summaryrefslogtreecommitdiffstats
path: root/web/server/h2o/libh2o/misc/oktavia
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 02:57:58 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 02:57:58 +0000
commitbe1c7e50e1e8809ea56f2c9d472eccd8ffd73a97 (patch)
tree9754ff1ca740f6346cf8483ec915d4054bc5da2d /web/server/h2o/libh2o/misc/oktavia
parentInitial commit. (diff)
downloadnetdata-be1c7e50e1e8809ea56f2c9d472eccd8ffd73a97.tar.xz
netdata-be1c7e50e1e8809ea56f2c9d472eccd8ffd73a97.zip
Adding upstream version 1.44.3.upstream/1.44.3upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'web/server/h2o/libh2o/misc/oktavia')
-rw-r--r--web/server/h2o/libh2o/misc/oktavia/.gitignore1
-rw-r--r--web/server/h2o/libh2o/misc/oktavia/.proverc4
-rw-r--r--web/server/h2o/libh2o/misc/oktavia/.travis.yml12
-rw-r--r--web/server/h2o/libh2o/misc/oktavia/LICENSE.rst22
-rw-r--r--web/server/h2o/libh2o/misc/oktavia/Makefile54
-rw-r--r--web/server/h2o/libh2o/misc/oktavia/README.rst78
-rwxr-xr-xweb/server/h2o/libh2o/misc/oktavia/bin/httpstatus7032
-rwxr-xr-xweb/server/h2o/libh2o/misc/oktavia/bin/oktavia-mkindex25034
-rwxr-xr-xweb/server/h2o/libh2o/misc/oktavia/bin/oktavia-search24779
-rw-r--r--web/server/h2o/libh2o/misc/oktavia/lib/oktavia-danish-search.js8023
-rw-r--r--web/server/h2o/libh2o/misc/oktavia/lib/oktavia-dutch-search.js8423
-rw-r--r--web/server/h2o/libh2o/misc/oktavia/lib/oktavia-english-search.js8922
-rw-r--r--web/server/h2o/libh2o/misc/oktavia/lib/oktavia-finnish-search.js8609
-rw-r--r--web/server/h2o/libh2o/misc/oktavia/lib/oktavia-french-search.js9061
-rw-r--r--web/server/h2o/libh2o/misc/oktavia/lib/oktavia-german-search.js8352
-rw-r--r--web/server/h2o/libh2o/misc/oktavia/lib/oktavia-hungarian-search.js8599
-rw-r--r--web/server/h2o/libh2o/misc/oktavia/lib/oktavia-italian-search.js8633
-rw-r--r--web/server/h2o/libh2o/misc/oktavia/lib/oktavia-jquery-highlight.js105
-rw-r--r--web/server/h2o/libh2o/misc/oktavia/lib/oktavia-jquery-ui.js521
-rw-r--r--web/server/h2o/libh2o/misc/oktavia/lib/oktavia-norwegian-search.js7952
-rw-r--r--web/server/h2o/libh2o/misc/oktavia/lib/oktavia-porter-search.js8494
-rw-r--r--web/server/h2o/libh2o/misc/oktavia/lib/oktavia-portuguese-search.js8566
-rw-r--r--web/server/h2o/libh2o/misc/oktavia/lib/oktavia-romanian-search.js8488
-rw-r--r--web/server/h2o/libh2o/misc/oktavia/lib/oktavia-russian-search.js8254
-rw-r--r--web/server/h2o/libh2o/misc/oktavia/lib/oktavia-search.js6795
-rw-r--r--web/server/h2o/libh2o/misc/oktavia/lib/oktavia-spanish-search.js8607
-rw-r--r--web/server/h2o/libh2o/misc/oktavia/lib/oktavia-swedish-search.js7934
-rw-r--r--web/server/h2o/libh2o/misc/oktavia/lib/oktavia-turkish-search.js10729
-rw-r--r--web/server/h2o/libh2o/misc/oktavia/lib/searchstyle.css174
-rw-r--r--web/server/h2o/libh2o/misc/oktavia/package.json23
-rw-r--r--web/server/h2o/libh2o/misc/oktavia/resource/favicon.ai1176
-rw-r--r--web/server/h2o/libh2o/misc/oktavia/resource/oktavia.epsbin0 -> 702054 bytes
-rw-r--r--web/server/h2o/libh2o/misc/oktavia/resource/oktavia_large.jpgbin0 -> 91592 bytes
-rw-r--r--web/server/h2o/libh2o/misc/oktavia/resource/oktavia_medium.jpgbin0 -> 38493 bytes
-rw-r--r--web/server/h2o/libh2o/misc/oktavia/resource/oktavia_small.jpgbin0 -> 39534 bytes
-rw-r--r--web/server/h2o/libh2o/misc/oktavia/src/binary-util.jsx597
-rw-r--r--web/server/h2o/libh2o/misc/oktavia/src/bit-vector.jsx295
-rw-r--r--web/server/h2o/libh2o/misc/oktavia/src/burrows-wheeler-transform.jsx73
-rw-r--r--web/server/h2o/libh2o/misc/oktavia/src/csvparser.jsx22
-rw-r--r--web/server/h2o/libh2o/misc/oktavia/src/fm-index.jsx323
-rw-r--r--web/server/h2o/libh2o/misc/oktavia/src/getopt.jsx356
-rw-r--r--web/server/h2o/libh2o/misc/oktavia/src/htmlparser.jsx280
-rw-r--r--web/server/h2o/libh2o/misc/oktavia/src/metadata.jsx498
-rw-r--r--web/server/h2o/libh2o/misc/oktavia/src/node-sqlite3.jsx115
-rw-r--r--web/server/h2o/libh2o/misc/oktavia/src/oktavia.jsx427
-rw-r--r--web/server/h2o/libh2o/misc/oktavia/src/query-parser.jsx60
-rw-r--r--web/server/h2o/libh2o/misc/oktavia/src/query-string-parser.jsx128
-rw-r--r--web/server/h2o/libh2o/misc/oktavia/src/query.jsx37
-rw-r--r--web/server/h2o/libh2o/misc/oktavia/src/sais.jsx250
-rw-r--r--web/server/h2o/libh2o/misc/oktavia/src/sax.jsx1356
-rw-r--r--web/server/h2o/libh2o/misc/oktavia/src/search-result.jsx287
-rw-r--r--web/server/h2o/libh2o/misc/oktavia/src/stemmer/among.jsx34
-rw-r--r--web/server/h2o/libh2o/misc/oktavia/src/stemmer/base-stemmer.jsx419
-rw-r--r--web/server/h2o/libh2o/misc/oktavia/src/stemmer/danish-stemmer.jsx507
-rw-r--r--web/server/h2o/libh2o/misc/oktavia/src/stemmer/dutch-stemmer.jsx1020
-rw-r--r--web/server/h2o/libh2o/misc/oktavia/src/stemmer/english-stemmer.jsx1638
-rw-r--r--web/server/h2o/libh2o/misc/oktavia/src/stemmer/finnish-stemmer.jsx1208
-rw-r--r--web/server/h2o/libh2o/misc/oktavia/src/stemmer/french-stemmer.jsx1867
-rw-r--r--web/server/h2o/libh2o/misc/oktavia/src/stemmer/german-stemmer.jsx894
-rw-r--r--web/server/h2o/libh2o/misc/oktavia/src/stemmer/hungarian-stemmer.jsx1478
-rw-r--r--web/server/h2o/libh2o/misc/oktavia/src/stemmer/italian-stemmer.jsx1412
-rw-r--r--web/server/h2o/libh2o/misc/oktavia/src/stemmer/norwegian-stemmer.jsx428
-rw-r--r--web/server/h2o/libh2o/misc/oktavia/src/stemmer/porter-stemmer.jsx1121
-rw-r--r--web/server/h2o/libh2o/misc/oktavia/src/stemmer/portuguese-stemmer.jsx1321
-rw-r--r--web/server/h2o/libh2o/misc/oktavia/src/stemmer/romanian-stemmer.jsx1227
-rw-r--r--web/server/h2o/libh2o/misc/oktavia/src/stemmer/russian-stemmer.jsx875
-rw-r--r--web/server/h2o/libh2o/misc/oktavia/src/stemmer/spanish-stemmer.jsx1408
-rw-r--r--web/server/h2o/libh2o/misc/oktavia/src/stemmer/stemmer.jsx5
-rw-r--r--web/server/h2o/libh2o/misc/oktavia/src/stemmer/swedish-stemmer.jsx416
-rw-r--r--web/server/h2o/libh2o/misc/oktavia/src/stemmer/turkish-stemmer.jsx3824
-rw-r--r--web/server/h2o/libh2o/misc/oktavia/src/style.jsx105
-rw-r--r--web/server/h2o/libh2o/misc/oktavia/src/textparser.jsx25
-rw-r--r--web/server/h2o/libh2o/misc/oktavia/src/tiny-segmenter.jsx350
-rw-r--r--web/server/h2o/libh2o/misc/oktavia/src/wavelet-matrix.jsx321
-rw-r--r--web/server/h2o/libh2o/misc/oktavia/templates/jsdoc3/README.md1
-rw-r--r--web/server/h2o/libh2o/misc/oktavia/templates/jsdoc3/publish.js508
-rw-r--r--web/server/h2o/libh2o/misc/oktavia/templates/jsdoc3/static/scripts/jquery-1.9.1.min.js5
-rw-r--r--web/server/h2o/libh2o/misc/oktavia/templates/jsdoc3/static/scripts/oktavia-english-search.js8922
-rw-r--r--web/server/h2o/libh2o/misc/oktavia/templates/jsdoc3/static/scripts/oktavia-jquery-highlight.js105
-rw-r--r--web/server/h2o/libh2o/misc/oktavia/templates/jsdoc3/static/scripts/oktavia-jquery-ui.js521
-rw-r--r--web/server/h2o/libh2o/misc/oktavia/templates/jsdoc3/static/scripts/prettify/Apache-License-2.0.txt202
-rw-r--r--web/server/h2o/libh2o/misc/oktavia/templates/jsdoc3/static/scripts/prettify/lang-css.js2
-rw-r--r--web/server/h2o/libh2o/misc/oktavia/templates/jsdoc3/static/scripts/prettify/prettify.js28
-rw-r--r--web/server/h2o/libh2o/misc/oktavia/templates/jsdoc3/static/styles/jsdoc-default.css283
-rw-r--r--web/server/h2o/libh2o/misc/oktavia/templates/jsdoc3/static/styles/prettify-jsdoc.css111
-rw-r--r--web/server/h2o/libh2o/misc/oktavia/templates/jsdoc3/static/styles/prettify-tomorrow.css132
-rw-r--r--web/server/h2o/libh2o/misc/oktavia/templates/jsdoc3/static/styles/searchstyle.css174
-rw-r--r--web/server/h2o/libh2o/misc/oktavia/templates/jsdoc3/tmpl/container.tmpl154
-rw-r--r--web/server/h2o/libh2o/misc/oktavia/templates/jsdoc3/tmpl/details.tmpl98
-rw-r--r--web/server/h2o/libh2o/misc/oktavia/templates/jsdoc3/tmpl/example.tmpl2
-rw-r--r--web/server/h2o/libh2o/misc/oktavia/templates/jsdoc3/tmpl/examples.tmpl11
-rw-r--r--web/server/h2o/libh2o/misc/oktavia/templates/jsdoc3/tmpl/exceptions.tmpl19
-rw-r--r--web/server/h2o/libh2o/misc/oktavia/templates/jsdoc3/tmpl/fires.tmpl4
-rw-r--r--web/server/h2o/libh2o/misc/oktavia/templates/jsdoc3/tmpl/layout.tmpl45
-rw-r--r--web/server/h2o/libh2o/misc/oktavia/templates/jsdoc3/tmpl/mainpage.tmpl14
-rw-r--r--web/server/h2o/libh2o/misc/oktavia/templates/jsdoc3/tmpl/members.tmpl22
-rw-r--r--web/server/h2o/libh2o/misc/oktavia/templates/jsdoc3/tmpl/method.tmpl76
-rw-r--r--web/server/h2o/libh2o/misc/oktavia/templates/jsdoc3/tmpl/params.tmpl108
-rw-r--r--web/server/h2o/libh2o/misc/oktavia/templates/jsdoc3/tmpl/properties.tmpl107
-rw-r--r--web/server/h2o/libh2o/misc/oktavia/templates/jsdoc3/tmpl/returns.tmpl19
-rw-r--r--web/server/h2o/libh2o/misc/oktavia/templates/jsdoc3/tmpl/source.tmpl8
-rw-r--r--web/server/h2o/libh2o/misc/oktavia/templates/jsdoc3/tmpl/tutorial.tmpl19
-rw-r--r--web/server/h2o/libh2o/misc/oktavia/templates/jsdoc3/tmpl/type.tmpl7
-rw-r--r--web/server/h2o/libh2o/misc/oktavia/templates/sphinx/_static/oktavia-jquery-ui.js521
-rw-r--r--web/server/h2o/libh2o/misc/oktavia/templates/sphinx/_static/oktavia-search.js6795
-rw-r--r--web/server/h2o/libh2o/misc/oktavia/templates/sphinx/_static/searchstyle.css174
-rw-r--r--web/server/h2o/libh2o/misc/oktavia/templates/sphinx/_templates/layout.html12
-rw-r--r--web/server/h2o/libh2o/misc/oktavia/templates/sphinx/_templates/searchbox.html0
-rw-r--r--web/server/h2o/libh2o/misc/oktavia/templates/tinkerer/_static/oktavia-jquery-ui.js521
-rw-r--r--web/server/h2o/libh2o/misc/oktavia/templates/tinkerer/_static/oktavia-search.js6795
-rw-r--r--web/server/h2o/libh2o/misc/oktavia/templates/tinkerer/_static/searchstyle.css174
-rw-r--r--web/server/h2o/libh2o/misc/oktavia/templates/tinkerer/_templates/oktaviasearch.html8
-rw-r--r--web/server/h2o/libh2o/misc/oktavia/test/test-binary-util.jsx190
-rw-r--r--web/server/h2o/libh2o/misc/oktavia/test/test-bit-vector.jsx131
-rw-r--r--web/server/h2o/libh2o/misc/oktavia/test/test-burrows-wheeler-transform.jsx24
-rw-r--r--web/server/h2o/libh2o/misc/oktavia/test/test-fm-index.jsx250
-rw-r--r--web/server/h2o/libh2o/misc/oktavia/test/test-getopt.jsx84
-rw-r--r--web/server/h2o/libh2o/misc/oktavia/test/test-oktavia-block.jsx226
-rw-r--r--web/server/h2o/libh2o/misc/oktavia/test/test-oktavia-section.jsx235
-rw-r--r--web/server/h2o/libh2o/misc/oktavia/test/test-oktavia-splitter.jsx173
-rw-r--r--web/server/h2o/libh2o/misc/oktavia/test/test-oktavia-stemming.jsx55
-rw-r--r--web/server/h2o/libh2o/misc/oktavia/test/test-oktavia-table.jsx213
-rw-r--r--web/server/h2o/libh2o/misc/oktavia/test/test-query-parser.jsx92
-rw-r--r--web/server/h2o/libh2o/misc/oktavia/test/test-query-string-parser.jsx94
-rw-r--r--web/server/h2o/libh2o/misc/oktavia/test/test-sax.jsx147
-rw-r--r--web/server/h2o/libh2o/misc/oktavia/test/test-search-result.jsx159
-rw-r--r--web/server/h2o/libh2o/misc/oktavia/test/test-wavelet-matrix.jsx143
-rw-r--r--web/server/h2o/libh2o/misc/oktavia/testdata/jsx_literal.txt65
-rw-r--r--web/server/h2o/libh2o/misc/oktavia/testdata/jsx_operator.txt68
-rw-r--r--web/server/h2o/libh2o/misc/oktavia/testdata/jsx_primitive_type.txt68
-rw-r--r--web/server/h2o/libh2o/misc/oktavia/testdata/jsx_tutorial.txt213
-rw-r--r--web/server/h2o/libh2o/misc/oktavia/testdata/jsx_typeconversion.txt40
-rw-r--r--web/server/h2o/libh2o/misc/oktavia/tool/httpstatus.jsx130
-rw-r--r--web/server/h2o/libh2o/misc/oktavia/tool/oktavia-mkindex.jsx470
-rw-r--r--web/server/h2o/libh2o/misc/oktavia/tool/oktavia-search.jsx370
-rw-r--r--web/server/h2o/libh2o/misc/oktavia/tool/search_simple.jsx39
-rw-r--r--web/server/h2o/libh2o/misc/oktavia/tool/web/oktavia-danish-search.jsx10
-rw-r--r--web/server/h2o/libh2o/misc/oktavia/tool/web/oktavia-dutch-search.jsx10
-rw-r--r--web/server/h2o/libh2o/misc/oktavia/tool/web/oktavia-english-search.jsx10
-rw-r--r--web/server/h2o/libh2o/misc/oktavia/tool/web/oktavia-finnish-search.jsx10
-rw-r--r--web/server/h2o/libh2o/misc/oktavia/tool/web/oktavia-french-search.jsx10
-rw-r--r--web/server/h2o/libh2o/misc/oktavia/tool/web/oktavia-german-search.jsx10
-rw-r--r--web/server/h2o/libh2o/misc/oktavia/tool/web/oktavia-hungarian-search.jsx10
-rw-r--r--web/server/h2o/libh2o/misc/oktavia/tool/web/oktavia-italian-search.jsx10
-rw-r--r--web/server/h2o/libh2o/misc/oktavia/tool/web/oktavia-norwegian-search.jsx10
-rw-r--r--web/server/h2o/libh2o/misc/oktavia/tool/web/oktavia-porter-search.jsx10
-rw-r--r--web/server/h2o/libh2o/misc/oktavia/tool/web/oktavia-portuguese-search.jsx10
-rw-r--r--web/server/h2o/libh2o/misc/oktavia/tool/web/oktavia-romanian-search.jsx10
-rw-r--r--web/server/h2o/libh2o/misc/oktavia/tool/web/oktavia-russian-search.jsx10
-rw-r--r--web/server/h2o/libh2o/misc/oktavia/tool/web/oktavia-search.jsx327
-rw-r--r--web/server/h2o/libh2o/misc/oktavia/tool/web/oktavia-spanish-search.jsx10
-rw-r--r--web/server/h2o/libh2o/misc/oktavia/tool/web/oktavia-swedish-search.jsx10
-rw-r--r--web/server/h2o/libh2o/misc/oktavia/tool/web/oktavia-turkish-search.jsx10
153 files changed, 261336 insertions, 0 deletions
diff --git a/web/server/h2o/libh2o/misc/oktavia/.gitignore b/web/server/h2o/libh2o/misc/oktavia/.gitignore
new file mode 100644
index 00000000..10d00b57
--- /dev/null
+++ b/web/server/h2o/libh2o/misc/oktavia/.gitignore
@@ -0,0 +1 @@
+*.gz
diff --git a/web/server/h2o/libh2o/misc/oktavia/.proverc b/web/server/h2o/libh2o/misc/oktavia/.proverc
new file mode 100644
index 00000000..ab863e4f
--- /dev/null
+++ b/web/server/h2o/libh2o/misc/oktavia/.proverc
@@ -0,0 +1,4 @@
+--exec "jsx --add-search-path src --release --test" test/
+--ext .jsx
+--timer
+--color
diff --git a/web/server/h2o/libh2o/misc/oktavia/.travis.yml b/web/server/h2o/libh2o/misc/oktavia/.travis.yml
new file mode 100644
index 00000000..0cf13fe4
--- /dev/null
+++ b/web/server/h2o/libh2o/misc/oktavia/.travis.yml
@@ -0,0 +1,12 @@
+language: node_js
+node_js:
+ - 0.10
+ - 0.8
+
+# We want to be notified when something happens.
+notifications:
+ email:
+ - yoshiki@shibu.jp
+
+before_install:
+ - npm install jsx
diff --git a/web/server/h2o/libh2o/misc/oktavia/LICENSE.rst b/web/server/h2o/libh2o/misc/oktavia/LICENSE.rst
new file mode 100644
index 00000000..5db7f172
--- /dev/null
+++ b/web/server/h2o/libh2o/misc/oktavia/LICENSE.rst
@@ -0,0 +1,22 @@
+The MIT License
+===============
+
+Copyright (c) 2013 Yoshiki Shibukawa (DeNA Co.,Ltd, and ngmoco LLC)
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/web/server/h2o/libh2o/misc/oktavia/Makefile b/web/server/h2o/libh2o/misc/oktavia/Makefile
new file mode 100644
index 00000000..b0fecfb8
--- /dev/null
+++ b/web/server/h2o/libh2o/misc/oktavia/Makefile
@@ -0,0 +1,54 @@
+JSX=jsx
+NPM=npm
+
+stemmers = danish dutch english finnish french german hungarian \
+ italian \
+ norwegian porter portuguese romanian \
+ russian spanish swedish turkish
+
+build: bin/httpstatus bin/oktavia-mkindex bin/oktavia-search libs template-files
+
+.PHONY: test clean
+
+bin/%: tool/%.jsx
+ $(JSX) --release --executable node --add-search-path ./src --output $@ $<
+
+libs: lib/oktavia-search.js $(stemmers:%=lib/oktavia-%-search.js) template-files
+
+lib/oktavia-search.js: tool/web/oktavia-search.jsx
+ $(JSX) --release --executable web --add-search-path ./src --output $@ $<
+
+lib/oktavia-%-search.js: tool/web/oktavia-%-search.jsx
+ $(JSX) --release --executable web --add-search-path ./src --output $@ $<
+
+template-files: templates/jsdoc3/static/scripts/oktavia-search.js templates/sphinx/_static/oktavia-search.js templates/tinkerer/_static/oktavia-search.js
+
+templates/jsdoc3/static/scripts/oktavia-search.js: lib/oktavia-english-search.js
+ cp lib/oktavia-english-search.js templates/jsdoc3/static/scripts/
+ cp lib/oktavia-jquery-ui.js templates/jsdoc3/static/scripts/
+ cp lib/oktavia-jquery-highlight.js templates/jsdoc3/static/scripts/
+ cp lib/searchstyle.css templates/jsdoc3/static/styles/
+
+templates/sphinx/_static/oktavia-search.js: lib/oktavia-search.js
+ cp lib/oktavia-search.js templates/sphinx/_static/
+ cp lib/oktavia-jquery-ui.js templates/sphinx/_static/
+ cp lib/searchstyle.css templates/sphinx/_static/
+
+templates/tinkerer/_static/oktavia-search.js: lib/oktavia-search.js
+ cp lib/oktavia-search.js templates/tinkerer/_static/
+ cp lib/oktavia-jquery-ui.js templates/tinkerer/_static/
+ cp lib/searchstyle.css templates/tinkerer/_static/
+
+test:
+ prove
+
+test-jsdoc:
+ rm -rf out;./node_modules/jsdoc/jsdoc -t templates/jsdoc3 --verbose lib/oktavia-jquery-ui.js
+ bin/oktavia-mkindex -i out -m html -c 5 -o scripts -f "#main" -t js -r out
+
+clean:
+ rm bin/httpstatus || true
+ rm bin/oktavia-mkindex || true
+ rm bin/oktavia-search || true
+ rm $(stemmers:%=lib/oktavia-%-search.js) || true
+ rm lib/oktavia-search.js || true
diff --git a/web/server/h2o/libh2o/misc/oktavia/README.rst b/web/server/h2o/libh2o/misc/oktavia/README.rst
new file mode 100644
index 00000000..4617c550
--- /dev/null
+++ b/web/server/h2o/libh2o/misc/oktavia/README.rst
@@ -0,0 +1,78 @@
+Oktavia
+=======
+
+.. image:: https://travis-ci.org/shibukawa/oktavia.png?branch=master
+
+:version: 0.5
+
+Oktavia is a full text search engine for JavaScript environment. It uses FM-Index.
+
+Usage
+-----
+
+See following pages:
+
+English Site: http://oktavia.info
+Japanese Site: http://oktavia.info/ja/
+
+Current Status
+--------------
+
+It can work as the search engine.
+
+Now it is an alpha version. Not optimized yet.
+
+I am planning to implement following features:
+
+* Improve file size and speed, portability
+
+ * Use MessagePack as a container format
+
+* Word Splitter option
+
+ * Standard
+ * CJK
+
+* Index Generator
+
+ * Standart Text (file, block, line)
+ * CSV (column, line)
+ * reST (sections, paragraph, code-block, etc...)
+
+ I hate markdown.
+
+* Custom schema support
+* Python/Sphinx version
+
+Development
+-----------
+
+Build
+~~~~~
+
+.. code-block:: bash
+
+ $ make
+
+Run test
+~~~~~~~~
+
+.. code-block:: bash
+
+ $ prove
+
+License
+-------
+
+This source code is released under MIT License.
+
+.. include:: LICENSE.rst
+
+Thanks
+------
+
+BitVector, WaveletMatrix, FM-Index included in this repository are ported from Shellinford
+(developed by @echizen_tm). Thank you!
+
+* https://code.google.com/p/shellinford/
+
diff --git a/web/server/h2o/libh2o/misc/oktavia/bin/httpstatus b/web/server/h2o/libh2o/misc/oktavia/bin/httpstatus
new file mode 100755
index 00000000..40d13cd7
--- /dev/null
+++ b/web/server/h2o/libh2o/misc/oktavia/bin/httpstatus
@@ -0,0 +1,7032 @@
+#!/usr/bin/env node
+// generatedy by JSX compiler 0.9.24 (2013-04-05 13:45:00 +0900; 1b229cc6a411f674f0f7cf7a79b7a8b3f8eb7414)
+var JSX = {};
+(function (JSX) {
+/**
+ * copies the implementations from source interface to target
+ */
+function $__jsx_merge_interface(target, source) {
+ for (var k in source.prototype)
+ if (source.prototype.hasOwnProperty(k))
+ target.prototype[k] = source.prototype[k];
+}
+
+/**
+ * defers the initialization of the property
+ */
+function $__jsx_lazy_init(obj, prop, func) {
+ function reset(obj, prop, value) {
+ delete obj[prop];
+ obj[prop] = value;
+ return value;
+ }
+
+ Object.defineProperty(obj, prop, {
+ get: function () {
+ return reset(obj, prop, func());
+ },
+ set: function (v) {
+ reset(obj, prop, v);
+ },
+ enumerable: true,
+ configurable: true
+ });
+}
+
+/**
+ * sideeffect().a /= b
+ */
+function $__jsx_div_assign(obj, prop, divisor) {
+ return obj[prop] = (obj[prop] / divisor) | 0;
+}
+
+/*
+ * global functions, renamed to avoid conflict with local variable names
+ */
+var $__jsx_parseInt = parseInt;
+var $__jsx_parseFloat = parseFloat;
+var $__jsx_isNaN = isNaN;
+var $__jsx_isFinite = isFinite;
+
+var $__jsx_encodeURIComponent = encodeURIComponent;
+var $__jsx_decodeURIComponent = decodeURIComponent;
+var $__jsx_encodeURI = encodeURI;
+var $__jsx_decodeURI = decodeURI;
+
+var $__jsx_ObjectToString = Object.prototype.toString;
+var $__jsx_ObjectHasOwnProperty = Object.prototype.hasOwnProperty;
+
+/*
+ * profiler object, initialized afterwards
+ */
+function $__jsx_profiler() {
+}
+
+/*
+ * public interface to JSX code
+ */
+JSX.require = function (path) {
+ var m = $__jsx_classMap[path];
+ return m !== undefined ? m : null;
+};
+
+JSX.profilerIsRunning = function () {
+ return $__jsx_profiler.getResults != null;
+};
+
+JSX.getProfileResults = function () {
+ return ($__jsx_profiler.getResults || function () { return {}; })();
+};
+
+JSX.postProfileResults = function (url, cb) {
+ if ($__jsx_profiler.postResults == null)
+ throw new Error("profiler has not been turned on");
+ return $__jsx_profiler.postResults(url, cb);
+};
+
+JSX.resetProfileResults = function () {
+ if ($__jsx_profiler.resetResults == null)
+ throw new Error("profiler has not been turned on");
+ return $__jsx_profiler.resetResults();
+};
+JSX.DEBUG = false;
+/**
+ * class HTTPStatus extends Object
+ * @constructor
+ */
+function HTTPStatus() {
+}
+
+/**
+ * @constructor
+ */
+function HTTPStatus$() {
+ /** @type {Oktavia} */
+ var this$0;
+ /** @type {Stemmer} */
+ var stemmer$0;
+ /** @type {Oktavia} */
+ var oktavia$0;
+ this.splitter = null;
+ this.httpstatus = null;
+ oktavia$0 = this.oktavia = new Oktavia$();
+ this$0 = oktavia$0;
+ stemmer$0 = new EnglishStemmer$();
+ this$0._stemmer = stemmer$0;
+ this.splitter = this.oktavia.addSplitter$S('line break');
+ this.makeIndex$();
+};
+
+HTTPStatus$.prototype = new HTTPStatus;
+
+/**
+ */
+HTTPStatus.prototype.makeIndex$ = function () {
+ /** @type {!number} */
+ var i;
+ /** @type {Splitter} */
+ var this$0;
+ /** @type {!number} */
+ var index$0$0;
+ /** @type {Oktavia} */
+ var this$0$0;
+ /** @type {FMIndex} */
+ var this$0$0$0;
+ /** @type {Oktavia} */
+ var this$1;
+ this.httpstatus = [ "100: Continue", "101: Switching Protocols", "102: Processing", "200: OK", "201: Created", "202: Accepted", "203: Non-Authoritative Information", "204: No Content", "205: Reset Content", "206: Partial Content", "207: Multi-Status", "208: Already Reported", "300: Multiple Choices", "301: Moved Permanently", "302: Found", "303: See Other", "304: Not Modified", "305: Use Proxy", "307: Temporary Redirect", "400: Bad Request", "401: Unauthorized", "402: Payment Required", "403: Forbidden", "404: Not Found", "405: Method Not Allowed", "406: Not Acceptable", "407: Proxy Authentication Required", "408: Request Timeout", "409: Conflict", "410: Gone", "411: Length Required", "412: Precondition Failed", "413: Request Entity Too Large", "414: Request-URI Too Large", "415: Unsupported Media Type", "416: Request Range Not Satisfiable", "417: Expectation Failed", "418: I'm a teapot", "422: Unprocessable Entity", "423: Locked", "424: Failed Dependency", "425: No code", "426: Upgrade Required", "428: Precondition Required", "429: Too Many Requests", "431: Request Header Fields Too Large", "449: Retry with", "500: Internal Server Error", "501: Not Implemented", "502: Bad Gateway", "503: Service Unavailable", "504: Gateway Timeout", "505: HTTP Version Not Supported", "506: Variant Also Negotiates", "507: Insufficient Storage", "509: Bandwidth Limit Exceeded", "510: Not Extended" ];
+ for (i in this.httpstatus) {
+ this.oktavia.addWord$SB(this.httpstatus[i], true);
+ this$0 = this.splitter;
+ this$0$0 = this$0._parent;
+ this$0$0$0 = this$0$0._fmindex;
+ index$0$0 = this$0$0$0._substr.length;
+ this$0._bitVector.set$I(index$0$0 - 1);
+ }
+ this$1 = this.oktavia;
+ this$1.build$IB(5, false);
+};
+
+/**
+ * @param {Array.<undefined|!string>} words
+ * @return {!string}
+ */
+HTTPStatus.prototype.search$AS = function (words) {
+ /** @type {QueryParser} */
+ var queryParser;
+ /** @type {Array.<undefined|Query>} */
+ var queries;
+ /** @type {!string} */
+ var result;
+ /** @type {SearchSummary} */
+ var summary;
+ /** @type {Array.<undefined|!string>} */
+ var resultWords;
+ /** @type {!number} */
+ var i;
+ queryParser = ({queries: [ ]});
+ queries = QueryParser$parse$LQueryParser$AS(queryParser, words);
+ if (queries.length === 0) {
+ result = this.httpstatus.join('\n');
+ result = result + "\n\nToday's status: " + this.httpstatus[Math.round(Math.random() * this.httpstatus.length)];
+ return result;
+ } else {
+ summary = this.oktavia.search$ALQuery$(queries);
+ if (SearchSummary$size$LSearchSummary$(summary) === 0) {
+ return "not found ";
+ }
+ resultWords = [ ];
+ for (i in summary.result.unitIds) {
+ resultWords.push(this.splitter.getContent$I(summary.result.unitIds[i]));
+ }
+ return resultWords.join('\n');
+ }
+};
+
+/**
+ * @return {!string}
+ */
+HTTPStatus.prototype.random$ = function () {
+ return this.httpstatus[Math.round(Math.random() * this.httpstatus.length)];
+};
+
+/**
+ * class _Main extends Object
+ * @constructor
+ */
+function _Main() {
+}
+
+/**
+ * @constructor
+ */
+function _Main$() {
+};
+
+_Main$.prototype = new _Main;
+
+/**
+ * @param {Array.<undefined|!string>} argv
+ */
+_Main.main$AS = function (argv) {
+ /** @type {HTTPStatus} */
+ var httpstatus;
+ httpstatus = new HTTPStatus$();
+ console.log(httpstatus.search$AS(argv));
+};
+
+var _Main$main$AS = _Main.main$AS;
+
+/**
+ * class Oktavia extends Object
+ * @constructor
+ */
+function Oktavia() {
+}
+
+/**
+ * @constructor
+ */
+function Oktavia$() {
+ /** @type {Array.<undefined|!string>} */
+ var _utf162compressCode$0;
+ this._compressCode2utf16 = null;
+ this._fmindex = new FMIndex$();
+ this._metadatas = ({ });
+ this._metadataLabels = [ ];
+ this._stemmer = null;
+ this._stemmingResult = ({ });
+ _utf162compressCode$0 = this._utf162compressCode = [ Oktavia.eof, Oktavia.eob, Oktavia.unknown ];
+ _utf162compressCode$0.length = 65536;
+ this._compressCode2utf16 = [ Oktavia.eof, Oktavia.eob, Oktavia.unknown ];
+};
+
+Oktavia$.prototype = new Oktavia;
+
+/**
+ * @param {Stemmer} stemmer
+ */
+Oktavia.prototype.setStemmer$LStemmer$ = function (stemmer) {
+ this._stemmer = stemmer;
+};
+
+/**
+ * @return {Metadata}
+ */
+Oktavia.prototype.getPrimaryMetadata$ = function () {
+ return this._metadatas[this._metadataLabels[0]];
+};
+
+/**
+ * @param {!string} key
+ * @return {Section}
+ */
+Oktavia.prototype.addSection$S = function (key) {
+ /** @type {Section} */
+ var section;
+ if (this._metadataLabels.indexOf(key) !== -1) {
+ throw new Error('Metadata name ' + key + ' is already exists');
+ }
+ this._metadataLabels.push(key);
+ section = new Section$LOktavia$(this);
+ this._metadatas[key] = section;
+ return section;
+};
+
+/**
+ * @param {!string} key
+ * @return {Section}
+ */
+Oktavia.prototype.getSection$S = function (key) {
+ if (this._metadataLabels.indexOf(key) === -1) {
+ throw new Error('Metadata name ' + key + " does't exists");
+ }
+ return this._metadatas[key];
+};
+
+/**
+ * @param {!string} key
+ * @return {Splitter}
+ */
+Oktavia.prototype.addSplitter$S = function (key) {
+ /** @type {Splitter} */
+ var splitter;
+ if (this._metadataLabels.indexOf(key) !== -1) {
+ throw new Error('Metadata name ' + key + ' is already exists');
+ }
+ this._metadataLabels.push(key);
+ splitter = new Splitter$LOktavia$(this);
+ this._metadatas[key] = splitter;
+ return splitter;
+};
+
+/**
+ * @param {!string} key
+ * @return {Splitter}
+ */
+Oktavia.prototype.getSplitter$S = function (key) {
+ if (this._metadataLabels.indexOf(key) === -1) {
+ throw new Error('Metadata name ' + key + " does't exists");
+ }
+ return this._metadatas[key];
+};
+
+/**
+ * @param {!string} key
+ * @param {Array.<undefined|!string>} headers
+ * @return {Table}
+ */
+Oktavia.prototype.addTable$SAS = function (key, headers) {
+ /** @type {Table} */
+ var table;
+ if (this._metadataLabels.indexOf(key) !== -1) {
+ throw new Error('Metadata name ' + key + ' is already exists');
+ }
+ this._metadataLabels.push(key);
+ table = new Table$LOktavia$AS(this, headers);
+ this._metadatas[key] = table;
+ return table;
+};
+
+/**
+ * @param {!string} key
+ * @return {Table}
+ */
+Oktavia.prototype.getTable$S = function (key) {
+ if (this._metadataLabels.indexOf(key) === -1) {
+ throw new Error('Metadata name ' + key + " does't exists");
+ }
+ return this._metadatas[key];
+};
+
+/**
+ * @param {!string} key
+ * @return {Block}
+ */
+Oktavia.prototype.addBlock$S = function (key) {
+ /** @type {Block} */
+ var block;
+ if (this._metadataLabels.indexOf(key) !== -1) {
+ throw new Error('Metadata name ' + key + ' is already exists');
+ }
+ this._metadataLabels.push(key);
+ block = new Block$LOktavia$(this);
+ this._metadatas[key] = block;
+ return block;
+};
+
+/**
+ * @param {!string} key
+ * @return {Block}
+ */
+Oktavia.prototype.getBlock$S = function (key) {
+ if (this._metadataLabels.indexOf(key) === -1) {
+ throw new Error('Metadata name ' + key + " does't exists");
+ }
+ return this._metadatas[key];
+};
+
+/**
+ */
+Oktavia.prototype.addEndOfBlock$ = function () {
+ this._fmindex.push$S(Oktavia.eob);
+};
+
+/**
+ * @param {!string} words
+ */
+Oktavia.prototype.addWord$S = function (words) {
+ /** @type {Array.<undefined|!string>} */
+ var str;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var charCode;
+ /** @type {undefined|!string} */
+ var newCharCode;
+ str = [ ];
+ str.length = words.length;
+ for (i = 0; i < words.length; i++) {
+ charCode = words.charCodeAt(i);
+ newCharCode = this._utf162compressCode[charCode];
+ if (newCharCode == null) {
+ newCharCode = String.fromCharCode(this._compressCode2utf16.length);
+ this._utf162compressCode[charCode] = newCharCode;
+ this._compressCode2utf16.push(String.fromCharCode(charCode));
+ }
+ str.push(newCharCode);
+ }
+ this._fmindex.push$S(str.join(''));
+};
+
+/**
+ * @param {!string} words
+ * @param {!boolean} stemming
+ */
+Oktavia.prototype.addWord$SB = function (words, stemming) {
+ /** @type {Array.<undefined|!string>} */
+ var wordList;
+ /** @type {!number} */
+ var i;
+ /** @type {undefined|!string} */
+ var originalWord;
+ /** @type {!string} */
+ var smallWord;
+ /** @type {undefined|!string} */
+ var registerWord;
+ /** @type {!string} */
+ var baseWord;
+ /** @type {!string} */
+ var compressedCodeWord;
+ /** @type {Array.<undefined|!string>} */
+ var stemmedList;
+ this.addWord$S(words);
+ wordList = words.split(/\s+/);
+ for (i = 0; i < wordList.length; i++) {
+ originalWord = wordList[i];
+ smallWord = originalWord.slice(0, 1).toLowerCase() + originalWord.slice(1);
+ registerWord = null;
+ if (stemming && this._stemmer) {
+ baseWord = this._stemmer.stemWord$S(originalWord.toLowerCase());
+ if (originalWord.indexOf(baseWord) === -1) {
+ registerWord = baseWord;
+ }
+ } else {
+ if (originalWord != smallWord) {
+ registerWord = smallWord;
+ }
+ }
+ if (registerWord) {
+ compressedCodeWord = this._convertToCompressionCode$S(originalWord);
+ stemmedList = this._stemmingResult[registerWord];
+ if (! stemmedList) {
+ stemmedList = [ compressedCodeWord ];
+ this._stemmingResult[registerWord] = stemmedList;
+ } else {
+ if (stemmedList.indexOf(compressedCodeWord) === -1) {
+ stemmedList.push(compressedCodeWord);
+ }
+ }
+ }
+ }
+};
+
+/**
+ * @param {!string} keyword
+ * @return {!string}
+ */
+Oktavia.prototype._convertToCompressionCode$S = function (keyword) {
+ /** @type {Array.<undefined|!string>} */
+ var resultChars;
+ /** @type {!number} */
+ var i;
+ /** @type {undefined|!string} */
+ var chr;
+ resultChars = [ ];
+ for (i = 0; i < keyword.length; i++) {
+ chr = this._utf162compressCode[keyword.charCodeAt(i)];
+ if (chr == null) {
+ resultChars.push(Oktavia.unknown);
+ } else {
+ resultChars.push(chr);
+ }
+ }
+ return resultChars.join('');
+};
+
+/**
+ * @param {!string} keyword
+ * @param {!boolean} stemming
+ * @return {Array.<undefined|!number>}
+ */
+Oktavia.prototype.rawSearch$SB = function (keyword, stemming) {
+ /** @type {Array.<undefined|!number>} */
+ var result;
+ /** @type {!string} */
+ var baseWord;
+ /** @type {Array.<undefined|!string>} */
+ var stemmedList;
+ /** @type {!number} */
+ var i;
+ /** @type {undefined|!string} */
+ var word;
+ if (stemming) {
+ result = [ ];
+ if (this._stemmer) {
+ baseWord = this._stemmer.stemWord$S(keyword.toLowerCase());
+ stemmedList = this._stemmingResult[baseWord];
+ if (stemmedList) {
+ for (i = 0; i < stemmedList.length; i++) {
+ word = stemmedList[i];
+ result = result.concat(this._fmindex.search$S(word));
+ }
+ }
+ }
+ } else {
+ result = this._fmindex.search$S(this._convertToCompressionCode$S(keyword));
+ }
+ return result;
+};
+
+/**
+ * @param {Array.<undefined|Query>} queries
+ * @return {SearchSummary}
+ */
+Oktavia.prototype.search$ALQuery$ = function (queries) {
+ /** @type {SearchSummary} */
+ var summary;
+ /** @type {!number} */
+ var i;
+ /** @type {SingleResult} */
+ var result$0;
+ summary = ({sourceResults: [ ], result: null, oktavia: this});
+ for (i = 0; i < queries.length; i++) {
+ result$0 = this._searchQuery$LQuery$(queries[i]);
+ summary.sourceResults.push(result$0);
+ }
+ summary.result = SearchSummary$mergeResult$LSearchSummary$ALSingleResult$(summary, summary.sourceResults);
+ return summary;
+};
+
+/**
+ * @param {Query} query
+ * @return {SingleResult}
+ */
+Oktavia.prototype._searchQuery$LQuery$ = function (query) {
+ /** @type {SingleResult} */
+ var result;
+ /** @type {Array.<undefined|!number>} */
+ var positions;
+ result = new SingleResult$SBB(query.word, query.or, query.not);
+ if (query.raw) {
+ positions = this.rawSearch$SB(query.word, false);
+ } else {
+ positions = this.rawSearch$SB(query.word, false).concat(this.rawSearch$SB(query.word, true));
+ }
+ this._metadatas[this._metadataLabels[0]].grouping$LSingleResult$AISB(result, positions, query.word, ! query.raw);
+ return result;
+};
+
+/**
+ */
+Oktavia.prototype.build$ = function () {
+ this.build$IB(5, false);
+};
+
+/**
+ * @param {!number} cacheDensity
+ * @param {!boolean} verbose
+ */
+Oktavia.prototype.build$IB = function (cacheDensity, verbose) {
+ /** @type {!string} */
+ var key;
+ /** @type {!number} */
+ var cacheRange;
+ /** @type {!number} */
+ var maxChar;
+ for (key in this._metadatas) {
+ this._metadatas[key]._build$();
+ }
+ cacheRange = Math.round(Math.max(1, 100 / Math.min(100, Math.max(0.01, cacheDensity))));
+ maxChar = this._compressCode2utf16.length;
+ this._fmindex.build$SIIB(Oktavia.eof, maxChar, cacheRange, verbose);
+};
+
+/**
+ * @return {!string}
+ */
+Oktavia.prototype.dump$ = function () {
+ return this.dump$B(false);
+};
+
+/**
+ * @param {!boolean} verbose
+ * @return {!string}
+ */
+Oktavia.prototype.dump$B = function (verbose) {
+ /** @type {!string} */
+ var header;
+ /** @type {!string} */
+ var fmdata;
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var i;
+ /** @type {CompressionReport} */
+ var report;
+ /** @type {undefined|!string} */
+ var name;
+ /** @type {!string} */
+ var data;
+ header = Binary$dumpString$SLCompressionReport$("oktavia-01", null).slice(1);
+ if (verbose) {
+ console.log("Source text size: " + (this._fmindex.size$() * 2 + "") + ' bytes');
+ }
+ fmdata = this._fmindex.dump$B(verbose);
+ result = [ header, fmdata ];
+ result.push(Binary$dump16bitNumber$I(this._compressCode2utf16.length));
+ for (i = 3; i < this._compressCode2utf16.length; i++) {
+ result.push(this._compressCode2utf16[i]);
+ }
+ if (verbose) {
+ console.log('Char Code Map: ' + (this._compressCode2utf16.length * 2 - 2 + "") + ' bytes');
+ }
+ report = ({source: 0, result: 0});
+ result.push(Binary$dumpStringListMap$HASLCompressionReport$(this._stemmingResult, report));
+ if (verbose) {
+ console.log('Stemmed Word Table: ' + (result[result.length - 1].length + "") + ' bytes (' + (Math.round(report.result * 100.0 / report.source) + "") + '%)');
+ }
+ result.push(Binary$dump16bitNumber$I(this._metadataLabels.length));
+ for (i = 0; i < this._metadataLabels.length; i++) {
+ report = ({source: 0, result: 0});
+ name = this._metadataLabels[i];
+ data = this._metadatas[name]._dump$LCompressionReport$(report);
+ result.push(Binary$dumpString$SLCompressionReport$(name, report), data);
+ if (verbose) {
+ console.log('Meta Data ' + name + ': ' + (data.length * 2 + "") + ' bytes (' + (Math.round(report.result * 100.0 / report.source) + "") + '%)');
+ }
+ }
+ return result.join('');
+};
+
+/**
+ * @param {!string} data
+ */
+Oktavia.prototype.load$S = function (data) {
+ /** @type {!string} */
+ var header;
+ /** @type {!number} */
+ var offset;
+ /** @type {!number} */
+ var charCodeCount;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var charCode;
+ /** @type {LoadedStringListMapResult} */
+ var stemmedWords;
+ /** @type {!number} */
+ var metadataCount;
+ /** @type {LoadedStringResult} */
+ var nameResult;
+ /** @type {!string} */
+ var name;
+ /** @type {!number} */
+ var type;
+ header = Binary$dumpString$SLCompressionReport$("oktavia-01", null).slice(1);
+ if (data.slice(0, 5) !== header) {
+ throw new Error('Invalid data file');
+ }
+ this._metadatas = ({ });
+ this._metadataLabels = [ ];
+ offset = 5;
+ offset = this._fmindex.load$SI(data, offset);
+ charCodeCount = Binary$load16bitNumber$SI(data, offset++);
+ this._compressCode2utf16 = [ Oktavia.eof, Oktavia.eob, Oktavia.unknown ];
+ this._utf162compressCode = [ Oktavia.eof, Oktavia.eob, Oktavia.unknown ];
+ for (i = 3; i < charCodeCount; i++) {
+ charCode = Binary$load16bitNumber$SI(data, offset++);
+ this._compressCode2utf16.push(String.fromCharCode(charCode));
+ this._utf162compressCode[charCode] = String.fromCharCode(i);
+ }
+ stemmedWords = Binary$loadStringListMap$SI(data, offset);
+ this._stemmingResult = stemmedWords.result;
+ offset = stemmedWords.offset;
+ metadataCount = Binary$load16bitNumber$SI(data, offset++);
+ for (i = 0; i < metadataCount; i++) {
+ nameResult = Binary$loadString$SI(data, offset);
+ name = nameResult.result;
+ offset = nameResult.offset;
+ type = Binary$load16bitNumber$SI(data, offset++);
+ switch (type) {
+ case 0:
+ offset = Section$_load$LOktavia$SSI(this, name, data, offset);
+ break;
+ case 1:
+ offset = Splitter$_load$LOktavia$SSI(this, name, data, offset);
+ break;
+ case 2:
+ offset = Table$_load$LOktavia$SSI(this, name, data, offset);
+ break;
+ case 3:
+ offset = Block$_load$LOktavia$SSI(this, name, data, offset);
+ break;
+ }
+ }
+};
+
+/**
+ * @return {!number}
+ */
+Oktavia.prototype.contentSize$ = function () {
+ /** @type {FMIndex} */
+ var this$0;
+ this$0 = this._fmindex;
+ return this$0._substr.length;
+};
+
+/**
+ * @param {!number} position
+ * @return {!number}
+ */
+Oktavia.prototype.wordPositionType$I = function (position) {
+ /** @type {!number} */
+ var result;
+ /** @type {!string} */
+ var ahead;
+ result = 0;
+ if (position === 0) {
+ result = 4;
+ } else {
+ ahead = this._fmindex.getSubstring$II(position - 1, 1);
+ if (/\s/.test(ahead)) {
+ result = 2;
+ } else {
+ if (/\W/.test(ahead)) {
+ result = 1;
+ } else {
+ if (Oktavia.eob === ahead) {
+ result = 3;
+ }
+ }
+ }
+ }
+ return (result | 0);
+};
+
+/**
+ * @param {!number} position
+ * @param {!number} length
+ * @return {!string}
+ */
+Oktavia.prototype._getSubstring$II = function (position, length) {
+ /** @type {!string} */
+ var result;
+ /** @type {Array.<undefined|!string>} */
+ var str;
+ /** @type {!number} */
+ var i;
+ result = this._fmindex.getSubstring$II(position, length);
+ str = [ ];
+ for (i = 0; i < result.length; i++) {
+ str.push(this._compressCode2utf16[result.charCodeAt(i)]);
+ }
+ return str.join('');
+};
+
+/**
+ * class Metadata extends Object
+ * @constructor
+ */
+function Metadata() {
+}
+
+/**
+ * @constructor
+ * @param {Oktavia} parent
+ */
+function Metadata$LOktavia$(parent) {
+ this._parent = parent;
+ this._bitVector = new BitVector$();
+};
+
+Metadata$LOktavia$.prototype = new Metadata;
+
+/**
+ * @return {!number}
+ */
+Metadata.prototype._size$ = function () {
+ /** @type {BitVector} */
+ var this$0;
+ /** @type {!number} */
+ var i$0;
+ /** @type {BitVector} */
+ var _bitVector$0;
+ this$0 = _bitVector$0 = this._bitVector;
+ i$0 = _bitVector$0._size;
+ return this$0.rank$IB(i$0, true);
+};
+
+/**
+ * @param {!number} index
+ * @return {!string}
+ */
+Metadata.prototype.getContent$I = function (index) {
+ /** @type {!number} */
+ var startPosition;
+ /** @type {!number} */
+ var length;
+ if (index < 0 || this._size$() <= index) {
+ throw new Error("Section.getContent() : range error " + (index + ""));
+ }
+ startPosition = 0;
+ if (index > 0) {
+ startPosition = this._bitVector.select$I(index - 1) + 1;
+ }
+ length = this._bitVector.select$I(index) - startPosition + 1;
+ return this._parent._getSubstring$II(startPosition, length);
+};
+
+/**
+ * @param {!number} index
+ * @return {!number}
+ */
+Metadata.prototype.getStartPosition$I = function (index) {
+ /** @type {!number} */
+ var startPosition;
+ if (index < 0 || this._size$() <= index) {
+ throw new Error("Section.getContent() : range error " + (index + ""));
+ }
+ startPosition = 0;
+ if (index > 0) {
+ startPosition = this._bitVector.select$I(index - 1) + 1;
+ }
+ return (startPosition | 0);
+};
+
+/**
+ * @param {SingleResult} result
+ * @param {Array.<undefined|!number>} positions
+ * @param {!string} word
+ * @param {!boolean} stemmed
+ */
+Metadata.prototype.grouping$LSingleResult$AISB = function (result, positions, word, stemmed) {
+};
+
+/**
+ * @param {!number} index
+ * @return {!string}
+ */
+Metadata.prototype.getInformation$I = function (index) {
+ return '';
+};
+
+/**
+ */
+Metadata.prototype._build$ = function () {
+ this._bitVector.build$();
+};
+
+/**
+ * @param {!string} name
+ * @param {!string} data
+ * @param {!number} offset
+ * @return {!number}
+ */
+Metadata.prototype._load$SSI = function (name, data, offset) {
+ offset = this._bitVector.load$SI(data, offset);
+ this._parent._metadataLabels.push(name);
+ this._parent._metadatas[name] = this;
+ return offset;
+};
+
+/**
+ * @return {!string}
+ */
+Metadata.prototype._dump$ = function () {
+ /** @type {BitVector} */
+ var this$0;
+ /** @type {Array.<undefined|!string>} */
+ var contents$0;
+ this$0 = this._bitVector;
+ contents$0 = [ ];
+ contents$0.push(Binary$dump32bitNumber$N(this$0._size));
+ contents$0.push(Binary$dump32bitNumberList$AN(this$0._v));
+ return contents$0.join('');
+};
+
+/**
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+Metadata.prototype._dump$LCompressionReport$ = function (report) {
+ /** @type {BitVector} */
+ var this$0;
+ /** @type {Array.<undefined|!string>} */
+ var contents$0;
+ this$0 = this._bitVector;
+ contents$0 = [ ];
+ contents$0.push(Binary$dump32bitNumber$N(this$0._size));
+ CompressionReport$add$LCompressionReport$II(report, 2, 2);
+ contents$0.push(Binary$dump32bitNumberList$ANLCompressionReport$(this$0._v, report));
+ return contents$0.join('');
+};
+
+/**
+ * class Section extends Metadata
+ * @constructor
+ */
+function Section() {
+}
+
+Section.prototype = new Metadata;
+/**
+ * @constructor
+ * @param {Oktavia} parent
+ */
+function Section$LOktavia$(parent) {
+ this._parent = parent;
+ this._bitVector = new BitVector$();
+ this._names = [ ];
+};
+
+Section$LOktavia$.prototype = new Section;
+
+/**
+ * @param {!string} name
+ */
+Section.prototype.setTail$S = function (name) {
+ /** @type {!number} */
+ var index$0;
+ /** @type {Oktavia} */
+ var this$0;
+ /** @type {FMIndex} */
+ var this$0$0;
+ this$0 = this._parent;
+ this$0$0 = this$0._fmindex;
+ index$0 = this$0$0._substr.length;
+ this._names.push(name);
+ this._bitVector.set$I(index$0 - 1);
+};
+
+/**
+ * @param {!string} name
+ * @param {!number} index
+ */
+Section.prototype.setTail$SI = function (name, index) {
+ this._names.push(name);
+ this._bitVector.set$I(index - 1);
+};
+
+/**
+ * @return {!number}
+ */
+Section.prototype.size$ = function () {
+ return (this._names.length | 0);
+};
+
+/**
+ * @param {!number} position
+ * @return {!number}
+ */
+Section.prototype.getSectionIndex$I = function (position) {
+ /** @type {BitVector} */
+ var this$0;
+ if (position < 0 || this._bitVector.size$() <= position) {
+ throw new Error("Section.getSectionIndex() : range error " + (position + ""));
+ }
+ this$0 = this._bitVector;
+ return this$0.rank$IB(position, true);
+};
+
+/**
+ * @param {!number} index
+ * @return {!string}
+ */
+Section.prototype.getName$I = function (index) {
+ if (index < 0 || this._names.length <= index) {
+ throw new Error("Section.getName() : range error");
+ }
+ return this._names[index];
+};
+
+/**
+ * @param {SingleResult} result
+ * @param {Array.<undefined|!number>} positions
+ * @param {!string} word
+ * @param {!boolean} stemmed
+ */
+Section.prototype.grouping$LSingleResult$AISB = function (result, positions, word, stemmed) {
+ /** @type {!number} */
+ var i;
+ /** @type {undefined|!number} */
+ var position;
+ /** @type {!number} */
+ var index;
+ /** @type {SearchUnit} */
+ var unit;
+ for (i = 0; i < positions.length; i++) {
+ position = positions[i];
+ index = this.getSectionIndex$I(position);
+ unit = SingleResult$getSearchUnit$LSingleResult$I(result, index);
+ if (unit.startPosition < 0) {
+ unit.startPosition = this.getStartPosition$I(index);
+ }
+ SearchUnit$addPosition$LSearchUnit$SIB(unit, word, position - unit.startPosition, stemmed);
+ }
+};
+
+/**
+ * @param {!number} index
+ * @return {!string}
+ */
+Section.prototype.getInformation$I = function (index) {
+ return this.getName$I(index);
+};
+
+/**
+ * @param {Oktavia} parent
+ * @param {!string} name
+ * @param {!string} data
+ * @param {!number} offset
+ * @return {!number}
+ */
+Section._load$LOktavia$SSI = function (parent, name, data, offset) {
+ /** @type {LoadedStringListResult} */
+ var strs;
+ /** @type {Section} */
+ var section;
+ /** @type {!number} */
+ var offset$0;
+ strs = new LoadedStringListResult$SI(data, offset);
+ section = new Section$LOktavia$(parent);
+ section._names = strs.result;
+ offset$0 = strs.offset;
+ offset$0 = section._bitVector.load$SI(data, offset$0);
+ section._parent._metadataLabels.push(name);
+ section._parent._metadatas[name] = section;
+ return offset$0;
+};
+
+var Section$_load$LOktavia$SSI = Section._load$LOktavia$SSI;
+
+/**
+ * @return {!string}
+ */
+Section.prototype._dump$ = function () {
+ return [ Binary$dump16bitNumber$I(0), Binary$dumpStringList$AS(this._names), Metadata.prototype._dump$.call(this) ].join('');
+};
+
+/**
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+Section.prototype._dump$LCompressionReport$ = function (report) {
+ CompressionReport$add$LCompressionReport$II(report, 1, 1);
+ return [ Binary$dump16bitNumber$I(0), Binary$dumpStringList$ASLCompressionReport$(this._names, report), Metadata.prototype._dump$LCompressionReport$.call(this, report) ].join('');
+};
+
+/**
+ * class Splitter extends Metadata
+ * @constructor
+ */
+function Splitter() {
+}
+
+Splitter.prototype = new Metadata;
+/**
+ * @constructor
+ * @param {Oktavia} parent
+ */
+function Splitter$LOktavia$(parent) {
+ this._parent = parent;
+ this._bitVector = new BitVector$();
+ this.name = null;
+};
+
+Splitter$LOktavia$.prototype = new Splitter;
+
+/**
+ * @constructor
+ * @param {Oktavia} parent
+ * @param {!string} name
+ */
+function Splitter$LOktavia$S(parent, name) {
+ this._parent = parent;
+ this._bitVector = new BitVector$();
+ this.name = name;
+};
+
+Splitter$LOktavia$S.prototype = new Splitter;
+
+/**
+ * @return {!number}
+ */
+Splitter.prototype.size$ = function () {
+ /** @type {BitVector} */
+ var this$0$0;
+ /** @type {!number} */
+ var i$0$0;
+ /** @type {BitVector} */
+ var _bitVector$0;
+ this$0$0 = _bitVector$0 = this._bitVector;
+ i$0$0 = _bitVector$0._size;
+ return this$0$0.rank$IB(i$0$0, true);
+};
+
+/**
+ */
+Splitter.prototype.split$ = function () {
+ /** @type {!number} */
+ var index$0;
+ /** @type {Oktavia} */
+ var this$0;
+ /** @type {FMIndex} */
+ var this$0$0;
+ this$0 = this._parent;
+ this$0$0 = this$0._fmindex;
+ index$0 = this$0$0._substr.length;
+ this._bitVector.set$I(index$0 - 1);
+};
+
+/**
+ * @param {!number} index
+ */
+Splitter.prototype.split$I = function (index) {
+ this._bitVector.set$I(index - 1);
+};
+
+/**
+ * @param {!number} position
+ * @return {!number}
+ */
+Splitter.prototype.getIndex$I = function (position) {
+ /** @type {BitVector} */
+ var this$0;
+ if (position < 0 || this._bitVector.size$() <= position) {
+ throw new Error("Section.getSectionIndex() : range error");
+ }
+ this$0 = this._bitVector;
+ return this$0.rank$IB(position, true);
+};
+
+/**
+ * @param {SingleResult} result
+ * @param {Array.<undefined|!number>} positions
+ * @param {!string} word
+ * @param {!boolean} stemmed
+ */
+Splitter.prototype.grouping$LSingleResult$AISB = function (result, positions, word, stemmed) {
+ /** @type {!number} */
+ var i;
+ /** @type {undefined|!number} */
+ var position;
+ /** @type {!number} */
+ var index;
+ /** @type {SearchUnit} */
+ var unit;
+ for (i = 0; i < positions.length; i++) {
+ position = positions[i];
+ index = this.getIndex$I(position);
+ unit = SingleResult$getSearchUnit$LSingleResult$I(result, index);
+ if (unit.startPosition < 0) {
+ unit.startPosition = this.getStartPosition$I(index);
+ }
+ SearchUnit$addPosition$LSearchUnit$SIB(unit, word, position - unit.startPosition, stemmed);
+ }
+};
+
+/**
+ * @param {!number} index
+ * @return {!string}
+ */
+Splitter.prototype.getInformation$I = function (index) {
+ return (this.name != null ? this.name + (index + 1 + "") : '');
+};
+
+/**
+ * @param {Oktavia} parent
+ * @param {!string} name
+ * @param {!string} data
+ * @param {!number} offset
+ * @return {!number}
+ */
+Splitter._load$LOktavia$SSI = function (parent, name, data, offset) {
+ /** @type {Splitter} */
+ var section;
+ section = new Splitter$LOktavia$(parent);
+ offset = section._bitVector.load$SI(data, offset);
+ section._parent._metadataLabels.push(name);
+ section._parent._metadatas[name] = section;
+ return offset;
+};
+
+var Splitter$_load$LOktavia$SSI = Splitter._load$LOktavia$SSI;
+
+/**
+ * @return {!string}
+ */
+Splitter.prototype._dump$ = function () {
+ return [ Binary$dump16bitNumber$I(1), Metadata.prototype._dump$.call(this) ].join('');
+};
+
+/**
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+Splitter.prototype._dump$LCompressionReport$ = function (report) {
+ CompressionReport$add$LCompressionReport$II(report, 1, 1);
+ return [ Binary$dump16bitNumber$I(1), Metadata.prototype._dump$LCompressionReport$.call(this, report) ].join('');
+};
+
+/**
+ * class Table extends Metadata
+ * @constructor
+ */
+function Table() {
+}
+
+Table.prototype = new Metadata;
+/**
+ * @constructor
+ * @param {Oktavia} parent
+ * @param {Array.<undefined|!string>} headers
+ */
+function Table$LOktavia$AS(parent, headers) {
+ this._parent = parent;
+ this._bitVector = new BitVector$();
+ this._headers = headers;
+ this._columnTails = new BitVector$();
+};
+
+Table$LOktavia$AS.prototype = new Table;
+
+/**
+ * @return {!number}
+ */
+Table.prototype.rowSize$ = function () {
+ /** @type {BitVector} */
+ var this$0$0;
+ /** @type {!number} */
+ var i$0$0;
+ /** @type {BitVector} */
+ var _bitVector$0;
+ this$0$0 = _bitVector$0 = this._bitVector;
+ i$0$0 = _bitVector$0._size;
+ return this$0$0.rank$IB(i$0$0, true);
+};
+
+/**
+ * @return {!number}
+ */
+Table.prototype.columnSize$ = function () {
+ return (this._headers.length | 0);
+};
+
+/**
+ */
+Table.prototype.setColumnTail$ = function () {
+ /** @type {!number} */
+ var index;
+ /** @type {Oktavia} */
+ var this$0;
+ /** @type {FMIndex} */
+ var this$0$0;
+ /** @type {Oktavia} */
+ var _parent$0;
+ this$0 = _parent$0 = this._parent;
+ this$0$0 = this$0._fmindex;
+ index = this$0$0._substr.length;
+ _parent$0._fmindex.push$S(Oktavia.eob);
+ this._columnTails.set$I(index - 1);
+};
+
+/**
+ */
+Table.prototype.setRowTail$ = function () {
+ /** @type {!number} */
+ var index;
+ /** @type {Oktavia} */
+ var this$0;
+ /** @type {FMIndex} */
+ var this$0$0;
+ this$0 = this._parent;
+ this$0$0 = this$0._fmindex;
+ index = this$0$0._substr.length;
+ this._bitVector.set$I(index - 1);
+};
+
+/**
+ * @param {!number} position
+ * @return {Array.<undefined|!number>}
+ */
+Table.prototype.getCell$I = function (position) {
+ /** @type {!number} */
+ var row;
+ /** @type {!number} */
+ var currentColumn;
+ /** @type {!number} */
+ var lastRowColumn;
+ /** @type {!number} */
+ var startPosition;
+ /** @type {Array.<undefined|!number>} */
+ var result;
+ /** @type {BitVector} */
+ var this$0;
+ /** @type {BitVector} */
+ var this$1;
+ if (position < 0 || this._bitVector.size$() <= position) {
+ throw new Error("Section.getSectionIndex() : range error " + (position + ""));
+ }
+ this$0 = this._bitVector;
+ row = this$0.rank$IB(position, true);
+ this$1 = this._columnTails;
+ currentColumn = this$1.rank$IB(position, true);
+ lastRowColumn = 0;
+ if (row > 0) {
+ startPosition = this._bitVector.select$I(row - 1) + 1;
+ lastRowColumn = this._columnTails.rank$I(startPosition);
+ }
+ result = [ row, currentColumn - lastRowColumn ];
+ return result;
+};
+
+/**
+ * @param {!number} rowIndex
+ * @return {Object.<string, undefined|!string>}
+ */
+Table.prototype.getRowContent$I = function (rowIndex) {
+ /** @type {!string} */
+ var content;
+ /** @type {Array.<undefined|!string>} */
+ var values;
+ /** @type {Object.<string, undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var i;
+ content = this.getContent$I(rowIndex);
+ values = content.split(Oktavia.eob, this._headers.length);
+ result = ({ });
+ for (i in this._headers) {
+ if (i < values.length) {
+ result[this._headers[i]] = values[i];
+ } else {
+ result[this._headers[i]] = '';
+ }
+ }
+ return result;
+};
+
+/**
+ * @param {SingleResult} result
+ * @param {Array.<undefined|!number>} positions
+ * @param {!string} word
+ * @param {!boolean} stemmed
+ */
+Table.prototype.grouping$LSingleResult$AISB = function (result, positions, word, stemmed) {
+};
+
+/**
+ * @param {!number} index
+ * @return {!string}
+ */
+Table.prototype.getInformation$I = function (index) {
+ return '';
+};
+
+/**
+ */
+Table.prototype._build$ = function () {
+ this._bitVector.build$();
+ this._columnTails.build$();
+};
+
+/**
+ * @param {Oktavia} parent
+ * @param {!string} name
+ * @param {!string} data
+ * @param {!number} offset
+ * @return {!number}
+ */
+Table._load$LOktavia$SSI = function (parent, name, data, offset) {
+ /** @type {LoadedStringListResult} */
+ var strs;
+ /** @type {Table} */
+ var table;
+ /** @type {!number} */
+ var offset$0;
+ strs = new LoadedStringListResult$SI(data, offset);
+ table = new Table$LOktavia$AS(parent, strs.result);
+ offset$0 = strs.offset;
+ offset$0 = table._bitVector.load$SI(data, offset$0);
+ table._parent._metadataLabels.push(name);
+ table._parent._metadatas[name] = table;
+ offset = offset$0;
+ return table._columnTails.load$SI(data, offset$0);
+};
+
+var Table$_load$LOktavia$SSI = Table._load$LOktavia$SSI;
+
+/**
+ * @return {!string}
+ */
+Table.prototype._dump$ = function () {
+ return [ Binary$dump16bitNumber$I(2), Binary$dumpStringList$AS(this._headers), Metadata.prototype._dump$.call(this), this._columnTails.dump$() ].join('');
+};
+
+/**
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+Table.prototype._dump$LCompressionReport$ = function (report) {
+ CompressionReport$add$LCompressionReport$II(report, 1, 1);
+ return [ Binary$dump16bitNumber$I(2), Binary$dumpStringList$ASLCompressionReport$(this._headers, report), Metadata.prototype._dump$LCompressionReport$.call(this, report), this._columnTails.dump$LCompressionReport$(report) ].join('');
+};
+
+/**
+ * class Block extends Metadata
+ * @constructor
+ */
+function Block() {
+}
+
+Block.prototype = new Metadata;
+/**
+ * @constructor
+ * @param {Oktavia} parent
+ */
+function Block$LOktavia$(parent) {
+ this._parent = parent;
+ this._bitVector = new BitVector$();
+ this._names = [ ];
+ this._start = false;
+};
+
+Block$LOktavia$.prototype = new Block;
+
+/**
+ * @param {!string} blockName
+ */
+Block.prototype.startBlock$S = function (blockName) {
+ this.startBlock$SI(blockName, this._parent.contentSize$());
+};
+
+/**
+ * @param {!string} blockName
+ * @param {!number} index
+ */
+Block.prototype.startBlock$SI = function (blockName, index) {
+ if (this._start) {
+ throw new Error('Splitter `' + this._names[this._names.length - 1] + '` is not closed');
+ }
+ this._start = true;
+ this._names.push(blockName);
+ this._bitVector.set$I(index - 1);
+};
+
+/**
+ */
+Block.prototype.endBlock$ = function () {
+ this.endBlock$I(this._parent.contentSize$());
+};
+
+/**
+ * @param {!number} index
+ */
+Block.prototype.endBlock$I = function (index) {
+ if (! this._start) {
+ throw new Error('Splitter is not started');
+ }
+ this._start = false;
+ this._bitVector.set$I(index - 1);
+};
+
+/**
+ * @return {!number}
+ */
+Block.prototype.size$ = function () {
+ return (this._names.length | 0);
+};
+
+/**
+ * @param {!number} position
+ * @return {!number}
+ */
+Block.prototype.blockIndex$I = function (position) {
+ /** @type {!number} */
+ var result;
+ /** @type {BitVector} */
+ var this$0;
+ if (position < 0 || this._parent._fmindex.size$() - 1 <= position) {
+ throw new Error("Block.blockIndex() : range error " + (position + ""));
+ }
+ if (position >= this._bitVector.size$()) {
+ position = (this._bitVector.size$() - 1 | 0);
+ result = (this._bitVector.rank$I(position) + 1 | 0);
+ } else {
+ this$0 = this._bitVector;
+ result = this$0.rank$IB(position, true);
+ }
+ return result;
+};
+
+/**
+ * @param {!number} position
+ * @return {!boolean}
+ */
+Block.prototype.inBlock$I = function (position) {
+ /** @type {!number} */
+ var blockIndex;
+ blockIndex = this.blockIndex$I(position);
+ return blockIndex % 2 !== 0;
+};
+
+/**
+ * @param {!number} position
+ * @return {!string}
+ */
+Block.prototype.getBlockContent$I = function (position) {
+ /** @type {!number} */
+ var blockIndex;
+ /** @type {!string} */
+ var result;
+ blockIndex = this.blockIndex$I(position);
+ if (blockIndex % 2 !== 0) {
+ result = this.getContent$I(blockIndex);
+ } else {
+ result = '';
+ }
+ return result;
+};
+
+/**
+ * @param {!number} position
+ * @return {!string}
+ */
+Block.prototype.getBlockName$I = function (position) {
+ /** @type {!number} */
+ var blockIndex;
+ /** @type {!string} */
+ var result;
+ blockIndex = this.blockIndex$I(position);
+ if (blockIndex % 2 !== 0) {
+ result = this._names[blockIndex >>> 1];
+ } else {
+ result = '';
+ }
+ return result;
+};
+
+/**
+ * @param {SingleResult} result
+ * @param {Array.<undefined|!number>} positions
+ * @param {!string} word
+ * @param {!boolean} stemmed
+ */
+Block.prototype.grouping$LSingleResult$AISB = function (result, positions, word, stemmed) {
+};
+
+/**
+ * @param {!number} index
+ * @return {!string}
+ */
+Block.prototype.getInformation$I = function (index) {
+ return '';
+};
+
+/**
+ * @param {Oktavia} parent
+ * @param {!string} name
+ * @param {!string} data
+ * @param {!number} offset
+ * @return {!number}
+ */
+Block._load$LOktavia$SSI = function (parent, name, data, offset) {
+ /** @type {LoadedStringListResult} */
+ var strs;
+ /** @type {Block} */
+ var block;
+ /** @type {!number} */
+ var offset$0;
+ strs = new LoadedStringListResult$SI(data, offset);
+ block = new Block$LOktavia$(parent);
+ block._names = strs.result;
+ offset$0 = strs.offset;
+ offset$0 = block._bitVector.load$SI(data, offset$0);
+ block._parent._metadataLabels.push(name);
+ block._parent._metadatas[name] = block;
+ return offset$0;
+};
+
+var Block$_load$LOktavia$SSI = Block._load$LOktavia$SSI;
+
+/**
+ * @return {!string}
+ */
+Block.prototype._dump$ = function () {
+ return [ Binary$dump16bitNumber$I(3), Binary$dumpStringList$AS(this._names), Metadata.prototype._dump$.call(this) ].join('');
+};
+
+/**
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+Block.prototype._dump$LCompressionReport$ = function (report) {
+ CompressionReport$add$LCompressionReport$II(report, 1, 1);
+ return [ Binary$dump16bitNumber$I(3), Binary$dumpStringList$ASLCompressionReport$(this._names, report), Metadata.prototype._dump$LCompressionReport$.call(this, report) ].join('');
+};
+
+/**
+ * class QueryParser extends Object
+ * @constructor
+ */
+function QueryParser() {
+}
+
+/**
+ * @constructor
+ */
+function QueryParser$() {
+ this.queries = [ ];
+};
+
+QueryParser$.prototype = new QueryParser;
+
+/**
+ * @param {QueryParser} $this
+ * @param {Array.<undefined|!string>} queryStrings
+ * @return {Array.<undefined|Query>}
+ */
+QueryParser.parse$LQueryParser$AS = function ($this, queryStrings) {
+ /** @type {!boolean} */
+ var nextOr;
+ /** @type {!number} */
+ var i;
+ /** @type {undefined|!string} */
+ var word;
+ /** @type {Query} */
+ var query;
+ nextOr = false;
+ for (i = 0; i < queryStrings.length; i++) {
+ word = queryStrings[i];
+ if (word == 'OR') {
+ nextOr = true;
+ } else {
+ query = new Query$();
+ if (nextOr) {
+ query.or = true;
+ nextOr = false;
+ }
+ if (word.slice(0, 1) === '-') {
+ query.not = true;
+ word = word.slice(1);
+ }
+ if (word.slice(0, 1) === '"' && word.slice(word.length - 1) === '"') {
+ query.raw = true;
+ word = word.slice(1, word.length - 1);
+ }
+ query.word = word;
+ $this.queries.push(query);
+ }
+ }
+ return $this.queries;
+};
+
+var QueryParser$parse$LQueryParser$AS = QueryParser.parse$LQueryParser$AS;
+
+/**
+ * @param {QueryParser} $this
+ * @return {!string}
+ */
+QueryParser.highlight$LQueryParser$ = function ($this) {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var i;
+ /** @type {Query} */
+ var query;
+ result = [ ];
+ for (i = 0; i < $this.queries.length; i++) {
+ query = $this.queries[i];
+ if (! query.not) {
+ result.push("highlight=" + $__jsx_encodeURIComponent(query.word));
+ }
+ }
+ return '?' + result.join('&');
+};
+
+var QueryParser$highlight$LQueryParser$ = QueryParser.highlight$LQueryParser$;
+
+/**
+ * class FMIndex extends Object
+ * @constructor
+ */
+function FMIndex() {
+}
+
+/**
+ * @constructor
+ */
+function FMIndex$() {
+ /** @type {Array.<undefined|!number>} */
+ var _rlt$0;
+ this._ssize = 0;
+ (this._ddic = 0, this._head = 0);
+ this._substr = "";
+ this._sv = new WaveletMatrix$();
+ this._posdic = [ ];
+ this._idic = [ ];
+ _rlt$0 = this._rlt = [ ];
+ _rlt$0.length = 65536;
+};
+
+FMIndex$.prototype = new FMIndex;
+
+/**
+ */
+FMIndex.prototype.clear$ = function () {
+ /** @type {WaveletMatrix} */
+ var this$0;
+ this$0 = this._sv;
+ this$0._bv.length = 0;
+ this$0._seps.length = 0;
+ this$0._size = 0;
+ this._posdic.length = 0;
+ this._idic.length = 0;
+ this._ddic = 0;
+ this._head = 0;
+ this._substr = "";
+};
+
+/**
+ * @return {!number}
+ */
+FMIndex.prototype.size$ = function () {
+ /** @type {WaveletMatrix} */
+ var this$0;
+ this$0 = this._sv;
+ return this$0._size;
+};
+
+/**
+ * @return {!number}
+ */
+FMIndex.prototype.contentSize$ = function () {
+ return this._substr.length;
+};
+
+/**
+ * @param {!string} key
+ * @return {!number}
+ */
+FMIndex.prototype.getRows$S = function (key) {
+ /** @type {Array.<undefined|!number>} */
+ var pos;
+ pos = [ ];
+ return this.getRows$SAI(key, pos);
+};
+
+/**
+ * @param {!string} key
+ * @param {Array.<undefined|!number>} pos
+ * @return {!number}
+ */
+FMIndex.prototype.getRows$SAI = function (key, pos) {
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var code;
+ /** @type {!number} */
+ var first;
+ /** @type {undefined|!number} */
+ var last;
+ /** @type {!number} */
+ var c;
+ /** @type {Array.<undefined|!number>} */
+ var _rlt$0;
+ i = key.length - 1;
+ code = key.charCodeAt(i);
+ first = (_rlt$0 = this._rlt)[code] + 1;
+ last = _rlt$0[code + 1];
+ while (first <= last) {
+ if (i === 0) {
+ pos[0] = (-- first | 0);
+ pos[1] = -- last;
+ return (last - first + 1 | 0);
+ }
+ i--;
+ c = key.charCodeAt(i);
+ first = this._rlt[c] + this._sv.rank$II(first - 1, c) + 1;
+ last = this._rlt[c] + this._sv.rank$II(last, c);
+ }
+ return 0;
+};
+
+/**
+ * @param {!number} i
+ * @return {!number}
+ */
+FMIndex.prototype.getPosition$I = function (i) {
+ /** @type {!number} */
+ var pos;
+ /** @type {!number} */
+ var c;
+ if (i >= this.size$()) {
+ throw new Error("FMIndex.getPosition() : range error");
+ }
+ pos = 0;
+ while (i !== this._head) {
+ if (i % this._ddic === 0) {
+ pos += this._posdic[i / this._ddic] + 1;
+ break;
+ }
+ c = this._sv.get$I(i);
+ i = this._rlt[c] + this._sv.rank$II(i, c);
+ pos++;
+ }
+ return (pos % this.size$() | 0);
+};
+
+/**
+ * @param {!number} pos
+ * @param {!number} len
+ * @return {!string}
+ */
+FMIndex.prototype.getSubstring$II = function (pos, len) {
+ /** @type {!number} */
+ var pos_end;
+ /** @type {!number} */
+ var pos_tmp;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var pos_idic;
+ /** @type {!string} */
+ var substr;
+ /** @type {!number} */
+ var c;
+ /** @type {!number} */
+ var _ddic$0;
+ if (pos >= this.size$()) {
+ throw new Error("FMIndex.getSubstring() : range error");
+ }
+ pos_end = Math.min(pos + len, this.size$());
+ pos_tmp = this.size$() - 1;
+ i = this._head;
+ pos_idic = Math.floor((pos_end + (_ddic$0 = this._ddic) - 2) / _ddic$0);
+ if (pos_idic < this._idic.length) {
+ pos_tmp = pos_idic * this._ddic;
+ i = this._idic[pos_idic];
+ }
+ substr = "";
+ while (pos_tmp >= pos) {
+ c = this._sv.get$I(i);
+ i = this._rlt[c] + this._sv.rank$II(i, c);
+ if (pos_tmp < pos_end) {
+ substr = String.fromCharCode(c) + substr;
+ }
+ if (pos_tmp === 0) {
+ break;
+ }
+ pos_tmp--;
+ }
+ return substr;
+};
+
+/**
+ */
+FMIndex.prototype.build$ = function () {
+ this.build$SIIB(String.fromCharCode(0), 65535, 20, false);
+};
+
+/**
+ * @param {!string} end_marker
+ * @param {!number} ddic
+ * @param {!boolean} verbose
+ */
+FMIndex.prototype.build$SIB = function (end_marker, ddic, verbose) {
+ this.build$SIIB(end_marker, 65535, ddic, verbose);
+};
+
+/**
+ * @param {!string} end_marker
+ * @param {!number} maxChar
+ * @param {!number} ddic
+ * @param {!boolean} verbose
+ */
+FMIndex.prototype.build$SIIB = function (end_marker, maxChar, ddic, verbose) {
+ /** @type {BurrowsWheelerTransform} */
+ var b;
+ /** @type {!string} */
+ var s;
+ /** @type {!number} */
+ var c;
+ /** @type {!string} */
+ var str$0;
+ /** @type {WaveletMatrix} */
+ var this$0;
+ /** @type {!string} */
+ var _str$0;
+ /** @type {Array.<undefined|!number>} */
+ var _suffixarray$0;
+ if (verbose) {
+ console.time("building burrows-wheeler transform");
+ }
+ this._substr += end_marker;
+ b = ({_str: "", _size: 0, _head: 0, _suffixarray: [ ]});
+ str$0 = this._substr;
+ _str$0 = b._str = str$0;
+ b._size = _str$0.length;
+ _suffixarray$0 = b._suffixarray = SAIS$make$S(str$0);
+ b._head = (_suffixarray$0.indexOf(0) | 0);
+ s = BurrowsWheelerTransform$get$LBurrowsWheelerTransform$(b);
+ this._ssize = s.length;
+ this._head = b._head;
+ b._str = "";
+ b._size = 0;
+ b._head = 0;
+ b._suffixarray.length = 0;
+ this._substr = "";
+ if (verbose) {
+ console.timeEnd("building burrows-wheeler transform");
+ }
+ if (verbose) {
+ console.time("building wavelet matrix");
+ }
+ this$0 = this._sv;
+ this$0._bitsize = (Math.ceil(Math.log(maxChar) / 0.6931471805599453) | 0);
+ if (verbose) {
+ console.log(" maxCharCode: ", maxChar);
+ console.log(" bitSize: ", this._sv.bitsize$());
+ }
+ this._sv.build$S(s);
+ if (verbose) {
+ console.timeEnd("building wavelet matrix");
+ }
+ if (verbose) {
+ console.time("caching rank less than");
+ }
+ for (c = 0; c < maxChar; c++) {
+ this._rlt[c] = this._sv.rank_less_than$II(this._sv.size$(), c);
+ }
+ if (verbose) {
+ console.timeEnd("caching rank less than");
+ }
+ this._ddic = ddic;
+ if (verbose) {
+ console.time("building dictionaries");
+ }
+ this._buildDictionaries$();
+ if (verbose) {
+ console.timeEnd("building dictionaries");
+ console.log('');
+ }
+};
+
+/**
+ */
+FMIndex.prototype._buildDictionaries$ = function () {
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var pos;
+ /** @type {!number} */
+ var c;
+ for (i = 0; i < this._ssize / this._ddic + 1; i++) {
+ this._posdic.push(0);
+ this._idic.push(0);
+ }
+ i = this._head;
+ pos = this.size$() - 1;
+ do {
+ if (i % this._ddic === 0) {
+ this._posdic[Math.floor(i / this._ddic)] = (pos | 0);
+ }
+ if (pos % this._ddic === 0) {
+ this._idic[Math.floor(pos / this._ddic)] = (i | 0);
+ }
+ c = this._sv.get$I(i);
+ i = this._rlt[c] + this._sv.rank$II(i, c);
+ pos--;
+ } while (i !== this._head);
+};
+
+/**
+ * @param {!string} doc
+ */
+FMIndex.prototype.push$S = function (doc) {
+ if (doc.length <= 0) {
+ throw new Error("FMIndex::push(): empty string");
+ }
+ this._substr += doc;
+};
+
+/**
+ * @param {!string} keyword
+ * @return {Array.<undefined|!number>}
+ */
+FMIndex.prototype.search$S = function (keyword) {
+ /** @type {Array.<undefined|!number>} */
+ var result;
+ /** @type {Array.<undefined|!number>} */
+ var position;
+ /** @type {!number} */
+ var rows;
+ /** @type {undefined|!number} */
+ var first;
+ /** @type {undefined|!number} */
+ var last;
+ /** @type {undefined|!number} */
+ var i;
+ result = [ ];
+ position = [ ];
+ rows = this.getRows$SAI(keyword, position);
+ if (rows > 0) {
+ first = position[0];
+ last = position[1];
+ for (i = first; i <= last; i++) {
+ result.push(this.getPosition$I(i));
+ }
+ }
+ return result;
+};
+
+/**
+ * @return {!string}
+ */
+FMIndex.prototype.dump$ = function () {
+ return this.dump$B(false);
+};
+
+/**
+ * @param {!boolean} verbose
+ * @return {!string}
+ */
+FMIndex.prototype.dump$B = function (verbose) {
+ /** @type {Array.<undefined|!string>} */
+ var contents;
+ /** @type {CompressionReport} */
+ var report;
+ /** @type {!number} */
+ var i;
+ contents = [ ];
+ report = ({source: 0, result: 0});
+ contents.push(Binary$dump32bitNumber$N(this._ddic));
+ contents.push(Binary$dump32bitNumber$N(this._ssize));
+ contents.push(Binary$dump32bitNumber$N(this._head));
+ CompressionReport$add$LCompressionReport$II(report, 6, 6);
+ contents.push(this._sv.dump$LCompressionReport$(report));
+ if (verbose) {
+ console.log("Serializing FM-index");
+ console.log(' Wavelet Matrix: ' + (contents[3].length * 2 + "") + ' bytes (' + (Math.round(report.result * 100.0 / report.source) + "") + '%)');
+ }
+ contents.push(Binary$dump32bitNumber$N(this._posdic.length));
+ for (i in this._posdic) {
+ contents.push(Binary$dump32bitNumber$N(this._posdic[i]));
+ }
+ for (i in this._idic) {
+ contents.push(Binary$dump32bitNumber$N(this._idic[i]));
+ }
+ if (verbose) {
+ console.log(' Dictionary Cache: ' + (this._idic.length * 16 + "") + ' bytes');
+ }
+ return contents.join("");
+};
+
+/**
+ * @param {!string} data
+ * @return {!number}
+ */
+FMIndex.prototype.load$S = function (data) {
+ return this.load$SI(data, 0);
+};
+
+/**
+ * @param {!string} data
+ * @param {!number} offset
+ * @return {!number}
+ */
+FMIndex.prototype.load$SI = function (data, offset) {
+ /** @type {!number} */
+ var maxChar;
+ /** @type {!number} */
+ var c;
+ /** @type {!number} */
+ var size;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var result$0;
+ /** @type {!number} */
+ var result$1;
+ result$0 = data.charCodeAt(offset) * 65536 + data.charCodeAt(offset + 1);
+ this._ddic = (result$0 | 0);
+ this._ssize = (Binary$load32bitNumber$SI(data, offset + 2) | 0);
+ this._head = (Binary$load32bitNumber$SI(data, offset + 4) | 0);
+ offset = this._sv.load$SI(data, offset + 6);
+ maxChar = Math.pow(2, this._sv.bitsize$());
+ for (c = 0; c < maxChar; c++) {
+ this._rlt[c] = this._sv.rank_less_than$II(this._sv.size$(), c);
+ }
+ result$1 = data.charCodeAt(offset) * 65536 + data.charCodeAt(offset + 1);
+ size = result$1;
+ offset += 2;
+ for (i = 0; i < size; (i++, offset += 2)) {
+ this._posdic.push(Binary$load32bitNumber$SI(data, offset));
+ }
+ for (i = 0; i < size; (i++, offset += 2)) {
+ this._idic.push(Binary$load32bitNumber$SI(data, offset));
+ }
+ return offset;
+};
+
+/**
+ * class Binary extends Object
+ * @constructor
+ */
+function Binary() {
+}
+
+/**
+ * @constructor
+ */
+function Binary$() {
+};
+
+Binary$.prototype = new Binary;
+
+/**
+ * @param {!number} num
+ * @return {!string}
+ */
+Binary.dump32bitNumber$N = function (num) {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ result = [ String.fromCharCode(Math.floor(num / 65536)) ];
+ result.push(String.fromCharCode(num % 65536));
+ return result.join("");
+};
+
+var Binary$dump32bitNumber$N = Binary.dump32bitNumber$N;
+
+/**
+ * @param {!string} buffer
+ * @param {!number} offset
+ * @return {!number}
+ */
+Binary.load32bitNumber$SI = function (buffer, offset) {
+ /** @type {!number} */
+ var result;
+ result = buffer.charCodeAt(offset) * 65536 + buffer.charCodeAt(offset + 1);
+ return result;
+};
+
+var Binary$load32bitNumber$SI = Binary.load32bitNumber$SI;
+
+/**
+ * @param {!number} num
+ * @return {!string}
+ */
+Binary.dump16bitNumber$I = function (num) {
+ return String.fromCharCode(num % 65536);
+};
+
+var Binary$dump16bitNumber$I = Binary.dump16bitNumber$I;
+
+/**
+ * @param {!string} buffer
+ * @param {!number} offset
+ * @return {!number}
+ */
+Binary.load16bitNumber$SI = function (buffer, offset) {
+ return (buffer.charCodeAt(offset) | 0);
+};
+
+var Binary$load16bitNumber$SI = Binary.load16bitNumber$SI;
+
+/**
+ * @param {!string} str
+ * @return {!string}
+ */
+Binary.dumpString$S = function (str) {
+ return Binary$dumpString$SLCompressionReport$(str, null);
+};
+
+var Binary$dumpString$S = Binary.dumpString$S;
+
+/**
+ * @param {!string} str
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+Binary.dumpString$SLCompressionReport$ = function (str, report) {
+ /** @type {!number} */
+ var length;
+ /** @type {!boolean} */
+ var compress;
+ /** @type {Array.<undefined|!number>} */
+ var charCodes;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var charCode;
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {undefined|!number} */
+ var bytes;
+ if (str.length > 32768) {
+ str = str.slice(0, 32768);
+ }
+ length = str.length;
+ compress = true;
+ charCodes = [ ];
+ for (i = 0; i < length; i++) {
+ charCode = str.charCodeAt(i);
+ if (charCode > 255) {
+ compress = false;
+ break;
+ }
+ charCodes.push(charCode);
+ }
+ if (compress) {
+ result = [ Binary$dump16bitNumber$I(length + 32768) ];
+ for (i = 0; i < length; i += 2) {
+ bytes = charCodes[i];
+ if (i !== length - 1) {
+ bytes += charCodes[i + 1] << 8;
+ }
+ result.push(String.fromCharCode(bytes % 65536));
+ }
+ if (report) {
+ CompressionReport$add$LCompressionReport$II(report, length, Math.ceil(length / 2));
+ }
+ } else {
+ result = [ Binary$dump16bitNumber$I(length), str ];
+ if (report) {
+ CompressionReport$add$LCompressionReport$II(report, length, length);
+ }
+ }
+ return result.join('');
+};
+
+var Binary$dumpString$SLCompressionReport$ = Binary.dumpString$SLCompressionReport$;
+
+/**
+ * @param {!string} buffer
+ * @param {!number} offset
+ * @return {LoadedStringResult}
+ */
+Binary.loadString$SI = function (buffer, offset) {
+ return new LoadedStringResult$SI(buffer, offset);
+};
+
+var Binary$loadString$SI = Binary.loadString$SI;
+
+/**
+ * @param {Array.<undefined|!string>} strList
+ * @return {!string}
+ */
+Binary.dumpStringList$AS = function (strList) {
+ return Binary$dumpStringList$ASLCompressionReport$(strList, null);
+};
+
+var Binary$dumpStringList$AS = Binary.dumpStringList$AS;
+
+/**
+ * @param {Array.<undefined|!string>} strList
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+Binary.dumpStringList$ASLCompressionReport$ = function (strList, report) {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var i;
+ result = [ Binary$dump32bitNumber$N(strList.length) ];
+ for (i = 0; i < strList.length; i++) {
+ result.push(Binary$dumpString$SLCompressionReport$(strList[i], report));
+ }
+ return result.join('');
+};
+
+var Binary$dumpStringList$ASLCompressionReport$ = Binary.dumpStringList$ASLCompressionReport$;
+
+/**
+ * @param {!string} buffer
+ * @param {!number} offset
+ * @return {LoadedStringListResult}
+ */
+Binary.loadStringList$SI = function (buffer, offset) {
+ return new LoadedStringListResult$SI(buffer, offset);
+};
+
+var Binary$loadStringList$SI = Binary.loadStringList$SI;
+
+/**
+ * @param {Object.<string, undefined|Array.<undefined|!string>>} strMap
+ * @return {!string}
+ */
+Binary.dumpStringListMap$HAS = function (strMap) {
+ return Binary$dumpStringListMap$HASLCompressionReport$(strMap, null);
+};
+
+var Binary$dumpStringListMap$HAS = Binary.dumpStringListMap$HAS;
+
+/**
+ * @param {Object.<string, undefined|Array.<undefined|!string>>} strMap
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+Binary.dumpStringListMap$HASLCompressionReport$ = function (strMap, report) {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var counter;
+ /** @type {!string} */
+ var key;
+ result = [ ];
+ counter = 0;
+ for (key in strMap) {
+ result.push(Binary$dumpString$SLCompressionReport$(key, report));
+ result.push(Binary$dumpStringList$ASLCompressionReport$(strMap[key], report));
+ counter++;
+ }
+ return Binary$dump32bitNumber$N(counter) + result.join('');
+};
+
+var Binary$dumpStringListMap$HASLCompressionReport$ = Binary.dumpStringListMap$HASLCompressionReport$;
+
+/**
+ * @param {!string} buffer
+ * @param {!number} offset
+ * @return {LoadedStringListMapResult}
+ */
+Binary.loadStringListMap$SI = function (buffer, offset) {
+ return new LoadedStringListMapResult$SI(buffer, offset);
+};
+
+var Binary$loadStringListMap$SI = Binary.loadStringListMap$SI;
+
+/**
+ * @param {Array.<undefined|!number>} array
+ * @return {!string}
+ */
+Binary.dump32bitNumberList$AN = function (array) {
+ return Binary$dump32bitNumberList$ANLCompressionReport$(array, null);
+};
+
+var Binary$dump32bitNumberList$AN = Binary.dump32bitNumberList$AN;
+
+/**
+ * @param {Array.<undefined|!number>} array
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+Binary.dump32bitNumberList$ANLCompressionReport$ = function (array, report) {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var index;
+ /** @type {!number} */
+ var inputLength;
+ /** @type {!number} */
+ var length;
+ /** @type {!string} */
+ var resultString;
+ /** @type {!number} */
+ var value1$0;
+ /** @type {!number} */
+ var value2$0;
+ result = [ Binary$dump32bitNumber$N(array.length) ];
+ index = 0;
+ inputLength = array.length;
+ while (index < inputLength) {
+ if (array[index] == 0) {
+ length = Binary$_countZero$ANI(array, index);
+ result.push(Binary$_zeroBlock$I(length));
+ index += length;
+ } else {
+ if (Binary$_shouldZebraCode$ANI(array, index)) {
+ result.push(Binary$_createZebraCode$ANI(array, index));
+ value1$0 = array.length;
+ value2$0 = index + 15;
+ index = (value1$0 <= value2$0 ? value1$0 : value2$0);
+ } else {
+ length = Binary$_searchDoubleZero$ANI(array, index);
+ result.push(Binary$_nonZeroBlock$ANII(array, index, length));
+ if (length === 0) {
+ throw new Error('');
+ }
+ index += length;
+ }
+ }
+ }
+ resultString = result.join('');
+ if (report) {
+ CompressionReport$add$LCompressionReport$II(report, array.length * 2 + 2, resultString.length);
+ }
+ return resultString;
+};
+
+var Binary$dump32bitNumberList$ANLCompressionReport$ = Binary.dump32bitNumberList$ANLCompressionReport$;
+
+/**
+ * @param {!string} buffer
+ * @param {!number} offset
+ * @return {LoadedNumberListResult}
+ */
+Binary.load32bitNumberList$SI = function (buffer, offset) {
+ return new LoadedNumberListResult$SI(buffer, offset);
+};
+
+var Binary$load32bitNumberList$SI = Binary.load32bitNumberList$SI;
+
+/**
+ * @param {Array.<undefined|!number>} array
+ * @param {!number} offset
+ * @return {!number}
+ */
+Binary._countZero$ANI = function (array, offset) {
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var array$len$0;
+ for ((i = offset, array$len$0 = array.length); i < array$len$0; i++) {
+ if (array[i] != 0) {
+ return (i - offset | 0);
+ }
+ }
+ return (array.length - offset | 0);
+};
+
+var Binary$_countZero$ANI = Binary._countZero$ANI;
+
+/**
+ * @param {!number} length
+ * @return {!string}
+ */
+Binary._zeroBlock$I = function (length) {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ result = [ ];
+ while (length > 0) {
+ if (length > 16384) {
+ result.push(Binary$dump16bitNumber$I(16383));
+ length -= 16384;
+ } else {
+ result.push(Binary$dump16bitNumber$I(length - 1));
+ length = 0;
+ }
+ }
+ return result.join('');
+};
+
+var Binary$_zeroBlock$I = Binary._zeroBlock$I;
+
+/**
+ * @param {Array.<undefined|!number>} array
+ * @param {!number} offset
+ * @return {!boolean}
+ */
+Binary._shouldZebraCode$ANI = function (array, offset) {
+ /** @type {!number} */
+ var change;
+ /** @type {!boolean} */
+ var isLastZero;
+ /** @type {!number} */
+ var i;
+ if (array.length - offset < 16) {
+ return true;
+ }
+ change = 0;
+ isLastZero = false;
+ for (i = offset; i < offset + 15; i++) {
+ if (array[i] == 0) {
+ if (! isLastZero) {
+ isLastZero = true;
+ change++;
+ }
+ } else {
+ if (isLastZero) {
+ isLastZero = false;
+ change++;
+ }
+ }
+ }
+ return change > 2;
+};
+
+var Binary$_shouldZebraCode$ANI = Binary._shouldZebraCode$ANI;
+
+/**
+ * @param {Array.<undefined|!number>} array
+ * @param {!number} offset
+ * @return {!number}
+ */
+Binary._searchDoubleZero$ANI = function (array, offset) {
+ /** @type {!boolean} */
+ var isLastZero;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var array$len$0;
+ isLastZero = false;
+ for ((i = offset, array$len$0 = array.length); i < array$len$0; i++) {
+ if (array[i] == 0) {
+ if (isLastZero) {
+ return (i - offset - 1 | 0);
+ }
+ isLastZero = true;
+ } else {
+ isLastZero = false;
+ }
+ }
+ return (array.length - offset | 0);
+};
+
+var Binary$_searchDoubleZero$ANI = Binary._searchDoubleZero$ANI;
+
+/**
+ * @param {Array.<undefined|!number>} array
+ * @param {!number} offset
+ * @param {!number} length
+ * @return {!string}
+ */
+Binary._nonZeroBlock$ANII = function (array, offset, length) {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var blockLength;
+ /** @type {!number} */
+ var i;
+ result = [ ];
+ while (length > 0) {
+ if (length > 16384) {
+ blockLength = 16384;
+ length -= 16384;
+ } else {
+ blockLength = length;
+ length = 0;
+ }
+ result.push(Binary$dump16bitNumber$I(blockLength - 1 + 0x4000));
+ for (i = offset; i < offset + blockLength; i++) {
+ result.push(Binary$dump32bitNumber$N(array[i]));
+ }
+ offset += blockLength;
+ }
+ return result.join('');
+};
+
+var Binary$_nonZeroBlock$ANII = Binary._nonZeroBlock$ANII;
+
+/**
+ * @param {Array.<undefined|!number>} array
+ * @param {!number} offset
+ * @return {!string}
+ */
+Binary._createZebraCode$ANI = function (array, offset) {
+ /** @type {!number} */
+ var last;
+ /** @type {!number} */
+ var code;
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var value1$0;
+ /** @type {!number} */
+ var value2$0;
+ value1$0 = offset + 15;
+ value2$0 = array.length;
+ last = (value1$0 <= value2$0 ? value1$0 : value2$0);
+ code = 0x8000;
+ result = [ ];
+ for (i = offset; i < last; i++) {
+ if (array[i] != 0) {
+ result.push(Binary$dump32bitNumber$N(array[i]));
+ code = code + (0x1 << i - offset);
+ }
+ }
+ return String.fromCharCode(code) + result.join('');
+};
+
+var Binary$_createZebraCode$ANI = Binary._createZebraCode$ANI;
+
+/**
+ * @param {!string} str
+ * @return {!string}
+ */
+Binary.base64encode$S = function (str) {
+ /** @type {Array.<undefined|!string>} */
+ var out;
+ /** @type {Array.<undefined|!number>} */
+ var source;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var code;
+ /** @type {!number} */
+ var len;
+ /** @type {!number} */
+ var c1;
+ /** @type {undefined|!number} */
+ var c2;
+ /** @type {undefined|!number} */
+ var c3;
+ out = [ ];
+ source = [ ];
+ for (i = 0; i < str.length; i++) {
+ code = str.charCodeAt(i);
+ source.push(code & 0x00ff, code >>> 8);
+ }
+ len = str.length * 2;
+ i = 0;
+ while (i < len) {
+ c1 = source[i++] & 0xff;
+ if (i === len) {
+ out.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(c1 >> 2));
+ out.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((c1 & 0x3) << 4));
+ out.push("==");
+ break;
+ }
+ c2 = source[i++];
+ if (i === len) {
+ out.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(c1 >> 2));
+ out.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((c1 & 0x3) << 4 | (c2 & 0xF0) >> 4));
+ out.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((c2 & 0xF) << 2));
+ out.push("=");
+ break;
+ }
+ c3 = source[i++];
+ out.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(c1 >> 2));
+ out.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((c1 & 0x3) << 4 | (c2 & 0xF0) >> 4));
+ out.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((c2 & 0xF) << 2 | (c3 & 0xC0) >> 6));
+ out.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(c3 & 0x3F));
+ }
+ return out.join('');
+};
+
+var Binary$base64encode$S = Binary.base64encode$S;
+
+/**
+ * @param {Array.<undefined|!number>} source
+ * @return {!string}
+ */
+Binary._mergeCharCode$AI = function (source) {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var i;
+ result = [ ];
+ for (i = 0; i < source.length; i += 2) {
+ result.push(String.fromCharCode(source[i] + (source[i + 1] << 8)));
+ }
+ return result.join('');
+};
+
+var Binary$_mergeCharCode$AI = Binary._mergeCharCode$AI;
+
+/**
+ * @param {!string} str
+ * @return {!string}
+ */
+Binary.base64decode$S = function (str) {
+ /** @type {!number} */
+ var len;
+ /** @type {!number} */
+ var i;
+ /** @type {Array.<undefined|!number>} */
+ var out;
+ /** @type {undefined|!number} */
+ var c1;
+ /** @type {undefined|!number} */
+ var c2;
+ /** @type {!number} */
+ var c3;
+ /** @type {!number} */
+ var c4;
+ len = str.length;
+ i = 0;
+ out = [ ];
+ while (i < len) {
+ do {
+ c1 = Binary._base64DecodeChars[str.charCodeAt(i++) & 0xff];
+ } while (i < len && c1 == -1);
+ if (c1 == -1) {
+ break;
+ }
+ do {
+ c2 = Binary._base64DecodeChars[str.charCodeAt(i++) & 0xff];
+ } while (i < len && c2 == -1);
+ if (c2 == -1) {
+ break;
+ }
+ out.push(c1 << 2 | (c2 & 0x30) >> 4);
+ do {
+ c3 = str.charCodeAt(i++) & 0xff;
+ if (c3 === 61) {
+ return Binary$_mergeCharCode$AI(out);
+ }
+ c3 = Binary._base64DecodeChars[c3];
+ } while (i < len && c3 === -1);
+ if (c3 === -1) {
+ break;
+ }
+ out.push((c2 & 0XF) << 4 | (c3 & 0x3C) >> 2);
+ do {
+ c4 = str.charCodeAt(i++) & 0xff;
+ if (c4 === 61) {
+ return Binary$_mergeCharCode$AI(out);
+ }
+ c4 = (Binary._base64DecodeChars[c4] | 0);
+ } while (i < len && c4 === -1);
+ if (c4 === -1) {
+ break;
+ }
+ out.push((c3 & 0x03) << 6 | c4);
+ }
+ return Binary$_mergeCharCode$AI(out);
+};
+
+var Binary$base64decode$S = Binary.base64decode$S;
+
+/**
+ * class LoadedStringResult extends Object
+ * @constructor
+ */
+function LoadedStringResult() {
+}
+
+/**
+ * @constructor
+ * @param {!string} data
+ * @param {!number} offset
+ */
+function LoadedStringResult$SI(data, offset) {
+ /** @type {!number} */
+ var strLength;
+ /** @type {Array.<undefined|!string>} */
+ var bytes;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var code;
+ /** @type {!number} */
+ var offset$0;
+ this.result = "";
+ this.offset = 0;
+ offset$0 = offset++;
+ strLength = data.charCodeAt(offset$0);
+ if (strLength > 32767) {
+ strLength = strLength - 32768;
+ bytes = [ ];
+ for (i = 0; i < strLength; i += 2) {
+ code = data.charCodeAt(offset);
+ bytes.push(String.fromCharCode(code & 0x00ff));
+ if (i !== strLength - 1) {
+ bytes.push(String.fromCharCode(code >>> 8));
+ }
+ offset++;
+ }
+ this.result = bytes.join('');
+ this.offset = offset;
+ } else {
+ this.result = data.slice(offset, offset + strLength);
+ this.offset = (offset + strLength | 0);
+ }
+};
+
+LoadedStringResult$SI.prototype = new LoadedStringResult;
+
+/**
+ * class LoadedStringListResult extends Object
+ * @constructor
+ */
+function LoadedStringListResult() {
+}
+
+/**
+ * @constructor
+ * @param {!string} data
+ * @param {!number} offset
+ */
+function LoadedStringListResult$SI(data, offset) {
+ /** @type {!number} */
+ var length;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var strLength;
+ /** @type {!string} */
+ var resultStr;
+ /** @type {Array.<undefined|!string>} */
+ var bytes;
+ /** @type {!number} */
+ var j;
+ /** @type {!number} */
+ var code;
+ /** @type {!number} */
+ var result$0;
+ /** @type {!number} */
+ var offset$0;
+ this.offset = 0;
+ this.result = [ ];
+ result$0 = data.charCodeAt(offset) * 65536 + data.charCodeAt(offset + 1);
+ length = result$0;
+ offset += 2;
+ for (i = 0; i < length; i++) {
+ offset$0 = offset++;
+ strLength = data.charCodeAt(offset$0);
+ if (strLength > 32767) {
+ strLength = strLength - 32768;
+ bytes = [ ];
+ for (j = 0; j < strLength; j += 2) {
+ code = data.charCodeAt(offset);
+ bytes.push(String.fromCharCode(code & 0x00ff));
+ if (j !== strLength - 1) {
+ bytes.push(String.fromCharCode(code >>> 8));
+ }
+ offset++;
+ }
+ resultStr = bytes.join('');
+ } else {
+ resultStr = data.slice(offset, offset + strLength);
+ offset = (offset + strLength | 0);
+ }
+ this.result.push(resultStr);
+ }
+ this.offset = offset;
+};
+
+LoadedStringListResult$SI.prototype = new LoadedStringListResult;
+
+/**
+ * class LoadedStringListMapResult extends Object
+ * @constructor
+ */
+function LoadedStringListMapResult() {
+}
+
+/**
+ * @constructor
+ * @param {!string} data
+ * @param {!number} offset
+ */
+function LoadedStringListMapResult$SI(data, offset) {
+ /** @type {!number} */
+ var length;
+ /** @type {!number} */
+ var i;
+ /** @type {LoadedStringResult} */
+ var keyResult;
+ /** @type {LoadedStringListResult} */
+ var valueResult;
+ /** @type {!number} */
+ var result$0;
+ /** @type {!number} */
+ var offset$0;
+ this.offset = 0;
+ this.result = ({ });
+ result$0 = data.charCodeAt(offset) * 65536 + data.charCodeAt(offset + 1);
+ length = result$0;
+ offset += 2;
+ for (i = 0; i < length; i++) {
+ keyResult = new LoadedStringResult$SI(data, offset);
+ offset$0 = keyResult.offset;
+ valueResult = new LoadedStringListResult$SI(data, offset$0);
+ this.result[keyResult.result] = valueResult.result;
+ offset = valueResult.offset;
+ }
+ this.offset = offset;
+};
+
+LoadedStringListMapResult$SI.prototype = new LoadedStringListMapResult;
+
+/**
+ * class LoadedNumberListResult extends Object
+ * @constructor
+ */
+function LoadedNumberListResult() {
+}
+
+/**
+ * @constructor
+ * @param {!string} data
+ * @param {!number} offset
+ */
+function LoadedNumberListResult$SI(data, offset) {
+ /** @type {!number} */
+ var resultLength;
+ /** @type {!number} */
+ var originalOffset;
+ /** @type {Array.<undefined|!number>} */
+ var result;
+ /** @type {!number} */
+ var tag;
+ /** @type {!number} */
+ var length;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var result$0;
+ /** @type {!number} */
+ var value1$0;
+ this.result = null;
+ this.offset = 0;
+ result$0 = data.charCodeAt(offset) * 65536 + data.charCodeAt(offset + 1);
+ resultLength = result$0;
+ originalOffset = offset;
+ offset += 2;
+ result = [ ];
+ while (result.length < resultLength) {
+ tag = data.charCodeAt(offset++);
+ if (tag >>> 15 === 1) {
+ value1$0 = resultLength - result.length;
+ length = (value1$0 <= 15 ? value1$0 : 15);
+ for (i = 0; i < length; i++) {
+ if (tag >>> i & 0x1) {
+ result.push(Binary$load32bitNumber$SI(data, offset));
+ offset += 2;
+ } else {
+ result.push(0);
+ }
+ }
+ } else {
+ if (tag >>> 14 === 1) {
+ length = tag - 0x4000 + 1;
+ for (i = 0; i < length; i++) {
+ result.push(Binary$load32bitNumber$SI(data, offset));
+ offset += 2;
+ }
+ } else {
+ length = tag + 1;
+ for (i = 0; i < length; i++) {
+ result.push(0);
+ }
+ }
+ }
+ }
+ this.result = result;
+ this.offset = offset;
+};
+
+LoadedNumberListResult$SI.prototype = new LoadedNumberListResult;
+
+/**
+ * class CompressionReport extends Object
+ * @constructor
+ */
+function CompressionReport() {
+}
+
+/**
+ * @constructor
+ */
+function CompressionReport$() {
+ this.source = 0;
+ this.result = 0;
+};
+
+CompressionReport$.prototype = new CompressionReport;
+
+/**
+ * @param {CompressionReport} $this
+ * @param {!number} source
+ * @param {!number} result
+ */
+CompressionReport.add$LCompressionReport$II = function ($this, source, result) {
+ $this.source += source;
+ $this.result += result;
+};
+
+var CompressionReport$add$LCompressionReport$II = CompressionReport.add$LCompressionReport$II;
+
+/**
+ * @param {CompressionReport} $this
+ * @return {!number}
+ */
+CompressionReport.rate$LCompressionReport$ = function ($this) {
+ return (Math.round($this.result * 100.0 / $this.source) | 0);
+};
+
+var CompressionReport$rate$LCompressionReport$ = CompressionReport.rate$LCompressionReport$;
+
+/**
+ * class Query extends Object
+ * @constructor
+ */
+function Query() {
+}
+
+/**
+ * @constructor
+ */
+function Query$() {
+ this.word = '';
+ this.or = false;
+ this.not = false;
+ this.raw = false;
+};
+
+Query$.prototype = new Query;
+
+/**
+ * @return {!string}
+ */
+Query.prototype.toString = function () {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ result = [ ];
+ if (this.or) {
+ result.push("OR ");
+ }
+ if (this.not) {
+ result.push("-");
+ }
+ if (this.raw) {
+ result.push('"', this.word, '"');
+ } else {
+ result.push(this.word);
+ }
+ return result.join('');
+};
+
+/**
+ * class Proposal extends Object
+ * @constructor
+ */
+function Proposal() {
+}
+
+/**
+ * @constructor
+ * @param {!number} omit
+ * @param {!number} expect
+ */
+function Proposal$II(omit, expect) {
+ this.omit = omit;
+ this.expect = expect;
+};
+
+Proposal$II.prototype = new Proposal;
+
+/**
+ * class Position extends Object
+ * @constructor
+ */
+function Position() {
+}
+
+/**
+ * @constructor
+ * @param {!string} word
+ * @param {!number} position
+ * @param {!boolean} stemmed
+ */
+function Position$SIB(word, position, stemmed) {
+ this.word = word;
+ this.position = position;
+ this.stemmed = stemmed;
+};
+
+Position$SIB.prototype = new Position;
+
+/**
+ * class SearchUnit extends Object
+ * @constructor
+ */
+function SearchUnit() {
+}
+
+/**
+ * @constructor
+ * @param {!number} id
+ */
+function SearchUnit$I(id) {
+ this.positions = ({ });
+ this.id = id;
+ this._size = 0;
+ this.score = 0;
+ this.startPosition = -1;
+};
+
+SearchUnit$I.prototype = new SearchUnit;
+
+/**
+ * @param {SearchUnit} $this
+ * @param {!string} word
+ * @param {!number} position
+ * @param {!boolean} stemmed
+ */
+SearchUnit.addPosition$LSearchUnit$SIB = function ($this, word, position, stemmed) {
+ /** @type {Position} */
+ var positionObj;
+ positionObj = $this.positions[position + ""];
+ if (! positionObj) {
+ $this._size++;
+ $this.positions[position + ""] = ({word: word, position: position, stemmed: stemmed});
+ } else {
+ if (positionObj.word.length < word.length) {
+ positionObj.word = word;
+ }
+ positionObj.stemmed = positionObj.stemmed && stemmed;
+ }
+};
+
+var SearchUnit$addPosition$LSearchUnit$SIB = SearchUnit.addPosition$LSearchUnit$SIB;
+
+/**
+ * @param {SearchUnit} $this
+ * @param {!number} position
+ * @return {Position}
+ */
+SearchUnit.get$LSearchUnit$I = function ($this, position) {
+ return $this.positions[position + ""];
+};
+
+var SearchUnit$get$LSearchUnit$I = SearchUnit.get$LSearchUnit$I;
+
+/**
+ * @param {SearchUnit} $this
+ * @return {!number}
+ */
+SearchUnit.size$LSearchUnit$ = function ($this) {
+ return $this._size;
+};
+
+var SearchUnit$size$LSearchUnit$ = SearchUnit.size$LSearchUnit$;
+
+/**
+ * @param {SearchUnit} $this
+ * @param {SearchUnit} rhs
+ */
+SearchUnit.merge$LSearchUnit$LSearchUnit$ = function ($this, rhs) {
+ /** @type {!string} */
+ var position;
+ /** @type {Position} */
+ var pos;
+ for (position in rhs.positions) {
+ pos = rhs.positions[position];
+ SearchUnit$addPosition$LSearchUnit$SIB($this, pos.word, pos.position, pos.stemmed);
+ }
+};
+
+var SearchUnit$merge$LSearchUnit$LSearchUnit$ = SearchUnit.merge$LSearchUnit$LSearchUnit$;
+
+/**
+ * @param {SearchUnit} $this
+ * @return {Array.<undefined|Position>}
+ */
+SearchUnit.getPositions$LSearchUnit$ = function ($this) {
+ /** @type {Array.<undefined|Position>} */
+ var result;
+ /** @type {!string} */
+ var pos;
+ result = [ ];
+ for (pos in $this.positions) {
+ result.push($this.positions[pos]);
+ }
+ result.sort((function (a, b) {
+ return a.position - b.position;
+ }));
+ return result;
+};
+
+var SearchUnit$getPositions$LSearchUnit$ = SearchUnit.getPositions$LSearchUnit$;
+
+/**
+ * class SingleResult extends Object
+ * @constructor
+ */
+function SingleResult() {
+}
+
+/**
+ * @constructor
+ */
+function SingleResult$() {
+ this.units = [ ];
+ this.unitIds = [ ];
+ this.or = false;
+ this.not = false;
+ this.searchWord = '';
+};
+
+SingleResult$.prototype = new SingleResult;
+
+/**
+ * @constructor
+ * @param {!string} searchWord
+ * @param {!boolean} or
+ * @param {!boolean} not
+ */
+function SingleResult$SBB(searchWord, or, not) {
+ this.units = [ ];
+ this.unitIds = [ ];
+ this.or = or;
+ this.not = not;
+ this.searchWord = searchWord;
+};
+
+SingleResult$SBB.prototype = new SingleResult;
+
+/**
+ * @param {SingleResult} $this
+ * @param {!number} unitId
+ * @return {SearchUnit}
+ */
+SingleResult.getSearchUnit$LSingleResult$I = function ($this, unitId) {
+ /** @type {!number} */
+ var existing;
+ /** @type {SearchUnit} */
+ var result;
+ existing = $this.unitIds.indexOf(unitId);
+ if (existing === -1) {
+ result = ({positions: ({ }), id: unitId, _size: 0, score: 0, startPosition: -1});
+ $this.units.push(result);
+ $this.unitIds.push(unitId);
+ } else {
+ result = $this.units[existing];
+ }
+ return result;
+};
+
+var SingleResult$getSearchUnit$LSingleResult$I = SingleResult.getSearchUnit$LSingleResult$I;
+
+/**
+ * @param {SingleResult} $this
+ * @param {SingleResult} rhs
+ * @return {SingleResult}
+ */
+SingleResult.merge$LSingleResult$LSingleResult$ = function ($this, rhs) {
+ /** @type {SingleResult} */
+ var result;
+ result = ({units: [ ], unitIds: [ ], or: false, not: false, searchWord: ''});
+ if (rhs.or) {
+ SingleResult$_orMerge$LSingleResult$LSingleResult$LSingleResult$($this, result, rhs);
+ } else {
+ if (rhs.not) {
+ SingleResult$_notMerge$LSingleResult$LSingleResult$LSingleResult$($this, result, rhs);
+ } else {
+ SingleResult$_andMerge$LSingleResult$LSingleResult$LSingleResult$($this, result, rhs);
+ }
+ }
+ return result;
+};
+
+var SingleResult$merge$LSingleResult$LSingleResult$ = SingleResult.merge$LSingleResult$LSingleResult$;
+
+/**
+ * @param {SingleResult} $this
+ * @return {!number}
+ */
+SingleResult.size$LSingleResult$ = function ($this) {
+ return ($this.units.length | 0);
+};
+
+var SingleResult$size$LSingleResult$ = SingleResult.size$LSingleResult$;
+
+/**
+ * @param {SingleResult} $this
+ * @param {SingleResult} result
+ * @param {SingleResult} rhs
+ */
+SingleResult._andMerge$LSingleResult$LSingleResult$LSingleResult$ = function ($this, result, rhs) {
+ /** @type {!number} */
+ var i;
+ /** @type {undefined|!number} */
+ var id;
+ /** @type {SearchUnit} */
+ var lhsSection;
+ for (i = 0; i < $this.unitIds.length; i++) {
+ id = $this.unitIds[i];
+ if (rhs.unitIds.indexOf(id) !== -1) {
+ lhsSection = $this.units[i];
+ result.unitIds.push(id);
+ result.units.push(lhsSection);
+ }
+ }
+};
+
+var SingleResult$_andMerge$LSingleResult$LSingleResult$LSingleResult$ = SingleResult._andMerge$LSingleResult$LSingleResult$LSingleResult$;
+
+/**
+ * @param {SingleResult} $this
+ * @param {SingleResult} result
+ * @param {SingleResult} rhs
+ */
+SingleResult._orMerge$LSingleResult$LSingleResult$LSingleResult$ = function ($this, result, rhs) {
+ /** @type {!number} */
+ var i;
+ /** @type {undefined|!number} */
+ var id;
+ /** @type {SearchUnit} */
+ var rhsSection;
+ /** @type {SearchUnit} */
+ var lhsSection;
+ /** @type {Array.<undefined|!number>} */
+ var unitIds$0;
+ /** @type {Array.<undefined|SearchUnit>} */
+ var units$0;
+ result.unitIds = (unitIds$0 = $this.unitIds).slice(0, unitIds$0.length);
+ result.units = (units$0 = $this.units).slice(0, units$0.length);
+ for (i = 0; i < rhs.unitIds.length; i++) {
+ id = rhs.unitIds[i];
+ rhsSection = rhs.units[i];
+ if (result.unitIds.indexOf(id) !== -1) {
+ lhsSection = result.units[result.unitIds.indexOf(id)];
+ SearchUnit$merge$LSearchUnit$LSearchUnit$(lhsSection, rhsSection);
+ } else {
+ result.unitIds.push(id);
+ result.units.push(rhsSection);
+ }
+ }
+};
+
+var SingleResult$_orMerge$LSingleResult$LSingleResult$LSingleResult$ = SingleResult._orMerge$LSingleResult$LSingleResult$LSingleResult$;
+
+/**
+ * @param {SingleResult} $this
+ * @param {SingleResult} result
+ * @param {SingleResult} rhs
+ */
+SingleResult._notMerge$LSingleResult$LSingleResult$LSingleResult$ = function ($this, result, rhs) {
+ /** @type {!number} */
+ var i;
+ /** @type {undefined|!number} */
+ var id;
+ /** @type {SearchUnit} */
+ var lhsSection;
+ for (i = 0; i < $this.unitIds.length; i++) {
+ id = $this.unitIds[i];
+ if (rhs.unitIds.indexOf(id) === -1) {
+ lhsSection = $this.units[i];
+ result.unitIds.push(id);
+ result.units.push(lhsSection);
+ }
+ }
+};
+
+var SingleResult$_notMerge$LSingleResult$LSingleResult$LSingleResult$ = SingleResult._notMerge$LSingleResult$LSingleResult$LSingleResult$;
+
+/**
+ * class SearchSummary extends Object
+ * @constructor
+ */
+function SearchSummary() {
+}
+
+/**
+ * @constructor
+ */
+function SearchSummary$() {
+ this.sourceResults = [ ];
+ this.result = null;
+ this.oktavia = null;
+};
+
+SearchSummary$.prototype = new SearchSummary;
+
+/**
+ * @constructor
+ * @param {Oktavia} oktavia
+ */
+function SearchSummary$LOktavia$(oktavia) {
+ this.sourceResults = [ ];
+ this.result = null;
+ this.oktavia = oktavia;
+};
+
+SearchSummary$LOktavia$.prototype = new SearchSummary;
+
+/**
+ * @param {SearchSummary} $this
+ * @param {SingleResult} result
+ */
+SearchSummary.addQuery$LSearchSummary$LSingleResult$ = function ($this, result) {
+ $this.sourceResults.push(result);
+};
+
+var SearchSummary$addQuery$LSearchSummary$LSingleResult$ = SearchSummary.addQuery$LSearchSummary$LSingleResult$;
+
+/**
+ * @param {SearchSummary} $this
+ */
+SearchSummary.mergeResult$LSearchSummary$ = function ($this) {
+ $this.result = SearchSummary$mergeResult$LSearchSummary$ALSingleResult$($this, $this.sourceResults);
+};
+
+var SearchSummary$mergeResult$LSearchSummary$ = SearchSummary.mergeResult$LSearchSummary$;
+
+/**
+ * @param {SearchSummary} $this
+ * @param {Array.<undefined|SingleResult>} results
+ * @return {SingleResult}
+ */
+SearchSummary.mergeResult$LSearchSummary$ALSingleResult$ = function ($this, results) {
+ /** @type {SingleResult} */
+ var rhs;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var results$len$0;
+ rhs = results[0];
+ for ((i = 1, results$len$0 = results.length); i < results$len$0; i++) {
+ rhs = SingleResult$merge$LSingleResult$LSingleResult$(rhs, results[i]);
+ }
+ return rhs;
+};
+
+var SearchSummary$mergeResult$LSearchSummary$ALSingleResult$ = SearchSummary.mergeResult$LSearchSummary$ALSingleResult$;
+
+/**
+ * @param {SearchSummary} $this
+ * @return {Array.<undefined|Proposal>}
+ */
+SearchSummary.getProposal$LSearchSummary$ = function ($this) {
+ /** @type {Array.<undefined|Proposal>} */
+ var proposals;
+ /** @type {!number} */
+ var i;
+ /** @type {Array.<undefined|SingleResult>} */
+ var tmpSource;
+ /** @type {!number} */
+ var j;
+ /** @type {SingleResult} */
+ var result;
+ proposals = [ ];
+ for (i = 0; i < $this.sourceResults.length; i++) {
+ tmpSource = [ ];
+ for (j = 0; j < $this.sourceResults.length; j++) {
+ if (i !== j) {
+ tmpSource.push($this.sourceResults[j]);
+ }
+ }
+ result = SearchSummary$mergeResult$LSearchSummary$ALSingleResult$($this, tmpSource);
+ proposals.push(({omit: i, expect: result.units.length}));
+ }
+ proposals.sort((function (a, b) {
+ return b.expect - a.expect;
+ }));
+ return proposals;
+};
+
+var SearchSummary$getProposal$LSearchSummary$ = SearchSummary.getProposal$LSearchSummary$;
+
+/**
+ * @param {SearchSummary} $this
+ * @return {Array.<undefined|SearchUnit>}
+ */
+SearchSummary.getSortedResult$LSearchSummary$ = function ($this) {
+ /** @type {Array.<undefined|SearchUnit>} */
+ var result;
+ /** @type {Array.<undefined|SearchUnit>} */
+ var units$0;
+ result = (units$0 = $this.result.units).slice(0, units$0.length);
+ result.sort((function (a, b) {
+ return b.score - a.score;
+ }));
+ return result;
+};
+
+var SearchSummary$getSortedResult$LSearchSummary$ = SearchSummary.getSortedResult$LSearchSummary$;
+
+/**
+ * @param {SearchSummary} $this
+ * @return {!number}
+ */
+SearchSummary.size$LSearchSummary$ = function ($this) {
+ /** @type {SingleResult} */
+ var this$0;
+ this$0 = $this.result;
+ return (this$0.units.length | 0);
+};
+
+var SearchSummary$size$LSearchSummary$ = SearchSummary.size$LSearchSummary$;
+
+/**
+ * @param {SearchSummary} $this
+ * @param {SingleResult} result
+ */
+SearchSummary.add$LSearchSummary$LSingleResult$ = function ($this, result) {
+ $this.sourceResults.push(result);
+};
+
+var SearchSummary$add$LSearchSummary$LSingleResult$ = SearchSummary.add$LSearchSummary$LSingleResult$;
+
+/**
+ * class Stemmer
+ * @constructor
+ */
+function Stemmer() {
+}
+
+Stemmer.prototype.$__jsx_implements_Stemmer = true;
+
+/**
+ * @constructor
+ */
+function Stemmer$() {
+};
+
+Stemmer$.prototype = new Stemmer;
+
+/**
+ * class BitVector extends Object
+ * @constructor
+ */
+function BitVector() {
+}
+
+/**
+ * @constructor
+ */
+function BitVector$() {
+ /** @type {Array.<undefined|!number>} */
+ var _v$0;
+ /** @type {Array.<undefined|!number>} */
+ var _r$0;
+ _r$0 = this._r = [ ];
+ _v$0 = this._v = [ ];
+ _v$0.length = 0;
+ _r$0.length = 0;
+ this._size = 0;
+ this._size1 = 0;
+};
+
+BitVector$.prototype = new BitVector;
+
+/**
+ */
+BitVector.prototype.build$ = function () {
+ /** @type {!number} */
+ var i;
+ this._size1 = 0;
+ for (i = 0; i < this._v.length; i++) {
+ if (i % 8 === 0) {
+ this._r.push(true ? this._size1 : this._size - this._size1);
+ }
+ this._size1 += this._rank32$IIB(this._v[i], 32, true);
+ }
+};
+
+/**
+ */
+BitVector.prototype.clear$ = function () {
+ this._v.length = 0;
+ this._r.length = 0;
+ this._size = 0;
+ this._size1 = 0;
+};
+
+/**
+ * @return {!number}
+ */
+BitVector.prototype.size$ = function () {
+ return this._size;
+};
+
+/**
+ * @param {!boolean} b
+ * @return {!number}
+ */
+BitVector.prototype.size$B = function (b) {
+ return (b ? this._size1 : this._size - this._size1);
+};
+
+/**
+ * @param {!number} value
+ */
+BitVector.prototype.set$I = function (value) {
+ this.set$IB(value, true);
+};
+
+/**
+ * @param {!number} value
+ * @param {!boolean} flag
+ */
+BitVector.prototype.set$IB = function (value, flag) {
+ /** @type {!number} */
+ var q;
+ /** @type {!number} */
+ var r;
+ /** @type {!number} */
+ var m;
+ if (value >= this._size) {
+ this._size = (value + 1 | 0);
+ }
+ q = (value / 32 | 0);
+ r = (value % 32 | 0);
+ while (q >= this._v.length) {
+ this._v.push(0);
+ }
+ m = 0x1 << r;
+ if (flag) {
+ this._v[q] |= m;
+ } else {
+ this._v[q] &= ~ m;
+ }
+};
+
+/**
+ * @param {!number} value
+ * @return {!boolean}
+ */
+BitVector.prototype.get$I = function (value) {
+ /** @type {!number} */
+ var q;
+ /** @type {!number} */
+ var r;
+ /** @type {!number} */
+ var m;
+ if (value >= this._size) {
+ throw new Error("BitVector.get() : range error");
+ }
+ q = (value / 32 | 0);
+ r = (value % 32 | 0);
+ m = 0x1 << r;
+ return !! (this._v[q] & m);
+};
+
+/**
+ * @param {!number} i
+ * @return {!number}
+ */
+BitVector.prototype.rank$I = function (i) {
+ return this.rank$IB(i, true);
+};
+
+/**
+ * @param {!number} i
+ * @param {!boolean} b
+ * @return {!number}
+ */
+BitVector.prototype.rank$IB = function (i, b) {
+ /** @type {!number} */
+ var q_large;
+ /** @type {!number} */
+ var q_small;
+ /** @type {!number} */
+ var r;
+ /** @type {!number} */
+ var rank;
+ /** @type {!number} */
+ var begin;
+ /** @type {!number} */
+ var j;
+ if (i > this._size) {
+ throw new Error("BitVector.rank() : range error");
+ }
+ if (i === 0) {
+ return 0;
+ }
+ i--;
+ q_large = (Math.floor(i / 256) | 0);
+ q_small = (Math.floor(i / 32) | 0);
+ r = (Math.floor(i % 32) | 0);
+ rank = (this._r[q_large] | 0);
+ if (! b) {
+ rank = q_large * 256 - rank;
+ }
+ begin = q_large * 8;
+ for (j = begin; j < q_small; j++) {
+ rank += this._rank32$IIB(this._v[j], 32, b);
+ }
+ rank += this._rank32$IIB(this._v[q_small], r + 1, b);
+ return rank;
+};
+
+/**
+ * @param {!number} i
+ * @return {!number}
+ */
+BitVector.prototype.select$I = function (i) {
+ return this.select$IB(i, true);
+};
+
+/**
+ * @param {!number} i
+ * @param {!boolean} b
+ * @return {!number}
+ */
+BitVector.prototype.select$IB = function (i, b) {
+ /** @type {!number} */
+ var left;
+ /** @type {!number} */
+ var right;
+ /** @type {!number} */
+ var pivot;
+ /** @type {undefined|!number} */
+ var rank;
+ /** @type {!number} */
+ var j;
+ if (i >= (b ? this._size1 : this._size - this._size1)) {
+ throw new Error("BitVector.select() : range error");
+ }
+ left = 0;
+ right = this._r.length;
+ while (left < right) {
+ pivot = Math.floor((left + right) / 2);
+ rank = this._r[pivot];
+ if (! b) {
+ rank = pivot * 256 - rank;
+ }
+ if (i < rank) {
+ right = pivot;
+ } else {
+ left = pivot + 1;
+ }
+ }
+ right--;
+ if (b) {
+ i -= (this._r[right] | 0);
+ } else {
+ i -= (right * 256 - this._r[right] | 0);
+ }
+ j = right * 8;
+ while (1) {
+ rank = this._rank32$IIB(this._v[j], 32, b);
+ if (i < rank) {
+ break;
+ }
+ j++;
+ i -= (rank | 0);
+ }
+ return (j * 32 + this._select32$IIB(this._v[j], i, b) | 0);
+};
+
+/**
+ * @param {!number} x
+ * @param {!number} i
+ * @param {!boolean} b
+ * @return {!number}
+ */
+BitVector.prototype._rank32$IIB = function (x, i, b) {
+ if (! b) {
+ x = ~ x;
+ }
+ x <<= 32 - i;
+ x = ((x & 0xaaaaaaaa) >>> 1) + (x & 0x55555555);
+ x = ((x & 0xcccccccc) >>> 2) + (x & 0x33333333);
+ x = ((x & 0xf0f0f0f0) >>> 4) + (x & 0x0f0f0f0f);
+ x = ((x & 0xff00ff00) >>> 8) + (x & 0x00ff00ff);
+ x = ((x & 0xffff0000) >>> 16) + (x & 0x0000ffff);
+ return x;
+};
+
+/**
+ * @param {!number} x
+ * @param {!number} i
+ * @param {!boolean} b
+ * @return {!number}
+ */
+BitVector.prototype._select32$IIB = function (x, i, b) {
+ /** @type {!number} */
+ var x1;
+ /** @type {!number} */
+ var x2;
+ /** @type {!number} */
+ var x3;
+ /** @type {!number} */
+ var x4;
+ /** @type {!number} */
+ var x5;
+ /** @type {!number} */
+ var pos;
+ /** @type {!number} */
+ var v5;
+ /** @type {!number} */
+ var v4;
+ /** @type {!number} */
+ var v3;
+ /** @type {!number} */
+ var v2;
+ /** @type {!number} */
+ var v1;
+ /** @type {!number} */
+ var v0;
+ if (! b) {
+ x = ~ x;
+ }
+ x1 = ((x & 0xaaaaaaaa) >>> 1) + (x & 0x55555555);
+ x2 = ((x1 & 0xcccccccc) >>> 2) + (x1 & 0x33333333);
+ x3 = ((x2 & 0xf0f0f0f0) >>> 4) + (x2 & 0x0f0f0f0f);
+ x4 = ((x3 & 0xff00ff00) >>> 8) + (x3 & 0x00ff00ff);
+ x5 = ((x4 & 0xffff0000) >>> 16) + (x4 & 0x0000ffff);
+ i++;
+ pos = 0;
+ v5 = x5 & 0xffffffff;
+ if (i > v5) {
+ i -= (v5 | 0);
+ pos += 32;
+ }
+ v4 = x4 >>> pos & 0x0000ffff;
+ if (i > v4) {
+ i -= (v4 | 0);
+ pos += 16;
+ }
+ v3 = x3 >>> pos & 0x000000ff;
+ if (i > v3) {
+ i -= (v3 | 0);
+ pos += 8;
+ }
+ v2 = x2 >>> pos & 0x0000000f;
+ if (i > v2) {
+ i -= (v2 | 0);
+ pos += 4;
+ }
+ v1 = x1 >>> pos & 0x00000003;
+ if (i > v1) {
+ i -= (v1 | 0);
+ pos += 2;
+ }
+ v0 = x >>> pos & 0x00000001;
+ if (i > v0) {
+ i -= (v0 | 0);
+ pos += 1;
+ }
+ return (pos | 0);
+};
+
+/**
+ * @return {!string}
+ */
+BitVector.prototype.dump$ = function () {
+ /** @type {Array.<undefined|!string>} */
+ var contents;
+ contents = [ ];
+ contents.push(Binary$dump32bitNumber$N(this._size));
+ contents.push(Binary$dump32bitNumberList$AN(this._v));
+ return contents.join('');
+};
+
+/**
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+BitVector.prototype.dump$LCompressionReport$ = function (report) {
+ /** @type {Array.<undefined|!string>} */
+ var contents;
+ contents = [ ];
+ contents.push(Binary$dump32bitNumber$N(this._size));
+ CompressionReport$add$LCompressionReport$II(report, 2, 2);
+ contents.push(Binary$dump32bitNumberList$ANLCompressionReport$(this._v, report));
+ return contents.join('');
+};
+
+/**
+ * @param {!string} data
+ * @return {!number}
+ */
+BitVector.prototype.load$S = function (data) {
+ return this.load$SI(data, 0);
+};
+
+/**
+ * @param {!string} data
+ * @param {!number} offset
+ * @return {!number}
+ */
+BitVector.prototype.load$SI = function (data, offset) {
+ /** @type {LoadedNumberListResult} */
+ var result;
+ /** @type {!number} */
+ var result$0;
+ this._v.length = 0;
+ this._r.length = 0;
+ this._size = 0;
+ this._size1 = 0;
+ result$0 = data.charCodeAt(offset) * 65536 + data.charCodeAt(offset + 1);
+ this._size = (result$0 | 0);
+ result = Binary$load32bitNumberList$SI(data, offset + 2);
+ this._v = result.result;
+ this.build$();
+ return result.offset;
+};
+
+/**
+ * class BaseStemmer extends Object
+ * @constructor
+ */
+function BaseStemmer() {
+}
+
+$__jsx_merge_interface(BaseStemmer, Stemmer);
+
+/**
+ * @constructor
+ */
+function BaseStemmer$() {
+ /** @type {!string} */
+ var current$0;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var limit$0;
+ this.cache = ({ });
+ current$0 = this.current = "";
+ cursor$0 = this.cursor = 0;
+ limit$0 = this.limit = current$0.length;
+ this.limit_backward = 0;
+ this.bra = cursor$0;
+ this.ket = limit$0;
+};
+
+BaseStemmer$.prototype = new BaseStemmer;
+
+/**
+ * @param {!string} value
+ */
+BaseStemmer.prototype.setCurrent$S = function (value) {
+ /** @type {!string} */
+ var current$0;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var limit$0;
+ current$0 = this.current = value;
+ cursor$0 = this.cursor = 0;
+ limit$0 = this.limit = current$0.length;
+ this.limit_backward = 0;
+ this.bra = cursor$0;
+ this.ket = limit$0;
+};
+
+/**
+ * @return {!string}
+ */
+BaseStemmer.prototype.getCurrent$ = function () {
+ return this.current;
+};
+
+/**
+ * @param {BaseStemmer} other
+ */
+BaseStemmer.prototype.copy_from$LBaseStemmer$ = function (other) {
+ this.current = other.current;
+ this.cursor = other.cursor;
+ this.limit = other.limit;
+ this.limit_backward = other.limit_backward;
+ this.bra = other.bra;
+ this.ket = other.ket;
+};
+
+/**
+ * @param {Array.<undefined|!number>} s
+ * @param {!number} min
+ * @param {!number} max
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.in_grouping$AIII = function (s, min, max) {
+ /** @type {!number} */
+ var ch;
+ if (this.cursor >= this.limit) {
+ return false;
+ }
+ ch = this.current.charCodeAt(this.cursor);
+ if (ch > max || ch < min) {
+ return false;
+ }
+ ch -= min;
+ if ((s[ch >>> 3] & 0x1 << (ch & 0x7)) === 0) {
+ return false;
+ }
+ this.cursor++;
+ return true;
+};
+
+/**
+ * @param {Array.<undefined|!number>} s
+ * @param {!number} min
+ * @param {!number} max
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.in_grouping_b$AIII = function (s, min, max) {
+ /** @type {!number} */
+ var ch;
+ if (this.cursor <= this.limit_backward) {
+ return false;
+ }
+ ch = this.current.charCodeAt(this.cursor - 1);
+ if (ch > max || ch < min) {
+ return false;
+ }
+ ch -= min;
+ if ((s[ch >>> 3] & 0x1 << (ch & 0x7)) === 0) {
+ return false;
+ }
+ this.cursor--;
+ return true;
+};
+
+/**
+ * @param {Array.<undefined|!number>} s
+ * @param {!number} min
+ * @param {!number} max
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.out_grouping$AIII = function (s, min, max) {
+ /** @type {!number} */
+ var ch;
+ if (this.cursor >= this.limit) {
+ return false;
+ }
+ ch = this.current.charCodeAt(this.cursor);
+ if (ch > max || ch < min) {
+ this.cursor++;
+ return true;
+ }
+ ch -= min;
+ if ((s[ch >>> 3] & 0X1 << (ch & 0x7)) === 0) {
+ this.cursor++;
+ return true;
+ }
+ return false;
+};
+
+/**
+ * @param {Array.<undefined|!number>} s
+ * @param {!number} min
+ * @param {!number} max
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.out_grouping_b$AIII = function (s, min, max) {
+ /** @type {!number} */
+ var ch;
+ if (this.cursor <= this.limit_backward) {
+ return false;
+ }
+ ch = this.current.charCodeAt(this.cursor - 1);
+ if (ch > max || ch < min) {
+ this.cursor--;
+ return true;
+ }
+ ch -= min;
+ if ((s[ch >>> 3] & 0x1 << (ch & 0x7)) === 0) {
+ this.cursor--;
+ return true;
+ }
+ return false;
+};
+
+/**
+ * @param {!number} min
+ * @param {!number} max
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.in_range$II = function (min, max) {
+ /** @type {!number} */
+ var ch;
+ if (this.cursor >= this.limit) {
+ return false;
+ }
+ ch = this.current.charCodeAt(this.cursor);
+ if (ch > max || ch < min) {
+ return false;
+ }
+ this.cursor++;
+ return true;
+};
+
+/**
+ * @param {!number} min
+ * @param {!number} max
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.in_range_b$II = function (min, max) {
+ /** @type {!number} */
+ var ch;
+ if (this.cursor <= this.limit_backward) {
+ return false;
+ }
+ ch = this.current.charCodeAt(this.cursor - 1);
+ if (ch > max || ch < min) {
+ return false;
+ }
+ this.cursor--;
+ return true;
+};
+
+/**
+ * @param {!number} min
+ * @param {!number} max
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.out_range$II = function (min, max) {
+ /** @type {!number} */
+ var ch;
+ if (this.cursor >= this.limit) {
+ return false;
+ }
+ ch = this.current.charCodeAt(this.cursor);
+ if (! (ch > max || ch < min)) {
+ return false;
+ }
+ this.cursor++;
+ return true;
+};
+
+/**
+ * @param {!number} min
+ * @param {!number} max
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.out_range_b$II = function (min, max) {
+ /** @type {!number} */
+ var ch;
+ if (this.cursor <= this.limit_backward) {
+ return false;
+ }
+ ch = this.current.charCodeAt(this.cursor - 1);
+ if (! (ch > max || ch < min)) {
+ return false;
+ }
+ this.cursor--;
+ return true;
+};
+
+/**
+ * @param {!number} s_size
+ * @param {!string} s
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.eq_s$IS = function (s_size, s) {
+ /** @type {!number} */
+ var cursor$0;
+ if (this.limit - this.cursor < s_size) {
+ return false;
+ }
+ if (this.current.slice(cursor$0 = this.cursor, cursor$0 + s_size) !== s) {
+ return false;
+ }
+ this.cursor += s_size;
+ return true;
+};
+
+/**
+ * @param {!number} s_size
+ * @param {!string} s
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.eq_s_b$IS = function (s_size, s) {
+ /** @type {!number} */
+ var cursor$0;
+ if (this.cursor - this.limit_backward < s_size) {
+ return false;
+ }
+ if (this.current.slice((cursor$0 = this.cursor) - s_size, cursor$0) !== s) {
+ return false;
+ }
+ this.cursor -= s_size;
+ return true;
+};
+
+/**
+ * @param {!string} s
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.eq_v$S = function (s) {
+ return this.eq_s$IS(s.length, s);
+};
+
+/**
+ * @param {!string} s
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.eq_v_b$S = function (s) {
+ return this.eq_s_b$IS(s.length, s);
+};
+
+/**
+ * @param {Array.<undefined|Among>} v
+ * @param {!number} v_size
+ * @return {!number}
+ */
+BaseStemmer.prototype.find_among$ALAmong$I = function (v, v_size) {
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var j;
+ /** @type {!number} */
+ var c;
+ /** @type {!number} */
+ var l;
+ /** @type {!number} */
+ var common_i;
+ /** @type {!number} */
+ var common_j;
+ /** @type {!boolean} */
+ var first_key_inspected;
+ /** @type {!number} */
+ var k;
+ /** @type {!number} */
+ var diff;
+ /** @type {!number} */
+ var common;
+ /** @type {Among} */
+ var w;
+ /** @type {!number} */
+ var i2;
+ /** @type {!boolean} */
+ var res;
+ i = 0;
+ j = v_size;
+ c = this.cursor;
+ l = this.limit;
+ common_i = 0;
+ common_j = 0;
+ first_key_inspected = false;
+ while (true) {
+ k = i + (j - i >>> 1);
+ diff = 0;
+ common = (common_i < common_j ? common_i : common_j);
+ w = v[k];
+ for (i2 = common; i2 < w.s_size; i2++) {
+ if (c + common === l) {
+ diff = -1;
+ break;
+ }
+ diff = this.current.charCodeAt(c + common) - w.s.charCodeAt(i2);
+ if (diff !== 0) {
+ break;
+ }
+ common++;
+ }
+ if (diff < 0) {
+ j = k;
+ common_j = common;
+ } else {
+ i = k;
+ common_i = common;
+ }
+ if (j - i <= 1) {
+ if (i > 0) {
+ break;
+ }
+ if (j === i) {
+ break;
+ }
+ if (first_key_inspected) {
+ break;
+ }
+ first_key_inspected = true;
+ }
+ }
+ while (true) {
+ w = v[i];
+ if (common_i >= w.s_size) {
+ this.cursor = (c + w.s_size | 0);
+ if (w.method == null) {
+ return w.result;
+ }
+ res = w.method(w.instance);
+ this.cursor = (c + w.s_size | 0);
+ if (res) {
+ return w.result;
+ }
+ }
+ i = w.substring_i;
+ if (i < 0) {
+ return 0;
+ }
+ }
+ return -1;
+};
+
+/**
+ * @param {Array.<undefined|Among>} v
+ * @param {!number} v_size
+ * @return {!number}
+ */
+BaseStemmer.prototype.find_among_b$ALAmong$I = function (v, v_size) {
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var j;
+ /** @type {!number} */
+ var c;
+ /** @type {!number} */
+ var lb;
+ /** @type {!number} */
+ var common_i;
+ /** @type {!number} */
+ var common_j;
+ /** @type {!boolean} */
+ var first_key_inspected;
+ /** @type {!number} */
+ var k;
+ /** @type {!number} */
+ var diff;
+ /** @type {!number} */
+ var common;
+ /** @type {Among} */
+ var w;
+ /** @type {!number} */
+ var i2;
+ /** @type {!boolean} */
+ var res;
+ i = 0;
+ j = v_size;
+ c = this.cursor;
+ lb = this.limit_backward;
+ common_i = 0;
+ common_j = 0;
+ first_key_inspected = false;
+ while (true) {
+ k = i + (j - i >> 1);
+ diff = 0;
+ common = (common_i < common_j ? common_i : common_j);
+ w = v[k];
+ for (i2 = w.s_size - 1 - common; i2 >= 0; i2--) {
+ if (c - common === lb) {
+ diff = -1;
+ break;
+ }
+ diff = this.current.charCodeAt(c - 1 - common) - w.s.charCodeAt(i2);
+ if (diff !== 0) {
+ break;
+ }
+ common++;
+ }
+ if (diff < 0) {
+ j = k;
+ common_j = common;
+ } else {
+ i = k;
+ common_i = common;
+ }
+ if (j - i <= 1) {
+ if (i > 0) {
+ break;
+ }
+ if (j === i) {
+ break;
+ }
+ if (first_key_inspected) {
+ break;
+ }
+ first_key_inspected = true;
+ }
+ }
+ while (true) {
+ w = v[i];
+ if (common_i >= w.s_size) {
+ this.cursor = (c - w.s_size | 0);
+ if (w.method == null) {
+ return w.result;
+ }
+ res = w.method(this);
+ this.cursor = (c - w.s_size | 0);
+ if (res) {
+ return w.result;
+ }
+ }
+ i = w.substring_i;
+ if (i < 0) {
+ return 0;
+ }
+ }
+ return -1;
+};
+
+/**
+ * @param {!number} c_bra
+ * @param {!number} c_ket
+ * @param {!string} s
+ * @return {!number}
+ */
+BaseStemmer.prototype.replace_s$IIS = function (c_bra, c_ket, s) {
+ /** @type {!number} */
+ var adjustment;
+ adjustment = s.length - (c_ket - c_bra);
+ this.current = this.current.slice(0, c_bra) + s + this.current.slice(c_ket);
+ this.limit += (adjustment | 0);
+ if (this.cursor >= c_ket) {
+ this.cursor += (adjustment | 0);
+ } else {
+ if (this.cursor > c_bra) {
+ this.cursor = c_bra;
+ }
+ }
+ return (adjustment | 0);
+};
+
+/**
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.slice_check$ = function () {
+ /** @type {!number} */
+ var bra$0;
+ /** @type {!number} */
+ var ket$0;
+ /** @type {!number} */
+ var limit$0;
+ return ((bra$0 = this.bra) < 0 || bra$0 > (ket$0 = this.ket) || ket$0 > (limit$0 = this.limit) || limit$0 > this.current.length ? false : true);
+};
+
+/**
+ * @param {!string} s
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.slice_from$S = function (s) {
+ /** @type {!boolean} */
+ var result;
+ /** @type {!number} */
+ var bra$0;
+ /** @type {!number} */
+ var ket$0;
+ /** @type {!number} */
+ var limit$0;
+ result = false;
+ if ((bra$0 = this.bra) < 0 || bra$0 > (ket$0 = this.ket) || ket$0 > (limit$0 = this.limit) || limit$0 > this.current.length ? false : true) {
+ this.replace_s$IIS(this.bra, this.ket, s);
+ result = true;
+ }
+ return result;
+};
+
+/**
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.slice_del$ = function () {
+ return this.slice_from$S("");
+};
+
+/**
+ * @param {!number} c_bra
+ * @param {!number} c_ket
+ * @param {!string} s
+ */
+BaseStemmer.prototype.insert$IIS = function (c_bra, c_ket, s) {
+ /** @type {!number} */
+ var adjustment;
+ adjustment = this.replace_s$IIS(c_bra, c_ket, s);
+ if (c_bra <= this.bra) {
+ this.bra += (adjustment | 0);
+ }
+ if (c_bra <= this.ket) {
+ this.ket += (adjustment | 0);
+ }
+};
+
+/**
+ * @param {!string} s
+ * @return {!string}
+ */
+BaseStemmer.prototype.slice_to$S = function (s) {
+ /** @type {!string} */
+ var result;
+ /** @type {!number} */
+ var bra$0;
+ /** @type {!number} */
+ var ket$0;
+ /** @type {!number} */
+ var limit$0;
+ result = '';
+ if ((bra$0 = this.bra) < 0 || bra$0 > (ket$0 = this.ket) || ket$0 > (limit$0 = this.limit) || limit$0 > this.current.length ? false : true) {
+ result = this.current.slice(this.bra, this.ket);
+ }
+ return result;
+};
+
+/**
+ * @param {!string} s
+ * @return {!string}
+ */
+BaseStemmer.prototype.assign_to$S = function (s) {
+ return this.current.slice(0, this.limit);
+};
+
+/**
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.stem$ = function () {
+ return false;
+};
+
+/**
+ * @param {!string} word
+ * @return {!string}
+ */
+BaseStemmer.prototype.stemWord$S = function (word) {
+ /** @type {undefined|!string} */
+ var result;
+ /** @type {!string} */
+ var current$0;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var limit$0;
+ result = this.cache['.' + word];
+ if (result == null) {
+ current$0 = this.current = word;
+ cursor$0 = this.cursor = 0;
+ limit$0 = this.limit = current$0.length;
+ this.limit_backward = 0;
+ this.bra = cursor$0;
+ this.ket = limit$0;
+ this.stem$();
+ result = this.current;
+ this.cache['.' + word] = result;
+ }
+ return result;
+};
+
+/**
+ * @param {Array.<undefined|!string>} words
+ * @return {Array.<undefined|!string>}
+ */
+BaseStemmer.prototype.stemWords$AS = function (words) {
+ /** @type {Array.<undefined|!string>} */
+ var results;
+ /** @type {!number} */
+ var i;
+ /** @type {undefined|!string} */
+ var word;
+ /** @type {undefined|!string} */
+ var result;
+ /** @type {!string} */
+ var current$0;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var limit$0;
+ results = [ ];
+ for (i = 0; i < words.length; i++) {
+ word = words[i];
+ result = this.cache['.' + word];
+ if (result == null) {
+ current$0 = this.current = word;
+ cursor$0 = this.cursor = 0;
+ limit$0 = this.limit = current$0.length;
+ this.limit_backward = 0;
+ this.bra = cursor$0;
+ this.ket = limit$0;
+ this.stem$();
+ result = this.current;
+ this.cache['.' + word] = result;
+ }
+ results.push(result);
+ }
+ return results;
+};
+
+/**
+ * class EnglishStemmer extends BaseStemmer
+ * @constructor
+ */
+function EnglishStemmer() {
+}
+
+EnglishStemmer.prototype = new BaseStemmer;
+/**
+ * @constructor
+ */
+function EnglishStemmer$() {
+ BaseStemmer$.call(this);
+ this.B_Y_found = false;
+ this.I_p2 = 0;
+ this.I_p1 = 0;
+};
+
+EnglishStemmer$.prototype = new EnglishStemmer;
+
+/**
+ * @param {EnglishStemmer} other
+ */
+EnglishStemmer.prototype.copy_from$LEnglishStemmer$ = function (other) {
+ this.B_Y_found = other.B_Y_found;
+ this.I_p2 = other.I_p2;
+ this.I_p1 = other.I_p1;
+ BaseStemmer.prototype.copy_from$LBaseStemmer$.call(this, other);
+};
+
+/**
+ * @return {!boolean}
+ */
+EnglishStemmer.prototype.r_prelude$ = function () {
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var v_3;
+ /** @type {!number} */
+ var v_4;
+ /** @type {!number} */
+ var v_5;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!boolean} */
+ var lab2;
+ /** @type {!boolean} */
+ var lab4;
+ /** @type {!boolean} */
+ var lab6;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var cursor$1;
+ /** @type {!number} */
+ var cursor$2;
+ this.B_Y_found = false;
+ v_1 = this.cursor;
+ lab0 = true;
+lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ this.bra = this.cursor;
+ if (! this.eq_s$IS(1, "'")) {
+ break lab0;
+ }
+ this.ket = this.cursor;
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ }
+ cursor$0 = this.cursor = v_1;
+ v_2 = cursor$0;
+ lab1 = true;
+lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ this.bra = this.cursor;
+ if (! this.eq_s$IS(1, "y")) {
+ break lab1;
+ }
+ this.ket = this.cursor;
+ if (! this.slice_from$S("Y")) {
+ return false;
+ }
+ this.B_Y_found = true;
+ }
+ cursor$2 = this.cursor = v_2;
+ v_3 = cursor$2;
+ lab2 = true;
+lab2:
+ while (lab2 === true) {
+ lab2 = false;
+ replab3:
+ while (true) {
+ v_4 = this.cursor;
+ lab4 = true;
+ lab4:
+ while (lab4 === true) {
+ lab4 = false;
+ golab5:
+ while (true) {
+ v_5 = this.cursor;
+ lab6 = true;
+ lab6:
+ while (lab6 === true) {
+ lab6 = false;
+ if (! this.in_grouping$AIII(EnglishStemmer.g_v, 97, 121)) {
+ break lab6;
+ }
+ this.bra = this.cursor;
+ if (! this.eq_s$IS(1, "y")) {
+ break lab6;
+ }
+ this.ket = this.cursor;
+ this.cursor = v_5;
+ break golab5;
+ }
+ cursor$1 = this.cursor = v_5;
+ if (cursor$1 >= this.limit) {
+ break lab4;
+ }
+ this.cursor++;
+ }
+ if (! this.slice_from$S("Y")) {
+ return false;
+ }
+ this.B_Y_found = true;
+ continue replab3;
+ }
+ this.cursor = v_4;
+ break replab3;
+ }
+ }
+ this.cursor = v_3;
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+EnglishStemmer.prototype.r_mark_regions$ = function () {
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!boolean} */
+ var lab2;
+ /** @type {!boolean} */
+ var lab4;
+ /** @type {!boolean} */
+ var lab6;
+ /** @type {!boolean} */
+ var lab8;
+ /** @type {!boolean} */
+ var lab10;
+ /** @type {!number} */
+ var limit$0;
+ this.I_p1 = limit$0 = this.limit;
+ this.I_p2 = limit$0;
+ v_1 = this.cursor;
+ lab0 = true;
+lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ v_2 = this.cursor;
+ lab2 = true;
+ lab2:
+ while (lab2 === true) {
+ lab2 = false;
+ if (this.find_among$ALAmong$I(EnglishStemmer.a_0, 3) === 0) {
+ break lab2;
+ }
+ break lab1;
+ }
+ this.cursor = v_2;
+ golab3:
+ while (true) {
+ lab4 = true;
+ lab4:
+ while (lab4 === true) {
+ lab4 = false;
+ if (! this.in_grouping$AIII(EnglishStemmer.g_v, 97, 121)) {
+ break lab4;
+ }
+ break golab3;
+ }
+ if (this.cursor >= this.limit) {
+ break lab0;
+ }
+ this.cursor++;
+ }
+ golab5:
+ while (true) {
+ lab6 = true;
+ lab6:
+ while (lab6 === true) {
+ lab6 = false;
+ if (! this.out_grouping$AIII(EnglishStemmer.g_v, 97, 121)) {
+ break lab6;
+ }
+ break golab5;
+ }
+ if (this.cursor >= this.limit) {
+ break lab0;
+ }
+ this.cursor++;
+ }
+ }
+ this.I_p1 = this.cursor;
+ golab7:
+ while (true) {
+ lab8 = true;
+ lab8:
+ while (lab8 === true) {
+ lab8 = false;
+ if (! this.in_grouping$AIII(EnglishStemmer.g_v, 97, 121)) {
+ break lab8;
+ }
+ break golab7;
+ }
+ if (this.cursor >= this.limit) {
+ break lab0;
+ }
+ this.cursor++;
+ }
+ golab9:
+ while (true) {
+ lab10 = true;
+ lab10:
+ while (lab10 === true) {
+ lab10 = false;
+ if (! this.out_grouping$AIII(EnglishStemmer.g_v, 97, 121)) {
+ break lab10;
+ }
+ break golab9;
+ }
+ if (this.cursor >= this.limit) {
+ break lab0;
+ }
+ this.cursor++;
+ }
+ this.I_p2 = this.cursor;
+ }
+ this.cursor = v_1;
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+EnglishStemmer.prototype.r_shortv$ = function () {
+ /** @type {!number} */
+ var v_1;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!boolean} */
+ var lab1;
+ lab0 = true;
+lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ v_1 = this.limit - this.cursor;
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ if (! this.out_grouping_b$AIII(EnglishStemmer.g_v_WXY, 89, 121)) {
+ break lab1;
+ }
+ if (! this.in_grouping_b$AIII(EnglishStemmer.g_v, 97, 121)) {
+ break lab1;
+ }
+ if (! this.out_grouping_b$AIII(EnglishStemmer.g_v, 97, 121)) {
+ break lab1;
+ }
+ break lab0;
+ }
+ this.cursor = this.limit - v_1;
+ if (! this.out_grouping_b$AIII(EnglishStemmer.g_v, 97, 121)) {
+ return false;
+ }
+ if (! this.in_grouping_b$AIII(EnglishStemmer.g_v, 97, 121)) {
+ return false;
+ }
+ if (this.cursor > this.limit_backward) {
+ return false;
+ }
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+EnglishStemmer.prototype.r_R1$ = function () {
+ return (! (this.I_p1 <= this.cursor) ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+EnglishStemmer.prototype.r_R2$ = function () {
+ return (! (this.I_p2 <= this.cursor) ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+EnglishStemmer.prototype.r_Step_1a$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!boolean} */
+ var lab2;
+ /** @type {!number} */
+ var c;
+ /** @type {!boolean} */
+ var lab4;
+ v_1 = this.limit - this.cursor;
+ lab0 = true;
+lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ this.ket = this.cursor;
+ among_var = this.find_among_b$ALAmong$I(EnglishStemmer.a_1, 3);
+ if (among_var === 0) {
+ this.cursor = this.limit - v_1;
+ break lab0;
+ }
+ this.bra = this.cursor;
+ switch (among_var) {
+ case 0:
+ this.cursor = this.limit - v_1;
+ break lab0;
+ case 1:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ }
+ }
+ this.ket = this.cursor;
+ among_var = this.find_among_b$ALAmong$I(EnglishStemmer.a_2, 6);
+ if (among_var === 0) {
+ return false;
+ }
+ this.bra = this.cursor;
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ if (! this.slice_from$S("ss")) {
+ return false;
+ }
+ break;
+ case 2:
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ v_2 = this.limit - this.cursor;
+ lab2 = true;
+ lab2:
+ while (lab2 === true) {
+ lab2 = false;
+ c = (this.cursor - 2 | 0);
+ if (this.limit_backward > c || c > this.limit) {
+ break lab2;
+ }
+ this.cursor = c;
+ if (! this.slice_from$S("i")) {
+ return false;
+ }
+ break lab1;
+ }
+ this.cursor = this.limit - v_2;
+ if (! this.slice_from$S("ie")) {
+ return false;
+ }
+ }
+ break;
+ case 3:
+ if (this.cursor <= this.limit_backward) {
+ return false;
+ }
+ this.cursor--;
+ golab3:
+ while (true) {
+ lab4 = true;
+ lab4:
+ while (lab4 === true) {
+ lab4 = false;
+ if (! this.in_grouping_b$AIII(EnglishStemmer.g_v, 97, 121)) {
+ break lab4;
+ }
+ break golab3;
+ }
+ if (this.cursor <= this.limit_backward) {
+ return false;
+ }
+ this.cursor--;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+EnglishStemmer.prototype.r_Step_1b$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_3;
+ /** @type {!number} */
+ var v_4;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!number} */
+ var c;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var cursor$1;
+ /** @type {!number} */
+ var cursor$2;
+ this.ket = this.cursor;
+ among_var = this.find_among_b$ALAmong$I(EnglishStemmer.a_4, 6);
+ if (among_var === 0) {
+ return false;
+ }
+ this.bra = this.cursor;
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ if (! (! (this.I_p1 <= this.cursor) ? false : true)) {
+ return false;
+ }
+ if (! this.slice_from$S("ee")) {
+ return false;
+ }
+ break;
+ case 2:
+ v_1 = this.limit - this.cursor;
+ golab0:
+ while (true) {
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ if (! this.in_grouping_b$AIII(EnglishStemmer.g_v, 97, 121)) {
+ break lab1;
+ }
+ break golab0;
+ }
+ if (this.cursor <= this.limit_backward) {
+ return false;
+ }
+ this.cursor--;
+ }
+ this.cursor = this.limit - v_1;
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ v_3 = this.limit - this.cursor;
+ among_var = this.find_among_b$ALAmong$I(EnglishStemmer.a_3, 13);
+ if (among_var === 0) {
+ return false;
+ }
+ this.cursor = this.limit - v_3;
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ c = cursor$0 = this.cursor;
+ this.insert$IIS(cursor$0, cursor$0, "e");
+ this.cursor = c;
+ break;
+ case 2:
+ this.ket = cursor$1 = this.cursor;
+ if (cursor$1 <= this.limit_backward) {
+ return false;
+ }
+ this.cursor--;
+ this.bra = this.cursor;
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 3:
+ if (this.cursor !== this.I_p1) {
+ return false;
+ }
+ v_4 = this.limit - this.cursor;
+ if (! this.r_shortv$()) {
+ return false;
+ }
+ cursor$2 = this.cursor = this.limit - v_4;
+ c = cursor$2;
+ this.insert$IIS(cursor$2, cursor$2, "e");
+ this.cursor = cursor$2;
+ break;
+ }
+ break;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+EnglishStemmer.prototype.r_Step_1c$ = function () {
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!boolean} */
+ var lab2;
+ this.ket = this.cursor;
+ lab0 = true;
+lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ v_1 = this.limit - this.cursor;
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ if (! this.eq_s_b$IS(1, "y")) {
+ break lab1;
+ }
+ break lab0;
+ }
+ this.cursor = this.limit - v_1;
+ if (! this.eq_s_b$IS(1, "Y")) {
+ return false;
+ }
+ }
+ this.bra = this.cursor;
+ if (! this.out_grouping_b$AIII(EnglishStemmer.g_v, 97, 121)) {
+ return false;
+ }
+ v_2 = this.limit - this.cursor;
+ lab2 = true;
+lab2:
+ while (lab2 === true) {
+ lab2 = false;
+ if (this.cursor > this.limit_backward) {
+ break lab2;
+ }
+ return false;
+ }
+ this.cursor = this.limit - v_2;
+ return (! this.slice_from$S("i") ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+EnglishStemmer.prototype.r_Step_2$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var cursor$0;
+ this.ket = this.cursor;
+ among_var = this.find_among_b$ALAmong$I(EnglishStemmer.a_5, 24);
+ if (among_var === 0) {
+ return false;
+ }
+ this.bra = cursor$0 = this.cursor;
+ if (! (! (this.I_p1 <= cursor$0) ? false : true)) {
+ return false;
+ }
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ if (! this.slice_from$S("tion")) {
+ return false;
+ }
+ break;
+ case 2:
+ if (! this.slice_from$S("ence")) {
+ return false;
+ }
+ break;
+ case 3:
+ if (! this.slice_from$S("ance")) {
+ return false;
+ }
+ break;
+ case 4:
+ if (! this.slice_from$S("able")) {
+ return false;
+ }
+ break;
+ case 5:
+ if (! this.slice_from$S("ent")) {
+ return false;
+ }
+ break;
+ case 6:
+ if (! this.slice_from$S("ize")) {
+ return false;
+ }
+ break;
+ case 7:
+ if (! this.slice_from$S("ate")) {
+ return false;
+ }
+ break;
+ case 8:
+ if (! this.slice_from$S("al")) {
+ return false;
+ }
+ break;
+ case 9:
+ if (! this.slice_from$S("ful")) {
+ return false;
+ }
+ break;
+ case 10:
+ if (! this.slice_from$S("ous")) {
+ return false;
+ }
+ break;
+ case 11:
+ if (! this.slice_from$S("ive")) {
+ return false;
+ }
+ break;
+ case 12:
+ if (! this.slice_from$S("ble")) {
+ return false;
+ }
+ break;
+ case 13:
+ if (! this.eq_s_b$IS(1, "l")) {
+ return false;
+ }
+ if (! this.slice_from$S("og")) {
+ return false;
+ }
+ break;
+ case 14:
+ if (! this.slice_from$S("ful")) {
+ return false;
+ }
+ break;
+ case 15:
+ if (! this.slice_from$S("less")) {
+ return false;
+ }
+ break;
+ case 16:
+ if (! this.in_grouping_b$AIII(EnglishStemmer.g_valid_LI, 99, 116)) {
+ return false;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+EnglishStemmer.prototype.r_Step_3$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var cursor$0;
+ this.ket = this.cursor;
+ among_var = this.find_among_b$ALAmong$I(EnglishStemmer.a_6, 9);
+ if (among_var === 0) {
+ return false;
+ }
+ this.bra = cursor$0 = this.cursor;
+ if (! (! (this.I_p1 <= cursor$0) ? false : true)) {
+ return false;
+ }
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ if (! this.slice_from$S("tion")) {
+ return false;
+ }
+ break;
+ case 2:
+ if (! this.slice_from$S("ate")) {
+ return false;
+ }
+ break;
+ case 3:
+ if (! this.slice_from$S("al")) {
+ return false;
+ }
+ break;
+ case 4:
+ if (! this.slice_from$S("ic")) {
+ return false;
+ }
+ break;
+ case 5:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 6:
+ if (! (! (this.I_p2 <= this.cursor) ? false : true)) {
+ return false;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+EnglishStemmer.prototype.r_Step_4$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var v_1;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!number} */
+ var cursor$0;
+ this.ket = this.cursor;
+ among_var = this.find_among_b$ALAmong$I(EnglishStemmer.a_7, 18);
+ if (among_var === 0) {
+ return false;
+ }
+ this.bra = cursor$0 = this.cursor;
+ if (! (! (this.I_p2 <= cursor$0) ? false : true)) {
+ return false;
+ }
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 2:
+ lab0 = true;
+ lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ v_1 = this.limit - this.cursor;
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ if (! this.eq_s_b$IS(1, "s")) {
+ break lab1;
+ }
+ break lab0;
+ }
+ this.cursor = this.limit - v_1;
+ if (! this.eq_s_b$IS(1, "t")) {
+ return false;
+ }
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+EnglishStemmer.prototype.r_Step_5$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!boolean} */
+ var lab2;
+ /** @type {!number} */
+ var cursor$0;
+ this.ket = this.cursor;
+ among_var = this.find_among_b$ALAmong$I(EnglishStemmer.a_8, 2);
+ if (among_var === 0) {
+ return false;
+ }
+ this.bra = this.cursor;
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ lab0 = true;
+ lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ v_1 = this.limit - this.cursor;
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ if (! (! (this.I_p2 <= this.cursor) ? false : true)) {
+ break lab1;
+ }
+ break lab0;
+ }
+ cursor$0 = this.cursor = this.limit - v_1;
+ if (! (! (this.I_p1 <= cursor$0) ? false : true)) {
+ return false;
+ }
+ v_2 = this.limit - this.cursor;
+ lab2 = true;
+ lab2:
+ while (lab2 === true) {
+ lab2 = false;
+ if (! this.r_shortv$()) {
+ break lab2;
+ }
+ return false;
+ }
+ this.cursor = this.limit - v_2;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 2:
+ if (! (! (this.I_p2 <= this.cursor) ? false : true)) {
+ return false;
+ }
+ if (! this.eq_s_b$IS(1, "l")) {
+ return false;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+EnglishStemmer.prototype.r_exception2$ = function () {
+ /** @type {!number} */
+ var cursor$0;
+ this.ket = this.cursor;
+ if (this.find_among_b$ALAmong$I(EnglishStemmer.a_9, 8) === 0) {
+ return false;
+ }
+ this.bra = cursor$0 = this.cursor;
+ return (cursor$0 > this.limit_backward ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+EnglishStemmer.prototype.r_exception1$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var cursor$0;
+ this.bra = this.cursor;
+ among_var = this.find_among$ALAmong$I(EnglishStemmer.a_10, 18);
+ if (among_var === 0) {
+ return false;
+ }
+ this.ket = cursor$0 = this.cursor;
+ if (cursor$0 < this.limit) {
+ return false;
+ }
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ if (! this.slice_from$S("ski")) {
+ return false;
+ }
+ break;
+ case 2:
+ if (! this.slice_from$S("sky")) {
+ return false;
+ }
+ break;
+ case 3:
+ if (! this.slice_from$S("die")) {
+ return false;
+ }
+ break;
+ case 4:
+ if (! this.slice_from$S("lie")) {
+ return false;
+ }
+ break;
+ case 5:
+ if (! this.slice_from$S("tie")) {
+ return false;
+ }
+ break;
+ case 6:
+ if (! this.slice_from$S("idl")) {
+ return false;
+ }
+ break;
+ case 7:
+ if (! this.slice_from$S("gentl")) {
+ return false;
+ }
+ break;
+ case 8:
+ if (! this.slice_from$S("ugli")) {
+ return false;
+ }
+ break;
+ case 9:
+ if (! this.slice_from$S("earli")) {
+ return false;
+ }
+ break;
+ case 10:
+ if (! this.slice_from$S("onli")) {
+ return false;
+ }
+ break;
+ case 11:
+ if (! this.slice_from$S("singl")) {
+ return false;
+ }
+ break;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+EnglishStemmer.prototype.r_postlude$ = function () {
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!boolean} */
+ var lab3;
+ /** @type {!number} */
+ var cursor$0;
+ if (! this.B_Y_found) {
+ return false;
+ }
+replab0:
+ while (true) {
+ v_1 = this.cursor;
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ golab2:
+ while (true) {
+ v_2 = this.cursor;
+ lab3 = true;
+ lab3:
+ while (lab3 === true) {
+ lab3 = false;
+ this.bra = this.cursor;
+ if (! this.eq_s$IS(1, "Y")) {
+ break lab3;
+ }
+ this.ket = this.cursor;
+ this.cursor = v_2;
+ break golab2;
+ }
+ cursor$0 = this.cursor = v_2;
+ if (cursor$0 >= this.limit) {
+ break lab1;
+ }
+ this.cursor++;
+ }
+ if (! this.slice_from$S("y")) {
+ return false;
+ }
+ continue replab0;
+ }
+ this.cursor = v_1;
+ break replab0;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+EnglishStemmer.prototype.stem$ = function () {
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var v_3;
+ /** @type {!number} */
+ var v_4;
+ /** @type {!number} */
+ var v_5;
+ /** @type {!number} */
+ var v_6;
+ /** @type {!number} */
+ var v_7;
+ /** @type {!number} */
+ var v_8;
+ /** @type {!number} */
+ var v_9;
+ /** @type {!number} */
+ var v_10;
+ /** @type {!number} */
+ var v_11;
+ /** @type {!number} */
+ var v_12;
+ /** @type {!number} */
+ var v_13;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!boolean} */
+ var lab2;
+ /** @type {!boolean} */
+ var lab3;
+ /** @type {!number} */
+ var c;
+ /** @type {!boolean} */
+ var lab4;
+ /** @type {!boolean} */
+ var lab5;
+ /** @type {!boolean} */
+ var lab6;
+ /** @type {!boolean} */
+ var lab7;
+ /** @type {!boolean} */
+ var lab8;
+ /** @type {!boolean} */
+ var lab9;
+ /** @type {!boolean} */
+ var lab10;
+ /** @type {!boolean} */
+ var lab11;
+ /** @type {!boolean} */
+ var lab12;
+ /** @type {!boolean} */
+ var lab13;
+ /** @type {!boolean} */
+ var lab14;
+ /** @type {!boolean} */
+ var lab15;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var cursor$1;
+ /** @type {!number} */
+ var cursor$2;
+ /** @type {!number} */
+ var limit$0;
+ /** @type {!number} */
+ var cursor$3;
+ /** @type {!number} */
+ var limit$1;
+ /** @type {!number} */
+ var cursor$4;
+ /** @type {!number} */
+ var limit$2;
+ /** @type {!number} */
+ var cursor$5;
+ /** @type {!number} */
+ var limit$3;
+ /** @type {!number} */
+ var cursor$6;
+ /** @type {!number} */
+ var limit$4;
+ /** @type {!number} */
+ var cursor$7;
+ /** @type {!number} */
+ var limit$5;
+ /** @type {!number} */
+ var cursor$8;
+ /** @type {!number} */
+ var limit$6;
+ /** @type {!number} */
+ var cursor$9;
+ /** @type {!number} */
+ var cursor$10;
+ lab0 = true;
+lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ v_1 = this.cursor;
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ if (! this.r_exception1$()) {
+ break lab1;
+ }
+ break lab0;
+ }
+ this.cursor = v_1;
+ lab2 = true;
+ lab2:
+ while (lab2 === true) {
+ lab2 = false;
+ v_2 = this.cursor;
+ lab3 = true;
+ lab3:
+ while (lab3 === true) {
+ lab3 = false;
+ c = (this.cursor + 3 | 0);
+ if (0 > c || c > this.limit) {
+ break lab3;
+ }
+ this.cursor = c;
+ break lab2;
+ }
+ this.cursor = v_2;
+ break lab0;
+ }
+ cursor$0 = this.cursor = v_1;
+ v_3 = cursor$0;
+ lab4 = true;
+ lab4:
+ while (lab4 === true) {
+ lab4 = false;
+ if (! this.r_prelude$()) {
+ break lab4;
+ }
+ }
+ cursor$1 = this.cursor = v_3;
+ v_4 = cursor$1;
+ lab5 = true;
+ lab5:
+ while (lab5 === true) {
+ lab5 = false;
+ if (! this.r_mark_regions$()) {
+ break lab5;
+ }
+ }
+ cursor$2 = this.cursor = v_4;
+ this.limit_backward = cursor$2;
+ cursor$3 = this.cursor = limit$0 = this.limit;
+ v_5 = limit$0 - cursor$3;
+ lab6 = true;
+ lab6:
+ while (lab6 === true) {
+ lab6 = false;
+ if (! this.r_Step_1a$()) {
+ break lab6;
+ }
+ }
+ this.cursor = this.limit - v_5;
+ lab7 = true;
+ lab7:
+ while (lab7 === true) {
+ lab7 = false;
+ v_6 = this.limit - this.cursor;
+ lab8 = true;
+ lab8:
+ while (lab8 === true) {
+ lab8 = false;
+ if (! this.r_exception2$()) {
+ break lab8;
+ }
+ break lab7;
+ }
+ cursor$4 = this.cursor = (limit$1 = this.limit) - v_6;
+ v_7 = limit$1 - cursor$4;
+ lab9 = true;
+ lab9:
+ while (lab9 === true) {
+ lab9 = false;
+ if (! this.r_Step_1b$()) {
+ break lab9;
+ }
+ }
+ cursor$5 = this.cursor = (limit$2 = this.limit) - v_7;
+ v_8 = limit$2 - cursor$5;
+ lab10 = true;
+ lab10:
+ while (lab10 === true) {
+ lab10 = false;
+ if (! this.r_Step_1c$()) {
+ break lab10;
+ }
+ }
+ cursor$6 = this.cursor = (limit$3 = this.limit) - v_8;
+ v_9 = limit$3 - cursor$6;
+ lab11 = true;
+ lab11:
+ while (lab11 === true) {
+ lab11 = false;
+ if (! this.r_Step_2$()) {
+ break lab11;
+ }
+ }
+ cursor$7 = this.cursor = (limit$4 = this.limit) - v_9;
+ v_10 = limit$4 - cursor$7;
+ lab12 = true;
+ lab12:
+ while (lab12 === true) {
+ lab12 = false;
+ if (! this.r_Step_3$()) {
+ break lab12;
+ }
+ }
+ cursor$8 = this.cursor = (limit$5 = this.limit) - v_10;
+ v_11 = limit$5 - cursor$8;
+ lab13 = true;
+ lab13:
+ while (lab13 === true) {
+ lab13 = false;
+ if (! this.r_Step_4$()) {
+ break lab13;
+ }
+ }
+ cursor$9 = this.cursor = (limit$6 = this.limit) - v_11;
+ v_12 = limit$6 - cursor$9;
+ lab14 = true;
+ lab14:
+ while (lab14 === true) {
+ lab14 = false;
+ if (! this.r_Step_5$()) {
+ break lab14;
+ }
+ }
+ this.cursor = this.limit - v_12;
+ }
+ cursor$10 = this.cursor = this.limit_backward;
+ v_13 = cursor$10;
+ lab15 = true;
+ lab15:
+ while (lab15 === true) {
+ lab15 = false;
+ if (! this.r_postlude$()) {
+ break lab15;
+ }
+ }
+ this.cursor = v_13;
+ }
+ return true;
+};
+
+/**
+ * @param {*} o
+ * @return {!boolean}
+ */
+EnglishStemmer.prototype.equals$X = function (o) {
+ return o instanceof EnglishStemmer;
+};
+
+/**
+ * @return {!number}
+ */
+EnglishStemmer.prototype.hashCode$ = function () {
+ /** @type {!string} */
+ var classname;
+ /** @type {!number} */
+ var hash;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var char;
+ classname = "EnglishStemmer";
+ hash = 0;
+ if ("EnglishStemmer".length === 0) {
+ return (hash | 0);
+ }
+ for (i = 0; i < classname.length; i++) {
+ char = classname.charCodeAt(i);
+ hash = (hash << 5) - hash + char;
+ hash = hash & hash;
+ }
+ return (hash | 0);
+};
+
+/**
+ * class Among extends Object
+ * @constructor
+ */
+function Among() {
+}
+
+/**
+ * @constructor
+ * @param {!string} s
+ * @param {!number} substring_i
+ * @param {!number} result
+ */
+function Among$SII(s, substring_i, result) {
+ this.s_size = s.length;
+ this.s = s;
+ this.substring_i = substring_i;
+ this.result = result;
+ this.method = null;
+ this.instance = null;
+};
+
+Among$SII.prototype = new Among;
+
+/**
+ * @constructor
+ * @param {!string} s
+ * @param {!number} substring_i
+ * @param {!number} result
+ * @param {*} method
+ * @param {BaseStemmer} instance
+ */
+function Among$SIIF$LBaseStemmer$B$LBaseStemmer$(s, substring_i, result, method, instance) {
+ this.s_size = s.length;
+ this.s = s;
+ this.substring_i = substring_i;
+ this.result = result;
+ this.method = method;
+ this.instance = instance;
+};
+
+Among$SIIF$LBaseStemmer$B$LBaseStemmer$.prototype = new Among;
+
+/**
+ * class WaveletMatrix extends Object
+ * @constructor
+ */
+function WaveletMatrix() {
+}
+
+/**
+ * @constructor
+ */
+function WaveletMatrix$() {
+ /** @type {Array.<undefined|BitVector>} */
+ var _bv$0;
+ /** @type {Array.<undefined|!number>} */
+ var _seps$0;
+ this._range = ({ });
+ _bv$0 = this._bv = [ ];
+ _seps$0 = this._seps = [ ];
+ this._bitsize = 16;
+ _bv$0.length = 0;
+ _seps$0.length = 0;
+ this._size = 0;
+};
+
+WaveletMatrix$.prototype = new WaveletMatrix;
+
+/**
+ * @return {!number}
+ */
+WaveletMatrix.prototype.bitsize$ = function () {
+ return this._bitsize;
+};
+
+/**
+ * @param {!number} charCode
+ */
+WaveletMatrix.prototype.setMaxCharCode$I = function (charCode) {
+ this._bitsize = (Math.ceil(Math.log(charCode) / 0.6931471805599453) | 0);
+};
+
+/**
+ */
+WaveletMatrix.prototype.clear$ = function () {
+ this._bv.length = 0;
+ this._seps.length = 0;
+ this._size = 0;
+};
+
+/**
+ * @param {!string} v
+ */
+WaveletMatrix.prototype.build$S = function (v) {
+ /** @type {!number} */
+ var size;
+ /** @type {!number} */
+ var bitsize;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var depth;
+ /** @type {Object.<string, undefined|!number>} */
+ var range_tmp;
+ /** @type {!number} */
+ var code;
+ /** @type {!boolean} */
+ var bit;
+ /** @type {!number} */
+ var key;
+ /** @type {Object.<string, undefined|!number>} */
+ var range_rev;
+ /** @type {!string} */
+ var range_key;
+ /** @type {!number} */
+ var value;
+ /** @type {!number} */
+ var pos0;
+ /** @type {undefined|!number} */
+ var pos1;
+ /** @type {!string} */
+ var range_rev_key;
+ /** @type {!number} */
+ var begin;
+ /** @type {undefined|!number} */
+ var end;
+ /** @type {!number} */
+ var num0;
+ /** @type {!number} */
+ var num1;
+ this._bv.length = 0;
+ this._seps.length = 0;
+ this._size = 0;
+ size = v.length;
+ bitsize = this._bitsize;
+ for (i = 0; i < bitsize; i++) {
+ this._bv.push(new BitVector$());
+ this._seps.push(0);
+ }
+ this._size = (size | 0);
+ for (i = 0; i < size; i++) {
+ this._bv[0].set$IB(i, this._uint2bit$II(v.charCodeAt(i), 0));
+ }
+ this._bv[0].build$();
+ this._seps[0] = this._bv[0].size$B(false);
+ this._range["0"] = 0;
+ this._range["1"] = this._seps[0];
+ depth = 1;
+ while (depth < bitsize) {
+ range_tmp = WaveletMatrix$_shallow_copy$HI(this._range);
+ for (i = 0; i < size; i++) {
+ code = v.charCodeAt(i);
+ bit = this._uint2bit$II(code, depth);
+ key = code >>> bitsize - depth;
+ this._bv[depth].set$IB(range_tmp[key + ""], bit);
+ range_tmp[key + ""]++;
+ }
+ this._bv[depth].build$();
+ this._seps[depth] = this._bv[depth].size$B(false);
+ range_rev = ({ });
+ for (range_key in this._range) {
+ value = this._range[range_key];
+ if (value != range_tmp[range_key]) {
+ range_rev[value + ""] = range_key | 0;
+ }
+ }
+ this._range = ({ });
+ pos0 = 0;
+ pos1 = this._seps[depth];
+ for (range_rev_key in range_rev) {
+ begin = range_rev_key | 0;
+ value = range_rev[range_rev_key];
+ end = range_tmp[value + ""];
+ num0 = this._bv[depth].rank$IB(end, false) - this._bv[depth].rank$IB(begin, false);
+ num1 = end - begin - num0;
+ if (num0 > 0) {
+ this._range[(value << 1) + ""] = (pos0 | 0);
+ pos0 += num0;
+ }
+ if (num1 > 0) {
+ this._range[(value << 1) + 1 + ""] = pos1;
+ pos1 += (num1 | 0);
+ }
+ }
+ depth++;
+ }
+};
+
+/**
+ * @return {!number}
+ */
+WaveletMatrix.prototype.size$ = function () {
+ return this._size;
+};
+
+/**
+ * @param {!number} c
+ * @return {!number}
+ */
+WaveletMatrix.prototype.size$I = function (c) {
+ return this.rank$II(this._size, c);
+};
+
+/**
+ * @param {!number} i
+ * @return {!number}
+ */
+WaveletMatrix.prototype.get$I = function (i) {
+ /** @type {!number} */
+ var value;
+ /** @type {!number} */
+ var depth;
+ /** @type {!boolean} */
+ var bit;
+ if (i >= this._size) {
+ throw new Error("WaveletMatrix.get() : range error");
+ }
+ value = 0;
+ depth = 0;
+ while (depth < this._bitsize) {
+ bit = this._bv[depth].get$I(i);
+ i = this._bv[depth].rank$IB(i, bit);
+ value <<= 1;
+ if (bit) {
+ i += this._seps[depth];
+ value += 1;
+ }
+ depth++;
+ }
+ return (value | 0);
+};
+
+/**
+ * @param {!number} i
+ * @param {!number} c
+ * @return {!number}
+ */
+WaveletMatrix.prototype.rank$II = function (i, c) {
+ /** @type {undefined|!number} */
+ var begin;
+ /** @type {!number} */
+ var end;
+ /** @type {!number} */
+ var depth;
+ /** @type {!boolean} */
+ var bit;
+ if (i > this._size) {
+ throw new Error("WaveletMatrix.rank(): range error");
+ }
+ if (i === 0) {
+ return 0;
+ }
+ begin = this._range[c + ""];
+ if (begin == null) {
+ return 0;
+ }
+ end = i;
+ depth = 0;
+ while (depth < this._bitsize) {
+ bit = this._uint2bit$II(c, depth);
+ end = this._bv[depth].rank$IB(end, bit);
+ if (bit) {
+ end += this._seps[depth];
+ }
+ depth++;
+ }
+ return (end - begin | 0);
+};
+
+/**
+ * @param {!number} i
+ * @param {!number} c
+ * @return {!number}
+ */
+WaveletMatrix.prototype.rank_less_than$II = function (i, c) {
+ /** @type {!number} */
+ var begin;
+ /** @type {!number} */
+ var end;
+ /** @type {!number} */
+ var depth;
+ /** @type {!number} */
+ var rlt;
+ /** @type {!number} */
+ var rank0_begin;
+ /** @type {!number} */
+ var rank0_end;
+ /** @type {Array.<undefined|!number>} */
+ var _seps$0;
+ if (i > this._size) {
+ throw new Error("WaveletMatrix.rank_less_than(): range error");
+ }
+ if (i === 0) {
+ return 0;
+ }
+ begin = 0;
+ end = i;
+ depth = 0;
+ rlt = 0;
+ while (depth < this._bitsize) {
+ rank0_begin = this._bv[depth].rank$IB(begin, false);
+ rank0_end = this._bv[depth].rank$IB(end, false);
+ if (this._uint2bit$II(c, depth)) {
+ rlt += rank0_end - rank0_begin;
+ begin += (_seps$0 = this._seps)[depth] - rank0_begin;
+ end += _seps$0[depth] - rank0_end;
+ } else {
+ begin = rank0_begin;
+ end = rank0_end;
+ }
+ depth++;
+ }
+ return (rlt | 0);
+};
+
+/**
+ * @return {!string}
+ */
+WaveletMatrix.prototype.dump$ = function () {
+ /** @type {Array.<undefined|!string>} */
+ var contents;
+ /** @type {!number} */
+ var i;
+ /** @type {Array.<undefined|!string>} */
+ var range_contents;
+ /** @type {!number} */
+ var counter;
+ /** @type {!string} */
+ var key;
+ contents = [ Binary$dump16bitNumber$I(this._bitsize), Binary$dump32bitNumber$N(this._size) ];
+ for (i = 0; i < this._bitsize; i++) {
+ contents.push(this._bv[i].dump$());
+ }
+ for (i = 0; i < this._bitsize; i++) {
+ contents.push(Binary$dump32bitNumber$N(this._seps[i]));
+ }
+ range_contents = [ ];
+ counter = 0;
+ for (key in this._range) {
+ range_contents.push(Binary$dump32bitNumber$N(key | 0));
+ range_contents.push(Binary$dump32bitNumber$N(this._range[key]));
+ counter++;
+ }
+ contents.push(Binary$dump32bitNumber$N(counter));
+ return contents.join('') + range_contents.join('');
+};
+
+/**
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+WaveletMatrix.prototype.dump$LCompressionReport$ = function (report) {
+ /** @type {Array.<undefined|!string>} */
+ var contents;
+ /** @type {!number} */
+ var i;
+ /** @type {Array.<undefined|!string>} */
+ var range_contents;
+ /** @type {!number} */
+ var counter;
+ /** @type {!string} */
+ var key;
+ contents = [ Binary$dump16bitNumber$I(this._bitsize), Binary$dump32bitNumber$N(this._size) ];
+ CompressionReport$add$LCompressionReport$II(report, 3, 3);
+ for (i = 0; i < this._bitsize; i++) {
+ contents.push(this._bv[i].dump$LCompressionReport$(report));
+ }
+ for (i = 0; i < this._bitsize; i++) {
+ contents.push(Binary$dump32bitNumber$N(this._seps[i]));
+ CompressionReport$add$LCompressionReport$II(report, 2, 2);
+ }
+ range_contents = [ ];
+ counter = 0;
+ for (key in this._range) {
+ range_contents.push(Binary$dump32bitNumber$N(key | 0));
+ range_contents.push(Binary$dump32bitNumber$N(this._range[key]));
+ CompressionReport$add$LCompressionReport$II(report, 4, 4);
+ counter++;
+ }
+ CompressionReport$add$LCompressionReport$II(report, 2, 2);
+ contents.push(Binary$dump32bitNumber$N(counter));
+ return contents.join('') + range_contents.join('');
+};
+
+/**
+ * @param {!string} data
+ * @return {!number}
+ */
+WaveletMatrix.prototype.load$S = function (data) {
+ return this.load$SI(data, 0);
+};
+
+/**
+ * @param {!string} data
+ * @param {!number} offset
+ * @return {!number}
+ */
+WaveletMatrix.prototype.load$SI = function (data, offset) {
+ /** @type {!number} */
+ var i;
+ /** @type {BitVector} */
+ var bit_vector;
+ /** @type {!number} */
+ var range_size;
+ /** @type {!number} */
+ var value;
+ /** @type {!number} */
+ var offset$0;
+ /** @type {!number} */
+ var result$0;
+ /** @type {!number} */
+ var result$1;
+ /** @type {!number} */
+ var result$2;
+ this._bv.length = 0;
+ this._seps.length = 0;
+ this._size = 0;
+ offset$0 = offset++;
+ this._bitsize = (data.charCodeAt(offset$0) | 0);
+ result$0 = data.charCodeAt(offset) * 65536 + data.charCodeAt(offset + 1);
+ this._size = (result$0 | 0);
+ offset += 2;
+ for (i = 0; i < this._bitsize; i++) {
+ bit_vector = new BitVector$();
+ offset = bit_vector.load$SI(data, offset);
+ this._bv.push(bit_vector);
+ }
+ for (i = 0; i < this._bitsize; (i++, offset += 2)) {
+ this._seps.push(Binary$load32bitNumber$SI(data, offset));
+ }
+ result$1 = data.charCodeAt(offset) * 65536 + data.charCodeAt(offset + 1);
+ range_size = result$1;
+ offset += 2;
+ for (i = 0; i < range_size; (i++, offset += 4)) {
+ result$2 = data.charCodeAt(offset) * 65536 + data.charCodeAt(offset + 1);
+ value = Binary$load32bitNumber$SI(data, offset + 2);
+ this._range[result$2 + ""] = (value | 0);
+ }
+ return offset;
+};
+
+/**
+ * @param {Object.<string, undefined|!number>} input
+ * @return {Object.<string, undefined|!number>}
+ */
+WaveletMatrix._shallow_copy$HI = function (input) {
+ /** @type {Object.<string, undefined|!number>} */
+ var result;
+ /** @type {!string} */
+ var key;
+ result = ({ });
+ for (key in input) {
+ result[key] = input[key];
+ }
+ return result;
+};
+
+var WaveletMatrix$_shallow_copy$HI = WaveletMatrix._shallow_copy$HI;
+
+/**
+ * @param {!number} c
+ * @param {!number} i
+ * @return {!boolean}
+ */
+WaveletMatrix.prototype._uint2bit$II = function (c, i) {
+ return (c >>> this._bitsize - 1 - i & 0x1) === 0x1;
+};
+
+/**
+ * class BurrowsWheelerTransform extends Object
+ * @constructor
+ */
+function BurrowsWheelerTransform() {
+}
+
+/**
+ * @constructor
+ */
+function BurrowsWheelerTransform$() {
+ this._str = "";
+ this._size = 0;
+ this._head = 0;
+ this._suffixarray = [ ];
+};
+
+BurrowsWheelerTransform$.prototype = new BurrowsWheelerTransform;
+
+/**
+ * @param {BurrowsWheelerTransform} $this
+ * @return {!number}
+ */
+BurrowsWheelerTransform.size$LBurrowsWheelerTransform$ = function ($this) {
+ return $this._size;
+};
+
+var BurrowsWheelerTransform$size$LBurrowsWheelerTransform$ = BurrowsWheelerTransform.size$LBurrowsWheelerTransform$;
+
+/**
+ * @param {BurrowsWheelerTransform} $this
+ * @return {!number}
+ */
+BurrowsWheelerTransform.head$LBurrowsWheelerTransform$ = function ($this) {
+ return $this._head;
+};
+
+var BurrowsWheelerTransform$head$LBurrowsWheelerTransform$ = BurrowsWheelerTransform.head$LBurrowsWheelerTransform$;
+
+/**
+ * @param {BurrowsWheelerTransform} $this
+ */
+BurrowsWheelerTransform.clear$LBurrowsWheelerTransform$ = function ($this) {
+ $this._str = "";
+ $this._size = 0;
+ $this._head = 0;
+ $this._suffixarray.length = 0;
+};
+
+var BurrowsWheelerTransform$clear$LBurrowsWheelerTransform$ = BurrowsWheelerTransform.clear$LBurrowsWheelerTransform$;
+
+/**
+ * @param {BurrowsWheelerTransform} $this
+ * @param {!string} str
+ */
+BurrowsWheelerTransform.build$LBurrowsWheelerTransform$S = function ($this, str) {
+ /** @type {!string} */
+ var _str$0;
+ /** @type {Array.<undefined|!number>} */
+ var _suffixarray$0;
+ _str$0 = $this._str = str;
+ $this._size = _str$0.length;
+ _suffixarray$0 = $this._suffixarray = SAIS$make$S(str);
+ $this._head = (_suffixarray$0.indexOf(0) | 0);
+};
+
+var BurrowsWheelerTransform$build$LBurrowsWheelerTransform$S = BurrowsWheelerTransform.build$LBurrowsWheelerTransform$S;
+
+/**
+ * @param {BurrowsWheelerTransform} $this
+ * @param {!number} i
+ * @return {!string}
+ */
+BurrowsWheelerTransform.get$LBurrowsWheelerTransform$I = function ($this, i) {
+ /** @type {!number} */
+ var size;
+ /** @type {!number} */
+ var index;
+ size = $this._size;
+ if (i >= size) {
+ throw new Error("BurrowsWheelerTransform.get() : range error");
+ }
+ index = ($this._suffixarray[i] + size - 1) % size;
+ return $this._str.charAt(index);
+};
+
+var BurrowsWheelerTransform$get$LBurrowsWheelerTransform$I = BurrowsWheelerTransform.get$LBurrowsWheelerTransform$I;
+
+/**
+ * @param {BurrowsWheelerTransform} $this
+ * @return {!string}
+ */
+BurrowsWheelerTransform.get$LBurrowsWheelerTransform$ = function ($this) {
+ /** @type {Array.<undefined|!string>} */
+ var str;
+ /** @type {!number} */
+ var size;
+ /** @type {!number} */
+ var i;
+ str = [ ];
+ size = $this._size;
+ for (i = 0; i < size; i++) {
+ str.push(BurrowsWheelerTransform$get$LBurrowsWheelerTransform$I($this, i));
+ }
+ return str.join("");
+};
+
+var BurrowsWheelerTransform$get$LBurrowsWheelerTransform$ = BurrowsWheelerTransform.get$LBurrowsWheelerTransform$;
+
+/**
+ * @param {BurrowsWheelerTransform} $this
+ * @param {!string} replace
+ * @return {!string}
+ */
+BurrowsWheelerTransform.get$LBurrowsWheelerTransform$S = function ($this, replace) {
+ /** @type {!string} */
+ var result;
+ result = BurrowsWheelerTransform$get$LBurrowsWheelerTransform$($this);
+ return result.replace(BurrowsWheelerTransform.END_MARKER, replace);
+};
+
+var BurrowsWheelerTransform$get$LBurrowsWheelerTransform$S = BurrowsWheelerTransform.get$LBurrowsWheelerTransform$S;
+
+/**
+ * class OArray extends Object
+ * @constructor
+ */
+function OArray() {
+}
+
+/**
+ * @constructor
+ * @param {Array.<undefined|!number>} array
+ */
+function OArray$AI(array) {
+ this.array = array;
+ this.offset = 0;
+};
+
+OArray$AI.prototype = new OArray;
+
+/**
+ * @constructor
+ * @param {Array.<undefined|!number>} array
+ * @param {!number} offset
+ */
+function OArray$AII(array, offset) {
+ this.array = array;
+ this.offset = offset;
+};
+
+OArray$AII.prototype = new OArray;
+
+/**
+ * @param {OArray} $this
+ * @param {!number} index
+ * @return {!number}
+ */
+OArray.get$LOArray$I = function ($this, index) {
+ return $this.array[index + $this.offset];
+};
+
+var OArray$get$LOArray$I = OArray.get$LOArray$I;
+
+/**
+ * @param {OArray} $this
+ * @param {!number} index
+ * @param {!number} value
+ */
+OArray.set$LOArray$II = function ($this, index, value) {
+ $this.array[index + $this.offset] = value;
+};
+
+var OArray$set$LOArray$II = OArray.set$LOArray$II;
+
+/**
+ * @param {OArray} $this
+ * @param {!number} index
+ * @return {!boolean}
+ */
+OArray.isS$LOArray$I = function ($this, index) {
+ /** @type {Array.<undefined|!number>} */
+ var array$0;
+ /** @type {!number} */
+ var offset$0;
+ return (array$0 = $this.array)[index + (offset$0 = $this.offset)] < array$0[index + offset$0 + 1];
+};
+
+var OArray$isS$LOArray$I = OArray.isS$LOArray$I;
+
+/**
+ * @param {OArray} $this
+ * @param {!number} index1
+ * @param {!number} index2
+ * @return {!boolean}
+ */
+OArray.compare$LOArray$II = function ($this, index1, index2) {
+ /** @type {Array.<undefined|!number>} */
+ var array$0;
+ /** @type {!number} */
+ var offset$0;
+ return (array$0 = $this.array)[index1 + (offset$0 = $this.offset)] == array$0[index2 + offset$0];
+};
+
+var OArray$compare$LOArray$II = OArray.compare$LOArray$II;
+
+/**
+ * class SAIS extends Object
+ * @constructor
+ */
+function SAIS() {
+}
+
+/**
+ * @constructor
+ */
+function SAIS$() {
+};
+
+SAIS$.prototype = new SAIS;
+
+/**
+ * @param {BitVector} t
+ * @param {!number} i
+ * @return {!boolean}
+ */
+SAIS._isLMS$LBitVector$I = function (t, i) {
+ return i > 0 && t.get$I(i) && ! t.get$I(i - 1);
+};
+
+var SAIS$_isLMS$LBitVector$I = SAIS._isLMS$LBitVector$I;
+
+/**
+ * @param {OArray} s
+ * @param {Array.<undefined|!number>} bkt
+ * @param {!number} n
+ * @param {!number} K
+ * @param {!boolean} end
+ */
+SAIS._getBuckets$LOArray$AIIIB = function (s, bkt, n, K, end) {
+ /** @type {!number} */
+ var sum;
+ /** @type {!number} */
+ var i;
+ sum = 0;
+ for (i = 0; i <= K; i++) {
+ bkt[i] = 0;
+ }
+ for (i = 0; i < n; i++) {
+ bkt[OArray$get$LOArray$I(s, i)]++;
+ }
+ for (i = 0; i <= K; i++) {
+ sum += bkt[i];
+ bkt[i] = ((end ? sum : sum - bkt[i]) | 0);
+ }
+};
+
+var SAIS$_getBuckets$LOArray$AIIIB = SAIS._getBuckets$LOArray$AIIIB;
+
+/**
+ * @param {BitVector} t
+ * @param {Array.<undefined|!number>} SA
+ * @param {OArray} s
+ * @param {Array.<undefined|!number>} bkt
+ * @param {!number} n
+ * @param {!number} K
+ * @param {!boolean} end
+ */
+SAIS._induceSAl$LBitVector$AILOArray$AIIIB = function (t, SA, s, bkt, n, K, end) {
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var j;
+ SAIS$_getBuckets$LOArray$AIIIB(s, bkt, n, K, end);
+ for (i = 0; i < n; i++) {
+ j = SA[i] - 1;
+ if (j >= 0 && ! t.get$I(j)) {
+ SA[bkt[OArray$get$LOArray$I(s, j)]++] = (j | 0);
+ }
+ }
+};
+
+var SAIS$_induceSAl$LBitVector$AILOArray$AIIIB = SAIS._induceSAl$LBitVector$AILOArray$AIIIB;
+
+/**
+ * @param {BitVector} t
+ * @param {Array.<undefined|!number>} SA
+ * @param {OArray} s
+ * @param {Array.<undefined|!number>} bkt
+ * @param {!number} n
+ * @param {!number} K
+ * @param {!boolean} end
+ */
+SAIS._induceSAs$LBitVector$AILOArray$AIIIB = function (t, SA, s, bkt, n, K, end) {
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var j;
+ SAIS$_getBuckets$LOArray$AIIIB(s, bkt, n, K, end);
+ for (i = n - 1; i >= 0; i--) {
+ j = SA[i] - 1;
+ if (j >= 0 && t.get$I(j)) {
+ SA[-- bkt[OArray$get$LOArray$I(s, j)]] = (j | 0);
+ }
+ }
+};
+
+var SAIS$_induceSAs$LBitVector$AILOArray$AIIIB = SAIS._induceSAs$LBitVector$AILOArray$AIIIB;
+
+/**
+ * @param {!string} source
+ * @return {Array.<undefined|!number>}
+ */
+SAIS.make$S = function (source) {
+ /** @type {Array.<undefined|!number>} */
+ var charCodes;
+ /** @type {!number} */
+ var maxCode;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var code;
+ /** @type {Array.<undefined|!number>} */
+ var SA;
+ /** @type {OArray} */
+ var s;
+ charCodes = [ ];
+ charCodes.length = source.length;
+ maxCode = 0;
+ for (i = 0; i < source.length; i++) {
+ code = source.charCodeAt(i);
+ charCodes[i] = (code | 0);
+ maxCode = (code > maxCode ? code : maxCode);
+ }
+ SA = [ ];
+ SA.length = source.length;
+ s = ({offset: 0, array: charCodes});
+ SAIS$_make$LOArray$AIII(s, SA, source.length, maxCode);
+ return SA;
+};
+
+var SAIS$make$S = SAIS.make$S;
+
+/**
+ * @param {OArray} s
+ * @param {Array.<undefined|!number>} SA
+ * @param {!number} n
+ * @param {!number} K
+ */
+SAIS._make$LOArray$AIII = function (s, SA, n, K) {
+ /** @type {BitVector} */
+ var t;
+ /** @type {!number} */
+ var i;
+ /** @type {Array.<undefined|!number>} */
+ var bkt;
+ /** @type {!number} */
+ var n1;
+ /** @type {!number} */
+ var name;
+ /** @type {!number} */
+ var prev;
+ /** @type {undefined|!number} */
+ var pos;
+ /** @type {!boolean} */
+ var diff;
+ /** @type {!number} */
+ var d;
+ /** @type {!number} */
+ var j;
+ /** @type {Array.<undefined|!number>} */
+ var SA1;
+ /** @type {OArray} */
+ var s1;
+ /** @type {!number} */
+ var i$0;
+ /** @type {!number} */
+ var index$0;
+ t = new BitVector$();
+ t.set$IB(n - 2, false);
+ t.set$IB(n - 1, true);
+ for (i = n - 3; i >= 0; i--) {
+ t.set$IB(i, OArray$isS$LOArray$I(s, i) || OArray$compare$LOArray$II(s, i, i + 1) && t.get$I(i + 1));
+ }
+ bkt = [ ];
+ bkt.length = K + 1;
+ SAIS$_getBuckets$LOArray$AIIIB(s, bkt, n, K, true);
+ for (i = 0; i < n; i++) {
+ SA[i] = -1;
+ }
+ for (i = 1; i < n; i++) {
+ if (SAIS$_isLMS$LBitVector$I(t, i)) {
+ SA[-- bkt[OArray$get$LOArray$I(s, i)]] = (i | 0);
+ }
+ }
+ SAIS$_induceSAl$LBitVector$AILOArray$AIIIB(t, SA, s, bkt, n, K, false);
+ SAIS$_induceSAs$LBitVector$AILOArray$AIIIB(t, SA, s, bkt, n, K, true);
+ n1 = 0;
+ for (i = 0; i < n; i++) {
+ i$0 = SA[i];
+ if (i$0 > 0 && t.get$I(i$0) && ! t.get$I(i$0 - 1)) {
+ SA[n1++] = SA[i];
+ }
+ }
+ for (i = n1; i < n; i++) {
+ SA[i] = -1;
+ }
+ name = 0;
+ prev = -1;
+ for (i = 0; i < n1; i++) {
+ pos = SA[i];
+ diff = false;
+ for (d = 0; d < n; d++) {
+ if (prev === -1 || ! OArray$compare$LOArray$II(s, pos + d, prev + d) || t.get$I(pos + d) !== t.get$I(prev + d)) {
+ diff = true;
+ break;
+ } else {
+ if (d > 0 && (SAIS$_isLMS$LBitVector$I(t, pos + d) || SAIS$_isLMS$LBitVector$I(t, prev + d))) {
+ break;
+ }
+ }
+ }
+ if (diff) {
+ name++;
+ prev = pos;
+ }
+ pos = ((pos % 2 === 0 ? pos / 2 : (pos - 1) / 2) | 0);
+ SA[n1 + pos] = (name - 1 | 0);
+ }
+ for ((i = n - 1, j = n - 1); i >= n1; i--) {
+ if (SA[i] >= 0) {
+ SA[j--] = SA[i];
+ }
+ }
+ SA1 = SA;
+ s1 = ({offset: n - n1, array: SA});
+ if (name < n1) {
+ SAIS$_make$LOArray$AIII(s1, SA1, n1, name - 1);
+ } else {
+ for (i = 0; i < n1; i++) {
+ SA1[OArray$get$LOArray$I(s1, i)] = (i | 0);
+ }
+ }
+ bkt = [ ];
+ bkt.length = K + 1;
+ SAIS$_getBuckets$LOArray$AIIIB(s, bkt, n, K, true);
+ for ((i = 1, j = 0); i < n; i++) {
+ if (SAIS$_isLMS$LBitVector$I(t, i)) {
+ OArray$set$LOArray$II(s1, j++, i);
+ }
+ }
+ for (i = 0; i < n1; i++) {
+ index$0 = SA1[i];
+ SA1[i] = s1.array[index$0 + s1.offset];
+ }
+ for (i = n1; i < n; i++) {
+ SA[i] = -1;
+ }
+ for (i = n1 - 1; i >= 0; i--) {
+ j = SA[i];
+ SA[i] = -1;
+ SA[-- bkt[OArray$get$LOArray$I(s, j)]] = (j | 0);
+ }
+ SAIS$_induceSAl$LBitVector$AILOArray$AIIIB(t, SA, s, bkt, n, K, false);
+ SAIS$_induceSAs$LBitVector$AILOArray$AIIIB(t, SA, s, bkt, n, K, true);
+};
+
+var SAIS$_make$LOArray$AIII = SAIS._make$LOArray$AIII;
+
+$__jsx_lazy_init(Oktavia, "eof", function () {
+ return String.fromCharCode(0);
+});
+$__jsx_lazy_init(Oktavia, "eob", function () {
+ return String.fromCharCode(1);
+});
+$__jsx_lazy_init(Oktavia, "unknown", function () {
+ return String.fromCharCode(3);
+});
+Binary._base64EncodeChars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
+$__jsx_lazy_init(Binary, "_base64DecodeChars", function () {
+ return [ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 62, -1, -1, -1, 63, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, -1, -1, -1, -1, -1, -1, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -1, -1, -1, -1, -1, -1, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, -1, -1, -1, -1 ];
+});
+BitVector.SMALL_BLOCK_SIZE = 32;
+BitVector.LARGE_BLOCK_SIZE = 256;
+BitVector.BLOCK_RATE = 8;
+EnglishStemmer.serialVersionUID = 1;
+$__jsx_lazy_init(EnglishStemmer, "methodObject", function () {
+ return new EnglishStemmer$();
+});
+$__jsx_lazy_init(EnglishStemmer, "a_0", function () {
+ return [ new Among$SII("arsen", -1, -1), new Among$SII("commun", -1, -1), new Among$SII("gener", -1, -1) ];
+});
+$__jsx_lazy_init(EnglishStemmer, "a_1", function () {
+ return [ new Among$SII("'", -1, 1), new Among$SII("'s'", 0, 1), new Among$SII("'s", -1, 1) ];
+});
+$__jsx_lazy_init(EnglishStemmer, "a_2", function () {
+ return [ new Among$SII("ied", -1, 2), new Among$SII("s", -1, 3), new Among$SII("ies", 1, 2), new Among$SII("sses", 1, 1), new Among$SII("ss", 1, -1), new Among$SII("us", 1, -1) ];
+});
+$__jsx_lazy_init(EnglishStemmer, "a_3", function () {
+ return [ new Among$SII("", -1, 3), new Among$SII("bb", 0, 2), new Among$SII("dd", 0, 2), new Among$SII("ff", 0, 2), new Among$SII("gg", 0, 2), new Among$SII("bl", 0, 1), new Among$SII("mm", 0, 2), new Among$SII("nn", 0, 2), new Among$SII("pp", 0, 2), new Among$SII("rr", 0, 2), new Among$SII("at", 0, 1), new Among$SII("tt", 0, 2), new Among$SII("iz", 0, 1) ];
+});
+$__jsx_lazy_init(EnglishStemmer, "a_4", function () {
+ return [ new Among$SII("ed", -1, 2), new Among$SII("eed", 0, 1), new Among$SII("ing", -1, 2), new Among$SII("edly", -1, 2), new Among$SII("eedly", 3, 1), new Among$SII("ingly", -1, 2) ];
+});
+$__jsx_lazy_init(EnglishStemmer, "a_5", function () {
+ return [ new Among$SII("anci", -1, 3), new Among$SII("enci", -1, 2), new Among$SII("ogi", -1, 13), new Among$SII("li", -1, 16), new Among$SII("bli", 3, 12), new Among$SII("abli", 4, 4), new Among$SII("alli", 3, 8), new Among$SII("fulli", 3, 14), new Among$SII("lessli", 3, 15), new Among$SII("ousli", 3, 10), new Among$SII("entli", 3, 5), new Among$SII("aliti", -1, 8), new Among$SII("biliti", -1, 12), new Among$SII("iviti", -1, 11), new Among$SII("tional", -1, 1), new Among$SII("ational", 14, 7), new Among$SII("alism", -1, 8), new Among$SII("ation", -1, 7), new Among$SII("ization", 17, 6), new Among$SII("izer", -1, 6), new Among$SII("ator", -1, 7), new Among$SII("iveness", -1, 11), new Among$SII("fulness", -1, 9), new Among$SII("ousness", -1, 10) ];
+});
+$__jsx_lazy_init(EnglishStemmer, "a_6", function () {
+ return [ new Among$SII("icate", -1, 4), new Among$SII("ative", -1, 6), new Among$SII("alize", -1, 3), new Among$SII("iciti", -1, 4), new Among$SII("ical", -1, 4), new Among$SII("tional", -1, 1), new Among$SII("ational", 5, 2), new Among$SII("ful", -1, 5), new Among$SII("ness", -1, 5) ];
+});
+$__jsx_lazy_init(EnglishStemmer, "a_7", function () {
+ return [ new Among$SII("ic", -1, 1), new Among$SII("ance", -1, 1), new Among$SII("ence", -1, 1), new Among$SII("able", -1, 1), new Among$SII("ible", -1, 1), new Among$SII("ate", -1, 1), new Among$SII("ive", -1, 1), new Among$SII("ize", -1, 1), new Among$SII("iti", -1, 1), new Among$SII("al", -1, 1), new Among$SII("ism", -1, 1), new Among$SII("ion", -1, 2), new Among$SII("er", -1, 1), new Among$SII("ous", -1, 1), new Among$SII("ant", -1, 1), new Among$SII("ent", -1, 1), new Among$SII("ment", 15, 1), new Among$SII("ement", 16, 1) ];
+});
+$__jsx_lazy_init(EnglishStemmer, "a_8", function () {
+ return [ new Among$SII("e", -1, 1), new Among$SII("l", -1, 2) ];
+});
+$__jsx_lazy_init(EnglishStemmer, "a_9", function () {
+ return [ new Among$SII("succeed", -1, -1), new Among$SII("proceed", -1, -1), new Among$SII("exceed", -1, -1), new Among$SII("canning", -1, -1), new Among$SII("inning", -1, -1), new Among$SII("earring", -1, -1), new Among$SII("herring", -1, -1), new Among$SII("outing", -1, -1) ];
+});
+$__jsx_lazy_init(EnglishStemmer, "a_10", function () {
+ return [ new Among$SII("andes", -1, -1), new Among$SII("atlas", -1, -1), new Among$SII("bias", -1, -1), new Among$SII("cosmos", -1, -1), new Among$SII("dying", -1, 3), new Among$SII("early", -1, 9), new Among$SII("gently", -1, 7), new Among$SII("howe", -1, -1), new Among$SII("idly", -1, 6), new Among$SII("lying", -1, 4), new Among$SII("news", -1, -1), new Among$SII("only", -1, 10), new Among$SII("singly", -1, 11), new Among$SII("skies", -1, 2), new Among$SII("skis", -1, 1), new Among$SII("sky", -1, -1), new Among$SII("tying", -1, 5), new Among$SII("ugly", -1, 8) ];
+});
+$__jsx_lazy_init(EnglishStemmer, "g_v", function () {
+ return [ 17, 65, 16, 1 ];
+});
+$__jsx_lazy_init(EnglishStemmer, "g_v_WXY", function () {
+ return [ 1, 17, 65, 208, 1 ];
+});
+$__jsx_lazy_init(EnglishStemmer, "g_valid_LI", function () {
+ return [ 55, 141, 2 ];
+});
+$__jsx_lazy_init(BurrowsWheelerTransform, "END_MARKER", function () {
+ return String.fromCharCode(0);
+});
+var $__jsx_classMap = {
+ "tool/httpstatus.jsx": {
+ HTTPStatus: HTTPStatus,
+ HTTPStatus$: HTTPStatus$,
+ _Main: _Main,
+ _Main$: _Main$
+ },
+ "src/oktavia.jsx": {
+ Oktavia: Oktavia,
+ Oktavia$: Oktavia$
+ },
+ "src/metadata.jsx": {
+ Metadata: Metadata,
+ Metadata$LOktavia$: Metadata$LOktavia$,
+ Section: Section,
+ Section$LOktavia$: Section$LOktavia$,
+ Splitter: Splitter,
+ Splitter$LOktavia$: Splitter$LOktavia$,
+ Splitter$LOktavia$S: Splitter$LOktavia$S,
+ Table: Table,
+ Table$LOktavia$AS: Table$LOktavia$AS,
+ Block: Block,
+ Block$LOktavia$: Block$LOktavia$
+ },
+ "src/query-parser.jsx": {
+ QueryParser: QueryParser,
+ QueryParser$: QueryParser$
+ },
+ "src/fm-index.jsx": {
+ FMIndex: FMIndex,
+ FMIndex$: FMIndex$
+ },
+ "src/binary-util.jsx": {
+ Binary: Binary,
+ Binary$: Binary$,
+ LoadedStringResult: LoadedStringResult,
+ LoadedStringResult$SI: LoadedStringResult$SI,
+ LoadedStringListResult: LoadedStringListResult,
+ LoadedStringListResult$SI: LoadedStringListResult$SI,
+ LoadedStringListMapResult: LoadedStringListMapResult,
+ LoadedStringListMapResult$SI: LoadedStringListMapResult$SI,
+ LoadedNumberListResult: LoadedNumberListResult,
+ LoadedNumberListResult$SI: LoadedNumberListResult$SI,
+ CompressionReport: CompressionReport,
+ CompressionReport$: CompressionReport$
+ },
+ "src/query.jsx": {
+ Query: Query,
+ Query$: Query$
+ },
+ "src/search-result.jsx": {
+ Proposal: Proposal,
+ Proposal$II: Proposal$II,
+ Position: Position,
+ Position$SIB: Position$SIB,
+ SearchUnit: SearchUnit,
+ SearchUnit$I: SearchUnit$I,
+ SingleResult: SingleResult,
+ SingleResult$: SingleResult$,
+ SingleResult$SBB: SingleResult$SBB,
+ SearchSummary: SearchSummary,
+ SearchSummary$: SearchSummary$,
+ SearchSummary$LOktavia$: SearchSummary$LOktavia$
+ },
+ "src/stemmer/stemmer.jsx": {
+ Stemmer: Stemmer,
+ Stemmer$: Stemmer$
+ },
+ "src/bit-vector.jsx": {
+ BitVector: BitVector,
+ BitVector$: BitVector$
+ },
+ "src/stemmer/base-stemmer.jsx": {
+ BaseStemmer: BaseStemmer,
+ BaseStemmer$: BaseStemmer$
+ },
+ "src/stemmer/english-stemmer.jsx": {
+ EnglishStemmer: EnglishStemmer,
+ EnglishStemmer$: EnglishStemmer$
+ },
+ "src/stemmer/among.jsx": {
+ Among: Among,
+ Among$SII: Among$SII,
+ Among$SIIF$LBaseStemmer$B$LBaseStemmer$: Among$SIIF$LBaseStemmer$B$LBaseStemmer$
+ },
+ "src/wavelet-matrix.jsx": {
+ WaveletMatrix: WaveletMatrix,
+ WaveletMatrix$: WaveletMatrix$
+ },
+ "src/burrows-wheeler-transform.jsx": {
+ BurrowsWheelerTransform: BurrowsWheelerTransform,
+ BurrowsWheelerTransform$: BurrowsWheelerTransform$
+ },
+ "src/sais.jsx": {
+ OArray: OArray,
+ OArray$AI: OArray$AI,
+ OArray$AII: OArray$AII,
+ SAIS: SAIS,
+ SAIS$: SAIS$
+ }
+};
+
+
+/**
+ * launches _Main.main(:string[]):void invoked by jsx --run|--executable
+ */
+JSX.runMain = function (sourceFile, args) {
+ var module = JSX.require(sourceFile);
+ if (! module) {
+ throw new ReferenceError("entry point module not found in " + sourceFile);
+ }
+ if (! module._Main) {
+ throw new ReferenceError("entry point _Main not found in " + sourceFile);
+ }
+ if (! module._Main.main$AS) {
+ throw new ReferenceError("entry point _Main.main(:string[]):void not found in " + sourceFile);
+ }
+ module._Main.main$AS(args);
+};
+
+/**
+ * launches _Test#test*():void invoked by jsx --test
+ */
+JSX.runTests = function (sourceFile, tests) {
+ var module = JSX.require(sourceFile);
+ var testClass = module._Test$;
+
+ if (!testClass) return; // skip if there's no test class
+
+ if(tests.length === 0) {
+ var p = testClass.prototype;
+ for (var m in p) {
+ if (p[m] instanceof Function
+ && /^test.*[$]$/.test(m)) {
+ tests.push(m);
+ }
+ }
+ }
+ else { // set as process arguments
+ tests = tests.map(function (name) {
+ return name + "$"; // mangle for function test*():void
+ });
+ }
+
+ var testCase = new testClass();
+
+ if (testCase.beforeClass$AS != null)
+ testCase.beforeClass$AS(tests);
+
+ for (var i = 0; i < tests.length; ++i) {
+ (function (method) {
+ if (method in testCase) {
+ testCase.run$SF$V$(method, function() { testCase[method](); });
+ }
+ else {
+ throw new ReferenceError("No such test method: " + method);
+ }
+ }(tests[i]));
+ }
+
+ if (testCase.afterClass$ != null)
+ testCase.afterClass$();
+};
+JSX.runMain("tool/httpstatus.jsx", process.argv.slice(2))
+})(JSX);
diff --git a/web/server/h2o/libh2o/misc/oktavia/bin/oktavia-mkindex b/web/server/h2o/libh2o/misc/oktavia/bin/oktavia-mkindex
new file mode 100755
index 00000000..b0171b53
--- /dev/null
+++ b/web/server/h2o/libh2o/misc/oktavia/bin/oktavia-mkindex
@@ -0,0 +1,25034 @@
+#!/usr/bin/env node
+// generatedy by JSX compiler 0.9.24 (2013-04-05 13:45:00 +0900; 1b229cc6a411f674f0f7cf7a79b7a8b3f8eb7414)
+var JSX = {};
+(function (JSX) {
+/**
+ * copies the implementations from source interface to target
+ */
+function $__jsx_merge_interface(target, source) {
+ for (var k in source.prototype)
+ if (source.prototype.hasOwnProperty(k))
+ target.prototype[k] = source.prototype[k];
+}
+
+/**
+ * defers the initialization of the property
+ */
+function $__jsx_lazy_init(obj, prop, func) {
+ function reset(obj, prop, value) {
+ delete obj[prop];
+ obj[prop] = value;
+ return value;
+ }
+
+ Object.defineProperty(obj, prop, {
+ get: function () {
+ return reset(obj, prop, func());
+ },
+ set: function (v) {
+ reset(obj, prop, v);
+ },
+ enumerable: true,
+ configurable: true
+ });
+}
+
+/**
+ * sideeffect().a /= b
+ */
+function $__jsx_div_assign(obj, prop, divisor) {
+ return obj[prop] = (obj[prop] / divisor) | 0;
+}
+
+/*
+ * global functions, renamed to avoid conflict with local variable names
+ */
+var $__jsx_parseInt = parseInt;
+var $__jsx_parseFloat = parseFloat;
+var $__jsx_isNaN = isNaN;
+var $__jsx_isFinite = isFinite;
+
+var $__jsx_encodeURIComponent = encodeURIComponent;
+var $__jsx_decodeURIComponent = decodeURIComponent;
+var $__jsx_encodeURI = encodeURI;
+var $__jsx_decodeURI = decodeURI;
+
+var $__jsx_ObjectToString = Object.prototype.toString;
+var $__jsx_ObjectHasOwnProperty = Object.prototype.hasOwnProperty;
+
+/*
+ * profiler object, initialized afterwards
+ */
+function $__jsx_profiler() {
+}
+
+/*
+ * public interface to JSX code
+ */
+JSX.require = function (path) {
+ var m = $__jsx_classMap[path];
+ return m !== undefined ? m : null;
+};
+
+JSX.profilerIsRunning = function () {
+ return $__jsx_profiler.getResults != null;
+};
+
+JSX.getProfileResults = function () {
+ return ($__jsx_profiler.getResults || function () { return {}; })();
+};
+
+JSX.postProfileResults = function (url, cb) {
+ if ($__jsx_profiler.postResults == null)
+ throw new Error("profiler has not been turned on");
+ return $__jsx_profiler.postResults(url, cb);
+};
+
+JSX.resetProfileResults = function () {
+ if ($__jsx_profiler.resetResults == null)
+ throw new Error("profiler has not been turned on");
+ return $__jsx_profiler.resetResults();
+};
+JSX.DEBUG = false;
+/**
+ * class _Main extends Object
+ * @constructor
+ */
+function _Main() {
+}
+
+/**
+ * @constructor
+ */
+function _Main$() {
+};
+
+_Main$.prototype = new _Main;
+
+/**
+ */
+_Main.usage$ = function () {
+ console.log([ "usage: oktavia_mkindex [options]", "", "Common Options:", " -i, --input [input folder/file ] : Target files to search. .html, .csv, .txt are available.", " -o, --output [outputfolder] : Directory that will store output files.", " : This is a relative path from root.", " : Default value is 'search'. ", " -t, --type [type] : Export type. 'index'(default), 'base64', 'cmd', 'js',", " : 'commonjs' are available.", " : 'index' is a just index file. 'cmd' is a base64 code with search program.", " : Others are base64 source code style output.", " -m, --mode [mode] : Mode type. 'html', 'csv', 'text' are available.", " -c, --cache-density [percent] : Cache data density. It effects file size and search speed.", " : 100% become four times of base index file size. Default value is 5%.", " : Valid value is 0.1% - 100%.", " -n, --name [function] : A variable name for 'js' output or property name", " : for 'js' and 'commonjs'. Default value is 'searchIndex'.", " -q, --quiet : Hide detail information.", " -h, --help : Display this message.", "", "HTML Mode Options:", " -r, --root [document root] : Document root folder. Default is current. ", " : Indexer creates result file path from this folder.", " -p, --prefix [directory prefix] : Directory prefix for a document root from a server root.", " : If your domain is example.com and 'manual' is passed,", " : document root become http://example.com/manual/.", " : It effects search result URL. Default value is '/'.", " -u, --unit [search unit] : 'file', 'h1'-'h6'. Default value is 'file'.", " -f, --filter [target tag] : Only contents inside this tag is indexed.", " : Default value is \"article,#content,#main,div.body\".", " -s, --stemmer [algorithm] : Select stemming algorithm.", " -w, --word-splitter [splitter] : Use optional word splitter.", " : 'ts' (TinySegmenter for Japanese) is available", "", "Text Mode Options:", " -s, --stemmer [algorithm] : Select stemming algorithm.", " -w, --word-splitter [splitter] : Use optional word splitter.", " : 'ts' (TinySegmenter for Japanese) is available", " -u, --unit [search unit] : file, block, line. Default value is 'file'.", "", "Supported Stemmer Algorithms:", " danish, dutch, english, finnish, french german, hungarian italian", " norwegian, porter, portuguese, romanian, russian, spanish, swedish, turkish" ].join('\n'));
+};
+
+var _Main$usage$ = _Main.usage$;
+
+/**
+ * @param {Array.<undefined|!string>} args
+ */
+_Main.main$AS = function (args) {
+ /** @type {Array.<undefined|!string>} */
+ var inputs;
+ /** @type {!string} */
+ var root;
+ /** @type {!string} */
+ var prefix;
+ /** @type {!string} */
+ var output;
+ /** @type {!boolean} */
+ var showhelp;
+ /** @type {!boolean} */
+ var notrun;
+ /** @type {!string} */
+ var unit;
+ /** @type {!string} */
+ var type;
+ /** @type {!string} */
+ var mode;
+ /** @type {!boolean} */
+ var verbose;
+ /** @type {Array.<undefined|!string>} */
+ var filter;
+ /** @type {undefined|!string} */
+ var algorithm;
+ /** @type {undefined|!string} */
+ var wordsplitter;
+ /** @type {!number} */
+ var cacheDensity;
+ /** @type {undefined|!string} */
+ var name;
+ /** @type {Array.<undefined|!string>} */
+ var validModes;
+ /** @type {Array.<undefined|!string>} */
+ var validUnitsForHTML;
+ /** @type {Array.<undefined|!string>} */
+ var validUnitsForText;
+ /** @type {Array.<undefined|!string>} */
+ var validStemmers;
+ /** @type {Array.<undefined|!string>} */
+ var validTypes;
+ /** @type {BasicParser} */
+ var parser;
+ /** @type {CommandOption} */
+ var opt;
+ /** @type {Array.<undefined|!string>} */
+ var items;
+ /** @type {!number} */
+ var i;
+ /** @type {Array.<undefined|!string>} */
+ var match;
+ /** @type {!number} */
+ var tmpValue;
+ /** @type {Array.<undefined|!string>} */
+ var inputTextFiles;
+ /** @type {Array.<undefined|!string>} */
+ var inputHTMLFiles;
+ /** @type {Array.<undefined|!string>} */
+ var inputCSVFiles;
+ /** @type {undefined|!string} */
+ var input;
+ /** @type {Stats} */
+ var stat;
+ /** @type {Stemmer} */
+ var stemmer;
+ /** @type {undefined|!string} */
+ var dump;
+ /** @type {!number} */
+ var unitIndex;
+ /** @type {HTMLParser} */
+ var htmlParser;
+ /** @type {!string} */
+ var indexFilePath;
+ /** @type {!string} */
+ var dirPath;
+ /** @type {Array.<undefined|!string>} */
+ var contents;
+ /** @type {!string} */
+ var filepath$0;
+ /** @type {!string} */
+ var filepath$1;
+ console.log("Search Engine Oktavia - Index Generator\n");
+ inputs = [ ];
+ root = process.cwd();
+ prefix = '/';
+ output = "search";
+ showhelp = false;
+ notrun = false;
+ unit = 'file';
+ type = 'js';
+ mode = '';
+ verbose = true;
+ filter = [ ];
+ algorithm = null;
+ wordsplitter = null;
+ cacheDensity = 5.0;
+ name = null;
+ validModes = [ 'html', 'csv', 'text' ];
+ validUnitsForHTML = [ 'file', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6' ];
+ validUnitsForText = [ 'file', 'block', 'line' ];
+ validStemmers = [ 'danish', 'dutch', 'english', 'finnish', 'french', 'german', 'hungarian', 'italian', 'norwegian', 'porter', 'portuguese', 'romanian', 'russian', 'spanish', 'swedish', 'turkish' ];
+ validTypes = [ 'index', 'base64', 'cmd', 'js', 'commonjs' ];
+ parser = new BasicParser$SAS("n:(name)q(quiet)m:(mode)i:(input)r:(root)p:(prefix)o:(output)h(help)u:(unit)f:(filter)s:(stemmer)w:(word-splitter)t:(type)c:(cache-density)", args);
+ opt = parser.getopt$();
+ while (opt) {
+ switch (opt.option) {
+ case "m":
+ if (validModes.indexOf(opt.optarg) === -1) {
+ console.error("Option m/mode should be 'html', 'csv', 'text'.");
+ notrun = true;
+ }
+ mode = opt.optarg;
+ break;
+ case "i":
+ inputs.push(opt.optarg);
+ break;
+ case "r":
+ root = node.path.resolve(opt.optarg);
+ break;
+ case "p":
+ prefix = opt.optarg;
+ break;
+ case "n":
+ name = opt.optarg;
+ break;
+ case "o":
+ output = opt.optarg;
+ if (output.slice(0, 1) === '/') {
+ output = output.slice(1);
+ }
+ break;
+ case "h":
+ showhelp = true;
+ break;
+ case "q":
+ verbose = false;
+ break;
+ case "u":
+ unit = opt.optarg;
+ break;
+ case "f":
+ items = opt.optarg.split(',');
+ for (i in items) {
+ filter.push(items[i]);
+ }
+ break;
+ case "t":
+ if (validTypes.indexOf(opt.optarg) === -1) {
+ console.error('Option -t/--type is invalid.');
+ notrun = true;
+ } else {
+ type = opt.optarg;
+ }
+ break;
+ case "s":
+ if (validStemmers.indexOf(opt.optarg) === -1) {
+ console.error('Option -s/--stemmer is invalid.');
+ notrun = true;
+ } else {
+ algorithm = opt.optarg;
+ }
+ break;
+ case "w":
+ break;
+ case "c":
+ match = /(\d+\.?\d*)/.exec(opt.optarg);
+ if (match) {
+ tmpValue = +match[1];
+ if (0.1 <= tmpValue && tmpValue <= 100) {
+ cacheDensity = tmpValue;
+ } else {
+ console.error('Option -c/--cache-density should be in 0.1 - 100.');
+ notrun = true;
+ }
+ } else {
+ console.error('Option -c/--cache-density is invalid.');
+ notrun = true;
+ }
+ break;
+ case "?":
+ notrun = true;
+ break;
+ }
+ opt = parser.getopt$();
+ }
+ inputTextFiles = [ ];
+ inputHTMLFiles = [ ];
+ inputCSVFiles = [ ];
+ if (filter.length === 0) {
+ filter = [ 'article', '#content', '#main', 'div.body' ];
+ }
+ for (i in inputs) {
+ input = inputs[i];
+ if (! node.fs.existsSync(input)) {
+ console.error("Following input folder/file doesn't exist: " + input);
+ notrun = true;
+ } else {
+ stat = node.fs.statSync(input);
+ if (stat.isFile()) {
+ _Main$_checkFileType$SASASAS(node.path.resolve(input), inputTextFiles, inputHTMLFiles, inputCSVFiles);
+ } else {
+ if (stat.isDirectory()) {
+ _Main$_checkDirectory$SASASAS(input, inputTextFiles, inputHTMLFiles, inputCSVFiles);
+ } else {
+ console.error("Following input is not folder or file: " + input);
+ notrun = true;
+ }
+ }
+ }
+ }
+ if (inputTextFiles.length === 0 && inputHTMLFiles.length === 0 && inputCSVFiles.length === 0 || ! mode) {
+ showhelp = true;
+ }
+ if (showhelp) {
+ _Main$usage$();
+ } else {
+ if (! notrun) {
+ stemmer = null;
+ if (algorithm) {
+ stemmer = _Main$_createStemmer$S(algorithm);
+ }
+ dump = null;
+ switch (mode) {
+ case 'html':
+ unitIndex = validUnitsForHTML.indexOf(unit);
+ if (unitIndex === -1) {
+ console.error('Option -u/--unit should be file, h1, h2, h3, h4, h5, h6. But ' + unit);
+ } else {
+ htmlParser = new HTMLParser$ISSASLStemmer$(unitIndex, root, prefix, filter, stemmer);
+ for (i = 0; i < inputHTMLFiles.length; i++) {
+ htmlParser.parse$S(inputHTMLFiles[i]);
+ }
+ console.log('generating index...');
+ if (verbose) {
+ console.log('');
+ }
+ dump = htmlParser.dump$IB(cacheDensity, verbose);
+ }
+ break;
+ case 'csv':
+ ({oktavia: new Oktavia$(), root: root, stemmer: stemmer});
+ for (i in inputCSVFiles) {
+ filepath$0 = inputCSVFiles[i];
+ }
+ break;
+ case 'text':
+ if (validUnitsForText.indexOf(unit) === -1) {
+ console.error('Option u/unit should be file, block, line. But ' + unit);
+ } else {
+ ({oktavia: new Oktavia$(), unit: unit, root: root, stemmer: stemmer});
+ for (i in inputTextFiles) {
+ filepath$1 = inputTextFiles[i];
+ node.fs.readFileSync(filepath$1, 'utf8');
+ }
+ }
+ break;
+ }
+ if (dump) {
+ indexFilePath = "";
+ switch (type) {
+ case 'index':
+ indexFilePath = node.path.resolve(root, output, 'searchindex.okt');
+ dirPath = node.path.dirname(indexFilePath);
+ _Main$_mkdirP$S(dirPath);
+ node.fs.writeFileSync(indexFilePath, dump, "utf16le");
+ break;
+ case 'base64':
+ indexFilePath = node.path.resolve(root, output, 'searchindex.okt.b64');
+ dirPath = node.path.dirname(indexFilePath);
+ _Main$_mkdirP$S(dirPath);
+ node.fs.writeFileSync(indexFilePath, Binary$base64encode$S(dump), "utf8");
+ break;
+ case 'cmd':
+ break;
+ case 'js':
+ indexFilePath = node.path.resolve(root, output, 'searchindex.js');
+ dirPath = node.path.dirname(indexFilePath);
+ _Main$_mkdirP$S(dirPath);
+ if (name == null) {
+ name = 'searchIndex';
+ }
+ contents = [ '// Oktavia Search Index', 'var ' + name + ' = "' + Binary$base64encode$S(dump) + '";', '' ];
+ node.fs.writeFileSync(indexFilePath, contents.join('\n'), "utf8");
+ break;
+ case 'commonjs':
+ indexFilePath = node.path.resolve(root, output, 'searchindex.js');
+ dirPath = node.path.dirname(indexFilePath);
+ _Main$_mkdirP$S(dirPath);
+ if (name == null) {
+ name = 'searchIndex';
+ }
+ contents = [ '// Oktavia Search Index', 'exports.' + name + ' = "' + Binary$base64encode$S(dump) + '";', '' ];
+ node.fs.writeFileSync(indexFilePath, contents.join('\n'), "utf8");
+ break;
+ }
+ if (indexFilePath) {
+ console.log("generated: " + indexFilePath);
+ }
+ }
+ }
+ }
+};
+
+var _Main$main$AS = _Main.main$AS;
+
+/**
+ * @param {!string} path
+ * @param {Array.<undefined|!string>} texts
+ * @param {Array.<undefined|!string>} HTMLs
+ * @param {Array.<undefined|!string>} CSVs
+ */
+_Main._checkFileType$SASASAS = function (path, texts, HTMLs, CSVs) {
+ /** @type {Array.<undefined|!string>} */
+ var match;
+ match = path.match(/(.*)\.(.*)/);
+ if (match && match[1]) {
+ switch (match[2].toLowerCase()) {
+ case 'html':
+ case 'htm':
+ HTMLs.push(path);
+ break;
+ case 'csv':
+ CSVs.push(path);
+ break;
+ default:
+ texts.push(path);
+ }
+ }
+};
+
+var _Main$_checkFileType$SASASAS = _Main._checkFileType$SASASAS;
+
+/**
+ * @param {!string} path
+ * @param {Array.<undefined|!string>} texts
+ * @param {Array.<undefined|!string>} HTMLs
+ * @param {Array.<undefined|!string>} CSVs
+ */
+_Main._checkDirectory$SASASAS = function (path, texts, HTMLs, CSVs) {
+ /** @type {Array.<undefined|!string>} */
+ var files;
+ /** @type {!number} */
+ var j;
+ /** @type {!string} */
+ var filepath;
+ /** @type {Stats} */
+ var stat;
+ files = node.fs.readdirSync(path);
+ for (j in files) {
+ filepath = node.path.resolve(path, files[j]);
+ stat = node.fs.statSync(filepath);
+ if (stat.isFile()) {
+ _Main$_checkFileType$SASASAS(filepath, texts, HTMLs, CSVs);
+ } else {
+ if (stat.isDirectory()) {
+ _Main$_checkDirectory$SASASAS(filepath, texts, HTMLs, CSVs);
+ }
+ }
+ }
+};
+
+var _Main$_checkDirectory$SASASAS = _Main._checkDirectory$SASASAS;
+
+/**
+ * @param {!string} path
+ */
+_Main._mkdirP$S = function (path) {
+ if (node.fs.existsSync(path)) {
+ return;
+ }
+ _Main$_mkdirP$S(node.path.dirname(path));
+ node.fs.mkdirSync(path);
+};
+
+var _Main$_mkdirP$S = _Main._mkdirP$S;
+
+/**
+ * @param {!string} algorithm
+ * @return {Stemmer}
+ */
+_Main._createStemmer$S = function (algorithm) {
+ /** @type {Stemmer} */
+ var stemmer;
+ switch (algorithm.toLowerCase()) {
+ case "danish":
+ stemmer = new DanishStemmer$();
+ break;
+ case "dutch":
+ stemmer = new DutchStemmer$();
+ break;
+ case "english":
+ stemmer = new EnglishStemmer$();
+ break;
+ case "finnish":
+ stemmer = new FinnishStemmer$();
+ break;
+ case "french":
+ stemmer = new FrenchStemmer$();
+ break;
+ case "german":
+ stemmer = new GermanStemmer$();
+ break;
+ case "hungarian":
+ stemmer = new HungarianStemmer$();
+ break;
+ case "italian":
+ stemmer = new ItalianStemmer$();
+ break;
+ case "norwegian":
+ stemmer = new NorwegianStemmer$();
+ break;
+ case "porter":
+ stemmer = new PorterStemmer$();
+ break;
+ case "portuguese":
+ stemmer = new PortugueseStemmer$();
+ break;
+ case "romanian":
+ stemmer = new RomanianStemmer$();
+ break;
+ case "russian":
+ stemmer = new RussianStemmer$();
+ break;
+ case "spanish":
+ stemmer = new SpanishStemmer$();
+ break;
+ case "swedish":
+ stemmer = new SwedishStemmer$();
+ break;
+ case "turkish":
+ stemmer = new TurkishStemmer$();
+ break;
+ default:
+ stemmer = new EnglishStemmer$();
+ break;
+ }
+ return stemmer;
+};
+
+var _Main$_createStemmer$S = _Main._createStemmer$S;
+
+/**
+ * class node extends Object
+ * @constructor
+ */
+function node() {
+}
+
+/**
+ * @constructor
+ */
+function node$() {
+};
+
+node$.prototype = new node;
+
+/**
+ * @param {!string} source
+ * @return {*}
+ */
+node.require$S = function (source) {
+ /** @type {!string} */
+ var src;
+ src = 'require(' + JSON.stringify(source) + ')';
+ return eval(src);
+};
+
+var node$require$S = node.require$S;
+
+/**
+ * class Oktavia extends Object
+ * @constructor
+ */
+function Oktavia() {
+}
+
+/**
+ * @constructor
+ */
+function Oktavia$() {
+ /** @type {Array.<undefined|!string>} */
+ var _utf162compressCode$0;
+ this._compressCode2utf16 = null;
+ this._fmindex = new FMIndex$();
+ this._metadatas = ({ });
+ this._metadataLabels = [ ];
+ this._stemmer = null;
+ this._stemmingResult = ({ });
+ _utf162compressCode$0 = this._utf162compressCode = [ Oktavia.eof, Oktavia.eob, Oktavia.unknown ];
+ _utf162compressCode$0.length = 65536;
+ this._compressCode2utf16 = [ Oktavia.eof, Oktavia.eob, Oktavia.unknown ];
+};
+
+Oktavia$.prototype = new Oktavia;
+
+/**
+ * @param {Stemmer} stemmer
+ */
+Oktavia.prototype.setStemmer$LStemmer$ = function (stemmer) {
+ this._stemmer = stemmer;
+};
+
+/**
+ * @return {Metadata}
+ */
+Oktavia.prototype.getPrimaryMetadata$ = function () {
+ return this._metadatas[this._metadataLabels[0]];
+};
+
+/**
+ * @param {!string} key
+ * @return {Section}
+ */
+Oktavia.prototype.addSection$S = function (key) {
+ /** @type {Section} */
+ var section;
+ if (this._metadataLabels.indexOf(key) !== -1) {
+ throw new Error('Metadata name ' + key + ' is already exists');
+ }
+ this._metadataLabels.push(key);
+ section = new Section$LOktavia$(this);
+ this._metadatas[key] = section;
+ return section;
+};
+
+/**
+ * @param {!string} key
+ * @return {Section}
+ */
+Oktavia.prototype.getSection$S = function (key) {
+ if (this._metadataLabels.indexOf(key) === -1) {
+ throw new Error('Metadata name ' + key + " does't exists");
+ }
+ return this._metadatas[key];
+};
+
+/**
+ * @param {!string} key
+ * @return {Splitter}
+ */
+Oktavia.prototype.addSplitter$S = function (key) {
+ /** @type {Splitter} */
+ var splitter;
+ if (this._metadataLabels.indexOf(key) !== -1) {
+ throw new Error('Metadata name ' + key + ' is already exists');
+ }
+ this._metadataLabels.push(key);
+ splitter = new Splitter$LOktavia$(this);
+ this._metadatas[key] = splitter;
+ return splitter;
+};
+
+/**
+ * @param {!string} key
+ * @return {Splitter}
+ */
+Oktavia.prototype.getSplitter$S = function (key) {
+ if (this._metadataLabels.indexOf(key) === -1) {
+ throw new Error('Metadata name ' + key + " does't exists");
+ }
+ return this._metadatas[key];
+};
+
+/**
+ * @param {!string} key
+ * @param {Array.<undefined|!string>} headers
+ * @return {Table}
+ */
+Oktavia.prototype.addTable$SAS = function (key, headers) {
+ /** @type {Table} */
+ var table;
+ if (this._metadataLabels.indexOf(key) !== -1) {
+ throw new Error('Metadata name ' + key + ' is already exists');
+ }
+ this._metadataLabels.push(key);
+ table = new Table$LOktavia$AS(this, headers);
+ this._metadatas[key] = table;
+ return table;
+};
+
+/**
+ * @param {!string} key
+ * @return {Table}
+ */
+Oktavia.prototype.getTable$S = function (key) {
+ if (this._metadataLabels.indexOf(key) === -1) {
+ throw new Error('Metadata name ' + key + " does't exists");
+ }
+ return this._metadatas[key];
+};
+
+/**
+ * @param {!string} key
+ * @return {Block}
+ */
+Oktavia.prototype.addBlock$S = function (key) {
+ /** @type {Block} */
+ var block;
+ if (this._metadataLabels.indexOf(key) !== -1) {
+ throw new Error('Metadata name ' + key + ' is already exists');
+ }
+ this._metadataLabels.push(key);
+ block = new Block$LOktavia$(this);
+ this._metadatas[key] = block;
+ return block;
+};
+
+/**
+ * @param {!string} key
+ * @return {Block}
+ */
+Oktavia.prototype.getBlock$S = function (key) {
+ if (this._metadataLabels.indexOf(key) === -1) {
+ throw new Error('Metadata name ' + key + " does't exists");
+ }
+ return this._metadatas[key];
+};
+
+/**
+ */
+Oktavia.prototype.addEndOfBlock$ = function () {
+ this._fmindex.push$S(Oktavia.eob);
+};
+
+/**
+ * @param {!string} words
+ */
+Oktavia.prototype.addWord$S = function (words) {
+ /** @type {Array.<undefined|!string>} */
+ var str;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var charCode;
+ /** @type {undefined|!string} */
+ var newCharCode;
+ str = [ ];
+ str.length = words.length;
+ for (i = 0; i < words.length; i++) {
+ charCode = words.charCodeAt(i);
+ newCharCode = this._utf162compressCode[charCode];
+ if (newCharCode == null) {
+ newCharCode = String.fromCharCode(this._compressCode2utf16.length);
+ this._utf162compressCode[charCode] = newCharCode;
+ this._compressCode2utf16.push(String.fromCharCode(charCode));
+ }
+ str.push(newCharCode);
+ }
+ this._fmindex.push$S(str.join(''));
+};
+
+/**
+ * @param {!string} words
+ * @param {!boolean} stemming
+ */
+Oktavia.prototype.addWord$SB = function (words, stemming) {
+ /** @type {Array.<undefined|!string>} */
+ var wordList;
+ /** @type {!number} */
+ var i;
+ /** @type {undefined|!string} */
+ var originalWord;
+ /** @type {!string} */
+ var smallWord;
+ /** @type {undefined|!string} */
+ var registerWord;
+ /** @type {!string} */
+ var baseWord;
+ /** @type {!string} */
+ var compressedCodeWord;
+ /** @type {Array.<undefined|!string>} */
+ var stemmedList;
+ this.addWord$S(words);
+ wordList = words.split(/\s+/);
+ for (i = 0; i < wordList.length; i++) {
+ originalWord = wordList[i];
+ smallWord = originalWord.slice(0, 1).toLowerCase() + originalWord.slice(1);
+ registerWord = null;
+ if (stemming && this._stemmer) {
+ baseWord = this._stemmer.stemWord$S(originalWord.toLowerCase());
+ if (originalWord.indexOf(baseWord) === -1) {
+ registerWord = baseWord;
+ }
+ } else {
+ if (originalWord != smallWord) {
+ registerWord = smallWord;
+ }
+ }
+ if (registerWord) {
+ compressedCodeWord = this._convertToCompressionCode$S(originalWord);
+ stemmedList = this._stemmingResult[registerWord];
+ if (! stemmedList) {
+ stemmedList = [ compressedCodeWord ];
+ this._stemmingResult[registerWord] = stemmedList;
+ } else {
+ if (stemmedList.indexOf(compressedCodeWord) === -1) {
+ stemmedList.push(compressedCodeWord);
+ }
+ }
+ }
+ }
+};
+
+/**
+ * @param {!string} keyword
+ * @return {!string}
+ */
+Oktavia.prototype._convertToCompressionCode$S = function (keyword) {
+ /** @type {Array.<undefined|!string>} */
+ var resultChars;
+ /** @type {!number} */
+ var i;
+ /** @type {undefined|!string} */
+ var chr;
+ resultChars = [ ];
+ for (i = 0; i < keyword.length; i++) {
+ chr = this._utf162compressCode[keyword.charCodeAt(i)];
+ if (chr == null) {
+ resultChars.push(Oktavia.unknown);
+ } else {
+ resultChars.push(chr);
+ }
+ }
+ return resultChars.join('');
+};
+
+/**
+ * @param {!string} keyword
+ * @param {!boolean} stemming
+ * @return {Array.<undefined|!number>}
+ */
+Oktavia.prototype.rawSearch$SB = function (keyword, stemming) {
+ /** @type {Array.<undefined|!number>} */
+ var result;
+ /** @type {!string} */
+ var baseWord;
+ /** @type {Array.<undefined|!string>} */
+ var stemmedList;
+ /** @type {!number} */
+ var i;
+ /** @type {undefined|!string} */
+ var word;
+ if (stemming) {
+ result = [ ];
+ if (this._stemmer) {
+ baseWord = this._stemmer.stemWord$S(keyword.toLowerCase());
+ stemmedList = this._stemmingResult[baseWord];
+ if (stemmedList) {
+ for (i = 0; i < stemmedList.length; i++) {
+ word = stemmedList[i];
+ result = result.concat(this._fmindex.search$S(word));
+ }
+ }
+ }
+ } else {
+ result = this._fmindex.search$S(this._convertToCompressionCode$S(keyword));
+ }
+ return result;
+};
+
+/**
+ * @param {Array.<undefined|Query>} queries
+ * @return {SearchSummary}
+ */
+Oktavia.prototype.search$ALQuery$ = function (queries) {
+ /** @type {SearchSummary} */
+ var summary;
+ /** @type {!number} */
+ var i;
+ /** @type {SingleResult} */
+ var result$0;
+ summary = ({sourceResults: [ ], result: null, oktavia: this});
+ for (i = 0; i < queries.length; i++) {
+ result$0 = this._searchQuery$LQuery$(queries[i]);
+ summary.sourceResults.push(result$0);
+ }
+ summary.result = SearchSummary$mergeResult$LSearchSummary$ALSingleResult$(summary, summary.sourceResults);
+ return summary;
+};
+
+/**
+ * @param {Query} query
+ * @return {SingleResult}
+ */
+Oktavia.prototype._searchQuery$LQuery$ = function (query) {
+ /** @type {SingleResult} */
+ var result;
+ /** @type {Array.<undefined|!number>} */
+ var positions;
+ result = new SingleResult$SBB(query.word, query.or, query.not);
+ if (query.raw) {
+ positions = this.rawSearch$SB(query.word, false);
+ } else {
+ positions = this.rawSearch$SB(query.word, false).concat(this.rawSearch$SB(query.word, true));
+ }
+ this._metadatas[this._metadataLabels[0]].grouping$LSingleResult$AISB(result, positions, query.word, ! query.raw);
+ return result;
+};
+
+/**
+ */
+Oktavia.prototype.build$ = function () {
+ this.build$IB(5, false);
+};
+
+/**
+ * @param {!number} cacheDensity
+ * @param {!boolean} verbose
+ */
+Oktavia.prototype.build$IB = function (cacheDensity, verbose) {
+ /** @type {!string} */
+ var key;
+ /** @type {!number} */
+ var cacheRange;
+ /** @type {!number} */
+ var maxChar;
+ for (key in this._metadatas) {
+ this._metadatas[key]._build$();
+ }
+ cacheRange = Math.round(Math.max(1, 100 / Math.min(100, Math.max(0.01, cacheDensity))));
+ maxChar = this._compressCode2utf16.length;
+ this._fmindex.build$SIIB(Oktavia.eof, maxChar, cacheRange, verbose);
+};
+
+/**
+ * @return {!string}
+ */
+Oktavia.prototype.dump$ = function () {
+ return this.dump$B(false);
+};
+
+/**
+ * @param {!boolean} verbose
+ * @return {!string}
+ */
+Oktavia.prototype.dump$B = function (verbose) {
+ /** @type {!string} */
+ var header;
+ /** @type {!string} */
+ var fmdata;
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var i;
+ /** @type {CompressionReport} */
+ var report;
+ /** @type {undefined|!string} */
+ var name;
+ /** @type {!string} */
+ var data;
+ header = Binary$dumpString$SLCompressionReport$("oktavia-01", null).slice(1);
+ if (verbose) {
+ console.log("Source text size: " + (this._fmindex.size$() * 2 + "") + ' bytes');
+ }
+ fmdata = this._fmindex.dump$B(verbose);
+ result = [ header, fmdata ];
+ result.push(Binary$dump16bitNumber$I(this._compressCode2utf16.length));
+ for (i = 3; i < this._compressCode2utf16.length; i++) {
+ result.push(this._compressCode2utf16[i]);
+ }
+ if (verbose) {
+ console.log('Char Code Map: ' + (this._compressCode2utf16.length * 2 - 2 + "") + ' bytes');
+ }
+ report = ({source: 0, result: 0});
+ result.push(Binary$dumpStringListMap$HASLCompressionReport$(this._stemmingResult, report));
+ if (verbose) {
+ console.log('Stemmed Word Table: ' + (result[result.length - 1].length + "") + ' bytes (' + (Math.round(report.result * 100.0 / report.source) + "") + '%)');
+ }
+ result.push(Binary$dump16bitNumber$I(this._metadataLabels.length));
+ for (i = 0; i < this._metadataLabels.length; i++) {
+ report = ({source: 0, result: 0});
+ name = this._metadataLabels[i];
+ data = this._metadatas[name]._dump$LCompressionReport$(report);
+ result.push(Binary$dumpString$SLCompressionReport$(name, report), data);
+ if (verbose) {
+ console.log('Meta Data ' + name + ': ' + (data.length * 2 + "") + ' bytes (' + (Math.round(report.result * 100.0 / report.source) + "") + '%)');
+ }
+ }
+ return result.join('');
+};
+
+/**
+ * @param {!string} data
+ */
+Oktavia.prototype.load$S = function (data) {
+ /** @type {!string} */
+ var header;
+ /** @type {!number} */
+ var offset;
+ /** @type {!number} */
+ var charCodeCount;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var charCode;
+ /** @type {LoadedStringListMapResult} */
+ var stemmedWords;
+ /** @type {!number} */
+ var metadataCount;
+ /** @type {LoadedStringResult} */
+ var nameResult;
+ /** @type {!string} */
+ var name;
+ /** @type {!number} */
+ var type;
+ header = Binary$dumpString$SLCompressionReport$("oktavia-01", null).slice(1);
+ if (data.slice(0, 5) !== header) {
+ throw new Error('Invalid data file');
+ }
+ this._metadatas = ({ });
+ this._metadataLabels = [ ];
+ offset = 5;
+ offset = this._fmindex.load$SI(data, offset);
+ charCodeCount = Binary$load16bitNumber$SI(data, offset++);
+ this._compressCode2utf16 = [ Oktavia.eof, Oktavia.eob, Oktavia.unknown ];
+ this._utf162compressCode = [ Oktavia.eof, Oktavia.eob, Oktavia.unknown ];
+ for (i = 3; i < charCodeCount; i++) {
+ charCode = Binary$load16bitNumber$SI(data, offset++);
+ this._compressCode2utf16.push(String.fromCharCode(charCode));
+ this._utf162compressCode[charCode] = String.fromCharCode(i);
+ }
+ stemmedWords = Binary$loadStringListMap$SI(data, offset);
+ this._stemmingResult = stemmedWords.result;
+ offset = stemmedWords.offset;
+ metadataCount = Binary$load16bitNumber$SI(data, offset++);
+ for (i = 0; i < metadataCount; i++) {
+ nameResult = Binary$loadString$SI(data, offset);
+ name = nameResult.result;
+ offset = nameResult.offset;
+ type = Binary$load16bitNumber$SI(data, offset++);
+ switch (type) {
+ case 0:
+ offset = Section$_load$LOktavia$SSI(this, name, data, offset);
+ break;
+ case 1:
+ offset = Splitter$_load$LOktavia$SSI(this, name, data, offset);
+ break;
+ case 2:
+ offset = Table$_load$LOktavia$SSI(this, name, data, offset);
+ break;
+ case 3:
+ offset = Block$_load$LOktavia$SSI(this, name, data, offset);
+ break;
+ }
+ }
+};
+
+/**
+ * @return {!number}
+ */
+Oktavia.prototype.contentSize$ = function () {
+ /** @type {FMIndex} */
+ var this$0;
+ this$0 = this._fmindex;
+ return this$0._substr.length;
+};
+
+/**
+ * @param {!number} position
+ * @return {!number}
+ */
+Oktavia.prototype.wordPositionType$I = function (position) {
+ /** @type {!number} */
+ var result;
+ /** @type {!string} */
+ var ahead;
+ result = 0;
+ if (position === 0) {
+ result = 4;
+ } else {
+ ahead = this._fmindex.getSubstring$II(position - 1, 1);
+ if (/\s/.test(ahead)) {
+ result = 2;
+ } else {
+ if (/\W/.test(ahead)) {
+ result = 1;
+ } else {
+ if (Oktavia.eob === ahead) {
+ result = 3;
+ }
+ }
+ }
+ }
+ return (result | 0);
+};
+
+/**
+ * @param {!number} position
+ * @param {!number} length
+ * @return {!string}
+ */
+Oktavia.prototype._getSubstring$II = function (position, length) {
+ /** @type {!string} */
+ var result;
+ /** @type {Array.<undefined|!string>} */
+ var str;
+ /** @type {!number} */
+ var i;
+ result = this._fmindex.getSubstring$II(position, length);
+ str = [ ];
+ for (i = 0; i < result.length; i++) {
+ str.push(this._compressCode2utf16[result.charCodeAt(i)]);
+ }
+ return str.join('');
+};
+
+/**
+ * class CommandOption extends Object
+ * @constructor
+ */
+function CommandOption() {
+}
+
+/**
+ * @constructor
+ * @param {!string} option
+ */
+function CommandOption$S(option) {
+ this.option = option;
+ this.optarg = null;
+ this.error = false;
+};
+
+CommandOption$S.prototype = new CommandOption;
+
+/**
+ * @constructor
+ * @param {!string} option
+ * @param {!string} optarg
+ */
+function CommandOption$SS(option, optarg) {
+ this.option = option;
+ this.optarg = optarg;
+ this.error = false;
+};
+
+CommandOption$SS.prototype = new CommandOption;
+
+/**
+ * @constructor
+ * @param {!string} option
+ * @param {!string} optarg
+ * @param {!boolean} error
+ */
+function CommandOption$SSB(option, optarg, error) {
+ this.option = option;
+ this.optarg = optarg;
+ this.error = error;
+};
+
+CommandOption$SSB.prototype = new CommandOption;
+
+/**
+ * class BasicParser extends Object
+ * @constructor
+ */
+function BasicParser() {
+}
+
+/**
+ * @constructor
+ * @param {!string} optstring
+ * @param {Array.<undefined|!string>} argv
+ */
+function BasicParser$SAS(optstring, argv) {
+ this._silent = false;
+ this._argv = argv;
+ this._options = ({ });
+ this._aliases = ({ });
+ this._optind = 0;
+ this._subind = 0;
+ this._extraoptions = false;
+ this._parseOptstr$S(optstring);
+};
+
+BasicParser$SAS.prototype = new BasicParser;
+
+/**
+ * @param {!string} msg
+ * @return {Error}
+ */
+BasicParser._makeError$S = function (msg) {
+ return new Error('getopt: ' + msg);
+};
+
+var BasicParser$_makeError$S = BasicParser._makeError$S;
+
+/**
+ * @param {!string} optstr
+ */
+BasicParser.prototype._parseOptstr$S = function (optstr) {
+ /** @type {!number} */
+ var i;
+ /** @type {!string} */
+ var chr;
+ /** @type {!boolean} */
+ var arg;
+ /** @type {!number} */
+ var cp;
+ /** @type {!string} */
+ var alias;
+ i = 0;
+ if (optstr.length > 0 && optstr.slice(0, 1) === ':') {
+ this._silent = true;
+ i++;
+ } else {
+ this._silent = false;
+ }
+ while (i < optstr.length) {
+ chr = optstr.slice(i, i + 1);
+ arg = false;
+ if (! /^[\w\d]$/.test(chr)) {
+ throw new Error("invalid optstring: only alphanumeric characters may be used as options: " + chr);
+ }
+ if (i + 1 < optstr.length && optstr.slice(i + 1, i + 2) === ':') {
+ arg = true;
+ i++;
+ }
+ this._options[chr] = arg;
+ while (i + 1 < optstr.length && optstr.slice(i + 1, i + 2) === '(') {
+ i++;
+ cp = optstr.indexOf(')', i + 1);
+ if (cp === -1) {
+ throw new Error("invalid optstring: missing \")\" to match \"(\" at char " + (i + ""));
+ }
+ alias = optstr.substring(i + 1, cp);
+ this._aliases[alias] = chr;
+ i = cp;
+ }
+ i++;
+ }
+};
+
+/**
+ * @return {!number}
+ */
+BasicParser.prototype.optind$ = function () {
+ return this._optind;
+};
+
+/**
+ * @return {CommandOption}
+ */
+BasicParser.prototype.getopt$ = function () {
+ /** @type {undefined|!string} */
+ var arg;
+ if (this._optind >= this._argv.length) {
+ return null;
+ }
+ arg = this._argv[this._optind];
+ if (this._extraoptions) {
+ this._optind++;
+ return ({option: arg, optarg: null, error: false});
+ }
+ if (this._subind === 0) {
+ if (arg == '-' || arg == '') {
+ return null;
+ }
+ if (arg.charAt(0) !== '-') {
+ this._extraoptions = true;
+ this._optind++;
+ return ({option: arg, optarg: null, error: false});
+ }
+ if (arg == '--') {
+ this._optind++;
+ this._subind = 0;
+ return null;
+ }
+ if (arg.slice(1, 2) === '-') {
+ return this._getoptLong$();
+ }
+ this._subind++;
+ }
+ return this._getoptShort$();
+};
+
+/**
+ * @return {CommandOption}
+ */
+BasicParser.prototype._getoptShort$ = function () {
+ /** @type {undefined|!string} */
+ var arg;
+ /** @type {!string} */
+ var chr;
+ /** @type {!number} */
+ var _subind$0;
+ arg = this._argv[this._optind];
+ chr = arg.slice(_subind$0 = this._subind, _subind$0 + 1);
+ if (++ this._subind >= arg.length) {
+ this._optind++;
+ this._subind = 0;
+ }
+ return (! (chr in this._options) ? this._errInvalidOption$S(chr) : ! this._options[chr] ? ({option: chr, optarg: null, error: false}) : this._getoptArgument$S(chr));
+};
+
+/**
+ * @return {CommandOption}
+ */
+BasicParser.prototype._getoptLong$ = function () {
+ /** @type {undefined|!string} */
+ var arg;
+ /** @type {!number} */
+ var eq;
+ /** @type {!string} */
+ var alias;
+ /** @type {undefined|!string} */
+ var chr;
+ arg = this._argv[this._optind];
+ eq = arg.indexOf('=');
+ alias = arg.substring(2, eq === -1 ? arg.length : eq);
+ if (! (alias in this._aliases)) {
+ return this._errInvalidOption$S(alias);
+ }
+ chr = this._aliases[alias];
+ if (! this._options[chr]) {
+ if (eq !== -1) {
+ return this._errExtraArg$S(alias);
+ }
+ this._optind++;
+ return ({option: chr, optarg: null, error: false});
+ }
+ if (eq === -1) {
+ this._optind++;
+ } else {
+ this._subind = (eq + 1 | 0);
+ }
+ return this._getoptArgument$S(chr);
+};
+
+/**
+ * @param {!string} chr
+ * @return {CommandOption}
+ */
+BasicParser.prototype._getoptArgument$S = function (chr) {
+ /** @type {!string} */
+ var arg;
+ if (this._optind >= this._argv.length) {
+ return this._errMissingArg$S(chr);
+ }
+ arg = this._argv[this._optind].substring(this._subind);
+ this._optind++;
+ this._subind = 0;
+ return ({option: chr, optarg: arg, error: false});
+};
+
+/**
+ * @param {!string} chr
+ * @return {CommandOption}
+ */
+BasicParser.prototype._errMissingArg$S = function (chr) {
+ if (this._silent) {
+ return ({option: ':', optarg: chr, error: false});
+ }
+ console.error('option requires an argument -- ' + chr + '\n');
+ return ({option: '?', optarg: chr, error: true});
+};
+
+/**
+ * @param {!string} chr
+ * @return {CommandOption}
+ */
+BasicParser.prototype._errInvalidOption$S = function (chr) {
+ if (! this._silent) {
+ console.error('illegal option -- ' + chr + '\n');
+ }
+ return ({option: '?', optarg: chr, error: true});
+};
+
+/**
+ * @param {!string} chr
+ * @return {CommandOption}
+ */
+BasicParser.prototype._errExtraArg$S = function (chr) {
+ if (! this._silent) {
+ console.error('option expects no argument -- ' + chr + '\n');
+ }
+ return ({option: '?', optarg: chr, error: true});
+};
+
+/**
+ * class TagFilter extends Object
+ * @constructor
+ */
+function TagFilter() {
+}
+
+/**
+ * @constructor
+ * @param {Array.<undefined|!string>} filters
+ */
+function TagFilter$AS(filters) {
+ /** @type {!number} */
+ var i;
+ /** @type {undefined|!string} */
+ var filter;
+ this.tags = [ ];
+ this.ids = [ ];
+ this.classes = [ ];
+ this.tagAndClasses = [ ];
+ for (i = 0; i < filters.length; i++) {
+ filter = filters[i];
+ switch (filter.charAt(0)) {
+ case '#':
+ this.ids.push(filter.slice(1));
+ break;
+ case '.':
+ this.classes.push(filter.slice(1));
+ break;
+ default:
+ if (filter.indexOf('.') !== -1) {
+ this.tags.push(filter);
+ } else {
+ this.tagAndClasses.push(filter);
+ }
+ }
+ }
+};
+
+TagFilter$AS.prototype = new TagFilter;
+
+/**
+ * @param {!string} tagname
+ * @param {Object.<string, undefined|!string>} attributes
+ * @return {!boolean}
+ */
+TagFilter.prototype.match$SHS = function (tagname, attributes) {
+ /** @type {!boolean} */
+ var result;
+ /** @type {undefined|!string} */
+ var classname;
+ result = false;
+ if (this.tags.indexOf(tagname) !== -1) {
+ result = true;
+ } else {
+ if (attributes.id && this.ids.indexOf(attributes.id) !== -1) {
+ result = true;
+ } else {
+ if (attributes.class) {
+ classname = attributes.class;
+ if (this.classes.indexOf(classname) !== -1 || this.tagAndClasses.indexOf(tagname + '.' + classname) !== -1) {
+ result = true;
+ }
+ }
+ }
+ }
+ return result;
+};
+
+/**
+ * class HTMLParser extends Object
+ * @constructor
+ */
+function HTMLParser() {
+}
+
+/**
+ * @constructor
+ * @param {!number} unit
+ * @param {!string} root
+ * @param {!string} prefix
+ * @param {Array.<undefined|!string>} filter
+ * @param {Stemmer} stemmer
+ */
+function HTMLParser$ISSASLStemmer$(unit, root, prefix, filter, stemmer) {
+ /** @type {Oktavia} */
+ var this$0;
+ /** @type {Oktavia} */
+ var oktavia$0;
+ this.unit = unit;
+ this.root = root;
+ this.prefix = prefix;
+ this.filter = new TagFilter$AS(filter);
+ oktavia$0 = this.oktavia = new Oktavia$();
+ oktavia$0.addSection$S('section');
+ this.oktavia.addBlock$S('tag');
+ if (stemmer) {
+ this$0 = this.oktavia;
+ this$0._stemmer = stemmer;
+ }
+};
+
+HTMLParser$ISSASLStemmer$.prototype = new HTMLParser;
+
+/**
+ * @param {!string} filepath
+ */
+HTMLParser.prototype.parse$S = function (filepath) {
+ /** @type {!string} */
+ var relative;
+ /** @type {!string} */
+ var lines;
+ /** @type {_HTMLHandler} */
+ var handler;
+ /** @type {SAXParser} */
+ var parser;
+ relative = this.prefix + node.path.relative(this.root, filepath);
+ console.log('reading: ' + relative);
+ lines = node.fs.readFileSync(filepath, 'utf8');
+ handler = new _HTMLHandler$LOktavia$SILTagFilter$(this.oktavia, relative, this.unit, this.filter);
+ parser = new SAXParser$LSAXHandler$(handler);
+ parser.parse$S(lines);
+};
+
+/**
+ * @param {!number} cacheDensity
+ * @param {!boolean} verbose
+ * @return {!string}
+ */
+HTMLParser.prototype.dump$IB = function (cacheDensity, verbose) {
+ console.log('\nbuilding...\n');
+ this.oktavia.build$IB(cacheDensity, verbose);
+ return this.oktavia.dump$B(verbose);
+};
+
+/**
+ * class CSVParser extends Object
+ * @constructor
+ */
+function CSVParser() {
+}
+
+/**
+ * @constructor
+ * @param {!string} root
+ * @param {Stemmer} stemmer
+ */
+function CSVParser$SLStemmer$(root, stemmer) {
+ this.oktavia = new Oktavia$();
+ this.root = root;
+ this.stemmer = stemmer;
+};
+
+CSVParser$SLStemmer$.prototype = new CSVParser;
+
+/**
+ * @param {CSVParser} $this
+ * @param {!string} filepath
+ */
+CSVParser.parse$LCSVParser$S = function ($this, filepath) {
+};
+
+var CSVParser$parse$LCSVParser$S = CSVParser.parse$LCSVParser$S;
+
+/**
+ * class TextParser extends Object
+ * @constructor
+ */
+function TextParser() {
+}
+
+/**
+ * @constructor
+ * @param {!string} unit
+ * @param {!string} root
+ * @param {Stemmer} stemmer
+ */
+function TextParser$SSLStemmer$(unit, root, stemmer) {
+ this.oktavia = new Oktavia$();
+ this.unit = unit;
+ this.root = root;
+ this.stemmer = stemmer;
+};
+
+TextParser$SSLStemmer$.prototype = new TextParser;
+
+/**
+ * @param {TextParser} $this
+ * @param {!string} filepath
+ */
+TextParser.parse$LTextParser$S = function ($this, filepath) {
+ node.fs.readFileSync(filepath, 'utf8');
+};
+
+var TextParser$parse$LTextParser$S = TextParser.parse$LTextParser$S;
+
+/**
+ * class Binary extends Object
+ * @constructor
+ */
+function Binary() {
+}
+
+/**
+ * @constructor
+ */
+function Binary$() {
+};
+
+Binary$.prototype = new Binary;
+
+/**
+ * @param {!number} num
+ * @return {!string}
+ */
+Binary.dump32bitNumber$N = function (num) {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ result = [ String.fromCharCode(Math.floor(num / 65536)) ];
+ result.push(String.fromCharCode(num % 65536));
+ return result.join("");
+};
+
+var Binary$dump32bitNumber$N = Binary.dump32bitNumber$N;
+
+/**
+ * @param {!string} buffer
+ * @param {!number} offset
+ * @return {!number}
+ */
+Binary.load32bitNumber$SI = function (buffer, offset) {
+ /** @type {!number} */
+ var result;
+ result = buffer.charCodeAt(offset) * 65536 + buffer.charCodeAt(offset + 1);
+ return result;
+};
+
+var Binary$load32bitNumber$SI = Binary.load32bitNumber$SI;
+
+/**
+ * @param {!number} num
+ * @return {!string}
+ */
+Binary.dump16bitNumber$I = function (num) {
+ return String.fromCharCode(num % 65536);
+};
+
+var Binary$dump16bitNumber$I = Binary.dump16bitNumber$I;
+
+/**
+ * @param {!string} buffer
+ * @param {!number} offset
+ * @return {!number}
+ */
+Binary.load16bitNumber$SI = function (buffer, offset) {
+ return (buffer.charCodeAt(offset) | 0);
+};
+
+var Binary$load16bitNumber$SI = Binary.load16bitNumber$SI;
+
+/**
+ * @param {!string} str
+ * @return {!string}
+ */
+Binary.dumpString$S = function (str) {
+ return Binary$dumpString$SLCompressionReport$(str, null);
+};
+
+var Binary$dumpString$S = Binary.dumpString$S;
+
+/**
+ * @param {!string} str
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+Binary.dumpString$SLCompressionReport$ = function (str, report) {
+ /** @type {!number} */
+ var length;
+ /** @type {!boolean} */
+ var compress;
+ /** @type {Array.<undefined|!number>} */
+ var charCodes;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var charCode;
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {undefined|!number} */
+ var bytes;
+ if (str.length > 32768) {
+ str = str.slice(0, 32768);
+ }
+ length = str.length;
+ compress = true;
+ charCodes = [ ];
+ for (i = 0; i < length; i++) {
+ charCode = str.charCodeAt(i);
+ if (charCode > 255) {
+ compress = false;
+ break;
+ }
+ charCodes.push(charCode);
+ }
+ if (compress) {
+ result = [ Binary$dump16bitNumber$I(length + 32768) ];
+ for (i = 0; i < length; i += 2) {
+ bytes = charCodes[i];
+ if (i !== length - 1) {
+ bytes += charCodes[i + 1] << 8;
+ }
+ result.push(String.fromCharCode(bytes % 65536));
+ }
+ if (report) {
+ CompressionReport$add$LCompressionReport$II(report, length, Math.ceil(length / 2));
+ }
+ } else {
+ result = [ Binary$dump16bitNumber$I(length), str ];
+ if (report) {
+ CompressionReport$add$LCompressionReport$II(report, length, length);
+ }
+ }
+ return result.join('');
+};
+
+var Binary$dumpString$SLCompressionReport$ = Binary.dumpString$SLCompressionReport$;
+
+/**
+ * @param {!string} buffer
+ * @param {!number} offset
+ * @return {LoadedStringResult}
+ */
+Binary.loadString$SI = function (buffer, offset) {
+ return new LoadedStringResult$SI(buffer, offset);
+};
+
+var Binary$loadString$SI = Binary.loadString$SI;
+
+/**
+ * @param {Array.<undefined|!string>} strList
+ * @return {!string}
+ */
+Binary.dumpStringList$AS = function (strList) {
+ return Binary$dumpStringList$ASLCompressionReport$(strList, null);
+};
+
+var Binary$dumpStringList$AS = Binary.dumpStringList$AS;
+
+/**
+ * @param {Array.<undefined|!string>} strList
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+Binary.dumpStringList$ASLCompressionReport$ = function (strList, report) {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var i;
+ result = [ Binary$dump32bitNumber$N(strList.length) ];
+ for (i = 0; i < strList.length; i++) {
+ result.push(Binary$dumpString$SLCompressionReport$(strList[i], report));
+ }
+ return result.join('');
+};
+
+var Binary$dumpStringList$ASLCompressionReport$ = Binary.dumpStringList$ASLCompressionReport$;
+
+/**
+ * @param {!string} buffer
+ * @param {!number} offset
+ * @return {LoadedStringListResult}
+ */
+Binary.loadStringList$SI = function (buffer, offset) {
+ return new LoadedStringListResult$SI(buffer, offset);
+};
+
+var Binary$loadStringList$SI = Binary.loadStringList$SI;
+
+/**
+ * @param {Object.<string, undefined|Array.<undefined|!string>>} strMap
+ * @return {!string}
+ */
+Binary.dumpStringListMap$HAS = function (strMap) {
+ return Binary$dumpStringListMap$HASLCompressionReport$(strMap, null);
+};
+
+var Binary$dumpStringListMap$HAS = Binary.dumpStringListMap$HAS;
+
+/**
+ * @param {Object.<string, undefined|Array.<undefined|!string>>} strMap
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+Binary.dumpStringListMap$HASLCompressionReport$ = function (strMap, report) {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var counter;
+ /** @type {!string} */
+ var key;
+ result = [ ];
+ counter = 0;
+ for (key in strMap) {
+ result.push(Binary$dumpString$SLCompressionReport$(key, report));
+ result.push(Binary$dumpStringList$ASLCompressionReport$(strMap[key], report));
+ counter++;
+ }
+ return Binary$dump32bitNumber$N(counter) + result.join('');
+};
+
+var Binary$dumpStringListMap$HASLCompressionReport$ = Binary.dumpStringListMap$HASLCompressionReport$;
+
+/**
+ * @param {!string} buffer
+ * @param {!number} offset
+ * @return {LoadedStringListMapResult}
+ */
+Binary.loadStringListMap$SI = function (buffer, offset) {
+ return new LoadedStringListMapResult$SI(buffer, offset);
+};
+
+var Binary$loadStringListMap$SI = Binary.loadStringListMap$SI;
+
+/**
+ * @param {Array.<undefined|!number>} array
+ * @return {!string}
+ */
+Binary.dump32bitNumberList$AN = function (array) {
+ return Binary$dump32bitNumberList$ANLCompressionReport$(array, null);
+};
+
+var Binary$dump32bitNumberList$AN = Binary.dump32bitNumberList$AN;
+
+/**
+ * @param {Array.<undefined|!number>} array
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+Binary.dump32bitNumberList$ANLCompressionReport$ = function (array, report) {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var index;
+ /** @type {!number} */
+ var inputLength;
+ /** @type {!number} */
+ var length;
+ /** @type {!string} */
+ var resultString;
+ /** @type {!number} */
+ var value1$0;
+ /** @type {!number} */
+ var value2$0;
+ result = [ Binary$dump32bitNumber$N(array.length) ];
+ index = 0;
+ inputLength = array.length;
+ while (index < inputLength) {
+ if (array[index] == 0) {
+ length = Binary$_countZero$ANI(array, index);
+ result.push(Binary$_zeroBlock$I(length));
+ index += length;
+ } else {
+ if (Binary$_shouldZebraCode$ANI(array, index)) {
+ result.push(Binary$_createZebraCode$ANI(array, index));
+ value1$0 = array.length;
+ value2$0 = index + 15;
+ index = (value1$0 <= value2$0 ? value1$0 : value2$0);
+ } else {
+ length = Binary$_searchDoubleZero$ANI(array, index);
+ result.push(Binary$_nonZeroBlock$ANII(array, index, length));
+ if (length === 0) {
+ throw new Error('');
+ }
+ index += length;
+ }
+ }
+ }
+ resultString = result.join('');
+ if (report) {
+ CompressionReport$add$LCompressionReport$II(report, array.length * 2 + 2, resultString.length);
+ }
+ return resultString;
+};
+
+var Binary$dump32bitNumberList$ANLCompressionReport$ = Binary.dump32bitNumberList$ANLCompressionReport$;
+
+/**
+ * @param {!string} buffer
+ * @param {!number} offset
+ * @return {LoadedNumberListResult}
+ */
+Binary.load32bitNumberList$SI = function (buffer, offset) {
+ return new LoadedNumberListResult$SI(buffer, offset);
+};
+
+var Binary$load32bitNumberList$SI = Binary.load32bitNumberList$SI;
+
+/**
+ * @param {Array.<undefined|!number>} array
+ * @param {!number} offset
+ * @return {!number}
+ */
+Binary._countZero$ANI = function (array, offset) {
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var array$len$0;
+ for ((i = offset, array$len$0 = array.length); i < array$len$0; i++) {
+ if (array[i] != 0) {
+ return (i - offset | 0);
+ }
+ }
+ return (array.length - offset | 0);
+};
+
+var Binary$_countZero$ANI = Binary._countZero$ANI;
+
+/**
+ * @param {!number} length
+ * @return {!string}
+ */
+Binary._zeroBlock$I = function (length) {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ result = [ ];
+ while (length > 0) {
+ if (length > 16384) {
+ result.push(Binary$dump16bitNumber$I(16383));
+ length -= 16384;
+ } else {
+ result.push(Binary$dump16bitNumber$I(length - 1));
+ length = 0;
+ }
+ }
+ return result.join('');
+};
+
+var Binary$_zeroBlock$I = Binary._zeroBlock$I;
+
+/**
+ * @param {Array.<undefined|!number>} array
+ * @param {!number} offset
+ * @return {!boolean}
+ */
+Binary._shouldZebraCode$ANI = function (array, offset) {
+ /** @type {!number} */
+ var change;
+ /** @type {!boolean} */
+ var isLastZero;
+ /** @type {!number} */
+ var i;
+ if (array.length - offset < 16) {
+ return true;
+ }
+ change = 0;
+ isLastZero = false;
+ for (i = offset; i < offset + 15; i++) {
+ if (array[i] == 0) {
+ if (! isLastZero) {
+ isLastZero = true;
+ change++;
+ }
+ } else {
+ if (isLastZero) {
+ isLastZero = false;
+ change++;
+ }
+ }
+ }
+ return change > 2;
+};
+
+var Binary$_shouldZebraCode$ANI = Binary._shouldZebraCode$ANI;
+
+/**
+ * @param {Array.<undefined|!number>} array
+ * @param {!number} offset
+ * @return {!number}
+ */
+Binary._searchDoubleZero$ANI = function (array, offset) {
+ /** @type {!boolean} */
+ var isLastZero;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var array$len$0;
+ isLastZero = false;
+ for ((i = offset, array$len$0 = array.length); i < array$len$0; i++) {
+ if (array[i] == 0) {
+ if (isLastZero) {
+ return (i - offset - 1 | 0);
+ }
+ isLastZero = true;
+ } else {
+ isLastZero = false;
+ }
+ }
+ return (array.length - offset | 0);
+};
+
+var Binary$_searchDoubleZero$ANI = Binary._searchDoubleZero$ANI;
+
+/**
+ * @param {Array.<undefined|!number>} array
+ * @param {!number} offset
+ * @param {!number} length
+ * @return {!string}
+ */
+Binary._nonZeroBlock$ANII = function (array, offset, length) {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var blockLength;
+ /** @type {!number} */
+ var i;
+ result = [ ];
+ while (length > 0) {
+ if (length > 16384) {
+ blockLength = 16384;
+ length -= 16384;
+ } else {
+ blockLength = length;
+ length = 0;
+ }
+ result.push(Binary$dump16bitNumber$I(blockLength - 1 + 0x4000));
+ for (i = offset; i < offset + blockLength; i++) {
+ result.push(Binary$dump32bitNumber$N(array[i]));
+ }
+ offset += blockLength;
+ }
+ return result.join('');
+};
+
+var Binary$_nonZeroBlock$ANII = Binary._nonZeroBlock$ANII;
+
+/**
+ * @param {Array.<undefined|!number>} array
+ * @param {!number} offset
+ * @return {!string}
+ */
+Binary._createZebraCode$ANI = function (array, offset) {
+ /** @type {!number} */
+ var last;
+ /** @type {!number} */
+ var code;
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var value1$0;
+ /** @type {!number} */
+ var value2$0;
+ value1$0 = offset + 15;
+ value2$0 = array.length;
+ last = (value1$0 <= value2$0 ? value1$0 : value2$0);
+ code = 0x8000;
+ result = [ ];
+ for (i = offset; i < last; i++) {
+ if (array[i] != 0) {
+ result.push(Binary$dump32bitNumber$N(array[i]));
+ code = code + (0x1 << i - offset);
+ }
+ }
+ return String.fromCharCode(code) + result.join('');
+};
+
+var Binary$_createZebraCode$ANI = Binary._createZebraCode$ANI;
+
+/**
+ * @param {!string} str
+ * @return {!string}
+ */
+Binary.base64encode$S = function (str) {
+ /** @type {Array.<undefined|!string>} */
+ var out;
+ /** @type {Array.<undefined|!number>} */
+ var source;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var code;
+ /** @type {!number} */
+ var len;
+ /** @type {!number} */
+ var c1;
+ /** @type {undefined|!number} */
+ var c2;
+ /** @type {undefined|!number} */
+ var c3;
+ out = [ ];
+ source = [ ];
+ for (i = 0; i < str.length; i++) {
+ code = str.charCodeAt(i);
+ source.push(code & 0x00ff, code >>> 8);
+ }
+ len = str.length * 2;
+ i = 0;
+ while (i < len) {
+ c1 = source[i++] & 0xff;
+ if (i === len) {
+ out.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(c1 >> 2));
+ out.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((c1 & 0x3) << 4));
+ out.push("==");
+ break;
+ }
+ c2 = source[i++];
+ if (i === len) {
+ out.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(c1 >> 2));
+ out.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((c1 & 0x3) << 4 | (c2 & 0xF0) >> 4));
+ out.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((c2 & 0xF) << 2));
+ out.push("=");
+ break;
+ }
+ c3 = source[i++];
+ out.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(c1 >> 2));
+ out.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((c1 & 0x3) << 4 | (c2 & 0xF0) >> 4));
+ out.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((c2 & 0xF) << 2 | (c3 & 0xC0) >> 6));
+ out.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(c3 & 0x3F));
+ }
+ return out.join('');
+};
+
+var Binary$base64encode$S = Binary.base64encode$S;
+
+/**
+ * @param {Array.<undefined|!number>} source
+ * @return {!string}
+ */
+Binary._mergeCharCode$AI = function (source) {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var i;
+ result = [ ];
+ for (i = 0; i < source.length; i += 2) {
+ result.push(String.fromCharCode(source[i] + (source[i + 1] << 8)));
+ }
+ return result.join('');
+};
+
+var Binary$_mergeCharCode$AI = Binary._mergeCharCode$AI;
+
+/**
+ * @param {!string} str
+ * @return {!string}
+ */
+Binary.base64decode$S = function (str) {
+ /** @type {!number} */
+ var len;
+ /** @type {!number} */
+ var i;
+ /** @type {Array.<undefined|!number>} */
+ var out;
+ /** @type {undefined|!number} */
+ var c1;
+ /** @type {undefined|!number} */
+ var c2;
+ /** @type {!number} */
+ var c3;
+ /** @type {!number} */
+ var c4;
+ len = str.length;
+ i = 0;
+ out = [ ];
+ while (i < len) {
+ do {
+ c1 = Binary._base64DecodeChars[str.charCodeAt(i++) & 0xff];
+ } while (i < len && c1 == -1);
+ if (c1 == -1) {
+ break;
+ }
+ do {
+ c2 = Binary._base64DecodeChars[str.charCodeAt(i++) & 0xff];
+ } while (i < len && c2 == -1);
+ if (c2 == -1) {
+ break;
+ }
+ out.push(c1 << 2 | (c2 & 0x30) >> 4);
+ do {
+ c3 = str.charCodeAt(i++) & 0xff;
+ if (c3 === 61) {
+ return Binary$_mergeCharCode$AI(out);
+ }
+ c3 = Binary._base64DecodeChars[c3];
+ } while (i < len && c3 === -1);
+ if (c3 === -1) {
+ break;
+ }
+ out.push((c2 & 0XF) << 4 | (c3 & 0x3C) >> 2);
+ do {
+ c4 = str.charCodeAt(i++) & 0xff;
+ if (c4 === 61) {
+ return Binary$_mergeCharCode$AI(out);
+ }
+ c4 = (Binary._base64DecodeChars[c4] | 0);
+ } while (i < len && c4 === -1);
+ if (c4 === -1) {
+ break;
+ }
+ out.push((c3 & 0x03) << 6 | c4);
+ }
+ return Binary$_mergeCharCode$AI(out);
+};
+
+var Binary$base64decode$S = Binary.base64decode$S;
+
+/**
+ * class LoadedStringResult extends Object
+ * @constructor
+ */
+function LoadedStringResult() {
+}
+
+/**
+ * @constructor
+ * @param {!string} data
+ * @param {!number} offset
+ */
+function LoadedStringResult$SI(data, offset) {
+ /** @type {!number} */
+ var strLength;
+ /** @type {Array.<undefined|!string>} */
+ var bytes;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var code;
+ /** @type {!number} */
+ var offset$0;
+ this.result = "";
+ this.offset = 0;
+ offset$0 = offset++;
+ strLength = data.charCodeAt(offset$0);
+ if (strLength > 32767) {
+ strLength = strLength - 32768;
+ bytes = [ ];
+ for (i = 0; i < strLength; i += 2) {
+ code = data.charCodeAt(offset);
+ bytes.push(String.fromCharCode(code & 0x00ff));
+ if (i !== strLength - 1) {
+ bytes.push(String.fromCharCode(code >>> 8));
+ }
+ offset++;
+ }
+ this.result = bytes.join('');
+ this.offset = offset;
+ } else {
+ this.result = data.slice(offset, offset + strLength);
+ this.offset = (offset + strLength | 0);
+ }
+};
+
+LoadedStringResult$SI.prototype = new LoadedStringResult;
+
+/**
+ * class LoadedStringListResult extends Object
+ * @constructor
+ */
+function LoadedStringListResult() {
+}
+
+/**
+ * @constructor
+ * @param {!string} data
+ * @param {!number} offset
+ */
+function LoadedStringListResult$SI(data, offset) {
+ /** @type {!number} */
+ var length;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var strLength;
+ /** @type {!string} */
+ var resultStr;
+ /** @type {Array.<undefined|!string>} */
+ var bytes;
+ /** @type {!number} */
+ var j;
+ /** @type {!number} */
+ var code;
+ /** @type {!number} */
+ var result$0;
+ /** @type {!number} */
+ var offset$0;
+ this.offset = 0;
+ this.result = [ ];
+ result$0 = data.charCodeAt(offset) * 65536 + data.charCodeAt(offset + 1);
+ length = result$0;
+ offset += 2;
+ for (i = 0; i < length; i++) {
+ offset$0 = offset++;
+ strLength = data.charCodeAt(offset$0);
+ if (strLength > 32767) {
+ strLength = strLength - 32768;
+ bytes = [ ];
+ for (j = 0; j < strLength; j += 2) {
+ code = data.charCodeAt(offset);
+ bytes.push(String.fromCharCode(code & 0x00ff));
+ if (j !== strLength - 1) {
+ bytes.push(String.fromCharCode(code >>> 8));
+ }
+ offset++;
+ }
+ resultStr = bytes.join('');
+ } else {
+ resultStr = data.slice(offset, offset + strLength);
+ offset = (offset + strLength | 0);
+ }
+ this.result.push(resultStr);
+ }
+ this.offset = offset;
+};
+
+LoadedStringListResult$SI.prototype = new LoadedStringListResult;
+
+/**
+ * class LoadedStringListMapResult extends Object
+ * @constructor
+ */
+function LoadedStringListMapResult() {
+}
+
+/**
+ * @constructor
+ * @param {!string} data
+ * @param {!number} offset
+ */
+function LoadedStringListMapResult$SI(data, offset) {
+ /** @type {!number} */
+ var length;
+ /** @type {!number} */
+ var i;
+ /** @type {LoadedStringResult} */
+ var keyResult;
+ /** @type {LoadedStringListResult} */
+ var valueResult;
+ /** @type {!number} */
+ var result$0;
+ /** @type {!number} */
+ var offset$0;
+ this.offset = 0;
+ this.result = ({ });
+ result$0 = data.charCodeAt(offset) * 65536 + data.charCodeAt(offset + 1);
+ length = result$0;
+ offset += 2;
+ for (i = 0; i < length; i++) {
+ keyResult = new LoadedStringResult$SI(data, offset);
+ offset$0 = keyResult.offset;
+ valueResult = new LoadedStringListResult$SI(data, offset$0);
+ this.result[keyResult.result] = valueResult.result;
+ offset = valueResult.offset;
+ }
+ this.offset = offset;
+};
+
+LoadedStringListMapResult$SI.prototype = new LoadedStringListMapResult;
+
+/**
+ * class LoadedNumberListResult extends Object
+ * @constructor
+ */
+function LoadedNumberListResult() {
+}
+
+/**
+ * @constructor
+ * @param {!string} data
+ * @param {!number} offset
+ */
+function LoadedNumberListResult$SI(data, offset) {
+ /** @type {!number} */
+ var resultLength;
+ /** @type {!number} */
+ var originalOffset;
+ /** @type {Array.<undefined|!number>} */
+ var result;
+ /** @type {!number} */
+ var tag;
+ /** @type {!number} */
+ var length;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var result$0;
+ /** @type {!number} */
+ var value1$0;
+ this.result = null;
+ this.offset = 0;
+ result$0 = data.charCodeAt(offset) * 65536 + data.charCodeAt(offset + 1);
+ resultLength = result$0;
+ originalOffset = offset;
+ offset += 2;
+ result = [ ];
+ while (result.length < resultLength) {
+ tag = data.charCodeAt(offset++);
+ if (tag >>> 15 === 1) {
+ value1$0 = resultLength - result.length;
+ length = (value1$0 <= 15 ? value1$0 : 15);
+ for (i = 0; i < length; i++) {
+ if (tag >>> i & 0x1) {
+ result.push(Binary$load32bitNumber$SI(data, offset));
+ offset += 2;
+ } else {
+ result.push(0);
+ }
+ }
+ } else {
+ if (tag >>> 14 === 1) {
+ length = tag - 0x4000 + 1;
+ for (i = 0; i < length; i++) {
+ result.push(Binary$load32bitNumber$SI(data, offset));
+ offset += 2;
+ }
+ } else {
+ length = tag + 1;
+ for (i = 0; i < length; i++) {
+ result.push(0);
+ }
+ }
+ }
+ }
+ this.result = result;
+ this.offset = offset;
+};
+
+LoadedNumberListResult$SI.prototype = new LoadedNumberListResult;
+
+/**
+ * class CompressionReport extends Object
+ * @constructor
+ */
+function CompressionReport() {
+}
+
+/**
+ * @constructor
+ */
+function CompressionReport$() {
+ this.source = 0;
+ this.result = 0;
+};
+
+CompressionReport$.prototype = new CompressionReport;
+
+/**
+ * @param {CompressionReport} $this
+ * @param {!number} source
+ * @param {!number} result
+ */
+CompressionReport.add$LCompressionReport$II = function ($this, source, result) {
+ $this.source += source;
+ $this.result += result;
+};
+
+var CompressionReport$add$LCompressionReport$II = CompressionReport.add$LCompressionReport$II;
+
+/**
+ * @param {CompressionReport} $this
+ * @return {!number}
+ */
+CompressionReport.rate$LCompressionReport$ = function ($this) {
+ return (Math.round($this.result * 100.0 / $this.source) | 0);
+};
+
+var CompressionReport$rate$LCompressionReport$ = CompressionReport.rate$LCompressionReport$;
+
+/**
+ * class Stemmer
+ * @constructor
+ */
+function Stemmer() {
+}
+
+Stemmer.prototype.$__jsx_implements_Stemmer = true;
+
+/**
+ * @constructor
+ */
+function Stemmer$() {
+};
+
+Stemmer$.prototype = new Stemmer;
+
+/**
+ * class js extends Object
+ * @constructor
+ */
+function js() {
+}
+
+/**
+ * @constructor
+ */
+function js$() {
+};
+
+js$.prototype = new js;
+
+/**
+ * class Metadata extends Object
+ * @constructor
+ */
+function Metadata() {
+}
+
+/**
+ * @constructor
+ * @param {Oktavia} parent
+ */
+function Metadata$LOktavia$(parent) {
+ this._parent = parent;
+ this._bitVector = new BitVector$();
+};
+
+Metadata$LOktavia$.prototype = new Metadata;
+
+/**
+ * @return {!number}
+ */
+Metadata.prototype._size$ = function () {
+ /** @type {BitVector} */
+ var this$0;
+ /** @type {!number} */
+ var i$0;
+ /** @type {BitVector} */
+ var _bitVector$0;
+ this$0 = _bitVector$0 = this._bitVector;
+ i$0 = _bitVector$0._size;
+ return this$0.rank$IB(i$0, true);
+};
+
+/**
+ * @param {!number} index
+ * @return {!string}
+ */
+Metadata.prototype.getContent$I = function (index) {
+ /** @type {!number} */
+ var startPosition;
+ /** @type {!number} */
+ var length;
+ if (index < 0 || this._size$() <= index) {
+ throw new Error("Section.getContent() : range error " + (index + ""));
+ }
+ startPosition = 0;
+ if (index > 0) {
+ startPosition = this._bitVector.select$I(index - 1) + 1;
+ }
+ length = this._bitVector.select$I(index) - startPosition + 1;
+ return this._parent._getSubstring$II(startPosition, length);
+};
+
+/**
+ * @param {!number} index
+ * @return {!number}
+ */
+Metadata.prototype.getStartPosition$I = function (index) {
+ /** @type {!number} */
+ var startPosition;
+ if (index < 0 || this._size$() <= index) {
+ throw new Error("Section.getContent() : range error " + (index + ""));
+ }
+ startPosition = 0;
+ if (index > 0) {
+ startPosition = this._bitVector.select$I(index - 1) + 1;
+ }
+ return (startPosition | 0);
+};
+
+/**
+ * @param {SingleResult} result
+ * @param {Array.<undefined|!number>} positions
+ * @param {!string} word
+ * @param {!boolean} stemmed
+ */
+Metadata.prototype.grouping$LSingleResult$AISB = function (result, positions, word, stemmed) {
+};
+
+/**
+ * @param {!number} index
+ * @return {!string}
+ */
+Metadata.prototype.getInformation$I = function (index) {
+ return '';
+};
+
+/**
+ */
+Metadata.prototype._build$ = function () {
+ this._bitVector.build$();
+};
+
+/**
+ * @param {!string} name
+ * @param {!string} data
+ * @param {!number} offset
+ * @return {!number}
+ */
+Metadata.prototype._load$SSI = function (name, data, offset) {
+ offset = this._bitVector.load$SI(data, offset);
+ this._parent._metadataLabels.push(name);
+ this._parent._metadatas[name] = this;
+ return offset;
+};
+
+/**
+ * @return {!string}
+ */
+Metadata.prototype._dump$ = function () {
+ /** @type {BitVector} */
+ var this$0;
+ /** @type {Array.<undefined|!string>} */
+ var contents$0;
+ this$0 = this._bitVector;
+ contents$0 = [ ];
+ contents$0.push(Binary$dump32bitNumber$N(this$0._size));
+ contents$0.push(Binary$dump32bitNumberList$AN(this$0._v));
+ return contents$0.join('');
+};
+
+/**
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+Metadata.prototype._dump$LCompressionReport$ = function (report) {
+ /** @type {BitVector} */
+ var this$0;
+ /** @type {Array.<undefined|!string>} */
+ var contents$0;
+ this$0 = this._bitVector;
+ contents$0 = [ ];
+ contents$0.push(Binary$dump32bitNumber$N(this$0._size));
+ CompressionReport$add$LCompressionReport$II(report, 2, 2);
+ contents$0.push(Binary$dump32bitNumberList$ANLCompressionReport$(this$0._v, report));
+ return contents$0.join('');
+};
+
+/**
+ * class Section extends Metadata
+ * @constructor
+ */
+function Section() {
+}
+
+Section.prototype = new Metadata;
+/**
+ * @constructor
+ * @param {Oktavia} parent
+ */
+function Section$LOktavia$(parent) {
+ this._parent = parent;
+ this._bitVector = new BitVector$();
+ this._names = [ ];
+};
+
+Section$LOktavia$.prototype = new Section;
+
+/**
+ * @param {!string} name
+ */
+Section.prototype.setTail$S = function (name) {
+ /** @type {!number} */
+ var index$0;
+ /** @type {Oktavia} */
+ var this$0;
+ /** @type {FMIndex} */
+ var this$0$0;
+ this$0 = this._parent;
+ this$0$0 = this$0._fmindex;
+ index$0 = this$0$0._substr.length;
+ this._names.push(name);
+ this._bitVector.set$I(index$0 - 1);
+};
+
+/**
+ * @param {!string} name
+ * @param {!number} index
+ */
+Section.prototype.setTail$SI = function (name, index) {
+ this._names.push(name);
+ this._bitVector.set$I(index - 1);
+};
+
+/**
+ * @return {!number}
+ */
+Section.prototype.size$ = function () {
+ return (this._names.length | 0);
+};
+
+/**
+ * @param {!number} position
+ * @return {!number}
+ */
+Section.prototype.getSectionIndex$I = function (position) {
+ /** @type {BitVector} */
+ var this$0;
+ if (position < 0 || this._bitVector.size$() <= position) {
+ throw new Error("Section.getSectionIndex() : range error " + (position + ""));
+ }
+ this$0 = this._bitVector;
+ return this$0.rank$IB(position, true);
+};
+
+/**
+ * @param {!number} index
+ * @return {!string}
+ */
+Section.prototype.getName$I = function (index) {
+ if (index < 0 || this._names.length <= index) {
+ throw new Error("Section.getName() : range error");
+ }
+ return this._names[index];
+};
+
+/**
+ * @param {SingleResult} result
+ * @param {Array.<undefined|!number>} positions
+ * @param {!string} word
+ * @param {!boolean} stemmed
+ */
+Section.prototype.grouping$LSingleResult$AISB = function (result, positions, word, stemmed) {
+ /** @type {!number} */
+ var i;
+ /** @type {undefined|!number} */
+ var position;
+ /** @type {!number} */
+ var index;
+ /** @type {SearchUnit} */
+ var unit;
+ for (i = 0; i < positions.length; i++) {
+ position = positions[i];
+ index = this.getSectionIndex$I(position);
+ unit = SingleResult$getSearchUnit$LSingleResult$I(result, index);
+ if (unit.startPosition < 0) {
+ unit.startPosition = this.getStartPosition$I(index);
+ }
+ SearchUnit$addPosition$LSearchUnit$SIB(unit, word, position - unit.startPosition, stemmed);
+ }
+};
+
+/**
+ * @param {!number} index
+ * @return {!string}
+ */
+Section.prototype.getInformation$I = function (index) {
+ return this.getName$I(index);
+};
+
+/**
+ * @param {Oktavia} parent
+ * @param {!string} name
+ * @param {!string} data
+ * @param {!number} offset
+ * @return {!number}
+ */
+Section._load$LOktavia$SSI = function (parent, name, data, offset) {
+ /** @type {LoadedStringListResult} */
+ var strs;
+ /** @type {Section} */
+ var section;
+ /** @type {!number} */
+ var offset$0;
+ strs = new LoadedStringListResult$SI(data, offset);
+ section = new Section$LOktavia$(parent);
+ section._names = strs.result;
+ offset$0 = strs.offset;
+ offset$0 = section._bitVector.load$SI(data, offset$0);
+ section._parent._metadataLabels.push(name);
+ section._parent._metadatas[name] = section;
+ return offset$0;
+};
+
+var Section$_load$LOktavia$SSI = Section._load$LOktavia$SSI;
+
+/**
+ * @return {!string}
+ */
+Section.prototype._dump$ = function () {
+ return [ Binary$dump16bitNumber$I(0), Binary$dumpStringList$AS(this._names), Metadata.prototype._dump$.call(this) ].join('');
+};
+
+/**
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+Section.prototype._dump$LCompressionReport$ = function (report) {
+ CompressionReport$add$LCompressionReport$II(report, 1, 1);
+ return [ Binary$dump16bitNumber$I(0), Binary$dumpStringList$ASLCompressionReport$(this._names, report), Metadata.prototype._dump$LCompressionReport$.call(this, report) ].join('');
+};
+
+/**
+ * class Splitter extends Metadata
+ * @constructor
+ */
+function Splitter() {
+}
+
+Splitter.prototype = new Metadata;
+/**
+ * @constructor
+ * @param {Oktavia} parent
+ */
+function Splitter$LOktavia$(parent) {
+ this._parent = parent;
+ this._bitVector = new BitVector$();
+ this.name = null;
+};
+
+Splitter$LOktavia$.prototype = new Splitter;
+
+/**
+ * @constructor
+ * @param {Oktavia} parent
+ * @param {!string} name
+ */
+function Splitter$LOktavia$S(parent, name) {
+ this._parent = parent;
+ this._bitVector = new BitVector$();
+ this.name = name;
+};
+
+Splitter$LOktavia$S.prototype = new Splitter;
+
+/**
+ * @return {!number}
+ */
+Splitter.prototype.size$ = function () {
+ /** @type {BitVector} */
+ var this$0$0;
+ /** @type {!number} */
+ var i$0$0;
+ /** @type {BitVector} */
+ var _bitVector$0;
+ this$0$0 = _bitVector$0 = this._bitVector;
+ i$0$0 = _bitVector$0._size;
+ return this$0$0.rank$IB(i$0$0, true);
+};
+
+/**
+ */
+Splitter.prototype.split$ = function () {
+ /** @type {!number} */
+ var index$0;
+ /** @type {Oktavia} */
+ var this$0;
+ /** @type {FMIndex} */
+ var this$0$0;
+ this$0 = this._parent;
+ this$0$0 = this$0._fmindex;
+ index$0 = this$0$0._substr.length;
+ this._bitVector.set$I(index$0 - 1);
+};
+
+/**
+ * @param {!number} index
+ */
+Splitter.prototype.split$I = function (index) {
+ this._bitVector.set$I(index - 1);
+};
+
+/**
+ * @param {!number} position
+ * @return {!number}
+ */
+Splitter.prototype.getIndex$I = function (position) {
+ /** @type {BitVector} */
+ var this$0;
+ if (position < 0 || this._bitVector.size$() <= position) {
+ throw new Error("Section.getSectionIndex() : range error");
+ }
+ this$0 = this._bitVector;
+ return this$0.rank$IB(position, true);
+};
+
+/**
+ * @param {SingleResult} result
+ * @param {Array.<undefined|!number>} positions
+ * @param {!string} word
+ * @param {!boolean} stemmed
+ */
+Splitter.prototype.grouping$LSingleResult$AISB = function (result, positions, word, stemmed) {
+ /** @type {!number} */
+ var i;
+ /** @type {undefined|!number} */
+ var position;
+ /** @type {!number} */
+ var index;
+ /** @type {SearchUnit} */
+ var unit;
+ for (i = 0; i < positions.length; i++) {
+ position = positions[i];
+ index = this.getIndex$I(position);
+ unit = SingleResult$getSearchUnit$LSingleResult$I(result, index);
+ if (unit.startPosition < 0) {
+ unit.startPosition = this.getStartPosition$I(index);
+ }
+ SearchUnit$addPosition$LSearchUnit$SIB(unit, word, position - unit.startPosition, stemmed);
+ }
+};
+
+/**
+ * @param {!number} index
+ * @return {!string}
+ */
+Splitter.prototype.getInformation$I = function (index) {
+ return (this.name != null ? this.name + (index + 1 + "") : '');
+};
+
+/**
+ * @param {Oktavia} parent
+ * @param {!string} name
+ * @param {!string} data
+ * @param {!number} offset
+ * @return {!number}
+ */
+Splitter._load$LOktavia$SSI = function (parent, name, data, offset) {
+ /** @type {Splitter} */
+ var section;
+ section = new Splitter$LOktavia$(parent);
+ offset = section._bitVector.load$SI(data, offset);
+ section._parent._metadataLabels.push(name);
+ section._parent._metadatas[name] = section;
+ return offset;
+};
+
+var Splitter$_load$LOktavia$SSI = Splitter._load$LOktavia$SSI;
+
+/**
+ * @return {!string}
+ */
+Splitter.prototype._dump$ = function () {
+ return [ Binary$dump16bitNumber$I(1), Metadata.prototype._dump$.call(this) ].join('');
+};
+
+/**
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+Splitter.prototype._dump$LCompressionReport$ = function (report) {
+ CompressionReport$add$LCompressionReport$II(report, 1, 1);
+ return [ Binary$dump16bitNumber$I(1), Metadata.prototype._dump$LCompressionReport$.call(this, report) ].join('');
+};
+
+/**
+ * class Table extends Metadata
+ * @constructor
+ */
+function Table() {
+}
+
+Table.prototype = new Metadata;
+/**
+ * @constructor
+ * @param {Oktavia} parent
+ * @param {Array.<undefined|!string>} headers
+ */
+function Table$LOktavia$AS(parent, headers) {
+ this._parent = parent;
+ this._bitVector = new BitVector$();
+ this._headers = headers;
+ this._columnTails = new BitVector$();
+};
+
+Table$LOktavia$AS.prototype = new Table;
+
+/**
+ * @return {!number}
+ */
+Table.prototype.rowSize$ = function () {
+ /** @type {BitVector} */
+ var this$0$0;
+ /** @type {!number} */
+ var i$0$0;
+ /** @type {BitVector} */
+ var _bitVector$0;
+ this$0$0 = _bitVector$0 = this._bitVector;
+ i$0$0 = _bitVector$0._size;
+ return this$0$0.rank$IB(i$0$0, true);
+};
+
+/**
+ * @return {!number}
+ */
+Table.prototype.columnSize$ = function () {
+ return (this._headers.length | 0);
+};
+
+/**
+ */
+Table.prototype.setColumnTail$ = function () {
+ /** @type {!number} */
+ var index;
+ /** @type {Oktavia} */
+ var this$0;
+ /** @type {FMIndex} */
+ var this$0$0;
+ /** @type {Oktavia} */
+ var _parent$0;
+ this$0 = _parent$0 = this._parent;
+ this$0$0 = this$0._fmindex;
+ index = this$0$0._substr.length;
+ _parent$0._fmindex.push$S(Oktavia.eob);
+ this._columnTails.set$I(index - 1);
+};
+
+/**
+ */
+Table.prototype.setRowTail$ = function () {
+ /** @type {!number} */
+ var index;
+ /** @type {Oktavia} */
+ var this$0;
+ /** @type {FMIndex} */
+ var this$0$0;
+ this$0 = this._parent;
+ this$0$0 = this$0._fmindex;
+ index = this$0$0._substr.length;
+ this._bitVector.set$I(index - 1);
+};
+
+/**
+ * @param {!number} position
+ * @return {Array.<undefined|!number>}
+ */
+Table.prototype.getCell$I = function (position) {
+ /** @type {!number} */
+ var row;
+ /** @type {!number} */
+ var currentColumn;
+ /** @type {!number} */
+ var lastRowColumn;
+ /** @type {!number} */
+ var startPosition;
+ /** @type {Array.<undefined|!number>} */
+ var result;
+ /** @type {BitVector} */
+ var this$0;
+ /** @type {BitVector} */
+ var this$1;
+ if (position < 0 || this._bitVector.size$() <= position) {
+ throw new Error("Section.getSectionIndex() : range error " + (position + ""));
+ }
+ this$0 = this._bitVector;
+ row = this$0.rank$IB(position, true);
+ this$1 = this._columnTails;
+ currentColumn = this$1.rank$IB(position, true);
+ lastRowColumn = 0;
+ if (row > 0) {
+ startPosition = this._bitVector.select$I(row - 1) + 1;
+ lastRowColumn = this._columnTails.rank$I(startPosition);
+ }
+ result = [ row, currentColumn - lastRowColumn ];
+ return result;
+};
+
+/**
+ * @param {!number} rowIndex
+ * @return {Object.<string, undefined|!string>}
+ */
+Table.prototype.getRowContent$I = function (rowIndex) {
+ /** @type {!string} */
+ var content;
+ /** @type {Array.<undefined|!string>} */
+ var values;
+ /** @type {Object.<string, undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var i;
+ content = this.getContent$I(rowIndex);
+ values = content.split(Oktavia.eob, this._headers.length);
+ result = ({ });
+ for (i in this._headers) {
+ if (i < values.length) {
+ result[this._headers[i]] = values[i];
+ } else {
+ result[this._headers[i]] = '';
+ }
+ }
+ return result;
+};
+
+/**
+ * @param {SingleResult} result
+ * @param {Array.<undefined|!number>} positions
+ * @param {!string} word
+ * @param {!boolean} stemmed
+ */
+Table.prototype.grouping$LSingleResult$AISB = function (result, positions, word, stemmed) {
+};
+
+/**
+ * @param {!number} index
+ * @return {!string}
+ */
+Table.prototype.getInformation$I = function (index) {
+ return '';
+};
+
+/**
+ */
+Table.prototype._build$ = function () {
+ this._bitVector.build$();
+ this._columnTails.build$();
+};
+
+/**
+ * @param {Oktavia} parent
+ * @param {!string} name
+ * @param {!string} data
+ * @param {!number} offset
+ * @return {!number}
+ */
+Table._load$LOktavia$SSI = function (parent, name, data, offset) {
+ /** @type {LoadedStringListResult} */
+ var strs;
+ /** @type {Table} */
+ var table;
+ /** @type {!number} */
+ var offset$0;
+ strs = new LoadedStringListResult$SI(data, offset);
+ table = new Table$LOktavia$AS(parent, strs.result);
+ offset$0 = strs.offset;
+ offset$0 = table._bitVector.load$SI(data, offset$0);
+ table._parent._metadataLabels.push(name);
+ table._parent._metadatas[name] = table;
+ offset = offset$0;
+ return table._columnTails.load$SI(data, offset$0);
+};
+
+var Table$_load$LOktavia$SSI = Table._load$LOktavia$SSI;
+
+/**
+ * @return {!string}
+ */
+Table.prototype._dump$ = function () {
+ return [ Binary$dump16bitNumber$I(2), Binary$dumpStringList$AS(this._headers), Metadata.prototype._dump$.call(this), this._columnTails.dump$() ].join('');
+};
+
+/**
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+Table.prototype._dump$LCompressionReport$ = function (report) {
+ CompressionReport$add$LCompressionReport$II(report, 1, 1);
+ return [ Binary$dump16bitNumber$I(2), Binary$dumpStringList$ASLCompressionReport$(this._headers, report), Metadata.prototype._dump$LCompressionReport$.call(this, report), this._columnTails.dump$LCompressionReport$(report) ].join('');
+};
+
+/**
+ * class Block extends Metadata
+ * @constructor
+ */
+function Block() {
+}
+
+Block.prototype = new Metadata;
+/**
+ * @constructor
+ * @param {Oktavia} parent
+ */
+function Block$LOktavia$(parent) {
+ this._parent = parent;
+ this._bitVector = new BitVector$();
+ this._names = [ ];
+ this._start = false;
+};
+
+Block$LOktavia$.prototype = new Block;
+
+/**
+ * @param {!string} blockName
+ */
+Block.prototype.startBlock$S = function (blockName) {
+ this.startBlock$SI(blockName, this._parent.contentSize$());
+};
+
+/**
+ * @param {!string} blockName
+ * @param {!number} index
+ */
+Block.prototype.startBlock$SI = function (blockName, index) {
+ if (this._start) {
+ throw new Error('Splitter `' + this._names[this._names.length - 1] + '` is not closed');
+ }
+ this._start = true;
+ this._names.push(blockName);
+ this._bitVector.set$I(index - 1);
+};
+
+/**
+ */
+Block.prototype.endBlock$ = function () {
+ this.endBlock$I(this._parent.contentSize$());
+};
+
+/**
+ * @param {!number} index
+ */
+Block.prototype.endBlock$I = function (index) {
+ if (! this._start) {
+ throw new Error('Splitter is not started');
+ }
+ this._start = false;
+ this._bitVector.set$I(index - 1);
+};
+
+/**
+ * @return {!number}
+ */
+Block.prototype.size$ = function () {
+ return (this._names.length | 0);
+};
+
+/**
+ * @param {!number} position
+ * @return {!number}
+ */
+Block.prototype.blockIndex$I = function (position) {
+ /** @type {!number} */
+ var result;
+ /** @type {BitVector} */
+ var this$0;
+ if (position < 0 || this._parent._fmindex.size$() - 1 <= position) {
+ throw new Error("Block.blockIndex() : range error " + (position + ""));
+ }
+ if (position >= this._bitVector.size$()) {
+ position = (this._bitVector.size$() - 1 | 0);
+ result = (this._bitVector.rank$I(position) + 1 | 0);
+ } else {
+ this$0 = this._bitVector;
+ result = this$0.rank$IB(position, true);
+ }
+ return result;
+};
+
+/**
+ * @param {!number} position
+ * @return {!boolean}
+ */
+Block.prototype.inBlock$I = function (position) {
+ /** @type {!number} */
+ var blockIndex;
+ blockIndex = this.blockIndex$I(position);
+ return blockIndex % 2 !== 0;
+};
+
+/**
+ * @param {!number} position
+ * @return {!string}
+ */
+Block.prototype.getBlockContent$I = function (position) {
+ /** @type {!number} */
+ var blockIndex;
+ /** @type {!string} */
+ var result;
+ blockIndex = this.blockIndex$I(position);
+ if (blockIndex % 2 !== 0) {
+ result = this.getContent$I(blockIndex);
+ } else {
+ result = '';
+ }
+ return result;
+};
+
+/**
+ * @param {!number} position
+ * @return {!string}
+ */
+Block.prototype.getBlockName$I = function (position) {
+ /** @type {!number} */
+ var blockIndex;
+ /** @type {!string} */
+ var result;
+ blockIndex = this.blockIndex$I(position);
+ if (blockIndex % 2 !== 0) {
+ result = this._names[blockIndex >>> 1];
+ } else {
+ result = '';
+ }
+ return result;
+};
+
+/**
+ * @param {SingleResult} result
+ * @param {Array.<undefined|!number>} positions
+ * @param {!string} word
+ * @param {!boolean} stemmed
+ */
+Block.prototype.grouping$LSingleResult$AISB = function (result, positions, word, stemmed) {
+};
+
+/**
+ * @param {!number} index
+ * @return {!string}
+ */
+Block.prototype.getInformation$I = function (index) {
+ return '';
+};
+
+/**
+ * @param {Oktavia} parent
+ * @param {!string} name
+ * @param {!string} data
+ * @param {!number} offset
+ * @return {!number}
+ */
+Block._load$LOktavia$SSI = function (parent, name, data, offset) {
+ /** @type {LoadedStringListResult} */
+ var strs;
+ /** @type {Block} */
+ var block;
+ /** @type {!number} */
+ var offset$0;
+ strs = new LoadedStringListResult$SI(data, offset);
+ block = new Block$LOktavia$(parent);
+ block._names = strs.result;
+ offset$0 = strs.offset;
+ offset$0 = block._bitVector.load$SI(data, offset$0);
+ block._parent._metadataLabels.push(name);
+ block._parent._metadatas[name] = block;
+ return offset$0;
+};
+
+var Block$_load$LOktavia$SSI = Block._load$LOktavia$SSI;
+
+/**
+ * @return {!string}
+ */
+Block.prototype._dump$ = function () {
+ return [ Binary$dump16bitNumber$I(3), Binary$dumpStringList$AS(this._names), Metadata.prototype._dump$.call(this) ].join('');
+};
+
+/**
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+Block.prototype._dump$LCompressionReport$ = function (report) {
+ CompressionReport$add$LCompressionReport$II(report, 1, 1);
+ return [ Binary$dump16bitNumber$I(3), Binary$dumpStringList$ASLCompressionReport$(this._names, report), Metadata.prototype._dump$LCompressionReport$.call(this, report) ].join('');
+};
+
+/**
+ * class FMIndex extends Object
+ * @constructor
+ */
+function FMIndex() {
+}
+
+/**
+ * @constructor
+ */
+function FMIndex$() {
+ /** @type {Array.<undefined|!number>} */
+ var _rlt$0;
+ this._ssize = 0;
+ (this._ddic = 0, this._head = 0);
+ this._substr = "";
+ this._sv = new WaveletMatrix$();
+ this._posdic = [ ];
+ this._idic = [ ];
+ _rlt$0 = this._rlt = [ ];
+ _rlt$0.length = 65536;
+};
+
+FMIndex$.prototype = new FMIndex;
+
+/**
+ */
+FMIndex.prototype.clear$ = function () {
+ /** @type {WaveletMatrix} */
+ var this$0;
+ this$0 = this._sv;
+ this$0._bv.length = 0;
+ this$0._seps.length = 0;
+ this$0._size = 0;
+ this._posdic.length = 0;
+ this._idic.length = 0;
+ this._ddic = 0;
+ this._head = 0;
+ this._substr = "";
+};
+
+/**
+ * @return {!number}
+ */
+FMIndex.prototype.size$ = function () {
+ /** @type {WaveletMatrix} */
+ var this$0;
+ this$0 = this._sv;
+ return this$0._size;
+};
+
+/**
+ * @return {!number}
+ */
+FMIndex.prototype.contentSize$ = function () {
+ return this._substr.length;
+};
+
+/**
+ * @param {!string} key
+ * @return {!number}
+ */
+FMIndex.prototype.getRows$S = function (key) {
+ /** @type {Array.<undefined|!number>} */
+ var pos;
+ pos = [ ];
+ return this.getRows$SAI(key, pos);
+};
+
+/**
+ * @param {!string} key
+ * @param {Array.<undefined|!number>} pos
+ * @return {!number}
+ */
+FMIndex.prototype.getRows$SAI = function (key, pos) {
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var code;
+ /** @type {!number} */
+ var first;
+ /** @type {undefined|!number} */
+ var last;
+ /** @type {!number} */
+ var c;
+ /** @type {Array.<undefined|!number>} */
+ var _rlt$0;
+ i = key.length - 1;
+ code = key.charCodeAt(i);
+ first = (_rlt$0 = this._rlt)[code] + 1;
+ last = _rlt$0[code + 1];
+ while (first <= last) {
+ if (i === 0) {
+ pos[0] = (-- first | 0);
+ pos[1] = -- last;
+ return (last - first + 1 | 0);
+ }
+ i--;
+ c = key.charCodeAt(i);
+ first = this._rlt[c] + this._sv.rank$II(first - 1, c) + 1;
+ last = this._rlt[c] + this._sv.rank$II(last, c);
+ }
+ return 0;
+};
+
+/**
+ * @param {!number} i
+ * @return {!number}
+ */
+FMIndex.prototype.getPosition$I = function (i) {
+ /** @type {!number} */
+ var pos;
+ /** @type {!number} */
+ var c;
+ if (i >= this.size$()) {
+ throw new Error("FMIndex.getPosition() : range error");
+ }
+ pos = 0;
+ while (i !== this._head) {
+ if (i % this._ddic === 0) {
+ pos += this._posdic[i / this._ddic] + 1;
+ break;
+ }
+ c = this._sv.get$I(i);
+ i = this._rlt[c] + this._sv.rank$II(i, c);
+ pos++;
+ }
+ return (pos % this.size$() | 0);
+};
+
+/**
+ * @param {!number} pos
+ * @param {!number} len
+ * @return {!string}
+ */
+FMIndex.prototype.getSubstring$II = function (pos, len) {
+ /** @type {!number} */
+ var pos_end;
+ /** @type {!number} */
+ var pos_tmp;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var pos_idic;
+ /** @type {!string} */
+ var substr;
+ /** @type {!number} */
+ var c;
+ /** @type {!number} */
+ var _ddic$0;
+ if (pos >= this.size$()) {
+ throw new Error("FMIndex.getSubstring() : range error");
+ }
+ pos_end = Math.min(pos + len, this.size$());
+ pos_tmp = this.size$() - 1;
+ i = this._head;
+ pos_idic = Math.floor((pos_end + (_ddic$0 = this._ddic) - 2) / _ddic$0);
+ if (pos_idic < this._idic.length) {
+ pos_tmp = pos_idic * this._ddic;
+ i = this._idic[pos_idic];
+ }
+ substr = "";
+ while (pos_tmp >= pos) {
+ c = this._sv.get$I(i);
+ i = this._rlt[c] + this._sv.rank$II(i, c);
+ if (pos_tmp < pos_end) {
+ substr = String.fromCharCode(c) + substr;
+ }
+ if (pos_tmp === 0) {
+ break;
+ }
+ pos_tmp--;
+ }
+ return substr;
+};
+
+/**
+ */
+FMIndex.prototype.build$ = function () {
+ this.build$SIIB(String.fromCharCode(0), 65535, 20, false);
+};
+
+/**
+ * @param {!string} end_marker
+ * @param {!number} ddic
+ * @param {!boolean} verbose
+ */
+FMIndex.prototype.build$SIB = function (end_marker, ddic, verbose) {
+ this.build$SIIB(end_marker, 65535, ddic, verbose);
+};
+
+/**
+ * @param {!string} end_marker
+ * @param {!number} maxChar
+ * @param {!number} ddic
+ * @param {!boolean} verbose
+ */
+FMIndex.prototype.build$SIIB = function (end_marker, maxChar, ddic, verbose) {
+ /** @type {BurrowsWheelerTransform} */
+ var b;
+ /** @type {!string} */
+ var s;
+ /** @type {!number} */
+ var c;
+ /** @type {!string} */
+ var str$0;
+ /** @type {WaveletMatrix} */
+ var this$0;
+ /** @type {!string} */
+ var _str$0;
+ /** @type {Array.<undefined|!number>} */
+ var _suffixarray$0;
+ if (verbose) {
+ console.time("building burrows-wheeler transform");
+ }
+ this._substr += end_marker;
+ b = ({_str: "", _size: 0, _head: 0, _suffixarray: [ ]});
+ str$0 = this._substr;
+ _str$0 = b._str = str$0;
+ b._size = _str$0.length;
+ _suffixarray$0 = b._suffixarray = SAIS$make$S(str$0);
+ b._head = (_suffixarray$0.indexOf(0) | 0);
+ s = BurrowsWheelerTransform$get$LBurrowsWheelerTransform$(b);
+ this._ssize = s.length;
+ this._head = b._head;
+ b._str = "";
+ b._size = 0;
+ b._head = 0;
+ b._suffixarray.length = 0;
+ this._substr = "";
+ if (verbose) {
+ console.timeEnd("building burrows-wheeler transform");
+ }
+ if (verbose) {
+ console.time("building wavelet matrix");
+ }
+ this$0 = this._sv;
+ this$0._bitsize = (Math.ceil(Math.log(maxChar) / 0.6931471805599453) | 0);
+ if (verbose) {
+ console.log(" maxCharCode: ", maxChar);
+ console.log(" bitSize: ", this._sv.bitsize$());
+ }
+ this._sv.build$S(s);
+ if (verbose) {
+ console.timeEnd("building wavelet matrix");
+ }
+ if (verbose) {
+ console.time("caching rank less than");
+ }
+ for (c = 0; c < maxChar; c++) {
+ this._rlt[c] = this._sv.rank_less_than$II(this._sv.size$(), c);
+ }
+ if (verbose) {
+ console.timeEnd("caching rank less than");
+ }
+ this._ddic = ddic;
+ if (verbose) {
+ console.time("building dictionaries");
+ }
+ this._buildDictionaries$();
+ if (verbose) {
+ console.timeEnd("building dictionaries");
+ console.log('');
+ }
+};
+
+/**
+ */
+FMIndex.prototype._buildDictionaries$ = function () {
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var pos;
+ /** @type {!number} */
+ var c;
+ for (i = 0; i < this._ssize / this._ddic + 1; i++) {
+ this._posdic.push(0);
+ this._idic.push(0);
+ }
+ i = this._head;
+ pos = this.size$() - 1;
+ do {
+ if (i % this._ddic === 0) {
+ this._posdic[Math.floor(i / this._ddic)] = (pos | 0);
+ }
+ if (pos % this._ddic === 0) {
+ this._idic[Math.floor(pos / this._ddic)] = (i | 0);
+ }
+ c = this._sv.get$I(i);
+ i = this._rlt[c] + this._sv.rank$II(i, c);
+ pos--;
+ } while (i !== this._head);
+};
+
+/**
+ * @param {!string} doc
+ */
+FMIndex.prototype.push$S = function (doc) {
+ if (doc.length <= 0) {
+ throw new Error("FMIndex::push(): empty string");
+ }
+ this._substr += doc;
+};
+
+/**
+ * @param {!string} keyword
+ * @return {Array.<undefined|!number>}
+ */
+FMIndex.prototype.search$S = function (keyword) {
+ /** @type {Array.<undefined|!number>} */
+ var result;
+ /** @type {Array.<undefined|!number>} */
+ var position;
+ /** @type {!number} */
+ var rows;
+ /** @type {undefined|!number} */
+ var first;
+ /** @type {undefined|!number} */
+ var last;
+ /** @type {undefined|!number} */
+ var i;
+ result = [ ];
+ position = [ ];
+ rows = this.getRows$SAI(keyword, position);
+ if (rows > 0) {
+ first = position[0];
+ last = position[1];
+ for (i = first; i <= last; i++) {
+ result.push(this.getPosition$I(i));
+ }
+ }
+ return result;
+};
+
+/**
+ * @return {!string}
+ */
+FMIndex.prototype.dump$ = function () {
+ return this.dump$B(false);
+};
+
+/**
+ * @param {!boolean} verbose
+ * @return {!string}
+ */
+FMIndex.prototype.dump$B = function (verbose) {
+ /** @type {Array.<undefined|!string>} */
+ var contents;
+ /** @type {CompressionReport} */
+ var report;
+ /** @type {!number} */
+ var i;
+ contents = [ ];
+ report = ({source: 0, result: 0});
+ contents.push(Binary$dump32bitNumber$N(this._ddic));
+ contents.push(Binary$dump32bitNumber$N(this._ssize));
+ contents.push(Binary$dump32bitNumber$N(this._head));
+ CompressionReport$add$LCompressionReport$II(report, 6, 6);
+ contents.push(this._sv.dump$LCompressionReport$(report));
+ if (verbose) {
+ console.log("Serializing FM-index");
+ console.log(' Wavelet Matrix: ' + (contents[3].length * 2 + "") + ' bytes (' + (Math.round(report.result * 100.0 / report.source) + "") + '%)');
+ }
+ contents.push(Binary$dump32bitNumber$N(this._posdic.length));
+ for (i in this._posdic) {
+ contents.push(Binary$dump32bitNumber$N(this._posdic[i]));
+ }
+ for (i in this._idic) {
+ contents.push(Binary$dump32bitNumber$N(this._idic[i]));
+ }
+ if (verbose) {
+ console.log(' Dictionary Cache: ' + (this._idic.length * 16 + "") + ' bytes');
+ }
+ return contents.join("");
+};
+
+/**
+ * @param {!string} data
+ * @return {!number}
+ */
+FMIndex.prototype.load$S = function (data) {
+ return this.load$SI(data, 0);
+};
+
+/**
+ * @param {!string} data
+ * @param {!number} offset
+ * @return {!number}
+ */
+FMIndex.prototype.load$SI = function (data, offset) {
+ /** @type {!number} */
+ var maxChar;
+ /** @type {!number} */
+ var c;
+ /** @type {!number} */
+ var size;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var result$0;
+ /** @type {!number} */
+ var result$1;
+ result$0 = data.charCodeAt(offset) * 65536 + data.charCodeAt(offset + 1);
+ this._ddic = (result$0 | 0);
+ this._ssize = (Binary$load32bitNumber$SI(data, offset + 2) | 0);
+ this._head = (Binary$load32bitNumber$SI(data, offset + 4) | 0);
+ offset = this._sv.load$SI(data, offset + 6);
+ maxChar = Math.pow(2, this._sv.bitsize$());
+ for (c = 0; c < maxChar; c++) {
+ this._rlt[c] = this._sv.rank_less_than$II(this._sv.size$(), c);
+ }
+ result$1 = data.charCodeAt(offset) * 65536 + data.charCodeAt(offset + 1);
+ size = result$1;
+ offset += 2;
+ for (i = 0; i < size; (i++, offset += 2)) {
+ this._posdic.push(Binary$load32bitNumber$SI(data, offset));
+ }
+ for (i = 0; i < size; (i++, offset += 2)) {
+ this._idic.push(Binary$load32bitNumber$SI(data, offset));
+ }
+ return offset;
+};
+
+/**
+ * class Query extends Object
+ * @constructor
+ */
+function Query() {
+}
+
+/**
+ * @constructor
+ */
+function Query$() {
+ this.word = '';
+ this.or = false;
+ this.not = false;
+ this.raw = false;
+};
+
+Query$.prototype = new Query;
+
+/**
+ * @return {!string}
+ */
+Query.prototype.toString = function () {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ result = [ ];
+ if (this.or) {
+ result.push("OR ");
+ }
+ if (this.not) {
+ result.push("-");
+ }
+ if (this.raw) {
+ result.push('"', this.word, '"');
+ } else {
+ result.push(this.word);
+ }
+ return result.join('');
+};
+
+/**
+ * class Proposal extends Object
+ * @constructor
+ */
+function Proposal() {
+}
+
+/**
+ * @constructor
+ * @param {!number} omit
+ * @param {!number} expect
+ */
+function Proposal$II(omit, expect) {
+ this.omit = omit;
+ this.expect = expect;
+};
+
+Proposal$II.prototype = new Proposal;
+
+/**
+ * class Position extends Object
+ * @constructor
+ */
+function Position() {
+}
+
+/**
+ * @constructor
+ * @param {!string} word
+ * @param {!number} position
+ * @param {!boolean} stemmed
+ */
+function Position$SIB(word, position, stemmed) {
+ this.word = word;
+ this.position = position;
+ this.stemmed = stemmed;
+};
+
+Position$SIB.prototype = new Position;
+
+/**
+ * class SearchUnit extends Object
+ * @constructor
+ */
+function SearchUnit() {
+}
+
+/**
+ * @constructor
+ * @param {!number} id
+ */
+function SearchUnit$I(id) {
+ this.positions = ({ });
+ this.id = id;
+ this._size = 0;
+ this.score = 0;
+ this.startPosition = -1;
+};
+
+SearchUnit$I.prototype = new SearchUnit;
+
+/**
+ * @param {SearchUnit} $this
+ * @param {!string} word
+ * @param {!number} position
+ * @param {!boolean} stemmed
+ */
+SearchUnit.addPosition$LSearchUnit$SIB = function ($this, word, position, stemmed) {
+ /** @type {Position} */
+ var positionObj;
+ positionObj = $this.positions[position + ""];
+ if (! positionObj) {
+ $this._size++;
+ $this.positions[position + ""] = ({word: word, position: position, stemmed: stemmed});
+ } else {
+ if (positionObj.word.length < word.length) {
+ positionObj.word = word;
+ }
+ positionObj.stemmed = positionObj.stemmed && stemmed;
+ }
+};
+
+var SearchUnit$addPosition$LSearchUnit$SIB = SearchUnit.addPosition$LSearchUnit$SIB;
+
+/**
+ * @param {SearchUnit} $this
+ * @param {!number} position
+ * @return {Position}
+ */
+SearchUnit.get$LSearchUnit$I = function ($this, position) {
+ return $this.positions[position + ""];
+};
+
+var SearchUnit$get$LSearchUnit$I = SearchUnit.get$LSearchUnit$I;
+
+/**
+ * @param {SearchUnit} $this
+ * @return {!number}
+ */
+SearchUnit.size$LSearchUnit$ = function ($this) {
+ return $this._size;
+};
+
+var SearchUnit$size$LSearchUnit$ = SearchUnit.size$LSearchUnit$;
+
+/**
+ * @param {SearchUnit} $this
+ * @param {SearchUnit} rhs
+ */
+SearchUnit.merge$LSearchUnit$LSearchUnit$ = function ($this, rhs) {
+ /** @type {!string} */
+ var position;
+ /** @type {Position} */
+ var pos;
+ for (position in rhs.positions) {
+ pos = rhs.positions[position];
+ SearchUnit$addPosition$LSearchUnit$SIB($this, pos.word, pos.position, pos.stemmed);
+ }
+};
+
+var SearchUnit$merge$LSearchUnit$LSearchUnit$ = SearchUnit.merge$LSearchUnit$LSearchUnit$;
+
+/**
+ * @param {SearchUnit} $this
+ * @return {Array.<undefined|Position>}
+ */
+SearchUnit.getPositions$LSearchUnit$ = function ($this) {
+ /** @type {Array.<undefined|Position>} */
+ var result;
+ /** @type {!string} */
+ var pos;
+ result = [ ];
+ for (pos in $this.positions) {
+ result.push($this.positions[pos]);
+ }
+ result.sort((function (a, b) {
+ return a.position - b.position;
+ }));
+ return result;
+};
+
+var SearchUnit$getPositions$LSearchUnit$ = SearchUnit.getPositions$LSearchUnit$;
+
+/**
+ * class SingleResult extends Object
+ * @constructor
+ */
+function SingleResult() {
+}
+
+/**
+ * @constructor
+ */
+function SingleResult$() {
+ this.units = [ ];
+ this.unitIds = [ ];
+ this.or = false;
+ this.not = false;
+ this.searchWord = '';
+};
+
+SingleResult$.prototype = new SingleResult;
+
+/**
+ * @constructor
+ * @param {!string} searchWord
+ * @param {!boolean} or
+ * @param {!boolean} not
+ */
+function SingleResult$SBB(searchWord, or, not) {
+ this.units = [ ];
+ this.unitIds = [ ];
+ this.or = or;
+ this.not = not;
+ this.searchWord = searchWord;
+};
+
+SingleResult$SBB.prototype = new SingleResult;
+
+/**
+ * @param {SingleResult} $this
+ * @param {!number} unitId
+ * @return {SearchUnit}
+ */
+SingleResult.getSearchUnit$LSingleResult$I = function ($this, unitId) {
+ /** @type {!number} */
+ var existing;
+ /** @type {SearchUnit} */
+ var result;
+ existing = $this.unitIds.indexOf(unitId);
+ if (existing === -1) {
+ result = ({positions: ({ }), id: unitId, _size: 0, score: 0, startPosition: -1});
+ $this.units.push(result);
+ $this.unitIds.push(unitId);
+ } else {
+ result = $this.units[existing];
+ }
+ return result;
+};
+
+var SingleResult$getSearchUnit$LSingleResult$I = SingleResult.getSearchUnit$LSingleResult$I;
+
+/**
+ * @param {SingleResult} $this
+ * @param {SingleResult} rhs
+ * @return {SingleResult}
+ */
+SingleResult.merge$LSingleResult$LSingleResult$ = function ($this, rhs) {
+ /** @type {SingleResult} */
+ var result;
+ result = ({units: [ ], unitIds: [ ], or: false, not: false, searchWord: ''});
+ if (rhs.or) {
+ SingleResult$_orMerge$LSingleResult$LSingleResult$LSingleResult$($this, result, rhs);
+ } else {
+ if (rhs.not) {
+ SingleResult$_notMerge$LSingleResult$LSingleResult$LSingleResult$($this, result, rhs);
+ } else {
+ SingleResult$_andMerge$LSingleResult$LSingleResult$LSingleResult$($this, result, rhs);
+ }
+ }
+ return result;
+};
+
+var SingleResult$merge$LSingleResult$LSingleResult$ = SingleResult.merge$LSingleResult$LSingleResult$;
+
+/**
+ * @param {SingleResult} $this
+ * @return {!number}
+ */
+SingleResult.size$LSingleResult$ = function ($this) {
+ return ($this.units.length | 0);
+};
+
+var SingleResult$size$LSingleResult$ = SingleResult.size$LSingleResult$;
+
+/**
+ * @param {SingleResult} $this
+ * @param {SingleResult} result
+ * @param {SingleResult} rhs
+ */
+SingleResult._andMerge$LSingleResult$LSingleResult$LSingleResult$ = function ($this, result, rhs) {
+ /** @type {!number} */
+ var i;
+ /** @type {undefined|!number} */
+ var id;
+ /** @type {SearchUnit} */
+ var lhsSection;
+ for (i = 0; i < $this.unitIds.length; i++) {
+ id = $this.unitIds[i];
+ if (rhs.unitIds.indexOf(id) !== -1) {
+ lhsSection = $this.units[i];
+ result.unitIds.push(id);
+ result.units.push(lhsSection);
+ }
+ }
+};
+
+var SingleResult$_andMerge$LSingleResult$LSingleResult$LSingleResult$ = SingleResult._andMerge$LSingleResult$LSingleResult$LSingleResult$;
+
+/**
+ * @param {SingleResult} $this
+ * @param {SingleResult} result
+ * @param {SingleResult} rhs
+ */
+SingleResult._orMerge$LSingleResult$LSingleResult$LSingleResult$ = function ($this, result, rhs) {
+ /** @type {!number} */
+ var i;
+ /** @type {undefined|!number} */
+ var id;
+ /** @type {SearchUnit} */
+ var rhsSection;
+ /** @type {SearchUnit} */
+ var lhsSection;
+ /** @type {Array.<undefined|!number>} */
+ var unitIds$0;
+ /** @type {Array.<undefined|SearchUnit>} */
+ var units$0;
+ result.unitIds = (unitIds$0 = $this.unitIds).slice(0, unitIds$0.length);
+ result.units = (units$0 = $this.units).slice(0, units$0.length);
+ for (i = 0; i < rhs.unitIds.length; i++) {
+ id = rhs.unitIds[i];
+ rhsSection = rhs.units[i];
+ if (result.unitIds.indexOf(id) !== -1) {
+ lhsSection = result.units[result.unitIds.indexOf(id)];
+ SearchUnit$merge$LSearchUnit$LSearchUnit$(lhsSection, rhsSection);
+ } else {
+ result.unitIds.push(id);
+ result.units.push(rhsSection);
+ }
+ }
+};
+
+var SingleResult$_orMerge$LSingleResult$LSingleResult$LSingleResult$ = SingleResult._orMerge$LSingleResult$LSingleResult$LSingleResult$;
+
+/**
+ * @param {SingleResult} $this
+ * @param {SingleResult} result
+ * @param {SingleResult} rhs
+ */
+SingleResult._notMerge$LSingleResult$LSingleResult$LSingleResult$ = function ($this, result, rhs) {
+ /** @type {!number} */
+ var i;
+ /** @type {undefined|!number} */
+ var id;
+ /** @type {SearchUnit} */
+ var lhsSection;
+ for (i = 0; i < $this.unitIds.length; i++) {
+ id = $this.unitIds[i];
+ if (rhs.unitIds.indexOf(id) === -1) {
+ lhsSection = $this.units[i];
+ result.unitIds.push(id);
+ result.units.push(lhsSection);
+ }
+ }
+};
+
+var SingleResult$_notMerge$LSingleResult$LSingleResult$LSingleResult$ = SingleResult._notMerge$LSingleResult$LSingleResult$LSingleResult$;
+
+/**
+ * class SearchSummary extends Object
+ * @constructor
+ */
+function SearchSummary() {
+}
+
+/**
+ * @constructor
+ */
+function SearchSummary$() {
+ this.sourceResults = [ ];
+ this.result = null;
+ this.oktavia = null;
+};
+
+SearchSummary$.prototype = new SearchSummary;
+
+/**
+ * @constructor
+ * @param {Oktavia} oktavia
+ */
+function SearchSummary$LOktavia$(oktavia) {
+ this.sourceResults = [ ];
+ this.result = null;
+ this.oktavia = oktavia;
+};
+
+SearchSummary$LOktavia$.prototype = new SearchSummary;
+
+/**
+ * @param {SearchSummary} $this
+ * @param {SingleResult} result
+ */
+SearchSummary.addQuery$LSearchSummary$LSingleResult$ = function ($this, result) {
+ $this.sourceResults.push(result);
+};
+
+var SearchSummary$addQuery$LSearchSummary$LSingleResult$ = SearchSummary.addQuery$LSearchSummary$LSingleResult$;
+
+/**
+ * @param {SearchSummary} $this
+ */
+SearchSummary.mergeResult$LSearchSummary$ = function ($this) {
+ $this.result = SearchSummary$mergeResult$LSearchSummary$ALSingleResult$($this, $this.sourceResults);
+};
+
+var SearchSummary$mergeResult$LSearchSummary$ = SearchSummary.mergeResult$LSearchSummary$;
+
+/**
+ * @param {SearchSummary} $this
+ * @param {Array.<undefined|SingleResult>} results
+ * @return {SingleResult}
+ */
+SearchSummary.mergeResult$LSearchSummary$ALSingleResult$ = function ($this, results) {
+ /** @type {SingleResult} */
+ var rhs;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var results$len$0;
+ rhs = results[0];
+ for ((i = 1, results$len$0 = results.length); i < results$len$0; i++) {
+ rhs = SingleResult$merge$LSingleResult$LSingleResult$(rhs, results[i]);
+ }
+ return rhs;
+};
+
+var SearchSummary$mergeResult$LSearchSummary$ALSingleResult$ = SearchSummary.mergeResult$LSearchSummary$ALSingleResult$;
+
+/**
+ * @param {SearchSummary} $this
+ * @return {Array.<undefined|Proposal>}
+ */
+SearchSummary.getProposal$LSearchSummary$ = function ($this) {
+ /** @type {Array.<undefined|Proposal>} */
+ var proposals;
+ /** @type {!number} */
+ var i;
+ /** @type {Array.<undefined|SingleResult>} */
+ var tmpSource;
+ /** @type {!number} */
+ var j;
+ /** @type {SingleResult} */
+ var result;
+ proposals = [ ];
+ for (i = 0; i < $this.sourceResults.length; i++) {
+ tmpSource = [ ];
+ for (j = 0; j < $this.sourceResults.length; j++) {
+ if (i !== j) {
+ tmpSource.push($this.sourceResults[j]);
+ }
+ }
+ result = SearchSummary$mergeResult$LSearchSummary$ALSingleResult$($this, tmpSource);
+ proposals.push(({omit: i, expect: result.units.length}));
+ }
+ proposals.sort((function (a, b) {
+ return b.expect - a.expect;
+ }));
+ return proposals;
+};
+
+var SearchSummary$getProposal$LSearchSummary$ = SearchSummary.getProposal$LSearchSummary$;
+
+/**
+ * @param {SearchSummary} $this
+ * @return {Array.<undefined|SearchUnit>}
+ */
+SearchSummary.getSortedResult$LSearchSummary$ = function ($this) {
+ /** @type {Array.<undefined|SearchUnit>} */
+ var result;
+ /** @type {Array.<undefined|SearchUnit>} */
+ var units$0;
+ result = (units$0 = $this.result.units).slice(0, units$0.length);
+ result.sort((function (a, b) {
+ return b.score - a.score;
+ }));
+ return result;
+};
+
+var SearchSummary$getSortedResult$LSearchSummary$ = SearchSummary.getSortedResult$LSearchSummary$;
+
+/**
+ * @param {SearchSummary} $this
+ * @return {!number}
+ */
+SearchSummary.size$LSearchSummary$ = function ($this) {
+ /** @type {SingleResult} */
+ var this$0;
+ this$0 = $this.result;
+ return (this$0.units.length | 0);
+};
+
+var SearchSummary$size$LSearchSummary$ = SearchSummary.size$LSearchSummary$;
+
+/**
+ * @param {SearchSummary} $this
+ * @param {SingleResult} result
+ */
+SearchSummary.add$LSearchSummary$LSingleResult$ = function ($this, result) {
+ $this.sourceResults.push(result);
+};
+
+var SearchSummary$add$LSearchSummary$LSingleResult$ = SearchSummary.add$LSearchSummary$LSingleResult$;
+
+/**
+ * class Tag extends Object
+ * @constructor
+ */
+function Tag() {
+}
+
+/**
+ * @constructor
+ * @param {!string} name
+ */
+function Tag$S(name) {
+ this.name = name;
+ this.attributes = ({ });
+ this.isSelfClosing = false;
+};
+
+Tag$S.prototype = new Tag;
+
+/**
+ * class _Common extends Object
+ * @constructor
+ */
+function _Common() {
+}
+
+/**
+ * @constructor
+ */
+function _Common$() {
+};
+
+_Common$.prototype = new _Common;
+
+/**
+ * class _State extends Object
+ * @constructor
+ */
+function _State() {
+}
+
+/**
+ * @constructor
+ */
+function _State$() {
+};
+
+_State$.prototype = new _State;
+
+/**
+ * class SAXHandler extends Object
+ * @constructor
+ */
+function SAXHandler() {
+}
+
+/**
+ * @constructor
+ */
+function SAXHandler$() {
+ this.position = 0;
+ this.column = 0;
+ this.line = 0;
+};
+
+SAXHandler$.prototype = new SAXHandler;
+
+/**
+ * @param {Error} error
+ */
+SAXHandler.prototype.onerror$LError$ = function (error) {
+};
+
+/**
+ * @param {!string} text
+ */
+SAXHandler.prototype.ontext$S = function (text) {
+};
+
+/**
+ * @param {!string} doctype
+ */
+SAXHandler.prototype.ondoctype$S = function (doctype) {
+};
+
+/**
+ * @param {!string} name
+ * @param {!string} body
+ */
+SAXHandler.prototype.onprocessinginstruction$SS = function (name, body) {
+};
+
+/**
+ * @param {!string} sgmlDecl
+ */
+SAXHandler.prototype.onsgmldeclaration$S = function (sgmlDecl) {
+};
+
+/**
+ * @param {!string} tagname
+ * @param {Object.<string, undefined|!string>} attributes
+ */
+SAXHandler.prototype.onopentag$SHS = function (tagname, attributes) {
+};
+
+/**
+ * @param {!string} tagname
+ */
+SAXHandler.prototype.onclosetag$S = function (tagname) {
+};
+
+/**
+ * @param {!string} name
+ * @param {!string} value
+ */
+SAXHandler.prototype.onattribute$SS = function (name, value) {
+};
+
+/**
+ * @param {!string} comment
+ */
+SAXHandler.prototype.oncomment$S = function (comment) {
+};
+
+/**
+ */
+SAXHandler.prototype.onopencdata$ = function () {
+};
+
+/**
+ * @param {!string} cdata
+ */
+SAXHandler.prototype.oncdata$S = function (cdata) {
+};
+
+/**
+ */
+SAXHandler.prototype.onclosecdata$ = function () {
+};
+
+/**
+ */
+SAXHandler.prototype.onend$ = function () {
+};
+
+/**
+ */
+SAXHandler.prototype.onready$ = function () {
+};
+
+/**
+ * @param {!string} script
+ */
+SAXHandler.prototype.onscript$S = function (script) {
+};
+
+/**
+ * class _HTMLHandler extends SAXHandler
+ * @constructor
+ */
+function _HTMLHandler() {
+}
+
+_HTMLHandler.prototype = new SAXHandler;
+/**
+ * @constructor
+ * @param {Oktavia} oktavia
+ * @param {!string} filepath
+ * @param {!number} unit
+ * @param {TagFilter} filter
+ */
+function _HTMLHandler$LOktavia$SILTagFilter$(oktavia, filepath, unit, filter) {
+ /** @type {Oktavia} */
+ var oktavia$0;
+ this.position = 0;
+ this.column = 0;
+ this.line = 0;
+ this.startTag = "";
+ this.currentLink = "";
+ this.sectionCount = 0;
+ this.inCode = false;
+ this.startParse = false;
+ this.stack = [ ];
+ oktavia$0 = this.oktavia = oktavia;
+ this.section = oktavia$0.getSection$S('section');
+ this.tag = this.oktavia.getBlock$S('tag');
+ this.unit = unit;
+ this.filter = filter;
+ this.filepath = filepath;
+ this.currentTitle = '';
+ this.lastId = '';
+ this.waitTitle = false;
+ this.addText = false;
+};
+
+_HTMLHandler$LOktavia$SILTagFilter$.prototype = new _HTMLHandler;
+
+/**
+ */
+_HTMLHandler.prototype.onready$ = function () {
+ this.currentLink = this.filepath;
+ this.inCode = false;
+};
+
+/**
+ * @param {!string} tagname
+ * @param {Object.<string, undefined|!string>} attributes
+ */
+_HTMLHandler.prototype.onopentag$SHS = function (tagname, attributes) {
+ /** @type {Array.<undefined|!string>} */
+ var headingId;
+ /** @type {Section} */
+ var this$0;
+ /** @type {!string} */
+ var name$0;
+ /** @type {!number} */
+ var index$0$0;
+ /** @type {Oktavia} */
+ var this$0$0;
+ /** @type {FMIndex} */
+ var this$0$0$0;
+ /** @type {Oktavia} */
+ var this$1;
+ /** @type {Block} */
+ var this$2;
+ /** @type {Block} */
+ var this$3;
+ /** @type {Oktavia} */
+ var this$4;
+ /** @type {Oktavia} */
+ var this$5;
+ headingId = [ 'h1', 'h2', 'h3', 'h4', 'h5', 'h6' ];
+ if (this.startParse) {
+ this.stack.push(tagname);
+ if ('id' in attributes) {
+ this.lastId = attributes.id;
+ }
+ switch (tagname) {
+ case 'h1':
+ case 'h2':
+ case 'h3':
+ case 'h4':
+ case 'h5':
+ case 'h6':
+ if (headingId.indexOf(tagname) < this.unit) {
+ if (this.oktavia.contentSize$() > 0) {
+ this$0 = this.section;
+ name$0 = this.currentTitle + Oktavia.eob + this.currentLink;
+ this$0$0 = this$0._parent;
+ this$0$0$0 = this$0$0._fmindex;
+ index$0$0 = this$0$0$0._substr.length;
+ this$0._names.push(name$0);
+ this$0._bitVector.set$I(index$0$0 - 1);
+ }
+ this.currentLink = this.filepath + '#' + this.lastId;
+ this.currentTitle = '';
+ this.waitTitle = true;
+ }
+ this$1 = this.oktavia;
+ this$1._fmindex.push$S(Oktavia.eob);
+ this$2 = this.tag;
+ this$2.startBlock$SI(tagname, this$2._parent.contentSize$());
+ break;
+ case 'pre':
+ this$3 = this.tag;
+ this$3.startBlock$SI('pre', this$3._parent.contentSize$());
+ this$4 = this.oktavia;
+ this$4._fmindex.push$S(Oktavia.eob);
+ this.inCode = true;
+ break;
+ case 'p':
+ case 'div':
+ case 'blockquote':
+ this$5 = this.oktavia;
+ this$5._fmindex.push$S(Oktavia.eob);
+ break;
+ }
+ } else {
+ if (this.filter.match$SHS(tagname, attributes)) {
+ this.startParse = true;
+ this.startTag = tagname;
+ this.stack.push(tagname);
+ }
+ }
+ if (tagname === 'title') {
+ this.waitTitle = true;
+ this.currentTitle = '';
+ }
+};
+
+/**
+ * @param {!string} tagname
+ */
+_HTMLHandler.prototype.onclosetag$S = function (tagname) {
+ /** @type {Block} */
+ var this$0;
+ /** @type {Block} */
+ var this$1;
+ if (this.startParse) {
+ switch (tagname) {
+ case 'h1':
+ case 'h2':
+ case 'h3':
+ case 'h4':
+ case 'h5':
+ case 'h6':
+ this$0 = this.tag;
+ this$0.endBlock$I(this$0._parent.contentSize$());
+ if (this.addText) {
+ this.oktavia.addWord$S('\n');
+ this.addText = false;
+ }
+ this.waitTitle = false;
+ break;
+ case 'pre':
+ this.inCode = false;
+ this$1 = this.tag;
+ this$1.endBlock$I(this$1._parent.contentSize$());
+ if (this.addText) {
+ this.oktavia.addWord$S('\n');
+ this.addText = false;
+ }
+ break;
+ case 'div':
+ case 'p':
+ case 'blockquote':
+ if (this.addText) {
+ this.oktavia.addWord$S('\n');
+ this.addText = false;
+ }
+ break;
+ }
+ if (this.stack.length === 0) {
+ this.startParse = false;
+ }
+ }
+ if (tagname === 'title') {
+ this.waitTitle = false;
+ }
+};
+
+/**
+ * @param {!string} text
+ */
+_HTMLHandler.prototype.ontext$S = function (text) {
+ if (this.startParse) {
+ this.oktavia.addWord$SB(text, ! this.inCode);
+ this.addText = true;
+ }
+ if (this.waitTitle) {
+ this.currentTitle += text;
+ }
+};
+
+/**
+ */
+_HTMLHandler.prototype.onend$ = function () {
+ /** @type {Section} */
+ var this$0;
+ /** @type {!string} */
+ var name$0;
+ /** @type {!number} */
+ var index$0$0;
+ /** @type {Oktavia} */
+ var this$0$0;
+ /** @type {FMIndex} */
+ var this$0$0$0;
+ this$0 = this.section;
+ name$0 = this.currentTitle + Oktavia.eob + this.currentLink;
+ this$0$0 = this$0._parent;
+ this$0$0$0 = this$0$0._fmindex;
+ index$0$0 = this$0$0$0._substr.length;
+ this$0._names.push(name$0);
+ this$0._bitVector.set$I(index$0$0 - 1);
+};
+
+/**
+ * class SAXParser extends Object
+ * @constructor
+ */
+function SAXParser() {
+}
+
+/**
+ * @constructor
+ * @param {SAXHandler} handler
+ */
+function SAXParser$LSAXHandler$(handler) {
+ this.q = "";
+ this.c = "";
+ this.bufferCheckPosition = 0;
+ this.looseCase = "";
+ this.tags = [ ];
+ this.closed = false;
+ this.closedRoot = false;
+ this.sawRoot = false;
+ this.tag = null;
+ this.error = null;
+ this.handler = null;
+ this.ENTITIES = null;
+ this.strict = false;
+ this.tagName = "";
+ this.state = 0;
+ this.line = 0;
+ this.column = 0;
+ this.position = 0;
+ this.startTagPosition = 0;
+ this.attribName = "";
+ this.attribValue = "";
+ this.script = "";
+ this.textNode = "";
+ this.attribList = null;
+ this.noscript = false;
+ this.cdata = "";
+ this.procInstBody = "";
+ this.procInstName = "";
+ this.doctype = "";
+ this.entity = "";
+ this.sgmlDecl = "";
+ this.comment = "";
+ this.preTags = 0;
+ this._init$LSAXHandler$B(handler, false);
+};
+
+SAXParser$LSAXHandler$.prototype = new SAXParser;
+
+/**
+ * @constructor
+ * @param {SAXHandler} handler
+ * @param {!boolean} strict
+ */
+function SAXParser$LSAXHandler$B(handler, strict) {
+ this.q = "";
+ this.c = "";
+ this.bufferCheckPosition = 0;
+ this.looseCase = "";
+ this.tags = [ ];
+ this.closed = false;
+ this.closedRoot = false;
+ this.sawRoot = false;
+ this.tag = null;
+ this.error = null;
+ this.handler = null;
+ this.ENTITIES = null;
+ this.strict = false;
+ this.tagName = "";
+ this.state = 0;
+ this.line = 0;
+ this.column = 0;
+ this.position = 0;
+ this.startTagPosition = 0;
+ this.attribName = "";
+ this.attribValue = "";
+ this.script = "";
+ this.textNode = "";
+ this.attribList = null;
+ this.noscript = false;
+ this.cdata = "";
+ this.procInstBody = "";
+ this.procInstName = "";
+ this.doctype = "";
+ this.entity = "";
+ this.sgmlDecl = "";
+ this.comment = "";
+ this.preTags = 0;
+ this._init$LSAXHandler$B(handler, strict);
+};
+
+SAXParser$LSAXHandler$B.prototype = new SAXParser;
+
+/**
+ * @param {SAXHandler} handler
+ * @param {!boolean} strict
+ */
+SAXParser.prototype._init$LSAXHandler$B = function (handler, strict) {
+ this.handler = handler;
+ this.clearBuffers$();
+ this.q = "";
+ this.bufferCheckPosition = 65536;
+ this.looseCase = 'toLowerCase';
+ this.tags = [ ];
+ this.closed = this.closedRoot = this.sawRoot = false;
+ this.tag = null;
+ this.error = null;
+ this.strict = strict;
+ this.noscript = strict;
+ this.state = 1;
+ this.ENTITIES = _Entities$entity_list$();
+ this.attribList = [ ];
+ this.noscript = false;
+ this.preTags = 0;
+ this.handler.onready$();
+};
+
+/**
+ * @param {!boolean} flag
+ */
+SAXParser.prototype.set_noscript$B = function (flag) {
+ this.noscript = flag;
+};
+
+/**
+ * @return {SAXParser}
+ */
+SAXParser.prototype.resume$ = function () {
+ this.error = null;
+ return this;
+};
+
+/**
+ * @return {SAXParser}
+ */
+SAXParser.prototype.close$ = function () {
+ return this.parse$S('');
+};
+
+/**
+ * @param {!string} chunk
+ * @return {SAXParser}
+ */
+SAXParser.prototype.parse$S = function (chunk) {
+ /** @type {Char} */
+ var _;
+ /** @type {!number} */
+ var i;
+ /** @type {!string} */
+ var c;
+ /** @type {!number} */
+ var starti;
+ /** @type {!number} */
+ var pad;
+ /** @type {!number} */
+ var returnState;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$0;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$1;
+ /** @type {RegExp} */
+ var charclass$2;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$3;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$4;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$5;
+ /** @type {!string} */
+ var text$0;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$6;
+ /** @type {RegExp} */
+ var charclass$7;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$8;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$9;
+ /** @type {RegExp} */
+ var charclass$10;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$11;
+ /** @type {RegExp} */
+ var charclass$12;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$13;
+ /** @type {RegExp} */
+ var charclass$14;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$15;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$16;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$17;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$18;
+ /** @type {RegExp} */
+ var charclass$19;
+ /** @type {RegExp} */
+ var charclass$20;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$21;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$22;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$23;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$24;
+ /** @type {!string} */
+ var comment$0;
+ _ = new Char$();
+ if (this.error) {
+ throw this.error;
+ }
+ if (this.closed) {
+ return this.emiterror$S("Cannot write after close. Assign an onready handler.");
+ }
+ (i = 0, c = "");
+ while (this.c = c = chunk.charAt(i++)) {
+ this.position++;
+ if (c === "\n") {
+ this.handler.line++;
+ this.handler.column = 0;
+ } else {
+ this.handler.column++;
+ }
+ switch (this.state) {
+ case 1:
+ if (c === "<") {
+ this.state = 4;
+ this.startTagPosition = this.position;
+ } else {
+ charclass$0 = _.whitespace;
+ if (! $__jsx_ObjectHasOwnProperty.call(charclass$0, c)) {
+ this.strictFail$S("Non-whitespace before first tag.");
+ this.textNode = c;
+ this.state = 2;
+ }
+ }
+ continue;
+ case 2:
+ if (this.sawRoot && ! this.closedRoot) {
+ starti = i - 1;
+ while (c && c !== "<" && c !== "&") {
+ c = chunk.charAt(i++);
+ if (c) {
+ this.position++;
+ if (c === "\n") {
+ this.handler.line++;
+ this.handler.column = 0;
+ } else {
+ this.handler.column++;
+ }
+ }
+ }
+ this.textNode += chunk.substring(starti, i - 1);
+ }
+ if (c === "<") {
+ this.state = 4;
+ this.startTagPosition = this.position;
+ } else {
+ if (_.not$HBS(_.whitespace, c) && (! this.sawRoot || this.closedRoot)) {
+ this.strictFail$S("Text data outside of root node.");
+ }
+ if (c === "&") {
+ this.state = 3;
+ } else {
+ this.textNode += c;
+ }
+ }
+ continue;
+ case 33:
+ if (c === "<") {
+ this.state = 34;
+ } else {
+ this.script += c;
+ }
+ continue;
+ case 34:
+ if (c === "/") {
+ this.state = 31;
+ } else {
+ this.script += "<" + c;
+ this.state = 33;
+ }
+ continue;
+ case 4:
+ if (c === "!") {
+ this.state = 5;
+ this.sgmlDecl = "";
+ } else {
+ charclass$1 = _.whitespace;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$1, c)) {
+ } else {
+ charclass$2 = _.nameStart;
+ if (charclass$2.test(c)) {
+ this.state = 21;
+ this.tagName = c;
+ } else {
+ if (c === "/") {
+ this.state = 31;
+ this.tagName = "";
+ } else {
+ if (c === "?") {
+ this.state = 18;
+ this.procInstName = this.procInstBody = "";
+ } else {
+ this.strictFail$S("Unencoded <");
+ if (this.startTagPosition + 1 < this.position) {
+ pad = this.position - this.startTagPosition;
+ for (i = 0; i < pad; i++) {
+ c = " " + c;
+ }
+ }
+ this.textNode += "<" + c;
+ this.state = 2;
+ }
+ }
+ }
+ }
+ }
+ continue;
+ case 5:
+ if ((this.sgmlDecl + c).toUpperCase() === _.CDATA) {
+ this.closetext_if_exist$();
+ this.state = 15;
+ this.sgmlDecl = "";
+ this.cdata = "";
+ } else {
+ if (this.sgmlDecl + c === "--") {
+ this.state = 12;
+ this.comment = "";
+ this.sgmlDecl = "";
+ } else {
+ if ((this.sgmlDecl + c).toUpperCase() === _.DOCTYPE) {
+ this.state = 7;
+ if (this.doctype || this.sawRoot) {
+ this.strictFail$S("Inappropriately located doctype declaration");
+ }
+ this.doctype = "";
+ this.sgmlDecl = "";
+ } else {
+ if (c === ">") {
+ this.closetext_if_exist$();
+ this.sgmlDecl = "";
+ this.state = 2;
+ } else {
+ charclass$3 = _.quote;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$3, c)) {
+ this.state = 6;
+ this.sgmlDecl += c;
+ } else {
+ this.sgmlDecl += c;
+ }
+ }
+ }
+ }
+ }
+ continue;
+ case 6:
+ if (c === this.q) {
+ this.state = 5;
+ this.q = "";
+ }
+ this.sgmlDecl += c;
+ continue;
+ case 7:
+ if (c === ">") {
+ this.state = 2;
+ this.closetext_if_exist$();
+ this.doctype.trim();
+ } else {
+ this.doctype += c;
+ if (c === "[") {
+ this.state = 9;
+ } else {
+ charclass$4 = _.quote;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$4, c)) {
+ this.state = 8;
+ this.q = c;
+ }
+ }
+ }
+ continue;
+ case 8:
+ this.doctype += c;
+ if (c === this.q) {
+ this.q = "";
+ this.state = 7;
+ }
+ continue;
+ case 9:
+ this.doctype += c;
+ if (c === "]") {
+ this.state = 7;
+ } else {
+ charclass$5 = _.quote;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$5, c)) {
+ this.state = 10;
+ this.q = c;
+ }
+ }
+ continue;
+ case 10:
+ this.doctype += c;
+ if (c === this.q) {
+ this.state = 9;
+ this.q = "";
+ }
+ continue;
+ case 12:
+ if (c === "-") {
+ this.state = 13;
+ } else {
+ this.comment += c;
+ }
+ continue;
+ case 13:
+ if (c === "-") {
+ this.state = 14;
+ text$0 = this.comment;
+ text$0 = text$0.replace(/[\n\t]/g, ' ');
+ text$0 = text$0.replace(/\s\s+/g, " ");
+ comment$0 = this.comment = text$0;
+ if (comment$0) {
+ this.closetext_if_exist$();
+ this.comment.trim();
+ }
+ this.comment = "";
+ } else {
+ this.comment += "-" + c;
+ this.state = 12;
+ }
+ continue;
+ case 14:
+ if (c !== ">") {
+ this.strictFail$S("Malformed comment");
+ this.comment += "--" + c;
+ this.state = 12;
+ } else {
+ this.state = 2;
+ }
+ continue;
+ case 15:
+ if (c === "]") {
+ this.state = 16;
+ } else {
+ this.cdata += c;
+ }
+ continue;
+ case 16:
+ if (c === "]") {
+ this.state = 17;
+ } else {
+ this.cdata += "]" + c;
+ this.state = 15;
+ }
+ continue;
+ case 17:
+ if (c === ">") {
+ if (this.cdata) {
+ this.closetext_if_exist$();
+ }
+ this.cdata = "";
+ this.state = 2;
+ } else {
+ if (c === "]") {
+ this.cdata += "]";
+ } else {
+ this.cdata += "]]" + c;
+ this.state = 15;
+ }
+ }
+ continue;
+ case 18:
+ if (c === "?") {
+ this.state = 20;
+ } else {
+ charclass$6 = _.whitespace;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$6, c)) {
+ this.state = 19;
+ } else {
+ this.procInstName += c;
+ }
+ }
+ continue;
+ case 19:
+ if (! this.procInstBody && _.is$HBS(_.whitespace, c)) {
+ continue;
+ } else {
+ if (c === "?") {
+ this.state = 20;
+ } else {
+ this.procInstBody += c;
+ }
+ }
+ continue;
+ case 20:
+ if (c === ">") {
+ this.closetext_if_exist$();
+ this.procInstName = this.procInstBody = "";
+ this.state = 2;
+ } else {
+ this.procInstBody += "?" + c;
+ this.state = 19;
+ }
+ continue;
+ case 21:
+ charclass$7 = _.nameBody;
+ if (charclass$7.test(c)) {
+ this.tagName += c;
+ } else {
+ this.newTag$();
+ if (c === ">") {
+ this.openTag$B(false);
+ } else {
+ if (c === "/") {
+ this.state = 22;
+ } else {
+ charclass$8 = _.whitespace;
+ if (! $__jsx_ObjectHasOwnProperty.call(charclass$8, c)) {
+ this.strictFail$S("Invalid character in tag name");
+ }
+ this.state = 23;
+ }
+ }
+ }
+ continue;
+ case 22:
+ if (c === ">") {
+ this.openTag$B(true);
+ this.closeTag$();
+ } else {
+ this.strictFail$S("Forward-slash in opening tag not followed by >");
+ this.state = 23;
+ }
+ continue;
+ case 23:
+ charclass$9 = _.whitespace;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$9, c)) {
+ continue;
+ } else {
+ if (c === ">") {
+ this.openTag$B(false);
+ } else {
+ if (c === "/") {
+ this.state = 22;
+ } else {
+ charclass$10 = _.nameStart;
+ if (charclass$10.test(c)) {
+ this.attribName = c;
+ this.attribValue = "";
+ this.state = 24;
+ } else {
+ this.strictFail$S("Invalid attribute name");
+ }
+ }
+ }
+ }
+ continue;
+ case 24:
+ if (c === "=") {
+ this.state = 26;
+ } else {
+ if (c === ">") {
+ this.strictFail$S("Attribute without value");
+ this.attribValue = this.attribName;
+ this.attrib$();
+ this.openTag$B(false);
+ } else {
+ charclass$11 = _.whitespace;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$11, c)) {
+ this.state = 25;
+ } else {
+ charclass$12 = _.nameBody;
+ if (charclass$12.test(c)) {
+ this.attribName += c;
+ } else {
+ this.strictFail$S("Invalid attribute name");
+ }
+ }
+ }
+ }
+ continue;
+ case 25:
+ if (c === "=") {
+ this.state = 26;
+ } else {
+ charclass$13 = _.whitespace;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$13, c)) {
+ continue;
+ } else {
+ this.strictFail$S("Attribute without value");
+ this.tag.attributes[this.attribName] = "";
+ this.attribValue = "";
+ this.closetext_if_exist$();
+ this.attribName = "";
+ if (c === ">") {
+ this.openTag$B(false);
+ } else {
+ charclass$14 = _.nameStart;
+ if (charclass$14.test(c)) {
+ this.attribName = c;
+ this.state = 24;
+ } else {
+ this.strictFail$S("Invalid attribute name");
+ this.state = 23;
+ }
+ }
+ }
+ }
+ continue;
+ case 26:
+ charclass$15 = _.whitespace;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$15, c)) {
+ continue;
+ } else {
+ charclass$16 = _.quote;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$16, c)) {
+ this.q = c;
+ this.state = 27;
+ } else {
+ this.strictFail$S("Unquoted attribute value");
+ this.state = 28;
+ this.attribValue = c;
+ }
+ }
+ continue;
+ case 27:
+ if (c !== this.q) {
+ if (c === "&") {
+ this.state = 29;
+ } else {
+ this.attribValue += c;
+ }
+ continue;
+ }
+ this.attrib$();
+ this.q = "";
+ this.state = 23;
+ continue;
+ case 28:
+ charclass$17 = _.attribEnd;
+ if (! $__jsx_ObjectHasOwnProperty.call(charclass$17, c)) {
+ if (c === "&") {
+ this.state = 30;
+ } else {
+ this.attribValue += c;
+ }
+ continue;
+ }
+ this.attrib$();
+ if (c === ">") {
+ this.openTag$B(false);
+ } else {
+ this.state = 23;
+ }
+ continue;
+ case 31:
+ if (! this.tagName) {
+ charclass$18 = _.whitespace;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$18, c)) {
+ continue;
+ } else {
+ charclass$19 = _.nameStart;
+ if (! charclass$19.test(c)) {
+ if (this.script) {
+ this.script += "</" + c;
+ this.state = 33;
+ } else {
+ this.strictFail$S("Invalid tagname in closing tag.");
+ }
+ } else {
+ this.tagName = c;
+ }
+ }
+ } else {
+ if (c === ">") {
+ this.closeTag$();
+ } else {
+ charclass$20 = _.nameBody;
+ if (charclass$20.test(c)) {
+ this.tagName += c;
+ } else {
+ if (this.script) {
+ this.script += "</" + this.tagName;
+ this.tagName = "";
+ this.state = 33;
+ } else {
+ charclass$21 = _.whitespace;
+ if (! $__jsx_ObjectHasOwnProperty.call(charclass$21, c)) {
+ this.strictFail$S("Invalid tagname in closing tag");
+ }
+ this.state = 32;
+ }
+ }
+ }
+ }
+ continue;
+ case 32:
+ charclass$22 = _.whitespace;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$22, c)) {
+ continue;
+ }
+ if (c === ">") {
+ this.closeTag$();
+ } else {
+ this.strictFail$S("Invalid characters in closing tag");
+ }
+ continue;
+ case 3:
+ if (c === ";") {
+ this.textNode += this.parseEntity$();
+ this.entity = "";
+ this.state = 2;
+ } else {
+ charclass$23 = _.entity;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$23, c)) {
+ this.entity += c;
+ } else {
+ this.strictFail$S("Invalid character entity");
+ this.textNode += "&" + this.entity + c;
+ this.entity = "";
+ this.state = 2;
+ }
+ }
+ continue;
+ case 29:
+ case 30:
+ if (this.state === 29) {
+ returnState = 27;
+ } else {
+ returnState = 28;
+ }
+ if (c === ";") {
+ this.attribValue += this.parseEntity$();
+ this.entity = "";
+ this.state = (returnState | 0);
+ } else {
+ charclass$24 = _.entity;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$24, c)) {
+ this.entity += c;
+ } else {
+ this.strictFail$S("Invalid character entity");
+ this.attribValue += "&" + this.entity + c;
+ this.entity = "";
+ this.state = (returnState | 0);
+ }
+ }
+ continue;
+ default:
+ throw new Error("Unknown state: " + (this.state + ""));
+ }
+ }
+ this.end$();
+ return this;
+};
+
+/**
+ */
+SAXParser.prototype.clearBuffers$ = function () {
+ this.comment = '';
+ this.sgmlDecl = '';
+ this.textNode = '';
+ this.tagName = '';
+ this.doctype = '';
+ this.procInstName = '';
+ this.procInstBody = '';
+ this.entity = '';
+ this.attribName = '';
+ this.attribValue = '';
+ this.cdata = '';
+ this.script = '';
+};
+
+/**
+ */
+SAXParser.prototype.closetext_if_exist$ = function () {
+ if (this.textNode !== '') {
+ this.closetext$();
+ }
+};
+
+/**
+ */
+SAXParser.prototype.closetext$ = function () {
+ /** @type {!string} */
+ var text;
+ /** @type {!string} */
+ var text$0;
+ if (this.preTags === 0) {
+ text$0 = this.textNode;
+ text$0 = text$0.replace(/[\n\t]/g, ' ');
+ text$0 = text$0.replace(/\s\s+/g, " ");
+ text = text$0;
+ if (text$0) {
+ this.handler.ontext$S(text);
+ }
+ } else {
+ if (this.textNode) {
+ this.handler.ontext$S(this.textNode);
+ }
+ }
+ this.textNode = "";
+};
+
+/**
+ * @param {!string} text
+ * @return {!string}
+ */
+SAXParser.prototype.textopts$S = function (text) {
+ text = text.replace(/[\n\t]/g, ' ');
+ text = text.replace(/\s\s+/g, " ");
+ return text;
+};
+
+/**
+ * @param {!string} er
+ * @return {SAXParser}
+ */
+SAXParser.prototype.emiterror$S = function (er) {
+ /** @type {Error} */
+ var error;
+ this.closetext$();
+ er += "\nLine: " + (this.line + "") + "\nColumn: " + (this.column + "") + "\nChar: " + this.c;
+ error = new Error(er);
+ this.error = error;
+ return this;
+};
+
+/**
+ */
+SAXParser.prototype.end$ = function () {
+ if (! this.closedRoot) {
+ this.strictFail$S("Unclosed root tag");
+ }
+ if (this.state !== 2) {
+ this.emiterror$S("Unexpected end");
+ }
+ this.closetext$();
+ this.c = "";
+ this.closed = true;
+ this.handler.onend$();
+};
+
+/**
+ * @param {!string} message
+ */
+SAXParser.prototype.strictFail$S = function (message) {
+ if (this.strict) {
+ this.emiterror$S(message);
+ }
+};
+
+/**
+ */
+SAXParser.prototype.newTag$ = function () {
+ if (! this.strict) {
+ this.tagName = this.tagName.toLowerCase();
+ }
+ this.tag = ({name: this.tagName, attributes: ({ }), isSelfClosing: false});
+ this.attribList.length = 0;
+};
+
+/**
+ */
+SAXParser.prototype.attrib$ = function () {
+ if (! this.strict) {
+ this.attribName = this.attribName.toLowerCase();
+ }
+ if ($__jsx_ObjectHasOwnProperty.call(this.tag.attributes, this.attribName)) {
+ this.attribName = this.attribValue = "";
+ return;
+ }
+ this.tag.attributes[this.attribName] = this.attribValue;
+ this.closetext_if_exist$();
+ this.attribName = this.attribValue = "";
+};
+
+/**
+ */
+SAXParser.prototype.openTag$ = function () {
+ this.openTag$B(false);
+};
+
+/**
+ * @param {!boolean} selfClosing
+ */
+SAXParser.prototype.openTag$B = function (selfClosing) {
+ /** @type {Tag} */
+ var tag$0;
+ /** @type {Tag} */
+ var tag$1;
+ (tag$0 = this.tag).isSelfClosing = selfClosing;
+ this.sawRoot = true;
+ this.tags.push(tag$0);
+ this.closetext_if_exist$();
+ this.handler.onopentag$SHS((tag$1 = this.tag).name, tag$1.attributes);
+ if (this.tag.name === 'pre') {
+ this.preTags++;
+ }
+ if (! selfClosing) {
+ if (! this.noscript && this.tagName.toLowerCase() === "script") {
+ this.state = 33;
+ } else {
+ this.state = 2;
+ }
+ this.tag = null;
+ this.tagName = "";
+ }
+ this.attribName = this.attribValue = "";
+ this.attribList.length = 0;
+};
+
+/**
+ */
+SAXParser.prototype.closeTag$ = function () {
+ /** @type {!number} */
+ var t;
+ /** @type {!string} */
+ var tagName;
+ /** @type {!string} */
+ var closeTo;
+ /** @type {Tag} */
+ var close;
+ /** @type {!number} */
+ var s;
+ /** @type {Tag} */
+ var tag$0;
+ if (! this.tagName) {
+ this.strictFail$S("Weird empty close tag.");
+ this.textNode += "</>";
+ this.state = 2;
+ return;
+ }
+ if (this.script) {
+ if (this.tagName !== "script") {
+ this.script += "</" + this.tagName + ">";
+ this.tagName = "";
+ this.state = 33;
+ return;
+ }
+ this.closetext_if_exist$();
+ this.script = "";
+ }
+ t = this.tags.length;
+ tagName = this.tagName;
+ if (! this.strict) {
+ tagName = tagName.toLowerCase();
+ }
+ closeTo = tagName;
+ while (t--) {
+ close = this.tags[t];
+ if (close.name !== closeTo) {
+ this.strictFail$S("Unexpected close tag");
+ } else {
+ break;
+ }
+ }
+ if (t < 0) {
+ this.strictFail$S("Unmatched closing tag: " + this.tagName);
+ this.textNode += "</" + this.tagName + ">";
+ this.state = 2;
+ return;
+ }
+ this.tagName = tagName;
+ s = this.tags.length;
+ while (s-- > t) {
+ tag$0 = this.tag = this.tags.pop();
+ this.tagName = tag$0.name;
+ this.closetext_if_exist$();
+ this.handler.onclosetag$S(this.tagName);
+ if (this.tagName === 'pre') {
+ this.preTags--;
+ }
+ }
+ if (t === 0) {
+ this.closedRoot = true;
+ }
+ this.tagName = this.attribValue = this.attribName = "";
+ this.attribList.length = 0;
+ this.state = 2;
+};
+
+/**
+ * @return {!string}
+ */
+SAXParser.prototype.parseEntity$ = function () {
+ /** @type {!string} */
+ var entity;
+ /** @type {!string} */
+ var entityLC;
+ /** @type {!number} */
+ var num;
+ /** @type {!string} */
+ var numStr;
+ entity = this.entity;
+ entityLC = entity.toLowerCase();
+ num = 0;
+ numStr = "";
+ if (this.ENTITIES[entity]) {
+ return this.ENTITIES[entity];
+ }
+ if (this.ENTITIES[entityLC]) {
+ return this.ENTITIES[entityLC];
+ }
+ entity = entityLC;
+ if (entityLC.charAt(0) === "#") {
+ if (entity.charAt(1) === "x") {
+ entity = entity.slice(2);
+ num = $__jsx_parseInt(entity, 16);
+ numStr = num.toString(16);
+ } else {
+ entity = entity.slice(1);
+ num = $__jsx_parseInt(entity, 10);
+ numStr = num.toString(10);
+ }
+ }
+ entity = entity.replace(/^0+/, "");
+ if (numStr.toLowerCase() !== entity) {
+ this.strictFail$S("Invalid character entity");
+ return "&" + this.entity + ";";
+ }
+ return String.fromCharCode(num);
+};
+
+/**
+ * class Char extends Object
+ * @constructor
+ */
+function Char() {
+}
+
+/**
+ * @constructor
+ */
+function Char$() {
+ this.CDATA = "[CDATA[";
+ this.DOCTYPE = "DOCTYPE";
+ this.XML_NAMESPACE = "http://www.w3.org/XML/1998/namespace";
+ this.whitespace = this._charClass$S("\r\n\t ");
+ this.number = this._charClass$S("0124356789");
+ this.letter = this._charClass$S("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ");
+ this.quote = this._charClass$S("'\"");
+ this.entity = this._charClass$S("0124356789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ#");
+ this.attribEnd = this._charClass$S("\r\n\t >");
+ this.nameStart = /[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/;
+ this.nameBody = /[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040\.\d-]/;
+};
+
+Char$.prototype = new Char;
+
+/**
+ * @param {!string} str
+ * @return {Object.<string, undefined|!boolean>}
+ */
+Char.prototype._charClass$S = function (str) {
+ /** @type {Object.<string, undefined|!boolean>} */
+ var result;
+ /** @type {!number} */
+ var i;
+ result = ({ });
+ for (i = 0; i < str.length; i++) {
+ result[str.slice(i, i + 1)] = true;
+ }
+ return result;
+};
+
+/**
+ * @param {RegExp} charclass
+ * @param {!string} c
+ * @return {!boolean}
+ */
+Char.prototype.is$LRegExp$S = function (charclass, c) {
+ return charclass.test(c);
+};
+
+/**
+ * @param {Object.<string, undefined|!boolean>} charclass
+ * @param {!string} c
+ * @return {!boolean}
+ */
+Char.prototype.is$HBS = function (charclass, c) {
+ return $__jsx_ObjectHasOwnProperty.call(charclass, c);
+};
+
+/**
+ * @param {RegExp} charclass
+ * @param {!string} c
+ * @return {!boolean}
+ */
+Char.prototype.not$LRegExp$S = function (charclass, c) {
+ return ! charclass.test(c);
+};
+
+/**
+ * @param {Object.<string, undefined|!boolean>} charclass
+ * @param {!string} c
+ * @return {!boolean}
+ */
+Char.prototype.not$HBS = function (charclass, c) {
+ return ! $__jsx_ObjectHasOwnProperty.call(charclass, c);
+};
+
+/**
+ * class _Entities extends Object
+ * @constructor
+ */
+function _Entities() {
+}
+
+/**
+ * @constructor
+ */
+function _Entities$() {
+};
+
+_Entities$.prototype = new _Entities;
+
+/**
+ * @return {Object.<string, undefined|!string>}
+ */
+_Entities.entity_list$ = function () {
+ /** @type {Object.<string, undefined|!string>} */
+ var result;
+ /** @type {!string} */
+ var key;
+ /** @type {*} */
+ var value;
+ result = ({ });
+ for (key in _Entities._entities) {
+ value = _Entities._entities[key];
+ if (typeof value === 'string') {
+ result[key] = value + "";
+ } else {
+ if (typeof value === 'number') {
+ result[key] = String.fromCharCode(value | 0);
+ }
+ }
+ }
+ return result;
+};
+
+var _Entities$entity_list$ = _Entities.entity_list$;
+
+/**
+ * class BaseStemmer extends Object
+ * @constructor
+ */
+function BaseStemmer() {
+}
+
+$__jsx_merge_interface(BaseStemmer, Stemmer);
+
+/**
+ * @constructor
+ */
+function BaseStemmer$() {
+ /** @type {!string} */
+ var current$0;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var limit$0;
+ this.cache = ({ });
+ current$0 = this.current = "";
+ cursor$0 = this.cursor = 0;
+ limit$0 = this.limit = current$0.length;
+ this.limit_backward = 0;
+ this.bra = cursor$0;
+ this.ket = limit$0;
+};
+
+BaseStemmer$.prototype = new BaseStemmer;
+
+/**
+ * @param {!string} value
+ */
+BaseStemmer.prototype.setCurrent$S = function (value) {
+ /** @type {!string} */
+ var current$0;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var limit$0;
+ current$0 = this.current = value;
+ cursor$0 = this.cursor = 0;
+ limit$0 = this.limit = current$0.length;
+ this.limit_backward = 0;
+ this.bra = cursor$0;
+ this.ket = limit$0;
+};
+
+/**
+ * @return {!string}
+ */
+BaseStemmer.prototype.getCurrent$ = function () {
+ return this.current;
+};
+
+/**
+ * @param {BaseStemmer} other
+ */
+BaseStemmer.prototype.copy_from$LBaseStemmer$ = function (other) {
+ this.current = other.current;
+ this.cursor = other.cursor;
+ this.limit = other.limit;
+ this.limit_backward = other.limit_backward;
+ this.bra = other.bra;
+ this.ket = other.ket;
+};
+
+/**
+ * @param {Array.<undefined|!number>} s
+ * @param {!number} min
+ * @param {!number} max
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.in_grouping$AIII = function (s, min, max) {
+ /** @type {!number} */
+ var ch;
+ if (this.cursor >= this.limit) {
+ return false;
+ }
+ ch = this.current.charCodeAt(this.cursor);
+ if (ch > max || ch < min) {
+ return false;
+ }
+ ch -= min;
+ if ((s[ch >>> 3] & 0x1 << (ch & 0x7)) === 0) {
+ return false;
+ }
+ this.cursor++;
+ return true;
+};
+
+/**
+ * @param {Array.<undefined|!number>} s
+ * @param {!number} min
+ * @param {!number} max
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.in_grouping_b$AIII = function (s, min, max) {
+ /** @type {!number} */
+ var ch;
+ if (this.cursor <= this.limit_backward) {
+ return false;
+ }
+ ch = this.current.charCodeAt(this.cursor - 1);
+ if (ch > max || ch < min) {
+ return false;
+ }
+ ch -= min;
+ if ((s[ch >>> 3] & 0x1 << (ch & 0x7)) === 0) {
+ return false;
+ }
+ this.cursor--;
+ return true;
+};
+
+/**
+ * @param {Array.<undefined|!number>} s
+ * @param {!number} min
+ * @param {!number} max
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.out_grouping$AIII = function (s, min, max) {
+ /** @type {!number} */
+ var ch;
+ if (this.cursor >= this.limit) {
+ return false;
+ }
+ ch = this.current.charCodeAt(this.cursor);
+ if (ch > max || ch < min) {
+ this.cursor++;
+ return true;
+ }
+ ch -= min;
+ if ((s[ch >>> 3] & 0X1 << (ch & 0x7)) === 0) {
+ this.cursor++;
+ return true;
+ }
+ return false;
+};
+
+/**
+ * @param {Array.<undefined|!number>} s
+ * @param {!number} min
+ * @param {!number} max
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.out_grouping_b$AIII = function (s, min, max) {
+ /** @type {!number} */
+ var ch;
+ if (this.cursor <= this.limit_backward) {
+ return false;
+ }
+ ch = this.current.charCodeAt(this.cursor - 1);
+ if (ch > max || ch < min) {
+ this.cursor--;
+ return true;
+ }
+ ch -= min;
+ if ((s[ch >>> 3] & 0x1 << (ch & 0x7)) === 0) {
+ this.cursor--;
+ return true;
+ }
+ return false;
+};
+
+/**
+ * @param {!number} min
+ * @param {!number} max
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.in_range$II = function (min, max) {
+ /** @type {!number} */
+ var ch;
+ if (this.cursor >= this.limit) {
+ return false;
+ }
+ ch = this.current.charCodeAt(this.cursor);
+ if (ch > max || ch < min) {
+ return false;
+ }
+ this.cursor++;
+ return true;
+};
+
+/**
+ * @param {!number} min
+ * @param {!number} max
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.in_range_b$II = function (min, max) {
+ /** @type {!number} */
+ var ch;
+ if (this.cursor <= this.limit_backward) {
+ return false;
+ }
+ ch = this.current.charCodeAt(this.cursor - 1);
+ if (ch > max || ch < min) {
+ return false;
+ }
+ this.cursor--;
+ return true;
+};
+
+/**
+ * @param {!number} min
+ * @param {!number} max
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.out_range$II = function (min, max) {
+ /** @type {!number} */
+ var ch;
+ if (this.cursor >= this.limit) {
+ return false;
+ }
+ ch = this.current.charCodeAt(this.cursor);
+ if (! (ch > max || ch < min)) {
+ return false;
+ }
+ this.cursor++;
+ return true;
+};
+
+/**
+ * @param {!number} min
+ * @param {!number} max
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.out_range_b$II = function (min, max) {
+ /** @type {!number} */
+ var ch;
+ if (this.cursor <= this.limit_backward) {
+ return false;
+ }
+ ch = this.current.charCodeAt(this.cursor - 1);
+ if (! (ch > max || ch < min)) {
+ return false;
+ }
+ this.cursor--;
+ return true;
+};
+
+/**
+ * @param {!number} s_size
+ * @param {!string} s
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.eq_s$IS = function (s_size, s) {
+ /** @type {!number} */
+ var cursor$0;
+ if (this.limit - this.cursor < s_size) {
+ return false;
+ }
+ if (this.current.slice(cursor$0 = this.cursor, cursor$0 + s_size) !== s) {
+ return false;
+ }
+ this.cursor += s_size;
+ return true;
+};
+
+/**
+ * @param {!number} s_size
+ * @param {!string} s
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.eq_s_b$IS = function (s_size, s) {
+ /** @type {!number} */
+ var cursor$0;
+ if (this.cursor - this.limit_backward < s_size) {
+ return false;
+ }
+ if (this.current.slice((cursor$0 = this.cursor) - s_size, cursor$0) !== s) {
+ return false;
+ }
+ this.cursor -= s_size;
+ return true;
+};
+
+/**
+ * @param {!string} s
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.eq_v$S = function (s) {
+ return this.eq_s$IS(s.length, s);
+};
+
+/**
+ * @param {!string} s
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.eq_v_b$S = function (s) {
+ return this.eq_s_b$IS(s.length, s);
+};
+
+/**
+ * @param {Array.<undefined|Among>} v
+ * @param {!number} v_size
+ * @return {!number}
+ */
+BaseStemmer.prototype.find_among$ALAmong$I = function (v, v_size) {
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var j;
+ /** @type {!number} */
+ var c;
+ /** @type {!number} */
+ var l;
+ /** @type {!number} */
+ var common_i;
+ /** @type {!number} */
+ var common_j;
+ /** @type {!boolean} */
+ var first_key_inspected;
+ /** @type {!number} */
+ var k;
+ /** @type {!number} */
+ var diff;
+ /** @type {!number} */
+ var common;
+ /** @type {Among} */
+ var w;
+ /** @type {!number} */
+ var i2;
+ /** @type {!boolean} */
+ var res;
+ i = 0;
+ j = v_size;
+ c = this.cursor;
+ l = this.limit;
+ common_i = 0;
+ common_j = 0;
+ first_key_inspected = false;
+ while (true) {
+ k = i + (j - i >>> 1);
+ diff = 0;
+ common = (common_i < common_j ? common_i : common_j);
+ w = v[k];
+ for (i2 = common; i2 < w.s_size; i2++) {
+ if (c + common === l) {
+ diff = -1;
+ break;
+ }
+ diff = this.current.charCodeAt(c + common) - w.s.charCodeAt(i2);
+ if (diff !== 0) {
+ break;
+ }
+ common++;
+ }
+ if (diff < 0) {
+ j = k;
+ common_j = common;
+ } else {
+ i = k;
+ common_i = common;
+ }
+ if (j - i <= 1) {
+ if (i > 0) {
+ break;
+ }
+ if (j === i) {
+ break;
+ }
+ if (first_key_inspected) {
+ break;
+ }
+ first_key_inspected = true;
+ }
+ }
+ while (true) {
+ w = v[i];
+ if (common_i >= w.s_size) {
+ this.cursor = (c + w.s_size | 0);
+ if (w.method == null) {
+ return w.result;
+ }
+ res = w.method(w.instance);
+ this.cursor = (c + w.s_size | 0);
+ if (res) {
+ return w.result;
+ }
+ }
+ i = w.substring_i;
+ if (i < 0) {
+ return 0;
+ }
+ }
+ return -1;
+};
+
+/**
+ * @param {Array.<undefined|Among>} v
+ * @param {!number} v_size
+ * @return {!number}
+ */
+BaseStemmer.prototype.find_among_b$ALAmong$I = function (v, v_size) {
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var j;
+ /** @type {!number} */
+ var c;
+ /** @type {!number} */
+ var lb;
+ /** @type {!number} */
+ var common_i;
+ /** @type {!number} */
+ var common_j;
+ /** @type {!boolean} */
+ var first_key_inspected;
+ /** @type {!number} */
+ var k;
+ /** @type {!number} */
+ var diff;
+ /** @type {!number} */
+ var common;
+ /** @type {Among} */
+ var w;
+ /** @type {!number} */
+ var i2;
+ /** @type {!boolean} */
+ var res;
+ i = 0;
+ j = v_size;
+ c = this.cursor;
+ lb = this.limit_backward;
+ common_i = 0;
+ common_j = 0;
+ first_key_inspected = false;
+ while (true) {
+ k = i + (j - i >> 1);
+ diff = 0;
+ common = (common_i < common_j ? common_i : common_j);
+ w = v[k];
+ for (i2 = w.s_size - 1 - common; i2 >= 0; i2--) {
+ if (c - common === lb) {
+ diff = -1;
+ break;
+ }
+ diff = this.current.charCodeAt(c - 1 - common) - w.s.charCodeAt(i2);
+ if (diff !== 0) {
+ break;
+ }
+ common++;
+ }
+ if (diff < 0) {
+ j = k;
+ common_j = common;
+ } else {
+ i = k;
+ common_i = common;
+ }
+ if (j - i <= 1) {
+ if (i > 0) {
+ break;
+ }
+ if (j === i) {
+ break;
+ }
+ if (first_key_inspected) {
+ break;
+ }
+ first_key_inspected = true;
+ }
+ }
+ while (true) {
+ w = v[i];
+ if (common_i >= w.s_size) {
+ this.cursor = (c - w.s_size | 0);
+ if (w.method == null) {
+ return w.result;
+ }
+ res = w.method(this);
+ this.cursor = (c - w.s_size | 0);
+ if (res) {
+ return w.result;
+ }
+ }
+ i = w.substring_i;
+ if (i < 0) {
+ return 0;
+ }
+ }
+ return -1;
+};
+
+/**
+ * @param {!number} c_bra
+ * @param {!number} c_ket
+ * @param {!string} s
+ * @return {!number}
+ */
+BaseStemmer.prototype.replace_s$IIS = function (c_bra, c_ket, s) {
+ /** @type {!number} */
+ var adjustment;
+ adjustment = s.length - (c_ket - c_bra);
+ this.current = this.current.slice(0, c_bra) + s + this.current.slice(c_ket);
+ this.limit += (adjustment | 0);
+ if (this.cursor >= c_ket) {
+ this.cursor += (adjustment | 0);
+ } else {
+ if (this.cursor > c_bra) {
+ this.cursor = c_bra;
+ }
+ }
+ return (adjustment | 0);
+};
+
+/**
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.slice_check$ = function () {
+ /** @type {!number} */
+ var bra$0;
+ /** @type {!number} */
+ var ket$0;
+ /** @type {!number} */
+ var limit$0;
+ return ((bra$0 = this.bra) < 0 || bra$0 > (ket$0 = this.ket) || ket$0 > (limit$0 = this.limit) || limit$0 > this.current.length ? false : true);
+};
+
+/**
+ * @param {!string} s
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.slice_from$S = function (s) {
+ /** @type {!boolean} */
+ var result;
+ /** @type {!number} */
+ var bra$0;
+ /** @type {!number} */
+ var ket$0;
+ /** @type {!number} */
+ var limit$0;
+ result = false;
+ if ((bra$0 = this.bra) < 0 || bra$0 > (ket$0 = this.ket) || ket$0 > (limit$0 = this.limit) || limit$0 > this.current.length ? false : true) {
+ this.replace_s$IIS(this.bra, this.ket, s);
+ result = true;
+ }
+ return result;
+};
+
+/**
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.slice_del$ = function () {
+ return this.slice_from$S("");
+};
+
+/**
+ * @param {!number} c_bra
+ * @param {!number} c_ket
+ * @param {!string} s
+ */
+BaseStemmer.prototype.insert$IIS = function (c_bra, c_ket, s) {
+ /** @type {!number} */
+ var adjustment;
+ adjustment = this.replace_s$IIS(c_bra, c_ket, s);
+ if (c_bra <= this.bra) {
+ this.bra += (adjustment | 0);
+ }
+ if (c_bra <= this.ket) {
+ this.ket += (adjustment | 0);
+ }
+};
+
+/**
+ * @param {!string} s
+ * @return {!string}
+ */
+BaseStemmer.prototype.slice_to$S = function (s) {
+ /** @type {!string} */
+ var result;
+ /** @type {!number} */
+ var bra$0;
+ /** @type {!number} */
+ var ket$0;
+ /** @type {!number} */
+ var limit$0;
+ result = '';
+ if ((bra$0 = this.bra) < 0 || bra$0 > (ket$0 = this.ket) || ket$0 > (limit$0 = this.limit) || limit$0 > this.current.length ? false : true) {
+ result = this.current.slice(this.bra, this.ket);
+ }
+ return result;
+};
+
+/**
+ * @param {!string} s
+ * @return {!string}
+ */
+BaseStemmer.prototype.assign_to$S = function (s) {
+ return this.current.slice(0, this.limit);
+};
+
+/**
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.stem$ = function () {
+ return false;
+};
+
+/**
+ * @param {!string} word
+ * @return {!string}
+ */
+BaseStemmer.prototype.stemWord$S = function (word) {
+ /** @type {undefined|!string} */
+ var result;
+ /** @type {!string} */
+ var current$0;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var limit$0;
+ result = this.cache['.' + word];
+ if (result == null) {
+ current$0 = this.current = word;
+ cursor$0 = this.cursor = 0;
+ limit$0 = this.limit = current$0.length;
+ this.limit_backward = 0;
+ this.bra = cursor$0;
+ this.ket = limit$0;
+ this.stem$();
+ result = this.current;
+ this.cache['.' + word] = result;
+ }
+ return result;
+};
+
+/**
+ * @param {Array.<undefined|!string>} words
+ * @return {Array.<undefined|!string>}
+ */
+BaseStemmer.prototype.stemWords$AS = function (words) {
+ /** @type {Array.<undefined|!string>} */
+ var results;
+ /** @type {!number} */
+ var i;
+ /** @type {undefined|!string} */
+ var word;
+ /** @type {undefined|!string} */
+ var result;
+ /** @type {!string} */
+ var current$0;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var limit$0;
+ results = [ ];
+ for (i = 0; i < words.length; i++) {
+ word = words[i];
+ result = this.cache['.' + word];
+ if (result == null) {
+ current$0 = this.current = word;
+ cursor$0 = this.cursor = 0;
+ limit$0 = this.limit = current$0.length;
+ this.limit_backward = 0;
+ this.bra = cursor$0;
+ this.ket = limit$0;
+ this.stem$();
+ result = this.current;
+ this.cache['.' + word] = result;
+ }
+ results.push(result);
+ }
+ return results;
+};
+
+/**
+ * class TurkishStemmer extends BaseStemmer
+ * @constructor
+ */
+function TurkishStemmer() {
+}
+
+TurkishStemmer.prototype = new BaseStemmer;
+/**
+ * @constructor
+ */
+function TurkishStemmer$() {
+ BaseStemmer$.call(this);
+ this.B_continue_stemming_noun_suffixes = false;
+ this.I_strlen = 0;
+};
+
+TurkishStemmer$.prototype = new TurkishStemmer;
+
+/**
+ * @param {TurkishStemmer} other
+ */
+TurkishStemmer.prototype.copy_from$LTurkishStemmer$ = function (other) {
+ this.B_continue_stemming_noun_suffixes = other.B_continue_stemming_noun_suffixes;
+ this.I_strlen = other.I_strlen;
+ BaseStemmer.prototype.copy_from$LBaseStemmer$.call(this, other);
+};
+
+/**
+ * @return {!boolean}
+ */
+TurkishStemmer.prototype.r_check_vowel_harmony$ = function () {
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var v_3;
+ /** @type {!number} */
+ var v_4;
+ /** @type {!number} */
+ var v_5;
+ /** @type {!number} */
+ var v_6;
+ /** @type {!number} */
+ var v_7;
+ /** @type {!number} */
+ var v_8;
+ /** @type {!number} */
+ var v_9;
+ /** @type {!number} */
+ var v_10;
+ /** @type {!number} */
+ var v_11;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!boolean} */
+ var lab2;
+ /** @type {!boolean} */
+ var lab3;
+ /** @type {!boolean} */
+ var lab5;
+ /** @type {!boolean} */
+ var lab6;
+ /** @type {!boolean} */
+ var lab8;
+ /** @type {!boolean} */
+ var lab9;
+ /** @type {!boolean} */
+ var lab11;
+ /** @type {!boolean} */
+ var lab12;
+ /** @type {!boolean} */
+ var lab14;
+ /** @type {!boolean} */
+ var lab15;
+ /** @type {!boolean} */
+ var lab17;
+ /** @type {!boolean} */
+ var lab18;
+ /** @type {!boolean} */
+ var lab20;
+ /** @type {!boolean} */
+ var lab21;
+ /** @type {!boolean} */
+ var lab23;
+ /** @type {!boolean} */
+ var lab25;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var cursor$1;
+ /** @type {!number} */
+ var cursor$2;
+ /** @type {!number} */
+ var cursor$3;
+ /** @type {!number} */
+ var cursor$4;
+ /** @type {!number} */
+ var cursor$5;
+ /** @type {!number} */
+ var cursor$6;
+ /** @type {!number} */
+ var cursor$7;
+ /** @type {!number} */
+ var cursor$8;
+ v_1 = this.limit - this.cursor;
+golab0:
+ while (true) {
+ v_2 = this.limit - this.cursor;
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ if (! this.in_grouping_b$AIII(TurkishStemmer.g_vowel, 97, 305)) {
+ break lab1;
+ }
+ this.cursor = this.limit - v_2;
+ break golab0;
+ }
+ cursor$0 = this.cursor = this.limit - v_2;
+ if (cursor$0 <= this.limit_backward) {
+ return false;
+ }
+ this.cursor--;
+ }
+ lab2 = true;
+lab2:
+ while (lab2 === true) {
+ lab2 = false;
+ v_3 = this.limit - this.cursor;
+ lab3 = true;
+ lab3:
+ while (lab3 === true) {
+ lab3 = false;
+ if (! this.eq_s_b$IS(1, "a")) {
+ break lab3;
+ }
+ golab4:
+ while (true) {
+ v_4 = this.limit - this.cursor;
+ lab5 = true;
+ lab5:
+ while (lab5 === true) {
+ lab5 = false;
+ if (! this.in_grouping_b$AIII(TurkishStemmer.g_vowel1, 97, 305)) {
+ break lab5;
+ }
+ this.cursor = this.limit - v_4;
+ break golab4;
+ }
+ cursor$1 = this.cursor = this.limit - v_4;
+ if (cursor$1 <= this.limit_backward) {
+ break lab3;
+ }
+ this.cursor--;
+ }
+ break lab2;
+ }
+ this.cursor = this.limit - v_3;
+ lab6 = true;
+ lab6:
+ while (lab6 === true) {
+ lab6 = false;
+ if (! this.eq_s_b$IS(1, "e")) {
+ break lab6;
+ }
+ golab7:
+ while (true) {
+ v_5 = this.limit - this.cursor;
+ lab8 = true;
+ lab8:
+ while (lab8 === true) {
+ lab8 = false;
+ if (! this.in_grouping_b$AIII(TurkishStemmer.g_vowel2, 101, 252)) {
+ break lab8;
+ }
+ this.cursor = this.limit - v_5;
+ break golab7;
+ }
+ cursor$2 = this.cursor = this.limit - v_5;
+ if (cursor$2 <= this.limit_backward) {
+ break lab6;
+ }
+ this.cursor--;
+ }
+ break lab2;
+ }
+ this.cursor = this.limit - v_3;
+ lab9 = true;
+ lab9:
+ while (lab9 === true) {
+ lab9 = false;
+ if (! this.eq_s_b$IS(1, "\u0131")) {
+ break lab9;
+ }
+ golab10:
+ while (true) {
+ v_6 = this.limit - this.cursor;
+ lab11 = true;
+ lab11:
+ while (lab11 === true) {
+ lab11 = false;
+ if (! this.in_grouping_b$AIII(TurkishStemmer.g_vowel3, 97, 305)) {
+ break lab11;
+ }
+ this.cursor = this.limit - v_6;
+ break golab10;
+ }
+ cursor$3 = this.cursor = this.limit - v_6;
+ if (cursor$3 <= this.limit_backward) {
+ break lab9;
+ }
+ this.cursor--;
+ }
+ break lab2;
+ }
+ this.cursor = this.limit - v_3;
+ lab12 = true;
+ lab12:
+ while (lab12 === true) {
+ lab12 = false;
+ if (! this.eq_s_b$IS(1, "i")) {
+ break lab12;
+ }
+ golab13:
+ while (true) {
+ v_7 = this.limit - this.cursor;
+ lab14 = true;
+ lab14:
+ while (lab14 === true) {
+ lab14 = false;
+ if (! this.in_grouping_b$AIII(TurkishStemmer.g_vowel4, 101, 105)) {
+ break lab14;
+ }
+ this.cursor = this.limit - v_7;
+ break golab13;
+ }
+ cursor$4 = this.cursor = this.limit - v_7;
+ if (cursor$4 <= this.limit_backward) {
+ break lab12;
+ }
+ this.cursor--;
+ }
+ break lab2;
+ }
+ this.cursor = this.limit - v_3;
+ lab15 = true;
+ lab15:
+ while (lab15 === true) {
+ lab15 = false;
+ if (! this.eq_s_b$IS(1, "o")) {
+ break lab15;
+ }
+ golab16:
+ while (true) {
+ v_8 = this.limit - this.cursor;
+ lab17 = true;
+ lab17:
+ while (lab17 === true) {
+ lab17 = false;
+ if (! this.in_grouping_b$AIII(TurkishStemmer.g_vowel5, 111, 117)) {
+ break lab17;
+ }
+ this.cursor = this.limit - v_8;
+ break golab16;
+ }
+ cursor$5 = this.cursor = this.limit - v_8;
+ if (cursor$5 <= this.limit_backward) {
+ break lab15;
+ }
+ this.cursor--;
+ }
+ break lab2;
+ }
+ this.cursor = this.limit - v_3;
+ lab18 = true;
+ lab18:
+ while (lab18 === true) {
+ lab18 = false;
+ if (! this.eq_s_b$IS(1, "\u00F6")) {
+ break lab18;
+ }
+ golab19:
+ while (true) {
+ v_9 = this.limit - this.cursor;
+ lab20 = true;
+ lab20:
+ while (lab20 === true) {
+ lab20 = false;
+ if (! this.in_grouping_b$AIII(TurkishStemmer.g_vowel6, 246, 252)) {
+ break lab20;
+ }
+ this.cursor = this.limit - v_9;
+ break golab19;
+ }
+ cursor$6 = this.cursor = this.limit - v_9;
+ if (cursor$6 <= this.limit_backward) {
+ break lab18;
+ }
+ this.cursor--;
+ }
+ break lab2;
+ }
+ this.cursor = this.limit - v_3;
+ lab21 = true;
+ lab21:
+ while (lab21 === true) {
+ lab21 = false;
+ if (! this.eq_s_b$IS(1, "u")) {
+ break lab21;
+ }
+ golab22:
+ while (true) {
+ v_10 = this.limit - this.cursor;
+ lab23 = true;
+ lab23:
+ while (lab23 === true) {
+ lab23 = false;
+ if (! this.in_grouping_b$AIII(TurkishStemmer.g_vowel5, 111, 117)) {
+ break lab23;
+ }
+ this.cursor = this.limit - v_10;
+ break golab22;
+ }
+ cursor$7 = this.cursor = this.limit - v_10;
+ if (cursor$7 <= this.limit_backward) {
+ break lab21;
+ }
+ this.cursor--;
+ }
+ break lab2;
+ }
+ this.cursor = this.limit - v_3;
+ if (! this.eq_s_b$IS(1, "\u00FC")) {
+ return false;
+ }
+ golab24:
+ while (true) {
+ v_11 = this.limit - this.cursor;
+ lab25 = true;
+ lab25:
+ while (lab25 === true) {
+ lab25 = false;
+ if (! this.in_grouping_b$AIII(TurkishStemmer.g_vowel6, 246, 252)) {
+ break lab25;
+ }
+ this.cursor = this.limit - v_11;
+ break golab24;
+ }
+ cursor$8 = this.cursor = this.limit - v_11;
+ if (cursor$8 <= this.limit_backward) {
+ return false;
+ }
+ this.cursor--;
+ }
+ }
+ this.cursor = this.limit - v_1;
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+TurkishStemmer.prototype.r_mark_suffix_with_optional_n_consonant$ = function () {
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var v_3;
+ /** @type {!number} */
+ var v_4;
+ /** @type {!number} */
+ var v_5;
+ /** @type {!number} */
+ var v_6;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!boolean} */
+ var lab2;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var limit$0;
+ /** @type {!number} */
+ var cursor$1;
+ /** @type {!number} */
+ var limit$1;
+ /** @type {!number} */
+ var cursor$2;
+ lab0 = true;
+lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ v_1 = this.limit - this.cursor;
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ v_2 = this.limit - this.cursor;
+ if (! this.eq_s_b$IS(1, "n")) {
+ break lab1;
+ }
+ cursor$0 = this.cursor = this.limit - v_2;
+ if (cursor$0 <= this.limit_backward) {
+ break lab1;
+ }
+ this.cursor--;
+ v_3 = this.limit - this.cursor;
+ if (! this.in_grouping_b$AIII(TurkishStemmer.g_vowel, 97, 305)) {
+ break lab1;
+ }
+ this.cursor = this.limit - v_3;
+ break lab0;
+ }
+ cursor$1 = this.cursor = (limit$0 = this.limit) - v_1;
+ v_4 = limit$0 - cursor$1;
+ lab2 = true;
+ lab2:
+ while (lab2 === true) {
+ lab2 = false;
+ v_5 = this.limit - this.cursor;
+ if (! this.eq_s_b$IS(1, "n")) {
+ break lab2;
+ }
+ this.cursor = this.limit - v_5;
+ return false;
+ }
+ cursor$2 = this.cursor = (limit$1 = this.limit) - v_4;
+ v_6 = limit$1 - cursor$2;
+ if (cursor$2 <= this.limit_backward) {
+ return false;
+ }
+ this.cursor--;
+ if (! this.in_grouping_b$AIII(TurkishStemmer.g_vowel, 97, 305)) {
+ return false;
+ }
+ this.cursor = this.limit - v_6;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+TurkishStemmer.prototype.r_mark_suffix_with_optional_s_consonant$ = function () {
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var v_3;
+ /** @type {!number} */
+ var v_4;
+ /** @type {!number} */
+ var v_5;
+ /** @type {!number} */
+ var v_6;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!boolean} */
+ var lab2;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var limit$0;
+ /** @type {!number} */
+ var cursor$1;
+ /** @type {!number} */
+ var limit$1;
+ /** @type {!number} */
+ var cursor$2;
+ lab0 = true;
+lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ v_1 = this.limit - this.cursor;
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ v_2 = this.limit - this.cursor;
+ if (! this.eq_s_b$IS(1, "s")) {
+ break lab1;
+ }
+ cursor$0 = this.cursor = this.limit - v_2;
+ if (cursor$0 <= this.limit_backward) {
+ break lab1;
+ }
+ this.cursor--;
+ v_3 = this.limit - this.cursor;
+ if (! this.in_grouping_b$AIII(TurkishStemmer.g_vowel, 97, 305)) {
+ break lab1;
+ }
+ this.cursor = this.limit - v_3;
+ break lab0;
+ }
+ cursor$1 = this.cursor = (limit$0 = this.limit) - v_1;
+ v_4 = limit$0 - cursor$1;
+ lab2 = true;
+ lab2:
+ while (lab2 === true) {
+ lab2 = false;
+ v_5 = this.limit - this.cursor;
+ if (! this.eq_s_b$IS(1, "s")) {
+ break lab2;
+ }
+ this.cursor = this.limit - v_5;
+ return false;
+ }
+ cursor$2 = this.cursor = (limit$1 = this.limit) - v_4;
+ v_6 = limit$1 - cursor$2;
+ if (cursor$2 <= this.limit_backward) {
+ return false;
+ }
+ this.cursor--;
+ if (! this.in_grouping_b$AIII(TurkishStemmer.g_vowel, 97, 305)) {
+ return false;
+ }
+ this.cursor = this.limit - v_6;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+TurkishStemmer.prototype.r_mark_suffix_with_optional_y_consonant$ = function () {
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var v_3;
+ /** @type {!number} */
+ var v_4;
+ /** @type {!number} */
+ var v_5;
+ /** @type {!number} */
+ var v_6;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!boolean} */
+ var lab2;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var limit$0;
+ /** @type {!number} */
+ var cursor$1;
+ /** @type {!number} */
+ var limit$1;
+ /** @type {!number} */
+ var cursor$2;
+ lab0 = true;
+lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ v_1 = this.limit - this.cursor;
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ v_2 = this.limit - this.cursor;
+ if (! this.eq_s_b$IS(1, "y")) {
+ break lab1;
+ }
+ cursor$0 = this.cursor = this.limit - v_2;
+ if (cursor$0 <= this.limit_backward) {
+ break lab1;
+ }
+ this.cursor--;
+ v_3 = this.limit - this.cursor;
+ if (! this.in_grouping_b$AIII(TurkishStemmer.g_vowel, 97, 305)) {
+ break lab1;
+ }
+ this.cursor = this.limit - v_3;
+ break lab0;
+ }
+ cursor$1 = this.cursor = (limit$0 = this.limit) - v_1;
+ v_4 = limit$0 - cursor$1;
+ lab2 = true;
+ lab2:
+ while (lab2 === true) {
+ lab2 = false;
+ v_5 = this.limit - this.cursor;
+ if (! this.eq_s_b$IS(1, "y")) {
+ break lab2;
+ }
+ this.cursor = this.limit - v_5;
+ return false;
+ }
+ cursor$2 = this.cursor = (limit$1 = this.limit) - v_4;
+ v_6 = limit$1 - cursor$2;
+ if (cursor$2 <= this.limit_backward) {
+ return false;
+ }
+ this.cursor--;
+ if (! this.in_grouping_b$AIII(TurkishStemmer.g_vowel, 97, 305)) {
+ return false;
+ }
+ this.cursor = this.limit - v_6;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+TurkishStemmer.prototype.r_mark_suffix_with_optional_U_vowel$ = function () {
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var v_3;
+ /** @type {!number} */
+ var v_4;
+ /** @type {!number} */
+ var v_5;
+ /** @type {!number} */
+ var v_6;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!boolean} */
+ var lab2;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var limit$0;
+ /** @type {!number} */
+ var cursor$1;
+ /** @type {!number} */
+ var limit$1;
+ /** @type {!number} */
+ var cursor$2;
+ lab0 = true;
+lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ v_1 = this.limit - this.cursor;
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ v_2 = this.limit - this.cursor;
+ if (! this.in_grouping_b$AIII(TurkishStemmer.g_U, 105, 305)) {
+ break lab1;
+ }
+ cursor$0 = this.cursor = this.limit - v_2;
+ if (cursor$0 <= this.limit_backward) {
+ break lab1;
+ }
+ this.cursor--;
+ v_3 = this.limit - this.cursor;
+ if (! this.out_grouping_b$AIII(TurkishStemmer.g_vowel, 97, 305)) {
+ break lab1;
+ }
+ this.cursor = this.limit - v_3;
+ break lab0;
+ }
+ cursor$1 = this.cursor = (limit$0 = this.limit) - v_1;
+ v_4 = limit$0 - cursor$1;
+ lab2 = true;
+ lab2:
+ while (lab2 === true) {
+ lab2 = false;
+ v_5 = this.limit - this.cursor;
+ if (! this.in_grouping_b$AIII(TurkishStemmer.g_U, 105, 305)) {
+ break lab2;
+ }
+ this.cursor = this.limit - v_5;
+ return false;
+ }
+ cursor$2 = this.cursor = (limit$1 = this.limit) - v_4;
+ v_6 = limit$1 - cursor$2;
+ if (cursor$2 <= this.limit_backward) {
+ return false;
+ }
+ this.cursor--;
+ if (! this.out_grouping_b$AIII(TurkishStemmer.g_vowel, 97, 305)) {
+ return false;
+ }
+ this.cursor = this.limit - v_6;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+TurkishStemmer.prototype.r_mark_possessives$ = function () {
+ return (this.find_among_b$ALAmong$I(TurkishStemmer.a_0, 10) === 0 ? false : ! this.r_mark_suffix_with_optional_U_vowel$() ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+TurkishStemmer.prototype.r_mark_sU$ = function () {
+ return (! this.r_check_vowel_harmony$() ? false : ! this.in_grouping_b$AIII(TurkishStemmer.g_U, 105, 305) ? false : ! this.r_mark_suffix_with_optional_s_consonant$() ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+TurkishStemmer.prototype.r_mark_lArI$ = function () {
+ return (this.find_among_b$ALAmong$I(TurkishStemmer.a_1, 2) === 0 ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+TurkishStemmer.prototype.r_mark_yU$ = function () {
+ return (! this.r_check_vowel_harmony$() ? false : ! this.in_grouping_b$AIII(TurkishStemmer.g_U, 105, 305) ? false : ! this.r_mark_suffix_with_optional_y_consonant$() ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+TurkishStemmer.prototype.r_mark_nU$ = function () {
+ return (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_2, 4) === 0 ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+TurkishStemmer.prototype.r_mark_nUn$ = function () {
+ return (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_3, 4) === 0 ? false : ! this.r_mark_suffix_with_optional_n_consonant$() ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+TurkishStemmer.prototype.r_mark_yA$ = function () {
+ return (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_4, 2) === 0 ? false : ! this.r_mark_suffix_with_optional_y_consonant$() ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+TurkishStemmer.prototype.r_mark_nA$ = function () {
+ return (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_5, 2) === 0 ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+TurkishStemmer.prototype.r_mark_DA$ = function () {
+ return (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_6, 4) === 0 ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+TurkishStemmer.prototype.r_mark_ndA$ = function () {
+ return (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_7, 2) === 0 ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+TurkishStemmer.prototype.r_mark_DAn$ = function () {
+ return (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_8, 4) === 0 ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+TurkishStemmer.prototype.r_mark_ndAn$ = function () {
+ return (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_9, 2) === 0 ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+TurkishStemmer.prototype.r_mark_ylA$ = function () {
+ return (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_10, 2) === 0 ? false : ! this.r_mark_suffix_with_optional_y_consonant$() ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+TurkishStemmer.prototype.r_mark_ki$ = function () {
+ return (! this.eq_s_b$IS(2, "ki") ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+TurkishStemmer.prototype.r_mark_ncA$ = function () {
+ return (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_11, 2) === 0 ? false : ! this.r_mark_suffix_with_optional_n_consonant$() ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+TurkishStemmer.prototype.r_mark_yUm$ = function () {
+ return (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_12, 4) === 0 ? false : ! this.r_mark_suffix_with_optional_y_consonant$() ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+TurkishStemmer.prototype.r_mark_sUn$ = function () {
+ return (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_13, 4) === 0 ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+TurkishStemmer.prototype.r_mark_yUz$ = function () {
+ return (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_14, 4) === 0 ? false : ! this.r_mark_suffix_with_optional_y_consonant$() ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+TurkishStemmer.prototype.r_mark_sUnUz$ = function () {
+ return (this.find_among_b$ALAmong$I(TurkishStemmer.a_15, 4) === 0 ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+TurkishStemmer.prototype.r_mark_lAr$ = function () {
+ return (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_16, 2) === 0 ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+TurkishStemmer.prototype.r_mark_nUz$ = function () {
+ return (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_17, 4) === 0 ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+TurkishStemmer.prototype.r_mark_DUr$ = function () {
+ return (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_18, 8) === 0 ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+TurkishStemmer.prototype.r_mark_cAsInA$ = function () {
+ return (this.find_among_b$ALAmong$I(TurkishStemmer.a_19, 2) === 0 ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+TurkishStemmer.prototype.r_mark_yDU$ = function () {
+ return (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_20, 32) === 0 ? false : ! this.r_mark_suffix_with_optional_y_consonant$() ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+TurkishStemmer.prototype.r_mark_ysA$ = function () {
+ return (this.find_among_b$ALAmong$I(TurkishStemmer.a_21, 8) === 0 ? false : ! this.r_mark_suffix_with_optional_y_consonant$() ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+TurkishStemmer.prototype.r_mark_ymUs_$ = function () {
+ return (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_22, 4) === 0 ? false : ! this.r_mark_suffix_with_optional_y_consonant$() ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+TurkishStemmer.prototype.r_mark_yken$ = function () {
+ return (! this.eq_s_b$IS(3, "ken") ? false : ! this.r_mark_suffix_with_optional_y_consonant$() ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+TurkishStemmer.prototype.r_stem_nominal_verb_suffixes$ = function () {
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var v_3;
+ /** @type {!number} */
+ var v_4;
+ /** @type {!number} */
+ var v_5;
+ /** @type {!number} */
+ var v_6;
+ /** @type {!number} */
+ var v_7;
+ /** @type {!number} */
+ var v_8;
+ /** @type {!number} */
+ var v_9;
+ /** @type {!number} */
+ var v_10;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!boolean} */
+ var lab2;
+ /** @type {!boolean} */
+ var lab3;
+ /** @type {!boolean} */
+ var lab4;
+ /** @type {!boolean} */
+ var lab5;
+ /** @type {!boolean} */
+ var lab6;
+ /** @type {!boolean} */
+ var lab7;
+ /** @type {!boolean} */
+ var lab8;
+ /** @type {!boolean} */
+ var lab9;
+ /** @type {!boolean} */
+ var lab10;
+ /** @type {!boolean} */
+ var lab11;
+ /** @type {!boolean} */
+ var lab12;
+ /** @type {!boolean} */
+ var lab13;
+ /** @type {!boolean} */
+ var lab14;
+ /** @type {!boolean} */
+ var lab15;
+ /** @type {!boolean} */
+ var lab16;
+ /** @type {!boolean} */
+ var lab17;
+ /** @type {!boolean} */
+ var lab18;
+ /** @type {!boolean} */
+ var lab19;
+ /** @type {!boolean} */
+ var lab20;
+ /** @type {!boolean} */
+ var lab21;
+ /** @type {!boolean} */
+ var lab22;
+ /** @type {!boolean} */
+ var lab23;
+ /** @type {!boolean} */
+ var lab24;
+ /** @type {!boolean} */
+ var lab25;
+ /** @type {!boolean} */
+ var lab26;
+ /** @type {!boolean} */
+ var lab27;
+ /** @type {!boolean} */
+ var lab28;
+ /** @type {!boolean} */
+ var lab29;
+ /** @type {!boolean} */
+ var lab30;
+ /** @type {!boolean} */
+ var lab31;
+ /** @type {!boolean} */
+ var lab32;
+ /** @type {!boolean} */
+ var lab33;
+ /** @type {!boolean} */
+ var lab34;
+ this.ket = this.cursor;
+ this.B_continue_stemming_noun_suffixes = true;
+ lab0 = true;
+lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ v_1 = this.limit - this.cursor;
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ lab2 = true;
+ lab2:
+ while (lab2 === true) {
+ lab2 = false;
+ v_2 = this.limit - this.cursor;
+ lab3 = true;
+ lab3:
+ while (lab3 === true) {
+ lab3 = false;
+ if (! (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_22, 4) === 0 ? false : ! this.r_mark_suffix_with_optional_y_consonant$() ? false : true)) {
+ break lab3;
+ }
+ break lab2;
+ }
+ this.cursor = this.limit - v_2;
+ lab4 = true;
+ lab4:
+ while (lab4 === true) {
+ lab4 = false;
+ if (! (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_20, 32) === 0 ? false : ! this.r_mark_suffix_with_optional_y_consonant$() ? false : true)) {
+ break lab4;
+ }
+ break lab2;
+ }
+ this.cursor = this.limit - v_2;
+ lab5 = true;
+ lab5:
+ while (lab5 === true) {
+ lab5 = false;
+ if (! (this.find_among_b$ALAmong$I(TurkishStemmer.a_21, 8) === 0 ? false : ! this.r_mark_suffix_with_optional_y_consonant$() ? false : true)) {
+ break lab5;
+ }
+ break lab2;
+ }
+ this.cursor = this.limit - v_2;
+ if (! (! this.eq_s_b$IS(3, "ken") ? false : ! this.r_mark_suffix_with_optional_y_consonant$() ? false : true)) {
+ break lab1;
+ }
+ }
+ break lab0;
+ }
+ this.cursor = this.limit - v_1;
+ lab6 = true;
+ lab6:
+ while (lab6 === true) {
+ lab6 = false;
+ if (! (this.find_among_b$ALAmong$I(TurkishStemmer.a_19, 2) === 0 ? false : true)) {
+ break lab6;
+ }
+ lab7 = true;
+ lab7:
+ while (lab7 === true) {
+ lab7 = false;
+ v_3 = this.limit - this.cursor;
+ lab8 = true;
+ lab8:
+ while (lab8 === true) {
+ lab8 = false;
+ if (! (this.find_among_b$ALAmong$I(TurkishStemmer.a_15, 4) === 0 ? false : true)) {
+ break lab8;
+ }
+ break lab7;
+ }
+ this.cursor = this.limit - v_3;
+ lab9 = true;
+ lab9:
+ while (lab9 === true) {
+ lab9 = false;
+ if (! (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_16, 2) === 0 ? false : true)) {
+ break lab9;
+ }
+ break lab7;
+ }
+ this.cursor = this.limit - v_3;
+ lab10 = true;
+ lab10:
+ while (lab10 === true) {
+ lab10 = false;
+ if (! (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_12, 4) === 0 ? false : ! this.r_mark_suffix_with_optional_y_consonant$() ? false : true)) {
+ break lab10;
+ }
+ break lab7;
+ }
+ this.cursor = this.limit - v_3;
+ lab11 = true;
+ lab11:
+ while (lab11 === true) {
+ lab11 = false;
+ if (! (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_13, 4) === 0 ? false : true)) {
+ break lab11;
+ }
+ break lab7;
+ }
+ this.cursor = this.limit - v_3;
+ lab12 = true;
+ lab12:
+ while (lab12 === true) {
+ lab12 = false;
+ if (! (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_14, 4) === 0 ? false : ! this.r_mark_suffix_with_optional_y_consonant$() ? false : true)) {
+ break lab12;
+ }
+ break lab7;
+ }
+ this.cursor = this.limit - v_3;
+ }
+ if (! (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_22, 4) === 0 ? false : ! this.r_mark_suffix_with_optional_y_consonant$() ? false : true)) {
+ break lab6;
+ }
+ break lab0;
+ }
+ this.cursor = this.limit - v_1;
+ lab13 = true;
+ lab13:
+ while (lab13 === true) {
+ lab13 = false;
+ if (! (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_16, 2) === 0 ? false : true)) {
+ break lab13;
+ }
+ this.bra = this.cursor;
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ v_4 = this.limit - this.cursor;
+ lab14 = true;
+ lab14:
+ while (lab14 === true) {
+ lab14 = false;
+ this.ket = this.cursor;
+ lab15 = true;
+ lab15:
+ while (lab15 === true) {
+ lab15 = false;
+ v_5 = this.limit - this.cursor;
+ lab16 = true;
+ lab16:
+ while (lab16 === true) {
+ lab16 = false;
+ if (! (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_18, 8) === 0 ? false : true)) {
+ break lab16;
+ }
+ break lab15;
+ }
+ this.cursor = this.limit - v_5;
+ lab17 = true;
+ lab17:
+ while (lab17 === true) {
+ lab17 = false;
+ if (! (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_20, 32) === 0 ? false : ! this.r_mark_suffix_with_optional_y_consonant$() ? false : true)) {
+ break lab17;
+ }
+ break lab15;
+ }
+ this.cursor = this.limit - v_5;
+ lab18 = true;
+ lab18:
+ while (lab18 === true) {
+ lab18 = false;
+ if (! (this.find_among_b$ALAmong$I(TurkishStemmer.a_21, 8) === 0 ? false : ! this.r_mark_suffix_with_optional_y_consonant$() ? false : true)) {
+ break lab18;
+ }
+ break lab15;
+ }
+ this.cursor = this.limit - v_5;
+ if (! (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_22, 4) === 0 ? false : ! this.r_mark_suffix_with_optional_y_consonant$() ? false : true)) {
+ this.cursor = this.limit - v_4;
+ break lab14;
+ }
+ }
+ }
+ this.B_continue_stemming_noun_suffixes = false;
+ break lab0;
+ }
+ this.cursor = this.limit - v_1;
+ lab19 = true;
+ lab19:
+ while (lab19 === true) {
+ lab19 = false;
+ if (! (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_17, 4) === 0 ? false : true)) {
+ break lab19;
+ }
+ lab20 = true;
+ lab20:
+ while (lab20 === true) {
+ lab20 = false;
+ v_6 = this.limit - this.cursor;
+ lab21 = true;
+ lab21:
+ while (lab21 === true) {
+ lab21 = false;
+ if (! (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_20, 32) === 0 ? false : ! this.r_mark_suffix_with_optional_y_consonant$() ? false : true)) {
+ break lab21;
+ }
+ break lab20;
+ }
+ this.cursor = this.limit - v_6;
+ if (! (this.find_among_b$ALAmong$I(TurkishStemmer.a_21, 8) === 0 ? false : ! this.r_mark_suffix_with_optional_y_consonant$() ? false : true)) {
+ break lab19;
+ }
+ }
+ break lab0;
+ }
+ this.cursor = this.limit - v_1;
+ lab22 = true;
+ lab22:
+ while (lab22 === true) {
+ lab22 = false;
+ lab23 = true;
+ lab23:
+ while (lab23 === true) {
+ lab23 = false;
+ v_7 = this.limit - this.cursor;
+ lab24 = true;
+ lab24:
+ while (lab24 === true) {
+ lab24 = false;
+ if (! (this.find_among_b$ALAmong$I(TurkishStemmer.a_15, 4) === 0 ? false : true)) {
+ break lab24;
+ }
+ break lab23;
+ }
+ this.cursor = this.limit - v_7;
+ lab25 = true;
+ lab25:
+ while (lab25 === true) {
+ lab25 = false;
+ if (! (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_14, 4) === 0 ? false : ! this.r_mark_suffix_with_optional_y_consonant$() ? false : true)) {
+ break lab25;
+ }
+ break lab23;
+ }
+ this.cursor = this.limit - v_7;
+ lab26 = true;
+ lab26:
+ while (lab26 === true) {
+ lab26 = false;
+ if (! (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_13, 4) === 0 ? false : true)) {
+ break lab26;
+ }
+ break lab23;
+ }
+ this.cursor = this.limit - v_7;
+ if (! (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_12, 4) === 0 ? false : ! this.r_mark_suffix_with_optional_y_consonant$() ? false : true)) {
+ break lab22;
+ }
+ }
+ this.bra = this.cursor;
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ v_8 = this.limit - this.cursor;
+ lab27 = true;
+ lab27:
+ while (lab27 === true) {
+ lab27 = false;
+ this.ket = this.cursor;
+ if (! (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_22, 4) === 0 ? false : ! this.r_mark_suffix_with_optional_y_consonant$() ? false : true)) {
+ this.cursor = this.limit - v_8;
+ break lab27;
+ }
+ }
+ break lab0;
+ }
+ this.cursor = this.limit - v_1;
+ if (! (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_18, 8) === 0 ? false : true)) {
+ return false;
+ }
+ this.bra = this.cursor;
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ v_9 = this.limit - this.cursor;
+ lab28 = true;
+ lab28:
+ while (lab28 === true) {
+ lab28 = false;
+ this.ket = this.cursor;
+ lab29 = true;
+ lab29:
+ while (lab29 === true) {
+ lab29 = false;
+ v_10 = this.limit - this.cursor;
+ lab30 = true;
+ lab30:
+ while (lab30 === true) {
+ lab30 = false;
+ if (! (this.find_among_b$ALAmong$I(TurkishStemmer.a_15, 4) === 0 ? false : true)) {
+ break lab30;
+ }
+ break lab29;
+ }
+ this.cursor = this.limit - v_10;
+ lab31 = true;
+ lab31:
+ while (lab31 === true) {
+ lab31 = false;
+ if (! (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_16, 2) === 0 ? false : true)) {
+ break lab31;
+ }
+ break lab29;
+ }
+ this.cursor = this.limit - v_10;
+ lab32 = true;
+ lab32:
+ while (lab32 === true) {
+ lab32 = false;
+ if (! (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_12, 4) === 0 ? false : ! this.r_mark_suffix_with_optional_y_consonant$() ? false : true)) {
+ break lab32;
+ }
+ break lab29;
+ }
+ this.cursor = this.limit - v_10;
+ lab33 = true;
+ lab33:
+ while (lab33 === true) {
+ lab33 = false;
+ if (! (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_13, 4) === 0 ? false : true)) {
+ break lab33;
+ }
+ break lab29;
+ }
+ this.cursor = this.limit - v_10;
+ lab34 = true;
+ lab34:
+ while (lab34 === true) {
+ lab34 = false;
+ if (! (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_14, 4) === 0 ? false : ! this.r_mark_suffix_with_optional_y_consonant$() ? false : true)) {
+ break lab34;
+ }
+ break lab29;
+ }
+ this.cursor = this.limit - v_10;
+ }
+ if (! (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_22, 4) === 0 ? false : ! this.r_mark_suffix_with_optional_y_consonant$() ? false : true)) {
+ this.cursor = this.limit - v_9;
+ break lab28;
+ }
+ }
+ }
+ this.bra = this.cursor;
+ return (! this.slice_from$S("") ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+TurkishStemmer.prototype.r_stem_suffix_chain_before_ki$ = function () {
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var v_3;
+ /** @type {!number} */
+ var v_4;
+ /** @type {!number} */
+ var v_5;
+ /** @type {!number} */
+ var v_6;
+ /** @type {!number} */
+ var v_7;
+ /** @type {!number} */
+ var v_8;
+ /** @type {!number} */
+ var v_9;
+ /** @type {!number} */
+ var v_10;
+ /** @type {!number} */
+ var v_11;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!boolean} */
+ var lab2;
+ /** @type {!boolean} */
+ var lab3;
+ /** @type {!boolean} */
+ var lab4;
+ /** @type {!boolean} */
+ var lab5;
+ /** @type {!boolean} */
+ var lab6;
+ /** @type {!boolean} */
+ var lab7;
+ /** @type {!boolean} */
+ var lab8;
+ /** @type {!boolean} */
+ var lab9;
+ /** @type {!boolean} */
+ var lab10;
+ /** @type {!boolean} */
+ var lab11;
+ /** @type {!boolean} */
+ var lab12;
+ /** @type {!boolean} */
+ var lab13;
+ /** @type {!boolean} */
+ var lab14;
+ /** @type {!boolean} */
+ var lab15;
+ /** @type {!boolean} */
+ var lab16;
+ /** @type {!boolean} */
+ var lab17;
+ /** @type {!boolean} */
+ var lab18;
+ this.ket = this.cursor;
+ if (! (! this.eq_s_b$IS(2, "ki") ? false : true)) {
+ return false;
+ }
+ lab0 = true;
+lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ v_1 = this.limit - this.cursor;
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ if (! (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_6, 4) === 0 ? false : true)) {
+ break lab1;
+ }
+ this.bra = this.cursor;
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ v_2 = this.limit - this.cursor;
+ lab2 = true;
+ lab2:
+ while (lab2 === true) {
+ lab2 = false;
+ this.ket = this.cursor;
+ lab3 = true;
+ lab3:
+ while (lab3 === true) {
+ lab3 = false;
+ v_3 = this.limit - this.cursor;
+ lab4 = true;
+ lab4:
+ while (lab4 === true) {
+ lab4 = false;
+ if (! (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_16, 2) === 0 ? false : true)) {
+ break lab4;
+ }
+ this.bra = this.cursor;
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ v_4 = this.limit - this.cursor;
+ lab5 = true;
+ lab5:
+ while (lab5 === true) {
+ lab5 = false;
+ if (! this.r_stem_suffix_chain_before_ki$()) {
+ this.cursor = this.limit - v_4;
+ break lab5;
+ }
+ }
+ break lab3;
+ }
+ this.cursor = this.limit - v_3;
+ if (! (this.find_among_b$ALAmong$I(TurkishStemmer.a_0, 10) === 0 ? false : ! this.r_mark_suffix_with_optional_U_vowel$() ? false : true)) {
+ this.cursor = this.limit - v_2;
+ break lab2;
+ }
+ this.bra = this.cursor;
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ v_5 = this.limit - this.cursor;
+ lab6 = true;
+ lab6:
+ while (lab6 === true) {
+ lab6 = false;
+ this.ket = this.cursor;
+ if (! (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_16, 2) === 0 ? false : true)) {
+ this.cursor = this.limit - v_5;
+ break lab6;
+ }
+ this.bra = this.cursor;
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ if (! this.r_stem_suffix_chain_before_ki$()) {
+ this.cursor = this.limit - v_5;
+ break lab6;
+ }
+ }
+ }
+ }
+ break lab0;
+ }
+ this.cursor = this.limit - v_1;
+ lab7 = true;
+ lab7:
+ while (lab7 === true) {
+ lab7 = false;
+ if (! (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_3, 4) === 0 ? false : ! this.r_mark_suffix_with_optional_n_consonant$() ? false : true)) {
+ break lab7;
+ }
+ this.bra = this.cursor;
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ v_6 = this.limit - this.cursor;
+ lab8 = true;
+ lab8:
+ while (lab8 === true) {
+ lab8 = false;
+ this.ket = this.cursor;
+ lab9 = true;
+ lab9:
+ while (lab9 === true) {
+ lab9 = false;
+ v_7 = this.limit - this.cursor;
+ lab10 = true;
+ lab10:
+ while (lab10 === true) {
+ lab10 = false;
+ if (! (this.find_among_b$ALAmong$I(TurkishStemmer.a_1, 2) === 0 ? false : true)) {
+ break lab10;
+ }
+ this.bra = this.cursor;
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break lab9;
+ }
+ this.cursor = this.limit - v_7;
+ lab11 = true;
+ lab11:
+ while (lab11 === true) {
+ lab11 = false;
+ this.ket = this.cursor;
+ lab12 = true;
+ lab12:
+ while (lab12 === true) {
+ lab12 = false;
+ v_8 = this.limit - this.cursor;
+ lab13 = true;
+ lab13:
+ while (lab13 === true) {
+ lab13 = false;
+ if (! (this.find_among_b$ALAmong$I(TurkishStemmer.a_0, 10) === 0 ? false : ! this.r_mark_suffix_with_optional_U_vowel$() ? false : true)) {
+ break lab13;
+ }
+ break lab12;
+ }
+ this.cursor = this.limit - v_8;
+ if (! (! this.r_check_vowel_harmony$() ? false : ! this.in_grouping_b$AIII(TurkishStemmer.g_U, 105, 305) ? false : ! this.r_mark_suffix_with_optional_s_consonant$() ? false : true)) {
+ break lab11;
+ }
+ }
+ this.bra = this.cursor;
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ v_9 = this.limit - this.cursor;
+ lab14 = true;
+ lab14:
+ while (lab14 === true) {
+ lab14 = false;
+ this.ket = this.cursor;
+ if (! (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_16, 2) === 0 ? false : true)) {
+ this.cursor = this.limit - v_9;
+ break lab14;
+ }
+ this.bra = this.cursor;
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ if (! this.r_stem_suffix_chain_before_ki$()) {
+ this.cursor = this.limit - v_9;
+ break lab14;
+ }
+ }
+ break lab9;
+ }
+ this.cursor = this.limit - v_7;
+ if (! this.r_stem_suffix_chain_before_ki$()) {
+ this.cursor = this.limit - v_6;
+ break lab8;
+ }
+ }
+ }
+ break lab0;
+ }
+ this.cursor = this.limit - v_1;
+ if (! (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_7, 2) === 0 ? false : true)) {
+ return false;
+ }
+ lab15 = true;
+ lab15:
+ while (lab15 === true) {
+ lab15 = false;
+ v_10 = this.limit - this.cursor;
+ lab16 = true;
+ lab16:
+ while (lab16 === true) {
+ lab16 = false;
+ if (! (this.find_among_b$ALAmong$I(TurkishStemmer.a_1, 2) === 0 ? false : true)) {
+ break lab16;
+ }
+ this.bra = this.cursor;
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break lab15;
+ }
+ this.cursor = this.limit - v_10;
+ lab17 = true;
+ lab17:
+ while (lab17 === true) {
+ lab17 = false;
+ if (! (! this.r_check_vowel_harmony$() ? false : ! this.in_grouping_b$AIII(TurkishStemmer.g_U, 105, 305) ? false : ! this.r_mark_suffix_with_optional_s_consonant$() ? false : true)) {
+ break lab17;
+ }
+ this.bra = this.cursor;
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ v_11 = this.limit - this.cursor;
+ lab18 = true;
+ lab18:
+ while (lab18 === true) {
+ lab18 = false;
+ this.ket = this.cursor;
+ if (! (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_16, 2) === 0 ? false : true)) {
+ this.cursor = this.limit - v_11;
+ break lab18;
+ }
+ this.bra = this.cursor;
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ if (! this.r_stem_suffix_chain_before_ki$()) {
+ this.cursor = this.limit - v_11;
+ break lab18;
+ }
+ }
+ break lab15;
+ }
+ this.cursor = this.limit - v_10;
+ if (! this.r_stem_suffix_chain_before_ki$()) {
+ return false;
+ }
+ }
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+TurkishStemmer.prototype.r_stem_noun_suffixes$ = function () {
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var v_3;
+ /** @type {!number} */
+ var v_4;
+ /** @type {!number} */
+ var v_5;
+ /** @type {!number} */
+ var v_6;
+ /** @type {!number} */
+ var v_7;
+ /** @type {!number} */
+ var v_8;
+ /** @type {!number} */
+ var v_9;
+ /** @type {!number} */
+ var v_10;
+ /** @type {!number} */
+ var v_11;
+ /** @type {!number} */
+ var v_12;
+ /** @type {!number} */
+ var v_13;
+ /** @type {!number} */
+ var v_14;
+ /** @type {!number} */
+ var v_15;
+ /** @type {!number} */
+ var v_16;
+ /** @type {!number} */
+ var v_17;
+ /** @type {!number} */
+ var v_18;
+ /** @type {!number} */
+ var v_19;
+ /** @type {!number} */
+ var v_20;
+ /** @type {!number} */
+ var v_21;
+ /** @type {!number} */
+ var v_22;
+ /** @type {!number} */
+ var v_23;
+ /** @type {!number} */
+ var v_24;
+ /** @type {!number} */
+ var v_25;
+ /** @type {!number} */
+ var v_26;
+ /** @type {!number} */
+ var v_27;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!boolean} */
+ var lab2;
+ /** @type {!boolean} */
+ var lab3;
+ /** @type {!boolean} */
+ var lab4;
+ /** @type {!boolean} */
+ var lab5;
+ /** @type {!boolean} */
+ var lab6;
+ /** @type {!boolean} */
+ var lab7;
+ /** @type {!boolean} */
+ var lab8;
+ /** @type {!boolean} */
+ var lab9;
+ /** @type {!boolean} */
+ var lab10;
+ /** @type {!boolean} */
+ var lab11;
+ /** @type {!boolean} */
+ var lab12;
+ /** @type {!boolean} */
+ var lab13;
+ /** @type {!boolean} */
+ var lab14;
+ /** @type {!boolean} */
+ var lab15;
+ /** @type {!boolean} */
+ var lab16;
+ /** @type {!boolean} */
+ var lab17;
+ /** @type {!boolean} */
+ var lab18;
+ /** @type {!boolean} */
+ var lab19;
+ /** @type {!boolean} */
+ var lab20;
+ /** @type {!boolean} */
+ var lab21;
+ /** @type {!boolean} */
+ var lab22;
+ /** @type {!boolean} */
+ var lab23;
+ /** @type {!boolean} */
+ var lab24;
+ /** @type {!boolean} */
+ var lab25;
+ /** @type {!boolean} */
+ var lab26;
+ /** @type {!boolean} */
+ var lab27;
+ /** @type {!boolean} */
+ var lab28;
+ /** @type {!boolean} */
+ var lab29;
+ /** @type {!boolean} */
+ var lab30;
+ /** @type {!boolean} */
+ var lab31;
+ /** @type {!boolean} */
+ var lab32;
+ /** @type {!boolean} */
+ var lab33;
+ /** @type {!boolean} */
+ var lab34;
+ /** @type {!boolean} */
+ var lab35;
+ /** @type {!boolean} */
+ var lab36;
+ /** @type {!boolean} */
+ var lab37;
+ /** @type {!boolean} */
+ var lab38;
+ /** @type {!boolean} */
+ var lab39;
+ /** @type {!boolean} */
+ var lab40;
+ /** @type {!boolean} */
+ var lab41;
+ /** @type {!boolean} */
+ var lab42;
+ /** @type {!boolean} */
+ var lab43;
+ /** @type {!boolean} */
+ var lab44;
+ /** @type {!boolean} */
+ var lab45;
+ /** @type {!boolean} */
+ var lab46;
+ /** @type {!boolean} */
+ var lab47;
+ /** @type {!boolean} */
+ var lab48;
+ /** @type {!boolean} */
+ var lab49;
+ /** @type {!boolean} */
+ var lab50;
+ /** @type {!boolean} */
+ var lab51;
+ /** @type {!boolean} */
+ var lab52;
+ /** @type {!boolean} */
+ var lab53;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var cursor$1;
+ lab0 = true;
+lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ v_1 = this.limit - this.cursor;
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ this.ket = this.cursor;
+ if (! (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_16, 2) === 0 ? false : true)) {
+ break lab1;
+ }
+ this.bra = this.cursor;
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ v_2 = this.limit - this.cursor;
+ lab2 = true;
+ lab2:
+ while (lab2 === true) {
+ lab2 = false;
+ if (! this.r_stem_suffix_chain_before_ki$()) {
+ this.cursor = this.limit - v_2;
+ break lab2;
+ }
+ }
+ break lab0;
+ }
+ this.cursor = this.limit - v_1;
+ lab3 = true;
+ lab3:
+ while (lab3 === true) {
+ lab3 = false;
+ this.ket = this.cursor;
+ if (! (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_11, 2) === 0 ? false : ! this.r_mark_suffix_with_optional_n_consonant$() ? false : true)) {
+ break lab3;
+ }
+ this.bra = this.cursor;
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ v_3 = this.limit - this.cursor;
+ lab4 = true;
+ lab4:
+ while (lab4 === true) {
+ lab4 = false;
+ lab5 = true;
+ lab5:
+ while (lab5 === true) {
+ lab5 = false;
+ v_4 = this.limit - this.cursor;
+ lab6 = true;
+ lab6:
+ while (lab6 === true) {
+ lab6 = false;
+ this.ket = this.cursor;
+ if (! (this.find_among_b$ALAmong$I(TurkishStemmer.a_1, 2) === 0 ? false : true)) {
+ break lab6;
+ }
+ this.bra = this.cursor;
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break lab5;
+ }
+ this.cursor = this.limit - v_4;
+ lab7 = true;
+ lab7:
+ while (lab7 === true) {
+ lab7 = false;
+ this.ket = this.cursor;
+ lab8 = true;
+ lab8:
+ while (lab8 === true) {
+ lab8 = false;
+ v_5 = this.limit - this.cursor;
+ lab9 = true;
+ lab9:
+ while (lab9 === true) {
+ lab9 = false;
+ if (! (this.find_among_b$ALAmong$I(TurkishStemmer.a_0, 10) === 0 ? false : ! this.r_mark_suffix_with_optional_U_vowel$() ? false : true)) {
+ break lab9;
+ }
+ break lab8;
+ }
+ this.cursor = this.limit - v_5;
+ if (! (! this.r_check_vowel_harmony$() ? false : ! this.in_grouping_b$AIII(TurkishStemmer.g_U, 105, 305) ? false : ! this.r_mark_suffix_with_optional_s_consonant$() ? false : true)) {
+ break lab7;
+ }
+ }
+ this.bra = this.cursor;
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ v_6 = this.limit - this.cursor;
+ lab10 = true;
+ lab10:
+ while (lab10 === true) {
+ lab10 = false;
+ this.ket = this.cursor;
+ if (! (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_16, 2) === 0 ? false : true)) {
+ this.cursor = this.limit - v_6;
+ break lab10;
+ }
+ this.bra = this.cursor;
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ if (! this.r_stem_suffix_chain_before_ki$()) {
+ this.cursor = this.limit - v_6;
+ break lab10;
+ }
+ }
+ break lab5;
+ }
+ cursor$0 = this.cursor = this.limit - v_4;
+ this.ket = cursor$0;
+ if (! (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_16, 2) === 0 ? false : true)) {
+ this.cursor = this.limit - v_3;
+ break lab4;
+ }
+ this.bra = this.cursor;
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ if (! this.r_stem_suffix_chain_before_ki$()) {
+ this.cursor = this.limit - v_3;
+ break lab4;
+ }
+ }
+ }
+ break lab0;
+ }
+ this.cursor = this.limit - v_1;
+ lab11 = true;
+ lab11:
+ while (lab11 === true) {
+ lab11 = false;
+ this.ket = this.cursor;
+ lab12 = true;
+ lab12:
+ while (lab12 === true) {
+ lab12 = false;
+ v_7 = this.limit - this.cursor;
+ lab13 = true;
+ lab13:
+ while (lab13 === true) {
+ lab13 = false;
+ if (! (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_7, 2) === 0 ? false : true)) {
+ break lab13;
+ }
+ break lab12;
+ }
+ this.cursor = this.limit - v_7;
+ if (! (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_5, 2) === 0 ? false : true)) {
+ break lab11;
+ }
+ }
+ lab14 = true;
+ lab14:
+ while (lab14 === true) {
+ lab14 = false;
+ v_8 = this.limit - this.cursor;
+ lab15 = true;
+ lab15:
+ while (lab15 === true) {
+ lab15 = false;
+ if (! (this.find_among_b$ALAmong$I(TurkishStemmer.a_1, 2) === 0 ? false : true)) {
+ break lab15;
+ }
+ this.bra = this.cursor;
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break lab14;
+ }
+ this.cursor = this.limit - v_8;
+ lab16 = true;
+ lab16:
+ while (lab16 === true) {
+ lab16 = false;
+ if (! (! this.r_check_vowel_harmony$() ? false : ! this.in_grouping_b$AIII(TurkishStemmer.g_U, 105, 305) ? false : ! this.r_mark_suffix_with_optional_s_consonant$() ? false : true)) {
+ break lab16;
+ }
+ this.bra = this.cursor;
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ v_9 = this.limit - this.cursor;
+ lab17 = true;
+ lab17:
+ while (lab17 === true) {
+ lab17 = false;
+ this.ket = this.cursor;
+ if (! (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_16, 2) === 0 ? false : true)) {
+ this.cursor = this.limit - v_9;
+ break lab17;
+ }
+ this.bra = this.cursor;
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ if (! this.r_stem_suffix_chain_before_ki$()) {
+ this.cursor = this.limit - v_9;
+ break lab17;
+ }
+ }
+ break lab14;
+ }
+ this.cursor = this.limit - v_8;
+ if (! this.r_stem_suffix_chain_before_ki$()) {
+ break lab11;
+ }
+ }
+ break lab0;
+ }
+ this.cursor = this.limit - v_1;
+ lab18 = true;
+ lab18:
+ while (lab18 === true) {
+ lab18 = false;
+ this.ket = this.cursor;
+ lab19 = true;
+ lab19:
+ while (lab19 === true) {
+ lab19 = false;
+ v_10 = this.limit - this.cursor;
+ lab20 = true;
+ lab20:
+ while (lab20 === true) {
+ lab20 = false;
+ if (! (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_9, 2) === 0 ? false : true)) {
+ break lab20;
+ }
+ break lab19;
+ }
+ this.cursor = this.limit - v_10;
+ if (! (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_2, 4) === 0 ? false : true)) {
+ break lab18;
+ }
+ }
+ lab21 = true;
+ lab21:
+ while (lab21 === true) {
+ lab21 = false;
+ v_11 = this.limit - this.cursor;
+ lab22 = true;
+ lab22:
+ while (lab22 === true) {
+ lab22 = false;
+ if (! (! this.r_check_vowel_harmony$() ? false : ! this.in_grouping_b$AIII(TurkishStemmer.g_U, 105, 305) ? false : ! this.r_mark_suffix_with_optional_s_consonant$() ? false : true)) {
+ break lab22;
+ }
+ this.bra = this.cursor;
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ v_12 = this.limit - this.cursor;
+ lab23 = true;
+ lab23:
+ while (lab23 === true) {
+ lab23 = false;
+ this.ket = this.cursor;
+ if (! (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_16, 2) === 0 ? false : true)) {
+ this.cursor = this.limit - v_12;
+ break lab23;
+ }
+ this.bra = this.cursor;
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ if (! this.r_stem_suffix_chain_before_ki$()) {
+ this.cursor = this.limit - v_12;
+ break lab23;
+ }
+ }
+ break lab21;
+ }
+ this.cursor = this.limit - v_11;
+ if (! (this.find_among_b$ALAmong$I(TurkishStemmer.a_1, 2) === 0 ? false : true)) {
+ break lab18;
+ }
+ }
+ break lab0;
+ }
+ this.cursor = this.limit - v_1;
+ lab24 = true;
+ lab24:
+ while (lab24 === true) {
+ lab24 = false;
+ this.ket = this.cursor;
+ if (! (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_8, 4) === 0 ? false : true)) {
+ break lab24;
+ }
+ this.bra = this.cursor;
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ v_13 = this.limit - this.cursor;
+ lab25 = true;
+ lab25:
+ while (lab25 === true) {
+ lab25 = false;
+ this.ket = this.cursor;
+ lab26 = true;
+ lab26:
+ while (lab26 === true) {
+ lab26 = false;
+ v_14 = this.limit - this.cursor;
+ lab27 = true;
+ lab27:
+ while (lab27 === true) {
+ lab27 = false;
+ if (! (this.find_among_b$ALAmong$I(TurkishStemmer.a_0, 10) === 0 ? false : ! this.r_mark_suffix_with_optional_U_vowel$() ? false : true)) {
+ break lab27;
+ }
+ this.bra = this.cursor;
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ v_15 = this.limit - this.cursor;
+ lab28 = true;
+ lab28:
+ while (lab28 === true) {
+ lab28 = false;
+ this.ket = this.cursor;
+ if (! (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_16, 2) === 0 ? false : true)) {
+ this.cursor = this.limit - v_15;
+ break lab28;
+ }
+ this.bra = this.cursor;
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ if (! this.r_stem_suffix_chain_before_ki$()) {
+ this.cursor = this.limit - v_15;
+ break lab28;
+ }
+ }
+ break lab26;
+ }
+ this.cursor = this.limit - v_14;
+ lab29 = true;
+ lab29:
+ while (lab29 === true) {
+ lab29 = false;
+ if (! (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_16, 2) === 0 ? false : true)) {
+ break lab29;
+ }
+ this.bra = this.cursor;
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ v_16 = this.limit - this.cursor;
+ lab30 = true;
+ lab30:
+ while (lab30 === true) {
+ lab30 = false;
+ if (! this.r_stem_suffix_chain_before_ki$()) {
+ this.cursor = this.limit - v_16;
+ break lab30;
+ }
+ }
+ break lab26;
+ }
+ this.cursor = this.limit - v_14;
+ if (! this.r_stem_suffix_chain_before_ki$()) {
+ this.cursor = this.limit - v_13;
+ break lab25;
+ }
+ }
+ }
+ break lab0;
+ }
+ this.cursor = this.limit - v_1;
+ lab31 = true;
+ lab31:
+ while (lab31 === true) {
+ lab31 = false;
+ this.ket = this.cursor;
+ lab32 = true;
+ lab32:
+ while (lab32 === true) {
+ lab32 = false;
+ v_17 = this.limit - this.cursor;
+ lab33 = true;
+ lab33:
+ while (lab33 === true) {
+ lab33 = false;
+ if (! (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_3, 4) === 0 ? false : ! this.r_mark_suffix_with_optional_n_consonant$() ? false : true)) {
+ break lab33;
+ }
+ break lab32;
+ }
+ this.cursor = this.limit - v_17;
+ if (! (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_10, 2) === 0 ? false : ! this.r_mark_suffix_with_optional_y_consonant$() ? false : true)) {
+ break lab31;
+ }
+ }
+ this.bra = this.cursor;
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ v_18 = this.limit - this.cursor;
+ lab34 = true;
+ lab34:
+ while (lab34 === true) {
+ lab34 = false;
+ lab35 = true;
+ lab35:
+ while (lab35 === true) {
+ lab35 = false;
+ v_19 = this.limit - this.cursor;
+ lab36 = true;
+ lab36:
+ while (lab36 === true) {
+ lab36 = false;
+ this.ket = this.cursor;
+ if (! (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_16, 2) === 0 ? false : true)) {
+ break lab36;
+ }
+ this.bra = this.cursor;
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ if (! this.r_stem_suffix_chain_before_ki$()) {
+ break lab36;
+ }
+ break lab35;
+ }
+ this.cursor = this.limit - v_19;
+ lab37 = true;
+ lab37:
+ while (lab37 === true) {
+ lab37 = false;
+ this.ket = this.cursor;
+ lab38 = true;
+ lab38:
+ while (lab38 === true) {
+ lab38 = false;
+ v_20 = this.limit - this.cursor;
+ lab39 = true;
+ lab39:
+ while (lab39 === true) {
+ lab39 = false;
+ if (! (this.find_among_b$ALAmong$I(TurkishStemmer.a_0, 10) === 0 ? false : ! this.r_mark_suffix_with_optional_U_vowel$() ? false : true)) {
+ break lab39;
+ }
+ break lab38;
+ }
+ this.cursor = this.limit - v_20;
+ if (! (! this.r_check_vowel_harmony$() ? false : ! this.in_grouping_b$AIII(TurkishStemmer.g_U, 105, 305) ? false : ! this.r_mark_suffix_with_optional_s_consonant$() ? false : true)) {
+ break lab37;
+ }
+ }
+ this.bra = this.cursor;
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ v_21 = this.limit - this.cursor;
+ lab40 = true;
+ lab40:
+ while (lab40 === true) {
+ lab40 = false;
+ this.ket = this.cursor;
+ if (! (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_16, 2) === 0 ? false : true)) {
+ this.cursor = this.limit - v_21;
+ break lab40;
+ }
+ this.bra = this.cursor;
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ if (! this.r_stem_suffix_chain_before_ki$()) {
+ this.cursor = this.limit - v_21;
+ break lab40;
+ }
+ }
+ break lab35;
+ }
+ this.cursor = this.limit - v_19;
+ if (! this.r_stem_suffix_chain_before_ki$()) {
+ this.cursor = this.limit - v_18;
+ break lab34;
+ }
+ }
+ }
+ break lab0;
+ }
+ this.cursor = this.limit - v_1;
+ lab41 = true;
+ lab41:
+ while (lab41 === true) {
+ lab41 = false;
+ this.ket = this.cursor;
+ if (! (this.find_among_b$ALAmong$I(TurkishStemmer.a_1, 2) === 0 ? false : true)) {
+ break lab41;
+ }
+ this.bra = this.cursor;
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break lab0;
+ }
+ this.cursor = this.limit - v_1;
+ lab42 = true;
+ lab42:
+ while (lab42 === true) {
+ lab42 = false;
+ if (! this.r_stem_suffix_chain_before_ki$()) {
+ break lab42;
+ }
+ break lab0;
+ }
+ this.cursor = this.limit - v_1;
+ lab43 = true;
+ lab43:
+ while (lab43 === true) {
+ lab43 = false;
+ this.ket = this.cursor;
+ lab44 = true;
+ lab44:
+ while (lab44 === true) {
+ lab44 = false;
+ v_22 = this.limit - this.cursor;
+ lab45 = true;
+ lab45:
+ while (lab45 === true) {
+ lab45 = false;
+ if (! (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_6, 4) === 0 ? false : true)) {
+ break lab45;
+ }
+ break lab44;
+ }
+ this.cursor = this.limit - v_22;
+ lab46 = true;
+ lab46:
+ while (lab46 === true) {
+ lab46 = false;
+ if (! (! this.r_check_vowel_harmony$() ? false : ! this.in_grouping_b$AIII(TurkishStemmer.g_U, 105, 305) ? false : ! this.r_mark_suffix_with_optional_y_consonant$() ? false : true)) {
+ break lab46;
+ }
+ break lab44;
+ }
+ this.cursor = this.limit - v_22;
+ if (! (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_4, 2) === 0 ? false : ! this.r_mark_suffix_with_optional_y_consonant$() ? false : true)) {
+ break lab43;
+ }
+ }
+ this.bra = this.cursor;
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ v_23 = this.limit - this.cursor;
+ lab47 = true;
+ lab47:
+ while (lab47 === true) {
+ lab47 = false;
+ this.ket = this.cursor;
+ lab48 = true;
+ lab48:
+ while (lab48 === true) {
+ lab48 = false;
+ v_24 = this.limit - this.cursor;
+ lab49 = true;
+ lab49:
+ while (lab49 === true) {
+ lab49 = false;
+ if (! (this.find_among_b$ALAmong$I(TurkishStemmer.a_0, 10) === 0 ? false : ! this.r_mark_suffix_with_optional_U_vowel$() ? false : true)) {
+ break lab49;
+ }
+ this.bra = this.cursor;
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ v_25 = this.limit - this.cursor;
+ lab50 = true;
+ lab50:
+ while (lab50 === true) {
+ lab50 = false;
+ this.ket = this.cursor;
+ if (! (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_16, 2) === 0 ? false : true)) {
+ this.cursor = this.limit - v_25;
+ break lab50;
+ }
+ }
+ break lab48;
+ }
+ this.cursor = this.limit - v_24;
+ if (! (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_16, 2) === 0 ? false : true)) {
+ this.cursor = this.limit - v_23;
+ break lab47;
+ }
+ }
+ this.bra = this.cursor;
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ this.ket = this.cursor;
+ if (! this.r_stem_suffix_chain_before_ki$()) {
+ this.cursor = this.limit - v_23;
+ break lab47;
+ }
+ }
+ break lab0;
+ }
+ cursor$1 = this.cursor = this.limit - v_1;
+ this.ket = cursor$1;
+ lab51 = true;
+ lab51:
+ while (lab51 === true) {
+ lab51 = false;
+ v_26 = this.limit - this.cursor;
+ lab52 = true;
+ lab52:
+ while (lab52 === true) {
+ lab52 = false;
+ if (! (this.find_among_b$ALAmong$I(TurkishStemmer.a_0, 10) === 0 ? false : ! this.r_mark_suffix_with_optional_U_vowel$() ? false : true)) {
+ break lab52;
+ }
+ break lab51;
+ }
+ this.cursor = this.limit - v_26;
+ if (! (! this.r_check_vowel_harmony$() ? false : ! this.in_grouping_b$AIII(TurkishStemmer.g_U, 105, 305) ? false : ! this.r_mark_suffix_with_optional_s_consonant$() ? false : true)) {
+ return false;
+ }
+ }
+ this.bra = this.cursor;
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ v_27 = this.limit - this.cursor;
+ lab53 = true;
+ lab53:
+ while (lab53 === true) {
+ lab53 = false;
+ this.ket = this.cursor;
+ if (! (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_16, 2) === 0 ? false : true)) {
+ this.cursor = this.limit - v_27;
+ break lab53;
+ }
+ this.bra = this.cursor;
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ if (! this.r_stem_suffix_chain_before_ki$()) {
+ this.cursor = this.limit - v_27;
+ break lab53;
+ }
+ }
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+TurkishStemmer.prototype.r_post_process_last_consonants$ = function () {
+ /** @type {!number} */
+ var among_var;
+ this.ket = this.cursor;
+ among_var = this.find_among_b$ALAmong$I(TurkishStemmer.a_23, 4);
+ if (among_var === 0) {
+ return false;
+ }
+ this.bra = this.cursor;
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ if (! this.slice_from$S("p")) {
+ return false;
+ }
+ break;
+ case 2:
+ if (! this.slice_from$S("\u00E7")) {
+ return false;
+ }
+ break;
+ case 3:
+ if (! this.slice_from$S("t")) {
+ return false;
+ }
+ break;
+ case 4:
+ if (! this.slice_from$S("k")) {
+ return false;
+ }
+ break;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+TurkishStemmer.prototype.r_append_U_to_stems_ending_with_d_or_g$ = function () {
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var v_3;
+ /** @type {!number} */
+ var v_4;
+ /** @type {!number} */
+ var v_5;
+ /** @type {!number} */
+ var v_6;
+ /** @type {!number} */
+ var v_7;
+ /** @type {!number} */
+ var v_8;
+ /** @type {!number} */
+ var v_9;
+ /** @type {!number} */
+ var v_10;
+ /** @type {!number} */
+ var v_11;
+ /** @type {!number} */
+ var v_12;
+ /** @type {!number} */
+ var v_13;
+ /** @type {!number} */
+ var v_14;
+ /** @type {!number} */
+ var v_15;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!boolean} */
+ var lab2;
+ /** @type {!boolean} */
+ var lab3;
+ /** @type {!boolean} */
+ var lab5;
+ /** @type {!boolean} */
+ var lab6;
+ /** @type {!boolean} */
+ var lab7;
+ /** @type {!boolean} */
+ var lab8;
+ /** @type {!boolean} */
+ var lab10;
+ /** @type {!boolean} */
+ var lab11;
+ /** @type {!boolean} */
+ var lab12;
+ /** @type {!boolean} */
+ var lab13;
+ /** @type {!boolean} */
+ var lab15;
+ /** @type {!boolean} */
+ var lab16;
+ /** @type {!boolean} */
+ var lab17;
+ /** @type {!boolean} */
+ var lab19;
+ /** @type {!boolean} */
+ var lab20;
+ /** @type {!boolean} */
+ var lab21;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var cursor$1;
+ /** @type {!number} */
+ var cursor$2;
+ /** @type {!number} */
+ var cursor$3;
+ /** @type {!number} */
+ var cursor$4;
+ /** @type {!number} */
+ var cursor$5;
+ /** @type {!number} */
+ var cursor$6;
+ /** @type {!number} */
+ var limit$0;
+ /** @type {!number} */
+ var cursor$7;
+ /** @type {!number} */
+ var cursor$8;
+ v_1 = this.limit - this.cursor;
+ lab0 = true;
+lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ v_2 = this.limit - this.cursor;
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ if (! this.eq_s_b$IS(1, "d")) {
+ break lab1;
+ }
+ break lab0;
+ }
+ this.cursor = this.limit - v_2;
+ if (! this.eq_s_b$IS(1, "g")) {
+ return false;
+ }
+ }
+ this.cursor = this.limit - v_1;
+ lab2 = true;
+lab2:
+ while (lab2 === true) {
+ lab2 = false;
+ v_3 = this.limit - this.cursor;
+ lab3 = true;
+ lab3:
+ while (lab3 === true) {
+ lab3 = false;
+ v_4 = this.limit - this.cursor;
+ golab4:
+ while (true) {
+ v_5 = this.limit - this.cursor;
+ lab5 = true;
+ lab5:
+ while (lab5 === true) {
+ lab5 = false;
+ if (! this.in_grouping_b$AIII(TurkishStemmer.g_vowel, 97, 305)) {
+ break lab5;
+ }
+ this.cursor = this.limit - v_5;
+ break golab4;
+ }
+ cursor$0 = this.cursor = this.limit - v_5;
+ if (cursor$0 <= this.limit_backward) {
+ break lab3;
+ }
+ this.cursor--;
+ }
+ lab6 = true;
+ lab6:
+ while (lab6 === true) {
+ lab6 = false;
+ v_6 = this.limit - this.cursor;
+ lab7 = true;
+ lab7:
+ while (lab7 === true) {
+ lab7 = false;
+ if (! this.eq_s_b$IS(1, "a")) {
+ break lab7;
+ }
+ break lab6;
+ }
+ this.cursor = this.limit - v_6;
+ if (! this.eq_s_b$IS(1, "\u0131")) {
+ break lab3;
+ }
+ }
+ cursor$1 = this.cursor = this.limit - v_4;
+ this.insert$IIS(cursor$1, cursor$1, "\u0131");
+ this.cursor = cursor$1;
+ break lab2;
+ }
+ this.cursor = this.limit - v_3;
+ lab8 = true;
+ lab8:
+ while (lab8 === true) {
+ lab8 = false;
+ v_7 = this.limit - this.cursor;
+ golab9:
+ while (true) {
+ v_8 = this.limit - this.cursor;
+ lab10 = true;
+ lab10:
+ while (lab10 === true) {
+ lab10 = false;
+ if (! this.in_grouping_b$AIII(TurkishStemmer.g_vowel, 97, 305)) {
+ break lab10;
+ }
+ this.cursor = this.limit - v_8;
+ break golab9;
+ }
+ cursor$2 = this.cursor = this.limit - v_8;
+ if (cursor$2 <= this.limit_backward) {
+ break lab8;
+ }
+ this.cursor--;
+ }
+ lab11 = true;
+ lab11:
+ while (lab11 === true) {
+ lab11 = false;
+ v_9 = this.limit - this.cursor;
+ lab12 = true;
+ lab12:
+ while (lab12 === true) {
+ lab12 = false;
+ if (! this.eq_s_b$IS(1, "e")) {
+ break lab12;
+ }
+ break lab11;
+ }
+ this.cursor = this.limit - v_9;
+ if (! this.eq_s_b$IS(1, "i")) {
+ break lab8;
+ }
+ }
+ cursor$3 = this.cursor = this.limit - v_7;
+ this.insert$IIS(cursor$3, cursor$3, "i");
+ this.cursor = cursor$3;
+ break lab2;
+ }
+ this.cursor = this.limit - v_3;
+ lab13 = true;
+ lab13:
+ while (lab13 === true) {
+ lab13 = false;
+ v_10 = this.limit - this.cursor;
+ golab14:
+ while (true) {
+ v_11 = this.limit - this.cursor;
+ lab15 = true;
+ lab15:
+ while (lab15 === true) {
+ lab15 = false;
+ if (! this.in_grouping_b$AIII(TurkishStemmer.g_vowel, 97, 305)) {
+ break lab15;
+ }
+ this.cursor = this.limit - v_11;
+ break golab14;
+ }
+ cursor$4 = this.cursor = this.limit - v_11;
+ if (cursor$4 <= this.limit_backward) {
+ break lab13;
+ }
+ this.cursor--;
+ }
+ lab16 = true;
+ lab16:
+ while (lab16 === true) {
+ lab16 = false;
+ v_12 = this.limit - this.cursor;
+ lab17 = true;
+ lab17:
+ while (lab17 === true) {
+ lab17 = false;
+ if (! this.eq_s_b$IS(1, "o")) {
+ break lab17;
+ }
+ break lab16;
+ }
+ this.cursor = this.limit - v_12;
+ if (! this.eq_s_b$IS(1, "u")) {
+ break lab13;
+ }
+ }
+ cursor$5 = this.cursor = this.limit - v_10;
+ this.insert$IIS(cursor$5, cursor$5, "u");
+ this.cursor = cursor$5;
+ break lab2;
+ }
+ cursor$7 = this.cursor = (limit$0 = this.limit) - v_3;
+ v_13 = limit$0 - cursor$7;
+ golab18:
+ while (true) {
+ v_14 = this.limit - this.cursor;
+ lab19 = true;
+ lab19:
+ while (lab19 === true) {
+ lab19 = false;
+ if (! this.in_grouping_b$AIII(TurkishStemmer.g_vowel, 97, 305)) {
+ break lab19;
+ }
+ this.cursor = this.limit - v_14;
+ break golab18;
+ }
+ cursor$6 = this.cursor = this.limit - v_14;
+ if (cursor$6 <= this.limit_backward) {
+ return false;
+ }
+ this.cursor--;
+ }
+ lab20 = true;
+ lab20:
+ while (lab20 === true) {
+ lab20 = false;
+ v_15 = this.limit - this.cursor;
+ lab21 = true;
+ lab21:
+ while (lab21 === true) {
+ lab21 = false;
+ if (! this.eq_s_b$IS(1, "\u00F6")) {
+ break lab21;
+ }
+ break lab20;
+ }
+ this.cursor = this.limit - v_15;
+ if (! this.eq_s_b$IS(1, "\u00FC")) {
+ return false;
+ }
+ }
+ cursor$8 = this.cursor = this.limit - v_13;
+ this.insert$IIS(cursor$8, cursor$8, "\u00FC");
+ this.cursor = cursor$8;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+TurkishStemmer.prototype.r_more_than_one_syllable_word$ = function () {
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_3;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!boolean} */
+ var lab3;
+ v_1 = this.cursor;
+ v_2 = 2;
+replab0:
+ while (true) {
+ v_3 = this.cursor;
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ golab2:
+ while (true) {
+ lab3 = true;
+ lab3:
+ while (lab3 === true) {
+ lab3 = false;
+ if (! this.in_grouping$AIII(TurkishStemmer.g_vowel, 97, 305)) {
+ break lab3;
+ }
+ break golab2;
+ }
+ if (this.cursor >= this.limit) {
+ break lab1;
+ }
+ this.cursor++;
+ }
+ v_2--;
+ continue replab0;
+ }
+ this.cursor = v_3;
+ break replab0;
+ }
+ if (v_2 > 0) {
+ return false;
+ }
+ this.cursor = v_1;
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+TurkishStemmer.prototype.r_is_reserved_word$ = function () {
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var v_4;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!boolean} */
+ var lab3;
+ /** @type {!boolean} */
+ var lab5;
+ /** @type {!number} */
+ var I_strlen$0;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var I_strlen$1;
+ lab0 = true;
+lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ v_1 = this.cursor;
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ v_2 = this.cursor;
+ golab2:
+ while (true) {
+ lab3 = true;
+ lab3:
+ while (lab3 === true) {
+ lab3 = false;
+ if (! this.eq_s$IS(2, "ad")) {
+ break lab3;
+ }
+ break golab2;
+ }
+ if (this.cursor >= this.limit) {
+ break lab1;
+ }
+ this.cursor++;
+ }
+ I_strlen$0 = this.I_strlen = 2;
+ if (! (I_strlen$0 === this.limit)) {
+ break lab1;
+ }
+ this.cursor = v_2;
+ break lab0;
+ }
+ cursor$0 = this.cursor = v_1;
+ v_4 = cursor$0;
+ golab4:
+ while (true) {
+ lab5 = true;
+ lab5:
+ while (lab5 === true) {
+ lab5 = false;
+ if (! this.eq_s$IS(5, "soyad")) {
+ break lab5;
+ }
+ break golab4;
+ }
+ if (this.cursor >= this.limit) {
+ return false;
+ }
+ this.cursor++;
+ }
+ I_strlen$1 = this.I_strlen = 5;
+ if (! (I_strlen$1 === this.limit)) {
+ return false;
+ }
+ this.cursor = v_4;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+TurkishStemmer.prototype.r_postlude$ = function () {
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!boolean} */
+ var lab2;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var limit$0;
+ /** @type {!number} */
+ var cursor$1;
+ v_1 = this.cursor;
+ lab0 = true;
+lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ if (! this.r_is_reserved_word$()) {
+ break lab0;
+ }
+ return false;
+ }
+ cursor$0 = this.cursor = v_1;
+ this.limit_backward = cursor$0;
+ cursor$1 = this.cursor = limit$0 = this.limit;
+ v_2 = limit$0 - cursor$1;
+ lab1 = true;
+lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ if (! this.r_append_U_to_stems_ending_with_d_or_g$()) {
+ break lab1;
+ }
+ }
+ this.cursor = this.limit - v_2;
+ lab2 = true;
+lab2:
+ while (lab2 === true) {
+ lab2 = false;
+ if (! this.r_post_process_last_consonants$()) {
+ break lab2;
+ }
+ }
+ this.cursor = this.limit_backward;
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+TurkishStemmer.prototype.stem$ = function () {
+ /** @type {!number} */
+ var v_1;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!number} */
+ var limit$0;
+ /** @type {!number} */
+ var cursor$0;
+ if (! this.r_more_than_one_syllable_word$()) {
+ return false;
+ }
+ this.limit_backward = this.cursor;
+ cursor$0 = this.cursor = limit$0 = this.limit;
+ v_1 = limit$0 - cursor$0;
+ lab0 = true;
+lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ if (! this.r_stem_nominal_verb_suffixes$()) {
+ break lab0;
+ }
+ }
+ this.cursor = this.limit - v_1;
+ if (! this.B_continue_stemming_noun_suffixes) {
+ return false;
+ }
+ lab1 = true;
+lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ if (! this.r_stem_noun_suffixes$()) {
+ break lab1;
+ }
+ }
+ this.cursor = this.limit_backward;
+ return (! this.r_postlude$() ? false : true);
+};
+
+/**
+ * @param {*} o
+ * @return {!boolean}
+ */
+TurkishStemmer.prototype.equals$X = function (o) {
+ return o instanceof TurkishStemmer;
+};
+
+/**
+ * @return {!number}
+ */
+TurkishStemmer.prototype.hashCode$ = function () {
+ /** @type {!string} */
+ var classname;
+ /** @type {!number} */
+ var hash;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var char;
+ classname = "TurkishStemmer";
+ hash = 0;
+ if ("TurkishStemmer".length === 0) {
+ return (hash | 0);
+ }
+ for (i = 0; i < classname.length; i++) {
+ char = classname.charCodeAt(i);
+ hash = (hash << 5) - hash + char;
+ hash = hash & hash;
+ }
+ return (hash | 0);
+};
+
+/**
+ * class SwedishStemmer extends BaseStemmer
+ * @constructor
+ */
+function SwedishStemmer() {
+}
+
+SwedishStemmer.prototype = new BaseStemmer;
+/**
+ * @constructor
+ */
+function SwedishStemmer$() {
+ BaseStemmer$.call(this);
+ this.I_x = 0;
+ this.I_p1 = 0;
+};
+
+SwedishStemmer$.prototype = new SwedishStemmer;
+
+/**
+ * @param {SwedishStemmer} other
+ */
+SwedishStemmer.prototype.copy_from$LSwedishStemmer$ = function (other) {
+ this.I_x = other.I_x;
+ this.I_p1 = other.I_p1;
+ BaseStemmer.prototype.copy_from$LBaseStemmer$.call(this, other);
+};
+
+/**
+ * @return {!boolean}
+ */
+SwedishStemmer.prototype.r_mark_regions$ = function () {
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var c;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!boolean} */
+ var lab3;
+ /** @type {!boolean} */
+ var lab4;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var limit$0;
+ /** @type {!number} */
+ var cursor$1;
+ /** @type {!number} */
+ var cursor$2;
+ this.I_p1 = limit$0 = this.limit;
+ v_1 = cursor$0 = this.cursor;
+ c = (cursor$0 + 3 | 0);
+ if (0 > c || c > limit$0) {
+ return false;
+ }
+ cursor$2 = this.cursor = c;
+ this.I_x = cursor$2;
+ this.cursor = v_1;
+golab0:
+ while (true) {
+ v_2 = this.cursor;
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ if (! this.in_grouping$AIII(SwedishStemmer.g_v, 97, 246)) {
+ break lab1;
+ }
+ this.cursor = v_2;
+ break golab0;
+ }
+ cursor$1 = this.cursor = v_2;
+ if (cursor$1 >= this.limit) {
+ return false;
+ }
+ this.cursor++;
+ }
+golab2:
+ while (true) {
+ lab3 = true;
+ lab3:
+ while (lab3 === true) {
+ lab3 = false;
+ if (! this.out_grouping$AIII(SwedishStemmer.g_v, 97, 246)) {
+ break lab3;
+ }
+ break golab2;
+ }
+ if (this.cursor >= this.limit) {
+ return false;
+ }
+ this.cursor++;
+ }
+ this.I_p1 = this.cursor;
+ lab4 = true;
+lab4:
+ while (lab4 === true) {
+ lab4 = false;
+ if (! (this.I_p1 < this.I_x)) {
+ break lab4;
+ }
+ this.I_p1 = this.I_x;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+SwedishStemmer.prototype.r_main_suffix$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var cursor$1;
+ /** @type {!number} */
+ var cursor$2;
+ v_1 = this.limit - (cursor$0 = this.cursor);
+ if (cursor$0 < this.I_p1) {
+ return false;
+ }
+ cursor$1 = this.cursor = this.I_p1;
+ v_2 = this.limit_backward;
+ this.limit_backward = cursor$1;
+ cursor$2 = this.cursor = this.limit - v_1;
+ this.ket = cursor$2;
+ among_var = this.find_among_b$ALAmong$I(SwedishStemmer.a_0, 37);
+ if (among_var === 0) {
+ this.limit_backward = v_2;
+ return false;
+ }
+ this.bra = this.cursor;
+ this.limit_backward = v_2;
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 2:
+ if (! this.in_grouping_b$AIII(SwedishStemmer.g_s_ending, 98, 121)) {
+ return false;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+SwedishStemmer.prototype.r_consonant_pair$ = function () {
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var v_3;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var cursor$1;
+ /** @type {!number} */
+ var limit$0;
+ /** @type {!number} */
+ var cursor$2;
+ /** @type {!number} */
+ var cursor$3;
+ v_1 = this.limit - (cursor$0 = this.cursor);
+ if (cursor$0 < this.I_p1) {
+ return false;
+ }
+ cursor$1 = this.cursor = this.I_p1;
+ v_2 = this.limit_backward;
+ this.limit_backward = cursor$1;
+ cursor$2 = this.cursor = (limit$0 = this.limit) - v_1;
+ v_3 = limit$0 - cursor$2;
+ if (this.find_among_b$ALAmong$I(SwedishStemmer.a_1, 7) === 0) {
+ this.limit_backward = v_2;
+ return false;
+ }
+ cursor$3 = this.cursor = this.limit - v_3;
+ this.ket = cursor$3;
+ if (cursor$3 <= this.limit_backward) {
+ this.limit_backward = v_2;
+ return false;
+ }
+ this.cursor--;
+ this.bra = this.cursor;
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ this.limit_backward = v_2;
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+SwedishStemmer.prototype.r_other_suffix$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var cursor$1;
+ /** @type {!number} */
+ var cursor$2;
+ v_1 = this.limit - (cursor$0 = this.cursor);
+ if (cursor$0 < this.I_p1) {
+ return false;
+ }
+ cursor$1 = this.cursor = this.I_p1;
+ v_2 = this.limit_backward;
+ this.limit_backward = cursor$1;
+ cursor$2 = this.cursor = this.limit - v_1;
+ this.ket = cursor$2;
+ among_var = this.find_among_b$ALAmong$I(SwedishStemmer.a_2, 5);
+ if (among_var === 0) {
+ this.limit_backward = v_2;
+ return false;
+ }
+ this.bra = this.cursor;
+ switch (among_var) {
+ case 0:
+ this.limit_backward = v_2;
+ return false;
+ case 1:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 2:
+ if (! this.slice_from$S("l\u00F6s")) {
+ return false;
+ }
+ break;
+ case 3:
+ if (! this.slice_from$S("full")) {
+ return false;
+ }
+ break;
+ }
+ this.limit_backward = v_2;
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+SwedishStemmer.prototype.stem$ = function () {
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var v_3;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!boolean} */
+ var lab2;
+ /** @type {!boolean} */
+ var lab3;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var limit$0;
+ /** @type {!number} */
+ var cursor$1;
+ /** @type {!number} */
+ var limit$1;
+ /** @type {!number} */
+ var cursor$2;
+ v_1 = this.cursor;
+ lab0 = true;
+lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ if (! this.r_mark_regions$()) {
+ break lab0;
+ }
+ }
+ cursor$0 = this.cursor = v_1;
+ this.limit_backward = cursor$0;
+ cursor$1 = this.cursor = limit$0 = this.limit;
+ v_2 = limit$0 - cursor$1;
+ lab1 = true;
+lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ if (! this.r_main_suffix$()) {
+ break lab1;
+ }
+ }
+ cursor$2 = this.cursor = (limit$1 = this.limit) - v_2;
+ v_3 = limit$1 - cursor$2;
+ lab2 = true;
+lab2:
+ while (lab2 === true) {
+ lab2 = false;
+ if (! this.r_consonant_pair$()) {
+ break lab2;
+ }
+ }
+ this.cursor = this.limit - v_3;
+ lab3 = true;
+lab3:
+ while (lab3 === true) {
+ lab3 = false;
+ if (! this.r_other_suffix$()) {
+ break lab3;
+ }
+ }
+ this.cursor = this.limit_backward;
+ return true;
+};
+
+/**
+ * @param {*} o
+ * @return {!boolean}
+ */
+SwedishStemmer.prototype.equals$X = function (o) {
+ return o instanceof SwedishStemmer;
+};
+
+/**
+ * @return {!number}
+ */
+SwedishStemmer.prototype.hashCode$ = function () {
+ /** @type {!string} */
+ var classname;
+ /** @type {!number} */
+ var hash;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var char;
+ classname = "SwedishStemmer";
+ hash = 0;
+ if ("SwedishStemmer".length === 0) {
+ return (hash | 0);
+ }
+ for (i = 0; i < classname.length; i++) {
+ char = classname.charCodeAt(i);
+ hash = (hash << 5) - hash + char;
+ hash = hash & hash;
+ }
+ return (hash | 0);
+};
+
+/**
+ * class SpanishStemmer extends BaseStemmer
+ * @constructor
+ */
+function SpanishStemmer() {
+}
+
+SpanishStemmer.prototype = new BaseStemmer;
+/**
+ * @constructor
+ */
+function SpanishStemmer$() {
+ BaseStemmer$.call(this);
+ this.I_p2 = 0;
+ this.I_p1 = 0;
+ this.I_pV = 0;
+};
+
+SpanishStemmer$.prototype = new SpanishStemmer;
+
+/**
+ * @param {SpanishStemmer} other
+ */
+SpanishStemmer.prototype.copy_from$LSpanishStemmer$ = function (other) {
+ this.I_p2 = other.I_p2;
+ this.I_p1 = other.I_p1;
+ this.I_pV = other.I_pV;
+ BaseStemmer.prototype.copy_from$LBaseStemmer$.call(this, other);
+};
+
+/**
+ * @return {!boolean}
+ */
+SpanishStemmer.prototype.r_mark_regions$ = function () {
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var v_3;
+ /** @type {!number} */
+ var v_6;
+ /** @type {!number} */
+ var v_8;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!boolean} */
+ var lab2;
+ /** @type {!boolean} */
+ var lab3;
+ /** @type {!boolean} */
+ var lab4;
+ /** @type {!boolean} */
+ var lab6;
+ /** @type {!boolean} */
+ var lab8;
+ /** @type {!boolean} */
+ var lab9;
+ /** @type {!boolean} */
+ var lab10;
+ /** @type {!boolean} */
+ var lab12;
+ /** @type {!boolean} */
+ var lab13;
+ /** @type {!boolean} */
+ var lab15;
+ /** @type {!boolean} */
+ var lab17;
+ /** @type {!boolean} */
+ var lab19;
+ /** @type {!boolean} */
+ var lab21;
+ /** @type {!number} */
+ var limit$0;
+ /** @type {!number} */
+ var cursor$0;
+ this.I_pV = limit$0 = this.limit;
+ this.I_p1 = limit$0;
+ this.I_p2 = limit$0;
+ v_1 = this.cursor;
+ lab0 = true;
+lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ v_2 = this.cursor;
+ lab2 = true;
+ lab2:
+ while (lab2 === true) {
+ lab2 = false;
+ if (! this.in_grouping$AIII(SpanishStemmer.g_v, 97, 252)) {
+ break lab2;
+ }
+ lab3 = true;
+ lab3:
+ while (lab3 === true) {
+ lab3 = false;
+ v_3 = this.cursor;
+ lab4 = true;
+ lab4:
+ while (lab4 === true) {
+ lab4 = false;
+ if (! this.out_grouping$AIII(SpanishStemmer.g_v, 97, 252)) {
+ break lab4;
+ }
+ golab5:
+ while (true) {
+ lab6 = true;
+ lab6:
+ while (lab6 === true) {
+ lab6 = false;
+ if (! this.in_grouping$AIII(SpanishStemmer.g_v, 97, 252)) {
+ break lab6;
+ }
+ break golab5;
+ }
+ if (this.cursor >= this.limit) {
+ break lab4;
+ }
+ this.cursor++;
+ }
+ break lab3;
+ }
+ this.cursor = v_3;
+ if (! this.in_grouping$AIII(SpanishStemmer.g_v, 97, 252)) {
+ break lab2;
+ }
+ golab7:
+ while (true) {
+ lab8 = true;
+ lab8:
+ while (lab8 === true) {
+ lab8 = false;
+ if (! this.out_grouping$AIII(SpanishStemmer.g_v, 97, 252)) {
+ break lab8;
+ }
+ break golab7;
+ }
+ if (this.cursor >= this.limit) {
+ break lab2;
+ }
+ this.cursor++;
+ }
+ }
+ break lab1;
+ }
+ this.cursor = v_2;
+ if (! this.out_grouping$AIII(SpanishStemmer.g_v, 97, 252)) {
+ break lab0;
+ }
+ lab9 = true;
+ lab9:
+ while (lab9 === true) {
+ lab9 = false;
+ v_6 = this.cursor;
+ lab10 = true;
+ lab10:
+ while (lab10 === true) {
+ lab10 = false;
+ if (! this.out_grouping$AIII(SpanishStemmer.g_v, 97, 252)) {
+ break lab10;
+ }
+ golab11:
+ while (true) {
+ lab12 = true;
+ lab12:
+ while (lab12 === true) {
+ lab12 = false;
+ if (! this.in_grouping$AIII(SpanishStemmer.g_v, 97, 252)) {
+ break lab12;
+ }
+ break golab11;
+ }
+ if (this.cursor >= this.limit) {
+ break lab10;
+ }
+ this.cursor++;
+ }
+ break lab9;
+ }
+ this.cursor = v_6;
+ if (! this.in_grouping$AIII(SpanishStemmer.g_v, 97, 252)) {
+ break lab0;
+ }
+ if (this.cursor >= this.limit) {
+ break lab0;
+ }
+ this.cursor++;
+ }
+ }
+ this.I_pV = this.cursor;
+ }
+ cursor$0 = this.cursor = v_1;
+ v_8 = cursor$0;
+ lab13 = true;
+lab13:
+ while (lab13 === true) {
+ lab13 = false;
+ golab14:
+ while (true) {
+ lab15 = true;
+ lab15:
+ while (lab15 === true) {
+ lab15 = false;
+ if (! this.in_grouping$AIII(SpanishStemmer.g_v, 97, 252)) {
+ break lab15;
+ }
+ break golab14;
+ }
+ if (this.cursor >= this.limit) {
+ break lab13;
+ }
+ this.cursor++;
+ }
+ golab16:
+ while (true) {
+ lab17 = true;
+ lab17:
+ while (lab17 === true) {
+ lab17 = false;
+ if (! this.out_grouping$AIII(SpanishStemmer.g_v, 97, 252)) {
+ break lab17;
+ }
+ break golab16;
+ }
+ if (this.cursor >= this.limit) {
+ break lab13;
+ }
+ this.cursor++;
+ }
+ this.I_p1 = this.cursor;
+ golab18:
+ while (true) {
+ lab19 = true;
+ lab19:
+ while (lab19 === true) {
+ lab19 = false;
+ if (! this.in_grouping$AIII(SpanishStemmer.g_v, 97, 252)) {
+ break lab19;
+ }
+ break golab18;
+ }
+ if (this.cursor >= this.limit) {
+ break lab13;
+ }
+ this.cursor++;
+ }
+ golab20:
+ while (true) {
+ lab21 = true;
+ lab21:
+ while (lab21 === true) {
+ lab21 = false;
+ if (! this.out_grouping$AIII(SpanishStemmer.g_v, 97, 252)) {
+ break lab21;
+ }
+ break golab20;
+ }
+ if (this.cursor >= this.limit) {
+ break lab13;
+ }
+ this.cursor++;
+ }
+ this.I_p2 = this.cursor;
+ }
+ this.cursor = v_8;
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+SpanishStemmer.prototype.r_postlude$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var v_1;
+ /** @type {!boolean} */
+ var lab1;
+replab0:
+ while (true) {
+ v_1 = this.cursor;
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ this.bra = this.cursor;
+ among_var = this.find_among$ALAmong$I(SpanishStemmer.a_0, 6);
+ if (among_var === 0) {
+ break lab1;
+ }
+ this.ket = this.cursor;
+ switch (among_var) {
+ case 0:
+ break lab1;
+ case 1:
+ if (! this.slice_from$S("a")) {
+ return false;
+ }
+ break;
+ case 2:
+ if (! this.slice_from$S("e")) {
+ return false;
+ }
+ break;
+ case 3:
+ if (! this.slice_from$S("i")) {
+ return false;
+ }
+ break;
+ case 4:
+ if (! this.slice_from$S("o")) {
+ return false;
+ }
+ break;
+ case 5:
+ if (! this.slice_from$S("u")) {
+ return false;
+ }
+ break;
+ case 6:
+ if (this.cursor >= this.limit) {
+ break lab1;
+ }
+ this.cursor++;
+ break;
+ }
+ continue replab0;
+ }
+ this.cursor = v_1;
+ break replab0;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+SpanishStemmer.prototype.r_RV$ = function () {
+ return (! (this.I_pV <= this.cursor) ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+SpanishStemmer.prototype.r_R1$ = function () {
+ return (! (this.I_p1 <= this.cursor) ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+SpanishStemmer.prototype.r_R2$ = function () {
+ return (! (this.I_p2 <= this.cursor) ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+SpanishStemmer.prototype.r_attached_pronoun$ = function () {
+ /** @type {!number} */
+ var among_var;
+ this.ket = this.cursor;
+ if (this.find_among_b$ALAmong$I(SpanishStemmer.a_1, 13) === 0) {
+ return false;
+ }
+ this.bra = this.cursor;
+ among_var = this.find_among_b$ALAmong$I(SpanishStemmer.a_2, 11);
+ if (among_var === 0) {
+ return false;
+ }
+ if (! (! (this.I_pV <= this.cursor) ? false : true)) {
+ return false;
+ }
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ this.bra = this.cursor;
+ if (! this.slice_from$S("iendo")) {
+ return false;
+ }
+ break;
+ case 2:
+ this.bra = this.cursor;
+ if (! this.slice_from$S("ando")) {
+ return false;
+ }
+ break;
+ case 3:
+ this.bra = this.cursor;
+ if (! this.slice_from$S("ar")) {
+ return false;
+ }
+ break;
+ case 4:
+ this.bra = this.cursor;
+ if (! this.slice_from$S("er")) {
+ return false;
+ }
+ break;
+ case 5:
+ this.bra = this.cursor;
+ if (! this.slice_from$S("ir")) {
+ return false;
+ }
+ break;
+ case 6:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 7:
+ if (! this.eq_s_b$IS(1, "u")) {
+ return false;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+SpanishStemmer.prototype.r_standard_suffix$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var v_3;
+ /** @type {!number} */
+ var v_4;
+ /** @type {!number} */
+ var v_5;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!boolean} */
+ var lab2;
+ /** @type {!boolean} */
+ var lab3;
+ /** @type {!boolean} */
+ var lab4;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var cursor$1;
+ /** @type {!number} */
+ var cursor$2;
+ /** @type {!number} */
+ var cursor$3;
+ this.ket = this.cursor;
+ among_var = this.find_among_b$ALAmong$I(SpanishStemmer.a_6, 46);
+ if (among_var === 0) {
+ return false;
+ }
+ this.bra = this.cursor;
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ if (! (! (this.I_p2 <= this.cursor) ? false : true)) {
+ return false;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 2:
+ if (! (! (this.I_p2 <= this.cursor) ? false : true)) {
+ return false;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ v_1 = this.limit - this.cursor;
+ lab0 = true;
+ lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ this.ket = this.cursor;
+ if (! this.eq_s_b$IS(2, "ic")) {
+ this.cursor = this.limit - v_1;
+ break lab0;
+ }
+ this.bra = cursor$0 = this.cursor;
+ if (! (! (this.I_p2 <= cursor$0) ? false : true)) {
+ this.cursor = this.limit - v_1;
+ break lab0;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ }
+ break;
+ case 3:
+ if (! (! (this.I_p2 <= this.cursor) ? false : true)) {
+ return false;
+ }
+ if (! this.slice_from$S("log")) {
+ return false;
+ }
+ break;
+ case 4:
+ if (! (! (this.I_p2 <= this.cursor) ? false : true)) {
+ return false;
+ }
+ if (! this.slice_from$S("u")) {
+ return false;
+ }
+ break;
+ case 5:
+ if (! (! (this.I_p2 <= this.cursor) ? false : true)) {
+ return false;
+ }
+ if (! this.slice_from$S("ente")) {
+ return false;
+ }
+ break;
+ case 6:
+ if (! (! (this.I_p1 <= this.cursor) ? false : true)) {
+ return false;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ v_2 = this.limit - this.cursor;
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ this.ket = this.cursor;
+ among_var = this.find_among_b$ALAmong$I(SpanishStemmer.a_3, 4);
+ if (among_var === 0) {
+ this.cursor = this.limit - v_2;
+ break lab1;
+ }
+ this.bra = cursor$1 = this.cursor;
+ if (! (! (this.I_p2 <= cursor$1) ? false : true)) {
+ this.cursor = this.limit - v_2;
+ break lab1;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ switch (among_var) {
+ case 0:
+ this.cursor = this.limit - v_2;
+ break lab1;
+ case 1:
+ this.ket = this.cursor;
+ if (! this.eq_s_b$IS(2, "at")) {
+ this.cursor = this.limit - v_2;
+ break lab1;
+ }
+ this.bra = cursor$2 = this.cursor;
+ if (! (! (this.I_p2 <= cursor$2) ? false : true)) {
+ this.cursor = this.limit - v_2;
+ break lab1;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ }
+ }
+ break;
+ case 7:
+ if (! (! (this.I_p2 <= this.cursor) ? false : true)) {
+ return false;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ v_3 = this.limit - this.cursor;
+ lab2 = true;
+ lab2:
+ while (lab2 === true) {
+ lab2 = false;
+ this.ket = this.cursor;
+ among_var = this.find_among_b$ALAmong$I(SpanishStemmer.a_4, 3);
+ if (among_var === 0) {
+ this.cursor = this.limit - v_3;
+ break lab2;
+ }
+ this.bra = this.cursor;
+ switch (among_var) {
+ case 0:
+ this.cursor = this.limit - v_3;
+ break lab2;
+ case 1:
+ if (! (! (this.I_p2 <= this.cursor) ? false : true)) {
+ this.cursor = this.limit - v_3;
+ break lab2;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ }
+ }
+ break;
+ case 8:
+ if (! (! (this.I_p2 <= this.cursor) ? false : true)) {
+ return false;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ v_4 = this.limit - this.cursor;
+ lab3 = true;
+ lab3:
+ while (lab3 === true) {
+ lab3 = false;
+ this.ket = this.cursor;
+ among_var = this.find_among_b$ALAmong$I(SpanishStemmer.a_5, 3);
+ if (among_var === 0) {
+ this.cursor = this.limit - v_4;
+ break lab3;
+ }
+ this.bra = this.cursor;
+ switch (among_var) {
+ case 0:
+ this.cursor = this.limit - v_4;
+ break lab3;
+ case 1:
+ if (! (! (this.I_p2 <= this.cursor) ? false : true)) {
+ this.cursor = this.limit - v_4;
+ break lab3;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ }
+ }
+ break;
+ case 9:
+ if (! (! (this.I_p2 <= this.cursor) ? false : true)) {
+ return false;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ v_5 = this.limit - this.cursor;
+ lab4 = true;
+ lab4:
+ while (lab4 === true) {
+ lab4 = false;
+ this.ket = this.cursor;
+ if (! this.eq_s_b$IS(2, "at")) {
+ this.cursor = this.limit - v_5;
+ break lab4;
+ }
+ this.bra = cursor$3 = this.cursor;
+ if (! (! (this.I_p2 <= cursor$3) ? false : true)) {
+ this.cursor = this.limit - v_5;
+ break lab4;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ }
+ break;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+SpanishStemmer.prototype.r_y_verb_suffix$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var cursor$1;
+ /** @type {!number} */
+ var cursor$2;
+ v_1 = this.limit - (cursor$0 = this.cursor);
+ if (cursor$0 < this.I_pV) {
+ return false;
+ }
+ cursor$1 = this.cursor = this.I_pV;
+ v_2 = this.limit_backward;
+ this.limit_backward = cursor$1;
+ cursor$2 = this.cursor = this.limit - v_1;
+ this.ket = cursor$2;
+ among_var = this.find_among_b$ALAmong$I(SpanishStemmer.a_7, 12);
+ if (among_var === 0) {
+ this.limit_backward = v_2;
+ return false;
+ }
+ this.bra = this.cursor;
+ this.limit_backward = v_2;
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ if (! this.eq_s_b$IS(1, "u")) {
+ return false;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+SpanishStemmer.prototype.r_verb_suffix$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var v_3;
+ /** @type {!number} */
+ var v_4;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var cursor$1;
+ /** @type {!number} */
+ var cursor$2;
+ v_1 = this.limit - (cursor$0 = this.cursor);
+ if (cursor$0 < this.I_pV) {
+ return false;
+ }
+ cursor$1 = this.cursor = this.I_pV;
+ v_2 = this.limit_backward;
+ this.limit_backward = cursor$1;
+ cursor$2 = this.cursor = this.limit - v_1;
+ this.ket = cursor$2;
+ among_var = this.find_among_b$ALAmong$I(SpanishStemmer.a_8, 96);
+ if (among_var === 0) {
+ this.limit_backward = v_2;
+ return false;
+ }
+ this.bra = this.cursor;
+ this.limit_backward = v_2;
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ v_3 = this.limit - this.cursor;
+ lab0 = true;
+ lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ if (! this.eq_s_b$IS(1, "u")) {
+ this.cursor = this.limit - v_3;
+ break lab0;
+ }
+ v_4 = this.limit - this.cursor;
+ if (! this.eq_s_b$IS(1, "g")) {
+ this.cursor = this.limit - v_3;
+ break lab0;
+ }
+ this.cursor = this.limit - v_4;
+ }
+ this.bra = this.cursor;
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 2:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+SpanishStemmer.prototype.r_residual_suffix$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var cursor$1;
+ this.ket = this.cursor;
+ among_var = this.find_among_b$ALAmong$I(SpanishStemmer.a_9, 8);
+ if (among_var === 0) {
+ return false;
+ }
+ this.bra = this.cursor;
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ if (! (! (this.I_pV <= this.cursor) ? false : true)) {
+ return false;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 2:
+ if (! (! (this.I_pV <= this.cursor) ? false : true)) {
+ return false;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ v_1 = this.limit - this.cursor;
+ lab0 = true;
+ lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ this.ket = this.cursor;
+ if (! this.eq_s_b$IS(1, "u")) {
+ this.cursor = this.limit - v_1;
+ break lab0;
+ }
+ this.bra = cursor$0 = this.cursor;
+ v_2 = this.limit - cursor$0;
+ if (! this.eq_s_b$IS(1, "g")) {
+ this.cursor = this.limit - v_1;
+ break lab0;
+ }
+ cursor$1 = this.cursor = this.limit - v_2;
+ if (! (! (this.I_pV <= cursor$1) ? false : true)) {
+ this.cursor = this.limit - v_1;
+ break lab0;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ }
+ break;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+SpanishStemmer.prototype.stem$ = function () {
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var v_3;
+ /** @type {!number} */
+ var v_4;
+ /** @type {!number} */
+ var v_6;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!boolean} */
+ var lab2;
+ /** @type {!boolean} */
+ var lab3;
+ /** @type {!boolean} */
+ var lab4;
+ /** @type {!boolean} */
+ var lab5;
+ /** @type {!boolean} */
+ var lab6;
+ /** @type {!boolean} */
+ var lab7;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var limit$0;
+ /** @type {!number} */
+ var cursor$1;
+ /** @type {!number} */
+ var limit$1;
+ /** @type {!number} */
+ var cursor$2;
+ /** @type {!number} */
+ var cursor$3;
+ v_1 = this.cursor;
+ lab0 = true;
+lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ if (! this.r_mark_regions$()) {
+ break lab0;
+ }
+ }
+ cursor$0 = this.cursor = v_1;
+ this.limit_backward = cursor$0;
+ cursor$1 = this.cursor = limit$0 = this.limit;
+ v_2 = limit$0 - cursor$1;
+ lab1 = true;
+lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ if (! this.r_attached_pronoun$()) {
+ break lab1;
+ }
+ }
+ cursor$2 = this.cursor = (limit$1 = this.limit) - v_2;
+ v_3 = limit$1 - cursor$2;
+ lab2 = true;
+lab2:
+ while (lab2 === true) {
+ lab2 = false;
+ lab3 = true;
+ lab3:
+ while (lab3 === true) {
+ lab3 = false;
+ v_4 = this.limit - this.cursor;
+ lab4 = true;
+ lab4:
+ while (lab4 === true) {
+ lab4 = false;
+ if (! this.r_standard_suffix$()) {
+ break lab4;
+ }
+ break lab3;
+ }
+ this.cursor = this.limit - v_4;
+ lab5 = true;
+ lab5:
+ while (lab5 === true) {
+ lab5 = false;
+ if (! this.r_y_verb_suffix$()) {
+ break lab5;
+ }
+ break lab3;
+ }
+ this.cursor = this.limit - v_4;
+ if (! this.r_verb_suffix$()) {
+ break lab2;
+ }
+ }
+ }
+ this.cursor = this.limit - v_3;
+ lab6 = true;
+lab6:
+ while (lab6 === true) {
+ lab6 = false;
+ if (! this.r_residual_suffix$()) {
+ break lab6;
+ }
+ }
+ cursor$3 = this.cursor = this.limit_backward;
+ v_6 = cursor$3;
+ lab7 = true;
+lab7:
+ while (lab7 === true) {
+ lab7 = false;
+ if (! this.r_postlude$()) {
+ break lab7;
+ }
+ }
+ this.cursor = v_6;
+ return true;
+};
+
+/**
+ * @param {*} o
+ * @return {!boolean}
+ */
+SpanishStemmer.prototype.equals$X = function (o) {
+ return o instanceof SpanishStemmer;
+};
+
+/**
+ * @return {!number}
+ */
+SpanishStemmer.prototype.hashCode$ = function () {
+ /** @type {!string} */
+ var classname;
+ /** @type {!number} */
+ var hash;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var char;
+ classname = "SpanishStemmer";
+ hash = 0;
+ if ("SpanishStemmer".length === 0) {
+ return (hash | 0);
+ }
+ for (i = 0; i < classname.length; i++) {
+ char = classname.charCodeAt(i);
+ hash = (hash << 5) - hash + char;
+ hash = hash & hash;
+ }
+ return (hash | 0);
+};
+
+/**
+ * class RussianStemmer extends BaseStemmer
+ * @constructor
+ */
+function RussianStemmer() {
+}
+
+RussianStemmer.prototype = new BaseStemmer;
+/**
+ * @constructor
+ */
+function RussianStemmer$() {
+ BaseStemmer$.call(this);
+ this.I_p2 = 0;
+ this.I_pV = 0;
+};
+
+RussianStemmer$.prototype = new RussianStemmer;
+
+/**
+ * @param {RussianStemmer} other
+ */
+RussianStemmer.prototype.copy_from$LRussianStemmer$ = function (other) {
+ this.I_p2 = other.I_p2;
+ this.I_pV = other.I_pV;
+ BaseStemmer.prototype.copy_from$LBaseStemmer$.call(this, other);
+};
+
+/**
+ * @return {!boolean}
+ */
+RussianStemmer.prototype.r_mark_regions$ = function () {
+ /** @type {!number} */
+ var v_1;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!boolean} */
+ var lab2;
+ /** @type {!boolean} */
+ var lab4;
+ /** @type {!boolean} */
+ var lab6;
+ /** @type {!boolean} */
+ var lab8;
+ /** @type {!number} */
+ var limit$0;
+ this.I_pV = limit$0 = this.limit;
+ this.I_p2 = limit$0;
+ v_1 = this.cursor;
+ lab0 = true;
+lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ golab1:
+ while (true) {
+ lab2 = true;
+ lab2:
+ while (lab2 === true) {
+ lab2 = false;
+ if (! this.in_grouping$AIII(RussianStemmer.g_v, 1072, 1103)) {
+ break lab2;
+ }
+ break golab1;
+ }
+ if (this.cursor >= this.limit) {
+ break lab0;
+ }
+ this.cursor++;
+ }
+ this.I_pV = this.cursor;
+ golab3:
+ while (true) {
+ lab4 = true;
+ lab4:
+ while (lab4 === true) {
+ lab4 = false;
+ if (! this.out_grouping$AIII(RussianStemmer.g_v, 1072, 1103)) {
+ break lab4;
+ }
+ break golab3;
+ }
+ if (this.cursor >= this.limit) {
+ break lab0;
+ }
+ this.cursor++;
+ }
+ golab5:
+ while (true) {
+ lab6 = true;
+ lab6:
+ while (lab6 === true) {
+ lab6 = false;
+ if (! this.in_grouping$AIII(RussianStemmer.g_v, 1072, 1103)) {
+ break lab6;
+ }
+ break golab5;
+ }
+ if (this.cursor >= this.limit) {
+ break lab0;
+ }
+ this.cursor++;
+ }
+ golab7:
+ while (true) {
+ lab8 = true;
+ lab8:
+ while (lab8 === true) {
+ lab8 = false;
+ if (! this.out_grouping$AIII(RussianStemmer.g_v, 1072, 1103)) {
+ break lab8;
+ }
+ break golab7;
+ }
+ if (this.cursor >= this.limit) {
+ break lab0;
+ }
+ this.cursor++;
+ }
+ this.I_p2 = this.cursor;
+ }
+ this.cursor = v_1;
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+RussianStemmer.prototype.r_R2$ = function () {
+ return (! (this.I_p2 <= this.cursor) ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+RussianStemmer.prototype.r_perfective_gerund$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var v_1;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!boolean} */
+ var lab1;
+ this.ket = this.cursor;
+ among_var = this.find_among_b$ALAmong$I(RussianStemmer.a_0, 9);
+ if (among_var === 0) {
+ return false;
+ }
+ this.bra = this.cursor;
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ lab0 = true;
+ lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ v_1 = this.limit - this.cursor;
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ if (! this.eq_s_b$IS(1, "\u0430")) {
+ break lab1;
+ }
+ break lab0;
+ }
+ this.cursor = this.limit - v_1;
+ if (! this.eq_s_b$IS(1, "\u044F")) {
+ return false;
+ }
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 2:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+RussianStemmer.prototype.r_adjective$ = function () {
+ /** @type {!number} */
+ var among_var;
+ this.ket = this.cursor;
+ among_var = this.find_among_b$ALAmong$I(RussianStemmer.a_1, 26);
+ if (among_var === 0) {
+ return false;
+ }
+ this.bra = this.cursor;
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+RussianStemmer.prototype.r_adjectival$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!boolean} */
+ var lab2;
+ if (! this.r_adjective$()) {
+ return false;
+ }
+ v_1 = this.limit - this.cursor;
+ lab0 = true;
+lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ this.ket = this.cursor;
+ among_var = this.find_among_b$ALAmong$I(RussianStemmer.a_2, 8);
+ if (among_var === 0) {
+ this.cursor = this.limit - v_1;
+ break lab0;
+ }
+ this.bra = this.cursor;
+ switch (among_var) {
+ case 0:
+ this.cursor = this.limit - v_1;
+ break lab0;
+ case 1:
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ v_2 = this.limit - this.cursor;
+ lab2 = true;
+ lab2:
+ while (lab2 === true) {
+ lab2 = false;
+ if (! this.eq_s_b$IS(1, "\u0430")) {
+ break lab2;
+ }
+ break lab1;
+ }
+ this.cursor = this.limit - v_2;
+ if (! this.eq_s_b$IS(1, "\u044F")) {
+ this.cursor = this.limit - v_1;
+ break lab0;
+ }
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 2:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ }
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+RussianStemmer.prototype.r_reflexive$ = function () {
+ /** @type {!number} */
+ var among_var;
+ this.ket = this.cursor;
+ among_var = this.find_among_b$ALAmong$I(RussianStemmer.a_3, 2);
+ if (among_var === 0) {
+ return false;
+ }
+ this.bra = this.cursor;
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+RussianStemmer.prototype.r_verb$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var v_1;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!boolean} */
+ var lab1;
+ this.ket = this.cursor;
+ among_var = this.find_among_b$ALAmong$I(RussianStemmer.a_4, 46);
+ if (among_var === 0) {
+ return false;
+ }
+ this.bra = this.cursor;
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ lab0 = true;
+ lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ v_1 = this.limit - this.cursor;
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ if (! this.eq_s_b$IS(1, "\u0430")) {
+ break lab1;
+ }
+ break lab0;
+ }
+ this.cursor = this.limit - v_1;
+ if (! this.eq_s_b$IS(1, "\u044F")) {
+ return false;
+ }
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 2:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+RussianStemmer.prototype.r_noun$ = function () {
+ /** @type {!number} */
+ var among_var;
+ this.ket = this.cursor;
+ among_var = this.find_among_b$ALAmong$I(RussianStemmer.a_5, 36);
+ if (among_var === 0) {
+ return false;
+ }
+ this.bra = this.cursor;
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+RussianStemmer.prototype.r_derivational$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var cursor$0;
+ this.ket = this.cursor;
+ among_var = this.find_among_b$ALAmong$I(RussianStemmer.a_6, 2);
+ if (among_var === 0) {
+ return false;
+ }
+ this.bra = cursor$0 = this.cursor;
+ if (! (! (this.I_p2 <= cursor$0) ? false : true)) {
+ return false;
+ }
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+RussianStemmer.prototype.r_tidy_up$ = function () {
+ /** @type {!number} */
+ var among_var;
+ this.ket = this.cursor;
+ among_var = this.find_among_b$ALAmong$I(RussianStemmer.a_7, 4);
+ if (among_var === 0) {
+ return false;
+ }
+ this.bra = this.cursor;
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ this.ket = this.cursor;
+ if (! this.eq_s_b$IS(1, "\u043D")) {
+ return false;
+ }
+ this.bra = this.cursor;
+ if (! this.eq_s_b$IS(1, "\u043D")) {
+ return false;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 2:
+ if (! this.eq_s_b$IS(1, "\u043D")) {
+ return false;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 3:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+RussianStemmer.prototype.stem$ = function () {
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var v_3;
+ /** @type {!number} */
+ var v_4;
+ /** @type {!number} */
+ var v_5;
+ /** @type {!number} */
+ var v_6;
+ /** @type {!number} */
+ var v_7;
+ /** @type {!number} */
+ var v_8;
+ /** @type {!number} */
+ var v_9;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!boolean} */
+ var lab2;
+ /** @type {!boolean} */
+ var lab3;
+ /** @type {!boolean} */
+ var lab4;
+ /** @type {!boolean} */
+ var lab5;
+ /** @type {!boolean} */
+ var lab6;
+ /** @type {!boolean} */
+ var lab7;
+ /** @type {!boolean} */
+ var lab8;
+ /** @type {!boolean} */
+ var lab9;
+ /** @type {!boolean} */
+ var lab10;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var limit$0;
+ /** @type {!number} */
+ var cursor$1;
+ /** @type {!number} */
+ var limit$1;
+ /** @type {!number} */
+ var cursor$2;
+ /** @type {!number} */
+ var cursor$3;
+ /** @type {!number} */
+ var limit$2;
+ /** @type {!number} */
+ var cursor$4;
+ /** @type {!number} */
+ var limit$3;
+ /** @type {!number} */
+ var cursor$5;
+ /** @type {!number} */
+ var limit_backward$0;
+ v_1 = this.cursor;
+ lab0 = true;
+lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ if (! this.r_mark_regions$()) {
+ break lab0;
+ }
+ }
+ cursor$0 = this.cursor = v_1;
+ this.limit_backward = cursor$0;
+ cursor$1 = this.cursor = limit$0 = this.limit;
+ v_2 = limit$0 - cursor$1;
+ if (cursor$1 < this.I_pV) {
+ return false;
+ }
+ cursor$3 = this.cursor = this.I_pV;
+ v_3 = this.limit_backward;
+ this.limit_backward = cursor$3;
+ cursor$4 = this.cursor = (limit$2 = this.limit) - v_2;
+ v_4 = limit$2 - cursor$4;
+ lab1 = true;
+lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ lab2 = true;
+ lab2:
+ while (lab2 === true) {
+ lab2 = false;
+ v_5 = this.limit - this.cursor;
+ lab3 = true;
+ lab3:
+ while (lab3 === true) {
+ lab3 = false;
+ if (! this.r_perfective_gerund$()) {
+ break lab3;
+ }
+ break lab2;
+ }
+ cursor$2 = this.cursor = (limit$1 = this.limit) - v_5;
+ v_6 = limit$1 - cursor$2;
+ lab4 = true;
+ lab4:
+ while (lab4 === true) {
+ lab4 = false;
+ if (! this.r_reflexive$()) {
+ this.cursor = this.limit - v_6;
+ break lab4;
+ }
+ }
+ lab5 = true;
+ lab5:
+ while (lab5 === true) {
+ lab5 = false;
+ v_7 = this.limit - this.cursor;
+ lab6 = true;
+ lab6:
+ while (lab6 === true) {
+ lab6 = false;
+ if (! this.r_adjectival$()) {
+ break lab6;
+ }
+ break lab5;
+ }
+ this.cursor = this.limit - v_7;
+ lab7 = true;
+ lab7:
+ while (lab7 === true) {
+ lab7 = false;
+ if (! this.r_verb$()) {
+ break lab7;
+ }
+ break lab5;
+ }
+ this.cursor = this.limit - v_7;
+ if (! this.r_noun$()) {
+ break lab1;
+ }
+ }
+ }
+ }
+ cursor$5 = this.cursor = (limit$3 = this.limit) - v_4;
+ v_8 = limit$3 - cursor$5;
+ lab8 = true;
+lab8:
+ while (lab8 === true) {
+ lab8 = false;
+ this.ket = this.cursor;
+ if (! this.eq_s_b$IS(1, "\u0438")) {
+ this.cursor = this.limit - v_8;
+ break lab8;
+ }
+ this.bra = this.cursor;
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ }
+ v_9 = this.limit - this.cursor;
+ lab9 = true;
+lab9:
+ while (lab9 === true) {
+ lab9 = false;
+ if (! this.r_derivational$()) {
+ break lab9;
+ }
+ }
+ this.cursor = this.limit - v_9;
+ lab10 = true;
+lab10:
+ while (lab10 === true) {
+ lab10 = false;
+ if (! this.r_tidy_up$()) {
+ break lab10;
+ }
+ }
+ limit_backward$0 = this.limit_backward = v_3;
+ this.cursor = limit_backward$0;
+ return true;
+};
+
+/**
+ * @param {*} o
+ * @return {!boolean}
+ */
+RussianStemmer.prototype.equals$X = function (o) {
+ return o instanceof RussianStemmer;
+};
+
+/**
+ * @return {!number}
+ */
+RussianStemmer.prototype.hashCode$ = function () {
+ /** @type {!string} */
+ var classname;
+ /** @type {!number} */
+ var hash;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var char;
+ classname = "RussianStemmer";
+ hash = 0;
+ if ("RussianStemmer".length === 0) {
+ return (hash | 0);
+ }
+ for (i = 0; i < classname.length; i++) {
+ char = classname.charCodeAt(i);
+ hash = (hash << 5) - hash + char;
+ hash = hash & hash;
+ }
+ return (hash | 0);
+};
+
+/**
+ * class RomanianStemmer extends BaseStemmer
+ * @constructor
+ */
+function RomanianStemmer() {
+}
+
+RomanianStemmer.prototype = new BaseStemmer;
+/**
+ * @constructor
+ */
+function RomanianStemmer$() {
+ BaseStemmer$.call(this);
+ this.B_standard_suffix_removed = false;
+ this.I_p2 = 0;
+ this.I_p1 = 0;
+ this.I_pV = 0;
+};
+
+RomanianStemmer$.prototype = new RomanianStemmer;
+
+/**
+ * @param {RomanianStemmer} other
+ */
+RomanianStemmer.prototype.copy_from$LRomanianStemmer$ = function (other) {
+ this.B_standard_suffix_removed = other.B_standard_suffix_removed;
+ this.I_p2 = other.I_p2;
+ this.I_p1 = other.I_p1;
+ this.I_pV = other.I_pV;
+ BaseStemmer.prototype.copy_from$LBaseStemmer$.call(this, other);
+};
+
+/**
+ * @return {!boolean}
+ */
+RomanianStemmer.prototype.r_prelude$ = function () {
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var v_3;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!boolean} */
+ var lab3;
+ /** @type {!boolean} */
+ var lab4;
+ /** @type {!boolean} */
+ var lab5;
+ /** @type {!number} */
+ var cursor$0;
+replab0:
+ while (true) {
+ v_1 = this.cursor;
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ golab2:
+ while (true) {
+ v_2 = this.cursor;
+ lab3 = true;
+ lab3:
+ while (lab3 === true) {
+ lab3 = false;
+ if (! this.in_grouping$AIII(RomanianStemmer.g_v, 97, 259)) {
+ break lab3;
+ }
+ this.bra = this.cursor;
+ lab4 = true;
+ lab4:
+ while (lab4 === true) {
+ lab4 = false;
+ v_3 = this.cursor;
+ lab5 = true;
+ lab5:
+ while (lab5 === true) {
+ lab5 = false;
+ if (! this.eq_s$IS(1, "u")) {
+ break lab5;
+ }
+ this.ket = this.cursor;
+ if (! this.in_grouping$AIII(RomanianStemmer.g_v, 97, 259)) {
+ break lab5;
+ }
+ if (! this.slice_from$S("U")) {
+ return false;
+ }
+ break lab4;
+ }
+ this.cursor = v_3;
+ if (! this.eq_s$IS(1, "i")) {
+ break lab3;
+ }
+ this.ket = this.cursor;
+ if (! this.in_grouping$AIII(RomanianStemmer.g_v, 97, 259)) {
+ break lab3;
+ }
+ if (! this.slice_from$S("I")) {
+ return false;
+ }
+ }
+ this.cursor = v_2;
+ break golab2;
+ }
+ cursor$0 = this.cursor = v_2;
+ if (cursor$0 >= this.limit) {
+ break lab1;
+ }
+ this.cursor++;
+ }
+ continue replab0;
+ }
+ this.cursor = v_1;
+ break replab0;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+RomanianStemmer.prototype.r_mark_regions$ = function () {
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var v_3;
+ /** @type {!number} */
+ var v_6;
+ /** @type {!number} */
+ var v_8;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!boolean} */
+ var lab2;
+ /** @type {!boolean} */
+ var lab3;
+ /** @type {!boolean} */
+ var lab4;
+ /** @type {!boolean} */
+ var lab6;
+ /** @type {!boolean} */
+ var lab8;
+ /** @type {!boolean} */
+ var lab9;
+ /** @type {!boolean} */
+ var lab10;
+ /** @type {!boolean} */
+ var lab12;
+ /** @type {!boolean} */
+ var lab13;
+ /** @type {!boolean} */
+ var lab15;
+ /** @type {!boolean} */
+ var lab17;
+ /** @type {!boolean} */
+ var lab19;
+ /** @type {!boolean} */
+ var lab21;
+ /** @type {!number} */
+ var limit$0;
+ /** @type {!number} */
+ var cursor$0;
+ this.I_pV = limit$0 = this.limit;
+ this.I_p1 = limit$0;
+ this.I_p2 = limit$0;
+ v_1 = this.cursor;
+ lab0 = true;
+lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ v_2 = this.cursor;
+ lab2 = true;
+ lab2:
+ while (lab2 === true) {
+ lab2 = false;
+ if (! this.in_grouping$AIII(RomanianStemmer.g_v, 97, 259)) {
+ break lab2;
+ }
+ lab3 = true;
+ lab3:
+ while (lab3 === true) {
+ lab3 = false;
+ v_3 = this.cursor;
+ lab4 = true;
+ lab4:
+ while (lab4 === true) {
+ lab4 = false;
+ if (! this.out_grouping$AIII(RomanianStemmer.g_v, 97, 259)) {
+ break lab4;
+ }
+ golab5:
+ while (true) {
+ lab6 = true;
+ lab6:
+ while (lab6 === true) {
+ lab6 = false;
+ if (! this.in_grouping$AIII(RomanianStemmer.g_v, 97, 259)) {
+ break lab6;
+ }
+ break golab5;
+ }
+ if (this.cursor >= this.limit) {
+ break lab4;
+ }
+ this.cursor++;
+ }
+ break lab3;
+ }
+ this.cursor = v_3;
+ if (! this.in_grouping$AIII(RomanianStemmer.g_v, 97, 259)) {
+ break lab2;
+ }
+ golab7:
+ while (true) {
+ lab8 = true;
+ lab8:
+ while (lab8 === true) {
+ lab8 = false;
+ if (! this.out_grouping$AIII(RomanianStemmer.g_v, 97, 259)) {
+ break lab8;
+ }
+ break golab7;
+ }
+ if (this.cursor >= this.limit) {
+ break lab2;
+ }
+ this.cursor++;
+ }
+ }
+ break lab1;
+ }
+ this.cursor = v_2;
+ if (! this.out_grouping$AIII(RomanianStemmer.g_v, 97, 259)) {
+ break lab0;
+ }
+ lab9 = true;
+ lab9:
+ while (lab9 === true) {
+ lab9 = false;
+ v_6 = this.cursor;
+ lab10 = true;
+ lab10:
+ while (lab10 === true) {
+ lab10 = false;
+ if (! this.out_grouping$AIII(RomanianStemmer.g_v, 97, 259)) {
+ break lab10;
+ }
+ golab11:
+ while (true) {
+ lab12 = true;
+ lab12:
+ while (lab12 === true) {
+ lab12 = false;
+ if (! this.in_grouping$AIII(RomanianStemmer.g_v, 97, 259)) {
+ break lab12;
+ }
+ break golab11;
+ }
+ if (this.cursor >= this.limit) {
+ break lab10;
+ }
+ this.cursor++;
+ }
+ break lab9;
+ }
+ this.cursor = v_6;
+ if (! this.in_grouping$AIII(RomanianStemmer.g_v, 97, 259)) {
+ break lab0;
+ }
+ if (this.cursor >= this.limit) {
+ break lab0;
+ }
+ this.cursor++;
+ }
+ }
+ this.I_pV = this.cursor;
+ }
+ cursor$0 = this.cursor = v_1;
+ v_8 = cursor$0;
+ lab13 = true;
+lab13:
+ while (lab13 === true) {
+ lab13 = false;
+ golab14:
+ while (true) {
+ lab15 = true;
+ lab15:
+ while (lab15 === true) {
+ lab15 = false;
+ if (! this.in_grouping$AIII(RomanianStemmer.g_v, 97, 259)) {
+ break lab15;
+ }
+ break golab14;
+ }
+ if (this.cursor >= this.limit) {
+ break lab13;
+ }
+ this.cursor++;
+ }
+ golab16:
+ while (true) {
+ lab17 = true;
+ lab17:
+ while (lab17 === true) {
+ lab17 = false;
+ if (! this.out_grouping$AIII(RomanianStemmer.g_v, 97, 259)) {
+ break lab17;
+ }
+ break golab16;
+ }
+ if (this.cursor >= this.limit) {
+ break lab13;
+ }
+ this.cursor++;
+ }
+ this.I_p1 = this.cursor;
+ golab18:
+ while (true) {
+ lab19 = true;
+ lab19:
+ while (lab19 === true) {
+ lab19 = false;
+ if (! this.in_grouping$AIII(RomanianStemmer.g_v, 97, 259)) {
+ break lab19;
+ }
+ break golab18;
+ }
+ if (this.cursor >= this.limit) {
+ break lab13;
+ }
+ this.cursor++;
+ }
+ golab20:
+ while (true) {
+ lab21 = true;
+ lab21:
+ while (lab21 === true) {
+ lab21 = false;
+ if (! this.out_grouping$AIII(RomanianStemmer.g_v, 97, 259)) {
+ break lab21;
+ }
+ break golab20;
+ }
+ if (this.cursor >= this.limit) {
+ break lab13;
+ }
+ this.cursor++;
+ }
+ this.I_p2 = this.cursor;
+ }
+ this.cursor = v_8;
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+RomanianStemmer.prototype.r_postlude$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var v_1;
+ /** @type {!boolean} */
+ var lab1;
+replab0:
+ while (true) {
+ v_1 = this.cursor;
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ this.bra = this.cursor;
+ among_var = this.find_among$ALAmong$I(RomanianStemmer.a_0, 3);
+ if (among_var === 0) {
+ break lab1;
+ }
+ this.ket = this.cursor;
+ switch (among_var) {
+ case 0:
+ break lab1;
+ case 1:
+ if (! this.slice_from$S("i")) {
+ return false;
+ }
+ break;
+ case 2:
+ if (! this.slice_from$S("u")) {
+ return false;
+ }
+ break;
+ case 3:
+ if (this.cursor >= this.limit) {
+ break lab1;
+ }
+ this.cursor++;
+ break;
+ }
+ continue replab0;
+ }
+ this.cursor = v_1;
+ break replab0;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+RomanianStemmer.prototype.r_RV$ = function () {
+ return (! (this.I_pV <= this.cursor) ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+RomanianStemmer.prototype.r_R1$ = function () {
+ return (! (this.I_p1 <= this.cursor) ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+RomanianStemmer.prototype.r_R2$ = function () {
+ return (! (this.I_p2 <= this.cursor) ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+RomanianStemmer.prototype.r_step_0$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var v_1;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!number} */
+ var cursor$0;
+ this.ket = this.cursor;
+ among_var = this.find_among_b$ALAmong$I(RomanianStemmer.a_1, 16);
+ if (among_var === 0) {
+ return false;
+ }
+ this.bra = cursor$0 = this.cursor;
+ if (! (! (this.I_p1 <= cursor$0) ? false : true)) {
+ return false;
+ }
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 2:
+ if (! this.slice_from$S("a")) {
+ return false;
+ }
+ break;
+ case 3:
+ if (! this.slice_from$S("e")) {
+ return false;
+ }
+ break;
+ case 4:
+ if (! this.slice_from$S("i")) {
+ return false;
+ }
+ break;
+ case 5:
+ v_1 = this.limit - this.cursor;
+ lab0 = true;
+ lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ if (! this.eq_s_b$IS(2, "ab")) {
+ break lab0;
+ }
+ return false;
+ }
+ this.cursor = this.limit - v_1;
+ if (! this.slice_from$S("i")) {
+ return false;
+ }
+ break;
+ case 6:
+ if (! this.slice_from$S("at")) {
+ return false;
+ }
+ break;
+ case 7:
+ if (! this.slice_from$S("a\u0163i")) {
+ return false;
+ }
+ break;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+RomanianStemmer.prototype.r_combo_suffix$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var cursor$1;
+ v_1 = this.limit - (cursor$0 = this.cursor);
+ this.ket = cursor$0;
+ among_var = this.find_among_b$ALAmong$I(RomanianStemmer.a_2, 46);
+ if (among_var === 0) {
+ return false;
+ }
+ this.bra = cursor$1 = this.cursor;
+ if (! (! (this.I_p1 <= cursor$1) ? false : true)) {
+ return false;
+ }
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ if (! this.slice_from$S("abil")) {
+ return false;
+ }
+ break;
+ case 2:
+ if (! this.slice_from$S("ibil")) {
+ return false;
+ }
+ break;
+ case 3:
+ if (! this.slice_from$S("iv")) {
+ return false;
+ }
+ break;
+ case 4:
+ if (! this.slice_from$S("ic")) {
+ return false;
+ }
+ break;
+ case 5:
+ if (! this.slice_from$S("at")) {
+ return false;
+ }
+ break;
+ case 6:
+ if (! this.slice_from$S("it")) {
+ return false;
+ }
+ break;
+ }
+ this.B_standard_suffix_removed = true;
+ this.cursor = this.limit - v_1;
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+RomanianStemmer.prototype.r_standard_suffix$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var v_1;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!number} */
+ var cursor$0;
+ this.B_standard_suffix_removed = false;
+replab0:
+ while (true) {
+ v_1 = this.limit - this.cursor;
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ if (! this.r_combo_suffix$()) {
+ break lab1;
+ }
+ continue replab0;
+ }
+ this.cursor = this.limit - v_1;
+ break replab0;
+ }
+ this.ket = this.cursor;
+ among_var = this.find_among_b$ALAmong$I(RomanianStemmer.a_3, 62);
+ if (among_var === 0) {
+ return false;
+ }
+ this.bra = cursor$0 = this.cursor;
+ if (! (! (this.I_p2 <= cursor$0) ? false : true)) {
+ return false;
+ }
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 2:
+ if (! this.eq_s_b$IS(1, "\u0163")) {
+ return false;
+ }
+ this.bra = this.cursor;
+ if (! this.slice_from$S("t")) {
+ return false;
+ }
+ break;
+ case 3:
+ if (! this.slice_from$S("ist")) {
+ return false;
+ }
+ break;
+ }
+ this.B_standard_suffix_removed = true;
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+RomanianStemmer.prototype.r_verb_suffix$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var v_3;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var cursor$1;
+ /** @type {!number} */
+ var cursor$2;
+ v_1 = this.limit - (cursor$0 = this.cursor);
+ if (cursor$0 < this.I_pV) {
+ return false;
+ }
+ cursor$1 = this.cursor = this.I_pV;
+ v_2 = this.limit_backward;
+ this.limit_backward = cursor$1;
+ cursor$2 = this.cursor = this.limit - v_1;
+ this.ket = cursor$2;
+ among_var = this.find_among_b$ALAmong$I(RomanianStemmer.a_4, 94);
+ if (among_var === 0) {
+ this.limit_backward = v_2;
+ return false;
+ }
+ this.bra = this.cursor;
+ switch (among_var) {
+ case 0:
+ this.limit_backward = v_2;
+ return false;
+ case 1:
+ lab0 = true;
+ lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ v_3 = this.limit - this.cursor;
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ if (! this.out_grouping_b$AIII(RomanianStemmer.g_v, 97, 259)) {
+ break lab1;
+ }
+ break lab0;
+ }
+ this.cursor = this.limit - v_3;
+ if (! this.eq_s_b$IS(1, "u")) {
+ this.limit_backward = v_2;
+ return false;
+ }
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 2:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ }
+ this.limit_backward = v_2;
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+RomanianStemmer.prototype.r_vowel_suffix$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var cursor$0;
+ this.ket = this.cursor;
+ among_var = this.find_among_b$ALAmong$I(RomanianStemmer.a_5, 5);
+ if (among_var === 0) {
+ return false;
+ }
+ this.bra = cursor$0 = this.cursor;
+ if (! (! (this.I_pV <= cursor$0) ? false : true)) {
+ return false;
+ }
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+RomanianStemmer.prototype.stem$ = function () {
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var v_3;
+ /** @type {!number} */
+ var v_4;
+ /** @type {!number} */
+ var v_5;
+ /** @type {!number} */
+ var v_6;
+ /** @type {!number} */
+ var v_8;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!boolean} */
+ var lab2;
+ /** @type {!boolean} */
+ var lab3;
+ /** @type {!boolean} */
+ var lab4;
+ /** @type {!boolean} */
+ var lab5;
+ /** @type {!boolean} */
+ var lab6;
+ /** @type {!boolean} */
+ var lab7;
+ /** @type {!boolean} */
+ var lab8;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var cursor$1;
+ /** @type {!number} */
+ var limit$0;
+ /** @type {!number} */
+ var cursor$2;
+ /** @type {!number} */
+ var limit$1;
+ /** @type {!number} */
+ var cursor$3;
+ /** @type {!number} */
+ var limit$2;
+ /** @type {!number} */
+ var cursor$4;
+ /** @type {!number} */
+ var cursor$5;
+ v_1 = this.cursor;
+ lab0 = true;
+lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ if (! this.r_prelude$()) {
+ break lab0;
+ }
+ }
+ cursor$0 = this.cursor = v_1;
+ v_2 = cursor$0;
+ lab1 = true;
+lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ if (! this.r_mark_regions$()) {
+ break lab1;
+ }
+ }
+ cursor$1 = this.cursor = v_2;
+ this.limit_backward = cursor$1;
+ cursor$2 = this.cursor = limit$0 = this.limit;
+ v_3 = limit$0 - cursor$2;
+ lab2 = true;
+lab2:
+ while (lab2 === true) {
+ lab2 = false;
+ if (! this.r_step_0$()) {
+ break lab2;
+ }
+ }
+ cursor$3 = this.cursor = (limit$1 = this.limit) - v_3;
+ v_4 = limit$1 - cursor$3;
+ lab3 = true;
+lab3:
+ while (lab3 === true) {
+ lab3 = false;
+ if (! this.r_standard_suffix$()) {
+ break lab3;
+ }
+ }
+ cursor$4 = this.cursor = (limit$2 = this.limit) - v_4;
+ v_5 = limit$2 - cursor$4;
+ lab4 = true;
+lab4:
+ while (lab4 === true) {
+ lab4 = false;
+ lab5 = true;
+ lab5:
+ while (lab5 === true) {
+ lab5 = false;
+ v_6 = this.limit - this.cursor;
+ lab6 = true;
+ lab6:
+ while (lab6 === true) {
+ lab6 = false;
+ if (! this.B_standard_suffix_removed) {
+ break lab6;
+ }
+ break lab5;
+ }
+ this.cursor = this.limit - v_6;
+ if (! this.r_verb_suffix$()) {
+ break lab4;
+ }
+ }
+ }
+ this.cursor = this.limit - v_5;
+ lab7 = true;
+lab7:
+ while (lab7 === true) {
+ lab7 = false;
+ if (! this.r_vowel_suffix$()) {
+ break lab7;
+ }
+ }
+ cursor$5 = this.cursor = this.limit_backward;
+ v_8 = cursor$5;
+ lab8 = true;
+lab8:
+ while (lab8 === true) {
+ lab8 = false;
+ if (! this.r_postlude$()) {
+ break lab8;
+ }
+ }
+ this.cursor = v_8;
+ return true;
+};
+
+/**
+ * @param {*} o
+ * @return {!boolean}
+ */
+RomanianStemmer.prototype.equals$X = function (o) {
+ return o instanceof RomanianStemmer;
+};
+
+/**
+ * @return {!number}
+ */
+RomanianStemmer.prototype.hashCode$ = function () {
+ /** @type {!string} */
+ var classname;
+ /** @type {!number} */
+ var hash;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var char;
+ classname = "RomanianStemmer";
+ hash = 0;
+ if ("RomanianStemmer".length === 0) {
+ return (hash | 0);
+ }
+ for (i = 0; i < classname.length; i++) {
+ char = classname.charCodeAt(i);
+ hash = (hash << 5) - hash + char;
+ hash = hash & hash;
+ }
+ return (hash | 0);
+};
+
+/**
+ * class PortugueseStemmer extends BaseStemmer
+ * @constructor
+ */
+function PortugueseStemmer() {
+}
+
+PortugueseStemmer.prototype = new BaseStemmer;
+/**
+ * @constructor
+ */
+function PortugueseStemmer$() {
+ BaseStemmer$.call(this);
+ this.I_p2 = 0;
+ this.I_p1 = 0;
+ this.I_pV = 0;
+};
+
+PortugueseStemmer$.prototype = new PortugueseStemmer;
+
+/**
+ * @param {PortugueseStemmer} other
+ */
+PortugueseStemmer.prototype.copy_from$LPortugueseStemmer$ = function (other) {
+ this.I_p2 = other.I_p2;
+ this.I_p1 = other.I_p1;
+ this.I_pV = other.I_pV;
+ BaseStemmer.prototype.copy_from$LBaseStemmer$.call(this, other);
+};
+
+/**
+ * @return {!boolean}
+ */
+PortugueseStemmer.prototype.r_prelude$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var v_1;
+ /** @type {!boolean} */
+ var lab1;
+replab0:
+ while (true) {
+ v_1 = this.cursor;
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ this.bra = this.cursor;
+ among_var = this.find_among$ALAmong$I(PortugueseStemmer.a_0, 3);
+ if (among_var === 0) {
+ break lab1;
+ }
+ this.ket = this.cursor;
+ switch (among_var) {
+ case 0:
+ break lab1;
+ case 1:
+ if (! this.slice_from$S("a~")) {
+ return false;
+ }
+ break;
+ case 2:
+ if (! this.slice_from$S("o~")) {
+ return false;
+ }
+ break;
+ case 3:
+ if (this.cursor >= this.limit) {
+ break lab1;
+ }
+ this.cursor++;
+ break;
+ }
+ continue replab0;
+ }
+ this.cursor = v_1;
+ break replab0;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+PortugueseStemmer.prototype.r_mark_regions$ = function () {
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var v_3;
+ /** @type {!number} */
+ var v_6;
+ /** @type {!number} */
+ var v_8;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!boolean} */
+ var lab2;
+ /** @type {!boolean} */
+ var lab3;
+ /** @type {!boolean} */
+ var lab4;
+ /** @type {!boolean} */
+ var lab6;
+ /** @type {!boolean} */
+ var lab8;
+ /** @type {!boolean} */
+ var lab9;
+ /** @type {!boolean} */
+ var lab10;
+ /** @type {!boolean} */
+ var lab12;
+ /** @type {!boolean} */
+ var lab13;
+ /** @type {!boolean} */
+ var lab15;
+ /** @type {!boolean} */
+ var lab17;
+ /** @type {!boolean} */
+ var lab19;
+ /** @type {!boolean} */
+ var lab21;
+ /** @type {!number} */
+ var limit$0;
+ /** @type {!number} */
+ var cursor$0;
+ this.I_pV = limit$0 = this.limit;
+ this.I_p1 = limit$0;
+ this.I_p2 = limit$0;
+ v_1 = this.cursor;
+ lab0 = true;
+lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ v_2 = this.cursor;
+ lab2 = true;
+ lab2:
+ while (lab2 === true) {
+ lab2 = false;
+ if (! this.in_grouping$AIII(PortugueseStemmer.g_v, 97, 250)) {
+ break lab2;
+ }
+ lab3 = true;
+ lab3:
+ while (lab3 === true) {
+ lab3 = false;
+ v_3 = this.cursor;
+ lab4 = true;
+ lab4:
+ while (lab4 === true) {
+ lab4 = false;
+ if (! this.out_grouping$AIII(PortugueseStemmer.g_v, 97, 250)) {
+ break lab4;
+ }
+ golab5:
+ while (true) {
+ lab6 = true;
+ lab6:
+ while (lab6 === true) {
+ lab6 = false;
+ if (! this.in_grouping$AIII(PortugueseStemmer.g_v, 97, 250)) {
+ break lab6;
+ }
+ break golab5;
+ }
+ if (this.cursor >= this.limit) {
+ break lab4;
+ }
+ this.cursor++;
+ }
+ break lab3;
+ }
+ this.cursor = v_3;
+ if (! this.in_grouping$AIII(PortugueseStemmer.g_v, 97, 250)) {
+ break lab2;
+ }
+ golab7:
+ while (true) {
+ lab8 = true;
+ lab8:
+ while (lab8 === true) {
+ lab8 = false;
+ if (! this.out_grouping$AIII(PortugueseStemmer.g_v, 97, 250)) {
+ break lab8;
+ }
+ break golab7;
+ }
+ if (this.cursor >= this.limit) {
+ break lab2;
+ }
+ this.cursor++;
+ }
+ }
+ break lab1;
+ }
+ this.cursor = v_2;
+ if (! this.out_grouping$AIII(PortugueseStemmer.g_v, 97, 250)) {
+ break lab0;
+ }
+ lab9 = true;
+ lab9:
+ while (lab9 === true) {
+ lab9 = false;
+ v_6 = this.cursor;
+ lab10 = true;
+ lab10:
+ while (lab10 === true) {
+ lab10 = false;
+ if (! this.out_grouping$AIII(PortugueseStemmer.g_v, 97, 250)) {
+ break lab10;
+ }
+ golab11:
+ while (true) {
+ lab12 = true;
+ lab12:
+ while (lab12 === true) {
+ lab12 = false;
+ if (! this.in_grouping$AIII(PortugueseStemmer.g_v, 97, 250)) {
+ break lab12;
+ }
+ break golab11;
+ }
+ if (this.cursor >= this.limit) {
+ break lab10;
+ }
+ this.cursor++;
+ }
+ break lab9;
+ }
+ this.cursor = v_6;
+ if (! this.in_grouping$AIII(PortugueseStemmer.g_v, 97, 250)) {
+ break lab0;
+ }
+ if (this.cursor >= this.limit) {
+ break lab0;
+ }
+ this.cursor++;
+ }
+ }
+ this.I_pV = this.cursor;
+ }
+ cursor$0 = this.cursor = v_1;
+ v_8 = cursor$0;
+ lab13 = true;
+lab13:
+ while (lab13 === true) {
+ lab13 = false;
+ golab14:
+ while (true) {
+ lab15 = true;
+ lab15:
+ while (lab15 === true) {
+ lab15 = false;
+ if (! this.in_grouping$AIII(PortugueseStemmer.g_v, 97, 250)) {
+ break lab15;
+ }
+ break golab14;
+ }
+ if (this.cursor >= this.limit) {
+ break lab13;
+ }
+ this.cursor++;
+ }
+ golab16:
+ while (true) {
+ lab17 = true;
+ lab17:
+ while (lab17 === true) {
+ lab17 = false;
+ if (! this.out_grouping$AIII(PortugueseStemmer.g_v, 97, 250)) {
+ break lab17;
+ }
+ break golab16;
+ }
+ if (this.cursor >= this.limit) {
+ break lab13;
+ }
+ this.cursor++;
+ }
+ this.I_p1 = this.cursor;
+ golab18:
+ while (true) {
+ lab19 = true;
+ lab19:
+ while (lab19 === true) {
+ lab19 = false;
+ if (! this.in_grouping$AIII(PortugueseStemmer.g_v, 97, 250)) {
+ break lab19;
+ }
+ break golab18;
+ }
+ if (this.cursor >= this.limit) {
+ break lab13;
+ }
+ this.cursor++;
+ }
+ golab20:
+ while (true) {
+ lab21 = true;
+ lab21:
+ while (lab21 === true) {
+ lab21 = false;
+ if (! this.out_grouping$AIII(PortugueseStemmer.g_v, 97, 250)) {
+ break lab21;
+ }
+ break golab20;
+ }
+ if (this.cursor >= this.limit) {
+ break lab13;
+ }
+ this.cursor++;
+ }
+ this.I_p2 = this.cursor;
+ }
+ this.cursor = v_8;
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+PortugueseStemmer.prototype.r_postlude$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var v_1;
+ /** @type {!boolean} */
+ var lab1;
+replab0:
+ while (true) {
+ v_1 = this.cursor;
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ this.bra = this.cursor;
+ among_var = this.find_among$ALAmong$I(PortugueseStemmer.a_1, 3);
+ if (among_var === 0) {
+ break lab1;
+ }
+ this.ket = this.cursor;
+ switch (among_var) {
+ case 0:
+ break lab1;
+ case 1:
+ if (! this.slice_from$S("\u00E3")) {
+ return false;
+ }
+ break;
+ case 2:
+ if (! this.slice_from$S("\u00F5")) {
+ return false;
+ }
+ break;
+ case 3:
+ if (this.cursor >= this.limit) {
+ break lab1;
+ }
+ this.cursor++;
+ break;
+ }
+ continue replab0;
+ }
+ this.cursor = v_1;
+ break replab0;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+PortugueseStemmer.prototype.r_RV$ = function () {
+ return (! (this.I_pV <= this.cursor) ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+PortugueseStemmer.prototype.r_R1$ = function () {
+ return (! (this.I_p1 <= this.cursor) ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+PortugueseStemmer.prototype.r_R2$ = function () {
+ return (! (this.I_p2 <= this.cursor) ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+PortugueseStemmer.prototype.r_standard_suffix$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var v_3;
+ /** @type {!number} */
+ var v_4;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!boolean} */
+ var lab2;
+ /** @type {!boolean} */
+ var lab3;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var cursor$1;
+ /** @type {!number} */
+ var cursor$2;
+ this.ket = this.cursor;
+ among_var = this.find_among_b$ALAmong$I(PortugueseStemmer.a_5, 45);
+ if (among_var === 0) {
+ return false;
+ }
+ this.bra = this.cursor;
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ if (! (! (this.I_p2 <= this.cursor) ? false : true)) {
+ return false;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 2:
+ if (! (! (this.I_p2 <= this.cursor) ? false : true)) {
+ return false;
+ }
+ if (! this.slice_from$S("log")) {
+ return false;
+ }
+ break;
+ case 3:
+ if (! (! (this.I_p2 <= this.cursor) ? false : true)) {
+ return false;
+ }
+ if (! this.slice_from$S("u")) {
+ return false;
+ }
+ break;
+ case 4:
+ if (! (! (this.I_p2 <= this.cursor) ? false : true)) {
+ return false;
+ }
+ if (! this.slice_from$S("ente")) {
+ return false;
+ }
+ break;
+ case 5:
+ if (! (! (this.I_p1 <= this.cursor) ? false : true)) {
+ return false;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ v_1 = this.limit - this.cursor;
+ lab0 = true;
+ lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ this.ket = this.cursor;
+ among_var = this.find_among_b$ALAmong$I(PortugueseStemmer.a_2, 4);
+ if (among_var === 0) {
+ this.cursor = this.limit - v_1;
+ break lab0;
+ }
+ this.bra = cursor$0 = this.cursor;
+ if (! (! (this.I_p2 <= cursor$0) ? false : true)) {
+ this.cursor = this.limit - v_1;
+ break lab0;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ switch (among_var) {
+ case 0:
+ this.cursor = this.limit - v_1;
+ break lab0;
+ case 1:
+ this.ket = this.cursor;
+ if (! this.eq_s_b$IS(2, "at")) {
+ this.cursor = this.limit - v_1;
+ break lab0;
+ }
+ this.bra = cursor$1 = this.cursor;
+ if (! (! (this.I_p2 <= cursor$1) ? false : true)) {
+ this.cursor = this.limit - v_1;
+ break lab0;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ }
+ }
+ break;
+ case 6:
+ if (! (! (this.I_p2 <= this.cursor) ? false : true)) {
+ return false;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ v_2 = this.limit - this.cursor;
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ this.ket = this.cursor;
+ among_var = this.find_among_b$ALAmong$I(PortugueseStemmer.a_3, 3);
+ if (among_var === 0) {
+ this.cursor = this.limit - v_2;
+ break lab1;
+ }
+ this.bra = this.cursor;
+ switch (among_var) {
+ case 0:
+ this.cursor = this.limit - v_2;
+ break lab1;
+ case 1:
+ if (! (! (this.I_p2 <= this.cursor) ? false : true)) {
+ this.cursor = this.limit - v_2;
+ break lab1;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ }
+ }
+ break;
+ case 7:
+ if (! (! (this.I_p2 <= this.cursor) ? false : true)) {
+ return false;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ v_3 = this.limit - this.cursor;
+ lab2 = true;
+ lab2:
+ while (lab2 === true) {
+ lab2 = false;
+ this.ket = this.cursor;
+ among_var = this.find_among_b$ALAmong$I(PortugueseStemmer.a_4, 3);
+ if (among_var === 0) {
+ this.cursor = this.limit - v_3;
+ break lab2;
+ }
+ this.bra = this.cursor;
+ switch (among_var) {
+ case 0:
+ this.cursor = this.limit - v_3;
+ break lab2;
+ case 1:
+ if (! (! (this.I_p2 <= this.cursor) ? false : true)) {
+ this.cursor = this.limit - v_3;
+ break lab2;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ }
+ }
+ break;
+ case 8:
+ if (! (! (this.I_p2 <= this.cursor) ? false : true)) {
+ return false;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ v_4 = this.limit - this.cursor;
+ lab3 = true;
+ lab3:
+ while (lab3 === true) {
+ lab3 = false;
+ this.ket = this.cursor;
+ if (! this.eq_s_b$IS(2, "at")) {
+ this.cursor = this.limit - v_4;
+ break lab3;
+ }
+ this.bra = cursor$2 = this.cursor;
+ if (! (! (this.I_p2 <= cursor$2) ? false : true)) {
+ this.cursor = this.limit - v_4;
+ break lab3;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ }
+ break;
+ case 9:
+ if (! (! (this.I_pV <= this.cursor) ? false : true)) {
+ return false;
+ }
+ if (! this.eq_s_b$IS(1, "e")) {
+ return false;
+ }
+ if (! this.slice_from$S("ir")) {
+ return false;
+ }
+ break;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+PortugueseStemmer.prototype.r_verb_suffix$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var cursor$1;
+ /** @type {!number} */
+ var cursor$2;
+ v_1 = this.limit - (cursor$0 = this.cursor);
+ if (cursor$0 < this.I_pV) {
+ return false;
+ }
+ cursor$1 = this.cursor = this.I_pV;
+ v_2 = this.limit_backward;
+ this.limit_backward = cursor$1;
+ cursor$2 = this.cursor = this.limit - v_1;
+ this.ket = cursor$2;
+ among_var = this.find_among_b$ALAmong$I(PortugueseStemmer.a_6, 120);
+ if (among_var === 0) {
+ this.limit_backward = v_2;
+ return false;
+ }
+ this.bra = this.cursor;
+ switch (among_var) {
+ case 0:
+ this.limit_backward = v_2;
+ return false;
+ case 1:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ }
+ this.limit_backward = v_2;
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+PortugueseStemmer.prototype.r_residual_suffix$ = function () {
+ /** @type {!number} */
+ var among_var;
+ this.ket = this.cursor;
+ among_var = this.find_among_b$ALAmong$I(PortugueseStemmer.a_7, 7);
+ if (among_var === 0) {
+ return false;
+ }
+ this.bra = this.cursor;
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ if (! (! (this.I_pV <= this.cursor) ? false : true)) {
+ return false;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+PortugueseStemmer.prototype.r_residual_form$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var v_3;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var cursor$1;
+ this.ket = this.cursor;
+ among_var = this.find_among_b$ALAmong$I(PortugueseStemmer.a_8, 4);
+ if (among_var === 0) {
+ return false;
+ }
+ this.bra = this.cursor;
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ if (! (! (this.I_pV <= this.cursor) ? false : true)) {
+ return false;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ this.ket = this.cursor;
+ lab0 = true;
+ lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ v_1 = this.limit - this.cursor;
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ if (! this.eq_s_b$IS(1, "u")) {
+ break lab1;
+ }
+ this.bra = cursor$0 = this.cursor;
+ v_2 = this.limit - cursor$0;
+ if (! this.eq_s_b$IS(1, "g")) {
+ break lab1;
+ }
+ this.cursor = this.limit - v_2;
+ break lab0;
+ }
+ this.cursor = this.limit - v_1;
+ if (! this.eq_s_b$IS(1, "i")) {
+ return false;
+ }
+ this.bra = cursor$1 = this.cursor;
+ v_3 = this.limit - cursor$1;
+ if (! this.eq_s_b$IS(1, "c")) {
+ return false;
+ }
+ this.cursor = this.limit - v_3;
+ }
+ if (! (! (this.I_pV <= this.cursor) ? false : true)) {
+ return false;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 2:
+ if (! this.slice_from$S("c")) {
+ return false;
+ }
+ break;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+PortugueseStemmer.prototype.stem$ = function () {
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var v_3;
+ /** @type {!number} */
+ var v_4;
+ /** @type {!number} */
+ var v_5;
+ /** @type {!number} */
+ var v_6;
+ /** @type {!number} */
+ var v_7;
+ /** @type {!number} */
+ var v_8;
+ /** @type {!number} */
+ var v_10;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!boolean} */
+ var lab2;
+ /** @type {!boolean} */
+ var lab3;
+ /** @type {!boolean} */
+ var lab4;
+ /** @type {!boolean} */
+ var lab5;
+ /** @type {!boolean} */
+ var lab6;
+ /** @type {!boolean} */
+ var lab7;
+ /** @type {!boolean} */
+ var lab8;
+ /** @type {!boolean} */
+ var lab9;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var cursor$1;
+ /** @type {!number} */
+ var cursor$2;
+ /** @type {!number} */
+ var limit$0;
+ /** @type {!number} */
+ var cursor$3;
+ /** @type {!number} */
+ var cursor$4;
+ /** @type {!number} */
+ var limit$1;
+ /** @type {!number} */
+ var cursor$5;
+ /** @type {!number} */
+ var cursor$6;
+ v_1 = this.cursor;
+ lab0 = true;
+lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ if (! this.r_prelude$()) {
+ break lab0;
+ }
+ }
+ cursor$0 = this.cursor = v_1;
+ v_2 = cursor$0;
+ lab1 = true;
+lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ if (! this.r_mark_regions$()) {
+ break lab1;
+ }
+ }
+ cursor$4 = this.cursor = v_2;
+ this.limit_backward = cursor$4;
+ cursor$5 = this.cursor = limit$1 = this.limit;
+ v_3 = limit$1 - cursor$5;
+ lab2 = true;
+lab2:
+ while (lab2 === true) {
+ lab2 = false;
+ lab3 = true;
+ lab3:
+ while (lab3 === true) {
+ lab3 = false;
+ v_4 = this.limit - this.cursor;
+ lab4 = true;
+ lab4:
+ while (lab4 === true) {
+ lab4 = false;
+ v_5 = this.limit - this.cursor;
+ lab5 = true;
+ lab5:
+ while (lab5 === true) {
+ lab5 = false;
+ v_6 = this.limit - this.cursor;
+ lab6 = true;
+ lab6:
+ while (lab6 === true) {
+ lab6 = false;
+ if (! this.r_standard_suffix$()) {
+ break lab6;
+ }
+ break lab5;
+ }
+ this.cursor = this.limit - v_6;
+ if (! this.r_verb_suffix$()) {
+ break lab4;
+ }
+ }
+ cursor$3 = this.cursor = (limit$0 = this.limit) - v_5;
+ v_7 = limit$0 - cursor$3;
+ lab7 = true;
+ lab7:
+ while (lab7 === true) {
+ lab7 = false;
+ this.ket = this.cursor;
+ if (! this.eq_s_b$IS(1, "i")) {
+ break lab7;
+ }
+ this.bra = cursor$1 = this.cursor;
+ v_8 = this.limit - cursor$1;
+ if (! this.eq_s_b$IS(1, "c")) {
+ break lab7;
+ }
+ cursor$2 = this.cursor = this.limit - v_8;
+ if (! (! (this.I_pV <= cursor$2) ? false : true)) {
+ break lab7;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ }
+ this.cursor = this.limit - v_7;
+ break lab3;
+ }
+ this.cursor = this.limit - v_4;
+ if (! this.r_residual_suffix$()) {
+ break lab2;
+ }
+ }
+ }
+ this.cursor = this.limit - v_3;
+ lab8 = true;
+lab8:
+ while (lab8 === true) {
+ lab8 = false;
+ if (! this.r_residual_form$()) {
+ break lab8;
+ }
+ }
+ cursor$6 = this.cursor = this.limit_backward;
+ v_10 = cursor$6;
+ lab9 = true;
+lab9:
+ while (lab9 === true) {
+ lab9 = false;
+ if (! this.r_postlude$()) {
+ break lab9;
+ }
+ }
+ this.cursor = v_10;
+ return true;
+};
+
+/**
+ * @param {*} o
+ * @return {!boolean}
+ */
+PortugueseStemmer.prototype.equals$X = function (o) {
+ return o instanceof PortugueseStemmer;
+};
+
+/**
+ * @return {!number}
+ */
+PortugueseStemmer.prototype.hashCode$ = function () {
+ /** @type {!string} */
+ var classname;
+ /** @type {!number} */
+ var hash;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var char;
+ classname = "PortugueseStemmer";
+ hash = 0;
+ if ("PortugueseStemmer".length === 0) {
+ return (hash | 0);
+ }
+ for (i = 0; i < classname.length; i++) {
+ char = classname.charCodeAt(i);
+ hash = (hash << 5) - hash + char;
+ hash = hash & hash;
+ }
+ return (hash | 0);
+};
+
+/**
+ * class PorterStemmer extends BaseStemmer
+ * @constructor
+ */
+function PorterStemmer() {
+}
+
+PorterStemmer.prototype = new BaseStemmer;
+/**
+ * @constructor
+ */
+function PorterStemmer$() {
+ BaseStemmer$.call(this);
+ this.B_Y_found = false;
+ this.I_p2 = 0;
+ this.I_p1 = 0;
+};
+
+PorterStemmer$.prototype = new PorterStemmer;
+
+/**
+ * @param {PorterStemmer} other
+ */
+PorterStemmer.prototype.copy_from$LPorterStemmer$ = function (other) {
+ this.B_Y_found = other.B_Y_found;
+ this.I_p2 = other.I_p2;
+ this.I_p1 = other.I_p1;
+ BaseStemmer.prototype.copy_from$LBaseStemmer$.call(this, other);
+};
+
+/**
+ * @return {!boolean}
+ */
+PorterStemmer.prototype.r_shortv$ = function () {
+ return (! this.out_grouping_b$AIII(PorterStemmer.g_v_WXY, 89, 121) ? false : ! this.in_grouping_b$AIII(PorterStemmer.g_v, 97, 121) ? false : ! this.out_grouping_b$AIII(PorterStemmer.g_v, 97, 121) ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+PorterStemmer.prototype.r_R1$ = function () {
+ return (! (this.I_p1 <= this.cursor) ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+PorterStemmer.prototype.r_R2$ = function () {
+ return (! (this.I_p2 <= this.cursor) ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+PorterStemmer.prototype.r_Step_1a$ = function () {
+ /** @type {!number} */
+ var among_var;
+ this.ket = this.cursor;
+ among_var = this.find_among_b$ALAmong$I(PorterStemmer.a_0, 4);
+ if (among_var === 0) {
+ return false;
+ }
+ this.bra = this.cursor;
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ if (! this.slice_from$S("ss")) {
+ return false;
+ }
+ break;
+ case 2:
+ if (! this.slice_from$S("i")) {
+ return false;
+ }
+ break;
+ case 3:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+PorterStemmer.prototype.r_Step_1b$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_3;
+ /** @type {!number} */
+ var v_4;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!number} */
+ var c;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var cursor$1;
+ /** @type {!number} */
+ var cursor$2;
+ this.ket = this.cursor;
+ among_var = this.find_among_b$ALAmong$I(PorterStemmer.a_2, 3);
+ if (among_var === 0) {
+ return false;
+ }
+ this.bra = this.cursor;
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ if (! (! (this.I_p1 <= this.cursor) ? false : true)) {
+ return false;
+ }
+ if (! this.slice_from$S("ee")) {
+ return false;
+ }
+ break;
+ case 2:
+ v_1 = this.limit - this.cursor;
+ golab0:
+ while (true) {
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ if (! this.in_grouping_b$AIII(PorterStemmer.g_v, 97, 121)) {
+ break lab1;
+ }
+ break golab0;
+ }
+ if (this.cursor <= this.limit_backward) {
+ return false;
+ }
+ this.cursor--;
+ }
+ this.cursor = this.limit - v_1;
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ v_3 = this.limit - this.cursor;
+ among_var = this.find_among_b$ALAmong$I(PorterStemmer.a_1, 13);
+ if (among_var === 0) {
+ return false;
+ }
+ this.cursor = this.limit - v_3;
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ c = cursor$0 = this.cursor;
+ this.insert$IIS(cursor$0, cursor$0, "e");
+ this.cursor = c;
+ break;
+ case 2:
+ this.ket = cursor$1 = this.cursor;
+ if (cursor$1 <= this.limit_backward) {
+ return false;
+ }
+ this.cursor--;
+ this.bra = this.cursor;
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 3:
+ if (this.cursor !== this.I_p1) {
+ return false;
+ }
+ v_4 = this.limit - this.cursor;
+ if (! this.r_shortv$()) {
+ return false;
+ }
+ cursor$2 = this.cursor = this.limit - v_4;
+ c = cursor$2;
+ this.insert$IIS(cursor$2, cursor$2, "e");
+ this.cursor = cursor$2;
+ break;
+ }
+ break;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+PorterStemmer.prototype.r_Step_1c$ = function () {
+ /** @type {!number} */
+ var v_1;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!boolean} */
+ var lab3;
+ this.ket = this.cursor;
+ lab0 = true;
+lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ v_1 = this.limit - this.cursor;
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ if (! this.eq_s_b$IS(1, "y")) {
+ break lab1;
+ }
+ break lab0;
+ }
+ this.cursor = this.limit - v_1;
+ if (! this.eq_s_b$IS(1, "Y")) {
+ return false;
+ }
+ }
+ this.bra = this.cursor;
+golab2:
+ while (true) {
+ lab3 = true;
+ lab3:
+ while (lab3 === true) {
+ lab3 = false;
+ if (! this.in_grouping_b$AIII(PorterStemmer.g_v, 97, 121)) {
+ break lab3;
+ }
+ break golab2;
+ }
+ if (this.cursor <= this.limit_backward) {
+ return false;
+ }
+ this.cursor--;
+ }
+ return (! this.slice_from$S("i") ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+PorterStemmer.prototype.r_Step_2$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var cursor$0;
+ this.ket = this.cursor;
+ among_var = this.find_among_b$ALAmong$I(PorterStemmer.a_3, 20);
+ if (among_var === 0) {
+ return false;
+ }
+ this.bra = cursor$0 = this.cursor;
+ if (! (! (this.I_p1 <= cursor$0) ? false : true)) {
+ return false;
+ }
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ if (! this.slice_from$S("tion")) {
+ return false;
+ }
+ break;
+ case 2:
+ if (! this.slice_from$S("ence")) {
+ return false;
+ }
+ break;
+ case 3:
+ if (! this.slice_from$S("ance")) {
+ return false;
+ }
+ break;
+ case 4:
+ if (! this.slice_from$S("able")) {
+ return false;
+ }
+ break;
+ case 5:
+ if (! this.slice_from$S("ent")) {
+ return false;
+ }
+ break;
+ case 6:
+ if (! this.slice_from$S("e")) {
+ return false;
+ }
+ break;
+ case 7:
+ if (! this.slice_from$S("ize")) {
+ return false;
+ }
+ break;
+ case 8:
+ if (! this.slice_from$S("ate")) {
+ return false;
+ }
+ break;
+ case 9:
+ if (! this.slice_from$S("al")) {
+ return false;
+ }
+ break;
+ case 10:
+ if (! this.slice_from$S("al")) {
+ return false;
+ }
+ break;
+ case 11:
+ if (! this.slice_from$S("ful")) {
+ return false;
+ }
+ break;
+ case 12:
+ if (! this.slice_from$S("ous")) {
+ return false;
+ }
+ break;
+ case 13:
+ if (! this.slice_from$S("ive")) {
+ return false;
+ }
+ break;
+ case 14:
+ if (! this.slice_from$S("ble")) {
+ return false;
+ }
+ break;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+PorterStemmer.prototype.r_Step_3$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var cursor$0;
+ this.ket = this.cursor;
+ among_var = this.find_among_b$ALAmong$I(PorterStemmer.a_4, 7);
+ if (among_var === 0) {
+ return false;
+ }
+ this.bra = cursor$0 = this.cursor;
+ if (! (! (this.I_p1 <= cursor$0) ? false : true)) {
+ return false;
+ }
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ if (! this.slice_from$S("al")) {
+ return false;
+ }
+ break;
+ case 2:
+ if (! this.slice_from$S("ic")) {
+ return false;
+ }
+ break;
+ case 3:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+PorterStemmer.prototype.r_Step_4$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var v_1;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!number} */
+ var cursor$0;
+ this.ket = this.cursor;
+ among_var = this.find_among_b$ALAmong$I(PorterStemmer.a_5, 19);
+ if (among_var === 0) {
+ return false;
+ }
+ this.bra = cursor$0 = this.cursor;
+ if (! (! (this.I_p2 <= cursor$0) ? false : true)) {
+ return false;
+ }
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 2:
+ lab0 = true;
+ lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ v_1 = this.limit - this.cursor;
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ if (! this.eq_s_b$IS(1, "s")) {
+ break lab1;
+ }
+ break lab0;
+ }
+ this.cursor = this.limit - v_1;
+ if (! this.eq_s_b$IS(1, "t")) {
+ return false;
+ }
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+PorterStemmer.prototype.r_Step_5a$ = function () {
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!boolean} */
+ var lab2;
+ /** @type {!number} */
+ var cursor$0;
+ this.ket = this.cursor;
+ if (! this.eq_s_b$IS(1, "e")) {
+ return false;
+ }
+ this.bra = this.cursor;
+ lab0 = true;
+lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ v_1 = this.limit - this.cursor;
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ if (! (! (this.I_p2 <= this.cursor) ? false : true)) {
+ break lab1;
+ }
+ break lab0;
+ }
+ cursor$0 = this.cursor = this.limit - v_1;
+ if (! (! (this.I_p1 <= cursor$0) ? false : true)) {
+ return false;
+ }
+ v_2 = this.limit - this.cursor;
+ lab2 = true;
+ lab2:
+ while (lab2 === true) {
+ lab2 = false;
+ if (! this.r_shortv$()) {
+ break lab2;
+ }
+ return false;
+ }
+ this.cursor = this.limit - v_2;
+ }
+ return (! this.slice_from$S("") ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+PorterStemmer.prototype.r_Step_5b$ = function () {
+ /** @type {!number} */
+ var cursor$0;
+ this.ket = this.cursor;
+ if (! this.eq_s_b$IS(1, "l")) {
+ return false;
+ }
+ this.bra = cursor$0 = this.cursor;
+ return (! (! (this.I_p2 <= cursor$0) ? false : true) ? false : ! this.eq_s_b$IS(1, "l") ? false : ! this.slice_from$S("") ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+PorterStemmer.prototype.stem$ = function () {
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var v_3;
+ /** @type {!number} */
+ var v_4;
+ /** @type {!number} */
+ var v_5;
+ /** @type {!number} */
+ var v_10;
+ /** @type {!number} */
+ var v_11;
+ /** @type {!number} */
+ var v_12;
+ /** @type {!number} */
+ var v_13;
+ /** @type {!number} */
+ var v_14;
+ /** @type {!number} */
+ var v_15;
+ /** @type {!number} */
+ var v_16;
+ /** @type {!number} */
+ var v_18;
+ /** @type {!number} */
+ var v_19;
+ /** @type {!number} */
+ var v_20;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!boolean} */
+ var lab3;
+ /** @type {!boolean} */
+ var lab5;
+ /** @type {!boolean} */
+ var lab6;
+ /** @type {!boolean} */
+ var lab8;
+ /** @type {!boolean} */
+ var lab10;
+ /** @type {!boolean} */
+ var lab12;
+ /** @type {!boolean} */
+ var lab14;
+ /** @type {!boolean} */
+ var lab15;
+ /** @type {!boolean} */
+ var lab16;
+ /** @type {!boolean} */
+ var lab17;
+ /** @type {!boolean} */
+ var lab18;
+ /** @type {!boolean} */
+ var lab19;
+ /** @type {!boolean} */
+ var lab20;
+ /** @type {!boolean} */
+ var lab21;
+ /** @type {!boolean} */
+ var lab22;
+ /** @type {!boolean} */
+ var lab23;
+ /** @type {!boolean} */
+ var lab25;
+ /** @type {!boolean} */
+ var lab27;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var cursor$1;
+ /** @type {!number} */
+ var limit$0;
+ /** @type {!number} */
+ var cursor$2;
+ /** @type {!number} */
+ var cursor$3;
+ /** @type {!number} */
+ var limit$1;
+ /** @type {!number} */
+ var cursor$4;
+ /** @type {!number} */
+ var limit$2;
+ /** @type {!number} */
+ var cursor$5;
+ /** @type {!number} */
+ var limit$3;
+ /** @type {!number} */
+ var cursor$6;
+ /** @type {!number} */
+ var limit$4;
+ /** @type {!number} */
+ var cursor$7;
+ /** @type {!number} */
+ var limit$5;
+ /** @type {!number} */
+ var cursor$8;
+ /** @type {!number} */
+ var limit$6;
+ /** @type {!number} */
+ var cursor$9;
+ /** @type {!number} */
+ var limit$7;
+ /** @type {!number} */
+ var cursor$10;
+ /** @type {!number} */
+ var cursor$11;
+ /** @type {!number} */
+ var cursor$12;
+ this.B_Y_found = false;
+ v_1 = this.cursor;
+ lab0 = true;
+lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ this.bra = this.cursor;
+ if (! this.eq_s$IS(1, "y")) {
+ break lab0;
+ }
+ this.ket = this.cursor;
+ if (! this.slice_from$S("Y")) {
+ return false;
+ }
+ this.B_Y_found = true;
+ }
+ cursor$1 = this.cursor = v_1;
+ v_2 = cursor$1;
+ lab1 = true;
+lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ replab2:
+ while (true) {
+ v_3 = this.cursor;
+ lab3 = true;
+ lab3:
+ while (lab3 === true) {
+ lab3 = false;
+ golab4:
+ while (true) {
+ v_4 = this.cursor;
+ lab5 = true;
+ lab5:
+ while (lab5 === true) {
+ lab5 = false;
+ if (! this.in_grouping$AIII(PorterStemmer.g_v, 97, 121)) {
+ break lab5;
+ }
+ this.bra = this.cursor;
+ if (! this.eq_s$IS(1, "y")) {
+ break lab5;
+ }
+ this.ket = this.cursor;
+ this.cursor = v_4;
+ break golab4;
+ }
+ cursor$0 = this.cursor = v_4;
+ if (cursor$0 >= this.limit) {
+ break lab3;
+ }
+ this.cursor++;
+ }
+ if (! this.slice_from$S("Y")) {
+ return false;
+ }
+ this.B_Y_found = true;
+ continue replab2;
+ }
+ this.cursor = v_3;
+ break replab2;
+ }
+ }
+ cursor$2 = this.cursor = v_2;
+ this.I_p1 = limit$0 = this.limit;
+ this.I_p2 = limit$0;
+ v_5 = cursor$2;
+ lab6 = true;
+lab6:
+ while (lab6 === true) {
+ lab6 = false;
+ golab7:
+ while (true) {
+ lab8 = true;
+ lab8:
+ while (lab8 === true) {
+ lab8 = false;
+ if (! this.in_grouping$AIII(PorterStemmer.g_v, 97, 121)) {
+ break lab8;
+ }
+ break golab7;
+ }
+ if (this.cursor >= this.limit) {
+ break lab6;
+ }
+ this.cursor++;
+ }
+ golab9:
+ while (true) {
+ lab10 = true;
+ lab10:
+ while (lab10 === true) {
+ lab10 = false;
+ if (! this.out_grouping$AIII(PorterStemmer.g_v, 97, 121)) {
+ break lab10;
+ }
+ break golab9;
+ }
+ if (this.cursor >= this.limit) {
+ break lab6;
+ }
+ this.cursor++;
+ }
+ this.I_p1 = this.cursor;
+ golab11:
+ while (true) {
+ lab12 = true;
+ lab12:
+ while (lab12 === true) {
+ lab12 = false;
+ if (! this.in_grouping$AIII(PorterStemmer.g_v, 97, 121)) {
+ break lab12;
+ }
+ break golab11;
+ }
+ if (this.cursor >= this.limit) {
+ break lab6;
+ }
+ this.cursor++;
+ }
+ golab13:
+ while (true) {
+ lab14 = true;
+ lab14:
+ while (lab14 === true) {
+ lab14 = false;
+ if (! this.out_grouping$AIII(PorterStemmer.g_v, 97, 121)) {
+ break lab14;
+ }
+ break golab13;
+ }
+ if (this.cursor >= this.limit) {
+ break lab6;
+ }
+ this.cursor++;
+ }
+ this.I_p2 = this.cursor;
+ }
+ cursor$3 = this.cursor = v_5;
+ this.limit_backward = cursor$3;
+ cursor$4 = this.cursor = limit$1 = this.limit;
+ v_10 = limit$1 - cursor$4;
+ lab15 = true;
+lab15:
+ while (lab15 === true) {
+ lab15 = false;
+ if (! this.r_Step_1a$()) {
+ break lab15;
+ }
+ }
+ cursor$5 = this.cursor = (limit$2 = this.limit) - v_10;
+ v_11 = limit$2 - cursor$5;
+ lab16 = true;
+lab16:
+ while (lab16 === true) {
+ lab16 = false;
+ if (! this.r_Step_1b$()) {
+ break lab16;
+ }
+ }
+ cursor$6 = this.cursor = (limit$3 = this.limit) - v_11;
+ v_12 = limit$3 - cursor$6;
+ lab17 = true;
+lab17:
+ while (lab17 === true) {
+ lab17 = false;
+ if (! this.r_Step_1c$()) {
+ break lab17;
+ }
+ }
+ cursor$7 = this.cursor = (limit$4 = this.limit) - v_12;
+ v_13 = limit$4 - cursor$7;
+ lab18 = true;
+lab18:
+ while (lab18 === true) {
+ lab18 = false;
+ if (! this.r_Step_2$()) {
+ break lab18;
+ }
+ }
+ cursor$8 = this.cursor = (limit$5 = this.limit) - v_13;
+ v_14 = limit$5 - cursor$8;
+ lab19 = true;
+lab19:
+ while (lab19 === true) {
+ lab19 = false;
+ if (! this.r_Step_3$()) {
+ break lab19;
+ }
+ }
+ cursor$9 = this.cursor = (limit$6 = this.limit) - v_14;
+ v_15 = limit$6 - cursor$9;
+ lab20 = true;
+lab20:
+ while (lab20 === true) {
+ lab20 = false;
+ if (! this.r_Step_4$()) {
+ break lab20;
+ }
+ }
+ cursor$10 = this.cursor = (limit$7 = this.limit) - v_15;
+ v_16 = limit$7 - cursor$10;
+ lab21 = true;
+lab21:
+ while (lab21 === true) {
+ lab21 = false;
+ if (! this.r_Step_5a$()) {
+ break lab21;
+ }
+ }
+ this.cursor = this.limit - v_16;
+ lab22 = true;
+lab22:
+ while (lab22 === true) {
+ lab22 = false;
+ if (! this.r_Step_5b$()) {
+ break lab22;
+ }
+ }
+ cursor$12 = this.cursor = this.limit_backward;
+ v_18 = cursor$12;
+ lab23 = true;
+lab23:
+ while (lab23 === true) {
+ lab23 = false;
+ if (! this.B_Y_found) {
+ break lab23;
+ }
+ replab24:
+ while (true) {
+ v_19 = this.cursor;
+ lab25 = true;
+ lab25:
+ while (lab25 === true) {
+ lab25 = false;
+ golab26:
+ while (true) {
+ v_20 = this.cursor;
+ lab27 = true;
+ lab27:
+ while (lab27 === true) {
+ lab27 = false;
+ this.bra = this.cursor;
+ if (! this.eq_s$IS(1, "Y")) {
+ break lab27;
+ }
+ this.ket = this.cursor;
+ this.cursor = v_20;
+ break golab26;
+ }
+ cursor$11 = this.cursor = v_20;
+ if (cursor$11 >= this.limit) {
+ break lab25;
+ }
+ this.cursor++;
+ }
+ if (! this.slice_from$S("y")) {
+ return false;
+ }
+ continue replab24;
+ }
+ this.cursor = v_19;
+ break replab24;
+ }
+ }
+ this.cursor = v_18;
+ return true;
+};
+
+/**
+ * @param {*} o
+ * @return {!boolean}
+ */
+PorterStemmer.prototype.equals$X = function (o) {
+ return o instanceof PorterStemmer;
+};
+
+/**
+ * @return {!number}
+ */
+PorterStemmer.prototype.hashCode$ = function () {
+ /** @type {!string} */
+ var classname;
+ /** @type {!number} */
+ var hash;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var char;
+ classname = "PorterStemmer";
+ hash = 0;
+ if ("PorterStemmer".length === 0) {
+ return (hash | 0);
+ }
+ for (i = 0; i < classname.length; i++) {
+ char = classname.charCodeAt(i);
+ hash = (hash << 5) - hash + char;
+ hash = hash & hash;
+ }
+ return (hash | 0);
+};
+
+/**
+ * class NorwegianStemmer extends BaseStemmer
+ * @constructor
+ */
+function NorwegianStemmer() {
+}
+
+NorwegianStemmer.prototype = new BaseStemmer;
+/**
+ * @constructor
+ */
+function NorwegianStemmer$() {
+ BaseStemmer$.call(this);
+ this.I_x = 0;
+ this.I_p1 = 0;
+};
+
+NorwegianStemmer$.prototype = new NorwegianStemmer;
+
+/**
+ * @param {NorwegianStemmer} other
+ */
+NorwegianStemmer.prototype.copy_from$LNorwegianStemmer$ = function (other) {
+ this.I_x = other.I_x;
+ this.I_p1 = other.I_p1;
+ BaseStemmer.prototype.copy_from$LBaseStemmer$.call(this, other);
+};
+
+/**
+ * @return {!boolean}
+ */
+NorwegianStemmer.prototype.r_mark_regions$ = function () {
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var c;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!boolean} */
+ var lab3;
+ /** @type {!boolean} */
+ var lab4;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var limit$0;
+ /** @type {!number} */
+ var cursor$1;
+ /** @type {!number} */
+ var cursor$2;
+ this.I_p1 = limit$0 = this.limit;
+ v_1 = cursor$0 = this.cursor;
+ c = (cursor$0 + 3 | 0);
+ if (0 > c || c > limit$0) {
+ return false;
+ }
+ cursor$2 = this.cursor = c;
+ this.I_x = cursor$2;
+ this.cursor = v_1;
+golab0:
+ while (true) {
+ v_2 = this.cursor;
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ if (! this.in_grouping$AIII(NorwegianStemmer.g_v, 97, 248)) {
+ break lab1;
+ }
+ this.cursor = v_2;
+ break golab0;
+ }
+ cursor$1 = this.cursor = v_2;
+ if (cursor$1 >= this.limit) {
+ return false;
+ }
+ this.cursor++;
+ }
+golab2:
+ while (true) {
+ lab3 = true;
+ lab3:
+ while (lab3 === true) {
+ lab3 = false;
+ if (! this.out_grouping$AIII(NorwegianStemmer.g_v, 97, 248)) {
+ break lab3;
+ }
+ break golab2;
+ }
+ if (this.cursor >= this.limit) {
+ return false;
+ }
+ this.cursor++;
+ }
+ this.I_p1 = this.cursor;
+ lab4 = true;
+lab4:
+ while (lab4 === true) {
+ lab4 = false;
+ if (! (this.I_p1 < this.I_x)) {
+ break lab4;
+ }
+ this.I_p1 = this.I_x;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+NorwegianStemmer.prototype.r_main_suffix$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var v_3;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var cursor$1;
+ /** @type {!number} */
+ var cursor$2;
+ v_1 = this.limit - (cursor$0 = this.cursor);
+ if (cursor$0 < this.I_p1) {
+ return false;
+ }
+ cursor$1 = this.cursor = this.I_p1;
+ v_2 = this.limit_backward;
+ this.limit_backward = cursor$1;
+ cursor$2 = this.cursor = this.limit - v_1;
+ this.ket = cursor$2;
+ among_var = this.find_among_b$ALAmong$I(NorwegianStemmer.a_0, 29);
+ if (among_var === 0) {
+ this.limit_backward = v_2;
+ return false;
+ }
+ this.bra = this.cursor;
+ this.limit_backward = v_2;
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 2:
+ lab0 = true;
+ lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ v_3 = this.limit - this.cursor;
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ if (! this.in_grouping_b$AIII(NorwegianStemmer.g_s_ending, 98, 122)) {
+ break lab1;
+ }
+ break lab0;
+ }
+ this.cursor = this.limit - v_3;
+ if (! this.eq_s_b$IS(1, "k")) {
+ return false;
+ }
+ if (! this.out_grouping_b$AIII(NorwegianStemmer.g_v, 97, 248)) {
+ return false;
+ }
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 3:
+ if (! this.slice_from$S("er")) {
+ return false;
+ }
+ break;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+NorwegianStemmer.prototype.r_consonant_pair$ = function () {
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var v_3;
+ /** @type {!number} */
+ var limit$0;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var cursor$1;
+ /** @type {!number} */
+ var cursor$2;
+ /** @type {!number} */
+ var cursor$3;
+ /** @type {!number} */
+ var limit_backward$0;
+ v_1 = (limit$0 = this.limit) - (cursor$0 = this.cursor);
+ v_2 = limit$0 - cursor$0;
+ if (cursor$0 < this.I_p1) {
+ return false;
+ }
+ cursor$1 = this.cursor = this.I_p1;
+ v_3 = this.limit_backward;
+ this.limit_backward = cursor$1;
+ cursor$2 = this.cursor = this.limit - v_2;
+ this.ket = cursor$2;
+ if (this.find_among_b$ALAmong$I(NorwegianStemmer.a_1, 2) === 0) {
+ this.limit_backward = v_3;
+ return false;
+ }
+ this.bra = this.cursor;
+ limit_backward$0 = this.limit_backward = v_3;
+ cursor$3 = this.cursor = this.limit - v_1;
+ if (cursor$3 <= limit_backward$0) {
+ return false;
+ }
+ this.cursor--;
+ this.bra = this.cursor;
+ return (! this.slice_from$S("") ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+NorwegianStemmer.prototype.r_other_suffix$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var cursor$1;
+ /** @type {!number} */
+ var cursor$2;
+ v_1 = this.limit - (cursor$0 = this.cursor);
+ if (cursor$0 < this.I_p1) {
+ return false;
+ }
+ cursor$1 = this.cursor = this.I_p1;
+ v_2 = this.limit_backward;
+ this.limit_backward = cursor$1;
+ cursor$2 = this.cursor = this.limit - v_1;
+ this.ket = cursor$2;
+ among_var = this.find_among_b$ALAmong$I(NorwegianStemmer.a_2, 11);
+ if (among_var === 0) {
+ this.limit_backward = v_2;
+ return false;
+ }
+ this.bra = this.cursor;
+ this.limit_backward = v_2;
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+NorwegianStemmer.prototype.stem$ = function () {
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var v_3;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!boolean} */
+ var lab2;
+ /** @type {!boolean} */
+ var lab3;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var limit$0;
+ /** @type {!number} */
+ var cursor$1;
+ /** @type {!number} */
+ var limit$1;
+ /** @type {!number} */
+ var cursor$2;
+ v_1 = this.cursor;
+ lab0 = true;
+lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ if (! this.r_mark_regions$()) {
+ break lab0;
+ }
+ }
+ cursor$0 = this.cursor = v_1;
+ this.limit_backward = cursor$0;
+ cursor$1 = this.cursor = limit$0 = this.limit;
+ v_2 = limit$0 - cursor$1;
+ lab1 = true;
+lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ if (! this.r_main_suffix$()) {
+ break lab1;
+ }
+ }
+ cursor$2 = this.cursor = (limit$1 = this.limit) - v_2;
+ v_3 = limit$1 - cursor$2;
+ lab2 = true;
+lab2:
+ while (lab2 === true) {
+ lab2 = false;
+ if (! this.r_consonant_pair$()) {
+ break lab2;
+ }
+ }
+ this.cursor = this.limit - v_3;
+ lab3 = true;
+lab3:
+ while (lab3 === true) {
+ lab3 = false;
+ if (! this.r_other_suffix$()) {
+ break lab3;
+ }
+ }
+ this.cursor = this.limit_backward;
+ return true;
+};
+
+/**
+ * @param {*} o
+ * @return {!boolean}
+ */
+NorwegianStemmer.prototype.equals$X = function (o) {
+ return o instanceof NorwegianStemmer;
+};
+
+/**
+ * @return {!number}
+ */
+NorwegianStemmer.prototype.hashCode$ = function () {
+ /** @type {!string} */
+ var classname;
+ /** @type {!number} */
+ var hash;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var char;
+ classname = "NorwegianStemmer";
+ hash = 0;
+ if ("NorwegianStemmer".length === 0) {
+ return (hash | 0);
+ }
+ for (i = 0; i < classname.length; i++) {
+ char = classname.charCodeAt(i);
+ hash = (hash << 5) - hash + char;
+ hash = hash & hash;
+ }
+ return (hash | 0);
+};
+
+/**
+ * class ItalianStemmer extends BaseStemmer
+ * @constructor
+ */
+function ItalianStemmer() {
+}
+
+ItalianStemmer.prototype = new BaseStemmer;
+/**
+ * @constructor
+ */
+function ItalianStemmer$() {
+ BaseStemmer$.call(this);
+ this.I_p2 = 0;
+ this.I_p1 = 0;
+ this.I_pV = 0;
+};
+
+ItalianStemmer$.prototype = new ItalianStemmer;
+
+/**
+ * @param {ItalianStemmer} other
+ */
+ItalianStemmer.prototype.copy_from$LItalianStemmer$ = function (other) {
+ this.I_p2 = other.I_p2;
+ this.I_p1 = other.I_p1;
+ this.I_pV = other.I_pV;
+ BaseStemmer.prototype.copy_from$LBaseStemmer$.call(this, other);
+};
+
+/**
+ * @return {!boolean}
+ */
+ItalianStemmer.prototype.r_prelude$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var v_3;
+ /** @type {!number} */
+ var v_4;
+ /** @type {!number} */
+ var v_5;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!boolean} */
+ var lab3;
+ /** @type {!boolean} */
+ var lab5;
+ /** @type {!boolean} */
+ var lab6;
+ /** @type {!boolean} */
+ var lab7;
+ /** @type {!number} */
+ var cursor$0;
+ v_1 = this.cursor;
+replab0:
+ while (true) {
+ v_2 = this.cursor;
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ this.bra = this.cursor;
+ among_var = this.find_among$ALAmong$I(ItalianStemmer.a_0, 7);
+ if (among_var === 0) {
+ break lab1;
+ }
+ this.ket = this.cursor;
+ switch (among_var) {
+ case 0:
+ break lab1;
+ case 1:
+ if (! this.slice_from$S("\u00E0")) {
+ return false;
+ }
+ break;
+ case 2:
+ if (! this.slice_from$S("\u00E8")) {
+ return false;
+ }
+ break;
+ case 3:
+ if (! this.slice_from$S("\u00EC")) {
+ return false;
+ }
+ break;
+ case 4:
+ if (! this.slice_from$S("\u00F2")) {
+ return false;
+ }
+ break;
+ case 5:
+ if (! this.slice_from$S("\u00F9")) {
+ return false;
+ }
+ break;
+ case 6:
+ if (! this.slice_from$S("qU")) {
+ return false;
+ }
+ break;
+ case 7:
+ if (this.cursor >= this.limit) {
+ break lab1;
+ }
+ this.cursor++;
+ break;
+ }
+ continue replab0;
+ }
+ this.cursor = v_2;
+ break replab0;
+ }
+ this.cursor = v_1;
+replab2:
+ while (true) {
+ v_3 = this.cursor;
+ lab3 = true;
+ lab3:
+ while (lab3 === true) {
+ lab3 = false;
+ golab4:
+ while (true) {
+ v_4 = this.cursor;
+ lab5 = true;
+ lab5:
+ while (lab5 === true) {
+ lab5 = false;
+ if (! this.in_grouping$AIII(ItalianStemmer.g_v, 97, 249)) {
+ break lab5;
+ }
+ this.bra = this.cursor;
+ lab6 = true;
+ lab6:
+ while (lab6 === true) {
+ lab6 = false;
+ v_5 = this.cursor;
+ lab7 = true;
+ lab7:
+ while (lab7 === true) {
+ lab7 = false;
+ if (! this.eq_s$IS(1, "u")) {
+ break lab7;
+ }
+ this.ket = this.cursor;
+ if (! this.in_grouping$AIII(ItalianStemmer.g_v, 97, 249)) {
+ break lab7;
+ }
+ if (! this.slice_from$S("U")) {
+ return false;
+ }
+ break lab6;
+ }
+ this.cursor = v_5;
+ if (! this.eq_s$IS(1, "i")) {
+ break lab5;
+ }
+ this.ket = this.cursor;
+ if (! this.in_grouping$AIII(ItalianStemmer.g_v, 97, 249)) {
+ break lab5;
+ }
+ if (! this.slice_from$S("I")) {
+ return false;
+ }
+ }
+ this.cursor = v_4;
+ break golab4;
+ }
+ cursor$0 = this.cursor = v_4;
+ if (cursor$0 >= this.limit) {
+ break lab3;
+ }
+ this.cursor++;
+ }
+ continue replab2;
+ }
+ this.cursor = v_3;
+ break replab2;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+ItalianStemmer.prototype.r_mark_regions$ = function () {
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var v_3;
+ /** @type {!number} */
+ var v_6;
+ /** @type {!number} */
+ var v_8;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!boolean} */
+ var lab2;
+ /** @type {!boolean} */
+ var lab3;
+ /** @type {!boolean} */
+ var lab4;
+ /** @type {!boolean} */
+ var lab6;
+ /** @type {!boolean} */
+ var lab8;
+ /** @type {!boolean} */
+ var lab9;
+ /** @type {!boolean} */
+ var lab10;
+ /** @type {!boolean} */
+ var lab12;
+ /** @type {!boolean} */
+ var lab13;
+ /** @type {!boolean} */
+ var lab15;
+ /** @type {!boolean} */
+ var lab17;
+ /** @type {!boolean} */
+ var lab19;
+ /** @type {!boolean} */
+ var lab21;
+ /** @type {!number} */
+ var limit$0;
+ /** @type {!number} */
+ var cursor$0;
+ this.I_pV = limit$0 = this.limit;
+ this.I_p1 = limit$0;
+ this.I_p2 = limit$0;
+ v_1 = this.cursor;
+ lab0 = true;
+lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ v_2 = this.cursor;
+ lab2 = true;
+ lab2:
+ while (lab2 === true) {
+ lab2 = false;
+ if (! this.in_grouping$AIII(ItalianStemmer.g_v, 97, 249)) {
+ break lab2;
+ }
+ lab3 = true;
+ lab3:
+ while (lab3 === true) {
+ lab3 = false;
+ v_3 = this.cursor;
+ lab4 = true;
+ lab4:
+ while (lab4 === true) {
+ lab4 = false;
+ if (! this.out_grouping$AIII(ItalianStemmer.g_v, 97, 249)) {
+ break lab4;
+ }
+ golab5:
+ while (true) {
+ lab6 = true;
+ lab6:
+ while (lab6 === true) {
+ lab6 = false;
+ if (! this.in_grouping$AIII(ItalianStemmer.g_v, 97, 249)) {
+ break lab6;
+ }
+ break golab5;
+ }
+ if (this.cursor >= this.limit) {
+ break lab4;
+ }
+ this.cursor++;
+ }
+ break lab3;
+ }
+ this.cursor = v_3;
+ if (! this.in_grouping$AIII(ItalianStemmer.g_v, 97, 249)) {
+ break lab2;
+ }
+ golab7:
+ while (true) {
+ lab8 = true;
+ lab8:
+ while (lab8 === true) {
+ lab8 = false;
+ if (! this.out_grouping$AIII(ItalianStemmer.g_v, 97, 249)) {
+ break lab8;
+ }
+ break golab7;
+ }
+ if (this.cursor >= this.limit) {
+ break lab2;
+ }
+ this.cursor++;
+ }
+ }
+ break lab1;
+ }
+ this.cursor = v_2;
+ if (! this.out_grouping$AIII(ItalianStemmer.g_v, 97, 249)) {
+ break lab0;
+ }
+ lab9 = true;
+ lab9:
+ while (lab9 === true) {
+ lab9 = false;
+ v_6 = this.cursor;
+ lab10 = true;
+ lab10:
+ while (lab10 === true) {
+ lab10 = false;
+ if (! this.out_grouping$AIII(ItalianStemmer.g_v, 97, 249)) {
+ break lab10;
+ }
+ golab11:
+ while (true) {
+ lab12 = true;
+ lab12:
+ while (lab12 === true) {
+ lab12 = false;
+ if (! this.in_grouping$AIII(ItalianStemmer.g_v, 97, 249)) {
+ break lab12;
+ }
+ break golab11;
+ }
+ if (this.cursor >= this.limit) {
+ break lab10;
+ }
+ this.cursor++;
+ }
+ break lab9;
+ }
+ this.cursor = v_6;
+ if (! this.in_grouping$AIII(ItalianStemmer.g_v, 97, 249)) {
+ break lab0;
+ }
+ if (this.cursor >= this.limit) {
+ break lab0;
+ }
+ this.cursor++;
+ }
+ }
+ this.I_pV = this.cursor;
+ }
+ cursor$0 = this.cursor = v_1;
+ v_8 = cursor$0;
+ lab13 = true;
+lab13:
+ while (lab13 === true) {
+ lab13 = false;
+ golab14:
+ while (true) {
+ lab15 = true;
+ lab15:
+ while (lab15 === true) {
+ lab15 = false;
+ if (! this.in_grouping$AIII(ItalianStemmer.g_v, 97, 249)) {
+ break lab15;
+ }
+ break golab14;
+ }
+ if (this.cursor >= this.limit) {
+ break lab13;
+ }
+ this.cursor++;
+ }
+ golab16:
+ while (true) {
+ lab17 = true;
+ lab17:
+ while (lab17 === true) {
+ lab17 = false;
+ if (! this.out_grouping$AIII(ItalianStemmer.g_v, 97, 249)) {
+ break lab17;
+ }
+ break golab16;
+ }
+ if (this.cursor >= this.limit) {
+ break lab13;
+ }
+ this.cursor++;
+ }
+ this.I_p1 = this.cursor;
+ golab18:
+ while (true) {
+ lab19 = true;
+ lab19:
+ while (lab19 === true) {
+ lab19 = false;
+ if (! this.in_grouping$AIII(ItalianStemmer.g_v, 97, 249)) {
+ break lab19;
+ }
+ break golab18;
+ }
+ if (this.cursor >= this.limit) {
+ break lab13;
+ }
+ this.cursor++;
+ }
+ golab20:
+ while (true) {
+ lab21 = true;
+ lab21:
+ while (lab21 === true) {
+ lab21 = false;
+ if (! this.out_grouping$AIII(ItalianStemmer.g_v, 97, 249)) {
+ break lab21;
+ }
+ break golab20;
+ }
+ if (this.cursor >= this.limit) {
+ break lab13;
+ }
+ this.cursor++;
+ }
+ this.I_p2 = this.cursor;
+ }
+ this.cursor = v_8;
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+ItalianStemmer.prototype.r_postlude$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var v_1;
+ /** @type {!boolean} */
+ var lab1;
+replab0:
+ while (true) {
+ v_1 = this.cursor;
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ this.bra = this.cursor;
+ among_var = this.find_among$ALAmong$I(ItalianStemmer.a_1, 3);
+ if (among_var === 0) {
+ break lab1;
+ }
+ this.ket = this.cursor;
+ switch (among_var) {
+ case 0:
+ break lab1;
+ case 1:
+ if (! this.slice_from$S("i")) {
+ return false;
+ }
+ break;
+ case 2:
+ if (! this.slice_from$S("u")) {
+ return false;
+ }
+ break;
+ case 3:
+ if (this.cursor >= this.limit) {
+ break lab1;
+ }
+ this.cursor++;
+ break;
+ }
+ continue replab0;
+ }
+ this.cursor = v_1;
+ break replab0;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+ItalianStemmer.prototype.r_RV$ = function () {
+ return (! (this.I_pV <= this.cursor) ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+ItalianStemmer.prototype.r_R1$ = function () {
+ return (! (this.I_p1 <= this.cursor) ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+ItalianStemmer.prototype.r_R2$ = function () {
+ return (! (this.I_p2 <= this.cursor) ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+ItalianStemmer.prototype.r_attached_pronoun$ = function () {
+ /** @type {!number} */
+ var among_var;
+ this.ket = this.cursor;
+ if (this.find_among_b$ALAmong$I(ItalianStemmer.a_2, 37) === 0) {
+ return false;
+ }
+ this.bra = this.cursor;
+ among_var = this.find_among_b$ALAmong$I(ItalianStemmer.a_3, 5);
+ if (among_var === 0) {
+ return false;
+ }
+ if (! (! (this.I_pV <= this.cursor) ? false : true)) {
+ return false;
+ }
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 2:
+ if (! this.slice_from$S("e")) {
+ return false;
+ }
+ break;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+ItalianStemmer.prototype.r_standard_suffix$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var v_3;
+ /** @type {!number} */
+ var v_4;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!boolean} */
+ var lab2;
+ /** @type {!boolean} */
+ var lab3;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var cursor$1;
+ /** @type {!number} */
+ var cursor$2;
+ /** @type {!number} */
+ var cursor$3;
+ /** @type {!number} */
+ var cursor$4;
+ this.ket = this.cursor;
+ among_var = this.find_among_b$ALAmong$I(ItalianStemmer.a_6, 51);
+ if (among_var === 0) {
+ return false;
+ }
+ this.bra = this.cursor;
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ if (! (! (this.I_p2 <= this.cursor) ? false : true)) {
+ return false;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 2:
+ if (! (! (this.I_p2 <= this.cursor) ? false : true)) {
+ return false;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ v_1 = this.limit - this.cursor;
+ lab0 = true;
+ lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ this.ket = this.cursor;
+ if (! this.eq_s_b$IS(2, "ic")) {
+ this.cursor = this.limit - v_1;
+ break lab0;
+ }
+ this.bra = cursor$0 = this.cursor;
+ if (! (! (this.I_p2 <= cursor$0) ? false : true)) {
+ this.cursor = this.limit - v_1;
+ break lab0;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ }
+ break;
+ case 3:
+ if (! (! (this.I_p2 <= this.cursor) ? false : true)) {
+ return false;
+ }
+ if (! this.slice_from$S("log")) {
+ return false;
+ }
+ break;
+ case 4:
+ if (! (! (this.I_p2 <= this.cursor) ? false : true)) {
+ return false;
+ }
+ if (! this.slice_from$S("u")) {
+ return false;
+ }
+ break;
+ case 5:
+ if (! (! (this.I_p2 <= this.cursor) ? false : true)) {
+ return false;
+ }
+ if (! this.slice_from$S("ente")) {
+ return false;
+ }
+ break;
+ case 6:
+ if (! (! (this.I_pV <= this.cursor) ? false : true)) {
+ return false;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 7:
+ if (! (! (this.I_p1 <= this.cursor) ? false : true)) {
+ return false;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ v_2 = this.limit - this.cursor;
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ this.ket = this.cursor;
+ among_var = this.find_among_b$ALAmong$I(ItalianStemmer.a_4, 4);
+ if (among_var === 0) {
+ this.cursor = this.limit - v_2;
+ break lab1;
+ }
+ this.bra = cursor$1 = this.cursor;
+ if (! (! (this.I_p2 <= cursor$1) ? false : true)) {
+ this.cursor = this.limit - v_2;
+ break lab1;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ switch (among_var) {
+ case 0:
+ this.cursor = this.limit - v_2;
+ break lab1;
+ case 1:
+ this.ket = this.cursor;
+ if (! this.eq_s_b$IS(2, "at")) {
+ this.cursor = this.limit - v_2;
+ break lab1;
+ }
+ this.bra = cursor$2 = this.cursor;
+ if (! (! (this.I_p2 <= cursor$2) ? false : true)) {
+ this.cursor = this.limit - v_2;
+ break lab1;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ }
+ }
+ break;
+ case 8:
+ if (! (! (this.I_p2 <= this.cursor) ? false : true)) {
+ return false;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ v_3 = this.limit - this.cursor;
+ lab2 = true;
+ lab2:
+ while (lab2 === true) {
+ lab2 = false;
+ this.ket = this.cursor;
+ among_var = this.find_among_b$ALAmong$I(ItalianStemmer.a_5, 3);
+ if (among_var === 0) {
+ this.cursor = this.limit - v_3;
+ break lab2;
+ }
+ this.bra = this.cursor;
+ switch (among_var) {
+ case 0:
+ this.cursor = this.limit - v_3;
+ break lab2;
+ case 1:
+ if (! (! (this.I_p2 <= this.cursor) ? false : true)) {
+ this.cursor = this.limit - v_3;
+ break lab2;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ }
+ }
+ break;
+ case 9:
+ if (! (! (this.I_p2 <= this.cursor) ? false : true)) {
+ return false;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ v_4 = this.limit - this.cursor;
+ lab3 = true;
+ lab3:
+ while (lab3 === true) {
+ lab3 = false;
+ this.ket = this.cursor;
+ if (! this.eq_s_b$IS(2, "at")) {
+ this.cursor = this.limit - v_4;
+ break lab3;
+ }
+ this.bra = cursor$3 = this.cursor;
+ if (! (! (this.I_p2 <= cursor$3) ? false : true)) {
+ this.cursor = this.limit - v_4;
+ break lab3;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ this.ket = this.cursor;
+ if (! this.eq_s_b$IS(2, "ic")) {
+ this.cursor = this.limit - v_4;
+ break lab3;
+ }
+ this.bra = cursor$4 = this.cursor;
+ if (! (! (this.I_p2 <= cursor$4) ? false : true)) {
+ this.cursor = this.limit - v_4;
+ break lab3;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ }
+ break;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+ItalianStemmer.prototype.r_verb_suffix$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var cursor$1;
+ /** @type {!number} */
+ var cursor$2;
+ v_1 = this.limit - (cursor$0 = this.cursor);
+ if (cursor$0 < this.I_pV) {
+ return false;
+ }
+ cursor$1 = this.cursor = this.I_pV;
+ v_2 = this.limit_backward;
+ this.limit_backward = cursor$1;
+ cursor$2 = this.cursor = this.limit - v_1;
+ this.ket = cursor$2;
+ among_var = this.find_among_b$ALAmong$I(ItalianStemmer.a_7, 87);
+ if (among_var === 0) {
+ this.limit_backward = v_2;
+ return false;
+ }
+ this.bra = this.cursor;
+ switch (among_var) {
+ case 0:
+ this.limit_backward = v_2;
+ return false;
+ case 1:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ }
+ this.limit_backward = v_2;
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+ItalianStemmer.prototype.r_vowel_suffix$ = function () {
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var cursor$1;
+ v_1 = this.limit - this.cursor;
+ lab0 = true;
+lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ this.ket = this.cursor;
+ if (! this.in_grouping_b$AIII(ItalianStemmer.g_AEIO, 97, 242)) {
+ this.cursor = this.limit - v_1;
+ break lab0;
+ }
+ this.bra = cursor$0 = this.cursor;
+ if (! (! (this.I_pV <= cursor$0) ? false : true)) {
+ this.cursor = this.limit - v_1;
+ break lab0;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ this.ket = this.cursor;
+ if (! this.eq_s_b$IS(1, "i")) {
+ this.cursor = this.limit - v_1;
+ break lab0;
+ }
+ this.bra = cursor$1 = this.cursor;
+ if (! (! (this.I_pV <= cursor$1) ? false : true)) {
+ this.cursor = this.limit - v_1;
+ break lab0;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ }
+ v_2 = this.limit - this.cursor;
+ lab1 = true;
+lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ this.ket = this.cursor;
+ if (! this.eq_s_b$IS(1, "h")) {
+ this.cursor = this.limit - v_2;
+ break lab1;
+ }
+ this.bra = this.cursor;
+ if (! this.in_grouping_b$AIII(ItalianStemmer.g_CG, 99, 103)) {
+ this.cursor = this.limit - v_2;
+ break lab1;
+ }
+ if (! (! (this.I_pV <= this.cursor) ? false : true)) {
+ this.cursor = this.limit - v_2;
+ break lab1;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+ItalianStemmer.prototype.stem$ = function () {
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var v_3;
+ /** @type {!number} */
+ var v_4;
+ /** @type {!number} */
+ var v_5;
+ /** @type {!number} */
+ var v_7;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!boolean} */
+ var lab2;
+ /** @type {!boolean} */
+ var lab3;
+ /** @type {!boolean} */
+ var lab4;
+ /** @type {!boolean} */
+ var lab5;
+ /** @type {!boolean} */
+ var lab6;
+ /** @type {!boolean} */
+ var lab7;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var cursor$1;
+ /** @type {!number} */
+ var limit$0;
+ /** @type {!number} */
+ var cursor$2;
+ /** @type {!number} */
+ var limit$1;
+ /** @type {!number} */
+ var cursor$3;
+ /** @type {!number} */
+ var cursor$4;
+ v_1 = this.cursor;
+ lab0 = true;
+lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ if (! this.r_prelude$()) {
+ break lab0;
+ }
+ }
+ cursor$0 = this.cursor = v_1;
+ v_2 = cursor$0;
+ lab1 = true;
+lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ if (! this.r_mark_regions$()) {
+ break lab1;
+ }
+ }
+ cursor$1 = this.cursor = v_2;
+ this.limit_backward = cursor$1;
+ cursor$2 = this.cursor = limit$0 = this.limit;
+ v_3 = limit$0 - cursor$2;
+ lab2 = true;
+lab2:
+ while (lab2 === true) {
+ lab2 = false;
+ if (! this.r_attached_pronoun$()) {
+ break lab2;
+ }
+ }
+ cursor$3 = this.cursor = (limit$1 = this.limit) - v_3;
+ v_4 = limit$1 - cursor$3;
+ lab3 = true;
+lab3:
+ while (lab3 === true) {
+ lab3 = false;
+ lab4 = true;
+ lab4:
+ while (lab4 === true) {
+ lab4 = false;
+ v_5 = this.limit - this.cursor;
+ lab5 = true;
+ lab5:
+ while (lab5 === true) {
+ lab5 = false;
+ if (! this.r_standard_suffix$()) {
+ break lab5;
+ }
+ break lab4;
+ }
+ this.cursor = this.limit - v_5;
+ if (! this.r_verb_suffix$()) {
+ break lab3;
+ }
+ }
+ }
+ this.cursor = this.limit - v_4;
+ lab6 = true;
+lab6:
+ while (lab6 === true) {
+ lab6 = false;
+ if (! this.r_vowel_suffix$()) {
+ break lab6;
+ }
+ }
+ cursor$4 = this.cursor = this.limit_backward;
+ v_7 = cursor$4;
+ lab7 = true;
+lab7:
+ while (lab7 === true) {
+ lab7 = false;
+ if (! this.r_postlude$()) {
+ break lab7;
+ }
+ }
+ this.cursor = v_7;
+ return true;
+};
+
+/**
+ * @param {*} o
+ * @return {!boolean}
+ */
+ItalianStemmer.prototype.equals$X = function (o) {
+ return o instanceof ItalianStemmer;
+};
+
+/**
+ * @return {!number}
+ */
+ItalianStemmer.prototype.hashCode$ = function () {
+ /** @type {!string} */
+ var classname;
+ /** @type {!number} */
+ var hash;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var char;
+ classname = "ItalianStemmer";
+ hash = 0;
+ if ("ItalianStemmer".length === 0) {
+ return (hash | 0);
+ }
+ for (i = 0; i < classname.length; i++) {
+ char = classname.charCodeAt(i);
+ hash = (hash << 5) - hash + char;
+ hash = hash & hash;
+ }
+ return (hash | 0);
+};
+
+/**
+ * class HungarianStemmer extends BaseStemmer
+ * @constructor
+ */
+function HungarianStemmer() {
+}
+
+HungarianStemmer.prototype = new BaseStemmer;
+/**
+ * @constructor
+ */
+function HungarianStemmer$() {
+ BaseStemmer$.call(this);
+ this.I_p1 = 0;
+};
+
+HungarianStemmer$.prototype = new HungarianStemmer;
+
+/**
+ * @param {HungarianStemmer} other
+ */
+HungarianStemmer.prototype.copy_from$LHungarianStemmer$ = function (other) {
+ this.I_p1 = other.I_p1;
+ BaseStemmer.prototype.copy_from$LBaseStemmer$.call(this, other);
+};
+
+/**
+ * @return {!boolean}
+ */
+HungarianStemmer.prototype.r_mark_regions$ = function () {
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var v_3;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!boolean} */
+ var lab3;
+ /** @type {!boolean} */
+ var lab4;
+ /** @type {!boolean} */
+ var lab5;
+ /** @type {!boolean} */
+ var lab7;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var cursor$1;
+ this.I_p1 = this.limit;
+ lab0 = true;
+lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ v_1 = this.cursor;
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ if (! this.in_grouping$AIII(HungarianStemmer.g_v, 97, 252)) {
+ break lab1;
+ }
+ golab2:
+ while (true) {
+ v_2 = this.cursor;
+ lab3 = true;
+ lab3:
+ while (lab3 === true) {
+ lab3 = false;
+ if (! this.out_grouping$AIII(HungarianStemmer.g_v, 97, 252)) {
+ break lab3;
+ }
+ this.cursor = v_2;
+ break golab2;
+ }
+ cursor$0 = this.cursor = v_2;
+ if (cursor$0 >= this.limit) {
+ break lab1;
+ }
+ this.cursor++;
+ }
+ lab4 = true;
+ lab4:
+ while (lab4 === true) {
+ lab4 = false;
+ v_3 = this.cursor;
+ lab5 = true;
+ lab5:
+ while (lab5 === true) {
+ lab5 = false;
+ if (this.find_among$ALAmong$I(HungarianStemmer.a_0, 8) === 0) {
+ break lab5;
+ }
+ break lab4;
+ }
+ cursor$1 = this.cursor = v_3;
+ if (cursor$1 >= this.limit) {
+ break lab1;
+ }
+ this.cursor++;
+ }
+ this.I_p1 = this.cursor;
+ break lab0;
+ }
+ this.cursor = v_1;
+ if (! this.out_grouping$AIII(HungarianStemmer.g_v, 97, 252)) {
+ return false;
+ }
+ golab6:
+ while (true) {
+ lab7 = true;
+ lab7:
+ while (lab7 === true) {
+ lab7 = false;
+ if (! this.in_grouping$AIII(HungarianStemmer.g_v, 97, 252)) {
+ break lab7;
+ }
+ break golab6;
+ }
+ if (this.cursor >= this.limit) {
+ return false;
+ }
+ this.cursor++;
+ }
+ this.I_p1 = this.cursor;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+HungarianStemmer.prototype.r_R1$ = function () {
+ return (! (this.I_p1 <= this.cursor) ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+HungarianStemmer.prototype.r_v_ending$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var cursor$0;
+ this.ket = this.cursor;
+ among_var = this.find_among_b$ALAmong$I(HungarianStemmer.a_1, 2);
+ if (among_var === 0) {
+ return false;
+ }
+ this.bra = cursor$0 = this.cursor;
+ if (! (! (this.I_p1 <= cursor$0) ? false : true)) {
+ return false;
+ }
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ if (! this.slice_from$S("a")) {
+ return false;
+ }
+ break;
+ case 2:
+ if (! this.slice_from$S("e")) {
+ return false;
+ }
+ break;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+HungarianStemmer.prototype.r_double$ = function () {
+ /** @type {!number} */
+ var v_1;
+ v_1 = this.limit - this.cursor;
+ if (this.find_among_b$ALAmong$I(HungarianStemmer.a_2, 23) === 0) {
+ return false;
+ }
+ this.cursor = this.limit - v_1;
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+HungarianStemmer.prototype.r_undouble$ = function () {
+ /** @type {!number} */
+ var c;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var cursor$1;
+ if (this.cursor <= this.limit_backward) {
+ return false;
+ }
+ this.cursor--;
+ this.ket = cursor$0 = this.cursor;
+ c = (cursor$0 - 1 | 0);
+ if (this.limit_backward > c || c > this.limit) {
+ return false;
+ }
+ cursor$1 = this.cursor = c;
+ this.bra = cursor$1;
+ return (! this.slice_from$S("") ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+HungarianStemmer.prototype.r_instrum$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var cursor$0;
+ this.ket = this.cursor;
+ among_var = this.find_among_b$ALAmong$I(HungarianStemmer.a_3, 2);
+ if (among_var === 0) {
+ return false;
+ }
+ this.bra = cursor$0 = this.cursor;
+ if (! (! (this.I_p1 <= cursor$0) ? false : true)) {
+ return false;
+ }
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ if (! this.r_double$()) {
+ return false;
+ }
+ break;
+ case 2:
+ if (! this.r_double$()) {
+ return false;
+ }
+ break;
+ }
+ return (! this.slice_from$S("") ? false : ! this.r_undouble$() ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+HungarianStemmer.prototype.r_case$ = function () {
+ /** @type {!number} */
+ var cursor$0;
+ this.ket = this.cursor;
+ if (this.find_among_b$ALAmong$I(HungarianStemmer.a_4, 44) === 0) {
+ return false;
+ }
+ this.bra = cursor$0 = this.cursor;
+ return (! (! (this.I_p1 <= cursor$0) ? false : true) ? false : ! this.slice_from$S("") ? false : ! this.r_v_ending$() ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+HungarianStemmer.prototype.r_case_special$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var cursor$0;
+ this.ket = this.cursor;
+ among_var = this.find_among_b$ALAmong$I(HungarianStemmer.a_5, 3);
+ if (among_var === 0) {
+ return false;
+ }
+ this.bra = cursor$0 = this.cursor;
+ if (! (! (this.I_p1 <= cursor$0) ? false : true)) {
+ return false;
+ }
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ if (! this.slice_from$S("e")) {
+ return false;
+ }
+ break;
+ case 2:
+ if (! this.slice_from$S("a")) {
+ return false;
+ }
+ break;
+ case 3:
+ if (! this.slice_from$S("a")) {
+ return false;
+ }
+ break;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+HungarianStemmer.prototype.r_case_other$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var cursor$0;
+ this.ket = this.cursor;
+ among_var = this.find_among_b$ALAmong$I(HungarianStemmer.a_6, 6);
+ if (among_var === 0) {
+ return false;
+ }
+ this.bra = cursor$0 = this.cursor;
+ if (! (! (this.I_p1 <= cursor$0) ? false : true)) {
+ return false;
+ }
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 2:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 3:
+ if (! this.slice_from$S("a")) {
+ return false;
+ }
+ break;
+ case 4:
+ if (! this.slice_from$S("e")) {
+ return false;
+ }
+ break;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+HungarianStemmer.prototype.r_factive$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var cursor$0;
+ this.ket = this.cursor;
+ among_var = this.find_among_b$ALAmong$I(HungarianStemmer.a_7, 2);
+ if (among_var === 0) {
+ return false;
+ }
+ this.bra = cursor$0 = this.cursor;
+ if (! (! (this.I_p1 <= cursor$0) ? false : true)) {
+ return false;
+ }
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ if (! this.r_double$()) {
+ return false;
+ }
+ break;
+ case 2:
+ if (! this.r_double$()) {
+ return false;
+ }
+ break;
+ }
+ return (! this.slice_from$S("") ? false : ! this.r_undouble$() ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+HungarianStemmer.prototype.r_plural$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var cursor$0;
+ this.ket = this.cursor;
+ among_var = this.find_among_b$ALAmong$I(HungarianStemmer.a_8, 7);
+ if (among_var === 0) {
+ return false;
+ }
+ this.bra = cursor$0 = this.cursor;
+ if (! (! (this.I_p1 <= cursor$0) ? false : true)) {
+ return false;
+ }
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ if (! this.slice_from$S("a")) {
+ return false;
+ }
+ break;
+ case 2:
+ if (! this.slice_from$S("e")) {
+ return false;
+ }
+ break;
+ case 3:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 4:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 5:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 6:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 7:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+HungarianStemmer.prototype.r_owned$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var cursor$0;
+ this.ket = this.cursor;
+ among_var = this.find_among_b$ALAmong$I(HungarianStemmer.a_9, 12);
+ if (among_var === 0) {
+ return false;
+ }
+ this.bra = cursor$0 = this.cursor;
+ if (! (! (this.I_p1 <= cursor$0) ? false : true)) {
+ return false;
+ }
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 2:
+ if (! this.slice_from$S("e")) {
+ return false;
+ }
+ break;
+ case 3:
+ if (! this.slice_from$S("a")) {
+ return false;
+ }
+ break;
+ case 4:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 5:
+ if (! this.slice_from$S("e")) {
+ return false;
+ }
+ break;
+ case 6:
+ if (! this.slice_from$S("a")) {
+ return false;
+ }
+ break;
+ case 7:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 8:
+ if (! this.slice_from$S("e")) {
+ return false;
+ }
+ break;
+ case 9:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+HungarianStemmer.prototype.r_sing_owner$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var cursor$0;
+ this.ket = this.cursor;
+ among_var = this.find_among_b$ALAmong$I(HungarianStemmer.a_10, 31);
+ if (among_var === 0) {
+ return false;
+ }
+ this.bra = cursor$0 = this.cursor;
+ if (! (! (this.I_p1 <= cursor$0) ? false : true)) {
+ return false;
+ }
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 2:
+ if (! this.slice_from$S("a")) {
+ return false;
+ }
+ break;
+ case 3:
+ if (! this.slice_from$S("e")) {
+ return false;
+ }
+ break;
+ case 4:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 5:
+ if (! this.slice_from$S("a")) {
+ return false;
+ }
+ break;
+ case 6:
+ if (! this.slice_from$S("e")) {
+ return false;
+ }
+ break;
+ case 7:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 8:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 9:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 10:
+ if (! this.slice_from$S("a")) {
+ return false;
+ }
+ break;
+ case 11:
+ if (! this.slice_from$S("e")) {
+ return false;
+ }
+ break;
+ case 12:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 13:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 14:
+ if (! this.slice_from$S("a")) {
+ return false;
+ }
+ break;
+ case 15:
+ if (! this.slice_from$S("e")) {
+ return false;
+ }
+ break;
+ case 16:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 17:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 18:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 19:
+ if (! this.slice_from$S("a")) {
+ return false;
+ }
+ break;
+ case 20:
+ if (! this.slice_from$S("e")) {
+ return false;
+ }
+ break;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+HungarianStemmer.prototype.r_plur_owner$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var cursor$0;
+ this.ket = this.cursor;
+ among_var = this.find_among_b$ALAmong$I(HungarianStemmer.a_11, 42);
+ if (among_var === 0) {
+ return false;
+ }
+ this.bra = cursor$0 = this.cursor;
+ if (! (! (this.I_p1 <= cursor$0) ? false : true)) {
+ return false;
+ }
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 2:
+ if (! this.slice_from$S("a")) {
+ return false;
+ }
+ break;
+ case 3:
+ if (! this.slice_from$S("e")) {
+ return false;
+ }
+ break;
+ case 4:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 5:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 6:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 7:
+ if (! this.slice_from$S("a")) {
+ return false;
+ }
+ break;
+ case 8:
+ if (! this.slice_from$S("e")) {
+ return false;
+ }
+ break;
+ case 9:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 10:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 11:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 12:
+ if (! this.slice_from$S("a")) {
+ return false;
+ }
+ break;
+ case 13:
+ if (! this.slice_from$S("e")) {
+ return false;
+ }
+ break;
+ case 14:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 15:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 16:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 17:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 18:
+ if (! this.slice_from$S("a")) {
+ return false;
+ }
+ break;
+ case 19:
+ if (! this.slice_from$S("e")) {
+ return false;
+ }
+ break;
+ case 20:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 21:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 22:
+ if (! this.slice_from$S("a")) {
+ return false;
+ }
+ break;
+ case 23:
+ if (! this.slice_from$S("e")) {
+ return false;
+ }
+ break;
+ case 24:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 25:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 26:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 27:
+ if (! this.slice_from$S("a")) {
+ return false;
+ }
+ break;
+ case 28:
+ if (! this.slice_from$S("e")) {
+ return false;
+ }
+ break;
+ case 29:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+HungarianStemmer.prototype.stem$ = function () {
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var v_3;
+ /** @type {!number} */
+ var v_4;
+ /** @type {!number} */
+ var v_5;
+ /** @type {!number} */
+ var v_6;
+ /** @type {!number} */
+ var v_7;
+ /** @type {!number} */
+ var v_8;
+ /** @type {!number} */
+ var v_9;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!boolean} */
+ var lab2;
+ /** @type {!boolean} */
+ var lab3;
+ /** @type {!boolean} */
+ var lab4;
+ /** @type {!boolean} */
+ var lab5;
+ /** @type {!boolean} */
+ var lab6;
+ /** @type {!boolean} */
+ var lab7;
+ /** @type {!boolean} */
+ var lab8;
+ /** @type {!boolean} */
+ var lab9;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var limit$0;
+ /** @type {!number} */
+ var cursor$1;
+ /** @type {!number} */
+ var limit$1;
+ /** @type {!number} */
+ var cursor$2;
+ /** @type {!number} */
+ var limit$2;
+ /** @type {!number} */
+ var cursor$3;
+ /** @type {!number} */
+ var limit$3;
+ /** @type {!number} */
+ var cursor$4;
+ /** @type {!number} */
+ var limit$4;
+ /** @type {!number} */
+ var cursor$5;
+ /** @type {!number} */
+ var limit$5;
+ /** @type {!number} */
+ var cursor$6;
+ /** @type {!number} */
+ var limit$6;
+ /** @type {!number} */
+ var cursor$7;
+ /** @type {!number} */
+ var limit$7;
+ /** @type {!number} */
+ var cursor$8;
+ v_1 = this.cursor;
+ lab0 = true;
+lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ if (! this.r_mark_regions$()) {
+ break lab0;
+ }
+ }
+ cursor$0 = this.cursor = v_1;
+ this.limit_backward = cursor$0;
+ cursor$1 = this.cursor = limit$0 = this.limit;
+ v_2 = limit$0 - cursor$1;
+ lab1 = true;
+lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ if (! this.r_instrum$()) {
+ break lab1;
+ }
+ }
+ cursor$2 = this.cursor = (limit$1 = this.limit) - v_2;
+ v_3 = limit$1 - cursor$2;
+ lab2 = true;
+lab2:
+ while (lab2 === true) {
+ lab2 = false;
+ if (! this.r_case$()) {
+ break lab2;
+ }
+ }
+ cursor$3 = this.cursor = (limit$2 = this.limit) - v_3;
+ v_4 = limit$2 - cursor$3;
+ lab3 = true;
+lab3:
+ while (lab3 === true) {
+ lab3 = false;
+ if (! this.r_case_special$()) {
+ break lab3;
+ }
+ }
+ cursor$4 = this.cursor = (limit$3 = this.limit) - v_4;
+ v_5 = limit$3 - cursor$4;
+ lab4 = true;
+lab4:
+ while (lab4 === true) {
+ lab4 = false;
+ if (! this.r_case_other$()) {
+ break lab4;
+ }
+ }
+ cursor$5 = this.cursor = (limit$4 = this.limit) - v_5;
+ v_6 = limit$4 - cursor$5;
+ lab5 = true;
+lab5:
+ while (lab5 === true) {
+ lab5 = false;
+ if (! this.r_factive$()) {
+ break lab5;
+ }
+ }
+ cursor$6 = this.cursor = (limit$5 = this.limit) - v_6;
+ v_7 = limit$5 - cursor$6;
+ lab6 = true;
+lab6:
+ while (lab6 === true) {
+ lab6 = false;
+ if (! this.r_owned$()) {
+ break lab6;
+ }
+ }
+ cursor$7 = this.cursor = (limit$6 = this.limit) - v_7;
+ v_8 = limit$6 - cursor$7;
+ lab7 = true;
+lab7:
+ while (lab7 === true) {
+ lab7 = false;
+ if (! this.r_sing_owner$()) {
+ break lab7;
+ }
+ }
+ cursor$8 = this.cursor = (limit$7 = this.limit) - v_8;
+ v_9 = limit$7 - cursor$8;
+ lab8 = true;
+lab8:
+ while (lab8 === true) {
+ lab8 = false;
+ if (! this.r_plur_owner$()) {
+ break lab8;
+ }
+ }
+ this.cursor = this.limit - v_9;
+ lab9 = true;
+lab9:
+ while (lab9 === true) {
+ lab9 = false;
+ if (! this.r_plural$()) {
+ break lab9;
+ }
+ }
+ this.cursor = this.limit_backward;
+ return true;
+};
+
+/**
+ * @param {*} o
+ * @return {!boolean}
+ */
+HungarianStemmer.prototype.equals$X = function (o) {
+ return o instanceof HungarianStemmer;
+};
+
+/**
+ * @return {!number}
+ */
+HungarianStemmer.prototype.hashCode$ = function () {
+ /** @type {!string} */
+ var classname;
+ /** @type {!number} */
+ var hash;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var char;
+ classname = "HungarianStemmer";
+ hash = 0;
+ if ("HungarianStemmer".length === 0) {
+ return (hash | 0);
+ }
+ for (i = 0; i < classname.length; i++) {
+ char = classname.charCodeAt(i);
+ hash = (hash << 5) - hash + char;
+ hash = hash & hash;
+ }
+ return (hash | 0);
+};
+
+/**
+ * class GermanStemmer extends BaseStemmer
+ * @constructor
+ */
+function GermanStemmer() {
+}
+
+GermanStemmer.prototype = new BaseStemmer;
+/**
+ * @constructor
+ */
+function GermanStemmer$() {
+ BaseStemmer$.call(this);
+ this.I_x = 0;
+ this.I_p2 = 0;
+ this.I_p1 = 0;
+};
+
+GermanStemmer$.prototype = new GermanStemmer;
+
+/**
+ * @param {GermanStemmer} other
+ */
+GermanStemmer.prototype.copy_from$LGermanStemmer$ = function (other) {
+ this.I_x = other.I_x;
+ this.I_p2 = other.I_p2;
+ this.I_p1 = other.I_p1;
+ BaseStemmer.prototype.copy_from$LBaseStemmer$.call(this, other);
+};
+
+/**
+ * @return {!boolean}
+ */
+GermanStemmer.prototype.r_prelude$ = function () {
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var v_3;
+ /** @type {!number} */
+ var v_4;
+ /** @type {!number} */
+ var v_5;
+ /** @type {!number} */
+ var v_6;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!boolean} */
+ var lab2;
+ /** @type {!boolean} */
+ var lab3;
+ /** @type {!boolean} */
+ var lab5;
+ /** @type {!boolean} */
+ var lab7;
+ /** @type {!boolean} */
+ var lab8;
+ /** @type {!boolean} */
+ var lab9;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var cursor$1;
+ v_1 = this.cursor;
+replab0:
+ while (true) {
+ v_2 = this.cursor;
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ lab2 = true;
+ lab2:
+ while (lab2 === true) {
+ lab2 = false;
+ v_3 = this.cursor;
+ lab3 = true;
+ lab3:
+ while (lab3 === true) {
+ lab3 = false;
+ this.bra = this.cursor;
+ if (! this.eq_s$IS(1, "\u00DF")) {
+ break lab3;
+ }
+ this.ket = this.cursor;
+ if (! this.slice_from$S("ss")) {
+ return false;
+ }
+ break lab2;
+ }
+ cursor$0 = this.cursor = v_3;
+ if (cursor$0 >= this.limit) {
+ break lab1;
+ }
+ this.cursor++;
+ }
+ continue replab0;
+ }
+ this.cursor = v_2;
+ break replab0;
+ }
+ this.cursor = v_1;
+replab4:
+ while (true) {
+ v_4 = this.cursor;
+ lab5 = true;
+ lab5:
+ while (lab5 === true) {
+ lab5 = false;
+ golab6:
+ while (true) {
+ v_5 = this.cursor;
+ lab7 = true;
+ lab7:
+ while (lab7 === true) {
+ lab7 = false;
+ if (! this.in_grouping$AIII(GermanStemmer.g_v, 97, 252)) {
+ break lab7;
+ }
+ this.bra = this.cursor;
+ lab8 = true;
+ lab8:
+ while (lab8 === true) {
+ lab8 = false;
+ v_6 = this.cursor;
+ lab9 = true;
+ lab9:
+ while (lab9 === true) {
+ lab9 = false;
+ if (! this.eq_s$IS(1, "u")) {
+ break lab9;
+ }
+ this.ket = this.cursor;
+ if (! this.in_grouping$AIII(GermanStemmer.g_v, 97, 252)) {
+ break lab9;
+ }
+ if (! this.slice_from$S("U")) {
+ return false;
+ }
+ break lab8;
+ }
+ this.cursor = v_6;
+ if (! this.eq_s$IS(1, "y")) {
+ break lab7;
+ }
+ this.ket = this.cursor;
+ if (! this.in_grouping$AIII(GermanStemmer.g_v, 97, 252)) {
+ break lab7;
+ }
+ if (! this.slice_from$S("Y")) {
+ return false;
+ }
+ }
+ this.cursor = v_5;
+ break golab6;
+ }
+ cursor$1 = this.cursor = v_5;
+ if (cursor$1 >= this.limit) {
+ break lab5;
+ }
+ this.cursor++;
+ }
+ continue replab4;
+ }
+ this.cursor = v_4;
+ break replab4;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+GermanStemmer.prototype.r_mark_regions$ = function () {
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var c;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!boolean} */
+ var lab3;
+ /** @type {!boolean} */
+ var lab4;
+ /** @type {!boolean} */
+ var lab6;
+ /** @type {!boolean} */
+ var lab8;
+ /** @type {!number} */
+ var limit$0;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var cursor$1;
+ this.I_p1 = limit$0 = this.limit;
+ this.I_p2 = limit$0;
+ v_1 = cursor$0 = this.cursor;
+ c = (cursor$0 + 3 | 0);
+ if (0 > c || c > limit$0) {
+ return false;
+ }
+ cursor$1 = this.cursor = c;
+ this.I_x = cursor$1;
+ this.cursor = v_1;
+golab0:
+ while (true) {
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ if (! this.in_grouping$AIII(GermanStemmer.g_v, 97, 252)) {
+ break lab1;
+ }
+ break golab0;
+ }
+ if (this.cursor >= this.limit) {
+ return false;
+ }
+ this.cursor++;
+ }
+golab2:
+ while (true) {
+ lab3 = true;
+ lab3:
+ while (lab3 === true) {
+ lab3 = false;
+ if (! this.out_grouping$AIII(GermanStemmer.g_v, 97, 252)) {
+ break lab3;
+ }
+ break golab2;
+ }
+ if (this.cursor >= this.limit) {
+ return false;
+ }
+ this.cursor++;
+ }
+ this.I_p1 = this.cursor;
+ lab4 = true;
+lab4:
+ while (lab4 === true) {
+ lab4 = false;
+ if (! (this.I_p1 < this.I_x)) {
+ break lab4;
+ }
+ this.I_p1 = this.I_x;
+ }
+golab5:
+ while (true) {
+ lab6 = true;
+ lab6:
+ while (lab6 === true) {
+ lab6 = false;
+ if (! this.in_grouping$AIII(GermanStemmer.g_v, 97, 252)) {
+ break lab6;
+ }
+ break golab5;
+ }
+ if (this.cursor >= this.limit) {
+ return false;
+ }
+ this.cursor++;
+ }
+golab7:
+ while (true) {
+ lab8 = true;
+ lab8:
+ while (lab8 === true) {
+ lab8 = false;
+ if (! this.out_grouping$AIII(GermanStemmer.g_v, 97, 252)) {
+ break lab8;
+ }
+ break golab7;
+ }
+ if (this.cursor >= this.limit) {
+ return false;
+ }
+ this.cursor++;
+ }
+ this.I_p2 = this.cursor;
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+GermanStemmer.prototype.r_postlude$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var v_1;
+ /** @type {!boolean} */
+ var lab1;
+replab0:
+ while (true) {
+ v_1 = this.cursor;
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ this.bra = this.cursor;
+ among_var = this.find_among$ALAmong$I(GermanStemmer.a_0, 6);
+ if (among_var === 0) {
+ break lab1;
+ }
+ this.ket = this.cursor;
+ switch (among_var) {
+ case 0:
+ break lab1;
+ case 1:
+ if (! this.slice_from$S("y")) {
+ return false;
+ }
+ break;
+ case 2:
+ if (! this.slice_from$S("u")) {
+ return false;
+ }
+ break;
+ case 3:
+ if (! this.slice_from$S("a")) {
+ return false;
+ }
+ break;
+ case 4:
+ if (! this.slice_from$S("o")) {
+ return false;
+ }
+ break;
+ case 5:
+ if (! this.slice_from$S("u")) {
+ return false;
+ }
+ break;
+ case 6:
+ if (this.cursor >= this.limit) {
+ break lab1;
+ }
+ this.cursor++;
+ break;
+ }
+ continue replab0;
+ }
+ this.cursor = v_1;
+ break replab0;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+GermanStemmer.prototype.r_R1$ = function () {
+ return (! (this.I_p1 <= this.cursor) ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+GermanStemmer.prototype.r_R2$ = function () {
+ return (! (this.I_p2 <= this.cursor) ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+GermanStemmer.prototype.r_standard_suffix$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var v_3;
+ /** @type {!number} */
+ var v_4;
+ /** @type {!number} */
+ var v_5;
+ /** @type {!number} */
+ var v_6;
+ /** @type {!number} */
+ var v_7;
+ /** @type {!number} */
+ var v_8;
+ /** @type {!number} */
+ var v_9;
+ /** @type {!number} */
+ var v_10;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!boolean} */
+ var lab2;
+ /** @type {!number} */
+ var c;
+ /** @type {!boolean} */
+ var lab3;
+ /** @type {!boolean} */
+ var lab4;
+ /** @type {!boolean} */
+ var lab5;
+ /** @type {!boolean} */
+ var lab6;
+ /** @type {!boolean} */
+ var lab7;
+ /** @type {!boolean} */
+ var lab8;
+ /** @type {!boolean} */
+ var lab9;
+ /** @type {!boolean} */
+ var lab10;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var cursor$1;
+ /** @type {!number} */
+ var limit$0;
+ /** @type {!number} */
+ var cursor$2;
+ /** @type {!number} */
+ var cursor$3;
+ /** @type {!number} */
+ var cursor$4;
+ /** @type {!number} */
+ var cursor$5;
+ /** @type {!number} */
+ var cursor$6;
+ /** @type {!number} */
+ var cursor$7;
+ /** @type {!number} */
+ var limit$1;
+ /** @type {!number} */
+ var cursor$8;
+ v_1 = this.limit - this.cursor;
+ lab0 = true;
+lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ this.ket = this.cursor;
+ among_var = this.find_among_b$ALAmong$I(GermanStemmer.a_1, 7);
+ if (among_var === 0) {
+ break lab0;
+ }
+ this.bra = cursor$0 = this.cursor;
+ if (! (! (this.I_p1 <= cursor$0) ? false : true)) {
+ break lab0;
+ }
+ switch (among_var) {
+ case 0:
+ break lab0;
+ case 1:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 2:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ v_2 = this.limit - this.cursor;
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ this.ket = this.cursor;
+ if (! this.eq_s_b$IS(1, "s")) {
+ this.cursor = this.limit - v_2;
+ break lab1;
+ }
+ this.bra = this.cursor;
+ if (! this.eq_s_b$IS(3, "nis")) {
+ this.cursor = this.limit - v_2;
+ break lab1;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ }
+ break;
+ case 3:
+ if (! this.in_grouping_b$AIII(GermanStemmer.g_s_ending, 98, 116)) {
+ break lab0;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ }
+ }
+ cursor$2 = this.cursor = (limit$0 = this.limit) - v_1;
+ v_3 = limit$0 - cursor$2;
+ lab2 = true;
+lab2:
+ while (lab2 === true) {
+ lab2 = false;
+ this.ket = this.cursor;
+ among_var = this.find_among_b$ALAmong$I(GermanStemmer.a_2, 4);
+ if (among_var === 0) {
+ break lab2;
+ }
+ this.bra = cursor$1 = this.cursor;
+ if (! (! (this.I_p1 <= cursor$1) ? false : true)) {
+ break lab2;
+ }
+ switch (among_var) {
+ case 0:
+ break lab2;
+ case 1:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 2:
+ if (! this.in_grouping_b$AIII(GermanStemmer.g_st_ending, 98, 116)) {
+ break lab2;
+ }
+ c = (this.cursor - 3 | 0);
+ if (this.limit_backward > c || c > this.limit) {
+ break lab2;
+ }
+ this.cursor = c;
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ }
+ }
+ cursor$8 = this.cursor = (limit$1 = this.limit) - v_3;
+ v_4 = limit$1 - cursor$8;
+ lab3 = true;
+lab3:
+ while (lab3 === true) {
+ lab3 = false;
+ this.ket = this.cursor;
+ among_var = this.find_among_b$ALAmong$I(GermanStemmer.a_4, 8);
+ if (among_var === 0) {
+ break lab3;
+ }
+ this.bra = cursor$3 = this.cursor;
+ if (! (! (this.I_p2 <= cursor$3) ? false : true)) {
+ break lab3;
+ }
+ switch (among_var) {
+ case 0:
+ break lab3;
+ case 1:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ v_5 = this.limit - this.cursor;
+ lab4 = true;
+ lab4:
+ while (lab4 === true) {
+ lab4 = false;
+ this.ket = this.cursor;
+ if (! this.eq_s_b$IS(2, "ig")) {
+ this.cursor = this.limit - v_5;
+ break lab4;
+ }
+ this.bra = cursor$4 = this.cursor;
+ v_6 = this.limit - cursor$4;
+ lab5 = true;
+ lab5:
+ while (lab5 === true) {
+ lab5 = false;
+ if (! this.eq_s_b$IS(1, "e")) {
+ break lab5;
+ }
+ this.cursor = this.limit - v_5;
+ break lab4;
+ }
+ cursor$5 = this.cursor = this.limit - v_6;
+ if (! (! (this.I_p2 <= cursor$5) ? false : true)) {
+ this.cursor = this.limit - v_5;
+ break lab4;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ }
+ break;
+ case 2:
+ v_7 = this.limit - this.cursor;
+ lab6 = true;
+ lab6:
+ while (lab6 === true) {
+ lab6 = false;
+ if (! this.eq_s_b$IS(1, "e")) {
+ break lab6;
+ }
+ break lab3;
+ }
+ this.cursor = this.limit - v_7;
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 3:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ v_8 = this.limit - this.cursor;
+ lab7 = true;
+ lab7:
+ while (lab7 === true) {
+ lab7 = false;
+ this.ket = this.cursor;
+ lab8 = true;
+ lab8:
+ while (lab8 === true) {
+ lab8 = false;
+ v_9 = this.limit - this.cursor;
+ lab9 = true;
+ lab9:
+ while (lab9 === true) {
+ lab9 = false;
+ if (! this.eq_s_b$IS(2, "er")) {
+ break lab9;
+ }
+ break lab8;
+ }
+ this.cursor = this.limit - v_9;
+ if (! this.eq_s_b$IS(2, "en")) {
+ this.cursor = this.limit - v_8;
+ break lab7;
+ }
+ }
+ this.bra = cursor$6 = this.cursor;
+ if (! (! (this.I_p1 <= cursor$6) ? false : true)) {
+ this.cursor = this.limit - v_8;
+ break lab7;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ }
+ break;
+ case 4:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ v_10 = this.limit - this.cursor;
+ lab10 = true;
+ lab10:
+ while (lab10 === true) {
+ lab10 = false;
+ this.ket = this.cursor;
+ among_var = this.find_among_b$ALAmong$I(GermanStemmer.a_3, 2);
+ if (among_var === 0) {
+ this.cursor = this.limit - v_10;
+ break lab10;
+ }
+ this.bra = cursor$7 = this.cursor;
+ if (! (! (this.I_p2 <= cursor$7) ? false : true)) {
+ this.cursor = this.limit - v_10;
+ break lab10;
+ }
+ switch (among_var) {
+ case 0:
+ this.cursor = this.limit - v_10;
+ break lab10;
+ case 1:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ }
+ }
+ break;
+ }
+ }
+ this.cursor = this.limit - v_4;
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+GermanStemmer.prototype.stem$ = function () {
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var v_4;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!boolean} */
+ var lab2;
+ /** @type {!boolean} */
+ var lab3;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var cursor$1;
+ /** @type {!number} */
+ var cursor$2;
+ v_1 = this.cursor;
+ lab0 = true;
+lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ if (! this.r_prelude$()) {
+ break lab0;
+ }
+ }
+ cursor$0 = this.cursor = v_1;
+ v_2 = cursor$0;
+ lab1 = true;
+lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ if (! this.r_mark_regions$()) {
+ break lab1;
+ }
+ }
+ cursor$1 = this.cursor = v_2;
+ this.limit_backward = cursor$1;
+ this.cursor = this.limit;
+ lab2 = true;
+lab2:
+ while (lab2 === true) {
+ lab2 = false;
+ if (! this.r_standard_suffix$()) {
+ break lab2;
+ }
+ }
+ cursor$2 = this.cursor = this.limit_backward;
+ v_4 = cursor$2;
+ lab3 = true;
+lab3:
+ while (lab3 === true) {
+ lab3 = false;
+ if (! this.r_postlude$()) {
+ break lab3;
+ }
+ }
+ this.cursor = v_4;
+ return true;
+};
+
+/**
+ * @param {*} o
+ * @return {!boolean}
+ */
+GermanStemmer.prototype.equals$X = function (o) {
+ return o instanceof GermanStemmer;
+};
+
+/**
+ * @return {!number}
+ */
+GermanStemmer.prototype.hashCode$ = function () {
+ /** @type {!string} */
+ var classname;
+ /** @type {!number} */
+ var hash;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var char;
+ classname = "GermanStemmer";
+ hash = 0;
+ if ("GermanStemmer".length === 0) {
+ return (hash | 0);
+ }
+ for (i = 0; i < classname.length; i++) {
+ char = classname.charCodeAt(i);
+ hash = (hash << 5) - hash + char;
+ hash = hash & hash;
+ }
+ return (hash | 0);
+};
+
+/**
+ * class FrenchStemmer extends BaseStemmer
+ * @constructor
+ */
+function FrenchStemmer() {
+}
+
+FrenchStemmer.prototype = new BaseStemmer;
+/**
+ * @constructor
+ */
+function FrenchStemmer$() {
+ BaseStemmer$.call(this);
+ this.I_p2 = 0;
+ this.I_p1 = 0;
+ this.I_pV = 0;
+};
+
+FrenchStemmer$.prototype = new FrenchStemmer;
+
+/**
+ * @param {FrenchStemmer} other
+ */
+FrenchStemmer.prototype.copy_from$LFrenchStemmer$ = function (other) {
+ this.I_p2 = other.I_p2;
+ this.I_p1 = other.I_p1;
+ this.I_pV = other.I_pV;
+ BaseStemmer.prototype.copy_from$LBaseStemmer$.call(this, other);
+};
+
+/**
+ * @return {!boolean}
+ */
+FrenchStemmer.prototype.r_prelude$ = function () {
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var v_3;
+ /** @type {!number} */
+ var v_4;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!boolean} */
+ var lab3;
+ /** @type {!boolean} */
+ var lab4;
+ /** @type {!boolean} */
+ var lab5;
+ /** @type {!boolean} */
+ var lab6;
+ /** @type {!boolean} */
+ var lab7;
+ /** @type {!boolean} */
+ var lab8;
+ /** @type {!boolean} */
+ var lab9;
+ /** @type {!number} */
+ var cursor$0;
+replab0:
+ while (true) {
+ v_1 = this.cursor;
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ golab2:
+ while (true) {
+ v_2 = this.cursor;
+ lab3 = true;
+ lab3:
+ while (lab3 === true) {
+ lab3 = false;
+ lab4 = true;
+ lab4:
+ while (lab4 === true) {
+ lab4 = false;
+ v_3 = this.cursor;
+ lab5 = true;
+ lab5:
+ while (lab5 === true) {
+ lab5 = false;
+ if (! this.in_grouping$AIII(FrenchStemmer.g_v, 97, 251)) {
+ break lab5;
+ }
+ this.bra = this.cursor;
+ lab6 = true;
+ lab6:
+ while (lab6 === true) {
+ lab6 = false;
+ v_4 = this.cursor;
+ lab7 = true;
+ lab7:
+ while (lab7 === true) {
+ lab7 = false;
+ if (! this.eq_s$IS(1, "u")) {
+ break lab7;
+ }
+ this.ket = this.cursor;
+ if (! this.in_grouping$AIII(FrenchStemmer.g_v, 97, 251)) {
+ break lab7;
+ }
+ if (! this.slice_from$S("U")) {
+ return false;
+ }
+ break lab6;
+ }
+ this.cursor = v_4;
+ lab8 = true;
+ lab8:
+ while (lab8 === true) {
+ lab8 = false;
+ if (! this.eq_s$IS(1, "i")) {
+ break lab8;
+ }
+ this.ket = this.cursor;
+ if (! this.in_grouping$AIII(FrenchStemmer.g_v, 97, 251)) {
+ break lab8;
+ }
+ if (! this.slice_from$S("I")) {
+ return false;
+ }
+ break lab6;
+ }
+ this.cursor = v_4;
+ if (! this.eq_s$IS(1, "y")) {
+ break lab5;
+ }
+ this.ket = this.cursor;
+ if (! this.slice_from$S("Y")) {
+ return false;
+ }
+ }
+ break lab4;
+ }
+ this.cursor = v_3;
+ lab9 = true;
+ lab9:
+ while (lab9 === true) {
+ lab9 = false;
+ this.bra = this.cursor;
+ if (! this.eq_s$IS(1, "y")) {
+ break lab9;
+ }
+ this.ket = this.cursor;
+ if (! this.in_grouping$AIII(FrenchStemmer.g_v, 97, 251)) {
+ break lab9;
+ }
+ if (! this.slice_from$S("Y")) {
+ return false;
+ }
+ break lab4;
+ }
+ this.cursor = v_3;
+ if (! this.eq_s$IS(1, "q")) {
+ break lab3;
+ }
+ this.bra = this.cursor;
+ if (! this.eq_s$IS(1, "u")) {
+ break lab3;
+ }
+ this.ket = this.cursor;
+ if (! this.slice_from$S("U")) {
+ return false;
+ }
+ }
+ this.cursor = v_2;
+ break golab2;
+ }
+ cursor$0 = this.cursor = v_2;
+ if (cursor$0 >= this.limit) {
+ break lab1;
+ }
+ this.cursor++;
+ }
+ continue replab0;
+ }
+ this.cursor = v_1;
+ break replab0;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+FrenchStemmer.prototype.r_mark_regions$ = function () {
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var v_4;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!boolean} */
+ var lab2;
+ /** @type {!boolean} */
+ var lab3;
+ /** @type {!boolean} */
+ var lab5;
+ /** @type {!boolean} */
+ var lab6;
+ /** @type {!boolean} */
+ var lab8;
+ /** @type {!boolean} */
+ var lab10;
+ /** @type {!boolean} */
+ var lab12;
+ /** @type {!boolean} */
+ var lab14;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var limit$0;
+ /** @type {!number} */
+ var cursor$1;
+ this.I_pV = limit$0 = this.limit;
+ this.I_p1 = limit$0;
+ this.I_p2 = limit$0;
+ v_1 = this.cursor;
+ lab0 = true;
+lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ v_2 = this.cursor;
+ lab2 = true;
+ lab2:
+ while (lab2 === true) {
+ lab2 = false;
+ if (! this.in_grouping$AIII(FrenchStemmer.g_v, 97, 251)) {
+ break lab2;
+ }
+ if (! this.in_grouping$AIII(FrenchStemmer.g_v, 97, 251)) {
+ break lab2;
+ }
+ if (this.cursor >= this.limit) {
+ break lab2;
+ }
+ this.cursor++;
+ break lab1;
+ }
+ this.cursor = v_2;
+ lab3 = true;
+ lab3:
+ while (lab3 === true) {
+ lab3 = false;
+ if (this.find_among$ALAmong$I(FrenchStemmer.a_0, 3) === 0) {
+ break lab3;
+ }
+ break lab1;
+ }
+ cursor$0 = this.cursor = v_2;
+ if (cursor$0 >= this.limit) {
+ break lab0;
+ }
+ this.cursor++;
+ golab4:
+ while (true) {
+ lab5 = true;
+ lab5:
+ while (lab5 === true) {
+ lab5 = false;
+ if (! this.in_grouping$AIII(FrenchStemmer.g_v, 97, 251)) {
+ break lab5;
+ }
+ break golab4;
+ }
+ if (this.cursor >= this.limit) {
+ break lab0;
+ }
+ this.cursor++;
+ }
+ }
+ this.I_pV = this.cursor;
+ }
+ cursor$1 = this.cursor = v_1;
+ v_4 = cursor$1;
+ lab6 = true;
+lab6:
+ while (lab6 === true) {
+ lab6 = false;
+ golab7:
+ while (true) {
+ lab8 = true;
+ lab8:
+ while (lab8 === true) {
+ lab8 = false;
+ if (! this.in_grouping$AIII(FrenchStemmer.g_v, 97, 251)) {
+ break lab8;
+ }
+ break golab7;
+ }
+ if (this.cursor >= this.limit) {
+ break lab6;
+ }
+ this.cursor++;
+ }
+ golab9:
+ while (true) {
+ lab10 = true;
+ lab10:
+ while (lab10 === true) {
+ lab10 = false;
+ if (! this.out_grouping$AIII(FrenchStemmer.g_v, 97, 251)) {
+ break lab10;
+ }
+ break golab9;
+ }
+ if (this.cursor >= this.limit) {
+ break lab6;
+ }
+ this.cursor++;
+ }
+ this.I_p1 = this.cursor;
+ golab11:
+ while (true) {
+ lab12 = true;
+ lab12:
+ while (lab12 === true) {
+ lab12 = false;
+ if (! this.in_grouping$AIII(FrenchStemmer.g_v, 97, 251)) {
+ break lab12;
+ }
+ break golab11;
+ }
+ if (this.cursor >= this.limit) {
+ break lab6;
+ }
+ this.cursor++;
+ }
+ golab13:
+ while (true) {
+ lab14 = true;
+ lab14:
+ while (lab14 === true) {
+ lab14 = false;
+ if (! this.out_grouping$AIII(FrenchStemmer.g_v, 97, 251)) {
+ break lab14;
+ }
+ break golab13;
+ }
+ if (this.cursor >= this.limit) {
+ break lab6;
+ }
+ this.cursor++;
+ }
+ this.I_p2 = this.cursor;
+ }
+ this.cursor = v_4;
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+FrenchStemmer.prototype.r_postlude$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var v_1;
+ /** @type {!boolean} */
+ var lab1;
+replab0:
+ while (true) {
+ v_1 = this.cursor;
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ this.bra = this.cursor;
+ among_var = this.find_among$ALAmong$I(FrenchStemmer.a_1, 4);
+ if (among_var === 0) {
+ break lab1;
+ }
+ this.ket = this.cursor;
+ switch (among_var) {
+ case 0:
+ break lab1;
+ case 1:
+ if (! this.slice_from$S("i")) {
+ return false;
+ }
+ break;
+ case 2:
+ if (! this.slice_from$S("u")) {
+ return false;
+ }
+ break;
+ case 3:
+ if (! this.slice_from$S("y")) {
+ return false;
+ }
+ break;
+ case 4:
+ if (this.cursor >= this.limit) {
+ break lab1;
+ }
+ this.cursor++;
+ break;
+ }
+ continue replab0;
+ }
+ this.cursor = v_1;
+ break replab0;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+FrenchStemmer.prototype.r_RV$ = function () {
+ return (! (this.I_pV <= this.cursor) ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+FrenchStemmer.prototype.r_R1$ = function () {
+ return (! (this.I_p1 <= this.cursor) ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+FrenchStemmer.prototype.r_R2$ = function () {
+ return (! (this.I_p2 <= this.cursor) ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+FrenchStemmer.prototype.r_standard_suffix$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var v_3;
+ /** @type {!number} */
+ var v_4;
+ /** @type {!number} */
+ var v_5;
+ /** @type {!number} */
+ var v_6;
+ /** @type {!number} */
+ var v_7;
+ /** @type {!number} */
+ var v_8;
+ /** @type {!number} */
+ var v_9;
+ /** @type {!number} */
+ var v_10;
+ /** @type {!number} */
+ var v_11;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!boolean} */
+ var lab2;
+ /** @type {!boolean} */
+ var lab3;
+ /** @type {!boolean} */
+ var lab4;
+ /** @type {!boolean} */
+ var lab5;
+ /** @type {!boolean} */
+ var lab6;
+ /** @type {!boolean} */
+ var lab7;
+ /** @type {!boolean} */
+ var lab8;
+ /** @type {!boolean} */
+ var lab9;
+ /** @type {!boolean} */
+ var lab10;
+ /** @type {!boolean} */
+ var lab11;
+ /** @type {!boolean} */
+ var lab12;
+ /** @type {!boolean} */
+ var lab13;
+ /** @type {!boolean} */
+ var lab14;
+ /** @type {!boolean} */
+ var lab15;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var cursor$1;
+ /** @type {!number} */
+ var cursor$2;
+ /** @type {!number} */
+ var cursor$3;
+ this.ket = this.cursor;
+ among_var = this.find_among_b$ALAmong$I(FrenchStemmer.a_4, 43);
+ if (among_var === 0) {
+ return false;
+ }
+ this.bra = this.cursor;
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ if (! (! (this.I_p2 <= this.cursor) ? false : true)) {
+ return false;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 2:
+ if (! (! (this.I_p2 <= this.cursor) ? false : true)) {
+ return false;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ v_1 = this.limit - this.cursor;
+ lab0 = true;
+ lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ this.ket = this.cursor;
+ if (! this.eq_s_b$IS(2, "ic")) {
+ this.cursor = this.limit - v_1;
+ break lab0;
+ }
+ this.bra = this.cursor;
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ v_2 = this.limit - this.cursor;
+ lab2 = true;
+ lab2:
+ while (lab2 === true) {
+ lab2 = false;
+ if (! (! (this.I_p2 <= this.cursor) ? false : true)) {
+ break lab2;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break lab1;
+ }
+ this.cursor = this.limit - v_2;
+ if (! this.slice_from$S("iqU")) {
+ return false;
+ }
+ }
+ }
+ break;
+ case 3:
+ if (! (! (this.I_p2 <= this.cursor) ? false : true)) {
+ return false;
+ }
+ if (! this.slice_from$S("log")) {
+ return false;
+ }
+ break;
+ case 4:
+ if (! (! (this.I_p2 <= this.cursor) ? false : true)) {
+ return false;
+ }
+ if (! this.slice_from$S("u")) {
+ return false;
+ }
+ break;
+ case 5:
+ if (! (! (this.I_p2 <= this.cursor) ? false : true)) {
+ return false;
+ }
+ if (! this.slice_from$S("ent")) {
+ return false;
+ }
+ break;
+ case 6:
+ if (! (! (this.I_pV <= this.cursor) ? false : true)) {
+ return false;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ v_3 = this.limit - this.cursor;
+ lab3 = true;
+ lab3:
+ while (lab3 === true) {
+ lab3 = false;
+ this.ket = this.cursor;
+ among_var = this.find_among_b$ALAmong$I(FrenchStemmer.a_2, 6);
+ if (among_var === 0) {
+ this.cursor = this.limit - v_3;
+ break lab3;
+ }
+ this.bra = this.cursor;
+ switch (among_var) {
+ case 0:
+ this.cursor = this.limit - v_3;
+ break lab3;
+ case 1:
+ if (! (! (this.I_p2 <= this.cursor) ? false : true)) {
+ this.cursor = this.limit - v_3;
+ break lab3;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ this.ket = this.cursor;
+ if (! this.eq_s_b$IS(2, "at")) {
+ this.cursor = this.limit - v_3;
+ break lab3;
+ }
+ this.bra = cursor$0 = this.cursor;
+ if (! (! (this.I_p2 <= cursor$0) ? false : true)) {
+ this.cursor = this.limit - v_3;
+ break lab3;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 2:
+ lab4 = true;
+ lab4:
+ while (lab4 === true) {
+ lab4 = false;
+ v_4 = this.limit - this.cursor;
+ lab5 = true;
+ lab5:
+ while (lab5 === true) {
+ lab5 = false;
+ if (! (! (this.I_p2 <= this.cursor) ? false : true)) {
+ break lab5;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break lab4;
+ }
+ cursor$1 = this.cursor = this.limit - v_4;
+ if (! (! (this.I_p1 <= cursor$1) ? false : true)) {
+ this.cursor = this.limit - v_3;
+ break lab3;
+ }
+ if (! this.slice_from$S("eux")) {
+ return false;
+ }
+ }
+ break;
+ case 3:
+ if (! (! (this.I_p2 <= this.cursor) ? false : true)) {
+ this.cursor = this.limit - v_3;
+ break lab3;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 4:
+ if (! (! (this.I_pV <= this.cursor) ? false : true)) {
+ this.cursor = this.limit - v_3;
+ break lab3;
+ }
+ if (! this.slice_from$S("i")) {
+ return false;
+ }
+ break;
+ }
+ }
+ break;
+ case 7:
+ if (! (! (this.I_p2 <= this.cursor) ? false : true)) {
+ return false;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ v_5 = this.limit - this.cursor;
+ lab6 = true;
+ lab6:
+ while (lab6 === true) {
+ lab6 = false;
+ this.ket = this.cursor;
+ among_var = this.find_among_b$ALAmong$I(FrenchStemmer.a_3, 3);
+ if (among_var === 0) {
+ this.cursor = this.limit - v_5;
+ break lab6;
+ }
+ this.bra = this.cursor;
+ switch (among_var) {
+ case 0:
+ this.cursor = this.limit - v_5;
+ break lab6;
+ case 1:
+ lab7 = true;
+ lab7:
+ while (lab7 === true) {
+ lab7 = false;
+ v_6 = this.limit - this.cursor;
+ lab8 = true;
+ lab8:
+ while (lab8 === true) {
+ lab8 = false;
+ if (! (! (this.I_p2 <= this.cursor) ? false : true)) {
+ break lab8;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break lab7;
+ }
+ this.cursor = this.limit - v_6;
+ if (! this.slice_from$S("abl")) {
+ return false;
+ }
+ }
+ break;
+ case 2:
+ lab9 = true;
+ lab9:
+ while (lab9 === true) {
+ lab9 = false;
+ v_7 = this.limit - this.cursor;
+ lab10 = true;
+ lab10:
+ while (lab10 === true) {
+ lab10 = false;
+ if (! (! (this.I_p2 <= this.cursor) ? false : true)) {
+ break lab10;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break lab9;
+ }
+ this.cursor = this.limit - v_7;
+ if (! this.slice_from$S("iqU")) {
+ return false;
+ }
+ }
+ break;
+ case 3:
+ if (! (! (this.I_p2 <= this.cursor) ? false : true)) {
+ this.cursor = this.limit - v_5;
+ break lab6;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ }
+ }
+ break;
+ case 8:
+ if (! (! (this.I_p2 <= this.cursor) ? false : true)) {
+ return false;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ v_8 = this.limit - this.cursor;
+ lab11 = true;
+ lab11:
+ while (lab11 === true) {
+ lab11 = false;
+ this.ket = this.cursor;
+ if (! this.eq_s_b$IS(2, "at")) {
+ this.cursor = this.limit - v_8;
+ break lab11;
+ }
+ this.bra = cursor$2 = this.cursor;
+ if (! (! (this.I_p2 <= cursor$2) ? false : true)) {
+ this.cursor = this.limit - v_8;
+ break lab11;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ this.ket = this.cursor;
+ if (! this.eq_s_b$IS(2, "ic")) {
+ this.cursor = this.limit - v_8;
+ break lab11;
+ }
+ this.bra = this.cursor;
+ lab12 = true;
+ lab12:
+ while (lab12 === true) {
+ lab12 = false;
+ v_9 = this.limit - this.cursor;
+ lab13 = true;
+ lab13:
+ while (lab13 === true) {
+ lab13 = false;
+ if (! (! (this.I_p2 <= this.cursor) ? false : true)) {
+ break lab13;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break lab12;
+ }
+ this.cursor = this.limit - v_9;
+ if (! this.slice_from$S("iqU")) {
+ return false;
+ }
+ }
+ }
+ break;
+ case 9:
+ if (! this.slice_from$S("eau")) {
+ return false;
+ }
+ break;
+ case 10:
+ if (! (! (this.I_p1 <= this.cursor) ? false : true)) {
+ return false;
+ }
+ if (! this.slice_from$S("al")) {
+ return false;
+ }
+ break;
+ case 11:
+ lab14 = true;
+ lab14:
+ while (lab14 === true) {
+ lab14 = false;
+ v_10 = this.limit - this.cursor;
+ lab15 = true;
+ lab15:
+ while (lab15 === true) {
+ lab15 = false;
+ if (! (! (this.I_p2 <= this.cursor) ? false : true)) {
+ break lab15;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break lab14;
+ }
+ cursor$3 = this.cursor = this.limit - v_10;
+ if (! (! (this.I_p1 <= cursor$3) ? false : true)) {
+ return false;
+ }
+ if (! this.slice_from$S("eux")) {
+ return false;
+ }
+ }
+ break;
+ case 12:
+ if (! (! (this.I_p1 <= this.cursor) ? false : true)) {
+ return false;
+ }
+ if (! this.out_grouping_b$AIII(FrenchStemmer.g_v, 97, 251)) {
+ return false;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 13:
+ if (! (! (this.I_pV <= this.cursor) ? false : true)) {
+ return false;
+ }
+ if (! this.slice_from$S("ant")) {
+ return false;
+ }
+ return false;
+ case 14:
+ if (! (! (this.I_pV <= this.cursor) ? false : true)) {
+ return false;
+ }
+ if (! this.slice_from$S("ent")) {
+ return false;
+ }
+ return false;
+ case 15:
+ v_11 = this.limit - this.cursor;
+ if (! this.in_grouping_b$AIII(FrenchStemmer.g_v, 97, 251)) {
+ return false;
+ }
+ if (! (! (this.I_pV <= this.cursor) ? false : true)) {
+ return false;
+ }
+ this.cursor = this.limit - v_11;
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ return false;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+FrenchStemmer.prototype.r_i_verb_suffix$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var cursor$1;
+ /** @type {!number} */
+ var cursor$2;
+ v_1 = this.limit - (cursor$0 = this.cursor);
+ if (cursor$0 < this.I_pV) {
+ return false;
+ }
+ cursor$1 = this.cursor = this.I_pV;
+ v_2 = this.limit_backward;
+ this.limit_backward = cursor$1;
+ cursor$2 = this.cursor = this.limit - v_1;
+ this.ket = cursor$2;
+ among_var = this.find_among_b$ALAmong$I(FrenchStemmer.a_5, 35);
+ if (among_var === 0) {
+ this.limit_backward = v_2;
+ return false;
+ }
+ this.bra = this.cursor;
+ switch (among_var) {
+ case 0:
+ this.limit_backward = v_2;
+ return false;
+ case 1:
+ if (! this.out_grouping_b$AIII(FrenchStemmer.g_v, 97, 251)) {
+ this.limit_backward = v_2;
+ return false;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ }
+ this.limit_backward = v_2;
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+FrenchStemmer.prototype.r_verb_suffix$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var v_3;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var cursor$1;
+ /** @type {!number} */
+ var cursor$2;
+ v_1 = this.limit - (cursor$0 = this.cursor);
+ if (cursor$0 < this.I_pV) {
+ return false;
+ }
+ cursor$1 = this.cursor = this.I_pV;
+ v_2 = this.limit_backward;
+ this.limit_backward = cursor$1;
+ cursor$2 = this.cursor = this.limit - v_1;
+ this.ket = cursor$2;
+ among_var = this.find_among_b$ALAmong$I(FrenchStemmer.a_6, 38);
+ if (among_var === 0) {
+ this.limit_backward = v_2;
+ return false;
+ }
+ this.bra = this.cursor;
+ switch (among_var) {
+ case 0:
+ this.limit_backward = v_2;
+ return false;
+ case 1:
+ if (! (! (this.I_p2 <= this.cursor) ? false : true)) {
+ this.limit_backward = v_2;
+ return false;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 2:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 3:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ v_3 = this.limit - this.cursor;
+ lab0 = true;
+ lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ this.ket = this.cursor;
+ if (! this.eq_s_b$IS(1, "e")) {
+ this.cursor = this.limit - v_3;
+ break lab0;
+ }
+ this.bra = this.cursor;
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ }
+ break;
+ }
+ this.limit_backward = v_2;
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+FrenchStemmer.prototype.r_residual_suffix$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var v_3;
+ /** @type {!number} */
+ var v_4;
+ /** @type {!number} */
+ var v_5;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!boolean} */
+ var lab2;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var cursor$1;
+ /** @type {!number} */
+ var cursor$2;
+ /** @type {!number} */
+ var cursor$3;
+ v_1 = this.limit - this.cursor;
+ lab0 = true;
+lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ this.ket = this.cursor;
+ if (! this.eq_s_b$IS(1, "s")) {
+ this.cursor = this.limit - v_1;
+ break lab0;
+ }
+ this.bra = cursor$0 = this.cursor;
+ v_2 = this.limit - cursor$0;
+ if (! this.out_grouping_b$AIII(FrenchStemmer.g_keep_with_s, 97, 232)) {
+ this.cursor = this.limit - v_1;
+ break lab0;
+ }
+ this.cursor = this.limit - v_2;
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ }
+ v_3 = this.limit - (cursor$1 = this.cursor);
+ if (cursor$1 < this.I_pV) {
+ return false;
+ }
+ cursor$2 = this.cursor = this.I_pV;
+ v_4 = this.limit_backward;
+ this.limit_backward = cursor$2;
+ cursor$3 = this.cursor = this.limit - v_3;
+ this.ket = cursor$3;
+ among_var = this.find_among_b$ALAmong$I(FrenchStemmer.a_7, 7);
+ if (among_var === 0) {
+ this.limit_backward = v_4;
+ return false;
+ }
+ this.bra = this.cursor;
+ switch (among_var) {
+ case 0:
+ this.limit_backward = v_4;
+ return false;
+ case 1:
+ if (! (! (this.I_p2 <= this.cursor) ? false : true)) {
+ this.limit_backward = v_4;
+ return false;
+ }
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ v_5 = this.limit - this.cursor;
+ lab2 = true;
+ lab2:
+ while (lab2 === true) {
+ lab2 = false;
+ if (! this.eq_s_b$IS(1, "s")) {
+ break lab2;
+ }
+ break lab1;
+ }
+ this.cursor = this.limit - v_5;
+ if (! this.eq_s_b$IS(1, "t")) {
+ this.limit_backward = v_4;
+ return false;
+ }
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 2:
+ if (! this.slice_from$S("i")) {
+ return false;
+ }
+ break;
+ case 3:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 4:
+ if (! this.eq_s_b$IS(2, "gu")) {
+ this.limit_backward = v_4;
+ return false;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ }
+ this.limit_backward = v_4;
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+FrenchStemmer.prototype.r_un_double$ = function () {
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var cursor$0;
+ v_1 = this.limit - this.cursor;
+ if (this.find_among_b$ALAmong$I(FrenchStemmer.a_8, 5) === 0) {
+ return false;
+ }
+ cursor$0 = this.cursor = this.limit - v_1;
+ this.ket = cursor$0;
+ if (cursor$0 <= this.limit_backward) {
+ return false;
+ }
+ this.cursor--;
+ this.bra = this.cursor;
+ return (! this.slice_from$S("") ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+FrenchStemmer.prototype.r_un_accent$ = function () {
+ /** @type {!number} */
+ var v_3;
+ /** @type {!number} */
+ var v_1;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!boolean} */
+ var lab2;
+ /** @type {!boolean} */
+ var lab3;
+ v_1 = 1;
+replab0:
+ while (true) {
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ if (! this.out_grouping_b$AIII(FrenchStemmer.g_v, 97, 251)) {
+ break lab1;
+ }
+ v_1--;
+ continue replab0;
+ }
+ break replab0;
+ }
+ if (v_1 > 0) {
+ return false;
+ }
+ this.ket = this.cursor;
+ lab2 = true;
+lab2:
+ while (lab2 === true) {
+ lab2 = false;
+ v_3 = this.limit - this.cursor;
+ lab3 = true;
+ lab3:
+ while (lab3 === true) {
+ lab3 = false;
+ if (! this.eq_s_b$IS(1, "\u00E9")) {
+ break lab3;
+ }
+ break lab2;
+ }
+ this.cursor = this.limit - v_3;
+ if (! this.eq_s_b$IS(1, "\u00E8")) {
+ return false;
+ }
+ }
+ this.bra = this.cursor;
+ return (! this.slice_from$S("e") ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+FrenchStemmer.prototype.stem$ = function () {
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var v_3;
+ /** @type {!number} */
+ var v_4;
+ /** @type {!number} */
+ var v_5;
+ /** @type {!number} */
+ var v_6;
+ /** @type {!number} */
+ var v_7;
+ /** @type {!number} */
+ var v_8;
+ /** @type {!number} */
+ var v_9;
+ /** @type {!number} */
+ var v_11;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!boolean} */
+ var lab2;
+ /** @type {!boolean} */
+ var lab3;
+ /** @type {!boolean} */
+ var lab4;
+ /** @type {!boolean} */
+ var lab5;
+ /** @type {!boolean} */
+ var lab6;
+ /** @type {!boolean} */
+ var lab7;
+ /** @type {!boolean} */
+ var lab8;
+ /** @type {!boolean} */
+ var lab9;
+ /** @type {!boolean} */
+ var lab10;
+ /** @type {!boolean} */
+ var lab11;
+ /** @type {!boolean} */
+ var lab12;
+ /** @type {!boolean} */
+ var lab13;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var limit$0;
+ /** @type {!number} */
+ var cursor$1;
+ /** @type {!number} */
+ var cursor$2;
+ /** @type {!number} */
+ var limit$1;
+ /** @type {!number} */
+ var cursor$3;
+ /** @type {!number} */
+ var limit$2;
+ /** @type {!number} */
+ var cursor$4;
+ /** @type {!number} */
+ var cursor$5;
+ v_1 = this.cursor;
+ lab0 = true;
+lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ if (! this.r_prelude$()) {
+ break lab0;
+ }
+ }
+ cursor$0 = this.cursor = v_1;
+ v_2 = cursor$0;
+ lab1 = true;
+lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ if (! this.r_mark_regions$()) {
+ break lab1;
+ }
+ }
+ cursor$2 = this.cursor = v_2;
+ this.limit_backward = cursor$2;
+ cursor$3 = this.cursor = limit$1 = this.limit;
+ v_3 = limit$1 - cursor$3;
+ lab2 = true;
+lab2:
+ while (lab2 === true) {
+ lab2 = false;
+ lab3 = true;
+ lab3:
+ while (lab3 === true) {
+ lab3 = false;
+ v_4 = this.limit - this.cursor;
+ lab4 = true;
+ lab4:
+ while (lab4 === true) {
+ lab4 = false;
+ v_5 = this.limit - this.cursor;
+ lab5 = true;
+ lab5:
+ while (lab5 === true) {
+ lab5 = false;
+ v_6 = this.limit - this.cursor;
+ lab6 = true;
+ lab6:
+ while (lab6 === true) {
+ lab6 = false;
+ if (! this.r_standard_suffix$()) {
+ break lab6;
+ }
+ break lab5;
+ }
+ this.cursor = this.limit - v_6;
+ lab7 = true;
+ lab7:
+ while (lab7 === true) {
+ lab7 = false;
+ if (! this.r_i_verb_suffix$()) {
+ break lab7;
+ }
+ break lab5;
+ }
+ this.cursor = this.limit - v_6;
+ if (! this.r_verb_suffix$()) {
+ break lab4;
+ }
+ }
+ cursor$1 = this.cursor = (limit$0 = this.limit) - v_5;
+ v_7 = limit$0 - cursor$1;
+ lab8 = true;
+ lab8:
+ while (lab8 === true) {
+ lab8 = false;
+ this.ket = this.cursor;
+ lab9 = true;
+ lab9:
+ while (lab9 === true) {
+ lab9 = false;
+ v_8 = this.limit - this.cursor;
+ lab10 = true;
+ lab10:
+ while (lab10 === true) {
+ lab10 = false;
+ if (! this.eq_s_b$IS(1, "Y")) {
+ break lab10;
+ }
+ this.bra = this.cursor;
+ if (! this.slice_from$S("i")) {
+ return false;
+ }
+ break lab9;
+ }
+ this.cursor = this.limit - v_8;
+ if (! this.eq_s_b$IS(1, "\u00E7")) {
+ this.cursor = this.limit - v_7;
+ break lab8;
+ }
+ this.bra = this.cursor;
+ if (! this.slice_from$S("c")) {
+ return false;
+ }
+ }
+ }
+ break lab3;
+ }
+ this.cursor = this.limit - v_4;
+ if (! this.r_residual_suffix$()) {
+ break lab2;
+ }
+ }
+ }
+ cursor$4 = this.cursor = (limit$2 = this.limit) - v_3;
+ v_9 = limit$2 - cursor$4;
+ lab11 = true;
+lab11:
+ while (lab11 === true) {
+ lab11 = false;
+ if (! this.r_un_double$()) {
+ break lab11;
+ }
+ }
+ this.cursor = this.limit - v_9;
+ lab12 = true;
+lab12:
+ while (lab12 === true) {
+ lab12 = false;
+ if (! this.r_un_accent$()) {
+ break lab12;
+ }
+ }
+ cursor$5 = this.cursor = this.limit_backward;
+ v_11 = cursor$5;
+ lab13 = true;
+lab13:
+ while (lab13 === true) {
+ lab13 = false;
+ if (! this.r_postlude$()) {
+ break lab13;
+ }
+ }
+ this.cursor = v_11;
+ return true;
+};
+
+/**
+ * @param {*} o
+ * @return {!boolean}
+ */
+FrenchStemmer.prototype.equals$X = function (o) {
+ return o instanceof FrenchStemmer;
+};
+
+/**
+ * @return {!number}
+ */
+FrenchStemmer.prototype.hashCode$ = function () {
+ /** @type {!string} */
+ var classname;
+ /** @type {!number} */
+ var hash;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var char;
+ classname = "FrenchStemmer";
+ hash = 0;
+ if ("FrenchStemmer".length === 0) {
+ return (hash | 0);
+ }
+ for (i = 0; i < classname.length; i++) {
+ char = classname.charCodeAt(i);
+ hash = (hash << 5) - hash + char;
+ hash = hash & hash;
+ }
+ return (hash | 0);
+};
+
+/**
+ * class FinnishStemmer extends BaseStemmer
+ * @constructor
+ */
+function FinnishStemmer() {
+}
+
+FinnishStemmer.prototype = new BaseStemmer;
+/**
+ * @constructor
+ */
+function FinnishStemmer$() {
+ BaseStemmer$.call(this);
+ this.B_ending_removed = false;
+ this.S_x = "";
+ this.I_p2 = 0;
+ this.I_p1 = 0;
+};
+
+FinnishStemmer$.prototype = new FinnishStemmer;
+
+/**
+ * @param {FinnishStemmer} other
+ */
+FinnishStemmer.prototype.copy_from$LFinnishStemmer$ = function (other) {
+ this.B_ending_removed = other.B_ending_removed;
+ this.S_x = other.S_x;
+ this.I_p2 = other.I_p2;
+ this.I_p1 = other.I_p1;
+ BaseStemmer.prototype.copy_from$LBaseStemmer$.call(this, other);
+};
+
+/**
+ * @return {!boolean}
+ */
+FinnishStemmer.prototype.r_mark_regions$ = function () {
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_3;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!boolean} */
+ var lab3;
+ /** @type {!boolean} */
+ var lab5;
+ /** @type {!boolean} */
+ var lab7;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var limit$0;
+ /** @type {!number} */
+ var cursor$1;
+ this.I_p1 = limit$0 = this.limit;
+ this.I_p2 = limit$0;
+golab0:
+ while (true) {
+ v_1 = this.cursor;
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ if (! this.in_grouping$AIII(FinnishStemmer.g_V1, 97, 246)) {
+ break lab1;
+ }
+ this.cursor = v_1;
+ break golab0;
+ }
+ cursor$0 = this.cursor = v_1;
+ if (cursor$0 >= this.limit) {
+ return false;
+ }
+ this.cursor++;
+ }
+golab2:
+ while (true) {
+ lab3 = true;
+ lab3:
+ while (lab3 === true) {
+ lab3 = false;
+ if (! this.out_grouping$AIII(FinnishStemmer.g_V1, 97, 246)) {
+ break lab3;
+ }
+ break golab2;
+ }
+ if (this.cursor >= this.limit) {
+ return false;
+ }
+ this.cursor++;
+ }
+ this.I_p1 = this.cursor;
+golab4:
+ while (true) {
+ v_3 = this.cursor;
+ lab5 = true;
+ lab5:
+ while (lab5 === true) {
+ lab5 = false;
+ if (! this.in_grouping$AIII(FinnishStemmer.g_V1, 97, 246)) {
+ break lab5;
+ }
+ this.cursor = v_3;
+ break golab4;
+ }
+ cursor$1 = this.cursor = v_3;
+ if (cursor$1 >= this.limit) {
+ return false;
+ }
+ this.cursor++;
+ }
+golab6:
+ while (true) {
+ lab7 = true;
+ lab7:
+ while (lab7 === true) {
+ lab7 = false;
+ if (! this.out_grouping$AIII(FinnishStemmer.g_V1, 97, 246)) {
+ break lab7;
+ }
+ break golab6;
+ }
+ if (this.cursor >= this.limit) {
+ return false;
+ }
+ this.cursor++;
+ }
+ this.I_p2 = this.cursor;
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+FinnishStemmer.prototype.r_R2$ = function () {
+ return (! (this.I_p2 <= this.cursor) ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+FinnishStemmer.prototype.r_particle_etc$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var cursor$1;
+ /** @type {!number} */
+ var cursor$2;
+ v_1 = this.limit - (cursor$0 = this.cursor);
+ if (cursor$0 < this.I_p1) {
+ return false;
+ }
+ cursor$1 = this.cursor = this.I_p1;
+ v_2 = this.limit_backward;
+ this.limit_backward = cursor$1;
+ cursor$2 = this.cursor = this.limit - v_1;
+ this.ket = cursor$2;
+ among_var = this.find_among_b$ALAmong$I(FinnishStemmer.a_0, 10);
+ if (among_var === 0) {
+ this.limit_backward = v_2;
+ return false;
+ }
+ this.bra = this.cursor;
+ this.limit_backward = v_2;
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ if (! this.in_grouping_b$AIII(FinnishStemmer.g_particle_end, 97, 246)) {
+ return false;
+ }
+ break;
+ case 2:
+ if (! (! (this.I_p2 <= this.cursor) ? false : true)) {
+ return false;
+ }
+ break;
+ }
+ return (! this.slice_from$S("") ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+FinnishStemmer.prototype.r_possessive$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var v_3;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var cursor$1;
+ /** @type {!number} */
+ var cursor$2;
+ v_1 = this.limit - (cursor$0 = this.cursor);
+ if (cursor$0 < this.I_p1) {
+ return false;
+ }
+ cursor$1 = this.cursor = this.I_p1;
+ v_2 = this.limit_backward;
+ this.limit_backward = cursor$1;
+ cursor$2 = this.cursor = this.limit - v_1;
+ this.ket = cursor$2;
+ among_var = this.find_among_b$ALAmong$I(FinnishStemmer.a_4, 9);
+ if (among_var === 0) {
+ this.limit_backward = v_2;
+ return false;
+ }
+ this.bra = this.cursor;
+ this.limit_backward = v_2;
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ v_3 = this.limit - this.cursor;
+ lab0 = true;
+ lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ if (! this.eq_s_b$IS(1, "k")) {
+ break lab0;
+ }
+ return false;
+ }
+ this.cursor = this.limit - v_3;
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 2:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ this.ket = this.cursor;
+ if (! this.eq_s_b$IS(3, "kse")) {
+ return false;
+ }
+ this.bra = this.cursor;
+ if (! this.slice_from$S("ksi")) {
+ return false;
+ }
+ break;
+ case 3:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 4:
+ if (this.find_among_b$ALAmong$I(FinnishStemmer.a_1, 6) === 0) {
+ return false;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 5:
+ if (this.find_among_b$ALAmong$I(FinnishStemmer.a_2, 6) === 0) {
+ return false;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 6:
+ if (this.find_among_b$ALAmong$I(FinnishStemmer.a_3, 2) === 0) {
+ return false;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+FinnishStemmer.prototype.r_LONG$ = function () {
+ return (this.find_among_b$ALAmong$I(FinnishStemmer.a_5, 7) === 0 ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+FinnishStemmer.prototype.r_VI$ = function () {
+ return (! this.eq_s_b$IS(1, "i") ? false : ! this.in_grouping_b$AIII(FinnishStemmer.g_V2, 97, 246) ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+FinnishStemmer.prototype.r_case_ending$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var v_3;
+ /** @type {!number} */
+ var v_4;
+ /** @type {!number} */
+ var v_5;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!boolean} */
+ var lab2;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var cursor$1;
+ /** @type {!number} */
+ var cursor$2;
+ /** @type {!number} */
+ var cursor$3;
+ v_1 = this.limit - (cursor$0 = this.cursor);
+ if (cursor$0 < this.I_p1) {
+ return false;
+ }
+ cursor$1 = this.cursor = this.I_p1;
+ v_2 = this.limit_backward;
+ this.limit_backward = cursor$1;
+ cursor$2 = this.cursor = this.limit - v_1;
+ this.ket = cursor$2;
+ among_var = this.find_among_b$ALAmong$I(FinnishStemmer.a_6, 30);
+ if (among_var === 0) {
+ this.limit_backward = v_2;
+ return false;
+ }
+ this.bra = this.cursor;
+ this.limit_backward = v_2;
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ if (! this.eq_s_b$IS(1, "a")) {
+ return false;
+ }
+ break;
+ case 2:
+ if (! this.eq_s_b$IS(1, "e")) {
+ return false;
+ }
+ break;
+ case 3:
+ if (! this.eq_s_b$IS(1, "i")) {
+ return false;
+ }
+ break;
+ case 4:
+ if (! this.eq_s_b$IS(1, "o")) {
+ return false;
+ }
+ break;
+ case 5:
+ if (! this.eq_s_b$IS(1, "\u00E4")) {
+ return false;
+ }
+ break;
+ case 6:
+ if (! this.eq_s_b$IS(1, "\u00F6")) {
+ return false;
+ }
+ break;
+ case 7:
+ v_3 = this.limit - this.cursor;
+ lab0 = true;
+ lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ v_4 = this.limit - this.cursor;
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ v_5 = this.limit - this.cursor;
+ lab2 = true;
+ lab2:
+ while (lab2 === true) {
+ lab2 = false;
+ if (! (this.find_among_b$ALAmong$I(FinnishStemmer.a_5, 7) === 0 ? false : true)) {
+ break lab2;
+ }
+ break lab1;
+ }
+ this.cursor = this.limit - v_5;
+ if (! this.eq_s_b$IS(2, "ie")) {
+ this.cursor = this.limit - v_3;
+ break lab0;
+ }
+ }
+ cursor$3 = this.cursor = this.limit - v_4;
+ if (cursor$3 <= this.limit_backward) {
+ this.cursor = this.limit - v_3;
+ break lab0;
+ }
+ this.cursor--;
+ this.bra = this.cursor;
+ }
+ break;
+ case 8:
+ if (! this.in_grouping_b$AIII(FinnishStemmer.g_V1, 97, 246)) {
+ return false;
+ }
+ if (! this.out_grouping_b$AIII(FinnishStemmer.g_V1, 97, 246)) {
+ return false;
+ }
+ break;
+ case 9:
+ if (! this.eq_s_b$IS(1, "e")) {
+ return false;
+ }
+ break;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ this.B_ending_removed = true;
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+FinnishStemmer.prototype.r_other_endings$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var v_3;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var cursor$1;
+ /** @type {!number} */
+ var cursor$2;
+ v_1 = this.limit - (cursor$0 = this.cursor);
+ if (cursor$0 < this.I_p2) {
+ return false;
+ }
+ cursor$1 = this.cursor = this.I_p2;
+ v_2 = this.limit_backward;
+ this.limit_backward = cursor$1;
+ cursor$2 = this.cursor = this.limit - v_1;
+ this.ket = cursor$2;
+ among_var = this.find_among_b$ALAmong$I(FinnishStemmer.a_7, 14);
+ if (among_var === 0) {
+ this.limit_backward = v_2;
+ return false;
+ }
+ this.bra = this.cursor;
+ this.limit_backward = v_2;
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ v_3 = this.limit - this.cursor;
+ lab0 = true;
+ lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ if (! this.eq_s_b$IS(2, "po")) {
+ break lab0;
+ }
+ return false;
+ }
+ this.cursor = this.limit - v_3;
+ break;
+ }
+ return (! this.slice_from$S("") ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+FinnishStemmer.prototype.r_i_plural$ = function () {
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var cursor$1;
+ /** @type {!number} */
+ var cursor$2;
+ v_1 = this.limit - (cursor$0 = this.cursor);
+ if (cursor$0 < this.I_p1) {
+ return false;
+ }
+ cursor$1 = this.cursor = this.I_p1;
+ v_2 = this.limit_backward;
+ this.limit_backward = cursor$1;
+ cursor$2 = this.cursor = this.limit - v_1;
+ this.ket = cursor$2;
+ if (this.find_among_b$ALAmong$I(FinnishStemmer.a_8, 2) === 0) {
+ this.limit_backward = v_2;
+ return false;
+ }
+ this.bra = this.cursor;
+ this.limit_backward = v_2;
+ return (! this.slice_from$S("") ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+FinnishStemmer.prototype.r_t_plural$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var v_3;
+ /** @type {!number} */
+ var v_4;
+ /** @type {!number} */
+ var v_5;
+ /** @type {!number} */
+ var v_6;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var cursor$1;
+ /** @type {!number} */
+ var cursor$2;
+ /** @type {!number} */
+ var cursor$3;
+ /** @type {!number} */
+ var cursor$4;
+ /** @type {!number} */
+ var cursor$5;
+ /** @type {!number} */
+ var cursor$6;
+ v_1 = this.limit - (cursor$0 = this.cursor);
+ if (cursor$0 < this.I_p1) {
+ return false;
+ }
+ cursor$1 = this.cursor = this.I_p1;
+ v_2 = this.limit_backward;
+ this.limit_backward = cursor$1;
+ cursor$2 = this.cursor = this.limit - v_1;
+ this.ket = cursor$2;
+ if (! this.eq_s_b$IS(1, "t")) {
+ this.limit_backward = v_2;
+ return false;
+ }
+ this.bra = cursor$3 = this.cursor;
+ v_3 = this.limit - cursor$3;
+ if (! this.in_grouping_b$AIII(FinnishStemmer.g_V1, 97, 246)) {
+ this.limit_backward = v_2;
+ return false;
+ }
+ this.cursor = this.limit - v_3;
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ this.limit_backward = v_2;
+ v_4 = this.limit - (cursor$4 = this.cursor);
+ if (cursor$4 < this.I_p2) {
+ return false;
+ }
+ cursor$5 = this.cursor = this.I_p2;
+ v_5 = this.limit_backward;
+ this.limit_backward = cursor$5;
+ cursor$6 = this.cursor = this.limit - v_4;
+ this.ket = cursor$6;
+ among_var = this.find_among_b$ALAmong$I(FinnishStemmer.a_9, 2);
+ if (among_var === 0) {
+ this.limit_backward = v_5;
+ return false;
+ }
+ this.bra = this.cursor;
+ this.limit_backward = v_5;
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ v_6 = this.limit - this.cursor;
+ lab0 = true;
+ lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ if (! this.eq_s_b$IS(2, "po")) {
+ break lab0;
+ }
+ return false;
+ }
+ this.cursor = this.limit - v_6;
+ break;
+ }
+ return (! this.slice_from$S("") ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+FinnishStemmer.prototype.r_tidy$ = function () {
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var v_3;
+ /** @type {!number} */
+ var v_4;
+ /** @type {!number} */
+ var v_5;
+ /** @type {!number} */
+ var v_6;
+ /** @type {!number} */
+ var v_7;
+ /** @type {!number} */
+ var v_8;
+ /** @type {!number} */
+ var v_9;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!boolean} */
+ var lab2;
+ /** @type {!boolean} */
+ var lab3;
+ /** @type {!boolean} */
+ var lab4;
+ /** @type {!boolean} */
+ var lab5;
+ /** @type {!boolean} */
+ var lab7;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var cursor$1;
+ /** @type {!number} */
+ var cursor$2;
+ /** @type {!number} */
+ var limit$0;
+ /** @type {!number} */
+ var cursor$3;
+ /** @type {!number} */
+ var limit$1;
+ /** @type {!number} */
+ var cursor$4;
+ /** @type {!number} */
+ var limit$2;
+ /** @type {!number} */
+ var cursor$5;
+ /** @type {!number} */
+ var limit$3;
+ /** @type {!number} */
+ var cursor$6;
+ /** @type {!number} */
+ var cursor$7;
+ /** @type {!number} */
+ var cursor$8;
+ /** @type {!string} */
+ var S_x$0;
+ v_1 = this.limit - (cursor$0 = this.cursor);
+ if (cursor$0 < this.I_p1) {
+ return false;
+ }
+ cursor$2 = this.cursor = this.I_p1;
+ v_2 = this.limit_backward;
+ this.limit_backward = cursor$2;
+ cursor$3 = this.cursor = (limit$0 = this.limit) - v_1;
+ v_3 = limit$0 - cursor$3;
+ lab0 = true;
+lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ v_4 = this.limit - this.cursor;
+ if (! (this.find_among_b$ALAmong$I(FinnishStemmer.a_5, 7) === 0 ? false : true)) {
+ break lab0;
+ }
+ cursor$1 = this.cursor = this.limit - v_4;
+ this.ket = cursor$1;
+ if (cursor$1 <= this.limit_backward) {
+ break lab0;
+ }
+ this.cursor--;
+ this.bra = this.cursor;
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ }
+ cursor$4 = this.cursor = (limit$1 = this.limit) - v_3;
+ v_5 = limit$1 - cursor$4;
+ lab1 = true;
+lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ this.ket = this.cursor;
+ if (! this.in_grouping_b$AIII(FinnishStemmer.g_AEI, 97, 228)) {
+ break lab1;
+ }
+ this.bra = this.cursor;
+ if (! this.out_grouping_b$AIII(FinnishStemmer.g_V1, 97, 246)) {
+ break lab1;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ }
+ cursor$5 = this.cursor = (limit$2 = this.limit) - v_5;
+ v_6 = limit$2 - cursor$5;
+ lab2 = true;
+lab2:
+ while (lab2 === true) {
+ lab2 = false;
+ this.ket = this.cursor;
+ if (! this.eq_s_b$IS(1, "j")) {
+ break lab2;
+ }
+ this.bra = this.cursor;
+ lab3 = true;
+ lab3:
+ while (lab3 === true) {
+ lab3 = false;
+ v_7 = this.limit - this.cursor;
+ lab4 = true;
+ lab4:
+ while (lab4 === true) {
+ lab4 = false;
+ if (! this.eq_s_b$IS(1, "o")) {
+ break lab4;
+ }
+ break lab3;
+ }
+ this.cursor = this.limit - v_7;
+ if (! this.eq_s_b$IS(1, "u")) {
+ break lab2;
+ }
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ }
+ cursor$6 = this.cursor = (limit$3 = this.limit) - v_6;
+ v_8 = limit$3 - cursor$6;
+ lab5 = true;
+lab5:
+ while (lab5 === true) {
+ lab5 = false;
+ this.ket = this.cursor;
+ if (! this.eq_s_b$IS(1, "o")) {
+ break lab5;
+ }
+ this.bra = this.cursor;
+ if (! this.eq_s_b$IS(1, "j")) {
+ break lab5;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ }
+ this.cursor = this.limit - v_8;
+ this.limit_backward = v_2;
+golab6:
+ while (true) {
+ v_9 = this.limit - this.cursor;
+ lab7 = true;
+ lab7:
+ while (lab7 === true) {
+ lab7 = false;
+ if (! this.out_grouping_b$AIII(FinnishStemmer.g_V1, 97, 246)) {
+ break lab7;
+ }
+ this.cursor = this.limit - v_9;
+ break golab6;
+ }
+ cursor$7 = this.cursor = this.limit - v_9;
+ if (cursor$7 <= this.limit_backward) {
+ return false;
+ }
+ this.cursor--;
+ }
+ this.ket = cursor$8 = this.cursor;
+ if (cursor$8 <= this.limit_backward) {
+ return false;
+ }
+ this.cursor--;
+ this.bra = this.cursor;
+ S_x$0 = this.S_x = this.slice_to$S(this.S_x);
+ return (S_x$0 === '' ? false : ! this.eq_v_b$S(this.S_x) ? false : ! this.slice_from$S("") ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+FinnishStemmer.prototype.stem$ = function () {
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var v_3;
+ /** @type {!number} */
+ var v_4;
+ /** @type {!number} */
+ var v_5;
+ /** @type {!number} */
+ var v_6;
+ /** @type {!number} */
+ var v_7;
+ /** @type {!number} */
+ var v_8;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!boolean} */
+ var lab2;
+ /** @type {!boolean} */
+ var lab3;
+ /** @type {!boolean} */
+ var lab4;
+ /** @type {!boolean} */
+ var lab5;
+ /** @type {!boolean} */
+ var lab6;
+ /** @type {!boolean} */
+ var lab7;
+ /** @type {!boolean} */
+ var lab8;
+ /** @type {!boolean} */
+ var lab9;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var limit$0;
+ /** @type {!number} */
+ var cursor$1;
+ /** @type {!number} */
+ var limit$1;
+ /** @type {!number} */
+ var cursor$2;
+ /** @type {!number} */
+ var limit$2;
+ /** @type {!number} */
+ var cursor$3;
+ /** @type {!number} */
+ var limit$3;
+ /** @type {!number} */
+ var cursor$4;
+ /** @type {!number} */
+ var limit$4;
+ /** @type {!number} */
+ var cursor$5;
+ v_1 = this.cursor;
+ lab0 = true;
+lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ if (! this.r_mark_regions$()) {
+ break lab0;
+ }
+ }
+ cursor$0 = this.cursor = v_1;
+ this.B_ending_removed = false;
+ this.limit_backward = cursor$0;
+ cursor$1 = this.cursor = limit$0 = this.limit;
+ v_2 = limit$0 - cursor$1;
+ lab1 = true;
+lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ if (! this.r_particle_etc$()) {
+ break lab1;
+ }
+ }
+ cursor$2 = this.cursor = (limit$1 = this.limit) - v_2;
+ v_3 = limit$1 - cursor$2;
+ lab2 = true;
+lab2:
+ while (lab2 === true) {
+ lab2 = false;
+ if (! this.r_possessive$()) {
+ break lab2;
+ }
+ }
+ cursor$3 = this.cursor = (limit$2 = this.limit) - v_3;
+ v_4 = limit$2 - cursor$3;
+ lab3 = true;
+lab3:
+ while (lab3 === true) {
+ lab3 = false;
+ if (! this.r_case_ending$()) {
+ break lab3;
+ }
+ }
+ cursor$4 = this.cursor = (limit$3 = this.limit) - v_4;
+ v_5 = limit$3 - cursor$4;
+ lab4 = true;
+lab4:
+ while (lab4 === true) {
+ lab4 = false;
+ if (! this.r_other_endings$()) {
+ break lab4;
+ }
+ }
+ this.cursor = this.limit - v_5;
+ lab5 = true;
+lab5:
+ while (lab5 === true) {
+ lab5 = false;
+ v_6 = this.limit - this.cursor;
+ lab6 = true;
+ lab6:
+ while (lab6 === true) {
+ lab6 = false;
+ if (! this.B_ending_removed) {
+ break lab6;
+ }
+ v_7 = this.limit - this.cursor;
+ lab7 = true;
+ lab7:
+ while (lab7 === true) {
+ lab7 = false;
+ if (! this.r_i_plural$()) {
+ break lab7;
+ }
+ }
+ this.cursor = this.limit - v_7;
+ break lab5;
+ }
+ cursor$5 = this.cursor = (limit$4 = this.limit) - v_6;
+ v_8 = limit$4 - cursor$5;
+ lab8 = true;
+ lab8:
+ while (lab8 === true) {
+ lab8 = false;
+ if (! this.r_t_plural$()) {
+ break lab8;
+ }
+ }
+ this.cursor = this.limit - v_8;
+ }
+ lab9 = true;
+lab9:
+ while (lab9 === true) {
+ lab9 = false;
+ if (! this.r_tidy$()) {
+ break lab9;
+ }
+ }
+ this.cursor = this.limit_backward;
+ return true;
+};
+
+/**
+ * @param {*} o
+ * @return {!boolean}
+ */
+FinnishStemmer.prototype.equals$X = function (o) {
+ return o instanceof FinnishStemmer;
+};
+
+/**
+ * @return {!number}
+ */
+FinnishStemmer.prototype.hashCode$ = function () {
+ /** @type {!string} */
+ var classname;
+ /** @type {!number} */
+ var hash;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var char;
+ classname = "FinnishStemmer";
+ hash = 0;
+ if ("FinnishStemmer".length === 0) {
+ return (hash | 0);
+ }
+ for (i = 0; i < classname.length; i++) {
+ char = classname.charCodeAt(i);
+ hash = (hash << 5) - hash + char;
+ hash = hash & hash;
+ }
+ return (hash | 0);
+};
+
+/**
+ * class EnglishStemmer extends BaseStemmer
+ * @constructor
+ */
+function EnglishStemmer() {
+}
+
+EnglishStemmer.prototype = new BaseStemmer;
+/**
+ * @constructor
+ */
+function EnglishStemmer$() {
+ BaseStemmer$.call(this);
+ this.B_Y_found = false;
+ this.I_p2 = 0;
+ this.I_p1 = 0;
+};
+
+EnglishStemmer$.prototype = new EnglishStemmer;
+
+/**
+ * @param {EnglishStemmer} other
+ */
+EnglishStemmer.prototype.copy_from$LEnglishStemmer$ = function (other) {
+ this.B_Y_found = other.B_Y_found;
+ this.I_p2 = other.I_p2;
+ this.I_p1 = other.I_p1;
+ BaseStemmer.prototype.copy_from$LBaseStemmer$.call(this, other);
+};
+
+/**
+ * @return {!boolean}
+ */
+EnglishStemmer.prototype.r_prelude$ = function () {
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var v_3;
+ /** @type {!number} */
+ var v_4;
+ /** @type {!number} */
+ var v_5;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!boolean} */
+ var lab2;
+ /** @type {!boolean} */
+ var lab4;
+ /** @type {!boolean} */
+ var lab6;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var cursor$1;
+ /** @type {!number} */
+ var cursor$2;
+ this.B_Y_found = false;
+ v_1 = this.cursor;
+ lab0 = true;
+lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ this.bra = this.cursor;
+ if (! this.eq_s$IS(1, "'")) {
+ break lab0;
+ }
+ this.ket = this.cursor;
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ }
+ cursor$0 = this.cursor = v_1;
+ v_2 = cursor$0;
+ lab1 = true;
+lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ this.bra = this.cursor;
+ if (! this.eq_s$IS(1, "y")) {
+ break lab1;
+ }
+ this.ket = this.cursor;
+ if (! this.slice_from$S("Y")) {
+ return false;
+ }
+ this.B_Y_found = true;
+ }
+ cursor$2 = this.cursor = v_2;
+ v_3 = cursor$2;
+ lab2 = true;
+lab2:
+ while (lab2 === true) {
+ lab2 = false;
+ replab3:
+ while (true) {
+ v_4 = this.cursor;
+ lab4 = true;
+ lab4:
+ while (lab4 === true) {
+ lab4 = false;
+ golab5:
+ while (true) {
+ v_5 = this.cursor;
+ lab6 = true;
+ lab6:
+ while (lab6 === true) {
+ lab6 = false;
+ if (! this.in_grouping$AIII(EnglishStemmer.g_v, 97, 121)) {
+ break lab6;
+ }
+ this.bra = this.cursor;
+ if (! this.eq_s$IS(1, "y")) {
+ break lab6;
+ }
+ this.ket = this.cursor;
+ this.cursor = v_5;
+ break golab5;
+ }
+ cursor$1 = this.cursor = v_5;
+ if (cursor$1 >= this.limit) {
+ break lab4;
+ }
+ this.cursor++;
+ }
+ if (! this.slice_from$S("Y")) {
+ return false;
+ }
+ this.B_Y_found = true;
+ continue replab3;
+ }
+ this.cursor = v_4;
+ break replab3;
+ }
+ }
+ this.cursor = v_3;
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+EnglishStemmer.prototype.r_mark_regions$ = function () {
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!boolean} */
+ var lab2;
+ /** @type {!boolean} */
+ var lab4;
+ /** @type {!boolean} */
+ var lab6;
+ /** @type {!boolean} */
+ var lab8;
+ /** @type {!boolean} */
+ var lab10;
+ /** @type {!number} */
+ var limit$0;
+ this.I_p1 = limit$0 = this.limit;
+ this.I_p2 = limit$0;
+ v_1 = this.cursor;
+ lab0 = true;
+lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ v_2 = this.cursor;
+ lab2 = true;
+ lab2:
+ while (lab2 === true) {
+ lab2 = false;
+ if (this.find_among$ALAmong$I(EnglishStemmer.a_0, 3) === 0) {
+ break lab2;
+ }
+ break lab1;
+ }
+ this.cursor = v_2;
+ golab3:
+ while (true) {
+ lab4 = true;
+ lab4:
+ while (lab4 === true) {
+ lab4 = false;
+ if (! this.in_grouping$AIII(EnglishStemmer.g_v, 97, 121)) {
+ break lab4;
+ }
+ break golab3;
+ }
+ if (this.cursor >= this.limit) {
+ break lab0;
+ }
+ this.cursor++;
+ }
+ golab5:
+ while (true) {
+ lab6 = true;
+ lab6:
+ while (lab6 === true) {
+ lab6 = false;
+ if (! this.out_grouping$AIII(EnglishStemmer.g_v, 97, 121)) {
+ break lab6;
+ }
+ break golab5;
+ }
+ if (this.cursor >= this.limit) {
+ break lab0;
+ }
+ this.cursor++;
+ }
+ }
+ this.I_p1 = this.cursor;
+ golab7:
+ while (true) {
+ lab8 = true;
+ lab8:
+ while (lab8 === true) {
+ lab8 = false;
+ if (! this.in_grouping$AIII(EnglishStemmer.g_v, 97, 121)) {
+ break lab8;
+ }
+ break golab7;
+ }
+ if (this.cursor >= this.limit) {
+ break lab0;
+ }
+ this.cursor++;
+ }
+ golab9:
+ while (true) {
+ lab10 = true;
+ lab10:
+ while (lab10 === true) {
+ lab10 = false;
+ if (! this.out_grouping$AIII(EnglishStemmer.g_v, 97, 121)) {
+ break lab10;
+ }
+ break golab9;
+ }
+ if (this.cursor >= this.limit) {
+ break lab0;
+ }
+ this.cursor++;
+ }
+ this.I_p2 = this.cursor;
+ }
+ this.cursor = v_1;
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+EnglishStemmer.prototype.r_shortv$ = function () {
+ /** @type {!number} */
+ var v_1;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!boolean} */
+ var lab1;
+ lab0 = true;
+lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ v_1 = this.limit - this.cursor;
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ if (! this.out_grouping_b$AIII(EnglishStemmer.g_v_WXY, 89, 121)) {
+ break lab1;
+ }
+ if (! this.in_grouping_b$AIII(EnglishStemmer.g_v, 97, 121)) {
+ break lab1;
+ }
+ if (! this.out_grouping_b$AIII(EnglishStemmer.g_v, 97, 121)) {
+ break lab1;
+ }
+ break lab0;
+ }
+ this.cursor = this.limit - v_1;
+ if (! this.out_grouping_b$AIII(EnglishStemmer.g_v, 97, 121)) {
+ return false;
+ }
+ if (! this.in_grouping_b$AIII(EnglishStemmer.g_v, 97, 121)) {
+ return false;
+ }
+ if (this.cursor > this.limit_backward) {
+ return false;
+ }
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+EnglishStemmer.prototype.r_R1$ = function () {
+ return (! (this.I_p1 <= this.cursor) ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+EnglishStemmer.prototype.r_R2$ = function () {
+ return (! (this.I_p2 <= this.cursor) ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+EnglishStemmer.prototype.r_Step_1a$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!boolean} */
+ var lab2;
+ /** @type {!number} */
+ var c;
+ /** @type {!boolean} */
+ var lab4;
+ v_1 = this.limit - this.cursor;
+ lab0 = true;
+lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ this.ket = this.cursor;
+ among_var = this.find_among_b$ALAmong$I(EnglishStemmer.a_1, 3);
+ if (among_var === 0) {
+ this.cursor = this.limit - v_1;
+ break lab0;
+ }
+ this.bra = this.cursor;
+ switch (among_var) {
+ case 0:
+ this.cursor = this.limit - v_1;
+ break lab0;
+ case 1:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ }
+ }
+ this.ket = this.cursor;
+ among_var = this.find_among_b$ALAmong$I(EnglishStemmer.a_2, 6);
+ if (among_var === 0) {
+ return false;
+ }
+ this.bra = this.cursor;
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ if (! this.slice_from$S("ss")) {
+ return false;
+ }
+ break;
+ case 2:
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ v_2 = this.limit - this.cursor;
+ lab2 = true;
+ lab2:
+ while (lab2 === true) {
+ lab2 = false;
+ c = (this.cursor - 2 | 0);
+ if (this.limit_backward > c || c > this.limit) {
+ break lab2;
+ }
+ this.cursor = c;
+ if (! this.slice_from$S("i")) {
+ return false;
+ }
+ break lab1;
+ }
+ this.cursor = this.limit - v_2;
+ if (! this.slice_from$S("ie")) {
+ return false;
+ }
+ }
+ break;
+ case 3:
+ if (this.cursor <= this.limit_backward) {
+ return false;
+ }
+ this.cursor--;
+ golab3:
+ while (true) {
+ lab4 = true;
+ lab4:
+ while (lab4 === true) {
+ lab4 = false;
+ if (! this.in_grouping_b$AIII(EnglishStemmer.g_v, 97, 121)) {
+ break lab4;
+ }
+ break golab3;
+ }
+ if (this.cursor <= this.limit_backward) {
+ return false;
+ }
+ this.cursor--;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+EnglishStemmer.prototype.r_Step_1b$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_3;
+ /** @type {!number} */
+ var v_4;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!number} */
+ var c;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var cursor$1;
+ /** @type {!number} */
+ var cursor$2;
+ this.ket = this.cursor;
+ among_var = this.find_among_b$ALAmong$I(EnglishStemmer.a_4, 6);
+ if (among_var === 0) {
+ return false;
+ }
+ this.bra = this.cursor;
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ if (! (! (this.I_p1 <= this.cursor) ? false : true)) {
+ return false;
+ }
+ if (! this.slice_from$S("ee")) {
+ return false;
+ }
+ break;
+ case 2:
+ v_1 = this.limit - this.cursor;
+ golab0:
+ while (true) {
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ if (! this.in_grouping_b$AIII(EnglishStemmer.g_v, 97, 121)) {
+ break lab1;
+ }
+ break golab0;
+ }
+ if (this.cursor <= this.limit_backward) {
+ return false;
+ }
+ this.cursor--;
+ }
+ this.cursor = this.limit - v_1;
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ v_3 = this.limit - this.cursor;
+ among_var = this.find_among_b$ALAmong$I(EnglishStemmer.a_3, 13);
+ if (among_var === 0) {
+ return false;
+ }
+ this.cursor = this.limit - v_3;
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ c = cursor$0 = this.cursor;
+ this.insert$IIS(cursor$0, cursor$0, "e");
+ this.cursor = c;
+ break;
+ case 2:
+ this.ket = cursor$1 = this.cursor;
+ if (cursor$1 <= this.limit_backward) {
+ return false;
+ }
+ this.cursor--;
+ this.bra = this.cursor;
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 3:
+ if (this.cursor !== this.I_p1) {
+ return false;
+ }
+ v_4 = this.limit - this.cursor;
+ if (! this.r_shortv$()) {
+ return false;
+ }
+ cursor$2 = this.cursor = this.limit - v_4;
+ c = cursor$2;
+ this.insert$IIS(cursor$2, cursor$2, "e");
+ this.cursor = cursor$2;
+ break;
+ }
+ break;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+EnglishStemmer.prototype.r_Step_1c$ = function () {
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!boolean} */
+ var lab2;
+ this.ket = this.cursor;
+ lab0 = true;
+lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ v_1 = this.limit - this.cursor;
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ if (! this.eq_s_b$IS(1, "y")) {
+ break lab1;
+ }
+ break lab0;
+ }
+ this.cursor = this.limit - v_1;
+ if (! this.eq_s_b$IS(1, "Y")) {
+ return false;
+ }
+ }
+ this.bra = this.cursor;
+ if (! this.out_grouping_b$AIII(EnglishStemmer.g_v, 97, 121)) {
+ return false;
+ }
+ v_2 = this.limit - this.cursor;
+ lab2 = true;
+lab2:
+ while (lab2 === true) {
+ lab2 = false;
+ if (this.cursor > this.limit_backward) {
+ break lab2;
+ }
+ return false;
+ }
+ this.cursor = this.limit - v_2;
+ return (! this.slice_from$S("i") ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+EnglishStemmer.prototype.r_Step_2$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var cursor$0;
+ this.ket = this.cursor;
+ among_var = this.find_among_b$ALAmong$I(EnglishStemmer.a_5, 24);
+ if (among_var === 0) {
+ return false;
+ }
+ this.bra = cursor$0 = this.cursor;
+ if (! (! (this.I_p1 <= cursor$0) ? false : true)) {
+ return false;
+ }
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ if (! this.slice_from$S("tion")) {
+ return false;
+ }
+ break;
+ case 2:
+ if (! this.slice_from$S("ence")) {
+ return false;
+ }
+ break;
+ case 3:
+ if (! this.slice_from$S("ance")) {
+ return false;
+ }
+ break;
+ case 4:
+ if (! this.slice_from$S("able")) {
+ return false;
+ }
+ break;
+ case 5:
+ if (! this.slice_from$S("ent")) {
+ return false;
+ }
+ break;
+ case 6:
+ if (! this.slice_from$S("ize")) {
+ return false;
+ }
+ break;
+ case 7:
+ if (! this.slice_from$S("ate")) {
+ return false;
+ }
+ break;
+ case 8:
+ if (! this.slice_from$S("al")) {
+ return false;
+ }
+ break;
+ case 9:
+ if (! this.slice_from$S("ful")) {
+ return false;
+ }
+ break;
+ case 10:
+ if (! this.slice_from$S("ous")) {
+ return false;
+ }
+ break;
+ case 11:
+ if (! this.slice_from$S("ive")) {
+ return false;
+ }
+ break;
+ case 12:
+ if (! this.slice_from$S("ble")) {
+ return false;
+ }
+ break;
+ case 13:
+ if (! this.eq_s_b$IS(1, "l")) {
+ return false;
+ }
+ if (! this.slice_from$S("og")) {
+ return false;
+ }
+ break;
+ case 14:
+ if (! this.slice_from$S("ful")) {
+ return false;
+ }
+ break;
+ case 15:
+ if (! this.slice_from$S("less")) {
+ return false;
+ }
+ break;
+ case 16:
+ if (! this.in_grouping_b$AIII(EnglishStemmer.g_valid_LI, 99, 116)) {
+ return false;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+EnglishStemmer.prototype.r_Step_3$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var cursor$0;
+ this.ket = this.cursor;
+ among_var = this.find_among_b$ALAmong$I(EnglishStemmer.a_6, 9);
+ if (among_var === 0) {
+ return false;
+ }
+ this.bra = cursor$0 = this.cursor;
+ if (! (! (this.I_p1 <= cursor$0) ? false : true)) {
+ return false;
+ }
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ if (! this.slice_from$S("tion")) {
+ return false;
+ }
+ break;
+ case 2:
+ if (! this.slice_from$S("ate")) {
+ return false;
+ }
+ break;
+ case 3:
+ if (! this.slice_from$S("al")) {
+ return false;
+ }
+ break;
+ case 4:
+ if (! this.slice_from$S("ic")) {
+ return false;
+ }
+ break;
+ case 5:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 6:
+ if (! (! (this.I_p2 <= this.cursor) ? false : true)) {
+ return false;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+EnglishStemmer.prototype.r_Step_4$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var v_1;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!number} */
+ var cursor$0;
+ this.ket = this.cursor;
+ among_var = this.find_among_b$ALAmong$I(EnglishStemmer.a_7, 18);
+ if (among_var === 0) {
+ return false;
+ }
+ this.bra = cursor$0 = this.cursor;
+ if (! (! (this.I_p2 <= cursor$0) ? false : true)) {
+ return false;
+ }
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 2:
+ lab0 = true;
+ lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ v_1 = this.limit - this.cursor;
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ if (! this.eq_s_b$IS(1, "s")) {
+ break lab1;
+ }
+ break lab0;
+ }
+ this.cursor = this.limit - v_1;
+ if (! this.eq_s_b$IS(1, "t")) {
+ return false;
+ }
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+EnglishStemmer.prototype.r_Step_5$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!boolean} */
+ var lab2;
+ /** @type {!number} */
+ var cursor$0;
+ this.ket = this.cursor;
+ among_var = this.find_among_b$ALAmong$I(EnglishStemmer.a_8, 2);
+ if (among_var === 0) {
+ return false;
+ }
+ this.bra = this.cursor;
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ lab0 = true;
+ lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ v_1 = this.limit - this.cursor;
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ if (! (! (this.I_p2 <= this.cursor) ? false : true)) {
+ break lab1;
+ }
+ break lab0;
+ }
+ cursor$0 = this.cursor = this.limit - v_1;
+ if (! (! (this.I_p1 <= cursor$0) ? false : true)) {
+ return false;
+ }
+ v_2 = this.limit - this.cursor;
+ lab2 = true;
+ lab2:
+ while (lab2 === true) {
+ lab2 = false;
+ if (! this.r_shortv$()) {
+ break lab2;
+ }
+ return false;
+ }
+ this.cursor = this.limit - v_2;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 2:
+ if (! (! (this.I_p2 <= this.cursor) ? false : true)) {
+ return false;
+ }
+ if (! this.eq_s_b$IS(1, "l")) {
+ return false;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+EnglishStemmer.prototype.r_exception2$ = function () {
+ /** @type {!number} */
+ var cursor$0;
+ this.ket = this.cursor;
+ if (this.find_among_b$ALAmong$I(EnglishStemmer.a_9, 8) === 0) {
+ return false;
+ }
+ this.bra = cursor$0 = this.cursor;
+ return (cursor$0 > this.limit_backward ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+EnglishStemmer.prototype.r_exception1$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var cursor$0;
+ this.bra = this.cursor;
+ among_var = this.find_among$ALAmong$I(EnglishStemmer.a_10, 18);
+ if (among_var === 0) {
+ return false;
+ }
+ this.ket = cursor$0 = this.cursor;
+ if (cursor$0 < this.limit) {
+ return false;
+ }
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ if (! this.slice_from$S("ski")) {
+ return false;
+ }
+ break;
+ case 2:
+ if (! this.slice_from$S("sky")) {
+ return false;
+ }
+ break;
+ case 3:
+ if (! this.slice_from$S("die")) {
+ return false;
+ }
+ break;
+ case 4:
+ if (! this.slice_from$S("lie")) {
+ return false;
+ }
+ break;
+ case 5:
+ if (! this.slice_from$S("tie")) {
+ return false;
+ }
+ break;
+ case 6:
+ if (! this.slice_from$S("idl")) {
+ return false;
+ }
+ break;
+ case 7:
+ if (! this.slice_from$S("gentl")) {
+ return false;
+ }
+ break;
+ case 8:
+ if (! this.slice_from$S("ugli")) {
+ return false;
+ }
+ break;
+ case 9:
+ if (! this.slice_from$S("earli")) {
+ return false;
+ }
+ break;
+ case 10:
+ if (! this.slice_from$S("onli")) {
+ return false;
+ }
+ break;
+ case 11:
+ if (! this.slice_from$S("singl")) {
+ return false;
+ }
+ break;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+EnglishStemmer.prototype.r_postlude$ = function () {
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!boolean} */
+ var lab3;
+ /** @type {!number} */
+ var cursor$0;
+ if (! this.B_Y_found) {
+ return false;
+ }
+replab0:
+ while (true) {
+ v_1 = this.cursor;
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ golab2:
+ while (true) {
+ v_2 = this.cursor;
+ lab3 = true;
+ lab3:
+ while (lab3 === true) {
+ lab3 = false;
+ this.bra = this.cursor;
+ if (! this.eq_s$IS(1, "Y")) {
+ break lab3;
+ }
+ this.ket = this.cursor;
+ this.cursor = v_2;
+ break golab2;
+ }
+ cursor$0 = this.cursor = v_2;
+ if (cursor$0 >= this.limit) {
+ break lab1;
+ }
+ this.cursor++;
+ }
+ if (! this.slice_from$S("y")) {
+ return false;
+ }
+ continue replab0;
+ }
+ this.cursor = v_1;
+ break replab0;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+EnglishStemmer.prototype.stem$ = function () {
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var v_3;
+ /** @type {!number} */
+ var v_4;
+ /** @type {!number} */
+ var v_5;
+ /** @type {!number} */
+ var v_6;
+ /** @type {!number} */
+ var v_7;
+ /** @type {!number} */
+ var v_8;
+ /** @type {!number} */
+ var v_9;
+ /** @type {!number} */
+ var v_10;
+ /** @type {!number} */
+ var v_11;
+ /** @type {!number} */
+ var v_12;
+ /** @type {!number} */
+ var v_13;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!boolean} */
+ var lab2;
+ /** @type {!boolean} */
+ var lab3;
+ /** @type {!number} */
+ var c;
+ /** @type {!boolean} */
+ var lab4;
+ /** @type {!boolean} */
+ var lab5;
+ /** @type {!boolean} */
+ var lab6;
+ /** @type {!boolean} */
+ var lab7;
+ /** @type {!boolean} */
+ var lab8;
+ /** @type {!boolean} */
+ var lab9;
+ /** @type {!boolean} */
+ var lab10;
+ /** @type {!boolean} */
+ var lab11;
+ /** @type {!boolean} */
+ var lab12;
+ /** @type {!boolean} */
+ var lab13;
+ /** @type {!boolean} */
+ var lab14;
+ /** @type {!boolean} */
+ var lab15;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var cursor$1;
+ /** @type {!number} */
+ var cursor$2;
+ /** @type {!number} */
+ var limit$0;
+ /** @type {!number} */
+ var cursor$3;
+ /** @type {!number} */
+ var limit$1;
+ /** @type {!number} */
+ var cursor$4;
+ /** @type {!number} */
+ var limit$2;
+ /** @type {!number} */
+ var cursor$5;
+ /** @type {!number} */
+ var limit$3;
+ /** @type {!number} */
+ var cursor$6;
+ /** @type {!number} */
+ var limit$4;
+ /** @type {!number} */
+ var cursor$7;
+ /** @type {!number} */
+ var limit$5;
+ /** @type {!number} */
+ var cursor$8;
+ /** @type {!number} */
+ var limit$6;
+ /** @type {!number} */
+ var cursor$9;
+ /** @type {!number} */
+ var cursor$10;
+ lab0 = true;
+lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ v_1 = this.cursor;
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ if (! this.r_exception1$()) {
+ break lab1;
+ }
+ break lab0;
+ }
+ this.cursor = v_1;
+ lab2 = true;
+ lab2:
+ while (lab2 === true) {
+ lab2 = false;
+ v_2 = this.cursor;
+ lab3 = true;
+ lab3:
+ while (lab3 === true) {
+ lab3 = false;
+ c = (this.cursor + 3 | 0);
+ if (0 > c || c > this.limit) {
+ break lab3;
+ }
+ this.cursor = c;
+ break lab2;
+ }
+ this.cursor = v_2;
+ break lab0;
+ }
+ cursor$0 = this.cursor = v_1;
+ v_3 = cursor$0;
+ lab4 = true;
+ lab4:
+ while (lab4 === true) {
+ lab4 = false;
+ if (! this.r_prelude$()) {
+ break lab4;
+ }
+ }
+ cursor$1 = this.cursor = v_3;
+ v_4 = cursor$1;
+ lab5 = true;
+ lab5:
+ while (lab5 === true) {
+ lab5 = false;
+ if (! this.r_mark_regions$()) {
+ break lab5;
+ }
+ }
+ cursor$2 = this.cursor = v_4;
+ this.limit_backward = cursor$2;
+ cursor$3 = this.cursor = limit$0 = this.limit;
+ v_5 = limit$0 - cursor$3;
+ lab6 = true;
+ lab6:
+ while (lab6 === true) {
+ lab6 = false;
+ if (! this.r_Step_1a$()) {
+ break lab6;
+ }
+ }
+ this.cursor = this.limit - v_5;
+ lab7 = true;
+ lab7:
+ while (lab7 === true) {
+ lab7 = false;
+ v_6 = this.limit - this.cursor;
+ lab8 = true;
+ lab8:
+ while (lab8 === true) {
+ lab8 = false;
+ if (! this.r_exception2$()) {
+ break lab8;
+ }
+ break lab7;
+ }
+ cursor$4 = this.cursor = (limit$1 = this.limit) - v_6;
+ v_7 = limit$1 - cursor$4;
+ lab9 = true;
+ lab9:
+ while (lab9 === true) {
+ lab9 = false;
+ if (! this.r_Step_1b$()) {
+ break lab9;
+ }
+ }
+ cursor$5 = this.cursor = (limit$2 = this.limit) - v_7;
+ v_8 = limit$2 - cursor$5;
+ lab10 = true;
+ lab10:
+ while (lab10 === true) {
+ lab10 = false;
+ if (! this.r_Step_1c$()) {
+ break lab10;
+ }
+ }
+ cursor$6 = this.cursor = (limit$3 = this.limit) - v_8;
+ v_9 = limit$3 - cursor$6;
+ lab11 = true;
+ lab11:
+ while (lab11 === true) {
+ lab11 = false;
+ if (! this.r_Step_2$()) {
+ break lab11;
+ }
+ }
+ cursor$7 = this.cursor = (limit$4 = this.limit) - v_9;
+ v_10 = limit$4 - cursor$7;
+ lab12 = true;
+ lab12:
+ while (lab12 === true) {
+ lab12 = false;
+ if (! this.r_Step_3$()) {
+ break lab12;
+ }
+ }
+ cursor$8 = this.cursor = (limit$5 = this.limit) - v_10;
+ v_11 = limit$5 - cursor$8;
+ lab13 = true;
+ lab13:
+ while (lab13 === true) {
+ lab13 = false;
+ if (! this.r_Step_4$()) {
+ break lab13;
+ }
+ }
+ cursor$9 = this.cursor = (limit$6 = this.limit) - v_11;
+ v_12 = limit$6 - cursor$9;
+ lab14 = true;
+ lab14:
+ while (lab14 === true) {
+ lab14 = false;
+ if (! this.r_Step_5$()) {
+ break lab14;
+ }
+ }
+ this.cursor = this.limit - v_12;
+ }
+ cursor$10 = this.cursor = this.limit_backward;
+ v_13 = cursor$10;
+ lab15 = true;
+ lab15:
+ while (lab15 === true) {
+ lab15 = false;
+ if (! this.r_postlude$()) {
+ break lab15;
+ }
+ }
+ this.cursor = v_13;
+ }
+ return true;
+};
+
+/**
+ * @param {*} o
+ * @return {!boolean}
+ */
+EnglishStemmer.prototype.equals$X = function (o) {
+ return o instanceof EnglishStemmer;
+};
+
+/**
+ * @return {!number}
+ */
+EnglishStemmer.prototype.hashCode$ = function () {
+ /** @type {!string} */
+ var classname;
+ /** @type {!number} */
+ var hash;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var char;
+ classname = "EnglishStemmer";
+ hash = 0;
+ if ("EnglishStemmer".length === 0) {
+ return (hash | 0);
+ }
+ for (i = 0; i < classname.length; i++) {
+ char = classname.charCodeAt(i);
+ hash = (hash << 5) - hash + char;
+ hash = hash & hash;
+ }
+ return (hash | 0);
+};
+
+/**
+ * class DutchStemmer extends BaseStemmer
+ * @constructor
+ */
+function DutchStemmer() {
+}
+
+DutchStemmer.prototype = new BaseStemmer;
+/**
+ * @constructor
+ */
+function DutchStemmer$() {
+ BaseStemmer$.call(this);
+ this.I_p2 = 0;
+ this.I_p1 = 0;
+ this.B_e_found = false;
+};
+
+DutchStemmer$.prototype = new DutchStemmer;
+
+/**
+ * @param {DutchStemmer} other
+ */
+DutchStemmer.prototype.copy_from$LDutchStemmer$ = function (other) {
+ this.I_p2 = other.I_p2;
+ this.I_p1 = other.I_p1;
+ this.B_e_found = other.B_e_found;
+ BaseStemmer.prototype.copy_from$LBaseStemmer$.call(this, other);
+};
+
+/**
+ * @return {!boolean}
+ */
+DutchStemmer.prototype.r_prelude$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var v_3;
+ /** @type {!number} */
+ var v_4;
+ /** @type {!number} */
+ var v_5;
+ /** @type {!number} */
+ var v_6;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!boolean} */
+ var lab2;
+ /** @type {!boolean} */
+ var lab4;
+ /** @type {!boolean} */
+ var lab6;
+ /** @type {!boolean} */
+ var lab7;
+ /** @type {!boolean} */
+ var lab8;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var cursor$1;
+ v_1 = this.cursor;
+replab0:
+ while (true) {
+ v_2 = this.cursor;
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ this.bra = this.cursor;
+ among_var = this.find_among$ALAmong$I(DutchStemmer.a_0, 11);
+ if (among_var === 0) {
+ break lab1;
+ }
+ this.ket = this.cursor;
+ switch (among_var) {
+ case 0:
+ break lab1;
+ case 1:
+ if (! this.slice_from$S("a")) {
+ return false;
+ }
+ break;
+ case 2:
+ if (! this.slice_from$S("e")) {
+ return false;
+ }
+ break;
+ case 3:
+ if (! this.slice_from$S("i")) {
+ return false;
+ }
+ break;
+ case 4:
+ if (! this.slice_from$S("o")) {
+ return false;
+ }
+ break;
+ case 5:
+ if (! this.slice_from$S("u")) {
+ return false;
+ }
+ break;
+ case 6:
+ if (this.cursor >= this.limit) {
+ break lab1;
+ }
+ this.cursor++;
+ break;
+ }
+ continue replab0;
+ }
+ this.cursor = v_2;
+ break replab0;
+ }
+ cursor$0 = this.cursor = v_1;
+ v_3 = cursor$0;
+ lab2 = true;
+lab2:
+ while (lab2 === true) {
+ lab2 = false;
+ this.bra = this.cursor;
+ if (! this.eq_s$IS(1, "y")) {
+ this.cursor = v_3;
+ break lab2;
+ }
+ this.ket = this.cursor;
+ if (! this.slice_from$S("Y")) {
+ return false;
+ }
+ }
+replab3:
+ while (true) {
+ v_4 = this.cursor;
+ lab4 = true;
+ lab4:
+ while (lab4 === true) {
+ lab4 = false;
+ golab5:
+ while (true) {
+ v_5 = this.cursor;
+ lab6 = true;
+ lab6:
+ while (lab6 === true) {
+ lab6 = false;
+ if (! this.in_grouping$AIII(DutchStemmer.g_v, 97, 232)) {
+ break lab6;
+ }
+ this.bra = this.cursor;
+ lab7 = true;
+ lab7:
+ while (lab7 === true) {
+ lab7 = false;
+ v_6 = this.cursor;
+ lab8 = true;
+ lab8:
+ while (lab8 === true) {
+ lab8 = false;
+ if (! this.eq_s$IS(1, "i")) {
+ break lab8;
+ }
+ this.ket = this.cursor;
+ if (! this.in_grouping$AIII(DutchStemmer.g_v, 97, 232)) {
+ break lab8;
+ }
+ if (! this.slice_from$S("I")) {
+ return false;
+ }
+ break lab7;
+ }
+ this.cursor = v_6;
+ if (! this.eq_s$IS(1, "y")) {
+ break lab6;
+ }
+ this.ket = this.cursor;
+ if (! this.slice_from$S("Y")) {
+ return false;
+ }
+ }
+ this.cursor = v_5;
+ break golab5;
+ }
+ cursor$1 = this.cursor = v_5;
+ if (cursor$1 >= this.limit) {
+ break lab4;
+ }
+ this.cursor++;
+ }
+ continue replab3;
+ }
+ this.cursor = v_4;
+ break replab3;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+DutchStemmer.prototype.r_mark_regions$ = function () {
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!boolean} */
+ var lab3;
+ /** @type {!boolean} */
+ var lab4;
+ /** @type {!boolean} */
+ var lab6;
+ /** @type {!boolean} */
+ var lab8;
+ /** @type {!number} */
+ var limit$0;
+ this.I_p1 = limit$0 = this.limit;
+ this.I_p2 = limit$0;
+golab0:
+ while (true) {
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ if (! this.in_grouping$AIII(DutchStemmer.g_v, 97, 232)) {
+ break lab1;
+ }
+ break golab0;
+ }
+ if (this.cursor >= this.limit) {
+ return false;
+ }
+ this.cursor++;
+ }
+golab2:
+ while (true) {
+ lab3 = true;
+ lab3:
+ while (lab3 === true) {
+ lab3 = false;
+ if (! this.out_grouping$AIII(DutchStemmer.g_v, 97, 232)) {
+ break lab3;
+ }
+ break golab2;
+ }
+ if (this.cursor >= this.limit) {
+ return false;
+ }
+ this.cursor++;
+ }
+ this.I_p1 = this.cursor;
+ lab4 = true;
+lab4:
+ while (lab4 === true) {
+ lab4 = false;
+ if (! (this.I_p1 < 3)) {
+ break lab4;
+ }
+ this.I_p1 = 3;
+ }
+golab5:
+ while (true) {
+ lab6 = true;
+ lab6:
+ while (lab6 === true) {
+ lab6 = false;
+ if (! this.in_grouping$AIII(DutchStemmer.g_v, 97, 232)) {
+ break lab6;
+ }
+ break golab5;
+ }
+ if (this.cursor >= this.limit) {
+ return false;
+ }
+ this.cursor++;
+ }
+golab7:
+ while (true) {
+ lab8 = true;
+ lab8:
+ while (lab8 === true) {
+ lab8 = false;
+ if (! this.out_grouping$AIII(DutchStemmer.g_v, 97, 232)) {
+ break lab8;
+ }
+ break golab7;
+ }
+ if (this.cursor >= this.limit) {
+ return false;
+ }
+ this.cursor++;
+ }
+ this.I_p2 = this.cursor;
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+DutchStemmer.prototype.r_postlude$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var v_1;
+ /** @type {!boolean} */
+ var lab1;
+replab0:
+ while (true) {
+ v_1 = this.cursor;
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ this.bra = this.cursor;
+ among_var = this.find_among$ALAmong$I(DutchStemmer.a_1, 3);
+ if (among_var === 0) {
+ break lab1;
+ }
+ this.ket = this.cursor;
+ switch (among_var) {
+ case 0:
+ break lab1;
+ case 1:
+ if (! this.slice_from$S("y")) {
+ return false;
+ }
+ break;
+ case 2:
+ if (! this.slice_from$S("i")) {
+ return false;
+ }
+ break;
+ case 3:
+ if (this.cursor >= this.limit) {
+ break lab1;
+ }
+ this.cursor++;
+ break;
+ }
+ continue replab0;
+ }
+ this.cursor = v_1;
+ break replab0;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+DutchStemmer.prototype.r_R1$ = function () {
+ return (! (this.I_p1 <= this.cursor) ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+DutchStemmer.prototype.r_R2$ = function () {
+ return (! (this.I_p2 <= this.cursor) ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+DutchStemmer.prototype.r_undouble$ = function () {
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var cursor$0;
+ v_1 = this.limit - this.cursor;
+ if (this.find_among_b$ALAmong$I(DutchStemmer.a_2, 3) === 0) {
+ return false;
+ }
+ cursor$0 = this.cursor = this.limit - v_1;
+ this.ket = cursor$0;
+ if (cursor$0 <= this.limit_backward) {
+ return false;
+ }
+ this.cursor--;
+ this.bra = this.cursor;
+ return (! this.slice_from$S("") ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+DutchStemmer.prototype.r_e_ending$ = function () {
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var cursor$0;
+ this.B_e_found = false;
+ this.ket = this.cursor;
+ if (! this.eq_s_b$IS(1, "e")) {
+ return false;
+ }
+ this.bra = cursor$0 = this.cursor;
+ if (! (! (this.I_p1 <= cursor$0) ? false : true)) {
+ return false;
+ }
+ v_1 = this.limit - this.cursor;
+ if (! this.out_grouping_b$AIII(DutchStemmer.g_v, 97, 232)) {
+ return false;
+ }
+ this.cursor = this.limit - v_1;
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ this.B_e_found = true;
+ return (! this.r_undouble$() ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+DutchStemmer.prototype.r_en_ending$ = function () {
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!number} */
+ var limit$0;
+ /** @type {!number} */
+ var cursor$0;
+ if (! (! (this.I_p1 <= this.cursor) ? false : true)) {
+ return false;
+ }
+ v_1 = this.limit - this.cursor;
+ if (! this.out_grouping_b$AIII(DutchStemmer.g_v, 97, 232)) {
+ return false;
+ }
+ cursor$0 = this.cursor = (limit$0 = this.limit) - v_1;
+ v_2 = limit$0 - cursor$0;
+ lab0 = true;
+lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ if (! this.eq_s_b$IS(3, "gem")) {
+ break lab0;
+ }
+ return false;
+ }
+ this.cursor = this.limit - v_2;
+ return (! this.slice_from$S("") ? false : ! this.r_undouble$() ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+DutchStemmer.prototype.r_standard_suffix$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var v_3;
+ /** @type {!number} */
+ var v_4;
+ /** @type {!number} */
+ var v_5;
+ /** @type {!number} */
+ var v_6;
+ /** @type {!number} */
+ var v_7;
+ /** @type {!number} */
+ var v_8;
+ /** @type {!number} */
+ var v_9;
+ /** @type {!number} */
+ var v_10;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!boolean} */
+ var lab2;
+ /** @type {!boolean} */
+ var lab3;
+ /** @type {!boolean} */
+ var lab4;
+ /** @type {!boolean} */
+ var lab5;
+ /** @type {!boolean} */
+ var lab6;
+ /** @type {!boolean} */
+ var lab7;
+ /** @type {!boolean} */
+ var lab8;
+ /** @type {!boolean} */
+ var lab9;
+ /** @type {!number} */
+ var limit$0;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var cursor$1;
+ /** @type {!number} */
+ var limit$1;
+ /** @type {!number} */
+ var cursor$2;
+ /** @type {!number} */
+ var cursor$3;
+ /** @type {!number} */
+ var limit$2;
+ /** @type {!number} */
+ var cursor$4;
+ /** @type {!number} */
+ var cursor$5;
+ /** @type {!number} */
+ var limit$3;
+ /** @type {!number} */
+ var cursor$6;
+ v_1 = this.limit - this.cursor;
+ lab0 = true;
+lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ this.ket = this.cursor;
+ among_var = this.find_among_b$ALAmong$I(DutchStemmer.a_3, 5);
+ if (among_var === 0) {
+ break lab0;
+ }
+ this.bra = this.cursor;
+ switch (among_var) {
+ case 0:
+ break lab0;
+ case 1:
+ if (! (! (this.I_p1 <= this.cursor) ? false : true)) {
+ break lab0;
+ }
+ if (! this.slice_from$S("heid")) {
+ return false;
+ }
+ break;
+ case 2:
+ if (! this.r_en_ending$()) {
+ break lab0;
+ }
+ break;
+ case 3:
+ if (! (! (this.I_p1 <= this.cursor) ? false : true)) {
+ break lab0;
+ }
+ if (! this.out_grouping_b$AIII(DutchStemmer.g_v_j, 97, 232)) {
+ break lab0;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ }
+ }
+ cursor$0 = this.cursor = (limit$0 = this.limit) - v_1;
+ v_2 = limit$0 - cursor$0;
+ lab1 = true;
+lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ if (! this.r_e_ending$()) {
+ break lab1;
+ }
+ }
+ cursor$2 = this.cursor = (limit$1 = this.limit) - v_2;
+ v_3 = limit$1 - cursor$2;
+ lab2 = true;
+lab2:
+ while (lab2 === true) {
+ lab2 = false;
+ this.ket = this.cursor;
+ if (! this.eq_s_b$IS(4, "heid")) {
+ break lab2;
+ }
+ this.bra = cursor$1 = this.cursor;
+ if (! (! (this.I_p2 <= cursor$1) ? false : true)) {
+ break lab2;
+ }
+ v_4 = this.limit - this.cursor;
+ lab3 = true;
+ lab3:
+ while (lab3 === true) {
+ lab3 = false;
+ if (! this.eq_s_b$IS(1, "c")) {
+ break lab3;
+ }
+ break lab2;
+ }
+ this.cursor = this.limit - v_4;
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ this.ket = this.cursor;
+ if (! this.eq_s_b$IS(2, "en")) {
+ break lab2;
+ }
+ this.bra = this.cursor;
+ if (! this.r_en_ending$()) {
+ break lab2;
+ }
+ }
+ cursor$4 = this.cursor = (limit$2 = this.limit) - v_3;
+ v_5 = limit$2 - cursor$4;
+ lab4 = true;
+lab4:
+ while (lab4 === true) {
+ lab4 = false;
+ this.ket = this.cursor;
+ among_var = this.find_among_b$ALAmong$I(DutchStemmer.a_4, 6);
+ if (among_var === 0) {
+ break lab4;
+ }
+ this.bra = this.cursor;
+ switch (among_var) {
+ case 0:
+ break lab4;
+ case 1:
+ if (! (! (this.I_p2 <= this.cursor) ? false : true)) {
+ break lab4;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ lab5 = true;
+ lab5:
+ while (lab5 === true) {
+ lab5 = false;
+ v_6 = this.limit - this.cursor;
+ lab6 = true;
+ lab6:
+ while (lab6 === true) {
+ lab6 = false;
+ this.ket = this.cursor;
+ if (! this.eq_s_b$IS(2, "ig")) {
+ break lab6;
+ }
+ this.bra = cursor$3 = this.cursor;
+ if (! (! (this.I_p2 <= cursor$3) ? false : true)) {
+ break lab6;
+ }
+ v_7 = this.limit - this.cursor;
+ lab7 = true;
+ lab7:
+ while (lab7 === true) {
+ lab7 = false;
+ if (! this.eq_s_b$IS(1, "e")) {
+ break lab7;
+ }
+ break lab6;
+ }
+ this.cursor = this.limit - v_7;
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break lab5;
+ }
+ this.cursor = this.limit - v_6;
+ if (! this.r_undouble$()) {
+ break lab4;
+ }
+ }
+ break;
+ case 2:
+ if (! (! (this.I_p2 <= this.cursor) ? false : true)) {
+ break lab4;
+ }
+ v_8 = this.limit - this.cursor;
+ lab8 = true;
+ lab8:
+ while (lab8 === true) {
+ lab8 = false;
+ if (! this.eq_s_b$IS(1, "e")) {
+ break lab8;
+ }
+ break lab4;
+ }
+ this.cursor = this.limit - v_8;
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 3:
+ if (! (! (this.I_p2 <= this.cursor) ? false : true)) {
+ break lab4;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ if (! this.r_e_ending$()) {
+ break lab4;
+ }
+ break;
+ case 4:
+ if (! (! (this.I_p2 <= this.cursor) ? false : true)) {
+ break lab4;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 5:
+ if (! (! (this.I_p2 <= this.cursor) ? false : true)) {
+ break lab4;
+ }
+ if (! this.B_e_found) {
+ break lab4;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ }
+ }
+ cursor$6 = this.cursor = (limit$3 = this.limit) - v_5;
+ v_9 = limit$3 - cursor$6;
+ lab9 = true;
+lab9:
+ while (lab9 === true) {
+ lab9 = false;
+ if (! this.out_grouping_b$AIII(DutchStemmer.g_v_I, 73, 232)) {
+ break lab9;
+ }
+ v_10 = this.limit - this.cursor;
+ if (this.find_among_b$ALAmong$I(DutchStemmer.a_5, 4) === 0) {
+ break lab9;
+ }
+ if (! this.out_grouping_b$AIII(DutchStemmer.g_v, 97, 232)) {
+ break lab9;
+ }
+ cursor$5 = this.cursor = this.limit - v_10;
+ this.ket = cursor$5;
+ if (cursor$5 <= this.limit_backward) {
+ break lab9;
+ }
+ this.cursor--;
+ this.bra = this.cursor;
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ }
+ this.cursor = this.limit - v_9;
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+DutchStemmer.prototype.stem$ = function () {
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var v_4;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!boolean} */
+ var lab2;
+ /** @type {!boolean} */
+ var lab3;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var cursor$1;
+ /** @type {!number} */
+ var cursor$2;
+ v_1 = this.cursor;
+ lab0 = true;
+lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ if (! this.r_prelude$()) {
+ break lab0;
+ }
+ }
+ cursor$0 = this.cursor = v_1;
+ v_2 = cursor$0;
+ lab1 = true;
+lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ if (! this.r_mark_regions$()) {
+ break lab1;
+ }
+ }
+ cursor$1 = this.cursor = v_2;
+ this.limit_backward = cursor$1;
+ this.cursor = this.limit;
+ lab2 = true;
+lab2:
+ while (lab2 === true) {
+ lab2 = false;
+ if (! this.r_standard_suffix$()) {
+ break lab2;
+ }
+ }
+ cursor$2 = this.cursor = this.limit_backward;
+ v_4 = cursor$2;
+ lab3 = true;
+lab3:
+ while (lab3 === true) {
+ lab3 = false;
+ if (! this.r_postlude$()) {
+ break lab3;
+ }
+ }
+ this.cursor = v_4;
+ return true;
+};
+
+/**
+ * @param {*} o
+ * @return {!boolean}
+ */
+DutchStemmer.prototype.equals$X = function (o) {
+ return o instanceof DutchStemmer;
+};
+
+/**
+ * @return {!number}
+ */
+DutchStemmer.prototype.hashCode$ = function () {
+ /** @type {!string} */
+ var classname;
+ /** @type {!number} */
+ var hash;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var char;
+ classname = "DutchStemmer";
+ hash = 0;
+ if ("DutchStemmer".length === 0) {
+ return (hash | 0);
+ }
+ for (i = 0; i < classname.length; i++) {
+ char = classname.charCodeAt(i);
+ hash = (hash << 5) - hash + char;
+ hash = hash & hash;
+ }
+ return (hash | 0);
+};
+
+/**
+ * class DanishStemmer extends BaseStemmer
+ * @constructor
+ */
+function DanishStemmer() {
+}
+
+DanishStemmer.prototype = new BaseStemmer;
+/**
+ * @constructor
+ */
+function DanishStemmer$() {
+ BaseStemmer$.call(this);
+ this.I_x = 0;
+ this.I_p1 = 0;
+ this.S_ch = "";
+};
+
+DanishStemmer$.prototype = new DanishStemmer;
+
+/**
+ * @param {DanishStemmer} other
+ */
+DanishStemmer.prototype.copy_from$LDanishStemmer$ = function (other) {
+ this.I_x = other.I_x;
+ this.I_p1 = other.I_p1;
+ this.S_ch = other.S_ch;
+ BaseStemmer.prototype.copy_from$LBaseStemmer$.call(this, other);
+};
+
+/**
+ * @return {!boolean}
+ */
+DanishStemmer.prototype.r_mark_regions$ = function () {
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var c;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!boolean} */
+ var lab3;
+ /** @type {!boolean} */
+ var lab4;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var limit$0;
+ /** @type {!number} */
+ var cursor$1;
+ /** @type {!number} */
+ var cursor$2;
+ this.I_p1 = limit$0 = this.limit;
+ v_1 = cursor$0 = this.cursor;
+ c = (cursor$0 + 3 | 0);
+ if (0 > c || c > limit$0) {
+ return false;
+ }
+ cursor$2 = this.cursor = c;
+ this.I_x = cursor$2;
+ this.cursor = v_1;
+golab0:
+ while (true) {
+ v_2 = this.cursor;
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ if (! this.in_grouping$AIII(DanishStemmer.g_v, 97, 248)) {
+ break lab1;
+ }
+ this.cursor = v_2;
+ break golab0;
+ }
+ cursor$1 = this.cursor = v_2;
+ if (cursor$1 >= this.limit) {
+ return false;
+ }
+ this.cursor++;
+ }
+golab2:
+ while (true) {
+ lab3 = true;
+ lab3:
+ while (lab3 === true) {
+ lab3 = false;
+ if (! this.out_grouping$AIII(DanishStemmer.g_v, 97, 248)) {
+ break lab3;
+ }
+ break golab2;
+ }
+ if (this.cursor >= this.limit) {
+ return false;
+ }
+ this.cursor++;
+ }
+ this.I_p1 = this.cursor;
+ lab4 = true;
+lab4:
+ while (lab4 === true) {
+ lab4 = false;
+ if (! (this.I_p1 < this.I_x)) {
+ break lab4;
+ }
+ this.I_p1 = this.I_x;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+DanishStemmer.prototype.r_main_suffix$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var cursor$1;
+ /** @type {!number} */
+ var cursor$2;
+ v_1 = this.limit - (cursor$0 = this.cursor);
+ if (cursor$0 < this.I_p1) {
+ return false;
+ }
+ cursor$1 = this.cursor = this.I_p1;
+ v_2 = this.limit_backward;
+ this.limit_backward = cursor$1;
+ cursor$2 = this.cursor = this.limit - v_1;
+ this.ket = cursor$2;
+ among_var = this.find_among_b$ALAmong$I(DanishStemmer.a_0, 32);
+ if (among_var === 0) {
+ this.limit_backward = v_2;
+ return false;
+ }
+ this.bra = this.cursor;
+ this.limit_backward = v_2;
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 2:
+ if (! this.in_grouping_b$AIII(DanishStemmer.g_s_ending, 97, 229)) {
+ return false;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+DanishStemmer.prototype.r_consonant_pair$ = function () {
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var v_3;
+ /** @type {!number} */
+ var limit$0;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var cursor$1;
+ /** @type {!number} */
+ var cursor$2;
+ /** @type {!number} */
+ var cursor$3;
+ /** @type {!number} */
+ var limit_backward$0;
+ v_1 = (limit$0 = this.limit) - (cursor$0 = this.cursor);
+ v_2 = limit$0 - cursor$0;
+ if (cursor$0 < this.I_p1) {
+ return false;
+ }
+ cursor$1 = this.cursor = this.I_p1;
+ v_3 = this.limit_backward;
+ this.limit_backward = cursor$1;
+ cursor$2 = this.cursor = this.limit - v_2;
+ this.ket = cursor$2;
+ if (this.find_among_b$ALAmong$I(DanishStemmer.a_1, 4) === 0) {
+ this.limit_backward = v_3;
+ return false;
+ }
+ this.bra = this.cursor;
+ limit_backward$0 = this.limit_backward = v_3;
+ cursor$3 = this.cursor = this.limit - v_1;
+ if (cursor$3 <= limit_backward$0) {
+ return false;
+ }
+ this.cursor--;
+ this.bra = this.cursor;
+ return (! this.slice_from$S("") ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+DanishStemmer.prototype.r_other_suffix$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var v_3;
+ /** @type {!number} */
+ var v_4;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!number} */
+ var limit$0;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var cursor$1;
+ /** @type {!number} */
+ var cursor$2;
+ v_1 = this.limit - this.cursor;
+ lab0 = true;
+lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ this.ket = this.cursor;
+ if (! this.eq_s_b$IS(2, "st")) {
+ break lab0;
+ }
+ this.bra = this.cursor;
+ if (! this.eq_s_b$IS(2, "ig")) {
+ break lab0;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ }
+ cursor$0 = this.cursor = (limit$0 = this.limit) - v_1;
+ v_2 = limit$0 - cursor$0;
+ if (cursor$0 < this.I_p1) {
+ return false;
+ }
+ cursor$1 = this.cursor = this.I_p1;
+ v_3 = this.limit_backward;
+ this.limit_backward = cursor$1;
+ cursor$2 = this.cursor = this.limit - v_2;
+ this.ket = cursor$2;
+ among_var = this.find_among_b$ALAmong$I(DanishStemmer.a_2, 5);
+ if (among_var === 0) {
+ this.limit_backward = v_3;
+ return false;
+ }
+ this.bra = this.cursor;
+ this.limit_backward = v_3;
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ v_4 = this.limit - this.cursor;
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ if (! this.r_consonant_pair$()) {
+ break lab1;
+ }
+ }
+ this.cursor = this.limit - v_4;
+ break;
+ case 2:
+ if (! this.slice_from$S("l\u00F8s")) {
+ return false;
+ }
+ break;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+DanishStemmer.prototype.r_undouble$ = function () {
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var cursor$1;
+ /** @type {!number} */
+ var cursor$2;
+ /** @type {!string} */
+ var S_ch$0;
+ v_1 = this.limit - (cursor$0 = this.cursor);
+ if (cursor$0 < this.I_p1) {
+ return false;
+ }
+ cursor$1 = this.cursor = this.I_p1;
+ v_2 = this.limit_backward;
+ this.limit_backward = cursor$1;
+ cursor$2 = this.cursor = this.limit - v_1;
+ this.ket = cursor$2;
+ if (! this.out_grouping_b$AIII(DanishStemmer.g_v, 97, 248)) {
+ this.limit_backward = v_2;
+ return false;
+ }
+ this.bra = this.cursor;
+ S_ch$0 = this.S_ch = this.slice_to$S(this.S_ch);
+ if (S_ch$0 === '') {
+ return false;
+ }
+ this.limit_backward = v_2;
+ return (! this.eq_v_b$S(this.S_ch) ? false : ! this.slice_from$S("") ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+DanishStemmer.prototype.stem$ = function () {
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var v_3;
+ /** @type {!number} */
+ var v_4;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!boolean} */
+ var lab2;
+ /** @type {!boolean} */
+ var lab3;
+ /** @type {!boolean} */
+ var lab4;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var limit$0;
+ /** @type {!number} */
+ var cursor$1;
+ /** @type {!number} */
+ var limit$1;
+ /** @type {!number} */
+ var cursor$2;
+ /** @type {!number} */
+ var limit$2;
+ /** @type {!number} */
+ var cursor$3;
+ v_1 = this.cursor;
+ lab0 = true;
+lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ if (! this.r_mark_regions$()) {
+ break lab0;
+ }
+ }
+ cursor$0 = this.cursor = v_1;
+ this.limit_backward = cursor$0;
+ cursor$1 = this.cursor = limit$0 = this.limit;
+ v_2 = limit$0 - cursor$1;
+ lab1 = true;
+lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ if (! this.r_main_suffix$()) {
+ break lab1;
+ }
+ }
+ cursor$2 = this.cursor = (limit$1 = this.limit) - v_2;
+ v_3 = limit$1 - cursor$2;
+ lab2 = true;
+lab2:
+ while (lab2 === true) {
+ lab2 = false;
+ if (! this.r_consonant_pair$()) {
+ break lab2;
+ }
+ }
+ cursor$3 = this.cursor = (limit$2 = this.limit) - v_3;
+ v_4 = limit$2 - cursor$3;
+ lab3 = true;
+lab3:
+ while (lab3 === true) {
+ lab3 = false;
+ if (! this.r_other_suffix$()) {
+ break lab3;
+ }
+ }
+ this.cursor = this.limit - v_4;
+ lab4 = true;
+lab4:
+ while (lab4 === true) {
+ lab4 = false;
+ if (! this.r_undouble$()) {
+ break lab4;
+ }
+ }
+ this.cursor = this.limit_backward;
+ return true;
+};
+
+/**
+ * @param {*} o
+ * @return {!boolean}
+ */
+DanishStemmer.prototype.equals$X = function (o) {
+ return o instanceof DanishStemmer;
+};
+
+/**
+ * @return {!number}
+ */
+DanishStemmer.prototype.hashCode$ = function () {
+ /** @type {!string} */
+ var classname;
+ /** @type {!number} */
+ var hash;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var char;
+ classname = "DanishStemmer";
+ hash = 0;
+ if ("DanishStemmer".length === 0) {
+ return (hash | 0);
+ }
+ for (i = 0; i < classname.length; i++) {
+ char = classname.charCodeAt(i);
+ hash = (hash << 5) - hash + char;
+ hash = hash & hash;
+ }
+ return (hash | 0);
+};
+
+/**
+ * class Among extends Object
+ * @constructor
+ */
+function Among() {
+}
+
+/**
+ * @constructor
+ * @param {!string} s
+ * @param {!number} substring_i
+ * @param {!number} result
+ */
+function Among$SII(s, substring_i, result) {
+ this.s_size = s.length;
+ this.s = s;
+ this.substring_i = substring_i;
+ this.result = result;
+ this.method = null;
+ this.instance = null;
+};
+
+Among$SII.prototype = new Among;
+
+/**
+ * @constructor
+ * @param {!string} s
+ * @param {!number} substring_i
+ * @param {!number} result
+ * @param {*} method
+ * @param {BaseStemmer} instance
+ */
+function Among$SIIF$LBaseStemmer$B$LBaseStemmer$(s, substring_i, result, method, instance) {
+ this.s_size = s.length;
+ this.s = s;
+ this.substring_i = substring_i;
+ this.result = result;
+ this.method = method;
+ this.instance = instance;
+};
+
+Among$SIIF$LBaseStemmer$B$LBaseStemmer$.prototype = new Among;
+
+/**
+ * class BitVector extends Object
+ * @constructor
+ */
+function BitVector() {
+}
+
+/**
+ * @constructor
+ */
+function BitVector$() {
+ /** @type {Array.<undefined|!number>} */
+ var _v$0;
+ /** @type {Array.<undefined|!number>} */
+ var _r$0;
+ _r$0 = this._r = [ ];
+ _v$0 = this._v = [ ];
+ _v$0.length = 0;
+ _r$0.length = 0;
+ this._size = 0;
+ this._size1 = 0;
+};
+
+BitVector$.prototype = new BitVector;
+
+/**
+ */
+BitVector.prototype.build$ = function () {
+ /** @type {!number} */
+ var i;
+ this._size1 = 0;
+ for (i = 0; i < this._v.length; i++) {
+ if (i % 8 === 0) {
+ this._r.push(true ? this._size1 : this._size - this._size1);
+ }
+ this._size1 += this._rank32$IIB(this._v[i], 32, true);
+ }
+};
+
+/**
+ */
+BitVector.prototype.clear$ = function () {
+ this._v.length = 0;
+ this._r.length = 0;
+ this._size = 0;
+ this._size1 = 0;
+};
+
+/**
+ * @return {!number}
+ */
+BitVector.prototype.size$ = function () {
+ return this._size;
+};
+
+/**
+ * @param {!boolean} b
+ * @return {!number}
+ */
+BitVector.prototype.size$B = function (b) {
+ return (b ? this._size1 : this._size - this._size1);
+};
+
+/**
+ * @param {!number} value
+ */
+BitVector.prototype.set$I = function (value) {
+ this.set$IB(value, true);
+};
+
+/**
+ * @param {!number} value
+ * @param {!boolean} flag
+ */
+BitVector.prototype.set$IB = function (value, flag) {
+ /** @type {!number} */
+ var q;
+ /** @type {!number} */
+ var r;
+ /** @type {!number} */
+ var m;
+ if (value >= this._size) {
+ this._size = (value + 1 | 0);
+ }
+ q = (value / 32 | 0);
+ r = (value % 32 | 0);
+ while (q >= this._v.length) {
+ this._v.push(0);
+ }
+ m = 0x1 << r;
+ if (flag) {
+ this._v[q] |= m;
+ } else {
+ this._v[q] &= ~ m;
+ }
+};
+
+/**
+ * @param {!number} value
+ * @return {!boolean}
+ */
+BitVector.prototype.get$I = function (value) {
+ /** @type {!number} */
+ var q;
+ /** @type {!number} */
+ var r;
+ /** @type {!number} */
+ var m;
+ if (value >= this._size) {
+ throw new Error("BitVector.get() : range error");
+ }
+ q = (value / 32 | 0);
+ r = (value % 32 | 0);
+ m = 0x1 << r;
+ return !! (this._v[q] & m);
+};
+
+/**
+ * @param {!number} i
+ * @return {!number}
+ */
+BitVector.prototype.rank$I = function (i) {
+ return this.rank$IB(i, true);
+};
+
+/**
+ * @param {!number} i
+ * @param {!boolean} b
+ * @return {!number}
+ */
+BitVector.prototype.rank$IB = function (i, b) {
+ /** @type {!number} */
+ var q_large;
+ /** @type {!number} */
+ var q_small;
+ /** @type {!number} */
+ var r;
+ /** @type {!number} */
+ var rank;
+ /** @type {!number} */
+ var begin;
+ /** @type {!number} */
+ var j;
+ if (i > this._size) {
+ throw new Error("BitVector.rank() : range error");
+ }
+ if (i === 0) {
+ return 0;
+ }
+ i--;
+ q_large = (Math.floor(i / 256) | 0);
+ q_small = (Math.floor(i / 32) | 0);
+ r = (Math.floor(i % 32) | 0);
+ rank = (this._r[q_large] | 0);
+ if (! b) {
+ rank = q_large * 256 - rank;
+ }
+ begin = q_large * 8;
+ for (j = begin; j < q_small; j++) {
+ rank += this._rank32$IIB(this._v[j], 32, b);
+ }
+ rank += this._rank32$IIB(this._v[q_small], r + 1, b);
+ return rank;
+};
+
+/**
+ * @param {!number} i
+ * @return {!number}
+ */
+BitVector.prototype.select$I = function (i) {
+ return this.select$IB(i, true);
+};
+
+/**
+ * @param {!number} i
+ * @param {!boolean} b
+ * @return {!number}
+ */
+BitVector.prototype.select$IB = function (i, b) {
+ /** @type {!number} */
+ var left;
+ /** @type {!number} */
+ var right;
+ /** @type {!number} */
+ var pivot;
+ /** @type {undefined|!number} */
+ var rank;
+ /** @type {!number} */
+ var j;
+ if (i >= (b ? this._size1 : this._size - this._size1)) {
+ throw new Error("BitVector.select() : range error");
+ }
+ left = 0;
+ right = this._r.length;
+ while (left < right) {
+ pivot = Math.floor((left + right) / 2);
+ rank = this._r[pivot];
+ if (! b) {
+ rank = pivot * 256 - rank;
+ }
+ if (i < rank) {
+ right = pivot;
+ } else {
+ left = pivot + 1;
+ }
+ }
+ right--;
+ if (b) {
+ i -= (this._r[right] | 0);
+ } else {
+ i -= (right * 256 - this._r[right] | 0);
+ }
+ j = right * 8;
+ while (1) {
+ rank = this._rank32$IIB(this._v[j], 32, b);
+ if (i < rank) {
+ break;
+ }
+ j++;
+ i -= (rank | 0);
+ }
+ return (j * 32 + this._select32$IIB(this._v[j], i, b) | 0);
+};
+
+/**
+ * @param {!number} x
+ * @param {!number} i
+ * @param {!boolean} b
+ * @return {!number}
+ */
+BitVector.prototype._rank32$IIB = function (x, i, b) {
+ if (! b) {
+ x = ~ x;
+ }
+ x <<= 32 - i;
+ x = ((x & 0xaaaaaaaa) >>> 1) + (x & 0x55555555);
+ x = ((x & 0xcccccccc) >>> 2) + (x & 0x33333333);
+ x = ((x & 0xf0f0f0f0) >>> 4) + (x & 0x0f0f0f0f);
+ x = ((x & 0xff00ff00) >>> 8) + (x & 0x00ff00ff);
+ x = ((x & 0xffff0000) >>> 16) + (x & 0x0000ffff);
+ return x;
+};
+
+/**
+ * @param {!number} x
+ * @param {!number} i
+ * @param {!boolean} b
+ * @return {!number}
+ */
+BitVector.prototype._select32$IIB = function (x, i, b) {
+ /** @type {!number} */
+ var x1;
+ /** @type {!number} */
+ var x2;
+ /** @type {!number} */
+ var x3;
+ /** @type {!number} */
+ var x4;
+ /** @type {!number} */
+ var x5;
+ /** @type {!number} */
+ var pos;
+ /** @type {!number} */
+ var v5;
+ /** @type {!number} */
+ var v4;
+ /** @type {!number} */
+ var v3;
+ /** @type {!number} */
+ var v2;
+ /** @type {!number} */
+ var v1;
+ /** @type {!number} */
+ var v0;
+ if (! b) {
+ x = ~ x;
+ }
+ x1 = ((x & 0xaaaaaaaa) >>> 1) + (x & 0x55555555);
+ x2 = ((x1 & 0xcccccccc) >>> 2) + (x1 & 0x33333333);
+ x3 = ((x2 & 0xf0f0f0f0) >>> 4) + (x2 & 0x0f0f0f0f);
+ x4 = ((x3 & 0xff00ff00) >>> 8) + (x3 & 0x00ff00ff);
+ x5 = ((x4 & 0xffff0000) >>> 16) + (x4 & 0x0000ffff);
+ i++;
+ pos = 0;
+ v5 = x5 & 0xffffffff;
+ if (i > v5) {
+ i -= (v5 | 0);
+ pos += 32;
+ }
+ v4 = x4 >>> pos & 0x0000ffff;
+ if (i > v4) {
+ i -= (v4 | 0);
+ pos += 16;
+ }
+ v3 = x3 >>> pos & 0x000000ff;
+ if (i > v3) {
+ i -= (v3 | 0);
+ pos += 8;
+ }
+ v2 = x2 >>> pos & 0x0000000f;
+ if (i > v2) {
+ i -= (v2 | 0);
+ pos += 4;
+ }
+ v1 = x1 >>> pos & 0x00000003;
+ if (i > v1) {
+ i -= (v1 | 0);
+ pos += 2;
+ }
+ v0 = x >>> pos & 0x00000001;
+ if (i > v0) {
+ i -= (v0 | 0);
+ pos += 1;
+ }
+ return (pos | 0);
+};
+
+/**
+ * @return {!string}
+ */
+BitVector.prototype.dump$ = function () {
+ /** @type {Array.<undefined|!string>} */
+ var contents;
+ contents = [ ];
+ contents.push(Binary$dump32bitNumber$N(this._size));
+ contents.push(Binary$dump32bitNumberList$AN(this._v));
+ return contents.join('');
+};
+
+/**
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+BitVector.prototype.dump$LCompressionReport$ = function (report) {
+ /** @type {Array.<undefined|!string>} */
+ var contents;
+ contents = [ ];
+ contents.push(Binary$dump32bitNumber$N(this._size));
+ CompressionReport$add$LCompressionReport$II(report, 2, 2);
+ contents.push(Binary$dump32bitNumberList$ANLCompressionReport$(this._v, report));
+ return contents.join('');
+};
+
+/**
+ * @param {!string} data
+ * @return {!number}
+ */
+BitVector.prototype.load$S = function (data) {
+ return this.load$SI(data, 0);
+};
+
+/**
+ * @param {!string} data
+ * @param {!number} offset
+ * @return {!number}
+ */
+BitVector.prototype.load$SI = function (data, offset) {
+ /** @type {LoadedNumberListResult} */
+ var result;
+ /** @type {!number} */
+ var result$0;
+ this._v.length = 0;
+ this._r.length = 0;
+ this._size = 0;
+ this._size1 = 0;
+ result$0 = data.charCodeAt(offset) * 65536 + data.charCodeAt(offset + 1);
+ this._size = (result$0 | 0);
+ result = Binary$load32bitNumberList$SI(data, offset + 2);
+ this._v = result.result;
+ this.build$();
+ return result.offset;
+};
+
+/**
+ * class WaveletMatrix extends Object
+ * @constructor
+ */
+function WaveletMatrix() {
+}
+
+/**
+ * @constructor
+ */
+function WaveletMatrix$() {
+ /** @type {Array.<undefined|BitVector>} */
+ var _bv$0;
+ /** @type {Array.<undefined|!number>} */
+ var _seps$0;
+ this._range = ({ });
+ _bv$0 = this._bv = [ ];
+ _seps$0 = this._seps = [ ];
+ this._bitsize = 16;
+ _bv$0.length = 0;
+ _seps$0.length = 0;
+ this._size = 0;
+};
+
+WaveletMatrix$.prototype = new WaveletMatrix;
+
+/**
+ * @return {!number}
+ */
+WaveletMatrix.prototype.bitsize$ = function () {
+ return this._bitsize;
+};
+
+/**
+ * @param {!number} charCode
+ */
+WaveletMatrix.prototype.setMaxCharCode$I = function (charCode) {
+ this._bitsize = (Math.ceil(Math.log(charCode) / 0.6931471805599453) | 0);
+};
+
+/**
+ */
+WaveletMatrix.prototype.clear$ = function () {
+ this._bv.length = 0;
+ this._seps.length = 0;
+ this._size = 0;
+};
+
+/**
+ * @param {!string} v
+ */
+WaveletMatrix.prototype.build$S = function (v) {
+ /** @type {!number} */
+ var size;
+ /** @type {!number} */
+ var bitsize;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var depth;
+ /** @type {Object.<string, undefined|!number>} */
+ var range_tmp;
+ /** @type {!number} */
+ var code;
+ /** @type {!boolean} */
+ var bit;
+ /** @type {!number} */
+ var key;
+ /** @type {Object.<string, undefined|!number>} */
+ var range_rev;
+ /** @type {!string} */
+ var range_key;
+ /** @type {!number} */
+ var value;
+ /** @type {!number} */
+ var pos0;
+ /** @type {undefined|!number} */
+ var pos1;
+ /** @type {!string} */
+ var range_rev_key;
+ /** @type {!number} */
+ var begin;
+ /** @type {undefined|!number} */
+ var end;
+ /** @type {!number} */
+ var num0;
+ /** @type {!number} */
+ var num1;
+ this._bv.length = 0;
+ this._seps.length = 0;
+ this._size = 0;
+ size = v.length;
+ bitsize = this._bitsize;
+ for (i = 0; i < bitsize; i++) {
+ this._bv.push(new BitVector$());
+ this._seps.push(0);
+ }
+ this._size = (size | 0);
+ for (i = 0; i < size; i++) {
+ this._bv[0].set$IB(i, this._uint2bit$II(v.charCodeAt(i), 0));
+ }
+ this._bv[0].build$();
+ this._seps[0] = this._bv[0].size$B(false);
+ this._range["0"] = 0;
+ this._range["1"] = this._seps[0];
+ depth = 1;
+ while (depth < bitsize) {
+ range_tmp = WaveletMatrix$_shallow_copy$HI(this._range);
+ for (i = 0; i < size; i++) {
+ code = v.charCodeAt(i);
+ bit = this._uint2bit$II(code, depth);
+ key = code >>> bitsize - depth;
+ this._bv[depth].set$IB(range_tmp[key + ""], bit);
+ range_tmp[key + ""]++;
+ }
+ this._bv[depth].build$();
+ this._seps[depth] = this._bv[depth].size$B(false);
+ range_rev = ({ });
+ for (range_key in this._range) {
+ value = this._range[range_key];
+ if (value != range_tmp[range_key]) {
+ range_rev[value + ""] = range_key | 0;
+ }
+ }
+ this._range = ({ });
+ pos0 = 0;
+ pos1 = this._seps[depth];
+ for (range_rev_key in range_rev) {
+ begin = range_rev_key | 0;
+ value = range_rev[range_rev_key];
+ end = range_tmp[value + ""];
+ num0 = this._bv[depth].rank$IB(end, false) - this._bv[depth].rank$IB(begin, false);
+ num1 = end - begin - num0;
+ if (num0 > 0) {
+ this._range[(value << 1) + ""] = (pos0 | 0);
+ pos0 += num0;
+ }
+ if (num1 > 0) {
+ this._range[(value << 1) + 1 + ""] = pos1;
+ pos1 += (num1 | 0);
+ }
+ }
+ depth++;
+ }
+};
+
+/**
+ * @return {!number}
+ */
+WaveletMatrix.prototype.size$ = function () {
+ return this._size;
+};
+
+/**
+ * @param {!number} c
+ * @return {!number}
+ */
+WaveletMatrix.prototype.size$I = function (c) {
+ return this.rank$II(this._size, c);
+};
+
+/**
+ * @param {!number} i
+ * @return {!number}
+ */
+WaveletMatrix.prototype.get$I = function (i) {
+ /** @type {!number} */
+ var value;
+ /** @type {!number} */
+ var depth;
+ /** @type {!boolean} */
+ var bit;
+ if (i >= this._size) {
+ throw new Error("WaveletMatrix.get() : range error");
+ }
+ value = 0;
+ depth = 0;
+ while (depth < this._bitsize) {
+ bit = this._bv[depth].get$I(i);
+ i = this._bv[depth].rank$IB(i, bit);
+ value <<= 1;
+ if (bit) {
+ i += this._seps[depth];
+ value += 1;
+ }
+ depth++;
+ }
+ return (value | 0);
+};
+
+/**
+ * @param {!number} i
+ * @param {!number} c
+ * @return {!number}
+ */
+WaveletMatrix.prototype.rank$II = function (i, c) {
+ /** @type {undefined|!number} */
+ var begin;
+ /** @type {!number} */
+ var end;
+ /** @type {!number} */
+ var depth;
+ /** @type {!boolean} */
+ var bit;
+ if (i > this._size) {
+ throw new Error("WaveletMatrix.rank(): range error");
+ }
+ if (i === 0) {
+ return 0;
+ }
+ begin = this._range[c + ""];
+ if (begin == null) {
+ return 0;
+ }
+ end = i;
+ depth = 0;
+ while (depth < this._bitsize) {
+ bit = this._uint2bit$II(c, depth);
+ end = this._bv[depth].rank$IB(end, bit);
+ if (bit) {
+ end += this._seps[depth];
+ }
+ depth++;
+ }
+ return (end - begin | 0);
+};
+
+/**
+ * @param {!number} i
+ * @param {!number} c
+ * @return {!number}
+ */
+WaveletMatrix.prototype.rank_less_than$II = function (i, c) {
+ /** @type {!number} */
+ var begin;
+ /** @type {!number} */
+ var end;
+ /** @type {!number} */
+ var depth;
+ /** @type {!number} */
+ var rlt;
+ /** @type {!number} */
+ var rank0_begin;
+ /** @type {!number} */
+ var rank0_end;
+ /** @type {Array.<undefined|!number>} */
+ var _seps$0;
+ if (i > this._size) {
+ throw new Error("WaveletMatrix.rank_less_than(): range error");
+ }
+ if (i === 0) {
+ return 0;
+ }
+ begin = 0;
+ end = i;
+ depth = 0;
+ rlt = 0;
+ while (depth < this._bitsize) {
+ rank0_begin = this._bv[depth].rank$IB(begin, false);
+ rank0_end = this._bv[depth].rank$IB(end, false);
+ if (this._uint2bit$II(c, depth)) {
+ rlt += rank0_end - rank0_begin;
+ begin += (_seps$0 = this._seps)[depth] - rank0_begin;
+ end += _seps$0[depth] - rank0_end;
+ } else {
+ begin = rank0_begin;
+ end = rank0_end;
+ }
+ depth++;
+ }
+ return (rlt | 0);
+};
+
+/**
+ * @return {!string}
+ */
+WaveletMatrix.prototype.dump$ = function () {
+ /** @type {Array.<undefined|!string>} */
+ var contents;
+ /** @type {!number} */
+ var i;
+ /** @type {Array.<undefined|!string>} */
+ var range_contents;
+ /** @type {!number} */
+ var counter;
+ /** @type {!string} */
+ var key;
+ contents = [ Binary$dump16bitNumber$I(this._bitsize), Binary$dump32bitNumber$N(this._size) ];
+ for (i = 0; i < this._bitsize; i++) {
+ contents.push(this._bv[i].dump$());
+ }
+ for (i = 0; i < this._bitsize; i++) {
+ contents.push(Binary$dump32bitNumber$N(this._seps[i]));
+ }
+ range_contents = [ ];
+ counter = 0;
+ for (key in this._range) {
+ range_contents.push(Binary$dump32bitNumber$N(key | 0));
+ range_contents.push(Binary$dump32bitNumber$N(this._range[key]));
+ counter++;
+ }
+ contents.push(Binary$dump32bitNumber$N(counter));
+ return contents.join('') + range_contents.join('');
+};
+
+/**
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+WaveletMatrix.prototype.dump$LCompressionReport$ = function (report) {
+ /** @type {Array.<undefined|!string>} */
+ var contents;
+ /** @type {!number} */
+ var i;
+ /** @type {Array.<undefined|!string>} */
+ var range_contents;
+ /** @type {!number} */
+ var counter;
+ /** @type {!string} */
+ var key;
+ contents = [ Binary$dump16bitNumber$I(this._bitsize), Binary$dump32bitNumber$N(this._size) ];
+ CompressionReport$add$LCompressionReport$II(report, 3, 3);
+ for (i = 0; i < this._bitsize; i++) {
+ contents.push(this._bv[i].dump$LCompressionReport$(report));
+ }
+ for (i = 0; i < this._bitsize; i++) {
+ contents.push(Binary$dump32bitNumber$N(this._seps[i]));
+ CompressionReport$add$LCompressionReport$II(report, 2, 2);
+ }
+ range_contents = [ ];
+ counter = 0;
+ for (key in this._range) {
+ range_contents.push(Binary$dump32bitNumber$N(key | 0));
+ range_contents.push(Binary$dump32bitNumber$N(this._range[key]));
+ CompressionReport$add$LCompressionReport$II(report, 4, 4);
+ counter++;
+ }
+ CompressionReport$add$LCompressionReport$II(report, 2, 2);
+ contents.push(Binary$dump32bitNumber$N(counter));
+ return contents.join('') + range_contents.join('');
+};
+
+/**
+ * @param {!string} data
+ * @return {!number}
+ */
+WaveletMatrix.prototype.load$S = function (data) {
+ return this.load$SI(data, 0);
+};
+
+/**
+ * @param {!string} data
+ * @param {!number} offset
+ * @return {!number}
+ */
+WaveletMatrix.prototype.load$SI = function (data, offset) {
+ /** @type {!number} */
+ var i;
+ /** @type {BitVector} */
+ var bit_vector;
+ /** @type {!number} */
+ var range_size;
+ /** @type {!number} */
+ var value;
+ /** @type {!number} */
+ var offset$0;
+ /** @type {!number} */
+ var result$0;
+ /** @type {!number} */
+ var result$1;
+ /** @type {!number} */
+ var result$2;
+ this._bv.length = 0;
+ this._seps.length = 0;
+ this._size = 0;
+ offset$0 = offset++;
+ this._bitsize = (data.charCodeAt(offset$0) | 0);
+ result$0 = data.charCodeAt(offset) * 65536 + data.charCodeAt(offset + 1);
+ this._size = (result$0 | 0);
+ offset += 2;
+ for (i = 0; i < this._bitsize; i++) {
+ bit_vector = new BitVector$();
+ offset = bit_vector.load$SI(data, offset);
+ this._bv.push(bit_vector);
+ }
+ for (i = 0; i < this._bitsize; (i++, offset += 2)) {
+ this._seps.push(Binary$load32bitNumber$SI(data, offset));
+ }
+ result$1 = data.charCodeAt(offset) * 65536 + data.charCodeAt(offset + 1);
+ range_size = result$1;
+ offset += 2;
+ for (i = 0; i < range_size; (i++, offset += 4)) {
+ result$2 = data.charCodeAt(offset) * 65536 + data.charCodeAt(offset + 1);
+ value = Binary$load32bitNumber$SI(data, offset + 2);
+ this._range[result$2 + ""] = (value | 0);
+ }
+ return offset;
+};
+
+/**
+ * @param {Object.<string, undefined|!number>} input
+ * @return {Object.<string, undefined|!number>}
+ */
+WaveletMatrix._shallow_copy$HI = function (input) {
+ /** @type {Object.<string, undefined|!number>} */
+ var result;
+ /** @type {!string} */
+ var key;
+ result = ({ });
+ for (key in input) {
+ result[key] = input[key];
+ }
+ return result;
+};
+
+var WaveletMatrix$_shallow_copy$HI = WaveletMatrix._shallow_copy$HI;
+
+/**
+ * @param {!number} c
+ * @param {!number} i
+ * @return {!boolean}
+ */
+WaveletMatrix.prototype._uint2bit$II = function (c, i) {
+ return (c >>> this._bitsize - 1 - i & 0x1) === 0x1;
+};
+
+/**
+ * class BurrowsWheelerTransform extends Object
+ * @constructor
+ */
+function BurrowsWheelerTransform() {
+}
+
+/**
+ * @constructor
+ */
+function BurrowsWheelerTransform$() {
+ this._str = "";
+ this._size = 0;
+ this._head = 0;
+ this._suffixarray = [ ];
+};
+
+BurrowsWheelerTransform$.prototype = new BurrowsWheelerTransform;
+
+/**
+ * @param {BurrowsWheelerTransform} $this
+ * @return {!number}
+ */
+BurrowsWheelerTransform.size$LBurrowsWheelerTransform$ = function ($this) {
+ return $this._size;
+};
+
+var BurrowsWheelerTransform$size$LBurrowsWheelerTransform$ = BurrowsWheelerTransform.size$LBurrowsWheelerTransform$;
+
+/**
+ * @param {BurrowsWheelerTransform} $this
+ * @return {!number}
+ */
+BurrowsWheelerTransform.head$LBurrowsWheelerTransform$ = function ($this) {
+ return $this._head;
+};
+
+var BurrowsWheelerTransform$head$LBurrowsWheelerTransform$ = BurrowsWheelerTransform.head$LBurrowsWheelerTransform$;
+
+/**
+ * @param {BurrowsWheelerTransform} $this
+ */
+BurrowsWheelerTransform.clear$LBurrowsWheelerTransform$ = function ($this) {
+ $this._str = "";
+ $this._size = 0;
+ $this._head = 0;
+ $this._suffixarray.length = 0;
+};
+
+var BurrowsWheelerTransform$clear$LBurrowsWheelerTransform$ = BurrowsWheelerTransform.clear$LBurrowsWheelerTransform$;
+
+/**
+ * @param {BurrowsWheelerTransform} $this
+ * @param {!string} str
+ */
+BurrowsWheelerTransform.build$LBurrowsWheelerTransform$S = function ($this, str) {
+ /** @type {!string} */
+ var _str$0;
+ /** @type {Array.<undefined|!number>} */
+ var _suffixarray$0;
+ _str$0 = $this._str = str;
+ $this._size = _str$0.length;
+ _suffixarray$0 = $this._suffixarray = SAIS$make$S(str);
+ $this._head = (_suffixarray$0.indexOf(0) | 0);
+};
+
+var BurrowsWheelerTransform$build$LBurrowsWheelerTransform$S = BurrowsWheelerTransform.build$LBurrowsWheelerTransform$S;
+
+/**
+ * @param {BurrowsWheelerTransform} $this
+ * @param {!number} i
+ * @return {!string}
+ */
+BurrowsWheelerTransform.get$LBurrowsWheelerTransform$I = function ($this, i) {
+ /** @type {!number} */
+ var size;
+ /** @type {!number} */
+ var index;
+ size = $this._size;
+ if (i >= size) {
+ throw new Error("BurrowsWheelerTransform.get() : range error");
+ }
+ index = ($this._suffixarray[i] + size - 1) % size;
+ return $this._str.charAt(index);
+};
+
+var BurrowsWheelerTransform$get$LBurrowsWheelerTransform$I = BurrowsWheelerTransform.get$LBurrowsWheelerTransform$I;
+
+/**
+ * @param {BurrowsWheelerTransform} $this
+ * @return {!string}
+ */
+BurrowsWheelerTransform.get$LBurrowsWheelerTransform$ = function ($this) {
+ /** @type {Array.<undefined|!string>} */
+ var str;
+ /** @type {!number} */
+ var size;
+ /** @type {!number} */
+ var i;
+ str = [ ];
+ size = $this._size;
+ for (i = 0; i < size; i++) {
+ str.push(BurrowsWheelerTransform$get$LBurrowsWheelerTransform$I($this, i));
+ }
+ return str.join("");
+};
+
+var BurrowsWheelerTransform$get$LBurrowsWheelerTransform$ = BurrowsWheelerTransform.get$LBurrowsWheelerTransform$;
+
+/**
+ * @param {BurrowsWheelerTransform} $this
+ * @param {!string} replace
+ * @return {!string}
+ */
+BurrowsWheelerTransform.get$LBurrowsWheelerTransform$S = function ($this, replace) {
+ /** @type {!string} */
+ var result;
+ result = BurrowsWheelerTransform$get$LBurrowsWheelerTransform$($this);
+ return result.replace(BurrowsWheelerTransform.END_MARKER, replace);
+};
+
+var BurrowsWheelerTransform$get$LBurrowsWheelerTransform$S = BurrowsWheelerTransform.get$LBurrowsWheelerTransform$S;
+
+/**
+ * class OArray extends Object
+ * @constructor
+ */
+function OArray() {
+}
+
+/**
+ * @constructor
+ * @param {Array.<undefined|!number>} array
+ */
+function OArray$AI(array) {
+ this.array = array;
+ this.offset = 0;
+};
+
+OArray$AI.prototype = new OArray;
+
+/**
+ * @constructor
+ * @param {Array.<undefined|!number>} array
+ * @param {!number} offset
+ */
+function OArray$AII(array, offset) {
+ this.array = array;
+ this.offset = offset;
+};
+
+OArray$AII.prototype = new OArray;
+
+/**
+ * @param {OArray} $this
+ * @param {!number} index
+ * @return {!number}
+ */
+OArray.get$LOArray$I = function ($this, index) {
+ return $this.array[index + $this.offset];
+};
+
+var OArray$get$LOArray$I = OArray.get$LOArray$I;
+
+/**
+ * @param {OArray} $this
+ * @param {!number} index
+ * @param {!number} value
+ */
+OArray.set$LOArray$II = function ($this, index, value) {
+ $this.array[index + $this.offset] = value;
+};
+
+var OArray$set$LOArray$II = OArray.set$LOArray$II;
+
+/**
+ * @param {OArray} $this
+ * @param {!number} index
+ * @return {!boolean}
+ */
+OArray.isS$LOArray$I = function ($this, index) {
+ /** @type {Array.<undefined|!number>} */
+ var array$0;
+ /** @type {!number} */
+ var offset$0;
+ return (array$0 = $this.array)[index + (offset$0 = $this.offset)] < array$0[index + offset$0 + 1];
+};
+
+var OArray$isS$LOArray$I = OArray.isS$LOArray$I;
+
+/**
+ * @param {OArray} $this
+ * @param {!number} index1
+ * @param {!number} index2
+ * @return {!boolean}
+ */
+OArray.compare$LOArray$II = function ($this, index1, index2) {
+ /** @type {Array.<undefined|!number>} */
+ var array$0;
+ /** @type {!number} */
+ var offset$0;
+ return (array$0 = $this.array)[index1 + (offset$0 = $this.offset)] == array$0[index2 + offset$0];
+};
+
+var OArray$compare$LOArray$II = OArray.compare$LOArray$II;
+
+/**
+ * class SAIS extends Object
+ * @constructor
+ */
+function SAIS() {
+}
+
+/**
+ * @constructor
+ */
+function SAIS$() {
+};
+
+SAIS$.prototype = new SAIS;
+
+/**
+ * @param {BitVector} t
+ * @param {!number} i
+ * @return {!boolean}
+ */
+SAIS._isLMS$LBitVector$I = function (t, i) {
+ return i > 0 && t.get$I(i) && ! t.get$I(i - 1);
+};
+
+var SAIS$_isLMS$LBitVector$I = SAIS._isLMS$LBitVector$I;
+
+/**
+ * @param {OArray} s
+ * @param {Array.<undefined|!number>} bkt
+ * @param {!number} n
+ * @param {!number} K
+ * @param {!boolean} end
+ */
+SAIS._getBuckets$LOArray$AIIIB = function (s, bkt, n, K, end) {
+ /** @type {!number} */
+ var sum;
+ /** @type {!number} */
+ var i;
+ sum = 0;
+ for (i = 0; i <= K; i++) {
+ bkt[i] = 0;
+ }
+ for (i = 0; i < n; i++) {
+ bkt[OArray$get$LOArray$I(s, i)]++;
+ }
+ for (i = 0; i <= K; i++) {
+ sum += bkt[i];
+ bkt[i] = ((end ? sum : sum - bkt[i]) | 0);
+ }
+};
+
+var SAIS$_getBuckets$LOArray$AIIIB = SAIS._getBuckets$LOArray$AIIIB;
+
+/**
+ * @param {BitVector} t
+ * @param {Array.<undefined|!number>} SA
+ * @param {OArray} s
+ * @param {Array.<undefined|!number>} bkt
+ * @param {!number} n
+ * @param {!number} K
+ * @param {!boolean} end
+ */
+SAIS._induceSAl$LBitVector$AILOArray$AIIIB = function (t, SA, s, bkt, n, K, end) {
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var j;
+ SAIS$_getBuckets$LOArray$AIIIB(s, bkt, n, K, end);
+ for (i = 0; i < n; i++) {
+ j = SA[i] - 1;
+ if (j >= 0 && ! t.get$I(j)) {
+ SA[bkt[OArray$get$LOArray$I(s, j)]++] = (j | 0);
+ }
+ }
+};
+
+var SAIS$_induceSAl$LBitVector$AILOArray$AIIIB = SAIS._induceSAl$LBitVector$AILOArray$AIIIB;
+
+/**
+ * @param {BitVector} t
+ * @param {Array.<undefined|!number>} SA
+ * @param {OArray} s
+ * @param {Array.<undefined|!number>} bkt
+ * @param {!number} n
+ * @param {!number} K
+ * @param {!boolean} end
+ */
+SAIS._induceSAs$LBitVector$AILOArray$AIIIB = function (t, SA, s, bkt, n, K, end) {
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var j;
+ SAIS$_getBuckets$LOArray$AIIIB(s, bkt, n, K, end);
+ for (i = n - 1; i >= 0; i--) {
+ j = SA[i] - 1;
+ if (j >= 0 && t.get$I(j)) {
+ SA[-- bkt[OArray$get$LOArray$I(s, j)]] = (j | 0);
+ }
+ }
+};
+
+var SAIS$_induceSAs$LBitVector$AILOArray$AIIIB = SAIS._induceSAs$LBitVector$AILOArray$AIIIB;
+
+/**
+ * @param {!string} source
+ * @return {Array.<undefined|!number>}
+ */
+SAIS.make$S = function (source) {
+ /** @type {Array.<undefined|!number>} */
+ var charCodes;
+ /** @type {!number} */
+ var maxCode;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var code;
+ /** @type {Array.<undefined|!number>} */
+ var SA;
+ /** @type {OArray} */
+ var s;
+ charCodes = [ ];
+ charCodes.length = source.length;
+ maxCode = 0;
+ for (i = 0; i < source.length; i++) {
+ code = source.charCodeAt(i);
+ charCodes[i] = (code | 0);
+ maxCode = (code > maxCode ? code : maxCode);
+ }
+ SA = [ ];
+ SA.length = source.length;
+ s = ({offset: 0, array: charCodes});
+ SAIS$_make$LOArray$AIII(s, SA, source.length, maxCode);
+ return SA;
+};
+
+var SAIS$make$S = SAIS.make$S;
+
+/**
+ * @param {OArray} s
+ * @param {Array.<undefined|!number>} SA
+ * @param {!number} n
+ * @param {!number} K
+ */
+SAIS._make$LOArray$AIII = function (s, SA, n, K) {
+ /** @type {BitVector} */
+ var t;
+ /** @type {!number} */
+ var i;
+ /** @type {Array.<undefined|!number>} */
+ var bkt;
+ /** @type {!number} */
+ var n1;
+ /** @type {!number} */
+ var name;
+ /** @type {!number} */
+ var prev;
+ /** @type {undefined|!number} */
+ var pos;
+ /** @type {!boolean} */
+ var diff;
+ /** @type {!number} */
+ var d;
+ /** @type {!number} */
+ var j;
+ /** @type {Array.<undefined|!number>} */
+ var SA1;
+ /** @type {OArray} */
+ var s1;
+ /** @type {!number} */
+ var i$0;
+ /** @type {!number} */
+ var index$0;
+ t = new BitVector$();
+ t.set$IB(n - 2, false);
+ t.set$IB(n - 1, true);
+ for (i = n - 3; i >= 0; i--) {
+ t.set$IB(i, OArray$isS$LOArray$I(s, i) || OArray$compare$LOArray$II(s, i, i + 1) && t.get$I(i + 1));
+ }
+ bkt = [ ];
+ bkt.length = K + 1;
+ SAIS$_getBuckets$LOArray$AIIIB(s, bkt, n, K, true);
+ for (i = 0; i < n; i++) {
+ SA[i] = -1;
+ }
+ for (i = 1; i < n; i++) {
+ if (SAIS$_isLMS$LBitVector$I(t, i)) {
+ SA[-- bkt[OArray$get$LOArray$I(s, i)]] = (i | 0);
+ }
+ }
+ SAIS$_induceSAl$LBitVector$AILOArray$AIIIB(t, SA, s, bkt, n, K, false);
+ SAIS$_induceSAs$LBitVector$AILOArray$AIIIB(t, SA, s, bkt, n, K, true);
+ n1 = 0;
+ for (i = 0; i < n; i++) {
+ i$0 = SA[i];
+ if (i$0 > 0 && t.get$I(i$0) && ! t.get$I(i$0 - 1)) {
+ SA[n1++] = SA[i];
+ }
+ }
+ for (i = n1; i < n; i++) {
+ SA[i] = -1;
+ }
+ name = 0;
+ prev = -1;
+ for (i = 0; i < n1; i++) {
+ pos = SA[i];
+ diff = false;
+ for (d = 0; d < n; d++) {
+ if (prev === -1 || ! OArray$compare$LOArray$II(s, pos + d, prev + d) || t.get$I(pos + d) !== t.get$I(prev + d)) {
+ diff = true;
+ break;
+ } else {
+ if (d > 0 && (SAIS$_isLMS$LBitVector$I(t, pos + d) || SAIS$_isLMS$LBitVector$I(t, prev + d))) {
+ break;
+ }
+ }
+ }
+ if (diff) {
+ name++;
+ prev = pos;
+ }
+ pos = ((pos % 2 === 0 ? pos / 2 : (pos - 1) / 2) | 0);
+ SA[n1 + pos] = (name - 1 | 0);
+ }
+ for ((i = n - 1, j = n - 1); i >= n1; i--) {
+ if (SA[i] >= 0) {
+ SA[j--] = SA[i];
+ }
+ }
+ SA1 = SA;
+ s1 = ({offset: n - n1, array: SA});
+ if (name < n1) {
+ SAIS$_make$LOArray$AIII(s1, SA1, n1, name - 1);
+ } else {
+ for (i = 0; i < n1; i++) {
+ SA1[OArray$get$LOArray$I(s1, i)] = (i | 0);
+ }
+ }
+ bkt = [ ];
+ bkt.length = K + 1;
+ SAIS$_getBuckets$LOArray$AIIIB(s, bkt, n, K, true);
+ for ((i = 1, j = 0); i < n; i++) {
+ if (SAIS$_isLMS$LBitVector$I(t, i)) {
+ OArray$set$LOArray$II(s1, j++, i);
+ }
+ }
+ for (i = 0; i < n1; i++) {
+ index$0 = SA1[i];
+ SA1[i] = s1.array[index$0 + s1.offset];
+ }
+ for (i = n1; i < n; i++) {
+ SA[i] = -1;
+ }
+ for (i = n1 - 1; i >= 0; i--) {
+ j = SA[i];
+ SA[i] = -1;
+ SA[-- bkt[OArray$get$LOArray$I(s, j)]] = (j | 0);
+ }
+ SAIS$_induceSAl$LBitVector$AILOArray$AIIIB(t, SA, s, bkt, n, K, false);
+ SAIS$_induceSAs$LBitVector$AILOArray$AIIIB(t, SA, s, bkt, n, K, true);
+};
+
+var SAIS$_make$LOArray$AIII = SAIS._make$LOArray$AIII;
+
+$__jsx_lazy_init(node, "__dirname", function () {
+ return eval("__dirname") + "";
+});
+$__jsx_lazy_init(node, "__filename", function () {
+ return eval("__filename") + "";
+});
+$__jsx_lazy_init(node, "fs", function () {
+ return node$require$S('fs');
+});
+$__jsx_lazy_init(node, "path", function () {
+ return node$require$S('path');
+});
+$__jsx_lazy_init(node, "child_process", function () {
+ return node$require$S('child_process');
+});
+$__jsx_lazy_init(node, "url", function () {
+ return node$require$S('url');
+});
+$__jsx_lazy_init(node, "http", function () {
+ return node$require$S('http');
+});
+$__jsx_lazy_init(node, "https", function () {
+ return node$require$S('https');
+});
+$__jsx_lazy_init(node, "net", function () {
+ return node$require$S('net');
+});
+$__jsx_lazy_init(Oktavia, "eof", function () {
+ return String.fromCharCode(0);
+});
+$__jsx_lazy_init(Oktavia, "eob", function () {
+ return String.fromCharCode(1);
+});
+$__jsx_lazy_init(Oktavia, "unknown", function () {
+ return String.fromCharCode(3);
+});
+Binary._base64EncodeChars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
+$__jsx_lazy_init(Binary, "_base64DecodeChars", function () {
+ return [ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 62, -1, -1, -1, 63, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, -1, -1, -1, -1, -1, -1, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -1, -1, -1, -1, -1, -1, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, -1, -1, -1, -1 ];
+});
+js.global = (function () { return this; })();
+$__jsx_lazy_init(_Common, "buffers", function () {
+ return [ "comment", "sgmlDecl", "textNode", "tagName", "doctype", "procInstName", "procInstBody", "entity", "attribName", "attribValue", "cdata", "script" ];
+});
+$__jsx_lazy_init(_Common, "EVENTS", function () {
+ return [ "text", "processinginstruction", "sgmldeclaration", "doctype", "comment", "attribute", "opentag", "closetag", "opencdata", "cdata", "clo_State.CDATA", "error", "end", "ready", "script", "opennamespace", "closenamespace" ];
+});
+_Common.MAX_BUFFER_LENGTH = 65536;
+_State.BEGIN = 1;
+_State.TEXT = 2;
+_State.TEXT_ENTITY = 3;
+_State.OPEN_WAKA = 4;
+_State.SGML_DECL = 5;
+_State.SGML_DECL_QUOTED = 6;
+_State.DOCTYPE = 7;
+_State.DOCTYPE_QUOTED = 8;
+_State.DOCTYPE_DTD = 9;
+_State.DOCTYPE_DTD_QUOTED = 10;
+_State.COMMENT_STARTING = 11;
+_State.COMMENT = 12;
+_State.COMMENT_ENDING = 13;
+_State.COMMENT_ENDED = 14;
+_State.CDATA = 15;
+_State.CDATA_ENDING = 16;
+_State.CDATA_ENDING_2 = 17;
+_State.PROC_INST = 18;
+_State.PROC_INST_BODY = 19;
+_State.PROC_INST_ENDING = 20;
+_State.OPEN_TAG = 21;
+_State.OPEN_TAG_SLASH = 22;
+_State.ATTRIB = 23;
+_State.ATTRIB_NAME = 24;
+_State.ATTRIB_NAME_SAW_WHITE = 25;
+_State.ATTRIB_VALUE = 26;
+_State.ATTRIB_VALUE_QUOTED = 27;
+_State.ATTRIB_VALUE_UNQUOTED = 28;
+_State.ATTRIB_VALUE_ENTITY_Q = 29;
+_State.ATTRIB_VALUE_ENTITY_U = 30;
+_State.CLOSE_TAG = 31;
+_State.CLOSE_TAG_SAW_WHITE = 32;
+_State.SCRIPT = 33;
+_State.SCRIPT_ENDING = 34;
+$__jsx_lazy_init(_Entities, "_entities", function () {
+ return ({ "amp": "&", "gt": ">", "lt": "<", "quot": "\"", "apos": "'", "AElig": 198, "Aacute": 193, "Acirc": 194, "Agrave": 192, "Aring": 197, "Atilde": 195, "Auml": 196, "Ccedil": 199, "ETH": 208, "Eacute": 201, "Ecirc": 202, "Egrave": 200, "Euml": 203, "Iacute": 205, "Icirc": 206, "Igrave": 204, "Iuml": 207, "Ntilde": 209, "Oacute": 211, "Ocirc": 212, "Ograve": 210, "Oslash": 216, "Otilde": 213, "Ouml": 214, "THORN": 222, "Uacute": 218, "Ucirc": 219, "Ugrave": 217, "Uuml": 220, "Yacute": 221, "aacute": 225, "acirc": 226, "aelig": 230, "agrave": 224, "aring": 229, "atilde": 227, "auml": 228, "ccedil": 231, "eacute": 233, "ecirc": 234, "egrave": 232, "eth": 240, "euml": 235, "iacute": 237, "icirc": 238, "igrave": 236, "iuml": 239, "ntilde": 241, "oacute": 243, "ocirc": 244, "ograve": 242, "oslash": 248, "otilde": 245, "ouml": 246, "szlig": 223, "thorn": 254, "uacute": 250, "ucirc": 251, "ugrave": 249, "uuml": 252, "yacute": 253, "yuml": 255, "copy": 169, "reg": 174, "nbsp": 160, "iexcl": 161, "cent": 162, "pound": 163, "curren": 164, "yen": 165, "brvbar": 166, "sect": 167, "uml": 168, "ordf": 170, "laquo": 171, "not": 172, "shy": 173, "macr": 175, "deg": 176, "plusmn": 177, "sup1": 185, "sup2": 178, "sup3": 179, "acute": 180, "micro": 181, "para": 182, "middot": 183, "cedil": 184, "ordm": 186, "raquo": 187, "frac14": 188, "frac12": 189, "frac34": 190, "iquest": 191, "times": 215, "divide": 247, "OElig": 338, "oelig": 339, "Scaron": 352, "scaron": 353, "Yuml": 376, "fnof": 402, "circ": 710, "tilde": 732, "Alpha": 913, "Beta": 914, "Gamma": 915, "Delta": 916, "Epsilon": 917, "Zeta": 918, "Eta": 919, "Theta": 920, "Iota": 921, "Kappa": 922, "Lambda": 923, "Mu": 924, "Nu": 925, "Xi": 926, "Omicron": 927, "Pi": 928, "Rho": 929, "Sigma": 931, "Tau": 932, "Upsilon": 933, "Phi": 934, "Chi": 935, "Psi": 936, "Omega": 937, "alpha": 945, "beta": 946, "gamma": 947, "delta": 948, "epsilon": 949, "zeta": 950, "eta": 951, "theta": 952, "iota": 953, "kappa": 954, "lambda": 955, "mu": 956, "nu": 957, "xi": 958, "omicron": 959, "pi": 960, "rho": 961, "sigmaf": 962, "sigma": 963, "tau": 964, "upsilon": 965, "phi": 966, "chi": 967, "psi": 968, "omega": 969, "thetasym": 977, "upsih": 978, "piv": 982, "ensp": 8194, "emsp": 8195, "thinsp": 8201, "zwnj": 8204, "zwj": 8205, "lrm": 8206, "rlm": 8207, "ndash": 8211, "mdash": 8212, "lsquo": 8216, "rsquo": 8217, "sbquo": 8218, "ldquo": 8220, "rdquo": 8221, "bdquo": 8222, "dagger": 8224, "Dagger": 8225, "bull": 8226, "hellip": 8230, "permil": 8240, "prime": 8242, "Prime": 8243, "lsaquo": 8249, "rsaquo": 8250, "oline": 8254, "frasl": 8260, "euro": 8364, "image": 8465, "weierp": 8472, "real": 8476, "trade": 8482, "alefsym": 8501, "larr": 8592, "uarr": 8593, "rarr": 8594, "darr": 8595, "harr": 8596, "crarr": 8629, "lArr": 8656, "uArr": 8657, "rArr": 8658, "dArr": 8659, "hArr": 8660, "forall": 8704, "part": 8706, "exist": 8707, "empty": 8709, "nabla": 8711, "isin": 8712, "notin": 8713, "ni": 8715, "prod": 8719, "sum": 8721, "minus": 8722, "lowast": 8727, "radic": 8730, "prop": 8733, "infin": 8734, "ang": 8736, "and": 8743, "or": 8744, "cap": 8745, "cup": 8746, "int": 8747, "there4": 8756, "sim": 8764, "cong": 8773, "asymp": 8776, "ne": 8800, "equiv": 8801, "le": 8804, "ge": 8805, "sub": 8834, "sup": 8835, "nsub": 8836, "sube": 8838, "supe": 8839, "oplus": 8853, "otimes": 8855, "perp": 8869, "sdot": 8901, "lceil": 8968, "rceil": 8969, "lfloor": 8970, "rfloor": 8971, "lang": 9001, "rang": 9002, "loz": 9674, "spades": 9824, "clubs": 9827, "hearts": 9829, "diams": 9830 });
+});
+TurkishStemmer.serialVersionUID = 1;
+$__jsx_lazy_init(TurkishStemmer, "methodObject", function () {
+ return new TurkishStemmer$();
+});
+$__jsx_lazy_init(TurkishStemmer, "a_0", function () {
+ return [ new Among$SII("m", -1, -1), new Among$SII("n", -1, -1), new Among$SII("miz", -1, -1), new Among$SII("niz", -1, -1), new Among$SII("muz", -1, -1), new Among$SII("nuz", -1, -1), new Among$SII("m\u00FCz", -1, -1), new Among$SII("n\u00FCz", -1, -1), new Among$SII("m\u0131z", -1, -1), new Among$SII("n\u0131z", -1, -1) ];
+});
+$__jsx_lazy_init(TurkishStemmer, "a_1", function () {
+ return [ new Among$SII("leri", -1, -1), new Among$SII("lar\u0131", -1, -1) ];
+});
+$__jsx_lazy_init(TurkishStemmer, "a_2", function () {
+ return [ new Among$SII("ni", -1, -1), new Among$SII("nu", -1, -1), new Among$SII("n\u00FC", -1, -1), new Among$SII("n\u0131", -1, -1) ];
+});
+$__jsx_lazy_init(TurkishStemmer, "a_3", function () {
+ return [ new Among$SII("in", -1, -1), new Among$SII("un", -1, -1), new Among$SII("\u00FCn", -1, -1), new Among$SII("\u0131n", -1, -1) ];
+});
+$__jsx_lazy_init(TurkishStemmer, "a_4", function () {
+ return [ new Among$SII("a", -1, -1), new Among$SII("e", -1, -1) ];
+});
+$__jsx_lazy_init(TurkishStemmer, "a_5", function () {
+ return [ new Among$SII("na", -1, -1), new Among$SII("ne", -1, -1) ];
+});
+$__jsx_lazy_init(TurkishStemmer, "a_6", function () {
+ return [ new Among$SII("da", -1, -1), new Among$SII("ta", -1, -1), new Among$SII("de", -1, -1), new Among$SII("te", -1, -1) ];
+});
+$__jsx_lazy_init(TurkishStemmer, "a_7", function () {
+ return [ new Among$SII("nda", -1, -1), new Among$SII("nde", -1, -1) ];
+});
+$__jsx_lazy_init(TurkishStemmer, "a_8", function () {
+ return [ new Among$SII("dan", -1, -1), new Among$SII("tan", -1, -1), new Among$SII("den", -1, -1), new Among$SII("ten", -1, -1) ];
+});
+$__jsx_lazy_init(TurkishStemmer, "a_9", function () {
+ return [ new Among$SII("ndan", -1, -1), new Among$SII("nden", -1, -1) ];
+});
+$__jsx_lazy_init(TurkishStemmer, "a_10", function () {
+ return [ new Among$SII("la", -1, -1), new Among$SII("le", -1, -1) ];
+});
+$__jsx_lazy_init(TurkishStemmer, "a_11", function () {
+ return [ new Among$SII("ca", -1, -1), new Among$SII("ce", -1, -1) ];
+});
+$__jsx_lazy_init(TurkishStemmer, "a_12", function () {
+ return [ new Among$SII("im", -1, -1), new Among$SII("um", -1, -1), new Among$SII("\u00FCm", -1, -1), new Among$SII("\u0131m", -1, -1) ];
+});
+$__jsx_lazy_init(TurkishStemmer, "a_13", function () {
+ return [ new Among$SII("sin", -1, -1), new Among$SII("sun", -1, -1), new Among$SII("s\u00FCn", -1, -1), new Among$SII("s\u0131n", -1, -1) ];
+});
+$__jsx_lazy_init(TurkishStemmer, "a_14", function () {
+ return [ new Among$SII("iz", -1, -1), new Among$SII("uz", -1, -1), new Among$SII("\u00FCz", -1, -1), new Among$SII("\u0131z", -1, -1) ];
+});
+$__jsx_lazy_init(TurkishStemmer, "a_15", function () {
+ return [ new Among$SII("siniz", -1, -1), new Among$SII("sunuz", -1, -1), new Among$SII("s\u00FCn\u00FCz", -1, -1), new Among$SII("s\u0131n\u0131z", -1, -1) ];
+});
+$__jsx_lazy_init(TurkishStemmer, "a_16", function () {
+ return [ new Among$SII("lar", -1, -1), new Among$SII("ler", -1, -1) ];
+});
+$__jsx_lazy_init(TurkishStemmer, "a_17", function () {
+ return [ new Among$SII("niz", -1, -1), new Among$SII("nuz", -1, -1), new Among$SII("n\u00FCz", -1, -1), new Among$SII("n\u0131z", -1, -1) ];
+});
+$__jsx_lazy_init(TurkishStemmer, "a_18", function () {
+ return [ new Among$SII("dir", -1, -1), new Among$SII("tir", -1, -1), new Among$SII("dur", -1, -1), new Among$SII("tur", -1, -1), new Among$SII("d\u00FCr", -1, -1), new Among$SII("t\u00FCr", -1, -1), new Among$SII("d\u0131r", -1, -1), new Among$SII("t\u0131r", -1, -1) ];
+});
+$__jsx_lazy_init(TurkishStemmer, "a_19", function () {
+ return [ new Among$SII("cas\u0131na", -1, -1), new Among$SII("cesine", -1, -1) ];
+});
+$__jsx_lazy_init(TurkishStemmer, "a_20", function () {
+ return [ new Among$SII("di", -1, -1), new Among$SII("ti", -1, -1), new Among$SII("dik", -1, -1), new Among$SII("tik", -1, -1), new Among$SII("duk", -1, -1), new Among$SII("tuk", -1, -1), new Among$SII("d\u00FCk", -1, -1), new Among$SII("t\u00FCk", -1, -1), new Among$SII("d\u0131k", -1, -1), new Among$SII("t\u0131k", -1, -1), new Among$SII("dim", -1, -1), new Among$SII("tim", -1, -1), new Among$SII("dum", -1, -1), new Among$SII("tum", -1, -1), new Among$SII("d\u00FCm", -1, -1), new Among$SII("t\u00FCm", -1, -1), new Among$SII("d\u0131m", -1, -1), new Among$SII("t\u0131m", -1, -1), new Among$SII("din", -1, -1), new Among$SII("tin", -1, -1), new Among$SII("dun", -1, -1), new Among$SII("tun", -1, -1), new Among$SII("d\u00FCn", -1, -1), new Among$SII("t\u00FCn", -1, -1), new Among$SII("d\u0131n", -1, -1), new Among$SII("t\u0131n", -1, -1), new Among$SII("du", -1, -1), new Among$SII("tu", -1, -1), new Among$SII("d\u00FC", -1, -1), new Among$SII("t\u00FC", -1, -1), new Among$SII("d\u0131", -1, -1), new Among$SII("t\u0131", -1, -1) ];
+});
+$__jsx_lazy_init(TurkishStemmer, "a_21", function () {
+ return [ new Among$SII("sa", -1, -1), new Among$SII("se", -1, -1), new Among$SII("sak", -1, -1), new Among$SII("sek", -1, -1), new Among$SII("sam", -1, -1), new Among$SII("sem", -1, -1), new Among$SII("san", -1, -1), new Among$SII("sen", -1, -1) ];
+});
+$__jsx_lazy_init(TurkishStemmer, "a_22", function () {
+ return [ new Among$SII("mi\u015F", -1, -1), new Among$SII("mu\u015F", -1, -1), new Among$SII("m\u00FC\u015F", -1, -1), new Among$SII("m\u0131\u015F", -1, -1) ];
+});
+$__jsx_lazy_init(TurkishStemmer, "a_23", function () {
+ return [ new Among$SII("b", -1, 1), new Among$SII("c", -1, 2), new Among$SII("d", -1, 3), new Among$SII("\u011F", -1, 4) ];
+});
+$__jsx_lazy_init(TurkishStemmer, "g_vowel", function () {
+ return [ 17, 65, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 8, 0, 0, 0, 0, 0, 0, 1 ];
+});
+$__jsx_lazy_init(TurkishStemmer, "g_U", function () {
+ return [ 1, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 1 ];
+});
+$__jsx_lazy_init(TurkishStemmer, "g_vowel1", function () {
+ return [ 1, 64, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1 ];
+});
+$__jsx_lazy_init(TurkishStemmer, "g_vowel2", function () {
+ return [ 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 130 ];
+});
+$__jsx_lazy_init(TurkishStemmer, "g_vowel3", function () {
+ return [ 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1 ];
+});
+$__jsx_lazy_init(TurkishStemmer, "g_vowel4", function () {
+ return [ 17 ];
+});
+$__jsx_lazy_init(TurkishStemmer, "g_vowel5", function () {
+ return [ 65 ];
+});
+$__jsx_lazy_init(TurkishStemmer, "g_vowel6", function () {
+ return [ 65 ];
+});
+SwedishStemmer.serialVersionUID = 1;
+$__jsx_lazy_init(SwedishStemmer, "methodObject", function () {
+ return new SwedishStemmer$();
+});
+$__jsx_lazy_init(SwedishStemmer, "a_0", function () {
+ return [ new Among$SII("a", -1, 1), new Among$SII("arna", 0, 1), new Among$SII("erna", 0, 1), new Among$SII("heterna", 2, 1), new Among$SII("orna", 0, 1), new Among$SII("ad", -1, 1), new Among$SII("e", -1, 1), new Among$SII("ade", 6, 1), new Among$SII("ande", 6, 1), new Among$SII("arne", 6, 1), new Among$SII("are", 6, 1), new Among$SII("aste", 6, 1), new Among$SII("en", -1, 1), new Among$SII("anden", 12, 1), new Among$SII("aren", 12, 1), new Among$SII("heten", 12, 1), new Among$SII("ern", -1, 1), new Among$SII("ar", -1, 1), new Among$SII("er", -1, 1), new Among$SII("heter", 18, 1), new Among$SII("or", -1, 1), new Among$SII("s", -1, 2), new Among$SII("as", 21, 1), new Among$SII("arnas", 22, 1), new Among$SII("ernas", 22, 1), new Among$SII("ornas", 22, 1), new Among$SII("es", 21, 1), new Among$SII("ades", 26, 1), new Among$SII("andes", 26, 1), new Among$SII("ens", 21, 1), new Among$SII("arens", 29, 1), new Among$SII("hetens", 29, 1), new Among$SII("erns", 21, 1), new Among$SII("at", -1, 1), new Among$SII("andet", -1, 1), new Among$SII("het", -1, 1), new Among$SII("ast", -1, 1) ];
+});
+$__jsx_lazy_init(SwedishStemmer, "a_1", function () {
+ return [ new Among$SII("dd", -1, -1), new Among$SII("gd", -1, -1), new Among$SII("nn", -1, -1), new Among$SII("dt", -1, -1), new Among$SII("gt", -1, -1), new Among$SII("kt", -1, -1), new Among$SII("tt", -1, -1) ];
+});
+$__jsx_lazy_init(SwedishStemmer, "a_2", function () {
+ return [ new Among$SII("ig", -1, 1), new Among$SII("lig", 0, 1), new Among$SII("els", -1, 1), new Among$SII("fullt", -1, 3), new Among$SII("l\u00F6st", -1, 2) ];
+});
+$__jsx_lazy_init(SwedishStemmer, "g_v", function () {
+ return [ 17, 65, 16, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 24, 0, 32 ];
+});
+$__jsx_lazy_init(SwedishStemmer, "g_s_ending", function () {
+ return [ 119, 127, 149 ];
+});
+SpanishStemmer.serialVersionUID = 1;
+$__jsx_lazy_init(SpanishStemmer, "methodObject", function () {
+ return new SpanishStemmer$();
+});
+$__jsx_lazy_init(SpanishStemmer, "a_0", function () {
+ return [ new Among$SII("", -1, 6), new Among$SII("\u00E1", 0, 1), new Among$SII("\u00E9", 0, 2), new Among$SII("\u00ED", 0, 3), new Among$SII("\u00F3", 0, 4), new Among$SII("\u00FA", 0, 5) ];
+});
+$__jsx_lazy_init(SpanishStemmer, "a_1", function () {
+ return [ new Among$SII("la", -1, -1), new Among$SII("sela", 0, -1), new Among$SII("le", -1, -1), new Among$SII("me", -1, -1), new Among$SII("se", -1, -1), new Among$SII("lo", -1, -1), new Among$SII("selo", 5, -1), new Among$SII("las", -1, -1), new Among$SII("selas", 7, -1), new Among$SII("les", -1, -1), new Among$SII("los", -1, -1), new Among$SII("selos", 10, -1), new Among$SII("nos", -1, -1) ];
+});
+$__jsx_lazy_init(SpanishStemmer, "a_2", function () {
+ return [ new Among$SII("ando", -1, 6), new Among$SII("iendo", -1, 6), new Among$SII("yendo", -1, 7), new Among$SII("\u00E1ndo", -1, 2), new Among$SII("i\u00E9ndo", -1, 1), new Among$SII("ar", -1, 6), new Among$SII("er", -1, 6), new Among$SII("ir", -1, 6), new Among$SII("\u00E1r", -1, 3), new Among$SII("\u00E9r", -1, 4), new Among$SII("\u00EDr", -1, 5) ];
+});
+$__jsx_lazy_init(SpanishStemmer, "a_3", function () {
+ return [ new Among$SII("ic", -1, -1), new Among$SII("ad", -1, -1), new Among$SII("os", -1, -1), new Among$SII("iv", -1, 1) ];
+});
+$__jsx_lazy_init(SpanishStemmer, "a_4", function () {
+ return [ new Among$SII("able", -1, 1), new Among$SII("ible", -1, 1), new Among$SII("ante", -1, 1) ];
+});
+$__jsx_lazy_init(SpanishStemmer, "a_5", function () {
+ return [ new Among$SII("ic", -1, 1), new Among$SII("abil", -1, 1), new Among$SII("iv", -1, 1) ];
+});
+$__jsx_lazy_init(SpanishStemmer, "a_6", function () {
+ return [ new Among$SII("ica", -1, 1), new Among$SII("ancia", -1, 2), new Among$SII("encia", -1, 5), new Among$SII("adora", -1, 2), new Among$SII("osa", -1, 1), new Among$SII("ista", -1, 1), new Among$SII("iva", -1, 9), new Among$SII("anza", -1, 1), new Among$SII("log\u00EDa", -1, 3), new Among$SII("idad", -1, 8), new Among$SII("able", -1, 1), new Among$SII("ible", -1, 1), new Among$SII("ante", -1, 2), new Among$SII("mente", -1, 7), new Among$SII("amente", 13, 6), new Among$SII("aci\u00F3n", -1, 2), new Among$SII("uci\u00F3n", -1, 4), new Among$SII("ico", -1, 1), new Among$SII("ismo", -1, 1), new Among$SII("oso", -1, 1), new Among$SII("amiento", -1, 1), new Among$SII("imiento", -1, 1), new Among$SII("ivo", -1, 9), new Among$SII("ador", -1, 2), new Among$SII("icas", -1, 1), new Among$SII("ancias", -1, 2), new Among$SII("encias", -1, 5), new Among$SII("adoras", -1, 2), new Among$SII("osas", -1, 1), new Among$SII("istas", -1, 1), new Among$SII("ivas", -1, 9), new Among$SII("anzas", -1, 1), new Among$SII("log\u00EDas", -1, 3), new Among$SII("idades", -1, 8), new Among$SII("ables", -1, 1), new Among$SII("ibles", -1, 1), new Among$SII("aciones", -1, 2), new Among$SII("uciones", -1, 4), new Among$SII("adores", -1, 2), new Among$SII("antes", -1, 2), new Among$SII("icos", -1, 1), new Among$SII("ismos", -1, 1), new Among$SII("osos", -1, 1), new Among$SII("amientos", -1, 1), new Among$SII("imientos", -1, 1), new Among$SII("ivos", -1, 9) ];
+});
+$__jsx_lazy_init(SpanishStemmer, "a_7", function () {
+ return [ new Among$SII("ya", -1, 1), new Among$SII("ye", -1, 1), new Among$SII("yan", -1, 1), new Among$SII("yen", -1, 1), new Among$SII("yeron", -1, 1), new Among$SII("yendo", -1, 1), new Among$SII("yo", -1, 1), new Among$SII("yas", -1, 1), new Among$SII("yes", -1, 1), new Among$SII("yais", -1, 1), new Among$SII("yamos", -1, 1), new Among$SII("y\u00F3", -1, 1) ];
+});
+$__jsx_lazy_init(SpanishStemmer, "a_8", function () {
+ return [ new Among$SII("aba", -1, 2), new Among$SII("ada", -1, 2), new Among$SII("ida", -1, 2), new Among$SII("ara", -1, 2), new Among$SII("iera", -1, 2), new Among$SII("\u00EDa", -1, 2), new Among$SII("ar\u00EDa", 5, 2), new Among$SII("er\u00EDa", 5, 2), new Among$SII("ir\u00EDa", 5, 2), new Among$SII("ad", -1, 2), new Among$SII("ed", -1, 2), new Among$SII("id", -1, 2), new Among$SII("ase", -1, 2), new Among$SII("iese", -1, 2), new Among$SII("aste", -1, 2), new Among$SII("iste", -1, 2), new Among$SII("an", -1, 2), new Among$SII("aban", 16, 2), new Among$SII("aran", 16, 2), new Among$SII("ieran", 16, 2), new Among$SII("\u00EDan", 16, 2), new Among$SII("ar\u00EDan", 20, 2), new Among$SII("er\u00EDan", 20, 2), new Among$SII("ir\u00EDan", 20, 2), new Among$SII("en", -1, 1), new Among$SII("asen", 24, 2), new Among$SII("iesen", 24, 2), new Among$SII("aron", -1, 2), new Among$SII("ieron", -1, 2), new Among$SII("ar\u00E1n", -1, 2), new Among$SII("er\u00E1n", -1, 2), new Among$SII("ir\u00E1n", -1, 2), new Among$SII("ado", -1, 2), new Among$SII("ido", -1, 2), new Among$SII("ando", -1, 2), new Among$SII("iendo", -1, 2), new Among$SII("ar", -1, 2), new Among$SII("er", -1, 2), new Among$SII("ir", -1, 2), new Among$SII("as", -1, 2), new Among$SII("abas", 39, 2), new Among$SII("adas", 39, 2), new Among$SII("idas", 39, 2), new Among$SII("aras", 39, 2), new Among$SII("ieras", 39, 2), new Among$SII("\u00EDas", 39, 2), new Among$SII("ar\u00EDas", 45, 2), new Among$SII("er\u00EDas", 45, 2), new Among$SII("ir\u00EDas", 45, 2), new Among$SII("es", -1, 1), new Among$SII("ases", 49, 2), new Among$SII("ieses", 49, 2), new Among$SII("abais", -1, 2), new Among$SII("arais", -1, 2), new Among$SII("ierais", -1, 2), new Among$SII("\u00EDais", -1, 2), new Among$SII("ar\u00EDais", 55, 2), new Among$SII("er\u00EDais", 55, 2), new Among$SII("ir\u00EDais", 55, 2), new Among$SII("aseis", -1, 2), new Among$SII("ieseis", -1, 2), new Among$SII("asteis", -1, 2), new Among$SII("isteis", -1, 2), new Among$SII("\u00E1is", -1, 2), new Among$SII("\u00E9is", -1, 1), new Among$SII("ar\u00E9is", 64, 2), new Among$SII("er\u00E9is", 64, 2), new Among$SII("ir\u00E9is", 64, 2), new Among$SII("ados", -1, 2), new Among$SII("idos", -1, 2), new Among$SII("amos", -1, 2), new Among$SII("\u00E1bamos", 70, 2), new Among$SII("\u00E1ramos", 70, 2), new Among$SII("i\u00E9ramos", 70, 2), new Among$SII("\u00EDamos", 70, 2), new Among$SII("ar\u00EDamos", 74, 2), new Among$SII("er\u00EDamos", 74, 2), new Among$SII("ir\u00EDamos", 74, 2), new Among$SII("emos", -1, 1), new Among$SII("aremos", 78, 2), new Among$SII("eremos", 78, 2), new Among$SII("iremos", 78, 2), new Among$SII("\u00E1semos", 78, 2), new Among$SII("i\u00E9semos", 78, 2), new Among$SII("imos", -1, 2), new Among$SII("ar\u00E1s", -1, 2), new Among$SII("er\u00E1s", -1, 2), new Among$SII("ir\u00E1s", -1, 2), new Among$SII("\u00EDs", -1, 2), new Among$SII("ar\u00E1", -1, 2), new Among$SII("er\u00E1", -1, 2), new Among$SII("ir\u00E1", -1, 2), new Among$SII("ar\u00E9", -1, 2), new Among$SII("er\u00E9", -1, 2), new Among$SII("ir\u00E9", -1, 2), new Among$SII("i\u00F3", -1, 2) ];
+});
+$__jsx_lazy_init(SpanishStemmer, "a_9", function () {
+ return [ new Among$SII("a", -1, 1), new Among$SII("e", -1, 2), new Among$SII("o", -1, 1), new Among$SII("os", -1, 1), new Among$SII("\u00E1", -1, 1), new Among$SII("\u00E9", -1, 2), new Among$SII("\u00ED", -1, 1), new Among$SII("\u00F3", -1, 1) ];
+});
+$__jsx_lazy_init(SpanishStemmer, "g_v", function () {
+ return [ 17, 65, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 17, 4, 10 ];
+});
+RussianStemmer.serialVersionUID = 1;
+$__jsx_lazy_init(RussianStemmer, "methodObject", function () {
+ return new RussianStemmer$();
+});
+$__jsx_lazy_init(RussianStemmer, "a_0", function () {
+ return [ new Among$SII("\u0432", -1, 1), new Among$SII("\u0438\u0432", 0, 2), new Among$SII("\u044B\u0432", 0, 2), new Among$SII("\u0432\u0448\u0438", -1, 1), new Among$SII("\u0438\u0432\u0448\u0438", 3, 2), new Among$SII("\u044B\u0432\u0448\u0438", 3, 2), new Among$SII("\u0432\u0448\u0438\u0441\u044C", -1, 1), new Among$SII("\u0438\u0432\u0448\u0438\u0441\u044C", 6, 2), new Among$SII("\u044B\u0432\u0448\u0438\u0441\u044C", 6, 2) ];
+});
+$__jsx_lazy_init(RussianStemmer, "a_1", function () {
+ return [ new Among$SII("\u0435\u0435", -1, 1), new Among$SII("\u0438\u0435", -1, 1), new Among$SII("\u043E\u0435", -1, 1), new Among$SII("\u044B\u0435", -1, 1), new Among$SII("\u0438\u043C\u0438", -1, 1), new Among$SII("\u044B\u043C\u0438", -1, 1), new Among$SII("\u0435\u0439", -1, 1), new Among$SII("\u0438\u0439", -1, 1), new Among$SII("\u043E\u0439", -1, 1), new Among$SII("\u044B\u0439", -1, 1), new Among$SII("\u0435\u043C", -1, 1), new Among$SII("\u0438\u043C", -1, 1), new Among$SII("\u043E\u043C", -1, 1), new Among$SII("\u044B\u043C", -1, 1), new Among$SII("\u0435\u0433\u043E", -1, 1), new Among$SII("\u043E\u0433\u043E", -1, 1), new Among$SII("\u0435\u043C\u0443", -1, 1), new Among$SII("\u043E\u043C\u0443", -1, 1), new Among$SII("\u0438\u0445", -1, 1), new Among$SII("\u044B\u0445", -1, 1), new Among$SII("\u0435\u044E", -1, 1), new Among$SII("\u043E\u044E", -1, 1), new Among$SII("\u0443\u044E", -1, 1), new Among$SII("\u044E\u044E", -1, 1), new Among$SII("\u0430\u044F", -1, 1), new Among$SII("\u044F\u044F", -1, 1) ];
+});
+$__jsx_lazy_init(RussianStemmer, "a_2", function () {
+ return [ new Among$SII("\u0435\u043C", -1, 1), new Among$SII("\u043D\u043D", -1, 1), new Among$SII("\u0432\u0448", -1, 1), new Among$SII("\u0438\u0432\u0448", 2, 2), new Among$SII("\u044B\u0432\u0448", 2, 2), new Among$SII("\u0449", -1, 1), new Among$SII("\u044E\u0449", 5, 1), new Among$SII("\u0443\u044E\u0449", 6, 2) ];
+});
+$__jsx_lazy_init(RussianStemmer, "a_3", function () {
+ return [ new Among$SII("\u0441\u044C", -1, 1), new Among$SII("\u0441\u044F", -1, 1) ];
+});
+$__jsx_lazy_init(RussianStemmer, "a_4", function () {
+ return [ new Among$SII("\u043B\u0430", -1, 1), new Among$SII("\u0438\u043B\u0430", 0, 2), new Among$SII("\u044B\u043B\u0430", 0, 2), new Among$SII("\u043D\u0430", -1, 1), new Among$SII("\u0435\u043D\u0430", 3, 2), new Among$SII("\u0435\u0442\u0435", -1, 1), new Among$SII("\u0438\u0442\u0435", -1, 2), new Among$SII("\u0439\u0442\u0435", -1, 1), new Among$SII("\u0435\u0439\u0442\u0435", 7, 2), new Among$SII("\u0443\u0439\u0442\u0435", 7, 2), new Among$SII("\u043B\u0438", -1, 1), new Among$SII("\u0438\u043B\u0438", 10, 2), new Among$SII("\u044B\u043B\u0438", 10, 2), new Among$SII("\u0439", -1, 1), new Among$SII("\u0435\u0439", 13, 2), new Among$SII("\u0443\u0439", 13, 2), new Among$SII("\u043B", -1, 1), new Among$SII("\u0438\u043B", 16, 2), new Among$SII("\u044B\u043B", 16, 2), new Among$SII("\u0435\u043C", -1, 1), new Among$SII("\u0438\u043C", -1, 2), new Among$SII("\u044B\u043C", -1, 2), new Among$SII("\u043D", -1, 1), new Among$SII("\u0435\u043D", 22, 2), new Among$SII("\u043B\u043E", -1, 1), new Among$SII("\u0438\u043B\u043E", 24, 2), new Among$SII("\u044B\u043B\u043E", 24, 2), new Among$SII("\u043D\u043E", -1, 1), new Among$SII("\u0435\u043D\u043E", 27, 2), new Among$SII("\u043D\u043D\u043E", 27, 1), new Among$SII("\u0435\u0442", -1, 1), new Among$SII("\u0443\u0435\u0442", 30, 2), new Among$SII("\u0438\u0442", -1, 2), new Among$SII("\u044B\u0442", -1, 2), new Among$SII("\u044E\u0442", -1, 1), new Among$SII("\u0443\u044E\u0442", 34, 2), new Among$SII("\u044F\u0442", -1, 2), new Among$SII("\u043D\u044B", -1, 1), new Among$SII("\u0435\u043D\u044B", 37, 2), new Among$SII("\u0442\u044C", -1, 1), new Among$SII("\u0438\u0442\u044C", 39, 2), new Among$SII("\u044B\u0442\u044C", 39, 2), new Among$SII("\u0435\u0448\u044C", -1, 1), new Among$SII("\u0438\u0448\u044C", -1, 2), new Among$SII("\u044E", -1, 2), new Among$SII("\u0443\u044E", 44, 2) ];
+});
+$__jsx_lazy_init(RussianStemmer, "a_5", function () {
+ return [ new Among$SII("\u0430", -1, 1), new Among$SII("\u0435\u0432", -1, 1), new Among$SII("\u043E\u0432", -1, 1), new Among$SII("\u0435", -1, 1), new Among$SII("\u0438\u0435", 3, 1), new Among$SII("\u044C\u0435", 3, 1), new Among$SII("\u0438", -1, 1), new Among$SII("\u0435\u0438", 6, 1), new Among$SII("\u0438\u0438", 6, 1), new Among$SII("\u0430\u043C\u0438", 6, 1), new Among$SII("\u044F\u043C\u0438", 6, 1), new Among$SII("\u0438\u044F\u043C\u0438", 10, 1), new Among$SII("\u0439", -1, 1), new Among$SII("\u0435\u0439", 12, 1), new Among$SII("\u0438\u0435\u0439", 13, 1), new Among$SII("\u0438\u0439", 12, 1), new Among$SII("\u043E\u0439", 12, 1), new Among$SII("\u0430\u043C", -1, 1), new Among$SII("\u0435\u043C", -1, 1), new Among$SII("\u0438\u0435\u043C", 18, 1), new Among$SII("\u043E\u043C", -1, 1), new Among$SII("\u044F\u043C", -1, 1), new Among$SII("\u0438\u044F\u043C", 21, 1), new Among$SII("\u043E", -1, 1), new Among$SII("\u0443", -1, 1), new Among$SII("\u0430\u0445", -1, 1), new Among$SII("\u044F\u0445", -1, 1), new Among$SII("\u0438\u044F\u0445", 26, 1), new Among$SII("\u044B", -1, 1), new Among$SII("\u044C", -1, 1), new Among$SII("\u044E", -1, 1), new Among$SII("\u0438\u044E", 30, 1), new Among$SII("\u044C\u044E", 30, 1), new Among$SII("\u044F", -1, 1), new Among$SII("\u0438\u044F", 33, 1), new Among$SII("\u044C\u044F", 33, 1) ];
+});
+$__jsx_lazy_init(RussianStemmer, "a_6", function () {
+ return [ new Among$SII("\u043E\u0441\u0442", -1, 1), new Among$SII("\u043E\u0441\u0442\u044C", -1, 1) ];
+});
+$__jsx_lazy_init(RussianStemmer, "a_7", function () {
+ return [ new Among$SII("\u0435\u0439\u0448\u0435", -1, 1), new Among$SII("\u043D", -1, 2), new Among$SII("\u0435\u0439\u0448", -1, 1), new Among$SII("\u044C", -1, 3) ];
+});
+$__jsx_lazy_init(RussianStemmer, "g_v", function () {
+ return [ 33, 65, 8, 232 ];
+});
+RomanianStemmer.serialVersionUID = 1;
+$__jsx_lazy_init(RomanianStemmer, "methodObject", function () {
+ return new RomanianStemmer$();
+});
+$__jsx_lazy_init(RomanianStemmer, "a_0", function () {
+ return [ new Among$SII("", -1, 3), new Among$SII("I", 0, 1), new Among$SII("U", 0, 2) ];
+});
+$__jsx_lazy_init(RomanianStemmer, "a_1", function () {
+ return [ new Among$SII("ea", -1, 3), new Among$SII("a\u0163ia", -1, 7), new Among$SII("aua", -1, 2), new Among$SII("iua", -1, 4), new Among$SII("a\u0163ie", -1, 7), new Among$SII("ele", -1, 3), new Among$SII("ile", -1, 5), new Among$SII("iile", 6, 4), new Among$SII("iei", -1, 4), new Among$SII("atei", -1, 6), new Among$SII("ii", -1, 4), new Among$SII("ului", -1, 1), new Among$SII("ul", -1, 1), new Among$SII("elor", -1, 3), new Among$SII("ilor", -1, 4), new Among$SII("iilor", 14, 4) ];
+});
+$__jsx_lazy_init(RomanianStemmer, "a_2", function () {
+ return [ new Among$SII("icala", -1, 4), new Among$SII("iciva", -1, 4), new Among$SII("ativa", -1, 5), new Among$SII("itiva", -1, 6), new Among$SII("icale", -1, 4), new Among$SII("a\u0163iune", -1, 5), new Among$SII("i\u0163iune", -1, 6), new Among$SII("atoare", -1, 5), new Among$SII("itoare", -1, 6), new Among$SII("\u0103toare", -1, 5), new Among$SII("icitate", -1, 4), new Among$SII("abilitate", -1, 1), new Among$SII("ibilitate", -1, 2), new Among$SII("ivitate", -1, 3), new Among$SII("icive", -1, 4), new Among$SII("ative", -1, 5), new Among$SII("itive", -1, 6), new Among$SII("icali", -1, 4), new Among$SII("atori", -1, 5), new Among$SII("icatori", 18, 4), new Among$SII("itori", -1, 6), new Among$SII("\u0103tori", -1, 5), new Among$SII("icitati", -1, 4), new Among$SII("abilitati", -1, 1), new Among$SII("ivitati", -1, 3), new Among$SII("icivi", -1, 4), new Among$SII("ativi", -1, 5), new Among$SII("itivi", -1, 6), new Among$SII("icit\u0103i", -1, 4), new Among$SII("abilit\u0103i", -1, 1), new Among$SII("ivit\u0103i", -1, 3), new Among$SII("icit\u0103\u0163i", -1, 4), new Among$SII("abilit\u0103\u0163i", -1, 1), new Among$SII("ivit\u0103\u0163i", -1, 3), new Among$SII("ical", -1, 4), new Among$SII("ator", -1, 5), new Among$SII("icator", 35, 4), new Among$SII("itor", -1, 6), new Among$SII("\u0103tor", -1, 5), new Among$SII("iciv", -1, 4), new Among$SII("ativ", -1, 5), new Among$SII("itiv", -1, 6), new Among$SII("ical\u0103", -1, 4), new Among$SII("iciv\u0103", -1, 4), new Among$SII("ativ\u0103", -1, 5), new Among$SII("itiv\u0103", -1, 6) ];
+});
+$__jsx_lazy_init(RomanianStemmer, "a_3", function () {
+ return [ new Among$SII("ica", -1, 1), new Among$SII("abila", -1, 1), new Among$SII("ibila", -1, 1), new Among$SII("oasa", -1, 1), new Among$SII("ata", -1, 1), new Among$SII("ita", -1, 1), new Among$SII("anta", -1, 1), new Among$SII("ista", -1, 3), new Among$SII("uta", -1, 1), new Among$SII("iva", -1, 1), new Among$SII("ic", -1, 1), new Among$SII("ice", -1, 1), new Among$SII("abile", -1, 1), new Among$SII("ibile", -1, 1), new Among$SII("isme", -1, 3), new Among$SII("iune", -1, 2), new Among$SII("oase", -1, 1), new Among$SII("ate", -1, 1), new Among$SII("itate", 17, 1), new Among$SII("ite", -1, 1), new Among$SII("ante", -1, 1), new Among$SII("iste", -1, 3), new Among$SII("ute", -1, 1), new Among$SII("ive", -1, 1), new Among$SII("ici", -1, 1), new Among$SII("abili", -1, 1), new Among$SII("ibili", -1, 1), new Among$SII("iuni", -1, 2), new Among$SII("atori", -1, 1), new Among$SII("osi", -1, 1), new Among$SII("ati", -1, 1), new Among$SII("itati", 30, 1), new Among$SII("iti", -1, 1), new Among$SII("anti", -1, 1), new Among$SII("isti", -1, 3), new Among$SII("uti", -1, 1), new Among$SII("i\u015Fti", -1, 3), new Among$SII("ivi", -1, 1), new Among$SII("it\u0103i", -1, 1), new Among$SII("o\u015Fi", -1, 1), new Among$SII("it\u0103\u0163i", -1, 1), new Among$SII("abil", -1, 1), new Among$SII("ibil", -1, 1), new Among$SII("ism", -1, 3), new Among$SII("ator", -1, 1), new Among$SII("os", -1, 1), new Among$SII("at", -1, 1), new Among$SII("it", -1, 1), new Among$SII("ant", -1, 1), new Among$SII("ist", -1, 3), new Among$SII("ut", -1, 1), new Among$SII("iv", -1, 1), new Among$SII("ic\u0103", -1, 1), new Among$SII("abil\u0103", -1, 1), new Among$SII("ibil\u0103", -1, 1), new Among$SII("oas\u0103", -1, 1), new Among$SII("at\u0103", -1, 1), new Among$SII("it\u0103", -1, 1), new Among$SII("ant\u0103", -1, 1), new Among$SII("ist\u0103", -1, 3), new Among$SII("ut\u0103", -1, 1), new Among$SII("iv\u0103", -1, 1) ];
+});
+$__jsx_lazy_init(RomanianStemmer, "a_4", function () {
+ return [ new Among$SII("ea", -1, 1), new Among$SII("ia", -1, 1), new Among$SII("esc", -1, 1), new Among$SII("\u0103sc", -1, 1), new Among$SII("ind", -1, 1), new Among$SII("\u00E2nd", -1, 1), new Among$SII("are", -1, 1), new Among$SII("ere", -1, 1), new Among$SII("ire", -1, 1), new Among$SII("\u00E2re", -1, 1), new Among$SII("se", -1, 2), new Among$SII("ase", 10, 1), new Among$SII("sese", 10, 2), new Among$SII("ise", 10, 1), new Among$SII("use", 10, 1), new Among$SII("\u00E2se", 10, 1), new Among$SII("e\u015Fte", -1, 1), new Among$SII("\u0103\u015Fte", -1, 1), new Among$SII("eze", -1, 1), new Among$SII("ai", -1, 1), new Among$SII("eai", 19, 1), new Among$SII("iai", 19, 1), new Among$SII("sei", -1, 2), new Among$SII("e\u015Fti", -1, 1), new Among$SII("\u0103\u015Fti", -1, 1), new Among$SII("ui", -1, 1), new Among$SII("ezi", -1, 1), new Among$SII("\u00E2i", -1, 1), new Among$SII("a\u015Fi", -1, 1), new Among$SII("se\u015Fi", -1, 2), new Among$SII("ase\u015Fi", 29, 1), new Among$SII("sese\u015Fi", 29, 2), new Among$SII("ise\u015Fi", 29, 1), new Among$SII("use\u015Fi", 29, 1), new Among$SII("\u00E2se\u015Fi", 29, 1), new Among$SII("i\u015Fi", -1, 1), new Among$SII("u\u015Fi", -1, 1), new Among$SII("\u00E2\u015Fi", -1, 1), new Among$SII("a\u0163i", -1, 2), new Among$SII("ea\u0163i", 38, 1), new Among$SII("ia\u0163i", 38, 1), new Among$SII("e\u0163i", -1, 2), new Among$SII("i\u0163i", -1, 2), new Among$SII("\u00E2\u0163i", -1, 2), new Among$SII("ar\u0103\u0163i", -1, 1), new Among$SII("ser\u0103\u0163i", -1, 2), new Among$SII("aser\u0103\u0163i", 45, 1), new Among$SII("seser\u0103\u0163i", 45, 2), new Among$SII("iser\u0103\u0163i", 45, 1), new Among$SII("user\u0103\u0163i", 45, 1), new Among$SII("\u00E2ser\u0103\u0163i", 45, 1), new Among$SII("ir\u0103\u0163i", -1, 1), new Among$SII("ur\u0103\u0163i", -1, 1), new Among$SII("\u00E2r\u0103\u0163i", -1, 1), new Among$SII("am", -1, 1), new Among$SII("eam", 54, 1), new Among$SII("iam", 54, 1), new Among$SII("em", -1, 2), new Among$SII("asem", 57, 1), new Among$SII("sesem", 57, 2), new Among$SII("isem", 57, 1), new Among$SII("usem", 57, 1), new Among$SII("\u00E2sem", 57, 1), new Among$SII("im", -1, 2), new Among$SII("\u00E2m", -1, 2), new Among$SII("\u0103m", -1, 2), new Among$SII("ar\u0103m", 65, 1), new Among$SII("ser\u0103m", 65, 2), new Among$SII("aser\u0103m", 67, 1), new Among$SII("seser\u0103m", 67, 2), new Among$SII("iser\u0103m", 67, 1), new Among$SII("user\u0103m", 67, 1), new Among$SII("\u00E2ser\u0103m", 67, 1), new Among$SII("ir\u0103m", 65, 1), new Among$SII("ur\u0103m", 65, 1), new Among$SII("\u00E2r\u0103m", 65, 1), new Among$SII("au", -1, 1), new Among$SII("eau", 76, 1), new Among$SII("iau", 76, 1), new Among$SII("indu", -1, 1), new Among$SII("\u00E2ndu", -1, 1), new Among$SII("ez", -1, 1), new Among$SII("easc\u0103", -1, 1), new Among$SII("ar\u0103", -1, 1), new Among$SII("ser\u0103", -1, 2), new Among$SII("aser\u0103", 84, 1), new Among$SII("seser\u0103", 84, 2), new Among$SII("iser\u0103", 84, 1), new Among$SII("user\u0103", 84, 1), new Among$SII("\u00E2ser\u0103", 84, 1), new Among$SII("ir\u0103", -1, 1), new Among$SII("ur\u0103", -1, 1), new Among$SII("\u00E2r\u0103", -1, 1), new Among$SII("eaz\u0103", -1, 1) ];
+});
+$__jsx_lazy_init(RomanianStemmer, "a_5", function () {
+ return [ new Among$SII("a", -1, 1), new Among$SII("e", -1, 1), new Among$SII("ie", 1, 1), new Among$SII("i", -1, 1), new Among$SII("\u0103", -1, 1) ];
+});
+$__jsx_lazy_init(RomanianStemmer, "g_v", function () {
+ return [ 17, 65, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 32, 0, 0, 4 ];
+});
+PortugueseStemmer.serialVersionUID = 1;
+$__jsx_lazy_init(PortugueseStemmer, "methodObject", function () {
+ return new PortugueseStemmer$();
+});
+$__jsx_lazy_init(PortugueseStemmer, "a_0", function () {
+ return [ new Among$SII("", -1, 3), new Among$SII("\u00E3", 0, 1), new Among$SII("\u00F5", 0, 2) ];
+});
+$__jsx_lazy_init(PortugueseStemmer, "a_1", function () {
+ return [ new Among$SII("", -1, 3), new Among$SII("a~", 0, 1), new Among$SII("o~", 0, 2) ];
+});
+$__jsx_lazy_init(PortugueseStemmer, "a_2", function () {
+ return [ new Among$SII("ic", -1, -1), new Among$SII("ad", -1, -1), new Among$SII("os", -1, -1), new Among$SII("iv", -1, 1) ];
+});
+$__jsx_lazy_init(PortugueseStemmer, "a_3", function () {
+ return [ new Among$SII("ante", -1, 1), new Among$SII("avel", -1, 1), new Among$SII("\u00EDvel", -1, 1) ];
+});
+$__jsx_lazy_init(PortugueseStemmer, "a_4", function () {
+ return [ new Among$SII("ic", -1, 1), new Among$SII("abil", -1, 1), new Among$SII("iv", -1, 1) ];
+});
+$__jsx_lazy_init(PortugueseStemmer, "a_5", function () {
+ return [ new Among$SII("ica", -1, 1), new Among$SII("\u00E2ncia", -1, 1), new Among$SII("\u00EAncia", -1, 4), new Among$SII("ira", -1, 9), new Among$SII("adora", -1, 1), new Among$SII("osa", -1, 1), new Among$SII("ista", -1, 1), new Among$SII("iva", -1, 8), new Among$SII("eza", -1, 1), new Among$SII("log\u00EDa", -1, 2), new Among$SII("idade", -1, 7), new Among$SII("ante", -1, 1), new Among$SII("mente", -1, 6), new Among$SII("amente", 12, 5), new Among$SII("\u00E1vel", -1, 1), new Among$SII("\u00EDvel", -1, 1), new Among$SII("uci\u00F3n", -1, 3), new Among$SII("ico", -1, 1), new Among$SII("ismo", -1, 1), new Among$SII("oso", -1, 1), new Among$SII("amento", -1, 1), new Among$SII("imento", -1, 1), new Among$SII("ivo", -1, 8), new Among$SII("a\u00E7a~o", -1, 1), new Among$SII("ador", -1, 1), new Among$SII("icas", -1, 1), new Among$SII("\u00EAncias", -1, 4), new Among$SII("iras", -1, 9), new Among$SII("adoras", -1, 1), new Among$SII("osas", -1, 1), new Among$SII("istas", -1, 1), new Among$SII("ivas", -1, 8), new Among$SII("ezas", -1, 1), new Among$SII("log\u00EDas", -1, 2), new Among$SII("idades", -1, 7), new Among$SII("uciones", -1, 3), new Among$SII("adores", -1, 1), new Among$SII("antes", -1, 1), new Among$SII("a\u00E7o~es", -1, 1), new Among$SII("icos", -1, 1), new Among$SII("ismos", -1, 1), new Among$SII("osos", -1, 1), new Among$SII("amentos", -1, 1), new Among$SII("imentos", -1, 1), new Among$SII("ivos", -1, 8) ];
+});
+$__jsx_lazy_init(PortugueseStemmer, "a_6", function () {
+ return [ new Among$SII("ada", -1, 1), new Among$SII("ida", -1, 1), new Among$SII("ia", -1, 1), new Among$SII("aria", 2, 1), new Among$SII("eria", 2, 1), new Among$SII("iria", 2, 1), new Among$SII("ara", -1, 1), new Among$SII("era", -1, 1), new Among$SII("ira", -1, 1), new Among$SII("ava", -1, 1), new Among$SII("asse", -1, 1), new Among$SII("esse", -1, 1), new Among$SII("isse", -1, 1), new Among$SII("aste", -1, 1), new Among$SII("este", -1, 1), new Among$SII("iste", -1, 1), new Among$SII("ei", -1, 1), new Among$SII("arei", 16, 1), new Among$SII("erei", 16, 1), new Among$SII("irei", 16, 1), new Among$SII("am", -1, 1), new Among$SII("iam", 20, 1), new Among$SII("ariam", 21, 1), new Among$SII("eriam", 21, 1), new Among$SII("iriam", 21, 1), new Among$SII("aram", 20, 1), new Among$SII("eram", 20, 1), new Among$SII("iram", 20, 1), new Among$SII("avam", 20, 1), new Among$SII("em", -1, 1), new Among$SII("arem", 29, 1), new Among$SII("erem", 29, 1), new Among$SII("irem", 29, 1), new Among$SII("assem", 29, 1), new Among$SII("essem", 29, 1), new Among$SII("issem", 29, 1), new Among$SII("ado", -1, 1), new Among$SII("ido", -1, 1), new Among$SII("ando", -1, 1), new Among$SII("endo", -1, 1), new Among$SII("indo", -1, 1), new Among$SII("ara~o", -1, 1), new Among$SII("era~o", -1, 1), new Among$SII("ira~o", -1, 1), new Among$SII("ar", -1, 1), new Among$SII("er", -1, 1), new Among$SII("ir", -1, 1), new Among$SII("as", -1, 1), new Among$SII("adas", 47, 1), new Among$SII("idas", 47, 1), new Among$SII("ias", 47, 1), new Among$SII("arias", 50, 1), new Among$SII("erias", 50, 1), new Among$SII("irias", 50, 1), new Among$SII("aras", 47, 1), new Among$SII("eras", 47, 1), new Among$SII("iras", 47, 1), new Among$SII("avas", 47, 1), new Among$SII("es", -1, 1), new Among$SII("ardes", 58, 1), new Among$SII("erdes", 58, 1), new Among$SII("irdes", 58, 1), new Among$SII("ares", 58, 1), new Among$SII("eres", 58, 1), new Among$SII("ires", 58, 1), new Among$SII("asses", 58, 1), new Among$SII("esses", 58, 1), new Among$SII("isses", 58, 1), new Among$SII("astes", 58, 1), new Among$SII("estes", 58, 1), new Among$SII("istes", 58, 1), new Among$SII("is", -1, 1), new Among$SII("ais", 71, 1), new Among$SII("eis", 71, 1), new Among$SII("areis", 73, 1), new Among$SII("ereis", 73, 1), new Among$SII("ireis", 73, 1), new Among$SII("\u00E1reis", 73, 1), new Among$SII("\u00E9reis", 73, 1), new Among$SII("\u00EDreis", 73, 1), new Among$SII("\u00E1sseis", 73, 1), new Among$SII("\u00E9sseis", 73, 1), new Among$SII("\u00EDsseis", 73, 1), new Among$SII("\u00E1veis", 73, 1), new Among$SII("\u00EDeis", 73, 1), new Among$SII("ar\u00EDeis", 84, 1), new Among$SII("er\u00EDeis", 84, 1), new Among$SII("ir\u00EDeis", 84, 1), new Among$SII("ados", -1, 1), new Among$SII("idos", -1, 1), new Among$SII("amos", -1, 1), new Among$SII("\u00E1ramos", 90, 1), new Among$SII("\u00E9ramos", 90, 1), new Among$SII("\u00EDramos", 90, 1), new Among$SII("\u00E1vamos", 90, 1), new Among$SII("\u00EDamos", 90, 1), new Among$SII("ar\u00EDamos", 95, 1), new Among$SII("er\u00EDamos", 95, 1), new Among$SII("ir\u00EDamos", 95, 1), new Among$SII("emos", -1, 1), new Among$SII("aremos", 99, 1), new Among$SII("eremos", 99, 1), new Among$SII("iremos", 99, 1), new Among$SII("\u00E1ssemos", 99, 1), new Among$SII("\u00EAssemos", 99, 1), new Among$SII("\u00EDssemos", 99, 1), new Among$SII("imos", -1, 1), new Among$SII("armos", -1, 1), new Among$SII("ermos", -1, 1), new Among$SII("irmos", -1, 1), new Among$SII("\u00E1mos", -1, 1), new Among$SII("ar\u00E1s", -1, 1), new Among$SII("er\u00E1s", -1, 1), new Among$SII("ir\u00E1s", -1, 1), new Among$SII("eu", -1, 1), new Among$SII("iu", -1, 1), new Among$SII("ou", -1, 1), new Among$SII("ar\u00E1", -1, 1), new Among$SII("er\u00E1", -1, 1), new Among$SII("ir\u00E1", -1, 1) ];
+});
+$__jsx_lazy_init(PortugueseStemmer, "a_7", function () {
+ return [ new Among$SII("a", -1, 1), new Among$SII("i", -1, 1), new Among$SII("o", -1, 1), new Among$SII("os", -1, 1), new Among$SII("\u00E1", -1, 1), new Among$SII("\u00ED", -1, 1), new Among$SII("\u00F3", -1, 1) ];
+});
+$__jsx_lazy_init(PortugueseStemmer, "a_8", function () {
+ return [ new Among$SII("e", -1, 1), new Among$SII("\u00E7", -1, 2), new Among$SII("\u00E9", -1, 1), new Among$SII("\u00EA", -1, 1) ];
+});
+$__jsx_lazy_init(PortugueseStemmer, "g_v", function () {
+ return [ 17, 65, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 19, 12, 2 ];
+});
+PorterStemmer.serialVersionUID = 1;
+$__jsx_lazy_init(PorterStemmer, "methodObject", function () {
+ return new PorterStemmer$();
+});
+$__jsx_lazy_init(PorterStemmer, "a_0", function () {
+ return [ new Among$SII("s", -1, 3), new Among$SII("ies", 0, 2), new Among$SII("sses", 0, 1), new Among$SII("ss", 0, -1) ];
+});
+$__jsx_lazy_init(PorterStemmer, "a_1", function () {
+ return [ new Among$SII("", -1, 3), new Among$SII("bb", 0, 2), new Among$SII("dd", 0, 2), new Among$SII("ff", 0, 2), new Among$SII("gg", 0, 2), new Among$SII("bl", 0, 1), new Among$SII("mm", 0, 2), new Among$SII("nn", 0, 2), new Among$SII("pp", 0, 2), new Among$SII("rr", 0, 2), new Among$SII("at", 0, 1), new Among$SII("tt", 0, 2), new Among$SII("iz", 0, 1) ];
+});
+$__jsx_lazy_init(PorterStemmer, "a_2", function () {
+ return [ new Among$SII("ed", -1, 2), new Among$SII("eed", 0, 1), new Among$SII("ing", -1, 2) ];
+});
+$__jsx_lazy_init(PorterStemmer, "a_3", function () {
+ return [ new Among$SII("anci", -1, 3), new Among$SII("enci", -1, 2), new Among$SII("abli", -1, 4), new Among$SII("eli", -1, 6), new Among$SII("alli", -1, 9), new Among$SII("ousli", -1, 12), new Among$SII("entli", -1, 5), new Among$SII("aliti", -1, 10), new Among$SII("biliti", -1, 14), new Among$SII("iviti", -1, 13), new Among$SII("tional", -1, 1), new Among$SII("ational", 10, 8), new Among$SII("alism", -1, 10), new Among$SII("ation", -1, 8), new Among$SII("ization", 13, 7), new Among$SII("izer", -1, 7), new Among$SII("ator", -1, 8), new Among$SII("iveness", -1, 13), new Among$SII("fulness", -1, 11), new Among$SII("ousness", -1, 12) ];
+});
+$__jsx_lazy_init(PorterStemmer, "a_4", function () {
+ return [ new Among$SII("icate", -1, 2), new Among$SII("ative", -1, 3), new Among$SII("alize", -1, 1), new Among$SII("iciti", -1, 2), new Among$SII("ical", -1, 2), new Among$SII("ful", -1, 3), new Among$SII("ness", -1, 3) ];
+});
+$__jsx_lazy_init(PorterStemmer, "a_5", function () {
+ return [ new Among$SII("ic", -1, 1), new Among$SII("ance", -1, 1), new Among$SII("ence", -1, 1), new Among$SII("able", -1, 1), new Among$SII("ible", -1, 1), new Among$SII("ate", -1, 1), new Among$SII("ive", -1, 1), new Among$SII("ize", -1, 1), new Among$SII("iti", -1, 1), new Among$SII("al", -1, 1), new Among$SII("ism", -1, 1), new Among$SII("ion", -1, 2), new Among$SII("er", -1, 1), new Among$SII("ous", -1, 1), new Among$SII("ant", -1, 1), new Among$SII("ent", -1, 1), new Among$SII("ment", 15, 1), new Among$SII("ement", 16, 1), new Among$SII("ou", -1, 1) ];
+});
+$__jsx_lazy_init(PorterStemmer, "g_v", function () {
+ return [ 17, 65, 16, 1 ];
+});
+$__jsx_lazy_init(PorterStemmer, "g_v_WXY", function () {
+ return [ 1, 17, 65, 208, 1 ];
+});
+NorwegianStemmer.serialVersionUID = 1;
+$__jsx_lazy_init(NorwegianStemmer, "methodObject", function () {
+ return new NorwegianStemmer$();
+});
+$__jsx_lazy_init(NorwegianStemmer, "a_0", function () {
+ return [ new Among$SII("a", -1, 1), new Among$SII("e", -1, 1), new Among$SII("ede", 1, 1), new Among$SII("ande", 1, 1), new Among$SII("ende", 1, 1), new Among$SII("ane", 1, 1), new Among$SII("ene", 1, 1), new Among$SII("hetene", 6, 1), new Among$SII("erte", 1, 3), new Among$SII("en", -1, 1), new Among$SII("heten", 9, 1), new Among$SII("ar", -1, 1), new Among$SII("er", -1, 1), new Among$SII("heter", 12, 1), new Among$SII("s", -1, 2), new Among$SII("as", 14, 1), new Among$SII("es", 14, 1), new Among$SII("edes", 16, 1), new Among$SII("endes", 16, 1), new Among$SII("enes", 16, 1), new Among$SII("hetenes", 19, 1), new Among$SII("ens", 14, 1), new Among$SII("hetens", 21, 1), new Among$SII("ers", 14, 1), new Among$SII("ets", 14, 1), new Among$SII("et", -1, 1), new Among$SII("het", 25, 1), new Among$SII("ert", -1, 3), new Among$SII("ast", -1, 1) ];
+});
+$__jsx_lazy_init(NorwegianStemmer, "a_1", function () {
+ return [ new Among$SII("dt", -1, -1), new Among$SII("vt", -1, -1) ];
+});
+$__jsx_lazy_init(NorwegianStemmer, "a_2", function () {
+ return [ new Among$SII("leg", -1, 1), new Among$SII("eleg", 0, 1), new Among$SII("ig", -1, 1), new Among$SII("eig", 2, 1), new Among$SII("lig", 2, 1), new Among$SII("elig", 4, 1), new Among$SII("els", -1, 1), new Among$SII("lov", -1, 1), new Among$SII("elov", 7, 1), new Among$SII("slov", 7, 1), new Among$SII("hetslov", 9, 1) ];
+});
+$__jsx_lazy_init(NorwegianStemmer, "g_v", function () {
+ return [ 17, 65, 16, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 48, 0, 128 ];
+});
+$__jsx_lazy_init(NorwegianStemmer, "g_s_ending", function () {
+ return [ 119, 125, 149, 1 ];
+});
+ItalianStemmer.serialVersionUID = 1;
+$__jsx_lazy_init(ItalianStemmer, "methodObject", function () {
+ return new ItalianStemmer$();
+});
+$__jsx_lazy_init(ItalianStemmer, "a_0", function () {
+ return [ new Among$SII("", -1, 7), new Among$SII("qu", 0, 6), new Among$SII("\u00E1", 0, 1), new Among$SII("\u00E9", 0, 2), new Among$SII("\u00ED", 0, 3), new Among$SII("\u00F3", 0, 4), new Among$SII("\u00FA", 0, 5) ];
+});
+$__jsx_lazy_init(ItalianStemmer, "a_1", function () {
+ return [ new Among$SII("", -1, 3), new Among$SII("I", 0, 1), new Among$SII("U", 0, 2) ];
+});
+$__jsx_lazy_init(ItalianStemmer, "a_2", function () {
+ return [ new Among$SII("la", -1, -1), new Among$SII("cela", 0, -1), new Among$SII("gliela", 0, -1), new Among$SII("mela", 0, -1), new Among$SII("tela", 0, -1), new Among$SII("vela", 0, -1), new Among$SII("le", -1, -1), new Among$SII("cele", 6, -1), new Among$SII("gliele", 6, -1), new Among$SII("mele", 6, -1), new Among$SII("tele", 6, -1), new Among$SII("vele", 6, -1), new Among$SII("ne", -1, -1), new Among$SII("cene", 12, -1), new Among$SII("gliene", 12, -1), new Among$SII("mene", 12, -1), new Among$SII("sene", 12, -1), new Among$SII("tene", 12, -1), new Among$SII("vene", 12, -1), new Among$SII("ci", -1, -1), new Among$SII("li", -1, -1), new Among$SII("celi", 20, -1), new Among$SII("glieli", 20, -1), new Among$SII("meli", 20, -1), new Among$SII("teli", 20, -1), new Among$SII("veli", 20, -1), new Among$SII("gli", 20, -1), new Among$SII("mi", -1, -1), new Among$SII("si", -1, -1), new Among$SII("ti", -1, -1), new Among$SII("vi", -1, -1), new Among$SII("lo", -1, -1), new Among$SII("celo", 31, -1), new Among$SII("glielo", 31, -1), new Among$SII("melo", 31, -1), new Among$SII("telo", 31, -1), new Among$SII("velo", 31, -1) ];
+});
+$__jsx_lazy_init(ItalianStemmer, "a_3", function () {
+ return [ new Among$SII("ando", -1, 1), new Among$SII("endo", -1, 1), new Among$SII("ar", -1, 2), new Among$SII("er", -1, 2), new Among$SII("ir", -1, 2) ];
+});
+$__jsx_lazy_init(ItalianStemmer, "a_4", function () {
+ return [ new Among$SII("ic", -1, -1), new Among$SII("abil", -1, -1), new Among$SII("os", -1, -1), new Among$SII("iv", -1, 1) ];
+});
+$__jsx_lazy_init(ItalianStemmer, "a_5", function () {
+ return [ new Among$SII("ic", -1, 1), new Among$SII("abil", -1, 1), new Among$SII("iv", -1, 1) ];
+});
+$__jsx_lazy_init(ItalianStemmer, "a_6", function () {
+ return [ new Among$SII("ica", -1, 1), new Among$SII("logia", -1, 3), new Among$SII("osa", -1, 1), new Among$SII("ista", -1, 1), new Among$SII("iva", -1, 9), new Among$SII("anza", -1, 1), new Among$SII("enza", -1, 5), new Among$SII("ice", -1, 1), new Among$SII("atrice", 7, 1), new Among$SII("iche", -1, 1), new Among$SII("logie", -1, 3), new Among$SII("abile", -1, 1), new Among$SII("ibile", -1, 1), new Among$SII("usione", -1, 4), new Among$SII("azione", -1, 2), new Among$SII("uzione", -1, 4), new Among$SII("atore", -1, 2), new Among$SII("ose", -1, 1), new Among$SII("ante", -1, 1), new Among$SII("mente", -1, 1), new Among$SII("amente", 19, 7), new Among$SII("iste", -1, 1), new Among$SII("ive", -1, 9), new Among$SII("anze", -1, 1), new Among$SII("enze", -1, 5), new Among$SII("ici", -1, 1), new Among$SII("atrici", 25, 1), new Among$SII("ichi", -1, 1), new Among$SII("abili", -1, 1), new Among$SII("ibili", -1, 1), new Among$SII("ismi", -1, 1), new Among$SII("usioni", -1, 4), new Among$SII("azioni", -1, 2), new Among$SII("uzioni", -1, 4), new Among$SII("atori", -1, 2), new Among$SII("osi", -1, 1), new Among$SII("anti", -1, 1), new Among$SII("amenti", -1, 6), new Among$SII("imenti", -1, 6), new Among$SII("isti", -1, 1), new Among$SII("ivi", -1, 9), new Among$SII("ico", -1, 1), new Among$SII("ismo", -1, 1), new Among$SII("oso", -1, 1), new Among$SII("amento", -1, 6), new Among$SII("imento", -1, 6), new Among$SII("ivo", -1, 9), new Among$SII("it\u00E0", -1, 8), new Among$SII("ist\u00E0", -1, 1), new Among$SII("ist\u00E8", -1, 1), new Among$SII("ist\u00EC", -1, 1) ];
+});
+$__jsx_lazy_init(ItalianStemmer, "a_7", function () {
+ return [ new Among$SII("isca", -1, 1), new Among$SII("enda", -1, 1), new Among$SII("ata", -1, 1), new Among$SII("ita", -1, 1), new Among$SII("uta", -1, 1), new Among$SII("ava", -1, 1), new Among$SII("eva", -1, 1), new Among$SII("iva", -1, 1), new Among$SII("erebbe", -1, 1), new Among$SII("irebbe", -1, 1), new Among$SII("isce", -1, 1), new Among$SII("ende", -1, 1), new Among$SII("are", -1, 1), new Among$SII("ere", -1, 1), new Among$SII("ire", -1, 1), new Among$SII("asse", -1, 1), new Among$SII("ate", -1, 1), new Among$SII("avate", 16, 1), new Among$SII("evate", 16, 1), new Among$SII("ivate", 16, 1), new Among$SII("ete", -1, 1), new Among$SII("erete", 20, 1), new Among$SII("irete", 20, 1), new Among$SII("ite", -1, 1), new Among$SII("ereste", -1, 1), new Among$SII("ireste", -1, 1), new Among$SII("ute", -1, 1), new Among$SII("erai", -1, 1), new Among$SII("irai", -1, 1), new Among$SII("isci", -1, 1), new Among$SII("endi", -1, 1), new Among$SII("erei", -1, 1), new Among$SII("irei", -1, 1), new Among$SII("assi", -1, 1), new Among$SII("ati", -1, 1), new Among$SII("iti", -1, 1), new Among$SII("eresti", -1, 1), new Among$SII("iresti", -1, 1), new Among$SII("uti", -1, 1), new Among$SII("avi", -1, 1), new Among$SII("evi", -1, 1), new Among$SII("ivi", -1, 1), new Among$SII("isco", -1, 1), new Among$SII("ando", -1, 1), new Among$SII("endo", -1, 1), new Among$SII("Yamo", -1, 1), new Among$SII("iamo", -1, 1), new Among$SII("avamo", -1, 1), new Among$SII("evamo", -1, 1), new Among$SII("ivamo", -1, 1), new Among$SII("eremo", -1, 1), new Among$SII("iremo", -1, 1), new Among$SII("assimo", -1, 1), new Among$SII("ammo", -1, 1), new Among$SII("emmo", -1, 1), new Among$SII("eremmo", 54, 1), new Among$SII("iremmo", 54, 1), new Among$SII("immo", -1, 1), new Among$SII("ano", -1, 1), new Among$SII("iscano", 58, 1), new Among$SII("avano", 58, 1), new Among$SII("evano", 58, 1), new Among$SII("ivano", 58, 1), new Among$SII("eranno", -1, 1), new Among$SII("iranno", -1, 1), new Among$SII("ono", -1, 1), new Among$SII("iscono", 65, 1), new Among$SII("arono", 65, 1), new Among$SII("erono", 65, 1), new Among$SII("irono", 65, 1), new Among$SII("erebbero", -1, 1), new Among$SII("irebbero", -1, 1), new Among$SII("assero", -1, 1), new Among$SII("essero", -1, 1), new Among$SII("issero", -1, 1), new Among$SII("ato", -1, 1), new Among$SII("ito", -1, 1), new Among$SII("uto", -1, 1), new Among$SII("avo", -1, 1), new Among$SII("evo", -1, 1), new Among$SII("ivo", -1, 1), new Among$SII("ar", -1, 1), new Among$SII("ir", -1, 1), new Among$SII("er\u00E0", -1, 1), new Among$SII("ir\u00E0", -1, 1), new Among$SII("er\u00F2", -1, 1), new Among$SII("ir\u00F2", -1, 1) ];
+});
+$__jsx_lazy_init(ItalianStemmer, "g_v", function () {
+ return [ 17, 65, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128, 128, 8, 2, 1 ];
+});
+$__jsx_lazy_init(ItalianStemmer, "g_AEIO", function () {
+ return [ 17, 65, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128, 128, 8, 2 ];
+});
+$__jsx_lazy_init(ItalianStemmer, "g_CG", function () {
+ return [ 17 ];
+});
+HungarianStemmer.serialVersionUID = 1;
+$__jsx_lazy_init(HungarianStemmer, "methodObject", function () {
+ return new HungarianStemmer$();
+});
+$__jsx_lazy_init(HungarianStemmer, "a_0", function () {
+ return [ new Among$SII("cs", -1, -1), new Among$SII("dzs", -1, -1), new Among$SII("gy", -1, -1), new Among$SII("ly", -1, -1), new Among$SII("ny", -1, -1), new Among$SII("sz", -1, -1), new Among$SII("ty", -1, -1), new Among$SII("zs", -1, -1) ];
+});
+$__jsx_lazy_init(HungarianStemmer, "a_1", function () {
+ return [ new Among$SII("\u00E1", -1, 1), new Among$SII("\u00E9", -1, 2) ];
+});
+$__jsx_lazy_init(HungarianStemmer, "a_2", function () {
+ return [ new Among$SII("bb", -1, -1), new Among$SII("cc", -1, -1), new Among$SII("dd", -1, -1), new Among$SII("ff", -1, -1), new Among$SII("gg", -1, -1), new Among$SII("jj", -1, -1), new Among$SII("kk", -1, -1), new Among$SII("ll", -1, -1), new Among$SII("mm", -1, -1), new Among$SII("nn", -1, -1), new Among$SII("pp", -1, -1), new Among$SII("rr", -1, -1), new Among$SII("ccs", -1, -1), new Among$SII("ss", -1, -1), new Among$SII("zzs", -1, -1), new Among$SII("tt", -1, -1), new Among$SII("vv", -1, -1), new Among$SII("ggy", -1, -1), new Among$SII("lly", -1, -1), new Among$SII("nny", -1, -1), new Among$SII("tty", -1, -1), new Among$SII("ssz", -1, -1), new Among$SII("zz", -1, -1) ];
+});
+$__jsx_lazy_init(HungarianStemmer, "a_3", function () {
+ return [ new Among$SII("al", -1, 1), new Among$SII("el", -1, 2) ];
+});
+$__jsx_lazy_init(HungarianStemmer, "a_4", function () {
+ return [ new Among$SII("ba", -1, -1), new Among$SII("ra", -1, -1), new Among$SII("be", -1, -1), new Among$SII("re", -1, -1), new Among$SII("ig", -1, -1), new Among$SII("nak", -1, -1), new Among$SII("nek", -1, -1), new Among$SII("val", -1, -1), new Among$SII("vel", -1, -1), new Among$SII("ul", -1, -1), new Among$SII("n\u00E1l", -1, -1), new Among$SII("n\u00E9l", -1, -1), new Among$SII("b\u00F3l", -1, -1), new Among$SII("r\u00F3l", -1, -1), new Among$SII("t\u00F3l", -1, -1), new Among$SII("b\u00F5l", -1, -1), new Among$SII("r\u00F5l", -1, -1), new Among$SII("t\u00F5l", -1, -1), new Among$SII("\u00FCl", -1, -1), new Among$SII("n", -1, -1), new Among$SII("an", 19, -1), new Among$SII("ban", 20, -1), new Among$SII("en", 19, -1), new Among$SII("ben", 22, -1), new Among$SII("k\u00E9ppen", 22, -1), new Among$SII("on", 19, -1), new Among$SII("\u00F6n", 19, -1), new Among$SII("k\u00E9pp", -1, -1), new Among$SII("kor", -1, -1), new Among$SII("t", -1, -1), new Among$SII("at", 29, -1), new Among$SII("et", 29, -1), new Among$SII("k\u00E9nt", 29, -1), new Among$SII("ank\u00E9nt", 32, -1), new Among$SII("enk\u00E9nt", 32, -1), new Among$SII("onk\u00E9nt", 32, -1), new Among$SII("ot", 29, -1), new Among$SII("\u00E9rt", 29, -1), new Among$SII("\u00F6t", 29, -1), new Among$SII("hez", -1, -1), new Among$SII("hoz", -1, -1), new Among$SII("h\u00F6z", -1, -1), new Among$SII("v\u00E1", -1, -1), new Among$SII("v\u00E9", -1, -1) ];
+});
+$__jsx_lazy_init(HungarianStemmer, "a_5", function () {
+ return [ new Among$SII("\u00E1n", -1, 2), new Among$SII("\u00E9n", -1, 1), new Among$SII("\u00E1nk\u00E9nt", -1, 3) ];
+});
+$__jsx_lazy_init(HungarianStemmer, "a_6", function () {
+ return [ new Among$SII("stul", -1, 2), new Among$SII("astul", 0, 1), new Among$SII("\u00E1stul", 0, 3), new Among$SII("st\u00FCl", -1, 2), new Among$SII("est\u00FCl", 3, 1), new Among$SII("\u00E9st\u00FCl", 3, 4) ];
+});
+$__jsx_lazy_init(HungarianStemmer, "a_7", function () {
+ return [ new Among$SII("\u00E1", -1, 1), new Among$SII("\u00E9", -1, 2) ];
+});
+$__jsx_lazy_init(HungarianStemmer, "a_8", function () {
+ return [ new Among$SII("k", -1, 7), new Among$SII("ak", 0, 4), new Among$SII("ek", 0, 6), new Among$SII("ok", 0, 5), new Among$SII("\u00E1k", 0, 1), new Among$SII("\u00E9k", 0, 2), new Among$SII("\u00F6k", 0, 3) ];
+});
+$__jsx_lazy_init(HungarianStemmer, "a_9", function () {
+ return [ new Among$SII("\u00E9i", -1, 7), new Among$SII("\u00E1\u00E9i", 0, 6), new Among$SII("\u00E9\u00E9i", 0, 5), new Among$SII("\u00E9", -1, 9), new Among$SII("k\u00E9", 3, 4), new Among$SII("ak\u00E9", 4, 1), new Among$SII("ek\u00E9", 4, 1), new Among$SII("ok\u00E9", 4, 1), new Among$SII("\u00E1k\u00E9", 4, 3), new Among$SII("\u00E9k\u00E9", 4, 2), new Among$SII("\u00F6k\u00E9", 4, 1), new Among$SII("\u00E9\u00E9", 3, 8) ];
+});
+$__jsx_lazy_init(HungarianStemmer, "a_10", function () {
+ return [ new Among$SII("a", -1, 18), new Among$SII("ja", 0, 17), new Among$SII("d", -1, 16), new Among$SII("ad", 2, 13), new Among$SII("ed", 2, 13), new Among$SII("od", 2, 13), new Among$SII("\u00E1d", 2, 14), new Among$SII("\u00E9d", 2, 15), new Among$SII("\u00F6d", 2, 13), new Among$SII("e", -1, 18), new Among$SII("je", 9, 17), new Among$SII("nk", -1, 4), new Among$SII("unk", 11, 1), new Among$SII("\u00E1nk", 11, 2), new Among$SII("\u00E9nk", 11, 3), new Among$SII("\u00FCnk", 11, 1), new Among$SII("uk", -1, 8), new Among$SII("juk", 16, 7), new Among$SII("\u00E1juk", 17, 5), new Among$SII("\u00FCk", -1, 8), new Among$SII("j\u00FCk", 19, 7), new Among$SII("\u00E9j\u00FCk", 20, 6), new Among$SII("m", -1, 12), new Among$SII("am", 22, 9), new Among$SII("em", 22, 9), new Among$SII("om", 22, 9), new Among$SII("\u00E1m", 22, 10), new Among$SII("\u00E9m", 22, 11), new Among$SII("o", -1, 18), new Among$SII("\u00E1", -1, 19), new Among$SII("\u00E9", -1, 20) ];
+});
+$__jsx_lazy_init(HungarianStemmer, "a_11", function () {
+ return [ new Among$SII("id", -1, 10), new Among$SII("aid", 0, 9), new Among$SII("jaid", 1, 6), new Among$SII("eid", 0, 9), new Among$SII("jeid", 3, 6), new Among$SII("\u00E1id", 0, 7), new Among$SII("\u00E9id", 0, 8), new Among$SII("i", -1, 15), new Among$SII("ai", 7, 14), new Among$SII("jai", 8, 11), new Among$SII("ei", 7, 14), new Among$SII("jei", 10, 11), new Among$SII("\u00E1i", 7, 12), new Among$SII("\u00E9i", 7, 13), new Among$SII("itek", -1, 24), new Among$SII("eitek", 14, 21), new Among$SII("jeitek", 15, 20), new Among$SII("\u00E9itek", 14, 23), new Among$SII("ik", -1, 29), new Among$SII("aik", 18, 26), new Among$SII("jaik", 19, 25), new Among$SII("eik", 18, 26), new Among$SII("jeik", 21, 25), new Among$SII("\u00E1ik", 18, 27), new Among$SII("\u00E9ik", 18, 28), new Among$SII("ink", -1, 20), new Among$SII("aink", 25, 17), new Among$SII("jaink", 26, 16), new Among$SII("eink", 25, 17), new Among$SII("jeink", 28, 16), new Among$SII("\u00E1ink", 25, 18), new Among$SII("\u00E9ink", 25, 19), new Among$SII("aitok", -1, 21), new Among$SII("jaitok", 32, 20), new Among$SII("\u00E1itok", -1, 22), new Among$SII("im", -1, 5), new Among$SII("aim", 35, 4), new Among$SII("jaim", 36, 1), new Among$SII("eim", 35, 4), new Among$SII("jeim", 38, 1), new Among$SII("\u00E1im", 35, 2), new Among$SII("\u00E9im", 35, 3) ];
+});
+$__jsx_lazy_init(HungarianStemmer, "g_v", function () {
+ return [ 17, 65, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 17, 52, 14 ];
+});
+GermanStemmer.serialVersionUID = 1;
+$__jsx_lazy_init(GermanStemmer, "methodObject", function () {
+ return new GermanStemmer$();
+});
+$__jsx_lazy_init(GermanStemmer, "a_0", function () {
+ return [ new Among$SII("", -1, 6), new Among$SII("U", 0, 2), new Among$SII("Y", 0, 1), new Among$SII("\u00E4", 0, 3), new Among$SII("\u00F6", 0, 4), new Among$SII("\u00FC", 0, 5) ];
+});
+$__jsx_lazy_init(GermanStemmer, "a_1", function () {
+ return [ new Among$SII("e", -1, 2), new Among$SII("em", -1, 1), new Among$SII("en", -1, 2), new Among$SII("ern", -1, 1), new Among$SII("er", -1, 1), new Among$SII("s", -1, 3), new Among$SII("es", 5, 2) ];
+});
+$__jsx_lazy_init(GermanStemmer, "a_2", function () {
+ return [ new Among$SII("en", -1, 1), new Among$SII("er", -1, 1), new Among$SII("st", -1, 2), new Among$SII("est", 2, 1) ];
+});
+$__jsx_lazy_init(GermanStemmer, "a_3", function () {
+ return [ new Among$SII("ig", -1, 1), new Among$SII("lich", -1, 1) ];
+});
+$__jsx_lazy_init(GermanStemmer, "a_4", function () {
+ return [ new Among$SII("end", -1, 1), new Among$SII("ig", -1, 2), new Among$SII("ung", -1, 1), new Among$SII("lich", -1, 3), new Among$SII("isch", -1, 2), new Among$SII("ik", -1, 2), new Among$SII("heit", -1, 3), new Among$SII("keit", -1, 4) ];
+});
+$__jsx_lazy_init(GermanStemmer, "g_v", function () {
+ return [ 17, 65, 16, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 32, 8 ];
+});
+$__jsx_lazy_init(GermanStemmer, "g_s_ending", function () {
+ return [ 117, 30, 5 ];
+});
+$__jsx_lazy_init(GermanStemmer, "g_st_ending", function () {
+ return [ 117, 30, 4 ];
+});
+FrenchStemmer.serialVersionUID = 1;
+$__jsx_lazy_init(FrenchStemmer, "methodObject", function () {
+ return new FrenchStemmer$();
+});
+$__jsx_lazy_init(FrenchStemmer, "a_0", function () {
+ return [ new Among$SII("col", -1, -1), new Among$SII("par", -1, -1), new Among$SII("tap", -1, -1) ];
+});
+$__jsx_lazy_init(FrenchStemmer, "a_1", function () {
+ return [ new Among$SII("", -1, 4), new Among$SII("I", 0, 1), new Among$SII("U", 0, 2), new Among$SII("Y", 0, 3) ];
+});
+$__jsx_lazy_init(FrenchStemmer, "a_2", function () {
+ return [ new Among$SII("iqU", -1, 3), new Among$SII("abl", -1, 3), new Among$SII("I\u00E8r", -1, 4), new Among$SII("i\u00E8r", -1, 4), new Among$SII("eus", -1, 2), new Among$SII("iv", -1, 1) ];
+});
+$__jsx_lazy_init(FrenchStemmer, "a_3", function () {
+ return [ new Among$SII("ic", -1, 2), new Among$SII("abil", -1, 1), new Among$SII("iv", -1, 3) ];
+});
+$__jsx_lazy_init(FrenchStemmer, "a_4", function () {
+ return [ new Among$SII("iqUe", -1, 1), new Among$SII("atrice", -1, 2), new Among$SII("ance", -1, 1), new Among$SII("ence", -1, 5), new Among$SII("logie", -1, 3), new Among$SII("able", -1, 1), new Among$SII("isme", -1, 1), new Among$SII("euse", -1, 11), new Among$SII("iste", -1, 1), new Among$SII("ive", -1, 8), new Among$SII("if", -1, 8), new Among$SII("usion", -1, 4), new Among$SII("ation", -1, 2), new Among$SII("ution", -1, 4), new Among$SII("ateur", -1, 2), new Among$SII("iqUes", -1, 1), new Among$SII("atrices", -1, 2), new Among$SII("ances", -1, 1), new Among$SII("ences", -1, 5), new Among$SII("logies", -1, 3), new Among$SII("ables", -1, 1), new Among$SII("ismes", -1, 1), new Among$SII("euses", -1, 11), new Among$SII("istes", -1, 1), new Among$SII("ives", -1, 8), new Among$SII("ifs", -1, 8), new Among$SII("usions", -1, 4), new Among$SII("ations", -1, 2), new Among$SII("utions", -1, 4), new Among$SII("ateurs", -1, 2), new Among$SII("ments", -1, 15), new Among$SII("ements", 30, 6), new Among$SII("issements", 31, 12), new Among$SII("it\u00E9s", -1, 7), new Among$SII("ment", -1, 15), new Among$SII("ement", 34, 6), new Among$SII("issement", 35, 12), new Among$SII("amment", 34, 13), new Among$SII("emment", 34, 14), new Among$SII("aux", -1, 10), new Among$SII("eaux", 39, 9), new Among$SII("eux", -1, 1), new Among$SII("it\u00E9", -1, 7) ];
+});
+$__jsx_lazy_init(FrenchStemmer, "a_5", function () {
+ return [ new Among$SII("ira", -1, 1), new Among$SII("ie", -1, 1), new Among$SII("isse", -1, 1), new Among$SII("issante", -1, 1), new Among$SII("i", -1, 1), new Among$SII("irai", 4, 1), new Among$SII("ir", -1, 1), new Among$SII("iras", -1, 1), new Among$SII("ies", -1, 1), new Among$SII("\u00EEmes", -1, 1), new Among$SII("isses", -1, 1), new Among$SII("issantes", -1, 1), new Among$SII("\u00EEtes", -1, 1), new Among$SII("is", -1, 1), new Among$SII("irais", 13, 1), new Among$SII("issais", 13, 1), new Among$SII("irions", -1, 1), new Among$SII("issions", -1, 1), new Among$SII("irons", -1, 1), new Among$SII("issons", -1, 1), new Among$SII("issants", -1, 1), new Among$SII("it", -1, 1), new Among$SII("irait", 21, 1), new Among$SII("issait", 21, 1), new Among$SII("issant", -1, 1), new Among$SII("iraIent", -1, 1), new Among$SII("issaIent", -1, 1), new Among$SII("irent", -1, 1), new Among$SII("issent", -1, 1), new Among$SII("iront", -1, 1), new Among$SII("\u00EEt", -1, 1), new Among$SII("iriez", -1, 1), new Among$SII("issiez", -1, 1), new Among$SII("irez", -1, 1), new Among$SII("issez", -1, 1) ];
+});
+$__jsx_lazy_init(FrenchStemmer, "a_6", function () {
+ return [ new Among$SII("a", -1, 3), new Among$SII("era", 0, 2), new Among$SII("asse", -1, 3), new Among$SII("ante", -1, 3), new Among$SII("\u00E9e", -1, 2), new Among$SII("ai", -1, 3), new Among$SII("erai", 5, 2), new Among$SII("er", -1, 2), new Among$SII("as", -1, 3), new Among$SII("eras", 8, 2), new Among$SII("\u00E2mes", -1, 3), new Among$SII("asses", -1, 3), new Among$SII("antes", -1, 3), new Among$SII("\u00E2tes", -1, 3), new Among$SII("\u00E9es", -1, 2), new Among$SII("ais", -1, 3), new Among$SII("erais", 15, 2), new Among$SII("ions", -1, 1), new Among$SII("erions", 17, 2), new Among$SII("assions", 17, 3), new Among$SII("erons", -1, 2), new Among$SII("ants", -1, 3), new Among$SII("\u00E9s", -1, 2), new Among$SII("ait", -1, 3), new Among$SII("erait", 23, 2), new Among$SII("ant", -1, 3), new Among$SII("aIent", -1, 3), new Among$SII("eraIent", 26, 2), new Among$SII("\u00E8rent", -1, 2), new Among$SII("assent", -1, 3), new Among$SII("eront", -1, 2), new Among$SII("\u00E2t", -1, 3), new Among$SII("ez", -1, 2), new Among$SII("iez", 32, 2), new Among$SII("eriez", 33, 2), new Among$SII("assiez", 33, 3), new Among$SII("erez", 32, 2), new Among$SII("\u00E9", -1, 2) ];
+});
+$__jsx_lazy_init(FrenchStemmer, "a_7", function () {
+ return [ new Among$SII("e", -1, 3), new Among$SII("I\u00E8re", 0, 2), new Among$SII("i\u00E8re", 0, 2), new Among$SII("ion", -1, 1), new Among$SII("Ier", -1, 2), new Among$SII("ier", -1, 2), new Among$SII("\u00EB", -1, 4) ];
+});
+$__jsx_lazy_init(FrenchStemmer, "a_8", function () {
+ return [ new Among$SII("ell", -1, -1), new Among$SII("eill", -1, -1), new Among$SII("enn", -1, -1), new Among$SII("onn", -1, -1), new Among$SII("ett", -1, -1) ];
+});
+$__jsx_lazy_init(FrenchStemmer, "g_v", function () {
+ return [ 17, 65, 16, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128, 130, 103, 8, 5 ];
+});
+$__jsx_lazy_init(FrenchStemmer, "g_keep_with_s", function () {
+ return [ 1, 65, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128 ];
+});
+FinnishStemmer.serialVersionUID = 1;
+$__jsx_lazy_init(FinnishStemmer, "methodObject", function () {
+ return new FinnishStemmer$();
+});
+$__jsx_lazy_init(FinnishStemmer, "a_0", function () {
+ return [ new Among$SII("pa", -1, 1), new Among$SII("sti", -1, 2), new Among$SII("kaan", -1, 1), new Among$SII("han", -1, 1), new Among$SII("kin", -1, 1), new Among$SII("h\u00E4n", -1, 1), new Among$SII("k\u00E4\u00E4n", -1, 1), new Among$SII("ko", -1, 1), new Among$SII("p\u00E4", -1, 1), new Among$SII("k\u00F6", -1, 1) ];
+});
+$__jsx_lazy_init(FinnishStemmer, "a_1", function () {
+ return [ new Among$SII("lla", -1, -1), new Among$SII("na", -1, -1), new Among$SII("ssa", -1, -1), new Among$SII("ta", -1, -1), new Among$SII("lta", 3, -1), new Among$SII("sta", 3, -1) ];
+});
+$__jsx_lazy_init(FinnishStemmer, "a_2", function () {
+ return [ new Among$SII("ll\u00E4", -1, -1), new Among$SII("n\u00E4", -1, -1), new Among$SII("ss\u00E4", -1, -1), new Among$SII("t\u00E4", -1, -1), new Among$SII("lt\u00E4", 3, -1), new Among$SII("st\u00E4", 3, -1) ];
+});
+$__jsx_lazy_init(FinnishStemmer, "a_3", function () {
+ return [ new Among$SII("lle", -1, -1), new Among$SII("ine", -1, -1) ];
+});
+$__jsx_lazy_init(FinnishStemmer, "a_4", function () {
+ return [ new Among$SII("nsa", -1, 3), new Among$SII("mme", -1, 3), new Among$SII("nne", -1, 3), new Among$SII("ni", -1, 2), new Among$SII("si", -1, 1), new Among$SII("an", -1, 4), new Among$SII("en", -1, 6), new Among$SII("\u00E4n", -1, 5), new Among$SII("ns\u00E4", -1, 3) ];
+});
+$__jsx_lazy_init(FinnishStemmer, "a_5", function () {
+ return [ new Among$SII("aa", -1, -1), new Among$SII("ee", -1, -1), new Among$SII("ii", -1, -1), new Among$SII("oo", -1, -1), new Among$SII("uu", -1, -1), new Among$SII("\u00E4\u00E4", -1, -1), new Among$SII("\u00F6\u00F6", -1, -1) ];
+});
+$__jsx_lazy_init(FinnishStemmer, "a_6", function () {
+ return [ new Among$SII("a", -1, 8), new Among$SII("lla", 0, -1), new Among$SII("na", 0, -1), new Among$SII("ssa", 0, -1), new Among$SII("ta", 0, -1), new Among$SII("lta", 4, -1), new Among$SII("sta", 4, -1), new Among$SII("tta", 4, 9), new Among$SII("lle", -1, -1), new Among$SII("ine", -1, -1), new Among$SII("ksi", -1, -1), new Among$SII("n", -1, 7), new Among$SII("han", 11, 1), new Among$SIIF$LBaseStemmer$B$LBaseStemmer$("den", 11, -1, (function (instance) {
+ return instance.r_VI$();
+ }), FinnishStemmer.methodObject), new Among$SIIF$LBaseStemmer$B$LBaseStemmer$("seen", 11, -1, (function (instance) {
+ return instance.r_LONG$();
+ }), FinnishStemmer.methodObject), new Among$SII("hen", 11, 2), new Among$SIIF$LBaseStemmer$B$LBaseStemmer$("tten", 11, -1, (function (instance) {
+ return instance.r_VI$();
+ }), FinnishStemmer.methodObject), new Among$SII("hin", 11, 3), new Among$SIIF$LBaseStemmer$B$LBaseStemmer$("siin", 11, -1, (function (instance) {
+ return instance.r_VI$();
+ }), FinnishStemmer.methodObject), new Among$SII("hon", 11, 4), new Among$SII("h\u00E4n", 11, 5), new Among$SII("h\u00F6n", 11, 6), new Among$SII("\u00E4", -1, 8), new Among$SII("ll\u00E4", 22, -1), new Among$SII("n\u00E4", 22, -1), new Among$SII("ss\u00E4", 22, -1), new Among$SII("t\u00E4", 22, -1), new Among$SII("lt\u00E4", 26, -1), new Among$SII("st\u00E4", 26, -1), new Among$SII("tt\u00E4", 26, 9) ];
+});
+$__jsx_lazy_init(FinnishStemmer, "a_7", function () {
+ return [ new Among$SII("eja", -1, -1), new Among$SII("mma", -1, 1), new Among$SII("imma", 1, -1), new Among$SII("mpa", -1, 1), new Among$SII("impa", 3, -1), new Among$SII("mmi", -1, 1), new Among$SII("immi", 5, -1), new Among$SII("mpi", -1, 1), new Among$SII("impi", 7, -1), new Among$SII("ej\u00E4", -1, -1), new Among$SII("mm\u00E4", -1, 1), new Among$SII("imm\u00E4", 10, -1), new Among$SII("mp\u00E4", -1, 1), new Among$SII("imp\u00E4", 12, -1) ];
+});
+$__jsx_lazy_init(FinnishStemmer, "a_8", function () {
+ return [ new Among$SII("i", -1, -1), new Among$SII("j", -1, -1) ];
+});
+$__jsx_lazy_init(FinnishStemmer, "a_9", function () {
+ return [ new Among$SII("mma", -1, 1), new Among$SII("imma", 0, -1) ];
+});
+$__jsx_lazy_init(FinnishStemmer, "g_AEI", function () {
+ return [ 17, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8 ];
+});
+$__jsx_lazy_init(FinnishStemmer, "g_V1", function () {
+ return [ 17, 65, 16, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 32 ];
+});
+$__jsx_lazy_init(FinnishStemmer, "g_V2", function () {
+ return [ 17, 65, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 32 ];
+});
+$__jsx_lazy_init(FinnishStemmer, "g_particle_end", function () {
+ return [ 17, 97, 24, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 32 ];
+});
+EnglishStemmer.serialVersionUID = 1;
+$__jsx_lazy_init(EnglishStemmer, "methodObject", function () {
+ return new EnglishStemmer$();
+});
+$__jsx_lazy_init(EnglishStemmer, "a_0", function () {
+ return [ new Among$SII("arsen", -1, -1), new Among$SII("commun", -1, -1), new Among$SII("gener", -1, -1) ];
+});
+$__jsx_lazy_init(EnglishStemmer, "a_1", function () {
+ return [ new Among$SII("'", -1, 1), new Among$SII("'s'", 0, 1), new Among$SII("'s", -1, 1) ];
+});
+$__jsx_lazy_init(EnglishStemmer, "a_2", function () {
+ return [ new Among$SII("ied", -1, 2), new Among$SII("s", -1, 3), new Among$SII("ies", 1, 2), new Among$SII("sses", 1, 1), new Among$SII("ss", 1, -1), new Among$SII("us", 1, -1) ];
+});
+$__jsx_lazy_init(EnglishStemmer, "a_3", function () {
+ return [ new Among$SII("", -1, 3), new Among$SII("bb", 0, 2), new Among$SII("dd", 0, 2), new Among$SII("ff", 0, 2), new Among$SII("gg", 0, 2), new Among$SII("bl", 0, 1), new Among$SII("mm", 0, 2), new Among$SII("nn", 0, 2), new Among$SII("pp", 0, 2), new Among$SII("rr", 0, 2), new Among$SII("at", 0, 1), new Among$SII("tt", 0, 2), new Among$SII("iz", 0, 1) ];
+});
+$__jsx_lazy_init(EnglishStemmer, "a_4", function () {
+ return [ new Among$SII("ed", -1, 2), new Among$SII("eed", 0, 1), new Among$SII("ing", -1, 2), new Among$SII("edly", -1, 2), new Among$SII("eedly", 3, 1), new Among$SII("ingly", -1, 2) ];
+});
+$__jsx_lazy_init(EnglishStemmer, "a_5", function () {
+ return [ new Among$SII("anci", -1, 3), new Among$SII("enci", -1, 2), new Among$SII("ogi", -1, 13), new Among$SII("li", -1, 16), new Among$SII("bli", 3, 12), new Among$SII("abli", 4, 4), new Among$SII("alli", 3, 8), new Among$SII("fulli", 3, 14), new Among$SII("lessli", 3, 15), new Among$SII("ousli", 3, 10), new Among$SII("entli", 3, 5), new Among$SII("aliti", -1, 8), new Among$SII("biliti", -1, 12), new Among$SII("iviti", -1, 11), new Among$SII("tional", -1, 1), new Among$SII("ational", 14, 7), new Among$SII("alism", -1, 8), new Among$SII("ation", -1, 7), new Among$SII("ization", 17, 6), new Among$SII("izer", -1, 6), new Among$SII("ator", -1, 7), new Among$SII("iveness", -1, 11), new Among$SII("fulness", -1, 9), new Among$SII("ousness", -1, 10) ];
+});
+$__jsx_lazy_init(EnglishStemmer, "a_6", function () {
+ return [ new Among$SII("icate", -1, 4), new Among$SII("ative", -1, 6), new Among$SII("alize", -1, 3), new Among$SII("iciti", -1, 4), new Among$SII("ical", -1, 4), new Among$SII("tional", -1, 1), new Among$SII("ational", 5, 2), new Among$SII("ful", -1, 5), new Among$SII("ness", -1, 5) ];
+});
+$__jsx_lazy_init(EnglishStemmer, "a_7", function () {
+ return [ new Among$SII("ic", -1, 1), new Among$SII("ance", -1, 1), new Among$SII("ence", -1, 1), new Among$SII("able", -1, 1), new Among$SII("ible", -1, 1), new Among$SII("ate", -1, 1), new Among$SII("ive", -1, 1), new Among$SII("ize", -1, 1), new Among$SII("iti", -1, 1), new Among$SII("al", -1, 1), new Among$SII("ism", -1, 1), new Among$SII("ion", -1, 2), new Among$SII("er", -1, 1), new Among$SII("ous", -1, 1), new Among$SII("ant", -1, 1), new Among$SII("ent", -1, 1), new Among$SII("ment", 15, 1), new Among$SII("ement", 16, 1) ];
+});
+$__jsx_lazy_init(EnglishStemmer, "a_8", function () {
+ return [ new Among$SII("e", -1, 1), new Among$SII("l", -1, 2) ];
+});
+$__jsx_lazy_init(EnglishStemmer, "a_9", function () {
+ return [ new Among$SII("succeed", -1, -1), new Among$SII("proceed", -1, -1), new Among$SII("exceed", -1, -1), new Among$SII("canning", -1, -1), new Among$SII("inning", -1, -1), new Among$SII("earring", -1, -1), new Among$SII("herring", -1, -1), new Among$SII("outing", -1, -1) ];
+});
+$__jsx_lazy_init(EnglishStemmer, "a_10", function () {
+ return [ new Among$SII("andes", -1, -1), new Among$SII("atlas", -1, -1), new Among$SII("bias", -1, -1), new Among$SII("cosmos", -1, -1), new Among$SII("dying", -1, 3), new Among$SII("early", -1, 9), new Among$SII("gently", -1, 7), new Among$SII("howe", -1, -1), new Among$SII("idly", -1, 6), new Among$SII("lying", -1, 4), new Among$SII("news", -1, -1), new Among$SII("only", -1, 10), new Among$SII("singly", -1, 11), new Among$SII("skies", -1, 2), new Among$SII("skis", -1, 1), new Among$SII("sky", -1, -1), new Among$SII("tying", -1, 5), new Among$SII("ugly", -1, 8) ];
+});
+$__jsx_lazy_init(EnglishStemmer, "g_v", function () {
+ return [ 17, 65, 16, 1 ];
+});
+$__jsx_lazy_init(EnglishStemmer, "g_v_WXY", function () {
+ return [ 1, 17, 65, 208, 1 ];
+});
+$__jsx_lazy_init(EnglishStemmer, "g_valid_LI", function () {
+ return [ 55, 141, 2 ];
+});
+DutchStemmer.serialVersionUID = 1;
+$__jsx_lazy_init(DutchStemmer, "methodObject", function () {
+ return new DutchStemmer$();
+});
+$__jsx_lazy_init(DutchStemmer, "a_0", function () {
+ return [ new Among$SII("", -1, 6), new Among$SII("\u00E1", 0, 1), new Among$SII("\u00E4", 0, 1), new Among$SII("\u00E9", 0, 2), new Among$SII("\u00EB", 0, 2), new Among$SII("\u00ED", 0, 3), new Among$SII("\u00EF", 0, 3), new Among$SII("\u00F3", 0, 4), new Among$SII("\u00F6", 0, 4), new Among$SII("\u00FA", 0, 5), new Among$SII("\u00FC", 0, 5) ];
+});
+$__jsx_lazy_init(DutchStemmer, "a_1", function () {
+ return [ new Among$SII("", -1, 3), new Among$SII("I", 0, 2), new Among$SII("Y", 0, 1) ];
+});
+$__jsx_lazy_init(DutchStemmer, "a_2", function () {
+ return [ new Among$SII("dd", -1, -1), new Among$SII("kk", -1, -1), new Among$SII("tt", -1, -1) ];
+});
+$__jsx_lazy_init(DutchStemmer, "a_3", function () {
+ return [ new Among$SII("ene", -1, 2), new Among$SII("se", -1, 3), new Among$SII("en", -1, 2), new Among$SII("heden", 2, 1), new Among$SII("s", -1, 3) ];
+});
+$__jsx_lazy_init(DutchStemmer, "a_4", function () {
+ return [ new Among$SII("end", -1, 1), new Among$SII("ig", -1, 2), new Among$SII("ing", -1, 1), new Among$SII("lijk", -1, 3), new Among$SII("baar", -1, 4), new Among$SII("bar", -1, 5) ];
+});
+$__jsx_lazy_init(DutchStemmer, "a_5", function () {
+ return [ new Among$SII("aa", -1, -1), new Among$SII("ee", -1, -1), new Among$SII("oo", -1, -1), new Among$SII("uu", -1, -1) ];
+});
+$__jsx_lazy_init(DutchStemmer, "g_v", function () {
+ return [ 17, 65, 16, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128 ];
+});
+$__jsx_lazy_init(DutchStemmer, "g_v_I", function () {
+ return [ 1, 0, 0, 17, 65, 16, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128 ];
+});
+$__jsx_lazy_init(DutchStemmer, "g_v_j", function () {
+ return [ 17, 67, 16, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128 ];
+});
+DanishStemmer.serialVersionUID = 1;
+$__jsx_lazy_init(DanishStemmer, "methodObject", function () {
+ return new DanishStemmer$();
+});
+$__jsx_lazy_init(DanishStemmer, "a_0", function () {
+ return [ new Among$SII("hed", -1, 1), new Among$SII("ethed", 0, 1), new Among$SII("ered", -1, 1), new Among$SII("e", -1, 1), new Among$SII("erede", 3, 1), new Among$SII("ende", 3, 1), new Among$SII("erende", 5, 1), new Among$SII("ene", 3, 1), new Among$SII("erne", 3, 1), new Among$SII("ere", 3, 1), new Among$SII("en", -1, 1), new Among$SII("heden", 10, 1), new Among$SII("eren", 10, 1), new Among$SII("er", -1, 1), new Among$SII("heder", 13, 1), new Among$SII("erer", 13, 1), new Among$SII("s", -1, 2), new Among$SII("heds", 16, 1), new Among$SII("es", 16, 1), new Among$SII("endes", 18, 1), new Among$SII("erendes", 19, 1), new Among$SII("enes", 18, 1), new Among$SII("ernes", 18, 1), new Among$SII("eres", 18, 1), new Among$SII("ens", 16, 1), new Among$SII("hedens", 24, 1), new Among$SII("erens", 24, 1), new Among$SII("ers", 16, 1), new Among$SII("ets", 16, 1), new Among$SII("erets", 28, 1), new Among$SII("et", -1, 1), new Among$SII("eret", 30, 1) ];
+});
+$__jsx_lazy_init(DanishStemmer, "a_1", function () {
+ return [ new Among$SII("gd", -1, -1), new Among$SII("dt", -1, -1), new Among$SII("gt", -1, -1), new Among$SII("kt", -1, -1) ];
+});
+$__jsx_lazy_init(DanishStemmer, "a_2", function () {
+ return [ new Among$SII("ig", -1, 1), new Among$SII("lig", 0, 1), new Among$SII("elig", 1, 1), new Among$SII("els", -1, 1), new Among$SII("l\u00F8st", -1, 2) ];
+});
+$__jsx_lazy_init(DanishStemmer, "g_v", function () {
+ return [ 17, 65, 16, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 48, 0, 128 ];
+});
+$__jsx_lazy_init(DanishStemmer, "g_s_ending", function () {
+ return [ 239, 254, 42, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16 ];
+});
+BitVector.SMALL_BLOCK_SIZE = 32;
+BitVector.LARGE_BLOCK_SIZE = 256;
+BitVector.BLOCK_RATE = 8;
+$__jsx_lazy_init(BurrowsWheelerTransform, "END_MARKER", function () {
+ return String.fromCharCode(0);
+});
+var $__jsx_classMap = {
+ "tool/oktavia-mkindex.jsx": {
+ _Main: _Main,
+ _Main$: _Main$
+ },
+ "system:lib/js/js/nodejs.jsx": {
+ node: node,
+ node$: node$
+ },
+ "src/oktavia.jsx": {
+ Oktavia: Oktavia,
+ Oktavia$: Oktavia$
+ },
+ "src/getopt.jsx": {
+ CommandOption: CommandOption,
+ CommandOption$S: CommandOption$S,
+ CommandOption$SS: CommandOption$SS,
+ CommandOption$SSB: CommandOption$SSB,
+ BasicParser: BasicParser,
+ BasicParser$SAS: BasicParser$SAS
+ },
+ "src/htmlparser.jsx": {
+ TagFilter: TagFilter,
+ TagFilter$AS: TagFilter$AS,
+ HTMLParser: HTMLParser,
+ HTMLParser$ISSASLStemmer$: HTMLParser$ISSASLStemmer$,
+ _HTMLHandler: _HTMLHandler,
+ _HTMLHandler$LOktavia$SILTagFilter$: _HTMLHandler$LOktavia$SILTagFilter$
+ },
+ "src/csvparser.jsx": {
+ CSVParser: CSVParser,
+ CSVParser$SLStemmer$: CSVParser$SLStemmer$
+ },
+ "src/textparser.jsx": {
+ TextParser: TextParser,
+ TextParser$SSLStemmer$: TextParser$SSLStemmer$
+ },
+ "src/binary-util.jsx": {
+ Binary: Binary,
+ Binary$: Binary$,
+ LoadedStringResult: LoadedStringResult,
+ LoadedStringResult$SI: LoadedStringResult$SI,
+ LoadedStringListResult: LoadedStringListResult,
+ LoadedStringListResult$SI: LoadedStringListResult$SI,
+ LoadedStringListMapResult: LoadedStringListMapResult,
+ LoadedStringListMapResult$SI: LoadedStringListMapResult$SI,
+ LoadedNumberListResult: LoadedNumberListResult,
+ LoadedNumberListResult$SI: LoadedNumberListResult$SI,
+ CompressionReport: CompressionReport,
+ CompressionReport$: CompressionReport$
+ },
+ "src/stemmer/stemmer.jsx": {
+ Stemmer: Stemmer,
+ Stemmer$: Stemmer$
+ },
+ "system:lib/js/js.jsx": {
+ js: js,
+ js$: js$
+ },
+ "src/metadata.jsx": {
+ Metadata: Metadata,
+ Metadata$LOktavia$: Metadata$LOktavia$,
+ Section: Section,
+ Section$LOktavia$: Section$LOktavia$,
+ Splitter: Splitter,
+ Splitter$LOktavia$: Splitter$LOktavia$,
+ Splitter$LOktavia$S: Splitter$LOktavia$S,
+ Table: Table,
+ Table$LOktavia$AS: Table$LOktavia$AS,
+ Block: Block,
+ Block$LOktavia$: Block$LOktavia$
+ },
+ "src/fm-index.jsx": {
+ FMIndex: FMIndex,
+ FMIndex$: FMIndex$
+ },
+ "src/query.jsx": {
+ Query: Query,
+ Query$: Query$
+ },
+ "src/search-result.jsx": {
+ Proposal: Proposal,
+ Proposal$II: Proposal$II,
+ Position: Position,
+ Position$SIB: Position$SIB,
+ SearchUnit: SearchUnit,
+ SearchUnit$I: SearchUnit$I,
+ SingleResult: SingleResult,
+ SingleResult$: SingleResult$,
+ SingleResult$SBB: SingleResult$SBB,
+ SearchSummary: SearchSummary,
+ SearchSummary$: SearchSummary$,
+ SearchSummary$LOktavia$: SearchSummary$LOktavia$
+ },
+ "src/sax.jsx": {
+ Tag: Tag,
+ Tag$S: Tag$S,
+ _Common: _Common,
+ _Common$: _Common$,
+ _State: _State,
+ _State$: _State$,
+ SAXHandler: SAXHandler,
+ SAXHandler$: SAXHandler$,
+ SAXParser: SAXParser,
+ SAXParser$LSAXHandler$: SAXParser$LSAXHandler$,
+ SAXParser$LSAXHandler$B: SAXParser$LSAXHandler$B,
+ Char: Char,
+ Char$: Char$,
+ _Entities: _Entities,
+ _Entities$: _Entities$
+ },
+ "src/stemmer/base-stemmer.jsx": {
+ BaseStemmer: BaseStemmer,
+ BaseStemmer$: BaseStemmer$
+ },
+ "src/stemmer/turkish-stemmer.jsx": {
+ TurkishStemmer: TurkishStemmer,
+ TurkishStemmer$: TurkishStemmer$
+ },
+ "src/stemmer/swedish-stemmer.jsx": {
+ SwedishStemmer: SwedishStemmer,
+ SwedishStemmer$: SwedishStemmer$
+ },
+ "src/stemmer/spanish-stemmer.jsx": {
+ SpanishStemmer: SpanishStemmer,
+ SpanishStemmer$: SpanishStemmer$
+ },
+ "src/stemmer/russian-stemmer.jsx": {
+ RussianStemmer: RussianStemmer,
+ RussianStemmer$: RussianStemmer$
+ },
+ "src/stemmer/romanian-stemmer.jsx": {
+ RomanianStemmer: RomanianStemmer,
+ RomanianStemmer$: RomanianStemmer$
+ },
+ "src/stemmer/portuguese-stemmer.jsx": {
+ PortugueseStemmer: PortugueseStemmer,
+ PortugueseStemmer$: PortugueseStemmer$
+ },
+ "src/stemmer/porter-stemmer.jsx": {
+ PorterStemmer: PorterStemmer,
+ PorterStemmer$: PorterStemmer$
+ },
+ "src/stemmer/norwegian-stemmer.jsx": {
+ NorwegianStemmer: NorwegianStemmer,
+ NorwegianStemmer$: NorwegianStemmer$
+ },
+ "src/stemmer/italian-stemmer.jsx": {
+ ItalianStemmer: ItalianStemmer,
+ ItalianStemmer$: ItalianStemmer$
+ },
+ "src/stemmer/hungarian-stemmer.jsx": {
+ HungarianStemmer: HungarianStemmer,
+ HungarianStemmer$: HungarianStemmer$
+ },
+ "src/stemmer/german-stemmer.jsx": {
+ GermanStemmer: GermanStemmer,
+ GermanStemmer$: GermanStemmer$
+ },
+ "src/stemmer/french-stemmer.jsx": {
+ FrenchStemmer: FrenchStemmer,
+ FrenchStemmer$: FrenchStemmer$
+ },
+ "src/stemmer/finnish-stemmer.jsx": {
+ FinnishStemmer: FinnishStemmer,
+ FinnishStemmer$: FinnishStemmer$
+ },
+ "src/stemmer/english-stemmer.jsx": {
+ EnglishStemmer: EnglishStemmer,
+ EnglishStemmer$: EnglishStemmer$
+ },
+ "src/stemmer/dutch-stemmer.jsx": {
+ DutchStemmer: DutchStemmer,
+ DutchStemmer$: DutchStemmer$
+ },
+ "src/stemmer/danish-stemmer.jsx": {
+ DanishStemmer: DanishStemmer,
+ DanishStemmer$: DanishStemmer$
+ },
+ "src/stemmer/among.jsx": {
+ Among: Among,
+ Among$SII: Among$SII,
+ Among$SIIF$LBaseStemmer$B$LBaseStemmer$: Among$SIIF$LBaseStemmer$B$LBaseStemmer$
+ },
+ "src/bit-vector.jsx": {
+ BitVector: BitVector,
+ BitVector$: BitVector$
+ },
+ "src/wavelet-matrix.jsx": {
+ WaveletMatrix: WaveletMatrix,
+ WaveletMatrix$: WaveletMatrix$
+ },
+ "src/burrows-wheeler-transform.jsx": {
+ BurrowsWheelerTransform: BurrowsWheelerTransform,
+ BurrowsWheelerTransform$: BurrowsWheelerTransform$
+ },
+ "src/sais.jsx": {
+ OArray: OArray,
+ OArray$AI: OArray$AI,
+ OArray$AII: OArray$AII,
+ SAIS: SAIS,
+ SAIS$: SAIS$
+ }
+};
+
+
+/**
+ * launches _Main.main(:string[]):void invoked by jsx --run|--executable
+ */
+JSX.runMain = function (sourceFile, args) {
+ var module = JSX.require(sourceFile);
+ if (! module) {
+ throw new ReferenceError("entry point module not found in " + sourceFile);
+ }
+ if (! module._Main) {
+ throw new ReferenceError("entry point _Main not found in " + sourceFile);
+ }
+ if (! module._Main.main$AS) {
+ throw new ReferenceError("entry point _Main.main(:string[]):void not found in " + sourceFile);
+ }
+ module._Main.main$AS(args);
+};
+
+/**
+ * launches _Test#test*():void invoked by jsx --test
+ */
+JSX.runTests = function (sourceFile, tests) {
+ var module = JSX.require(sourceFile);
+ var testClass = module._Test$;
+
+ if (!testClass) return; // skip if there's no test class
+
+ if(tests.length === 0) {
+ var p = testClass.prototype;
+ for (var m in p) {
+ if (p[m] instanceof Function
+ && /^test.*[$]$/.test(m)) {
+ tests.push(m);
+ }
+ }
+ }
+ else { // set as process arguments
+ tests = tests.map(function (name) {
+ return name + "$"; // mangle for function test*():void
+ });
+ }
+
+ var testCase = new testClass();
+
+ if (testCase.beforeClass$AS != null)
+ testCase.beforeClass$AS(tests);
+
+ for (var i = 0; i < tests.length; ++i) {
+ (function (method) {
+ if (method in testCase) {
+ testCase.run$SF$V$(method, function() { testCase[method](); });
+ }
+ else {
+ throw new ReferenceError("No such test method: " + method);
+ }
+ }(tests[i]));
+ }
+
+ if (testCase.afterClass$ != null)
+ testCase.afterClass$();
+};
+JSX.runMain("tool/oktavia-mkindex.jsx", process.argv.slice(2))
+})(JSX);
diff --git a/web/server/h2o/libh2o/misc/oktavia/bin/oktavia-search b/web/server/h2o/libh2o/misc/oktavia/bin/oktavia-search
new file mode 100755
index 00000000..33edd769
--- /dev/null
+++ b/web/server/h2o/libh2o/misc/oktavia/bin/oktavia-search
@@ -0,0 +1,24779 @@
+#!/usr/bin/env node
+// generatedy by JSX compiler 0.9.24 (2013-04-05 13:45:00 +0900; 1b229cc6a411f674f0f7cf7a79b7a8b3f8eb7414)
+var JSX = {};
+(function (JSX) {
+/**
+ * copies the implementations from source interface to target
+ */
+function $__jsx_merge_interface(target, source) {
+ for (var k in source.prototype)
+ if (source.prototype.hasOwnProperty(k))
+ target.prototype[k] = source.prototype[k];
+}
+
+/**
+ * defers the initialization of the property
+ */
+function $__jsx_lazy_init(obj, prop, func) {
+ function reset(obj, prop, value) {
+ delete obj[prop];
+ obj[prop] = value;
+ return value;
+ }
+
+ Object.defineProperty(obj, prop, {
+ get: function () {
+ return reset(obj, prop, func());
+ },
+ set: function (v) {
+ reset(obj, prop, v);
+ },
+ enumerable: true,
+ configurable: true
+ });
+}
+
+/**
+ * sideeffect().a /= b
+ */
+function $__jsx_div_assign(obj, prop, divisor) {
+ return obj[prop] = (obj[prop] / divisor) | 0;
+}
+
+/*
+ * global functions, renamed to avoid conflict with local variable names
+ */
+var $__jsx_parseInt = parseInt;
+var $__jsx_parseFloat = parseFloat;
+var $__jsx_isNaN = isNaN;
+var $__jsx_isFinite = isFinite;
+
+var $__jsx_encodeURIComponent = encodeURIComponent;
+var $__jsx_decodeURIComponent = decodeURIComponent;
+var $__jsx_encodeURI = encodeURI;
+var $__jsx_decodeURI = decodeURI;
+
+var $__jsx_ObjectToString = Object.prototype.toString;
+var $__jsx_ObjectHasOwnProperty = Object.prototype.hasOwnProperty;
+
+/*
+ * profiler object, initialized afterwards
+ */
+function $__jsx_profiler() {
+}
+
+/*
+ * public interface to JSX code
+ */
+JSX.require = function (path) {
+ var m = $__jsx_classMap[path];
+ return m !== undefined ? m : null;
+};
+
+JSX.profilerIsRunning = function () {
+ return $__jsx_profiler.getResults != null;
+};
+
+JSX.getProfileResults = function () {
+ return ($__jsx_profiler.getResults || function () { return {}; })();
+};
+
+JSX.postProfileResults = function (url, cb) {
+ if ($__jsx_profiler.postResults == null)
+ throw new Error("profiler has not been turned on");
+ return $__jsx_profiler.postResults(url, cb);
+};
+
+JSX.resetProfileResults = function () {
+ if ($__jsx_profiler.resetResults == null)
+ throw new Error("profiler has not been turned on");
+ return $__jsx_profiler.resetResults();
+};
+JSX.DEBUG = false;
+/**
+ * class Search extends Object
+ * @constructor
+ */
+function Search() {
+}
+
+/**
+ * @constructor
+ */
+function Search$() {
+ this.style = null;
+};
+
+Search$.prototype = new Search;
+
+/**
+ * @param {Search} $this
+ * @param {!string} indexFile
+ * @param {Array.<undefined|!string>} queryStrings
+ * @param {!number} num
+ * @param {Style} style
+ * @param {undefined|!string} algorithm
+ */
+Search.search$LSearch$SASILStyle$US = function ($this, indexFile, queryStrings, num, style, algorithm) {
+ /** @type {Oktavia} */
+ var oktavia;
+ /** @type {QueryParser} */
+ var queryParser;
+ /** @type {SearchSummary} */
+ var summary;
+ /** @type {Stemmer} */
+ var stemmer$0;
+ $this.style = style;
+ oktavia = new Oktavia$();
+ if (algorithm != null) {
+ stemmer$0 = Search$createStemmer$LSearch$S($this, algorithm);
+ oktavia._stemmer = stemmer$0;
+ }
+ if (! Search$loadIndex$LSearch$LOktavia$S($this, oktavia, indexFile)) {
+ return;
+ }
+ console.time('searching');
+ queryParser = ({queries: [ ]});
+ QueryParser$parse$LQueryParser$AS(queryParser, queryStrings);
+ summary = oktavia.search$ALQuery$(queryParser.queries);
+ console.timeEnd('searching');
+ if (SearchSummary$size$LSearchSummary$(summary) === 0) {
+ Search$notFound$LSearch$LSearchSummary$AS($this, summary, queryStrings);
+ } else {
+ Search$showResult$LSearch$LOktavia$LSearchSummary$I($this, oktavia, summary, num);
+ }
+};
+
+var Search$search$LSearch$SASILStyle$US = Search.search$LSearch$SASILStyle$US;
+
+/**
+ * @param {Search} $this
+ * @param {Oktavia} oktavia
+ * @param {!string} filepath
+ * @return {!boolean}
+ */
+Search.loadIndex$LSearch$LOktavia$S = function ($this, oktavia, filepath) {
+ /** @type {!string} */
+ var ext;
+ /** @type {!string} */
+ var content;
+ /** @type {!boolean} */
+ var result;
+ /** @type {!number} */
+ var index;
+ /** @type {!number} */
+ var lastIndex;
+ ext = node.path.extname(filepath);
+ result = true;
+ switch (ext) {
+ case ".okt":
+ content = node.fs.readFileSync(filepath, "utf16le");
+ oktavia.load$S(content);
+ break;
+ case ".b64":
+ content = node.fs.readFileSync(filepath, "utf8");
+ oktavia.load$S(Binary$base64decode$S(content));
+ break;
+ case ".js":
+ content = node.fs.readFileSync(filepath, "utf8");
+ index = content.indexOf('"');
+ lastIndex = content.lastIndexOf('"');
+ oktavia.load$S(Binary$base64decode$S(content.slice(index, lastIndex)));
+ break;
+ default:
+ console.log("unknown file extension: " + ext);
+ result = false;
+ break;
+ }
+ return result;
+};
+
+var Search$loadIndex$LSearch$LOktavia$S = Search.loadIndex$LSearch$LOktavia$S;
+
+/**
+ * @param {Search} $this
+ * @param {Oktavia} oktavia
+ * @param {SearchSummary} summary
+ * @return {Array.<undefined|SearchUnit>}
+ */
+Search.sortResult$LSearch$LOktavia$LSearchSummary$ = function ($this, oktavia, summary) {
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var score;
+ /** @type {SearchUnit} */
+ var unit;
+ /** @type {!string} */
+ var pos;
+ /** @type {Position} */
+ var position;
+ for (i = 0; i < summary.result.units.length; i++) {
+ score = 0;
+ unit = summary.result.units[i];
+ for (pos in unit.positions) {
+ position = unit.positions[pos];
+ if (oktavia.wordPositionType$I(position.position)) {
+ score += 10;
+ } else {
+ score += 1;
+ }
+ if (! position.stemmed) {
+ score += 2;
+ }
+ }
+ unit.score = (score | 0);
+ }
+ return SearchSummary$getSortedResult$LSearchSummary$(summary);
+};
+
+var Search$sortResult$LSearch$LOktavia$LSearchSummary$ = Search.sortResult$LSearch$LOktavia$LSearchSummary$;
+
+/**
+ * @param {Search} $this
+ * @param {Oktavia} oktavia
+ * @param {SearchSummary} summary
+ * @param {!number} num
+ */
+Search.showResult$LSearch$LOktavia$LSearchSummary$I = function ($this, oktavia, summary, num) {
+ /** @type {Array.<undefined|SearchUnit>} */
+ var results;
+ /** @type {Style} */
+ var style;
+ /** @type {Metadata} */
+ var metadata;
+ /** @type {!number} */
+ var i;
+ /** @type {SearchUnit} */
+ var unit;
+ /** @type {Array.<undefined|!string>} */
+ var info;
+ /** @type {!string} */
+ var content;
+ /** @type {!number} */
+ var start;
+ /** @type {Array.<undefined|Position>} */
+ var positions;
+ /** @type {!number} */
+ var end;
+ /** @type {!boolean} */
+ var split;
+ /** @type {!number} */
+ var j;
+ /** @type {Position} */
+ var pos;
+ /** @type {!string} */
+ var text;
+ /** @type {!number} */
+ var position$0;
+ results = Search$sortResult$LSearch$LOktavia$LSearchSummary$($this, oktavia, summary);
+ style = $this.style;
+ metadata = oktavia._metadatas[oktavia._metadataLabels[0]];
+ for (i = 0; i < results.length; i++) {
+ unit = results[i];
+ info = metadata.getInformation$I(unit.id).split(Oktavia.eob);
+ console.log(style.convert$S('<title>' + info[0] + '</title>') + ' ' + style.convert$S('<url>' + info[1] + '</url>'));
+ content = metadata.getContent$I(unit.id);
+ start = 0;
+ positions = SearchUnit$getPositions$LSearchUnit$(unit);
+ if (content.indexOf(info[0]) === 1) {
+ content = content.slice(info[0].length + 2, content.length);
+ start += info[0].length + 2;
+ }
+ end = start + num;
+ split = false;
+ if (positions[0].position > end - positions[0].word.length) {
+ end = positions[0].position + Math.floor(num / 2);
+ split = true;
+ }
+ for (j = positions.length - 1; j > -1; j--) {
+ pos = positions[j];
+ if (pos.position + pos.word.length < end) {
+ content = [ content.slice(0, pos.position - start), style.convert$S('<hit>*</hit>').replace('*', content.slice((position$0 = pos.position) - start, position$0 + pos.word.length - start)), content.slice(pos.position + pos.word.length - start, content.length) ].join('');
+ }
+ }
+ if (split) {
+ text = [ content.slice(0, Math.floor(num / 2)) + ' ...', content.slice(- Math.floor(num / 2), end - start) ].join('\n');
+ } else {
+ text = content.slice(0, end - start) + ' ...\n';
+ }
+ text = text.replace(Oktavia.eob, ' ').replace(/\n\n+/, '\n\n');
+ console.log(text);
+ }
+ console.log(style.convert$S('<summary>' + (SearchSummary$size$LSearchSummary$(summary) + "") + " results.</summary>\n"));
+};
+
+var Search$showResult$LSearch$LOktavia$LSearchSummary$I = Search.showResult$LSearch$LOktavia$LSearchSummary$I;
+
+/**
+ * @param {Search} $this
+ * @param {SearchSummary} summary
+ * @param {Array.<undefined|!string>} query
+ */
+Search.notFound$LSearch$LSearchSummary$AS = function ($this, summary, query) {
+ /** @type {Style} */
+ var style;
+ /** @type {Array.<undefined|Proposal>} */
+ var proposals;
+ /** @type {!number} */
+ var i;
+ /** @type {Proposal} */
+ var proposal;
+ /** @type {Array.<undefined|!string>} */
+ var querywords;
+ /** @type {!number} */
+ var j;
+ style = $this.style;
+ if (query.length > 1) {
+ console.log("Suggestions:");
+ proposals = SearchSummary$getProposal$LSearchSummary$(summary);
+ for (i = 0; i < proposals.length; i++) {
+ proposal = proposals[i];
+ querywords = [ ];
+ for (j = 0; j < query.length; j++) {
+ if (j !== proposal.omit) {
+ querywords.push(style.convert$S('<hit>' + query[j] + '</hit>'));
+ }
+ }
+ console.log("* Expected result: " + querywords.join(" ") + " - " + (proposal.expect + "") + " hit");
+ }
+ } else {
+ console.log(style.convert$S("Your search - <hit>" + query[0] + "</hit> - didn't match any documents."));
+ }
+};
+
+var Search$notFound$LSearch$LSearchSummary$AS = Search.notFound$LSearch$LSearchSummary$AS;
+
+/**
+ * @param {Search} $this
+ * @param {!string} algorithm
+ * @return {Stemmer}
+ */
+Search.createStemmer$LSearch$S = function ($this, algorithm) {
+ /** @type {Stemmer} */
+ var stemmer;
+ switch (algorithm.toLowerCase()) {
+ case "danish":
+ stemmer = new DanishStemmer$();
+ break;
+ case "dutch":
+ stemmer = new DutchStemmer$();
+ break;
+ case "english":
+ stemmer = new EnglishStemmer$();
+ break;
+ case "finnish":
+ stemmer = new FinnishStemmer$();
+ break;
+ case "french":
+ stemmer = new FrenchStemmer$();
+ break;
+ case "german":
+ stemmer = new GermanStemmer$();
+ break;
+ case "hungarian":
+ stemmer = new HungarianStemmer$();
+ break;
+ case "italian":
+ stemmer = new ItalianStemmer$();
+ break;
+ case "norwegian":
+ stemmer = new NorwegianStemmer$();
+ break;
+ case "porter":
+ stemmer = new PorterStemmer$();
+ break;
+ case "portuguese":
+ stemmer = new PortugueseStemmer$();
+ break;
+ case "romanian":
+ stemmer = new RomanianStemmer$();
+ break;
+ case "russian":
+ stemmer = new RussianStemmer$();
+ break;
+ case "spanish":
+ stemmer = new SpanishStemmer$();
+ break;
+ case "swedish":
+ stemmer = new SwedishStemmer$();
+ break;
+ case "turkish":
+ stemmer = new TurkishStemmer$();
+ break;
+ default:
+ stemmer = new EnglishStemmer$();
+ break;
+ }
+ return stemmer;
+};
+
+var Search$createStemmer$LSearch$S = Search.createStemmer$LSearch$S;
+
+/**
+ * class _Main extends Object
+ * @constructor
+ */
+function _Main() {
+}
+
+/**
+ * @constructor
+ */
+function _Main$() {
+};
+
+_Main$.prototype = new _Main;
+
+/**
+ */
+_Main.usage$ = function () {
+ console.log([ "usage: oktavia_search index_file [options] query...", "", "Options:", " -m, --mono : Don't use color.", " -s, --stemmer [algorithm] : Select stemming algorithm.", " -n, --number [char number] : Result display number. Default value = 250", " -h, --help : Display this message.", "", "Search Query Syntax:", " word1 word2 : All words.", ' "word1 word2" : Exact words or phrase.', " word1 OR word2 : Any of these words.", " word1 -word2 : None of these words." ].join('\n'));
+};
+
+var _Main$usage$ = _Main.usage$;
+
+/**
+ * @param {Array.<undefined|!string>} args
+ */
+_Main.main$AS = function (args) {
+ /** @type {undefined|!string} */
+ var indexFile;
+ /** @type {!boolean} */
+ var showhelp;
+ /** @type {!boolean} */
+ var notrun;
+ /** @type {!string} */
+ var styleType;
+ /** @type {!number} */
+ var num;
+ /** @type {Array.<undefined|!string>} */
+ var queryStrings;
+ /** @type {undefined|!string} */
+ var algorithm;
+ /** @type {Array.<undefined|!string>} */
+ var validStemmers;
+ /** @type {BasicParser} */
+ var parser;
+ /** @type {CommandOption} */
+ var opt;
+ /** @type {Style} */
+ var style;
+ /** @type {Search} */
+ var search;
+ console.log("Search Engine Oktavia - Command-line Search Client\n");
+ indexFile = null;
+ showhelp = false;
+ notrun = false;
+ styleType = 'console';
+ num = 250;
+ queryStrings = [ ];
+ algorithm = null;
+ validStemmers = [ 'danish', 'dutch', 'english', 'finnish', 'french', 'german', 'hungarian', 'italian', 'norwegian', 'porter', 'portuguese', 'romanian', 'russian', 'spanish', 'swedish', 'turkish' ];
+ if (args.length === 0) {
+ showhelp = true;
+ } else {
+ if (! node.fs.existsSync(args[0])) {
+ console.error("Index file '" + args[0] + "' doesn't exist.");
+ notrun = true;
+ } else {
+ indexFile = args[0];
+ }
+ }
+ parser = new BasicParser$SAS("m(mono)s:(stemmer)n:(number)h(help)", args.slice(1));
+ opt = parser.getopt$();
+ while (opt) {
+ switch (opt.option) {
+ case "s":
+ if (validStemmers.indexOf(opt.optarg) === -1) {
+ console.error('Option s/stemmer is invalid.');
+ notrun = true;
+ } else {
+ algorithm = opt.optarg;
+ }
+ break;
+ case "m":
+ styleType = 'ignore';
+ break;
+ case "n":
+ num = opt.optarg | 0;
+ break;
+ case "h":
+ showhelp = true;
+ break;
+ default:
+ queryStrings.push(opt.option);
+ break;
+ }
+ opt = parser.getopt$();
+ }
+ if (showhelp || queryStrings.length === 0) {
+ console.log([ "usage: oktavia_search index_file [options] query...", "", "Options:", " -m, --mono : Don't use color.", " -s, --stemmer [algorithm] : Select stemming algorithm.", " -n, --number [char number] : Result display number. Default value = 250", " -h, --help : Display this message.", "", "Search Query Syntax:", " word1 word2 : All words.", ' "word1 word2" : Exact words or phrase.', " word1 OR word2 : Any of these words.", " word1 -word2 : None of these words." ].join('\n'));
+ } else {
+ if (! notrun) {
+ style = new Style$S(styleType);
+ search = ({style: null});
+ Search$search$LSearch$SASILStyle$US(search, indexFile, queryStrings, num, style, algorithm);
+ }
+ }
+};
+
+var _Main$main$AS = _Main.main$AS;
+
+/**
+ * class node extends Object
+ * @constructor
+ */
+function node() {
+}
+
+/**
+ * @constructor
+ */
+function node$() {
+};
+
+node$.prototype = new node;
+
+/**
+ * @param {!string} source
+ * @return {*}
+ */
+node.require$S = function (source) {
+ /** @type {!string} */
+ var src;
+ src = 'require(' + JSON.stringify(source) + ')';
+ return eval(src);
+};
+
+var node$require$S = node.require$S;
+
+/**
+ * class Oktavia extends Object
+ * @constructor
+ */
+function Oktavia() {
+}
+
+/**
+ * @constructor
+ */
+function Oktavia$() {
+ /** @type {Array.<undefined|!string>} */
+ var _utf162compressCode$0;
+ this._compressCode2utf16 = null;
+ this._fmindex = new FMIndex$();
+ this._metadatas = ({ });
+ this._metadataLabels = [ ];
+ this._stemmer = null;
+ this._stemmingResult = ({ });
+ _utf162compressCode$0 = this._utf162compressCode = [ Oktavia.eof, Oktavia.eob, Oktavia.unknown ];
+ _utf162compressCode$0.length = 65536;
+ this._compressCode2utf16 = [ Oktavia.eof, Oktavia.eob, Oktavia.unknown ];
+};
+
+Oktavia$.prototype = new Oktavia;
+
+/**
+ * @param {Stemmer} stemmer
+ */
+Oktavia.prototype.setStemmer$LStemmer$ = function (stemmer) {
+ this._stemmer = stemmer;
+};
+
+/**
+ * @return {Metadata}
+ */
+Oktavia.prototype.getPrimaryMetadata$ = function () {
+ return this._metadatas[this._metadataLabels[0]];
+};
+
+/**
+ * @param {!string} key
+ * @return {Section}
+ */
+Oktavia.prototype.addSection$S = function (key) {
+ /** @type {Section} */
+ var section;
+ if (this._metadataLabels.indexOf(key) !== -1) {
+ throw new Error('Metadata name ' + key + ' is already exists');
+ }
+ this._metadataLabels.push(key);
+ section = new Section$LOktavia$(this);
+ this._metadatas[key] = section;
+ return section;
+};
+
+/**
+ * @param {!string} key
+ * @return {Section}
+ */
+Oktavia.prototype.getSection$S = function (key) {
+ if (this._metadataLabels.indexOf(key) === -1) {
+ throw new Error('Metadata name ' + key + " does't exists");
+ }
+ return this._metadatas[key];
+};
+
+/**
+ * @param {!string} key
+ * @return {Splitter}
+ */
+Oktavia.prototype.addSplitter$S = function (key) {
+ /** @type {Splitter} */
+ var splitter;
+ if (this._metadataLabels.indexOf(key) !== -1) {
+ throw new Error('Metadata name ' + key + ' is already exists');
+ }
+ this._metadataLabels.push(key);
+ splitter = new Splitter$LOktavia$(this);
+ this._metadatas[key] = splitter;
+ return splitter;
+};
+
+/**
+ * @param {!string} key
+ * @return {Splitter}
+ */
+Oktavia.prototype.getSplitter$S = function (key) {
+ if (this._metadataLabels.indexOf(key) === -1) {
+ throw new Error('Metadata name ' + key + " does't exists");
+ }
+ return this._metadatas[key];
+};
+
+/**
+ * @param {!string} key
+ * @param {Array.<undefined|!string>} headers
+ * @return {Table}
+ */
+Oktavia.prototype.addTable$SAS = function (key, headers) {
+ /** @type {Table} */
+ var table;
+ if (this._metadataLabels.indexOf(key) !== -1) {
+ throw new Error('Metadata name ' + key + ' is already exists');
+ }
+ this._metadataLabels.push(key);
+ table = new Table$LOktavia$AS(this, headers);
+ this._metadatas[key] = table;
+ return table;
+};
+
+/**
+ * @param {!string} key
+ * @return {Table}
+ */
+Oktavia.prototype.getTable$S = function (key) {
+ if (this._metadataLabels.indexOf(key) === -1) {
+ throw new Error('Metadata name ' + key + " does't exists");
+ }
+ return this._metadatas[key];
+};
+
+/**
+ * @param {!string} key
+ * @return {Block}
+ */
+Oktavia.prototype.addBlock$S = function (key) {
+ /** @type {Block} */
+ var block;
+ if (this._metadataLabels.indexOf(key) !== -1) {
+ throw new Error('Metadata name ' + key + ' is already exists');
+ }
+ this._metadataLabels.push(key);
+ block = new Block$LOktavia$(this);
+ this._metadatas[key] = block;
+ return block;
+};
+
+/**
+ * @param {!string} key
+ * @return {Block}
+ */
+Oktavia.prototype.getBlock$S = function (key) {
+ if (this._metadataLabels.indexOf(key) === -1) {
+ throw new Error('Metadata name ' + key + " does't exists");
+ }
+ return this._metadatas[key];
+};
+
+/**
+ */
+Oktavia.prototype.addEndOfBlock$ = function () {
+ this._fmindex.push$S(Oktavia.eob);
+};
+
+/**
+ * @param {!string} words
+ */
+Oktavia.prototype.addWord$S = function (words) {
+ /** @type {Array.<undefined|!string>} */
+ var str;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var charCode;
+ /** @type {undefined|!string} */
+ var newCharCode;
+ str = [ ];
+ str.length = words.length;
+ for (i = 0; i < words.length; i++) {
+ charCode = words.charCodeAt(i);
+ newCharCode = this._utf162compressCode[charCode];
+ if (newCharCode == null) {
+ newCharCode = String.fromCharCode(this._compressCode2utf16.length);
+ this._utf162compressCode[charCode] = newCharCode;
+ this._compressCode2utf16.push(String.fromCharCode(charCode));
+ }
+ str.push(newCharCode);
+ }
+ this._fmindex.push$S(str.join(''));
+};
+
+/**
+ * @param {!string} words
+ * @param {!boolean} stemming
+ */
+Oktavia.prototype.addWord$SB = function (words, stemming) {
+ /** @type {Array.<undefined|!string>} */
+ var wordList;
+ /** @type {!number} */
+ var i;
+ /** @type {undefined|!string} */
+ var originalWord;
+ /** @type {!string} */
+ var smallWord;
+ /** @type {undefined|!string} */
+ var registerWord;
+ /** @type {!string} */
+ var baseWord;
+ /** @type {!string} */
+ var compressedCodeWord;
+ /** @type {Array.<undefined|!string>} */
+ var stemmedList;
+ this.addWord$S(words);
+ wordList = words.split(/\s+/);
+ for (i = 0; i < wordList.length; i++) {
+ originalWord = wordList[i];
+ smallWord = originalWord.slice(0, 1).toLowerCase() + originalWord.slice(1);
+ registerWord = null;
+ if (stemming && this._stemmer) {
+ baseWord = this._stemmer.stemWord$S(originalWord.toLowerCase());
+ if (originalWord.indexOf(baseWord) === -1) {
+ registerWord = baseWord;
+ }
+ } else {
+ if (originalWord != smallWord) {
+ registerWord = smallWord;
+ }
+ }
+ if (registerWord) {
+ compressedCodeWord = this._convertToCompressionCode$S(originalWord);
+ stemmedList = this._stemmingResult[registerWord];
+ if (! stemmedList) {
+ stemmedList = [ compressedCodeWord ];
+ this._stemmingResult[registerWord] = stemmedList;
+ } else {
+ if (stemmedList.indexOf(compressedCodeWord) === -1) {
+ stemmedList.push(compressedCodeWord);
+ }
+ }
+ }
+ }
+};
+
+/**
+ * @param {!string} keyword
+ * @return {!string}
+ */
+Oktavia.prototype._convertToCompressionCode$S = function (keyword) {
+ /** @type {Array.<undefined|!string>} */
+ var resultChars;
+ /** @type {!number} */
+ var i;
+ /** @type {undefined|!string} */
+ var chr;
+ resultChars = [ ];
+ for (i = 0; i < keyword.length; i++) {
+ chr = this._utf162compressCode[keyword.charCodeAt(i)];
+ if (chr == null) {
+ resultChars.push(Oktavia.unknown);
+ } else {
+ resultChars.push(chr);
+ }
+ }
+ return resultChars.join('');
+};
+
+/**
+ * @param {!string} keyword
+ * @param {!boolean} stemming
+ * @return {Array.<undefined|!number>}
+ */
+Oktavia.prototype.rawSearch$SB = function (keyword, stemming) {
+ /** @type {Array.<undefined|!number>} */
+ var result;
+ /** @type {!string} */
+ var baseWord;
+ /** @type {Array.<undefined|!string>} */
+ var stemmedList;
+ /** @type {!number} */
+ var i;
+ /** @type {undefined|!string} */
+ var word;
+ if (stemming) {
+ result = [ ];
+ if (this._stemmer) {
+ baseWord = this._stemmer.stemWord$S(keyword.toLowerCase());
+ stemmedList = this._stemmingResult[baseWord];
+ if (stemmedList) {
+ for (i = 0; i < stemmedList.length; i++) {
+ word = stemmedList[i];
+ result = result.concat(this._fmindex.search$S(word));
+ }
+ }
+ }
+ } else {
+ result = this._fmindex.search$S(this._convertToCompressionCode$S(keyword));
+ }
+ return result;
+};
+
+/**
+ * @param {Array.<undefined|Query>} queries
+ * @return {SearchSummary}
+ */
+Oktavia.prototype.search$ALQuery$ = function (queries) {
+ /** @type {SearchSummary} */
+ var summary;
+ /** @type {!number} */
+ var i;
+ /** @type {SingleResult} */
+ var result$0;
+ summary = ({sourceResults: [ ], result: null, oktavia: this});
+ for (i = 0; i < queries.length; i++) {
+ result$0 = this._searchQuery$LQuery$(queries[i]);
+ summary.sourceResults.push(result$0);
+ }
+ summary.result = SearchSummary$mergeResult$LSearchSummary$ALSingleResult$(summary, summary.sourceResults);
+ return summary;
+};
+
+/**
+ * @param {Query} query
+ * @return {SingleResult}
+ */
+Oktavia.prototype._searchQuery$LQuery$ = function (query) {
+ /** @type {SingleResult} */
+ var result;
+ /** @type {Array.<undefined|!number>} */
+ var positions;
+ result = new SingleResult$SBB(query.word, query.or, query.not);
+ if (query.raw) {
+ positions = this.rawSearch$SB(query.word, false);
+ } else {
+ positions = this.rawSearch$SB(query.word, false).concat(this.rawSearch$SB(query.word, true));
+ }
+ this._metadatas[this._metadataLabels[0]].grouping$LSingleResult$AISB(result, positions, query.word, ! query.raw);
+ return result;
+};
+
+/**
+ */
+Oktavia.prototype.build$ = function () {
+ this.build$IB(5, false);
+};
+
+/**
+ * @param {!number} cacheDensity
+ * @param {!boolean} verbose
+ */
+Oktavia.prototype.build$IB = function (cacheDensity, verbose) {
+ /** @type {!string} */
+ var key;
+ /** @type {!number} */
+ var cacheRange;
+ /** @type {!number} */
+ var maxChar;
+ for (key in this._metadatas) {
+ this._metadatas[key]._build$();
+ }
+ cacheRange = Math.round(Math.max(1, 100 / Math.min(100, Math.max(0.01, cacheDensity))));
+ maxChar = this._compressCode2utf16.length;
+ this._fmindex.build$SIIB(Oktavia.eof, maxChar, cacheRange, verbose);
+};
+
+/**
+ * @return {!string}
+ */
+Oktavia.prototype.dump$ = function () {
+ return this.dump$B(false);
+};
+
+/**
+ * @param {!boolean} verbose
+ * @return {!string}
+ */
+Oktavia.prototype.dump$B = function (verbose) {
+ /** @type {!string} */
+ var header;
+ /** @type {!string} */
+ var fmdata;
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var i;
+ /** @type {CompressionReport} */
+ var report;
+ /** @type {undefined|!string} */
+ var name;
+ /** @type {!string} */
+ var data;
+ header = Binary$dumpString$SLCompressionReport$("oktavia-01", null).slice(1);
+ if (verbose) {
+ console.log("Source text size: " + (this._fmindex.size$() * 2 + "") + ' bytes');
+ }
+ fmdata = this._fmindex.dump$B(verbose);
+ result = [ header, fmdata ];
+ result.push(Binary$dump16bitNumber$I(this._compressCode2utf16.length));
+ for (i = 3; i < this._compressCode2utf16.length; i++) {
+ result.push(this._compressCode2utf16[i]);
+ }
+ if (verbose) {
+ console.log('Char Code Map: ' + (this._compressCode2utf16.length * 2 - 2 + "") + ' bytes');
+ }
+ report = ({source: 0, result: 0});
+ result.push(Binary$dumpStringListMap$HASLCompressionReport$(this._stemmingResult, report));
+ if (verbose) {
+ console.log('Stemmed Word Table: ' + (result[result.length - 1].length + "") + ' bytes (' + (Math.round(report.result * 100.0 / report.source) + "") + '%)');
+ }
+ result.push(Binary$dump16bitNumber$I(this._metadataLabels.length));
+ for (i = 0; i < this._metadataLabels.length; i++) {
+ report = ({source: 0, result: 0});
+ name = this._metadataLabels[i];
+ data = this._metadatas[name]._dump$LCompressionReport$(report);
+ result.push(Binary$dumpString$SLCompressionReport$(name, report), data);
+ if (verbose) {
+ console.log('Meta Data ' + name + ': ' + (data.length * 2 + "") + ' bytes (' + (Math.round(report.result * 100.0 / report.source) + "") + '%)');
+ }
+ }
+ return result.join('');
+};
+
+/**
+ * @param {!string} data
+ */
+Oktavia.prototype.load$S = function (data) {
+ /** @type {!string} */
+ var header;
+ /** @type {!number} */
+ var offset;
+ /** @type {!number} */
+ var charCodeCount;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var charCode;
+ /** @type {LoadedStringListMapResult} */
+ var stemmedWords;
+ /** @type {!number} */
+ var metadataCount;
+ /** @type {LoadedStringResult} */
+ var nameResult;
+ /** @type {!string} */
+ var name;
+ /** @type {!number} */
+ var type;
+ header = Binary$dumpString$SLCompressionReport$("oktavia-01", null).slice(1);
+ if (data.slice(0, 5) !== header) {
+ throw new Error('Invalid data file');
+ }
+ this._metadatas = ({ });
+ this._metadataLabels = [ ];
+ offset = 5;
+ offset = this._fmindex.load$SI(data, offset);
+ charCodeCount = Binary$load16bitNumber$SI(data, offset++);
+ this._compressCode2utf16 = [ Oktavia.eof, Oktavia.eob, Oktavia.unknown ];
+ this._utf162compressCode = [ Oktavia.eof, Oktavia.eob, Oktavia.unknown ];
+ for (i = 3; i < charCodeCount; i++) {
+ charCode = Binary$load16bitNumber$SI(data, offset++);
+ this._compressCode2utf16.push(String.fromCharCode(charCode));
+ this._utf162compressCode[charCode] = String.fromCharCode(i);
+ }
+ stemmedWords = Binary$loadStringListMap$SI(data, offset);
+ this._stemmingResult = stemmedWords.result;
+ offset = stemmedWords.offset;
+ metadataCount = Binary$load16bitNumber$SI(data, offset++);
+ for (i = 0; i < metadataCount; i++) {
+ nameResult = Binary$loadString$SI(data, offset);
+ name = nameResult.result;
+ offset = nameResult.offset;
+ type = Binary$load16bitNumber$SI(data, offset++);
+ switch (type) {
+ case 0:
+ offset = Section$_load$LOktavia$SSI(this, name, data, offset);
+ break;
+ case 1:
+ offset = Splitter$_load$LOktavia$SSI(this, name, data, offset);
+ break;
+ case 2:
+ offset = Table$_load$LOktavia$SSI(this, name, data, offset);
+ break;
+ case 3:
+ offset = Block$_load$LOktavia$SSI(this, name, data, offset);
+ break;
+ }
+ }
+};
+
+/**
+ * @return {!number}
+ */
+Oktavia.prototype.contentSize$ = function () {
+ /** @type {FMIndex} */
+ var this$0;
+ this$0 = this._fmindex;
+ return this$0._substr.length;
+};
+
+/**
+ * @param {!number} position
+ * @return {!number}
+ */
+Oktavia.prototype.wordPositionType$I = function (position) {
+ /** @type {!number} */
+ var result;
+ /** @type {!string} */
+ var ahead;
+ result = 0;
+ if (position === 0) {
+ result = 4;
+ } else {
+ ahead = this._fmindex.getSubstring$II(position - 1, 1);
+ if (/\s/.test(ahead)) {
+ result = 2;
+ } else {
+ if (/\W/.test(ahead)) {
+ result = 1;
+ } else {
+ if (Oktavia.eob === ahead) {
+ result = 3;
+ }
+ }
+ }
+ }
+ return (result | 0);
+};
+
+/**
+ * @param {!number} position
+ * @param {!number} length
+ * @return {!string}
+ */
+Oktavia.prototype._getSubstring$II = function (position, length) {
+ /** @type {!string} */
+ var result;
+ /** @type {Array.<undefined|!string>} */
+ var str;
+ /** @type {!number} */
+ var i;
+ result = this._fmindex.getSubstring$II(position, length);
+ str = [ ];
+ for (i = 0; i < result.length; i++) {
+ str.push(this._compressCode2utf16[result.charCodeAt(i)]);
+ }
+ return str.join('');
+};
+
+/**
+ * class CommandOption extends Object
+ * @constructor
+ */
+function CommandOption() {
+}
+
+/**
+ * @constructor
+ * @param {!string} option
+ */
+function CommandOption$S(option) {
+ this.option = option;
+ this.optarg = null;
+ this.error = false;
+};
+
+CommandOption$S.prototype = new CommandOption;
+
+/**
+ * @constructor
+ * @param {!string} option
+ * @param {!string} optarg
+ */
+function CommandOption$SS(option, optarg) {
+ this.option = option;
+ this.optarg = optarg;
+ this.error = false;
+};
+
+CommandOption$SS.prototype = new CommandOption;
+
+/**
+ * @constructor
+ * @param {!string} option
+ * @param {!string} optarg
+ * @param {!boolean} error
+ */
+function CommandOption$SSB(option, optarg, error) {
+ this.option = option;
+ this.optarg = optarg;
+ this.error = error;
+};
+
+CommandOption$SSB.prototype = new CommandOption;
+
+/**
+ * class BasicParser extends Object
+ * @constructor
+ */
+function BasicParser() {
+}
+
+/**
+ * @constructor
+ * @param {!string} optstring
+ * @param {Array.<undefined|!string>} argv
+ */
+function BasicParser$SAS(optstring, argv) {
+ this._silent = false;
+ this._argv = argv;
+ this._options = ({ });
+ this._aliases = ({ });
+ this._optind = 0;
+ this._subind = 0;
+ this._extraoptions = false;
+ this._parseOptstr$S(optstring);
+};
+
+BasicParser$SAS.prototype = new BasicParser;
+
+/**
+ * @param {!string} msg
+ * @return {Error}
+ */
+BasicParser._makeError$S = function (msg) {
+ return new Error('getopt: ' + msg);
+};
+
+var BasicParser$_makeError$S = BasicParser._makeError$S;
+
+/**
+ * @param {!string} optstr
+ */
+BasicParser.prototype._parseOptstr$S = function (optstr) {
+ /** @type {!number} */
+ var i;
+ /** @type {!string} */
+ var chr;
+ /** @type {!boolean} */
+ var arg;
+ /** @type {!number} */
+ var cp;
+ /** @type {!string} */
+ var alias;
+ i = 0;
+ if (optstr.length > 0 && optstr.slice(0, 1) === ':') {
+ this._silent = true;
+ i++;
+ } else {
+ this._silent = false;
+ }
+ while (i < optstr.length) {
+ chr = optstr.slice(i, i + 1);
+ arg = false;
+ if (! /^[\w\d]$/.test(chr)) {
+ throw new Error("invalid optstring: only alphanumeric characters may be used as options: " + chr);
+ }
+ if (i + 1 < optstr.length && optstr.slice(i + 1, i + 2) === ':') {
+ arg = true;
+ i++;
+ }
+ this._options[chr] = arg;
+ while (i + 1 < optstr.length && optstr.slice(i + 1, i + 2) === '(') {
+ i++;
+ cp = optstr.indexOf(')', i + 1);
+ if (cp === -1) {
+ throw new Error("invalid optstring: missing \")\" to match \"(\" at char " + (i + ""));
+ }
+ alias = optstr.substring(i + 1, cp);
+ this._aliases[alias] = chr;
+ i = cp;
+ }
+ i++;
+ }
+};
+
+/**
+ * @return {!number}
+ */
+BasicParser.prototype.optind$ = function () {
+ return this._optind;
+};
+
+/**
+ * @return {CommandOption}
+ */
+BasicParser.prototype.getopt$ = function () {
+ /** @type {undefined|!string} */
+ var arg;
+ if (this._optind >= this._argv.length) {
+ return null;
+ }
+ arg = this._argv[this._optind];
+ if (this._extraoptions) {
+ this._optind++;
+ return ({option: arg, optarg: null, error: false});
+ }
+ if (this._subind === 0) {
+ if (arg == '-' || arg == '') {
+ return null;
+ }
+ if (arg.charAt(0) !== '-') {
+ this._extraoptions = true;
+ this._optind++;
+ return ({option: arg, optarg: null, error: false});
+ }
+ if (arg == '--') {
+ this._optind++;
+ this._subind = 0;
+ return null;
+ }
+ if (arg.slice(1, 2) === '-') {
+ return this._getoptLong$();
+ }
+ this._subind++;
+ }
+ return this._getoptShort$();
+};
+
+/**
+ * @return {CommandOption}
+ */
+BasicParser.prototype._getoptShort$ = function () {
+ /** @type {undefined|!string} */
+ var arg;
+ /** @type {!string} */
+ var chr;
+ /** @type {!number} */
+ var _subind$0;
+ arg = this._argv[this._optind];
+ chr = arg.slice(_subind$0 = this._subind, _subind$0 + 1);
+ if (++ this._subind >= arg.length) {
+ this._optind++;
+ this._subind = 0;
+ }
+ return (! (chr in this._options) ? this._errInvalidOption$S(chr) : ! this._options[chr] ? ({option: chr, optarg: null, error: false}) : this._getoptArgument$S(chr));
+};
+
+/**
+ * @return {CommandOption}
+ */
+BasicParser.prototype._getoptLong$ = function () {
+ /** @type {undefined|!string} */
+ var arg;
+ /** @type {!number} */
+ var eq;
+ /** @type {!string} */
+ var alias;
+ /** @type {undefined|!string} */
+ var chr;
+ arg = this._argv[this._optind];
+ eq = arg.indexOf('=');
+ alias = arg.substring(2, eq === -1 ? arg.length : eq);
+ if (! (alias in this._aliases)) {
+ return this._errInvalidOption$S(alias);
+ }
+ chr = this._aliases[alias];
+ if (! this._options[chr]) {
+ if (eq !== -1) {
+ return this._errExtraArg$S(alias);
+ }
+ this._optind++;
+ return ({option: chr, optarg: null, error: false});
+ }
+ if (eq === -1) {
+ this._optind++;
+ } else {
+ this._subind = (eq + 1 | 0);
+ }
+ return this._getoptArgument$S(chr);
+};
+
+/**
+ * @param {!string} chr
+ * @return {CommandOption}
+ */
+BasicParser.prototype._getoptArgument$S = function (chr) {
+ /** @type {!string} */
+ var arg;
+ if (this._optind >= this._argv.length) {
+ return this._errMissingArg$S(chr);
+ }
+ arg = this._argv[this._optind].substring(this._subind);
+ this._optind++;
+ this._subind = 0;
+ return ({option: chr, optarg: arg, error: false});
+};
+
+/**
+ * @param {!string} chr
+ * @return {CommandOption}
+ */
+BasicParser.prototype._errMissingArg$S = function (chr) {
+ if (this._silent) {
+ return ({option: ':', optarg: chr, error: false});
+ }
+ console.error('option requires an argument -- ' + chr + '\n');
+ return ({option: '?', optarg: chr, error: true});
+};
+
+/**
+ * @param {!string} chr
+ * @return {CommandOption}
+ */
+BasicParser.prototype._errInvalidOption$S = function (chr) {
+ if (! this._silent) {
+ console.error('illegal option -- ' + chr + '\n');
+ }
+ return ({option: '?', optarg: chr, error: true});
+};
+
+/**
+ * @param {!string} chr
+ * @return {CommandOption}
+ */
+BasicParser.prototype._errExtraArg$S = function (chr) {
+ if (! this._silent) {
+ console.error('option expects no argument -- ' + chr + '\n');
+ }
+ return ({option: '?', optarg: chr, error: true});
+};
+
+/**
+ * class QueryParser extends Object
+ * @constructor
+ */
+function QueryParser() {
+}
+
+/**
+ * @constructor
+ */
+function QueryParser$() {
+ this.queries = [ ];
+};
+
+QueryParser$.prototype = new QueryParser;
+
+/**
+ * @param {QueryParser} $this
+ * @param {Array.<undefined|!string>} queryStrings
+ * @return {Array.<undefined|Query>}
+ */
+QueryParser.parse$LQueryParser$AS = function ($this, queryStrings) {
+ /** @type {!boolean} */
+ var nextOr;
+ /** @type {!number} */
+ var i;
+ /** @type {undefined|!string} */
+ var word;
+ /** @type {Query} */
+ var query;
+ nextOr = false;
+ for (i = 0; i < queryStrings.length; i++) {
+ word = queryStrings[i];
+ if (word == 'OR') {
+ nextOr = true;
+ } else {
+ query = new Query$();
+ if (nextOr) {
+ query.or = true;
+ nextOr = false;
+ }
+ if (word.slice(0, 1) === '-') {
+ query.not = true;
+ word = word.slice(1);
+ }
+ if (word.slice(0, 1) === '"' && word.slice(word.length - 1) === '"') {
+ query.raw = true;
+ word = word.slice(1, word.length - 1);
+ }
+ query.word = word;
+ $this.queries.push(query);
+ }
+ }
+ return $this.queries;
+};
+
+var QueryParser$parse$LQueryParser$AS = QueryParser.parse$LQueryParser$AS;
+
+/**
+ * @param {QueryParser} $this
+ * @return {!string}
+ */
+QueryParser.highlight$LQueryParser$ = function ($this) {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var i;
+ /** @type {Query} */
+ var query;
+ result = [ ];
+ for (i = 0; i < $this.queries.length; i++) {
+ query = $this.queries[i];
+ if (! query.not) {
+ result.push("highlight=" + $__jsx_encodeURIComponent(query.word));
+ }
+ }
+ return '?' + result.join('&');
+};
+
+var QueryParser$highlight$LQueryParser$ = QueryParser.highlight$LQueryParser$;
+
+/**
+ * class Proposal extends Object
+ * @constructor
+ */
+function Proposal() {
+}
+
+/**
+ * @constructor
+ * @param {!number} omit
+ * @param {!number} expect
+ */
+function Proposal$II(omit, expect) {
+ this.omit = omit;
+ this.expect = expect;
+};
+
+Proposal$II.prototype = new Proposal;
+
+/**
+ * class Position extends Object
+ * @constructor
+ */
+function Position() {
+}
+
+/**
+ * @constructor
+ * @param {!string} word
+ * @param {!number} position
+ * @param {!boolean} stemmed
+ */
+function Position$SIB(word, position, stemmed) {
+ this.word = word;
+ this.position = position;
+ this.stemmed = stemmed;
+};
+
+Position$SIB.prototype = new Position;
+
+/**
+ * class SearchUnit extends Object
+ * @constructor
+ */
+function SearchUnit() {
+}
+
+/**
+ * @constructor
+ * @param {!number} id
+ */
+function SearchUnit$I(id) {
+ this.positions = ({ });
+ this.id = id;
+ this._size = 0;
+ this.score = 0;
+ this.startPosition = -1;
+};
+
+SearchUnit$I.prototype = new SearchUnit;
+
+/**
+ * @param {SearchUnit} $this
+ * @param {!string} word
+ * @param {!number} position
+ * @param {!boolean} stemmed
+ */
+SearchUnit.addPosition$LSearchUnit$SIB = function ($this, word, position, stemmed) {
+ /** @type {Position} */
+ var positionObj;
+ positionObj = $this.positions[position + ""];
+ if (! positionObj) {
+ $this._size++;
+ $this.positions[position + ""] = ({word: word, position: position, stemmed: stemmed});
+ } else {
+ if (positionObj.word.length < word.length) {
+ positionObj.word = word;
+ }
+ positionObj.stemmed = positionObj.stemmed && stemmed;
+ }
+};
+
+var SearchUnit$addPosition$LSearchUnit$SIB = SearchUnit.addPosition$LSearchUnit$SIB;
+
+/**
+ * @param {SearchUnit} $this
+ * @param {!number} position
+ * @return {Position}
+ */
+SearchUnit.get$LSearchUnit$I = function ($this, position) {
+ return $this.positions[position + ""];
+};
+
+var SearchUnit$get$LSearchUnit$I = SearchUnit.get$LSearchUnit$I;
+
+/**
+ * @param {SearchUnit} $this
+ * @return {!number}
+ */
+SearchUnit.size$LSearchUnit$ = function ($this) {
+ return $this._size;
+};
+
+var SearchUnit$size$LSearchUnit$ = SearchUnit.size$LSearchUnit$;
+
+/**
+ * @param {SearchUnit} $this
+ * @param {SearchUnit} rhs
+ */
+SearchUnit.merge$LSearchUnit$LSearchUnit$ = function ($this, rhs) {
+ /** @type {!string} */
+ var position;
+ /** @type {Position} */
+ var pos;
+ for (position in rhs.positions) {
+ pos = rhs.positions[position];
+ SearchUnit$addPosition$LSearchUnit$SIB($this, pos.word, pos.position, pos.stemmed);
+ }
+};
+
+var SearchUnit$merge$LSearchUnit$LSearchUnit$ = SearchUnit.merge$LSearchUnit$LSearchUnit$;
+
+/**
+ * @param {SearchUnit} $this
+ * @return {Array.<undefined|Position>}
+ */
+SearchUnit.getPositions$LSearchUnit$ = function ($this) {
+ /** @type {Array.<undefined|Position>} */
+ var result;
+ /** @type {!string} */
+ var pos;
+ result = [ ];
+ for (pos in $this.positions) {
+ result.push($this.positions[pos]);
+ }
+ result.sort((function (a, b) {
+ return a.position - b.position;
+ }));
+ return result;
+};
+
+var SearchUnit$getPositions$LSearchUnit$ = SearchUnit.getPositions$LSearchUnit$;
+
+/**
+ * class SingleResult extends Object
+ * @constructor
+ */
+function SingleResult() {
+}
+
+/**
+ * @constructor
+ */
+function SingleResult$() {
+ this.units = [ ];
+ this.unitIds = [ ];
+ this.or = false;
+ this.not = false;
+ this.searchWord = '';
+};
+
+SingleResult$.prototype = new SingleResult;
+
+/**
+ * @constructor
+ * @param {!string} searchWord
+ * @param {!boolean} or
+ * @param {!boolean} not
+ */
+function SingleResult$SBB(searchWord, or, not) {
+ this.units = [ ];
+ this.unitIds = [ ];
+ this.or = or;
+ this.not = not;
+ this.searchWord = searchWord;
+};
+
+SingleResult$SBB.prototype = new SingleResult;
+
+/**
+ * @param {SingleResult} $this
+ * @param {!number} unitId
+ * @return {SearchUnit}
+ */
+SingleResult.getSearchUnit$LSingleResult$I = function ($this, unitId) {
+ /** @type {!number} */
+ var existing;
+ /** @type {SearchUnit} */
+ var result;
+ existing = $this.unitIds.indexOf(unitId);
+ if (existing === -1) {
+ result = ({positions: ({ }), id: unitId, _size: 0, score: 0, startPosition: -1});
+ $this.units.push(result);
+ $this.unitIds.push(unitId);
+ } else {
+ result = $this.units[existing];
+ }
+ return result;
+};
+
+var SingleResult$getSearchUnit$LSingleResult$I = SingleResult.getSearchUnit$LSingleResult$I;
+
+/**
+ * @param {SingleResult} $this
+ * @param {SingleResult} rhs
+ * @return {SingleResult}
+ */
+SingleResult.merge$LSingleResult$LSingleResult$ = function ($this, rhs) {
+ /** @type {SingleResult} */
+ var result;
+ result = ({units: [ ], unitIds: [ ], or: false, not: false, searchWord: ''});
+ if (rhs.or) {
+ SingleResult$_orMerge$LSingleResult$LSingleResult$LSingleResult$($this, result, rhs);
+ } else {
+ if (rhs.not) {
+ SingleResult$_notMerge$LSingleResult$LSingleResult$LSingleResult$($this, result, rhs);
+ } else {
+ SingleResult$_andMerge$LSingleResult$LSingleResult$LSingleResult$($this, result, rhs);
+ }
+ }
+ return result;
+};
+
+var SingleResult$merge$LSingleResult$LSingleResult$ = SingleResult.merge$LSingleResult$LSingleResult$;
+
+/**
+ * @param {SingleResult} $this
+ * @return {!number}
+ */
+SingleResult.size$LSingleResult$ = function ($this) {
+ return ($this.units.length | 0);
+};
+
+var SingleResult$size$LSingleResult$ = SingleResult.size$LSingleResult$;
+
+/**
+ * @param {SingleResult} $this
+ * @param {SingleResult} result
+ * @param {SingleResult} rhs
+ */
+SingleResult._andMerge$LSingleResult$LSingleResult$LSingleResult$ = function ($this, result, rhs) {
+ /** @type {!number} */
+ var i;
+ /** @type {undefined|!number} */
+ var id;
+ /** @type {SearchUnit} */
+ var lhsSection;
+ for (i = 0; i < $this.unitIds.length; i++) {
+ id = $this.unitIds[i];
+ if (rhs.unitIds.indexOf(id) !== -1) {
+ lhsSection = $this.units[i];
+ result.unitIds.push(id);
+ result.units.push(lhsSection);
+ }
+ }
+};
+
+var SingleResult$_andMerge$LSingleResult$LSingleResult$LSingleResult$ = SingleResult._andMerge$LSingleResult$LSingleResult$LSingleResult$;
+
+/**
+ * @param {SingleResult} $this
+ * @param {SingleResult} result
+ * @param {SingleResult} rhs
+ */
+SingleResult._orMerge$LSingleResult$LSingleResult$LSingleResult$ = function ($this, result, rhs) {
+ /** @type {!number} */
+ var i;
+ /** @type {undefined|!number} */
+ var id;
+ /** @type {SearchUnit} */
+ var rhsSection;
+ /** @type {SearchUnit} */
+ var lhsSection;
+ /** @type {Array.<undefined|!number>} */
+ var unitIds$0;
+ /** @type {Array.<undefined|SearchUnit>} */
+ var units$0;
+ result.unitIds = (unitIds$0 = $this.unitIds).slice(0, unitIds$0.length);
+ result.units = (units$0 = $this.units).slice(0, units$0.length);
+ for (i = 0; i < rhs.unitIds.length; i++) {
+ id = rhs.unitIds[i];
+ rhsSection = rhs.units[i];
+ if (result.unitIds.indexOf(id) !== -1) {
+ lhsSection = result.units[result.unitIds.indexOf(id)];
+ SearchUnit$merge$LSearchUnit$LSearchUnit$(lhsSection, rhsSection);
+ } else {
+ result.unitIds.push(id);
+ result.units.push(rhsSection);
+ }
+ }
+};
+
+var SingleResult$_orMerge$LSingleResult$LSingleResult$LSingleResult$ = SingleResult._orMerge$LSingleResult$LSingleResult$LSingleResult$;
+
+/**
+ * @param {SingleResult} $this
+ * @param {SingleResult} result
+ * @param {SingleResult} rhs
+ */
+SingleResult._notMerge$LSingleResult$LSingleResult$LSingleResult$ = function ($this, result, rhs) {
+ /** @type {!number} */
+ var i;
+ /** @type {undefined|!number} */
+ var id;
+ /** @type {SearchUnit} */
+ var lhsSection;
+ for (i = 0; i < $this.unitIds.length; i++) {
+ id = $this.unitIds[i];
+ if (rhs.unitIds.indexOf(id) === -1) {
+ lhsSection = $this.units[i];
+ result.unitIds.push(id);
+ result.units.push(lhsSection);
+ }
+ }
+};
+
+var SingleResult$_notMerge$LSingleResult$LSingleResult$LSingleResult$ = SingleResult._notMerge$LSingleResult$LSingleResult$LSingleResult$;
+
+/**
+ * class SearchSummary extends Object
+ * @constructor
+ */
+function SearchSummary() {
+}
+
+/**
+ * @constructor
+ */
+function SearchSummary$() {
+ this.sourceResults = [ ];
+ this.result = null;
+ this.oktavia = null;
+};
+
+SearchSummary$.prototype = new SearchSummary;
+
+/**
+ * @constructor
+ * @param {Oktavia} oktavia
+ */
+function SearchSummary$LOktavia$(oktavia) {
+ this.sourceResults = [ ];
+ this.result = null;
+ this.oktavia = oktavia;
+};
+
+SearchSummary$LOktavia$.prototype = new SearchSummary;
+
+/**
+ * @param {SearchSummary} $this
+ * @param {SingleResult} result
+ */
+SearchSummary.addQuery$LSearchSummary$LSingleResult$ = function ($this, result) {
+ $this.sourceResults.push(result);
+};
+
+var SearchSummary$addQuery$LSearchSummary$LSingleResult$ = SearchSummary.addQuery$LSearchSummary$LSingleResult$;
+
+/**
+ * @param {SearchSummary} $this
+ */
+SearchSummary.mergeResult$LSearchSummary$ = function ($this) {
+ $this.result = SearchSummary$mergeResult$LSearchSummary$ALSingleResult$($this, $this.sourceResults);
+};
+
+var SearchSummary$mergeResult$LSearchSummary$ = SearchSummary.mergeResult$LSearchSummary$;
+
+/**
+ * @param {SearchSummary} $this
+ * @param {Array.<undefined|SingleResult>} results
+ * @return {SingleResult}
+ */
+SearchSummary.mergeResult$LSearchSummary$ALSingleResult$ = function ($this, results) {
+ /** @type {SingleResult} */
+ var rhs;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var results$len$0;
+ rhs = results[0];
+ for ((i = 1, results$len$0 = results.length); i < results$len$0; i++) {
+ rhs = SingleResult$merge$LSingleResult$LSingleResult$(rhs, results[i]);
+ }
+ return rhs;
+};
+
+var SearchSummary$mergeResult$LSearchSummary$ALSingleResult$ = SearchSummary.mergeResult$LSearchSummary$ALSingleResult$;
+
+/**
+ * @param {SearchSummary} $this
+ * @return {Array.<undefined|Proposal>}
+ */
+SearchSummary.getProposal$LSearchSummary$ = function ($this) {
+ /** @type {Array.<undefined|Proposal>} */
+ var proposals;
+ /** @type {!number} */
+ var i;
+ /** @type {Array.<undefined|SingleResult>} */
+ var tmpSource;
+ /** @type {!number} */
+ var j;
+ /** @type {SingleResult} */
+ var result;
+ proposals = [ ];
+ for (i = 0; i < $this.sourceResults.length; i++) {
+ tmpSource = [ ];
+ for (j = 0; j < $this.sourceResults.length; j++) {
+ if (i !== j) {
+ tmpSource.push($this.sourceResults[j]);
+ }
+ }
+ result = SearchSummary$mergeResult$LSearchSummary$ALSingleResult$($this, tmpSource);
+ proposals.push(({omit: i, expect: result.units.length}));
+ }
+ proposals.sort((function (a, b) {
+ return b.expect - a.expect;
+ }));
+ return proposals;
+};
+
+var SearchSummary$getProposal$LSearchSummary$ = SearchSummary.getProposal$LSearchSummary$;
+
+/**
+ * @param {SearchSummary} $this
+ * @return {Array.<undefined|SearchUnit>}
+ */
+SearchSummary.getSortedResult$LSearchSummary$ = function ($this) {
+ /** @type {Array.<undefined|SearchUnit>} */
+ var result;
+ /** @type {Array.<undefined|SearchUnit>} */
+ var units$0;
+ result = (units$0 = $this.result.units).slice(0, units$0.length);
+ result.sort((function (a, b) {
+ return b.score - a.score;
+ }));
+ return result;
+};
+
+var SearchSummary$getSortedResult$LSearchSummary$ = SearchSummary.getSortedResult$LSearchSummary$;
+
+/**
+ * @param {SearchSummary} $this
+ * @return {!number}
+ */
+SearchSummary.size$LSearchSummary$ = function ($this) {
+ /** @type {SingleResult} */
+ var this$0;
+ this$0 = $this.result;
+ return (this$0.units.length | 0);
+};
+
+var SearchSummary$size$LSearchSummary$ = SearchSummary.size$LSearchSummary$;
+
+/**
+ * @param {SearchSummary} $this
+ * @param {SingleResult} result
+ */
+SearchSummary.add$LSearchSummary$LSingleResult$ = function ($this, result) {
+ $this.sourceResults.push(result);
+};
+
+var SearchSummary$add$LSearchSummary$LSingleResult$ = SearchSummary.add$LSearchSummary$LSingleResult$;
+
+/**
+ * class Style extends Object
+ * @constructor
+ */
+function Style() {
+}
+
+/**
+ * @constructor
+ * @param {!string} mode
+ */
+function Style$S(mode) {
+ this.styles = null;
+ this.escapeHTML = false;
+ switch (mode) {
+ case 'console':
+ this.styles = Style.console;
+ break;
+ case 'html':
+ this.styles = Style.html;
+ break;
+ case 'ignore':
+ this.styles = Style.ignore;
+ break;
+ default:
+ this.styles = Style.ignore;
+ break;
+ }
+ this.escapeHTML = mode === 'html';
+};
+
+Style$S.prototype = new Style;
+
+/**
+ * @param {!string} source
+ * @return {!string}
+ */
+Style.prototype.convert$S = function (source) {
+ /** @type {_HTMLHandler} */
+ var handler;
+ /** @type {SAXParser} */
+ var parser;
+ handler = new _HTMLHandler$HASB(this.styles, this.escapeHTML);
+ parser = new SAXParser$LSAXHandler$(handler);
+ parser.parse$S(source);
+ return handler.text.join('');
+};
+
+/**
+ * class Binary extends Object
+ * @constructor
+ */
+function Binary() {
+}
+
+/**
+ * @constructor
+ */
+function Binary$() {
+};
+
+Binary$.prototype = new Binary;
+
+/**
+ * @param {!number} num
+ * @return {!string}
+ */
+Binary.dump32bitNumber$N = function (num) {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ result = [ String.fromCharCode(Math.floor(num / 65536)) ];
+ result.push(String.fromCharCode(num % 65536));
+ return result.join("");
+};
+
+var Binary$dump32bitNumber$N = Binary.dump32bitNumber$N;
+
+/**
+ * @param {!string} buffer
+ * @param {!number} offset
+ * @return {!number}
+ */
+Binary.load32bitNumber$SI = function (buffer, offset) {
+ /** @type {!number} */
+ var result;
+ result = buffer.charCodeAt(offset) * 65536 + buffer.charCodeAt(offset + 1);
+ return result;
+};
+
+var Binary$load32bitNumber$SI = Binary.load32bitNumber$SI;
+
+/**
+ * @param {!number} num
+ * @return {!string}
+ */
+Binary.dump16bitNumber$I = function (num) {
+ return String.fromCharCode(num % 65536);
+};
+
+var Binary$dump16bitNumber$I = Binary.dump16bitNumber$I;
+
+/**
+ * @param {!string} buffer
+ * @param {!number} offset
+ * @return {!number}
+ */
+Binary.load16bitNumber$SI = function (buffer, offset) {
+ return (buffer.charCodeAt(offset) | 0);
+};
+
+var Binary$load16bitNumber$SI = Binary.load16bitNumber$SI;
+
+/**
+ * @param {!string} str
+ * @return {!string}
+ */
+Binary.dumpString$S = function (str) {
+ return Binary$dumpString$SLCompressionReport$(str, null);
+};
+
+var Binary$dumpString$S = Binary.dumpString$S;
+
+/**
+ * @param {!string} str
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+Binary.dumpString$SLCompressionReport$ = function (str, report) {
+ /** @type {!number} */
+ var length;
+ /** @type {!boolean} */
+ var compress;
+ /** @type {Array.<undefined|!number>} */
+ var charCodes;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var charCode;
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {undefined|!number} */
+ var bytes;
+ if (str.length > 32768) {
+ str = str.slice(0, 32768);
+ }
+ length = str.length;
+ compress = true;
+ charCodes = [ ];
+ for (i = 0; i < length; i++) {
+ charCode = str.charCodeAt(i);
+ if (charCode > 255) {
+ compress = false;
+ break;
+ }
+ charCodes.push(charCode);
+ }
+ if (compress) {
+ result = [ Binary$dump16bitNumber$I(length + 32768) ];
+ for (i = 0; i < length; i += 2) {
+ bytes = charCodes[i];
+ if (i !== length - 1) {
+ bytes += charCodes[i + 1] << 8;
+ }
+ result.push(String.fromCharCode(bytes % 65536));
+ }
+ if (report) {
+ CompressionReport$add$LCompressionReport$II(report, length, Math.ceil(length / 2));
+ }
+ } else {
+ result = [ Binary$dump16bitNumber$I(length), str ];
+ if (report) {
+ CompressionReport$add$LCompressionReport$II(report, length, length);
+ }
+ }
+ return result.join('');
+};
+
+var Binary$dumpString$SLCompressionReport$ = Binary.dumpString$SLCompressionReport$;
+
+/**
+ * @param {!string} buffer
+ * @param {!number} offset
+ * @return {LoadedStringResult}
+ */
+Binary.loadString$SI = function (buffer, offset) {
+ return new LoadedStringResult$SI(buffer, offset);
+};
+
+var Binary$loadString$SI = Binary.loadString$SI;
+
+/**
+ * @param {Array.<undefined|!string>} strList
+ * @return {!string}
+ */
+Binary.dumpStringList$AS = function (strList) {
+ return Binary$dumpStringList$ASLCompressionReport$(strList, null);
+};
+
+var Binary$dumpStringList$AS = Binary.dumpStringList$AS;
+
+/**
+ * @param {Array.<undefined|!string>} strList
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+Binary.dumpStringList$ASLCompressionReport$ = function (strList, report) {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var i;
+ result = [ Binary$dump32bitNumber$N(strList.length) ];
+ for (i = 0; i < strList.length; i++) {
+ result.push(Binary$dumpString$SLCompressionReport$(strList[i], report));
+ }
+ return result.join('');
+};
+
+var Binary$dumpStringList$ASLCompressionReport$ = Binary.dumpStringList$ASLCompressionReport$;
+
+/**
+ * @param {!string} buffer
+ * @param {!number} offset
+ * @return {LoadedStringListResult}
+ */
+Binary.loadStringList$SI = function (buffer, offset) {
+ return new LoadedStringListResult$SI(buffer, offset);
+};
+
+var Binary$loadStringList$SI = Binary.loadStringList$SI;
+
+/**
+ * @param {Object.<string, undefined|Array.<undefined|!string>>} strMap
+ * @return {!string}
+ */
+Binary.dumpStringListMap$HAS = function (strMap) {
+ return Binary$dumpStringListMap$HASLCompressionReport$(strMap, null);
+};
+
+var Binary$dumpStringListMap$HAS = Binary.dumpStringListMap$HAS;
+
+/**
+ * @param {Object.<string, undefined|Array.<undefined|!string>>} strMap
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+Binary.dumpStringListMap$HASLCompressionReport$ = function (strMap, report) {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var counter;
+ /** @type {!string} */
+ var key;
+ result = [ ];
+ counter = 0;
+ for (key in strMap) {
+ result.push(Binary$dumpString$SLCompressionReport$(key, report));
+ result.push(Binary$dumpStringList$ASLCompressionReport$(strMap[key], report));
+ counter++;
+ }
+ return Binary$dump32bitNumber$N(counter) + result.join('');
+};
+
+var Binary$dumpStringListMap$HASLCompressionReport$ = Binary.dumpStringListMap$HASLCompressionReport$;
+
+/**
+ * @param {!string} buffer
+ * @param {!number} offset
+ * @return {LoadedStringListMapResult}
+ */
+Binary.loadStringListMap$SI = function (buffer, offset) {
+ return new LoadedStringListMapResult$SI(buffer, offset);
+};
+
+var Binary$loadStringListMap$SI = Binary.loadStringListMap$SI;
+
+/**
+ * @param {Array.<undefined|!number>} array
+ * @return {!string}
+ */
+Binary.dump32bitNumberList$AN = function (array) {
+ return Binary$dump32bitNumberList$ANLCompressionReport$(array, null);
+};
+
+var Binary$dump32bitNumberList$AN = Binary.dump32bitNumberList$AN;
+
+/**
+ * @param {Array.<undefined|!number>} array
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+Binary.dump32bitNumberList$ANLCompressionReport$ = function (array, report) {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var index;
+ /** @type {!number} */
+ var inputLength;
+ /** @type {!number} */
+ var length;
+ /** @type {!string} */
+ var resultString;
+ /** @type {!number} */
+ var value1$0;
+ /** @type {!number} */
+ var value2$0;
+ result = [ Binary$dump32bitNumber$N(array.length) ];
+ index = 0;
+ inputLength = array.length;
+ while (index < inputLength) {
+ if (array[index] == 0) {
+ length = Binary$_countZero$ANI(array, index);
+ result.push(Binary$_zeroBlock$I(length));
+ index += length;
+ } else {
+ if (Binary$_shouldZebraCode$ANI(array, index)) {
+ result.push(Binary$_createZebraCode$ANI(array, index));
+ value1$0 = array.length;
+ value2$0 = index + 15;
+ index = (value1$0 <= value2$0 ? value1$0 : value2$0);
+ } else {
+ length = Binary$_searchDoubleZero$ANI(array, index);
+ result.push(Binary$_nonZeroBlock$ANII(array, index, length));
+ if (length === 0) {
+ throw new Error('');
+ }
+ index += length;
+ }
+ }
+ }
+ resultString = result.join('');
+ if (report) {
+ CompressionReport$add$LCompressionReport$II(report, array.length * 2 + 2, resultString.length);
+ }
+ return resultString;
+};
+
+var Binary$dump32bitNumberList$ANLCompressionReport$ = Binary.dump32bitNumberList$ANLCompressionReport$;
+
+/**
+ * @param {!string} buffer
+ * @param {!number} offset
+ * @return {LoadedNumberListResult}
+ */
+Binary.load32bitNumberList$SI = function (buffer, offset) {
+ return new LoadedNumberListResult$SI(buffer, offset);
+};
+
+var Binary$load32bitNumberList$SI = Binary.load32bitNumberList$SI;
+
+/**
+ * @param {Array.<undefined|!number>} array
+ * @param {!number} offset
+ * @return {!number}
+ */
+Binary._countZero$ANI = function (array, offset) {
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var array$len$0;
+ for ((i = offset, array$len$0 = array.length); i < array$len$0; i++) {
+ if (array[i] != 0) {
+ return (i - offset | 0);
+ }
+ }
+ return (array.length - offset | 0);
+};
+
+var Binary$_countZero$ANI = Binary._countZero$ANI;
+
+/**
+ * @param {!number} length
+ * @return {!string}
+ */
+Binary._zeroBlock$I = function (length) {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ result = [ ];
+ while (length > 0) {
+ if (length > 16384) {
+ result.push(Binary$dump16bitNumber$I(16383));
+ length -= 16384;
+ } else {
+ result.push(Binary$dump16bitNumber$I(length - 1));
+ length = 0;
+ }
+ }
+ return result.join('');
+};
+
+var Binary$_zeroBlock$I = Binary._zeroBlock$I;
+
+/**
+ * @param {Array.<undefined|!number>} array
+ * @param {!number} offset
+ * @return {!boolean}
+ */
+Binary._shouldZebraCode$ANI = function (array, offset) {
+ /** @type {!number} */
+ var change;
+ /** @type {!boolean} */
+ var isLastZero;
+ /** @type {!number} */
+ var i;
+ if (array.length - offset < 16) {
+ return true;
+ }
+ change = 0;
+ isLastZero = false;
+ for (i = offset; i < offset + 15; i++) {
+ if (array[i] == 0) {
+ if (! isLastZero) {
+ isLastZero = true;
+ change++;
+ }
+ } else {
+ if (isLastZero) {
+ isLastZero = false;
+ change++;
+ }
+ }
+ }
+ return change > 2;
+};
+
+var Binary$_shouldZebraCode$ANI = Binary._shouldZebraCode$ANI;
+
+/**
+ * @param {Array.<undefined|!number>} array
+ * @param {!number} offset
+ * @return {!number}
+ */
+Binary._searchDoubleZero$ANI = function (array, offset) {
+ /** @type {!boolean} */
+ var isLastZero;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var array$len$0;
+ isLastZero = false;
+ for ((i = offset, array$len$0 = array.length); i < array$len$0; i++) {
+ if (array[i] == 0) {
+ if (isLastZero) {
+ return (i - offset - 1 | 0);
+ }
+ isLastZero = true;
+ } else {
+ isLastZero = false;
+ }
+ }
+ return (array.length - offset | 0);
+};
+
+var Binary$_searchDoubleZero$ANI = Binary._searchDoubleZero$ANI;
+
+/**
+ * @param {Array.<undefined|!number>} array
+ * @param {!number} offset
+ * @param {!number} length
+ * @return {!string}
+ */
+Binary._nonZeroBlock$ANII = function (array, offset, length) {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var blockLength;
+ /** @type {!number} */
+ var i;
+ result = [ ];
+ while (length > 0) {
+ if (length > 16384) {
+ blockLength = 16384;
+ length -= 16384;
+ } else {
+ blockLength = length;
+ length = 0;
+ }
+ result.push(Binary$dump16bitNumber$I(blockLength - 1 + 0x4000));
+ for (i = offset; i < offset + blockLength; i++) {
+ result.push(Binary$dump32bitNumber$N(array[i]));
+ }
+ offset += blockLength;
+ }
+ return result.join('');
+};
+
+var Binary$_nonZeroBlock$ANII = Binary._nonZeroBlock$ANII;
+
+/**
+ * @param {Array.<undefined|!number>} array
+ * @param {!number} offset
+ * @return {!string}
+ */
+Binary._createZebraCode$ANI = function (array, offset) {
+ /** @type {!number} */
+ var last;
+ /** @type {!number} */
+ var code;
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var value1$0;
+ /** @type {!number} */
+ var value2$0;
+ value1$0 = offset + 15;
+ value2$0 = array.length;
+ last = (value1$0 <= value2$0 ? value1$0 : value2$0);
+ code = 0x8000;
+ result = [ ];
+ for (i = offset; i < last; i++) {
+ if (array[i] != 0) {
+ result.push(Binary$dump32bitNumber$N(array[i]));
+ code = code + (0x1 << i - offset);
+ }
+ }
+ return String.fromCharCode(code) + result.join('');
+};
+
+var Binary$_createZebraCode$ANI = Binary._createZebraCode$ANI;
+
+/**
+ * @param {!string} str
+ * @return {!string}
+ */
+Binary.base64encode$S = function (str) {
+ /** @type {Array.<undefined|!string>} */
+ var out;
+ /** @type {Array.<undefined|!number>} */
+ var source;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var code;
+ /** @type {!number} */
+ var len;
+ /** @type {!number} */
+ var c1;
+ /** @type {undefined|!number} */
+ var c2;
+ /** @type {undefined|!number} */
+ var c3;
+ out = [ ];
+ source = [ ];
+ for (i = 0; i < str.length; i++) {
+ code = str.charCodeAt(i);
+ source.push(code & 0x00ff, code >>> 8);
+ }
+ len = str.length * 2;
+ i = 0;
+ while (i < len) {
+ c1 = source[i++] & 0xff;
+ if (i === len) {
+ out.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(c1 >> 2));
+ out.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((c1 & 0x3) << 4));
+ out.push("==");
+ break;
+ }
+ c2 = source[i++];
+ if (i === len) {
+ out.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(c1 >> 2));
+ out.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((c1 & 0x3) << 4 | (c2 & 0xF0) >> 4));
+ out.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((c2 & 0xF) << 2));
+ out.push("=");
+ break;
+ }
+ c3 = source[i++];
+ out.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(c1 >> 2));
+ out.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((c1 & 0x3) << 4 | (c2 & 0xF0) >> 4));
+ out.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((c2 & 0xF) << 2 | (c3 & 0xC0) >> 6));
+ out.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(c3 & 0x3F));
+ }
+ return out.join('');
+};
+
+var Binary$base64encode$S = Binary.base64encode$S;
+
+/**
+ * @param {Array.<undefined|!number>} source
+ * @return {!string}
+ */
+Binary._mergeCharCode$AI = function (source) {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var i;
+ result = [ ];
+ for (i = 0; i < source.length; i += 2) {
+ result.push(String.fromCharCode(source[i] + (source[i + 1] << 8)));
+ }
+ return result.join('');
+};
+
+var Binary$_mergeCharCode$AI = Binary._mergeCharCode$AI;
+
+/**
+ * @param {!string} str
+ * @return {!string}
+ */
+Binary.base64decode$S = function (str) {
+ /** @type {!number} */
+ var len;
+ /** @type {!number} */
+ var i;
+ /** @type {Array.<undefined|!number>} */
+ var out;
+ /** @type {undefined|!number} */
+ var c1;
+ /** @type {undefined|!number} */
+ var c2;
+ /** @type {!number} */
+ var c3;
+ /** @type {!number} */
+ var c4;
+ len = str.length;
+ i = 0;
+ out = [ ];
+ while (i < len) {
+ do {
+ c1 = Binary._base64DecodeChars[str.charCodeAt(i++) & 0xff];
+ } while (i < len && c1 == -1);
+ if (c1 == -1) {
+ break;
+ }
+ do {
+ c2 = Binary._base64DecodeChars[str.charCodeAt(i++) & 0xff];
+ } while (i < len && c2 == -1);
+ if (c2 == -1) {
+ break;
+ }
+ out.push(c1 << 2 | (c2 & 0x30) >> 4);
+ do {
+ c3 = str.charCodeAt(i++) & 0xff;
+ if (c3 === 61) {
+ return Binary$_mergeCharCode$AI(out);
+ }
+ c3 = Binary._base64DecodeChars[c3];
+ } while (i < len && c3 === -1);
+ if (c3 === -1) {
+ break;
+ }
+ out.push((c2 & 0XF) << 4 | (c3 & 0x3C) >> 2);
+ do {
+ c4 = str.charCodeAt(i++) & 0xff;
+ if (c4 === 61) {
+ return Binary$_mergeCharCode$AI(out);
+ }
+ c4 = (Binary._base64DecodeChars[c4] | 0);
+ } while (i < len && c4 === -1);
+ if (c4 === -1) {
+ break;
+ }
+ out.push((c3 & 0x03) << 6 | c4);
+ }
+ return Binary$_mergeCharCode$AI(out);
+};
+
+var Binary$base64decode$S = Binary.base64decode$S;
+
+/**
+ * class LoadedStringResult extends Object
+ * @constructor
+ */
+function LoadedStringResult() {
+}
+
+/**
+ * @constructor
+ * @param {!string} data
+ * @param {!number} offset
+ */
+function LoadedStringResult$SI(data, offset) {
+ /** @type {!number} */
+ var strLength;
+ /** @type {Array.<undefined|!string>} */
+ var bytes;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var code;
+ /** @type {!number} */
+ var offset$0;
+ this.result = "";
+ this.offset = 0;
+ offset$0 = offset++;
+ strLength = data.charCodeAt(offset$0);
+ if (strLength > 32767) {
+ strLength = strLength - 32768;
+ bytes = [ ];
+ for (i = 0; i < strLength; i += 2) {
+ code = data.charCodeAt(offset);
+ bytes.push(String.fromCharCode(code & 0x00ff));
+ if (i !== strLength - 1) {
+ bytes.push(String.fromCharCode(code >>> 8));
+ }
+ offset++;
+ }
+ this.result = bytes.join('');
+ this.offset = offset;
+ } else {
+ this.result = data.slice(offset, offset + strLength);
+ this.offset = (offset + strLength | 0);
+ }
+};
+
+LoadedStringResult$SI.prototype = new LoadedStringResult;
+
+/**
+ * class LoadedStringListResult extends Object
+ * @constructor
+ */
+function LoadedStringListResult() {
+}
+
+/**
+ * @constructor
+ * @param {!string} data
+ * @param {!number} offset
+ */
+function LoadedStringListResult$SI(data, offset) {
+ /** @type {!number} */
+ var length;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var strLength;
+ /** @type {!string} */
+ var resultStr;
+ /** @type {Array.<undefined|!string>} */
+ var bytes;
+ /** @type {!number} */
+ var j;
+ /** @type {!number} */
+ var code;
+ /** @type {!number} */
+ var result$0;
+ /** @type {!number} */
+ var offset$0;
+ this.offset = 0;
+ this.result = [ ];
+ result$0 = data.charCodeAt(offset) * 65536 + data.charCodeAt(offset + 1);
+ length = result$0;
+ offset += 2;
+ for (i = 0; i < length; i++) {
+ offset$0 = offset++;
+ strLength = data.charCodeAt(offset$0);
+ if (strLength > 32767) {
+ strLength = strLength - 32768;
+ bytes = [ ];
+ for (j = 0; j < strLength; j += 2) {
+ code = data.charCodeAt(offset);
+ bytes.push(String.fromCharCode(code & 0x00ff));
+ if (j !== strLength - 1) {
+ bytes.push(String.fromCharCode(code >>> 8));
+ }
+ offset++;
+ }
+ resultStr = bytes.join('');
+ } else {
+ resultStr = data.slice(offset, offset + strLength);
+ offset = (offset + strLength | 0);
+ }
+ this.result.push(resultStr);
+ }
+ this.offset = offset;
+};
+
+LoadedStringListResult$SI.prototype = new LoadedStringListResult;
+
+/**
+ * class LoadedStringListMapResult extends Object
+ * @constructor
+ */
+function LoadedStringListMapResult() {
+}
+
+/**
+ * @constructor
+ * @param {!string} data
+ * @param {!number} offset
+ */
+function LoadedStringListMapResult$SI(data, offset) {
+ /** @type {!number} */
+ var length;
+ /** @type {!number} */
+ var i;
+ /** @type {LoadedStringResult} */
+ var keyResult;
+ /** @type {LoadedStringListResult} */
+ var valueResult;
+ /** @type {!number} */
+ var result$0;
+ /** @type {!number} */
+ var offset$0;
+ this.offset = 0;
+ this.result = ({ });
+ result$0 = data.charCodeAt(offset) * 65536 + data.charCodeAt(offset + 1);
+ length = result$0;
+ offset += 2;
+ for (i = 0; i < length; i++) {
+ keyResult = new LoadedStringResult$SI(data, offset);
+ offset$0 = keyResult.offset;
+ valueResult = new LoadedStringListResult$SI(data, offset$0);
+ this.result[keyResult.result] = valueResult.result;
+ offset = valueResult.offset;
+ }
+ this.offset = offset;
+};
+
+LoadedStringListMapResult$SI.prototype = new LoadedStringListMapResult;
+
+/**
+ * class LoadedNumberListResult extends Object
+ * @constructor
+ */
+function LoadedNumberListResult() {
+}
+
+/**
+ * @constructor
+ * @param {!string} data
+ * @param {!number} offset
+ */
+function LoadedNumberListResult$SI(data, offset) {
+ /** @type {!number} */
+ var resultLength;
+ /** @type {!number} */
+ var originalOffset;
+ /** @type {Array.<undefined|!number>} */
+ var result;
+ /** @type {!number} */
+ var tag;
+ /** @type {!number} */
+ var length;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var result$0;
+ /** @type {!number} */
+ var value1$0;
+ this.result = null;
+ this.offset = 0;
+ result$0 = data.charCodeAt(offset) * 65536 + data.charCodeAt(offset + 1);
+ resultLength = result$0;
+ originalOffset = offset;
+ offset += 2;
+ result = [ ];
+ while (result.length < resultLength) {
+ tag = data.charCodeAt(offset++);
+ if (tag >>> 15 === 1) {
+ value1$0 = resultLength - result.length;
+ length = (value1$0 <= 15 ? value1$0 : 15);
+ for (i = 0; i < length; i++) {
+ if (tag >>> i & 0x1) {
+ result.push(Binary$load32bitNumber$SI(data, offset));
+ offset += 2;
+ } else {
+ result.push(0);
+ }
+ }
+ } else {
+ if (tag >>> 14 === 1) {
+ length = tag - 0x4000 + 1;
+ for (i = 0; i < length; i++) {
+ result.push(Binary$load32bitNumber$SI(data, offset));
+ offset += 2;
+ }
+ } else {
+ length = tag + 1;
+ for (i = 0; i < length; i++) {
+ result.push(0);
+ }
+ }
+ }
+ }
+ this.result = result;
+ this.offset = offset;
+};
+
+LoadedNumberListResult$SI.prototype = new LoadedNumberListResult;
+
+/**
+ * class CompressionReport extends Object
+ * @constructor
+ */
+function CompressionReport() {
+}
+
+/**
+ * @constructor
+ */
+function CompressionReport$() {
+ this.source = 0;
+ this.result = 0;
+};
+
+CompressionReport$.prototype = new CompressionReport;
+
+/**
+ * @param {CompressionReport} $this
+ * @param {!number} source
+ * @param {!number} result
+ */
+CompressionReport.add$LCompressionReport$II = function ($this, source, result) {
+ $this.source += source;
+ $this.result += result;
+};
+
+var CompressionReport$add$LCompressionReport$II = CompressionReport.add$LCompressionReport$II;
+
+/**
+ * @param {CompressionReport} $this
+ * @return {!number}
+ */
+CompressionReport.rate$LCompressionReport$ = function ($this) {
+ return (Math.round($this.result * 100.0 / $this.source) | 0);
+};
+
+var CompressionReport$rate$LCompressionReport$ = CompressionReport.rate$LCompressionReport$;
+
+/**
+ * class Stemmer
+ * @constructor
+ */
+function Stemmer() {
+}
+
+Stemmer.prototype.$__jsx_implements_Stemmer = true;
+
+/**
+ * @constructor
+ */
+function Stemmer$() {
+};
+
+Stemmer$.prototype = new Stemmer;
+
+/**
+ * class js extends Object
+ * @constructor
+ */
+function js() {
+}
+
+/**
+ * @constructor
+ */
+function js$() {
+};
+
+js$.prototype = new js;
+
+/**
+ * class Metadata extends Object
+ * @constructor
+ */
+function Metadata() {
+}
+
+/**
+ * @constructor
+ * @param {Oktavia} parent
+ */
+function Metadata$LOktavia$(parent) {
+ this._parent = parent;
+ this._bitVector = new BitVector$();
+};
+
+Metadata$LOktavia$.prototype = new Metadata;
+
+/**
+ * @return {!number}
+ */
+Metadata.prototype._size$ = function () {
+ /** @type {BitVector} */
+ var this$0;
+ /** @type {!number} */
+ var i$0;
+ /** @type {BitVector} */
+ var _bitVector$0;
+ this$0 = _bitVector$0 = this._bitVector;
+ i$0 = _bitVector$0._size;
+ return this$0.rank$IB(i$0, true);
+};
+
+/**
+ * @param {!number} index
+ * @return {!string}
+ */
+Metadata.prototype.getContent$I = function (index) {
+ /** @type {!number} */
+ var startPosition;
+ /** @type {!number} */
+ var length;
+ if (index < 0 || this._size$() <= index) {
+ throw new Error("Section.getContent() : range error " + (index + ""));
+ }
+ startPosition = 0;
+ if (index > 0) {
+ startPosition = this._bitVector.select$I(index - 1) + 1;
+ }
+ length = this._bitVector.select$I(index) - startPosition + 1;
+ return this._parent._getSubstring$II(startPosition, length);
+};
+
+/**
+ * @param {!number} index
+ * @return {!number}
+ */
+Metadata.prototype.getStartPosition$I = function (index) {
+ /** @type {!number} */
+ var startPosition;
+ if (index < 0 || this._size$() <= index) {
+ throw new Error("Section.getContent() : range error " + (index + ""));
+ }
+ startPosition = 0;
+ if (index > 0) {
+ startPosition = this._bitVector.select$I(index - 1) + 1;
+ }
+ return (startPosition | 0);
+};
+
+/**
+ * @param {SingleResult} result
+ * @param {Array.<undefined|!number>} positions
+ * @param {!string} word
+ * @param {!boolean} stemmed
+ */
+Metadata.prototype.grouping$LSingleResult$AISB = function (result, positions, word, stemmed) {
+};
+
+/**
+ * @param {!number} index
+ * @return {!string}
+ */
+Metadata.prototype.getInformation$I = function (index) {
+ return '';
+};
+
+/**
+ */
+Metadata.prototype._build$ = function () {
+ this._bitVector.build$();
+};
+
+/**
+ * @param {!string} name
+ * @param {!string} data
+ * @param {!number} offset
+ * @return {!number}
+ */
+Metadata.prototype._load$SSI = function (name, data, offset) {
+ offset = this._bitVector.load$SI(data, offset);
+ this._parent._metadataLabels.push(name);
+ this._parent._metadatas[name] = this;
+ return offset;
+};
+
+/**
+ * @return {!string}
+ */
+Metadata.prototype._dump$ = function () {
+ /** @type {BitVector} */
+ var this$0;
+ /** @type {Array.<undefined|!string>} */
+ var contents$0;
+ this$0 = this._bitVector;
+ contents$0 = [ ];
+ contents$0.push(Binary$dump32bitNumber$N(this$0._size));
+ contents$0.push(Binary$dump32bitNumberList$AN(this$0._v));
+ return contents$0.join('');
+};
+
+/**
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+Metadata.prototype._dump$LCompressionReport$ = function (report) {
+ /** @type {BitVector} */
+ var this$0;
+ /** @type {Array.<undefined|!string>} */
+ var contents$0;
+ this$0 = this._bitVector;
+ contents$0 = [ ];
+ contents$0.push(Binary$dump32bitNumber$N(this$0._size));
+ CompressionReport$add$LCompressionReport$II(report, 2, 2);
+ contents$0.push(Binary$dump32bitNumberList$ANLCompressionReport$(this$0._v, report));
+ return contents$0.join('');
+};
+
+/**
+ * class Section extends Metadata
+ * @constructor
+ */
+function Section() {
+}
+
+Section.prototype = new Metadata;
+/**
+ * @constructor
+ * @param {Oktavia} parent
+ */
+function Section$LOktavia$(parent) {
+ this._parent = parent;
+ this._bitVector = new BitVector$();
+ this._names = [ ];
+};
+
+Section$LOktavia$.prototype = new Section;
+
+/**
+ * @param {!string} name
+ */
+Section.prototype.setTail$S = function (name) {
+ /** @type {!number} */
+ var index$0;
+ /** @type {Oktavia} */
+ var this$0;
+ /** @type {FMIndex} */
+ var this$0$0;
+ this$0 = this._parent;
+ this$0$0 = this$0._fmindex;
+ index$0 = this$0$0._substr.length;
+ this._names.push(name);
+ this._bitVector.set$I(index$0 - 1);
+};
+
+/**
+ * @param {!string} name
+ * @param {!number} index
+ */
+Section.prototype.setTail$SI = function (name, index) {
+ this._names.push(name);
+ this._bitVector.set$I(index - 1);
+};
+
+/**
+ * @return {!number}
+ */
+Section.prototype.size$ = function () {
+ return (this._names.length | 0);
+};
+
+/**
+ * @param {!number} position
+ * @return {!number}
+ */
+Section.prototype.getSectionIndex$I = function (position) {
+ /** @type {BitVector} */
+ var this$0;
+ if (position < 0 || this._bitVector.size$() <= position) {
+ throw new Error("Section.getSectionIndex() : range error " + (position + ""));
+ }
+ this$0 = this._bitVector;
+ return this$0.rank$IB(position, true);
+};
+
+/**
+ * @param {!number} index
+ * @return {!string}
+ */
+Section.prototype.getName$I = function (index) {
+ if (index < 0 || this._names.length <= index) {
+ throw new Error("Section.getName() : range error");
+ }
+ return this._names[index];
+};
+
+/**
+ * @param {SingleResult} result
+ * @param {Array.<undefined|!number>} positions
+ * @param {!string} word
+ * @param {!boolean} stemmed
+ */
+Section.prototype.grouping$LSingleResult$AISB = function (result, positions, word, stemmed) {
+ /** @type {!number} */
+ var i;
+ /** @type {undefined|!number} */
+ var position;
+ /** @type {!number} */
+ var index;
+ /** @type {SearchUnit} */
+ var unit;
+ for (i = 0; i < positions.length; i++) {
+ position = positions[i];
+ index = this.getSectionIndex$I(position);
+ unit = SingleResult$getSearchUnit$LSingleResult$I(result, index);
+ if (unit.startPosition < 0) {
+ unit.startPosition = this.getStartPosition$I(index);
+ }
+ SearchUnit$addPosition$LSearchUnit$SIB(unit, word, position - unit.startPosition, stemmed);
+ }
+};
+
+/**
+ * @param {!number} index
+ * @return {!string}
+ */
+Section.prototype.getInformation$I = function (index) {
+ return this.getName$I(index);
+};
+
+/**
+ * @param {Oktavia} parent
+ * @param {!string} name
+ * @param {!string} data
+ * @param {!number} offset
+ * @return {!number}
+ */
+Section._load$LOktavia$SSI = function (parent, name, data, offset) {
+ /** @type {LoadedStringListResult} */
+ var strs;
+ /** @type {Section} */
+ var section;
+ /** @type {!number} */
+ var offset$0;
+ strs = new LoadedStringListResult$SI(data, offset);
+ section = new Section$LOktavia$(parent);
+ section._names = strs.result;
+ offset$0 = strs.offset;
+ offset$0 = section._bitVector.load$SI(data, offset$0);
+ section._parent._metadataLabels.push(name);
+ section._parent._metadatas[name] = section;
+ return offset$0;
+};
+
+var Section$_load$LOktavia$SSI = Section._load$LOktavia$SSI;
+
+/**
+ * @return {!string}
+ */
+Section.prototype._dump$ = function () {
+ return [ Binary$dump16bitNumber$I(0), Binary$dumpStringList$AS(this._names), Metadata.prototype._dump$.call(this) ].join('');
+};
+
+/**
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+Section.prototype._dump$LCompressionReport$ = function (report) {
+ CompressionReport$add$LCompressionReport$II(report, 1, 1);
+ return [ Binary$dump16bitNumber$I(0), Binary$dumpStringList$ASLCompressionReport$(this._names, report), Metadata.prototype._dump$LCompressionReport$.call(this, report) ].join('');
+};
+
+/**
+ * class Splitter extends Metadata
+ * @constructor
+ */
+function Splitter() {
+}
+
+Splitter.prototype = new Metadata;
+/**
+ * @constructor
+ * @param {Oktavia} parent
+ */
+function Splitter$LOktavia$(parent) {
+ this._parent = parent;
+ this._bitVector = new BitVector$();
+ this.name = null;
+};
+
+Splitter$LOktavia$.prototype = new Splitter;
+
+/**
+ * @constructor
+ * @param {Oktavia} parent
+ * @param {!string} name
+ */
+function Splitter$LOktavia$S(parent, name) {
+ this._parent = parent;
+ this._bitVector = new BitVector$();
+ this.name = name;
+};
+
+Splitter$LOktavia$S.prototype = new Splitter;
+
+/**
+ * @return {!number}
+ */
+Splitter.prototype.size$ = function () {
+ /** @type {BitVector} */
+ var this$0$0;
+ /** @type {!number} */
+ var i$0$0;
+ /** @type {BitVector} */
+ var _bitVector$0;
+ this$0$0 = _bitVector$0 = this._bitVector;
+ i$0$0 = _bitVector$0._size;
+ return this$0$0.rank$IB(i$0$0, true);
+};
+
+/**
+ */
+Splitter.prototype.split$ = function () {
+ /** @type {!number} */
+ var index$0;
+ /** @type {Oktavia} */
+ var this$0;
+ /** @type {FMIndex} */
+ var this$0$0;
+ this$0 = this._parent;
+ this$0$0 = this$0._fmindex;
+ index$0 = this$0$0._substr.length;
+ this._bitVector.set$I(index$0 - 1);
+};
+
+/**
+ * @param {!number} index
+ */
+Splitter.prototype.split$I = function (index) {
+ this._bitVector.set$I(index - 1);
+};
+
+/**
+ * @param {!number} position
+ * @return {!number}
+ */
+Splitter.prototype.getIndex$I = function (position) {
+ /** @type {BitVector} */
+ var this$0;
+ if (position < 0 || this._bitVector.size$() <= position) {
+ throw new Error("Section.getSectionIndex() : range error");
+ }
+ this$0 = this._bitVector;
+ return this$0.rank$IB(position, true);
+};
+
+/**
+ * @param {SingleResult} result
+ * @param {Array.<undefined|!number>} positions
+ * @param {!string} word
+ * @param {!boolean} stemmed
+ */
+Splitter.prototype.grouping$LSingleResult$AISB = function (result, positions, word, stemmed) {
+ /** @type {!number} */
+ var i;
+ /** @type {undefined|!number} */
+ var position;
+ /** @type {!number} */
+ var index;
+ /** @type {SearchUnit} */
+ var unit;
+ for (i = 0; i < positions.length; i++) {
+ position = positions[i];
+ index = this.getIndex$I(position);
+ unit = SingleResult$getSearchUnit$LSingleResult$I(result, index);
+ if (unit.startPosition < 0) {
+ unit.startPosition = this.getStartPosition$I(index);
+ }
+ SearchUnit$addPosition$LSearchUnit$SIB(unit, word, position - unit.startPosition, stemmed);
+ }
+};
+
+/**
+ * @param {!number} index
+ * @return {!string}
+ */
+Splitter.prototype.getInformation$I = function (index) {
+ return (this.name != null ? this.name + (index + 1 + "") : '');
+};
+
+/**
+ * @param {Oktavia} parent
+ * @param {!string} name
+ * @param {!string} data
+ * @param {!number} offset
+ * @return {!number}
+ */
+Splitter._load$LOktavia$SSI = function (parent, name, data, offset) {
+ /** @type {Splitter} */
+ var section;
+ section = new Splitter$LOktavia$(parent);
+ offset = section._bitVector.load$SI(data, offset);
+ section._parent._metadataLabels.push(name);
+ section._parent._metadatas[name] = section;
+ return offset;
+};
+
+var Splitter$_load$LOktavia$SSI = Splitter._load$LOktavia$SSI;
+
+/**
+ * @return {!string}
+ */
+Splitter.prototype._dump$ = function () {
+ return [ Binary$dump16bitNumber$I(1), Metadata.prototype._dump$.call(this) ].join('');
+};
+
+/**
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+Splitter.prototype._dump$LCompressionReport$ = function (report) {
+ CompressionReport$add$LCompressionReport$II(report, 1, 1);
+ return [ Binary$dump16bitNumber$I(1), Metadata.prototype._dump$LCompressionReport$.call(this, report) ].join('');
+};
+
+/**
+ * class Table extends Metadata
+ * @constructor
+ */
+function Table() {
+}
+
+Table.prototype = new Metadata;
+/**
+ * @constructor
+ * @param {Oktavia} parent
+ * @param {Array.<undefined|!string>} headers
+ */
+function Table$LOktavia$AS(parent, headers) {
+ this._parent = parent;
+ this._bitVector = new BitVector$();
+ this._headers = headers;
+ this._columnTails = new BitVector$();
+};
+
+Table$LOktavia$AS.prototype = new Table;
+
+/**
+ * @return {!number}
+ */
+Table.prototype.rowSize$ = function () {
+ /** @type {BitVector} */
+ var this$0$0;
+ /** @type {!number} */
+ var i$0$0;
+ /** @type {BitVector} */
+ var _bitVector$0;
+ this$0$0 = _bitVector$0 = this._bitVector;
+ i$0$0 = _bitVector$0._size;
+ return this$0$0.rank$IB(i$0$0, true);
+};
+
+/**
+ * @return {!number}
+ */
+Table.prototype.columnSize$ = function () {
+ return (this._headers.length | 0);
+};
+
+/**
+ */
+Table.prototype.setColumnTail$ = function () {
+ /** @type {!number} */
+ var index;
+ /** @type {Oktavia} */
+ var this$0;
+ /** @type {FMIndex} */
+ var this$0$0;
+ /** @type {Oktavia} */
+ var _parent$0;
+ this$0 = _parent$0 = this._parent;
+ this$0$0 = this$0._fmindex;
+ index = this$0$0._substr.length;
+ _parent$0._fmindex.push$S(Oktavia.eob);
+ this._columnTails.set$I(index - 1);
+};
+
+/**
+ */
+Table.prototype.setRowTail$ = function () {
+ /** @type {!number} */
+ var index;
+ /** @type {Oktavia} */
+ var this$0;
+ /** @type {FMIndex} */
+ var this$0$0;
+ this$0 = this._parent;
+ this$0$0 = this$0._fmindex;
+ index = this$0$0._substr.length;
+ this._bitVector.set$I(index - 1);
+};
+
+/**
+ * @param {!number} position
+ * @return {Array.<undefined|!number>}
+ */
+Table.prototype.getCell$I = function (position) {
+ /** @type {!number} */
+ var row;
+ /** @type {!number} */
+ var currentColumn;
+ /** @type {!number} */
+ var lastRowColumn;
+ /** @type {!number} */
+ var startPosition;
+ /** @type {Array.<undefined|!number>} */
+ var result;
+ /** @type {BitVector} */
+ var this$0;
+ /** @type {BitVector} */
+ var this$1;
+ if (position < 0 || this._bitVector.size$() <= position) {
+ throw new Error("Section.getSectionIndex() : range error " + (position + ""));
+ }
+ this$0 = this._bitVector;
+ row = this$0.rank$IB(position, true);
+ this$1 = this._columnTails;
+ currentColumn = this$1.rank$IB(position, true);
+ lastRowColumn = 0;
+ if (row > 0) {
+ startPosition = this._bitVector.select$I(row - 1) + 1;
+ lastRowColumn = this._columnTails.rank$I(startPosition);
+ }
+ result = [ row, currentColumn - lastRowColumn ];
+ return result;
+};
+
+/**
+ * @param {!number} rowIndex
+ * @return {Object.<string, undefined|!string>}
+ */
+Table.prototype.getRowContent$I = function (rowIndex) {
+ /** @type {!string} */
+ var content;
+ /** @type {Array.<undefined|!string>} */
+ var values;
+ /** @type {Object.<string, undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var i;
+ content = this.getContent$I(rowIndex);
+ values = content.split(Oktavia.eob, this._headers.length);
+ result = ({ });
+ for (i in this._headers) {
+ if (i < values.length) {
+ result[this._headers[i]] = values[i];
+ } else {
+ result[this._headers[i]] = '';
+ }
+ }
+ return result;
+};
+
+/**
+ * @param {SingleResult} result
+ * @param {Array.<undefined|!number>} positions
+ * @param {!string} word
+ * @param {!boolean} stemmed
+ */
+Table.prototype.grouping$LSingleResult$AISB = function (result, positions, word, stemmed) {
+};
+
+/**
+ * @param {!number} index
+ * @return {!string}
+ */
+Table.prototype.getInformation$I = function (index) {
+ return '';
+};
+
+/**
+ */
+Table.prototype._build$ = function () {
+ this._bitVector.build$();
+ this._columnTails.build$();
+};
+
+/**
+ * @param {Oktavia} parent
+ * @param {!string} name
+ * @param {!string} data
+ * @param {!number} offset
+ * @return {!number}
+ */
+Table._load$LOktavia$SSI = function (parent, name, data, offset) {
+ /** @type {LoadedStringListResult} */
+ var strs;
+ /** @type {Table} */
+ var table;
+ /** @type {!number} */
+ var offset$0;
+ strs = new LoadedStringListResult$SI(data, offset);
+ table = new Table$LOktavia$AS(parent, strs.result);
+ offset$0 = strs.offset;
+ offset$0 = table._bitVector.load$SI(data, offset$0);
+ table._parent._metadataLabels.push(name);
+ table._parent._metadatas[name] = table;
+ offset = offset$0;
+ return table._columnTails.load$SI(data, offset$0);
+};
+
+var Table$_load$LOktavia$SSI = Table._load$LOktavia$SSI;
+
+/**
+ * @return {!string}
+ */
+Table.prototype._dump$ = function () {
+ return [ Binary$dump16bitNumber$I(2), Binary$dumpStringList$AS(this._headers), Metadata.prototype._dump$.call(this), this._columnTails.dump$() ].join('');
+};
+
+/**
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+Table.prototype._dump$LCompressionReport$ = function (report) {
+ CompressionReport$add$LCompressionReport$II(report, 1, 1);
+ return [ Binary$dump16bitNumber$I(2), Binary$dumpStringList$ASLCompressionReport$(this._headers, report), Metadata.prototype._dump$LCompressionReport$.call(this, report), this._columnTails.dump$LCompressionReport$(report) ].join('');
+};
+
+/**
+ * class Block extends Metadata
+ * @constructor
+ */
+function Block() {
+}
+
+Block.prototype = new Metadata;
+/**
+ * @constructor
+ * @param {Oktavia} parent
+ */
+function Block$LOktavia$(parent) {
+ this._parent = parent;
+ this._bitVector = new BitVector$();
+ this._names = [ ];
+ this._start = false;
+};
+
+Block$LOktavia$.prototype = new Block;
+
+/**
+ * @param {!string} blockName
+ */
+Block.prototype.startBlock$S = function (blockName) {
+ this.startBlock$SI(blockName, this._parent.contentSize$());
+};
+
+/**
+ * @param {!string} blockName
+ * @param {!number} index
+ */
+Block.prototype.startBlock$SI = function (blockName, index) {
+ if (this._start) {
+ throw new Error('Splitter `' + this._names[this._names.length - 1] + '` is not closed');
+ }
+ this._start = true;
+ this._names.push(blockName);
+ this._bitVector.set$I(index - 1);
+};
+
+/**
+ */
+Block.prototype.endBlock$ = function () {
+ this.endBlock$I(this._parent.contentSize$());
+};
+
+/**
+ * @param {!number} index
+ */
+Block.prototype.endBlock$I = function (index) {
+ if (! this._start) {
+ throw new Error('Splitter is not started');
+ }
+ this._start = false;
+ this._bitVector.set$I(index - 1);
+};
+
+/**
+ * @return {!number}
+ */
+Block.prototype.size$ = function () {
+ return (this._names.length | 0);
+};
+
+/**
+ * @param {!number} position
+ * @return {!number}
+ */
+Block.prototype.blockIndex$I = function (position) {
+ /** @type {!number} */
+ var result;
+ /** @type {BitVector} */
+ var this$0;
+ if (position < 0 || this._parent._fmindex.size$() - 1 <= position) {
+ throw new Error("Block.blockIndex() : range error " + (position + ""));
+ }
+ if (position >= this._bitVector.size$()) {
+ position = (this._bitVector.size$() - 1 | 0);
+ result = (this._bitVector.rank$I(position) + 1 | 0);
+ } else {
+ this$0 = this._bitVector;
+ result = this$0.rank$IB(position, true);
+ }
+ return result;
+};
+
+/**
+ * @param {!number} position
+ * @return {!boolean}
+ */
+Block.prototype.inBlock$I = function (position) {
+ /** @type {!number} */
+ var blockIndex;
+ blockIndex = this.blockIndex$I(position);
+ return blockIndex % 2 !== 0;
+};
+
+/**
+ * @param {!number} position
+ * @return {!string}
+ */
+Block.prototype.getBlockContent$I = function (position) {
+ /** @type {!number} */
+ var blockIndex;
+ /** @type {!string} */
+ var result;
+ blockIndex = this.blockIndex$I(position);
+ if (blockIndex % 2 !== 0) {
+ result = this.getContent$I(blockIndex);
+ } else {
+ result = '';
+ }
+ return result;
+};
+
+/**
+ * @param {!number} position
+ * @return {!string}
+ */
+Block.prototype.getBlockName$I = function (position) {
+ /** @type {!number} */
+ var blockIndex;
+ /** @type {!string} */
+ var result;
+ blockIndex = this.blockIndex$I(position);
+ if (blockIndex % 2 !== 0) {
+ result = this._names[blockIndex >>> 1];
+ } else {
+ result = '';
+ }
+ return result;
+};
+
+/**
+ * @param {SingleResult} result
+ * @param {Array.<undefined|!number>} positions
+ * @param {!string} word
+ * @param {!boolean} stemmed
+ */
+Block.prototype.grouping$LSingleResult$AISB = function (result, positions, word, stemmed) {
+};
+
+/**
+ * @param {!number} index
+ * @return {!string}
+ */
+Block.prototype.getInformation$I = function (index) {
+ return '';
+};
+
+/**
+ * @param {Oktavia} parent
+ * @param {!string} name
+ * @param {!string} data
+ * @param {!number} offset
+ * @return {!number}
+ */
+Block._load$LOktavia$SSI = function (parent, name, data, offset) {
+ /** @type {LoadedStringListResult} */
+ var strs;
+ /** @type {Block} */
+ var block;
+ /** @type {!number} */
+ var offset$0;
+ strs = new LoadedStringListResult$SI(data, offset);
+ block = new Block$LOktavia$(parent);
+ block._names = strs.result;
+ offset$0 = strs.offset;
+ offset$0 = block._bitVector.load$SI(data, offset$0);
+ block._parent._metadataLabels.push(name);
+ block._parent._metadatas[name] = block;
+ return offset$0;
+};
+
+var Block$_load$LOktavia$SSI = Block._load$LOktavia$SSI;
+
+/**
+ * @return {!string}
+ */
+Block.prototype._dump$ = function () {
+ return [ Binary$dump16bitNumber$I(3), Binary$dumpStringList$AS(this._names), Metadata.prototype._dump$.call(this) ].join('');
+};
+
+/**
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+Block.prototype._dump$LCompressionReport$ = function (report) {
+ CompressionReport$add$LCompressionReport$II(report, 1, 1);
+ return [ Binary$dump16bitNumber$I(3), Binary$dumpStringList$ASLCompressionReport$(this._names, report), Metadata.prototype._dump$LCompressionReport$.call(this, report) ].join('');
+};
+
+/**
+ * class FMIndex extends Object
+ * @constructor
+ */
+function FMIndex() {
+}
+
+/**
+ * @constructor
+ */
+function FMIndex$() {
+ /** @type {Array.<undefined|!number>} */
+ var _rlt$0;
+ this._ssize = 0;
+ (this._ddic = 0, this._head = 0);
+ this._substr = "";
+ this._sv = new WaveletMatrix$();
+ this._posdic = [ ];
+ this._idic = [ ];
+ _rlt$0 = this._rlt = [ ];
+ _rlt$0.length = 65536;
+};
+
+FMIndex$.prototype = new FMIndex;
+
+/**
+ */
+FMIndex.prototype.clear$ = function () {
+ /** @type {WaveletMatrix} */
+ var this$0;
+ this$0 = this._sv;
+ this$0._bv.length = 0;
+ this$0._seps.length = 0;
+ this$0._size = 0;
+ this._posdic.length = 0;
+ this._idic.length = 0;
+ this._ddic = 0;
+ this._head = 0;
+ this._substr = "";
+};
+
+/**
+ * @return {!number}
+ */
+FMIndex.prototype.size$ = function () {
+ /** @type {WaveletMatrix} */
+ var this$0;
+ this$0 = this._sv;
+ return this$0._size;
+};
+
+/**
+ * @return {!number}
+ */
+FMIndex.prototype.contentSize$ = function () {
+ return this._substr.length;
+};
+
+/**
+ * @param {!string} key
+ * @return {!number}
+ */
+FMIndex.prototype.getRows$S = function (key) {
+ /** @type {Array.<undefined|!number>} */
+ var pos;
+ pos = [ ];
+ return this.getRows$SAI(key, pos);
+};
+
+/**
+ * @param {!string} key
+ * @param {Array.<undefined|!number>} pos
+ * @return {!number}
+ */
+FMIndex.prototype.getRows$SAI = function (key, pos) {
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var code;
+ /** @type {!number} */
+ var first;
+ /** @type {undefined|!number} */
+ var last;
+ /** @type {!number} */
+ var c;
+ /** @type {Array.<undefined|!number>} */
+ var _rlt$0;
+ i = key.length - 1;
+ code = key.charCodeAt(i);
+ first = (_rlt$0 = this._rlt)[code] + 1;
+ last = _rlt$0[code + 1];
+ while (first <= last) {
+ if (i === 0) {
+ pos[0] = (-- first | 0);
+ pos[1] = -- last;
+ return (last - first + 1 | 0);
+ }
+ i--;
+ c = key.charCodeAt(i);
+ first = this._rlt[c] + this._sv.rank$II(first - 1, c) + 1;
+ last = this._rlt[c] + this._sv.rank$II(last, c);
+ }
+ return 0;
+};
+
+/**
+ * @param {!number} i
+ * @return {!number}
+ */
+FMIndex.prototype.getPosition$I = function (i) {
+ /** @type {!number} */
+ var pos;
+ /** @type {!number} */
+ var c;
+ if (i >= this.size$()) {
+ throw new Error("FMIndex.getPosition() : range error");
+ }
+ pos = 0;
+ while (i !== this._head) {
+ if (i % this._ddic === 0) {
+ pos += this._posdic[i / this._ddic] + 1;
+ break;
+ }
+ c = this._sv.get$I(i);
+ i = this._rlt[c] + this._sv.rank$II(i, c);
+ pos++;
+ }
+ return (pos % this.size$() | 0);
+};
+
+/**
+ * @param {!number} pos
+ * @param {!number} len
+ * @return {!string}
+ */
+FMIndex.prototype.getSubstring$II = function (pos, len) {
+ /** @type {!number} */
+ var pos_end;
+ /** @type {!number} */
+ var pos_tmp;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var pos_idic;
+ /** @type {!string} */
+ var substr;
+ /** @type {!number} */
+ var c;
+ /** @type {!number} */
+ var _ddic$0;
+ if (pos >= this.size$()) {
+ throw new Error("FMIndex.getSubstring() : range error");
+ }
+ pos_end = Math.min(pos + len, this.size$());
+ pos_tmp = this.size$() - 1;
+ i = this._head;
+ pos_idic = Math.floor((pos_end + (_ddic$0 = this._ddic) - 2) / _ddic$0);
+ if (pos_idic < this._idic.length) {
+ pos_tmp = pos_idic * this._ddic;
+ i = this._idic[pos_idic];
+ }
+ substr = "";
+ while (pos_tmp >= pos) {
+ c = this._sv.get$I(i);
+ i = this._rlt[c] + this._sv.rank$II(i, c);
+ if (pos_tmp < pos_end) {
+ substr = String.fromCharCode(c) + substr;
+ }
+ if (pos_tmp === 0) {
+ break;
+ }
+ pos_tmp--;
+ }
+ return substr;
+};
+
+/**
+ */
+FMIndex.prototype.build$ = function () {
+ this.build$SIIB(String.fromCharCode(0), 65535, 20, false);
+};
+
+/**
+ * @param {!string} end_marker
+ * @param {!number} ddic
+ * @param {!boolean} verbose
+ */
+FMIndex.prototype.build$SIB = function (end_marker, ddic, verbose) {
+ this.build$SIIB(end_marker, 65535, ddic, verbose);
+};
+
+/**
+ * @param {!string} end_marker
+ * @param {!number} maxChar
+ * @param {!number} ddic
+ * @param {!boolean} verbose
+ */
+FMIndex.prototype.build$SIIB = function (end_marker, maxChar, ddic, verbose) {
+ /** @type {BurrowsWheelerTransform} */
+ var b;
+ /** @type {!string} */
+ var s;
+ /** @type {!number} */
+ var c;
+ /** @type {!string} */
+ var str$0;
+ /** @type {WaveletMatrix} */
+ var this$0;
+ /** @type {!string} */
+ var _str$0;
+ /** @type {Array.<undefined|!number>} */
+ var _suffixarray$0;
+ if (verbose) {
+ console.time("building burrows-wheeler transform");
+ }
+ this._substr += end_marker;
+ b = ({_str: "", _size: 0, _head: 0, _suffixarray: [ ]});
+ str$0 = this._substr;
+ _str$0 = b._str = str$0;
+ b._size = _str$0.length;
+ _suffixarray$0 = b._suffixarray = SAIS$make$S(str$0);
+ b._head = (_suffixarray$0.indexOf(0) | 0);
+ s = BurrowsWheelerTransform$get$LBurrowsWheelerTransform$(b);
+ this._ssize = s.length;
+ this._head = b._head;
+ b._str = "";
+ b._size = 0;
+ b._head = 0;
+ b._suffixarray.length = 0;
+ this._substr = "";
+ if (verbose) {
+ console.timeEnd("building burrows-wheeler transform");
+ }
+ if (verbose) {
+ console.time("building wavelet matrix");
+ }
+ this$0 = this._sv;
+ this$0._bitsize = (Math.ceil(Math.log(maxChar) / 0.6931471805599453) | 0);
+ if (verbose) {
+ console.log(" maxCharCode: ", maxChar);
+ console.log(" bitSize: ", this._sv.bitsize$());
+ }
+ this._sv.build$S(s);
+ if (verbose) {
+ console.timeEnd("building wavelet matrix");
+ }
+ if (verbose) {
+ console.time("caching rank less than");
+ }
+ for (c = 0; c < maxChar; c++) {
+ this._rlt[c] = this._sv.rank_less_than$II(this._sv.size$(), c);
+ }
+ if (verbose) {
+ console.timeEnd("caching rank less than");
+ }
+ this._ddic = ddic;
+ if (verbose) {
+ console.time("building dictionaries");
+ }
+ this._buildDictionaries$();
+ if (verbose) {
+ console.timeEnd("building dictionaries");
+ console.log('');
+ }
+};
+
+/**
+ */
+FMIndex.prototype._buildDictionaries$ = function () {
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var pos;
+ /** @type {!number} */
+ var c;
+ for (i = 0; i < this._ssize / this._ddic + 1; i++) {
+ this._posdic.push(0);
+ this._idic.push(0);
+ }
+ i = this._head;
+ pos = this.size$() - 1;
+ do {
+ if (i % this._ddic === 0) {
+ this._posdic[Math.floor(i / this._ddic)] = (pos | 0);
+ }
+ if (pos % this._ddic === 0) {
+ this._idic[Math.floor(pos / this._ddic)] = (i | 0);
+ }
+ c = this._sv.get$I(i);
+ i = this._rlt[c] + this._sv.rank$II(i, c);
+ pos--;
+ } while (i !== this._head);
+};
+
+/**
+ * @param {!string} doc
+ */
+FMIndex.prototype.push$S = function (doc) {
+ if (doc.length <= 0) {
+ throw new Error("FMIndex::push(): empty string");
+ }
+ this._substr += doc;
+};
+
+/**
+ * @param {!string} keyword
+ * @return {Array.<undefined|!number>}
+ */
+FMIndex.prototype.search$S = function (keyword) {
+ /** @type {Array.<undefined|!number>} */
+ var result;
+ /** @type {Array.<undefined|!number>} */
+ var position;
+ /** @type {!number} */
+ var rows;
+ /** @type {undefined|!number} */
+ var first;
+ /** @type {undefined|!number} */
+ var last;
+ /** @type {undefined|!number} */
+ var i;
+ result = [ ];
+ position = [ ];
+ rows = this.getRows$SAI(keyword, position);
+ if (rows > 0) {
+ first = position[0];
+ last = position[1];
+ for (i = first; i <= last; i++) {
+ result.push(this.getPosition$I(i));
+ }
+ }
+ return result;
+};
+
+/**
+ * @return {!string}
+ */
+FMIndex.prototype.dump$ = function () {
+ return this.dump$B(false);
+};
+
+/**
+ * @param {!boolean} verbose
+ * @return {!string}
+ */
+FMIndex.prototype.dump$B = function (verbose) {
+ /** @type {Array.<undefined|!string>} */
+ var contents;
+ /** @type {CompressionReport} */
+ var report;
+ /** @type {!number} */
+ var i;
+ contents = [ ];
+ report = ({source: 0, result: 0});
+ contents.push(Binary$dump32bitNumber$N(this._ddic));
+ contents.push(Binary$dump32bitNumber$N(this._ssize));
+ contents.push(Binary$dump32bitNumber$N(this._head));
+ CompressionReport$add$LCompressionReport$II(report, 6, 6);
+ contents.push(this._sv.dump$LCompressionReport$(report));
+ if (verbose) {
+ console.log("Serializing FM-index");
+ console.log(' Wavelet Matrix: ' + (contents[3].length * 2 + "") + ' bytes (' + (Math.round(report.result * 100.0 / report.source) + "") + '%)');
+ }
+ contents.push(Binary$dump32bitNumber$N(this._posdic.length));
+ for (i in this._posdic) {
+ contents.push(Binary$dump32bitNumber$N(this._posdic[i]));
+ }
+ for (i in this._idic) {
+ contents.push(Binary$dump32bitNumber$N(this._idic[i]));
+ }
+ if (verbose) {
+ console.log(' Dictionary Cache: ' + (this._idic.length * 16 + "") + ' bytes');
+ }
+ return contents.join("");
+};
+
+/**
+ * @param {!string} data
+ * @return {!number}
+ */
+FMIndex.prototype.load$S = function (data) {
+ return this.load$SI(data, 0);
+};
+
+/**
+ * @param {!string} data
+ * @param {!number} offset
+ * @return {!number}
+ */
+FMIndex.prototype.load$SI = function (data, offset) {
+ /** @type {!number} */
+ var maxChar;
+ /** @type {!number} */
+ var c;
+ /** @type {!number} */
+ var size;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var result$0;
+ /** @type {!number} */
+ var result$1;
+ result$0 = data.charCodeAt(offset) * 65536 + data.charCodeAt(offset + 1);
+ this._ddic = (result$0 | 0);
+ this._ssize = (Binary$load32bitNumber$SI(data, offset + 2) | 0);
+ this._head = (Binary$load32bitNumber$SI(data, offset + 4) | 0);
+ offset = this._sv.load$SI(data, offset + 6);
+ maxChar = Math.pow(2, this._sv.bitsize$());
+ for (c = 0; c < maxChar; c++) {
+ this._rlt[c] = this._sv.rank_less_than$II(this._sv.size$(), c);
+ }
+ result$1 = data.charCodeAt(offset) * 65536 + data.charCodeAt(offset + 1);
+ size = result$1;
+ offset += 2;
+ for (i = 0; i < size; (i++, offset += 2)) {
+ this._posdic.push(Binary$load32bitNumber$SI(data, offset));
+ }
+ for (i = 0; i < size; (i++, offset += 2)) {
+ this._idic.push(Binary$load32bitNumber$SI(data, offset));
+ }
+ return offset;
+};
+
+/**
+ * class Query extends Object
+ * @constructor
+ */
+function Query() {
+}
+
+/**
+ * @constructor
+ */
+function Query$() {
+ this.word = '';
+ this.or = false;
+ this.not = false;
+ this.raw = false;
+};
+
+Query$.prototype = new Query;
+
+/**
+ * @return {!string}
+ */
+Query.prototype.toString = function () {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ result = [ ];
+ if (this.or) {
+ result.push("OR ");
+ }
+ if (this.not) {
+ result.push("-");
+ }
+ if (this.raw) {
+ result.push('"', this.word, '"');
+ } else {
+ result.push(this.word);
+ }
+ return result.join('');
+};
+
+/**
+ * class Tag extends Object
+ * @constructor
+ */
+function Tag() {
+}
+
+/**
+ * @constructor
+ * @param {!string} name
+ */
+function Tag$S(name) {
+ this.name = name;
+ this.attributes = ({ });
+ this.isSelfClosing = false;
+};
+
+Tag$S.prototype = new Tag;
+
+/**
+ * class _Common extends Object
+ * @constructor
+ */
+function _Common() {
+}
+
+/**
+ * @constructor
+ */
+function _Common$() {
+};
+
+_Common$.prototype = new _Common;
+
+/**
+ * class _State extends Object
+ * @constructor
+ */
+function _State() {
+}
+
+/**
+ * @constructor
+ */
+function _State$() {
+};
+
+_State$.prototype = new _State;
+
+/**
+ * class SAXHandler extends Object
+ * @constructor
+ */
+function SAXHandler() {
+}
+
+/**
+ * @constructor
+ */
+function SAXHandler$() {
+ this.position = 0;
+ this.column = 0;
+ this.line = 0;
+};
+
+SAXHandler$.prototype = new SAXHandler;
+
+/**
+ * @param {Error} error
+ */
+SAXHandler.prototype.onerror$LError$ = function (error) {
+};
+
+/**
+ * @param {!string} text
+ */
+SAXHandler.prototype.ontext$S = function (text) {
+};
+
+/**
+ * @param {!string} doctype
+ */
+SAXHandler.prototype.ondoctype$S = function (doctype) {
+};
+
+/**
+ * @param {!string} name
+ * @param {!string} body
+ */
+SAXHandler.prototype.onprocessinginstruction$SS = function (name, body) {
+};
+
+/**
+ * @param {!string} sgmlDecl
+ */
+SAXHandler.prototype.onsgmldeclaration$S = function (sgmlDecl) {
+};
+
+/**
+ * @param {!string} tagname
+ * @param {Object.<string, undefined|!string>} attributes
+ */
+SAXHandler.prototype.onopentag$SHS = function (tagname, attributes) {
+};
+
+/**
+ * @param {!string} tagname
+ */
+SAXHandler.prototype.onclosetag$S = function (tagname) {
+};
+
+/**
+ * @param {!string} name
+ * @param {!string} value
+ */
+SAXHandler.prototype.onattribute$SS = function (name, value) {
+};
+
+/**
+ * @param {!string} comment
+ */
+SAXHandler.prototype.oncomment$S = function (comment) {
+};
+
+/**
+ */
+SAXHandler.prototype.onopencdata$ = function () {
+};
+
+/**
+ * @param {!string} cdata
+ */
+SAXHandler.prototype.oncdata$S = function (cdata) {
+};
+
+/**
+ */
+SAXHandler.prototype.onclosecdata$ = function () {
+};
+
+/**
+ */
+SAXHandler.prototype.onend$ = function () {
+};
+
+/**
+ */
+SAXHandler.prototype.onready$ = function () {
+};
+
+/**
+ * @param {!string} script
+ */
+SAXHandler.prototype.onscript$S = function (script) {
+};
+
+/**
+ * class _HTMLHandler extends SAXHandler
+ * @constructor
+ */
+function _HTMLHandler() {
+}
+
+_HTMLHandler.prototype = new SAXHandler;
+/**
+ * @constructor
+ * @param {Object.<string, undefined|Array.<undefined|!string>>} styles
+ * @param {!boolean} escape
+ */
+function _HTMLHandler$HASB(styles, escape) {
+ this.position = 0;
+ this.column = 0;
+ this.line = 0;
+ this.text = [ ];
+ this.escape = escape;
+ this.styles = styles;
+};
+
+_HTMLHandler$HASB.prototype = new _HTMLHandler;
+
+/**
+ * @param {!string} str
+ * @return {!string}
+ */
+_HTMLHandler.escapeHTML$S = function (str) {
+ return str.replace(/\n/g, "<br/>").replace(/&/g, "&amp;").replace(/"/g, "&quot;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
+};
+
+var _HTMLHandler$escapeHTML$S = _HTMLHandler.escapeHTML$S;
+
+/**
+ * @param {!string} tagname
+ * @param {Object.<string, undefined|!string>} attributes
+ */
+_HTMLHandler.prototype.onopentag$SHS = function (tagname, attributes) {
+ this.text.push(this.styles[tagname][0]);
+};
+
+/**
+ * @param {!string} tagname
+ */
+_HTMLHandler.prototype.onclosetag$S = function (tagname) {
+ this.text.push(this.styles[tagname][1]);
+};
+
+/**
+ * @param {!string} text
+ */
+_HTMLHandler.prototype.ontext$S = function (text) {
+ if (this.escape) {
+ this.text.push(text.replace(/\n/g, "<br/>").replace(/&/g, "&amp;").replace(/"/g, "&quot;").replace(/</g, "&lt;").replace(/>/g, "&gt;"));
+ } else {
+ this.text.push(text);
+ }
+};
+
+/**
+ * @return {!string}
+ */
+_HTMLHandler.prototype.result$ = function () {
+ return this.text.join('');
+};
+
+/**
+ * class SAXParser extends Object
+ * @constructor
+ */
+function SAXParser() {
+}
+
+/**
+ * @constructor
+ * @param {SAXHandler} handler
+ */
+function SAXParser$LSAXHandler$(handler) {
+ this.q = "";
+ this.c = "";
+ this.bufferCheckPosition = 0;
+ this.looseCase = "";
+ this.tags = [ ];
+ this.closed = false;
+ this.closedRoot = false;
+ this.sawRoot = false;
+ this.tag = null;
+ this.error = null;
+ this.handler = null;
+ this.ENTITIES = null;
+ this.strict = false;
+ this.tagName = "";
+ this.state = 0;
+ this.line = 0;
+ this.column = 0;
+ this.position = 0;
+ this.startTagPosition = 0;
+ this.attribName = "";
+ this.attribValue = "";
+ this.script = "";
+ this.textNode = "";
+ this.attribList = null;
+ this.noscript = false;
+ this.cdata = "";
+ this.procInstBody = "";
+ this.procInstName = "";
+ this.doctype = "";
+ this.entity = "";
+ this.sgmlDecl = "";
+ this.comment = "";
+ this.preTags = 0;
+ this._init$LSAXHandler$B(handler, false);
+};
+
+SAXParser$LSAXHandler$.prototype = new SAXParser;
+
+/**
+ * @constructor
+ * @param {SAXHandler} handler
+ * @param {!boolean} strict
+ */
+function SAXParser$LSAXHandler$B(handler, strict) {
+ this.q = "";
+ this.c = "";
+ this.bufferCheckPosition = 0;
+ this.looseCase = "";
+ this.tags = [ ];
+ this.closed = false;
+ this.closedRoot = false;
+ this.sawRoot = false;
+ this.tag = null;
+ this.error = null;
+ this.handler = null;
+ this.ENTITIES = null;
+ this.strict = false;
+ this.tagName = "";
+ this.state = 0;
+ this.line = 0;
+ this.column = 0;
+ this.position = 0;
+ this.startTagPosition = 0;
+ this.attribName = "";
+ this.attribValue = "";
+ this.script = "";
+ this.textNode = "";
+ this.attribList = null;
+ this.noscript = false;
+ this.cdata = "";
+ this.procInstBody = "";
+ this.procInstName = "";
+ this.doctype = "";
+ this.entity = "";
+ this.sgmlDecl = "";
+ this.comment = "";
+ this.preTags = 0;
+ this._init$LSAXHandler$B(handler, strict);
+};
+
+SAXParser$LSAXHandler$B.prototype = new SAXParser;
+
+/**
+ * @param {SAXHandler} handler
+ * @param {!boolean} strict
+ */
+SAXParser.prototype._init$LSAXHandler$B = function (handler, strict) {
+ this.handler = handler;
+ this.clearBuffers$();
+ this.q = "";
+ this.bufferCheckPosition = 65536;
+ this.looseCase = 'toLowerCase';
+ this.tags = [ ];
+ this.closed = this.closedRoot = this.sawRoot = false;
+ this.tag = null;
+ this.error = null;
+ this.strict = strict;
+ this.noscript = strict;
+ this.state = 1;
+ this.ENTITIES = _Entities$entity_list$();
+ this.attribList = [ ];
+ this.noscript = false;
+ this.preTags = 0;
+};
+
+/**
+ * @param {!boolean} flag
+ */
+SAXParser.prototype.set_noscript$B = function (flag) {
+ this.noscript = flag;
+};
+
+/**
+ * @return {SAXParser}
+ */
+SAXParser.prototype.resume$ = function () {
+ this.error = null;
+ return this;
+};
+
+/**
+ * @return {SAXParser}
+ */
+SAXParser.prototype.close$ = function () {
+ return this.parse$S('');
+};
+
+/**
+ * @param {!string} chunk
+ * @return {SAXParser}
+ */
+SAXParser.prototype.parse$S = function (chunk) {
+ /** @type {Char} */
+ var _;
+ /** @type {!number} */
+ var i;
+ /** @type {!string} */
+ var c;
+ /** @type {!number} */
+ var starti;
+ /** @type {!number} */
+ var pad;
+ /** @type {!number} */
+ var returnState;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$0;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$1;
+ /** @type {RegExp} */
+ var charclass$2;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$3;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$4;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$5;
+ /** @type {!string} */
+ var text$0;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$6;
+ /** @type {RegExp} */
+ var charclass$7;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$8;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$9;
+ /** @type {RegExp} */
+ var charclass$10;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$11;
+ /** @type {RegExp} */
+ var charclass$12;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$13;
+ /** @type {RegExp} */
+ var charclass$14;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$15;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$16;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$17;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$18;
+ /** @type {RegExp} */
+ var charclass$19;
+ /** @type {RegExp} */
+ var charclass$20;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$21;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$22;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$23;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$24;
+ /** @type {!string} */
+ var comment$0;
+ _ = new Char$();
+ if (this.error) {
+ throw this.error;
+ }
+ if (this.closed) {
+ return this.emiterror$S("Cannot write after close. Assign an onready handler.");
+ }
+ (i = 0, c = "");
+ while (this.c = c = chunk.charAt(i++)) {
+ this.position++;
+ if (c === "\n") {
+ this.handler.line++;
+ this.handler.column = 0;
+ } else {
+ this.handler.column++;
+ }
+ switch (this.state) {
+ case 1:
+ if (c === "<") {
+ this.state = 4;
+ this.startTagPosition = this.position;
+ } else {
+ charclass$0 = _.whitespace;
+ if (! $__jsx_ObjectHasOwnProperty.call(charclass$0, c)) {
+ this.strictFail$S("Non-whitespace before first tag.");
+ this.textNode = c;
+ this.state = 2;
+ }
+ }
+ continue;
+ case 2:
+ if (this.sawRoot && ! this.closedRoot) {
+ starti = i - 1;
+ while (c && c !== "<" && c !== "&") {
+ c = chunk.charAt(i++);
+ if (c) {
+ this.position++;
+ if (c === "\n") {
+ this.handler.line++;
+ this.handler.column = 0;
+ } else {
+ this.handler.column++;
+ }
+ }
+ }
+ this.textNode += chunk.substring(starti, i - 1);
+ }
+ if (c === "<") {
+ this.state = 4;
+ this.startTagPosition = this.position;
+ } else {
+ if (_.not$HBS(_.whitespace, c) && (! this.sawRoot || this.closedRoot)) {
+ this.strictFail$S("Text data outside of root node.");
+ }
+ if (c === "&") {
+ this.state = 3;
+ } else {
+ this.textNode += c;
+ }
+ }
+ continue;
+ case 33:
+ if (c === "<") {
+ this.state = 34;
+ } else {
+ this.script += c;
+ }
+ continue;
+ case 34:
+ if (c === "/") {
+ this.state = 31;
+ } else {
+ this.script += "<" + c;
+ this.state = 33;
+ }
+ continue;
+ case 4:
+ if (c === "!") {
+ this.state = 5;
+ this.sgmlDecl = "";
+ } else {
+ charclass$1 = _.whitespace;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$1, c)) {
+ } else {
+ charclass$2 = _.nameStart;
+ if (charclass$2.test(c)) {
+ this.state = 21;
+ this.tagName = c;
+ } else {
+ if (c === "/") {
+ this.state = 31;
+ this.tagName = "";
+ } else {
+ if (c === "?") {
+ this.state = 18;
+ this.procInstName = this.procInstBody = "";
+ } else {
+ this.strictFail$S("Unencoded <");
+ if (this.startTagPosition + 1 < this.position) {
+ pad = this.position - this.startTagPosition;
+ for (i = 0; i < pad; i++) {
+ c = " " + c;
+ }
+ }
+ this.textNode += "<" + c;
+ this.state = 2;
+ }
+ }
+ }
+ }
+ }
+ continue;
+ case 5:
+ if ((this.sgmlDecl + c).toUpperCase() === _.CDATA) {
+ this.closetext_if_exist$();
+ this.state = 15;
+ this.sgmlDecl = "";
+ this.cdata = "";
+ } else {
+ if (this.sgmlDecl + c === "--") {
+ this.state = 12;
+ this.comment = "";
+ this.sgmlDecl = "";
+ } else {
+ if ((this.sgmlDecl + c).toUpperCase() === _.DOCTYPE) {
+ this.state = 7;
+ if (this.doctype || this.sawRoot) {
+ this.strictFail$S("Inappropriately located doctype declaration");
+ }
+ this.doctype = "";
+ this.sgmlDecl = "";
+ } else {
+ if (c === ">") {
+ this.closetext_if_exist$();
+ this.sgmlDecl = "";
+ this.state = 2;
+ } else {
+ charclass$3 = _.quote;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$3, c)) {
+ this.state = 6;
+ this.sgmlDecl += c;
+ } else {
+ this.sgmlDecl += c;
+ }
+ }
+ }
+ }
+ }
+ continue;
+ case 6:
+ if (c === this.q) {
+ this.state = 5;
+ this.q = "";
+ }
+ this.sgmlDecl += c;
+ continue;
+ case 7:
+ if (c === ">") {
+ this.state = 2;
+ this.closetext_if_exist$();
+ this.doctype.trim();
+ } else {
+ this.doctype += c;
+ if (c === "[") {
+ this.state = 9;
+ } else {
+ charclass$4 = _.quote;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$4, c)) {
+ this.state = 8;
+ this.q = c;
+ }
+ }
+ }
+ continue;
+ case 8:
+ this.doctype += c;
+ if (c === this.q) {
+ this.q = "";
+ this.state = 7;
+ }
+ continue;
+ case 9:
+ this.doctype += c;
+ if (c === "]") {
+ this.state = 7;
+ } else {
+ charclass$5 = _.quote;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$5, c)) {
+ this.state = 10;
+ this.q = c;
+ }
+ }
+ continue;
+ case 10:
+ this.doctype += c;
+ if (c === this.q) {
+ this.state = 9;
+ this.q = "";
+ }
+ continue;
+ case 12:
+ if (c === "-") {
+ this.state = 13;
+ } else {
+ this.comment += c;
+ }
+ continue;
+ case 13:
+ if (c === "-") {
+ this.state = 14;
+ text$0 = this.comment;
+ text$0 = text$0.replace(/[\n\t]/g, ' ');
+ text$0 = text$0.replace(/\s\s+/g, " ");
+ comment$0 = this.comment = text$0;
+ if (comment$0) {
+ this.closetext_if_exist$();
+ this.comment.trim();
+ }
+ this.comment = "";
+ } else {
+ this.comment += "-" + c;
+ this.state = 12;
+ }
+ continue;
+ case 14:
+ if (c !== ">") {
+ this.strictFail$S("Malformed comment");
+ this.comment += "--" + c;
+ this.state = 12;
+ } else {
+ this.state = 2;
+ }
+ continue;
+ case 15:
+ if (c === "]") {
+ this.state = 16;
+ } else {
+ this.cdata += c;
+ }
+ continue;
+ case 16:
+ if (c === "]") {
+ this.state = 17;
+ } else {
+ this.cdata += "]" + c;
+ this.state = 15;
+ }
+ continue;
+ case 17:
+ if (c === ">") {
+ if (this.cdata) {
+ this.closetext_if_exist$();
+ }
+ this.cdata = "";
+ this.state = 2;
+ } else {
+ if (c === "]") {
+ this.cdata += "]";
+ } else {
+ this.cdata += "]]" + c;
+ this.state = 15;
+ }
+ }
+ continue;
+ case 18:
+ if (c === "?") {
+ this.state = 20;
+ } else {
+ charclass$6 = _.whitespace;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$6, c)) {
+ this.state = 19;
+ } else {
+ this.procInstName += c;
+ }
+ }
+ continue;
+ case 19:
+ if (! this.procInstBody && _.is$HBS(_.whitespace, c)) {
+ continue;
+ } else {
+ if (c === "?") {
+ this.state = 20;
+ } else {
+ this.procInstBody += c;
+ }
+ }
+ continue;
+ case 20:
+ if (c === ">") {
+ this.closetext_if_exist$();
+ this.procInstName = this.procInstBody = "";
+ this.state = 2;
+ } else {
+ this.procInstBody += "?" + c;
+ this.state = 19;
+ }
+ continue;
+ case 21:
+ charclass$7 = _.nameBody;
+ if (charclass$7.test(c)) {
+ this.tagName += c;
+ } else {
+ this.newTag$();
+ if (c === ">") {
+ this.openTag$B(false);
+ } else {
+ if (c === "/") {
+ this.state = 22;
+ } else {
+ charclass$8 = _.whitespace;
+ if (! $__jsx_ObjectHasOwnProperty.call(charclass$8, c)) {
+ this.strictFail$S("Invalid character in tag name");
+ }
+ this.state = 23;
+ }
+ }
+ }
+ continue;
+ case 22:
+ if (c === ">") {
+ this.openTag$B(true);
+ this.closeTag$();
+ } else {
+ this.strictFail$S("Forward-slash in opening tag not followed by >");
+ this.state = 23;
+ }
+ continue;
+ case 23:
+ charclass$9 = _.whitespace;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$9, c)) {
+ continue;
+ } else {
+ if (c === ">") {
+ this.openTag$B(false);
+ } else {
+ if (c === "/") {
+ this.state = 22;
+ } else {
+ charclass$10 = _.nameStart;
+ if (charclass$10.test(c)) {
+ this.attribName = c;
+ this.attribValue = "";
+ this.state = 24;
+ } else {
+ this.strictFail$S("Invalid attribute name");
+ }
+ }
+ }
+ }
+ continue;
+ case 24:
+ if (c === "=") {
+ this.state = 26;
+ } else {
+ if (c === ">") {
+ this.strictFail$S("Attribute without value");
+ this.attribValue = this.attribName;
+ this.attrib$();
+ this.openTag$B(false);
+ } else {
+ charclass$11 = _.whitespace;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$11, c)) {
+ this.state = 25;
+ } else {
+ charclass$12 = _.nameBody;
+ if (charclass$12.test(c)) {
+ this.attribName += c;
+ } else {
+ this.strictFail$S("Invalid attribute name");
+ }
+ }
+ }
+ }
+ continue;
+ case 25:
+ if (c === "=") {
+ this.state = 26;
+ } else {
+ charclass$13 = _.whitespace;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$13, c)) {
+ continue;
+ } else {
+ this.strictFail$S("Attribute without value");
+ this.tag.attributes[this.attribName] = "";
+ this.attribValue = "";
+ this.closetext_if_exist$();
+ this.attribName = "";
+ if (c === ">") {
+ this.openTag$B(false);
+ } else {
+ charclass$14 = _.nameStart;
+ if (charclass$14.test(c)) {
+ this.attribName = c;
+ this.state = 24;
+ } else {
+ this.strictFail$S("Invalid attribute name");
+ this.state = 23;
+ }
+ }
+ }
+ }
+ continue;
+ case 26:
+ charclass$15 = _.whitespace;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$15, c)) {
+ continue;
+ } else {
+ charclass$16 = _.quote;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$16, c)) {
+ this.q = c;
+ this.state = 27;
+ } else {
+ this.strictFail$S("Unquoted attribute value");
+ this.state = 28;
+ this.attribValue = c;
+ }
+ }
+ continue;
+ case 27:
+ if (c !== this.q) {
+ if (c === "&") {
+ this.state = 29;
+ } else {
+ this.attribValue += c;
+ }
+ continue;
+ }
+ this.attrib$();
+ this.q = "";
+ this.state = 23;
+ continue;
+ case 28:
+ charclass$17 = _.attribEnd;
+ if (! $__jsx_ObjectHasOwnProperty.call(charclass$17, c)) {
+ if (c === "&") {
+ this.state = 30;
+ } else {
+ this.attribValue += c;
+ }
+ continue;
+ }
+ this.attrib$();
+ if (c === ">") {
+ this.openTag$B(false);
+ } else {
+ this.state = 23;
+ }
+ continue;
+ case 31:
+ if (! this.tagName) {
+ charclass$18 = _.whitespace;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$18, c)) {
+ continue;
+ } else {
+ charclass$19 = _.nameStart;
+ if (! charclass$19.test(c)) {
+ if (this.script) {
+ this.script += "</" + c;
+ this.state = 33;
+ } else {
+ this.strictFail$S("Invalid tagname in closing tag.");
+ }
+ } else {
+ this.tagName = c;
+ }
+ }
+ } else {
+ if (c === ">") {
+ this.closeTag$();
+ } else {
+ charclass$20 = _.nameBody;
+ if (charclass$20.test(c)) {
+ this.tagName += c;
+ } else {
+ if (this.script) {
+ this.script += "</" + this.tagName;
+ this.tagName = "";
+ this.state = 33;
+ } else {
+ charclass$21 = _.whitespace;
+ if (! $__jsx_ObjectHasOwnProperty.call(charclass$21, c)) {
+ this.strictFail$S("Invalid tagname in closing tag");
+ }
+ this.state = 32;
+ }
+ }
+ }
+ }
+ continue;
+ case 32:
+ charclass$22 = _.whitespace;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$22, c)) {
+ continue;
+ }
+ if (c === ">") {
+ this.closeTag$();
+ } else {
+ this.strictFail$S("Invalid characters in closing tag");
+ }
+ continue;
+ case 3:
+ if (c === ";") {
+ this.textNode += this.parseEntity$();
+ this.entity = "";
+ this.state = 2;
+ } else {
+ charclass$23 = _.entity;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$23, c)) {
+ this.entity += c;
+ } else {
+ this.strictFail$S("Invalid character entity");
+ this.textNode += "&" + this.entity + c;
+ this.entity = "";
+ this.state = 2;
+ }
+ }
+ continue;
+ case 29:
+ case 30:
+ if (this.state === 29) {
+ returnState = 27;
+ } else {
+ returnState = 28;
+ }
+ if (c === ";") {
+ this.attribValue += this.parseEntity$();
+ this.entity = "";
+ this.state = (returnState | 0);
+ } else {
+ charclass$24 = _.entity;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$24, c)) {
+ this.entity += c;
+ } else {
+ this.strictFail$S("Invalid character entity");
+ this.attribValue += "&" + this.entity + c;
+ this.entity = "";
+ this.state = (returnState | 0);
+ }
+ }
+ continue;
+ default:
+ throw new Error("Unknown state: " + (this.state + ""));
+ }
+ }
+ this.end$();
+ return this;
+};
+
+/**
+ */
+SAXParser.prototype.clearBuffers$ = function () {
+ this.comment = '';
+ this.sgmlDecl = '';
+ this.textNode = '';
+ this.tagName = '';
+ this.doctype = '';
+ this.procInstName = '';
+ this.procInstBody = '';
+ this.entity = '';
+ this.attribName = '';
+ this.attribValue = '';
+ this.cdata = '';
+ this.script = '';
+};
+
+/**
+ */
+SAXParser.prototype.closetext_if_exist$ = function () {
+ if (this.textNode !== '') {
+ this.closetext$();
+ }
+};
+
+/**
+ */
+SAXParser.prototype.closetext$ = function () {
+ /** @type {!string} */
+ var text;
+ /** @type {!string} */
+ var text$0;
+ if (this.preTags === 0) {
+ text$0 = this.textNode;
+ text$0 = text$0.replace(/[\n\t]/g, ' ');
+ text$0 = text$0.replace(/\s\s+/g, " ");
+ text = text$0;
+ if (text$0) {
+ this.handler.ontext$S(text);
+ }
+ } else {
+ if (this.textNode) {
+ this.handler.ontext$S(this.textNode);
+ }
+ }
+ this.textNode = "";
+};
+
+/**
+ * @param {!string} text
+ * @return {!string}
+ */
+SAXParser.prototype.textopts$S = function (text) {
+ text = text.replace(/[\n\t]/g, ' ');
+ text = text.replace(/\s\s+/g, " ");
+ return text;
+};
+
+/**
+ * @param {!string} er
+ * @return {SAXParser}
+ */
+SAXParser.prototype.emiterror$S = function (er) {
+ /** @type {Error} */
+ var error;
+ this.closetext$();
+ er += "\nLine: " + (this.line + "") + "\nColumn: " + (this.column + "") + "\nChar: " + this.c;
+ error = new Error(er);
+ this.error = error;
+ return this;
+};
+
+/**
+ */
+SAXParser.prototype.end$ = function () {
+ if (! this.closedRoot) {
+ this.strictFail$S("Unclosed root tag");
+ }
+ if (this.state !== 2) {
+ this.emiterror$S("Unexpected end");
+ }
+ this.closetext$();
+ this.c = "";
+ this.closed = true;
+};
+
+/**
+ * @param {!string} message
+ */
+SAXParser.prototype.strictFail$S = function (message) {
+ if (this.strict) {
+ this.emiterror$S(message);
+ }
+};
+
+/**
+ */
+SAXParser.prototype.newTag$ = function () {
+ if (! this.strict) {
+ this.tagName = this.tagName.toLowerCase();
+ }
+ this.tag = ({name: this.tagName, attributes: ({ }), isSelfClosing: false});
+ this.attribList.length = 0;
+};
+
+/**
+ */
+SAXParser.prototype.attrib$ = function () {
+ if (! this.strict) {
+ this.attribName = this.attribName.toLowerCase();
+ }
+ if ($__jsx_ObjectHasOwnProperty.call(this.tag.attributes, this.attribName)) {
+ this.attribName = this.attribValue = "";
+ return;
+ }
+ this.tag.attributes[this.attribName] = this.attribValue;
+ this.closetext_if_exist$();
+ this.attribName = this.attribValue = "";
+};
+
+/**
+ */
+SAXParser.prototype.openTag$ = function () {
+ this.openTag$B(false);
+};
+
+/**
+ * @param {!boolean} selfClosing
+ */
+SAXParser.prototype.openTag$B = function (selfClosing) {
+ /** @type {Tag} */
+ var tag$0;
+ /** @type {Tag} */
+ var tag$1;
+ (tag$0 = this.tag).isSelfClosing = selfClosing;
+ this.sawRoot = true;
+ this.tags.push(tag$0);
+ this.closetext_if_exist$();
+ this.handler.onopentag$SHS((tag$1 = this.tag).name, tag$1.attributes);
+ if (this.tag.name === 'pre') {
+ this.preTags++;
+ }
+ if (! selfClosing) {
+ if (! this.noscript && this.tagName.toLowerCase() === "script") {
+ this.state = 33;
+ } else {
+ this.state = 2;
+ }
+ this.tag = null;
+ this.tagName = "";
+ }
+ this.attribName = this.attribValue = "";
+ this.attribList.length = 0;
+};
+
+/**
+ */
+SAXParser.prototype.closeTag$ = function () {
+ /** @type {!number} */
+ var t;
+ /** @type {!string} */
+ var tagName;
+ /** @type {!string} */
+ var closeTo;
+ /** @type {Tag} */
+ var close;
+ /** @type {!number} */
+ var s;
+ /** @type {Tag} */
+ var tag$0;
+ if (! this.tagName) {
+ this.strictFail$S("Weird empty close tag.");
+ this.textNode += "</>";
+ this.state = 2;
+ return;
+ }
+ if (this.script) {
+ if (this.tagName !== "script") {
+ this.script += "</" + this.tagName + ">";
+ this.tagName = "";
+ this.state = 33;
+ return;
+ }
+ this.closetext_if_exist$();
+ this.script = "";
+ }
+ t = this.tags.length;
+ tagName = this.tagName;
+ if (! this.strict) {
+ tagName = tagName.toLowerCase();
+ }
+ closeTo = tagName;
+ while (t--) {
+ close = this.tags[t];
+ if (close.name !== closeTo) {
+ this.strictFail$S("Unexpected close tag");
+ } else {
+ break;
+ }
+ }
+ if (t < 0) {
+ this.strictFail$S("Unmatched closing tag: " + this.tagName);
+ this.textNode += "</" + this.tagName + ">";
+ this.state = 2;
+ return;
+ }
+ this.tagName = tagName;
+ s = this.tags.length;
+ while (s-- > t) {
+ tag$0 = this.tag = this.tags.pop();
+ this.tagName = tag$0.name;
+ this.closetext_if_exist$();
+ this.handler.onclosetag$S(this.tagName);
+ if (this.tagName === 'pre') {
+ this.preTags--;
+ }
+ }
+ if (t === 0) {
+ this.closedRoot = true;
+ }
+ this.tagName = this.attribValue = this.attribName = "";
+ this.attribList.length = 0;
+ this.state = 2;
+};
+
+/**
+ * @return {!string}
+ */
+SAXParser.prototype.parseEntity$ = function () {
+ /** @type {!string} */
+ var entity;
+ /** @type {!string} */
+ var entityLC;
+ /** @type {!number} */
+ var num;
+ /** @type {!string} */
+ var numStr;
+ entity = this.entity;
+ entityLC = entity.toLowerCase();
+ num = 0;
+ numStr = "";
+ if (this.ENTITIES[entity]) {
+ return this.ENTITIES[entity];
+ }
+ if (this.ENTITIES[entityLC]) {
+ return this.ENTITIES[entityLC];
+ }
+ entity = entityLC;
+ if (entityLC.charAt(0) === "#") {
+ if (entity.charAt(1) === "x") {
+ entity = entity.slice(2);
+ num = $__jsx_parseInt(entity, 16);
+ numStr = num.toString(16);
+ } else {
+ entity = entity.slice(1);
+ num = $__jsx_parseInt(entity, 10);
+ numStr = num.toString(10);
+ }
+ }
+ entity = entity.replace(/^0+/, "");
+ if (numStr.toLowerCase() !== entity) {
+ this.strictFail$S("Invalid character entity");
+ return "&" + this.entity + ";";
+ }
+ return String.fromCharCode(num);
+};
+
+/**
+ * class Char extends Object
+ * @constructor
+ */
+function Char() {
+}
+
+/**
+ * @constructor
+ */
+function Char$() {
+ this.CDATA = "[CDATA[";
+ this.DOCTYPE = "DOCTYPE";
+ this.XML_NAMESPACE = "http://www.w3.org/XML/1998/namespace";
+ this.whitespace = this._charClass$S("\r\n\t ");
+ this.number = this._charClass$S("0124356789");
+ this.letter = this._charClass$S("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ");
+ this.quote = this._charClass$S("'\"");
+ this.entity = this._charClass$S("0124356789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ#");
+ this.attribEnd = this._charClass$S("\r\n\t >");
+ this.nameStart = /[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/;
+ this.nameBody = /[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040\.\d-]/;
+};
+
+Char$.prototype = new Char;
+
+/**
+ * @param {!string} str
+ * @return {Object.<string, undefined|!boolean>}
+ */
+Char.prototype._charClass$S = function (str) {
+ /** @type {Object.<string, undefined|!boolean>} */
+ var result;
+ /** @type {!number} */
+ var i;
+ result = ({ });
+ for (i = 0; i < str.length; i++) {
+ result[str.slice(i, i + 1)] = true;
+ }
+ return result;
+};
+
+/**
+ * @param {RegExp} charclass
+ * @param {!string} c
+ * @return {!boolean}
+ */
+Char.prototype.is$LRegExp$S = function (charclass, c) {
+ return charclass.test(c);
+};
+
+/**
+ * @param {Object.<string, undefined|!boolean>} charclass
+ * @param {!string} c
+ * @return {!boolean}
+ */
+Char.prototype.is$HBS = function (charclass, c) {
+ return $__jsx_ObjectHasOwnProperty.call(charclass, c);
+};
+
+/**
+ * @param {RegExp} charclass
+ * @param {!string} c
+ * @return {!boolean}
+ */
+Char.prototype.not$LRegExp$S = function (charclass, c) {
+ return ! charclass.test(c);
+};
+
+/**
+ * @param {Object.<string, undefined|!boolean>} charclass
+ * @param {!string} c
+ * @return {!boolean}
+ */
+Char.prototype.not$HBS = function (charclass, c) {
+ return ! $__jsx_ObjectHasOwnProperty.call(charclass, c);
+};
+
+/**
+ * class _Entities extends Object
+ * @constructor
+ */
+function _Entities() {
+}
+
+/**
+ * @constructor
+ */
+function _Entities$() {
+};
+
+_Entities$.prototype = new _Entities;
+
+/**
+ * @return {Object.<string, undefined|!string>}
+ */
+_Entities.entity_list$ = function () {
+ /** @type {Object.<string, undefined|!string>} */
+ var result;
+ /** @type {!string} */
+ var key;
+ /** @type {*} */
+ var value;
+ result = ({ });
+ for (key in _Entities._entities) {
+ value = _Entities._entities[key];
+ if (typeof value === 'string') {
+ result[key] = value + "";
+ } else {
+ if (typeof value === 'number') {
+ result[key] = String.fromCharCode(value | 0);
+ }
+ }
+ }
+ return result;
+};
+
+var _Entities$entity_list$ = _Entities.entity_list$;
+
+/**
+ * class BaseStemmer extends Object
+ * @constructor
+ */
+function BaseStemmer() {
+}
+
+$__jsx_merge_interface(BaseStemmer, Stemmer);
+
+/**
+ * @constructor
+ */
+function BaseStemmer$() {
+ /** @type {!string} */
+ var current$0;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var limit$0;
+ this.cache = ({ });
+ current$0 = this.current = "";
+ cursor$0 = this.cursor = 0;
+ limit$0 = this.limit = current$0.length;
+ this.limit_backward = 0;
+ this.bra = cursor$0;
+ this.ket = limit$0;
+};
+
+BaseStemmer$.prototype = new BaseStemmer;
+
+/**
+ * @param {!string} value
+ */
+BaseStemmer.prototype.setCurrent$S = function (value) {
+ /** @type {!string} */
+ var current$0;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var limit$0;
+ current$0 = this.current = value;
+ cursor$0 = this.cursor = 0;
+ limit$0 = this.limit = current$0.length;
+ this.limit_backward = 0;
+ this.bra = cursor$0;
+ this.ket = limit$0;
+};
+
+/**
+ * @return {!string}
+ */
+BaseStemmer.prototype.getCurrent$ = function () {
+ return this.current;
+};
+
+/**
+ * @param {BaseStemmer} other
+ */
+BaseStemmer.prototype.copy_from$LBaseStemmer$ = function (other) {
+ this.current = other.current;
+ this.cursor = other.cursor;
+ this.limit = other.limit;
+ this.limit_backward = other.limit_backward;
+ this.bra = other.bra;
+ this.ket = other.ket;
+};
+
+/**
+ * @param {Array.<undefined|!number>} s
+ * @param {!number} min
+ * @param {!number} max
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.in_grouping$AIII = function (s, min, max) {
+ /** @type {!number} */
+ var ch;
+ if (this.cursor >= this.limit) {
+ return false;
+ }
+ ch = this.current.charCodeAt(this.cursor);
+ if (ch > max || ch < min) {
+ return false;
+ }
+ ch -= min;
+ if ((s[ch >>> 3] & 0x1 << (ch & 0x7)) === 0) {
+ return false;
+ }
+ this.cursor++;
+ return true;
+};
+
+/**
+ * @param {Array.<undefined|!number>} s
+ * @param {!number} min
+ * @param {!number} max
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.in_grouping_b$AIII = function (s, min, max) {
+ /** @type {!number} */
+ var ch;
+ if (this.cursor <= this.limit_backward) {
+ return false;
+ }
+ ch = this.current.charCodeAt(this.cursor - 1);
+ if (ch > max || ch < min) {
+ return false;
+ }
+ ch -= min;
+ if ((s[ch >>> 3] & 0x1 << (ch & 0x7)) === 0) {
+ return false;
+ }
+ this.cursor--;
+ return true;
+};
+
+/**
+ * @param {Array.<undefined|!number>} s
+ * @param {!number} min
+ * @param {!number} max
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.out_grouping$AIII = function (s, min, max) {
+ /** @type {!number} */
+ var ch;
+ if (this.cursor >= this.limit) {
+ return false;
+ }
+ ch = this.current.charCodeAt(this.cursor);
+ if (ch > max || ch < min) {
+ this.cursor++;
+ return true;
+ }
+ ch -= min;
+ if ((s[ch >>> 3] & 0X1 << (ch & 0x7)) === 0) {
+ this.cursor++;
+ return true;
+ }
+ return false;
+};
+
+/**
+ * @param {Array.<undefined|!number>} s
+ * @param {!number} min
+ * @param {!number} max
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.out_grouping_b$AIII = function (s, min, max) {
+ /** @type {!number} */
+ var ch;
+ if (this.cursor <= this.limit_backward) {
+ return false;
+ }
+ ch = this.current.charCodeAt(this.cursor - 1);
+ if (ch > max || ch < min) {
+ this.cursor--;
+ return true;
+ }
+ ch -= min;
+ if ((s[ch >>> 3] & 0x1 << (ch & 0x7)) === 0) {
+ this.cursor--;
+ return true;
+ }
+ return false;
+};
+
+/**
+ * @param {!number} min
+ * @param {!number} max
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.in_range$II = function (min, max) {
+ /** @type {!number} */
+ var ch;
+ if (this.cursor >= this.limit) {
+ return false;
+ }
+ ch = this.current.charCodeAt(this.cursor);
+ if (ch > max || ch < min) {
+ return false;
+ }
+ this.cursor++;
+ return true;
+};
+
+/**
+ * @param {!number} min
+ * @param {!number} max
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.in_range_b$II = function (min, max) {
+ /** @type {!number} */
+ var ch;
+ if (this.cursor <= this.limit_backward) {
+ return false;
+ }
+ ch = this.current.charCodeAt(this.cursor - 1);
+ if (ch > max || ch < min) {
+ return false;
+ }
+ this.cursor--;
+ return true;
+};
+
+/**
+ * @param {!number} min
+ * @param {!number} max
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.out_range$II = function (min, max) {
+ /** @type {!number} */
+ var ch;
+ if (this.cursor >= this.limit) {
+ return false;
+ }
+ ch = this.current.charCodeAt(this.cursor);
+ if (! (ch > max || ch < min)) {
+ return false;
+ }
+ this.cursor++;
+ return true;
+};
+
+/**
+ * @param {!number} min
+ * @param {!number} max
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.out_range_b$II = function (min, max) {
+ /** @type {!number} */
+ var ch;
+ if (this.cursor <= this.limit_backward) {
+ return false;
+ }
+ ch = this.current.charCodeAt(this.cursor - 1);
+ if (! (ch > max || ch < min)) {
+ return false;
+ }
+ this.cursor--;
+ return true;
+};
+
+/**
+ * @param {!number} s_size
+ * @param {!string} s
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.eq_s$IS = function (s_size, s) {
+ /** @type {!number} */
+ var cursor$0;
+ if (this.limit - this.cursor < s_size) {
+ return false;
+ }
+ if (this.current.slice(cursor$0 = this.cursor, cursor$0 + s_size) !== s) {
+ return false;
+ }
+ this.cursor += s_size;
+ return true;
+};
+
+/**
+ * @param {!number} s_size
+ * @param {!string} s
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.eq_s_b$IS = function (s_size, s) {
+ /** @type {!number} */
+ var cursor$0;
+ if (this.cursor - this.limit_backward < s_size) {
+ return false;
+ }
+ if (this.current.slice((cursor$0 = this.cursor) - s_size, cursor$0) !== s) {
+ return false;
+ }
+ this.cursor -= s_size;
+ return true;
+};
+
+/**
+ * @param {!string} s
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.eq_v$S = function (s) {
+ return this.eq_s$IS(s.length, s);
+};
+
+/**
+ * @param {!string} s
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.eq_v_b$S = function (s) {
+ return this.eq_s_b$IS(s.length, s);
+};
+
+/**
+ * @param {Array.<undefined|Among>} v
+ * @param {!number} v_size
+ * @return {!number}
+ */
+BaseStemmer.prototype.find_among$ALAmong$I = function (v, v_size) {
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var j;
+ /** @type {!number} */
+ var c;
+ /** @type {!number} */
+ var l;
+ /** @type {!number} */
+ var common_i;
+ /** @type {!number} */
+ var common_j;
+ /** @type {!boolean} */
+ var first_key_inspected;
+ /** @type {!number} */
+ var k;
+ /** @type {!number} */
+ var diff;
+ /** @type {!number} */
+ var common;
+ /** @type {Among} */
+ var w;
+ /** @type {!number} */
+ var i2;
+ /** @type {!boolean} */
+ var res;
+ i = 0;
+ j = v_size;
+ c = this.cursor;
+ l = this.limit;
+ common_i = 0;
+ common_j = 0;
+ first_key_inspected = false;
+ while (true) {
+ k = i + (j - i >>> 1);
+ diff = 0;
+ common = (common_i < common_j ? common_i : common_j);
+ w = v[k];
+ for (i2 = common; i2 < w.s_size; i2++) {
+ if (c + common === l) {
+ diff = -1;
+ break;
+ }
+ diff = this.current.charCodeAt(c + common) - w.s.charCodeAt(i2);
+ if (diff !== 0) {
+ break;
+ }
+ common++;
+ }
+ if (diff < 0) {
+ j = k;
+ common_j = common;
+ } else {
+ i = k;
+ common_i = common;
+ }
+ if (j - i <= 1) {
+ if (i > 0) {
+ break;
+ }
+ if (j === i) {
+ break;
+ }
+ if (first_key_inspected) {
+ break;
+ }
+ first_key_inspected = true;
+ }
+ }
+ while (true) {
+ w = v[i];
+ if (common_i >= w.s_size) {
+ this.cursor = (c + w.s_size | 0);
+ if (w.method == null) {
+ return w.result;
+ }
+ res = w.method(w.instance);
+ this.cursor = (c + w.s_size | 0);
+ if (res) {
+ return w.result;
+ }
+ }
+ i = w.substring_i;
+ if (i < 0) {
+ return 0;
+ }
+ }
+ return -1;
+};
+
+/**
+ * @param {Array.<undefined|Among>} v
+ * @param {!number} v_size
+ * @return {!number}
+ */
+BaseStemmer.prototype.find_among_b$ALAmong$I = function (v, v_size) {
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var j;
+ /** @type {!number} */
+ var c;
+ /** @type {!number} */
+ var lb;
+ /** @type {!number} */
+ var common_i;
+ /** @type {!number} */
+ var common_j;
+ /** @type {!boolean} */
+ var first_key_inspected;
+ /** @type {!number} */
+ var k;
+ /** @type {!number} */
+ var diff;
+ /** @type {!number} */
+ var common;
+ /** @type {Among} */
+ var w;
+ /** @type {!number} */
+ var i2;
+ /** @type {!boolean} */
+ var res;
+ i = 0;
+ j = v_size;
+ c = this.cursor;
+ lb = this.limit_backward;
+ common_i = 0;
+ common_j = 0;
+ first_key_inspected = false;
+ while (true) {
+ k = i + (j - i >> 1);
+ diff = 0;
+ common = (common_i < common_j ? common_i : common_j);
+ w = v[k];
+ for (i2 = w.s_size - 1 - common; i2 >= 0; i2--) {
+ if (c - common === lb) {
+ diff = -1;
+ break;
+ }
+ diff = this.current.charCodeAt(c - 1 - common) - w.s.charCodeAt(i2);
+ if (diff !== 0) {
+ break;
+ }
+ common++;
+ }
+ if (diff < 0) {
+ j = k;
+ common_j = common;
+ } else {
+ i = k;
+ common_i = common;
+ }
+ if (j - i <= 1) {
+ if (i > 0) {
+ break;
+ }
+ if (j === i) {
+ break;
+ }
+ if (first_key_inspected) {
+ break;
+ }
+ first_key_inspected = true;
+ }
+ }
+ while (true) {
+ w = v[i];
+ if (common_i >= w.s_size) {
+ this.cursor = (c - w.s_size | 0);
+ if (w.method == null) {
+ return w.result;
+ }
+ res = w.method(this);
+ this.cursor = (c - w.s_size | 0);
+ if (res) {
+ return w.result;
+ }
+ }
+ i = w.substring_i;
+ if (i < 0) {
+ return 0;
+ }
+ }
+ return -1;
+};
+
+/**
+ * @param {!number} c_bra
+ * @param {!number} c_ket
+ * @param {!string} s
+ * @return {!number}
+ */
+BaseStemmer.prototype.replace_s$IIS = function (c_bra, c_ket, s) {
+ /** @type {!number} */
+ var adjustment;
+ adjustment = s.length - (c_ket - c_bra);
+ this.current = this.current.slice(0, c_bra) + s + this.current.slice(c_ket);
+ this.limit += (adjustment | 0);
+ if (this.cursor >= c_ket) {
+ this.cursor += (adjustment | 0);
+ } else {
+ if (this.cursor > c_bra) {
+ this.cursor = c_bra;
+ }
+ }
+ return (adjustment | 0);
+};
+
+/**
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.slice_check$ = function () {
+ /** @type {!number} */
+ var bra$0;
+ /** @type {!number} */
+ var ket$0;
+ /** @type {!number} */
+ var limit$0;
+ return ((bra$0 = this.bra) < 0 || bra$0 > (ket$0 = this.ket) || ket$0 > (limit$0 = this.limit) || limit$0 > this.current.length ? false : true);
+};
+
+/**
+ * @param {!string} s
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.slice_from$S = function (s) {
+ /** @type {!boolean} */
+ var result;
+ /** @type {!number} */
+ var bra$0;
+ /** @type {!number} */
+ var ket$0;
+ /** @type {!number} */
+ var limit$0;
+ result = false;
+ if ((bra$0 = this.bra) < 0 || bra$0 > (ket$0 = this.ket) || ket$0 > (limit$0 = this.limit) || limit$0 > this.current.length ? false : true) {
+ this.replace_s$IIS(this.bra, this.ket, s);
+ result = true;
+ }
+ return result;
+};
+
+/**
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.slice_del$ = function () {
+ return this.slice_from$S("");
+};
+
+/**
+ * @param {!number} c_bra
+ * @param {!number} c_ket
+ * @param {!string} s
+ */
+BaseStemmer.prototype.insert$IIS = function (c_bra, c_ket, s) {
+ /** @type {!number} */
+ var adjustment;
+ adjustment = this.replace_s$IIS(c_bra, c_ket, s);
+ if (c_bra <= this.bra) {
+ this.bra += (adjustment | 0);
+ }
+ if (c_bra <= this.ket) {
+ this.ket += (adjustment | 0);
+ }
+};
+
+/**
+ * @param {!string} s
+ * @return {!string}
+ */
+BaseStemmer.prototype.slice_to$S = function (s) {
+ /** @type {!string} */
+ var result;
+ /** @type {!number} */
+ var bra$0;
+ /** @type {!number} */
+ var ket$0;
+ /** @type {!number} */
+ var limit$0;
+ result = '';
+ if ((bra$0 = this.bra) < 0 || bra$0 > (ket$0 = this.ket) || ket$0 > (limit$0 = this.limit) || limit$0 > this.current.length ? false : true) {
+ result = this.current.slice(this.bra, this.ket);
+ }
+ return result;
+};
+
+/**
+ * @param {!string} s
+ * @return {!string}
+ */
+BaseStemmer.prototype.assign_to$S = function (s) {
+ return this.current.slice(0, this.limit);
+};
+
+/**
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.stem$ = function () {
+ return false;
+};
+
+/**
+ * @param {!string} word
+ * @return {!string}
+ */
+BaseStemmer.prototype.stemWord$S = function (word) {
+ /** @type {undefined|!string} */
+ var result;
+ /** @type {!string} */
+ var current$0;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var limit$0;
+ result = this.cache['.' + word];
+ if (result == null) {
+ current$0 = this.current = word;
+ cursor$0 = this.cursor = 0;
+ limit$0 = this.limit = current$0.length;
+ this.limit_backward = 0;
+ this.bra = cursor$0;
+ this.ket = limit$0;
+ this.stem$();
+ result = this.current;
+ this.cache['.' + word] = result;
+ }
+ return result;
+};
+
+/**
+ * @param {Array.<undefined|!string>} words
+ * @return {Array.<undefined|!string>}
+ */
+BaseStemmer.prototype.stemWords$AS = function (words) {
+ /** @type {Array.<undefined|!string>} */
+ var results;
+ /** @type {!number} */
+ var i;
+ /** @type {undefined|!string} */
+ var word;
+ /** @type {undefined|!string} */
+ var result;
+ /** @type {!string} */
+ var current$0;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var limit$0;
+ results = [ ];
+ for (i = 0; i < words.length; i++) {
+ word = words[i];
+ result = this.cache['.' + word];
+ if (result == null) {
+ current$0 = this.current = word;
+ cursor$0 = this.cursor = 0;
+ limit$0 = this.limit = current$0.length;
+ this.limit_backward = 0;
+ this.bra = cursor$0;
+ this.ket = limit$0;
+ this.stem$();
+ result = this.current;
+ this.cache['.' + word] = result;
+ }
+ results.push(result);
+ }
+ return results;
+};
+
+/**
+ * class TurkishStemmer extends BaseStemmer
+ * @constructor
+ */
+function TurkishStemmer() {
+}
+
+TurkishStemmer.prototype = new BaseStemmer;
+/**
+ * @constructor
+ */
+function TurkishStemmer$() {
+ BaseStemmer$.call(this);
+ this.B_continue_stemming_noun_suffixes = false;
+ this.I_strlen = 0;
+};
+
+TurkishStemmer$.prototype = new TurkishStemmer;
+
+/**
+ * @param {TurkishStemmer} other
+ */
+TurkishStemmer.prototype.copy_from$LTurkishStemmer$ = function (other) {
+ this.B_continue_stemming_noun_suffixes = other.B_continue_stemming_noun_suffixes;
+ this.I_strlen = other.I_strlen;
+ BaseStemmer.prototype.copy_from$LBaseStemmer$.call(this, other);
+};
+
+/**
+ * @return {!boolean}
+ */
+TurkishStemmer.prototype.r_check_vowel_harmony$ = function () {
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var v_3;
+ /** @type {!number} */
+ var v_4;
+ /** @type {!number} */
+ var v_5;
+ /** @type {!number} */
+ var v_6;
+ /** @type {!number} */
+ var v_7;
+ /** @type {!number} */
+ var v_8;
+ /** @type {!number} */
+ var v_9;
+ /** @type {!number} */
+ var v_10;
+ /** @type {!number} */
+ var v_11;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!boolean} */
+ var lab2;
+ /** @type {!boolean} */
+ var lab3;
+ /** @type {!boolean} */
+ var lab5;
+ /** @type {!boolean} */
+ var lab6;
+ /** @type {!boolean} */
+ var lab8;
+ /** @type {!boolean} */
+ var lab9;
+ /** @type {!boolean} */
+ var lab11;
+ /** @type {!boolean} */
+ var lab12;
+ /** @type {!boolean} */
+ var lab14;
+ /** @type {!boolean} */
+ var lab15;
+ /** @type {!boolean} */
+ var lab17;
+ /** @type {!boolean} */
+ var lab18;
+ /** @type {!boolean} */
+ var lab20;
+ /** @type {!boolean} */
+ var lab21;
+ /** @type {!boolean} */
+ var lab23;
+ /** @type {!boolean} */
+ var lab25;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var cursor$1;
+ /** @type {!number} */
+ var cursor$2;
+ /** @type {!number} */
+ var cursor$3;
+ /** @type {!number} */
+ var cursor$4;
+ /** @type {!number} */
+ var cursor$5;
+ /** @type {!number} */
+ var cursor$6;
+ /** @type {!number} */
+ var cursor$7;
+ /** @type {!number} */
+ var cursor$8;
+ v_1 = this.limit - this.cursor;
+golab0:
+ while (true) {
+ v_2 = this.limit - this.cursor;
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ if (! this.in_grouping_b$AIII(TurkishStemmer.g_vowel, 97, 305)) {
+ break lab1;
+ }
+ this.cursor = this.limit - v_2;
+ break golab0;
+ }
+ cursor$0 = this.cursor = this.limit - v_2;
+ if (cursor$0 <= this.limit_backward) {
+ return false;
+ }
+ this.cursor--;
+ }
+ lab2 = true;
+lab2:
+ while (lab2 === true) {
+ lab2 = false;
+ v_3 = this.limit - this.cursor;
+ lab3 = true;
+ lab3:
+ while (lab3 === true) {
+ lab3 = false;
+ if (! this.eq_s_b$IS(1, "a")) {
+ break lab3;
+ }
+ golab4:
+ while (true) {
+ v_4 = this.limit - this.cursor;
+ lab5 = true;
+ lab5:
+ while (lab5 === true) {
+ lab5 = false;
+ if (! this.in_grouping_b$AIII(TurkishStemmer.g_vowel1, 97, 305)) {
+ break lab5;
+ }
+ this.cursor = this.limit - v_4;
+ break golab4;
+ }
+ cursor$1 = this.cursor = this.limit - v_4;
+ if (cursor$1 <= this.limit_backward) {
+ break lab3;
+ }
+ this.cursor--;
+ }
+ break lab2;
+ }
+ this.cursor = this.limit - v_3;
+ lab6 = true;
+ lab6:
+ while (lab6 === true) {
+ lab6 = false;
+ if (! this.eq_s_b$IS(1, "e")) {
+ break lab6;
+ }
+ golab7:
+ while (true) {
+ v_5 = this.limit - this.cursor;
+ lab8 = true;
+ lab8:
+ while (lab8 === true) {
+ lab8 = false;
+ if (! this.in_grouping_b$AIII(TurkishStemmer.g_vowel2, 101, 252)) {
+ break lab8;
+ }
+ this.cursor = this.limit - v_5;
+ break golab7;
+ }
+ cursor$2 = this.cursor = this.limit - v_5;
+ if (cursor$2 <= this.limit_backward) {
+ break lab6;
+ }
+ this.cursor--;
+ }
+ break lab2;
+ }
+ this.cursor = this.limit - v_3;
+ lab9 = true;
+ lab9:
+ while (lab9 === true) {
+ lab9 = false;
+ if (! this.eq_s_b$IS(1, "\u0131")) {
+ break lab9;
+ }
+ golab10:
+ while (true) {
+ v_6 = this.limit - this.cursor;
+ lab11 = true;
+ lab11:
+ while (lab11 === true) {
+ lab11 = false;
+ if (! this.in_grouping_b$AIII(TurkishStemmer.g_vowel3, 97, 305)) {
+ break lab11;
+ }
+ this.cursor = this.limit - v_6;
+ break golab10;
+ }
+ cursor$3 = this.cursor = this.limit - v_6;
+ if (cursor$3 <= this.limit_backward) {
+ break lab9;
+ }
+ this.cursor--;
+ }
+ break lab2;
+ }
+ this.cursor = this.limit - v_3;
+ lab12 = true;
+ lab12:
+ while (lab12 === true) {
+ lab12 = false;
+ if (! this.eq_s_b$IS(1, "i")) {
+ break lab12;
+ }
+ golab13:
+ while (true) {
+ v_7 = this.limit - this.cursor;
+ lab14 = true;
+ lab14:
+ while (lab14 === true) {
+ lab14 = false;
+ if (! this.in_grouping_b$AIII(TurkishStemmer.g_vowel4, 101, 105)) {
+ break lab14;
+ }
+ this.cursor = this.limit - v_7;
+ break golab13;
+ }
+ cursor$4 = this.cursor = this.limit - v_7;
+ if (cursor$4 <= this.limit_backward) {
+ break lab12;
+ }
+ this.cursor--;
+ }
+ break lab2;
+ }
+ this.cursor = this.limit - v_3;
+ lab15 = true;
+ lab15:
+ while (lab15 === true) {
+ lab15 = false;
+ if (! this.eq_s_b$IS(1, "o")) {
+ break lab15;
+ }
+ golab16:
+ while (true) {
+ v_8 = this.limit - this.cursor;
+ lab17 = true;
+ lab17:
+ while (lab17 === true) {
+ lab17 = false;
+ if (! this.in_grouping_b$AIII(TurkishStemmer.g_vowel5, 111, 117)) {
+ break lab17;
+ }
+ this.cursor = this.limit - v_8;
+ break golab16;
+ }
+ cursor$5 = this.cursor = this.limit - v_8;
+ if (cursor$5 <= this.limit_backward) {
+ break lab15;
+ }
+ this.cursor--;
+ }
+ break lab2;
+ }
+ this.cursor = this.limit - v_3;
+ lab18 = true;
+ lab18:
+ while (lab18 === true) {
+ lab18 = false;
+ if (! this.eq_s_b$IS(1, "\u00F6")) {
+ break lab18;
+ }
+ golab19:
+ while (true) {
+ v_9 = this.limit - this.cursor;
+ lab20 = true;
+ lab20:
+ while (lab20 === true) {
+ lab20 = false;
+ if (! this.in_grouping_b$AIII(TurkishStemmer.g_vowel6, 246, 252)) {
+ break lab20;
+ }
+ this.cursor = this.limit - v_9;
+ break golab19;
+ }
+ cursor$6 = this.cursor = this.limit - v_9;
+ if (cursor$6 <= this.limit_backward) {
+ break lab18;
+ }
+ this.cursor--;
+ }
+ break lab2;
+ }
+ this.cursor = this.limit - v_3;
+ lab21 = true;
+ lab21:
+ while (lab21 === true) {
+ lab21 = false;
+ if (! this.eq_s_b$IS(1, "u")) {
+ break lab21;
+ }
+ golab22:
+ while (true) {
+ v_10 = this.limit - this.cursor;
+ lab23 = true;
+ lab23:
+ while (lab23 === true) {
+ lab23 = false;
+ if (! this.in_grouping_b$AIII(TurkishStemmer.g_vowel5, 111, 117)) {
+ break lab23;
+ }
+ this.cursor = this.limit - v_10;
+ break golab22;
+ }
+ cursor$7 = this.cursor = this.limit - v_10;
+ if (cursor$7 <= this.limit_backward) {
+ break lab21;
+ }
+ this.cursor--;
+ }
+ break lab2;
+ }
+ this.cursor = this.limit - v_3;
+ if (! this.eq_s_b$IS(1, "\u00FC")) {
+ return false;
+ }
+ golab24:
+ while (true) {
+ v_11 = this.limit - this.cursor;
+ lab25 = true;
+ lab25:
+ while (lab25 === true) {
+ lab25 = false;
+ if (! this.in_grouping_b$AIII(TurkishStemmer.g_vowel6, 246, 252)) {
+ break lab25;
+ }
+ this.cursor = this.limit - v_11;
+ break golab24;
+ }
+ cursor$8 = this.cursor = this.limit - v_11;
+ if (cursor$8 <= this.limit_backward) {
+ return false;
+ }
+ this.cursor--;
+ }
+ }
+ this.cursor = this.limit - v_1;
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+TurkishStemmer.prototype.r_mark_suffix_with_optional_n_consonant$ = function () {
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var v_3;
+ /** @type {!number} */
+ var v_4;
+ /** @type {!number} */
+ var v_5;
+ /** @type {!number} */
+ var v_6;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!boolean} */
+ var lab2;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var limit$0;
+ /** @type {!number} */
+ var cursor$1;
+ /** @type {!number} */
+ var limit$1;
+ /** @type {!number} */
+ var cursor$2;
+ lab0 = true;
+lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ v_1 = this.limit - this.cursor;
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ v_2 = this.limit - this.cursor;
+ if (! this.eq_s_b$IS(1, "n")) {
+ break lab1;
+ }
+ cursor$0 = this.cursor = this.limit - v_2;
+ if (cursor$0 <= this.limit_backward) {
+ break lab1;
+ }
+ this.cursor--;
+ v_3 = this.limit - this.cursor;
+ if (! this.in_grouping_b$AIII(TurkishStemmer.g_vowel, 97, 305)) {
+ break lab1;
+ }
+ this.cursor = this.limit - v_3;
+ break lab0;
+ }
+ cursor$1 = this.cursor = (limit$0 = this.limit) - v_1;
+ v_4 = limit$0 - cursor$1;
+ lab2 = true;
+ lab2:
+ while (lab2 === true) {
+ lab2 = false;
+ v_5 = this.limit - this.cursor;
+ if (! this.eq_s_b$IS(1, "n")) {
+ break lab2;
+ }
+ this.cursor = this.limit - v_5;
+ return false;
+ }
+ cursor$2 = this.cursor = (limit$1 = this.limit) - v_4;
+ v_6 = limit$1 - cursor$2;
+ if (cursor$2 <= this.limit_backward) {
+ return false;
+ }
+ this.cursor--;
+ if (! this.in_grouping_b$AIII(TurkishStemmer.g_vowel, 97, 305)) {
+ return false;
+ }
+ this.cursor = this.limit - v_6;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+TurkishStemmer.prototype.r_mark_suffix_with_optional_s_consonant$ = function () {
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var v_3;
+ /** @type {!number} */
+ var v_4;
+ /** @type {!number} */
+ var v_5;
+ /** @type {!number} */
+ var v_6;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!boolean} */
+ var lab2;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var limit$0;
+ /** @type {!number} */
+ var cursor$1;
+ /** @type {!number} */
+ var limit$1;
+ /** @type {!number} */
+ var cursor$2;
+ lab0 = true;
+lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ v_1 = this.limit - this.cursor;
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ v_2 = this.limit - this.cursor;
+ if (! this.eq_s_b$IS(1, "s")) {
+ break lab1;
+ }
+ cursor$0 = this.cursor = this.limit - v_2;
+ if (cursor$0 <= this.limit_backward) {
+ break lab1;
+ }
+ this.cursor--;
+ v_3 = this.limit - this.cursor;
+ if (! this.in_grouping_b$AIII(TurkishStemmer.g_vowel, 97, 305)) {
+ break lab1;
+ }
+ this.cursor = this.limit - v_3;
+ break lab0;
+ }
+ cursor$1 = this.cursor = (limit$0 = this.limit) - v_1;
+ v_4 = limit$0 - cursor$1;
+ lab2 = true;
+ lab2:
+ while (lab2 === true) {
+ lab2 = false;
+ v_5 = this.limit - this.cursor;
+ if (! this.eq_s_b$IS(1, "s")) {
+ break lab2;
+ }
+ this.cursor = this.limit - v_5;
+ return false;
+ }
+ cursor$2 = this.cursor = (limit$1 = this.limit) - v_4;
+ v_6 = limit$1 - cursor$2;
+ if (cursor$2 <= this.limit_backward) {
+ return false;
+ }
+ this.cursor--;
+ if (! this.in_grouping_b$AIII(TurkishStemmer.g_vowel, 97, 305)) {
+ return false;
+ }
+ this.cursor = this.limit - v_6;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+TurkishStemmer.prototype.r_mark_suffix_with_optional_y_consonant$ = function () {
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var v_3;
+ /** @type {!number} */
+ var v_4;
+ /** @type {!number} */
+ var v_5;
+ /** @type {!number} */
+ var v_6;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!boolean} */
+ var lab2;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var limit$0;
+ /** @type {!number} */
+ var cursor$1;
+ /** @type {!number} */
+ var limit$1;
+ /** @type {!number} */
+ var cursor$2;
+ lab0 = true;
+lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ v_1 = this.limit - this.cursor;
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ v_2 = this.limit - this.cursor;
+ if (! this.eq_s_b$IS(1, "y")) {
+ break lab1;
+ }
+ cursor$0 = this.cursor = this.limit - v_2;
+ if (cursor$0 <= this.limit_backward) {
+ break lab1;
+ }
+ this.cursor--;
+ v_3 = this.limit - this.cursor;
+ if (! this.in_grouping_b$AIII(TurkishStemmer.g_vowel, 97, 305)) {
+ break lab1;
+ }
+ this.cursor = this.limit - v_3;
+ break lab0;
+ }
+ cursor$1 = this.cursor = (limit$0 = this.limit) - v_1;
+ v_4 = limit$0 - cursor$1;
+ lab2 = true;
+ lab2:
+ while (lab2 === true) {
+ lab2 = false;
+ v_5 = this.limit - this.cursor;
+ if (! this.eq_s_b$IS(1, "y")) {
+ break lab2;
+ }
+ this.cursor = this.limit - v_5;
+ return false;
+ }
+ cursor$2 = this.cursor = (limit$1 = this.limit) - v_4;
+ v_6 = limit$1 - cursor$2;
+ if (cursor$2 <= this.limit_backward) {
+ return false;
+ }
+ this.cursor--;
+ if (! this.in_grouping_b$AIII(TurkishStemmer.g_vowel, 97, 305)) {
+ return false;
+ }
+ this.cursor = this.limit - v_6;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+TurkishStemmer.prototype.r_mark_suffix_with_optional_U_vowel$ = function () {
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var v_3;
+ /** @type {!number} */
+ var v_4;
+ /** @type {!number} */
+ var v_5;
+ /** @type {!number} */
+ var v_6;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!boolean} */
+ var lab2;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var limit$0;
+ /** @type {!number} */
+ var cursor$1;
+ /** @type {!number} */
+ var limit$1;
+ /** @type {!number} */
+ var cursor$2;
+ lab0 = true;
+lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ v_1 = this.limit - this.cursor;
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ v_2 = this.limit - this.cursor;
+ if (! this.in_grouping_b$AIII(TurkishStemmer.g_U, 105, 305)) {
+ break lab1;
+ }
+ cursor$0 = this.cursor = this.limit - v_2;
+ if (cursor$0 <= this.limit_backward) {
+ break lab1;
+ }
+ this.cursor--;
+ v_3 = this.limit - this.cursor;
+ if (! this.out_grouping_b$AIII(TurkishStemmer.g_vowel, 97, 305)) {
+ break lab1;
+ }
+ this.cursor = this.limit - v_3;
+ break lab0;
+ }
+ cursor$1 = this.cursor = (limit$0 = this.limit) - v_1;
+ v_4 = limit$0 - cursor$1;
+ lab2 = true;
+ lab2:
+ while (lab2 === true) {
+ lab2 = false;
+ v_5 = this.limit - this.cursor;
+ if (! this.in_grouping_b$AIII(TurkishStemmer.g_U, 105, 305)) {
+ break lab2;
+ }
+ this.cursor = this.limit - v_5;
+ return false;
+ }
+ cursor$2 = this.cursor = (limit$1 = this.limit) - v_4;
+ v_6 = limit$1 - cursor$2;
+ if (cursor$2 <= this.limit_backward) {
+ return false;
+ }
+ this.cursor--;
+ if (! this.out_grouping_b$AIII(TurkishStemmer.g_vowel, 97, 305)) {
+ return false;
+ }
+ this.cursor = this.limit - v_6;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+TurkishStemmer.prototype.r_mark_possessives$ = function () {
+ return (this.find_among_b$ALAmong$I(TurkishStemmer.a_0, 10) === 0 ? false : ! this.r_mark_suffix_with_optional_U_vowel$() ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+TurkishStemmer.prototype.r_mark_sU$ = function () {
+ return (! this.r_check_vowel_harmony$() ? false : ! this.in_grouping_b$AIII(TurkishStemmer.g_U, 105, 305) ? false : ! this.r_mark_suffix_with_optional_s_consonant$() ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+TurkishStemmer.prototype.r_mark_lArI$ = function () {
+ return (this.find_among_b$ALAmong$I(TurkishStemmer.a_1, 2) === 0 ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+TurkishStemmer.prototype.r_mark_yU$ = function () {
+ return (! this.r_check_vowel_harmony$() ? false : ! this.in_grouping_b$AIII(TurkishStemmer.g_U, 105, 305) ? false : ! this.r_mark_suffix_with_optional_y_consonant$() ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+TurkishStemmer.prototype.r_mark_nU$ = function () {
+ return (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_2, 4) === 0 ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+TurkishStemmer.prototype.r_mark_nUn$ = function () {
+ return (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_3, 4) === 0 ? false : ! this.r_mark_suffix_with_optional_n_consonant$() ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+TurkishStemmer.prototype.r_mark_yA$ = function () {
+ return (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_4, 2) === 0 ? false : ! this.r_mark_suffix_with_optional_y_consonant$() ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+TurkishStemmer.prototype.r_mark_nA$ = function () {
+ return (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_5, 2) === 0 ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+TurkishStemmer.prototype.r_mark_DA$ = function () {
+ return (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_6, 4) === 0 ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+TurkishStemmer.prototype.r_mark_ndA$ = function () {
+ return (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_7, 2) === 0 ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+TurkishStemmer.prototype.r_mark_DAn$ = function () {
+ return (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_8, 4) === 0 ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+TurkishStemmer.prototype.r_mark_ndAn$ = function () {
+ return (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_9, 2) === 0 ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+TurkishStemmer.prototype.r_mark_ylA$ = function () {
+ return (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_10, 2) === 0 ? false : ! this.r_mark_suffix_with_optional_y_consonant$() ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+TurkishStemmer.prototype.r_mark_ki$ = function () {
+ return (! this.eq_s_b$IS(2, "ki") ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+TurkishStemmer.prototype.r_mark_ncA$ = function () {
+ return (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_11, 2) === 0 ? false : ! this.r_mark_suffix_with_optional_n_consonant$() ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+TurkishStemmer.prototype.r_mark_yUm$ = function () {
+ return (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_12, 4) === 0 ? false : ! this.r_mark_suffix_with_optional_y_consonant$() ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+TurkishStemmer.prototype.r_mark_sUn$ = function () {
+ return (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_13, 4) === 0 ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+TurkishStemmer.prototype.r_mark_yUz$ = function () {
+ return (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_14, 4) === 0 ? false : ! this.r_mark_suffix_with_optional_y_consonant$() ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+TurkishStemmer.prototype.r_mark_sUnUz$ = function () {
+ return (this.find_among_b$ALAmong$I(TurkishStemmer.a_15, 4) === 0 ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+TurkishStemmer.prototype.r_mark_lAr$ = function () {
+ return (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_16, 2) === 0 ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+TurkishStemmer.prototype.r_mark_nUz$ = function () {
+ return (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_17, 4) === 0 ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+TurkishStemmer.prototype.r_mark_DUr$ = function () {
+ return (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_18, 8) === 0 ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+TurkishStemmer.prototype.r_mark_cAsInA$ = function () {
+ return (this.find_among_b$ALAmong$I(TurkishStemmer.a_19, 2) === 0 ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+TurkishStemmer.prototype.r_mark_yDU$ = function () {
+ return (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_20, 32) === 0 ? false : ! this.r_mark_suffix_with_optional_y_consonant$() ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+TurkishStemmer.prototype.r_mark_ysA$ = function () {
+ return (this.find_among_b$ALAmong$I(TurkishStemmer.a_21, 8) === 0 ? false : ! this.r_mark_suffix_with_optional_y_consonant$() ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+TurkishStemmer.prototype.r_mark_ymUs_$ = function () {
+ return (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_22, 4) === 0 ? false : ! this.r_mark_suffix_with_optional_y_consonant$() ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+TurkishStemmer.prototype.r_mark_yken$ = function () {
+ return (! this.eq_s_b$IS(3, "ken") ? false : ! this.r_mark_suffix_with_optional_y_consonant$() ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+TurkishStemmer.prototype.r_stem_nominal_verb_suffixes$ = function () {
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var v_3;
+ /** @type {!number} */
+ var v_4;
+ /** @type {!number} */
+ var v_5;
+ /** @type {!number} */
+ var v_6;
+ /** @type {!number} */
+ var v_7;
+ /** @type {!number} */
+ var v_8;
+ /** @type {!number} */
+ var v_9;
+ /** @type {!number} */
+ var v_10;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!boolean} */
+ var lab2;
+ /** @type {!boolean} */
+ var lab3;
+ /** @type {!boolean} */
+ var lab4;
+ /** @type {!boolean} */
+ var lab5;
+ /** @type {!boolean} */
+ var lab6;
+ /** @type {!boolean} */
+ var lab7;
+ /** @type {!boolean} */
+ var lab8;
+ /** @type {!boolean} */
+ var lab9;
+ /** @type {!boolean} */
+ var lab10;
+ /** @type {!boolean} */
+ var lab11;
+ /** @type {!boolean} */
+ var lab12;
+ /** @type {!boolean} */
+ var lab13;
+ /** @type {!boolean} */
+ var lab14;
+ /** @type {!boolean} */
+ var lab15;
+ /** @type {!boolean} */
+ var lab16;
+ /** @type {!boolean} */
+ var lab17;
+ /** @type {!boolean} */
+ var lab18;
+ /** @type {!boolean} */
+ var lab19;
+ /** @type {!boolean} */
+ var lab20;
+ /** @type {!boolean} */
+ var lab21;
+ /** @type {!boolean} */
+ var lab22;
+ /** @type {!boolean} */
+ var lab23;
+ /** @type {!boolean} */
+ var lab24;
+ /** @type {!boolean} */
+ var lab25;
+ /** @type {!boolean} */
+ var lab26;
+ /** @type {!boolean} */
+ var lab27;
+ /** @type {!boolean} */
+ var lab28;
+ /** @type {!boolean} */
+ var lab29;
+ /** @type {!boolean} */
+ var lab30;
+ /** @type {!boolean} */
+ var lab31;
+ /** @type {!boolean} */
+ var lab32;
+ /** @type {!boolean} */
+ var lab33;
+ /** @type {!boolean} */
+ var lab34;
+ this.ket = this.cursor;
+ this.B_continue_stemming_noun_suffixes = true;
+ lab0 = true;
+lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ v_1 = this.limit - this.cursor;
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ lab2 = true;
+ lab2:
+ while (lab2 === true) {
+ lab2 = false;
+ v_2 = this.limit - this.cursor;
+ lab3 = true;
+ lab3:
+ while (lab3 === true) {
+ lab3 = false;
+ if (! (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_22, 4) === 0 ? false : ! this.r_mark_suffix_with_optional_y_consonant$() ? false : true)) {
+ break lab3;
+ }
+ break lab2;
+ }
+ this.cursor = this.limit - v_2;
+ lab4 = true;
+ lab4:
+ while (lab4 === true) {
+ lab4 = false;
+ if (! (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_20, 32) === 0 ? false : ! this.r_mark_suffix_with_optional_y_consonant$() ? false : true)) {
+ break lab4;
+ }
+ break lab2;
+ }
+ this.cursor = this.limit - v_2;
+ lab5 = true;
+ lab5:
+ while (lab5 === true) {
+ lab5 = false;
+ if (! (this.find_among_b$ALAmong$I(TurkishStemmer.a_21, 8) === 0 ? false : ! this.r_mark_suffix_with_optional_y_consonant$() ? false : true)) {
+ break lab5;
+ }
+ break lab2;
+ }
+ this.cursor = this.limit - v_2;
+ if (! (! this.eq_s_b$IS(3, "ken") ? false : ! this.r_mark_suffix_with_optional_y_consonant$() ? false : true)) {
+ break lab1;
+ }
+ }
+ break lab0;
+ }
+ this.cursor = this.limit - v_1;
+ lab6 = true;
+ lab6:
+ while (lab6 === true) {
+ lab6 = false;
+ if (! (this.find_among_b$ALAmong$I(TurkishStemmer.a_19, 2) === 0 ? false : true)) {
+ break lab6;
+ }
+ lab7 = true;
+ lab7:
+ while (lab7 === true) {
+ lab7 = false;
+ v_3 = this.limit - this.cursor;
+ lab8 = true;
+ lab8:
+ while (lab8 === true) {
+ lab8 = false;
+ if (! (this.find_among_b$ALAmong$I(TurkishStemmer.a_15, 4) === 0 ? false : true)) {
+ break lab8;
+ }
+ break lab7;
+ }
+ this.cursor = this.limit - v_3;
+ lab9 = true;
+ lab9:
+ while (lab9 === true) {
+ lab9 = false;
+ if (! (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_16, 2) === 0 ? false : true)) {
+ break lab9;
+ }
+ break lab7;
+ }
+ this.cursor = this.limit - v_3;
+ lab10 = true;
+ lab10:
+ while (lab10 === true) {
+ lab10 = false;
+ if (! (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_12, 4) === 0 ? false : ! this.r_mark_suffix_with_optional_y_consonant$() ? false : true)) {
+ break lab10;
+ }
+ break lab7;
+ }
+ this.cursor = this.limit - v_3;
+ lab11 = true;
+ lab11:
+ while (lab11 === true) {
+ lab11 = false;
+ if (! (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_13, 4) === 0 ? false : true)) {
+ break lab11;
+ }
+ break lab7;
+ }
+ this.cursor = this.limit - v_3;
+ lab12 = true;
+ lab12:
+ while (lab12 === true) {
+ lab12 = false;
+ if (! (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_14, 4) === 0 ? false : ! this.r_mark_suffix_with_optional_y_consonant$() ? false : true)) {
+ break lab12;
+ }
+ break lab7;
+ }
+ this.cursor = this.limit - v_3;
+ }
+ if (! (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_22, 4) === 0 ? false : ! this.r_mark_suffix_with_optional_y_consonant$() ? false : true)) {
+ break lab6;
+ }
+ break lab0;
+ }
+ this.cursor = this.limit - v_1;
+ lab13 = true;
+ lab13:
+ while (lab13 === true) {
+ lab13 = false;
+ if (! (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_16, 2) === 0 ? false : true)) {
+ break lab13;
+ }
+ this.bra = this.cursor;
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ v_4 = this.limit - this.cursor;
+ lab14 = true;
+ lab14:
+ while (lab14 === true) {
+ lab14 = false;
+ this.ket = this.cursor;
+ lab15 = true;
+ lab15:
+ while (lab15 === true) {
+ lab15 = false;
+ v_5 = this.limit - this.cursor;
+ lab16 = true;
+ lab16:
+ while (lab16 === true) {
+ lab16 = false;
+ if (! (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_18, 8) === 0 ? false : true)) {
+ break lab16;
+ }
+ break lab15;
+ }
+ this.cursor = this.limit - v_5;
+ lab17 = true;
+ lab17:
+ while (lab17 === true) {
+ lab17 = false;
+ if (! (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_20, 32) === 0 ? false : ! this.r_mark_suffix_with_optional_y_consonant$() ? false : true)) {
+ break lab17;
+ }
+ break lab15;
+ }
+ this.cursor = this.limit - v_5;
+ lab18 = true;
+ lab18:
+ while (lab18 === true) {
+ lab18 = false;
+ if (! (this.find_among_b$ALAmong$I(TurkishStemmer.a_21, 8) === 0 ? false : ! this.r_mark_suffix_with_optional_y_consonant$() ? false : true)) {
+ break lab18;
+ }
+ break lab15;
+ }
+ this.cursor = this.limit - v_5;
+ if (! (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_22, 4) === 0 ? false : ! this.r_mark_suffix_with_optional_y_consonant$() ? false : true)) {
+ this.cursor = this.limit - v_4;
+ break lab14;
+ }
+ }
+ }
+ this.B_continue_stemming_noun_suffixes = false;
+ break lab0;
+ }
+ this.cursor = this.limit - v_1;
+ lab19 = true;
+ lab19:
+ while (lab19 === true) {
+ lab19 = false;
+ if (! (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_17, 4) === 0 ? false : true)) {
+ break lab19;
+ }
+ lab20 = true;
+ lab20:
+ while (lab20 === true) {
+ lab20 = false;
+ v_6 = this.limit - this.cursor;
+ lab21 = true;
+ lab21:
+ while (lab21 === true) {
+ lab21 = false;
+ if (! (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_20, 32) === 0 ? false : ! this.r_mark_suffix_with_optional_y_consonant$() ? false : true)) {
+ break lab21;
+ }
+ break lab20;
+ }
+ this.cursor = this.limit - v_6;
+ if (! (this.find_among_b$ALAmong$I(TurkishStemmer.a_21, 8) === 0 ? false : ! this.r_mark_suffix_with_optional_y_consonant$() ? false : true)) {
+ break lab19;
+ }
+ }
+ break lab0;
+ }
+ this.cursor = this.limit - v_1;
+ lab22 = true;
+ lab22:
+ while (lab22 === true) {
+ lab22 = false;
+ lab23 = true;
+ lab23:
+ while (lab23 === true) {
+ lab23 = false;
+ v_7 = this.limit - this.cursor;
+ lab24 = true;
+ lab24:
+ while (lab24 === true) {
+ lab24 = false;
+ if (! (this.find_among_b$ALAmong$I(TurkishStemmer.a_15, 4) === 0 ? false : true)) {
+ break lab24;
+ }
+ break lab23;
+ }
+ this.cursor = this.limit - v_7;
+ lab25 = true;
+ lab25:
+ while (lab25 === true) {
+ lab25 = false;
+ if (! (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_14, 4) === 0 ? false : ! this.r_mark_suffix_with_optional_y_consonant$() ? false : true)) {
+ break lab25;
+ }
+ break lab23;
+ }
+ this.cursor = this.limit - v_7;
+ lab26 = true;
+ lab26:
+ while (lab26 === true) {
+ lab26 = false;
+ if (! (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_13, 4) === 0 ? false : true)) {
+ break lab26;
+ }
+ break lab23;
+ }
+ this.cursor = this.limit - v_7;
+ if (! (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_12, 4) === 0 ? false : ! this.r_mark_suffix_with_optional_y_consonant$() ? false : true)) {
+ break lab22;
+ }
+ }
+ this.bra = this.cursor;
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ v_8 = this.limit - this.cursor;
+ lab27 = true;
+ lab27:
+ while (lab27 === true) {
+ lab27 = false;
+ this.ket = this.cursor;
+ if (! (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_22, 4) === 0 ? false : ! this.r_mark_suffix_with_optional_y_consonant$() ? false : true)) {
+ this.cursor = this.limit - v_8;
+ break lab27;
+ }
+ }
+ break lab0;
+ }
+ this.cursor = this.limit - v_1;
+ if (! (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_18, 8) === 0 ? false : true)) {
+ return false;
+ }
+ this.bra = this.cursor;
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ v_9 = this.limit - this.cursor;
+ lab28 = true;
+ lab28:
+ while (lab28 === true) {
+ lab28 = false;
+ this.ket = this.cursor;
+ lab29 = true;
+ lab29:
+ while (lab29 === true) {
+ lab29 = false;
+ v_10 = this.limit - this.cursor;
+ lab30 = true;
+ lab30:
+ while (lab30 === true) {
+ lab30 = false;
+ if (! (this.find_among_b$ALAmong$I(TurkishStemmer.a_15, 4) === 0 ? false : true)) {
+ break lab30;
+ }
+ break lab29;
+ }
+ this.cursor = this.limit - v_10;
+ lab31 = true;
+ lab31:
+ while (lab31 === true) {
+ lab31 = false;
+ if (! (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_16, 2) === 0 ? false : true)) {
+ break lab31;
+ }
+ break lab29;
+ }
+ this.cursor = this.limit - v_10;
+ lab32 = true;
+ lab32:
+ while (lab32 === true) {
+ lab32 = false;
+ if (! (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_12, 4) === 0 ? false : ! this.r_mark_suffix_with_optional_y_consonant$() ? false : true)) {
+ break lab32;
+ }
+ break lab29;
+ }
+ this.cursor = this.limit - v_10;
+ lab33 = true;
+ lab33:
+ while (lab33 === true) {
+ lab33 = false;
+ if (! (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_13, 4) === 0 ? false : true)) {
+ break lab33;
+ }
+ break lab29;
+ }
+ this.cursor = this.limit - v_10;
+ lab34 = true;
+ lab34:
+ while (lab34 === true) {
+ lab34 = false;
+ if (! (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_14, 4) === 0 ? false : ! this.r_mark_suffix_with_optional_y_consonant$() ? false : true)) {
+ break lab34;
+ }
+ break lab29;
+ }
+ this.cursor = this.limit - v_10;
+ }
+ if (! (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_22, 4) === 0 ? false : ! this.r_mark_suffix_with_optional_y_consonant$() ? false : true)) {
+ this.cursor = this.limit - v_9;
+ break lab28;
+ }
+ }
+ }
+ this.bra = this.cursor;
+ return (! this.slice_from$S("") ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+TurkishStemmer.prototype.r_stem_suffix_chain_before_ki$ = function () {
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var v_3;
+ /** @type {!number} */
+ var v_4;
+ /** @type {!number} */
+ var v_5;
+ /** @type {!number} */
+ var v_6;
+ /** @type {!number} */
+ var v_7;
+ /** @type {!number} */
+ var v_8;
+ /** @type {!number} */
+ var v_9;
+ /** @type {!number} */
+ var v_10;
+ /** @type {!number} */
+ var v_11;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!boolean} */
+ var lab2;
+ /** @type {!boolean} */
+ var lab3;
+ /** @type {!boolean} */
+ var lab4;
+ /** @type {!boolean} */
+ var lab5;
+ /** @type {!boolean} */
+ var lab6;
+ /** @type {!boolean} */
+ var lab7;
+ /** @type {!boolean} */
+ var lab8;
+ /** @type {!boolean} */
+ var lab9;
+ /** @type {!boolean} */
+ var lab10;
+ /** @type {!boolean} */
+ var lab11;
+ /** @type {!boolean} */
+ var lab12;
+ /** @type {!boolean} */
+ var lab13;
+ /** @type {!boolean} */
+ var lab14;
+ /** @type {!boolean} */
+ var lab15;
+ /** @type {!boolean} */
+ var lab16;
+ /** @type {!boolean} */
+ var lab17;
+ /** @type {!boolean} */
+ var lab18;
+ this.ket = this.cursor;
+ if (! (! this.eq_s_b$IS(2, "ki") ? false : true)) {
+ return false;
+ }
+ lab0 = true;
+lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ v_1 = this.limit - this.cursor;
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ if (! (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_6, 4) === 0 ? false : true)) {
+ break lab1;
+ }
+ this.bra = this.cursor;
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ v_2 = this.limit - this.cursor;
+ lab2 = true;
+ lab2:
+ while (lab2 === true) {
+ lab2 = false;
+ this.ket = this.cursor;
+ lab3 = true;
+ lab3:
+ while (lab3 === true) {
+ lab3 = false;
+ v_3 = this.limit - this.cursor;
+ lab4 = true;
+ lab4:
+ while (lab4 === true) {
+ lab4 = false;
+ if (! (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_16, 2) === 0 ? false : true)) {
+ break lab4;
+ }
+ this.bra = this.cursor;
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ v_4 = this.limit - this.cursor;
+ lab5 = true;
+ lab5:
+ while (lab5 === true) {
+ lab5 = false;
+ if (! this.r_stem_suffix_chain_before_ki$()) {
+ this.cursor = this.limit - v_4;
+ break lab5;
+ }
+ }
+ break lab3;
+ }
+ this.cursor = this.limit - v_3;
+ if (! (this.find_among_b$ALAmong$I(TurkishStemmer.a_0, 10) === 0 ? false : ! this.r_mark_suffix_with_optional_U_vowel$() ? false : true)) {
+ this.cursor = this.limit - v_2;
+ break lab2;
+ }
+ this.bra = this.cursor;
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ v_5 = this.limit - this.cursor;
+ lab6 = true;
+ lab6:
+ while (lab6 === true) {
+ lab6 = false;
+ this.ket = this.cursor;
+ if (! (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_16, 2) === 0 ? false : true)) {
+ this.cursor = this.limit - v_5;
+ break lab6;
+ }
+ this.bra = this.cursor;
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ if (! this.r_stem_suffix_chain_before_ki$()) {
+ this.cursor = this.limit - v_5;
+ break lab6;
+ }
+ }
+ }
+ }
+ break lab0;
+ }
+ this.cursor = this.limit - v_1;
+ lab7 = true;
+ lab7:
+ while (lab7 === true) {
+ lab7 = false;
+ if (! (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_3, 4) === 0 ? false : ! this.r_mark_suffix_with_optional_n_consonant$() ? false : true)) {
+ break lab7;
+ }
+ this.bra = this.cursor;
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ v_6 = this.limit - this.cursor;
+ lab8 = true;
+ lab8:
+ while (lab8 === true) {
+ lab8 = false;
+ this.ket = this.cursor;
+ lab9 = true;
+ lab9:
+ while (lab9 === true) {
+ lab9 = false;
+ v_7 = this.limit - this.cursor;
+ lab10 = true;
+ lab10:
+ while (lab10 === true) {
+ lab10 = false;
+ if (! (this.find_among_b$ALAmong$I(TurkishStemmer.a_1, 2) === 0 ? false : true)) {
+ break lab10;
+ }
+ this.bra = this.cursor;
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break lab9;
+ }
+ this.cursor = this.limit - v_7;
+ lab11 = true;
+ lab11:
+ while (lab11 === true) {
+ lab11 = false;
+ this.ket = this.cursor;
+ lab12 = true;
+ lab12:
+ while (lab12 === true) {
+ lab12 = false;
+ v_8 = this.limit - this.cursor;
+ lab13 = true;
+ lab13:
+ while (lab13 === true) {
+ lab13 = false;
+ if (! (this.find_among_b$ALAmong$I(TurkishStemmer.a_0, 10) === 0 ? false : ! this.r_mark_suffix_with_optional_U_vowel$() ? false : true)) {
+ break lab13;
+ }
+ break lab12;
+ }
+ this.cursor = this.limit - v_8;
+ if (! (! this.r_check_vowel_harmony$() ? false : ! this.in_grouping_b$AIII(TurkishStemmer.g_U, 105, 305) ? false : ! this.r_mark_suffix_with_optional_s_consonant$() ? false : true)) {
+ break lab11;
+ }
+ }
+ this.bra = this.cursor;
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ v_9 = this.limit - this.cursor;
+ lab14 = true;
+ lab14:
+ while (lab14 === true) {
+ lab14 = false;
+ this.ket = this.cursor;
+ if (! (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_16, 2) === 0 ? false : true)) {
+ this.cursor = this.limit - v_9;
+ break lab14;
+ }
+ this.bra = this.cursor;
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ if (! this.r_stem_suffix_chain_before_ki$()) {
+ this.cursor = this.limit - v_9;
+ break lab14;
+ }
+ }
+ break lab9;
+ }
+ this.cursor = this.limit - v_7;
+ if (! this.r_stem_suffix_chain_before_ki$()) {
+ this.cursor = this.limit - v_6;
+ break lab8;
+ }
+ }
+ }
+ break lab0;
+ }
+ this.cursor = this.limit - v_1;
+ if (! (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_7, 2) === 0 ? false : true)) {
+ return false;
+ }
+ lab15 = true;
+ lab15:
+ while (lab15 === true) {
+ lab15 = false;
+ v_10 = this.limit - this.cursor;
+ lab16 = true;
+ lab16:
+ while (lab16 === true) {
+ lab16 = false;
+ if (! (this.find_among_b$ALAmong$I(TurkishStemmer.a_1, 2) === 0 ? false : true)) {
+ break lab16;
+ }
+ this.bra = this.cursor;
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break lab15;
+ }
+ this.cursor = this.limit - v_10;
+ lab17 = true;
+ lab17:
+ while (lab17 === true) {
+ lab17 = false;
+ if (! (! this.r_check_vowel_harmony$() ? false : ! this.in_grouping_b$AIII(TurkishStemmer.g_U, 105, 305) ? false : ! this.r_mark_suffix_with_optional_s_consonant$() ? false : true)) {
+ break lab17;
+ }
+ this.bra = this.cursor;
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ v_11 = this.limit - this.cursor;
+ lab18 = true;
+ lab18:
+ while (lab18 === true) {
+ lab18 = false;
+ this.ket = this.cursor;
+ if (! (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_16, 2) === 0 ? false : true)) {
+ this.cursor = this.limit - v_11;
+ break lab18;
+ }
+ this.bra = this.cursor;
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ if (! this.r_stem_suffix_chain_before_ki$()) {
+ this.cursor = this.limit - v_11;
+ break lab18;
+ }
+ }
+ break lab15;
+ }
+ this.cursor = this.limit - v_10;
+ if (! this.r_stem_suffix_chain_before_ki$()) {
+ return false;
+ }
+ }
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+TurkishStemmer.prototype.r_stem_noun_suffixes$ = function () {
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var v_3;
+ /** @type {!number} */
+ var v_4;
+ /** @type {!number} */
+ var v_5;
+ /** @type {!number} */
+ var v_6;
+ /** @type {!number} */
+ var v_7;
+ /** @type {!number} */
+ var v_8;
+ /** @type {!number} */
+ var v_9;
+ /** @type {!number} */
+ var v_10;
+ /** @type {!number} */
+ var v_11;
+ /** @type {!number} */
+ var v_12;
+ /** @type {!number} */
+ var v_13;
+ /** @type {!number} */
+ var v_14;
+ /** @type {!number} */
+ var v_15;
+ /** @type {!number} */
+ var v_16;
+ /** @type {!number} */
+ var v_17;
+ /** @type {!number} */
+ var v_18;
+ /** @type {!number} */
+ var v_19;
+ /** @type {!number} */
+ var v_20;
+ /** @type {!number} */
+ var v_21;
+ /** @type {!number} */
+ var v_22;
+ /** @type {!number} */
+ var v_23;
+ /** @type {!number} */
+ var v_24;
+ /** @type {!number} */
+ var v_25;
+ /** @type {!number} */
+ var v_26;
+ /** @type {!number} */
+ var v_27;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!boolean} */
+ var lab2;
+ /** @type {!boolean} */
+ var lab3;
+ /** @type {!boolean} */
+ var lab4;
+ /** @type {!boolean} */
+ var lab5;
+ /** @type {!boolean} */
+ var lab6;
+ /** @type {!boolean} */
+ var lab7;
+ /** @type {!boolean} */
+ var lab8;
+ /** @type {!boolean} */
+ var lab9;
+ /** @type {!boolean} */
+ var lab10;
+ /** @type {!boolean} */
+ var lab11;
+ /** @type {!boolean} */
+ var lab12;
+ /** @type {!boolean} */
+ var lab13;
+ /** @type {!boolean} */
+ var lab14;
+ /** @type {!boolean} */
+ var lab15;
+ /** @type {!boolean} */
+ var lab16;
+ /** @type {!boolean} */
+ var lab17;
+ /** @type {!boolean} */
+ var lab18;
+ /** @type {!boolean} */
+ var lab19;
+ /** @type {!boolean} */
+ var lab20;
+ /** @type {!boolean} */
+ var lab21;
+ /** @type {!boolean} */
+ var lab22;
+ /** @type {!boolean} */
+ var lab23;
+ /** @type {!boolean} */
+ var lab24;
+ /** @type {!boolean} */
+ var lab25;
+ /** @type {!boolean} */
+ var lab26;
+ /** @type {!boolean} */
+ var lab27;
+ /** @type {!boolean} */
+ var lab28;
+ /** @type {!boolean} */
+ var lab29;
+ /** @type {!boolean} */
+ var lab30;
+ /** @type {!boolean} */
+ var lab31;
+ /** @type {!boolean} */
+ var lab32;
+ /** @type {!boolean} */
+ var lab33;
+ /** @type {!boolean} */
+ var lab34;
+ /** @type {!boolean} */
+ var lab35;
+ /** @type {!boolean} */
+ var lab36;
+ /** @type {!boolean} */
+ var lab37;
+ /** @type {!boolean} */
+ var lab38;
+ /** @type {!boolean} */
+ var lab39;
+ /** @type {!boolean} */
+ var lab40;
+ /** @type {!boolean} */
+ var lab41;
+ /** @type {!boolean} */
+ var lab42;
+ /** @type {!boolean} */
+ var lab43;
+ /** @type {!boolean} */
+ var lab44;
+ /** @type {!boolean} */
+ var lab45;
+ /** @type {!boolean} */
+ var lab46;
+ /** @type {!boolean} */
+ var lab47;
+ /** @type {!boolean} */
+ var lab48;
+ /** @type {!boolean} */
+ var lab49;
+ /** @type {!boolean} */
+ var lab50;
+ /** @type {!boolean} */
+ var lab51;
+ /** @type {!boolean} */
+ var lab52;
+ /** @type {!boolean} */
+ var lab53;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var cursor$1;
+ lab0 = true;
+lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ v_1 = this.limit - this.cursor;
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ this.ket = this.cursor;
+ if (! (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_16, 2) === 0 ? false : true)) {
+ break lab1;
+ }
+ this.bra = this.cursor;
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ v_2 = this.limit - this.cursor;
+ lab2 = true;
+ lab2:
+ while (lab2 === true) {
+ lab2 = false;
+ if (! this.r_stem_suffix_chain_before_ki$()) {
+ this.cursor = this.limit - v_2;
+ break lab2;
+ }
+ }
+ break lab0;
+ }
+ this.cursor = this.limit - v_1;
+ lab3 = true;
+ lab3:
+ while (lab3 === true) {
+ lab3 = false;
+ this.ket = this.cursor;
+ if (! (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_11, 2) === 0 ? false : ! this.r_mark_suffix_with_optional_n_consonant$() ? false : true)) {
+ break lab3;
+ }
+ this.bra = this.cursor;
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ v_3 = this.limit - this.cursor;
+ lab4 = true;
+ lab4:
+ while (lab4 === true) {
+ lab4 = false;
+ lab5 = true;
+ lab5:
+ while (lab5 === true) {
+ lab5 = false;
+ v_4 = this.limit - this.cursor;
+ lab6 = true;
+ lab6:
+ while (lab6 === true) {
+ lab6 = false;
+ this.ket = this.cursor;
+ if (! (this.find_among_b$ALAmong$I(TurkishStemmer.a_1, 2) === 0 ? false : true)) {
+ break lab6;
+ }
+ this.bra = this.cursor;
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break lab5;
+ }
+ this.cursor = this.limit - v_4;
+ lab7 = true;
+ lab7:
+ while (lab7 === true) {
+ lab7 = false;
+ this.ket = this.cursor;
+ lab8 = true;
+ lab8:
+ while (lab8 === true) {
+ lab8 = false;
+ v_5 = this.limit - this.cursor;
+ lab9 = true;
+ lab9:
+ while (lab9 === true) {
+ lab9 = false;
+ if (! (this.find_among_b$ALAmong$I(TurkishStemmer.a_0, 10) === 0 ? false : ! this.r_mark_suffix_with_optional_U_vowel$() ? false : true)) {
+ break lab9;
+ }
+ break lab8;
+ }
+ this.cursor = this.limit - v_5;
+ if (! (! this.r_check_vowel_harmony$() ? false : ! this.in_grouping_b$AIII(TurkishStemmer.g_U, 105, 305) ? false : ! this.r_mark_suffix_with_optional_s_consonant$() ? false : true)) {
+ break lab7;
+ }
+ }
+ this.bra = this.cursor;
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ v_6 = this.limit - this.cursor;
+ lab10 = true;
+ lab10:
+ while (lab10 === true) {
+ lab10 = false;
+ this.ket = this.cursor;
+ if (! (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_16, 2) === 0 ? false : true)) {
+ this.cursor = this.limit - v_6;
+ break lab10;
+ }
+ this.bra = this.cursor;
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ if (! this.r_stem_suffix_chain_before_ki$()) {
+ this.cursor = this.limit - v_6;
+ break lab10;
+ }
+ }
+ break lab5;
+ }
+ cursor$0 = this.cursor = this.limit - v_4;
+ this.ket = cursor$0;
+ if (! (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_16, 2) === 0 ? false : true)) {
+ this.cursor = this.limit - v_3;
+ break lab4;
+ }
+ this.bra = this.cursor;
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ if (! this.r_stem_suffix_chain_before_ki$()) {
+ this.cursor = this.limit - v_3;
+ break lab4;
+ }
+ }
+ }
+ break lab0;
+ }
+ this.cursor = this.limit - v_1;
+ lab11 = true;
+ lab11:
+ while (lab11 === true) {
+ lab11 = false;
+ this.ket = this.cursor;
+ lab12 = true;
+ lab12:
+ while (lab12 === true) {
+ lab12 = false;
+ v_7 = this.limit - this.cursor;
+ lab13 = true;
+ lab13:
+ while (lab13 === true) {
+ lab13 = false;
+ if (! (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_7, 2) === 0 ? false : true)) {
+ break lab13;
+ }
+ break lab12;
+ }
+ this.cursor = this.limit - v_7;
+ if (! (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_5, 2) === 0 ? false : true)) {
+ break lab11;
+ }
+ }
+ lab14 = true;
+ lab14:
+ while (lab14 === true) {
+ lab14 = false;
+ v_8 = this.limit - this.cursor;
+ lab15 = true;
+ lab15:
+ while (lab15 === true) {
+ lab15 = false;
+ if (! (this.find_among_b$ALAmong$I(TurkishStemmer.a_1, 2) === 0 ? false : true)) {
+ break lab15;
+ }
+ this.bra = this.cursor;
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break lab14;
+ }
+ this.cursor = this.limit - v_8;
+ lab16 = true;
+ lab16:
+ while (lab16 === true) {
+ lab16 = false;
+ if (! (! this.r_check_vowel_harmony$() ? false : ! this.in_grouping_b$AIII(TurkishStemmer.g_U, 105, 305) ? false : ! this.r_mark_suffix_with_optional_s_consonant$() ? false : true)) {
+ break lab16;
+ }
+ this.bra = this.cursor;
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ v_9 = this.limit - this.cursor;
+ lab17 = true;
+ lab17:
+ while (lab17 === true) {
+ lab17 = false;
+ this.ket = this.cursor;
+ if (! (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_16, 2) === 0 ? false : true)) {
+ this.cursor = this.limit - v_9;
+ break lab17;
+ }
+ this.bra = this.cursor;
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ if (! this.r_stem_suffix_chain_before_ki$()) {
+ this.cursor = this.limit - v_9;
+ break lab17;
+ }
+ }
+ break lab14;
+ }
+ this.cursor = this.limit - v_8;
+ if (! this.r_stem_suffix_chain_before_ki$()) {
+ break lab11;
+ }
+ }
+ break lab0;
+ }
+ this.cursor = this.limit - v_1;
+ lab18 = true;
+ lab18:
+ while (lab18 === true) {
+ lab18 = false;
+ this.ket = this.cursor;
+ lab19 = true;
+ lab19:
+ while (lab19 === true) {
+ lab19 = false;
+ v_10 = this.limit - this.cursor;
+ lab20 = true;
+ lab20:
+ while (lab20 === true) {
+ lab20 = false;
+ if (! (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_9, 2) === 0 ? false : true)) {
+ break lab20;
+ }
+ break lab19;
+ }
+ this.cursor = this.limit - v_10;
+ if (! (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_2, 4) === 0 ? false : true)) {
+ break lab18;
+ }
+ }
+ lab21 = true;
+ lab21:
+ while (lab21 === true) {
+ lab21 = false;
+ v_11 = this.limit - this.cursor;
+ lab22 = true;
+ lab22:
+ while (lab22 === true) {
+ lab22 = false;
+ if (! (! this.r_check_vowel_harmony$() ? false : ! this.in_grouping_b$AIII(TurkishStemmer.g_U, 105, 305) ? false : ! this.r_mark_suffix_with_optional_s_consonant$() ? false : true)) {
+ break lab22;
+ }
+ this.bra = this.cursor;
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ v_12 = this.limit - this.cursor;
+ lab23 = true;
+ lab23:
+ while (lab23 === true) {
+ lab23 = false;
+ this.ket = this.cursor;
+ if (! (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_16, 2) === 0 ? false : true)) {
+ this.cursor = this.limit - v_12;
+ break lab23;
+ }
+ this.bra = this.cursor;
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ if (! this.r_stem_suffix_chain_before_ki$()) {
+ this.cursor = this.limit - v_12;
+ break lab23;
+ }
+ }
+ break lab21;
+ }
+ this.cursor = this.limit - v_11;
+ if (! (this.find_among_b$ALAmong$I(TurkishStemmer.a_1, 2) === 0 ? false : true)) {
+ break lab18;
+ }
+ }
+ break lab0;
+ }
+ this.cursor = this.limit - v_1;
+ lab24 = true;
+ lab24:
+ while (lab24 === true) {
+ lab24 = false;
+ this.ket = this.cursor;
+ if (! (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_8, 4) === 0 ? false : true)) {
+ break lab24;
+ }
+ this.bra = this.cursor;
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ v_13 = this.limit - this.cursor;
+ lab25 = true;
+ lab25:
+ while (lab25 === true) {
+ lab25 = false;
+ this.ket = this.cursor;
+ lab26 = true;
+ lab26:
+ while (lab26 === true) {
+ lab26 = false;
+ v_14 = this.limit - this.cursor;
+ lab27 = true;
+ lab27:
+ while (lab27 === true) {
+ lab27 = false;
+ if (! (this.find_among_b$ALAmong$I(TurkishStemmer.a_0, 10) === 0 ? false : ! this.r_mark_suffix_with_optional_U_vowel$() ? false : true)) {
+ break lab27;
+ }
+ this.bra = this.cursor;
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ v_15 = this.limit - this.cursor;
+ lab28 = true;
+ lab28:
+ while (lab28 === true) {
+ lab28 = false;
+ this.ket = this.cursor;
+ if (! (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_16, 2) === 0 ? false : true)) {
+ this.cursor = this.limit - v_15;
+ break lab28;
+ }
+ this.bra = this.cursor;
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ if (! this.r_stem_suffix_chain_before_ki$()) {
+ this.cursor = this.limit - v_15;
+ break lab28;
+ }
+ }
+ break lab26;
+ }
+ this.cursor = this.limit - v_14;
+ lab29 = true;
+ lab29:
+ while (lab29 === true) {
+ lab29 = false;
+ if (! (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_16, 2) === 0 ? false : true)) {
+ break lab29;
+ }
+ this.bra = this.cursor;
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ v_16 = this.limit - this.cursor;
+ lab30 = true;
+ lab30:
+ while (lab30 === true) {
+ lab30 = false;
+ if (! this.r_stem_suffix_chain_before_ki$()) {
+ this.cursor = this.limit - v_16;
+ break lab30;
+ }
+ }
+ break lab26;
+ }
+ this.cursor = this.limit - v_14;
+ if (! this.r_stem_suffix_chain_before_ki$()) {
+ this.cursor = this.limit - v_13;
+ break lab25;
+ }
+ }
+ }
+ break lab0;
+ }
+ this.cursor = this.limit - v_1;
+ lab31 = true;
+ lab31:
+ while (lab31 === true) {
+ lab31 = false;
+ this.ket = this.cursor;
+ lab32 = true;
+ lab32:
+ while (lab32 === true) {
+ lab32 = false;
+ v_17 = this.limit - this.cursor;
+ lab33 = true;
+ lab33:
+ while (lab33 === true) {
+ lab33 = false;
+ if (! (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_3, 4) === 0 ? false : ! this.r_mark_suffix_with_optional_n_consonant$() ? false : true)) {
+ break lab33;
+ }
+ break lab32;
+ }
+ this.cursor = this.limit - v_17;
+ if (! (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_10, 2) === 0 ? false : ! this.r_mark_suffix_with_optional_y_consonant$() ? false : true)) {
+ break lab31;
+ }
+ }
+ this.bra = this.cursor;
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ v_18 = this.limit - this.cursor;
+ lab34 = true;
+ lab34:
+ while (lab34 === true) {
+ lab34 = false;
+ lab35 = true;
+ lab35:
+ while (lab35 === true) {
+ lab35 = false;
+ v_19 = this.limit - this.cursor;
+ lab36 = true;
+ lab36:
+ while (lab36 === true) {
+ lab36 = false;
+ this.ket = this.cursor;
+ if (! (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_16, 2) === 0 ? false : true)) {
+ break lab36;
+ }
+ this.bra = this.cursor;
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ if (! this.r_stem_suffix_chain_before_ki$()) {
+ break lab36;
+ }
+ break lab35;
+ }
+ this.cursor = this.limit - v_19;
+ lab37 = true;
+ lab37:
+ while (lab37 === true) {
+ lab37 = false;
+ this.ket = this.cursor;
+ lab38 = true;
+ lab38:
+ while (lab38 === true) {
+ lab38 = false;
+ v_20 = this.limit - this.cursor;
+ lab39 = true;
+ lab39:
+ while (lab39 === true) {
+ lab39 = false;
+ if (! (this.find_among_b$ALAmong$I(TurkishStemmer.a_0, 10) === 0 ? false : ! this.r_mark_suffix_with_optional_U_vowel$() ? false : true)) {
+ break lab39;
+ }
+ break lab38;
+ }
+ this.cursor = this.limit - v_20;
+ if (! (! this.r_check_vowel_harmony$() ? false : ! this.in_grouping_b$AIII(TurkishStemmer.g_U, 105, 305) ? false : ! this.r_mark_suffix_with_optional_s_consonant$() ? false : true)) {
+ break lab37;
+ }
+ }
+ this.bra = this.cursor;
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ v_21 = this.limit - this.cursor;
+ lab40 = true;
+ lab40:
+ while (lab40 === true) {
+ lab40 = false;
+ this.ket = this.cursor;
+ if (! (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_16, 2) === 0 ? false : true)) {
+ this.cursor = this.limit - v_21;
+ break lab40;
+ }
+ this.bra = this.cursor;
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ if (! this.r_stem_suffix_chain_before_ki$()) {
+ this.cursor = this.limit - v_21;
+ break lab40;
+ }
+ }
+ break lab35;
+ }
+ this.cursor = this.limit - v_19;
+ if (! this.r_stem_suffix_chain_before_ki$()) {
+ this.cursor = this.limit - v_18;
+ break lab34;
+ }
+ }
+ }
+ break lab0;
+ }
+ this.cursor = this.limit - v_1;
+ lab41 = true;
+ lab41:
+ while (lab41 === true) {
+ lab41 = false;
+ this.ket = this.cursor;
+ if (! (this.find_among_b$ALAmong$I(TurkishStemmer.a_1, 2) === 0 ? false : true)) {
+ break lab41;
+ }
+ this.bra = this.cursor;
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break lab0;
+ }
+ this.cursor = this.limit - v_1;
+ lab42 = true;
+ lab42:
+ while (lab42 === true) {
+ lab42 = false;
+ if (! this.r_stem_suffix_chain_before_ki$()) {
+ break lab42;
+ }
+ break lab0;
+ }
+ this.cursor = this.limit - v_1;
+ lab43 = true;
+ lab43:
+ while (lab43 === true) {
+ lab43 = false;
+ this.ket = this.cursor;
+ lab44 = true;
+ lab44:
+ while (lab44 === true) {
+ lab44 = false;
+ v_22 = this.limit - this.cursor;
+ lab45 = true;
+ lab45:
+ while (lab45 === true) {
+ lab45 = false;
+ if (! (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_6, 4) === 0 ? false : true)) {
+ break lab45;
+ }
+ break lab44;
+ }
+ this.cursor = this.limit - v_22;
+ lab46 = true;
+ lab46:
+ while (lab46 === true) {
+ lab46 = false;
+ if (! (! this.r_check_vowel_harmony$() ? false : ! this.in_grouping_b$AIII(TurkishStemmer.g_U, 105, 305) ? false : ! this.r_mark_suffix_with_optional_y_consonant$() ? false : true)) {
+ break lab46;
+ }
+ break lab44;
+ }
+ this.cursor = this.limit - v_22;
+ if (! (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_4, 2) === 0 ? false : ! this.r_mark_suffix_with_optional_y_consonant$() ? false : true)) {
+ break lab43;
+ }
+ }
+ this.bra = this.cursor;
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ v_23 = this.limit - this.cursor;
+ lab47 = true;
+ lab47:
+ while (lab47 === true) {
+ lab47 = false;
+ this.ket = this.cursor;
+ lab48 = true;
+ lab48:
+ while (lab48 === true) {
+ lab48 = false;
+ v_24 = this.limit - this.cursor;
+ lab49 = true;
+ lab49:
+ while (lab49 === true) {
+ lab49 = false;
+ if (! (this.find_among_b$ALAmong$I(TurkishStemmer.a_0, 10) === 0 ? false : ! this.r_mark_suffix_with_optional_U_vowel$() ? false : true)) {
+ break lab49;
+ }
+ this.bra = this.cursor;
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ v_25 = this.limit - this.cursor;
+ lab50 = true;
+ lab50:
+ while (lab50 === true) {
+ lab50 = false;
+ this.ket = this.cursor;
+ if (! (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_16, 2) === 0 ? false : true)) {
+ this.cursor = this.limit - v_25;
+ break lab50;
+ }
+ }
+ break lab48;
+ }
+ this.cursor = this.limit - v_24;
+ if (! (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_16, 2) === 0 ? false : true)) {
+ this.cursor = this.limit - v_23;
+ break lab47;
+ }
+ }
+ this.bra = this.cursor;
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ this.ket = this.cursor;
+ if (! this.r_stem_suffix_chain_before_ki$()) {
+ this.cursor = this.limit - v_23;
+ break lab47;
+ }
+ }
+ break lab0;
+ }
+ cursor$1 = this.cursor = this.limit - v_1;
+ this.ket = cursor$1;
+ lab51 = true;
+ lab51:
+ while (lab51 === true) {
+ lab51 = false;
+ v_26 = this.limit - this.cursor;
+ lab52 = true;
+ lab52:
+ while (lab52 === true) {
+ lab52 = false;
+ if (! (this.find_among_b$ALAmong$I(TurkishStemmer.a_0, 10) === 0 ? false : ! this.r_mark_suffix_with_optional_U_vowel$() ? false : true)) {
+ break lab52;
+ }
+ break lab51;
+ }
+ this.cursor = this.limit - v_26;
+ if (! (! this.r_check_vowel_harmony$() ? false : ! this.in_grouping_b$AIII(TurkishStemmer.g_U, 105, 305) ? false : ! this.r_mark_suffix_with_optional_s_consonant$() ? false : true)) {
+ return false;
+ }
+ }
+ this.bra = this.cursor;
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ v_27 = this.limit - this.cursor;
+ lab53 = true;
+ lab53:
+ while (lab53 === true) {
+ lab53 = false;
+ this.ket = this.cursor;
+ if (! (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_16, 2) === 0 ? false : true)) {
+ this.cursor = this.limit - v_27;
+ break lab53;
+ }
+ this.bra = this.cursor;
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ if (! this.r_stem_suffix_chain_before_ki$()) {
+ this.cursor = this.limit - v_27;
+ break lab53;
+ }
+ }
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+TurkishStemmer.prototype.r_post_process_last_consonants$ = function () {
+ /** @type {!number} */
+ var among_var;
+ this.ket = this.cursor;
+ among_var = this.find_among_b$ALAmong$I(TurkishStemmer.a_23, 4);
+ if (among_var === 0) {
+ return false;
+ }
+ this.bra = this.cursor;
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ if (! this.slice_from$S("p")) {
+ return false;
+ }
+ break;
+ case 2:
+ if (! this.slice_from$S("\u00E7")) {
+ return false;
+ }
+ break;
+ case 3:
+ if (! this.slice_from$S("t")) {
+ return false;
+ }
+ break;
+ case 4:
+ if (! this.slice_from$S("k")) {
+ return false;
+ }
+ break;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+TurkishStemmer.prototype.r_append_U_to_stems_ending_with_d_or_g$ = function () {
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var v_3;
+ /** @type {!number} */
+ var v_4;
+ /** @type {!number} */
+ var v_5;
+ /** @type {!number} */
+ var v_6;
+ /** @type {!number} */
+ var v_7;
+ /** @type {!number} */
+ var v_8;
+ /** @type {!number} */
+ var v_9;
+ /** @type {!number} */
+ var v_10;
+ /** @type {!number} */
+ var v_11;
+ /** @type {!number} */
+ var v_12;
+ /** @type {!number} */
+ var v_13;
+ /** @type {!number} */
+ var v_14;
+ /** @type {!number} */
+ var v_15;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!boolean} */
+ var lab2;
+ /** @type {!boolean} */
+ var lab3;
+ /** @type {!boolean} */
+ var lab5;
+ /** @type {!boolean} */
+ var lab6;
+ /** @type {!boolean} */
+ var lab7;
+ /** @type {!boolean} */
+ var lab8;
+ /** @type {!boolean} */
+ var lab10;
+ /** @type {!boolean} */
+ var lab11;
+ /** @type {!boolean} */
+ var lab12;
+ /** @type {!boolean} */
+ var lab13;
+ /** @type {!boolean} */
+ var lab15;
+ /** @type {!boolean} */
+ var lab16;
+ /** @type {!boolean} */
+ var lab17;
+ /** @type {!boolean} */
+ var lab19;
+ /** @type {!boolean} */
+ var lab20;
+ /** @type {!boolean} */
+ var lab21;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var cursor$1;
+ /** @type {!number} */
+ var cursor$2;
+ /** @type {!number} */
+ var cursor$3;
+ /** @type {!number} */
+ var cursor$4;
+ /** @type {!number} */
+ var cursor$5;
+ /** @type {!number} */
+ var cursor$6;
+ /** @type {!number} */
+ var limit$0;
+ /** @type {!number} */
+ var cursor$7;
+ /** @type {!number} */
+ var cursor$8;
+ v_1 = this.limit - this.cursor;
+ lab0 = true;
+lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ v_2 = this.limit - this.cursor;
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ if (! this.eq_s_b$IS(1, "d")) {
+ break lab1;
+ }
+ break lab0;
+ }
+ this.cursor = this.limit - v_2;
+ if (! this.eq_s_b$IS(1, "g")) {
+ return false;
+ }
+ }
+ this.cursor = this.limit - v_1;
+ lab2 = true;
+lab2:
+ while (lab2 === true) {
+ lab2 = false;
+ v_3 = this.limit - this.cursor;
+ lab3 = true;
+ lab3:
+ while (lab3 === true) {
+ lab3 = false;
+ v_4 = this.limit - this.cursor;
+ golab4:
+ while (true) {
+ v_5 = this.limit - this.cursor;
+ lab5 = true;
+ lab5:
+ while (lab5 === true) {
+ lab5 = false;
+ if (! this.in_grouping_b$AIII(TurkishStemmer.g_vowel, 97, 305)) {
+ break lab5;
+ }
+ this.cursor = this.limit - v_5;
+ break golab4;
+ }
+ cursor$0 = this.cursor = this.limit - v_5;
+ if (cursor$0 <= this.limit_backward) {
+ break lab3;
+ }
+ this.cursor--;
+ }
+ lab6 = true;
+ lab6:
+ while (lab6 === true) {
+ lab6 = false;
+ v_6 = this.limit - this.cursor;
+ lab7 = true;
+ lab7:
+ while (lab7 === true) {
+ lab7 = false;
+ if (! this.eq_s_b$IS(1, "a")) {
+ break lab7;
+ }
+ break lab6;
+ }
+ this.cursor = this.limit - v_6;
+ if (! this.eq_s_b$IS(1, "\u0131")) {
+ break lab3;
+ }
+ }
+ cursor$1 = this.cursor = this.limit - v_4;
+ this.insert$IIS(cursor$1, cursor$1, "\u0131");
+ this.cursor = cursor$1;
+ break lab2;
+ }
+ this.cursor = this.limit - v_3;
+ lab8 = true;
+ lab8:
+ while (lab8 === true) {
+ lab8 = false;
+ v_7 = this.limit - this.cursor;
+ golab9:
+ while (true) {
+ v_8 = this.limit - this.cursor;
+ lab10 = true;
+ lab10:
+ while (lab10 === true) {
+ lab10 = false;
+ if (! this.in_grouping_b$AIII(TurkishStemmer.g_vowel, 97, 305)) {
+ break lab10;
+ }
+ this.cursor = this.limit - v_8;
+ break golab9;
+ }
+ cursor$2 = this.cursor = this.limit - v_8;
+ if (cursor$2 <= this.limit_backward) {
+ break lab8;
+ }
+ this.cursor--;
+ }
+ lab11 = true;
+ lab11:
+ while (lab11 === true) {
+ lab11 = false;
+ v_9 = this.limit - this.cursor;
+ lab12 = true;
+ lab12:
+ while (lab12 === true) {
+ lab12 = false;
+ if (! this.eq_s_b$IS(1, "e")) {
+ break lab12;
+ }
+ break lab11;
+ }
+ this.cursor = this.limit - v_9;
+ if (! this.eq_s_b$IS(1, "i")) {
+ break lab8;
+ }
+ }
+ cursor$3 = this.cursor = this.limit - v_7;
+ this.insert$IIS(cursor$3, cursor$3, "i");
+ this.cursor = cursor$3;
+ break lab2;
+ }
+ this.cursor = this.limit - v_3;
+ lab13 = true;
+ lab13:
+ while (lab13 === true) {
+ lab13 = false;
+ v_10 = this.limit - this.cursor;
+ golab14:
+ while (true) {
+ v_11 = this.limit - this.cursor;
+ lab15 = true;
+ lab15:
+ while (lab15 === true) {
+ lab15 = false;
+ if (! this.in_grouping_b$AIII(TurkishStemmer.g_vowel, 97, 305)) {
+ break lab15;
+ }
+ this.cursor = this.limit - v_11;
+ break golab14;
+ }
+ cursor$4 = this.cursor = this.limit - v_11;
+ if (cursor$4 <= this.limit_backward) {
+ break lab13;
+ }
+ this.cursor--;
+ }
+ lab16 = true;
+ lab16:
+ while (lab16 === true) {
+ lab16 = false;
+ v_12 = this.limit - this.cursor;
+ lab17 = true;
+ lab17:
+ while (lab17 === true) {
+ lab17 = false;
+ if (! this.eq_s_b$IS(1, "o")) {
+ break lab17;
+ }
+ break lab16;
+ }
+ this.cursor = this.limit - v_12;
+ if (! this.eq_s_b$IS(1, "u")) {
+ break lab13;
+ }
+ }
+ cursor$5 = this.cursor = this.limit - v_10;
+ this.insert$IIS(cursor$5, cursor$5, "u");
+ this.cursor = cursor$5;
+ break lab2;
+ }
+ cursor$7 = this.cursor = (limit$0 = this.limit) - v_3;
+ v_13 = limit$0 - cursor$7;
+ golab18:
+ while (true) {
+ v_14 = this.limit - this.cursor;
+ lab19 = true;
+ lab19:
+ while (lab19 === true) {
+ lab19 = false;
+ if (! this.in_grouping_b$AIII(TurkishStemmer.g_vowel, 97, 305)) {
+ break lab19;
+ }
+ this.cursor = this.limit - v_14;
+ break golab18;
+ }
+ cursor$6 = this.cursor = this.limit - v_14;
+ if (cursor$6 <= this.limit_backward) {
+ return false;
+ }
+ this.cursor--;
+ }
+ lab20 = true;
+ lab20:
+ while (lab20 === true) {
+ lab20 = false;
+ v_15 = this.limit - this.cursor;
+ lab21 = true;
+ lab21:
+ while (lab21 === true) {
+ lab21 = false;
+ if (! this.eq_s_b$IS(1, "\u00F6")) {
+ break lab21;
+ }
+ break lab20;
+ }
+ this.cursor = this.limit - v_15;
+ if (! this.eq_s_b$IS(1, "\u00FC")) {
+ return false;
+ }
+ }
+ cursor$8 = this.cursor = this.limit - v_13;
+ this.insert$IIS(cursor$8, cursor$8, "\u00FC");
+ this.cursor = cursor$8;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+TurkishStemmer.prototype.r_more_than_one_syllable_word$ = function () {
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_3;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!boolean} */
+ var lab3;
+ v_1 = this.cursor;
+ v_2 = 2;
+replab0:
+ while (true) {
+ v_3 = this.cursor;
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ golab2:
+ while (true) {
+ lab3 = true;
+ lab3:
+ while (lab3 === true) {
+ lab3 = false;
+ if (! this.in_grouping$AIII(TurkishStemmer.g_vowel, 97, 305)) {
+ break lab3;
+ }
+ break golab2;
+ }
+ if (this.cursor >= this.limit) {
+ break lab1;
+ }
+ this.cursor++;
+ }
+ v_2--;
+ continue replab0;
+ }
+ this.cursor = v_3;
+ break replab0;
+ }
+ if (v_2 > 0) {
+ return false;
+ }
+ this.cursor = v_1;
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+TurkishStemmer.prototype.r_is_reserved_word$ = function () {
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var v_4;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!boolean} */
+ var lab3;
+ /** @type {!boolean} */
+ var lab5;
+ /** @type {!number} */
+ var I_strlen$0;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var I_strlen$1;
+ lab0 = true;
+lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ v_1 = this.cursor;
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ v_2 = this.cursor;
+ golab2:
+ while (true) {
+ lab3 = true;
+ lab3:
+ while (lab3 === true) {
+ lab3 = false;
+ if (! this.eq_s$IS(2, "ad")) {
+ break lab3;
+ }
+ break golab2;
+ }
+ if (this.cursor >= this.limit) {
+ break lab1;
+ }
+ this.cursor++;
+ }
+ I_strlen$0 = this.I_strlen = 2;
+ if (! (I_strlen$0 === this.limit)) {
+ break lab1;
+ }
+ this.cursor = v_2;
+ break lab0;
+ }
+ cursor$0 = this.cursor = v_1;
+ v_4 = cursor$0;
+ golab4:
+ while (true) {
+ lab5 = true;
+ lab5:
+ while (lab5 === true) {
+ lab5 = false;
+ if (! this.eq_s$IS(5, "soyad")) {
+ break lab5;
+ }
+ break golab4;
+ }
+ if (this.cursor >= this.limit) {
+ return false;
+ }
+ this.cursor++;
+ }
+ I_strlen$1 = this.I_strlen = 5;
+ if (! (I_strlen$1 === this.limit)) {
+ return false;
+ }
+ this.cursor = v_4;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+TurkishStemmer.prototype.r_postlude$ = function () {
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!boolean} */
+ var lab2;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var limit$0;
+ /** @type {!number} */
+ var cursor$1;
+ v_1 = this.cursor;
+ lab0 = true;
+lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ if (! this.r_is_reserved_word$()) {
+ break lab0;
+ }
+ return false;
+ }
+ cursor$0 = this.cursor = v_1;
+ this.limit_backward = cursor$0;
+ cursor$1 = this.cursor = limit$0 = this.limit;
+ v_2 = limit$0 - cursor$1;
+ lab1 = true;
+lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ if (! this.r_append_U_to_stems_ending_with_d_or_g$()) {
+ break lab1;
+ }
+ }
+ this.cursor = this.limit - v_2;
+ lab2 = true;
+lab2:
+ while (lab2 === true) {
+ lab2 = false;
+ if (! this.r_post_process_last_consonants$()) {
+ break lab2;
+ }
+ }
+ this.cursor = this.limit_backward;
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+TurkishStemmer.prototype.stem$ = function () {
+ /** @type {!number} */
+ var v_1;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!number} */
+ var limit$0;
+ /** @type {!number} */
+ var cursor$0;
+ if (! this.r_more_than_one_syllable_word$()) {
+ return false;
+ }
+ this.limit_backward = this.cursor;
+ cursor$0 = this.cursor = limit$0 = this.limit;
+ v_1 = limit$0 - cursor$0;
+ lab0 = true;
+lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ if (! this.r_stem_nominal_verb_suffixes$()) {
+ break lab0;
+ }
+ }
+ this.cursor = this.limit - v_1;
+ if (! this.B_continue_stemming_noun_suffixes) {
+ return false;
+ }
+ lab1 = true;
+lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ if (! this.r_stem_noun_suffixes$()) {
+ break lab1;
+ }
+ }
+ this.cursor = this.limit_backward;
+ return (! this.r_postlude$() ? false : true);
+};
+
+/**
+ * @param {*} o
+ * @return {!boolean}
+ */
+TurkishStemmer.prototype.equals$X = function (o) {
+ return o instanceof TurkishStemmer;
+};
+
+/**
+ * @return {!number}
+ */
+TurkishStemmer.prototype.hashCode$ = function () {
+ /** @type {!string} */
+ var classname;
+ /** @type {!number} */
+ var hash;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var char;
+ classname = "TurkishStemmer";
+ hash = 0;
+ if ("TurkishStemmer".length === 0) {
+ return (hash | 0);
+ }
+ for (i = 0; i < classname.length; i++) {
+ char = classname.charCodeAt(i);
+ hash = (hash << 5) - hash + char;
+ hash = hash & hash;
+ }
+ return (hash | 0);
+};
+
+/**
+ * class SwedishStemmer extends BaseStemmer
+ * @constructor
+ */
+function SwedishStemmer() {
+}
+
+SwedishStemmer.prototype = new BaseStemmer;
+/**
+ * @constructor
+ */
+function SwedishStemmer$() {
+ BaseStemmer$.call(this);
+ this.I_x = 0;
+ this.I_p1 = 0;
+};
+
+SwedishStemmer$.prototype = new SwedishStemmer;
+
+/**
+ * @param {SwedishStemmer} other
+ */
+SwedishStemmer.prototype.copy_from$LSwedishStemmer$ = function (other) {
+ this.I_x = other.I_x;
+ this.I_p1 = other.I_p1;
+ BaseStemmer.prototype.copy_from$LBaseStemmer$.call(this, other);
+};
+
+/**
+ * @return {!boolean}
+ */
+SwedishStemmer.prototype.r_mark_regions$ = function () {
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var c;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!boolean} */
+ var lab3;
+ /** @type {!boolean} */
+ var lab4;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var limit$0;
+ /** @type {!number} */
+ var cursor$1;
+ /** @type {!number} */
+ var cursor$2;
+ this.I_p1 = limit$0 = this.limit;
+ v_1 = cursor$0 = this.cursor;
+ c = (cursor$0 + 3 | 0);
+ if (0 > c || c > limit$0) {
+ return false;
+ }
+ cursor$2 = this.cursor = c;
+ this.I_x = cursor$2;
+ this.cursor = v_1;
+golab0:
+ while (true) {
+ v_2 = this.cursor;
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ if (! this.in_grouping$AIII(SwedishStemmer.g_v, 97, 246)) {
+ break lab1;
+ }
+ this.cursor = v_2;
+ break golab0;
+ }
+ cursor$1 = this.cursor = v_2;
+ if (cursor$1 >= this.limit) {
+ return false;
+ }
+ this.cursor++;
+ }
+golab2:
+ while (true) {
+ lab3 = true;
+ lab3:
+ while (lab3 === true) {
+ lab3 = false;
+ if (! this.out_grouping$AIII(SwedishStemmer.g_v, 97, 246)) {
+ break lab3;
+ }
+ break golab2;
+ }
+ if (this.cursor >= this.limit) {
+ return false;
+ }
+ this.cursor++;
+ }
+ this.I_p1 = this.cursor;
+ lab4 = true;
+lab4:
+ while (lab4 === true) {
+ lab4 = false;
+ if (! (this.I_p1 < this.I_x)) {
+ break lab4;
+ }
+ this.I_p1 = this.I_x;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+SwedishStemmer.prototype.r_main_suffix$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var cursor$1;
+ /** @type {!number} */
+ var cursor$2;
+ v_1 = this.limit - (cursor$0 = this.cursor);
+ if (cursor$0 < this.I_p1) {
+ return false;
+ }
+ cursor$1 = this.cursor = this.I_p1;
+ v_2 = this.limit_backward;
+ this.limit_backward = cursor$1;
+ cursor$2 = this.cursor = this.limit - v_1;
+ this.ket = cursor$2;
+ among_var = this.find_among_b$ALAmong$I(SwedishStemmer.a_0, 37);
+ if (among_var === 0) {
+ this.limit_backward = v_2;
+ return false;
+ }
+ this.bra = this.cursor;
+ this.limit_backward = v_2;
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 2:
+ if (! this.in_grouping_b$AIII(SwedishStemmer.g_s_ending, 98, 121)) {
+ return false;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+SwedishStemmer.prototype.r_consonant_pair$ = function () {
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var v_3;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var cursor$1;
+ /** @type {!number} */
+ var limit$0;
+ /** @type {!number} */
+ var cursor$2;
+ /** @type {!number} */
+ var cursor$3;
+ v_1 = this.limit - (cursor$0 = this.cursor);
+ if (cursor$0 < this.I_p1) {
+ return false;
+ }
+ cursor$1 = this.cursor = this.I_p1;
+ v_2 = this.limit_backward;
+ this.limit_backward = cursor$1;
+ cursor$2 = this.cursor = (limit$0 = this.limit) - v_1;
+ v_3 = limit$0 - cursor$2;
+ if (this.find_among_b$ALAmong$I(SwedishStemmer.a_1, 7) === 0) {
+ this.limit_backward = v_2;
+ return false;
+ }
+ cursor$3 = this.cursor = this.limit - v_3;
+ this.ket = cursor$3;
+ if (cursor$3 <= this.limit_backward) {
+ this.limit_backward = v_2;
+ return false;
+ }
+ this.cursor--;
+ this.bra = this.cursor;
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ this.limit_backward = v_2;
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+SwedishStemmer.prototype.r_other_suffix$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var cursor$1;
+ /** @type {!number} */
+ var cursor$2;
+ v_1 = this.limit - (cursor$0 = this.cursor);
+ if (cursor$0 < this.I_p1) {
+ return false;
+ }
+ cursor$1 = this.cursor = this.I_p1;
+ v_2 = this.limit_backward;
+ this.limit_backward = cursor$1;
+ cursor$2 = this.cursor = this.limit - v_1;
+ this.ket = cursor$2;
+ among_var = this.find_among_b$ALAmong$I(SwedishStemmer.a_2, 5);
+ if (among_var === 0) {
+ this.limit_backward = v_2;
+ return false;
+ }
+ this.bra = this.cursor;
+ switch (among_var) {
+ case 0:
+ this.limit_backward = v_2;
+ return false;
+ case 1:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 2:
+ if (! this.slice_from$S("l\u00F6s")) {
+ return false;
+ }
+ break;
+ case 3:
+ if (! this.slice_from$S("full")) {
+ return false;
+ }
+ break;
+ }
+ this.limit_backward = v_2;
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+SwedishStemmer.prototype.stem$ = function () {
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var v_3;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!boolean} */
+ var lab2;
+ /** @type {!boolean} */
+ var lab3;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var limit$0;
+ /** @type {!number} */
+ var cursor$1;
+ /** @type {!number} */
+ var limit$1;
+ /** @type {!number} */
+ var cursor$2;
+ v_1 = this.cursor;
+ lab0 = true;
+lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ if (! this.r_mark_regions$()) {
+ break lab0;
+ }
+ }
+ cursor$0 = this.cursor = v_1;
+ this.limit_backward = cursor$0;
+ cursor$1 = this.cursor = limit$0 = this.limit;
+ v_2 = limit$0 - cursor$1;
+ lab1 = true;
+lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ if (! this.r_main_suffix$()) {
+ break lab1;
+ }
+ }
+ cursor$2 = this.cursor = (limit$1 = this.limit) - v_2;
+ v_3 = limit$1 - cursor$2;
+ lab2 = true;
+lab2:
+ while (lab2 === true) {
+ lab2 = false;
+ if (! this.r_consonant_pair$()) {
+ break lab2;
+ }
+ }
+ this.cursor = this.limit - v_3;
+ lab3 = true;
+lab3:
+ while (lab3 === true) {
+ lab3 = false;
+ if (! this.r_other_suffix$()) {
+ break lab3;
+ }
+ }
+ this.cursor = this.limit_backward;
+ return true;
+};
+
+/**
+ * @param {*} o
+ * @return {!boolean}
+ */
+SwedishStemmer.prototype.equals$X = function (o) {
+ return o instanceof SwedishStemmer;
+};
+
+/**
+ * @return {!number}
+ */
+SwedishStemmer.prototype.hashCode$ = function () {
+ /** @type {!string} */
+ var classname;
+ /** @type {!number} */
+ var hash;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var char;
+ classname = "SwedishStemmer";
+ hash = 0;
+ if ("SwedishStemmer".length === 0) {
+ return (hash | 0);
+ }
+ for (i = 0; i < classname.length; i++) {
+ char = classname.charCodeAt(i);
+ hash = (hash << 5) - hash + char;
+ hash = hash & hash;
+ }
+ return (hash | 0);
+};
+
+/**
+ * class SpanishStemmer extends BaseStemmer
+ * @constructor
+ */
+function SpanishStemmer() {
+}
+
+SpanishStemmer.prototype = new BaseStemmer;
+/**
+ * @constructor
+ */
+function SpanishStemmer$() {
+ BaseStemmer$.call(this);
+ this.I_p2 = 0;
+ this.I_p1 = 0;
+ this.I_pV = 0;
+};
+
+SpanishStemmer$.prototype = new SpanishStemmer;
+
+/**
+ * @param {SpanishStemmer} other
+ */
+SpanishStemmer.prototype.copy_from$LSpanishStemmer$ = function (other) {
+ this.I_p2 = other.I_p2;
+ this.I_p1 = other.I_p1;
+ this.I_pV = other.I_pV;
+ BaseStemmer.prototype.copy_from$LBaseStemmer$.call(this, other);
+};
+
+/**
+ * @return {!boolean}
+ */
+SpanishStemmer.prototype.r_mark_regions$ = function () {
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var v_3;
+ /** @type {!number} */
+ var v_6;
+ /** @type {!number} */
+ var v_8;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!boolean} */
+ var lab2;
+ /** @type {!boolean} */
+ var lab3;
+ /** @type {!boolean} */
+ var lab4;
+ /** @type {!boolean} */
+ var lab6;
+ /** @type {!boolean} */
+ var lab8;
+ /** @type {!boolean} */
+ var lab9;
+ /** @type {!boolean} */
+ var lab10;
+ /** @type {!boolean} */
+ var lab12;
+ /** @type {!boolean} */
+ var lab13;
+ /** @type {!boolean} */
+ var lab15;
+ /** @type {!boolean} */
+ var lab17;
+ /** @type {!boolean} */
+ var lab19;
+ /** @type {!boolean} */
+ var lab21;
+ /** @type {!number} */
+ var limit$0;
+ /** @type {!number} */
+ var cursor$0;
+ this.I_pV = limit$0 = this.limit;
+ this.I_p1 = limit$0;
+ this.I_p2 = limit$0;
+ v_1 = this.cursor;
+ lab0 = true;
+lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ v_2 = this.cursor;
+ lab2 = true;
+ lab2:
+ while (lab2 === true) {
+ lab2 = false;
+ if (! this.in_grouping$AIII(SpanishStemmer.g_v, 97, 252)) {
+ break lab2;
+ }
+ lab3 = true;
+ lab3:
+ while (lab3 === true) {
+ lab3 = false;
+ v_3 = this.cursor;
+ lab4 = true;
+ lab4:
+ while (lab4 === true) {
+ lab4 = false;
+ if (! this.out_grouping$AIII(SpanishStemmer.g_v, 97, 252)) {
+ break lab4;
+ }
+ golab5:
+ while (true) {
+ lab6 = true;
+ lab6:
+ while (lab6 === true) {
+ lab6 = false;
+ if (! this.in_grouping$AIII(SpanishStemmer.g_v, 97, 252)) {
+ break lab6;
+ }
+ break golab5;
+ }
+ if (this.cursor >= this.limit) {
+ break lab4;
+ }
+ this.cursor++;
+ }
+ break lab3;
+ }
+ this.cursor = v_3;
+ if (! this.in_grouping$AIII(SpanishStemmer.g_v, 97, 252)) {
+ break lab2;
+ }
+ golab7:
+ while (true) {
+ lab8 = true;
+ lab8:
+ while (lab8 === true) {
+ lab8 = false;
+ if (! this.out_grouping$AIII(SpanishStemmer.g_v, 97, 252)) {
+ break lab8;
+ }
+ break golab7;
+ }
+ if (this.cursor >= this.limit) {
+ break lab2;
+ }
+ this.cursor++;
+ }
+ }
+ break lab1;
+ }
+ this.cursor = v_2;
+ if (! this.out_grouping$AIII(SpanishStemmer.g_v, 97, 252)) {
+ break lab0;
+ }
+ lab9 = true;
+ lab9:
+ while (lab9 === true) {
+ lab9 = false;
+ v_6 = this.cursor;
+ lab10 = true;
+ lab10:
+ while (lab10 === true) {
+ lab10 = false;
+ if (! this.out_grouping$AIII(SpanishStemmer.g_v, 97, 252)) {
+ break lab10;
+ }
+ golab11:
+ while (true) {
+ lab12 = true;
+ lab12:
+ while (lab12 === true) {
+ lab12 = false;
+ if (! this.in_grouping$AIII(SpanishStemmer.g_v, 97, 252)) {
+ break lab12;
+ }
+ break golab11;
+ }
+ if (this.cursor >= this.limit) {
+ break lab10;
+ }
+ this.cursor++;
+ }
+ break lab9;
+ }
+ this.cursor = v_6;
+ if (! this.in_grouping$AIII(SpanishStemmer.g_v, 97, 252)) {
+ break lab0;
+ }
+ if (this.cursor >= this.limit) {
+ break lab0;
+ }
+ this.cursor++;
+ }
+ }
+ this.I_pV = this.cursor;
+ }
+ cursor$0 = this.cursor = v_1;
+ v_8 = cursor$0;
+ lab13 = true;
+lab13:
+ while (lab13 === true) {
+ lab13 = false;
+ golab14:
+ while (true) {
+ lab15 = true;
+ lab15:
+ while (lab15 === true) {
+ lab15 = false;
+ if (! this.in_grouping$AIII(SpanishStemmer.g_v, 97, 252)) {
+ break lab15;
+ }
+ break golab14;
+ }
+ if (this.cursor >= this.limit) {
+ break lab13;
+ }
+ this.cursor++;
+ }
+ golab16:
+ while (true) {
+ lab17 = true;
+ lab17:
+ while (lab17 === true) {
+ lab17 = false;
+ if (! this.out_grouping$AIII(SpanishStemmer.g_v, 97, 252)) {
+ break lab17;
+ }
+ break golab16;
+ }
+ if (this.cursor >= this.limit) {
+ break lab13;
+ }
+ this.cursor++;
+ }
+ this.I_p1 = this.cursor;
+ golab18:
+ while (true) {
+ lab19 = true;
+ lab19:
+ while (lab19 === true) {
+ lab19 = false;
+ if (! this.in_grouping$AIII(SpanishStemmer.g_v, 97, 252)) {
+ break lab19;
+ }
+ break golab18;
+ }
+ if (this.cursor >= this.limit) {
+ break lab13;
+ }
+ this.cursor++;
+ }
+ golab20:
+ while (true) {
+ lab21 = true;
+ lab21:
+ while (lab21 === true) {
+ lab21 = false;
+ if (! this.out_grouping$AIII(SpanishStemmer.g_v, 97, 252)) {
+ break lab21;
+ }
+ break golab20;
+ }
+ if (this.cursor >= this.limit) {
+ break lab13;
+ }
+ this.cursor++;
+ }
+ this.I_p2 = this.cursor;
+ }
+ this.cursor = v_8;
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+SpanishStemmer.prototype.r_postlude$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var v_1;
+ /** @type {!boolean} */
+ var lab1;
+replab0:
+ while (true) {
+ v_1 = this.cursor;
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ this.bra = this.cursor;
+ among_var = this.find_among$ALAmong$I(SpanishStemmer.a_0, 6);
+ if (among_var === 0) {
+ break lab1;
+ }
+ this.ket = this.cursor;
+ switch (among_var) {
+ case 0:
+ break lab1;
+ case 1:
+ if (! this.slice_from$S("a")) {
+ return false;
+ }
+ break;
+ case 2:
+ if (! this.slice_from$S("e")) {
+ return false;
+ }
+ break;
+ case 3:
+ if (! this.slice_from$S("i")) {
+ return false;
+ }
+ break;
+ case 4:
+ if (! this.slice_from$S("o")) {
+ return false;
+ }
+ break;
+ case 5:
+ if (! this.slice_from$S("u")) {
+ return false;
+ }
+ break;
+ case 6:
+ if (this.cursor >= this.limit) {
+ break lab1;
+ }
+ this.cursor++;
+ break;
+ }
+ continue replab0;
+ }
+ this.cursor = v_1;
+ break replab0;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+SpanishStemmer.prototype.r_RV$ = function () {
+ return (! (this.I_pV <= this.cursor) ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+SpanishStemmer.prototype.r_R1$ = function () {
+ return (! (this.I_p1 <= this.cursor) ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+SpanishStemmer.prototype.r_R2$ = function () {
+ return (! (this.I_p2 <= this.cursor) ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+SpanishStemmer.prototype.r_attached_pronoun$ = function () {
+ /** @type {!number} */
+ var among_var;
+ this.ket = this.cursor;
+ if (this.find_among_b$ALAmong$I(SpanishStemmer.a_1, 13) === 0) {
+ return false;
+ }
+ this.bra = this.cursor;
+ among_var = this.find_among_b$ALAmong$I(SpanishStemmer.a_2, 11);
+ if (among_var === 0) {
+ return false;
+ }
+ if (! (! (this.I_pV <= this.cursor) ? false : true)) {
+ return false;
+ }
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ this.bra = this.cursor;
+ if (! this.slice_from$S("iendo")) {
+ return false;
+ }
+ break;
+ case 2:
+ this.bra = this.cursor;
+ if (! this.slice_from$S("ando")) {
+ return false;
+ }
+ break;
+ case 3:
+ this.bra = this.cursor;
+ if (! this.slice_from$S("ar")) {
+ return false;
+ }
+ break;
+ case 4:
+ this.bra = this.cursor;
+ if (! this.slice_from$S("er")) {
+ return false;
+ }
+ break;
+ case 5:
+ this.bra = this.cursor;
+ if (! this.slice_from$S("ir")) {
+ return false;
+ }
+ break;
+ case 6:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 7:
+ if (! this.eq_s_b$IS(1, "u")) {
+ return false;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+SpanishStemmer.prototype.r_standard_suffix$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var v_3;
+ /** @type {!number} */
+ var v_4;
+ /** @type {!number} */
+ var v_5;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!boolean} */
+ var lab2;
+ /** @type {!boolean} */
+ var lab3;
+ /** @type {!boolean} */
+ var lab4;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var cursor$1;
+ /** @type {!number} */
+ var cursor$2;
+ /** @type {!number} */
+ var cursor$3;
+ this.ket = this.cursor;
+ among_var = this.find_among_b$ALAmong$I(SpanishStemmer.a_6, 46);
+ if (among_var === 0) {
+ return false;
+ }
+ this.bra = this.cursor;
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ if (! (! (this.I_p2 <= this.cursor) ? false : true)) {
+ return false;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 2:
+ if (! (! (this.I_p2 <= this.cursor) ? false : true)) {
+ return false;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ v_1 = this.limit - this.cursor;
+ lab0 = true;
+ lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ this.ket = this.cursor;
+ if (! this.eq_s_b$IS(2, "ic")) {
+ this.cursor = this.limit - v_1;
+ break lab0;
+ }
+ this.bra = cursor$0 = this.cursor;
+ if (! (! (this.I_p2 <= cursor$0) ? false : true)) {
+ this.cursor = this.limit - v_1;
+ break lab0;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ }
+ break;
+ case 3:
+ if (! (! (this.I_p2 <= this.cursor) ? false : true)) {
+ return false;
+ }
+ if (! this.slice_from$S("log")) {
+ return false;
+ }
+ break;
+ case 4:
+ if (! (! (this.I_p2 <= this.cursor) ? false : true)) {
+ return false;
+ }
+ if (! this.slice_from$S("u")) {
+ return false;
+ }
+ break;
+ case 5:
+ if (! (! (this.I_p2 <= this.cursor) ? false : true)) {
+ return false;
+ }
+ if (! this.slice_from$S("ente")) {
+ return false;
+ }
+ break;
+ case 6:
+ if (! (! (this.I_p1 <= this.cursor) ? false : true)) {
+ return false;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ v_2 = this.limit - this.cursor;
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ this.ket = this.cursor;
+ among_var = this.find_among_b$ALAmong$I(SpanishStemmer.a_3, 4);
+ if (among_var === 0) {
+ this.cursor = this.limit - v_2;
+ break lab1;
+ }
+ this.bra = cursor$1 = this.cursor;
+ if (! (! (this.I_p2 <= cursor$1) ? false : true)) {
+ this.cursor = this.limit - v_2;
+ break lab1;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ switch (among_var) {
+ case 0:
+ this.cursor = this.limit - v_2;
+ break lab1;
+ case 1:
+ this.ket = this.cursor;
+ if (! this.eq_s_b$IS(2, "at")) {
+ this.cursor = this.limit - v_2;
+ break lab1;
+ }
+ this.bra = cursor$2 = this.cursor;
+ if (! (! (this.I_p2 <= cursor$2) ? false : true)) {
+ this.cursor = this.limit - v_2;
+ break lab1;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ }
+ }
+ break;
+ case 7:
+ if (! (! (this.I_p2 <= this.cursor) ? false : true)) {
+ return false;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ v_3 = this.limit - this.cursor;
+ lab2 = true;
+ lab2:
+ while (lab2 === true) {
+ lab2 = false;
+ this.ket = this.cursor;
+ among_var = this.find_among_b$ALAmong$I(SpanishStemmer.a_4, 3);
+ if (among_var === 0) {
+ this.cursor = this.limit - v_3;
+ break lab2;
+ }
+ this.bra = this.cursor;
+ switch (among_var) {
+ case 0:
+ this.cursor = this.limit - v_3;
+ break lab2;
+ case 1:
+ if (! (! (this.I_p2 <= this.cursor) ? false : true)) {
+ this.cursor = this.limit - v_3;
+ break lab2;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ }
+ }
+ break;
+ case 8:
+ if (! (! (this.I_p2 <= this.cursor) ? false : true)) {
+ return false;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ v_4 = this.limit - this.cursor;
+ lab3 = true;
+ lab3:
+ while (lab3 === true) {
+ lab3 = false;
+ this.ket = this.cursor;
+ among_var = this.find_among_b$ALAmong$I(SpanishStemmer.a_5, 3);
+ if (among_var === 0) {
+ this.cursor = this.limit - v_4;
+ break lab3;
+ }
+ this.bra = this.cursor;
+ switch (among_var) {
+ case 0:
+ this.cursor = this.limit - v_4;
+ break lab3;
+ case 1:
+ if (! (! (this.I_p2 <= this.cursor) ? false : true)) {
+ this.cursor = this.limit - v_4;
+ break lab3;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ }
+ }
+ break;
+ case 9:
+ if (! (! (this.I_p2 <= this.cursor) ? false : true)) {
+ return false;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ v_5 = this.limit - this.cursor;
+ lab4 = true;
+ lab4:
+ while (lab4 === true) {
+ lab4 = false;
+ this.ket = this.cursor;
+ if (! this.eq_s_b$IS(2, "at")) {
+ this.cursor = this.limit - v_5;
+ break lab4;
+ }
+ this.bra = cursor$3 = this.cursor;
+ if (! (! (this.I_p2 <= cursor$3) ? false : true)) {
+ this.cursor = this.limit - v_5;
+ break lab4;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ }
+ break;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+SpanishStemmer.prototype.r_y_verb_suffix$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var cursor$1;
+ /** @type {!number} */
+ var cursor$2;
+ v_1 = this.limit - (cursor$0 = this.cursor);
+ if (cursor$0 < this.I_pV) {
+ return false;
+ }
+ cursor$1 = this.cursor = this.I_pV;
+ v_2 = this.limit_backward;
+ this.limit_backward = cursor$1;
+ cursor$2 = this.cursor = this.limit - v_1;
+ this.ket = cursor$2;
+ among_var = this.find_among_b$ALAmong$I(SpanishStemmer.a_7, 12);
+ if (among_var === 0) {
+ this.limit_backward = v_2;
+ return false;
+ }
+ this.bra = this.cursor;
+ this.limit_backward = v_2;
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ if (! this.eq_s_b$IS(1, "u")) {
+ return false;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+SpanishStemmer.prototype.r_verb_suffix$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var v_3;
+ /** @type {!number} */
+ var v_4;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var cursor$1;
+ /** @type {!number} */
+ var cursor$2;
+ v_1 = this.limit - (cursor$0 = this.cursor);
+ if (cursor$0 < this.I_pV) {
+ return false;
+ }
+ cursor$1 = this.cursor = this.I_pV;
+ v_2 = this.limit_backward;
+ this.limit_backward = cursor$1;
+ cursor$2 = this.cursor = this.limit - v_1;
+ this.ket = cursor$2;
+ among_var = this.find_among_b$ALAmong$I(SpanishStemmer.a_8, 96);
+ if (among_var === 0) {
+ this.limit_backward = v_2;
+ return false;
+ }
+ this.bra = this.cursor;
+ this.limit_backward = v_2;
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ v_3 = this.limit - this.cursor;
+ lab0 = true;
+ lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ if (! this.eq_s_b$IS(1, "u")) {
+ this.cursor = this.limit - v_3;
+ break lab0;
+ }
+ v_4 = this.limit - this.cursor;
+ if (! this.eq_s_b$IS(1, "g")) {
+ this.cursor = this.limit - v_3;
+ break lab0;
+ }
+ this.cursor = this.limit - v_4;
+ }
+ this.bra = this.cursor;
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 2:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+SpanishStemmer.prototype.r_residual_suffix$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var cursor$1;
+ this.ket = this.cursor;
+ among_var = this.find_among_b$ALAmong$I(SpanishStemmer.a_9, 8);
+ if (among_var === 0) {
+ return false;
+ }
+ this.bra = this.cursor;
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ if (! (! (this.I_pV <= this.cursor) ? false : true)) {
+ return false;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 2:
+ if (! (! (this.I_pV <= this.cursor) ? false : true)) {
+ return false;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ v_1 = this.limit - this.cursor;
+ lab0 = true;
+ lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ this.ket = this.cursor;
+ if (! this.eq_s_b$IS(1, "u")) {
+ this.cursor = this.limit - v_1;
+ break lab0;
+ }
+ this.bra = cursor$0 = this.cursor;
+ v_2 = this.limit - cursor$0;
+ if (! this.eq_s_b$IS(1, "g")) {
+ this.cursor = this.limit - v_1;
+ break lab0;
+ }
+ cursor$1 = this.cursor = this.limit - v_2;
+ if (! (! (this.I_pV <= cursor$1) ? false : true)) {
+ this.cursor = this.limit - v_1;
+ break lab0;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ }
+ break;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+SpanishStemmer.prototype.stem$ = function () {
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var v_3;
+ /** @type {!number} */
+ var v_4;
+ /** @type {!number} */
+ var v_6;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!boolean} */
+ var lab2;
+ /** @type {!boolean} */
+ var lab3;
+ /** @type {!boolean} */
+ var lab4;
+ /** @type {!boolean} */
+ var lab5;
+ /** @type {!boolean} */
+ var lab6;
+ /** @type {!boolean} */
+ var lab7;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var limit$0;
+ /** @type {!number} */
+ var cursor$1;
+ /** @type {!number} */
+ var limit$1;
+ /** @type {!number} */
+ var cursor$2;
+ /** @type {!number} */
+ var cursor$3;
+ v_1 = this.cursor;
+ lab0 = true;
+lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ if (! this.r_mark_regions$()) {
+ break lab0;
+ }
+ }
+ cursor$0 = this.cursor = v_1;
+ this.limit_backward = cursor$0;
+ cursor$1 = this.cursor = limit$0 = this.limit;
+ v_2 = limit$0 - cursor$1;
+ lab1 = true;
+lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ if (! this.r_attached_pronoun$()) {
+ break lab1;
+ }
+ }
+ cursor$2 = this.cursor = (limit$1 = this.limit) - v_2;
+ v_3 = limit$1 - cursor$2;
+ lab2 = true;
+lab2:
+ while (lab2 === true) {
+ lab2 = false;
+ lab3 = true;
+ lab3:
+ while (lab3 === true) {
+ lab3 = false;
+ v_4 = this.limit - this.cursor;
+ lab4 = true;
+ lab4:
+ while (lab4 === true) {
+ lab4 = false;
+ if (! this.r_standard_suffix$()) {
+ break lab4;
+ }
+ break lab3;
+ }
+ this.cursor = this.limit - v_4;
+ lab5 = true;
+ lab5:
+ while (lab5 === true) {
+ lab5 = false;
+ if (! this.r_y_verb_suffix$()) {
+ break lab5;
+ }
+ break lab3;
+ }
+ this.cursor = this.limit - v_4;
+ if (! this.r_verb_suffix$()) {
+ break lab2;
+ }
+ }
+ }
+ this.cursor = this.limit - v_3;
+ lab6 = true;
+lab6:
+ while (lab6 === true) {
+ lab6 = false;
+ if (! this.r_residual_suffix$()) {
+ break lab6;
+ }
+ }
+ cursor$3 = this.cursor = this.limit_backward;
+ v_6 = cursor$3;
+ lab7 = true;
+lab7:
+ while (lab7 === true) {
+ lab7 = false;
+ if (! this.r_postlude$()) {
+ break lab7;
+ }
+ }
+ this.cursor = v_6;
+ return true;
+};
+
+/**
+ * @param {*} o
+ * @return {!boolean}
+ */
+SpanishStemmer.prototype.equals$X = function (o) {
+ return o instanceof SpanishStemmer;
+};
+
+/**
+ * @return {!number}
+ */
+SpanishStemmer.prototype.hashCode$ = function () {
+ /** @type {!string} */
+ var classname;
+ /** @type {!number} */
+ var hash;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var char;
+ classname = "SpanishStemmer";
+ hash = 0;
+ if ("SpanishStemmer".length === 0) {
+ return (hash | 0);
+ }
+ for (i = 0; i < classname.length; i++) {
+ char = classname.charCodeAt(i);
+ hash = (hash << 5) - hash + char;
+ hash = hash & hash;
+ }
+ return (hash | 0);
+};
+
+/**
+ * class RussianStemmer extends BaseStemmer
+ * @constructor
+ */
+function RussianStemmer() {
+}
+
+RussianStemmer.prototype = new BaseStemmer;
+/**
+ * @constructor
+ */
+function RussianStemmer$() {
+ BaseStemmer$.call(this);
+ this.I_p2 = 0;
+ this.I_pV = 0;
+};
+
+RussianStemmer$.prototype = new RussianStemmer;
+
+/**
+ * @param {RussianStemmer} other
+ */
+RussianStemmer.prototype.copy_from$LRussianStemmer$ = function (other) {
+ this.I_p2 = other.I_p2;
+ this.I_pV = other.I_pV;
+ BaseStemmer.prototype.copy_from$LBaseStemmer$.call(this, other);
+};
+
+/**
+ * @return {!boolean}
+ */
+RussianStemmer.prototype.r_mark_regions$ = function () {
+ /** @type {!number} */
+ var v_1;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!boolean} */
+ var lab2;
+ /** @type {!boolean} */
+ var lab4;
+ /** @type {!boolean} */
+ var lab6;
+ /** @type {!boolean} */
+ var lab8;
+ /** @type {!number} */
+ var limit$0;
+ this.I_pV = limit$0 = this.limit;
+ this.I_p2 = limit$0;
+ v_1 = this.cursor;
+ lab0 = true;
+lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ golab1:
+ while (true) {
+ lab2 = true;
+ lab2:
+ while (lab2 === true) {
+ lab2 = false;
+ if (! this.in_grouping$AIII(RussianStemmer.g_v, 1072, 1103)) {
+ break lab2;
+ }
+ break golab1;
+ }
+ if (this.cursor >= this.limit) {
+ break lab0;
+ }
+ this.cursor++;
+ }
+ this.I_pV = this.cursor;
+ golab3:
+ while (true) {
+ lab4 = true;
+ lab4:
+ while (lab4 === true) {
+ lab4 = false;
+ if (! this.out_grouping$AIII(RussianStemmer.g_v, 1072, 1103)) {
+ break lab4;
+ }
+ break golab3;
+ }
+ if (this.cursor >= this.limit) {
+ break lab0;
+ }
+ this.cursor++;
+ }
+ golab5:
+ while (true) {
+ lab6 = true;
+ lab6:
+ while (lab6 === true) {
+ lab6 = false;
+ if (! this.in_grouping$AIII(RussianStemmer.g_v, 1072, 1103)) {
+ break lab6;
+ }
+ break golab5;
+ }
+ if (this.cursor >= this.limit) {
+ break lab0;
+ }
+ this.cursor++;
+ }
+ golab7:
+ while (true) {
+ lab8 = true;
+ lab8:
+ while (lab8 === true) {
+ lab8 = false;
+ if (! this.out_grouping$AIII(RussianStemmer.g_v, 1072, 1103)) {
+ break lab8;
+ }
+ break golab7;
+ }
+ if (this.cursor >= this.limit) {
+ break lab0;
+ }
+ this.cursor++;
+ }
+ this.I_p2 = this.cursor;
+ }
+ this.cursor = v_1;
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+RussianStemmer.prototype.r_R2$ = function () {
+ return (! (this.I_p2 <= this.cursor) ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+RussianStemmer.prototype.r_perfective_gerund$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var v_1;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!boolean} */
+ var lab1;
+ this.ket = this.cursor;
+ among_var = this.find_among_b$ALAmong$I(RussianStemmer.a_0, 9);
+ if (among_var === 0) {
+ return false;
+ }
+ this.bra = this.cursor;
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ lab0 = true;
+ lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ v_1 = this.limit - this.cursor;
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ if (! this.eq_s_b$IS(1, "\u0430")) {
+ break lab1;
+ }
+ break lab0;
+ }
+ this.cursor = this.limit - v_1;
+ if (! this.eq_s_b$IS(1, "\u044F")) {
+ return false;
+ }
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 2:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+RussianStemmer.prototype.r_adjective$ = function () {
+ /** @type {!number} */
+ var among_var;
+ this.ket = this.cursor;
+ among_var = this.find_among_b$ALAmong$I(RussianStemmer.a_1, 26);
+ if (among_var === 0) {
+ return false;
+ }
+ this.bra = this.cursor;
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+RussianStemmer.prototype.r_adjectival$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!boolean} */
+ var lab2;
+ if (! this.r_adjective$()) {
+ return false;
+ }
+ v_1 = this.limit - this.cursor;
+ lab0 = true;
+lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ this.ket = this.cursor;
+ among_var = this.find_among_b$ALAmong$I(RussianStemmer.a_2, 8);
+ if (among_var === 0) {
+ this.cursor = this.limit - v_1;
+ break lab0;
+ }
+ this.bra = this.cursor;
+ switch (among_var) {
+ case 0:
+ this.cursor = this.limit - v_1;
+ break lab0;
+ case 1:
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ v_2 = this.limit - this.cursor;
+ lab2 = true;
+ lab2:
+ while (lab2 === true) {
+ lab2 = false;
+ if (! this.eq_s_b$IS(1, "\u0430")) {
+ break lab2;
+ }
+ break lab1;
+ }
+ this.cursor = this.limit - v_2;
+ if (! this.eq_s_b$IS(1, "\u044F")) {
+ this.cursor = this.limit - v_1;
+ break lab0;
+ }
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 2:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ }
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+RussianStemmer.prototype.r_reflexive$ = function () {
+ /** @type {!number} */
+ var among_var;
+ this.ket = this.cursor;
+ among_var = this.find_among_b$ALAmong$I(RussianStemmer.a_3, 2);
+ if (among_var === 0) {
+ return false;
+ }
+ this.bra = this.cursor;
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+RussianStemmer.prototype.r_verb$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var v_1;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!boolean} */
+ var lab1;
+ this.ket = this.cursor;
+ among_var = this.find_among_b$ALAmong$I(RussianStemmer.a_4, 46);
+ if (among_var === 0) {
+ return false;
+ }
+ this.bra = this.cursor;
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ lab0 = true;
+ lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ v_1 = this.limit - this.cursor;
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ if (! this.eq_s_b$IS(1, "\u0430")) {
+ break lab1;
+ }
+ break lab0;
+ }
+ this.cursor = this.limit - v_1;
+ if (! this.eq_s_b$IS(1, "\u044F")) {
+ return false;
+ }
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 2:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+RussianStemmer.prototype.r_noun$ = function () {
+ /** @type {!number} */
+ var among_var;
+ this.ket = this.cursor;
+ among_var = this.find_among_b$ALAmong$I(RussianStemmer.a_5, 36);
+ if (among_var === 0) {
+ return false;
+ }
+ this.bra = this.cursor;
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+RussianStemmer.prototype.r_derivational$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var cursor$0;
+ this.ket = this.cursor;
+ among_var = this.find_among_b$ALAmong$I(RussianStemmer.a_6, 2);
+ if (among_var === 0) {
+ return false;
+ }
+ this.bra = cursor$0 = this.cursor;
+ if (! (! (this.I_p2 <= cursor$0) ? false : true)) {
+ return false;
+ }
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+RussianStemmer.prototype.r_tidy_up$ = function () {
+ /** @type {!number} */
+ var among_var;
+ this.ket = this.cursor;
+ among_var = this.find_among_b$ALAmong$I(RussianStemmer.a_7, 4);
+ if (among_var === 0) {
+ return false;
+ }
+ this.bra = this.cursor;
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ this.ket = this.cursor;
+ if (! this.eq_s_b$IS(1, "\u043D")) {
+ return false;
+ }
+ this.bra = this.cursor;
+ if (! this.eq_s_b$IS(1, "\u043D")) {
+ return false;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 2:
+ if (! this.eq_s_b$IS(1, "\u043D")) {
+ return false;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 3:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+RussianStemmer.prototype.stem$ = function () {
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var v_3;
+ /** @type {!number} */
+ var v_4;
+ /** @type {!number} */
+ var v_5;
+ /** @type {!number} */
+ var v_6;
+ /** @type {!number} */
+ var v_7;
+ /** @type {!number} */
+ var v_8;
+ /** @type {!number} */
+ var v_9;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!boolean} */
+ var lab2;
+ /** @type {!boolean} */
+ var lab3;
+ /** @type {!boolean} */
+ var lab4;
+ /** @type {!boolean} */
+ var lab5;
+ /** @type {!boolean} */
+ var lab6;
+ /** @type {!boolean} */
+ var lab7;
+ /** @type {!boolean} */
+ var lab8;
+ /** @type {!boolean} */
+ var lab9;
+ /** @type {!boolean} */
+ var lab10;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var limit$0;
+ /** @type {!number} */
+ var cursor$1;
+ /** @type {!number} */
+ var limit$1;
+ /** @type {!number} */
+ var cursor$2;
+ /** @type {!number} */
+ var cursor$3;
+ /** @type {!number} */
+ var limit$2;
+ /** @type {!number} */
+ var cursor$4;
+ /** @type {!number} */
+ var limit$3;
+ /** @type {!number} */
+ var cursor$5;
+ /** @type {!number} */
+ var limit_backward$0;
+ v_1 = this.cursor;
+ lab0 = true;
+lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ if (! this.r_mark_regions$()) {
+ break lab0;
+ }
+ }
+ cursor$0 = this.cursor = v_1;
+ this.limit_backward = cursor$0;
+ cursor$1 = this.cursor = limit$0 = this.limit;
+ v_2 = limit$0 - cursor$1;
+ if (cursor$1 < this.I_pV) {
+ return false;
+ }
+ cursor$3 = this.cursor = this.I_pV;
+ v_3 = this.limit_backward;
+ this.limit_backward = cursor$3;
+ cursor$4 = this.cursor = (limit$2 = this.limit) - v_2;
+ v_4 = limit$2 - cursor$4;
+ lab1 = true;
+lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ lab2 = true;
+ lab2:
+ while (lab2 === true) {
+ lab2 = false;
+ v_5 = this.limit - this.cursor;
+ lab3 = true;
+ lab3:
+ while (lab3 === true) {
+ lab3 = false;
+ if (! this.r_perfective_gerund$()) {
+ break lab3;
+ }
+ break lab2;
+ }
+ cursor$2 = this.cursor = (limit$1 = this.limit) - v_5;
+ v_6 = limit$1 - cursor$2;
+ lab4 = true;
+ lab4:
+ while (lab4 === true) {
+ lab4 = false;
+ if (! this.r_reflexive$()) {
+ this.cursor = this.limit - v_6;
+ break lab4;
+ }
+ }
+ lab5 = true;
+ lab5:
+ while (lab5 === true) {
+ lab5 = false;
+ v_7 = this.limit - this.cursor;
+ lab6 = true;
+ lab6:
+ while (lab6 === true) {
+ lab6 = false;
+ if (! this.r_adjectival$()) {
+ break lab6;
+ }
+ break lab5;
+ }
+ this.cursor = this.limit - v_7;
+ lab7 = true;
+ lab7:
+ while (lab7 === true) {
+ lab7 = false;
+ if (! this.r_verb$()) {
+ break lab7;
+ }
+ break lab5;
+ }
+ this.cursor = this.limit - v_7;
+ if (! this.r_noun$()) {
+ break lab1;
+ }
+ }
+ }
+ }
+ cursor$5 = this.cursor = (limit$3 = this.limit) - v_4;
+ v_8 = limit$3 - cursor$5;
+ lab8 = true;
+lab8:
+ while (lab8 === true) {
+ lab8 = false;
+ this.ket = this.cursor;
+ if (! this.eq_s_b$IS(1, "\u0438")) {
+ this.cursor = this.limit - v_8;
+ break lab8;
+ }
+ this.bra = this.cursor;
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ }
+ v_9 = this.limit - this.cursor;
+ lab9 = true;
+lab9:
+ while (lab9 === true) {
+ lab9 = false;
+ if (! this.r_derivational$()) {
+ break lab9;
+ }
+ }
+ this.cursor = this.limit - v_9;
+ lab10 = true;
+lab10:
+ while (lab10 === true) {
+ lab10 = false;
+ if (! this.r_tidy_up$()) {
+ break lab10;
+ }
+ }
+ limit_backward$0 = this.limit_backward = v_3;
+ this.cursor = limit_backward$0;
+ return true;
+};
+
+/**
+ * @param {*} o
+ * @return {!boolean}
+ */
+RussianStemmer.prototype.equals$X = function (o) {
+ return o instanceof RussianStemmer;
+};
+
+/**
+ * @return {!number}
+ */
+RussianStemmer.prototype.hashCode$ = function () {
+ /** @type {!string} */
+ var classname;
+ /** @type {!number} */
+ var hash;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var char;
+ classname = "RussianStemmer";
+ hash = 0;
+ if ("RussianStemmer".length === 0) {
+ return (hash | 0);
+ }
+ for (i = 0; i < classname.length; i++) {
+ char = classname.charCodeAt(i);
+ hash = (hash << 5) - hash + char;
+ hash = hash & hash;
+ }
+ return (hash | 0);
+};
+
+/**
+ * class RomanianStemmer extends BaseStemmer
+ * @constructor
+ */
+function RomanianStemmer() {
+}
+
+RomanianStemmer.prototype = new BaseStemmer;
+/**
+ * @constructor
+ */
+function RomanianStemmer$() {
+ BaseStemmer$.call(this);
+ this.B_standard_suffix_removed = false;
+ this.I_p2 = 0;
+ this.I_p1 = 0;
+ this.I_pV = 0;
+};
+
+RomanianStemmer$.prototype = new RomanianStemmer;
+
+/**
+ * @param {RomanianStemmer} other
+ */
+RomanianStemmer.prototype.copy_from$LRomanianStemmer$ = function (other) {
+ this.B_standard_suffix_removed = other.B_standard_suffix_removed;
+ this.I_p2 = other.I_p2;
+ this.I_p1 = other.I_p1;
+ this.I_pV = other.I_pV;
+ BaseStemmer.prototype.copy_from$LBaseStemmer$.call(this, other);
+};
+
+/**
+ * @return {!boolean}
+ */
+RomanianStemmer.prototype.r_prelude$ = function () {
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var v_3;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!boolean} */
+ var lab3;
+ /** @type {!boolean} */
+ var lab4;
+ /** @type {!boolean} */
+ var lab5;
+ /** @type {!number} */
+ var cursor$0;
+replab0:
+ while (true) {
+ v_1 = this.cursor;
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ golab2:
+ while (true) {
+ v_2 = this.cursor;
+ lab3 = true;
+ lab3:
+ while (lab3 === true) {
+ lab3 = false;
+ if (! this.in_grouping$AIII(RomanianStemmer.g_v, 97, 259)) {
+ break lab3;
+ }
+ this.bra = this.cursor;
+ lab4 = true;
+ lab4:
+ while (lab4 === true) {
+ lab4 = false;
+ v_3 = this.cursor;
+ lab5 = true;
+ lab5:
+ while (lab5 === true) {
+ lab5 = false;
+ if (! this.eq_s$IS(1, "u")) {
+ break lab5;
+ }
+ this.ket = this.cursor;
+ if (! this.in_grouping$AIII(RomanianStemmer.g_v, 97, 259)) {
+ break lab5;
+ }
+ if (! this.slice_from$S("U")) {
+ return false;
+ }
+ break lab4;
+ }
+ this.cursor = v_3;
+ if (! this.eq_s$IS(1, "i")) {
+ break lab3;
+ }
+ this.ket = this.cursor;
+ if (! this.in_grouping$AIII(RomanianStemmer.g_v, 97, 259)) {
+ break lab3;
+ }
+ if (! this.slice_from$S("I")) {
+ return false;
+ }
+ }
+ this.cursor = v_2;
+ break golab2;
+ }
+ cursor$0 = this.cursor = v_2;
+ if (cursor$0 >= this.limit) {
+ break lab1;
+ }
+ this.cursor++;
+ }
+ continue replab0;
+ }
+ this.cursor = v_1;
+ break replab0;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+RomanianStemmer.prototype.r_mark_regions$ = function () {
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var v_3;
+ /** @type {!number} */
+ var v_6;
+ /** @type {!number} */
+ var v_8;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!boolean} */
+ var lab2;
+ /** @type {!boolean} */
+ var lab3;
+ /** @type {!boolean} */
+ var lab4;
+ /** @type {!boolean} */
+ var lab6;
+ /** @type {!boolean} */
+ var lab8;
+ /** @type {!boolean} */
+ var lab9;
+ /** @type {!boolean} */
+ var lab10;
+ /** @type {!boolean} */
+ var lab12;
+ /** @type {!boolean} */
+ var lab13;
+ /** @type {!boolean} */
+ var lab15;
+ /** @type {!boolean} */
+ var lab17;
+ /** @type {!boolean} */
+ var lab19;
+ /** @type {!boolean} */
+ var lab21;
+ /** @type {!number} */
+ var limit$0;
+ /** @type {!number} */
+ var cursor$0;
+ this.I_pV = limit$0 = this.limit;
+ this.I_p1 = limit$0;
+ this.I_p2 = limit$0;
+ v_1 = this.cursor;
+ lab0 = true;
+lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ v_2 = this.cursor;
+ lab2 = true;
+ lab2:
+ while (lab2 === true) {
+ lab2 = false;
+ if (! this.in_grouping$AIII(RomanianStemmer.g_v, 97, 259)) {
+ break lab2;
+ }
+ lab3 = true;
+ lab3:
+ while (lab3 === true) {
+ lab3 = false;
+ v_3 = this.cursor;
+ lab4 = true;
+ lab4:
+ while (lab4 === true) {
+ lab4 = false;
+ if (! this.out_grouping$AIII(RomanianStemmer.g_v, 97, 259)) {
+ break lab4;
+ }
+ golab5:
+ while (true) {
+ lab6 = true;
+ lab6:
+ while (lab6 === true) {
+ lab6 = false;
+ if (! this.in_grouping$AIII(RomanianStemmer.g_v, 97, 259)) {
+ break lab6;
+ }
+ break golab5;
+ }
+ if (this.cursor >= this.limit) {
+ break lab4;
+ }
+ this.cursor++;
+ }
+ break lab3;
+ }
+ this.cursor = v_3;
+ if (! this.in_grouping$AIII(RomanianStemmer.g_v, 97, 259)) {
+ break lab2;
+ }
+ golab7:
+ while (true) {
+ lab8 = true;
+ lab8:
+ while (lab8 === true) {
+ lab8 = false;
+ if (! this.out_grouping$AIII(RomanianStemmer.g_v, 97, 259)) {
+ break lab8;
+ }
+ break golab7;
+ }
+ if (this.cursor >= this.limit) {
+ break lab2;
+ }
+ this.cursor++;
+ }
+ }
+ break lab1;
+ }
+ this.cursor = v_2;
+ if (! this.out_grouping$AIII(RomanianStemmer.g_v, 97, 259)) {
+ break lab0;
+ }
+ lab9 = true;
+ lab9:
+ while (lab9 === true) {
+ lab9 = false;
+ v_6 = this.cursor;
+ lab10 = true;
+ lab10:
+ while (lab10 === true) {
+ lab10 = false;
+ if (! this.out_grouping$AIII(RomanianStemmer.g_v, 97, 259)) {
+ break lab10;
+ }
+ golab11:
+ while (true) {
+ lab12 = true;
+ lab12:
+ while (lab12 === true) {
+ lab12 = false;
+ if (! this.in_grouping$AIII(RomanianStemmer.g_v, 97, 259)) {
+ break lab12;
+ }
+ break golab11;
+ }
+ if (this.cursor >= this.limit) {
+ break lab10;
+ }
+ this.cursor++;
+ }
+ break lab9;
+ }
+ this.cursor = v_6;
+ if (! this.in_grouping$AIII(RomanianStemmer.g_v, 97, 259)) {
+ break lab0;
+ }
+ if (this.cursor >= this.limit) {
+ break lab0;
+ }
+ this.cursor++;
+ }
+ }
+ this.I_pV = this.cursor;
+ }
+ cursor$0 = this.cursor = v_1;
+ v_8 = cursor$0;
+ lab13 = true;
+lab13:
+ while (lab13 === true) {
+ lab13 = false;
+ golab14:
+ while (true) {
+ lab15 = true;
+ lab15:
+ while (lab15 === true) {
+ lab15 = false;
+ if (! this.in_grouping$AIII(RomanianStemmer.g_v, 97, 259)) {
+ break lab15;
+ }
+ break golab14;
+ }
+ if (this.cursor >= this.limit) {
+ break lab13;
+ }
+ this.cursor++;
+ }
+ golab16:
+ while (true) {
+ lab17 = true;
+ lab17:
+ while (lab17 === true) {
+ lab17 = false;
+ if (! this.out_grouping$AIII(RomanianStemmer.g_v, 97, 259)) {
+ break lab17;
+ }
+ break golab16;
+ }
+ if (this.cursor >= this.limit) {
+ break lab13;
+ }
+ this.cursor++;
+ }
+ this.I_p1 = this.cursor;
+ golab18:
+ while (true) {
+ lab19 = true;
+ lab19:
+ while (lab19 === true) {
+ lab19 = false;
+ if (! this.in_grouping$AIII(RomanianStemmer.g_v, 97, 259)) {
+ break lab19;
+ }
+ break golab18;
+ }
+ if (this.cursor >= this.limit) {
+ break lab13;
+ }
+ this.cursor++;
+ }
+ golab20:
+ while (true) {
+ lab21 = true;
+ lab21:
+ while (lab21 === true) {
+ lab21 = false;
+ if (! this.out_grouping$AIII(RomanianStemmer.g_v, 97, 259)) {
+ break lab21;
+ }
+ break golab20;
+ }
+ if (this.cursor >= this.limit) {
+ break lab13;
+ }
+ this.cursor++;
+ }
+ this.I_p2 = this.cursor;
+ }
+ this.cursor = v_8;
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+RomanianStemmer.prototype.r_postlude$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var v_1;
+ /** @type {!boolean} */
+ var lab1;
+replab0:
+ while (true) {
+ v_1 = this.cursor;
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ this.bra = this.cursor;
+ among_var = this.find_among$ALAmong$I(RomanianStemmer.a_0, 3);
+ if (among_var === 0) {
+ break lab1;
+ }
+ this.ket = this.cursor;
+ switch (among_var) {
+ case 0:
+ break lab1;
+ case 1:
+ if (! this.slice_from$S("i")) {
+ return false;
+ }
+ break;
+ case 2:
+ if (! this.slice_from$S("u")) {
+ return false;
+ }
+ break;
+ case 3:
+ if (this.cursor >= this.limit) {
+ break lab1;
+ }
+ this.cursor++;
+ break;
+ }
+ continue replab0;
+ }
+ this.cursor = v_1;
+ break replab0;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+RomanianStemmer.prototype.r_RV$ = function () {
+ return (! (this.I_pV <= this.cursor) ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+RomanianStemmer.prototype.r_R1$ = function () {
+ return (! (this.I_p1 <= this.cursor) ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+RomanianStemmer.prototype.r_R2$ = function () {
+ return (! (this.I_p2 <= this.cursor) ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+RomanianStemmer.prototype.r_step_0$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var v_1;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!number} */
+ var cursor$0;
+ this.ket = this.cursor;
+ among_var = this.find_among_b$ALAmong$I(RomanianStemmer.a_1, 16);
+ if (among_var === 0) {
+ return false;
+ }
+ this.bra = cursor$0 = this.cursor;
+ if (! (! (this.I_p1 <= cursor$0) ? false : true)) {
+ return false;
+ }
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 2:
+ if (! this.slice_from$S("a")) {
+ return false;
+ }
+ break;
+ case 3:
+ if (! this.slice_from$S("e")) {
+ return false;
+ }
+ break;
+ case 4:
+ if (! this.slice_from$S("i")) {
+ return false;
+ }
+ break;
+ case 5:
+ v_1 = this.limit - this.cursor;
+ lab0 = true;
+ lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ if (! this.eq_s_b$IS(2, "ab")) {
+ break lab0;
+ }
+ return false;
+ }
+ this.cursor = this.limit - v_1;
+ if (! this.slice_from$S("i")) {
+ return false;
+ }
+ break;
+ case 6:
+ if (! this.slice_from$S("at")) {
+ return false;
+ }
+ break;
+ case 7:
+ if (! this.slice_from$S("a\u0163i")) {
+ return false;
+ }
+ break;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+RomanianStemmer.prototype.r_combo_suffix$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var cursor$1;
+ v_1 = this.limit - (cursor$0 = this.cursor);
+ this.ket = cursor$0;
+ among_var = this.find_among_b$ALAmong$I(RomanianStemmer.a_2, 46);
+ if (among_var === 0) {
+ return false;
+ }
+ this.bra = cursor$1 = this.cursor;
+ if (! (! (this.I_p1 <= cursor$1) ? false : true)) {
+ return false;
+ }
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ if (! this.slice_from$S("abil")) {
+ return false;
+ }
+ break;
+ case 2:
+ if (! this.slice_from$S("ibil")) {
+ return false;
+ }
+ break;
+ case 3:
+ if (! this.slice_from$S("iv")) {
+ return false;
+ }
+ break;
+ case 4:
+ if (! this.slice_from$S("ic")) {
+ return false;
+ }
+ break;
+ case 5:
+ if (! this.slice_from$S("at")) {
+ return false;
+ }
+ break;
+ case 6:
+ if (! this.slice_from$S("it")) {
+ return false;
+ }
+ break;
+ }
+ this.B_standard_suffix_removed = true;
+ this.cursor = this.limit - v_1;
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+RomanianStemmer.prototype.r_standard_suffix$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var v_1;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!number} */
+ var cursor$0;
+ this.B_standard_suffix_removed = false;
+replab0:
+ while (true) {
+ v_1 = this.limit - this.cursor;
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ if (! this.r_combo_suffix$()) {
+ break lab1;
+ }
+ continue replab0;
+ }
+ this.cursor = this.limit - v_1;
+ break replab0;
+ }
+ this.ket = this.cursor;
+ among_var = this.find_among_b$ALAmong$I(RomanianStemmer.a_3, 62);
+ if (among_var === 0) {
+ return false;
+ }
+ this.bra = cursor$0 = this.cursor;
+ if (! (! (this.I_p2 <= cursor$0) ? false : true)) {
+ return false;
+ }
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 2:
+ if (! this.eq_s_b$IS(1, "\u0163")) {
+ return false;
+ }
+ this.bra = this.cursor;
+ if (! this.slice_from$S("t")) {
+ return false;
+ }
+ break;
+ case 3:
+ if (! this.slice_from$S("ist")) {
+ return false;
+ }
+ break;
+ }
+ this.B_standard_suffix_removed = true;
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+RomanianStemmer.prototype.r_verb_suffix$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var v_3;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var cursor$1;
+ /** @type {!number} */
+ var cursor$2;
+ v_1 = this.limit - (cursor$0 = this.cursor);
+ if (cursor$0 < this.I_pV) {
+ return false;
+ }
+ cursor$1 = this.cursor = this.I_pV;
+ v_2 = this.limit_backward;
+ this.limit_backward = cursor$1;
+ cursor$2 = this.cursor = this.limit - v_1;
+ this.ket = cursor$2;
+ among_var = this.find_among_b$ALAmong$I(RomanianStemmer.a_4, 94);
+ if (among_var === 0) {
+ this.limit_backward = v_2;
+ return false;
+ }
+ this.bra = this.cursor;
+ switch (among_var) {
+ case 0:
+ this.limit_backward = v_2;
+ return false;
+ case 1:
+ lab0 = true;
+ lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ v_3 = this.limit - this.cursor;
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ if (! this.out_grouping_b$AIII(RomanianStemmer.g_v, 97, 259)) {
+ break lab1;
+ }
+ break lab0;
+ }
+ this.cursor = this.limit - v_3;
+ if (! this.eq_s_b$IS(1, "u")) {
+ this.limit_backward = v_2;
+ return false;
+ }
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 2:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ }
+ this.limit_backward = v_2;
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+RomanianStemmer.prototype.r_vowel_suffix$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var cursor$0;
+ this.ket = this.cursor;
+ among_var = this.find_among_b$ALAmong$I(RomanianStemmer.a_5, 5);
+ if (among_var === 0) {
+ return false;
+ }
+ this.bra = cursor$0 = this.cursor;
+ if (! (! (this.I_pV <= cursor$0) ? false : true)) {
+ return false;
+ }
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+RomanianStemmer.prototype.stem$ = function () {
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var v_3;
+ /** @type {!number} */
+ var v_4;
+ /** @type {!number} */
+ var v_5;
+ /** @type {!number} */
+ var v_6;
+ /** @type {!number} */
+ var v_8;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!boolean} */
+ var lab2;
+ /** @type {!boolean} */
+ var lab3;
+ /** @type {!boolean} */
+ var lab4;
+ /** @type {!boolean} */
+ var lab5;
+ /** @type {!boolean} */
+ var lab6;
+ /** @type {!boolean} */
+ var lab7;
+ /** @type {!boolean} */
+ var lab8;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var cursor$1;
+ /** @type {!number} */
+ var limit$0;
+ /** @type {!number} */
+ var cursor$2;
+ /** @type {!number} */
+ var limit$1;
+ /** @type {!number} */
+ var cursor$3;
+ /** @type {!number} */
+ var limit$2;
+ /** @type {!number} */
+ var cursor$4;
+ /** @type {!number} */
+ var cursor$5;
+ v_1 = this.cursor;
+ lab0 = true;
+lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ if (! this.r_prelude$()) {
+ break lab0;
+ }
+ }
+ cursor$0 = this.cursor = v_1;
+ v_2 = cursor$0;
+ lab1 = true;
+lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ if (! this.r_mark_regions$()) {
+ break lab1;
+ }
+ }
+ cursor$1 = this.cursor = v_2;
+ this.limit_backward = cursor$1;
+ cursor$2 = this.cursor = limit$0 = this.limit;
+ v_3 = limit$0 - cursor$2;
+ lab2 = true;
+lab2:
+ while (lab2 === true) {
+ lab2 = false;
+ if (! this.r_step_0$()) {
+ break lab2;
+ }
+ }
+ cursor$3 = this.cursor = (limit$1 = this.limit) - v_3;
+ v_4 = limit$1 - cursor$3;
+ lab3 = true;
+lab3:
+ while (lab3 === true) {
+ lab3 = false;
+ if (! this.r_standard_suffix$()) {
+ break lab3;
+ }
+ }
+ cursor$4 = this.cursor = (limit$2 = this.limit) - v_4;
+ v_5 = limit$2 - cursor$4;
+ lab4 = true;
+lab4:
+ while (lab4 === true) {
+ lab4 = false;
+ lab5 = true;
+ lab5:
+ while (lab5 === true) {
+ lab5 = false;
+ v_6 = this.limit - this.cursor;
+ lab6 = true;
+ lab6:
+ while (lab6 === true) {
+ lab6 = false;
+ if (! this.B_standard_suffix_removed) {
+ break lab6;
+ }
+ break lab5;
+ }
+ this.cursor = this.limit - v_6;
+ if (! this.r_verb_suffix$()) {
+ break lab4;
+ }
+ }
+ }
+ this.cursor = this.limit - v_5;
+ lab7 = true;
+lab7:
+ while (lab7 === true) {
+ lab7 = false;
+ if (! this.r_vowel_suffix$()) {
+ break lab7;
+ }
+ }
+ cursor$5 = this.cursor = this.limit_backward;
+ v_8 = cursor$5;
+ lab8 = true;
+lab8:
+ while (lab8 === true) {
+ lab8 = false;
+ if (! this.r_postlude$()) {
+ break lab8;
+ }
+ }
+ this.cursor = v_8;
+ return true;
+};
+
+/**
+ * @param {*} o
+ * @return {!boolean}
+ */
+RomanianStemmer.prototype.equals$X = function (o) {
+ return o instanceof RomanianStemmer;
+};
+
+/**
+ * @return {!number}
+ */
+RomanianStemmer.prototype.hashCode$ = function () {
+ /** @type {!string} */
+ var classname;
+ /** @type {!number} */
+ var hash;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var char;
+ classname = "RomanianStemmer";
+ hash = 0;
+ if ("RomanianStemmer".length === 0) {
+ return (hash | 0);
+ }
+ for (i = 0; i < classname.length; i++) {
+ char = classname.charCodeAt(i);
+ hash = (hash << 5) - hash + char;
+ hash = hash & hash;
+ }
+ return (hash | 0);
+};
+
+/**
+ * class PortugueseStemmer extends BaseStemmer
+ * @constructor
+ */
+function PortugueseStemmer() {
+}
+
+PortugueseStemmer.prototype = new BaseStemmer;
+/**
+ * @constructor
+ */
+function PortugueseStemmer$() {
+ BaseStemmer$.call(this);
+ this.I_p2 = 0;
+ this.I_p1 = 0;
+ this.I_pV = 0;
+};
+
+PortugueseStemmer$.prototype = new PortugueseStemmer;
+
+/**
+ * @param {PortugueseStemmer} other
+ */
+PortugueseStemmer.prototype.copy_from$LPortugueseStemmer$ = function (other) {
+ this.I_p2 = other.I_p2;
+ this.I_p1 = other.I_p1;
+ this.I_pV = other.I_pV;
+ BaseStemmer.prototype.copy_from$LBaseStemmer$.call(this, other);
+};
+
+/**
+ * @return {!boolean}
+ */
+PortugueseStemmer.prototype.r_prelude$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var v_1;
+ /** @type {!boolean} */
+ var lab1;
+replab0:
+ while (true) {
+ v_1 = this.cursor;
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ this.bra = this.cursor;
+ among_var = this.find_among$ALAmong$I(PortugueseStemmer.a_0, 3);
+ if (among_var === 0) {
+ break lab1;
+ }
+ this.ket = this.cursor;
+ switch (among_var) {
+ case 0:
+ break lab1;
+ case 1:
+ if (! this.slice_from$S("a~")) {
+ return false;
+ }
+ break;
+ case 2:
+ if (! this.slice_from$S("o~")) {
+ return false;
+ }
+ break;
+ case 3:
+ if (this.cursor >= this.limit) {
+ break lab1;
+ }
+ this.cursor++;
+ break;
+ }
+ continue replab0;
+ }
+ this.cursor = v_1;
+ break replab0;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+PortugueseStemmer.prototype.r_mark_regions$ = function () {
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var v_3;
+ /** @type {!number} */
+ var v_6;
+ /** @type {!number} */
+ var v_8;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!boolean} */
+ var lab2;
+ /** @type {!boolean} */
+ var lab3;
+ /** @type {!boolean} */
+ var lab4;
+ /** @type {!boolean} */
+ var lab6;
+ /** @type {!boolean} */
+ var lab8;
+ /** @type {!boolean} */
+ var lab9;
+ /** @type {!boolean} */
+ var lab10;
+ /** @type {!boolean} */
+ var lab12;
+ /** @type {!boolean} */
+ var lab13;
+ /** @type {!boolean} */
+ var lab15;
+ /** @type {!boolean} */
+ var lab17;
+ /** @type {!boolean} */
+ var lab19;
+ /** @type {!boolean} */
+ var lab21;
+ /** @type {!number} */
+ var limit$0;
+ /** @type {!number} */
+ var cursor$0;
+ this.I_pV = limit$0 = this.limit;
+ this.I_p1 = limit$0;
+ this.I_p2 = limit$0;
+ v_1 = this.cursor;
+ lab0 = true;
+lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ v_2 = this.cursor;
+ lab2 = true;
+ lab2:
+ while (lab2 === true) {
+ lab2 = false;
+ if (! this.in_grouping$AIII(PortugueseStemmer.g_v, 97, 250)) {
+ break lab2;
+ }
+ lab3 = true;
+ lab3:
+ while (lab3 === true) {
+ lab3 = false;
+ v_3 = this.cursor;
+ lab4 = true;
+ lab4:
+ while (lab4 === true) {
+ lab4 = false;
+ if (! this.out_grouping$AIII(PortugueseStemmer.g_v, 97, 250)) {
+ break lab4;
+ }
+ golab5:
+ while (true) {
+ lab6 = true;
+ lab6:
+ while (lab6 === true) {
+ lab6 = false;
+ if (! this.in_grouping$AIII(PortugueseStemmer.g_v, 97, 250)) {
+ break lab6;
+ }
+ break golab5;
+ }
+ if (this.cursor >= this.limit) {
+ break lab4;
+ }
+ this.cursor++;
+ }
+ break lab3;
+ }
+ this.cursor = v_3;
+ if (! this.in_grouping$AIII(PortugueseStemmer.g_v, 97, 250)) {
+ break lab2;
+ }
+ golab7:
+ while (true) {
+ lab8 = true;
+ lab8:
+ while (lab8 === true) {
+ lab8 = false;
+ if (! this.out_grouping$AIII(PortugueseStemmer.g_v, 97, 250)) {
+ break lab8;
+ }
+ break golab7;
+ }
+ if (this.cursor >= this.limit) {
+ break lab2;
+ }
+ this.cursor++;
+ }
+ }
+ break lab1;
+ }
+ this.cursor = v_2;
+ if (! this.out_grouping$AIII(PortugueseStemmer.g_v, 97, 250)) {
+ break lab0;
+ }
+ lab9 = true;
+ lab9:
+ while (lab9 === true) {
+ lab9 = false;
+ v_6 = this.cursor;
+ lab10 = true;
+ lab10:
+ while (lab10 === true) {
+ lab10 = false;
+ if (! this.out_grouping$AIII(PortugueseStemmer.g_v, 97, 250)) {
+ break lab10;
+ }
+ golab11:
+ while (true) {
+ lab12 = true;
+ lab12:
+ while (lab12 === true) {
+ lab12 = false;
+ if (! this.in_grouping$AIII(PortugueseStemmer.g_v, 97, 250)) {
+ break lab12;
+ }
+ break golab11;
+ }
+ if (this.cursor >= this.limit) {
+ break lab10;
+ }
+ this.cursor++;
+ }
+ break lab9;
+ }
+ this.cursor = v_6;
+ if (! this.in_grouping$AIII(PortugueseStemmer.g_v, 97, 250)) {
+ break lab0;
+ }
+ if (this.cursor >= this.limit) {
+ break lab0;
+ }
+ this.cursor++;
+ }
+ }
+ this.I_pV = this.cursor;
+ }
+ cursor$0 = this.cursor = v_1;
+ v_8 = cursor$0;
+ lab13 = true;
+lab13:
+ while (lab13 === true) {
+ lab13 = false;
+ golab14:
+ while (true) {
+ lab15 = true;
+ lab15:
+ while (lab15 === true) {
+ lab15 = false;
+ if (! this.in_grouping$AIII(PortugueseStemmer.g_v, 97, 250)) {
+ break lab15;
+ }
+ break golab14;
+ }
+ if (this.cursor >= this.limit) {
+ break lab13;
+ }
+ this.cursor++;
+ }
+ golab16:
+ while (true) {
+ lab17 = true;
+ lab17:
+ while (lab17 === true) {
+ lab17 = false;
+ if (! this.out_grouping$AIII(PortugueseStemmer.g_v, 97, 250)) {
+ break lab17;
+ }
+ break golab16;
+ }
+ if (this.cursor >= this.limit) {
+ break lab13;
+ }
+ this.cursor++;
+ }
+ this.I_p1 = this.cursor;
+ golab18:
+ while (true) {
+ lab19 = true;
+ lab19:
+ while (lab19 === true) {
+ lab19 = false;
+ if (! this.in_grouping$AIII(PortugueseStemmer.g_v, 97, 250)) {
+ break lab19;
+ }
+ break golab18;
+ }
+ if (this.cursor >= this.limit) {
+ break lab13;
+ }
+ this.cursor++;
+ }
+ golab20:
+ while (true) {
+ lab21 = true;
+ lab21:
+ while (lab21 === true) {
+ lab21 = false;
+ if (! this.out_grouping$AIII(PortugueseStemmer.g_v, 97, 250)) {
+ break lab21;
+ }
+ break golab20;
+ }
+ if (this.cursor >= this.limit) {
+ break lab13;
+ }
+ this.cursor++;
+ }
+ this.I_p2 = this.cursor;
+ }
+ this.cursor = v_8;
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+PortugueseStemmer.prototype.r_postlude$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var v_1;
+ /** @type {!boolean} */
+ var lab1;
+replab0:
+ while (true) {
+ v_1 = this.cursor;
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ this.bra = this.cursor;
+ among_var = this.find_among$ALAmong$I(PortugueseStemmer.a_1, 3);
+ if (among_var === 0) {
+ break lab1;
+ }
+ this.ket = this.cursor;
+ switch (among_var) {
+ case 0:
+ break lab1;
+ case 1:
+ if (! this.slice_from$S("\u00E3")) {
+ return false;
+ }
+ break;
+ case 2:
+ if (! this.slice_from$S("\u00F5")) {
+ return false;
+ }
+ break;
+ case 3:
+ if (this.cursor >= this.limit) {
+ break lab1;
+ }
+ this.cursor++;
+ break;
+ }
+ continue replab0;
+ }
+ this.cursor = v_1;
+ break replab0;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+PortugueseStemmer.prototype.r_RV$ = function () {
+ return (! (this.I_pV <= this.cursor) ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+PortugueseStemmer.prototype.r_R1$ = function () {
+ return (! (this.I_p1 <= this.cursor) ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+PortugueseStemmer.prototype.r_R2$ = function () {
+ return (! (this.I_p2 <= this.cursor) ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+PortugueseStemmer.prototype.r_standard_suffix$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var v_3;
+ /** @type {!number} */
+ var v_4;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!boolean} */
+ var lab2;
+ /** @type {!boolean} */
+ var lab3;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var cursor$1;
+ /** @type {!number} */
+ var cursor$2;
+ this.ket = this.cursor;
+ among_var = this.find_among_b$ALAmong$I(PortugueseStemmer.a_5, 45);
+ if (among_var === 0) {
+ return false;
+ }
+ this.bra = this.cursor;
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ if (! (! (this.I_p2 <= this.cursor) ? false : true)) {
+ return false;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 2:
+ if (! (! (this.I_p2 <= this.cursor) ? false : true)) {
+ return false;
+ }
+ if (! this.slice_from$S("log")) {
+ return false;
+ }
+ break;
+ case 3:
+ if (! (! (this.I_p2 <= this.cursor) ? false : true)) {
+ return false;
+ }
+ if (! this.slice_from$S("u")) {
+ return false;
+ }
+ break;
+ case 4:
+ if (! (! (this.I_p2 <= this.cursor) ? false : true)) {
+ return false;
+ }
+ if (! this.slice_from$S("ente")) {
+ return false;
+ }
+ break;
+ case 5:
+ if (! (! (this.I_p1 <= this.cursor) ? false : true)) {
+ return false;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ v_1 = this.limit - this.cursor;
+ lab0 = true;
+ lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ this.ket = this.cursor;
+ among_var = this.find_among_b$ALAmong$I(PortugueseStemmer.a_2, 4);
+ if (among_var === 0) {
+ this.cursor = this.limit - v_1;
+ break lab0;
+ }
+ this.bra = cursor$0 = this.cursor;
+ if (! (! (this.I_p2 <= cursor$0) ? false : true)) {
+ this.cursor = this.limit - v_1;
+ break lab0;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ switch (among_var) {
+ case 0:
+ this.cursor = this.limit - v_1;
+ break lab0;
+ case 1:
+ this.ket = this.cursor;
+ if (! this.eq_s_b$IS(2, "at")) {
+ this.cursor = this.limit - v_1;
+ break lab0;
+ }
+ this.bra = cursor$1 = this.cursor;
+ if (! (! (this.I_p2 <= cursor$1) ? false : true)) {
+ this.cursor = this.limit - v_1;
+ break lab0;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ }
+ }
+ break;
+ case 6:
+ if (! (! (this.I_p2 <= this.cursor) ? false : true)) {
+ return false;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ v_2 = this.limit - this.cursor;
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ this.ket = this.cursor;
+ among_var = this.find_among_b$ALAmong$I(PortugueseStemmer.a_3, 3);
+ if (among_var === 0) {
+ this.cursor = this.limit - v_2;
+ break lab1;
+ }
+ this.bra = this.cursor;
+ switch (among_var) {
+ case 0:
+ this.cursor = this.limit - v_2;
+ break lab1;
+ case 1:
+ if (! (! (this.I_p2 <= this.cursor) ? false : true)) {
+ this.cursor = this.limit - v_2;
+ break lab1;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ }
+ }
+ break;
+ case 7:
+ if (! (! (this.I_p2 <= this.cursor) ? false : true)) {
+ return false;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ v_3 = this.limit - this.cursor;
+ lab2 = true;
+ lab2:
+ while (lab2 === true) {
+ lab2 = false;
+ this.ket = this.cursor;
+ among_var = this.find_among_b$ALAmong$I(PortugueseStemmer.a_4, 3);
+ if (among_var === 0) {
+ this.cursor = this.limit - v_3;
+ break lab2;
+ }
+ this.bra = this.cursor;
+ switch (among_var) {
+ case 0:
+ this.cursor = this.limit - v_3;
+ break lab2;
+ case 1:
+ if (! (! (this.I_p2 <= this.cursor) ? false : true)) {
+ this.cursor = this.limit - v_3;
+ break lab2;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ }
+ }
+ break;
+ case 8:
+ if (! (! (this.I_p2 <= this.cursor) ? false : true)) {
+ return false;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ v_4 = this.limit - this.cursor;
+ lab3 = true;
+ lab3:
+ while (lab3 === true) {
+ lab3 = false;
+ this.ket = this.cursor;
+ if (! this.eq_s_b$IS(2, "at")) {
+ this.cursor = this.limit - v_4;
+ break lab3;
+ }
+ this.bra = cursor$2 = this.cursor;
+ if (! (! (this.I_p2 <= cursor$2) ? false : true)) {
+ this.cursor = this.limit - v_4;
+ break lab3;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ }
+ break;
+ case 9:
+ if (! (! (this.I_pV <= this.cursor) ? false : true)) {
+ return false;
+ }
+ if (! this.eq_s_b$IS(1, "e")) {
+ return false;
+ }
+ if (! this.slice_from$S("ir")) {
+ return false;
+ }
+ break;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+PortugueseStemmer.prototype.r_verb_suffix$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var cursor$1;
+ /** @type {!number} */
+ var cursor$2;
+ v_1 = this.limit - (cursor$0 = this.cursor);
+ if (cursor$0 < this.I_pV) {
+ return false;
+ }
+ cursor$1 = this.cursor = this.I_pV;
+ v_2 = this.limit_backward;
+ this.limit_backward = cursor$1;
+ cursor$2 = this.cursor = this.limit - v_1;
+ this.ket = cursor$2;
+ among_var = this.find_among_b$ALAmong$I(PortugueseStemmer.a_6, 120);
+ if (among_var === 0) {
+ this.limit_backward = v_2;
+ return false;
+ }
+ this.bra = this.cursor;
+ switch (among_var) {
+ case 0:
+ this.limit_backward = v_2;
+ return false;
+ case 1:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ }
+ this.limit_backward = v_2;
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+PortugueseStemmer.prototype.r_residual_suffix$ = function () {
+ /** @type {!number} */
+ var among_var;
+ this.ket = this.cursor;
+ among_var = this.find_among_b$ALAmong$I(PortugueseStemmer.a_7, 7);
+ if (among_var === 0) {
+ return false;
+ }
+ this.bra = this.cursor;
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ if (! (! (this.I_pV <= this.cursor) ? false : true)) {
+ return false;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+PortugueseStemmer.prototype.r_residual_form$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var v_3;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var cursor$1;
+ this.ket = this.cursor;
+ among_var = this.find_among_b$ALAmong$I(PortugueseStemmer.a_8, 4);
+ if (among_var === 0) {
+ return false;
+ }
+ this.bra = this.cursor;
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ if (! (! (this.I_pV <= this.cursor) ? false : true)) {
+ return false;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ this.ket = this.cursor;
+ lab0 = true;
+ lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ v_1 = this.limit - this.cursor;
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ if (! this.eq_s_b$IS(1, "u")) {
+ break lab1;
+ }
+ this.bra = cursor$0 = this.cursor;
+ v_2 = this.limit - cursor$0;
+ if (! this.eq_s_b$IS(1, "g")) {
+ break lab1;
+ }
+ this.cursor = this.limit - v_2;
+ break lab0;
+ }
+ this.cursor = this.limit - v_1;
+ if (! this.eq_s_b$IS(1, "i")) {
+ return false;
+ }
+ this.bra = cursor$1 = this.cursor;
+ v_3 = this.limit - cursor$1;
+ if (! this.eq_s_b$IS(1, "c")) {
+ return false;
+ }
+ this.cursor = this.limit - v_3;
+ }
+ if (! (! (this.I_pV <= this.cursor) ? false : true)) {
+ return false;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 2:
+ if (! this.slice_from$S("c")) {
+ return false;
+ }
+ break;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+PortugueseStemmer.prototype.stem$ = function () {
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var v_3;
+ /** @type {!number} */
+ var v_4;
+ /** @type {!number} */
+ var v_5;
+ /** @type {!number} */
+ var v_6;
+ /** @type {!number} */
+ var v_7;
+ /** @type {!number} */
+ var v_8;
+ /** @type {!number} */
+ var v_10;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!boolean} */
+ var lab2;
+ /** @type {!boolean} */
+ var lab3;
+ /** @type {!boolean} */
+ var lab4;
+ /** @type {!boolean} */
+ var lab5;
+ /** @type {!boolean} */
+ var lab6;
+ /** @type {!boolean} */
+ var lab7;
+ /** @type {!boolean} */
+ var lab8;
+ /** @type {!boolean} */
+ var lab9;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var cursor$1;
+ /** @type {!number} */
+ var cursor$2;
+ /** @type {!number} */
+ var limit$0;
+ /** @type {!number} */
+ var cursor$3;
+ /** @type {!number} */
+ var cursor$4;
+ /** @type {!number} */
+ var limit$1;
+ /** @type {!number} */
+ var cursor$5;
+ /** @type {!number} */
+ var cursor$6;
+ v_1 = this.cursor;
+ lab0 = true;
+lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ if (! this.r_prelude$()) {
+ break lab0;
+ }
+ }
+ cursor$0 = this.cursor = v_1;
+ v_2 = cursor$0;
+ lab1 = true;
+lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ if (! this.r_mark_regions$()) {
+ break lab1;
+ }
+ }
+ cursor$4 = this.cursor = v_2;
+ this.limit_backward = cursor$4;
+ cursor$5 = this.cursor = limit$1 = this.limit;
+ v_3 = limit$1 - cursor$5;
+ lab2 = true;
+lab2:
+ while (lab2 === true) {
+ lab2 = false;
+ lab3 = true;
+ lab3:
+ while (lab3 === true) {
+ lab3 = false;
+ v_4 = this.limit - this.cursor;
+ lab4 = true;
+ lab4:
+ while (lab4 === true) {
+ lab4 = false;
+ v_5 = this.limit - this.cursor;
+ lab5 = true;
+ lab5:
+ while (lab5 === true) {
+ lab5 = false;
+ v_6 = this.limit - this.cursor;
+ lab6 = true;
+ lab6:
+ while (lab6 === true) {
+ lab6 = false;
+ if (! this.r_standard_suffix$()) {
+ break lab6;
+ }
+ break lab5;
+ }
+ this.cursor = this.limit - v_6;
+ if (! this.r_verb_suffix$()) {
+ break lab4;
+ }
+ }
+ cursor$3 = this.cursor = (limit$0 = this.limit) - v_5;
+ v_7 = limit$0 - cursor$3;
+ lab7 = true;
+ lab7:
+ while (lab7 === true) {
+ lab7 = false;
+ this.ket = this.cursor;
+ if (! this.eq_s_b$IS(1, "i")) {
+ break lab7;
+ }
+ this.bra = cursor$1 = this.cursor;
+ v_8 = this.limit - cursor$1;
+ if (! this.eq_s_b$IS(1, "c")) {
+ break lab7;
+ }
+ cursor$2 = this.cursor = this.limit - v_8;
+ if (! (! (this.I_pV <= cursor$2) ? false : true)) {
+ break lab7;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ }
+ this.cursor = this.limit - v_7;
+ break lab3;
+ }
+ this.cursor = this.limit - v_4;
+ if (! this.r_residual_suffix$()) {
+ break lab2;
+ }
+ }
+ }
+ this.cursor = this.limit - v_3;
+ lab8 = true;
+lab8:
+ while (lab8 === true) {
+ lab8 = false;
+ if (! this.r_residual_form$()) {
+ break lab8;
+ }
+ }
+ cursor$6 = this.cursor = this.limit_backward;
+ v_10 = cursor$6;
+ lab9 = true;
+lab9:
+ while (lab9 === true) {
+ lab9 = false;
+ if (! this.r_postlude$()) {
+ break lab9;
+ }
+ }
+ this.cursor = v_10;
+ return true;
+};
+
+/**
+ * @param {*} o
+ * @return {!boolean}
+ */
+PortugueseStemmer.prototype.equals$X = function (o) {
+ return o instanceof PortugueseStemmer;
+};
+
+/**
+ * @return {!number}
+ */
+PortugueseStemmer.prototype.hashCode$ = function () {
+ /** @type {!string} */
+ var classname;
+ /** @type {!number} */
+ var hash;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var char;
+ classname = "PortugueseStemmer";
+ hash = 0;
+ if ("PortugueseStemmer".length === 0) {
+ return (hash | 0);
+ }
+ for (i = 0; i < classname.length; i++) {
+ char = classname.charCodeAt(i);
+ hash = (hash << 5) - hash + char;
+ hash = hash & hash;
+ }
+ return (hash | 0);
+};
+
+/**
+ * class PorterStemmer extends BaseStemmer
+ * @constructor
+ */
+function PorterStemmer() {
+}
+
+PorterStemmer.prototype = new BaseStemmer;
+/**
+ * @constructor
+ */
+function PorterStemmer$() {
+ BaseStemmer$.call(this);
+ this.B_Y_found = false;
+ this.I_p2 = 0;
+ this.I_p1 = 0;
+};
+
+PorterStemmer$.prototype = new PorterStemmer;
+
+/**
+ * @param {PorterStemmer} other
+ */
+PorterStemmer.prototype.copy_from$LPorterStemmer$ = function (other) {
+ this.B_Y_found = other.B_Y_found;
+ this.I_p2 = other.I_p2;
+ this.I_p1 = other.I_p1;
+ BaseStemmer.prototype.copy_from$LBaseStemmer$.call(this, other);
+};
+
+/**
+ * @return {!boolean}
+ */
+PorterStemmer.prototype.r_shortv$ = function () {
+ return (! this.out_grouping_b$AIII(PorterStemmer.g_v_WXY, 89, 121) ? false : ! this.in_grouping_b$AIII(PorterStemmer.g_v, 97, 121) ? false : ! this.out_grouping_b$AIII(PorterStemmer.g_v, 97, 121) ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+PorterStemmer.prototype.r_R1$ = function () {
+ return (! (this.I_p1 <= this.cursor) ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+PorterStemmer.prototype.r_R2$ = function () {
+ return (! (this.I_p2 <= this.cursor) ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+PorterStemmer.prototype.r_Step_1a$ = function () {
+ /** @type {!number} */
+ var among_var;
+ this.ket = this.cursor;
+ among_var = this.find_among_b$ALAmong$I(PorterStemmer.a_0, 4);
+ if (among_var === 0) {
+ return false;
+ }
+ this.bra = this.cursor;
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ if (! this.slice_from$S("ss")) {
+ return false;
+ }
+ break;
+ case 2:
+ if (! this.slice_from$S("i")) {
+ return false;
+ }
+ break;
+ case 3:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+PorterStemmer.prototype.r_Step_1b$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_3;
+ /** @type {!number} */
+ var v_4;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!number} */
+ var c;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var cursor$1;
+ /** @type {!number} */
+ var cursor$2;
+ this.ket = this.cursor;
+ among_var = this.find_among_b$ALAmong$I(PorterStemmer.a_2, 3);
+ if (among_var === 0) {
+ return false;
+ }
+ this.bra = this.cursor;
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ if (! (! (this.I_p1 <= this.cursor) ? false : true)) {
+ return false;
+ }
+ if (! this.slice_from$S("ee")) {
+ return false;
+ }
+ break;
+ case 2:
+ v_1 = this.limit - this.cursor;
+ golab0:
+ while (true) {
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ if (! this.in_grouping_b$AIII(PorterStemmer.g_v, 97, 121)) {
+ break lab1;
+ }
+ break golab0;
+ }
+ if (this.cursor <= this.limit_backward) {
+ return false;
+ }
+ this.cursor--;
+ }
+ this.cursor = this.limit - v_1;
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ v_3 = this.limit - this.cursor;
+ among_var = this.find_among_b$ALAmong$I(PorterStemmer.a_1, 13);
+ if (among_var === 0) {
+ return false;
+ }
+ this.cursor = this.limit - v_3;
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ c = cursor$0 = this.cursor;
+ this.insert$IIS(cursor$0, cursor$0, "e");
+ this.cursor = c;
+ break;
+ case 2:
+ this.ket = cursor$1 = this.cursor;
+ if (cursor$1 <= this.limit_backward) {
+ return false;
+ }
+ this.cursor--;
+ this.bra = this.cursor;
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 3:
+ if (this.cursor !== this.I_p1) {
+ return false;
+ }
+ v_4 = this.limit - this.cursor;
+ if (! this.r_shortv$()) {
+ return false;
+ }
+ cursor$2 = this.cursor = this.limit - v_4;
+ c = cursor$2;
+ this.insert$IIS(cursor$2, cursor$2, "e");
+ this.cursor = cursor$2;
+ break;
+ }
+ break;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+PorterStemmer.prototype.r_Step_1c$ = function () {
+ /** @type {!number} */
+ var v_1;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!boolean} */
+ var lab3;
+ this.ket = this.cursor;
+ lab0 = true;
+lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ v_1 = this.limit - this.cursor;
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ if (! this.eq_s_b$IS(1, "y")) {
+ break lab1;
+ }
+ break lab0;
+ }
+ this.cursor = this.limit - v_1;
+ if (! this.eq_s_b$IS(1, "Y")) {
+ return false;
+ }
+ }
+ this.bra = this.cursor;
+golab2:
+ while (true) {
+ lab3 = true;
+ lab3:
+ while (lab3 === true) {
+ lab3 = false;
+ if (! this.in_grouping_b$AIII(PorterStemmer.g_v, 97, 121)) {
+ break lab3;
+ }
+ break golab2;
+ }
+ if (this.cursor <= this.limit_backward) {
+ return false;
+ }
+ this.cursor--;
+ }
+ return (! this.slice_from$S("i") ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+PorterStemmer.prototype.r_Step_2$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var cursor$0;
+ this.ket = this.cursor;
+ among_var = this.find_among_b$ALAmong$I(PorterStemmer.a_3, 20);
+ if (among_var === 0) {
+ return false;
+ }
+ this.bra = cursor$0 = this.cursor;
+ if (! (! (this.I_p1 <= cursor$0) ? false : true)) {
+ return false;
+ }
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ if (! this.slice_from$S("tion")) {
+ return false;
+ }
+ break;
+ case 2:
+ if (! this.slice_from$S("ence")) {
+ return false;
+ }
+ break;
+ case 3:
+ if (! this.slice_from$S("ance")) {
+ return false;
+ }
+ break;
+ case 4:
+ if (! this.slice_from$S("able")) {
+ return false;
+ }
+ break;
+ case 5:
+ if (! this.slice_from$S("ent")) {
+ return false;
+ }
+ break;
+ case 6:
+ if (! this.slice_from$S("e")) {
+ return false;
+ }
+ break;
+ case 7:
+ if (! this.slice_from$S("ize")) {
+ return false;
+ }
+ break;
+ case 8:
+ if (! this.slice_from$S("ate")) {
+ return false;
+ }
+ break;
+ case 9:
+ if (! this.slice_from$S("al")) {
+ return false;
+ }
+ break;
+ case 10:
+ if (! this.slice_from$S("al")) {
+ return false;
+ }
+ break;
+ case 11:
+ if (! this.slice_from$S("ful")) {
+ return false;
+ }
+ break;
+ case 12:
+ if (! this.slice_from$S("ous")) {
+ return false;
+ }
+ break;
+ case 13:
+ if (! this.slice_from$S("ive")) {
+ return false;
+ }
+ break;
+ case 14:
+ if (! this.slice_from$S("ble")) {
+ return false;
+ }
+ break;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+PorterStemmer.prototype.r_Step_3$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var cursor$0;
+ this.ket = this.cursor;
+ among_var = this.find_among_b$ALAmong$I(PorterStemmer.a_4, 7);
+ if (among_var === 0) {
+ return false;
+ }
+ this.bra = cursor$0 = this.cursor;
+ if (! (! (this.I_p1 <= cursor$0) ? false : true)) {
+ return false;
+ }
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ if (! this.slice_from$S("al")) {
+ return false;
+ }
+ break;
+ case 2:
+ if (! this.slice_from$S("ic")) {
+ return false;
+ }
+ break;
+ case 3:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+PorterStemmer.prototype.r_Step_4$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var v_1;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!number} */
+ var cursor$0;
+ this.ket = this.cursor;
+ among_var = this.find_among_b$ALAmong$I(PorterStemmer.a_5, 19);
+ if (among_var === 0) {
+ return false;
+ }
+ this.bra = cursor$0 = this.cursor;
+ if (! (! (this.I_p2 <= cursor$0) ? false : true)) {
+ return false;
+ }
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 2:
+ lab0 = true;
+ lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ v_1 = this.limit - this.cursor;
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ if (! this.eq_s_b$IS(1, "s")) {
+ break lab1;
+ }
+ break lab0;
+ }
+ this.cursor = this.limit - v_1;
+ if (! this.eq_s_b$IS(1, "t")) {
+ return false;
+ }
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+PorterStemmer.prototype.r_Step_5a$ = function () {
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!boolean} */
+ var lab2;
+ /** @type {!number} */
+ var cursor$0;
+ this.ket = this.cursor;
+ if (! this.eq_s_b$IS(1, "e")) {
+ return false;
+ }
+ this.bra = this.cursor;
+ lab0 = true;
+lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ v_1 = this.limit - this.cursor;
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ if (! (! (this.I_p2 <= this.cursor) ? false : true)) {
+ break lab1;
+ }
+ break lab0;
+ }
+ cursor$0 = this.cursor = this.limit - v_1;
+ if (! (! (this.I_p1 <= cursor$0) ? false : true)) {
+ return false;
+ }
+ v_2 = this.limit - this.cursor;
+ lab2 = true;
+ lab2:
+ while (lab2 === true) {
+ lab2 = false;
+ if (! this.r_shortv$()) {
+ break lab2;
+ }
+ return false;
+ }
+ this.cursor = this.limit - v_2;
+ }
+ return (! this.slice_from$S("") ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+PorterStemmer.prototype.r_Step_5b$ = function () {
+ /** @type {!number} */
+ var cursor$0;
+ this.ket = this.cursor;
+ if (! this.eq_s_b$IS(1, "l")) {
+ return false;
+ }
+ this.bra = cursor$0 = this.cursor;
+ return (! (! (this.I_p2 <= cursor$0) ? false : true) ? false : ! this.eq_s_b$IS(1, "l") ? false : ! this.slice_from$S("") ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+PorterStemmer.prototype.stem$ = function () {
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var v_3;
+ /** @type {!number} */
+ var v_4;
+ /** @type {!number} */
+ var v_5;
+ /** @type {!number} */
+ var v_10;
+ /** @type {!number} */
+ var v_11;
+ /** @type {!number} */
+ var v_12;
+ /** @type {!number} */
+ var v_13;
+ /** @type {!number} */
+ var v_14;
+ /** @type {!number} */
+ var v_15;
+ /** @type {!number} */
+ var v_16;
+ /** @type {!number} */
+ var v_18;
+ /** @type {!number} */
+ var v_19;
+ /** @type {!number} */
+ var v_20;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!boolean} */
+ var lab3;
+ /** @type {!boolean} */
+ var lab5;
+ /** @type {!boolean} */
+ var lab6;
+ /** @type {!boolean} */
+ var lab8;
+ /** @type {!boolean} */
+ var lab10;
+ /** @type {!boolean} */
+ var lab12;
+ /** @type {!boolean} */
+ var lab14;
+ /** @type {!boolean} */
+ var lab15;
+ /** @type {!boolean} */
+ var lab16;
+ /** @type {!boolean} */
+ var lab17;
+ /** @type {!boolean} */
+ var lab18;
+ /** @type {!boolean} */
+ var lab19;
+ /** @type {!boolean} */
+ var lab20;
+ /** @type {!boolean} */
+ var lab21;
+ /** @type {!boolean} */
+ var lab22;
+ /** @type {!boolean} */
+ var lab23;
+ /** @type {!boolean} */
+ var lab25;
+ /** @type {!boolean} */
+ var lab27;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var cursor$1;
+ /** @type {!number} */
+ var limit$0;
+ /** @type {!number} */
+ var cursor$2;
+ /** @type {!number} */
+ var cursor$3;
+ /** @type {!number} */
+ var limit$1;
+ /** @type {!number} */
+ var cursor$4;
+ /** @type {!number} */
+ var limit$2;
+ /** @type {!number} */
+ var cursor$5;
+ /** @type {!number} */
+ var limit$3;
+ /** @type {!number} */
+ var cursor$6;
+ /** @type {!number} */
+ var limit$4;
+ /** @type {!number} */
+ var cursor$7;
+ /** @type {!number} */
+ var limit$5;
+ /** @type {!number} */
+ var cursor$8;
+ /** @type {!number} */
+ var limit$6;
+ /** @type {!number} */
+ var cursor$9;
+ /** @type {!number} */
+ var limit$7;
+ /** @type {!number} */
+ var cursor$10;
+ /** @type {!number} */
+ var cursor$11;
+ /** @type {!number} */
+ var cursor$12;
+ this.B_Y_found = false;
+ v_1 = this.cursor;
+ lab0 = true;
+lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ this.bra = this.cursor;
+ if (! this.eq_s$IS(1, "y")) {
+ break lab0;
+ }
+ this.ket = this.cursor;
+ if (! this.slice_from$S("Y")) {
+ return false;
+ }
+ this.B_Y_found = true;
+ }
+ cursor$1 = this.cursor = v_1;
+ v_2 = cursor$1;
+ lab1 = true;
+lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ replab2:
+ while (true) {
+ v_3 = this.cursor;
+ lab3 = true;
+ lab3:
+ while (lab3 === true) {
+ lab3 = false;
+ golab4:
+ while (true) {
+ v_4 = this.cursor;
+ lab5 = true;
+ lab5:
+ while (lab5 === true) {
+ lab5 = false;
+ if (! this.in_grouping$AIII(PorterStemmer.g_v, 97, 121)) {
+ break lab5;
+ }
+ this.bra = this.cursor;
+ if (! this.eq_s$IS(1, "y")) {
+ break lab5;
+ }
+ this.ket = this.cursor;
+ this.cursor = v_4;
+ break golab4;
+ }
+ cursor$0 = this.cursor = v_4;
+ if (cursor$0 >= this.limit) {
+ break lab3;
+ }
+ this.cursor++;
+ }
+ if (! this.slice_from$S("Y")) {
+ return false;
+ }
+ this.B_Y_found = true;
+ continue replab2;
+ }
+ this.cursor = v_3;
+ break replab2;
+ }
+ }
+ cursor$2 = this.cursor = v_2;
+ this.I_p1 = limit$0 = this.limit;
+ this.I_p2 = limit$0;
+ v_5 = cursor$2;
+ lab6 = true;
+lab6:
+ while (lab6 === true) {
+ lab6 = false;
+ golab7:
+ while (true) {
+ lab8 = true;
+ lab8:
+ while (lab8 === true) {
+ lab8 = false;
+ if (! this.in_grouping$AIII(PorterStemmer.g_v, 97, 121)) {
+ break lab8;
+ }
+ break golab7;
+ }
+ if (this.cursor >= this.limit) {
+ break lab6;
+ }
+ this.cursor++;
+ }
+ golab9:
+ while (true) {
+ lab10 = true;
+ lab10:
+ while (lab10 === true) {
+ lab10 = false;
+ if (! this.out_grouping$AIII(PorterStemmer.g_v, 97, 121)) {
+ break lab10;
+ }
+ break golab9;
+ }
+ if (this.cursor >= this.limit) {
+ break lab6;
+ }
+ this.cursor++;
+ }
+ this.I_p1 = this.cursor;
+ golab11:
+ while (true) {
+ lab12 = true;
+ lab12:
+ while (lab12 === true) {
+ lab12 = false;
+ if (! this.in_grouping$AIII(PorterStemmer.g_v, 97, 121)) {
+ break lab12;
+ }
+ break golab11;
+ }
+ if (this.cursor >= this.limit) {
+ break lab6;
+ }
+ this.cursor++;
+ }
+ golab13:
+ while (true) {
+ lab14 = true;
+ lab14:
+ while (lab14 === true) {
+ lab14 = false;
+ if (! this.out_grouping$AIII(PorterStemmer.g_v, 97, 121)) {
+ break lab14;
+ }
+ break golab13;
+ }
+ if (this.cursor >= this.limit) {
+ break lab6;
+ }
+ this.cursor++;
+ }
+ this.I_p2 = this.cursor;
+ }
+ cursor$3 = this.cursor = v_5;
+ this.limit_backward = cursor$3;
+ cursor$4 = this.cursor = limit$1 = this.limit;
+ v_10 = limit$1 - cursor$4;
+ lab15 = true;
+lab15:
+ while (lab15 === true) {
+ lab15 = false;
+ if (! this.r_Step_1a$()) {
+ break lab15;
+ }
+ }
+ cursor$5 = this.cursor = (limit$2 = this.limit) - v_10;
+ v_11 = limit$2 - cursor$5;
+ lab16 = true;
+lab16:
+ while (lab16 === true) {
+ lab16 = false;
+ if (! this.r_Step_1b$()) {
+ break lab16;
+ }
+ }
+ cursor$6 = this.cursor = (limit$3 = this.limit) - v_11;
+ v_12 = limit$3 - cursor$6;
+ lab17 = true;
+lab17:
+ while (lab17 === true) {
+ lab17 = false;
+ if (! this.r_Step_1c$()) {
+ break lab17;
+ }
+ }
+ cursor$7 = this.cursor = (limit$4 = this.limit) - v_12;
+ v_13 = limit$4 - cursor$7;
+ lab18 = true;
+lab18:
+ while (lab18 === true) {
+ lab18 = false;
+ if (! this.r_Step_2$()) {
+ break lab18;
+ }
+ }
+ cursor$8 = this.cursor = (limit$5 = this.limit) - v_13;
+ v_14 = limit$5 - cursor$8;
+ lab19 = true;
+lab19:
+ while (lab19 === true) {
+ lab19 = false;
+ if (! this.r_Step_3$()) {
+ break lab19;
+ }
+ }
+ cursor$9 = this.cursor = (limit$6 = this.limit) - v_14;
+ v_15 = limit$6 - cursor$9;
+ lab20 = true;
+lab20:
+ while (lab20 === true) {
+ lab20 = false;
+ if (! this.r_Step_4$()) {
+ break lab20;
+ }
+ }
+ cursor$10 = this.cursor = (limit$7 = this.limit) - v_15;
+ v_16 = limit$7 - cursor$10;
+ lab21 = true;
+lab21:
+ while (lab21 === true) {
+ lab21 = false;
+ if (! this.r_Step_5a$()) {
+ break lab21;
+ }
+ }
+ this.cursor = this.limit - v_16;
+ lab22 = true;
+lab22:
+ while (lab22 === true) {
+ lab22 = false;
+ if (! this.r_Step_5b$()) {
+ break lab22;
+ }
+ }
+ cursor$12 = this.cursor = this.limit_backward;
+ v_18 = cursor$12;
+ lab23 = true;
+lab23:
+ while (lab23 === true) {
+ lab23 = false;
+ if (! this.B_Y_found) {
+ break lab23;
+ }
+ replab24:
+ while (true) {
+ v_19 = this.cursor;
+ lab25 = true;
+ lab25:
+ while (lab25 === true) {
+ lab25 = false;
+ golab26:
+ while (true) {
+ v_20 = this.cursor;
+ lab27 = true;
+ lab27:
+ while (lab27 === true) {
+ lab27 = false;
+ this.bra = this.cursor;
+ if (! this.eq_s$IS(1, "Y")) {
+ break lab27;
+ }
+ this.ket = this.cursor;
+ this.cursor = v_20;
+ break golab26;
+ }
+ cursor$11 = this.cursor = v_20;
+ if (cursor$11 >= this.limit) {
+ break lab25;
+ }
+ this.cursor++;
+ }
+ if (! this.slice_from$S("y")) {
+ return false;
+ }
+ continue replab24;
+ }
+ this.cursor = v_19;
+ break replab24;
+ }
+ }
+ this.cursor = v_18;
+ return true;
+};
+
+/**
+ * @param {*} o
+ * @return {!boolean}
+ */
+PorterStemmer.prototype.equals$X = function (o) {
+ return o instanceof PorterStemmer;
+};
+
+/**
+ * @return {!number}
+ */
+PorterStemmer.prototype.hashCode$ = function () {
+ /** @type {!string} */
+ var classname;
+ /** @type {!number} */
+ var hash;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var char;
+ classname = "PorterStemmer";
+ hash = 0;
+ if ("PorterStemmer".length === 0) {
+ return (hash | 0);
+ }
+ for (i = 0; i < classname.length; i++) {
+ char = classname.charCodeAt(i);
+ hash = (hash << 5) - hash + char;
+ hash = hash & hash;
+ }
+ return (hash | 0);
+};
+
+/**
+ * class NorwegianStemmer extends BaseStemmer
+ * @constructor
+ */
+function NorwegianStemmer() {
+}
+
+NorwegianStemmer.prototype = new BaseStemmer;
+/**
+ * @constructor
+ */
+function NorwegianStemmer$() {
+ BaseStemmer$.call(this);
+ this.I_x = 0;
+ this.I_p1 = 0;
+};
+
+NorwegianStemmer$.prototype = new NorwegianStemmer;
+
+/**
+ * @param {NorwegianStemmer} other
+ */
+NorwegianStemmer.prototype.copy_from$LNorwegianStemmer$ = function (other) {
+ this.I_x = other.I_x;
+ this.I_p1 = other.I_p1;
+ BaseStemmer.prototype.copy_from$LBaseStemmer$.call(this, other);
+};
+
+/**
+ * @return {!boolean}
+ */
+NorwegianStemmer.prototype.r_mark_regions$ = function () {
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var c;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!boolean} */
+ var lab3;
+ /** @type {!boolean} */
+ var lab4;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var limit$0;
+ /** @type {!number} */
+ var cursor$1;
+ /** @type {!number} */
+ var cursor$2;
+ this.I_p1 = limit$0 = this.limit;
+ v_1 = cursor$0 = this.cursor;
+ c = (cursor$0 + 3 | 0);
+ if (0 > c || c > limit$0) {
+ return false;
+ }
+ cursor$2 = this.cursor = c;
+ this.I_x = cursor$2;
+ this.cursor = v_1;
+golab0:
+ while (true) {
+ v_2 = this.cursor;
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ if (! this.in_grouping$AIII(NorwegianStemmer.g_v, 97, 248)) {
+ break lab1;
+ }
+ this.cursor = v_2;
+ break golab0;
+ }
+ cursor$1 = this.cursor = v_2;
+ if (cursor$1 >= this.limit) {
+ return false;
+ }
+ this.cursor++;
+ }
+golab2:
+ while (true) {
+ lab3 = true;
+ lab3:
+ while (lab3 === true) {
+ lab3 = false;
+ if (! this.out_grouping$AIII(NorwegianStemmer.g_v, 97, 248)) {
+ break lab3;
+ }
+ break golab2;
+ }
+ if (this.cursor >= this.limit) {
+ return false;
+ }
+ this.cursor++;
+ }
+ this.I_p1 = this.cursor;
+ lab4 = true;
+lab4:
+ while (lab4 === true) {
+ lab4 = false;
+ if (! (this.I_p1 < this.I_x)) {
+ break lab4;
+ }
+ this.I_p1 = this.I_x;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+NorwegianStemmer.prototype.r_main_suffix$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var v_3;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var cursor$1;
+ /** @type {!number} */
+ var cursor$2;
+ v_1 = this.limit - (cursor$0 = this.cursor);
+ if (cursor$0 < this.I_p1) {
+ return false;
+ }
+ cursor$1 = this.cursor = this.I_p1;
+ v_2 = this.limit_backward;
+ this.limit_backward = cursor$1;
+ cursor$2 = this.cursor = this.limit - v_1;
+ this.ket = cursor$2;
+ among_var = this.find_among_b$ALAmong$I(NorwegianStemmer.a_0, 29);
+ if (among_var === 0) {
+ this.limit_backward = v_2;
+ return false;
+ }
+ this.bra = this.cursor;
+ this.limit_backward = v_2;
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 2:
+ lab0 = true;
+ lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ v_3 = this.limit - this.cursor;
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ if (! this.in_grouping_b$AIII(NorwegianStemmer.g_s_ending, 98, 122)) {
+ break lab1;
+ }
+ break lab0;
+ }
+ this.cursor = this.limit - v_3;
+ if (! this.eq_s_b$IS(1, "k")) {
+ return false;
+ }
+ if (! this.out_grouping_b$AIII(NorwegianStemmer.g_v, 97, 248)) {
+ return false;
+ }
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 3:
+ if (! this.slice_from$S("er")) {
+ return false;
+ }
+ break;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+NorwegianStemmer.prototype.r_consonant_pair$ = function () {
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var v_3;
+ /** @type {!number} */
+ var limit$0;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var cursor$1;
+ /** @type {!number} */
+ var cursor$2;
+ /** @type {!number} */
+ var cursor$3;
+ /** @type {!number} */
+ var limit_backward$0;
+ v_1 = (limit$0 = this.limit) - (cursor$0 = this.cursor);
+ v_2 = limit$0 - cursor$0;
+ if (cursor$0 < this.I_p1) {
+ return false;
+ }
+ cursor$1 = this.cursor = this.I_p1;
+ v_3 = this.limit_backward;
+ this.limit_backward = cursor$1;
+ cursor$2 = this.cursor = this.limit - v_2;
+ this.ket = cursor$2;
+ if (this.find_among_b$ALAmong$I(NorwegianStemmer.a_1, 2) === 0) {
+ this.limit_backward = v_3;
+ return false;
+ }
+ this.bra = this.cursor;
+ limit_backward$0 = this.limit_backward = v_3;
+ cursor$3 = this.cursor = this.limit - v_1;
+ if (cursor$3 <= limit_backward$0) {
+ return false;
+ }
+ this.cursor--;
+ this.bra = this.cursor;
+ return (! this.slice_from$S("") ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+NorwegianStemmer.prototype.r_other_suffix$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var cursor$1;
+ /** @type {!number} */
+ var cursor$2;
+ v_1 = this.limit - (cursor$0 = this.cursor);
+ if (cursor$0 < this.I_p1) {
+ return false;
+ }
+ cursor$1 = this.cursor = this.I_p1;
+ v_2 = this.limit_backward;
+ this.limit_backward = cursor$1;
+ cursor$2 = this.cursor = this.limit - v_1;
+ this.ket = cursor$2;
+ among_var = this.find_among_b$ALAmong$I(NorwegianStemmer.a_2, 11);
+ if (among_var === 0) {
+ this.limit_backward = v_2;
+ return false;
+ }
+ this.bra = this.cursor;
+ this.limit_backward = v_2;
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+NorwegianStemmer.prototype.stem$ = function () {
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var v_3;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!boolean} */
+ var lab2;
+ /** @type {!boolean} */
+ var lab3;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var limit$0;
+ /** @type {!number} */
+ var cursor$1;
+ /** @type {!number} */
+ var limit$1;
+ /** @type {!number} */
+ var cursor$2;
+ v_1 = this.cursor;
+ lab0 = true;
+lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ if (! this.r_mark_regions$()) {
+ break lab0;
+ }
+ }
+ cursor$0 = this.cursor = v_1;
+ this.limit_backward = cursor$0;
+ cursor$1 = this.cursor = limit$0 = this.limit;
+ v_2 = limit$0 - cursor$1;
+ lab1 = true;
+lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ if (! this.r_main_suffix$()) {
+ break lab1;
+ }
+ }
+ cursor$2 = this.cursor = (limit$1 = this.limit) - v_2;
+ v_3 = limit$1 - cursor$2;
+ lab2 = true;
+lab2:
+ while (lab2 === true) {
+ lab2 = false;
+ if (! this.r_consonant_pair$()) {
+ break lab2;
+ }
+ }
+ this.cursor = this.limit - v_3;
+ lab3 = true;
+lab3:
+ while (lab3 === true) {
+ lab3 = false;
+ if (! this.r_other_suffix$()) {
+ break lab3;
+ }
+ }
+ this.cursor = this.limit_backward;
+ return true;
+};
+
+/**
+ * @param {*} o
+ * @return {!boolean}
+ */
+NorwegianStemmer.prototype.equals$X = function (o) {
+ return o instanceof NorwegianStemmer;
+};
+
+/**
+ * @return {!number}
+ */
+NorwegianStemmer.prototype.hashCode$ = function () {
+ /** @type {!string} */
+ var classname;
+ /** @type {!number} */
+ var hash;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var char;
+ classname = "NorwegianStemmer";
+ hash = 0;
+ if ("NorwegianStemmer".length === 0) {
+ return (hash | 0);
+ }
+ for (i = 0; i < classname.length; i++) {
+ char = classname.charCodeAt(i);
+ hash = (hash << 5) - hash + char;
+ hash = hash & hash;
+ }
+ return (hash | 0);
+};
+
+/**
+ * class ItalianStemmer extends BaseStemmer
+ * @constructor
+ */
+function ItalianStemmer() {
+}
+
+ItalianStemmer.prototype = new BaseStemmer;
+/**
+ * @constructor
+ */
+function ItalianStemmer$() {
+ BaseStemmer$.call(this);
+ this.I_p2 = 0;
+ this.I_p1 = 0;
+ this.I_pV = 0;
+};
+
+ItalianStemmer$.prototype = new ItalianStemmer;
+
+/**
+ * @param {ItalianStemmer} other
+ */
+ItalianStemmer.prototype.copy_from$LItalianStemmer$ = function (other) {
+ this.I_p2 = other.I_p2;
+ this.I_p1 = other.I_p1;
+ this.I_pV = other.I_pV;
+ BaseStemmer.prototype.copy_from$LBaseStemmer$.call(this, other);
+};
+
+/**
+ * @return {!boolean}
+ */
+ItalianStemmer.prototype.r_prelude$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var v_3;
+ /** @type {!number} */
+ var v_4;
+ /** @type {!number} */
+ var v_5;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!boolean} */
+ var lab3;
+ /** @type {!boolean} */
+ var lab5;
+ /** @type {!boolean} */
+ var lab6;
+ /** @type {!boolean} */
+ var lab7;
+ /** @type {!number} */
+ var cursor$0;
+ v_1 = this.cursor;
+replab0:
+ while (true) {
+ v_2 = this.cursor;
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ this.bra = this.cursor;
+ among_var = this.find_among$ALAmong$I(ItalianStemmer.a_0, 7);
+ if (among_var === 0) {
+ break lab1;
+ }
+ this.ket = this.cursor;
+ switch (among_var) {
+ case 0:
+ break lab1;
+ case 1:
+ if (! this.slice_from$S("\u00E0")) {
+ return false;
+ }
+ break;
+ case 2:
+ if (! this.slice_from$S("\u00E8")) {
+ return false;
+ }
+ break;
+ case 3:
+ if (! this.slice_from$S("\u00EC")) {
+ return false;
+ }
+ break;
+ case 4:
+ if (! this.slice_from$S("\u00F2")) {
+ return false;
+ }
+ break;
+ case 5:
+ if (! this.slice_from$S("\u00F9")) {
+ return false;
+ }
+ break;
+ case 6:
+ if (! this.slice_from$S("qU")) {
+ return false;
+ }
+ break;
+ case 7:
+ if (this.cursor >= this.limit) {
+ break lab1;
+ }
+ this.cursor++;
+ break;
+ }
+ continue replab0;
+ }
+ this.cursor = v_2;
+ break replab0;
+ }
+ this.cursor = v_1;
+replab2:
+ while (true) {
+ v_3 = this.cursor;
+ lab3 = true;
+ lab3:
+ while (lab3 === true) {
+ lab3 = false;
+ golab4:
+ while (true) {
+ v_4 = this.cursor;
+ lab5 = true;
+ lab5:
+ while (lab5 === true) {
+ lab5 = false;
+ if (! this.in_grouping$AIII(ItalianStemmer.g_v, 97, 249)) {
+ break lab5;
+ }
+ this.bra = this.cursor;
+ lab6 = true;
+ lab6:
+ while (lab6 === true) {
+ lab6 = false;
+ v_5 = this.cursor;
+ lab7 = true;
+ lab7:
+ while (lab7 === true) {
+ lab7 = false;
+ if (! this.eq_s$IS(1, "u")) {
+ break lab7;
+ }
+ this.ket = this.cursor;
+ if (! this.in_grouping$AIII(ItalianStemmer.g_v, 97, 249)) {
+ break lab7;
+ }
+ if (! this.slice_from$S("U")) {
+ return false;
+ }
+ break lab6;
+ }
+ this.cursor = v_5;
+ if (! this.eq_s$IS(1, "i")) {
+ break lab5;
+ }
+ this.ket = this.cursor;
+ if (! this.in_grouping$AIII(ItalianStemmer.g_v, 97, 249)) {
+ break lab5;
+ }
+ if (! this.slice_from$S("I")) {
+ return false;
+ }
+ }
+ this.cursor = v_4;
+ break golab4;
+ }
+ cursor$0 = this.cursor = v_4;
+ if (cursor$0 >= this.limit) {
+ break lab3;
+ }
+ this.cursor++;
+ }
+ continue replab2;
+ }
+ this.cursor = v_3;
+ break replab2;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+ItalianStemmer.prototype.r_mark_regions$ = function () {
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var v_3;
+ /** @type {!number} */
+ var v_6;
+ /** @type {!number} */
+ var v_8;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!boolean} */
+ var lab2;
+ /** @type {!boolean} */
+ var lab3;
+ /** @type {!boolean} */
+ var lab4;
+ /** @type {!boolean} */
+ var lab6;
+ /** @type {!boolean} */
+ var lab8;
+ /** @type {!boolean} */
+ var lab9;
+ /** @type {!boolean} */
+ var lab10;
+ /** @type {!boolean} */
+ var lab12;
+ /** @type {!boolean} */
+ var lab13;
+ /** @type {!boolean} */
+ var lab15;
+ /** @type {!boolean} */
+ var lab17;
+ /** @type {!boolean} */
+ var lab19;
+ /** @type {!boolean} */
+ var lab21;
+ /** @type {!number} */
+ var limit$0;
+ /** @type {!number} */
+ var cursor$0;
+ this.I_pV = limit$0 = this.limit;
+ this.I_p1 = limit$0;
+ this.I_p2 = limit$0;
+ v_1 = this.cursor;
+ lab0 = true;
+lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ v_2 = this.cursor;
+ lab2 = true;
+ lab2:
+ while (lab2 === true) {
+ lab2 = false;
+ if (! this.in_grouping$AIII(ItalianStemmer.g_v, 97, 249)) {
+ break lab2;
+ }
+ lab3 = true;
+ lab3:
+ while (lab3 === true) {
+ lab3 = false;
+ v_3 = this.cursor;
+ lab4 = true;
+ lab4:
+ while (lab4 === true) {
+ lab4 = false;
+ if (! this.out_grouping$AIII(ItalianStemmer.g_v, 97, 249)) {
+ break lab4;
+ }
+ golab5:
+ while (true) {
+ lab6 = true;
+ lab6:
+ while (lab6 === true) {
+ lab6 = false;
+ if (! this.in_grouping$AIII(ItalianStemmer.g_v, 97, 249)) {
+ break lab6;
+ }
+ break golab5;
+ }
+ if (this.cursor >= this.limit) {
+ break lab4;
+ }
+ this.cursor++;
+ }
+ break lab3;
+ }
+ this.cursor = v_3;
+ if (! this.in_grouping$AIII(ItalianStemmer.g_v, 97, 249)) {
+ break lab2;
+ }
+ golab7:
+ while (true) {
+ lab8 = true;
+ lab8:
+ while (lab8 === true) {
+ lab8 = false;
+ if (! this.out_grouping$AIII(ItalianStemmer.g_v, 97, 249)) {
+ break lab8;
+ }
+ break golab7;
+ }
+ if (this.cursor >= this.limit) {
+ break lab2;
+ }
+ this.cursor++;
+ }
+ }
+ break lab1;
+ }
+ this.cursor = v_2;
+ if (! this.out_grouping$AIII(ItalianStemmer.g_v, 97, 249)) {
+ break lab0;
+ }
+ lab9 = true;
+ lab9:
+ while (lab9 === true) {
+ lab9 = false;
+ v_6 = this.cursor;
+ lab10 = true;
+ lab10:
+ while (lab10 === true) {
+ lab10 = false;
+ if (! this.out_grouping$AIII(ItalianStemmer.g_v, 97, 249)) {
+ break lab10;
+ }
+ golab11:
+ while (true) {
+ lab12 = true;
+ lab12:
+ while (lab12 === true) {
+ lab12 = false;
+ if (! this.in_grouping$AIII(ItalianStemmer.g_v, 97, 249)) {
+ break lab12;
+ }
+ break golab11;
+ }
+ if (this.cursor >= this.limit) {
+ break lab10;
+ }
+ this.cursor++;
+ }
+ break lab9;
+ }
+ this.cursor = v_6;
+ if (! this.in_grouping$AIII(ItalianStemmer.g_v, 97, 249)) {
+ break lab0;
+ }
+ if (this.cursor >= this.limit) {
+ break lab0;
+ }
+ this.cursor++;
+ }
+ }
+ this.I_pV = this.cursor;
+ }
+ cursor$0 = this.cursor = v_1;
+ v_8 = cursor$0;
+ lab13 = true;
+lab13:
+ while (lab13 === true) {
+ lab13 = false;
+ golab14:
+ while (true) {
+ lab15 = true;
+ lab15:
+ while (lab15 === true) {
+ lab15 = false;
+ if (! this.in_grouping$AIII(ItalianStemmer.g_v, 97, 249)) {
+ break lab15;
+ }
+ break golab14;
+ }
+ if (this.cursor >= this.limit) {
+ break lab13;
+ }
+ this.cursor++;
+ }
+ golab16:
+ while (true) {
+ lab17 = true;
+ lab17:
+ while (lab17 === true) {
+ lab17 = false;
+ if (! this.out_grouping$AIII(ItalianStemmer.g_v, 97, 249)) {
+ break lab17;
+ }
+ break golab16;
+ }
+ if (this.cursor >= this.limit) {
+ break lab13;
+ }
+ this.cursor++;
+ }
+ this.I_p1 = this.cursor;
+ golab18:
+ while (true) {
+ lab19 = true;
+ lab19:
+ while (lab19 === true) {
+ lab19 = false;
+ if (! this.in_grouping$AIII(ItalianStemmer.g_v, 97, 249)) {
+ break lab19;
+ }
+ break golab18;
+ }
+ if (this.cursor >= this.limit) {
+ break lab13;
+ }
+ this.cursor++;
+ }
+ golab20:
+ while (true) {
+ lab21 = true;
+ lab21:
+ while (lab21 === true) {
+ lab21 = false;
+ if (! this.out_grouping$AIII(ItalianStemmer.g_v, 97, 249)) {
+ break lab21;
+ }
+ break golab20;
+ }
+ if (this.cursor >= this.limit) {
+ break lab13;
+ }
+ this.cursor++;
+ }
+ this.I_p2 = this.cursor;
+ }
+ this.cursor = v_8;
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+ItalianStemmer.prototype.r_postlude$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var v_1;
+ /** @type {!boolean} */
+ var lab1;
+replab0:
+ while (true) {
+ v_1 = this.cursor;
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ this.bra = this.cursor;
+ among_var = this.find_among$ALAmong$I(ItalianStemmer.a_1, 3);
+ if (among_var === 0) {
+ break lab1;
+ }
+ this.ket = this.cursor;
+ switch (among_var) {
+ case 0:
+ break lab1;
+ case 1:
+ if (! this.slice_from$S("i")) {
+ return false;
+ }
+ break;
+ case 2:
+ if (! this.slice_from$S("u")) {
+ return false;
+ }
+ break;
+ case 3:
+ if (this.cursor >= this.limit) {
+ break lab1;
+ }
+ this.cursor++;
+ break;
+ }
+ continue replab0;
+ }
+ this.cursor = v_1;
+ break replab0;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+ItalianStemmer.prototype.r_RV$ = function () {
+ return (! (this.I_pV <= this.cursor) ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+ItalianStemmer.prototype.r_R1$ = function () {
+ return (! (this.I_p1 <= this.cursor) ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+ItalianStemmer.prototype.r_R2$ = function () {
+ return (! (this.I_p2 <= this.cursor) ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+ItalianStemmer.prototype.r_attached_pronoun$ = function () {
+ /** @type {!number} */
+ var among_var;
+ this.ket = this.cursor;
+ if (this.find_among_b$ALAmong$I(ItalianStemmer.a_2, 37) === 0) {
+ return false;
+ }
+ this.bra = this.cursor;
+ among_var = this.find_among_b$ALAmong$I(ItalianStemmer.a_3, 5);
+ if (among_var === 0) {
+ return false;
+ }
+ if (! (! (this.I_pV <= this.cursor) ? false : true)) {
+ return false;
+ }
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 2:
+ if (! this.slice_from$S("e")) {
+ return false;
+ }
+ break;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+ItalianStemmer.prototype.r_standard_suffix$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var v_3;
+ /** @type {!number} */
+ var v_4;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!boolean} */
+ var lab2;
+ /** @type {!boolean} */
+ var lab3;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var cursor$1;
+ /** @type {!number} */
+ var cursor$2;
+ /** @type {!number} */
+ var cursor$3;
+ /** @type {!number} */
+ var cursor$4;
+ this.ket = this.cursor;
+ among_var = this.find_among_b$ALAmong$I(ItalianStemmer.a_6, 51);
+ if (among_var === 0) {
+ return false;
+ }
+ this.bra = this.cursor;
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ if (! (! (this.I_p2 <= this.cursor) ? false : true)) {
+ return false;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 2:
+ if (! (! (this.I_p2 <= this.cursor) ? false : true)) {
+ return false;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ v_1 = this.limit - this.cursor;
+ lab0 = true;
+ lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ this.ket = this.cursor;
+ if (! this.eq_s_b$IS(2, "ic")) {
+ this.cursor = this.limit - v_1;
+ break lab0;
+ }
+ this.bra = cursor$0 = this.cursor;
+ if (! (! (this.I_p2 <= cursor$0) ? false : true)) {
+ this.cursor = this.limit - v_1;
+ break lab0;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ }
+ break;
+ case 3:
+ if (! (! (this.I_p2 <= this.cursor) ? false : true)) {
+ return false;
+ }
+ if (! this.slice_from$S("log")) {
+ return false;
+ }
+ break;
+ case 4:
+ if (! (! (this.I_p2 <= this.cursor) ? false : true)) {
+ return false;
+ }
+ if (! this.slice_from$S("u")) {
+ return false;
+ }
+ break;
+ case 5:
+ if (! (! (this.I_p2 <= this.cursor) ? false : true)) {
+ return false;
+ }
+ if (! this.slice_from$S("ente")) {
+ return false;
+ }
+ break;
+ case 6:
+ if (! (! (this.I_pV <= this.cursor) ? false : true)) {
+ return false;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 7:
+ if (! (! (this.I_p1 <= this.cursor) ? false : true)) {
+ return false;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ v_2 = this.limit - this.cursor;
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ this.ket = this.cursor;
+ among_var = this.find_among_b$ALAmong$I(ItalianStemmer.a_4, 4);
+ if (among_var === 0) {
+ this.cursor = this.limit - v_2;
+ break lab1;
+ }
+ this.bra = cursor$1 = this.cursor;
+ if (! (! (this.I_p2 <= cursor$1) ? false : true)) {
+ this.cursor = this.limit - v_2;
+ break lab1;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ switch (among_var) {
+ case 0:
+ this.cursor = this.limit - v_2;
+ break lab1;
+ case 1:
+ this.ket = this.cursor;
+ if (! this.eq_s_b$IS(2, "at")) {
+ this.cursor = this.limit - v_2;
+ break lab1;
+ }
+ this.bra = cursor$2 = this.cursor;
+ if (! (! (this.I_p2 <= cursor$2) ? false : true)) {
+ this.cursor = this.limit - v_2;
+ break lab1;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ }
+ }
+ break;
+ case 8:
+ if (! (! (this.I_p2 <= this.cursor) ? false : true)) {
+ return false;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ v_3 = this.limit - this.cursor;
+ lab2 = true;
+ lab2:
+ while (lab2 === true) {
+ lab2 = false;
+ this.ket = this.cursor;
+ among_var = this.find_among_b$ALAmong$I(ItalianStemmer.a_5, 3);
+ if (among_var === 0) {
+ this.cursor = this.limit - v_3;
+ break lab2;
+ }
+ this.bra = this.cursor;
+ switch (among_var) {
+ case 0:
+ this.cursor = this.limit - v_3;
+ break lab2;
+ case 1:
+ if (! (! (this.I_p2 <= this.cursor) ? false : true)) {
+ this.cursor = this.limit - v_3;
+ break lab2;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ }
+ }
+ break;
+ case 9:
+ if (! (! (this.I_p2 <= this.cursor) ? false : true)) {
+ return false;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ v_4 = this.limit - this.cursor;
+ lab3 = true;
+ lab3:
+ while (lab3 === true) {
+ lab3 = false;
+ this.ket = this.cursor;
+ if (! this.eq_s_b$IS(2, "at")) {
+ this.cursor = this.limit - v_4;
+ break lab3;
+ }
+ this.bra = cursor$3 = this.cursor;
+ if (! (! (this.I_p2 <= cursor$3) ? false : true)) {
+ this.cursor = this.limit - v_4;
+ break lab3;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ this.ket = this.cursor;
+ if (! this.eq_s_b$IS(2, "ic")) {
+ this.cursor = this.limit - v_4;
+ break lab3;
+ }
+ this.bra = cursor$4 = this.cursor;
+ if (! (! (this.I_p2 <= cursor$4) ? false : true)) {
+ this.cursor = this.limit - v_4;
+ break lab3;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ }
+ break;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+ItalianStemmer.prototype.r_verb_suffix$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var cursor$1;
+ /** @type {!number} */
+ var cursor$2;
+ v_1 = this.limit - (cursor$0 = this.cursor);
+ if (cursor$0 < this.I_pV) {
+ return false;
+ }
+ cursor$1 = this.cursor = this.I_pV;
+ v_2 = this.limit_backward;
+ this.limit_backward = cursor$1;
+ cursor$2 = this.cursor = this.limit - v_1;
+ this.ket = cursor$2;
+ among_var = this.find_among_b$ALAmong$I(ItalianStemmer.a_7, 87);
+ if (among_var === 0) {
+ this.limit_backward = v_2;
+ return false;
+ }
+ this.bra = this.cursor;
+ switch (among_var) {
+ case 0:
+ this.limit_backward = v_2;
+ return false;
+ case 1:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ }
+ this.limit_backward = v_2;
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+ItalianStemmer.prototype.r_vowel_suffix$ = function () {
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var cursor$1;
+ v_1 = this.limit - this.cursor;
+ lab0 = true;
+lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ this.ket = this.cursor;
+ if (! this.in_grouping_b$AIII(ItalianStemmer.g_AEIO, 97, 242)) {
+ this.cursor = this.limit - v_1;
+ break lab0;
+ }
+ this.bra = cursor$0 = this.cursor;
+ if (! (! (this.I_pV <= cursor$0) ? false : true)) {
+ this.cursor = this.limit - v_1;
+ break lab0;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ this.ket = this.cursor;
+ if (! this.eq_s_b$IS(1, "i")) {
+ this.cursor = this.limit - v_1;
+ break lab0;
+ }
+ this.bra = cursor$1 = this.cursor;
+ if (! (! (this.I_pV <= cursor$1) ? false : true)) {
+ this.cursor = this.limit - v_1;
+ break lab0;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ }
+ v_2 = this.limit - this.cursor;
+ lab1 = true;
+lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ this.ket = this.cursor;
+ if (! this.eq_s_b$IS(1, "h")) {
+ this.cursor = this.limit - v_2;
+ break lab1;
+ }
+ this.bra = this.cursor;
+ if (! this.in_grouping_b$AIII(ItalianStemmer.g_CG, 99, 103)) {
+ this.cursor = this.limit - v_2;
+ break lab1;
+ }
+ if (! (! (this.I_pV <= this.cursor) ? false : true)) {
+ this.cursor = this.limit - v_2;
+ break lab1;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+ItalianStemmer.prototype.stem$ = function () {
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var v_3;
+ /** @type {!number} */
+ var v_4;
+ /** @type {!number} */
+ var v_5;
+ /** @type {!number} */
+ var v_7;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!boolean} */
+ var lab2;
+ /** @type {!boolean} */
+ var lab3;
+ /** @type {!boolean} */
+ var lab4;
+ /** @type {!boolean} */
+ var lab5;
+ /** @type {!boolean} */
+ var lab6;
+ /** @type {!boolean} */
+ var lab7;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var cursor$1;
+ /** @type {!number} */
+ var limit$0;
+ /** @type {!number} */
+ var cursor$2;
+ /** @type {!number} */
+ var limit$1;
+ /** @type {!number} */
+ var cursor$3;
+ /** @type {!number} */
+ var cursor$4;
+ v_1 = this.cursor;
+ lab0 = true;
+lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ if (! this.r_prelude$()) {
+ break lab0;
+ }
+ }
+ cursor$0 = this.cursor = v_1;
+ v_2 = cursor$0;
+ lab1 = true;
+lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ if (! this.r_mark_regions$()) {
+ break lab1;
+ }
+ }
+ cursor$1 = this.cursor = v_2;
+ this.limit_backward = cursor$1;
+ cursor$2 = this.cursor = limit$0 = this.limit;
+ v_3 = limit$0 - cursor$2;
+ lab2 = true;
+lab2:
+ while (lab2 === true) {
+ lab2 = false;
+ if (! this.r_attached_pronoun$()) {
+ break lab2;
+ }
+ }
+ cursor$3 = this.cursor = (limit$1 = this.limit) - v_3;
+ v_4 = limit$1 - cursor$3;
+ lab3 = true;
+lab3:
+ while (lab3 === true) {
+ lab3 = false;
+ lab4 = true;
+ lab4:
+ while (lab4 === true) {
+ lab4 = false;
+ v_5 = this.limit - this.cursor;
+ lab5 = true;
+ lab5:
+ while (lab5 === true) {
+ lab5 = false;
+ if (! this.r_standard_suffix$()) {
+ break lab5;
+ }
+ break lab4;
+ }
+ this.cursor = this.limit - v_5;
+ if (! this.r_verb_suffix$()) {
+ break lab3;
+ }
+ }
+ }
+ this.cursor = this.limit - v_4;
+ lab6 = true;
+lab6:
+ while (lab6 === true) {
+ lab6 = false;
+ if (! this.r_vowel_suffix$()) {
+ break lab6;
+ }
+ }
+ cursor$4 = this.cursor = this.limit_backward;
+ v_7 = cursor$4;
+ lab7 = true;
+lab7:
+ while (lab7 === true) {
+ lab7 = false;
+ if (! this.r_postlude$()) {
+ break lab7;
+ }
+ }
+ this.cursor = v_7;
+ return true;
+};
+
+/**
+ * @param {*} o
+ * @return {!boolean}
+ */
+ItalianStemmer.prototype.equals$X = function (o) {
+ return o instanceof ItalianStemmer;
+};
+
+/**
+ * @return {!number}
+ */
+ItalianStemmer.prototype.hashCode$ = function () {
+ /** @type {!string} */
+ var classname;
+ /** @type {!number} */
+ var hash;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var char;
+ classname = "ItalianStemmer";
+ hash = 0;
+ if ("ItalianStemmer".length === 0) {
+ return (hash | 0);
+ }
+ for (i = 0; i < classname.length; i++) {
+ char = classname.charCodeAt(i);
+ hash = (hash << 5) - hash + char;
+ hash = hash & hash;
+ }
+ return (hash | 0);
+};
+
+/**
+ * class HungarianStemmer extends BaseStemmer
+ * @constructor
+ */
+function HungarianStemmer() {
+}
+
+HungarianStemmer.prototype = new BaseStemmer;
+/**
+ * @constructor
+ */
+function HungarianStemmer$() {
+ BaseStemmer$.call(this);
+ this.I_p1 = 0;
+};
+
+HungarianStemmer$.prototype = new HungarianStemmer;
+
+/**
+ * @param {HungarianStemmer} other
+ */
+HungarianStemmer.prototype.copy_from$LHungarianStemmer$ = function (other) {
+ this.I_p1 = other.I_p1;
+ BaseStemmer.prototype.copy_from$LBaseStemmer$.call(this, other);
+};
+
+/**
+ * @return {!boolean}
+ */
+HungarianStemmer.prototype.r_mark_regions$ = function () {
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var v_3;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!boolean} */
+ var lab3;
+ /** @type {!boolean} */
+ var lab4;
+ /** @type {!boolean} */
+ var lab5;
+ /** @type {!boolean} */
+ var lab7;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var cursor$1;
+ this.I_p1 = this.limit;
+ lab0 = true;
+lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ v_1 = this.cursor;
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ if (! this.in_grouping$AIII(HungarianStemmer.g_v, 97, 252)) {
+ break lab1;
+ }
+ golab2:
+ while (true) {
+ v_2 = this.cursor;
+ lab3 = true;
+ lab3:
+ while (lab3 === true) {
+ lab3 = false;
+ if (! this.out_grouping$AIII(HungarianStemmer.g_v, 97, 252)) {
+ break lab3;
+ }
+ this.cursor = v_2;
+ break golab2;
+ }
+ cursor$0 = this.cursor = v_2;
+ if (cursor$0 >= this.limit) {
+ break lab1;
+ }
+ this.cursor++;
+ }
+ lab4 = true;
+ lab4:
+ while (lab4 === true) {
+ lab4 = false;
+ v_3 = this.cursor;
+ lab5 = true;
+ lab5:
+ while (lab5 === true) {
+ lab5 = false;
+ if (this.find_among$ALAmong$I(HungarianStemmer.a_0, 8) === 0) {
+ break lab5;
+ }
+ break lab4;
+ }
+ cursor$1 = this.cursor = v_3;
+ if (cursor$1 >= this.limit) {
+ break lab1;
+ }
+ this.cursor++;
+ }
+ this.I_p1 = this.cursor;
+ break lab0;
+ }
+ this.cursor = v_1;
+ if (! this.out_grouping$AIII(HungarianStemmer.g_v, 97, 252)) {
+ return false;
+ }
+ golab6:
+ while (true) {
+ lab7 = true;
+ lab7:
+ while (lab7 === true) {
+ lab7 = false;
+ if (! this.in_grouping$AIII(HungarianStemmer.g_v, 97, 252)) {
+ break lab7;
+ }
+ break golab6;
+ }
+ if (this.cursor >= this.limit) {
+ return false;
+ }
+ this.cursor++;
+ }
+ this.I_p1 = this.cursor;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+HungarianStemmer.prototype.r_R1$ = function () {
+ return (! (this.I_p1 <= this.cursor) ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+HungarianStemmer.prototype.r_v_ending$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var cursor$0;
+ this.ket = this.cursor;
+ among_var = this.find_among_b$ALAmong$I(HungarianStemmer.a_1, 2);
+ if (among_var === 0) {
+ return false;
+ }
+ this.bra = cursor$0 = this.cursor;
+ if (! (! (this.I_p1 <= cursor$0) ? false : true)) {
+ return false;
+ }
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ if (! this.slice_from$S("a")) {
+ return false;
+ }
+ break;
+ case 2:
+ if (! this.slice_from$S("e")) {
+ return false;
+ }
+ break;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+HungarianStemmer.prototype.r_double$ = function () {
+ /** @type {!number} */
+ var v_1;
+ v_1 = this.limit - this.cursor;
+ if (this.find_among_b$ALAmong$I(HungarianStemmer.a_2, 23) === 0) {
+ return false;
+ }
+ this.cursor = this.limit - v_1;
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+HungarianStemmer.prototype.r_undouble$ = function () {
+ /** @type {!number} */
+ var c;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var cursor$1;
+ if (this.cursor <= this.limit_backward) {
+ return false;
+ }
+ this.cursor--;
+ this.ket = cursor$0 = this.cursor;
+ c = (cursor$0 - 1 | 0);
+ if (this.limit_backward > c || c > this.limit) {
+ return false;
+ }
+ cursor$1 = this.cursor = c;
+ this.bra = cursor$1;
+ return (! this.slice_from$S("") ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+HungarianStemmer.prototype.r_instrum$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var cursor$0;
+ this.ket = this.cursor;
+ among_var = this.find_among_b$ALAmong$I(HungarianStemmer.a_3, 2);
+ if (among_var === 0) {
+ return false;
+ }
+ this.bra = cursor$0 = this.cursor;
+ if (! (! (this.I_p1 <= cursor$0) ? false : true)) {
+ return false;
+ }
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ if (! this.r_double$()) {
+ return false;
+ }
+ break;
+ case 2:
+ if (! this.r_double$()) {
+ return false;
+ }
+ break;
+ }
+ return (! this.slice_from$S("") ? false : ! this.r_undouble$() ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+HungarianStemmer.prototype.r_case$ = function () {
+ /** @type {!number} */
+ var cursor$0;
+ this.ket = this.cursor;
+ if (this.find_among_b$ALAmong$I(HungarianStemmer.a_4, 44) === 0) {
+ return false;
+ }
+ this.bra = cursor$0 = this.cursor;
+ return (! (! (this.I_p1 <= cursor$0) ? false : true) ? false : ! this.slice_from$S("") ? false : ! this.r_v_ending$() ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+HungarianStemmer.prototype.r_case_special$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var cursor$0;
+ this.ket = this.cursor;
+ among_var = this.find_among_b$ALAmong$I(HungarianStemmer.a_5, 3);
+ if (among_var === 0) {
+ return false;
+ }
+ this.bra = cursor$0 = this.cursor;
+ if (! (! (this.I_p1 <= cursor$0) ? false : true)) {
+ return false;
+ }
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ if (! this.slice_from$S("e")) {
+ return false;
+ }
+ break;
+ case 2:
+ if (! this.slice_from$S("a")) {
+ return false;
+ }
+ break;
+ case 3:
+ if (! this.slice_from$S("a")) {
+ return false;
+ }
+ break;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+HungarianStemmer.prototype.r_case_other$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var cursor$0;
+ this.ket = this.cursor;
+ among_var = this.find_among_b$ALAmong$I(HungarianStemmer.a_6, 6);
+ if (among_var === 0) {
+ return false;
+ }
+ this.bra = cursor$0 = this.cursor;
+ if (! (! (this.I_p1 <= cursor$0) ? false : true)) {
+ return false;
+ }
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 2:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 3:
+ if (! this.slice_from$S("a")) {
+ return false;
+ }
+ break;
+ case 4:
+ if (! this.slice_from$S("e")) {
+ return false;
+ }
+ break;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+HungarianStemmer.prototype.r_factive$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var cursor$0;
+ this.ket = this.cursor;
+ among_var = this.find_among_b$ALAmong$I(HungarianStemmer.a_7, 2);
+ if (among_var === 0) {
+ return false;
+ }
+ this.bra = cursor$0 = this.cursor;
+ if (! (! (this.I_p1 <= cursor$0) ? false : true)) {
+ return false;
+ }
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ if (! this.r_double$()) {
+ return false;
+ }
+ break;
+ case 2:
+ if (! this.r_double$()) {
+ return false;
+ }
+ break;
+ }
+ return (! this.slice_from$S("") ? false : ! this.r_undouble$() ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+HungarianStemmer.prototype.r_plural$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var cursor$0;
+ this.ket = this.cursor;
+ among_var = this.find_among_b$ALAmong$I(HungarianStemmer.a_8, 7);
+ if (among_var === 0) {
+ return false;
+ }
+ this.bra = cursor$0 = this.cursor;
+ if (! (! (this.I_p1 <= cursor$0) ? false : true)) {
+ return false;
+ }
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ if (! this.slice_from$S("a")) {
+ return false;
+ }
+ break;
+ case 2:
+ if (! this.slice_from$S("e")) {
+ return false;
+ }
+ break;
+ case 3:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 4:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 5:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 6:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 7:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+HungarianStemmer.prototype.r_owned$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var cursor$0;
+ this.ket = this.cursor;
+ among_var = this.find_among_b$ALAmong$I(HungarianStemmer.a_9, 12);
+ if (among_var === 0) {
+ return false;
+ }
+ this.bra = cursor$0 = this.cursor;
+ if (! (! (this.I_p1 <= cursor$0) ? false : true)) {
+ return false;
+ }
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 2:
+ if (! this.slice_from$S("e")) {
+ return false;
+ }
+ break;
+ case 3:
+ if (! this.slice_from$S("a")) {
+ return false;
+ }
+ break;
+ case 4:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 5:
+ if (! this.slice_from$S("e")) {
+ return false;
+ }
+ break;
+ case 6:
+ if (! this.slice_from$S("a")) {
+ return false;
+ }
+ break;
+ case 7:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 8:
+ if (! this.slice_from$S("e")) {
+ return false;
+ }
+ break;
+ case 9:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+HungarianStemmer.prototype.r_sing_owner$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var cursor$0;
+ this.ket = this.cursor;
+ among_var = this.find_among_b$ALAmong$I(HungarianStemmer.a_10, 31);
+ if (among_var === 0) {
+ return false;
+ }
+ this.bra = cursor$0 = this.cursor;
+ if (! (! (this.I_p1 <= cursor$0) ? false : true)) {
+ return false;
+ }
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 2:
+ if (! this.slice_from$S("a")) {
+ return false;
+ }
+ break;
+ case 3:
+ if (! this.slice_from$S("e")) {
+ return false;
+ }
+ break;
+ case 4:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 5:
+ if (! this.slice_from$S("a")) {
+ return false;
+ }
+ break;
+ case 6:
+ if (! this.slice_from$S("e")) {
+ return false;
+ }
+ break;
+ case 7:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 8:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 9:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 10:
+ if (! this.slice_from$S("a")) {
+ return false;
+ }
+ break;
+ case 11:
+ if (! this.slice_from$S("e")) {
+ return false;
+ }
+ break;
+ case 12:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 13:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 14:
+ if (! this.slice_from$S("a")) {
+ return false;
+ }
+ break;
+ case 15:
+ if (! this.slice_from$S("e")) {
+ return false;
+ }
+ break;
+ case 16:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 17:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 18:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 19:
+ if (! this.slice_from$S("a")) {
+ return false;
+ }
+ break;
+ case 20:
+ if (! this.slice_from$S("e")) {
+ return false;
+ }
+ break;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+HungarianStemmer.prototype.r_plur_owner$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var cursor$0;
+ this.ket = this.cursor;
+ among_var = this.find_among_b$ALAmong$I(HungarianStemmer.a_11, 42);
+ if (among_var === 0) {
+ return false;
+ }
+ this.bra = cursor$0 = this.cursor;
+ if (! (! (this.I_p1 <= cursor$0) ? false : true)) {
+ return false;
+ }
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 2:
+ if (! this.slice_from$S("a")) {
+ return false;
+ }
+ break;
+ case 3:
+ if (! this.slice_from$S("e")) {
+ return false;
+ }
+ break;
+ case 4:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 5:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 6:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 7:
+ if (! this.slice_from$S("a")) {
+ return false;
+ }
+ break;
+ case 8:
+ if (! this.slice_from$S("e")) {
+ return false;
+ }
+ break;
+ case 9:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 10:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 11:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 12:
+ if (! this.slice_from$S("a")) {
+ return false;
+ }
+ break;
+ case 13:
+ if (! this.slice_from$S("e")) {
+ return false;
+ }
+ break;
+ case 14:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 15:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 16:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 17:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 18:
+ if (! this.slice_from$S("a")) {
+ return false;
+ }
+ break;
+ case 19:
+ if (! this.slice_from$S("e")) {
+ return false;
+ }
+ break;
+ case 20:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 21:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 22:
+ if (! this.slice_from$S("a")) {
+ return false;
+ }
+ break;
+ case 23:
+ if (! this.slice_from$S("e")) {
+ return false;
+ }
+ break;
+ case 24:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 25:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 26:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 27:
+ if (! this.slice_from$S("a")) {
+ return false;
+ }
+ break;
+ case 28:
+ if (! this.slice_from$S("e")) {
+ return false;
+ }
+ break;
+ case 29:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+HungarianStemmer.prototype.stem$ = function () {
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var v_3;
+ /** @type {!number} */
+ var v_4;
+ /** @type {!number} */
+ var v_5;
+ /** @type {!number} */
+ var v_6;
+ /** @type {!number} */
+ var v_7;
+ /** @type {!number} */
+ var v_8;
+ /** @type {!number} */
+ var v_9;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!boolean} */
+ var lab2;
+ /** @type {!boolean} */
+ var lab3;
+ /** @type {!boolean} */
+ var lab4;
+ /** @type {!boolean} */
+ var lab5;
+ /** @type {!boolean} */
+ var lab6;
+ /** @type {!boolean} */
+ var lab7;
+ /** @type {!boolean} */
+ var lab8;
+ /** @type {!boolean} */
+ var lab9;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var limit$0;
+ /** @type {!number} */
+ var cursor$1;
+ /** @type {!number} */
+ var limit$1;
+ /** @type {!number} */
+ var cursor$2;
+ /** @type {!number} */
+ var limit$2;
+ /** @type {!number} */
+ var cursor$3;
+ /** @type {!number} */
+ var limit$3;
+ /** @type {!number} */
+ var cursor$4;
+ /** @type {!number} */
+ var limit$4;
+ /** @type {!number} */
+ var cursor$5;
+ /** @type {!number} */
+ var limit$5;
+ /** @type {!number} */
+ var cursor$6;
+ /** @type {!number} */
+ var limit$6;
+ /** @type {!number} */
+ var cursor$7;
+ /** @type {!number} */
+ var limit$7;
+ /** @type {!number} */
+ var cursor$8;
+ v_1 = this.cursor;
+ lab0 = true;
+lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ if (! this.r_mark_regions$()) {
+ break lab0;
+ }
+ }
+ cursor$0 = this.cursor = v_1;
+ this.limit_backward = cursor$0;
+ cursor$1 = this.cursor = limit$0 = this.limit;
+ v_2 = limit$0 - cursor$1;
+ lab1 = true;
+lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ if (! this.r_instrum$()) {
+ break lab1;
+ }
+ }
+ cursor$2 = this.cursor = (limit$1 = this.limit) - v_2;
+ v_3 = limit$1 - cursor$2;
+ lab2 = true;
+lab2:
+ while (lab2 === true) {
+ lab2 = false;
+ if (! this.r_case$()) {
+ break lab2;
+ }
+ }
+ cursor$3 = this.cursor = (limit$2 = this.limit) - v_3;
+ v_4 = limit$2 - cursor$3;
+ lab3 = true;
+lab3:
+ while (lab3 === true) {
+ lab3 = false;
+ if (! this.r_case_special$()) {
+ break lab3;
+ }
+ }
+ cursor$4 = this.cursor = (limit$3 = this.limit) - v_4;
+ v_5 = limit$3 - cursor$4;
+ lab4 = true;
+lab4:
+ while (lab4 === true) {
+ lab4 = false;
+ if (! this.r_case_other$()) {
+ break lab4;
+ }
+ }
+ cursor$5 = this.cursor = (limit$4 = this.limit) - v_5;
+ v_6 = limit$4 - cursor$5;
+ lab5 = true;
+lab5:
+ while (lab5 === true) {
+ lab5 = false;
+ if (! this.r_factive$()) {
+ break lab5;
+ }
+ }
+ cursor$6 = this.cursor = (limit$5 = this.limit) - v_6;
+ v_7 = limit$5 - cursor$6;
+ lab6 = true;
+lab6:
+ while (lab6 === true) {
+ lab6 = false;
+ if (! this.r_owned$()) {
+ break lab6;
+ }
+ }
+ cursor$7 = this.cursor = (limit$6 = this.limit) - v_7;
+ v_8 = limit$6 - cursor$7;
+ lab7 = true;
+lab7:
+ while (lab7 === true) {
+ lab7 = false;
+ if (! this.r_sing_owner$()) {
+ break lab7;
+ }
+ }
+ cursor$8 = this.cursor = (limit$7 = this.limit) - v_8;
+ v_9 = limit$7 - cursor$8;
+ lab8 = true;
+lab8:
+ while (lab8 === true) {
+ lab8 = false;
+ if (! this.r_plur_owner$()) {
+ break lab8;
+ }
+ }
+ this.cursor = this.limit - v_9;
+ lab9 = true;
+lab9:
+ while (lab9 === true) {
+ lab9 = false;
+ if (! this.r_plural$()) {
+ break lab9;
+ }
+ }
+ this.cursor = this.limit_backward;
+ return true;
+};
+
+/**
+ * @param {*} o
+ * @return {!boolean}
+ */
+HungarianStemmer.prototype.equals$X = function (o) {
+ return o instanceof HungarianStemmer;
+};
+
+/**
+ * @return {!number}
+ */
+HungarianStemmer.prototype.hashCode$ = function () {
+ /** @type {!string} */
+ var classname;
+ /** @type {!number} */
+ var hash;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var char;
+ classname = "HungarianStemmer";
+ hash = 0;
+ if ("HungarianStemmer".length === 0) {
+ return (hash | 0);
+ }
+ for (i = 0; i < classname.length; i++) {
+ char = classname.charCodeAt(i);
+ hash = (hash << 5) - hash + char;
+ hash = hash & hash;
+ }
+ return (hash | 0);
+};
+
+/**
+ * class GermanStemmer extends BaseStemmer
+ * @constructor
+ */
+function GermanStemmer() {
+}
+
+GermanStemmer.prototype = new BaseStemmer;
+/**
+ * @constructor
+ */
+function GermanStemmer$() {
+ BaseStemmer$.call(this);
+ this.I_x = 0;
+ this.I_p2 = 0;
+ this.I_p1 = 0;
+};
+
+GermanStemmer$.prototype = new GermanStemmer;
+
+/**
+ * @param {GermanStemmer} other
+ */
+GermanStemmer.prototype.copy_from$LGermanStemmer$ = function (other) {
+ this.I_x = other.I_x;
+ this.I_p2 = other.I_p2;
+ this.I_p1 = other.I_p1;
+ BaseStemmer.prototype.copy_from$LBaseStemmer$.call(this, other);
+};
+
+/**
+ * @return {!boolean}
+ */
+GermanStemmer.prototype.r_prelude$ = function () {
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var v_3;
+ /** @type {!number} */
+ var v_4;
+ /** @type {!number} */
+ var v_5;
+ /** @type {!number} */
+ var v_6;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!boolean} */
+ var lab2;
+ /** @type {!boolean} */
+ var lab3;
+ /** @type {!boolean} */
+ var lab5;
+ /** @type {!boolean} */
+ var lab7;
+ /** @type {!boolean} */
+ var lab8;
+ /** @type {!boolean} */
+ var lab9;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var cursor$1;
+ v_1 = this.cursor;
+replab0:
+ while (true) {
+ v_2 = this.cursor;
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ lab2 = true;
+ lab2:
+ while (lab2 === true) {
+ lab2 = false;
+ v_3 = this.cursor;
+ lab3 = true;
+ lab3:
+ while (lab3 === true) {
+ lab3 = false;
+ this.bra = this.cursor;
+ if (! this.eq_s$IS(1, "\u00DF")) {
+ break lab3;
+ }
+ this.ket = this.cursor;
+ if (! this.slice_from$S("ss")) {
+ return false;
+ }
+ break lab2;
+ }
+ cursor$0 = this.cursor = v_3;
+ if (cursor$0 >= this.limit) {
+ break lab1;
+ }
+ this.cursor++;
+ }
+ continue replab0;
+ }
+ this.cursor = v_2;
+ break replab0;
+ }
+ this.cursor = v_1;
+replab4:
+ while (true) {
+ v_4 = this.cursor;
+ lab5 = true;
+ lab5:
+ while (lab5 === true) {
+ lab5 = false;
+ golab6:
+ while (true) {
+ v_5 = this.cursor;
+ lab7 = true;
+ lab7:
+ while (lab7 === true) {
+ lab7 = false;
+ if (! this.in_grouping$AIII(GermanStemmer.g_v, 97, 252)) {
+ break lab7;
+ }
+ this.bra = this.cursor;
+ lab8 = true;
+ lab8:
+ while (lab8 === true) {
+ lab8 = false;
+ v_6 = this.cursor;
+ lab9 = true;
+ lab9:
+ while (lab9 === true) {
+ lab9 = false;
+ if (! this.eq_s$IS(1, "u")) {
+ break lab9;
+ }
+ this.ket = this.cursor;
+ if (! this.in_grouping$AIII(GermanStemmer.g_v, 97, 252)) {
+ break lab9;
+ }
+ if (! this.slice_from$S("U")) {
+ return false;
+ }
+ break lab8;
+ }
+ this.cursor = v_6;
+ if (! this.eq_s$IS(1, "y")) {
+ break lab7;
+ }
+ this.ket = this.cursor;
+ if (! this.in_grouping$AIII(GermanStemmer.g_v, 97, 252)) {
+ break lab7;
+ }
+ if (! this.slice_from$S("Y")) {
+ return false;
+ }
+ }
+ this.cursor = v_5;
+ break golab6;
+ }
+ cursor$1 = this.cursor = v_5;
+ if (cursor$1 >= this.limit) {
+ break lab5;
+ }
+ this.cursor++;
+ }
+ continue replab4;
+ }
+ this.cursor = v_4;
+ break replab4;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+GermanStemmer.prototype.r_mark_regions$ = function () {
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var c;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!boolean} */
+ var lab3;
+ /** @type {!boolean} */
+ var lab4;
+ /** @type {!boolean} */
+ var lab6;
+ /** @type {!boolean} */
+ var lab8;
+ /** @type {!number} */
+ var limit$0;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var cursor$1;
+ this.I_p1 = limit$0 = this.limit;
+ this.I_p2 = limit$0;
+ v_1 = cursor$0 = this.cursor;
+ c = (cursor$0 + 3 | 0);
+ if (0 > c || c > limit$0) {
+ return false;
+ }
+ cursor$1 = this.cursor = c;
+ this.I_x = cursor$1;
+ this.cursor = v_1;
+golab0:
+ while (true) {
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ if (! this.in_grouping$AIII(GermanStemmer.g_v, 97, 252)) {
+ break lab1;
+ }
+ break golab0;
+ }
+ if (this.cursor >= this.limit) {
+ return false;
+ }
+ this.cursor++;
+ }
+golab2:
+ while (true) {
+ lab3 = true;
+ lab3:
+ while (lab3 === true) {
+ lab3 = false;
+ if (! this.out_grouping$AIII(GermanStemmer.g_v, 97, 252)) {
+ break lab3;
+ }
+ break golab2;
+ }
+ if (this.cursor >= this.limit) {
+ return false;
+ }
+ this.cursor++;
+ }
+ this.I_p1 = this.cursor;
+ lab4 = true;
+lab4:
+ while (lab4 === true) {
+ lab4 = false;
+ if (! (this.I_p1 < this.I_x)) {
+ break lab4;
+ }
+ this.I_p1 = this.I_x;
+ }
+golab5:
+ while (true) {
+ lab6 = true;
+ lab6:
+ while (lab6 === true) {
+ lab6 = false;
+ if (! this.in_grouping$AIII(GermanStemmer.g_v, 97, 252)) {
+ break lab6;
+ }
+ break golab5;
+ }
+ if (this.cursor >= this.limit) {
+ return false;
+ }
+ this.cursor++;
+ }
+golab7:
+ while (true) {
+ lab8 = true;
+ lab8:
+ while (lab8 === true) {
+ lab8 = false;
+ if (! this.out_grouping$AIII(GermanStemmer.g_v, 97, 252)) {
+ break lab8;
+ }
+ break golab7;
+ }
+ if (this.cursor >= this.limit) {
+ return false;
+ }
+ this.cursor++;
+ }
+ this.I_p2 = this.cursor;
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+GermanStemmer.prototype.r_postlude$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var v_1;
+ /** @type {!boolean} */
+ var lab1;
+replab0:
+ while (true) {
+ v_1 = this.cursor;
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ this.bra = this.cursor;
+ among_var = this.find_among$ALAmong$I(GermanStemmer.a_0, 6);
+ if (among_var === 0) {
+ break lab1;
+ }
+ this.ket = this.cursor;
+ switch (among_var) {
+ case 0:
+ break lab1;
+ case 1:
+ if (! this.slice_from$S("y")) {
+ return false;
+ }
+ break;
+ case 2:
+ if (! this.slice_from$S("u")) {
+ return false;
+ }
+ break;
+ case 3:
+ if (! this.slice_from$S("a")) {
+ return false;
+ }
+ break;
+ case 4:
+ if (! this.slice_from$S("o")) {
+ return false;
+ }
+ break;
+ case 5:
+ if (! this.slice_from$S("u")) {
+ return false;
+ }
+ break;
+ case 6:
+ if (this.cursor >= this.limit) {
+ break lab1;
+ }
+ this.cursor++;
+ break;
+ }
+ continue replab0;
+ }
+ this.cursor = v_1;
+ break replab0;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+GermanStemmer.prototype.r_R1$ = function () {
+ return (! (this.I_p1 <= this.cursor) ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+GermanStemmer.prototype.r_R2$ = function () {
+ return (! (this.I_p2 <= this.cursor) ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+GermanStemmer.prototype.r_standard_suffix$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var v_3;
+ /** @type {!number} */
+ var v_4;
+ /** @type {!number} */
+ var v_5;
+ /** @type {!number} */
+ var v_6;
+ /** @type {!number} */
+ var v_7;
+ /** @type {!number} */
+ var v_8;
+ /** @type {!number} */
+ var v_9;
+ /** @type {!number} */
+ var v_10;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!boolean} */
+ var lab2;
+ /** @type {!number} */
+ var c;
+ /** @type {!boolean} */
+ var lab3;
+ /** @type {!boolean} */
+ var lab4;
+ /** @type {!boolean} */
+ var lab5;
+ /** @type {!boolean} */
+ var lab6;
+ /** @type {!boolean} */
+ var lab7;
+ /** @type {!boolean} */
+ var lab8;
+ /** @type {!boolean} */
+ var lab9;
+ /** @type {!boolean} */
+ var lab10;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var cursor$1;
+ /** @type {!number} */
+ var limit$0;
+ /** @type {!number} */
+ var cursor$2;
+ /** @type {!number} */
+ var cursor$3;
+ /** @type {!number} */
+ var cursor$4;
+ /** @type {!number} */
+ var cursor$5;
+ /** @type {!number} */
+ var cursor$6;
+ /** @type {!number} */
+ var cursor$7;
+ /** @type {!number} */
+ var limit$1;
+ /** @type {!number} */
+ var cursor$8;
+ v_1 = this.limit - this.cursor;
+ lab0 = true;
+lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ this.ket = this.cursor;
+ among_var = this.find_among_b$ALAmong$I(GermanStemmer.a_1, 7);
+ if (among_var === 0) {
+ break lab0;
+ }
+ this.bra = cursor$0 = this.cursor;
+ if (! (! (this.I_p1 <= cursor$0) ? false : true)) {
+ break lab0;
+ }
+ switch (among_var) {
+ case 0:
+ break lab0;
+ case 1:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 2:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ v_2 = this.limit - this.cursor;
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ this.ket = this.cursor;
+ if (! this.eq_s_b$IS(1, "s")) {
+ this.cursor = this.limit - v_2;
+ break lab1;
+ }
+ this.bra = this.cursor;
+ if (! this.eq_s_b$IS(3, "nis")) {
+ this.cursor = this.limit - v_2;
+ break lab1;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ }
+ break;
+ case 3:
+ if (! this.in_grouping_b$AIII(GermanStemmer.g_s_ending, 98, 116)) {
+ break lab0;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ }
+ }
+ cursor$2 = this.cursor = (limit$0 = this.limit) - v_1;
+ v_3 = limit$0 - cursor$2;
+ lab2 = true;
+lab2:
+ while (lab2 === true) {
+ lab2 = false;
+ this.ket = this.cursor;
+ among_var = this.find_among_b$ALAmong$I(GermanStemmer.a_2, 4);
+ if (among_var === 0) {
+ break lab2;
+ }
+ this.bra = cursor$1 = this.cursor;
+ if (! (! (this.I_p1 <= cursor$1) ? false : true)) {
+ break lab2;
+ }
+ switch (among_var) {
+ case 0:
+ break lab2;
+ case 1:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 2:
+ if (! this.in_grouping_b$AIII(GermanStemmer.g_st_ending, 98, 116)) {
+ break lab2;
+ }
+ c = (this.cursor - 3 | 0);
+ if (this.limit_backward > c || c > this.limit) {
+ break lab2;
+ }
+ this.cursor = c;
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ }
+ }
+ cursor$8 = this.cursor = (limit$1 = this.limit) - v_3;
+ v_4 = limit$1 - cursor$8;
+ lab3 = true;
+lab3:
+ while (lab3 === true) {
+ lab3 = false;
+ this.ket = this.cursor;
+ among_var = this.find_among_b$ALAmong$I(GermanStemmer.a_4, 8);
+ if (among_var === 0) {
+ break lab3;
+ }
+ this.bra = cursor$3 = this.cursor;
+ if (! (! (this.I_p2 <= cursor$3) ? false : true)) {
+ break lab3;
+ }
+ switch (among_var) {
+ case 0:
+ break lab3;
+ case 1:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ v_5 = this.limit - this.cursor;
+ lab4 = true;
+ lab4:
+ while (lab4 === true) {
+ lab4 = false;
+ this.ket = this.cursor;
+ if (! this.eq_s_b$IS(2, "ig")) {
+ this.cursor = this.limit - v_5;
+ break lab4;
+ }
+ this.bra = cursor$4 = this.cursor;
+ v_6 = this.limit - cursor$4;
+ lab5 = true;
+ lab5:
+ while (lab5 === true) {
+ lab5 = false;
+ if (! this.eq_s_b$IS(1, "e")) {
+ break lab5;
+ }
+ this.cursor = this.limit - v_5;
+ break lab4;
+ }
+ cursor$5 = this.cursor = this.limit - v_6;
+ if (! (! (this.I_p2 <= cursor$5) ? false : true)) {
+ this.cursor = this.limit - v_5;
+ break lab4;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ }
+ break;
+ case 2:
+ v_7 = this.limit - this.cursor;
+ lab6 = true;
+ lab6:
+ while (lab6 === true) {
+ lab6 = false;
+ if (! this.eq_s_b$IS(1, "e")) {
+ break lab6;
+ }
+ break lab3;
+ }
+ this.cursor = this.limit - v_7;
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 3:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ v_8 = this.limit - this.cursor;
+ lab7 = true;
+ lab7:
+ while (lab7 === true) {
+ lab7 = false;
+ this.ket = this.cursor;
+ lab8 = true;
+ lab8:
+ while (lab8 === true) {
+ lab8 = false;
+ v_9 = this.limit - this.cursor;
+ lab9 = true;
+ lab9:
+ while (lab9 === true) {
+ lab9 = false;
+ if (! this.eq_s_b$IS(2, "er")) {
+ break lab9;
+ }
+ break lab8;
+ }
+ this.cursor = this.limit - v_9;
+ if (! this.eq_s_b$IS(2, "en")) {
+ this.cursor = this.limit - v_8;
+ break lab7;
+ }
+ }
+ this.bra = cursor$6 = this.cursor;
+ if (! (! (this.I_p1 <= cursor$6) ? false : true)) {
+ this.cursor = this.limit - v_8;
+ break lab7;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ }
+ break;
+ case 4:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ v_10 = this.limit - this.cursor;
+ lab10 = true;
+ lab10:
+ while (lab10 === true) {
+ lab10 = false;
+ this.ket = this.cursor;
+ among_var = this.find_among_b$ALAmong$I(GermanStemmer.a_3, 2);
+ if (among_var === 0) {
+ this.cursor = this.limit - v_10;
+ break lab10;
+ }
+ this.bra = cursor$7 = this.cursor;
+ if (! (! (this.I_p2 <= cursor$7) ? false : true)) {
+ this.cursor = this.limit - v_10;
+ break lab10;
+ }
+ switch (among_var) {
+ case 0:
+ this.cursor = this.limit - v_10;
+ break lab10;
+ case 1:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ }
+ }
+ break;
+ }
+ }
+ this.cursor = this.limit - v_4;
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+GermanStemmer.prototype.stem$ = function () {
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var v_4;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!boolean} */
+ var lab2;
+ /** @type {!boolean} */
+ var lab3;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var cursor$1;
+ /** @type {!number} */
+ var cursor$2;
+ v_1 = this.cursor;
+ lab0 = true;
+lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ if (! this.r_prelude$()) {
+ break lab0;
+ }
+ }
+ cursor$0 = this.cursor = v_1;
+ v_2 = cursor$0;
+ lab1 = true;
+lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ if (! this.r_mark_regions$()) {
+ break lab1;
+ }
+ }
+ cursor$1 = this.cursor = v_2;
+ this.limit_backward = cursor$1;
+ this.cursor = this.limit;
+ lab2 = true;
+lab2:
+ while (lab2 === true) {
+ lab2 = false;
+ if (! this.r_standard_suffix$()) {
+ break lab2;
+ }
+ }
+ cursor$2 = this.cursor = this.limit_backward;
+ v_4 = cursor$2;
+ lab3 = true;
+lab3:
+ while (lab3 === true) {
+ lab3 = false;
+ if (! this.r_postlude$()) {
+ break lab3;
+ }
+ }
+ this.cursor = v_4;
+ return true;
+};
+
+/**
+ * @param {*} o
+ * @return {!boolean}
+ */
+GermanStemmer.prototype.equals$X = function (o) {
+ return o instanceof GermanStemmer;
+};
+
+/**
+ * @return {!number}
+ */
+GermanStemmer.prototype.hashCode$ = function () {
+ /** @type {!string} */
+ var classname;
+ /** @type {!number} */
+ var hash;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var char;
+ classname = "GermanStemmer";
+ hash = 0;
+ if ("GermanStemmer".length === 0) {
+ return (hash | 0);
+ }
+ for (i = 0; i < classname.length; i++) {
+ char = classname.charCodeAt(i);
+ hash = (hash << 5) - hash + char;
+ hash = hash & hash;
+ }
+ return (hash | 0);
+};
+
+/**
+ * class FrenchStemmer extends BaseStemmer
+ * @constructor
+ */
+function FrenchStemmer() {
+}
+
+FrenchStemmer.prototype = new BaseStemmer;
+/**
+ * @constructor
+ */
+function FrenchStemmer$() {
+ BaseStemmer$.call(this);
+ this.I_p2 = 0;
+ this.I_p1 = 0;
+ this.I_pV = 0;
+};
+
+FrenchStemmer$.prototype = new FrenchStemmer;
+
+/**
+ * @param {FrenchStemmer} other
+ */
+FrenchStemmer.prototype.copy_from$LFrenchStemmer$ = function (other) {
+ this.I_p2 = other.I_p2;
+ this.I_p1 = other.I_p1;
+ this.I_pV = other.I_pV;
+ BaseStemmer.prototype.copy_from$LBaseStemmer$.call(this, other);
+};
+
+/**
+ * @return {!boolean}
+ */
+FrenchStemmer.prototype.r_prelude$ = function () {
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var v_3;
+ /** @type {!number} */
+ var v_4;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!boolean} */
+ var lab3;
+ /** @type {!boolean} */
+ var lab4;
+ /** @type {!boolean} */
+ var lab5;
+ /** @type {!boolean} */
+ var lab6;
+ /** @type {!boolean} */
+ var lab7;
+ /** @type {!boolean} */
+ var lab8;
+ /** @type {!boolean} */
+ var lab9;
+ /** @type {!number} */
+ var cursor$0;
+replab0:
+ while (true) {
+ v_1 = this.cursor;
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ golab2:
+ while (true) {
+ v_2 = this.cursor;
+ lab3 = true;
+ lab3:
+ while (lab3 === true) {
+ lab3 = false;
+ lab4 = true;
+ lab4:
+ while (lab4 === true) {
+ lab4 = false;
+ v_3 = this.cursor;
+ lab5 = true;
+ lab5:
+ while (lab5 === true) {
+ lab5 = false;
+ if (! this.in_grouping$AIII(FrenchStemmer.g_v, 97, 251)) {
+ break lab5;
+ }
+ this.bra = this.cursor;
+ lab6 = true;
+ lab6:
+ while (lab6 === true) {
+ lab6 = false;
+ v_4 = this.cursor;
+ lab7 = true;
+ lab7:
+ while (lab7 === true) {
+ lab7 = false;
+ if (! this.eq_s$IS(1, "u")) {
+ break lab7;
+ }
+ this.ket = this.cursor;
+ if (! this.in_grouping$AIII(FrenchStemmer.g_v, 97, 251)) {
+ break lab7;
+ }
+ if (! this.slice_from$S("U")) {
+ return false;
+ }
+ break lab6;
+ }
+ this.cursor = v_4;
+ lab8 = true;
+ lab8:
+ while (lab8 === true) {
+ lab8 = false;
+ if (! this.eq_s$IS(1, "i")) {
+ break lab8;
+ }
+ this.ket = this.cursor;
+ if (! this.in_grouping$AIII(FrenchStemmer.g_v, 97, 251)) {
+ break lab8;
+ }
+ if (! this.slice_from$S("I")) {
+ return false;
+ }
+ break lab6;
+ }
+ this.cursor = v_4;
+ if (! this.eq_s$IS(1, "y")) {
+ break lab5;
+ }
+ this.ket = this.cursor;
+ if (! this.slice_from$S("Y")) {
+ return false;
+ }
+ }
+ break lab4;
+ }
+ this.cursor = v_3;
+ lab9 = true;
+ lab9:
+ while (lab9 === true) {
+ lab9 = false;
+ this.bra = this.cursor;
+ if (! this.eq_s$IS(1, "y")) {
+ break lab9;
+ }
+ this.ket = this.cursor;
+ if (! this.in_grouping$AIII(FrenchStemmer.g_v, 97, 251)) {
+ break lab9;
+ }
+ if (! this.slice_from$S("Y")) {
+ return false;
+ }
+ break lab4;
+ }
+ this.cursor = v_3;
+ if (! this.eq_s$IS(1, "q")) {
+ break lab3;
+ }
+ this.bra = this.cursor;
+ if (! this.eq_s$IS(1, "u")) {
+ break lab3;
+ }
+ this.ket = this.cursor;
+ if (! this.slice_from$S("U")) {
+ return false;
+ }
+ }
+ this.cursor = v_2;
+ break golab2;
+ }
+ cursor$0 = this.cursor = v_2;
+ if (cursor$0 >= this.limit) {
+ break lab1;
+ }
+ this.cursor++;
+ }
+ continue replab0;
+ }
+ this.cursor = v_1;
+ break replab0;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+FrenchStemmer.prototype.r_mark_regions$ = function () {
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var v_4;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!boolean} */
+ var lab2;
+ /** @type {!boolean} */
+ var lab3;
+ /** @type {!boolean} */
+ var lab5;
+ /** @type {!boolean} */
+ var lab6;
+ /** @type {!boolean} */
+ var lab8;
+ /** @type {!boolean} */
+ var lab10;
+ /** @type {!boolean} */
+ var lab12;
+ /** @type {!boolean} */
+ var lab14;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var limit$0;
+ /** @type {!number} */
+ var cursor$1;
+ this.I_pV = limit$0 = this.limit;
+ this.I_p1 = limit$0;
+ this.I_p2 = limit$0;
+ v_1 = this.cursor;
+ lab0 = true;
+lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ v_2 = this.cursor;
+ lab2 = true;
+ lab2:
+ while (lab2 === true) {
+ lab2 = false;
+ if (! this.in_grouping$AIII(FrenchStemmer.g_v, 97, 251)) {
+ break lab2;
+ }
+ if (! this.in_grouping$AIII(FrenchStemmer.g_v, 97, 251)) {
+ break lab2;
+ }
+ if (this.cursor >= this.limit) {
+ break lab2;
+ }
+ this.cursor++;
+ break lab1;
+ }
+ this.cursor = v_2;
+ lab3 = true;
+ lab3:
+ while (lab3 === true) {
+ lab3 = false;
+ if (this.find_among$ALAmong$I(FrenchStemmer.a_0, 3) === 0) {
+ break lab3;
+ }
+ break lab1;
+ }
+ cursor$0 = this.cursor = v_2;
+ if (cursor$0 >= this.limit) {
+ break lab0;
+ }
+ this.cursor++;
+ golab4:
+ while (true) {
+ lab5 = true;
+ lab5:
+ while (lab5 === true) {
+ lab5 = false;
+ if (! this.in_grouping$AIII(FrenchStemmer.g_v, 97, 251)) {
+ break lab5;
+ }
+ break golab4;
+ }
+ if (this.cursor >= this.limit) {
+ break lab0;
+ }
+ this.cursor++;
+ }
+ }
+ this.I_pV = this.cursor;
+ }
+ cursor$1 = this.cursor = v_1;
+ v_4 = cursor$1;
+ lab6 = true;
+lab6:
+ while (lab6 === true) {
+ lab6 = false;
+ golab7:
+ while (true) {
+ lab8 = true;
+ lab8:
+ while (lab8 === true) {
+ lab8 = false;
+ if (! this.in_grouping$AIII(FrenchStemmer.g_v, 97, 251)) {
+ break lab8;
+ }
+ break golab7;
+ }
+ if (this.cursor >= this.limit) {
+ break lab6;
+ }
+ this.cursor++;
+ }
+ golab9:
+ while (true) {
+ lab10 = true;
+ lab10:
+ while (lab10 === true) {
+ lab10 = false;
+ if (! this.out_grouping$AIII(FrenchStemmer.g_v, 97, 251)) {
+ break lab10;
+ }
+ break golab9;
+ }
+ if (this.cursor >= this.limit) {
+ break lab6;
+ }
+ this.cursor++;
+ }
+ this.I_p1 = this.cursor;
+ golab11:
+ while (true) {
+ lab12 = true;
+ lab12:
+ while (lab12 === true) {
+ lab12 = false;
+ if (! this.in_grouping$AIII(FrenchStemmer.g_v, 97, 251)) {
+ break lab12;
+ }
+ break golab11;
+ }
+ if (this.cursor >= this.limit) {
+ break lab6;
+ }
+ this.cursor++;
+ }
+ golab13:
+ while (true) {
+ lab14 = true;
+ lab14:
+ while (lab14 === true) {
+ lab14 = false;
+ if (! this.out_grouping$AIII(FrenchStemmer.g_v, 97, 251)) {
+ break lab14;
+ }
+ break golab13;
+ }
+ if (this.cursor >= this.limit) {
+ break lab6;
+ }
+ this.cursor++;
+ }
+ this.I_p2 = this.cursor;
+ }
+ this.cursor = v_4;
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+FrenchStemmer.prototype.r_postlude$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var v_1;
+ /** @type {!boolean} */
+ var lab1;
+replab0:
+ while (true) {
+ v_1 = this.cursor;
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ this.bra = this.cursor;
+ among_var = this.find_among$ALAmong$I(FrenchStemmer.a_1, 4);
+ if (among_var === 0) {
+ break lab1;
+ }
+ this.ket = this.cursor;
+ switch (among_var) {
+ case 0:
+ break lab1;
+ case 1:
+ if (! this.slice_from$S("i")) {
+ return false;
+ }
+ break;
+ case 2:
+ if (! this.slice_from$S("u")) {
+ return false;
+ }
+ break;
+ case 3:
+ if (! this.slice_from$S("y")) {
+ return false;
+ }
+ break;
+ case 4:
+ if (this.cursor >= this.limit) {
+ break lab1;
+ }
+ this.cursor++;
+ break;
+ }
+ continue replab0;
+ }
+ this.cursor = v_1;
+ break replab0;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+FrenchStemmer.prototype.r_RV$ = function () {
+ return (! (this.I_pV <= this.cursor) ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+FrenchStemmer.prototype.r_R1$ = function () {
+ return (! (this.I_p1 <= this.cursor) ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+FrenchStemmer.prototype.r_R2$ = function () {
+ return (! (this.I_p2 <= this.cursor) ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+FrenchStemmer.prototype.r_standard_suffix$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var v_3;
+ /** @type {!number} */
+ var v_4;
+ /** @type {!number} */
+ var v_5;
+ /** @type {!number} */
+ var v_6;
+ /** @type {!number} */
+ var v_7;
+ /** @type {!number} */
+ var v_8;
+ /** @type {!number} */
+ var v_9;
+ /** @type {!number} */
+ var v_10;
+ /** @type {!number} */
+ var v_11;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!boolean} */
+ var lab2;
+ /** @type {!boolean} */
+ var lab3;
+ /** @type {!boolean} */
+ var lab4;
+ /** @type {!boolean} */
+ var lab5;
+ /** @type {!boolean} */
+ var lab6;
+ /** @type {!boolean} */
+ var lab7;
+ /** @type {!boolean} */
+ var lab8;
+ /** @type {!boolean} */
+ var lab9;
+ /** @type {!boolean} */
+ var lab10;
+ /** @type {!boolean} */
+ var lab11;
+ /** @type {!boolean} */
+ var lab12;
+ /** @type {!boolean} */
+ var lab13;
+ /** @type {!boolean} */
+ var lab14;
+ /** @type {!boolean} */
+ var lab15;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var cursor$1;
+ /** @type {!number} */
+ var cursor$2;
+ /** @type {!number} */
+ var cursor$3;
+ this.ket = this.cursor;
+ among_var = this.find_among_b$ALAmong$I(FrenchStemmer.a_4, 43);
+ if (among_var === 0) {
+ return false;
+ }
+ this.bra = this.cursor;
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ if (! (! (this.I_p2 <= this.cursor) ? false : true)) {
+ return false;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 2:
+ if (! (! (this.I_p2 <= this.cursor) ? false : true)) {
+ return false;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ v_1 = this.limit - this.cursor;
+ lab0 = true;
+ lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ this.ket = this.cursor;
+ if (! this.eq_s_b$IS(2, "ic")) {
+ this.cursor = this.limit - v_1;
+ break lab0;
+ }
+ this.bra = this.cursor;
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ v_2 = this.limit - this.cursor;
+ lab2 = true;
+ lab2:
+ while (lab2 === true) {
+ lab2 = false;
+ if (! (! (this.I_p2 <= this.cursor) ? false : true)) {
+ break lab2;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break lab1;
+ }
+ this.cursor = this.limit - v_2;
+ if (! this.slice_from$S("iqU")) {
+ return false;
+ }
+ }
+ }
+ break;
+ case 3:
+ if (! (! (this.I_p2 <= this.cursor) ? false : true)) {
+ return false;
+ }
+ if (! this.slice_from$S("log")) {
+ return false;
+ }
+ break;
+ case 4:
+ if (! (! (this.I_p2 <= this.cursor) ? false : true)) {
+ return false;
+ }
+ if (! this.slice_from$S("u")) {
+ return false;
+ }
+ break;
+ case 5:
+ if (! (! (this.I_p2 <= this.cursor) ? false : true)) {
+ return false;
+ }
+ if (! this.slice_from$S("ent")) {
+ return false;
+ }
+ break;
+ case 6:
+ if (! (! (this.I_pV <= this.cursor) ? false : true)) {
+ return false;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ v_3 = this.limit - this.cursor;
+ lab3 = true;
+ lab3:
+ while (lab3 === true) {
+ lab3 = false;
+ this.ket = this.cursor;
+ among_var = this.find_among_b$ALAmong$I(FrenchStemmer.a_2, 6);
+ if (among_var === 0) {
+ this.cursor = this.limit - v_3;
+ break lab3;
+ }
+ this.bra = this.cursor;
+ switch (among_var) {
+ case 0:
+ this.cursor = this.limit - v_3;
+ break lab3;
+ case 1:
+ if (! (! (this.I_p2 <= this.cursor) ? false : true)) {
+ this.cursor = this.limit - v_3;
+ break lab3;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ this.ket = this.cursor;
+ if (! this.eq_s_b$IS(2, "at")) {
+ this.cursor = this.limit - v_3;
+ break lab3;
+ }
+ this.bra = cursor$0 = this.cursor;
+ if (! (! (this.I_p2 <= cursor$0) ? false : true)) {
+ this.cursor = this.limit - v_3;
+ break lab3;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 2:
+ lab4 = true;
+ lab4:
+ while (lab4 === true) {
+ lab4 = false;
+ v_4 = this.limit - this.cursor;
+ lab5 = true;
+ lab5:
+ while (lab5 === true) {
+ lab5 = false;
+ if (! (! (this.I_p2 <= this.cursor) ? false : true)) {
+ break lab5;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break lab4;
+ }
+ cursor$1 = this.cursor = this.limit - v_4;
+ if (! (! (this.I_p1 <= cursor$1) ? false : true)) {
+ this.cursor = this.limit - v_3;
+ break lab3;
+ }
+ if (! this.slice_from$S("eux")) {
+ return false;
+ }
+ }
+ break;
+ case 3:
+ if (! (! (this.I_p2 <= this.cursor) ? false : true)) {
+ this.cursor = this.limit - v_3;
+ break lab3;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 4:
+ if (! (! (this.I_pV <= this.cursor) ? false : true)) {
+ this.cursor = this.limit - v_3;
+ break lab3;
+ }
+ if (! this.slice_from$S("i")) {
+ return false;
+ }
+ break;
+ }
+ }
+ break;
+ case 7:
+ if (! (! (this.I_p2 <= this.cursor) ? false : true)) {
+ return false;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ v_5 = this.limit - this.cursor;
+ lab6 = true;
+ lab6:
+ while (lab6 === true) {
+ lab6 = false;
+ this.ket = this.cursor;
+ among_var = this.find_among_b$ALAmong$I(FrenchStemmer.a_3, 3);
+ if (among_var === 0) {
+ this.cursor = this.limit - v_5;
+ break lab6;
+ }
+ this.bra = this.cursor;
+ switch (among_var) {
+ case 0:
+ this.cursor = this.limit - v_5;
+ break lab6;
+ case 1:
+ lab7 = true;
+ lab7:
+ while (lab7 === true) {
+ lab7 = false;
+ v_6 = this.limit - this.cursor;
+ lab8 = true;
+ lab8:
+ while (lab8 === true) {
+ lab8 = false;
+ if (! (! (this.I_p2 <= this.cursor) ? false : true)) {
+ break lab8;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break lab7;
+ }
+ this.cursor = this.limit - v_6;
+ if (! this.slice_from$S("abl")) {
+ return false;
+ }
+ }
+ break;
+ case 2:
+ lab9 = true;
+ lab9:
+ while (lab9 === true) {
+ lab9 = false;
+ v_7 = this.limit - this.cursor;
+ lab10 = true;
+ lab10:
+ while (lab10 === true) {
+ lab10 = false;
+ if (! (! (this.I_p2 <= this.cursor) ? false : true)) {
+ break lab10;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break lab9;
+ }
+ this.cursor = this.limit - v_7;
+ if (! this.slice_from$S("iqU")) {
+ return false;
+ }
+ }
+ break;
+ case 3:
+ if (! (! (this.I_p2 <= this.cursor) ? false : true)) {
+ this.cursor = this.limit - v_5;
+ break lab6;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ }
+ }
+ break;
+ case 8:
+ if (! (! (this.I_p2 <= this.cursor) ? false : true)) {
+ return false;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ v_8 = this.limit - this.cursor;
+ lab11 = true;
+ lab11:
+ while (lab11 === true) {
+ lab11 = false;
+ this.ket = this.cursor;
+ if (! this.eq_s_b$IS(2, "at")) {
+ this.cursor = this.limit - v_8;
+ break lab11;
+ }
+ this.bra = cursor$2 = this.cursor;
+ if (! (! (this.I_p2 <= cursor$2) ? false : true)) {
+ this.cursor = this.limit - v_8;
+ break lab11;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ this.ket = this.cursor;
+ if (! this.eq_s_b$IS(2, "ic")) {
+ this.cursor = this.limit - v_8;
+ break lab11;
+ }
+ this.bra = this.cursor;
+ lab12 = true;
+ lab12:
+ while (lab12 === true) {
+ lab12 = false;
+ v_9 = this.limit - this.cursor;
+ lab13 = true;
+ lab13:
+ while (lab13 === true) {
+ lab13 = false;
+ if (! (! (this.I_p2 <= this.cursor) ? false : true)) {
+ break lab13;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break lab12;
+ }
+ this.cursor = this.limit - v_9;
+ if (! this.slice_from$S("iqU")) {
+ return false;
+ }
+ }
+ }
+ break;
+ case 9:
+ if (! this.slice_from$S("eau")) {
+ return false;
+ }
+ break;
+ case 10:
+ if (! (! (this.I_p1 <= this.cursor) ? false : true)) {
+ return false;
+ }
+ if (! this.slice_from$S("al")) {
+ return false;
+ }
+ break;
+ case 11:
+ lab14 = true;
+ lab14:
+ while (lab14 === true) {
+ lab14 = false;
+ v_10 = this.limit - this.cursor;
+ lab15 = true;
+ lab15:
+ while (lab15 === true) {
+ lab15 = false;
+ if (! (! (this.I_p2 <= this.cursor) ? false : true)) {
+ break lab15;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break lab14;
+ }
+ cursor$3 = this.cursor = this.limit - v_10;
+ if (! (! (this.I_p1 <= cursor$3) ? false : true)) {
+ return false;
+ }
+ if (! this.slice_from$S("eux")) {
+ return false;
+ }
+ }
+ break;
+ case 12:
+ if (! (! (this.I_p1 <= this.cursor) ? false : true)) {
+ return false;
+ }
+ if (! this.out_grouping_b$AIII(FrenchStemmer.g_v, 97, 251)) {
+ return false;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 13:
+ if (! (! (this.I_pV <= this.cursor) ? false : true)) {
+ return false;
+ }
+ if (! this.slice_from$S("ant")) {
+ return false;
+ }
+ return false;
+ case 14:
+ if (! (! (this.I_pV <= this.cursor) ? false : true)) {
+ return false;
+ }
+ if (! this.slice_from$S("ent")) {
+ return false;
+ }
+ return false;
+ case 15:
+ v_11 = this.limit - this.cursor;
+ if (! this.in_grouping_b$AIII(FrenchStemmer.g_v, 97, 251)) {
+ return false;
+ }
+ if (! (! (this.I_pV <= this.cursor) ? false : true)) {
+ return false;
+ }
+ this.cursor = this.limit - v_11;
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ return false;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+FrenchStemmer.prototype.r_i_verb_suffix$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var cursor$1;
+ /** @type {!number} */
+ var cursor$2;
+ v_1 = this.limit - (cursor$0 = this.cursor);
+ if (cursor$0 < this.I_pV) {
+ return false;
+ }
+ cursor$1 = this.cursor = this.I_pV;
+ v_2 = this.limit_backward;
+ this.limit_backward = cursor$1;
+ cursor$2 = this.cursor = this.limit - v_1;
+ this.ket = cursor$2;
+ among_var = this.find_among_b$ALAmong$I(FrenchStemmer.a_5, 35);
+ if (among_var === 0) {
+ this.limit_backward = v_2;
+ return false;
+ }
+ this.bra = this.cursor;
+ switch (among_var) {
+ case 0:
+ this.limit_backward = v_2;
+ return false;
+ case 1:
+ if (! this.out_grouping_b$AIII(FrenchStemmer.g_v, 97, 251)) {
+ this.limit_backward = v_2;
+ return false;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ }
+ this.limit_backward = v_2;
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+FrenchStemmer.prototype.r_verb_suffix$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var v_3;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var cursor$1;
+ /** @type {!number} */
+ var cursor$2;
+ v_1 = this.limit - (cursor$0 = this.cursor);
+ if (cursor$0 < this.I_pV) {
+ return false;
+ }
+ cursor$1 = this.cursor = this.I_pV;
+ v_2 = this.limit_backward;
+ this.limit_backward = cursor$1;
+ cursor$2 = this.cursor = this.limit - v_1;
+ this.ket = cursor$2;
+ among_var = this.find_among_b$ALAmong$I(FrenchStemmer.a_6, 38);
+ if (among_var === 0) {
+ this.limit_backward = v_2;
+ return false;
+ }
+ this.bra = this.cursor;
+ switch (among_var) {
+ case 0:
+ this.limit_backward = v_2;
+ return false;
+ case 1:
+ if (! (! (this.I_p2 <= this.cursor) ? false : true)) {
+ this.limit_backward = v_2;
+ return false;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 2:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 3:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ v_3 = this.limit - this.cursor;
+ lab0 = true;
+ lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ this.ket = this.cursor;
+ if (! this.eq_s_b$IS(1, "e")) {
+ this.cursor = this.limit - v_3;
+ break lab0;
+ }
+ this.bra = this.cursor;
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ }
+ break;
+ }
+ this.limit_backward = v_2;
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+FrenchStemmer.prototype.r_residual_suffix$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var v_3;
+ /** @type {!number} */
+ var v_4;
+ /** @type {!number} */
+ var v_5;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!boolean} */
+ var lab2;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var cursor$1;
+ /** @type {!number} */
+ var cursor$2;
+ /** @type {!number} */
+ var cursor$3;
+ v_1 = this.limit - this.cursor;
+ lab0 = true;
+lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ this.ket = this.cursor;
+ if (! this.eq_s_b$IS(1, "s")) {
+ this.cursor = this.limit - v_1;
+ break lab0;
+ }
+ this.bra = cursor$0 = this.cursor;
+ v_2 = this.limit - cursor$0;
+ if (! this.out_grouping_b$AIII(FrenchStemmer.g_keep_with_s, 97, 232)) {
+ this.cursor = this.limit - v_1;
+ break lab0;
+ }
+ this.cursor = this.limit - v_2;
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ }
+ v_3 = this.limit - (cursor$1 = this.cursor);
+ if (cursor$1 < this.I_pV) {
+ return false;
+ }
+ cursor$2 = this.cursor = this.I_pV;
+ v_4 = this.limit_backward;
+ this.limit_backward = cursor$2;
+ cursor$3 = this.cursor = this.limit - v_3;
+ this.ket = cursor$3;
+ among_var = this.find_among_b$ALAmong$I(FrenchStemmer.a_7, 7);
+ if (among_var === 0) {
+ this.limit_backward = v_4;
+ return false;
+ }
+ this.bra = this.cursor;
+ switch (among_var) {
+ case 0:
+ this.limit_backward = v_4;
+ return false;
+ case 1:
+ if (! (! (this.I_p2 <= this.cursor) ? false : true)) {
+ this.limit_backward = v_4;
+ return false;
+ }
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ v_5 = this.limit - this.cursor;
+ lab2 = true;
+ lab2:
+ while (lab2 === true) {
+ lab2 = false;
+ if (! this.eq_s_b$IS(1, "s")) {
+ break lab2;
+ }
+ break lab1;
+ }
+ this.cursor = this.limit - v_5;
+ if (! this.eq_s_b$IS(1, "t")) {
+ this.limit_backward = v_4;
+ return false;
+ }
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 2:
+ if (! this.slice_from$S("i")) {
+ return false;
+ }
+ break;
+ case 3:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 4:
+ if (! this.eq_s_b$IS(2, "gu")) {
+ this.limit_backward = v_4;
+ return false;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ }
+ this.limit_backward = v_4;
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+FrenchStemmer.prototype.r_un_double$ = function () {
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var cursor$0;
+ v_1 = this.limit - this.cursor;
+ if (this.find_among_b$ALAmong$I(FrenchStemmer.a_8, 5) === 0) {
+ return false;
+ }
+ cursor$0 = this.cursor = this.limit - v_1;
+ this.ket = cursor$0;
+ if (cursor$0 <= this.limit_backward) {
+ return false;
+ }
+ this.cursor--;
+ this.bra = this.cursor;
+ return (! this.slice_from$S("") ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+FrenchStemmer.prototype.r_un_accent$ = function () {
+ /** @type {!number} */
+ var v_3;
+ /** @type {!number} */
+ var v_1;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!boolean} */
+ var lab2;
+ /** @type {!boolean} */
+ var lab3;
+ v_1 = 1;
+replab0:
+ while (true) {
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ if (! this.out_grouping_b$AIII(FrenchStemmer.g_v, 97, 251)) {
+ break lab1;
+ }
+ v_1--;
+ continue replab0;
+ }
+ break replab0;
+ }
+ if (v_1 > 0) {
+ return false;
+ }
+ this.ket = this.cursor;
+ lab2 = true;
+lab2:
+ while (lab2 === true) {
+ lab2 = false;
+ v_3 = this.limit - this.cursor;
+ lab3 = true;
+ lab3:
+ while (lab3 === true) {
+ lab3 = false;
+ if (! this.eq_s_b$IS(1, "\u00E9")) {
+ break lab3;
+ }
+ break lab2;
+ }
+ this.cursor = this.limit - v_3;
+ if (! this.eq_s_b$IS(1, "\u00E8")) {
+ return false;
+ }
+ }
+ this.bra = this.cursor;
+ return (! this.slice_from$S("e") ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+FrenchStemmer.prototype.stem$ = function () {
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var v_3;
+ /** @type {!number} */
+ var v_4;
+ /** @type {!number} */
+ var v_5;
+ /** @type {!number} */
+ var v_6;
+ /** @type {!number} */
+ var v_7;
+ /** @type {!number} */
+ var v_8;
+ /** @type {!number} */
+ var v_9;
+ /** @type {!number} */
+ var v_11;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!boolean} */
+ var lab2;
+ /** @type {!boolean} */
+ var lab3;
+ /** @type {!boolean} */
+ var lab4;
+ /** @type {!boolean} */
+ var lab5;
+ /** @type {!boolean} */
+ var lab6;
+ /** @type {!boolean} */
+ var lab7;
+ /** @type {!boolean} */
+ var lab8;
+ /** @type {!boolean} */
+ var lab9;
+ /** @type {!boolean} */
+ var lab10;
+ /** @type {!boolean} */
+ var lab11;
+ /** @type {!boolean} */
+ var lab12;
+ /** @type {!boolean} */
+ var lab13;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var limit$0;
+ /** @type {!number} */
+ var cursor$1;
+ /** @type {!number} */
+ var cursor$2;
+ /** @type {!number} */
+ var limit$1;
+ /** @type {!number} */
+ var cursor$3;
+ /** @type {!number} */
+ var limit$2;
+ /** @type {!number} */
+ var cursor$4;
+ /** @type {!number} */
+ var cursor$5;
+ v_1 = this.cursor;
+ lab0 = true;
+lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ if (! this.r_prelude$()) {
+ break lab0;
+ }
+ }
+ cursor$0 = this.cursor = v_1;
+ v_2 = cursor$0;
+ lab1 = true;
+lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ if (! this.r_mark_regions$()) {
+ break lab1;
+ }
+ }
+ cursor$2 = this.cursor = v_2;
+ this.limit_backward = cursor$2;
+ cursor$3 = this.cursor = limit$1 = this.limit;
+ v_3 = limit$1 - cursor$3;
+ lab2 = true;
+lab2:
+ while (lab2 === true) {
+ lab2 = false;
+ lab3 = true;
+ lab3:
+ while (lab3 === true) {
+ lab3 = false;
+ v_4 = this.limit - this.cursor;
+ lab4 = true;
+ lab4:
+ while (lab4 === true) {
+ lab4 = false;
+ v_5 = this.limit - this.cursor;
+ lab5 = true;
+ lab5:
+ while (lab5 === true) {
+ lab5 = false;
+ v_6 = this.limit - this.cursor;
+ lab6 = true;
+ lab6:
+ while (lab6 === true) {
+ lab6 = false;
+ if (! this.r_standard_suffix$()) {
+ break lab6;
+ }
+ break lab5;
+ }
+ this.cursor = this.limit - v_6;
+ lab7 = true;
+ lab7:
+ while (lab7 === true) {
+ lab7 = false;
+ if (! this.r_i_verb_suffix$()) {
+ break lab7;
+ }
+ break lab5;
+ }
+ this.cursor = this.limit - v_6;
+ if (! this.r_verb_suffix$()) {
+ break lab4;
+ }
+ }
+ cursor$1 = this.cursor = (limit$0 = this.limit) - v_5;
+ v_7 = limit$0 - cursor$1;
+ lab8 = true;
+ lab8:
+ while (lab8 === true) {
+ lab8 = false;
+ this.ket = this.cursor;
+ lab9 = true;
+ lab9:
+ while (lab9 === true) {
+ lab9 = false;
+ v_8 = this.limit - this.cursor;
+ lab10 = true;
+ lab10:
+ while (lab10 === true) {
+ lab10 = false;
+ if (! this.eq_s_b$IS(1, "Y")) {
+ break lab10;
+ }
+ this.bra = this.cursor;
+ if (! this.slice_from$S("i")) {
+ return false;
+ }
+ break lab9;
+ }
+ this.cursor = this.limit - v_8;
+ if (! this.eq_s_b$IS(1, "\u00E7")) {
+ this.cursor = this.limit - v_7;
+ break lab8;
+ }
+ this.bra = this.cursor;
+ if (! this.slice_from$S("c")) {
+ return false;
+ }
+ }
+ }
+ break lab3;
+ }
+ this.cursor = this.limit - v_4;
+ if (! this.r_residual_suffix$()) {
+ break lab2;
+ }
+ }
+ }
+ cursor$4 = this.cursor = (limit$2 = this.limit) - v_3;
+ v_9 = limit$2 - cursor$4;
+ lab11 = true;
+lab11:
+ while (lab11 === true) {
+ lab11 = false;
+ if (! this.r_un_double$()) {
+ break lab11;
+ }
+ }
+ this.cursor = this.limit - v_9;
+ lab12 = true;
+lab12:
+ while (lab12 === true) {
+ lab12 = false;
+ if (! this.r_un_accent$()) {
+ break lab12;
+ }
+ }
+ cursor$5 = this.cursor = this.limit_backward;
+ v_11 = cursor$5;
+ lab13 = true;
+lab13:
+ while (lab13 === true) {
+ lab13 = false;
+ if (! this.r_postlude$()) {
+ break lab13;
+ }
+ }
+ this.cursor = v_11;
+ return true;
+};
+
+/**
+ * @param {*} o
+ * @return {!boolean}
+ */
+FrenchStemmer.prototype.equals$X = function (o) {
+ return o instanceof FrenchStemmer;
+};
+
+/**
+ * @return {!number}
+ */
+FrenchStemmer.prototype.hashCode$ = function () {
+ /** @type {!string} */
+ var classname;
+ /** @type {!number} */
+ var hash;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var char;
+ classname = "FrenchStemmer";
+ hash = 0;
+ if ("FrenchStemmer".length === 0) {
+ return (hash | 0);
+ }
+ for (i = 0; i < classname.length; i++) {
+ char = classname.charCodeAt(i);
+ hash = (hash << 5) - hash + char;
+ hash = hash & hash;
+ }
+ return (hash | 0);
+};
+
+/**
+ * class FinnishStemmer extends BaseStemmer
+ * @constructor
+ */
+function FinnishStemmer() {
+}
+
+FinnishStemmer.prototype = new BaseStemmer;
+/**
+ * @constructor
+ */
+function FinnishStemmer$() {
+ BaseStemmer$.call(this);
+ this.B_ending_removed = false;
+ this.S_x = "";
+ this.I_p2 = 0;
+ this.I_p1 = 0;
+};
+
+FinnishStemmer$.prototype = new FinnishStemmer;
+
+/**
+ * @param {FinnishStemmer} other
+ */
+FinnishStemmer.prototype.copy_from$LFinnishStemmer$ = function (other) {
+ this.B_ending_removed = other.B_ending_removed;
+ this.S_x = other.S_x;
+ this.I_p2 = other.I_p2;
+ this.I_p1 = other.I_p1;
+ BaseStemmer.prototype.copy_from$LBaseStemmer$.call(this, other);
+};
+
+/**
+ * @return {!boolean}
+ */
+FinnishStemmer.prototype.r_mark_regions$ = function () {
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_3;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!boolean} */
+ var lab3;
+ /** @type {!boolean} */
+ var lab5;
+ /** @type {!boolean} */
+ var lab7;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var limit$0;
+ /** @type {!number} */
+ var cursor$1;
+ this.I_p1 = limit$0 = this.limit;
+ this.I_p2 = limit$0;
+golab0:
+ while (true) {
+ v_1 = this.cursor;
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ if (! this.in_grouping$AIII(FinnishStemmer.g_V1, 97, 246)) {
+ break lab1;
+ }
+ this.cursor = v_1;
+ break golab0;
+ }
+ cursor$0 = this.cursor = v_1;
+ if (cursor$0 >= this.limit) {
+ return false;
+ }
+ this.cursor++;
+ }
+golab2:
+ while (true) {
+ lab3 = true;
+ lab3:
+ while (lab3 === true) {
+ lab3 = false;
+ if (! this.out_grouping$AIII(FinnishStemmer.g_V1, 97, 246)) {
+ break lab3;
+ }
+ break golab2;
+ }
+ if (this.cursor >= this.limit) {
+ return false;
+ }
+ this.cursor++;
+ }
+ this.I_p1 = this.cursor;
+golab4:
+ while (true) {
+ v_3 = this.cursor;
+ lab5 = true;
+ lab5:
+ while (lab5 === true) {
+ lab5 = false;
+ if (! this.in_grouping$AIII(FinnishStemmer.g_V1, 97, 246)) {
+ break lab5;
+ }
+ this.cursor = v_3;
+ break golab4;
+ }
+ cursor$1 = this.cursor = v_3;
+ if (cursor$1 >= this.limit) {
+ return false;
+ }
+ this.cursor++;
+ }
+golab6:
+ while (true) {
+ lab7 = true;
+ lab7:
+ while (lab7 === true) {
+ lab7 = false;
+ if (! this.out_grouping$AIII(FinnishStemmer.g_V1, 97, 246)) {
+ break lab7;
+ }
+ break golab6;
+ }
+ if (this.cursor >= this.limit) {
+ return false;
+ }
+ this.cursor++;
+ }
+ this.I_p2 = this.cursor;
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+FinnishStemmer.prototype.r_R2$ = function () {
+ return (! (this.I_p2 <= this.cursor) ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+FinnishStemmer.prototype.r_particle_etc$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var cursor$1;
+ /** @type {!number} */
+ var cursor$2;
+ v_1 = this.limit - (cursor$0 = this.cursor);
+ if (cursor$0 < this.I_p1) {
+ return false;
+ }
+ cursor$1 = this.cursor = this.I_p1;
+ v_2 = this.limit_backward;
+ this.limit_backward = cursor$1;
+ cursor$2 = this.cursor = this.limit - v_1;
+ this.ket = cursor$2;
+ among_var = this.find_among_b$ALAmong$I(FinnishStemmer.a_0, 10);
+ if (among_var === 0) {
+ this.limit_backward = v_2;
+ return false;
+ }
+ this.bra = this.cursor;
+ this.limit_backward = v_2;
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ if (! this.in_grouping_b$AIII(FinnishStemmer.g_particle_end, 97, 246)) {
+ return false;
+ }
+ break;
+ case 2:
+ if (! (! (this.I_p2 <= this.cursor) ? false : true)) {
+ return false;
+ }
+ break;
+ }
+ return (! this.slice_from$S("") ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+FinnishStemmer.prototype.r_possessive$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var v_3;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var cursor$1;
+ /** @type {!number} */
+ var cursor$2;
+ v_1 = this.limit - (cursor$0 = this.cursor);
+ if (cursor$0 < this.I_p1) {
+ return false;
+ }
+ cursor$1 = this.cursor = this.I_p1;
+ v_2 = this.limit_backward;
+ this.limit_backward = cursor$1;
+ cursor$2 = this.cursor = this.limit - v_1;
+ this.ket = cursor$2;
+ among_var = this.find_among_b$ALAmong$I(FinnishStemmer.a_4, 9);
+ if (among_var === 0) {
+ this.limit_backward = v_2;
+ return false;
+ }
+ this.bra = this.cursor;
+ this.limit_backward = v_2;
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ v_3 = this.limit - this.cursor;
+ lab0 = true;
+ lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ if (! this.eq_s_b$IS(1, "k")) {
+ break lab0;
+ }
+ return false;
+ }
+ this.cursor = this.limit - v_3;
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 2:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ this.ket = this.cursor;
+ if (! this.eq_s_b$IS(3, "kse")) {
+ return false;
+ }
+ this.bra = this.cursor;
+ if (! this.slice_from$S("ksi")) {
+ return false;
+ }
+ break;
+ case 3:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 4:
+ if (this.find_among_b$ALAmong$I(FinnishStemmer.a_1, 6) === 0) {
+ return false;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 5:
+ if (this.find_among_b$ALAmong$I(FinnishStemmer.a_2, 6) === 0) {
+ return false;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 6:
+ if (this.find_among_b$ALAmong$I(FinnishStemmer.a_3, 2) === 0) {
+ return false;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+FinnishStemmer.prototype.r_LONG$ = function () {
+ return (this.find_among_b$ALAmong$I(FinnishStemmer.a_5, 7) === 0 ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+FinnishStemmer.prototype.r_VI$ = function () {
+ return (! this.eq_s_b$IS(1, "i") ? false : ! this.in_grouping_b$AIII(FinnishStemmer.g_V2, 97, 246) ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+FinnishStemmer.prototype.r_case_ending$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var v_3;
+ /** @type {!number} */
+ var v_4;
+ /** @type {!number} */
+ var v_5;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!boolean} */
+ var lab2;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var cursor$1;
+ /** @type {!number} */
+ var cursor$2;
+ /** @type {!number} */
+ var cursor$3;
+ v_1 = this.limit - (cursor$0 = this.cursor);
+ if (cursor$0 < this.I_p1) {
+ return false;
+ }
+ cursor$1 = this.cursor = this.I_p1;
+ v_2 = this.limit_backward;
+ this.limit_backward = cursor$1;
+ cursor$2 = this.cursor = this.limit - v_1;
+ this.ket = cursor$2;
+ among_var = this.find_among_b$ALAmong$I(FinnishStemmer.a_6, 30);
+ if (among_var === 0) {
+ this.limit_backward = v_2;
+ return false;
+ }
+ this.bra = this.cursor;
+ this.limit_backward = v_2;
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ if (! this.eq_s_b$IS(1, "a")) {
+ return false;
+ }
+ break;
+ case 2:
+ if (! this.eq_s_b$IS(1, "e")) {
+ return false;
+ }
+ break;
+ case 3:
+ if (! this.eq_s_b$IS(1, "i")) {
+ return false;
+ }
+ break;
+ case 4:
+ if (! this.eq_s_b$IS(1, "o")) {
+ return false;
+ }
+ break;
+ case 5:
+ if (! this.eq_s_b$IS(1, "\u00E4")) {
+ return false;
+ }
+ break;
+ case 6:
+ if (! this.eq_s_b$IS(1, "\u00F6")) {
+ return false;
+ }
+ break;
+ case 7:
+ v_3 = this.limit - this.cursor;
+ lab0 = true;
+ lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ v_4 = this.limit - this.cursor;
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ v_5 = this.limit - this.cursor;
+ lab2 = true;
+ lab2:
+ while (lab2 === true) {
+ lab2 = false;
+ if (! (this.find_among_b$ALAmong$I(FinnishStemmer.a_5, 7) === 0 ? false : true)) {
+ break lab2;
+ }
+ break lab1;
+ }
+ this.cursor = this.limit - v_5;
+ if (! this.eq_s_b$IS(2, "ie")) {
+ this.cursor = this.limit - v_3;
+ break lab0;
+ }
+ }
+ cursor$3 = this.cursor = this.limit - v_4;
+ if (cursor$3 <= this.limit_backward) {
+ this.cursor = this.limit - v_3;
+ break lab0;
+ }
+ this.cursor--;
+ this.bra = this.cursor;
+ }
+ break;
+ case 8:
+ if (! this.in_grouping_b$AIII(FinnishStemmer.g_V1, 97, 246)) {
+ return false;
+ }
+ if (! this.out_grouping_b$AIII(FinnishStemmer.g_V1, 97, 246)) {
+ return false;
+ }
+ break;
+ case 9:
+ if (! this.eq_s_b$IS(1, "e")) {
+ return false;
+ }
+ break;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ this.B_ending_removed = true;
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+FinnishStemmer.prototype.r_other_endings$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var v_3;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var cursor$1;
+ /** @type {!number} */
+ var cursor$2;
+ v_1 = this.limit - (cursor$0 = this.cursor);
+ if (cursor$0 < this.I_p2) {
+ return false;
+ }
+ cursor$1 = this.cursor = this.I_p2;
+ v_2 = this.limit_backward;
+ this.limit_backward = cursor$1;
+ cursor$2 = this.cursor = this.limit - v_1;
+ this.ket = cursor$2;
+ among_var = this.find_among_b$ALAmong$I(FinnishStemmer.a_7, 14);
+ if (among_var === 0) {
+ this.limit_backward = v_2;
+ return false;
+ }
+ this.bra = this.cursor;
+ this.limit_backward = v_2;
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ v_3 = this.limit - this.cursor;
+ lab0 = true;
+ lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ if (! this.eq_s_b$IS(2, "po")) {
+ break lab0;
+ }
+ return false;
+ }
+ this.cursor = this.limit - v_3;
+ break;
+ }
+ return (! this.slice_from$S("") ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+FinnishStemmer.prototype.r_i_plural$ = function () {
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var cursor$1;
+ /** @type {!number} */
+ var cursor$2;
+ v_1 = this.limit - (cursor$0 = this.cursor);
+ if (cursor$0 < this.I_p1) {
+ return false;
+ }
+ cursor$1 = this.cursor = this.I_p1;
+ v_2 = this.limit_backward;
+ this.limit_backward = cursor$1;
+ cursor$2 = this.cursor = this.limit - v_1;
+ this.ket = cursor$2;
+ if (this.find_among_b$ALAmong$I(FinnishStemmer.a_8, 2) === 0) {
+ this.limit_backward = v_2;
+ return false;
+ }
+ this.bra = this.cursor;
+ this.limit_backward = v_2;
+ return (! this.slice_from$S("") ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+FinnishStemmer.prototype.r_t_plural$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var v_3;
+ /** @type {!number} */
+ var v_4;
+ /** @type {!number} */
+ var v_5;
+ /** @type {!number} */
+ var v_6;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var cursor$1;
+ /** @type {!number} */
+ var cursor$2;
+ /** @type {!number} */
+ var cursor$3;
+ /** @type {!number} */
+ var cursor$4;
+ /** @type {!number} */
+ var cursor$5;
+ /** @type {!number} */
+ var cursor$6;
+ v_1 = this.limit - (cursor$0 = this.cursor);
+ if (cursor$0 < this.I_p1) {
+ return false;
+ }
+ cursor$1 = this.cursor = this.I_p1;
+ v_2 = this.limit_backward;
+ this.limit_backward = cursor$1;
+ cursor$2 = this.cursor = this.limit - v_1;
+ this.ket = cursor$2;
+ if (! this.eq_s_b$IS(1, "t")) {
+ this.limit_backward = v_2;
+ return false;
+ }
+ this.bra = cursor$3 = this.cursor;
+ v_3 = this.limit - cursor$3;
+ if (! this.in_grouping_b$AIII(FinnishStemmer.g_V1, 97, 246)) {
+ this.limit_backward = v_2;
+ return false;
+ }
+ this.cursor = this.limit - v_3;
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ this.limit_backward = v_2;
+ v_4 = this.limit - (cursor$4 = this.cursor);
+ if (cursor$4 < this.I_p2) {
+ return false;
+ }
+ cursor$5 = this.cursor = this.I_p2;
+ v_5 = this.limit_backward;
+ this.limit_backward = cursor$5;
+ cursor$6 = this.cursor = this.limit - v_4;
+ this.ket = cursor$6;
+ among_var = this.find_among_b$ALAmong$I(FinnishStemmer.a_9, 2);
+ if (among_var === 0) {
+ this.limit_backward = v_5;
+ return false;
+ }
+ this.bra = this.cursor;
+ this.limit_backward = v_5;
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ v_6 = this.limit - this.cursor;
+ lab0 = true;
+ lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ if (! this.eq_s_b$IS(2, "po")) {
+ break lab0;
+ }
+ return false;
+ }
+ this.cursor = this.limit - v_6;
+ break;
+ }
+ return (! this.slice_from$S("") ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+FinnishStemmer.prototype.r_tidy$ = function () {
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var v_3;
+ /** @type {!number} */
+ var v_4;
+ /** @type {!number} */
+ var v_5;
+ /** @type {!number} */
+ var v_6;
+ /** @type {!number} */
+ var v_7;
+ /** @type {!number} */
+ var v_8;
+ /** @type {!number} */
+ var v_9;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!boolean} */
+ var lab2;
+ /** @type {!boolean} */
+ var lab3;
+ /** @type {!boolean} */
+ var lab4;
+ /** @type {!boolean} */
+ var lab5;
+ /** @type {!boolean} */
+ var lab7;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var cursor$1;
+ /** @type {!number} */
+ var cursor$2;
+ /** @type {!number} */
+ var limit$0;
+ /** @type {!number} */
+ var cursor$3;
+ /** @type {!number} */
+ var limit$1;
+ /** @type {!number} */
+ var cursor$4;
+ /** @type {!number} */
+ var limit$2;
+ /** @type {!number} */
+ var cursor$5;
+ /** @type {!number} */
+ var limit$3;
+ /** @type {!number} */
+ var cursor$6;
+ /** @type {!number} */
+ var cursor$7;
+ /** @type {!number} */
+ var cursor$8;
+ /** @type {!string} */
+ var S_x$0;
+ v_1 = this.limit - (cursor$0 = this.cursor);
+ if (cursor$0 < this.I_p1) {
+ return false;
+ }
+ cursor$2 = this.cursor = this.I_p1;
+ v_2 = this.limit_backward;
+ this.limit_backward = cursor$2;
+ cursor$3 = this.cursor = (limit$0 = this.limit) - v_1;
+ v_3 = limit$0 - cursor$3;
+ lab0 = true;
+lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ v_4 = this.limit - this.cursor;
+ if (! (this.find_among_b$ALAmong$I(FinnishStemmer.a_5, 7) === 0 ? false : true)) {
+ break lab0;
+ }
+ cursor$1 = this.cursor = this.limit - v_4;
+ this.ket = cursor$1;
+ if (cursor$1 <= this.limit_backward) {
+ break lab0;
+ }
+ this.cursor--;
+ this.bra = this.cursor;
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ }
+ cursor$4 = this.cursor = (limit$1 = this.limit) - v_3;
+ v_5 = limit$1 - cursor$4;
+ lab1 = true;
+lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ this.ket = this.cursor;
+ if (! this.in_grouping_b$AIII(FinnishStemmer.g_AEI, 97, 228)) {
+ break lab1;
+ }
+ this.bra = this.cursor;
+ if (! this.out_grouping_b$AIII(FinnishStemmer.g_V1, 97, 246)) {
+ break lab1;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ }
+ cursor$5 = this.cursor = (limit$2 = this.limit) - v_5;
+ v_6 = limit$2 - cursor$5;
+ lab2 = true;
+lab2:
+ while (lab2 === true) {
+ lab2 = false;
+ this.ket = this.cursor;
+ if (! this.eq_s_b$IS(1, "j")) {
+ break lab2;
+ }
+ this.bra = this.cursor;
+ lab3 = true;
+ lab3:
+ while (lab3 === true) {
+ lab3 = false;
+ v_7 = this.limit - this.cursor;
+ lab4 = true;
+ lab4:
+ while (lab4 === true) {
+ lab4 = false;
+ if (! this.eq_s_b$IS(1, "o")) {
+ break lab4;
+ }
+ break lab3;
+ }
+ this.cursor = this.limit - v_7;
+ if (! this.eq_s_b$IS(1, "u")) {
+ break lab2;
+ }
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ }
+ cursor$6 = this.cursor = (limit$3 = this.limit) - v_6;
+ v_8 = limit$3 - cursor$6;
+ lab5 = true;
+lab5:
+ while (lab5 === true) {
+ lab5 = false;
+ this.ket = this.cursor;
+ if (! this.eq_s_b$IS(1, "o")) {
+ break lab5;
+ }
+ this.bra = this.cursor;
+ if (! this.eq_s_b$IS(1, "j")) {
+ break lab5;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ }
+ this.cursor = this.limit - v_8;
+ this.limit_backward = v_2;
+golab6:
+ while (true) {
+ v_9 = this.limit - this.cursor;
+ lab7 = true;
+ lab7:
+ while (lab7 === true) {
+ lab7 = false;
+ if (! this.out_grouping_b$AIII(FinnishStemmer.g_V1, 97, 246)) {
+ break lab7;
+ }
+ this.cursor = this.limit - v_9;
+ break golab6;
+ }
+ cursor$7 = this.cursor = this.limit - v_9;
+ if (cursor$7 <= this.limit_backward) {
+ return false;
+ }
+ this.cursor--;
+ }
+ this.ket = cursor$8 = this.cursor;
+ if (cursor$8 <= this.limit_backward) {
+ return false;
+ }
+ this.cursor--;
+ this.bra = this.cursor;
+ S_x$0 = this.S_x = this.slice_to$S(this.S_x);
+ return (S_x$0 === '' ? false : ! this.eq_v_b$S(this.S_x) ? false : ! this.slice_from$S("") ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+FinnishStemmer.prototype.stem$ = function () {
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var v_3;
+ /** @type {!number} */
+ var v_4;
+ /** @type {!number} */
+ var v_5;
+ /** @type {!number} */
+ var v_6;
+ /** @type {!number} */
+ var v_7;
+ /** @type {!number} */
+ var v_8;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!boolean} */
+ var lab2;
+ /** @type {!boolean} */
+ var lab3;
+ /** @type {!boolean} */
+ var lab4;
+ /** @type {!boolean} */
+ var lab5;
+ /** @type {!boolean} */
+ var lab6;
+ /** @type {!boolean} */
+ var lab7;
+ /** @type {!boolean} */
+ var lab8;
+ /** @type {!boolean} */
+ var lab9;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var limit$0;
+ /** @type {!number} */
+ var cursor$1;
+ /** @type {!number} */
+ var limit$1;
+ /** @type {!number} */
+ var cursor$2;
+ /** @type {!number} */
+ var limit$2;
+ /** @type {!number} */
+ var cursor$3;
+ /** @type {!number} */
+ var limit$3;
+ /** @type {!number} */
+ var cursor$4;
+ /** @type {!number} */
+ var limit$4;
+ /** @type {!number} */
+ var cursor$5;
+ v_1 = this.cursor;
+ lab0 = true;
+lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ if (! this.r_mark_regions$()) {
+ break lab0;
+ }
+ }
+ cursor$0 = this.cursor = v_1;
+ this.B_ending_removed = false;
+ this.limit_backward = cursor$0;
+ cursor$1 = this.cursor = limit$0 = this.limit;
+ v_2 = limit$0 - cursor$1;
+ lab1 = true;
+lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ if (! this.r_particle_etc$()) {
+ break lab1;
+ }
+ }
+ cursor$2 = this.cursor = (limit$1 = this.limit) - v_2;
+ v_3 = limit$1 - cursor$2;
+ lab2 = true;
+lab2:
+ while (lab2 === true) {
+ lab2 = false;
+ if (! this.r_possessive$()) {
+ break lab2;
+ }
+ }
+ cursor$3 = this.cursor = (limit$2 = this.limit) - v_3;
+ v_4 = limit$2 - cursor$3;
+ lab3 = true;
+lab3:
+ while (lab3 === true) {
+ lab3 = false;
+ if (! this.r_case_ending$()) {
+ break lab3;
+ }
+ }
+ cursor$4 = this.cursor = (limit$3 = this.limit) - v_4;
+ v_5 = limit$3 - cursor$4;
+ lab4 = true;
+lab4:
+ while (lab4 === true) {
+ lab4 = false;
+ if (! this.r_other_endings$()) {
+ break lab4;
+ }
+ }
+ this.cursor = this.limit - v_5;
+ lab5 = true;
+lab5:
+ while (lab5 === true) {
+ lab5 = false;
+ v_6 = this.limit - this.cursor;
+ lab6 = true;
+ lab6:
+ while (lab6 === true) {
+ lab6 = false;
+ if (! this.B_ending_removed) {
+ break lab6;
+ }
+ v_7 = this.limit - this.cursor;
+ lab7 = true;
+ lab7:
+ while (lab7 === true) {
+ lab7 = false;
+ if (! this.r_i_plural$()) {
+ break lab7;
+ }
+ }
+ this.cursor = this.limit - v_7;
+ break lab5;
+ }
+ cursor$5 = this.cursor = (limit$4 = this.limit) - v_6;
+ v_8 = limit$4 - cursor$5;
+ lab8 = true;
+ lab8:
+ while (lab8 === true) {
+ lab8 = false;
+ if (! this.r_t_plural$()) {
+ break lab8;
+ }
+ }
+ this.cursor = this.limit - v_8;
+ }
+ lab9 = true;
+lab9:
+ while (lab9 === true) {
+ lab9 = false;
+ if (! this.r_tidy$()) {
+ break lab9;
+ }
+ }
+ this.cursor = this.limit_backward;
+ return true;
+};
+
+/**
+ * @param {*} o
+ * @return {!boolean}
+ */
+FinnishStemmer.prototype.equals$X = function (o) {
+ return o instanceof FinnishStemmer;
+};
+
+/**
+ * @return {!number}
+ */
+FinnishStemmer.prototype.hashCode$ = function () {
+ /** @type {!string} */
+ var classname;
+ /** @type {!number} */
+ var hash;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var char;
+ classname = "FinnishStemmer";
+ hash = 0;
+ if ("FinnishStemmer".length === 0) {
+ return (hash | 0);
+ }
+ for (i = 0; i < classname.length; i++) {
+ char = classname.charCodeAt(i);
+ hash = (hash << 5) - hash + char;
+ hash = hash & hash;
+ }
+ return (hash | 0);
+};
+
+/**
+ * class EnglishStemmer extends BaseStemmer
+ * @constructor
+ */
+function EnglishStemmer() {
+}
+
+EnglishStemmer.prototype = new BaseStemmer;
+/**
+ * @constructor
+ */
+function EnglishStemmer$() {
+ BaseStemmer$.call(this);
+ this.B_Y_found = false;
+ this.I_p2 = 0;
+ this.I_p1 = 0;
+};
+
+EnglishStemmer$.prototype = new EnglishStemmer;
+
+/**
+ * @param {EnglishStemmer} other
+ */
+EnglishStemmer.prototype.copy_from$LEnglishStemmer$ = function (other) {
+ this.B_Y_found = other.B_Y_found;
+ this.I_p2 = other.I_p2;
+ this.I_p1 = other.I_p1;
+ BaseStemmer.prototype.copy_from$LBaseStemmer$.call(this, other);
+};
+
+/**
+ * @return {!boolean}
+ */
+EnglishStemmer.prototype.r_prelude$ = function () {
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var v_3;
+ /** @type {!number} */
+ var v_4;
+ /** @type {!number} */
+ var v_5;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!boolean} */
+ var lab2;
+ /** @type {!boolean} */
+ var lab4;
+ /** @type {!boolean} */
+ var lab6;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var cursor$1;
+ /** @type {!number} */
+ var cursor$2;
+ this.B_Y_found = false;
+ v_1 = this.cursor;
+ lab0 = true;
+lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ this.bra = this.cursor;
+ if (! this.eq_s$IS(1, "'")) {
+ break lab0;
+ }
+ this.ket = this.cursor;
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ }
+ cursor$0 = this.cursor = v_1;
+ v_2 = cursor$0;
+ lab1 = true;
+lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ this.bra = this.cursor;
+ if (! this.eq_s$IS(1, "y")) {
+ break lab1;
+ }
+ this.ket = this.cursor;
+ if (! this.slice_from$S("Y")) {
+ return false;
+ }
+ this.B_Y_found = true;
+ }
+ cursor$2 = this.cursor = v_2;
+ v_3 = cursor$2;
+ lab2 = true;
+lab2:
+ while (lab2 === true) {
+ lab2 = false;
+ replab3:
+ while (true) {
+ v_4 = this.cursor;
+ lab4 = true;
+ lab4:
+ while (lab4 === true) {
+ lab4 = false;
+ golab5:
+ while (true) {
+ v_5 = this.cursor;
+ lab6 = true;
+ lab6:
+ while (lab6 === true) {
+ lab6 = false;
+ if (! this.in_grouping$AIII(EnglishStemmer.g_v, 97, 121)) {
+ break lab6;
+ }
+ this.bra = this.cursor;
+ if (! this.eq_s$IS(1, "y")) {
+ break lab6;
+ }
+ this.ket = this.cursor;
+ this.cursor = v_5;
+ break golab5;
+ }
+ cursor$1 = this.cursor = v_5;
+ if (cursor$1 >= this.limit) {
+ break lab4;
+ }
+ this.cursor++;
+ }
+ if (! this.slice_from$S("Y")) {
+ return false;
+ }
+ this.B_Y_found = true;
+ continue replab3;
+ }
+ this.cursor = v_4;
+ break replab3;
+ }
+ }
+ this.cursor = v_3;
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+EnglishStemmer.prototype.r_mark_regions$ = function () {
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!boolean} */
+ var lab2;
+ /** @type {!boolean} */
+ var lab4;
+ /** @type {!boolean} */
+ var lab6;
+ /** @type {!boolean} */
+ var lab8;
+ /** @type {!boolean} */
+ var lab10;
+ /** @type {!number} */
+ var limit$0;
+ this.I_p1 = limit$0 = this.limit;
+ this.I_p2 = limit$0;
+ v_1 = this.cursor;
+ lab0 = true;
+lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ v_2 = this.cursor;
+ lab2 = true;
+ lab2:
+ while (lab2 === true) {
+ lab2 = false;
+ if (this.find_among$ALAmong$I(EnglishStemmer.a_0, 3) === 0) {
+ break lab2;
+ }
+ break lab1;
+ }
+ this.cursor = v_2;
+ golab3:
+ while (true) {
+ lab4 = true;
+ lab4:
+ while (lab4 === true) {
+ lab4 = false;
+ if (! this.in_grouping$AIII(EnglishStemmer.g_v, 97, 121)) {
+ break lab4;
+ }
+ break golab3;
+ }
+ if (this.cursor >= this.limit) {
+ break lab0;
+ }
+ this.cursor++;
+ }
+ golab5:
+ while (true) {
+ lab6 = true;
+ lab6:
+ while (lab6 === true) {
+ lab6 = false;
+ if (! this.out_grouping$AIII(EnglishStemmer.g_v, 97, 121)) {
+ break lab6;
+ }
+ break golab5;
+ }
+ if (this.cursor >= this.limit) {
+ break lab0;
+ }
+ this.cursor++;
+ }
+ }
+ this.I_p1 = this.cursor;
+ golab7:
+ while (true) {
+ lab8 = true;
+ lab8:
+ while (lab8 === true) {
+ lab8 = false;
+ if (! this.in_grouping$AIII(EnglishStemmer.g_v, 97, 121)) {
+ break lab8;
+ }
+ break golab7;
+ }
+ if (this.cursor >= this.limit) {
+ break lab0;
+ }
+ this.cursor++;
+ }
+ golab9:
+ while (true) {
+ lab10 = true;
+ lab10:
+ while (lab10 === true) {
+ lab10 = false;
+ if (! this.out_grouping$AIII(EnglishStemmer.g_v, 97, 121)) {
+ break lab10;
+ }
+ break golab9;
+ }
+ if (this.cursor >= this.limit) {
+ break lab0;
+ }
+ this.cursor++;
+ }
+ this.I_p2 = this.cursor;
+ }
+ this.cursor = v_1;
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+EnglishStemmer.prototype.r_shortv$ = function () {
+ /** @type {!number} */
+ var v_1;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!boolean} */
+ var lab1;
+ lab0 = true;
+lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ v_1 = this.limit - this.cursor;
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ if (! this.out_grouping_b$AIII(EnglishStemmer.g_v_WXY, 89, 121)) {
+ break lab1;
+ }
+ if (! this.in_grouping_b$AIII(EnglishStemmer.g_v, 97, 121)) {
+ break lab1;
+ }
+ if (! this.out_grouping_b$AIII(EnglishStemmer.g_v, 97, 121)) {
+ break lab1;
+ }
+ break lab0;
+ }
+ this.cursor = this.limit - v_1;
+ if (! this.out_grouping_b$AIII(EnglishStemmer.g_v, 97, 121)) {
+ return false;
+ }
+ if (! this.in_grouping_b$AIII(EnglishStemmer.g_v, 97, 121)) {
+ return false;
+ }
+ if (this.cursor > this.limit_backward) {
+ return false;
+ }
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+EnglishStemmer.prototype.r_R1$ = function () {
+ return (! (this.I_p1 <= this.cursor) ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+EnglishStemmer.prototype.r_R2$ = function () {
+ return (! (this.I_p2 <= this.cursor) ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+EnglishStemmer.prototype.r_Step_1a$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!boolean} */
+ var lab2;
+ /** @type {!number} */
+ var c;
+ /** @type {!boolean} */
+ var lab4;
+ v_1 = this.limit - this.cursor;
+ lab0 = true;
+lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ this.ket = this.cursor;
+ among_var = this.find_among_b$ALAmong$I(EnglishStemmer.a_1, 3);
+ if (among_var === 0) {
+ this.cursor = this.limit - v_1;
+ break lab0;
+ }
+ this.bra = this.cursor;
+ switch (among_var) {
+ case 0:
+ this.cursor = this.limit - v_1;
+ break lab0;
+ case 1:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ }
+ }
+ this.ket = this.cursor;
+ among_var = this.find_among_b$ALAmong$I(EnglishStemmer.a_2, 6);
+ if (among_var === 0) {
+ return false;
+ }
+ this.bra = this.cursor;
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ if (! this.slice_from$S("ss")) {
+ return false;
+ }
+ break;
+ case 2:
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ v_2 = this.limit - this.cursor;
+ lab2 = true;
+ lab2:
+ while (lab2 === true) {
+ lab2 = false;
+ c = (this.cursor - 2 | 0);
+ if (this.limit_backward > c || c > this.limit) {
+ break lab2;
+ }
+ this.cursor = c;
+ if (! this.slice_from$S("i")) {
+ return false;
+ }
+ break lab1;
+ }
+ this.cursor = this.limit - v_2;
+ if (! this.slice_from$S("ie")) {
+ return false;
+ }
+ }
+ break;
+ case 3:
+ if (this.cursor <= this.limit_backward) {
+ return false;
+ }
+ this.cursor--;
+ golab3:
+ while (true) {
+ lab4 = true;
+ lab4:
+ while (lab4 === true) {
+ lab4 = false;
+ if (! this.in_grouping_b$AIII(EnglishStemmer.g_v, 97, 121)) {
+ break lab4;
+ }
+ break golab3;
+ }
+ if (this.cursor <= this.limit_backward) {
+ return false;
+ }
+ this.cursor--;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+EnglishStemmer.prototype.r_Step_1b$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_3;
+ /** @type {!number} */
+ var v_4;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!number} */
+ var c;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var cursor$1;
+ /** @type {!number} */
+ var cursor$2;
+ this.ket = this.cursor;
+ among_var = this.find_among_b$ALAmong$I(EnglishStemmer.a_4, 6);
+ if (among_var === 0) {
+ return false;
+ }
+ this.bra = this.cursor;
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ if (! (! (this.I_p1 <= this.cursor) ? false : true)) {
+ return false;
+ }
+ if (! this.slice_from$S("ee")) {
+ return false;
+ }
+ break;
+ case 2:
+ v_1 = this.limit - this.cursor;
+ golab0:
+ while (true) {
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ if (! this.in_grouping_b$AIII(EnglishStemmer.g_v, 97, 121)) {
+ break lab1;
+ }
+ break golab0;
+ }
+ if (this.cursor <= this.limit_backward) {
+ return false;
+ }
+ this.cursor--;
+ }
+ this.cursor = this.limit - v_1;
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ v_3 = this.limit - this.cursor;
+ among_var = this.find_among_b$ALAmong$I(EnglishStemmer.a_3, 13);
+ if (among_var === 0) {
+ return false;
+ }
+ this.cursor = this.limit - v_3;
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ c = cursor$0 = this.cursor;
+ this.insert$IIS(cursor$0, cursor$0, "e");
+ this.cursor = c;
+ break;
+ case 2:
+ this.ket = cursor$1 = this.cursor;
+ if (cursor$1 <= this.limit_backward) {
+ return false;
+ }
+ this.cursor--;
+ this.bra = this.cursor;
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 3:
+ if (this.cursor !== this.I_p1) {
+ return false;
+ }
+ v_4 = this.limit - this.cursor;
+ if (! this.r_shortv$()) {
+ return false;
+ }
+ cursor$2 = this.cursor = this.limit - v_4;
+ c = cursor$2;
+ this.insert$IIS(cursor$2, cursor$2, "e");
+ this.cursor = cursor$2;
+ break;
+ }
+ break;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+EnglishStemmer.prototype.r_Step_1c$ = function () {
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!boolean} */
+ var lab2;
+ this.ket = this.cursor;
+ lab0 = true;
+lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ v_1 = this.limit - this.cursor;
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ if (! this.eq_s_b$IS(1, "y")) {
+ break lab1;
+ }
+ break lab0;
+ }
+ this.cursor = this.limit - v_1;
+ if (! this.eq_s_b$IS(1, "Y")) {
+ return false;
+ }
+ }
+ this.bra = this.cursor;
+ if (! this.out_grouping_b$AIII(EnglishStemmer.g_v, 97, 121)) {
+ return false;
+ }
+ v_2 = this.limit - this.cursor;
+ lab2 = true;
+lab2:
+ while (lab2 === true) {
+ lab2 = false;
+ if (this.cursor > this.limit_backward) {
+ break lab2;
+ }
+ return false;
+ }
+ this.cursor = this.limit - v_2;
+ return (! this.slice_from$S("i") ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+EnglishStemmer.prototype.r_Step_2$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var cursor$0;
+ this.ket = this.cursor;
+ among_var = this.find_among_b$ALAmong$I(EnglishStemmer.a_5, 24);
+ if (among_var === 0) {
+ return false;
+ }
+ this.bra = cursor$0 = this.cursor;
+ if (! (! (this.I_p1 <= cursor$0) ? false : true)) {
+ return false;
+ }
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ if (! this.slice_from$S("tion")) {
+ return false;
+ }
+ break;
+ case 2:
+ if (! this.slice_from$S("ence")) {
+ return false;
+ }
+ break;
+ case 3:
+ if (! this.slice_from$S("ance")) {
+ return false;
+ }
+ break;
+ case 4:
+ if (! this.slice_from$S("able")) {
+ return false;
+ }
+ break;
+ case 5:
+ if (! this.slice_from$S("ent")) {
+ return false;
+ }
+ break;
+ case 6:
+ if (! this.slice_from$S("ize")) {
+ return false;
+ }
+ break;
+ case 7:
+ if (! this.slice_from$S("ate")) {
+ return false;
+ }
+ break;
+ case 8:
+ if (! this.slice_from$S("al")) {
+ return false;
+ }
+ break;
+ case 9:
+ if (! this.slice_from$S("ful")) {
+ return false;
+ }
+ break;
+ case 10:
+ if (! this.slice_from$S("ous")) {
+ return false;
+ }
+ break;
+ case 11:
+ if (! this.slice_from$S("ive")) {
+ return false;
+ }
+ break;
+ case 12:
+ if (! this.slice_from$S("ble")) {
+ return false;
+ }
+ break;
+ case 13:
+ if (! this.eq_s_b$IS(1, "l")) {
+ return false;
+ }
+ if (! this.slice_from$S("og")) {
+ return false;
+ }
+ break;
+ case 14:
+ if (! this.slice_from$S("ful")) {
+ return false;
+ }
+ break;
+ case 15:
+ if (! this.slice_from$S("less")) {
+ return false;
+ }
+ break;
+ case 16:
+ if (! this.in_grouping_b$AIII(EnglishStemmer.g_valid_LI, 99, 116)) {
+ return false;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+EnglishStemmer.prototype.r_Step_3$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var cursor$0;
+ this.ket = this.cursor;
+ among_var = this.find_among_b$ALAmong$I(EnglishStemmer.a_6, 9);
+ if (among_var === 0) {
+ return false;
+ }
+ this.bra = cursor$0 = this.cursor;
+ if (! (! (this.I_p1 <= cursor$0) ? false : true)) {
+ return false;
+ }
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ if (! this.slice_from$S("tion")) {
+ return false;
+ }
+ break;
+ case 2:
+ if (! this.slice_from$S("ate")) {
+ return false;
+ }
+ break;
+ case 3:
+ if (! this.slice_from$S("al")) {
+ return false;
+ }
+ break;
+ case 4:
+ if (! this.slice_from$S("ic")) {
+ return false;
+ }
+ break;
+ case 5:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 6:
+ if (! (! (this.I_p2 <= this.cursor) ? false : true)) {
+ return false;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+EnglishStemmer.prototype.r_Step_4$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var v_1;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!number} */
+ var cursor$0;
+ this.ket = this.cursor;
+ among_var = this.find_among_b$ALAmong$I(EnglishStemmer.a_7, 18);
+ if (among_var === 0) {
+ return false;
+ }
+ this.bra = cursor$0 = this.cursor;
+ if (! (! (this.I_p2 <= cursor$0) ? false : true)) {
+ return false;
+ }
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 2:
+ lab0 = true;
+ lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ v_1 = this.limit - this.cursor;
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ if (! this.eq_s_b$IS(1, "s")) {
+ break lab1;
+ }
+ break lab0;
+ }
+ this.cursor = this.limit - v_1;
+ if (! this.eq_s_b$IS(1, "t")) {
+ return false;
+ }
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+EnglishStemmer.prototype.r_Step_5$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!boolean} */
+ var lab2;
+ /** @type {!number} */
+ var cursor$0;
+ this.ket = this.cursor;
+ among_var = this.find_among_b$ALAmong$I(EnglishStemmer.a_8, 2);
+ if (among_var === 0) {
+ return false;
+ }
+ this.bra = this.cursor;
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ lab0 = true;
+ lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ v_1 = this.limit - this.cursor;
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ if (! (! (this.I_p2 <= this.cursor) ? false : true)) {
+ break lab1;
+ }
+ break lab0;
+ }
+ cursor$0 = this.cursor = this.limit - v_1;
+ if (! (! (this.I_p1 <= cursor$0) ? false : true)) {
+ return false;
+ }
+ v_2 = this.limit - this.cursor;
+ lab2 = true;
+ lab2:
+ while (lab2 === true) {
+ lab2 = false;
+ if (! this.r_shortv$()) {
+ break lab2;
+ }
+ return false;
+ }
+ this.cursor = this.limit - v_2;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 2:
+ if (! (! (this.I_p2 <= this.cursor) ? false : true)) {
+ return false;
+ }
+ if (! this.eq_s_b$IS(1, "l")) {
+ return false;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+EnglishStemmer.prototype.r_exception2$ = function () {
+ /** @type {!number} */
+ var cursor$0;
+ this.ket = this.cursor;
+ if (this.find_among_b$ALAmong$I(EnglishStemmer.a_9, 8) === 0) {
+ return false;
+ }
+ this.bra = cursor$0 = this.cursor;
+ return (cursor$0 > this.limit_backward ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+EnglishStemmer.prototype.r_exception1$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var cursor$0;
+ this.bra = this.cursor;
+ among_var = this.find_among$ALAmong$I(EnglishStemmer.a_10, 18);
+ if (among_var === 0) {
+ return false;
+ }
+ this.ket = cursor$0 = this.cursor;
+ if (cursor$0 < this.limit) {
+ return false;
+ }
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ if (! this.slice_from$S("ski")) {
+ return false;
+ }
+ break;
+ case 2:
+ if (! this.slice_from$S("sky")) {
+ return false;
+ }
+ break;
+ case 3:
+ if (! this.slice_from$S("die")) {
+ return false;
+ }
+ break;
+ case 4:
+ if (! this.slice_from$S("lie")) {
+ return false;
+ }
+ break;
+ case 5:
+ if (! this.slice_from$S("tie")) {
+ return false;
+ }
+ break;
+ case 6:
+ if (! this.slice_from$S("idl")) {
+ return false;
+ }
+ break;
+ case 7:
+ if (! this.slice_from$S("gentl")) {
+ return false;
+ }
+ break;
+ case 8:
+ if (! this.slice_from$S("ugli")) {
+ return false;
+ }
+ break;
+ case 9:
+ if (! this.slice_from$S("earli")) {
+ return false;
+ }
+ break;
+ case 10:
+ if (! this.slice_from$S("onli")) {
+ return false;
+ }
+ break;
+ case 11:
+ if (! this.slice_from$S("singl")) {
+ return false;
+ }
+ break;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+EnglishStemmer.prototype.r_postlude$ = function () {
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!boolean} */
+ var lab3;
+ /** @type {!number} */
+ var cursor$0;
+ if (! this.B_Y_found) {
+ return false;
+ }
+replab0:
+ while (true) {
+ v_1 = this.cursor;
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ golab2:
+ while (true) {
+ v_2 = this.cursor;
+ lab3 = true;
+ lab3:
+ while (lab3 === true) {
+ lab3 = false;
+ this.bra = this.cursor;
+ if (! this.eq_s$IS(1, "Y")) {
+ break lab3;
+ }
+ this.ket = this.cursor;
+ this.cursor = v_2;
+ break golab2;
+ }
+ cursor$0 = this.cursor = v_2;
+ if (cursor$0 >= this.limit) {
+ break lab1;
+ }
+ this.cursor++;
+ }
+ if (! this.slice_from$S("y")) {
+ return false;
+ }
+ continue replab0;
+ }
+ this.cursor = v_1;
+ break replab0;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+EnglishStemmer.prototype.stem$ = function () {
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var v_3;
+ /** @type {!number} */
+ var v_4;
+ /** @type {!number} */
+ var v_5;
+ /** @type {!number} */
+ var v_6;
+ /** @type {!number} */
+ var v_7;
+ /** @type {!number} */
+ var v_8;
+ /** @type {!number} */
+ var v_9;
+ /** @type {!number} */
+ var v_10;
+ /** @type {!number} */
+ var v_11;
+ /** @type {!number} */
+ var v_12;
+ /** @type {!number} */
+ var v_13;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!boolean} */
+ var lab2;
+ /** @type {!boolean} */
+ var lab3;
+ /** @type {!number} */
+ var c;
+ /** @type {!boolean} */
+ var lab4;
+ /** @type {!boolean} */
+ var lab5;
+ /** @type {!boolean} */
+ var lab6;
+ /** @type {!boolean} */
+ var lab7;
+ /** @type {!boolean} */
+ var lab8;
+ /** @type {!boolean} */
+ var lab9;
+ /** @type {!boolean} */
+ var lab10;
+ /** @type {!boolean} */
+ var lab11;
+ /** @type {!boolean} */
+ var lab12;
+ /** @type {!boolean} */
+ var lab13;
+ /** @type {!boolean} */
+ var lab14;
+ /** @type {!boolean} */
+ var lab15;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var cursor$1;
+ /** @type {!number} */
+ var cursor$2;
+ /** @type {!number} */
+ var limit$0;
+ /** @type {!number} */
+ var cursor$3;
+ /** @type {!number} */
+ var limit$1;
+ /** @type {!number} */
+ var cursor$4;
+ /** @type {!number} */
+ var limit$2;
+ /** @type {!number} */
+ var cursor$5;
+ /** @type {!number} */
+ var limit$3;
+ /** @type {!number} */
+ var cursor$6;
+ /** @type {!number} */
+ var limit$4;
+ /** @type {!number} */
+ var cursor$7;
+ /** @type {!number} */
+ var limit$5;
+ /** @type {!number} */
+ var cursor$8;
+ /** @type {!number} */
+ var limit$6;
+ /** @type {!number} */
+ var cursor$9;
+ /** @type {!number} */
+ var cursor$10;
+ lab0 = true;
+lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ v_1 = this.cursor;
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ if (! this.r_exception1$()) {
+ break lab1;
+ }
+ break lab0;
+ }
+ this.cursor = v_1;
+ lab2 = true;
+ lab2:
+ while (lab2 === true) {
+ lab2 = false;
+ v_2 = this.cursor;
+ lab3 = true;
+ lab3:
+ while (lab3 === true) {
+ lab3 = false;
+ c = (this.cursor + 3 | 0);
+ if (0 > c || c > this.limit) {
+ break lab3;
+ }
+ this.cursor = c;
+ break lab2;
+ }
+ this.cursor = v_2;
+ break lab0;
+ }
+ cursor$0 = this.cursor = v_1;
+ v_3 = cursor$0;
+ lab4 = true;
+ lab4:
+ while (lab4 === true) {
+ lab4 = false;
+ if (! this.r_prelude$()) {
+ break lab4;
+ }
+ }
+ cursor$1 = this.cursor = v_3;
+ v_4 = cursor$1;
+ lab5 = true;
+ lab5:
+ while (lab5 === true) {
+ lab5 = false;
+ if (! this.r_mark_regions$()) {
+ break lab5;
+ }
+ }
+ cursor$2 = this.cursor = v_4;
+ this.limit_backward = cursor$2;
+ cursor$3 = this.cursor = limit$0 = this.limit;
+ v_5 = limit$0 - cursor$3;
+ lab6 = true;
+ lab6:
+ while (lab6 === true) {
+ lab6 = false;
+ if (! this.r_Step_1a$()) {
+ break lab6;
+ }
+ }
+ this.cursor = this.limit - v_5;
+ lab7 = true;
+ lab7:
+ while (lab7 === true) {
+ lab7 = false;
+ v_6 = this.limit - this.cursor;
+ lab8 = true;
+ lab8:
+ while (lab8 === true) {
+ lab8 = false;
+ if (! this.r_exception2$()) {
+ break lab8;
+ }
+ break lab7;
+ }
+ cursor$4 = this.cursor = (limit$1 = this.limit) - v_6;
+ v_7 = limit$1 - cursor$4;
+ lab9 = true;
+ lab9:
+ while (lab9 === true) {
+ lab9 = false;
+ if (! this.r_Step_1b$()) {
+ break lab9;
+ }
+ }
+ cursor$5 = this.cursor = (limit$2 = this.limit) - v_7;
+ v_8 = limit$2 - cursor$5;
+ lab10 = true;
+ lab10:
+ while (lab10 === true) {
+ lab10 = false;
+ if (! this.r_Step_1c$()) {
+ break lab10;
+ }
+ }
+ cursor$6 = this.cursor = (limit$3 = this.limit) - v_8;
+ v_9 = limit$3 - cursor$6;
+ lab11 = true;
+ lab11:
+ while (lab11 === true) {
+ lab11 = false;
+ if (! this.r_Step_2$()) {
+ break lab11;
+ }
+ }
+ cursor$7 = this.cursor = (limit$4 = this.limit) - v_9;
+ v_10 = limit$4 - cursor$7;
+ lab12 = true;
+ lab12:
+ while (lab12 === true) {
+ lab12 = false;
+ if (! this.r_Step_3$()) {
+ break lab12;
+ }
+ }
+ cursor$8 = this.cursor = (limit$5 = this.limit) - v_10;
+ v_11 = limit$5 - cursor$8;
+ lab13 = true;
+ lab13:
+ while (lab13 === true) {
+ lab13 = false;
+ if (! this.r_Step_4$()) {
+ break lab13;
+ }
+ }
+ cursor$9 = this.cursor = (limit$6 = this.limit) - v_11;
+ v_12 = limit$6 - cursor$9;
+ lab14 = true;
+ lab14:
+ while (lab14 === true) {
+ lab14 = false;
+ if (! this.r_Step_5$()) {
+ break lab14;
+ }
+ }
+ this.cursor = this.limit - v_12;
+ }
+ cursor$10 = this.cursor = this.limit_backward;
+ v_13 = cursor$10;
+ lab15 = true;
+ lab15:
+ while (lab15 === true) {
+ lab15 = false;
+ if (! this.r_postlude$()) {
+ break lab15;
+ }
+ }
+ this.cursor = v_13;
+ }
+ return true;
+};
+
+/**
+ * @param {*} o
+ * @return {!boolean}
+ */
+EnglishStemmer.prototype.equals$X = function (o) {
+ return o instanceof EnglishStemmer;
+};
+
+/**
+ * @return {!number}
+ */
+EnglishStemmer.prototype.hashCode$ = function () {
+ /** @type {!string} */
+ var classname;
+ /** @type {!number} */
+ var hash;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var char;
+ classname = "EnglishStemmer";
+ hash = 0;
+ if ("EnglishStemmer".length === 0) {
+ return (hash | 0);
+ }
+ for (i = 0; i < classname.length; i++) {
+ char = classname.charCodeAt(i);
+ hash = (hash << 5) - hash + char;
+ hash = hash & hash;
+ }
+ return (hash | 0);
+};
+
+/**
+ * class DutchStemmer extends BaseStemmer
+ * @constructor
+ */
+function DutchStemmer() {
+}
+
+DutchStemmer.prototype = new BaseStemmer;
+/**
+ * @constructor
+ */
+function DutchStemmer$() {
+ BaseStemmer$.call(this);
+ this.I_p2 = 0;
+ this.I_p1 = 0;
+ this.B_e_found = false;
+};
+
+DutchStemmer$.prototype = new DutchStemmer;
+
+/**
+ * @param {DutchStemmer} other
+ */
+DutchStemmer.prototype.copy_from$LDutchStemmer$ = function (other) {
+ this.I_p2 = other.I_p2;
+ this.I_p1 = other.I_p1;
+ this.B_e_found = other.B_e_found;
+ BaseStemmer.prototype.copy_from$LBaseStemmer$.call(this, other);
+};
+
+/**
+ * @return {!boolean}
+ */
+DutchStemmer.prototype.r_prelude$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var v_3;
+ /** @type {!number} */
+ var v_4;
+ /** @type {!number} */
+ var v_5;
+ /** @type {!number} */
+ var v_6;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!boolean} */
+ var lab2;
+ /** @type {!boolean} */
+ var lab4;
+ /** @type {!boolean} */
+ var lab6;
+ /** @type {!boolean} */
+ var lab7;
+ /** @type {!boolean} */
+ var lab8;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var cursor$1;
+ v_1 = this.cursor;
+replab0:
+ while (true) {
+ v_2 = this.cursor;
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ this.bra = this.cursor;
+ among_var = this.find_among$ALAmong$I(DutchStemmer.a_0, 11);
+ if (among_var === 0) {
+ break lab1;
+ }
+ this.ket = this.cursor;
+ switch (among_var) {
+ case 0:
+ break lab1;
+ case 1:
+ if (! this.slice_from$S("a")) {
+ return false;
+ }
+ break;
+ case 2:
+ if (! this.slice_from$S("e")) {
+ return false;
+ }
+ break;
+ case 3:
+ if (! this.slice_from$S("i")) {
+ return false;
+ }
+ break;
+ case 4:
+ if (! this.slice_from$S("o")) {
+ return false;
+ }
+ break;
+ case 5:
+ if (! this.slice_from$S("u")) {
+ return false;
+ }
+ break;
+ case 6:
+ if (this.cursor >= this.limit) {
+ break lab1;
+ }
+ this.cursor++;
+ break;
+ }
+ continue replab0;
+ }
+ this.cursor = v_2;
+ break replab0;
+ }
+ cursor$0 = this.cursor = v_1;
+ v_3 = cursor$0;
+ lab2 = true;
+lab2:
+ while (lab2 === true) {
+ lab2 = false;
+ this.bra = this.cursor;
+ if (! this.eq_s$IS(1, "y")) {
+ this.cursor = v_3;
+ break lab2;
+ }
+ this.ket = this.cursor;
+ if (! this.slice_from$S("Y")) {
+ return false;
+ }
+ }
+replab3:
+ while (true) {
+ v_4 = this.cursor;
+ lab4 = true;
+ lab4:
+ while (lab4 === true) {
+ lab4 = false;
+ golab5:
+ while (true) {
+ v_5 = this.cursor;
+ lab6 = true;
+ lab6:
+ while (lab6 === true) {
+ lab6 = false;
+ if (! this.in_grouping$AIII(DutchStemmer.g_v, 97, 232)) {
+ break lab6;
+ }
+ this.bra = this.cursor;
+ lab7 = true;
+ lab7:
+ while (lab7 === true) {
+ lab7 = false;
+ v_6 = this.cursor;
+ lab8 = true;
+ lab8:
+ while (lab8 === true) {
+ lab8 = false;
+ if (! this.eq_s$IS(1, "i")) {
+ break lab8;
+ }
+ this.ket = this.cursor;
+ if (! this.in_grouping$AIII(DutchStemmer.g_v, 97, 232)) {
+ break lab8;
+ }
+ if (! this.slice_from$S("I")) {
+ return false;
+ }
+ break lab7;
+ }
+ this.cursor = v_6;
+ if (! this.eq_s$IS(1, "y")) {
+ break lab6;
+ }
+ this.ket = this.cursor;
+ if (! this.slice_from$S("Y")) {
+ return false;
+ }
+ }
+ this.cursor = v_5;
+ break golab5;
+ }
+ cursor$1 = this.cursor = v_5;
+ if (cursor$1 >= this.limit) {
+ break lab4;
+ }
+ this.cursor++;
+ }
+ continue replab3;
+ }
+ this.cursor = v_4;
+ break replab3;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+DutchStemmer.prototype.r_mark_regions$ = function () {
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!boolean} */
+ var lab3;
+ /** @type {!boolean} */
+ var lab4;
+ /** @type {!boolean} */
+ var lab6;
+ /** @type {!boolean} */
+ var lab8;
+ /** @type {!number} */
+ var limit$0;
+ this.I_p1 = limit$0 = this.limit;
+ this.I_p2 = limit$0;
+golab0:
+ while (true) {
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ if (! this.in_grouping$AIII(DutchStemmer.g_v, 97, 232)) {
+ break lab1;
+ }
+ break golab0;
+ }
+ if (this.cursor >= this.limit) {
+ return false;
+ }
+ this.cursor++;
+ }
+golab2:
+ while (true) {
+ lab3 = true;
+ lab3:
+ while (lab3 === true) {
+ lab3 = false;
+ if (! this.out_grouping$AIII(DutchStemmer.g_v, 97, 232)) {
+ break lab3;
+ }
+ break golab2;
+ }
+ if (this.cursor >= this.limit) {
+ return false;
+ }
+ this.cursor++;
+ }
+ this.I_p1 = this.cursor;
+ lab4 = true;
+lab4:
+ while (lab4 === true) {
+ lab4 = false;
+ if (! (this.I_p1 < 3)) {
+ break lab4;
+ }
+ this.I_p1 = 3;
+ }
+golab5:
+ while (true) {
+ lab6 = true;
+ lab6:
+ while (lab6 === true) {
+ lab6 = false;
+ if (! this.in_grouping$AIII(DutchStemmer.g_v, 97, 232)) {
+ break lab6;
+ }
+ break golab5;
+ }
+ if (this.cursor >= this.limit) {
+ return false;
+ }
+ this.cursor++;
+ }
+golab7:
+ while (true) {
+ lab8 = true;
+ lab8:
+ while (lab8 === true) {
+ lab8 = false;
+ if (! this.out_grouping$AIII(DutchStemmer.g_v, 97, 232)) {
+ break lab8;
+ }
+ break golab7;
+ }
+ if (this.cursor >= this.limit) {
+ return false;
+ }
+ this.cursor++;
+ }
+ this.I_p2 = this.cursor;
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+DutchStemmer.prototype.r_postlude$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var v_1;
+ /** @type {!boolean} */
+ var lab1;
+replab0:
+ while (true) {
+ v_1 = this.cursor;
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ this.bra = this.cursor;
+ among_var = this.find_among$ALAmong$I(DutchStemmer.a_1, 3);
+ if (among_var === 0) {
+ break lab1;
+ }
+ this.ket = this.cursor;
+ switch (among_var) {
+ case 0:
+ break lab1;
+ case 1:
+ if (! this.slice_from$S("y")) {
+ return false;
+ }
+ break;
+ case 2:
+ if (! this.slice_from$S("i")) {
+ return false;
+ }
+ break;
+ case 3:
+ if (this.cursor >= this.limit) {
+ break lab1;
+ }
+ this.cursor++;
+ break;
+ }
+ continue replab0;
+ }
+ this.cursor = v_1;
+ break replab0;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+DutchStemmer.prototype.r_R1$ = function () {
+ return (! (this.I_p1 <= this.cursor) ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+DutchStemmer.prototype.r_R2$ = function () {
+ return (! (this.I_p2 <= this.cursor) ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+DutchStemmer.prototype.r_undouble$ = function () {
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var cursor$0;
+ v_1 = this.limit - this.cursor;
+ if (this.find_among_b$ALAmong$I(DutchStemmer.a_2, 3) === 0) {
+ return false;
+ }
+ cursor$0 = this.cursor = this.limit - v_1;
+ this.ket = cursor$0;
+ if (cursor$0 <= this.limit_backward) {
+ return false;
+ }
+ this.cursor--;
+ this.bra = this.cursor;
+ return (! this.slice_from$S("") ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+DutchStemmer.prototype.r_e_ending$ = function () {
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var cursor$0;
+ this.B_e_found = false;
+ this.ket = this.cursor;
+ if (! this.eq_s_b$IS(1, "e")) {
+ return false;
+ }
+ this.bra = cursor$0 = this.cursor;
+ if (! (! (this.I_p1 <= cursor$0) ? false : true)) {
+ return false;
+ }
+ v_1 = this.limit - this.cursor;
+ if (! this.out_grouping_b$AIII(DutchStemmer.g_v, 97, 232)) {
+ return false;
+ }
+ this.cursor = this.limit - v_1;
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ this.B_e_found = true;
+ return (! this.r_undouble$() ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+DutchStemmer.prototype.r_en_ending$ = function () {
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!number} */
+ var limit$0;
+ /** @type {!number} */
+ var cursor$0;
+ if (! (! (this.I_p1 <= this.cursor) ? false : true)) {
+ return false;
+ }
+ v_1 = this.limit - this.cursor;
+ if (! this.out_grouping_b$AIII(DutchStemmer.g_v, 97, 232)) {
+ return false;
+ }
+ cursor$0 = this.cursor = (limit$0 = this.limit) - v_1;
+ v_2 = limit$0 - cursor$0;
+ lab0 = true;
+lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ if (! this.eq_s_b$IS(3, "gem")) {
+ break lab0;
+ }
+ return false;
+ }
+ this.cursor = this.limit - v_2;
+ return (! this.slice_from$S("") ? false : ! this.r_undouble$() ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+DutchStemmer.prototype.r_standard_suffix$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var v_3;
+ /** @type {!number} */
+ var v_4;
+ /** @type {!number} */
+ var v_5;
+ /** @type {!number} */
+ var v_6;
+ /** @type {!number} */
+ var v_7;
+ /** @type {!number} */
+ var v_8;
+ /** @type {!number} */
+ var v_9;
+ /** @type {!number} */
+ var v_10;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!boolean} */
+ var lab2;
+ /** @type {!boolean} */
+ var lab3;
+ /** @type {!boolean} */
+ var lab4;
+ /** @type {!boolean} */
+ var lab5;
+ /** @type {!boolean} */
+ var lab6;
+ /** @type {!boolean} */
+ var lab7;
+ /** @type {!boolean} */
+ var lab8;
+ /** @type {!boolean} */
+ var lab9;
+ /** @type {!number} */
+ var limit$0;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var cursor$1;
+ /** @type {!number} */
+ var limit$1;
+ /** @type {!number} */
+ var cursor$2;
+ /** @type {!number} */
+ var cursor$3;
+ /** @type {!number} */
+ var limit$2;
+ /** @type {!number} */
+ var cursor$4;
+ /** @type {!number} */
+ var cursor$5;
+ /** @type {!number} */
+ var limit$3;
+ /** @type {!number} */
+ var cursor$6;
+ v_1 = this.limit - this.cursor;
+ lab0 = true;
+lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ this.ket = this.cursor;
+ among_var = this.find_among_b$ALAmong$I(DutchStemmer.a_3, 5);
+ if (among_var === 0) {
+ break lab0;
+ }
+ this.bra = this.cursor;
+ switch (among_var) {
+ case 0:
+ break lab0;
+ case 1:
+ if (! (! (this.I_p1 <= this.cursor) ? false : true)) {
+ break lab0;
+ }
+ if (! this.slice_from$S("heid")) {
+ return false;
+ }
+ break;
+ case 2:
+ if (! this.r_en_ending$()) {
+ break lab0;
+ }
+ break;
+ case 3:
+ if (! (! (this.I_p1 <= this.cursor) ? false : true)) {
+ break lab0;
+ }
+ if (! this.out_grouping_b$AIII(DutchStemmer.g_v_j, 97, 232)) {
+ break lab0;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ }
+ }
+ cursor$0 = this.cursor = (limit$0 = this.limit) - v_1;
+ v_2 = limit$0 - cursor$0;
+ lab1 = true;
+lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ if (! this.r_e_ending$()) {
+ break lab1;
+ }
+ }
+ cursor$2 = this.cursor = (limit$1 = this.limit) - v_2;
+ v_3 = limit$1 - cursor$2;
+ lab2 = true;
+lab2:
+ while (lab2 === true) {
+ lab2 = false;
+ this.ket = this.cursor;
+ if (! this.eq_s_b$IS(4, "heid")) {
+ break lab2;
+ }
+ this.bra = cursor$1 = this.cursor;
+ if (! (! (this.I_p2 <= cursor$1) ? false : true)) {
+ break lab2;
+ }
+ v_4 = this.limit - this.cursor;
+ lab3 = true;
+ lab3:
+ while (lab3 === true) {
+ lab3 = false;
+ if (! this.eq_s_b$IS(1, "c")) {
+ break lab3;
+ }
+ break lab2;
+ }
+ this.cursor = this.limit - v_4;
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ this.ket = this.cursor;
+ if (! this.eq_s_b$IS(2, "en")) {
+ break lab2;
+ }
+ this.bra = this.cursor;
+ if (! this.r_en_ending$()) {
+ break lab2;
+ }
+ }
+ cursor$4 = this.cursor = (limit$2 = this.limit) - v_3;
+ v_5 = limit$2 - cursor$4;
+ lab4 = true;
+lab4:
+ while (lab4 === true) {
+ lab4 = false;
+ this.ket = this.cursor;
+ among_var = this.find_among_b$ALAmong$I(DutchStemmer.a_4, 6);
+ if (among_var === 0) {
+ break lab4;
+ }
+ this.bra = this.cursor;
+ switch (among_var) {
+ case 0:
+ break lab4;
+ case 1:
+ if (! (! (this.I_p2 <= this.cursor) ? false : true)) {
+ break lab4;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ lab5 = true;
+ lab5:
+ while (lab5 === true) {
+ lab5 = false;
+ v_6 = this.limit - this.cursor;
+ lab6 = true;
+ lab6:
+ while (lab6 === true) {
+ lab6 = false;
+ this.ket = this.cursor;
+ if (! this.eq_s_b$IS(2, "ig")) {
+ break lab6;
+ }
+ this.bra = cursor$3 = this.cursor;
+ if (! (! (this.I_p2 <= cursor$3) ? false : true)) {
+ break lab6;
+ }
+ v_7 = this.limit - this.cursor;
+ lab7 = true;
+ lab7:
+ while (lab7 === true) {
+ lab7 = false;
+ if (! this.eq_s_b$IS(1, "e")) {
+ break lab7;
+ }
+ break lab6;
+ }
+ this.cursor = this.limit - v_7;
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break lab5;
+ }
+ this.cursor = this.limit - v_6;
+ if (! this.r_undouble$()) {
+ break lab4;
+ }
+ }
+ break;
+ case 2:
+ if (! (! (this.I_p2 <= this.cursor) ? false : true)) {
+ break lab4;
+ }
+ v_8 = this.limit - this.cursor;
+ lab8 = true;
+ lab8:
+ while (lab8 === true) {
+ lab8 = false;
+ if (! this.eq_s_b$IS(1, "e")) {
+ break lab8;
+ }
+ break lab4;
+ }
+ this.cursor = this.limit - v_8;
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 3:
+ if (! (! (this.I_p2 <= this.cursor) ? false : true)) {
+ break lab4;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ if (! this.r_e_ending$()) {
+ break lab4;
+ }
+ break;
+ case 4:
+ if (! (! (this.I_p2 <= this.cursor) ? false : true)) {
+ break lab4;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 5:
+ if (! (! (this.I_p2 <= this.cursor) ? false : true)) {
+ break lab4;
+ }
+ if (! this.B_e_found) {
+ break lab4;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ }
+ }
+ cursor$6 = this.cursor = (limit$3 = this.limit) - v_5;
+ v_9 = limit$3 - cursor$6;
+ lab9 = true;
+lab9:
+ while (lab9 === true) {
+ lab9 = false;
+ if (! this.out_grouping_b$AIII(DutchStemmer.g_v_I, 73, 232)) {
+ break lab9;
+ }
+ v_10 = this.limit - this.cursor;
+ if (this.find_among_b$ALAmong$I(DutchStemmer.a_5, 4) === 0) {
+ break lab9;
+ }
+ if (! this.out_grouping_b$AIII(DutchStemmer.g_v, 97, 232)) {
+ break lab9;
+ }
+ cursor$5 = this.cursor = this.limit - v_10;
+ this.ket = cursor$5;
+ if (cursor$5 <= this.limit_backward) {
+ break lab9;
+ }
+ this.cursor--;
+ this.bra = this.cursor;
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ }
+ this.cursor = this.limit - v_9;
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+DutchStemmer.prototype.stem$ = function () {
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var v_4;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!boolean} */
+ var lab2;
+ /** @type {!boolean} */
+ var lab3;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var cursor$1;
+ /** @type {!number} */
+ var cursor$2;
+ v_1 = this.cursor;
+ lab0 = true;
+lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ if (! this.r_prelude$()) {
+ break lab0;
+ }
+ }
+ cursor$0 = this.cursor = v_1;
+ v_2 = cursor$0;
+ lab1 = true;
+lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ if (! this.r_mark_regions$()) {
+ break lab1;
+ }
+ }
+ cursor$1 = this.cursor = v_2;
+ this.limit_backward = cursor$1;
+ this.cursor = this.limit;
+ lab2 = true;
+lab2:
+ while (lab2 === true) {
+ lab2 = false;
+ if (! this.r_standard_suffix$()) {
+ break lab2;
+ }
+ }
+ cursor$2 = this.cursor = this.limit_backward;
+ v_4 = cursor$2;
+ lab3 = true;
+lab3:
+ while (lab3 === true) {
+ lab3 = false;
+ if (! this.r_postlude$()) {
+ break lab3;
+ }
+ }
+ this.cursor = v_4;
+ return true;
+};
+
+/**
+ * @param {*} o
+ * @return {!boolean}
+ */
+DutchStemmer.prototype.equals$X = function (o) {
+ return o instanceof DutchStemmer;
+};
+
+/**
+ * @return {!number}
+ */
+DutchStemmer.prototype.hashCode$ = function () {
+ /** @type {!string} */
+ var classname;
+ /** @type {!number} */
+ var hash;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var char;
+ classname = "DutchStemmer";
+ hash = 0;
+ if ("DutchStemmer".length === 0) {
+ return (hash | 0);
+ }
+ for (i = 0; i < classname.length; i++) {
+ char = classname.charCodeAt(i);
+ hash = (hash << 5) - hash + char;
+ hash = hash & hash;
+ }
+ return (hash | 0);
+};
+
+/**
+ * class DanishStemmer extends BaseStemmer
+ * @constructor
+ */
+function DanishStemmer() {
+}
+
+DanishStemmer.prototype = new BaseStemmer;
+/**
+ * @constructor
+ */
+function DanishStemmer$() {
+ BaseStemmer$.call(this);
+ this.I_x = 0;
+ this.I_p1 = 0;
+ this.S_ch = "";
+};
+
+DanishStemmer$.prototype = new DanishStemmer;
+
+/**
+ * @param {DanishStemmer} other
+ */
+DanishStemmer.prototype.copy_from$LDanishStemmer$ = function (other) {
+ this.I_x = other.I_x;
+ this.I_p1 = other.I_p1;
+ this.S_ch = other.S_ch;
+ BaseStemmer.prototype.copy_from$LBaseStemmer$.call(this, other);
+};
+
+/**
+ * @return {!boolean}
+ */
+DanishStemmer.prototype.r_mark_regions$ = function () {
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var c;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!boolean} */
+ var lab3;
+ /** @type {!boolean} */
+ var lab4;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var limit$0;
+ /** @type {!number} */
+ var cursor$1;
+ /** @type {!number} */
+ var cursor$2;
+ this.I_p1 = limit$0 = this.limit;
+ v_1 = cursor$0 = this.cursor;
+ c = (cursor$0 + 3 | 0);
+ if (0 > c || c > limit$0) {
+ return false;
+ }
+ cursor$2 = this.cursor = c;
+ this.I_x = cursor$2;
+ this.cursor = v_1;
+golab0:
+ while (true) {
+ v_2 = this.cursor;
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ if (! this.in_grouping$AIII(DanishStemmer.g_v, 97, 248)) {
+ break lab1;
+ }
+ this.cursor = v_2;
+ break golab0;
+ }
+ cursor$1 = this.cursor = v_2;
+ if (cursor$1 >= this.limit) {
+ return false;
+ }
+ this.cursor++;
+ }
+golab2:
+ while (true) {
+ lab3 = true;
+ lab3:
+ while (lab3 === true) {
+ lab3 = false;
+ if (! this.out_grouping$AIII(DanishStemmer.g_v, 97, 248)) {
+ break lab3;
+ }
+ break golab2;
+ }
+ if (this.cursor >= this.limit) {
+ return false;
+ }
+ this.cursor++;
+ }
+ this.I_p1 = this.cursor;
+ lab4 = true;
+lab4:
+ while (lab4 === true) {
+ lab4 = false;
+ if (! (this.I_p1 < this.I_x)) {
+ break lab4;
+ }
+ this.I_p1 = this.I_x;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+DanishStemmer.prototype.r_main_suffix$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var cursor$1;
+ /** @type {!number} */
+ var cursor$2;
+ v_1 = this.limit - (cursor$0 = this.cursor);
+ if (cursor$0 < this.I_p1) {
+ return false;
+ }
+ cursor$1 = this.cursor = this.I_p1;
+ v_2 = this.limit_backward;
+ this.limit_backward = cursor$1;
+ cursor$2 = this.cursor = this.limit - v_1;
+ this.ket = cursor$2;
+ among_var = this.find_among_b$ALAmong$I(DanishStemmer.a_0, 32);
+ if (among_var === 0) {
+ this.limit_backward = v_2;
+ return false;
+ }
+ this.bra = this.cursor;
+ this.limit_backward = v_2;
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 2:
+ if (! this.in_grouping_b$AIII(DanishStemmer.g_s_ending, 97, 229)) {
+ return false;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+DanishStemmer.prototype.r_consonant_pair$ = function () {
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var v_3;
+ /** @type {!number} */
+ var limit$0;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var cursor$1;
+ /** @type {!number} */
+ var cursor$2;
+ /** @type {!number} */
+ var cursor$3;
+ /** @type {!number} */
+ var limit_backward$0;
+ v_1 = (limit$0 = this.limit) - (cursor$0 = this.cursor);
+ v_2 = limit$0 - cursor$0;
+ if (cursor$0 < this.I_p1) {
+ return false;
+ }
+ cursor$1 = this.cursor = this.I_p1;
+ v_3 = this.limit_backward;
+ this.limit_backward = cursor$1;
+ cursor$2 = this.cursor = this.limit - v_2;
+ this.ket = cursor$2;
+ if (this.find_among_b$ALAmong$I(DanishStemmer.a_1, 4) === 0) {
+ this.limit_backward = v_3;
+ return false;
+ }
+ this.bra = this.cursor;
+ limit_backward$0 = this.limit_backward = v_3;
+ cursor$3 = this.cursor = this.limit - v_1;
+ if (cursor$3 <= limit_backward$0) {
+ return false;
+ }
+ this.cursor--;
+ this.bra = this.cursor;
+ return (! this.slice_from$S("") ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+DanishStemmer.prototype.r_other_suffix$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var v_3;
+ /** @type {!number} */
+ var v_4;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!number} */
+ var limit$0;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var cursor$1;
+ /** @type {!number} */
+ var cursor$2;
+ v_1 = this.limit - this.cursor;
+ lab0 = true;
+lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ this.ket = this.cursor;
+ if (! this.eq_s_b$IS(2, "st")) {
+ break lab0;
+ }
+ this.bra = this.cursor;
+ if (! this.eq_s_b$IS(2, "ig")) {
+ break lab0;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ }
+ cursor$0 = this.cursor = (limit$0 = this.limit) - v_1;
+ v_2 = limit$0 - cursor$0;
+ if (cursor$0 < this.I_p1) {
+ return false;
+ }
+ cursor$1 = this.cursor = this.I_p1;
+ v_3 = this.limit_backward;
+ this.limit_backward = cursor$1;
+ cursor$2 = this.cursor = this.limit - v_2;
+ this.ket = cursor$2;
+ among_var = this.find_among_b$ALAmong$I(DanishStemmer.a_2, 5);
+ if (among_var === 0) {
+ this.limit_backward = v_3;
+ return false;
+ }
+ this.bra = this.cursor;
+ this.limit_backward = v_3;
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ v_4 = this.limit - this.cursor;
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ if (! this.r_consonant_pair$()) {
+ break lab1;
+ }
+ }
+ this.cursor = this.limit - v_4;
+ break;
+ case 2:
+ if (! this.slice_from$S("l\u00F8s")) {
+ return false;
+ }
+ break;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+DanishStemmer.prototype.r_undouble$ = function () {
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var cursor$1;
+ /** @type {!number} */
+ var cursor$2;
+ /** @type {!string} */
+ var S_ch$0;
+ v_1 = this.limit - (cursor$0 = this.cursor);
+ if (cursor$0 < this.I_p1) {
+ return false;
+ }
+ cursor$1 = this.cursor = this.I_p1;
+ v_2 = this.limit_backward;
+ this.limit_backward = cursor$1;
+ cursor$2 = this.cursor = this.limit - v_1;
+ this.ket = cursor$2;
+ if (! this.out_grouping_b$AIII(DanishStemmer.g_v, 97, 248)) {
+ this.limit_backward = v_2;
+ return false;
+ }
+ this.bra = this.cursor;
+ S_ch$0 = this.S_ch = this.slice_to$S(this.S_ch);
+ if (S_ch$0 === '') {
+ return false;
+ }
+ this.limit_backward = v_2;
+ return (! this.eq_v_b$S(this.S_ch) ? false : ! this.slice_from$S("") ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+DanishStemmer.prototype.stem$ = function () {
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var v_3;
+ /** @type {!number} */
+ var v_4;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!boolean} */
+ var lab2;
+ /** @type {!boolean} */
+ var lab3;
+ /** @type {!boolean} */
+ var lab4;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var limit$0;
+ /** @type {!number} */
+ var cursor$1;
+ /** @type {!number} */
+ var limit$1;
+ /** @type {!number} */
+ var cursor$2;
+ /** @type {!number} */
+ var limit$2;
+ /** @type {!number} */
+ var cursor$3;
+ v_1 = this.cursor;
+ lab0 = true;
+lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ if (! this.r_mark_regions$()) {
+ break lab0;
+ }
+ }
+ cursor$0 = this.cursor = v_1;
+ this.limit_backward = cursor$0;
+ cursor$1 = this.cursor = limit$0 = this.limit;
+ v_2 = limit$0 - cursor$1;
+ lab1 = true;
+lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ if (! this.r_main_suffix$()) {
+ break lab1;
+ }
+ }
+ cursor$2 = this.cursor = (limit$1 = this.limit) - v_2;
+ v_3 = limit$1 - cursor$2;
+ lab2 = true;
+lab2:
+ while (lab2 === true) {
+ lab2 = false;
+ if (! this.r_consonant_pair$()) {
+ break lab2;
+ }
+ }
+ cursor$3 = this.cursor = (limit$2 = this.limit) - v_3;
+ v_4 = limit$2 - cursor$3;
+ lab3 = true;
+lab3:
+ while (lab3 === true) {
+ lab3 = false;
+ if (! this.r_other_suffix$()) {
+ break lab3;
+ }
+ }
+ this.cursor = this.limit - v_4;
+ lab4 = true;
+lab4:
+ while (lab4 === true) {
+ lab4 = false;
+ if (! this.r_undouble$()) {
+ break lab4;
+ }
+ }
+ this.cursor = this.limit_backward;
+ return true;
+};
+
+/**
+ * @param {*} o
+ * @return {!boolean}
+ */
+DanishStemmer.prototype.equals$X = function (o) {
+ return o instanceof DanishStemmer;
+};
+
+/**
+ * @return {!number}
+ */
+DanishStemmer.prototype.hashCode$ = function () {
+ /** @type {!string} */
+ var classname;
+ /** @type {!number} */
+ var hash;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var char;
+ classname = "DanishStemmer";
+ hash = 0;
+ if ("DanishStemmer".length === 0) {
+ return (hash | 0);
+ }
+ for (i = 0; i < classname.length; i++) {
+ char = classname.charCodeAt(i);
+ hash = (hash << 5) - hash + char;
+ hash = hash & hash;
+ }
+ return (hash | 0);
+};
+
+/**
+ * class Among extends Object
+ * @constructor
+ */
+function Among() {
+}
+
+/**
+ * @constructor
+ * @param {!string} s
+ * @param {!number} substring_i
+ * @param {!number} result
+ */
+function Among$SII(s, substring_i, result) {
+ this.s_size = s.length;
+ this.s = s;
+ this.substring_i = substring_i;
+ this.result = result;
+ this.method = null;
+ this.instance = null;
+};
+
+Among$SII.prototype = new Among;
+
+/**
+ * @constructor
+ * @param {!string} s
+ * @param {!number} substring_i
+ * @param {!number} result
+ * @param {*} method
+ * @param {BaseStemmer} instance
+ */
+function Among$SIIF$LBaseStemmer$B$LBaseStemmer$(s, substring_i, result, method, instance) {
+ this.s_size = s.length;
+ this.s = s;
+ this.substring_i = substring_i;
+ this.result = result;
+ this.method = method;
+ this.instance = instance;
+};
+
+Among$SIIF$LBaseStemmer$B$LBaseStemmer$.prototype = new Among;
+
+/**
+ * class BitVector extends Object
+ * @constructor
+ */
+function BitVector() {
+}
+
+/**
+ * @constructor
+ */
+function BitVector$() {
+ /** @type {Array.<undefined|!number>} */
+ var _v$0;
+ /** @type {Array.<undefined|!number>} */
+ var _r$0;
+ _r$0 = this._r = [ ];
+ _v$0 = this._v = [ ];
+ _v$0.length = 0;
+ _r$0.length = 0;
+ this._size = 0;
+ this._size1 = 0;
+};
+
+BitVector$.prototype = new BitVector;
+
+/**
+ */
+BitVector.prototype.build$ = function () {
+ /** @type {!number} */
+ var i;
+ this._size1 = 0;
+ for (i = 0; i < this._v.length; i++) {
+ if (i % 8 === 0) {
+ this._r.push(true ? this._size1 : this._size - this._size1);
+ }
+ this._size1 += this._rank32$IIB(this._v[i], 32, true);
+ }
+};
+
+/**
+ */
+BitVector.prototype.clear$ = function () {
+ this._v.length = 0;
+ this._r.length = 0;
+ this._size = 0;
+ this._size1 = 0;
+};
+
+/**
+ * @return {!number}
+ */
+BitVector.prototype.size$ = function () {
+ return this._size;
+};
+
+/**
+ * @param {!boolean} b
+ * @return {!number}
+ */
+BitVector.prototype.size$B = function (b) {
+ return (b ? this._size1 : this._size - this._size1);
+};
+
+/**
+ * @param {!number} value
+ */
+BitVector.prototype.set$I = function (value) {
+ this.set$IB(value, true);
+};
+
+/**
+ * @param {!number} value
+ * @param {!boolean} flag
+ */
+BitVector.prototype.set$IB = function (value, flag) {
+ /** @type {!number} */
+ var q;
+ /** @type {!number} */
+ var r;
+ /** @type {!number} */
+ var m;
+ if (value >= this._size) {
+ this._size = (value + 1 | 0);
+ }
+ q = (value / 32 | 0);
+ r = (value % 32 | 0);
+ while (q >= this._v.length) {
+ this._v.push(0);
+ }
+ m = 0x1 << r;
+ if (flag) {
+ this._v[q] |= m;
+ } else {
+ this._v[q] &= ~ m;
+ }
+};
+
+/**
+ * @param {!number} value
+ * @return {!boolean}
+ */
+BitVector.prototype.get$I = function (value) {
+ /** @type {!number} */
+ var q;
+ /** @type {!number} */
+ var r;
+ /** @type {!number} */
+ var m;
+ if (value >= this._size) {
+ throw new Error("BitVector.get() : range error");
+ }
+ q = (value / 32 | 0);
+ r = (value % 32 | 0);
+ m = 0x1 << r;
+ return !! (this._v[q] & m);
+};
+
+/**
+ * @param {!number} i
+ * @return {!number}
+ */
+BitVector.prototype.rank$I = function (i) {
+ return this.rank$IB(i, true);
+};
+
+/**
+ * @param {!number} i
+ * @param {!boolean} b
+ * @return {!number}
+ */
+BitVector.prototype.rank$IB = function (i, b) {
+ /** @type {!number} */
+ var q_large;
+ /** @type {!number} */
+ var q_small;
+ /** @type {!number} */
+ var r;
+ /** @type {!number} */
+ var rank;
+ /** @type {!number} */
+ var begin;
+ /** @type {!number} */
+ var j;
+ if (i > this._size) {
+ throw new Error("BitVector.rank() : range error");
+ }
+ if (i === 0) {
+ return 0;
+ }
+ i--;
+ q_large = (Math.floor(i / 256) | 0);
+ q_small = (Math.floor(i / 32) | 0);
+ r = (Math.floor(i % 32) | 0);
+ rank = (this._r[q_large] | 0);
+ if (! b) {
+ rank = q_large * 256 - rank;
+ }
+ begin = q_large * 8;
+ for (j = begin; j < q_small; j++) {
+ rank += this._rank32$IIB(this._v[j], 32, b);
+ }
+ rank += this._rank32$IIB(this._v[q_small], r + 1, b);
+ return rank;
+};
+
+/**
+ * @param {!number} i
+ * @return {!number}
+ */
+BitVector.prototype.select$I = function (i) {
+ return this.select$IB(i, true);
+};
+
+/**
+ * @param {!number} i
+ * @param {!boolean} b
+ * @return {!number}
+ */
+BitVector.prototype.select$IB = function (i, b) {
+ /** @type {!number} */
+ var left;
+ /** @type {!number} */
+ var right;
+ /** @type {!number} */
+ var pivot;
+ /** @type {undefined|!number} */
+ var rank;
+ /** @type {!number} */
+ var j;
+ if (i >= (b ? this._size1 : this._size - this._size1)) {
+ throw new Error("BitVector.select() : range error");
+ }
+ left = 0;
+ right = this._r.length;
+ while (left < right) {
+ pivot = Math.floor((left + right) / 2);
+ rank = this._r[pivot];
+ if (! b) {
+ rank = pivot * 256 - rank;
+ }
+ if (i < rank) {
+ right = pivot;
+ } else {
+ left = pivot + 1;
+ }
+ }
+ right--;
+ if (b) {
+ i -= (this._r[right] | 0);
+ } else {
+ i -= (right * 256 - this._r[right] | 0);
+ }
+ j = right * 8;
+ while (1) {
+ rank = this._rank32$IIB(this._v[j], 32, b);
+ if (i < rank) {
+ break;
+ }
+ j++;
+ i -= (rank | 0);
+ }
+ return (j * 32 + this._select32$IIB(this._v[j], i, b) | 0);
+};
+
+/**
+ * @param {!number} x
+ * @param {!number} i
+ * @param {!boolean} b
+ * @return {!number}
+ */
+BitVector.prototype._rank32$IIB = function (x, i, b) {
+ if (! b) {
+ x = ~ x;
+ }
+ x <<= 32 - i;
+ x = ((x & 0xaaaaaaaa) >>> 1) + (x & 0x55555555);
+ x = ((x & 0xcccccccc) >>> 2) + (x & 0x33333333);
+ x = ((x & 0xf0f0f0f0) >>> 4) + (x & 0x0f0f0f0f);
+ x = ((x & 0xff00ff00) >>> 8) + (x & 0x00ff00ff);
+ x = ((x & 0xffff0000) >>> 16) + (x & 0x0000ffff);
+ return x;
+};
+
+/**
+ * @param {!number} x
+ * @param {!number} i
+ * @param {!boolean} b
+ * @return {!number}
+ */
+BitVector.prototype._select32$IIB = function (x, i, b) {
+ /** @type {!number} */
+ var x1;
+ /** @type {!number} */
+ var x2;
+ /** @type {!number} */
+ var x3;
+ /** @type {!number} */
+ var x4;
+ /** @type {!number} */
+ var x5;
+ /** @type {!number} */
+ var pos;
+ /** @type {!number} */
+ var v5;
+ /** @type {!number} */
+ var v4;
+ /** @type {!number} */
+ var v3;
+ /** @type {!number} */
+ var v2;
+ /** @type {!number} */
+ var v1;
+ /** @type {!number} */
+ var v0;
+ if (! b) {
+ x = ~ x;
+ }
+ x1 = ((x & 0xaaaaaaaa) >>> 1) + (x & 0x55555555);
+ x2 = ((x1 & 0xcccccccc) >>> 2) + (x1 & 0x33333333);
+ x3 = ((x2 & 0xf0f0f0f0) >>> 4) + (x2 & 0x0f0f0f0f);
+ x4 = ((x3 & 0xff00ff00) >>> 8) + (x3 & 0x00ff00ff);
+ x5 = ((x4 & 0xffff0000) >>> 16) + (x4 & 0x0000ffff);
+ i++;
+ pos = 0;
+ v5 = x5 & 0xffffffff;
+ if (i > v5) {
+ i -= (v5 | 0);
+ pos += 32;
+ }
+ v4 = x4 >>> pos & 0x0000ffff;
+ if (i > v4) {
+ i -= (v4 | 0);
+ pos += 16;
+ }
+ v3 = x3 >>> pos & 0x000000ff;
+ if (i > v3) {
+ i -= (v3 | 0);
+ pos += 8;
+ }
+ v2 = x2 >>> pos & 0x0000000f;
+ if (i > v2) {
+ i -= (v2 | 0);
+ pos += 4;
+ }
+ v1 = x1 >>> pos & 0x00000003;
+ if (i > v1) {
+ i -= (v1 | 0);
+ pos += 2;
+ }
+ v0 = x >>> pos & 0x00000001;
+ if (i > v0) {
+ i -= (v0 | 0);
+ pos += 1;
+ }
+ return (pos | 0);
+};
+
+/**
+ * @return {!string}
+ */
+BitVector.prototype.dump$ = function () {
+ /** @type {Array.<undefined|!string>} */
+ var contents;
+ contents = [ ];
+ contents.push(Binary$dump32bitNumber$N(this._size));
+ contents.push(Binary$dump32bitNumberList$AN(this._v));
+ return contents.join('');
+};
+
+/**
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+BitVector.prototype.dump$LCompressionReport$ = function (report) {
+ /** @type {Array.<undefined|!string>} */
+ var contents;
+ contents = [ ];
+ contents.push(Binary$dump32bitNumber$N(this._size));
+ CompressionReport$add$LCompressionReport$II(report, 2, 2);
+ contents.push(Binary$dump32bitNumberList$ANLCompressionReport$(this._v, report));
+ return contents.join('');
+};
+
+/**
+ * @param {!string} data
+ * @return {!number}
+ */
+BitVector.prototype.load$S = function (data) {
+ return this.load$SI(data, 0);
+};
+
+/**
+ * @param {!string} data
+ * @param {!number} offset
+ * @return {!number}
+ */
+BitVector.prototype.load$SI = function (data, offset) {
+ /** @type {LoadedNumberListResult} */
+ var result;
+ /** @type {!number} */
+ var result$0;
+ this._v.length = 0;
+ this._r.length = 0;
+ this._size = 0;
+ this._size1 = 0;
+ result$0 = data.charCodeAt(offset) * 65536 + data.charCodeAt(offset + 1);
+ this._size = (result$0 | 0);
+ result = Binary$load32bitNumberList$SI(data, offset + 2);
+ this._v = result.result;
+ this.build$();
+ return result.offset;
+};
+
+/**
+ * class WaveletMatrix extends Object
+ * @constructor
+ */
+function WaveletMatrix() {
+}
+
+/**
+ * @constructor
+ */
+function WaveletMatrix$() {
+ /** @type {Array.<undefined|BitVector>} */
+ var _bv$0;
+ /** @type {Array.<undefined|!number>} */
+ var _seps$0;
+ this._range = ({ });
+ _bv$0 = this._bv = [ ];
+ _seps$0 = this._seps = [ ];
+ this._bitsize = 16;
+ _bv$0.length = 0;
+ _seps$0.length = 0;
+ this._size = 0;
+};
+
+WaveletMatrix$.prototype = new WaveletMatrix;
+
+/**
+ * @return {!number}
+ */
+WaveletMatrix.prototype.bitsize$ = function () {
+ return this._bitsize;
+};
+
+/**
+ * @param {!number} charCode
+ */
+WaveletMatrix.prototype.setMaxCharCode$I = function (charCode) {
+ this._bitsize = (Math.ceil(Math.log(charCode) / 0.6931471805599453) | 0);
+};
+
+/**
+ */
+WaveletMatrix.prototype.clear$ = function () {
+ this._bv.length = 0;
+ this._seps.length = 0;
+ this._size = 0;
+};
+
+/**
+ * @param {!string} v
+ */
+WaveletMatrix.prototype.build$S = function (v) {
+ /** @type {!number} */
+ var size;
+ /** @type {!number} */
+ var bitsize;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var depth;
+ /** @type {Object.<string, undefined|!number>} */
+ var range_tmp;
+ /** @type {!number} */
+ var code;
+ /** @type {!boolean} */
+ var bit;
+ /** @type {!number} */
+ var key;
+ /** @type {Object.<string, undefined|!number>} */
+ var range_rev;
+ /** @type {!string} */
+ var range_key;
+ /** @type {!number} */
+ var value;
+ /** @type {!number} */
+ var pos0;
+ /** @type {undefined|!number} */
+ var pos1;
+ /** @type {!string} */
+ var range_rev_key;
+ /** @type {!number} */
+ var begin;
+ /** @type {undefined|!number} */
+ var end;
+ /** @type {!number} */
+ var num0;
+ /** @type {!number} */
+ var num1;
+ this._bv.length = 0;
+ this._seps.length = 0;
+ this._size = 0;
+ size = v.length;
+ bitsize = this._bitsize;
+ for (i = 0; i < bitsize; i++) {
+ this._bv.push(new BitVector$());
+ this._seps.push(0);
+ }
+ this._size = (size | 0);
+ for (i = 0; i < size; i++) {
+ this._bv[0].set$IB(i, this._uint2bit$II(v.charCodeAt(i), 0));
+ }
+ this._bv[0].build$();
+ this._seps[0] = this._bv[0].size$B(false);
+ this._range["0"] = 0;
+ this._range["1"] = this._seps[0];
+ depth = 1;
+ while (depth < bitsize) {
+ range_tmp = WaveletMatrix$_shallow_copy$HI(this._range);
+ for (i = 0; i < size; i++) {
+ code = v.charCodeAt(i);
+ bit = this._uint2bit$II(code, depth);
+ key = code >>> bitsize - depth;
+ this._bv[depth].set$IB(range_tmp[key + ""], bit);
+ range_tmp[key + ""]++;
+ }
+ this._bv[depth].build$();
+ this._seps[depth] = this._bv[depth].size$B(false);
+ range_rev = ({ });
+ for (range_key in this._range) {
+ value = this._range[range_key];
+ if (value != range_tmp[range_key]) {
+ range_rev[value + ""] = range_key | 0;
+ }
+ }
+ this._range = ({ });
+ pos0 = 0;
+ pos1 = this._seps[depth];
+ for (range_rev_key in range_rev) {
+ begin = range_rev_key | 0;
+ value = range_rev[range_rev_key];
+ end = range_tmp[value + ""];
+ num0 = this._bv[depth].rank$IB(end, false) - this._bv[depth].rank$IB(begin, false);
+ num1 = end - begin - num0;
+ if (num0 > 0) {
+ this._range[(value << 1) + ""] = (pos0 | 0);
+ pos0 += num0;
+ }
+ if (num1 > 0) {
+ this._range[(value << 1) + 1 + ""] = pos1;
+ pos1 += (num1 | 0);
+ }
+ }
+ depth++;
+ }
+};
+
+/**
+ * @return {!number}
+ */
+WaveletMatrix.prototype.size$ = function () {
+ return this._size;
+};
+
+/**
+ * @param {!number} c
+ * @return {!number}
+ */
+WaveletMatrix.prototype.size$I = function (c) {
+ return this.rank$II(this._size, c);
+};
+
+/**
+ * @param {!number} i
+ * @return {!number}
+ */
+WaveletMatrix.prototype.get$I = function (i) {
+ /** @type {!number} */
+ var value;
+ /** @type {!number} */
+ var depth;
+ /** @type {!boolean} */
+ var bit;
+ if (i >= this._size) {
+ throw new Error("WaveletMatrix.get() : range error");
+ }
+ value = 0;
+ depth = 0;
+ while (depth < this._bitsize) {
+ bit = this._bv[depth].get$I(i);
+ i = this._bv[depth].rank$IB(i, bit);
+ value <<= 1;
+ if (bit) {
+ i += this._seps[depth];
+ value += 1;
+ }
+ depth++;
+ }
+ return (value | 0);
+};
+
+/**
+ * @param {!number} i
+ * @param {!number} c
+ * @return {!number}
+ */
+WaveletMatrix.prototype.rank$II = function (i, c) {
+ /** @type {undefined|!number} */
+ var begin;
+ /** @type {!number} */
+ var end;
+ /** @type {!number} */
+ var depth;
+ /** @type {!boolean} */
+ var bit;
+ if (i > this._size) {
+ throw new Error("WaveletMatrix.rank(): range error");
+ }
+ if (i === 0) {
+ return 0;
+ }
+ begin = this._range[c + ""];
+ if (begin == null) {
+ return 0;
+ }
+ end = i;
+ depth = 0;
+ while (depth < this._bitsize) {
+ bit = this._uint2bit$II(c, depth);
+ end = this._bv[depth].rank$IB(end, bit);
+ if (bit) {
+ end += this._seps[depth];
+ }
+ depth++;
+ }
+ return (end - begin | 0);
+};
+
+/**
+ * @param {!number} i
+ * @param {!number} c
+ * @return {!number}
+ */
+WaveletMatrix.prototype.rank_less_than$II = function (i, c) {
+ /** @type {!number} */
+ var begin;
+ /** @type {!number} */
+ var end;
+ /** @type {!number} */
+ var depth;
+ /** @type {!number} */
+ var rlt;
+ /** @type {!number} */
+ var rank0_begin;
+ /** @type {!number} */
+ var rank0_end;
+ /** @type {Array.<undefined|!number>} */
+ var _seps$0;
+ if (i > this._size) {
+ throw new Error("WaveletMatrix.rank_less_than(): range error");
+ }
+ if (i === 0) {
+ return 0;
+ }
+ begin = 0;
+ end = i;
+ depth = 0;
+ rlt = 0;
+ while (depth < this._bitsize) {
+ rank0_begin = this._bv[depth].rank$IB(begin, false);
+ rank0_end = this._bv[depth].rank$IB(end, false);
+ if (this._uint2bit$II(c, depth)) {
+ rlt += rank0_end - rank0_begin;
+ begin += (_seps$0 = this._seps)[depth] - rank0_begin;
+ end += _seps$0[depth] - rank0_end;
+ } else {
+ begin = rank0_begin;
+ end = rank0_end;
+ }
+ depth++;
+ }
+ return (rlt | 0);
+};
+
+/**
+ * @return {!string}
+ */
+WaveletMatrix.prototype.dump$ = function () {
+ /** @type {Array.<undefined|!string>} */
+ var contents;
+ /** @type {!number} */
+ var i;
+ /** @type {Array.<undefined|!string>} */
+ var range_contents;
+ /** @type {!number} */
+ var counter;
+ /** @type {!string} */
+ var key;
+ contents = [ Binary$dump16bitNumber$I(this._bitsize), Binary$dump32bitNumber$N(this._size) ];
+ for (i = 0; i < this._bitsize; i++) {
+ contents.push(this._bv[i].dump$());
+ }
+ for (i = 0; i < this._bitsize; i++) {
+ contents.push(Binary$dump32bitNumber$N(this._seps[i]));
+ }
+ range_contents = [ ];
+ counter = 0;
+ for (key in this._range) {
+ range_contents.push(Binary$dump32bitNumber$N(key | 0));
+ range_contents.push(Binary$dump32bitNumber$N(this._range[key]));
+ counter++;
+ }
+ contents.push(Binary$dump32bitNumber$N(counter));
+ return contents.join('') + range_contents.join('');
+};
+
+/**
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+WaveletMatrix.prototype.dump$LCompressionReport$ = function (report) {
+ /** @type {Array.<undefined|!string>} */
+ var contents;
+ /** @type {!number} */
+ var i;
+ /** @type {Array.<undefined|!string>} */
+ var range_contents;
+ /** @type {!number} */
+ var counter;
+ /** @type {!string} */
+ var key;
+ contents = [ Binary$dump16bitNumber$I(this._bitsize), Binary$dump32bitNumber$N(this._size) ];
+ CompressionReport$add$LCompressionReport$II(report, 3, 3);
+ for (i = 0; i < this._bitsize; i++) {
+ contents.push(this._bv[i].dump$LCompressionReport$(report));
+ }
+ for (i = 0; i < this._bitsize; i++) {
+ contents.push(Binary$dump32bitNumber$N(this._seps[i]));
+ CompressionReport$add$LCompressionReport$II(report, 2, 2);
+ }
+ range_contents = [ ];
+ counter = 0;
+ for (key in this._range) {
+ range_contents.push(Binary$dump32bitNumber$N(key | 0));
+ range_contents.push(Binary$dump32bitNumber$N(this._range[key]));
+ CompressionReport$add$LCompressionReport$II(report, 4, 4);
+ counter++;
+ }
+ CompressionReport$add$LCompressionReport$II(report, 2, 2);
+ contents.push(Binary$dump32bitNumber$N(counter));
+ return contents.join('') + range_contents.join('');
+};
+
+/**
+ * @param {!string} data
+ * @return {!number}
+ */
+WaveletMatrix.prototype.load$S = function (data) {
+ return this.load$SI(data, 0);
+};
+
+/**
+ * @param {!string} data
+ * @param {!number} offset
+ * @return {!number}
+ */
+WaveletMatrix.prototype.load$SI = function (data, offset) {
+ /** @type {!number} */
+ var i;
+ /** @type {BitVector} */
+ var bit_vector;
+ /** @type {!number} */
+ var range_size;
+ /** @type {!number} */
+ var value;
+ /** @type {!number} */
+ var offset$0;
+ /** @type {!number} */
+ var result$0;
+ /** @type {!number} */
+ var result$1;
+ /** @type {!number} */
+ var result$2;
+ this._bv.length = 0;
+ this._seps.length = 0;
+ this._size = 0;
+ offset$0 = offset++;
+ this._bitsize = (data.charCodeAt(offset$0) | 0);
+ result$0 = data.charCodeAt(offset) * 65536 + data.charCodeAt(offset + 1);
+ this._size = (result$0 | 0);
+ offset += 2;
+ for (i = 0; i < this._bitsize; i++) {
+ bit_vector = new BitVector$();
+ offset = bit_vector.load$SI(data, offset);
+ this._bv.push(bit_vector);
+ }
+ for (i = 0; i < this._bitsize; (i++, offset += 2)) {
+ this._seps.push(Binary$load32bitNumber$SI(data, offset));
+ }
+ result$1 = data.charCodeAt(offset) * 65536 + data.charCodeAt(offset + 1);
+ range_size = result$1;
+ offset += 2;
+ for (i = 0; i < range_size; (i++, offset += 4)) {
+ result$2 = data.charCodeAt(offset) * 65536 + data.charCodeAt(offset + 1);
+ value = Binary$load32bitNumber$SI(data, offset + 2);
+ this._range[result$2 + ""] = (value | 0);
+ }
+ return offset;
+};
+
+/**
+ * @param {Object.<string, undefined|!number>} input
+ * @return {Object.<string, undefined|!number>}
+ */
+WaveletMatrix._shallow_copy$HI = function (input) {
+ /** @type {Object.<string, undefined|!number>} */
+ var result;
+ /** @type {!string} */
+ var key;
+ result = ({ });
+ for (key in input) {
+ result[key] = input[key];
+ }
+ return result;
+};
+
+var WaveletMatrix$_shallow_copy$HI = WaveletMatrix._shallow_copy$HI;
+
+/**
+ * @param {!number} c
+ * @param {!number} i
+ * @return {!boolean}
+ */
+WaveletMatrix.prototype._uint2bit$II = function (c, i) {
+ return (c >>> this._bitsize - 1 - i & 0x1) === 0x1;
+};
+
+/**
+ * class BurrowsWheelerTransform extends Object
+ * @constructor
+ */
+function BurrowsWheelerTransform() {
+}
+
+/**
+ * @constructor
+ */
+function BurrowsWheelerTransform$() {
+ this._str = "";
+ this._size = 0;
+ this._head = 0;
+ this._suffixarray = [ ];
+};
+
+BurrowsWheelerTransform$.prototype = new BurrowsWheelerTransform;
+
+/**
+ * @param {BurrowsWheelerTransform} $this
+ * @return {!number}
+ */
+BurrowsWheelerTransform.size$LBurrowsWheelerTransform$ = function ($this) {
+ return $this._size;
+};
+
+var BurrowsWheelerTransform$size$LBurrowsWheelerTransform$ = BurrowsWheelerTransform.size$LBurrowsWheelerTransform$;
+
+/**
+ * @param {BurrowsWheelerTransform} $this
+ * @return {!number}
+ */
+BurrowsWheelerTransform.head$LBurrowsWheelerTransform$ = function ($this) {
+ return $this._head;
+};
+
+var BurrowsWheelerTransform$head$LBurrowsWheelerTransform$ = BurrowsWheelerTransform.head$LBurrowsWheelerTransform$;
+
+/**
+ * @param {BurrowsWheelerTransform} $this
+ */
+BurrowsWheelerTransform.clear$LBurrowsWheelerTransform$ = function ($this) {
+ $this._str = "";
+ $this._size = 0;
+ $this._head = 0;
+ $this._suffixarray.length = 0;
+};
+
+var BurrowsWheelerTransform$clear$LBurrowsWheelerTransform$ = BurrowsWheelerTransform.clear$LBurrowsWheelerTransform$;
+
+/**
+ * @param {BurrowsWheelerTransform} $this
+ * @param {!string} str
+ */
+BurrowsWheelerTransform.build$LBurrowsWheelerTransform$S = function ($this, str) {
+ /** @type {!string} */
+ var _str$0;
+ /** @type {Array.<undefined|!number>} */
+ var _suffixarray$0;
+ _str$0 = $this._str = str;
+ $this._size = _str$0.length;
+ _suffixarray$0 = $this._suffixarray = SAIS$make$S(str);
+ $this._head = (_suffixarray$0.indexOf(0) | 0);
+};
+
+var BurrowsWheelerTransform$build$LBurrowsWheelerTransform$S = BurrowsWheelerTransform.build$LBurrowsWheelerTransform$S;
+
+/**
+ * @param {BurrowsWheelerTransform} $this
+ * @param {!number} i
+ * @return {!string}
+ */
+BurrowsWheelerTransform.get$LBurrowsWheelerTransform$I = function ($this, i) {
+ /** @type {!number} */
+ var size;
+ /** @type {!number} */
+ var index;
+ size = $this._size;
+ if (i >= size) {
+ throw new Error("BurrowsWheelerTransform.get() : range error");
+ }
+ index = ($this._suffixarray[i] + size - 1) % size;
+ return $this._str.charAt(index);
+};
+
+var BurrowsWheelerTransform$get$LBurrowsWheelerTransform$I = BurrowsWheelerTransform.get$LBurrowsWheelerTransform$I;
+
+/**
+ * @param {BurrowsWheelerTransform} $this
+ * @return {!string}
+ */
+BurrowsWheelerTransform.get$LBurrowsWheelerTransform$ = function ($this) {
+ /** @type {Array.<undefined|!string>} */
+ var str;
+ /** @type {!number} */
+ var size;
+ /** @type {!number} */
+ var i;
+ str = [ ];
+ size = $this._size;
+ for (i = 0; i < size; i++) {
+ str.push(BurrowsWheelerTransform$get$LBurrowsWheelerTransform$I($this, i));
+ }
+ return str.join("");
+};
+
+var BurrowsWheelerTransform$get$LBurrowsWheelerTransform$ = BurrowsWheelerTransform.get$LBurrowsWheelerTransform$;
+
+/**
+ * @param {BurrowsWheelerTransform} $this
+ * @param {!string} replace
+ * @return {!string}
+ */
+BurrowsWheelerTransform.get$LBurrowsWheelerTransform$S = function ($this, replace) {
+ /** @type {!string} */
+ var result;
+ result = BurrowsWheelerTransform$get$LBurrowsWheelerTransform$($this);
+ return result.replace(BurrowsWheelerTransform.END_MARKER, replace);
+};
+
+var BurrowsWheelerTransform$get$LBurrowsWheelerTransform$S = BurrowsWheelerTransform.get$LBurrowsWheelerTransform$S;
+
+/**
+ * class OArray extends Object
+ * @constructor
+ */
+function OArray() {
+}
+
+/**
+ * @constructor
+ * @param {Array.<undefined|!number>} array
+ */
+function OArray$AI(array) {
+ this.array = array;
+ this.offset = 0;
+};
+
+OArray$AI.prototype = new OArray;
+
+/**
+ * @constructor
+ * @param {Array.<undefined|!number>} array
+ * @param {!number} offset
+ */
+function OArray$AII(array, offset) {
+ this.array = array;
+ this.offset = offset;
+};
+
+OArray$AII.prototype = new OArray;
+
+/**
+ * @param {OArray} $this
+ * @param {!number} index
+ * @return {!number}
+ */
+OArray.get$LOArray$I = function ($this, index) {
+ return $this.array[index + $this.offset];
+};
+
+var OArray$get$LOArray$I = OArray.get$LOArray$I;
+
+/**
+ * @param {OArray} $this
+ * @param {!number} index
+ * @param {!number} value
+ */
+OArray.set$LOArray$II = function ($this, index, value) {
+ $this.array[index + $this.offset] = value;
+};
+
+var OArray$set$LOArray$II = OArray.set$LOArray$II;
+
+/**
+ * @param {OArray} $this
+ * @param {!number} index
+ * @return {!boolean}
+ */
+OArray.isS$LOArray$I = function ($this, index) {
+ /** @type {Array.<undefined|!number>} */
+ var array$0;
+ /** @type {!number} */
+ var offset$0;
+ return (array$0 = $this.array)[index + (offset$0 = $this.offset)] < array$0[index + offset$0 + 1];
+};
+
+var OArray$isS$LOArray$I = OArray.isS$LOArray$I;
+
+/**
+ * @param {OArray} $this
+ * @param {!number} index1
+ * @param {!number} index2
+ * @return {!boolean}
+ */
+OArray.compare$LOArray$II = function ($this, index1, index2) {
+ /** @type {Array.<undefined|!number>} */
+ var array$0;
+ /** @type {!number} */
+ var offset$0;
+ return (array$0 = $this.array)[index1 + (offset$0 = $this.offset)] == array$0[index2 + offset$0];
+};
+
+var OArray$compare$LOArray$II = OArray.compare$LOArray$II;
+
+/**
+ * class SAIS extends Object
+ * @constructor
+ */
+function SAIS() {
+}
+
+/**
+ * @constructor
+ */
+function SAIS$() {
+};
+
+SAIS$.prototype = new SAIS;
+
+/**
+ * @param {BitVector} t
+ * @param {!number} i
+ * @return {!boolean}
+ */
+SAIS._isLMS$LBitVector$I = function (t, i) {
+ return i > 0 && t.get$I(i) && ! t.get$I(i - 1);
+};
+
+var SAIS$_isLMS$LBitVector$I = SAIS._isLMS$LBitVector$I;
+
+/**
+ * @param {OArray} s
+ * @param {Array.<undefined|!number>} bkt
+ * @param {!number} n
+ * @param {!number} K
+ * @param {!boolean} end
+ */
+SAIS._getBuckets$LOArray$AIIIB = function (s, bkt, n, K, end) {
+ /** @type {!number} */
+ var sum;
+ /** @type {!number} */
+ var i;
+ sum = 0;
+ for (i = 0; i <= K; i++) {
+ bkt[i] = 0;
+ }
+ for (i = 0; i < n; i++) {
+ bkt[OArray$get$LOArray$I(s, i)]++;
+ }
+ for (i = 0; i <= K; i++) {
+ sum += bkt[i];
+ bkt[i] = ((end ? sum : sum - bkt[i]) | 0);
+ }
+};
+
+var SAIS$_getBuckets$LOArray$AIIIB = SAIS._getBuckets$LOArray$AIIIB;
+
+/**
+ * @param {BitVector} t
+ * @param {Array.<undefined|!number>} SA
+ * @param {OArray} s
+ * @param {Array.<undefined|!number>} bkt
+ * @param {!number} n
+ * @param {!number} K
+ * @param {!boolean} end
+ */
+SAIS._induceSAl$LBitVector$AILOArray$AIIIB = function (t, SA, s, bkt, n, K, end) {
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var j;
+ SAIS$_getBuckets$LOArray$AIIIB(s, bkt, n, K, end);
+ for (i = 0; i < n; i++) {
+ j = SA[i] - 1;
+ if (j >= 0 && ! t.get$I(j)) {
+ SA[bkt[OArray$get$LOArray$I(s, j)]++] = (j | 0);
+ }
+ }
+};
+
+var SAIS$_induceSAl$LBitVector$AILOArray$AIIIB = SAIS._induceSAl$LBitVector$AILOArray$AIIIB;
+
+/**
+ * @param {BitVector} t
+ * @param {Array.<undefined|!number>} SA
+ * @param {OArray} s
+ * @param {Array.<undefined|!number>} bkt
+ * @param {!number} n
+ * @param {!number} K
+ * @param {!boolean} end
+ */
+SAIS._induceSAs$LBitVector$AILOArray$AIIIB = function (t, SA, s, bkt, n, K, end) {
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var j;
+ SAIS$_getBuckets$LOArray$AIIIB(s, bkt, n, K, end);
+ for (i = n - 1; i >= 0; i--) {
+ j = SA[i] - 1;
+ if (j >= 0 && t.get$I(j)) {
+ SA[-- bkt[OArray$get$LOArray$I(s, j)]] = (j | 0);
+ }
+ }
+};
+
+var SAIS$_induceSAs$LBitVector$AILOArray$AIIIB = SAIS._induceSAs$LBitVector$AILOArray$AIIIB;
+
+/**
+ * @param {!string} source
+ * @return {Array.<undefined|!number>}
+ */
+SAIS.make$S = function (source) {
+ /** @type {Array.<undefined|!number>} */
+ var charCodes;
+ /** @type {!number} */
+ var maxCode;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var code;
+ /** @type {Array.<undefined|!number>} */
+ var SA;
+ /** @type {OArray} */
+ var s;
+ charCodes = [ ];
+ charCodes.length = source.length;
+ maxCode = 0;
+ for (i = 0; i < source.length; i++) {
+ code = source.charCodeAt(i);
+ charCodes[i] = (code | 0);
+ maxCode = (code > maxCode ? code : maxCode);
+ }
+ SA = [ ];
+ SA.length = source.length;
+ s = ({offset: 0, array: charCodes});
+ SAIS$_make$LOArray$AIII(s, SA, source.length, maxCode);
+ return SA;
+};
+
+var SAIS$make$S = SAIS.make$S;
+
+/**
+ * @param {OArray} s
+ * @param {Array.<undefined|!number>} SA
+ * @param {!number} n
+ * @param {!number} K
+ */
+SAIS._make$LOArray$AIII = function (s, SA, n, K) {
+ /** @type {BitVector} */
+ var t;
+ /** @type {!number} */
+ var i;
+ /** @type {Array.<undefined|!number>} */
+ var bkt;
+ /** @type {!number} */
+ var n1;
+ /** @type {!number} */
+ var name;
+ /** @type {!number} */
+ var prev;
+ /** @type {undefined|!number} */
+ var pos;
+ /** @type {!boolean} */
+ var diff;
+ /** @type {!number} */
+ var d;
+ /** @type {!number} */
+ var j;
+ /** @type {Array.<undefined|!number>} */
+ var SA1;
+ /** @type {OArray} */
+ var s1;
+ /** @type {!number} */
+ var i$0;
+ /** @type {!number} */
+ var index$0;
+ t = new BitVector$();
+ t.set$IB(n - 2, false);
+ t.set$IB(n - 1, true);
+ for (i = n - 3; i >= 0; i--) {
+ t.set$IB(i, OArray$isS$LOArray$I(s, i) || OArray$compare$LOArray$II(s, i, i + 1) && t.get$I(i + 1));
+ }
+ bkt = [ ];
+ bkt.length = K + 1;
+ SAIS$_getBuckets$LOArray$AIIIB(s, bkt, n, K, true);
+ for (i = 0; i < n; i++) {
+ SA[i] = -1;
+ }
+ for (i = 1; i < n; i++) {
+ if (SAIS$_isLMS$LBitVector$I(t, i)) {
+ SA[-- bkt[OArray$get$LOArray$I(s, i)]] = (i | 0);
+ }
+ }
+ SAIS$_induceSAl$LBitVector$AILOArray$AIIIB(t, SA, s, bkt, n, K, false);
+ SAIS$_induceSAs$LBitVector$AILOArray$AIIIB(t, SA, s, bkt, n, K, true);
+ n1 = 0;
+ for (i = 0; i < n; i++) {
+ i$0 = SA[i];
+ if (i$0 > 0 && t.get$I(i$0) && ! t.get$I(i$0 - 1)) {
+ SA[n1++] = SA[i];
+ }
+ }
+ for (i = n1; i < n; i++) {
+ SA[i] = -1;
+ }
+ name = 0;
+ prev = -1;
+ for (i = 0; i < n1; i++) {
+ pos = SA[i];
+ diff = false;
+ for (d = 0; d < n; d++) {
+ if (prev === -1 || ! OArray$compare$LOArray$II(s, pos + d, prev + d) || t.get$I(pos + d) !== t.get$I(prev + d)) {
+ diff = true;
+ break;
+ } else {
+ if (d > 0 && (SAIS$_isLMS$LBitVector$I(t, pos + d) || SAIS$_isLMS$LBitVector$I(t, prev + d))) {
+ break;
+ }
+ }
+ }
+ if (diff) {
+ name++;
+ prev = pos;
+ }
+ pos = ((pos % 2 === 0 ? pos / 2 : (pos - 1) / 2) | 0);
+ SA[n1 + pos] = (name - 1 | 0);
+ }
+ for ((i = n - 1, j = n - 1); i >= n1; i--) {
+ if (SA[i] >= 0) {
+ SA[j--] = SA[i];
+ }
+ }
+ SA1 = SA;
+ s1 = ({offset: n - n1, array: SA});
+ if (name < n1) {
+ SAIS$_make$LOArray$AIII(s1, SA1, n1, name - 1);
+ } else {
+ for (i = 0; i < n1; i++) {
+ SA1[OArray$get$LOArray$I(s1, i)] = (i | 0);
+ }
+ }
+ bkt = [ ];
+ bkt.length = K + 1;
+ SAIS$_getBuckets$LOArray$AIIIB(s, bkt, n, K, true);
+ for ((i = 1, j = 0); i < n; i++) {
+ if (SAIS$_isLMS$LBitVector$I(t, i)) {
+ OArray$set$LOArray$II(s1, j++, i);
+ }
+ }
+ for (i = 0; i < n1; i++) {
+ index$0 = SA1[i];
+ SA1[i] = s1.array[index$0 + s1.offset];
+ }
+ for (i = n1; i < n; i++) {
+ SA[i] = -1;
+ }
+ for (i = n1 - 1; i >= 0; i--) {
+ j = SA[i];
+ SA[i] = -1;
+ SA[-- bkt[OArray$get$LOArray$I(s, j)]] = (j | 0);
+ }
+ SAIS$_induceSAl$LBitVector$AILOArray$AIIIB(t, SA, s, bkt, n, K, false);
+ SAIS$_induceSAs$LBitVector$AILOArray$AIIIB(t, SA, s, bkt, n, K, true);
+};
+
+var SAIS$_make$LOArray$AIII = SAIS._make$LOArray$AIII;
+
+$__jsx_lazy_init(node, "__dirname", function () {
+ return eval("__dirname") + "";
+});
+$__jsx_lazy_init(node, "__filename", function () {
+ return eval("__filename") + "";
+});
+$__jsx_lazy_init(node, "fs", function () {
+ return node$require$S('fs');
+});
+$__jsx_lazy_init(node, "path", function () {
+ return node$require$S('path');
+});
+$__jsx_lazy_init(node, "child_process", function () {
+ return node$require$S('child_process');
+});
+$__jsx_lazy_init(node, "url", function () {
+ return node$require$S('url');
+});
+$__jsx_lazy_init(node, "http", function () {
+ return node$require$S('http');
+});
+$__jsx_lazy_init(node, "https", function () {
+ return node$require$S('https');
+});
+$__jsx_lazy_init(node, "net", function () {
+ return node$require$S('net');
+});
+$__jsx_lazy_init(Oktavia, "eof", function () {
+ return String.fromCharCode(0);
+});
+$__jsx_lazy_init(Oktavia, "eob", function () {
+ return String.fromCharCode(1);
+});
+$__jsx_lazy_init(Oktavia, "unknown", function () {
+ return String.fromCharCode(3);
+});
+$__jsx_lazy_init(Style, "console", function () {
+ return ({ 'title': [ '\x1B[32m\x1b[4m', '\x1B[39m\x1b[0m' ], 'url': [ '\x1B[34m', '\x1B[39m' ], 'hit': [ '\x1B[4m', '\x1B[0m' ], 'del': [ '\x1B[9m', '\x1B[0m' ], 'summary': [ '\x1B[90m', '\x1B[39m' ] });
+});
+$__jsx_lazy_init(Style, "html", function () {
+ return ({ 'title': [ '<span class="title">', '</span>' ], 'url': [ '<span class="url">', '</span>' ], 'hit': [ '<span class="hit">', '</span>' ], 'del': [ '<del>', '</del>' ], 'summary': [ '<span class="reuslt">', '</span>' ] });
+});
+$__jsx_lazy_init(Style, "ignore", function () {
+ return ({ 'tilte': [ '', '' ], 'url': [ '', '' ], 'hit': [ '', '' ], 'del': [ '', '' ], 'summary': [ '', '' ] });
+});
+Binary._base64EncodeChars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
+$__jsx_lazy_init(Binary, "_base64DecodeChars", function () {
+ return [ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 62, -1, -1, -1, 63, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, -1, -1, -1, -1, -1, -1, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -1, -1, -1, -1, -1, -1, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, -1, -1, -1, -1 ];
+});
+js.global = (function () { return this; })();
+$__jsx_lazy_init(_Common, "buffers", function () {
+ return [ "comment", "sgmlDecl", "textNode", "tagName", "doctype", "procInstName", "procInstBody", "entity", "attribName", "attribValue", "cdata", "script" ];
+});
+$__jsx_lazy_init(_Common, "EVENTS", function () {
+ return [ "text", "processinginstruction", "sgmldeclaration", "doctype", "comment", "attribute", "opentag", "closetag", "opencdata", "cdata", "clo_State.CDATA", "error", "end", "ready", "script", "opennamespace", "closenamespace" ];
+});
+_Common.MAX_BUFFER_LENGTH = 65536;
+_State.BEGIN = 1;
+_State.TEXT = 2;
+_State.TEXT_ENTITY = 3;
+_State.OPEN_WAKA = 4;
+_State.SGML_DECL = 5;
+_State.SGML_DECL_QUOTED = 6;
+_State.DOCTYPE = 7;
+_State.DOCTYPE_QUOTED = 8;
+_State.DOCTYPE_DTD = 9;
+_State.DOCTYPE_DTD_QUOTED = 10;
+_State.COMMENT_STARTING = 11;
+_State.COMMENT = 12;
+_State.COMMENT_ENDING = 13;
+_State.COMMENT_ENDED = 14;
+_State.CDATA = 15;
+_State.CDATA_ENDING = 16;
+_State.CDATA_ENDING_2 = 17;
+_State.PROC_INST = 18;
+_State.PROC_INST_BODY = 19;
+_State.PROC_INST_ENDING = 20;
+_State.OPEN_TAG = 21;
+_State.OPEN_TAG_SLASH = 22;
+_State.ATTRIB = 23;
+_State.ATTRIB_NAME = 24;
+_State.ATTRIB_NAME_SAW_WHITE = 25;
+_State.ATTRIB_VALUE = 26;
+_State.ATTRIB_VALUE_QUOTED = 27;
+_State.ATTRIB_VALUE_UNQUOTED = 28;
+_State.ATTRIB_VALUE_ENTITY_Q = 29;
+_State.ATTRIB_VALUE_ENTITY_U = 30;
+_State.CLOSE_TAG = 31;
+_State.CLOSE_TAG_SAW_WHITE = 32;
+_State.SCRIPT = 33;
+_State.SCRIPT_ENDING = 34;
+$__jsx_lazy_init(_Entities, "_entities", function () {
+ return ({ "amp": "&", "gt": ">", "lt": "<", "quot": "\"", "apos": "'", "AElig": 198, "Aacute": 193, "Acirc": 194, "Agrave": 192, "Aring": 197, "Atilde": 195, "Auml": 196, "Ccedil": 199, "ETH": 208, "Eacute": 201, "Ecirc": 202, "Egrave": 200, "Euml": 203, "Iacute": 205, "Icirc": 206, "Igrave": 204, "Iuml": 207, "Ntilde": 209, "Oacute": 211, "Ocirc": 212, "Ograve": 210, "Oslash": 216, "Otilde": 213, "Ouml": 214, "THORN": 222, "Uacute": 218, "Ucirc": 219, "Ugrave": 217, "Uuml": 220, "Yacute": 221, "aacute": 225, "acirc": 226, "aelig": 230, "agrave": 224, "aring": 229, "atilde": 227, "auml": 228, "ccedil": 231, "eacute": 233, "ecirc": 234, "egrave": 232, "eth": 240, "euml": 235, "iacute": 237, "icirc": 238, "igrave": 236, "iuml": 239, "ntilde": 241, "oacute": 243, "ocirc": 244, "ograve": 242, "oslash": 248, "otilde": 245, "ouml": 246, "szlig": 223, "thorn": 254, "uacute": 250, "ucirc": 251, "ugrave": 249, "uuml": 252, "yacute": 253, "yuml": 255, "copy": 169, "reg": 174, "nbsp": 160, "iexcl": 161, "cent": 162, "pound": 163, "curren": 164, "yen": 165, "brvbar": 166, "sect": 167, "uml": 168, "ordf": 170, "laquo": 171, "not": 172, "shy": 173, "macr": 175, "deg": 176, "plusmn": 177, "sup1": 185, "sup2": 178, "sup3": 179, "acute": 180, "micro": 181, "para": 182, "middot": 183, "cedil": 184, "ordm": 186, "raquo": 187, "frac14": 188, "frac12": 189, "frac34": 190, "iquest": 191, "times": 215, "divide": 247, "OElig": 338, "oelig": 339, "Scaron": 352, "scaron": 353, "Yuml": 376, "fnof": 402, "circ": 710, "tilde": 732, "Alpha": 913, "Beta": 914, "Gamma": 915, "Delta": 916, "Epsilon": 917, "Zeta": 918, "Eta": 919, "Theta": 920, "Iota": 921, "Kappa": 922, "Lambda": 923, "Mu": 924, "Nu": 925, "Xi": 926, "Omicron": 927, "Pi": 928, "Rho": 929, "Sigma": 931, "Tau": 932, "Upsilon": 933, "Phi": 934, "Chi": 935, "Psi": 936, "Omega": 937, "alpha": 945, "beta": 946, "gamma": 947, "delta": 948, "epsilon": 949, "zeta": 950, "eta": 951, "theta": 952, "iota": 953, "kappa": 954, "lambda": 955, "mu": 956, "nu": 957, "xi": 958, "omicron": 959, "pi": 960, "rho": 961, "sigmaf": 962, "sigma": 963, "tau": 964, "upsilon": 965, "phi": 966, "chi": 967, "psi": 968, "omega": 969, "thetasym": 977, "upsih": 978, "piv": 982, "ensp": 8194, "emsp": 8195, "thinsp": 8201, "zwnj": 8204, "zwj": 8205, "lrm": 8206, "rlm": 8207, "ndash": 8211, "mdash": 8212, "lsquo": 8216, "rsquo": 8217, "sbquo": 8218, "ldquo": 8220, "rdquo": 8221, "bdquo": 8222, "dagger": 8224, "Dagger": 8225, "bull": 8226, "hellip": 8230, "permil": 8240, "prime": 8242, "Prime": 8243, "lsaquo": 8249, "rsaquo": 8250, "oline": 8254, "frasl": 8260, "euro": 8364, "image": 8465, "weierp": 8472, "real": 8476, "trade": 8482, "alefsym": 8501, "larr": 8592, "uarr": 8593, "rarr": 8594, "darr": 8595, "harr": 8596, "crarr": 8629, "lArr": 8656, "uArr": 8657, "rArr": 8658, "dArr": 8659, "hArr": 8660, "forall": 8704, "part": 8706, "exist": 8707, "empty": 8709, "nabla": 8711, "isin": 8712, "notin": 8713, "ni": 8715, "prod": 8719, "sum": 8721, "minus": 8722, "lowast": 8727, "radic": 8730, "prop": 8733, "infin": 8734, "ang": 8736, "and": 8743, "or": 8744, "cap": 8745, "cup": 8746, "int": 8747, "there4": 8756, "sim": 8764, "cong": 8773, "asymp": 8776, "ne": 8800, "equiv": 8801, "le": 8804, "ge": 8805, "sub": 8834, "sup": 8835, "nsub": 8836, "sube": 8838, "supe": 8839, "oplus": 8853, "otimes": 8855, "perp": 8869, "sdot": 8901, "lceil": 8968, "rceil": 8969, "lfloor": 8970, "rfloor": 8971, "lang": 9001, "rang": 9002, "loz": 9674, "spades": 9824, "clubs": 9827, "hearts": 9829, "diams": 9830 });
+});
+TurkishStemmer.serialVersionUID = 1;
+$__jsx_lazy_init(TurkishStemmer, "methodObject", function () {
+ return new TurkishStemmer$();
+});
+$__jsx_lazy_init(TurkishStemmer, "a_0", function () {
+ return [ new Among$SII("m", -1, -1), new Among$SII("n", -1, -1), new Among$SII("miz", -1, -1), new Among$SII("niz", -1, -1), new Among$SII("muz", -1, -1), new Among$SII("nuz", -1, -1), new Among$SII("m\u00FCz", -1, -1), new Among$SII("n\u00FCz", -1, -1), new Among$SII("m\u0131z", -1, -1), new Among$SII("n\u0131z", -1, -1) ];
+});
+$__jsx_lazy_init(TurkishStemmer, "a_1", function () {
+ return [ new Among$SII("leri", -1, -1), new Among$SII("lar\u0131", -1, -1) ];
+});
+$__jsx_lazy_init(TurkishStemmer, "a_2", function () {
+ return [ new Among$SII("ni", -1, -1), new Among$SII("nu", -1, -1), new Among$SII("n\u00FC", -1, -1), new Among$SII("n\u0131", -1, -1) ];
+});
+$__jsx_lazy_init(TurkishStemmer, "a_3", function () {
+ return [ new Among$SII("in", -1, -1), new Among$SII("un", -1, -1), new Among$SII("\u00FCn", -1, -1), new Among$SII("\u0131n", -1, -1) ];
+});
+$__jsx_lazy_init(TurkishStemmer, "a_4", function () {
+ return [ new Among$SII("a", -1, -1), new Among$SII("e", -1, -1) ];
+});
+$__jsx_lazy_init(TurkishStemmer, "a_5", function () {
+ return [ new Among$SII("na", -1, -1), new Among$SII("ne", -1, -1) ];
+});
+$__jsx_lazy_init(TurkishStemmer, "a_6", function () {
+ return [ new Among$SII("da", -1, -1), new Among$SII("ta", -1, -1), new Among$SII("de", -1, -1), new Among$SII("te", -1, -1) ];
+});
+$__jsx_lazy_init(TurkishStemmer, "a_7", function () {
+ return [ new Among$SII("nda", -1, -1), new Among$SII("nde", -1, -1) ];
+});
+$__jsx_lazy_init(TurkishStemmer, "a_8", function () {
+ return [ new Among$SII("dan", -1, -1), new Among$SII("tan", -1, -1), new Among$SII("den", -1, -1), new Among$SII("ten", -1, -1) ];
+});
+$__jsx_lazy_init(TurkishStemmer, "a_9", function () {
+ return [ new Among$SII("ndan", -1, -1), new Among$SII("nden", -1, -1) ];
+});
+$__jsx_lazy_init(TurkishStemmer, "a_10", function () {
+ return [ new Among$SII("la", -1, -1), new Among$SII("le", -1, -1) ];
+});
+$__jsx_lazy_init(TurkishStemmer, "a_11", function () {
+ return [ new Among$SII("ca", -1, -1), new Among$SII("ce", -1, -1) ];
+});
+$__jsx_lazy_init(TurkishStemmer, "a_12", function () {
+ return [ new Among$SII("im", -1, -1), new Among$SII("um", -1, -1), new Among$SII("\u00FCm", -1, -1), new Among$SII("\u0131m", -1, -1) ];
+});
+$__jsx_lazy_init(TurkishStemmer, "a_13", function () {
+ return [ new Among$SII("sin", -1, -1), new Among$SII("sun", -1, -1), new Among$SII("s\u00FCn", -1, -1), new Among$SII("s\u0131n", -1, -1) ];
+});
+$__jsx_lazy_init(TurkishStemmer, "a_14", function () {
+ return [ new Among$SII("iz", -1, -1), new Among$SII("uz", -1, -1), new Among$SII("\u00FCz", -1, -1), new Among$SII("\u0131z", -1, -1) ];
+});
+$__jsx_lazy_init(TurkishStemmer, "a_15", function () {
+ return [ new Among$SII("siniz", -1, -1), new Among$SII("sunuz", -1, -1), new Among$SII("s\u00FCn\u00FCz", -1, -1), new Among$SII("s\u0131n\u0131z", -1, -1) ];
+});
+$__jsx_lazy_init(TurkishStemmer, "a_16", function () {
+ return [ new Among$SII("lar", -1, -1), new Among$SII("ler", -1, -1) ];
+});
+$__jsx_lazy_init(TurkishStemmer, "a_17", function () {
+ return [ new Among$SII("niz", -1, -1), new Among$SII("nuz", -1, -1), new Among$SII("n\u00FCz", -1, -1), new Among$SII("n\u0131z", -1, -1) ];
+});
+$__jsx_lazy_init(TurkishStemmer, "a_18", function () {
+ return [ new Among$SII("dir", -1, -1), new Among$SII("tir", -1, -1), new Among$SII("dur", -1, -1), new Among$SII("tur", -1, -1), new Among$SII("d\u00FCr", -1, -1), new Among$SII("t\u00FCr", -1, -1), new Among$SII("d\u0131r", -1, -1), new Among$SII("t\u0131r", -1, -1) ];
+});
+$__jsx_lazy_init(TurkishStemmer, "a_19", function () {
+ return [ new Among$SII("cas\u0131na", -1, -1), new Among$SII("cesine", -1, -1) ];
+});
+$__jsx_lazy_init(TurkishStemmer, "a_20", function () {
+ return [ new Among$SII("di", -1, -1), new Among$SII("ti", -1, -1), new Among$SII("dik", -1, -1), new Among$SII("tik", -1, -1), new Among$SII("duk", -1, -1), new Among$SII("tuk", -1, -1), new Among$SII("d\u00FCk", -1, -1), new Among$SII("t\u00FCk", -1, -1), new Among$SII("d\u0131k", -1, -1), new Among$SII("t\u0131k", -1, -1), new Among$SII("dim", -1, -1), new Among$SII("tim", -1, -1), new Among$SII("dum", -1, -1), new Among$SII("tum", -1, -1), new Among$SII("d\u00FCm", -1, -1), new Among$SII("t\u00FCm", -1, -1), new Among$SII("d\u0131m", -1, -1), new Among$SII("t\u0131m", -1, -1), new Among$SII("din", -1, -1), new Among$SII("tin", -1, -1), new Among$SII("dun", -1, -1), new Among$SII("tun", -1, -1), new Among$SII("d\u00FCn", -1, -1), new Among$SII("t\u00FCn", -1, -1), new Among$SII("d\u0131n", -1, -1), new Among$SII("t\u0131n", -1, -1), new Among$SII("du", -1, -1), new Among$SII("tu", -1, -1), new Among$SII("d\u00FC", -1, -1), new Among$SII("t\u00FC", -1, -1), new Among$SII("d\u0131", -1, -1), new Among$SII("t\u0131", -1, -1) ];
+});
+$__jsx_lazy_init(TurkishStemmer, "a_21", function () {
+ return [ new Among$SII("sa", -1, -1), new Among$SII("se", -1, -1), new Among$SII("sak", -1, -1), new Among$SII("sek", -1, -1), new Among$SII("sam", -1, -1), new Among$SII("sem", -1, -1), new Among$SII("san", -1, -1), new Among$SII("sen", -1, -1) ];
+});
+$__jsx_lazy_init(TurkishStemmer, "a_22", function () {
+ return [ new Among$SII("mi\u015F", -1, -1), new Among$SII("mu\u015F", -1, -1), new Among$SII("m\u00FC\u015F", -1, -1), new Among$SII("m\u0131\u015F", -1, -1) ];
+});
+$__jsx_lazy_init(TurkishStemmer, "a_23", function () {
+ return [ new Among$SII("b", -1, 1), new Among$SII("c", -1, 2), new Among$SII("d", -1, 3), new Among$SII("\u011F", -1, 4) ];
+});
+$__jsx_lazy_init(TurkishStemmer, "g_vowel", function () {
+ return [ 17, 65, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 8, 0, 0, 0, 0, 0, 0, 1 ];
+});
+$__jsx_lazy_init(TurkishStemmer, "g_U", function () {
+ return [ 1, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 1 ];
+});
+$__jsx_lazy_init(TurkishStemmer, "g_vowel1", function () {
+ return [ 1, 64, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1 ];
+});
+$__jsx_lazy_init(TurkishStemmer, "g_vowel2", function () {
+ return [ 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 130 ];
+});
+$__jsx_lazy_init(TurkishStemmer, "g_vowel3", function () {
+ return [ 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1 ];
+});
+$__jsx_lazy_init(TurkishStemmer, "g_vowel4", function () {
+ return [ 17 ];
+});
+$__jsx_lazy_init(TurkishStemmer, "g_vowel5", function () {
+ return [ 65 ];
+});
+$__jsx_lazy_init(TurkishStemmer, "g_vowel6", function () {
+ return [ 65 ];
+});
+SwedishStemmer.serialVersionUID = 1;
+$__jsx_lazy_init(SwedishStemmer, "methodObject", function () {
+ return new SwedishStemmer$();
+});
+$__jsx_lazy_init(SwedishStemmer, "a_0", function () {
+ return [ new Among$SII("a", -1, 1), new Among$SII("arna", 0, 1), new Among$SII("erna", 0, 1), new Among$SII("heterna", 2, 1), new Among$SII("orna", 0, 1), new Among$SII("ad", -1, 1), new Among$SII("e", -1, 1), new Among$SII("ade", 6, 1), new Among$SII("ande", 6, 1), new Among$SII("arne", 6, 1), new Among$SII("are", 6, 1), new Among$SII("aste", 6, 1), new Among$SII("en", -1, 1), new Among$SII("anden", 12, 1), new Among$SII("aren", 12, 1), new Among$SII("heten", 12, 1), new Among$SII("ern", -1, 1), new Among$SII("ar", -1, 1), new Among$SII("er", -1, 1), new Among$SII("heter", 18, 1), new Among$SII("or", -1, 1), new Among$SII("s", -1, 2), new Among$SII("as", 21, 1), new Among$SII("arnas", 22, 1), new Among$SII("ernas", 22, 1), new Among$SII("ornas", 22, 1), new Among$SII("es", 21, 1), new Among$SII("ades", 26, 1), new Among$SII("andes", 26, 1), new Among$SII("ens", 21, 1), new Among$SII("arens", 29, 1), new Among$SII("hetens", 29, 1), new Among$SII("erns", 21, 1), new Among$SII("at", -1, 1), new Among$SII("andet", -1, 1), new Among$SII("het", -1, 1), new Among$SII("ast", -1, 1) ];
+});
+$__jsx_lazy_init(SwedishStemmer, "a_1", function () {
+ return [ new Among$SII("dd", -1, -1), new Among$SII("gd", -1, -1), new Among$SII("nn", -1, -1), new Among$SII("dt", -1, -1), new Among$SII("gt", -1, -1), new Among$SII("kt", -1, -1), new Among$SII("tt", -1, -1) ];
+});
+$__jsx_lazy_init(SwedishStemmer, "a_2", function () {
+ return [ new Among$SII("ig", -1, 1), new Among$SII("lig", 0, 1), new Among$SII("els", -1, 1), new Among$SII("fullt", -1, 3), new Among$SII("l\u00F6st", -1, 2) ];
+});
+$__jsx_lazy_init(SwedishStemmer, "g_v", function () {
+ return [ 17, 65, 16, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 24, 0, 32 ];
+});
+$__jsx_lazy_init(SwedishStemmer, "g_s_ending", function () {
+ return [ 119, 127, 149 ];
+});
+SpanishStemmer.serialVersionUID = 1;
+$__jsx_lazy_init(SpanishStemmer, "methodObject", function () {
+ return new SpanishStemmer$();
+});
+$__jsx_lazy_init(SpanishStemmer, "a_0", function () {
+ return [ new Among$SII("", -1, 6), new Among$SII("\u00E1", 0, 1), new Among$SII("\u00E9", 0, 2), new Among$SII("\u00ED", 0, 3), new Among$SII("\u00F3", 0, 4), new Among$SII("\u00FA", 0, 5) ];
+});
+$__jsx_lazy_init(SpanishStemmer, "a_1", function () {
+ return [ new Among$SII("la", -1, -1), new Among$SII("sela", 0, -1), new Among$SII("le", -1, -1), new Among$SII("me", -1, -1), new Among$SII("se", -1, -1), new Among$SII("lo", -1, -1), new Among$SII("selo", 5, -1), new Among$SII("las", -1, -1), new Among$SII("selas", 7, -1), new Among$SII("les", -1, -1), new Among$SII("los", -1, -1), new Among$SII("selos", 10, -1), new Among$SII("nos", -1, -1) ];
+});
+$__jsx_lazy_init(SpanishStemmer, "a_2", function () {
+ return [ new Among$SII("ando", -1, 6), new Among$SII("iendo", -1, 6), new Among$SII("yendo", -1, 7), new Among$SII("\u00E1ndo", -1, 2), new Among$SII("i\u00E9ndo", -1, 1), new Among$SII("ar", -1, 6), new Among$SII("er", -1, 6), new Among$SII("ir", -1, 6), new Among$SII("\u00E1r", -1, 3), new Among$SII("\u00E9r", -1, 4), new Among$SII("\u00EDr", -1, 5) ];
+});
+$__jsx_lazy_init(SpanishStemmer, "a_3", function () {
+ return [ new Among$SII("ic", -1, -1), new Among$SII("ad", -1, -1), new Among$SII("os", -1, -1), new Among$SII("iv", -1, 1) ];
+});
+$__jsx_lazy_init(SpanishStemmer, "a_4", function () {
+ return [ new Among$SII("able", -1, 1), new Among$SII("ible", -1, 1), new Among$SII("ante", -1, 1) ];
+});
+$__jsx_lazy_init(SpanishStemmer, "a_5", function () {
+ return [ new Among$SII("ic", -1, 1), new Among$SII("abil", -1, 1), new Among$SII("iv", -1, 1) ];
+});
+$__jsx_lazy_init(SpanishStemmer, "a_6", function () {
+ return [ new Among$SII("ica", -1, 1), new Among$SII("ancia", -1, 2), new Among$SII("encia", -1, 5), new Among$SII("adora", -1, 2), new Among$SII("osa", -1, 1), new Among$SII("ista", -1, 1), new Among$SII("iva", -1, 9), new Among$SII("anza", -1, 1), new Among$SII("log\u00EDa", -1, 3), new Among$SII("idad", -1, 8), new Among$SII("able", -1, 1), new Among$SII("ible", -1, 1), new Among$SII("ante", -1, 2), new Among$SII("mente", -1, 7), new Among$SII("amente", 13, 6), new Among$SII("aci\u00F3n", -1, 2), new Among$SII("uci\u00F3n", -1, 4), new Among$SII("ico", -1, 1), new Among$SII("ismo", -1, 1), new Among$SII("oso", -1, 1), new Among$SII("amiento", -1, 1), new Among$SII("imiento", -1, 1), new Among$SII("ivo", -1, 9), new Among$SII("ador", -1, 2), new Among$SII("icas", -1, 1), new Among$SII("ancias", -1, 2), new Among$SII("encias", -1, 5), new Among$SII("adoras", -1, 2), new Among$SII("osas", -1, 1), new Among$SII("istas", -1, 1), new Among$SII("ivas", -1, 9), new Among$SII("anzas", -1, 1), new Among$SII("log\u00EDas", -1, 3), new Among$SII("idades", -1, 8), new Among$SII("ables", -1, 1), new Among$SII("ibles", -1, 1), new Among$SII("aciones", -1, 2), new Among$SII("uciones", -1, 4), new Among$SII("adores", -1, 2), new Among$SII("antes", -1, 2), new Among$SII("icos", -1, 1), new Among$SII("ismos", -1, 1), new Among$SII("osos", -1, 1), new Among$SII("amientos", -1, 1), new Among$SII("imientos", -1, 1), new Among$SII("ivos", -1, 9) ];
+});
+$__jsx_lazy_init(SpanishStemmer, "a_7", function () {
+ return [ new Among$SII("ya", -1, 1), new Among$SII("ye", -1, 1), new Among$SII("yan", -1, 1), new Among$SII("yen", -1, 1), new Among$SII("yeron", -1, 1), new Among$SII("yendo", -1, 1), new Among$SII("yo", -1, 1), new Among$SII("yas", -1, 1), new Among$SII("yes", -1, 1), new Among$SII("yais", -1, 1), new Among$SII("yamos", -1, 1), new Among$SII("y\u00F3", -1, 1) ];
+});
+$__jsx_lazy_init(SpanishStemmer, "a_8", function () {
+ return [ new Among$SII("aba", -1, 2), new Among$SII("ada", -1, 2), new Among$SII("ida", -1, 2), new Among$SII("ara", -1, 2), new Among$SII("iera", -1, 2), new Among$SII("\u00EDa", -1, 2), new Among$SII("ar\u00EDa", 5, 2), new Among$SII("er\u00EDa", 5, 2), new Among$SII("ir\u00EDa", 5, 2), new Among$SII("ad", -1, 2), new Among$SII("ed", -1, 2), new Among$SII("id", -1, 2), new Among$SII("ase", -1, 2), new Among$SII("iese", -1, 2), new Among$SII("aste", -1, 2), new Among$SII("iste", -1, 2), new Among$SII("an", -1, 2), new Among$SII("aban", 16, 2), new Among$SII("aran", 16, 2), new Among$SII("ieran", 16, 2), new Among$SII("\u00EDan", 16, 2), new Among$SII("ar\u00EDan", 20, 2), new Among$SII("er\u00EDan", 20, 2), new Among$SII("ir\u00EDan", 20, 2), new Among$SII("en", -1, 1), new Among$SII("asen", 24, 2), new Among$SII("iesen", 24, 2), new Among$SII("aron", -1, 2), new Among$SII("ieron", -1, 2), new Among$SII("ar\u00E1n", -1, 2), new Among$SII("er\u00E1n", -1, 2), new Among$SII("ir\u00E1n", -1, 2), new Among$SII("ado", -1, 2), new Among$SII("ido", -1, 2), new Among$SII("ando", -1, 2), new Among$SII("iendo", -1, 2), new Among$SII("ar", -1, 2), new Among$SII("er", -1, 2), new Among$SII("ir", -1, 2), new Among$SII("as", -1, 2), new Among$SII("abas", 39, 2), new Among$SII("adas", 39, 2), new Among$SII("idas", 39, 2), new Among$SII("aras", 39, 2), new Among$SII("ieras", 39, 2), new Among$SII("\u00EDas", 39, 2), new Among$SII("ar\u00EDas", 45, 2), new Among$SII("er\u00EDas", 45, 2), new Among$SII("ir\u00EDas", 45, 2), new Among$SII("es", -1, 1), new Among$SII("ases", 49, 2), new Among$SII("ieses", 49, 2), new Among$SII("abais", -1, 2), new Among$SII("arais", -1, 2), new Among$SII("ierais", -1, 2), new Among$SII("\u00EDais", -1, 2), new Among$SII("ar\u00EDais", 55, 2), new Among$SII("er\u00EDais", 55, 2), new Among$SII("ir\u00EDais", 55, 2), new Among$SII("aseis", -1, 2), new Among$SII("ieseis", -1, 2), new Among$SII("asteis", -1, 2), new Among$SII("isteis", -1, 2), new Among$SII("\u00E1is", -1, 2), new Among$SII("\u00E9is", -1, 1), new Among$SII("ar\u00E9is", 64, 2), new Among$SII("er\u00E9is", 64, 2), new Among$SII("ir\u00E9is", 64, 2), new Among$SII("ados", -1, 2), new Among$SII("idos", -1, 2), new Among$SII("amos", -1, 2), new Among$SII("\u00E1bamos", 70, 2), new Among$SII("\u00E1ramos", 70, 2), new Among$SII("i\u00E9ramos", 70, 2), new Among$SII("\u00EDamos", 70, 2), new Among$SII("ar\u00EDamos", 74, 2), new Among$SII("er\u00EDamos", 74, 2), new Among$SII("ir\u00EDamos", 74, 2), new Among$SII("emos", -1, 1), new Among$SII("aremos", 78, 2), new Among$SII("eremos", 78, 2), new Among$SII("iremos", 78, 2), new Among$SII("\u00E1semos", 78, 2), new Among$SII("i\u00E9semos", 78, 2), new Among$SII("imos", -1, 2), new Among$SII("ar\u00E1s", -1, 2), new Among$SII("er\u00E1s", -1, 2), new Among$SII("ir\u00E1s", -1, 2), new Among$SII("\u00EDs", -1, 2), new Among$SII("ar\u00E1", -1, 2), new Among$SII("er\u00E1", -1, 2), new Among$SII("ir\u00E1", -1, 2), new Among$SII("ar\u00E9", -1, 2), new Among$SII("er\u00E9", -1, 2), new Among$SII("ir\u00E9", -1, 2), new Among$SII("i\u00F3", -1, 2) ];
+});
+$__jsx_lazy_init(SpanishStemmer, "a_9", function () {
+ return [ new Among$SII("a", -1, 1), new Among$SII("e", -1, 2), new Among$SII("o", -1, 1), new Among$SII("os", -1, 1), new Among$SII("\u00E1", -1, 1), new Among$SII("\u00E9", -1, 2), new Among$SII("\u00ED", -1, 1), new Among$SII("\u00F3", -1, 1) ];
+});
+$__jsx_lazy_init(SpanishStemmer, "g_v", function () {
+ return [ 17, 65, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 17, 4, 10 ];
+});
+RussianStemmer.serialVersionUID = 1;
+$__jsx_lazy_init(RussianStemmer, "methodObject", function () {
+ return new RussianStemmer$();
+});
+$__jsx_lazy_init(RussianStemmer, "a_0", function () {
+ return [ new Among$SII("\u0432", -1, 1), new Among$SII("\u0438\u0432", 0, 2), new Among$SII("\u044B\u0432", 0, 2), new Among$SII("\u0432\u0448\u0438", -1, 1), new Among$SII("\u0438\u0432\u0448\u0438", 3, 2), new Among$SII("\u044B\u0432\u0448\u0438", 3, 2), new Among$SII("\u0432\u0448\u0438\u0441\u044C", -1, 1), new Among$SII("\u0438\u0432\u0448\u0438\u0441\u044C", 6, 2), new Among$SII("\u044B\u0432\u0448\u0438\u0441\u044C", 6, 2) ];
+});
+$__jsx_lazy_init(RussianStemmer, "a_1", function () {
+ return [ new Among$SII("\u0435\u0435", -1, 1), new Among$SII("\u0438\u0435", -1, 1), new Among$SII("\u043E\u0435", -1, 1), new Among$SII("\u044B\u0435", -1, 1), new Among$SII("\u0438\u043C\u0438", -1, 1), new Among$SII("\u044B\u043C\u0438", -1, 1), new Among$SII("\u0435\u0439", -1, 1), new Among$SII("\u0438\u0439", -1, 1), new Among$SII("\u043E\u0439", -1, 1), new Among$SII("\u044B\u0439", -1, 1), new Among$SII("\u0435\u043C", -1, 1), new Among$SII("\u0438\u043C", -1, 1), new Among$SII("\u043E\u043C", -1, 1), new Among$SII("\u044B\u043C", -1, 1), new Among$SII("\u0435\u0433\u043E", -1, 1), new Among$SII("\u043E\u0433\u043E", -1, 1), new Among$SII("\u0435\u043C\u0443", -1, 1), new Among$SII("\u043E\u043C\u0443", -1, 1), new Among$SII("\u0438\u0445", -1, 1), new Among$SII("\u044B\u0445", -1, 1), new Among$SII("\u0435\u044E", -1, 1), new Among$SII("\u043E\u044E", -1, 1), new Among$SII("\u0443\u044E", -1, 1), new Among$SII("\u044E\u044E", -1, 1), new Among$SII("\u0430\u044F", -1, 1), new Among$SII("\u044F\u044F", -1, 1) ];
+});
+$__jsx_lazy_init(RussianStemmer, "a_2", function () {
+ return [ new Among$SII("\u0435\u043C", -1, 1), new Among$SII("\u043D\u043D", -1, 1), new Among$SII("\u0432\u0448", -1, 1), new Among$SII("\u0438\u0432\u0448", 2, 2), new Among$SII("\u044B\u0432\u0448", 2, 2), new Among$SII("\u0449", -1, 1), new Among$SII("\u044E\u0449", 5, 1), new Among$SII("\u0443\u044E\u0449", 6, 2) ];
+});
+$__jsx_lazy_init(RussianStemmer, "a_3", function () {
+ return [ new Among$SII("\u0441\u044C", -1, 1), new Among$SII("\u0441\u044F", -1, 1) ];
+});
+$__jsx_lazy_init(RussianStemmer, "a_4", function () {
+ return [ new Among$SII("\u043B\u0430", -1, 1), new Among$SII("\u0438\u043B\u0430", 0, 2), new Among$SII("\u044B\u043B\u0430", 0, 2), new Among$SII("\u043D\u0430", -1, 1), new Among$SII("\u0435\u043D\u0430", 3, 2), new Among$SII("\u0435\u0442\u0435", -1, 1), new Among$SII("\u0438\u0442\u0435", -1, 2), new Among$SII("\u0439\u0442\u0435", -1, 1), new Among$SII("\u0435\u0439\u0442\u0435", 7, 2), new Among$SII("\u0443\u0439\u0442\u0435", 7, 2), new Among$SII("\u043B\u0438", -1, 1), new Among$SII("\u0438\u043B\u0438", 10, 2), new Among$SII("\u044B\u043B\u0438", 10, 2), new Among$SII("\u0439", -1, 1), new Among$SII("\u0435\u0439", 13, 2), new Among$SII("\u0443\u0439", 13, 2), new Among$SII("\u043B", -1, 1), new Among$SII("\u0438\u043B", 16, 2), new Among$SII("\u044B\u043B", 16, 2), new Among$SII("\u0435\u043C", -1, 1), new Among$SII("\u0438\u043C", -1, 2), new Among$SII("\u044B\u043C", -1, 2), new Among$SII("\u043D", -1, 1), new Among$SII("\u0435\u043D", 22, 2), new Among$SII("\u043B\u043E", -1, 1), new Among$SII("\u0438\u043B\u043E", 24, 2), new Among$SII("\u044B\u043B\u043E", 24, 2), new Among$SII("\u043D\u043E", -1, 1), new Among$SII("\u0435\u043D\u043E", 27, 2), new Among$SII("\u043D\u043D\u043E", 27, 1), new Among$SII("\u0435\u0442", -1, 1), new Among$SII("\u0443\u0435\u0442", 30, 2), new Among$SII("\u0438\u0442", -1, 2), new Among$SII("\u044B\u0442", -1, 2), new Among$SII("\u044E\u0442", -1, 1), new Among$SII("\u0443\u044E\u0442", 34, 2), new Among$SII("\u044F\u0442", -1, 2), new Among$SII("\u043D\u044B", -1, 1), new Among$SII("\u0435\u043D\u044B", 37, 2), new Among$SII("\u0442\u044C", -1, 1), new Among$SII("\u0438\u0442\u044C", 39, 2), new Among$SII("\u044B\u0442\u044C", 39, 2), new Among$SII("\u0435\u0448\u044C", -1, 1), new Among$SII("\u0438\u0448\u044C", -1, 2), new Among$SII("\u044E", -1, 2), new Among$SII("\u0443\u044E", 44, 2) ];
+});
+$__jsx_lazy_init(RussianStemmer, "a_5", function () {
+ return [ new Among$SII("\u0430", -1, 1), new Among$SII("\u0435\u0432", -1, 1), new Among$SII("\u043E\u0432", -1, 1), new Among$SII("\u0435", -1, 1), new Among$SII("\u0438\u0435", 3, 1), new Among$SII("\u044C\u0435", 3, 1), new Among$SII("\u0438", -1, 1), new Among$SII("\u0435\u0438", 6, 1), new Among$SII("\u0438\u0438", 6, 1), new Among$SII("\u0430\u043C\u0438", 6, 1), new Among$SII("\u044F\u043C\u0438", 6, 1), new Among$SII("\u0438\u044F\u043C\u0438", 10, 1), new Among$SII("\u0439", -1, 1), new Among$SII("\u0435\u0439", 12, 1), new Among$SII("\u0438\u0435\u0439", 13, 1), new Among$SII("\u0438\u0439", 12, 1), new Among$SII("\u043E\u0439", 12, 1), new Among$SII("\u0430\u043C", -1, 1), new Among$SII("\u0435\u043C", -1, 1), new Among$SII("\u0438\u0435\u043C", 18, 1), new Among$SII("\u043E\u043C", -1, 1), new Among$SII("\u044F\u043C", -1, 1), new Among$SII("\u0438\u044F\u043C", 21, 1), new Among$SII("\u043E", -1, 1), new Among$SII("\u0443", -1, 1), new Among$SII("\u0430\u0445", -1, 1), new Among$SII("\u044F\u0445", -1, 1), new Among$SII("\u0438\u044F\u0445", 26, 1), new Among$SII("\u044B", -1, 1), new Among$SII("\u044C", -1, 1), new Among$SII("\u044E", -1, 1), new Among$SII("\u0438\u044E", 30, 1), new Among$SII("\u044C\u044E", 30, 1), new Among$SII("\u044F", -1, 1), new Among$SII("\u0438\u044F", 33, 1), new Among$SII("\u044C\u044F", 33, 1) ];
+});
+$__jsx_lazy_init(RussianStemmer, "a_6", function () {
+ return [ new Among$SII("\u043E\u0441\u0442", -1, 1), new Among$SII("\u043E\u0441\u0442\u044C", -1, 1) ];
+});
+$__jsx_lazy_init(RussianStemmer, "a_7", function () {
+ return [ new Among$SII("\u0435\u0439\u0448\u0435", -1, 1), new Among$SII("\u043D", -1, 2), new Among$SII("\u0435\u0439\u0448", -1, 1), new Among$SII("\u044C", -1, 3) ];
+});
+$__jsx_lazy_init(RussianStemmer, "g_v", function () {
+ return [ 33, 65, 8, 232 ];
+});
+RomanianStemmer.serialVersionUID = 1;
+$__jsx_lazy_init(RomanianStemmer, "methodObject", function () {
+ return new RomanianStemmer$();
+});
+$__jsx_lazy_init(RomanianStemmer, "a_0", function () {
+ return [ new Among$SII("", -1, 3), new Among$SII("I", 0, 1), new Among$SII("U", 0, 2) ];
+});
+$__jsx_lazy_init(RomanianStemmer, "a_1", function () {
+ return [ new Among$SII("ea", -1, 3), new Among$SII("a\u0163ia", -1, 7), new Among$SII("aua", -1, 2), new Among$SII("iua", -1, 4), new Among$SII("a\u0163ie", -1, 7), new Among$SII("ele", -1, 3), new Among$SII("ile", -1, 5), new Among$SII("iile", 6, 4), new Among$SII("iei", -1, 4), new Among$SII("atei", -1, 6), new Among$SII("ii", -1, 4), new Among$SII("ului", -1, 1), new Among$SII("ul", -1, 1), new Among$SII("elor", -1, 3), new Among$SII("ilor", -1, 4), new Among$SII("iilor", 14, 4) ];
+});
+$__jsx_lazy_init(RomanianStemmer, "a_2", function () {
+ return [ new Among$SII("icala", -1, 4), new Among$SII("iciva", -1, 4), new Among$SII("ativa", -1, 5), new Among$SII("itiva", -1, 6), new Among$SII("icale", -1, 4), new Among$SII("a\u0163iune", -1, 5), new Among$SII("i\u0163iune", -1, 6), new Among$SII("atoare", -1, 5), new Among$SII("itoare", -1, 6), new Among$SII("\u0103toare", -1, 5), new Among$SII("icitate", -1, 4), new Among$SII("abilitate", -1, 1), new Among$SII("ibilitate", -1, 2), new Among$SII("ivitate", -1, 3), new Among$SII("icive", -1, 4), new Among$SII("ative", -1, 5), new Among$SII("itive", -1, 6), new Among$SII("icali", -1, 4), new Among$SII("atori", -1, 5), new Among$SII("icatori", 18, 4), new Among$SII("itori", -1, 6), new Among$SII("\u0103tori", -1, 5), new Among$SII("icitati", -1, 4), new Among$SII("abilitati", -1, 1), new Among$SII("ivitati", -1, 3), new Among$SII("icivi", -1, 4), new Among$SII("ativi", -1, 5), new Among$SII("itivi", -1, 6), new Among$SII("icit\u0103i", -1, 4), new Among$SII("abilit\u0103i", -1, 1), new Among$SII("ivit\u0103i", -1, 3), new Among$SII("icit\u0103\u0163i", -1, 4), new Among$SII("abilit\u0103\u0163i", -1, 1), new Among$SII("ivit\u0103\u0163i", -1, 3), new Among$SII("ical", -1, 4), new Among$SII("ator", -1, 5), new Among$SII("icator", 35, 4), new Among$SII("itor", -1, 6), new Among$SII("\u0103tor", -1, 5), new Among$SII("iciv", -1, 4), new Among$SII("ativ", -1, 5), new Among$SII("itiv", -1, 6), new Among$SII("ical\u0103", -1, 4), new Among$SII("iciv\u0103", -1, 4), new Among$SII("ativ\u0103", -1, 5), new Among$SII("itiv\u0103", -1, 6) ];
+});
+$__jsx_lazy_init(RomanianStemmer, "a_3", function () {
+ return [ new Among$SII("ica", -1, 1), new Among$SII("abila", -1, 1), new Among$SII("ibila", -1, 1), new Among$SII("oasa", -1, 1), new Among$SII("ata", -1, 1), new Among$SII("ita", -1, 1), new Among$SII("anta", -1, 1), new Among$SII("ista", -1, 3), new Among$SII("uta", -1, 1), new Among$SII("iva", -1, 1), new Among$SII("ic", -1, 1), new Among$SII("ice", -1, 1), new Among$SII("abile", -1, 1), new Among$SII("ibile", -1, 1), new Among$SII("isme", -1, 3), new Among$SII("iune", -1, 2), new Among$SII("oase", -1, 1), new Among$SII("ate", -1, 1), new Among$SII("itate", 17, 1), new Among$SII("ite", -1, 1), new Among$SII("ante", -1, 1), new Among$SII("iste", -1, 3), new Among$SII("ute", -1, 1), new Among$SII("ive", -1, 1), new Among$SII("ici", -1, 1), new Among$SII("abili", -1, 1), new Among$SII("ibili", -1, 1), new Among$SII("iuni", -1, 2), new Among$SII("atori", -1, 1), new Among$SII("osi", -1, 1), new Among$SII("ati", -1, 1), new Among$SII("itati", 30, 1), new Among$SII("iti", -1, 1), new Among$SII("anti", -1, 1), new Among$SII("isti", -1, 3), new Among$SII("uti", -1, 1), new Among$SII("i\u015Fti", -1, 3), new Among$SII("ivi", -1, 1), new Among$SII("it\u0103i", -1, 1), new Among$SII("o\u015Fi", -1, 1), new Among$SII("it\u0103\u0163i", -1, 1), new Among$SII("abil", -1, 1), new Among$SII("ibil", -1, 1), new Among$SII("ism", -1, 3), new Among$SII("ator", -1, 1), new Among$SII("os", -1, 1), new Among$SII("at", -1, 1), new Among$SII("it", -1, 1), new Among$SII("ant", -1, 1), new Among$SII("ist", -1, 3), new Among$SII("ut", -1, 1), new Among$SII("iv", -1, 1), new Among$SII("ic\u0103", -1, 1), new Among$SII("abil\u0103", -1, 1), new Among$SII("ibil\u0103", -1, 1), new Among$SII("oas\u0103", -1, 1), new Among$SII("at\u0103", -1, 1), new Among$SII("it\u0103", -1, 1), new Among$SII("ant\u0103", -1, 1), new Among$SII("ist\u0103", -1, 3), new Among$SII("ut\u0103", -1, 1), new Among$SII("iv\u0103", -1, 1) ];
+});
+$__jsx_lazy_init(RomanianStemmer, "a_4", function () {
+ return [ new Among$SII("ea", -1, 1), new Among$SII("ia", -1, 1), new Among$SII("esc", -1, 1), new Among$SII("\u0103sc", -1, 1), new Among$SII("ind", -1, 1), new Among$SII("\u00E2nd", -1, 1), new Among$SII("are", -1, 1), new Among$SII("ere", -1, 1), new Among$SII("ire", -1, 1), new Among$SII("\u00E2re", -1, 1), new Among$SII("se", -1, 2), new Among$SII("ase", 10, 1), new Among$SII("sese", 10, 2), new Among$SII("ise", 10, 1), new Among$SII("use", 10, 1), new Among$SII("\u00E2se", 10, 1), new Among$SII("e\u015Fte", -1, 1), new Among$SII("\u0103\u015Fte", -1, 1), new Among$SII("eze", -1, 1), new Among$SII("ai", -1, 1), new Among$SII("eai", 19, 1), new Among$SII("iai", 19, 1), new Among$SII("sei", -1, 2), new Among$SII("e\u015Fti", -1, 1), new Among$SII("\u0103\u015Fti", -1, 1), new Among$SII("ui", -1, 1), new Among$SII("ezi", -1, 1), new Among$SII("\u00E2i", -1, 1), new Among$SII("a\u015Fi", -1, 1), new Among$SII("se\u015Fi", -1, 2), new Among$SII("ase\u015Fi", 29, 1), new Among$SII("sese\u015Fi", 29, 2), new Among$SII("ise\u015Fi", 29, 1), new Among$SII("use\u015Fi", 29, 1), new Among$SII("\u00E2se\u015Fi", 29, 1), new Among$SII("i\u015Fi", -1, 1), new Among$SII("u\u015Fi", -1, 1), new Among$SII("\u00E2\u015Fi", -1, 1), new Among$SII("a\u0163i", -1, 2), new Among$SII("ea\u0163i", 38, 1), new Among$SII("ia\u0163i", 38, 1), new Among$SII("e\u0163i", -1, 2), new Among$SII("i\u0163i", -1, 2), new Among$SII("\u00E2\u0163i", -1, 2), new Among$SII("ar\u0103\u0163i", -1, 1), new Among$SII("ser\u0103\u0163i", -1, 2), new Among$SII("aser\u0103\u0163i", 45, 1), new Among$SII("seser\u0103\u0163i", 45, 2), new Among$SII("iser\u0103\u0163i", 45, 1), new Among$SII("user\u0103\u0163i", 45, 1), new Among$SII("\u00E2ser\u0103\u0163i", 45, 1), new Among$SII("ir\u0103\u0163i", -1, 1), new Among$SII("ur\u0103\u0163i", -1, 1), new Among$SII("\u00E2r\u0103\u0163i", -1, 1), new Among$SII("am", -1, 1), new Among$SII("eam", 54, 1), new Among$SII("iam", 54, 1), new Among$SII("em", -1, 2), new Among$SII("asem", 57, 1), new Among$SII("sesem", 57, 2), new Among$SII("isem", 57, 1), new Among$SII("usem", 57, 1), new Among$SII("\u00E2sem", 57, 1), new Among$SII("im", -1, 2), new Among$SII("\u00E2m", -1, 2), new Among$SII("\u0103m", -1, 2), new Among$SII("ar\u0103m", 65, 1), new Among$SII("ser\u0103m", 65, 2), new Among$SII("aser\u0103m", 67, 1), new Among$SII("seser\u0103m", 67, 2), new Among$SII("iser\u0103m", 67, 1), new Among$SII("user\u0103m", 67, 1), new Among$SII("\u00E2ser\u0103m", 67, 1), new Among$SII("ir\u0103m", 65, 1), new Among$SII("ur\u0103m", 65, 1), new Among$SII("\u00E2r\u0103m", 65, 1), new Among$SII("au", -1, 1), new Among$SII("eau", 76, 1), new Among$SII("iau", 76, 1), new Among$SII("indu", -1, 1), new Among$SII("\u00E2ndu", -1, 1), new Among$SII("ez", -1, 1), new Among$SII("easc\u0103", -1, 1), new Among$SII("ar\u0103", -1, 1), new Among$SII("ser\u0103", -1, 2), new Among$SII("aser\u0103", 84, 1), new Among$SII("seser\u0103", 84, 2), new Among$SII("iser\u0103", 84, 1), new Among$SII("user\u0103", 84, 1), new Among$SII("\u00E2ser\u0103", 84, 1), new Among$SII("ir\u0103", -1, 1), new Among$SII("ur\u0103", -1, 1), new Among$SII("\u00E2r\u0103", -1, 1), new Among$SII("eaz\u0103", -1, 1) ];
+});
+$__jsx_lazy_init(RomanianStemmer, "a_5", function () {
+ return [ new Among$SII("a", -1, 1), new Among$SII("e", -1, 1), new Among$SII("ie", 1, 1), new Among$SII("i", -1, 1), new Among$SII("\u0103", -1, 1) ];
+});
+$__jsx_lazy_init(RomanianStemmer, "g_v", function () {
+ return [ 17, 65, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 32, 0, 0, 4 ];
+});
+PortugueseStemmer.serialVersionUID = 1;
+$__jsx_lazy_init(PortugueseStemmer, "methodObject", function () {
+ return new PortugueseStemmer$();
+});
+$__jsx_lazy_init(PortugueseStemmer, "a_0", function () {
+ return [ new Among$SII("", -1, 3), new Among$SII("\u00E3", 0, 1), new Among$SII("\u00F5", 0, 2) ];
+});
+$__jsx_lazy_init(PortugueseStemmer, "a_1", function () {
+ return [ new Among$SII("", -1, 3), new Among$SII("a~", 0, 1), new Among$SII("o~", 0, 2) ];
+});
+$__jsx_lazy_init(PortugueseStemmer, "a_2", function () {
+ return [ new Among$SII("ic", -1, -1), new Among$SII("ad", -1, -1), new Among$SII("os", -1, -1), new Among$SII("iv", -1, 1) ];
+});
+$__jsx_lazy_init(PortugueseStemmer, "a_3", function () {
+ return [ new Among$SII("ante", -1, 1), new Among$SII("avel", -1, 1), new Among$SII("\u00EDvel", -1, 1) ];
+});
+$__jsx_lazy_init(PortugueseStemmer, "a_4", function () {
+ return [ new Among$SII("ic", -1, 1), new Among$SII("abil", -1, 1), new Among$SII("iv", -1, 1) ];
+});
+$__jsx_lazy_init(PortugueseStemmer, "a_5", function () {
+ return [ new Among$SII("ica", -1, 1), new Among$SII("\u00E2ncia", -1, 1), new Among$SII("\u00EAncia", -1, 4), new Among$SII("ira", -1, 9), new Among$SII("adora", -1, 1), new Among$SII("osa", -1, 1), new Among$SII("ista", -1, 1), new Among$SII("iva", -1, 8), new Among$SII("eza", -1, 1), new Among$SII("log\u00EDa", -1, 2), new Among$SII("idade", -1, 7), new Among$SII("ante", -1, 1), new Among$SII("mente", -1, 6), new Among$SII("amente", 12, 5), new Among$SII("\u00E1vel", -1, 1), new Among$SII("\u00EDvel", -1, 1), new Among$SII("uci\u00F3n", -1, 3), new Among$SII("ico", -1, 1), new Among$SII("ismo", -1, 1), new Among$SII("oso", -1, 1), new Among$SII("amento", -1, 1), new Among$SII("imento", -1, 1), new Among$SII("ivo", -1, 8), new Among$SII("a\u00E7a~o", -1, 1), new Among$SII("ador", -1, 1), new Among$SII("icas", -1, 1), new Among$SII("\u00EAncias", -1, 4), new Among$SII("iras", -1, 9), new Among$SII("adoras", -1, 1), new Among$SII("osas", -1, 1), new Among$SII("istas", -1, 1), new Among$SII("ivas", -1, 8), new Among$SII("ezas", -1, 1), new Among$SII("log\u00EDas", -1, 2), new Among$SII("idades", -1, 7), new Among$SII("uciones", -1, 3), new Among$SII("adores", -1, 1), new Among$SII("antes", -1, 1), new Among$SII("a\u00E7o~es", -1, 1), new Among$SII("icos", -1, 1), new Among$SII("ismos", -1, 1), new Among$SII("osos", -1, 1), new Among$SII("amentos", -1, 1), new Among$SII("imentos", -1, 1), new Among$SII("ivos", -1, 8) ];
+});
+$__jsx_lazy_init(PortugueseStemmer, "a_6", function () {
+ return [ new Among$SII("ada", -1, 1), new Among$SII("ida", -1, 1), new Among$SII("ia", -1, 1), new Among$SII("aria", 2, 1), new Among$SII("eria", 2, 1), new Among$SII("iria", 2, 1), new Among$SII("ara", -1, 1), new Among$SII("era", -1, 1), new Among$SII("ira", -1, 1), new Among$SII("ava", -1, 1), new Among$SII("asse", -1, 1), new Among$SII("esse", -1, 1), new Among$SII("isse", -1, 1), new Among$SII("aste", -1, 1), new Among$SII("este", -1, 1), new Among$SII("iste", -1, 1), new Among$SII("ei", -1, 1), new Among$SII("arei", 16, 1), new Among$SII("erei", 16, 1), new Among$SII("irei", 16, 1), new Among$SII("am", -1, 1), new Among$SII("iam", 20, 1), new Among$SII("ariam", 21, 1), new Among$SII("eriam", 21, 1), new Among$SII("iriam", 21, 1), new Among$SII("aram", 20, 1), new Among$SII("eram", 20, 1), new Among$SII("iram", 20, 1), new Among$SII("avam", 20, 1), new Among$SII("em", -1, 1), new Among$SII("arem", 29, 1), new Among$SII("erem", 29, 1), new Among$SII("irem", 29, 1), new Among$SII("assem", 29, 1), new Among$SII("essem", 29, 1), new Among$SII("issem", 29, 1), new Among$SII("ado", -1, 1), new Among$SII("ido", -1, 1), new Among$SII("ando", -1, 1), new Among$SII("endo", -1, 1), new Among$SII("indo", -1, 1), new Among$SII("ara~o", -1, 1), new Among$SII("era~o", -1, 1), new Among$SII("ira~o", -1, 1), new Among$SII("ar", -1, 1), new Among$SII("er", -1, 1), new Among$SII("ir", -1, 1), new Among$SII("as", -1, 1), new Among$SII("adas", 47, 1), new Among$SII("idas", 47, 1), new Among$SII("ias", 47, 1), new Among$SII("arias", 50, 1), new Among$SII("erias", 50, 1), new Among$SII("irias", 50, 1), new Among$SII("aras", 47, 1), new Among$SII("eras", 47, 1), new Among$SII("iras", 47, 1), new Among$SII("avas", 47, 1), new Among$SII("es", -1, 1), new Among$SII("ardes", 58, 1), new Among$SII("erdes", 58, 1), new Among$SII("irdes", 58, 1), new Among$SII("ares", 58, 1), new Among$SII("eres", 58, 1), new Among$SII("ires", 58, 1), new Among$SII("asses", 58, 1), new Among$SII("esses", 58, 1), new Among$SII("isses", 58, 1), new Among$SII("astes", 58, 1), new Among$SII("estes", 58, 1), new Among$SII("istes", 58, 1), new Among$SII("is", -1, 1), new Among$SII("ais", 71, 1), new Among$SII("eis", 71, 1), new Among$SII("areis", 73, 1), new Among$SII("ereis", 73, 1), new Among$SII("ireis", 73, 1), new Among$SII("\u00E1reis", 73, 1), new Among$SII("\u00E9reis", 73, 1), new Among$SII("\u00EDreis", 73, 1), new Among$SII("\u00E1sseis", 73, 1), new Among$SII("\u00E9sseis", 73, 1), new Among$SII("\u00EDsseis", 73, 1), new Among$SII("\u00E1veis", 73, 1), new Among$SII("\u00EDeis", 73, 1), new Among$SII("ar\u00EDeis", 84, 1), new Among$SII("er\u00EDeis", 84, 1), new Among$SII("ir\u00EDeis", 84, 1), new Among$SII("ados", -1, 1), new Among$SII("idos", -1, 1), new Among$SII("amos", -1, 1), new Among$SII("\u00E1ramos", 90, 1), new Among$SII("\u00E9ramos", 90, 1), new Among$SII("\u00EDramos", 90, 1), new Among$SII("\u00E1vamos", 90, 1), new Among$SII("\u00EDamos", 90, 1), new Among$SII("ar\u00EDamos", 95, 1), new Among$SII("er\u00EDamos", 95, 1), new Among$SII("ir\u00EDamos", 95, 1), new Among$SII("emos", -1, 1), new Among$SII("aremos", 99, 1), new Among$SII("eremos", 99, 1), new Among$SII("iremos", 99, 1), new Among$SII("\u00E1ssemos", 99, 1), new Among$SII("\u00EAssemos", 99, 1), new Among$SII("\u00EDssemos", 99, 1), new Among$SII("imos", -1, 1), new Among$SII("armos", -1, 1), new Among$SII("ermos", -1, 1), new Among$SII("irmos", -1, 1), new Among$SII("\u00E1mos", -1, 1), new Among$SII("ar\u00E1s", -1, 1), new Among$SII("er\u00E1s", -1, 1), new Among$SII("ir\u00E1s", -1, 1), new Among$SII("eu", -1, 1), new Among$SII("iu", -1, 1), new Among$SII("ou", -1, 1), new Among$SII("ar\u00E1", -1, 1), new Among$SII("er\u00E1", -1, 1), new Among$SII("ir\u00E1", -1, 1) ];
+});
+$__jsx_lazy_init(PortugueseStemmer, "a_7", function () {
+ return [ new Among$SII("a", -1, 1), new Among$SII("i", -1, 1), new Among$SII("o", -1, 1), new Among$SII("os", -1, 1), new Among$SII("\u00E1", -1, 1), new Among$SII("\u00ED", -1, 1), new Among$SII("\u00F3", -1, 1) ];
+});
+$__jsx_lazy_init(PortugueseStemmer, "a_8", function () {
+ return [ new Among$SII("e", -1, 1), new Among$SII("\u00E7", -1, 2), new Among$SII("\u00E9", -1, 1), new Among$SII("\u00EA", -1, 1) ];
+});
+$__jsx_lazy_init(PortugueseStemmer, "g_v", function () {
+ return [ 17, 65, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 19, 12, 2 ];
+});
+PorterStemmer.serialVersionUID = 1;
+$__jsx_lazy_init(PorterStemmer, "methodObject", function () {
+ return new PorterStemmer$();
+});
+$__jsx_lazy_init(PorterStemmer, "a_0", function () {
+ return [ new Among$SII("s", -1, 3), new Among$SII("ies", 0, 2), new Among$SII("sses", 0, 1), new Among$SII("ss", 0, -1) ];
+});
+$__jsx_lazy_init(PorterStemmer, "a_1", function () {
+ return [ new Among$SII("", -1, 3), new Among$SII("bb", 0, 2), new Among$SII("dd", 0, 2), new Among$SII("ff", 0, 2), new Among$SII("gg", 0, 2), new Among$SII("bl", 0, 1), new Among$SII("mm", 0, 2), new Among$SII("nn", 0, 2), new Among$SII("pp", 0, 2), new Among$SII("rr", 0, 2), new Among$SII("at", 0, 1), new Among$SII("tt", 0, 2), new Among$SII("iz", 0, 1) ];
+});
+$__jsx_lazy_init(PorterStemmer, "a_2", function () {
+ return [ new Among$SII("ed", -1, 2), new Among$SII("eed", 0, 1), new Among$SII("ing", -1, 2) ];
+});
+$__jsx_lazy_init(PorterStemmer, "a_3", function () {
+ return [ new Among$SII("anci", -1, 3), new Among$SII("enci", -1, 2), new Among$SII("abli", -1, 4), new Among$SII("eli", -1, 6), new Among$SII("alli", -1, 9), new Among$SII("ousli", -1, 12), new Among$SII("entli", -1, 5), new Among$SII("aliti", -1, 10), new Among$SII("biliti", -1, 14), new Among$SII("iviti", -1, 13), new Among$SII("tional", -1, 1), new Among$SII("ational", 10, 8), new Among$SII("alism", -1, 10), new Among$SII("ation", -1, 8), new Among$SII("ization", 13, 7), new Among$SII("izer", -1, 7), new Among$SII("ator", -1, 8), new Among$SII("iveness", -1, 13), new Among$SII("fulness", -1, 11), new Among$SII("ousness", -1, 12) ];
+});
+$__jsx_lazy_init(PorterStemmer, "a_4", function () {
+ return [ new Among$SII("icate", -1, 2), new Among$SII("ative", -1, 3), new Among$SII("alize", -1, 1), new Among$SII("iciti", -1, 2), new Among$SII("ical", -1, 2), new Among$SII("ful", -1, 3), new Among$SII("ness", -1, 3) ];
+});
+$__jsx_lazy_init(PorterStemmer, "a_5", function () {
+ return [ new Among$SII("ic", -1, 1), new Among$SII("ance", -1, 1), new Among$SII("ence", -1, 1), new Among$SII("able", -1, 1), new Among$SII("ible", -1, 1), new Among$SII("ate", -1, 1), new Among$SII("ive", -1, 1), new Among$SII("ize", -1, 1), new Among$SII("iti", -1, 1), new Among$SII("al", -1, 1), new Among$SII("ism", -1, 1), new Among$SII("ion", -1, 2), new Among$SII("er", -1, 1), new Among$SII("ous", -1, 1), new Among$SII("ant", -1, 1), new Among$SII("ent", -1, 1), new Among$SII("ment", 15, 1), new Among$SII("ement", 16, 1), new Among$SII("ou", -1, 1) ];
+});
+$__jsx_lazy_init(PorterStemmer, "g_v", function () {
+ return [ 17, 65, 16, 1 ];
+});
+$__jsx_lazy_init(PorterStemmer, "g_v_WXY", function () {
+ return [ 1, 17, 65, 208, 1 ];
+});
+NorwegianStemmer.serialVersionUID = 1;
+$__jsx_lazy_init(NorwegianStemmer, "methodObject", function () {
+ return new NorwegianStemmer$();
+});
+$__jsx_lazy_init(NorwegianStemmer, "a_0", function () {
+ return [ new Among$SII("a", -1, 1), new Among$SII("e", -1, 1), new Among$SII("ede", 1, 1), new Among$SII("ande", 1, 1), new Among$SII("ende", 1, 1), new Among$SII("ane", 1, 1), new Among$SII("ene", 1, 1), new Among$SII("hetene", 6, 1), new Among$SII("erte", 1, 3), new Among$SII("en", -1, 1), new Among$SII("heten", 9, 1), new Among$SII("ar", -1, 1), new Among$SII("er", -1, 1), new Among$SII("heter", 12, 1), new Among$SII("s", -1, 2), new Among$SII("as", 14, 1), new Among$SII("es", 14, 1), new Among$SII("edes", 16, 1), new Among$SII("endes", 16, 1), new Among$SII("enes", 16, 1), new Among$SII("hetenes", 19, 1), new Among$SII("ens", 14, 1), new Among$SII("hetens", 21, 1), new Among$SII("ers", 14, 1), new Among$SII("ets", 14, 1), new Among$SII("et", -1, 1), new Among$SII("het", 25, 1), new Among$SII("ert", -1, 3), new Among$SII("ast", -1, 1) ];
+});
+$__jsx_lazy_init(NorwegianStemmer, "a_1", function () {
+ return [ new Among$SII("dt", -1, -1), new Among$SII("vt", -1, -1) ];
+});
+$__jsx_lazy_init(NorwegianStemmer, "a_2", function () {
+ return [ new Among$SII("leg", -1, 1), new Among$SII("eleg", 0, 1), new Among$SII("ig", -1, 1), new Among$SII("eig", 2, 1), new Among$SII("lig", 2, 1), new Among$SII("elig", 4, 1), new Among$SII("els", -1, 1), new Among$SII("lov", -1, 1), new Among$SII("elov", 7, 1), new Among$SII("slov", 7, 1), new Among$SII("hetslov", 9, 1) ];
+});
+$__jsx_lazy_init(NorwegianStemmer, "g_v", function () {
+ return [ 17, 65, 16, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 48, 0, 128 ];
+});
+$__jsx_lazy_init(NorwegianStemmer, "g_s_ending", function () {
+ return [ 119, 125, 149, 1 ];
+});
+ItalianStemmer.serialVersionUID = 1;
+$__jsx_lazy_init(ItalianStemmer, "methodObject", function () {
+ return new ItalianStemmer$();
+});
+$__jsx_lazy_init(ItalianStemmer, "a_0", function () {
+ return [ new Among$SII("", -1, 7), new Among$SII("qu", 0, 6), new Among$SII("\u00E1", 0, 1), new Among$SII("\u00E9", 0, 2), new Among$SII("\u00ED", 0, 3), new Among$SII("\u00F3", 0, 4), new Among$SII("\u00FA", 0, 5) ];
+});
+$__jsx_lazy_init(ItalianStemmer, "a_1", function () {
+ return [ new Among$SII("", -1, 3), new Among$SII("I", 0, 1), new Among$SII("U", 0, 2) ];
+});
+$__jsx_lazy_init(ItalianStemmer, "a_2", function () {
+ return [ new Among$SII("la", -1, -1), new Among$SII("cela", 0, -1), new Among$SII("gliela", 0, -1), new Among$SII("mela", 0, -1), new Among$SII("tela", 0, -1), new Among$SII("vela", 0, -1), new Among$SII("le", -1, -1), new Among$SII("cele", 6, -1), new Among$SII("gliele", 6, -1), new Among$SII("mele", 6, -1), new Among$SII("tele", 6, -1), new Among$SII("vele", 6, -1), new Among$SII("ne", -1, -1), new Among$SII("cene", 12, -1), new Among$SII("gliene", 12, -1), new Among$SII("mene", 12, -1), new Among$SII("sene", 12, -1), new Among$SII("tene", 12, -1), new Among$SII("vene", 12, -1), new Among$SII("ci", -1, -1), new Among$SII("li", -1, -1), new Among$SII("celi", 20, -1), new Among$SII("glieli", 20, -1), new Among$SII("meli", 20, -1), new Among$SII("teli", 20, -1), new Among$SII("veli", 20, -1), new Among$SII("gli", 20, -1), new Among$SII("mi", -1, -1), new Among$SII("si", -1, -1), new Among$SII("ti", -1, -1), new Among$SII("vi", -1, -1), new Among$SII("lo", -1, -1), new Among$SII("celo", 31, -1), new Among$SII("glielo", 31, -1), new Among$SII("melo", 31, -1), new Among$SII("telo", 31, -1), new Among$SII("velo", 31, -1) ];
+});
+$__jsx_lazy_init(ItalianStemmer, "a_3", function () {
+ return [ new Among$SII("ando", -1, 1), new Among$SII("endo", -1, 1), new Among$SII("ar", -1, 2), new Among$SII("er", -1, 2), new Among$SII("ir", -1, 2) ];
+});
+$__jsx_lazy_init(ItalianStemmer, "a_4", function () {
+ return [ new Among$SII("ic", -1, -1), new Among$SII("abil", -1, -1), new Among$SII("os", -1, -1), new Among$SII("iv", -1, 1) ];
+});
+$__jsx_lazy_init(ItalianStemmer, "a_5", function () {
+ return [ new Among$SII("ic", -1, 1), new Among$SII("abil", -1, 1), new Among$SII("iv", -1, 1) ];
+});
+$__jsx_lazy_init(ItalianStemmer, "a_6", function () {
+ return [ new Among$SII("ica", -1, 1), new Among$SII("logia", -1, 3), new Among$SII("osa", -1, 1), new Among$SII("ista", -1, 1), new Among$SII("iva", -1, 9), new Among$SII("anza", -1, 1), new Among$SII("enza", -1, 5), new Among$SII("ice", -1, 1), new Among$SII("atrice", 7, 1), new Among$SII("iche", -1, 1), new Among$SII("logie", -1, 3), new Among$SII("abile", -1, 1), new Among$SII("ibile", -1, 1), new Among$SII("usione", -1, 4), new Among$SII("azione", -1, 2), new Among$SII("uzione", -1, 4), new Among$SII("atore", -1, 2), new Among$SII("ose", -1, 1), new Among$SII("ante", -1, 1), new Among$SII("mente", -1, 1), new Among$SII("amente", 19, 7), new Among$SII("iste", -1, 1), new Among$SII("ive", -1, 9), new Among$SII("anze", -1, 1), new Among$SII("enze", -1, 5), new Among$SII("ici", -1, 1), new Among$SII("atrici", 25, 1), new Among$SII("ichi", -1, 1), new Among$SII("abili", -1, 1), new Among$SII("ibili", -1, 1), new Among$SII("ismi", -1, 1), new Among$SII("usioni", -1, 4), new Among$SII("azioni", -1, 2), new Among$SII("uzioni", -1, 4), new Among$SII("atori", -1, 2), new Among$SII("osi", -1, 1), new Among$SII("anti", -1, 1), new Among$SII("amenti", -1, 6), new Among$SII("imenti", -1, 6), new Among$SII("isti", -1, 1), new Among$SII("ivi", -1, 9), new Among$SII("ico", -1, 1), new Among$SII("ismo", -1, 1), new Among$SII("oso", -1, 1), new Among$SII("amento", -1, 6), new Among$SII("imento", -1, 6), new Among$SII("ivo", -1, 9), new Among$SII("it\u00E0", -1, 8), new Among$SII("ist\u00E0", -1, 1), new Among$SII("ist\u00E8", -1, 1), new Among$SII("ist\u00EC", -1, 1) ];
+});
+$__jsx_lazy_init(ItalianStemmer, "a_7", function () {
+ return [ new Among$SII("isca", -1, 1), new Among$SII("enda", -1, 1), new Among$SII("ata", -1, 1), new Among$SII("ita", -1, 1), new Among$SII("uta", -1, 1), new Among$SII("ava", -1, 1), new Among$SII("eva", -1, 1), new Among$SII("iva", -1, 1), new Among$SII("erebbe", -1, 1), new Among$SII("irebbe", -1, 1), new Among$SII("isce", -1, 1), new Among$SII("ende", -1, 1), new Among$SII("are", -1, 1), new Among$SII("ere", -1, 1), new Among$SII("ire", -1, 1), new Among$SII("asse", -1, 1), new Among$SII("ate", -1, 1), new Among$SII("avate", 16, 1), new Among$SII("evate", 16, 1), new Among$SII("ivate", 16, 1), new Among$SII("ete", -1, 1), new Among$SII("erete", 20, 1), new Among$SII("irete", 20, 1), new Among$SII("ite", -1, 1), new Among$SII("ereste", -1, 1), new Among$SII("ireste", -1, 1), new Among$SII("ute", -1, 1), new Among$SII("erai", -1, 1), new Among$SII("irai", -1, 1), new Among$SII("isci", -1, 1), new Among$SII("endi", -1, 1), new Among$SII("erei", -1, 1), new Among$SII("irei", -1, 1), new Among$SII("assi", -1, 1), new Among$SII("ati", -1, 1), new Among$SII("iti", -1, 1), new Among$SII("eresti", -1, 1), new Among$SII("iresti", -1, 1), new Among$SII("uti", -1, 1), new Among$SII("avi", -1, 1), new Among$SII("evi", -1, 1), new Among$SII("ivi", -1, 1), new Among$SII("isco", -1, 1), new Among$SII("ando", -1, 1), new Among$SII("endo", -1, 1), new Among$SII("Yamo", -1, 1), new Among$SII("iamo", -1, 1), new Among$SII("avamo", -1, 1), new Among$SII("evamo", -1, 1), new Among$SII("ivamo", -1, 1), new Among$SII("eremo", -1, 1), new Among$SII("iremo", -1, 1), new Among$SII("assimo", -1, 1), new Among$SII("ammo", -1, 1), new Among$SII("emmo", -1, 1), new Among$SII("eremmo", 54, 1), new Among$SII("iremmo", 54, 1), new Among$SII("immo", -1, 1), new Among$SII("ano", -1, 1), new Among$SII("iscano", 58, 1), new Among$SII("avano", 58, 1), new Among$SII("evano", 58, 1), new Among$SII("ivano", 58, 1), new Among$SII("eranno", -1, 1), new Among$SII("iranno", -1, 1), new Among$SII("ono", -1, 1), new Among$SII("iscono", 65, 1), new Among$SII("arono", 65, 1), new Among$SII("erono", 65, 1), new Among$SII("irono", 65, 1), new Among$SII("erebbero", -1, 1), new Among$SII("irebbero", -1, 1), new Among$SII("assero", -1, 1), new Among$SII("essero", -1, 1), new Among$SII("issero", -1, 1), new Among$SII("ato", -1, 1), new Among$SII("ito", -1, 1), new Among$SII("uto", -1, 1), new Among$SII("avo", -1, 1), new Among$SII("evo", -1, 1), new Among$SII("ivo", -1, 1), new Among$SII("ar", -1, 1), new Among$SII("ir", -1, 1), new Among$SII("er\u00E0", -1, 1), new Among$SII("ir\u00E0", -1, 1), new Among$SII("er\u00F2", -1, 1), new Among$SII("ir\u00F2", -1, 1) ];
+});
+$__jsx_lazy_init(ItalianStemmer, "g_v", function () {
+ return [ 17, 65, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128, 128, 8, 2, 1 ];
+});
+$__jsx_lazy_init(ItalianStemmer, "g_AEIO", function () {
+ return [ 17, 65, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128, 128, 8, 2 ];
+});
+$__jsx_lazy_init(ItalianStemmer, "g_CG", function () {
+ return [ 17 ];
+});
+HungarianStemmer.serialVersionUID = 1;
+$__jsx_lazy_init(HungarianStemmer, "methodObject", function () {
+ return new HungarianStemmer$();
+});
+$__jsx_lazy_init(HungarianStemmer, "a_0", function () {
+ return [ new Among$SII("cs", -1, -1), new Among$SII("dzs", -1, -1), new Among$SII("gy", -1, -1), new Among$SII("ly", -1, -1), new Among$SII("ny", -1, -1), new Among$SII("sz", -1, -1), new Among$SII("ty", -1, -1), new Among$SII("zs", -1, -1) ];
+});
+$__jsx_lazy_init(HungarianStemmer, "a_1", function () {
+ return [ new Among$SII("\u00E1", -1, 1), new Among$SII("\u00E9", -1, 2) ];
+});
+$__jsx_lazy_init(HungarianStemmer, "a_2", function () {
+ return [ new Among$SII("bb", -1, -1), new Among$SII("cc", -1, -1), new Among$SII("dd", -1, -1), new Among$SII("ff", -1, -1), new Among$SII("gg", -1, -1), new Among$SII("jj", -1, -1), new Among$SII("kk", -1, -1), new Among$SII("ll", -1, -1), new Among$SII("mm", -1, -1), new Among$SII("nn", -1, -1), new Among$SII("pp", -1, -1), new Among$SII("rr", -1, -1), new Among$SII("ccs", -1, -1), new Among$SII("ss", -1, -1), new Among$SII("zzs", -1, -1), new Among$SII("tt", -1, -1), new Among$SII("vv", -1, -1), new Among$SII("ggy", -1, -1), new Among$SII("lly", -1, -1), new Among$SII("nny", -1, -1), new Among$SII("tty", -1, -1), new Among$SII("ssz", -1, -1), new Among$SII("zz", -1, -1) ];
+});
+$__jsx_lazy_init(HungarianStemmer, "a_3", function () {
+ return [ new Among$SII("al", -1, 1), new Among$SII("el", -1, 2) ];
+});
+$__jsx_lazy_init(HungarianStemmer, "a_4", function () {
+ return [ new Among$SII("ba", -1, -1), new Among$SII("ra", -1, -1), new Among$SII("be", -1, -1), new Among$SII("re", -1, -1), new Among$SII("ig", -1, -1), new Among$SII("nak", -1, -1), new Among$SII("nek", -1, -1), new Among$SII("val", -1, -1), new Among$SII("vel", -1, -1), new Among$SII("ul", -1, -1), new Among$SII("n\u00E1l", -1, -1), new Among$SII("n\u00E9l", -1, -1), new Among$SII("b\u00F3l", -1, -1), new Among$SII("r\u00F3l", -1, -1), new Among$SII("t\u00F3l", -1, -1), new Among$SII("b\u00F5l", -1, -1), new Among$SII("r\u00F5l", -1, -1), new Among$SII("t\u00F5l", -1, -1), new Among$SII("\u00FCl", -1, -1), new Among$SII("n", -1, -1), new Among$SII("an", 19, -1), new Among$SII("ban", 20, -1), new Among$SII("en", 19, -1), new Among$SII("ben", 22, -1), new Among$SII("k\u00E9ppen", 22, -1), new Among$SII("on", 19, -1), new Among$SII("\u00F6n", 19, -1), new Among$SII("k\u00E9pp", -1, -1), new Among$SII("kor", -1, -1), new Among$SII("t", -1, -1), new Among$SII("at", 29, -1), new Among$SII("et", 29, -1), new Among$SII("k\u00E9nt", 29, -1), new Among$SII("ank\u00E9nt", 32, -1), new Among$SII("enk\u00E9nt", 32, -1), new Among$SII("onk\u00E9nt", 32, -1), new Among$SII("ot", 29, -1), new Among$SII("\u00E9rt", 29, -1), new Among$SII("\u00F6t", 29, -1), new Among$SII("hez", -1, -1), new Among$SII("hoz", -1, -1), new Among$SII("h\u00F6z", -1, -1), new Among$SII("v\u00E1", -1, -1), new Among$SII("v\u00E9", -1, -1) ];
+});
+$__jsx_lazy_init(HungarianStemmer, "a_5", function () {
+ return [ new Among$SII("\u00E1n", -1, 2), new Among$SII("\u00E9n", -1, 1), new Among$SII("\u00E1nk\u00E9nt", -1, 3) ];
+});
+$__jsx_lazy_init(HungarianStemmer, "a_6", function () {
+ return [ new Among$SII("stul", -1, 2), new Among$SII("astul", 0, 1), new Among$SII("\u00E1stul", 0, 3), new Among$SII("st\u00FCl", -1, 2), new Among$SII("est\u00FCl", 3, 1), new Among$SII("\u00E9st\u00FCl", 3, 4) ];
+});
+$__jsx_lazy_init(HungarianStemmer, "a_7", function () {
+ return [ new Among$SII("\u00E1", -1, 1), new Among$SII("\u00E9", -1, 2) ];
+});
+$__jsx_lazy_init(HungarianStemmer, "a_8", function () {
+ return [ new Among$SII("k", -1, 7), new Among$SII("ak", 0, 4), new Among$SII("ek", 0, 6), new Among$SII("ok", 0, 5), new Among$SII("\u00E1k", 0, 1), new Among$SII("\u00E9k", 0, 2), new Among$SII("\u00F6k", 0, 3) ];
+});
+$__jsx_lazy_init(HungarianStemmer, "a_9", function () {
+ return [ new Among$SII("\u00E9i", -1, 7), new Among$SII("\u00E1\u00E9i", 0, 6), new Among$SII("\u00E9\u00E9i", 0, 5), new Among$SII("\u00E9", -1, 9), new Among$SII("k\u00E9", 3, 4), new Among$SII("ak\u00E9", 4, 1), new Among$SII("ek\u00E9", 4, 1), new Among$SII("ok\u00E9", 4, 1), new Among$SII("\u00E1k\u00E9", 4, 3), new Among$SII("\u00E9k\u00E9", 4, 2), new Among$SII("\u00F6k\u00E9", 4, 1), new Among$SII("\u00E9\u00E9", 3, 8) ];
+});
+$__jsx_lazy_init(HungarianStemmer, "a_10", function () {
+ return [ new Among$SII("a", -1, 18), new Among$SII("ja", 0, 17), new Among$SII("d", -1, 16), new Among$SII("ad", 2, 13), new Among$SII("ed", 2, 13), new Among$SII("od", 2, 13), new Among$SII("\u00E1d", 2, 14), new Among$SII("\u00E9d", 2, 15), new Among$SII("\u00F6d", 2, 13), new Among$SII("e", -1, 18), new Among$SII("je", 9, 17), new Among$SII("nk", -1, 4), new Among$SII("unk", 11, 1), new Among$SII("\u00E1nk", 11, 2), new Among$SII("\u00E9nk", 11, 3), new Among$SII("\u00FCnk", 11, 1), new Among$SII("uk", -1, 8), new Among$SII("juk", 16, 7), new Among$SII("\u00E1juk", 17, 5), new Among$SII("\u00FCk", -1, 8), new Among$SII("j\u00FCk", 19, 7), new Among$SII("\u00E9j\u00FCk", 20, 6), new Among$SII("m", -1, 12), new Among$SII("am", 22, 9), new Among$SII("em", 22, 9), new Among$SII("om", 22, 9), new Among$SII("\u00E1m", 22, 10), new Among$SII("\u00E9m", 22, 11), new Among$SII("o", -1, 18), new Among$SII("\u00E1", -1, 19), new Among$SII("\u00E9", -1, 20) ];
+});
+$__jsx_lazy_init(HungarianStemmer, "a_11", function () {
+ return [ new Among$SII("id", -1, 10), new Among$SII("aid", 0, 9), new Among$SII("jaid", 1, 6), new Among$SII("eid", 0, 9), new Among$SII("jeid", 3, 6), new Among$SII("\u00E1id", 0, 7), new Among$SII("\u00E9id", 0, 8), new Among$SII("i", -1, 15), new Among$SII("ai", 7, 14), new Among$SII("jai", 8, 11), new Among$SII("ei", 7, 14), new Among$SII("jei", 10, 11), new Among$SII("\u00E1i", 7, 12), new Among$SII("\u00E9i", 7, 13), new Among$SII("itek", -1, 24), new Among$SII("eitek", 14, 21), new Among$SII("jeitek", 15, 20), new Among$SII("\u00E9itek", 14, 23), new Among$SII("ik", -1, 29), new Among$SII("aik", 18, 26), new Among$SII("jaik", 19, 25), new Among$SII("eik", 18, 26), new Among$SII("jeik", 21, 25), new Among$SII("\u00E1ik", 18, 27), new Among$SII("\u00E9ik", 18, 28), new Among$SII("ink", -1, 20), new Among$SII("aink", 25, 17), new Among$SII("jaink", 26, 16), new Among$SII("eink", 25, 17), new Among$SII("jeink", 28, 16), new Among$SII("\u00E1ink", 25, 18), new Among$SII("\u00E9ink", 25, 19), new Among$SII("aitok", -1, 21), new Among$SII("jaitok", 32, 20), new Among$SII("\u00E1itok", -1, 22), new Among$SII("im", -1, 5), new Among$SII("aim", 35, 4), new Among$SII("jaim", 36, 1), new Among$SII("eim", 35, 4), new Among$SII("jeim", 38, 1), new Among$SII("\u00E1im", 35, 2), new Among$SII("\u00E9im", 35, 3) ];
+});
+$__jsx_lazy_init(HungarianStemmer, "g_v", function () {
+ return [ 17, 65, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 17, 52, 14 ];
+});
+GermanStemmer.serialVersionUID = 1;
+$__jsx_lazy_init(GermanStemmer, "methodObject", function () {
+ return new GermanStemmer$();
+});
+$__jsx_lazy_init(GermanStemmer, "a_0", function () {
+ return [ new Among$SII("", -1, 6), new Among$SII("U", 0, 2), new Among$SII("Y", 0, 1), new Among$SII("\u00E4", 0, 3), new Among$SII("\u00F6", 0, 4), new Among$SII("\u00FC", 0, 5) ];
+});
+$__jsx_lazy_init(GermanStemmer, "a_1", function () {
+ return [ new Among$SII("e", -1, 2), new Among$SII("em", -1, 1), new Among$SII("en", -1, 2), new Among$SII("ern", -1, 1), new Among$SII("er", -1, 1), new Among$SII("s", -1, 3), new Among$SII("es", 5, 2) ];
+});
+$__jsx_lazy_init(GermanStemmer, "a_2", function () {
+ return [ new Among$SII("en", -1, 1), new Among$SII("er", -1, 1), new Among$SII("st", -1, 2), new Among$SII("est", 2, 1) ];
+});
+$__jsx_lazy_init(GermanStemmer, "a_3", function () {
+ return [ new Among$SII("ig", -1, 1), new Among$SII("lich", -1, 1) ];
+});
+$__jsx_lazy_init(GermanStemmer, "a_4", function () {
+ return [ new Among$SII("end", -1, 1), new Among$SII("ig", -1, 2), new Among$SII("ung", -1, 1), new Among$SII("lich", -1, 3), new Among$SII("isch", -1, 2), new Among$SII("ik", -1, 2), new Among$SII("heit", -1, 3), new Among$SII("keit", -1, 4) ];
+});
+$__jsx_lazy_init(GermanStemmer, "g_v", function () {
+ return [ 17, 65, 16, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 32, 8 ];
+});
+$__jsx_lazy_init(GermanStemmer, "g_s_ending", function () {
+ return [ 117, 30, 5 ];
+});
+$__jsx_lazy_init(GermanStemmer, "g_st_ending", function () {
+ return [ 117, 30, 4 ];
+});
+FrenchStemmer.serialVersionUID = 1;
+$__jsx_lazy_init(FrenchStemmer, "methodObject", function () {
+ return new FrenchStemmer$();
+});
+$__jsx_lazy_init(FrenchStemmer, "a_0", function () {
+ return [ new Among$SII("col", -1, -1), new Among$SII("par", -1, -1), new Among$SII("tap", -1, -1) ];
+});
+$__jsx_lazy_init(FrenchStemmer, "a_1", function () {
+ return [ new Among$SII("", -1, 4), new Among$SII("I", 0, 1), new Among$SII("U", 0, 2), new Among$SII("Y", 0, 3) ];
+});
+$__jsx_lazy_init(FrenchStemmer, "a_2", function () {
+ return [ new Among$SII("iqU", -1, 3), new Among$SII("abl", -1, 3), new Among$SII("I\u00E8r", -1, 4), new Among$SII("i\u00E8r", -1, 4), new Among$SII("eus", -1, 2), new Among$SII("iv", -1, 1) ];
+});
+$__jsx_lazy_init(FrenchStemmer, "a_3", function () {
+ return [ new Among$SII("ic", -1, 2), new Among$SII("abil", -1, 1), new Among$SII("iv", -1, 3) ];
+});
+$__jsx_lazy_init(FrenchStemmer, "a_4", function () {
+ return [ new Among$SII("iqUe", -1, 1), new Among$SII("atrice", -1, 2), new Among$SII("ance", -1, 1), new Among$SII("ence", -1, 5), new Among$SII("logie", -1, 3), new Among$SII("able", -1, 1), new Among$SII("isme", -1, 1), new Among$SII("euse", -1, 11), new Among$SII("iste", -1, 1), new Among$SII("ive", -1, 8), new Among$SII("if", -1, 8), new Among$SII("usion", -1, 4), new Among$SII("ation", -1, 2), new Among$SII("ution", -1, 4), new Among$SII("ateur", -1, 2), new Among$SII("iqUes", -1, 1), new Among$SII("atrices", -1, 2), new Among$SII("ances", -1, 1), new Among$SII("ences", -1, 5), new Among$SII("logies", -1, 3), new Among$SII("ables", -1, 1), new Among$SII("ismes", -1, 1), new Among$SII("euses", -1, 11), new Among$SII("istes", -1, 1), new Among$SII("ives", -1, 8), new Among$SII("ifs", -1, 8), new Among$SII("usions", -1, 4), new Among$SII("ations", -1, 2), new Among$SII("utions", -1, 4), new Among$SII("ateurs", -1, 2), new Among$SII("ments", -1, 15), new Among$SII("ements", 30, 6), new Among$SII("issements", 31, 12), new Among$SII("it\u00E9s", -1, 7), new Among$SII("ment", -1, 15), new Among$SII("ement", 34, 6), new Among$SII("issement", 35, 12), new Among$SII("amment", 34, 13), new Among$SII("emment", 34, 14), new Among$SII("aux", -1, 10), new Among$SII("eaux", 39, 9), new Among$SII("eux", -1, 1), new Among$SII("it\u00E9", -1, 7) ];
+});
+$__jsx_lazy_init(FrenchStemmer, "a_5", function () {
+ return [ new Among$SII("ira", -1, 1), new Among$SII("ie", -1, 1), new Among$SII("isse", -1, 1), new Among$SII("issante", -1, 1), new Among$SII("i", -1, 1), new Among$SII("irai", 4, 1), new Among$SII("ir", -1, 1), new Among$SII("iras", -1, 1), new Among$SII("ies", -1, 1), new Among$SII("\u00EEmes", -1, 1), new Among$SII("isses", -1, 1), new Among$SII("issantes", -1, 1), new Among$SII("\u00EEtes", -1, 1), new Among$SII("is", -1, 1), new Among$SII("irais", 13, 1), new Among$SII("issais", 13, 1), new Among$SII("irions", -1, 1), new Among$SII("issions", -1, 1), new Among$SII("irons", -1, 1), new Among$SII("issons", -1, 1), new Among$SII("issants", -1, 1), new Among$SII("it", -1, 1), new Among$SII("irait", 21, 1), new Among$SII("issait", 21, 1), new Among$SII("issant", -1, 1), new Among$SII("iraIent", -1, 1), new Among$SII("issaIent", -1, 1), new Among$SII("irent", -1, 1), new Among$SII("issent", -1, 1), new Among$SII("iront", -1, 1), new Among$SII("\u00EEt", -1, 1), new Among$SII("iriez", -1, 1), new Among$SII("issiez", -1, 1), new Among$SII("irez", -1, 1), new Among$SII("issez", -1, 1) ];
+});
+$__jsx_lazy_init(FrenchStemmer, "a_6", function () {
+ return [ new Among$SII("a", -1, 3), new Among$SII("era", 0, 2), new Among$SII("asse", -1, 3), new Among$SII("ante", -1, 3), new Among$SII("\u00E9e", -1, 2), new Among$SII("ai", -1, 3), new Among$SII("erai", 5, 2), new Among$SII("er", -1, 2), new Among$SII("as", -1, 3), new Among$SII("eras", 8, 2), new Among$SII("\u00E2mes", -1, 3), new Among$SII("asses", -1, 3), new Among$SII("antes", -1, 3), new Among$SII("\u00E2tes", -1, 3), new Among$SII("\u00E9es", -1, 2), new Among$SII("ais", -1, 3), new Among$SII("erais", 15, 2), new Among$SII("ions", -1, 1), new Among$SII("erions", 17, 2), new Among$SII("assions", 17, 3), new Among$SII("erons", -1, 2), new Among$SII("ants", -1, 3), new Among$SII("\u00E9s", -1, 2), new Among$SII("ait", -1, 3), new Among$SII("erait", 23, 2), new Among$SII("ant", -1, 3), new Among$SII("aIent", -1, 3), new Among$SII("eraIent", 26, 2), new Among$SII("\u00E8rent", -1, 2), new Among$SII("assent", -1, 3), new Among$SII("eront", -1, 2), new Among$SII("\u00E2t", -1, 3), new Among$SII("ez", -1, 2), new Among$SII("iez", 32, 2), new Among$SII("eriez", 33, 2), new Among$SII("assiez", 33, 3), new Among$SII("erez", 32, 2), new Among$SII("\u00E9", -1, 2) ];
+});
+$__jsx_lazy_init(FrenchStemmer, "a_7", function () {
+ return [ new Among$SII("e", -1, 3), new Among$SII("I\u00E8re", 0, 2), new Among$SII("i\u00E8re", 0, 2), new Among$SII("ion", -1, 1), new Among$SII("Ier", -1, 2), new Among$SII("ier", -1, 2), new Among$SII("\u00EB", -1, 4) ];
+});
+$__jsx_lazy_init(FrenchStemmer, "a_8", function () {
+ return [ new Among$SII("ell", -1, -1), new Among$SII("eill", -1, -1), new Among$SII("enn", -1, -1), new Among$SII("onn", -1, -1), new Among$SII("ett", -1, -1) ];
+});
+$__jsx_lazy_init(FrenchStemmer, "g_v", function () {
+ return [ 17, 65, 16, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128, 130, 103, 8, 5 ];
+});
+$__jsx_lazy_init(FrenchStemmer, "g_keep_with_s", function () {
+ return [ 1, 65, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128 ];
+});
+FinnishStemmer.serialVersionUID = 1;
+$__jsx_lazy_init(FinnishStemmer, "methodObject", function () {
+ return new FinnishStemmer$();
+});
+$__jsx_lazy_init(FinnishStemmer, "a_0", function () {
+ return [ new Among$SII("pa", -1, 1), new Among$SII("sti", -1, 2), new Among$SII("kaan", -1, 1), new Among$SII("han", -1, 1), new Among$SII("kin", -1, 1), new Among$SII("h\u00E4n", -1, 1), new Among$SII("k\u00E4\u00E4n", -1, 1), new Among$SII("ko", -1, 1), new Among$SII("p\u00E4", -1, 1), new Among$SII("k\u00F6", -1, 1) ];
+});
+$__jsx_lazy_init(FinnishStemmer, "a_1", function () {
+ return [ new Among$SII("lla", -1, -1), new Among$SII("na", -1, -1), new Among$SII("ssa", -1, -1), new Among$SII("ta", -1, -1), new Among$SII("lta", 3, -1), new Among$SII("sta", 3, -1) ];
+});
+$__jsx_lazy_init(FinnishStemmer, "a_2", function () {
+ return [ new Among$SII("ll\u00E4", -1, -1), new Among$SII("n\u00E4", -1, -1), new Among$SII("ss\u00E4", -1, -1), new Among$SII("t\u00E4", -1, -1), new Among$SII("lt\u00E4", 3, -1), new Among$SII("st\u00E4", 3, -1) ];
+});
+$__jsx_lazy_init(FinnishStemmer, "a_3", function () {
+ return [ new Among$SII("lle", -1, -1), new Among$SII("ine", -1, -1) ];
+});
+$__jsx_lazy_init(FinnishStemmer, "a_4", function () {
+ return [ new Among$SII("nsa", -1, 3), new Among$SII("mme", -1, 3), new Among$SII("nne", -1, 3), new Among$SII("ni", -1, 2), new Among$SII("si", -1, 1), new Among$SII("an", -1, 4), new Among$SII("en", -1, 6), new Among$SII("\u00E4n", -1, 5), new Among$SII("ns\u00E4", -1, 3) ];
+});
+$__jsx_lazy_init(FinnishStemmer, "a_5", function () {
+ return [ new Among$SII("aa", -1, -1), new Among$SII("ee", -1, -1), new Among$SII("ii", -1, -1), new Among$SII("oo", -1, -1), new Among$SII("uu", -1, -1), new Among$SII("\u00E4\u00E4", -1, -1), new Among$SII("\u00F6\u00F6", -1, -1) ];
+});
+$__jsx_lazy_init(FinnishStemmer, "a_6", function () {
+ return [ new Among$SII("a", -1, 8), new Among$SII("lla", 0, -1), new Among$SII("na", 0, -1), new Among$SII("ssa", 0, -1), new Among$SII("ta", 0, -1), new Among$SII("lta", 4, -1), new Among$SII("sta", 4, -1), new Among$SII("tta", 4, 9), new Among$SII("lle", -1, -1), new Among$SII("ine", -1, -1), new Among$SII("ksi", -1, -1), new Among$SII("n", -1, 7), new Among$SII("han", 11, 1), new Among$SIIF$LBaseStemmer$B$LBaseStemmer$("den", 11, -1, (function (instance) {
+ return instance.r_VI$();
+ }), FinnishStemmer.methodObject), new Among$SIIF$LBaseStemmer$B$LBaseStemmer$("seen", 11, -1, (function (instance) {
+ return instance.r_LONG$();
+ }), FinnishStemmer.methodObject), new Among$SII("hen", 11, 2), new Among$SIIF$LBaseStemmer$B$LBaseStemmer$("tten", 11, -1, (function (instance) {
+ return instance.r_VI$();
+ }), FinnishStemmer.methodObject), new Among$SII("hin", 11, 3), new Among$SIIF$LBaseStemmer$B$LBaseStemmer$("siin", 11, -1, (function (instance) {
+ return instance.r_VI$();
+ }), FinnishStemmer.methodObject), new Among$SII("hon", 11, 4), new Among$SII("h\u00E4n", 11, 5), new Among$SII("h\u00F6n", 11, 6), new Among$SII("\u00E4", -1, 8), new Among$SII("ll\u00E4", 22, -1), new Among$SII("n\u00E4", 22, -1), new Among$SII("ss\u00E4", 22, -1), new Among$SII("t\u00E4", 22, -1), new Among$SII("lt\u00E4", 26, -1), new Among$SII("st\u00E4", 26, -1), new Among$SII("tt\u00E4", 26, 9) ];
+});
+$__jsx_lazy_init(FinnishStemmer, "a_7", function () {
+ return [ new Among$SII("eja", -1, -1), new Among$SII("mma", -1, 1), new Among$SII("imma", 1, -1), new Among$SII("mpa", -1, 1), new Among$SII("impa", 3, -1), new Among$SII("mmi", -1, 1), new Among$SII("immi", 5, -1), new Among$SII("mpi", -1, 1), new Among$SII("impi", 7, -1), new Among$SII("ej\u00E4", -1, -1), new Among$SII("mm\u00E4", -1, 1), new Among$SII("imm\u00E4", 10, -1), new Among$SII("mp\u00E4", -1, 1), new Among$SII("imp\u00E4", 12, -1) ];
+});
+$__jsx_lazy_init(FinnishStemmer, "a_8", function () {
+ return [ new Among$SII("i", -1, -1), new Among$SII("j", -1, -1) ];
+});
+$__jsx_lazy_init(FinnishStemmer, "a_9", function () {
+ return [ new Among$SII("mma", -1, 1), new Among$SII("imma", 0, -1) ];
+});
+$__jsx_lazy_init(FinnishStemmer, "g_AEI", function () {
+ return [ 17, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8 ];
+});
+$__jsx_lazy_init(FinnishStemmer, "g_V1", function () {
+ return [ 17, 65, 16, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 32 ];
+});
+$__jsx_lazy_init(FinnishStemmer, "g_V2", function () {
+ return [ 17, 65, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 32 ];
+});
+$__jsx_lazy_init(FinnishStemmer, "g_particle_end", function () {
+ return [ 17, 97, 24, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 32 ];
+});
+EnglishStemmer.serialVersionUID = 1;
+$__jsx_lazy_init(EnglishStemmer, "methodObject", function () {
+ return new EnglishStemmer$();
+});
+$__jsx_lazy_init(EnglishStemmer, "a_0", function () {
+ return [ new Among$SII("arsen", -1, -1), new Among$SII("commun", -1, -1), new Among$SII("gener", -1, -1) ];
+});
+$__jsx_lazy_init(EnglishStemmer, "a_1", function () {
+ return [ new Among$SII("'", -1, 1), new Among$SII("'s'", 0, 1), new Among$SII("'s", -1, 1) ];
+});
+$__jsx_lazy_init(EnglishStemmer, "a_2", function () {
+ return [ new Among$SII("ied", -1, 2), new Among$SII("s", -1, 3), new Among$SII("ies", 1, 2), new Among$SII("sses", 1, 1), new Among$SII("ss", 1, -1), new Among$SII("us", 1, -1) ];
+});
+$__jsx_lazy_init(EnglishStemmer, "a_3", function () {
+ return [ new Among$SII("", -1, 3), new Among$SII("bb", 0, 2), new Among$SII("dd", 0, 2), new Among$SII("ff", 0, 2), new Among$SII("gg", 0, 2), new Among$SII("bl", 0, 1), new Among$SII("mm", 0, 2), new Among$SII("nn", 0, 2), new Among$SII("pp", 0, 2), new Among$SII("rr", 0, 2), new Among$SII("at", 0, 1), new Among$SII("tt", 0, 2), new Among$SII("iz", 0, 1) ];
+});
+$__jsx_lazy_init(EnglishStemmer, "a_4", function () {
+ return [ new Among$SII("ed", -1, 2), new Among$SII("eed", 0, 1), new Among$SII("ing", -1, 2), new Among$SII("edly", -1, 2), new Among$SII("eedly", 3, 1), new Among$SII("ingly", -1, 2) ];
+});
+$__jsx_lazy_init(EnglishStemmer, "a_5", function () {
+ return [ new Among$SII("anci", -1, 3), new Among$SII("enci", -1, 2), new Among$SII("ogi", -1, 13), new Among$SII("li", -1, 16), new Among$SII("bli", 3, 12), new Among$SII("abli", 4, 4), new Among$SII("alli", 3, 8), new Among$SII("fulli", 3, 14), new Among$SII("lessli", 3, 15), new Among$SII("ousli", 3, 10), new Among$SII("entli", 3, 5), new Among$SII("aliti", -1, 8), new Among$SII("biliti", -1, 12), new Among$SII("iviti", -1, 11), new Among$SII("tional", -1, 1), new Among$SII("ational", 14, 7), new Among$SII("alism", -1, 8), new Among$SII("ation", -1, 7), new Among$SII("ization", 17, 6), new Among$SII("izer", -1, 6), new Among$SII("ator", -1, 7), new Among$SII("iveness", -1, 11), new Among$SII("fulness", -1, 9), new Among$SII("ousness", -1, 10) ];
+});
+$__jsx_lazy_init(EnglishStemmer, "a_6", function () {
+ return [ new Among$SII("icate", -1, 4), new Among$SII("ative", -1, 6), new Among$SII("alize", -1, 3), new Among$SII("iciti", -1, 4), new Among$SII("ical", -1, 4), new Among$SII("tional", -1, 1), new Among$SII("ational", 5, 2), new Among$SII("ful", -1, 5), new Among$SII("ness", -1, 5) ];
+});
+$__jsx_lazy_init(EnglishStemmer, "a_7", function () {
+ return [ new Among$SII("ic", -1, 1), new Among$SII("ance", -1, 1), new Among$SII("ence", -1, 1), new Among$SII("able", -1, 1), new Among$SII("ible", -1, 1), new Among$SII("ate", -1, 1), new Among$SII("ive", -1, 1), new Among$SII("ize", -1, 1), new Among$SII("iti", -1, 1), new Among$SII("al", -1, 1), new Among$SII("ism", -1, 1), new Among$SII("ion", -1, 2), new Among$SII("er", -1, 1), new Among$SII("ous", -1, 1), new Among$SII("ant", -1, 1), new Among$SII("ent", -1, 1), new Among$SII("ment", 15, 1), new Among$SII("ement", 16, 1) ];
+});
+$__jsx_lazy_init(EnglishStemmer, "a_8", function () {
+ return [ new Among$SII("e", -1, 1), new Among$SII("l", -1, 2) ];
+});
+$__jsx_lazy_init(EnglishStemmer, "a_9", function () {
+ return [ new Among$SII("succeed", -1, -1), new Among$SII("proceed", -1, -1), new Among$SII("exceed", -1, -1), new Among$SII("canning", -1, -1), new Among$SII("inning", -1, -1), new Among$SII("earring", -1, -1), new Among$SII("herring", -1, -1), new Among$SII("outing", -1, -1) ];
+});
+$__jsx_lazy_init(EnglishStemmer, "a_10", function () {
+ return [ new Among$SII("andes", -1, -1), new Among$SII("atlas", -1, -1), new Among$SII("bias", -1, -1), new Among$SII("cosmos", -1, -1), new Among$SII("dying", -1, 3), new Among$SII("early", -1, 9), new Among$SII("gently", -1, 7), new Among$SII("howe", -1, -1), new Among$SII("idly", -1, 6), new Among$SII("lying", -1, 4), new Among$SII("news", -1, -1), new Among$SII("only", -1, 10), new Among$SII("singly", -1, 11), new Among$SII("skies", -1, 2), new Among$SII("skis", -1, 1), new Among$SII("sky", -1, -1), new Among$SII("tying", -1, 5), new Among$SII("ugly", -1, 8) ];
+});
+$__jsx_lazy_init(EnglishStemmer, "g_v", function () {
+ return [ 17, 65, 16, 1 ];
+});
+$__jsx_lazy_init(EnglishStemmer, "g_v_WXY", function () {
+ return [ 1, 17, 65, 208, 1 ];
+});
+$__jsx_lazy_init(EnglishStemmer, "g_valid_LI", function () {
+ return [ 55, 141, 2 ];
+});
+DutchStemmer.serialVersionUID = 1;
+$__jsx_lazy_init(DutchStemmer, "methodObject", function () {
+ return new DutchStemmer$();
+});
+$__jsx_lazy_init(DutchStemmer, "a_0", function () {
+ return [ new Among$SII("", -1, 6), new Among$SII("\u00E1", 0, 1), new Among$SII("\u00E4", 0, 1), new Among$SII("\u00E9", 0, 2), new Among$SII("\u00EB", 0, 2), new Among$SII("\u00ED", 0, 3), new Among$SII("\u00EF", 0, 3), new Among$SII("\u00F3", 0, 4), new Among$SII("\u00F6", 0, 4), new Among$SII("\u00FA", 0, 5), new Among$SII("\u00FC", 0, 5) ];
+});
+$__jsx_lazy_init(DutchStemmer, "a_1", function () {
+ return [ new Among$SII("", -1, 3), new Among$SII("I", 0, 2), new Among$SII("Y", 0, 1) ];
+});
+$__jsx_lazy_init(DutchStemmer, "a_2", function () {
+ return [ new Among$SII("dd", -1, -1), new Among$SII("kk", -1, -1), new Among$SII("tt", -1, -1) ];
+});
+$__jsx_lazy_init(DutchStemmer, "a_3", function () {
+ return [ new Among$SII("ene", -1, 2), new Among$SII("se", -1, 3), new Among$SII("en", -1, 2), new Among$SII("heden", 2, 1), new Among$SII("s", -1, 3) ];
+});
+$__jsx_lazy_init(DutchStemmer, "a_4", function () {
+ return [ new Among$SII("end", -1, 1), new Among$SII("ig", -1, 2), new Among$SII("ing", -1, 1), new Among$SII("lijk", -1, 3), new Among$SII("baar", -1, 4), new Among$SII("bar", -1, 5) ];
+});
+$__jsx_lazy_init(DutchStemmer, "a_5", function () {
+ return [ new Among$SII("aa", -1, -1), new Among$SII("ee", -1, -1), new Among$SII("oo", -1, -1), new Among$SII("uu", -1, -1) ];
+});
+$__jsx_lazy_init(DutchStemmer, "g_v", function () {
+ return [ 17, 65, 16, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128 ];
+});
+$__jsx_lazy_init(DutchStemmer, "g_v_I", function () {
+ return [ 1, 0, 0, 17, 65, 16, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128 ];
+});
+$__jsx_lazy_init(DutchStemmer, "g_v_j", function () {
+ return [ 17, 67, 16, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128 ];
+});
+DanishStemmer.serialVersionUID = 1;
+$__jsx_lazy_init(DanishStemmer, "methodObject", function () {
+ return new DanishStemmer$();
+});
+$__jsx_lazy_init(DanishStemmer, "a_0", function () {
+ return [ new Among$SII("hed", -1, 1), new Among$SII("ethed", 0, 1), new Among$SII("ered", -1, 1), new Among$SII("e", -1, 1), new Among$SII("erede", 3, 1), new Among$SII("ende", 3, 1), new Among$SII("erende", 5, 1), new Among$SII("ene", 3, 1), new Among$SII("erne", 3, 1), new Among$SII("ere", 3, 1), new Among$SII("en", -1, 1), new Among$SII("heden", 10, 1), new Among$SII("eren", 10, 1), new Among$SII("er", -1, 1), new Among$SII("heder", 13, 1), new Among$SII("erer", 13, 1), new Among$SII("s", -1, 2), new Among$SII("heds", 16, 1), new Among$SII("es", 16, 1), new Among$SII("endes", 18, 1), new Among$SII("erendes", 19, 1), new Among$SII("enes", 18, 1), new Among$SII("ernes", 18, 1), new Among$SII("eres", 18, 1), new Among$SII("ens", 16, 1), new Among$SII("hedens", 24, 1), new Among$SII("erens", 24, 1), new Among$SII("ers", 16, 1), new Among$SII("ets", 16, 1), new Among$SII("erets", 28, 1), new Among$SII("et", -1, 1), new Among$SII("eret", 30, 1) ];
+});
+$__jsx_lazy_init(DanishStemmer, "a_1", function () {
+ return [ new Among$SII("gd", -1, -1), new Among$SII("dt", -1, -1), new Among$SII("gt", -1, -1), new Among$SII("kt", -1, -1) ];
+});
+$__jsx_lazy_init(DanishStemmer, "a_2", function () {
+ return [ new Among$SII("ig", -1, 1), new Among$SII("lig", 0, 1), new Among$SII("elig", 1, 1), new Among$SII("els", -1, 1), new Among$SII("l\u00F8st", -1, 2) ];
+});
+$__jsx_lazy_init(DanishStemmer, "g_v", function () {
+ return [ 17, 65, 16, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 48, 0, 128 ];
+});
+$__jsx_lazy_init(DanishStemmer, "g_s_ending", function () {
+ return [ 239, 254, 42, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16 ];
+});
+BitVector.SMALL_BLOCK_SIZE = 32;
+BitVector.LARGE_BLOCK_SIZE = 256;
+BitVector.BLOCK_RATE = 8;
+$__jsx_lazy_init(BurrowsWheelerTransform, "END_MARKER", function () {
+ return String.fromCharCode(0);
+});
+var $__jsx_classMap = {
+ "tool/oktavia-search.jsx": {
+ Search: Search,
+ Search$: Search$,
+ _Main: _Main,
+ _Main$: _Main$
+ },
+ "system:lib/js/js/nodejs.jsx": {
+ node: node,
+ node$: node$
+ },
+ "src/oktavia.jsx": {
+ Oktavia: Oktavia,
+ Oktavia$: Oktavia$
+ },
+ "src/getopt.jsx": {
+ CommandOption: CommandOption,
+ CommandOption$S: CommandOption$S,
+ CommandOption$SS: CommandOption$SS,
+ CommandOption$SSB: CommandOption$SSB,
+ BasicParser: BasicParser,
+ BasicParser$SAS: BasicParser$SAS
+ },
+ "src/query-parser.jsx": {
+ QueryParser: QueryParser,
+ QueryParser$: QueryParser$
+ },
+ "src/search-result.jsx": {
+ Proposal: Proposal,
+ Proposal$II: Proposal$II,
+ Position: Position,
+ Position$SIB: Position$SIB,
+ SearchUnit: SearchUnit,
+ SearchUnit$I: SearchUnit$I,
+ SingleResult: SingleResult,
+ SingleResult$: SingleResult$,
+ SingleResult$SBB: SingleResult$SBB,
+ SearchSummary: SearchSummary,
+ SearchSummary$: SearchSummary$,
+ SearchSummary$LOktavia$: SearchSummary$LOktavia$
+ },
+ "src/style.jsx": {
+ Style: Style,
+ Style$S: Style$S,
+ _HTMLHandler: _HTMLHandler,
+ _HTMLHandler$HASB: _HTMLHandler$HASB
+ },
+ "src/binary-util.jsx": {
+ Binary: Binary,
+ Binary$: Binary$,
+ LoadedStringResult: LoadedStringResult,
+ LoadedStringResult$SI: LoadedStringResult$SI,
+ LoadedStringListResult: LoadedStringListResult,
+ LoadedStringListResult$SI: LoadedStringListResult$SI,
+ LoadedStringListMapResult: LoadedStringListMapResult,
+ LoadedStringListMapResult$SI: LoadedStringListMapResult$SI,
+ LoadedNumberListResult: LoadedNumberListResult,
+ LoadedNumberListResult$SI: LoadedNumberListResult$SI,
+ CompressionReport: CompressionReport,
+ CompressionReport$: CompressionReport$
+ },
+ "src/stemmer/stemmer.jsx": {
+ Stemmer: Stemmer,
+ Stemmer$: Stemmer$
+ },
+ "system:lib/js/js.jsx": {
+ js: js,
+ js$: js$
+ },
+ "src/metadata.jsx": {
+ Metadata: Metadata,
+ Metadata$LOktavia$: Metadata$LOktavia$,
+ Section: Section,
+ Section$LOktavia$: Section$LOktavia$,
+ Splitter: Splitter,
+ Splitter$LOktavia$: Splitter$LOktavia$,
+ Splitter$LOktavia$S: Splitter$LOktavia$S,
+ Table: Table,
+ Table$LOktavia$AS: Table$LOktavia$AS,
+ Block: Block,
+ Block$LOktavia$: Block$LOktavia$
+ },
+ "src/fm-index.jsx": {
+ FMIndex: FMIndex,
+ FMIndex$: FMIndex$
+ },
+ "src/query.jsx": {
+ Query: Query,
+ Query$: Query$
+ },
+ "src/sax.jsx": {
+ Tag: Tag,
+ Tag$S: Tag$S,
+ _Common: _Common,
+ _Common$: _Common$,
+ _State: _State,
+ _State$: _State$,
+ SAXHandler: SAXHandler,
+ SAXHandler$: SAXHandler$,
+ SAXParser: SAXParser,
+ SAXParser$LSAXHandler$: SAXParser$LSAXHandler$,
+ SAXParser$LSAXHandler$B: SAXParser$LSAXHandler$B,
+ Char: Char,
+ Char$: Char$,
+ _Entities: _Entities,
+ _Entities$: _Entities$
+ },
+ "src/stemmer/base-stemmer.jsx": {
+ BaseStemmer: BaseStemmer,
+ BaseStemmer$: BaseStemmer$
+ },
+ "src/stemmer/turkish-stemmer.jsx": {
+ TurkishStemmer: TurkishStemmer,
+ TurkishStemmer$: TurkishStemmer$
+ },
+ "src/stemmer/swedish-stemmer.jsx": {
+ SwedishStemmer: SwedishStemmer,
+ SwedishStemmer$: SwedishStemmer$
+ },
+ "src/stemmer/spanish-stemmer.jsx": {
+ SpanishStemmer: SpanishStemmer,
+ SpanishStemmer$: SpanishStemmer$
+ },
+ "src/stemmer/russian-stemmer.jsx": {
+ RussianStemmer: RussianStemmer,
+ RussianStemmer$: RussianStemmer$
+ },
+ "src/stemmer/romanian-stemmer.jsx": {
+ RomanianStemmer: RomanianStemmer,
+ RomanianStemmer$: RomanianStemmer$
+ },
+ "src/stemmer/portuguese-stemmer.jsx": {
+ PortugueseStemmer: PortugueseStemmer,
+ PortugueseStemmer$: PortugueseStemmer$
+ },
+ "src/stemmer/porter-stemmer.jsx": {
+ PorterStemmer: PorterStemmer,
+ PorterStemmer$: PorterStemmer$
+ },
+ "src/stemmer/norwegian-stemmer.jsx": {
+ NorwegianStemmer: NorwegianStemmer,
+ NorwegianStemmer$: NorwegianStemmer$
+ },
+ "src/stemmer/italian-stemmer.jsx": {
+ ItalianStemmer: ItalianStemmer,
+ ItalianStemmer$: ItalianStemmer$
+ },
+ "src/stemmer/hungarian-stemmer.jsx": {
+ HungarianStemmer: HungarianStemmer,
+ HungarianStemmer$: HungarianStemmer$
+ },
+ "src/stemmer/german-stemmer.jsx": {
+ GermanStemmer: GermanStemmer,
+ GermanStemmer$: GermanStemmer$
+ },
+ "src/stemmer/french-stemmer.jsx": {
+ FrenchStemmer: FrenchStemmer,
+ FrenchStemmer$: FrenchStemmer$
+ },
+ "src/stemmer/finnish-stemmer.jsx": {
+ FinnishStemmer: FinnishStemmer,
+ FinnishStemmer$: FinnishStemmer$
+ },
+ "src/stemmer/english-stemmer.jsx": {
+ EnglishStemmer: EnglishStemmer,
+ EnglishStemmer$: EnglishStemmer$
+ },
+ "src/stemmer/dutch-stemmer.jsx": {
+ DutchStemmer: DutchStemmer,
+ DutchStemmer$: DutchStemmer$
+ },
+ "src/stemmer/danish-stemmer.jsx": {
+ DanishStemmer: DanishStemmer,
+ DanishStemmer$: DanishStemmer$
+ },
+ "src/stemmer/among.jsx": {
+ Among: Among,
+ Among$SII: Among$SII,
+ Among$SIIF$LBaseStemmer$B$LBaseStemmer$: Among$SIIF$LBaseStemmer$B$LBaseStemmer$
+ },
+ "src/bit-vector.jsx": {
+ BitVector: BitVector,
+ BitVector$: BitVector$
+ },
+ "src/wavelet-matrix.jsx": {
+ WaveletMatrix: WaveletMatrix,
+ WaveletMatrix$: WaveletMatrix$
+ },
+ "src/burrows-wheeler-transform.jsx": {
+ BurrowsWheelerTransform: BurrowsWheelerTransform,
+ BurrowsWheelerTransform$: BurrowsWheelerTransform$
+ },
+ "src/sais.jsx": {
+ OArray: OArray,
+ OArray$AI: OArray$AI,
+ OArray$AII: OArray$AII,
+ SAIS: SAIS,
+ SAIS$: SAIS$
+ }
+};
+
+
+/**
+ * launches _Main.main(:string[]):void invoked by jsx --run|--executable
+ */
+JSX.runMain = function (sourceFile, args) {
+ var module = JSX.require(sourceFile);
+ if (! module) {
+ throw new ReferenceError("entry point module not found in " + sourceFile);
+ }
+ if (! module._Main) {
+ throw new ReferenceError("entry point _Main not found in " + sourceFile);
+ }
+ if (! module._Main.main$AS) {
+ throw new ReferenceError("entry point _Main.main(:string[]):void not found in " + sourceFile);
+ }
+ module._Main.main$AS(args);
+};
+
+/**
+ * launches _Test#test*():void invoked by jsx --test
+ */
+JSX.runTests = function (sourceFile, tests) {
+ var module = JSX.require(sourceFile);
+ var testClass = module._Test$;
+
+ if (!testClass) return; // skip if there's no test class
+
+ if(tests.length === 0) {
+ var p = testClass.prototype;
+ for (var m in p) {
+ if (p[m] instanceof Function
+ && /^test.*[$]$/.test(m)) {
+ tests.push(m);
+ }
+ }
+ }
+ else { // set as process arguments
+ tests = tests.map(function (name) {
+ return name + "$"; // mangle for function test*():void
+ });
+ }
+
+ var testCase = new testClass();
+
+ if (testCase.beforeClass$AS != null)
+ testCase.beforeClass$AS(tests);
+
+ for (var i = 0; i < tests.length; ++i) {
+ (function (method) {
+ if (method in testCase) {
+ testCase.run$SF$V$(method, function() { testCase[method](); });
+ }
+ else {
+ throw new ReferenceError("No such test method: " + method);
+ }
+ }(tests[i]));
+ }
+
+ if (testCase.afterClass$ != null)
+ testCase.afterClass$();
+};
+JSX.runMain("tool/oktavia-search.jsx", process.argv.slice(2))
+})(JSX);
diff --git a/web/server/h2o/libh2o/misc/oktavia/lib/oktavia-danish-search.js b/web/server/h2o/libh2o/misc/oktavia/lib/oktavia-danish-search.js
new file mode 100644
index 00000000..e0d209e8
--- /dev/null
+++ b/web/server/h2o/libh2o/misc/oktavia/lib/oktavia-danish-search.js
@@ -0,0 +1,8023 @@
+// generatedy by JSX compiler 0.9.24 (2013-04-05 13:45:00 +0900; 1b229cc6a411f674f0f7cf7a79b7a8b3f8eb7414)
+var JSX = {};
+(function (JSX) {
+/**
+ * copies the implementations from source interface to target
+ */
+function $__jsx_merge_interface(target, source) {
+ for (var k in source.prototype)
+ if (source.prototype.hasOwnProperty(k))
+ target.prototype[k] = source.prototype[k];
+}
+
+/**
+ * defers the initialization of the property
+ */
+function $__jsx_lazy_init(obj, prop, func) {
+ function reset(obj, prop, value) {
+ delete obj[prop];
+ obj[prop] = value;
+ return value;
+ }
+
+ Object.defineProperty(obj, prop, {
+ get: function () {
+ return reset(obj, prop, func());
+ },
+ set: function (v) {
+ reset(obj, prop, v);
+ },
+ enumerable: true,
+ configurable: true
+ });
+}
+
+/**
+ * sideeffect().a /= b
+ */
+function $__jsx_div_assign(obj, prop, divisor) {
+ return obj[prop] = (obj[prop] / divisor) | 0;
+}
+
+/*
+ * global functions, renamed to avoid conflict with local variable names
+ */
+var $__jsx_parseInt = parseInt;
+var $__jsx_parseFloat = parseFloat;
+var $__jsx_isNaN = isNaN;
+var $__jsx_isFinite = isFinite;
+
+var $__jsx_encodeURIComponent = encodeURIComponent;
+var $__jsx_decodeURIComponent = decodeURIComponent;
+var $__jsx_encodeURI = encodeURI;
+var $__jsx_decodeURI = decodeURI;
+
+var $__jsx_ObjectToString = Object.prototype.toString;
+var $__jsx_ObjectHasOwnProperty = Object.prototype.hasOwnProperty;
+
+/*
+ * profiler object, initialized afterwards
+ */
+function $__jsx_profiler() {
+}
+
+/*
+ * public interface to JSX code
+ */
+JSX.require = function (path) {
+ var m = $__jsx_classMap[path];
+ return m !== undefined ? m : null;
+};
+
+JSX.profilerIsRunning = function () {
+ return $__jsx_profiler.getResults != null;
+};
+
+JSX.getProfileResults = function () {
+ return ($__jsx_profiler.getResults || function () { return {}; })();
+};
+
+JSX.postProfileResults = function (url, cb) {
+ if ($__jsx_profiler.postResults == null)
+ throw new Error("profiler has not been turned on");
+ return $__jsx_profiler.postResults(url, cb);
+};
+
+JSX.resetProfileResults = function () {
+ if ($__jsx_profiler.resetResults == null)
+ throw new Error("profiler has not been turned on");
+ return $__jsx_profiler.resetResults();
+};
+JSX.DEBUG = false;
+/**
+ * class _Main extends Object
+ * @constructor
+ */
+function _Main() {
+}
+
+/**
+ * @constructor
+ */
+function _Main$() {
+};
+
+_Main$.prototype = new _Main;
+
+/**
+ * @param {Array.<undefined|!string>} args
+ */
+_Main.main$AS = function (args) {
+ OktaviaSearch$setStemmer$LStemmer$(new DanishStemmer$());
+};
+
+var _Main$main$AS = _Main.main$AS;
+
+/**
+ * class _Result extends Object
+ * @constructor
+ */
+function _Result() {
+}
+
+/**
+ * @constructor
+ * @param {!string} title
+ * @param {!string} url
+ * @param {!string} content
+ * @param {!number} score
+ */
+function _Result$SSSI(title, url, content, score) {
+ this.title = title;
+ this.url = url;
+ this.content = content;
+ this.score = score;
+};
+
+_Result$SSSI.prototype = new _Result;
+
+/**
+ * class _Proposal extends Object
+ * @constructor
+ */
+function _Proposal() {
+}
+
+/**
+ * @constructor
+ * @param {!string} options
+ * @param {!string} label
+ * @param {!number} count
+ */
+function _Proposal$SSI(options, label, count) {
+ this.options = options;
+ this.label = label;
+ this.count = count;
+};
+
+_Proposal$SSI.prototype = new _Proposal;
+
+/**
+ * class OktaviaSearch extends Object
+ * @constructor
+ */
+function OktaviaSearch() {
+}
+
+/**
+ * @constructor
+ * @param {!number} entriesPerPage
+ */
+function OktaviaSearch$I(entriesPerPage) {
+ this._queries = null;
+ this._highlight = "";
+ this._result = null;
+ this._proposals = null;
+ this._currentFolderDepth = 0;
+ this._oktavia = new Oktavia$();
+ this._entriesPerPage = entriesPerPage;
+ this._currentPage = 1;
+ this._queryString = null;
+ this._callback = null;
+ OktaviaSearch._instance = this;
+};
+
+OktaviaSearch$I.prototype = new OktaviaSearch;
+
+/**
+ * @param {Stemmer} stemmer
+ */
+OktaviaSearch.setStemmer$LStemmer$ = function (stemmer) {
+ /** @type {Oktavia} */
+ var this$0;
+ if (OktaviaSearch._instance) {
+ this$0 = OktaviaSearch._instance._oktavia;
+ this$0._stemmer = stemmer;
+ } else {
+ OktaviaSearch._stemmer = stemmer;
+ }
+};
+
+var OktaviaSearch$setStemmer$LStemmer$ = OktaviaSearch.setStemmer$LStemmer$;
+
+/**
+ * @param {!string} index
+ */
+OktaviaSearch.prototype.loadIndex$S = function (index) {
+ /** @type {Oktavia} */
+ var this$0;
+ /** @type {Stemmer} */
+ var stemmer$0;
+ if (OktaviaSearch._stemmer) {
+ this$0 = this._oktavia;
+ stemmer$0 = OktaviaSearch._stemmer;
+ this$0._stemmer = stemmer$0;
+ }
+ this._oktavia.load$S(Binary$base64decode$S(index));
+ if (this._queryString) {
+ this.search$SF$IIV$(this._queryString, this._callback);
+ this._queryString = null;
+ this._callback = null;
+ }
+};
+
+/**
+ * @param {!string} queryString
+ * @param {*} callback
+ */
+OktaviaSearch.prototype.search$SF$IIV$ = function (queryString, callback) {
+ /** @type {QueryStringParser} */
+ var queryParser;
+ /** @type {SearchSummary} */
+ var summary;
+ /** @type {Array.<undefined|SearchUnit>} */
+ var _result$0;
+ if (this._oktavia) {
+ queryParser = ({queries: [ ]});
+ this._queries = QueryStringParser$parse$LQueryStringParser$S(queryParser, queryString);
+ this._highlight = QueryStringParser$highlight$LQueryStringParser$(queryParser);
+ summary = this._oktavia.search$ALQuery$(this._queries);
+ if (SearchSummary$size$LSearchSummary$(summary) > 0) {
+ this._result = this._sortResult$LSearchSummary$(summary);
+ this._proposals = [ ];
+ this._currentPage = 1;
+ } else {
+ this._result = [ ];
+ if (this._queries.length > 1) {
+ this._proposals = SearchSummary$getProposal$LSearchSummary$(summary);
+ } else {
+ this._proposals = [ ];
+ }
+ this._currentPage = 1;
+ }
+ callback((_result$0 = this._result).length, Math.ceil(_result$0.length / this._entriesPerPage));
+ } else {
+ this._queryString = queryString;
+ this._callback = callback;
+ }
+};
+
+/**
+ * @return {!number}
+ */
+OktaviaSearch.prototype.resultSize$ = function () {
+ return (this._result.length | 0);
+};
+
+/**
+ * @return {!number}
+ */
+OktaviaSearch.prototype.totalPages$ = function () {
+ return (Math.ceil(this._result.length / this._entriesPerPage) | 0);
+};
+
+/**
+ * @return {!number}
+ */
+OktaviaSearch.prototype.currentPage$ = function () {
+ return this._currentPage;
+};
+
+/**
+ * @param {!number} page
+ */
+OktaviaSearch.prototype.setCurrentPage$I = function (page) {
+ this._currentPage = page;
+};
+
+/**
+ * @return {!boolean}
+ */
+OktaviaSearch.prototype.hasPrevPage$ = function () {
+ return this._currentPage !== 1;
+};
+
+/**
+ * @return {!boolean}
+ */
+OktaviaSearch.prototype.hasNextPage$ = function () {
+ return this._currentPage !== Math.ceil(this._result.length / this._entriesPerPage);
+};
+
+/**
+ * @return {Array.<undefined|!string>}
+ */
+OktaviaSearch.prototype.pageIndexes$ = function () {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var total;
+ /** @type {!number} */
+ var i;
+ result = [ ];
+ total = Math.ceil(this._result.length / this._entriesPerPage);
+ if (total < 10) {
+ for (i = 1; i <= total; i++) {
+ result.push(i + "");
+ }
+ } else {
+ if (this._currentPage <= 5) {
+ for (i = 1; i <= 7; i++) {
+ result.push(i + "");
+ }
+ result.push('...', total + "");
+ } else {
+ if (total - 5 <= this._currentPage) {
+ result.push('1', '...');
+ for (i = total - 8; i <= total; i++) {
+ result.push(i + "");
+ }
+ } else {
+ result.push('1', '...');
+ for (i = this._currentPage - 3; i <= this._currentPage + 3; i++) {
+ result.push(i + "");
+ }
+ result.push('...', total + "");
+ }
+ }
+ }
+ return result;
+};
+
+/**
+ * @return {Array.<undefined|_Result>}
+ */
+OktaviaSearch.prototype.getResult$ = function () {
+ /** @type {Style} */
+ var style;
+ /** @type {!number} */
+ var start;
+ /** @type {!number} */
+ var last;
+ /** @type {Metadata} */
+ var metadata;
+ /** @type {!number} */
+ var num;
+ /** @type {Array.<undefined|_Result>} */
+ var results;
+ /** @type {!number} */
+ var i;
+ /** @type {SearchUnit} */
+ var unit;
+ /** @type {Array.<undefined|!string>} */
+ var info;
+ /** @type {!string} */
+ var content;
+ /** @type {Array.<undefined|Position>} */
+ var positions;
+ /** @type {!number} */
+ var end;
+ /** @type {!boolean} */
+ var split;
+ /** @type {!number} */
+ var j;
+ /** @type {Position} */
+ var pos;
+ /** @type {!string} */
+ var text;
+ /** @type {Oktavia} */
+ var this$0;
+ /** @type {!number} */
+ var position$0;
+ /** @type {!number} */
+ var _currentPage$0;
+ /** @type {!number} */
+ var _entriesPerPage$0;
+ style = new Style$S('html');
+ start = ((_currentPage$0 = this._currentPage) - 1) * (_entriesPerPage$0 = this._entriesPerPage);
+ last = Math.min(_currentPage$0 * _entriesPerPage$0, this._result.length);
+ this$0 = this._oktavia;
+ metadata = this$0._metadatas[this$0._metadataLabels[0]];
+ num = 250;
+ results = [ ];
+ for (i = start; i < last; i++) {
+ unit = this._result[i];
+ info = metadata.getInformation$I(unit.id).split(Oktavia.eob);
+ content = metadata.getContent$I(unit.id);
+ start = 0;
+ positions = SearchUnit$getPositions$LSearchUnit$(unit);
+ if (content.indexOf(info[0]) === 1) {
+ content = content.slice(info[0].length + 2, content.length);
+ start += info[0].length + 2;
+ }
+ end = start + num;
+ split = false;
+ if (positions[0].position > end - positions[0].word.length) {
+ end = positions[0].position + Math.floor(num / 2);
+ split = true;
+ }
+ for (j = positions.length - 1; j > -1; j--) {
+ pos = positions[j];
+ if (pos.position + pos.word.length < end) {
+ content = [ content.slice(0, pos.position - start), style.convert$S('<hit>*</hit>').replace('*', content.slice((position$0 = pos.position) - start, position$0 + pos.word.length - start)), content.slice(pos.position + pos.word.length - start, content.length) ].join('');
+ }
+ }
+ if (split) {
+ text = [ content.slice(0, Math.floor(num / 2)) + ' ...', content.slice(- Math.floor(num / 2), end - start) ].join('<br/>');
+ } else {
+ text = content.slice(0, end - start) + ' ...<br/>';
+ }
+ text = text.replace(Oktavia.eob, ' ').replace(/(<br\/>)(<br\/>)+/, '<br/><br/>');
+ results.push(({title: info[0], url: info[1], content: text, score: unit.score}));
+ }
+ return results;
+};
+
+/**
+ * @return {!string}
+ */
+OktaviaSearch.prototype.getHighlight$ = function () {
+ return this._highlight;
+};
+
+/**
+ * @return {Array.<undefined|_Proposal>}
+ */
+OktaviaSearch.prototype.getProposals$ = function () {
+ /** @type {Style} */
+ var style;
+ /** @type {Array.<undefined|_Proposal>} */
+ var results;
+ /** @type {!number} */
+ var i;
+ /** @type {Proposal} */
+ var proposal;
+ /** @type {Array.<undefined|!string>} */
+ var label;
+ /** @type {Array.<undefined|!string>} */
+ var option;
+ /** @type {!number} */
+ var j;
+ style = new Style$S('html');
+ results = [ ];
+ if (this._queries.length > 1) {
+ for (i = 0; i < this._proposals.length; i++) {
+ proposal = this._proposals[i];
+ if (proposal.expect > 0) {
+ label = [ ];
+ option = [ ];
+ for (j = 0; j < this._queries.length; j++) {
+ if (j !== proposal.omit) {
+ label.push(style.convert$S('<hit>' + this._queries[j].toString() + '</hit>'));
+ option.push(this._queries[j].toString());
+ } else {
+ label.push(style.convert$S('<del>' + this._queries[j].toString() + '</del>'));
+ }
+ }
+ results.push(({options: option.join(' '), label: label.join('&nbsp;'), count: proposal.expect}));
+ }
+ }
+ }
+ return results;
+};
+
+/**
+ * @param {SearchSummary} summary
+ * @return {Array.<undefined|SearchUnit>}
+ */
+OktaviaSearch.prototype._sortResult$LSearchSummary$ = function (summary) {
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var score;
+ /** @type {SearchUnit} */
+ var unit;
+ /** @type {!string} */
+ var pos;
+ /** @type {Position} */
+ var position;
+ for (i = 0; i < summary.result.units.length; i++) {
+ score = 0;
+ unit = summary.result.units[i];
+ for (pos in unit.positions) {
+ position = unit.positions[pos];
+ if (this._oktavia.wordPositionType$I(position.position)) {
+ score += 10;
+ } else {
+ score += 1;
+ }
+ if (! position.stemmed) {
+ score += 2;
+ }
+ }
+ unit.score = (score | 0);
+ }
+ return SearchSummary$getSortedResult$LSearchSummary$(summary);
+};
+
+/**
+ * class _Main$0 extends Object
+ * @constructor
+ */
+function _Main$0() {
+}
+
+/**
+ * @constructor
+ */
+function _Main$0$() {
+};
+
+_Main$0$.prototype = new _Main$0;
+
+/**
+ * @param {Array.<undefined|!string>} args
+ */
+_Main$0.main$AS = function (args) {
+};
+
+var _Main$0$main$AS = _Main$0.main$AS;
+
+/**
+ * class Oktavia extends Object
+ * @constructor
+ */
+function Oktavia() {
+}
+
+/**
+ * @constructor
+ */
+function Oktavia$() {
+ /** @type {Array.<undefined|!string>} */
+ var _utf162compressCode$0;
+ this._compressCode2utf16 = null;
+ this._fmindex = new FMIndex$();
+ this._metadatas = ({ });
+ this._metadataLabels = [ ];
+ this._stemmer = null;
+ this._stemmingResult = ({ });
+ _utf162compressCode$0 = this._utf162compressCode = [ Oktavia.eof, Oktavia.eob, Oktavia.unknown ];
+ _utf162compressCode$0.length = 65536;
+ this._compressCode2utf16 = [ Oktavia.eof, Oktavia.eob, Oktavia.unknown ];
+};
+
+Oktavia$.prototype = new Oktavia;
+
+/**
+ * @param {Stemmer} stemmer
+ */
+Oktavia.prototype.setStemmer$LStemmer$ = function (stemmer) {
+ this._stemmer = stemmer;
+};
+
+/**
+ * @return {Metadata}
+ */
+Oktavia.prototype.getPrimaryMetadata$ = function () {
+ return this._metadatas[this._metadataLabels[0]];
+};
+
+/**
+ * @param {!string} key
+ * @return {Section}
+ */
+Oktavia.prototype.addSection$S = function (key) {
+ /** @type {Section} */
+ var section;
+ if (this._metadataLabels.indexOf(key) !== -1) {
+ throw new Error('Metadata name ' + key + ' is already exists');
+ }
+ this._metadataLabels.push(key);
+ section = new Section$LOktavia$(this);
+ this._metadatas[key] = section;
+ return section;
+};
+
+/**
+ * @param {!string} key
+ * @return {Section}
+ */
+Oktavia.prototype.getSection$S = function (key) {
+ if (this._metadataLabels.indexOf(key) === -1) {
+ throw new Error('Metadata name ' + key + " does't exists");
+ }
+ return this._metadatas[key];
+};
+
+/**
+ * @param {!string} key
+ * @return {Splitter}
+ */
+Oktavia.prototype.addSplitter$S = function (key) {
+ /** @type {Splitter} */
+ var splitter;
+ if (this._metadataLabels.indexOf(key) !== -1) {
+ throw new Error('Metadata name ' + key + ' is already exists');
+ }
+ this._metadataLabels.push(key);
+ splitter = new Splitter$LOktavia$(this);
+ this._metadatas[key] = splitter;
+ return splitter;
+};
+
+/**
+ * @param {!string} key
+ * @return {Splitter}
+ */
+Oktavia.prototype.getSplitter$S = function (key) {
+ if (this._metadataLabels.indexOf(key) === -1) {
+ throw new Error('Metadata name ' + key + " does't exists");
+ }
+ return this._metadatas[key];
+};
+
+/**
+ * @param {!string} key
+ * @param {Array.<undefined|!string>} headers
+ * @return {Table}
+ */
+Oktavia.prototype.addTable$SAS = function (key, headers) {
+ /** @type {Table} */
+ var table;
+ if (this._metadataLabels.indexOf(key) !== -1) {
+ throw new Error('Metadata name ' + key + ' is already exists');
+ }
+ this._metadataLabels.push(key);
+ table = new Table$LOktavia$AS(this, headers);
+ this._metadatas[key] = table;
+ return table;
+};
+
+/**
+ * @param {!string} key
+ * @return {Table}
+ */
+Oktavia.prototype.getTable$S = function (key) {
+ if (this._metadataLabels.indexOf(key) === -1) {
+ throw new Error('Metadata name ' + key + " does't exists");
+ }
+ return this._metadatas[key];
+};
+
+/**
+ * @param {!string} key
+ * @return {Block}
+ */
+Oktavia.prototype.addBlock$S = function (key) {
+ /** @type {Block} */
+ var block;
+ if (this._metadataLabels.indexOf(key) !== -1) {
+ throw new Error('Metadata name ' + key + ' is already exists');
+ }
+ this._metadataLabels.push(key);
+ block = new Block$LOktavia$(this);
+ this._metadatas[key] = block;
+ return block;
+};
+
+/**
+ * @param {!string} key
+ * @return {Block}
+ */
+Oktavia.prototype.getBlock$S = function (key) {
+ if (this._metadataLabels.indexOf(key) === -1) {
+ throw new Error('Metadata name ' + key + " does't exists");
+ }
+ return this._metadatas[key];
+};
+
+/**
+ */
+Oktavia.prototype.addEndOfBlock$ = function () {
+ this._fmindex.push$S(Oktavia.eob);
+};
+
+/**
+ * @param {!string} words
+ */
+Oktavia.prototype.addWord$S = function (words) {
+ /** @type {Array.<undefined|!string>} */
+ var str;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var charCode;
+ /** @type {undefined|!string} */
+ var newCharCode;
+ str = [ ];
+ str.length = words.length;
+ for (i = 0; i < words.length; i++) {
+ charCode = words.charCodeAt(i);
+ newCharCode = this._utf162compressCode[charCode];
+ if (newCharCode == null) {
+ newCharCode = String.fromCharCode(this._compressCode2utf16.length);
+ this._utf162compressCode[charCode] = newCharCode;
+ this._compressCode2utf16.push(String.fromCharCode(charCode));
+ }
+ str.push(newCharCode);
+ }
+ this._fmindex.push$S(str.join(''));
+};
+
+/**
+ * @param {!string} words
+ * @param {!boolean} stemming
+ */
+Oktavia.prototype.addWord$SB = function (words, stemming) {
+ /** @type {Array.<undefined|!string>} */
+ var wordList;
+ /** @type {!number} */
+ var i;
+ /** @type {undefined|!string} */
+ var originalWord;
+ /** @type {!string} */
+ var smallWord;
+ /** @type {undefined|!string} */
+ var registerWord;
+ /** @type {!string} */
+ var baseWord;
+ /** @type {!string} */
+ var compressedCodeWord;
+ /** @type {Array.<undefined|!string>} */
+ var stemmedList;
+ this.addWord$S(words);
+ wordList = words.split(/\s+/);
+ for (i = 0; i < wordList.length; i++) {
+ originalWord = wordList[i];
+ smallWord = originalWord.slice(0, 1).toLowerCase() + originalWord.slice(1);
+ registerWord = null;
+ if (stemming && this._stemmer) {
+ baseWord = this._stemmer.stemWord$S(originalWord.toLowerCase());
+ if (originalWord.indexOf(baseWord) === -1) {
+ registerWord = baseWord;
+ }
+ } else {
+ if (originalWord != smallWord) {
+ registerWord = smallWord;
+ }
+ }
+ if (registerWord) {
+ compressedCodeWord = this._convertToCompressionCode$S(originalWord);
+ stemmedList = this._stemmingResult[registerWord];
+ if (! stemmedList) {
+ stemmedList = [ compressedCodeWord ];
+ this._stemmingResult[registerWord] = stemmedList;
+ } else {
+ if (stemmedList.indexOf(compressedCodeWord) === -1) {
+ stemmedList.push(compressedCodeWord);
+ }
+ }
+ }
+ }
+};
+
+/**
+ * @param {!string} keyword
+ * @return {!string}
+ */
+Oktavia.prototype._convertToCompressionCode$S = function (keyword) {
+ /** @type {Array.<undefined|!string>} */
+ var resultChars;
+ /** @type {!number} */
+ var i;
+ /** @type {undefined|!string} */
+ var chr;
+ resultChars = [ ];
+ for (i = 0; i < keyword.length; i++) {
+ chr = this._utf162compressCode[keyword.charCodeAt(i)];
+ if (chr == null) {
+ resultChars.push(Oktavia.unknown);
+ } else {
+ resultChars.push(chr);
+ }
+ }
+ return resultChars.join('');
+};
+
+/**
+ * @param {!string} keyword
+ * @param {!boolean} stemming
+ * @return {Array.<undefined|!number>}
+ */
+Oktavia.prototype.rawSearch$SB = function (keyword, stemming) {
+ /** @type {Array.<undefined|!number>} */
+ var result;
+ /** @type {!string} */
+ var baseWord;
+ /** @type {Array.<undefined|!string>} */
+ var stemmedList;
+ /** @type {!number} */
+ var i;
+ /** @type {undefined|!string} */
+ var word;
+ if (stemming) {
+ result = [ ];
+ if (this._stemmer) {
+ baseWord = this._stemmer.stemWord$S(keyword.toLowerCase());
+ stemmedList = this._stemmingResult[baseWord];
+ if (stemmedList) {
+ for (i = 0; i < stemmedList.length; i++) {
+ word = stemmedList[i];
+ result = result.concat(this._fmindex.search$S(word));
+ }
+ }
+ }
+ } else {
+ result = this._fmindex.search$S(this._convertToCompressionCode$S(keyword));
+ }
+ return result;
+};
+
+/**
+ * @param {Array.<undefined|Query>} queries
+ * @return {SearchSummary}
+ */
+Oktavia.prototype.search$ALQuery$ = function (queries) {
+ /** @type {SearchSummary} */
+ var summary;
+ /** @type {!number} */
+ var i;
+ /** @type {SingleResult} */
+ var result$0;
+ summary = ({sourceResults: [ ], result: null, oktavia: this});
+ for (i = 0; i < queries.length; i++) {
+ result$0 = this._searchQuery$LQuery$(queries[i]);
+ summary.sourceResults.push(result$0);
+ }
+ summary.result = SearchSummary$mergeResult$LSearchSummary$ALSingleResult$(summary, summary.sourceResults);
+ return summary;
+};
+
+/**
+ * @param {Query} query
+ * @return {SingleResult}
+ */
+Oktavia.prototype._searchQuery$LQuery$ = function (query) {
+ /** @type {SingleResult} */
+ var result;
+ /** @type {Array.<undefined|!number>} */
+ var positions;
+ result = new SingleResult$SBB(query.word, query.or, query.not);
+ if (query.raw) {
+ positions = this.rawSearch$SB(query.word, false);
+ } else {
+ positions = this.rawSearch$SB(query.word, false).concat(this.rawSearch$SB(query.word, true));
+ }
+ this._metadatas[this._metadataLabels[0]].grouping$LSingleResult$AISB(result, positions, query.word, ! query.raw);
+ return result;
+};
+
+/**
+ */
+Oktavia.prototype.build$ = function () {
+ this.build$IB(5, false);
+};
+
+/**
+ * @param {!number} cacheDensity
+ * @param {!boolean} verbose
+ */
+Oktavia.prototype.build$IB = function (cacheDensity, verbose) {
+ /** @type {!string} */
+ var key;
+ /** @type {!number} */
+ var cacheRange;
+ /** @type {!number} */
+ var maxChar;
+ for (key in this._metadatas) {
+ this._metadatas[key]._build$();
+ }
+ cacheRange = Math.round(Math.max(1, 100 / Math.min(100, Math.max(0.01, cacheDensity))));
+ maxChar = this._compressCode2utf16.length;
+ this._fmindex.build$SIIB(Oktavia.eof, maxChar, cacheRange, verbose);
+};
+
+/**
+ * @return {!string}
+ */
+Oktavia.prototype.dump$ = function () {
+ return this.dump$B(false);
+};
+
+/**
+ * @param {!boolean} verbose
+ * @return {!string}
+ */
+Oktavia.prototype.dump$B = function (verbose) {
+ /** @type {!string} */
+ var header;
+ /** @type {!string} */
+ var fmdata;
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var i;
+ /** @type {CompressionReport} */
+ var report;
+ /** @type {undefined|!string} */
+ var name;
+ /** @type {!string} */
+ var data;
+ header = Binary$dumpString$SLCompressionReport$("oktavia-01", null).slice(1);
+ if (verbose) {
+ console.log("Source text size: " + (this._fmindex.size$() * 2 + "") + ' bytes');
+ }
+ fmdata = this._fmindex.dump$B(verbose);
+ result = [ header, fmdata ];
+ result.push(Binary$dump16bitNumber$I(this._compressCode2utf16.length));
+ for (i = 3; i < this._compressCode2utf16.length; i++) {
+ result.push(this._compressCode2utf16[i]);
+ }
+ if (verbose) {
+ console.log('Char Code Map: ' + (this._compressCode2utf16.length * 2 - 2 + "") + ' bytes');
+ }
+ report = ({source: 0, result: 0});
+ result.push(Binary$dumpStringListMap$HASLCompressionReport$(this._stemmingResult, report));
+ if (verbose) {
+ console.log('Stemmed Word Table: ' + (result[result.length - 1].length + "") + ' bytes (' + (Math.round(report.result * 100.0 / report.source) + "") + '%)');
+ }
+ result.push(Binary$dump16bitNumber$I(this._metadataLabels.length));
+ for (i = 0; i < this._metadataLabels.length; i++) {
+ report = ({source: 0, result: 0});
+ name = this._metadataLabels[i];
+ data = this._metadatas[name]._dump$LCompressionReport$(report);
+ result.push(Binary$dumpString$SLCompressionReport$(name, report), data);
+ if (verbose) {
+ console.log('Meta Data ' + name + ': ' + (data.length * 2 + "") + ' bytes (' + (Math.round(report.result * 100.0 / report.source) + "") + '%)');
+ }
+ }
+ return result.join('');
+};
+
+/**
+ * @param {!string} data
+ */
+Oktavia.prototype.load$S = function (data) {
+ /** @type {!string} */
+ var header;
+ /** @type {!number} */
+ var offset;
+ /** @type {!number} */
+ var charCodeCount;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var charCode;
+ /** @type {LoadedStringListMapResult} */
+ var stemmedWords;
+ /** @type {!number} */
+ var metadataCount;
+ /** @type {LoadedStringResult} */
+ var nameResult;
+ /** @type {!string} */
+ var name;
+ /** @type {!number} */
+ var type;
+ header = Binary$dumpString$SLCompressionReport$("oktavia-01", null).slice(1);
+ if (data.slice(0, 5) !== header) {
+ throw new Error('Invalid data file');
+ }
+ this._metadatas = ({ });
+ this._metadataLabels = [ ];
+ offset = 5;
+ offset = this._fmindex.load$SI(data, offset);
+ charCodeCount = Binary$load16bitNumber$SI(data, offset++);
+ this._compressCode2utf16 = [ Oktavia.eof, Oktavia.eob, Oktavia.unknown ];
+ this._utf162compressCode = [ Oktavia.eof, Oktavia.eob, Oktavia.unknown ];
+ for (i = 3; i < charCodeCount; i++) {
+ charCode = Binary$load16bitNumber$SI(data, offset++);
+ this._compressCode2utf16.push(String.fromCharCode(charCode));
+ this._utf162compressCode[charCode] = String.fromCharCode(i);
+ }
+ stemmedWords = Binary$loadStringListMap$SI(data, offset);
+ this._stemmingResult = stemmedWords.result;
+ offset = stemmedWords.offset;
+ metadataCount = Binary$load16bitNumber$SI(data, offset++);
+ for (i = 0; i < metadataCount; i++) {
+ nameResult = Binary$loadString$SI(data, offset);
+ name = nameResult.result;
+ offset = nameResult.offset;
+ type = Binary$load16bitNumber$SI(data, offset++);
+ switch (type) {
+ case 0:
+ offset = Section$_load$LOktavia$SSI(this, name, data, offset);
+ break;
+ case 1:
+ offset = Splitter$_load$LOktavia$SSI(this, name, data, offset);
+ break;
+ case 2:
+ offset = Table$_load$LOktavia$SSI(this, name, data, offset);
+ break;
+ case 3:
+ offset = Block$_load$LOktavia$SSI(this, name, data, offset);
+ break;
+ }
+ }
+};
+
+/**
+ * @return {!number}
+ */
+Oktavia.prototype.contentSize$ = function () {
+ /** @type {FMIndex} */
+ var this$0;
+ this$0 = this._fmindex;
+ return this$0._substr.length;
+};
+
+/**
+ * @param {!number} position
+ * @return {!number}
+ */
+Oktavia.prototype.wordPositionType$I = function (position) {
+ /** @type {!number} */
+ var result;
+ /** @type {!string} */
+ var ahead;
+ result = 0;
+ if (position === 0) {
+ result = 4;
+ } else {
+ ahead = this._fmindex.getSubstring$II(position - 1, 1);
+ if (/\s/.test(ahead)) {
+ result = 2;
+ } else {
+ if (/\W/.test(ahead)) {
+ result = 1;
+ } else {
+ if (Oktavia.eob === ahead) {
+ result = 3;
+ }
+ }
+ }
+ }
+ return (result | 0);
+};
+
+/**
+ * @param {!number} position
+ * @param {!number} length
+ * @return {!string}
+ */
+Oktavia.prototype._getSubstring$II = function (position, length) {
+ /** @type {!string} */
+ var result;
+ /** @type {Array.<undefined|!string>} */
+ var str;
+ /** @type {!number} */
+ var i;
+ result = this._fmindex.getSubstring$II(position, length);
+ str = [ ];
+ for (i = 0; i < result.length; i++) {
+ str.push(this._compressCode2utf16[result.charCodeAt(i)]);
+ }
+ return str.join('');
+};
+
+/**
+ * class Binary extends Object
+ * @constructor
+ */
+function Binary() {
+}
+
+/**
+ * @constructor
+ */
+function Binary$() {
+};
+
+Binary$.prototype = new Binary;
+
+/**
+ * @param {!number} num
+ * @return {!string}
+ */
+Binary.dump32bitNumber$N = function (num) {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ result = [ String.fromCharCode(Math.floor(num / 65536)) ];
+ result.push(String.fromCharCode(num % 65536));
+ return result.join("");
+};
+
+var Binary$dump32bitNumber$N = Binary.dump32bitNumber$N;
+
+/**
+ * @param {!string} buffer
+ * @param {!number} offset
+ * @return {!number}
+ */
+Binary.load32bitNumber$SI = function (buffer, offset) {
+ /** @type {!number} */
+ var result;
+ result = buffer.charCodeAt(offset) * 65536 + buffer.charCodeAt(offset + 1);
+ return result;
+};
+
+var Binary$load32bitNumber$SI = Binary.load32bitNumber$SI;
+
+/**
+ * @param {!number} num
+ * @return {!string}
+ */
+Binary.dump16bitNumber$I = function (num) {
+ return String.fromCharCode(num % 65536);
+};
+
+var Binary$dump16bitNumber$I = Binary.dump16bitNumber$I;
+
+/**
+ * @param {!string} buffer
+ * @param {!number} offset
+ * @return {!number}
+ */
+Binary.load16bitNumber$SI = function (buffer, offset) {
+ return (buffer.charCodeAt(offset) | 0);
+};
+
+var Binary$load16bitNumber$SI = Binary.load16bitNumber$SI;
+
+/**
+ * @param {!string} str
+ * @return {!string}
+ */
+Binary.dumpString$S = function (str) {
+ return Binary$dumpString$SLCompressionReport$(str, null);
+};
+
+var Binary$dumpString$S = Binary.dumpString$S;
+
+/**
+ * @param {!string} str
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+Binary.dumpString$SLCompressionReport$ = function (str, report) {
+ /** @type {!number} */
+ var length;
+ /** @type {!boolean} */
+ var compress;
+ /** @type {Array.<undefined|!number>} */
+ var charCodes;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var charCode;
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {undefined|!number} */
+ var bytes;
+ if (str.length > 32768) {
+ str = str.slice(0, 32768);
+ }
+ length = str.length;
+ compress = true;
+ charCodes = [ ];
+ for (i = 0; i < length; i++) {
+ charCode = str.charCodeAt(i);
+ if (charCode > 255) {
+ compress = false;
+ break;
+ }
+ charCodes.push(charCode);
+ }
+ if (compress) {
+ result = [ Binary$dump16bitNumber$I(length + 32768) ];
+ for (i = 0; i < length; i += 2) {
+ bytes = charCodes[i];
+ if (i !== length - 1) {
+ bytes += charCodes[i + 1] << 8;
+ }
+ result.push(String.fromCharCode(bytes % 65536));
+ }
+ if (report) {
+ CompressionReport$add$LCompressionReport$II(report, length, Math.ceil(length / 2));
+ }
+ } else {
+ result = [ Binary$dump16bitNumber$I(length), str ];
+ if (report) {
+ CompressionReport$add$LCompressionReport$II(report, length, length);
+ }
+ }
+ return result.join('');
+};
+
+var Binary$dumpString$SLCompressionReport$ = Binary.dumpString$SLCompressionReport$;
+
+/**
+ * @param {!string} buffer
+ * @param {!number} offset
+ * @return {LoadedStringResult}
+ */
+Binary.loadString$SI = function (buffer, offset) {
+ return new LoadedStringResult$SI(buffer, offset);
+};
+
+var Binary$loadString$SI = Binary.loadString$SI;
+
+/**
+ * @param {Array.<undefined|!string>} strList
+ * @return {!string}
+ */
+Binary.dumpStringList$AS = function (strList) {
+ return Binary$dumpStringList$ASLCompressionReport$(strList, null);
+};
+
+var Binary$dumpStringList$AS = Binary.dumpStringList$AS;
+
+/**
+ * @param {Array.<undefined|!string>} strList
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+Binary.dumpStringList$ASLCompressionReport$ = function (strList, report) {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var i;
+ result = [ Binary$dump32bitNumber$N(strList.length) ];
+ for (i = 0; i < strList.length; i++) {
+ result.push(Binary$dumpString$SLCompressionReport$(strList[i], report));
+ }
+ return result.join('');
+};
+
+var Binary$dumpStringList$ASLCompressionReport$ = Binary.dumpStringList$ASLCompressionReport$;
+
+/**
+ * @param {!string} buffer
+ * @param {!number} offset
+ * @return {LoadedStringListResult}
+ */
+Binary.loadStringList$SI = function (buffer, offset) {
+ return new LoadedStringListResult$SI(buffer, offset);
+};
+
+var Binary$loadStringList$SI = Binary.loadStringList$SI;
+
+/**
+ * @param {Object.<string, undefined|Array.<undefined|!string>>} strMap
+ * @return {!string}
+ */
+Binary.dumpStringListMap$HAS = function (strMap) {
+ return Binary$dumpStringListMap$HASLCompressionReport$(strMap, null);
+};
+
+var Binary$dumpStringListMap$HAS = Binary.dumpStringListMap$HAS;
+
+/**
+ * @param {Object.<string, undefined|Array.<undefined|!string>>} strMap
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+Binary.dumpStringListMap$HASLCompressionReport$ = function (strMap, report) {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var counter;
+ /** @type {!string} */
+ var key;
+ result = [ ];
+ counter = 0;
+ for (key in strMap) {
+ result.push(Binary$dumpString$SLCompressionReport$(key, report));
+ result.push(Binary$dumpStringList$ASLCompressionReport$(strMap[key], report));
+ counter++;
+ }
+ return Binary$dump32bitNumber$N(counter) + result.join('');
+};
+
+var Binary$dumpStringListMap$HASLCompressionReport$ = Binary.dumpStringListMap$HASLCompressionReport$;
+
+/**
+ * @param {!string} buffer
+ * @param {!number} offset
+ * @return {LoadedStringListMapResult}
+ */
+Binary.loadStringListMap$SI = function (buffer, offset) {
+ return new LoadedStringListMapResult$SI(buffer, offset);
+};
+
+var Binary$loadStringListMap$SI = Binary.loadStringListMap$SI;
+
+/**
+ * @param {Array.<undefined|!number>} array
+ * @return {!string}
+ */
+Binary.dump32bitNumberList$AN = function (array) {
+ return Binary$dump32bitNumberList$ANLCompressionReport$(array, null);
+};
+
+var Binary$dump32bitNumberList$AN = Binary.dump32bitNumberList$AN;
+
+/**
+ * @param {Array.<undefined|!number>} array
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+Binary.dump32bitNumberList$ANLCompressionReport$ = function (array, report) {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var index;
+ /** @type {!number} */
+ var inputLength;
+ /** @type {!number} */
+ var length;
+ /** @type {!string} */
+ var resultString;
+ /** @type {!number} */
+ var value1$0;
+ /** @type {!number} */
+ var value2$0;
+ result = [ Binary$dump32bitNumber$N(array.length) ];
+ index = 0;
+ inputLength = array.length;
+ while (index < inputLength) {
+ if (array[index] == 0) {
+ length = Binary$_countZero$ANI(array, index);
+ result.push(Binary$_zeroBlock$I(length));
+ index += length;
+ } else {
+ if (Binary$_shouldZebraCode$ANI(array, index)) {
+ result.push(Binary$_createZebraCode$ANI(array, index));
+ value1$0 = array.length;
+ value2$0 = index + 15;
+ index = (value1$0 <= value2$0 ? value1$0 : value2$0);
+ } else {
+ length = Binary$_searchDoubleZero$ANI(array, index);
+ result.push(Binary$_nonZeroBlock$ANII(array, index, length));
+ if (length === 0) {
+ throw new Error('');
+ }
+ index += length;
+ }
+ }
+ }
+ resultString = result.join('');
+ if (report) {
+ CompressionReport$add$LCompressionReport$II(report, array.length * 2 + 2, resultString.length);
+ }
+ return resultString;
+};
+
+var Binary$dump32bitNumberList$ANLCompressionReport$ = Binary.dump32bitNumberList$ANLCompressionReport$;
+
+/**
+ * @param {!string} buffer
+ * @param {!number} offset
+ * @return {LoadedNumberListResult}
+ */
+Binary.load32bitNumberList$SI = function (buffer, offset) {
+ return new LoadedNumberListResult$SI(buffer, offset);
+};
+
+var Binary$load32bitNumberList$SI = Binary.load32bitNumberList$SI;
+
+/**
+ * @param {Array.<undefined|!number>} array
+ * @param {!number} offset
+ * @return {!number}
+ */
+Binary._countZero$ANI = function (array, offset) {
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var array$len$0;
+ for ((i = offset, array$len$0 = array.length); i < array$len$0; i++) {
+ if (array[i] != 0) {
+ return (i - offset | 0);
+ }
+ }
+ return (array.length - offset | 0);
+};
+
+var Binary$_countZero$ANI = Binary._countZero$ANI;
+
+/**
+ * @param {!number} length
+ * @return {!string}
+ */
+Binary._zeroBlock$I = function (length) {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ result = [ ];
+ while (length > 0) {
+ if (length > 16384) {
+ result.push(Binary$dump16bitNumber$I(16383));
+ length -= 16384;
+ } else {
+ result.push(Binary$dump16bitNumber$I(length - 1));
+ length = 0;
+ }
+ }
+ return result.join('');
+};
+
+var Binary$_zeroBlock$I = Binary._zeroBlock$I;
+
+/**
+ * @param {Array.<undefined|!number>} array
+ * @param {!number} offset
+ * @return {!boolean}
+ */
+Binary._shouldZebraCode$ANI = function (array, offset) {
+ /** @type {!number} */
+ var change;
+ /** @type {!boolean} */
+ var isLastZero;
+ /** @type {!number} */
+ var i;
+ if (array.length - offset < 16) {
+ return true;
+ }
+ change = 0;
+ isLastZero = false;
+ for (i = offset; i < offset + 15; i++) {
+ if (array[i] == 0) {
+ if (! isLastZero) {
+ isLastZero = true;
+ change++;
+ }
+ } else {
+ if (isLastZero) {
+ isLastZero = false;
+ change++;
+ }
+ }
+ }
+ return change > 2;
+};
+
+var Binary$_shouldZebraCode$ANI = Binary._shouldZebraCode$ANI;
+
+/**
+ * @param {Array.<undefined|!number>} array
+ * @param {!number} offset
+ * @return {!number}
+ */
+Binary._searchDoubleZero$ANI = function (array, offset) {
+ /** @type {!boolean} */
+ var isLastZero;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var array$len$0;
+ isLastZero = false;
+ for ((i = offset, array$len$0 = array.length); i < array$len$0; i++) {
+ if (array[i] == 0) {
+ if (isLastZero) {
+ return (i - offset - 1 | 0);
+ }
+ isLastZero = true;
+ } else {
+ isLastZero = false;
+ }
+ }
+ return (array.length - offset | 0);
+};
+
+var Binary$_searchDoubleZero$ANI = Binary._searchDoubleZero$ANI;
+
+/**
+ * @param {Array.<undefined|!number>} array
+ * @param {!number} offset
+ * @param {!number} length
+ * @return {!string}
+ */
+Binary._nonZeroBlock$ANII = function (array, offset, length) {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var blockLength;
+ /** @type {!number} */
+ var i;
+ result = [ ];
+ while (length > 0) {
+ if (length > 16384) {
+ blockLength = 16384;
+ length -= 16384;
+ } else {
+ blockLength = length;
+ length = 0;
+ }
+ result.push(Binary$dump16bitNumber$I(blockLength - 1 + 0x4000));
+ for (i = offset; i < offset + blockLength; i++) {
+ result.push(Binary$dump32bitNumber$N(array[i]));
+ }
+ offset += blockLength;
+ }
+ return result.join('');
+};
+
+var Binary$_nonZeroBlock$ANII = Binary._nonZeroBlock$ANII;
+
+/**
+ * @param {Array.<undefined|!number>} array
+ * @param {!number} offset
+ * @return {!string}
+ */
+Binary._createZebraCode$ANI = function (array, offset) {
+ /** @type {!number} */
+ var last;
+ /** @type {!number} */
+ var code;
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var value1$0;
+ /** @type {!number} */
+ var value2$0;
+ value1$0 = offset + 15;
+ value2$0 = array.length;
+ last = (value1$0 <= value2$0 ? value1$0 : value2$0);
+ code = 0x8000;
+ result = [ ];
+ for (i = offset; i < last; i++) {
+ if (array[i] != 0) {
+ result.push(Binary$dump32bitNumber$N(array[i]));
+ code = code + (0x1 << i - offset);
+ }
+ }
+ return String.fromCharCode(code) + result.join('');
+};
+
+var Binary$_createZebraCode$ANI = Binary._createZebraCode$ANI;
+
+/**
+ * @param {!string} str
+ * @return {!string}
+ */
+Binary.base64encode$S = function (str) {
+ /** @type {Array.<undefined|!string>} */
+ var out;
+ /** @type {Array.<undefined|!number>} */
+ var source;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var code;
+ /** @type {!number} */
+ var len;
+ /** @type {!number} */
+ var c1;
+ /** @type {undefined|!number} */
+ var c2;
+ /** @type {undefined|!number} */
+ var c3;
+ out = [ ];
+ source = [ ];
+ for (i = 0; i < str.length; i++) {
+ code = str.charCodeAt(i);
+ source.push(code & 0x00ff, code >>> 8);
+ }
+ len = str.length * 2;
+ i = 0;
+ while (i < len) {
+ c1 = source[i++] & 0xff;
+ if (i === len) {
+ out.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(c1 >> 2));
+ out.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((c1 & 0x3) << 4));
+ out.push("==");
+ break;
+ }
+ c2 = source[i++];
+ if (i === len) {
+ out.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(c1 >> 2));
+ out.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((c1 & 0x3) << 4 | (c2 & 0xF0) >> 4));
+ out.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((c2 & 0xF) << 2));
+ out.push("=");
+ break;
+ }
+ c3 = source[i++];
+ out.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(c1 >> 2));
+ out.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((c1 & 0x3) << 4 | (c2 & 0xF0) >> 4));
+ out.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((c2 & 0xF) << 2 | (c3 & 0xC0) >> 6));
+ out.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(c3 & 0x3F));
+ }
+ return out.join('');
+};
+
+var Binary$base64encode$S = Binary.base64encode$S;
+
+/**
+ * @param {Array.<undefined|!number>} source
+ * @return {!string}
+ */
+Binary._mergeCharCode$AI = function (source) {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var i;
+ result = [ ];
+ for (i = 0; i < source.length; i += 2) {
+ result.push(String.fromCharCode(source[i] + (source[i + 1] << 8)));
+ }
+ return result.join('');
+};
+
+var Binary$_mergeCharCode$AI = Binary._mergeCharCode$AI;
+
+/**
+ * @param {!string} str
+ * @return {!string}
+ */
+Binary.base64decode$S = function (str) {
+ /** @type {!number} */
+ var len;
+ /** @type {!number} */
+ var i;
+ /** @type {Array.<undefined|!number>} */
+ var out;
+ /** @type {undefined|!number} */
+ var c1;
+ /** @type {undefined|!number} */
+ var c2;
+ /** @type {!number} */
+ var c3;
+ /** @type {!number} */
+ var c4;
+ len = str.length;
+ i = 0;
+ out = [ ];
+ while (i < len) {
+ do {
+ c1 = Binary._base64DecodeChars[str.charCodeAt(i++) & 0xff];
+ } while (i < len && c1 == -1);
+ if (c1 == -1) {
+ break;
+ }
+ do {
+ c2 = Binary._base64DecodeChars[str.charCodeAt(i++) & 0xff];
+ } while (i < len && c2 == -1);
+ if (c2 == -1) {
+ break;
+ }
+ out.push(c1 << 2 | (c2 & 0x30) >> 4);
+ do {
+ c3 = str.charCodeAt(i++) & 0xff;
+ if (c3 === 61) {
+ return Binary$_mergeCharCode$AI(out);
+ }
+ c3 = Binary._base64DecodeChars[c3];
+ } while (i < len && c3 === -1);
+ if (c3 === -1) {
+ break;
+ }
+ out.push((c2 & 0XF) << 4 | (c3 & 0x3C) >> 2);
+ do {
+ c4 = str.charCodeAt(i++) & 0xff;
+ if (c4 === 61) {
+ return Binary$_mergeCharCode$AI(out);
+ }
+ c4 = (Binary._base64DecodeChars[c4] | 0);
+ } while (i < len && c4 === -1);
+ if (c4 === -1) {
+ break;
+ }
+ out.push((c3 & 0x03) << 6 | c4);
+ }
+ return Binary$_mergeCharCode$AI(out);
+};
+
+var Binary$base64decode$S = Binary.base64decode$S;
+
+/**
+ * class LoadedStringResult extends Object
+ * @constructor
+ */
+function LoadedStringResult() {
+}
+
+/**
+ * @constructor
+ * @param {!string} data
+ * @param {!number} offset
+ */
+function LoadedStringResult$SI(data, offset) {
+ /** @type {!number} */
+ var strLength;
+ /** @type {Array.<undefined|!string>} */
+ var bytes;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var code;
+ /** @type {!number} */
+ var offset$0;
+ this.result = "";
+ this.offset = 0;
+ offset$0 = offset++;
+ strLength = data.charCodeAt(offset$0);
+ if (strLength > 32767) {
+ strLength = strLength - 32768;
+ bytes = [ ];
+ for (i = 0; i < strLength; i += 2) {
+ code = data.charCodeAt(offset);
+ bytes.push(String.fromCharCode(code & 0x00ff));
+ if (i !== strLength - 1) {
+ bytes.push(String.fromCharCode(code >>> 8));
+ }
+ offset++;
+ }
+ this.result = bytes.join('');
+ this.offset = offset;
+ } else {
+ this.result = data.slice(offset, offset + strLength);
+ this.offset = (offset + strLength | 0);
+ }
+};
+
+LoadedStringResult$SI.prototype = new LoadedStringResult;
+
+/**
+ * class LoadedStringListResult extends Object
+ * @constructor
+ */
+function LoadedStringListResult() {
+}
+
+/**
+ * @constructor
+ * @param {!string} data
+ * @param {!number} offset
+ */
+function LoadedStringListResult$SI(data, offset) {
+ /** @type {!number} */
+ var length;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var strLength;
+ /** @type {!string} */
+ var resultStr;
+ /** @type {Array.<undefined|!string>} */
+ var bytes;
+ /** @type {!number} */
+ var j;
+ /** @type {!number} */
+ var code;
+ /** @type {!number} */
+ var result$0;
+ /** @type {!number} */
+ var offset$0;
+ this.offset = 0;
+ this.result = [ ];
+ result$0 = data.charCodeAt(offset) * 65536 + data.charCodeAt(offset + 1);
+ length = result$0;
+ offset += 2;
+ for (i = 0; i < length; i++) {
+ offset$0 = offset++;
+ strLength = data.charCodeAt(offset$0);
+ if (strLength > 32767) {
+ strLength = strLength - 32768;
+ bytes = [ ];
+ for (j = 0; j < strLength; j += 2) {
+ code = data.charCodeAt(offset);
+ bytes.push(String.fromCharCode(code & 0x00ff));
+ if (j !== strLength - 1) {
+ bytes.push(String.fromCharCode(code >>> 8));
+ }
+ offset++;
+ }
+ resultStr = bytes.join('');
+ } else {
+ resultStr = data.slice(offset, offset + strLength);
+ offset = (offset + strLength | 0);
+ }
+ this.result.push(resultStr);
+ }
+ this.offset = offset;
+};
+
+LoadedStringListResult$SI.prototype = new LoadedStringListResult;
+
+/**
+ * class LoadedStringListMapResult extends Object
+ * @constructor
+ */
+function LoadedStringListMapResult() {
+}
+
+/**
+ * @constructor
+ * @param {!string} data
+ * @param {!number} offset
+ */
+function LoadedStringListMapResult$SI(data, offset) {
+ /** @type {!number} */
+ var length;
+ /** @type {!number} */
+ var i;
+ /** @type {LoadedStringResult} */
+ var keyResult;
+ /** @type {LoadedStringListResult} */
+ var valueResult;
+ /** @type {!number} */
+ var result$0;
+ /** @type {!number} */
+ var offset$0;
+ this.offset = 0;
+ this.result = ({ });
+ result$0 = data.charCodeAt(offset) * 65536 + data.charCodeAt(offset + 1);
+ length = result$0;
+ offset += 2;
+ for (i = 0; i < length; i++) {
+ keyResult = new LoadedStringResult$SI(data, offset);
+ offset$0 = keyResult.offset;
+ valueResult = new LoadedStringListResult$SI(data, offset$0);
+ this.result[keyResult.result] = valueResult.result;
+ offset = valueResult.offset;
+ }
+ this.offset = offset;
+};
+
+LoadedStringListMapResult$SI.prototype = new LoadedStringListMapResult;
+
+/**
+ * class LoadedNumberListResult extends Object
+ * @constructor
+ */
+function LoadedNumberListResult() {
+}
+
+/**
+ * @constructor
+ * @param {!string} data
+ * @param {!number} offset
+ */
+function LoadedNumberListResult$SI(data, offset) {
+ /** @type {!number} */
+ var resultLength;
+ /** @type {!number} */
+ var originalOffset;
+ /** @type {Array.<undefined|!number>} */
+ var result;
+ /** @type {!number} */
+ var tag;
+ /** @type {!number} */
+ var length;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var result$0;
+ /** @type {!number} */
+ var value1$0;
+ this.result = null;
+ this.offset = 0;
+ result$0 = data.charCodeAt(offset) * 65536 + data.charCodeAt(offset + 1);
+ resultLength = result$0;
+ originalOffset = offset;
+ offset += 2;
+ result = [ ];
+ while (result.length < resultLength) {
+ tag = data.charCodeAt(offset++);
+ if (tag >>> 15 === 1) {
+ value1$0 = resultLength - result.length;
+ length = (value1$0 <= 15 ? value1$0 : 15);
+ for (i = 0; i < length; i++) {
+ if (tag >>> i & 0x1) {
+ result.push(Binary$load32bitNumber$SI(data, offset));
+ offset += 2;
+ } else {
+ result.push(0);
+ }
+ }
+ } else {
+ if (tag >>> 14 === 1) {
+ length = tag - 0x4000 + 1;
+ for (i = 0; i < length; i++) {
+ result.push(Binary$load32bitNumber$SI(data, offset));
+ offset += 2;
+ }
+ } else {
+ length = tag + 1;
+ for (i = 0; i < length; i++) {
+ result.push(0);
+ }
+ }
+ }
+ }
+ this.result = result;
+ this.offset = offset;
+};
+
+LoadedNumberListResult$SI.prototype = new LoadedNumberListResult;
+
+/**
+ * class CompressionReport extends Object
+ * @constructor
+ */
+function CompressionReport() {
+}
+
+/**
+ * @constructor
+ */
+function CompressionReport$() {
+ this.source = 0;
+ this.result = 0;
+};
+
+CompressionReport$.prototype = new CompressionReport;
+
+/**
+ * @param {CompressionReport} $this
+ * @param {!number} source
+ * @param {!number} result
+ */
+CompressionReport.add$LCompressionReport$II = function ($this, source, result) {
+ $this.source += source;
+ $this.result += result;
+};
+
+var CompressionReport$add$LCompressionReport$II = CompressionReport.add$LCompressionReport$II;
+
+/**
+ * @param {CompressionReport} $this
+ * @return {!number}
+ */
+CompressionReport.rate$LCompressionReport$ = function ($this) {
+ return (Math.round($this.result * 100.0 / $this.source) | 0);
+};
+
+var CompressionReport$rate$LCompressionReport$ = CompressionReport.rate$LCompressionReport$;
+
+/**
+ * class Query extends Object
+ * @constructor
+ */
+function Query() {
+}
+
+/**
+ * @constructor
+ */
+function Query$() {
+ this.word = '';
+ this.or = false;
+ this.not = false;
+ this.raw = false;
+};
+
+Query$.prototype = new Query;
+
+/**
+ * @return {!string}
+ */
+Query.prototype.toString = function () {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ result = [ ];
+ if (this.or) {
+ result.push("OR ");
+ }
+ if (this.not) {
+ result.push("-");
+ }
+ if (this.raw) {
+ result.push('"', this.word, '"');
+ } else {
+ result.push(this.word);
+ }
+ return result.join('');
+};
+
+/**
+ * class QueryStringParser extends Object
+ * @constructor
+ */
+function QueryStringParser() {
+}
+
+/**
+ * @constructor
+ */
+function QueryStringParser$() {
+ this.queries = [ ];
+};
+
+QueryStringParser$.prototype = new QueryStringParser;
+
+/**
+ * @param {QueryStringParser} $this
+ * @param {!string} queryString
+ * @return {Array.<undefined|Query>}
+ */
+QueryStringParser.parse$LQueryStringParser$S = function ($this, queryString) {
+ /** @type {!boolean} */
+ var nextOr;
+ /** @type {!boolean} */
+ var nextNot;
+ /** @type {!number} */
+ var currentWordStart;
+ /** @type {!number} */
+ var status;
+ /** @type {RegExp} */
+ var isSpace;
+ /** @type {!number} */
+ var i;
+ /** @type {!string} */
+ var ch;
+ /** @type {!string} */
+ var word;
+ /** @type {Query} */
+ var query;
+ nextOr = false;
+ nextNot = false;
+ currentWordStart = 0;
+ status = 0;
+ isSpace = /[\s\u3000]/;
+ for (i = 0; i < queryString.length; i++) {
+ ch = queryString.charAt(i);
+ switch (status) {
+ case 0:
+ if (! isSpace.test(ch)) {
+ if (ch === '-') {
+ nextNot = true;
+ } else {
+ if (ch === '"') {
+ currentWordStart = i + 1;
+ status = 2;
+ } else {
+ currentWordStart = i;
+ status = 1;
+ }
+ }
+ } else {
+ nextNot = false;
+ }
+ break;
+ case 1:
+ if (isSpace.test(ch)) {
+ word = queryString.slice(currentWordStart, i);
+ if (word === 'OR') {
+ nextOr = true;
+ } else {
+ query = new Query$();
+ query.word = word;
+ query.or = nextOr;
+ query.not = nextNot;
+ $this.queries.push(query);
+ nextOr = false;
+ nextNot = false;
+ }
+ status = 0;
+ }
+ break;
+ case 2:
+ if (ch === '"') {
+ word = queryString.slice(currentWordStart, i);
+ query = new Query$();
+ query.word = word;
+ query.or = nextOr;
+ query.not = nextNot;
+ query.raw = true;
+ $this.queries.push(query);
+ nextOr = false;
+ nextNot = false;
+ status = 0;
+ }
+ break;
+ }
+ }
+ switch (status) {
+ case 0:
+ break;
+ case 1:
+ query = new Query$();
+ word = queryString.slice(currentWordStart, queryString.length);
+ if (word !== 'OR') {
+ query.word = word;
+ query.or = nextOr;
+ query.not = nextNot;
+ $this.queries.push(query);
+ }
+ break;
+ case 2:
+ query = new Query$();
+ query.word = queryString.slice(currentWordStart, queryString.length);
+ query.or = nextOr;
+ query.not = nextNot;
+ query.raw = true;
+ $this.queries.push(query);
+ break;
+ }
+ return $this.queries;
+};
+
+var QueryStringParser$parse$LQueryStringParser$S = QueryStringParser.parse$LQueryStringParser$S;
+
+/**
+ * @param {QueryStringParser} $this
+ * @return {!string}
+ */
+QueryStringParser.highlight$LQueryStringParser$ = function ($this) {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var i;
+ /** @type {Query} */
+ var query;
+ result = [ ];
+ for (i = 0; i < $this.queries.length; i++) {
+ query = $this.queries[i];
+ if (! query.not) {
+ result.push("highlight=" + $__jsx_encodeURIComponent(query.word));
+ }
+ }
+ return '?' + result.join('&');
+};
+
+var QueryStringParser$highlight$LQueryStringParser$ = QueryStringParser.highlight$LQueryStringParser$;
+
+/**
+ * class Proposal extends Object
+ * @constructor
+ */
+function Proposal() {
+}
+
+/**
+ * @constructor
+ * @param {!number} omit
+ * @param {!number} expect
+ */
+function Proposal$II(omit, expect) {
+ this.omit = omit;
+ this.expect = expect;
+};
+
+Proposal$II.prototype = new Proposal;
+
+/**
+ * class Position extends Object
+ * @constructor
+ */
+function Position() {
+}
+
+/**
+ * @constructor
+ * @param {!string} word
+ * @param {!number} position
+ * @param {!boolean} stemmed
+ */
+function Position$SIB(word, position, stemmed) {
+ this.word = word;
+ this.position = position;
+ this.stemmed = stemmed;
+};
+
+Position$SIB.prototype = new Position;
+
+/**
+ * class SearchUnit extends Object
+ * @constructor
+ */
+function SearchUnit() {
+}
+
+/**
+ * @constructor
+ * @param {!number} id
+ */
+function SearchUnit$I(id) {
+ this.positions = ({ });
+ this.id = id;
+ this._size = 0;
+ this.score = 0;
+ this.startPosition = -1;
+};
+
+SearchUnit$I.prototype = new SearchUnit;
+
+/**
+ * @param {SearchUnit} $this
+ * @param {!string} word
+ * @param {!number} position
+ * @param {!boolean} stemmed
+ */
+SearchUnit.addPosition$LSearchUnit$SIB = function ($this, word, position, stemmed) {
+ /** @type {Position} */
+ var positionObj;
+ positionObj = $this.positions[position + ""];
+ if (! positionObj) {
+ $this._size++;
+ $this.positions[position + ""] = ({word: word, position: position, stemmed: stemmed});
+ } else {
+ if (positionObj.word.length < word.length) {
+ positionObj.word = word;
+ }
+ positionObj.stemmed = positionObj.stemmed && stemmed;
+ }
+};
+
+var SearchUnit$addPosition$LSearchUnit$SIB = SearchUnit.addPosition$LSearchUnit$SIB;
+
+/**
+ * @param {SearchUnit} $this
+ * @param {!number} position
+ * @return {Position}
+ */
+SearchUnit.get$LSearchUnit$I = function ($this, position) {
+ return $this.positions[position + ""];
+};
+
+var SearchUnit$get$LSearchUnit$I = SearchUnit.get$LSearchUnit$I;
+
+/**
+ * @param {SearchUnit} $this
+ * @return {!number}
+ */
+SearchUnit.size$LSearchUnit$ = function ($this) {
+ return $this._size;
+};
+
+var SearchUnit$size$LSearchUnit$ = SearchUnit.size$LSearchUnit$;
+
+/**
+ * @param {SearchUnit} $this
+ * @param {SearchUnit} rhs
+ */
+SearchUnit.merge$LSearchUnit$LSearchUnit$ = function ($this, rhs) {
+ /** @type {!string} */
+ var position;
+ /** @type {Position} */
+ var pos;
+ for (position in rhs.positions) {
+ pos = rhs.positions[position];
+ SearchUnit$addPosition$LSearchUnit$SIB($this, pos.word, pos.position, pos.stemmed);
+ }
+};
+
+var SearchUnit$merge$LSearchUnit$LSearchUnit$ = SearchUnit.merge$LSearchUnit$LSearchUnit$;
+
+/**
+ * @param {SearchUnit} $this
+ * @return {Array.<undefined|Position>}
+ */
+SearchUnit.getPositions$LSearchUnit$ = function ($this) {
+ /** @type {Array.<undefined|Position>} */
+ var result;
+ /** @type {!string} */
+ var pos;
+ result = [ ];
+ for (pos in $this.positions) {
+ result.push($this.positions[pos]);
+ }
+ result.sort((function (a, b) {
+ return a.position - b.position;
+ }));
+ return result;
+};
+
+var SearchUnit$getPositions$LSearchUnit$ = SearchUnit.getPositions$LSearchUnit$;
+
+/**
+ * class SingleResult extends Object
+ * @constructor
+ */
+function SingleResult() {
+}
+
+/**
+ * @constructor
+ */
+function SingleResult$() {
+ this.units = [ ];
+ this.unitIds = [ ];
+ this.or = false;
+ this.not = false;
+ this.searchWord = '';
+};
+
+SingleResult$.prototype = new SingleResult;
+
+/**
+ * @constructor
+ * @param {!string} searchWord
+ * @param {!boolean} or
+ * @param {!boolean} not
+ */
+function SingleResult$SBB(searchWord, or, not) {
+ this.units = [ ];
+ this.unitIds = [ ];
+ this.or = or;
+ this.not = not;
+ this.searchWord = searchWord;
+};
+
+SingleResult$SBB.prototype = new SingleResult;
+
+/**
+ * @param {SingleResult} $this
+ * @param {!number} unitId
+ * @return {SearchUnit}
+ */
+SingleResult.getSearchUnit$LSingleResult$I = function ($this, unitId) {
+ /** @type {!number} */
+ var existing;
+ /** @type {SearchUnit} */
+ var result;
+ existing = $this.unitIds.indexOf(unitId);
+ if (existing === -1) {
+ result = ({positions: ({ }), id: unitId, _size: 0, score: 0, startPosition: -1});
+ $this.units.push(result);
+ $this.unitIds.push(unitId);
+ } else {
+ result = $this.units[existing];
+ }
+ return result;
+};
+
+var SingleResult$getSearchUnit$LSingleResult$I = SingleResult.getSearchUnit$LSingleResult$I;
+
+/**
+ * @param {SingleResult} $this
+ * @param {SingleResult} rhs
+ * @return {SingleResult}
+ */
+SingleResult.merge$LSingleResult$LSingleResult$ = function ($this, rhs) {
+ /** @type {SingleResult} */
+ var result;
+ result = ({units: [ ], unitIds: [ ], or: false, not: false, searchWord: ''});
+ if (rhs.or) {
+ SingleResult$_orMerge$LSingleResult$LSingleResult$LSingleResult$($this, result, rhs);
+ } else {
+ if (rhs.not) {
+ SingleResult$_notMerge$LSingleResult$LSingleResult$LSingleResult$($this, result, rhs);
+ } else {
+ SingleResult$_andMerge$LSingleResult$LSingleResult$LSingleResult$($this, result, rhs);
+ }
+ }
+ return result;
+};
+
+var SingleResult$merge$LSingleResult$LSingleResult$ = SingleResult.merge$LSingleResult$LSingleResult$;
+
+/**
+ * @param {SingleResult} $this
+ * @return {!number}
+ */
+SingleResult.size$LSingleResult$ = function ($this) {
+ return ($this.units.length | 0);
+};
+
+var SingleResult$size$LSingleResult$ = SingleResult.size$LSingleResult$;
+
+/**
+ * @param {SingleResult} $this
+ * @param {SingleResult} result
+ * @param {SingleResult} rhs
+ */
+SingleResult._andMerge$LSingleResult$LSingleResult$LSingleResult$ = function ($this, result, rhs) {
+ /** @type {!number} */
+ var i;
+ /** @type {undefined|!number} */
+ var id;
+ /** @type {SearchUnit} */
+ var lhsSection;
+ for (i = 0; i < $this.unitIds.length; i++) {
+ id = $this.unitIds[i];
+ if (rhs.unitIds.indexOf(id) !== -1) {
+ lhsSection = $this.units[i];
+ result.unitIds.push(id);
+ result.units.push(lhsSection);
+ }
+ }
+};
+
+var SingleResult$_andMerge$LSingleResult$LSingleResult$LSingleResult$ = SingleResult._andMerge$LSingleResult$LSingleResult$LSingleResult$;
+
+/**
+ * @param {SingleResult} $this
+ * @param {SingleResult} result
+ * @param {SingleResult} rhs
+ */
+SingleResult._orMerge$LSingleResult$LSingleResult$LSingleResult$ = function ($this, result, rhs) {
+ /** @type {!number} */
+ var i;
+ /** @type {undefined|!number} */
+ var id;
+ /** @type {SearchUnit} */
+ var rhsSection;
+ /** @type {SearchUnit} */
+ var lhsSection;
+ /** @type {Array.<undefined|!number>} */
+ var unitIds$0;
+ /** @type {Array.<undefined|SearchUnit>} */
+ var units$0;
+ result.unitIds = (unitIds$0 = $this.unitIds).slice(0, unitIds$0.length);
+ result.units = (units$0 = $this.units).slice(0, units$0.length);
+ for (i = 0; i < rhs.unitIds.length; i++) {
+ id = rhs.unitIds[i];
+ rhsSection = rhs.units[i];
+ if (result.unitIds.indexOf(id) !== -1) {
+ lhsSection = result.units[result.unitIds.indexOf(id)];
+ SearchUnit$merge$LSearchUnit$LSearchUnit$(lhsSection, rhsSection);
+ } else {
+ result.unitIds.push(id);
+ result.units.push(rhsSection);
+ }
+ }
+};
+
+var SingleResult$_orMerge$LSingleResult$LSingleResult$LSingleResult$ = SingleResult._orMerge$LSingleResult$LSingleResult$LSingleResult$;
+
+/**
+ * @param {SingleResult} $this
+ * @param {SingleResult} result
+ * @param {SingleResult} rhs
+ */
+SingleResult._notMerge$LSingleResult$LSingleResult$LSingleResult$ = function ($this, result, rhs) {
+ /** @type {!number} */
+ var i;
+ /** @type {undefined|!number} */
+ var id;
+ /** @type {SearchUnit} */
+ var lhsSection;
+ for (i = 0; i < $this.unitIds.length; i++) {
+ id = $this.unitIds[i];
+ if (rhs.unitIds.indexOf(id) === -1) {
+ lhsSection = $this.units[i];
+ result.unitIds.push(id);
+ result.units.push(lhsSection);
+ }
+ }
+};
+
+var SingleResult$_notMerge$LSingleResult$LSingleResult$LSingleResult$ = SingleResult._notMerge$LSingleResult$LSingleResult$LSingleResult$;
+
+/**
+ * class SearchSummary extends Object
+ * @constructor
+ */
+function SearchSummary() {
+}
+
+/**
+ * @constructor
+ */
+function SearchSummary$() {
+ this.sourceResults = [ ];
+ this.result = null;
+ this.oktavia = null;
+};
+
+SearchSummary$.prototype = new SearchSummary;
+
+/**
+ * @constructor
+ * @param {Oktavia} oktavia
+ */
+function SearchSummary$LOktavia$(oktavia) {
+ this.sourceResults = [ ];
+ this.result = null;
+ this.oktavia = oktavia;
+};
+
+SearchSummary$LOktavia$.prototype = new SearchSummary;
+
+/**
+ * @param {SearchSummary} $this
+ * @param {SingleResult} result
+ */
+SearchSummary.addQuery$LSearchSummary$LSingleResult$ = function ($this, result) {
+ $this.sourceResults.push(result);
+};
+
+var SearchSummary$addQuery$LSearchSummary$LSingleResult$ = SearchSummary.addQuery$LSearchSummary$LSingleResult$;
+
+/**
+ * @param {SearchSummary} $this
+ */
+SearchSummary.mergeResult$LSearchSummary$ = function ($this) {
+ $this.result = SearchSummary$mergeResult$LSearchSummary$ALSingleResult$($this, $this.sourceResults);
+};
+
+var SearchSummary$mergeResult$LSearchSummary$ = SearchSummary.mergeResult$LSearchSummary$;
+
+/**
+ * @param {SearchSummary} $this
+ * @param {Array.<undefined|SingleResult>} results
+ * @return {SingleResult}
+ */
+SearchSummary.mergeResult$LSearchSummary$ALSingleResult$ = function ($this, results) {
+ /** @type {SingleResult} */
+ var rhs;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var results$len$0;
+ rhs = results[0];
+ for ((i = 1, results$len$0 = results.length); i < results$len$0; i++) {
+ rhs = SingleResult$merge$LSingleResult$LSingleResult$(rhs, results[i]);
+ }
+ return rhs;
+};
+
+var SearchSummary$mergeResult$LSearchSummary$ALSingleResult$ = SearchSummary.mergeResult$LSearchSummary$ALSingleResult$;
+
+/**
+ * @param {SearchSummary} $this
+ * @return {Array.<undefined|Proposal>}
+ */
+SearchSummary.getProposal$LSearchSummary$ = function ($this) {
+ /** @type {Array.<undefined|Proposal>} */
+ var proposals;
+ /** @type {!number} */
+ var i;
+ /** @type {Array.<undefined|SingleResult>} */
+ var tmpSource;
+ /** @type {!number} */
+ var j;
+ /** @type {SingleResult} */
+ var result;
+ proposals = [ ];
+ for (i = 0; i < $this.sourceResults.length; i++) {
+ tmpSource = [ ];
+ for (j = 0; j < $this.sourceResults.length; j++) {
+ if (i !== j) {
+ tmpSource.push($this.sourceResults[j]);
+ }
+ }
+ result = SearchSummary$mergeResult$LSearchSummary$ALSingleResult$($this, tmpSource);
+ proposals.push(({omit: i, expect: result.units.length}));
+ }
+ proposals.sort((function (a, b) {
+ return b.expect - a.expect;
+ }));
+ return proposals;
+};
+
+var SearchSummary$getProposal$LSearchSummary$ = SearchSummary.getProposal$LSearchSummary$;
+
+/**
+ * @param {SearchSummary} $this
+ * @return {Array.<undefined|SearchUnit>}
+ */
+SearchSummary.getSortedResult$LSearchSummary$ = function ($this) {
+ /** @type {Array.<undefined|SearchUnit>} */
+ var result;
+ /** @type {Array.<undefined|SearchUnit>} */
+ var units$0;
+ result = (units$0 = $this.result.units).slice(0, units$0.length);
+ result.sort((function (a, b) {
+ return b.score - a.score;
+ }));
+ return result;
+};
+
+var SearchSummary$getSortedResult$LSearchSummary$ = SearchSummary.getSortedResult$LSearchSummary$;
+
+/**
+ * @param {SearchSummary} $this
+ * @return {!number}
+ */
+SearchSummary.size$LSearchSummary$ = function ($this) {
+ /** @type {SingleResult} */
+ var this$0;
+ this$0 = $this.result;
+ return (this$0.units.length | 0);
+};
+
+var SearchSummary$size$LSearchSummary$ = SearchSummary.size$LSearchSummary$;
+
+/**
+ * @param {SearchSummary} $this
+ * @param {SingleResult} result
+ */
+SearchSummary.add$LSearchSummary$LSingleResult$ = function ($this, result) {
+ $this.sourceResults.push(result);
+};
+
+var SearchSummary$add$LSearchSummary$LSingleResult$ = SearchSummary.add$LSearchSummary$LSingleResult$;
+
+/**
+ * class Style extends Object
+ * @constructor
+ */
+function Style() {
+}
+
+/**
+ * @constructor
+ * @param {!string} mode
+ */
+function Style$S(mode) {
+ this.styles = null;
+ this.escapeHTML = false;
+ switch (mode) {
+ case 'console':
+ this.styles = Style.console;
+ break;
+ case 'html':
+ this.styles = Style.html;
+ break;
+ case 'ignore':
+ this.styles = Style.ignore;
+ break;
+ default:
+ this.styles = Style.ignore;
+ break;
+ }
+ this.escapeHTML = mode === 'html';
+};
+
+Style$S.prototype = new Style;
+
+/**
+ * @param {!string} source
+ * @return {!string}
+ */
+Style.prototype.convert$S = function (source) {
+ /** @type {_HTMLHandler} */
+ var handler;
+ /** @type {SAXParser} */
+ var parser;
+ handler = new _HTMLHandler$HASB(this.styles, this.escapeHTML);
+ parser = new SAXParser$LSAXHandler$(handler);
+ parser.parse$S(source);
+ return handler.text.join('');
+};
+
+/**
+ * class Stemmer
+ * @constructor
+ */
+function Stemmer() {
+}
+
+Stemmer.prototype.$__jsx_implements_Stemmer = true;
+
+/**
+ * @constructor
+ */
+function Stemmer$() {
+};
+
+Stemmer$.prototype = new Stemmer;
+
+/**
+ * class BaseStemmer extends Object
+ * @constructor
+ */
+function BaseStemmer() {
+}
+
+$__jsx_merge_interface(BaseStemmer, Stemmer);
+
+/**
+ * @constructor
+ */
+function BaseStemmer$() {
+ /** @type {!string} */
+ var current$0;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var limit$0;
+ this.cache = ({ });
+ current$0 = this.current = "";
+ cursor$0 = this.cursor = 0;
+ limit$0 = this.limit = current$0.length;
+ this.limit_backward = 0;
+ this.bra = cursor$0;
+ this.ket = limit$0;
+};
+
+BaseStemmer$.prototype = new BaseStemmer;
+
+/**
+ * @param {!string} value
+ */
+BaseStemmer.prototype.setCurrent$S = function (value) {
+ /** @type {!string} */
+ var current$0;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var limit$0;
+ current$0 = this.current = value;
+ cursor$0 = this.cursor = 0;
+ limit$0 = this.limit = current$0.length;
+ this.limit_backward = 0;
+ this.bra = cursor$0;
+ this.ket = limit$0;
+};
+
+/**
+ * @return {!string}
+ */
+BaseStemmer.prototype.getCurrent$ = function () {
+ return this.current;
+};
+
+/**
+ * @param {BaseStemmer} other
+ */
+BaseStemmer.prototype.copy_from$LBaseStemmer$ = function (other) {
+ this.current = other.current;
+ this.cursor = other.cursor;
+ this.limit = other.limit;
+ this.limit_backward = other.limit_backward;
+ this.bra = other.bra;
+ this.ket = other.ket;
+};
+
+/**
+ * @param {Array.<undefined|!number>} s
+ * @param {!number} min
+ * @param {!number} max
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.in_grouping$AIII = function (s, min, max) {
+ /** @type {!number} */
+ var ch;
+ if (this.cursor >= this.limit) {
+ return false;
+ }
+ ch = this.current.charCodeAt(this.cursor);
+ if (ch > max || ch < min) {
+ return false;
+ }
+ ch -= min;
+ if ((s[ch >>> 3] & 0x1 << (ch & 0x7)) === 0) {
+ return false;
+ }
+ this.cursor++;
+ return true;
+};
+
+/**
+ * @param {Array.<undefined|!number>} s
+ * @param {!number} min
+ * @param {!number} max
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.in_grouping_b$AIII = function (s, min, max) {
+ /** @type {!number} */
+ var ch;
+ if (this.cursor <= this.limit_backward) {
+ return false;
+ }
+ ch = this.current.charCodeAt(this.cursor - 1);
+ if (ch > max || ch < min) {
+ return false;
+ }
+ ch -= min;
+ if ((s[ch >>> 3] & 0x1 << (ch & 0x7)) === 0) {
+ return false;
+ }
+ this.cursor--;
+ return true;
+};
+
+/**
+ * @param {Array.<undefined|!number>} s
+ * @param {!number} min
+ * @param {!number} max
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.out_grouping$AIII = function (s, min, max) {
+ /** @type {!number} */
+ var ch;
+ if (this.cursor >= this.limit) {
+ return false;
+ }
+ ch = this.current.charCodeAt(this.cursor);
+ if (ch > max || ch < min) {
+ this.cursor++;
+ return true;
+ }
+ ch -= min;
+ if ((s[ch >>> 3] & 0X1 << (ch & 0x7)) === 0) {
+ this.cursor++;
+ return true;
+ }
+ return false;
+};
+
+/**
+ * @param {Array.<undefined|!number>} s
+ * @param {!number} min
+ * @param {!number} max
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.out_grouping_b$AIII = function (s, min, max) {
+ /** @type {!number} */
+ var ch;
+ if (this.cursor <= this.limit_backward) {
+ return false;
+ }
+ ch = this.current.charCodeAt(this.cursor - 1);
+ if (ch > max || ch < min) {
+ this.cursor--;
+ return true;
+ }
+ ch -= min;
+ if ((s[ch >>> 3] & 0x1 << (ch & 0x7)) === 0) {
+ this.cursor--;
+ return true;
+ }
+ return false;
+};
+
+/**
+ * @param {!number} min
+ * @param {!number} max
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.in_range$II = function (min, max) {
+ /** @type {!number} */
+ var ch;
+ if (this.cursor >= this.limit) {
+ return false;
+ }
+ ch = this.current.charCodeAt(this.cursor);
+ if (ch > max || ch < min) {
+ return false;
+ }
+ this.cursor++;
+ return true;
+};
+
+/**
+ * @param {!number} min
+ * @param {!number} max
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.in_range_b$II = function (min, max) {
+ /** @type {!number} */
+ var ch;
+ if (this.cursor <= this.limit_backward) {
+ return false;
+ }
+ ch = this.current.charCodeAt(this.cursor - 1);
+ if (ch > max || ch < min) {
+ return false;
+ }
+ this.cursor--;
+ return true;
+};
+
+/**
+ * @param {!number} min
+ * @param {!number} max
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.out_range$II = function (min, max) {
+ /** @type {!number} */
+ var ch;
+ if (this.cursor >= this.limit) {
+ return false;
+ }
+ ch = this.current.charCodeAt(this.cursor);
+ if (! (ch > max || ch < min)) {
+ return false;
+ }
+ this.cursor++;
+ return true;
+};
+
+/**
+ * @param {!number} min
+ * @param {!number} max
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.out_range_b$II = function (min, max) {
+ /** @type {!number} */
+ var ch;
+ if (this.cursor <= this.limit_backward) {
+ return false;
+ }
+ ch = this.current.charCodeAt(this.cursor - 1);
+ if (! (ch > max || ch < min)) {
+ return false;
+ }
+ this.cursor--;
+ return true;
+};
+
+/**
+ * @param {!number} s_size
+ * @param {!string} s
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.eq_s$IS = function (s_size, s) {
+ /** @type {!number} */
+ var cursor$0;
+ if (this.limit - this.cursor < s_size) {
+ return false;
+ }
+ if (this.current.slice(cursor$0 = this.cursor, cursor$0 + s_size) !== s) {
+ return false;
+ }
+ this.cursor += s_size;
+ return true;
+};
+
+/**
+ * @param {!number} s_size
+ * @param {!string} s
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.eq_s_b$IS = function (s_size, s) {
+ /** @type {!number} */
+ var cursor$0;
+ if (this.cursor - this.limit_backward < s_size) {
+ return false;
+ }
+ if (this.current.slice((cursor$0 = this.cursor) - s_size, cursor$0) !== s) {
+ return false;
+ }
+ this.cursor -= s_size;
+ return true;
+};
+
+/**
+ * @param {!string} s
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.eq_v$S = function (s) {
+ return this.eq_s$IS(s.length, s);
+};
+
+/**
+ * @param {!string} s
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.eq_v_b$S = function (s) {
+ return this.eq_s_b$IS(s.length, s);
+};
+
+/**
+ * @param {Array.<undefined|Among>} v
+ * @param {!number} v_size
+ * @return {!number}
+ */
+BaseStemmer.prototype.find_among$ALAmong$I = function (v, v_size) {
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var j;
+ /** @type {!number} */
+ var c;
+ /** @type {!number} */
+ var l;
+ /** @type {!number} */
+ var common_i;
+ /** @type {!number} */
+ var common_j;
+ /** @type {!boolean} */
+ var first_key_inspected;
+ /** @type {!number} */
+ var k;
+ /** @type {!number} */
+ var diff;
+ /** @type {!number} */
+ var common;
+ /** @type {Among} */
+ var w;
+ /** @type {!number} */
+ var i2;
+ /** @type {!boolean} */
+ var res;
+ i = 0;
+ j = v_size;
+ c = this.cursor;
+ l = this.limit;
+ common_i = 0;
+ common_j = 0;
+ first_key_inspected = false;
+ while (true) {
+ k = i + (j - i >>> 1);
+ diff = 0;
+ common = (common_i < common_j ? common_i : common_j);
+ w = v[k];
+ for (i2 = common; i2 < w.s_size; i2++) {
+ if (c + common === l) {
+ diff = -1;
+ break;
+ }
+ diff = this.current.charCodeAt(c + common) - w.s.charCodeAt(i2);
+ if (diff !== 0) {
+ break;
+ }
+ common++;
+ }
+ if (diff < 0) {
+ j = k;
+ common_j = common;
+ } else {
+ i = k;
+ common_i = common;
+ }
+ if (j - i <= 1) {
+ if (i > 0) {
+ break;
+ }
+ if (j === i) {
+ break;
+ }
+ if (first_key_inspected) {
+ break;
+ }
+ first_key_inspected = true;
+ }
+ }
+ while (true) {
+ w = v[i];
+ if (common_i >= w.s_size) {
+ this.cursor = (c + w.s_size | 0);
+ if (w.method == null) {
+ return w.result;
+ }
+ res = w.method(w.instance);
+ this.cursor = (c + w.s_size | 0);
+ if (res) {
+ return w.result;
+ }
+ }
+ i = w.substring_i;
+ if (i < 0) {
+ return 0;
+ }
+ }
+ return -1;
+};
+
+/**
+ * @param {Array.<undefined|Among>} v
+ * @param {!number} v_size
+ * @return {!number}
+ */
+BaseStemmer.prototype.find_among_b$ALAmong$I = function (v, v_size) {
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var j;
+ /** @type {!number} */
+ var c;
+ /** @type {!number} */
+ var lb;
+ /** @type {!number} */
+ var common_i;
+ /** @type {!number} */
+ var common_j;
+ /** @type {!boolean} */
+ var first_key_inspected;
+ /** @type {!number} */
+ var k;
+ /** @type {!number} */
+ var diff;
+ /** @type {!number} */
+ var common;
+ /** @type {Among} */
+ var w;
+ /** @type {!number} */
+ var i2;
+ /** @type {!boolean} */
+ var res;
+ i = 0;
+ j = v_size;
+ c = this.cursor;
+ lb = this.limit_backward;
+ common_i = 0;
+ common_j = 0;
+ first_key_inspected = false;
+ while (true) {
+ k = i + (j - i >> 1);
+ diff = 0;
+ common = (common_i < common_j ? common_i : common_j);
+ w = v[k];
+ for (i2 = w.s_size - 1 - common; i2 >= 0; i2--) {
+ if (c - common === lb) {
+ diff = -1;
+ break;
+ }
+ diff = this.current.charCodeAt(c - 1 - common) - w.s.charCodeAt(i2);
+ if (diff !== 0) {
+ break;
+ }
+ common++;
+ }
+ if (diff < 0) {
+ j = k;
+ common_j = common;
+ } else {
+ i = k;
+ common_i = common;
+ }
+ if (j - i <= 1) {
+ if (i > 0) {
+ break;
+ }
+ if (j === i) {
+ break;
+ }
+ if (first_key_inspected) {
+ break;
+ }
+ first_key_inspected = true;
+ }
+ }
+ while (true) {
+ w = v[i];
+ if (common_i >= w.s_size) {
+ this.cursor = (c - w.s_size | 0);
+ if (w.method == null) {
+ return w.result;
+ }
+ res = w.method(this);
+ this.cursor = (c - w.s_size | 0);
+ if (res) {
+ return w.result;
+ }
+ }
+ i = w.substring_i;
+ if (i < 0) {
+ return 0;
+ }
+ }
+ return -1;
+};
+
+/**
+ * @param {!number} c_bra
+ * @param {!number} c_ket
+ * @param {!string} s
+ * @return {!number}
+ */
+BaseStemmer.prototype.replace_s$IIS = function (c_bra, c_ket, s) {
+ /** @type {!number} */
+ var adjustment;
+ adjustment = s.length - (c_ket - c_bra);
+ this.current = this.current.slice(0, c_bra) + s + this.current.slice(c_ket);
+ this.limit += (adjustment | 0);
+ if (this.cursor >= c_ket) {
+ this.cursor += (adjustment | 0);
+ } else {
+ if (this.cursor > c_bra) {
+ this.cursor = c_bra;
+ }
+ }
+ return (adjustment | 0);
+};
+
+/**
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.slice_check$ = function () {
+ /** @type {!number} */
+ var bra$0;
+ /** @type {!number} */
+ var ket$0;
+ /** @type {!number} */
+ var limit$0;
+ return ((bra$0 = this.bra) < 0 || bra$0 > (ket$0 = this.ket) || ket$0 > (limit$0 = this.limit) || limit$0 > this.current.length ? false : true);
+};
+
+/**
+ * @param {!string} s
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.slice_from$S = function (s) {
+ /** @type {!boolean} */
+ var result;
+ /** @type {!number} */
+ var bra$0;
+ /** @type {!number} */
+ var ket$0;
+ /** @type {!number} */
+ var limit$0;
+ result = false;
+ if ((bra$0 = this.bra) < 0 || bra$0 > (ket$0 = this.ket) || ket$0 > (limit$0 = this.limit) || limit$0 > this.current.length ? false : true) {
+ this.replace_s$IIS(this.bra, this.ket, s);
+ result = true;
+ }
+ return result;
+};
+
+/**
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.slice_del$ = function () {
+ return this.slice_from$S("");
+};
+
+/**
+ * @param {!number} c_bra
+ * @param {!number} c_ket
+ * @param {!string} s
+ */
+BaseStemmer.prototype.insert$IIS = function (c_bra, c_ket, s) {
+ /** @type {!number} */
+ var adjustment;
+ adjustment = this.replace_s$IIS(c_bra, c_ket, s);
+ if (c_bra <= this.bra) {
+ this.bra += (adjustment | 0);
+ }
+ if (c_bra <= this.ket) {
+ this.ket += (adjustment | 0);
+ }
+};
+
+/**
+ * @param {!string} s
+ * @return {!string}
+ */
+BaseStemmer.prototype.slice_to$S = function (s) {
+ /** @type {!string} */
+ var result;
+ /** @type {!number} */
+ var bra$0;
+ /** @type {!number} */
+ var ket$0;
+ /** @type {!number} */
+ var limit$0;
+ result = '';
+ if ((bra$0 = this.bra) < 0 || bra$0 > (ket$0 = this.ket) || ket$0 > (limit$0 = this.limit) || limit$0 > this.current.length ? false : true) {
+ result = this.current.slice(this.bra, this.ket);
+ }
+ return result;
+};
+
+/**
+ * @param {!string} s
+ * @return {!string}
+ */
+BaseStemmer.prototype.assign_to$S = function (s) {
+ return this.current.slice(0, this.limit);
+};
+
+/**
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.stem$ = function () {
+ return false;
+};
+
+/**
+ * @param {!string} word
+ * @return {!string}
+ */
+BaseStemmer.prototype.stemWord$S = function (word) {
+ /** @type {undefined|!string} */
+ var result;
+ /** @type {!string} */
+ var current$0;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var limit$0;
+ result = this.cache['.' + word];
+ if (result == null) {
+ current$0 = this.current = word;
+ cursor$0 = this.cursor = 0;
+ limit$0 = this.limit = current$0.length;
+ this.limit_backward = 0;
+ this.bra = cursor$0;
+ this.ket = limit$0;
+ this.stem$();
+ result = this.current;
+ this.cache['.' + word] = result;
+ }
+ return result;
+};
+
+/**
+ * @param {Array.<undefined|!string>} words
+ * @return {Array.<undefined|!string>}
+ */
+BaseStemmer.prototype.stemWords$AS = function (words) {
+ /** @type {Array.<undefined|!string>} */
+ var results;
+ /** @type {!number} */
+ var i;
+ /** @type {undefined|!string} */
+ var word;
+ /** @type {undefined|!string} */
+ var result;
+ /** @type {!string} */
+ var current$0;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var limit$0;
+ results = [ ];
+ for (i = 0; i < words.length; i++) {
+ word = words[i];
+ result = this.cache['.' + word];
+ if (result == null) {
+ current$0 = this.current = word;
+ cursor$0 = this.cursor = 0;
+ limit$0 = this.limit = current$0.length;
+ this.limit_backward = 0;
+ this.bra = cursor$0;
+ this.ket = limit$0;
+ this.stem$();
+ result = this.current;
+ this.cache['.' + word] = result;
+ }
+ results.push(result);
+ }
+ return results;
+};
+
+/**
+ * class DanishStemmer extends BaseStemmer
+ * @constructor
+ */
+function DanishStemmer() {
+}
+
+DanishStemmer.prototype = new BaseStemmer;
+/**
+ * @constructor
+ */
+function DanishStemmer$() {
+ BaseStemmer$.call(this);
+ this.I_x = 0;
+ this.I_p1 = 0;
+ this.S_ch = "";
+};
+
+DanishStemmer$.prototype = new DanishStemmer;
+
+/**
+ * @param {DanishStemmer} other
+ */
+DanishStemmer.prototype.copy_from$LDanishStemmer$ = function (other) {
+ this.I_x = other.I_x;
+ this.I_p1 = other.I_p1;
+ this.S_ch = other.S_ch;
+ BaseStemmer.prototype.copy_from$LBaseStemmer$.call(this, other);
+};
+
+/**
+ * @return {!boolean}
+ */
+DanishStemmer.prototype.r_mark_regions$ = function () {
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var c;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!boolean} */
+ var lab3;
+ /** @type {!boolean} */
+ var lab4;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var limit$0;
+ /** @type {!number} */
+ var cursor$1;
+ /** @type {!number} */
+ var cursor$2;
+ this.I_p1 = limit$0 = this.limit;
+ v_1 = cursor$0 = this.cursor;
+ c = (cursor$0 + 3 | 0);
+ if (0 > c || c > limit$0) {
+ return false;
+ }
+ cursor$2 = this.cursor = c;
+ this.I_x = cursor$2;
+ this.cursor = v_1;
+golab0:
+ while (true) {
+ v_2 = this.cursor;
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ if (! this.in_grouping$AIII(DanishStemmer.g_v, 97, 248)) {
+ break lab1;
+ }
+ this.cursor = v_2;
+ break golab0;
+ }
+ cursor$1 = this.cursor = v_2;
+ if (cursor$1 >= this.limit) {
+ return false;
+ }
+ this.cursor++;
+ }
+golab2:
+ while (true) {
+ lab3 = true;
+ lab3:
+ while (lab3 === true) {
+ lab3 = false;
+ if (! this.out_grouping$AIII(DanishStemmer.g_v, 97, 248)) {
+ break lab3;
+ }
+ break golab2;
+ }
+ if (this.cursor >= this.limit) {
+ return false;
+ }
+ this.cursor++;
+ }
+ this.I_p1 = this.cursor;
+ lab4 = true;
+lab4:
+ while (lab4 === true) {
+ lab4 = false;
+ if (! (this.I_p1 < this.I_x)) {
+ break lab4;
+ }
+ this.I_p1 = this.I_x;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+DanishStemmer.prototype.r_main_suffix$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var cursor$1;
+ /** @type {!number} */
+ var cursor$2;
+ v_1 = this.limit - (cursor$0 = this.cursor);
+ if (cursor$0 < this.I_p1) {
+ return false;
+ }
+ cursor$1 = this.cursor = this.I_p1;
+ v_2 = this.limit_backward;
+ this.limit_backward = cursor$1;
+ cursor$2 = this.cursor = this.limit - v_1;
+ this.ket = cursor$2;
+ among_var = this.find_among_b$ALAmong$I(DanishStemmer.a_0, 32);
+ if (among_var === 0) {
+ this.limit_backward = v_2;
+ return false;
+ }
+ this.bra = this.cursor;
+ this.limit_backward = v_2;
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 2:
+ if (! this.in_grouping_b$AIII(DanishStemmer.g_s_ending, 97, 229)) {
+ return false;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+DanishStemmer.prototype.r_consonant_pair$ = function () {
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var v_3;
+ /** @type {!number} */
+ var limit$0;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var cursor$1;
+ /** @type {!number} */
+ var cursor$2;
+ /** @type {!number} */
+ var cursor$3;
+ /** @type {!number} */
+ var limit_backward$0;
+ v_1 = (limit$0 = this.limit) - (cursor$0 = this.cursor);
+ v_2 = limit$0 - cursor$0;
+ if (cursor$0 < this.I_p1) {
+ return false;
+ }
+ cursor$1 = this.cursor = this.I_p1;
+ v_3 = this.limit_backward;
+ this.limit_backward = cursor$1;
+ cursor$2 = this.cursor = this.limit - v_2;
+ this.ket = cursor$2;
+ if (this.find_among_b$ALAmong$I(DanishStemmer.a_1, 4) === 0) {
+ this.limit_backward = v_3;
+ return false;
+ }
+ this.bra = this.cursor;
+ limit_backward$0 = this.limit_backward = v_3;
+ cursor$3 = this.cursor = this.limit - v_1;
+ if (cursor$3 <= limit_backward$0) {
+ return false;
+ }
+ this.cursor--;
+ this.bra = this.cursor;
+ return (! this.slice_from$S("") ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+DanishStemmer.prototype.r_other_suffix$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var v_3;
+ /** @type {!number} */
+ var v_4;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!number} */
+ var limit$0;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var cursor$1;
+ /** @type {!number} */
+ var cursor$2;
+ v_1 = this.limit - this.cursor;
+ lab0 = true;
+lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ this.ket = this.cursor;
+ if (! this.eq_s_b$IS(2, "st")) {
+ break lab0;
+ }
+ this.bra = this.cursor;
+ if (! this.eq_s_b$IS(2, "ig")) {
+ break lab0;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ }
+ cursor$0 = this.cursor = (limit$0 = this.limit) - v_1;
+ v_2 = limit$0 - cursor$0;
+ if (cursor$0 < this.I_p1) {
+ return false;
+ }
+ cursor$1 = this.cursor = this.I_p1;
+ v_3 = this.limit_backward;
+ this.limit_backward = cursor$1;
+ cursor$2 = this.cursor = this.limit - v_2;
+ this.ket = cursor$2;
+ among_var = this.find_among_b$ALAmong$I(DanishStemmer.a_2, 5);
+ if (among_var === 0) {
+ this.limit_backward = v_3;
+ return false;
+ }
+ this.bra = this.cursor;
+ this.limit_backward = v_3;
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ v_4 = this.limit - this.cursor;
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ if (! this.r_consonant_pair$()) {
+ break lab1;
+ }
+ }
+ this.cursor = this.limit - v_4;
+ break;
+ case 2:
+ if (! this.slice_from$S("l\u00F8s")) {
+ return false;
+ }
+ break;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+DanishStemmer.prototype.r_undouble$ = function () {
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var cursor$1;
+ /** @type {!number} */
+ var cursor$2;
+ /** @type {!string} */
+ var S_ch$0;
+ v_1 = this.limit - (cursor$0 = this.cursor);
+ if (cursor$0 < this.I_p1) {
+ return false;
+ }
+ cursor$1 = this.cursor = this.I_p1;
+ v_2 = this.limit_backward;
+ this.limit_backward = cursor$1;
+ cursor$2 = this.cursor = this.limit - v_1;
+ this.ket = cursor$2;
+ if (! this.out_grouping_b$AIII(DanishStemmer.g_v, 97, 248)) {
+ this.limit_backward = v_2;
+ return false;
+ }
+ this.bra = this.cursor;
+ S_ch$0 = this.S_ch = this.slice_to$S(this.S_ch);
+ if (S_ch$0 === '') {
+ return false;
+ }
+ this.limit_backward = v_2;
+ return (! this.eq_v_b$S(this.S_ch) ? false : ! this.slice_from$S("") ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+DanishStemmer.prototype.stem$ = function () {
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var v_3;
+ /** @type {!number} */
+ var v_4;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!boolean} */
+ var lab2;
+ /** @type {!boolean} */
+ var lab3;
+ /** @type {!boolean} */
+ var lab4;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var limit$0;
+ /** @type {!number} */
+ var cursor$1;
+ /** @type {!number} */
+ var limit$1;
+ /** @type {!number} */
+ var cursor$2;
+ /** @type {!number} */
+ var limit$2;
+ /** @type {!number} */
+ var cursor$3;
+ v_1 = this.cursor;
+ lab0 = true;
+lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ if (! this.r_mark_regions$()) {
+ break lab0;
+ }
+ }
+ cursor$0 = this.cursor = v_1;
+ this.limit_backward = cursor$0;
+ cursor$1 = this.cursor = limit$0 = this.limit;
+ v_2 = limit$0 - cursor$1;
+ lab1 = true;
+lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ if (! this.r_main_suffix$()) {
+ break lab1;
+ }
+ }
+ cursor$2 = this.cursor = (limit$1 = this.limit) - v_2;
+ v_3 = limit$1 - cursor$2;
+ lab2 = true;
+lab2:
+ while (lab2 === true) {
+ lab2 = false;
+ if (! this.r_consonant_pair$()) {
+ break lab2;
+ }
+ }
+ cursor$3 = this.cursor = (limit$2 = this.limit) - v_3;
+ v_4 = limit$2 - cursor$3;
+ lab3 = true;
+lab3:
+ while (lab3 === true) {
+ lab3 = false;
+ if (! this.r_other_suffix$()) {
+ break lab3;
+ }
+ }
+ this.cursor = this.limit - v_4;
+ lab4 = true;
+lab4:
+ while (lab4 === true) {
+ lab4 = false;
+ if (! this.r_undouble$()) {
+ break lab4;
+ }
+ }
+ this.cursor = this.limit_backward;
+ return true;
+};
+
+/**
+ * @param {*} o
+ * @return {!boolean}
+ */
+DanishStemmer.prototype.equals$X = function (o) {
+ return o instanceof DanishStemmer;
+};
+
+/**
+ * @return {!number}
+ */
+DanishStemmer.prototype.hashCode$ = function () {
+ /** @type {!string} */
+ var classname;
+ /** @type {!number} */
+ var hash;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var char;
+ classname = "DanishStemmer";
+ hash = 0;
+ if ("DanishStemmer".length === 0) {
+ return (hash | 0);
+ }
+ for (i = 0; i < classname.length; i++) {
+ char = classname.charCodeAt(i);
+ hash = (hash << 5) - hash + char;
+ hash = hash & hash;
+ }
+ return (hash | 0);
+};
+
+/**
+ * class Among extends Object
+ * @constructor
+ */
+function Among() {
+}
+
+/**
+ * @constructor
+ * @param {!string} s
+ * @param {!number} substring_i
+ * @param {!number} result
+ */
+function Among$SII(s, substring_i, result) {
+ this.s_size = s.length;
+ this.s = s;
+ this.substring_i = substring_i;
+ this.result = result;
+ this.method = null;
+ this.instance = null;
+};
+
+Among$SII.prototype = new Among;
+
+/**
+ * @constructor
+ * @param {!string} s
+ * @param {!number} substring_i
+ * @param {!number} result
+ * @param {*} method
+ * @param {BaseStemmer} instance
+ */
+function Among$SIIF$LBaseStemmer$B$LBaseStemmer$(s, substring_i, result, method, instance) {
+ this.s_size = s.length;
+ this.s = s;
+ this.substring_i = substring_i;
+ this.result = result;
+ this.method = method;
+ this.instance = instance;
+};
+
+Among$SIIF$LBaseStemmer$B$LBaseStemmer$.prototype = new Among;
+
+/**
+ * class Metadata extends Object
+ * @constructor
+ */
+function Metadata() {
+}
+
+/**
+ * @constructor
+ * @param {Oktavia} parent
+ */
+function Metadata$LOktavia$(parent) {
+ this._parent = parent;
+ this._bitVector = new BitVector$();
+};
+
+Metadata$LOktavia$.prototype = new Metadata;
+
+/**
+ * @return {!number}
+ */
+Metadata.prototype._size$ = function () {
+ /** @type {BitVector} */
+ var this$0;
+ /** @type {!number} */
+ var i$0;
+ /** @type {BitVector} */
+ var _bitVector$0;
+ this$0 = _bitVector$0 = this._bitVector;
+ i$0 = _bitVector$0._size;
+ return this$0.rank$IB(i$0, true);
+};
+
+/**
+ * @param {!number} index
+ * @return {!string}
+ */
+Metadata.prototype.getContent$I = function (index) {
+ /** @type {!number} */
+ var startPosition;
+ /** @type {!number} */
+ var length;
+ if (index < 0 || this._size$() <= index) {
+ throw new Error("Section.getContent() : range error " + (index + ""));
+ }
+ startPosition = 0;
+ if (index > 0) {
+ startPosition = this._bitVector.select$I(index - 1) + 1;
+ }
+ length = this._bitVector.select$I(index) - startPosition + 1;
+ return this._parent._getSubstring$II(startPosition, length);
+};
+
+/**
+ * @param {!number} index
+ * @return {!number}
+ */
+Metadata.prototype.getStartPosition$I = function (index) {
+ /** @type {!number} */
+ var startPosition;
+ if (index < 0 || this._size$() <= index) {
+ throw new Error("Section.getContent() : range error " + (index + ""));
+ }
+ startPosition = 0;
+ if (index > 0) {
+ startPosition = this._bitVector.select$I(index - 1) + 1;
+ }
+ return (startPosition | 0);
+};
+
+/**
+ * @param {SingleResult} result
+ * @param {Array.<undefined|!number>} positions
+ * @param {!string} word
+ * @param {!boolean} stemmed
+ */
+Metadata.prototype.grouping$LSingleResult$AISB = function (result, positions, word, stemmed) {
+};
+
+/**
+ * @param {!number} index
+ * @return {!string}
+ */
+Metadata.prototype.getInformation$I = function (index) {
+ return '';
+};
+
+/**
+ */
+Metadata.prototype._build$ = function () {
+ this._bitVector.build$();
+};
+
+/**
+ * @param {!string} name
+ * @param {!string} data
+ * @param {!number} offset
+ * @return {!number}
+ */
+Metadata.prototype._load$SSI = function (name, data, offset) {
+ offset = this._bitVector.load$SI(data, offset);
+ this._parent._metadataLabels.push(name);
+ this._parent._metadatas[name] = this;
+ return offset;
+};
+
+/**
+ * @return {!string}
+ */
+Metadata.prototype._dump$ = function () {
+ /** @type {BitVector} */
+ var this$0;
+ /** @type {Array.<undefined|!string>} */
+ var contents$0;
+ this$0 = this._bitVector;
+ contents$0 = [ ];
+ contents$0.push(Binary$dump32bitNumber$N(this$0._size));
+ contents$0.push(Binary$dump32bitNumberList$AN(this$0._v));
+ return contents$0.join('');
+};
+
+/**
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+Metadata.prototype._dump$LCompressionReport$ = function (report) {
+ /** @type {BitVector} */
+ var this$0;
+ /** @type {Array.<undefined|!string>} */
+ var contents$0;
+ this$0 = this._bitVector;
+ contents$0 = [ ];
+ contents$0.push(Binary$dump32bitNumber$N(this$0._size));
+ CompressionReport$add$LCompressionReport$II(report, 2, 2);
+ contents$0.push(Binary$dump32bitNumberList$ANLCompressionReport$(this$0._v, report));
+ return contents$0.join('');
+};
+
+/**
+ * class Section extends Metadata
+ * @constructor
+ */
+function Section() {
+}
+
+Section.prototype = new Metadata;
+/**
+ * @constructor
+ * @param {Oktavia} parent
+ */
+function Section$LOktavia$(parent) {
+ this._parent = parent;
+ this._bitVector = new BitVector$();
+ this._names = [ ];
+};
+
+Section$LOktavia$.prototype = new Section;
+
+/**
+ * @param {!string} name
+ */
+Section.prototype.setTail$S = function (name) {
+ /** @type {!number} */
+ var index$0;
+ /** @type {Oktavia} */
+ var this$0;
+ /** @type {FMIndex} */
+ var this$0$0;
+ this$0 = this._parent;
+ this$0$0 = this$0._fmindex;
+ index$0 = this$0$0._substr.length;
+ this._names.push(name);
+ this._bitVector.set$I(index$0 - 1);
+};
+
+/**
+ * @param {!string} name
+ * @param {!number} index
+ */
+Section.prototype.setTail$SI = function (name, index) {
+ this._names.push(name);
+ this._bitVector.set$I(index - 1);
+};
+
+/**
+ * @return {!number}
+ */
+Section.prototype.size$ = function () {
+ return (this._names.length | 0);
+};
+
+/**
+ * @param {!number} position
+ * @return {!number}
+ */
+Section.prototype.getSectionIndex$I = function (position) {
+ /** @type {BitVector} */
+ var this$0;
+ if (position < 0 || this._bitVector.size$() <= position) {
+ throw new Error("Section.getSectionIndex() : range error " + (position + ""));
+ }
+ this$0 = this._bitVector;
+ return this$0.rank$IB(position, true);
+};
+
+/**
+ * @param {!number} index
+ * @return {!string}
+ */
+Section.prototype.getName$I = function (index) {
+ if (index < 0 || this._names.length <= index) {
+ throw new Error("Section.getName() : range error");
+ }
+ return this._names[index];
+};
+
+/**
+ * @param {SingleResult} result
+ * @param {Array.<undefined|!number>} positions
+ * @param {!string} word
+ * @param {!boolean} stemmed
+ */
+Section.prototype.grouping$LSingleResult$AISB = function (result, positions, word, stemmed) {
+ /** @type {!number} */
+ var i;
+ /** @type {undefined|!number} */
+ var position;
+ /** @type {!number} */
+ var index;
+ /** @type {SearchUnit} */
+ var unit;
+ for (i = 0; i < positions.length; i++) {
+ position = positions[i];
+ index = this.getSectionIndex$I(position);
+ unit = SingleResult$getSearchUnit$LSingleResult$I(result, index);
+ if (unit.startPosition < 0) {
+ unit.startPosition = this.getStartPosition$I(index);
+ }
+ SearchUnit$addPosition$LSearchUnit$SIB(unit, word, position - unit.startPosition, stemmed);
+ }
+};
+
+/**
+ * @param {!number} index
+ * @return {!string}
+ */
+Section.prototype.getInformation$I = function (index) {
+ return this.getName$I(index);
+};
+
+/**
+ * @param {Oktavia} parent
+ * @param {!string} name
+ * @param {!string} data
+ * @param {!number} offset
+ * @return {!number}
+ */
+Section._load$LOktavia$SSI = function (parent, name, data, offset) {
+ /** @type {LoadedStringListResult} */
+ var strs;
+ /** @type {Section} */
+ var section;
+ /** @type {!number} */
+ var offset$0;
+ strs = new LoadedStringListResult$SI(data, offset);
+ section = new Section$LOktavia$(parent);
+ section._names = strs.result;
+ offset$0 = strs.offset;
+ offset$0 = section._bitVector.load$SI(data, offset$0);
+ section._parent._metadataLabels.push(name);
+ section._parent._metadatas[name] = section;
+ return offset$0;
+};
+
+var Section$_load$LOktavia$SSI = Section._load$LOktavia$SSI;
+
+/**
+ * @return {!string}
+ */
+Section.prototype._dump$ = function () {
+ return [ Binary$dump16bitNumber$I(0), Binary$dumpStringList$AS(this._names), Metadata.prototype._dump$.call(this) ].join('');
+};
+
+/**
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+Section.prototype._dump$LCompressionReport$ = function (report) {
+ CompressionReport$add$LCompressionReport$II(report, 1, 1);
+ return [ Binary$dump16bitNumber$I(0), Binary$dumpStringList$ASLCompressionReport$(this._names, report), Metadata.prototype._dump$LCompressionReport$.call(this, report) ].join('');
+};
+
+/**
+ * class Splitter extends Metadata
+ * @constructor
+ */
+function Splitter() {
+}
+
+Splitter.prototype = new Metadata;
+/**
+ * @constructor
+ * @param {Oktavia} parent
+ */
+function Splitter$LOktavia$(parent) {
+ this._parent = parent;
+ this._bitVector = new BitVector$();
+ this.name = null;
+};
+
+Splitter$LOktavia$.prototype = new Splitter;
+
+/**
+ * @constructor
+ * @param {Oktavia} parent
+ * @param {!string} name
+ */
+function Splitter$LOktavia$S(parent, name) {
+ this._parent = parent;
+ this._bitVector = new BitVector$();
+ this.name = name;
+};
+
+Splitter$LOktavia$S.prototype = new Splitter;
+
+/**
+ * @return {!number}
+ */
+Splitter.prototype.size$ = function () {
+ /** @type {BitVector} */
+ var this$0$0;
+ /** @type {!number} */
+ var i$0$0;
+ /** @type {BitVector} */
+ var _bitVector$0;
+ this$0$0 = _bitVector$0 = this._bitVector;
+ i$0$0 = _bitVector$0._size;
+ return this$0$0.rank$IB(i$0$0, true);
+};
+
+/**
+ */
+Splitter.prototype.split$ = function () {
+ /** @type {!number} */
+ var index$0;
+ /** @type {Oktavia} */
+ var this$0;
+ /** @type {FMIndex} */
+ var this$0$0;
+ this$0 = this._parent;
+ this$0$0 = this$0._fmindex;
+ index$0 = this$0$0._substr.length;
+ this._bitVector.set$I(index$0 - 1);
+};
+
+/**
+ * @param {!number} index
+ */
+Splitter.prototype.split$I = function (index) {
+ this._bitVector.set$I(index - 1);
+};
+
+/**
+ * @param {!number} position
+ * @return {!number}
+ */
+Splitter.prototype.getIndex$I = function (position) {
+ /** @type {BitVector} */
+ var this$0;
+ if (position < 0 || this._bitVector.size$() <= position) {
+ throw new Error("Section.getSectionIndex() : range error");
+ }
+ this$0 = this._bitVector;
+ return this$0.rank$IB(position, true);
+};
+
+/**
+ * @param {SingleResult} result
+ * @param {Array.<undefined|!number>} positions
+ * @param {!string} word
+ * @param {!boolean} stemmed
+ */
+Splitter.prototype.grouping$LSingleResult$AISB = function (result, positions, word, stemmed) {
+ /** @type {!number} */
+ var i;
+ /** @type {undefined|!number} */
+ var position;
+ /** @type {!number} */
+ var index;
+ /** @type {SearchUnit} */
+ var unit;
+ for (i = 0; i < positions.length; i++) {
+ position = positions[i];
+ index = this.getIndex$I(position);
+ unit = SingleResult$getSearchUnit$LSingleResult$I(result, index);
+ if (unit.startPosition < 0) {
+ unit.startPosition = this.getStartPosition$I(index);
+ }
+ SearchUnit$addPosition$LSearchUnit$SIB(unit, word, position - unit.startPosition, stemmed);
+ }
+};
+
+/**
+ * @param {!number} index
+ * @return {!string}
+ */
+Splitter.prototype.getInformation$I = function (index) {
+ return (this.name != null ? this.name + (index + 1 + "") : '');
+};
+
+/**
+ * @param {Oktavia} parent
+ * @param {!string} name
+ * @param {!string} data
+ * @param {!number} offset
+ * @return {!number}
+ */
+Splitter._load$LOktavia$SSI = function (parent, name, data, offset) {
+ /** @type {Splitter} */
+ var section;
+ section = new Splitter$LOktavia$(parent);
+ offset = section._bitVector.load$SI(data, offset);
+ section._parent._metadataLabels.push(name);
+ section._parent._metadatas[name] = section;
+ return offset;
+};
+
+var Splitter$_load$LOktavia$SSI = Splitter._load$LOktavia$SSI;
+
+/**
+ * @return {!string}
+ */
+Splitter.prototype._dump$ = function () {
+ return [ Binary$dump16bitNumber$I(1), Metadata.prototype._dump$.call(this) ].join('');
+};
+
+/**
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+Splitter.prototype._dump$LCompressionReport$ = function (report) {
+ CompressionReport$add$LCompressionReport$II(report, 1, 1);
+ return [ Binary$dump16bitNumber$I(1), Metadata.prototype._dump$LCompressionReport$.call(this, report) ].join('');
+};
+
+/**
+ * class Table extends Metadata
+ * @constructor
+ */
+function Table() {
+}
+
+Table.prototype = new Metadata;
+/**
+ * @constructor
+ * @param {Oktavia} parent
+ * @param {Array.<undefined|!string>} headers
+ */
+function Table$LOktavia$AS(parent, headers) {
+ this._parent = parent;
+ this._bitVector = new BitVector$();
+ this._headers = headers;
+ this._columnTails = new BitVector$();
+};
+
+Table$LOktavia$AS.prototype = new Table;
+
+/**
+ * @return {!number}
+ */
+Table.prototype.rowSize$ = function () {
+ /** @type {BitVector} */
+ var this$0$0;
+ /** @type {!number} */
+ var i$0$0;
+ /** @type {BitVector} */
+ var _bitVector$0;
+ this$0$0 = _bitVector$0 = this._bitVector;
+ i$0$0 = _bitVector$0._size;
+ return this$0$0.rank$IB(i$0$0, true);
+};
+
+/**
+ * @return {!number}
+ */
+Table.prototype.columnSize$ = function () {
+ return (this._headers.length | 0);
+};
+
+/**
+ */
+Table.prototype.setColumnTail$ = function () {
+ /** @type {!number} */
+ var index;
+ /** @type {Oktavia} */
+ var this$0;
+ /** @type {FMIndex} */
+ var this$0$0;
+ /** @type {Oktavia} */
+ var _parent$0;
+ this$0 = _parent$0 = this._parent;
+ this$0$0 = this$0._fmindex;
+ index = this$0$0._substr.length;
+ _parent$0._fmindex.push$S(Oktavia.eob);
+ this._columnTails.set$I(index - 1);
+};
+
+/**
+ */
+Table.prototype.setRowTail$ = function () {
+ /** @type {!number} */
+ var index;
+ /** @type {Oktavia} */
+ var this$0;
+ /** @type {FMIndex} */
+ var this$0$0;
+ this$0 = this._parent;
+ this$0$0 = this$0._fmindex;
+ index = this$0$0._substr.length;
+ this._bitVector.set$I(index - 1);
+};
+
+/**
+ * @param {!number} position
+ * @return {Array.<undefined|!number>}
+ */
+Table.prototype.getCell$I = function (position) {
+ /** @type {!number} */
+ var row;
+ /** @type {!number} */
+ var currentColumn;
+ /** @type {!number} */
+ var lastRowColumn;
+ /** @type {!number} */
+ var startPosition;
+ /** @type {Array.<undefined|!number>} */
+ var result;
+ /** @type {BitVector} */
+ var this$0;
+ /** @type {BitVector} */
+ var this$1;
+ if (position < 0 || this._bitVector.size$() <= position) {
+ throw new Error("Section.getSectionIndex() : range error " + (position + ""));
+ }
+ this$0 = this._bitVector;
+ row = this$0.rank$IB(position, true);
+ this$1 = this._columnTails;
+ currentColumn = this$1.rank$IB(position, true);
+ lastRowColumn = 0;
+ if (row > 0) {
+ startPosition = this._bitVector.select$I(row - 1) + 1;
+ lastRowColumn = this._columnTails.rank$I(startPosition);
+ }
+ result = [ row, currentColumn - lastRowColumn ];
+ return result;
+};
+
+/**
+ * @param {!number} rowIndex
+ * @return {Object.<string, undefined|!string>}
+ */
+Table.prototype.getRowContent$I = function (rowIndex) {
+ /** @type {!string} */
+ var content;
+ /** @type {Array.<undefined|!string>} */
+ var values;
+ /** @type {Object.<string, undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var i;
+ content = this.getContent$I(rowIndex);
+ values = content.split(Oktavia.eob, this._headers.length);
+ result = ({ });
+ for (i in this._headers) {
+ if (i < values.length) {
+ result[this._headers[i]] = values[i];
+ } else {
+ result[this._headers[i]] = '';
+ }
+ }
+ return result;
+};
+
+/**
+ * @param {SingleResult} result
+ * @param {Array.<undefined|!number>} positions
+ * @param {!string} word
+ * @param {!boolean} stemmed
+ */
+Table.prototype.grouping$LSingleResult$AISB = function (result, positions, word, stemmed) {
+};
+
+/**
+ * @param {!number} index
+ * @return {!string}
+ */
+Table.prototype.getInformation$I = function (index) {
+ return '';
+};
+
+/**
+ */
+Table.prototype._build$ = function () {
+ this._bitVector.build$();
+ this._columnTails.build$();
+};
+
+/**
+ * @param {Oktavia} parent
+ * @param {!string} name
+ * @param {!string} data
+ * @param {!number} offset
+ * @return {!number}
+ */
+Table._load$LOktavia$SSI = function (parent, name, data, offset) {
+ /** @type {LoadedStringListResult} */
+ var strs;
+ /** @type {Table} */
+ var table;
+ /** @type {!number} */
+ var offset$0;
+ strs = new LoadedStringListResult$SI(data, offset);
+ table = new Table$LOktavia$AS(parent, strs.result);
+ offset$0 = strs.offset;
+ offset$0 = table._bitVector.load$SI(data, offset$0);
+ table._parent._metadataLabels.push(name);
+ table._parent._metadatas[name] = table;
+ offset = offset$0;
+ return table._columnTails.load$SI(data, offset$0);
+};
+
+var Table$_load$LOktavia$SSI = Table._load$LOktavia$SSI;
+
+/**
+ * @return {!string}
+ */
+Table.prototype._dump$ = function () {
+ return [ Binary$dump16bitNumber$I(2), Binary$dumpStringList$AS(this._headers), Metadata.prototype._dump$.call(this), this._columnTails.dump$() ].join('');
+};
+
+/**
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+Table.prototype._dump$LCompressionReport$ = function (report) {
+ CompressionReport$add$LCompressionReport$II(report, 1, 1);
+ return [ Binary$dump16bitNumber$I(2), Binary$dumpStringList$ASLCompressionReport$(this._headers, report), Metadata.prototype._dump$LCompressionReport$.call(this, report), this._columnTails.dump$LCompressionReport$(report) ].join('');
+};
+
+/**
+ * class Block extends Metadata
+ * @constructor
+ */
+function Block() {
+}
+
+Block.prototype = new Metadata;
+/**
+ * @constructor
+ * @param {Oktavia} parent
+ */
+function Block$LOktavia$(parent) {
+ this._parent = parent;
+ this._bitVector = new BitVector$();
+ this._names = [ ];
+ this._start = false;
+};
+
+Block$LOktavia$.prototype = new Block;
+
+/**
+ * @param {!string} blockName
+ */
+Block.prototype.startBlock$S = function (blockName) {
+ this.startBlock$SI(blockName, this._parent.contentSize$());
+};
+
+/**
+ * @param {!string} blockName
+ * @param {!number} index
+ */
+Block.prototype.startBlock$SI = function (blockName, index) {
+ if (this._start) {
+ throw new Error('Splitter `' + this._names[this._names.length - 1] + '` is not closed');
+ }
+ this._start = true;
+ this._names.push(blockName);
+ this._bitVector.set$I(index - 1);
+};
+
+/**
+ */
+Block.prototype.endBlock$ = function () {
+ this.endBlock$I(this._parent.contentSize$());
+};
+
+/**
+ * @param {!number} index
+ */
+Block.prototype.endBlock$I = function (index) {
+ if (! this._start) {
+ throw new Error('Splitter is not started');
+ }
+ this._start = false;
+ this._bitVector.set$I(index - 1);
+};
+
+/**
+ * @return {!number}
+ */
+Block.prototype.size$ = function () {
+ return (this._names.length | 0);
+};
+
+/**
+ * @param {!number} position
+ * @return {!number}
+ */
+Block.prototype.blockIndex$I = function (position) {
+ /** @type {!number} */
+ var result;
+ /** @type {BitVector} */
+ var this$0;
+ if (position < 0 || this._parent._fmindex.size$() - 1 <= position) {
+ throw new Error("Block.blockIndex() : range error " + (position + ""));
+ }
+ if (position >= this._bitVector.size$()) {
+ position = (this._bitVector.size$() - 1 | 0);
+ result = (this._bitVector.rank$I(position) + 1 | 0);
+ } else {
+ this$0 = this._bitVector;
+ result = this$0.rank$IB(position, true);
+ }
+ return result;
+};
+
+/**
+ * @param {!number} position
+ * @return {!boolean}
+ */
+Block.prototype.inBlock$I = function (position) {
+ /** @type {!number} */
+ var blockIndex;
+ blockIndex = this.blockIndex$I(position);
+ return blockIndex % 2 !== 0;
+};
+
+/**
+ * @param {!number} position
+ * @return {!string}
+ */
+Block.prototype.getBlockContent$I = function (position) {
+ /** @type {!number} */
+ var blockIndex;
+ /** @type {!string} */
+ var result;
+ blockIndex = this.blockIndex$I(position);
+ if (blockIndex % 2 !== 0) {
+ result = this.getContent$I(blockIndex);
+ } else {
+ result = '';
+ }
+ return result;
+};
+
+/**
+ * @param {!number} position
+ * @return {!string}
+ */
+Block.prototype.getBlockName$I = function (position) {
+ /** @type {!number} */
+ var blockIndex;
+ /** @type {!string} */
+ var result;
+ blockIndex = this.blockIndex$I(position);
+ if (blockIndex % 2 !== 0) {
+ result = this._names[blockIndex >>> 1];
+ } else {
+ result = '';
+ }
+ return result;
+};
+
+/**
+ * @param {SingleResult} result
+ * @param {Array.<undefined|!number>} positions
+ * @param {!string} word
+ * @param {!boolean} stemmed
+ */
+Block.prototype.grouping$LSingleResult$AISB = function (result, positions, word, stemmed) {
+};
+
+/**
+ * @param {!number} index
+ * @return {!string}
+ */
+Block.prototype.getInformation$I = function (index) {
+ return '';
+};
+
+/**
+ * @param {Oktavia} parent
+ * @param {!string} name
+ * @param {!string} data
+ * @param {!number} offset
+ * @return {!number}
+ */
+Block._load$LOktavia$SSI = function (parent, name, data, offset) {
+ /** @type {LoadedStringListResult} */
+ var strs;
+ /** @type {Block} */
+ var block;
+ /** @type {!number} */
+ var offset$0;
+ strs = new LoadedStringListResult$SI(data, offset);
+ block = new Block$LOktavia$(parent);
+ block._names = strs.result;
+ offset$0 = strs.offset;
+ offset$0 = block._bitVector.load$SI(data, offset$0);
+ block._parent._metadataLabels.push(name);
+ block._parent._metadatas[name] = block;
+ return offset$0;
+};
+
+var Block$_load$LOktavia$SSI = Block._load$LOktavia$SSI;
+
+/**
+ * @return {!string}
+ */
+Block.prototype._dump$ = function () {
+ return [ Binary$dump16bitNumber$I(3), Binary$dumpStringList$AS(this._names), Metadata.prototype._dump$.call(this) ].join('');
+};
+
+/**
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+Block.prototype._dump$LCompressionReport$ = function (report) {
+ CompressionReport$add$LCompressionReport$II(report, 1, 1);
+ return [ Binary$dump16bitNumber$I(3), Binary$dumpStringList$ASLCompressionReport$(this._names, report), Metadata.prototype._dump$LCompressionReport$.call(this, report) ].join('');
+};
+
+/**
+ * class FMIndex extends Object
+ * @constructor
+ */
+function FMIndex() {
+}
+
+/**
+ * @constructor
+ */
+function FMIndex$() {
+ /** @type {Array.<undefined|!number>} */
+ var _rlt$0;
+ this._ssize = 0;
+ (this._ddic = 0, this._head = 0);
+ this._substr = "";
+ this._sv = new WaveletMatrix$();
+ this._posdic = [ ];
+ this._idic = [ ];
+ _rlt$0 = this._rlt = [ ];
+ _rlt$0.length = 65536;
+};
+
+FMIndex$.prototype = new FMIndex;
+
+/**
+ */
+FMIndex.prototype.clear$ = function () {
+ /** @type {WaveletMatrix} */
+ var this$0;
+ this$0 = this._sv;
+ this$0._bv.length = 0;
+ this$0._seps.length = 0;
+ this$0._size = 0;
+ this._posdic.length = 0;
+ this._idic.length = 0;
+ this._ddic = 0;
+ this._head = 0;
+ this._substr = "";
+};
+
+/**
+ * @return {!number}
+ */
+FMIndex.prototype.size$ = function () {
+ /** @type {WaveletMatrix} */
+ var this$0;
+ this$0 = this._sv;
+ return this$0._size;
+};
+
+/**
+ * @return {!number}
+ */
+FMIndex.prototype.contentSize$ = function () {
+ return this._substr.length;
+};
+
+/**
+ * @param {!string} key
+ * @return {!number}
+ */
+FMIndex.prototype.getRows$S = function (key) {
+ /** @type {Array.<undefined|!number>} */
+ var pos;
+ pos = [ ];
+ return this.getRows$SAI(key, pos);
+};
+
+/**
+ * @param {!string} key
+ * @param {Array.<undefined|!number>} pos
+ * @return {!number}
+ */
+FMIndex.prototype.getRows$SAI = function (key, pos) {
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var code;
+ /** @type {!number} */
+ var first;
+ /** @type {undefined|!number} */
+ var last;
+ /** @type {!number} */
+ var c;
+ /** @type {Array.<undefined|!number>} */
+ var _rlt$0;
+ i = key.length - 1;
+ code = key.charCodeAt(i);
+ first = (_rlt$0 = this._rlt)[code] + 1;
+ last = _rlt$0[code + 1];
+ while (first <= last) {
+ if (i === 0) {
+ pos[0] = (-- first | 0);
+ pos[1] = -- last;
+ return (last - first + 1 | 0);
+ }
+ i--;
+ c = key.charCodeAt(i);
+ first = this._rlt[c] + this._sv.rank$II(first - 1, c) + 1;
+ last = this._rlt[c] + this._sv.rank$II(last, c);
+ }
+ return 0;
+};
+
+/**
+ * @param {!number} i
+ * @return {!number}
+ */
+FMIndex.prototype.getPosition$I = function (i) {
+ /** @type {!number} */
+ var pos;
+ /** @type {!number} */
+ var c;
+ if (i >= this.size$()) {
+ throw new Error("FMIndex.getPosition() : range error");
+ }
+ pos = 0;
+ while (i !== this._head) {
+ if (i % this._ddic === 0) {
+ pos += this._posdic[i / this._ddic] + 1;
+ break;
+ }
+ c = this._sv.get$I(i);
+ i = this._rlt[c] + this._sv.rank$II(i, c);
+ pos++;
+ }
+ return (pos % this.size$() | 0);
+};
+
+/**
+ * @param {!number} pos
+ * @param {!number} len
+ * @return {!string}
+ */
+FMIndex.prototype.getSubstring$II = function (pos, len) {
+ /** @type {!number} */
+ var pos_end;
+ /** @type {!number} */
+ var pos_tmp;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var pos_idic;
+ /** @type {!string} */
+ var substr;
+ /** @type {!number} */
+ var c;
+ /** @type {!number} */
+ var _ddic$0;
+ if (pos >= this.size$()) {
+ throw new Error("FMIndex.getSubstring() : range error");
+ }
+ pos_end = Math.min(pos + len, this.size$());
+ pos_tmp = this.size$() - 1;
+ i = this._head;
+ pos_idic = Math.floor((pos_end + (_ddic$0 = this._ddic) - 2) / _ddic$0);
+ if (pos_idic < this._idic.length) {
+ pos_tmp = pos_idic * this._ddic;
+ i = this._idic[pos_idic];
+ }
+ substr = "";
+ while (pos_tmp >= pos) {
+ c = this._sv.get$I(i);
+ i = this._rlt[c] + this._sv.rank$II(i, c);
+ if (pos_tmp < pos_end) {
+ substr = String.fromCharCode(c) + substr;
+ }
+ if (pos_tmp === 0) {
+ break;
+ }
+ pos_tmp--;
+ }
+ return substr;
+};
+
+/**
+ */
+FMIndex.prototype.build$ = function () {
+ this.build$SIIB(String.fromCharCode(0), 65535, 20, false);
+};
+
+/**
+ * @param {!string} end_marker
+ * @param {!number} ddic
+ * @param {!boolean} verbose
+ */
+FMIndex.prototype.build$SIB = function (end_marker, ddic, verbose) {
+ this.build$SIIB(end_marker, 65535, ddic, verbose);
+};
+
+/**
+ * @param {!string} end_marker
+ * @param {!number} maxChar
+ * @param {!number} ddic
+ * @param {!boolean} verbose
+ */
+FMIndex.prototype.build$SIIB = function (end_marker, maxChar, ddic, verbose) {
+ /** @type {BurrowsWheelerTransform} */
+ var b;
+ /** @type {!string} */
+ var s;
+ /** @type {!number} */
+ var c;
+ /** @type {!string} */
+ var str$0;
+ /** @type {WaveletMatrix} */
+ var this$0;
+ /** @type {!string} */
+ var _str$0;
+ /** @type {Array.<undefined|!number>} */
+ var _suffixarray$0;
+ if (verbose) {
+ console.time("building burrows-wheeler transform");
+ }
+ this._substr += end_marker;
+ b = ({_str: "", _size: 0, _head: 0, _suffixarray: [ ]});
+ str$0 = this._substr;
+ _str$0 = b._str = str$0;
+ b._size = _str$0.length;
+ _suffixarray$0 = b._suffixarray = SAIS$make$S(str$0);
+ b._head = (_suffixarray$0.indexOf(0) | 0);
+ s = BurrowsWheelerTransform$get$LBurrowsWheelerTransform$(b);
+ this._ssize = s.length;
+ this._head = b._head;
+ b._str = "";
+ b._size = 0;
+ b._head = 0;
+ b._suffixarray.length = 0;
+ this._substr = "";
+ if (verbose) {
+ console.timeEnd("building burrows-wheeler transform");
+ }
+ if (verbose) {
+ console.time("building wavelet matrix");
+ }
+ this$0 = this._sv;
+ this$0._bitsize = (Math.ceil(Math.log(maxChar) / 0.6931471805599453) | 0);
+ if (verbose) {
+ console.log(" maxCharCode: ", maxChar);
+ console.log(" bitSize: ", this._sv.bitsize$());
+ }
+ this._sv.build$S(s);
+ if (verbose) {
+ console.timeEnd("building wavelet matrix");
+ }
+ if (verbose) {
+ console.time("caching rank less than");
+ }
+ for (c = 0; c < maxChar; c++) {
+ this._rlt[c] = this._sv.rank_less_than$II(this._sv.size$(), c);
+ }
+ if (verbose) {
+ console.timeEnd("caching rank less than");
+ }
+ this._ddic = ddic;
+ if (verbose) {
+ console.time("building dictionaries");
+ }
+ this._buildDictionaries$();
+ if (verbose) {
+ console.timeEnd("building dictionaries");
+ console.log('');
+ }
+};
+
+/**
+ */
+FMIndex.prototype._buildDictionaries$ = function () {
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var pos;
+ /** @type {!number} */
+ var c;
+ for (i = 0; i < this._ssize / this._ddic + 1; i++) {
+ this._posdic.push(0);
+ this._idic.push(0);
+ }
+ i = this._head;
+ pos = this.size$() - 1;
+ do {
+ if (i % this._ddic === 0) {
+ this._posdic[Math.floor(i / this._ddic)] = (pos | 0);
+ }
+ if (pos % this._ddic === 0) {
+ this._idic[Math.floor(pos / this._ddic)] = (i | 0);
+ }
+ c = this._sv.get$I(i);
+ i = this._rlt[c] + this._sv.rank$II(i, c);
+ pos--;
+ } while (i !== this._head);
+};
+
+/**
+ * @param {!string} doc
+ */
+FMIndex.prototype.push$S = function (doc) {
+ if (doc.length <= 0) {
+ throw new Error("FMIndex::push(): empty string");
+ }
+ this._substr += doc;
+};
+
+/**
+ * @param {!string} keyword
+ * @return {Array.<undefined|!number>}
+ */
+FMIndex.prototype.search$S = function (keyword) {
+ /** @type {Array.<undefined|!number>} */
+ var result;
+ /** @type {Array.<undefined|!number>} */
+ var position;
+ /** @type {!number} */
+ var rows;
+ /** @type {undefined|!number} */
+ var first;
+ /** @type {undefined|!number} */
+ var last;
+ /** @type {undefined|!number} */
+ var i;
+ result = [ ];
+ position = [ ];
+ rows = this.getRows$SAI(keyword, position);
+ if (rows > 0) {
+ first = position[0];
+ last = position[1];
+ for (i = first; i <= last; i++) {
+ result.push(this.getPosition$I(i));
+ }
+ }
+ return result;
+};
+
+/**
+ * @return {!string}
+ */
+FMIndex.prototype.dump$ = function () {
+ return this.dump$B(false);
+};
+
+/**
+ * @param {!boolean} verbose
+ * @return {!string}
+ */
+FMIndex.prototype.dump$B = function (verbose) {
+ /** @type {Array.<undefined|!string>} */
+ var contents;
+ /** @type {CompressionReport} */
+ var report;
+ /** @type {!number} */
+ var i;
+ contents = [ ];
+ report = ({source: 0, result: 0});
+ contents.push(Binary$dump32bitNumber$N(this._ddic));
+ contents.push(Binary$dump32bitNumber$N(this._ssize));
+ contents.push(Binary$dump32bitNumber$N(this._head));
+ CompressionReport$add$LCompressionReport$II(report, 6, 6);
+ contents.push(this._sv.dump$LCompressionReport$(report));
+ if (verbose) {
+ console.log("Serializing FM-index");
+ console.log(' Wavelet Matrix: ' + (contents[3].length * 2 + "") + ' bytes (' + (Math.round(report.result * 100.0 / report.source) + "") + '%)');
+ }
+ contents.push(Binary$dump32bitNumber$N(this._posdic.length));
+ for (i in this._posdic) {
+ contents.push(Binary$dump32bitNumber$N(this._posdic[i]));
+ }
+ for (i in this._idic) {
+ contents.push(Binary$dump32bitNumber$N(this._idic[i]));
+ }
+ if (verbose) {
+ console.log(' Dictionary Cache: ' + (this._idic.length * 16 + "") + ' bytes');
+ }
+ return contents.join("");
+};
+
+/**
+ * @param {!string} data
+ * @return {!number}
+ */
+FMIndex.prototype.load$S = function (data) {
+ return this.load$SI(data, 0);
+};
+
+/**
+ * @param {!string} data
+ * @param {!number} offset
+ * @return {!number}
+ */
+FMIndex.prototype.load$SI = function (data, offset) {
+ /** @type {!number} */
+ var maxChar;
+ /** @type {!number} */
+ var c;
+ /** @type {!number} */
+ var size;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var result$0;
+ /** @type {!number} */
+ var result$1;
+ result$0 = data.charCodeAt(offset) * 65536 + data.charCodeAt(offset + 1);
+ this._ddic = (result$0 | 0);
+ this._ssize = (Binary$load32bitNumber$SI(data, offset + 2) | 0);
+ this._head = (Binary$load32bitNumber$SI(data, offset + 4) | 0);
+ offset = this._sv.load$SI(data, offset + 6);
+ maxChar = Math.pow(2, this._sv.bitsize$());
+ for (c = 0; c < maxChar; c++) {
+ this._rlt[c] = this._sv.rank_less_than$II(this._sv.size$(), c);
+ }
+ result$1 = data.charCodeAt(offset) * 65536 + data.charCodeAt(offset + 1);
+ size = result$1;
+ offset += 2;
+ for (i = 0; i < size; (i++, offset += 2)) {
+ this._posdic.push(Binary$load32bitNumber$SI(data, offset));
+ }
+ for (i = 0; i < size; (i++, offset += 2)) {
+ this._idic.push(Binary$load32bitNumber$SI(data, offset));
+ }
+ return offset;
+};
+
+/**
+ * class Tag extends Object
+ * @constructor
+ */
+function Tag() {
+}
+
+/**
+ * @constructor
+ * @param {!string} name
+ */
+function Tag$S(name) {
+ this.name = name;
+ this.attributes = ({ });
+ this.isSelfClosing = false;
+};
+
+Tag$S.prototype = new Tag;
+
+/**
+ * class _Common extends Object
+ * @constructor
+ */
+function _Common() {
+}
+
+/**
+ * @constructor
+ */
+function _Common$() {
+};
+
+_Common$.prototype = new _Common;
+
+/**
+ * class _State extends Object
+ * @constructor
+ */
+function _State() {
+}
+
+/**
+ * @constructor
+ */
+function _State$() {
+};
+
+_State$.prototype = new _State;
+
+/**
+ * class SAXHandler extends Object
+ * @constructor
+ */
+function SAXHandler() {
+}
+
+/**
+ * @constructor
+ */
+function SAXHandler$() {
+ this.position = 0;
+ this.column = 0;
+ this.line = 0;
+};
+
+SAXHandler$.prototype = new SAXHandler;
+
+/**
+ * @param {Error} error
+ */
+SAXHandler.prototype.onerror$LError$ = function (error) {
+};
+
+/**
+ * @param {!string} text
+ */
+SAXHandler.prototype.ontext$S = function (text) {
+};
+
+/**
+ * @param {!string} doctype
+ */
+SAXHandler.prototype.ondoctype$S = function (doctype) {
+};
+
+/**
+ * @param {!string} name
+ * @param {!string} body
+ */
+SAXHandler.prototype.onprocessinginstruction$SS = function (name, body) {
+};
+
+/**
+ * @param {!string} sgmlDecl
+ */
+SAXHandler.prototype.onsgmldeclaration$S = function (sgmlDecl) {
+};
+
+/**
+ * @param {!string} tagname
+ * @param {Object.<string, undefined|!string>} attributes
+ */
+SAXHandler.prototype.onopentag$SHS = function (tagname, attributes) {
+};
+
+/**
+ * @param {!string} tagname
+ */
+SAXHandler.prototype.onclosetag$S = function (tagname) {
+};
+
+/**
+ * @param {!string} name
+ * @param {!string} value
+ */
+SAXHandler.prototype.onattribute$SS = function (name, value) {
+};
+
+/**
+ * @param {!string} comment
+ */
+SAXHandler.prototype.oncomment$S = function (comment) {
+};
+
+/**
+ */
+SAXHandler.prototype.onopencdata$ = function () {
+};
+
+/**
+ * @param {!string} cdata
+ */
+SAXHandler.prototype.oncdata$S = function (cdata) {
+};
+
+/**
+ */
+SAXHandler.prototype.onclosecdata$ = function () {
+};
+
+/**
+ */
+SAXHandler.prototype.onend$ = function () {
+};
+
+/**
+ */
+SAXHandler.prototype.onready$ = function () {
+};
+
+/**
+ * @param {!string} script
+ */
+SAXHandler.prototype.onscript$S = function (script) {
+};
+
+/**
+ * class _HTMLHandler extends SAXHandler
+ * @constructor
+ */
+function _HTMLHandler() {
+}
+
+_HTMLHandler.prototype = new SAXHandler;
+/**
+ * @constructor
+ * @param {Object.<string, undefined|Array.<undefined|!string>>} styles
+ * @param {!boolean} escape
+ */
+function _HTMLHandler$HASB(styles, escape) {
+ this.position = 0;
+ this.column = 0;
+ this.line = 0;
+ this.text = [ ];
+ this.escape = escape;
+ this.styles = styles;
+};
+
+_HTMLHandler$HASB.prototype = new _HTMLHandler;
+
+/**
+ * @param {!string} str
+ * @return {!string}
+ */
+_HTMLHandler.escapeHTML$S = function (str) {
+ return str.replace(/\n/g, "<br/>").replace(/&/g, "&amp;").replace(/"/g, "&quot;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
+};
+
+var _HTMLHandler$escapeHTML$S = _HTMLHandler.escapeHTML$S;
+
+/**
+ * @param {!string} tagname
+ * @param {Object.<string, undefined|!string>} attributes
+ */
+_HTMLHandler.prototype.onopentag$SHS = function (tagname, attributes) {
+ this.text.push(this.styles[tagname][0]);
+};
+
+/**
+ * @param {!string} tagname
+ */
+_HTMLHandler.prototype.onclosetag$S = function (tagname) {
+ this.text.push(this.styles[tagname][1]);
+};
+
+/**
+ * @param {!string} text
+ */
+_HTMLHandler.prototype.ontext$S = function (text) {
+ if (this.escape) {
+ this.text.push(text.replace(/\n/g, "<br/>").replace(/&/g, "&amp;").replace(/"/g, "&quot;").replace(/</g, "&lt;").replace(/>/g, "&gt;"));
+ } else {
+ this.text.push(text);
+ }
+};
+
+/**
+ * @return {!string}
+ */
+_HTMLHandler.prototype.result$ = function () {
+ return this.text.join('');
+};
+
+/**
+ * class SAXParser extends Object
+ * @constructor
+ */
+function SAXParser() {
+}
+
+/**
+ * @constructor
+ * @param {SAXHandler} handler
+ */
+function SAXParser$LSAXHandler$(handler) {
+ this.q = "";
+ this.c = "";
+ this.bufferCheckPosition = 0;
+ this.looseCase = "";
+ this.tags = [ ];
+ this.closed = false;
+ this.closedRoot = false;
+ this.sawRoot = false;
+ this.tag = null;
+ this.error = null;
+ this.handler = null;
+ this.ENTITIES = null;
+ this.strict = false;
+ this.tagName = "";
+ this.state = 0;
+ this.line = 0;
+ this.column = 0;
+ this.position = 0;
+ this.startTagPosition = 0;
+ this.attribName = "";
+ this.attribValue = "";
+ this.script = "";
+ this.textNode = "";
+ this.attribList = null;
+ this.noscript = false;
+ this.cdata = "";
+ this.procInstBody = "";
+ this.procInstName = "";
+ this.doctype = "";
+ this.entity = "";
+ this.sgmlDecl = "";
+ this.comment = "";
+ this.preTags = 0;
+ this._init$LSAXHandler$B(handler, false);
+};
+
+SAXParser$LSAXHandler$.prototype = new SAXParser;
+
+/**
+ * @constructor
+ * @param {SAXHandler} handler
+ * @param {!boolean} strict
+ */
+function SAXParser$LSAXHandler$B(handler, strict) {
+ this.q = "";
+ this.c = "";
+ this.bufferCheckPosition = 0;
+ this.looseCase = "";
+ this.tags = [ ];
+ this.closed = false;
+ this.closedRoot = false;
+ this.sawRoot = false;
+ this.tag = null;
+ this.error = null;
+ this.handler = null;
+ this.ENTITIES = null;
+ this.strict = false;
+ this.tagName = "";
+ this.state = 0;
+ this.line = 0;
+ this.column = 0;
+ this.position = 0;
+ this.startTagPosition = 0;
+ this.attribName = "";
+ this.attribValue = "";
+ this.script = "";
+ this.textNode = "";
+ this.attribList = null;
+ this.noscript = false;
+ this.cdata = "";
+ this.procInstBody = "";
+ this.procInstName = "";
+ this.doctype = "";
+ this.entity = "";
+ this.sgmlDecl = "";
+ this.comment = "";
+ this.preTags = 0;
+ this._init$LSAXHandler$B(handler, strict);
+};
+
+SAXParser$LSAXHandler$B.prototype = new SAXParser;
+
+/**
+ * @param {SAXHandler} handler
+ * @param {!boolean} strict
+ */
+SAXParser.prototype._init$LSAXHandler$B = function (handler, strict) {
+ this.handler = handler;
+ this.clearBuffers$();
+ this.q = "";
+ this.bufferCheckPosition = 65536;
+ this.looseCase = 'toLowerCase';
+ this.tags = [ ];
+ this.closed = this.closedRoot = this.sawRoot = false;
+ this.tag = null;
+ this.error = null;
+ this.strict = strict;
+ this.noscript = strict;
+ this.state = 1;
+ this.ENTITIES = _Entities$entity_list$();
+ this.attribList = [ ];
+ this.noscript = false;
+ this.preTags = 0;
+};
+
+/**
+ * @param {!boolean} flag
+ */
+SAXParser.prototype.set_noscript$B = function (flag) {
+ this.noscript = flag;
+};
+
+/**
+ * @return {SAXParser}
+ */
+SAXParser.prototype.resume$ = function () {
+ this.error = null;
+ return this;
+};
+
+/**
+ * @return {SAXParser}
+ */
+SAXParser.prototype.close$ = function () {
+ return this.parse$S('');
+};
+
+/**
+ * @param {!string} chunk
+ * @return {SAXParser}
+ */
+SAXParser.prototype.parse$S = function (chunk) {
+ /** @type {Char} */
+ var _;
+ /** @type {!number} */
+ var i;
+ /** @type {!string} */
+ var c;
+ /** @type {!number} */
+ var starti;
+ /** @type {!number} */
+ var pad;
+ /** @type {!number} */
+ var returnState;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$0;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$1;
+ /** @type {RegExp} */
+ var charclass$2;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$3;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$4;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$5;
+ /** @type {!string} */
+ var text$0;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$6;
+ /** @type {RegExp} */
+ var charclass$7;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$8;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$9;
+ /** @type {RegExp} */
+ var charclass$10;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$11;
+ /** @type {RegExp} */
+ var charclass$12;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$13;
+ /** @type {RegExp} */
+ var charclass$14;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$15;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$16;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$17;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$18;
+ /** @type {RegExp} */
+ var charclass$19;
+ /** @type {RegExp} */
+ var charclass$20;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$21;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$22;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$23;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$24;
+ /** @type {!string} */
+ var comment$0;
+ _ = new Char$();
+ if (this.error) {
+ throw this.error;
+ }
+ if (this.closed) {
+ return this.emiterror$S("Cannot write after close. Assign an onready handler.");
+ }
+ (i = 0, c = "");
+ while (this.c = c = chunk.charAt(i++)) {
+ this.position++;
+ if (c === "\n") {
+ this.handler.line++;
+ this.handler.column = 0;
+ } else {
+ this.handler.column++;
+ }
+ switch (this.state) {
+ case 1:
+ if (c === "<") {
+ this.state = 4;
+ this.startTagPosition = this.position;
+ } else {
+ charclass$0 = _.whitespace;
+ if (! $__jsx_ObjectHasOwnProperty.call(charclass$0, c)) {
+ this.strictFail$S("Non-whitespace before first tag.");
+ this.textNode = c;
+ this.state = 2;
+ }
+ }
+ continue;
+ case 2:
+ if (this.sawRoot && ! this.closedRoot) {
+ starti = i - 1;
+ while (c && c !== "<" && c !== "&") {
+ c = chunk.charAt(i++);
+ if (c) {
+ this.position++;
+ if (c === "\n") {
+ this.handler.line++;
+ this.handler.column = 0;
+ } else {
+ this.handler.column++;
+ }
+ }
+ }
+ this.textNode += chunk.substring(starti, i - 1);
+ }
+ if (c === "<") {
+ this.state = 4;
+ this.startTagPosition = this.position;
+ } else {
+ if (_.not$HBS(_.whitespace, c) && (! this.sawRoot || this.closedRoot)) {
+ this.strictFail$S("Text data outside of root node.");
+ }
+ if (c === "&") {
+ this.state = 3;
+ } else {
+ this.textNode += c;
+ }
+ }
+ continue;
+ case 33:
+ if (c === "<") {
+ this.state = 34;
+ } else {
+ this.script += c;
+ }
+ continue;
+ case 34:
+ if (c === "/") {
+ this.state = 31;
+ } else {
+ this.script += "<" + c;
+ this.state = 33;
+ }
+ continue;
+ case 4:
+ if (c === "!") {
+ this.state = 5;
+ this.sgmlDecl = "";
+ } else {
+ charclass$1 = _.whitespace;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$1, c)) {
+ } else {
+ charclass$2 = _.nameStart;
+ if (charclass$2.test(c)) {
+ this.state = 21;
+ this.tagName = c;
+ } else {
+ if (c === "/") {
+ this.state = 31;
+ this.tagName = "";
+ } else {
+ if (c === "?") {
+ this.state = 18;
+ this.procInstName = this.procInstBody = "";
+ } else {
+ this.strictFail$S("Unencoded <");
+ if (this.startTagPosition + 1 < this.position) {
+ pad = this.position - this.startTagPosition;
+ for (i = 0; i < pad; i++) {
+ c = " " + c;
+ }
+ }
+ this.textNode += "<" + c;
+ this.state = 2;
+ }
+ }
+ }
+ }
+ }
+ continue;
+ case 5:
+ if ((this.sgmlDecl + c).toUpperCase() === _.CDATA) {
+ this.closetext_if_exist$();
+ this.state = 15;
+ this.sgmlDecl = "";
+ this.cdata = "";
+ } else {
+ if (this.sgmlDecl + c === "--") {
+ this.state = 12;
+ this.comment = "";
+ this.sgmlDecl = "";
+ } else {
+ if ((this.sgmlDecl + c).toUpperCase() === _.DOCTYPE) {
+ this.state = 7;
+ if (this.doctype || this.sawRoot) {
+ this.strictFail$S("Inappropriately located doctype declaration");
+ }
+ this.doctype = "";
+ this.sgmlDecl = "";
+ } else {
+ if (c === ">") {
+ this.closetext_if_exist$();
+ this.sgmlDecl = "";
+ this.state = 2;
+ } else {
+ charclass$3 = _.quote;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$3, c)) {
+ this.state = 6;
+ this.sgmlDecl += c;
+ } else {
+ this.sgmlDecl += c;
+ }
+ }
+ }
+ }
+ }
+ continue;
+ case 6:
+ if (c === this.q) {
+ this.state = 5;
+ this.q = "";
+ }
+ this.sgmlDecl += c;
+ continue;
+ case 7:
+ if (c === ">") {
+ this.state = 2;
+ this.closetext_if_exist$();
+ this.doctype.trim();
+ } else {
+ this.doctype += c;
+ if (c === "[") {
+ this.state = 9;
+ } else {
+ charclass$4 = _.quote;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$4, c)) {
+ this.state = 8;
+ this.q = c;
+ }
+ }
+ }
+ continue;
+ case 8:
+ this.doctype += c;
+ if (c === this.q) {
+ this.q = "";
+ this.state = 7;
+ }
+ continue;
+ case 9:
+ this.doctype += c;
+ if (c === "]") {
+ this.state = 7;
+ } else {
+ charclass$5 = _.quote;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$5, c)) {
+ this.state = 10;
+ this.q = c;
+ }
+ }
+ continue;
+ case 10:
+ this.doctype += c;
+ if (c === this.q) {
+ this.state = 9;
+ this.q = "";
+ }
+ continue;
+ case 12:
+ if (c === "-") {
+ this.state = 13;
+ } else {
+ this.comment += c;
+ }
+ continue;
+ case 13:
+ if (c === "-") {
+ this.state = 14;
+ text$0 = this.comment;
+ text$0 = text$0.replace(/[\n\t]/g, ' ');
+ text$0 = text$0.replace(/\s\s+/g, " ");
+ comment$0 = this.comment = text$0;
+ if (comment$0) {
+ this.closetext_if_exist$();
+ this.comment.trim();
+ }
+ this.comment = "";
+ } else {
+ this.comment += "-" + c;
+ this.state = 12;
+ }
+ continue;
+ case 14:
+ if (c !== ">") {
+ this.strictFail$S("Malformed comment");
+ this.comment += "--" + c;
+ this.state = 12;
+ } else {
+ this.state = 2;
+ }
+ continue;
+ case 15:
+ if (c === "]") {
+ this.state = 16;
+ } else {
+ this.cdata += c;
+ }
+ continue;
+ case 16:
+ if (c === "]") {
+ this.state = 17;
+ } else {
+ this.cdata += "]" + c;
+ this.state = 15;
+ }
+ continue;
+ case 17:
+ if (c === ">") {
+ if (this.cdata) {
+ this.closetext_if_exist$();
+ }
+ this.cdata = "";
+ this.state = 2;
+ } else {
+ if (c === "]") {
+ this.cdata += "]";
+ } else {
+ this.cdata += "]]" + c;
+ this.state = 15;
+ }
+ }
+ continue;
+ case 18:
+ if (c === "?") {
+ this.state = 20;
+ } else {
+ charclass$6 = _.whitespace;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$6, c)) {
+ this.state = 19;
+ } else {
+ this.procInstName += c;
+ }
+ }
+ continue;
+ case 19:
+ if (! this.procInstBody && _.is$HBS(_.whitespace, c)) {
+ continue;
+ } else {
+ if (c === "?") {
+ this.state = 20;
+ } else {
+ this.procInstBody += c;
+ }
+ }
+ continue;
+ case 20:
+ if (c === ">") {
+ this.closetext_if_exist$();
+ this.procInstName = this.procInstBody = "";
+ this.state = 2;
+ } else {
+ this.procInstBody += "?" + c;
+ this.state = 19;
+ }
+ continue;
+ case 21:
+ charclass$7 = _.nameBody;
+ if (charclass$7.test(c)) {
+ this.tagName += c;
+ } else {
+ this.newTag$();
+ if (c === ">") {
+ this.openTag$B(false);
+ } else {
+ if (c === "/") {
+ this.state = 22;
+ } else {
+ charclass$8 = _.whitespace;
+ if (! $__jsx_ObjectHasOwnProperty.call(charclass$8, c)) {
+ this.strictFail$S("Invalid character in tag name");
+ }
+ this.state = 23;
+ }
+ }
+ }
+ continue;
+ case 22:
+ if (c === ">") {
+ this.openTag$B(true);
+ this.closeTag$();
+ } else {
+ this.strictFail$S("Forward-slash in opening tag not followed by >");
+ this.state = 23;
+ }
+ continue;
+ case 23:
+ charclass$9 = _.whitespace;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$9, c)) {
+ continue;
+ } else {
+ if (c === ">") {
+ this.openTag$B(false);
+ } else {
+ if (c === "/") {
+ this.state = 22;
+ } else {
+ charclass$10 = _.nameStart;
+ if (charclass$10.test(c)) {
+ this.attribName = c;
+ this.attribValue = "";
+ this.state = 24;
+ } else {
+ this.strictFail$S("Invalid attribute name");
+ }
+ }
+ }
+ }
+ continue;
+ case 24:
+ if (c === "=") {
+ this.state = 26;
+ } else {
+ if (c === ">") {
+ this.strictFail$S("Attribute without value");
+ this.attribValue = this.attribName;
+ this.attrib$();
+ this.openTag$B(false);
+ } else {
+ charclass$11 = _.whitespace;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$11, c)) {
+ this.state = 25;
+ } else {
+ charclass$12 = _.nameBody;
+ if (charclass$12.test(c)) {
+ this.attribName += c;
+ } else {
+ this.strictFail$S("Invalid attribute name");
+ }
+ }
+ }
+ }
+ continue;
+ case 25:
+ if (c === "=") {
+ this.state = 26;
+ } else {
+ charclass$13 = _.whitespace;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$13, c)) {
+ continue;
+ } else {
+ this.strictFail$S("Attribute without value");
+ this.tag.attributes[this.attribName] = "";
+ this.attribValue = "";
+ this.closetext_if_exist$();
+ this.attribName = "";
+ if (c === ">") {
+ this.openTag$B(false);
+ } else {
+ charclass$14 = _.nameStart;
+ if (charclass$14.test(c)) {
+ this.attribName = c;
+ this.state = 24;
+ } else {
+ this.strictFail$S("Invalid attribute name");
+ this.state = 23;
+ }
+ }
+ }
+ }
+ continue;
+ case 26:
+ charclass$15 = _.whitespace;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$15, c)) {
+ continue;
+ } else {
+ charclass$16 = _.quote;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$16, c)) {
+ this.q = c;
+ this.state = 27;
+ } else {
+ this.strictFail$S("Unquoted attribute value");
+ this.state = 28;
+ this.attribValue = c;
+ }
+ }
+ continue;
+ case 27:
+ if (c !== this.q) {
+ if (c === "&") {
+ this.state = 29;
+ } else {
+ this.attribValue += c;
+ }
+ continue;
+ }
+ this.attrib$();
+ this.q = "";
+ this.state = 23;
+ continue;
+ case 28:
+ charclass$17 = _.attribEnd;
+ if (! $__jsx_ObjectHasOwnProperty.call(charclass$17, c)) {
+ if (c === "&") {
+ this.state = 30;
+ } else {
+ this.attribValue += c;
+ }
+ continue;
+ }
+ this.attrib$();
+ if (c === ">") {
+ this.openTag$B(false);
+ } else {
+ this.state = 23;
+ }
+ continue;
+ case 31:
+ if (! this.tagName) {
+ charclass$18 = _.whitespace;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$18, c)) {
+ continue;
+ } else {
+ charclass$19 = _.nameStart;
+ if (! charclass$19.test(c)) {
+ if (this.script) {
+ this.script += "</" + c;
+ this.state = 33;
+ } else {
+ this.strictFail$S("Invalid tagname in closing tag.");
+ }
+ } else {
+ this.tagName = c;
+ }
+ }
+ } else {
+ if (c === ">") {
+ this.closeTag$();
+ } else {
+ charclass$20 = _.nameBody;
+ if (charclass$20.test(c)) {
+ this.tagName += c;
+ } else {
+ if (this.script) {
+ this.script += "</" + this.tagName;
+ this.tagName = "";
+ this.state = 33;
+ } else {
+ charclass$21 = _.whitespace;
+ if (! $__jsx_ObjectHasOwnProperty.call(charclass$21, c)) {
+ this.strictFail$S("Invalid tagname in closing tag");
+ }
+ this.state = 32;
+ }
+ }
+ }
+ }
+ continue;
+ case 32:
+ charclass$22 = _.whitespace;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$22, c)) {
+ continue;
+ }
+ if (c === ">") {
+ this.closeTag$();
+ } else {
+ this.strictFail$S("Invalid characters in closing tag");
+ }
+ continue;
+ case 3:
+ if (c === ";") {
+ this.textNode += this.parseEntity$();
+ this.entity = "";
+ this.state = 2;
+ } else {
+ charclass$23 = _.entity;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$23, c)) {
+ this.entity += c;
+ } else {
+ this.strictFail$S("Invalid character entity");
+ this.textNode += "&" + this.entity + c;
+ this.entity = "";
+ this.state = 2;
+ }
+ }
+ continue;
+ case 29:
+ case 30:
+ if (this.state === 29) {
+ returnState = 27;
+ } else {
+ returnState = 28;
+ }
+ if (c === ";") {
+ this.attribValue += this.parseEntity$();
+ this.entity = "";
+ this.state = (returnState | 0);
+ } else {
+ charclass$24 = _.entity;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$24, c)) {
+ this.entity += c;
+ } else {
+ this.strictFail$S("Invalid character entity");
+ this.attribValue += "&" + this.entity + c;
+ this.entity = "";
+ this.state = (returnState | 0);
+ }
+ }
+ continue;
+ default:
+ throw new Error("Unknown state: " + (this.state + ""));
+ }
+ }
+ this.end$();
+ return this;
+};
+
+/**
+ */
+SAXParser.prototype.clearBuffers$ = function () {
+ this.comment = '';
+ this.sgmlDecl = '';
+ this.textNode = '';
+ this.tagName = '';
+ this.doctype = '';
+ this.procInstName = '';
+ this.procInstBody = '';
+ this.entity = '';
+ this.attribName = '';
+ this.attribValue = '';
+ this.cdata = '';
+ this.script = '';
+};
+
+/**
+ */
+SAXParser.prototype.closetext_if_exist$ = function () {
+ if (this.textNode !== '') {
+ this.closetext$();
+ }
+};
+
+/**
+ */
+SAXParser.prototype.closetext$ = function () {
+ /** @type {!string} */
+ var text;
+ /** @type {!string} */
+ var text$0;
+ if (this.preTags === 0) {
+ text$0 = this.textNode;
+ text$0 = text$0.replace(/[\n\t]/g, ' ');
+ text$0 = text$0.replace(/\s\s+/g, " ");
+ text = text$0;
+ if (text$0) {
+ this.handler.ontext$S(text);
+ }
+ } else {
+ if (this.textNode) {
+ this.handler.ontext$S(this.textNode);
+ }
+ }
+ this.textNode = "";
+};
+
+/**
+ * @param {!string} text
+ * @return {!string}
+ */
+SAXParser.prototype.textopts$S = function (text) {
+ text = text.replace(/[\n\t]/g, ' ');
+ text = text.replace(/\s\s+/g, " ");
+ return text;
+};
+
+/**
+ * @param {!string} er
+ * @return {SAXParser}
+ */
+SAXParser.prototype.emiterror$S = function (er) {
+ /** @type {Error} */
+ var error;
+ this.closetext$();
+ er += "\nLine: " + (this.line + "") + "\nColumn: " + (this.column + "") + "\nChar: " + this.c;
+ error = new Error(er);
+ this.error = error;
+ return this;
+};
+
+/**
+ */
+SAXParser.prototype.end$ = function () {
+ if (! this.closedRoot) {
+ this.strictFail$S("Unclosed root tag");
+ }
+ if (this.state !== 2) {
+ this.emiterror$S("Unexpected end");
+ }
+ this.closetext$();
+ this.c = "";
+ this.closed = true;
+};
+
+/**
+ * @param {!string} message
+ */
+SAXParser.prototype.strictFail$S = function (message) {
+ if (this.strict) {
+ this.emiterror$S(message);
+ }
+};
+
+/**
+ */
+SAXParser.prototype.newTag$ = function () {
+ if (! this.strict) {
+ this.tagName = this.tagName.toLowerCase();
+ }
+ this.tag = ({name: this.tagName, attributes: ({ }), isSelfClosing: false});
+ this.attribList.length = 0;
+};
+
+/**
+ */
+SAXParser.prototype.attrib$ = function () {
+ if (! this.strict) {
+ this.attribName = this.attribName.toLowerCase();
+ }
+ if ($__jsx_ObjectHasOwnProperty.call(this.tag.attributes, this.attribName)) {
+ this.attribName = this.attribValue = "";
+ return;
+ }
+ this.tag.attributes[this.attribName] = this.attribValue;
+ this.closetext_if_exist$();
+ this.attribName = this.attribValue = "";
+};
+
+/**
+ */
+SAXParser.prototype.openTag$ = function () {
+ this.openTag$B(false);
+};
+
+/**
+ * @param {!boolean} selfClosing
+ */
+SAXParser.prototype.openTag$B = function (selfClosing) {
+ /** @type {Tag} */
+ var tag$0;
+ /** @type {Tag} */
+ var tag$1;
+ (tag$0 = this.tag).isSelfClosing = selfClosing;
+ this.sawRoot = true;
+ this.tags.push(tag$0);
+ this.closetext_if_exist$();
+ this.handler.onopentag$SHS((tag$1 = this.tag).name, tag$1.attributes);
+ if (this.tag.name === 'pre') {
+ this.preTags++;
+ }
+ if (! selfClosing) {
+ if (! this.noscript && this.tagName.toLowerCase() === "script") {
+ this.state = 33;
+ } else {
+ this.state = 2;
+ }
+ this.tag = null;
+ this.tagName = "";
+ }
+ this.attribName = this.attribValue = "";
+ this.attribList.length = 0;
+};
+
+/**
+ */
+SAXParser.prototype.closeTag$ = function () {
+ /** @type {!number} */
+ var t;
+ /** @type {!string} */
+ var tagName;
+ /** @type {!string} */
+ var closeTo;
+ /** @type {Tag} */
+ var close;
+ /** @type {!number} */
+ var s;
+ /** @type {Tag} */
+ var tag$0;
+ if (! this.tagName) {
+ this.strictFail$S("Weird empty close tag.");
+ this.textNode += "</>";
+ this.state = 2;
+ return;
+ }
+ if (this.script) {
+ if (this.tagName !== "script") {
+ this.script += "</" + this.tagName + ">";
+ this.tagName = "";
+ this.state = 33;
+ return;
+ }
+ this.closetext_if_exist$();
+ this.script = "";
+ }
+ t = this.tags.length;
+ tagName = this.tagName;
+ if (! this.strict) {
+ tagName = tagName.toLowerCase();
+ }
+ closeTo = tagName;
+ while (t--) {
+ close = this.tags[t];
+ if (close.name !== closeTo) {
+ this.strictFail$S("Unexpected close tag");
+ } else {
+ break;
+ }
+ }
+ if (t < 0) {
+ this.strictFail$S("Unmatched closing tag: " + this.tagName);
+ this.textNode += "</" + this.tagName + ">";
+ this.state = 2;
+ return;
+ }
+ this.tagName = tagName;
+ s = this.tags.length;
+ while (s-- > t) {
+ tag$0 = this.tag = this.tags.pop();
+ this.tagName = tag$0.name;
+ this.closetext_if_exist$();
+ this.handler.onclosetag$S(this.tagName);
+ if (this.tagName === 'pre') {
+ this.preTags--;
+ }
+ }
+ if (t === 0) {
+ this.closedRoot = true;
+ }
+ this.tagName = this.attribValue = this.attribName = "";
+ this.attribList.length = 0;
+ this.state = 2;
+};
+
+/**
+ * @return {!string}
+ */
+SAXParser.prototype.parseEntity$ = function () {
+ /** @type {!string} */
+ var entity;
+ /** @type {!string} */
+ var entityLC;
+ /** @type {!number} */
+ var num;
+ /** @type {!string} */
+ var numStr;
+ entity = this.entity;
+ entityLC = entity.toLowerCase();
+ num = 0;
+ numStr = "";
+ if (this.ENTITIES[entity]) {
+ return this.ENTITIES[entity];
+ }
+ if (this.ENTITIES[entityLC]) {
+ return this.ENTITIES[entityLC];
+ }
+ entity = entityLC;
+ if (entityLC.charAt(0) === "#") {
+ if (entity.charAt(1) === "x") {
+ entity = entity.slice(2);
+ num = $__jsx_parseInt(entity, 16);
+ numStr = num.toString(16);
+ } else {
+ entity = entity.slice(1);
+ num = $__jsx_parseInt(entity, 10);
+ numStr = num.toString(10);
+ }
+ }
+ entity = entity.replace(/^0+/, "");
+ if (numStr.toLowerCase() !== entity) {
+ this.strictFail$S("Invalid character entity");
+ return "&" + this.entity + ";";
+ }
+ return String.fromCharCode(num);
+};
+
+/**
+ * class Char extends Object
+ * @constructor
+ */
+function Char() {
+}
+
+/**
+ * @constructor
+ */
+function Char$() {
+ this.CDATA = "[CDATA[";
+ this.DOCTYPE = "DOCTYPE";
+ this.XML_NAMESPACE = "http://www.w3.org/XML/1998/namespace";
+ this.whitespace = this._charClass$S("\r\n\t ");
+ this.number = this._charClass$S("0124356789");
+ this.letter = this._charClass$S("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ");
+ this.quote = this._charClass$S("'\"");
+ this.entity = this._charClass$S("0124356789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ#");
+ this.attribEnd = this._charClass$S("\r\n\t >");
+ this.nameStart = /[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/;
+ this.nameBody = /[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040\.\d-]/;
+};
+
+Char$.prototype = new Char;
+
+/**
+ * @param {!string} str
+ * @return {Object.<string, undefined|!boolean>}
+ */
+Char.prototype._charClass$S = function (str) {
+ /** @type {Object.<string, undefined|!boolean>} */
+ var result;
+ /** @type {!number} */
+ var i;
+ result = ({ });
+ for (i = 0; i < str.length; i++) {
+ result[str.slice(i, i + 1)] = true;
+ }
+ return result;
+};
+
+/**
+ * @param {RegExp} charclass
+ * @param {!string} c
+ * @return {!boolean}
+ */
+Char.prototype.is$LRegExp$S = function (charclass, c) {
+ return charclass.test(c);
+};
+
+/**
+ * @param {Object.<string, undefined|!boolean>} charclass
+ * @param {!string} c
+ * @return {!boolean}
+ */
+Char.prototype.is$HBS = function (charclass, c) {
+ return $__jsx_ObjectHasOwnProperty.call(charclass, c);
+};
+
+/**
+ * @param {RegExp} charclass
+ * @param {!string} c
+ * @return {!boolean}
+ */
+Char.prototype.not$LRegExp$S = function (charclass, c) {
+ return ! charclass.test(c);
+};
+
+/**
+ * @param {Object.<string, undefined|!boolean>} charclass
+ * @param {!string} c
+ * @return {!boolean}
+ */
+Char.prototype.not$HBS = function (charclass, c) {
+ return ! $__jsx_ObjectHasOwnProperty.call(charclass, c);
+};
+
+/**
+ * class _Entities extends Object
+ * @constructor
+ */
+function _Entities() {
+}
+
+/**
+ * @constructor
+ */
+function _Entities$() {
+};
+
+_Entities$.prototype = new _Entities;
+
+/**
+ * @return {Object.<string, undefined|!string>}
+ */
+_Entities.entity_list$ = function () {
+ /** @type {Object.<string, undefined|!string>} */
+ var result;
+ /** @type {!string} */
+ var key;
+ /** @type {*} */
+ var value;
+ result = ({ });
+ for (key in _Entities._entities) {
+ value = _Entities._entities[key];
+ if (typeof value === 'string') {
+ result[key] = value + "";
+ } else {
+ if (typeof value === 'number') {
+ result[key] = String.fromCharCode(value | 0);
+ }
+ }
+ }
+ return result;
+};
+
+var _Entities$entity_list$ = _Entities.entity_list$;
+
+/**
+ * class BitVector extends Object
+ * @constructor
+ */
+function BitVector() {
+}
+
+/**
+ * @constructor
+ */
+function BitVector$() {
+ /** @type {Array.<undefined|!number>} */
+ var _v$0;
+ /** @type {Array.<undefined|!number>} */
+ var _r$0;
+ _r$0 = this._r = [ ];
+ _v$0 = this._v = [ ];
+ _v$0.length = 0;
+ _r$0.length = 0;
+ this._size = 0;
+ this._size1 = 0;
+};
+
+BitVector$.prototype = new BitVector;
+
+/**
+ */
+BitVector.prototype.build$ = function () {
+ /** @type {!number} */
+ var i;
+ this._size1 = 0;
+ for (i = 0; i < this._v.length; i++) {
+ if (i % 8 === 0) {
+ this._r.push(true ? this._size1 : this._size - this._size1);
+ }
+ this._size1 += this._rank32$IIB(this._v[i], 32, true);
+ }
+};
+
+/**
+ */
+BitVector.prototype.clear$ = function () {
+ this._v.length = 0;
+ this._r.length = 0;
+ this._size = 0;
+ this._size1 = 0;
+};
+
+/**
+ * @return {!number}
+ */
+BitVector.prototype.size$ = function () {
+ return this._size;
+};
+
+/**
+ * @param {!boolean} b
+ * @return {!number}
+ */
+BitVector.prototype.size$B = function (b) {
+ return (b ? this._size1 : this._size - this._size1);
+};
+
+/**
+ * @param {!number} value
+ */
+BitVector.prototype.set$I = function (value) {
+ this.set$IB(value, true);
+};
+
+/**
+ * @param {!number} value
+ * @param {!boolean} flag
+ */
+BitVector.prototype.set$IB = function (value, flag) {
+ /** @type {!number} */
+ var q;
+ /** @type {!number} */
+ var r;
+ /** @type {!number} */
+ var m;
+ if (value >= this._size) {
+ this._size = (value + 1 | 0);
+ }
+ q = (value / 32 | 0);
+ r = (value % 32 | 0);
+ while (q >= this._v.length) {
+ this._v.push(0);
+ }
+ m = 0x1 << r;
+ if (flag) {
+ this._v[q] |= m;
+ } else {
+ this._v[q] &= ~ m;
+ }
+};
+
+/**
+ * @param {!number} value
+ * @return {!boolean}
+ */
+BitVector.prototype.get$I = function (value) {
+ /** @type {!number} */
+ var q;
+ /** @type {!number} */
+ var r;
+ /** @type {!number} */
+ var m;
+ if (value >= this._size) {
+ throw new Error("BitVector.get() : range error");
+ }
+ q = (value / 32 | 0);
+ r = (value % 32 | 0);
+ m = 0x1 << r;
+ return !! (this._v[q] & m);
+};
+
+/**
+ * @param {!number} i
+ * @return {!number}
+ */
+BitVector.prototype.rank$I = function (i) {
+ return this.rank$IB(i, true);
+};
+
+/**
+ * @param {!number} i
+ * @param {!boolean} b
+ * @return {!number}
+ */
+BitVector.prototype.rank$IB = function (i, b) {
+ /** @type {!number} */
+ var q_large;
+ /** @type {!number} */
+ var q_small;
+ /** @type {!number} */
+ var r;
+ /** @type {!number} */
+ var rank;
+ /** @type {!number} */
+ var begin;
+ /** @type {!number} */
+ var j;
+ if (i > this._size) {
+ throw new Error("BitVector.rank() : range error");
+ }
+ if (i === 0) {
+ return 0;
+ }
+ i--;
+ q_large = (Math.floor(i / 256) | 0);
+ q_small = (Math.floor(i / 32) | 0);
+ r = (Math.floor(i % 32) | 0);
+ rank = (this._r[q_large] | 0);
+ if (! b) {
+ rank = q_large * 256 - rank;
+ }
+ begin = q_large * 8;
+ for (j = begin; j < q_small; j++) {
+ rank += this._rank32$IIB(this._v[j], 32, b);
+ }
+ rank += this._rank32$IIB(this._v[q_small], r + 1, b);
+ return rank;
+};
+
+/**
+ * @param {!number} i
+ * @return {!number}
+ */
+BitVector.prototype.select$I = function (i) {
+ return this.select$IB(i, true);
+};
+
+/**
+ * @param {!number} i
+ * @param {!boolean} b
+ * @return {!number}
+ */
+BitVector.prototype.select$IB = function (i, b) {
+ /** @type {!number} */
+ var left;
+ /** @type {!number} */
+ var right;
+ /** @type {!number} */
+ var pivot;
+ /** @type {undefined|!number} */
+ var rank;
+ /** @type {!number} */
+ var j;
+ if (i >= (b ? this._size1 : this._size - this._size1)) {
+ throw new Error("BitVector.select() : range error");
+ }
+ left = 0;
+ right = this._r.length;
+ while (left < right) {
+ pivot = Math.floor((left + right) / 2);
+ rank = this._r[pivot];
+ if (! b) {
+ rank = pivot * 256 - rank;
+ }
+ if (i < rank) {
+ right = pivot;
+ } else {
+ left = pivot + 1;
+ }
+ }
+ right--;
+ if (b) {
+ i -= (this._r[right] | 0);
+ } else {
+ i -= (right * 256 - this._r[right] | 0);
+ }
+ j = right * 8;
+ while (1) {
+ rank = this._rank32$IIB(this._v[j], 32, b);
+ if (i < rank) {
+ break;
+ }
+ j++;
+ i -= (rank | 0);
+ }
+ return (j * 32 + this._select32$IIB(this._v[j], i, b) | 0);
+};
+
+/**
+ * @param {!number} x
+ * @param {!number} i
+ * @param {!boolean} b
+ * @return {!number}
+ */
+BitVector.prototype._rank32$IIB = function (x, i, b) {
+ if (! b) {
+ x = ~ x;
+ }
+ x <<= 32 - i;
+ x = ((x & 0xaaaaaaaa) >>> 1) + (x & 0x55555555);
+ x = ((x & 0xcccccccc) >>> 2) + (x & 0x33333333);
+ x = ((x & 0xf0f0f0f0) >>> 4) + (x & 0x0f0f0f0f);
+ x = ((x & 0xff00ff00) >>> 8) + (x & 0x00ff00ff);
+ x = ((x & 0xffff0000) >>> 16) + (x & 0x0000ffff);
+ return x;
+};
+
+/**
+ * @param {!number} x
+ * @param {!number} i
+ * @param {!boolean} b
+ * @return {!number}
+ */
+BitVector.prototype._select32$IIB = function (x, i, b) {
+ /** @type {!number} */
+ var x1;
+ /** @type {!number} */
+ var x2;
+ /** @type {!number} */
+ var x3;
+ /** @type {!number} */
+ var x4;
+ /** @type {!number} */
+ var x5;
+ /** @type {!number} */
+ var pos;
+ /** @type {!number} */
+ var v5;
+ /** @type {!number} */
+ var v4;
+ /** @type {!number} */
+ var v3;
+ /** @type {!number} */
+ var v2;
+ /** @type {!number} */
+ var v1;
+ /** @type {!number} */
+ var v0;
+ if (! b) {
+ x = ~ x;
+ }
+ x1 = ((x & 0xaaaaaaaa) >>> 1) + (x & 0x55555555);
+ x2 = ((x1 & 0xcccccccc) >>> 2) + (x1 & 0x33333333);
+ x3 = ((x2 & 0xf0f0f0f0) >>> 4) + (x2 & 0x0f0f0f0f);
+ x4 = ((x3 & 0xff00ff00) >>> 8) + (x3 & 0x00ff00ff);
+ x5 = ((x4 & 0xffff0000) >>> 16) + (x4 & 0x0000ffff);
+ i++;
+ pos = 0;
+ v5 = x5 & 0xffffffff;
+ if (i > v5) {
+ i -= (v5 | 0);
+ pos += 32;
+ }
+ v4 = x4 >>> pos & 0x0000ffff;
+ if (i > v4) {
+ i -= (v4 | 0);
+ pos += 16;
+ }
+ v3 = x3 >>> pos & 0x000000ff;
+ if (i > v3) {
+ i -= (v3 | 0);
+ pos += 8;
+ }
+ v2 = x2 >>> pos & 0x0000000f;
+ if (i > v2) {
+ i -= (v2 | 0);
+ pos += 4;
+ }
+ v1 = x1 >>> pos & 0x00000003;
+ if (i > v1) {
+ i -= (v1 | 0);
+ pos += 2;
+ }
+ v0 = x >>> pos & 0x00000001;
+ if (i > v0) {
+ i -= (v0 | 0);
+ pos += 1;
+ }
+ return (pos | 0);
+};
+
+/**
+ * @return {!string}
+ */
+BitVector.prototype.dump$ = function () {
+ /** @type {Array.<undefined|!string>} */
+ var contents;
+ contents = [ ];
+ contents.push(Binary$dump32bitNumber$N(this._size));
+ contents.push(Binary$dump32bitNumberList$AN(this._v));
+ return contents.join('');
+};
+
+/**
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+BitVector.prototype.dump$LCompressionReport$ = function (report) {
+ /** @type {Array.<undefined|!string>} */
+ var contents;
+ contents = [ ];
+ contents.push(Binary$dump32bitNumber$N(this._size));
+ CompressionReport$add$LCompressionReport$II(report, 2, 2);
+ contents.push(Binary$dump32bitNumberList$ANLCompressionReport$(this._v, report));
+ return contents.join('');
+};
+
+/**
+ * @param {!string} data
+ * @return {!number}
+ */
+BitVector.prototype.load$S = function (data) {
+ return this.load$SI(data, 0);
+};
+
+/**
+ * @param {!string} data
+ * @param {!number} offset
+ * @return {!number}
+ */
+BitVector.prototype.load$SI = function (data, offset) {
+ /** @type {LoadedNumberListResult} */
+ var result;
+ /** @type {!number} */
+ var result$0;
+ this._v.length = 0;
+ this._r.length = 0;
+ this._size = 0;
+ this._size1 = 0;
+ result$0 = data.charCodeAt(offset) * 65536 + data.charCodeAt(offset + 1);
+ this._size = (result$0 | 0);
+ result = Binary$load32bitNumberList$SI(data, offset + 2);
+ this._v = result.result;
+ this.build$();
+ return result.offset;
+};
+
+/**
+ * class WaveletMatrix extends Object
+ * @constructor
+ */
+function WaveletMatrix() {
+}
+
+/**
+ * @constructor
+ */
+function WaveletMatrix$() {
+ /** @type {Array.<undefined|BitVector>} */
+ var _bv$0;
+ /** @type {Array.<undefined|!number>} */
+ var _seps$0;
+ this._range = ({ });
+ _bv$0 = this._bv = [ ];
+ _seps$0 = this._seps = [ ];
+ this._bitsize = 16;
+ _bv$0.length = 0;
+ _seps$0.length = 0;
+ this._size = 0;
+};
+
+WaveletMatrix$.prototype = new WaveletMatrix;
+
+/**
+ * @return {!number}
+ */
+WaveletMatrix.prototype.bitsize$ = function () {
+ return this._bitsize;
+};
+
+/**
+ * @param {!number} charCode
+ */
+WaveletMatrix.prototype.setMaxCharCode$I = function (charCode) {
+ this._bitsize = (Math.ceil(Math.log(charCode) / 0.6931471805599453) | 0);
+};
+
+/**
+ */
+WaveletMatrix.prototype.clear$ = function () {
+ this._bv.length = 0;
+ this._seps.length = 0;
+ this._size = 0;
+};
+
+/**
+ * @param {!string} v
+ */
+WaveletMatrix.prototype.build$S = function (v) {
+ /** @type {!number} */
+ var size;
+ /** @type {!number} */
+ var bitsize;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var depth;
+ /** @type {Object.<string, undefined|!number>} */
+ var range_tmp;
+ /** @type {!number} */
+ var code;
+ /** @type {!boolean} */
+ var bit;
+ /** @type {!number} */
+ var key;
+ /** @type {Object.<string, undefined|!number>} */
+ var range_rev;
+ /** @type {!string} */
+ var range_key;
+ /** @type {!number} */
+ var value;
+ /** @type {!number} */
+ var pos0;
+ /** @type {undefined|!number} */
+ var pos1;
+ /** @type {!string} */
+ var range_rev_key;
+ /** @type {!number} */
+ var begin;
+ /** @type {undefined|!number} */
+ var end;
+ /** @type {!number} */
+ var num0;
+ /** @type {!number} */
+ var num1;
+ this._bv.length = 0;
+ this._seps.length = 0;
+ this._size = 0;
+ size = v.length;
+ bitsize = this._bitsize;
+ for (i = 0; i < bitsize; i++) {
+ this._bv.push(new BitVector$());
+ this._seps.push(0);
+ }
+ this._size = (size | 0);
+ for (i = 0; i < size; i++) {
+ this._bv[0].set$IB(i, this._uint2bit$II(v.charCodeAt(i), 0));
+ }
+ this._bv[0].build$();
+ this._seps[0] = this._bv[0].size$B(false);
+ this._range["0"] = 0;
+ this._range["1"] = this._seps[0];
+ depth = 1;
+ while (depth < bitsize) {
+ range_tmp = WaveletMatrix$_shallow_copy$HI(this._range);
+ for (i = 0; i < size; i++) {
+ code = v.charCodeAt(i);
+ bit = this._uint2bit$II(code, depth);
+ key = code >>> bitsize - depth;
+ this._bv[depth].set$IB(range_tmp[key + ""], bit);
+ range_tmp[key + ""]++;
+ }
+ this._bv[depth].build$();
+ this._seps[depth] = this._bv[depth].size$B(false);
+ range_rev = ({ });
+ for (range_key in this._range) {
+ value = this._range[range_key];
+ if (value != range_tmp[range_key]) {
+ range_rev[value + ""] = range_key | 0;
+ }
+ }
+ this._range = ({ });
+ pos0 = 0;
+ pos1 = this._seps[depth];
+ for (range_rev_key in range_rev) {
+ begin = range_rev_key | 0;
+ value = range_rev[range_rev_key];
+ end = range_tmp[value + ""];
+ num0 = this._bv[depth].rank$IB(end, false) - this._bv[depth].rank$IB(begin, false);
+ num1 = end - begin - num0;
+ if (num0 > 0) {
+ this._range[(value << 1) + ""] = (pos0 | 0);
+ pos0 += num0;
+ }
+ if (num1 > 0) {
+ this._range[(value << 1) + 1 + ""] = pos1;
+ pos1 += (num1 | 0);
+ }
+ }
+ depth++;
+ }
+};
+
+/**
+ * @return {!number}
+ */
+WaveletMatrix.prototype.size$ = function () {
+ return this._size;
+};
+
+/**
+ * @param {!number} c
+ * @return {!number}
+ */
+WaveletMatrix.prototype.size$I = function (c) {
+ return this.rank$II(this._size, c);
+};
+
+/**
+ * @param {!number} i
+ * @return {!number}
+ */
+WaveletMatrix.prototype.get$I = function (i) {
+ /** @type {!number} */
+ var value;
+ /** @type {!number} */
+ var depth;
+ /** @type {!boolean} */
+ var bit;
+ if (i >= this._size) {
+ throw new Error("WaveletMatrix.get() : range error");
+ }
+ value = 0;
+ depth = 0;
+ while (depth < this._bitsize) {
+ bit = this._bv[depth].get$I(i);
+ i = this._bv[depth].rank$IB(i, bit);
+ value <<= 1;
+ if (bit) {
+ i += this._seps[depth];
+ value += 1;
+ }
+ depth++;
+ }
+ return (value | 0);
+};
+
+/**
+ * @param {!number} i
+ * @param {!number} c
+ * @return {!number}
+ */
+WaveletMatrix.prototype.rank$II = function (i, c) {
+ /** @type {undefined|!number} */
+ var begin;
+ /** @type {!number} */
+ var end;
+ /** @type {!number} */
+ var depth;
+ /** @type {!boolean} */
+ var bit;
+ if (i > this._size) {
+ throw new Error("WaveletMatrix.rank(): range error");
+ }
+ if (i === 0) {
+ return 0;
+ }
+ begin = this._range[c + ""];
+ if (begin == null) {
+ return 0;
+ }
+ end = i;
+ depth = 0;
+ while (depth < this._bitsize) {
+ bit = this._uint2bit$II(c, depth);
+ end = this._bv[depth].rank$IB(end, bit);
+ if (bit) {
+ end += this._seps[depth];
+ }
+ depth++;
+ }
+ return (end - begin | 0);
+};
+
+/**
+ * @param {!number} i
+ * @param {!number} c
+ * @return {!number}
+ */
+WaveletMatrix.prototype.rank_less_than$II = function (i, c) {
+ /** @type {!number} */
+ var begin;
+ /** @type {!number} */
+ var end;
+ /** @type {!number} */
+ var depth;
+ /** @type {!number} */
+ var rlt;
+ /** @type {!number} */
+ var rank0_begin;
+ /** @type {!number} */
+ var rank0_end;
+ /** @type {Array.<undefined|!number>} */
+ var _seps$0;
+ if (i > this._size) {
+ throw new Error("WaveletMatrix.rank_less_than(): range error");
+ }
+ if (i === 0) {
+ return 0;
+ }
+ begin = 0;
+ end = i;
+ depth = 0;
+ rlt = 0;
+ while (depth < this._bitsize) {
+ rank0_begin = this._bv[depth].rank$IB(begin, false);
+ rank0_end = this._bv[depth].rank$IB(end, false);
+ if (this._uint2bit$II(c, depth)) {
+ rlt += rank0_end - rank0_begin;
+ begin += (_seps$0 = this._seps)[depth] - rank0_begin;
+ end += _seps$0[depth] - rank0_end;
+ } else {
+ begin = rank0_begin;
+ end = rank0_end;
+ }
+ depth++;
+ }
+ return (rlt | 0);
+};
+
+/**
+ * @return {!string}
+ */
+WaveletMatrix.prototype.dump$ = function () {
+ /** @type {Array.<undefined|!string>} */
+ var contents;
+ /** @type {!number} */
+ var i;
+ /** @type {Array.<undefined|!string>} */
+ var range_contents;
+ /** @type {!number} */
+ var counter;
+ /** @type {!string} */
+ var key;
+ contents = [ Binary$dump16bitNumber$I(this._bitsize), Binary$dump32bitNumber$N(this._size) ];
+ for (i = 0; i < this._bitsize; i++) {
+ contents.push(this._bv[i].dump$());
+ }
+ for (i = 0; i < this._bitsize; i++) {
+ contents.push(Binary$dump32bitNumber$N(this._seps[i]));
+ }
+ range_contents = [ ];
+ counter = 0;
+ for (key in this._range) {
+ range_contents.push(Binary$dump32bitNumber$N(key | 0));
+ range_contents.push(Binary$dump32bitNumber$N(this._range[key]));
+ counter++;
+ }
+ contents.push(Binary$dump32bitNumber$N(counter));
+ return contents.join('') + range_contents.join('');
+};
+
+/**
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+WaveletMatrix.prototype.dump$LCompressionReport$ = function (report) {
+ /** @type {Array.<undefined|!string>} */
+ var contents;
+ /** @type {!number} */
+ var i;
+ /** @type {Array.<undefined|!string>} */
+ var range_contents;
+ /** @type {!number} */
+ var counter;
+ /** @type {!string} */
+ var key;
+ contents = [ Binary$dump16bitNumber$I(this._bitsize), Binary$dump32bitNumber$N(this._size) ];
+ CompressionReport$add$LCompressionReport$II(report, 3, 3);
+ for (i = 0; i < this._bitsize; i++) {
+ contents.push(this._bv[i].dump$LCompressionReport$(report));
+ }
+ for (i = 0; i < this._bitsize; i++) {
+ contents.push(Binary$dump32bitNumber$N(this._seps[i]));
+ CompressionReport$add$LCompressionReport$II(report, 2, 2);
+ }
+ range_contents = [ ];
+ counter = 0;
+ for (key in this._range) {
+ range_contents.push(Binary$dump32bitNumber$N(key | 0));
+ range_contents.push(Binary$dump32bitNumber$N(this._range[key]));
+ CompressionReport$add$LCompressionReport$II(report, 4, 4);
+ counter++;
+ }
+ CompressionReport$add$LCompressionReport$II(report, 2, 2);
+ contents.push(Binary$dump32bitNumber$N(counter));
+ return contents.join('') + range_contents.join('');
+};
+
+/**
+ * @param {!string} data
+ * @return {!number}
+ */
+WaveletMatrix.prototype.load$S = function (data) {
+ return this.load$SI(data, 0);
+};
+
+/**
+ * @param {!string} data
+ * @param {!number} offset
+ * @return {!number}
+ */
+WaveletMatrix.prototype.load$SI = function (data, offset) {
+ /** @type {!number} */
+ var i;
+ /** @type {BitVector} */
+ var bit_vector;
+ /** @type {!number} */
+ var range_size;
+ /** @type {!number} */
+ var value;
+ /** @type {!number} */
+ var offset$0;
+ /** @type {!number} */
+ var result$0;
+ /** @type {!number} */
+ var result$1;
+ /** @type {!number} */
+ var result$2;
+ this._bv.length = 0;
+ this._seps.length = 0;
+ this._size = 0;
+ offset$0 = offset++;
+ this._bitsize = (data.charCodeAt(offset$0) | 0);
+ result$0 = data.charCodeAt(offset) * 65536 + data.charCodeAt(offset + 1);
+ this._size = (result$0 | 0);
+ offset += 2;
+ for (i = 0; i < this._bitsize; i++) {
+ bit_vector = new BitVector$();
+ offset = bit_vector.load$SI(data, offset);
+ this._bv.push(bit_vector);
+ }
+ for (i = 0; i < this._bitsize; (i++, offset += 2)) {
+ this._seps.push(Binary$load32bitNumber$SI(data, offset));
+ }
+ result$1 = data.charCodeAt(offset) * 65536 + data.charCodeAt(offset + 1);
+ range_size = result$1;
+ offset += 2;
+ for (i = 0; i < range_size; (i++, offset += 4)) {
+ result$2 = data.charCodeAt(offset) * 65536 + data.charCodeAt(offset + 1);
+ value = Binary$load32bitNumber$SI(data, offset + 2);
+ this._range[result$2 + ""] = (value | 0);
+ }
+ return offset;
+};
+
+/**
+ * @param {Object.<string, undefined|!number>} input
+ * @return {Object.<string, undefined|!number>}
+ */
+WaveletMatrix._shallow_copy$HI = function (input) {
+ /** @type {Object.<string, undefined|!number>} */
+ var result;
+ /** @type {!string} */
+ var key;
+ result = ({ });
+ for (key in input) {
+ result[key] = input[key];
+ }
+ return result;
+};
+
+var WaveletMatrix$_shallow_copy$HI = WaveletMatrix._shallow_copy$HI;
+
+/**
+ * @param {!number} c
+ * @param {!number} i
+ * @return {!boolean}
+ */
+WaveletMatrix.prototype._uint2bit$II = function (c, i) {
+ return (c >>> this._bitsize - 1 - i & 0x1) === 0x1;
+};
+
+/**
+ * class BurrowsWheelerTransform extends Object
+ * @constructor
+ */
+function BurrowsWheelerTransform() {
+}
+
+/**
+ * @constructor
+ */
+function BurrowsWheelerTransform$() {
+ this._str = "";
+ this._size = 0;
+ this._head = 0;
+ this._suffixarray = [ ];
+};
+
+BurrowsWheelerTransform$.prototype = new BurrowsWheelerTransform;
+
+/**
+ * @param {BurrowsWheelerTransform} $this
+ * @return {!number}
+ */
+BurrowsWheelerTransform.size$LBurrowsWheelerTransform$ = function ($this) {
+ return $this._size;
+};
+
+var BurrowsWheelerTransform$size$LBurrowsWheelerTransform$ = BurrowsWheelerTransform.size$LBurrowsWheelerTransform$;
+
+/**
+ * @param {BurrowsWheelerTransform} $this
+ * @return {!number}
+ */
+BurrowsWheelerTransform.head$LBurrowsWheelerTransform$ = function ($this) {
+ return $this._head;
+};
+
+var BurrowsWheelerTransform$head$LBurrowsWheelerTransform$ = BurrowsWheelerTransform.head$LBurrowsWheelerTransform$;
+
+/**
+ * @param {BurrowsWheelerTransform} $this
+ */
+BurrowsWheelerTransform.clear$LBurrowsWheelerTransform$ = function ($this) {
+ $this._str = "";
+ $this._size = 0;
+ $this._head = 0;
+ $this._suffixarray.length = 0;
+};
+
+var BurrowsWheelerTransform$clear$LBurrowsWheelerTransform$ = BurrowsWheelerTransform.clear$LBurrowsWheelerTransform$;
+
+/**
+ * @param {BurrowsWheelerTransform} $this
+ * @param {!string} str
+ */
+BurrowsWheelerTransform.build$LBurrowsWheelerTransform$S = function ($this, str) {
+ /** @type {!string} */
+ var _str$0;
+ /** @type {Array.<undefined|!number>} */
+ var _suffixarray$0;
+ _str$0 = $this._str = str;
+ $this._size = _str$0.length;
+ _suffixarray$0 = $this._suffixarray = SAIS$make$S(str);
+ $this._head = (_suffixarray$0.indexOf(0) | 0);
+};
+
+var BurrowsWheelerTransform$build$LBurrowsWheelerTransform$S = BurrowsWheelerTransform.build$LBurrowsWheelerTransform$S;
+
+/**
+ * @param {BurrowsWheelerTransform} $this
+ * @param {!number} i
+ * @return {!string}
+ */
+BurrowsWheelerTransform.get$LBurrowsWheelerTransform$I = function ($this, i) {
+ /** @type {!number} */
+ var size;
+ /** @type {!number} */
+ var index;
+ size = $this._size;
+ if (i >= size) {
+ throw new Error("BurrowsWheelerTransform.get() : range error");
+ }
+ index = ($this._suffixarray[i] + size - 1) % size;
+ return $this._str.charAt(index);
+};
+
+var BurrowsWheelerTransform$get$LBurrowsWheelerTransform$I = BurrowsWheelerTransform.get$LBurrowsWheelerTransform$I;
+
+/**
+ * @param {BurrowsWheelerTransform} $this
+ * @return {!string}
+ */
+BurrowsWheelerTransform.get$LBurrowsWheelerTransform$ = function ($this) {
+ /** @type {Array.<undefined|!string>} */
+ var str;
+ /** @type {!number} */
+ var size;
+ /** @type {!number} */
+ var i;
+ str = [ ];
+ size = $this._size;
+ for (i = 0; i < size; i++) {
+ str.push(BurrowsWheelerTransform$get$LBurrowsWheelerTransform$I($this, i));
+ }
+ return str.join("");
+};
+
+var BurrowsWheelerTransform$get$LBurrowsWheelerTransform$ = BurrowsWheelerTransform.get$LBurrowsWheelerTransform$;
+
+/**
+ * @param {BurrowsWheelerTransform} $this
+ * @param {!string} replace
+ * @return {!string}
+ */
+BurrowsWheelerTransform.get$LBurrowsWheelerTransform$S = function ($this, replace) {
+ /** @type {!string} */
+ var result;
+ result = BurrowsWheelerTransform$get$LBurrowsWheelerTransform$($this);
+ return result.replace(BurrowsWheelerTransform.END_MARKER, replace);
+};
+
+var BurrowsWheelerTransform$get$LBurrowsWheelerTransform$S = BurrowsWheelerTransform.get$LBurrowsWheelerTransform$S;
+
+/**
+ * class OArray extends Object
+ * @constructor
+ */
+function OArray() {
+}
+
+/**
+ * @constructor
+ * @param {Array.<undefined|!number>} array
+ */
+function OArray$AI(array) {
+ this.array = array;
+ this.offset = 0;
+};
+
+OArray$AI.prototype = new OArray;
+
+/**
+ * @constructor
+ * @param {Array.<undefined|!number>} array
+ * @param {!number} offset
+ */
+function OArray$AII(array, offset) {
+ this.array = array;
+ this.offset = offset;
+};
+
+OArray$AII.prototype = new OArray;
+
+/**
+ * @param {OArray} $this
+ * @param {!number} index
+ * @return {!number}
+ */
+OArray.get$LOArray$I = function ($this, index) {
+ return $this.array[index + $this.offset];
+};
+
+var OArray$get$LOArray$I = OArray.get$LOArray$I;
+
+/**
+ * @param {OArray} $this
+ * @param {!number} index
+ * @param {!number} value
+ */
+OArray.set$LOArray$II = function ($this, index, value) {
+ $this.array[index + $this.offset] = value;
+};
+
+var OArray$set$LOArray$II = OArray.set$LOArray$II;
+
+/**
+ * @param {OArray} $this
+ * @param {!number} index
+ * @return {!boolean}
+ */
+OArray.isS$LOArray$I = function ($this, index) {
+ /** @type {Array.<undefined|!number>} */
+ var array$0;
+ /** @type {!number} */
+ var offset$0;
+ return (array$0 = $this.array)[index + (offset$0 = $this.offset)] < array$0[index + offset$0 + 1];
+};
+
+var OArray$isS$LOArray$I = OArray.isS$LOArray$I;
+
+/**
+ * @param {OArray} $this
+ * @param {!number} index1
+ * @param {!number} index2
+ * @return {!boolean}
+ */
+OArray.compare$LOArray$II = function ($this, index1, index2) {
+ /** @type {Array.<undefined|!number>} */
+ var array$0;
+ /** @type {!number} */
+ var offset$0;
+ return (array$0 = $this.array)[index1 + (offset$0 = $this.offset)] == array$0[index2 + offset$0];
+};
+
+var OArray$compare$LOArray$II = OArray.compare$LOArray$II;
+
+/**
+ * class SAIS extends Object
+ * @constructor
+ */
+function SAIS() {
+}
+
+/**
+ * @constructor
+ */
+function SAIS$() {
+};
+
+SAIS$.prototype = new SAIS;
+
+/**
+ * @param {BitVector} t
+ * @param {!number} i
+ * @return {!boolean}
+ */
+SAIS._isLMS$LBitVector$I = function (t, i) {
+ return i > 0 && t.get$I(i) && ! t.get$I(i - 1);
+};
+
+var SAIS$_isLMS$LBitVector$I = SAIS._isLMS$LBitVector$I;
+
+/**
+ * @param {OArray} s
+ * @param {Array.<undefined|!number>} bkt
+ * @param {!number} n
+ * @param {!number} K
+ * @param {!boolean} end
+ */
+SAIS._getBuckets$LOArray$AIIIB = function (s, bkt, n, K, end) {
+ /** @type {!number} */
+ var sum;
+ /** @type {!number} */
+ var i;
+ sum = 0;
+ for (i = 0; i <= K; i++) {
+ bkt[i] = 0;
+ }
+ for (i = 0; i < n; i++) {
+ bkt[OArray$get$LOArray$I(s, i)]++;
+ }
+ for (i = 0; i <= K; i++) {
+ sum += bkt[i];
+ bkt[i] = ((end ? sum : sum - bkt[i]) | 0);
+ }
+};
+
+var SAIS$_getBuckets$LOArray$AIIIB = SAIS._getBuckets$LOArray$AIIIB;
+
+/**
+ * @param {BitVector} t
+ * @param {Array.<undefined|!number>} SA
+ * @param {OArray} s
+ * @param {Array.<undefined|!number>} bkt
+ * @param {!number} n
+ * @param {!number} K
+ * @param {!boolean} end
+ */
+SAIS._induceSAl$LBitVector$AILOArray$AIIIB = function (t, SA, s, bkt, n, K, end) {
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var j;
+ SAIS$_getBuckets$LOArray$AIIIB(s, bkt, n, K, end);
+ for (i = 0; i < n; i++) {
+ j = SA[i] - 1;
+ if (j >= 0 && ! t.get$I(j)) {
+ SA[bkt[OArray$get$LOArray$I(s, j)]++] = (j | 0);
+ }
+ }
+};
+
+var SAIS$_induceSAl$LBitVector$AILOArray$AIIIB = SAIS._induceSAl$LBitVector$AILOArray$AIIIB;
+
+/**
+ * @param {BitVector} t
+ * @param {Array.<undefined|!number>} SA
+ * @param {OArray} s
+ * @param {Array.<undefined|!number>} bkt
+ * @param {!number} n
+ * @param {!number} K
+ * @param {!boolean} end
+ */
+SAIS._induceSAs$LBitVector$AILOArray$AIIIB = function (t, SA, s, bkt, n, K, end) {
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var j;
+ SAIS$_getBuckets$LOArray$AIIIB(s, bkt, n, K, end);
+ for (i = n - 1; i >= 0; i--) {
+ j = SA[i] - 1;
+ if (j >= 0 && t.get$I(j)) {
+ SA[-- bkt[OArray$get$LOArray$I(s, j)]] = (j | 0);
+ }
+ }
+};
+
+var SAIS$_induceSAs$LBitVector$AILOArray$AIIIB = SAIS._induceSAs$LBitVector$AILOArray$AIIIB;
+
+/**
+ * @param {!string} source
+ * @return {Array.<undefined|!number>}
+ */
+SAIS.make$S = function (source) {
+ /** @type {Array.<undefined|!number>} */
+ var charCodes;
+ /** @type {!number} */
+ var maxCode;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var code;
+ /** @type {Array.<undefined|!number>} */
+ var SA;
+ /** @type {OArray} */
+ var s;
+ charCodes = [ ];
+ charCodes.length = source.length;
+ maxCode = 0;
+ for (i = 0; i < source.length; i++) {
+ code = source.charCodeAt(i);
+ charCodes[i] = (code | 0);
+ maxCode = (code > maxCode ? code : maxCode);
+ }
+ SA = [ ];
+ SA.length = source.length;
+ s = ({offset: 0, array: charCodes});
+ SAIS$_make$LOArray$AIII(s, SA, source.length, maxCode);
+ return SA;
+};
+
+var SAIS$make$S = SAIS.make$S;
+
+/**
+ * @param {OArray} s
+ * @param {Array.<undefined|!number>} SA
+ * @param {!number} n
+ * @param {!number} K
+ */
+SAIS._make$LOArray$AIII = function (s, SA, n, K) {
+ /** @type {BitVector} */
+ var t;
+ /** @type {!number} */
+ var i;
+ /** @type {Array.<undefined|!number>} */
+ var bkt;
+ /** @type {!number} */
+ var n1;
+ /** @type {!number} */
+ var name;
+ /** @type {!number} */
+ var prev;
+ /** @type {undefined|!number} */
+ var pos;
+ /** @type {!boolean} */
+ var diff;
+ /** @type {!number} */
+ var d;
+ /** @type {!number} */
+ var j;
+ /** @type {Array.<undefined|!number>} */
+ var SA1;
+ /** @type {OArray} */
+ var s1;
+ /** @type {!number} */
+ var i$0;
+ /** @type {!number} */
+ var index$0;
+ t = new BitVector$();
+ t.set$IB(n - 2, false);
+ t.set$IB(n - 1, true);
+ for (i = n - 3; i >= 0; i--) {
+ t.set$IB(i, OArray$isS$LOArray$I(s, i) || OArray$compare$LOArray$II(s, i, i + 1) && t.get$I(i + 1));
+ }
+ bkt = [ ];
+ bkt.length = K + 1;
+ SAIS$_getBuckets$LOArray$AIIIB(s, bkt, n, K, true);
+ for (i = 0; i < n; i++) {
+ SA[i] = -1;
+ }
+ for (i = 1; i < n; i++) {
+ if (SAIS$_isLMS$LBitVector$I(t, i)) {
+ SA[-- bkt[OArray$get$LOArray$I(s, i)]] = (i | 0);
+ }
+ }
+ SAIS$_induceSAl$LBitVector$AILOArray$AIIIB(t, SA, s, bkt, n, K, false);
+ SAIS$_induceSAs$LBitVector$AILOArray$AIIIB(t, SA, s, bkt, n, K, true);
+ n1 = 0;
+ for (i = 0; i < n; i++) {
+ i$0 = SA[i];
+ if (i$0 > 0 && t.get$I(i$0) && ! t.get$I(i$0 - 1)) {
+ SA[n1++] = SA[i];
+ }
+ }
+ for (i = n1; i < n; i++) {
+ SA[i] = -1;
+ }
+ name = 0;
+ prev = -1;
+ for (i = 0; i < n1; i++) {
+ pos = SA[i];
+ diff = false;
+ for (d = 0; d < n; d++) {
+ if (prev === -1 || ! OArray$compare$LOArray$II(s, pos + d, prev + d) || t.get$I(pos + d) !== t.get$I(prev + d)) {
+ diff = true;
+ break;
+ } else {
+ if (d > 0 && (SAIS$_isLMS$LBitVector$I(t, pos + d) || SAIS$_isLMS$LBitVector$I(t, prev + d))) {
+ break;
+ }
+ }
+ }
+ if (diff) {
+ name++;
+ prev = pos;
+ }
+ pos = ((pos % 2 === 0 ? pos / 2 : (pos - 1) / 2) | 0);
+ SA[n1 + pos] = (name - 1 | 0);
+ }
+ for ((i = n - 1, j = n - 1); i >= n1; i--) {
+ if (SA[i] >= 0) {
+ SA[j--] = SA[i];
+ }
+ }
+ SA1 = SA;
+ s1 = ({offset: n - n1, array: SA});
+ if (name < n1) {
+ SAIS$_make$LOArray$AIII(s1, SA1, n1, name - 1);
+ } else {
+ for (i = 0; i < n1; i++) {
+ SA1[OArray$get$LOArray$I(s1, i)] = (i | 0);
+ }
+ }
+ bkt = [ ];
+ bkt.length = K + 1;
+ SAIS$_getBuckets$LOArray$AIIIB(s, bkt, n, K, true);
+ for ((i = 1, j = 0); i < n; i++) {
+ if (SAIS$_isLMS$LBitVector$I(t, i)) {
+ OArray$set$LOArray$II(s1, j++, i);
+ }
+ }
+ for (i = 0; i < n1; i++) {
+ index$0 = SA1[i];
+ SA1[i] = s1.array[index$0 + s1.offset];
+ }
+ for (i = n1; i < n; i++) {
+ SA[i] = -1;
+ }
+ for (i = n1 - 1; i >= 0; i--) {
+ j = SA[i];
+ SA[i] = -1;
+ SA[-- bkt[OArray$get$LOArray$I(s, j)]] = (j | 0);
+ }
+ SAIS$_induceSAl$LBitVector$AILOArray$AIIIB(t, SA, s, bkt, n, K, false);
+ SAIS$_induceSAs$LBitVector$AILOArray$AIIIB(t, SA, s, bkt, n, K, true);
+};
+
+var SAIS$_make$LOArray$AIII = SAIS._make$LOArray$AIII;
+
+OktaviaSearch._stemmer = null;
+OktaviaSearch._instance = null;
+$__jsx_lazy_init(Oktavia, "eof", function () {
+ return String.fromCharCode(0);
+});
+$__jsx_lazy_init(Oktavia, "eob", function () {
+ return String.fromCharCode(1);
+});
+$__jsx_lazy_init(Oktavia, "unknown", function () {
+ return String.fromCharCode(3);
+});
+Binary._base64EncodeChars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
+$__jsx_lazy_init(Binary, "_base64DecodeChars", function () {
+ return [ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 62, -1, -1, -1, 63, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, -1, -1, -1, -1, -1, -1, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -1, -1, -1, -1, -1, -1, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, -1, -1, -1, -1 ];
+});
+$__jsx_lazy_init(Style, "console", function () {
+ return ({ 'title': [ '\x1B[32m\x1b[4m', '\x1B[39m\x1b[0m' ], 'url': [ '\x1B[34m', '\x1B[39m' ], 'hit': [ '\x1B[4m', '\x1B[0m' ], 'del': [ '\x1B[9m', '\x1B[0m' ], 'summary': [ '\x1B[90m', '\x1B[39m' ] });
+});
+$__jsx_lazy_init(Style, "html", function () {
+ return ({ 'title': [ '<span class="title">', '</span>' ], 'url': [ '<span class="url">', '</span>' ], 'hit': [ '<span class="hit">', '</span>' ], 'del': [ '<del>', '</del>' ], 'summary': [ '<span class="reuslt">', '</span>' ] });
+});
+$__jsx_lazy_init(Style, "ignore", function () {
+ return ({ 'tilte': [ '', '' ], 'url': [ '', '' ], 'hit': [ '', '' ], 'del': [ '', '' ], 'summary': [ '', '' ] });
+});
+DanishStemmer.serialVersionUID = 1;
+$__jsx_lazy_init(DanishStemmer, "methodObject", function () {
+ return new DanishStemmer$();
+});
+$__jsx_lazy_init(DanishStemmer, "a_0", function () {
+ return [ new Among$SII("hed", -1, 1), new Among$SII("ethed", 0, 1), new Among$SII("ered", -1, 1), new Among$SII("e", -1, 1), new Among$SII("erede", 3, 1), new Among$SII("ende", 3, 1), new Among$SII("erende", 5, 1), new Among$SII("ene", 3, 1), new Among$SII("erne", 3, 1), new Among$SII("ere", 3, 1), new Among$SII("en", -1, 1), new Among$SII("heden", 10, 1), new Among$SII("eren", 10, 1), new Among$SII("er", -1, 1), new Among$SII("heder", 13, 1), new Among$SII("erer", 13, 1), new Among$SII("s", -1, 2), new Among$SII("heds", 16, 1), new Among$SII("es", 16, 1), new Among$SII("endes", 18, 1), new Among$SII("erendes", 19, 1), new Among$SII("enes", 18, 1), new Among$SII("ernes", 18, 1), new Among$SII("eres", 18, 1), new Among$SII("ens", 16, 1), new Among$SII("hedens", 24, 1), new Among$SII("erens", 24, 1), new Among$SII("ers", 16, 1), new Among$SII("ets", 16, 1), new Among$SII("erets", 28, 1), new Among$SII("et", -1, 1), new Among$SII("eret", 30, 1) ];
+});
+$__jsx_lazy_init(DanishStemmer, "a_1", function () {
+ return [ new Among$SII("gd", -1, -1), new Among$SII("dt", -1, -1), new Among$SII("gt", -1, -1), new Among$SII("kt", -1, -1) ];
+});
+$__jsx_lazy_init(DanishStemmer, "a_2", function () {
+ return [ new Among$SII("ig", -1, 1), new Among$SII("lig", 0, 1), new Among$SII("elig", 1, 1), new Among$SII("els", -1, 1), new Among$SII("l\u00F8st", -1, 2) ];
+});
+$__jsx_lazy_init(DanishStemmer, "g_v", function () {
+ return [ 17, 65, 16, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 48, 0, 128 ];
+});
+$__jsx_lazy_init(DanishStemmer, "g_s_ending", function () {
+ return [ 239, 254, 42, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16 ];
+});
+$__jsx_lazy_init(_Common, "buffers", function () {
+ return [ "comment", "sgmlDecl", "textNode", "tagName", "doctype", "procInstName", "procInstBody", "entity", "attribName", "attribValue", "cdata", "script" ];
+});
+$__jsx_lazy_init(_Common, "EVENTS", function () {
+ return [ "text", "processinginstruction", "sgmldeclaration", "doctype", "comment", "attribute", "opentag", "closetag", "opencdata", "cdata", "clo_State.CDATA", "error", "end", "ready", "script", "opennamespace", "closenamespace" ];
+});
+_Common.MAX_BUFFER_LENGTH = 65536;
+_State.BEGIN = 1;
+_State.TEXT = 2;
+_State.TEXT_ENTITY = 3;
+_State.OPEN_WAKA = 4;
+_State.SGML_DECL = 5;
+_State.SGML_DECL_QUOTED = 6;
+_State.DOCTYPE = 7;
+_State.DOCTYPE_QUOTED = 8;
+_State.DOCTYPE_DTD = 9;
+_State.DOCTYPE_DTD_QUOTED = 10;
+_State.COMMENT_STARTING = 11;
+_State.COMMENT = 12;
+_State.COMMENT_ENDING = 13;
+_State.COMMENT_ENDED = 14;
+_State.CDATA = 15;
+_State.CDATA_ENDING = 16;
+_State.CDATA_ENDING_2 = 17;
+_State.PROC_INST = 18;
+_State.PROC_INST_BODY = 19;
+_State.PROC_INST_ENDING = 20;
+_State.OPEN_TAG = 21;
+_State.OPEN_TAG_SLASH = 22;
+_State.ATTRIB = 23;
+_State.ATTRIB_NAME = 24;
+_State.ATTRIB_NAME_SAW_WHITE = 25;
+_State.ATTRIB_VALUE = 26;
+_State.ATTRIB_VALUE_QUOTED = 27;
+_State.ATTRIB_VALUE_UNQUOTED = 28;
+_State.ATTRIB_VALUE_ENTITY_Q = 29;
+_State.ATTRIB_VALUE_ENTITY_U = 30;
+_State.CLOSE_TAG = 31;
+_State.CLOSE_TAG_SAW_WHITE = 32;
+_State.SCRIPT = 33;
+_State.SCRIPT_ENDING = 34;
+$__jsx_lazy_init(_Entities, "_entities", function () {
+ return ({ "amp": "&", "gt": ">", "lt": "<", "quot": "\"", "apos": "'", "AElig": 198, "Aacute": 193, "Acirc": 194, "Agrave": 192, "Aring": 197, "Atilde": 195, "Auml": 196, "Ccedil": 199, "ETH": 208, "Eacute": 201, "Ecirc": 202, "Egrave": 200, "Euml": 203, "Iacute": 205, "Icirc": 206, "Igrave": 204, "Iuml": 207, "Ntilde": 209, "Oacute": 211, "Ocirc": 212, "Ograve": 210, "Oslash": 216, "Otilde": 213, "Ouml": 214, "THORN": 222, "Uacute": 218, "Ucirc": 219, "Ugrave": 217, "Uuml": 220, "Yacute": 221, "aacute": 225, "acirc": 226, "aelig": 230, "agrave": 224, "aring": 229, "atilde": 227, "auml": 228, "ccedil": 231, "eacute": 233, "ecirc": 234, "egrave": 232, "eth": 240, "euml": 235, "iacute": 237, "icirc": 238, "igrave": 236, "iuml": 239, "ntilde": 241, "oacute": 243, "ocirc": 244, "ograve": 242, "oslash": 248, "otilde": 245, "ouml": 246, "szlig": 223, "thorn": 254, "uacute": 250, "ucirc": 251, "ugrave": 249, "uuml": 252, "yacute": 253, "yuml": 255, "copy": 169, "reg": 174, "nbsp": 160, "iexcl": 161, "cent": 162, "pound": 163, "curren": 164, "yen": 165, "brvbar": 166, "sect": 167, "uml": 168, "ordf": 170, "laquo": 171, "not": 172, "shy": 173, "macr": 175, "deg": 176, "plusmn": 177, "sup1": 185, "sup2": 178, "sup3": 179, "acute": 180, "micro": 181, "para": 182, "middot": 183, "cedil": 184, "ordm": 186, "raquo": 187, "frac14": 188, "frac12": 189, "frac34": 190, "iquest": 191, "times": 215, "divide": 247, "OElig": 338, "oelig": 339, "Scaron": 352, "scaron": 353, "Yuml": 376, "fnof": 402, "circ": 710, "tilde": 732, "Alpha": 913, "Beta": 914, "Gamma": 915, "Delta": 916, "Epsilon": 917, "Zeta": 918, "Eta": 919, "Theta": 920, "Iota": 921, "Kappa": 922, "Lambda": 923, "Mu": 924, "Nu": 925, "Xi": 926, "Omicron": 927, "Pi": 928, "Rho": 929, "Sigma": 931, "Tau": 932, "Upsilon": 933, "Phi": 934, "Chi": 935, "Psi": 936, "Omega": 937, "alpha": 945, "beta": 946, "gamma": 947, "delta": 948, "epsilon": 949, "zeta": 950, "eta": 951, "theta": 952, "iota": 953, "kappa": 954, "lambda": 955, "mu": 956, "nu": 957, "xi": 958, "omicron": 959, "pi": 960, "rho": 961, "sigmaf": 962, "sigma": 963, "tau": 964, "upsilon": 965, "phi": 966, "chi": 967, "psi": 968, "omega": 969, "thetasym": 977, "upsih": 978, "piv": 982, "ensp": 8194, "emsp": 8195, "thinsp": 8201, "zwnj": 8204, "zwj": 8205, "lrm": 8206, "rlm": 8207, "ndash": 8211, "mdash": 8212, "lsquo": 8216, "rsquo": 8217, "sbquo": 8218, "ldquo": 8220, "rdquo": 8221, "bdquo": 8222, "dagger": 8224, "Dagger": 8225, "bull": 8226, "hellip": 8230, "permil": 8240, "prime": 8242, "Prime": 8243, "lsaquo": 8249, "rsaquo": 8250, "oline": 8254, "frasl": 8260, "euro": 8364, "image": 8465, "weierp": 8472, "real": 8476, "trade": 8482, "alefsym": 8501, "larr": 8592, "uarr": 8593, "rarr": 8594, "darr": 8595, "harr": 8596, "crarr": 8629, "lArr": 8656, "uArr": 8657, "rArr": 8658, "dArr": 8659, "hArr": 8660, "forall": 8704, "part": 8706, "exist": 8707, "empty": 8709, "nabla": 8711, "isin": 8712, "notin": 8713, "ni": 8715, "prod": 8719, "sum": 8721, "minus": 8722, "lowast": 8727, "radic": 8730, "prop": 8733, "infin": 8734, "ang": 8736, "and": 8743, "or": 8744, "cap": 8745, "cup": 8746, "int": 8747, "there4": 8756, "sim": 8764, "cong": 8773, "asymp": 8776, "ne": 8800, "equiv": 8801, "le": 8804, "ge": 8805, "sub": 8834, "sup": 8835, "nsub": 8836, "sube": 8838, "supe": 8839, "oplus": 8853, "otimes": 8855, "perp": 8869, "sdot": 8901, "lceil": 8968, "rceil": 8969, "lfloor": 8970, "rfloor": 8971, "lang": 9001, "rang": 9002, "loz": 9674, "spades": 9824, "clubs": 9827, "hearts": 9829, "diams": 9830 });
+});
+BitVector.SMALL_BLOCK_SIZE = 32;
+BitVector.LARGE_BLOCK_SIZE = 256;
+BitVector.BLOCK_RATE = 8;
+$__jsx_lazy_init(BurrowsWheelerTransform, "END_MARKER", function () {
+ return String.fromCharCode(0);
+});
+var $__jsx_classMap = {
+ "tool/web/oktavia-danish-search.jsx": {
+ _Main: _Main,
+ _Main$: _Main$
+ },
+ "tool/web/oktavia-search.jsx": {
+ _Result: _Result,
+ _Result$SSSI: _Result$SSSI,
+ _Proposal: _Proposal,
+ _Proposal$SSI: _Proposal$SSI,
+ OktaviaSearch: OktaviaSearch,
+ OktaviaSearch$I: OktaviaSearch$I,
+ _Main: _Main$0,
+ _Main$: _Main$0$
+ },
+ "src/oktavia.jsx": {
+ Oktavia: Oktavia,
+ Oktavia$: Oktavia$
+ },
+ "src/binary-util.jsx": {
+ Binary: Binary,
+ Binary$: Binary$,
+ LoadedStringResult: LoadedStringResult,
+ LoadedStringResult$SI: LoadedStringResult$SI,
+ LoadedStringListResult: LoadedStringListResult,
+ LoadedStringListResult$SI: LoadedStringListResult$SI,
+ LoadedStringListMapResult: LoadedStringListMapResult,
+ LoadedStringListMapResult$SI: LoadedStringListMapResult$SI,
+ LoadedNumberListResult: LoadedNumberListResult,
+ LoadedNumberListResult$SI: LoadedNumberListResult$SI,
+ CompressionReport: CompressionReport,
+ CompressionReport$: CompressionReport$
+ },
+ "src/query.jsx": {
+ Query: Query,
+ Query$: Query$
+ },
+ "src/query-string-parser.jsx": {
+ QueryStringParser: QueryStringParser,
+ QueryStringParser$: QueryStringParser$
+ },
+ "src/search-result.jsx": {
+ Proposal: Proposal,
+ Proposal$II: Proposal$II,
+ Position: Position,
+ Position$SIB: Position$SIB,
+ SearchUnit: SearchUnit,
+ SearchUnit$I: SearchUnit$I,
+ SingleResult: SingleResult,
+ SingleResult$: SingleResult$,
+ SingleResult$SBB: SingleResult$SBB,
+ SearchSummary: SearchSummary,
+ SearchSummary$: SearchSummary$,
+ SearchSummary$LOktavia$: SearchSummary$LOktavia$
+ },
+ "src/style.jsx": {
+ Style: Style,
+ Style$S: Style$S,
+ _HTMLHandler: _HTMLHandler,
+ _HTMLHandler$HASB: _HTMLHandler$HASB
+ },
+ "src/stemmer/stemmer.jsx": {
+ Stemmer: Stemmer,
+ Stemmer$: Stemmer$
+ },
+ "src/stemmer/base-stemmer.jsx": {
+ BaseStemmer: BaseStemmer,
+ BaseStemmer$: BaseStemmer$
+ },
+ "src/stemmer/danish-stemmer.jsx": {
+ DanishStemmer: DanishStemmer,
+ DanishStemmer$: DanishStemmer$
+ },
+ "src/stemmer/among.jsx": {
+ Among: Among,
+ Among$SII: Among$SII,
+ Among$SIIF$LBaseStemmer$B$LBaseStemmer$: Among$SIIF$LBaseStemmer$B$LBaseStemmer$
+ },
+ "src/metadata.jsx": {
+ Metadata: Metadata,
+ Metadata$LOktavia$: Metadata$LOktavia$,
+ Section: Section,
+ Section$LOktavia$: Section$LOktavia$,
+ Splitter: Splitter,
+ Splitter$LOktavia$: Splitter$LOktavia$,
+ Splitter$LOktavia$S: Splitter$LOktavia$S,
+ Table: Table,
+ Table$LOktavia$AS: Table$LOktavia$AS,
+ Block: Block,
+ Block$LOktavia$: Block$LOktavia$
+ },
+ "src/fm-index.jsx": {
+ FMIndex: FMIndex,
+ FMIndex$: FMIndex$
+ },
+ "src/sax.jsx": {
+ Tag: Tag,
+ Tag$S: Tag$S,
+ _Common: _Common,
+ _Common$: _Common$,
+ _State: _State,
+ _State$: _State$,
+ SAXHandler: SAXHandler,
+ SAXHandler$: SAXHandler$,
+ SAXParser: SAXParser,
+ SAXParser$LSAXHandler$: SAXParser$LSAXHandler$,
+ SAXParser$LSAXHandler$B: SAXParser$LSAXHandler$B,
+ Char: Char,
+ Char$: Char$,
+ _Entities: _Entities,
+ _Entities$: _Entities$
+ },
+ "src/bit-vector.jsx": {
+ BitVector: BitVector,
+ BitVector$: BitVector$
+ },
+ "src/wavelet-matrix.jsx": {
+ WaveletMatrix: WaveletMatrix,
+ WaveletMatrix$: WaveletMatrix$
+ },
+ "src/burrows-wheeler-transform.jsx": {
+ BurrowsWheelerTransform: BurrowsWheelerTransform,
+ BurrowsWheelerTransform$: BurrowsWheelerTransform$
+ },
+ "src/sais.jsx": {
+ OArray: OArray,
+ OArray$AI: OArray$AI,
+ OArray$AII: OArray$AII,
+ SAIS: SAIS,
+ SAIS$: SAIS$
+ }
+};
+
+
+/**
+ * launches _Main.main(:string[]):void invoked by jsx --run|--executable
+ */
+JSX.runMain = function (sourceFile, args) {
+ var module = JSX.require(sourceFile);
+ if (! module) {
+ throw new ReferenceError("entry point module not found in " + sourceFile);
+ }
+ if (! module._Main) {
+ throw new ReferenceError("entry point _Main not found in " + sourceFile);
+ }
+ if (! module._Main.main$AS) {
+ throw new ReferenceError("entry point _Main.main(:string[]):void not found in " + sourceFile);
+ }
+ module._Main.main$AS(args);
+};
+
+/**
+ * launches _Test#test*():void invoked by jsx --test
+ */
+JSX.runTests = function (sourceFile, tests) {
+ var module = JSX.require(sourceFile);
+ var testClass = module._Test$;
+
+ if (!testClass) return; // skip if there's no test class
+
+ if(tests.length === 0) {
+ var p = testClass.prototype;
+ for (var m in p) {
+ if (p[m] instanceof Function
+ && /^test.*[$]$/.test(m)) {
+ tests.push(m);
+ }
+ }
+ }
+ else { // set as process arguments
+ tests = tests.map(function (name) {
+ return name + "$"; // mangle for function test*():void
+ });
+ }
+
+ var testCase = new testClass();
+
+ if (testCase.beforeClass$AS != null)
+ testCase.beforeClass$AS(tests);
+
+ for (var i = 0; i < tests.length; ++i) {
+ (function (method) {
+ if (method in testCase) {
+ testCase.run$SF$V$(method, function() { testCase[method](); });
+ }
+ else {
+ throw new ReferenceError("No such test method: " + method);
+ }
+ }(tests[i]));
+ }
+
+ if (testCase.afterClass$ != null)
+ testCase.afterClass$();
+};
+/**
+ * call a function on load/DOMContentLoaded
+ */
+function $__jsx_onload (event) {
+ window.removeEventListener("load", $__jsx_onload);
+ document.removeEventListener("DOMContentLoaded", $__jsx_onload);
+ JSX.runMain("tool/web/oktavia-danish-search.jsx", [])
+}
+
+window.addEventListener("load", $__jsx_onload);
+document.addEventListener("DOMContentLoaded", $__jsx_onload);
+
+})(JSX);
diff --git a/web/server/h2o/libh2o/misc/oktavia/lib/oktavia-dutch-search.js b/web/server/h2o/libh2o/misc/oktavia/lib/oktavia-dutch-search.js
new file mode 100644
index 00000000..4f46e2fc
--- /dev/null
+++ b/web/server/h2o/libh2o/misc/oktavia/lib/oktavia-dutch-search.js
@@ -0,0 +1,8423 @@
+// generatedy by JSX compiler 0.9.24 (2013-04-05 13:45:00 +0900; 1b229cc6a411f674f0f7cf7a79b7a8b3f8eb7414)
+var JSX = {};
+(function (JSX) {
+/**
+ * copies the implementations from source interface to target
+ */
+function $__jsx_merge_interface(target, source) {
+ for (var k in source.prototype)
+ if (source.prototype.hasOwnProperty(k))
+ target.prototype[k] = source.prototype[k];
+}
+
+/**
+ * defers the initialization of the property
+ */
+function $__jsx_lazy_init(obj, prop, func) {
+ function reset(obj, prop, value) {
+ delete obj[prop];
+ obj[prop] = value;
+ return value;
+ }
+
+ Object.defineProperty(obj, prop, {
+ get: function () {
+ return reset(obj, prop, func());
+ },
+ set: function (v) {
+ reset(obj, prop, v);
+ },
+ enumerable: true,
+ configurable: true
+ });
+}
+
+/**
+ * sideeffect().a /= b
+ */
+function $__jsx_div_assign(obj, prop, divisor) {
+ return obj[prop] = (obj[prop] / divisor) | 0;
+}
+
+/*
+ * global functions, renamed to avoid conflict with local variable names
+ */
+var $__jsx_parseInt = parseInt;
+var $__jsx_parseFloat = parseFloat;
+var $__jsx_isNaN = isNaN;
+var $__jsx_isFinite = isFinite;
+
+var $__jsx_encodeURIComponent = encodeURIComponent;
+var $__jsx_decodeURIComponent = decodeURIComponent;
+var $__jsx_encodeURI = encodeURI;
+var $__jsx_decodeURI = decodeURI;
+
+var $__jsx_ObjectToString = Object.prototype.toString;
+var $__jsx_ObjectHasOwnProperty = Object.prototype.hasOwnProperty;
+
+/*
+ * profiler object, initialized afterwards
+ */
+function $__jsx_profiler() {
+}
+
+/*
+ * public interface to JSX code
+ */
+JSX.require = function (path) {
+ var m = $__jsx_classMap[path];
+ return m !== undefined ? m : null;
+};
+
+JSX.profilerIsRunning = function () {
+ return $__jsx_profiler.getResults != null;
+};
+
+JSX.getProfileResults = function () {
+ return ($__jsx_profiler.getResults || function () { return {}; })();
+};
+
+JSX.postProfileResults = function (url, cb) {
+ if ($__jsx_profiler.postResults == null)
+ throw new Error("profiler has not been turned on");
+ return $__jsx_profiler.postResults(url, cb);
+};
+
+JSX.resetProfileResults = function () {
+ if ($__jsx_profiler.resetResults == null)
+ throw new Error("profiler has not been turned on");
+ return $__jsx_profiler.resetResults();
+};
+JSX.DEBUG = false;
+/**
+ * class _Main extends Object
+ * @constructor
+ */
+function _Main() {
+}
+
+/**
+ * @constructor
+ */
+function _Main$() {
+};
+
+_Main$.prototype = new _Main;
+
+/**
+ * @param {Array.<undefined|!string>} args
+ */
+_Main.main$AS = function (args) {
+ OktaviaSearch$setStemmer$LStemmer$(new DutchStemmer$());
+};
+
+var _Main$main$AS = _Main.main$AS;
+
+/**
+ * class _Result extends Object
+ * @constructor
+ */
+function _Result() {
+}
+
+/**
+ * @constructor
+ * @param {!string} title
+ * @param {!string} url
+ * @param {!string} content
+ * @param {!number} score
+ */
+function _Result$SSSI(title, url, content, score) {
+ this.title = title;
+ this.url = url;
+ this.content = content;
+ this.score = score;
+};
+
+_Result$SSSI.prototype = new _Result;
+
+/**
+ * class _Proposal extends Object
+ * @constructor
+ */
+function _Proposal() {
+}
+
+/**
+ * @constructor
+ * @param {!string} options
+ * @param {!string} label
+ * @param {!number} count
+ */
+function _Proposal$SSI(options, label, count) {
+ this.options = options;
+ this.label = label;
+ this.count = count;
+};
+
+_Proposal$SSI.prototype = new _Proposal;
+
+/**
+ * class OktaviaSearch extends Object
+ * @constructor
+ */
+function OktaviaSearch() {
+}
+
+/**
+ * @constructor
+ * @param {!number} entriesPerPage
+ */
+function OktaviaSearch$I(entriesPerPage) {
+ this._queries = null;
+ this._highlight = "";
+ this._result = null;
+ this._proposals = null;
+ this._currentFolderDepth = 0;
+ this._oktavia = new Oktavia$();
+ this._entriesPerPage = entriesPerPage;
+ this._currentPage = 1;
+ this._queryString = null;
+ this._callback = null;
+ OktaviaSearch._instance = this;
+};
+
+OktaviaSearch$I.prototype = new OktaviaSearch;
+
+/**
+ * @param {Stemmer} stemmer
+ */
+OktaviaSearch.setStemmer$LStemmer$ = function (stemmer) {
+ /** @type {Oktavia} */
+ var this$0;
+ if (OktaviaSearch._instance) {
+ this$0 = OktaviaSearch._instance._oktavia;
+ this$0._stemmer = stemmer;
+ } else {
+ OktaviaSearch._stemmer = stemmer;
+ }
+};
+
+var OktaviaSearch$setStemmer$LStemmer$ = OktaviaSearch.setStemmer$LStemmer$;
+
+/**
+ * @param {!string} index
+ */
+OktaviaSearch.prototype.loadIndex$S = function (index) {
+ /** @type {Oktavia} */
+ var this$0;
+ /** @type {Stemmer} */
+ var stemmer$0;
+ if (OktaviaSearch._stemmer) {
+ this$0 = this._oktavia;
+ stemmer$0 = OktaviaSearch._stemmer;
+ this$0._stemmer = stemmer$0;
+ }
+ this._oktavia.load$S(Binary$base64decode$S(index));
+ if (this._queryString) {
+ this.search$SF$IIV$(this._queryString, this._callback);
+ this._queryString = null;
+ this._callback = null;
+ }
+};
+
+/**
+ * @param {!string} queryString
+ * @param {*} callback
+ */
+OktaviaSearch.prototype.search$SF$IIV$ = function (queryString, callback) {
+ /** @type {QueryStringParser} */
+ var queryParser;
+ /** @type {SearchSummary} */
+ var summary;
+ /** @type {Array.<undefined|SearchUnit>} */
+ var _result$0;
+ if (this._oktavia) {
+ queryParser = ({queries: [ ]});
+ this._queries = QueryStringParser$parse$LQueryStringParser$S(queryParser, queryString);
+ this._highlight = QueryStringParser$highlight$LQueryStringParser$(queryParser);
+ summary = this._oktavia.search$ALQuery$(this._queries);
+ if (SearchSummary$size$LSearchSummary$(summary) > 0) {
+ this._result = this._sortResult$LSearchSummary$(summary);
+ this._proposals = [ ];
+ this._currentPage = 1;
+ } else {
+ this._result = [ ];
+ if (this._queries.length > 1) {
+ this._proposals = SearchSummary$getProposal$LSearchSummary$(summary);
+ } else {
+ this._proposals = [ ];
+ }
+ this._currentPage = 1;
+ }
+ callback((_result$0 = this._result).length, Math.ceil(_result$0.length / this._entriesPerPage));
+ } else {
+ this._queryString = queryString;
+ this._callback = callback;
+ }
+};
+
+/**
+ * @return {!number}
+ */
+OktaviaSearch.prototype.resultSize$ = function () {
+ return (this._result.length | 0);
+};
+
+/**
+ * @return {!number}
+ */
+OktaviaSearch.prototype.totalPages$ = function () {
+ return (Math.ceil(this._result.length / this._entriesPerPage) | 0);
+};
+
+/**
+ * @return {!number}
+ */
+OktaviaSearch.prototype.currentPage$ = function () {
+ return this._currentPage;
+};
+
+/**
+ * @param {!number} page
+ */
+OktaviaSearch.prototype.setCurrentPage$I = function (page) {
+ this._currentPage = page;
+};
+
+/**
+ * @return {!boolean}
+ */
+OktaviaSearch.prototype.hasPrevPage$ = function () {
+ return this._currentPage !== 1;
+};
+
+/**
+ * @return {!boolean}
+ */
+OktaviaSearch.prototype.hasNextPage$ = function () {
+ return this._currentPage !== Math.ceil(this._result.length / this._entriesPerPage);
+};
+
+/**
+ * @return {Array.<undefined|!string>}
+ */
+OktaviaSearch.prototype.pageIndexes$ = function () {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var total;
+ /** @type {!number} */
+ var i;
+ result = [ ];
+ total = Math.ceil(this._result.length / this._entriesPerPage);
+ if (total < 10) {
+ for (i = 1; i <= total; i++) {
+ result.push(i + "");
+ }
+ } else {
+ if (this._currentPage <= 5) {
+ for (i = 1; i <= 7; i++) {
+ result.push(i + "");
+ }
+ result.push('...', total + "");
+ } else {
+ if (total - 5 <= this._currentPage) {
+ result.push('1', '...');
+ for (i = total - 8; i <= total; i++) {
+ result.push(i + "");
+ }
+ } else {
+ result.push('1', '...');
+ for (i = this._currentPage - 3; i <= this._currentPage + 3; i++) {
+ result.push(i + "");
+ }
+ result.push('...', total + "");
+ }
+ }
+ }
+ return result;
+};
+
+/**
+ * @return {Array.<undefined|_Result>}
+ */
+OktaviaSearch.prototype.getResult$ = function () {
+ /** @type {Style} */
+ var style;
+ /** @type {!number} */
+ var start;
+ /** @type {!number} */
+ var last;
+ /** @type {Metadata} */
+ var metadata;
+ /** @type {!number} */
+ var num;
+ /** @type {Array.<undefined|_Result>} */
+ var results;
+ /** @type {!number} */
+ var i;
+ /** @type {SearchUnit} */
+ var unit;
+ /** @type {Array.<undefined|!string>} */
+ var info;
+ /** @type {!string} */
+ var content;
+ /** @type {Array.<undefined|Position>} */
+ var positions;
+ /** @type {!number} */
+ var end;
+ /** @type {!boolean} */
+ var split;
+ /** @type {!number} */
+ var j;
+ /** @type {Position} */
+ var pos;
+ /** @type {!string} */
+ var text;
+ /** @type {Oktavia} */
+ var this$0;
+ /** @type {!number} */
+ var position$0;
+ /** @type {!number} */
+ var _currentPage$0;
+ /** @type {!number} */
+ var _entriesPerPage$0;
+ style = new Style$S('html');
+ start = ((_currentPage$0 = this._currentPage) - 1) * (_entriesPerPage$0 = this._entriesPerPage);
+ last = Math.min(_currentPage$0 * _entriesPerPage$0, this._result.length);
+ this$0 = this._oktavia;
+ metadata = this$0._metadatas[this$0._metadataLabels[0]];
+ num = 250;
+ results = [ ];
+ for (i = start; i < last; i++) {
+ unit = this._result[i];
+ info = metadata.getInformation$I(unit.id).split(Oktavia.eob);
+ content = metadata.getContent$I(unit.id);
+ start = 0;
+ positions = SearchUnit$getPositions$LSearchUnit$(unit);
+ if (content.indexOf(info[0]) === 1) {
+ content = content.slice(info[0].length + 2, content.length);
+ start += info[0].length + 2;
+ }
+ end = start + num;
+ split = false;
+ if (positions[0].position > end - positions[0].word.length) {
+ end = positions[0].position + Math.floor(num / 2);
+ split = true;
+ }
+ for (j = positions.length - 1; j > -1; j--) {
+ pos = positions[j];
+ if (pos.position + pos.word.length < end) {
+ content = [ content.slice(0, pos.position - start), style.convert$S('<hit>*</hit>').replace('*', content.slice((position$0 = pos.position) - start, position$0 + pos.word.length - start)), content.slice(pos.position + pos.word.length - start, content.length) ].join('');
+ }
+ }
+ if (split) {
+ text = [ content.slice(0, Math.floor(num / 2)) + ' ...', content.slice(- Math.floor(num / 2), end - start) ].join('<br/>');
+ } else {
+ text = content.slice(0, end - start) + ' ...<br/>';
+ }
+ text = text.replace(Oktavia.eob, ' ').replace(/(<br\/>)(<br\/>)+/, '<br/><br/>');
+ results.push(({title: info[0], url: info[1], content: text, score: unit.score}));
+ }
+ return results;
+};
+
+/**
+ * @return {!string}
+ */
+OktaviaSearch.prototype.getHighlight$ = function () {
+ return this._highlight;
+};
+
+/**
+ * @return {Array.<undefined|_Proposal>}
+ */
+OktaviaSearch.prototype.getProposals$ = function () {
+ /** @type {Style} */
+ var style;
+ /** @type {Array.<undefined|_Proposal>} */
+ var results;
+ /** @type {!number} */
+ var i;
+ /** @type {Proposal} */
+ var proposal;
+ /** @type {Array.<undefined|!string>} */
+ var label;
+ /** @type {Array.<undefined|!string>} */
+ var option;
+ /** @type {!number} */
+ var j;
+ style = new Style$S('html');
+ results = [ ];
+ if (this._queries.length > 1) {
+ for (i = 0; i < this._proposals.length; i++) {
+ proposal = this._proposals[i];
+ if (proposal.expect > 0) {
+ label = [ ];
+ option = [ ];
+ for (j = 0; j < this._queries.length; j++) {
+ if (j !== proposal.omit) {
+ label.push(style.convert$S('<hit>' + this._queries[j].toString() + '</hit>'));
+ option.push(this._queries[j].toString());
+ } else {
+ label.push(style.convert$S('<del>' + this._queries[j].toString() + '</del>'));
+ }
+ }
+ results.push(({options: option.join(' '), label: label.join('&nbsp;'), count: proposal.expect}));
+ }
+ }
+ }
+ return results;
+};
+
+/**
+ * @param {SearchSummary} summary
+ * @return {Array.<undefined|SearchUnit>}
+ */
+OktaviaSearch.prototype._sortResult$LSearchSummary$ = function (summary) {
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var score;
+ /** @type {SearchUnit} */
+ var unit;
+ /** @type {!string} */
+ var pos;
+ /** @type {Position} */
+ var position;
+ for (i = 0; i < summary.result.units.length; i++) {
+ score = 0;
+ unit = summary.result.units[i];
+ for (pos in unit.positions) {
+ position = unit.positions[pos];
+ if (this._oktavia.wordPositionType$I(position.position)) {
+ score += 10;
+ } else {
+ score += 1;
+ }
+ if (! position.stemmed) {
+ score += 2;
+ }
+ }
+ unit.score = (score | 0);
+ }
+ return SearchSummary$getSortedResult$LSearchSummary$(summary);
+};
+
+/**
+ * class _Main$0 extends Object
+ * @constructor
+ */
+function _Main$0() {
+}
+
+/**
+ * @constructor
+ */
+function _Main$0$() {
+};
+
+_Main$0$.prototype = new _Main$0;
+
+/**
+ * @param {Array.<undefined|!string>} args
+ */
+_Main$0.main$AS = function (args) {
+};
+
+var _Main$0$main$AS = _Main$0.main$AS;
+
+/**
+ * class Oktavia extends Object
+ * @constructor
+ */
+function Oktavia() {
+}
+
+/**
+ * @constructor
+ */
+function Oktavia$() {
+ /** @type {Array.<undefined|!string>} */
+ var _utf162compressCode$0;
+ this._compressCode2utf16 = null;
+ this._fmindex = new FMIndex$();
+ this._metadatas = ({ });
+ this._metadataLabels = [ ];
+ this._stemmer = null;
+ this._stemmingResult = ({ });
+ _utf162compressCode$0 = this._utf162compressCode = [ Oktavia.eof, Oktavia.eob, Oktavia.unknown ];
+ _utf162compressCode$0.length = 65536;
+ this._compressCode2utf16 = [ Oktavia.eof, Oktavia.eob, Oktavia.unknown ];
+};
+
+Oktavia$.prototype = new Oktavia;
+
+/**
+ * @param {Stemmer} stemmer
+ */
+Oktavia.prototype.setStemmer$LStemmer$ = function (stemmer) {
+ this._stemmer = stemmer;
+};
+
+/**
+ * @return {Metadata}
+ */
+Oktavia.prototype.getPrimaryMetadata$ = function () {
+ return this._metadatas[this._metadataLabels[0]];
+};
+
+/**
+ * @param {!string} key
+ * @return {Section}
+ */
+Oktavia.prototype.addSection$S = function (key) {
+ /** @type {Section} */
+ var section;
+ if (this._metadataLabels.indexOf(key) !== -1) {
+ throw new Error('Metadata name ' + key + ' is already exists');
+ }
+ this._metadataLabels.push(key);
+ section = new Section$LOktavia$(this);
+ this._metadatas[key] = section;
+ return section;
+};
+
+/**
+ * @param {!string} key
+ * @return {Section}
+ */
+Oktavia.prototype.getSection$S = function (key) {
+ if (this._metadataLabels.indexOf(key) === -1) {
+ throw new Error('Metadata name ' + key + " does't exists");
+ }
+ return this._metadatas[key];
+};
+
+/**
+ * @param {!string} key
+ * @return {Splitter}
+ */
+Oktavia.prototype.addSplitter$S = function (key) {
+ /** @type {Splitter} */
+ var splitter;
+ if (this._metadataLabels.indexOf(key) !== -1) {
+ throw new Error('Metadata name ' + key + ' is already exists');
+ }
+ this._metadataLabels.push(key);
+ splitter = new Splitter$LOktavia$(this);
+ this._metadatas[key] = splitter;
+ return splitter;
+};
+
+/**
+ * @param {!string} key
+ * @return {Splitter}
+ */
+Oktavia.prototype.getSplitter$S = function (key) {
+ if (this._metadataLabels.indexOf(key) === -1) {
+ throw new Error('Metadata name ' + key + " does't exists");
+ }
+ return this._metadatas[key];
+};
+
+/**
+ * @param {!string} key
+ * @param {Array.<undefined|!string>} headers
+ * @return {Table}
+ */
+Oktavia.prototype.addTable$SAS = function (key, headers) {
+ /** @type {Table} */
+ var table;
+ if (this._metadataLabels.indexOf(key) !== -1) {
+ throw new Error('Metadata name ' + key + ' is already exists');
+ }
+ this._metadataLabels.push(key);
+ table = new Table$LOktavia$AS(this, headers);
+ this._metadatas[key] = table;
+ return table;
+};
+
+/**
+ * @param {!string} key
+ * @return {Table}
+ */
+Oktavia.prototype.getTable$S = function (key) {
+ if (this._metadataLabels.indexOf(key) === -1) {
+ throw new Error('Metadata name ' + key + " does't exists");
+ }
+ return this._metadatas[key];
+};
+
+/**
+ * @param {!string} key
+ * @return {Block}
+ */
+Oktavia.prototype.addBlock$S = function (key) {
+ /** @type {Block} */
+ var block;
+ if (this._metadataLabels.indexOf(key) !== -1) {
+ throw new Error('Metadata name ' + key + ' is already exists');
+ }
+ this._metadataLabels.push(key);
+ block = new Block$LOktavia$(this);
+ this._metadatas[key] = block;
+ return block;
+};
+
+/**
+ * @param {!string} key
+ * @return {Block}
+ */
+Oktavia.prototype.getBlock$S = function (key) {
+ if (this._metadataLabels.indexOf(key) === -1) {
+ throw new Error('Metadata name ' + key + " does't exists");
+ }
+ return this._metadatas[key];
+};
+
+/**
+ */
+Oktavia.prototype.addEndOfBlock$ = function () {
+ this._fmindex.push$S(Oktavia.eob);
+};
+
+/**
+ * @param {!string} words
+ */
+Oktavia.prototype.addWord$S = function (words) {
+ /** @type {Array.<undefined|!string>} */
+ var str;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var charCode;
+ /** @type {undefined|!string} */
+ var newCharCode;
+ str = [ ];
+ str.length = words.length;
+ for (i = 0; i < words.length; i++) {
+ charCode = words.charCodeAt(i);
+ newCharCode = this._utf162compressCode[charCode];
+ if (newCharCode == null) {
+ newCharCode = String.fromCharCode(this._compressCode2utf16.length);
+ this._utf162compressCode[charCode] = newCharCode;
+ this._compressCode2utf16.push(String.fromCharCode(charCode));
+ }
+ str.push(newCharCode);
+ }
+ this._fmindex.push$S(str.join(''));
+};
+
+/**
+ * @param {!string} words
+ * @param {!boolean} stemming
+ */
+Oktavia.prototype.addWord$SB = function (words, stemming) {
+ /** @type {Array.<undefined|!string>} */
+ var wordList;
+ /** @type {!number} */
+ var i;
+ /** @type {undefined|!string} */
+ var originalWord;
+ /** @type {!string} */
+ var smallWord;
+ /** @type {undefined|!string} */
+ var registerWord;
+ /** @type {!string} */
+ var baseWord;
+ /** @type {!string} */
+ var compressedCodeWord;
+ /** @type {Array.<undefined|!string>} */
+ var stemmedList;
+ this.addWord$S(words);
+ wordList = words.split(/\s+/);
+ for (i = 0; i < wordList.length; i++) {
+ originalWord = wordList[i];
+ smallWord = originalWord.slice(0, 1).toLowerCase() + originalWord.slice(1);
+ registerWord = null;
+ if (stemming && this._stemmer) {
+ baseWord = this._stemmer.stemWord$S(originalWord.toLowerCase());
+ if (originalWord.indexOf(baseWord) === -1) {
+ registerWord = baseWord;
+ }
+ } else {
+ if (originalWord != smallWord) {
+ registerWord = smallWord;
+ }
+ }
+ if (registerWord) {
+ compressedCodeWord = this._convertToCompressionCode$S(originalWord);
+ stemmedList = this._stemmingResult[registerWord];
+ if (! stemmedList) {
+ stemmedList = [ compressedCodeWord ];
+ this._stemmingResult[registerWord] = stemmedList;
+ } else {
+ if (stemmedList.indexOf(compressedCodeWord) === -1) {
+ stemmedList.push(compressedCodeWord);
+ }
+ }
+ }
+ }
+};
+
+/**
+ * @param {!string} keyword
+ * @return {!string}
+ */
+Oktavia.prototype._convertToCompressionCode$S = function (keyword) {
+ /** @type {Array.<undefined|!string>} */
+ var resultChars;
+ /** @type {!number} */
+ var i;
+ /** @type {undefined|!string} */
+ var chr;
+ resultChars = [ ];
+ for (i = 0; i < keyword.length; i++) {
+ chr = this._utf162compressCode[keyword.charCodeAt(i)];
+ if (chr == null) {
+ resultChars.push(Oktavia.unknown);
+ } else {
+ resultChars.push(chr);
+ }
+ }
+ return resultChars.join('');
+};
+
+/**
+ * @param {!string} keyword
+ * @param {!boolean} stemming
+ * @return {Array.<undefined|!number>}
+ */
+Oktavia.prototype.rawSearch$SB = function (keyword, stemming) {
+ /** @type {Array.<undefined|!number>} */
+ var result;
+ /** @type {!string} */
+ var baseWord;
+ /** @type {Array.<undefined|!string>} */
+ var stemmedList;
+ /** @type {!number} */
+ var i;
+ /** @type {undefined|!string} */
+ var word;
+ if (stemming) {
+ result = [ ];
+ if (this._stemmer) {
+ baseWord = this._stemmer.stemWord$S(keyword.toLowerCase());
+ stemmedList = this._stemmingResult[baseWord];
+ if (stemmedList) {
+ for (i = 0; i < stemmedList.length; i++) {
+ word = stemmedList[i];
+ result = result.concat(this._fmindex.search$S(word));
+ }
+ }
+ }
+ } else {
+ result = this._fmindex.search$S(this._convertToCompressionCode$S(keyword));
+ }
+ return result;
+};
+
+/**
+ * @param {Array.<undefined|Query>} queries
+ * @return {SearchSummary}
+ */
+Oktavia.prototype.search$ALQuery$ = function (queries) {
+ /** @type {SearchSummary} */
+ var summary;
+ /** @type {!number} */
+ var i;
+ /** @type {SingleResult} */
+ var result$0;
+ summary = ({sourceResults: [ ], result: null, oktavia: this});
+ for (i = 0; i < queries.length; i++) {
+ result$0 = this._searchQuery$LQuery$(queries[i]);
+ summary.sourceResults.push(result$0);
+ }
+ summary.result = SearchSummary$mergeResult$LSearchSummary$ALSingleResult$(summary, summary.sourceResults);
+ return summary;
+};
+
+/**
+ * @param {Query} query
+ * @return {SingleResult}
+ */
+Oktavia.prototype._searchQuery$LQuery$ = function (query) {
+ /** @type {SingleResult} */
+ var result;
+ /** @type {Array.<undefined|!number>} */
+ var positions;
+ result = new SingleResult$SBB(query.word, query.or, query.not);
+ if (query.raw) {
+ positions = this.rawSearch$SB(query.word, false);
+ } else {
+ positions = this.rawSearch$SB(query.word, false).concat(this.rawSearch$SB(query.word, true));
+ }
+ this._metadatas[this._metadataLabels[0]].grouping$LSingleResult$AISB(result, positions, query.word, ! query.raw);
+ return result;
+};
+
+/**
+ */
+Oktavia.prototype.build$ = function () {
+ this.build$IB(5, false);
+};
+
+/**
+ * @param {!number} cacheDensity
+ * @param {!boolean} verbose
+ */
+Oktavia.prototype.build$IB = function (cacheDensity, verbose) {
+ /** @type {!string} */
+ var key;
+ /** @type {!number} */
+ var cacheRange;
+ /** @type {!number} */
+ var maxChar;
+ for (key in this._metadatas) {
+ this._metadatas[key]._build$();
+ }
+ cacheRange = Math.round(Math.max(1, 100 / Math.min(100, Math.max(0.01, cacheDensity))));
+ maxChar = this._compressCode2utf16.length;
+ this._fmindex.build$SIIB(Oktavia.eof, maxChar, cacheRange, verbose);
+};
+
+/**
+ * @return {!string}
+ */
+Oktavia.prototype.dump$ = function () {
+ return this.dump$B(false);
+};
+
+/**
+ * @param {!boolean} verbose
+ * @return {!string}
+ */
+Oktavia.prototype.dump$B = function (verbose) {
+ /** @type {!string} */
+ var header;
+ /** @type {!string} */
+ var fmdata;
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var i;
+ /** @type {CompressionReport} */
+ var report;
+ /** @type {undefined|!string} */
+ var name;
+ /** @type {!string} */
+ var data;
+ header = Binary$dumpString$SLCompressionReport$("oktavia-01", null).slice(1);
+ if (verbose) {
+ console.log("Source text size: " + (this._fmindex.size$() * 2 + "") + ' bytes');
+ }
+ fmdata = this._fmindex.dump$B(verbose);
+ result = [ header, fmdata ];
+ result.push(Binary$dump16bitNumber$I(this._compressCode2utf16.length));
+ for (i = 3; i < this._compressCode2utf16.length; i++) {
+ result.push(this._compressCode2utf16[i]);
+ }
+ if (verbose) {
+ console.log('Char Code Map: ' + (this._compressCode2utf16.length * 2 - 2 + "") + ' bytes');
+ }
+ report = ({source: 0, result: 0});
+ result.push(Binary$dumpStringListMap$HASLCompressionReport$(this._stemmingResult, report));
+ if (verbose) {
+ console.log('Stemmed Word Table: ' + (result[result.length - 1].length + "") + ' bytes (' + (Math.round(report.result * 100.0 / report.source) + "") + '%)');
+ }
+ result.push(Binary$dump16bitNumber$I(this._metadataLabels.length));
+ for (i = 0; i < this._metadataLabels.length; i++) {
+ report = ({source: 0, result: 0});
+ name = this._metadataLabels[i];
+ data = this._metadatas[name]._dump$LCompressionReport$(report);
+ result.push(Binary$dumpString$SLCompressionReport$(name, report), data);
+ if (verbose) {
+ console.log('Meta Data ' + name + ': ' + (data.length * 2 + "") + ' bytes (' + (Math.round(report.result * 100.0 / report.source) + "") + '%)');
+ }
+ }
+ return result.join('');
+};
+
+/**
+ * @param {!string} data
+ */
+Oktavia.prototype.load$S = function (data) {
+ /** @type {!string} */
+ var header;
+ /** @type {!number} */
+ var offset;
+ /** @type {!number} */
+ var charCodeCount;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var charCode;
+ /** @type {LoadedStringListMapResult} */
+ var stemmedWords;
+ /** @type {!number} */
+ var metadataCount;
+ /** @type {LoadedStringResult} */
+ var nameResult;
+ /** @type {!string} */
+ var name;
+ /** @type {!number} */
+ var type;
+ header = Binary$dumpString$SLCompressionReport$("oktavia-01", null).slice(1);
+ if (data.slice(0, 5) !== header) {
+ throw new Error('Invalid data file');
+ }
+ this._metadatas = ({ });
+ this._metadataLabels = [ ];
+ offset = 5;
+ offset = this._fmindex.load$SI(data, offset);
+ charCodeCount = Binary$load16bitNumber$SI(data, offset++);
+ this._compressCode2utf16 = [ Oktavia.eof, Oktavia.eob, Oktavia.unknown ];
+ this._utf162compressCode = [ Oktavia.eof, Oktavia.eob, Oktavia.unknown ];
+ for (i = 3; i < charCodeCount; i++) {
+ charCode = Binary$load16bitNumber$SI(data, offset++);
+ this._compressCode2utf16.push(String.fromCharCode(charCode));
+ this._utf162compressCode[charCode] = String.fromCharCode(i);
+ }
+ stemmedWords = Binary$loadStringListMap$SI(data, offset);
+ this._stemmingResult = stemmedWords.result;
+ offset = stemmedWords.offset;
+ metadataCount = Binary$load16bitNumber$SI(data, offset++);
+ for (i = 0; i < metadataCount; i++) {
+ nameResult = Binary$loadString$SI(data, offset);
+ name = nameResult.result;
+ offset = nameResult.offset;
+ type = Binary$load16bitNumber$SI(data, offset++);
+ switch (type) {
+ case 0:
+ offset = Section$_load$LOktavia$SSI(this, name, data, offset);
+ break;
+ case 1:
+ offset = Splitter$_load$LOktavia$SSI(this, name, data, offset);
+ break;
+ case 2:
+ offset = Table$_load$LOktavia$SSI(this, name, data, offset);
+ break;
+ case 3:
+ offset = Block$_load$LOktavia$SSI(this, name, data, offset);
+ break;
+ }
+ }
+};
+
+/**
+ * @return {!number}
+ */
+Oktavia.prototype.contentSize$ = function () {
+ /** @type {FMIndex} */
+ var this$0;
+ this$0 = this._fmindex;
+ return this$0._substr.length;
+};
+
+/**
+ * @param {!number} position
+ * @return {!number}
+ */
+Oktavia.prototype.wordPositionType$I = function (position) {
+ /** @type {!number} */
+ var result;
+ /** @type {!string} */
+ var ahead;
+ result = 0;
+ if (position === 0) {
+ result = 4;
+ } else {
+ ahead = this._fmindex.getSubstring$II(position - 1, 1);
+ if (/\s/.test(ahead)) {
+ result = 2;
+ } else {
+ if (/\W/.test(ahead)) {
+ result = 1;
+ } else {
+ if (Oktavia.eob === ahead) {
+ result = 3;
+ }
+ }
+ }
+ }
+ return (result | 0);
+};
+
+/**
+ * @param {!number} position
+ * @param {!number} length
+ * @return {!string}
+ */
+Oktavia.prototype._getSubstring$II = function (position, length) {
+ /** @type {!string} */
+ var result;
+ /** @type {Array.<undefined|!string>} */
+ var str;
+ /** @type {!number} */
+ var i;
+ result = this._fmindex.getSubstring$II(position, length);
+ str = [ ];
+ for (i = 0; i < result.length; i++) {
+ str.push(this._compressCode2utf16[result.charCodeAt(i)]);
+ }
+ return str.join('');
+};
+
+/**
+ * class Binary extends Object
+ * @constructor
+ */
+function Binary() {
+}
+
+/**
+ * @constructor
+ */
+function Binary$() {
+};
+
+Binary$.prototype = new Binary;
+
+/**
+ * @param {!number} num
+ * @return {!string}
+ */
+Binary.dump32bitNumber$N = function (num) {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ result = [ String.fromCharCode(Math.floor(num / 65536)) ];
+ result.push(String.fromCharCode(num % 65536));
+ return result.join("");
+};
+
+var Binary$dump32bitNumber$N = Binary.dump32bitNumber$N;
+
+/**
+ * @param {!string} buffer
+ * @param {!number} offset
+ * @return {!number}
+ */
+Binary.load32bitNumber$SI = function (buffer, offset) {
+ /** @type {!number} */
+ var result;
+ result = buffer.charCodeAt(offset) * 65536 + buffer.charCodeAt(offset + 1);
+ return result;
+};
+
+var Binary$load32bitNumber$SI = Binary.load32bitNumber$SI;
+
+/**
+ * @param {!number} num
+ * @return {!string}
+ */
+Binary.dump16bitNumber$I = function (num) {
+ return String.fromCharCode(num % 65536);
+};
+
+var Binary$dump16bitNumber$I = Binary.dump16bitNumber$I;
+
+/**
+ * @param {!string} buffer
+ * @param {!number} offset
+ * @return {!number}
+ */
+Binary.load16bitNumber$SI = function (buffer, offset) {
+ return (buffer.charCodeAt(offset) | 0);
+};
+
+var Binary$load16bitNumber$SI = Binary.load16bitNumber$SI;
+
+/**
+ * @param {!string} str
+ * @return {!string}
+ */
+Binary.dumpString$S = function (str) {
+ return Binary$dumpString$SLCompressionReport$(str, null);
+};
+
+var Binary$dumpString$S = Binary.dumpString$S;
+
+/**
+ * @param {!string} str
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+Binary.dumpString$SLCompressionReport$ = function (str, report) {
+ /** @type {!number} */
+ var length;
+ /** @type {!boolean} */
+ var compress;
+ /** @type {Array.<undefined|!number>} */
+ var charCodes;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var charCode;
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {undefined|!number} */
+ var bytes;
+ if (str.length > 32768) {
+ str = str.slice(0, 32768);
+ }
+ length = str.length;
+ compress = true;
+ charCodes = [ ];
+ for (i = 0; i < length; i++) {
+ charCode = str.charCodeAt(i);
+ if (charCode > 255) {
+ compress = false;
+ break;
+ }
+ charCodes.push(charCode);
+ }
+ if (compress) {
+ result = [ Binary$dump16bitNumber$I(length + 32768) ];
+ for (i = 0; i < length; i += 2) {
+ bytes = charCodes[i];
+ if (i !== length - 1) {
+ bytes += charCodes[i + 1] << 8;
+ }
+ result.push(String.fromCharCode(bytes % 65536));
+ }
+ if (report) {
+ CompressionReport$add$LCompressionReport$II(report, length, Math.ceil(length / 2));
+ }
+ } else {
+ result = [ Binary$dump16bitNumber$I(length), str ];
+ if (report) {
+ CompressionReport$add$LCompressionReport$II(report, length, length);
+ }
+ }
+ return result.join('');
+};
+
+var Binary$dumpString$SLCompressionReport$ = Binary.dumpString$SLCompressionReport$;
+
+/**
+ * @param {!string} buffer
+ * @param {!number} offset
+ * @return {LoadedStringResult}
+ */
+Binary.loadString$SI = function (buffer, offset) {
+ return new LoadedStringResult$SI(buffer, offset);
+};
+
+var Binary$loadString$SI = Binary.loadString$SI;
+
+/**
+ * @param {Array.<undefined|!string>} strList
+ * @return {!string}
+ */
+Binary.dumpStringList$AS = function (strList) {
+ return Binary$dumpStringList$ASLCompressionReport$(strList, null);
+};
+
+var Binary$dumpStringList$AS = Binary.dumpStringList$AS;
+
+/**
+ * @param {Array.<undefined|!string>} strList
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+Binary.dumpStringList$ASLCompressionReport$ = function (strList, report) {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var i;
+ result = [ Binary$dump32bitNumber$N(strList.length) ];
+ for (i = 0; i < strList.length; i++) {
+ result.push(Binary$dumpString$SLCompressionReport$(strList[i], report));
+ }
+ return result.join('');
+};
+
+var Binary$dumpStringList$ASLCompressionReport$ = Binary.dumpStringList$ASLCompressionReport$;
+
+/**
+ * @param {!string} buffer
+ * @param {!number} offset
+ * @return {LoadedStringListResult}
+ */
+Binary.loadStringList$SI = function (buffer, offset) {
+ return new LoadedStringListResult$SI(buffer, offset);
+};
+
+var Binary$loadStringList$SI = Binary.loadStringList$SI;
+
+/**
+ * @param {Object.<string, undefined|Array.<undefined|!string>>} strMap
+ * @return {!string}
+ */
+Binary.dumpStringListMap$HAS = function (strMap) {
+ return Binary$dumpStringListMap$HASLCompressionReport$(strMap, null);
+};
+
+var Binary$dumpStringListMap$HAS = Binary.dumpStringListMap$HAS;
+
+/**
+ * @param {Object.<string, undefined|Array.<undefined|!string>>} strMap
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+Binary.dumpStringListMap$HASLCompressionReport$ = function (strMap, report) {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var counter;
+ /** @type {!string} */
+ var key;
+ result = [ ];
+ counter = 0;
+ for (key in strMap) {
+ result.push(Binary$dumpString$SLCompressionReport$(key, report));
+ result.push(Binary$dumpStringList$ASLCompressionReport$(strMap[key], report));
+ counter++;
+ }
+ return Binary$dump32bitNumber$N(counter) + result.join('');
+};
+
+var Binary$dumpStringListMap$HASLCompressionReport$ = Binary.dumpStringListMap$HASLCompressionReport$;
+
+/**
+ * @param {!string} buffer
+ * @param {!number} offset
+ * @return {LoadedStringListMapResult}
+ */
+Binary.loadStringListMap$SI = function (buffer, offset) {
+ return new LoadedStringListMapResult$SI(buffer, offset);
+};
+
+var Binary$loadStringListMap$SI = Binary.loadStringListMap$SI;
+
+/**
+ * @param {Array.<undefined|!number>} array
+ * @return {!string}
+ */
+Binary.dump32bitNumberList$AN = function (array) {
+ return Binary$dump32bitNumberList$ANLCompressionReport$(array, null);
+};
+
+var Binary$dump32bitNumberList$AN = Binary.dump32bitNumberList$AN;
+
+/**
+ * @param {Array.<undefined|!number>} array
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+Binary.dump32bitNumberList$ANLCompressionReport$ = function (array, report) {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var index;
+ /** @type {!number} */
+ var inputLength;
+ /** @type {!number} */
+ var length;
+ /** @type {!string} */
+ var resultString;
+ /** @type {!number} */
+ var value1$0;
+ /** @type {!number} */
+ var value2$0;
+ result = [ Binary$dump32bitNumber$N(array.length) ];
+ index = 0;
+ inputLength = array.length;
+ while (index < inputLength) {
+ if (array[index] == 0) {
+ length = Binary$_countZero$ANI(array, index);
+ result.push(Binary$_zeroBlock$I(length));
+ index += length;
+ } else {
+ if (Binary$_shouldZebraCode$ANI(array, index)) {
+ result.push(Binary$_createZebraCode$ANI(array, index));
+ value1$0 = array.length;
+ value2$0 = index + 15;
+ index = (value1$0 <= value2$0 ? value1$0 : value2$0);
+ } else {
+ length = Binary$_searchDoubleZero$ANI(array, index);
+ result.push(Binary$_nonZeroBlock$ANII(array, index, length));
+ if (length === 0) {
+ throw new Error('');
+ }
+ index += length;
+ }
+ }
+ }
+ resultString = result.join('');
+ if (report) {
+ CompressionReport$add$LCompressionReport$II(report, array.length * 2 + 2, resultString.length);
+ }
+ return resultString;
+};
+
+var Binary$dump32bitNumberList$ANLCompressionReport$ = Binary.dump32bitNumberList$ANLCompressionReport$;
+
+/**
+ * @param {!string} buffer
+ * @param {!number} offset
+ * @return {LoadedNumberListResult}
+ */
+Binary.load32bitNumberList$SI = function (buffer, offset) {
+ return new LoadedNumberListResult$SI(buffer, offset);
+};
+
+var Binary$load32bitNumberList$SI = Binary.load32bitNumberList$SI;
+
+/**
+ * @param {Array.<undefined|!number>} array
+ * @param {!number} offset
+ * @return {!number}
+ */
+Binary._countZero$ANI = function (array, offset) {
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var array$len$0;
+ for ((i = offset, array$len$0 = array.length); i < array$len$0; i++) {
+ if (array[i] != 0) {
+ return (i - offset | 0);
+ }
+ }
+ return (array.length - offset | 0);
+};
+
+var Binary$_countZero$ANI = Binary._countZero$ANI;
+
+/**
+ * @param {!number} length
+ * @return {!string}
+ */
+Binary._zeroBlock$I = function (length) {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ result = [ ];
+ while (length > 0) {
+ if (length > 16384) {
+ result.push(Binary$dump16bitNumber$I(16383));
+ length -= 16384;
+ } else {
+ result.push(Binary$dump16bitNumber$I(length - 1));
+ length = 0;
+ }
+ }
+ return result.join('');
+};
+
+var Binary$_zeroBlock$I = Binary._zeroBlock$I;
+
+/**
+ * @param {Array.<undefined|!number>} array
+ * @param {!number} offset
+ * @return {!boolean}
+ */
+Binary._shouldZebraCode$ANI = function (array, offset) {
+ /** @type {!number} */
+ var change;
+ /** @type {!boolean} */
+ var isLastZero;
+ /** @type {!number} */
+ var i;
+ if (array.length - offset < 16) {
+ return true;
+ }
+ change = 0;
+ isLastZero = false;
+ for (i = offset; i < offset + 15; i++) {
+ if (array[i] == 0) {
+ if (! isLastZero) {
+ isLastZero = true;
+ change++;
+ }
+ } else {
+ if (isLastZero) {
+ isLastZero = false;
+ change++;
+ }
+ }
+ }
+ return change > 2;
+};
+
+var Binary$_shouldZebraCode$ANI = Binary._shouldZebraCode$ANI;
+
+/**
+ * @param {Array.<undefined|!number>} array
+ * @param {!number} offset
+ * @return {!number}
+ */
+Binary._searchDoubleZero$ANI = function (array, offset) {
+ /** @type {!boolean} */
+ var isLastZero;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var array$len$0;
+ isLastZero = false;
+ for ((i = offset, array$len$0 = array.length); i < array$len$0; i++) {
+ if (array[i] == 0) {
+ if (isLastZero) {
+ return (i - offset - 1 | 0);
+ }
+ isLastZero = true;
+ } else {
+ isLastZero = false;
+ }
+ }
+ return (array.length - offset | 0);
+};
+
+var Binary$_searchDoubleZero$ANI = Binary._searchDoubleZero$ANI;
+
+/**
+ * @param {Array.<undefined|!number>} array
+ * @param {!number} offset
+ * @param {!number} length
+ * @return {!string}
+ */
+Binary._nonZeroBlock$ANII = function (array, offset, length) {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var blockLength;
+ /** @type {!number} */
+ var i;
+ result = [ ];
+ while (length > 0) {
+ if (length > 16384) {
+ blockLength = 16384;
+ length -= 16384;
+ } else {
+ blockLength = length;
+ length = 0;
+ }
+ result.push(Binary$dump16bitNumber$I(blockLength - 1 + 0x4000));
+ for (i = offset; i < offset + blockLength; i++) {
+ result.push(Binary$dump32bitNumber$N(array[i]));
+ }
+ offset += blockLength;
+ }
+ return result.join('');
+};
+
+var Binary$_nonZeroBlock$ANII = Binary._nonZeroBlock$ANII;
+
+/**
+ * @param {Array.<undefined|!number>} array
+ * @param {!number} offset
+ * @return {!string}
+ */
+Binary._createZebraCode$ANI = function (array, offset) {
+ /** @type {!number} */
+ var last;
+ /** @type {!number} */
+ var code;
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var value1$0;
+ /** @type {!number} */
+ var value2$0;
+ value1$0 = offset + 15;
+ value2$0 = array.length;
+ last = (value1$0 <= value2$0 ? value1$0 : value2$0);
+ code = 0x8000;
+ result = [ ];
+ for (i = offset; i < last; i++) {
+ if (array[i] != 0) {
+ result.push(Binary$dump32bitNumber$N(array[i]));
+ code = code + (0x1 << i - offset);
+ }
+ }
+ return String.fromCharCode(code) + result.join('');
+};
+
+var Binary$_createZebraCode$ANI = Binary._createZebraCode$ANI;
+
+/**
+ * @param {!string} str
+ * @return {!string}
+ */
+Binary.base64encode$S = function (str) {
+ /** @type {Array.<undefined|!string>} */
+ var out;
+ /** @type {Array.<undefined|!number>} */
+ var source;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var code;
+ /** @type {!number} */
+ var len;
+ /** @type {!number} */
+ var c1;
+ /** @type {undefined|!number} */
+ var c2;
+ /** @type {undefined|!number} */
+ var c3;
+ out = [ ];
+ source = [ ];
+ for (i = 0; i < str.length; i++) {
+ code = str.charCodeAt(i);
+ source.push(code & 0x00ff, code >>> 8);
+ }
+ len = str.length * 2;
+ i = 0;
+ while (i < len) {
+ c1 = source[i++] & 0xff;
+ if (i === len) {
+ out.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(c1 >> 2));
+ out.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((c1 & 0x3) << 4));
+ out.push("==");
+ break;
+ }
+ c2 = source[i++];
+ if (i === len) {
+ out.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(c1 >> 2));
+ out.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((c1 & 0x3) << 4 | (c2 & 0xF0) >> 4));
+ out.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((c2 & 0xF) << 2));
+ out.push("=");
+ break;
+ }
+ c3 = source[i++];
+ out.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(c1 >> 2));
+ out.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((c1 & 0x3) << 4 | (c2 & 0xF0) >> 4));
+ out.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((c2 & 0xF) << 2 | (c3 & 0xC0) >> 6));
+ out.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(c3 & 0x3F));
+ }
+ return out.join('');
+};
+
+var Binary$base64encode$S = Binary.base64encode$S;
+
+/**
+ * @param {Array.<undefined|!number>} source
+ * @return {!string}
+ */
+Binary._mergeCharCode$AI = function (source) {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var i;
+ result = [ ];
+ for (i = 0; i < source.length; i += 2) {
+ result.push(String.fromCharCode(source[i] + (source[i + 1] << 8)));
+ }
+ return result.join('');
+};
+
+var Binary$_mergeCharCode$AI = Binary._mergeCharCode$AI;
+
+/**
+ * @param {!string} str
+ * @return {!string}
+ */
+Binary.base64decode$S = function (str) {
+ /** @type {!number} */
+ var len;
+ /** @type {!number} */
+ var i;
+ /** @type {Array.<undefined|!number>} */
+ var out;
+ /** @type {undefined|!number} */
+ var c1;
+ /** @type {undefined|!number} */
+ var c2;
+ /** @type {!number} */
+ var c3;
+ /** @type {!number} */
+ var c4;
+ len = str.length;
+ i = 0;
+ out = [ ];
+ while (i < len) {
+ do {
+ c1 = Binary._base64DecodeChars[str.charCodeAt(i++) & 0xff];
+ } while (i < len && c1 == -1);
+ if (c1 == -1) {
+ break;
+ }
+ do {
+ c2 = Binary._base64DecodeChars[str.charCodeAt(i++) & 0xff];
+ } while (i < len && c2 == -1);
+ if (c2 == -1) {
+ break;
+ }
+ out.push(c1 << 2 | (c2 & 0x30) >> 4);
+ do {
+ c3 = str.charCodeAt(i++) & 0xff;
+ if (c3 === 61) {
+ return Binary$_mergeCharCode$AI(out);
+ }
+ c3 = Binary._base64DecodeChars[c3];
+ } while (i < len && c3 === -1);
+ if (c3 === -1) {
+ break;
+ }
+ out.push((c2 & 0XF) << 4 | (c3 & 0x3C) >> 2);
+ do {
+ c4 = str.charCodeAt(i++) & 0xff;
+ if (c4 === 61) {
+ return Binary$_mergeCharCode$AI(out);
+ }
+ c4 = (Binary._base64DecodeChars[c4] | 0);
+ } while (i < len && c4 === -1);
+ if (c4 === -1) {
+ break;
+ }
+ out.push((c3 & 0x03) << 6 | c4);
+ }
+ return Binary$_mergeCharCode$AI(out);
+};
+
+var Binary$base64decode$S = Binary.base64decode$S;
+
+/**
+ * class LoadedStringResult extends Object
+ * @constructor
+ */
+function LoadedStringResult() {
+}
+
+/**
+ * @constructor
+ * @param {!string} data
+ * @param {!number} offset
+ */
+function LoadedStringResult$SI(data, offset) {
+ /** @type {!number} */
+ var strLength;
+ /** @type {Array.<undefined|!string>} */
+ var bytes;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var code;
+ /** @type {!number} */
+ var offset$0;
+ this.result = "";
+ this.offset = 0;
+ offset$0 = offset++;
+ strLength = data.charCodeAt(offset$0);
+ if (strLength > 32767) {
+ strLength = strLength - 32768;
+ bytes = [ ];
+ for (i = 0; i < strLength; i += 2) {
+ code = data.charCodeAt(offset);
+ bytes.push(String.fromCharCode(code & 0x00ff));
+ if (i !== strLength - 1) {
+ bytes.push(String.fromCharCode(code >>> 8));
+ }
+ offset++;
+ }
+ this.result = bytes.join('');
+ this.offset = offset;
+ } else {
+ this.result = data.slice(offset, offset + strLength);
+ this.offset = (offset + strLength | 0);
+ }
+};
+
+LoadedStringResult$SI.prototype = new LoadedStringResult;
+
+/**
+ * class LoadedStringListResult extends Object
+ * @constructor
+ */
+function LoadedStringListResult() {
+}
+
+/**
+ * @constructor
+ * @param {!string} data
+ * @param {!number} offset
+ */
+function LoadedStringListResult$SI(data, offset) {
+ /** @type {!number} */
+ var length;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var strLength;
+ /** @type {!string} */
+ var resultStr;
+ /** @type {Array.<undefined|!string>} */
+ var bytes;
+ /** @type {!number} */
+ var j;
+ /** @type {!number} */
+ var code;
+ /** @type {!number} */
+ var result$0;
+ /** @type {!number} */
+ var offset$0;
+ this.offset = 0;
+ this.result = [ ];
+ result$0 = data.charCodeAt(offset) * 65536 + data.charCodeAt(offset + 1);
+ length = result$0;
+ offset += 2;
+ for (i = 0; i < length; i++) {
+ offset$0 = offset++;
+ strLength = data.charCodeAt(offset$0);
+ if (strLength > 32767) {
+ strLength = strLength - 32768;
+ bytes = [ ];
+ for (j = 0; j < strLength; j += 2) {
+ code = data.charCodeAt(offset);
+ bytes.push(String.fromCharCode(code & 0x00ff));
+ if (j !== strLength - 1) {
+ bytes.push(String.fromCharCode(code >>> 8));
+ }
+ offset++;
+ }
+ resultStr = bytes.join('');
+ } else {
+ resultStr = data.slice(offset, offset + strLength);
+ offset = (offset + strLength | 0);
+ }
+ this.result.push(resultStr);
+ }
+ this.offset = offset;
+};
+
+LoadedStringListResult$SI.prototype = new LoadedStringListResult;
+
+/**
+ * class LoadedStringListMapResult extends Object
+ * @constructor
+ */
+function LoadedStringListMapResult() {
+}
+
+/**
+ * @constructor
+ * @param {!string} data
+ * @param {!number} offset
+ */
+function LoadedStringListMapResult$SI(data, offset) {
+ /** @type {!number} */
+ var length;
+ /** @type {!number} */
+ var i;
+ /** @type {LoadedStringResult} */
+ var keyResult;
+ /** @type {LoadedStringListResult} */
+ var valueResult;
+ /** @type {!number} */
+ var result$0;
+ /** @type {!number} */
+ var offset$0;
+ this.offset = 0;
+ this.result = ({ });
+ result$0 = data.charCodeAt(offset) * 65536 + data.charCodeAt(offset + 1);
+ length = result$0;
+ offset += 2;
+ for (i = 0; i < length; i++) {
+ keyResult = new LoadedStringResult$SI(data, offset);
+ offset$0 = keyResult.offset;
+ valueResult = new LoadedStringListResult$SI(data, offset$0);
+ this.result[keyResult.result] = valueResult.result;
+ offset = valueResult.offset;
+ }
+ this.offset = offset;
+};
+
+LoadedStringListMapResult$SI.prototype = new LoadedStringListMapResult;
+
+/**
+ * class LoadedNumberListResult extends Object
+ * @constructor
+ */
+function LoadedNumberListResult() {
+}
+
+/**
+ * @constructor
+ * @param {!string} data
+ * @param {!number} offset
+ */
+function LoadedNumberListResult$SI(data, offset) {
+ /** @type {!number} */
+ var resultLength;
+ /** @type {!number} */
+ var originalOffset;
+ /** @type {Array.<undefined|!number>} */
+ var result;
+ /** @type {!number} */
+ var tag;
+ /** @type {!number} */
+ var length;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var result$0;
+ /** @type {!number} */
+ var value1$0;
+ this.result = null;
+ this.offset = 0;
+ result$0 = data.charCodeAt(offset) * 65536 + data.charCodeAt(offset + 1);
+ resultLength = result$0;
+ originalOffset = offset;
+ offset += 2;
+ result = [ ];
+ while (result.length < resultLength) {
+ tag = data.charCodeAt(offset++);
+ if (tag >>> 15 === 1) {
+ value1$0 = resultLength - result.length;
+ length = (value1$0 <= 15 ? value1$0 : 15);
+ for (i = 0; i < length; i++) {
+ if (tag >>> i & 0x1) {
+ result.push(Binary$load32bitNumber$SI(data, offset));
+ offset += 2;
+ } else {
+ result.push(0);
+ }
+ }
+ } else {
+ if (tag >>> 14 === 1) {
+ length = tag - 0x4000 + 1;
+ for (i = 0; i < length; i++) {
+ result.push(Binary$load32bitNumber$SI(data, offset));
+ offset += 2;
+ }
+ } else {
+ length = tag + 1;
+ for (i = 0; i < length; i++) {
+ result.push(0);
+ }
+ }
+ }
+ }
+ this.result = result;
+ this.offset = offset;
+};
+
+LoadedNumberListResult$SI.prototype = new LoadedNumberListResult;
+
+/**
+ * class CompressionReport extends Object
+ * @constructor
+ */
+function CompressionReport() {
+}
+
+/**
+ * @constructor
+ */
+function CompressionReport$() {
+ this.source = 0;
+ this.result = 0;
+};
+
+CompressionReport$.prototype = new CompressionReport;
+
+/**
+ * @param {CompressionReport} $this
+ * @param {!number} source
+ * @param {!number} result
+ */
+CompressionReport.add$LCompressionReport$II = function ($this, source, result) {
+ $this.source += source;
+ $this.result += result;
+};
+
+var CompressionReport$add$LCompressionReport$II = CompressionReport.add$LCompressionReport$II;
+
+/**
+ * @param {CompressionReport} $this
+ * @return {!number}
+ */
+CompressionReport.rate$LCompressionReport$ = function ($this) {
+ return (Math.round($this.result * 100.0 / $this.source) | 0);
+};
+
+var CompressionReport$rate$LCompressionReport$ = CompressionReport.rate$LCompressionReport$;
+
+/**
+ * class Query extends Object
+ * @constructor
+ */
+function Query() {
+}
+
+/**
+ * @constructor
+ */
+function Query$() {
+ this.word = '';
+ this.or = false;
+ this.not = false;
+ this.raw = false;
+};
+
+Query$.prototype = new Query;
+
+/**
+ * @return {!string}
+ */
+Query.prototype.toString = function () {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ result = [ ];
+ if (this.or) {
+ result.push("OR ");
+ }
+ if (this.not) {
+ result.push("-");
+ }
+ if (this.raw) {
+ result.push('"', this.word, '"');
+ } else {
+ result.push(this.word);
+ }
+ return result.join('');
+};
+
+/**
+ * class QueryStringParser extends Object
+ * @constructor
+ */
+function QueryStringParser() {
+}
+
+/**
+ * @constructor
+ */
+function QueryStringParser$() {
+ this.queries = [ ];
+};
+
+QueryStringParser$.prototype = new QueryStringParser;
+
+/**
+ * @param {QueryStringParser} $this
+ * @param {!string} queryString
+ * @return {Array.<undefined|Query>}
+ */
+QueryStringParser.parse$LQueryStringParser$S = function ($this, queryString) {
+ /** @type {!boolean} */
+ var nextOr;
+ /** @type {!boolean} */
+ var nextNot;
+ /** @type {!number} */
+ var currentWordStart;
+ /** @type {!number} */
+ var status;
+ /** @type {RegExp} */
+ var isSpace;
+ /** @type {!number} */
+ var i;
+ /** @type {!string} */
+ var ch;
+ /** @type {!string} */
+ var word;
+ /** @type {Query} */
+ var query;
+ nextOr = false;
+ nextNot = false;
+ currentWordStart = 0;
+ status = 0;
+ isSpace = /[\s\u3000]/;
+ for (i = 0; i < queryString.length; i++) {
+ ch = queryString.charAt(i);
+ switch (status) {
+ case 0:
+ if (! isSpace.test(ch)) {
+ if (ch === '-') {
+ nextNot = true;
+ } else {
+ if (ch === '"') {
+ currentWordStart = i + 1;
+ status = 2;
+ } else {
+ currentWordStart = i;
+ status = 1;
+ }
+ }
+ } else {
+ nextNot = false;
+ }
+ break;
+ case 1:
+ if (isSpace.test(ch)) {
+ word = queryString.slice(currentWordStart, i);
+ if (word === 'OR') {
+ nextOr = true;
+ } else {
+ query = new Query$();
+ query.word = word;
+ query.or = nextOr;
+ query.not = nextNot;
+ $this.queries.push(query);
+ nextOr = false;
+ nextNot = false;
+ }
+ status = 0;
+ }
+ break;
+ case 2:
+ if (ch === '"') {
+ word = queryString.slice(currentWordStart, i);
+ query = new Query$();
+ query.word = word;
+ query.or = nextOr;
+ query.not = nextNot;
+ query.raw = true;
+ $this.queries.push(query);
+ nextOr = false;
+ nextNot = false;
+ status = 0;
+ }
+ break;
+ }
+ }
+ switch (status) {
+ case 0:
+ break;
+ case 1:
+ query = new Query$();
+ word = queryString.slice(currentWordStart, queryString.length);
+ if (word !== 'OR') {
+ query.word = word;
+ query.or = nextOr;
+ query.not = nextNot;
+ $this.queries.push(query);
+ }
+ break;
+ case 2:
+ query = new Query$();
+ query.word = queryString.slice(currentWordStart, queryString.length);
+ query.or = nextOr;
+ query.not = nextNot;
+ query.raw = true;
+ $this.queries.push(query);
+ break;
+ }
+ return $this.queries;
+};
+
+var QueryStringParser$parse$LQueryStringParser$S = QueryStringParser.parse$LQueryStringParser$S;
+
+/**
+ * @param {QueryStringParser} $this
+ * @return {!string}
+ */
+QueryStringParser.highlight$LQueryStringParser$ = function ($this) {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var i;
+ /** @type {Query} */
+ var query;
+ result = [ ];
+ for (i = 0; i < $this.queries.length; i++) {
+ query = $this.queries[i];
+ if (! query.not) {
+ result.push("highlight=" + $__jsx_encodeURIComponent(query.word));
+ }
+ }
+ return '?' + result.join('&');
+};
+
+var QueryStringParser$highlight$LQueryStringParser$ = QueryStringParser.highlight$LQueryStringParser$;
+
+/**
+ * class Proposal extends Object
+ * @constructor
+ */
+function Proposal() {
+}
+
+/**
+ * @constructor
+ * @param {!number} omit
+ * @param {!number} expect
+ */
+function Proposal$II(omit, expect) {
+ this.omit = omit;
+ this.expect = expect;
+};
+
+Proposal$II.prototype = new Proposal;
+
+/**
+ * class Position extends Object
+ * @constructor
+ */
+function Position() {
+}
+
+/**
+ * @constructor
+ * @param {!string} word
+ * @param {!number} position
+ * @param {!boolean} stemmed
+ */
+function Position$SIB(word, position, stemmed) {
+ this.word = word;
+ this.position = position;
+ this.stemmed = stemmed;
+};
+
+Position$SIB.prototype = new Position;
+
+/**
+ * class SearchUnit extends Object
+ * @constructor
+ */
+function SearchUnit() {
+}
+
+/**
+ * @constructor
+ * @param {!number} id
+ */
+function SearchUnit$I(id) {
+ this.positions = ({ });
+ this.id = id;
+ this._size = 0;
+ this.score = 0;
+ this.startPosition = -1;
+};
+
+SearchUnit$I.prototype = new SearchUnit;
+
+/**
+ * @param {SearchUnit} $this
+ * @param {!string} word
+ * @param {!number} position
+ * @param {!boolean} stemmed
+ */
+SearchUnit.addPosition$LSearchUnit$SIB = function ($this, word, position, stemmed) {
+ /** @type {Position} */
+ var positionObj;
+ positionObj = $this.positions[position + ""];
+ if (! positionObj) {
+ $this._size++;
+ $this.positions[position + ""] = ({word: word, position: position, stemmed: stemmed});
+ } else {
+ if (positionObj.word.length < word.length) {
+ positionObj.word = word;
+ }
+ positionObj.stemmed = positionObj.stemmed && stemmed;
+ }
+};
+
+var SearchUnit$addPosition$LSearchUnit$SIB = SearchUnit.addPosition$LSearchUnit$SIB;
+
+/**
+ * @param {SearchUnit} $this
+ * @param {!number} position
+ * @return {Position}
+ */
+SearchUnit.get$LSearchUnit$I = function ($this, position) {
+ return $this.positions[position + ""];
+};
+
+var SearchUnit$get$LSearchUnit$I = SearchUnit.get$LSearchUnit$I;
+
+/**
+ * @param {SearchUnit} $this
+ * @return {!number}
+ */
+SearchUnit.size$LSearchUnit$ = function ($this) {
+ return $this._size;
+};
+
+var SearchUnit$size$LSearchUnit$ = SearchUnit.size$LSearchUnit$;
+
+/**
+ * @param {SearchUnit} $this
+ * @param {SearchUnit} rhs
+ */
+SearchUnit.merge$LSearchUnit$LSearchUnit$ = function ($this, rhs) {
+ /** @type {!string} */
+ var position;
+ /** @type {Position} */
+ var pos;
+ for (position in rhs.positions) {
+ pos = rhs.positions[position];
+ SearchUnit$addPosition$LSearchUnit$SIB($this, pos.word, pos.position, pos.stemmed);
+ }
+};
+
+var SearchUnit$merge$LSearchUnit$LSearchUnit$ = SearchUnit.merge$LSearchUnit$LSearchUnit$;
+
+/**
+ * @param {SearchUnit} $this
+ * @return {Array.<undefined|Position>}
+ */
+SearchUnit.getPositions$LSearchUnit$ = function ($this) {
+ /** @type {Array.<undefined|Position>} */
+ var result;
+ /** @type {!string} */
+ var pos;
+ result = [ ];
+ for (pos in $this.positions) {
+ result.push($this.positions[pos]);
+ }
+ result.sort((function (a, b) {
+ return a.position - b.position;
+ }));
+ return result;
+};
+
+var SearchUnit$getPositions$LSearchUnit$ = SearchUnit.getPositions$LSearchUnit$;
+
+/**
+ * class SingleResult extends Object
+ * @constructor
+ */
+function SingleResult() {
+}
+
+/**
+ * @constructor
+ */
+function SingleResult$() {
+ this.units = [ ];
+ this.unitIds = [ ];
+ this.or = false;
+ this.not = false;
+ this.searchWord = '';
+};
+
+SingleResult$.prototype = new SingleResult;
+
+/**
+ * @constructor
+ * @param {!string} searchWord
+ * @param {!boolean} or
+ * @param {!boolean} not
+ */
+function SingleResult$SBB(searchWord, or, not) {
+ this.units = [ ];
+ this.unitIds = [ ];
+ this.or = or;
+ this.not = not;
+ this.searchWord = searchWord;
+};
+
+SingleResult$SBB.prototype = new SingleResult;
+
+/**
+ * @param {SingleResult} $this
+ * @param {!number} unitId
+ * @return {SearchUnit}
+ */
+SingleResult.getSearchUnit$LSingleResult$I = function ($this, unitId) {
+ /** @type {!number} */
+ var existing;
+ /** @type {SearchUnit} */
+ var result;
+ existing = $this.unitIds.indexOf(unitId);
+ if (existing === -1) {
+ result = ({positions: ({ }), id: unitId, _size: 0, score: 0, startPosition: -1});
+ $this.units.push(result);
+ $this.unitIds.push(unitId);
+ } else {
+ result = $this.units[existing];
+ }
+ return result;
+};
+
+var SingleResult$getSearchUnit$LSingleResult$I = SingleResult.getSearchUnit$LSingleResult$I;
+
+/**
+ * @param {SingleResult} $this
+ * @param {SingleResult} rhs
+ * @return {SingleResult}
+ */
+SingleResult.merge$LSingleResult$LSingleResult$ = function ($this, rhs) {
+ /** @type {SingleResult} */
+ var result;
+ result = ({units: [ ], unitIds: [ ], or: false, not: false, searchWord: ''});
+ if (rhs.or) {
+ SingleResult$_orMerge$LSingleResult$LSingleResult$LSingleResult$($this, result, rhs);
+ } else {
+ if (rhs.not) {
+ SingleResult$_notMerge$LSingleResult$LSingleResult$LSingleResult$($this, result, rhs);
+ } else {
+ SingleResult$_andMerge$LSingleResult$LSingleResult$LSingleResult$($this, result, rhs);
+ }
+ }
+ return result;
+};
+
+var SingleResult$merge$LSingleResult$LSingleResult$ = SingleResult.merge$LSingleResult$LSingleResult$;
+
+/**
+ * @param {SingleResult} $this
+ * @return {!number}
+ */
+SingleResult.size$LSingleResult$ = function ($this) {
+ return ($this.units.length | 0);
+};
+
+var SingleResult$size$LSingleResult$ = SingleResult.size$LSingleResult$;
+
+/**
+ * @param {SingleResult} $this
+ * @param {SingleResult} result
+ * @param {SingleResult} rhs
+ */
+SingleResult._andMerge$LSingleResult$LSingleResult$LSingleResult$ = function ($this, result, rhs) {
+ /** @type {!number} */
+ var i;
+ /** @type {undefined|!number} */
+ var id;
+ /** @type {SearchUnit} */
+ var lhsSection;
+ for (i = 0; i < $this.unitIds.length; i++) {
+ id = $this.unitIds[i];
+ if (rhs.unitIds.indexOf(id) !== -1) {
+ lhsSection = $this.units[i];
+ result.unitIds.push(id);
+ result.units.push(lhsSection);
+ }
+ }
+};
+
+var SingleResult$_andMerge$LSingleResult$LSingleResult$LSingleResult$ = SingleResult._andMerge$LSingleResult$LSingleResult$LSingleResult$;
+
+/**
+ * @param {SingleResult} $this
+ * @param {SingleResult} result
+ * @param {SingleResult} rhs
+ */
+SingleResult._orMerge$LSingleResult$LSingleResult$LSingleResult$ = function ($this, result, rhs) {
+ /** @type {!number} */
+ var i;
+ /** @type {undefined|!number} */
+ var id;
+ /** @type {SearchUnit} */
+ var rhsSection;
+ /** @type {SearchUnit} */
+ var lhsSection;
+ /** @type {Array.<undefined|!number>} */
+ var unitIds$0;
+ /** @type {Array.<undefined|SearchUnit>} */
+ var units$0;
+ result.unitIds = (unitIds$0 = $this.unitIds).slice(0, unitIds$0.length);
+ result.units = (units$0 = $this.units).slice(0, units$0.length);
+ for (i = 0; i < rhs.unitIds.length; i++) {
+ id = rhs.unitIds[i];
+ rhsSection = rhs.units[i];
+ if (result.unitIds.indexOf(id) !== -1) {
+ lhsSection = result.units[result.unitIds.indexOf(id)];
+ SearchUnit$merge$LSearchUnit$LSearchUnit$(lhsSection, rhsSection);
+ } else {
+ result.unitIds.push(id);
+ result.units.push(rhsSection);
+ }
+ }
+};
+
+var SingleResult$_orMerge$LSingleResult$LSingleResult$LSingleResult$ = SingleResult._orMerge$LSingleResult$LSingleResult$LSingleResult$;
+
+/**
+ * @param {SingleResult} $this
+ * @param {SingleResult} result
+ * @param {SingleResult} rhs
+ */
+SingleResult._notMerge$LSingleResult$LSingleResult$LSingleResult$ = function ($this, result, rhs) {
+ /** @type {!number} */
+ var i;
+ /** @type {undefined|!number} */
+ var id;
+ /** @type {SearchUnit} */
+ var lhsSection;
+ for (i = 0; i < $this.unitIds.length; i++) {
+ id = $this.unitIds[i];
+ if (rhs.unitIds.indexOf(id) === -1) {
+ lhsSection = $this.units[i];
+ result.unitIds.push(id);
+ result.units.push(lhsSection);
+ }
+ }
+};
+
+var SingleResult$_notMerge$LSingleResult$LSingleResult$LSingleResult$ = SingleResult._notMerge$LSingleResult$LSingleResult$LSingleResult$;
+
+/**
+ * class SearchSummary extends Object
+ * @constructor
+ */
+function SearchSummary() {
+}
+
+/**
+ * @constructor
+ */
+function SearchSummary$() {
+ this.sourceResults = [ ];
+ this.result = null;
+ this.oktavia = null;
+};
+
+SearchSummary$.prototype = new SearchSummary;
+
+/**
+ * @constructor
+ * @param {Oktavia} oktavia
+ */
+function SearchSummary$LOktavia$(oktavia) {
+ this.sourceResults = [ ];
+ this.result = null;
+ this.oktavia = oktavia;
+};
+
+SearchSummary$LOktavia$.prototype = new SearchSummary;
+
+/**
+ * @param {SearchSummary} $this
+ * @param {SingleResult} result
+ */
+SearchSummary.addQuery$LSearchSummary$LSingleResult$ = function ($this, result) {
+ $this.sourceResults.push(result);
+};
+
+var SearchSummary$addQuery$LSearchSummary$LSingleResult$ = SearchSummary.addQuery$LSearchSummary$LSingleResult$;
+
+/**
+ * @param {SearchSummary} $this
+ */
+SearchSummary.mergeResult$LSearchSummary$ = function ($this) {
+ $this.result = SearchSummary$mergeResult$LSearchSummary$ALSingleResult$($this, $this.sourceResults);
+};
+
+var SearchSummary$mergeResult$LSearchSummary$ = SearchSummary.mergeResult$LSearchSummary$;
+
+/**
+ * @param {SearchSummary} $this
+ * @param {Array.<undefined|SingleResult>} results
+ * @return {SingleResult}
+ */
+SearchSummary.mergeResult$LSearchSummary$ALSingleResult$ = function ($this, results) {
+ /** @type {SingleResult} */
+ var rhs;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var results$len$0;
+ rhs = results[0];
+ for ((i = 1, results$len$0 = results.length); i < results$len$0; i++) {
+ rhs = SingleResult$merge$LSingleResult$LSingleResult$(rhs, results[i]);
+ }
+ return rhs;
+};
+
+var SearchSummary$mergeResult$LSearchSummary$ALSingleResult$ = SearchSummary.mergeResult$LSearchSummary$ALSingleResult$;
+
+/**
+ * @param {SearchSummary} $this
+ * @return {Array.<undefined|Proposal>}
+ */
+SearchSummary.getProposal$LSearchSummary$ = function ($this) {
+ /** @type {Array.<undefined|Proposal>} */
+ var proposals;
+ /** @type {!number} */
+ var i;
+ /** @type {Array.<undefined|SingleResult>} */
+ var tmpSource;
+ /** @type {!number} */
+ var j;
+ /** @type {SingleResult} */
+ var result;
+ proposals = [ ];
+ for (i = 0; i < $this.sourceResults.length; i++) {
+ tmpSource = [ ];
+ for (j = 0; j < $this.sourceResults.length; j++) {
+ if (i !== j) {
+ tmpSource.push($this.sourceResults[j]);
+ }
+ }
+ result = SearchSummary$mergeResult$LSearchSummary$ALSingleResult$($this, tmpSource);
+ proposals.push(({omit: i, expect: result.units.length}));
+ }
+ proposals.sort((function (a, b) {
+ return b.expect - a.expect;
+ }));
+ return proposals;
+};
+
+var SearchSummary$getProposal$LSearchSummary$ = SearchSummary.getProposal$LSearchSummary$;
+
+/**
+ * @param {SearchSummary} $this
+ * @return {Array.<undefined|SearchUnit>}
+ */
+SearchSummary.getSortedResult$LSearchSummary$ = function ($this) {
+ /** @type {Array.<undefined|SearchUnit>} */
+ var result;
+ /** @type {Array.<undefined|SearchUnit>} */
+ var units$0;
+ result = (units$0 = $this.result.units).slice(0, units$0.length);
+ result.sort((function (a, b) {
+ return b.score - a.score;
+ }));
+ return result;
+};
+
+var SearchSummary$getSortedResult$LSearchSummary$ = SearchSummary.getSortedResult$LSearchSummary$;
+
+/**
+ * @param {SearchSummary} $this
+ * @return {!number}
+ */
+SearchSummary.size$LSearchSummary$ = function ($this) {
+ /** @type {SingleResult} */
+ var this$0;
+ this$0 = $this.result;
+ return (this$0.units.length | 0);
+};
+
+var SearchSummary$size$LSearchSummary$ = SearchSummary.size$LSearchSummary$;
+
+/**
+ * @param {SearchSummary} $this
+ * @param {SingleResult} result
+ */
+SearchSummary.add$LSearchSummary$LSingleResult$ = function ($this, result) {
+ $this.sourceResults.push(result);
+};
+
+var SearchSummary$add$LSearchSummary$LSingleResult$ = SearchSummary.add$LSearchSummary$LSingleResult$;
+
+/**
+ * class Style extends Object
+ * @constructor
+ */
+function Style() {
+}
+
+/**
+ * @constructor
+ * @param {!string} mode
+ */
+function Style$S(mode) {
+ this.styles = null;
+ this.escapeHTML = false;
+ switch (mode) {
+ case 'console':
+ this.styles = Style.console;
+ break;
+ case 'html':
+ this.styles = Style.html;
+ break;
+ case 'ignore':
+ this.styles = Style.ignore;
+ break;
+ default:
+ this.styles = Style.ignore;
+ break;
+ }
+ this.escapeHTML = mode === 'html';
+};
+
+Style$S.prototype = new Style;
+
+/**
+ * @param {!string} source
+ * @return {!string}
+ */
+Style.prototype.convert$S = function (source) {
+ /** @type {_HTMLHandler} */
+ var handler;
+ /** @type {SAXParser} */
+ var parser;
+ handler = new _HTMLHandler$HASB(this.styles, this.escapeHTML);
+ parser = new SAXParser$LSAXHandler$(handler);
+ parser.parse$S(source);
+ return handler.text.join('');
+};
+
+/**
+ * class Stemmer
+ * @constructor
+ */
+function Stemmer() {
+}
+
+Stemmer.prototype.$__jsx_implements_Stemmer = true;
+
+/**
+ * @constructor
+ */
+function Stemmer$() {
+};
+
+Stemmer$.prototype = new Stemmer;
+
+/**
+ * class BaseStemmer extends Object
+ * @constructor
+ */
+function BaseStemmer() {
+}
+
+$__jsx_merge_interface(BaseStemmer, Stemmer);
+
+/**
+ * @constructor
+ */
+function BaseStemmer$() {
+ /** @type {!string} */
+ var current$0;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var limit$0;
+ this.cache = ({ });
+ current$0 = this.current = "";
+ cursor$0 = this.cursor = 0;
+ limit$0 = this.limit = current$0.length;
+ this.limit_backward = 0;
+ this.bra = cursor$0;
+ this.ket = limit$0;
+};
+
+BaseStemmer$.prototype = new BaseStemmer;
+
+/**
+ * @param {!string} value
+ */
+BaseStemmer.prototype.setCurrent$S = function (value) {
+ /** @type {!string} */
+ var current$0;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var limit$0;
+ current$0 = this.current = value;
+ cursor$0 = this.cursor = 0;
+ limit$0 = this.limit = current$0.length;
+ this.limit_backward = 0;
+ this.bra = cursor$0;
+ this.ket = limit$0;
+};
+
+/**
+ * @return {!string}
+ */
+BaseStemmer.prototype.getCurrent$ = function () {
+ return this.current;
+};
+
+/**
+ * @param {BaseStemmer} other
+ */
+BaseStemmer.prototype.copy_from$LBaseStemmer$ = function (other) {
+ this.current = other.current;
+ this.cursor = other.cursor;
+ this.limit = other.limit;
+ this.limit_backward = other.limit_backward;
+ this.bra = other.bra;
+ this.ket = other.ket;
+};
+
+/**
+ * @param {Array.<undefined|!number>} s
+ * @param {!number} min
+ * @param {!number} max
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.in_grouping$AIII = function (s, min, max) {
+ /** @type {!number} */
+ var ch;
+ if (this.cursor >= this.limit) {
+ return false;
+ }
+ ch = this.current.charCodeAt(this.cursor);
+ if (ch > max || ch < min) {
+ return false;
+ }
+ ch -= min;
+ if ((s[ch >>> 3] & 0x1 << (ch & 0x7)) === 0) {
+ return false;
+ }
+ this.cursor++;
+ return true;
+};
+
+/**
+ * @param {Array.<undefined|!number>} s
+ * @param {!number} min
+ * @param {!number} max
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.in_grouping_b$AIII = function (s, min, max) {
+ /** @type {!number} */
+ var ch;
+ if (this.cursor <= this.limit_backward) {
+ return false;
+ }
+ ch = this.current.charCodeAt(this.cursor - 1);
+ if (ch > max || ch < min) {
+ return false;
+ }
+ ch -= min;
+ if ((s[ch >>> 3] & 0x1 << (ch & 0x7)) === 0) {
+ return false;
+ }
+ this.cursor--;
+ return true;
+};
+
+/**
+ * @param {Array.<undefined|!number>} s
+ * @param {!number} min
+ * @param {!number} max
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.out_grouping$AIII = function (s, min, max) {
+ /** @type {!number} */
+ var ch;
+ if (this.cursor >= this.limit) {
+ return false;
+ }
+ ch = this.current.charCodeAt(this.cursor);
+ if (ch > max || ch < min) {
+ this.cursor++;
+ return true;
+ }
+ ch -= min;
+ if ((s[ch >>> 3] & 0X1 << (ch & 0x7)) === 0) {
+ this.cursor++;
+ return true;
+ }
+ return false;
+};
+
+/**
+ * @param {Array.<undefined|!number>} s
+ * @param {!number} min
+ * @param {!number} max
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.out_grouping_b$AIII = function (s, min, max) {
+ /** @type {!number} */
+ var ch;
+ if (this.cursor <= this.limit_backward) {
+ return false;
+ }
+ ch = this.current.charCodeAt(this.cursor - 1);
+ if (ch > max || ch < min) {
+ this.cursor--;
+ return true;
+ }
+ ch -= min;
+ if ((s[ch >>> 3] & 0x1 << (ch & 0x7)) === 0) {
+ this.cursor--;
+ return true;
+ }
+ return false;
+};
+
+/**
+ * @param {!number} min
+ * @param {!number} max
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.in_range$II = function (min, max) {
+ /** @type {!number} */
+ var ch;
+ if (this.cursor >= this.limit) {
+ return false;
+ }
+ ch = this.current.charCodeAt(this.cursor);
+ if (ch > max || ch < min) {
+ return false;
+ }
+ this.cursor++;
+ return true;
+};
+
+/**
+ * @param {!number} min
+ * @param {!number} max
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.in_range_b$II = function (min, max) {
+ /** @type {!number} */
+ var ch;
+ if (this.cursor <= this.limit_backward) {
+ return false;
+ }
+ ch = this.current.charCodeAt(this.cursor - 1);
+ if (ch > max || ch < min) {
+ return false;
+ }
+ this.cursor--;
+ return true;
+};
+
+/**
+ * @param {!number} min
+ * @param {!number} max
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.out_range$II = function (min, max) {
+ /** @type {!number} */
+ var ch;
+ if (this.cursor >= this.limit) {
+ return false;
+ }
+ ch = this.current.charCodeAt(this.cursor);
+ if (! (ch > max || ch < min)) {
+ return false;
+ }
+ this.cursor++;
+ return true;
+};
+
+/**
+ * @param {!number} min
+ * @param {!number} max
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.out_range_b$II = function (min, max) {
+ /** @type {!number} */
+ var ch;
+ if (this.cursor <= this.limit_backward) {
+ return false;
+ }
+ ch = this.current.charCodeAt(this.cursor - 1);
+ if (! (ch > max || ch < min)) {
+ return false;
+ }
+ this.cursor--;
+ return true;
+};
+
+/**
+ * @param {!number} s_size
+ * @param {!string} s
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.eq_s$IS = function (s_size, s) {
+ /** @type {!number} */
+ var cursor$0;
+ if (this.limit - this.cursor < s_size) {
+ return false;
+ }
+ if (this.current.slice(cursor$0 = this.cursor, cursor$0 + s_size) !== s) {
+ return false;
+ }
+ this.cursor += s_size;
+ return true;
+};
+
+/**
+ * @param {!number} s_size
+ * @param {!string} s
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.eq_s_b$IS = function (s_size, s) {
+ /** @type {!number} */
+ var cursor$0;
+ if (this.cursor - this.limit_backward < s_size) {
+ return false;
+ }
+ if (this.current.slice((cursor$0 = this.cursor) - s_size, cursor$0) !== s) {
+ return false;
+ }
+ this.cursor -= s_size;
+ return true;
+};
+
+/**
+ * @param {!string} s
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.eq_v$S = function (s) {
+ return this.eq_s$IS(s.length, s);
+};
+
+/**
+ * @param {!string} s
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.eq_v_b$S = function (s) {
+ return this.eq_s_b$IS(s.length, s);
+};
+
+/**
+ * @param {Array.<undefined|Among>} v
+ * @param {!number} v_size
+ * @return {!number}
+ */
+BaseStemmer.prototype.find_among$ALAmong$I = function (v, v_size) {
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var j;
+ /** @type {!number} */
+ var c;
+ /** @type {!number} */
+ var l;
+ /** @type {!number} */
+ var common_i;
+ /** @type {!number} */
+ var common_j;
+ /** @type {!boolean} */
+ var first_key_inspected;
+ /** @type {!number} */
+ var k;
+ /** @type {!number} */
+ var diff;
+ /** @type {!number} */
+ var common;
+ /** @type {Among} */
+ var w;
+ /** @type {!number} */
+ var i2;
+ /** @type {!boolean} */
+ var res;
+ i = 0;
+ j = v_size;
+ c = this.cursor;
+ l = this.limit;
+ common_i = 0;
+ common_j = 0;
+ first_key_inspected = false;
+ while (true) {
+ k = i + (j - i >>> 1);
+ diff = 0;
+ common = (common_i < common_j ? common_i : common_j);
+ w = v[k];
+ for (i2 = common; i2 < w.s_size; i2++) {
+ if (c + common === l) {
+ diff = -1;
+ break;
+ }
+ diff = this.current.charCodeAt(c + common) - w.s.charCodeAt(i2);
+ if (diff !== 0) {
+ break;
+ }
+ common++;
+ }
+ if (diff < 0) {
+ j = k;
+ common_j = common;
+ } else {
+ i = k;
+ common_i = common;
+ }
+ if (j - i <= 1) {
+ if (i > 0) {
+ break;
+ }
+ if (j === i) {
+ break;
+ }
+ if (first_key_inspected) {
+ break;
+ }
+ first_key_inspected = true;
+ }
+ }
+ while (true) {
+ w = v[i];
+ if (common_i >= w.s_size) {
+ this.cursor = (c + w.s_size | 0);
+ if (w.method == null) {
+ return w.result;
+ }
+ res = w.method(w.instance);
+ this.cursor = (c + w.s_size | 0);
+ if (res) {
+ return w.result;
+ }
+ }
+ i = w.substring_i;
+ if (i < 0) {
+ return 0;
+ }
+ }
+ return -1;
+};
+
+/**
+ * @param {Array.<undefined|Among>} v
+ * @param {!number} v_size
+ * @return {!number}
+ */
+BaseStemmer.prototype.find_among_b$ALAmong$I = function (v, v_size) {
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var j;
+ /** @type {!number} */
+ var c;
+ /** @type {!number} */
+ var lb;
+ /** @type {!number} */
+ var common_i;
+ /** @type {!number} */
+ var common_j;
+ /** @type {!boolean} */
+ var first_key_inspected;
+ /** @type {!number} */
+ var k;
+ /** @type {!number} */
+ var diff;
+ /** @type {!number} */
+ var common;
+ /** @type {Among} */
+ var w;
+ /** @type {!number} */
+ var i2;
+ /** @type {!boolean} */
+ var res;
+ i = 0;
+ j = v_size;
+ c = this.cursor;
+ lb = this.limit_backward;
+ common_i = 0;
+ common_j = 0;
+ first_key_inspected = false;
+ while (true) {
+ k = i + (j - i >> 1);
+ diff = 0;
+ common = (common_i < common_j ? common_i : common_j);
+ w = v[k];
+ for (i2 = w.s_size - 1 - common; i2 >= 0; i2--) {
+ if (c - common === lb) {
+ diff = -1;
+ break;
+ }
+ diff = this.current.charCodeAt(c - 1 - common) - w.s.charCodeAt(i2);
+ if (diff !== 0) {
+ break;
+ }
+ common++;
+ }
+ if (diff < 0) {
+ j = k;
+ common_j = common;
+ } else {
+ i = k;
+ common_i = common;
+ }
+ if (j - i <= 1) {
+ if (i > 0) {
+ break;
+ }
+ if (j === i) {
+ break;
+ }
+ if (first_key_inspected) {
+ break;
+ }
+ first_key_inspected = true;
+ }
+ }
+ while (true) {
+ w = v[i];
+ if (common_i >= w.s_size) {
+ this.cursor = (c - w.s_size | 0);
+ if (w.method == null) {
+ return w.result;
+ }
+ res = w.method(this);
+ this.cursor = (c - w.s_size | 0);
+ if (res) {
+ return w.result;
+ }
+ }
+ i = w.substring_i;
+ if (i < 0) {
+ return 0;
+ }
+ }
+ return -1;
+};
+
+/**
+ * @param {!number} c_bra
+ * @param {!number} c_ket
+ * @param {!string} s
+ * @return {!number}
+ */
+BaseStemmer.prototype.replace_s$IIS = function (c_bra, c_ket, s) {
+ /** @type {!number} */
+ var adjustment;
+ adjustment = s.length - (c_ket - c_bra);
+ this.current = this.current.slice(0, c_bra) + s + this.current.slice(c_ket);
+ this.limit += (adjustment | 0);
+ if (this.cursor >= c_ket) {
+ this.cursor += (adjustment | 0);
+ } else {
+ if (this.cursor > c_bra) {
+ this.cursor = c_bra;
+ }
+ }
+ return (adjustment | 0);
+};
+
+/**
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.slice_check$ = function () {
+ /** @type {!number} */
+ var bra$0;
+ /** @type {!number} */
+ var ket$0;
+ /** @type {!number} */
+ var limit$0;
+ return ((bra$0 = this.bra) < 0 || bra$0 > (ket$0 = this.ket) || ket$0 > (limit$0 = this.limit) || limit$0 > this.current.length ? false : true);
+};
+
+/**
+ * @param {!string} s
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.slice_from$S = function (s) {
+ /** @type {!boolean} */
+ var result;
+ /** @type {!number} */
+ var bra$0;
+ /** @type {!number} */
+ var ket$0;
+ /** @type {!number} */
+ var limit$0;
+ result = false;
+ if ((bra$0 = this.bra) < 0 || bra$0 > (ket$0 = this.ket) || ket$0 > (limit$0 = this.limit) || limit$0 > this.current.length ? false : true) {
+ this.replace_s$IIS(this.bra, this.ket, s);
+ result = true;
+ }
+ return result;
+};
+
+/**
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.slice_del$ = function () {
+ return this.slice_from$S("");
+};
+
+/**
+ * @param {!number} c_bra
+ * @param {!number} c_ket
+ * @param {!string} s
+ */
+BaseStemmer.prototype.insert$IIS = function (c_bra, c_ket, s) {
+ /** @type {!number} */
+ var adjustment;
+ adjustment = this.replace_s$IIS(c_bra, c_ket, s);
+ if (c_bra <= this.bra) {
+ this.bra += (adjustment | 0);
+ }
+ if (c_bra <= this.ket) {
+ this.ket += (adjustment | 0);
+ }
+};
+
+/**
+ * @param {!string} s
+ * @return {!string}
+ */
+BaseStemmer.prototype.slice_to$S = function (s) {
+ /** @type {!string} */
+ var result;
+ /** @type {!number} */
+ var bra$0;
+ /** @type {!number} */
+ var ket$0;
+ /** @type {!number} */
+ var limit$0;
+ result = '';
+ if ((bra$0 = this.bra) < 0 || bra$0 > (ket$0 = this.ket) || ket$0 > (limit$0 = this.limit) || limit$0 > this.current.length ? false : true) {
+ result = this.current.slice(this.bra, this.ket);
+ }
+ return result;
+};
+
+/**
+ * @param {!string} s
+ * @return {!string}
+ */
+BaseStemmer.prototype.assign_to$S = function (s) {
+ return this.current.slice(0, this.limit);
+};
+
+/**
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.stem$ = function () {
+ return false;
+};
+
+/**
+ * @param {!string} word
+ * @return {!string}
+ */
+BaseStemmer.prototype.stemWord$S = function (word) {
+ /** @type {undefined|!string} */
+ var result;
+ /** @type {!string} */
+ var current$0;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var limit$0;
+ result = this.cache['.' + word];
+ if (result == null) {
+ current$0 = this.current = word;
+ cursor$0 = this.cursor = 0;
+ limit$0 = this.limit = current$0.length;
+ this.limit_backward = 0;
+ this.bra = cursor$0;
+ this.ket = limit$0;
+ this.stem$();
+ result = this.current;
+ this.cache['.' + word] = result;
+ }
+ return result;
+};
+
+/**
+ * @param {Array.<undefined|!string>} words
+ * @return {Array.<undefined|!string>}
+ */
+BaseStemmer.prototype.stemWords$AS = function (words) {
+ /** @type {Array.<undefined|!string>} */
+ var results;
+ /** @type {!number} */
+ var i;
+ /** @type {undefined|!string} */
+ var word;
+ /** @type {undefined|!string} */
+ var result;
+ /** @type {!string} */
+ var current$0;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var limit$0;
+ results = [ ];
+ for (i = 0; i < words.length; i++) {
+ word = words[i];
+ result = this.cache['.' + word];
+ if (result == null) {
+ current$0 = this.current = word;
+ cursor$0 = this.cursor = 0;
+ limit$0 = this.limit = current$0.length;
+ this.limit_backward = 0;
+ this.bra = cursor$0;
+ this.ket = limit$0;
+ this.stem$();
+ result = this.current;
+ this.cache['.' + word] = result;
+ }
+ results.push(result);
+ }
+ return results;
+};
+
+/**
+ * class DutchStemmer extends BaseStemmer
+ * @constructor
+ */
+function DutchStemmer() {
+}
+
+DutchStemmer.prototype = new BaseStemmer;
+/**
+ * @constructor
+ */
+function DutchStemmer$() {
+ BaseStemmer$.call(this);
+ this.I_p2 = 0;
+ this.I_p1 = 0;
+ this.B_e_found = false;
+};
+
+DutchStemmer$.prototype = new DutchStemmer;
+
+/**
+ * @param {DutchStemmer} other
+ */
+DutchStemmer.prototype.copy_from$LDutchStemmer$ = function (other) {
+ this.I_p2 = other.I_p2;
+ this.I_p1 = other.I_p1;
+ this.B_e_found = other.B_e_found;
+ BaseStemmer.prototype.copy_from$LBaseStemmer$.call(this, other);
+};
+
+/**
+ * @return {!boolean}
+ */
+DutchStemmer.prototype.r_prelude$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var v_3;
+ /** @type {!number} */
+ var v_4;
+ /** @type {!number} */
+ var v_5;
+ /** @type {!number} */
+ var v_6;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!boolean} */
+ var lab2;
+ /** @type {!boolean} */
+ var lab4;
+ /** @type {!boolean} */
+ var lab6;
+ /** @type {!boolean} */
+ var lab7;
+ /** @type {!boolean} */
+ var lab8;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var cursor$1;
+ v_1 = this.cursor;
+replab0:
+ while (true) {
+ v_2 = this.cursor;
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ this.bra = this.cursor;
+ among_var = this.find_among$ALAmong$I(DutchStemmer.a_0, 11);
+ if (among_var === 0) {
+ break lab1;
+ }
+ this.ket = this.cursor;
+ switch (among_var) {
+ case 0:
+ break lab1;
+ case 1:
+ if (! this.slice_from$S("a")) {
+ return false;
+ }
+ break;
+ case 2:
+ if (! this.slice_from$S("e")) {
+ return false;
+ }
+ break;
+ case 3:
+ if (! this.slice_from$S("i")) {
+ return false;
+ }
+ break;
+ case 4:
+ if (! this.slice_from$S("o")) {
+ return false;
+ }
+ break;
+ case 5:
+ if (! this.slice_from$S("u")) {
+ return false;
+ }
+ break;
+ case 6:
+ if (this.cursor >= this.limit) {
+ break lab1;
+ }
+ this.cursor++;
+ break;
+ }
+ continue replab0;
+ }
+ this.cursor = v_2;
+ break replab0;
+ }
+ cursor$0 = this.cursor = v_1;
+ v_3 = cursor$0;
+ lab2 = true;
+lab2:
+ while (lab2 === true) {
+ lab2 = false;
+ this.bra = this.cursor;
+ if (! this.eq_s$IS(1, "y")) {
+ this.cursor = v_3;
+ break lab2;
+ }
+ this.ket = this.cursor;
+ if (! this.slice_from$S("Y")) {
+ return false;
+ }
+ }
+replab3:
+ while (true) {
+ v_4 = this.cursor;
+ lab4 = true;
+ lab4:
+ while (lab4 === true) {
+ lab4 = false;
+ golab5:
+ while (true) {
+ v_5 = this.cursor;
+ lab6 = true;
+ lab6:
+ while (lab6 === true) {
+ lab6 = false;
+ if (! this.in_grouping$AIII(DutchStemmer.g_v, 97, 232)) {
+ break lab6;
+ }
+ this.bra = this.cursor;
+ lab7 = true;
+ lab7:
+ while (lab7 === true) {
+ lab7 = false;
+ v_6 = this.cursor;
+ lab8 = true;
+ lab8:
+ while (lab8 === true) {
+ lab8 = false;
+ if (! this.eq_s$IS(1, "i")) {
+ break lab8;
+ }
+ this.ket = this.cursor;
+ if (! this.in_grouping$AIII(DutchStemmer.g_v, 97, 232)) {
+ break lab8;
+ }
+ if (! this.slice_from$S("I")) {
+ return false;
+ }
+ break lab7;
+ }
+ this.cursor = v_6;
+ if (! this.eq_s$IS(1, "y")) {
+ break lab6;
+ }
+ this.ket = this.cursor;
+ if (! this.slice_from$S("Y")) {
+ return false;
+ }
+ }
+ this.cursor = v_5;
+ break golab5;
+ }
+ cursor$1 = this.cursor = v_5;
+ if (cursor$1 >= this.limit) {
+ break lab4;
+ }
+ this.cursor++;
+ }
+ continue replab3;
+ }
+ this.cursor = v_4;
+ break replab3;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+DutchStemmer.prototype.r_mark_regions$ = function () {
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!boolean} */
+ var lab3;
+ /** @type {!boolean} */
+ var lab4;
+ /** @type {!boolean} */
+ var lab6;
+ /** @type {!boolean} */
+ var lab8;
+ /** @type {!number} */
+ var limit$0;
+ this.I_p1 = limit$0 = this.limit;
+ this.I_p2 = limit$0;
+golab0:
+ while (true) {
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ if (! this.in_grouping$AIII(DutchStemmer.g_v, 97, 232)) {
+ break lab1;
+ }
+ break golab0;
+ }
+ if (this.cursor >= this.limit) {
+ return false;
+ }
+ this.cursor++;
+ }
+golab2:
+ while (true) {
+ lab3 = true;
+ lab3:
+ while (lab3 === true) {
+ lab3 = false;
+ if (! this.out_grouping$AIII(DutchStemmer.g_v, 97, 232)) {
+ break lab3;
+ }
+ break golab2;
+ }
+ if (this.cursor >= this.limit) {
+ return false;
+ }
+ this.cursor++;
+ }
+ this.I_p1 = this.cursor;
+ lab4 = true;
+lab4:
+ while (lab4 === true) {
+ lab4 = false;
+ if (! (this.I_p1 < 3)) {
+ break lab4;
+ }
+ this.I_p1 = 3;
+ }
+golab5:
+ while (true) {
+ lab6 = true;
+ lab6:
+ while (lab6 === true) {
+ lab6 = false;
+ if (! this.in_grouping$AIII(DutchStemmer.g_v, 97, 232)) {
+ break lab6;
+ }
+ break golab5;
+ }
+ if (this.cursor >= this.limit) {
+ return false;
+ }
+ this.cursor++;
+ }
+golab7:
+ while (true) {
+ lab8 = true;
+ lab8:
+ while (lab8 === true) {
+ lab8 = false;
+ if (! this.out_grouping$AIII(DutchStemmer.g_v, 97, 232)) {
+ break lab8;
+ }
+ break golab7;
+ }
+ if (this.cursor >= this.limit) {
+ return false;
+ }
+ this.cursor++;
+ }
+ this.I_p2 = this.cursor;
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+DutchStemmer.prototype.r_postlude$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var v_1;
+ /** @type {!boolean} */
+ var lab1;
+replab0:
+ while (true) {
+ v_1 = this.cursor;
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ this.bra = this.cursor;
+ among_var = this.find_among$ALAmong$I(DutchStemmer.a_1, 3);
+ if (among_var === 0) {
+ break lab1;
+ }
+ this.ket = this.cursor;
+ switch (among_var) {
+ case 0:
+ break lab1;
+ case 1:
+ if (! this.slice_from$S("y")) {
+ return false;
+ }
+ break;
+ case 2:
+ if (! this.slice_from$S("i")) {
+ return false;
+ }
+ break;
+ case 3:
+ if (this.cursor >= this.limit) {
+ break lab1;
+ }
+ this.cursor++;
+ break;
+ }
+ continue replab0;
+ }
+ this.cursor = v_1;
+ break replab0;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+DutchStemmer.prototype.r_R1$ = function () {
+ return (! (this.I_p1 <= this.cursor) ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+DutchStemmer.prototype.r_R2$ = function () {
+ return (! (this.I_p2 <= this.cursor) ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+DutchStemmer.prototype.r_undouble$ = function () {
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var cursor$0;
+ v_1 = this.limit - this.cursor;
+ if (this.find_among_b$ALAmong$I(DutchStemmer.a_2, 3) === 0) {
+ return false;
+ }
+ cursor$0 = this.cursor = this.limit - v_1;
+ this.ket = cursor$0;
+ if (cursor$0 <= this.limit_backward) {
+ return false;
+ }
+ this.cursor--;
+ this.bra = this.cursor;
+ return (! this.slice_from$S("") ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+DutchStemmer.prototype.r_e_ending$ = function () {
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var cursor$0;
+ this.B_e_found = false;
+ this.ket = this.cursor;
+ if (! this.eq_s_b$IS(1, "e")) {
+ return false;
+ }
+ this.bra = cursor$0 = this.cursor;
+ if (! (! (this.I_p1 <= cursor$0) ? false : true)) {
+ return false;
+ }
+ v_1 = this.limit - this.cursor;
+ if (! this.out_grouping_b$AIII(DutchStemmer.g_v, 97, 232)) {
+ return false;
+ }
+ this.cursor = this.limit - v_1;
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ this.B_e_found = true;
+ return (! this.r_undouble$() ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+DutchStemmer.prototype.r_en_ending$ = function () {
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!number} */
+ var limit$0;
+ /** @type {!number} */
+ var cursor$0;
+ if (! (! (this.I_p1 <= this.cursor) ? false : true)) {
+ return false;
+ }
+ v_1 = this.limit - this.cursor;
+ if (! this.out_grouping_b$AIII(DutchStemmer.g_v, 97, 232)) {
+ return false;
+ }
+ cursor$0 = this.cursor = (limit$0 = this.limit) - v_1;
+ v_2 = limit$0 - cursor$0;
+ lab0 = true;
+lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ if (! this.eq_s_b$IS(3, "gem")) {
+ break lab0;
+ }
+ return false;
+ }
+ this.cursor = this.limit - v_2;
+ return (! this.slice_from$S("") ? false : ! this.r_undouble$() ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+DutchStemmer.prototype.r_standard_suffix$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var v_3;
+ /** @type {!number} */
+ var v_4;
+ /** @type {!number} */
+ var v_5;
+ /** @type {!number} */
+ var v_6;
+ /** @type {!number} */
+ var v_7;
+ /** @type {!number} */
+ var v_8;
+ /** @type {!number} */
+ var v_9;
+ /** @type {!number} */
+ var v_10;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!boolean} */
+ var lab2;
+ /** @type {!boolean} */
+ var lab3;
+ /** @type {!boolean} */
+ var lab4;
+ /** @type {!boolean} */
+ var lab5;
+ /** @type {!boolean} */
+ var lab6;
+ /** @type {!boolean} */
+ var lab7;
+ /** @type {!boolean} */
+ var lab8;
+ /** @type {!boolean} */
+ var lab9;
+ /** @type {!number} */
+ var limit$0;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var cursor$1;
+ /** @type {!number} */
+ var limit$1;
+ /** @type {!number} */
+ var cursor$2;
+ /** @type {!number} */
+ var cursor$3;
+ /** @type {!number} */
+ var limit$2;
+ /** @type {!number} */
+ var cursor$4;
+ /** @type {!number} */
+ var cursor$5;
+ /** @type {!number} */
+ var limit$3;
+ /** @type {!number} */
+ var cursor$6;
+ v_1 = this.limit - this.cursor;
+ lab0 = true;
+lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ this.ket = this.cursor;
+ among_var = this.find_among_b$ALAmong$I(DutchStemmer.a_3, 5);
+ if (among_var === 0) {
+ break lab0;
+ }
+ this.bra = this.cursor;
+ switch (among_var) {
+ case 0:
+ break lab0;
+ case 1:
+ if (! (! (this.I_p1 <= this.cursor) ? false : true)) {
+ break lab0;
+ }
+ if (! this.slice_from$S("heid")) {
+ return false;
+ }
+ break;
+ case 2:
+ if (! this.r_en_ending$()) {
+ break lab0;
+ }
+ break;
+ case 3:
+ if (! (! (this.I_p1 <= this.cursor) ? false : true)) {
+ break lab0;
+ }
+ if (! this.out_grouping_b$AIII(DutchStemmer.g_v_j, 97, 232)) {
+ break lab0;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ }
+ }
+ cursor$0 = this.cursor = (limit$0 = this.limit) - v_1;
+ v_2 = limit$0 - cursor$0;
+ lab1 = true;
+lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ if (! this.r_e_ending$()) {
+ break lab1;
+ }
+ }
+ cursor$2 = this.cursor = (limit$1 = this.limit) - v_2;
+ v_3 = limit$1 - cursor$2;
+ lab2 = true;
+lab2:
+ while (lab2 === true) {
+ lab2 = false;
+ this.ket = this.cursor;
+ if (! this.eq_s_b$IS(4, "heid")) {
+ break lab2;
+ }
+ this.bra = cursor$1 = this.cursor;
+ if (! (! (this.I_p2 <= cursor$1) ? false : true)) {
+ break lab2;
+ }
+ v_4 = this.limit - this.cursor;
+ lab3 = true;
+ lab3:
+ while (lab3 === true) {
+ lab3 = false;
+ if (! this.eq_s_b$IS(1, "c")) {
+ break lab3;
+ }
+ break lab2;
+ }
+ this.cursor = this.limit - v_4;
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ this.ket = this.cursor;
+ if (! this.eq_s_b$IS(2, "en")) {
+ break lab2;
+ }
+ this.bra = this.cursor;
+ if (! this.r_en_ending$()) {
+ break lab2;
+ }
+ }
+ cursor$4 = this.cursor = (limit$2 = this.limit) - v_3;
+ v_5 = limit$2 - cursor$4;
+ lab4 = true;
+lab4:
+ while (lab4 === true) {
+ lab4 = false;
+ this.ket = this.cursor;
+ among_var = this.find_among_b$ALAmong$I(DutchStemmer.a_4, 6);
+ if (among_var === 0) {
+ break lab4;
+ }
+ this.bra = this.cursor;
+ switch (among_var) {
+ case 0:
+ break lab4;
+ case 1:
+ if (! (! (this.I_p2 <= this.cursor) ? false : true)) {
+ break lab4;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ lab5 = true;
+ lab5:
+ while (lab5 === true) {
+ lab5 = false;
+ v_6 = this.limit - this.cursor;
+ lab6 = true;
+ lab6:
+ while (lab6 === true) {
+ lab6 = false;
+ this.ket = this.cursor;
+ if (! this.eq_s_b$IS(2, "ig")) {
+ break lab6;
+ }
+ this.bra = cursor$3 = this.cursor;
+ if (! (! (this.I_p2 <= cursor$3) ? false : true)) {
+ break lab6;
+ }
+ v_7 = this.limit - this.cursor;
+ lab7 = true;
+ lab7:
+ while (lab7 === true) {
+ lab7 = false;
+ if (! this.eq_s_b$IS(1, "e")) {
+ break lab7;
+ }
+ break lab6;
+ }
+ this.cursor = this.limit - v_7;
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break lab5;
+ }
+ this.cursor = this.limit - v_6;
+ if (! this.r_undouble$()) {
+ break lab4;
+ }
+ }
+ break;
+ case 2:
+ if (! (! (this.I_p2 <= this.cursor) ? false : true)) {
+ break lab4;
+ }
+ v_8 = this.limit - this.cursor;
+ lab8 = true;
+ lab8:
+ while (lab8 === true) {
+ lab8 = false;
+ if (! this.eq_s_b$IS(1, "e")) {
+ break lab8;
+ }
+ break lab4;
+ }
+ this.cursor = this.limit - v_8;
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 3:
+ if (! (! (this.I_p2 <= this.cursor) ? false : true)) {
+ break lab4;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ if (! this.r_e_ending$()) {
+ break lab4;
+ }
+ break;
+ case 4:
+ if (! (! (this.I_p2 <= this.cursor) ? false : true)) {
+ break lab4;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 5:
+ if (! (! (this.I_p2 <= this.cursor) ? false : true)) {
+ break lab4;
+ }
+ if (! this.B_e_found) {
+ break lab4;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ }
+ }
+ cursor$6 = this.cursor = (limit$3 = this.limit) - v_5;
+ v_9 = limit$3 - cursor$6;
+ lab9 = true;
+lab9:
+ while (lab9 === true) {
+ lab9 = false;
+ if (! this.out_grouping_b$AIII(DutchStemmer.g_v_I, 73, 232)) {
+ break lab9;
+ }
+ v_10 = this.limit - this.cursor;
+ if (this.find_among_b$ALAmong$I(DutchStemmer.a_5, 4) === 0) {
+ break lab9;
+ }
+ if (! this.out_grouping_b$AIII(DutchStemmer.g_v, 97, 232)) {
+ break lab9;
+ }
+ cursor$5 = this.cursor = this.limit - v_10;
+ this.ket = cursor$5;
+ if (cursor$5 <= this.limit_backward) {
+ break lab9;
+ }
+ this.cursor--;
+ this.bra = this.cursor;
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ }
+ this.cursor = this.limit - v_9;
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+DutchStemmer.prototype.stem$ = function () {
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var v_4;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!boolean} */
+ var lab2;
+ /** @type {!boolean} */
+ var lab3;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var cursor$1;
+ /** @type {!number} */
+ var cursor$2;
+ v_1 = this.cursor;
+ lab0 = true;
+lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ if (! this.r_prelude$()) {
+ break lab0;
+ }
+ }
+ cursor$0 = this.cursor = v_1;
+ v_2 = cursor$0;
+ lab1 = true;
+lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ if (! this.r_mark_regions$()) {
+ break lab1;
+ }
+ }
+ cursor$1 = this.cursor = v_2;
+ this.limit_backward = cursor$1;
+ this.cursor = this.limit;
+ lab2 = true;
+lab2:
+ while (lab2 === true) {
+ lab2 = false;
+ if (! this.r_standard_suffix$()) {
+ break lab2;
+ }
+ }
+ cursor$2 = this.cursor = this.limit_backward;
+ v_4 = cursor$2;
+ lab3 = true;
+lab3:
+ while (lab3 === true) {
+ lab3 = false;
+ if (! this.r_postlude$()) {
+ break lab3;
+ }
+ }
+ this.cursor = v_4;
+ return true;
+};
+
+/**
+ * @param {*} o
+ * @return {!boolean}
+ */
+DutchStemmer.prototype.equals$X = function (o) {
+ return o instanceof DutchStemmer;
+};
+
+/**
+ * @return {!number}
+ */
+DutchStemmer.prototype.hashCode$ = function () {
+ /** @type {!string} */
+ var classname;
+ /** @type {!number} */
+ var hash;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var char;
+ classname = "DutchStemmer";
+ hash = 0;
+ if ("DutchStemmer".length === 0) {
+ return (hash | 0);
+ }
+ for (i = 0; i < classname.length; i++) {
+ char = classname.charCodeAt(i);
+ hash = (hash << 5) - hash + char;
+ hash = hash & hash;
+ }
+ return (hash | 0);
+};
+
+/**
+ * class Among extends Object
+ * @constructor
+ */
+function Among() {
+}
+
+/**
+ * @constructor
+ * @param {!string} s
+ * @param {!number} substring_i
+ * @param {!number} result
+ */
+function Among$SII(s, substring_i, result) {
+ this.s_size = s.length;
+ this.s = s;
+ this.substring_i = substring_i;
+ this.result = result;
+ this.method = null;
+ this.instance = null;
+};
+
+Among$SII.prototype = new Among;
+
+/**
+ * @constructor
+ * @param {!string} s
+ * @param {!number} substring_i
+ * @param {!number} result
+ * @param {*} method
+ * @param {BaseStemmer} instance
+ */
+function Among$SIIF$LBaseStemmer$B$LBaseStemmer$(s, substring_i, result, method, instance) {
+ this.s_size = s.length;
+ this.s = s;
+ this.substring_i = substring_i;
+ this.result = result;
+ this.method = method;
+ this.instance = instance;
+};
+
+Among$SIIF$LBaseStemmer$B$LBaseStemmer$.prototype = new Among;
+
+/**
+ * class Metadata extends Object
+ * @constructor
+ */
+function Metadata() {
+}
+
+/**
+ * @constructor
+ * @param {Oktavia} parent
+ */
+function Metadata$LOktavia$(parent) {
+ this._parent = parent;
+ this._bitVector = new BitVector$();
+};
+
+Metadata$LOktavia$.prototype = new Metadata;
+
+/**
+ * @return {!number}
+ */
+Metadata.prototype._size$ = function () {
+ /** @type {BitVector} */
+ var this$0;
+ /** @type {!number} */
+ var i$0;
+ /** @type {BitVector} */
+ var _bitVector$0;
+ this$0 = _bitVector$0 = this._bitVector;
+ i$0 = _bitVector$0._size;
+ return this$0.rank$IB(i$0, true);
+};
+
+/**
+ * @param {!number} index
+ * @return {!string}
+ */
+Metadata.prototype.getContent$I = function (index) {
+ /** @type {!number} */
+ var startPosition;
+ /** @type {!number} */
+ var length;
+ if (index < 0 || this._size$() <= index) {
+ throw new Error("Section.getContent() : range error " + (index + ""));
+ }
+ startPosition = 0;
+ if (index > 0) {
+ startPosition = this._bitVector.select$I(index - 1) + 1;
+ }
+ length = this._bitVector.select$I(index) - startPosition + 1;
+ return this._parent._getSubstring$II(startPosition, length);
+};
+
+/**
+ * @param {!number} index
+ * @return {!number}
+ */
+Metadata.prototype.getStartPosition$I = function (index) {
+ /** @type {!number} */
+ var startPosition;
+ if (index < 0 || this._size$() <= index) {
+ throw new Error("Section.getContent() : range error " + (index + ""));
+ }
+ startPosition = 0;
+ if (index > 0) {
+ startPosition = this._bitVector.select$I(index - 1) + 1;
+ }
+ return (startPosition | 0);
+};
+
+/**
+ * @param {SingleResult} result
+ * @param {Array.<undefined|!number>} positions
+ * @param {!string} word
+ * @param {!boolean} stemmed
+ */
+Metadata.prototype.grouping$LSingleResult$AISB = function (result, positions, word, stemmed) {
+};
+
+/**
+ * @param {!number} index
+ * @return {!string}
+ */
+Metadata.prototype.getInformation$I = function (index) {
+ return '';
+};
+
+/**
+ */
+Metadata.prototype._build$ = function () {
+ this._bitVector.build$();
+};
+
+/**
+ * @param {!string} name
+ * @param {!string} data
+ * @param {!number} offset
+ * @return {!number}
+ */
+Metadata.prototype._load$SSI = function (name, data, offset) {
+ offset = this._bitVector.load$SI(data, offset);
+ this._parent._metadataLabels.push(name);
+ this._parent._metadatas[name] = this;
+ return offset;
+};
+
+/**
+ * @return {!string}
+ */
+Metadata.prototype._dump$ = function () {
+ /** @type {BitVector} */
+ var this$0;
+ /** @type {Array.<undefined|!string>} */
+ var contents$0;
+ this$0 = this._bitVector;
+ contents$0 = [ ];
+ contents$0.push(Binary$dump32bitNumber$N(this$0._size));
+ contents$0.push(Binary$dump32bitNumberList$AN(this$0._v));
+ return contents$0.join('');
+};
+
+/**
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+Metadata.prototype._dump$LCompressionReport$ = function (report) {
+ /** @type {BitVector} */
+ var this$0;
+ /** @type {Array.<undefined|!string>} */
+ var contents$0;
+ this$0 = this._bitVector;
+ contents$0 = [ ];
+ contents$0.push(Binary$dump32bitNumber$N(this$0._size));
+ CompressionReport$add$LCompressionReport$II(report, 2, 2);
+ contents$0.push(Binary$dump32bitNumberList$ANLCompressionReport$(this$0._v, report));
+ return contents$0.join('');
+};
+
+/**
+ * class Section extends Metadata
+ * @constructor
+ */
+function Section() {
+}
+
+Section.prototype = new Metadata;
+/**
+ * @constructor
+ * @param {Oktavia} parent
+ */
+function Section$LOktavia$(parent) {
+ this._parent = parent;
+ this._bitVector = new BitVector$();
+ this._names = [ ];
+};
+
+Section$LOktavia$.prototype = new Section;
+
+/**
+ * @param {!string} name
+ */
+Section.prototype.setTail$S = function (name) {
+ /** @type {!number} */
+ var index$0;
+ /** @type {Oktavia} */
+ var this$0;
+ /** @type {FMIndex} */
+ var this$0$0;
+ this$0 = this._parent;
+ this$0$0 = this$0._fmindex;
+ index$0 = this$0$0._substr.length;
+ this._names.push(name);
+ this._bitVector.set$I(index$0 - 1);
+};
+
+/**
+ * @param {!string} name
+ * @param {!number} index
+ */
+Section.prototype.setTail$SI = function (name, index) {
+ this._names.push(name);
+ this._bitVector.set$I(index - 1);
+};
+
+/**
+ * @return {!number}
+ */
+Section.prototype.size$ = function () {
+ return (this._names.length | 0);
+};
+
+/**
+ * @param {!number} position
+ * @return {!number}
+ */
+Section.prototype.getSectionIndex$I = function (position) {
+ /** @type {BitVector} */
+ var this$0;
+ if (position < 0 || this._bitVector.size$() <= position) {
+ throw new Error("Section.getSectionIndex() : range error " + (position + ""));
+ }
+ this$0 = this._bitVector;
+ return this$0.rank$IB(position, true);
+};
+
+/**
+ * @param {!number} index
+ * @return {!string}
+ */
+Section.prototype.getName$I = function (index) {
+ if (index < 0 || this._names.length <= index) {
+ throw new Error("Section.getName() : range error");
+ }
+ return this._names[index];
+};
+
+/**
+ * @param {SingleResult} result
+ * @param {Array.<undefined|!number>} positions
+ * @param {!string} word
+ * @param {!boolean} stemmed
+ */
+Section.prototype.grouping$LSingleResult$AISB = function (result, positions, word, stemmed) {
+ /** @type {!number} */
+ var i;
+ /** @type {undefined|!number} */
+ var position;
+ /** @type {!number} */
+ var index;
+ /** @type {SearchUnit} */
+ var unit;
+ for (i = 0; i < positions.length; i++) {
+ position = positions[i];
+ index = this.getSectionIndex$I(position);
+ unit = SingleResult$getSearchUnit$LSingleResult$I(result, index);
+ if (unit.startPosition < 0) {
+ unit.startPosition = this.getStartPosition$I(index);
+ }
+ SearchUnit$addPosition$LSearchUnit$SIB(unit, word, position - unit.startPosition, stemmed);
+ }
+};
+
+/**
+ * @param {!number} index
+ * @return {!string}
+ */
+Section.prototype.getInformation$I = function (index) {
+ return this.getName$I(index);
+};
+
+/**
+ * @param {Oktavia} parent
+ * @param {!string} name
+ * @param {!string} data
+ * @param {!number} offset
+ * @return {!number}
+ */
+Section._load$LOktavia$SSI = function (parent, name, data, offset) {
+ /** @type {LoadedStringListResult} */
+ var strs;
+ /** @type {Section} */
+ var section;
+ /** @type {!number} */
+ var offset$0;
+ strs = new LoadedStringListResult$SI(data, offset);
+ section = new Section$LOktavia$(parent);
+ section._names = strs.result;
+ offset$0 = strs.offset;
+ offset$0 = section._bitVector.load$SI(data, offset$0);
+ section._parent._metadataLabels.push(name);
+ section._parent._metadatas[name] = section;
+ return offset$0;
+};
+
+var Section$_load$LOktavia$SSI = Section._load$LOktavia$SSI;
+
+/**
+ * @return {!string}
+ */
+Section.prototype._dump$ = function () {
+ return [ Binary$dump16bitNumber$I(0), Binary$dumpStringList$AS(this._names), Metadata.prototype._dump$.call(this) ].join('');
+};
+
+/**
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+Section.prototype._dump$LCompressionReport$ = function (report) {
+ CompressionReport$add$LCompressionReport$II(report, 1, 1);
+ return [ Binary$dump16bitNumber$I(0), Binary$dumpStringList$ASLCompressionReport$(this._names, report), Metadata.prototype._dump$LCompressionReport$.call(this, report) ].join('');
+};
+
+/**
+ * class Splitter extends Metadata
+ * @constructor
+ */
+function Splitter() {
+}
+
+Splitter.prototype = new Metadata;
+/**
+ * @constructor
+ * @param {Oktavia} parent
+ */
+function Splitter$LOktavia$(parent) {
+ this._parent = parent;
+ this._bitVector = new BitVector$();
+ this.name = null;
+};
+
+Splitter$LOktavia$.prototype = new Splitter;
+
+/**
+ * @constructor
+ * @param {Oktavia} parent
+ * @param {!string} name
+ */
+function Splitter$LOktavia$S(parent, name) {
+ this._parent = parent;
+ this._bitVector = new BitVector$();
+ this.name = name;
+};
+
+Splitter$LOktavia$S.prototype = new Splitter;
+
+/**
+ * @return {!number}
+ */
+Splitter.prototype.size$ = function () {
+ /** @type {BitVector} */
+ var this$0$0;
+ /** @type {!number} */
+ var i$0$0;
+ /** @type {BitVector} */
+ var _bitVector$0;
+ this$0$0 = _bitVector$0 = this._bitVector;
+ i$0$0 = _bitVector$0._size;
+ return this$0$0.rank$IB(i$0$0, true);
+};
+
+/**
+ */
+Splitter.prototype.split$ = function () {
+ /** @type {!number} */
+ var index$0;
+ /** @type {Oktavia} */
+ var this$0;
+ /** @type {FMIndex} */
+ var this$0$0;
+ this$0 = this._parent;
+ this$0$0 = this$0._fmindex;
+ index$0 = this$0$0._substr.length;
+ this._bitVector.set$I(index$0 - 1);
+};
+
+/**
+ * @param {!number} index
+ */
+Splitter.prototype.split$I = function (index) {
+ this._bitVector.set$I(index - 1);
+};
+
+/**
+ * @param {!number} position
+ * @return {!number}
+ */
+Splitter.prototype.getIndex$I = function (position) {
+ /** @type {BitVector} */
+ var this$0;
+ if (position < 0 || this._bitVector.size$() <= position) {
+ throw new Error("Section.getSectionIndex() : range error");
+ }
+ this$0 = this._bitVector;
+ return this$0.rank$IB(position, true);
+};
+
+/**
+ * @param {SingleResult} result
+ * @param {Array.<undefined|!number>} positions
+ * @param {!string} word
+ * @param {!boolean} stemmed
+ */
+Splitter.prototype.grouping$LSingleResult$AISB = function (result, positions, word, stemmed) {
+ /** @type {!number} */
+ var i;
+ /** @type {undefined|!number} */
+ var position;
+ /** @type {!number} */
+ var index;
+ /** @type {SearchUnit} */
+ var unit;
+ for (i = 0; i < positions.length; i++) {
+ position = positions[i];
+ index = this.getIndex$I(position);
+ unit = SingleResult$getSearchUnit$LSingleResult$I(result, index);
+ if (unit.startPosition < 0) {
+ unit.startPosition = this.getStartPosition$I(index);
+ }
+ SearchUnit$addPosition$LSearchUnit$SIB(unit, word, position - unit.startPosition, stemmed);
+ }
+};
+
+/**
+ * @param {!number} index
+ * @return {!string}
+ */
+Splitter.prototype.getInformation$I = function (index) {
+ return (this.name != null ? this.name + (index + 1 + "") : '');
+};
+
+/**
+ * @param {Oktavia} parent
+ * @param {!string} name
+ * @param {!string} data
+ * @param {!number} offset
+ * @return {!number}
+ */
+Splitter._load$LOktavia$SSI = function (parent, name, data, offset) {
+ /** @type {Splitter} */
+ var section;
+ section = new Splitter$LOktavia$(parent);
+ offset = section._bitVector.load$SI(data, offset);
+ section._parent._metadataLabels.push(name);
+ section._parent._metadatas[name] = section;
+ return offset;
+};
+
+var Splitter$_load$LOktavia$SSI = Splitter._load$LOktavia$SSI;
+
+/**
+ * @return {!string}
+ */
+Splitter.prototype._dump$ = function () {
+ return [ Binary$dump16bitNumber$I(1), Metadata.prototype._dump$.call(this) ].join('');
+};
+
+/**
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+Splitter.prototype._dump$LCompressionReport$ = function (report) {
+ CompressionReport$add$LCompressionReport$II(report, 1, 1);
+ return [ Binary$dump16bitNumber$I(1), Metadata.prototype._dump$LCompressionReport$.call(this, report) ].join('');
+};
+
+/**
+ * class Table extends Metadata
+ * @constructor
+ */
+function Table() {
+}
+
+Table.prototype = new Metadata;
+/**
+ * @constructor
+ * @param {Oktavia} parent
+ * @param {Array.<undefined|!string>} headers
+ */
+function Table$LOktavia$AS(parent, headers) {
+ this._parent = parent;
+ this._bitVector = new BitVector$();
+ this._headers = headers;
+ this._columnTails = new BitVector$();
+};
+
+Table$LOktavia$AS.prototype = new Table;
+
+/**
+ * @return {!number}
+ */
+Table.prototype.rowSize$ = function () {
+ /** @type {BitVector} */
+ var this$0$0;
+ /** @type {!number} */
+ var i$0$0;
+ /** @type {BitVector} */
+ var _bitVector$0;
+ this$0$0 = _bitVector$0 = this._bitVector;
+ i$0$0 = _bitVector$0._size;
+ return this$0$0.rank$IB(i$0$0, true);
+};
+
+/**
+ * @return {!number}
+ */
+Table.prototype.columnSize$ = function () {
+ return (this._headers.length | 0);
+};
+
+/**
+ */
+Table.prototype.setColumnTail$ = function () {
+ /** @type {!number} */
+ var index;
+ /** @type {Oktavia} */
+ var this$0;
+ /** @type {FMIndex} */
+ var this$0$0;
+ /** @type {Oktavia} */
+ var _parent$0;
+ this$0 = _parent$0 = this._parent;
+ this$0$0 = this$0._fmindex;
+ index = this$0$0._substr.length;
+ _parent$0._fmindex.push$S(Oktavia.eob);
+ this._columnTails.set$I(index - 1);
+};
+
+/**
+ */
+Table.prototype.setRowTail$ = function () {
+ /** @type {!number} */
+ var index;
+ /** @type {Oktavia} */
+ var this$0;
+ /** @type {FMIndex} */
+ var this$0$0;
+ this$0 = this._parent;
+ this$0$0 = this$0._fmindex;
+ index = this$0$0._substr.length;
+ this._bitVector.set$I(index - 1);
+};
+
+/**
+ * @param {!number} position
+ * @return {Array.<undefined|!number>}
+ */
+Table.prototype.getCell$I = function (position) {
+ /** @type {!number} */
+ var row;
+ /** @type {!number} */
+ var currentColumn;
+ /** @type {!number} */
+ var lastRowColumn;
+ /** @type {!number} */
+ var startPosition;
+ /** @type {Array.<undefined|!number>} */
+ var result;
+ /** @type {BitVector} */
+ var this$0;
+ /** @type {BitVector} */
+ var this$1;
+ if (position < 0 || this._bitVector.size$() <= position) {
+ throw new Error("Section.getSectionIndex() : range error " + (position + ""));
+ }
+ this$0 = this._bitVector;
+ row = this$0.rank$IB(position, true);
+ this$1 = this._columnTails;
+ currentColumn = this$1.rank$IB(position, true);
+ lastRowColumn = 0;
+ if (row > 0) {
+ startPosition = this._bitVector.select$I(row - 1) + 1;
+ lastRowColumn = this._columnTails.rank$I(startPosition);
+ }
+ result = [ row, currentColumn - lastRowColumn ];
+ return result;
+};
+
+/**
+ * @param {!number} rowIndex
+ * @return {Object.<string, undefined|!string>}
+ */
+Table.prototype.getRowContent$I = function (rowIndex) {
+ /** @type {!string} */
+ var content;
+ /** @type {Array.<undefined|!string>} */
+ var values;
+ /** @type {Object.<string, undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var i;
+ content = this.getContent$I(rowIndex);
+ values = content.split(Oktavia.eob, this._headers.length);
+ result = ({ });
+ for (i in this._headers) {
+ if (i < values.length) {
+ result[this._headers[i]] = values[i];
+ } else {
+ result[this._headers[i]] = '';
+ }
+ }
+ return result;
+};
+
+/**
+ * @param {SingleResult} result
+ * @param {Array.<undefined|!number>} positions
+ * @param {!string} word
+ * @param {!boolean} stemmed
+ */
+Table.prototype.grouping$LSingleResult$AISB = function (result, positions, word, stemmed) {
+};
+
+/**
+ * @param {!number} index
+ * @return {!string}
+ */
+Table.prototype.getInformation$I = function (index) {
+ return '';
+};
+
+/**
+ */
+Table.prototype._build$ = function () {
+ this._bitVector.build$();
+ this._columnTails.build$();
+};
+
+/**
+ * @param {Oktavia} parent
+ * @param {!string} name
+ * @param {!string} data
+ * @param {!number} offset
+ * @return {!number}
+ */
+Table._load$LOktavia$SSI = function (parent, name, data, offset) {
+ /** @type {LoadedStringListResult} */
+ var strs;
+ /** @type {Table} */
+ var table;
+ /** @type {!number} */
+ var offset$0;
+ strs = new LoadedStringListResult$SI(data, offset);
+ table = new Table$LOktavia$AS(parent, strs.result);
+ offset$0 = strs.offset;
+ offset$0 = table._bitVector.load$SI(data, offset$0);
+ table._parent._metadataLabels.push(name);
+ table._parent._metadatas[name] = table;
+ offset = offset$0;
+ return table._columnTails.load$SI(data, offset$0);
+};
+
+var Table$_load$LOktavia$SSI = Table._load$LOktavia$SSI;
+
+/**
+ * @return {!string}
+ */
+Table.prototype._dump$ = function () {
+ return [ Binary$dump16bitNumber$I(2), Binary$dumpStringList$AS(this._headers), Metadata.prototype._dump$.call(this), this._columnTails.dump$() ].join('');
+};
+
+/**
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+Table.prototype._dump$LCompressionReport$ = function (report) {
+ CompressionReport$add$LCompressionReport$II(report, 1, 1);
+ return [ Binary$dump16bitNumber$I(2), Binary$dumpStringList$ASLCompressionReport$(this._headers, report), Metadata.prototype._dump$LCompressionReport$.call(this, report), this._columnTails.dump$LCompressionReport$(report) ].join('');
+};
+
+/**
+ * class Block extends Metadata
+ * @constructor
+ */
+function Block() {
+}
+
+Block.prototype = new Metadata;
+/**
+ * @constructor
+ * @param {Oktavia} parent
+ */
+function Block$LOktavia$(parent) {
+ this._parent = parent;
+ this._bitVector = new BitVector$();
+ this._names = [ ];
+ this._start = false;
+};
+
+Block$LOktavia$.prototype = new Block;
+
+/**
+ * @param {!string} blockName
+ */
+Block.prototype.startBlock$S = function (blockName) {
+ this.startBlock$SI(blockName, this._parent.contentSize$());
+};
+
+/**
+ * @param {!string} blockName
+ * @param {!number} index
+ */
+Block.prototype.startBlock$SI = function (blockName, index) {
+ if (this._start) {
+ throw new Error('Splitter `' + this._names[this._names.length - 1] + '` is not closed');
+ }
+ this._start = true;
+ this._names.push(blockName);
+ this._bitVector.set$I(index - 1);
+};
+
+/**
+ */
+Block.prototype.endBlock$ = function () {
+ this.endBlock$I(this._parent.contentSize$());
+};
+
+/**
+ * @param {!number} index
+ */
+Block.prototype.endBlock$I = function (index) {
+ if (! this._start) {
+ throw new Error('Splitter is not started');
+ }
+ this._start = false;
+ this._bitVector.set$I(index - 1);
+};
+
+/**
+ * @return {!number}
+ */
+Block.prototype.size$ = function () {
+ return (this._names.length | 0);
+};
+
+/**
+ * @param {!number} position
+ * @return {!number}
+ */
+Block.prototype.blockIndex$I = function (position) {
+ /** @type {!number} */
+ var result;
+ /** @type {BitVector} */
+ var this$0;
+ if (position < 0 || this._parent._fmindex.size$() - 1 <= position) {
+ throw new Error("Block.blockIndex() : range error " + (position + ""));
+ }
+ if (position >= this._bitVector.size$()) {
+ position = (this._bitVector.size$() - 1 | 0);
+ result = (this._bitVector.rank$I(position) + 1 | 0);
+ } else {
+ this$0 = this._bitVector;
+ result = this$0.rank$IB(position, true);
+ }
+ return result;
+};
+
+/**
+ * @param {!number} position
+ * @return {!boolean}
+ */
+Block.prototype.inBlock$I = function (position) {
+ /** @type {!number} */
+ var blockIndex;
+ blockIndex = this.blockIndex$I(position);
+ return blockIndex % 2 !== 0;
+};
+
+/**
+ * @param {!number} position
+ * @return {!string}
+ */
+Block.prototype.getBlockContent$I = function (position) {
+ /** @type {!number} */
+ var blockIndex;
+ /** @type {!string} */
+ var result;
+ blockIndex = this.blockIndex$I(position);
+ if (blockIndex % 2 !== 0) {
+ result = this.getContent$I(blockIndex);
+ } else {
+ result = '';
+ }
+ return result;
+};
+
+/**
+ * @param {!number} position
+ * @return {!string}
+ */
+Block.prototype.getBlockName$I = function (position) {
+ /** @type {!number} */
+ var blockIndex;
+ /** @type {!string} */
+ var result;
+ blockIndex = this.blockIndex$I(position);
+ if (blockIndex % 2 !== 0) {
+ result = this._names[blockIndex >>> 1];
+ } else {
+ result = '';
+ }
+ return result;
+};
+
+/**
+ * @param {SingleResult} result
+ * @param {Array.<undefined|!number>} positions
+ * @param {!string} word
+ * @param {!boolean} stemmed
+ */
+Block.prototype.grouping$LSingleResult$AISB = function (result, positions, word, stemmed) {
+};
+
+/**
+ * @param {!number} index
+ * @return {!string}
+ */
+Block.prototype.getInformation$I = function (index) {
+ return '';
+};
+
+/**
+ * @param {Oktavia} parent
+ * @param {!string} name
+ * @param {!string} data
+ * @param {!number} offset
+ * @return {!number}
+ */
+Block._load$LOktavia$SSI = function (parent, name, data, offset) {
+ /** @type {LoadedStringListResult} */
+ var strs;
+ /** @type {Block} */
+ var block;
+ /** @type {!number} */
+ var offset$0;
+ strs = new LoadedStringListResult$SI(data, offset);
+ block = new Block$LOktavia$(parent);
+ block._names = strs.result;
+ offset$0 = strs.offset;
+ offset$0 = block._bitVector.load$SI(data, offset$0);
+ block._parent._metadataLabels.push(name);
+ block._parent._metadatas[name] = block;
+ return offset$0;
+};
+
+var Block$_load$LOktavia$SSI = Block._load$LOktavia$SSI;
+
+/**
+ * @return {!string}
+ */
+Block.prototype._dump$ = function () {
+ return [ Binary$dump16bitNumber$I(3), Binary$dumpStringList$AS(this._names), Metadata.prototype._dump$.call(this) ].join('');
+};
+
+/**
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+Block.prototype._dump$LCompressionReport$ = function (report) {
+ CompressionReport$add$LCompressionReport$II(report, 1, 1);
+ return [ Binary$dump16bitNumber$I(3), Binary$dumpStringList$ASLCompressionReport$(this._names, report), Metadata.prototype._dump$LCompressionReport$.call(this, report) ].join('');
+};
+
+/**
+ * class FMIndex extends Object
+ * @constructor
+ */
+function FMIndex() {
+}
+
+/**
+ * @constructor
+ */
+function FMIndex$() {
+ /** @type {Array.<undefined|!number>} */
+ var _rlt$0;
+ this._ssize = 0;
+ (this._ddic = 0, this._head = 0);
+ this._substr = "";
+ this._sv = new WaveletMatrix$();
+ this._posdic = [ ];
+ this._idic = [ ];
+ _rlt$0 = this._rlt = [ ];
+ _rlt$0.length = 65536;
+};
+
+FMIndex$.prototype = new FMIndex;
+
+/**
+ */
+FMIndex.prototype.clear$ = function () {
+ /** @type {WaveletMatrix} */
+ var this$0;
+ this$0 = this._sv;
+ this$0._bv.length = 0;
+ this$0._seps.length = 0;
+ this$0._size = 0;
+ this._posdic.length = 0;
+ this._idic.length = 0;
+ this._ddic = 0;
+ this._head = 0;
+ this._substr = "";
+};
+
+/**
+ * @return {!number}
+ */
+FMIndex.prototype.size$ = function () {
+ /** @type {WaveletMatrix} */
+ var this$0;
+ this$0 = this._sv;
+ return this$0._size;
+};
+
+/**
+ * @return {!number}
+ */
+FMIndex.prototype.contentSize$ = function () {
+ return this._substr.length;
+};
+
+/**
+ * @param {!string} key
+ * @return {!number}
+ */
+FMIndex.prototype.getRows$S = function (key) {
+ /** @type {Array.<undefined|!number>} */
+ var pos;
+ pos = [ ];
+ return this.getRows$SAI(key, pos);
+};
+
+/**
+ * @param {!string} key
+ * @param {Array.<undefined|!number>} pos
+ * @return {!number}
+ */
+FMIndex.prototype.getRows$SAI = function (key, pos) {
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var code;
+ /** @type {!number} */
+ var first;
+ /** @type {undefined|!number} */
+ var last;
+ /** @type {!number} */
+ var c;
+ /** @type {Array.<undefined|!number>} */
+ var _rlt$0;
+ i = key.length - 1;
+ code = key.charCodeAt(i);
+ first = (_rlt$0 = this._rlt)[code] + 1;
+ last = _rlt$0[code + 1];
+ while (first <= last) {
+ if (i === 0) {
+ pos[0] = (-- first | 0);
+ pos[1] = -- last;
+ return (last - first + 1 | 0);
+ }
+ i--;
+ c = key.charCodeAt(i);
+ first = this._rlt[c] + this._sv.rank$II(first - 1, c) + 1;
+ last = this._rlt[c] + this._sv.rank$II(last, c);
+ }
+ return 0;
+};
+
+/**
+ * @param {!number} i
+ * @return {!number}
+ */
+FMIndex.prototype.getPosition$I = function (i) {
+ /** @type {!number} */
+ var pos;
+ /** @type {!number} */
+ var c;
+ if (i >= this.size$()) {
+ throw new Error("FMIndex.getPosition() : range error");
+ }
+ pos = 0;
+ while (i !== this._head) {
+ if (i % this._ddic === 0) {
+ pos += this._posdic[i / this._ddic] + 1;
+ break;
+ }
+ c = this._sv.get$I(i);
+ i = this._rlt[c] + this._sv.rank$II(i, c);
+ pos++;
+ }
+ return (pos % this.size$() | 0);
+};
+
+/**
+ * @param {!number} pos
+ * @param {!number} len
+ * @return {!string}
+ */
+FMIndex.prototype.getSubstring$II = function (pos, len) {
+ /** @type {!number} */
+ var pos_end;
+ /** @type {!number} */
+ var pos_tmp;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var pos_idic;
+ /** @type {!string} */
+ var substr;
+ /** @type {!number} */
+ var c;
+ /** @type {!number} */
+ var _ddic$0;
+ if (pos >= this.size$()) {
+ throw new Error("FMIndex.getSubstring() : range error");
+ }
+ pos_end = Math.min(pos + len, this.size$());
+ pos_tmp = this.size$() - 1;
+ i = this._head;
+ pos_idic = Math.floor((pos_end + (_ddic$0 = this._ddic) - 2) / _ddic$0);
+ if (pos_idic < this._idic.length) {
+ pos_tmp = pos_idic * this._ddic;
+ i = this._idic[pos_idic];
+ }
+ substr = "";
+ while (pos_tmp >= pos) {
+ c = this._sv.get$I(i);
+ i = this._rlt[c] + this._sv.rank$II(i, c);
+ if (pos_tmp < pos_end) {
+ substr = String.fromCharCode(c) + substr;
+ }
+ if (pos_tmp === 0) {
+ break;
+ }
+ pos_tmp--;
+ }
+ return substr;
+};
+
+/**
+ */
+FMIndex.prototype.build$ = function () {
+ this.build$SIIB(String.fromCharCode(0), 65535, 20, false);
+};
+
+/**
+ * @param {!string} end_marker
+ * @param {!number} ddic
+ * @param {!boolean} verbose
+ */
+FMIndex.prototype.build$SIB = function (end_marker, ddic, verbose) {
+ this.build$SIIB(end_marker, 65535, ddic, verbose);
+};
+
+/**
+ * @param {!string} end_marker
+ * @param {!number} maxChar
+ * @param {!number} ddic
+ * @param {!boolean} verbose
+ */
+FMIndex.prototype.build$SIIB = function (end_marker, maxChar, ddic, verbose) {
+ /** @type {BurrowsWheelerTransform} */
+ var b;
+ /** @type {!string} */
+ var s;
+ /** @type {!number} */
+ var c;
+ /** @type {!string} */
+ var str$0;
+ /** @type {WaveletMatrix} */
+ var this$0;
+ /** @type {!string} */
+ var _str$0;
+ /** @type {Array.<undefined|!number>} */
+ var _suffixarray$0;
+ if (verbose) {
+ console.time("building burrows-wheeler transform");
+ }
+ this._substr += end_marker;
+ b = ({_str: "", _size: 0, _head: 0, _suffixarray: [ ]});
+ str$0 = this._substr;
+ _str$0 = b._str = str$0;
+ b._size = _str$0.length;
+ _suffixarray$0 = b._suffixarray = SAIS$make$S(str$0);
+ b._head = (_suffixarray$0.indexOf(0) | 0);
+ s = BurrowsWheelerTransform$get$LBurrowsWheelerTransform$(b);
+ this._ssize = s.length;
+ this._head = b._head;
+ b._str = "";
+ b._size = 0;
+ b._head = 0;
+ b._suffixarray.length = 0;
+ this._substr = "";
+ if (verbose) {
+ console.timeEnd("building burrows-wheeler transform");
+ }
+ if (verbose) {
+ console.time("building wavelet matrix");
+ }
+ this$0 = this._sv;
+ this$0._bitsize = (Math.ceil(Math.log(maxChar) / 0.6931471805599453) | 0);
+ if (verbose) {
+ console.log(" maxCharCode: ", maxChar);
+ console.log(" bitSize: ", this._sv.bitsize$());
+ }
+ this._sv.build$S(s);
+ if (verbose) {
+ console.timeEnd("building wavelet matrix");
+ }
+ if (verbose) {
+ console.time("caching rank less than");
+ }
+ for (c = 0; c < maxChar; c++) {
+ this._rlt[c] = this._sv.rank_less_than$II(this._sv.size$(), c);
+ }
+ if (verbose) {
+ console.timeEnd("caching rank less than");
+ }
+ this._ddic = ddic;
+ if (verbose) {
+ console.time("building dictionaries");
+ }
+ this._buildDictionaries$();
+ if (verbose) {
+ console.timeEnd("building dictionaries");
+ console.log('');
+ }
+};
+
+/**
+ */
+FMIndex.prototype._buildDictionaries$ = function () {
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var pos;
+ /** @type {!number} */
+ var c;
+ for (i = 0; i < this._ssize / this._ddic + 1; i++) {
+ this._posdic.push(0);
+ this._idic.push(0);
+ }
+ i = this._head;
+ pos = this.size$() - 1;
+ do {
+ if (i % this._ddic === 0) {
+ this._posdic[Math.floor(i / this._ddic)] = (pos | 0);
+ }
+ if (pos % this._ddic === 0) {
+ this._idic[Math.floor(pos / this._ddic)] = (i | 0);
+ }
+ c = this._sv.get$I(i);
+ i = this._rlt[c] + this._sv.rank$II(i, c);
+ pos--;
+ } while (i !== this._head);
+};
+
+/**
+ * @param {!string} doc
+ */
+FMIndex.prototype.push$S = function (doc) {
+ if (doc.length <= 0) {
+ throw new Error("FMIndex::push(): empty string");
+ }
+ this._substr += doc;
+};
+
+/**
+ * @param {!string} keyword
+ * @return {Array.<undefined|!number>}
+ */
+FMIndex.prototype.search$S = function (keyword) {
+ /** @type {Array.<undefined|!number>} */
+ var result;
+ /** @type {Array.<undefined|!number>} */
+ var position;
+ /** @type {!number} */
+ var rows;
+ /** @type {undefined|!number} */
+ var first;
+ /** @type {undefined|!number} */
+ var last;
+ /** @type {undefined|!number} */
+ var i;
+ result = [ ];
+ position = [ ];
+ rows = this.getRows$SAI(keyword, position);
+ if (rows > 0) {
+ first = position[0];
+ last = position[1];
+ for (i = first; i <= last; i++) {
+ result.push(this.getPosition$I(i));
+ }
+ }
+ return result;
+};
+
+/**
+ * @return {!string}
+ */
+FMIndex.prototype.dump$ = function () {
+ return this.dump$B(false);
+};
+
+/**
+ * @param {!boolean} verbose
+ * @return {!string}
+ */
+FMIndex.prototype.dump$B = function (verbose) {
+ /** @type {Array.<undefined|!string>} */
+ var contents;
+ /** @type {CompressionReport} */
+ var report;
+ /** @type {!number} */
+ var i;
+ contents = [ ];
+ report = ({source: 0, result: 0});
+ contents.push(Binary$dump32bitNumber$N(this._ddic));
+ contents.push(Binary$dump32bitNumber$N(this._ssize));
+ contents.push(Binary$dump32bitNumber$N(this._head));
+ CompressionReport$add$LCompressionReport$II(report, 6, 6);
+ contents.push(this._sv.dump$LCompressionReport$(report));
+ if (verbose) {
+ console.log("Serializing FM-index");
+ console.log(' Wavelet Matrix: ' + (contents[3].length * 2 + "") + ' bytes (' + (Math.round(report.result * 100.0 / report.source) + "") + '%)');
+ }
+ contents.push(Binary$dump32bitNumber$N(this._posdic.length));
+ for (i in this._posdic) {
+ contents.push(Binary$dump32bitNumber$N(this._posdic[i]));
+ }
+ for (i in this._idic) {
+ contents.push(Binary$dump32bitNumber$N(this._idic[i]));
+ }
+ if (verbose) {
+ console.log(' Dictionary Cache: ' + (this._idic.length * 16 + "") + ' bytes');
+ }
+ return contents.join("");
+};
+
+/**
+ * @param {!string} data
+ * @return {!number}
+ */
+FMIndex.prototype.load$S = function (data) {
+ return this.load$SI(data, 0);
+};
+
+/**
+ * @param {!string} data
+ * @param {!number} offset
+ * @return {!number}
+ */
+FMIndex.prototype.load$SI = function (data, offset) {
+ /** @type {!number} */
+ var maxChar;
+ /** @type {!number} */
+ var c;
+ /** @type {!number} */
+ var size;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var result$0;
+ /** @type {!number} */
+ var result$1;
+ result$0 = data.charCodeAt(offset) * 65536 + data.charCodeAt(offset + 1);
+ this._ddic = (result$0 | 0);
+ this._ssize = (Binary$load32bitNumber$SI(data, offset + 2) | 0);
+ this._head = (Binary$load32bitNumber$SI(data, offset + 4) | 0);
+ offset = this._sv.load$SI(data, offset + 6);
+ maxChar = Math.pow(2, this._sv.bitsize$());
+ for (c = 0; c < maxChar; c++) {
+ this._rlt[c] = this._sv.rank_less_than$II(this._sv.size$(), c);
+ }
+ result$1 = data.charCodeAt(offset) * 65536 + data.charCodeAt(offset + 1);
+ size = result$1;
+ offset += 2;
+ for (i = 0; i < size; (i++, offset += 2)) {
+ this._posdic.push(Binary$load32bitNumber$SI(data, offset));
+ }
+ for (i = 0; i < size; (i++, offset += 2)) {
+ this._idic.push(Binary$load32bitNumber$SI(data, offset));
+ }
+ return offset;
+};
+
+/**
+ * class Tag extends Object
+ * @constructor
+ */
+function Tag() {
+}
+
+/**
+ * @constructor
+ * @param {!string} name
+ */
+function Tag$S(name) {
+ this.name = name;
+ this.attributes = ({ });
+ this.isSelfClosing = false;
+};
+
+Tag$S.prototype = new Tag;
+
+/**
+ * class _Common extends Object
+ * @constructor
+ */
+function _Common() {
+}
+
+/**
+ * @constructor
+ */
+function _Common$() {
+};
+
+_Common$.prototype = new _Common;
+
+/**
+ * class _State extends Object
+ * @constructor
+ */
+function _State() {
+}
+
+/**
+ * @constructor
+ */
+function _State$() {
+};
+
+_State$.prototype = new _State;
+
+/**
+ * class SAXHandler extends Object
+ * @constructor
+ */
+function SAXHandler() {
+}
+
+/**
+ * @constructor
+ */
+function SAXHandler$() {
+ this.position = 0;
+ this.column = 0;
+ this.line = 0;
+};
+
+SAXHandler$.prototype = new SAXHandler;
+
+/**
+ * @param {Error} error
+ */
+SAXHandler.prototype.onerror$LError$ = function (error) {
+};
+
+/**
+ * @param {!string} text
+ */
+SAXHandler.prototype.ontext$S = function (text) {
+};
+
+/**
+ * @param {!string} doctype
+ */
+SAXHandler.prototype.ondoctype$S = function (doctype) {
+};
+
+/**
+ * @param {!string} name
+ * @param {!string} body
+ */
+SAXHandler.prototype.onprocessinginstruction$SS = function (name, body) {
+};
+
+/**
+ * @param {!string} sgmlDecl
+ */
+SAXHandler.prototype.onsgmldeclaration$S = function (sgmlDecl) {
+};
+
+/**
+ * @param {!string} tagname
+ * @param {Object.<string, undefined|!string>} attributes
+ */
+SAXHandler.prototype.onopentag$SHS = function (tagname, attributes) {
+};
+
+/**
+ * @param {!string} tagname
+ */
+SAXHandler.prototype.onclosetag$S = function (tagname) {
+};
+
+/**
+ * @param {!string} name
+ * @param {!string} value
+ */
+SAXHandler.prototype.onattribute$SS = function (name, value) {
+};
+
+/**
+ * @param {!string} comment
+ */
+SAXHandler.prototype.oncomment$S = function (comment) {
+};
+
+/**
+ */
+SAXHandler.prototype.onopencdata$ = function () {
+};
+
+/**
+ * @param {!string} cdata
+ */
+SAXHandler.prototype.oncdata$S = function (cdata) {
+};
+
+/**
+ */
+SAXHandler.prototype.onclosecdata$ = function () {
+};
+
+/**
+ */
+SAXHandler.prototype.onend$ = function () {
+};
+
+/**
+ */
+SAXHandler.prototype.onready$ = function () {
+};
+
+/**
+ * @param {!string} script
+ */
+SAXHandler.prototype.onscript$S = function (script) {
+};
+
+/**
+ * class _HTMLHandler extends SAXHandler
+ * @constructor
+ */
+function _HTMLHandler() {
+}
+
+_HTMLHandler.prototype = new SAXHandler;
+/**
+ * @constructor
+ * @param {Object.<string, undefined|Array.<undefined|!string>>} styles
+ * @param {!boolean} escape
+ */
+function _HTMLHandler$HASB(styles, escape) {
+ this.position = 0;
+ this.column = 0;
+ this.line = 0;
+ this.text = [ ];
+ this.escape = escape;
+ this.styles = styles;
+};
+
+_HTMLHandler$HASB.prototype = new _HTMLHandler;
+
+/**
+ * @param {!string} str
+ * @return {!string}
+ */
+_HTMLHandler.escapeHTML$S = function (str) {
+ return str.replace(/\n/g, "<br/>").replace(/&/g, "&amp;").replace(/"/g, "&quot;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
+};
+
+var _HTMLHandler$escapeHTML$S = _HTMLHandler.escapeHTML$S;
+
+/**
+ * @param {!string} tagname
+ * @param {Object.<string, undefined|!string>} attributes
+ */
+_HTMLHandler.prototype.onopentag$SHS = function (tagname, attributes) {
+ this.text.push(this.styles[tagname][0]);
+};
+
+/**
+ * @param {!string} tagname
+ */
+_HTMLHandler.prototype.onclosetag$S = function (tagname) {
+ this.text.push(this.styles[tagname][1]);
+};
+
+/**
+ * @param {!string} text
+ */
+_HTMLHandler.prototype.ontext$S = function (text) {
+ if (this.escape) {
+ this.text.push(text.replace(/\n/g, "<br/>").replace(/&/g, "&amp;").replace(/"/g, "&quot;").replace(/</g, "&lt;").replace(/>/g, "&gt;"));
+ } else {
+ this.text.push(text);
+ }
+};
+
+/**
+ * @return {!string}
+ */
+_HTMLHandler.prototype.result$ = function () {
+ return this.text.join('');
+};
+
+/**
+ * class SAXParser extends Object
+ * @constructor
+ */
+function SAXParser() {
+}
+
+/**
+ * @constructor
+ * @param {SAXHandler} handler
+ */
+function SAXParser$LSAXHandler$(handler) {
+ this.q = "";
+ this.c = "";
+ this.bufferCheckPosition = 0;
+ this.looseCase = "";
+ this.tags = [ ];
+ this.closed = false;
+ this.closedRoot = false;
+ this.sawRoot = false;
+ this.tag = null;
+ this.error = null;
+ this.handler = null;
+ this.ENTITIES = null;
+ this.strict = false;
+ this.tagName = "";
+ this.state = 0;
+ this.line = 0;
+ this.column = 0;
+ this.position = 0;
+ this.startTagPosition = 0;
+ this.attribName = "";
+ this.attribValue = "";
+ this.script = "";
+ this.textNode = "";
+ this.attribList = null;
+ this.noscript = false;
+ this.cdata = "";
+ this.procInstBody = "";
+ this.procInstName = "";
+ this.doctype = "";
+ this.entity = "";
+ this.sgmlDecl = "";
+ this.comment = "";
+ this.preTags = 0;
+ this._init$LSAXHandler$B(handler, false);
+};
+
+SAXParser$LSAXHandler$.prototype = new SAXParser;
+
+/**
+ * @constructor
+ * @param {SAXHandler} handler
+ * @param {!boolean} strict
+ */
+function SAXParser$LSAXHandler$B(handler, strict) {
+ this.q = "";
+ this.c = "";
+ this.bufferCheckPosition = 0;
+ this.looseCase = "";
+ this.tags = [ ];
+ this.closed = false;
+ this.closedRoot = false;
+ this.sawRoot = false;
+ this.tag = null;
+ this.error = null;
+ this.handler = null;
+ this.ENTITIES = null;
+ this.strict = false;
+ this.tagName = "";
+ this.state = 0;
+ this.line = 0;
+ this.column = 0;
+ this.position = 0;
+ this.startTagPosition = 0;
+ this.attribName = "";
+ this.attribValue = "";
+ this.script = "";
+ this.textNode = "";
+ this.attribList = null;
+ this.noscript = false;
+ this.cdata = "";
+ this.procInstBody = "";
+ this.procInstName = "";
+ this.doctype = "";
+ this.entity = "";
+ this.sgmlDecl = "";
+ this.comment = "";
+ this.preTags = 0;
+ this._init$LSAXHandler$B(handler, strict);
+};
+
+SAXParser$LSAXHandler$B.prototype = new SAXParser;
+
+/**
+ * @param {SAXHandler} handler
+ * @param {!boolean} strict
+ */
+SAXParser.prototype._init$LSAXHandler$B = function (handler, strict) {
+ this.handler = handler;
+ this.clearBuffers$();
+ this.q = "";
+ this.bufferCheckPosition = 65536;
+ this.looseCase = 'toLowerCase';
+ this.tags = [ ];
+ this.closed = this.closedRoot = this.sawRoot = false;
+ this.tag = null;
+ this.error = null;
+ this.strict = strict;
+ this.noscript = strict;
+ this.state = 1;
+ this.ENTITIES = _Entities$entity_list$();
+ this.attribList = [ ];
+ this.noscript = false;
+ this.preTags = 0;
+};
+
+/**
+ * @param {!boolean} flag
+ */
+SAXParser.prototype.set_noscript$B = function (flag) {
+ this.noscript = flag;
+};
+
+/**
+ * @return {SAXParser}
+ */
+SAXParser.prototype.resume$ = function () {
+ this.error = null;
+ return this;
+};
+
+/**
+ * @return {SAXParser}
+ */
+SAXParser.prototype.close$ = function () {
+ return this.parse$S('');
+};
+
+/**
+ * @param {!string} chunk
+ * @return {SAXParser}
+ */
+SAXParser.prototype.parse$S = function (chunk) {
+ /** @type {Char} */
+ var _;
+ /** @type {!number} */
+ var i;
+ /** @type {!string} */
+ var c;
+ /** @type {!number} */
+ var starti;
+ /** @type {!number} */
+ var pad;
+ /** @type {!number} */
+ var returnState;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$0;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$1;
+ /** @type {RegExp} */
+ var charclass$2;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$3;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$4;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$5;
+ /** @type {!string} */
+ var text$0;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$6;
+ /** @type {RegExp} */
+ var charclass$7;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$8;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$9;
+ /** @type {RegExp} */
+ var charclass$10;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$11;
+ /** @type {RegExp} */
+ var charclass$12;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$13;
+ /** @type {RegExp} */
+ var charclass$14;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$15;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$16;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$17;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$18;
+ /** @type {RegExp} */
+ var charclass$19;
+ /** @type {RegExp} */
+ var charclass$20;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$21;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$22;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$23;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$24;
+ /** @type {!string} */
+ var comment$0;
+ _ = new Char$();
+ if (this.error) {
+ throw this.error;
+ }
+ if (this.closed) {
+ return this.emiterror$S("Cannot write after close. Assign an onready handler.");
+ }
+ (i = 0, c = "");
+ while (this.c = c = chunk.charAt(i++)) {
+ this.position++;
+ if (c === "\n") {
+ this.handler.line++;
+ this.handler.column = 0;
+ } else {
+ this.handler.column++;
+ }
+ switch (this.state) {
+ case 1:
+ if (c === "<") {
+ this.state = 4;
+ this.startTagPosition = this.position;
+ } else {
+ charclass$0 = _.whitespace;
+ if (! $__jsx_ObjectHasOwnProperty.call(charclass$0, c)) {
+ this.strictFail$S("Non-whitespace before first tag.");
+ this.textNode = c;
+ this.state = 2;
+ }
+ }
+ continue;
+ case 2:
+ if (this.sawRoot && ! this.closedRoot) {
+ starti = i - 1;
+ while (c && c !== "<" && c !== "&") {
+ c = chunk.charAt(i++);
+ if (c) {
+ this.position++;
+ if (c === "\n") {
+ this.handler.line++;
+ this.handler.column = 0;
+ } else {
+ this.handler.column++;
+ }
+ }
+ }
+ this.textNode += chunk.substring(starti, i - 1);
+ }
+ if (c === "<") {
+ this.state = 4;
+ this.startTagPosition = this.position;
+ } else {
+ if (_.not$HBS(_.whitespace, c) && (! this.sawRoot || this.closedRoot)) {
+ this.strictFail$S("Text data outside of root node.");
+ }
+ if (c === "&") {
+ this.state = 3;
+ } else {
+ this.textNode += c;
+ }
+ }
+ continue;
+ case 33:
+ if (c === "<") {
+ this.state = 34;
+ } else {
+ this.script += c;
+ }
+ continue;
+ case 34:
+ if (c === "/") {
+ this.state = 31;
+ } else {
+ this.script += "<" + c;
+ this.state = 33;
+ }
+ continue;
+ case 4:
+ if (c === "!") {
+ this.state = 5;
+ this.sgmlDecl = "";
+ } else {
+ charclass$1 = _.whitespace;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$1, c)) {
+ } else {
+ charclass$2 = _.nameStart;
+ if (charclass$2.test(c)) {
+ this.state = 21;
+ this.tagName = c;
+ } else {
+ if (c === "/") {
+ this.state = 31;
+ this.tagName = "";
+ } else {
+ if (c === "?") {
+ this.state = 18;
+ this.procInstName = this.procInstBody = "";
+ } else {
+ this.strictFail$S("Unencoded <");
+ if (this.startTagPosition + 1 < this.position) {
+ pad = this.position - this.startTagPosition;
+ for (i = 0; i < pad; i++) {
+ c = " " + c;
+ }
+ }
+ this.textNode += "<" + c;
+ this.state = 2;
+ }
+ }
+ }
+ }
+ }
+ continue;
+ case 5:
+ if ((this.sgmlDecl + c).toUpperCase() === _.CDATA) {
+ this.closetext_if_exist$();
+ this.state = 15;
+ this.sgmlDecl = "";
+ this.cdata = "";
+ } else {
+ if (this.sgmlDecl + c === "--") {
+ this.state = 12;
+ this.comment = "";
+ this.sgmlDecl = "";
+ } else {
+ if ((this.sgmlDecl + c).toUpperCase() === _.DOCTYPE) {
+ this.state = 7;
+ if (this.doctype || this.sawRoot) {
+ this.strictFail$S("Inappropriately located doctype declaration");
+ }
+ this.doctype = "";
+ this.sgmlDecl = "";
+ } else {
+ if (c === ">") {
+ this.closetext_if_exist$();
+ this.sgmlDecl = "";
+ this.state = 2;
+ } else {
+ charclass$3 = _.quote;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$3, c)) {
+ this.state = 6;
+ this.sgmlDecl += c;
+ } else {
+ this.sgmlDecl += c;
+ }
+ }
+ }
+ }
+ }
+ continue;
+ case 6:
+ if (c === this.q) {
+ this.state = 5;
+ this.q = "";
+ }
+ this.sgmlDecl += c;
+ continue;
+ case 7:
+ if (c === ">") {
+ this.state = 2;
+ this.closetext_if_exist$();
+ this.doctype.trim();
+ } else {
+ this.doctype += c;
+ if (c === "[") {
+ this.state = 9;
+ } else {
+ charclass$4 = _.quote;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$4, c)) {
+ this.state = 8;
+ this.q = c;
+ }
+ }
+ }
+ continue;
+ case 8:
+ this.doctype += c;
+ if (c === this.q) {
+ this.q = "";
+ this.state = 7;
+ }
+ continue;
+ case 9:
+ this.doctype += c;
+ if (c === "]") {
+ this.state = 7;
+ } else {
+ charclass$5 = _.quote;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$5, c)) {
+ this.state = 10;
+ this.q = c;
+ }
+ }
+ continue;
+ case 10:
+ this.doctype += c;
+ if (c === this.q) {
+ this.state = 9;
+ this.q = "";
+ }
+ continue;
+ case 12:
+ if (c === "-") {
+ this.state = 13;
+ } else {
+ this.comment += c;
+ }
+ continue;
+ case 13:
+ if (c === "-") {
+ this.state = 14;
+ text$0 = this.comment;
+ text$0 = text$0.replace(/[\n\t]/g, ' ');
+ text$0 = text$0.replace(/\s\s+/g, " ");
+ comment$0 = this.comment = text$0;
+ if (comment$0) {
+ this.closetext_if_exist$();
+ this.comment.trim();
+ }
+ this.comment = "";
+ } else {
+ this.comment += "-" + c;
+ this.state = 12;
+ }
+ continue;
+ case 14:
+ if (c !== ">") {
+ this.strictFail$S("Malformed comment");
+ this.comment += "--" + c;
+ this.state = 12;
+ } else {
+ this.state = 2;
+ }
+ continue;
+ case 15:
+ if (c === "]") {
+ this.state = 16;
+ } else {
+ this.cdata += c;
+ }
+ continue;
+ case 16:
+ if (c === "]") {
+ this.state = 17;
+ } else {
+ this.cdata += "]" + c;
+ this.state = 15;
+ }
+ continue;
+ case 17:
+ if (c === ">") {
+ if (this.cdata) {
+ this.closetext_if_exist$();
+ }
+ this.cdata = "";
+ this.state = 2;
+ } else {
+ if (c === "]") {
+ this.cdata += "]";
+ } else {
+ this.cdata += "]]" + c;
+ this.state = 15;
+ }
+ }
+ continue;
+ case 18:
+ if (c === "?") {
+ this.state = 20;
+ } else {
+ charclass$6 = _.whitespace;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$6, c)) {
+ this.state = 19;
+ } else {
+ this.procInstName += c;
+ }
+ }
+ continue;
+ case 19:
+ if (! this.procInstBody && _.is$HBS(_.whitespace, c)) {
+ continue;
+ } else {
+ if (c === "?") {
+ this.state = 20;
+ } else {
+ this.procInstBody += c;
+ }
+ }
+ continue;
+ case 20:
+ if (c === ">") {
+ this.closetext_if_exist$();
+ this.procInstName = this.procInstBody = "";
+ this.state = 2;
+ } else {
+ this.procInstBody += "?" + c;
+ this.state = 19;
+ }
+ continue;
+ case 21:
+ charclass$7 = _.nameBody;
+ if (charclass$7.test(c)) {
+ this.tagName += c;
+ } else {
+ this.newTag$();
+ if (c === ">") {
+ this.openTag$B(false);
+ } else {
+ if (c === "/") {
+ this.state = 22;
+ } else {
+ charclass$8 = _.whitespace;
+ if (! $__jsx_ObjectHasOwnProperty.call(charclass$8, c)) {
+ this.strictFail$S("Invalid character in tag name");
+ }
+ this.state = 23;
+ }
+ }
+ }
+ continue;
+ case 22:
+ if (c === ">") {
+ this.openTag$B(true);
+ this.closeTag$();
+ } else {
+ this.strictFail$S("Forward-slash in opening tag not followed by >");
+ this.state = 23;
+ }
+ continue;
+ case 23:
+ charclass$9 = _.whitespace;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$9, c)) {
+ continue;
+ } else {
+ if (c === ">") {
+ this.openTag$B(false);
+ } else {
+ if (c === "/") {
+ this.state = 22;
+ } else {
+ charclass$10 = _.nameStart;
+ if (charclass$10.test(c)) {
+ this.attribName = c;
+ this.attribValue = "";
+ this.state = 24;
+ } else {
+ this.strictFail$S("Invalid attribute name");
+ }
+ }
+ }
+ }
+ continue;
+ case 24:
+ if (c === "=") {
+ this.state = 26;
+ } else {
+ if (c === ">") {
+ this.strictFail$S("Attribute without value");
+ this.attribValue = this.attribName;
+ this.attrib$();
+ this.openTag$B(false);
+ } else {
+ charclass$11 = _.whitespace;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$11, c)) {
+ this.state = 25;
+ } else {
+ charclass$12 = _.nameBody;
+ if (charclass$12.test(c)) {
+ this.attribName += c;
+ } else {
+ this.strictFail$S("Invalid attribute name");
+ }
+ }
+ }
+ }
+ continue;
+ case 25:
+ if (c === "=") {
+ this.state = 26;
+ } else {
+ charclass$13 = _.whitespace;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$13, c)) {
+ continue;
+ } else {
+ this.strictFail$S("Attribute without value");
+ this.tag.attributes[this.attribName] = "";
+ this.attribValue = "";
+ this.closetext_if_exist$();
+ this.attribName = "";
+ if (c === ">") {
+ this.openTag$B(false);
+ } else {
+ charclass$14 = _.nameStart;
+ if (charclass$14.test(c)) {
+ this.attribName = c;
+ this.state = 24;
+ } else {
+ this.strictFail$S("Invalid attribute name");
+ this.state = 23;
+ }
+ }
+ }
+ }
+ continue;
+ case 26:
+ charclass$15 = _.whitespace;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$15, c)) {
+ continue;
+ } else {
+ charclass$16 = _.quote;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$16, c)) {
+ this.q = c;
+ this.state = 27;
+ } else {
+ this.strictFail$S("Unquoted attribute value");
+ this.state = 28;
+ this.attribValue = c;
+ }
+ }
+ continue;
+ case 27:
+ if (c !== this.q) {
+ if (c === "&") {
+ this.state = 29;
+ } else {
+ this.attribValue += c;
+ }
+ continue;
+ }
+ this.attrib$();
+ this.q = "";
+ this.state = 23;
+ continue;
+ case 28:
+ charclass$17 = _.attribEnd;
+ if (! $__jsx_ObjectHasOwnProperty.call(charclass$17, c)) {
+ if (c === "&") {
+ this.state = 30;
+ } else {
+ this.attribValue += c;
+ }
+ continue;
+ }
+ this.attrib$();
+ if (c === ">") {
+ this.openTag$B(false);
+ } else {
+ this.state = 23;
+ }
+ continue;
+ case 31:
+ if (! this.tagName) {
+ charclass$18 = _.whitespace;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$18, c)) {
+ continue;
+ } else {
+ charclass$19 = _.nameStart;
+ if (! charclass$19.test(c)) {
+ if (this.script) {
+ this.script += "</" + c;
+ this.state = 33;
+ } else {
+ this.strictFail$S("Invalid tagname in closing tag.");
+ }
+ } else {
+ this.tagName = c;
+ }
+ }
+ } else {
+ if (c === ">") {
+ this.closeTag$();
+ } else {
+ charclass$20 = _.nameBody;
+ if (charclass$20.test(c)) {
+ this.tagName += c;
+ } else {
+ if (this.script) {
+ this.script += "</" + this.tagName;
+ this.tagName = "";
+ this.state = 33;
+ } else {
+ charclass$21 = _.whitespace;
+ if (! $__jsx_ObjectHasOwnProperty.call(charclass$21, c)) {
+ this.strictFail$S("Invalid tagname in closing tag");
+ }
+ this.state = 32;
+ }
+ }
+ }
+ }
+ continue;
+ case 32:
+ charclass$22 = _.whitespace;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$22, c)) {
+ continue;
+ }
+ if (c === ">") {
+ this.closeTag$();
+ } else {
+ this.strictFail$S("Invalid characters in closing tag");
+ }
+ continue;
+ case 3:
+ if (c === ";") {
+ this.textNode += this.parseEntity$();
+ this.entity = "";
+ this.state = 2;
+ } else {
+ charclass$23 = _.entity;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$23, c)) {
+ this.entity += c;
+ } else {
+ this.strictFail$S("Invalid character entity");
+ this.textNode += "&" + this.entity + c;
+ this.entity = "";
+ this.state = 2;
+ }
+ }
+ continue;
+ case 29:
+ case 30:
+ if (this.state === 29) {
+ returnState = 27;
+ } else {
+ returnState = 28;
+ }
+ if (c === ";") {
+ this.attribValue += this.parseEntity$();
+ this.entity = "";
+ this.state = (returnState | 0);
+ } else {
+ charclass$24 = _.entity;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$24, c)) {
+ this.entity += c;
+ } else {
+ this.strictFail$S("Invalid character entity");
+ this.attribValue += "&" + this.entity + c;
+ this.entity = "";
+ this.state = (returnState | 0);
+ }
+ }
+ continue;
+ default:
+ throw new Error("Unknown state: " + (this.state + ""));
+ }
+ }
+ this.end$();
+ return this;
+};
+
+/**
+ */
+SAXParser.prototype.clearBuffers$ = function () {
+ this.comment = '';
+ this.sgmlDecl = '';
+ this.textNode = '';
+ this.tagName = '';
+ this.doctype = '';
+ this.procInstName = '';
+ this.procInstBody = '';
+ this.entity = '';
+ this.attribName = '';
+ this.attribValue = '';
+ this.cdata = '';
+ this.script = '';
+};
+
+/**
+ */
+SAXParser.prototype.closetext_if_exist$ = function () {
+ if (this.textNode !== '') {
+ this.closetext$();
+ }
+};
+
+/**
+ */
+SAXParser.prototype.closetext$ = function () {
+ /** @type {!string} */
+ var text;
+ /** @type {!string} */
+ var text$0;
+ if (this.preTags === 0) {
+ text$0 = this.textNode;
+ text$0 = text$0.replace(/[\n\t]/g, ' ');
+ text$0 = text$0.replace(/\s\s+/g, " ");
+ text = text$0;
+ if (text$0) {
+ this.handler.ontext$S(text);
+ }
+ } else {
+ if (this.textNode) {
+ this.handler.ontext$S(this.textNode);
+ }
+ }
+ this.textNode = "";
+};
+
+/**
+ * @param {!string} text
+ * @return {!string}
+ */
+SAXParser.prototype.textopts$S = function (text) {
+ text = text.replace(/[\n\t]/g, ' ');
+ text = text.replace(/\s\s+/g, " ");
+ return text;
+};
+
+/**
+ * @param {!string} er
+ * @return {SAXParser}
+ */
+SAXParser.prototype.emiterror$S = function (er) {
+ /** @type {Error} */
+ var error;
+ this.closetext$();
+ er += "\nLine: " + (this.line + "") + "\nColumn: " + (this.column + "") + "\nChar: " + this.c;
+ error = new Error(er);
+ this.error = error;
+ return this;
+};
+
+/**
+ */
+SAXParser.prototype.end$ = function () {
+ if (! this.closedRoot) {
+ this.strictFail$S("Unclosed root tag");
+ }
+ if (this.state !== 2) {
+ this.emiterror$S("Unexpected end");
+ }
+ this.closetext$();
+ this.c = "";
+ this.closed = true;
+};
+
+/**
+ * @param {!string} message
+ */
+SAXParser.prototype.strictFail$S = function (message) {
+ if (this.strict) {
+ this.emiterror$S(message);
+ }
+};
+
+/**
+ */
+SAXParser.prototype.newTag$ = function () {
+ if (! this.strict) {
+ this.tagName = this.tagName.toLowerCase();
+ }
+ this.tag = ({name: this.tagName, attributes: ({ }), isSelfClosing: false});
+ this.attribList.length = 0;
+};
+
+/**
+ */
+SAXParser.prototype.attrib$ = function () {
+ if (! this.strict) {
+ this.attribName = this.attribName.toLowerCase();
+ }
+ if ($__jsx_ObjectHasOwnProperty.call(this.tag.attributes, this.attribName)) {
+ this.attribName = this.attribValue = "";
+ return;
+ }
+ this.tag.attributes[this.attribName] = this.attribValue;
+ this.closetext_if_exist$();
+ this.attribName = this.attribValue = "";
+};
+
+/**
+ */
+SAXParser.prototype.openTag$ = function () {
+ this.openTag$B(false);
+};
+
+/**
+ * @param {!boolean} selfClosing
+ */
+SAXParser.prototype.openTag$B = function (selfClosing) {
+ /** @type {Tag} */
+ var tag$0;
+ /** @type {Tag} */
+ var tag$1;
+ (tag$0 = this.tag).isSelfClosing = selfClosing;
+ this.sawRoot = true;
+ this.tags.push(tag$0);
+ this.closetext_if_exist$();
+ this.handler.onopentag$SHS((tag$1 = this.tag).name, tag$1.attributes);
+ if (this.tag.name === 'pre') {
+ this.preTags++;
+ }
+ if (! selfClosing) {
+ if (! this.noscript && this.tagName.toLowerCase() === "script") {
+ this.state = 33;
+ } else {
+ this.state = 2;
+ }
+ this.tag = null;
+ this.tagName = "";
+ }
+ this.attribName = this.attribValue = "";
+ this.attribList.length = 0;
+};
+
+/**
+ */
+SAXParser.prototype.closeTag$ = function () {
+ /** @type {!number} */
+ var t;
+ /** @type {!string} */
+ var tagName;
+ /** @type {!string} */
+ var closeTo;
+ /** @type {Tag} */
+ var close;
+ /** @type {!number} */
+ var s;
+ /** @type {Tag} */
+ var tag$0;
+ if (! this.tagName) {
+ this.strictFail$S("Weird empty close tag.");
+ this.textNode += "</>";
+ this.state = 2;
+ return;
+ }
+ if (this.script) {
+ if (this.tagName !== "script") {
+ this.script += "</" + this.tagName + ">";
+ this.tagName = "";
+ this.state = 33;
+ return;
+ }
+ this.closetext_if_exist$();
+ this.script = "";
+ }
+ t = this.tags.length;
+ tagName = this.tagName;
+ if (! this.strict) {
+ tagName = tagName.toLowerCase();
+ }
+ closeTo = tagName;
+ while (t--) {
+ close = this.tags[t];
+ if (close.name !== closeTo) {
+ this.strictFail$S("Unexpected close tag");
+ } else {
+ break;
+ }
+ }
+ if (t < 0) {
+ this.strictFail$S("Unmatched closing tag: " + this.tagName);
+ this.textNode += "</" + this.tagName + ">";
+ this.state = 2;
+ return;
+ }
+ this.tagName = tagName;
+ s = this.tags.length;
+ while (s-- > t) {
+ tag$0 = this.tag = this.tags.pop();
+ this.tagName = tag$0.name;
+ this.closetext_if_exist$();
+ this.handler.onclosetag$S(this.tagName);
+ if (this.tagName === 'pre') {
+ this.preTags--;
+ }
+ }
+ if (t === 0) {
+ this.closedRoot = true;
+ }
+ this.tagName = this.attribValue = this.attribName = "";
+ this.attribList.length = 0;
+ this.state = 2;
+};
+
+/**
+ * @return {!string}
+ */
+SAXParser.prototype.parseEntity$ = function () {
+ /** @type {!string} */
+ var entity;
+ /** @type {!string} */
+ var entityLC;
+ /** @type {!number} */
+ var num;
+ /** @type {!string} */
+ var numStr;
+ entity = this.entity;
+ entityLC = entity.toLowerCase();
+ num = 0;
+ numStr = "";
+ if (this.ENTITIES[entity]) {
+ return this.ENTITIES[entity];
+ }
+ if (this.ENTITIES[entityLC]) {
+ return this.ENTITIES[entityLC];
+ }
+ entity = entityLC;
+ if (entityLC.charAt(0) === "#") {
+ if (entity.charAt(1) === "x") {
+ entity = entity.slice(2);
+ num = $__jsx_parseInt(entity, 16);
+ numStr = num.toString(16);
+ } else {
+ entity = entity.slice(1);
+ num = $__jsx_parseInt(entity, 10);
+ numStr = num.toString(10);
+ }
+ }
+ entity = entity.replace(/^0+/, "");
+ if (numStr.toLowerCase() !== entity) {
+ this.strictFail$S("Invalid character entity");
+ return "&" + this.entity + ";";
+ }
+ return String.fromCharCode(num);
+};
+
+/**
+ * class Char extends Object
+ * @constructor
+ */
+function Char() {
+}
+
+/**
+ * @constructor
+ */
+function Char$() {
+ this.CDATA = "[CDATA[";
+ this.DOCTYPE = "DOCTYPE";
+ this.XML_NAMESPACE = "http://www.w3.org/XML/1998/namespace";
+ this.whitespace = this._charClass$S("\r\n\t ");
+ this.number = this._charClass$S("0124356789");
+ this.letter = this._charClass$S("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ");
+ this.quote = this._charClass$S("'\"");
+ this.entity = this._charClass$S("0124356789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ#");
+ this.attribEnd = this._charClass$S("\r\n\t >");
+ this.nameStart = /[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/;
+ this.nameBody = /[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040\.\d-]/;
+};
+
+Char$.prototype = new Char;
+
+/**
+ * @param {!string} str
+ * @return {Object.<string, undefined|!boolean>}
+ */
+Char.prototype._charClass$S = function (str) {
+ /** @type {Object.<string, undefined|!boolean>} */
+ var result;
+ /** @type {!number} */
+ var i;
+ result = ({ });
+ for (i = 0; i < str.length; i++) {
+ result[str.slice(i, i + 1)] = true;
+ }
+ return result;
+};
+
+/**
+ * @param {RegExp} charclass
+ * @param {!string} c
+ * @return {!boolean}
+ */
+Char.prototype.is$LRegExp$S = function (charclass, c) {
+ return charclass.test(c);
+};
+
+/**
+ * @param {Object.<string, undefined|!boolean>} charclass
+ * @param {!string} c
+ * @return {!boolean}
+ */
+Char.prototype.is$HBS = function (charclass, c) {
+ return $__jsx_ObjectHasOwnProperty.call(charclass, c);
+};
+
+/**
+ * @param {RegExp} charclass
+ * @param {!string} c
+ * @return {!boolean}
+ */
+Char.prototype.not$LRegExp$S = function (charclass, c) {
+ return ! charclass.test(c);
+};
+
+/**
+ * @param {Object.<string, undefined|!boolean>} charclass
+ * @param {!string} c
+ * @return {!boolean}
+ */
+Char.prototype.not$HBS = function (charclass, c) {
+ return ! $__jsx_ObjectHasOwnProperty.call(charclass, c);
+};
+
+/**
+ * class _Entities extends Object
+ * @constructor
+ */
+function _Entities() {
+}
+
+/**
+ * @constructor
+ */
+function _Entities$() {
+};
+
+_Entities$.prototype = new _Entities;
+
+/**
+ * @return {Object.<string, undefined|!string>}
+ */
+_Entities.entity_list$ = function () {
+ /** @type {Object.<string, undefined|!string>} */
+ var result;
+ /** @type {!string} */
+ var key;
+ /** @type {*} */
+ var value;
+ result = ({ });
+ for (key in _Entities._entities) {
+ value = _Entities._entities[key];
+ if (typeof value === 'string') {
+ result[key] = value + "";
+ } else {
+ if (typeof value === 'number') {
+ result[key] = String.fromCharCode(value | 0);
+ }
+ }
+ }
+ return result;
+};
+
+var _Entities$entity_list$ = _Entities.entity_list$;
+
+/**
+ * class BitVector extends Object
+ * @constructor
+ */
+function BitVector() {
+}
+
+/**
+ * @constructor
+ */
+function BitVector$() {
+ /** @type {Array.<undefined|!number>} */
+ var _v$0;
+ /** @type {Array.<undefined|!number>} */
+ var _r$0;
+ _r$0 = this._r = [ ];
+ _v$0 = this._v = [ ];
+ _v$0.length = 0;
+ _r$0.length = 0;
+ this._size = 0;
+ this._size1 = 0;
+};
+
+BitVector$.prototype = new BitVector;
+
+/**
+ */
+BitVector.prototype.build$ = function () {
+ /** @type {!number} */
+ var i;
+ this._size1 = 0;
+ for (i = 0; i < this._v.length; i++) {
+ if (i % 8 === 0) {
+ this._r.push(true ? this._size1 : this._size - this._size1);
+ }
+ this._size1 += this._rank32$IIB(this._v[i], 32, true);
+ }
+};
+
+/**
+ */
+BitVector.prototype.clear$ = function () {
+ this._v.length = 0;
+ this._r.length = 0;
+ this._size = 0;
+ this._size1 = 0;
+};
+
+/**
+ * @return {!number}
+ */
+BitVector.prototype.size$ = function () {
+ return this._size;
+};
+
+/**
+ * @param {!boolean} b
+ * @return {!number}
+ */
+BitVector.prototype.size$B = function (b) {
+ return (b ? this._size1 : this._size - this._size1);
+};
+
+/**
+ * @param {!number} value
+ */
+BitVector.prototype.set$I = function (value) {
+ this.set$IB(value, true);
+};
+
+/**
+ * @param {!number} value
+ * @param {!boolean} flag
+ */
+BitVector.prototype.set$IB = function (value, flag) {
+ /** @type {!number} */
+ var q;
+ /** @type {!number} */
+ var r;
+ /** @type {!number} */
+ var m;
+ if (value >= this._size) {
+ this._size = (value + 1 | 0);
+ }
+ q = (value / 32 | 0);
+ r = (value % 32 | 0);
+ while (q >= this._v.length) {
+ this._v.push(0);
+ }
+ m = 0x1 << r;
+ if (flag) {
+ this._v[q] |= m;
+ } else {
+ this._v[q] &= ~ m;
+ }
+};
+
+/**
+ * @param {!number} value
+ * @return {!boolean}
+ */
+BitVector.prototype.get$I = function (value) {
+ /** @type {!number} */
+ var q;
+ /** @type {!number} */
+ var r;
+ /** @type {!number} */
+ var m;
+ if (value >= this._size) {
+ throw new Error("BitVector.get() : range error");
+ }
+ q = (value / 32 | 0);
+ r = (value % 32 | 0);
+ m = 0x1 << r;
+ return !! (this._v[q] & m);
+};
+
+/**
+ * @param {!number} i
+ * @return {!number}
+ */
+BitVector.prototype.rank$I = function (i) {
+ return this.rank$IB(i, true);
+};
+
+/**
+ * @param {!number} i
+ * @param {!boolean} b
+ * @return {!number}
+ */
+BitVector.prototype.rank$IB = function (i, b) {
+ /** @type {!number} */
+ var q_large;
+ /** @type {!number} */
+ var q_small;
+ /** @type {!number} */
+ var r;
+ /** @type {!number} */
+ var rank;
+ /** @type {!number} */
+ var begin;
+ /** @type {!number} */
+ var j;
+ if (i > this._size) {
+ throw new Error("BitVector.rank() : range error");
+ }
+ if (i === 0) {
+ return 0;
+ }
+ i--;
+ q_large = (Math.floor(i / 256) | 0);
+ q_small = (Math.floor(i / 32) | 0);
+ r = (Math.floor(i % 32) | 0);
+ rank = (this._r[q_large] | 0);
+ if (! b) {
+ rank = q_large * 256 - rank;
+ }
+ begin = q_large * 8;
+ for (j = begin; j < q_small; j++) {
+ rank += this._rank32$IIB(this._v[j], 32, b);
+ }
+ rank += this._rank32$IIB(this._v[q_small], r + 1, b);
+ return rank;
+};
+
+/**
+ * @param {!number} i
+ * @return {!number}
+ */
+BitVector.prototype.select$I = function (i) {
+ return this.select$IB(i, true);
+};
+
+/**
+ * @param {!number} i
+ * @param {!boolean} b
+ * @return {!number}
+ */
+BitVector.prototype.select$IB = function (i, b) {
+ /** @type {!number} */
+ var left;
+ /** @type {!number} */
+ var right;
+ /** @type {!number} */
+ var pivot;
+ /** @type {undefined|!number} */
+ var rank;
+ /** @type {!number} */
+ var j;
+ if (i >= (b ? this._size1 : this._size - this._size1)) {
+ throw new Error("BitVector.select() : range error");
+ }
+ left = 0;
+ right = this._r.length;
+ while (left < right) {
+ pivot = Math.floor((left + right) / 2);
+ rank = this._r[pivot];
+ if (! b) {
+ rank = pivot * 256 - rank;
+ }
+ if (i < rank) {
+ right = pivot;
+ } else {
+ left = pivot + 1;
+ }
+ }
+ right--;
+ if (b) {
+ i -= (this._r[right] | 0);
+ } else {
+ i -= (right * 256 - this._r[right] | 0);
+ }
+ j = right * 8;
+ while (1) {
+ rank = this._rank32$IIB(this._v[j], 32, b);
+ if (i < rank) {
+ break;
+ }
+ j++;
+ i -= (rank | 0);
+ }
+ return (j * 32 + this._select32$IIB(this._v[j], i, b) | 0);
+};
+
+/**
+ * @param {!number} x
+ * @param {!number} i
+ * @param {!boolean} b
+ * @return {!number}
+ */
+BitVector.prototype._rank32$IIB = function (x, i, b) {
+ if (! b) {
+ x = ~ x;
+ }
+ x <<= 32 - i;
+ x = ((x & 0xaaaaaaaa) >>> 1) + (x & 0x55555555);
+ x = ((x & 0xcccccccc) >>> 2) + (x & 0x33333333);
+ x = ((x & 0xf0f0f0f0) >>> 4) + (x & 0x0f0f0f0f);
+ x = ((x & 0xff00ff00) >>> 8) + (x & 0x00ff00ff);
+ x = ((x & 0xffff0000) >>> 16) + (x & 0x0000ffff);
+ return x;
+};
+
+/**
+ * @param {!number} x
+ * @param {!number} i
+ * @param {!boolean} b
+ * @return {!number}
+ */
+BitVector.prototype._select32$IIB = function (x, i, b) {
+ /** @type {!number} */
+ var x1;
+ /** @type {!number} */
+ var x2;
+ /** @type {!number} */
+ var x3;
+ /** @type {!number} */
+ var x4;
+ /** @type {!number} */
+ var x5;
+ /** @type {!number} */
+ var pos;
+ /** @type {!number} */
+ var v5;
+ /** @type {!number} */
+ var v4;
+ /** @type {!number} */
+ var v3;
+ /** @type {!number} */
+ var v2;
+ /** @type {!number} */
+ var v1;
+ /** @type {!number} */
+ var v0;
+ if (! b) {
+ x = ~ x;
+ }
+ x1 = ((x & 0xaaaaaaaa) >>> 1) + (x & 0x55555555);
+ x2 = ((x1 & 0xcccccccc) >>> 2) + (x1 & 0x33333333);
+ x3 = ((x2 & 0xf0f0f0f0) >>> 4) + (x2 & 0x0f0f0f0f);
+ x4 = ((x3 & 0xff00ff00) >>> 8) + (x3 & 0x00ff00ff);
+ x5 = ((x4 & 0xffff0000) >>> 16) + (x4 & 0x0000ffff);
+ i++;
+ pos = 0;
+ v5 = x5 & 0xffffffff;
+ if (i > v5) {
+ i -= (v5 | 0);
+ pos += 32;
+ }
+ v4 = x4 >>> pos & 0x0000ffff;
+ if (i > v4) {
+ i -= (v4 | 0);
+ pos += 16;
+ }
+ v3 = x3 >>> pos & 0x000000ff;
+ if (i > v3) {
+ i -= (v3 | 0);
+ pos += 8;
+ }
+ v2 = x2 >>> pos & 0x0000000f;
+ if (i > v2) {
+ i -= (v2 | 0);
+ pos += 4;
+ }
+ v1 = x1 >>> pos & 0x00000003;
+ if (i > v1) {
+ i -= (v1 | 0);
+ pos += 2;
+ }
+ v0 = x >>> pos & 0x00000001;
+ if (i > v0) {
+ i -= (v0 | 0);
+ pos += 1;
+ }
+ return (pos | 0);
+};
+
+/**
+ * @return {!string}
+ */
+BitVector.prototype.dump$ = function () {
+ /** @type {Array.<undefined|!string>} */
+ var contents;
+ contents = [ ];
+ contents.push(Binary$dump32bitNumber$N(this._size));
+ contents.push(Binary$dump32bitNumberList$AN(this._v));
+ return contents.join('');
+};
+
+/**
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+BitVector.prototype.dump$LCompressionReport$ = function (report) {
+ /** @type {Array.<undefined|!string>} */
+ var contents;
+ contents = [ ];
+ contents.push(Binary$dump32bitNumber$N(this._size));
+ CompressionReport$add$LCompressionReport$II(report, 2, 2);
+ contents.push(Binary$dump32bitNumberList$ANLCompressionReport$(this._v, report));
+ return contents.join('');
+};
+
+/**
+ * @param {!string} data
+ * @return {!number}
+ */
+BitVector.prototype.load$S = function (data) {
+ return this.load$SI(data, 0);
+};
+
+/**
+ * @param {!string} data
+ * @param {!number} offset
+ * @return {!number}
+ */
+BitVector.prototype.load$SI = function (data, offset) {
+ /** @type {LoadedNumberListResult} */
+ var result;
+ /** @type {!number} */
+ var result$0;
+ this._v.length = 0;
+ this._r.length = 0;
+ this._size = 0;
+ this._size1 = 0;
+ result$0 = data.charCodeAt(offset) * 65536 + data.charCodeAt(offset + 1);
+ this._size = (result$0 | 0);
+ result = Binary$load32bitNumberList$SI(data, offset + 2);
+ this._v = result.result;
+ this.build$();
+ return result.offset;
+};
+
+/**
+ * class WaveletMatrix extends Object
+ * @constructor
+ */
+function WaveletMatrix() {
+}
+
+/**
+ * @constructor
+ */
+function WaveletMatrix$() {
+ /** @type {Array.<undefined|BitVector>} */
+ var _bv$0;
+ /** @type {Array.<undefined|!number>} */
+ var _seps$0;
+ this._range = ({ });
+ _bv$0 = this._bv = [ ];
+ _seps$0 = this._seps = [ ];
+ this._bitsize = 16;
+ _bv$0.length = 0;
+ _seps$0.length = 0;
+ this._size = 0;
+};
+
+WaveletMatrix$.prototype = new WaveletMatrix;
+
+/**
+ * @return {!number}
+ */
+WaveletMatrix.prototype.bitsize$ = function () {
+ return this._bitsize;
+};
+
+/**
+ * @param {!number} charCode
+ */
+WaveletMatrix.prototype.setMaxCharCode$I = function (charCode) {
+ this._bitsize = (Math.ceil(Math.log(charCode) / 0.6931471805599453) | 0);
+};
+
+/**
+ */
+WaveletMatrix.prototype.clear$ = function () {
+ this._bv.length = 0;
+ this._seps.length = 0;
+ this._size = 0;
+};
+
+/**
+ * @param {!string} v
+ */
+WaveletMatrix.prototype.build$S = function (v) {
+ /** @type {!number} */
+ var size;
+ /** @type {!number} */
+ var bitsize;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var depth;
+ /** @type {Object.<string, undefined|!number>} */
+ var range_tmp;
+ /** @type {!number} */
+ var code;
+ /** @type {!boolean} */
+ var bit;
+ /** @type {!number} */
+ var key;
+ /** @type {Object.<string, undefined|!number>} */
+ var range_rev;
+ /** @type {!string} */
+ var range_key;
+ /** @type {!number} */
+ var value;
+ /** @type {!number} */
+ var pos0;
+ /** @type {undefined|!number} */
+ var pos1;
+ /** @type {!string} */
+ var range_rev_key;
+ /** @type {!number} */
+ var begin;
+ /** @type {undefined|!number} */
+ var end;
+ /** @type {!number} */
+ var num0;
+ /** @type {!number} */
+ var num1;
+ this._bv.length = 0;
+ this._seps.length = 0;
+ this._size = 0;
+ size = v.length;
+ bitsize = this._bitsize;
+ for (i = 0; i < bitsize; i++) {
+ this._bv.push(new BitVector$());
+ this._seps.push(0);
+ }
+ this._size = (size | 0);
+ for (i = 0; i < size; i++) {
+ this._bv[0].set$IB(i, this._uint2bit$II(v.charCodeAt(i), 0));
+ }
+ this._bv[0].build$();
+ this._seps[0] = this._bv[0].size$B(false);
+ this._range["0"] = 0;
+ this._range["1"] = this._seps[0];
+ depth = 1;
+ while (depth < bitsize) {
+ range_tmp = WaveletMatrix$_shallow_copy$HI(this._range);
+ for (i = 0; i < size; i++) {
+ code = v.charCodeAt(i);
+ bit = this._uint2bit$II(code, depth);
+ key = code >>> bitsize - depth;
+ this._bv[depth].set$IB(range_tmp[key + ""], bit);
+ range_tmp[key + ""]++;
+ }
+ this._bv[depth].build$();
+ this._seps[depth] = this._bv[depth].size$B(false);
+ range_rev = ({ });
+ for (range_key in this._range) {
+ value = this._range[range_key];
+ if (value != range_tmp[range_key]) {
+ range_rev[value + ""] = range_key | 0;
+ }
+ }
+ this._range = ({ });
+ pos0 = 0;
+ pos1 = this._seps[depth];
+ for (range_rev_key in range_rev) {
+ begin = range_rev_key | 0;
+ value = range_rev[range_rev_key];
+ end = range_tmp[value + ""];
+ num0 = this._bv[depth].rank$IB(end, false) - this._bv[depth].rank$IB(begin, false);
+ num1 = end - begin - num0;
+ if (num0 > 0) {
+ this._range[(value << 1) + ""] = (pos0 | 0);
+ pos0 += num0;
+ }
+ if (num1 > 0) {
+ this._range[(value << 1) + 1 + ""] = pos1;
+ pos1 += (num1 | 0);
+ }
+ }
+ depth++;
+ }
+};
+
+/**
+ * @return {!number}
+ */
+WaveletMatrix.prototype.size$ = function () {
+ return this._size;
+};
+
+/**
+ * @param {!number} c
+ * @return {!number}
+ */
+WaveletMatrix.prototype.size$I = function (c) {
+ return this.rank$II(this._size, c);
+};
+
+/**
+ * @param {!number} i
+ * @return {!number}
+ */
+WaveletMatrix.prototype.get$I = function (i) {
+ /** @type {!number} */
+ var value;
+ /** @type {!number} */
+ var depth;
+ /** @type {!boolean} */
+ var bit;
+ if (i >= this._size) {
+ throw new Error("WaveletMatrix.get() : range error");
+ }
+ value = 0;
+ depth = 0;
+ while (depth < this._bitsize) {
+ bit = this._bv[depth].get$I(i);
+ i = this._bv[depth].rank$IB(i, bit);
+ value <<= 1;
+ if (bit) {
+ i += this._seps[depth];
+ value += 1;
+ }
+ depth++;
+ }
+ return (value | 0);
+};
+
+/**
+ * @param {!number} i
+ * @param {!number} c
+ * @return {!number}
+ */
+WaveletMatrix.prototype.rank$II = function (i, c) {
+ /** @type {undefined|!number} */
+ var begin;
+ /** @type {!number} */
+ var end;
+ /** @type {!number} */
+ var depth;
+ /** @type {!boolean} */
+ var bit;
+ if (i > this._size) {
+ throw new Error("WaveletMatrix.rank(): range error");
+ }
+ if (i === 0) {
+ return 0;
+ }
+ begin = this._range[c + ""];
+ if (begin == null) {
+ return 0;
+ }
+ end = i;
+ depth = 0;
+ while (depth < this._bitsize) {
+ bit = this._uint2bit$II(c, depth);
+ end = this._bv[depth].rank$IB(end, bit);
+ if (bit) {
+ end += this._seps[depth];
+ }
+ depth++;
+ }
+ return (end - begin | 0);
+};
+
+/**
+ * @param {!number} i
+ * @param {!number} c
+ * @return {!number}
+ */
+WaveletMatrix.prototype.rank_less_than$II = function (i, c) {
+ /** @type {!number} */
+ var begin;
+ /** @type {!number} */
+ var end;
+ /** @type {!number} */
+ var depth;
+ /** @type {!number} */
+ var rlt;
+ /** @type {!number} */
+ var rank0_begin;
+ /** @type {!number} */
+ var rank0_end;
+ /** @type {Array.<undefined|!number>} */
+ var _seps$0;
+ if (i > this._size) {
+ throw new Error("WaveletMatrix.rank_less_than(): range error");
+ }
+ if (i === 0) {
+ return 0;
+ }
+ begin = 0;
+ end = i;
+ depth = 0;
+ rlt = 0;
+ while (depth < this._bitsize) {
+ rank0_begin = this._bv[depth].rank$IB(begin, false);
+ rank0_end = this._bv[depth].rank$IB(end, false);
+ if (this._uint2bit$II(c, depth)) {
+ rlt += rank0_end - rank0_begin;
+ begin += (_seps$0 = this._seps)[depth] - rank0_begin;
+ end += _seps$0[depth] - rank0_end;
+ } else {
+ begin = rank0_begin;
+ end = rank0_end;
+ }
+ depth++;
+ }
+ return (rlt | 0);
+};
+
+/**
+ * @return {!string}
+ */
+WaveletMatrix.prototype.dump$ = function () {
+ /** @type {Array.<undefined|!string>} */
+ var contents;
+ /** @type {!number} */
+ var i;
+ /** @type {Array.<undefined|!string>} */
+ var range_contents;
+ /** @type {!number} */
+ var counter;
+ /** @type {!string} */
+ var key;
+ contents = [ Binary$dump16bitNumber$I(this._bitsize), Binary$dump32bitNumber$N(this._size) ];
+ for (i = 0; i < this._bitsize; i++) {
+ contents.push(this._bv[i].dump$());
+ }
+ for (i = 0; i < this._bitsize; i++) {
+ contents.push(Binary$dump32bitNumber$N(this._seps[i]));
+ }
+ range_contents = [ ];
+ counter = 0;
+ for (key in this._range) {
+ range_contents.push(Binary$dump32bitNumber$N(key | 0));
+ range_contents.push(Binary$dump32bitNumber$N(this._range[key]));
+ counter++;
+ }
+ contents.push(Binary$dump32bitNumber$N(counter));
+ return contents.join('') + range_contents.join('');
+};
+
+/**
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+WaveletMatrix.prototype.dump$LCompressionReport$ = function (report) {
+ /** @type {Array.<undefined|!string>} */
+ var contents;
+ /** @type {!number} */
+ var i;
+ /** @type {Array.<undefined|!string>} */
+ var range_contents;
+ /** @type {!number} */
+ var counter;
+ /** @type {!string} */
+ var key;
+ contents = [ Binary$dump16bitNumber$I(this._bitsize), Binary$dump32bitNumber$N(this._size) ];
+ CompressionReport$add$LCompressionReport$II(report, 3, 3);
+ for (i = 0; i < this._bitsize; i++) {
+ contents.push(this._bv[i].dump$LCompressionReport$(report));
+ }
+ for (i = 0; i < this._bitsize; i++) {
+ contents.push(Binary$dump32bitNumber$N(this._seps[i]));
+ CompressionReport$add$LCompressionReport$II(report, 2, 2);
+ }
+ range_contents = [ ];
+ counter = 0;
+ for (key in this._range) {
+ range_contents.push(Binary$dump32bitNumber$N(key | 0));
+ range_contents.push(Binary$dump32bitNumber$N(this._range[key]));
+ CompressionReport$add$LCompressionReport$II(report, 4, 4);
+ counter++;
+ }
+ CompressionReport$add$LCompressionReport$II(report, 2, 2);
+ contents.push(Binary$dump32bitNumber$N(counter));
+ return contents.join('') + range_contents.join('');
+};
+
+/**
+ * @param {!string} data
+ * @return {!number}
+ */
+WaveletMatrix.prototype.load$S = function (data) {
+ return this.load$SI(data, 0);
+};
+
+/**
+ * @param {!string} data
+ * @param {!number} offset
+ * @return {!number}
+ */
+WaveletMatrix.prototype.load$SI = function (data, offset) {
+ /** @type {!number} */
+ var i;
+ /** @type {BitVector} */
+ var bit_vector;
+ /** @type {!number} */
+ var range_size;
+ /** @type {!number} */
+ var value;
+ /** @type {!number} */
+ var offset$0;
+ /** @type {!number} */
+ var result$0;
+ /** @type {!number} */
+ var result$1;
+ /** @type {!number} */
+ var result$2;
+ this._bv.length = 0;
+ this._seps.length = 0;
+ this._size = 0;
+ offset$0 = offset++;
+ this._bitsize = (data.charCodeAt(offset$0) | 0);
+ result$0 = data.charCodeAt(offset) * 65536 + data.charCodeAt(offset + 1);
+ this._size = (result$0 | 0);
+ offset += 2;
+ for (i = 0; i < this._bitsize; i++) {
+ bit_vector = new BitVector$();
+ offset = bit_vector.load$SI(data, offset);
+ this._bv.push(bit_vector);
+ }
+ for (i = 0; i < this._bitsize; (i++, offset += 2)) {
+ this._seps.push(Binary$load32bitNumber$SI(data, offset));
+ }
+ result$1 = data.charCodeAt(offset) * 65536 + data.charCodeAt(offset + 1);
+ range_size = result$1;
+ offset += 2;
+ for (i = 0; i < range_size; (i++, offset += 4)) {
+ result$2 = data.charCodeAt(offset) * 65536 + data.charCodeAt(offset + 1);
+ value = Binary$load32bitNumber$SI(data, offset + 2);
+ this._range[result$2 + ""] = (value | 0);
+ }
+ return offset;
+};
+
+/**
+ * @param {Object.<string, undefined|!number>} input
+ * @return {Object.<string, undefined|!number>}
+ */
+WaveletMatrix._shallow_copy$HI = function (input) {
+ /** @type {Object.<string, undefined|!number>} */
+ var result;
+ /** @type {!string} */
+ var key;
+ result = ({ });
+ for (key in input) {
+ result[key] = input[key];
+ }
+ return result;
+};
+
+var WaveletMatrix$_shallow_copy$HI = WaveletMatrix._shallow_copy$HI;
+
+/**
+ * @param {!number} c
+ * @param {!number} i
+ * @return {!boolean}
+ */
+WaveletMatrix.prototype._uint2bit$II = function (c, i) {
+ return (c >>> this._bitsize - 1 - i & 0x1) === 0x1;
+};
+
+/**
+ * class BurrowsWheelerTransform extends Object
+ * @constructor
+ */
+function BurrowsWheelerTransform() {
+}
+
+/**
+ * @constructor
+ */
+function BurrowsWheelerTransform$() {
+ this._str = "";
+ this._size = 0;
+ this._head = 0;
+ this._suffixarray = [ ];
+};
+
+BurrowsWheelerTransform$.prototype = new BurrowsWheelerTransform;
+
+/**
+ * @param {BurrowsWheelerTransform} $this
+ * @return {!number}
+ */
+BurrowsWheelerTransform.size$LBurrowsWheelerTransform$ = function ($this) {
+ return $this._size;
+};
+
+var BurrowsWheelerTransform$size$LBurrowsWheelerTransform$ = BurrowsWheelerTransform.size$LBurrowsWheelerTransform$;
+
+/**
+ * @param {BurrowsWheelerTransform} $this
+ * @return {!number}
+ */
+BurrowsWheelerTransform.head$LBurrowsWheelerTransform$ = function ($this) {
+ return $this._head;
+};
+
+var BurrowsWheelerTransform$head$LBurrowsWheelerTransform$ = BurrowsWheelerTransform.head$LBurrowsWheelerTransform$;
+
+/**
+ * @param {BurrowsWheelerTransform} $this
+ */
+BurrowsWheelerTransform.clear$LBurrowsWheelerTransform$ = function ($this) {
+ $this._str = "";
+ $this._size = 0;
+ $this._head = 0;
+ $this._suffixarray.length = 0;
+};
+
+var BurrowsWheelerTransform$clear$LBurrowsWheelerTransform$ = BurrowsWheelerTransform.clear$LBurrowsWheelerTransform$;
+
+/**
+ * @param {BurrowsWheelerTransform} $this
+ * @param {!string} str
+ */
+BurrowsWheelerTransform.build$LBurrowsWheelerTransform$S = function ($this, str) {
+ /** @type {!string} */
+ var _str$0;
+ /** @type {Array.<undefined|!number>} */
+ var _suffixarray$0;
+ _str$0 = $this._str = str;
+ $this._size = _str$0.length;
+ _suffixarray$0 = $this._suffixarray = SAIS$make$S(str);
+ $this._head = (_suffixarray$0.indexOf(0) | 0);
+};
+
+var BurrowsWheelerTransform$build$LBurrowsWheelerTransform$S = BurrowsWheelerTransform.build$LBurrowsWheelerTransform$S;
+
+/**
+ * @param {BurrowsWheelerTransform} $this
+ * @param {!number} i
+ * @return {!string}
+ */
+BurrowsWheelerTransform.get$LBurrowsWheelerTransform$I = function ($this, i) {
+ /** @type {!number} */
+ var size;
+ /** @type {!number} */
+ var index;
+ size = $this._size;
+ if (i >= size) {
+ throw new Error("BurrowsWheelerTransform.get() : range error");
+ }
+ index = ($this._suffixarray[i] + size - 1) % size;
+ return $this._str.charAt(index);
+};
+
+var BurrowsWheelerTransform$get$LBurrowsWheelerTransform$I = BurrowsWheelerTransform.get$LBurrowsWheelerTransform$I;
+
+/**
+ * @param {BurrowsWheelerTransform} $this
+ * @return {!string}
+ */
+BurrowsWheelerTransform.get$LBurrowsWheelerTransform$ = function ($this) {
+ /** @type {Array.<undefined|!string>} */
+ var str;
+ /** @type {!number} */
+ var size;
+ /** @type {!number} */
+ var i;
+ str = [ ];
+ size = $this._size;
+ for (i = 0; i < size; i++) {
+ str.push(BurrowsWheelerTransform$get$LBurrowsWheelerTransform$I($this, i));
+ }
+ return str.join("");
+};
+
+var BurrowsWheelerTransform$get$LBurrowsWheelerTransform$ = BurrowsWheelerTransform.get$LBurrowsWheelerTransform$;
+
+/**
+ * @param {BurrowsWheelerTransform} $this
+ * @param {!string} replace
+ * @return {!string}
+ */
+BurrowsWheelerTransform.get$LBurrowsWheelerTransform$S = function ($this, replace) {
+ /** @type {!string} */
+ var result;
+ result = BurrowsWheelerTransform$get$LBurrowsWheelerTransform$($this);
+ return result.replace(BurrowsWheelerTransform.END_MARKER, replace);
+};
+
+var BurrowsWheelerTransform$get$LBurrowsWheelerTransform$S = BurrowsWheelerTransform.get$LBurrowsWheelerTransform$S;
+
+/**
+ * class OArray extends Object
+ * @constructor
+ */
+function OArray() {
+}
+
+/**
+ * @constructor
+ * @param {Array.<undefined|!number>} array
+ */
+function OArray$AI(array) {
+ this.array = array;
+ this.offset = 0;
+};
+
+OArray$AI.prototype = new OArray;
+
+/**
+ * @constructor
+ * @param {Array.<undefined|!number>} array
+ * @param {!number} offset
+ */
+function OArray$AII(array, offset) {
+ this.array = array;
+ this.offset = offset;
+};
+
+OArray$AII.prototype = new OArray;
+
+/**
+ * @param {OArray} $this
+ * @param {!number} index
+ * @return {!number}
+ */
+OArray.get$LOArray$I = function ($this, index) {
+ return $this.array[index + $this.offset];
+};
+
+var OArray$get$LOArray$I = OArray.get$LOArray$I;
+
+/**
+ * @param {OArray} $this
+ * @param {!number} index
+ * @param {!number} value
+ */
+OArray.set$LOArray$II = function ($this, index, value) {
+ $this.array[index + $this.offset] = value;
+};
+
+var OArray$set$LOArray$II = OArray.set$LOArray$II;
+
+/**
+ * @param {OArray} $this
+ * @param {!number} index
+ * @return {!boolean}
+ */
+OArray.isS$LOArray$I = function ($this, index) {
+ /** @type {Array.<undefined|!number>} */
+ var array$0;
+ /** @type {!number} */
+ var offset$0;
+ return (array$0 = $this.array)[index + (offset$0 = $this.offset)] < array$0[index + offset$0 + 1];
+};
+
+var OArray$isS$LOArray$I = OArray.isS$LOArray$I;
+
+/**
+ * @param {OArray} $this
+ * @param {!number} index1
+ * @param {!number} index2
+ * @return {!boolean}
+ */
+OArray.compare$LOArray$II = function ($this, index1, index2) {
+ /** @type {Array.<undefined|!number>} */
+ var array$0;
+ /** @type {!number} */
+ var offset$0;
+ return (array$0 = $this.array)[index1 + (offset$0 = $this.offset)] == array$0[index2 + offset$0];
+};
+
+var OArray$compare$LOArray$II = OArray.compare$LOArray$II;
+
+/**
+ * class SAIS extends Object
+ * @constructor
+ */
+function SAIS() {
+}
+
+/**
+ * @constructor
+ */
+function SAIS$() {
+};
+
+SAIS$.prototype = new SAIS;
+
+/**
+ * @param {BitVector} t
+ * @param {!number} i
+ * @return {!boolean}
+ */
+SAIS._isLMS$LBitVector$I = function (t, i) {
+ return i > 0 && t.get$I(i) && ! t.get$I(i - 1);
+};
+
+var SAIS$_isLMS$LBitVector$I = SAIS._isLMS$LBitVector$I;
+
+/**
+ * @param {OArray} s
+ * @param {Array.<undefined|!number>} bkt
+ * @param {!number} n
+ * @param {!number} K
+ * @param {!boolean} end
+ */
+SAIS._getBuckets$LOArray$AIIIB = function (s, bkt, n, K, end) {
+ /** @type {!number} */
+ var sum;
+ /** @type {!number} */
+ var i;
+ sum = 0;
+ for (i = 0; i <= K; i++) {
+ bkt[i] = 0;
+ }
+ for (i = 0; i < n; i++) {
+ bkt[OArray$get$LOArray$I(s, i)]++;
+ }
+ for (i = 0; i <= K; i++) {
+ sum += bkt[i];
+ bkt[i] = ((end ? sum : sum - bkt[i]) | 0);
+ }
+};
+
+var SAIS$_getBuckets$LOArray$AIIIB = SAIS._getBuckets$LOArray$AIIIB;
+
+/**
+ * @param {BitVector} t
+ * @param {Array.<undefined|!number>} SA
+ * @param {OArray} s
+ * @param {Array.<undefined|!number>} bkt
+ * @param {!number} n
+ * @param {!number} K
+ * @param {!boolean} end
+ */
+SAIS._induceSAl$LBitVector$AILOArray$AIIIB = function (t, SA, s, bkt, n, K, end) {
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var j;
+ SAIS$_getBuckets$LOArray$AIIIB(s, bkt, n, K, end);
+ for (i = 0; i < n; i++) {
+ j = SA[i] - 1;
+ if (j >= 0 && ! t.get$I(j)) {
+ SA[bkt[OArray$get$LOArray$I(s, j)]++] = (j | 0);
+ }
+ }
+};
+
+var SAIS$_induceSAl$LBitVector$AILOArray$AIIIB = SAIS._induceSAl$LBitVector$AILOArray$AIIIB;
+
+/**
+ * @param {BitVector} t
+ * @param {Array.<undefined|!number>} SA
+ * @param {OArray} s
+ * @param {Array.<undefined|!number>} bkt
+ * @param {!number} n
+ * @param {!number} K
+ * @param {!boolean} end
+ */
+SAIS._induceSAs$LBitVector$AILOArray$AIIIB = function (t, SA, s, bkt, n, K, end) {
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var j;
+ SAIS$_getBuckets$LOArray$AIIIB(s, bkt, n, K, end);
+ for (i = n - 1; i >= 0; i--) {
+ j = SA[i] - 1;
+ if (j >= 0 && t.get$I(j)) {
+ SA[-- bkt[OArray$get$LOArray$I(s, j)]] = (j | 0);
+ }
+ }
+};
+
+var SAIS$_induceSAs$LBitVector$AILOArray$AIIIB = SAIS._induceSAs$LBitVector$AILOArray$AIIIB;
+
+/**
+ * @param {!string} source
+ * @return {Array.<undefined|!number>}
+ */
+SAIS.make$S = function (source) {
+ /** @type {Array.<undefined|!number>} */
+ var charCodes;
+ /** @type {!number} */
+ var maxCode;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var code;
+ /** @type {Array.<undefined|!number>} */
+ var SA;
+ /** @type {OArray} */
+ var s;
+ charCodes = [ ];
+ charCodes.length = source.length;
+ maxCode = 0;
+ for (i = 0; i < source.length; i++) {
+ code = source.charCodeAt(i);
+ charCodes[i] = (code | 0);
+ maxCode = (code > maxCode ? code : maxCode);
+ }
+ SA = [ ];
+ SA.length = source.length;
+ s = ({offset: 0, array: charCodes});
+ SAIS$_make$LOArray$AIII(s, SA, source.length, maxCode);
+ return SA;
+};
+
+var SAIS$make$S = SAIS.make$S;
+
+/**
+ * @param {OArray} s
+ * @param {Array.<undefined|!number>} SA
+ * @param {!number} n
+ * @param {!number} K
+ */
+SAIS._make$LOArray$AIII = function (s, SA, n, K) {
+ /** @type {BitVector} */
+ var t;
+ /** @type {!number} */
+ var i;
+ /** @type {Array.<undefined|!number>} */
+ var bkt;
+ /** @type {!number} */
+ var n1;
+ /** @type {!number} */
+ var name;
+ /** @type {!number} */
+ var prev;
+ /** @type {undefined|!number} */
+ var pos;
+ /** @type {!boolean} */
+ var diff;
+ /** @type {!number} */
+ var d;
+ /** @type {!number} */
+ var j;
+ /** @type {Array.<undefined|!number>} */
+ var SA1;
+ /** @type {OArray} */
+ var s1;
+ /** @type {!number} */
+ var i$0;
+ /** @type {!number} */
+ var index$0;
+ t = new BitVector$();
+ t.set$IB(n - 2, false);
+ t.set$IB(n - 1, true);
+ for (i = n - 3; i >= 0; i--) {
+ t.set$IB(i, OArray$isS$LOArray$I(s, i) || OArray$compare$LOArray$II(s, i, i + 1) && t.get$I(i + 1));
+ }
+ bkt = [ ];
+ bkt.length = K + 1;
+ SAIS$_getBuckets$LOArray$AIIIB(s, bkt, n, K, true);
+ for (i = 0; i < n; i++) {
+ SA[i] = -1;
+ }
+ for (i = 1; i < n; i++) {
+ if (SAIS$_isLMS$LBitVector$I(t, i)) {
+ SA[-- bkt[OArray$get$LOArray$I(s, i)]] = (i | 0);
+ }
+ }
+ SAIS$_induceSAl$LBitVector$AILOArray$AIIIB(t, SA, s, bkt, n, K, false);
+ SAIS$_induceSAs$LBitVector$AILOArray$AIIIB(t, SA, s, bkt, n, K, true);
+ n1 = 0;
+ for (i = 0; i < n; i++) {
+ i$0 = SA[i];
+ if (i$0 > 0 && t.get$I(i$0) && ! t.get$I(i$0 - 1)) {
+ SA[n1++] = SA[i];
+ }
+ }
+ for (i = n1; i < n; i++) {
+ SA[i] = -1;
+ }
+ name = 0;
+ prev = -1;
+ for (i = 0; i < n1; i++) {
+ pos = SA[i];
+ diff = false;
+ for (d = 0; d < n; d++) {
+ if (prev === -1 || ! OArray$compare$LOArray$II(s, pos + d, prev + d) || t.get$I(pos + d) !== t.get$I(prev + d)) {
+ diff = true;
+ break;
+ } else {
+ if (d > 0 && (SAIS$_isLMS$LBitVector$I(t, pos + d) || SAIS$_isLMS$LBitVector$I(t, prev + d))) {
+ break;
+ }
+ }
+ }
+ if (diff) {
+ name++;
+ prev = pos;
+ }
+ pos = ((pos % 2 === 0 ? pos / 2 : (pos - 1) / 2) | 0);
+ SA[n1 + pos] = (name - 1 | 0);
+ }
+ for ((i = n - 1, j = n - 1); i >= n1; i--) {
+ if (SA[i] >= 0) {
+ SA[j--] = SA[i];
+ }
+ }
+ SA1 = SA;
+ s1 = ({offset: n - n1, array: SA});
+ if (name < n1) {
+ SAIS$_make$LOArray$AIII(s1, SA1, n1, name - 1);
+ } else {
+ for (i = 0; i < n1; i++) {
+ SA1[OArray$get$LOArray$I(s1, i)] = (i | 0);
+ }
+ }
+ bkt = [ ];
+ bkt.length = K + 1;
+ SAIS$_getBuckets$LOArray$AIIIB(s, bkt, n, K, true);
+ for ((i = 1, j = 0); i < n; i++) {
+ if (SAIS$_isLMS$LBitVector$I(t, i)) {
+ OArray$set$LOArray$II(s1, j++, i);
+ }
+ }
+ for (i = 0; i < n1; i++) {
+ index$0 = SA1[i];
+ SA1[i] = s1.array[index$0 + s1.offset];
+ }
+ for (i = n1; i < n; i++) {
+ SA[i] = -1;
+ }
+ for (i = n1 - 1; i >= 0; i--) {
+ j = SA[i];
+ SA[i] = -1;
+ SA[-- bkt[OArray$get$LOArray$I(s, j)]] = (j | 0);
+ }
+ SAIS$_induceSAl$LBitVector$AILOArray$AIIIB(t, SA, s, bkt, n, K, false);
+ SAIS$_induceSAs$LBitVector$AILOArray$AIIIB(t, SA, s, bkt, n, K, true);
+};
+
+var SAIS$_make$LOArray$AIII = SAIS._make$LOArray$AIII;
+
+OktaviaSearch._stemmer = null;
+OktaviaSearch._instance = null;
+$__jsx_lazy_init(Oktavia, "eof", function () {
+ return String.fromCharCode(0);
+});
+$__jsx_lazy_init(Oktavia, "eob", function () {
+ return String.fromCharCode(1);
+});
+$__jsx_lazy_init(Oktavia, "unknown", function () {
+ return String.fromCharCode(3);
+});
+Binary._base64EncodeChars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
+$__jsx_lazy_init(Binary, "_base64DecodeChars", function () {
+ return [ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 62, -1, -1, -1, 63, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, -1, -1, -1, -1, -1, -1, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -1, -1, -1, -1, -1, -1, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, -1, -1, -1, -1 ];
+});
+$__jsx_lazy_init(Style, "console", function () {
+ return ({ 'title': [ '\x1B[32m\x1b[4m', '\x1B[39m\x1b[0m' ], 'url': [ '\x1B[34m', '\x1B[39m' ], 'hit': [ '\x1B[4m', '\x1B[0m' ], 'del': [ '\x1B[9m', '\x1B[0m' ], 'summary': [ '\x1B[90m', '\x1B[39m' ] });
+});
+$__jsx_lazy_init(Style, "html", function () {
+ return ({ 'title': [ '<span class="title">', '</span>' ], 'url': [ '<span class="url">', '</span>' ], 'hit': [ '<span class="hit">', '</span>' ], 'del': [ '<del>', '</del>' ], 'summary': [ '<span class="reuslt">', '</span>' ] });
+});
+$__jsx_lazy_init(Style, "ignore", function () {
+ return ({ 'tilte': [ '', '' ], 'url': [ '', '' ], 'hit': [ '', '' ], 'del': [ '', '' ], 'summary': [ '', '' ] });
+});
+DutchStemmer.serialVersionUID = 1;
+$__jsx_lazy_init(DutchStemmer, "methodObject", function () {
+ return new DutchStemmer$();
+});
+$__jsx_lazy_init(DutchStemmer, "a_0", function () {
+ return [ new Among$SII("", -1, 6), new Among$SII("\u00E1", 0, 1), new Among$SII("\u00E4", 0, 1), new Among$SII("\u00E9", 0, 2), new Among$SII("\u00EB", 0, 2), new Among$SII("\u00ED", 0, 3), new Among$SII("\u00EF", 0, 3), new Among$SII("\u00F3", 0, 4), new Among$SII("\u00F6", 0, 4), new Among$SII("\u00FA", 0, 5), new Among$SII("\u00FC", 0, 5) ];
+});
+$__jsx_lazy_init(DutchStemmer, "a_1", function () {
+ return [ new Among$SII("", -1, 3), new Among$SII("I", 0, 2), new Among$SII("Y", 0, 1) ];
+});
+$__jsx_lazy_init(DutchStemmer, "a_2", function () {
+ return [ new Among$SII("dd", -1, -1), new Among$SII("kk", -1, -1), new Among$SII("tt", -1, -1) ];
+});
+$__jsx_lazy_init(DutchStemmer, "a_3", function () {
+ return [ new Among$SII("ene", -1, 2), new Among$SII("se", -1, 3), new Among$SII("en", -1, 2), new Among$SII("heden", 2, 1), new Among$SII("s", -1, 3) ];
+});
+$__jsx_lazy_init(DutchStemmer, "a_4", function () {
+ return [ new Among$SII("end", -1, 1), new Among$SII("ig", -1, 2), new Among$SII("ing", -1, 1), new Among$SII("lijk", -1, 3), new Among$SII("baar", -1, 4), new Among$SII("bar", -1, 5) ];
+});
+$__jsx_lazy_init(DutchStemmer, "a_5", function () {
+ return [ new Among$SII("aa", -1, -1), new Among$SII("ee", -1, -1), new Among$SII("oo", -1, -1), new Among$SII("uu", -1, -1) ];
+});
+$__jsx_lazy_init(DutchStemmer, "g_v", function () {
+ return [ 17, 65, 16, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128 ];
+});
+$__jsx_lazy_init(DutchStemmer, "g_v_I", function () {
+ return [ 1, 0, 0, 17, 65, 16, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128 ];
+});
+$__jsx_lazy_init(DutchStemmer, "g_v_j", function () {
+ return [ 17, 67, 16, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128 ];
+});
+$__jsx_lazy_init(_Common, "buffers", function () {
+ return [ "comment", "sgmlDecl", "textNode", "tagName", "doctype", "procInstName", "procInstBody", "entity", "attribName", "attribValue", "cdata", "script" ];
+});
+$__jsx_lazy_init(_Common, "EVENTS", function () {
+ return [ "text", "processinginstruction", "sgmldeclaration", "doctype", "comment", "attribute", "opentag", "closetag", "opencdata", "cdata", "clo_State.CDATA", "error", "end", "ready", "script", "opennamespace", "closenamespace" ];
+});
+_Common.MAX_BUFFER_LENGTH = 65536;
+_State.BEGIN = 1;
+_State.TEXT = 2;
+_State.TEXT_ENTITY = 3;
+_State.OPEN_WAKA = 4;
+_State.SGML_DECL = 5;
+_State.SGML_DECL_QUOTED = 6;
+_State.DOCTYPE = 7;
+_State.DOCTYPE_QUOTED = 8;
+_State.DOCTYPE_DTD = 9;
+_State.DOCTYPE_DTD_QUOTED = 10;
+_State.COMMENT_STARTING = 11;
+_State.COMMENT = 12;
+_State.COMMENT_ENDING = 13;
+_State.COMMENT_ENDED = 14;
+_State.CDATA = 15;
+_State.CDATA_ENDING = 16;
+_State.CDATA_ENDING_2 = 17;
+_State.PROC_INST = 18;
+_State.PROC_INST_BODY = 19;
+_State.PROC_INST_ENDING = 20;
+_State.OPEN_TAG = 21;
+_State.OPEN_TAG_SLASH = 22;
+_State.ATTRIB = 23;
+_State.ATTRIB_NAME = 24;
+_State.ATTRIB_NAME_SAW_WHITE = 25;
+_State.ATTRIB_VALUE = 26;
+_State.ATTRIB_VALUE_QUOTED = 27;
+_State.ATTRIB_VALUE_UNQUOTED = 28;
+_State.ATTRIB_VALUE_ENTITY_Q = 29;
+_State.ATTRIB_VALUE_ENTITY_U = 30;
+_State.CLOSE_TAG = 31;
+_State.CLOSE_TAG_SAW_WHITE = 32;
+_State.SCRIPT = 33;
+_State.SCRIPT_ENDING = 34;
+$__jsx_lazy_init(_Entities, "_entities", function () {
+ return ({ "amp": "&", "gt": ">", "lt": "<", "quot": "\"", "apos": "'", "AElig": 198, "Aacute": 193, "Acirc": 194, "Agrave": 192, "Aring": 197, "Atilde": 195, "Auml": 196, "Ccedil": 199, "ETH": 208, "Eacute": 201, "Ecirc": 202, "Egrave": 200, "Euml": 203, "Iacute": 205, "Icirc": 206, "Igrave": 204, "Iuml": 207, "Ntilde": 209, "Oacute": 211, "Ocirc": 212, "Ograve": 210, "Oslash": 216, "Otilde": 213, "Ouml": 214, "THORN": 222, "Uacute": 218, "Ucirc": 219, "Ugrave": 217, "Uuml": 220, "Yacute": 221, "aacute": 225, "acirc": 226, "aelig": 230, "agrave": 224, "aring": 229, "atilde": 227, "auml": 228, "ccedil": 231, "eacute": 233, "ecirc": 234, "egrave": 232, "eth": 240, "euml": 235, "iacute": 237, "icirc": 238, "igrave": 236, "iuml": 239, "ntilde": 241, "oacute": 243, "ocirc": 244, "ograve": 242, "oslash": 248, "otilde": 245, "ouml": 246, "szlig": 223, "thorn": 254, "uacute": 250, "ucirc": 251, "ugrave": 249, "uuml": 252, "yacute": 253, "yuml": 255, "copy": 169, "reg": 174, "nbsp": 160, "iexcl": 161, "cent": 162, "pound": 163, "curren": 164, "yen": 165, "brvbar": 166, "sect": 167, "uml": 168, "ordf": 170, "laquo": 171, "not": 172, "shy": 173, "macr": 175, "deg": 176, "plusmn": 177, "sup1": 185, "sup2": 178, "sup3": 179, "acute": 180, "micro": 181, "para": 182, "middot": 183, "cedil": 184, "ordm": 186, "raquo": 187, "frac14": 188, "frac12": 189, "frac34": 190, "iquest": 191, "times": 215, "divide": 247, "OElig": 338, "oelig": 339, "Scaron": 352, "scaron": 353, "Yuml": 376, "fnof": 402, "circ": 710, "tilde": 732, "Alpha": 913, "Beta": 914, "Gamma": 915, "Delta": 916, "Epsilon": 917, "Zeta": 918, "Eta": 919, "Theta": 920, "Iota": 921, "Kappa": 922, "Lambda": 923, "Mu": 924, "Nu": 925, "Xi": 926, "Omicron": 927, "Pi": 928, "Rho": 929, "Sigma": 931, "Tau": 932, "Upsilon": 933, "Phi": 934, "Chi": 935, "Psi": 936, "Omega": 937, "alpha": 945, "beta": 946, "gamma": 947, "delta": 948, "epsilon": 949, "zeta": 950, "eta": 951, "theta": 952, "iota": 953, "kappa": 954, "lambda": 955, "mu": 956, "nu": 957, "xi": 958, "omicron": 959, "pi": 960, "rho": 961, "sigmaf": 962, "sigma": 963, "tau": 964, "upsilon": 965, "phi": 966, "chi": 967, "psi": 968, "omega": 969, "thetasym": 977, "upsih": 978, "piv": 982, "ensp": 8194, "emsp": 8195, "thinsp": 8201, "zwnj": 8204, "zwj": 8205, "lrm": 8206, "rlm": 8207, "ndash": 8211, "mdash": 8212, "lsquo": 8216, "rsquo": 8217, "sbquo": 8218, "ldquo": 8220, "rdquo": 8221, "bdquo": 8222, "dagger": 8224, "Dagger": 8225, "bull": 8226, "hellip": 8230, "permil": 8240, "prime": 8242, "Prime": 8243, "lsaquo": 8249, "rsaquo": 8250, "oline": 8254, "frasl": 8260, "euro": 8364, "image": 8465, "weierp": 8472, "real": 8476, "trade": 8482, "alefsym": 8501, "larr": 8592, "uarr": 8593, "rarr": 8594, "darr": 8595, "harr": 8596, "crarr": 8629, "lArr": 8656, "uArr": 8657, "rArr": 8658, "dArr": 8659, "hArr": 8660, "forall": 8704, "part": 8706, "exist": 8707, "empty": 8709, "nabla": 8711, "isin": 8712, "notin": 8713, "ni": 8715, "prod": 8719, "sum": 8721, "minus": 8722, "lowast": 8727, "radic": 8730, "prop": 8733, "infin": 8734, "ang": 8736, "and": 8743, "or": 8744, "cap": 8745, "cup": 8746, "int": 8747, "there4": 8756, "sim": 8764, "cong": 8773, "asymp": 8776, "ne": 8800, "equiv": 8801, "le": 8804, "ge": 8805, "sub": 8834, "sup": 8835, "nsub": 8836, "sube": 8838, "supe": 8839, "oplus": 8853, "otimes": 8855, "perp": 8869, "sdot": 8901, "lceil": 8968, "rceil": 8969, "lfloor": 8970, "rfloor": 8971, "lang": 9001, "rang": 9002, "loz": 9674, "spades": 9824, "clubs": 9827, "hearts": 9829, "diams": 9830 });
+});
+BitVector.SMALL_BLOCK_SIZE = 32;
+BitVector.LARGE_BLOCK_SIZE = 256;
+BitVector.BLOCK_RATE = 8;
+$__jsx_lazy_init(BurrowsWheelerTransform, "END_MARKER", function () {
+ return String.fromCharCode(0);
+});
+var $__jsx_classMap = {
+ "tool/web/oktavia-dutch-search.jsx": {
+ _Main: _Main,
+ _Main$: _Main$
+ },
+ "tool/web/oktavia-search.jsx": {
+ _Result: _Result,
+ _Result$SSSI: _Result$SSSI,
+ _Proposal: _Proposal,
+ _Proposal$SSI: _Proposal$SSI,
+ OktaviaSearch: OktaviaSearch,
+ OktaviaSearch$I: OktaviaSearch$I,
+ _Main: _Main$0,
+ _Main$: _Main$0$
+ },
+ "src/oktavia.jsx": {
+ Oktavia: Oktavia,
+ Oktavia$: Oktavia$
+ },
+ "src/binary-util.jsx": {
+ Binary: Binary,
+ Binary$: Binary$,
+ LoadedStringResult: LoadedStringResult,
+ LoadedStringResult$SI: LoadedStringResult$SI,
+ LoadedStringListResult: LoadedStringListResult,
+ LoadedStringListResult$SI: LoadedStringListResult$SI,
+ LoadedStringListMapResult: LoadedStringListMapResult,
+ LoadedStringListMapResult$SI: LoadedStringListMapResult$SI,
+ LoadedNumberListResult: LoadedNumberListResult,
+ LoadedNumberListResult$SI: LoadedNumberListResult$SI,
+ CompressionReport: CompressionReport,
+ CompressionReport$: CompressionReport$
+ },
+ "src/query.jsx": {
+ Query: Query,
+ Query$: Query$
+ },
+ "src/query-string-parser.jsx": {
+ QueryStringParser: QueryStringParser,
+ QueryStringParser$: QueryStringParser$
+ },
+ "src/search-result.jsx": {
+ Proposal: Proposal,
+ Proposal$II: Proposal$II,
+ Position: Position,
+ Position$SIB: Position$SIB,
+ SearchUnit: SearchUnit,
+ SearchUnit$I: SearchUnit$I,
+ SingleResult: SingleResult,
+ SingleResult$: SingleResult$,
+ SingleResult$SBB: SingleResult$SBB,
+ SearchSummary: SearchSummary,
+ SearchSummary$: SearchSummary$,
+ SearchSummary$LOktavia$: SearchSummary$LOktavia$
+ },
+ "src/style.jsx": {
+ Style: Style,
+ Style$S: Style$S,
+ _HTMLHandler: _HTMLHandler,
+ _HTMLHandler$HASB: _HTMLHandler$HASB
+ },
+ "src/stemmer/stemmer.jsx": {
+ Stemmer: Stemmer,
+ Stemmer$: Stemmer$
+ },
+ "src/stemmer/base-stemmer.jsx": {
+ BaseStemmer: BaseStemmer,
+ BaseStemmer$: BaseStemmer$
+ },
+ "src/stemmer/dutch-stemmer.jsx": {
+ DutchStemmer: DutchStemmer,
+ DutchStemmer$: DutchStemmer$
+ },
+ "src/stemmer/among.jsx": {
+ Among: Among,
+ Among$SII: Among$SII,
+ Among$SIIF$LBaseStemmer$B$LBaseStemmer$: Among$SIIF$LBaseStemmer$B$LBaseStemmer$
+ },
+ "src/metadata.jsx": {
+ Metadata: Metadata,
+ Metadata$LOktavia$: Metadata$LOktavia$,
+ Section: Section,
+ Section$LOktavia$: Section$LOktavia$,
+ Splitter: Splitter,
+ Splitter$LOktavia$: Splitter$LOktavia$,
+ Splitter$LOktavia$S: Splitter$LOktavia$S,
+ Table: Table,
+ Table$LOktavia$AS: Table$LOktavia$AS,
+ Block: Block,
+ Block$LOktavia$: Block$LOktavia$
+ },
+ "src/fm-index.jsx": {
+ FMIndex: FMIndex,
+ FMIndex$: FMIndex$
+ },
+ "src/sax.jsx": {
+ Tag: Tag,
+ Tag$S: Tag$S,
+ _Common: _Common,
+ _Common$: _Common$,
+ _State: _State,
+ _State$: _State$,
+ SAXHandler: SAXHandler,
+ SAXHandler$: SAXHandler$,
+ SAXParser: SAXParser,
+ SAXParser$LSAXHandler$: SAXParser$LSAXHandler$,
+ SAXParser$LSAXHandler$B: SAXParser$LSAXHandler$B,
+ Char: Char,
+ Char$: Char$,
+ _Entities: _Entities,
+ _Entities$: _Entities$
+ },
+ "src/bit-vector.jsx": {
+ BitVector: BitVector,
+ BitVector$: BitVector$
+ },
+ "src/wavelet-matrix.jsx": {
+ WaveletMatrix: WaveletMatrix,
+ WaveletMatrix$: WaveletMatrix$
+ },
+ "src/burrows-wheeler-transform.jsx": {
+ BurrowsWheelerTransform: BurrowsWheelerTransform,
+ BurrowsWheelerTransform$: BurrowsWheelerTransform$
+ },
+ "src/sais.jsx": {
+ OArray: OArray,
+ OArray$AI: OArray$AI,
+ OArray$AII: OArray$AII,
+ SAIS: SAIS,
+ SAIS$: SAIS$
+ }
+};
+
+
+/**
+ * launches _Main.main(:string[]):void invoked by jsx --run|--executable
+ */
+JSX.runMain = function (sourceFile, args) {
+ var module = JSX.require(sourceFile);
+ if (! module) {
+ throw new ReferenceError("entry point module not found in " + sourceFile);
+ }
+ if (! module._Main) {
+ throw new ReferenceError("entry point _Main not found in " + sourceFile);
+ }
+ if (! module._Main.main$AS) {
+ throw new ReferenceError("entry point _Main.main(:string[]):void not found in " + sourceFile);
+ }
+ module._Main.main$AS(args);
+};
+
+/**
+ * launches _Test#test*():void invoked by jsx --test
+ */
+JSX.runTests = function (sourceFile, tests) {
+ var module = JSX.require(sourceFile);
+ var testClass = module._Test$;
+
+ if (!testClass) return; // skip if there's no test class
+
+ if(tests.length === 0) {
+ var p = testClass.prototype;
+ for (var m in p) {
+ if (p[m] instanceof Function
+ && /^test.*[$]$/.test(m)) {
+ tests.push(m);
+ }
+ }
+ }
+ else { // set as process arguments
+ tests = tests.map(function (name) {
+ return name + "$"; // mangle for function test*():void
+ });
+ }
+
+ var testCase = new testClass();
+
+ if (testCase.beforeClass$AS != null)
+ testCase.beforeClass$AS(tests);
+
+ for (var i = 0; i < tests.length; ++i) {
+ (function (method) {
+ if (method in testCase) {
+ testCase.run$SF$V$(method, function() { testCase[method](); });
+ }
+ else {
+ throw new ReferenceError("No such test method: " + method);
+ }
+ }(tests[i]));
+ }
+
+ if (testCase.afterClass$ != null)
+ testCase.afterClass$();
+};
+/**
+ * call a function on load/DOMContentLoaded
+ */
+function $__jsx_onload (event) {
+ window.removeEventListener("load", $__jsx_onload);
+ document.removeEventListener("DOMContentLoaded", $__jsx_onload);
+ JSX.runMain("tool/web/oktavia-dutch-search.jsx", [])
+}
+
+window.addEventListener("load", $__jsx_onload);
+document.addEventListener("DOMContentLoaded", $__jsx_onload);
+
+})(JSX);
diff --git a/web/server/h2o/libh2o/misc/oktavia/lib/oktavia-english-search.js b/web/server/h2o/libh2o/misc/oktavia/lib/oktavia-english-search.js
new file mode 100644
index 00000000..cf5c38f3
--- /dev/null
+++ b/web/server/h2o/libh2o/misc/oktavia/lib/oktavia-english-search.js
@@ -0,0 +1,8922 @@
+// generatedy by JSX compiler 0.9.24 (2013-04-05 13:45:00 +0900; 1b229cc6a411f674f0f7cf7a79b7a8b3f8eb7414)
+var JSX = {};
+(function (JSX) {
+/**
+ * copies the implementations from source interface to target
+ */
+function $__jsx_merge_interface(target, source) {
+ for (var k in source.prototype)
+ if (source.prototype.hasOwnProperty(k))
+ target.prototype[k] = source.prototype[k];
+}
+
+/**
+ * defers the initialization of the property
+ */
+function $__jsx_lazy_init(obj, prop, func) {
+ function reset(obj, prop, value) {
+ delete obj[prop];
+ obj[prop] = value;
+ return value;
+ }
+
+ Object.defineProperty(obj, prop, {
+ get: function () {
+ return reset(obj, prop, func());
+ },
+ set: function (v) {
+ reset(obj, prop, v);
+ },
+ enumerable: true,
+ configurable: true
+ });
+}
+
+/**
+ * sideeffect().a /= b
+ */
+function $__jsx_div_assign(obj, prop, divisor) {
+ return obj[prop] = (obj[prop] / divisor) | 0;
+}
+
+/*
+ * global functions, renamed to avoid conflict with local variable names
+ */
+var $__jsx_parseInt = parseInt;
+var $__jsx_parseFloat = parseFloat;
+var $__jsx_isNaN = isNaN;
+var $__jsx_isFinite = isFinite;
+
+var $__jsx_encodeURIComponent = encodeURIComponent;
+var $__jsx_decodeURIComponent = decodeURIComponent;
+var $__jsx_encodeURI = encodeURI;
+var $__jsx_decodeURI = decodeURI;
+
+var $__jsx_ObjectToString = Object.prototype.toString;
+var $__jsx_ObjectHasOwnProperty = Object.prototype.hasOwnProperty;
+
+/*
+ * profiler object, initialized afterwards
+ */
+function $__jsx_profiler() {
+}
+
+/*
+ * public interface to JSX code
+ */
+JSX.require = function (path) {
+ var m = $__jsx_classMap[path];
+ return m !== undefined ? m : null;
+};
+
+JSX.profilerIsRunning = function () {
+ return $__jsx_profiler.getResults != null;
+};
+
+JSX.getProfileResults = function () {
+ return ($__jsx_profiler.getResults || function () { return {}; })();
+};
+
+JSX.postProfileResults = function (url, cb) {
+ if ($__jsx_profiler.postResults == null)
+ throw new Error("profiler has not been turned on");
+ return $__jsx_profiler.postResults(url, cb);
+};
+
+JSX.resetProfileResults = function () {
+ if ($__jsx_profiler.resetResults == null)
+ throw new Error("profiler has not been turned on");
+ return $__jsx_profiler.resetResults();
+};
+JSX.DEBUG = false;
+/**
+ * class _Main extends Object
+ * @constructor
+ */
+function _Main() {
+}
+
+/**
+ * @constructor
+ */
+function _Main$() {
+};
+
+_Main$.prototype = new _Main;
+
+/**
+ * @param {Array.<undefined|!string>} args
+ */
+_Main.main$AS = function (args) {
+ OktaviaSearch$setStemmer$LStemmer$(new EnglishStemmer$());
+};
+
+var _Main$main$AS = _Main.main$AS;
+
+/**
+ * class _Result extends Object
+ * @constructor
+ */
+function _Result() {
+}
+
+/**
+ * @constructor
+ * @param {!string} title
+ * @param {!string} url
+ * @param {!string} content
+ * @param {!number} score
+ */
+function _Result$SSSI(title, url, content, score) {
+ this.title = title;
+ this.url = url;
+ this.content = content;
+ this.score = score;
+};
+
+_Result$SSSI.prototype = new _Result;
+
+/**
+ * class _Proposal extends Object
+ * @constructor
+ */
+function _Proposal() {
+}
+
+/**
+ * @constructor
+ * @param {!string} options
+ * @param {!string} label
+ * @param {!number} count
+ */
+function _Proposal$SSI(options, label, count) {
+ this.options = options;
+ this.label = label;
+ this.count = count;
+};
+
+_Proposal$SSI.prototype = new _Proposal;
+
+/**
+ * class OktaviaSearch extends Object
+ * @constructor
+ */
+function OktaviaSearch() {
+}
+
+/**
+ * @constructor
+ * @param {!number} entriesPerPage
+ */
+function OktaviaSearch$I(entriesPerPage) {
+ this._queries = null;
+ this._highlight = "";
+ this._result = null;
+ this._proposals = null;
+ this._currentFolderDepth = 0;
+ this._oktavia = new Oktavia$();
+ this._entriesPerPage = entriesPerPage;
+ this._currentPage = 1;
+ this._queryString = null;
+ this._callback = null;
+ OktaviaSearch._instance = this;
+};
+
+OktaviaSearch$I.prototype = new OktaviaSearch;
+
+/**
+ * @param {Stemmer} stemmer
+ */
+OktaviaSearch.setStemmer$LStemmer$ = function (stemmer) {
+ /** @type {Oktavia} */
+ var this$0;
+ if (OktaviaSearch._instance) {
+ this$0 = OktaviaSearch._instance._oktavia;
+ this$0._stemmer = stemmer;
+ } else {
+ OktaviaSearch._stemmer = stemmer;
+ }
+};
+
+var OktaviaSearch$setStemmer$LStemmer$ = OktaviaSearch.setStemmer$LStemmer$;
+
+/**
+ * @param {!string} index
+ */
+OktaviaSearch.prototype.loadIndex$S = function (index) {
+ /** @type {Oktavia} */
+ var this$0;
+ /** @type {Stemmer} */
+ var stemmer$0;
+ if (OktaviaSearch._stemmer) {
+ this$0 = this._oktavia;
+ stemmer$0 = OktaviaSearch._stemmer;
+ this$0._stemmer = stemmer$0;
+ }
+ this._oktavia.load$S(Binary$base64decode$S(index));
+ if (this._queryString) {
+ this.search$SF$IIV$(this._queryString, this._callback);
+ this._queryString = null;
+ this._callback = null;
+ }
+};
+
+/**
+ * @param {!string} queryString
+ * @param {*} callback
+ */
+OktaviaSearch.prototype.search$SF$IIV$ = function (queryString, callback) {
+ /** @type {QueryStringParser} */
+ var queryParser;
+ /** @type {SearchSummary} */
+ var summary;
+ /** @type {Array.<undefined|SearchUnit>} */
+ var _result$0;
+ if (this._oktavia) {
+ queryParser = ({queries: [ ]});
+ this._queries = QueryStringParser$parse$LQueryStringParser$S(queryParser, queryString);
+ this._highlight = QueryStringParser$highlight$LQueryStringParser$(queryParser);
+ summary = this._oktavia.search$ALQuery$(this._queries);
+ if (SearchSummary$size$LSearchSummary$(summary) > 0) {
+ this._result = this._sortResult$LSearchSummary$(summary);
+ this._proposals = [ ];
+ this._currentPage = 1;
+ } else {
+ this._result = [ ];
+ if (this._queries.length > 1) {
+ this._proposals = SearchSummary$getProposal$LSearchSummary$(summary);
+ } else {
+ this._proposals = [ ];
+ }
+ this._currentPage = 1;
+ }
+ callback((_result$0 = this._result).length, Math.ceil(_result$0.length / this._entriesPerPage));
+ } else {
+ this._queryString = queryString;
+ this._callback = callback;
+ }
+};
+
+/**
+ * @return {!number}
+ */
+OktaviaSearch.prototype.resultSize$ = function () {
+ return (this._result.length | 0);
+};
+
+/**
+ * @return {!number}
+ */
+OktaviaSearch.prototype.totalPages$ = function () {
+ return (Math.ceil(this._result.length / this._entriesPerPage) | 0);
+};
+
+/**
+ * @return {!number}
+ */
+OktaviaSearch.prototype.currentPage$ = function () {
+ return this._currentPage;
+};
+
+/**
+ * @param {!number} page
+ */
+OktaviaSearch.prototype.setCurrentPage$I = function (page) {
+ this._currentPage = page;
+};
+
+/**
+ * @return {!boolean}
+ */
+OktaviaSearch.prototype.hasPrevPage$ = function () {
+ return this._currentPage !== 1;
+};
+
+/**
+ * @return {!boolean}
+ */
+OktaviaSearch.prototype.hasNextPage$ = function () {
+ return this._currentPage !== Math.ceil(this._result.length / this._entriesPerPage);
+};
+
+/**
+ * @return {Array.<undefined|!string>}
+ */
+OktaviaSearch.prototype.pageIndexes$ = function () {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var total;
+ /** @type {!number} */
+ var i;
+ result = [ ];
+ total = Math.ceil(this._result.length / this._entriesPerPage);
+ if (total < 10) {
+ for (i = 1; i <= total; i++) {
+ result.push(i + "");
+ }
+ } else {
+ if (this._currentPage <= 5) {
+ for (i = 1; i <= 7; i++) {
+ result.push(i + "");
+ }
+ result.push('...', total + "");
+ } else {
+ if (total - 5 <= this._currentPage) {
+ result.push('1', '...');
+ for (i = total - 8; i <= total; i++) {
+ result.push(i + "");
+ }
+ } else {
+ result.push('1', '...');
+ for (i = this._currentPage - 3; i <= this._currentPage + 3; i++) {
+ result.push(i + "");
+ }
+ result.push('...', total + "");
+ }
+ }
+ }
+ return result;
+};
+
+/**
+ * @return {Array.<undefined|_Result>}
+ */
+OktaviaSearch.prototype.getResult$ = function () {
+ /** @type {Style} */
+ var style;
+ /** @type {!number} */
+ var start;
+ /** @type {!number} */
+ var last;
+ /** @type {Metadata} */
+ var metadata;
+ /** @type {!number} */
+ var num;
+ /** @type {Array.<undefined|_Result>} */
+ var results;
+ /** @type {!number} */
+ var i;
+ /** @type {SearchUnit} */
+ var unit;
+ /** @type {Array.<undefined|!string>} */
+ var info;
+ /** @type {!string} */
+ var content;
+ /** @type {Array.<undefined|Position>} */
+ var positions;
+ /** @type {!number} */
+ var end;
+ /** @type {!boolean} */
+ var split;
+ /** @type {!number} */
+ var j;
+ /** @type {Position} */
+ var pos;
+ /** @type {!string} */
+ var text;
+ /** @type {Oktavia} */
+ var this$0;
+ /** @type {!number} */
+ var position$0;
+ /** @type {!number} */
+ var _currentPage$0;
+ /** @type {!number} */
+ var _entriesPerPage$0;
+ style = new Style$S('html');
+ start = ((_currentPage$0 = this._currentPage) - 1) * (_entriesPerPage$0 = this._entriesPerPage);
+ last = Math.min(_currentPage$0 * _entriesPerPage$0, this._result.length);
+ this$0 = this._oktavia;
+ metadata = this$0._metadatas[this$0._metadataLabels[0]];
+ num = 250;
+ results = [ ];
+ for (i = start; i < last; i++) {
+ unit = this._result[i];
+ info = metadata.getInformation$I(unit.id).split(Oktavia.eob);
+ content = metadata.getContent$I(unit.id);
+ start = 0;
+ positions = SearchUnit$getPositions$LSearchUnit$(unit);
+ if (content.indexOf(info[0]) === 1) {
+ content = content.slice(info[0].length + 2, content.length);
+ start += info[0].length + 2;
+ }
+ end = start + num;
+ split = false;
+ if (positions[0].position > end - positions[0].word.length) {
+ end = positions[0].position + Math.floor(num / 2);
+ split = true;
+ }
+ for (j = positions.length - 1; j > -1; j--) {
+ pos = positions[j];
+ if (pos.position + pos.word.length < end) {
+ content = [ content.slice(0, pos.position - start), style.convert$S('<hit>*</hit>').replace('*', content.slice((position$0 = pos.position) - start, position$0 + pos.word.length - start)), content.slice(pos.position + pos.word.length - start, content.length) ].join('');
+ }
+ }
+ if (split) {
+ text = [ content.slice(0, Math.floor(num / 2)) + ' ...', content.slice(- Math.floor(num / 2), end - start) ].join('<br/>');
+ } else {
+ text = content.slice(0, end - start) + ' ...<br/>';
+ }
+ text = text.replace(Oktavia.eob, ' ').replace(/(<br\/>)(<br\/>)+/, '<br/><br/>');
+ results.push(({title: info[0], url: info[1], content: text, score: unit.score}));
+ }
+ return results;
+};
+
+/**
+ * @return {!string}
+ */
+OktaviaSearch.prototype.getHighlight$ = function () {
+ return this._highlight;
+};
+
+/**
+ * @return {Array.<undefined|_Proposal>}
+ */
+OktaviaSearch.prototype.getProposals$ = function () {
+ /** @type {Style} */
+ var style;
+ /** @type {Array.<undefined|_Proposal>} */
+ var results;
+ /** @type {!number} */
+ var i;
+ /** @type {Proposal} */
+ var proposal;
+ /** @type {Array.<undefined|!string>} */
+ var label;
+ /** @type {Array.<undefined|!string>} */
+ var option;
+ /** @type {!number} */
+ var j;
+ style = new Style$S('html');
+ results = [ ];
+ if (this._queries.length > 1) {
+ for (i = 0; i < this._proposals.length; i++) {
+ proposal = this._proposals[i];
+ if (proposal.expect > 0) {
+ label = [ ];
+ option = [ ];
+ for (j = 0; j < this._queries.length; j++) {
+ if (j !== proposal.omit) {
+ label.push(style.convert$S('<hit>' + this._queries[j].toString() + '</hit>'));
+ option.push(this._queries[j].toString());
+ } else {
+ label.push(style.convert$S('<del>' + this._queries[j].toString() + '</del>'));
+ }
+ }
+ results.push(({options: option.join(' '), label: label.join('&nbsp;'), count: proposal.expect}));
+ }
+ }
+ }
+ return results;
+};
+
+/**
+ * @param {SearchSummary} summary
+ * @return {Array.<undefined|SearchUnit>}
+ */
+OktaviaSearch.prototype._sortResult$LSearchSummary$ = function (summary) {
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var score;
+ /** @type {SearchUnit} */
+ var unit;
+ /** @type {!string} */
+ var pos;
+ /** @type {Position} */
+ var position;
+ for (i = 0; i < summary.result.units.length; i++) {
+ score = 0;
+ unit = summary.result.units[i];
+ for (pos in unit.positions) {
+ position = unit.positions[pos];
+ if (this._oktavia.wordPositionType$I(position.position)) {
+ score += 10;
+ } else {
+ score += 1;
+ }
+ if (! position.stemmed) {
+ score += 2;
+ }
+ }
+ unit.score = (score | 0);
+ }
+ return SearchSummary$getSortedResult$LSearchSummary$(summary);
+};
+
+/**
+ * class _Main$0 extends Object
+ * @constructor
+ */
+function _Main$0() {
+}
+
+/**
+ * @constructor
+ */
+function _Main$0$() {
+};
+
+_Main$0$.prototype = new _Main$0;
+
+/**
+ * @param {Array.<undefined|!string>} args
+ */
+_Main$0.main$AS = function (args) {
+};
+
+var _Main$0$main$AS = _Main$0.main$AS;
+
+/**
+ * class Oktavia extends Object
+ * @constructor
+ */
+function Oktavia() {
+}
+
+/**
+ * @constructor
+ */
+function Oktavia$() {
+ /** @type {Array.<undefined|!string>} */
+ var _utf162compressCode$0;
+ this._compressCode2utf16 = null;
+ this._fmindex = new FMIndex$();
+ this._metadatas = ({ });
+ this._metadataLabels = [ ];
+ this._stemmer = null;
+ this._stemmingResult = ({ });
+ _utf162compressCode$0 = this._utf162compressCode = [ Oktavia.eof, Oktavia.eob, Oktavia.unknown ];
+ _utf162compressCode$0.length = 65536;
+ this._compressCode2utf16 = [ Oktavia.eof, Oktavia.eob, Oktavia.unknown ];
+};
+
+Oktavia$.prototype = new Oktavia;
+
+/**
+ * @param {Stemmer} stemmer
+ */
+Oktavia.prototype.setStemmer$LStemmer$ = function (stemmer) {
+ this._stemmer = stemmer;
+};
+
+/**
+ * @return {Metadata}
+ */
+Oktavia.prototype.getPrimaryMetadata$ = function () {
+ return this._metadatas[this._metadataLabels[0]];
+};
+
+/**
+ * @param {!string} key
+ * @return {Section}
+ */
+Oktavia.prototype.addSection$S = function (key) {
+ /** @type {Section} */
+ var section;
+ if (this._metadataLabels.indexOf(key) !== -1) {
+ throw new Error('Metadata name ' + key + ' is already exists');
+ }
+ this._metadataLabels.push(key);
+ section = new Section$LOktavia$(this);
+ this._metadatas[key] = section;
+ return section;
+};
+
+/**
+ * @param {!string} key
+ * @return {Section}
+ */
+Oktavia.prototype.getSection$S = function (key) {
+ if (this._metadataLabels.indexOf(key) === -1) {
+ throw new Error('Metadata name ' + key + " does't exists");
+ }
+ return this._metadatas[key];
+};
+
+/**
+ * @param {!string} key
+ * @return {Splitter}
+ */
+Oktavia.prototype.addSplitter$S = function (key) {
+ /** @type {Splitter} */
+ var splitter;
+ if (this._metadataLabels.indexOf(key) !== -1) {
+ throw new Error('Metadata name ' + key + ' is already exists');
+ }
+ this._metadataLabels.push(key);
+ splitter = new Splitter$LOktavia$(this);
+ this._metadatas[key] = splitter;
+ return splitter;
+};
+
+/**
+ * @param {!string} key
+ * @return {Splitter}
+ */
+Oktavia.prototype.getSplitter$S = function (key) {
+ if (this._metadataLabels.indexOf(key) === -1) {
+ throw new Error('Metadata name ' + key + " does't exists");
+ }
+ return this._metadatas[key];
+};
+
+/**
+ * @param {!string} key
+ * @param {Array.<undefined|!string>} headers
+ * @return {Table}
+ */
+Oktavia.prototype.addTable$SAS = function (key, headers) {
+ /** @type {Table} */
+ var table;
+ if (this._metadataLabels.indexOf(key) !== -1) {
+ throw new Error('Metadata name ' + key + ' is already exists');
+ }
+ this._metadataLabels.push(key);
+ table = new Table$LOktavia$AS(this, headers);
+ this._metadatas[key] = table;
+ return table;
+};
+
+/**
+ * @param {!string} key
+ * @return {Table}
+ */
+Oktavia.prototype.getTable$S = function (key) {
+ if (this._metadataLabels.indexOf(key) === -1) {
+ throw new Error('Metadata name ' + key + " does't exists");
+ }
+ return this._metadatas[key];
+};
+
+/**
+ * @param {!string} key
+ * @return {Block}
+ */
+Oktavia.prototype.addBlock$S = function (key) {
+ /** @type {Block} */
+ var block;
+ if (this._metadataLabels.indexOf(key) !== -1) {
+ throw new Error('Metadata name ' + key + ' is already exists');
+ }
+ this._metadataLabels.push(key);
+ block = new Block$LOktavia$(this);
+ this._metadatas[key] = block;
+ return block;
+};
+
+/**
+ * @param {!string} key
+ * @return {Block}
+ */
+Oktavia.prototype.getBlock$S = function (key) {
+ if (this._metadataLabels.indexOf(key) === -1) {
+ throw new Error('Metadata name ' + key + " does't exists");
+ }
+ return this._metadatas[key];
+};
+
+/**
+ */
+Oktavia.prototype.addEndOfBlock$ = function () {
+ this._fmindex.push$S(Oktavia.eob);
+};
+
+/**
+ * @param {!string} words
+ */
+Oktavia.prototype.addWord$S = function (words) {
+ /** @type {Array.<undefined|!string>} */
+ var str;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var charCode;
+ /** @type {undefined|!string} */
+ var newCharCode;
+ str = [ ];
+ str.length = words.length;
+ for (i = 0; i < words.length; i++) {
+ charCode = words.charCodeAt(i);
+ newCharCode = this._utf162compressCode[charCode];
+ if (newCharCode == null) {
+ newCharCode = String.fromCharCode(this._compressCode2utf16.length);
+ this._utf162compressCode[charCode] = newCharCode;
+ this._compressCode2utf16.push(String.fromCharCode(charCode));
+ }
+ str.push(newCharCode);
+ }
+ this._fmindex.push$S(str.join(''));
+};
+
+/**
+ * @param {!string} words
+ * @param {!boolean} stemming
+ */
+Oktavia.prototype.addWord$SB = function (words, stemming) {
+ /** @type {Array.<undefined|!string>} */
+ var wordList;
+ /** @type {!number} */
+ var i;
+ /** @type {undefined|!string} */
+ var originalWord;
+ /** @type {!string} */
+ var smallWord;
+ /** @type {undefined|!string} */
+ var registerWord;
+ /** @type {!string} */
+ var baseWord;
+ /** @type {!string} */
+ var compressedCodeWord;
+ /** @type {Array.<undefined|!string>} */
+ var stemmedList;
+ this.addWord$S(words);
+ wordList = words.split(/\s+/);
+ for (i = 0; i < wordList.length; i++) {
+ originalWord = wordList[i];
+ smallWord = originalWord.slice(0, 1).toLowerCase() + originalWord.slice(1);
+ registerWord = null;
+ if (stemming && this._stemmer) {
+ baseWord = this._stemmer.stemWord$S(originalWord.toLowerCase());
+ if (originalWord.indexOf(baseWord) === -1) {
+ registerWord = baseWord;
+ }
+ } else {
+ if (originalWord != smallWord) {
+ registerWord = smallWord;
+ }
+ }
+ if (registerWord) {
+ compressedCodeWord = this._convertToCompressionCode$S(originalWord);
+ stemmedList = this._stemmingResult[registerWord];
+ if (! stemmedList) {
+ stemmedList = [ compressedCodeWord ];
+ this._stemmingResult[registerWord] = stemmedList;
+ } else {
+ if (stemmedList.indexOf(compressedCodeWord) === -1) {
+ stemmedList.push(compressedCodeWord);
+ }
+ }
+ }
+ }
+};
+
+/**
+ * @param {!string} keyword
+ * @return {!string}
+ */
+Oktavia.prototype._convertToCompressionCode$S = function (keyword) {
+ /** @type {Array.<undefined|!string>} */
+ var resultChars;
+ /** @type {!number} */
+ var i;
+ /** @type {undefined|!string} */
+ var chr;
+ resultChars = [ ];
+ for (i = 0; i < keyword.length; i++) {
+ chr = this._utf162compressCode[keyword.charCodeAt(i)];
+ if (chr == null) {
+ resultChars.push(Oktavia.unknown);
+ } else {
+ resultChars.push(chr);
+ }
+ }
+ return resultChars.join('');
+};
+
+/**
+ * @param {!string} keyword
+ * @param {!boolean} stemming
+ * @return {Array.<undefined|!number>}
+ */
+Oktavia.prototype.rawSearch$SB = function (keyword, stemming) {
+ /** @type {Array.<undefined|!number>} */
+ var result;
+ /** @type {!string} */
+ var baseWord;
+ /** @type {Array.<undefined|!string>} */
+ var stemmedList;
+ /** @type {!number} */
+ var i;
+ /** @type {undefined|!string} */
+ var word;
+ if (stemming) {
+ result = [ ];
+ if (this._stemmer) {
+ baseWord = this._stemmer.stemWord$S(keyword.toLowerCase());
+ stemmedList = this._stemmingResult[baseWord];
+ if (stemmedList) {
+ for (i = 0; i < stemmedList.length; i++) {
+ word = stemmedList[i];
+ result = result.concat(this._fmindex.search$S(word));
+ }
+ }
+ }
+ } else {
+ result = this._fmindex.search$S(this._convertToCompressionCode$S(keyword));
+ }
+ return result;
+};
+
+/**
+ * @param {Array.<undefined|Query>} queries
+ * @return {SearchSummary}
+ */
+Oktavia.prototype.search$ALQuery$ = function (queries) {
+ /** @type {SearchSummary} */
+ var summary;
+ /** @type {!number} */
+ var i;
+ /** @type {SingleResult} */
+ var result$0;
+ summary = ({sourceResults: [ ], result: null, oktavia: this});
+ for (i = 0; i < queries.length; i++) {
+ result$0 = this._searchQuery$LQuery$(queries[i]);
+ summary.sourceResults.push(result$0);
+ }
+ summary.result = SearchSummary$mergeResult$LSearchSummary$ALSingleResult$(summary, summary.sourceResults);
+ return summary;
+};
+
+/**
+ * @param {Query} query
+ * @return {SingleResult}
+ */
+Oktavia.prototype._searchQuery$LQuery$ = function (query) {
+ /** @type {SingleResult} */
+ var result;
+ /** @type {Array.<undefined|!number>} */
+ var positions;
+ result = new SingleResult$SBB(query.word, query.or, query.not);
+ if (query.raw) {
+ positions = this.rawSearch$SB(query.word, false);
+ } else {
+ positions = this.rawSearch$SB(query.word, false).concat(this.rawSearch$SB(query.word, true));
+ }
+ this._metadatas[this._metadataLabels[0]].grouping$LSingleResult$AISB(result, positions, query.word, ! query.raw);
+ return result;
+};
+
+/**
+ */
+Oktavia.prototype.build$ = function () {
+ this.build$IB(5, false);
+};
+
+/**
+ * @param {!number} cacheDensity
+ * @param {!boolean} verbose
+ */
+Oktavia.prototype.build$IB = function (cacheDensity, verbose) {
+ /** @type {!string} */
+ var key;
+ /** @type {!number} */
+ var cacheRange;
+ /** @type {!number} */
+ var maxChar;
+ for (key in this._metadatas) {
+ this._metadatas[key]._build$();
+ }
+ cacheRange = Math.round(Math.max(1, 100 / Math.min(100, Math.max(0.01, cacheDensity))));
+ maxChar = this._compressCode2utf16.length;
+ this._fmindex.build$SIIB(Oktavia.eof, maxChar, cacheRange, verbose);
+};
+
+/**
+ * @return {!string}
+ */
+Oktavia.prototype.dump$ = function () {
+ return this.dump$B(false);
+};
+
+/**
+ * @param {!boolean} verbose
+ * @return {!string}
+ */
+Oktavia.prototype.dump$B = function (verbose) {
+ /** @type {!string} */
+ var header;
+ /** @type {!string} */
+ var fmdata;
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var i;
+ /** @type {CompressionReport} */
+ var report;
+ /** @type {undefined|!string} */
+ var name;
+ /** @type {!string} */
+ var data;
+ header = Binary$dumpString$SLCompressionReport$("oktavia-01", null).slice(1);
+ if (verbose) {
+ console.log("Source text size: " + (this._fmindex.size$() * 2 + "") + ' bytes');
+ }
+ fmdata = this._fmindex.dump$B(verbose);
+ result = [ header, fmdata ];
+ result.push(Binary$dump16bitNumber$I(this._compressCode2utf16.length));
+ for (i = 3; i < this._compressCode2utf16.length; i++) {
+ result.push(this._compressCode2utf16[i]);
+ }
+ if (verbose) {
+ console.log('Char Code Map: ' + (this._compressCode2utf16.length * 2 - 2 + "") + ' bytes');
+ }
+ report = ({source: 0, result: 0});
+ result.push(Binary$dumpStringListMap$HASLCompressionReport$(this._stemmingResult, report));
+ if (verbose) {
+ console.log('Stemmed Word Table: ' + (result[result.length - 1].length + "") + ' bytes (' + (Math.round(report.result * 100.0 / report.source) + "") + '%)');
+ }
+ result.push(Binary$dump16bitNumber$I(this._metadataLabels.length));
+ for (i = 0; i < this._metadataLabels.length; i++) {
+ report = ({source: 0, result: 0});
+ name = this._metadataLabels[i];
+ data = this._metadatas[name]._dump$LCompressionReport$(report);
+ result.push(Binary$dumpString$SLCompressionReport$(name, report), data);
+ if (verbose) {
+ console.log('Meta Data ' + name + ': ' + (data.length * 2 + "") + ' bytes (' + (Math.round(report.result * 100.0 / report.source) + "") + '%)');
+ }
+ }
+ return result.join('');
+};
+
+/**
+ * @param {!string} data
+ */
+Oktavia.prototype.load$S = function (data) {
+ /** @type {!string} */
+ var header;
+ /** @type {!number} */
+ var offset;
+ /** @type {!number} */
+ var charCodeCount;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var charCode;
+ /** @type {LoadedStringListMapResult} */
+ var stemmedWords;
+ /** @type {!number} */
+ var metadataCount;
+ /** @type {LoadedStringResult} */
+ var nameResult;
+ /** @type {!string} */
+ var name;
+ /** @type {!number} */
+ var type;
+ header = Binary$dumpString$SLCompressionReport$("oktavia-01", null).slice(1);
+ if (data.slice(0, 5) !== header) {
+ throw new Error('Invalid data file');
+ }
+ this._metadatas = ({ });
+ this._metadataLabels = [ ];
+ offset = 5;
+ offset = this._fmindex.load$SI(data, offset);
+ charCodeCount = Binary$load16bitNumber$SI(data, offset++);
+ this._compressCode2utf16 = [ Oktavia.eof, Oktavia.eob, Oktavia.unknown ];
+ this._utf162compressCode = [ Oktavia.eof, Oktavia.eob, Oktavia.unknown ];
+ for (i = 3; i < charCodeCount; i++) {
+ charCode = Binary$load16bitNumber$SI(data, offset++);
+ this._compressCode2utf16.push(String.fromCharCode(charCode));
+ this._utf162compressCode[charCode] = String.fromCharCode(i);
+ }
+ stemmedWords = Binary$loadStringListMap$SI(data, offset);
+ this._stemmingResult = stemmedWords.result;
+ offset = stemmedWords.offset;
+ metadataCount = Binary$load16bitNumber$SI(data, offset++);
+ for (i = 0; i < metadataCount; i++) {
+ nameResult = Binary$loadString$SI(data, offset);
+ name = nameResult.result;
+ offset = nameResult.offset;
+ type = Binary$load16bitNumber$SI(data, offset++);
+ switch (type) {
+ case 0:
+ offset = Section$_load$LOktavia$SSI(this, name, data, offset);
+ break;
+ case 1:
+ offset = Splitter$_load$LOktavia$SSI(this, name, data, offset);
+ break;
+ case 2:
+ offset = Table$_load$LOktavia$SSI(this, name, data, offset);
+ break;
+ case 3:
+ offset = Block$_load$LOktavia$SSI(this, name, data, offset);
+ break;
+ }
+ }
+};
+
+/**
+ * @return {!number}
+ */
+Oktavia.prototype.contentSize$ = function () {
+ /** @type {FMIndex} */
+ var this$0;
+ this$0 = this._fmindex;
+ return this$0._substr.length;
+};
+
+/**
+ * @param {!number} position
+ * @return {!number}
+ */
+Oktavia.prototype.wordPositionType$I = function (position) {
+ /** @type {!number} */
+ var result;
+ /** @type {!string} */
+ var ahead;
+ result = 0;
+ if (position === 0) {
+ result = 4;
+ } else {
+ ahead = this._fmindex.getSubstring$II(position - 1, 1);
+ if (/\s/.test(ahead)) {
+ result = 2;
+ } else {
+ if (/\W/.test(ahead)) {
+ result = 1;
+ } else {
+ if (Oktavia.eob === ahead) {
+ result = 3;
+ }
+ }
+ }
+ }
+ return (result | 0);
+};
+
+/**
+ * @param {!number} position
+ * @param {!number} length
+ * @return {!string}
+ */
+Oktavia.prototype._getSubstring$II = function (position, length) {
+ /** @type {!string} */
+ var result;
+ /** @type {Array.<undefined|!string>} */
+ var str;
+ /** @type {!number} */
+ var i;
+ result = this._fmindex.getSubstring$II(position, length);
+ str = [ ];
+ for (i = 0; i < result.length; i++) {
+ str.push(this._compressCode2utf16[result.charCodeAt(i)]);
+ }
+ return str.join('');
+};
+
+/**
+ * class Binary extends Object
+ * @constructor
+ */
+function Binary() {
+}
+
+/**
+ * @constructor
+ */
+function Binary$() {
+};
+
+Binary$.prototype = new Binary;
+
+/**
+ * @param {!number} num
+ * @return {!string}
+ */
+Binary.dump32bitNumber$N = function (num) {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ result = [ String.fromCharCode(Math.floor(num / 65536)) ];
+ result.push(String.fromCharCode(num % 65536));
+ return result.join("");
+};
+
+var Binary$dump32bitNumber$N = Binary.dump32bitNumber$N;
+
+/**
+ * @param {!string} buffer
+ * @param {!number} offset
+ * @return {!number}
+ */
+Binary.load32bitNumber$SI = function (buffer, offset) {
+ /** @type {!number} */
+ var result;
+ result = buffer.charCodeAt(offset) * 65536 + buffer.charCodeAt(offset + 1);
+ return result;
+};
+
+var Binary$load32bitNumber$SI = Binary.load32bitNumber$SI;
+
+/**
+ * @param {!number} num
+ * @return {!string}
+ */
+Binary.dump16bitNumber$I = function (num) {
+ return String.fromCharCode(num % 65536);
+};
+
+var Binary$dump16bitNumber$I = Binary.dump16bitNumber$I;
+
+/**
+ * @param {!string} buffer
+ * @param {!number} offset
+ * @return {!number}
+ */
+Binary.load16bitNumber$SI = function (buffer, offset) {
+ return (buffer.charCodeAt(offset) | 0);
+};
+
+var Binary$load16bitNumber$SI = Binary.load16bitNumber$SI;
+
+/**
+ * @param {!string} str
+ * @return {!string}
+ */
+Binary.dumpString$S = function (str) {
+ return Binary$dumpString$SLCompressionReport$(str, null);
+};
+
+var Binary$dumpString$S = Binary.dumpString$S;
+
+/**
+ * @param {!string} str
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+Binary.dumpString$SLCompressionReport$ = function (str, report) {
+ /** @type {!number} */
+ var length;
+ /** @type {!boolean} */
+ var compress;
+ /** @type {Array.<undefined|!number>} */
+ var charCodes;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var charCode;
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {undefined|!number} */
+ var bytes;
+ if (str.length > 32768) {
+ str = str.slice(0, 32768);
+ }
+ length = str.length;
+ compress = true;
+ charCodes = [ ];
+ for (i = 0; i < length; i++) {
+ charCode = str.charCodeAt(i);
+ if (charCode > 255) {
+ compress = false;
+ break;
+ }
+ charCodes.push(charCode);
+ }
+ if (compress) {
+ result = [ Binary$dump16bitNumber$I(length + 32768) ];
+ for (i = 0; i < length; i += 2) {
+ bytes = charCodes[i];
+ if (i !== length - 1) {
+ bytes += charCodes[i + 1] << 8;
+ }
+ result.push(String.fromCharCode(bytes % 65536));
+ }
+ if (report) {
+ CompressionReport$add$LCompressionReport$II(report, length, Math.ceil(length / 2));
+ }
+ } else {
+ result = [ Binary$dump16bitNumber$I(length), str ];
+ if (report) {
+ CompressionReport$add$LCompressionReport$II(report, length, length);
+ }
+ }
+ return result.join('');
+};
+
+var Binary$dumpString$SLCompressionReport$ = Binary.dumpString$SLCompressionReport$;
+
+/**
+ * @param {!string} buffer
+ * @param {!number} offset
+ * @return {LoadedStringResult}
+ */
+Binary.loadString$SI = function (buffer, offset) {
+ return new LoadedStringResult$SI(buffer, offset);
+};
+
+var Binary$loadString$SI = Binary.loadString$SI;
+
+/**
+ * @param {Array.<undefined|!string>} strList
+ * @return {!string}
+ */
+Binary.dumpStringList$AS = function (strList) {
+ return Binary$dumpStringList$ASLCompressionReport$(strList, null);
+};
+
+var Binary$dumpStringList$AS = Binary.dumpStringList$AS;
+
+/**
+ * @param {Array.<undefined|!string>} strList
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+Binary.dumpStringList$ASLCompressionReport$ = function (strList, report) {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var i;
+ result = [ Binary$dump32bitNumber$N(strList.length) ];
+ for (i = 0; i < strList.length; i++) {
+ result.push(Binary$dumpString$SLCompressionReport$(strList[i], report));
+ }
+ return result.join('');
+};
+
+var Binary$dumpStringList$ASLCompressionReport$ = Binary.dumpStringList$ASLCompressionReport$;
+
+/**
+ * @param {!string} buffer
+ * @param {!number} offset
+ * @return {LoadedStringListResult}
+ */
+Binary.loadStringList$SI = function (buffer, offset) {
+ return new LoadedStringListResult$SI(buffer, offset);
+};
+
+var Binary$loadStringList$SI = Binary.loadStringList$SI;
+
+/**
+ * @param {Object.<string, undefined|Array.<undefined|!string>>} strMap
+ * @return {!string}
+ */
+Binary.dumpStringListMap$HAS = function (strMap) {
+ return Binary$dumpStringListMap$HASLCompressionReport$(strMap, null);
+};
+
+var Binary$dumpStringListMap$HAS = Binary.dumpStringListMap$HAS;
+
+/**
+ * @param {Object.<string, undefined|Array.<undefined|!string>>} strMap
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+Binary.dumpStringListMap$HASLCompressionReport$ = function (strMap, report) {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var counter;
+ /** @type {!string} */
+ var key;
+ result = [ ];
+ counter = 0;
+ for (key in strMap) {
+ result.push(Binary$dumpString$SLCompressionReport$(key, report));
+ result.push(Binary$dumpStringList$ASLCompressionReport$(strMap[key], report));
+ counter++;
+ }
+ return Binary$dump32bitNumber$N(counter) + result.join('');
+};
+
+var Binary$dumpStringListMap$HASLCompressionReport$ = Binary.dumpStringListMap$HASLCompressionReport$;
+
+/**
+ * @param {!string} buffer
+ * @param {!number} offset
+ * @return {LoadedStringListMapResult}
+ */
+Binary.loadStringListMap$SI = function (buffer, offset) {
+ return new LoadedStringListMapResult$SI(buffer, offset);
+};
+
+var Binary$loadStringListMap$SI = Binary.loadStringListMap$SI;
+
+/**
+ * @param {Array.<undefined|!number>} array
+ * @return {!string}
+ */
+Binary.dump32bitNumberList$AN = function (array) {
+ return Binary$dump32bitNumberList$ANLCompressionReport$(array, null);
+};
+
+var Binary$dump32bitNumberList$AN = Binary.dump32bitNumberList$AN;
+
+/**
+ * @param {Array.<undefined|!number>} array
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+Binary.dump32bitNumberList$ANLCompressionReport$ = function (array, report) {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var index;
+ /** @type {!number} */
+ var inputLength;
+ /** @type {!number} */
+ var length;
+ /** @type {!string} */
+ var resultString;
+ /** @type {!number} */
+ var value1$0;
+ /** @type {!number} */
+ var value2$0;
+ result = [ Binary$dump32bitNumber$N(array.length) ];
+ index = 0;
+ inputLength = array.length;
+ while (index < inputLength) {
+ if (array[index] == 0) {
+ length = Binary$_countZero$ANI(array, index);
+ result.push(Binary$_zeroBlock$I(length));
+ index += length;
+ } else {
+ if (Binary$_shouldZebraCode$ANI(array, index)) {
+ result.push(Binary$_createZebraCode$ANI(array, index));
+ value1$0 = array.length;
+ value2$0 = index + 15;
+ index = (value1$0 <= value2$0 ? value1$0 : value2$0);
+ } else {
+ length = Binary$_searchDoubleZero$ANI(array, index);
+ result.push(Binary$_nonZeroBlock$ANII(array, index, length));
+ if (length === 0) {
+ throw new Error('');
+ }
+ index += length;
+ }
+ }
+ }
+ resultString = result.join('');
+ if (report) {
+ CompressionReport$add$LCompressionReport$II(report, array.length * 2 + 2, resultString.length);
+ }
+ return resultString;
+};
+
+var Binary$dump32bitNumberList$ANLCompressionReport$ = Binary.dump32bitNumberList$ANLCompressionReport$;
+
+/**
+ * @param {!string} buffer
+ * @param {!number} offset
+ * @return {LoadedNumberListResult}
+ */
+Binary.load32bitNumberList$SI = function (buffer, offset) {
+ return new LoadedNumberListResult$SI(buffer, offset);
+};
+
+var Binary$load32bitNumberList$SI = Binary.load32bitNumberList$SI;
+
+/**
+ * @param {Array.<undefined|!number>} array
+ * @param {!number} offset
+ * @return {!number}
+ */
+Binary._countZero$ANI = function (array, offset) {
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var array$len$0;
+ for ((i = offset, array$len$0 = array.length); i < array$len$0; i++) {
+ if (array[i] != 0) {
+ return (i - offset | 0);
+ }
+ }
+ return (array.length - offset | 0);
+};
+
+var Binary$_countZero$ANI = Binary._countZero$ANI;
+
+/**
+ * @param {!number} length
+ * @return {!string}
+ */
+Binary._zeroBlock$I = function (length) {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ result = [ ];
+ while (length > 0) {
+ if (length > 16384) {
+ result.push(Binary$dump16bitNumber$I(16383));
+ length -= 16384;
+ } else {
+ result.push(Binary$dump16bitNumber$I(length - 1));
+ length = 0;
+ }
+ }
+ return result.join('');
+};
+
+var Binary$_zeroBlock$I = Binary._zeroBlock$I;
+
+/**
+ * @param {Array.<undefined|!number>} array
+ * @param {!number} offset
+ * @return {!boolean}
+ */
+Binary._shouldZebraCode$ANI = function (array, offset) {
+ /** @type {!number} */
+ var change;
+ /** @type {!boolean} */
+ var isLastZero;
+ /** @type {!number} */
+ var i;
+ if (array.length - offset < 16) {
+ return true;
+ }
+ change = 0;
+ isLastZero = false;
+ for (i = offset; i < offset + 15; i++) {
+ if (array[i] == 0) {
+ if (! isLastZero) {
+ isLastZero = true;
+ change++;
+ }
+ } else {
+ if (isLastZero) {
+ isLastZero = false;
+ change++;
+ }
+ }
+ }
+ return change > 2;
+};
+
+var Binary$_shouldZebraCode$ANI = Binary._shouldZebraCode$ANI;
+
+/**
+ * @param {Array.<undefined|!number>} array
+ * @param {!number} offset
+ * @return {!number}
+ */
+Binary._searchDoubleZero$ANI = function (array, offset) {
+ /** @type {!boolean} */
+ var isLastZero;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var array$len$0;
+ isLastZero = false;
+ for ((i = offset, array$len$0 = array.length); i < array$len$0; i++) {
+ if (array[i] == 0) {
+ if (isLastZero) {
+ return (i - offset - 1 | 0);
+ }
+ isLastZero = true;
+ } else {
+ isLastZero = false;
+ }
+ }
+ return (array.length - offset | 0);
+};
+
+var Binary$_searchDoubleZero$ANI = Binary._searchDoubleZero$ANI;
+
+/**
+ * @param {Array.<undefined|!number>} array
+ * @param {!number} offset
+ * @param {!number} length
+ * @return {!string}
+ */
+Binary._nonZeroBlock$ANII = function (array, offset, length) {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var blockLength;
+ /** @type {!number} */
+ var i;
+ result = [ ];
+ while (length > 0) {
+ if (length > 16384) {
+ blockLength = 16384;
+ length -= 16384;
+ } else {
+ blockLength = length;
+ length = 0;
+ }
+ result.push(Binary$dump16bitNumber$I(blockLength - 1 + 0x4000));
+ for (i = offset; i < offset + blockLength; i++) {
+ result.push(Binary$dump32bitNumber$N(array[i]));
+ }
+ offset += blockLength;
+ }
+ return result.join('');
+};
+
+var Binary$_nonZeroBlock$ANII = Binary._nonZeroBlock$ANII;
+
+/**
+ * @param {Array.<undefined|!number>} array
+ * @param {!number} offset
+ * @return {!string}
+ */
+Binary._createZebraCode$ANI = function (array, offset) {
+ /** @type {!number} */
+ var last;
+ /** @type {!number} */
+ var code;
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var value1$0;
+ /** @type {!number} */
+ var value2$0;
+ value1$0 = offset + 15;
+ value2$0 = array.length;
+ last = (value1$0 <= value2$0 ? value1$0 : value2$0);
+ code = 0x8000;
+ result = [ ];
+ for (i = offset; i < last; i++) {
+ if (array[i] != 0) {
+ result.push(Binary$dump32bitNumber$N(array[i]));
+ code = code + (0x1 << i - offset);
+ }
+ }
+ return String.fromCharCode(code) + result.join('');
+};
+
+var Binary$_createZebraCode$ANI = Binary._createZebraCode$ANI;
+
+/**
+ * @param {!string} str
+ * @return {!string}
+ */
+Binary.base64encode$S = function (str) {
+ /** @type {Array.<undefined|!string>} */
+ var out;
+ /** @type {Array.<undefined|!number>} */
+ var source;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var code;
+ /** @type {!number} */
+ var len;
+ /** @type {!number} */
+ var c1;
+ /** @type {undefined|!number} */
+ var c2;
+ /** @type {undefined|!number} */
+ var c3;
+ out = [ ];
+ source = [ ];
+ for (i = 0; i < str.length; i++) {
+ code = str.charCodeAt(i);
+ source.push(code & 0x00ff, code >>> 8);
+ }
+ len = str.length * 2;
+ i = 0;
+ while (i < len) {
+ c1 = source[i++] & 0xff;
+ if (i === len) {
+ out.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(c1 >> 2));
+ out.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((c1 & 0x3) << 4));
+ out.push("==");
+ break;
+ }
+ c2 = source[i++];
+ if (i === len) {
+ out.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(c1 >> 2));
+ out.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((c1 & 0x3) << 4 | (c2 & 0xF0) >> 4));
+ out.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((c2 & 0xF) << 2));
+ out.push("=");
+ break;
+ }
+ c3 = source[i++];
+ out.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(c1 >> 2));
+ out.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((c1 & 0x3) << 4 | (c2 & 0xF0) >> 4));
+ out.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((c2 & 0xF) << 2 | (c3 & 0xC0) >> 6));
+ out.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(c3 & 0x3F));
+ }
+ return out.join('');
+};
+
+var Binary$base64encode$S = Binary.base64encode$S;
+
+/**
+ * @param {Array.<undefined|!number>} source
+ * @return {!string}
+ */
+Binary._mergeCharCode$AI = function (source) {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var i;
+ result = [ ];
+ for (i = 0; i < source.length; i += 2) {
+ result.push(String.fromCharCode(source[i] + (source[i + 1] << 8)));
+ }
+ return result.join('');
+};
+
+var Binary$_mergeCharCode$AI = Binary._mergeCharCode$AI;
+
+/**
+ * @param {!string} str
+ * @return {!string}
+ */
+Binary.base64decode$S = function (str) {
+ /** @type {!number} */
+ var len;
+ /** @type {!number} */
+ var i;
+ /** @type {Array.<undefined|!number>} */
+ var out;
+ /** @type {undefined|!number} */
+ var c1;
+ /** @type {undefined|!number} */
+ var c2;
+ /** @type {!number} */
+ var c3;
+ /** @type {!number} */
+ var c4;
+ len = str.length;
+ i = 0;
+ out = [ ];
+ while (i < len) {
+ do {
+ c1 = Binary._base64DecodeChars[str.charCodeAt(i++) & 0xff];
+ } while (i < len && c1 == -1);
+ if (c1 == -1) {
+ break;
+ }
+ do {
+ c2 = Binary._base64DecodeChars[str.charCodeAt(i++) & 0xff];
+ } while (i < len && c2 == -1);
+ if (c2 == -1) {
+ break;
+ }
+ out.push(c1 << 2 | (c2 & 0x30) >> 4);
+ do {
+ c3 = str.charCodeAt(i++) & 0xff;
+ if (c3 === 61) {
+ return Binary$_mergeCharCode$AI(out);
+ }
+ c3 = Binary._base64DecodeChars[c3];
+ } while (i < len && c3 === -1);
+ if (c3 === -1) {
+ break;
+ }
+ out.push((c2 & 0XF) << 4 | (c3 & 0x3C) >> 2);
+ do {
+ c4 = str.charCodeAt(i++) & 0xff;
+ if (c4 === 61) {
+ return Binary$_mergeCharCode$AI(out);
+ }
+ c4 = (Binary._base64DecodeChars[c4] | 0);
+ } while (i < len && c4 === -1);
+ if (c4 === -1) {
+ break;
+ }
+ out.push((c3 & 0x03) << 6 | c4);
+ }
+ return Binary$_mergeCharCode$AI(out);
+};
+
+var Binary$base64decode$S = Binary.base64decode$S;
+
+/**
+ * class LoadedStringResult extends Object
+ * @constructor
+ */
+function LoadedStringResult() {
+}
+
+/**
+ * @constructor
+ * @param {!string} data
+ * @param {!number} offset
+ */
+function LoadedStringResult$SI(data, offset) {
+ /** @type {!number} */
+ var strLength;
+ /** @type {Array.<undefined|!string>} */
+ var bytes;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var code;
+ /** @type {!number} */
+ var offset$0;
+ this.result = "";
+ this.offset = 0;
+ offset$0 = offset++;
+ strLength = data.charCodeAt(offset$0);
+ if (strLength > 32767) {
+ strLength = strLength - 32768;
+ bytes = [ ];
+ for (i = 0; i < strLength; i += 2) {
+ code = data.charCodeAt(offset);
+ bytes.push(String.fromCharCode(code & 0x00ff));
+ if (i !== strLength - 1) {
+ bytes.push(String.fromCharCode(code >>> 8));
+ }
+ offset++;
+ }
+ this.result = bytes.join('');
+ this.offset = offset;
+ } else {
+ this.result = data.slice(offset, offset + strLength);
+ this.offset = (offset + strLength | 0);
+ }
+};
+
+LoadedStringResult$SI.prototype = new LoadedStringResult;
+
+/**
+ * class LoadedStringListResult extends Object
+ * @constructor
+ */
+function LoadedStringListResult() {
+}
+
+/**
+ * @constructor
+ * @param {!string} data
+ * @param {!number} offset
+ */
+function LoadedStringListResult$SI(data, offset) {
+ /** @type {!number} */
+ var length;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var strLength;
+ /** @type {!string} */
+ var resultStr;
+ /** @type {Array.<undefined|!string>} */
+ var bytes;
+ /** @type {!number} */
+ var j;
+ /** @type {!number} */
+ var code;
+ /** @type {!number} */
+ var result$0;
+ /** @type {!number} */
+ var offset$0;
+ this.offset = 0;
+ this.result = [ ];
+ result$0 = data.charCodeAt(offset) * 65536 + data.charCodeAt(offset + 1);
+ length = result$0;
+ offset += 2;
+ for (i = 0; i < length; i++) {
+ offset$0 = offset++;
+ strLength = data.charCodeAt(offset$0);
+ if (strLength > 32767) {
+ strLength = strLength - 32768;
+ bytes = [ ];
+ for (j = 0; j < strLength; j += 2) {
+ code = data.charCodeAt(offset);
+ bytes.push(String.fromCharCode(code & 0x00ff));
+ if (j !== strLength - 1) {
+ bytes.push(String.fromCharCode(code >>> 8));
+ }
+ offset++;
+ }
+ resultStr = bytes.join('');
+ } else {
+ resultStr = data.slice(offset, offset + strLength);
+ offset = (offset + strLength | 0);
+ }
+ this.result.push(resultStr);
+ }
+ this.offset = offset;
+};
+
+LoadedStringListResult$SI.prototype = new LoadedStringListResult;
+
+/**
+ * class LoadedStringListMapResult extends Object
+ * @constructor
+ */
+function LoadedStringListMapResult() {
+}
+
+/**
+ * @constructor
+ * @param {!string} data
+ * @param {!number} offset
+ */
+function LoadedStringListMapResult$SI(data, offset) {
+ /** @type {!number} */
+ var length;
+ /** @type {!number} */
+ var i;
+ /** @type {LoadedStringResult} */
+ var keyResult;
+ /** @type {LoadedStringListResult} */
+ var valueResult;
+ /** @type {!number} */
+ var result$0;
+ /** @type {!number} */
+ var offset$0;
+ this.offset = 0;
+ this.result = ({ });
+ result$0 = data.charCodeAt(offset) * 65536 + data.charCodeAt(offset + 1);
+ length = result$0;
+ offset += 2;
+ for (i = 0; i < length; i++) {
+ keyResult = new LoadedStringResult$SI(data, offset);
+ offset$0 = keyResult.offset;
+ valueResult = new LoadedStringListResult$SI(data, offset$0);
+ this.result[keyResult.result] = valueResult.result;
+ offset = valueResult.offset;
+ }
+ this.offset = offset;
+};
+
+LoadedStringListMapResult$SI.prototype = new LoadedStringListMapResult;
+
+/**
+ * class LoadedNumberListResult extends Object
+ * @constructor
+ */
+function LoadedNumberListResult() {
+}
+
+/**
+ * @constructor
+ * @param {!string} data
+ * @param {!number} offset
+ */
+function LoadedNumberListResult$SI(data, offset) {
+ /** @type {!number} */
+ var resultLength;
+ /** @type {!number} */
+ var originalOffset;
+ /** @type {Array.<undefined|!number>} */
+ var result;
+ /** @type {!number} */
+ var tag;
+ /** @type {!number} */
+ var length;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var result$0;
+ /** @type {!number} */
+ var value1$0;
+ this.result = null;
+ this.offset = 0;
+ result$0 = data.charCodeAt(offset) * 65536 + data.charCodeAt(offset + 1);
+ resultLength = result$0;
+ originalOffset = offset;
+ offset += 2;
+ result = [ ];
+ while (result.length < resultLength) {
+ tag = data.charCodeAt(offset++);
+ if (tag >>> 15 === 1) {
+ value1$0 = resultLength - result.length;
+ length = (value1$0 <= 15 ? value1$0 : 15);
+ for (i = 0; i < length; i++) {
+ if (tag >>> i & 0x1) {
+ result.push(Binary$load32bitNumber$SI(data, offset));
+ offset += 2;
+ } else {
+ result.push(0);
+ }
+ }
+ } else {
+ if (tag >>> 14 === 1) {
+ length = tag - 0x4000 + 1;
+ for (i = 0; i < length; i++) {
+ result.push(Binary$load32bitNumber$SI(data, offset));
+ offset += 2;
+ }
+ } else {
+ length = tag + 1;
+ for (i = 0; i < length; i++) {
+ result.push(0);
+ }
+ }
+ }
+ }
+ this.result = result;
+ this.offset = offset;
+};
+
+LoadedNumberListResult$SI.prototype = new LoadedNumberListResult;
+
+/**
+ * class CompressionReport extends Object
+ * @constructor
+ */
+function CompressionReport() {
+}
+
+/**
+ * @constructor
+ */
+function CompressionReport$() {
+ this.source = 0;
+ this.result = 0;
+};
+
+CompressionReport$.prototype = new CompressionReport;
+
+/**
+ * @param {CompressionReport} $this
+ * @param {!number} source
+ * @param {!number} result
+ */
+CompressionReport.add$LCompressionReport$II = function ($this, source, result) {
+ $this.source += source;
+ $this.result += result;
+};
+
+var CompressionReport$add$LCompressionReport$II = CompressionReport.add$LCompressionReport$II;
+
+/**
+ * @param {CompressionReport} $this
+ * @return {!number}
+ */
+CompressionReport.rate$LCompressionReport$ = function ($this) {
+ return (Math.round($this.result * 100.0 / $this.source) | 0);
+};
+
+var CompressionReport$rate$LCompressionReport$ = CompressionReport.rate$LCompressionReport$;
+
+/**
+ * class Query extends Object
+ * @constructor
+ */
+function Query() {
+}
+
+/**
+ * @constructor
+ */
+function Query$() {
+ this.word = '';
+ this.or = false;
+ this.not = false;
+ this.raw = false;
+};
+
+Query$.prototype = new Query;
+
+/**
+ * @return {!string}
+ */
+Query.prototype.toString = function () {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ result = [ ];
+ if (this.or) {
+ result.push("OR ");
+ }
+ if (this.not) {
+ result.push("-");
+ }
+ if (this.raw) {
+ result.push('"', this.word, '"');
+ } else {
+ result.push(this.word);
+ }
+ return result.join('');
+};
+
+/**
+ * class QueryStringParser extends Object
+ * @constructor
+ */
+function QueryStringParser() {
+}
+
+/**
+ * @constructor
+ */
+function QueryStringParser$() {
+ this.queries = [ ];
+};
+
+QueryStringParser$.prototype = new QueryStringParser;
+
+/**
+ * @param {QueryStringParser} $this
+ * @param {!string} queryString
+ * @return {Array.<undefined|Query>}
+ */
+QueryStringParser.parse$LQueryStringParser$S = function ($this, queryString) {
+ /** @type {!boolean} */
+ var nextOr;
+ /** @type {!boolean} */
+ var nextNot;
+ /** @type {!number} */
+ var currentWordStart;
+ /** @type {!number} */
+ var status;
+ /** @type {RegExp} */
+ var isSpace;
+ /** @type {!number} */
+ var i;
+ /** @type {!string} */
+ var ch;
+ /** @type {!string} */
+ var word;
+ /** @type {Query} */
+ var query;
+ nextOr = false;
+ nextNot = false;
+ currentWordStart = 0;
+ status = 0;
+ isSpace = /[\s\u3000]/;
+ for (i = 0; i < queryString.length; i++) {
+ ch = queryString.charAt(i);
+ switch (status) {
+ case 0:
+ if (! isSpace.test(ch)) {
+ if (ch === '-') {
+ nextNot = true;
+ } else {
+ if (ch === '"') {
+ currentWordStart = i + 1;
+ status = 2;
+ } else {
+ currentWordStart = i;
+ status = 1;
+ }
+ }
+ } else {
+ nextNot = false;
+ }
+ break;
+ case 1:
+ if (isSpace.test(ch)) {
+ word = queryString.slice(currentWordStart, i);
+ if (word === 'OR') {
+ nextOr = true;
+ } else {
+ query = new Query$();
+ query.word = word;
+ query.or = nextOr;
+ query.not = nextNot;
+ $this.queries.push(query);
+ nextOr = false;
+ nextNot = false;
+ }
+ status = 0;
+ }
+ break;
+ case 2:
+ if (ch === '"') {
+ word = queryString.slice(currentWordStart, i);
+ query = new Query$();
+ query.word = word;
+ query.or = nextOr;
+ query.not = nextNot;
+ query.raw = true;
+ $this.queries.push(query);
+ nextOr = false;
+ nextNot = false;
+ status = 0;
+ }
+ break;
+ }
+ }
+ switch (status) {
+ case 0:
+ break;
+ case 1:
+ query = new Query$();
+ word = queryString.slice(currentWordStart, queryString.length);
+ if (word !== 'OR') {
+ query.word = word;
+ query.or = nextOr;
+ query.not = nextNot;
+ $this.queries.push(query);
+ }
+ break;
+ case 2:
+ query = new Query$();
+ query.word = queryString.slice(currentWordStart, queryString.length);
+ query.or = nextOr;
+ query.not = nextNot;
+ query.raw = true;
+ $this.queries.push(query);
+ break;
+ }
+ return $this.queries;
+};
+
+var QueryStringParser$parse$LQueryStringParser$S = QueryStringParser.parse$LQueryStringParser$S;
+
+/**
+ * @param {QueryStringParser} $this
+ * @return {!string}
+ */
+QueryStringParser.highlight$LQueryStringParser$ = function ($this) {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var i;
+ /** @type {Query} */
+ var query;
+ result = [ ];
+ for (i = 0; i < $this.queries.length; i++) {
+ query = $this.queries[i];
+ if (! query.not) {
+ result.push("highlight=" + $__jsx_encodeURIComponent(query.word));
+ }
+ }
+ return '?' + result.join('&');
+};
+
+var QueryStringParser$highlight$LQueryStringParser$ = QueryStringParser.highlight$LQueryStringParser$;
+
+/**
+ * class Proposal extends Object
+ * @constructor
+ */
+function Proposal() {
+}
+
+/**
+ * @constructor
+ * @param {!number} omit
+ * @param {!number} expect
+ */
+function Proposal$II(omit, expect) {
+ this.omit = omit;
+ this.expect = expect;
+};
+
+Proposal$II.prototype = new Proposal;
+
+/**
+ * class Position extends Object
+ * @constructor
+ */
+function Position() {
+}
+
+/**
+ * @constructor
+ * @param {!string} word
+ * @param {!number} position
+ * @param {!boolean} stemmed
+ */
+function Position$SIB(word, position, stemmed) {
+ this.word = word;
+ this.position = position;
+ this.stemmed = stemmed;
+};
+
+Position$SIB.prototype = new Position;
+
+/**
+ * class SearchUnit extends Object
+ * @constructor
+ */
+function SearchUnit() {
+}
+
+/**
+ * @constructor
+ * @param {!number} id
+ */
+function SearchUnit$I(id) {
+ this.positions = ({ });
+ this.id = id;
+ this._size = 0;
+ this.score = 0;
+ this.startPosition = -1;
+};
+
+SearchUnit$I.prototype = new SearchUnit;
+
+/**
+ * @param {SearchUnit} $this
+ * @param {!string} word
+ * @param {!number} position
+ * @param {!boolean} stemmed
+ */
+SearchUnit.addPosition$LSearchUnit$SIB = function ($this, word, position, stemmed) {
+ /** @type {Position} */
+ var positionObj;
+ positionObj = $this.positions[position + ""];
+ if (! positionObj) {
+ $this._size++;
+ $this.positions[position + ""] = ({word: word, position: position, stemmed: stemmed});
+ } else {
+ if (positionObj.word.length < word.length) {
+ positionObj.word = word;
+ }
+ positionObj.stemmed = positionObj.stemmed && stemmed;
+ }
+};
+
+var SearchUnit$addPosition$LSearchUnit$SIB = SearchUnit.addPosition$LSearchUnit$SIB;
+
+/**
+ * @param {SearchUnit} $this
+ * @param {!number} position
+ * @return {Position}
+ */
+SearchUnit.get$LSearchUnit$I = function ($this, position) {
+ return $this.positions[position + ""];
+};
+
+var SearchUnit$get$LSearchUnit$I = SearchUnit.get$LSearchUnit$I;
+
+/**
+ * @param {SearchUnit} $this
+ * @return {!number}
+ */
+SearchUnit.size$LSearchUnit$ = function ($this) {
+ return $this._size;
+};
+
+var SearchUnit$size$LSearchUnit$ = SearchUnit.size$LSearchUnit$;
+
+/**
+ * @param {SearchUnit} $this
+ * @param {SearchUnit} rhs
+ */
+SearchUnit.merge$LSearchUnit$LSearchUnit$ = function ($this, rhs) {
+ /** @type {!string} */
+ var position;
+ /** @type {Position} */
+ var pos;
+ for (position in rhs.positions) {
+ pos = rhs.positions[position];
+ SearchUnit$addPosition$LSearchUnit$SIB($this, pos.word, pos.position, pos.stemmed);
+ }
+};
+
+var SearchUnit$merge$LSearchUnit$LSearchUnit$ = SearchUnit.merge$LSearchUnit$LSearchUnit$;
+
+/**
+ * @param {SearchUnit} $this
+ * @return {Array.<undefined|Position>}
+ */
+SearchUnit.getPositions$LSearchUnit$ = function ($this) {
+ /** @type {Array.<undefined|Position>} */
+ var result;
+ /** @type {!string} */
+ var pos;
+ result = [ ];
+ for (pos in $this.positions) {
+ result.push($this.positions[pos]);
+ }
+ result.sort((function (a, b) {
+ return a.position - b.position;
+ }));
+ return result;
+};
+
+var SearchUnit$getPositions$LSearchUnit$ = SearchUnit.getPositions$LSearchUnit$;
+
+/**
+ * class SingleResult extends Object
+ * @constructor
+ */
+function SingleResult() {
+}
+
+/**
+ * @constructor
+ */
+function SingleResult$() {
+ this.units = [ ];
+ this.unitIds = [ ];
+ this.or = false;
+ this.not = false;
+ this.searchWord = '';
+};
+
+SingleResult$.prototype = new SingleResult;
+
+/**
+ * @constructor
+ * @param {!string} searchWord
+ * @param {!boolean} or
+ * @param {!boolean} not
+ */
+function SingleResult$SBB(searchWord, or, not) {
+ this.units = [ ];
+ this.unitIds = [ ];
+ this.or = or;
+ this.not = not;
+ this.searchWord = searchWord;
+};
+
+SingleResult$SBB.prototype = new SingleResult;
+
+/**
+ * @param {SingleResult} $this
+ * @param {!number} unitId
+ * @return {SearchUnit}
+ */
+SingleResult.getSearchUnit$LSingleResult$I = function ($this, unitId) {
+ /** @type {!number} */
+ var existing;
+ /** @type {SearchUnit} */
+ var result;
+ existing = $this.unitIds.indexOf(unitId);
+ if (existing === -1) {
+ result = ({positions: ({ }), id: unitId, _size: 0, score: 0, startPosition: -1});
+ $this.units.push(result);
+ $this.unitIds.push(unitId);
+ } else {
+ result = $this.units[existing];
+ }
+ return result;
+};
+
+var SingleResult$getSearchUnit$LSingleResult$I = SingleResult.getSearchUnit$LSingleResult$I;
+
+/**
+ * @param {SingleResult} $this
+ * @param {SingleResult} rhs
+ * @return {SingleResult}
+ */
+SingleResult.merge$LSingleResult$LSingleResult$ = function ($this, rhs) {
+ /** @type {SingleResult} */
+ var result;
+ result = ({units: [ ], unitIds: [ ], or: false, not: false, searchWord: ''});
+ if (rhs.or) {
+ SingleResult$_orMerge$LSingleResult$LSingleResult$LSingleResult$($this, result, rhs);
+ } else {
+ if (rhs.not) {
+ SingleResult$_notMerge$LSingleResult$LSingleResult$LSingleResult$($this, result, rhs);
+ } else {
+ SingleResult$_andMerge$LSingleResult$LSingleResult$LSingleResult$($this, result, rhs);
+ }
+ }
+ return result;
+};
+
+var SingleResult$merge$LSingleResult$LSingleResult$ = SingleResult.merge$LSingleResult$LSingleResult$;
+
+/**
+ * @param {SingleResult} $this
+ * @return {!number}
+ */
+SingleResult.size$LSingleResult$ = function ($this) {
+ return ($this.units.length | 0);
+};
+
+var SingleResult$size$LSingleResult$ = SingleResult.size$LSingleResult$;
+
+/**
+ * @param {SingleResult} $this
+ * @param {SingleResult} result
+ * @param {SingleResult} rhs
+ */
+SingleResult._andMerge$LSingleResult$LSingleResult$LSingleResult$ = function ($this, result, rhs) {
+ /** @type {!number} */
+ var i;
+ /** @type {undefined|!number} */
+ var id;
+ /** @type {SearchUnit} */
+ var lhsSection;
+ for (i = 0; i < $this.unitIds.length; i++) {
+ id = $this.unitIds[i];
+ if (rhs.unitIds.indexOf(id) !== -1) {
+ lhsSection = $this.units[i];
+ result.unitIds.push(id);
+ result.units.push(lhsSection);
+ }
+ }
+};
+
+var SingleResult$_andMerge$LSingleResult$LSingleResult$LSingleResult$ = SingleResult._andMerge$LSingleResult$LSingleResult$LSingleResult$;
+
+/**
+ * @param {SingleResult} $this
+ * @param {SingleResult} result
+ * @param {SingleResult} rhs
+ */
+SingleResult._orMerge$LSingleResult$LSingleResult$LSingleResult$ = function ($this, result, rhs) {
+ /** @type {!number} */
+ var i;
+ /** @type {undefined|!number} */
+ var id;
+ /** @type {SearchUnit} */
+ var rhsSection;
+ /** @type {SearchUnit} */
+ var lhsSection;
+ /** @type {Array.<undefined|!number>} */
+ var unitIds$0;
+ /** @type {Array.<undefined|SearchUnit>} */
+ var units$0;
+ result.unitIds = (unitIds$0 = $this.unitIds).slice(0, unitIds$0.length);
+ result.units = (units$0 = $this.units).slice(0, units$0.length);
+ for (i = 0; i < rhs.unitIds.length; i++) {
+ id = rhs.unitIds[i];
+ rhsSection = rhs.units[i];
+ if (result.unitIds.indexOf(id) !== -1) {
+ lhsSection = result.units[result.unitIds.indexOf(id)];
+ SearchUnit$merge$LSearchUnit$LSearchUnit$(lhsSection, rhsSection);
+ } else {
+ result.unitIds.push(id);
+ result.units.push(rhsSection);
+ }
+ }
+};
+
+var SingleResult$_orMerge$LSingleResult$LSingleResult$LSingleResult$ = SingleResult._orMerge$LSingleResult$LSingleResult$LSingleResult$;
+
+/**
+ * @param {SingleResult} $this
+ * @param {SingleResult} result
+ * @param {SingleResult} rhs
+ */
+SingleResult._notMerge$LSingleResult$LSingleResult$LSingleResult$ = function ($this, result, rhs) {
+ /** @type {!number} */
+ var i;
+ /** @type {undefined|!number} */
+ var id;
+ /** @type {SearchUnit} */
+ var lhsSection;
+ for (i = 0; i < $this.unitIds.length; i++) {
+ id = $this.unitIds[i];
+ if (rhs.unitIds.indexOf(id) === -1) {
+ lhsSection = $this.units[i];
+ result.unitIds.push(id);
+ result.units.push(lhsSection);
+ }
+ }
+};
+
+var SingleResult$_notMerge$LSingleResult$LSingleResult$LSingleResult$ = SingleResult._notMerge$LSingleResult$LSingleResult$LSingleResult$;
+
+/**
+ * class SearchSummary extends Object
+ * @constructor
+ */
+function SearchSummary() {
+}
+
+/**
+ * @constructor
+ */
+function SearchSummary$() {
+ this.sourceResults = [ ];
+ this.result = null;
+ this.oktavia = null;
+};
+
+SearchSummary$.prototype = new SearchSummary;
+
+/**
+ * @constructor
+ * @param {Oktavia} oktavia
+ */
+function SearchSummary$LOktavia$(oktavia) {
+ this.sourceResults = [ ];
+ this.result = null;
+ this.oktavia = oktavia;
+};
+
+SearchSummary$LOktavia$.prototype = new SearchSummary;
+
+/**
+ * @param {SearchSummary} $this
+ * @param {SingleResult} result
+ */
+SearchSummary.addQuery$LSearchSummary$LSingleResult$ = function ($this, result) {
+ $this.sourceResults.push(result);
+};
+
+var SearchSummary$addQuery$LSearchSummary$LSingleResult$ = SearchSummary.addQuery$LSearchSummary$LSingleResult$;
+
+/**
+ * @param {SearchSummary} $this
+ */
+SearchSummary.mergeResult$LSearchSummary$ = function ($this) {
+ $this.result = SearchSummary$mergeResult$LSearchSummary$ALSingleResult$($this, $this.sourceResults);
+};
+
+var SearchSummary$mergeResult$LSearchSummary$ = SearchSummary.mergeResult$LSearchSummary$;
+
+/**
+ * @param {SearchSummary} $this
+ * @param {Array.<undefined|SingleResult>} results
+ * @return {SingleResult}
+ */
+SearchSummary.mergeResult$LSearchSummary$ALSingleResult$ = function ($this, results) {
+ /** @type {SingleResult} */
+ var rhs;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var results$len$0;
+ rhs = results[0];
+ for ((i = 1, results$len$0 = results.length); i < results$len$0; i++) {
+ rhs = SingleResult$merge$LSingleResult$LSingleResult$(rhs, results[i]);
+ }
+ return rhs;
+};
+
+var SearchSummary$mergeResult$LSearchSummary$ALSingleResult$ = SearchSummary.mergeResult$LSearchSummary$ALSingleResult$;
+
+/**
+ * @param {SearchSummary} $this
+ * @return {Array.<undefined|Proposal>}
+ */
+SearchSummary.getProposal$LSearchSummary$ = function ($this) {
+ /** @type {Array.<undefined|Proposal>} */
+ var proposals;
+ /** @type {!number} */
+ var i;
+ /** @type {Array.<undefined|SingleResult>} */
+ var tmpSource;
+ /** @type {!number} */
+ var j;
+ /** @type {SingleResult} */
+ var result;
+ proposals = [ ];
+ for (i = 0; i < $this.sourceResults.length; i++) {
+ tmpSource = [ ];
+ for (j = 0; j < $this.sourceResults.length; j++) {
+ if (i !== j) {
+ tmpSource.push($this.sourceResults[j]);
+ }
+ }
+ result = SearchSummary$mergeResult$LSearchSummary$ALSingleResult$($this, tmpSource);
+ proposals.push(({omit: i, expect: result.units.length}));
+ }
+ proposals.sort((function (a, b) {
+ return b.expect - a.expect;
+ }));
+ return proposals;
+};
+
+var SearchSummary$getProposal$LSearchSummary$ = SearchSummary.getProposal$LSearchSummary$;
+
+/**
+ * @param {SearchSummary} $this
+ * @return {Array.<undefined|SearchUnit>}
+ */
+SearchSummary.getSortedResult$LSearchSummary$ = function ($this) {
+ /** @type {Array.<undefined|SearchUnit>} */
+ var result;
+ /** @type {Array.<undefined|SearchUnit>} */
+ var units$0;
+ result = (units$0 = $this.result.units).slice(0, units$0.length);
+ result.sort((function (a, b) {
+ return b.score - a.score;
+ }));
+ return result;
+};
+
+var SearchSummary$getSortedResult$LSearchSummary$ = SearchSummary.getSortedResult$LSearchSummary$;
+
+/**
+ * @param {SearchSummary} $this
+ * @return {!number}
+ */
+SearchSummary.size$LSearchSummary$ = function ($this) {
+ /** @type {SingleResult} */
+ var this$0;
+ this$0 = $this.result;
+ return (this$0.units.length | 0);
+};
+
+var SearchSummary$size$LSearchSummary$ = SearchSummary.size$LSearchSummary$;
+
+/**
+ * @param {SearchSummary} $this
+ * @param {SingleResult} result
+ */
+SearchSummary.add$LSearchSummary$LSingleResult$ = function ($this, result) {
+ $this.sourceResults.push(result);
+};
+
+var SearchSummary$add$LSearchSummary$LSingleResult$ = SearchSummary.add$LSearchSummary$LSingleResult$;
+
+/**
+ * class Style extends Object
+ * @constructor
+ */
+function Style() {
+}
+
+/**
+ * @constructor
+ * @param {!string} mode
+ */
+function Style$S(mode) {
+ this.styles = null;
+ this.escapeHTML = false;
+ switch (mode) {
+ case 'console':
+ this.styles = Style.console;
+ break;
+ case 'html':
+ this.styles = Style.html;
+ break;
+ case 'ignore':
+ this.styles = Style.ignore;
+ break;
+ default:
+ this.styles = Style.ignore;
+ break;
+ }
+ this.escapeHTML = mode === 'html';
+};
+
+Style$S.prototype = new Style;
+
+/**
+ * @param {!string} source
+ * @return {!string}
+ */
+Style.prototype.convert$S = function (source) {
+ /** @type {_HTMLHandler} */
+ var handler;
+ /** @type {SAXParser} */
+ var parser;
+ handler = new _HTMLHandler$HASB(this.styles, this.escapeHTML);
+ parser = new SAXParser$LSAXHandler$(handler);
+ parser.parse$S(source);
+ return handler.text.join('');
+};
+
+/**
+ * class Stemmer
+ * @constructor
+ */
+function Stemmer() {
+}
+
+Stemmer.prototype.$__jsx_implements_Stemmer = true;
+
+/**
+ * @constructor
+ */
+function Stemmer$() {
+};
+
+Stemmer$.prototype = new Stemmer;
+
+/**
+ * class BaseStemmer extends Object
+ * @constructor
+ */
+function BaseStemmer() {
+}
+
+$__jsx_merge_interface(BaseStemmer, Stemmer);
+
+/**
+ * @constructor
+ */
+function BaseStemmer$() {
+ /** @type {!string} */
+ var current$0;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var limit$0;
+ this.cache = ({ });
+ current$0 = this.current = "";
+ cursor$0 = this.cursor = 0;
+ limit$0 = this.limit = current$0.length;
+ this.limit_backward = 0;
+ this.bra = cursor$0;
+ this.ket = limit$0;
+};
+
+BaseStemmer$.prototype = new BaseStemmer;
+
+/**
+ * @param {!string} value
+ */
+BaseStemmer.prototype.setCurrent$S = function (value) {
+ /** @type {!string} */
+ var current$0;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var limit$0;
+ current$0 = this.current = value;
+ cursor$0 = this.cursor = 0;
+ limit$0 = this.limit = current$0.length;
+ this.limit_backward = 0;
+ this.bra = cursor$0;
+ this.ket = limit$0;
+};
+
+/**
+ * @return {!string}
+ */
+BaseStemmer.prototype.getCurrent$ = function () {
+ return this.current;
+};
+
+/**
+ * @param {BaseStemmer} other
+ */
+BaseStemmer.prototype.copy_from$LBaseStemmer$ = function (other) {
+ this.current = other.current;
+ this.cursor = other.cursor;
+ this.limit = other.limit;
+ this.limit_backward = other.limit_backward;
+ this.bra = other.bra;
+ this.ket = other.ket;
+};
+
+/**
+ * @param {Array.<undefined|!number>} s
+ * @param {!number} min
+ * @param {!number} max
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.in_grouping$AIII = function (s, min, max) {
+ /** @type {!number} */
+ var ch;
+ if (this.cursor >= this.limit) {
+ return false;
+ }
+ ch = this.current.charCodeAt(this.cursor);
+ if (ch > max || ch < min) {
+ return false;
+ }
+ ch -= min;
+ if ((s[ch >>> 3] & 0x1 << (ch & 0x7)) === 0) {
+ return false;
+ }
+ this.cursor++;
+ return true;
+};
+
+/**
+ * @param {Array.<undefined|!number>} s
+ * @param {!number} min
+ * @param {!number} max
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.in_grouping_b$AIII = function (s, min, max) {
+ /** @type {!number} */
+ var ch;
+ if (this.cursor <= this.limit_backward) {
+ return false;
+ }
+ ch = this.current.charCodeAt(this.cursor - 1);
+ if (ch > max || ch < min) {
+ return false;
+ }
+ ch -= min;
+ if ((s[ch >>> 3] & 0x1 << (ch & 0x7)) === 0) {
+ return false;
+ }
+ this.cursor--;
+ return true;
+};
+
+/**
+ * @param {Array.<undefined|!number>} s
+ * @param {!number} min
+ * @param {!number} max
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.out_grouping$AIII = function (s, min, max) {
+ /** @type {!number} */
+ var ch;
+ if (this.cursor >= this.limit) {
+ return false;
+ }
+ ch = this.current.charCodeAt(this.cursor);
+ if (ch > max || ch < min) {
+ this.cursor++;
+ return true;
+ }
+ ch -= min;
+ if ((s[ch >>> 3] & 0X1 << (ch & 0x7)) === 0) {
+ this.cursor++;
+ return true;
+ }
+ return false;
+};
+
+/**
+ * @param {Array.<undefined|!number>} s
+ * @param {!number} min
+ * @param {!number} max
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.out_grouping_b$AIII = function (s, min, max) {
+ /** @type {!number} */
+ var ch;
+ if (this.cursor <= this.limit_backward) {
+ return false;
+ }
+ ch = this.current.charCodeAt(this.cursor - 1);
+ if (ch > max || ch < min) {
+ this.cursor--;
+ return true;
+ }
+ ch -= min;
+ if ((s[ch >>> 3] & 0x1 << (ch & 0x7)) === 0) {
+ this.cursor--;
+ return true;
+ }
+ return false;
+};
+
+/**
+ * @param {!number} min
+ * @param {!number} max
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.in_range$II = function (min, max) {
+ /** @type {!number} */
+ var ch;
+ if (this.cursor >= this.limit) {
+ return false;
+ }
+ ch = this.current.charCodeAt(this.cursor);
+ if (ch > max || ch < min) {
+ return false;
+ }
+ this.cursor++;
+ return true;
+};
+
+/**
+ * @param {!number} min
+ * @param {!number} max
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.in_range_b$II = function (min, max) {
+ /** @type {!number} */
+ var ch;
+ if (this.cursor <= this.limit_backward) {
+ return false;
+ }
+ ch = this.current.charCodeAt(this.cursor - 1);
+ if (ch > max || ch < min) {
+ return false;
+ }
+ this.cursor--;
+ return true;
+};
+
+/**
+ * @param {!number} min
+ * @param {!number} max
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.out_range$II = function (min, max) {
+ /** @type {!number} */
+ var ch;
+ if (this.cursor >= this.limit) {
+ return false;
+ }
+ ch = this.current.charCodeAt(this.cursor);
+ if (! (ch > max || ch < min)) {
+ return false;
+ }
+ this.cursor++;
+ return true;
+};
+
+/**
+ * @param {!number} min
+ * @param {!number} max
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.out_range_b$II = function (min, max) {
+ /** @type {!number} */
+ var ch;
+ if (this.cursor <= this.limit_backward) {
+ return false;
+ }
+ ch = this.current.charCodeAt(this.cursor - 1);
+ if (! (ch > max || ch < min)) {
+ return false;
+ }
+ this.cursor--;
+ return true;
+};
+
+/**
+ * @param {!number} s_size
+ * @param {!string} s
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.eq_s$IS = function (s_size, s) {
+ /** @type {!number} */
+ var cursor$0;
+ if (this.limit - this.cursor < s_size) {
+ return false;
+ }
+ if (this.current.slice(cursor$0 = this.cursor, cursor$0 + s_size) !== s) {
+ return false;
+ }
+ this.cursor += s_size;
+ return true;
+};
+
+/**
+ * @param {!number} s_size
+ * @param {!string} s
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.eq_s_b$IS = function (s_size, s) {
+ /** @type {!number} */
+ var cursor$0;
+ if (this.cursor - this.limit_backward < s_size) {
+ return false;
+ }
+ if (this.current.slice((cursor$0 = this.cursor) - s_size, cursor$0) !== s) {
+ return false;
+ }
+ this.cursor -= s_size;
+ return true;
+};
+
+/**
+ * @param {!string} s
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.eq_v$S = function (s) {
+ return this.eq_s$IS(s.length, s);
+};
+
+/**
+ * @param {!string} s
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.eq_v_b$S = function (s) {
+ return this.eq_s_b$IS(s.length, s);
+};
+
+/**
+ * @param {Array.<undefined|Among>} v
+ * @param {!number} v_size
+ * @return {!number}
+ */
+BaseStemmer.prototype.find_among$ALAmong$I = function (v, v_size) {
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var j;
+ /** @type {!number} */
+ var c;
+ /** @type {!number} */
+ var l;
+ /** @type {!number} */
+ var common_i;
+ /** @type {!number} */
+ var common_j;
+ /** @type {!boolean} */
+ var first_key_inspected;
+ /** @type {!number} */
+ var k;
+ /** @type {!number} */
+ var diff;
+ /** @type {!number} */
+ var common;
+ /** @type {Among} */
+ var w;
+ /** @type {!number} */
+ var i2;
+ /** @type {!boolean} */
+ var res;
+ i = 0;
+ j = v_size;
+ c = this.cursor;
+ l = this.limit;
+ common_i = 0;
+ common_j = 0;
+ first_key_inspected = false;
+ while (true) {
+ k = i + (j - i >>> 1);
+ diff = 0;
+ common = (common_i < common_j ? common_i : common_j);
+ w = v[k];
+ for (i2 = common; i2 < w.s_size; i2++) {
+ if (c + common === l) {
+ diff = -1;
+ break;
+ }
+ diff = this.current.charCodeAt(c + common) - w.s.charCodeAt(i2);
+ if (diff !== 0) {
+ break;
+ }
+ common++;
+ }
+ if (diff < 0) {
+ j = k;
+ common_j = common;
+ } else {
+ i = k;
+ common_i = common;
+ }
+ if (j - i <= 1) {
+ if (i > 0) {
+ break;
+ }
+ if (j === i) {
+ break;
+ }
+ if (first_key_inspected) {
+ break;
+ }
+ first_key_inspected = true;
+ }
+ }
+ while (true) {
+ w = v[i];
+ if (common_i >= w.s_size) {
+ this.cursor = (c + w.s_size | 0);
+ if (w.method == null) {
+ return w.result;
+ }
+ res = w.method(w.instance);
+ this.cursor = (c + w.s_size | 0);
+ if (res) {
+ return w.result;
+ }
+ }
+ i = w.substring_i;
+ if (i < 0) {
+ return 0;
+ }
+ }
+ return -1;
+};
+
+/**
+ * @param {Array.<undefined|Among>} v
+ * @param {!number} v_size
+ * @return {!number}
+ */
+BaseStemmer.prototype.find_among_b$ALAmong$I = function (v, v_size) {
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var j;
+ /** @type {!number} */
+ var c;
+ /** @type {!number} */
+ var lb;
+ /** @type {!number} */
+ var common_i;
+ /** @type {!number} */
+ var common_j;
+ /** @type {!boolean} */
+ var first_key_inspected;
+ /** @type {!number} */
+ var k;
+ /** @type {!number} */
+ var diff;
+ /** @type {!number} */
+ var common;
+ /** @type {Among} */
+ var w;
+ /** @type {!number} */
+ var i2;
+ /** @type {!boolean} */
+ var res;
+ i = 0;
+ j = v_size;
+ c = this.cursor;
+ lb = this.limit_backward;
+ common_i = 0;
+ common_j = 0;
+ first_key_inspected = false;
+ while (true) {
+ k = i + (j - i >> 1);
+ diff = 0;
+ common = (common_i < common_j ? common_i : common_j);
+ w = v[k];
+ for (i2 = w.s_size - 1 - common; i2 >= 0; i2--) {
+ if (c - common === lb) {
+ diff = -1;
+ break;
+ }
+ diff = this.current.charCodeAt(c - 1 - common) - w.s.charCodeAt(i2);
+ if (diff !== 0) {
+ break;
+ }
+ common++;
+ }
+ if (diff < 0) {
+ j = k;
+ common_j = common;
+ } else {
+ i = k;
+ common_i = common;
+ }
+ if (j - i <= 1) {
+ if (i > 0) {
+ break;
+ }
+ if (j === i) {
+ break;
+ }
+ if (first_key_inspected) {
+ break;
+ }
+ first_key_inspected = true;
+ }
+ }
+ while (true) {
+ w = v[i];
+ if (common_i >= w.s_size) {
+ this.cursor = (c - w.s_size | 0);
+ if (w.method == null) {
+ return w.result;
+ }
+ res = w.method(this);
+ this.cursor = (c - w.s_size | 0);
+ if (res) {
+ return w.result;
+ }
+ }
+ i = w.substring_i;
+ if (i < 0) {
+ return 0;
+ }
+ }
+ return -1;
+};
+
+/**
+ * @param {!number} c_bra
+ * @param {!number} c_ket
+ * @param {!string} s
+ * @return {!number}
+ */
+BaseStemmer.prototype.replace_s$IIS = function (c_bra, c_ket, s) {
+ /** @type {!number} */
+ var adjustment;
+ adjustment = s.length - (c_ket - c_bra);
+ this.current = this.current.slice(0, c_bra) + s + this.current.slice(c_ket);
+ this.limit += (adjustment | 0);
+ if (this.cursor >= c_ket) {
+ this.cursor += (adjustment | 0);
+ } else {
+ if (this.cursor > c_bra) {
+ this.cursor = c_bra;
+ }
+ }
+ return (adjustment | 0);
+};
+
+/**
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.slice_check$ = function () {
+ /** @type {!number} */
+ var bra$0;
+ /** @type {!number} */
+ var ket$0;
+ /** @type {!number} */
+ var limit$0;
+ return ((bra$0 = this.bra) < 0 || bra$0 > (ket$0 = this.ket) || ket$0 > (limit$0 = this.limit) || limit$0 > this.current.length ? false : true);
+};
+
+/**
+ * @param {!string} s
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.slice_from$S = function (s) {
+ /** @type {!boolean} */
+ var result;
+ /** @type {!number} */
+ var bra$0;
+ /** @type {!number} */
+ var ket$0;
+ /** @type {!number} */
+ var limit$0;
+ result = false;
+ if ((bra$0 = this.bra) < 0 || bra$0 > (ket$0 = this.ket) || ket$0 > (limit$0 = this.limit) || limit$0 > this.current.length ? false : true) {
+ this.replace_s$IIS(this.bra, this.ket, s);
+ result = true;
+ }
+ return result;
+};
+
+/**
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.slice_del$ = function () {
+ return this.slice_from$S("");
+};
+
+/**
+ * @param {!number} c_bra
+ * @param {!number} c_ket
+ * @param {!string} s
+ */
+BaseStemmer.prototype.insert$IIS = function (c_bra, c_ket, s) {
+ /** @type {!number} */
+ var adjustment;
+ adjustment = this.replace_s$IIS(c_bra, c_ket, s);
+ if (c_bra <= this.bra) {
+ this.bra += (adjustment | 0);
+ }
+ if (c_bra <= this.ket) {
+ this.ket += (adjustment | 0);
+ }
+};
+
+/**
+ * @param {!string} s
+ * @return {!string}
+ */
+BaseStemmer.prototype.slice_to$S = function (s) {
+ /** @type {!string} */
+ var result;
+ /** @type {!number} */
+ var bra$0;
+ /** @type {!number} */
+ var ket$0;
+ /** @type {!number} */
+ var limit$0;
+ result = '';
+ if ((bra$0 = this.bra) < 0 || bra$0 > (ket$0 = this.ket) || ket$0 > (limit$0 = this.limit) || limit$0 > this.current.length ? false : true) {
+ result = this.current.slice(this.bra, this.ket);
+ }
+ return result;
+};
+
+/**
+ * @param {!string} s
+ * @return {!string}
+ */
+BaseStemmer.prototype.assign_to$S = function (s) {
+ return this.current.slice(0, this.limit);
+};
+
+/**
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.stem$ = function () {
+ return false;
+};
+
+/**
+ * @param {!string} word
+ * @return {!string}
+ */
+BaseStemmer.prototype.stemWord$S = function (word) {
+ /** @type {undefined|!string} */
+ var result;
+ /** @type {!string} */
+ var current$0;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var limit$0;
+ result = this.cache['.' + word];
+ if (result == null) {
+ current$0 = this.current = word;
+ cursor$0 = this.cursor = 0;
+ limit$0 = this.limit = current$0.length;
+ this.limit_backward = 0;
+ this.bra = cursor$0;
+ this.ket = limit$0;
+ this.stem$();
+ result = this.current;
+ this.cache['.' + word] = result;
+ }
+ return result;
+};
+
+/**
+ * @param {Array.<undefined|!string>} words
+ * @return {Array.<undefined|!string>}
+ */
+BaseStemmer.prototype.stemWords$AS = function (words) {
+ /** @type {Array.<undefined|!string>} */
+ var results;
+ /** @type {!number} */
+ var i;
+ /** @type {undefined|!string} */
+ var word;
+ /** @type {undefined|!string} */
+ var result;
+ /** @type {!string} */
+ var current$0;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var limit$0;
+ results = [ ];
+ for (i = 0; i < words.length; i++) {
+ word = words[i];
+ result = this.cache['.' + word];
+ if (result == null) {
+ current$0 = this.current = word;
+ cursor$0 = this.cursor = 0;
+ limit$0 = this.limit = current$0.length;
+ this.limit_backward = 0;
+ this.bra = cursor$0;
+ this.ket = limit$0;
+ this.stem$();
+ result = this.current;
+ this.cache['.' + word] = result;
+ }
+ results.push(result);
+ }
+ return results;
+};
+
+/**
+ * class EnglishStemmer extends BaseStemmer
+ * @constructor
+ */
+function EnglishStemmer() {
+}
+
+EnglishStemmer.prototype = new BaseStemmer;
+/**
+ * @constructor
+ */
+function EnglishStemmer$() {
+ BaseStemmer$.call(this);
+ this.B_Y_found = false;
+ this.I_p2 = 0;
+ this.I_p1 = 0;
+};
+
+EnglishStemmer$.prototype = new EnglishStemmer;
+
+/**
+ * @param {EnglishStemmer} other
+ */
+EnglishStemmer.prototype.copy_from$LEnglishStemmer$ = function (other) {
+ this.B_Y_found = other.B_Y_found;
+ this.I_p2 = other.I_p2;
+ this.I_p1 = other.I_p1;
+ BaseStemmer.prototype.copy_from$LBaseStemmer$.call(this, other);
+};
+
+/**
+ * @return {!boolean}
+ */
+EnglishStemmer.prototype.r_prelude$ = function () {
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var v_3;
+ /** @type {!number} */
+ var v_4;
+ /** @type {!number} */
+ var v_5;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!boolean} */
+ var lab2;
+ /** @type {!boolean} */
+ var lab4;
+ /** @type {!boolean} */
+ var lab6;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var cursor$1;
+ /** @type {!number} */
+ var cursor$2;
+ this.B_Y_found = false;
+ v_1 = this.cursor;
+ lab0 = true;
+lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ this.bra = this.cursor;
+ if (! this.eq_s$IS(1, "'")) {
+ break lab0;
+ }
+ this.ket = this.cursor;
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ }
+ cursor$0 = this.cursor = v_1;
+ v_2 = cursor$0;
+ lab1 = true;
+lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ this.bra = this.cursor;
+ if (! this.eq_s$IS(1, "y")) {
+ break lab1;
+ }
+ this.ket = this.cursor;
+ if (! this.slice_from$S("Y")) {
+ return false;
+ }
+ this.B_Y_found = true;
+ }
+ cursor$2 = this.cursor = v_2;
+ v_3 = cursor$2;
+ lab2 = true;
+lab2:
+ while (lab2 === true) {
+ lab2 = false;
+ replab3:
+ while (true) {
+ v_4 = this.cursor;
+ lab4 = true;
+ lab4:
+ while (lab4 === true) {
+ lab4 = false;
+ golab5:
+ while (true) {
+ v_5 = this.cursor;
+ lab6 = true;
+ lab6:
+ while (lab6 === true) {
+ lab6 = false;
+ if (! this.in_grouping$AIII(EnglishStemmer.g_v, 97, 121)) {
+ break lab6;
+ }
+ this.bra = this.cursor;
+ if (! this.eq_s$IS(1, "y")) {
+ break lab6;
+ }
+ this.ket = this.cursor;
+ this.cursor = v_5;
+ break golab5;
+ }
+ cursor$1 = this.cursor = v_5;
+ if (cursor$1 >= this.limit) {
+ break lab4;
+ }
+ this.cursor++;
+ }
+ if (! this.slice_from$S("Y")) {
+ return false;
+ }
+ this.B_Y_found = true;
+ continue replab3;
+ }
+ this.cursor = v_4;
+ break replab3;
+ }
+ }
+ this.cursor = v_3;
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+EnglishStemmer.prototype.r_mark_regions$ = function () {
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!boolean} */
+ var lab2;
+ /** @type {!boolean} */
+ var lab4;
+ /** @type {!boolean} */
+ var lab6;
+ /** @type {!boolean} */
+ var lab8;
+ /** @type {!boolean} */
+ var lab10;
+ /** @type {!number} */
+ var limit$0;
+ this.I_p1 = limit$0 = this.limit;
+ this.I_p2 = limit$0;
+ v_1 = this.cursor;
+ lab0 = true;
+lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ v_2 = this.cursor;
+ lab2 = true;
+ lab2:
+ while (lab2 === true) {
+ lab2 = false;
+ if (this.find_among$ALAmong$I(EnglishStemmer.a_0, 3) === 0) {
+ break lab2;
+ }
+ break lab1;
+ }
+ this.cursor = v_2;
+ golab3:
+ while (true) {
+ lab4 = true;
+ lab4:
+ while (lab4 === true) {
+ lab4 = false;
+ if (! this.in_grouping$AIII(EnglishStemmer.g_v, 97, 121)) {
+ break lab4;
+ }
+ break golab3;
+ }
+ if (this.cursor >= this.limit) {
+ break lab0;
+ }
+ this.cursor++;
+ }
+ golab5:
+ while (true) {
+ lab6 = true;
+ lab6:
+ while (lab6 === true) {
+ lab6 = false;
+ if (! this.out_grouping$AIII(EnglishStemmer.g_v, 97, 121)) {
+ break lab6;
+ }
+ break golab5;
+ }
+ if (this.cursor >= this.limit) {
+ break lab0;
+ }
+ this.cursor++;
+ }
+ }
+ this.I_p1 = this.cursor;
+ golab7:
+ while (true) {
+ lab8 = true;
+ lab8:
+ while (lab8 === true) {
+ lab8 = false;
+ if (! this.in_grouping$AIII(EnglishStemmer.g_v, 97, 121)) {
+ break lab8;
+ }
+ break golab7;
+ }
+ if (this.cursor >= this.limit) {
+ break lab0;
+ }
+ this.cursor++;
+ }
+ golab9:
+ while (true) {
+ lab10 = true;
+ lab10:
+ while (lab10 === true) {
+ lab10 = false;
+ if (! this.out_grouping$AIII(EnglishStemmer.g_v, 97, 121)) {
+ break lab10;
+ }
+ break golab9;
+ }
+ if (this.cursor >= this.limit) {
+ break lab0;
+ }
+ this.cursor++;
+ }
+ this.I_p2 = this.cursor;
+ }
+ this.cursor = v_1;
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+EnglishStemmer.prototype.r_shortv$ = function () {
+ /** @type {!number} */
+ var v_1;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!boolean} */
+ var lab1;
+ lab0 = true;
+lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ v_1 = this.limit - this.cursor;
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ if (! this.out_grouping_b$AIII(EnglishStemmer.g_v_WXY, 89, 121)) {
+ break lab1;
+ }
+ if (! this.in_grouping_b$AIII(EnglishStemmer.g_v, 97, 121)) {
+ break lab1;
+ }
+ if (! this.out_grouping_b$AIII(EnglishStemmer.g_v, 97, 121)) {
+ break lab1;
+ }
+ break lab0;
+ }
+ this.cursor = this.limit - v_1;
+ if (! this.out_grouping_b$AIII(EnglishStemmer.g_v, 97, 121)) {
+ return false;
+ }
+ if (! this.in_grouping_b$AIII(EnglishStemmer.g_v, 97, 121)) {
+ return false;
+ }
+ if (this.cursor > this.limit_backward) {
+ return false;
+ }
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+EnglishStemmer.prototype.r_R1$ = function () {
+ return (! (this.I_p1 <= this.cursor) ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+EnglishStemmer.prototype.r_R2$ = function () {
+ return (! (this.I_p2 <= this.cursor) ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+EnglishStemmer.prototype.r_Step_1a$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!boolean} */
+ var lab2;
+ /** @type {!number} */
+ var c;
+ /** @type {!boolean} */
+ var lab4;
+ v_1 = this.limit - this.cursor;
+ lab0 = true;
+lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ this.ket = this.cursor;
+ among_var = this.find_among_b$ALAmong$I(EnglishStemmer.a_1, 3);
+ if (among_var === 0) {
+ this.cursor = this.limit - v_1;
+ break lab0;
+ }
+ this.bra = this.cursor;
+ switch (among_var) {
+ case 0:
+ this.cursor = this.limit - v_1;
+ break lab0;
+ case 1:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ }
+ }
+ this.ket = this.cursor;
+ among_var = this.find_among_b$ALAmong$I(EnglishStemmer.a_2, 6);
+ if (among_var === 0) {
+ return false;
+ }
+ this.bra = this.cursor;
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ if (! this.slice_from$S("ss")) {
+ return false;
+ }
+ break;
+ case 2:
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ v_2 = this.limit - this.cursor;
+ lab2 = true;
+ lab2:
+ while (lab2 === true) {
+ lab2 = false;
+ c = (this.cursor - 2 | 0);
+ if (this.limit_backward > c || c > this.limit) {
+ break lab2;
+ }
+ this.cursor = c;
+ if (! this.slice_from$S("i")) {
+ return false;
+ }
+ break lab1;
+ }
+ this.cursor = this.limit - v_2;
+ if (! this.slice_from$S("ie")) {
+ return false;
+ }
+ }
+ break;
+ case 3:
+ if (this.cursor <= this.limit_backward) {
+ return false;
+ }
+ this.cursor--;
+ golab3:
+ while (true) {
+ lab4 = true;
+ lab4:
+ while (lab4 === true) {
+ lab4 = false;
+ if (! this.in_grouping_b$AIII(EnglishStemmer.g_v, 97, 121)) {
+ break lab4;
+ }
+ break golab3;
+ }
+ if (this.cursor <= this.limit_backward) {
+ return false;
+ }
+ this.cursor--;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+EnglishStemmer.prototype.r_Step_1b$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_3;
+ /** @type {!number} */
+ var v_4;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!number} */
+ var c;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var cursor$1;
+ /** @type {!number} */
+ var cursor$2;
+ this.ket = this.cursor;
+ among_var = this.find_among_b$ALAmong$I(EnglishStemmer.a_4, 6);
+ if (among_var === 0) {
+ return false;
+ }
+ this.bra = this.cursor;
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ if (! (! (this.I_p1 <= this.cursor) ? false : true)) {
+ return false;
+ }
+ if (! this.slice_from$S("ee")) {
+ return false;
+ }
+ break;
+ case 2:
+ v_1 = this.limit - this.cursor;
+ golab0:
+ while (true) {
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ if (! this.in_grouping_b$AIII(EnglishStemmer.g_v, 97, 121)) {
+ break lab1;
+ }
+ break golab0;
+ }
+ if (this.cursor <= this.limit_backward) {
+ return false;
+ }
+ this.cursor--;
+ }
+ this.cursor = this.limit - v_1;
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ v_3 = this.limit - this.cursor;
+ among_var = this.find_among_b$ALAmong$I(EnglishStemmer.a_3, 13);
+ if (among_var === 0) {
+ return false;
+ }
+ this.cursor = this.limit - v_3;
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ c = cursor$0 = this.cursor;
+ this.insert$IIS(cursor$0, cursor$0, "e");
+ this.cursor = c;
+ break;
+ case 2:
+ this.ket = cursor$1 = this.cursor;
+ if (cursor$1 <= this.limit_backward) {
+ return false;
+ }
+ this.cursor--;
+ this.bra = this.cursor;
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 3:
+ if (this.cursor !== this.I_p1) {
+ return false;
+ }
+ v_4 = this.limit - this.cursor;
+ if (! this.r_shortv$()) {
+ return false;
+ }
+ cursor$2 = this.cursor = this.limit - v_4;
+ c = cursor$2;
+ this.insert$IIS(cursor$2, cursor$2, "e");
+ this.cursor = cursor$2;
+ break;
+ }
+ break;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+EnglishStemmer.prototype.r_Step_1c$ = function () {
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!boolean} */
+ var lab2;
+ this.ket = this.cursor;
+ lab0 = true;
+lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ v_1 = this.limit - this.cursor;
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ if (! this.eq_s_b$IS(1, "y")) {
+ break lab1;
+ }
+ break lab0;
+ }
+ this.cursor = this.limit - v_1;
+ if (! this.eq_s_b$IS(1, "Y")) {
+ return false;
+ }
+ }
+ this.bra = this.cursor;
+ if (! this.out_grouping_b$AIII(EnglishStemmer.g_v, 97, 121)) {
+ return false;
+ }
+ v_2 = this.limit - this.cursor;
+ lab2 = true;
+lab2:
+ while (lab2 === true) {
+ lab2 = false;
+ if (this.cursor > this.limit_backward) {
+ break lab2;
+ }
+ return false;
+ }
+ this.cursor = this.limit - v_2;
+ return (! this.slice_from$S("i") ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+EnglishStemmer.prototype.r_Step_2$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var cursor$0;
+ this.ket = this.cursor;
+ among_var = this.find_among_b$ALAmong$I(EnglishStemmer.a_5, 24);
+ if (among_var === 0) {
+ return false;
+ }
+ this.bra = cursor$0 = this.cursor;
+ if (! (! (this.I_p1 <= cursor$0) ? false : true)) {
+ return false;
+ }
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ if (! this.slice_from$S("tion")) {
+ return false;
+ }
+ break;
+ case 2:
+ if (! this.slice_from$S("ence")) {
+ return false;
+ }
+ break;
+ case 3:
+ if (! this.slice_from$S("ance")) {
+ return false;
+ }
+ break;
+ case 4:
+ if (! this.slice_from$S("able")) {
+ return false;
+ }
+ break;
+ case 5:
+ if (! this.slice_from$S("ent")) {
+ return false;
+ }
+ break;
+ case 6:
+ if (! this.slice_from$S("ize")) {
+ return false;
+ }
+ break;
+ case 7:
+ if (! this.slice_from$S("ate")) {
+ return false;
+ }
+ break;
+ case 8:
+ if (! this.slice_from$S("al")) {
+ return false;
+ }
+ break;
+ case 9:
+ if (! this.slice_from$S("ful")) {
+ return false;
+ }
+ break;
+ case 10:
+ if (! this.slice_from$S("ous")) {
+ return false;
+ }
+ break;
+ case 11:
+ if (! this.slice_from$S("ive")) {
+ return false;
+ }
+ break;
+ case 12:
+ if (! this.slice_from$S("ble")) {
+ return false;
+ }
+ break;
+ case 13:
+ if (! this.eq_s_b$IS(1, "l")) {
+ return false;
+ }
+ if (! this.slice_from$S("og")) {
+ return false;
+ }
+ break;
+ case 14:
+ if (! this.slice_from$S("ful")) {
+ return false;
+ }
+ break;
+ case 15:
+ if (! this.slice_from$S("less")) {
+ return false;
+ }
+ break;
+ case 16:
+ if (! this.in_grouping_b$AIII(EnglishStemmer.g_valid_LI, 99, 116)) {
+ return false;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+EnglishStemmer.prototype.r_Step_3$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var cursor$0;
+ this.ket = this.cursor;
+ among_var = this.find_among_b$ALAmong$I(EnglishStemmer.a_6, 9);
+ if (among_var === 0) {
+ return false;
+ }
+ this.bra = cursor$0 = this.cursor;
+ if (! (! (this.I_p1 <= cursor$0) ? false : true)) {
+ return false;
+ }
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ if (! this.slice_from$S("tion")) {
+ return false;
+ }
+ break;
+ case 2:
+ if (! this.slice_from$S("ate")) {
+ return false;
+ }
+ break;
+ case 3:
+ if (! this.slice_from$S("al")) {
+ return false;
+ }
+ break;
+ case 4:
+ if (! this.slice_from$S("ic")) {
+ return false;
+ }
+ break;
+ case 5:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 6:
+ if (! (! (this.I_p2 <= this.cursor) ? false : true)) {
+ return false;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+EnglishStemmer.prototype.r_Step_4$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var v_1;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!number} */
+ var cursor$0;
+ this.ket = this.cursor;
+ among_var = this.find_among_b$ALAmong$I(EnglishStemmer.a_7, 18);
+ if (among_var === 0) {
+ return false;
+ }
+ this.bra = cursor$0 = this.cursor;
+ if (! (! (this.I_p2 <= cursor$0) ? false : true)) {
+ return false;
+ }
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 2:
+ lab0 = true;
+ lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ v_1 = this.limit - this.cursor;
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ if (! this.eq_s_b$IS(1, "s")) {
+ break lab1;
+ }
+ break lab0;
+ }
+ this.cursor = this.limit - v_1;
+ if (! this.eq_s_b$IS(1, "t")) {
+ return false;
+ }
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+EnglishStemmer.prototype.r_Step_5$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!boolean} */
+ var lab2;
+ /** @type {!number} */
+ var cursor$0;
+ this.ket = this.cursor;
+ among_var = this.find_among_b$ALAmong$I(EnglishStemmer.a_8, 2);
+ if (among_var === 0) {
+ return false;
+ }
+ this.bra = this.cursor;
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ lab0 = true;
+ lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ v_1 = this.limit - this.cursor;
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ if (! (! (this.I_p2 <= this.cursor) ? false : true)) {
+ break lab1;
+ }
+ break lab0;
+ }
+ cursor$0 = this.cursor = this.limit - v_1;
+ if (! (! (this.I_p1 <= cursor$0) ? false : true)) {
+ return false;
+ }
+ v_2 = this.limit - this.cursor;
+ lab2 = true;
+ lab2:
+ while (lab2 === true) {
+ lab2 = false;
+ if (! this.r_shortv$()) {
+ break lab2;
+ }
+ return false;
+ }
+ this.cursor = this.limit - v_2;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 2:
+ if (! (! (this.I_p2 <= this.cursor) ? false : true)) {
+ return false;
+ }
+ if (! this.eq_s_b$IS(1, "l")) {
+ return false;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+EnglishStemmer.prototype.r_exception2$ = function () {
+ /** @type {!number} */
+ var cursor$0;
+ this.ket = this.cursor;
+ if (this.find_among_b$ALAmong$I(EnglishStemmer.a_9, 8) === 0) {
+ return false;
+ }
+ this.bra = cursor$0 = this.cursor;
+ return (cursor$0 > this.limit_backward ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+EnglishStemmer.prototype.r_exception1$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var cursor$0;
+ this.bra = this.cursor;
+ among_var = this.find_among$ALAmong$I(EnglishStemmer.a_10, 18);
+ if (among_var === 0) {
+ return false;
+ }
+ this.ket = cursor$0 = this.cursor;
+ if (cursor$0 < this.limit) {
+ return false;
+ }
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ if (! this.slice_from$S("ski")) {
+ return false;
+ }
+ break;
+ case 2:
+ if (! this.slice_from$S("sky")) {
+ return false;
+ }
+ break;
+ case 3:
+ if (! this.slice_from$S("die")) {
+ return false;
+ }
+ break;
+ case 4:
+ if (! this.slice_from$S("lie")) {
+ return false;
+ }
+ break;
+ case 5:
+ if (! this.slice_from$S("tie")) {
+ return false;
+ }
+ break;
+ case 6:
+ if (! this.slice_from$S("idl")) {
+ return false;
+ }
+ break;
+ case 7:
+ if (! this.slice_from$S("gentl")) {
+ return false;
+ }
+ break;
+ case 8:
+ if (! this.slice_from$S("ugli")) {
+ return false;
+ }
+ break;
+ case 9:
+ if (! this.slice_from$S("earli")) {
+ return false;
+ }
+ break;
+ case 10:
+ if (! this.slice_from$S("onli")) {
+ return false;
+ }
+ break;
+ case 11:
+ if (! this.slice_from$S("singl")) {
+ return false;
+ }
+ break;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+EnglishStemmer.prototype.r_postlude$ = function () {
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!boolean} */
+ var lab3;
+ /** @type {!number} */
+ var cursor$0;
+ if (! this.B_Y_found) {
+ return false;
+ }
+replab0:
+ while (true) {
+ v_1 = this.cursor;
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ golab2:
+ while (true) {
+ v_2 = this.cursor;
+ lab3 = true;
+ lab3:
+ while (lab3 === true) {
+ lab3 = false;
+ this.bra = this.cursor;
+ if (! this.eq_s$IS(1, "Y")) {
+ break lab3;
+ }
+ this.ket = this.cursor;
+ this.cursor = v_2;
+ break golab2;
+ }
+ cursor$0 = this.cursor = v_2;
+ if (cursor$0 >= this.limit) {
+ break lab1;
+ }
+ this.cursor++;
+ }
+ if (! this.slice_from$S("y")) {
+ return false;
+ }
+ continue replab0;
+ }
+ this.cursor = v_1;
+ break replab0;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+EnglishStemmer.prototype.stem$ = function () {
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var v_3;
+ /** @type {!number} */
+ var v_4;
+ /** @type {!number} */
+ var v_5;
+ /** @type {!number} */
+ var v_6;
+ /** @type {!number} */
+ var v_7;
+ /** @type {!number} */
+ var v_8;
+ /** @type {!number} */
+ var v_9;
+ /** @type {!number} */
+ var v_10;
+ /** @type {!number} */
+ var v_11;
+ /** @type {!number} */
+ var v_12;
+ /** @type {!number} */
+ var v_13;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!boolean} */
+ var lab2;
+ /** @type {!boolean} */
+ var lab3;
+ /** @type {!number} */
+ var c;
+ /** @type {!boolean} */
+ var lab4;
+ /** @type {!boolean} */
+ var lab5;
+ /** @type {!boolean} */
+ var lab6;
+ /** @type {!boolean} */
+ var lab7;
+ /** @type {!boolean} */
+ var lab8;
+ /** @type {!boolean} */
+ var lab9;
+ /** @type {!boolean} */
+ var lab10;
+ /** @type {!boolean} */
+ var lab11;
+ /** @type {!boolean} */
+ var lab12;
+ /** @type {!boolean} */
+ var lab13;
+ /** @type {!boolean} */
+ var lab14;
+ /** @type {!boolean} */
+ var lab15;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var cursor$1;
+ /** @type {!number} */
+ var cursor$2;
+ /** @type {!number} */
+ var limit$0;
+ /** @type {!number} */
+ var cursor$3;
+ /** @type {!number} */
+ var limit$1;
+ /** @type {!number} */
+ var cursor$4;
+ /** @type {!number} */
+ var limit$2;
+ /** @type {!number} */
+ var cursor$5;
+ /** @type {!number} */
+ var limit$3;
+ /** @type {!number} */
+ var cursor$6;
+ /** @type {!number} */
+ var limit$4;
+ /** @type {!number} */
+ var cursor$7;
+ /** @type {!number} */
+ var limit$5;
+ /** @type {!number} */
+ var cursor$8;
+ /** @type {!number} */
+ var limit$6;
+ /** @type {!number} */
+ var cursor$9;
+ /** @type {!number} */
+ var cursor$10;
+ lab0 = true;
+lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ v_1 = this.cursor;
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ if (! this.r_exception1$()) {
+ break lab1;
+ }
+ break lab0;
+ }
+ this.cursor = v_1;
+ lab2 = true;
+ lab2:
+ while (lab2 === true) {
+ lab2 = false;
+ v_2 = this.cursor;
+ lab3 = true;
+ lab3:
+ while (lab3 === true) {
+ lab3 = false;
+ c = (this.cursor + 3 | 0);
+ if (0 > c || c > this.limit) {
+ break lab3;
+ }
+ this.cursor = c;
+ break lab2;
+ }
+ this.cursor = v_2;
+ break lab0;
+ }
+ cursor$0 = this.cursor = v_1;
+ v_3 = cursor$0;
+ lab4 = true;
+ lab4:
+ while (lab4 === true) {
+ lab4 = false;
+ if (! this.r_prelude$()) {
+ break lab4;
+ }
+ }
+ cursor$1 = this.cursor = v_3;
+ v_4 = cursor$1;
+ lab5 = true;
+ lab5:
+ while (lab5 === true) {
+ lab5 = false;
+ if (! this.r_mark_regions$()) {
+ break lab5;
+ }
+ }
+ cursor$2 = this.cursor = v_4;
+ this.limit_backward = cursor$2;
+ cursor$3 = this.cursor = limit$0 = this.limit;
+ v_5 = limit$0 - cursor$3;
+ lab6 = true;
+ lab6:
+ while (lab6 === true) {
+ lab6 = false;
+ if (! this.r_Step_1a$()) {
+ break lab6;
+ }
+ }
+ this.cursor = this.limit - v_5;
+ lab7 = true;
+ lab7:
+ while (lab7 === true) {
+ lab7 = false;
+ v_6 = this.limit - this.cursor;
+ lab8 = true;
+ lab8:
+ while (lab8 === true) {
+ lab8 = false;
+ if (! this.r_exception2$()) {
+ break lab8;
+ }
+ break lab7;
+ }
+ cursor$4 = this.cursor = (limit$1 = this.limit) - v_6;
+ v_7 = limit$1 - cursor$4;
+ lab9 = true;
+ lab9:
+ while (lab9 === true) {
+ lab9 = false;
+ if (! this.r_Step_1b$()) {
+ break lab9;
+ }
+ }
+ cursor$5 = this.cursor = (limit$2 = this.limit) - v_7;
+ v_8 = limit$2 - cursor$5;
+ lab10 = true;
+ lab10:
+ while (lab10 === true) {
+ lab10 = false;
+ if (! this.r_Step_1c$()) {
+ break lab10;
+ }
+ }
+ cursor$6 = this.cursor = (limit$3 = this.limit) - v_8;
+ v_9 = limit$3 - cursor$6;
+ lab11 = true;
+ lab11:
+ while (lab11 === true) {
+ lab11 = false;
+ if (! this.r_Step_2$()) {
+ break lab11;
+ }
+ }
+ cursor$7 = this.cursor = (limit$4 = this.limit) - v_9;
+ v_10 = limit$4 - cursor$7;
+ lab12 = true;
+ lab12:
+ while (lab12 === true) {
+ lab12 = false;
+ if (! this.r_Step_3$()) {
+ break lab12;
+ }
+ }
+ cursor$8 = this.cursor = (limit$5 = this.limit) - v_10;
+ v_11 = limit$5 - cursor$8;
+ lab13 = true;
+ lab13:
+ while (lab13 === true) {
+ lab13 = false;
+ if (! this.r_Step_4$()) {
+ break lab13;
+ }
+ }
+ cursor$9 = this.cursor = (limit$6 = this.limit) - v_11;
+ v_12 = limit$6 - cursor$9;
+ lab14 = true;
+ lab14:
+ while (lab14 === true) {
+ lab14 = false;
+ if (! this.r_Step_5$()) {
+ break lab14;
+ }
+ }
+ this.cursor = this.limit - v_12;
+ }
+ cursor$10 = this.cursor = this.limit_backward;
+ v_13 = cursor$10;
+ lab15 = true;
+ lab15:
+ while (lab15 === true) {
+ lab15 = false;
+ if (! this.r_postlude$()) {
+ break lab15;
+ }
+ }
+ this.cursor = v_13;
+ }
+ return true;
+};
+
+/**
+ * @param {*} o
+ * @return {!boolean}
+ */
+EnglishStemmer.prototype.equals$X = function (o) {
+ return o instanceof EnglishStemmer;
+};
+
+/**
+ * @return {!number}
+ */
+EnglishStemmer.prototype.hashCode$ = function () {
+ /** @type {!string} */
+ var classname;
+ /** @type {!number} */
+ var hash;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var char;
+ classname = "EnglishStemmer";
+ hash = 0;
+ if ("EnglishStemmer".length === 0) {
+ return (hash | 0);
+ }
+ for (i = 0; i < classname.length; i++) {
+ char = classname.charCodeAt(i);
+ hash = (hash << 5) - hash + char;
+ hash = hash & hash;
+ }
+ return (hash | 0);
+};
+
+/**
+ * class Among extends Object
+ * @constructor
+ */
+function Among() {
+}
+
+/**
+ * @constructor
+ * @param {!string} s
+ * @param {!number} substring_i
+ * @param {!number} result
+ */
+function Among$SII(s, substring_i, result) {
+ this.s_size = s.length;
+ this.s = s;
+ this.substring_i = substring_i;
+ this.result = result;
+ this.method = null;
+ this.instance = null;
+};
+
+Among$SII.prototype = new Among;
+
+/**
+ * @constructor
+ * @param {!string} s
+ * @param {!number} substring_i
+ * @param {!number} result
+ * @param {*} method
+ * @param {BaseStemmer} instance
+ */
+function Among$SIIF$LBaseStemmer$B$LBaseStemmer$(s, substring_i, result, method, instance) {
+ this.s_size = s.length;
+ this.s = s;
+ this.substring_i = substring_i;
+ this.result = result;
+ this.method = method;
+ this.instance = instance;
+};
+
+Among$SIIF$LBaseStemmer$B$LBaseStemmer$.prototype = new Among;
+
+/**
+ * class Metadata extends Object
+ * @constructor
+ */
+function Metadata() {
+}
+
+/**
+ * @constructor
+ * @param {Oktavia} parent
+ */
+function Metadata$LOktavia$(parent) {
+ this._parent = parent;
+ this._bitVector = new BitVector$();
+};
+
+Metadata$LOktavia$.prototype = new Metadata;
+
+/**
+ * @return {!number}
+ */
+Metadata.prototype._size$ = function () {
+ /** @type {BitVector} */
+ var this$0;
+ /** @type {!number} */
+ var i$0;
+ /** @type {BitVector} */
+ var _bitVector$0;
+ this$0 = _bitVector$0 = this._bitVector;
+ i$0 = _bitVector$0._size;
+ return this$0.rank$IB(i$0, true);
+};
+
+/**
+ * @param {!number} index
+ * @return {!string}
+ */
+Metadata.prototype.getContent$I = function (index) {
+ /** @type {!number} */
+ var startPosition;
+ /** @type {!number} */
+ var length;
+ if (index < 0 || this._size$() <= index) {
+ throw new Error("Section.getContent() : range error " + (index + ""));
+ }
+ startPosition = 0;
+ if (index > 0) {
+ startPosition = this._bitVector.select$I(index - 1) + 1;
+ }
+ length = this._bitVector.select$I(index) - startPosition + 1;
+ return this._parent._getSubstring$II(startPosition, length);
+};
+
+/**
+ * @param {!number} index
+ * @return {!number}
+ */
+Metadata.prototype.getStartPosition$I = function (index) {
+ /** @type {!number} */
+ var startPosition;
+ if (index < 0 || this._size$() <= index) {
+ throw new Error("Section.getContent() : range error " + (index + ""));
+ }
+ startPosition = 0;
+ if (index > 0) {
+ startPosition = this._bitVector.select$I(index - 1) + 1;
+ }
+ return (startPosition | 0);
+};
+
+/**
+ * @param {SingleResult} result
+ * @param {Array.<undefined|!number>} positions
+ * @param {!string} word
+ * @param {!boolean} stemmed
+ */
+Metadata.prototype.grouping$LSingleResult$AISB = function (result, positions, word, stemmed) {
+};
+
+/**
+ * @param {!number} index
+ * @return {!string}
+ */
+Metadata.prototype.getInformation$I = function (index) {
+ return '';
+};
+
+/**
+ */
+Metadata.prototype._build$ = function () {
+ this._bitVector.build$();
+};
+
+/**
+ * @param {!string} name
+ * @param {!string} data
+ * @param {!number} offset
+ * @return {!number}
+ */
+Metadata.prototype._load$SSI = function (name, data, offset) {
+ offset = this._bitVector.load$SI(data, offset);
+ this._parent._metadataLabels.push(name);
+ this._parent._metadatas[name] = this;
+ return offset;
+};
+
+/**
+ * @return {!string}
+ */
+Metadata.prototype._dump$ = function () {
+ /** @type {BitVector} */
+ var this$0;
+ /** @type {Array.<undefined|!string>} */
+ var contents$0;
+ this$0 = this._bitVector;
+ contents$0 = [ ];
+ contents$0.push(Binary$dump32bitNumber$N(this$0._size));
+ contents$0.push(Binary$dump32bitNumberList$AN(this$0._v));
+ return contents$0.join('');
+};
+
+/**
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+Metadata.prototype._dump$LCompressionReport$ = function (report) {
+ /** @type {BitVector} */
+ var this$0;
+ /** @type {Array.<undefined|!string>} */
+ var contents$0;
+ this$0 = this._bitVector;
+ contents$0 = [ ];
+ contents$0.push(Binary$dump32bitNumber$N(this$0._size));
+ CompressionReport$add$LCompressionReport$II(report, 2, 2);
+ contents$0.push(Binary$dump32bitNumberList$ANLCompressionReport$(this$0._v, report));
+ return contents$0.join('');
+};
+
+/**
+ * class Section extends Metadata
+ * @constructor
+ */
+function Section() {
+}
+
+Section.prototype = new Metadata;
+/**
+ * @constructor
+ * @param {Oktavia} parent
+ */
+function Section$LOktavia$(parent) {
+ this._parent = parent;
+ this._bitVector = new BitVector$();
+ this._names = [ ];
+};
+
+Section$LOktavia$.prototype = new Section;
+
+/**
+ * @param {!string} name
+ */
+Section.prototype.setTail$S = function (name) {
+ /** @type {!number} */
+ var index$0;
+ /** @type {Oktavia} */
+ var this$0;
+ /** @type {FMIndex} */
+ var this$0$0;
+ this$0 = this._parent;
+ this$0$0 = this$0._fmindex;
+ index$0 = this$0$0._substr.length;
+ this._names.push(name);
+ this._bitVector.set$I(index$0 - 1);
+};
+
+/**
+ * @param {!string} name
+ * @param {!number} index
+ */
+Section.prototype.setTail$SI = function (name, index) {
+ this._names.push(name);
+ this._bitVector.set$I(index - 1);
+};
+
+/**
+ * @return {!number}
+ */
+Section.prototype.size$ = function () {
+ return (this._names.length | 0);
+};
+
+/**
+ * @param {!number} position
+ * @return {!number}
+ */
+Section.prototype.getSectionIndex$I = function (position) {
+ /** @type {BitVector} */
+ var this$0;
+ if (position < 0 || this._bitVector.size$() <= position) {
+ throw new Error("Section.getSectionIndex() : range error " + (position + ""));
+ }
+ this$0 = this._bitVector;
+ return this$0.rank$IB(position, true);
+};
+
+/**
+ * @param {!number} index
+ * @return {!string}
+ */
+Section.prototype.getName$I = function (index) {
+ if (index < 0 || this._names.length <= index) {
+ throw new Error("Section.getName() : range error");
+ }
+ return this._names[index];
+};
+
+/**
+ * @param {SingleResult} result
+ * @param {Array.<undefined|!number>} positions
+ * @param {!string} word
+ * @param {!boolean} stemmed
+ */
+Section.prototype.grouping$LSingleResult$AISB = function (result, positions, word, stemmed) {
+ /** @type {!number} */
+ var i;
+ /** @type {undefined|!number} */
+ var position;
+ /** @type {!number} */
+ var index;
+ /** @type {SearchUnit} */
+ var unit;
+ for (i = 0; i < positions.length; i++) {
+ position = positions[i];
+ index = this.getSectionIndex$I(position);
+ unit = SingleResult$getSearchUnit$LSingleResult$I(result, index);
+ if (unit.startPosition < 0) {
+ unit.startPosition = this.getStartPosition$I(index);
+ }
+ SearchUnit$addPosition$LSearchUnit$SIB(unit, word, position - unit.startPosition, stemmed);
+ }
+};
+
+/**
+ * @param {!number} index
+ * @return {!string}
+ */
+Section.prototype.getInformation$I = function (index) {
+ return this.getName$I(index);
+};
+
+/**
+ * @param {Oktavia} parent
+ * @param {!string} name
+ * @param {!string} data
+ * @param {!number} offset
+ * @return {!number}
+ */
+Section._load$LOktavia$SSI = function (parent, name, data, offset) {
+ /** @type {LoadedStringListResult} */
+ var strs;
+ /** @type {Section} */
+ var section;
+ /** @type {!number} */
+ var offset$0;
+ strs = new LoadedStringListResult$SI(data, offset);
+ section = new Section$LOktavia$(parent);
+ section._names = strs.result;
+ offset$0 = strs.offset;
+ offset$0 = section._bitVector.load$SI(data, offset$0);
+ section._parent._metadataLabels.push(name);
+ section._parent._metadatas[name] = section;
+ return offset$0;
+};
+
+var Section$_load$LOktavia$SSI = Section._load$LOktavia$SSI;
+
+/**
+ * @return {!string}
+ */
+Section.prototype._dump$ = function () {
+ return [ Binary$dump16bitNumber$I(0), Binary$dumpStringList$AS(this._names), Metadata.prototype._dump$.call(this) ].join('');
+};
+
+/**
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+Section.prototype._dump$LCompressionReport$ = function (report) {
+ CompressionReport$add$LCompressionReport$II(report, 1, 1);
+ return [ Binary$dump16bitNumber$I(0), Binary$dumpStringList$ASLCompressionReport$(this._names, report), Metadata.prototype._dump$LCompressionReport$.call(this, report) ].join('');
+};
+
+/**
+ * class Splitter extends Metadata
+ * @constructor
+ */
+function Splitter() {
+}
+
+Splitter.prototype = new Metadata;
+/**
+ * @constructor
+ * @param {Oktavia} parent
+ */
+function Splitter$LOktavia$(parent) {
+ this._parent = parent;
+ this._bitVector = new BitVector$();
+ this.name = null;
+};
+
+Splitter$LOktavia$.prototype = new Splitter;
+
+/**
+ * @constructor
+ * @param {Oktavia} parent
+ * @param {!string} name
+ */
+function Splitter$LOktavia$S(parent, name) {
+ this._parent = parent;
+ this._bitVector = new BitVector$();
+ this.name = name;
+};
+
+Splitter$LOktavia$S.prototype = new Splitter;
+
+/**
+ * @return {!number}
+ */
+Splitter.prototype.size$ = function () {
+ /** @type {BitVector} */
+ var this$0$0;
+ /** @type {!number} */
+ var i$0$0;
+ /** @type {BitVector} */
+ var _bitVector$0;
+ this$0$0 = _bitVector$0 = this._bitVector;
+ i$0$0 = _bitVector$0._size;
+ return this$0$0.rank$IB(i$0$0, true);
+};
+
+/**
+ */
+Splitter.prototype.split$ = function () {
+ /** @type {!number} */
+ var index$0;
+ /** @type {Oktavia} */
+ var this$0;
+ /** @type {FMIndex} */
+ var this$0$0;
+ this$0 = this._parent;
+ this$0$0 = this$0._fmindex;
+ index$0 = this$0$0._substr.length;
+ this._bitVector.set$I(index$0 - 1);
+};
+
+/**
+ * @param {!number} index
+ */
+Splitter.prototype.split$I = function (index) {
+ this._bitVector.set$I(index - 1);
+};
+
+/**
+ * @param {!number} position
+ * @return {!number}
+ */
+Splitter.prototype.getIndex$I = function (position) {
+ /** @type {BitVector} */
+ var this$0;
+ if (position < 0 || this._bitVector.size$() <= position) {
+ throw new Error("Section.getSectionIndex() : range error");
+ }
+ this$0 = this._bitVector;
+ return this$0.rank$IB(position, true);
+};
+
+/**
+ * @param {SingleResult} result
+ * @param {Array.<undefined|!number>} positions
+ * @param {!string} word
+ * @param {!boolean} stemmed
+ */
+Splitter.prototype.grouping$LSingleResult$AISB = function (result, positions, word, stemmed) {
+ /** @type {!number} */
+ var i;
+ /** @type {undefined|!number} */
+ var position;
+ /** @type {!number} */
+ var index;
+ /** @type {SearchUnit} */
+ var unit;
+ for (i = 0; i < positions.length; i++) {
+ position = positions[i];
+ index = this.getIndex$I(position);
+ unit = SingleResult$getSearchUnit$LSingleResult$I(result, index);
+ if (unit.startPosition < 0) {
+ unit.startPosition = this.getStartPosition$I(index);
+ }
+ SearchUnit$addPosition$LSearchUnit$SIB(unit, word, position - unit.startPosition, stemmed);
+ }
+};
+
+/**
+ * @param {!number} index
+ * @return {!string}
+ */
+Splitter.prototype.getInformation$I = function (index) {
+ return (this.name != null ? this.name + (index + 1 + "") : '');
+};
+
+/**
+ * @param {Oktavia} parent
+ * @param {!string} name
+ * @param {!string} data
+ * @param {!number} offset
+ * @return {!number}
+ */
+Splitter._load$LOktavia$SSI = function (parent, name, data, offset) {
+ /** @type {Splitter} */
+ var section;
+ section = new Splitter$LOktavia$(parent);
+ offset = section._bitVector.load$SI(data, offset);
+ section._parent._metadataLabels.push(name);
+ section._parent._metadatas[name] = section;
+ return offset;
+};
+
+var Splitter$_load$LOktavia$SSI = Splitter._load$LOktavia$SSI;
+
+/**
+ * @return {!string}
+ */
+Splitter.prototype._dump$ = function () {
+ return [ Binary$dump16bitNumber$I(1), Metadata.prototype._dump$.call(this) ].join('');
+};
+
+/**
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+Splitter.prototype._dump$LCompressionReport$ = function (report) {
+ CompressionReport$add$LCompressionReport$II(report, 1, 1);
+ return [ Binary$dump16bitNumber$I(1), Metadata.prototype._dump$LCompressionReport$.call(this, report) ].join('');
+};
+
+/**
+ * class Table extends Metadata
+ * @constructor
+ */
+function Table() {
+}
+
+Table.prototype = new Metadata;
+/**
+ * @constructor
+ * @param {Oktavia} parent
+ * @param {Array.<undefined|!string>} headers
+ */
+function Table$LOktavia$AS(parent, headers) {
+ this._parent = parent;
+ this._bitVector = new BitVector$();
+ this._headers = headers;
+ this._columnTails = new BitVector$();
+};
+
+Table$LOktavia$AS.prototype = new Table;
+
+/**
+ * @return {!number}
+ */
+Table.prototype.rowSize$ = function () {
+ /** @type {BitVector} */
+ var this$0$0;
+ /** @type {!number} */
+ var i$0$0;
+ /** @type {BitVector} */
+ var _bitVector$0;
+ this$0$0 = _bitVector$0 = this._bitVector;
+ i$0$0 = _bitVector$0._size;
+ return this$0$0.rank$IB(i$0$0, true);
+};
+
+/**
+ * @return {!number}
+ */
+Table.prototype.columnSize$ = function () {
+ return (this._headers.length | 0);
+};
+
+/**
+ */
+Table.prototype.setColumnTail$ = function () {
+ /** @type {!number} */
+ var index;
+ /** @type {Oktavia} */
+ var this$0;
+ /** @type {FMIndex} */
+ var this$0$0;
+ /** @type {Oktavia} */
+ var _parent$0;
+ this$0 = _parent$0 = this._parent;
+ this$0$0 = this$0._fmindex;
+ index = this$0$0._substr.length;
+ _parent$0._fmindex.push$S(Oktavia.eob);
+ this._columnTails.set$I(index - 1);
+};
+
+/**
+ */
+Table.prototype.setRowTail$ = function () {
+ /** @type {!number} */
+ var index;
+ /** @type {Oktavia} */
+ var this$0;
+ /** @type {FMIndex} */
+ var this$0$0;
+ this$0 = this._parent;
+ this$0$0 = this$0._fmindex;
+ index = this$0$0._substr.length;
+ this._bitVector.set$I(index - 1);
+};
+
+/**
+ * @param {!number} position
+ * @return {Array.<undefined|!number>}
+ */
+Table.prototype.getCell$I = function (position) {
+ /** @type {!number} */
+ var row;
+ /** @type {!number} */
+ var currentColumn;
+ /** @type {!number} */
+ var lastRowColumn;
+ /** @type {!number} */
+ var startPosition;
+ /** @type {Array.<undefined|!number>} */
+ var result;
+ /** @type {BitVector} */
+ var this$0;
+ /** @type {BitVector} */
+ var this$1;
+ if (position < 0 || this._bitVector.size$() <= position) {
+ throw new Error("Section.getSectionIndex() : range error " + (position + ""));
+ }
+ this$0 = this._bitVector;
+ row = this$0.rank$IB(position, true);
+ this$1 = this._columnTails;
+ currentColumn = this$1.rank$IB(position, true);
+ lastRowColumn = 0;
+ if (row > 0) {
+ startPosition = this._bitVector.select$I(row - 1) + 1;
+ lastRowColumn = this._columnTails.rank$I(startPosition);
+ }
+ result = [ row, currentColumn - lastRowColumn ];
+ return result;
+};
+
+/**
+ * @param {!number} rowIndex
+ * @return {Object.<string, undefined|!string>}
+ */
+Table.prototype.getRowContent$I = function (rowIndex) {
+ /** @type {!string} */
+ var content;
+ /** @type {Array.<undefined|!string>} */
+ var values;
+ /** @type {Object.<string, undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var i;
+ content = this.getContent$I(rowIndex);
+ values = content.split(Oktavia.eob, this._headers.length);
+ result = ({ });
+ for (i in this._headers) {
+ if (i < values.length) {
+ result[this._headers[i]] = values[i];
+ } else {
+ result[this._headers[i]] = '';
+ }
+ }
+ return result;
+};
+
+/**
+ * @param {SingleResult} result
+ * @param {Array.<undefined|!number>} positions
+ * @param {!string} word
+ * @param {!boolean} stemmed
+ */
+Table.prototype.grouping$LSingleResult$AISB = function (result, positions, word, stemmed) {
+};
+
+/**
+ * @param {!number} index
+ * @return {!string}
+ */
+Table.prototype.getInformation$I = function (index) {
+ return '';
+};
+
+/**
+ */
+Table.prototype._build$ = function () {
+ this._bitVector.build$();
+ this._columnTails.build$();
+};
+
+/**
+ * @param {Oktavia} parent
+ * @param {!string} name
+ * @param {!string} data
+ * @param {!number} offset
+ * @return {!number}
+ */
+Table._load$LOktavia$SSI = function (parent, name, data, offset) {
+ /** @type {LoadedStringListResult} */
+ var strs;
+ /** @type {Table} */
+ var table;
+ /** @type {!number} */
+ var offset$0;
+ strs = new LoadedStringListResult$SI(data, offset);
+ table = new Table$LOktavia$AS(parent, strs.result);
+ offset$0 = strs.offset;
+ offset$0 = table._bitVector.load$SI(data, offset$0);
+ table._parent._metadataLabels.push(name);
+ table._parent._metadatas[name] = table;
+ offset = offset$0;
+ return table._columnTails.load$SI(data, offset$0);
+};
+
+var Table$_load$LOktavia$SSI = Table._load$LOktavia$SSI;
+
+/**
+ * @return {!string}
+ */
+Table.prototype._dump$ = function () {
+ return [ Binary$dump16bitNumber$I(2), Binary$dumpStringList$AS(this._headers), Metadata.prototype._dump$.call(this), this._columnTails.dump$() ].join('');
+};
+
+/**
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+Table.prototype._dump$LCompressionReport$ = function (report) {
+ CompressionReport$add$LCompressionReport$II(report, 1, 1);
+ return [ Binary$dump16bitNumber$I(2), Binary$dumpStringList$ASLCompressionReport$(this._headers, report), Metadata.prototype._dump$LCompressionReport$.call(this, report), this._columnTails.dump$LCompressionReport$(report) ].join('');
+};
+
+/**
+ * class Block extends Metadata
+ * @constructor
+ */
+function Block() {
+}
+
+Block.prototype = new Metadata;
+/**
+ * @constructor
+ * @param {Oktavia} parent
+ */
+function Block$LOktavia$(parent) {
+ this._parent = parent;
+ this._bitVector = new BitVector$();
+ this._names = [ ];
+ this._start = false;
+};
+
+Block$LOktavia$.prototype = new Block;
+
+/**
+ * @param {!string} blockName
+ */
+Block.prototype.startBlock$S = function (blockName) {
+ this.startBlock$SI(blockName, this._parent.contentSize$());
+};
+
+/**
+ * @param {!string} blockName
+ * @param {!number} index
+ */
+Block.prototype.startBlock$SI = function (blockName, index) {
+ if (this._start) {
+ throw new Error('Splitter `' + this._names[this._names.length - 1] + '` is not closed');
+ }
+ this._start = true;
+ this._names.push(blockName);
+ this._bitVector.set$I(index - 1);
+};
+
+/**
+ */
+Block.prototype.endBlock$ = function () {
+ this.endBlock$I(this._parent.contentSize$());
+};
+
+/**
+ * @param {!number} index
+ */
+Block.prototype.endBlock$I = function (index) {
+ if (! this._start) {
+ throw new Error('Splitter is not started');
+ }
+ this._start = false;
+ this._bitVector.set$I(index - 1);
+};
+
+/**
+ * @return {!number}
+ */
+Block.prototype.size$ = function () {
+ return (this._names.length | 0);
+};
+
+/**
+ * @param {!number} position
+ * @return {!number}
+ */
+Block.prototype.blockIndex$I = function (position) {
+ /** @type {!number} */
+ var result;
+ /** @type {BitVector} */
+ var this$0;
+ if (position < 0 || this._parent._fmindex.size$() - 1 <= position) {
+ throw new Error("Block.blockIndex() : range error " + (position + ""));
+ }
+ if (position >= this._bitVector.size$()) {
+ position = (this._bitVector.size$() - 1 | 0);
+ result = (this._bitVector.rank$I(position) + 1 | 0);
+ } else {
+ this$0 = this._bitVector;
+ result = this$0.rank$IB(position, true);
+ }
+ return result;
+};
+
+/**
+ * @param {!number} position
+ * @return {!boolean}
+ */
+Block.prototype.inBlock$I = function (position) {
+ /** @type {!number} */
+ var blockIndex;
+ blockIndex = this.blockIndex$I(position);
+ return blockIndex % 2 !== 0;
+};
+
+/**
+ * @param {!number} position
+ * @return {!string}
+ */
+Block.prototype.getBlockContent$I = function (position) {
+ /** @type {!number} */
+ var blockIndex;
+ /** @type {!string} */
+ var result;
+ blockIndex = this.blockIndex$I(position);
+ if (blockIndex % 2 !== 0) {
+ result = this.getContent$I(blockIndex);
+ } else {
+ result = '';
+ }
+ return result;
+};
+
+/**
+ * @param {!number} position
+ * @return {!string}
+ */
+Block.prototype.getBlockName$I = function (position) {
+ /** @type {!number} */
+ var blockIndex;
+ /** @type {!string} */
+ var result;
+ blockIndex = this.blockIndex$I(position);
+ if (blockIndex % 2 !== 0) {
+ result = this._names[blockIndex >>> 1];
+ } else {
+ result = '';
+ }
+ return result;
+};
+
+/**
+ * @param {SingleResult} result
+ * @param {Array.<undefined|!number>} positions
+ * @param {!string} word
+ * @param {!boolean} stemmed
+ */
+Block.prototype.grouping$LSingleResult$AISB = function (result, positions, word, stemmed) {
+};
+
+/**
+ * @param {!number} index
+ * @return {!string}
+ */
+Block.prototype.getInformation$I = function (index) {
+ return '';
+};
+
+/**
+ * @param {Oktavia} parent
+ * @param {!string} name
+ * @param {!string} data
+ * @param {!number} offset
+ * @return {!number}
+ */
+Block._load$LOktavia$SSI = function (parent, name, data, offset) {
+ /** @type {LoadedStringListResult} */
+ var strs;
+ /** @type {Block} */
+ var block;
+ /** @type {!number} */
+ var offset$0;
+ strs = new LoadedStringListResult$SI(data, offset);
+ block = new Block$LOktavia$(parent);
+ block._names = strs.result;
+ offset$0 = strs.offset;
+ offset$0 = block._bitVector.load$SI(data, offset$0);
+ block._parent._metadataLabels.push(name);
+ block._parent._metadatas[name] = block;
+ return offset$0;
+};
+
+var Block$_load$LOktavia$SSI = Block._load$LOktavia$SSI;
+
+/**
+ * @return {!string}
+ */
+Block.prototype._dump$ = function () {
+ return [ Binary$dump16bitNumber$I(3), Binary$dumpStringList$AS(this._names), Metadata.prototype._dump$.call(this) ].join('');
+};
+
+/**
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+Block.prototype._dump$LCompressionReport$ = function (report) {
+ CompressionReport$add$LCompressionReport$II(report, 1, 1);
+ return [ Binary$dump16bitNumber$I(3), Binary$dumpStringList$ASLCompressionReport$(this._names, report), Metadata.prototype._dump$LCompressionReport$.call(this, report) ].join('');
+};
+
+/**
+ * class FMIndex extends Object
+ * @constructor
+ */
+function FMIndex() {
+}
+
+/**
+ * @constructor
+ */
+function FMIndex$() {
+ /** @type {Array.<undefined|!number>} */
+ var _rlt$0;
+ this._ssize = 0;
+ (this._ddic = 0, this._head = 0);
+ this._substr = "";
+ this._sv = new WaveletMatrix$();
+ this._posdic = [ ];
+ this._idic = [ ];
+ _rlt$0 = this._rlt = [ ];
+ _rlt$0.length = 65536;
+};
+
+FMIndex$.prototype = new FMIndex;
+
+/**
+ */
+FMIndex.prototype.clear$ = function () {
+ /** @type {WaveletMatrix} */
+ var this$0;
+ this$0 = this._sv;
+ this$0._bv.length = 0;
+ this$0._seps.length = 0;
+ this$0._size = 0;
+ this._posdic.length = 0;
+ this._idic.length = 0;
+ this._ddic = 0;
+ this._head = 0;
+ this._substr = "";
+};
+
+/**
+ * @return {!number}
+ */
+FMIndex.prototype.size$ = function () {
+ /** @type {WaveletMatrix} */
+ var this$0;
+ this$0 = this._sv;
+ return this$0._size;
+};
+
+/**
+ * @return {!number}
+ */
+FMIndex.prototype.contentSize$ = function () {
+ return this._substr.length;
+};
+
+/**
+ * @param {!string} key
+ * @return {!number}
+ */
+FMIndex.prototype.getRows$S = function (key) {
+ /** @type {Array.<undefined|!number>} */
+ var pos;
+ pos = [ ];
+ return this.getRows$SAI(key, pos);
+};
+
+/**
+ * @param {!string} key
+ * @param {Array.<undefined|!number>} pos
+ * @return {!number}
+ */
+FMIndex.prototype.getRows$SAI = function (key, pos) {
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var code;
+ /** @type {!number} */
+ var first;
+ /** @type {undefined|!number} */
+ var last;
+ /** @type {!number} */
+ var c;
+ /** @type {Array.<undefined|!number>} */
+ var _rlt$0;
+ i = key.length - 1;
+ code = key.charCodeAt(i);
+ first = (_rlt$0 = this._rlt)[code] + 1;
+ last = _rlt$0[code + 1];
+ while (first <= last) {
+ if (i === 0) {
+ pos[0] = (-- first | 0);
+ pos[1] = -- last;
+ return (last - first + 1 | 0);
+ }
+ i--;
+ c = key.charCodeAt(i);
+ first = this._rlt[c] + this._sv.rank$II(first - 1, c) + 1;
+ last = this._rlt[c] + this._sv.rank$II(last, c);
+ }
+ return 0;
+};
+
+/**
+ * @param {!number} i
+ * @return {!number}
+ */
+FMIndex.prototype.getPosition$I = function (i) {
+ /** @type {!number} */
+ var pos;
+ /** @type {!number} */
+ var c;
+ if (i >= this.size$()) {
+ throw new Error("FMIndex.getPosition() : range error");
+ }
+ pos = 0;
+ while (i !== this._head) {
+ if (i % this._ddic === 0) {
+ pos += this._posdic[i / this._ddic] + 1;
+ break;
+ }
+ c = this._sv.get$I(i);
+ i = this._rlt[c] + this._sv.rank$II(i, c);
+ pos++;
+ }
+ return (pos % this.size$() | 0);
+};
+
+/**
+ * @param {!number} pos
+ * @param {!number} len
+ * @return {!string}
+ */
+FMIndex.prototype.getSubstring$II = function (pos, len) {
+ /** @type {!number} */
+ var pos_end;
+ /** @type {!number} */
+ var pos_tmp;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var pos_idic;
+ /** @type {!string} */
+ var substr;
+ /** @type {!number} */
+ var c;
+ /** @type {!number} */
+ var _ddic$0;
+ if (pos >= this.size$()) {
+ throw new Error("FMIndex.getSubstring() : range error");
+ }
+ pos_end = Math.min(pos + len, this.size$());
+ pos_tmp = this.size$() - 1;
+ i = this._head;
+ pos_idic = Math.floor((pos_end + (_ddic$0 = this._ddic) - 2) / _ddic$0);
+ if (pos_idic < this._idic.length) {
+ pos_tmp = pos_idic * this._ddic;
+ i = this._idic[pos_idic];
+ }
+ substr = "";
+ while (pos_tmp >= pos) {
+ c = this._sv.get$I(i);
+ i = this._rlt[c] + this._sv.rank$II(i, c);
+ if (pos_tmp < pos_end) {
+ substr = String.fromCharCode(c) + substr;
+ }
+ if (pos_tmp === 0) {
+ break;
+ }
+ pos_tmp--;
+ }
+ return substr;
+};
+
+/**
+ */
+FMIndex.prototype.build$ = function () {
+ this.build$SIIB(String.fromCharCode(0), 65535, 20, false);
+};
+
+/**
+ * @param {!string} end_marker
+ * @param {!number} ddic
+ * @param {!boolean} verbose
+ */
+FMIndex.prototype.build$SIB = function (end_marker, ddic, verbose) {
+ this.build$SIIB(end_marker, 65535, ddic, verbose);
+};
+
+/**
+ * @param {!string} end_marker
+ * @param {!number} maxChar
+ * @param {!number} ddic
+ * @param {!boolean} verbose
+ */
+FMIndex.prototype.build$SIIB = function (end_marker, maxChar, ddic, verbose) {
+ /** @type {BurrowsWheelerTransform} */
+ var b;
+ /** @type {!string} */
+ var s;
+ /** @type {!number} */
+ var c;
+ /** @type {!string} */
+ var str$0;
+ /** @type {WaveletMatrix} */
+ var this$0;
+ /** @type {!string} */
+ var _str$0;
+ /** @type {Array.<undefined|!number>} */
+ var _suffixarray$0;
+ if (verbose) {
+ console.time("building burrows-wheeler transform");
+ }
+ this._substr += end_marker;
+ b = ({_str: "", _size: 0, _head: 0, _suffixarray: [ ]});
+ str$0 = this._substr;
+ _str$0 = b._str = str$0;
+ b._size = _str$0.length;
+ _suffixarray$0 = b._suffixarray = SAIS$make$S(str$0);
+ b._head = (_suffixarray$0.indexOf(0) | 0);
+ s = BurrowsWheelerTransform$get$LBurrowsWheelerTransform$(b);
+ this._ssize = s.length;
+ this._head = b._head;
+ b._str = "";
+ b._size = 0;
+ b._head = 0;
+ b._suffixarray.length = 0;
+ this._substr = "";
+ if (verbose) {
+ console.timeEnd("building burrows-wheeler transform");
+ }
+ if (verbose) {
+ console.time("building wavelet matrix");
+ }
+ this$0 = this._sv;
+ this$0._bitsize = (Math.ceil(Math.log(maxChar) / 0.6931471805599453) | 0);
+ if (verbose) {
+ console.log(" maxCharCode: ", maxChar);
+ console.log(" bitSize: ", this._sv.bitsize$());
+ }
+ this._sv.build$S(s);
+ if (verbose) {
+ console.timeEnd("building wavelet matrix");
+ }
+ if (verbose) {
+ console.time("caching rank less than");
+ }
+ for (c = 0; c < maxChar; c++) {
+ this._rlt[c] = this._sv.rank_less_than$II(this._sv.size$(), c);
+ }
+ if (verbose) {
+ console.timeEnd("caching rank less than");
+ }
+ this._ddic = ddic;
+ if (verbose) {
+ console.time("building dictionaries");
+ }
+ this._buildDictionaries$();
+ if (verbose) {
+ console.timeEnd("building dictionaries");
+ console.log('');
+ }
+};
+
+/**
+ */
+FMIndex.prototype._buildDictionaries$ = function () {
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var pos;
+ /** @type {!number} */
+ var c;
+ for (i = 0; i < this._ssize / this._ddic + 1; i++) {
+ this._posdic.push(0);
+ this._idic.push(0);
+ }
+ i = this._head;
+ pos = this.size$() - 1;
+ do {
+ if (i % this._ddic === 0) {
+ this._posdic[Math.floor(i / this._ddic)] = (pos | 0);
+ }
+ if (pos % this._ddic === 0) {
+ this._idic[Math.floor(pos / this._ddic)] = (i | 0);
+ }
+ c = this._sv.get$I(i);
+ i = this._rlt[c] + this._sv.rank$II(i, c);
+ pos--;
+ } while (i !== this._head);
+};
+
+/**
+ * @param {!string} doc
+ */
+FMIndex.prototype.push$S = function (doc) {
+ if (doc.length <= 0) {
+ throw new Error("FMIndex::push(): empty string");
+ }
+ this._substr += doc;
+};
+
+/**
+ * @param {!string} keyword
+ * @return {Array.<undefined|!number>}
+ */
+FMIndex.prototype.search$S = function (keyword) {
+ /** @type {Array.<undefined|!number>} */
+ var result;
+ /** @type {Array.<undefined|!number>} */
+ var position;
+ /** @type {!number} */
+ var rows;
+ /** @type {undefined|!number} */
+ var first;
+ /** @type {undefined|!number} */
+ var last;
+ /** @type {undefined|!number} */
+ var i;
+ result = [ ];
+ position = [ ];
+ rows = this.getRows$SAI(keyword, position);
+ if (rows > 0) {
+ first = position[0];
+ last = position[1];
+ for (i = first; i <= last; i++) {
+ result.push(this.getPosition$I(i));
+ }
+ }
+ return result;
+};
+
+/**
+ * @return {!string}
+ */
+FMIndex.prototype.dump$ = function () {
+ return this.dump$B(false);
+};
+
+/**
+ * @param {!boolean} verbose
+ * @return {!string}
+ */
+FMIndex.prototype.dump$B = function (verbose) {
+ /** @type {Array.<undefined|!string>} */
+ var contents;
+ /** @type {CompressionReport} */
+ var report;
+ /** @type {!number} */
+ var i;
+ contents = [ ];
+ report = ({source: 0, result: 0});
+ contents.push(Binary$dump32bitNumber$N(this._ddic));
+ contents.push(Binary$dump32bitNumber$N(this._ssize));
+ contents.push(Binary$dump32bitNumber$N(this._head));
+ CompressionReport$add$LCompressionReport$II(report, 6, 6);
+ contents.push(this._sv.dump$LCompressionReport$(report));
+ if (verbose) {
+ console.log("Serializing FM-index");
+ console.log(' Wavelet Matrix: ' + (contents[3].length * 2 + "") + ' bytes (' + (Math.round(report.result * 100.0 / report.source) + "") + '%)');
+ }
+ contents.push(Binary$dump32bitNumber$N(this._posdic.length));
+ for (i in this._posdic) {
+ contents.push(Binary$dump32bitNumber$N(this._posdic[i]));
+ }
+ for (i in this._idic) {
+ contents.push(Binary$dump32bitNumber$N(this._idic[i]));
+ }
+ if (verbose) {
+ console.log(' Dictionary Cache: ' + (this._idic.length * 16 + "") + ' bytes');
+ }
+ return contents.join("");
+};
+
+/**
+ * @param {!string} data
+ * @return {!number}
+ */
+FMIndex.prototype.load$S = function (data) {
+ return this.load$SI(data, 0);
+};
+
+/**
+ * @param {!string} data
+ * @param {!number} offset
+ * @return {!number}
+ */
+FMIndex.prototype.load$SI = function (data, offset) {
+ /** @type {!number} */
+ var maxChar;
+ /** @type {!number} */
+ var c;
+ /** @type {!number} */
+ var size;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var result$0;
+ /** @type {!number} */
+ var result$1;
+ result$0 = data.charCodeAt(offset) * 65536 + data.charCodeAt(offset + 1);
+ this._ddic = (result$0 | 0);
+ this._ssize = (Binary$load32bitNumber$SI(data, offset + 2) | 0);
+ this._head = (Binary$load32bitNumber$SI(data, offset + 4) | 0);
+ offset = this._sv.load$SI(data, offset + 6);
+ maxChar = Math.pow(2, this._sv.bitsize$());
+ for (c = 0; c < maxChar; c++) {
+ this._rlt[c] = this._sv.rank_less_than$II(this._sv.size$(), c);
+ }
+ result$1 = data.charCodeAt(offset) * 65536 + data.charCodeAt(offset + 1);
+ size = result$1;
+ offset += 2;
+ for (i = 0; i < size; (i++, offset += 2)) {
+ this._posdic.push(Binary$load32bitNumber$SI(data, offset));
+ }
+ for (i = 0; i < size; (i++, offset += 2)) {
+ this._idic.push(Binary$load32bitNumber$SI(data, offset));
+ }
+ return offset;
+};
+
+/**
+ * class Tag extends Object
+ * @constructor
+ */
+function Tag() {
+}
+
+/**
+ * @constructor
+ * @param {!string} name
+ */
+function Tag$S(name) {
+ this.name = name;
+ this.attributes = ({ });
+ this.isSelfClosing = false;
+};
+
+Tag$S.prototype = new Tag;
+
+/**
+ * class _Common extends Object
+ * @constructor
+ */
+function _Common() {
+}
+
+/**
+ * @constructor
+ */
+function _Common$() {
+};
+
+_Common$.prototype = new _Common;
+
+/**
+ * class _State extends Object
+ * @constructor
+ */
+function _State() {
+}
+
+/**
+ * @constructor
+ */
+function _State$() {
+};
+
+_State$.prototype = new _State;
+
+/**
+ * class SAXHandler extends Object
+ * @constructor
+ */
+function SAXHandler() {
+}
+
+/**
+ * @constructor
+ */
+function SAXHandler$() {
+ this.position = 0;
+ this.column = 0;
+ this.line = 0;
+};
+
+SAXHandler$.prototype = new SAXHandler;
+
+/**
+ * @param {Error} error
+ */
+SAXHandler.prototype.onerror$LError$ = function (error) {
+};
+
+/**
+ * @param {!string} text
+ */
+SAXHandler.prototype.ontext$S = function (text) {
+};
+
+/**
+ * @param {!string} doctype
+ */
+SAXHandler.prototype.ondoctype$S = function (doctype) {
+};
+
+/**
+ * @param {!string} name
+ * @param {!string} body
+ */
+SAXHandler.prototype.onprocessinginstruction$SS = function (name, body) {
+};
+
+/**
+ * @param {!string} sgmlDecl
+ */
+SAXHandler.prototype.onsgmldeclaration$S = function (sgmlDecl) {
+};
+
+/**
+ * @param {!string} tagname
+ * @param {Object.<string, undefined|!string>} attributes
+ */
+SAXHandler.prototype.onopentag$SHS = function (tagname, attributes) {
+};
+
+/**
+ * @param {!string} tagname
+ */
+SAXHandler.prototype.onclosetag$S = function (tagname) {
+};
+
+/**
+ * @param {!string} name
+ * @param {!string} value
+ */
+SAXHandler.prototype.onattribute$SS = function (name, value) {
+};
+
+/**
+ * @param {!string} comment
+ */
+SAXHandler.prototype.oncomment$S = function (comment) {
+};
+
+/**
+ */
+SAXHandler.prototype.onopencdata$ = function () {
+};
+
+/**
+ * @param {!string} cdata
+ */
+SAXHandler.prototype.oncdata$S = function (cdata) {
+};
+
+/**
+ */
+SAXHandler.prototype.onclosecdata$ = function () {
+};
+
+/**
+ */
+SAXHandler.prototype.onend$ = function () {
+};
+
+/**
+ */
+SAXHandler.prototype.onready$ = function () {
+};
+
+/**
+ * @param {!string} script
+ */
+SAXHandler.prototype.onscript$S = function (script) {
+};
+
+/**
+ * class _HTMLHandler extends SAXHandler
+ * @constructor
+ */
+function _HTMLHandler() {
+}
+
+_HTMLHandler.prototype = new SAXHandler;
+/**
+ * @constructor
+ * @param {Object.<string, undefined|Array.<undefined|!string>>} styles
+ * @param {!boolean} escape
+ */
+function _HTMLHandler$HASB(styles, escape) {
+ this.position = 0;
+ this.column = 0;
+ this.line = 0;
+ this.text = [ ];
+ this.escape = escape;
+ this.styles = styles;
+};
+
+_HTMLHandler$HASB.prototype = new _HTMLHandler;
+
+/**
+ * @param {!string} str
+ * @return {!string}
+ */
+_HTMLHandler.escapeHTML$S = function (str) {
+ return str.replace(/\n/g, "<br/>").replace(/&/g, "&amp;").replace(/"/g, "&quot;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
+};
+
+var _HTMLHandler$escapeHTML$S = _HTMLHandler.escapeHTML$S;
+
+/**
+ * @param {!string} tagname
+ * @param {Object.<string, undefined|!string>} attributes
+ */
+_HTMLHandler.prototype.onopentag$SHS = function (tagname, attributes) {
+ this.text.push(this.styles[tagname][0]);
+};
+
+/**
+ * @param {!string} tagname
+ */
+_HTMLHandler.prototype.onclosetag$S = function (tagname) {
+ this.text.push(this.styles[tagname][1]);
+};
+
+/**
+ * @param {!string} text
+ */
+_HTMLHandler.prototype.ontext$S = function (text) {
+ if (this.escape) {
+ this.text.push(text.replace(/\n/g, "<br/>").replace(/&/g, "&amp;").replace(/"/g, "&quot;").replace(/</g, "&lt;").replace(/>/g, "&gt;"));
+ } else {
+ this.text.push(text);
+ }
+};
+
+/**
+ * @return {!string}
+ */
+_HTMLHandler.prototype.result$ = function () {
+ return this.text.join('');
+};
+
+/**
+ * class SAXParser extends Object
+ * @constructor
+ */
+function SAXParser() {
+}
+
+/**
+ * @constructor
+ * @param {SAXHandler} handler
+ */
+function SAXParser$LSAXHandler$(handler) {
+ this.q = "";
+ this.c = "";
+ this.bufferCheckPosition = 0;
+ this.looseCase = "";
+ this.tags = [ ];
+ this.closed = false;
+ this.closedRoot = false;
+ this.sawRoot = false;
+ this.tag = null;
+ this.error = null;
+ this.handler = null;
+ this.ENTITIES = null;
+ this.strict = false;
+ this.tagName = "";
+ this.state = 0;
+ this.line = 0;
+ this.column = 0;
+ this.position = 0;
+ this.startTagPosition = 0;
+ this.attribName = "";
+ this.attribValue = "";
+ this.script = "";
+ this.textNode = "";
+ this.attribList = null;
+ this.noscript = false;
+ this.cdata = "";
+ this.procInstBody = "";
+ this.procInstName = "";
+ this.doctype = "";
+ this.entity = "";
+ this.sgmlDecl = "";
+ this.comment = "";
+ this.preTags = 0;
+ this._init$LSAXHandler$B(handler, false);
+};
+
+SAXParser$LSAXHandler$.prototype = new SAXParser;
+
+/**
+ * @constructor
+ * @param {SAXHandler} handler
+ * @param {!boolean} strict
+ */
+function SAXParser$LSAXHandler$B(handler, strict) {
+ this.q = "";
+ this.c = "";
+ this.bufferCheckPosition = 0;
+ this.looseCase = "";
+ this.tags = [ ];
+ this.closed = false;
+ this.closedRoot = false;
+ this.sawRoot = false;
+ this.tag = null;
+ this.error = null;
+ this.handler = null;
+ this.ENTITIES = null;
+ this.strict = false;
+ this.tagName = "";
+ this.state = 0;
+ this.line = 0;
+ this.column = 0;
+ this.position = 0;
+ this.startTagPosition = 0;
+ this.attribName = "";
+ this.attribValue = "";
+ this.script = "";
+ this.textNode = "";
+ this.attribList = null;
+ this.noscript = false;
+ this.cdata = "";
+ this.procInstBody = "";
+ this.procInstName = "";
+ this.doctype = "";
+ this.entity = "";
+ this.sgmlDecl = "";
+ this.comment = "";
+ this.preTags = 0;
+ this._init$LSAXHandler$B(handler, strict);
+};
+
+SAXParser$LSAXHandler$B.prototype = new SAXParser;
+
+/**
+ * @param {SAXHandler} handler
+ * @param {!boolean} strict
+ */
+SAXParser.prototype._init$LSAXHandler$B = function (handler, strict) {
+ this.handler = handler;
+ this.clearBuffers$();
+ this.q = "";
+ this.bufferCheckPosition = 65536;
+ this.looseCase = 'toLowerCase';
+ this.tags = [ ];
+ this.closed = this.closedRoot = this.sawRoot = false;
+ this.tag = null;
+ this.error = null;
+ this.strict = strict;
+ this.noscript = strict;
+ this.state = 1;
+ this.ENTITIES = _Entities$entity_list$();
+ this.attribList = [ ];
+ this.noscript = false;
+ this.preTags = 0;
+};
+
+/**
+ * @param {!boolean} flag
+ */
+SAXParser.prototype.set_noscript$B = function (flag) {
+ this.noscript = flag;
+};
+
+/**
+ * @return {SAXParser}
+ */
+SAXParser.prototype.resume$ = function () {
+ this.error = null;
+ return this;
+};
+
+/**
+ * @return {SAXParser}
+ */
+SAXParser.prototype.close$ = function () {
+ return this.parse$S('');
+};
+
+/**
+ * @param {!string} chunk
+ * @return {SAXParser}
+ */
+SAXParser.prototype.parse$S = function (chunk) {
+ /** @type {Char} */
+ var _;
+ /** @type {!number} */
+ var i;
+ /** @type {!string} */
+ var c;
+ /** @type {!number} */
+ var starti;
+ /** @type {!number} */
+ var pad;
+ /** @type {!number} */
+ var returnState;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$0;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$1;
+ /** @type {RegExp} */
+ var charclass$2;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$3;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$4;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$5;
+ /** @type {!string} */
+ var text$0;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$6;
+ /** @type {RegExp} */
+ var charclass$7;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$8;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$9;
+ /** @type {RegExp} */
+ var charclass$10;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$11;
+ /** @type {RegExp} */
+ var charclass$12;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$13;
+ /** @type {RegExp} */
+ var charclass$14;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$15;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$16;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$17;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$18;
+ /** @type {RegExp} */
+ var charclass$19;
+ /** @type {RegExp} */
+ var charclass$20;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$21;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$22;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$23;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$24;
+ /** @type {!string} */
+ var comment$0;
+ _ = new Char$();
+ if (this.error) {
+ throw this.error;
+ }
+ if (this.closed) {
+ return this.emiterror$S("Cannot write after close. Assign an onready handler.");
+ }
+ (i = 0, c = "");
+ while (this.c = c = chunk.charAt(i++)) {
+ this.position++;
+ if (c === "\n") {
+ this.handler.line++;
+ this.handler.column = 0;
+ } else {
+ this.handler.column++;
+ }
+ switch (this.state) {
+ case 1:
+ if (c === "<") {
+ this.state = 4;
+ this.startTagPosition = this.position;
+ } else {
+ charclass$0 = _.whitespace;
+ if (! $__jsx_ObjectHasOwnProperty.call(charclass$0, c)) {
+ this.strictFail$S("Non-whitespace before first tag.");
+ this.textNode = c;
+ this.state = 2;
+ }
+ }
+ continue;
+ case 2:
+ if (this.sawRoot && ! this.closedRoot) {
+ starti = i - 1;
+ while (c && c !== "<" && c !== "&") {
+ c = chunk.charAt(i++);
+ if (c) {
+ this.position++;
+ if (c === "\n") {
+ this.handler.line++;
+ this.handler.column = 0;
+ } else {
+ this.handler.column++;
+ }
+ }
+ }
+ this.textNode += chunk.substring(starti, i - 1);
+ }
+ if (c === "<") {
+ this.state = 4;
+ this.startTagPosition = this.position;
+ } else {
+ if (_.not$HBS(_.whitespace, c) && (! this.sawRoot || this.closedRoot)) {
+ this.strictFail$S("Text data outside of root node.");
+ }
+ if (c === "&") {
+ this.state = 3;
+ } else {
+ this.textNode += c;
+ }
+ }
+ continue;
+ case 33:
+ if (c === "<") {
+ this.state = 34;
+ } else {
+ this.script += c;
+ }
+ continue;
+ case 34:
+ if (c === "/") {
+ this.state = 31;
+ } else {
+ this.script += "<" + c;
+ this.state = 33;
+ }
+ continue;
+ case 4:
+ if (c === "!") {
+ this.state = 5;
+ this.sgmlDecl = "";
+ } else {
+ charclass$1 = _.whitespace;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$1, c)) {
+ } else {
+ charclass$2 = _.nameStart;
+ if (charclass$2.test(c)) {
+ this.state = 21;
+ this.tagName = c;
+ } else {
+ if (c === "/") {
+ this.state = 31;
+ this.tagName = "";
+ } else {
+ if (c === "?") {
+ this.state = 18;
+ this.procInstName = this.procInstBody = "";
+ } else {
+ this.strictFail$S("Unencoded <");
+ if (this.startTagPosition + 1 < this.position) {
+ pad = this.position - this.startTagPosition;
+ for (i = 0; i < pad; i++) {
+ c = " " + c;
+ }
+ }
+ this.textNode += "<" + c;
+ this.state = 2;
+ }
+ }
+ }
+ }
+ }
+ continue;
+ case 5:
+ if ((this.sgmlDecl + c).toUpperCase() === _.CDATA) {
+ this.closetext_if_exist$();
+ this.state = 15;
+ this.sgmlDecl = "";
+ this.cdata = "";
+ } else {
+ if (this.sgmlDecl + c === "--") {
+ this.state = 12;
+ this.comment = "";
+ this.sgmlDecl = "";
+ } else {
+ if ((this.sgmlDecl + c).toUpperCase() === _.DOCTYPE) {
+ this.state = 7;
+ if (this.doctype || this.sawRoot) {
+ this.strictFail$S("Inappropriately located doctype declaration");
+ }
+ this.doctype = "";
+ this.sgmlDecl = "";
+ } else {
+ if (c === ">") {
+ this.closetext_if_exist$();
+ this.sgmlDecl = "";
+ this.state = 2;
+ } else {
+ charclass$3 = _.quote;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$3, c)) {
+ this.state = 6;
+ this.sgmlDecl += c;
+ } else {
+ this.sgmlDecl += c;
+ }
+ }
+ }
+ }
+ }
+ continue;
+ case 6:
+ if (c === this.q) {
+ this.state = 5;
+ this.q = "";
+ }
+ this.sgmlDecl += c;
+ continue;
+ case 7:
+ if (c === ">") {
+ this.state = 2;
+ this.closetext_if_exist$();
+ this.doctype.trim();
+ } else {
+ this.doctype += c;
+ if (c === "[") {
+ this.state = 9;
+ } else {
+ charclass$4 = _.quote;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$4, c)) {
+ this.state = 8;
+ this.q = c;
+ }
+ }
+ }
+ continue;
+ case 8:
+ this.doctype += c;
+ if (c === this.q) {
+ this.q = "";
+ this.state = 7;
+ }
+ continue;
+ case 9:
+ this.doctype += c;
+ if (c === "]") {
+ this.state = 7;
+ } else {
+ charclass$5 = _.quote;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$5, c)) {
+ this.state = 10;
+ this.q = c;
+ }
+ }
+ continue;
+ case 10:
+ this.doctype += c;
+ if (c === this.q) {
+ this.state = 9;
+ this.q = "";
+ }
+ continue;
+ case 12:
+ if (c === "-") {
+ this.state = 13;
+ } else {
+ this.comment += c;
+ }
+ continue;
+ case 13:
+ if (c === "-") {
+ this.state = 14;
+ text$0 = this.comment;
+ text$0 = text$0.replace(/[\n\t]/g, ' ');
+ text$0 = text$0.replace(/\s\s+/g, " ");
+ comment$0 = this.comment = text$0;
+ if (comment$0) {
+ this.closetext_if_exist$();
+ this.comment.trim();
+ }
+ this.comment = "";
+ } else {
+ this.comment += "-" + c;
+ this.state = 12;
+ }
+ continue;
+ case 14:
+ if (c !== ">") {
+ this.strictFail$S("Malformed comment");
+ this.comment += "--" + c;
+ this.state = 12;
+ } else {
+ this.state = 2;
+ }
+ continue;
+ case 15:
+ if (c === "]") {
+ this.state = 16;
+ } else {
+ this.cdata += c;
+ }
+ continue;
+ case 16:
+ if (c === "]") {
+ this.state = 17;
+ } else {
+ this.cdata += "]" + c;
+ this.state = 15;
+ }
+ continue;
+ case 17:
+ if (c === ">") {
+ if (this.cdata) {
+ this.closetext_if_exist$();
+ }
+ this.cdata = "";
+ this.state = 2;
+ } else {
+ if (c === "]") {
+ this.cdata += "]";
+ } else {
+ this.cdata += "]]" + c;
+ this.state = 15;
+ }
+ }
+ continue;
+ case 18:
+ if (c === "?") {
+ this.state = 20;
+ } else {
+ charclass$6 = _.whitespace;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$6, c)) {
+ this.state = 19;
+ } else {
+ this.procInstName += c;
+ }
+ }
+ continue;
+ case 19:
+ if (! this.procInstBody && _.is$HBS(_.whitespace, c)) {
+ continue;
+ } else {
+ if (c === "?") {
+ this.state = 20;
+ } else {
+ this.procInstBody += c;
+ }
+ }
+ continue;
+ case 20:
+ if (c === ">") {
+ this.closetext_if_exist$();
+ this.procInstName = this.procInstBody = "";
+ this.state = 2;
+ } else {
+ this.procInstBody += "?" + c;
+ this.state = 19;
+ }
+ continue;
+ case 21:
+ charclass$7 = _.nameBody;
+ if (charclass$7.test(c)) {
+ this.tagName += c;
+ } else {
+ this.newTag$();
+ if (c === ">") {
+ this.openTag$B(false);
+ } else {
+ if (c === "/") {
+ this.state = 22;
+ } else {
+ charclass$8 = _.whitespace;
+ if (! $__jsx_ObjectHasOwnProperty.call(charclass$8, c)) {
+ this.strictFail$S("Invalid character in tag name");
+ }
+ this.state = 23;
+ }
+ }
+ }
+ continue;
+ case 22:
+ if (c === ">") {
+ this.openTag$B(true);
+ this.closeTag$();
+ } else {
+ this.strictFail$S("Forward-slash in opening tag not followed by >");
+ this.state = 23;
+ }
+ continue;
+ case 23:
+ charclass$9 = _.whitespace;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$9, c)) {
+ continue;
+ } else {
+ if (c === ">") {
+ this.openTag$B(false);
+ } else {
+ if (c === "/") {
+ this.state = 22;
+ } else {
+ charclass$10 = _.nameStart;
+ if (charclass$10.test(c)) {
+ this.attribName = c;
+ this.attribValue = "";
+ this.state = 24;
+ } else {
+ this.strictFail$S("Invalid attribute name");
+ }
+ }
+ }
+ }
+ continue;
+ case 24:
+ if (c === "=") {
+ this.state = 26;
+ } else {
+ if (c === ">") {
+ this.strictFail$S("Attribute without value");
+ this.attribValue = this.attribName;
+ this.attrib$();
+ this.openTag$B(false);
+ } else {
+ charclass$11 = _.whitespace;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$11, c)) {
+ this.state = 25;
+ } else {
+ charclass$12 = _.nameBody;
+ if (charclass$12.test(c)) {
+ this.attribName += c;
+ } else {
+ this.strictFail$S("Invalid attribute name");
+ }
+ }
+ }
+ }
+ continue;
+ case 25:
+ if (c === "=") {
+ this.state = 26;
+ } else {
+ charclass$13 = _.whitespace;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$13, c)) {
+ continue;
+ } else {
+ this.strictFail$S("Attribute without value");
+ this.tag.attributes[this.attribName] = "";
+ this.attribValue = "";
+ this.closetext_if_exist$();
+ this.attribName = "";
+ if (c === ">") {
+ this.openTag$B(false);
+ } else {
+ charclass$14 = _.nameStart;
+ if (charclass$14.test(c)) {
+ this.attribName = c;
+ this.state = 24;
+ } else {
+ this.strictFail$S("Invalid attribute name");
+ this.state = 23;
+ }
+ }
+ }
+ }
+ continue;
+ case 26:
+ charclass$15 = _.whitespace;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$15, c)) {
+ continue;
+ } else {
+ charclass$16 = _.quote;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$16, c)) {
+ this.q = c;
+ this.state = 27;
+ } else {
+ this.strictFail$S("Unquoted attribute value");
+ this.state = 28;
+ this.attribValue = c;
+ }
+ }
+ continue;
+ case 27:
+ if (c !== this.q) {
+ if (c === "&") {
+ this.state = 29;
+ } else {
+ this.attribValue += c;
+ }
+ continue;
+ }
+ this.attrib$();
+ this.q = "";
+ this.state = 23;
+ continue;
+ case 28:
+ charclass$17 = _.attribEnd;
+ if (! $__jsx_ObjectHasOwnProperty.call(charclass$17, c)) {
+ if (c === "&") {
+ this.state = 30;
+ } else {
+ this.attribValue += c;
+ }
+ continue;
+ }
+ this.attrib$();
+ if (c === ">") {
+ this.openTag$B(false);
+ } else {
+ this.state = 23;
+ }
+ continue;
+ case 31:
+ if (! this.tagName) {
+ charclass$18 = _.whitespace;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$18, c)) {
+ continue;
+ } else {
+ charclass$19 = _.nameStart;
+ if (! charclass$19.test(c)) {
+ if (this.script) {
+ this.script += "</" + c;
+ this.state = 33;
+ } else {
+ this.strictFail$S("Invalid tagname in closing tag.");
+ }
+ } else {
+ this.tagName = c;
+ }
+ }
+ } else {
+ if (c === ">") {
+ this.closeTag$();
+ } else {
+ charclass$20 = _.nameBody;
+ if (charclass$20.test(c)) {
+ this.tagName += c;
+ } else {
+ if (this.script) {
+ this.script += "</" + this.tagName;
+ this.tagName = "";
+ this.state = 33;
+ } else {
+ charclass$21 = _.whitespace;
+ if (! $__jsx_ObjectHasOwnProperty.call(charclass$21, c)) {
+ this.strictFail$S("Invalid tagname in closing tag");
+ }
+ this.state = 32;
+ }
+ }
+ }
+ }
+ continue;
+ case 32:
+ charclass$22 = _.whitespace;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$22, c)) {
+ continue;
+ }
+ if (c === ">") {
+ this.closeTag$();
+ } else {
+ this.strictFail$S("Invalid characters in closing tag");
+ }
+ continue;
+ case 3:
+ if (c === ";") {
+ this.textNode += this.parseEntity$();
+ this.entity = "";
+ this.state = 2;
+ } else {
+ charclass$23 = _.entity;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$23, c)) {
+ this.entity += c;
+ } else {
+ this.strictFail$S("Invalid character entity");
+ this.textNode += "&" + this.entity + c;
+ this.entity = "";
+ this.state = 2;
+ }
+ }
+ continue;
+ case 29:
+ case 30:
+ if (this.state === 29) {
+ returnState = 27;
+ } else {
+ returnState = 28;
+ }
+ if (c === ";") {
+ this.attribValue += this.parseEntity$();
+ this.entity = "";
+ this.state = (returnState | 0);
+ } else {
+ charclass$24 = _.entity;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$24, c)) {
+ this.entity += c;
+ } else {
+ this.strictFail$S("Invalid character entity");
+ this.attribValue += "&" + this.entity + c;
+ this.entity = "";
+ this.state = (returnState | 0);
+ }
+ }
+ continue;
+ default:
+ throw new Error("Unknown state: " + (this.state + ""));
+ }
+ }
+ this.end$();
+ return this;
+};
+
+/**
+ */
+SAXParser.prototype.clearBuffers$ = function () {
+ this.comment = '';
+ this.sgmlDecl = '';
+ this.textNode = '';
+ this.tagName = '';
+ this.doctype = '';
+ this.procInstName = '';
+ this.procInstBody = '';
+ this.entity = '';
+ this.attribName = '';
+ this.attribValue = '';
+ this.cdata = '';
+ this.script = '';
+};
+
+/**
+ */
+SAXParser.prototype.closetext_if_exist$ = function () {
+ if (this.textNode !== '') {
+ this.closetext$();
+ }
+};
+
+/**
+ */
+SAXParser.prototype.closetext$ = function () {
+ /** @type {!string} */
+ var text;
+ /** @type {!string} */
+ var text$0;
+ if (this.preTags === 0) {
+ text$0 = this.textNode;
+ text$0 = text$0.replace(/[\n\t]/g, ' ');
+ text$0 = text$0.replace(/\s\s+/g, " ");
+ text = text$0;
+ if (text$0) {
+ this.handler.ontext$S(text);
+ }
+ } else {
+ if (this.textNode) {
+ this.handler.ontext$S(this.textNode);
+ }
+ }
+ this.textNode = "";
+};
+
+/**
+ * @param {!string} text
+ * @return {!string}
+ */
+SAXParser.prototype.textopts$S = function (text) {
+ text = text.replace(/[\n\t]/g, ' ');
+ text = text.replace(/\s\s+/g, " ");
+ return text;
+};
+
+/**
+ * @param {!string} er
+ * @return {SAXParser}
+ */
+SAXParser.prototype.emiterror$S = function (er) {
+ /** @type {Error} */
+ var error;
+ this.closetext$();
+ er += "\nLine: " + (this.line + "") + "\nColumn: " + (this.column + "") + "\nChar: " + this.c;
+ error = new Error(er);
+ this.error = error;
+ return this;
+};
+
+/**
+ */
+SAXParser.prototype.end$ = function () {
+ if (! this.closedRoot) {
+ this.strictFail$S("Unclosed root tag");
+ }
+ if (this.state !== 2) {
+ this.emiterror$S("Unexpected end");
+ }
+ this.closetext$();
+ this.c = "";
+ this.closed = true;
+};
+
+/**
+ * @param {!string} message
+ */
+SAXParser.prototype.strictFail$S = function (message) {
+ if (this.strict) {
+ this.emiterror$S(message);
+ }
+};
+
+/**
+ */
+SAXParser.prototype.newTag$ = function () {
+ if (! this.strict) {
+ this.tagName = this.tagName.toLowerCase();
+ }
+ this.tag = ({name: this.tagName, attributes: ({ }), isSelfClosing: false});
+ this.attribList.length = 0;
+};
+
+/**
+ */
+SAXParser.prototype.attrib$ = function () {
+ if (! this.strict) {
+ this.attribName = this.attribName.toLowerCase();
+ }
+ if ($__jsx_ObjectHasOwnProperty.call(this.tag.attributes, this.attribName)) {
+ this.attribName = this.attribValue = "";
+ return;
+ }
+ this.tag.attributes[this.attribName] = this.attribValue;
+ this.closetext_if_exist$();
+ this.attribName = this.attribValue = "";
+};
+
+/**
+ */
+SAXParser.prototype.openTag$ = function () {
+ this.openTag$B(false);
+};
+
+/**
+ * @param {!boolean} selfClosing
+ */
+SAXParser.prototype.openTag$B = function (selfClosing) {
+ /** @type {Tag} */
+ var tag$0;
+ /** @type {Tag} */
+ var tag$1;
+ (tag$0 = this.tag).isSelfClosing = selfClosing;
+ this.sawRoot = true;
+ this.tags.push(tag$0);
+ this.closetext_if_exist$();
+ this.handler.onopentag$SHS((tag$1 = this.tag).name, tag$1.attributes);
+ if (this.tag.name === 'pre') {
+ this.preTags++;
+ }
+ if (! selfClosing) {
+ if (! this.noscript && this.tagName.toLowerCase() === "script") {
+ this.state = 33;
+ } else {
+ this.state = 2;
+ }
+ this.tag = null;
+ this.tagName = "";
+ }
+ this.attribName = this.attribValue = "";
+ this.attribList.length = 0;
+};
+
+/**
+ */
+SAXParser.prototype.closeTag$ = function () {
+ /** @type {!number} */
+ var t;
+ /** @type {!string} */
+ var tagName;
+ /** @type {!string} */
+ var closeTo;
+ /** @type {Tag} */
+ var close;
+ /** @type {!number} */
+ var s;
+ /** @type {Tag} */
+ var tag$0;
+ if (! this.tagName) {
+ this.strictFail$S("Weird empty close tag.");
+ this.textNode += "</>";
+ this.state = 2;
+ return;
+ }
+ if (this.script) {
+ if (this.tagName !== "script") {
+ this.script += "</" + this.tagName + ">";
+ this.tagName = "";
+ this.state = 33;
+ return;
+ }
+ this.closetext_if_exist$();
+ this.script = "";
+ }
+ t = this.tags.length;
+ tagName = this.tagName;
+ if (! this.strict) {
+ tagName = tagName.toLowerCase();
+ }
+ closeTo = tagName;
+ while (t--) {
+ close = this.tags[t];
+ if (close.name !== closeTo) {
+ this.strictFail$S("Unexpected close tag");
+ } else {
+ break;
+ }
+ }
+ if (t < 0) {
+ this.strictFail$S("Unmatched closing tag: " + this.tagName);
+ this.textNode += "</" + this.tagName + ">";
+ this.state = 2;
+ return;
+ }
+ this.tagName = tagName;
+ s = this.tags.length;
+ while (s-- > t) {
+ tag$0 = this.tag = this.tags.pop();
+ this.tagName = tag$0.name;
+ this.closetext_if_exist$();
+ this.handler.onclosetag$S(this.tagName);
+ if (this.tagName === 'pre') {
+ this.preTags--;
+ }
+ }
+ if (t === 0) {
+ this.closedRoot = true;
+ }
+ this.tagName = this.attribValue = this.attribName = "";
+ this.attribList.length = 0;
+ this.state = 2;
+};
+
+/**
+ * @return {!string}
+ */
+SAXParser.prototype.parseEntity$ = function () {
+ /** @type {!string} */
+ var entity;
+ /** @type {!string} */
+ var entityLC;
+ /** @type {!number} */
+ var num;
+ /** @type {!string} */
+ var numStr;
+ entity = this.entity;
+ entityLC = entity.toLowerCase();
+ num = 0;
+ numStr = "";
+ if (this.ENTITIES[entity]) {
+ return this.ENTITIES[entity];
+ }
+ if (this.ENTITIES[entityLC]) {
+ return this.ENTITIES[entityLC];
+ }
+ entity = entityLC;
+ if (entityLC.charAt(0) === "#") {
+ if (entity.charAt(1) === "x") {
+ entity = entity.slice(2);
+ num = $__jsx_parseInt(entity, 16);
+ numStr = num.toString(16);
+ } else {
+ entity = entity.slice(1);
+ num = $__jsx_parseInt(entity, 10);
+ numStr = num.toString(10);
+ }
+ }
+ entity = entity.replace(/^0+/, "");
+ if (numStr.toLowerCase() !== entity) {
+ this.strictFail$S("Invalid character entity");
+ return "&" + this.entity + ";";
+ }
+ return String.fromCharCode(num);
+};
+
+/**
+ * class Char extends Object
+ * @constructor
+ */
+function Char() {
+}
+
+/**
+ * @constructor
+ */
+function Char$() {
+ this.CDATA = "[CDATA[";
+ this.DOCTYPE = "DOCTYPE";
+ this.XML_NAMESPACE = "http://www.w3.org/XML/1998/namespace";
+ this.whitespace = this._charClass$S("\r\n\t ");
+ this.number = this._charClass$S("0124356789");
+ this.letter = this._charClass$S("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ");
+ this.quote = this._charClass$S("'\"");
+ this.entity = this._charClass$S("0124356789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ#");
+ this.attribEnd = this._charClass$S("\r\n\t >");
+ this.nameStart = /[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/;
+ this.nameBody = /[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040\.\d-]/;
+};
+
+Char$.prototype = new Char;
+
+/**
+ * @param {!string} str
+ * @return {Object.<string, undefined|!boolean>}
+ */
+Char.prototype._charClass$S = function (str) {
+ /** @type {Object.<string, undefined|!boolean>} */
+ var result;
+ /** @type {!number} */
+ var i;
+ result = ({ });
+ for (i = 0; i < str.length; i++) {
+ result[str.slice(i, i + 1)] = true;
+ }
+ return result;
+};
+
+/**
+ * @param {RegExp} charclass
+ * @param {!string} c
+ * @return {!boolean}
+ */
+Char.prototype.is$LRegExp$S = function (charclass, c) {
+ return charclass.test(c);
+};
+
+/**
+ * @param {Object.<string, undefined|!boolean>} charclass
+ * @param {!string} c
+ * @return {!boolean}
+ */
+Char.prototype.is$HBS = function (charclass, c) {
+ return $__jsx_ObjectHasOwnProperty.call(charclass, c);
+};
+
+/**
+ * @param {RegExp} charclass
+ * @param {!string} c
+ * @return {!boolean}
+ */
+Char.prototype.not$LRegExp$S = function (charclass, c) {
+ return ! charclass.test(c);
+};
+
+/**
+ * @param {Object.<string, undefined|!boolean>} charclass
+ * @param {!string} c
+ * @return {!boolean}
+ */
+Char.prototype.not$HBS = function (charclass, c) {
+ return ! $__jsx_ObjectHasOwnProperty.call(charclass, c);
+};
+
+/**
+ * class _Entities extends Object
+ * @constructor
+ */
+function _Entities() {
+}
+
+/**
+ * @constructor
+ */
+function _Entities$() {
+};
+
+_Entities$.prototype = new _Entities;
+
+/**
+ * @return {Object.<string, undefined|!string>}
+ */
+_Entities.entity_list$ = function () {
+ /** @type {Object.<string, undefined|!string>} */
+ var result;
+ /** @type {!string} */
+ var key;
+ /** @type {*} */
+ var value;
+ result = ({ });
+ for (key in _Entities._entities) {
+ value = _Entities._entities[key];
+ if (typeof value === 'string') {
+ result[key] = value + "";
+ } else {
+ if (typeof value === 'number') {
+ result[key] = String.fromCharCode(value | 0);
+ }
+ }
+ }
+ return result;
+};
+
+var _Entities$entity_list$ = _Entities.entity_list$;
+
+/**
+ * class BitVector extends Object
+ * @constructor
+ */
+function BitVector() {
+}
+
+/**
+ * @constructor
+ */
+function BitVector$() {
+ /** @type {Array.<undefined|!number>} */
+ var _v$0;
+ /** @type {Array.<undefined|!number>} */
+ var _r$0;
+ _r$0 = this._r = [ ];
+ _v$0 = this._v = [ ];
+ _v$0.length = 0;
+ _r$0.length = 0;
+ this._size = 0;
+ this._size1 = 0;
+};
+
+BitVector$.prototype = new BitVector;
+
+/**
+ */
+BitVector.prototype.build$ = function () {
+ /** @type {!number} */
+ var i;
+ this._size1 = 0;
+ for (i = 0; i < this._v.length; i++) {
+ if (i % 8 === 0) {
+ this._r.push(true ? this._size1 : this._size - this._size1);
+ }
+ this._size1 += this._rank32$IIB(this._v[i], 32, true);
+ }
+};
+
+/**
+ */
+BitVector.prototype.clear$ = function () {
+ this._v.length = 0;
+ this._r.length = 0;
+ this._size = 0;
+ this._size1 = 0;
+};
+
+/**
+ * @return {!number}
+ */
+BitVector.prototype.size$ = function () {
+ return this._size;
+};
+
+/**
+ * @param {!boolean} b
+ * @return {!number}
+ */
+BitVector.prototype.size$B = function (b) {
+ return (b ? this._size1 : this._size - this._size1);
+};
+
+/**
+ * @param {!number} value
+ */
+BitVector.prototype.set$I = function (value) {
+ this.set$IB(value, true);
+};
+
+/**
+ * @param {!number} value
+ * @param {!boolean} flag
+ */
+BitVector.prototype.set$IB = function (value, flag) {
+ /** @type {!number} */
+ var q;
+ /** @type {!number} */
+ var r;
+ /** @type {!number} */
+ var m;
+ if (value >= this._size) {
+ this._size = (value + 1 | 0);
+ }
+ q = (value / 32 | 0);
+ r = (value % 32 | 0);
+ while (q >= this._v.length) {
+ this._v.push(0);
+ }
+ m = 0x1 << r;
+ if (flag) {
+ this._v[q] |= m;
+ } else {
+ this._v[q] &= ~ m;
+ }
+};
+
+/**
+ * @param {!number} value
+ * @return {!boolean}
+ */
+BitVector.prototype.get$I = function (value) {
+ /** @type {!number} */
+ var q;
+ /** @type {!number} */
+ var r;
+ /** @type {!number} */
+ var m;
+ if (value >= this._size) {
+ throw new Error("BitVector.get() : range error");
+ }
+ q = (value / 32 | 0);
+ r = (value % 32 | 0);
+ m = 0x1 << r;
+ return !! (this._v[q] & m);
+};
+
+/**
+ * @param {!number} i
+ * @return {!number}
+ */
+BitVector.prototype.rank$I = function (i) {
+ return this.rank$IB(i, true);
+};
+
+/**
+ * @param {!number} i
+ * @param {!boolean} b
+ * @return {!number}
+ */
+BitVector.prototype.rank$IB = function (i, b) {
+ /** @type {!number} */
+ var q_large;
+ /** @type {!number} */
+ var q_small;
+ /** @type {!number} */
+ var r;
+ /** @type {!number} */
+ var rank;
+ /** @type {!number} */
+ var begin;
+ /** @type {!number} */
+ var j;
+ if (i > this._size) {
+ throw new Error("BitVector.rank() : range error");
+ }
+ if (i === 0) {
+ return 0;
+ }
+ i--;
+ q_large = (Math.floor(i / 256) | 0);
+ q_small = (Math.floor(i / 32) | 0);
+ r = (Math.floor(i % 32) | 0);
+ rank = (this._r[q_large] | 0);
+ if (! b) {
+ rank = q_large * 256 - rank;
+ }
+ begin = q_large * 8;
+ for (j = begin; j < q_small; j++) {
+ rank += this._rank32$IIB(this._v[j], 32, b);
+ }
+ rank += this._rank32$IIB(this._v[q_small], r + 1, b);
+ return rank;
+};
+
+/**
+ * @param {!number} i
+ * @return {!number}
+ */
+BitVector.prototype.select$I = function (i) {
+ return this.select$IB(i, true);
+};
+
+/**
+ * @param {!number} i
+ * @param {!boolean} b
+ * @return {!number}
+ */
+BitVector.prototype.select$IB = function (i, b) {
+ /** @type {!number} */
+ var left;
+ /** @type {!number} */
+ var right;
+ /** @type {!number} */
+ var pivot;
+ /** @type {undefined|!number} */
+ var rank;
+ /** @type {!number} */
+ var j;
+ if (i >= (b ? this._size1 : this._size - this._size1)) {
+ throw new Error("BitVector.select() : range error");
+ }
+ left = 0;
+ right = this._r.length;
+ while (left < right) {
+ pivot = Math.floor((left + right) / 2);
+ rank = this._r[pivot];
+ if (! b) {
+ rank = pivot * 256 - rank;
+ }
+ if (i < rank) {
+ right = pivot;
+ } else {
+ left = pivot + 1;
+ }
+ }
+ right--;
+ if (b) {
+ i -= (this._r[right] | 0);
+ } else {
+ i -= (right * 256 - this._r[right] | 0);
+ }
+ j = right * 8;
+ while (1) {
+ rank = this._rank32$IIB(this._v[j], 32, b);
+ if (i < rank) {
+ break;
+ }
+ j++;
+ i -= (rank | 0);
+ }
+ return (j * 32 + this._select32$IIB(this._v[j], i, b) | 0);
+};
+
+/**
+ * @param {!number} x
+ * @param {!number} i
+ * @param {!boolean} b
+ * @return {!number}
+ */
+BitVector.prototype._rank32$IIB = function (x, i, b) {
+ if (! b) {
+ x = ~ x;
+ }
+ x <<= 32 - i;
+ x = ((x & 0xaaaaaaaa) >>> 1) + (x & 0x55555555);
+ x = ((x & 0xcccccccc) >>> 2) + (x & 0x33333333);
+ x = ((x & 0xf0f0f0f0) >>> 4) + (x & 0x0f0f0f0f);
+ x = ((x & 0xff00ff00) >>> 8) + (x & 0x00ff00ff);
+ x = ((x & 0xffff0000) >>> 16) + (x & 0x0000ffff);
+ return x;
+};
+
+/**
+ * @param {!number} x
+ * @param {!number} i
+ * @param {!boolean} b
+ * @return {!number}
+ */
+BitVector.prototype._select32$IIB = function (x, i, b) {
+ /** @type {!number} */
+ var x1;
+ /** @type {!number} */
+ var x2;
+ /** @type {!number} */
+ var x3;
+ /** @type {!number} */
+ var x4;
+ /** @type {!number} */
+ var x5;
+ /** @type {!number} */
+ var pos;
+ /** @type {!number} */
+ var v5;
+ /** @type {!number} */
+ var v4;
+ /** @type {!number} */
+ var v3;
+ /** @type {!number} */
+ var v2;
+ /** @type {!number} */
+ var v1;
+ /** @type {!number} */
+ var v0;
+ if (! b) {
+ x = ~ x;
+ }
+ x1 = ((x & 0xaaaaaaaa) >>> 1) + (x & 0x55555555);
+ x2 = ((x1 & 0xcccccccc) >>> 2) + (x1 & 0x33333333);
+ x3 = ((x2 & 0xf0f0f0f0) >>> 4) + (x2 & 0x0f0f0f0f);
+ x4 = ((x3 & 0xff00ff00) >>> 8) + (x3 & 0x00ff00ff);
+ x5 = ((x4 & 0xffff0000) >>> 16) + (x4 & 0x0000ffff);
+ i++;
+ pos = 0;
+ v5 = x5 & 0xffffffff;
+ if (i > v5) {
+ i -= (v5 | 0);
+ pos += 32;
+ }
+ v4 = x4 >>> pos & 0x0000ffff;
+ if (i > v4) {
+ i -= (v4 | 0);
+ pos += 16;
+ }
+ v3 = x3 >>> pos & 0x000000ff;
+ if (i > v3) {
+ i -= (v3 | 0);
+ pos += 8;
+ }
+ v2 = x2 >>> pos & 0x0000000f;
+ if (i > v2) {
+ i -= (v2 | 0);
+ pos += 4;
+ }
+ v1 = x1 >>> pos & 0x00000003;
+ if (i > v1) {
+ i -= (v1 | 0);
+ pos += 2;
+ }
+ v0 = x >>> pos & 0x00000001;
+ if (i > v0) {
+ i -= (v0 | 0);
+ pos += 1;
+ }
+ return (pos | 0);
+};
+
+/**
+ * @return {!string}
+ */
+BitVector.prototype.dump$ = function () {
+ /** @type {Array.<undefined|!string>} */
+ var contents;
+ contents = [ ];
+ contents.push(Binary$dump32bitNumber$N(this._size));
+ contents.push(Binary$dump32bitNumberList$AN(this._v));
+ return contents.join('');
+};
+
+/**
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+BitVector.prototype.dump$LCompressionReport$ = function (report) {
+ /** @type {Array.<undefined|!string>} */
+ var contents;
+ contents = [ ];
+ contents.push(Binary$dump32bitNumber$N(this._size));
+ CompressionReport$add$LCompressionReport$II(report, 2, 2);
+ contents.push(Binary$dump32bitNumberList$ANLCompressionReport$(this._v, report));
+ return contents.join('');
+};
+
+/**
+ * @param {!string} data
+ * @return {!number}
+ */
+BitVector.prototype.load$S = function (data) {
+ return this.load$SI(data, 0);
+};
+
+/**
+ * @param {!string} data
+ * @param {!number} offset
+ * @return {!number}
+ */
+BitVector.prototype.load$SI = function (data, offset) {
+ /** @type {LoadedNumberListResult} */
+ var result;
+ /** @type {!number} */
+ var result$0;
+ this._v.length = 0;
+ this._r.length = 0;
+ this._size = 0;
+ this._size1 = 0;
+ result$0 = data.charCodeAt(offset) * 65536 + data.charCodeAt(offset + 1);
+ this._size = (result$0 | 0);
+ result = Binary$load32bitNumberList$SI(data, offset + 2);
+ this._v = result.result;
+ this.build$();
+ return result.offset;
+};
+
+/**
+ * class WaveletMatrix extends Object
+ * @constructor
+ */
+function WaveletMatrix() {
+}
+
+/**
+ * @constructor
+ */
+function WaveletMatrix$() {
+ /** @type {Array.<undefined|BitVector>} */
+ var _bv$0;
+ /** @type {Array.<undefined|!number>} */
+ var _seps$0;
+ this._range = ({ });
+ _bv$0 = this._bv = [ ];
+ _seps$0 = this._seps = [ ];
+ this._bitsize = 16;
+ _bv$0.length = 0;
+ _seps$0.length = 0;
+ this._size = 0;
+};
+
+WaveletMatrix$.prototype = new WaveletMatrix;
+
+/**
+ * @return {!number}
+ */
+WaveletMatrix.prototype.bitsize$ = function () {
+ return this._bitsize;
+};
+
+/**
+ * @param {!number} charCode
+ */
+WaveletMatrix.prototype.setMaxCharCode$I = function (charCode) {
+ this._bitsize = (Math.ceil(Math.log(charCode) / 0.6931471805599453) | 0);
+};
+
+/**
+ */
+WaveletMatrix.prototype.clear$ = function () {
+ this._bv.length = 0;
+ this._seps.length = 0;
+ this._size = 0;
+};
+
+/**
+ * @param {!string} v
+ */
+WaveletMatrix.prototype.build$S = function (v) {
+ /** @type {!number} */
+ var size;
+ /** @type {!number} */
+ var bitsize;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var depth;
+ /** @type {Object.<string, undefined|!number>} */
+ var range_tmp;
+ /** @type {!number} */
+ var code;
+ /** @type {!boolean} */
+ var bit;
+ /** @type {!number} */
+ var key;
+ /** @type {Object.<string, undefined|!number>} */
+ var range_rev;
+ /** @type {!string} */
+ var range_key;
+ /** @type {!number} */
+ var value;
+ /** @type {!number} */
+ var pos0;
+ /** @type {undefined|!number} */
+ var pos1;
+ /** @type {!string} */
+ var range_rev_key;
+ /** @type {!number} */
+ var begin;
+ /** @type {undefined|!number} */
+ var end;
+ /** @type {!number} */
+ var num0;
+ /** @type {!number} */
+ var num1;
+ this._bv.length = 0;
+ this._seps.length = 0;
+ this._size = 0;
+ size = v.length;
+ bitsize = this._bitsize;
+ for (i = 0; i < bitsize; i++) {
+ this._bv.push(new BitVector$());
+ this._seps.push(0);
+ }
+ this._size = (size | 0);
+ for (i = 0; i < size; i++) {
+ this._bv[0].set$IB(i, this._uint2bit$II(v.charCodeAt(i), 0));
+ }
+ this._bv[0].build$();
+ this._seps[0] = this._bv[0].size$B(false);
+ this._range["0"] = 0;
+ this._range["1"] = this._seps[0];
+ depth = 1;
+ while (depth < bitsize) {
+ range_tmp = WaveletMatrix$_shallow_copy$HI(this._range);
+ for (i = 0; i < size; i++) {
+ code = v.charCodeAt(i);
+ bit = this._uint2bit$II(code, depth);
+ key = code >>> bitsize - depth;
+ this._bv[depth].set$IB(range_tmp[key + ""], bit);
+ range_tmp[key + ""]++;
+ }
+ this._bv[depth].build$();
+ this._seps[depth] = this._bv[depth].size$B(false);
+ range_rev = ({ });
+ for (range_key in this._range) {
+ value = this._range[range_key];
+ if (value != range_tmp[range_key]) {
+ range_rev[value + ""] = range_key | 0;
+ }
+ }
+ this._range = ({ });
+ pos0 = 0;
+ pos1 = this._seps[depth];
+ for (range_rev_key in range_rev) {
+ begin = range_rev_key | 0;
+ value = range_rev[range_rev_key];
+ end = range_tmp[value + ""];
+ num0 = this._bv[depth].rank$IB(end, false) - this._bv[depth].rank$IB(begin, false);
+ num1 = end - begin - num0;
+ if (num0 > 0) {
+ this._range[(value << 1) + ""] = (pos0 | 0);
+ pos0 += num0;
+ }
+ if (num1 > 0) {
+ this._range[(value << 1) + 1 + ""] = pos1;
+ pos1 += (num1 | 0);
+ }
+ }
+ depth++;
+ }
+};
+
+/**
+ * @return {!number}
+ */
+WaveletMatrix.prototype.size$ = function () {
+ return this._size;
+};
+
+/**
+ * @param {!number} c
+ * @return {!number}
+ */
+WaveletMatrix.prototype.size$I = function (c) {
+ return this.rank$II(this._size, c);
+};
+
+/**
+ * @param {!number} i
+ * @return {!number}
+ */
+WaveletMatrix.prototype.get$I = function (i) {
+ /** @type {!number} */
+ var value;
+ /** @type {!number} */
+ var depth;
+ /** @type {!boolean} */
+ var bit;
+ if (i >= this._size) {
+ throw new Error("WaveletMatrix.get() : range error");
+ }
+ value = 0;
+ depth = 0;
+ while (depth < this._bitsize) {
+ bit = this._bv[depth].get$I(i);
+ i = this._bv[depth].rank$IB(i, bit);
+ value <<= 1;
+ if (bit) {
+ i += this._seps[depth];
+ value += 1;
+ }
+ depth++;
+ }
+ return (value | 0);
+};
+
+/**
+ * @param {!number} i
+ * @param {!number} c
+ * @return {!number}
+ */
+WaveletMatrix.prototype.rank$II = function (i, c) {
+ /** @type {undefined|!number} */
+ var begin;
+ /** @type {!number} */
+ var end;
+ /** @type {!number} */
+ var depth;
+ /** @type {!boolean} */
+ var bit;
+ if (i > this._size) {
+ throw new Error("WaveletMatrix.rank(): range error");
+ }
+ if (i === 0) {
+ return 0;
+ }
+ begin = this._range[c + ""];
+ if (begin == null) {
+ return 0;
+ }
+ end = i;
+ depth = 0;
+ while (depth < this._bitsize) {
+ bit = this._uint2bit$II(c, depth);
+ end = this._bv[depth].rank$IB(end, bit);
+ if (bit) {
+ end += this._seps[depth];
+ }
+ depth++;
+ }
+ return (end - begin | 0);
+};
+
+/**
+ * @param {!number} i
+ * @param {!number} c
+ * @return {!number}
+ */
+WaveletMatrix.prototype.rank_less_than$II = function (i, c) {
+ /** @type {!number} */
+ var begin;
+ /** @type {!number} */
+ var end;
+ /** @type {!number} */
+ var depth;
+ /** @type {!number} */
+ var rlt;
+ /** @type {!number} */
+ var rank0_begin;
+ /** @type {!number} */
+ var rank0_end;
+ /** @type {Array.<undefined|!number>} */
+ var _seps$0;
+ if (i > this._size) {
+ throw new Error("WaveletMatrix.rank_less_than(): range error");
+ }
+ if (i === 0) {
+ return 0;
+ }
+ begin = 0;
+ end = i;
+ depth = 0;
+ rlt = 0;
+ while (depth < this._bitsize) {
+ rank0_begin = this._bv[depth].rank$IB(begin, false);
+ rank0_end = this._bv[depth].rank$IB(end, false);
+ if (this._uint2bit$II(c, depth)) {
+ rlt += rank0_end - rank0_begin;
+ begin += (_seps$0 = this._seps)[depth] - rank0_begin;
+ end += _seps$0[depth] - rank0_end;
+ } else {
+ begin = rank0_begin;
+ end = rank0_end;
+ }
+ depth++;
+ }
+ return (rlt | 0);
+};
+
+/**
+ * @return {!string}
+ */
+WaveletMatrix.prototype.dump$ = function () {
+ /** @type {Array.<undefined|!string>} */
+ var contents;
+ /** @type {!number} */
+ var i;
+ /** @type {Array.<undefined|!string>} */
+ var range_contents;
+ /** @type {!number} */
+ var counter;
+ /** @type {!string} */
+ var key;
+ contents = [ Binary$dump16bitNumber$I(this._bitsize), Binary$dump32bitNumber$N(this._size) ];
+ for (i = 0; i < this._bitsize; i++) {
+ contents.push(this._bv[i].dump$());
+ }
+ for (i = 0; i < this._bitsize; i++) {
+ contents.push(Binary$dump32bitNumber$N(this._seps[i]));
+ }
+ range_contents = [ ];
+ counter = 0;
+ for (key in this._range) {
+ range_contents.push(Binary$dump32bitNumber$N(key | 0));
+ range_contents.push(Binary$dump32bitNumber$N(this._range[key]));
+ counter++;
+ }
+ contents.push(Binary$dump32bitNumber$N(counter));
+ return contents.join('') + range_contents.join('');
+};
+
+/**
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+WaveletMatrix.prototype.dump$LCompressionReport$ = function (report) {
+ /** @type {Array.<undefined|!string>} */
+ var contents;
+ /** @type {!number} */
+ var i;
+ /** @type {Array.<undefined|!string>} */
+ var range_contents;
+ /** @type {!number} */
+ var counter;
+ /** @type {!string} */
+ var key;
+ contents = [ Binary$dump16bitNumber$I(this._bitsize), Binary$dump32bitNumber$N(this._size) ];
+ CompressionReport$add$LCompressionReport$II(report, 3, 3);
+ for (i = 0; i < this._bitsize; i++) {
+ contents.push(this._bv[i].dump$LCompressionReport$(report));
+ }
+ for (i = 0; i < this._bitsize; i++) {
+ contents.push(Binary$dump32bitNumber$N(this._seps[i]));
+ CompressionReport$add$LCompressionReport$II(report, 2, 2);
+ }
+ range_contents = [ ];
+ counter = 0;
+ for (key in this._range) {
+ range_contents.push(Binary$dump32bitNumber$N(key | 0));
+ range_contents.push(Binary$dump32bitNumber$N(this._range[key]));
+ CompressionReport$add$LCompressionReport$II(report, 4, 4);
+ counter++;
+ }
+ CompressionReport$add$LCompressionReport$II(report, 2, 2);
+ contents.push(Binary$dump32bitNumber$N(counter));
+ return contents.join('') + range_contents.join('');
+};
+
+/**
+ * @param {!string} data
+ * @return {!number}
+ */
+WaveletMatrix.prototype.load$S = function (data) {
+ return this.load$SI(data, 0);
+};
+
+/**
+ * @param {!string} data
+ * @param {!number} offset
+ * @return {!number}
+ */
+WaveletMatrix.prototype.load$SI = function (data, offset) {
+ /** @type {!number} */
+ var i;
+ /** @type {BitVector} */
+ var bit_vector;
+ /** @type {!number} */
+ var range_size;
+ /** @type {!number} */
+ var value;
+ /** @type {!number} */
+ var offset$0;
+ /** @type {!number} */
+ var result$0;
+ /** @type {!number} */
+ var result$1;
+ /** @type {!number} */
+ var result$2;
+ this._bv.length = 0;
+ this._seps.length = 0;
+ this._size = 0;
+ offset$0 = offset++;
+ this._bitsize = (data.charCodeAt(offset$0) | 0);
+ result$0 = data.charCodeAt(offset) * 65536 + data.charCodeAt(offset + 1);
+ this._size = (result$0 | 0);
+ offset += 2;
+ for (i = 0; i < this._bitsize; i++) {
+ bit_vector = new BitVector$();
+ offset = bit_vector.load$SI(data, offset);
+ this._bv.push(bit_vector);
+ }
+ for (i = 0; i < this._bitsize; (i++, offset += 2)) {
+ this._seps.push(Binary$load32bitNumber$SI(data, offset));
+ }
+ result$1 = data.charCodeAt(offset) * 65536 + data.charCodeAt(offset + 1);
+ range_size = result$1;
+ offset += 2;
+ for (i = 0; i < range_size; (i++, offset += 4)) {
+ result$2 = data.charCodeAt(offset) * 65536 + data.charCodeAt(offset + 1);
+ value = Binary$load32bitNumber$SI(data, offset + 2);
+ this._range[result$2 + ""] = (value | 0);
+ }
+ return offset;
+};
+
+/**
+ * @param {Object.<string, undefined|!number>} input
+ * @return {Object.<string, undefined|!number>}
+ */
+WaveletMatrix._shallow_copy$HI = function (input) {
+ /** @type {Object.<string, undefined|!number>} */
+ var result;
+ /** @type {!string} */
+ var key;
+ result = ({ });
+ for (key in input) {
+ result[key] = input[key];
+ }
+ return result;
+};
+
+var WaveletMatrix$_shallow_copy$HI = WaveletMatrix._shallow_copy$HI;
+
+/**
+ * @param {!number} c
+ * @param {!number} i
+ * @return {!boolean}
+ */
+WaveletMatrix.prototype._uint2bit$II = function (c, i) {
+ return (c >>> this._bitsize - 1 - i & 0x1) === 0x1;
+};
+
+/**
+ * class BurrowsWheelerTransform extends Object
+ * @constructor
+ */
+function BurrowsWheelerTransform() {
+}
+
+/**
+ * @constructor
+ */
+function BurrowsWheelerTransform$() {
+ this._str = "";
+ this._size = 0;
+ this._head = 0;
+ this._suffixarray = [ ];
+};
+
+BurrowsWheelerTransform$.prototype = new BurrowsWheelerTransform;
+
+/**
+ * @param {BurrowsWheelerTransform} $this
+ * @return {!number}
+ */
+BurrowsWheelerTransform.size$LBurrowsWheelerTransform$ = function ($this) {
+ return $this._size;
+};
+
+var BurrowsWheelerTransform$size$LBurrowsWheelerTransform$ = BurrowsWheelerTransform.size$LBurrowsWheelerTransform$;
+
+/**
+ * @param {BurrowsWheelerTransform} $this
+ * @return {!number}
+ */
+BurrowsWheelerTransform.head$LBurrowsWheelerTransform$ = function ($this) {
+ return $this._head;
+};
+
+var BurrowsWheelerTransform$head$LBurrowsWheelerTransform$ = BurrowsWheelerTransform.head$LBurrowsWheelerTransform$;
+
+/**
+ * @param {BurrowsWheelerTransform} $this
+ */
+BurrowsWheelerTransform.clear$LBurrowsWheelerTransform$ = function ($this) {
+ $this._str = "";
+ $this._size = 0;
+ $this._head = 0;
+ $this._suffixarray.length = 0;
+};
+
+var BurrowsWheelerTransform$clear$LBurrowsWheelerTransform$ = BurrowsWheelerTransform.clear$LBurrowsWheelerTransform$;
+
+/**
+ * @param {BurrowsWheelerTransform} $this
+ * @param {!string} str
+ */
+BurrowsWheelerTransform.build$LBurrowsWheelerTransform$S = function ($this, str) {
+ /** @type {!string} */
+ var _str$0;
+ /** @type {Array.<undefined|!number>} */
+ var _suffixarray$0;
+ _str$0 = $this._str = str;
+ $this._size = _str$0.length;
+ _suffixarray$0 = $this._suffixarray = SAIS$make$S(str);
+ $this._head = (_suffixarray$0.indexOf(0) | 0);
+};
+
+var BurrowsWheelerTransform$build$LBurrowsWheelerTransform$S = BurrowsWheelerTransform.build$LBurrowsWheelerTransform$S;
+
+/**
+ * @param {BurrowsWheelerTransform} $this
+ * @param {!number} i
+ * @return {!string}
+ */
+BurrowsWheelerTransform.get$LBurrowsWheelerTransform$I = function ($this, i) {
+ /** @type {!number} */
+ var size;
+ /** @type {!number} */
+ var index;
+ size = $this._size;
+ if (i >= size) {
+ throw new Error("BurrowsWheelerTransform.get() : range error");
+ }
+ index = ($this._suffixarray[i] + size - 1) % size;
+ return $this._str.charAt(index);
+};
+
+var BurrowsWheelerTransform$get$LBurrowsWheelerTransform$I = BurrowsWheelerTransform.get$LBurrowsWheelerTransform$I;
+
+/**
+ * @param {BurrowsWheelerTransform} $this
+ * @return {!string}
+ */
+BurrowsWheelerTransform.get$LBurrowsWheelerTransform$ = function ($this) {
+ /** @type {Array.<undefined|!string>} */
+ var str;
+ /** @type {!number} */
+ var size;
+ /** @type {!number} */
+ var i;
+ str = [ ];
+ size = $this._size;
+ for (i = 0; i < size; i++) {
+ str.push(BurrowsWheelerTransform$get$LBurrowsWheelerTransform$I($this, i));
+ }
+ return str.join("");
+};
+
+var BurrowsWheelerTransform$get$LBurrowsWheelerTransform$ = BurrowsWheelerTransform.get$LBurrowsWheelerTransform$;
+
+/**
+ * @param {BurrowsWheelerTransform} $this
+ * @param {!string} replace
+ * @return {!string}
+ */
+BurrowsWheelerTransform.get$LBurrowsWheelerTransform$S = function ($this, replace) {
+ /** @type {!string} */
+ var result;
+ result = BurrowsWheelerTransform$get$LBurrowsWheelerTransform$($this);
+ return result.replace(BurrowsWheelerTransform.END_MARKER, replace);
+};
+
+var BurrowsWheelerTransform$get$LBurrowsWheelerTransform$S = BurrowsWheelerTransform.get$LBurrowsWheelerTransform$S;
+
+/**
+ * class OArray extends Object
+ * @constructor
+ */
+function OArray() {
+}
+
+/**
+ * @constructor
+ * @param {Array.<undefined|!number>} array
+ */
+function OArray$AI(array) {
+ this.array = array;
+ this.offset = 0;
+};
+
+OArray$AI.prototype = new OArray;
+
+/**
+ * @constructor
+ * @param {Array.<undefined|!number>} array
+ * @param {!number} offset
+ */
+function OArray$AII(array, offset) {
+ this.array = array;
+ this.offset = offset;
+};
+
+OArray$AII.prototype = new OArray;
+
+/**
+ * @param {OArray} $this
+ * @param {!number} index
+ * @return {!number}
+ */
+OArray.get$LOArray$I = function ($this, index) {
+ return $this.array[index + $this.offset];
+};
+
+var OArray$get$LOArray$I = OArray.get$LOArray$I;
+
+/**
+ * @param {OArray} $this
+ * @param {!number} index
+ * @param {!number} value
+ */
+OArray.set$LOArray$II = function ($this, index, value) {
+ $this.array[index + $this.offset] = value;
+};
+
+var OArray$set$LOArray$II = OArray.set$LOArray$II;
+
+/**
+ * @param {OArray} $this
+ * @param {!number} index
+ * @return {!boolean}
+ */
+OArray.isS$LOArray$I = function ($this, index) {
+ /** @type {Array.<undefined|!number>} */
+ var array$0;
+ /** @type {!number} */
+ var offset$0;
+ return (array$0 = $this.array)[index + (offset$0 = $this.offset)] < array$0[index + offset$0 + 1];
+};
+
+var OArray$isS$LOArray$I = OArray.isS$LOArray$I;
+
+/**
+ * @param {OArray} $this
+ * @param {!number} index1
+ * @param {!number} index2
+ * @return {!boolean}
+ */
+OArray.compare$LOArray$II = function ($this, index1, index2) {
+ /** @type {Array.<undefined|!number>} */
+ var array$0;
+ /** @type {!number} */
+ var offset$0;
+ return (array$0 = $this.array)[index1 + (offset$0 = $this.offset)] == array$0[index2 + offset$0];
+};
+
+var OArray$compare$LOArray$II = OArray.compare$LOArray$II;
+
+/**
+ * class SAIS extends Object
+ * @constructor
+ */
+function SAIS() {
+}
+
+/**
+ * @constructor
+ */
+function SAIS$() {
+};
+
+SAIS$.prototype = new SAIS;
+
+/**
+ * @param {BitVector} t
+ * @param {!number} i
+ * @return {!boolean}
+ */
+SAIS._isLMS$LBitVector$I = function (t, i) {
+ return i > 0 && t.get$I(i) && ! t.get$I(i - 1);
+};
+
+var SAIS$_isLMS$LBitVector$I = SAIS._isLMS$LBitVector$I;
+
+/**
+ * @param {OArray} s
+ * @param {Array.<undefined|!number>} bkt
+ * @param {!number} n
+ * @param {!number} K
+ * @param {!boolean} end
+ */
+SAIS._getBuckets$LOArray$AIIIB = function (s, bkt, n, K, end) {
+ /** @type {!number} */
+ var sum;
+ /** @type {!number} */
+ var i;
+ sum = 0;
+ for (i = 0; i <= K; i++) {
+ bkt[i] = 0;
+ }
+ for (i = 0; i < n; i++) {
+ bkt[OArray$get$LOArray$I(s, i)]++;
+ }
+ for (i = 0; i <= K; i++) {
+ sum += bkt[i];
+ bkt[i] = ((end ? sum : sum - bkt[i]) | 0);
+ }
+};
+
+var SAIS$_getBuckets$LOArray$AIIIB = SAIS._getBuckets$LOArray$AIIIB;
+
+/**
+ * @param {BitVector} t
+ * @param {Array.<undefined|!number>} SA
+ * @param {OArray} s
+ * @param {Array.<undefined|!number>} bkt
+ * @param {!number} n
+ * @param {!number} K
+ * @param {!boolean} end
+ */
+SAIS._induceSAl$LBitVector$AILOArray$AIIIB = function (t, SA, s, bkt, n, K, end) {
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var j;
+ SAIS$_getBuckets$LOArray$AIIIB(s, bkt, n, K, end);
+ for (i = 0; i < n; i++) {
+ j = SA[i] - 1;
+ if (j >= 0 && ! t.get$I(j)) {
+ SA[bkt[OArray$get$LOArray$I(s, j)]++] = (j | 0);
+ }
+ }
+};
+
+var SAIS$_induceSAl$LBitVector$AILOArray$AIIIB = SAIS._induceSAl$LBitVector$AILOArray$AIIIB;
+
+/**
+ * @param {BitVector} t
+ * @param {Array.<undefined|!number>} SA
+ * @param {OArray} s
+ * @param {Array.<undefined|!number>} bkt
+ * @param {!number} n
+ * @param {!number} K
+ * @param {!boolean} end
+ */
+SAIS._induceSAs$LBitVector$AILOArray$AIIIB = function (t, SA, s, bkt, n, K, end) {
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var j;
+ SAIS$_getBuckets$LOArray$AIIIB(s, bkt, n, K, end);
+ for (i = n - 1; i >= 0; i--) {
+ j = SA[i] - 1;
+ if (j >= 0 && t.get$I(j)) {
+ SA[-- bkt[OArray$get$LOArray$I(s, j)]] = (j | 0);
+ }
+ }
+};
+
+var SAIS$_induceSAs$LBitVector$AILOArray$AIIIB = SAIS._induceSAs$LBitVector$AILOArray$AIIIB;
+
+/**
+ * @param {!string} source
+ * @return {Array.<undefined|!number>}
+ */
+SAIS.make$S = function (source) {
+ /** @type {Array.<undefined|!number>} */
+ var charCodes;
+ /** @type {!number} */
+ var maxCode;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var code;
+ /** @type {Array.<undefined|!number>} */
+ var SA;
+ /** @type {OArray} */
+ var s;
+ charCodes = [ ];
+ charCodes.length = source.length;
+ maxCode = 0;
+ for (i = 0; i < source.length; i++) {
+ code = source.charCodeAt(i);
+ charCodes[i] = (code | 0);
+ maxCode = (code > maxCode ? code : maxCode);
+ }
+ SA = [ ];
+ SA.length = source.length;
+ s = ({offset: 0, array: charCodes});
+ SAIS$_make$LOArray$AIII(s, SA, source.length, maxCode);
+ return SA;
+};
+
+var SAIS$make$S = SAIS.make$S;
+
+/**
+ * @param {OArray} s
+ * @param {Array.<undefined|!number>} SA
+ * @param {!number} n
+ * @param {!number} K
+ */
+SAIS._make$LOArray$AIII = function (s, SA, n, K) {
+ /** @type {BitVector} */
+ var t;
+ /** @type {!number} */
+ var i;
+ /** @type {Array.<undefined|!number>} */
+ var bkt;
+ /** @type {!number} */
+ var n1;
+ /** @type {!number} */
+ var name;
+ /** @type {!number} */
+ var prev;
+ /** @type {undefined|!number} */
+ var pos;
+ /** @type {!boolean} */
+ var diff;
+ /** @type {!number} */
+ var d;
+ /** @type {!number} */
+ var j;
+ /** @type {Array.<undefined|!number>} */
+ var SA1;
+ /** @type {OArray} */
+ var s1;
+ /** @type {!number} */
+ var i$0;
+ /** @type {!number} */
+ var index$0;
+ t = new BitVector$();
+ t.set$IB(n - 2, false);
+ t.set$IB(n - 1, true);
+ for (i = n - 3; i >= 0; i--) {
+ t.set$IB(i, OArray$isS$LOArray$I(s, i) || OArray$compare$LOArray$II(s, i, i + 1) && t.get$I(i + 1));
+ }
+ bkt = [ ];
+ bkt.length = K + 1;
+ SAIS$_getBuckets$LOArray$AIIIB(s, bkt, n, K, true);
+ for (i = 0; i < n; i++) {
+ SA[i] = -1;
+ }
+ for (i = 1; i < n; i++) {
+ if (SAIS$_isLMS$LBitVector$I(t, i)) {
+ SA[-- bkt[OArray$get$LOArray$I(s, i)]] = (i | 0);
+ }
+ }
+ SAIS$_induceSAl$LBitVector$AILOArray$AIIIB(t, SA, s, bkt, n, K, false);
+ SAIS$_induceSAs$LBitVector$AILOArray$AIIIB(t, SA, s, bkt, n, K, true);
+ n1 = 0;
+ for (i = 0; i < n; i++) {
+ i$0 = SA[i];
+ if (i$0 > 0 && t.get$I(i$0) && ! t.get$I(i$0 - 1)) {
+ SA[n1++] = SA[i];
+ }
+ }
+ for (i = n1; i < n; i++) {
+ SA[i] = -1;
+ }
+ name = 0;
+ prev = -1;
+ for (i = 0; i < n1; i++) {
+ pos = SA[i];
+ diff = false;
+ for (d = 0; d < n; d++) {
+ if (prev === -1 || ! OArray$compare$LOArray$II(s, pos + d, prev + d) || t.get$I(pos + d) !== t.get$I(prev + d)) {
+ diff = true;
+ break;
+ } else {
+ if (d > 0 && (SAIS$_isLMS$LBitVector$I(t, pos + d) || SAIS$_isLMS$LBitVector$I(t, prev + d))) {
+ break;
+ }
+ }
+ }
+ if (diff) {
+ name++;
+ prev = pos;
+ }
+ pos = ((pos % 2 === 0 ? pos / 2 : (pos - 1) / 2) | 0);
+ SA[n1 + pos] = (name - 1 | 0);
+ }
+ for ((i = n - 1, j = n - 1); i >= n1; i--) {
+ if (SA[i] >= 0) {
+ SA[j--] = SA[i];
+ }
+ }
+ SA1 = SA;
+ s1 = ({offset: n - n1, array: SA});
+ if (name < n1) {
+ SAIS$_make$LOArray$AIII(s1, SA1, n1, name - 1);
+ } else {
+ for (i = 0; i < n1; i++) {
+ SA1[OArray$get$LOArray$I(s1, i)] = (i | 0);
+ }
+ }
+ bkt = [ ];
+ bkt.length = K + 1;
+ SAIS$_getBuckets$LOArray$AIIIB(s, bkt, n, K, true);
+ for ((i = 1, j = 0); i < n; i++) {
+ if (SAIS$_isLMS$LBitVector$I(t, i)) {
+ OArray$set$LOArray$II(s1, j++, i);
+ }
+ }
+ for (i = 0; i < n1; i++) {
+ index$0 = SA1[i];
+ SA1[i] = s1.array[index$0 + s1.offset];
+ }
+ for (i = n1; i < n; i++) {
+ SA[i] = -1;
+ }
+ for (i = n1 - 1; i >= 0; i--) {
+ j = SA[i];
+ SA[i] = -1;
+ SA[-- bkt[OArray$get$LOArray$I(s, j)]] = (j | 0);
+ }
+ SAIS$_induceSAl$LBitVector$AILOArray$AIIIB(t, SA, s, bkt, n, K, false);
+ SAIS$_induceSAs$LBitVector$AILOArray$AIIIB(t, SA, s, bkt, n, K, true);
+};
+
+var SAIS$_make$LOArray$AIII = SAIS._make$LOArray$AIII;
+
+OktaviaSearch._stemmer = null;
+OktaviaSearch._instance = null;
+$__jsx_lazy_init(Oktavia, "eof", function () {
+ return String.fromCharCode(0);
+});
+$__jsx_lazy_init(Oktavia, "eob", function () {
+ return String.fromCharCode(1);
+});
+$__jsx_lazy_init(Oktavia, "unknown", function () {
+ return String.fromCharCode(3);
+});
+Binary._base64EncodeChars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
+$__jsx_lazy_init(Binary, "_base64DecodeChars", function () {
+ return [ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 62, -1, -1, -1, 63, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, -1, -1, -1, -1, -1, -1, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -1, -1, -1, -1, -1, -1, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, -1, -1, -1, -1 ];
+});
+$__jsx_lazy_init(Style, "console", function () {
+ return ({ 'title': [ '\x1B[32m\x1b[4m', '\x1B[39m\x1b[0m' ], 'url': [ '\x1B[34m', '\x1B[39m' ], 'hit': [ '\x1B[4m', '\x1B[0m' ], 'del': [ '\x1B[9m', '\x1B[0m' ], 'summary': [ '\x1B[90m', '\x1B[39m' ] });
+});
+$__jsx_lazy_init(Style, "html", function () {
+ return ({ 'title': [ '<span class="title">', '</span>' ], 'url': [ '<span class="url">', '</span>' ], 'hit': [ '<span class="hit">', '</span>' ], 'del': [ '<del>', '</del>' ], 'summary': [ '<span class="reuslt">', '</span>' ] });
+});
+$__jsx_lazy_init(Style, "ignore", function () {
+ return ({ 'tilte': [ '', '' ], 'url': [ '', '' ], 'hit': [ '', '' ], 'del': [ '', '' ], 'summary': [ '', '' ] });
+});
+EnglishStemmer.serialVersionUID = 1;
+$__jsx_lazy_init(EnglishStemmer, "methodObject", function () {
+ return new EnglishStemmer$();
+});
+$__jsx_lazy_init(EnglishStemmer, "a_0", function () {
+ return [ new Among$SII("arsen", -1, -1), new Among$SII("commun", -1, -1), new Among$SII("gener", -1, -1) ];
+});
+$__jsx_lazy_init(EnglishStemmer, "a_1", function () {
+ return [ new Among$SII("'", -1, 1), new Among$SII("'s'", 0, 1), new Among$SII("'s", -1, 1) ];
+});
+$__jsx_lazy_init(EnglishStemmer, "a_2", function () {
+ return [ new Among$SII("ied", -1, 2), new Among$SII("s", -1, 3), new Among$SII("ies", 1, 2), new Among$SII("sses", 1, 1), new Among$SII("ss", 1, -1), new Among$SII("us", 1, -1) ];
+});
+$__jsx_lazy_init(EnglishStemmer, "a_3", function () {
+ return [ new Among$SII("", -1, 3), new Among$SII("bb", 0, 2), new Among$SII("dd", 0, 2), new Among$SII("ff", 0, 2), new Among$SII("gg", 0, 2), new Among$SII("bl", 0, 1), new Among$SII("mm", 0, 2), new Among$SII("nn", 0, 2), new Among$SII("pp", 0, 2), new Among$SII("rr", 0, 2), new Among$SII("at", 0, 1), new Among$SII("tt", 0, 2), new Among$SII("iz", 0, 1) ];
+});
+$__jsx_lazy_init(EnglishStemmer, "a_4", function () {
+ return [ new Among$SII("ed", -1, 2), new Among$SII("eed", 0, 1), new Among$SII("ing", -1, 2), new Among$SII("edly", -1, 2), new Among$SII("eedly", 3, 1), new Among$SII("ingly", -1, 2) ];
+});
+$__jsx_lazy_init(EnglishStemmer, "a_5", function () {
+ return [ new Among$SII("anci", -1, 3), new Among$SII("enci", -1, 2), new Among$SII("ogi", -1, 13), new Among$SII("li", -1, 16), new Among$SII("bli", 3, 12), new Among$SII("abli", 4, 4), new Among$SII("alli", 3, 8), new Among$SII("fulli", 3, 14), new Among$SII("lessli", 3, 15), new Among$SII("ousli", 3, 10), new Among$SII("entli", 3, 5), new Among$SII("aliti", -1, 8), new Among$SII("biliti", -1, 12), new Among$SII("iviti", -1, 11), new Among$SII("tional", -1, 1), new Among$SII("ational", 14, 7), new Among$SII("alism", -1, 8), new Among$SII("ation", -1, 7), new Among$SII("ization", 17, 6), new Among$SII("izer", -1, 6), new Among$SII("ator", -1, 7), new Among$SII("iveness", -1, 11), new Among$SII("fulness", -1, 9), new Among$SII("ousness", -1, 10) ];
+});
+$__jsx_lazy_init(EnglishStemmer, "a_6", function () {
+ return [ new Among$SII("icate", -1, 4), new Among$SII("ative", -1, 6), new Among$SII("alize", -1, 3), new Among$SII("iciti", -1, 4), new Among$SII("ical", -1, 4), new Among$SII("tional", -1, 1), new Among$SII("ational", 5, 2), new Among$SII("ful", -1, 5), new Among$SII("ness", -1, 5) ];
+});
+$__jsx_lazy_init(EnglishStemmer, "a_7", function () {
+ return [ new Among$SII("ic", -1, 1), new Among$SII("ance", -1, 1), new Among$SII("ence", -1, 1), new Among$SII("able", -1, 1), new Among$SII("ible", -1, 1), new Among$SII("ate", -1, 1), new Among$SII("ive", -1, 1), new Among$SII("ize", -1, 1), new Among$SII("iti", -1, 1), new Among$SII("al", -1, 1), new Among$SII("ism", -1, 1), new Among$SII("ion", -1, 2), new Among$SII("er", -1, 1), new Among$SII("ous", -1, 1), new Among$SII("ant", -1, 1), new Among$SII("ent", -1, 1), new Among$SII("ment", 15, 1), new Among$SII("ement", 16, 1) ];
+});
+$__jsx_lazy_init(EnglishStemmer, "a_8", function () {
+ return [ new Among$SII("e", -1, 1), new Among$SII("l", -1, 2) ];
+});
+$__jsx_lazy_init(EnglishStemmer, "a_9", function () {
+ return [ new Among$SII("succeed", -1, -1), new Among$SII("proceed", -1, -1), new Among$SII("exceed", -1, -1), new Among$SII("canning", -1, -1), new Among$SII("inning", -1, -1), new Among$SII("earring", -1, -1), new Among$SII("herring", -1, -1), new Among$SII("outing", -1, -1) ];
+});
+$__jsx_lazy_init(EnglishStemmer, "a_10", function () {
+ return [ new Among$SII("andes", -1, -1), new Among$SII("atlas", -1, -1), new Among$SII("bias", -1, -1), new Among$SII("cosmos", -1, -1), new Among$SII("dying", -1, 3), new Among$SII("early", -1, 9), new Among$SII("gently", -1, 7), new Among$SII("howe", -1, -1), new Among$SII("idly", -1, 6), new Among$SII("lying", -1, 4), new Among$SII("news", -1, -1), new Among$SII("only", -1, 10), new Among$SII("singly", -1, 11), new Among$SII("skies", -1, 2), new Among$SII("skis", -1, 1), new Among$SII("sky", -1, -1), new Among$SII("tying", -1, 5), new Among$SII("ugly", -1, 8) ];
+});
+$__jsx_lazy_init(EnglishStemmer, "g_v", function () {
+ return [ 17, 65, 16, 1 ];
+});
+$__jsx_lazy_init(EnglishStemmer, "g_v_WXY", function () {
+ return [ 1, 17, 65, 208, 1 ];
+});
+$__jsx_lazy_init(EnglishStemmer, "g_valid_LI", function () {
+ return [ 55, 141, 2 ];
+});
+$__jsx_lazy_init(_Common, "buffers", function () {
+ return [ "comment", "sgmlDecl", "textNode", "tagName", "doctype", "procInstName", "procInstBody", "entity", "attribName", "attribValue", "cdata", "script" ];
+});
+$__jsx_lazy_init(_Common, "EVENTS", function () {
+ return [ "text", "processinginstruction", "sgmldeclaration", "doctype", "comment", "attribute", "opentag", "closetag", "opencdata", "cdata", "clo_State.CDATA", "error", "end", "ready", "script", "opennamespace", "closenamespace" ];
+});
+_Common.MAX_BUFFER_LENGTH = 65536;
+_State.BEGIN = 1;
+_State.TEXT = 2;
+_State.TEXT_ENTITY = 3;
+_State.OPEN_WAKA = 4;
+_State.SGML_DECL = 5;
+_State.SGML_DECL_QUOTED = 6;
+_State.DOCTYPE = 7;
+_State.DOCTYPE_QUOTED = 8;
+_State.DOCTYPE_DTD = 9;
+_State.DOCTYPE_DTD_QUOTED = 10;
+_State.COMMENT_STARTING = 11;
+_State.COMMENT = 12;
+_State.COMMENT_ENDING = 13;
+_State.COMMENT_ENDED = 14;
+_State.CDATA = 15;
+_State.CDATA_ENDING = 16;
+_State.CDATA_ENDING_2 = 17;
+_State.PROC_INST = 18;
+_State.PROC_INST_BODY = 19;
+_State.PROC_INST_ENDING = 20;
+_State.OPEN_TAG = 21;
+_State.OPEN_TAG_SLASH = 22;
+_State.ATTRIB = 23;
+_State.ATTRIB_NAME = 24;
+_State.ATTRIB_NAME_SAW_WHITE = 25;
+_State.ATTRIB_VALUE = 26;
+_State.ATTRIB_VALUE_QUOTED = 27;
+_State.ATTRIB_VALUE_UNQUOTED = 28;
+_State.ATTRIB_VALUE_ENTITY_Q = 29;
+_State.ATTRIB_VALUE_ENTITY_U = 30;
+_State.CLOSE_TAG = 31;
+_State.CLOSE_TAG_SAW_WHITE = 32;
+_State.SCRIPT = 33;
+_State.SCRIPT_ENDING = 34;
+$__jsx_lazy_init(_Entities, "_entities", function () {
+ return ({ "amp": "&", "gt": ">", "lt": "<", "quot": "\"", "apos": "'", "AElig": 198, "Aacute": 193, "Acirc": 194, "Agrave": 192, "Aring": 197, "Atilde": 195, "Auml": 196, "Ccedil": 199, "ETH": 208, "Eacute": 201, "Ecirc": 202, "Egrave": 200, "Euml": 203, "Iacute": 205, "Icirc": 206, "Igrave": 204, "Iuml": 207, "Ntilde": 209, "Oacute": 211, "Ocirc": 212, "Ograve": 210, "Oslash": 216, "Otilde": 213, "Ouml": 214, "THORN": 222, "Uacute": 218, "Ucirc": 219, "Ugrave": 217, "Uuml": 220, "Yacute": 221, "aacute": 225, "acirc": 226, "aelig": 230, "agrave": 224, "aring": 229, "atilde": 227, "auml": 228, "ccedil": 231, "eacute": 233, "ecirc": 234, "egrave": 232, "eth": 240, "euml": 235, "iacute": 237, "icirc": 238, "igrave": 236, "iuml": 239, "ntilde": 241, "oacute": 243, "ocirc": 244, "ograve": 242, "oslash": 248, "otilde": 245, "ouml": 246, "szlig": 223, "thorn": 254, "uacute": 250, "ucirc": 251, "ugrave": 249, "uuml": 252, "yacute": 253, "yuml": 255, "copy": 169, "reg": 174, "nbsp": 160, "iexcl": 161, "cent": 162, "pound": 163, "curren": 164, "yen": 165, "brvbar": 166, "sect": 167, "uml": 168, "ordf": 170, "laquo": 171, "not": 172, "shy": 173, "macr": 175, "deg": 176, "plusmn": 177, "sup1": 185, "sup2": 178, "sup3": 179, "acute": 180, "micro": 181, "para": 182, "middot": 183, "cedil": 184, "ordm": 186, "raquo": 187, "frac14": 188, "frac12": 189, "frac34": 190, "iquest": 191, "times": 215, "divide": 247, "OElig": 338, "oelig": 339, "Scaron": 352, "scaron": 353, "Yuml": 376, "fnof": 402, "circ": 710, "tilde": 732, "Alpha": 913, "Beta": 914, "Gamma": 915, "Delta": 916, "Epsilon": 917, "Zeta": 918, "Eta": 919, "Theta": 920, "Iota": 921, "Kappa": 922, "Lambda": 923, "Mu": 924, "Nu": 925, "Xi": 926, "Omicron": 927, "Pi": 928, "Rho": 929, "Sigma": 931, "Tau": 932, "Upsilon": 933, "Phi": 934, "Chi": 935, "Psi": 936, "Omega": 937, "alpha": 945, "beta": 946, "gamma": 947, "delta": 948, "epsilon": 949, "zeta": 950, "eta": 951, "theta": 952, "iota": 953, "kappa": 954, "lambda": 955, "mu": 956, "nu": 957, "xi": 958, "omicron": 959, "pi": 960, "rho": 961, "sigmaf": 962, "sigma": 963, "tau": 964, "upsilon": 965, "phi": 966, "chi": 967, "psi": 968, "omega": 969, "thetasym": 977, "upsih": 978, "piv": 982, "ensp": 8194, "emsp": 8195, "thinsp": 8201, "zwnj": 8204, "zwj": 8205, "lrm": 8206, "rlm": 8207, "ndash": 8211, "mdash": 8212, "lsquo": 8216, "rsquo": 8217, "sbquo": 8218, "ldquo": 8220, "rdquo": 8221, "bdquo": 8222, "dagger": 8224, "Dagger": 8225, "bull": 8226, "hellip": 8230, "permil": 8240, "prime": 8242, "Prime": 8243, "lsaquo": 8249, "rsaquo": 8250, "oline": 8254, "frasl": 8260, "euro": 8364, "image": 8465, "weierp": 8472, "real": 8476, "trade": 8482, "alefsym": 8501, "larr": 8592, "uarr": 8593, "rarr": 8594, "darr": 8595, "harr": 8596, "crarr": 8629, "lArr": 8656, "uArr": 8657, "rArr": 8658, "dArr": 8659, "hArr": 8660, "forall": 8704, "part": 8706, "exist": 8707, "empty": 8709, "nabla": 8711, "isin": 8712, "notin": 8713, "ni": 8715, "prod": 8719, "sum": 8721, "minus": 8722, "lowast": 8727, "radic": 8730, "prop": 8733, "infin": 8734, "ang": 8736, "and": 8743, "or": 8744, "cap": 8745, "cup": 8746, "int": 8747, "there4": 8756, "sim": 8764, "cong": 8773, "asymp": 8776, "ne": 8800, "equiv": 8801, "le": 8804, "ge": 8805, "sub": 8834, "sup": 8835, "nsub": 8836, "sube": 8838, "supe": 8839, "oplus": 8853, "otimes": 8855, "perp": 8869, "sdot": 8901, "lceil": 8968, "rceil": 8969, "lfloor": 8970, "rfloor": 8971, "lang": 9001, "rang": 9002, "loz": 9674, "spades": 9824, "clubs": 9827, "hearts": 9829, "diams": 9830 });
+});
+BitVector.SMALL_BLOCK_SIZE = 32;
+BitVector.LARGE_BLOCK_SIZE = 256;
+BitVector.BLOCK_RATE = 8;
+$__jsx_lazy_init(BurrowsWheelerTransform, "END_MARKER", function () {
+ return String.fromCharCode(0);
+});
+var $__jsx_classMap = {
+ "tool/web/oktavia-english-search.jsx": {
+ _Main: _Main,
+ _Main$: _Main$
+ },
+ "tool/web/oktavia-search.jsx": {
+ _Result: _Result,
+ _Result$SSSI: _Result$SSSI,
+ _Proposal: _Proposal,
+ _Proposal$SSI: _Proposal$SSI,
+ OktaviaSearch: OktaviaSearch,
+ OktaviaSearch$I: OktaviaSearch$I,
+ _Main: _Main$0,
+ _Main$: _Main$0$
+ },
+ "src/oktavia.jsx": {
+ Oktavia: Oktavia,
+ Oktavia$: Oktavia$
+ },
+ "src/binary-util.jsx": {
+ Binary: Binary,
+ Binary$: Binary$,
+ LoadedStringResult: LoadedStringResult,
+ LoadedStringResult$SI: LoadedStringResult$SI,
+ LoadedStringListResult: LoadedStringListResult,
+ LoadedStringListResult$SI: LoadedStringListResult$SI,
+ LoadedStringListMapResult: LoadedStringListMapResult,
+ LoadedStringListMapResult$SI: LoadedStringListMapResult$SI,
+ LoadedNumberListResult: LoadedNumberListResult,
+ LoadedNumberListResult$SI: LoadedNumberListResult$SI,
+ CompressionReport: CompressionReport,
+ CompressionReport$: CompressionReport$
+ },
+ "src/query.jsx": {
+ Query: Query,
+ Query$: Query$
+ },
+ "src/query-string-parser.jsx": {
+ QueryStringParser: QueryStringParser,
+ QueryStringParser$: QueryStringParser$
+ },
+ "src/search-result.jsx": {
+ Proposal: Proposal,
+ Proposal$II: Proposal$II,
+ Position: Position,
+ Position$SIB: Position$SIB,
+ SearchUnit: SearchUnit,
+ SearchUnit$I: SearchUnit$I,
+ SingleResult: SingleResult,
+ SingleResult$: SingleResult$,
+ SingleResult$SBB: SingleResult$SBB,
+ SearchSummary: SearchSummary,
+ SearchSummary$: SearchSummary$,
+ SearchSummary$LOktavia$: SearchSummary$LOktavia$
+ },
+ "src/style.jsx": {
+ Style: Style,
+ Style$S: Style$S,
+ _HTMLHandler: _HTMLHandler,
+ _HTMLHandler$HASB: _HTMLHandler$HASB
+ },
+ "src/stemmer/stemmer.jsx": {
+ Stemmer: Stemmer,
+ Stemmer$: Stemmer$
+ },
+ "src/stemmer/base-stemmer.jsx": {
+ BaseStemmer: BaseStemmer,
+ BaseStemmer$: BaseStemmer$
+ },
+ "src/stemmer/english-stemmer.jsx": {
+ EnglishStemmer: EnglishStemmer,
+ EnglishStemmer$: EnglishStemmer$
+ },
+ "src/stemmer/among.jsx": {
+ Among: Among,
+ Among$SII: Among$SII,
+ Among$SIIF$LBaseStemmer$B$LBaseStemmer$: Among$SIIF$LBaseStemmer$B$LBaseStemmer$
+ },
+ "src/metadata.jsx": {
+ Metadata: Metadata,
+ Metadata$LOktavia$: Metadata$LOktavia$,
+ Section: Section,
+ Section$LOktavia$: Section$LOktavia$,
+ Splitter: Splitter,
+ Splitter$LOktavia$: Splitter$LOktavia$,
+ Splitter$LOktavia$S: Splitter$LOktavia$S,
+ Table: Table,
+ Table$LOktavia$AS: Table$LOktavia$AS,
+ Block: Block,
+ Block$LOktavia$: Block$LOktavia$
+ },
+ "src/fm-index.jsx": {
+ FMIndex: FMIndex,
+ FMIndex$: FMIndex$
+ },
+ "src/sax.jsx": {
+ Tag: Tag,
+ Tag$S: Tag$S,
+ _Common: _Common,
+ _Common$: _Common$,
+ _State: _State,
+ _State$: _State$,
+ SAXHandler: SAXHandler,
+ SAXHandler$: SAXHandler$,
+ SAXParser: SAXParser,
+ SAXParser$LSAXHandler$: SAXParser$LSAXHandler$,
+ SAXParser$LSAXHandler$B: SAXParser$LSAXHandler$B,
+ Char: Char,
+ Char$: Char$,
+ _Entities: _Entities,
+ _Entities$: _Entities$
+ },
+ "src/bit-vector.jsx": {
+ BitVector: BitVector,
+ BitVector$: BitVector$
+ },
+ "src/wavelet-matrix.jsx": {
+ WaveletMatrix: WaveletMatrix,
+ WaveletMatrix$: WaveletMatrix$
+ },
+ "src/burrows-wheeler-transform.jsx": {
+ BurrowsWheelerTransform: BurrowsWheelerTransform,
+ BurrowsWheelerTransform$: BurrowsWheelerTransform$
+ },
+ "src/sais.jsx": {
+ OArray: OArray,
+ OArray$AI: OArray$AI,
+ OArray$AII: OArray$AII,
+ SAIS: SAIS,
+ SAIS$: SAIS$
+ }
+};
+
+
+/**
+ * launches _Main.main(:string[]):void invoked by jsx --run|--executable
+ */
+JSX.runMain = function (sourceFile, args) {
+ var module = JSX.require(sourceFile);
+ if (! module) {
+ throw new ReferenceError("entry point module not found in " + sourceFile);
+ }
+ if (! module._Main) {
+ throw new ReferenceError("entry point _Main not found in " + sourceFile);
+ }
+ if (! module._Main.main$AS) {
+ throw new ReferenceError("entry point _Main.main(:string[]):void not found in " + sourceFile);
+ }
+ module._Main.main$AS(args);
+};
+
+/**
+ * launches _Test#test*():void invoked by jsx --test
+ */
+JSX.runTests = function (sourceFile, tests) {
+ var module = JSX.require(sourceFile);
+ var testClass = module._Test$;
+
+ if (!testClass) return; // skip if there's no test class
+
+ if(tests.length === 0) {
+ var p = testClass.prototype;
+ for (var m in p) {
+ if (p[m] instanceof Function
+ && /^test.*[$]$/.test(m)) {
+ tests.push(m);
+ }
+ }
+ }
+ else { // set as process arguments
+ tests = tests.map(function (name) {
+ return name + "$"; // mangle for function test*():void
+ });
+ }
+
+ var testCase = new testClass();
+
+ if (testCase.beforeClass$AS != null)
+ testCase.beforeClass$AS(tests);
+
+ for (var i = 0; i < tests.length; ++i) {
+ (function (method) {
+ if (method in testCase) {
+ testCase.run$SF$V$(method, function() { testCase[method](); });
+ }
+ else {
+ throw new ReferenceError("No such test method: " + method);
+ }
+ }(tests[i]));
+ }
+
+ if (testCase.afterClass$ != null)
+ testCase.afterClass$();
+};
+/**
+ * call a function on load/DOMContentLoaded
+ */
+function $__jsx_onload (event) {
+ window.removeEventListener("load", $__jsx_onload);
+ document.removeEventListener("DOMContentLoaded", $__jsx_onload);
+ JSX.runMain("tool/web/oktavia-english-search.jsx", [])
+}
+
+window.addEventListener("load", $__jsx_onload);
+document.addEventListener("DOMContentLoaded", $__jsx_onload);
+
+})(JSX);
diff --git a/web/server/h2o/libh2o/misc/oktavia/lib/oktavia-finnish-search.js b/web/server/h2o/libh2o/misc/oktavia/lib/oktavia-finnish-search.js
new file mode 100644
index 00000000..2d81bc79
--- /dev/null
+++ b/web/server/h2o/libh2o/misc/oktavia/lib/oktavia-finnish-search.js
@@ -0,0 +1,8609 @@
+// generatedy by JSX compiler 0.9.24 (2013-04-05 13:45:00 +0900; 1b229cc6a411f674f0f7cf7a79b7a8b3f8eb7414)
+var JSX = {};
+(function (JSX) {
+/**
+ * copies the implementations from source interface to target
+ */
+function $__jsx_merge_interface(target, source) {
+ for (var k in source.prototype)
+ if (source.prototype.hasOwnProperty(k))
+ target.prototype[k] = source.prototype[k];
+}
+
+/**
+ * defers the initialization of the property
+ */
+function $__jsx_lazy_init(obj, prop, func) {
+ function reset(obj, prop, value) {
+ delete obj[prop];
+ obj[prop] = value;
+ return value;
+ }
+
+ Object.defineProperty(obj, prop, {
+ get: function () {
+ return reset(obj, prop, func());
+ },
+ set: function (v) {
+ reset(obj, prop, v);
+ },
+ enumerable: true,
+ configurable: true
+ });
+}
+
+/**
+ * sideeffect().a /= b
+ */
+function $__jsx_div_assign(obj, prop, divisor) {
+ return obj[prop] = (obj[prop] / divisor) | 0;
+}
+
+/*
+ * global functions, renamed to avoid conflict with local variable names
+ */
+var $__jsx_parseInt = parseInt;
+var $__jsx_parseFloat = parseFloat;
+var $__jsx_isNaN = isNaN;
+var $__jsx_isFinite = isFinite;
+
+var $__jsx_encodeURIComponent = encodeURIComponent;
+var $__jsx_decodeURIComponent = decodeURIComponent;
+var $__jsx_encodeURI = encodeURI;
+var $__jsx_decodeURI = decodeURI;
+
+var $__jsx_ObjectToString = Object.prototype.toString;
+var $__jsx_ObjectHasOwnProperty = Object.prototype.hasOwnProperty;
+
+/*
+ * profiler object, initialized afterwards
+ */
+function $__jsx_profiler() {
+}
+
+/*
+ * public interface to JSX code
+ */
+JSX.require = function (path) {
+ var m = $__jsx_classMap[path];
+ return m !== undefined ? m : null;
+};
+
+JSX.profilerIsRunning = function () {
+ return $__jsx_profiler.getResults != null;
+};
+
+JSX.getProfileResults = function () {
+ return ($__jsx_profiler.getResults || function () { return {}; })();
+};
+
+JSX.postProfileResults = function (url, cb) {
+ if ($__jsx_profiler.postResults == null)
+ throw new Error("profiler has not been turned on");
+ return $__jsx_profiler.postResults(url, cb);
+};
+
+JSX.resetProfileResults = function () {
+ if ($__jsx_profiler.resetResults == null)
+ throw new Error("profiler has not been turned on");
+ return $__jsx_profiler.resetResults();
+};
+JSX.DEBUG = false;
+/**
+ * class _Main extends Object
+ * @constructor
+ */
+function _Main() {
+}
+
+/**
+ * @constructor
+ */
+function _Main$() {
+};
+
+_Main$.prototype = new _Main;
+
+/**
+ * @param {Array.<undefined|!string>} args
+ */
+_Main.main$AS = function (args) {
+ OktaviaSearch$setStemmer$LStemmer$(new FinnishStemmer$());
+};
+
+var _Main$main$AS = _Main.main$AS;
+
+/**
+ * class _Result extends Object
+ * @constructor
+ */
+function _Result() {
+}
+
+/**
+ * @constructor
+ * @param {!string} title
+ * @param {!string} url
+ * @param {!string} content
+ * @param {!number} score
+ */
+function _Result$SSSI(title, url, content, score) {
+ this.title = title;
+ this.url = url;
+ this.content = content;
+ this.score = score;
+};
+
+_Result$SSSI.prototype = new _Result;
+
+/**
+ * class _Proposal extends Object
+ * @constructor
+ */
+function _Proposal() {
+}
+
+/**
+ * @constructor
+ * @param {!string} options
+ * @param {!string} label
+ * @param {!number} count
+ */
+function _Proposal$SSI(options, label, count) {
+ this.options = options;
+ this.label = label;
+ this.count = count;
+};
+
+_Proposal$SSI.prototype = new _Proposal;
+
+/**
+ * class OktaviaSearch extends Object
+ * @constructor
+ */
+function OktaviaSearch() {
+}
+
+/**
+ * @constructor
+ * @param {!number} entriesPerPage
+ */
+function OktaviaSearch$I(entriesPerPage) {
+ this._queries = null;
+ this._highlight = "";
+ this._result = null;
+ this._proposals = null;
+ this._currentFolderDepth = 0;
+ this._oktavia = new Oktavia$();
+ this._entriesPerPage = entriesPerPage;
+ this._currentPage = 1;
+ this._queryString = null;
+ this._callback = null;
+ OktaviaSearch._instance = this;
+};
+
+OktaviaSearch$I.prototype = new OktaviaSearch;
+
+/**
+ * @param {Stemmer} stemmer
+ */
+OktaviaSearch.setStemmer$LStemmer$ = function (stemmer) {
+ /** @type {Oktavia} */
+ var this$0;
+ if (OktaviaSearch._instance) {
+ this$0 = OktaviaSearch._instance._oktavia;
+ this$0._stemmer = stemmer;
+ } else {
+ OktaviaSearch._stemmer = stemmer;
+ }
+};
+
+var OktaviaSearch$setStemmer$LStemmer$ = OktaviaSearch.setStemmer$LStemmer$;
+
+/**
+ * @param {!string} index
+ */
+OktaviaSearch.prototype.loadIndex$S = function (index) {
+ /** @type {Oktavia} */
+ var this$0;
+ /** @type {Stemmer} */
+ var stemmer$0;
+ if (OktaviaSearch._stemmer) {
+ this$0 = this._oktavia;
+ stemmer$0 = OktaviaSearch._stemmer;
+ this$0._stemmer = stemmer$0;
+ }
+ this._oktavia.load$S(Binary$base64decode$S(index));
+ if (this._queryString) {
+ this.search$SF$IIV$(this._queryString, this._callback);
+ this._queryString = null;
+ this._callback = null;
+ }
+};
+
+/**
+ * @param {!string} queryString
+ * @param {*} callback
+ */
+OktaviaSearch.prototype.search$SF$IIV$ = function (queryString, callback) {
+ /** @type {QueryStringParser} */
+ var queryParser;
+ /** @type {SearchSummary} */
+ var summary;
+ /** @type {Array.<undefined|SearchUnit>} */
+ var _result$0;
+ if (this._oktavia) {
+ queryParser = ({queries: [ ]});
+ this._queries = QueryStringParser$parse$LQueryStringParser$S(queryParser, queryString);
+ this._highlight = QueryStringParser$highlight$LQueryStringParser$(queryParser);
+ summary = this._oktavia.search$ALQuery$(this._queries);
+ if (SearchSummary$size$LSearchSummary$(summary) > 0) {
+ this._result = this._sortResult$LSearchSummary$(summary);
+ this._proposals = [ ];
+ this._currentPage = 1;
+ } else {
+ this._result = [ ];
+ if (this._queries.length > 1) {
+ this._proposals = SearchSummary$getProposal$LSearchSummary$(summary);
+ } else {
+ this._proposals = [ ];
+ }
+ this._currentPage = 1;
+ }
+ callback((_result$0 = this._result).length, Math.ceil(_result$0.length / this._entriesPerPage));
+ } else {
+ this._queryString = queryString;
+ this._callback = callback;
+ }
+};
+
+/**
+ * @return {!number}
+ */
+OktaviaSearch.prototype.resultSize$ = function () {
+ return (this._result.length | 0);
+};
+
+/**
+ * @return {!number}
+ */
+OktaviaSearch.prototype.totalPages$ = function () {
+ return (Math.ceil(this._result.length / this._entriesPerPage) | 0);
+};
+
+/**
+ * @return {!number}
+ */
+OktaviaSearch.prototype.currentPage$ = function () {
+ return this._currentPage;
+};
+
+/**
+ * @param {!number} page
+ */
+OktaviaSearch.prototype.setCurrentPage$I = function (page) {
+ this._currentPage = page;
+};
+
+/**
+ * @return {!boolean}
+ */
+OktaviaSearch.prototype.hasPrevPage$ = function () {
+ return this._currentPage !== 1;
+};
+
+/**
+ * @return {!boolean}
+ */
+OktaviaSearch.prototype.hasNextPage$ = function () {
+ return this._currentPage !== Math.ceil(this._result.length / this._entriesPerPage);
+};
+
+/**
+ * @return {Array.<undefined|!string>}
+ */
+OktaviaSearch.prototype.pageIndexes$ = function () {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var total;
+ /** @type {!number} */
+ var i;
+ result = [ ];
+ total = Math.ceil(this._result.length / this._entriesPerPage);
+ if (total < 10) {
+ for (i = 1; i <= total; i++) {
+ result.push(i + "");
+ }
+ } else {
+ if (this._currentPage <= 5) {
+ for (i = 1; i <= 7; i++) {
+ result.push(i + "");
+ }
+ result.push('...', total + "");
+ } else {
+ if (total - 5 <= this._currentPage) {
+ result.push('1', '...');
+ for (i = total - 8; i <= total; i++) {
+ result.push(i + "");
+ }
+ } else {
+ result.push('1', '...');
+ for (i = this._currentPage - 3; i <= this._currentPage + 3; i++) {
+ result.push(i + "");
+ }
+ result.push('...', total + "");
+ }
+ }
+ }
+ return result;
+};
+
+/**
+ * @return {Array.<undefined|_Result>}
+ */
+OktaviaSearch.prototype.getResult$ = function () {
+ /** @type {Style} */
+ var style;
+ /** @type {!number} */
+ var start;
+ /** @type {!number} */
+ var last;
+ /** @type {Metadata} */
+ var metadata;
+ /** @type {!number} */
+ var num;
+ /** @type {Array.<undefined|_Result>} */
+ var results;
+ /** @type {!number} */
+ var i;
+ /** @type {SearchUnit} */
+ var unit;
+ /** @type {Array.<undefined|!string>} */
+ var info;
+ /** @type {!string} */
+ var content;
+ /** @type {Array.<undefined|Position>} */
+ var positions;
+ /** @type {!number} */
+ var end;
+ /** @type {!boolean} */
+ var split;
+ /** @type {!number} */
+ var j;
+ /** @type {Position} */
+ var pos;
+ /** @type {!string} */
+ var text;
+ /** @type {Oktavia} */
+ var this$0;
+ /** @type {!number} */
+ var position$0;
+ /** @type {!number} */
+ var _currentPage$0;
+ /** @type {!number} */
+ var _entriesPerPage$0;
+ style = new Style$S('html');
+ start = ((_currentPage$0 = this._currentPage) - 1) * (_entriesPerPage$0 = this._entriesPerPage);
+ last = Math.min(_currentPage$0 * _entriesPerPage$0, this._result.length);
+ this$0 = this._oktavia;
+ metadata = this$0._metadatas[this$0._metadataLabels[0]];
+ num = 250;
+ results = [ ];
+ for (i = start; i < last; i++) {
+ unit = this._result[i];
+ info = metadata.getInformation$I(unit.id).split(Oktavia.eob);
+ content = metadata.getContent$I(unit.id);
+ start = 0;
+ positions = SearchUnit$getPositions$LSearchUnit$(unit);
+ if (content.indexOf(info[0]) === 1) {
+ content = content.slice(info[0].length + 2, content.length);
+ start += info[0].length + 2;
+ }
+ end = start + num;
+ split = false;
+ if (positions[0].position > end - positions[0].word.length) {
+ end = positions[0].position + Math.floor(num / 2);
+ split = true;
+ }
+ for (j = positions.length - 1; j > -1; j--) {
+ pos = positions[j];
+ if (pos.position + pos.word.length < end) {
+ content = [ content.slice(0, pos.position - start), style.convert$S('<hit>*</hit>').replace('*', content.slice((position$0 = pos.position) - start, position$0 + pos.word.length - start)), content.slice(pos.position + pos.word.length - start, content.length) ].join('');
+ }
+ }
+ if (split) {
+ text = [ content.slice(0, Math.floor(num / 2)) + ' ...', content.slice(- Math.floor(num / 2), end - start) ].join('<br/>');
+ } else {
+ text = content.slice(0, end - start) + ' ...<br/>';
+ }
+ text = text.replace(Oktavia.eob, ' ').replace(/(<br\/>)(<br\/>)+/, '<br/><br/>');
+ results.push(({title: info[0], url: info[1], content: text, score: unit.score}));
+ }
+ return results;
+};
+
+/**
+ * @return {!string}
+ */
+OktaviaSearch.prototype.getHighlight$ = function () {
+ return this._highlight;
+};
+
+/**
+ * @return {Array.<undefined|_Proposal>}
+ */
+OktaviaSearch.prototype.getProposals$ = function () {
+ /** @type {Style} */
+ var style;
+ /** @type {Array.<undefined|_Proposal>} */
+ var results;
+ /** @type {!number} */
+ var i;
+ /** @type {Proposal} */
+ var proposal;
+ /** @type {Array.<undefined|!string>} */
+ var label;
+ /** @type {Array.<undefined|!string>} */
+ var option;
+ /** @type {!number} */
+ var j;
+ style = new Style$S('html');
+ results = [ ];
+ if (this._queries.length > 1) {
+ for (i = 0; i < this._proposals.length; i++) {
+ proposal = this._proposals[i];
+ if (proposal.expect > 0) {
+ label = [ ];
+ option = [ ];
+ for (j = 0; j < this._queries.length; j++) {
+ if (j !== proposal.omit) {
+ label.push(style.convert$S('<hit>' + this._queries[j].toString() + '</hit>'));
+ option.push(this._queries[j].toString());
+ } else {
+ label.push(style.convert$S('<del>' + this._queries[j].toString() + '</del>'));
+ }
+ }
+ results.push(({options: option.join(' '), label: label.join('&nbsp;'), count: proposal.expect}));
+ }
+ }
+ }
+ return results;
+};
+
+/**
+ * @param {SearchSummary} summary
+ * @return {Array.<undefined|SearchUnit>}
+ */
+OktaviaSearch.prototype._sortResult$LSearchSummary$ = function (summary) {
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var score;
+ /** @type {SearchUnit} */
+ var unit;
+ /** @type {!string} */
+ var pos;
+ /** @type {Position} */
+ var position;
+ for (i = 0; i < summary.result.units.length; i++) {
+ score = 0;
+ unit = summary.result.units[i];
+ for (pos in unit.positions) {
+ position = unit.positions[pos];
+ if (this._oktavia.wordPositionType$I(position.position)) {
+ score += 10;
+ } else {
+ score += 1;
+ }
+ if (! position.stemmed) {
+ score += 2;
+ }
+ }
+ unit.score = (score | 0);
+ }
+ return SearchSummary$getSortedResult$LSearchSummary$(summary);
+};
+
+/**
+ * class _Main$0 extends Object
+ * @constructor
+ */
+function _Main$0() {
+}
+
+/**
+ * @constructor
+ */
+function _Main$0$() {
+};
+
+_Main$0$.prototype = new _Main$0;
+
+/**
+ * @param {Array.<undefined|!string>} args
+ */
+_Main$0.main$AS = function (args) {
+};
+
+var _Main$0$main$AS = _Main$0.main$AS;
+
+/**
+ * class Oktavia extends Object
+ * @constructor
+ */
+function Oktavia() {
+}
+
+/**
+ * @constructor
+ */
+function Oktavia$() {
+ /** @type {Array.<undefined|!string>} */
+ var _utf162compressCode$0;
+ this._compressCode2utf16 = null;
+ this._fmindex = new FMIndex$();
+ this._metadatas = ({ });
+ this._metadataLabels = [ ];
+ this._stemmer = null;
+ this._stemmingResult = ({ });
+ _utf162compressCode$0 = this._utf162compressCode = [ Oktavia.eof, Oktavia.eob, Oktavia.unknown ];
+ _utf162compressCode$0.length = 65536;
+ this._compressCode2utf16 = [ Oktavia.eof, Oktavia.eob, Oktavia.unknown ];
+};
+
+Oktavia$.prototype = new Oktavia;
+
+/**
+ * @param {Stemmer} stemmer
+ */
+Oktavia.prototype.setStemmer$LStemmer$ = function (stemmer) {
+ this._stemmer = stemmer;
+};
+
+/**
+ * @return {Metadata}
+ */
+Oktavia.prototype.getPrimaryMetadata$ = function () {
+ return this._metadatas[this._metadataLabels[0]];
+};
+
+/**
+ * @param {!string} key
+ * @return {Section}
+ */
+Oktavia.prototype.addSection$S = function (key) {
+ /** @type {Section} */
+ var section;
+ if (this._metadataLabels.indexOf(key) !== -1) {
+ throw new Error('Metadata name ' + key + ' is already exists');
+ }
+ this._metadataLabels.push(key);
+ section = new Section$LOktavia$(this);
+ this._metadatas[key] = section;
+ return section;
+};
+
+/**
+ * @param {!string} key
+ * @return {Section}
+ */
+Oktavia.prototype.getSection$S = function (key) {
+ if (this._metadataLabels.indexOf(key) === -1) {
+ throw new Error('Metadata name ' + key + " does't exists");
+ }
+ return this._metadatas[key];
+};
+
+/**
+ * @param {!string} key
+ * @return {Splitter}
+ */
+Oktavia.prototype.addSplitter$S = function (key) {
+ /** @type {Splitter} */
+ var splitter;
+ if (this._metadataLabels.indexOf(key) !== -1) {
+ throw new Error('Metadata name ' + key + ' is already exists');
+ }
+ this._metadataLabels.push(key);
+ splitter = new Splitter$LOktavia$(this);
+ this._metadatas[key] = splitter;
+ return splitter;
+};
+
+/**
+ * @param {!string} key
+ * @return {Splitter}
+ */
+Oktavia.prototype.getSplitter$S = function (key) {
+ if (this._metadataLabels.indexOf(key) === -1) {
+ throw new Error('Metadata name ' + key + " does't exists");
+ }
+ return this._metadatas[key];
+};
+
+/**
+ * @param {!string} key
+ * @param {Array.<undefined|!string>} headers
+ * @return {Table}
+ */
+Oktavia.prototype.addTable$SAS = function (key, headers) {
+ /** @type {Table} */
+ var table;
+ if (this._metadataLabels.indexOf(key) !== -1) {
+ throw new Error('Metadata name ' + key + ' is already exists');
+ }
+ this._metadataLabels.push(key);
+ table = new Table$LOktavia$AS(this, headers);
+ this._metadatas[key] = table;
+ return table;
+};
+
+/**
+ * @param {!string} key
+ * @return {Table}
+ */
+Oktavia.prototype.getTable$S = function (key) {
+ if (this._metadataLabels.indexOf(key) === -1) {
+ throw new Error('Metadata name ' + key + " does't exists");
+ }
+ return this._metadatas[key];
+};
+
+/**
+ * @param {!string} key
+ * @return {Block}
+ */
+Oktavia.prototype.addBlock$S = function (key) {
+ /** @type {Block} */
+ var block;
+ if (this._metadataLabels.indexOf(key) !== -1) {
+ throw new Error('Metadata name ' + key + ' is already exists');
+ }
+ this._metadataLabels.push(key);
+ block = new Block$LOktavia$(this);
+ this._metadatas[key] = block;
+ return block;
+};
+
+/**
+ * @param {!string} key
+ * @return {Block}
+ */
+Oktavia.prototype.getBlock$S = function (key) {
+ if (this._metadataLabels.indexOf(key) === -1) {
+ throw new Error('Metadata name ' + key + " does't exists");
+ }
+ return this._metadatas[key];
+};
+
+/**
+ */
+Oktavia.prototype.addEndOfBlock$ = function () {
+ this._fmindex.push$S(Oktavia.eob);
+};
+
+/**
+ * @param {!string} words
+ */
+Oktavia.prototype.addWord$S = function (words) {
+ /** @type {Array.<undefined|!string>} */
+ var str;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var charCode;
+ /** @type {undefined|!string} */
+ var newCharCode;
+ str = [ ];
+ str.length = words.length;
+ for (i = 0; i < words.length; i++) {
+ charCode = words.charCodeAt(i);
+ newCharCode = this._utf162compressCode[charCode];
+ if (newCharCode == null) {
+ newCharCode = String.fromCharCode(this._compressCode2utf16.length);
+ this._utf162compressCode[charCode] = newCharCode;
+ this._compressCode2utf16.push(String.fromCharCode(charCode));
+ }
+ str.push(newCharCode);
+ }
+ this._fmindex.push$S(str.join(''));
+};
+
+/**
+ * @param {!string} words
+ * @param {!boolean} stemming
+ */
+Oktavia.prototype.addWord$SB = function (words, stemming) {
+ /** @type {Array.<undefined|!string>} */
+ var wordList;
+ /** @type {!number} */
+ var i;
+ /** @type {undefined|!string} */
+ var originalWord;
+ /** @type {!string} */
+ var smallWord;
+ /** @type {undefined|!string} */
+ var registerWord;
+ /** @type {!string} */
+ var baseWord;
+ /** @type {!string} */
+ var compressedCodeWord;
+ /** @type {Array.<undefined|!string>} */
+ var stemmedList;
+ this.addWord$S(words);
+ wordList = words.split(/\s+/);
+ for (i = 0; i < wordList.length; i++) {
+ originalWord = wordList[i];
+ smallWord = originalWord.slice(0, 1).toLowerCase() + originalWord.slice(1);
+ registerWord = null;
+ if (stemming && this._stemmer) {
+ baseWord = this._stemmer.stemWord$S(originalWord.toLowerCase());
+ if (originalWord.indexOf(baseWord) === -1) {
+ registerWord = baseWord;
+ }
+ } else {
+ if (originalWord != smallWord) {
+ registerWord = smallWord;
+ }
+ }
+ if (registerWord) {
+ compressedCodeWord = this._convertToCompressionCode$S(originalWord);
+ stemmedList = this._stemmingResult[registerWord];
+ if (! stemmedList) {
+ stemmedList = [ compressedCodeWord ];
+ this._stemmingResult[registerWord] = stemmedList;
+ } else {
+ if (stemmedList.indexOf(compressedCodeWord) === -1) {
+ stemmedList.push(compressedCodeWord);
+ }
+ }
+ }
+ }
+};
+
+/**
+ * @param {!string} keyword
+ * @return {!string}
+ */
+Oktavia.prototype._convertToCompressionCode$S = function (keyword) {
+ /** @type {Array.<undefined|!string>} */
+ var resultChars;
+ /** @type {!number} */
+ var i;
+ /** @type {undefined|!string} */
+ var chr;
+ resultChars = [ ];
+ for (i = 0; i < keyword.length; i++) {
+ chr = this._utf162compressCode[keyword.charCodeAt(i)];
+ if (chr == null) {
+ resultChars.push(Oktavia.unknown);
+ } else {
+ resultChars.push(chr);
+ }
+ }
+ return resultChars.join('');
+};
+
+/**
+ * @param {!string} keyword
+ * @param {!boolean} stemming
+ * @return {Array.<undefined|!number>}
+ */
+Oktavia.prototype.rawSearch$SB = function (keyword, stemming) {
+ /** @type {Array.<undefined|!number>} */
+ var result;
+ /** @type {!string} */
+ var baseWord;
+ /** @type {Array.<undefined|!string>} */
+ var stemmedList;
+ /** @type {!number} */
+ var i;
+ /** @type {undefined|!string} */
+ var word;
+ if (stemming) {
+ result = [ ];
+ if (this._stemmer) {
+ baseWord = this._stemmer.stemWord$S(keyword.toLowerCase());
+ stemmedList = this._stemmingResult[baseWord];
+ if (stemmedList) {
+ for (i = 0; i < stemmedList.length; i++) {
+ word = stemmedList[i];
+ result = result.concat(this._fmindex.search$S(word));
+ }
+ }
+ }
+ } else {
+ result = this._fmindex.search$S(this._convertToCompressionCode$S(keyword));
+ }
+ return result;
+};
+
+/**
+ * @param {Array.<undefined|Query>} queries
+ * @return {SearchSummary}
+ */
+Oktavia.prototype.search$ALQuery$ = function (queries) {
+ /** @type {SearchSummary} */
+ var summary;
+ /** @type {!number} */
+ var i;
+ /** @type {SingleResult} */
+ var result$0;
+ summary = ({sourceResults: [ ], result: null, oktavia: this});
+ for (i = 0; i < queries.length; i++) {
+ result$0 = this._searchQuery$LQuery$(queries[i]);
+ summary.sourceResults.push(result$0);
+ }
+ summary.result = SearchSummary$mergeResult$LSearchSummary$ALSingleResult$(summary, summary.sourceResults);
+ return summary;
+};
+
+/**
+ * @param {Query} query
+ * @return {SingleResult}
+ */
+Oktavia.prototype._searchQuery$LQuery$ = function (query) {
+ /** @type {SingleResult} */
+ var result;
+ /** @type {Array.<undefined|!number>} */
+ var positions;
+ result = new SingleResult$SBB(query.word, query.or, query.not);
+ if (query.raw) {
+ positions = this.rawSearch$SB(query.word, false);
+ } else {
+ positions = this.rawSearch$SB(query.word, false).concat(this.rawSearch$SB(query.word, true));
+ }
+ this._metadatas[this._metadataLabels[0]].grouping$LSingleResult$AISB(result, positions, query.word, ! query.raw);
+ return result;
+};
+
+/**
+ */
+Oktavia.prototype.build$ = function () {
+ this.build$IB(5, false);
+};
+
+/**
+ * @param {!number} cacheDensity
+ * @param {!boolean} verbose
+ */
+Oktavia.prototype.build$IB = function (cacheDensity, verbose) {
+ /** @type {!string} */
+ var key;
+ /** @type {!number} */
+ var cacheRange;
+ /** @type {!number} */
+ var maxChar;
+ for (key in this._metadatas) {
+ this._metadatas[key]._build$();
+ }
+ cacheRange = Math.round(Math.max(1, 100 / Math.min(100, Math.max(0.01, cacheDensity))));
+ maxChar = this._compressCode2utf16.length;
+ this._fmindex.build$SIIB(Oktavia.eof, maxChar, cacheRange, verbose);
+};
+
+/**
+ * @return {!string}
+ */
+Oktavia.prototype.dump$ = function () {
+ return this.dump$B(false);
+};
+
+/**
+ * @param {!boolean} verbose
+ * @return {!string}
+ */
+Oktavia.prototype.dump$B = function (verbose) {
+ /** @type {!string} */
+ var header;
+ /** @type {!string} */
+ var fmdata;
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var i;
+ /** @type {CompressionReport} */
+ var report;
+ /** @type {undefined|!string} */
+ var name;
+ /** @type {!string} */
+ var data;
+ header = Binary$dumpString$SLCompressionReport$("oktavia-01", null).slice(1);
+ if (verbose) {
+ console.log("Source text size: " + (this._fmindex.size$() * 2 + "") + ' bytes');
+ }
+ fmdata = this._fmindex.dump$B(verbose);
+ result = [ header, fmdata ];
+ result.push(Binary$dump16bitNumber$I(this._compressCode2utf16.length));
+ for (i = 3; i < this._compressCode2utf16.length; i++) {
+ result.push(this._compressCode2utf16[i]);
+ }
+ if (verbose) {
+ console.log('Char Code Map: ' + (this._compressCode2utf16.length * 2 - 2 + "") + ' bytes');
+ }
+ report = ({source: 0, result: 0});
+ result.push(Binary$dumpStringListMap$HASLCompressionReport$(this._stemmingResult, report));
+ if (verbose) {
+ console.log('Stemmed Word Table: ' + (result[result.length - 1].length + "") + ' bytes (' + (Math.round(report.result * 100.0 / report.source) + "") + '%)');
+ }
+ result.push(Binary$dump16bitNumber$I(this._metadataLabels.length));
+ for (i = 0; i < this._metadataLabels.length; i++) {
+ report = ({source: 0, result: 0});
+ name = this._metadataLabels[i];
+ data = this._metadatas[name]._dump$LCompressionReport$(report);
+ result.push(Binary$dumpString$SLCompressionReport$(name, report), data);
+ if (verbose) {
+ console.log('Meta Data ' + name + ': ' + (data.length * 2 + "") + ' bytes (' + (Math.round(report.result * 100.0 / report.source) + "") + '%)');
+ }
+ }
+ return result.join('');
+};
+
+/**
+ * @param {!string} data
+ */
+Oktavia.prototype.load$S = function (data) {
+ /** @type {!string} */
+ var header;
+ /** @type {!number} */
+ var offset;
+ /** @type {!number} */
+ var charCodeCount;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var charCode;
+ /** @type {LoadedStringListMapResult} */
+ var stemmedWords;
+ /** @type {!number} */
+ var metadataCount;
+ /** @type {LoadedStringResult} */
+ var nameResult;
+ /** @type {!string} */
+ var name;
+ /** @type {!number} */
+ var type;
+ header = Binary$dumpString$SLCompressionReport$("oktavia-01", null).slice(1);
+ if (data.slice(0, 5) !== header) {
+ throw new Error('Invalid data file');
+ }
+ this._metadatas = ({ });
+ this._metadataLabels = [ ];
+ offset = 5;
+ offset = this._fmindex.load$SI(data, offset);
+ charCodeCount = Binary$load16bitNumber$SI(data, offset++);
+ this._compressCode2utf16 = [ Oktavia.eof, Oktavia.eob, Oktavia.unknown ];
+ this._utf162compressCode = [ Oktavia.eof, Oktavia.eob, Oktavia.unknown ];
+ for (i = 3; i < charCodeCount; i++) {
+ charCode = Binary$load16bitNumber$SI(data, offset++);
+ this._compressCode2utf16.push(String.fromCharCode(charCode));
+ this._utf162compressCode[charCode] = String.fromCharCode(i);
+ }
+ stemmedWords = Binary$loadStringListMap$SI(data, offset);
+ this._stemmingResult = stemmedWords.result;
+ offset = stemmedWords.offset;
+ metadataCount = Binary$load16bitNumber$SI(data, offset++);
+ for (i = 0; i < metadataCount; i++) {
+ nameResult = Binary$loadString$SI(data, offset);
+ name = nameResult.result;
+ offset = nameResult.offset;
+ type = Binary$load16bitNumber$SI(data, offset++);
+ switch (type) {
+ case 0:
+ offset = Section$_load$LOktavia$SSI(this, name, data, offset);
+ break;
+ case 1:
+ offset = Splitter$_load$LOktavia$SSI(this, name, data, offset);
+ break;
+ case 2:
+ offset = Table$_load$LOktavia$SSI(this, name, data, offset);
+ break;
+ case 3:
+ offset = Block$_load$LOktavia$SSI(this, name, data, offset);
+ break;
+ }
+ }
+};
+
+/**
+ * @return {!number}
+ */
+Oktavia.prototype.contentSize$ = function () {
+ /** @type {FMIndex} */
+ var this$0;
+ this$0 = this._fmindex;
+ return this$0._substr.length;
+};
+
+/**
+ * @param {!number} position
+ * @return {!number}
+ */
+Oktavia.prototype.wordPositionType$I = function (position) {
+ /** @type {!number} */
+ var result;
+ /** @type {!string} */
+ var ahead;
+ result = 0;
+ if (position === 0) {
+ result = 4;
+ } else {
+ ahead = this._fmindex.getSubstring$II(position - 1, 1);
+ if (/\s/.test(ahead)) {
+ result = 2;
+ } else {
+ if (/\W/.test(ahead)) {
+ result = 1;
+ } else {
+ if (Oktavia.eob === ahead) {
+ result = 3;
+ }
+ }
+ }
+ }
+ return (result | 0);
+};
+
+/**
+ * @param {!number} position
+ * @param {!number} length
+ * @return {!string}
+ */
+Oktavia.prototype._getSubstring$II = function (position, length) {
+ /** @type {!string} */
+ var result;
+ /** @type {Array.<undefined|!string>} */
+ var str;
+ /** @type {!number} */
+ var i;
+ result = this._fmindex.getSubstring$II(position, length);
+ str = [ ];
+ for (i = 0; i < result.length; i++) {
+ str.push(this._compressCode2utf16[result.charCodeAt(i)]);
+ }
+ return str.join('');
+};
+
+/**
+ * class Binary extends Object
+ * @constructor
+ */
+function Binary() {
+}
+
+/**
+ * @constructor
+ */
+function Binary$() {
+};
+
+Binary$.prototype = new Binary;
+
+/**
+ * @param {!number} num
+ * @return {!string}
+ */
+Binary.dump32bitNumber$N = function (num) {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ result = [ String.fromCharCode(Math.floor(num / 65536)) ];
+ result.push(String.fromCharCode(num % 65536));
+ return result.join("");
+};
+
+var Binary$dump32bitNumber$N = Binary.dump32bitNumber$N;
+
+/**
+ * @param {!string} buffer
+ * @param {!number} offset
+ * @return {!number}
+ */
+Binary.load32bitNumber$SI = function (buffer, offset) {
+ /** @type {!number} */
+ var result;
+ result = buffer.charCodeAt(offset) * 65536 + buffer.charCodeAt(offset + 1);
+ return result;
+};
+
+var Binary$load32bitNumber$SI = Binary.load32bitNumber$SI;
+
+/**
+ * @param {!number} num
+ * @return {!string}
+ */
+Binary.dump16bitNumber$I = function (num) {
+ return String.fromCharCode(num % 65536);
+};
+
+var Binary$dump16bitNumber$I = Binary.dump16bitNumber$I;
+
+/**
+ * @param {!string} buffer
+ * @param {!number} offset
+ * @return {!number}
+ */
+Binary.load16bitNumber$SI = function (buffer, offset) {
+ return (buffer.charCodeAt(offset) | 0);
+};
+
+var Binary$load16bitNumber$SI = Binary.load16bitNumber$SI;
+
+/**
+ * @param {!string} str
+ * @return {!string}
+ */
+Binary.dumpString$S = function (str) {
+ return Binary$dumpString$SLCompressionReport$(str, null);
+};
+
+var Binary$dumpString$S = Binary.dumpString$S;
+
+/**
+ * @param {!string} str
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+Binary.dumpString$SLCompressionReport$ = function (str, report) {
+ /** @type {!number} */
+ var length;
+ /** @type {!boolean} */
+ var compress;
+ /** @type {Array.<undefined|!number>} */
+ var charCodes;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var charCode;
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {undefined|!number} */
+ var bytes;
+ if (str.length > 32768) {
+ str = str.slice(0, 32768);
+ }
+ length = str.length;
+ compress = true;
+ charCodes = [ ];
+ for (i = 0; i < length; i++) {
+ charCode = str.charCodeAt(i);
+ if (charCode > 255) {
+ compress = false;
+ break;
+ }
+ charCodes.push(charCode);
+ }
+ if (compress) {
+ result = [ Binary$dump16bitNumber$I(length + 32768) ];
+ for (i = 0; i < length; i += 2) {
+ bytes = charCodes[i];
+ if (i !== length - 1) {
+ bytes += charCodes[i + 1] << 8;
+ }
+ result.push(String.fromCharCode(bytes % 65536));
+ }
+ if (report) {
+ CompressionReport$add$LCompressionReport$II(report, length, Math.ceil(length / 2));
+ }
+ } else {
+ result = [ Binary$dump16bitNumber$I(length), str ];
+ if (report) {
+ CompressionReport$add$LCompressionReport$II(report, length, length);
+ }
+ }
+ return result.join('');
+};
+
+var Binary$dumpString$SLCompressionReport$ = Binary.dumpString$SLCompressionReport$;
+
+/**
+ * @param {!string} buffer
+ * @param {!number} offset
+ * @return {LoadedStringResult}
+ */
+Binary.loadString$SI = function (buffer, offset) {
+ return new LoadedStringResult$SI(buffer, offset);
+};
+
+var Binary$loadString$SI = Binary.loadString$SI;
+
+/**
+ * @param {Array.<undefined|!string>} strList
+ * @return {!string}
+ */
+Binary.dumpStringList$AS = function (strList) {
+ return Binary$dumpStringList$ASLCompressionReport$(strList, null);
+};
+
+var Binary$dumpStringList$AS = Binary.dumpStringList$AS;
+
+/**
+ * @param {Array.<undefined|!string>} strList
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+Binary.dumpStringList$ASLCompressionReport$ = function (strList, report) {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var i;
+ result = [ Binary$dump32bitNumber$N(strList.length) ];
+ for (i = 0; i < strList.length; i++) {
+ result.push(Binary$dumpString$SLCompressionReport$(strList[i], report));
+ }
+ return result.join('');
+};
+
+var Binary$dumpStringList$ASLCompressionReport$ = Binary.dumpStringList$ASLCompressionReport$;
+
+/**
+ * @param {!string} buffer
+ * @param {!number} offset
+ * @return {LoadedStringListResult}
+ */
+Binary.loadStringList$SI = function (buffer, offset) {
+ return new LoadedStringListResult$SI(buffer, offset);
+};
+
+var Binary$loadStringList$SI = Binary.loadStringList$SI;
+
+/**
+ * @param {Object.<string, undefined|Array.<undefined|!string>>} strMap
+ * @return {!string}
+ */
+Binary.dumpStringListMap$HAS = function (strMap) {
+ return Binary$dumpStringListMap$HASLCompressionReport$(strMap, null);
+};
+
+var Binary$dumpStringListMap$HAS = Binary.dumpStringListMap$HAS;
+
+/**
+ * @param {Object.<string, undefined|Array.<undefined|!string>>} strMap
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+Binary.dumpStringListMap$HASLCompressionReport$ = function (strMap, report) {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var counter;
+ /** @type {!string} */
+ var key;
+ result = [ ];
+ counter = 0;
+ for (key in strMap) {
+ result.push(Binary$dumpString$SLCompressionReport$(key, report));
+ result.push(Binary$dumpStringList$ASLCompressionReport$(strMap[key], report));
+ counter++;
+ }
+ return Binary$dump32bitNumber$N(counter) + result.join('');
+};
+
+var Binary$dumpStringListMap$HASLCompressionReport$ = Binary.dumpStringListMap$HASLCompressionReport$;
+
+/**
+ * @param {!string} buffer
+ * @param {!number} offset
+ * @return {LoadedStringListMapResult}
+ */
+Binary.loadStringListMap$SI = function (buffer, offset) {
+ return new LoadedStringListMapResult$SI(buffer, offset);
+};
+
+var Binary$loadStringListMap$SI = Binary.loadStringListMap$SI;
+
+/**
+ * @param {Array.<undefined|!number>} array
+ * @return {!string}
+ */
+Binary.dump32bitNumberList$AN = function (array) {
+ return Binary$dump32bitNumberList$ANLCompressionReport$(array, null);
+};
+
+var Binary$dump32bitNumberList$AN = Binary.dump32bitNumberList$AN;
+
+/**
+ * @param {Array.<undefined|!number>} array
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+Binary.dump32bitNumberList$ANLCompressionReport$ = function (array, report) {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var index;
+ /** @type {!number} */
+ var inputLength;
+ /** @type {!number} */
+ var length;
+ /** @type {!string} */
+ var resultString;
+ /** @type {!number} */
+ var value1$0;
+ /** @type {!number} */
+ var value2$0;
+ result = [ Binary$dump32bitNumber$N(array.length) ];
+ index = 0;
+ inputLength = array.length;
+ while (index < inputLength) {
+ if (array[index] == 0) {
+ length = Binary$_countZero$ANI(array, index);
+ result.push(Binary$_zeroBlock$I(length));
+ index += length;
+ } else {
+ if (Binary$_shouldZebraCode$ANI(array, index)) {
+ result.push(Binary$_createZebraCode$ANI(array, index));
+ value1$0 = array.length;
+ value2$0 = index + 15;
+ index = (value1$0 <= value2$0 ? value1$0 : value2$0);
+ } else {
+ length = Binary$_searchDoubleZero$ANI(array, index);
+ result.push(Binary$_nonZeroBlock$ANII(array, index, length));
+ if (length === 0) {
+ throw new Error('');
+ }
+ index += length;
+ }
+ }
+ }
+ resultString = result.join('');
+ if (report) {
+ CompressionReport$add$LCompressionReport$II(report, array.length * 2 + 2, resultString.length);
+ }
+ return resultString;
+};
+
+var Binary$dump32bitNumberList$ANLCompressionReport$ = Binary.dump32bitNumberList$ANLCompressionReport$;
+
+/**
+ * @param {!string} buffer
+ * @param {!number} offset
+ * @return {LoadedNumberListResult}
+ */
+Binary.load32bitNumberList$SI = function (buffer, offset) {
+ return new LoadedNumberListResult$SI(buffer, offset);
+};
+
+var Binary$load32bitNumberList$SI = Binary.load32bitNumberList$SI;
+
+/**
+ * @param {Array.<undefined|!number>} array
+ * @param {!number} offset
+ * @return {!number}
+ */
+Binary._countZero$ANI = function (array, offset) {
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var array$len$0;
+ for ((i = offset, array$len$0 = array.length); i < array$len$0; i++) {
+ if (array[i] != 0) {
+ return (i - offset | 0);
+ }
+ }
+ return (array.length - offset | 0);
+};
+
+var Binary$_countZero$ANI = Binary._countZero$ANI;
+
+/**
+ * @param {!number} length
+ * @return {!string}
+ */
+Binary._zeroBlock$I = function (length) {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ result = [ ];
+ while (length > 0) {
+ if (length > 16384) {
+ result.push(Binary$dump16bitNumber$I(16383));
+ length -= 16384;
+ } else {
+ result.push(Binary$dump16bitNumber$I(length - 1));
+ length = 0;
+ }
+ }
+ return result.join('');
+};
+
+var Binary$_zeroBlock$I = Binary._zeroBlock$I;
+
+/**
+ * @param {Array.<undefined|!number>} array
+ * @param {!number} offset
+ * @return {!boolean}
+ */
+Binary._shouldZebraCode$ANI = function (array, offset) {
+ /** @type {!number} */
+ var change;
+ /** @type {!boolean} */
+ var isLastZero;
+ /** @type {!number} */
+ var i;
+ if (array.length - offset < 16) {
+ return true;
+ }
+ change = 0;
+ isLastZero = false;
+ for (i = offset; i < offset + 15; i++) {
+ if (array[i] == 0) {
+ if (! isLastZero) {
+ isLastZero = true;
+ change++;
+ }
+ } else {
+ if (isLastZero) {
+ isLastZero = false;
+ change++;
+ }
+ }
+ }
+ return change > 2;
+};
+
+var Binary$_shouldZebraCode$ANI = Binary._shouldZebraCode$ANI;
+
+/**
+ * @param {Array.<undefined|!number>} array
+ * @param {!number} offset
+ * @return {!number}
+ */
+Binary._searchDoubleZero$ANI = function (array, offset) {
+ /** @type {!boolean} */
+ var isLastZero;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var array$len$0;
+ isLastZero = false;
+ for ((i = offset, array$len$0 = array.length); i < array$len$0; i++) {
+ if (array[i] == 0) {
+ if (isLastZero) {
+ return (i - offset - 1 | 0);
+ }
+ isLastZero = true;
+ } else {
+ isLastZero = false;
+ }
+ }
+ return (array.length - offset | 0);
+};
+
+var Binary$_searchDoubleZero$ANI = Binary._searchDoubleZero$ANI;
+
+/**
+ * @param {Array.<undefined|!number>} array
+ * @param {!number} offset
+ * @param {!number} length
+ * @return {!string}
+ */
+Binary._nonZeroBlock$ANII = function (array, offset, length) {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var blockLength;
+ /** @type {!number} */
+ var i;
+ result = [ ];
+ while (length > 0) {
+ if (length > 16384) {
+ blockLength = 16384;
+ length -= 16384;
+ } else {
+ blockLength = length;
+ length = 0;
+ }
+ result.push(Binary$dump16bitNumber$I(blockLength - 1 + 0x4000));
+ for (i = offset; i < offset + blockLength; i++) {
+ result.push(Binary$dump32bitNumber$N(array[i]));
+ }
+ offset += blockLength;
+ }
+ return result.join('');
+};
+
+var Binary$_nonZeroBlock$ANII = Binary._nonZeroBlock$ANII;
+
+/**
+ * @param {Array.<undefined|!number>} array
+ * @param {!number} offset
+ * @return {!string}
+ */
+Binary._createZebraCode$ANI = function (array, offset) {
+ /** @type {!number} */
+ var last;
+ /** @type {!number} */
+ var code;
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var value1$0;
+ /** @type {!number} */
+ var value2$0;
+ value1$0 = offset + 15;
+ value2$0 = array.length;
+ last = (value1$0 <= value2$0 ? value1$0 : value2$0);
+ code = 0x8000;
+ result = [ ];
+ for (i = offset; i < last; i++) {
+ if (array[i] != 0) {
+ result.push(Binary$dump32bitNumber$N(array[i]));
+ code = code + (0x1 << i - offset);
+ }
+ }
+ return String.fromCharCode(code) + result.join('');
+};
+
+var Binary$_createZebraCode$ANI = Binary._createZebraCode$ANI;
+
+/**
+ * @param {!string} str
+ * @return {!string}
+ */
+Binary.base64encode$S = function (str) {
+ /** @type {Array.<undefined|!string>} */
+ var out;
+ /** @type {Array.<undefined|!number>} */
+ var source;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var code;
+ /** @type {!number} */
+ var len;
+ /** @type {!number} */
+ var c1;
+ /** @type {undefined|!number} */
+ var c2;
+ /** @type {undefined|!number} */
+ var c3;
+ out = [ ];
+ source = [ ];
+ for (i = 0; i < str.length; i++) {
+ code = str.charCodeAt(i);
+ source.push(code & 0x00ff, code >>> 8);
+ }
+ len = str.length * 2;
+ i = 0;
+ while (i < len) {
+ c1 = source[i++] & 0xff;
+ if (i === len) {
+ out.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(c1 >> 2));
+ out.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((c1 & 0x3) << 4));
+ out.push("==");
+ break;
+ }
+ c2 = source[i++];
+ if (i === len) {
+ out.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(c1 >> 2));
+ out.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((c1 & 0x3) << 4 | (c2 & 0xF0) >> 4));
+ out.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((c2 & 0xF) << 2));
+ out.push("=");
+ break;
+ }
+ c3 = source[i++];
+ out.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(c1 >> 2));
+ out.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((c1 & 0x3) << 4 | (c2 & 0xF0) >> 4));
+ out.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((c2 & 0xF) << 2 | (c3 & 0xC0) >> 6));
+ out.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(c3 & 0x3F));
+ }
+ return out.join('');
+};
+
+var Binary$base64encode$S = Binary.base64encode$S;
+
+/**
+ * @param {Array.<undefined|!number>} source
+ * @return {!string}
+ */
+Binary._mergeCharCode$AI = function (source) {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var i;
+ result = [ ];
+ for (i = 0; i < source.length; i += 2) {
+ result.push(String.fromCharCode(source[i] + (source[i + 1] << 8)));
+ }
+ return result.join('');
+};
+
+var Binary$_mergeCharCode$AI = Binary._mergeCharCode$AI;
+
+/**
+ * @param {!string} str
+ * @return {!string}
+ */
+Binary.base64decode$S = function (str) {
+ /** @type {!number} */
+ var len;
+ /** @type {!number} */
+ var i;
+ /** @type {Array.<undefined|!number>} */
+ var out;
+ /** @type {undefined|!number} */
+ var c1;
+ /** @type {undefined|!number} */
+ var c2;
+ /** @type {!number} */
+ var c3;
+ /** @type {!number} */
+ var c4;
+ len = str.length;
+ i = 0;
+ out = [ ];
+ while (i < len) {
+ do {
+ c1 = Binary._base64DecodeChars[str.charCodeAt(i++) & 0xff];
+ } while (i < len && c1 == -1);
+ if (c1 == -1) {
+ break;
+ }
+ do {
+ c2 = Binary._base64DecodeChars[str.charCodeAt(i++) & 0xff];
+ } while (i < len && c2 == -1);
+ if (c2 == -1) {
+ break;
+ }
+ out.push(c1 << 2 | (c2 & 0x30) >> 4);
+ do {
+ c3 = str.charCodeAt(i++) & 0xff;
+ if (c3 === 61) {
+ return Binary$_mergeCharCode$AI(out);
+ }
+ c3 = Binary._base64DecodeChars[c3];
+ } while (i < len && c3 === -1);
+ if (c3 === -1) {
+ break;
+ }
+ out.push((c2 & 0XF) << 4 | (c3 & 0x3C) >> 2);
+ do {
+ c4 = str.charCodeAt(i++) & 0xff;
+ if (c4 === 61) {
+ return Binary$_mergeCharCode$AI(out);
+ }
+ c4 = (Binary._base64DecodeChars[c4] | 0);
+ } while (i < len && c4 === -1);
+ if (c4 === -1) {
+ break;
+ }
+ out.push((c3 & 0x03) << 6 | c4);
+ }
+ return Binary$_mergeCharCode$AI(out);
+};
+
+var Binary$base64decode$S = Binary.base64decode$S;
+
+/**
+ * class LoadedStringResult extends Object
+ * @constructor
+ */
+function LoadedStringResult() {
+}
+
+/**
+ * @constructor
+ * @param {!string} data
+ * @param {!number} offset
+ */
+function LoadedStringResult$SI(data, offset) {
+ /** @type {!number} */
+ var strLength;
+ /** @type {Array.<undefined|!string>} */
+ var bytes;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var code;
+ /** @type {!number} */
+ var offset$0;
+ this.result = "";
+ this.offset = 0;
+ offset$0 = offset++;
+ strLength = data.charCodeAt(offset$0);
+ if (strLength > 32767) {
+ strLength = strLength - 32768;
+ bytes = [ ];
+ for (i = 0; i < strLength; i += 2) {
+ code = data.charCodeAt(offset);
+ bytes.push(String.fromCharCode(code & 0x00ff));
+ if (i !== strLength - 1) {
+ bytes.push(String.fromCharCode(code >>> 8));
+ }
+ offset++;
+ }
+ this.result = bytes.join('');
+ this.offset = offset;
+ } else {
+ this.result = data.slice(offset, offset + strLength);
+ this.offset = (offset + strLength | 0);
+ }
+};
+
+LoadedStringResult$SI.prototype = new LoadedStringResult;
+
+/**
+ * class LoadedStringListResult extends Object
+ * @constructor
+ */
+function LoadedStringListResult() {
+}
+
+/**
+ * @constructor
+ * @param {!string} data
+ * @param {!number} offset
+ */
+function LoadedStringListResult$SI(data, offset) {
+ /** @type {!number} */
+ var length;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var strLength;
+ /** @type {!string} */
+ var resultStr;
+ /** @type {Array.<undefined|!string>} */
+ var bytes;
+ /** @type {!number} */
+ var j;
+ /** @type {!number} */
+ var code;
+ /** @type {!number} */
+ var result$0;
+ /** @type {!number} */
+ var offset$0;
+ this.offset = 0;
+ this.result = [ ];
+ result$0 = data.charCodeAt(offset) * 65536 + data.charCodeAt(offset + 1);
+ length = result$0;
+ offset += 2;
+ for (i = 0; i < length; i++) {
+ offset$0 = offset++;
+ strLength = data.charCodeAt(offset$0);
+ if (strLength > 32767) {
+ strLength = strLength - 32768;
+ bytes = [ ];
+ for (j = 0; j < strLength; j += 2) {
+ code = data.charCodeAt(offset);
+ bytes.push(String.fromCharCode(code & 0x00ff));
+ if (j !== strLength - 1) {
+ bytes.push(String.fromCharCode(code >>> 8));
+ }
+ offset++;
+ }
+ resultStr = bytes.join('');
+ } else {
+ resultStr = data.slice(offset, offset + strLength);
+ offset = (offset + strLength | 0);
+ }
+ this.result.push(resultStr);
+ }
+ this.offset = offset;
+};
+
+LoadedStringListResult$SI.prototype = new LoadedStringListResult;
+
+/**
+ * class LoadedStringListMapResult extends Object
+ * @constructor
+ */
+function LoadedStringListMapResult() {
+}
+
+/**
+ * @constructor
+ * @param {!string} data
+ * @param {!number} offset
+ */
+function LoadedStringListMapResult$SI(data, offset) {
+ /** @type {!number} */
+ var length;
+ /** @type {!number} */
+ var i;
+ /** @type {LoadedStringResult} */
+ var keyResult;
+ /** @type {LoadedStringListResult} */
+ var valueResult;
+ /** @type {!number} */
+ var result$0;
+ /** @type {!number} */
+ var offset$0;
+ this.offset = 0;
+ this.result = ({ });
+ result$0 = data.charCodeAt(offset) * 65536 + data.charCodeAt(offset + 1);
+ length = result$0;
+ offset += 2;
+ for (i = 0; i < length; i++) {
+ keyResult = new LoadedStringResult$SI(data, offset);
+ offset$0 = keyResult.offset;
+ valueResult = new LoadedStringListResult$SI(data, offset$0);
+ this.result[keyResult.result] = valueResult.result;
+ offset = valueResult.offset;
+ }
+ this.offset = offset;
+};
+
+LoadedStringListMapResult$SI.prototype = new LoadedStringListMapResult;
+
+/**
+ * class LoadedNumberListResult extends Object
+ * @constructor
+ */
+function LoadedNumberListResult() {
+}
+
+/**
+ * @constructor
+ * @param {!string} data
+ * @param {!number} offset
+ */
+function LoadedNumberListResult$SI(data, offset) {
+ /** @type {!number} */
+ var resultLength;
+ /** @type {!number} */
+ var originalOffset;
+ /** @type {Array.<undefined|!number>} */
+ var result;
+ /** @type {!number} */
+ var tag;
+ /** @type {!number} */
+ var length;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var result$0;
+ /** @type {!number} */
+ var value1$0;
+ this.result = null;
+ this.offset = 0;
+ result$0 = data.charCodeAt(offset) * 65536 + data.charCodeAt(offset + 1);
+ resultLength = result$0;
+ originalOffset = offset;
+ offset += 2;
+ result = [ ];
+ while (result.length < resultLength) {
+ tag = data.charCodeAt(offset++);
+ if (tag >>> 15 === 1) {
+ value1$0 = resultLength - result.length;
+ length = (value1$0 <= 15 ? value1$0 : 15);
+ for (i = 0; i < length; i++) {
+ if (tag >>> i & 0x1) {
+ result.push(Binary$load32bitNumber$SI(data, offset));
+ offset += 2;
+ } else {
+ result.push(0);
+ }
+ }
+ } else {
+ if (tag >>> 14 === 1) {
+ length = tag - 0x4000 + 1;
+ for (i = 0; i < length; i++) {
+ result.push(Binary$load32bitNumber$SI(data, offset));
+ offset += 2;
+ }
+ } else {
+ length = tag + 1;
+ for (i = 0; i < length; i++) {
+ result.push(0);
+ }
+ }
+ }
+ }
+ this.result = result;
+ this.offset = offset;
+};
+
+LoadedNumberListResult$SI.prototype = new LoadedNumberListResult;
+
+/**
+ * class CompressionReport extends Object
+ * @constructor
+ */
+function CompressionReport() {
+}
+
+/**
+ * @constructor
+ */
+function CompressionReport$() {
+ this.source = 0;
+ this.result = 0;
+};
+
+CompressionReport$.prototype = new CompressionReport;
+
+/**
+ * @param {CompressionReport} $this
+ * @param {!number} source
+ * @param {!number} result
+ */
+CompressionReport.add$LCompressionReport$II = function ($this, source, result) {
+ $this.source += source;
+ $this.result += result;
+};
+
+var CompressionReport$add$LCompressionReport$II = CompressionReport.add$LCompressionReport$II;
+
+/**
+ * @param {CompressionReport} $this
+ * @return {!number}
+ */
+CompressionReport.rate$LCompressionReport$ = function ($this) {
+ return (Math.round($this.result * 100.0 / $this.source) | 0);
+};
+
+var CompressionReport$rate$LCompressionReport$ = CompressionReport.rate$LCompressionReport$;
+
+/**
+ * class Query extends Object
+ * @constructor
+ */
+function Query() {
+}
+
+/**
+ * @constructor
+ */
+function Query$() {
+ this.word = '';
+ this.or = false;
+ this.not = false;
+ this.raw = false;
+};
+
+Query$.prototype = new Query;
+
+/**
+ * @return {!string}
+ */
+Query.prototype.toString = function () {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ result = [ ];
+ if (this.or) {
+ result.push("OR ");
+ }
+ if (this.not) {
+ result.push("-");
+ }
+ if (this.raw) {
+ result.push('"', this.word, '"');
+ } else {
+ result.push(this.word);
+ }
+ return result.join('');
+};
+
+/**
+ * class QueryStringParser extends Object
+ * @constructor
+ */
+function QueryStringParser() {
+}
+
+/**
+ * @constructor
+ */
+function QueryStringParser$() {
+ this.queries = [ ];
+};
+
+QueryStringParser$.prototype = new QueryStringParser;
+
+/**
+ * @param {QueryStringParser} $this
+ * @param {!string} queryString
+ * @return {Array.<undefined|Query>}
+ */
+QueryStringParser.parse$LQueryStringParser$S = function ($this, queryString) {
+ /** @type {!boolean} */
+ var nextOr;
+ /** @type {!boolean} */
+ var nextNot;
+ /** @type {!number} */
+ var currentWordStart;
+ /** @type {!number} */
+ var status;
+ /** @type {RegExp} */
+ var isSpace;
+ /** @type {!number} */
+ var i;
+ /** @type {!string} */
+ var ch;
+ /** @type {!string} */
+ var word;
+ /** @type {Query} */
+ var query;
+ nextOr = false;
+ nextNot = false;
+ currentWordStart = 0;
+ status = 0;
+ isSpace = /[\s\u3000]/;
+ for (i = 0; i < queryString.length; i++) {
+ ch = queryString.charAt(i);
+ switch (status) {
+ case 0:
+ if (! isSpace.test(ch)) {
+ if (ch === '-') {
+ nextNot = true;
+ } else {
+ if (ch === '"') {
+ currentWordStart = i + 1;
+ status = 2;
+ } else {
+ currentWordStart = i;
+ status = 1;
+ }
+ }
+ } else {
+ nextNot = false;
+ }
+ break;
+ case 1:
+ if (isSpace.test(ch)) {
+ word = queryString.slice(currentWordStart, i);
+ if (word === 'OR') {
+ nextOr = true;
+ } else {
+ query = new Query$();
+ query.word = word;
+ query.or = nextOr;
+ query.not = nextNot;
+ $this.queries.push(query);
+ nextOr = false;
+ nextNot = false;
+ }
+ status = 0;
+ }
+ break;
+ case 2:
+ if (ch === '"') {
+ word = queryString.slice(currentWordStart, i);
+ query = new Query$();
+ query.word = word;
+ query.or = nextOr;
+ query.not = nextNot;
+ query.raw = true;
+ $this.queries.push(query);
+ nextOr = false;
+ nextNot = false;
+ status = 0;
+ }
+ break;
+ }
+ }
+ switch (status) {
+ case 0:
+ break;
+ case 1:
+ query = new Query$();
+ word = queryString.slice(currentWordStart, queryString.length);
+ if (word !== 'OR') {
+ query.word = word;
+ query.or = nextOr;
+ query.not = nextNot;
+ $this.queries.push(query);
+ }
+ break;
+ case 2:
+ query = new Query$();
+ query.word = queryString.slice(currentWordStart, queryString.length);
+ query.or = nextOr;
+ query.not = nextNot;
+ query.raw = true;
+ $this.queries.push(query);
+ break;
+ }
+ return $this.queries;
+};
+
+var QueryStringParser$parse$LQueryStringParser$S = QueryStringParser.parse$LQueryStringParser$S;
+
+/**
+ * @param {QueryStringParser} $this
+ * @return {!string}
+ */
+QueryStringParser.highlight$LQueryStringParser$ = function ($this) {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var i;
+ /** @type {Query} */
+ var query;
+ result = [ ];
+ for (i = 0; i < $this.queries.length; i++) {
+ query = $this.queries[i];
+ if (! query.not) {
+ result.push("highlight=" + $__jsx_encodeURIComponent(query.word));
+ }
+ }
+ return '?' + result.join('&');
+};
+
+var QueryStringParser$highlight$LQueryStringParser$ = QueryStringParser.highlight$LQueryStringParser$;
+
+/**
+ * class Proposal extends Object
+ * @constructor
+ */
+function Proposal() {
+}
+
+/**
+ * @constructor
+ * @param {!number} omit
+ * @param {!number} expect
+ */
+function Proposal$II(omit, expect) {
+ this.omit = omit;
+ this.expect = expect;
+};
+
+Proposal$II.prototype = new Proposal;
+
+/**
+ * class Position extends Object
+ * @constructor
+ */
+function Position() {
+}
+
+/**
+ * @constructor
+ * @param {!string} word
+ * @param {!number} position
+ * @param {!boolean} stemmed
+ */
+function Position$SIB(word, position, stemmed) {
+ this.word = word;
+ this.position = position;
+ this.stemmed = stemmed;
+};
+
+Position$SIB.prototype = new Position;
+
+/**
+ * class SearchUnit extends Object
+ * @constructor
+ */
+function SearchUnit() {
+}
+
+/**
+ * @constructor
+ * @param {!number} id
+ */
+function SearchUnit$I(id) {
+ this.positions = ({ });
+ this.id = id;
+ this._size = 0;
+ this.score = 0;
+ this.startPosition = -1;
+};
+
+SearchUnit$I.prototype = new SearchUnit;
+
+/**
+ * @param {SearchUnit} $this
+ * @param {!string} word
+ * @param {!number} position
+ * @param {!boolean} stemmed
+ */
+SearchUnit.addPosition$LSearchUnit$SIB = function ($this, word, position, stemmed) {
+ /** @type {Position} */
+ var positionObj;
+ positionObj = $this.positions[position + ""];
+ if (! positionObj) {
+ $this._size++;
+ $this.positions[position + ""] = ({word: word, position: position, stemmed: stemmed});
+ } else {
+ if (positionObj.word.length < word.length) {
+ positionObj.word = word;
+ }
+ positionObj.stemmed = positionObj.stemmed && stemmed;
+ }
+};
+
+var SearchUnit$addPosition$LSearchUnit$SIB = SearchUnit.addPosition$LSearchUnit$SIB;
+
+/**
+ * @param {SearchUnit} $this
+ * @param {!number} position
+ * @return {Position}
+ */
+SearchUnit.get$LSearchUnit$I = function ($this, position) {
+ return $this.positions[position + ""];
+};
+
+var SearchUnit$get$LSearchUnit$I = SearchUnit.get$LSearchUnit$I;
+
+/**
+ * @param {SearchUnit} $this
+ * @return {!number}
+ */
+SearchUnit.size$LSearchUnit$ = function ($this) {
+ return $this._size;
+};
+
+var SearchUnit$size$LSearchUnit$ = SearchUnit.size$LSearchUnit$;
+
+/**
+ * @param {SearchUnit} $this
+ * @param {SearchUnit} rhs
+ */
+SearchUnit.merge$LSearchUnit$LSearchUnit$ = function ($this, rhs) {
+ /** @type {!string} */
+ var position;
+ /** @type {Position} */
+ var pos;
+ for (position in rhs.positions) {
+ pos = rhs.positions[position];
+ SearchUnit$addPosition$LSearchUnit$SIB($this, pos.word, pos.position, pos.stemmed);
+ }
+};
+
+var SearchUnit$merge$LSearchUnit$LSearchUnit$ = SearchUnit.merge$LSearchUnit$LSearchUnit$;
+
+/**
+ * @param {SearchUnit} $this
+ * @return {Array.<undefined|Position>}
+ */
+SearchUnit.getPositions$LSearchUnit$ = function ($this) {
+ /** @type {Array.<undefined|Position>} */
+ var result;
+ /** @type {!string} */
+ var pos;
+ result = [ ];
+ for (pos in $this.positions) {
+ result.push($this.positions[pos]);
+ }
+ result.sort((function (a, b) {
+ return a.position - b.position;
+ }));
+ return result;
+};
+
+var SearchUnit$getPositions$LSearchUnit$ = SearchUnit.getPositions$LSearchUnit$;
+
+/**
+ * class SingleResult extends Object
+ * @constructor
+ */
+function SingleResult() {
+}
+
+/**
+ * @constructor
+ */
+function SingleResult$() {
+ this.units = [ ];
+ this.unitIds = [ ];
+ this.or = false;
+ this.not = false;
+ this.searchWord = '';
+};
+
+SingleResult$.prototype = new SingleResult;
+
+/**
+ * @constructor
+ * @param {!string} searchWord
+ * @param {!boolean} or
+ * @param {!boolean} not
+ */
+function SingleResult$SBB(searchWord, or, not) {
+ this.units = [ ];
+ this.unitIds = [ ];
+ this.or = or;
+ this.not = not;
+ this.searchWord = searchWord;
+};
+
+SingleResult$SBB.prototype = new SingleResult;
+
+/**
+ * @param {SingleResult} $this
+ * @param {!number} unitId
+ * @return {SearchUnit}
+ */
+SingleResult.getSearchUnit$LSingleResult$I = function ($this, unitId) {
+ /** @type {!number} */
+ var existing;
+ /** @type {SearchUnit} */
+ var result;
+ existing = $this.unitIds.indexOf(unitId);
+ if (existing === -1) {
+ result = ({positions: ({ }), id: unitId, _size: 0, score: 0, startPosition: -1});
+ $this.units.push(result);
+ $this.unitIds.push(unitId);
+ } else {
+ result = $this.units[existing];
+ }
+ return result;
+};
+
+var SingleResult$getSearchUnit$LSingleResult$I = SingleResult.getSearchUnit$LSingleResult$I;
+
+/**
+ * @param {SingleResult} $this
+ * @param {SingleResult} rhs
+ * @return {SingleResult}
+ */
+SingleResult.merge$LSingleResult$LSingleResult$ = function ($this, rhs) {
+ /** @type {SingleResult} */
+ var result;
+ result = ({units: [ ], unitIds: [ ], or: false, not: false, searchWord: ''});
+ if (rhs.or) {
+ SingleResult$_orMerge$LSingleResult$LSingleResult$LSingleResult$($this, result, rhs);
+ } else {
+ if (rhs.not) {
+ SingleResult$_notMerge$LSingleResult$LSingleResult$LSingleResult$($this, result, rhs);
+ } else {
+ SingleResult$_andMerge$LSingleResult$LSingleResult$LSingleResult$($this, result, rhs);
+ }
+ }
+ return result;
+};
+
+var SingleResult$merge$LSingleResult$LSingleResult$ = SingleResult.merge$LSingleResult$LSingleResult$;
+
+/**
+ * @param {SingleResult} $this
+ * @return {!number}
+ */
+SingleResult.size$LSingleResult$ = function ($this) {
+ return ($this.units.length | 0);
+};
+
+var SingleResult$size$LSingleResult$ = SingleResult.size$LSingleResult$;
+
+/**
+ * @param {SingleResult} $this
+ * @param {SingleResult} result
+ * @param {SingleResult} rhs
+ */
+SingleResult._andMerge$LSingleResult$LSingleResult$LSingleResult$ = function ($this, result, rhs) {
+ /** @type {!number} */
+ var i;
+ /** @type {undefined|!number} */
+ var id;
+ /** @type {SearchUnit} */
+ var lhsSection;
+ for (i = 0; i < $this.unitIds.length; i++) {
+ id = $this.unitIds[i];
+ if (rhs.unitIds.indexOf(id) !== -1) {
+ lhsSection = $this.units[i];
+ result.unitIds.push(id);
+ result.units.push(lhsSection);
+ }
+ }
+};
+
+var SingleResult$_andMerge$LSingleResult$LSingleResult$LSingleResult$ = SingleResult._andMerge$LSingleResult$LSingleResult$LSingleResult$;
+
+/**
+ * @param {SingleResult} $this
+ * @param {SingleResult} result
+ * @param {SingleResult} rhs
+ */
+SingleResult._orMerge$LSingleResult$LSingleResult$LSingleResult$ = function ($this, result, rhs) {
+ /** @type {!number} */
+ var i;
+ /** @type {undefined|!number} */
+ var id;
+ /** @type {SearchUnit} */
+ var rhsSection;
+ /** @type {SearchUnit} */
+ var lhsSection;
+ /** @type {Array.<undefined|!number>} */
+ var unitIds$0;
+ /** @type {Array.<undefined|SearchUnit>} */
+ var units$0;
+ result.unitIds = (unitIds$0 = $this.unitIds).slice(0, unitIds$0.length);
+ result.units = (units$0 = $this.units).slice(0, units$0.length);
+ for (i = 0; i < rhs.unitIds.length; i++) {
+ id = rhs.unitIds[i];
+ rhsSection = rhs.units[i];
+ if (result.unitIds.indexOf(id) !== -1) {
+ lhsSection = result.units[result.unitIds.indexOf(id)];
+ SearchUnit$merge$LSearchUnit$LSearchUnit$(lhsSection, rhsSection);
+ } else {
+ result.unitIds.push(id);
+ result.units.push(rhsSection);
+ }
+ }
+};
+
+var SingleResult$_orMerge$LSingleResult$LSingleResult$LSingleResult$ = SingleResult._orMerge$LSingleResult$LSingleResult$LSingleResult$;
+
+/**
+ * @param {SingleResult} $this
+ * @param {SingleResult} result
+ * @param {SingleResult} rhs
+ */
+SingleResult._notMerge$LSingleResult$LSingleResult$LSingleResult$ = function ($this, result, rhs) {
+ /** @type {!number} */
+ var i;
+ /** @type {undefined|!number} */
+ var id;
+ /** @type {SearchUnit} */
+ var lhsSection;
+ for (i = 0; i < $this.unitIds.length; i++) {
+ id = $this.unitIds[i];
+ if (rhs.unitIds.indexOf(id) === -1) {
+ lhsSection = $this.units[i];
+ result.unitIds.push(id);
+ result.units.push(lhsSection);
+ }
+ }
+};
+
+var SingleResult$_notMerge$LSingleResult$LSingleResult$LSingleResult$ = SingleResult._notMerge$LSingleResult$LSingleResult$LSingleResult$;
+
+/**
+ * class SearchSummary extends Object
+ * @constructor
+ */
+function SearchSummary() {
+}
+
+/**
+ * @constructor
+ */
+function SearchSummary$() {
+ this.sourceResults = [ ];
+ this.result = null;
+ this.oktavia = null;
+};
+
+SearchSummary$.prototype = new SearchSummary;
+
+/**
+ * @constructor
+ * @param {Oktavia} oktavia
+ */
+function SearchSummary$LOktavia$(oktavia) {
+ this.sourceResults = [ ];
+ this.result = null;
+ this.oktavia = oktavia;
+};
+
+SearchSummary$LOktavia$.prototype = new SearchSummary;
+
+/**
+ * @param {SearchSummary} $this
+ * @param {SingleResult} result
+ */
+SearchSummary.addQuery$LSearchSummary$LSingleResult$ = function ($this, result) {
+ $this.sourceResults.push(result);
+};
+
+var SearchSummary$addQuery$LSearchSummary$LSingleResult$ = SearchSummary.addQuery$LSearchSummary$LSingleResult$;
+
+/**
+ * @param {SearchSummary} $this
+ */
+SearchSummary.mergeResult$LSearchSummary$ = function ($this) {
+ $this.result = SearchSummary$mergeResult$LSearchSummary$ALSingleResult$($this, $this.sourceResults);
+};
+
+var SearchSummary$mergeResult$LSearchSummary$ = SearchSummary.mergeResult$LSearchSummary$;
+
+/**
+ * @param {SearchSummary} $this
+ * @param {Array.<undefined|SingleResult>} results
+ * @return {SingleResult}
+ */
+SearchSummary.mergeResult$LSearchSummary$ALSingleResult$ = function ($this, results) {
+ /** @type {SingleResult} */
+ var rhs;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var results$len$0;
+ rhs = results[0];
+ for ((i = 1, results$len$0 = results.length); i < results$len$0; i++) {
+ rhs = SingleResult$merge$LSingleResult$LSingleResult$(rhs, results[i]);
+ }
+ return rhs;
+};
+
+var SearchSummary$mergeResult$LSearchSummary$ALSingleResult$ = SearchSummary.mergeResult$LSearchSummary$ALSingleResult$;
+
+/**
+ * @param {SearchSummary} $this
+ * @return {Array.<undefined|Proposal>}
+ */
+SearchSummary.getProposal$LSearchSummary$ = function ($this) {
+ /** @type {Array.<undefined|Proposal>} */
+ var proposals;
+ /** @type {!number} */
+ var i;
+ /** @type {Array.<undefined|SingleResult>} */
+ var tmpSource;
+ /** @type {!number} */
+ var j;
+ /** @type {SingleResult} */
+ var result;
+ proposals = [ ];
+ for (i = 0; i < $this.sourceResults.length; i++) {
+ tmpSource = [ ];
+ for (j = 0; j < $this.sourceResults.length; j++) {
+ if (i !== j) {
+ tmpSource.push($this.sourceResults[j]);
+ }
+ }
+ result = SearchSummary$mergeResult$LSearchSummary$ALSingleResult$($this, tmpSource);
+ proposals.push(({omit: i, expect: result.units.length}));
+ }
+ proposals.sort((function (a, b) {
+ return b.expect - a.expect;
+ }));
+ return proposals;
+};
+
+var SearchSummary$getProposal$LSearchSummary$ = SearchSummary.getProposal$LSearchSummary$;
+
+/**
+ * @param {SearchSummary} $this
+ * @return {Array.<undefined|SearchUnit>}
+ */
+SearchSummary.getSortedResult$LSearchSummary$ = function ($this) {
+ /** @type {Array.<undefined|SearchUnit>} */
+ var result;
+ /** @type {Array.<undefined|SearchUnit>} */
+ var units$0;
+ result = (units$0 = $this.result.units).slice(0, units$0.length);
+ result.sort((function (a, b) {
+ return b.score - a.score;
+ }));
+ return result;
+};
+
+var SearchSummary$getSortedResult$LSearchSummary$ = SearchSummary.getSortedResult$LSearchSummary$;
+
+/**
+ * @param {SearchSummary} $this
+ * @return {!number}
+ */
+SearchSummary.size$LSearchSummary$ = function ($this) {
+ /** @type {SingleResult} */
+ var this$0;
+ this$0 = $this.result;
+ return (this$0.units.length | 0);
+};
+
+var SearchSummary$size$LSearchSummary$ = SearchSummary.size$LSearchSummary$;
+
+/**
+ * @param {SearchSummary} $this
+ * @param {SingleResult} result
+ */
+SearchSummary.add$LSearchSummary$LSingleResult$ = function ($this, result) {
+ $this.sourceResults.push(result);
+};
+
+var SearchSummary$add$LSearchSummary$LSingleResult$ = SearchSummary.add$LSearchSummary$LSingleResult$;
+
+/**
+ * class Style extends Object
+ * @constructor
+ */
+function Style() {
+}
+
+/**
+ * @constructor
+ * @param {!string} mode
+ */
+function Style$S(mode) {
+ this.styles = null;
+ this.escapeHTML = false;
+ switch (mode) {
+ case 'console':
+ this.styles = Style.console;
+ break;
+ case 'html':
+ this.styles = Style.html;
+ break;
+ case 'ignore':
+ this.styles = Style.ignore;
+ break;
+ default:
+ this.styles = Style.ignore;
+ break;
+ }
+ this.escapeHTML = mode === 'html';
+};
+
+Style$S.prototype = new Style;
+
+/**
+ * @param {!string} source
+ * @return {!string}
+ */
+Style.prototype.convert$S = function (source) {
+ /** @type {_HTMLHandler} */
+ var handler;
+ /** @type {SAXParser} */
+ var parser;
+ handler = new _HTMLHandler$HASB(this.styles, this.escapeHTML);
+ parser = new SAXParser$LSAXHandler$(handler);
+ parser.parse$S(source);
+ return handler.text.join('');
+};
+
+/**
+ * class Stemmer
+ * @constructor
+ */
+function Stemmer() {
+}
+
+Stemmer.prototype.$__jsx_implements_Stemmer = true;
+
+/**
+ * @constructor
+ */
+function Stemmer$() {
+};
+
+Stemmer$.prototype = new Stemmer;
+
+/**
+ * class BaseStemmer extends Object
+ * @constructor
+ */
+function BaseStemmer() {
+}
+
+$__jsx_merge_interface(BaseStemmer, Stemmer);
+
+/**
+ * @constructor
+ */
+function BaseStemmer$() {
+ /** @type {!string} */
+ var current$0;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var limit$0;
+ this.cache = ({ });
+ current$0 = this.current = "";
+ cursor$0 = this.cursor = 0;
+ limit$0 = this.limit = current$0.length;
+ this.limit_backward = 0;
+ this.bra = cursor$0;
+ this.ket = limit$0;
+};
+
+BaseStemmer$.prototype = new BaseStemmer;
+
+/**
+ * @param {!string} value
+ */
+BaseStemmer.prototype.setCurrent$S = function (value) {
+ /** @type {!string} */
+ var current$0;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var limit$0;
+ current$0 = this.current = value;
+ cursor$0 = this.cursor = 0;
+ limit$0 = this.limit = current$0.length;
+ this.limit_backward = 0;
+ this.bra = cursor$0;
+ this.ket = limit$0;
+};
+
+/**
+ * @return {!string}
+ */
+BaseStemmer.prototype.getCurrent$ = function () {
+ return this.current;
+};
+
+/**
+ * @param {BaseStemmer} other
+ */
+BaseStemmer.prototype.copy_from$LBaseStemmer$ = function (other) {
+ this.current = other.current;
+ this.cursor = other.cursor;
+ this.limit = other.limit;
+ this.limit_backward = other.limit_backward;
+ this.bra = other.bra;
+ this.ket = other.ket;
+};
+
+/**
+ * @param {Array.<undefined|!number>} s
+ * @param {!number} min
+ * @param {!number} max
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.in_grouping$AIII = function (s, min, max) {
+ /** @type {!number} */
+ var ch;
+ if (this.cursor >= this.limit) {
+ return false;
+ }
+ ch = this.current.charCodeAt(this.cursor);
+ if (ch > max || ch < min) {
+ return false;
+ }
+ ch -= min;
+ if ((s[ch >>> 3] & 0x1 << (ch & 0x7)) === 0) {
+ return false;
+ }
+ this.cursor++;
+ return true;
+};
+
+/**
+ * @param {Array.<undefined|!number>} s
+ * @param {!number} min
+ * @param {!number} max
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.in_grouping_b$AIII = function (s, min, max) {
+ /** @type {!number} */
+ var ch;
+ if (this.cursor <= this.limit_backward) {
+ return false;
+ }
+ ch = this.current.charCodeAt(this.cursor - 1);
+ if (ch > max || ch < min) {
+ return false;
+ }
+ ch -= min;
+ if ((s[ch >>> 3] & 0x1 << (ch & 0x7)) === 0) {
+ return false;
+ }
+ this.cursor--;
+ return true;
+};
+
+/**
+ * @param {Array.<undefined|!number>} s
+ * @param {!number} min
+ * @param {!number} max
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.out_grouping$AIII = function (s, min, max) {
+ /** @type {!number} */
+ var ch;
+ if (this.cursor >= this.limit) {
+ return false;
+ }
+ ch = this.current.charCodeAt(this.cursor);
+ if (ch > max || ch < min) {
+ this.cursor++;
+ return true;
+ }
+ ch -= min;
+ if ((s[ch >>> 3] & 0X1 << (ch & 0x7)) === 0) {
+ this.cursor++;
+ return true;
+ }
+ return false;
+};
+
+/**
+ * @param {Array.<undefined|!number>} s
+ * @param {!number} min
+ * @param {!number} max
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.out_grouping_b$AIII = function (s, min, max) {
+ /** @type {!number} */
+ var ch;
+ if (this.cursor <= this.limit_backward) {
+ return false;
+ }
+ ch = this.current.charCodeAt(this.cursor - 1);
+ if (ch > max || ch < min) {
+ this.cursor--;
+ return true;
+ }
+ ch -= min;
+ if ((s[ch >>> 3] & 0x1 << (ch & 0x7)) === 0) {
+ this.cursor--;
+ return true;
+ }
+ return false;
+};
+
+/**
+ * @param {!number} min
+ * @param {!number} max
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.in_range$II = function (min, max) {
+ /** @type {!number} */
+ var ch;
+ if (this.cursor >= this.limit) {
+ return false;
+ }
+ ch = this.current.charCodeAt(this.cursor);
+ if (ch > max || ch < min) {
+ return false;
+ }
+ this.cursor++;
+ return true;
+};
+
+/**
+ * @param {!number} min
+ * @param {!number} max
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.in_range_b$II = function (min, max) {
+ /** @type {!number} */
+ var ch;
+ if (this.cursor <= this.limit_backward) {
+ return false;
+ }
+ ch = this.current.charCodeAt(this.cursor - 1);
+ if (ch > max || ch < min) {
+ return false;
+ }
+ this.cursor--;
+ return true;
+};
+
+/**
+ * @param {!number} min
+ * @param {!number} max
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.out_range$II = function (min, max) {
+ /** @type {!number} */
+ var ch;
+ if (this.cursor >= this.limit) {
+ return false;
+ }
+ ch = this.current.charCodeAt(this.cursor);
+ if (! (ch > max || ch < min)) {
+ return false;
+ }
+ this.cursor++;
+ return true;
+};
+
+/**
+ * @param {!number} min
+ * @param {!number} max
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.out_range_b$II = function (min, max) {
+ /** @type {!number} */
+ var ch;
+ if (this.cursor <= this.limit_backward) {
+ return false;
+ }
+ ch = this.current.charCodeAt(this.cursor - 1);
+ if (! (ch > max || ch < min)) {
+ return false;
+ }
+ this.cursor--;
+ return true;
+};
+
+/**
+ * @param {!number} s_size
+ * @param {!string} s
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.eq_s$IS = function (s_size, s) {
+ /** @type {!number} */
+ var cursor$0;
+ if (this.limit - this.cursor < s_size) {
+ return false;
+ }
+ if (this.current.slice(cursor$0 = this.cursor, cursor$0 + s_size) !== s) {
+ return false;
+ }
+ this.cursor += s_size;
+ return true;
+};
+
+/**
+ * @param {!number} s_size
+ * @param {!string} s
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.eq_s_b$IS = function (s_size, s) {
+ /** @type {!number} */
+ var cursor$0;
+ if (this.cursor - this.limit_backward < s_size) {
+ return false;
+ }
+ if (this.current.slice((cursor$0 = this.cursor) - s_size, cursor$0) !== s) {
+ return false;
+ }
+ this.cursor -= s_size;
+ return true;
+};
+
+/**
+ * @param {!string} s
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.eq_v$S = function (s) {
+ return this.eq_s$IS(s.length, s);
+};
+
+/**
+ * @param {!string} s
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.eq_v_b$S = function (s) {
+ return this.eq_s_b$IS(s.length, s);
+};
+
+/**
+ * @param {Array.<undefined|Among>} v
+ * @param {!number} v_size
+ * @return {!number}
+ */
+BaseStemmer.prototype.find_among$ALAmong$I = function (v, v_size) {
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var j;
+ /** @type {!number} */
+ var c;
+ /** @type {!number} */
+ var l;
+ /** @type {!number} */
+ var common_i;
+ /** @type {!number} */
+ var common_j;
+ /** @type {!boolean} */
+ var first_key_inspected;
+ /** @type {!number} */
+ var k;
+ /** @type {!number} */
+ var diff;
+ /** @type {!number} */
+ var common;
+ /** @type {Among} */
+ var w;
+ /** @type {!number} */
+ var i2;
+ /** @type {!boolean} */
+ var res;
+ i = 0;
+ j = v_size;
+ c = this.cursor;
+ l = this.limit;
+ common_i = 0;
+ common_j = 0;
+ first_key_inspected = false;
+ while (true) {
+ k = i + (j - i >>> 1);
+ diff = 0;
+ common = (common_i < common_j ? common_i : common_j);
+ w = v[k];
+ for (i2 = common; i2 < w.s_size; i2++) {
+ if (c + common === l) {
+ diff = -1;
+ break;
+ }
+ diff = this.current.charCodeAt(c + common) - w.s.charCodeAt(i2);
+ if (diff !== 0) {
+ break;
+ }
+ common++;
+ }
+ if (diff < 0) {
+ j = k;
+ common_j = common;
+ } else {
+ i = k;
+ common_i = common;
+ }
+ if (j - i <= 1) {
+ if (i > 0) {
+ break;
+ }
+ if (j === i) {
+ break;
+ }
+ if (first_key_inspected) {
+ break;
+ }
+ first_key_inspected = true;
+ }
+ }
+ while (true) {
+ w = v[i];
+ if (common_i >= w.s_size) {
+ this.cursor = (c + w.s_size | 0);
+ if (w.method == null) {
+ return w.result;
+ }
+ res = w.method(w.instance);
+ this.cursor = (c + w.s_size | 0);
+ if (res) {
+ return w.result;
+ }
+ }
+ i = w.substring_i;
+ if (i < 0) {
+ return 0;
+ }
+ }
+ return -1;
+};
+
+/**
+ * @param {Array.<undefined|Among>} v
+ * @param {!number} v_size
+ * @return {!number}
+ */
+BaseStemmer.prototype.find_among_b$ALAmong$I = function (v, v_size) {
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var j;
+ /** @type {!number} */
+ var c;
+ /** @type {!number} */
+ var lb;
+ /** @type {!number} */
+ var common_i;
+ /** @type {!number} */
+ var common_j;
+ /** @type {!boolean} */
+ var first_key_inspected;
+ /** @type {!number} */
+ var k;
+ /** @type {!number} */
+ var diff;
+ /** @type {!number} */
+ var common;
+ /** @type {Among} */
+ var w;
+ /** @type {!number} */
+ var i2;
+ /** @type {!boolean} */
+ var res;
+ i = 0;
+ j = v_size;
+ c = this.cursor;
+ lb = this.limit_backward;
+ common_i = 0;
+ common_j = 0;
+ first_key_inspected = false;
+ while (true) {
+ k = i + (j - i >> 1);
+ diff = 0;
+ common = (common_i < common_j ? common_i : common_j);
+ w = v[k];
+ for (i2 = w.s_size - 1 - common; i2 >= 0; i2--) {
+ if (c - common === lb) {
+ diff = -1;
+ break;
+ }
+ diff = this.current.charCodeAt(c - 1 - common) - w.s.charCodeAt(i2);
+ if (diff !== 0) {
+ break;
+ }
+ common++;
+ }
+ if (diff < 0) {
+ j = k;
+ common_j = common;
+ } else {
+ i = k;
+ common_i = common;
+ }
+ if (j - i <= 1) {
+ if (i > 0) {
+ break;
+ }
+ if (j === i) {
+ break;
+ }
+ if (first_key_inspected) {
+ break;
+ }
+ first_key_inspected = true;
+ }
+ }
+ while (true) {
+ w = v[i];
+ if (common_i >= w.s_size) {
+ this.cursor = (c - w.s_size | 0);
+ if (w.method == null) {
+ return w.result;
+ }
+ res = w.method(this);
+ this.cursor = (c - w.s_size | 0);
+ if (res) {
+ return w.result;
+ }
+ }
+ i = w.substring_i;
+ if (i < 0) {
+ return 0;
+ }
+ }
+ return -1;
+};
+
+/**
+ * @param {!number} c_bra
+ * @param {!number} c_ket
+ * @param {!string} s
+ * @return {!number}
+ */
+BaseStemmer.prototype.replace_s$IIS = function (c_bra, c_ket, s) {
+ /** @type {!number} */
+ var adjustment;
+ adjustment = s.length - (c_ket - c_bra);
+ this.current = this.current.slice(0, c_bra) + s + this.current.slice(c_ket);
+ this.limit += (adjustment | 0);
+ if (this.cursor >= c_ket) {
+ this.cursor += (adjustment | 0);
+ } else {
+ if (this.cursor > c_bra) {
+ this.cursor = c_bra;
+ }
+ }
+ return (adjustment | 0);
+};
+
+/**
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.slice_check$ = function () {
+ /** @type {!number} */
+ var bra$0;
+ /** @type {!number} */
+ var ket$0;
+ /** @type {!number} */
+ var limit$0;
+ return ((bra$0 = this.bra) < 0 || bra$0 > (ket$0 = this.ket) || ket$0 > (limit$0 = this.limit) || limit$0 > this.current.length ? false : true);
+};
+
+/**
+ * @param {!string} s
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.slice_from$S = function (s) {
+ /** @type {!boolean} */
+ var result;
+ /** @type {!number} */
+ var bra$0;
+ /** @type {!number} */
+ var ket$0;
+ /** @type {!number} */
+ var limit$0;
+ result = false;
+ if ((bra$0 = this.bra) < 0 || bra$0 > (ket$0 = this.ket) || ket$0 > (limit$0 = this.limit) || limit$0 > this.current.length ? false : true) {
+ this.replace_s$IIS(this.bra, this.ket, s);
+ result = true;
+ }
+ return result;
+};
+
+/**
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.slice_del$ = function () {
+ return this.slice_from$S("");
+};
+
+/**
+ * @param {!number} c_bra
+ * @param {!number} c_ket
+ * @param {!string} s
+ */
+BaseStemmer.prototype.insert$IIS = function (c_bra, c_ket, s) {
+ /** @type {!number} */
+ var adjustment;
+ adjustment = this.replace_s$IIS(c_bra, c_ket, s);
+ if (c_bra <= this.bra) {
+ this.bra += (adjustment | 0);
+ }
+ if (c_bra <= this.ket) {
+ this.ket += (adjustment | 0);
+ }
+};
+
+/**
+ * @param {!string} s
+ * @return {!string}
+ */
+BaseStemmer.prototype.slice_to$S = function (s) {
+ /** @type {!string} */
+ var result;
+ /** @type {!number} */
+ var bra$0;
+ /** @type {!number} */
+ var ket$0;
+ /** @type {!number} */
+ var limit$0;
+ result = '';
+ if ((bra$0 = this.bra) < 0 || bra$0 > (ket$0 = this.ket) || ket$0 > (limit$0 = this.limit) || limit$0 > this.current.length ? false : true) {
+ result = this.current.slice(this.bra, this.ket);
+ }
+ return result;
+};
+
+/**
+ * @param {!string} s
+ * @return {!string}
+ */
+BaseStemmer.prototype.assign_to$S = function (s) {
+ return this.current.slice(0, this.limit);
+};
+
+/**
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.stem$ = function () {
+ return false;
+};
+
+/**
+ * @param {!string} word
+ * @return {!string}
+ */
+BaseStemmer.prototype.stemWord$S = function (word) {
+ /** @type {undefined|!string} */
+ var result;
+ /** @type {!string} */
+ var current$0;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var limit$0;
+ result = this.cache['.' + word];
+ if (result == null) {
+ current$0 = this.current = word;
+ cursor$0 = this.cursor = 0;
+ limit$0 = this.limit = current$0.length;
+ this.limit_backward = 0;
+ this.bra = cursor$0;
+ this.ket = limit$0;
+ this.stem$();
+ result = this.current;
+ this.cache['.' + word] = result;
+ }
+ return result;
+};
+
+/**
+ * @param {Array.<undefined|!string>} words
+ * @return {Array.<undefined|!string>}
+ */
+BaseStemmer.prototype.stemWords$AS = function (words) {
+ /** @type {Array.<undefined|!string>} */
+ var results;
+ /** @type {!number} */
+ var i;
+ /** @type {undefined|!string} */
+ var word;
+ /** @type {undefined|!string} */
+ var result;
+ /** @type {!string} */
+ var current$0;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var limit$0;
+ results = [ ];
+ for (i = 0; i < words.length; i++) {
+ word = words[i];
+ result = this.cache['.' + word];
+ if (result == null) {
+ current$0 = this.current = word;
+ cursor$0 = this.cursor = 0;
+ limit$0 = this.limit = current$0.length;
+ this.limit_backward = 0;
+ this.bra = cursor$0;
+ this.ket = limit$0;
+ this.stem$();
+ result = this.current;
+ this.cache['.' + word] = result;
+ }
+ results.push(result);
+ }
+ return results;
+};
+
+/**
+ * class FinnishStemmer extends BaseStemmer
+ * @constructor
+ */
+function FinnishStemmer() {
+}
+
+FinnishStemmer.prototype = new BaseStemmer;
+/**
+ * @constructor
+ */
+function FinnishStemmer$() {
+ BaseStemmer$.call(this);
+ this.B_ending_removed = false;
+ this.S_x = "";
+ this.I_p2 = 0;
+ this.I_p1 = 0;
+};
+
+FinnishStemmer$.prototype = new FinnishStemmer;
+
+/**
+ * @param {FinnishStemmer} other
+ */
+FinnishStemmer.prototype.copy_from$LFinnishStemmer$ = function (other) {
+ this.B_ending_removed = other.B_ending_removed;
+ this.S_x = other.S_x;
+ this.I_p2 = other.I_p2;
+ this.I_p1 = other.I_p1;
+ BaseStemmer.prototype.copy_from$LBaseStemmer$.call(this, other);
+};
+
+/**
+ * @return {!boolean}
+ */
+FinnishStemmer.prototype.r_mark_regions$ = function () {
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_3;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!boolean} */
+ var lab3;
+ /** @type {!boolean} */
+ var lab5;
+ /** @type {!boolean} */
+ var lab7;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var limit$0;
+ /** @type {!number} */
+ var cursor$1;
+ this.I_p1 = limit$0 = this.limit;
+ this.I_p2 = limit$0;
+golab0:
+ while (true) {
+ v_1 = this.cursor;
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ if (! this.in_grouping$AIII(FinnishStemmer.g_V1, 97, 246)) {
+ break lab1;
+ }
+ this.cursor = v_1;
+ break golab0;
+ }
+ cursor$0 = this.cursor = v_1;
+ if (cursor$0 >= this.limit) {
+ return false;
+ }
+ this.cursor++;
+ }
+golab2:
+ while (true) {
+ lab3 = true;
+ lab3:
+ while (lab3 === true) {
+ lab3 = false;
+ if (! this.out_grouping$AIII(FinnishStemmer.g_V1, 97, 246)) {
+ break lab3;
+ }
+ break golab2;
+ }
+ if (this.cursor >= this.limit) {
+ return false;
+ }
+ this.cursor++;
+ }
+ this.I_p1 = this.cursor;
+golab4:
+ while (true) {
+ v_3 = this.cursor;
+ lab5 = true;
+ lab5:
+ while (lab5 === true) {
+ lab5 = false;
+ if (! this.in_grouping$AIII(FinnishStemmer.g_V1, 97, 246)) {
+ break lab5;
+ }
+ this.cursor = v_3;
+ break golab4;
+ }
+ cursor$1 = this.cursor = v_3;
+ if (cursor$1 >= this.limit) {
+ return false;
+ }
+ this.cursor++;
+ }
+golab6:
+ while (true) {
+ lab7 = true;
+ lab7:
+ while (lab7 === true) {
+ lab7 = false;
+ if (! this.out_grouping$AIII(FinnishStemmer.g_V1, 97, 246)) {
+ break lab7;
+ }
+ break golab6;
+ }
+ if (this.cursor >= this.limit) {
+ return false;
+ }
+ this.cursor++;
+ }
+ this.I_p2 = this.cursor;
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+FinnishStemmer.prototype.r_R2$ = function () {
+ return (! (this.I_p2 <= this.cursor) ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+FinnishStemmer.prototype.r_particle_etc$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var cursor$1;
+ /** @type {!number} */
+ var cursor$2;
+ v_1 = this.limit - (cursor$0 = this.cursor);
+ if (cursor$0 < this.I_p1) {
+ return false;
+ }
+ cursor$1 = this.cursor = this.I_p1;
+ v_2 = this.limit_backward;
+ this.limit_backward = cursor$1;
+ cursor$2 = this.cursor = this.limit - v_1;
+ this.ket = cursor$2;
+ among_var = this.find_among_b$ALAmong$I(FinnishStemmer.a_0, 10);
+ if (among_var === 0) {
+ this.limit_backward = v_2;
+ return false;
+ }
+ this.bra = this.cursor;
+ this.limit_backward = v_2;
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ if (! this.in_grouping_b$AIII(FinnishStemmer.g_particle_end, 97, 246)) {
+ return false;
+ }
+ break;
+ case 2:
+ if (! (! (this.I_p2 <= this.cursor) ? false : true)) {
+ return false;
+ }
+ break;
+ }
+ return (! this.slice_from$S("") ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+FinnishStemmer.prototype.r_possessive$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var v_3;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var cursor$1;
+ /** @type {!number} */
+ var cursor$2;
+ v_1 = this.limit - (cursor$0 = this.cursor);
+ if (cursor$0 < this.I_p1) {
+ return false;
+ }
+ cursor$1 = this.cursor = this.I_p1;
+ v_2 = this.limit_backward;
+ this.limit_backward = cursor$1;
+ cursor$2 = this.cursor = this.limit - v_1;
+ this.ket = cursor$2;
+ among_var = this.find_among_b$ALAmong$I(FinnishStemmer.a_4, 9);
+ if (among_var === 0) {
+ this.limit_backward = v_2;
+ return false;
+ }
+ this.bra = this.cursor;
+ this.limit_backward = v_2;
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ v_3 = this.limit - this.cursor;
+ lab0 = true;
+ lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ if (! this.eq_s_b$IS(1, "k")) {
+ break lab0;
+ }
+ return false;
+ }
+ this.cursor = this.limit - v_3;
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 2:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ this.ket = this.cursor;
+ if (! this.eq_s_b$IS(3, "kse")) {
+ return false;
+ }
+ this.bra = this.cursor;
+ if (! this.slice_from$S("ksi")) {
+ return false;
+ }
+ break;
+ case 3:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 4:
+ if (this.find_among_b$ALAmong$I(FinnishStemmer.a_1, 6) === 0) {
+ return false;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 5:
+ if (this.find_among_b$ALAmong$I(FinnishStemmer.a_2, 6) === 0) {
+ return false;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 6:
+ if (this.find_among_b$ALAmong$I(FinnishStemmer.a_3, 2) === 0) {
+ return false;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+FinnishStemmer.prototype.r_LONG$ = function () {
+ return (this.find_among_b$ALAmong$I(FinnishStemmer.a_5, 7) === 0 ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+FinnishStemmer.prototype.r_VI$ = function () {
+ return (! this.eq_s_b$IS(1, "i") ? false : ! this.in_grouping_b$AIII(FinnishStemmer.g_V2, 97, 246) ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+FinnishStemmer.prototype.r_case_ending$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var v_3;
+ /** @type {!number} */
+ var v_4;
+ /** @type {!number} */
+ var v_5;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!boolean} */
+ var lab2;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var cursor$1;
+ /** @type {!number} */
+ var cursor$2;
+ /** @type {!number} */
+ var cursor$3;
+ v_1 = this.limit - (cursor$0 = this.cursor);
+ if (cursor$0 < this.I_p1) {
+ return false;
+ }
+ cursor$1 = this.cursor = this.I_p1;
+ v_2 = this.limit_backward;
+ this.limit_backward = cursor$1;
+ cursor$2 = this.cursor = this.limit - v_1;
+ this.ket = cursor$2;
+ among_var = this.find_among_b$ALAmong$I(FinnishStemmer.a_6, 30);
+ if (among_var === 0) {
+ this.limit_backward = v_2;
+ return false;
+ }
+ this.bra = this.cursor;
+ this.limit_backward = v_2;
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ if (! this.eq_s_b$IS(1, "a")) {
+ return false;
+ }
+ break;
+ case 2:
+ if (! this.eq_s_b$IS(1, "e")) {
+ return false;
+ }
+ break;
+ case 3:
+ if (! this.eq_s_b$IS(1, "i")) {
+ return false;
+ }
+ break;
+ case 4:
+ if (! this.eq_s_b$IS(1, "o")) {
+ return false;
+ }
+ break;
+ case 5:
+ if (! this.eq_s_b$IS(1, "\u00E4")) {
+ return false;
+ }
+ break;
+ case 6:
+ if (! this.eq_s_b$IS(1, "\u00F6")) {
+ return false;
+ }
+ break;
+ case 7:
+ v_3 = this.limit - this.cursor;
+ lab0 = true;
+ lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ v_4 = this.limit - this.cursor;
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ v_5 = this.limit - this.cursor;
+ lab2 = true;
+ lab2:
+ while (lab2 === true) {
+ lab2 = false;
+ if (! (this.find_among_b$ALAmong$I(FinnishStemmer.a_5, 7) === 0 ? false : true)) {
+ break lab2;
+ }
+ break lab1;
+ }
+ this.cursor = this.limit - v_5;
+ if (! this.eq_s_b$IS(2, "ie")) {
+ this.cursor = this.limit - v_3;
+ break lab0;
+ }
+ }
+ cursor$3 = this.cursor = this.limit - v_4;
+ if (cursor$3 <= this.limit_backward) {
+ this.cursor = this.limit - v_3;
+ break lab0;
+ }
+ this.cursor--;
+ this.bra = this.cursor;
+ }
+ break;
+ case 8:
+ if (! this.in_grouping_b$AIII(FinnishStemmer.g_V1, 97, 246)) {
+ return false;
+ }
+ if (! this.out_grouping_b$AIII(FinnishStemmer.g_V1, 97, 246)) {
+ return false;
+ }
+ break;
+ case 9:
+ if (! this.eq_s_b$IS(1, "e")) {
+ return false;
+ }
+ break;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ this.B_ending_removed = true;
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+FinnishStemmer.prototype.r_other_endings$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var v_3;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var cursor$1;
+ /** @type {!number} */
+ var cursor$2;
+ v_1 = this.limit - (cursor$0 = this.cursor);
+ if (cursor$0 < this.I_p2) {
+ return false;
+ }
+ cursor$1 = this.cursor = this.I_p2;
+ v_2 = this.limit_backward;
+ this.limit_backward = cursor$1;
+ cursor$2 = this.cursor = this.limit - v_1;
+ this.ket = cursor$2;
+ among_var = this.find_among_b$ALAmong$I(FinnishStemmer.a_7, 14);
+ if (among_var === 0) {
+ this.limit_backward = v_2;
+ return false;
+ }
+ this.bra = this.cursor;
+ this.limit_backward = v_2;
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ v_3 = this.limit - this.cursor;
+ lab0 = true;
+ lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ if (! this.eq_s_b$IS(2, "po")) {
+ break lab0;
+ }
+ return false;
+ }
+ this.cursor = this.limit - v_3;
+ break;
+ }
+ return (! this.slice_from$S("") ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+FinnishStemmer.prototype.r_i_plural$ = function () {
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var cursor$1;
+ /** @type {!number} */
+ var cursor$2;
+ v_1 = this.limit - (cursor$0 = this.cursor);
+ if (cursor$0 < this.I_p1) {
+ return false;
+ }
+ cursor$1 = this.cursor = this.I_p1;
+ v_2 = this.limit_backward;
+ this.limit_backward = cursor$1;
+ cursor$2 = this.cursor = this.limit - v_1;
+ this.ket = cursor$2;
+ if (this.find_among_b$ALAmong$I(FinnishStemmer.a_8, 2) === 0) {
+ this.limit_backward = v_2;
+ return false;
+ }
+ this.bra = this.cursor;
+ this.limit_backward = v_2;
+ return (! this.slice_from$S("") ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+FinnishStemmer.prototype.r_t_plural$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var v_3;
+ /** @type {!number} */
+ var v_4;
+ /** @type {!number} */
+ var v_5;
+ /** @type {!number} */
+ var v_6;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var cursor$1;
+ /** @type {!number} */
+ var cursor$2;
+ /** @type {!number} */
+ var cursor$3;
+ /** @type {!number} */
+ var cursor$4;
+ /** @type {!number} */
+ var cursor$5;
+ /** @type {!number} */
+ var cursor$6;
+ v_1 = this.limit - (cursor$0 = this.cursor);
+ if (cursor$0 < this.I_p1) {
+ return false;
+ }
+ cursor$1 = this.cursor = this.I_p1;
+ v_2 = this.limit_backward;
+ this.limit_backward = cursor$1;
+ cursor$2 = this.cursor = this.limit - v_1;
+ this.ket = cursor$2;
+ if (! this.eq_s_b$IS(1, "t")) {
+ this.limit_backward = v_2;
+ return false;
+ }
+ this.bra = cursor$3 = this.cursor;
+ v_3 = this.limit - cursor$3;
+ if (! this.in_grouping_b$AIII(FinnishStemmer.g_V1, 97, 246)) {
+ this.limit_backward = v_2;
+ return false;
+ }
+ this.cursor = this.limit - v_3;
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ this.limit_backward = v_2;
+ v_4 = this.limit - (cursor$4 = this.cursor);
+ if (cursor$4 < this.I_p2) {
+ return false;
+ }
+ cursor$5 = this.cursor = this.I_p2;
+ v_5 = this.limit_backward;
+ this.limit_backward = cursor$5;
+ cursor$6 = this.cursor = this.limit - v_4;
+ this.ket = cursor$6;
+ among_var = this.find_among_b$ALAmong$I(FinnishStemmer.a_9, 2);
+ if (among_var === 0) {
+ this.limit_backward = v_5;
+ return false;
+ }
+ this.bra = this.cursor;
+ this.limit_backward = v_5;
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ v_6 = this.limit - this.cursor;
+ lab0 = true;
+ lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ if (! this.eq_s_b$IS(2, "po")) {
+ break lab0;
+ }
+ return false;
+ }
+ this.cursor = this.limit - v_6;
+ break;
+ }
+ return (! this.slice_from$S("") ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+FinnishStemmer.prototype.r_tidy$ = function () {
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var v_3;
+ /** @type {!number} */
+ var v_4;
+ /** @type {!number} */
+ var v_5;
+ /** @type {!number} */
+ var v_6;
+ /** @type {!number} */
+ var v_7;
+ /** @type {!number} */
+ var v_8;
+ /** @type {!number} */
+ var v_9;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!boolean} */
+ var lab2;
+ /** @type {!boolean} */
+ var lab3;
+ /** @type {!boolean} */
+ var lab4;
+ /** @type {!boolean} */
+ var lab5;
+ /** @type {!boolean} */
+ var lab7;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var cursor$1;
+ /** @type {!number} */
+ var cursor$2;
+ /** @type {!number} */
+ var limit$0;
+ /** @type {!number} */
+ var cursor$3;
+ /** @type {!number} */
+ var limit$1;
+ /** @type {!number} */
+ var cursor$4;
+ /** @type {!number} */
+ var limit$2;
+ /** @type {!number} */
+ var cursor$5;
+ /** @type {!number} */
+ var limit$3;
+ /** @type {!number} */
+ var cursor$6;
+ /** @type {!number} */
+ var cursor$7;
+ /** @type {!number} */
+ var cursor$8;
+ /** @type {!string} */
+ var S_x$0;
+ v_1 = this.limit - (cursor$0 = this.cursor);
+ if (cursor$0 < this.I_p1) {
+ return false;
+ }
+ cursor$2 = this.cursor = this.I_p1;
+ v_2 = this.limit_backward;
+ this.limit_backward = cursor$2;
+ cursor$3 = this.cursor = (limit$0 = this.limit) - v_1;
+ v_3 = limit$0 - cursor$3;
+ lab0 = true;
+lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ v_4 = this.limit - this.cursor;
+ if (! (this.find_among_b$ALAmong$I(FinnishStemmer.a_5, 7) === 0 ? false : true)) {
+ break lab0;
+ }
+ cursor$1 = this.cursor = this.limit - v_4;
+ this.ket = cursor$1;
+ if (cursor$1 <= this.limit_backward) {
+ break lab0;
+ }
+ this.cursor--;
+ this.bra = this.cursor;
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ }
+ cursor$4 = this.cursor = (limit$1 = this.limit) - v_3;
+ v_5 = limit$1 - cursor$4;
+ lab1 = true;
+lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ this.ket = this.cursor;
+ if (! this.in_grouping_b$AIII(FinnishStemmer.g_AEI, 97, 228)) {
+ break lab1;
+ }
+ this.bra = this.cursor;
+ if (! this.out_grouping_b$AIII(FinnishStemmer.g_V1, 97, 246)) {
+ break lab1;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ }
+ cursor$5 = this.cursor = (limit$2 = this.limit) - v_5;
+ v_6 = limit$2 - cursor$5;
+ lab2 = true;
+lab2:
+ while (lab2 === true) {
+ lab2 = false;
+ this.ket = this.cursor;
+ if (! this.eq_s_b$IS(1, "j")) {
+ break lab2;
+ }
+ this.bra = this.cursor;
+ lab3 = true;
+ lab3:
+ while (lab3 === true) {
+ lab3 = false;
+ v_7 = this.limit - this.cursor;
+ lab4 = true;
+ lab4:
+ while (lab4 === true) {
+ lab4 = false;
+ if (! this.eq_s_b$IS(1, "o")) {
+ break lab4;
+ }
+ break lab3;
+ }
+ this.cursor = this.limit - v_7;
+ if (! this.eq_s_b$IS(1, "u")) {
+ break lab2;
+ }
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ }
+ cursor$6 = this.cursor = (limit$3 = this.limit) - v_6;
+ v_8 = limit$3 - cursor$6;
+ lab5 = true;
+lab5:
+ while (lab5 === true) {
+ lab5 = false;
+ this.ket = this.cursor;
+ if (! this.eq_s_b$IS(1, "o")) {
+ break lab5;
+ }
+ this.bra = this.cursor;
+ if (! this.eq_s_b$IS(1, "j")) {
+ break lab5;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ }
+ this.cursor = this.limit - v_8;
+ this.limit_backward = v_2;
+golab6:
+ while (true) {
+ v_9 = this.limit - this.cursor;
+ lab7 = true;
+ lab7:
+ while (lab7 === true) {
+ lab7 = false;
+ if (! this.out_grouping_b$AIII(FinnishStemmer.g_V1, 97, 246)) {
+ break lab7;
+ }
+ this.cursor = this.limit - v_9;
+ break golab6;
+ }
+ cursor$7 = this.cursor = this.limit - v_9;
+ if (cursor$7 <= this.limit_backward) {
+ return false;
+ }
+ this.cursor--;
+ }
+ this.ket = cursor$8 = this.cursor;
+ if (cursor$8 <= this.limit_backward) {
+ return false;
+ }
+ this.cursor--;
+ this.bra = this.cursor;
+ S_x$0 = this.S_x = this.slice_to$S(this.S_x);
+ return (S_x$0 === '' ? false : ! this.eq_v_b$S(this.S_x) ? false : ! this.slice_from$S("") ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+FinnishStemmer.prototype.stem$ = function () {
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var v_3;
+ /** @type {!number} */
+ var v_4;
+ /** @type {!number} */
+ var v_5;
+ /** @type {!number} */
+ var v_6;
+ /** @type {!number} */
+ var v_7;
+ /** @type {!number} */
+ var v_8;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!boolean} */
+ var lab2;
+ /** @type {!boolean} */
+ var lab3;
+ /** @type {!boolean} */
+ var lab4;
+ /** @type {!boolean} */
+ var lab5;
+ /** @type {!boolean} */
+ var lab6;
+ /** @type {!boolean} */
+ var lab7;
+ /** @type {!boolean} */
+ var lab8;
+ /** @type {!boolean} */
+ var lab9;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var limit$0;
+ /** @type {!number} */
+ var cursor$1;
+ /** @type {!number} */
+ var limit$1;
+ /** @type {!number} */
+ var cursor$2;
+ /** @type {!number} */
+ var limit$2;
+ /** @type {!number} */
+ var cursor$3;
+ /** @type {!number} */
+ var limit$3;
+ /** @type {!number} */
+ var cursor$4;
+ /** @type {!number} */
+ var limit$4;
+ /** @type {!number} */
+ var cursor$5;
+ v_1 = this.cursor;
+ lab0 = true;
+lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ if (! this.r_mark_regions$()) {
+ break lab0;
+ }
+ }
+ cursor$0 = this.cursor = v_1;
+ this.B_ending_removed = false;
+ this.limit_backward = cursor$0;
+ cursor$1 = this.cursor = limit$0 = this.limit;
+ v_2 = limit$0 - cursor$1;
+ lab1 = true;
+lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ if (! this.r_particle_etc$()) {
+ break lab1;
+ }
+ }
+ cursor$2 = this.cursor = (limit$1 = this.limit) - v_2;
+ v_3 = limit$1 - cursor$2;
+ lab2 = true;
+lab2:
+ while (lab2 === true) {
+ lab2 = false;
+ if (! this.r_possessive$()) {
+ break lab2;
+ }
+ }
+ cursor$3 = this.cursor = (limit$2 = this.limit) - v_3;
+ v_4 = limit$2 - cursor$3;
+ lab3 = true;
+lab3:
+ while (lab3 === true) {
+ lab3 = false;
+ if (! this.r_case_ending$()) {
+ break lab3;
+ }
+ }
+ cursor$4 = this.cursor = (limit$3 = this.limit) - v_4;
+ v_5 = limit$3 - cursor$4;
+ lab4 = true;
+lab4:
+ while (lab4 === true) {
+ lab4 = false;
+ if (! this.r_other_endings$()) {
+ break lab4;
+ }
+ }
+ this.cursor = this.limit - v_5;
+ lab5 = true;
+lab5:
+ while (lab5 === true) {
+ lab5 = false;
+ v_6 = this.limit - this.cursor;
+ lab6 = true;
+ lab6:
+ while (lab6 === true) {
+ lab6 = false;
+ if (! this.B_ending_removed) {
+ break lab6;
+ }
+ v_7 = this.limit - this.cursor;
+ lab7 = true;
+ lab7:
+ while (lab7 === true) {
+ lab7 = false;
+ if (! this.r_i_plural$()) {
+ break lab7;
+ }
+ }
+ this.cursor = this.limit - v_7;
+ break lab5;
+ }
+ cursor$5 = this.cursor = (limit$4 = this.limit) - v_6;
+ v_8 = limit$4 - cursor$5;
+ lab8 = true;
+ lab8:
+ while (lab8 === true) {
+ lab8 = false;
+ if (! this.r_t_plural$()) {
+ break lab8;
+ }
+ }
+ this.cursor = this.limit - v_8;
+ }
+ lab9 = true;
+lab9:
+ while (lab9 === true) {
+ lab9 = false;
+ if (! this.r_tidy$()) {
+ break lab9;
+ }
+ }
+ this.cursor = this.limit_backward;
+ return true;
+};
+
+/**
+ * @param {*} o
+ * @return {!boolean}
+ */
+FinnishStemmer.prototype.equals$X = function (o) {
+ return o instanceof FinnishStemmer;
+};
+
+/**
+ * @return {!number}
+ */
+FinnishStemmer.prototype.hashCode$ = function () {
+ /** @type {!string} */
+ var classname;
+ /** @type {!number} */
+ var hash;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var char;
+ classname = "FinnishStemmer";
+ hash = 0;
+ if ("FinnishStemmer".length === 0) {
+ return (hash | 0);
+ }
+ for (i = 0; i < classname.length; i++) {
+ char = classname.charCodeAt(i);
+ hash = (hash << 5) - hash + char;
+ hash = hash & hash;
+ }
+ return (hash | 0);
+};
+
+/**
+ * class Among extends Object
+ * @constructor
+ */
+function Among() {
+}
+
+/**
+ * @constructor
+ * @param {!string} s
+ * @param {!number} substring_i
+ * @param {!number} result
+ */
+function Among$SII(s, substring_i, result) {
+ this.s_size = s.length;
+ this.s = s;
+ this.substring_i = substring_i;
+ this.result = result;
+ this.method = null;
+ this.instance = null;
+};
+
+Among$SII.prototype = new Among;
+
+/**
+ * @constructor
+ * @param {!string} s
+ * @param {!number} substring_i
+ * @param {!number} result
+ * @param {*} method
+ * @param {BaseStemmer} instance
+ */
+function Among$SIIF$LBaseStemmer$B$LBaseStemmer$(s, substring_i, result, method, instance) {
+ this.s_size = s.length;
+ this.s = s;
+ this.substring_i = substring_i;
+ this.result = result;
+ this.method = method;
+ this.instance = instance;
+};
+
+Among$SIIF$LBaseStemmer$B$LBaseStemmer$.prototype = new Among;
+
+/**
+ * class Metadata extends Object
+ * @constructor
+ */
+function Metadata() {
+}
+
+/**
+ * @constructor
+ * @param {Oktavia} parent
+ */
+function Metadata$LOktavia$(parent) {
+ this._parent = parent;
+ this._bitVector = new BitVector$();
+};
+
+Metadata$LOktavia$.prototype = new Metadata;
+
+/**
+ * @return {!number}
+ */
+Metadata.prototype._size$ = function () {
+ /** @type {BitVector} */
+ var this$0;
+ /** @type {!number} */
+ var i$0;
+ /** @type {BitVector} */
+ var _bitVector$0;
+ this$0 = _bitVector$0 = this._bitVector;
+ i$0 = _bitVector$0._size;
+ return this$0.rank$IB(i$0, true);
+};
+
+/**
+ * @param {!number} index
+ * @return {!string}
+ */
+Metadata.prototype.getContent$I = function (index) {
+ /** @type {!number} */
+ var startPosition;
+ /** @type {!number} */
+ var length;
+ if (index < 0 || this._size$() <= index) {
+ throw new Error("Section.getContent() : range error " + (index + ""));
+ }
+ startPosition = 0;
+ if (index > 0) {
+ startPosition = this._bitVector.select$I(index - 1) + 1;
+ }
+ length = this._bitVector.select$I(index) - startPosition + 1;
+ return this._parent._getSubstring$II(startPosition, length);
+};
+
+/**
+ * @param {!number} index
+ * @return {!number}
+ */
+Metadata.prototype.getStartPosition$I = function (index) {
+ /** @type {!number} */
+ var startPosition;
+ if (index < 0 || this._size$() <= index) {
+ throw new Error("Section.getContent() : range error " + (index + ""));
+ }
+ startPosition = 0;
+ if (index > 0) {
+ startPosition = this._bitVector.select$I(index - 1) + 1;
+ }
+ return (startPosition | 0);
+};
+
+/**
+ * @param {SingleResult} result
+ * @param {Array.<undefined|!number>} positions
+ * @param {!string} word
+ * @param {!boolean} stemmed
+ */
+Metadata.prototype.grouping$LSingleResult$AISB = function (result, positions, word, stemmed) {
+};
+
+/**
+ * @param {!number} index
+ * @return {!string}
+ */
+Metadata.prototype.getInformation$I = function (index) {
+ return '';
+};
+
+/**
+ */
+Metadata.prototype._build$ = function () {
+ this._bitVector.build$();
+};
+
+/**
+ * @param {!string} name
+ * @param {!string} data
+ * @param {!number} offset
+ * @return {!number}
+ */
+Metadata.prototype._load$SSI = function (name, data, offset) {
+ offset = this._bitVector.load$SI(data, offset);
+ this._parent._metadataLabels.push(name);
+ this._parent._metadatas[name] = this;
+ return offset;
+};
+
+/**
+ * @return {!string}
+ */
+Metadata.prototype._dump$ = function () {
+ /** @type {BitVector} */
+ var this$0;
+ /** @type {Array.<undefined|!string>} */
+ var contents$0;
+ this$0 = this._bitVector;
+ contents$0 = [ ];
+ contents$0.push(Binary$dump32bitNumber$N(this$0._size));
+ contents$0.push(Binary$dump32bitNumberList$AN(this$0._v));
+ return contents$0.join('');
+};
+
+/**
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+Metadata.prototype._dump$LCompressionReport$ = function (report) {
+ /** @type {BitVector} */
+ var this$0;
+ /** @type {Array.<undefined|!string>} */
+ var contents$0;
+ this$0 = this._bitVector;
+ contents$0 = [ ];
+ contents$0.push(Binary$dump32bitNumber$N(this$0._size));
+ CompressionReport$add$LCompressionReport$II(report, 2, 2);
+ contents$0.push(Binary$dump32bitNumberList$ANLCompressionReport$(this$0._v, report));
+ return contents$0.join('');
+};
+
+/**
+ * class Section extends Metadata
+ * @constructor
+ */
+function Section() {
+}
+
+Section.prototype = new Metadata;
+/**
+ * @constructor
+ * @param {Oktavia} parent
+ */
+function Section$LOktavia$(parent) {
+ this._parent = parent;
+ this._bitVector = new BitVector$();
+ this._names = [ ];
+};
+
+Section$LOktavia$.prototype = new Section;
+
+/**
+ * @param {!string} name
+ */
+Section.prototype.setTail$S = function (name) {
+ /** @type {!number} */
+ var index$0;
+ /** @type {Oktavia} */
+ var this$0;
+ /** @type {FMIndex} */
+ var this$0$0;
+ this$0 = this._parent;
+ this$0$0 = this$0._fmindex;
+ index$0 = this$0$0._substr.length;
+ this._names.push(name);
+ this._bitVector.set$I(index$0 - 1);
+};
+
+/**
+ * @param {!string} name
+ * @param {!number} index
+ */
+Section.prototype.setTail$SI = function (name, index) {
+ this._names.push(name);
+ this._bitVector.set$I(index - 1);
+};
+
+/**
+ * @return {!number}
+ */
+Section.prototype.size$ = function () {
+ return (this._names.length | 0);
+};
+
+/**
+ * @param {!number} position
+ * @return {!number}
+ */
+Section.prototype.getSectionIndex$I = function (position) {
+ /** @type {BitVector} */
+ var this$0;
+ if (position < 0 || this._bitVector.size$() <= position) {
+ throw new Error("Section.getSectionIndex() : range error " + (position + ""));
+ }
+ this$0 = this._bitVector;
+ return this$0.rank$IB(position, true);
+};
+
+/**
+ * @param {!number} index
+ * @return {!string}
+ */
+Section.prototype.getName$I = function (index) {
+ if (index < 0 || this._names.length <= index) {
+ throw new Error("Section.getName() : range error");
+ }
+ return this._names[index];
+};
+
+/**
+ * @param {SingleResult} result
+ * @param {Array.<undefined|!number>} positions
+ * @param {!string} word
+ * @param {!boolean} stemmed
+ */
+Section.prototype.grouping$LSingleResult$AISB = function (result, positions, word, stemmed) {
+ /** @type {!number} */
+ var i;
+ /** @type {undefined|!number} */
+ var position;
+ /** @type {!number} */
+ var index;
+ /** @type {SearchUnit} */
+ var unit;
+ for (i = 0; i < positions.length; i++) {
+ position = positions[i];
+ index = this.getSectionIndex$I(position);
+ unit = SingleResult$getSearchUnit$LSingleResult$I(result, index);
+ if (unit.startPosition < 0) {
+ unit.startPosition = this.getStartPosition$I(index);
+ }
+ SearchUnit$addPosition$LSearchUnit$SIB(unit, word, position - unit.startPosition, stemmed);
+ }
+};
+
+/**
+ * @param {!number} index
+ * @return {!string}
+ */
+Section.prototype.getInformation$I = function (index) {
+ return this.getName$I(index);
+};
+
+/**
+ * @param {Oktavia} parent
+ * @param {!string} name
+ * @param {!string} data
+ * @param {!number} offset
+ * @return {!number}
+ */
+Section._load$LOktavia$SSI = function (parent, name, data, offset) {
+ /** @type {LoadedStringListResult} */
+ var strs;
+ /** @type {Section} */
+ var section;
+ /** @type {!number} */
+ var offset$0;
+ strs = new LoadedStringListResult$SI(data, offset);
+ section = new Section$LOktavia$(parent);
+ section._names = strs.result;
+ offset$0 = strs.offset;
+ offset$0 = section._bitVector.load$SI(data, offset$0);
+ section._parent._metadataLabels.push(name);
+ section._parent._metadatas[name] = section;
+ return offset$0;
+};
+
+var Section$_load$LOktavia$SSI = Section._load$LOktavia$SSI;
+
+/**
+ * @return {!string}
+ */
+Section.prototype._dump$ = function () {
+ return [ Binary$dump16bitNumber$I(0), Binary$dumpStringList$AS(this._names), Metadata.prototype._dump$.call(this) ].join('');
+};
+
+/**
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+Section.prototype._dump$LCompressionReport$ = function (report) {
+ CompressionReport$add$LCompressionReport$II(report, 1, 1);
+ return [ Binary$dump16bitNumber$I(0), Binary$dumpStringList$ASLCompressionReport$(this._names, report), Metadata.prototype._dump$LCompressionReport$.call(this, report) ].join('');
+};
+
+/**
+ * class Splitter extends Metadata
+ * @constructor
+ */
+function Splitter() {
+}
+
+Splitter.prototype = new Metadata;
+/**
+ * @constructor
+ * @param {Oktavia} parent
+ */
+function Splitter$LOktavia$(parent) {
+ this._parent = parent;
+ this._bitVector = new BitVector$();
+ this.name = null;
+};
+
+Splitter$LOktavia$.prototype = new Splitter;
+
+/**
+ * @constructor
+ * @param {Oktavia} parent
+ * @param {!string} name
+ */
+function Splitter$LOktavia$S(parent, name) {
+ this._parent = parent;
+ this._bitVector = new BitVector$();
+ this.name = name;
+};
+
+Splitter$LOktavia$S.prototype = new Splitter;
+
+/**
+ * @return {!number}
+ */
+Splitter.prototype.size$ = function () {
+ /** @type {BitVector} */
+ var this$0$0;
+ /** @type {!number} */
+ var i$0$0;
+ /** @type {BitVector} */
+ var _bitVector$0;
+ this$0$0 = _bitVector$0 = this._bitVector;
+ i$0$0 = _bitVector$0._size;
+ return this$0$0.rank$IB(i$0$0, true);
+};
+
+/**
+ */
+Splitter.prototype.split$ = function () {
+ /** @type {!number} */
+ var index$0;
+ /** @type {Oktavia} */
+ var this$0;
+ /** @type {FMIndex} */
+ var this$0$0;
+ this$0 = this._parent;
+ this$0$0 = this$0._fmindex;
+ index$0 = this$0$0._substr.length;
+ this._bitVector.set$I(index$0 - 1);
+};
+
+/**
+ * @param {!number} index
+ */
+Splitter.prototype.split$I = function (index) {
+ this._bitVector.set$I(index - 1);
+};
+
+/**
+ * @param {!number} position
+ * @return {!number}
+ */
+Splitter.prototype.getIndex$I = function (position) {
+ /** @type {BitVector} */
+ var this$0;
+ if (position < 0 || this._bitVector.size$() <= position) {
+ throw new Error("Section.getSectionIndex() : range error");
+ }
+ this$0 = this._bitVector;
+ return this$0.rank$IB(position, true);
+};
+
+/**
+ * @param {SingleResult} result
+ * @param {Array.<undefined|!number>} positions
+ * @param {!string} word
+ * @param {!boolean} stemmed
+ */
+Splitter.prototype.grouping$LSingleResult$AISB = function (result, positions, word, stemmed) {
+ /** @type {!number} */
+ var i;
+ /** @type {undefined|!number} */
+ var position;
+ /** @type {!number} */
+ var index;
+ /** @type {SearchUnit} */
+ var unit;
+ for (i = 0; i < positions.length; i++) {
+ position = positions[i];
+ index = this.getIndex$I(position);
+ unit = SingleResult$getSearchUnit$LSingleResult$I(result, index);
+ if (unit.startPosition < 0) {
+ unit.startPosition = this.getStartPosition$I(index);
+ }
+ SearchUnit$addPosition$LSearchUnit$SIB(unit, word, position - unit.startPosition, stemmed);
+ }
+};
+
+/**
+ * @param {!number} index
+ * @return {!string}
+ */
+Splitter.prototype.getInformation$I = function (index) {
+ return (this.name != null ? this.name + (index + 1 + "") : '');
+};
+
+/**
+ * @param {Oktavia} parent
+ * @param {!string} name
+ * @param {!string} data
+ * @param {!number} offset
+ * @return {!number}
+ */
+Splitter._load$LOktavia$SSI = function (parent, name, data, offset) {
+ /** @type {Splitter} */
+ var section;
+ section = new Splitter$LOktavia$(parent);
+ offset = section._bitVector.load$SI(data, offset);
+ section._parent._metadataLabels.push(name);
+ section._parent._metadatas[name] = section;
+ return offset;
+};
+
+var Splitter$_load$LOktavia$SSI = Splitter._load$LOktavia$SSI;
+
+/**
+ * @return {!string}
+ */
+Splitter.prototype._dump$ = function () {
+ return [ Binary$dump16bitNumber$I(1), Metadata.prototype._dump$.call(this) ].join('');
+};
+
+/**
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+Splitter.prototype._dump$LCompressionReport$ = function (report) {
+ CompressionReport$add$LCompressionReport$II(report, 1, 1);
+ return [ Binary$dump16bitNumber$I(1), Metadata.prototype._dump$LCompressionReport$.call(this, report) ].join('');
+};
+
+/**
+ * class Table extends Metadata
+ * @constructor
+ */
+function Table() {
+}
+
+Table.prototype = new Metadata;
+/**
+ * @constructor
+ * @param {Oktavia} parent
+ * @param {Array.<undefined|!string>} headers
+ */
+function Table$LOktavia$AS(parent, headers) {
+ this._parent = parent;
+ this._bitVector = new BitVector$();
+ this._headers = headers;
+ this._columnTails = new BitVector$();
+};
+
+Table$LOktavia$AS.prototype = new Table;
+
+/**
+ * @return {!number}
+ */
+Table.prototype.rowSize$ = function () {
+ /** @type {BitVector} */
+ var this$0$0;
+ /** @type {!number} */
+ var i$0$0;
+ /** @type {BitVector} */
+ var _bitVector$0;
+ this$0$0 = _bitVector$0 = this._bitVector;
+ i$0$0 = _bitVector$0._size;
+ return this$0$0.rank$IB(i$0$0, true);
+};
+
+/**
+ * @return {!number}
+ */
+Table.prototype.columnSize$ = function () {
+ return (this._headers.length | 0);
+};
+
+/**
+ */
+Table.prototype.setColumnTail$ = function () {
+ /** @type {!number} */
+ var index;
+ /** @type {Oktavia} */
+ var this$0;
+ /** @type {FMIndex} */
+ var this$0$0;
+ /** @type {Oktavia} */
+ var _parent$0;
+ this$0 = _parent$0 = this._parent;
+ this$0$0 = this$0._fmindex;
+ index = this$0$0._substr.length;
+ _parent$0._fmindex.push$S(Oktavia.eob);
+ this._columnTails.set$I(index - 1);
+};
+
+/**
+ */
+Table.prototype.setRowTail$ = function () {
+ /** @type {!number} */
+ var index;
+ /** @type {Oktavia} */
+ var this$0;
+ /** @type {FMIndex} */
+ var this$0$0;
+ this$0 = this._parent;
+ this$0$0 = this$0._fmindex;
+ index = this$0$0._substr.length;
+ this._bitVector.set$I(index - 1);
+};
+
+/**
+ * @param {!number} position
+ * @return {Array.<undefined|!number>}
+ */
+Table.prototype.getCell$I = function (position) {
+ /** @type {!number} */
+ var row;
+ /** @type {!number} */
+ var currentColumn;
+ /** @type {!number} */
+ var lastRowColumn;
+ /** @type {!number} */
+ var startPosition;
+ /** @type {Array.<undefined|!number>} */
+ var result;
+ /** @type {BitVector} */
+ var this$0;
+ /** @type {BitVector} */
+ var this$1;
+ if (position < 0 || this._bitVector.size$() <= position) {
+ throw new Error("Section.getSectionIndex() : range error " + (position + ""));
+ }
+ this$0 = this._bitVector;
+ row = this$0.rank$IB(position, true);
+ this$1 = this._columnTails;
+ currentColumn = this$1.rank$IB(position, true);
+ lastRowColumn = 0;
+ if (row > 0) {
+ startPosition = this._bitVector.select$I(row - 1) + 1;
+ lastRowColumn = this._columnTails.rank$I(startPosition);
+ }
+ result = [ row, currentColumn - lastRowColumn ];
+ return result;
+};
+
+/**
+ * @param {!number} rowIndex
+ * @return {Object.<string, undefined|!string>}
+ */
+Table.prototype.getRowContent$I = function (rowIndex) {
+ /** @type {!string} */
+ var content;
+ /** @type {Array.<undefined|!string>} */
+ var values;
+ /** @type {Object.<string, undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var i;
+ content = this.getContent$I(rowIndex);
+ values = content.split(Oktavia.eob, this._headers.length);
+ result = ({ });
+ for (i in this._headers) {
+ if (i < values.length) {
+ result[this._headers[i]] = values[i];
+ } else {
+ result[this._headers[i]] = '';
+ }
+ }
+ return result;
+};
+
+/**
+ * @param {SingleResult} result
+ * @param {Array.<undefined|!number>} positions
+ * @param {!string} word
+ * @param {!boolean} stemmed
+ */
+Table.prototype.grouping$LSingleResult$AISB = function (result, positions, word, stemmed) {
+};
+
+/**
+ * @param {!number} index
+ * @return {!string}
+ */
+Table.prototype.getInformation$I = function (index) {
+ return '';
+};
+
+/**
+ */
+Table.prototype._build$ = function () {
+ this._bitVector.build$();
+ this._columnTails.build$();
+};
+
+/**
+ * @param {Oktavia} parent
+ * @param {!string} name
+ * @param {!string} data
+ * @param {!number} offset
+ * @return {!number}
+ */
+Table._load$LOktavia$SSI = function (parent, name, data, offset) {
+ /** @type {LoadedStringListResult} */
+ var strs;
+ /** @type {Table} */
+ var table;
+ /** @type {!number} */
+ var offset$0;
+ strs = new LoadedStringListResult$SI(data, offset);
+ table = new Table$LOktavia$AS(parent, strs.result);
+ offset$0 = strs.offset;
+ offset$0 = table._bitVector.load$SI(data, offset$0);
+ table._parent._metadataLabels.push(name);
+ table._parent._metadatas[name] = table;
+ offset = offset$0;
+ return table._columnTails.load$SI(data, offset$0);
+};
+
+var Table$_load$LOktavia$SSI = Table._load$LOktavia$SSI;
+
+/**
+ * @return {!string}
+ */
+Table.prototype._dump$ = function () {
+ return [ Binary$dump16bitNumber$I(2), Binary$dumpStringList$AS(this._headers), Metadata.prototype._dump$.call(this), this._columnTails.dump$() ].join('');
+};
+
+/**
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+Table.prototype._dump$LCompressionReport$ = function (report) {
+ CompressionReport$add$LCompressionReport$II(report, 1, 1);
+ return [ Binary$dump16bitNumber$I(2), Binary$dumpStringList$ASLCompressionReport$(this._headers, report), Metadata.prototype._dump$LCompressionReport$.call(this, report), this._columnTails.dump$LCompressionReport$(report) ].join('');
+};
+
+/**
+ * class Block extends Metadata
+ * @constructor
+ */
+function Block() {
+}
+
+Block.prototype = new Metadata;
+/**
+ * @constructor
+ * @param {Oktavia} parent
+ */
+function Block$LOktavia$(parent) {
+ this._parent = parent;
+ this._bitVector = new BitVector$();
+ this._names = [ ];
+ this._start = false;
+};
+
+Block$LOktavia$.prototype = new Block;
+
+/**
+ * @param {!string} blockName
+ */
+Block.prototype.startBlock$S = function (blockName) {
+ this.startBlock$SI(blockName, this._parent.contentSize$());
+};
+
+/**
+ * @param {!string} blockName
+ * @param {!number} index
+ */
+Block.prototype.startBlock$SI = function (blockName, index) {
+ if (this._start) {
+ throw new Error('Splitter `' + this._names[this._names.length - 1] + '` is not closed');
+ }
+ this._start = true;
+ this._names.push(blockName);
+ this._bitVector.set$I(index - 1);
+};
+
+/**
+ */
+Block.prototype.endBlock$ = function () {
+ this.endBlock$I(this._parent.contentSize$());
+};
+
+/**
+ * @param {!number} index
+ */
+Block.prototype.endBlock$I = function (index) {
+ if (! this._start) {
+ throw new Error('Splitter is not started');
+ }
+ this._start = false;
+ this._bitVector.set$I(index - 1);
+};
+
+/**
+ * @return {!number}
+ */
+Block.prototype.size$ = function () {
+ return (this._names.length | 0);
+};
+
+/**
+ * @param {!number} position
+ * @return {!number}
+ */
+Block.prototype.blockIndex$I = function (position) {
+ /** @type {!number} */
+ var result;
+ /** @type {BitVector} */
+ var this$0;
+ if (position < 0 || this._parent._fmindex.size$() - 1 <= position) {
+ throw new Error("Block.blockIndex() : range error " + (position + ""));
+ }
+ if (position >= this._bitVector.size$()) {
+ position = (this._bitVector.size$() - 1 | 0);
+ result = (this._bitVector.rank$I(position) + 1 | 0);
+ } else {
+ this$0 = this._bitVector;
+ result = this$0.rank$IB(position, true);
+ }
+ return result;
+};
+
+/**
+ * @param {!number} position
+ * @return {!boolean}
+ */
+Block.prototype.inBlock$I = function (position) {
+ /** @type {!number} */
+ var blockIndex;
+ blockIndex = this.blockIndex$I(position);
+ return blockIndex % 2 !== 0;
+};
+
+/**
+ * @param {!number} position
+ * @return {!string}
+ */
+Block.prototype.getBlockContent$I = function (position) {
+ /** @type {!number} */
+ var blockIndex;
+ /** @type {!string} */
+ var result;
+ blockIndex = this.blockIndex$I(position);
+ if (blockIndex % 2 !== 0) {
+ result = this.getContent$I(blockIndex);
+ } else {
+ result = '';
+ }
+ return result;
+};
+
+/**
+ * @param {!number} position
+ * @return {!string}
+ */
+Block.prototype.getBlockName$I = function (position) {
+ /** @type {!number} */
+ var blockIndex;
+ /** @type {!string} */
+ var result;
+ blockIndex = this.blockIndex$I(position);
+ if (blockIndex % 2 !== 0) {
+ result = this._names[blockIndex >>> 1];
+ } else {
+ result = '';
+ }
+ return result;
+};
+
+/**
+ * @param {SingleResult} result
+ * @param {Array.<undefined|!number>} positions
+ * @param {!string} word
+ * @param {!boolean} stemmed
+ */
+Block.prototype.grouping$LSingleResult$AISB = function (result, positions, word, stemmed) {
+};
+
+/**
+ * @param {!number} index
+ * @return {!string}
+ */
+Block.prototype.getInformation$I = function (index) {
+ return '';
+};
+
+/**
+ * @param {Oktavia} parent
+ * @param {!string} name
+ * @param {!string} data
+ * @param {!number} offset
+ * @return {!number}
+ */
+Block._load$LOktavia$SSI = function (parent, name, data, offset) {
+ /** @type {LoadedStringListResult} */
+ var strs;
+ /** @type {Block} */
+ var block;
+ /** @type {!number} */
+ var offset$0;
+ strs = new LoadedStringListResult$SI(data, offset);
+ block = new Block$LOktavia$(parent);
+ block._names = strs.result;
+ offset$0 = strs.offset;
+ offset$0 = block._bitVector.load$SI(data, offset$0);
+ block._parent._metadataLabels.push(name);
+ block._parent._metadatas[name] = block;
+ return offset$0;
+};
+
+var Block$_load$LOktavia$SSI = Block._load$LOktavia$SSI;
+
+/**
+ * @return {!string}
+ */
+Block.prototype._dump$ = function () {
+ return [ Binary$dump16bitNumber$I(3), Binary$dumpStringList$AS(this._names), Metadata.prototype._dump$.call(this) ].join('');
+};
+
+/**
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+Block.prototype._dump$LCompressionReport$ = function (report) {
+ CompressionReport$add$LCompressionReport$II(report, 1, 1);
+ return [ Binary$dump16bitNumber$I(3), Binary$dumpStringList$ASLCompressionReport$(this._names, report), Metadata.prototype._dump$LCompressionReport$.call(this, report) ].join('');
+};
+
+/**
+ * class FMIndex extends Object
+ * @constructor
+ */
+function FMIndex() {
+}
+
+/**
+ * @constructor
+ */
+function FMIndex$() {
+ /** @type {Array.<undefined|!number>} */
+ var _rlt$0;
+ this._ssize = 0;
+ (this._ddic = 0, this._head = 0);
+ this._substr = "";
+ this._sv = new WaveletMatrix$();
+ this._posdic = [ ];
+ this._idic = [ ];
+ _rlt$0 = this._rlt = [ ];
+ _rlt$0.length = 65536;
+};
+
+FMIndex$.prototype = new FMIndex;
+
+/**
+ */
+FMIndex.prototype.clear$ = function () {
+ /** @type {WaveletMatrix} */
+ var this$0;
+ this$0 = this._sv;
+ this$0._bv.length = 0;
+ this$0._seps.length = 0;
+ this$0._size = 0;
+ this._posdic.length = 0;
+ this._idic.length = 0;
+ this._ddic = 0;
+ this._head = 0;
+ this._substr = "";
+};
+
+/**
+ * @return {!number}
+ */
+FMIndex.prototype.size$ = function () {
+ /** @type {WaveletMatrix} */
+ var this$0;
+ this$0 = this._sv;
+ return this$0._size;
+};
+
+/**
+ * @return {!number}
+ */
+FMIndex.prototype.contentSize$ = function () {
+ return this._substr.length;
+};
+
+/**
+ * @param {!string} key
+ * @return {!number}
+ */
+FMIndex.prototype.getRows$S = function (key) {
+ /** @type {Array.<undefined|!number>} */
+ var pos;
+ pos = [ ];
+ return this.getRows$SAI(key, pos);
+};
+
+/**
+ * @param {!string} key
+ * @param {Array.<undefined|!number>} pos
+ * @return {!number}
+ */
+FMIndex.prototype.getRows$SAI = function (key, pos) {
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var code;
+ /** @type {!number} */
+ var first;
+ /** @type {undefined|!number} */
+ var last;
+ /** @type {!number} */
+ var c;
+ /** @type {Array.<undefined|!number>} */
+ var _rlt$0;
+ i = key.length - 1;
+ code = key.charCodeAt(i);
+ first = (_rlt$0 = this._rlt)[code] + 1;
+ last = _rlt$0[code + 1];
+ while (first <= last) {
+ if (i === 0) {
+ pos[0] = (-- first | 0);
+ pos[1] = -- last;
+ return (last - first + 1 | 0);
+ }
+ i--;
+ c = key.charCodeAt(i);
+ first = this._rlt[c] + this._sv.rank$II(first - 1, c) + 1;
+ last = this._rlt[c] + this._sv.rank$II(last, c);
+ }
+ return 0;
+};
+
+/**
+ * @param {!number} i
+ * @return {!number}
+ */
+FMIndex.prototype.getPosition$I = function (i) {
+ /** @type {!number} */
+ var pos;
+ /** @type {!number} */
+ var c;
+ if (i >= this.size$()) {
+ throw new Error("FMIndex.getPosition() : range error");
+ }
+ pos = 0;
+ while (i !== this._head) {
+ if (i % this._ddic === 0) {
+ pos += this._posdic[i / this._ddic] + 1;
+ break;
+ }
+ c = this._sv.get$I(i);
+ i = this._rlt[c] + this._sv.rank$II(i, c);
+ pos++;
+ }
+ return (pos % this.size$() | 0);
+};
+
+/**
+ * @param {!number} pos
+ * @param {!number} len
+ * @return {!string}
+ */
+FMIndex.prototype.getSubstring$II = function (pos, len) {
+ /** @type {!number} */
+ var pos_end;
+ /** @type {!number} */
+ var pos_tmp;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var pos_idic;
+ /** @type {!string} */
+ var substr;
+ /** @type {!number} */
+ var c;
+ /** @type {!number} */
+ var _ddic$0;
+ if (pos >= this.size$()) {
+ throw new Error("FMIndex.getSubstring() : range error");
+ }
+ pos_end = Math.min(pos + len, this.size$());
+ pos_tmp = this.size$() - 1;
+ i = this._head;
+ pos_idic = Math.floor((pos_end + (_ddic$0 = this._ddic) - 2) / _ddic$0);
+ if (pos_idic < this._idic.length) {
+ pos_tmp = pos_idic * this._ddic;
+ i = this._idic[pos_idic];
+ }
+ substr = "";
+ while (pos_tmp >= pos) {
+ c = this._sv.get$I(i);
+ i = this._rlt[c] + this._sv.rank$II(i, c);
+ if (pos_tmp < pos_end) {
+ substr = String.fromCharCode(c) + substr;
+ }
+ if (pos_tmp === 0) {
+ break;
+ }
+ pos_tmp--;
+ }
+ return substr;
+};
+
+/**
+ */
+FMIndex.prototype.build$ = function () {
+ this.build$SIIB(String.fromCharCode(0), 65535, 20, false);
+};
+
+/**
+ * @param {!string} end_marker
+ * @param {!number} ddic
+ * @param {!boolean} verbose
+ */
+FMIndex.prototype.build$SIB = function (end_marker, ddic, verbose) {
+ this.build$SIIB(end_marker, 65535, ddic, verbose);
+};
+
+/**
+ * @param {!string} end_marker
+ * @param {!number} maxChar
+ * @param {!number} ddic
+ * @param {!boolean} verbose
+ */
+FMIndex.prototype.build$SIIB = function (end_marker, maxChar, ddic, verbose) {
+ /** @type {BurrowsWheelerTransform} */
+ var b;
+ /** @type {!string} */
+ var s;
+ /** @type {!number} */
+ var c;
+ /** @type {!string} */
+ var str$0;
+ /** @type {WaveletMatrix} */
+ var this$0;
+ /** @type {!string} */
+ var _str$0;
+ /** @type {Array.<undefined|!number>} */
+ var _suffixarray$0;
+ if (verbose) {
+ console.time("building burrows-wheeler transform");
+ }
+ this._substr += end_marker;
+ b = ({_str: "", _size: 0, _head: 0, _suffixarray: [ ]});
+ str$0 = this._substr;
+ _str$0 = b._str = str$0;
+ b._size = _str$0.length;
+ _suffixarray$0 = b._suffixarray = SAIS$make$S(str$0);
+ b._head = (_suffixarray$0.indexOf(0) | 0);
+ s = BurrowsWheelerTransform$get$LBurrowsWheelerTransform$(b);
+ this._ssize = s.length;
+ this._head = b._head;
+ b._str = "";
+ b._size = 0;
+ b._head = 0;
+ b._suffixarray.length = 0;
+ this._substr = "";
+ if (verbose) {
+ console.timeEnd("building burrows-wheeler transform");
+ }
+ if (verbose) {
+ console.time("building wavelet matrix");
+ }
+ this$0 = this._sv;
+ this$0._bitsize = (Math.ceil(Math.log(maxChar) / 0.6931471805599453) | 0);
+ if (verbose) {
+ console.log(" maxCharCode: ", maxChar);
+ console.log(" bitSize: ", this._sv.bitsize$());
+ }
+ this._sv.build$S(s);
+ if (verbose) {
+ console.timeEnd("building wavelet matrix");
+ }
+ if (verbose) {
+ console.time("caching rank less than");
+ }
+ for (c = 0; c < maxChar; c++) {
+ this._rlt[c] = this._sv.rank_less_than$II(this._sv.size$(), c);
+ }
+ if (verbose) {
+ console.timeEnd("caching rank less than");
+ }
+ this._ddic = ddic;
+ if (verbose) {
+ console.time("building dictionaries");
+ }
+ this._buildDictionaries$();
+ if (verbose) {
+ console.timeEnd("building dictionaries");
+ console.log('');
+ }
+};
+
+/**
+ */
+FMIndex.prototype._buildDictionaries$ = function () {
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var pos;
+ /** @type {!number} */
+ var c;
+ for (i = 0; i < this._ssize / this._ddic + 1; i++) {
+ this._posdic.push(0);
+ this._idic.push(0);
+ }
+ i = this._head;
+ pos = this.size$() - 1;
+ do {
+ if (i % this._ddic === 0) {
+ this._posdic[Math.floor(i / this._ddic)] = (pos | 0);
+ }
+ if (pos % this._ddic === 0) {
+ this._idic[Math.floor(pos / this._ddic)] = (i | 0);
+ }
+ c = this._sv.get$I(i);
+ i = this._rlt[c] + this._sv.rank$II(i, c);
+ pos--;
+ } while (i !== this._head);
+};
+
+/**
+ * @param {!string} doc
+ */
+FMIndex.prototype.push$S = function (doc) {
+ if (doc.length <= 0) {
+ throw new Error("FMIndex::push(): empty string");
+ }
+ this._substr += doc;
+};
+
+/**
+ * @param {!string} keyword
+ * @return {Array.<undefined|!number>}
+ */
+FMIndex.prototype.search$S = function (keyword) {
+ /** @type {Array.<undefined|!number>} */
+ var result;
+ /** @type {Array.<undefined|!number>} */
+ var position;
+ /** @type {!number} */
+ var rows;
+ /** @type {undefined|!number} */
+ var first;
+ /** @type {undefined|!number} */
+ var last;
+ /** @type {undefined|!number} */
+ var i;
+ result = [ ];
+ position = [ ];
+ rows = this.getRows$SAI(keyword, position);
+ if (rows > 0) {
+ first = position[0];
+ last = position[1];
+ for (i = first; i <= last; i++) {
+ result.push(this.getPosition$I(i));
+ }
+ }
+ return result;
+};
+
+/**
+ * @return {!string}
+ */
+FMIndex.prototype.dump$ = function () {
+ return this.dump$B(false);
+};
+
+/**
+ * @param {!boolean} verbose
+ * @return {!string}
+ */
+FMIndex.prototype.dump$B = function (verbose) {
+ /** @type {Array.<undefined|!string>} */
+ var contents;
+ /** @type {CompressionReport} */
+ var report;
+ /** @type {!number} */
+ var i;
+ contents = [ ];
+ report = ({source: 0, result: 0});
+ contents.push(Binary$dump32bitNumber$N(this._ddic));
+ contents.push(Binary$dump32bitNumber$N(this._ssize));
+ contents.push(Binary$dump32bitNumber$N(this._head));
+ CompressionReport$add$LCompressionReport$II(report, 6, 6);
+ contents.push(this._sv.dump$LCompressionReport$(report));
+ if (verbose) {
+ console.log("Serializing FM-index");
+ console.log(' Wavelet Matrix: ' + (contents[3].length * 2 + "") + ' bytes (' + (Math.round(report.result * 100.0 / report.source) + "") + '%)');
+ }
+ contents.push(Binary$dump32bitNumber$N(this._posdic.length));
+ for (i in this._posdic) {
+ contents.push(Binary$dump32bitNumber$N(this._posdic[i]));
+ }
+ for (i in this._idic) {
+ contents.push(Binary$dump32bitNumber$N(this._idic[i]));
+ }
+ if (verbose) {
+ console.log(' Dictionary Cache: ' + (this._idic.length * 16 + "") + ' bytes');
+ }
+ return contents.join("");
+};
+
+/**
+ * @param {!string} data
+ * @return {!number}
+ */
+FMIndex.prototype.load$S = function (data) {
+ return this.load$SI(data, 0);
+};
+
+/**
+ * @param {!string} data
+ * @param {!number} offset
+ * @return {!number}
+ */
+FMIndex.prototype.load$SI = function (data, offset) {
+ /** @type {!number} */
+ var maxChar;
+ /** @type {!number} */
+ var c;
+ /** @type {!number} */
+ var size;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var result$0;
+ /** @type {!number} */
+ var result$1;
+ result$0 = data.charCodeAt(offset) * 65536 + data.charCodeAt(offset + 1);
+ this._ddic = (result$0 | 0);
+ this._ssize = (Binary$load32bitNumber$SI(data, offset + 2) | 0);
+ this._head = (Binary$load32bitNumber$SI(data, offset + 4) | 0);
+ offset = this._sv.load$SI(data, offset + 6);
+ maxChar = Math.pow(2, this._sv.bitsize$());
+ for (c = 0; c < maxChar; c++) {
+ this._rlt[c] = this._sv.rank_less_than$II(this._sv.size$(), c);
+ }
+ result$1 = data.charCodeAt(offset) * 65536 + data.charCodeAt(offset + 1);
+ size = result$1;
+ offset += 2;
+ for (i = 0; i < size; (i++, offset += 2)) {
+ this._posdic.push(Binary$load32bitNumber$SI(data, offset));
+ }
+ for (i = 0; i < size; (i++, offset += 2)) {
+ this._idic.push(Binary$load32bitNumber$SI(data, offset));
+ }
+ return offset;
+};
+
+/**
+ * class Tag extends Object
+ * @constructor
+ */
+function Tag() {
+}
+
+/**
+ * @constructor
+ * @param {!string} name
+ */
+function Tag$S(name) {
+ this.name = name;
+ this.attributes = ({ });
+ this.isSelfClosing = false;
+};
+
+Tag$S.prototype = new Tag;
+
+/**
+ * class _Common extends Object
+ * @constructor
+ */
+function _Common() {
+}
+
+/**
+ * @constructor
+ */
+function _Common$() {
+};
+
+_Common$.prototype = new _Common;
+
+/**
+ * class _State extends Object
+ * @constructor
+ */
+function _State() {
+}
+
+/**
+ * @constructor
+ */
+function _State$() {
+};
+
+_State$.prototype = new _State;
+
+/**
+ * class SAXHandler extends Object
+ * @constructor
+ */
+function SAXHandler() {
+}
+
+/**
+ * @constructor
+ */
+function SAXHandler$() {
+ this.position = 0;
+ this.column = 0;
+ this.line = 0;
+};
+
+SAXHandler$.prototype = new SAXHandler;
+
+/**
+ * @param {Error} error
+ */
+SAXHandler.prototype.onerror$LError$ = function (error) {
+};
+
+/**
+ * @param {!string} text
+ */
+SAXHandler.prototype.ontext$S = function (text) {
+};
+
+/**
+ * @param {!string} doctype
+ */
+SAXHandler.prototype.ondoctype$S = function (doctype) {
+};
+
+/**
+ * @param {!string} name
+ * @param {!string} body
+ */
+SAXHandler.prototype.onprocessinginstruction$SS = function (name, body) {
+};
+
+/**
+ * @param {!string} sgmlDecl
+ */
+SAXHandler.prototype.onsgmldeclaration$S = function (sgmlDecl) {
+};
+
+/**
+ * @param {!string} tagname
+ * @param {Object.<string, undefined|!string>} attributes
+ */
+SAXHandler.prototype.onopentag$SHS = function (tagname, attributes) {
+};
+
+/**
+ * @param {!string} tagname
+ */
+SAXHandler.prototype.onclosetag$S = function (tagname) {
+};
+
+/**
+ * @param {!string} name
+ * @param {!string} value
+ */
+SAXHandler.prototype.onattribute$SS = function (name, value) {
+};
+
+/**
+ * @param {!string} comment
+ */
+SAXHandler.prototype.oncomment$S = function (comment) {
+};
+
+/**
+ */
+SAXHandler.prototype.onopencdata$ = function () {
+};
+
+/**
+ * @param {!string} cdata
+ */
+SAXHandler.prototype.oncdata$S = function (cdata) {
+};
+
+/**
+ */
+SAXHandler.prototype.onclosecdata$ = function () {
+};
+
+/**
+ */
+SAXHandler.prototype.onend$ = function () {
+};
+
+/**
+ */
+SAXHandler.prototype.onready$ = function () {
+};
+
+/**
+ * @param {!string} script
+ */
+SAXHandler.prototype.onscript$S = function (script) {
+};
+
+/**
+ * class _HTMLHandler extends SAXHandler
+ * @constructor
+ */
+function _HTMLHandler() {
+}
+
+_HTMLHandler.prototype = new SAXHandler;
+/**
+ * @constructor
+ * @param {Object.<string, undefined|Array.<undefined|!string>>} styles
+ * @param {!boolean} escape
+ */
+function _HTMLHandler$HASB(styles, escape) {
+ this.position = 0;
+ this.column = 0;
+ this.line = 0;
+ this.text = [ ];
+ this.escape = escape;
+ this.styles = styles;
+};
+
+_HTMLHandler$HASB.prototype = new _HTMLHandler;
+
+/**
+ * @param {!string} str
+ * @return {!string}
+ */
+_HTMLHandler.escapeHTML$S = function (str) {
+ return str.replace(/\n/g, "<br/>").replace(/&/g, "&amp;").replace(/"/g, "&quot;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
+};
+
+var _HTMLHandler$escapeHTML$S = _HTMLHandler.escapeHTML$S;
+
+/**
+ * @param {!string} tagname
+ * @param {Object.<string, undefined|!string>} attributes
+ */
+_HTMLHandler.prototype.onopentag$SHS = function (tagname, attributes) {
+ this.text.push(this.styles[tagname][0]);
+};
+
+/**
+ * @param {!string} tagname
+ */
+_HTMLHandler.prototype.onclosetag$S = function (tagname) {
+ this.text.push(this.styles[tagname][1]);
+};
+
+/**
+ * @param {!string} text
+ */
+_HTMLHandler.prototype.ontext$S = function (text) {
+ if (this.escape) {
+ this.text.push(text.replace(/\n/g, "<br/>").replace(/&/g, "&amp;").replace(/"/g, "&quot;").replace(/</g, "&lt;").replace(/>/g, "&gt;"));
+ } else {
+ this.text.push(text);
+ }
+};
+
+/**
+ * @return {!string}
+ */
+_HTMLHandler.prototype.result$ = function () {
+ return this.text.join('');
+};
+
+/**
+ * class SAXParser extends Object
+ * @constructor
+ */
+function SAXParser() {
+}
+
+/**
+ * @constructor
+ * @param {SAXHandler} handler
+ */
+function SAXParser$LSAXHandler$(handler) {
+ this.q = "";
+ this.c = "";
+ this.bufferCheckPosition = 0;
+ this.looseCase = "";
+ this.tags = [ ];
+ this.closed = false;
+ this.closedRoot = false;
+ this.sawRoot = false;
+ this.tag = null;
+ this.error = null;
+ this.handler = null;
+ this.ENTITIES = null;
+ this.strict = false;
+ this.tagName = "";
+ this.state = 0;
+ this.line = 0;
+ this.column = 0;
+ this.position = 0;
+ this.startTagPosition = 0;
+ this.attribName = "";
+ this.attribValue = "";
+ this.script = "";
+ this.textNode = "";
+ this.attribList = null;
+ this.noscript = false;
+ this.cdata = "";
+ this.procInstBody = "";
+ this.procInstName = "";
+ this.doctype = "";
+ this.entity = "";
+ this.sgmlDecl = "";
+ this.comment = "";
+ this.preTags = 0;
+ this._init$LSAXHandler$B(handler, false);
+};
+
+SAXParser$LSAXHandler$.prototype = new SAXParser;
+
+/**
+ * @constructor
+ * @param {SAXHandler} handler
+ * @param {!boolean} strict
+ */
+function SAXParser$LSAXHandler$B(handler, strict) {
+ this.q = "";
+ this.c = "";
+ this.bufferCheckPosition = 0;
+ this.looseCase = "";
+ this.tags = [ ];
+ this.closed = false;
+ this.closedRoot = false;
+ this.sawRoot = false;
+ this.tag = null;
+ this.error = null;
+ this.handler = null;
+ this.ENTITIES = null;
+ this.strict = false;
+ this.tagName = "";
+ this.state = 0;
+ this.line = 0;
+ this.column = 0;
+ this.position = 0;
+ this.startTagPosition = 0;
+ this.attribName = "";
+ this.attribValue = "";
+ this.script = "";
+ this.textNode = "";
+ this.attribList = null;
+ this.noscript = false;
+ this.cdata = "";
+ this.procInstBody = "";
+ this.procInstName = "";
+ this.doctype = "";
+ this.entity = "";
+ this.sgmlDecl = "";
+ this.comment = "";
+ this.preTags = 0;
+ this._init$LSAXHandler$B(handler, strict);
+};
+
+SAXParser$LSAXHandler$B.prototype = new SAXParser;
+
+/**
+ * @param {SAXHandler} handler
+ * @param {!boolean} strict
+ */
+SAXParser.prototype._init$LSAXHandler$B = function (handler, strict) {
+ this.handler = handler;
+ this.clearBuffers$();
+ this.q = "";
+ this.bufferCheckPosition = 65536;
+ this.looseCase = 'toLowerCase';
+ this.tags = [ ];
+ this.closed = this.closedRoot = this.sawRoot = false;
+ this.tag = null;
+ this.error = null;
+ this.strict = strict;
+ this.noscript = strict;
+ this.state = 1;
+ this.ENTITIES = _Entities$entity_list$();
+ this.attribList = [ ];
+ this.noscript = false;
+ this.preTags = 0;
+};
+
+/**
+ * @param {!boolean} flag
+ */
+SAXParser.prototype.set_noscript$B = function (flag) {
+ this.noscript = flag;
+};
+
+/**
+ * @return {SAXParser}
+ */
+SAXParser.prototype.resume$ = function () {
+ this.error = null;
+ return this;
+};
+
+/**
+ * @return {SAXParser}
+ */
+SAXParser.prototype.close$ = function () {
+ return this.parse$S('');
+};
+
+/**
+ * @param {!string} chunk
+ * @return {SAXParser}
+ */
+SAXParser.prototype.parse$S = function (chunk) {
+ /** @type {Char} */
+ var _;
+ /** @type {!number} */
+ var i;
+ /** @type {!string} */
+ var c;
+ /** @type {!number} */
+ var starti;
+ /** @type {!number} */
+ var pad;
+ /** @type {!number} */
+ var returnState;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$0;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$1;
+ /** @type {RegExp} */
+ var charclass$2;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$3;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$4;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$5;
+ /** @type {!string} */
+ var text$0;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$6;
+ /** @type {RegExp} */
+ var charclass$7;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$8;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$9;
+ /** @type {RegExp} */
+ var charclass$10;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$11;
+ /** @type {RegExp} */
+ var charclass$12;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$13;
+ /** @type {RegExp} */
+ var charclass$14;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$15;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$16;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$17;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$18;
+ /** @type {RegExp} */
+ var charclass$19;
+ /** @type {RegExp} */
+ var charclass$20;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$21;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$22;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$23;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$24;
+ /** @type {!string} */
+ var comment$0;
+ _ = new Char$();
+ if (this.error) {
+ throw this.error;
+ }
+ if (this.closed) {
+ return this.emiterror$S("Cannot write after close. Assign an onready handler.");
+ }
+ (i = 0, c = "");
+ while (this.c = c = chunk.charAt(i++)) {
+ this.position++;
+ if (c === "\n") {
+ this.handler.line++;
+ this.handler.column = 0;
+ } else {
+ this.handler.column++;
+ }
+ switch (this.state) {
+ case 1:
+ if (c === "<") {
+ this.state = 4;
+ this.startTagPosition = this.position;
+ } else {
+ charclass$0 = _.whitespace;
+ if (! $__jsx_ObjectHasOwnProperty.call(charclass$0, c)) {
+ this.strictFail$S("Non-whitespace before first tag.");
+ this.textNode = c;
+ this.state = 2;
+ }
+ }
+ continue;
+ case 2:
+ if (this.sawRoot && ! this.closedRoot) {
+ starti = i - 1;
+ while (c && c !== "<" && c !== "&") {
+ c = chunk.charAt(i++);
+ if (c) {
+ this.position++;
+ if (c === "\n") {
+ this.handler.line++;
+ this.handler.column = 0;
+ } else {
+ this.handler.column++;
+ }
+ }
+ }
+ this.textNode += chunk.substring(starti, i - 1);
+ }
+ if (c === "<") {
+ this.state = 4;
+ this.startTagPosition = this.position;
+ } else {
+ if (_.not$HBS(_.whitespace, c) && (! this.sawRoot || this.closedRoot)) {
+ this.strictFail$S("Text data outside of root node.");
+ }
+ if (c === "&") {
+ this.state = 3;
+ } else {
+ this.textNode += c;
+ }
+ }
+ continue;
+ case 33:
+ if (c === "<") {
+ this.state = 34;
+ } else {
+ this.script += c;
+ }
+ continue;
+ case 34:
+ if (c === "/") {
+ this.state = 31;
+ } else {
+ this.script += "<" + c;
+ this.state = 33;
+ }
+ continue;
+ case 4:
+ if (c === "!") {
+ this.state = 5;
+ this.sgmlDecl = "";
+ } else {
+ charclass$1 = _.whitespace;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$1, c)) {
+ } else {
+ charclass$2 = _.nameStart;
+ if (charclass$2.test(c)) {
+ this.state = 21;
+ this.tagName = c;
+ } else {
+ if (c === "/") {
+ this.state = 31;
+ this.tagName = "";
+ } else {
+ if (c === "?") {
+ this.state = 18;
+ this.procInstName = this.procInstBody = "";
+ } else {
+ this.strictFail$S("Unencoded <");
+ if (this.startTagPosition + 1 < this.position) {
+ pad = this.position - this.startTagPosition;
+ for (i = 0; i < pad; i++) {
+ c = " " + c;
+ }
+ }
+ this.textNode += "<" + c;
+ this.state = 2;
+ }
+ }
+ }
+ }
+ }
+ continue;
+ case 5:
+ if ((this.sgmlDecl + c).toUpperCase() === _.CDATA) {
+ this.closetext_if_exist$();
+ this.state = 15;
+ this.sgmlDecl = "";
+ this.cdata = "";
+ } else {
+ if (this.sgmlDecl + c === "--") {
+ this.state = 12;
+ this.comment = "";
+ this.sgmlDecl = "";
+ } else {
+ if ((this.sgmlDecl + c).toUpperCase() === _.DOCTYPE) {
+ this.state = 7;
+ if (this.doctype || this.sawRoot) {
+ this.strictFail$S("Inappropriately located doctype declaration");
+ }
+ this.doctype = "";
+ this.sgmlDecl = "";
+ } else {
+ if (c === ">") {
+ this.closetext_if_exist$();
+ this.sgmlDecl = "";
+ this.state = 2;
+ } else {
+ charclass$3 = _.quote;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$3, c)) {
+ this.state = 6;
+ this.sgmlDecl += c;
+ } else {
+ this.sgmlDecl += c;
+ }
+ }
+ }
+ }
+ }
+ continue;
+ case 6:
+ if (c === this.q) {
+ this.state = 5;
+ this.q = "";
+ }
+ this.sgmlDecl += c;
+ continue;
+ case 7:
+ if (c === ">") {
+ this.state = 2;
+ this.closetext_if_exist$();
+ this.doctype.trim();
+ } else {
+ this.doctype += c;
+ if (c === "[") {
+ this.state = 9;
+ } else {
+ charclass$4 = _.quote;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$4, c)) {
+ this.state = 8;
+ this.q = c;
+ }
+ }
+ }
+ continue;
+ case 8:
+ this.doctype += c;
+ if (c === this.q) {
+ this.q = "";
+ this.state = 7;
+ }
+ continue;
+ case 9:
+ this.doctype += c;
+ if (c === "]") {
+ this.state = 7;
+ } else {
+ charclass$5 = _.quote;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$5, c)) {
+ this.state = 10;
+ this.q = c;
+ }
+ }
+ continue;
+ case 10:
+ this.doctype += c;
+ if (c === this.q) {
+ this.state = 9;
+ this.q = "";
+ }
+ continue;
+ case 12:
+ if (c === "-") {
+ this.state = 13;
+ } else {
+ this.comment += c;
+ }
+ continue;
+ case 13:
+ if (c === "-") {
+ this.state = 14;
+ text$0 = this.comment;
+ text$0 = text$0.replace(/[\n\t]/g, ' ');
+ text$0 = text$0.replace(/\s\s+/g, " ");
+ comment$0 = this.comment = text$0;
+ if (comment$0) {
+ this.closetext_if_exist$();
+ this.comment.trim();
+ }
+ this.comment = "";
+ } else {
+ this.comment += "-" + c;
+ this.state = 12;
+ }
+ continue;
+ case 14:
+ if (c !== ">") {
+ this.strictFail$S("Malformed comment");
+ this.comment += "--" + c;
+ this.state = 12;
+ } else {
+ this.state = 2;
+ }
+ continue;
+ case 15:
+ if (c === "]") {
+ this.state = 16;
+ } else {
+ this.cdata += c;
+ }
+ continue;
+ case 16:
+ if (c === "]") {
+ this.state = 17;
+ } else {
+ this.cdata += "]" + c;
+ this.state = 15;
+ }
+ continue;
+ case 17:
+ if (c === ">") {
+ if (this.cdata) {
+ this.closetext_if_exist$();
+ }
+ this.cdata = "";
+ this.state = 2;
+ } else {
+ if (c === "]") {
+ this.cdata += "]";
+ } else {
+ this.cdata += "]]" + c;
+ this.state = 15;
+ }
+ }
+ continue;
+ case 18:
+ if (c === "?") {
+ this.state = 20;
+ } else {
+ charclass$6 = _.whitespace;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$6, c)) {
+ this.state = 19;
+ } else {
+ this.procInstName += c;
+ }
+ }
+ continue;
+ case 19:
+ if (! this.procInstBody && _.is$HBS(_.whitespace, c)) {
+ continue;
+ } else {
+ if (c === "?") {
+ this.state = 20;
+ } else {
+ this.procInstBody += c;
+ }
+ }
+ continue;
+ case 20:
+ if (c === ">") {
+ this.closetext_if_exist$();
+ this.procInstName = this.procInstBody = "";
+ this.state = 2;
+ } else {
+ this.procInstBody += "?" + c;
+ this.state = 19;
+ }
+ continue;
+ case 21:
+ charclass$7 = _.nameBody;
+ if (charclass$7.test(c)) {
+ this.tagName += c;
+ } else {
+ this.newTag$();
+ if (c === ">") {
+ this.openTag$B(false);
+ } else {
+ if (c === "/") {
+ this.state = 22;
+ } else {
+ charclass$8 = _.whitespace;
+ if (! $__jsx_ObjectHasOwnProperty.call(charclass$8, c)) {
+ this.strictFail$S("Invalid character in tag name");
+ }
+ this.state = 23;
+ }
+ }
+ }
+ continue;
+ case 22:
+ if (c === ">") {
+ this.openTag$B(true);
+ this.closeTag$();
+ } else {
+ this.strictFail$S("Forward-slash in opening tag not followed by >");
+ this.state = 23;
+ }
+ continue;
+ case 23:
+ charclass$9 = _.whitespace;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$9, c)) {
+ continue;
+ } else {
+ if (c === ">") {
+ this.openTag$B(false);
+ } else {
+ if (c === "/") {
+ this.state = 22;
+ } else {
+ charclass$10 = _.nameStart;
+ if (charclass$10.test(c)) {
+ this.attribName = c;
+ this.attribValue = "";
+ this.state = 24;
+ } else {
+ this.strictFail$S("Invalid attribute name");
+ }
+ }
+ }
+ }
+ continue;
+ case 24:
+ if (c === "=") {
+ this.state = 26;
+ } else {
+ if (c === ">") {
+ this.strictFail$S("Attribute without value");
+ this.attribValue = this.attribName;
+ this.attrib$();
+ this.openTag$B(false);
+ } else {
+ charclass$11 = _.whitespace;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$11, c)) {
+ this.state = 25;
+ } else {
+ charclass$12 = _.nameBody;
+ if (charclass$12.test(c)) {
+ this.attribName += c;
+ } else {
+ this.strictFail$S("Invalid attribute name");
+ }
+ }
+ }
+ }
+ continue;
+ case 25:
+ if (c === "=") {
+ this.state = 26;
+ } else {
+ charclass$13 = _.whitespace;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$13, c)) {
+ continue;
+ } else {
+ this.strictFail$S("Attribute without value");
+ this.tag.attributes[this.attribName] = "";
+ this.attribValue = "";
+ this.closetext_if_exist$();
+ this.attribName = "";
+ if (c === ">") {
+ this.openTag$B(false);
+ } else {
+ charclass$14 = _.nameStart;
+ if (charclass$14.test(c)) {
+ this.attribName = c;
+ this.state = 24;
+ } else {
+ this.strictFail$S("Invalid attribute name");
+ this.state = 23;
+ }
+ }
+ }
+ }
+ continue;
+ case 26:
+ charclass$15 = _.whitespace;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$15, c)) {
+ continue;
+ } else {
+ charclass$16 = _.quote;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$16, c)) {
+ this.q = c;
+ this.state = 27;
+ } else {
+ this.strictFail$S("Unquoted attribute value");
+ this.state = 28;
+ this.attribValue = c;
+ }
+ }
+ continue;
+ case 27:
+ if (c !== this.q) {
+ if (c === "&") {
+ this.state = 29;
+ } else {
+ this.attribValue += c;
+ }
+ continue;
+ }
+ this.attrib$();
+ this.q = "";
+ this.state = 23;
+ continue;
+ case 28:
+ charclass$17 = _.attribEnd;
+ if (! $__jsx_ObjectHasOwnProperty.call(charclass$17, c)) {
+ if (c === "&") {
+ this.state = 30;
+ } else {
+ this.attribValue += c;
+ }
+ continue;
+ }
+ this.attrib$();
+ if (c === ">") {
+ this.openTag$B(false);
+ } else {
+ this.state = 23;
+ }
+ continue;
+ case 31:
+ if (! this.tagName) {
+ charclass$18 = _.whitespace;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$18, c)) {
+ continue;
+ } else {
+ charclass$19 = _.nameStart;
+ if (! charclass$19.test(c)) {
+ if (this.script) {
+ this.script += "</" + c;
+ this.state = 33;
+ } else {
+ this.strictFail$S("Invalid tagname in closing tag.");
+ }
+ } else {
+ this.tagName = c;
+ }
+ }
+ } else {
+ if (c === ">") {
+ this.closeTag$();
+ } else {
+ charclass$20 = _.nameBody;
+ if (charclass$20.test(c)) {
+ this.tagName += c;
+ } else {
+ if (this.script) {
+ this.script += "</" + this.tagName;
+ this.tagName = "";
+ this.state = 33;
+ } else {
+ charclass$21 = _.whitespace;
+ if (! $__jsx_ObjectHasOwnProperty.call(charclass$21, c)) {
+ this.strictFail$S("Invalid tagname in closing tag");
+ }
+ this.state = 32;
+ }
+ }
+ }
+ }
+ continue;
+ case 32:
+ charclass$22 = _.whitespace;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$22, c)) {
+ continue;
+ }
+ if (c === ">") {
+ this.closeTag$();
+ } else {
+ this.strictFail$S("Invalid characters in closing tag");
+ }
+ continue;
+ case 3:
+ if (c === ";") {
+ this.textNode += this.parseEntity$();
+ this.entity = "";
+ this.state = 2;
+ } else {
+ charclass$23 = _.entity;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$23, c)) {
+ this.entity += c;
+ } else {
+ this.strictFail$S("Invalid character entity");
+ this.textNode += "&" + this.entity + c;
+ this.entity = "";
+ this.state = 2;
+ }
+ }
+ continue;
+ case 29:
+ case 30:
+ if (this.state === 29) {
+ returnState = 27;
+ } else {
+ returnState = 28;
+ }
+ if (c === ";") {
+ this.attribValue += this.parseEntity$();
+ this.entity = "";
+ this.state = (returnState | 0);
+ } else {
+ charclass$24 = _.entity;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$24, c)) {
+ this.entity += c;
+ } else {
+ this.strictFail$S("Invalid character entity");
+ this.attribValue += "&" + this.entity + c;
+ this.entity = "";
+ this.state = (returnState | 0);
+ }
+ }
+ continue;
+ default:
+ throw new Error("Unknown state: " + (this.state + ""));
+ }
+ }
+ this.end$();
+ return this;
+};
+
+/**
+ */
+SAXParser.prototype.clearBuffers$ = function () {
+ this.comment = '';
+ this.sgmlDecl = '';
+ this.textNode = '';
+ this.tagName = '';
+ this.doctype = '';
+ this.procInstName = '';
+ this.procInstBody = '';
+ this.entity = '';
+ this.attribName = '';
+ this.attribValue = '';
+ this.cdata = '';
+ this.script = '';
+};
+
+/**
+ */
+SAXParser.prototype.closetext_if_exist$ = function () {
+ if (this.textNode !== '') {
+ this.closetext$();
+ }
+};
+
+/**
+ */
+SAXParser.prototype.closetext$ = function () {
+ /** @type {!string} */
+ var text;
+ /** @type {!string} */
+ var text$0;
+ if (this.preTags === 0) {
+ text$0 = this.textNode;
+ text$0 = text$0.replace(/[\n\t]/g, ' ');
+ text$0 = text$0.replace(/\s\s+/g, " ");
+ text = text$0;
+ if (text$0) {
+ this.handler.ontext$S(text);
+ }
+ } else {
+ if (this.textNode) {
+ this.handler.ontext$S(this.textNode);
+ }
+ }
+ this.textNode = "";
+};
+
+/**
+ * @param {!string} text
+ * @return {!string}
+ */
+SAXParser.prototype.textopts$S = function (text) {
+ text = text.replace(/[\n\t]/g, ' ');
+ text = text.replace(/\s\s+/g, " ");
+ return text;
+};
+
+/**
+ * @param {!string} er
+ * @return {SAXParser}
+ */
+SAXParser.prototype.emiterror$S = function (er) {
+ /** @type {Error} */
+ var error;
+ this.closetext$();
+ er += "\nLine: " + (this.line + "") + "\nColumn: " + (this.column + "") + "\nChar: " + this.c;
+ error = new Error(er);
+ this.error = error;
+ return this;
+};
+
+/**
+ */
+SAXParser.prototype.end$ = function () {
+ if (! this.closedRoot) {
+ this.strictFail$S("Unclosed root tag");
+ }
+ if (this.state !== 2) {
+ this.emiterror$S("Unexpected end");
+ }
+ this.closetext$();
+ this.c = "";
+ this.closed = true;
+};
+
+/**
+ * @param {!string} message
+ */
+SAXParser.prototype.strictFail$S = function (message) {
+ if (this.strict) {
+ this.emiterror$S(message);
+ }
+};
+
+/**
+ */
+SAXParser.prototype.newTag$ = function () {
+ if (! this.strict) {
+ this.tagName = this.tagName.toLowerCase();
+ }
+ this.tag = ({name: this.tagName, attributes: ({ }), isSelfClosing: false});
+ this.attribList.length = 0;
+};
+
+/**
+ */
+SAXParser.prototype.attrib$ = function () {
+ if (! this.strict) {
+ this.attribName = this.attribName.toLowerCase();
+ }
+ if ($__jsx_ObjectHasOwnProperty.call(this.tag.attributes, this.attribName)) {
+ this.attribName = this.attribValue = "";
+ return;
+ }
+ this.tag.attributes[this.attribName] = this.attribValue;
+ this.closetext_if_exist$();
+ this.attribName = this.attribValue = "";
+};
+
+/**
+ */
+SAXParser.prototype.openTag$ = function () {
+ this.openTag$B(false);
+};
+
+/**
+ * @param {!boolean} selfClosing
+ */
+SAXParser.prototype.openTag$B = function (selfClosing) {
+ /** @type {Tag} */
+ var tag$0;
+ /** @type {Tag} */
+ var tag$1;
+ (tag$0 = this.tag).isSelfClosing = selfClosing;
+ this.sawRoot = true;
+ this.tags.push(tag$0);
+ this.closetext_if_exist$();
+ this.handler.onopentag$SHS((tag$1 = this.tag).name, tag$1.attributes);
+ if (this.tag.name === 'pre') {
+ this.preTags++;
+ }
+ if (! selfClosing) {
+ if (! this.noscript && this.tagName.toLowerCase() === "script") {
+ this.state = 33;
+ } else {
+ this.state = 2;
+ }
+ this.tag = null;
+ this.tagName = "";
+ }
+ this.attribName = this.attribValue = "";
+ this.attribList.length = 0;
+};
+
+/**
+ */
+SAXParser.prototype.closeTag$ = function () {
+ /** @type {!number} */
+ var t;
+ /** @type {!string} */
+ var tagName;
+ /** @type {!string} */
+ var closeTo;
+ /** @type {Tag} */
+ var close;
+ /** @type {!number} */
+ var s;
+ /** @type {Tag} */
+ var tag$0;
+ if (! this.tagName) {
+ this.strictFail$S("Weird empty close tag.");
+ this.textNode += "</>";
+ this.state = 2;
+ return;
+ }
+ if (this.script) {
+ if (this.tagName !== "script") {
+ this.script += "</" + this.tagName + ">";
+ this.tagName = "";
+ this.state = 33;
+ return;
+ }
+ this.closetext_if_exist$();
+ this.script = "";
+ }
+ t = this.tags.length;
+ tagName = this.tagName;
+ if (! this.strict) {
+ tagName = tagName.toLowerCase();
+ }
+ closeTo = tagName;
+ while (t--) {
+ close = this.tags[t];
+ if (close.name !== closeTo) {
+ this.strictFail$S("Unexpected close tag");
+ } else {
+ break;
+ }
+ }
+ if (t < 0) {
+ this.strictFail$S("Unmatched closing tag: " + this.tagName);
+ this.textNode += "</" + this.tagName + ">";
+ this.state = 2;
+ return;
+ }
+ this.tagName = tagName;
+ s = this.tags.length;
+ while (s-- > t) {
+ tag$0 = this.tag = this.tags.pop();
+ this.tagName = tag$0.name;
+ this.closetext_if_exist$();
+ this.handler.onclosetag$S(this.tagName);
+ if (this.tagName === 'pre') {
+ this.preTags--;
+ }
+ }
+ if (t === 0) {
+ this.closedRoot = true;
+ }
+ this.tagName = this.attribValue = this.attribName = "";
+ this.attribList.length = 0;
+ this.state = 2;
+};
+
+/**
+ * @return {!string}
+ */
+SAXParser.prototype.parseEntity$ = function () {
+ /** @type {!string} */
+ var entity;
+ /** @type {!string} */
+ var entityLC;
+ /** @type {!number} */
+ var num;
+ /** @type {!string} */
+ var numStr;
+ entity = this.entity;
+ entityLC = entity.toLowerCase();
+ num = 0;
+ numStr = "";
+ if (this.ENTITIES[entity]) {
+ return this.ENTITIES[entity];
+ }
+ if (this.ENTITIES[entityLC]) {
+ return this.ENTITIES[entityLC];
+ }
+ entity = entityLC;
+ if (entityLC.charAt(0) === "#") {
+ if (entity.charAt(1) === "x") {
+ entity = entity.slice(2);
+ num = $__jsx_parseInt(entity, 16);
+ numStr = num.toString(16);
+ } else {
+ entity = entity.slice(1);
+ num = $__jsx_parseInt(entity, 10);
+ numStr = num.toString(10);
+ }
+ }
+ entity = entity.replace(/^0+/, "");
+ if (numStr.toLowerCase() !== entity) {
+ this.strictFail$S("Invalid character entity");
+ return "&" + this.entity + ";";
+ }
+ return String.fromCharCode(num);
+};
+
+/**
+ * class Char extends Object
+ * @constructor
+ */
+function Char() {
+}
+
+/**
+ * @constructor
+ */
+function Char$() {
+ this.CDATA = "[CDATA[";
+ this.DOCTYPE = "DOCTYPE";
+ this.XML_NAMESPACE = "http://www.w3.org/XML/1998/namespace";
+ this.whitespace = this._charClass$S("\r\n\t ");
+ this.number = this._charClass$S("0124356789");
+ this.letter = this._charClass$S("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ");
+ this.quote = this._charClass$S("'\"");
+ this.entity = this._charClass$S("0124356789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ#");
+ this.attribEnd = this._charClass$S("\r\n\t >");
+ this.nameStart = /[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/;
+ this.nameBody = /[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040\.\d-]/;
+};
+
+Char$.prototype = new Char;
+
+/**
+ * @param {!string} str
+ * @return {Object.<string, undefined|!boolean>}
+ */
+Char.prototype._charClass$S = function (str) {
+ /** @type {Object.<string, undefined|!boolean>} */
+ var result;
+ /** @type {!number} */
+ var i;
+ result = ({ });
+ for (i = 0; i < str.length; i++) {
+ result[str.slice(i, i + 1)] = true;
+ }
+ return result;
+};
+
+/**
+ * @param {RegExp} charclass
+ * @param {!string} c
+ * @return {!boolean}
+ */
+Char.prototype.is$LRegExp$S = function (charclass, c) {
+ return charclass.test(c);
+};
+
+/**
+ * @param {Object.<string, undefined|!boolean>} charclass
+ * @param {!string} c
+ * @return {!boolean}
+ */
+Char.prototype.is$HBS = function (charclass, c) {
+ return $__jsx_ObjectHasOwnProperty.call(charclass, c);
+};
+
+/**
+ * @param {RegExp} charclass
+ * @param {!string} c
+ * @return {!boolean}
+ */
+Char.prototype.not$LRegExp$S = function (charclass, c) {
+ return ! charclass.test(c);
+};
+
+/**
+ * @param {Object.<string, undefined|!boolean>} charclass
+ * @param {!string} c
+ * @return {!boolean}
+ */
+Char.prototype.not$HBS = function (charclass, c) {
+ return ! $__jsx_ObjectHasOwnProperty.call(charclass, c);
+};
+
+/**
+ * class _Entities extends Object
+ * @constructor
+ */
+function _Entities() {
+}
+
+/**
+ * @constructor
+ */
+function _Entities$() {
+};
+
+_Entities$.prototype = new _Entities;
+
+/**
+ * @return {Object.<string, undefined|!string>}
+ */
+_Entities.entity_list$ = function () {
+ /** @type {Object.<string, undefined|!string>} */
+ var result;
+ /** @type {!string} */
+ var key;
+ /** @type {*} */
+ var value;
+ result = ({ });
+ for (key in _Entities._entities) {
+ value = _Entities._entities[key];
+ if (typeof value === 'string') {
+ result[key] = value + "";
+ } else {
+ if (typeof value === 'number') {
+ result[key] = String.fromCharCode(value | 0);
+ }
+ }
+ }
+ return result;
+};
+
+var _Entities$entity_list$ = _Entities.entity_list$;
+
+/**
+ * class BitVector extends Object
+ * @constructor
+ */
+function BitVector() {
+}
+
+/**
+ * @constructor
+ */
+function BitVector$() {
+ /** @type {Array.<undefined|!number>} */
+ var _v$0;
+ /** @type {Array.<undefined|!number>} */
+ var _r$0;
+ _r$0 = this._r = [ ];
+ _v$0 = this._v = [ ];
+ _v$0.length = 0;
+ _r$0.length = 0;
+ this._size = 0;
+ this._size1 = 0;
+};
+
+BitVector$.prototype = new BitVector;
+
+/**
+ */
+BitVector.prototype.build$ = function () {
+ /** @type {!number} */
+ var i;
+ this._size1 = 0;
+ for (i = 0; i < this._v.length; i++) {
+ if (i % 8 === 0) {
+ this._r.push(true ? this._size1 : this._size - this._size1);
+ }
+ this._size1 += this._rank32$IIB(this._v[i], 32, true);
+ }
+};
+
+/**
+ */
+BitVector.prototype.clear$ = function () {
+ this._v.length = 0;
+ this._r.length = 0;
+ this._size = 0;
+ this._size1 = 0;
+};
+
+/**
+ * @return {!number}
+ */
+BitVector.prototype.size$ = function () {
+ return this._size;
+};
+
+/**
+ * @param {!boolean} b
+ * @return {!number}
+ */
+BitVector.prototype.size$B = function (b) {
+ return (b ? this._size1 : this._size - this._size1);
+};
+
+/**
+ * @param {!number} value
+ */
+BitVector.prototype.set$I = function (value) {
+ this.set$IB(value, true);
+};
+
+/**
+ * @param {!number} value
+ * @param {!boolean} flag
+ */
+BitVector.prototype.set$IB = function (value, flag) {
+ /** @type {!number} */
+ var q;
+ /** @type {!number} */
+ var r;
+ /** @type {!number} */
+ var m;
+ if (value >= this._size) {
+ this._size = (value + 1 | 0);
+ }
+ q = (value / 32 | 0);
+ r = (value % 32 | 0);
+ while (q >= this._v.length) {
+ this._v.push(0);
+ }
+ m = 0x1 << r;
+ if (flag) {
+ this._v[q] |= m;
+ } else {
+ this._v[q] &= ~ m;
+ }
+};
+
+/**
+ * @param {!number} value
+ * @return {!boolean}
+ */
+BitVector.prototype.get$I = function (value) {
+ /** @type {!number} */
+ var q;
+ /** @type {!number} */
+ var r;
+ /** @type {!number} */
+ var m;
+ if (value >= this._size) {
+ throw new Error("BitVector.get() : range error");
+ }
+ q = (value / 32 | 0);
+ r = (value % 32 | 0);
+ m = 0x1 << r;
+ return !! (this._v[q] & m);
+};
+
+/**
+ * @param {!number} i
+ * @return {!number}
+ */
+BitVector.prototype.rank$I = function (i) {
+ return this.rank$IB(i, true);
+};
+
+/**
+ * @param {!number} i
+ * @param {!boolean} b
+ * @return {!number}
+ */
+BitVector.prototype.rank$IB = function (i, b) {
+ /** @type {!number} */
+ var q_large;
+ /** @type {!number} */
+ var q_small;
+ /** @type {!number} */
+ var r;
+ /** @type {!number} */
+ var rank;
+ /** @type {!number} */
+ var begin;
+ /** @type {!number} */
+ var j;
+ if (i > this._size) {
+ throw new Error("BitVector.rank() : range error");
+ }
+ if (i === 0) {
+ return 0;
+ }
+ i--;
+ q_large = (Math.floor(i / 256) | 0);
+ q_small = (Math.floor(i / 32) | 0);
+ r = (Math.floor(i % 32) | 0);
+ rank = (this._r[q_large] | 0);
+ if (! b) {
+ rank = q_large * 256 - rank;
+ }
+ begin = q_large * 8;
+ for (j = begin; j < q_small; j++) {
+ rank += this._rank32$IIB(this._v[j], 32, b);
+ }
+ rank += this._rank32$IIB(this._v[q_small], r + 1, b);
+ return rank;
+};
+
+/**
+ * @param {!number} i
+ * @return {!number}
+ */
+BitVector.prototype.select$I = function (i) {
+ return this.select$IB(i, true);
+};
+
+/**
+ * @param {!number} i
+ * @param {!boolean} b
+ * @return {!number}
+ */
+BitVector.prototype.select$IB = function (i, b) {
+ /** @type {!number} */
+ var left;
+ /** @type {!number} */
+ var right;
+ /** @type {!number} */
+ var pivot;
+ /** @type {undefined|!number} */
+ var rank;
+ /** @type {!number} */
+ var j;
+ if (i >= (b ? this._size1 : this._size - this._size1)) {
+ throw new Error("BitVector.select() : range error");
+ }
+ left = 0;
+ right = this._r.length;
+ while (left < right) {
+ pivot = Math.floor((left + right) / 2);
+ rank = this._r[pivot];
+ if (! b) {
+ rank = pivot * 256 - rank;
+ }
+ if (i < rank) {
+ right = pivot;
+ } else {
+ left = pivot + 1;
+ }
+ }
+ right--;
+ if (b) {
+ i -= (this._r[right] | 0);
+ } else {
+ i -= (right * 256 - this._r[right] | 0);
+ }
+ j = right * 8;
+ while (1) {
+ rank = this._rank32$IIB(this._v[j], 32, b);
+ if (i < rank) {
+ break;
+ }
+ j++;
+ i -= (rank | 0);
+ }
+ return (j * 32 + this._select32$IIB(this._v[j], i, b) | 0);
+};
+
+/**
+ * @param {!number} x
+ * @param {!number} i
+ * @param {!boolean} b
+ * @return {!number}
+ */
+BitVector.prototype._rank32$IIB = function (x, i, b) {
+ if (! b) {
+ x = ~ x;
+ }
+ x <<= 32 - i;
+ x = ((x & 0xaaaaaaaa) >>> 1) + (x & 0x55555555);
+ x = ((x & 0xcccccccc) >>> 2) + (x & 0x33333333);
+ x = ((x & 0xf0f0f0f0) >>> 4) + (x & 0x0f0f0f0f);
+ x = ((x & 0xff00ff00) >>> 8) + (x & 0x00ff00ff);
+ x = ((x & 0xffff0000) >>> 16) + (x & 0x0000ffff);
+ return x;
+};
+
+/**
+ * @param {!number} x
+ * @param {!number} i
+ * @param {!boolean} b
+ * @return {!number}
+ */
+BitVector.prototype._select32$IIB = function (x, i, b) {
+ /** @type {!number} */
+ var x1;
+ /** @type {!number} */
+ var x2;
+ /** @type {!number} */
+ var x3;
+ /** @type {!number} */
+ var x4;
+ /** @type {!number} */
+ var x5;
+ /** @type {!number} */
+ var pos;
+ /** @type {!number} */
+ var v5;
+ /** @type {!number} */
+ var v4;
+ /** @type {!number} */
+ var v3;
+ /** @type {!number} */
+ var v2;
+ /** @type {!number} */
+ var v1;
+ /** @type {!number} */
+ var v0;
+ if (! b) {
+ x = ~ x;
+ }
+ x1 = ((x & 0xaaaaaaaa) >>> 1) + (x & 0x55555555);
+ x2 = ((x1 & 0xcccccccc) >>> 2) + (x1 & 0x33333333);
+ x3 = ((x2 & 0xf0f0f0f0) >>> 4) + (x2 & 0x0f0f0f0f);
+ x4 = ((x3 & 0xff00ff00) >>> 8) + (x3 & 0x00ff00ff);
+ x5 = ((x4 & 0xffff0000) >>> 16) + (x4 & 0x0000ffff);
+ i++;
+ pos = 0;
+ v5 = x5 & 0xffffffff;
+ if (i > v5) {
+ i -= (v5 | 0);
+ pos += 32;
+ }
+ v4 = x4 >>> pos & 0x0000ffff;
+ if (i > v4) {
+ i -= (v4 | 0);
+ pos += 16;
+ }
+ v3 = x3 >>> pos & 0x000000ff;
+ if (i > v3) {
+ i -= (v3 | 0);
+ pos += 8;
+ }
+ v2 = x2 >>> pos & 0x0000000f;
+ if (i > v2) {
+ i -= (v2 | 0);
+ pos += 4;
+ }
+ v1 = x1 >>> pos & 0x00000003;
+ if (i > v1) {
+ i -= (v1 | 0);
+ pos += 2;
+ }
+ v0 = x >>> pos & 0x00000001;
+ if (i > v0) {
+ i -= (v0 | 0);
+ pos += 1;
+ }
+ return (pos | 0);
+};
+
+/**
+ * @return {!string}
+ */
+BitVector.prototype.dump$ = function () {
+ /** @type {Array.<undefined|!string>} */
+ var contents;
+ contents = [ ];
+ contents.push(Binary$dump32bitNumber$N(this._size));
+ contents.push(Binary$dump32bitNumberList$AN(this._v));
+ return contents.join('');
+};
+
+/**
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+BitVector.prototype.dump$LCompressionReport$ = function (report) {
+ /** @type {Array.<undefined|!string>} */
+ var contents;
+ contents = [ ];
+ contents.push(Binary$dump32bitNumber$N(this._size));
+ CompressionReport$add$LCompressionReport$II(report, 2, 2);
+ contents.push(Binary$dump32bitNumberList$ANLCompressionReport$(this._v, report));
+ return contents.join('');
+};
+
+/**
+ * @param {!string} data
+ * @return {!number}
+ */
+BitVector.prototype.load$S = function (data) {
+ return this.load$SI(data, 0);
+};
+
+/**
+ * @param {!string} data
+ * @param {!number} offset
+ * @return {!number}
+ */
+BitVector.prototype.load$SI = function (data, offset) {
+ /** @type {LoadedNumberListResult} */
+ var result;
+ /** @type {!number} */
+ var result$0;
+ this._v.length = 0;
+ this._r.length = 0;
+ this._size = 0;
+ this._size1 = 0;
+ result$0 = data.charCodeAt(offset) * 65536 + data.charCodeAt(offset + 1);
+ this._size = (result$0 | 0);
+ result = Binary$load32bitNumberList$SI(data, offset + 2);
+ this._v = result.result;
+ this.build$();
+ return result.offset;
+};
+
+/**
+ * class WaveletMatrix extends Object
+ * @constructor
+ */
+function WaveletMatrix() {
+}
+
+/**
+ * @constructor
+ */
+function WaveletMatrix$() {
+ /** @type {Array.<undefined|BitVector>} */
+ var _bv$0;
+ /** @type {Array.<undefined|!number>} */
+ var _seps$0;
+ this._range = ({ });
+ _bv$0 = this._bv = [ ];
+ _seps$0 = this._seps = [ ];
+ this._bitsize = 16;
+ _bv$0.length = 0;
+ _seps$0.length = 0;
+ this._size = 0;
+};
+
+WaveletMatrix$.prototype = new WaveletMatrix;
+
+/**
+ * @return {!number}
+ */
+WaveletMatrix.prototype.bitsize$ = function () {
+ return this._bitsize;
+};
+
+/**
+ * @param {!number} charCode
+ */
+WaveletMatrix.prototype.setMaxCharCode$I = function (charCode) {
+ this._bitsize = (Math.ceil(Math.log(charCode) / 0.6931471805599453) | 0);
+};
+
+/**
+ */
+WaveletMatrix.prototype.clear$ = function () {
+ this._bv.length = 0;
+ this._seps.length = 0;
+ this._size = 0;
+};
+
+/**
+ * @param {!string} v
+ */
+WaveletMatrix.prototype.build$S = function (v) {
+ /** @type {!number} */
+ var size;
+ /** @type {!number} */
+ var bitsize;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var depth;
+ /** @type {Object.<string, undefined|!number>} */
+ var range_tmp;
+ /** @type {!number} */
+ var code;
+ /** @type {!boolean} */
+ var bit;
+ /** @type {!number} */
+ var key;
+ /** @type {Object.<string, undefined|!number>} */
+ var range_rev;
+ /** @type {!string} */
+ var range_key;
+ /** @type {!number} */
+ var value;
+ /** @type {!number} */
+ var pos0;
+ /** @type {undefined|!number} */
+ var pos1;
+ /** @type {!string} */
+ var range_rev_key;
+ /** @type {!number} */
+ var begin;
+ /** @type {undefined|!number} */
+ var end;
+ /** @type {!number} */
+ var num0;
+ /** @type {!number} */
+ var num1;
+ this._bv.length = 0;
+ this._seps.length = 0;
+ this._size = 0;
+ size = v.length;
+ bitsize = this._bitsize;
+ for (i = 0; i < bitsize; i++) {
+ this._bv.push(new BitVector$());
+ this._seps.push(0);
+ }
+ this._size = (size | 0);
+ for (i = 0; i < size; i++) {
+ this._bv[0].set$IB(i, this._uint2bit$II(v.charCodeAt(i), 0));
+ }
+ this._bv[0].build$();
+ this._seps[0] = this._bv[0].size$B(false);
+ this._range["0"] = 0;
+ this._range["1"] = this._seps[0];
+ depth = 1;
+ while (depth < bitsize) {
+ range_tmp = WaveletMatrix$_shallow_copy$HI(this._range);
+ for (i = 0; i < size; i++) {
+ code = v.charCodeAt(i);
+ bit = this._uint2bit$II(code, depth);
+ key = code >>> bitsize - depth;
+ this._bv[depth].set$IB(range_tmp[key + ""], bit);
+ range_tmp[key + ""]++;
+ }
+ this._bv[depth].build$();
+ this._seps[depth] = this._bv[depth].size$B(false);
+ range_rev = ({ });
+ for (range_key in this._range) {
+ value = this._range[range_key];
+ if (value != range_tmp[range_key]) {
+ range_rev[value + ""] = range_key | 0;
+ }
+ }
+ this._range = ({ });
+ pos0 = 0;
+ pos1 = this._seps[depth];
+ for (range_rev_key in range_rev) {
+ begin = range_rev_key | 0;
+ value = range_rev[range_rev_key];
+ end = range_tmp[value + ""];
+ num0 = this._bv[depth].rank$IB(end, false) - this._bv[depth].rank$IB(begin, false);
+ num1 = end - begin - num0;
+ if (num0 > 0) {
+ this._range[(value << 1) + ""] = (pos0 | 0);
+ pos0 += num0;
+ }
+ if (num1 > 0) {
+ this._range[(value << 1) + 1 + ""] = pos1;
+ pos1 += (num1 | 0);
+ }
+ }
+ depth++;
+ }
+};
+
+/**
+ * @return {!number}
+ */
+WaveletMatrix.prototype.size$ = function () {
+ return this._size;
+};
+
+/**
+ * @param {!number} c
+ * @return {!number}
+ */
+WaveletMatrix.prototype.size$I = function (c) {
+ return this.rank$II(this._size, c);
+};
+
+/**
+ * @param {!number} i
+ * @return {!number}
+ */
+WaveletMatrix.prototype.get$I = function (i) {
+ /** @type {!number} */
+ var value;
+ /** @type {!number} */
+ var depth;
+ /** @type {!boolean} */
+ var bit;
+ if (i >= this._size) {
+ throw new Error("WaveletMatrix.get() : range error");
+ }
+ value = 0;
+ depth = 0;
+ while (depth < this._bitsize) {
+ bit = this._bv[depth].get$I(i);
+ i = this._bv[depth].rank$IB(i, bit);
+ value <<= 1;
+ if (bit) {
+ i += this._seps[depth];
+ value += 1;
+ }
+ depth++;
+ }
+ return (value | 0);
+};
+
+/**
+ * @param {!number} i
+ * @param {!number} c
+ * @return {!number}
+ */
+WaveletMatrix.prototype.rank$II = function (i, c) {
+ /** @type {undefined|!number} */
+ var begin;
+ /** @type {!number} */
+ var end;
+ /** @type {!number} */
+ var depth;
+ /** @type {!boolean} */
+ var bit;
+ if (i > this._size) {
+ throw new Error("WaveletMatrix.rank(): range error");
+ }
+ if (i === 0) {
+ return 0;
+ }
+ begin = this._range[c + ""];
+ if (begin == null) {
+ return 0;
+ }
+ end = i;
+ depth = 0;
+ while (depth < this._bitsize) {
+ bit = this._uint2bit$II(c, depth);
+ end = this._bv[depth].rank$IB(end, bit);
+ if (bit) {
+ end += this._seps[depth];
+ }
+ depth++;
+ }
+ return (end - begin | 0);
+};
+
+/**
+ * @param {!number} i
+ * @param {!number} c
+ * @return {!number}
+ */
+WaveletMatrix.prototype.rank_less_than$II = function (i, c) {
+ /** @type {!number} */
+ var begin;
+ /** @type {!number} */
+ var end;
+ /** @type {!number} */
+ var depth;
+ /** @type {!number} */
+ var rlt;
+ /** @type {!number} */
+ var rank0_begin;
+ /** @type {!number} */
+ var rank0_end;
+ /** @type {Array.<undefined|!number>} */
+ var _seps$0;
+ if (i > this._size) {
+ throw new Error("WaveletMatrix.rank_less_than(): range error");
+ }
+ if (i === 0) {
+ return 0;
+ }
+ begin = 0;
+ end = i;
+ depth = 0;
+ rlt = 0;
+ while (depth < this._bitsize) {
+ rank0_begin = this._bv[depth].rank$IB(begin, false);
+ rank0_end = this._bv[depth].rank$IB(end, false);
+ if (this._uint2bit$II(c, depth)) {
+ rlt += rank0_end - rank0_begin;
+ begin += (_seps$0 = this._seps)[depth] - rank0_begin;
+ end += _seps$0[depth] - rank0_end;
+ } else {
+ begin = rank0_begin;
+ end = rank0_end;
+ }
+ depth++;
+ }
+ return (rlt | 0);
+};
+
+/**
+ * @return {!string}
+ */
+WaveletMatrix.prototype.dump$ = function () {
+ /** @type {Array.<undefined|!string>} */
+ var contents;
+ /** @type {!number} */
+ var i;
+ /** @type {Array.<undefined|!string>} */
+ var range_contents;
+ /** @type {!number} */
+ var counter;
+ /** @type {!string} */
+ var key;
+ contents = [ Binary$dump16bitNumber$I(this._bitsize), Binary$dump32bitNumber$N(this._size) ];
+ for (i = 0; i < this._bitsize; i++) {
+ contents.push(this._bv[i].dump$());
+ }
+ for (i = 0; i < this._bitsize; i++) {
+ contents.push(Binary$dump32bitNumber$N(this._seps[i]));
+ }
+ range_contents = [ ];
+ counter = 0;
+ for (key in this._range) {
+ range_contents.push(Binary$dump32bitNumber$N(key | 0));
+ range_contents.push(Binary$dump32bitNumber$N(this._range[key]));
+ counter++;
+ }
+ contents.push(Binary$dump32bitNumber$N(counter));
+ return contents.join('') + range_contents.join('');
+};
+
+/**
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+WaveletMatrix.prototype.dump$LCompressionReport$ = function (report) {
+ /** @type {Array.<undefined|!string>} */
+ var contents;
+ /** @type {!number} */
+ var i;
+ /** @type {Array.<undefined|!string>} */
+ var range_contents;
+ /** @type {!number} */
+ var counter;
+ /** @type {!string} */
+ var key;
+ contents = [ Binary$dump16bitNumber$I(this._bitsize), Binary$dump32bitNumber$N(this._size) ];
+ CompressionReport$add$LCompressionReport$II(report, 3, 3);
+ for (i = 0; i < this._bitsize; i++) {
+ contents.push(this._bv[i].dump$LCompressionReport$(report));
+ }
+ for (i = 0; i < this._bitsize; i++) {
+ contents.push(Binary$dump32bitNumber$N(this._seps[i]));
+ CompressionReport$add$LCompressionReport$II(report, 2, 2);
+ }
+ range_contents = [ ];
+ counter = 0;
+ for (key in this._range) {
+ range_contents.push(Binary$dump32bitNumber$N(key | 0));
+ range_contents.push(Binary$dump32bitNumber$N(this._range[key]));
+ CompressionReport$add$LCompressionReport$II(report, 4, 4);
+ counter++;
+ }
+ CompressionReport$add$LCompressionReport$II(report, 2, 2);
+ contents.push(Binary$dump32bitNumber$N(counter));
+ return contents.join('') + range_contents.join('');
+};
+
+/**
+ * @param {!string} data
+ * @return {!number}
+ */
+WaveletMatrix.prototype.load$S = function (data) {
+ return this.load$SI(data, 0);
+};
+
+/**
+ * @param {!string} data
+ * @param {!number} offset
+ * @return {!number}
+ */
+WaveletMatrix.prototype.load$SI = function (data, offset) {
+ /** @type {!number} */
+ var i;
+ /** @type {BitVector} */
+ var bit_vector;
+ /** @type {!number} */
+ var range_size;
+ /** @type {!number} */
+ var value;
+ /** @type {!number} */
+ var offset$0;
+ /** @type {!number} */
+ var result$0;
+ /** @type {!number} */
+ var result$1;
+ /** @type {!number} */
+ var result$2;
+ this._bv.length = 0;
+ this._seps.length = 0;
+ this._size = 0;
+ offset$0 = offset++;
+ this._bitsize = (data.charCodeAt(offset$0) | 0);
+ result$0 = data.charCodeAt(offset) * 65536 + data.charCodeAt(offset + 1);
+ this._size = (result$0 | 0);
+ offset += 2;
+ for (i = 0; i < this._bitsize; i++) {
+ bit_vector = new BitVector$();
+ offset = bit_vector.load$SI(data, offset);
+ this._bv.push(bit_vector);
+ }
+ for (i = 0; i < this._bitsize; (i++, offset += 2)) {
+ this._seps.push(Binary$load32bitNumber$SI(data, offset));
+ }
+ result$1 = data.charCodeAt(offset) * 65536 + data.charCodeAt(offset + 1);
+ range_size = result$1;
+ offset += 2;
+ for (i = 0; i < range_size; (i++, offset += 4)) {
+ result$2 = data.charCodeAt(offset) * 65536 + data.charCodeAt(offset + 1);
+ value = Binary$load32bitNumber$SI(data, offset + 2);
+ this._range[result$2 + ""] = (value | 0);
+ }
+ return offset;
+};
+
+/**
+ * @param {Object.<string, undefined|!number>} input
+ * @return {Object.<string, undefined|!number>}
+ */
+WaveletMatrix._shallow_copy$HI = function (input) {
+ /** @type {Object.<string, undefined|!number>} */
+ var result;
+ /** @type {!string} */
+ var key;
+ result = ({ });
+ for (key in input) {
+ result[key] = input[key];
+ }
+ return result;
+};
+
+var WaveletMatrix$_shallow_copy$HI = WaveletMatrix._shallow_copy$HI;
+
+/**
+ * @param {!number} c
+ * @param {!number} i
+ * @return {!boolean}
+ */
+WaveletMatrix.prototype._uint2bit$II = function (c, i) {
+ return (c >>> this._bitsize - 1 - i & 0x1) === 0x1;
+};
+
+/**
+ * class BurrowsWheelerTransform extends Object
+ * @constructor
+ */
+function BurrowsWheelerTransform() {
+}
+
+/**
+ * @constructor
+ */
+function BurrowsWheelerTransform$() {
+ this._str = "";
+ this._size = 0;
+ this._head = 0;
+ this._suffixarray = [ ];
+};
+
+BurrowsWheelerTransform$.prototype = new BurrowsWheelerTransform;
+
+/**
+ * @param {BurrowsWheelerTransform} $this
+ * @return {!number}
+ */
+BurrowsWheelerTransform.size$LBurrowsWheelerTransform$ = function ($this) {
+ return $this._size;
+};
+
+var BurrowsWheelerTransform$size$LBurrowsWheelerTransform$ = BurrowsWheelerTransform.size$LBurrowsWheelerTransform$;
+
+/**
+ * @param {BurrowsWheelerTransform} $this
+ * @return {!number}
+ */
+BurrowsWheelerTransform.head$LBurrowsWheelerTransform$ = function ($this) {
+ return $this._head;
+};
+
+var BurrowsWheelerTransform$head$LBurrowsWheelerTransform$ = BurrowsWheelerTransform.head$LBurrowsWheelerTransform$;
+
+/**
+ * @param {BurrowsWheelerTransform} $this
+ */
+BurrowsWheelerTransform.clear$LBurrowsWheelerTransform$ = function ($this) {
+ $this._str = "";
+ $this._size = 0;
+ $this._head = 0;
+ $this._suffixarray.length = 0;
+};
+
+var BurrowsWheelerTransform$clear$LBurrowsWheelerTransform$ = BurrowsWheelerTransform.clear$LBurrowsWheelerTransform$;
+
+/**
+ * @param {BurrowsWheelerTransform} $this
+ * @param {!string} str
+ */
+BurrowsWheelerTransform.build$LBurrowsWheelerTransform$S = function ($this, str) {
+ /** @type {!string} */
+ var _str$0;
+ /** @type {Array.<undefined|!number>} */
+ var _suffixarray$0;
+ _str$0 = $this._str = str;
+ $this._size = _str$0.length;
+ _suffixarray$0 = $this._suffixarray = SAIS$make$S(str);
+ $this._head = (_suffixarray$0.indexOf(0) | 0);
+};
+
+var BurrowsWheelerTransform$build$LBurrowsWheelerTransform$S = BurrowsWheelerTransform.build$LBurrowsWheelerTransform$S;
+
+/**
+ * @param {BurrowsWheelerTransform} $this
+ * @param {!number} i
+ * @return {!string}
+ */
+BurrowsWheelerTransform.get$LBurrowsWheelerTransform$I = function ($this, i) {
+ /** @type {!number} */
+ var size;
+ /** @type {!number} */
+ var index;
+ size = $this._size;
+ if (i >= size) {
+ throw new Error("BurrowsWheelerTransform.get() : range error");
+ }
+ index = ($this._suffixarray[i] + size - 1) % size;
+ return $this._str.charAt(index);
+};
+
+var BurrowsWheelerTransform$get$LBurrowsWheelerTransform$I = BurrowsWheelerTransform.get$LBurrowsWheelerTransform$I;
+
+/**
+ * @param {BurrowsWheelerTransform} $this
+ * @return {!string}
+ */
+BurrowsWheelerTransform.get$LBurrowsWheelerTransform$ = function ($this) {
+ /** @type {Array.<undefined|!string>} */
+ var str;
+ /** @type {!number} */
+ var size;
+ /** @type {!number} */
+ var i;
+ str = [ ];
+ size = $this._size;
+ for (i = 0; i < size; i++) {
+ str.push(BurrowsWheelerTransform$get$LBurrowsWheelerTransform$I($this, i));
+ }
+ return str.join("");
+};
+
+var BurrowsWheelerTransform$get$LBurrowsWheelerTransform$ = BurrowsWheelerTransform.get$LBurrowsWheelerTransform$;
+
+/**
+ * @param {BurrowsWheelerTransform} $this
+ * @param {!string} replace
+ * @return {!string}
+ */
+BurrowsWheelerTransform.get$LBurrowsWheelerTransform$S = function ($this, replace) {
+ /** @type {!string} */
+ var result;
+ result = BurrowsWheelerTransform$get$LBurrowsWheelerTransform$($this);
+ return result.replace(BurrowsWheelerTransform.END_MARKER, replace);
+};
+
+var BurrowsWheelerTransform$get$LBurrowsWheelerTransform$S = BurrowsWheelerTransform.get$LBurrowsWheelerTransform$S;
+
+/**
+ * class OArray extends Object
+ * @constructor
+ */
+function OArray() {
+}
+
+/**
+ * @constructor
+ * @param {Array.<undefined|!number>} array
+ */
+function OArray$AI(array) {
+ this.array = array;
+ this.offset = 0;
+};
+
+OArray$AI.prototype = new OArray;
+
+/**
+ * @constructor
+ * @param {Array.<undefined|!number>} array
+ * @param {!number} offset
+ */
+function OArray$AII(array, offset) {
+ this.array = array;
+ this.offset = offset;
+};
+
+OArray$AII.prototype = new OArray;
+
+/**
+ * @param {OArray} $this
+ * @param {!number} index
+ * @return {!number}
+ */
+OArray.get$LOArray$I = function ($this, index) {
+ return $this.array[index + $this.offset];
+};
+
+var OArray$get$LOArray$I = OArray.get$LOArray$I;
+
+/**
+ * @param {OArray} $this
+ * @param {!number} index
+ * @param {!number} value
+ */
+OArray.set$LOArray$II = function ($this, index, value) {
+ $this.array[index + $this.offset] = value;
+};
+
+var OArray$set$LOArray$II = OArray.set$LOArray$II;
+
+/**
+ * @param {OArray} $this
+ * @param {!number} index
+ * @return {!boolean}
+ */
+OArray.isS$LOArray$I = function ($this, index) {
+ /** @type {Array.<undefined|!number>} */
+ var array$0;
+ /** @type {!number} */
+ var offset$0;
+ return (array$0 = $this.array)[index + (offset$0 = $this.offset)] < array$0[index + offset$0 + 1];
+};
+
+var OArray$isS$LOArray$I = OArray.isS$LOArray$I;
+
+/**
+ * @param {OArray} $this
+ * @param {!number} index1
+ * @param {!number} index2
+ * @return {!boolean}
+ */
+OArray.compare$LOArray$II = function ($this, index1, index2) {
+ /** @type {Array.<undefined|!number>} */
+ var array$0;
+ /** @type {!number} */
+ var offset$0;
+ return (array$0 = $this.array)[index1 + (offset$0 = $this.offset)] == array$0[index2 + offset$0];
+};
+
+var OArray$compare$LOArray$II = OArray.compare$LOArray$II;
+
+/**
+ * class SAIS extends Object
+ * @constructor
+ */
+function SAIS() {
+}
+
+/**
+ * @constructor
+ */
+function SAIS$() {
+};
+
+SAIS$.prototype = new SAIS;
+
+/**
+ * @param {BitVector} t
+ * @param {!number} i
+ * @return {!boolean}
+ */
+SAIS._isLMS$LBitVector$I = function (t, i) {
+ return i > 0 && t.get$I(i) && ! t.get$I(i - 1);
+};
+
+var SAIS$_isLMS$LBitVector$I = SAIS._isLMS$LBitVector$I;
+
+/**
+ * @param {OArray} s
+ * @param {Array.<undefined|!number>} bkt
+ * @param {!number} n
+ * @param {!number} K
+ * @param {!boolean} end
+ */
+SAIS._getBuckets$LOArray$AIIIB = function (s, bkt, n, K, end) {
+ /** @type {!number} */
+ var sum;
+ /** @type {!number} */
+ var i;
+ sum = 0;
+ for (i = 0; i <= K; i++) {
+ bkt[i] = 0;
+ }
+ for (i = 0; i < n; i++) {
+ bkt[OArray$get$LOArray$I(s, i)]++;
+ }
+ for (i = 0; i <= K; i++) {
+ sum += bkt[i];
+ bkt[i] = ((end ? sum : sum - bkt[i]) | 0);
+ }
+};
+
+var SAIS$_getBuckets$LOArray$AIIIB = SAIS._getBuckets$LOArray$AIIIB;
+
+/**
+ * @param {BitVector} t
+ * @param {Array.<undefined|!number>} SA
+ * @param {OArray} s
+ * @param {Array.<undefined|!number>} bkt
+ * @param {!number} n
+ * @param {!number} K
+ * @param {!boolean} end
+ */
+SAIS._induceSAl$LBitVector$AILOArray$AIIIB = function (t, SA, s, bkt, n, K, end) {
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var j;
+ SAIS$_getBuckets$LOArray$AIIIB(s, bkt, n, K, end);
+ for (i = 0; i < n; i++) {
+ j = SA[i] - 1;
+ if (j >= 0 && ! t.get$I(j)) {
+ SA[bkt[OArray$get$LOArray$I(s, j)]++] = (j | 0);
+ }
+ }
+};
+
+var SAIS$_induceSAl$LBitVector$AILOArray$AIIIB = SAIS._induceSAl$LBitVector$AILOArray$AIIIB;
+
+/**
+ * @param {BitVector} t
+ * @param {Array.<undefined|!number>} SA
+ * @param {OArray} s
+ * @param {Array.<undefined|!number>} bkt
+ * @param {!number} n
+ * @param {!number} K
+ * @param {!boolean} end
+ */
+SAIS._induceSAs$LBitVector$AILOArray$AIIIB = function (t, SA, s, bkt, n, K, end) {
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var j;
+ SAIS$_getBuckets$LOArray$AIIIB(s, bkt, n, K, end);
+ for (i = n - 1; i >= 0; i--) {
+ j = SA[i] - 1;
+ if (j >= 0 && t.get$I(j)) {
+ SA[-- bkt[OArray$get$LOArray$I(s, j)]] = (j | 0);
+ }
+ }
+};
+
+var SAIS$_induceSAs$LBitVector$AILOArray$AIIIB = SAIS._induceSAs$LBitVector$AILOArray$AIIIB;
+
+/**
+ * @param {!string} source
+ * @return {Array.<undefined|!number>}
+ */
+SAIS.make$S = function (source) {
+ /** @type {Array.<undefined|!number>} */
+ var charCodes;
+ /** @type {!number} */
+ var maxCode;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var code;
+ /** @type {Array.<undefined|!number>} */
+ var SA;
+ /** @type {OArray} */
+ var s;
+ charCodes = [ ];
+ charCodes.length = source.length;
+ maxCode = 0;
+ for (i = 0; i < source.length; i++) {
+ code = source.charCodeAt(i);
+ charCodes[i] = (code | 0);
+ maxCode = (code > maxCode ? code : maxCode);
+ }
+ SA = [ ];
+ SA.length = source.length;
+ s = ({offset: 0, array: charCodes});
+ SAIS$_make$LOArray$AIII(s, SA, source.length, maxCode);
+ return SA;
+};
+
+var SAIS$make$S = SAIS.make$S;
+
+/**
+ * @param {OArray} s
+ * @param {Array.<undefined|!number>} SA
+ * @param {!number} n
+ * @param {!number} K
+ */
+SAIS._make$LOArray$AIII = function (s, SA, n, K) {
+ /** @type {BitVector} */
+ var t;
+ /** @type {!number} */
+ var i;
+ /** @type {Array.<undefined|!number>} */
+ var bkt;
+ /** @type {!number} */
+ var n1;
+ /** @type {!number} */
+ var name;
+ /** @type {!number} */
+ var prev;
+ /** @type {undefined|!number} */
+ var pos;
+ /** @type {!boolean} */
+ var diff;
+ /** @type {!number} */
+ var d;
+ /** @type {!number} */
+ var j;
+ /** @type {Array.<undefined|!number>} */
+ var SA1;
+ /** @type {OArray} */
+ var s1;
+ /** @type {!number} */
+ var i$0;
+ /** @type {!number} */
+ var index$0;
+ t = new BitVector$();
+ t.set$IB(n - 2, false);
+ t.set$IB(n - 1, true);
+ for (i = n - 3; i >= 0; i--) {
+ t.set$IB(i, OArray$isS$LOArray$I(s, i) || OArray$compare$LOArray$II(s, i, i + 1) && t.get$I(i + 1));
+ }
+ bkt = [ ];
+ bkt.length = K + 1;
+ SAIS$_getBuckets$LOArray$AIIIB(s, bkt, n, K, true);
+ for (i = 0; i < n; i++) {
+ SA[i] = -1;
+ }
+ for (i = 1; i < n; i++) {
+ if (SAIS$_isLMS$LBitVector$I(t, i)) {
+ SA[-- bkt[OArray$get$LOArray$I(s, i)]] = (i | 0);
+ }
+ }
+ SAIS$_induceSAl$LBitVector$AILOArray$AIIIB(t, SA, s, bkt, n, K, false);
+ SAIS$_induceSAs$LBitVector$AILOArray$AIIIB(t, SA, s, bkt, n, K, true);
+ n1 = 0;
+ for (i = 0; i < n; i++) {
+ i$0 = SA[i];
+ if (i$0 > 0 && t.get$I(i$0) && ! t.get$I(i$0 - 1)) {
+ SA[n1++] = SA[i];
+ }
+ }
+ for (i = n1; i < n; i++) {
+ SA[i] = -1;
+ }
+ name = 0;
+ prev = -1;
+ for (i = 0; i < n1; i++) {
+ pos = SA[i];
+ diff = false;
+ for (d = 0; d < n; d++) {
+ if (prev === -1 || ! OArray$compare$LOArray$II(s, pos + d, prev + d) || t.get$I(pos + d) !== t.get$I(prev + d)) {
+ diff = true;
+ break;
+ } else {
+ if (d > 0 && (SAIS$_isLMS$LBitVector$I(t, pos + d) || SAIS$_isLMS$LBitVector$I(t, prev + d))) {
+ break;
+ }
+ }
+ }
+ if (diff) {
+ name++;
+ prev = pos;
+ }
+ pos = ((pos % 2 === 0 ? pos / 2 : (pos - 1) / 2) | 0);
+ SA[n1 + pos] = (name - 1 | 0);
+ }
+ for ((i = n - 1, j = n - 1); i >= n1; i--) {
+ if (SA[i] >= 0) {
+ SA[j--] = SA[i];
+ }
+ }
+ SA1 = SA;
+ s1 = ({offset: n - n1, array: SA});
+ if (name < n1) {
+ SAIS$_make$LOArray$AIII(s1, SA1, n1, name - 1);
+ } else {
+ for (i = 0; i < n1; i++) {
+ SA1[OArray$get$LOArray$I(s1, i)] = (i | 0);
+ }
+ }
+ bkt = [ ];
+ bkt.length = K + 1;
+ SAIS$_getBuckets$LOArray$AIIIB(s, bkt, n, K, true);
+ for ((i = 1, j = 0); i < n; i++) {
+ if (SAIS$_isLMS$LBitVector$I(t, i)) {
+ OArray$set$LOArray$II(s1, j++, i);
+ }
+ }
+ for (i = 0; i < n1; i++) {
+ index$0 = SA1[i];
+ SA1[i] = s1.array[index$0 + s1.offset];
+ }
+ for (i = n1; i < n; i++) {
+ SA[i] = -1;
+ }
+ for (i = n1 - 1; i >= 0; i--) {
+ j = SA[i];
+ SA[i] = -1;
+ SA[-- bkt[OArray$get$LOArray$I(s, j)]] = (j | 0);
+ }
+ SAIS$_induceSAl$LBitVector$AILOArray$AIIIB(t, SA, s, bkt, n, K, false);
+ SAIS$_induceSAs$LBitVector$AILOArray$AIIIB(t, SA, s, bkt, n, K, true);
+};
+
+var SAIS$_make$LOArray$AIII = SAIS._make$LOArray$AIII;
+
+OktaviaSearch._stemmer = null;
+OktaviaSearch._instance = null;
+$__jsx_lazy_init(Oktavia, "eof", function () {
+ return String.fromCharCode(0);
+});
+$__jsx_lazy_init(Oktavia, "eob", function () {
+ return String.fromCharCode(1);
+});
+$__jsx_lazy_init(Oktavia, "unknown", function () {
+ return String.fromCharCode(3);
+});
+Binary._base64EncodeChars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
+$__jsx_lazy_init(Binary, "_base64DecodeChars", function () {
+ return [ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 62, -1, -1, -1, 63, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, -1, -1, -1, -1, -1, -1, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -1, -1, -1, -1, -1, -1, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, -1, -1, -1, -1 ];
+});
+$__jsx_lazy_init(Style, "console", function () {
+ return ({ 'title': [ '\x1B[32m\x1b[4m', '\x1B[39m\x1b[0m' ], 'url': [ '\x1B[34m', '\x1B[39m' ], 'hit': [ '\x1B[4m', '\x1B[0m' ], 'del': [ '\x1B[9m', '\x1B[0m' ], 'summary': [ '\x1B[90m', '\x1B[39m' ] });
+});
+$__jsx_lazy_init(Style, "html", function () {
+ return ({ 'title': [ '<span class="title">', '</span>' ], 'url': [ '<span class="url">', '</span>' ], 'hit': [ '<span class="hit">', '</span>' ], 'del': [ '<del>', '</del>' ], 'summary': [ '<span class="reuslt">', '</span>' ] });
+});
+$__jsx_lazy_init(Style, "ignore", function () {
+ return ({ 'tilte': [ '', '' ], 'url': [ '', '' ], 'hit': [ '', '' ], 'del': [ '', '' ], 'summary': [ '', '' ] });
+});
+FinnishStemmer.serialVersionUID = 1;
+$__jsx_lazy_init(FinnishStemmer, "methodObject", function () {
+ return new FinnishStemmer$();
+});
+$__jsx_lazy_init(FinnishStemmer, "a_0", function () {
+ return [ new Among$SII("pa", -1, 1), new Among$SII("sti", -1, 2), new Among$SII("kaan", -1, 1), new Among$SII("han", -1, 1), new Among$SII("kin", -1, 1), new Among$SII("h\u00E4n", -1, 1), new Among$SII("k\u00E4\u00E4n", -1, 1), new Among$SII("ko", -1, 1), new Among$SII("p\u00E4", -1, 1), new Among$SII("k\u00F6", -1, 1) ];
+});
+$__jsx_lazy_init(FinnishStemmer, "a_1", function () {
+ return [ new Among$SII("lla", -1, -1), new Among$SII("na", -1, -1), new Among$SII("ssa", -1, -1), new Among$SII("ta", -1, -1), new Among$SII("lta", 3, -1), new Among$SII("sta", 3, -1) ];
+});
+$__jsx_lazy_init(FinnishStemmer, "a_2", function () {
+ return [ new Among$SII("ll\u00E4", -1, -1), new Among$SII("n\u00E4", -1, -1), new Among$SII("ss\u00E4", -1, -1), new Among$SII("t\u00E4", -1, -1), new Among$SII("lt\u00E4", 3, -1), new Among$SII("st\u00E4", 3, -1) ];
+});
+$__jsx_lazy_init(FinnishStemmer, "a_3", function () {
+ return [ new Among$SII("lle", -1, -1), new Among$SII("ine", -1, -1) ];
+});
+$__jsx_lazy_init(FinnishStemmer, "a_4", function () {
+ return [ new Among$SII("nsa", -1, 3), new Among$SII("mme", -1, 3), new Among$SII("nne", -1, 3), new Among$SII("ni", -1, 2), new Among$SII("si", -1, 1), new Among$SII("an", -1, 4), new Among$SII("en", -1, 6), new Among$SII("\u00E4n", -1, 5), new Among$SII("ns\u00E4", -1, 3) ];
+});
+$__jsx_lazy_init(FinnishStemmer, "a_5", function () {
+ return [ new Among$SII("aa", -1, -1), new Among$SII("ee", -1, -1), new Among$SII("ii", -1, -1), new Among$SII("oo", -1, -1), new Among$SII("uu", -1, -1), new Among$SII("\u00E4\u00E4", -1, -1), new Among$SII("\u00F6\u00F6", -1, -1) ];
+});
+$__jsx_lazy_init(FinnishStemmer, "a_6", function () {
+ return [ new Among$SII("a", -1, 8), new Among$SII("lla", 0, -1), new Among$SII("na", 0, -1), new Among$SII("ssa", 0, -1), new Among$SII("ta", 0, -1), new Among$SII("lta", 4, -1), new Among$SII("sta", 4, -1), new Among$SII("tta", 4, 9), new Among$SII("lle", -1, -1), new Among$SII("ine", -1, -1), new Among$SII("ksi", -1, -1), new Among$SII("n", -1, 7), new Among$SII("han", 11, 1), new Among$SIIF$LBaseStemmer$B$LBaseStemmer$("den", 11, -1, (function (instance) {
+ return instance.r_VI$();
+ }), FinnishStemmer.methodObject), new Among$SIIF$LBaseStemmer$B$LBaseStemmer$("seen", 11, -1, (function (instance) {
+ return instance.r_LONG$();
+ }), FinnishStemmer.methodObject), new Among$SII("hen", 11, 2), new Among$SIIF$LBaseStemmer$B$LBaseStemmer$("tten", 11, -1, (function (instance) {
+ return instance.r_VI$();
+ }), FinnishStemmer.methodObject), new Among$SII("hin", 11, 3), new Among$SIIF$LBaseStemmer$B$LBaseStemmer$("siin", 11, -1, (function (instance) {
+ return instance.r_VI$();
+ }), FinnishStemmer.methodObject), new Among$SII("hon", 11, 4), new Among$SII("h\u00E4n", 11, 5), new Among$SII("h\u00F6n", 11, 6), new Among$SII("\u00E4", -1, 8), new Among$SII("ll\u00E4", 22, -1), new Among$SII("n\u00E4", 22, -1), new Among$SII("ss\u00E4", 22, -1), new Among$SII("t\u00E4", 22, -1), new Among$SII("lt\u00E4", 26, -1), new Among$SII("st\u00E4", 26, -1), new Among$SII("tt\u00E4", 26, 9) ];
+});
+$__jsx_lazy_init(FinnishStemmer, "a_7", function () {
+ return [ new Among$SII("eja", -1, -1), new Among$SII("mma", -1, 1), new Among$SII("imma", 1, -1), new Among$SII("mpa", -1, 1), new Among$SII("impa", 3, -1), new Among$SII("mmi", -1, 1), new Among$SII("immi", 5, -1), new Among$SII("mpi", -1, 1), new Among$SII("impi", 7, -1), new Among$SII("ej\u00E4", -1, -1), new Among$SII("mm\u00E4", -1, 1), new Among$SII("imm\u00E4", 10, -1), new Among$SII("mp\u00E4", -1, 1), new Among$SII("imp\u00E4", 12, -1) ];
+});
+$__jsx_lazy_init(FinnishStemmer, "a_8", function () {
+ return [ new Among$SII("i", -1, -1), new Among$SII("j", -1, -1) ];
+});
+$__jsx_lazy_init(FinnishStemmer, "a_9", function () {
+ return [ new Among$SII("mma", -1, 1), new Among$SII("imma", 0, -1) ];
+});
+$__jsx_lazy_init(FinnishStemmer, "g_AEI", function () {
+ return [ 17, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8 ];
+});
+$__jsx_lazy_init(FinnishStemmer, "g_V1", function () {
+ return [ 17, 65, 16, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 32 ];
+});
+$__jsx_lazy_init(FinnishStemmer, "g_V2", function () {
+ return [ 17, 65, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 32 ];
+});
+$__jsx_lazy_init(FinnishStemmer, "g_particle_end", function () {
+ return [ 17, 97, 24, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 32 ];
+});
+$__jsx_lazy_init(_Common, "buffers", function () {
+ return [ "comment", "sgmlDecl", "textNode", "tagName", "doctype", "procInstName", "procInstBody", "entity", "attribName", "attribValue", "cdata", "script" ];
+});
+$__jsx_lazy_init(_Common, "EVENTS", function () {
+ return [ "text", "processinginstruction", "sgmldeclaration", "doctype", "comment", "attribute", "opentag", "closetag", "opencdata", "cdata", "clo_State.CDATA", "error", "end", "ready", "script", "opennamespace", "closenamespace" ];
+});
+_Common.MAX_BUFFER_LENGTH = 65536;
+_State.BEGIN = 1;
+_State.TEXT = 2;
+_State.TEXT_ENTITY = 3;
+_State.OPEN_WAKA = 4;
+_State.SGML_DECL = 5;
+_State.SGML_DECL_QUOTED = 6;
+_State.DOCTYPE = 7;
+_State.DOCTYPE_QUOTED = 8;
+_State.DOCTYPE_DTD = 9;
+_State.DOCTYPE_DTD_QUOTED = 10;
+_State.COMMENT_STARTING = 11;
+_State.COMMENT = 12;
+_State.COMMENT_ENDING = 13;
+_State.COMMENT_ENDED = 14;
+_State.CDATA = 15;
+_State.CDATA_ENDING = 16;
+_State.CDATA_ENDING_2 = 17;
+_State.PROC_INST = 18;
+_State.PROC_INST_BODY = 19;
+_State.PROC_INST_ENDING = 20;
+_State.OPEN_TAG = 21;
+_State.OPEN_TAG_SLASH = 22;
+_State.ATTRIB = 23;
+_State.ATTRIB_NAME = 24;
+_State.ATTRIB_NAME_SAW_WHITE = 25;
+_State.ATTRIB_VALUE = 26;
+_State.ATTRIB_VALUE_QUOTED = 27;
+_State.ATTRIB_VALUE_UNQUOTED = 28;
+_State.ATTRIB_VALUE_ENTITY_Q = 29;
+_State.ATTRIB_VALUE_ENTITY_U = 30;
+_State.CLOSE_TAG = 31;
+_State.CLOSE_TAG_SAW_WHITE = 32;
+_State.SCRIPT = 33;
+_State.SCRIPT_ENDING = 34;
+$__jsx_lazy_init(_Entities, "_entities", function () {
+ return ({ "amp": "&", "gt": ">", "lt": "<", "quot": "\"", "apos": "'", "AElig": 198, "Aacute": 193, "Acirc": 194, "Agrave": 192, "Aring": 197, "Atilde": 195, "Auml": 196, "Ccedil": 199, "ETH": 208, "Eacute": 201, "Ecirc": 202, "Egrave": 200, "Euml": 203, "Iacute": 205, "Icirc": 206, "Igrave": 204, "Iuml": 207, "Ntilde": 209, "Oacute": 211, "Ocirc": 212, "Ograve": 210, "Oslash": 216, "Otilde": 213, "Ouml": 214, "THORN": 222, "Uacute": 218, "Ucirc": 219, "Ugrave": 217, "Uuml": 220, "Yacute": 221, "aacute": 225, "acirc": 226, "aelig": 230, "agrave": 224, "aring": 229, "atilde": 227, "auml": 228, "ccedil": 231, "eacute": 233, "ecirc": 234, "egrave": 232, "eth": 240, "euml": 235, "iacute": 237, "icirc": 238, "igrave": 236, "iuml": 239, "ntilde": 241, "oacute": 243, "ocirc": 244, "ograve": 242, "oslash": 248, "otilde": 245, "ouml": 246, "szlig": 223, "thorn": 254, "uacute": 250, "ucirc": 251, "ugrave": 249, "uuml": 252, "yacute": 253, "yuml": 255, "copy": 169, "reg": 174, "nbsp": 160, "iexcl": 161, "cent": 162, "pound": 163, "curren": 164, "yen": 165, "brvbar": 166, "sect": 167, "uml": 168, "ordf": 170, "laquo": 171, "not": 172, "shy": 173, "macr": 175, "deg": 176, "plusmn": 177, "sup1": 185, "sup2": 178, "sup3": 179, "acute": 180, "micro": 181, "para": 182, "middot": 183, "cedil": 184, "ordm": 186, "raquo": 187, "frac14": 188, "frac12": 189, "frac34": 190, "iquest": 191, "times": 215, "divide": 247, "OElig": 338, "oelig": 339, "Scaron": 352, "scaron": 353, "Yuml": 376, "fnof": 402, "circ": 710, "tilde": 732, "Alpha": 913, "Beta": 914, "Gamma": 915, "Delta": 916, "Epsilon": 917, "Zeta": 918, "Eta": 919, "Theta": 920, "Iota": 921, "Kappa": 922, "Lambda": 923, "Mu": 924, "Nu": 925, "Xi": 926, "Omicron": 927, "Pi": 928, "Rho": 929, "Sigma": 931, "Tau": 932, "Upsilon": 933, "Phi": 934, "Chi": 935, "Psi": 936, "Omega": 937, "alpha": 945, "beta": 946, "gamma": 947, "delta": 948, "epsilon": 949, "zeta": 950, "eta": 951, "theta": 952, "iota": 953, "kappa": 954, "lambda": 955, "mu": 956, "nu": 957, "xi": 958, "omicron": 959, "pi": 960, "rho": 961, "sigmaf": 962, "sigma": 963, "tau": 964, "upsilon": 965, "phi": 966, "chi": 967, "psi": 968, "omega": 969, "thetasym": 977, "upsih": 978, "piv": 982, "ensp": 8194, "emsp": 8195, "thinsp": 8201, "zwnj": 8204, "zwj": 8205, "lrm": 8206, "rlm": 8207, "ndash": 8211, "mdash": 8212, "lsquo": 8216, "rsquo": 8217, "sbquo": 8218, "ldquo": 8220, "rdquo": 8221, "bdquo": 8222, "dagger": 8224, "Dagger": 8225, "bull": 8226, "hellip": 8230, "permil": 8240, "prime": 8242, "Prime": 8243, "lsaquo": 8249, "rsaquo": 8250, "oline": 8254, "frasl": 8260, "euro": 8364, "image": 8465, "weierp": 8472, "real": 8476, "trade": 8482, "alefsym": 8501, "larr": 8592, "uarr": 8593, "rarr": 8594, "darr": 8595, "harr": 8596, "crarr": 8629, "lArr": 8656, "uArr": 8657, "rArr": 8658, "dArr": 8659, "hArr": 8660, "forall": 8704, "part": 8706, "exist": 8707, "empty": 8709, "nabla": 8711, "isin": 8712, "notin": 8713, "ni": 8715, "prod": 8719, "sum": 8721, "minus": 8722, "lowast": 8727, "radic": 8730, "prop": 8733, "infin": 8734, "ang": 8736, "and": 8743, "or": 8744, "cap": 8745, "cup": 8746, "int": 8747, "there4": 8756, "sim": 8764, "cong": 8773, "asymp": 8776, "ne": 8800, "equiv": 8801, "le": 8804, "ge": 8805, "sub": 8834, "sup": 8835, "nsub": 8836, "sube": 8838, "supe": 8839, "oplus": 8853, "otimes": 8855, "perp": 8869, "sdot": 8901, "lceil": 8968, "rceil": 8969, "lfloor": 8970, "rfloor": 8971, "lang": 9001, "rang": 9002, "loz": 9674, "spades": 9824, "clubs": 9827, "hearts": 9829, "diams": 9830 });
+});
+BitVector.SMALL_BLOCK_SIZE = 32;
+BitVector.LARGE_BLOCK_SIZE = 256;
+BitVector.BLOCK_RATE = 8;
+$__jsx_lazy_init(BurrowsWheelerTransform, "END_MARKER", function () {
+ return String.fromCharCode(0);
+});
+var $__jsx_classMap = {
+ "tool/web/oktavia-finnish-search.jsx": {
+ _Main: _Main,
+ _Main$: _Main$
+ },
+ "tool/web/oktavia-search.jsx": {
+ _Result: _Result,
+ _Result$SSSI: _Result$SSSI,
+ _Proposal: _Proposal,
+ _Proposal$SSI: _Proposal$SSI,
+ OktaviaSearch: OktaviaSearch,
+ OktaviaSearch$I: OktaviaSearch$I,
+ _Main: _Main$0,
+ _Main$: _Main$0$
+ },
+ "src/oktavia.jsx": {
+ Oktavia: Oktavia,
+ Oktavia$: Oktavia$
+ },
+ "src/binary-util.jsx": {
+ Binary: Binary,
+ Binary$: Binary$,
+ LoadedStringResult: LoadedStringResult,
+ LoadedStringResult$SI: LoadedStringResult$SI,
+ LoadedStringListResult: LoadedStringListResult,
+ LoadedStringListResult$SI: LoadedStringListResult$SI,
+ LoadedStringListMapResult: LoadedStringListMapResult,
+ LoadedStringListMapResult$SI: LoadedStringListMapResult$SI,
+ LoadedNumberListResult: LoadedNumberListResult,
+ LoadedNumberListResult$SI: LoadedNumberListResult$SI,
+ CompressionReport: CompressionReport,
+ CompressionReport$: CompressionReport$
+ },
+ "src/query.jsx": {
+ Query: Query,
+ Query$: Query$
+ },
+ "src/query-string-parser.jsx": {
+ QueryStringParser: QueryStringParser,
+ QueryStringParser$: QueryStringParser$
+ },
+ "src/search-result.jsx": {
+ Proposal: Proposal,
+ Proposal$II: Proposal$II,
+ Position: Position,
+ Position$SIB: Position$SIB,
+ SearchUnit: SearchUnit,
+ SearchUnit$I: SearchUnit$I,
+ SingleResult: SingleResult,
+ SingleResult$: SingleResult$,
+ SingleResult$SBB: SingleResult$SBB,
+ SearchSummary: SearchSummary,
+ SearchSummary$: SearchSummary$,
+ SearchSummary$LOktavia$: SearchSummary$LOktavia$
+ },
+ "src/style.jsx": {
+ Style: Style,
+ Style$S: Style$S,
+ _HTMLHandler: _HTMLHandler,
+ _HTMLHandler$HASB: _HTMLHandler$HASB
+ },
+ "src/stemmer/stemmer.jsx": {
+ Stemmer: Stemmer,
+ Stemmer$: Stemmer$
+ },
+ "src/stemmer/base-stemmer.jsx": {
+ BaseStemmer: BaseStemmer,
+ BaseStemmer$: BaseStemmer$
+ },
+ "src/stemmer/finnish-stemmer.jsx": {
+ FinnishStemmer: FinnishStemmer,
+ FinnishStemmer$: FinnishStemmer$
+ },
+ "src/stemmer/among.jsx": {
+ Among: Among,
+ Among$SII: Among$SII,
+ Among$SIIF$LBaseStemmer$B$LBaseStemmer$: Among$SIIF$LBaseStemmer$B$LBaseStemmer$
+ },
+ "src/metadata.jsx": {
+ Metadata: Metadata,
+ Metadata$LOktavia$: Metadata$LOktavia$,
+ Section: Section,
+ Section$LOktavia$: Section$LOktavia$,
+ Splitter: Splitter,
+ Splitter$LOktavia$: Splitter$LOktavia$,
+ Splitter$LOktavia$S: Splitter$LOktavia$S,
+ Table: Table,
+ Table$LOktavia$AS: Table$LOktavia$AS,
+ Block: Block,
+ Block$LOktavia$: Block$LOktavia$
+ },
+ "src/fm-index.jsx": {
+ FMIndex: FMIndex,
+ FMIndex$: FMIndex$
+ },
+ "src/sax.jsx": {
+ Tag: Tag,
+ Tag$S: Tag$S,
+ _Common: _Common,
+ _Common$: _Common$,
+ _State: _State,
+ _State$: _State$,
+ SAXHandler: SAXHandler,
+ SAXHandler$: SAXHandler$,
+ SAXParser: SAXParser,
+ SAXParser$LSAXHandler$: SAXParser$LSAXHandler$,
+ SAXParser$LSAXHandler$B: SAXParser$LSAXHandler$B,
+ Char: Char,
+ Char$: Char$,
+ _Entities: _Entities,
+ _Entities$: _Entities$
+ },
+ "src/bit-vector.jsx": {
+ BitVector: BitVector,
+ BitVector$: BitVector$
+ },
+ "src/wavelet-matrix.jsx": {
+ WaveletMatrix: WaveletMatrix,
+ WaveletMatrix$: WaveletMatrix$
+ },
+ "src/burrows-wheeler-transform.jsx": {
+ BurrowsWheelerTransform: BurrowsWheelerTransform,
+ BurrowsWheelerTransform$: BurrowsWheelerTransform$
+ },
+ "src/sais.jsx": {
+ OArray: OArray,
+ OArray$AI: OArray$AI,
+ OArray$AII: OArray$AII,
+ SAIS: SAIS,
+ SAIS$: SAIS$
+ }
+};
+
+
+/**
+ * launches _Main.main(:string[]):void invoked by jsx --run|--executable
+ */
+JSX.runMain = function (sourceFile, args) {
+ var module = JSX.require(sourceFile);
+ if (! module) {
+ throw new ReferenceError("entry point module not found in " + sourceFile);
+ }
+ if (! module._Main) {
+ throw new ReferenceError("entry point _Main not found in " + sourceFile);
+ }
+ if (! module._Main.main$AS) {
+ throw new ReferenceError("entry point _Main.main(:string[]):void not found in " + sourceFile);
+ }
+ module._Main.main$AS(args);
+};
+
+/**
+ * launches _Test#test*():void invoked by jsx --test
+ */
+JSX.runTests = function (sourceFile, tests) {
+ var module = JSX.require(sourceFile);
+ var testClass = module._Test$;
+
+ if (!testClass) return; // skip if there's no test class
+
+ if(tests.length === 0) {
+ var p = testClass.prototype;
+ for (var m in p) {
+ if (p[m] instanceof Function
+ && /^test.*[$]$/.test(m)) {
+ tests.push(m);
+ }
+ }
+ }
+ else { // set as process arguments
+ tests = tests.map(function (name) {
+ return name + "$"; // mangle for function test*():void
+ });
+ }
+
+ var testCase = new testClass();
+
+ if (testCase.beforeClass$AS != null)
+ testCase.beforeClass$AS(tests);
+
+ for (var i = 0; i < tests.length; ++i) {
+ (function (method) {
+ if (method in testCase) {
+ testCase.run$SF$V$(method, function() { testCase[method](); });
+ }
+ else {
+ throw new ReferenceError("No such test method: " + method);
+ }
+ }(tests[i]));
+ }
+
+ if (testCase.afterClass$ != null)
+ testCase.afterClass$();
+};
+/**
+ * call a function on load/DOMContentLoaded
+ */
+function $__jsx_onload (event) {
+ window.removeEventListener("load", $__jsx_onload);
+ document.removeEventListener("DOMContentLoaded", $__jsx_onload);
+ JSX.runMain("tool/web/oktavia-finnish-search.jsx", [])
+}
+
+window.addEventListener("load", $__jsx_onload);
+document.addEventListener("DOMContentLoaded", $__jsx_onload);
+
+})(JSX);
diff --git a/web/server/h2o/libh2o/misc/oktavia/lib/oktavia-french-search.js b/web/server/h2o/libh2o/misc/oktavia/lib/oktavia-french-search.js
new file mode 100644
index 00000000..4668c843
--- /dev/null
+++ b/web/server/h2o/libh2o/misc/oktavia/lib/oktavia-french-search.js
@@ -0,0 +1,9061 @@
+// generatedy by JSX compiler 0.9.24 (2013-04-05 13:45:00 +0900; 1b229cc6a411f674f0f7cf7a79b7a8b3f8eb7414)
+var JSX = {};
+(function (JSX) {
+/**
+ * copies the implementations from source interface to target
+ */
+function $__jsx_merge_interface(target, source) {
+ for (var k in source.prototype)
+ if (source.prototype.hasOwnProperty(k))
+ target.prototype[k] = source.prototype[k];
+}
+
+/**
+ * defers the initialization of the property
+ */
+function $__jsx_lazy_init(obj, prop, func) {
+ function reset(obj, prop, value) {
+ delete obj[prop];
+ obj[prop] = value;
+ return value;
+ }
+
+ Object.defineProperty(obj, prop, {
+ get: function () {
+ return reset(obj, prop, func());
+ },
+ set: function (v) {
+ reset(obj, prop, v);
+ },
+ enumerable: true,
+ configurable: true
+ });
+}
+
+/**
+ * sideeffect().a /= b
+ */
+function $__jsx_div_assign(obj, prop, divisor) {
+ return obj[prop] = (obj[prop] / divisor) | 0;
+}
+
+/*
+ * global functions, renamed to avoid conflict with local variable names
+ */
+var $__jsx_parseInt = parseInt;
+var $__jsx_parseFloat = parseFloat;
+var $__jsx_isNaN = isNaN;
+var $__jsx_isFinite = isFinite;
+
+var $__jsx_encodeURIComponent = encodeURIComponent;
+var $__jsx_decodeURIComponent = decodeURIComponent;
+var $__jsx_encodeURI = encodeURI;
+var $__jsx_decodeURI = decodeURI;
+
+var $__jsx_ObjectToString = Object.prototype.toString;
+var $__jsx_ObjectHasOwnProperty = Object.prototype.hasOwnProperty;
+
+/*
+ * profiler object, initialized afterwards
+ */
+function $__jsx_profiler() {
+}
+
+/*
+ * public interface to JSX code
+ */
+JSX.require = function (path) {
+ var m = $__jsx_classMap[path];
+ return m !== undefined ? m : null;
+};
+
+JSX.profilerIsRunning = function () {
+ return $__jsx_profiler.getResults != null;
+};
+
+JSX.getProfileResults = function () {
+ return ($__jsx_profiler.getResults || function () { return {}; })();
+};
+
+JSX.postProfileResults = function (url, cb) {
+ if ($__jsx_profiler.postResults == null)
+ throw new Error("profiler has not been turned on");
+ return $__jsx_profiler.postResults(url, cb);
+};
+
+JSX.resetProfileResults = function () {
+ if ($__jsx_profiler.resetResults == null)
+ throw new Error("profiler has not been turned on");
+ return $__jsx_profiler.resetResults();
+};
+JSX.DEBUG = false;
+/**
+ * class _Main extends Object
+ * @constructor
+ */
+function _Main() {
+}
+
+/**
+ * @constructor
+ */
+function _Main$() {
+};
+
+_Main$.prototype = new _Main;
+
+/**
+ * @param {Array.<undefined|!string>} args
+ */
+_Main.main$AS = function (args) {
+ OktaviaSearch$setStemmer$LStemmer$(new FrenchStemmer$());
+};
+
+var _Main$main$AS = _Main.main$AS;
+
+/**
+ * class _Result extends Object
+ * @constructor
+ */
+function _Result() {
+}
+
+/**
+ * @constructor
+ * @param {!string} title
+ * @param {!string} url
+ * @param {!string} content
+ * @param {!number} score
+ */
+function _Result$SSSI(title, url, content, score) {
+ this.title = title;
+ this.url = url;
+ this.content = content;
+ this.score = score;
+};
+
+_Result$SSSI.prototype = new _Result;
+
+/**
+ * class _Proposal extends Object
+ * @constructor
+ */
+function _Proposal() {
+}
+
+/**
+ * @constructor
+ * @param {!string} options
+ * @param {!string} label
+ * @param {!number} count
+ */
+function _Proposal$SSI(options, label, count) {
+ this.options = options;
+ this.label = label;
+ this.count = count;
+};
+
+_Proposal$SSI.prototype = new _Proposal;
+
+/**
+ * class OktaviaSearch extends Object
+ * @constructor
+ */
+function OktaviaSearch() {
+}
+
+/**
+ * @constructor
+ * @param {!number} entriesPerPage
+ */
+function OktaviaSearch$I(entriesPerPage) {
+ this._queries = null;
+ this._highlight = "";
+ this._result = null;
+ this._proposals = null;
+ this._currentFolderDepth = 0;
+ this._oktavia = new Oktavia$();
+ this._entriesPerPage = entriesPerPage;
+ this._currentPage = 1;
+ this._queryString = null;
+ this._callback = null;
+ OktaviaSearch._instance = this;
+};
+
+OktaviaSearch$I.prototype = new OktaviaSearch;
+
+/**
+ * @param {Stemmer} stemmer
+ */
+OktaviaSearch.setStemmer$LStemmer$ = function (stemmer) {
+ /** @type {Oktavia} */
+ var this$0;
+ if (OktaviaSearch._instance) {
+ this$0 = OktaviaSearch._instance._oktavia;
+ this$0._stemmer = stemmer;
+ } else {
+ OktaviaSearch._stemmer = stemmer;
+ }
+};
+
+var OktaviaSearch$setStemmer$LStemmer$ = OktaviaSearch.setStemmer$LStemmer$;
+
+/**
+ * @param {!string} index
+ */
+OktaviaSearch.prototype.loadIndex$S = function (index) {
+ /** @type {Oktavia} */
+ var this$0;
+ /** @type {Stemmer} */
+ var stemmer$0;
+ if (OktaviaSearch._stemmer) {
+ this$0 = this._oktavia;
+ stemmer$0 = OktaviaSearch._stemmer;
+ this$0._stemmer = stemmer$0;
+ }
+ this._oktavia.load$S(Binary$base64decode$S(index));
+ if (this._queryString) {
+ this.search$SF$IIV$(this._queryString, this._callback);
+ this._queryString = null;
+ this._callback = null;
+ }
+};
+
+/**
+ * @param {!string} queryString
+ * @param {*} callback
+ */
+OktaviaSearch.prototype.search$SF$IIV$ = function (queryString, callback) {
+ /** @type {QueryStringParser} */
+ var queryParser;
+ /** @type {SearchSummary} */
+ var summary;
+ /** @type {Array.<undefined|SearchUnit>} */
+ var _result$0;
+ if (this._oktavia) {
+ queryParser = ({queries: [ ]});
+ this._queries = QueryStringParser$parse$LQueryStringParser$S(queryParser, queryString);
+ this._highlight = QueryStringParser$highlight$LQueryStringParser$(queryParser);
+ summary = this._oktavia.search$ALQuery$(this._queries);
+ if (SearchSummary$size$LSearchSummary$(summary) > 0) {
+ this._result = this._sortResult$LSearchSummary$(summary);
+ this._proposals = [ ];
+ this._currentPage = 1;
+ } else {
+ this._result = [ ];
+ if (this._queries.length > 1) {
+ this._proposals = SearchSummary$getProposal$LSearchSummary$(summary);
+ } else {
+ this._proposals = [ ];
+ }
+ this._currentPage = 1;
+ }
+ callback((_result$0 = this._result).length, Math.ceil(_result$0.length / this._entriesPerPage));
+ } else {
+ this._queryString = queryString;
+ this._callback = callback;
+ }
+};
+
+/**
+ * @return {!number}
+ */
+OktaviaSearch.prototype.resultSize$ = function () {
+ return (this._result.length | 0);
+};
+
+/**
+ * @return {!number}
+ */
+OktaviaSearch.prototype.totalPages$ = function () {
+ return (Math.ceil(this._result.length / this._entriesPerPage) | 0);
+};
+
+/**
+ * @return {!number}
+ */
+OktaviaSearch.prototype.currentPage$ = function () {
+ return this._currentPage;
+};
+
+/**
+ * @param {!number} page
+ */
+OktaviaSearch.prototype.setCurrentPage$I = function (page) {
+ this._currentPage = page;
+};
+
+/**
+ * @return {!boolean}
+ */
+OktaviaSearch.prototype.hasPrevPage$ = function () {
+ return this._currentPage !== 1;
+};
+
+/**
+ * @return {!boolean}
+ */
+OktaviaSearch.prototype.hasNextPage$ = function () {
+ return this._currentPage !== Math.ceil(this._result.length / this._entriesPerPage);
+};
+
+/**
+ * @return {Array.<undefined|!string>}
+ */
+OktaviaSearch.prototype.pageIndexes$ = function () {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var total;
+ /** @type {!number} */
+ var i;
+ result = [ ];
+ total = Math.ceil(this._result.length / this._entriesPerPage);
+ if (total < 10) {
+ for (i = 1; i <= total; i++) {
+ result.push(i + "");
+ }
+ } else {
+ if (this._currentPage <= 5) {
+ for (i = 1; i <= 7; i++) {
+ result.push(i + "");
+ }
+ result.push('...', total + "");
+ } else {
+ if (total - 5 <= this._currentPage) {
+ result.push('1', '...');
+ for (i = total - 8; i <= total; i++) {
+ result.push(i + "");
+ }
+ } else {
+ result.push('1', '...');
+ for (i = this._currentPage - 3; i <= this._currentPage + 3; i++) {
+ result.push(i + "");
+ }
+ result.push('...', total + "");
+ }
+ }
+ }
+ return result;
+};
+
+/**
+ * @return {Array.<undefined|_Result>}
+ */
+OktaviaSearch.prototype.getResult$ = function () {
+ /** @type {Style} */
+ var style;
+ /** @type {!number} */
+ var start;
+ /** @type {!number} */
+ var last;
+ /** @type {Metadata} */
+ var metadata;
+ /** @type {!number} */
+ var num;
+ /** @type {Array.<undefined|_Result>} */
+ var results;
+ /** @type {!number} */
+ var i;
+ /** @type {SearchUnit} */
+ var unit;
+ /** @type {Array.<undefined|!string>} */
+ var info;
+ /** @type {!string} */
+ var content;
+ /** @type {Array.<undefined|Position>} */
+ var positions;
+ /** @type {!number} */
+ var end;
+ /** @type {!boolean} */
+ var split;
+ /** @type {!number} */
+ var j;
+ /** @type {Position} */
+ var pos;
+ /** @type {!string} */
+ var text;
+ /** @type {Oktavia} */
+ var this$0;
+ /** @type {!number} */
+ var position$0;
+ /** @type {!number} */
+ var _currentPage$0;
+ /** @type {!number} */
+ var _entriesPerPage$0;
+ style = new Style$S('html');
+ start = ((_currentPage$0 = this._currentPage) - 1) * (_entriesPerPage$0 = this._entriesPerPage);
+ last = Math.min(_currentPage$0 * _entriesPerPage$0, this._result.length);
+ this$0 = this._oktavia;
+ metadata = this$0._metadatas[this$0._metadataLabels[0]];
+ num = 250;
+ results = [ ];
+ for (i = start; i < last; i++) {
+ unit = this._result[i];
+ info = metadata.getInformation$I(unit.id).split(Oktavia.eob);
+ content = metadata.getContent$I(unit.id);
+ start = 0;
+ positions = SearchUnit$getPositions$LSearchUnit$(unit);
+ if (content.indexOf(info[0]) === 1) {
+ content = content.slice(info[0].length + 2, content.length);
+ start += info[0].length + 2;
+ }
+ end = start + num;
+ split = false;
+ if (positions[0].position > end - positions[0].word.length) {
+ end = positions[0].position + Math.floor(num / 2);
+ split = true;
+ }
+ for (j = positions.length - 1; j > -1; j--) {
+ pos = positions[j];
+ if (pos.position + pos.word.length < end) {
+ content = [ content.slice(0, pos.position - start), style.convert$S('<hit>*</hit>').replace('*', content.slice((position$0 = pos.position) - start, position$0 + pos.word.length - start)), content.slice(pos.position + pos.word.length - start, content.length) ].join('');
+ }
+ }
+ if (split) {
+ text = [ content.slice(0, Math.floor(num / 2)) + ' ...', content.slice(- Math.floor(num / 2), end - start) ].join('<br/>');
+ } else {
+ text = content.slice(0, end - start) + ' ...<br/>';
+ }
+ text = text.replace(Oktavia.eob, ' ').replace(/(<br\/>)(<br\/>)+/, '<br/><br/>');
+ results.push(({title: info[0], url: info[1], content: text, score: unit.score}));
+ }
+ return results;
+};
+
+/**
+ * @return {!string}
+ */
+OktaviaSearch.prototype.getHighlight$ = function () {
+ return this._highlight;
+};
+
+/**
+ * @return {Array.<undefined|_Proposal>}
+ */
+OktaviaSearch.prototype.getProposals$ = function () {
+ /** @type {Style} */
+ var style;
+ /** @type {Array.<undefined|_Proposal>} */
+ var results;
+ /** @type {!number} */
+ var i;
+ /** @type {Proposal} */
+ var proposal;
+ /** @type {Array.<undefined|!string>} */
+ var label;
+ /** @type {Array.<undefined|!string>} */
+ var option;
+ /** @type {!number} */
+ var j;
+ style = new Style$S('html');
+ results = [ ];
+ if (this._queries.length > 1) {
+ for (i = 0; i < this._proposals.length; i++) {
+ proposal = this._proposals[i];
+ if (proposal.expect > 0) {
+ label = [ ];
+ option = [ ];
+ for (j = 0; j < this._queries.length; j++) {
+ if (j !== proposal.omit) {
+ label.push(style.convert$S('<hit>' + this._queries[j].toString() + '</hit>'));
+ option.push(this._queries[j].toString());
+ } else {
+ label.push(style.convert$S('<del>' + this._queries[j].toString() + '</del>'));
+ }
+ }
+ results.push(({options: option.join(' '), label: label.join('&nbsp;'), count: proposal.expect}));
+ }
+ }
+ }
+ return results;
+};
+
+/**
+ * @param {SearchSummary} summary
+ * @return {Array.<undefined|SearchUnit>}
+ */
+OktaviaSearch.prototype._sortResult$LSearchSummary$ = function (summary) {
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var score;
+ /** @type {SearchUnit} */
+ var unit;
+ /** @type {!string} */
+ var pos;
+ /** @type {Position} */
+ var position;
+ for (i = 0; i < summary.result.units.length; i++) {
+ score = 0;
+ unit = summary.result.units[i];
+ for (pos in unit.positions) {
+ position = unit.positions[pos];
+ if (this._oktavia.wordPositionType$I(position.position)) {
+ score += 10;
+ } else {
+ score += 1;
+ }
+ if (! position.stemmed) {
+ score += 2;
+ }
+ }
+ unit.score = (score | 0);
+ }
+ return SearchSummary$getSortedResult$LSearchSummary$(summary);
+};
+
+/**
+ * class _Main$0 extends Object
+ * @constructor
+ */
+function _Main$0() {
+}
+
+/**
+ * @constructor
+ */
+function _Main$0$() {
+};
+
+_Main$0$.prototype = new _Main$0;
+
+/**
+ * @param {Array.<undefined|!string>} args
+ */
+_Main$0.main$AS = function (args) {
+};
+
+var _Main$0$main$AS = _Main$0.main$AS;
+
+/**
+ * class Oktavia extends Object
+ * @constructor
+ */
+function Oktavia() {
+}
+
+/**
+ * @constructor
+ */
+function Oktavia$() {
+ /** @type {Array.<undefined|!string>} */
+ var _utf162compressCode$0;
+ this._compressCode2utf16 = null;
+ this._fmindex = new FMIndex$();
+ this._metadatas = ({ });
+ this._metadataLabels = [ ];
+ this._stemmer = null;
+ this._stemmingResult = ({ });
+ _utf162compressCode$0 = this._utf162compressCode = [ Oktavia.eof, Oktavia.eob, Oktavia.unknown ];
+ _utf162compressCode$0.length = 65536;
+ this._compressCode2utf16 = [ Oktavia.eof, Oktavia.eob, Oktavia.unknown ];
+};
+
+Oktavia$.prototype = new Oktavia;
+
+/**
+ * @param {Stemmer} stemmer
+ */
+Oktavia.prototype.setStemmer$LStemmer$ = function (stemmer) {
+ this._stemmer = stemmer;
+};
+
+/**
+ * @return {Metadata}
+ */
+Oktavia.prototype.getPrimaryMetadata$ = function () {
+ return this._metadatas[this._metadataLabels[0]];
+};
+
+/**
+ * @param {!string} key
+ * @return {Section}
+ */
+Oktavia.prototype.addSection$S = function (key) {
+ /** @type {Section} */
+ var section;
+ if (this._metadataLabels.indexOf(key) !== -1) {
+ throw new Error('Metadata name ' + key + ' is already exists');
+ }
+ this._metadataLabels.push(key);
+ section = new Section$LOktavia$(this);
+ this._metadatas[key] = section;
+ return section;
+};
+
+/**
+ * @param {!string} key
+ * @return {Section}
+ */
+Oktavia.prototype.getSection$S = function (key) {
+ if (this._metadataLabels.indexOf(key) === -1) {
+ throw new Error('Metadata name ' + key + " does't exists");
+ }
+ return this._metadatas[key];
+};
+
+/**
+ * @param {!string} key
+ * @return {Splitter}
+ */
+Oktavia.prototype.addSplitter$S = function (key) {
+ /** @type {Splitter} */
+ var splitter;
+ if (this._metadataLabels.indexOf(key) !== -1) {
+ throw new Error('Metadata name ' + key + ' is already exists');
+ }
+ this._metadataLabels.push(key);
+ splitter = new Splitter$LOktavia$(this);
+ this._metadatas[key] = splitter;
+ return splitter;
+};
+
+/**
+ * @param {!string} key
+ * @return {Splitter}
+ */
+Oktavia.prototype.getSplitter$S = function (key) {
+ if (this._metadataLabels.indexOf(key) === -1) {
+ throw new Error('Metadata name ' + key + " does't exists");
+ }
+ return this._metadatas[key];
+};
+
+/**
+ * @param {!string} key
+ * @param {Array.<undefined|!string>} headers
+ * @return {Table}
+ */
+Oktavia.prototype.addTable$SAS = function (key, headers) {
+ /** @type {Table} */
+ var table;
+ if (this._metadataLabels.indexOf(key) !== -1) {
+ throw new Error('Metadata name ' + key + ' is already exists');
+ }
+ this._metadataLabels.push(key);
+ table = new Table$LOktavia$AS(this, headers);
+ this._metadatas[key] = table;
+ return table;
+};
+
+/**
+ * @param {!string} key
+ * @return {Table}
+ */
+Oktavia.prototype.getTable$S = function (key) {
+ if (this._metadataLabels.indexOf(key) === -1) {
+ throw new Error('Metadata name ' + key + " does't exists");
+ }
+ return this._metadatas[key];
+};
+
+/**
+ * @param {!string} key
+ * @return {Block}
+ */
+Oktavia.prototype.addBlock$S = function (key) {
+ /** @type {Block} */
+ var block;
+ if (this._metadataLabels.indexOf(key) !== -1) {
+ throw new Error('Metadata name ' + key + ' is already exists');
+ }
+ this._metadataLabels.push(key);
+ block = new Block$LOktavia$(this);
+ this._metadatas[key] = block;
+ return block;
+};
+
+/**
+ * @param {!string} key
+ * @return {Block}
+ */
+Oktavia.prototype.getBlock$S = function (key) {
+ if (this._metadataLabels.indexOf(key) === -1) {
+ throw new Error('Metadata name ' + key + " does't exists");
+ }
+ return this._metadatas[key];
+};
+
+/**
+ */
+Oktavia.prototype.addEndOfBlock$ = function () {
+ this._fmindex.push$S(Oktavia.eob);
+};
+
+/**
+ * @param {!string} words
+ */
+Oktavia.prototype.addWord$S = function (words) {
+ /** @type {Array.<undefined|!string>} */
+ var str;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var charCode;
+ /** @type {undefined|!string} */
+ var newCharCode;
+ str = [ ];
+ str.length = words.length;
+ for (i = 0; i < words.length; i++) {
+ charCode = words.charCodeAt(i);
+ newCharCode = this._utf162compressCode[charCode];
+ if (newCharCode == null) {
+ newCharCode = String.fromCharCode(this._compressCode2utf16.length);
+ this._utf162compressCode[charCode] = newCharCode;
+ this._compressCode2utf16.push(String.fromCharCode(charCode));
+ }
+ str.push(newCharCode);
+ }
+ this._fmindex.push$S(str.join(''));
+};
+
+/**
+ * @param {!string} words
+ * @param {!boolean} stemming
+ */
+Oktavia.prototype.addWord$SB = function (words, stemming) {
+ /** @type {Array.<undefined|!string>} */
+ var wordList;
+ /** @type {!number} */
+ var i;
+ /** @type {undefined|!string} */
+ var originalWord;
+ /** @type {!string} */
+ var smallWord;
+ /** @type {undefined|!string} */
+ var registerWord;
+ /** @type {!string} */
+ var baseWord;
+ /** @type {!string} */
+ var compressedCodeWord;
+ /** @type {Array.<undefined|!string>} */
+ var stemmedList;
+ this.addWord$S(words);
+ wordList = words.split(/\s+/);
+ for (i = 0; i < wordList.length; i++) {
+ originalWord = wordList[i];
+ smallWord = originalWord.slice(0, 1).toLowerCase() + originalWord.slice(1);
+ registerWord = null;
+ if (stemming && this._stemmer) {
+ baseWord = this._stemmer.stemWord$S(originalWord.toLowerCase());
+ if (originalWord.indexOf(baseWord) === -1) {
+ registerWord = baseWord;
+ }
+ } else {
+ if (originalWord != smallWord) {
+ registerWord = smallWord;
+ }
+ }
+ if (registerWord) {
+ compressedCodeWord = this._convertToCompressionCode$S(originalWord);
+ stemmedList = this._stemmingResult[registerWord];
+ if (! stemmedList) {
+ stemmedList = [ compressedCodeWord ];
+ this._stemmingResult[registerWord] = stemmedList;
+ } else {
+ if (stemmedList.indexOf(compressedCodeWord) === -1) {
+ stemmedList.push(compressedCodeWord);
+ }
+ }
+ }
+ }
+};
+
+/**
+ * @param {!string} keyword
+ * @return {!string}
+ */
+Oktavia.prototype._convertToCompressionCode$S = function (keyword) {
+ /** @type {Array.<undefined|!string>} */
+ var resultChars;
+ /** @type {!number} */
+ var i;
+ /** @type {undefined|!string} */
+ var chr;
+ resultChars = [ ];
+ for (i = 0; i < keyword.length; i++) {
+ chr = this._utf162compressCode[keyword.charCodeAt(i)];
+ if (chr == null) {
+ resultChars.push(Oktavia.unknown);
+ } else {
+ resultChars.push(chr);
+ }
+ }
+ return resultChars.join('');
+};
+
+/**
+ * @param {!string} keyword
+ * @param {!boolean} stemming
+ * @return {Array.<undefined|!number>}
+ */
+Oktavia.prototype.rawSearch$SB = function (keyword, stemming) {
+ /** @type {Array.<undefined|!number>} */
+ var result;
+ /** @type {!string} */
+ var baseWord;
+ /** @type {Array.<undefined|!string>} */
+ var stemmedList;
+ /** @type {!number} */
+ var i;
+ /** @type {undefined|!string} */
+ var word;
+ if (stemming) {
+ result = [ ];
+ if (this._stemmer) {
+ baseWord = this._stemmer.stemWord$S(keyword.toLowerCase());
+ stemmedList = this._stemmingResult[baseWord];
+ if (stemmedList) {
+ for (i = 0; i < stemmedList.length; i++) {
+ word = stemmedList[i];
+ result = result.concat(this._fmindex.search$S(word));
+ }
+ }
+ }
+ } else {
+ result = this._fmindex.search$S(this._convertToCompressionCode$S(keyword));
+ }
+ return result;
+};
+
+/**
+ * @param {Array.<undefined|Query>} queries
+ * @return {SearchSummary}
+ */
+Oktavia.prototype.search$ALQuery$ = function (queries) {
+ /** @type {SearchSummary} */
+ var summary;
+ /** @type {!number} */
+ var i;
+ /** @type {SingleResult} */
+ var result$0;
+ summary = ({sourceResults: [ ], result: null, oktavia: this});
+ for (i = 0; i < queries.length; i++) {
+ result$0 = this._searchQuery$LQuery$(queries[i]);
+ summary.sourceResults.push(result$0);
+ }
+ summary.result = SearchSummary$mergeResult$LSearchSummary$ALSingleResult$(summary, summary.sourceResults);
+ return summary;
+};
+
+/**
+ * @param {Query} query
+ * @return {SingleResult}
+ */
+Oktavia.prototype._searchQuery$LQuery$ = function (query) {
+ /** @type {SingleResult} */
+ var result;
+ /** @type {Array.<undefined|!number>} */
+ var positions;
+ result = new SingleResult$SBB(query.word, query.or, query.not);
+ if (query.raw) {
+ positions = this.rawSearch$SB(query.word, false);
+ } else {
+ positions = this.rawSearch$SB(query.word, false).concat(this.rawSearch$SB(query.word, true));
+ }
+ this._metadatas[this._metadataLabels[0]].grouping$LSingleResult$AISB(result, positions, query.word, ! query.raw);
+ return result;
+};
+
+/**
+ */
+Oktavia.prototype.build$ = function () {
+ this.build$IB(5, false);
+};
+
+/**
+ * @param {!number} cacheDensity
+ * @param {!boolean} verbose
+ */
+Oktavia.prototype.build$IB = function (cacheDensity, verbose) {
+ /** @type {!string} */
+ var key;
+ /** @type {!number} */
+ var cacheRange;
+ /** @type {!number} */
+ var maxChar;
+ for (key in this._metadatas) {
+ this._metadatas[key]._build$();
+ }
+ cacheRange = Math.round(Math.max(1, 100 / Math.min(100, Math.max(0.01, cacheDensity))));
+ maxChar = this._compressCode2utf16.length;
+ this._fmindex.build$SIIB(Oktavia.eof, maxChar, cacheRange, verbose);
+};
+
+/**
+ * @return {!string}
+ */
+Oktavia.prototype.dump$ = function () {
+ return this.dump$B(false);
+};
+
+/**
+ * @param {!boolean} verbose
+ * @return {!string}
+ */
+Oktavia.prototype.dump$B = function (verbose) {
+ /** @type {!string} */
+ var header;
+ /** @type {!string} */
+ var fmdata;
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var i;
+ /** @type {CompressionReport} */
+ var report;
+ /** @type {undefined|!string} */
+ var name;
+ /** @type {!string} */
+ var data;
+ header = Binary$dumpString$SLCompressionReport$("oktavia-01", null).slice(1);
+ if (verbose) {
+ console.log("Source text size: " + (this._fmindex.size$() * 2 + "") + ' bytes');
+ }
+ fmdata = this._fmindex.dump$B(verbose);
+ result = [ header, fmdata ];
+ result.push(Binary$dump16bitNumber$I(this._compressCode2utf16.length));
+ for (i = 3; i < this._compressCode2utf16.length; i++) {
+ result.push(this._compressCode2utf16[i]);
+ }
+ if (verbose) {
+ console.log('Char Code Map: ' + (this._compressCode2utf16.length * 2 - 2 + "") + ' bytes');
+ }
+ report = ({source: 0, result: 0});
+ result.push(Binary$dumpStringListMap$HASLCompressionReport$(this._stemmingResult, report));
+ if (verbose) {
+ console.log('Stemmed Word Table: ' + (result[result.length - 1].length + "") + ' bytes (' + (Math.round(report.result * 100.0 / report.source) + "") + '%)');
+ }
+ result.push(Binary$dump16bitNumber$I(this._metadataLabels.length));
+ for (i = 0; i < this._metadataLabels.length; i++) {
+ report = ({source: 0, result: 0});
+ name = this._metadataLabels[i];
+ data = this._metadatas[name]._dump$LCompressionReport$(report);
+ result.push(Binary$dumpString$SLCompressionReport$(name, report), data);
+ if (verbose) {
+ console.log('Meta Data ' + name + ': ' + (data.length * 2 + "") + ' bytes (' + (Math.round(report.result * 100.0 / report.source) + "") + '%)');
+ }
+ }
+ return result.join('');
+};
+
+/**
+ * @param {!string} data
+ */
+Oktavia.prototype.load$S = function (data) {
+ /** @type {!string} */
+ var header;
+ /** @type {!number} */
+ var offset;
+ /** @type {!number} */
+ var charCodeCount;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var charCode;
+ /** @type {LoadedStringListMapResult} */
+ var stemmedWords;
+ /** @type {!number} */
+ var metadataCount;
+ /** @type {LoadedStringResult} */
+ var nameResult;
+ /** @type {!string} */
+ var name;
+ /** @type {!number} */
+ var type;
+ header = Binary$dumpString$SLCompressionReport$("oktavia-01", null).slice(1);
+ if (data.slice(0, 5) !== header) {
+ throw new Error('Invalid data file');
+ }
+ this._metadatas = ({ });
+ this._metadataLabels = [ ];
+ offset = 5;
+ offset = this._fmindex.load$SI(data, offset);
+ charCodeCount = Binary$load16bitNumber$SI(data, offset++);
+ this._compressCode2utf16 = [ Oktavia.eof, Oktavia.eob, Oktavia.unknown ];
+ this._utf162compressCode = [ Oktavia.eof, Oktavia.eob, Oktavia.unknown ];
+ for (i = 3; i < charCodeCount; i++) {
+ charCode = Binary$load16bitNumber$SI(data, offset++);
+ this._compressCode2utf16.push(String.fromCharCode(charCode));
+ this._utf162compressCode[charCode] = String.fromCharCode(i);
+ }
+ stemmedWords = Binary$loadStringListMap$SI(data, offset);
+ this._stemmingResult = stemmedWords.result;
+ offset = stemmedWords.offset;
+ metadataCount = Binary$load16bitNumber$SI(data, offset++);
+ for (i = 0; i < metadataCount; i++) {
+ nameResult = Binary$loadString$SI(data, offset);
+ name = nameResult.result;
+ offset = nameResult.offset;
+ type = Binary$load16bitNumber$SI(data, offset++);
+ switch (type) {
+ case 0:
+ offset = Section$_load$LOktavia$SSI(this, name, data, offset);
+ break;
+ case 1:
+ offset = Splitter$_load$LOktavia$SSI(this, name, data, offset);
+ break;
+ case 2:
+ offset = Table$_load$LOktavia$SSI(this, name, data, offset);
+ break;
+ case 3:
+ offset = Block$_load$LOktavia$SSI(this, name, data, offset);
+ break;
+ }
+ }
+};
+
+/**
+ * @return {!number}
+ */
+Oktavia.prototype.contentSize$ = function () {
+ /** @type {FMIndex} */
+ var this$0;
+ this$0 = this._fmindex;
+ return this$0._substr.length;
+};
+
+/**
+ * @param {!number} position
+ * @return {!number}
+ */
+Oktavia.prototype.wordPositionType$I = function (position) {
+ /** @type {!number} */
+ var result;
+ /** @type {!string} */
+ var ahead;
+ result = 0;
+ if (position === 0) {
+ result = 4;
+ } else {
+ ahead = this._fmindex.getSubstring$II(position - 1, 1);
+ if (/\s/.test(ahead)) {
+ result = 2;
+ } else {
+ if (/\W/.test(ahead)) {
+ result = 1;
+ } else {
+ if (Oktavia.eob === ahead) {
+ result = 3;
+ }
+ }
+ }
+ }
+ return (result | 0);
+};
+
+/**
+ * @param {!number} position
+ * @param {!number} length
+ * @return {!string}
+ */
+Oktavia.prototype._getSubstring$II = function (position, length) {
+ /** @type {!string} */
+ var result;
+ /** @type {Array.<undefined|!string>} */
+ var str;
+ /** @type {!number} */
+ var i;
+ result = this._fmindex.getSubstring$II(position, length);
+ str = [ ];
+ for (i = 0; i < result.length; i++) {
+ str.push(this._compressCode2utf16[result.charCodeAt(i)]);
+ }
+ return str.join('');
+};
+
+/**
+ * class Binary extends Object
+ * @constructor
+ */
+function Binary() {
+}
+
+/**
+ * @constructor
+ */
+function Binary$() {
+};
+
+Binary$.prototype = new Binary;
+
+/**
+ * @param {!number} num
+ * @return {!string}
+ */
+Binary.dump32bitNumber$N = function (num) {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ result = [ String.fromCharCode(Math.floor(num / 65536)) ];
+ result.push(String.fromCharCode(num % 65536));
+ return result.join("");
+};
+
+var Binary$dump32bitNumber$N = Binary.dump32bitNumber$N;
+
+/**
+ * @param {!string} buffer
+ * @param {!number} offset
+ * @return {!number}
+ */
+Binary.load32bitNumber$SI = function (buffer, offset) {
+ /** @type {!number} */
+ var result;
+ result = buffer.charCodeAt(offset) * 65536 + buffer.charCodeAt(offset + 1);
+ return result;
+};
+
+var Binary$load32bitNumber$SI = Binary.load32bitNumber$SI;
+
+/**
+ * @param {!number} num
+ * @return {!string}
+ */
+Binary.dump16bitNumber$I = function (num) {
+ return String.fromCharCode(num % 65536);
+};
+
+var Binary$dump16bitNumber$I = Binary.dump16bitNumber$I;
+
+/**
+ * @param {!string} buffer
+ * @param {!number} offset
+ * @return {!number}
+ */
+Binary.load16bitNumber$SI = function (buffer, offset) {
+ return (buffer.charCodeAt(offset) | 0);
+};
+
+var Binary$load16bitNumber$SI = Binary.load16bitNumber$SI;
+
+/**
+ * @param {!string} str
+ * @return {!string}
+ */
+Binary.dumpString$S = function (str) {
+ return Binary$dumpString$SLCompressionReport$(str, null);
+};
+
+var Binary$dumpString$S = Binary.dumpString$S;
+
+/**
+ * @param {!string} str
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+Binary.dumpString$SLCompressionReport$ = function (str, report) {
+ /** @type {!number} */
+ var length;
+ /** @type {!boolean} */
+ var compress;
+ /** @type {Array.<undefined|!number>} */
+ var charCodes;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var charCode;
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {undefined|!number} */
+ var bytes;
+ if (str.length > 32768) {
+ str = str.slice(0, 32768);
+ }
+ length = str.length;
+ compress = true;
+ charCodes = [ ];
+ for (i = 0; i < length; i++) {
+ charCode = str.charCodeAt(i);
+ if (charCode > 255) {
+ compress = false;
+ break;
+ }
+ charCodes.push(charCode);
+ }
+ if (compress) {
+ result = [ Binary$dump16bitNumber$I(length + 32768) ];
+ for (i = 0; i < length; i += 2) {
+ bytes = charCodes[i];
+ if (i !== length - 1) {
+ bytes += charCodes[i + 1] << 8;
+ }
+ result.push(String.fromCharCode(bytes % 65536));
+ }
+ if (report) {
+ CompressionReport$add$LCompressionReport$II(report, length, Math.ceil(length / 2));
+ }
+ } else {
+ result = [ Binary$dump16bitNumber$I(length), str ];
+ if (report) {
+ CompressionReport$add$LCompressionReport$II(report, length, length);
+ }
+ }
+ return result.join('');
+};
+
+var Binary$dumpString$SLCompressionReport$ = Binary.dumpString$SLCompressionReport$;
+
+/**
+ * @param {!string} buffer
+ * @param {!number} offset
+ * @return {LoadedStringResult}
+ */
+Binary.loadString$SI = function (buffer, offset) {
+ return new LoadedStringResult$SI(buffer, offset);
+};
+
+var Binary$loadString$SI = Binary.loadString$SI;
+
+/**
+ * @param {Array.<undefined|!string>} strList
+ * @return {!string}
+ */
+Binary.dumpStringList$AS = function (strList) {
+ return Binary$dumpStringList$ASLCompressionReport$(strList, null);
+};
+
+var Binary$dumpStringList$AS = Binary.dumpStringList$AS;
+
+/**
+ * @param {Array.<undefined|!string>} strList
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+Binary.dumpStringList$ASLCompressionReport$ = function (strList, report) {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var i;
+ result = [ Binary$dump32bitNumber$N(strList.length) ];
+ for (i = 0; i < strList.length; i++) {
+ result.push(Binary$dumpString$SLCompressionReport$(strList[i], report));
+ }
+ return result.join('');
+};
+
+var Binary$dumpStringList$ASLCompressionReport$ = Binary.dumpStringList$ASLCompressionReport$;
+
+/**
+ * @param {!string} buffer
+ * @param {!number} offset
+ * @return {LoadedStringListResult}
+ */
+Binary.loadStringList$SI = function (buffer, offset) {
+ return new LoadedStringListResult$SI(buffer, offset);
+};
+
+var Binary$loadStringList$SI = Binary.loadStringList$SI;
+
+/**
+ * @param {Object.<string, undefined|Array.<undefined|!string>>} strMap
+ * @return {!string}
+ */
+Binary.dumpStringListMap$HAS = function (strMap) {
+ return Binary$dumpStringListMap$HASLCompressionReport$(strMap, null);
+};
+
+var Binary$dumpStringListMap$HAS = Binary.dumpStringListMap$HAS;
+
+/**
+ * @param {Object.<string, undefined|Array.<undefined|!string>>} strMap
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+Binary.dumpStringListMap$HASLCompressionReport$ = function (strMap, report) {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var counter;
+ /** @type {!string} */
+ var key;
+ result = [ ];
+ counter = 0;
+ for (key in strMap) {
+ result.push(Binary$dumpString$SLCompressionReport$(key, report));
+ result.push(Binary$dumpStringList$ASLCompressionReport$(strMap[key], report));
+ counter++;
+ }
+ return Binary$dump32bitNumber$N(counter) + result.join('');
+};
+
+var Binary$dumpStringListMap$HASLCompressionReport$ = Binary.dumpStringListMap$HASLCompressionReport$;
+
+/**
+ * @param {!string} buffer
+ * @param {!number} offset
+ * @return {LoadedStringListMapResult}
+ */
+Binary.loadStringListMap$SI = function (buffer, offset) {
+ return new LoadedStringListMapResult$SI(buffer, offset);
+};
+
+var Binary$loadStringListMap$SI = Binary.loadStringListMap$SI;
+
+/**
+ * @param {Array.<undefined|!number>} array
+ * @return {!string}
+ */
+Binary.dump32bitNumberList$AN = function (array) {
+ return Binary$dump32bitNumberList$ANLCompressionReport$(array, null);
+};
+
+var Binary$dump32bitNumberList$AN = Binary.dump32bitNumberList$AN;
+
+/**
+ * @param {Array.<undefined|!number>} array
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+Binary.dump32bitNumberList$ANLCompressionReport$ = function (array, report) {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var index;
+ /** @type {!number} */
+ var inputLength;
+ /** @type {!number} */
+ var length;
+ /** @type {!string} */
+ var resultString;
+ /** @type {!number} */
+ var value1$0;
+ /** @type {!number} */
+ var value2$0;
+ result = [ Binary$dump32bitNumber$N(array.length) ];
+ index = 0;
+ inputLength = array.length;
+ while (index < inputLength) {
+ if (array[index] == 0) {
+ length = Binary$_countZero$ANI(array, index);
+ result.push(Binary$_zeroBlock$I(length));
+ index += length;
+ } else {
+ if (Binary$_shouldZebraCode$ANI(array, index)) {
+ result.push(Binary$_createZebraCode$ANI(array, index));
+ value1$0 = array.length;
+ value2$0 = index + 15;
+ index = (value1$0 <= value2$0 ? value1$0 : value2$0);
+ } else {
+ length = Binary$_searchDoubleZero$ANI(array, index);
+ result.push(Binary$_nonZeroBlock$ANII(array, index, length));
+ if (length === 0) {
+ throw new Error('');
+ }
+ index += length;
+ }
+ }
+ }
+ resultString = result.join('');
+ if (report) {
+ CompressionReport$add$LCompressionReport$II(report, array.length * 2 + 2, resultString.length);
+ }
+ return resultString;
+};
+
+var Binary$dump32bitNumberList$ANLCompressionReport$ = Binary.dump32bitNumberList$ANLCompressionReport$;
+
+/**
+ * @param {!string} buffer
+ * @param {!number} offset
+ * @return {LoadedNumberListResult}
+ */
+Binary.load32bitNumberList$SI = function (buffer, offset) {
+ return new LoadedNumberListResult$SI(buffer, offset);
+};
+
+var Binary$load32bitNumberList$SI = Binary.load32bitNumberList$SI;
+
+/**
+ * @param {Array.<undefined|!number>} array
+ * @param {!number} offset
+ * @return {!number}
+ */
+Binary._countZero$ANI = function (array, offset) {
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var array$len$0;
+ for ((i = offset, array$len$0 = array.length); i < array$len$0; i++) {
+ if (array[i] != 0) {
+ return (i - offset | 0);
+ }
+ }
+ return (array.length - offset | 0);
+};
+
+var Binary$_countZero$ANI = Binary._countZero$ANI;
+
+/**
+ * @param {!number} length
+ * @return {!string}
+ */
+Binary._zeroBlock$I = function (length) {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ result = [ ];
+ while (length > 0) {
+ if (length > 16384) {
+ result.push(Binary$dump16bitNumber$I(16383));
+ length -= 16384;
+ } else {
+ result.push(Binary$dump16bitNumber$I(length - 1));
+ length = 0;
+ }
+ }
+ return result.join('');
+};
+
+var Binary$_zeroBlock$I = Binary._zeroBlock$I;
+
+/**
+ * @param {Array.<undefined|!number>} array
+ * @param {!number} offset
+ * @return {!boolean}
+ */
+Binary._shouldZebraCode$ANI = function (array, offset) {
+ /** @type {!number} */
+ var change;
+ /** @type {!boolean} */
+ var isLastZero;
+ /** @type {!number} */
+ var i;
+ if (array.length - offset < 16) {
+ return true;
+ }
+ change = 0;
+ isLastZero = false;
+ for (i = offset; i < offset + 15; i++) {
+ if (array[i] == 0) {
+ if (! isLastZero) {
+ isLastZero = true;
+ change++;
+ }
+ } else {
+ if (isLastZero) {
+ isLastZero = false;
+ change++;
+ }
+ }
+ }
+ return change > 2;
+};
+
+var Binary$_shouldZebraCode$ANI = Binary._shouldZebraCode$ANI;
+
+/**
+ * @param {Array.<undefined|!number>} array
+ * @param {!number} offset
+ * @return {!number}
+ */
+Binary._searchDoubleZero$ANI = function (array, offset) {
+ /** @type {!boolean} */
+ var isLastZero;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var array$len$0;
+ isLastZero = false;
+ for ((i = offset, array$len$0 = array.length); i < array$len$0; i++) {
+ if (array[i] == 0) {
+ if (isLastZero) {
+ return (i - offset - 1 | 0);
+ }
+ isLastZero = true;
+ } else {
+ isLastZero = false;
+ }
+ }
+ return (array.length - offset | 0);
+};
+
+var Binary$_searchDoubleZero$ANI = Binary._searchDoubleZero$ANI;
+
+/**
+ * @param {Array.<undefined|!number>} array
+ * @param {!number} offset
+ * @param {!number} length
+ * @return {!string}
+ */
+Binary._nonZeroBlock$ANII = function (array, offset, length) {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var blockLength;
+ /** @type {!number} */
+ var i;
+ result = [ ];
+ while (length > 0) {
+ if (length > 16384) {
+ blockLength = 16384;
+ length -= 16384;
+ } else {
+ blockLength = length;
+ length = 0;
+ }
+ result.push(Binary$dump16bitNumber$I(blockLength - 1 + 0x4000));
+ for (i = offset; i < offset + blockLength; i++) {
+ result.push(Binary$dump32bitNumber$N(array[i]));
+ }
+ offset += blockLength;
+ }
+ return result.join('');
+};
+
+var Binary$_nonZeroBlock$ANII = Binary._nonZeroBlock$ANII;
+
+/**
+ * @param {Array.<undefined|!number>} array
+ * @param {!number} offset
+ * @return {!string}
+ */
+Binary._createZebraCode$ANI = function (array, offset) {
+ /** @type {!number} */
+ var last;
+ /** @type {!number} */
+ var code;
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var value1$0;
+ /** @type {!number} */
+ var value2$0;
+ value1$0 = offset + 15;
+ value2$0 = array.length;
+ last = (value1$0 <= value2$0 ? value1$0 : value2$0);
+ code = 0x8000;
+ result = [ ];
+ for (i = offset; i < last; i++) {
+ if (array[i] != 0) {
+ result.push(Binary$dump32bitNumber$N(array[i]));
+ code = code + (0x1 << i - offset);
+ }
+ }
+ return String.fromCharCode(code) + result.join('');
+};
+
+var Binary$_createZebraCode$ANI = Binary._createZebraCode$ANI;
+
+/**
+ * @param {!string} str
+ * @return {!string}
+ */
+Binary.base64encode$S = function (str) {
+ /** @type {Array.<undefined|!string>} */
+ var out;
+ /** @type {Array.<undefined|!number>} */
+ var source;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var code;
+ /** @type {!number} */
+ var len;
+ /** @type {!number} */
+ var c1;
+ /** @type {undefined|!number} */
+ var c2;
+ /** @type {undefined|!number} */
+ var c3;
+ out = [ ];
+ source = [ ];
+ for (i = 0; i < str.length; i++) {
+ code = str.charCodeAt(i);
+ source.push(code & 0x00ff, code >>> 8);
+ }
+ len = str.length * 2;
+ i = 0;
+ while (i < len) {
+ c1 = source[i++] & 0xff;
+ if (i === len) {
+ out.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(c1 >> 2));
+ out.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((c1 & 0x3) << 4));
+ out.push("==");
+ break;
+ }
+ c2 = source[i++];
+ if (i === len) {
+ out.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(c1 >> 2));
+ out.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((c1 & 0x3) << 4 | (c2 & 0xF0) >> 4));
+ out.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((c2 & 0xF) << 2));
+ out.push("=");
+ break;
+ }
+ c3 = source[i++];
+ out.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(c1 >> 2));
+ out.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((c1 & 0x3) << 4 | (c2 & 0xF0) >> 4));
+ out.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((c2 & 0xF) << 2 | (c3 & 0xC0) >> 6));
+ out.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(c3 & 0x3F));
+ }
+ return out.join('');
+};
+
+var Binary$base64encode$S = Binary.base64encode$S;
+
+/**
+ * @param {Array.<undefined|!number>} source
+ * @return {!string}
+ */
+Binary._mergeCharCode$AI = function (source) {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var i;
+ result = [ ];
+ for (i = 0; i < source.length; i += 2) {
+ result.push(String.fromCharCode(source[i] + (source[i + 1] << 8)));
+ }
+ return result.join('');
+};
+
+var Binary$_mergeCharCode$AI = Binary._mergeCharCode$AI;
+
+/**
+ * @param {!string} str
+ * @return {!string}
+ */
+Binary.base64decode$S = function (str) {
+ /** @type {!number} */
+ var len;
+ /** @type {!number} */
+ var i;
+ /** @type {Array.<undefined|!number>} */
+ var out;
+ /** @type {undefined|!number} */
+ var c1;
+ /** @type {undefined|!number} */
+ var c2;
+ /** @type {!number} */
+ var c3;
+ /** @type {!number} */
+ var c4;
+ len = str.length;
+ i = 0;
+ out = [ ];
+ while (i < len) {
+ do {
+ c1 = Binary._base64DecodeChars[str.charCodeAt(i++) & 0xff];
+ } while (i < len && c1 == -1);
+ if (c1 == -1) {
+ break;
+ }
+ do {
+ c2 = Binary._base64DecodeChars[str.charCodeAt(i++) & 0xff];
+ } while (i < len && c2 == -1);
+ if (c2 == -1) {
+ break;
+ }
+ out.push(c1 << 2 | (c2 & 0x30) >> 4);
+ do {
+ c3 = str.charCodeAt(i++) & 0xff;
+ if (c3 === 61) {
+ return Binary$_mergeCharCode$AI(out);
+ }
+ c3 = Binary._base64DecodeChars[c3];
+ } while (i < len && c3 === -1);
+ if (c3 === -1) {
+ break;
+ }
+ out.push((c2 & 0XF) << 4 | (c3 & 0x3C) >> 2);
+ do {
+ c4 = str.charCodeAt(i++) & 0xff;
+ if (c4 === 61) {
+ return Binary$_mergeCharCode$AI(out);
+ }
+ c4 = (Binary._base64DecodeChars[c4] | 0);
+ } while (i < len && c4 === -1);
+ if (c4 === -1) {
+ break;
+ }
+ out.push((c3 & 0x03) << 6 | c4);
+ }
+ return Binary$_mergeCharCode$AI(out);
+};
+
+var Binary$base64decode$S = Binary.base64decode$S;
+
+/**
+ * class LoadedStringResult extends Object
+ * @constructor
+ */
+function LoadedStringResult() {
+}
+
+/**
+ * @constructor
+ * @param {!string} data
+ * @param {!number} offset
+ */
+function LoadedStringResult$SI(data, offset) {
+ /** @type {!number} */
+ var strLength;
+ /** @type {Array.<undefined|!string>} */
+ var bytes;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var code;
+ /** @type {!number} */
+ var offset$0;
+ this.result = "";
+ this.offset = 0;
+ offset$0 = offset++;
+ strLength = data.charCodeAt(offset$0);
+ if (strLength > 32767) {
+ strLength = strLength - 32768;
+ bytes = [ ];
+ for (i = 0; i < strLength; i += 2) {
+ code = data.charCodeAt(offset);
+ bytes.push(String.fromCharCode(code & 0x00ff));
+ if (i !== strLength - 1) {
+ bytes.push(String.fromCharCode(code >>> 8));
+ }
+ offset++;
+ }
+ this.result = bytes.join('');
+ this.offset = offset;
+ } else {
+ this.result = data.slice(offset, offset + strLength);
+ this.offset = (offset + strLength | 0);
+ }
+};
+
+LoadedStringResult$SI.prototype = new LoadedStringResult;
+
+/**
+ * class LoadedStringListResult extends Object
+ * @constructor
+ */
+function LoadedStringListResult() {
+}
+
+/**
+ * @constructor
+ * @param {!string} data
+ * @param {!number} offset
+ */
+function LoadedStringListResult$SI(data, offset) {
+ /** @type {!number} */
+ var length;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var strLength;
+ /** @type {!string} */
+ var resultStr;
+ /** @type {Array.<undefined|!string>} */
+ var bytes;
+ /** @type {!number} */
+ var j;
+ /** @type {!number} */
+ var code;
+ /** @type {!number} */
+ var result$0;
+ /** @type {!number} */
+ var offset$0;
+ this.offset = 0;
+ this.result = [ ];
+ result$0 = data.charCodeAt(offset) * 65536 + data.charCodeAt(offset + 1);
+ length = result$0;
+ offset += 2;
+ for (i = 0; i < length; i++) {
+ offset$0 = offset++;
+ strLength = data.charCodeAt(offset$0);
+ if (strLength > 32767) {
+ strLength = strLength - 32768;
+ bytes = [ ];
+ for (j = 0; j < strLength; j += 2) {
+ code = data.charCodeAt(offset);
+ bytes.push(String.fromCharCode(code & 0x00ff));
+ if (j !== strLength - 1) {
+ bytes.push(String.fromCharCode(code >>> 8));
+ }
+ offset++;
+ }
+ resultStr = bytes.join('');
+ } else {
+ resultStr = data.slice(offset, offset + strLength);
+ offset = (offset + strLength | 0);
+ }
+ this.result.push(resultStr);
+ }
+ this.offset = offset;
+};
+
+LoadedStringListResult$SI.prototype = new LoadedStringListResult;
+
+/**
+ * class LoadedStringListMapResult extends Object
+ * @constructor
+ */
+function LoadedStringListMapResult() {
+}
+
+/**
+ * @constructor
+ * @param {!string} data
+ * @param {!number} offset
+ */
+function LoadedStringListMapResult$SI(data, offset) {
+ /** @type {!number} */
+ var length;
+ /** @type {!number} */
+ var i;
+ /** @type {LoadedStringResult} */
+ var keyResult;
+ /** @type {LoadedStringListResult} */
+ var valueResult;
+ /** @type {!number} */
+ var result$0;
+ /** @type {!number} */
+ var offset$0;
+ this.offset = 0;
+ this.result = ({ });
+ result$0 = data.charCodeAt(offset) * 65536 + data.charCodeAt(offset + 1);
+ length = result$0;
+ offset += 2;
+ for (i = 0; i < length; i++) {
+ keyResult = new LoadedStringResult$SI(data, offset);
+ offset$0 = keyResult.offset;
+ valueResult = new LoadedStringListResult$SI(data, offset$0);
+ this.result[keyResult.result] = valueResult.result;
+ offset = valueResult.offset;
+ }
+ this.offset = offset;
+};
+
+LoadedStringListMapResult$SI.prototype = new LoadedStringListMapResult;
+
+/**
+ * class LoadedNumberListResult extends Object
+ * @constructor
+ */
+function LoadedNumberListResult() {
+}
+
+/**
+ * @constructor
+ * @param {!string} data
+ * @param {!number} offset
+ */
+function LoadedNumberListResult$SI(data, offset) {
+ /** @type {!number} */
+ var resultLength;
+ /** @type {!number} */
+ var originalOffset;
+ /** @type {Array.<undefined|!number>} */
+ var result;
+ /** @type {!number} */
+ var tag;
+ /** @type {!number} */
+ var length;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var result$0;
+ /** @type {!number} */
+ var value1$0;
+ this.result = null;
+ this.offset = 0;
+ result$0 = data.charCodeAt(offset) * 65536 + data.charCodeAt(offset + 1);
+ resultLength = result$0;
+ originalOffset = offset;
+ offset += 2;
+ result = [ ];
+ while (result.length < resultLength) {
+ tag = data.charCodeAt(offset++);
+ if (tag >>> 15 === 1) {
+ value1$0 = resultLength - result.length;
+ length = (value1$0 <= 15 ? value1$0 : 15);
+ for (i = 0; i < length; i++) {
+ if (tag >>> i & 0x1) {
+ result.push(Binary$load32bitNumber$SI(data, offset));
+ offset += 2;
+ } else {
+ result.push(0);
+ }
+ }
+ } else {
+ if (tag >>> 14 === 1) {
+ length = tag - 0x4000 + 1;
+ for (i = 0; i < length; i++) {
+ result.push(Binary$load32bitNumber$SI(data, offset));
+ offset += 2;
+ }
+ } else {
+ length = tag + 1;
+ for (i = 0; i < length; i++) {
+ result.push(0);
+ }
+ }
+ }
+ }
+ this.result = result;
+ this.offset = offset;
+};
+
+LoadedNumberListResult$SI.prototype = new LoadedNumberListResult;
+
+/**
+ * class CompressionReport extends Object
+ * @constructor
+ */
+function CompressionReport() {
+}
+
+/**
+ * @constructor
+ */
+function CompressionReport$() {
+ this.source = 0;
+ this.result = 0;
+};
+
+CompressionReport$.prototype = new CompressionReport;
+
+/**
+ * @param {CompressionReport} $this
+ * @param {!number} source
+ * @param {!number} result
+ */
+CompressionReport.add$LCompressionReport$II = function ($this, source, result) {
+ $this.source += source;
+ $this.result += result;
+};
+
+var CompressionReport$add$LCompressionReport$II = CompressionReport.add$LCompressionReport$II;
+
+/**
+ * @param {CompressionReport} $this
+ * @return {!number}
+ */
+CompressionReport.rate$LCompressionReport$ = function ($this) {
+ return (Math.round($this.result * 100.0 / $this.source) | 0);
+};
+
+var CompressionReport$rate$LCompressionReport$ = CompressionReport.rate$LCompressionReport$;
+
+/**
+ * class Query extends Object
+ * @constructor
+ */
+function Query() {
+}
+
+/**
+ * @constructor
+ */
+function Query$() {
+ this.word = '';
+ this.or = false;
+ this.not = false;
+ this.raw = false;
+};
+
+Query$.prototype = new Query;
+
+/**
+ * @return {!string}
+ */
+Query.prototype.toString = function () {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ result = [ ];
+ if (this.or) {
+ result.push("OR ");
+ }
+ if (this.not) {
+ result.push("-");
+ }
+ if (this.raw) {
+ result.push('"', this.word, '"');
+ } else {
+ result.push(this.word);
+ }
+ return result.join('');
+};
+
+/**
+ * class QueryStringParser extends Object
+ * @constructor
+ */
+function QueryStringParser() {
+}
+
+/**
+ * @constructor
+ */
+function QueryStringParser$() {
+ this.queries = [ ];
+};
+
+QueryStringParser$.prototype = new QueryStringParser;
+
+/**
+ * @param {QueryStringParser} $this
+ * @param {!string} queryString
+ * @return {Array.<undefined|Query>}
+ */
+QueryStringParser.parse$LQueryStringParser$S = function ($this, queryString) {
+ /** @type {!boolean} */
+ var nextOr;
+ /** @type {!boolean} */
+ var nextNot;
+ /** @type {!number} */
+ var currentWordStart;
+ /** @type {!number} */
+ var status;
+ /** @type {RegExp} */
+ var isSpace;
+ /** @type {!number} */
+ var i;
+ /** @type {!string} */
+ var ch;
+ /** @type {!string} */
+ var word;
+ /** @type {Query} */
+ var query;
+ nextOr = false;
+ nextNot = false;
+ currentWordStart = 0;
+ status = 0;
+ isSpace = /[\s\u3000]/;
+ for (i = 0; i < queryString.length; i++) {
+ ch = queryString.charAt(i);
+ switch (status) {
+ case 0:
+ if (! isSpace.test(ch)) {
+ if (ch === '-') {
+ nextNot = true;
+ } else {
+ if (ch === '"') {
+ currentWordStart = i + 1;
+ status = 2;
+ } else {
+ currentWordStart = i;
+ status = 1;
+ }
+ }
+ } else {
+ nextNot = false;
+ }
+ break;
+ case 1:
+ if (isSpace.test(ch)) {
+ word = queryString.slice(currentWordStart, i);
+ if (word === 'OR') {
+ nextOr = true;
+ } else {
+ query = new Query$();
+ query.word = word;
+ query.or = nextOr;
+ query.not = nextNot;
+ $this.queries.push(query);
+ nextOr = false;
+ nextNot = false;
+ }
+ status = 0;
+ }
+ break;
+ case 2:
+ if (ch === '"') {
+ word = queryString.slice(currentWordStart, i);
+ query = new Query$();
+ query.word = word;
+ query.or = nextOr;
+ query.not = nextNot;
+ query.raw = true;
+ $this.queries.push(query);
+ nextOr = false;
+ nextNot = false;
+ status = 0;
+ }
+ break;
+ }
+ }
+ switch (status) {
+ case 0:
+ break;
+ case 1:
+ query = new Query$();
+ word = queryString.slice(currentWordStart, queryString.length);
+ if (word !== 'OR') {
+ query.word = word;
+ query.or = nextOr;
+ query.not = nextNot;
+ $this.queries.push(query);
+ }
+ break;
+ case 2:
+ query = new Query$();
+ query.word = queryString.slice(currentWordStart, queryString.length);
+ query.or = nextOr;
+ query.not = nextNot;
+ query.raw = true;
+ $this.queries.push(query);
+ break;
+ }
+ return $this.queries;
+};
+
+var QueryStringParser$parse$LQueryStringParser$S = QueryStringParser.parse$LQueryStringParser$S;
+
+/**
+ * @param {QueryStringParser} $this
+ * @return {!string}
+ */
+QueryStringParser.highlight$LQueryStringParser$ = function ($this) {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var i;
+ /** @type {Query} */
+ var query;
+ result = [ ];
+ for (i = 0; i < $this.queries.length; i++) {
+ query = $this.queries[i];
+ if (! query.not) {
+ result.push("highlight=" + $__jsx_encodeURIComponent(query.word));
+ }
+ }
+ return '?' + result.join('&');
+};
+
+var QueryStringParser$highlight$LQueryStringParser$ = QueryStringParser.highlight$LQueryStringParser$;
+
+/**
+ * class Proposal extends Object
+ * @constructor
+ */
+function Proposal() {
+}
+
+/**
+ * @constructor
+ * @param {!number} omit
+ * @param {!number} expect
+ */
+function Proposal$II(omit, expect) {
+ this.omit = omit;
+ this.expect = expect;
+};
+
+Proposal$II.prototype = new Proposal;
+
+/**
+ * class Position extends Object
+ * @constructor
+ */
+function Position() {
+}
+
+/**
+ * @constructor
+ * @param {!string} word
+ * @param {!number} position
+ * @param {!boolean} stemmed
+ */
+function Position$SIB(word, position, stemmed) {
+ this.word = word;
+ this.position = position;
+ this.stemmed = stemmed;
+};
+
+Position$SIB.prototype = new Position;
+
+/**
+ * class SearchUnit extends Object
+ * @constructor
+ */
+function SearchUnit() {
+}
+
+/**
+ * @constructor
+ * @param {!number} id
+ */
+function SearchUnit$I(id) {
+ this.positions = ({ });
+ this.id = id;
+ this._size = 0;
+ this.score = 0;
+ this.startPosition = -1;
+};
+
+SearchUnit$I.prototype = new SearchUnit;
+
+/**
+ * @param {SearchUnit} $this
+ * @param {!string} word
+ * @param {!number} position
+ * @param {!boolean} stemmed
+ */
+SearchUnit.addPosition$LSearchUnit$SIB = function ($this, word, position, stemmed) {
+ /** @type {Position} */
+ var positionObj;
+ positionObj = $this.positions[position + ""];
+ if (! positionObj) {
+ $this._size++;
+ $this.positions[position + ""] = ({word: word, position: position, stemmed: stemmed});
+ } else {
+ if (positionObj.word.length < word.length) {
+ positionObj.word = word;
+ }
+ positionObj.stemmed = positionObj.stemmed && stemmed;
+ }
+};
+
+var SearchUnit$addPosition$LSearchUnit$SIB = SearchUnit.addPosition$LSearchUnit$SIB;
+
+/**
+ * @param {SearchUnit} $this
+ * @param {!number} position
+ * @return {Position}
+ */
+SearchUnit.get$LSearchUnit$I = function ($this, position) {
+ return $this.positions[position + ""];
+};
+
+var SearchUnit$get$LSearchUnit$I = SearchUnit.get$LSearchUnit$I;
+
+/**
+ * @param {SearchUnit} $this
+ * @return {!number}
+ */
+SearchUnit.size$LSearchUnit$ = function ($this) {
+ return $this._size;
+};
+
+var SearchUnit$size$LSearchUnit$ = SearchUnit.size$LSearchUnit$;
+
+/**
+ * @param {SearchUnit} $this
+ * @param {SearchUnit} rhs
+ */
+SearchUnit.merge$LSearchUnit$LSearchUnit$ = function ($this, rhs) {
+ /** @type {!string} */
+ var position;
+ /** @type {Position} */
+ var pos;
+ for (position in rhs.positions) {
+ pos = rhs.positions[position];
+ SearchUnit$addPosition$LSearchUnit$SIB($this, pos.word, pos.position, pos.stemmed);
+ }
+};
+
+var SearchUnit$merge$LSearchUnit$LSearchUnit$ = SearchUnit.merge$LSearchUnit$LSearchUnit$;
+
+/**
+ * @param {SearchUnit} $this
+ * @return {Array.<undefined|Position>}
+ */
+SearchUnit.getPositions$LSearchUnit$ = function ($this) {
+ /** @type {Array.<undefined|Position>} */
+ var result;
+ /** @type {!string} */
+ var pos;
+ result = [ ];
+ for (pos in $this.positions) {
+ result.push($this.positions[pos]);
+ }
+ result.sort((function (a, b) {
+ return a.position - b.position;
+ }));
+ return result;
+};
+
+var SearchUnit$getPositions$LSearchUnit$ = SearchUnit.getPositions$LSearchUnit$;
+
+/**
+ * class SingleResult extends Object
+ * @constructor
+ */
+function SingleResult() {
+}
+
+/**
+ * @constructor
+ */
+function SingleResult$() {
+ this.units = [ ];
+ this.unitIds = [ ];
+ this.or = false;
+ this.not = false;
+ this.searchWord = '';
+};
+
+SingleResult$.prototype = new SingleResult;
+
+/**
+ * @constructor
+ * @param {!string} searchWord
+ * @param {!boolean} or
+ * @param {!boolean} not
+ */
+function SingleResult$SBB(searchWord, or, not) {
+ this.units = [ ];
+ this.unitIds = [ ];
+ this.or = or;
+ this.not = not;
+ this.searchWord = searchWord;
+};
+
+SingleResult$SBB.prototype = new SingleResult;
+
+/**
+ * @param {SingleResult} $this
+ * @param {!number} unitId
+ * @return {SearchUnit}
+ */
+SingleResult.getSearchUnit$LSingleResult$I = function ($this, unitId) {
+ /** @type {!number} */
+ var existing;
+ /** @type {SearchUnit} */
+ var result;
+ existing = $this.unitIds.indexOf(unitId);
+ if (existing === -1) {
+ result = ({positions: ({ }), id: unitId, _size: 0, score: 0, startPosition: -1});
+ $this.units.push(result);
+ $this.unitIds.push(unitId);
+ } else {
+ result = $this.units[existing];
+ }
+ return result;
+};
+
+var SingleResult$getSearchUnit$LSingleResult$I = SingleResult.getSearchUnit$LSingleResult$I;
+
+/**
+ * @param {SingleResult} $this
+ * @param {SingleResult} rhs
+ * @return {SingleResult}
+ */
+SingleResult.merge$LSingleResult$LSingleResult$ = function ($this, rhs) {
+ /** @type {SingleResult} */
+ var result;
+ result = ({units: [ ], unitIds: [ ], or: false, not: false, searchWord: ''});
+ if (rhs.or) {
+ SingleResult$_orMerge$LSingleResult$LSingleResult$LSingleResult$($this, result, rhs);
+ } else {
+ if (rhs.not) {
+ SingleResult$_notMerge$LSingleResult$LSingleResult$LSingleResult$($this, result, rhs);
+ } else {
+ SingleResult$_andMerge$LSingleResult$LSingleResult$LSingleResult$($this, result, rhs);
+ }
+ }
+ return result;
+};
+
+var SingleResult$merge$LSingleResult$LSingleResult$ = SingleResult.merge$LSingleResult$LSingleResult$;
+
+/**
+ * @param {SingleResult} $this
+ * @return {!number}
+ */
+SingleResult.size$LSingleResult$ = function ($this) {
+ return ($this.units.length | 0);
+};
+
+var SingleResult$size$LSingleResult$ = SingleResult.size$LSingleResult$;
+
+/**
+ * @param {SingleResult} $this
+ * @param {SingleResult} result
+ * @param {SingleResult} rhs
+ */
+SingleResult._andMerge$LSingleResult$LSingleResult$LSingleResult$ = function ($this, result, rhs) {
+ /** @type {!number} */
+ var i;
+ /** @type {undefined|!number} */
+ var id;
+ /** @type {SearchUnit} */
+ var lhsSection;
+ for (i = 0; i < $this.unitIds.length; i++) {
+ id = $this.unitIds[i];
+ if (rhs.unitIds.indexOf(id) !== -1) {
+ lhsSection = $this.units[i];
+ result.unitIds.push(id);
+ result.units.push(lhsSection);
+ }
+ }
+};
+
+var SingleResult$_andMerge$LSingleResult$LSingleResult$LSingleResult$ = SingleResult._andMerge$LSingleResult$LSingleResult$LSingleResult$;
+
+/**
+ * @param {SingleResult} $this
+ * @param {SingleResult} result
+ * @param {SingleResult} rhs
+ */
+SingleResult._orMerge$LSingleResult$LSingleResult$LSingleResult$ = function ($this, result, rhs) {
+ /** @type {!number} */
+ var i;
+ /** @type {undefined|!number} */
+ var id;
+ /** @type {SearchUnit} */
+ var rhsSection;
+ /** @type {SearchUnit} */
+ var lhsSection;
+ /** @type {Array.<undefined|!number>} */
+ var unitIds$0;
+ /** @type {Array.<undefined|SearchUnit>} */
+ var units$0;
+ result.unitIds = (unitIds$0 = $this.unitIds).slice(0, unitIds$0.length);
+ result.units = (units$0 = $this.units).slice(0, units$0.length);
+ for (i = 0; i < rhs.unitIds.length; i++) {
+ id = rhs.unitIds[i];
+ rhsSection = rhs.units[i];
+ if (result.unitIds.indexOf(id) !== -1) {
+ lhsSection = result.units[result.unitIds.indexOf(id)];
+ SearchUnit$merge$LSearchUnit$LSearchUnit$(lhsSection, rhsSection);
+ } else {
+ result.unitIds.push(id);
+ result.units.push(rhsSection);
+ }
+ }
+};
+
+var SingleResult$_orMerge$LSingleResult$LSingleResult$LSingleResult$ = SingleResult._orMerge$LSingleResult$LSingleResult$LSingleResult$;
+
+/**
+ * @param {SingleResult} $this
+ * @param {SingleResult} result
+ * @param {SingleResult} rhs
+ */
+SingleResult._notMerge$LSingleResult$LSingleResult$LSingleResult$ = function ($this, result, rhs) {
+ /** @type {!number} */
+ var i;
+ /** @type {undefined|!number} */
+ var id;
+ /** @type {SearchUnit} */
+ var lhsSection;
+ for (i = 0; i < $this.unitIds.length; i++) {
+ id = $this.unitIds[i];
+ if (rhs.unitIds.indexOf(id) === -1) {
+ lhsSection = $this.units[i];
+ result.unitIds.push(id);
+ result.units.push(lhsSection);
+ }
+ }
+};
+
+var SingleResult$_notMerge$LSingleResult$LSingleResult$LSingleResult$ = SingleResult._notMerge$LSingleResult$LSingleResult$LSingleResult$;
+
+/**
+ * class SearchSummary extends Object
+ * @constructor
+ */
+function SearchSummary() {
+}
+
+/**
+ * @constructor
+ */
+function SearchSummary$() {
+ this.sourceResults = [ ];
+ this.result = null;
+ this.oktavia = null;
+};
+
+SearchSummary$.prototype = new SearchSummary;
+
+/**
+ * @constructor
+ * @param {Oktavia} oktavia
+ */
+function SearchSummary$LOktavia$(oktavia) {
+ this.sourceResults = [ ];
+ this.result = null;
+ this.oktavia = oktavia;
+};
+
+SearchSummary$LOktavia$.prototype = new SearchSummary;
+
+/**
+ * @param {SearchSummary} $this
+ * @param {SingleResult} result
+ */
+SearchSummary.addQuery$LSearchSummary$LSingleResult$ = function ($this, result) {
+ $this.sourceResults.push(result);
+};
+
+var SearchSummary$addQuery$LSearchSummary$LSingleResult$ = SearchSummary.addQuery$LSearchSummary$LSingleResult$;
+
+/**
+ * @param {SearchSummary} $this
+ */
+SearchSummary.mergeResult$LSearchSummary$ = function ($this) {
+ $this.result = SearchSummary$mergeResult$LSearchSummary$ALSingleResult$($this, $this.sourceResults);
+};
+
+var SearchSummary$mergeResult$LSearchSummary$ = SearchSummary.mergeResult$LSearchSummary$;
+
+/**
+ * @param {SearchSummary} $this
+ * @param {Array.<undefined|SingleResult>} results
+ * @return {SingleResult}
+ */
+SearchSummary.mergeResult$LSearchSummary$ALSingleResult$ = function ($this, results) {
+ /** @type {SingleResult} */
+ var rhs;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var results$len$0;
+ rhs = results[0];
+ for ((i = 1, results$len$0 = results.length); i < results$len$0; i++) {
+ rhs = SingleResult$merge$LSingleResult$LSingleResult$(rhs, results[i]);
+ }
+ return rhs;
+};
+
+var SearchSummary$mergeResult$LSearchSummary$ALSingleResult$ = SearchSummary.mergeResult$LSearchSummary$ALSingleResult$;
+
+/**
+ * @param {SearchSummary} $this
+ * @return {Array.<undefined|Proposal>}
+ */
+SearchSummary.getProposal$LSearchSummary$ = function ($this) {
+ /** @type {Array.<undefined|Proposal>} */
+ var proposals;
+ /** @type {!number} */
+ var i;
+ /** @type {Array.<undefined|SingleResult>} */
+ var tmpSource;
+ /** @type {!number} */
+ var j;
+ /** @type {SingleResult} */
+ var result;
+ proposals = [ ];
+ for (i = 0; i < $this.sourceResults.length; i++) {
+ tmpSource = [ ];
+ for (j = 0; j < $this.sourceResults.length; j++) {
+ if (i !== j) {
+ tmpSource.push($this.sourceResults[j]);
+ }
+ }
+ result = SearchSummary$mergeResult$LSearchSummary$ALSingleResult$($this, tmpSource);
+ proposals.push(({omit: i, expect: result.units.length}));
+ }
+ proposals.sort((function (a, b) {
+ return b.expect - a.expect;
+ }));
+ return proposals;
+};
+
+var SearchSummary$getProposal$LSearchSummary$ = SearchSummary.getProposal$LSearchSummary$;
+
+/**
+ * @param {SearchSummary} $this
+ * @return {Array.<undefined|SearchUnit>}
+ */
+SearchSummary.getSortedResult$LSearchSummary$ = function ($this) {
+ /** @type {Array.<undefined|SearchUnit>} */
+ var result;
+ /** @type {Array.<undefined|SearchUnit>} */
+ var units$0;
+ result = (units$0 = $this.result.units).slice(0, units$0.length);
+ result.sort((function (a, b) {
+ return b.score - a.score;
+ }));
+ return result;
+};
+
+var SearchSummary$getSortedResult$LSearchSummary$ = SearchSummary.getSortedResult$LSearchSummary$;
+
+/**
+ * @param {SearchSummary} $this
+ * @return {!number}
+ */
+SearchSummary.size$LSearchSummary$ = function ($this) {
+ /** @type {SingleResult} */
+ var this$0;
+ this$0 = $this.result;
+ return (this$0.units.length | 0);
+};
+
+var SearchSummary$size$LSearchSummary$ = SearchSummary.size$LSearchSummary$;
+
+/**
+ * @param {SearchSummary} $this
+ * @param {SingleResult} result
+ */
+SearchSummary.add$LSearchSummary$LSingleResult$ = function ($this, result) {
+ $this.sourceResults.push(result);
+};
+
+var SearchSummary$add$LSearchSummary$LSingleResult$ = SearchSummary.add$LSearchSummary$LSingleResult$;
+
+/**
+ * class Style extends Object
+ * @constructor
+ */
+function Style() {
+}
+
+/**
+ * @constructor
+ * @param {!string} mode
+ */
+function Style$S(mode) {
+ this.styles = null;
+ this.escapeHTML = false;
+ switch (mode) {
+ case 'console':
+ this.styles = Style.console;
+ break;
+ case 'html':
+ this.styles = Style.html;
+ break;
+ case 'ignore':
+ this.styles = Style.ignore;
+ break;
+ default:
+ this.styles = Style.ignore;
+ break;
+ }
+ this.escapeHTML = mode === 'html';
+};
+
+Style$S.prototype = new Style;
+
+/**
+ * @param {!string} source
+ * @return {!string}
+ */
+Style.prototype.convert$S = function (source) {
+ /** @type {_HTMLHandler} */
+ var handler;
+ /** @type {SAXParser} */
+ var parser;
+ handler = new _HTMLHandler$HASB(this.styles, this.escapeHTML);
+ parser = new SAXParser$LSAXHandler$(handler);
+ parser.parse$S(source);
+ return handler.text.join('');
+};
+
+/**
+ * class Stemmer
+ * @constructor
+ */
+function Stemmer() {
+}
+
+Stemmer.prototype.$__jsx_implements_Stemmer = true;
+
+/**
+ * @constructor
+ */
+function Stemmer$() {
+};
+
+Stemmer$.prototype = new Stemmer;
+
+/**
+ * class BaseStemmer extends Object
+ * @constructor
+ */
+function BaseStemmer() {
+}
+
+$__jsx_merge_interface(BaseStemmer, Stemmer);
+
+/**
+ * @constructor
+ */
+function BaseStemmer$() {
+ /** @type {!string} */
+ var current$0;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var limit$0;
+ this.cache = ({ });
+ current$0 = this.current = "";
+ cursor$0 = this.cursor = 0;
+ limit$0 = this.limit = current$0.length;
+ this.limit_backward = 0;
+ this.bra = cursor$0;
+ this.ket = limit$0;
+};
+
+BaseStemmer$.prototype = new BaseStemmer;
+
+/**
+ * @param {!string} value
+ */
+BaseStemmer.prototype.setCurrent$S = function (value) {
+ /** @type {!string} */
+ var current$0;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var limit$0;
+ current$0 = this.current = value;
+ cursor$0 = this.cursor = 0;
+ limit$0 = this.limit = current$0.length;
+ this.limit_backward = 0;
+ this.bra = cursor$0;
+ this.ket = limit$0;
+};
+
+/**
+ * @return {!string}
+ */
+BaseStemmer.prototype.getCurrent$ = function () {
+ return this.current;
+};
+
+/**
+ * @param {BaseStemmer} other
+ */
+BaseStemmer.prototype.copy_from$LBaseStemmer$ = function (other) {
+ this.current = other.current;
+ this.cursor = other.cursor;
+ this.limit = other.limit;
+ this.limit_backward = other.limit_backward;
+ this.bra = other.bra;
+ this.ket = other.ket;
+};
+
+/**
+ * @param {Array.<undefined|!number>} s
+ * @param {!number} min
+ * @param {!number} max
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.in_grouping$AIII = function (s, min, max) {
+ /** @type {!number} */
+ var ch;
+ if (this.cursor >= this.limit) {
+ return false;
+ }
+ ch = this.current.charCodeAt(this.cursor);
+ if (ch > max || ch < min) {
+ return false;
+ }
+ ch -= min;
+ if ((s[ch >>> 3] & 0x1 << (ch & 0x7)) === 0) {
+ return false;
+ }
+ this.cursor++;
+ return true;
+};
+
+/**
+ * @param {Array.<undefined|!number>} s
+ * @param {!number} min
+ * @param {!number} max
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.in_grouping_b$AIII = function (s, min, max) {
+ /** @type {!number} */
+ var ch;
+ if (this.cursor <= this.limit_backward) {
+ return false;
+ }
+ ch = this.current.charCodeAt(this.cursor - 1);
+ if (ch > max || ch < min) {
+ return false;
+ }
+ ch -= min;
+ if ((s[ch >>> 3] & 0x1 << (ch & 0x7)) === 0) {
+ return false;
+ }
+ this.cursor--;
+ return true;
+};
+
+/**
+ * @param {Array.<undefined|!number>} s
+ * @param {!number} min
+ * @param {!number} max
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.out_grouping$AIII = function (s, min, max) {
+ /** @type {!number} */
+ var ch;
+ if (this.cursor >= this.limit) {
+ return false;
+ }
+ ch = this.current.charCodeAt(this.cursor);
+ if (ch > max || ch < min) {
+ this.cursor++;
+ return true;
+ }
+ ch -= min;
+ if ((s[ch >>> 3] & 0X1 << (ch & 0x7)) === 0) {
+ this.cursor++;
+ return true;
+ }
+ return false;
+};
+
+/**
+ * @param {Array.<undefined|!number>} s
+ * @param {!number} min
+ * @param {!number} max
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.out_grouping_b$AIII = function (s, min, max) {
+ /** @type {!number} */
+ var ch;
+ if (this.cursor <= this.limit_backward) {
+ return false;
+ }
+ ch = this.current.charCodeAt(this.cursor - 1);
+ if (ch > max || ch < min) {
+ this.cursor--;
+ return true;
+ }
+ ch -= min;
+ if ((s[ch >>> 3] & 0x1 << (ch & 0x7)) === 0) {
+ this.cursor--;
+ return true;
+ }
+ return false;
+};
+
+/**
+ * @param {!number} min
+ * @param {!number} max
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.in_range$II = function (min, max) {
+ /** @type {!number} */
+ var ch;
+ if (this.cursor >= this.limit) {
+ return false;
+ }
+ ch = this.current.charCodeAt(this.cursor);
+ if (ch > max || ch < min) {
+ return false;
+ }
+ this.cursor++;
+ return true;
+};
+
+/**
+ * @param {!number} min
+ * @param {!number} max
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.in_range_b$II = function (min, max) {
+ /** @type {!number} */
+ var ch;
+ if (this.cursor <= this.limit_backward) {
+ return false;
+ }
+ ch = this.current.charCodeAt(this.cursor - 1);
+ if (ch > max || ch < min) {
+ return false;
+ }
+ this.cursor--;
+ return true;
+};
+
+/**
+ * @param {!number} min
+ * @param {!number} max
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.out_range$II = function (min, max) {
+ /** @type {!number} */
+ var ch;
+ if (this.cursor >= this.limit) {
+ return false;
+ }
+ ch = this.current.charCodeAt(this.cursor);
+ if (! (ch > max || ch < min)) {
+ return false;
+ }
+ this.cursor++;
+ return true;
+};
+
+/**
+ * @param {!number} min
+ * @param {!number} max
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.out_range_b$II = function (min, max) {
+ /** @type {!number} */
+ var ch;
+ if (this.cursor <= this.limit_backward) {
+ return false;
+ }
+ ch = this.current.charCodeAt(this.cursor - 1);
+ if (! (ch > max || ch < min)) {
+ return false;
+ }
+ this.cursor--;
+ return true;
+};
+
+/**
+ * @param {!number} s_size
+ * @param {!string} s
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.eq_s$IS = function (s_size, s) {
+ /** @type {!number} */
+ var cursor$0;
+ if (this.limit - this.cursor < s_size) {
+ return false;
+ }
+ if (this.current.slice(cursor$0 = this.cursor, cursor$0 + s_size) !== s) {
+ return false;
+ }
+ this.cursor += s_size;
+ return true;
+};
+
+/**
+ * @param {!number} s_size
+ * @param {!string} s
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.eq_s_b$IS = function (s_size, s) {
+ /** @type {!number} */
+ var cursor$0;
+ if (this.cursor - this.limit_backward < s_size) {
+ return false;
+ }
+ if (this.current.slice((cursor$0 = this.cursor) - s_size, cursor$0) !== s) {
+ return false;
+ }
+ this.cursor -= s_size;
+ return true;
+};
+
+/**
+ * @param {!string} s
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.eq_v$S = function (s) {
+ return this.eq_s$IS(s.length, s);
+};
+
+/**
+ * @param {!string} s
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.eq_v_b$S = function (s) {
+ return this.eq_s_b$IS(s.length, s);
+};
+
+/**
+ * @param {Array.<undefined|Among>} v
+ * @param {!number} v_size
+ * @return {!number}
+ */
+BaseStemmer.prototype.find_among$ALAmong$I = function (v, v_size) {
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var j;
+ /** @type {!number} */
+ var c;
+ /** @type {!number} */
+ var l;
+ /** @type {!number} */
+ var common_i;
+ /** @type {!number} */
+ var common_j;
+ /** @type {!boolean} */
+ var first_key_inspected;
+ /** @type {!number} */
+ var k;
+ /** @type {!number} */
+ var diff;
+ /** @type {!number} */
+ var common;
+ /** @type {Among} */
+ var w;
+ /** @type {!number} */
+ var i2;
+ /** @type {!boolean} */
+ var res;
+ i = 0;
+ j = v_size;
+ c = this.cursor;
+ l = this.limit;
+ common_i = 0;
+ common_j = 0;
+ first_key_inspected = false;
+ while (true) {
+ k = i + (j - i >>> 1);
+ diff = 0;
+ common = (common_i < common_j ? common_i : common_j);
+ w = v[k];
+ for (i2 = common; i2 < w.s_size; i2++) {
+ if (c + common === l) {
+ diff = -1;
+ break;
+ }
+ diff = this.current.charCodeAt(c + common) - w.s.charCodeAt(i2);
+ if (diff !== 0) {
+ break;
+ }
+ common++;
+ }
+ if (diff < 0) {
+ j = k;
+ common_j = common;
+ } else {
+ i = k;
+ common_i = common;
+ }
+ if (j - i <= 1) {
+ if (i > 0) {
+ break;
+ }
+ if (j === i) {
+ break;
+ }
+ if (first_key_inspected) {
+ break;
+ }
+ first_key_inspected = true;
+ }
+ }
+ while (true) {
+ w = v[i];
+ if (common_i >= w.s_size) {
+ this.cursor = (c + w.s_size | 0);
+ if (w.method == null) {
+ return w.result;
+ }
+ res = w.method(w.instance);
+ this.cursor = (c + w.s_size | 0);
+ if (res) {
+ return w.result;
+ }
+ }
+ i = w.substring_i;
+ if (i < 0) {
+ return 0;
+ }
+ }
+ return -1;
+};
+
+/**
+ * @param {Array.<undefined|Among>} v
+ * @param {!number} v_size
+ * @return {!number}
+ */
+BaseStemmer.prototype.find_among_b$ALAmong$I = function (v, v_size) {
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var j;
+ /** @type {!number} */
+ var c;
+ /** @type {!number} */
+ var lb;
+ /** @type {!number} */
+ var common_i;
+ /** @type {!number} */
+ var common_j;
+ /** @type {!boolean} */
+ var first_key_inspected;
+ /** @type {!number} */
+ var k;
+ /** @type {!number} */
+ var diff;
+ /** @type {!number} */
+ var common;
+ /** @type {Among} */
+ var w;
+ /** @type {!number} */
+ var i2;
+ /** @type {!boolean} */
+ var res;
+ i = 0;
+ j = v_size;
+ c = this.cursor;
+ lb = this.limit_backward;
+ common_i = 0;
+ common_j = 0;
+ first_key_inspected = false;
+ while (true) {
+ k = i + (j - i >> 1);
+ diff = 0;
+ common = (common_i < common_j ? common_i : common_j);
+ w = v[k];
+ for (i2 = w.s_size - 1 - common; i2 >= 0; i2--) {
+ if (c - common === lb) {
+ diff = -1;
+ break;
+ }
+ diff = this.current.charCodeAt(c - 1 - common) - w.s.charCodeAt(i2);
+ if (diff !== 0) {
+ break;
+ }
+ common++;
+ }
+ if (diff < 0) {
+ j = k;
+ common_j = common;
+ } else {
+ i = k;
+ common_i = common;
+ }
+ if (j - i <= 1) {
+ if (i > 0) {
+ break;
+ }
+ if (j === i) {
+ break;
+ }
+ if (first_key_inspected) {
+ break;
+ }
+ first_key_inspected = true;
+ }
+ }
+ while (true) {
+ w = v[i];
+ if (common_i >= w.s_size) {
+ this.cursor = (c - w.s_size | 0);
+ if (w.method == null) {
+ return w.result;
+ }
+ res = w.method(this);
+ this.cursor = (c - w.s_size | 0);
+ if (res) {
+ return w.result;
+ }
+ }
+ i = w.substring_i;
+ if (i < 0) {
+ return 0;
+ }
+ }
+ return -1;
+};
+
+/**
+ * @param {!number} c_bra
+ * @param {!number} c_ket
+ * @param {!string} s
+ * @return {!number}
+ */
+BaseStemmer.prototype.replace_s$IIS = function (c_bra, c_ket, s) {
+ /** @type {!number} */
+ var adjustment;
+ adjustment = s.length - (c_ket - c_bra);
+ this.current = this.current.slice(0, c_bra) + s + this.current.slice(c_ket);
+ this.limit += (adjustment | 0);
+ if (this.cursor >= c_ket) {
+ this.cursor += (adjustment | 0);
+ } else {
+ if (this.cursor > c_bra) {
+ this.cursor = c_bra;
+ }
+ }
+ return (adjustment | 0);
+};
+
+/**
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.slice_check$ = function () {
+ /** @type {!number} */
+ var bra$0;
+ /** @type {!number} */
+ var ket$0;
+ /** @type {!number} */
+ var limit$0;
+ return ((bra$0 = this.bra) < 0 || bra$0 > (ket$0 = this.ket) || ket$0 > (limit$0 = this.limit) || limit$0 > this.current.length ? false : true);
+};
+
+/**
+ * @param {!string} s
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.slice_from$S = function (s) {
+ /** @type {!boolean} */
+ var result;
+ /** @type {!number} */
+ var bra$0;
+ /** @type {!number} */
+ var ket$0;
+ /** @type {!number} */
+ var limit$0;
+ result = false;
+ if ((bra$0 = this.bra) < 0 || bra$0 > (ket$0 = this.ket) || ket$0 > (limit$0 = this.limit) || limit$0 > this.current.length ? false : true) {
+ this.replace_s$IIS(this.bra, this.ket, s);
+ result = true;
+ }
+ return result;
+};
+
+/**
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.slice_del$ = function () {
+ return this.slice_from$S("");
+};
+
+/**
+ * @param {!number} c_bra
+ * @param {!number} c_ket
+ * @param {!string} s
+ */
+BaseStemmer.prototype.insert$IIS = function (c_bra, c_ket, s) {
+ /** @type {!number} */
+ var adjustment;
+ adjustment = this.replace_s$IIS(c_bra, c_ket, s);
+ if (c_bra <= this.bra) {
+ this.bra += (adjustment | 0);
+ }
+ if (c_bra <= this.ket) {
+ this.ket += (adjustment | 0);
+ }
+};
+
+/**
+ * @param {!string} s
+ * @return {!string}
+ */
+BaseStemmer.prototype.slice_to$S = function (s) {
+ /** @type {!string} */
+ var result;
+ /** @type {!number} */
+ var bra$0;
+ /** @type {!number} */
+ var ket$0;
+ /** @type {!number} */
+ var limit$0;
+ result = '';
+ if ((bra$0 = this.bra) < 0 || bra$0 > (ket$0 = this.ket) || ket$0 > (limit$0 = this.limit) || limit$0 > this.current.length ? false : true) {
+ result = this.current.slice(this.bra, this.ket);
+ }
+ return result;
+};
+
+/**
+ * @param {!string} s
+ * @return {!string}
+ */
+BaseStemmer.prototype.assign_to$S = function (s) {
+ return this.current.slice(0, this.limit);
+};
+
+/**
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.stem$ = function () {
+ return false;
+};
+
+/**
+ * @param {!string} word
+ * @return {!string}
+ */
+BaseStemmer.prototype.stemWord$S = function (word) {
+ /** @type {undefined|!string} */
+ var result;
+ /** @type {!string} */
+ var current$0;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var limit$0;
+ result = this.cache['.' + word];
+ if (result == null) {
+ current$0 = this.current = word;
+ cursor$0 = this.cursor = 0;
+ limit$0 = this.limit = current$0.length;
+ this.limit_backward = 0;
+ this.bra = cursor$0;
+ this.ket = limit$0;
+ this.stem$();
+ result = this.current;
+ this.cache['.' + word] = result;
+ }
+ return result;
+};
+
+/**
+ * @param {Array.<undefined|!string>} words
+ * @return {Array.<undefined|!string>}
+ */
+BaseStemmer.prototype.stemWords$AS = function (words) {
+ /** @type {Array.<undefined|!string>} */
+ var results;
+ /** @type {!number} */
+ var i;
+ /** @type {undefined|!string} */
+ var word;
+ /** @type {undefined|!string} */
+ var result;
+ /** @type {!string} */
+ var current$0;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var limit$0;
+ results = [ ];
+ for (i = 0; i < words.length; i++) {
+ word = words[i];
+ result = this.cache['.' + word];
+ if (result == null) {
+ current$0 = this.current = word;
+ cursor$0 = this.cursor = 0;
+ limit$0 = this.limit = current$0.length;
+ this.limit_backward = 0;
+ this.bra = cursor$0;
+ this.ket = limit$0;
+ this.stem$();
+ result = this.current;
+ this.cache['.' + word] = result;
+ }
+ results.push(result);
+ }
+ return results;
+};
+
+/**
+ * class FrenchStemmer extends BaseStemmer
+ * @constructor
+ */
+function FrenchStemmer() {
+}
+
+FrenchStemmer.prototype = new BaseStemmer;
+/**
+ * @constructor
+ */
+function FrenchStemmer$() {
+ BaseStemmer$.call(this);
+ this.I_p2 = 0;
+ this.I_p1 = 0;
+ this.I_pV = 0;
+};
+
+FrenchStemmer$.prototype = new FrenchStemmer;
+
+/**
+ * @param {FrenchStemmer} other
+ */
+FrenchStemmer.prototype.copy_from$LFrenchStemmer$ = function (other) {
+ this.I_p2 = other.I_p2;
+ this.I_p1 = other.I_p1;
+ this.I_pV = other.I_pV;
+ BaseStemmer.prototype.copy_from$LBaseStemmer$.call(this, other);
+};
+
+/**
+ * @return {!boolean}
+ */
+FrenchStemmer.prototype.r_prelude$ = function () {
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var v_3;
+ /** @type {!number} */
+ var v_4;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!boolean} */
+ var lab3;
+ /** @type {!boolean} */
+ var lab4;
+ /** @type {!boolean} */
+ var lab5;
+ /** @type {!boolean} */
+ var lab6;
+ /** @type {!boolean} */
+ var lab7;
+ /** @type {!boolean} */
+ var lab8;
+ /** @type {!boolean} */
+ var lab9;
+ /** @type {!number} */
+ var cursor$0;
+replab0:
+ while (true) {
+ v_1 = this.cursor;
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ golab2:
+ while (true) {
+ v_2 = this.cursor;
+ lab3 = true;
+ lab3:
+ while (lab3 === true) {
+ lab3 = false;
+ lab4 = true;
+ lab4:
+ while (lab4 === true) {
+ lab4 = false;
+ v_3 = this.cursor;
+ lab5 = true;
+ lab5:
+ while (lab5 === true) {
+ lab5 = false;
+ if (! this.in_grouping$AIII(FrenchStemmer.g_v, 97, 251)) {
+ break lab5;
+ }
+ this.bra = this.cursor;
+ lab6 = true;
+ lab6:
+ while (lab6 === true) {
+ lab6 = false;
+ v_4 = this.cursor;
+ lab7 = true;
+ lab7:
+ while (lab7 === true) {
+ lab7 = false;
+ if (! this.eq_s$IS(1, "u")) {
+ break lab7;
+ }
+ this.ket = this.cursor;
+ if (! this.in_grouping$AIII(FrenchStemmer.g_v, 97, 251)) {
+ break lab7;
+ }
+ if (! this.slice_from$S("U")) {
+ return false;
+ }
+ break lab6;
+ }
+ this.cursor = v_4;
+ lab8 = true;
+ lab8:
+ while (lab8 === true) {
+ lab8 = false;
+ if (! this.eq_s$IS(1, "i")) {
+ break lab8;
+ }
+ this.ket = this.cursor;
+ if (! this.in_grouping$AIII(FrenchStemmer.g_v, 97, 251)) {
+ break lab8;
+ }
+ if (! this.slice_from$S("I")) {
+ return false;
+ }
+ break lab6;
+ }
+ this.cursor = v_4;
+ if (! this.eq_s$IS(1, "y")) {
+ break lab5;
+ }
+ this.ket = this.cursor;
+ if (! this.slice_from$S("Y")) {
+ return false;
+ }
+ }
+ break lab4;
+ }
+ this.cursor = v_3;
+ lab9 = true;
+ lab9:
+ while (lab9 === true) {
+ lab9 = false;
+ this.bra = this.cursor;
+ if (! this.eq_s$IS(1, "y")) {
+ break lab9;
+ }
+ this.ket = this.cursor;
+ if (! this.in_grouping$AIII(FrenchStemmer.g_v, 97, 251)) {
+ break lab9;
+ }
+ if (! this.slice_from$S("Y")) {
+ return false;
+ }
+ break lab4;
+ }
+ this.cursor = v_3;
+ if (! this.eq_s$IS(1, "q")) {
+ break lab3;
+ }
+ this.bra = this.cursor;
+ if (! this.eq_s$IS(1, "u")) {
+ break lab3;
+ }
+ this.ket = this.cursor;
+ if (! this.slice_from$S("U")) {
+ return false;
+ }
+ }
+ this.cursor = v_2;
+ break golab2;
+ }
+ cursor$0 = this.cursor = v_2;
+ if (cursor$0 >= this.limit) {
+ break lab1;
+ }
+ this.cursor++;
+ }
+ continue replab0;
+ }
+ this.cursor = v_1;
+ break replab0;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+FrenchStemmer.prototype.r_mark_regions$ = function () {
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var v_4;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!boolean} */
+ var lab2;
+ /** @type {!boolean} */
+ var lab3;
+ /** @type {!boolean} */
+ var lab5;
+ /** @type {!boolean} */
+ var lab6;
+ /** @type {!boolean} */
+ var lab8;
+ /** @type {!boolean} */
+ var lab10;
+ /** @type {!boolean} */
+ var lab12;
+ /** @type {!boolean} */
+ var lab14;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var limit$0;
+ /** @type {!number} */
+ var cursor$1;
+ this.I_pV = limit$0 = this.limit;
+ this.I_p1 = limit$0;
+ this.I_p2 = limit$0;
+ v_1 = this.cursor;
+ lab0 = true;
+lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ v_2 = this.cursor;
+ lab2 = true;
+ lab2:
+ while (lab2 === true) {
+ lab2 = false;
+ if (! this.in_grouping$AIII(FrenchStemmer.g_v, 97, 251)) {
+ break lab2;
+ }
+ if (! this.in_grouping$AIII(FrenchStemmer.g_v, 97, 251)) {
+ break lab2;
+ }
+ if (this.cursor >= this.limit) {
+ break lab2;
+ }
+ this.cursor++;
+ break lab1;
+ }
+ this.cursor = v_2;
+ lab3 = true;
+ lab3:
+ while (lab3 === true) {
+ lab3 = false;
+ if (this.find_among$ALAmong$I(FrenchStemmer.a_0, 3) === 0) {
+ break lab3;
+ }
+ break lab1;
+ }
+ cursor$0 = this.cursor = v_2;
+ if (cursor$0 >= this.limit) {
+ break lab0;
+ }
+ this.cursor++;
+ golab4:
+ while (true) {
+ lab5 = true;
+ lab5:
+ while (lab5 === true) {
+ lab5 = false;
+ if (! this.in_grouping$AIII(FrenchStemmer.g_v, 97, 251)) {
+ break lab5;
+ }
+ break golab4;
+ }
+ if (this.cursor >= this.limit) {
+ break lab0;
+ }
+ this.cursor++;
+ }
+ }
+ this.I_pV = this.cursor;
+ }
+ cursor$1 = this.cursor = v_1;
+ v_4 = cursor$1;
+ lab6 = true;
+lab6:
+ while (lab6 === true) {
+ lab6 = false;
+ golab7:
+ while (true) {
+ lab8 = true;
+ lab8:
+ while (lab8 === true) {
+ lab8 = false;
+ if (! this.in_grouping$AIII(FrenchStemmer.g_v, 97, 251)) {
+ break lab8;
+ }
+ break golab7;
+ }
+ if (this.cursor >= this.limit) {
+ break lab6;
+ }
+ this.cursor++;
+ }
+ golab9:
+ while (true) {
+ lab10 = true;
+ lab10:
+ while (lab10 === true) {
+ lab10 = false;
+ if (! this.out_grouping$AIII(FrenchStemmer.g_v, 97, 251)) {
+ break lab10;
+ }
+ break golab9;
+ }
+ if (this.cursor >= this.limit) {
+ break lab6;
+ }
+ this.cursor++;
+ }
+ this.I_p1 = this.cursor;
+ golab11:
+ while (true) {
+ lab12 = true;
+ lab12:
+ while (lab12 === true) {
+ lab12 = false;
+ if (! this.in_grouping$AIII(FrenchStemmer.g_v, 97, 251)) {
+ break lab12;
+ }
+ break golab11;
+ }
+ if (this.cursor >= this.limit) {
+ break lab6;
+ }
+ this.cursor++;
+ }
+ golab13:
+ while (true) {
+ lab14 = true;
+ lab14:
+ while (lab14 === true) {
+ lab14 = false;
+ if (! this.out_grouping$AIII(FrenchStemmer.g_v, 97, 251)) {
+ break lab14;
+ }
+ break golab13;
+ }
+ if (this.cursor >= this.limit) {
+ break lab6;
+ }
+ this.cursor++;
+ }
+ this.I_p2 = this.cursor;
+ }
+ this.cursor = v_4;
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+FrenchStemmer.prototype.r_postlude$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var v_1;
+ /** @type {!boolean} */
+ var lab1;
+replab0:
+ while (true) {
+ v_1 = this.cursor;
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ this.bra = this.cursor;
+ among_var = this.find_among$ALAmong$I(FrenchStemmer.a_1, 4);
+ if (among_var === 0) {
+ break lab1;
+ }
+ this.ket = this.cursor;
+ switch (among_var) {
+ case 0:
+ break lab1;
+ case 1:
+ if (! this.slice_from$S("i")) {
+ return false;
+ }
+ break;
+ case 2:
+ if (! this.slice_from$S("u")) {
+ return false;
+ }
+ break;
+ case 3:
+ if (! this.slice_from$S("y")) {
+ return false;
+ }
+ break;
+ case 4:
+ if (this.cursor >= this.limit) {
+ break lab1;
+ }
+ this.cursor++;
+ break;
+ }
+ continue replab0;
+ }
+ this.cursor = v_1;
+ break replab0;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+FrenchStemmer.prototype.r_RV$ = function () {
+ return (! (this.I_pV <= this.cursor) ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+FrenchStemmer.prototype.r_R1$ = function () {
+ return (! (this.I_p1 <= this.cursor) ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+FrenchStemmer.prototype.r_R2$ = function () {
+ return (! (this.I_p2 <= this.cursor) ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+FrenchStemmer.prototype.r_standard_suffix$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var v_3;
+ /** @type {!number} */
+ var v_4;
+ /** @type {!number} */
+ var v_5;
+ /** @type {!number} */
+ var v_6;
+ /** @type {!number} */
+ var v_7;
+ /** @type {!number} */
+ var v_8;
+ /** @type {!number} */
+ var v_9;
+ /** @type {!number} */
+ var v_10;
+ /** @type {!number} */
+ var v_11;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!boolean} */
+ var lab2;
+ /** @type {!boolean} */
+ var lab3;
+ /** @type {!boolean} */
+ var lab4;
+ /** @type {!boolean} */
+ var lab5;
+ /** @type {!boolean} */
+ var lab6;
+ /** @type {!boolean} */
+ var lab7;
+ /** @type {!boolean} */
+ var lab8;
+ /** @type {!boolean} */
+ var lab9;
+ /** @type {!boolean} */
+ var lab10;
+ /** @type {!boolean} */
+ var lab11;
+ /** @type {!boolean} */
+ var lab12;
+ /** @type {!boolean} */
+ var lab13;
+ /** @type {!boolean} */
+ var lab14;
+ /** @type {!boolean} */
+ var lab15;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var cursor$1;
+ /** @type {!number} */
+ var cursor$2;
+ /** @type {!number} */
+ var cursor$3;
+ this.ket = this.cursor;
+ among_var = this.find_among_b$ALAmong$I(FrenchStemmer.a_4, 43);
+ if (among_var === 0) {
+ return false;
+ }
+ this.bra = this.cursor;
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ if (! (! (this.I_p2 <= this.cursor) ? false : true)) {
+ return false;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 2:
+ if (! (! (this.I_p2 <= this.cursor) ? false : true)) {
+ return false;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ v_1 = this.limit - this.cursor;
+ lab0 = true;
+ lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ this.ket = this.cursor;
+ if (! this.eq_s_b$IS(2, "ic")) {
+ this.cursor = this.limit - v_1;
+ break lab0;
+ }
+ this.bra = this.cursor;
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ v_2 = this.limit - this.cursor;
+ lab2 = true;
+ lab2:
+ while (lab2 === true) {
+ lab2 = false;
+ if (! (! (this.I_p2 <= this.cursor) ? false : true)) {
+ break lab2;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break lab1;
+ }
+ this.cursor = this.limit - v_2;
+ if (! this.slice_from$S("iqU")) {
+ return false;
+ }
+ }
+ }
+ break;
+ case 3:
+ if (! (! (this.I_p2 <= this.cursor) ? false : true)) {
+ return false;
+ }
+ if (! this.slice_from$S("log")) {
+ return false;
+ }
+ break;
+ case 4:
+ if (! (! (this.I_p2 <= this.cursor) ? false : true)) {
+ return false;
+ }
+ if (! this.slice_from$S("u")) {
+ return false;
+ }
+ break;
+ case 5:
+ if (! (! (this.I_p2 <= this.cursor) ? false : true)) {
+ return false;
+ }
+ if (! this.slice_from$S("ent")) {
+ return false;
+ }
+ break;
+ case 6:
+ if (! (! (this.I_pV <= this.cursor) ? false : true)) {
+ return false;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ v_3 = this.limit - this.cursor;
+ lab3 = true;
+ lab3:
+ while (lab3 === true) {
+ lab3 = false;
+ this.ket = this.cursor;
+ among_var = this.find_among_b$ALAmong$I(FrenchStemmer.a_2, 6);
+ if (among_var === 0) {
+ this.cursor = this.limit - v_3;
+ break lab3;
+ }
+ this.bra = this.cursor;
+ switch (among_var) {
+ case 0:
+ this.cursor = this.limit - v_3;
+ break lab3;
+ case 1:
+ if (! (! (this.I_p2 <= this.cursor) ? false : true)) {
+ this.cursor = this.limit - v_3;
+ break lab3;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ this.ket = this.cursor;
+ if (! this.eq_s_b$IS(2, "at")) {
+ this.cursor = this.limit - v_3;
+ break lab3;
+ }
+ this.bra = cursor$0 = this.cursor;
+ if (! (! (this.I_p2 <= cursor$0) ? false : true)) {
+ this.cursor = this.limit - v_3;
+ break lab3;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 2:
+ lab4 = true;
+ lab4:
+ while (lab4 === true) {
+ lab4 = false;
+ v_4 = this.limit - this.cursor;
+ lab5 = true;
+ lab5:
+ while (lab5 === true) {
+ lab5 = false;
+ if (! (! (this.I_p2 <= this.cursor) ? false : true)) {
+ break lab5;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break lab4;
+ }
+ cursor$1 = this.cursor = this.limit - v_4;
+ if (! (! (this.I_p1 <= cursor$1) ? false : true)) {
+ this.cursor = this.limit - v_3;
+ break lab3;
+ }
+ if (! this.slice_from$S("eux")) {
+ return false;
+ }
+ }
+ break;
+ case 3:
+ if (! (! (this.I_p2 <= this.cursor) ? false : true)) {
+ this.cursor = this.limit - v_3;
+ break lab3;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 4:
+ if (! (! (this.I_pV <= this.cursor) ? false : true)) {
+ this.cursor = this.limit - v_3;
+ break lab3;
+ }
+ if (! this.slice_from$S("i")) {
+ return false;
+ }
+ break;
+ }
+ }
+ break;
+ case 7:
+ if (! (! (this.I_p2 <= this.cursor) ? false : true)) {
+ return false;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ v_5 = this.limit - this.cursor;
+ lab6 = true;
+ lab6:
+ while (lab6 === true) {
+ lab6 = false;
+ this.ket = this.cursor;
+ among_var = this.find_among_b$ALAmong$I(FrenchStemmer.a_3, 3);
+ if (among_var === 0) {
+ this.cursor = this.limit - v_5;
+ break lab6;
+ }
+ this.bra = this.cursor;
+ switch (among_var) {
+ case 0:
+ this.cursor = this.limit - v_5;
+ break lab6;
+ case 1:
+ lab7 = true;
+ lab7:
+ while (lab7 === true) {
+ lab7 = false;
+ v_6 = this.limit - this.cursor;
+ lab8 = true;
+ lab8:
+ while (lab8 === true) {
+ lab8 = false;
+ if (! (! (this.I_p2 <= this.cursor) ? false : true)) {
+ break lab8;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break lab7;
+ }
+ this.cursor = this.limit - v_6;
+ if (! this.slice_from$S("abl")) {
+ return false;
+ }
+ }
+ break;
+ case 2:
+ lab9 = true;
+ lab9:
+ while (lab9 === true) {
+ lab9 = false;
+ v_7 = this.limit - this.cursor;
+ lab10 = true;
+ lab10:
+ while (lab10 === true) {
+ lab10 = false;
+ if (! (! (this.I_p2 <= this.cursor) ? false : true)) {
+ break lab10;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break lab9;
+ }
+ this.cursor = this.limit - v_7;
+ if (! this.slice_from$S("iqU")) {
+ return false;
+ }
+ }
+ break;
+ case 3:
+ if (! (! (this.I_p2 <= this.cursor) ? false : true)) {
+ this.cursor = this.limit - v_5;
+ break lab6;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ }
+ }
+ break;
+ case 8:
+ if (! (! (this.I_p2 <= this.cursor) ? false : true)) {
+ return false;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ v_8 = this.limit - this.cursor;
+ lab11 = true;
+ lab11:
+ while (lab11 === true) {
+ lab11 = false;
+ this.ket = this.cursor;
+ if (! this.eq_s_b$IS(2, "at")) {
+ this.cursor = this.limit - v_8;
+ break lab11;
+ }
+ this.bra = cursor$2 = this.cursor;
+ if (! (! (this.I_p2 <= cursor$2) ? false : true)) {
+ this.cursor = this.limit - v_8;
+ break lab11;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ this.ket = this.cursor;
+ if (! this.eq_s_b$IS(2, "ic")) {
+ this.cursor = this.limit - v_8;
+ break lab11;
+ }
+ this.bra = this.cursor;
+ lab12 = true;
+ lab12:
+ while (lab12 === true) {
+ lab12 = false;
+ v_9 = this.limit - this.cursor;
+ lab13 = true;
+ lab13:
+ while (lab13 === true) {
+ lab13 = false;
+ if (! (! (this.I_p2 <= this.cursor) ? false : true)) {
+ break lab13;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break lab12;
+ }
+ this.cursor = this.limit - v_9;
+ if (! this.slice_from$S("iqU")) {
+ return false;
+ }
+ }
+ }
+ break;
+ case 9:
+ if (! this.slice_from$S("eau")) {
+ return false;
+ }
+ break;
+ case 10:
+ if (! (! (this.I_p1 <= this.cursor) ? false : true)) {
+ return false;
+ }
+ if (! this.slice_from$S("al")) {
+ return false;
+ }
+ break;
+ case 11:
+ lab14 = true;
+ lab14:
+ while (lab14 === true) {
+ lab14 = false;
+ v_10 = this.limit - this.cursor;
+ lab15 = true;
+ lab15:
+ while (lab15 === true) {
+ lab15 = false;
+ if (! (! (this.I_p2 <= this.cursor) ? false : true)) {
+ break lab15;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break lab14;
+ }
+ cursor$3 = this.cursor = this.limit - v_10;
+ if (! (! (this.I_p1 <= cursor$3) ? false : true)) {
+ return false;
+ }
+ if (! this.slice_from$S("eux")) {
+ return false;
+ }
+ }
+ break;
+ case 12:
+ if (! (! (this.I_p1 <= this.cursor) ? false : true)) {
+ return false;
+ }
+ if (! this.out_grouping_b$AIII(FrenchStemmer.g_v, 97, 251)) {
+ return false;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 13:
+ if (! (! (this.I_pV <= this.cursor) ? false : true)) {
+ return false;
+ }
+ if (! this.slice_from$S("ant")) {
+ return false;
+ }
+ return false;
+ case 14:
+ if (! (! (this.I_pV <= this.cursor) ? false : true)) {
+ return false;
+ }
+ if (! this.slice_from$S("ent")) {
+ return false;
+ }
+ return false;
+ case 15:
+ v_11 = this.limit - this.cursor;
+ if (! this.in_grouping_b$AIII(FrenchStemmer.g_v, 97, 251)) {
+ return false;
+ }
+ if (! (! (this.I_pV <= this.cursor) ? false : true)) {
+ return false;
+ }
+ this.cursor = this.limit - v_11;
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ return false;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+FrenchStemmer.prototype.r_i_verb_suffix$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var cursor$1;
+ /** @type {!number} */
+ var cursor$2;
+ v_1 = this.limit - (cursor$0 = this.cursor);
+ if (cursor$0 < this.I_pV) {
+ return false;
+ }
+ cursor$1 = this.cursor = this.I_pV;
+ v_2 = this.limit_backward;
+ this.limit_backward = cursor$1;
+ cursor$2 = this.cursor = this.limit - v_1;
+ this.ket = cursor$2;
+ among_var = this.find_among_b$ALAmong$I(FrenchStemmer.a_5, 35);
+ if (among_var === 0) {
+ this.limit_backward = v_2;
+ return false;
+ }
+ this.bra = this.cursor;
+ switch (among_var) {
+ case 0:
+ this.limit_backward = v_2;
+ return false;
+ case 1:
+ if (! this.out_grouping_b$AIII(FrenchStemmer.g_v, 97, 251)) {
+ this.limit_backward = v_2;
+ return false;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ }
+ this.limit_backward = v_2;
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+FrenchStemmer.prototype.r_verb_suffix$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var v_3;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var cursor$1;
+ /** @type {!number} */
+ var cursor$2;
+ v_1 = this.limit - (cursor$0 = this.cursor);
+ if (cursor$0 < this.I_pV) {
+ return false;
+ }
+ cursor$1 = this.cursor = this.I_pV;
+ v_2 = this.limit_backward;
+ this.limit_backward = cursor$1;
+ cursor$2 = this.cursor = this.limit - v_1;
+ this.ket = cursor$2;
+ among_var = this.find_among_b$ALAmong$I(FrenchStemmer.a_6, 38);
+ if (among_var === 0) {
+ this.limit_backward = v_2;
+ return false;
+ }
+ this.bra = this.cursor;
+ switch (among_var) {
+ case 0:
+ this.limit_backward = v_2;
+ return false;
+ case 1:
+ if (! (! (this.I_p2 <= this.cursor) ? false : true)) {
+ this.limit_backward = v_2;
+ return false;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 2:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 3:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ v_3 = this.limit - this.cursor;
+ lab0 = true;
+ lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ this.ket = this.cursor;
+ if (! this.eq_s_b$IS(1, "e")) {
+ this.cursor = this.limit - v_3;
+ break lab0;
+ }
+ this.bra = this.cursor;
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ }
+ break;
+ }
+ this.limit_backward = v_2;
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+FrenchStemmer.prototype.r_residual_suffix$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var v_3;
+ /** @type {!number} */
+ var v_4;
+ /** @type {!number} */
+ var v_5;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!boolean} */
+ var lab2;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var cursor$1;
+ /** @type {!number} */
+ var cursor$2;
+ /** @type {!number} */
+ var cursor$3;
+ v_1 = this.limit - this.cursor;
+ lab0 = true;
+lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ this.ket = this.cursor;
+ if (! this.eq_s_b$IS(1, "s")) {
+ this.cursor = this.limit - v_1;
+ break lab0;
+ }
+ this.bra = cursor$0 = this.cursor;
+ v_2 = this.limit - cursor$0;
+ if (! this.out_grouping_b$AIII(FrenchStemmer.g_keep_with_s, 97, 232)) {
+ this.cursor = this.limit - v_1;
+ break lab0;
+ }
+ this.cursor = this.limit - v_2;
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ }
+ v_3 = this.limit - (cursor$1 = this.cursor);
+ if (cursor$1 < this.I_pV) {
+ return false;
+ }
+ cursor$2 = this.cursor = this.I_pV;
+ v_4 = this.limit_backward;
+ this.limit_backward = cursor$2;
+ cursor$3 = this.cursor = this.limit - v_3;
+ this.ket = cursor$3;
+ among_var = this.find_among_b$ALAmong$I(FrenchStemmer.a_7, 7);
+ if (among_var === 0) {
+ this.limit_backward = v_4;
+ return false;
+ }
+ this.bra = this.cursor;
+ switch (among_var) {
+ case 0:
+ this.limit_backward = v_4;
+ return false;
+ case 1:
+ if (! (! (this.I_p2 <= this.cursor) ? false : true)) {
+ this.limit_backward = v_4;
+ return false;
+ }
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ v_5 = this.limit - this.cursor;
+ lab2 = true;
+ lab2:
+ while (lab2 === true) {
+ lab2 = false;
+ if (! this.eq_s_b$IS(1, "s")) {
+ break lab2;
+ }
+ break lab1;
+ }
+ this.cursor = this.limit - v_5;
+ if (! this.eq_s_b$IS(1, "t")) {
+ this.limit_backward = v_4;
+ return false;
+ }
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 2:
+ if (! this.slice_from$S("i")) {
+ return false;
+ }
+ break;
+ case 3:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 4:
+ if (! this.eq_s_b$IS(2, "gu")) {
+ this.limit_backward = v_4;
+ return false;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ }
+ this.limit_backward = v_4;
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+FrenchStemmer.prototype.r_un_double$ = function () {
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var cursor$0;
+ v_1 = this.limit - this.cursor;
+ if (this.find_among_b$ALAmong$I(FrenchStemmer.a_8, 5) === 0) {
+ return false;
+ }
+ cursor$0 = this.cursor = this.limit - v_1;
+ this.ket = cursor$0;
+ if (cursor$0 <= this.limit_backward) {
+ return false;
+ }
+ this.cursor--;
+ this.bra = this.cursor;
+ return (! this.slice_from$S("") ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+FrenchStemmer.prototype.r_un_accent$ = function () {
+ /** @type {!number} */
+ var v_3;
+ /** @type {!number} */
+ var v_1;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!boolean} */
+ var lab2;
+ /** @type {!boolean} */
+ var lab3;
+ v_1 = 1;
+replab0:
+ while (true) {
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ if (! this.out_grouping_b$AIII(FrenchStemmer.g_v, 97, 251)) {
+ break lab1;
+ }
+ v_1--;
+ continue replab0;
+ }
+ break replab0;
+ }
+ if (v_1 > 0) {
+ return false;
+ }
+ this.ket = this.cursor;
+ lab2 = true;
+lab2:
+ while (lab2 === true) {
+ lab2 = false;
+ v_3 = this.limit - this.cursor;
+ lab3 = true;
+ lab3:
+ while (lab3 === true) {
+ lab3 = false;
+ if (! this.eq_s_b$IS(1, "\u00E9")) {
+ break lab3;
+ }
+ break lab2;
+ }
+ this.cursor = this.limit - v_3;
+ if (! this.eq_s_b$IS(1, "\u00E8")) {
+ return false;
+ }
+ }
+ this.bra = this.cursor;
+ return (! this.slice_from$S("e") ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+FrenchStemmer.prototype.stem$ = function () {
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var v_3;
+ /** @type {!number} */
+ var v_4;
+ /** @type {!number} */
+ var v_5;
+ /** @type {!number} */
+ var v_6;
+ /** @type {!number} */
+ var v_7;
+ /** @type {!number} */
+ var v_8;
+ /** @type {!number} */
+ var v_9;
+ /** @type {!number} */
+ var v_11;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!boolean} */
+ var lab2;
+ /** @type {!boolean} */
+ var lab3;
+ /** @type {!boolean} */
+ var lab4;
+ /** @type {!boolean} */
+ var lab5;
+ /** @type {!boolean} */
+ var lab6;
+ /** @type {!boolean} */
+ var lab7;
+ /** @type {!boolean} */
+ var lab8;
+ /** @type {!boolean} */
+ var lab9;
+ /** @type {!boolean} */
+ var lab10;
+ /** @type {!boolean} */
+ var lab11;
+ /** @type {!boolean} */
+ var lab12;
+ /** @type {!boolean} */
+ var lab13;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var limit$0;
+ /** @type {!number} */
+ var cursor$1;
+ /** @type {!number} */
+ var cursor$2;
+ /** @type {!number} */
+ var limit$1;
+ /** @type {!number} */
+ var cursor$3;
+ /** @type {!number} */
+ var limit$2;
+ /** @type {!number} */
+ var cursor$4;
+ /** @type {!number} */
+ var cursor$5;
+ v_1 = this.cursor;
+ lab0 = true;
+lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ if (! this.r_prelude$()) {
+ break lab0;
+ }
+ }
+ cursor$0 = this.cursor = v_1;
+ v_2 = cursor$0;
+ lab1 = true;
+lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ if (! this.r_mark_regions$()) {
+ break lab1;
+ }
+ }
+ cursor$2 = this.cursor = v_2;
+ this.limit_backward = cursor$2;
+ cursor$3 = this.cursor = limit$1 = this.limit;
+ v_3 = limit$1 - cursor$3;
+ lab2 = true;
+lab2:
+ while (lab2 === true) {
+ lab2 = false;
+ lab3 = true;
+ lab3:
+ while (lab3 === true) {
+ lab3 = false;
+ v_4 = this.limit - this.cursor;
+ lab4 = true;
+ lab4:
+ while (lab4 === true) {
+ lab4 = false;
+ v_5 = this.limit - this.cursor;
+ lab5 = true;
+ lab5:
+ while (lab5 === true) {
+ lab5 = false;
+ v_6 = this.limit - this.cursor;
+ lab6 = true;
+ lab6:
+ while (lab6 === true) {
+ lab6 = false;
+ if (! this.r_standard_suffix$()) {
+ break lab6;
+ }
+ break lab5;
+ }
+ this.cursor = this.limit - v_6;
+ lab7 = true;
+ lab7:
+ while (lab7 === true) {
+ lab7 = false;
+ if (! this.r_i_verb_suffix$()) {
+ break lab7;
+ }
+ break lab5;
+ }
+ this.cursor = this.limit - v_6;
+ if (! this.r_verb_suffix$()) {
+ break lab4;
+ }
+ }
+ cursor$1 = this.cursor = (limit$0 = this.limit) - v_5;
+ v_7 = limit$0 - cursor$1;
+ lab8 = true;
+ lab8:
+ while (lab8 === true) {
+ lab8 = false;
+ this.ket = this.cursor;
+ lab9 = true;
+ lab9:
+ while (lab9 === true) {
+ lab9 = false;
+ v_8 = this.limit - this.cursor;
+ lab10 = true;
+ lab10:
+ while (lab10 === true) {
+ lab10 = false;
+ if (! this.eq_s_b$IS(1, "Y")) {
+ break lab10;
+ }
+ this.bra = this.cursor;
+ if (! this.slice_from$S("i")) {
+ return false;
+ }
+ break lab9;
+ }
+ this.cursor = this.limit - v_8;
+ if (! this.eq_s_b$IS(1, "\u00E7")) {
+ this.cursor = this.limit - v_7;
+ break lab8;
+ }
+ this.bra = this.cursor;
+ if (! this.slice_from$S("c")) {
+ return false;
+ }
+ }
+ }
+ break lab3;
+ }
+ this.cursor = this.limit - v_4;
+ if (! this.r_residual_suffix$()) {
+ break lab2;
+ }
+ }
+ }
+ cursor$4 = this.cursor = (limit$2 = this.limit) - v_3;
+ v_9 = limit$2 - cursor$4;
+ lab11 = true;
+lab11:
+ while (lab11 === true) {
+ lab11 = false;
+ if (! this.r_un_double$()) {
+ break lab11;
+ }
+ }
+ this.cursor = this.limit - v_9;
+ lab12 = true;
+lab12:
+ while (lab12 === true) {
+ lab12 = false;
+ if (! this.r_un_accent$()) {
+ break lab12;
+ }
+ }
+ cursor$5 = this.cursor = this.limit_backward;
+ v_11 = cursor$5;
+ lab13 = true;
+lab13:
+ while (lab13 === true) {
+ lab13 = false;
+ if (! this.r_postlude$()) {
+ break lab13;
+ }
+ }
+ this.cursor = v_11;
+ return true;
+};
+
+/**
+ * @param {*} o
+ * @return {!boolean}
+ */
+FrenchStemmer.prototype.equals$X = function (o) {
+ return o instanceof FrenchStemmer;
+};
+
+/**
+ * @return {!number}
+ */
+FrenchStemmer.prototype.hashCode$ = function () {
+ /** @type {!string} */
+ var classname;
+ /** @type {!number} */
+ var hash;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var char;
+ classname = "FrenchStemmer";
+ hash = 0;
+ if ("FrenchStemmer".length === 0) {
+ return (hash | 0);
+ }
+ for (i = 0; i < classname.length; i++) {
+ char = classname.charCodeAt(i);
+ hash = (hash << 5) - hash + char;
+ hash = hash & hash;
+ }
+ return (hash | 0);
+};
+
+/**
+ * class Among extends Object
+ * @constructor
+ */
+function Among() {
+}
+
+/**
+ * @constructor
+ * @param {!string} s
+ * @param {!number} substring_i
+ * @param {!number} result
+ */
+function Among$SII(s, substring_i, result) {
+ this.s_size = s.length;
+ this.s = s;
+ this.substring_i = substring_i;
+ this.result = result;
+ this.method = null;
+ this.instance = null;
+};
+
+Among$SII.prototype = new Among;
+
+/**
+ * @constructor
+ * @param {!string} s
+ * @param {!number} substring_i
+ * @param {!number} result
+ * @param {*} method
+ * @param {BaseStemmer} instance
+ */
+function Among$SIIF$LBaseStemmer$B$LBaseStemmer$(s, substring_i, result, method, instance) {
+ this.s_size = s.length;
+ this.s = s;
+ this.substring_i = substring_i;
+ this.result = result;
+ this.method = method;
+ this.instance = instance;
+};
+
+Among$SIIF$LBaseStemmer$B$LBaseStemmer$.prototype = new Among;
+
+/**
+ * class Metadata extends Object
+ * @constructor
+ */
+function Metadata() {
+}
+
+/**
+ * @constructor
+ * @param {Oktavia} parent
+ */
+function Metadata$LOktavia$(parent) {
+ this._parent = parent;
+ this._bitVector = new BitVector$();
+};
+
+Metadata$LOktavia$.prototype = new Metadata;
+
+/**
+ * @return {!number}
+ */
+Metadata.prototype._size$ = function () {
+ /** @type {BitVector} */
+ var this$0;
+ /** @type {!number} */
+ var i$0;
+ /** @type {BitVector} */
+ var _bitVector$0;
+ this$0 = _bitVector$0 = this._bitVector;
+ i$0 = _bitVector$0._size;
+ return this$0.rank$IB(i$0, true);
+};
+
+/**
+ * @param {!number} index
+ * @return {!string}
+ */
+Metadata.prototype.getContent$I = function (index) {
+ /** @type {!number} */
+ var startPosition;
+ /** @type {!number} */
+ var length;
+ if (index < 0 || this._size$() <= index) {
+ throw new Error("Section.getContent() : range error " + (index + ""));
+ }
+ startPosition = 0;
+ if (index > 0) {
+ startPosition = this._bitVector.select$I(index - 1) + 1;
+ }
+ length = this._bitVector.select$I(index) - startPosition + 1;
+ return this._parent._getSubstring$II(startPosition, length);
+};
+
+/**
+ * @param {!number} index
+ * @return {!number}
+ */
+Metadata.prototype.getStartPosition$I = function (index) {
+ /** @type {!number} */
+ var startPosition;
+ if (index < 0 || this._size$() <= index) {
+ throw new Error("Section.getContent() : range error " + (index + ""));
+ }
+ startPosition = 0;
+ if (index > 0) {
+ startPosition = this._bitVector.select$I(index - 1) + 1;
+ }
+ return (startPosition | 0);
+};
+
+/**
+ * @param {SingleResult} result
+ * @param {Array.<undefined|!number>} positions
+ * @param {!string} word
+ * @param {!boolean} stemmed
+ */
+Metadata.prototype.grouping$LSingleResult$AISB = function (result, positions, word, stemmed) {
+};
+
+/**
+ * @param {!number} index
+ * @return {!string}
+ */
+Metadata.prototype.getInformation$I = function (index) {
+ return '';
+};
+
+/**
+ */
+Metadata.prototype._build$ = function () {
+ this._bitVector.build$();
+};
+
+/**
+ * @param {!string} name
+ * @param {!string} data
+ * @param {!number} offset
+ * @return {!number}
+ */
+Metadata.prototype._load$SSI = function (name, data, offset) {
+ offset = this._bitVector.load$SI(data, offset);
+ this._parent._metadataLabels.push(name);
+ this._parent._metadatas[name] = this;
+ return offset;
+};
+
+/**
+ * @return {!string}
+ */
+Metadata.prototype._dump$ = function () {
+ /** @type {BitVector} */
+ var this$0;
+ /** @type {Array.<undefined|!string>} */
+ var contents$0;
+ this$0 = this._bitVector;
+ contents$0 = [ ];
+ contents$0.push(Binary$dump32bitNumber$N(this$0._size));
+ contents$0.push(Binary$dump32bitNumberList$AN(this$0._v));
+ return contents$0.join('');
+};
+
+/**
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+Metadata.prototype._dump$LCompressionReport$ = function (report) {
+ /** @type {BitVector} */
+ var this$0;
+ /** @type {Array.<undefined|!string>} */
+ var contents$0;
+ this$0 = this._bitVector;
+ contents$0 = [ ];
+ contents$0.push(Binary$dump32bitNumber$N(this$0._size));
+ CompressionReport$add$LCompressionReport$II(report, 2, 2);
+ contents$0.push(Binary$dump32bitNumberList$ANLCompressionReport$(this$0._v, report));
+ return contents$0.join('');
+};
+
+/**
+ * class Section extends Metadata
+ * @constructor
+ */
+function Section() {
+}
+
+Section.prototype = new Metadata;
+/**
+ * @constructor
+ * @param {Oktavia} parent
+ */
+function Section$LOktavia$(parent) {
+ this._parent = parent;
+ this._bitVector = new BitVector$();
+ this._names = [ ];
+};
+
+Section$LOktavia$.prototype = new Section;
+
+/**
+ * @param {!string} name
+ */
+Section.prototype.setTail$S = function (name) {
+ /** @type {!number} */
+ var index$0;
+ /** @type {Oktavia} */
+ var this$0;
+ /** @type {FMIndex} */
+ var this$0$0;
+ this$0 = this._parent;
+ this$0$0 = this$0._fmindex;
+ index$0 = this$0$0._substr.length;
+ this._names.push(name);
+ this._bitVector.set$I(index$0 - 1);
+};
+
+/**
+ * @param {!string} name
+ * @param {!number} index
+ */
+Section.prototype.setTail$SI = function (name, index) {
+ this._names.push(name);
+ this._bitVector.set$I(index - 1);
+};
+
+/**
+ * @return {!number}
+ */
+Section.prototype.size$ = function () {
+ return (this._names.length | 0);
+};
+
+/**
+ * @param {!number} position
+ * @return {!number}
+ */
+Section.prototype.getSectionIndex$I = function (position) {
+ /** @type {BitVector} */
+ var this$0;
+ if (position < 0 || this._bitVector.size$() <= position) {
+ throw new Error("Section.getSectionIndex() : range error " + (position + ""));
+ }
+ this$0 = this._bitVector;
+ return this$0.rank$IB(position, true);
+};
+
+/**
+ * @param {!number} index
+ * @return {!string}
+ */
+Section.prototype.getName$I = function (index) {
+ if (index < 0 || this._names.length <= index) {
+ throw new Error("Section.getName() : range error");
+ }
+ return this._names[index];
+};
+
+/**
+ * @param {SingleResult} result
+ * @param {Array.<undefined|!number>} positions
+ * @param {!string} word
+ * @param {!boolean} stemmed
+ */
+Section.prototype.grouping$LSingleResult$AISB = function (result, positions, word, stemmed) {
+ /** @type {!number} */
+ var i;
+ /** @type {undefined|!number} */
+ var position;
+ /** @type {!number} */
+ var index;
+ /** @type {SearchUnit} */
+ var unit;
+ for (i = 0; i < positions.length; i++) {
+ position = positions[i];
+ index = this.getSectionIndex$I(position);
+ unit = SingleResult$getSearchUnit$LSingleResult$I(result, index);
+ if (unit.startPosition < 0) {
+ unit.startPosition = this.getStartPosition$I(index);
+ }
+ SearchUnit$addPosition$LSearchUnit$SIB(unit, word, position - unit.startPosition, stemmed);
+ }
+};
+
+/**
+ * @param {!number} index
+ * @return {!string}
+ */
+Section.prototype.getInformation$I = function (index) {
+ return this.getName$I(index);
+};
+
+/**
+ * @param {Oktavia} parent
+ * @param {!string} name
+ * @param {!string} data
+ * @param {!number} offset
+ * @return {!number}
+ */
+Section._load$LOktavia$SSI = function (parent, name, data, offset) {
+ /** @type {LoadedStringListResult} */
+ var strs;
+ /** @type {Section} */
+ var section;
+ /** @type {!number} */
+ var offset$0;
+ strs = new LoadedStringListResult$SI(data, offset);
+ section = new Section$LOktavia$(parent);
+ section._names = strs.result;
+ offset$0 = strs.offset;
+ offset$0 = section._bitVector.load$SI(data, offset$0);
+ section._parent._metadataLabels.push(name);
+ section._parent._metadatas[name] = section;
+ return offset$0;
+};
+
+var Section$_load$LOktavia$SSI = Section._load$LOktavia$SSI;
+
+/**
+ * @return {!string}
+ */
+Section.prototype._dump$ = function () {
+ return [ Binary$dump16bitNumber$I(0), Binary$dumpStringList$AS(this._names), Metadata.prototype._dump$.call(this) ].join('');
+};
+
+/**
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+Section.prototype._dump$LCompressionReport$ = function (report) {
+ CompressionReport$add$LCompressionReport$II(report, 1, 1);
+ return [ Binary$dump16bitNumber$I(0), Binary$dumpStringList$ASLCompressionReport$(this._names, report), Metadata.prototype._dump$LCompressionReport$.call(this, report) ].join('');
+};
+
+/**
+ * class Splitter extends Metadata
+ * @constructor
+ */
+function Splitter() {
+}
+
+Splitter.prototype = new Metadata;
+/**
+ * @constructor
+ * @param {Oktavia} parent
+ */
+function Splitter$LOktavia$(parent) {
+ this._parent = parent;
+ this._bitVector = new BitVector$();
+ this.name = null;
+};
+
+Splitter$LOktavia$.prototype = new Splitter;
+
+/**
+ * @constructor
+ * @param {Oktavia} parent
+ * @param {!string} name
+ */
+function Splitter$LOktavia$S(parent, name) {
+ this._parent = parent;
+ this._bitVector = new BitVector$();
+ this.name = name;
+};
+
+Splitter$LOktavia$S.prototype = new Splitter;
+
+/**
+ * @return {!number}
+ */
+Splitter.prototype.size$ = function () {
+ /** @type {BitVector} */
+ var this$0$0;
+ /** @type {!number} */
+ var i$0$0;
+ /** @type {BitVector} */
+ var _bitVector$0;
+ this$0$0 = _bitVector$0 = this._bitVector;
+ i$0$0 = _bitVector$0._size;
+ return this$0$0.rank$IB(i$0$0, true);
+};
+
+/**
+ */
+Splitter.prototype.split$ = function () {
+ /** @type {!number} */
+ var index$0;
+ /** @type {Oktavia} */
+ var this$0;
+ /** @type {FMIndex} */
+ var this$0$0;
+ this$0 = this._parent;
+ this$0$0 = this$0._fmindex;
+ index$0 = this$0$0._substr.length;
+ this._bitVector.set$I(index$0 - 1);
+};
+
+/**
+ * @param {!number} index
+ */
+Splitter.prototype.split$I = function (index) {
+ this._bitVector.set$I(index - 1);
+};
+
+/**
+ * @param {!number} position
+ * @return {!number}
+ */
+Splitter.prototype.getIndex$I = function (position) {
+ /** @type {BitVector} */
+ var this$0;
+ if (position < 0 || this._bitVector.size$() <= position) {
+ throw new Error("Section.getSectionIndex() : range error");
+ }
+ this$0 = this._bitVector;
+ return this$0.rank$IB(position, true);
+};
+
+/**
+ * @param {SingleResult} result
+ * @param {Array.<undefined|!number>} positions
+ * @param {!string} word
+ * @param {!boolean} stemmed
+ */
+Splitter.prototype.grouping$LSingleResult$AISB = function (result, positions, word, stemmed) {
+ /** @type {!number} */
+ var i;
+ /** @type {undefined|!number} */
+ var position;
+ /** @type {!number} */
+ var index;
+ /** @type {SearchUnit} */
+ var unit;
+ for (i = 0; i < positions.length; i++) {
+ position = positions[i];
+ index = this.getIndex$I(position);
+ unit = SingleResult$getSearchUnit$LSingleResult$I(result, index);
+ if (unit.startPosition < 0) {
+ unit.startPosition = this.getStartPosition$I(index);
+ }
+ SearchUnit$addPosition$LSearchUnit$SIB(unit, word, position - unit.startPosition, stemmed);
+ }
+};
+
+/**
+ * @param {!number} index
+ * @return {!string}
+ */
+Splitter.prototype.getInformation$I = function (index) {
+ return (this.name != null ? this.name + (index + 1 + "") : '');
+};
+
+/**
+ * @param {Oktavia} parent
+ * @param {!string} name
+ * @param {!string} data
+ * @param {!number} offset
+ * @return {!number}
+ */
+Splitter._load$LOktavia$SSI = function (parent, name, data, offset) {
+ /** @type {Splitter} */
+ var section;
+ section = new Splitter$LOktavia$(parent);
+ offset = section._bitVector.load$SI(data, offset);
+ section._parent._metadataLabels.push(name);
+ section._parent._metadatas[name] = section;
+ return offset;
+};
+
+var Splitter$_load$LOktavia$SSI = Splitter._load$LOktavia$SSI;
+
+/**
+ * @return {!string}
+ */
+Splitter.prototype._dump$ = function () {
+ return [ Binary$dump16bitNumber$I(1), Metadata.prototype._dump$.call(this) ].join('');
+};
+
+/**
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+Splitter.prototype._dump$LCompressionReport$ = function (report) {
+ CompressionReport$add$LCompressionReport$II(report, 1, 1);
+ return [ Binary$dump16bitNumber$I(1), Metadata.prototype._dump$LCompressionReport$.call(this, report) ].join('');
+};
+
+/**
+ * class Table extends Metadata
+ * @constructor
+ */
+function Table() {
+}
+
+Table.prototype = new Metadata;
+/**
+ * @constructor
+ * @param {Oktavia} parent
+ * @param {Array.<undefined|!string>} headers
+ */
+function Table$LOktavia$AS(parent, headers) {
+ this._parent = parent;
+ this._bitVector = new BitVector$();
+ this._headers = headers;
+ this._columnTails = new BitVector$();
+};
+
+Table$LOktavia$AS.prototype = new Table;
+
+/**
+ * @return {!number}
+ */
+Table.prototype.rowSize$ = function () {
+ /** @type {BitVector} */
+ var this$0$0;
+ /** @type {!number} */
+ var i$0$0;
+ /** @type {BitVector} */
+ var _bitVector$0;
+ this$0$0 = _bitVector$0 = this._bitVector;
+ i$0$0 = _bitVector$0._size;
+ return this$0$0.rank$IB(i$0$0, true);
+};
+
+/**
+ * @return {!number}
+ */
+Table.prototype.columnSize$ = function () {
+ return (this._headers.length | 0);
+};
+
+/**
+ */
+Table.prototype.setColumnTail$ = function () {
+ /** @type {!number} */
+ var index;
+ /** @type {Oktavia} */
+ var this$0;
+ /** @type {FMIndex} */
+ var this$0$0;
+ /** @type {Oktavia} */
+ var _parent$0;
+ this$0 = _parent$0 = this._parent;
+ this$0$0 = this$0._fmindex;
+ index = this$0$0._substr.length;
+ _parent$0._fmindex.push$S(Oktavia.eob);
+ this._columnTails.set$I(index - 1);
+};
+
+/**
+ */
+Table.prototype.setRowTail$ = function () {
+ /** @type {!number} */
+ var index;
+ /** @type {Oktavia} */
+ var this$0;
+ /** @type {FMIndex} */
+ var this$0$0;
+ this$0 = this._parent;
+ this$0$0 = this$0._fmindex;
+ index = this$0$0._substr.length;
+ this._bitVector.set$I(index - 1);
+};
+
+/**
+ * @param {!number} position
+ * @return {Array.<undefined|!number>}
+ */
+Table.prototype.getCell$I = function (position) {
+ /** @type {!number} */
+ var row;
+ /** @type {!number} */
+ var currentColumn;
+ /** @type {!number} */
+ var lastRowColumn;
+ /** @type {!number} */
+ var startPosition;
+ /** @type {Array.<undefined|!number>} */
+ var result;
+ /** @type {BitVector} */
+ var this$0;
+ /** @type {BitVector} */
+ var this$1;
+ if (position < 0 || this._bitVector.size$() <= position) {
+ throw new Error("Section.getSectionIndex() : range error " + (position + ""));
+ }
+ this$0 = this._bitVector;
+ row = this$0.rank$IB(position, true);
+ this$1 = this._columnTails;
+ currentColumn = this$1.rank$IB(position, true);
+ lastRowColumn = 0;
+ if (row > 0) {
+ startPosition = this._bitVector.select$I(row - 1) + 1;
+ lastRowColumn = this._columnTails.rank$I(startPosition);
+ }
+ result = [ row, currentColumn - lastRowColumn ];
+ return result;
+};
+
+/**
+ * @param {!number} rowIndex
+ * @return {Object.<string, undefined|!string>}
+ */
+Table.prototype.getRowContent$I = function (rowIndex) {
+ /** @type {!string} */
+ var content;
+ /** @type {Array.<undefined|!string>} */
+ var values;
+ /** @type {Object.<string, undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var i;
+ content = this.getContent$I(rowIndex);
+ values = content.split(Oktavia.eob, this._headers.length);
+ result = ({ });
+ for (i in this._headers) {
+ if (i < values.length) {
+ result[this._headers[i]] = values[i];
+ } else {
+ result[this._headers[i]] = '';
+ }
+ }
+ return result;
+};
+
+/**
+ * @param {SingleResult} result
+ * @param {Array.<undefined|!number>} positions
+ * @param {!string} word
+ * @param {!boolean} stemmed
+ */
+Table.prototype.grouping$LSingleResult$AISB = function (result, positions, word, stemmed) {
+};
+
+/**
+ * @param {!number} index
+ * @return {!string}
+ */
+Table.prototype.getInformation$I = function (index) {
+ return '';
+};
+
+/**
+ */
+Table.prototype._build$ = function () {
+ this._bitVector.build$();
+ this._columnTails.build$();
+};
+
+/**
+ * @param {Oktavia} parent
+ * @param {!string} name
+ * @param {!string} data
+ * @param {!number} offset
+ * @return {!number}
+ */
+Table._load$LOktavia$SSI = function (parent, name, data, offset) {
+ /** @type {LoadedStringListResult} */
+ var strs;
+ /** @type {Table} */
+ var table;
+ /** @type {!number} */
+ var offset$0;
+ strs = new LoadedStringListResult$SI(data, offset);
+ table = new Table$LOktavia$AS(parent, strs.result);
+ offset$0 = strs.offset;
+ offset$0 = table._bitVector.load$SI(data, offset$0);
+ table._parent._metadataLabels.push(name);
+ table._parent._metadatas[name] = table;
+ offset = offset$0;
+ return table._columnTails.load$SI(data, offset$0);
+};
+
+var Table$_load$LOktavia$SSI = Table._load$LOktavia$SSI;
+
+/**
+ * @return {!string}
+ */
+Table.prototype._dump$ = function () {
+ return [ Binary$dump16bitNumber$I(2), Binary$dumpStringList$AS(this._headers), Metadata.prototype._dump$.call(this), this._columnTails.dump$() ].join('');
+};
+
+/**
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+Table.prototype._dump$LCompressionReport$ = function (report) {
+ CompressionReport$add$LCompressionReport$II(report, 1, 1);
+ return [ Binary$dump16bitNumber$I(2), Binary$dumpStringList$ASLCompressionReport$(this._headers, report), Metadata.prototype._dump$LCompressionReport$.call(this, report), this._columnTails.dump$LCompressionReport$(report) ].join('');
+};
+
+/**
+ * class Block extends Metadata
+ * @constructor
+ */
+function Block() {
+}
+
+Block.prototype = new Metadata;
+/**
+ * @constructor
+ * @param {Oktavia} parent
+ */
+function Block$LOktavia$(parent) {
+ this._parent = parent;
+ this._bitVector = new BitVector$();
+ this._names = [ ];
+ this._start = false;
+};
+
+Block$LOktavia$.prototype = new Block;
+
+/**
+ * @param {!string} blockName
+ */
+Block.prototype.startBlock$S = function (blockName) {
+ this.startBlock$SI(blockName, this._parent.contentSize$());
+};
+
+/**
+ * @param {!string} blockName
+ * @param {!number} index
+ */
+Block.prototype.startBlock$SI = function (blockName, index) {
+ if (this._start) {
+ throw new Error('Splitter `' + this._names[this._names.length - 1] + '` is not closed');
+ }
+ this._start = true;
+ this._names.push(blockName);
+ this._bitVector.set$I(index - 1);
+};
+
+/**
+ */
+Block.prototype.endBlock$ = function () {
+ this.endBlock$I(this._parent.contentSize$());
+};
+
+/**
+ * @param {!number} index
+ */
+Block.prototype.endBlock$I = function (index) {
+ if (! this._start) {
+ throw new Error('Splitter is not started');
+ }
+ this._start = false;
+ this._bitVector.set$I(index - 1);
+};
+
+/**
+ * @return {!number}
+ */
+Block.prototype.size$ = function () {
+ return (this._names.length | 0);
+};
+
+/**
+ * @param {!number} position
+ * @return {!number}
+ */
+Block.prototype.blockIndex$I = function (position) {
+ /** @type {!number} */
+ var result;
+ /** @type {BitVector} */
+ var this$0;
+ if (position < 0 || this._parent._fmindex.size$() - 1 <= position) {
+ throw new Error("Block.blockIndex() : range error " + (position + ""));
+ }
+ if (position >= this._bitVector.size$()) {
+ position = (this._bitVector.size$() - 1 | 0);
+ result = (this._bitVector.rank$I(position) + 1 | 0);
+ } else {
+ this$0 = this._bitVector;
+ result = this$0.rank$IB(position, true);
+ }
+ return result;
+};
+
+/**
+ * @param {!number} position
+ * @return {!boolean}
+ */
+Block.prototype.inBlock$I = function (position) {
+ /** @type {!number} */
+ var blockIndex;
+ blockIndex = this.blockIndex$I(position);
+ return blockIndex % 2 !== 0;
+};
+
+/**
+ * @param {!number} position
+ * @return {!string}
+ */
+Block.prototype.getBlockContent$I = function (position) {
+ /** @type {!number} */
+ var blockIndex;
+ /** @type {!string} */
+ var result;
+ blockIndex = this.blockIndex$I(position);
+ if (blockIndex % 2 !== 0) {
+ result = this.getContent$I(blockIndex);
+ } else {
+ result = '';
+ }
+ return result;
+};
+
+/**
+ * @param {!number} position
+ * @return {!string}
+ */
+Block.prototype.getBlockName$I = function (position) {
+ /** @type {!number} */
+ var blockIndex;
+ /** @type {!string} */
+ var result;
+ blockIndex = this.blockIndex$I(position);
+ if (blockIndex % 2 !== 0) {
+ result = this._names[blockIndex >>> 1];
+ } else {
+ result = '';
+ }
+ return result;
+};
+
+/**
+ * @param {SingleResult} result
+ * @param {Array.<undefined|!number>} positions
+ * @param {!string} word
+ * @param {!boolean} stemmed
+ */
+Block.prototype.grouping$LSingleResult$AISB = function (result, positions, word, stemmed) {
+};
+
+/**
+ * @param {!number} index
+ * @return {!string}
+ */
+Block.prototype.getInformation$I = function (index) {
+ return '';
+};
+
+/**
+ * @param {Oktavia} parent
+ * @param {!string} name
+ * @param {!string} data
+ * @param {!number} offset
+ * @return {!number}
+ */
+Block._load$LOktavia$SSI = function (parent, name, data, offset) {
+ /** @type {LoadedStringListResult} */
+ var strs;
+ /** @type {Block} */
+ var block;
+ /** @type {!number} */
+ var offset$0;
+ strs = new LoadedStringListResult$SI(data, offset);
+ block = new Block$LOktavia$(parent);
+ block._names = strs.result;
+ offset$0 = strs.offset;
+ offset$0 = block._bitVector.load$SI(data, offset$0);
+ block._parent._metadataLabels.push(name);
+ block._parent._metadatas[name] = block;
+ return offset$0;
+};
+
+var Block$_load$LOktavia$SSI = Block._load$LOktavia$SSI;
+
+/**
+ * @return {!string}
+ */
+Block.prototype._dump$ = function () {
+ return [ Binary$dump16bitNumber$I(3), Binary$dumpStringList$AS(this._names), Metadata.prototype._dump$.call(this) ].join('');
+};
+
+/**
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+Block.prototype._dump$LCompressionReport$ = function (report) {
+ CompressionReport$add$LCompressionReport$II(report, 1, 1);
+ return [ Binary$dump16bitNumber$I(3), Binary$dumpStringList$ASLCompressionReport$(this._names, report), Metadata.prototype._dump$LCompressionReport$.call(this, report) ].join('');
+};
+
+/**
+ * class FMIndex extends Object
+ * @constructor
+ */
+function FMIndex() {
+}
+
+/**
+ * @constructor
+ */
+function FMIndex$() {
+ /** @type {Array.<undefined|!number>} */
+ var _rlt$0;
+ this._ssize = 0;
+ (this._ddic = 0, this._head = 0);
+ this._substr = "";
+ this._sv = new WaveletMatrix$();
+ this._posdic = [ ];
+ this._idic = [ ];
+ _rlt$0 = this._rlt = [ ];
+ _rlt$0.length = 65536;
+};
+
+FMIndex$.prototype = new FMIndex;
+
+/**
+ */
+FMIndex.prototype.clear$ = function () {
+ /** @type {WaveletMatrix} */
+ var this$0;
+ this$0 = this._sv;
+ this$0._bv.length = 0;
+ this$0._seps.length = 0;
+ this$0._size = 0;
+ this._posdic.length = 0;
+ this._idic.length = 0;
+ this._ddic = 0;
+ this._head = 0;
+ this._substr = "";
+};
+
+/**
+ * @return {!number}
+ */
+FMIndex.prototype.size$ = function () {
+ /** @type {WaveletMatrix} */
+ var this$0;
+ this$0 = this._sv;
+ return this$0._size;
+};
+
+/**
+ * @return {!number}
+ */
+FMIndex.prototype.contentSize$ = function () {
+ return this._substr.length;
+};
+
+/**
+ * @param {!string} key
+ * @return {!number}
+ */
+FMIndex.prototype.getRows$S = function (key) {
+ /** @type {Array.<undefined|!number>} */
+ var pos;
+ pos = [ ];
+ return this.getRows$SAI(key, pos);
+};
+
+/**
+ * @param {!string} key
+ * @param {Array.<undefined|!number>} pos
+ * @return {!number}
+ */
+FMIndex.prototype.getRows$SAI = function (key, pos) {
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var code;
+ /** @type {!number} */
+ var first;
+ /** @type {undefined|!number} */
+ var last;
+ /** @type {!number} */
+ var c;
+ /** @type {Array.<undefined|!number>} */
+ var _rlt$0;
+ i = key.length - 1;
+ code = key.charCodeAt(i);
+ first = (_rlt$0 = this._rlt)[code] + 1;
+ last = _rlt$0[code + 1];
+ while (first <= last) {
+ if (i === 0) {
+ pos[0] = (-- first | 0);
+ pos[1] = -- last;
+ return (last - first + 1 | 0);
+ }
+ i--;
+ c = key.charCodeAt(i);
+ first = this._rlt[c] + this._sv.rank$II(first - 1, c) + 1;
+ last = this._rlt[c] + this._sv.rank$II(last, c);
+ }
+ return 0;
+};
+
+/**
+ * @param {!number} i
+ * @return {!number}
+ */
+FMIndex.prototype.getPosition$I = function (i) {
+ /** @type {!number} */
+ var pos;
+ /** @type {!number} */
+ var c;
+ if (i >= this.size$()) {
+ throw new Error("FMIndex.getPosition() : range error");
+ }
+ pos = 0;
+ while (i !== this._head) {
+ if (i % this._ddic === 0) {
+ pos += this._posdic[i / this._ddic] + 1;
+ break;
+ }
+ c = this._sv.get$I(i);
+ i = this._rlt[c] + this._sv.rank$II(i, c);
+ pos++;
+ }
+ return (pos % this.size$() | 0);
+};
+
+/**
+ * @param {!number} pos
+ * @param {!number} len
+ * @return {!string}
+ */
+FMIndex.prototype.getSubstring$II = function (pos, len) {
+ /** @type {!number} */
+ var pos_end;
+ /** @type {!number} */
+ var pos_tmp;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var pos_idic;
+ /** @type {!string} */
+ var substr;
+ /** @type {!number} */
+ var c;
+ /** @type {!number} */
+ var _ddic$0;
+ if (pos >= this.size$()) {
+ throw new Error("FMIndex.getSubstring() : range error");
+ }
+ pos_end = Math.min(pos + len, this.size$());
+ pos_tmp = this.size$() - 1;
+ i = this._head;
+ pos_idic = Math.floor((pos_end + (_ddic$0 = this._ddic) - 2) / _ddic$0);
+ if (pos_idic < this._idic.length) {
+ pos_tmp = pos_idic * this._ddic;
+ i = this._idic[pos_idic];
+ }
+ substr = "";
+ while (pos_tmp >= pos) {
+ c = this._sv.get$I(i);
+ i = this._rlt[c] + this._sv.rank$II(i, c);
+ if (pos_tmp < pos_end) {
+ substr = String.fromCharCode(c) + substr;
+ }
+ if (pos_tmp === 0) {
+ break;
+ }
+ pos_tmp--;
+ }
+ return substr;
+};
+
+/**
+ */
+FMIndex.prototype.build$ = function () {
+ this.build$SIIB(String.fromCharCode(0), 65535, 20, false);
+};
+
+/**
+ * @param {!string} end_marker
+ * @param {!number} ddic
+ * @param {!boolean} verbose
+ */
+FMIndex.prototype.build$SIB = function (end_marker, ddic, verbose) {
+ this.build$SIIB(end_marker, 65535, ddic, verbose);
+};
+
+/**
+ * @param {!string} end_marker
+ * @param {!number} maxChar
+ * @param {!number} ddic
+ * @param {!boolean} verbose
+ */
+FMIndex.prototype.build$SIIB = function (end_marker, maxChar, ddic, verbose) {
+ /** @type {BurrowsWheelerTransform} */
+ var b;
+ /** @type {!string} */
+ var s;
+ /** @type {!number} */
+ var c;
+ /** @type {!string} */
+ var str$0;
+ /** @type {WaveletMatrix} */
+ var this$0;
+ /** @type {!string} */
+ var _str$0;
+ /** @type {Array.<undefined|!number>} */
+ var _suffixarray$0;
+ if (verbose) {
+ console.time("building burrows-wheeler transform");
+ }
+ this._substr += end_marker;
+ b = ({_str: "", _size: 0, _head: 0, _suffixarray: [ ]});
+ str$0 = this._substr;
+ _str$0 = b._str = str$0;
+ b._size = _str$0.length;
+ _suffixarray$0 = b._suffixarray = SAIS$make$S(str$0);
+ b._head = (_suffixarray$0.indexOf(0) | 0);
+ s = BurrowsWheelerTransform$get$LBurrowsWheelerTransform$(b);
+ this._ssize = s.length;
+ this._head = b._head;
+ b._str = "";
+ b._size = 0;
+ b._head = 0;
+ b._suffixarray.length = 0;
+ this._substr = "";
+ if (verbose) {
+ console.timeEnd("building burrows-wheeler transform");
+ }
+ if (verbose) {
+ console.time("building wavelet matrix");
+ }
+ this$0 = this._sv;
+ this$0._bitsize = (Math.ceil(Math.log(maxChar) / 0.6931471805599453) | 0);
+ if (verbose) {
+ console.log(" maxCharCode: ", maxChar);
+ console.log(" bitSize: ", this._sv.bitsize$());
+ }
+ this._sv.build$S(s);
+ if (verbose) {
+ console.timeEnd("building wavelet matrix");
+ }
+ if (verbose) {
+ console.time("caching rank less than");
+ }
+ for (c = 0; c < maxChar; c++) {
+ this._rlt[c] = this._sv.rank_less_than$II(this._sv.size$(), c);
+ }
+ if (verbose) {
+ console.timeEnd("caching rank less than");
+ }
+ this._ddic = ddic;
+ if (verbose) {
+ console.time("building dictionaries");
+ }
+ this._buildDictionaries$();
+ if (verbose) {
+ console.timeEnd("building dictionaries");
+ console.log('');
+ }
+};
+
+/**
+ */
+FMIndex.prototype._buildDictionaries$ = function () {
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var pos;
+ /** @type {!number} */
+ var c;
+ for (i = 0; i < this._ssize / this._ddic + 1; i++) {
+ this._posdic.push(0);
+ this._idic.push(0);
+ }
+ i = this._head;
+ pos = this.size$() - 1;
+ do {
+ if (i % this._ddic === 0) {
+ this._posdic[Math.floor(i / this._ddic)] = (pos | 0);
+ }
+ if (pos % this._ddic === 0) {
+ this._idic[Math.floor(pos / this._ddic)] = (i | 0);
+ }
+ c = this._sv.get$I(i);
+ i = this._rlt[c] + this._sv.rank$II(i, c);
+ pos--;
+ } while (i !== this._head);
+};
+
+/**
+ * @param {!string} doc
+ */
+FMIndex.prototype.push$S = function (doc) {
+ if (doc.length <= 0) {
+ throw new Error("FMIndex::push(): empty string");
+ }
+ this._substr += doc;
+};
+
+/**
+ * @param {!string} keyword
+ * @return {Array.<undefined|!number>}
+ */
+FMIndex.prototype.search$S = function (keyword) {
+ /** @type {Array.<undefined|!number>} */
+ var result;
+ /** @type {Array.<undefined|!number>} */
+ var position;
+ /** @type {!number} */
+ var rows;
+ /** @type {undefined|!number} */
+ var first;
+ /** @type {undefined|!number} */
+ var last;
+ /** @type {undefined|!number} */
+ var i;
+ result = [ ];
+ position = [ ];
+ rows = this.getRows$SAI(keyword, position);
+ if (rows > 0) {
+ first = position[0];
+ last = position[1];
+ for (i = first; i <= last; i++) {
+ result.push(this.getPosition$I(i));
+ }
+ }
+ return result;
+};
+
+/**
+ * @return {!string}
+ */
+FMIndex.prototype.dump$ = function () {
+ return this.dump$B(false);
+};
+
+/**
+ * @param {!boolean} verbose
+ * @return {!string}
+ */
+FMIndex.prototype.dump$B = function (verbose) {
+ /** @type {Array.<undefined|!string>} */
+ var contents;
+ /** @type {CompressionReport} */
+ var report;
+ /** @type {!number} */
+ var i;
+ contents = [ ];
+ report = ({source: 0, result: 0});
+ contents.push(Binary$dump32bitNumber$N(this._ddic));
+ contents.push(Binary$dump32bitNumber$N(this._ssize));
+ contents.push(Binary$dump32bitNumber$N(this._head));
+ CompressionReport$add$LCompressionReport$II(report, 6, 6);
+ contents.push(this._sv.dump$LCompressionReport$(report));
+ if (verbose) {
+ console.log("Serializing FM-index");
+ console.log(' Wavelet Matrix: ' + (contents[3].length * 2 + "") + ' bytes (' + (Math.round(report.result * 100.0 / report.source) + "") + '%)');
+ }
+ contents.push(Binary$dump32bitNumber$N(this._posdic.length));
+ for (i in this._posdic) {
+ contents.push(Binary$dump32bitNumber$N(this._posdic[i]));
+ }
+ for (i in this._idic) {
+ contents.push(Binary$dump32bitNumber$N(this._idic[i]));
+ }
+ if (verbose) {
+ console.log(' Dictionary Cache: ' + (this._idic.length * 16 + "") + ' bytes');
+ }
+ return contents.join("");
+};
+
+/**
+ * @param {!string} data
+ * @return {!number}
+ */
+FMIndex.prototype.load$S = function (data) {
+ return this.load$SI(data, 0);
+};
+
+/**
+ * @param {!string} data
+ * @param {!number} offset
+ * @return {!number}
+ */
+FMIndex.prototype.load$SI = function (data, offset) {
+ /** @type {!number} */
+ var maxChar;
+ /** @type {!number} */
+ var c;
+ /** @type {!number} */
+ var size;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var result$0;
+ /** @type {!number} */
+ var result$1;
+ result$0 = data.charCodeAt(offset) * 65536 + data.charCodeAt(offset + 1);
+ this._ddic = (result$0 | 0);
+ this._ssize = (Binary$load32bitNumber$SI(data, offset + 2) | 0);
+ this._head = (Binary$load32bitNumber$SI(data, offset + 4) | 0);
+ offset = this._sv.load$SI(data, offset + 6);
+ maxChar = Math.pow(2, this._sv.bitsize$());
+ for (c = 0; c < maxChar; c++) {
+ this._rlt[c] = this._sv.rank_less_than$II(this._sv.size$(), c);
+ }
+ result$1 = data.charCodeAt(offset) * 65536 + data.charCodeAt(offset + 1);
+ size = result$1;
+ offset += 2;
+ for (i = 0; i < size; (i++, offset += 2)) {
+ this._posdic.push(Binary$load32bitNumber$SI(data, offset));
+ }
+ for (i = 0; i < size; (i++, offset += 2)) {
+ this._idic.push(Binary$load32bitNumber$SI(data, offset));
+ }
+ return offset;
+};
+
+/**
+ * class Tag extends Object
+ * @constructor
+ */
+function Tag() {
+}
+
+/**
+ * @constructor
+ * @param {!string} name
+ */
+function Tag$S(name) {
+ this.name = name;
+ this.attributes = ({ });
+ this.isSelfClosing = false;
+};
+
+Tag$S.prototype = new Tag;
+
+/**
+ * class _Common extends Object
+ * @constructor
+ */
+function _Common() {
+}
+
+/**
+ * @constructor
+ */
+function _Common$() {
+};
+
+_Common$.prototype = new _Common;
+
+/**
+ * class _State extends Object
+ * @constructor
+ */
+function _State() {
+}
+
+/**
+ * @constructor
+ */
+function _State$() {
+};
+
+_State$.prototype = new _State;
+
+/**
+ * class SAXHandler extends Object
+ * @constructor
+ */
+function SAXHandler() {
+}
+
+/**
+ * @constructor
+ */
+function SAXHandler$() {
+ this.position = 0;
+ this.column = 0;
+ this.line = 0;
+};
+
+SAXHandler$.prototype = new SAXHandler;
+
+/**
+ * @param {Error} error
+ */
+SAXHandler.prototype.onerror$LError$ = function (error) {
+};
+
+/**
+ * @param {!string} text
+ */
+SAXHandler.prototype.ontext$S = function (text) {
+};
+
+/**
+ * @param {!string} doctype
+ */
+SAXHandler.prototype.ondoctype$S = function (doctype) {
+};
+
+/**
+ * @param {!string} name
+ * @param {!string} body
+ */
+SAXHandler.prototype.onprocessinginstruction$SS = function (name, body) {
+};
+
+/**
+ * @param {!string} sgmlDecl
+ */
+SAXHandler.prototype.onsgmldeclaration$S = function (sgmlDecl) {
+};
+
+/**
+ * @param {!string} tagname
+ * @param {Object.<string, undefined|!string>} attributes
+ */
+SAXHandler.prototype.onopentag$SHS = function (tagname, attributes) {
+};
+
+/**
+ * @param {!string} tagname
+ */
+SAXHandler.prototype.onclosetag$S = function (tagname) {
+};
+
+/**
+ * @param {!string} name
+ * @param {!string} value
+ */
+SAXHandler.prototype.onattribute$SS = function (name, value) {
+};
+
+/**
+ * @param {!string} comment
+ */
+SAXHandler.prototype.oncomment$S = function (comment) {
+};
+
+/**
+ */
+SAXHandler.prototype.onopencdata$ = function () {
+};
+
+/**
+ * @param {!string} cdata
+ */
+SAXHandler.prototype.oncdata$S = function (cdata) {
+};
+
+/**
+ */
+SAXHandler.prototype.onclosecdata$ = function () {
+};
+
+/**
+ */
+SAXHandler.prototype.onend$ = function () {
+};
+
+/**
+ */
+SAXHandler.prototype.onready$ = function () {
+};
+
+/**
+ * @param {!string} script
+ */
+SAXHandler.prototype.onscript$S = function (script) {
+};
+
+/**
+ * class _HTMLHandler extends SAXHandler
+ * @constructor
+ */
+function _HTMLHandler() {
+}
+
+_HTMLHandler.prototype = new SAXHandler;
+/**
+ * @constructor
+ * @param {Object.<string, undefined|Array.<undefined|!string>>} styles
+ * @param {!boolean} escape
+ */
+function _HTMLHandler$HASB(styles, escape) {
+ this.position = 0;
+ this.column = 0;
+ this.line = 0;
+ this.text = [ ];
+ this.escape = escape;
+ this.styles = styles;
+};
+
+_HTMLHandler$HASB.prototype = new _HTMLHandler;
+
+/**
+ * @param {!string} str
+ * @return {!string}
+ */
+_HTMLHandler.escapeHTML$S = function (str) {
+ return str.replace(/\n/g, "<br/>").replace(/&/g, "&amp;").replace(/"/g, "&quot;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
+};
+
+var _HTMLHandler$escapeHTML$S = _HTMLHandler.escapeHTML$S;
+
+/**
+ * @param {!string} tagname
+ * @param {Object.<string, undefined|!string>} attributes
+ */
+_HTMLHandler.prototype.onopentag$SHS = function (tagname, attributes) {
+ this.text.push(this.styles[tagname][0]);
+};
+
+/**
+ * @param {!string} tagname
+ */
+_HTMLHandler.prototype.onclosetag$S = function (tagname) {
+ this.text.push(this.styles[tagname][1]);
+};
+
+/**
+ * @param {!string} text
+ */
+_HTMLHandler.prototype.ontext$S = function (text) {
+ if (this.escape) {
+ this.text.push(text.replace(/\n/g, "<br/>").replace(/&/g, "&amp;").replace(/"/g, "&quot;").replace(/</g, "&lt;").replace(/>/g, "&gt;"));
+ } else {
+ this.text.push(text);
+ }
+};
+
+/**
+ * @return {!string}
+ */
+_HTMLHandler.prototype.result$ = function () {
+ return this.text.join('');
+};
+
+/**
+ * class SAXParser extends Object
+ * @constructor
+ */
+function SAXParser() {
+}
+
+/**
+ * @constructor
+ * @param {SAXHandler} handler
+ */
+function SAXParser$LSAXHandler$(handler) {
+ this.q = "";
+ this.c = "";
+ this.bufferCheckPosition = 0;
+ this.looseCase = "";
+ this.tags = [ ];
+ this.closed = false;
+ this.closedRoot = false;
+ this.sawRoot = false;
+ this.tag = null;
+ this.error = null;
+ this.handler = null;
+ this.ENTITIES = null;
+ this.strict = false;
+ this.tagName = "";
+ this.state = 0;
+ this.line = 0;
+ this.column = 0;
+ this.position = 0;
+ this.startTagPosition = 0;
+ this.attribName = "";
+ this.attribValue = "";
+ this.script = "";
+ this.textNode = "";
+ this.attribList = null;
+ this.noscript = false;
+ this.cdata = "";
+ this.procInstBody = "";
+ this.procInstName = "";
+ this.doctype = "";
+ this.entity = "";
+ this.sgmlDecl = "";
+ this.comment = "";
+ this.preTags = 0;
+ this._init$LSAXHandler$B(handler, false);
+};
+
+SAXParser$LSAXHandler$.prototype = new SAXParser;
+
+/**
+ * @constructor
+ * @param {SAXHandler} handler
+ * @param {!boolean} strict
+ */
+function SAXParser$LSAXHandler$B(handler, strict) {
+ this.q = "";
+ this.c = "";
+ this.bufferCheckPosition = 0;
+ this.looseCase = "";
+ this.tags = [ ];
+ this.closed = false;
+ this.closedRoot = false;
+ this.sawRoot = false;
+ this.tag = null;
+ this.error = null;
+ this.handler = null;
+ this.ENTITIES = null;
+ this.strict = false;
+ this.tagName = "";
+ this.state = 0;
+ this.line = 0;
+ this.column = 0;
+ this.position = 0;
+ this.startTagPosition = 0;
+ this.attribName = "";
+ this.attribValue = "";
+ this.script = "";
+ this.textNode = "";
+ this.attribList = null;
+ this.noscript = false;
+ this.cdata = "";
+ this.procInstBody = "";
+ this.procInstName = "";
+ this.doctype = "";
+ this.entity = "";
+ this.sgmlDecl = "";
+ this.comment = "";
+ this.preTags = 0;
+ this._init$LSAXHandler$B(handler, strict);
+};
+
+SAXParser$LSAXHandler$B.prototype = new SAXParser;
+
+/**
+ * @param {SAXHandler} handler
+ * @param {!boolean} strict
+ */
+SAXParser.prototype._init$LSAXHandler$B = function (handler, strict) {
+ this.handler = handler;
+ this.clearBuffers$();
+ this.q = "";
+ this.bufferCheckPosition = 65536;
+ this.looseCase = 'toLowerCase';
+ this.tags = [ ];
+ this.closed = this.closedRoot = this.sawRoot = false;
+ this.tag = null;
+ this.error = null;
+ this.strict = strict;
+ this.noscript = strict;
+ this.state = 1;
+ this.ENTITIES = _Entities$entity_list$();
+ this.attribList = [ ];
+ this.noscript = false;
+ this.preTags = 0;
+};
+
+/**
+ * @param {!boolean} flag
+ */
+SAXParser.prototype.set_noscript$B = function (flag) {
+ this.noscript = flag;
+};
+
+/**
+ * @return {SAXParser}
+ */
+SAXParser.prototype.resume$ = function () {
+ this.error = null;
+ return this;
+};
+
+/**
+ * @return {SAXParser}
+ */
+SAXParser.prototype.close$ = function () {
+ return this.parse$S('');
+};
+
+/**
+ * @param {!string} chunk
+ * @return {SAXParser}
+ */
+SAXParser.prototype.parse$S = function (chunk) {
+ /** @type {Char} */
+ var _;
+ /** @type {!number} */
+ var i;
+ /** @type {!string} */
+ var c;
+ /** @type {!number} */
+ var starti;
+ /** @type {!number} */
+ var pad;
+ /** @type {!number} */
+ var returnState;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$0;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$1;
+ /** @type {RegExp} */
+ var charclass$2;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$3;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$4;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$5;
+ /** @type {!string} */
+ var text$0;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$6;
+ /** @type {RegExp} */
+ var charclass$7;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$8;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$9;
+ /** @type {RegExp} */
+ var charclass$10;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$11;
+ /** @type {RegExp} */
+ var charclass$12;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$13;
+ /** @type {RegExp} */
+ var charclass$14;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$15;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$16;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$17;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$18;
+ /** @type {RegExp} */
+ var charclass$19;
+ /** @type {RegExp} */
+ var charclass$20;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$21;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$22;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$23;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$24;
+ /** @type {!string} */
+ var comment$0;
+ _ = new Char$();
+ if (this.error) {
+ throw this.error;
+ }
+ if (this.closed) {
+ return this.emiterror$S("Cannot write after close. Assign an onready handler.");
+ }
+ (i = 0, c = "");
+ while (this.c = c = chunk.charAt(i++)) {
+ this.position++;
+ if (c === "\n") {
+ this.handler.line++;
+ this.handler.column = 0;
+ } else {
+ this.handler.column++;
+ }
+ switch (this.state) {
+ case 1:
+ if (c === "<") {
+ this.state = 4;
+ this.startTagPosition = this.position;
+ } else {
+ charclass$0 = _.whitespace;
+ if (! $__jsx_ObjectHasOwnProperty.call(charclass$0, c)) {
+ this.strictFail$S("Non-whitespace before first tag.");
+ this.textNode = c;
+ this.state = 2;
+ }
+ }
+ continue;
+ case 2:
+ if (this.sawRoot && ! this.closedRoot) {
+ starti = i - 1;
+ while (c && c !== "<" && c !== "&") {
+ c = chunk.charAt(i++);
+ if (c) {
+ this.position++;
+ if (c === "\n") {
+ this.handler.line++;
+ this.handler.column = 0;
+ } else {
+ this.handler.column++;
+ }
+ }
+ }
+ this.textNode += chunk.substring(starti, i - 1);
+ }
+ if (c === "<") {
+ this.state = 4;
+ this.startTagPosition = this.position;
+ } else {
+ if (_.not$HBS(_.whitespace, c) && (! this.sawRoot || this.closedRoot)) {
+ this.strictFail$S("Text data outside of root node.");
+ }
+ if (c === "&") {
+ this.state = 3;
+ } else {
+ this.textNode += c;
+ }
+ }
+ continue;
+ case 33:
+ if (c === "<") {
+ this.state = 34;
+ } else {
+ this.script += c;
+ }
+ continue;
+ case 34:
+ if (c === "/") {
+ this.state = 31;
+ } else {
+ this.script += "<" + c;
+ this.state = 33;
+ }
+ continue;
+ case 4:
+ if (c === "!") {
+ this.state = 5;
+ this.sgmlDecl = "";
+ } else {
+ charclass$1 = _.whitespace;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$1, c)) {
+ } else {
+ charclass$2 = _.nameStart;
+ if (charclass$2.test(c)) {
+ this.state = 21;
+ this.tagName = c;
+ } else {
+ if (c === "/") {
+ this.state = 31;
+ this.tagName = "";
+ } else {
+ if (c === "?") {
+ this.state = 18;
+ this.procInstName = this.procInstBody = "";
+ } else {
+ this.strictFail$S("Unencoded <");
+ if (this.startTagPosition + 1 < this.position) {
+ pad = this.position - this.startTagPosition;
+ for (i = 0; i < pad; i++) {
+ c = " " + c;
+ }
+ }
+ this.textNode += "<" + c;
+ this.state = 2;
+ }
+ }
+ }
+ }
+ }
+ continue;
+ case 5:
+ if ((this.sgmlDecl + c).toUpperCase() === _.CDATA) {
+ this.closetext_if_exist$();
+ this.state = 15;
+ this.sgmlDecl = "";
+ this.cdata = "";
+ } else {
+ if (this.sgmlDecl + c === "--") {
+ this.state = 12;
+ this.comment = "";
+ this.sgmlDecl = "";
+ } else {
+ if ((this.sgmlDecl + c).toUpperCase() === _.DOCTYPE) {
+ this.state = 7;
+ if (this.doctype || this.sawRoot) {
+ this.strictFail$S("Inappropriately located doctype declaration");
+ }
+ this.doctype = "";
+ this.sgmlDecl = "";
+ } else {
+ if (c === ">") {
+ this.closetext_if_exist$();
+ this.sgmlDecl = "";
+ this.state = 2;
+ } else {
+ charclass$3 = _.quote;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$3, c)) {
+ this.state = 6;
+ this.sgmlDecl += c;
+ } else {
+ this.sgmlDecl += c;
+ }
+ }
+ }
+ }
+ }
+ continue;
+ case 6:
+ if (c === this.q) {
+ this.state = 5;
+ this.q = "";
+ }
+ this.sgmlDecl += c;
+ continue;
+ case 7:
+ if (c === ">") {
+ this.state = 2;
+ this.closetext_if_exist$();
+ this.doctype.trim();
+ } else {
+ this.doctype += c;
+ if (c === "[") {
+ this.state = 9;
+ } else {
+ charclass$4 = _.quote;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$4, c)) {
+ this.state = 8;
+ this.q = c;
+ }
+ }
+ }
+ continue;
+ case 8:
+ this.doctype += c;
+ if (c === this.q) {
+ this.q = "";
+ this.state = 7;
+ }
+ continue;
+ case 9:
+ this.doctype += c;
+ if (c === "]") {
+ this.state = 7;
+ } else {
+ charclass$5 = _.quote;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$5, c)) {
+ this.state = 10;
+ this.q = c;
+ }
+ }
+ continue;
+ case 10:
+ this.doctype += c;
+ if (c === this.q) {
+ this.state = 9;
+ this.q = "";
+ }
+ continue;
+ case 12:
+ if (c === "-") {
+ this.state = 13;
+ } else {
+ this.comment += c;
+ }
+ continue;
+ case 13:
+ if (c === "-") {
+ this.state = 14;
+ text$0 = this.comment;
+ text$0 = text$0.replace(/[\n\t]/g, ' ');
+ text$0 = text$0.replace(/\s\s+/g, " ");
+ comment$0 = this.comment = text$0;
+ if (comment$0) {
+ this.closetext_if_exist$();
+ this.comment.trim();
+ }
+ this.comment = "";
+ } else {
+ this.comment += "-" + c;
+ this.state = 12;
+ }
+ continue;
+ case 14:
+ if (c !== ">") {
+ this.strictFail$S("Malformed comment");
+ this.comment += "--" + c;
+ this.state = 12;
+ } else {
+ this.state = 2;
+ }
+ continue;
+ case 15:
+ if (c === "]") {
+ this.state = 16;
+ } else {
+ this.cdata += c;
+ }
+ continue;
+ case 16:
+ if (c === "]") {
+ this.state = 17;
+ } else {
+ this.cdata += "]" + c;
+ this.state = 15;
+ }
+ continue;
+ case 17:
+ if (c === ">") {
+ if (this.cdata) {
+ this.closetext_if_exist$();
+ }
+ this.cdata = "";
+ this.state = 2;
+ } else {
+ if (c === "]") {
+ this.cdata += "]";
+ } else {
+ this.cdata += "]]" + c;
+ this.state = 15;
+ }
+ }
+ continue;
+ case 18:
+ if (c === "?") {
+ this.state = 20;
+ } else {
+ charclass$6 = _.whitespace;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$6, c)) {
+ this.state = 19;
+ } else {
+ this.procInstName += c;
+ }
+ }
+ continue;
+ case 19:
+ if (! this.procInstBody && _.is$HBS(_.whitespace, c)) {
+ continue;
+ } else {
+ if (c === "?") {
+ this.state = 20;
+ } else {
+ this.procInstBody += c;
+ }
+ }
+ continue;
+ case 20:
+ if (c === ">") {
+ this.closetext_if_exist$();
+ this.procInstName = this.procInstBody = "";
+ this.state = 2;
+ } else {
+ this.procInstBody += "?" + c;
+ this.state = 19;
+ }
+ continue;
+ case 21:
+ charclass$7 = _.nameBody;
+ if (charclass$7.test(c)) {
+ this.tagName += c;
+ } else {
+ this.newTag$();
+ if (c === ">") {
+ this.openTag$B(false);
+ } else {
+ if (c === "/") {
+ this.state = 22;
+ } else {
+ charclass$8 = _.whitespace;
+ if (! $__jsx_ObjectHasOwnProperty.call(charclass$8, c)) {
+ this.strictFail$S("Invalid character in tag name");
+ }
+ this.state = 23;
+ }
+ }
+ }
+ continue;
+ case 22:
+ if (c === ">") {
+ this.openTag$B(true);
+ this.closeTag$();
+ } else {
+ this.strictFail$S("Forward-slash in opening tag not followed by >");
+ this.state = 23;
+ }
+ continue;
+ case 23:
+ charclass$9 = _.whitespace;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$9, c)) {
+ continue;
+ } else {
+ if (c === ">") {
+ this.openTag$B(false);
+ } else {
+ if (c === "/") {
+ this.state = 22;
+ } else {
+ charclass$10 = _.nameStart;
+ if (charclass$10.test(c)) {
+ this.attribName = c;
+ this.attribValue = "";
+ this.state = 24;
+ } else {
+ this.strictFail$S("Invalid attribute name");
+ }
+ }
+ }
+ }
+ continue;
+ case 24:
+ if (c === "=") {
+ this.state = 26;
+ } else {
+ if (c === ">") {
+ this.strictFail$S("Attribute without value");
+ this.attribValue = this.attribName;
+ this.attrib$();
+ this.openTag$B(false);
+ } else {
+ charclass$11 = _.whitespace;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$11, c)) {
+ this.state = 25;
+ } else {
+ charclass$12 = _.nameBody;
+ if (charclass$12.test(c)) {
+ this.attribName += c;
+ } else {
+ this.strictFail$S("Invalid attribute name");
+ }
+ }
+ }
+ }
+ continue;
+ case 25:
+ if (c === "=") {
+ this.state = 26;
+ } else {
+ charclass$13 = _.whitespace;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$13, c)) {
+ continue;
+ } else {
+ this.strictFail$S("Attribute without value");
+ this.tag.attributes[this.attribName] = "";
+ this.attribValue = "";
+ this.closetext_if_exist$();
+ this.attribName = "";
+ if (c === ">") {
+ this.openTag$B(false);
+ } else {
+ charclass$14 = _.nameStart;
+ if (charclass$14.test(c)) {
+ this.attribName = c;
+ this.state = 24;
+ } else {
+ this.strictFail$S("Invalid attribute name");
+ this.state = 23;
+ }
+ }
+ }
+ }
+ continue;
+ case 26:
+ charclass$15 = _.whitespace;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$15, c)) {
+ continue;
+ } else {
+ charclass$16 = _.quote;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$16, c)) {
+ this.q = c;
+ this.state = 27;
+ } else {
+ this.strictFail$S("Unquoted attribute value");
+ this.state = 28;
+ this.attribValue = c;
+ }
+ }
+ continue;
+ case 27:
+ if (c !== this.q) {
+ if (c === "&") {
+ this.state = 29;
+ } else {
+ this.attribValue += c;
+ }
+ continue;
+ }
+ this.attrib$();
+ this.q = "";
+ this.state = 23;
+ continue;
+ case 28:
+ charclass$17 = _.attribEnd;
+ if (! $__jsx_ObjectHasOwnProperty.call(charclass$17, c)) {
+ if (c === "&") {
+ this.state = 30;
+ } else {
+ this.attribValue += c;
+ }
+ continue;
+ }
+ this.attrib$();
+ if (c === ">") {
+ this.openTag$B(false);
+ } else {
+ this.state = 23;
+ }
+ continue;
+ case 31:
+ if (! this.tagName) {
+ charclass$18 = _.whitespace;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$18, c)) {
+ continue;
+ } else {
+ charclass$19 = _.nameStart;
+ if (! charclass$19.test(c)) {
+ if (this.script) {
+ this.script += "</" + c;
+ this.state = 33;
+ } else {
+ this.strictFail$S("Invalid tagname in closing tag.");
+ }
+ } else {
+ this.tagName = c;
+ }
+ }
+ } else {
+ if (c === ">") {
+ this.closeTag$();
+ } else {
+ charclass$20 = _.nameBody;
+ if (charclass$20.test(c)) {
+ this.tagName += c;
+ } else {
+ if (this.script) {
+ this.script += "</" + this.tagName;
+ this.tagName = "";
+ this.state = 33;
+ } else {
+ charclass$21 = _.whitespace;
+ if (! $__jsx_ObjectHasOwnProperty.call(charclass$21, c)) {
+ this.strictFail$S("Invalid tagname in closing tag");
+ }
+ this.state = 32;
+ }
+ }
+ }
+ }
+ continue;
+ case 32:
+ charclass$22 = _.whitespace;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$22, c)) {
+ continue;
+ }
+ if (c === ">") {
+ this.closeTag$();
+ } else {
+ this.strictFail$S("Invalid characters in closing tag");
+ }
+ continue;
+ case 3:
+ if (c === ";") {
+ this.textNode += this.parseEntity$();
+ this.entity = "";
+ this.state = 2;
+ } else {
+ charclass$23 = _.entity;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$23, c)) {
+ this.entity += c;
+ } else {
+ this.strictFail$S("Invalid character entity");
+ this.textNode += "&" + this.entity + c;
+ this.entity = "";
+ this.state = 2;
+ }
+ }
+ continue;
+ case 29:
+ case 30:
+ if (this.state === 29) {
+ returnState = 27;
+ } else {
+ returnState = 28;
+ }
+ if (c === ";") {
+ this.attribValue += this.parseEntity$();
+ this.entity = "";
+ this.state = (returnState | 0);
+ } else {
+ charclass$24 = _.entity;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$24, c)) {
+ this.entity += c;
+ } else {
+ this.strictFail$S("Invalid character entity");
+ this.attribValue += "&" + this.entity + c;
+ this.entity = "";
+ this.state = (returnState | 0);
+ }
+ }
+ continue;
+ default:
+ throw new Error("Unknown state: " + (this.state + ""));
+ }
+ }
+ this.end$();
+ return this;
+};
+
+/**
+ */
+SAXParser.prototype.clearBuffers$ = function () {
+ this.comment = '';
+ this.sgmlDecl = '';
+ this.textNode = '';
+ this.tagName = '';
+ this.doctype = '';
+ this.procInstName = '';
+ this.procInstBody = '';
+ this.entity = '';
+ this.attribName = '';
+ this.attribValue = '';
+ this.cdata = '';
+ this.script = '';
+};
+
+/**
+ */
+SAXParser.prototype.closetext_if_exist$ = function () {
+ if (this.textNode !== '') {
+ this.closetext$();
+ }
+};
+
+/**
+ */
+SAXParser.prototype.closetext$ = function () {
+ /** @type {!string} */
+ var text;
+ /** @type {!string} */
+ var text$0;
+ if (this.preTags === 0) {
+ text$0 = this.textNode;
+ text$0 = text$0.replace(/[\n\t]/g, ' ');
+ text$0 = text$0.replace(/\s\s+/g, " ");
+ text = text$0;
+ if (text$0) {
+ this.handler.ontext$S(text);
+ }
+ } else {
+ if (this.textNode) {
+ this.handler.ontext$S(this.textNode);
+ }
+ }
+ this.textNode = "";
+};
+
+/**
+ * @param {!string} text
+ * @return {!string}
+ */
+SAXParser.prototype.textopts$S = function (text) {
+ text = text.replace(/[\n\t]/g, ' ');
+ text = text.replace(/\s\s+/g, " ");
+ return text;
+};
+
+/**
+ * @param {!string} er
+ * @return {SAXParser}
+ */
+SAXParser.prototype.emiterror$S = function (er) {
+ /** @type {Error} */
+ var error;
+ this.closetext$();
+ er += "\nLine: " + (this.line + "") + "\nColumn: " + (this.column + "") + "\nChar: " + this.c;
+ error = new Error(er);
+ this.error = error;
+ return this;
+};
+
+/**
+ */
+SAXParser.prototype.end$ = function () {
+ if (! this.closedRoot) {
+ this.strictFail$S("Unclosed root tag");
+ }
+ if (this.state !== 2) {
+ this.emiterror$S("Unexpected end");
+ }
+ this.closetext$();
+ this.c = "";
+ this.closed = true;
+};
+
+/**
+ * @param {!string} message
+ */
+SAXParser.prototype.strictFail$S = function (message) {
+ if (this.strict) {
+ this.emiterror$S(message);
+ }
+};
+
+/**
+ */
+SAXParser.prototype.newTag$ = function () {
+ if (! this.strict) {
+ this.tagName = this.tagName.toLowerCase();
+ }
+ this.tag = ({name: this.tagName, attributes: ({ }), isSelfClosing: false});
+ this.attribList.length = 0;
+};
+
+/**
+ */
+SAXParser.prototype.attrib$ = function () {
+ if (! this.strict) {
+ this.attribName = this.attribName.toLowerCase();
+ }
+ if ($__jsx_ObjectHasOwnProperty.call(this.tag.attributes, this.attribName)) {
+ this.attribName = this.attribValue = "";
+ return;
+ }
+ this.tag.attributes[this.attribName] = this.attribValue;
+ this.closetext_if_exist$();
+ this.attribName = this.attribValue = "";
+};
+
+/**
+ */
+SAXParser.prototype.openTag$ = function () {
+ this.openTag$B(false);
+};
+
+/**
+ * @param {!boolean} selfClosing
+ */
+SAXParser.prototype.openTag$B = function (selfClosing) {
+ /** @type {Tag} */
+ var tag$0;
+ /** @type {Tag} */
+ var tag$1;
+ (tag$0 = this.tag).isSelfClosing = selfClosing;
+ this.sawRoot = true;
+ this.tags.push(tag$0);
+ this.closetext_if_exist$();
+ this.handler.onopentag$SHS((tag$1 = this.tag).name, tag$1.attributes);
+ if (this.tag.name === 'pre') {
+ this.preTags++;
+ }
+ if (! selfClosing) {
+ if (! this.noscript && this.tagName.toLowerCase() === "script") {
+ this.state = 33;
+ } else {
+ this.state = 2;
+ }
+ this.tag = null;
+ this.tagName = "";
+ }
+ this.attribName = this.attribValue = "";
+ this.attribList.length = 0;
+};
+
+/**
+ */
+SAXParser.prototype.closeTag$ = function () {
+ /** @type {!number} */
+ var t;
+ /** @type {!string} */
+ var tagName;
+ /** @type {!string} */
+ var closeTo;
+ /** @type {Tag} */
+ var close;
+ /** @type {!number} */
+ var s;
+ /** @type {Tag} */
+ var tag$0;
+ if (! this.tagName) {
+ this.strictFail$S("Weird empty close tag.");
+ this.textNode += "</>";
+ this.state = 2;
+ return;
+ }
+ if (this.script) {
+ if (this.tagName !== "script") {
+ this.script += "</" + this.tagName + ">";
+ this.tagName = "";
+ this.state = 33;
+ return;
+ }
+ this.closetext_if_exist$();
+ this.script = "";
+ }
+ t = this.tags.length;
+ tagName = this.tagName;
+ if (! this.strict) {
+ tagName = tagName.toLowerCase();
+ }
+ closeTo = tagName;
+ while (t--) {
+ close = this.tags[t];
+ if (close.name !== closeTo) {
+ this.strictFail$S("Unexpected close tag");
+ } else {
+ break;
+ }
+ }
+ if (t < 0) {
+ this.strictFail$S("Unmatched closing tag: " + this.tagName);
+ this.textNode += "</" + this.tagName + ">";
+ this.state = 2;
+ return;
+ }
+ this.tagName = tagName;
+ s = this.tags.length;
+ while (s-- > t) {
+ tag$0 = this.tag = this.tags.pop();
+ this.tagName = tag$0.name;
+ this.closetext_if_exist$();
+ this.handler.onclosetag$S(this.tagName);
+ if (this.tagName === 'pre') {
+ this.preTags--;
+ }
+ }
+ if (t === 0) {
+ this.closedRoot = true;
+ }
+ this.tagName = this.attribValue = this.attribName = "";
+ this.attribList.length = 0;
+ this.state = 2;
+};
+
+/**
+ * @return {!string}
+ */
+SAXParser.prototype.parseEntity$ = function () {
+ /** @type {!string} */
+ var entity;
+ /** @type {!string} */
+ var entityLC;
+ /** @type {!number} */
+ var num;
+ /** @type {!string} */
+ var numStr;
+ entity = this.entity;
+ entityLC = entity.toLowerCase();
+ num = 0;
+ numStr = "";
+ if (this.ENTITIES[entity]) {
+ return this.ENTITIES[entity];
+ }
+ if (this.ENTITIES[entityLC]) {
+ return this.ENTITIES[entityLC];
+ }
+ entity = entityLC;
+ if (entityLC.charAt(0) === "#") {
+ if (entity.charAt(1) === "x") {
+ entity = entity.slice(2);
+ num = $__jsx_parseInt(entity, 16);
+ numStr = num.toString(16);
+ } else {
+ entity = entity.slice(1);
+ num = $__jsx_parseInt(entity, 10);
+ numStr = num.toString(10);
+ }
+ }
+ entity = entity.replace(/^0+/, "");
+ if (numStr.toLowerCase() !== entity) {
+ this.strictFail$S("Invalid character entity");
+ return "&" + this.entity + ";";
+ }
+ return String.fromCharCode(num);
+};
+
+/**
+ * class Char extends Object
+ * @constructor
+ */
+function Char() {
+}
+
+/**
+ * @constructor
+ */
+function Char$() {
+ this.CDATA = "[CDATA[";
+ this.DOCTYPE = "DOCTYPE";
+ this.XML_NAMESPACE = "http://www.w3.org/XML/1998/namespace";
+ this.whitespace = this._charClass$S("\r\n\t ");
+ this.number = this._charClass$S("0124356789");
+ this.letter = this._charClass$S("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ");
+ this.quote = this._charClass$S("'\"");
+ this.entity = this._charClass$S("0124356789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ#");
+ this.attribEnd = this._charClass$S("\r\n\t >");
+ this.nameStart = /[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/;
+ this.nameBody = /[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040\.\d-]/;
+};
+
+Char$.prototype = new Char;
+
+/**
+ * @param {!string} str
+ * @return {Object.<string, undefined|!boolean>}
+ */
+Char.prototype._charClass$S = function (str) {
+ /** @type {Object.<string, undefined|!boolean>} */
+ var result;
+ /** @type {!number} */
+ var i;
+ result = ({ });
+ for (i = 0; i < str.length; i++) {
+ result[str.slice(i, i + 1)] = true;
+ }
+ return result;
+};
+
+/**
+ * @param {RegExp} charclass
+ * @param {!string} c
+ * @return {!boolean}
+ */
+Char.prototype.is$LRegExp$S = function (charclass, c) {
+ return charclass.test(c);
+};
+
+/**
+ * @param {Object.<string, undefined|!boolean>} charclass
+ * @param {!string} c
+ * @return {!boolean}
+ */
+Char.prototype.is$HBS = function (charclass, c) {
+ return $__jsx_ObjectHasOwnProperty.call(charclass, c);
+};
+
+/**
+ * @param {RegExp} charclass
+ * @param {!string} c
+ * @return {!boolean}
+ */
+Char.prototype.not$LRegExp$S = function (charclass, c) {
+ return ! charclass.test(c);
+};
+
+/**
+ * @param {Object.<string, undefined|!boolean>} charclass
+ * @param {!string} c
+ * @return {!boolean}
+ */
+Char.prototype.not$HBS = function (charclass, c) {
+ return ! $__jsx_ObjectHasOwnProperty.call(charclass, c);
+};
+
+/**
+ * class _Entities extends Object
+ * @constructor
+ */
+function _Entities() {
+}
+
+/**
+ * @constructor
+ */
+function _Entities$() {
+};
+
+_Entities$.prototype = new _Entities;
+
+/**
+ * @return {Object.<string, undefined|!string>}
+ */
+_Entities.entity_list$ = function () {
+ /** @type {Object.<string, undefined|!string>} */
+ var result;
+ /** @type {!string} */
+ var key;
+ /** @type {*} */
+ var value;
+ result = ({ });
+ for (key in _Entities._entities) {
+ value = _Entities._entities[key];
+ if (typeof value === 'string') {
+ result[key] = value + "";
+ } else {
+ if (typeof value === 'number') {
+ result[key] = String.fromCharCode(value | 0);
+ }
+ }
+ }
+ return result;
+};
+
+var _Entities$entity_list$ = _Entities.entity_list$;
+
+/**
+ * class BitVector extends Object
+ * @constructor
+ */
+function BitVector() {
+}
+
+/**
+ * @constructor
+ */
+function BitVector$() {
+ /** @type {Array.<undefined|!number>} */
+ var _v$0;
+ /** @type {Array.<undefined|!number>} */
+ var _r$0;
+ _r$0 = this._r = [ ];
+ _v$0 = this._v = [ ];
+ _v$0.length = 0;
+ _r$0.length = 0;
+ this._size = 0;
+ this._size1 = 0;
+};
+
+BitVector$.prototype = new BitVector;
+
+/**
+ */
+BitVector.prototype.build$ = function () {
+ /** @type {!number} */
+ var i;
+ this._size1 = 0;
+ for (i = 0; i < this._v.length; i++) {
+ if (i % 8 === 0) {
+ this._r.push(true ? this._size1 : this._size - this._size1);
+ }
+ this._size1 += this._rank32$IIB(this._v[i], 32, true);
+ }
+};
+
+/**
+ */
+BitVector.prototype.clear$ = function () {
+ this._v.length = 0;
+ this._r.length = 0;
+ this._size = 0;
+ this._size1 = 0;
+};
+
+/**
+ * @return {!number}
+ */
+BitVector.prototype.size$ = function () {
+ return this._size;
+};
+
+/**
+ * @param {!boolean} b
+ * @return {!number}
+ */
+BitVector.prototype.size$B = function (b) {
+ return (b ? this._size1 : this._size - this._size1);
+};
+
+/**
+ * @param {!number} value
+ */
+BitVector.prototype.set$I = function (value) {
+ this.set$IB(value, true);
+};
+
+/**
+ * @param {!number} value
+ * @param {!boolean} flag
+ */
+BitVector.prototype.set$IB = function (value, flag) {
+ /** @type {!number} */
+ var q;
+ /** @type {!number} */
+ var r;
+ /** @type {!number} */
+ var m;
+ if (value >= this._size) {
+ this._size = (value + 1 | 0);
+ }
+ q = (value / 32 | 0);
+ r = (value % 32 | 0);
+ while (q >= this._v.length) {
+ this._v.push(0);
+ }
+ m = 0x1 << r;
+ if (flag) {
+ this._v[q] |= m;
+ } else {
+ this._v[q] &= ~ m;
+ }
+};
+
+/**
+ * @param {!number} value
+ * @return {!boolean}
+ */
+BitVector.prototype.get$I = function (value) {
+ /** @type {!number} */
+ var q;
+ /** @type {!number} */
+ var r;
+ /** @type {!number} */
+ var m;
+ if (value >= this._size) {
+ throw new Error("BitVector.get() : range error");
+ }
+ q = (value / 32 | 0);
+ r = (value % 32 | 0);
+ m = 0x1 << r;
+ return !! (this._v[q] & m);
+};
+
+/**
+ * @param {!number} i
+ * @return {!number}
+ */
+BitVector.prototype.rank$I = function (i) {
+ return this.rank$IB(i, true);
+};
+
+/**
+ * @param {!number} i
+ * @param {!boolean} b
+ * @return {!number}
+ */
+BitVector.prototype.rank$IB = function (i, b) {
+ /** @type {!number} */
+ var q_large;
+ /** @type {!number} */
+ var q_small;
+ /** @type {!number} */
+ var r;
+ /** @type {!number} */
+ var rank;
+ /** @type {!number} */
+ var begin;
+ /** @type {!number} */
+ var j;
+ if (i > this._size) {
+ throw new Error("BitVector.rank() : range error");
+ }
+ if (i === 0) {
+ return 0;
+ }
+ i--;
+ q_large = (Math.floor(i / 256) | 0);
+ q_small = (Math.floor(i / 32) | 0);
+ r = (Math.floor(i % 32) | 0);
+ rank = (this._r[q_large] | 0);
+ if (! b) {
+ rank = q_large * 256 - rank;
+ }
+ begin = q_large * 8;
+ for (j = begin; j < q_small; j++) {
+ rank += this._rank32$IIB(this._v[j], 32, b);
+ }
+ rank += this._rank32$IIB(this._v[q_small], r + 1, b);
+ return rank;
+};
+
+/**
+ * @param {!number} i
+ * @return {!number}
+ */
+BitVector.prototype.select$I = function (i) {
+ return this.select$IB(i, true);
+};
+
+/**
+ * @param {!number} i
+ * @param {!boolean} b
+ * @return {!number}
+ */
+BitVector.prototype.select$IB = function (i, b) {
+ /** @type {!number} */
+ var left;
+ /** @type {!number} */
+ var right;
+ /** @type {!number} */
+ var pivot;
+ /** @type {undefined|!number} */
+ var rank;
+ /** @type {!number} */
+ var j;
+ if (i >= (b ? this._size1 : this._size - this._size1)) {
+ throw new Error("BitVector.select() : range error");
+ }
+ left = 0;
+ right = this._r.length;
+ while (left < right) {
+ pivot = Math.floor((left + right) / 2);
+ rank = this._r[pivot];
+ if (! b) {
+ rank = pivot * 256 - rank;
+ }
+ if (i < rank) {
+ right = pivot;
+ } else {
+ left = pivot + 1;
+ }
+ }
+ right--;
+ if (b) {
+ i -= (this._r[right] | 0);
+ } else {
+ i -= (right * 256 - this._r[right] | 0);
+ }
+ j = right * 8;
+ while (1) {
+ rank = this._rank32$IIB(this._v[j], 32, b);
+ if (i < rank) {
+ break;
+ }
+ j++;
+ i -= (rank | 0);
+ }
+ return (j * 32 + this._select32$IIB(this._v[j], i, b) | 0);
+};
+
+/**
+ * @param {!number} x
+ * @param {!number} i
+ * @param {!boolean} b
+ * @return {!number}
+ */
+BitVector.prototype._rank32$IIB = function (x, i, b) {
+ if (! b) {
+ x = ~ x;
+ }
+ x <<= 32 - i;
+ x = ((x & 0xaaaaaaaa) >>> 1) + (x & 0x55555555);
+ x = ((x & 0xcccccccc) >>> 2) + (x & 0x33333333);
+ x = ((x & 0xf0f0f0f0) >>> 4) + (x & 0x0f0f0f0f);
+ x = ((x & 0xff00ff00) >>> 8) + (x & 0x00ff00ff);
+ x = ((x & 0xffff0000) >>> 16) + (x & 0x0000ffff);
+ return x;
+};
+
+/**
+ * @param {!number} x
+ * @param {!number} i
+ * @param {!boolean} b
+ * @return {!number}
+ */
+BitVector.prototype._select32$IIB = function (x, i, b) {
+ /** @type {!number} */
+ var x1;
+ /** @type {!number} */
+ var x2;
+ /** @type {!number} */
+ var x3;
+ /** @type {!number} */
+ var x4;
+ /** @type {!number} */
+ var x5;
+ /** @type {!number} */
+ var pos;
+ /** @type {!number} */
+ var v5;
+ /** @type {!number} */
+ var v4;
+ /** @type {!number} */
+ var v3;
+ /** @type {!number} */
+ var v2;
+ /** @type {!number} */
+ var v1;
+ /** @type {!number} */
+ var v0;
+ if (! b) {
+ x = ~ x;
+ }
+ x1 = ((x & 0xaaaaaaaa) >>> 1) + (x & 0x55555555);
+ x2 = ((x1 & 0xcccccccc) >>> 2) + (x1 & 0x33333333);
+ x3 = ((x2 & 0xf0f0f0f0) >>> 4) + (x2 & 0x0f0f0f0f);
+ x4 = ((x3 & 0xff00ff00) >>> 8) + (x3 & 0x00ff00ff);
+ x5 = ((x4 & 0xffff0000) >>> 16) + (x4 & 0x0000ffff);
+ i++;
+ pos = 0;
+ v5 = x5 & 0xffffffff;
+ if (i > v5) {
+ i -= (v5 | 0);
+ pos += 32;
+ }
+ v4 = x4 >>> pos & 0x0000ffff;
+ if (i > v4) {
+ i -= (v4 | 0);
+ pos += 16;
+ }
+ v3 = x3 >>> pos & 0x000000ff;
+ if (i > v3) {
+ i -= (v3 | 0);
+ pos += 8;
+ }
+ v2 = x2 >>> pos & 0x0000000f;
+ if (i > v2) {
+ i -= (v2 | 0);
+ pos += 4;
+ }
+ v1 = x1 >>> pos & 0x00000003;
+ if (i > v1) {
+ i -= (v1 | 0);
+ pos += 2;
+ }
+ v0 = x >>> pos & 0x00000001;
+ if (i > v0) {
+ i -= (v0 | 0);
+ pos += 1;
+ }
+ return (pos | 0);
+};
+
+/**
+ * @return {!string}
+ */
+BitVector.prototype.dump$ = function () {
+ /** @type {Array.<undefined|!string>} */
+ var contents;
+ contents = [ ];
+ contents.push(Binary$dump32bitNumber$N(this._size));
+ contents.push(Binary$dump32bitNumberList$AN(this._v));
+ return contents.join('');
+};
+
+/**
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+BitVector.prototype.dump$LCompressionReport$ = function (report) {
+ /** @type {Array.<undefined|!string>} */
+ var contents;
+ contents = [ ];
+ contents.push(Binary$dump32bitNumber$N(this._size));
+ CompressionReport$add$LCompressionReport$II(report, 2, 2);
+ contents.push(Binary$dump32bitNumberList$ANLCompressionReport$(this._v, report));
+ return contents.join('');
+};
+
+/**
+ * @param {!string} data
+ * @return {!number}
+ */
+BitVector.prototype.load$S = function (data) {
+ return this.load$SI(data, 0);
+};
+
+/**
+ * @param {!string} data
+ * @param {!number} offset
+ * @return {!number}
+ */
+BitVector.prototype.load$SI = function (data, offset) {
+ /** @type {LoadedNumberListResult} */
+ var result;
+ /** @type {!number} */
+ var result$0;
+ this._v.length = 0;
+ this._r.length = 0;
+ this._size = 0;
+ this._size1 = 0;
+ result$0 = data.charCodeAt(offset) * 65536 + data.charCodeAt(offset + 1);
+ this._size = (result$0 | 0);
+ result = Binary$load32bitNumberList$SI(data, offset + 2);
+ this._v = result.result;
+ this.build$();
+ return result.offset;
+};
+
+/**
+ * class WaveletMatrix extends Object
+ * @constructor
+ */
+function WaveletMatrix() {
+}
+
+/**
+ * @constructor
+ */
+function WaveletMatrix$() {
+ /** @type {Array.<undefined|BitVector>} */
+ var _bv$0;
+ /** @type {Array.<undefined|!number>} */
+ var _seps$0;
+ this._range = ({ });
+ _bv$0 = this._bv = [ ];
+ _seps$0 = this._seps = [ ];
+ this._bitsize = 16;
+ _bv$0.length = 0;
+ _seps$0.length = 0;
+ this._size = 0;
+};
+
+WaveletMatrix$.prototype = new WaveletMatrix;
+
+/**
+ * @return {!number}
+ */
+WaveletMatrix.prototype.bitsize$ = function () {
+ return this._bitsize;
+};
+
+/**
+ * @param {!number} charCode
+ */
+WaveletMatrix.prototype.setMaxCharCode$I = function (charCode) {
+ this._bitsize = (Math.ceil(Math.log(charCode) / 0.6931471805599453) | 0);
+};
+
+/**
+ */
+WaveletMatrix.prototype.clear$ = function () {
+ this._bv.length = 0;
+ this._seps.length = 0;
+ this._size = 0;
+};
+
+/**
+ * @param {!string} v
+ */
+WaveletMatrix.prototype.build$S = function (v) {
+ /** @type {!number} */
+ var size;
+ /** @type {!number} */
+ var bitsize;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var depth;
+ /** @type {Object.<string, undefined|!number>} */
+ var range_tmp;
+ /** @type {!number} */
+ var code;
+ /** @type {!boolean} */
+ var bit;
+ /** @type {!number} */
+ var key;
+ /** @type {Object.<string, undefined|!number>} */
+ var range_rev;
+ /** @type {!string} */
+ var range_key;
+ /** @type {!number} */
+ var value;
+ /** @type {!number} */
+ var pos0;
+ /** @type {undefined|!number} */
+ var pos1;
+ /** @type {!string} */
+ var range_rev_key;
+ /** @type {!number} */
+ var begin;
+ /** @type {undefined|!number} */
+ var end;
+ /** @type {!number} */
+ var num0;
+ /** @type {!number} */
+ var num1;
+ this._bv.length = 0;
+ this._seps.length = 0;
+ this._size = 0;
+ size = v.length;
+ bitsize = this._bitsize;
+ for (i = 0; i < bitsize; i++) {
+ this._bv.push(new BitVector$());
+ this._seps.push(0);
+ }
+ this._size = (size | 0);
+ for (i = 0; i < size; i++) {
+ this._bv[0].set$IB(i, this._uint2bit$II(v.charCodeAt(i), 0));
+ }
+ this._bv[0].build$();
+ this._seps[0] = this._bv[0].size$B(false);
+ this._range["0"] = 0;
+ this._range["1"] = this._seps[0];
+ depth = 1;
+ while (depth < bitsize) {
+ range_tmp = WaveletMatrix$_shallow_copy$HI(this._range);
+ for (i = 0; i < size; i++) {
+ code = v.charCodeAt(i);
+ bit = this._uint2bit$II(code, depth);
+ key = code >>> bitsize - depth;
+ this._bv[depth].set$IB(range_tmp[key + ""], bit);
+ range_tmp[key + ""]++;
+ }
+ this._bv[depth].build$();
+ this._seps[depth] = this._bv[depth].size$B(false);
+ range_rev = ({ });
+ for (range_key in this._range) {
+ value = this._range[range_key];
+ if (value != range_tmp[range_key]) {
+ range_rev[value + ""] = range_key | 0;
+ }
+ }
+ this._range = ({ });
+ pos0 = 0;
+ pos1 = this._seps[depth];
+ for (range_rev_key in range_rev) {
+ begin = range_rev_key | 0;
+ value = range_rev[range_rev_key];
+ end = range_tmp[value + ""];
+ num0 = this._bv[depth].rank$IB(end, false) - this._bv[depth].rank$IB(begin, false);
+ num1 = end - begin - num0;
+ if (num0 > 0) {
+ this._range[(value << 1) + ""] = (pos0 | 0);
+ pos0 += num0;
+ }
+ if (num1 > 0) {
+ this._range[(value << 1) + 1 + ""] = pos1;
+ pos1 += (num1 | 0);
+ }
+ }
+ depth++;
+ }
+};
+
+/**
+ * @return {!number}
+ */
+WaveletMatrix.prototype.size$ = function () {
+ return this._size;
+};
+
+/**
+ * @param {!number} c
+ * @return {!number}
+ */
+WaveletMatrix.prototype.size$I = function (c) {
+ return this.rank$II(this._size, c);
+};
+
+/**
+ * @param {!number} i
+ * @return {!number}
+ */
+WaveletMatrix.prototype.get$I = function (i) {
+ /** @type {!number} */
+ var value;
+ /** @type {!number} */
+ var depth;
+ /** @type {!boolean} */
+ var bit;
+ if (i >= this._size) {
+ throw new Error("WaveletMatrix.get() : range error");
+ }
+ value = 0;
+ depth = 0;
+ while (depth < this._bitsize) {
+ bit = this._bv[depth].get$I(i);
+ i = this._bv[depth].rank$IB(i, bit);
+ value <<= 1;
+ if (bit) {
+ i += this._seps[depth];
+ value += 1;
+ }
+ depth++;
+ }
+ return (value | 0);
+};
+
+/**
+ * @param {!number} i
+ * @param {!number} c
+ * @return {!number}
+ */
+WaveletMatrix.prototype.rank$II = function (i, c) {
+ /** @type {undefined|!number} */
+ var begin;
+ /** @type {!number} */
+ var end;
+ /** @type {!number} */
+ var depth;
+ /** @type {!boolean} */
+ var bit;
+ if (i > this._size) {
+ throw new Error("WaveletMatrix.rank(): range error");
+ }
+ if (i === 0) {
+ return 0;
+ }
+ begin = this._range[c + ""];
+ if (begin == null) {
+ return 0;
+ }
+ end = i;
+ depth = 0;
+ while (depth < this._bitsize) {
+ bit = this._uint2bit$II(c, depth);
+ end = this._bv[depth].rank$IB(end, bit);
+ if (bit) {
+ end += this._seps[depth];
+ }
+ depth++;
+ }
+ return (end - begin | 0);
+};
+
+/**
+ * @param {!number} i
+ * @param {!number} c
+ * @return {!number}
+ */
+WaveletMatrix.prototype.rank_less_than$II = function (i, c) {
+ /** @type {!number} */
+ var begin;
+ /** @type {!number} */
+ var end;
+ /** @type {!number} */
+ var depth;
+ /** @type {!number} */
+ var rlt;
+ /** @type {!number} */
+ var rank0_begin;
+ /** @type {!number} */
+ var rank0_end;
+ /** @type {Array.<undefined|!number>} */
+ var _seps$0;
+ if (i > this._size) {
+ throw new Error("WaveletMatrix.rank_less_than(): range error");
+ }
+ if (i === 0) {
+ return 0;
+ }
+ begin = 0;
+ end = i;
+ depth = 0;
+ rlt = 0;
+ while (depth < this._bitsize) {
+ rank0_begin = this._bv[depth].rank$IB(begin, false);
+ rank0_end = this._bv[depth].rank$IB(end, false);
+ if (this._uint2bit$II(c, depth)) {
+ rlt += rank0_end - rank0_begin;
+ begin += (_seps$0 = this._seps)[depth] - rank0_begin;
+ end += _seps$0[depth] - rank0_end;
+ } else {
+ begin = rank0_begin;
+ end = rank0_end;
+ }
+ depth++;
+ }
+ return (rlt | 0);
+};
+
+/**
+ * @return {!string}
+ */
+WaveletMatrix.prototype.dump$ = function () {
+ /** @type {Array.<undefined|!string>} */
+ var contents;
+ /** @type {!number} */
+ var i;
+ /** @type {Array.<undefined|!string>} */
+ var range_contents;
+ /** @type {!number} */
+ var counter;
+ /** @type {!string} */
+ var key;
+ contents = [ Binary$dump16bitNumber$I(this._bitsize), Binary$dump32bitNumber$N(this._size) ];
+ for (i = 0; i < this._bitsize; i++) {
+ contents.push(this._bv[i].dump$());
+ }
+ for (i = 0; i < this._bitsize; i++) {
+ contents.push(Binary$dump32bitNumber$N(this._seps[i]));
+ }
+ range_contents = [ ];
+ counter = 0;
+ for (key in this._range) {
+ range_contents.push(Binary$dump32bitNumber$N(key | 0));
+ range_contents.push(Binary$dump32bitNumber$N(this._range[key]));
+ counter++;
+ }
+ contents.push(Binary$dump32bitNumber$N(counter));
+ return contents.join('') + range_contents.join('');
+};
+
+/**
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+WaveletMatrix.prototype.dump$LCompressionReport$ = function (report) {
+ /** @type {Array.<undefined|!string>} */
+ var contents;
+ /** @type {!number} */
+ var i;
+ /** @type {Array.<undefined|!string>} */
+ var range_contents;
+ /** @type {!number} */
+ var counter;
+ /** @type {!string} */
+ var key;
+ contents = [ Binary$dump16bitNumber$I(this._bitsize), Binary$dump32bitNumber$N(this._size) ];
+ CompressionReport$add$LCompressionReport$II(report, 3, 3);
+ for (i = 0; i < this._bitsize; i++) {
+ contents.push(this._bv[i].dump$LCompressionReport$(report));
+ }
+ for (i = 0; i < this._bitsize; i++) {
+ contents.push(Binary$dump32bitNumber$N(this._seps[i]));
+ CompressionReport$add$LCompressionReport$II(report, 2, 2);
+ }
+ range_contents = [ ];
+ counter = 0;
+ for (key in this._range) {
+ range_contents.push(Binary$dump32bitNumber$N(key | 0));
+ range_contents.push(Binary$dump32bitNumber$N(this._range[key]));
+ CompressionReport$add$LCompressionReport$II(report, 4, 4);
+ counter++;
+ }
+ CompressionReport$add$LCompressionReport$II(report, 2, 2);
+ contents.push(Binary$dump32bitNumber$N(counter));
+ return contents.join('') + range_contents.join('');
+};
+
+/**
+ * @param {!string} data
+ * @return {!number}
+ */
+WaveletMatrix.prototype.load$S = function (data) {
+ return this.load$SI(data, 0);
+};
+
+/**
+ * @param {!string} data
+ * @param {!number} offset
+ * @return {!number}
+ */
+WaveletMatrix.prototype.load$SI = function (data, offset) {
+ /** @type {!number} */
+ var i;
+ /** @type {BitVector} */
+ var bit_vector;
+ /** @type {!number} */
+ var range_size;
+ /** @type {!number} */
+ var value;
+ /** @type {!number} */
+ var offset$0;
+ /** @type {!number} */
+ var result$0;
+ /** @type {!number} */
+ var result$1;
+ /** @type {!number} */
+ var result$2;
+ this._bv.length = 0;
+ this._seps.length = 0;
+ this._size = 0;
+ offset$0 = offset++;
+ this._bitsize = (data.charCodeAt(offset$0) | 0);
+ result$0 = data.charCodeAt(offset) * 65536 + data.charCodeAt(offset + 1);
+ this._size = (result$0 | 0);
+ offset += 2;
+ for (i = 0; i < this._bitsize; i++) {
+ bit_vector = new BitVector$();
+ offset = bit_vector.load$SI(data, offset);
+ this._bv.push(bit_vector);
+ }
+ for (i = 0; i < this._bitsize; (i++, offset += 2)) {
+ this._seps.push(Binary$load32bitNumber$SI(data, offset));
+ }
+ result$1 = data.charCodeAt(offset) * 65536 + data.charCodeAt(offset + 1);
+ range_size = result$1;
+ offset += 2;
+ for (i = 0; i < range_size; (i++, offset += 4)) {
+ result$2 = data.charCodeAt(offset) * 65536 + data.charCodeAt(offset + 1);
+ value = Binary$load32bitNumber$SI(data, offset + 2);
+ this._range[result$2 + ""] = (value | 0);
+ }
+ return offset;
+};
+
+/**
+ * @param {Object.<string, undefined|!number>} input
+ * @return {Object.<string, undefined|!number>}
+ */
+WaveletMatrix._shallow_copy$HI = function (input) {
+ /** @type {Object.<string, undefined|!number>} */
+ var result;
+ /** @type {!string} */
+ var key;
+ result = ({ });
+ for (key in input) {
+ result[key] = input[key];
+ }
+ return result;
+};
+
+var WaveletMatrix$_shallow_copy$HI = WaveletMatrix._shallow_copy$HI;
+
+/**
+ * @param {!number} c
+ * @param {!number} i
+ * @return {!boolean}
+ */
+WaveletMatrix.prototype._uint2bit$II = function (c, i) {
+ return (c >>> this._bitsize - 1 - i & 0x1) === 0x1;
+};
+
+/**
+ * class BurrowsWheelerTransform extends Object
+ * @constructor
+ */
+function BurrowsWheelerTransform() {
+}
+
+/**
+ * @constructor
+ */
+function BurrowsWheelerTransform$() {
+ this._str = "";
+ this._size = 0;
+ this._head = 0;
+ this._suffixarray = [ ];
+};
+
+BurrowsWheelerTransform$.prototype = new BurrowsWheelerTransform;
+
+/**
+ * @param {BurrowsWheelerTransform} $this
+ * @return {!number}
+ */
+BurrowsWheelerTransform.size$LBurrowsWheelerTransform$ = function ($this) {
+ return $this._size;
+};
+
+var BurrowsWheelerTransform$size$LBurrowsWheelerTransform$ = BurrowsWheelerTransform.size$LBurrowsWheelerTransform$;
+
+/**
+ * @param {BurrowsWheelerTransform} $this
+ * @return {!number}
+ */
+BurrowsWheelerTransform.head$LBurrowsWheelerTransform$ = function ($this) {
+ return $this._head;
+};
+
+var BurrowsWheelerTransform$head$LBurrowsWheelerTransform$ = BurrowsWheelerTransform.head$LBurrowsWheelerTransform$;
+
+/**
+ * @param {BurrowsWheelerTransform} $this
+ */
+BurrowsWheelerTransform.clear$LBurrowsWheelerTransform$ = function ($this) {
+ $this._str = "";
+ $this._size = 0;
+ $this._head = 0;
+ $this._suffixarray.length = 0;
+};
+
+var BurrowsWheelerTransform$clear$LBurrowsWheelerTransform$ = BurrowsWheelerTransform.clear$LBurrowsWheelerTransform$;
+
+/**
+ * @param {BurrowsWheelerTransform} $this
+ * @param {!string} str
+ */
+BurrowsWheelerTransform.build$LBurrowsWheelerTransform$S = function ($this, str) {
+ /** @type {!string} */
+ var _str$0;
+ /** @type {Array.<undefined|!number>} */
+ var _suffixarray$0;
+ _str$0 = $this._str = str;
+ $this._size = _str$0.length;
+ _suffixarray$0 = $this._suffixarray = SAIS$make$S(str);
+ $this._head = (_suffixarray$0.indexOf(0) | 0);
+};
+
+var BurrowsWheelerTransform$build$LBurrowsWheelerTransform$S = BurrowsWheelerTransform.build$LBurrowsWheelerTransform$S;
+
+/**
+ * @param {BurrowsWheelerTransform} $this
+ * @param {!number} i
+ * @return {!string}
+ */
+BurrowsWheelerTransform.get$LBurrowsWheelerTransform$I = function ($this, i) {
+ /** @type {!number} */
+ var size;
+ /** @type {!number} */
+ var index;
+ size = $this._size;
+ if (i >= size) {
+ throw new Error("BurrowsWheelerTransform.get() : range error");
+ }
+ index = ($this._suffixarray[i] + size - 1) % size;
+ return $this._str.charAt(index);
+};
+
+var BurrowsWheelerTransform$get$LBurrowsWheelerTransform$I = BurrowsWheelerTransform.get$LBurrowsWheelerTransform$I;
+
+/**
+ * @param {BurrowsWheelerTransform} $this
+ * @return {!string}
+ */
+BurrowsWheelerTransform.get$LBurrowsWheelerTransform$ = function ($this) {
+ /** @type {Array.<undefined|!string>} */
+ var str;
+ /** @type {!number} */
+ var size;
+ /** @type {!number} */
+ var i;
+ str = [ ];
+ size = $this._size;
+ for (i = 0; i < size; i++) {
+ str.push(BurrowsWheelerTransform$get$LBurrowsWheelerTransform$I($this, i));
+ }
+ return str.join("");
+};
+
+var BurrowsWheelerTransform$get$LBurrowsWheelerTransform$ = BurrowsWheelerTransform.get$LBurrowsWheelerTransform$;
+
+/**
+ * @param {BurrowsWheelerTransform} $this
+ * @param {!string} replace
+ * @return {!string}
+ */
+BurrowsWheelerTransform.get$LBurrowsWheelerTransform$S = function ($this, replace) {
+ /** @type {!string} */
+ var result;
+ result = BurrowsWheelerTransform$get$LBurrowsWheelerTransform$($this);
+ return result.replace(BurrowsWheelerTransform.END_MARKER, replace);
+};
+
+var BurrowsWheelerTransform$get$LBurrowsWheelerTransform$S = BurrowsWheelerTransform.get$LBurrowsWheelerTransform$S;
+
+/**
+ * class OArray extends Object
+ * @constructor
+ */
+function OArray() {
+}
+
+/**
+ * @constructor
+ * @param {Array.<undefined|!number>} array
+ */
+function OArray$AI(array) {
+ this.array = array;
+ this.offset = 0;
+};
+
+OArray$AI.prototype = new OArray;
+
+/**
+ * @constructor
+ * @param {Array.<undefined|!number>} array
+ * @param {!number} offset
+ */
+function OArray$AII(array, offset) {
+ this.array = array;
+ this.offset = offset;
+};
+
+OArray$AII.prototype = new OArray;
+
+/**
+ * @param {OArray} $this
+ * @param {!number} index
+ * @return {!number}
+ */
+OArray.get$LOArray$I = function ($this, index) {
+ return $this.array[index + $this.offset];
+};
+
+var OArray$get$LOArray$I = OArray.get$LOArray$I;
+
+/**
+ * @param {OArray} $this
+ * @param {!number} index
+ * @param {!number} value
+ */
+OArray.set$LOArray$II = function ($this, index, value) {
+ $this.array[index + $this.offset] = value;
+};
+
+var OArray$set$LOArray$II = OArray.set$LOArray$II;
+
+/**
+ * @param {OArray} $this
+ * @param {!number} index
+ * @return {!boolean}
+ */
+OArray.isS$LOArray$I = function ($this, index) {
+ /** @type {Array.<undefined|!number>} */
+ var array$0;
+ /** @type {!number} */
+ var offset$0;
+ return (array$0 = $this.array)[index + (offset$0 = $this.offset)] < array$0[index + offset$0 + 1];
+};
+
+var OArray$isS$LOArray$I = OArray.isS$LOArray$I;
+
+/**
+ * @param {OArray} $this
+ * @param {!number} index1
+ * @param {!number} index2
+ * @return {!boolean}
+ */
+OArray.compare$LOArray$II = function ($this, index1, index2) {
+ /** @type {Array.<undefined|!number>} */
+ var array$0;
+ /** @type {!number} */
+ var offset$0;
+ return (array$0 = $this.array)[index1 + (offset$0 = $this.offset)] == array$0[index2 + offset$0];
+};
+
+var OArray$compare$LOArray$II = OArray.compare$LOArray$II;
+
+/**
+ * class SAIS extends Object
+ * @constructor
+ */
+function SAIS() {
+}
+
+/**
+ * @constructor
+ */
+function SAIS$() {
+};
+
+SAIS$.prototype = new SAIS;
+
+/**
+ * @param {BitVector} t
+ * @param {!number} i
+ * @return {!boolean}
+ */
+SAIS._isLMS$LBitVector$I = function (t, i) {
+ return i > 0 && t.get$I(i) && ! t.get$I(i - 1);
+};
+
+var SAIS$_isLMS$LBitVector$I = SAIS._isLMS$LBitVector$I;
+
+/**
+ * @param {OArray} s
+ * @param {Array.<undefined|!number>} bkt
+ * @param {!number} n
+ * @param {!number} K
+ * @param {!boolean} end
+ */
+SAIS._getBuckets$LOArray$AIIIB = function (s, bkt, n, K, end) {
+ /** @type {!number} */
+ var sum;
+ /** @type {!number} */
+ var i;
+ sum = 0;
+ for (i = 0; i <= K; i++) {
+ bkt[i] = 0;
+ }
+ for (i = 0; i < n; i++) {
+ bkt[OArray$get$LOArray$I(s, i)]++;
+ }
+ for (i = 0; i <= K; i++) {
+ sum += bkt[i];
+ bkt[i] = ((end ? sum : sum - bkt[i]) | 0);
+ }
+};
+
+var SAIS$_getBuckets$LOArray$AIIIB = SAIS._getBuckets$LOArray$AIIIB;
+
+/**
+ * @param {BitVector} t
+ * @param {Array.<undefined|!number>} SA
+ * @param {OArray} s
+ * @param {Array.<undefined|!number>} bkt
+ * @param {!number} n
+ * @param {!number} K
+ * @param {!boolean} end
+ */
+SAIS._induceSAl$LBitVector$AILOArray$AIIIB = function (t, SA, s, bkt, n, K, end) {
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var j;
+ SAIS$_getBuckets$LOArray$AIIIB(s, bkt, n, K, end);
+ for (i = 0; i < n; i++) {
+ j = SA[i] - 1;
+ if (j >= 0 && ! t.get$I(j)) {
+ SA[bkt[OArray$get$LOArray$I(s, j)]++] = (j | 0);
+ }
+ }
+};
+
+var SAIS$_induceSAl$LBitVector$AILOArray$AIIIB = SAIS._induceSAl$LBitVector$AILOArray$AIIIB;
+
+/**
+ * @param {BitVector} t
+ * @param {Array.<undefined|!number>} SA
+ * @param {OArray} s
+ * @param {Array.<undefined|!number>} bkt
+ * @param {!number} n
+ * @param {!number} K
+ * @param {!boolean} end
+ */
+SAIS._induceSAs$LBitVector$AILOArray$AIIIB = function (t, SA, s, bkt, n, K, end) {
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var j;
+ SAIS$_getBuckets$LOArray$AIIIB(s, bkt, n, K, end);
+ for (i = n - 1; i >= 0; i--) {
+ j = SA[i] - 1;
+ if (j >= 0 && t.get$I(j)) {
+ SA[-- bkt[OArray$get$LOArray$I(s, j)]] = (j | 0);
+ }
+ }
+};
+
+var SAIS$_induceSAs$LBitVector$AILOArray$AIIIB = SAIS._induceSAs$LBitVector$AILOArray$AIIIB;
+
+/**
+ * @param {!string} source
+ * @return {Array.<undefined|!number>}
+ */
+SAIS.make$S = function (source) {
+ /** @type {Array.<undefined|!number>} */
+ var charCodes;
+ /** @type {!number} */
+ var maxCode;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var code;
+ /** @type {Array.<undefined|!number>} */
+ var SA;
+ /** @type {OArray} */
+ var s;
+ charCodes = [ ];
+ charCodes.length = source.length;
+ maxCode = 0;
+ for (i = 0; i < source.length; i++) {
+ code = source.charCodeAt(i);
+ charCodes[i] = (code | 0);
+ maxCode = (code > maxCode ? code : maxCode);
+ }
+ SA = [ ];
+ SA.length = source.length;
+ s = ({offset: 0, array: charCodes});
+ SAIS$_make$LOArray$AIII(s, SA, source.length, maxCode);
+ return SA;
+};
+
+var SAIS$make$S = SAIS.make$S;
+
+/**
+ * @param {OArray} s
+ * @param {Array.<undefined|!number>} SA
+ * @param {!number} n
+ * @param {!number} K
+ */
+SAIS._make$LOArray$AIII = function (s, SA, n, K) {
+ /** @type {BitVector} */
+ var t;
+ /** @type {!number} */
+ var i;
+ /** @type {Array.<undefined|!number>} */
+ var bkt;
+ /** @type {!number} */
+ var n1;
+ /** @type {!number} */
+ var name;
+ /** @type {!number} */
+ var prev;
+ /** @type {undefined|!number} */
+ var pos;
+ /** @type {!boolean} */
+ var diff;
+ /** @type {!number} */
+ var d;
+ /** @type {!number} */
+ var j;
+ /** @type {Array.<undefined|!number>} */
+ var SA1;
+ /** @type {OArray} */
+ var s1;
+ /** @type {!number} */
+ var i$0;
+ /** @type {!number} */
+ var index$0;
+ t = new BitVector$();
+ t.set$IB(n - 2, false);
+ t.set$IB(n - 1, true);
+ for (i = n - 3; i >= 0; i--) {
+ t.set$IB(i, OArray$isS$LOArray$I(s, i) || OArray$compare$LOArray$II(s, i, i + 1) && t.get$I(i + 1));
+ }
+ bkt = [ ];
+ bkt.length = K + 1;
+ SAIS$_getBuckets$LOArray$AIIIB(s, bkt, n, K, true);
+ for (i = 0; i < n; i++) {
+ SA[i] = -1;
+ }
+ for (i = 1; i < n; i++) {
+ if (SAIS$_isLMS$LBitVector$I(t, i)) {
+ SA[-- bkt[OArray$get$LOArray$I(s, i)]] = (i | 0);
+ }
+ }
+ SAIS$_induceSAl$LBitVector$AILOArray$AIIIB(t, SA, s, bkt, n, K, false);
+ SAIS$_induceSAs$LBitVector$AILOArray$AIIIB(t, SA, s, bkt, n, K, true);
+ n1 = 0;
+ for (i = 0; i < n; i++) {
+ i$0 = SA[i];
+ if (i$0 > 0 && t.get$I(i$0) && ! t.get$I(i$0 - 1)) {
+ SA[n1++] = SA[i];
+ }
+ }
+ for (i = n1; i < n; i++) {
+ SA[i] = -1;
+ }
+ name = 0;
+ prev = -1;
+ for (i = 0; i < n1; i++) {
+ pos = SA[i];
+ diff = false;
+ for (d = 0; d < n; d++) {
+ if (prev === -1 || ! OArray$compare$LOArray$II(s, pos + d, prev + d) || t.get$I(pos + d) !== t.get$I(prev + d)) {
+ diff = true;
+ break;
+ } else {
+ if (d > 0 && (SAIS$_isLMS$LBitVector$I(t, pos + d) || SAIS$_isLMS$LBitVector$I(t, prev + d))) {
+ break;
+ }
+ }
+ }
+ if (diff) {
+ name++;
+ prev = pos;
+ }
+ pos = ((pos % 2 === 0 ? pos / 2 : (pos - 1) / 2) | 0);
+ SA[n1 + pos] = (name - 1 | 0);
+ }
+ for ((i = n - 1, j = n - 1); i >= n1; i--) {
+ if (SA[i] >= 0) {
+ SA[j--] = SA[i];
+ }
+ }
+ SA1 = SA;
+ s1 = ({offset: n - n1, array: SA});
+ if (name < n1) {
+ SAIS$_make$LOArray$AIII(s1, SA1, n1, name - 1);
+ } else {
+ for (i = 0; i < n1; i++) {
+ SA1[OArray$get$LOArray$I(s1, i)] = (i | 0);
+ }
+ }
+ bkt = [ ];
+ bkt.length = K + 1;
+ SAIS$_getBuckets$LOArray$AIIIB(s, bkt, n, K, true);
+ for ((i = 1, j = 0); i < n; i++) {
+ if (SAIS$_isLMS$LBitVector$I(t, i)) {
+ OArray$set$LOArray$II(s1, j++, i);
+ }
+ }
+ for (i = 0; i < n1; i++) {
+ index$0 = SA1[i];
+ SA1[i] = s1.array[index$0 + s1.offset];
+ }
+ for (i = n1; i < n; i++) {
+ SA[i] = -1;
+ }
+ for (i = n1 - 1; i >= 0; i--) {
+ j = SA[i];
+ SA[i] = -1;
+ SA[-- bkt[OArray$get$LOArray$I(s, j)]] = (j | 0);
+ }
+ SAIS$_induceSAl$LBitVector$AILOArray$AIIIB(t, SA, s, bkt, n, K, false);
+ SAIS$_induceSAs$LBitVector$AILOArray$AIIIB(t, SA, s, bkt, n, K, true);
+};
+
+var SAIS$_make$LOArray$AIII = SAIS._make$LOArray$AIII;
+
+OktaviaSearch._stemmer = null;
+OktaviaSearch._instance = null;
+$__jsx_lazy_init(Oktavia, "eof", function () {
+ return String.fromCharCode(0);
+});
+$__jsx_lazy_init(Oktavia, "eob", function () {
+ return String.fromCharCode(1);
+});
+$__jsx_lazy_init(Oktavia, "unknown", function () {
+ return String.fromCharCode(3);
+});
+Binary._base64EncodeChars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
+$__jsx_lazy_init(Binary, "_base64DecodeChars", function () {
+ return [ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 62, -1, -1, -1, 63, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, -1, -1, -1, -1, -1, -1, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -1, -1, -1, -1, -1, -1, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, -1, -1, -1, -1 ];
+});
+$__jsx_lazy_init(Style, "console", function () {
+ return ({ 'title': [ '\x1B[32m\x1b[4m', '\x1B[39m\x1b[0m' ], 'url': [ '\x1B[34m', '\x1B[39m' ], 'hit': [ '\x1B[4m', '\x1B[0m' ], 'del': [ '\x1B[9m', '\x1B[0m' ], 'summary': [ '\x1B[90m', '\x1B[39m' ] });
+});
+$__jsx_lazy_init(Style, "html", function () {
+ return ({ 'title': [ '<span class="title">', '</span>' ], 'url': [ '<span class="url">', '</span>' ], 'hit': [ '<span class="hit">', '</span>' ], 'del': [ '<del>', '</del>' ], 'summary': [ '<span class="reuslt">', '</span>' ] });
+});
+$__jsx_lazy_init(Style, "ignore", function () {
+ return ({ 'tilte': [ '', '' ], 'url': [ '', '' ], 'hit': [ '', '' ], 'del': [ '', '' ], 'summary': [ '', '' ] });
+});
+FrenchStemmer.serialVersionUID = 1;
+$__jsx_lazy_init(FrenchStemmer, "methodObject", function () {
+ return new FrenchStemmer$();
+});
+$__jsx_lazy_init(FrenchStemmer, "a_0", function () {
+ return [ new Among$SII("col", -1, -1), new Among$SII("par", -1, -1), new Among$SII("tap", -1, -1) ];
+});
+$__jsx_lazy_init(FrenchStemmer, "a_1", function () {
+ return [ new Among$SII("", -1, 4), new Among$SII("I", 0, 1), new Among$SII("U", 0, 2), new Among$SII("Y", 0, 3) ];
+});
+$__jsx_lazy_init(FrenchStemmer, "a_2", function () {
+ return [ new Among$SII("iqU", -1, 3), new Among$SII("abl", -1, 3), new Among$SII("I\u00E8r", -1, 4), new Among$SII("i\u00E8r", -1, 4), new Among$SII("eus", -1, 2), new Among$SII("iv", -1, 1) ];
+});
+$__jsx_lazy_init(FrenchStemmer, "a_3", function () {
+ return [ new Among$SII("ic", -1, 2), new Among$SII("abil", -1, 1), new Among$SII("iv", -1, 3) ];
+});
+$__jsx_lazy_init(FrenchStemmer, "a_4", function () {
+ return [ new Among$SII("iqUe", -1, 1), new Among$SII("atrice", -1, 2), new Among$SII("ance", -1, 1), new Among$SII("ence", -1, 5), new Among$SII("logie", -1, 3), new Among$SII("able", -1, 1), new Among$SII("isme", -1, 1), new Among$SII("euse", -1, 11), new Among$SII("iste", -1, 1), new Among$SII("ive", -1, 8), new Among$SII("if", -1, 8), new Among$SII("usion", -1, 4), new Among$SII("ation", -1, 2), new Among$SII("ution", -1, 4), new Among$SII("ateur", -1, 2), new Among$SII("iqUes", -1, 1), new Among$SII("atrices", -1, 2), new Among$SII("ances", -1, 1), new Among$SII("ences", -1, 5), new Among$SII("logies", -1, 3), new Among$SII("ables", -1, 1), new Among$SII("ismes", -1, 1), new Among$SII("euses", -1, 11), new Among$SII("istes", -1, 1), new Among$SII("ives", -1, 8), new Among$SII("ifs", -1, 8), new Among$SII("usions", -1, 4), new Among$SII("ations", -1, 2), new Among$SII("utions", -1, 4), new Among$SII("ateurs", -1, 2), new Among$SII("ments", -1, 15), new Among$SII("ements", 30, 6), new Among$SII("issements", 31, 12), new Among$SII("it\u00E9s", -1, 7), new Among$SII("ment", -1, 15), new Among$SII("ement", 34, 6), new Among$SII("issement", 35, 12), new Among$SII("amment", 34, 13), new Among$SII("emment", 34, 14), new Among$SII("aux", -1, 10), new Among$SII("eaux", 39, 9), new Among$SII("eux", -1, 1), new Among$SII("it\u00E9", -1, 7) ];
+});
+$__jsx_lazy_init(FrenchStemmer, "a_5", function () {
+ return [ new Among$SII("ira", -1, 1), new Among$SII("ie", -1, 1), new Among$SII("isse", -1, 1), new Among$SII("issante", -1, 1), new Among$SII("i", -1, 1), new Among$SII("irai", 4, 1), new Among$SII("ir", -1, 1), new Among$SII("iras", -1, 1), new Among$SII("ies", -1, 1), new Among$SII("\u00EEmes", -1, 1), new Among$SII("isses", -1, 1), new Among$SII("issantes", -1, 1), new Among$SII("\u00EEtes", -1, 1), new Among$SII("is", -1, 1), new Among$SII("irais", 13, 1), new Among$SII("issais", 13, 1), new Among$SII("irions", -1, 1), new Among$SII("issions", -1, 1), new Among$SII("irons", -1, 1), new Among$SII("issons", -1, 1), new Among$SII("issants", -1, 1), new Among$SII("it", -1, 1), new Among$SII("irait", 21, 1), new Among$SII("issait", 21, 1), new Among$SII("issant", -1, 1), new Among$SII("iraIent", -1, 1), new Among$SII("issaIent", -1, 1), new Among$SII("irent", -1, 1), new Among$SII("issent", -1, 1), new Among$SII("iront", -1, 1), new Among$SII("\u00EEt", -1, 1), new Among$SII("iriez", -1, 1), new Among$SII("issiez", -1, 1), new Among$SII("irez", -1, 1), new Among$SII("issez", -1, 1) ];
+});
+$__jsx_lazy_init(FrenchStemmer, "a_6", function () {
+ return [ new Among$SII("a", -1, 3), new Among$SII("era", 0, 2), new Among$SII("asse", -1, 3), new Among$SII("ante", -1, 3), new Among$SII("\u00E9e", -1, 2), new Among$SII("ai", -1, 3), new Among$SII("erai", 5, 2), new Among$SII("er", -1, 2), new Among$SII("as", -1, 3), new Among$SII("eras", 8, 2), new Among$SII("\u00E2mes", -1, 3), new Among$SII("asses", -1, 3), new Among$SII("antes", -1, 3), new Among$SII("\u00E2tes", -1, 3), new Among$SII("\u00E9es", -1, 2), new Among$SII("ais", -1, 3), new Among$SII("erais", 15, 2), new Among$SII("ions", -1, 1), new Among$SII("erions", 17, 2), new Among$SII("assions", 17, 3), new Among$SII("erons", -1, 2), new Among$SII("ants", -1, 3), new Among$SII("\u00E9s", -1, 2), new Among$SII("ait", -1, 3), new Among$SII("erait", 23, 2), new Among$SII("ant", -1, 3), new Among$SII("aIent", -1, 3), new Among$SII("eraIent", 26, 2), new Among$SII("\u00E8rent", -1, 2), new Among$SII("assent", -1, 3), new Among$SII("eront", -1, 2), new Among$SII("\u00E2t", -1, 3), new Among$SII("ez", -1, 2), new Among$SII("iez", 32, 2), new Among$SII("eriez", 33, 2), new Among$SII("assiez", 33, 3), new Among$SII("erez", 32, 2), new Among$SII("\u00E9", -1, 2) ];
+});
+$__jsx_lazy_init(FrenchStemmer, "a_7", function () {
+ return [ new Among$SII("e", -1, 3), new Among$SII("I\u00E8re", 0, 2), new Among$SII("i\u00E8re", 0, 2), new Among$SII("ion", -1, 1), new Among$SII("Ier", -1, 2), new Among$SII("ier", -1, 2), new Among$SII("\u00EB", -1, 4) ];
+});
+$__jsx_lazy_init(FrenchStemmer, "a_8", function () {
+ return [ new Among$SII("ell", -1, -1), new Among$SII("eill", -1, -1), new Among$SII("enn", -1, -1), new Among$SII("onn", -1, -1), new Among$SII("ett", -1, -1) ];
+});
+$__jsx_lazy_init(FrenchStemmer, "g_v", function () {
+ return [ 17, 65, 16, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128, 130, 103, 8, 5 ];
+});
+$__jsx_lazy_init(FrenchStemmer, "g_keep_with_s", function () {
+ return [ 1, 65, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128 ];
+});
+$__jsx_lazy_init(_Common, "buffers", function () {
+ return [ "comment", "sgmlDecl", "textNode", "tagName", "doctype", "procInstName", "procInstBody", "entity", "attribName", "attribValue", "cdata", "script" ];
+});
+$__jsx_lazy_init(_Common, "EVENTS", function () {
+ return [ "text", "processinginstruction", "sgmldeclaration", "doctype", "comment", "attribute", "opentag", "closetag", "opencdata", "cdata", "clo_State.CDATA", "error", "end", "ready", "script", "opennamespace", "closenamespace" ];
+});
+_Common.MAX_BUFFER_LENGTH = 65536;
+_State.BEGIN = 1;
+_State.TEXT = 2;
+_State.TEXT_ENTITY = 3;
+_State.OPEN_WAKA = 4;
+_State.SGML_DECL = 5;
+_State.SGML_DECL_QUOTED = 6;
+_State.DOCTYPE = 7;
+_State.DOCTYPE_QUOTED = 8;
+_State.DOCTYPE_DTD = 9;
+_State.DOCTYPE_DTD_QUOTED = 10;
+_State.COMMENT_STARTING = 11;
+_State.COMMENT = 12;
+_State.COMMENT_ENDING = 13;
+_State.COMMENT_ENDED = 14;
+_State.CDATA = 15;
+_State.CDATA_ENDING = 16;
+_State.CDATA_ENDING_2 = 17;
+_State.PROC_INST = 18;
+_State.PROC_INST_BODY = 19;
+_State.PROC_INST_ENDING = 20;
+_State.OPEN_TAG = 21;
+_State.OPEN_TAG_SLASH = 22;
+_State.ATTRIB = 23;
+_State.ATTRIB_NAME = 24;
+_State.ATTRIB_NAME_SAW_WHITE = 25;
+_State.ATTRIB_VALUE = 26;
+_State.ATTRIB_VALUE_QUOTED = 27;
+_State.ATTRIB_VALUE_UNQUOTED = 28;
+_State.ATTRIB_VALUE_ENTITY_Q = 29;
+_State.ATTRIB_VALUE_ENTITY_U = 30;
+_State.CLOSE_TAG = 31;
+_State.CLOSE_TAG_SAW_WHITE = 32;
+_State.SCRIPT = 33;
+_State.SCRIPT_ENDING = 34;
+$__jsx_lazy_init(_Entities, "_entities", function () {
+ return ({ "amp": "&", "gt": ">", "lt": "<", "quot": "\"", "apos": "'", "AElig": 198, "Aacute": 193, "Acirc": 194, "Agrave": 192, "Aring": 197, "Atilde": 195, "Auml": 196, "Ccedil": 199, "ETH": 208, "Eacute": 201, "Ecirc": 202, "Egrave": 200, "Euml": 203, "Iacute": 205, "Icirc": 206, "Igrave": 204, "Iuml": 207, "Ntilde": 209, "Oacute": 211, "Ocirc": 212, "Ograve": 210, "Oslash": 216, "Otilde": 213, "Ouml": 214, "THORN": 222, "Uacute": 218, "Ucirc": 219, "Ugrave": 217, "Uuml": 220, "Yacute": 221, "aacute": 225, "acirc": 226, "aelig": 230, "agrave": 224, "aring": 229, "atilde": 227, "auml": 228, "ccedil": 231, "eacute": 233, "ecirc": 234, "egrave": 232, "eth": 240, "euml": 235, "iacute": 237, "icirc": 238, "igrave": 236, "iuml": 239, "ntilde": 241, "oacute": 243, "ocirc": 244, "ograve": 242, "oslash": 248, "otilde": 245, "ouml": 246, "szlig": 223, "thorn": 254, "uacute": 250, "ucirc": 251, "ugrave": 249, "uuml": 252, "yacute": 253, "yuml": 255, "copy": 169, "reg": 174, "nbsp": 160, "iexcl": 161, "cent": 162, "pound": 163, "curren": 164, "yen": 165, "brvbar": 166, "sect": 167, "uml": 168, "ordf": 170, "laquo": 171, "not": 172, "shy": 173, "macr": 175, "deg": 176, "plusmn": 177, "sup1": 185, "sup2": 178, "sup3": 179, "acute": 180, "micro": 181, "para": 182, "middot": 183, "cedil": 184, "ordm": 186, "raquo": 187, "frac14": 188, "frac12": 189, "frac34": 190, "iquest": 191, "times": 215, "divide": 247, "OElig": 338, "oelig": 339, "Scaron": 352, "scaron": 353, "Yuml": 376, "fnof": 402, "circ": 710, "tilde": 732, "Alpha": 913, "Beta": 914, "Gamma": 915, "Delta": 916, "Epsilon": 917, "Zeta": 918, "Eta": 919, "Theta": 920, "Iota": 921, "Kappa": 922, "Lambda": 923, "Mu": 924, "Nu": 925, "Xi": 926, "Omicron": 927, "Pi": 928, "Rho": 929, "Sigma": 931, "Tau": 932, "Upsilon": 933, "Phi": 934, "Chi": 935, "Psi": 936, "Omega": 937, "alpha": 945, "beta": 946, "gamma": 947, "delta": 948, "epsilon": 949, "zeta": 950, "eta": 951, "theta": 952, "iota": 953, "kappa": 954, "lambda": 955, "mu": 956, "nu": 957, "xi": 958, "omicron": 959, "pi": 960, "rho": 961, "sigmaf": 962, "sigma": 963, "tau": 964, "upsilon": 965, "phi": 966, "chi": 967, "psi": 968, "omega": 969, "thetasym": 977, "upsih": 978, "piv": 982, "ensp": 8194, "emsp": 8195, "thinsp": 8201, "zwnj": 8204, "zwj": 8205, "lrm": 8206, "rlm": 8207, "ndash": 8211, "mdash": 8212, "lsquo": 8216, "rsquo": 8217, "sbquo": 8218, "ldquo": 8220, "rdquo": 8221, "bdquo": 8222, "dagger": 8224, "Dagger": 8225, "bull": 8226, "hellip": 8230, "permil": 8240, "prime": 8242, "Prime": 8243, "lsaquo": 8249, "rsaquo": 8250, "oline": 8254, "frasl": 8260, "euro": 8364, "image": 8465, "weierp": 8472, "real": 8476, "trade": 8482, "alefsym": 8501, "larr": 8592, "uarr": 8593, "rarr": 8594, "darr": 8595, "harr": 8596, "crarr": 8629, "lArr": 8656, "uArr": 8657, "rArr": 8658, "dArr": 8659, "hArr": 8660, "forall": 8704, "part": 8706, "exist": 8707, "empty": 8709, "nabla": 8711, "isin": 8712, "notin": 8713, "ni": 8715, "prod": 8719, "sum": 8721, "minus": 8722, "lowast": 8727, "radic": 8730, "prop": 8733, "infin": 8734, "ang": 8736, "and": 8743, "or": 8744, "cap": 8745, "cup": 8746, "int": 8747, "there4": 8756, "sim": 8764, "cong": 8773, "asymp": 8776, "ne": 8800, "equiv": 8801, "le": 8804, "ge": 8805, "sub": 8834, "sup": 8835, "nsub": 8836, "sube": 8838, "supe": 8839, "oplus": 8853, "otimes": 8855, "perp": 8869, "sdot": 8901, "lceil": 8968, "rceil": 8969, "lfloor": 8970, "rfloor": 8971, "lang": 9001, "rang": 9002, "loz": 9674, "spades": 9824, "clubs": 9827, "hearts": 9829, "diams": 9830 });
+});
+BitVector.SMALL_BLOCK_SIZE = 32;
+BitVector.LARGE_BLOCK_SIZE = 256;
+BitVector.BLOCK_RATE = 8;
+$__jsx_lazy_init(BurrowsWheelerTransform, "END_MARKER", function () {
+ return String.fromCharCode(0);
+});
+var $__jsx_classMap = {
+ "tool/web/oktavia-french-search.jsx": {
+ _Main: _Main,
+ _Main$: _Main$
+ },
+ "tool/web/oktavia-search.jsx": {
+ _Result: _Result,
+ _Result$SSSI: _Result$SSSI,
+ _Proposal: _Proposal,
+ _Proposal$SSI: _Proposal$SSI,
+ OktaviaSearch: OktaviaSearch,
+ OktaviaSearch$I: OktaviaSearch$I,
+ _Main: _Main$0,
+ _Main$: _Main$0$
+ },
+ "src/oktavia.jsx": {
+ Oktavia: Oktavia,
+ Oktavia$: Oktavia$
+ },
+ "src/binary-util.jsx": {
+ Binary: Binary,
+ Binary$: Binary$,
+ LoadedStringResult: LoadedStringResult,
+ LoadedStringResult$SI: LoadedStringResult$SI,
+ LoadedStringListResult: LoadedStringListResult,
+ LoadedStringListResult$SI: LoadedStringListResult$SI,
+ LoadedStringListMapResult: LoadedStringListMapResult,
+ LoadedStringListMapResult$SI: LoadedStringListMapResult$SI,
+ LoadedNumberListResult: LoadedNumberListResult,
+ LoadedNumberListResult$SI: LoadedNumberListResult$SI,
+ CompressionReport: CompressionReport,
+ CompressionReport$: CompressionReport$
+ },
+ "src/query.jsx": {
+ Query: Query,
+ Query$: Query$
+ },
+ "src/query-string-parser.jsx": {
+ QueryStringParser: QueryStringParser,
+ QueryStringParser$: QueryStringParser$
+ },
+ "src/search-result.jsx": {
+ Proposal: Proposal,
+ Proposal$II: Proposal$II,
+ Position: Position,
+ Position$SIB: Position$SIB,
+ SearchUnit: SearchUnit,
+ SearchUnit$I: SearchUnit$I,
+ SingleResult: SingleResult,
+ SingleResult$: SingleResult$,
+ SingleResult$SBB: SingleResult$SBB,
+ SearchSummary: SearchSummary,
+ SearchSummary$: SearchSummary$,
+ SearchSummary$LOktavia$: SearchSummary$LOktavia$
+ },
+ "src/style.jsx": {
+ Style: Style,
+ Style$S: Style$S,
+ _HTMLHandler: _HTMLHandler,
+ _HTMLHandler$HASB: _HTMLHandler$HASB
+ },
+ "src/stemmer/stemmer.jsx": {
+ Stemmer: Stemmer,
+ Stemmer$: Stemmer$
+ },
+ "src/stemmer/base-stemmer.jsx": {
+ BaseStemmer: BaseStemmer,
+ BaseStemmer$: BaseStemmer$
+ },
+ "src/stemmer/french-stemmer.jsx": {
+ FrenchStemmer: FrenchStemmer,
+ FrenchStemmer$: FrenchStemmer$
+ },
+ "src/stemmer/among.jsx": {
+ Among: Among,
+ Among$SII: Among$SII,
+ Among$SIIF$LBaseStemmer$B$LBaseStemmer$: Among$SIIF$LBaseStemmer$B$LBaseStemmer$
+ },
+ "src/metadata.jsx": {
+ Metadata: Metadata,
+ Metadata$LOktavia$: Metadata$LOktavia$,
+ Section: Section,
+ Section$LOktavia$: Section$LOktavia$,
+ Splitter: Splitter,
+ Splitter$LOktavia$: Splitter$LOktavia$,
+ Splitter$LOktavia$S: Splitter$LOktavia$S,
+ Table: Table,
+ Table$LOktavia$AS: Table$LOktavia$AS,
+ Block: Block,
+ Block$LOktavia$: Block$LOktavia$
+ },
+ "src/fm-index.jsx": {
+ FMIndex: FMIndex,
+ FMIndex$: FMIndex$
+ },
+ "src/sax.jsx": {
+ Tag: Tag,
+ Tag$S: Tag$S,
+ _Common: _Common,
+ _Common$: _Common$,
+ _State: _State,
+ _State$: _State$,
+ SAXHandler: SAXHandler,
+ SAXHandler$: SAXHandler$,
+ SAXParser: SAXParser,
+ SAXParser$LSAXHandler$: SAXParser$LSAXHandler$,
+ SAXParser$LSAXHandler$B: SAXParser$LSAXHandler$B,
+ Char: Char,
+ Char$: Char$,
+ _Entities: _Entities,
+ _Entities$: _Entities$
+ },
+ "src/bit-vector.jsx": {
+ BitVector: BitVector,
+ BitVector$: BitVector$
+ },
+ "src/wavelet-matrix.jsx": {
+ WaveletMatrix: WaveletMatrix,
+ WaveletMatrix$: WaveletMatrix$
+ },
+ "src/burrows-wheeler-transform.jsx": {
+ BurrowsWheelerTransform: BurrowsWheelerTransform,
+ BurrowsWheelerTransform$: BurrowsWheelerTransform$
+ },
+ "src/sais.jsx": {
+ OArray: OArray,
+ OArray$AI: OArray$AI,
+ OArray$AII: OArray$AII,
+ SAIS: SAIS,
+ SAIS$: SAIS$
+ }
+};
+
+
+/**
+ * launches _Main.main(:string[]):void invoked by jsx --run|--executable
+ */
+JSX.runMain = function (sourceFile, args) {
+ var module = JSX.require(sourceFile);
+ if (! module) {
+ throw new ReferenceError("entry point module not found in " + sourceFile);
+ }
+ if (! module._Main) {
+ throw new ReferenceError("entry point _Main not found in " + sourceFile);
+ }
+ if (! module._Main.main$AS) {
+ throw new ReferenceError("entry point _Main.main(:string[]):void not found in " + sourceFile);
+ }
+ module._Main.main$AS(args);
+};
+
+/**
+ * launches _Test#test*():void invoked by jsx --test
+ */
+JSX.runTests = function (sourceFile, tests) {
+ var module = JSX.require(sourceFile);
+ var testClass = module._Test$;
+
+ if (!testClass) return; // skip if there's no test class
+
+ if(tests.length === 0) {
+ var p = testClass.prototype;
+ for (var m in p) {
+ if (p[m] instanceof Function
+ && /^test.*[$]$/.test(m)) {
+ tests.push(m);
+ }
+ }
+ }
+ else { // set as process arguments
+ tests = tests.map(function (name) {
+ return name + "$"; // mangle for function test*():void
+ });
+ }
+
+ var testCase = new testClass();
+
+ if (testCase.beforeClass$AS != null)
+ testCase.beforeClass$AS(tests);
+
+ for (var i = 0; i < tests.length; ++i) {
+ (function (method) {
+ if (method in testCase) {
+ testCase.run$SF$V$(method, function() { testCase[method](); });
+ }
+ else {
+ throw new ReferenceError("No such test method: " + method);
+ }
+ }(tests[i]));
+ }
+
+ if (testCase.afterClass$ != null)
+ testCase.afterClass$();
+};
+/**
+ * call a function on load/DOMContentLoaded
+ */
+function $__jsx_onload (event) {
+ window.removeEventListener("load", $__jsx_onload);
+ document.removeEventListener("DOMContentLoaded", $__jsx_onload);
+ JSX.runMain("tool/web/oktavia-french-search.jsx", [])
+}
+
+window.addEventListener("load", $__jsx_onload);
+document.addEventListener("DOMContentLoaded", $__jsx_onload);
+
+})(JSX);
diff --git a/web/server/h2o/libh2o/misc/oktavia/lib/oktavia-german-search.js b/web/server/h2o/libh2o/misc/oktavia/lib/oktavia-german-search.js
new file mode 100644
index 00000000..3769dd3c
--- /dev/null
+++ b/web/server/h2o/libh2o/misc/oktavia/lib/oktavia-german-search.js
@@ -0,0 +1,8352 @@
+// generatedy by JSX compiler 0.9.24 (2013-04-05 13:45:00 +0900; 1b229cc6a411f674f0f7cf7a79b7a8b3f8eb7414)
+var JSX = {};
+(function (JSX) {
+/**
+ * copies the implementations from source interface to target
+ */
+function $__jsx_merge_interface(target, source) {
+ for (var k in source.prototype)
+ if (source.prototype.hasOwnProperty(k))
+ target.prototype[k] = source.prototype[k];
+}
+
+/**
+ * defers the initialization of the property
+ */
+function $__jsx_lazy_init(obj, prop, func) {
+ function reset(obj, prop, value) {
+ delete obj[prop];
+ obj[prop] = value;
+ return value;
+ }
+
+ Object.defineProperty(obj, prop, {
+ get: function () {
+ return reset(obj, prop, func());
+ },
+ set: function (v) {
+ reset(obj, prop, v);
+ },
+ enumerable: true,
+ configurable: true
+ });
+}
+
+/**
+ * sideeffect().a /= b
+ */
+function $__jsx_div_assign(obj, prop, divisor) {
+ return obj[prop] = (obj[prop] / divisor) | 0;
+}
+
+/*
+ * global functions, renamed to avoid conflict with local variable names
+ */
+var $__jsx_parseInt = parseInt;
+var $__jsx_parseFloat = parseFloat;
+var $__jsx_isNaN = isNaN;
+var $__jsx_isFinite = isFinite;
+
+var $__jsx_encodeURIComponent = encodeURIComponent;
+var $__jsx_decodeURIComponent = decodeURIComponent;
+var $__jsx_encodeURI = encodeURI;
+var $__jsx_decodeURI = decodeURI;
+
+var $__jsx_ObjectToString = Object.prototype.toString;
+var $__jsx_ObjectHasOwnProperty = Object.prototype.hasOwnProperty;
+
+/*
+ * profiler object, initialized afterwards
+ */
+function $__jsx_profiler() {
+}
+
+/*
+ * public interface to JSX code
+ */
+JSX.require = function (path) {
+ var m = $__jsx_classMap[path];
+ return m !== undefined ? m : null;
+};
+
+JSX.profilerIsRunning = function () {
+ return $__jsx_profiler.getResults != null;
+};
+
+JSX.getProfileResults = function () {
+ return ($__jsx_profiler.getResults || function () { return {}; })();
+};
+
+JSX.postProfileResults = function (url, cb) {
+ if ($__jsx_profiler.postResults == null)
+ throw new Error("profiler has not been turned on");
+ return $__jsx_profiler.postResults(url, cb);
+};
+
+JSX.resetProfileResults = function () {
+ if ($__jsx_profiler.resetResults == null)
+ throw new Error("profiler has not been turned on");
+ return $__jsx_profiler.resetResults();
+};
+JSX.DEBUG = false;
+/**
+ * class _Main extends Object
+ * @constructor
+ */
+function _Main() {
+}
+
+/**
+ * @constructor
+ */
+function _Main$() {
+};
+
+_Main$.prototype = new _Main;
+
+/**
+ * @param {Array.<undefined|!string>} args
+ */
+_Main.main$AS = function (args) {
+ OktaviaSearch$setStemmer$LStemmer$(new GermanStemmer$());
+};
+
+var _Main$main$AS = _Main.main$AS;
+
+/**
+ * class _Result extends Object
+ * @constructor
+ */
+function _Result() {
+}
+
+/**
+ * @constructor
+ * @param {!string} title
+ * @param {!string} url
+ * @param {!string} content
+ * @param {!number} score
+ */
+function _Result$SSSI(title, url, content, score) {
+ this.title = title;
+ this.url = url;
+ this.content = content;
+ this.score = score;
+};
+
+_Result$SSSI.prototype = new _Result;
+
+/**
+ * class _Proposal extends Object
+ * @constructor
+ */
+function _Proposal() {
+}
+
+/**
+ * @constructor
+ * @param {!string} options
+ * @param {!string} label
+ * @param {!number} count
+ */
+function _Proposal$SSI(options, label, count) {
+ this.options = options;
+ this.label = label;
+ this.count = count;
+};
+
+_Proposal$SSI.prototype = new _Proposal;
+
+/**
+ * class OktaviaSearch extends Object
+ * @constructor
+ */
+function OktaviaSearch() {
+}
+
+/**
+ * @constructor
+ * @param {!number} entriesPerPage
+ */
+function OktaviaSearch$I(entriesPerPage) {
+ this._queries = null;
+ this._highlight = "";
+ this._result = null;
+ this._proposals = null;
+ this._currentFolderDepth = 0;
+ this._oktavia = new Oktavia$();
+ this._entriesPerPage = entriesPerPage;
+ this._currentPage = 1;
+ this._queryString = null;
+ this._callback = null;
+ OktaviaSearch._instance = this;
+};
+
+OktaviaSearch$I.prototype = new OktaviaSearch;
+
+/**
+ * @param {Stemmer} stemmer
+ */
+OktaviaSearch.setStemmer$LStemmer$ = function (stemmer) {
+ /** @type {Oktavia} */
+ var this$0;
+ if (OktaviaSearch._instance) {
+ this$0 = OktaviaSearch._instance._oktavia;
+ this$0._stemmer = stemmer;
+ } else {
+ OktaviaSearch._stemmer = stemmer;
+ }
+};
+
+var OktaviaSearch$setStemmer$LStemmer$ = OktaviaSearch.setStemmer$LStemmer$;
+
+/**
+ * @param {!string} index
+ */
+OktaviaSearch.prototype.loadIndex$S = function (index) {
+ /** @type {Oktavia} */
+ var this$0;
+ /** @type {Stemmer} */
+ var stemmer$0;
+ if (OktaviaSearch._stemmer) {
+ this$0 = this._oktavia;
+ stemmer$0 = OktaviaSearch._stemmer;
+ this$0._stemmer = stemmer$0;
+ }
+ this._oktavia.load$S(Binary$base64decode$S(index));
+ if (this._queryString) {
+ this.search$SF$IIV$(this._queryString, this._callback);
+ this._queryString = null;
+ this._callback = null;
+ }
+};
+
+/**
+ * @param {!string} queryString
+ * @param {*} callback
+ */
+OktaviaSearch.prototype.search$SF$IIV$ = function (queryString, callback) {
+ /** @type {QueryStringParser} */
+ var queryParser;
+ /** @type {SearchSummary} */
+ var summary;
+ /** @type {Array.<undefined|SearchUnit>} */
+ var _result$0;
+ if (this._oktavia) {
+ queryParser = ({queries: [ ]});
+ this._queries = QueryStringParser$parse$LQueryStringParser$S(queryParser, queryString);
+ this._highlight = QueryStringParser$highlight$LQueryStringParser$(queryParser);
+ summary = this._oktavia.search$ALQuery$(this._queries);
+ if (SearchSummary$size$LSearchSummary$(summary) > 0) {
+ this._result = this._sortResult$LSearchSummary$(summary);
+ this._proposals = [ ];
+ this._currentPage = 1;
+ } else {
+ this._result = [ ];
+ if (this._queries.length > 1) {
+ this._proposals = SearchSummary$getProposal$LSearchSummary$(summary);
+ } else {
+ this._proposals = [ ];
+ }
+ this._currentPage = 1;
+ }
+ callback((_result$0 = this._result).length, Math.ceil(_result$0.length / this._entriesPerPage));
+ } else {
+ this._queryString = queryString;
+ this._callback = callback;
+ }
+};
+
+/**
+ * @return {!number}
+ */
+OktaviaSearch.prototype.resultSize$ = function () {
+ return (this._result.length | 0);
+};
+
+/**
+ * @return {!number}
+ */
+OktaviaSearch.prototype.totalPages$ = function () {
+ return (Math.ceil(this._result.length / this._entriesPerPage) | 0);
+};
+
+/**
+ * @return {!number}
+ */
+OktaviaSearch.prototype.currentPage$ = function () {
+ return this._currentPage;
+};
+
+/**
+ * @param {!number} page
+ */
+OktaviaSearch.prototype.setCurrentPage$I = function (page) {
+ this._currentPage = page;
+};
+
+/**
+ * @return {!boolean}
+ */
+OktaviaSearch.prototype.hasPrevPage$ = function () {
+ return this._currentPage !== 1;
+};
+
+/**
+ * @return {!boolean}
+ */
+OktaviaSearch.prototype.hasNextPage$ = function () {
+ return this._currentPage !== Math.ceil(this._result.length / this._entriesPerPage);
+};
+
+/**
+ * @return {Array.<undefined|!string>}
+ */
+OktaviaSearch.prototype.pageIndexes$ = function () {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var total;
+ /** @type {!number} */
+ var i;
+ result = [ ];
+ total = Math.ceil(this._result.length / this._entriesPerPage);
+ if (total < 10) {
+ for (i = 1; i <= total; i++) {
+ result.push(i + "");
+ }
+ } else {
+ if (this._currentPage <= 5) {
+ for (i = 1; i <= 7; i++) {
+ result.push(i + "");
+ }
+ result.push('...', total + "");
+ } else {
+ if (total - 5 <= this._currentPage) {
+ result.push('1', '...');
+ for (i = total - 8; i <= total; i++) {
+ result.push(i + "");
+ }
+ } else {
+ result.push('1', '...');
+ for (i = this._currentPage - 3; i <= this._currentPage + 3; i++) {
+ result.push(i + "");
+ }
+ result.push('...', total + "");
+ }
+ }
+ }
+ return result;
+};
+
+/**
+ * @return {Array.<undefined|_Result>}
+ */
+OktaviaSearch.prototype.getResult$ = function () {
+ /** @type {Style} */
+ var style;
+ /** @type {!number} */
+ var start;
+ /** @type {!number} */
+ var last;
+ /** @type {Metadata} */
+ var metadata;
+ /** @type {!number} */
+ var num;
+ /** @type {Array.<undefined|_Result>} */
+ var results;
+ /** @type {!number} */
+ var i;
+ /** @type {SearchUnit} */
+ var unit;
+ /** @type {Array.<undefined|!string>} */
+ var info;
+ /** @type {!string} */
+ var content;
+ /** @type {Array.<undefined|Position>} */
+ var positions;
+ /** @type {!number} */
+ var end;
+ /** @type {!boolean} */
+ var split;
+ /** @type {!number} */
+ var j;
+ /** @type {Position} */
+ var pos;
+ /** @type {!string} */
+ var text;
+ /** @type {Oktavia} */
+ var this$0;
+ /** @type {!number} */
+ var position$0;
+ /** @type {!number} */
+ var _currentPage$0;
+ /** @type {!number} */
+ var _entriesPerPage$0;
+ style = new Style$S('html');
+ start = ((_currentPage$0 = this._currentPage) - 1) * (_entriesPerPage$0 = this._entriesPerPage);
+ last = Math.min(_currentPage$0 * _entriesPerPage$0, this._result.length);
+ this$0 = this._oktavia;
+ metadata = this$0._metadatas[this$0._metadataLabels[0]];
+ num = 250;
+ results = [ ];
+ for (i = start; i < last; i++) {
+ unit = this._result[i];
+ info = metadata.getInformation$I(unit.id).split(Oktavia.eob);
+ content = metadata.getContent$I(unit.id);
+ start = 0;
+ positions = SearchUnit$getPositions$LSearchUnit$(unit);
+ if (content.indexOf(info[0]) === 1) {
+ content = content.slice(info[0].length + 2, content.length);
+ start += info[0].length + 2;
+ }
+ end = start + num;
+ split = false;
+ if (positions[0].position > end - positions[0].word.length) {
+ end = positions[0].position + Math.floor(num / 2);
+ split = true;
+ }
+ for (j = positions.length - 1; j > -1; j--) {
+ pos = positions[j];
+ if (pos.position + pos.word.length < end) {
+ content = [ content.slice(0, pos.position - start), style.convert$S('<hit>*</hit>').replace('*', content.slice((position$0 = pos.position) - start, position$0 + pos.word.length - start)), content.slice(pos.position + pos.word.length - start, content.length) ].join('');
+ }
+ }
+ if (split) {
+ text = [ content.slice(0, Math.floor(num / 2)) + ' ...', content.slice(- Math.floor(num / 2), end - start) ].join('<br/>');
+ } else {
+ text = content.slice(0, end - start) + ' ...<br/>';
+ }
+ text = text.replace(Oktavia.eob, ' ').replace(/(<br\/>)(<br\/>)+/, '<br/><br/>');
+ results.push(({title: info[0], url: info[1], content: text, score: unit.score}));
+ }
+ return results;
+};
+
+/**
+ * @return {!string}
+ */
+OktaviaSearch.prototype.getHighlight$ = function () {
+ return this._highlight;
+};
+
+/**
+ * @return {Array.<undefined|_Proposal>}
+ */
+OktaviaSearch.prototype.getProposals$ = function () {
+ /** @type {Style} */
+ var style;
+ /** @type {Array.<undefined|_Proposal>} */
+ var results;
+ /** @type {!number} */
+ var i;
+ /** @type {Proposal} */
+ var proposal;
+ /** @type {Array.<undefined|!string>} */
+ var label;
+ /** @type {Array.<undefined|!string>} */
+ var option;
+ /** @type {!number} */
+ var j;
+ style = new Style$S('html');
+ results = [ ];
+ if (this._queries.length > 1) {
+ for (i = 0; i < this._proposals.length; i++) {
+ proposal = this._proposals[i];
+ if (proposal.expect > 0) {
+ label = [ ];
+ option = [ ];
+ for (j = 0; j < this._queries.length; j++) {
+ if (j !== proposal.omit) {
+ label.push(style.convert$S('<hit>' + this._queries[j].toString() + '</hit>'));
+ option.push(this._queries[j].toString());
+ } else {
+ label.push(style.convert$S('<del>' + this._queries[j].toString() + '</del>'));
+ }
+ }
+ results.push(({options: option.join(' '), label: label.join('&nbsp;'), count: proposal.expect}));
+ }
+ }
+ }
+ return results;
+};
+
+/**
+ * @param {SearchSummary} summary
+ * @return {Array.<undefined|SearchUnit>}
+ */
+OktaviaSearch.prototype._sortResult$LSearchSummary$ = function (summary) {
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var score;
+ /** @type {SearchUnit} */
+ var unit;
+ /** @type {!string} */
+ var pos;
+ /** @type {Position} */
+ var position;
+ for (i = 0; i < summary.result.units.length; i++) {
+ score = 0;
+ unit = summary.result.units[i];
+ for (pos in unit.positions) {
+ position = unit.positions[pos];
+ if (this._oktavia.wordPositionType$I(position.position)) {
+ score += 10;
+ } else {
+ score += 1;
+ }
+ if (! position.stemmed) {
+ score += 2;
+ }
+ }
+ unit.score = (score | 0);
+ }
+ return SearchSummary$getSortedResult$LSearchSummary$(summary);
+};
+
+/**
+ * class _Main$0 extends Object
+ * @constructor
+ */
+function _Main$0() {
+}
+
+/**
+ * @constructor
+ */
+function _Main$0$() {
+};
+
+_Main$0$.prototype = new _Main$0;
+
+/**
+ * @param {Array.<undefined|!string>} args
+ */
+_Main$0.main$AS = function (args) {
+};
+
+var _Main$0$main$AS = _Main$0.main$AS;
+
+/**
+ * class Oktavia extends Object
+ * @constructor
+ */
+function Oktavia() {
+}
+
+/**
+ * @constructor
+ */
+function Oktavia$() {
+ /** @type {Array.<undefined|!string>} */
+ var _utf162compressCode$0;
+ this._compressCode2utf16 = null;
+ this._fmindex = new FMIndex$();
+ this._metadatas = ({ });
+ this._metadataLabels = [ ];
+ this._stemmer = null;
+ this._stemmingResult = ({ });
+ _utf162compressCode$0 = this._utf162compressCode = [ Oktavia.eof, Oktavia.eob, Oktavia.unknown ];
+ _utf162compressCode$0.length = 65536;
+ this._compressCode2utf16 = [ Oktavia.eof, Oktavia.eob, Oktavia.unknown ];
+};
+
+Oktavia$.prototype = new Oktavia;
+
+/**
+ * @param {Stemmer} stemmer
+ */
+Oktavia.prototype.setStemmer$LStemmer$ = function (stemmer) {
+ this._stemmer = stemmer;
+};
+
+/**
+ * @return {Metadata}
+ */
+Oktavia.prototype.getPrimaryMetadata$ = function () {
+ return this._metadatas[this._metadataLabels[0]];
+};
+
+/**
+ * @param {!string} key
+ * @return {Section}
+ */
+Oktavia.prototype.addSection$S = function (key) {
+ /** @type {Section} */
+ var section;
+ if (this._metadataLabels.indexOf(key) !== -1) {
+ throw new Error('Metadata name ' + key + ' is already exists');
+ }
+ this._metadataLabels.push(key);
+ section = new Section$LOktavia$(this);
+ this._metadatas[key] = section;
+ return section;
+};
+
+/**
+ * @param {!string} key
+ * @return {Section}
+ */
+Oktavia.prototype.getSection$S = function (key) {
+ if (this._metadataLabels.indexOf(key) === -1) {
+ throw new Error('Metadata name ' + key + " does't exists");
+ }
+ return this._metadatas[key];
+};
+
+/**
+ * @param {!string} key
+ * @return {Splitter}
+ */
+Oktavia.prototype.addSplitter$S = function (key) {
+ /** @type {Splitter} */
+ var splitter;
+ if (this._metadataLabels.indexOf(key) !== -1) {
+ throw new Error('Metadata name ' + key + ' is already exists');
+ }
+ this._metadataLabels.push(key);
+ splitter = new Splitter$LOktavia$(this);
+ this._metadatas[key] = splitter;
+ return splitter;
+};
+
+/**
+ * @param {!string} key
+ * @return {Splitter}
+ */
+Oktavia.prototype.getSplitter$S = function (key) {
+ if (this._metadataLabels.indexOf(key) === -1) {
+ throw new Error('Metadata name ' + key + " does't exists");
+ }
+ return this._metadatas[key];
+};
+
+/**
+ * @param {!string} key
+ * @param {Array.<undefined|!string>} headers
+ * @return {Table}
+ */
+Oktavia.prototype.addTable$SAS = function (key, headers) {
+ /** @type {Table} */
+ var table;
+ if (this._metadataLabels.indexOf(key) !== -1) {
+ throw new Error('Metadata name ' + key + ' is already exists');
+ }
+ this._metadataLabels.push(key);
+ table = new Table$LOktavia$AS(this, headers);
+ this._metadatas[key] = table;
+ return table;
+};
+
+/**
+ * @param {!string} key
+ * @return {Table}
+ */
+Oktavia.prototype.getTable$S = function (key) {
+ if (this._metadataLabels.indexOf(key) === -1) {
+ throw new Error('Metadata name ' + key + " does't exists");
+ }
+ return this._metadatas[key];
+};
+
+/**
+ * @param {!string} key
+ * @return {Block}
+ */
+Oktavia.prototype.addBlock$S = function (key) {
+ /** @type {Block} */
+ var block;
+ if (this._metadataLabels.indexOf(key) !== -1) {
+ throw new Error('Metadata name ' + key + ' is already exists');
+ }
+ this._metadataLabels.push(key);
+ block = new Block$LOktavia$(this);
+ this._metadatas[key] = block;
+ return block;
+};
+
+/**
+ * @param {!string} key
+ * @return {Block}
+ */
+Oktavia.prototype.getBlock$S = function (key) {
+ if (this._metadataLabels.indexOf(key) === -1) {
+ throw new Error('Metadata name ' + key + " does't exists");
+ }
+ return this._metadatas[key];
+};
+
+/**
+ */
+Oktavia.prototype.addEndOfBlock$ = function () {
+ this._fmindex.push$S(Oktavia.eob);
+};
+
+/**
+ * @param {!string} words
+ */
+Oktavia.prototype.addWord$S = function (words) {
+ /** @type {Array.<undefined|!string>} */
+ var str;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var charCode;
+ /** @type {undefined|!string} */
+ var newCharCode;
+ str = [ ];
+ str.length = words.length;
+ for (i = 0; i < words.length; i++) {
+ charCode = words.charCodeAt(i);
+ newCharCode = this._utf162compressCode[charCode];
+ if (newCharCode == null) {
+ newCharCode = String.fromCharCode(this._compressCode2utf16.length);
+ this._utf162compressCode[charCode] = newCharCode;
+ this._compressCode2utf16.push(String.fromCharCode(charCode));
+ }
+ str.push(newCharCode);
+ }
+ this._fmindex.push$S(str.join(''));
+};
+
+/**
+ * @param {!string} words
+ * @param {!boolean} stemming
+ */
+Oktavia.prototype.addWord$SB = function (words, stemming) {
+ /** @type {Array.<undefined|!string>} */
+ var wordList;
+ /** @type {!number} */
+ var i;
+ /** @type {undefined|!string} */
+ var originalWord;
+ /** @type {!string} */
+ var smallWord;
+ /** @type {undefined|!string} */
+ var registerWord;
+ /** @type {!string} */
+ var baseWord;
+ /** @type {!string} */
+ var compressedCodeWord;
+ /** @type {Array.<undefined|!string>} */
+ var stemmedList;
+ this.addWord$S(words);
+ wordList = words.split(/\s+/);
+ for (i = 0; i < wordList.length; i++) {
+ originalWord = wordList[i];
+ smallWord = originalWord.slice(0, 1).toLowerCase() + originalWord.slice(1);
+ registerWord = null;
+ if (stemming && this._stemmer) {
+ baseWord = this._stemmer.stemWord$S(originalWord.toLowerCase());
+ if (originalWord.indexOf(baseWord) === -1) {
+ registerWord = baseWord;
+ }
+ } else {
+ if (originalWord != smallWord) {
+ registerWord = smallWord;
+ }
+ }
+ if (registerWord) {
+ compressedCodeWord = this._convertToCompressionCode$S(originalWord);
+ stemmedList = this._stemmingResult[registerWord];
+ if (! stemmedList) {
+ stemmedList = [ compressedCodeWord ];
+ this._stemmingResult[registerWord] = stemmedList;
+ } else {
+ if (stemmedList.indexOf(compressedCodeWord) === -1) {
+ stemmedList.push(compressedCodeWord);
+ }
+ }
+ }
+ }
+};
+
+/**
+ * @param {!string} keyword
+ * @return {!string}
+ */
+Oktavia.prototype._convertToCompressionCode$S = function (keyword) {
+ /** @type {Array.<undefined|!string>} */
+ var resultChars;
+ /** @type {!number} */
+ var i;
+ /** @type {undefined|!string} */
+ var chr;
+ resultChars = [ ];
+ for (i = 0; i < keyword.length; i++) {
+ chr = this._utf162compressCode[keyword.charCodeAt(i)];
+ if (chr == null) {
+ resultChars.push(Oktavia.unknown);
+ } else {
+ resultChars.push(chr);
+ }
+ }
+ return resultChars.join('');
+};
+
+/**
+ * @param {!string} keyword
+ * @param {!boolean} stemming
+ * @return {Array.<undefined|!number>}
+ */
+Oktavia.prototype.rawSearch$SB = function (keyword, stemming) {
+ /** @type {Array.<undefined|!number>} */
+ var result;
+ /** @type {!string} */
+ var baseWord;
+ /** @type {Array.<undefined|!string>} */
+ var stemmedList;
+ /** @type {!number} */
+ var i;
+ /** @type {undefined|!string} */
+ var word;
+ if (stemming) {
+ result = [ ];
+ if (this._stemmer) {
+ baseWord = this._stemmer.stemWord$S(keyword.toLowerCase());
+ stemmedList = this._stemmingResult[baseWord];
+ if (stemmedList) {
+ for (i = 0; i < stemmedList.length; i++) {
+ word = stemmedList[i];
+ result = result.concat(this._fmindex.search$S(word));
+ }
+ }
+ }
+ } else {
+ result = this._fmindex.search$S(this._convertToCompressionCode$S(keyword));
+ }
+ return result;
+};
+
+/**
+ * @param {Array.<undefined|Query>} queries
+ * @return {SearchSummary}
+ */
+Oktavia.prototype.search$ALQuery$ = function (queries) {
+ /** @type {SearchSummary} */
+ var summary;
+ /** @type {!number} */
+ var i;
+ /** @type {SingleResult} */
+ var result$0;
+ summary = ({sourceResults: [ ], result: null, oktavia: this});
+ for (i = 0; i < queries.length; i++) {
+ result$0 = this._searchQuery$LQuery$(queries[i]);
+ summary.sourceResults.push(result$0);
+ }
+ summary.result = SearchSummary$mergeResult$LSearchSummary$ALSingleResult$(summary, summary.sourceResults);
+ return summary;
+};
+
+/**
+ * @param {Query} query
+ * @return {SingleResult}
+ */
+Oktavia.prototype._searchQuery$LQuery$ = function (query) {
+ /** @type {SingleResult} */
+ var result;
+ /** @type {Array.<undefined|!number>} */
+ var positions;
+ result = new SingleResult$SBB(query.word, query.or, query.not);
+ if (query.raw) {
+ positions = this.rawSearch$SB(query.word, false);
+ } else {
+ positions = this.rawSearch$SB(query.word, false).concat(this.rawSearch$SB(query.word, true));
+ }
+ this._metadatas[this._metadataLabels[0]].grouping$LSingleResult$AISB(result, positions, query.word, ! query.raw);
+ return result;
+};
+
+/**
+ */
+Oktavia.prototype.build$ = function () {
+ this.build$IB(5, false);
+};
+
+/**
+ * @param {!number} cacheDensity
+ * @param {!boolean} verbose
+ */
+Oktavia.prototype.build$IB = function (cacheDensity, verbose) {
+ /** @type {!string} */
+ var key;
+ /** @type {!number} */
+ var cacheRange;
+ /** @type {!number} */
+ var maxChar;
+ for (key in this._metadatas) {
+ this._metadatas[key]._build$();
+ }
+ cacheRange = Math.round(Math.max(1, 100 / Math.min(100, Math.max(0.01, cacheDensity))));
+ maxChar = this._compressCode2utf16.length;
+ this._fmindex.build$SIIB(Oktavia.eof, maxChar, cacheRange, verbose);
+};
+
+/**
+ * @return {!string}
+ */
+Oktavia.prototype.dump$ = function () {
+ return this.dump$B(false);
+};
+
+/**
+ * @param {!boolean} verbose
+ * @return {!string}
+ */
+Oktavia.prototype.dump$B = function (verbose) {
+ /** @type {!string} */
+ var header;
+ /** @type {!string} */
+ var fmdata;
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var i;
+ /** @type {CompressionReport} */
+ var report;
+ /** @type {undefined|!string} */
+ var name;
+ /** @type {!string} */
+ var data;
+ header = Binary$dumpString$SLCompressionReport$("oktavia-01", null).slice(1);
+ if (verbose) {
+ console.log("Source text size: " + (this._fmindex.size$() * 2 + "") + ' bytes');
+ }
+ fmdata = this._fmindex.dump$B(verbose);
+ result = [ header, fmdata ];
+ result.push(Binary$dump16bitNumber$I(this._compressCode2utf16.length));
+ for (i = 3; i < this._compressCode2utf16.length; i++) {
+ result.push(this._compressCode2utf16[i]);
+ }
+ if (verbose) {
+ console.log('Char Code Map: ' + (this._compressCode2utf16.length * 2 - 2 + "") + ' bytes');
+ }
+ report = ({source: 0, result: 0});
+ result.push(Binary$dumpStringListMap$HASLCompressionReport$(this._stemmingResult, report));
+ if (verbose) {
+ console.log('Stemmed Word Table: ' + (result[result.length - 1].length + "") + ' bytes (' + (Math.round(report.result * 100.0 / report.source) + "") + '%)');
+ }
+ result.push(Binary$dump16bitNumber$I(this._metadataLabels.length));
+ for (i = 0; i < this._metadataLabels.length; i++) {
+ report = ({source: 0, result: 0});
+ name = this._metadataLabels[i];
+ data = this._metadatas[name]._dump$LCompressionReport$(report);
+ result.push(Binary$dumpString$SLCompressionReport$(name, report), data);
+ if (verbose) {
+ console.log('Meta Data ' + name + ': ' + (data.length * 2 + "") + ' bytes (' + (Math.round(report.result * 100.0 / report.source) + "") + '%)');
+ }
+ }
+ return result.join('');
+};
+
+/**
+ * @param {!string} data
+ */
+Oktavia.prototype.load$S = function (data) {
+ /** @type {!string} */
+ var header;
+ /** @type {!number} */
+ var offset;
+ /** @type {!number} */
+ var charCodeCount;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var charCode;
+ /** @type {LoadedStringListMapResult} */
+ var stemmedWords;
+ /** @type {!number} */
+ var metadataCount;
+ /** @type {LoadedStringResult} */
+ var nameResult;
+ /** @type {!string} */
+ var name;
+ /** @type {!number} */
+ var type;
+ header = Binary$dumpString$SLCompressionReport$("oktavia-01", null).slice(1);
+ if (data.slice(0, 5) !== header) {
+ throw new Error('Invalid data file');
+ }
+ this._metadatas = ({ });
+ this._metadataLabels = [ ];
+ offset = 5;
+ offset = this._fmindex.load$SI(data, offset);
+ charCodeCount = Binary$load16bitNumber$SI(data, offset++);
+ this._compressCode2utf16 = [ Oktavia.eof, Oktavia.eob, Oktavia.unknown ];
+ this._utf162compressCode = [ Oktavia.eof, Oktavia.eob, Oktavia.unknown ];
+ for (i = 3; i < charCodeCount; i++) {
+ charCode = Binary$load16bitNumber$SI(data, offset++);
+ this._compressCode2utf16.push(String.fromCharCode(charCode));
+ this._utf162compressCode[charCode] = String.fromCharCode(i);
+ }
+ stemmedWords = Binary$loadStringListMap$SI(data, offset);
+ this._stemmingResult = stemmedWords.result;
+ offset = stemmedWords.offset;
+ metadataCount = Binary$load16bitNumber$SI(data, offset++);
+ for (i = 0; i < metadataCount; i++) {
+ nameResult = Binary$loadString$SI(data, offset);
+ name = nameResult.result;
+ offset = nameResult.offset;
+ type = Binary$load16bitNumber$SI(data, offset++);
+ switch (type) {
+ case 0:
+ offset = Section$_load$LOktavia$SSI(this, name, data, offset);
+ break;
+ case 1:
+ offset = Splitter$_load$LOktavia$SSI(this, name, data, offset);
+ break;
+ case 2:
+ offset = Table$_load$LOktavia$SSI(this, name, data, offset);
+ break;
+ case 3:
+ offset = Block$_load$LOktavia$SSI(this, name, data, offset);
+ break;
+ }
+ }
+};
+
+/**
+ * @return {!number}
+ */
+Oktavia.prototype.contentSize$ = function () {
+ /** @type {FMIndex} */
+ var this$0;
+ this$0 = this._fmindex;
+ return this$0._substr.length;
+};
+
+/**
+ * @param {!number} position
+ * @return {!number}
+ */
+Oktavia.prototype.wordPositionType$I = function (position) {
+ /** @type {!number} */
+ var result;
+ /** @type {!string} */
+ var ahead;
+ result = 0;
+ if (position === 0) {
+ result = 4;
+ } else {
+ ahead = this._fmindex.getSubstring$II(position - 1, 1);
+ if (/\s/.test(ahead)) {
+ result = 2;
+ } else {
+ if (/\W/.test(ahead)) {
+ result = 1;
+ } else {
+ if (Oktavia.eob === ahead) {
+ result = 3;
+ }
+ }
+ }
+ }
+ return (result | 0);
+};
+
+/**
+ * @param {!number} position
+ * @param {!number} length
+ * @return {!string}
+ */
+Oktavia.prototype._getSubstring$II = function (position, length) {
+ /** @type {!string} */
+ var result;
+ /** @type {Array.<undefined|!string>} */
+ var str;
+ /** @type {!number} */
+ var i;
+ result = this._fmindex.getSubstring$II(position, length);
+ str = [ ];
+ for (i = 0; i < result.length; i++) {
+ str.push(this._compressCode2utf16[result.charCodeAt(i)]);
+ }
+ return str.join('');
+};
+
+/**
+ * class Binary extends Object
+ * @constructor
+ */
+function Binary() {
+}
+
+/**
+ * @constructor
+ */
+function Binary$() {
+};
+
+Binary$.prototype = new Binary;
+
+/**
+ * @param {!number} num
+ * @return {!string}
+ */
+Binary.dump32bitNumber$N = function (num) {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ result = [ String.fromCharCode(Math.floor(num / 65536)) ];
+ result.push(String.fromCharCode(num % 65536));
+ return result.join("");
+};
+
+var Binary$dump32bitNumber$N = Binary.dump32bitNumber$N;
+
+/**
+ * @param {!string} buffer
+ * @param {!number} offset
+ * @return {!number}
+ */
+Binary.load32bitNumber$SI = function (buffer, offset) {
+ /** @type {!number} */
+ var result;
+ result = buffer.charCodeAt(offset) * 65536 + buffer.charCodeAt(offset + 1);
+ return result;
+};
+
+var Binary$load32bitNumber$SI = Binary.load32bitNumber$SI;
+
+/**
+ * @param {!number} num
+ * @return {!string}
+ */
+Binary.dump16bitNumber$I = function (num) {
+ return String.fromCharCode(num % 65536);
+};
+
+var Binary$dump16bitNumber$I = Binary.dump16bitNumber$I;
+
+/**
+ * @param {!string} buffer
+ * @param {!number} offset
+ * @return {!number}
+ */
+Binary.load16bitNumber$SI = function (buffer, offset) {
+ return (buffer.charCodeAt(offset) | 0);
+};
+
+var Binary$load16bitNumber$SI = Binary.load16bitNumber$SI;
+
+/**
+ * @param {!string} str
+ * @return {!string}
+ */
+Binary.dumpString$S = function (str) {
+ return Binary$dumpString$SLCompressionReport$(str, null);
+};
+
+var Binary$dumpString$S = Binary.dumpString$S;
+
+/**
+ * @param {!string} str
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+Binary.dumpString$SLCompressionReport$ = function (str, report) {
+ /** @type {!number} */
+ var length;
+ /** @type {!boolean} */
+ var compress;
+ /** @type {Array.<undefined|!number>} */
+ var charCodes;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var charCode;
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {undefined|!number} */
+ var bytes;
+ if (str.length > 32768) {
+ str = str.slice(0, 32768);
+ }
+ length = str.length;
+ compress = true;
+ charCodes = [ ];
+ for (i = 0; i < length; i++) {
+ charCode = str.charCodeAt(i);
+ if (charCode > 255) {
+ compress = false;
+ break;
+ }
+ charCodes.push(charCode);
+ }
+ if (compress) {
+ result = [ Binary$dump16bitNumber$I(length + 32768) ];
+ for (i = 0; i < length; i += 2) {
+ bytes = charCodes[i];
+ if (i !== length - 1) {
+ bytes += charCodes[i + 1] << 8;
+ }
+ result.push(String.fromCharCode(bytes % 65536));
+ }
+ if (report) {
+ CompressionReport$add$LCompressionReport$II(report, length, Math.ceil(length / 2));
+ }
+ } else {
+ result = [ Binary$dump16bitNumber$I(length), str ];
+ if (report) {
+ CompressionReport$add$LCompressionReport$II(report, length, length);
+ }
+ }
+ return result.join('');
+};
+
+var Binary$dumpString$SLCompressionReport$ = Binary.dumpString$SLCompressionReport$;
+
+/**
+ * @param {!string} buffer
+ * @param {!number} offset
+ * @return {LoadedStringResult}
+ */
+Binary.loadString$SI = function (buffer, offset) {
+ return new LoadedStringResult$SI(buffer, offset);
+};
+
+var Binary$loadString$SI = Binary.loadString$SI;
+
+/**
+ * @param {Array.<undefined|!string>} strList
+ * @return {!string}
+ */
+Binary.dumpStringList$AS = function (strList) {
+ return Binary$dumpStringList$ASLCompressionReport$(strList, null);
+};
+
+var Binary$dumpStringList$AS = Binary.dumpStringList$AS;
+
+/**
+ * @param {Array.<undefined|!string>} strList
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+Binary.dumpStringList$ASLCompressionReport$ = function (strList, report) {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var i;
+ result = [ Binary$dump32bitNumber$N(strList.length) ];
+ for (i = 0; i < strList.length; i++) {
+ result.push(Binary$dumpString$SLCompressionReport$(strList[i], report));
+ }
+ return result.join('');
+};
+
+var Binary$dumpStringList$ASLCompressionReport$ = Binary.dumpStringList$ASLCompressionReport$;
+
+/**
+ * @param {!string} buffer
+ * @param {!number} offset
+ * @return {LoadedStringListResult}
+ */
+Binary.loadStringList$SI = function (buffer, offset) {
+ return new LoadedStringListResult$SI(buffer, offset);
+};
+
+var Binary$loadStringList$SI = Binary.loadStringList$SI;
+
+/**
+ * @param {Object.<string, undefined|Array.<undefined|!string>>} strMap
+ * @return {!string}
+ */
+Binary.dumpStringListMap$HAS = function (strMap) {
+ return Binary$dumpStringListMap$HASLCompressionReport$(strMap, null);
+};
+
+var Binary$dumpStringListMap$HAS = Binary.dumpStringListMap$HAS;
+
+/**
+ * @param {Object.<string, undefined|Array.<undefined|!string>>} strMap
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+Binary.dumpStringListMap$HASLCompressionReport$ = function (strMap, report) {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var counter;
+ /** @type {!string} */
+ var key;
+ result = [ ];
+ counter = 0;
+ for (key in strMap) {
+ result.push(Binary$dumpString$SLCompressionReport$(key, report));
+ result.push(Binary$dumpStringList$ASLCompressionReport$(strMap[key], report));
+ counter++;
+ }
+ return Binary$dump32bitNumber$N(counter) + result.join('');
+};
+
+var Binary$dumpStringListMap$HASLCompressionReport$ = Binary.dumpStringListMap$HASLCompressionReport$;
+
+/**
+ * @param {!string} buffer
+ * @param {!number} offset
+ * @return {LoadedStringListMapResult}
+ */
+Binary.loadStringListMap$SI = function (buffer, offset) {
+ return new LoadedStringListMapResult$SI(buffer, offset);
+};
+
+var Binary$loadStringListMap$SI = Binary.loadStringListMap$SI;
+
+/**
+ * @param {Array.<undefined|!number>} array
+ * @return {!string}
+ */
+Binary.dump32bitNumberList$AN = function (array) {
+ return Binary$dump32bitNumberList$ANLCompressionReport$(array, null);
+};
+
+var Binary$dump32bitNumberList$AN = Binary.dump32bitNumberList$AN;
+
+/**
+ * @param {Array.<undefined|!number>} array
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+Binary.dump32bitNumberList$ANLCompressionReport$ = function (array, report) {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var index;
+ /** @type {!number} */
+ var inputLength;
+ /** @type {!number} */
+ var length;
+ /** @type {!string} */
+ var resultString;
+ /** @type {!number} */
+ var value1$0;
+ /** @type {!number} */
+ var value2$0;
+ result = [ Binary$dump32bitNumber$N(array.length) ];
+ index = 0;
+ inputLength = array.length;
+ while (index < inputLength) {
+ if (array[index] == 0) {
+ length = Binary$_countZero$ANI(array, index);
+ result.push(Binary$_zeroBlock$I(length));
+ index += length;
+ } else {
+ if (Binary$_shouldZebraCode$ANI(array, index)) {
+ result.push(Binary$_createZebraCode$ANI(array, index));
+ value1$0 = array.length;
+ value2$0 = index + 15;
+ index = (value1$0 <= value2$0 ? value1$0 : value2$0);
+ } else {
+ length = Binary$_searchDoubleZero$ANI(array, index);
+ result.push(Binary$_nonZeroBlock$ANII(array, index, length));
+ if (length === 0) {
+ throw new Error('');
+ }
+ index += length;
+ }
+ }
+ }
+ resultString = result.join('');
+ if (report) {
+ CompressionReport$add$LCompressionReport$II(report, array.length * 2 + 2, resultString.length);
+ }
+ return resultString;
+};
+
+var Binary$dump32bitNumberList$ANLCompressionReport$ = Binary.dump32bitNumberList$ANLCompressionReport$;
+
+/**
+ * @param {!string} buffer
+ * @param {!number} offset
+ * @return {LoadedNumberListResult}
+ */
+Binary.load32bitNumberList$SI = function (buffer, offset) {
+ return new LoadedNumberListResult$SI(buffer, offset);
+};
+
+var Binary$load32bitNumberList$SI = Binary.load32bitNumberList$SI;
+
+/**
+ * @param {Array.<undefined|!number>} array
+ * @param {!number} offset
+ * @return {!number}
+ */
+Binary._countZero$ANI = function (array, offset) {
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var array$len$0;
+ for ((i = offset, array$len$0 = array.length); i < array$len$0; i++) {
+ if (array[i] != 0) {
+ return (i - offset | 0);
+ }
+ }
+ return (array.length - offset | 0);
+};
+
+var Binary$_countZero$ANI = Binary._countZero$ANI;
+
+/**
+ * @param {!number} length
+ * @return {!string}
+ */
+Binary._zeroBlock$I = function (length) {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ result = [ ];
+ while (length > 0) {
+ if (length > 16384) {
+ result.push(Binary$dump16bitNumber$I(16383));
+ length -= 16384;
+ } else {
+ result.push(Binary$dump16bitNumber$I(length - 1));
+ length = 0;
+ }
+ }
+ return result.join('');
+};
+
+var Binary$_zeroBlock$I = Binary._zeroBlock$I;
+
+/**
+ * @param {Array.<undefined|!number>} array
+ * @param {!number} offset
+ * @return {!boolean}
+ */
+Binary._shouldZebraCode$ANI = function (array, offset) {
+ /** @type {!number} */
+ var change;
+ /** @type {!boolean} */
+ var isLastZero;
+ /** @type {!number} */
+ var i;
+ if (array.length - offset < 16) {
+ return true;
+ }
+ change = 0;
+ isLastZero = false;
+ for (i = offset; i < offset + 15; i++) {
+ if (array[i] == 0) {
+ if (! isLastZero) {
+ isLastZero = true;
+ change++;
+ }
+ } else {
+ if (isLastZero) {
+ isLastZero = false;
+ change++;
+ }
+ }
+ }
+ return change > 2;
+};
+
+var Binary$_shouldZebraCode$ANI = Binary._shouldZebraCode$ANI;
+
+/**
+ * @param {Array.<undefined|!number>} array
+ * @param {!number} offset
+ * @return {!number}
+ */
+Binary._searchDoubleZero$ANI = function (array, offset) {
+ /** @type {!boolean} */
+ var isLastZero;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var array$len$0;
+ isLastZero = false;
+ for ((i = offset, array$len$0 = array.length); i < array$len$0; i++) {
+ if (array[i] == 0) {
+ if (isLastZero) {
+ return (i - offset - 1 | 0);
+ }
+ isLastZero = true;
+ } else {
+ isLastZero = false;
+ }
+ }
+ return (array.length - offset | 0);
+};
+
+var Binary$_searchDoubleZero$ANI = Binary._searchDoubleZero$ANI;
+
+/**
+ * @param {Array.<undefined|!number>} array
+ * @param {!number} offset
+ * @param {!number} length
+ * @return {!string}
+ */
+Binary._nonZeroBlock$ANII = function (array, offset, length) {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var blockLength;
+ /** @type {!number} */
+ var i;
+ result = [ ];
+ while (length > 0) {
+ if (length > 16384) {
+ blockLength = 16384;
+ length -= 16384;
+ } else {
+ blockLength = length;
+ length = 0;
+ }
+ result.push(Binary$dump16bitNumber$I(blockLength - 1 + 0x4000));
+ for (i = offset; i < offset + blockLength; i++) {
+ result.push(Binary$dump32bitNumber$N(array[i]));
+ }
+ offset += blockLength;
+ }
+ return result.join('');
+};
+
+var Binary$_nonZeroBlock$ANII = Binary._nonZeroBlock$ANII;
+
+/**
+ * @param {Array.<undefined|!number>} array
+ * @param {!number} offset
+ * @return {!string}
+ */
+Binary._createZebraCode$ANI = function (array, offset) {
+ /** @type {!number} */
+ var last;
+ /** @type {!number} */
+ var code;
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var value1$0;
+ /** @type {!number} */
+ var value2$0;
+ value1$0 = offset + 15;
+ value2$0 = array.length;
+ last = (value1$0 <= value2$0 ? value1$0 : value2$0);
+ code = 0x8000;
+ result = [ ];
+ for (i = offset; i < last; i++) {
+ if (array[i] != 0) {
+ result.push(Binary$dump32bitNumber$N(array[i]));
+ code = code + (0x1 << i - offset);
+ }
+ }
+ return String.fromCharCode(code) + result.join('');
+};
+
+var Binary$_createZebraCode$ANI = Binary._createZebraCode$ANI;
+
+/**
+ * @param {!string} str
+ * @return {!string}
+ */
+Binary.base64encode$S = function (str) {
+ /** @type {Array.<undefined|!string>} */
+ var out;
+ /** @type {Array.<undefined|!number>} */
+ var source;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var code;
+ /** @type {!number} */
+ var len;
+ /** @type {!number} */
+ var c1;
+ /** @type {undefined|!number} */
+ var c2;
+ /** @type {undefined|!number} */
+ var c3;
+ out = [ ];
+ source = [ ];
+ for (i = 0; i < str.length; i++) {
+ code = str.charCodeAt(i);
+ source.push(code & 0x00ff, code >>> 8);
+ }
+ len = str.length * 2;
+ i = 0;
+ while (i < len) {
+ c1 = source[i++] & 0xff;
+ if (i === len) {
+ out.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(c1 >> 2));
+ out.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((c1 & 0x3) << 4));
+ out.push("==");
+ break;
+ }
+ c2 = source[i++];
+ if (i === len) {
+ out.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(c1 >> 2));
+ out.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((c1 & 0x3) << 4 | (c2 & 0xF0) >> 4));
+ out.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((c2 & 0xF) << 2));
+ out.push("=");
+ break;
+ }
+ c3 = source[i++];
+ out.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(c1 >> 2));
+ out.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((c1 & 0x3) << 4 | (c2 & 0xF0) >> 4));
+ out.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((c2 & 0xF) << 2 | (c3 & 0xC0) >> 6));
+ out.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(c3 & 0x3F));
+ }
+ return out.join('');
+};
+
+var Binary$base64encode$S = Binary.base64encode$S;
+
+/**
+ * @param {Array.<undefined|!number>} source
+ * @return {!string}
+ */
+Binary._mergeCharCode$AI = function (source) {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var i;
+ result = [ ];
+ for (i = 0; i < source.length; i += 2) {
+ result.push(String.fromCharCode(source[i] + (source[i + 1] << 8)));
+ }
+ return result.join('');
+};
+
+var Binary$_mergeCharCode$AI = Binary._mergeCharCode$AI;
+
+/**
+ * @param {!string} str
+ * @return {!string}
+ */
+Binary.base64decode$S = function (str) {
+ /** @type {!number} */
+ var len;
+ /** @type {!number} */
+ var i;
+ /** @type {Array.<undefined|!number>} */
+ var out;
+ /** @type {undefined|!number} */
+ var c1;
+ /** @type {undefined|!number} */
+ var c2;
+ /** @type {!number} */
+ var c3;
+ /** @type {!number} */
+ var c4;
+ len = str.length;
+ i = 0;
+ out = [ ];
+ while (i < len) {
+ do {
+ c1 = Binary._base64DecodeChars[str.charCodeAt(i++) & 0xff];
+ } while (i < len && c1 == -1);
+ if (c1 == -1) {
+ break;
+ }
+ do {
+ c2 = Binary._base64DecodeChars[str.charCodeAt(i++) & 0xff];
+ } while (i < len && c2 == -1);
+ if (c2 == -1) {
+ break;
+ }
+ out.push(c1 << 2 | (c2 & 0x30) >> 4);
+ do {
+ c3 = str.charCodeAt(i++) & 0xff;
+ if (c3 === 61) {
+ return Binary$_mergeCharCode$AI(out);
+ }
+ c3 = Binary._base64DecodeChars[c3];
+ } while (i < len && c3 === -1);
+ if (c3 === -1) {
+ break;
+ }
+ out.push((c2 & 0XF) << 4 | (c3 & 0x3C) >> 2);
+ do {
+ c4 = str.charCodeAt(i++) & 0xff;
+ if (c4 === 61) {
+ return Binary$_mergeCharCode$AI(out);
+ }
+ c4 = (Binary._base64DecodeChars[c4] | 0);
+ } while (i < len && c4 === -1);
+ if (c4 === -1) {
+ break;
+ }
+ out.push((c3 & 0x03) << 6 | c4);
+ }
+ return Binary$_mergeCharCode$AI(out);
+};
+
+var Binary$base64decode$S = Binary.base64decode$S;
+
+/**
+ * class LoadedStringResult extends Object
+ * @constructor
+ */
+function LoadedStringResult() {
+}
+
+/**
+ * @constructor
+ * @param {!string} data
+ * @param {!number} offset
+ */
+function LoadedStringResult$SI(data, offset) {
+ /** @type {!number} */
+ var strLength;
+ /** @type {Array.<undefined|!string>} */
+ var bytes;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var code;
+ /** @type {!number} */
+ var offset$0;
+ this.result = "";
+ this.offset = 0;
+ offset$0 = offset++;
+ strLength = data.charCodeAt(offset$0);
+ if (strLength > 32767) {
+ strLength = strLength - 32768;
+ bytes = [ ];
+ for (i = 0; i < strLength; i += 2) {
+ code = data.charCodeAt(offset);
+ bytes.push(String.fromCharCode(code & 0x00ff));
+ if (i !== strLength - 1) {
+ bytes.push(String.fromCharCode(code >>> 8));
+ }
+ offset++;
+ }
+ this.result = bytes.join('');
+ this.offset = offset;
+ } else {
+ this.result = data.slice(offset, offset + strLength);
+ this.offset = (offset + strLength | 0);
+ }
+};
+
+LoadedStringResult$SI.prototype = new LoadedStringResult;
+
+/**
+ * class LoadedStringListResult extends Object
+ * @constructor
+ */
+function LoadedStringListResult() {
+}
+
+/**
+ * @constructor
+ * @param {!string} data
+ * @param {!number} offset
+ */
+function LoadedStringListResult$SI(data, offset) {
+ /** @type {!number} */
+ var length;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var strLength;
+ /** @type {!string} */
+ var resultStr;
+ /** @type {Array.<undefined|!string>} */
+ var bytes;
+ /** @type {!number} */
+ var j;
+ /** @type {!number} */
+ var code;
+ /** @type {!number} */
+ var result$0;
+ /** @type {!number} */
+ var offset$0;
+ this.offset = 0;
+ this.result = [ ];
+ result$0 = data.charCodeAt(offset) * 65536 + data.charCodeAt(offset + 1);
+ length = result$0;
+ offset += 2;
+ for (i = 0; i < length; i++) {
+ offset$0 = offset++;
+ strLength = data.charCodeAt(offset$0);
+ if (strLength > 32767) {
+ strLength = strLength - 32768;
+ bytes = [ ];
+ for (j = 0; j < strLength; j += 2) {
+ code = data.charCodeAt(offset);
+ bytes.push(String.fromCharCode(code & 0x00ff));
+ if (j !== strLength - 1) {
+ bytes.push(String.fromCharCode(code >>> 8));
+ }
+ offset++;
+ }
+ resultStr = bytes.join('');
+ } else {
+ resultStr = data.slice(offset, offset + strLength);
+ offset = (offset + strLength | 0);
+ }
+ this.result.push(resultStr);
+ }
+ this.offset = offset;
+};
+
+LoadedStringListResult$SI.prototype = new LoadedStringListResult;
+
+/**
+ * class LoadedStringListMapResult extends Object
+ * @constructor
+ */
+function LoadedStringListMapResult() {
+}
+
+/**
+ * @constructor
+ * @param {!string} data
+ * @param {!number} offset
+ */
+function LoadedStringListMapResult$SI(data, offset) {
+ /** @type {!number} */
+ var length;
+ /** @type {!number} */
+ var i;
+ /** @type {LoadedStringResult} */
+ var keyResult;
+ /** @type {LoadedStringListResult} */
+ var valueResult;
+ /** @type {!number} */
+ var result$0;
+ /** @type {!number} */
+ var offset$0;
+ this.offset = 0;
+ this.result = ({ });
+ result$0 = data.charCodeAt(offset) * 65536 + data.charCodeAt(offset + 1);
+ length = result$0;
+ offset += 2;
+ for (i = 0; i < length; i++) {
+ keyResult = new LoadedStringResult$SI(data, offset);
+ offset$0 = keyResult.offset;
+ valueResult = new LoadedStringListResult$SI(data, offset$0);
+ this.result[keyResult.result] = valueResult.result;
+ offset = valueResult.offset;
+ }
+ this.offset = offset;
+};
+
+LoadedStringListMapResult$SI.prototype = new LoadedStringListMapResult;
+
+/**
+ * class LoadedNumberListResult extends Object
+ * @constructor
+ */
+function LoadedNumberListResult() {
+}
+
+/**
+ * @constructor
+ * @param {!string} data
+ * @param {!number} offset
+ */
+function LoadedNumberListResult$SI(data, offset) {
+ /** @type {!number} */
+ var resultLength;
+ /** @type {!number} */
+ var originalOffset;
+ /** @type {Array.<undefined|!number>} */
+ var result;
+ /** @type {!number} */
+ var tag;
+ /** @type {!number} */
+ var length;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var result$0;
+ /** @type {!number} */
+ var value1$0;
+ this.result = null;
+ this.offset = 0;
+ result$0 = data.charCodeAt(offset) * 65536 + data.charCodeAt(offset + 1);
+ resultLength = result$0;
+ originalOffset = offset;
+ offset += 2;
+ result = [ ];
+ while (result.length < resultLength) {
+ tag = data.charCodeAt(offset++);
+ if (tag >>> 15 === 1) {
+ value1$0 = resultLength - result.length;
+ length = (value1$0 <= 15 ? value1$0 : 15);
+ for (i = 0; i < length; i++) {
+ if (tag >>> i & 0x1) {
+ result.push(Binary$load32bitNumber$SI(data, offset));
+ offset += 2;
+ } else {
+ result.push(0);
+ }
+ }
+ } else {
+ if (tag >>> 14 === 1) {
+ length = tag - 0x4000 + 1;
+ for (i = 0; i < length; i++) {
+ result.push(Binary$load32bitNumber$SI(data, offset));
+ offset += 2;
+ }
+ } else {
+ length = tag + 1;
+ for (i = 0; i < length; i++) {
+ result.push(0);
+ }
+ }
+ }
+ }
+ this.result = result;
+ this.offset = offset;
+};
+
+LoadedNumberListResult$SI.prototype = new LoadedNumberListResult;
+
+/**
+ * class CompressionReport extends Object
+ * @constructor
+ */
+function CompressionReport() {
+}
+
+/**
+ * @constructor
+ */
+function CompressionReport$() {
+ this.source = 0;
+ this.result = 0;
+};
+
+CompressionReport$.prototype = new CompressionReport;
+
+/**
+ * @param {CompressionReport} $this
+ * @param {!number} source
+ * @param {!number} result
+ */
+CompressionReport.add$LCompressionReport$II = function ($this, source, result) {
+ $this.source += source;
+ $this.result += result;
+};
+
+var CompressionReport$add$LCompressionReport$II = CompressionReport.add$LCompressionReport$II;
+
+/**
+ * @param {CompressionReport} $this
+ * @return {!number}
+ */
+CompressionReport.rate$LCompressionReport$ = function ($this) {
+ return (Math.round($this.result * 100.0 / $this.source) | 0);
+};
+
+var CompressionReport$rate$LCompressionReport$ = CompressionReport.rate$LCompressionReport$;
+
+/**
+ * class Query extends Object
+ * @constructor
+ */
+function Query() {
+}
+
+/**
+ * @constructor
+ */
+function Query$() {
+ this.word = '';
+ this.or = false;
+ this.not = false;
+ this.raw = false;
+};
+
+Query$.prototype = new Query;
+
+/**
+ * @return {!string}
+ */
+Query.prototype.toString = function () {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ result = [ ];
+ if (this.or) {
+ result.push("OR ");
+ }
+ if (this.not) {
+ result.push("-");
+ }
+ if (this.raw) {
+ result.push('"', this.word, '"');
+ } else {
+ result.push(this.word);
+ }
+ return result.join('');
+};
+
+/**
+ * class QueryStringParser extends Object
+ * @constructor
+ */
+function QueryStringParser() {
+}
+
+/**
+ * @constructor
+ */
+function QueryStringParser$() {
+ this.queries = [ ];
+};
+
+QueryStringParser$.prototype = new QueryStringParser;
+
+/**
+ * @param {QueryStringParser} $this
+ * @param {!string} queryString
+ * @return {Array.<undefined|Query>}
+ */
+QueryStringParser.parse$LQueryStringParser$S = function ($this, queryString) {
+ /** @type {!boolean} */
+ var nextOr;
+ /** @type {!boolean} */
+ var nextNot;
+ /** @type {!number} */
+ var currentWordStart;
+ /** @type {!number} */
+ var status;
+ /** @type {RegExp} */
+ var isSpace;
+ /** @type {!number} */
+ var i;
+ /** @type {!string} */
+ var ch;
+ /** @type {!string} */
+ var word;
+ /** @type {Query} */
+ var query;
+ nextOr = false;
+ nextNot = false;
+ currentWordStart = 0;
+ status = 0;
+ isSpace = /[\s\u3000]/;
+ for (i = 0; i < queryString.length; i++) {
+ ch = queryString.charAt(i);
+ switch (status) {
+ case 0:
+ if (! isSpace.test(ch)) {
+ if (ch === '-') {
+ nextNot = true;
+ } else {
+ if (ch === '"') {
+ currentWordStart = i + 1;
+ status = 2;
+ } else {
+ currentWordStart = i;
+ status = 1;
+ }
+ }
+ } else {
+ nextNot = false;
+ }
+ break;
+ case 1:
+ if (isSpace.test(ch)) {
+ word = queryString.slice(currentWordStart, i);
+ if (word === 'OR') {
+ nextOr = true;
+ } else {
+ query = new Query$();
+ query.word = word;
+ query.or = nextOr;
+ query.not = nextNot;
+ $this.queries.push(query);
+ nextOr = false;
+ nextNot = false;
+ }
+ status = 0;
+ }
+ break;
+ case 2:
+ if (ch === '"') {
+ word = queryString.slice(currentWordStart, i);
+ query = new Query$();
+ query.word = word;
+ query.or = nextOr;
+ query.not = nextNot;
+ query.raw = true;
+ $this.queries.push(query);
+ nextOr = false;
+ nextNot = false;
+ status = 0;
+ }
+ break;
+ }
+ }
+ switch (status) {
+ case 0:
+ break;
+ case 1:
+ query = new Query$();
+ word = queryString.slice(currentWordStart, queryString.length);
+ if (word !== 'OR') {
+ query.word = word;
+ query.or = nextOr;
+ query.not = nextNot;
+ $this.queries.push(query);
+ }
+ break;
+ case 2:
+ query = new Query$();
+ query.word = queryString.slice(currentWordStart, queryString.length);
+ query.or = nextOr;
+ query.not = nextNot;
+ query.raw = true;
+ $this.queries.push(query);
+ break;
+ }
+ return $this.queries;
+};
+
+var QueryStringParser$parse$LQueryStringParser$S = QueryStringParser.parse$LQueryStringParser$S;
+
+/**
+ * @param {QueryStringParser} $this
+ * @return {!string}
+ */
+QueryStringParser.highlight$LQueryStringParser$ = function ($this) {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var i;
+ /** @type {Query} */
+ var query;
+ result = [ ];
+ for (i = 0; i < $this.queries.length; i++) {
+ query = $this.queries[i];
+ if (! query.not) {
+ result.push("highlight=" + $__jsx_encodeURIComponent(query.word));
+ }
+ }
+ return '?' + result.join('&');
+};
+
+var QueryStringParser$highlight$LQueryStringParser$ = QueryStringParser.highlight$LQueryStringParser$;
+
+/**
+ * class Proposal extends Object
+ * @constructor
+ */
+function Proposal() {
+}
+
+/**
+ * @constructor
+ * @param {!number} omit
+ * @param {!number} expect
+ */
+function Proposal$II(omit, expect) {
+ this.omit = omit;
+ this.expect = expect;
+};
+
+Proposal$II.prototype = new Proposal;
+
+/**
+ * class Position extends Object
+ * @constructor
+ */
+function Position() {
+}
+
+/**
+ * @constructor
+ * @param {!string} word
+ * @param {!number} position
+ * @param {!boolean} stemmed
+ */
+function Position$SIB(word, position, stemmed) {
+ this.word = word;
+ this.position = position;
+ this.stemmed = stemmed;
+};
+
+Position$SIB.prototype = new Position;
+
+/**
+ * class SearchUnit extends Object
+ * @constructor
+ */
+function SearchUnit() {
+}
+
+/**
+ * @constructor
+ * @param {!number} id
+ */
+function SearchUnit$I(id) {
+ this.positions = ({ });
+ this.id = id;
+ this._size = 0;
+ this.score = 0;
+ this.startPosition = -1;
+};
+
+SearchUnit$I.prototype = new SearchUnit;
+
+/**
+ * @param {SearchUnit} $this
+ * @param {!string} word
+ * @param {!number} position
+ * @param {!boolean} stemmed
+ */
+SearchUnit.addPosition$LSearchUnit$SIB = function ($this, word, position, stemmed) {
+ /** @type {Position} */
+ var positionObj;
+ positionObj = $this.positions[position + ""];
+ if (! positionObj) {
+ $this._size++;
+ $this.positions[position + ""] = ({word: word, position: position, stemmed: stemmed});
+ } else {
+ if (positionObj.word.length < word.length) {
+ positionObj.word = word;
+ }
+ positionObj.stemmed = positionObj.stemmed && stemmed;
+ }
+};
+
+var SearchUnit$addPosition$LSearchUnit$SIB = SearchUnit.addPosition$LSearchUnit$SIB;
+
+/**
+ * @param {SearchUnit} $this
+ * @param {!number} position
+ * @return {Position}
+ */
+SearchUnit.get$LSearchUnit$I = function ($this, position) {
+ return $this.positions[position + ""];
+};
+
+var SearchUnit$get$LSearchUnit$I = SearchUnit.get$LSearchUnit$I;
+
+/**
+ * @param {SearchUnit} $this
+ * @return {!number}
+ */
+SearchUnit.size$LSearchUnit$ = function ($this) {
+ return $this._size;
+};
+
+var SearchUnit$size$LSearchUnit$ = SearchUnit.size$LSearchUnit$;
+
+/**
+ * @param {SearchUnit} $this
+ * @param {SearchUnit} rhs
+ */
+SearchUnit.merge$LSearchUnit$LSearchUnit$ = function ($this, rhs) {
+ /** @type {!string} */
+ var position;
+ /** @type {Position} */
+ var pos;
+ for (position in rhs.positions) {
+ pos = rhs.positions[position];
+ SearchUnit$addPosition$LSearchUnit$SIB($this, pos.word, pos.position, pos.stemmed);
+ }
+};
+
+var SearchUnit$merge$LSearchUnit$LSearchUnit$ = SearchUnit.merge$LSearchUnit$LSearchUnit$;
+
+/**
+ * @param {SearchUnit} $this
+ * @return {Array.<undefined|Position>}
+ */
+SearchUnit.getPositions$LSearchUnit$ = function ($this) {
+ /** @type {Array.<undefined|Position>} */
+ var result;
+ /** @type {!string} */
+ var pos;
+ result = [ ];
+ for (pos in $this.positions) {
+ result.push($this.positions[pos]);
+ }
+ result.sort((function (a, b) {
+ return a.position - b.position;
+ }));
+ return result;
+};
+
+var SearchUnit$getPositions$LSearchUnit$ = SearchUnit.getPositions$LSearchUnit$;
+
+/**
+ * class SingleResult extends Object
+ * @constructor
+ */
+function SingleResult() {
+}
+
+/**
+ * @constructor
+ */
+function SingleResult$() {
+ this.units = [ ];
+ this.unitIds = [ ];
+ this.or = false;
+ this.not = false;
+ this.searchWord = '';
+};
+
+SingleResult$.prototype = new SingleResult;
+
+/**
+ * @constructor
+ * @param {!string} searchWord
+ * @param {!boolean} or
+ * @param {!boolean} not
+ */
+function SingleResult$SBB(searchWord, or, not) {
+ this.units = [ ];
+ this.unitIds = [ ];
+ this.or = or;
+ this.not = not;
+ this.searchWord = searchWord;
+};
+
+SingleResult$SBB.prototype = new SingleResult;
+
+/**
+ * @param {SingleResult} $this
+ * @param {!number} unitId
+ * @return {SearchUnit}
+ */
+SingleResult.getSearchUnit$LSingleResult$I = function ($this, unitId) {
+ /** @type {!number} */
+ var existing;
+ /** @type {SearchUnit} */
+ var result;
+ existing = $this.unitIds.indexOf(unitId);
+ if (existing === -1) {
+ result = ({positions: ({ }), id: unitId, _size: 0, score: 0, startPosition: -1});
+ $this.units.push(result);
+ $this.unitIds.push(unitId);
+ } else {
+ result = $this.units[existing];
+ }
+ return result;
+};
+
+var SingleResult$getSearchUnit$LSingleResult$I = SingleResult.getSearchUnit$LSingleResult$I;
+
+/**
+ * @param {SingleResult} $this
+ * @param {SingleResult} rhs
+ * @return {SingleResult}
+ */
+SingleResult.merge$LSingleResult$LSingleResult$ = function ($this, rhs) {
+ /** @type {SingleResult} */
+ var result;
+ result = ({units: [ ], unitIds: [ ], or: false, not: false, searchWord: ''});
+ if (rhs.or) {
+ SingleResult$_orMerge$LSingleResult$LSingleResult$LSingleResult$($this, result, rhs);
+ } else {
+ if (rhs.not) {
+ SingleResult$_notMerge$LSingleResult$LSingleResult$LSingleResult$($this, result, rhs);
+ } else {
+ SingleResult$_andMerge$LSingleResult$LSingleResult$LSingleResult$($this, result, rhs);
+ }
+ }
+ return result;
+};
+
+var SingleResult$merge$LSingleResult$LSingleResult$ = SingleResult.merge$LSingleResult$LSingleResult$;
+
+/**
+ * @param {SingleResult} $this
+ * @return {!number}
+ */
+SingleResult.size$LSingleResult$ = function ($this) {
+ return ($this.units.length | 0);
+};
+
+var SingleResult$size$LSingleResult$ = SingleResult.size$LSingleResult$;
+
+/**
+ * @param {SingleResult} $this
+ * @param {SingleResult} result
+ * @param {SingleResult} rhs
+ */
+SingleResult._andMerge$LSingleResult$LSingleResult$LSingleResult$ = function ($this, result, rhs) {
+ /** @type {!number} */
+ var i;
+ /** @type {undefined|!number} */
+ var id;
+ /** @type {SearchUnit} */
+ var lhsSection;
+ for (i = 0; i < $this.unitIds.length; i++) {
+ id = $this.unitIds[i];
+ if (rhs.unitIds.indexOf(id) !== -1) {
+ lhsSection = $this.units[i];
+ result.unitIds.push(id);
+ result.units.push(lhsSection);
+ }
+ }
+};
+
+var SingleResult$_andMerge$LSingleResult$LSingleResult$LSingleResult$ = SingleResult._andMerge$LSingleResult$LSingleResult$LSingleResult$;
+
+/**
+ * @param {SingleResult} $this
+ * @param {SingleResult} result
+ * @param {SingleResult} rhs
+ */
+SingleResult._orMerge$LSingleResult$LSingleResult$LSingleResult$ = function ($this, result, rhs) {
+ /** @type {!number} */
+ var i;
+ /** @type {undefined|!number} */
+ var id;
+ /** @type {SearchUnit} */
+ var rhsSection;
+ /** @type {SearchUnit} */
+ var lhsSection;
+ /** @type {Array.<undefined|!number>} */
+ var unitIds$0;
+ /** @type {Array.<undefined|SearchUnit>} */
+ var units$0;
+ result.unitIds = (unitIds$0 = $this.unitIds).slice(0, unitIds$0.length);
+ result.units = (units$0 = $this.units).slice(0, units$0.length);
+ for (i = 0; i < rhs.unitIds.length; i++) {
+ id = rhs.unitIds[i];
+ rhsSection = rhs.units[i];
+ if (result.unitIds.indexOf(id) !== -1) {
+ lhsSection = result.units[result.unitIds.indexOf(id)];
+ SearchUnit$merge$LSearchUnit$LSearchUnit$(lhsSection, rhsSection);
+ } else {
+ result.unitIds.push(id);
+ result.units.push(rhsSection);
+ }
+ }
+};
+
+var SingleResult$_orMerge$LSingleResult$LSingleResult$LSingleResult$ = SingleResult._orMerge$LSingleResult$LSingleResult$LSingleResult$;
+
+/**
+ * @param {SingleResult} $this
+ * @param {SingleResult} result
+ * @param {SingleResult} rhs
+ */
+SingleResult._notMerge$LSingleResult$LSingleResult$LSingleResult$ = function ($this, result, rhs) {
+ /** @type {!number} */
+ var i;
+ /** @type {undefined|!number} */
+ var id;
+ /** @type {SearchUnit} */
+ var lhsSection;
+ for (i = 0; i < $this.unitIds.length; i++) {
+ id = $this.unitIds[i];
+ if (rhs.unitIds.indexOf(id) === -1) {
+ lhsSection = $this.units[i];
+ result.unitIds.push(id);
+ result.units.push(lhsSection);
+ }
+ }
+};
+
+var SingleResult$_notMerge$LSingleResult$LSingleResult$LSingleResult$ = SingleResult._notMerge$LSingleResult$LSingleResult$LSingleResult$;
+
+/**
+ * class SearchSummary extends Object
+ * @constructor
+ */
+function SearchSummary() {
+}
+
+/**
+ * @constructor
+ */
+function SearchSummary$() {
+ this.sourceResults = [ ];
+ this.result = null;
+ this.oktavia = null;
+};
+
+SearchSummary$.prototype = new SearchSummary;
+
+/**
+ * @constructor
+ * @param {Oktavia} oktavia
+ */
+function SearchSummary$LOktavia$(oktavia) {
+ this.sourceResults = [ ];
+ this.result = null;
+ this.oktavia = oktavia;
+};
+
+SearchSummary$LOktavia$.prototype = new SearchSummary;
+
+/**
+ * @param {SearchSummary} $this
+ * @param {SingleResult} result
+ */
+SearchSummary.addQuery$LSearchSummary$LSingleResult$ = function ($this, result) {
+ $this.sourceResults.push(result);
+};
+
+var SearchSummary$addQuery$LSearchSummary$LSingleResult$ = SearchSummary.addQuery$LSearchSummary$LSingleResult$;
+
+/**
+ * @param {SearchSummary} $this
+ */
+SearchSummary.mergeResult$LSearchSummary$ = function ($this) {
+ $this.result = SearchSummary$mergeResult$LSearchSummary$ALSingleResult$($this, $this.sourceResults);
+};
+
+var SearchSummary$mergeResult$LSearchSummary$ = SearchSummary.mergeResult$LSearchSummary$;
+
+/**
+ * @param {SearchSummary} $this
+ * @param {Array.<undefined|SingleResult>} results
+ * @return {SingleResult}
+ */
+SearchSummary.mergeResult$LSearchSummary$ALSingleResult$ = function ($this, results) {
+ /** @type {SingleResult} */
+ var rhs;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var results$len$0;
+ rhs = results[0];
+ for ((i = 1, results$len$0 = results.length); i < results$len$0; i++) {
+ rhs = SingleResult$merge$LSingleResult$LSingleResult$(rhs, results[i]);
+ }
+ return rhs;
+};
+
+var SearchSummary$mergeResult$LSearchSummary$ALSingleResult$ = SearchSummary.mergeResult$LSearchSummary$ALSingleResult$;
+
+/**
+ * @param {SearchSummary} $this
+ * @return {Array.<undefined|Proposal>}
+ */
+SearchSummary.getProposal$LSearchSummary$ = function ($this) {
+ /** @type {Array.<undefined|Proposal>} */
+ var proposals;
+ /** @type {!number} */
+ var i;
+ /** @type {Array.<undefined|SingleResult>} */
+ var tmpSource;
+ /** @type {!number} */
+ var j;
+ /** @type {SingleResult} */
+ var result;
+ proposals = [ ];
+ for (i = 0; i < $this.sourceResults.length; i++) {
+ tmpSource = [ ];
+ for (j = 0; j < $this.sourceResults.length; j++) {
+ if (i !== j) {
+ tmpSource.push($this.sourceResults[j]);
+ }
+ }
+ result = SearchSummary$mergeResult$LSearchSummary$ALSingleResult$($this, tmpSource);
+ proposals.push(({omit: i, expect: result.units.length}));
+ }
+ proposals.sort((function (a, b) {
+ return b.expect - a.expect;
+ }));
+ return proposals;
+};
+
+var SearchSummary$getProposal$LSearchSummary$ = SearchSummary.getProposal$LSearchSummary$;
+
+/**
+ * @param {SearchSummary} $this
+ * @return {Array.<undefined|SearchUnit>}
+ */
+SearchSummary.getSortedResult$LSearchSummary$ = function ($this) {
+ /** @type {Array.<undefined|SearchUnit>} */
+ var result;
+ /** @type {Array.<undefined|SearchUnit>} */
+ var units$0;
+ result = (units$0 = $this.result.units).slice(0, units$0.length);
+ result.sort((function (a, b) {
+ return b.score - a.score;
+ }));
+ return result;
+};
+
+var SearchSummary$getSortedResult$LSearchSummary$ = SearchSummary.getSortedResult$LSearchSummary$;
+
+/**
+ * @param {SearchSummary} $this
+ * @return {!number}
+ */
+SearchSummary.size$LSearchSummary$ = function ($this) {
+ /** @type {SingleResult} */
+ var this$0;
+ this$0 = $this.result;
+ return (this$0.units.length | 0);
+};
+
+var SearchSummary$size$LSearchSummary$ = SearchSummary.size$LSearchSummary$;
+
+/**
+ * @param {SearchSummary} $this
+ * @param {SingleResult} result
+ */
+SearchSummary.add$LSearchSummary$LSingleResult$ = function ($this, result) {
+ $this.sourceResults.push(result);
+};
+
+var SearchSummary$add$LSearchSummary$LSingleResult$ = SearchSummary.add$LSearchSummary$LSingleResult$;
+
+/**
+ * class Style extends Object
+ * @constructor
+ */
+function Style() {
+}
+
+/**
+ * @constructor
+ * @param {!string} mode
+ */
+function Style$S(mode) {
+ this.styles = null;
+ this.escapeHTML = false;
+ switch (mode) {
+ case 'console':
+ this.styles = Style.console;
+ break;
+ case 'html':
+ this.styles = Style.html;
+ break;
+ case 'ignore':
+ this.styles = Style.ignore;
+ break;
+ default:
+ this.styles = Style.ignore;
+ break;
+ }
+ this.escapeHTML = mode === 'html';
+};
+
+Style$S.prototype = new Style;
+
+/**
+ * @param {!string} source
+ * @return {!string}
+ */
+Style.prototype.convert$S = function (source) {
+ /** @type {_HTMLHandler} */
+ var handler;
+ /** @type {SAXParser} */
+ var parser;
+ handler = new _HTMLHandler$HASB(this.styles, this.escapeHTML);
+ parser = new SAXParser$LSAXHandler$(handler);
+ parser.parse$S(source);
+ return handler.text.join('');
+};
+
+/**
+ * class Stemmer
+ * @constructor
+ */
+function Stemmer() {
+}
+
+Stemmer.prototype.$__jsx_implements_Stemmer = true;
+
+/**
+ * @constructor
+ */
+function Stemmer$() {
+};
+
+Stemmer$.prototype = new Stemmer;
+
+/**
+ * class BaseStemmer extends Object
+ * @constructor
+ */
+function BaseStemmer() {
+}
+
+$__jsx_merge_interface(BaseStemmer, Stemmer);
+
+/**
+ * @constructor
+ */
+function BaseStemmer$() {
+ /** @type {!string} */
+ var current$0;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var limit$0;
+ this.cache = ({ });
+ current$0 = this.current = "";
+ cursor$0 = this.cursor = 0;
+ limit$0 = this.limit = current$0.length;
+ this.limit_backward = 0;
+ this.bra = cursor$0;
+ this.ket = limit$0;
+};
+
+BaseStemmer$.prototype = new BaseStemmer;
+
+/**
+ * @param {!string} value
+ */
+BaseStemmer.prototype.setCurrent$S = function (value) {
+ /** @type {!string} */
+ var current$0;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var limit$0;
+ current$0 = this.current = value;
+ cursor$0 = this.cursor = 0;
+ limit$0 = this.limit = current$0.length;
+ this.limit_backward = 0;
+ this.bra = cursor$0;
+ this.ket = limit$0;
+};
+
+/**
+ * @return {!string}
+ */
+BaseStemmer.prototype.getCurrent$ = function () {
+ return this.current;
+};
+
+/**
+ * @param {BaseStemmer} other
+ */
+BaseStemmer.prototype.copy_from$LBaseStemmer$ = function (other) {
+ this.current = other.current;
+ this.cursor = other.cursor;
+ this.limit = other.limit;
+ this.limit_backward = other.limit_backward;
+ this.bra = other.bra;
+ this.ket = other.ket;
+};
+
+/**
+ * @param {Array.<undefined|!number>} s
+ * @param {!number} min
+ * @param {!number} max
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.in_grouping$AIII = function (s, min, max) {
+ /** @type {!number} */
+ var ch;
+ if (this.cursor >= this.limit) {
+ return false;
+ }
+ ch = this.current.charCodeAt(this.cursor);
+ if (ch > max || ch < min) {
+ return false;
+ }
+ ch -= min;
+ if ((s[ch >>> 3] & 0x1 << (ch & 0x7)) === 0) {
+ return false;
+ }
+ this.cursor++;
+ return true;
+};
+
+/**
+ * @param {Array.<undefined|!number>} s
+ * @param {!number} min
+ * @param {!number} max
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.in_grouping_b$AIII = function (s, min, max) {
+ /** @type {!number} */
+ var ch;
+ if (this.cursor <= this.limit_backward) {
+ return false;
+ }
+ ch = this.current.charCodeAt(this.cursor - 1);
+ if (ch > max || ch < min) {
+ return false;
+ }
+ ch -= min;
+ if ((s[ch >>> 3] & 0x1 << (ch & 0x7)) === 0) {
+ return false;
+ }
+ this.cursor--;
+ return true;
+};
+
+/**
+ * @param {Array.<undefined|!number>} s
+ * @param {!number} min
+ * @param {!number} max
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.out_grouping$AIII = function (s, min, max) {
+ /** @type {!number} */
+ var ch;
+ if (this.cursor >= this.limit) {
+ return false;
+ }
+ ch = this.current.charCodeAt(this.cursor);
+ if (ch > max || ch < min) {
+ this.cursor++;
+ return true;
+ }
+ ch -= min;
+ if ((s[ch >>> 3] & 0X1 << (ch & 0x7)) === 0) {
+ this.cursor++;
+ return true;
+ }
+ return false;
+};
+
+/**
+ * @param {Array.<undefined|!number>} s
+ * @param {!number} min
+ * @param {!number} max
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.out_grouping_b$AIII = function (s, min, max) {
+ /** @type {!number} */
+ var ch;
+ if (this.cursor <= this.limit_backward) {
+ return false;
+ }
+ ch = this.current.charCodeAt(this.cursor - 1);
+ if (ch > max || ch < min) {
+ this.cursor--;
+ return true;
+ }
+ ch -= min;
+ if ((s[ch >>> 3] & 0x1 << (ch & 0x7)) === 0) {
+ this.cursor--;
+ return true;
+ }
+ return false;
+};
+
+/**
+ * @param {!number} min
+ * @param {!number} max
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.in_range$II = function (min, max) {
+ /** @type {!number} */
+ var ch;
+ if (this.cursor >= this.limit) {
+ return false;
+ }
+ ch = this.current.charCodeAt(this.cursor);
+ if (ch > max || ch < min) {
+ return false;
+ }
+ this.cursor++;
+ return true;
+};
+
+/**
+ * @param {!number} min
+ * @param {!number} max
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.in_range_b$II = function (min, max) {
+ /** @type {!number} */
+ var ch;
+ if (this.cursor <= this.limit_backward) {
+ return false;
+ }
+ ch = this.current.charCodeAt(this.cursor - 1);
+ if (ch > max || ch < min) {
+ return false;
+ }
+ this.cursor--;
+ return true;
+};
+
+/**
+ * @param {!number} min
+ * @param {!number} max
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.out_range$II = function (min, max) {
+ /** @type {!number} */
+ var ch;
+ if (this.cursor >= this.limit) {
+ return false;
+ }
+ ch = this.current.charCodeAt(this.cursor);
+ if (! (ch > max || ch < min)) {
+ return false;
+ }
+ this.cursor++;
+ return true;
+};
+
+/**
+ * @param {!number} min
+ * @param {!number} max
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.out_range_b$II = function (min, max) {
+ /** @type {!number} */
+ var ch;
+ if (this.cursor <= this.limit_backward) {
+ return false;
+ }
+ ch = this.current.charCodeAt(this.cursor - 1);
+ if (! (ch > max || ch < min)) {
+ return false;
+ }
+ this.cursor--;
+ return true;
+};
+
+/**
+ * @param {!number} s_size
+ * @param {!string} s
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.eq_s$IS = function (s_size, s) {
+ /** @type {!number} */
+ var cursor$0;
+ if (this.limit - this.cursor < s_size) {
+ return false;
+ }
+ if (this.current.slice(cursor$0 = this.cursor, cursor$0 + s_size) !== s) {
+ return false;
+ }
+ this.cursor += s_size;
+ return true;
+};
+
+/**
+ * @param {!number} s_size
+ * @param {!string} s
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.eq_s_b$IS = function (s_size, s) {
+ /** @type {!number} */
+ var cursor$0;
+ if (this.cursor - this.limit_backward < s_size) {
+ return false;
+ }
+ if (this.current.slice((cursor$0 = this.cursor) - s_size, cursor$0) !== s) {
+ return false;
+ }
+ this.cursor -= s_size;
+ return true;
+};
+
+/**
+ * @param {!string} s
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.eq_v$S = function (s) {
+ return this.eq_s$IS(s.length, s);
+};
+
+/**
+ * @param {!string} s
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.eq_v_b$S = function (s) {
+ return this.eq_s_b$IS(s.length, s);
+};
+
+/**
+ * @param {Array.<undefined|Among>} v
+ * @param {!number} v_size
+ * @return {!number}
+ */
+BaseStemmer.prototype.find_among$ALAmong$I = function (v, v_size) {
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var j;
+ /** @type {!number} */
+ var c;
+ /** @type {!number} */
+ var l;
+ /** @type {!number} */
+ var common_i;
+ /** @type {!number} */
+ var common_j;
+ /** @type {!boolean} */
+ var first_key_inspected;
+ /** @type {!number} */
+ var k;
+ /** @type {!number} */
+ var diff;
+ /** @type {!number} */
+ var common;
+ /** @type {Among} */
+ var w;
+ /** @type {!number} */
+ var i2;
+ /** @type {!boolean} */
+ var res;
+ i = 0;
+ j = v_size;
+ c = this.cursor;
+ l = this.limit;
+ common_i = 0;
+ common_j = 0;
+ first_key_inspected = false;
+ while (true) {
+ k = i + (j - i >>> 1);
+ diff = 0;
+ common = (common_i < common_j ? common_i : common_j);
+ w = v[k];
+ for (i2 = common; i2 < w.s_size; i2++) {
+ if (c + common === l) {
+ diff = -1;
+ break;
+ }
+ diff = this.current.charCodeAt(c + common) - w.s.charCodeAt(i2);
+ if (diff !== 0) {
+ break;
+ }
+ common++;
+ }
+ if (diff < 0) {
+ j = k;
+ common_j = common;
+ } else {
+ i = k;
+ common_i = common;
+ }
+ if (j - i <= 1) {
+ if (i > 0) {
+ break;
+ }
+ if (j === i) {
+ break;
+ }
+ if (first_key_inspected) {
+ break;
+ }
+ first_key_inspected = true;
+ }
+ }
+ while (true) {
+ w = v[i];
+ if (common_i >= w.s_size) {
+ this.cursor = (c + w.s_size | 0);
+ if (w.method == null) {
+ return w.result;
+ }
+ res = w.method(w.instance);
+ this.cursor = (c + w.s_size | 0);
+ if (res) {
+ return w.result;
+ }
+ }
+ i = w.substring_i;
+ if (i < 0) {
+ return 0;
+ }
+ }
+ return -1;
+};
+
+/**
+ * @param {Array.<undefined|Among>} v
+ * @param {!number} v_size
+ * @return {!number}
+ */
+BaseStemmer.prototype.find_among_b$ALAmong$I = function (v, v_size) {
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var j;
+ /** @type {!number} */
+ var c;
+ /** @type {!number} */
+ var lb;
+ /** @type {!number} */
+ var common_i;
+ /** @type {!number} */
+ var common_j;
+ /** @type {!boolean} */
+ var first_key_inspected;
+ /** @type {!number} */
+ var k;
+ /** @type {!number} */
+ var diff;
+ /** @type {!number} */
+ var common;
+ /** @type {Among} */
+ var w;
+ /** @type {!number} */
+ var i2;
+ /** @type {!boolean} */
+ var res;
+ i = 0;
+ j = v_size;
+ c = this.cursor;
+ lb = this.limit_backward;
+ common_i = 0;
+ common_j = 0;
+ first_key_inspected = false;
+ while (true) {
+ k = i + (j - i >> 1);
+ diff = 0;
+ common = (common_i < common_j ? common_i : common_j);
+ w = v[k];
+ for (i2 = w.s_size - 1 - common; i2 >= 0; i2--) {
+ if (c - common === lb) {
+ diff = -1;
+ break;
+ }
+ diff = this.current.charCodeAt(c - 1 - common) - w.s.charCodeAt(i2);
+ if (diff !== 0) {
+ break;
+ }
+ common++;
+ }
+ if (diff < 0) {
+ j = k;
+ common_j = common;
+ } else {
+ i = k;
+ common_i = common;
+ }
+ if (j - i <= 1) {
+ if (i > 0) {
+ break;
+ }
+ if (j === i) {
+ break;
+ }
+ if (first_key_inspected) {
+ break;
+ }
+ first_key_inspected = true;
+ }
+ }
+ while (true) {
+ w = v[i];
+ if (common_i >= w.s_size) {
+ this.cursor = (c - w.s_size | 0);
+ if (w.method == null) {
+ return w.result;
+ }
+ res = w.method(this);
+ this.cursor = (c - w.s_size | 0);
+ if (res) {
+ return w.result;
+ }
+ }
+ i = w.substring_i;
+ if (i < 0) {
+ return 0;
+ }
+ }
+ return -1;
+};
+
+/**
+ * @param {!number} c_bra
+ * @param {!number} c_ket
+ * @param {!string} s
+ * @return {!number}
+ */
+BaseStemmer.prototype.replace_s$IIS = function (c_bra, c_ket, s) {
+ /** @type {!number} */
+ var adjustment;
+ adjustment = s.length - (c_ket - c_bra);
+ this.current = this.current.slice(0, c_bra) + s + this.current.slice(c_ket);
+ this.limit += (adjustment | 0);
+ if (this.cursor >= c_ket) {
+ this.cursor += (adjustment | 0);
+ } else {
+ if (this.cursor > c_bra) {
+ this.cursor = c_bra;
+ }
+ }
+ return (adjustment | 0);
+};
+
+/**
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.slice_check$ = function () {
+ /** @type {!number} */
+ var bra$0;
+ /** @type {!number} */
+ var ket$0;
+ /** @type {!number} */
+ var limit$0;
+ return ((bra$0 = this.bra) < 0 || bra$0 > (ket$0 = this.ket) || ket$0 > (limit$0 = this.limit) || limit$0 > this.current.length ? false : true);
+};
+
+/**
+ * @param {!string} s
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.slice_from$S = function (s) {
+ /** @type {!boolean} */
+ var result;
+ /** @type {!number} */
+ var bra$0;
+ /** @type {!number} */
+ var ket$0;
+ /** @type {!number} */
+ var limit$0;
+ result = false;
+ if ((bra$0 = this.bra) < 0 || bra$0 > (ket$0 = this.ket) || ket$0 > (limit$0 = this.limit) || limit$0 > this.current.length ? false : true) {
+ this.replace_s$IIS(this.bra, this.ket, s);
+ result = true;
+ }
+ return result;
+};
+
+/**
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.slice_del$ = function () {
+ return this.slice_from$S("");
+};
+
+/**
+ * @param {!number} c_bra
+ * @param {!number} c_ket
+ * @param {!string} s
+ */
+BaseStemmer.prototype.insert$IIS = function (c_bra, c_ket, s) {
+ /** @type {!number} */
+ var adjustment;
+ adjustment = this.replace_s$IIS(c_bra, c_ket, s);
+ if (c_bra <= this.bra) {
+ this.bra += (adjustment | 0);
+ }
+ if (c_bra <= this.ket) {
+ this.ket += (adjustment | 0);
+ }
+};
+
+/**
+ * @param {!string} s
+ * @return {!string}
+ */
+BaseStemmer.prototype.slice_to$S = function (s) {
+ /** @type {!string} */
+ var result;
+ /** @type {!number} */
+ var bra$0;
+ /** @type {!number} */
+ var ket$0;
+ /** @type {!number} */
+ var limit$0;
+ result = '';
+ if ((bra$0 = this.bra) < 0 || bra$0 > (ket$0 = this.ket) || ket$0 > (limit$0 = this.limit) || limit$0 > this.current.length ? false : true) {
+ result = this.current.slice(this.bra, this.ket);
+ }
+ return result;
+};
+
+/**
+ * @param {!string} s
+ * @return {!string}
+ */
+BaseStemmer.prototype.assign_to$S = function (s) {
+ return this.current.slice(0, this.limit);
+};
+
+/**
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.stem$ = function () {
+ return false;
+};
+
+/**
+ * @param {!string} word
+ * @return {!string}
+ */
+BaseStemmer.prototype.stemWord$S = function (word) {
+ /** @type {undefined|!string} */
+ var result;
+ /** @type {!string} */
+ var current$0;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var limit$0;
+ result = this.cache['.' + word];
+ if (result == null) {
+ current$0 = this.current = word;
+ cursor$0 = this.cursor = 0;
+ limit$0 = this.limit = current$0.length;
+ this.limit_backward = 0;
+ this.bra = cursor$0;
+ this.ket = limit$0;
+ this.stem$();
+ result = this.current;
+ this.cache['.' + word] = result;
+ }
+ return result;
+};
+
+/**
+ * @param {Array.<undefined|!string>} words
+ * @return {Array.<undefined|!string>}
+ */
+BaseStemmer.prototype.stemWords$AS = function (words) {
+ /** @type {Array.<undefined|!string>} */
+ var results;
+ /** @type {!number} */
+ var i;
+ /** @type {undefined|!string} */
+ var word;
+ /** @type {undefined|!string} */
+ var result;
+ /** @type {!string} */
+ var current$0;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var limit$0;
+ results = [ ];
+ for (i = 0; i < words.length; i++) {
+ word = words[i];
+ result = this.cache['.' + word];
+ if (result == null) {
+ current$0 = this.current = word;
+ cursor$0 = this.cursor = 0;
+ limit$0 = this.limit = current$0.length;
+ this.limit_backward = 0;
+ this.bra = cursor$0;
+ this.ket = limit$0;
+ this.stem$();
+ result = this.current;
+ this.cache['.' + word] = result;
+ }
+ results.push(result);
+ }
+ return results;
+};
+
+/**
+ * class GermanStemmer extends BaseStemmer
+ * @constructor
+ */
+function GermanStemmer() {
+}
+
+GermanStemmer.prototype = new BaseStemmer;
+/**
+ * @constructor
+ */
+function GermanStemmer$() {
+ BaseStemmer$.call(this);
+ this.I_x = 0;
+ this.I_p2 = 0;
+ this.I_p1 = 0;
+};
+
+GermanStemmer$.prototype = new GermanStemmer;
+
+/**
+ * @param {GermanStemmer} other
+ */
+GermanStemmer.prototype.copy_from$LGermanStemmer$ = function (other) {
+ this.I_x = other.I_x;
+ this.I_p2 = other.I_p2;
+ this.I_p1 = other.I_p1;
+ BaseStemmer.prototype.copy_from$LBaseStemmer$.call(this, other);
+};
+
+/**
+ * @return {!boolean}
+ */
+GermanStemmer.prototype.r_prelude$ = function () {
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var v_3;
+ /** @type {!number} */
+ var v_4;
+ /** @type {!number} */
+ var v_5;
+ /** @type {!number} */
+ var v_6;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!boolean} */
+ var lab2;
+ /** @type {!boolean} */
+ var lab3;
+ /** @type {!boolean} */
+ var lab5;
+ /** @type {!boolean} */
+ var lab7;
+ /** @type {!boolean} */
+ var lab8;
+ /** @type {!boolean} */
+ var lab9;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var cursor$1;
+ v_1 = this.cursor;
+replab0:
+ while (true) {
+ v_2 = this.cursor;
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ lab2 = true;
+ lab2:
+ while (lab2 === true) {
+ lab2 = false;
+ v_3 = this.cursor;
+ lab3 = true;
+ lab3:
+ while (lab3 === true) {
+ lab3 = false;
+ this.bra = this.cursor;
+ if (! this.eq_s$IS(1, "\u00DF")) {
+ break lab3;
+ }
+ this.ket = this.cursor;
+ if (! this.slice_from$S("ss")) {
+ return false;
+ }
+ break lab2;
+ }
+ cursor$0 = this.cursor = v_3;
+ if (cursor$0 >= this.limit) {
+ break lab1;
+ }
+ this.cursor++;
+ }
+ continue replab0;
+ }
+ this.cursor = v_2;
+ break replab0;
+ }
+ this.cursor = v_1;
+replab4:
+ while (true) {
+ v_4 = this.cursor;
+ lab5 = true;
+ lab5:
+ while (lab5 === true) {
+ lab5 = false;
+ golab6:
+ while (true) {
+ v_5 = this.cursor;
+ lab7 = true;
+ lab7:
+ while (lab7 === true) {
+ lab7 = false;
+ if (! this.in_grouping$AIII(GermanStemmer.g_v, 97, 252)) {
+ break lab7;
+ }
+ this.bra = this.cursor;
+ lab8 = true;
+ lab8:
+ while (lab8 === true) {
+ lab8 = false;
+ v_6 = this.cursor;
+ lab9 = true;
+ lab9:
+ while (lab9 === true) {
+ lab9 = false;
+ if (! this.eq_s$IS(1, "u")) {
+ break lab9;
+ }
+ this.ket = this.cursor;
+ if (! this.in_grouping$AIII(GermanStemmer.g_v, 97, 252)) {
+ break lab9;
+ }
+ if (! this.slice_from$S("U")) {
+ return false;
+ }
+ break lab8;
+ }
+ this.cursor = v_6;
+ if (! this.eq_s$IS(1, "y")) {
+ break lab7;
+ }
+ this.ket = this.cursor;
+ if (! this.in_grouping$AIII(GermanStemmer.g_v, 97, 252)) {
+ break lab7;
+ }
+ if (! this.slice_from$S("Y")) {
+ return false;
+ }
+ }
+ this.cursor = v_5;
+ break golab6;
+ }
+ cursor$1 = this.cursor = v_5;
+ if (cursor$1 >= this.limit) {
+ break lab5;
+ }
+ this.cursor++;
+ }
+ continue replab4;
+ }
+ this.cursor = v_4;
+ break replab4;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+GermanStemmer.prototype.r_mark_regions$ = function () {
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var c;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!boolean} */
+ var lab3;
+ /** @type {!boolean} */
+ var lab4;
+ /** @type {!boolean} */
+ var lab6;
+ /** @type {!boolean} */
+ var lab8;
+ /** @type {!number} */
+ var limit$0;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var cursor$1;
+ this.I_p1 = limit$0 = this.limit;
+ this.I_p2 = limit$0;
+ v_1 = cursor$0 = this.cursor;
+ c = (cursor$0 + 3 | 0);
+ if (0 > c || c > limit$0) {
+ return false;
+ }
+ cursor$1 = this.cursor = c;
+ this.I_x = cursor$1;
+ this.cursor = v_1;
+golab0:
+ while (true) {
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ if (! this.in_grouping$AIII(GermanStemmer.g_v, 97, 252)) {
+ break lab1;
+ }
+ break golab0;
+ }
+ if (this.cursor >= this.limit) {
+ return false;
+ }
+ this.cursor++;
+ }
+golab2:
+ while (true) {
+ lab3 = true;
+ lab3:
+ while (lab3 === true) {
+ lab3 = false;
+ if (! this.out_grouping$AIII(GermanStemmer.g_v, 97, 252)) {
+ break lab3;
+ }
+ break golab2;
+ }
+ if (this.cursor >= this.limit) {
+ return false;
+ }
+ this.cursor++;
+ }
+ this.I_p1 = this.cursor;
+ lab4 = true;
+lab4:
+ while (lab4 === true) {
+ lab4 = false;
+ if (! (this.I_p1 < this.I_x)) {
+ break lab4;
+ }
+ this.I_p1 = this.I_x;
+ }
+golab5:
+ while (true) {
+ lab6 = true;
+ lab6:
+ while (lab6 === true) {
+ lab6 = false;
+ if (! this.in_grouping$AIII(GermanStemmer.g_v, 97, 252)) {
+ break lab6;
+ }
+ break golab5;
+ }
+ if (this.cursor >= this.limit) {
+ return false;
+ }
+ this.cursor++;
+ }
+golab7:
+ while (true) {
+ lab8 = true;
+ lab8:
+ while (lab8 === true) {
+ lab8 = false;
+ if (! this.out_grouping$AIII(GermanStemmer.g_v, 97, 252)) {
+ break lab8;
+ }
+ break golab7;
+ }
+ if (this.cursor >= this.limit) {
+ return false;
+ }
+ this.cursor++;
+ }
+ this.I_p2 = this.cursor;
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+GermanStemmer.prototype.r_postlude$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var v_1;
+ /** @type {!boolean} */
+ var lab1;
+replab0:
+ while (true) {
+ v_1 = this.cursor;
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ this.bra = this.cursor;
+ among_var = this.find_among$ALAmong$I(GermanStemmer.a_0, 6);
+ if (among_var === 0) {
+ break lab1;
+ }
+ this.ket = this.cursor;
+ switch (among_var) {
+ case 0:
+ break lab1;
+ case 1:
+ if (! this.slice_from$S("y")) {
+ return false;
+ }
+ break;
+ case 2:
+ if (! this.slice_from$S("u")) {
+ return false;
+ }
+ break;
+ case 3:
+ if (! this.slice_from$S("a")) {
+ return false;
+ }
+ break;
+ case 4:
+ if (! this.slice_from$S("o")) {
+ return false;
+ }
+ break;
+ case 5:
+ if (! this.slice_from$S("u")) {
+ return false;
+ }
+ break;
+ case 6:
+ if (this.cursor >= this.limit) {
+ break lab1;
+ }
+ this.cursor++;
+ break;
+ }
+ continue replab0;
+ }
+ this.cursor = v_1;
+ break replab0;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+GermanStemmer.prototype.r_R1$ = function () {
+ return (! (this.I_p1 <= this.cursor) ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+GermanStemmer.prototype.r_R2$ = function () {
+ return (! (this.I_p2 <= this.cursor) ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+GermanStemmer.prototype.r_standard_suffix$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var v_3;
+ /** @type {!number} */
+ var v_4;
+ /** @type {!number} */
+ var v_5;
+ /** @type {!number} */
+ var v_6;
+ /** @type {!number} */
+ var v_7;
+ /** @type {!number} */
+ var v_8;
+ /** @type {!number} */
+ var v_9;
+ /** @type {!number} */
+ var v_10;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!boolean} */
+ var lab2;
+ /** @type {!number} */
+ var c;
+ /** @type {!boolean} */
+ var lab3;
+ /** @type {!boolean} */
+ var lab4;
+ /** @type {!boolean} */
+ var lab5;
+ /** @type {!boolean} */
+ var lab6;
+ /** @type {!boolean} */
+ var lab7;
+ /** @type {!boolean} */
+ var lab8;
+ /** @type {!boolean} */
+ var lab9;
+ /** @type {!boolean} */
+ var lab10;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var cursor$1;
+ /** @type {!number} */
+ var limit$0;
+ /** @type {!number} */
+ var cursor$2;
+ /** @type {!number} */
+ var cursor$3;
+ /** @type {!number} */
+ var cursor$4;
+ /** @type {!number} */
+ var cursor$5;
+ /** @type {!number} */
+ var cursor$6;
+ /** @type {!number} */
+ var cursor$7;
+ /** @type {!number} */
+ var limit$1;
+ /** @type {!number} */
+ var cursor$8;
+ v_1 = this.limit - this.cursor;
+ lab0 = true;
+lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ this.ket = this.cursor;
+ among_var = this.find_among_b$ALAmong$I(GermanStemmer.a_1, 7);
+ if (among_var === 0) {
+ break lab0;
+ }
+ this.bra = cursor$0 = this.cursor;
+ if (! (! (this.I_p1 <= cursor$0) ? false : true)) {
+ break lab0;
+ }
+ switch (among_var) {
+ case 0:
+ break lab0;
+ case 1:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 2:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ v_2 = this.limit - this.cursor;
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ this.ket = this.cursor;
+ if (! this.eq_s_b$IS(1, "s")) {
+ this.cursor = this.limit - v_2;
+ break lab1;
+ }
+ this.bra = this.cursor;
+ if (! this.eq_s_b$IS(3, "nis")) {
+ this.cursor = this.limit - v_2;
+ break lab1;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ }
+ break;
+ case 3:
+ if (! this.in_grouping_b$AIII(GermanStemmer.g_s_ending, 98, 116)) {
+ break lab0;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ }
+ }
+ cursor$2 = this.cursor = (limit$0 = this.limit) - v_1;
+ v_3 = limit$0 - cursor$2;
+ lab2 = true;
+lab2:
+ while (lab2 === true) {
+ lab2 = false;
+ this.ket = this.cursor;
+ among_var = this.find_among_b$ALAmong$I(GermanStemmer.a_2, 4);
+ if (among_var === 0) {
+ break lab2;
+ }
+ this.bra = cursor$1 = this.cursor;
+ if (! (! (this.I_p1 <= cursor$1) ? false : true)) {
+ break lab2;
+ }
+ switch (among_var) {
+ case 0:
+ break lab2;
+ case 1:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 2:
+ if (! this.in_grouping_b$AIII(GermanStemmer.g_st_ending, 98, 116)) {
+ break lab2;
+ }
+ c = (this.cursor - 3 | 0);
+ if (this.limit_backward > c || c > this.limit) {
+ break lab2;
+ }
+ this.cursor = c;
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ }
+ }
+ cursor$8 = this.cursor = (limit$1 = this.limit) - v_3;
+ v_4 = limit$1 - cursor$8;
+ lab3 = true;
+lab3:
+ while (lab3 === true) {
+ lab3 = false;
+ this.ket = this.cursor;
+ among_var = this.find_among_b$ALAmong$I(GermanStemmer.a_4, 8);
+ if (among_var === 0) {
+ break lab3;
+ }
+ this.bra = cursor$3 = this.cursor;
+ if (! (! (this.I_p2 <= cursor$3) ? false : true)) {
+ break lab3;
+ }
+ switch (among_var) {
+ case 0:
+ break lab3;
+ case 1:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ v_5 = this.limit - this.cursor;
+ lab4 = true;
+ lab4:
+ while (lab4 === true) {
+ lab4 = false;
+ this.ket = this.cursor;
+ if (! this.eq_s_b$IS(2, "ig")) {
+ this.cursor = this.limit - v_5;
+ break lab4;
+ }
+ this.bra = cursor$4 = this.cursor;
+ v_6 = this.limit - cursor$4;
+ lab5 = true;
+ lab5:
+ while (lab5 === true) {
+ lab5 = false;
+ if (! this.eq_s_b$IS(1, "e")) {
+ break lab5;
+ }
+ this.cursor = this.limit - v_5;
+ break lab4;
+ }
+ cursor$5 = this.cursor = this.limit - v_6;
+ if (! (! (this.I_p2 <= cursor$5) ? false : true)) {
+ this.cursor = this.limit - v_5;
+ break lab4;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ }
+ break;
+ case 2:
+ v_7 = this.limit - this.cursor;
+ lab6 = true;
+ lab6:
+ while (lab6 === true) {
+ lab6 = false;
+ if (! this.eq_s_b$IS(1, "e")) {
+ break lab6;
+ }
+ break lab3;
+ }
+ this.cursor = this.limit - v_7;
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 3:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ v_8 = this.limit - this.cursor;
+ lab7 = true;
+ lab7:
+ while (lab7 === true) {
+ lab7 = false;
+ this.ket = this.cursor;
+ lab8 = true;
+ lab8:
+ while (lab8 === true) {
+ lab8 = false;
+ v_9 = this.limit - this.cursor;
+ lab9 = true;
+ lab9:
+ while (lab9 === true) {
+ lab9 = false;
+ if (! this.eq_s_b$IS(2, "er")) {
+ break lab9;
+ }
+ break lab8;
+ }
+ this.cursor = this.limit - v_9;
+ if (! this.eq_s_b$IS(2, "en")) {
+ this.cursor = this.limit - v_8;
+ break lab7;
+ }
+ }
+ this.bra = cursor$6 = this.cursor;
+ if (! (! (this.I_p1 <= cursor$6) ? false : true)) {
+ this.cursor = this.limit - v_8;
+ break lab7;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ }
+ break;
+ case 4:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ v_10 = this.limit - this.cursor;
+ lab10 = true;
+ lab10:
+ while (lab10 === true) {
+ lab10 = false;
+ this.ket = this.cursor;
+ among_var = this.find_among_b$ALAmong$I(GermanStemmer.a_3, 2);
+ if (among_var === 0) {
+ this.cursor = this.limit - v_10;
+ break lab10;
+ }
+ this.bra = cursor$7 = this.cursor;
+ if (! (! (this.I_p2 <= cursor$7) ? false : true)) {
+ this.cursor = this.limit - v_10;
+ break lab10;
+ }
+ switch (among_var) {
+ case 0:
+ this.cursor = this.limit - v_10;
+ break lab10;
+ case 1:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ }
+ }
+ break;
+ }
+ }
+ this.cursor = this.limit - v_4;
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+GermanStemmer.prototype.stem$ = function () {
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var v_4;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!boolean} */
+ var lab2;
+ /** @type {!boolean} */
+ var lab3;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var cursor$1;
+ /** @type {!number} */
+ var cursor$2;
+ v_1 = this.cursor;
+ lab0 = true;
+lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ if (! this.r_prelude$()) {
+ break lab0;
+ }
+ }
+ cursor$0 = this.cursor = v_1;
+ v_2 = cursor$0;
+ lab1 = true;
+lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ if (! this.r_mark_regions$()) {
+ break lab1;
+ }
+ }
+ cursor$1 = this.cursor = v_2;
+ this.limit_backward = cursor$1;
+ this.cursor = this.limit;
+ lab2 = true;
+lab2:
+ while (lab2 === true) {
+ lab2 = false;
+ if (! this.r_standard_suffix$()) {
+ break lab2;
+ }
+ }
+ cursor$2 = this.cursor = this.limit_backward;
+ v_4 = cursor$2;
+ lab3 = true;
+lab3:
+ while (lab3 === true) {
+ lab3 = false;
+ if (! this.r_postlude$()) {
+ break lab3;
+ }
+ }
+ this.cursor = v_4;
+ return true;
+};
+
+/**
+ * @param {*} o
+ * @return {!boolean}
+ */
+GermanStemmer.prototype.equals$X = function (o) {
+ return o instanceof GermanStemmer;
+};
+
+/**
+ * @return {!number}
+ */
+GermanStemmer.prototype.hashCode$ = function () {
+ /** @type {!string} */
+ var classname;
+ /** @type {!number} */
+ var hash;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var char;
+ classname = "GermanStemmer";
+ hash = 0;
+ if ("GermanStemmer".length === 0) {
+ return (hash | 0);
+ }
+ for (i = 0; i < classname.length; i++) {
+ char = classname.charCodeAt(i);
+ hash = (hash << 5) - hash + char;
+ hash = hash & hash;
+ }
+ return (hash | 0);
+};
+
+/**
+ * class Among extends Object
+ * @constructor
+ */
+function Among() {
+}
+
+/**
+ * @constructor
+ * @param {!string} s
+ * @param {!number} substring_i
+ * @param {!number} result
+ */
+function Among$SII(s, substring_i, result) {
+ this.s_size = s.length;
+ this.s = s;
+ this.substring_i = substring_i;
+ this.result = result;
+ this.method = null;
+ this.instance = null;
+};
+
+Among$SII.prototype = new Among;
+
+/**
+ * @constructor
+ * @param {!string} s
+ * @param {!number} substring_i
+ * @param {!number} result
+ * @param {*} method
+ * @param {BaseStemmer} instance
+ */
+function Among$SIIF$LBaseStemmer$B$LBaseStemmer$(s, substring_i, result, method, instance) {
+ this.s_size = s.length;
+ this.s = s;
+ this.substring_i = substring_i;
+ this.result = result;
+ this.method = method;
+ this.instance = instance;
+};
+
+Among$SIIF$LBaseStemmer$B$LBaseStemmer$.prototype = new Among;
+
+/**
+ * class Metadata extends Object
+ * @constructor
+ */
+function Metadata() {
+}
+
+/**
+ * @constructor
+ * @param {Oktavia} parent
+ */
+function Metadata$LOktavia$(parent) {
+ this._parent = parent;
+ this._bitVector = new BitVector$();
+};
+
+Metadata$LOktavia$.prototype = new Metadata;
+
+/**
+ * @return {!number}
+ */
+Metadata.prototype._size$ = function () {
+ /** @type {BitVector} */
+ var this$0;
+ /** @type {!number} */
+ var i$0;
+ /** @type {BitVector} */
+ var _bitVector$0;
+ this$0 = _bitVector$0 = this._bitVector;
+ i$0 = _bitVector$0._size;
+ return this$0.rank$IB(i$0, true);
+};
+
+/**
+ * @param {!number} index
+ * @return {!string}
+ */
+Metadata.prototype.getContent$I = function (index) {
+ /** @type {!number} */
+ var startPosition;
+ /** @type {!number} */
+ var length;
+ if (index < 0 || this._size$() <= index) {
+ throw new Error("Section.getContent() : range error " + (index + ""));
+ }
+ startPosition = 0;
+ if (index > 0) {
+ startPosition = this._bitVector.select$I(index - 1) + 1;
+ }
+ length = this._bitVector.select$I(index) - startPosition + 1;
+ return this._parent._getSubstring$II(startPosition, length);
+};
+
+/**
+ * @param {!number} index
+ * @return {!number}
+ */
+Metadata.prototype.getStartPosition$I = function (index) {
+ /** @type {!number} */
+ var startPosition;
+ if (index < 0 || this._size$() <= index) {
+ throw new Error("Section.getContent() : range error " + (index + ""));
+ }
+ startPosition = 0;
+ if (index > 0) {
+ startPosition = this._bitVector.select$I(index - 1) + 1;
+ }
+ return (startPosition | 0);
+};
+
+/**
+ * @param {SingleResult} result
+ * @param {Array.<undefined|!number>} positions
+ * @param {!string} word
+ * @param {!boolean} stemmed
+ */
+Metadata.prototype.grouping$LSingleResult$AISB = function (result, positions, word, stemmed) {
+};
+
+/**
+ * @param {!number} index
+ * @return {!string}
+ */
+Metadata.prototype.getInformation$I = function (index) {
+ return '';
+};
+
+/**
+ */
+Metadata.prototype._build$ = function () {
+ this._bitVector.build$();
+};
+
+/**
+ * @param {!string} name
+ * @param {!string} data
+ * @param {!number} offset
+ * @return {!number}
+ */
+Metadata.prototype._load$SSI = function (name, data, offset) {
+ offset = this._bitVector.load$SI(data, offset);
+ this._parent._metadataLabels.push(name);
+ this._parent._metadatas[name] = this;
+ return offset;
+};
+
+/**
+ * @return {!string}
+ */
+Metadata.prototype._dump$ = function () {
+ /** @type {BitVector} */
+ var this$0;
+ /** @type {Array.<undefined|!string>} */
+ var contents$0;
+ this$0 = this._bitVector;
+ contents$0 = [ ];
+ contents$0.push(Binary$dump32bitNumber$N(this$0._size));
+ contents$0.push(Binary$dump32bitNumberList$AN(this$0._v));
+ return contents$0.join('');
+};
+
+/**
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+Metadata.prototype._dump$LCompressionReport$ = function (report) {
+ /** @type {BitVector} */
+ var this$0;
+ /** @type {Array.<undefined|!string>} */
+ var contents$0;
+ this$0 = this._bitVector;
+ contents$0 = [ ];
+ contents$0.push(Binary$dump32bitNumber$N(this$0._size));
+ CompressionReport$add$LCompressionReport$II(report, 2, 2);
+ contents$0.push(Binary$dump32bitNumberList$ANLCompressionReport$(this$0._v, report));
+ return contents$0.join('');
+};
+
+/**
+ * class Section extends Metadata
+ * @constructor
+ */
+function Section() {
+}
+
+Section.prototype = new Metadata;
+/**
+ * @constructor
+ * @param {Oktavia} parent
+ */
+function Section$LOktavia$(parent) {
+ this._parent = parent;
+ this._bitVector = new BitVector$();
+ this._names = [ ];
+};
+
+Section$LOktavia$.prototype = new Section;
+
+/**
+ * @param {!string} name
+ */
+Section.prototype.setTail$S = function (name) {
+ /** @type {!number} */
+ var index$0;
+ /** @type {Oktavia} */
+ var this$0;
+ /** @type {FMIndex} */
+ var this$0$0;
+ this$0 = this._parent;
+ this$0$0 = this$0._fmindex;
+ index$0 = this$0$0._substr.length;
+ this._names.push(name);
+ this._bitVector.set$I(index$0 - 1);
+};
+
+/**
+ * @param {!string} name
+ * @param {!number} index
+ */
+Section.prototype.setTail$SI = function (name, index) {
+ this._names.push(name);
+ this._bitVector.set$I(index - 1);
+};
+
+/**
+ * @return {!number}
+ */
+Section.prototype.size$ = function () {
+ return (this._names.length | 0);
+};
+
+/**
+ * @param {!number} position
+ * @return {!number}
+ */
+Section.prototype.getSectionIndex$I = function (position) {
+ /** @type {BitVector} */
+ var this$0;
+ if (position < 0 || this._bitVector.size$() <= position) {
+ throw new Error("Section.getSectionIndex() : range error " + (position + ""));
+ }
+ this$0 = this._bitVector;
+ return this$0.rank$IB(position, true);
+};
+
+/**
+ * @param {!number} index
+ * @return {!string}
+ */
+Section.prototype.getName$I = function (index) {
+ if (index < 0 || this._names.length <= index) {
+ throw new Error("Section.getName() : range error");
+ }
+ return this._names[index];
+};
+
+/**
+ * @param {SingleResult} result
+ * @param {Array.<undefined|!number>} positions
+ * @param {!string} word
+ * @param {!boolean} stemmed
+ */
+Section.prototype.grouping$LSingleResult$AISB = function (result, positions, word, stemmed) {
+ /** @type {!number} */
+ var i;
+ /** @type {undefined|!number} */
+ var position;
+ /** @type {!number} */
+ var index;
+ /** @type {SearchUnit} */
+ var unit;
+ for (i = 0; i < positions.length; i++) {
+ position = positions[i];
+ index = this.getSectionIndex$I(position);
+ unit = SingleResult$getSearchUnit$LSingleResult$I(result, index);
+ if (unit.startPosition < 0) {
+ unit.startPosition = this.getStartPosition$I(index);
+ }
+ SearchUnit$addPosition$LSearchUnit$SIB(unit, word, position - unit.startPosition, stemmed);
+ }
+};
+
+/**
+ * @param {!number} index
+ * @return {!string}
+ */
+Section.prototype.getInformation$I = function (index) {
+ return this.getName$I(index);
+};
+
+/**
+ * @param {Oktavia} parent
+ * @param {!string} name
+ * @param {!string} data
+ * @param {!number} offset
+ * @return {!number}
+ */
+Section._load$LOktavia$SSI = function (parent, name, data, offset) {
+ /** @type {LoadedStringListResult} */
+ var strs;
+ /** @type {Section} */
+ var section;
+ /** @type {!number} */
+ var offset$0;
+ strs = new LoadedStringListResult$SI(data, offset);
+ section = new Section$LOktavia$(parent);
+ section._names = strs.result;
+ offset$0 = strs.offset;
+ offset$0 = section._bitVector.load$SI(data, offset$0);
+ section._parent._metadataLabels.push(name);
+ section._parent._metadatas[name] = section;
+ return offset$0;
+};
+
+var Section$_load$LOktavia$SSI = Section._load$LOktavia$SSI;
+
+/**
+ * @return {!string}
+ */
+Section.prototype._dump$ = function () {
+ return [ Binary$dump16bitNumber$I(0), Binary$dumpStringList$AS(this._names), Metadata.prototype._dump$.call(this) ].join('');
+};
+
+/**
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+Section.prototype._dump$LCompressionReport$ = function (report) {
+ CompressionReport$add$LCompressionReport$II(report, 1, 1);
+ return [ Binary$dump16bitNumber$I(0), Binary$dumpStringList$ASLCompressionReport$(this._names, report), Metadata.prototype._dump$LCompressionReport$.call(this, report) ].join('');
+};
+
+/**
+ * class Splitter extends Metadata
+ * @constructor
+ */
+function Splitter() {
+}
+
+Splitter.prototype = new Metadata;
+/**
+ * @constructor
+ * @param {Oktavia} parent
+ */
+function Splitter$LOktavia$(parent) {
+ this._parent = parent;
+ this._bitVector = new BitVector$();
+ this.name = null;
+};
+
+Splitter$LOktavia$.prototype = new Splitter;
+
+/**
+ * @constructor
+ * @param {Oktavia} parent
+ * @param {!string} name
+ */
+function Splitter$LOktavia$S(parent, name) {
+ this._parent = parent;
+ this._bitVector = new BitVector$();
+ this.name = name;
+};
+
+Splitter$LOktavia$S.prototype = new Splitter;
+
+/**
+ * @return {!number}
+ */
+Splitter.prototype.size$ = function () {
+ /** @type {BitVector} */
+ var this$0$0;
+ /** @type {!number} */
+ var i$0$0;
+ /** @type {BitVector} */
+ var _bitVector$0;
+ this$0$0 = _bitVector$0 = this._bitVector;
+ i$0$0 = _bitVector$0._size;
+ return this$0$0.rank$IB(i$0$0, true);
+};
+
+/**
+ */
+Splitter.prototype.split$ = function () {
+ /** @type {!number} */
+ var index$0;
+ /** @type {Oktavia} */
+ var this$0;
+ /** @type {FMIndex} */
+ var this$0$0;
+ this$0 = this._parent;
+ this$0$0 = this$0._fmindex;
+ index$0 = this$0$0._substr.length;
+ this._bitVector.set$I(index$0 - 1);
+};
+
+/**
+ * @param {!number} index
+ */
+Splitter.prototype.split$I = function (index) {
+ this._bitVector.set$I(index - 1);
+};
+
+/**
+ * @param {!number} position
+ * @return {!number}
+ */
+Splitter.prototype.getIndex$I = function (position) {
+ /** @type {BitVector} */
+ var this$0;
+ if (position < 0 || this._bitVector.size$() <= position) {
+ throw new Error("Section.getSectionIndex() : range error");
+ }
+ this$0 = this._bitVector;
+ return this$0.rank$IB(position, true);
+};
+
+/**
+ * @param {SingleResult} result
+ * @param {Array.<undefined|!number>} positions
+ * @param {!string} word
+ * @param {!boolean} stemmed
+ */
+Splitter.prototype.grouping$LSingleResult$AISB = function (result, positions, word, stemmed) {
+ /** @type {!number} */
+ var i;
+ /** @type {undefined|!number} */
+ var position;
+ /** @type {!number} */
+ var index;
+ /** @type {SearchUnit} */
+ var unit;
+ for (i = 0; i < positions.length; i++) {
+ position = positions[i];
+ index = this.getIndex$I(position);
+ unit = SingleResult$getSearchUnit$LSingleResult$I(result, index);
+ if (unit.startPosition < 0) {
+ unit.startPosition = this.getStartPosition$I(index);
+ }
+ SearchUnit$addPosition$LSearchUnit$SIB(unit, word, position - unit.startPosition, stemmed);
+ }
+};
+
+/**
+ * @param {!number} index
+ * @return {!string}
+ */
+Splitter.prototype.getInformation$I = function (index) {
+ return (this.name != null ? this.name + (index + 1 + "") : '');
+};
+
+/**
+ * @param {Oktavia} parent
+ * @param {!string} name
+ * @param {!string} data
+ * @param {!number} offset
+ * @return {!number}
+ */
+Splitter._load$LOktavia$SSI = function (parent, name, data, offset) {
+ /** @type {Splitter} */
+ var section;
+ section = new Splitter$LOktavia$(parent);
+ offset = section._bitVector.load$SI(data, offset);
+ section._parent._metadataLabels.push(name);
+ section._parent._metadatas[name] = section;
+ return offset;
+};
+
+var Splitter$_load$LOktavia$SSI = Splitter._load$LOktavia$SSI;
+
+/**
+ * @return {!string}
+ */
+Splitter.prototype._dump$ = function () {
+ return [ Binary$dump16bitNumber$I(1), Metadata.prototype._dump$.call(this) ].join('');
+};
+
+/**
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+Splitter.prototype._dump$LCompressionReport$ = function (report) {
+ CompressionReport$add$LCompressionReport$II(report, 1, 1);
+ return [ Binary$dump16bitNumber$I(1), Metadata.prototype._dump$LCompressionReport$.call(this, report) ].join('');
+};
+
+/**
+ * class Table extends Metadata
+ * @constructor
+ */
+function Table() {
+}
+
+Table.prototype = new Metadata;
+/**
+ * @constructor
+ * @param {Oktavia} parent
+ * @param {Array.<undefined|!string>} headers
+ */
+function Table$LOktavia$AS(parent, headers) {
+ this._parent = parent;
+ this._bitVector = new BitVector$();
+ this._headers = headers;
+ this._columnTails = new BitVector$();
+};
+
+Table$LOktavia$AS.prototype = new Table;
+
+/**
+ * @return {!number}
+ */
+Table.prototype.rowSize$ = function () {
+ /** @type {BitVector} */
+ var this$0$0;
+ /** @type {!number} */
+ var i$0$0;
+ /** @type {BitVector} */
+ var _bitVector$0;
+ this$0$0 = _bitVector$0 = this._bitVector;
+ i$0$0 = _bitVector$0._size;
+ return this$0$0.rank$IB(i$0$0, true);
+};
+
+/**
+ * @return {!number}
+ */
+Table.prototype.columnSize$ = function () {
+ return (this._headers.length | 0);
+};
+
+/**
+ */
+Table.prototype.setColumnTail$ = function () {
+ /** @type {!number} */
+ var index;
+ /** @type {Oktavia} */
+ var this$0;
+ /** @type {FMIndex} */
+ var this$0$0;
+ /** @type {Oktavia} */
+ var _parent$0;
+ this$0 = _parent$0 = this._parent;
+ this$0$0 = this$0._fmindex;
+ index = this$0$0._substr.length;
+ _parent$0._fmindex.push$S(Oktavia.eob);
+ this._columnTails.set$I(index - 1);
+};
+
+/**
+ */
+Table.prototype.setRowTail$ = function () {
+ /** @type {!number} */
+ var index;
+ /** @type {Oktavia} */
+ var this$0;
+ /** @type {FMIndex} */
+ var this$0$0;
+ this$0 = this._parent;
+ this$0$0 = this$0._fmindex;
+ index = this$0$0._substr.length;
+ this._bitVector.set$I(index - 1);
+};
+
+/**
+ * @param {!number} position
+ * @return {Array.<undefined|!number>}
+ */
+Table.prototype.getCell$I = function (position) {
+ /** @type {!number} */
+ var row;
+ /** @type {!number} */
+ var currentColumn;
+ /** @type {!number} */
+ var lastRowColumn;
+ /** @type {!number} */
+ var startPosition;
+ /** @type {Array.<undefined|!number>} */
+ var result;
+ /** @type {BitVector} */
+ var this$0;
+ /** @type {BitVector} */
+ var this$1;
+ if (position < 0 || this._bitVector.size$() <= position) {
+ throw new Error("Section.getSectionIndex() : range error " + (position + ""));
+ }
+ this$0 = this._bitVector;
+ row = this$0.rank$IB(position, true);
+ this$1 = this._columnTails;
+ currentColumn = this$1.rank$IB(position, true);
+ lastRowColumn = 0;
+ if (row > 0) {
+ startPosition = this._bitVector.select$I(row - 1) + 1;
+ lastRowColumn = this._columnTails.rank$I(startPosition);
+ }
+ result = [ row, currentColumn - lastRowColumn ];
+ return result;
+};
+
+/**
+ * @param {!number} rowIndex
+ * @return {Object.<string, undefined|!string>}
+ */
+Table.prototype.getRowContent$I = function (rowIndex) {
+ /** @type {!string} */
+ var content;
+ /** @type {Array.<undefined|!string>} */
+ var values;
+ /** @type {Object.<string, undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var i;
+ content = this.getContent$I(rowIndex);
+ values = content.split(Oktavia.eob, this._headers.length);
+ result = ({ });
+ for (i in this._headers) {
+ if (i < values.length) {
+ result[this._headers[i]] = values[i];
+ } else {
+ result[this._headers[i]] = '';
+ }
+ }
+ return result;
+};
+
+/**
+ * @param {SingleResult} result
+ * @param {Array.<undefined|!number>} positions
+ * @param {!string} word
+ * @param {!boolean} stemmed
+ */
+Table.prototype.grouping$LSingleResult$AISB = function (result, positions, word, stemmed) {
+};
+
+/**
+ * @param {!number} index
+ * @return {!string}
+ */
+Table.prototype.getInformation$I = function (index) {
+ return '';
+};
+
+/**
+ */
+Table.prototype._build$ = function () {
+ this._bitVector.build$();
+ this._columnTails.build$();
+};
+
+/**
+ * @param {Oktavia} parent
+ * @param {!string} name
+ * @param {!string} data
+ * @param {!number} offset
+ * @return {!number}
+ */
+Table._load$LOktavia$SSI = function (parent, name, data, offset) {
+ /** @type {LoadedStringListResult} */
+ var strs;
+ /** @type {Table} */
+ var table;
+ /** @type {!number} */
+ var offset$0;
+ strs = new LoadedStringListResult$SI(data, offset);
+ table = new Table$LOktavia$AS(parent, strs.result);
+ offset$0 = strs.offset;
+ offset$0 = table._bitVector.load$SI(data, offset$0);
+ table._parent._metadataLabels.push(name);
+ table._parent._metadatas[name] = table;
+ offset = offset$0;
+ return table._columnTails.load$SI(data, offset$0);
+};
+
+var Table$_load$LOktavia$SSI = Table._load$LOktavia$SSI;
+
+/**
+ * @return {!string}
+ */
+Table.prototype._dump$ = function () {
+ return [ Binary$dump16bitNumber$I(2), Binary$dumpStringList$AS(this._headers), Metadata.prototype._dump$.call(this), this._columnTails.dump$() ].join('');
+};
+
+/**
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+Table.prototype._dump$LCompressionReport$ = function (report) {
+ CompressionReport$add$LCompressionReport$II(report, 1, 1);
+ return [ Binary$dump16bitNumber$I(2), Binary$dumpStringList$ASLCompressionReport$(this._headers, report), Metadata.prototype._dump$LCompressionReport$.call(this, report), this._columnTails.dump$LCompressionReport$(report) ].join('');
+};
+
+/**
+ * class Block extends Metadata
+ * @constructor
+ */
+function Block() {
+}
+
+Block.prototype = new Metadata;
+/**
+ * @constructor
+ * @param {Oktavia} parent
+ */
+function Block$LOktavia$(parent) {
+ this._parent = parent;
+ this._bitVector = new BitVector$();
+ this._names = [ ];
+ this._start = false;
+};
+
+Block$LOktavia$.prototype = new Block;
+
+/**
+ * @param {!string} blockName
+ */
+Block.prototype.startBlock$S = function (blockName) {
+ this.startBlock$SI(blockName, this._parent.contentSize$());
+};
+
+/**
+ * @param {!string} blockName
+ * @param {!number} index
+ */
+Block.prototype.startBlock$SI = function (blockName, index) {
+ if (this._start) {
+ throw new Error('Splitter `' + this._names[this._names.length - 1] + '` is not closed');
+ }
+ this._start = true;
+ this._names.push(blockName);
+ this._bitVector.set$I(index - 1);
+};
+
+/**
+ */
+Block.prototype.endBlock$ = function () {
+ this.endBlock$I(this._parent.contentSize$());
+};
+
+/**
+ * @param {!number} index
+ */
+Block.prototype.endBlock$I = function (index) {
+ if (! this._start) {
+ throw new Error('Splitter is not started');
+ }
+ this._start = false;
+ this._bitVector.set$I(index - 1);
+};
+
+/**
+ * @return {!number}
+ */
+Block.prototype.size$ = function () {
+ return (this._names.length | 0);
+};
+
+/**
+ * @param {!number} position
+ * @return {!number}
+ */
+Block.prototype.blockIndex$I = function (position) {
+ /** @type {!number} */
+ var result;
+ /** @type {BitVector} */
+ var this$0;
+ if (position < 0 || this._parent._fmindex.size$() - 1 <= position) {
+ throw new Error("Block.blockIndex() : range error " + (position + ""));
+ }
+ if (position >= this._bitVector.size$()) {
+ position = (this._bitVector.size$() - 1 | 0);
+ result = (this._bitVector.rank$I(position) + 1 | 0);
+ } else {
+ this$0 = this._bitVector;
+ result = this$0.rank$IB(position, true);
+ }
+ return result;
+};
+
+/**
+ * @param {!number} position
+ * @return {!boolean}
+ */
+Block.prototype.inBlock$I = function (position) {
+ /** @type {!number} */
+ var blockIndex;
+ blockIndex = this.blockIndex$I(position);
+ return blockIndex % 2 !== 0;
+};
+
+/**
+ * @param {!number} position
+ * @return {!string}
+ */
+Block.prototype.getBlockContent$I = function (position) {
+ /** @type {!number} */
+ var blockIndex;
+ /** @type {!string} */
+ var result;
+ blockIndex = this.blockIndex$I(position);
+ if (blockIndex % 2 !== 0) {
+ result = this.getContent$I(blockIndex);
+ } else {
+ result = '';
+ }
+ return result;
+};
+
+/**
+ * @param {!number} position
+ * @return {!string}
+ */
+Block.prototype.getBlockName$I = function (position) {
+ /** @type {!number} */
+ var blockIndex;
+ /** @type {!string} */
+ var result;
+ blockIndex = this.blockIndex$I(position);
+ if (blockIndex % 2 !== 0) {
+ result = this._names[blockIndex >>> 1];
+ } else {
+ result = '';
+ }
+ return result;
+};
+
+/**
+ * @param {SingleResult} result
+ * @param {Array.<undefined|!number>} positions
+ * @param {!string} word
+ * @param {!boolean} stemmed
+ */
+Block.prototype.grouping$LSingleResult$AISB = function (result, positions, word, stemmed) {
+};
+
+/**
+ * @param {!number} index
+ * @return {!string}
+ */
+Block.prototype.getInformation$I = function (index) {
+ return '';
+};
+
+/**
+ * @param {Oktavia} parent
+ * @param {!string} name
+ * @param {!string} data
+ * @param {!number} offset
+ * @return {!number}
+ */
+Block._load$LOktavia$SSI = function (parent, name, data, offset) {
+ /** @type {LoadedStringListResult} */
+ var strs;
+ /** @type {Block} */
+ var block;
+ /** @type {!number} */
+ var offset$0;
+ strs = new LoadedStringListResult$SI(data, offset);
+ block = new Block$LOktavia$(parent);
+ block._names = strs.result;
+ offset$0 = strs.offset;
+ offset$0 = block._bitVector.load$SI(data, offset$0);
+ block._parent._metadataLabels.push(name);
+ block._parent._metadatas[name] = block;
+ return offset$0;
+};
+
+var Block$_load$LOktavia$SSI = Block._load$LOktavia$SSI;
+
+/**
+ * @return {!string}
+ */
+Block.prototype._dump$ = function () {
+ return [ Binary$dump16bitNumber$I(3), Binary$dumpStringList$AS(this._names), Metadata.prototype._dump$.call(this) ].join('');
+};
+
+/**
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+Block.prototype._dump$LCompressionReport$ = function (report) {
+ CompressionReport$add$LCompressionReport$II(report, 1, 1);
+ return [ Binary$dump16bitNumber$I(3), Binary$dumpStringList$ASLCompressionReport$(this._names, report), Metadata.prototype._dump$LCompressionReport$.call(this, report) ].join('');
+};
+
+/**
+ * class FMIndex extends Object
+ * @constructor
+ */
+function FMIndex() {
+}
+
+/**
+ * @constructor
+ */
+function FMIndex$() {
+ /** @type {Array.<undefined|!number>} */
+ var _rlt$0;
+ this._ssize = 0;
+ (this._ddic = 0, this._head = 0);
+ this._substr = "";
+ this._sv = new WaveletMatrix$();
+ this._posdic = [ ];
+ this._idic = [ ];
+ _rlt$0 = this._rlt = [ ];
+ _rlt$0.length = 65536;
+};
+
+FMIndex$.prototype = new FMIndex;
+
+/**
+ */
+FMIndex.prototype.clear$ = function () {
+ /** @type {WaveletMatrix} */
+ var this$0;
+ this$0 = this._sv;
+ this$0._bv.length = 0;
+ this$0._seps.length = 0;
+ this$0._size = 0;
+ this._posdic.length = 0;
+ this._idic.length = 0;
+ this._ddic = 0;
+ this._head = 0;
+ this._substr = "";
+};
+
+/**
+ * @return {!number}
+ */
+FMIndex.prototype.size$ = function () {
+ /** @type {WaveletMatrix} */
+ var this$0;
+ this$0 = this._sv;
+ return this$0._size;
+};
+
+/**
+ * @return {!number}
+ */
+FMIndex.prototype.contentSize$ = function () {
+ return this._substr.length;
+};
+
+/**
+ * @param {!string} key
+ * @return {!number}
+ */
+FMIndex.prototype.getRows$S = function (key) {
+ /** @type {Array.<undefined|!number>} */
+ var pos;
+ pos = [ ];
+ return this.getRows$SAI(key, pos);
+};
+
+/**
+ * @param {!string} key
+ * @param {Array.<undefined|!number>} pos
+ * @return {!number}
+ */
+FMIndex.prototype.getRows$SAI = function (key, pos) {
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var code;
+ /** @type {!number} */
+ var first;
+ /** @type {undefined|!number} */
+ var last;
+ /** @type {!number} */
+ var c;
+ /** @type {Array.<undefined|!number>} */
+ var _rlt$0;
+ i = key.length - 1;
+ code = key.charCodeAt(i);
+ first = (_rlt$0 = this._rlt)[code] + 1;
+ last = _rlt$0[code + 1];
+ while (first <= last) {
+ if (i === 0) {
+ pos[0] = (-- first | 0);
+ pos[1] = -- last;
+ return (last - first + 1 | 0);
+ }
+ i--;
+ c = key.charCodeAt(i);
+ first = this._rlt[c] + this._sv.rank$II(first - 1, c) + 1;
+ last = this._rlt[c] + this._sv.rank$II(last, c);
+ }
+ return 0;
+};
+
+/**
+ * @param {!number} i
+ * @return {!number}
+ */
+FMIndex.prototype.getPosition$I = function (i) {
+ /** @type {!number} */
+ var pos;
+ /** @type {!number} */
+ var c;
+ if (i >= this.size$()) {
+ throw new Error("FMIndex.getPosition() : range error");
+ }
+ pos = 0;
+ while (i !== this._head) {
+ if (i % this._ddic === 0) {
+ pos += this._posdic[i / this._ddic] + 1;
+ break;
+ }
+ c = this._sv.get$I(i);
+ i = this._rlt[c] + this._sv.rank$II(i, c);
+ pos++;
+ }
+ return (pos % this.size$() | 0);
+};
+
+/**
+ * @param {!number} pos
+ * @param {!number} len
+ * @return {!string}
+ */
+FMIndex.prototype.getSubstring$II = function (pos, len) {
+ /** @type {!number} */
+ var pos_end;
+ /** @type {!number} */
+ var pos_tmp;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var pos_idic;
+ /** @type {!string} */
+ var substr;
+ /** @type {!number} */
+ var c;
+ /** @type {!number} */
+ var _ddic$0;
+ if (pos >= this.size$()) {
+ throw new Error("FMIndex.getSubstring() : range error");
+ }
+ pos_end = Math.min(pos + len, this.size$());
+ pos_tmp = this.size$() - 1;
+ i = this._head;
+ pos_idic = Math.floor((pos_end + (_ddic$0 = this._ddic) - 2) / _ddic$0);
+ if (pos_idic < this._idic.length) {
+ pos_tmp = pos_idic * this._ddic;
+ i = this._idic[pos_idic];
+ }
+ substr = "";
+ while (pos_tmp >= pos) {
+ c = this._sv.get$I(i);
+ i = this._rlt[c] + this._sv.rank$II(i, c);
+ if (pos_tmp < pos_end) {
+ substr = String.fromCharCode(c) + substr;
+ }
+ if (pos_tmp === 0) {
+ break;
+ }
+ pos_tmp--;
+ }
+ return substr;
+};
+
+/**
+ */
+FMIndex.prototype.build$ = function () {
+ this.build$SIIB(String.fromCharCode(0), 65535, 20, false);
+};
+
+/**
+ * @param {!string} end_marker
+ * @param {!number} ddic
+ * @param {!boolean} verbose
+ */
+FMIndex.prototype.build$SIB = function (end_marker, ddic, verbose) {
+ this.build$SIIB(end_marker, 65535, ddic, verbose);
+};
+
+/**
+ * @param {!string} end_marker
+ * @param {!number} maxChar
+ * @param {!number} ddic
+ * @param {!boolean} verbose
+ */
+FMIndex.prototype.build$SIIB = function (end_marker, maxChar, ddic, verbose) {
+ /** @type {BurrowsWheelerTransform} */
+ var b;
+ /** @type {!string} */
+ var s;
+ /** @type {!number} */
+ var c;
+ /** @type {!string} */
+ var str$0;
+ /** @type {WaveletMatrix} */
+ var this$0;
+ /** @type {!string} */
+ var _str$0;
+ /** @type {Array.<undefined|!number>} */
+ var _suffixarray$0;
+ if (verbose) {
+ console.time("building burrows-wheeler transform");
+ }
+ this._substr += end_marker;
+ b = ({_str: "", _size: 0, _head: 0, _suffixarray: [ ]});
+ str$0 = this._substr;
+ _str$0 = b._str = str$0;
+ b._size = _str$0.length;
+ _suffixarray$0 = b._suffixarray = SAIS$make$S(str$0);
+ b._head = (_suffixarray$0.indexOf(0) | 0);
+ s = BurrowsWheelerTransform$get$LBurrowsWheelerTransform$(b);
+ this._ssize = s.length;
+ this._head = b._head;
+ b._str = "";
+ b._size = 0;
+ b._head = 0;
+ b._suffixarray.length = 0;
+ this._substr = "";
+ if (verbose) {
+ console.timeEnd("building burrows-wheeler transform");
+ }
+ if (verbose) {
+ console.time("building wavelet matrix");
+ }
+ this$0 = this._sv;
+ this$0._bitsize = (Math.ceil(Math.log(maxChar) / 0.6931471805599453) | 0);
+ if (verbose) {
+ console.log(" maxCharCode: ", maxChar);
+ console.log(" bitSize: ", this._sv.bitsize$());
+ }
+ this._sv.build$S(s);
+ if (verbose) {
+ console.timeEnd("building wavelet matrix");
+ }
+ if (verbose) {
+ console.time("caching rank less than");
+ }
+ for (c = 0; c < maxChar; c++) {
+ this._rlt[c] = this._sv.rank_less_than$II(this._sv.size$(), c);
+ }
+ if (verbose) {
+ console.timeEnd("caching rank less than");
+ }
+ this._ddic = ddic;
+ if (verbose) {
+ console.time("building dictionaries");
+ }
+ this._buildDictionaries$();
+ if (verbose) {
+ console.timeEnd("building dictionaries");
+ console.log('');
+ }
+};
+
+/**
+ */
+FMIndex.prototype._buildDictionaries$ = function () {
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var pos;
+ /** @type {!number} */
+ var c;
+ for (i = 0; i < this._ssize / this._ddic + 1; i++) {
+ this._posdic.push(0);
+ this._idic.push(0);
+ }
+ i = this._head;
+ pos = this.size$() - 1;
+ do {
+ if (i % this._ddic === 0) {
+ this._posdic[Math.floor(i / this._ddic)] = (pos | 0);
+ }
+ if (pos % this._ddic === 0) {
+ this._idic[Math.floor(pos / this._ddic)] = (i | 0);
+ }
+ c = this._sv.get$I(i);
+ i = this._rlt[c] + this._sv.rank$II(i, c);
+ pos--;
+ } while (i !== this._head);
+};
+
+/**
+ * @param {!string} doc
+ */
+FMIndex.prototype.push$S = function (doc) {
+ if (doc.length <= 0) {
+ throw new Error("FMIndex::push(): empty string");
+ }
+ this._substr += doc;
+};
+
+/**
+ * @param {!string} keyword
+ * @return {Array.<undefined|!number>}
+ */
+FMIndex.prototype.search$S = function (keyword) {
+ /** @type {Array.<undefined|!number>} */
+ var result;
+ /** @type {Array.<undefined|!number>} */
+ var position;
+ /** @type {!number} */
+ var rows;
+ /** @type {undefined|!number} */
+ var first;
+ /** @type {undefined|!number} */
+ var last;
+ /** @type {undefined|!number} */
+ var i;
+ result = [ ];
+ position = [ ];
+ rows = this.getRows$SAI(keyword, position);
+ if (rows > 0) {
+ first = position[0];
+ last = position[1];
+ for (i = first; i <= last; i++) {
+ result.push(this.getPosition$I(i));
+ }
+ }
+ return result;
+};
+
+/**
+ * @return {!string}
+ */
+FMIndex.prototype.dump$ = function () {
+ return this.dump$B(false);
+};
+
+/**
+ * @param {!boolean} verbose
+ * @return {!string}
+ */
+FMIndex.prototype.dump$B = function (verbose) {
+ /** @type {Array.<undefined|!string>} */
+ var contents;
+ /** @type {CompressionReport} */
+ var report;
+ /** @type {!number} */
+ var i;
+ contents = [ ];
+ report = ({source: 0, result: 0});
+ contents.push(Binary$dump32bitNumber$N(this._ddic));
+ contents.push(Binary$dump32bitNumber$N(this._ssize));
+ contents.push(Binary$dump32bitNumber$N(this._head));
+ CompressionReport$add$LCompressionReport$II(report, 6, 6);
+ contents.push(this._sv.dump$LCompressionReport$(report));
+ if (verbose) {
+ console.log("Serializing FM-index");
+ console.log(' Wavelet Matrix: ' + (contents[3].length * 2 + "") + ' bytes (' + (Math.round(report.result * 100.0 / report.source) + "") + '%)');
+ }
+ contents.push(Binary$dump32bitNumber$N(this._posdic.length));
+ for (i in this._posdic) {
+ contents.push(Binary$dump32bitNumber$N(this._posdic[i]));
+ }
+ for (i in this._idic) {
+ contents.push(Binary$dump32bitNumber$N(this._idic[i]));
+ }
+ if (verbose) {
+ console.log(' Dictionary Cache: ' + (this._idic.length * 16 + "") + ' bytes');
+ }
+ return contents.join("");
+};
+
+/**
+ * @param {!string} data
+ * @return {!number}
+ */
+FMIndex.prototype.load$S = function (data) {
+ return this.load$SI(data, 0);
+};
+
+/**
+ * @param {!string} data
+ * @param {!number} offset
+ * @return {!number}
+ */
+FMIndex.prototype.load$SI = function (data, offset) {
+ /** @type {!number} */
+ var maxChar;
+ /** @type {!number} */
+ var c;
+ /** @type {!number} */
+ var size;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var result$0;
+ /** @type {!number} */
+ var result$1;
+ result$0 = data.charCodeAt(offset) * 65536 + data.charCodeAt(offset + 1);
+ this._ddic = (result$0 | 0);
+ this._ssize = (Binary$load32bitNumber$SI(data, offset + 2) | 0);
+ this._head = (Binary$load32bitNumber$SI(data, offset + 4) | 0);
+ offset = this._sv.load$SI(data, offset + 6);
+ maxChar = Math.pow(2, this._sv.bitsize$());
+ for (c = 0; c < maxChar; c++) {
+ this._rlt[c] = this._sv.rank_less_than$II(this._sv.size$(), c);
+ }
+ result$1 = data.charCodeAt(offset) * 65536 + data.charCodeAt(offset + 1);
+ size = result$1;
+ offset += 2;
+ for (i = 0; i < size; (i++, offset += 2)) {
+ this._posdic.push(Binary$load32bitNumber$SI(data, offset));
+ }
+ for (i = 0; i < size; (i++, offset += 2)) {
+ this._idic.push(Binary$load32bitNumber$SI(data, offset));
+ }
+ return offset;
+};
+
+/**
+ * class Tag extends Object
+ * @constructor
+ */
+function Tag() {
+}
+
+/**
+ * @constructor
+ * @param {!string} name
+ */
+function Tag$S(name) {
+ this.name = name;
+ this.attributes = ({ });
+ this.isSelfClosing = false;
+};
+
+Tag$S.prototype = new Tag;
+
+/**
+ * class _Common extends Object
+ * @constructor
+ */
+function _Common() {
+}
+
+/**
+ * @constructor
+ */
+function _Common$() {
+};
+
+_Common$.prototype = new _Common;
+
+/**
+ * class _State extends Object
+ * @constructor
+ */
+function _State() {
+}
+
+/**
+ * @constructor
+ */
+function _State$() {
+};
+
+_State$.prototype = new _State;
+
+/**
+ * class SAXHandler extends Object
+ * @constructor
+ */
+function SAXHandler() {
+}
+
+/**
+ * @constructor
+ */
+function SAXHandler$() {
+ this.position = 0;
+ this.column = 0;
+ this.line = 0;
+};
+
+SAXHandler$.prototype = new SAXHandler;
+
+/**
+ * @param {Error} error
+ */
+SAXHandler.prototype.onerror$LError$ = function (error) {
+};
+
+/**
+ * @param {!string} text
+ */
+SAXHandler.prototype.ontext$S = function (text) {
+};
+
+/**
+ * @param {!string} doctype
+ */
+SAXHandler.prototype.ondoctype$S = function (doctype) {
+};
+
+/**
+ * @param {!string} name
+ * @param {!string} body
+ */
+SAXHandler.prototype.onprocessinginstruction$SS = function (name, body) {
+};
+
+/**
+ * @param {!string} sgmlDecl
+ */
+SAXHandler.prototype.onsgmldeclaration$S = function (sgmlDecl) {
+};
+
+/**
+ * @param {!string} tagname
+ * @param {Object.<string, undefined|!string>} attributes
+ */
+SAXHandler.prototype.onopentag$SHS = function (tagname, attributes) {
+};
+
+/**
+ * @param {!string} tagname
+ */
+SAXHandler.prototype.onclosetag$S = function (tagname) {
+};
+
+/**
+ * @param {!string} name
+ * @param {!string} value
+ */
+SAXHandler.prototype.onattribute$SS = function (name, value) {
+};
+
+/**
+ * @param {!string} comment
+ */
+SAXHandler.prototype.oncomment$S = function (comment) {
+};
+
+/**
+ */
+SAXHandler.prototype.onopencdata$ = function () {
+};
+
+/**
+ * @param {!string} cdata
+ */
+SAXHandler.prototype.oncdata$S = function (cdata) {
+};
+
+/**
+ */
+SAXHandler.prototype.onclosecdata$ = function () {
+};
+
+/**
+ */
+SAXHandler.prototype.onend$ = function () {
+};
+
+/**
+ */
+SAXHandler.prototype.onready$ = function () {
+};
+
+/**
+ * @param {!string} script
+ */
+SAXHandler.prototype.onscript$S = function (script) {
+};
+
+/**
+ * class _HTMLHandler extends SAXHandler
+ * @constructor
+ */
+function _HTMLHandler() {
+}
+
+_HTMLHandler.prototype = new SAXHandler;
+/**
+ * @constructor
+ * @param {Object.<string, undefined|Array.<undefined|!string>>} styles
+ * @param {!boolean} escape
+ */
+function _HTMLHandler$HASB(styles, escape) {
+ this.position = 0;
+ this.column = 0;
+ this.line = 0;
+ this.text = [ ];
+ this.escape = escape;
+ this.styles = styles;
+};
+
+_HTMLHandler$HASB.prototype = new _HTMLHandler;
+
+/**
+ * @param {!string} str
+ * @return {!string}
+ */
+_HTMLHandler.escapeHTML$S = function (str) {
+ return str.replace(/\n/g, "<br/>").replace(/&/g, "&amp;").replace(/"/g, "&quot;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
+};
+
+var _HTMLHandler$escapeHTML$S = _HTMLHandler.escapeHTML$S;
+
+/**
+ * @param {!string} tagname
+ * @param {Object.<string, undefined|!string>} attributes
+ */
+_HTMLHandler.prototype.onopentag$SHS = function (tagname, attributes) {
+ this.text.push(this.styles[tagname][0]);
+};
+
+/**
+ * @param {!string} tagname
+ */
+_HTMLHandler.prototype.onclosetag$S = function (tagname) {
+ this.text.push(this.styles[tagname][1]);
+};
+
+/**
+ * @param {!string} text
+ */
+_HTMLHandler.prototype.ontext$S = function (text) {
+ if (this.escape) {
+ this.text.push(text.replace(/\n/g, "<br/>").replace(/&/g, "&amp;").replace(/"/g, "&quot;").replace(/</g, "&lt;").replace(/>/g, "&gt;"));
+ } else {
+ this.text.push(text);
+ }
+};
+
+/**
+ * @return {!string}
+ */
+_HTMLHandler.prototype.result$ = function () {
+ return this.text.join('');
+};
+
+/**
+ * class SAXParser extends Object
+ * @constructor
+ */
+function SAXParser() {
+}
+
+/**
+ * @constructor
+ * @param {SAXHandler} handler
+ */
+function SAXParser$LSAXHandler$(handler) {
+ this.q = "";
+ this.c = "";
+ this.bufferCheckPosition = 0;
+ this.looseCase = "";
+ this.tags = [ ];
+ this.closed = false;
+ this.closedRoot = false;
+ this.sawRoot = false;
+ this.tag = null;
+ this.error = null;
+ this.handler = null;
+ this.ENTITIES = null;
+ this.strict = false;
+ this.tagName = "";
+ this.state = 0;
+ this.line = 0;
+ this.column = 0;
+ this.position = 0;
+ this.startTagPosition = 0;
+ this.attribName = "";
+ this.attribValue = "";
+ this.script = "";
+ this.textNode = "";
+ this.attribList = null;
+ this.noscript = false;
+ this.cdata = "";
+ this.procInstBody = "";
+ this.procInstName = "";
+ this.doctype = "";
+ this.entity = "";
+ this.sgmlDecl = "";
+ this.comment = "";
+ this.preTags = 0;
+ this._init$LSAXHandler$B(handler, false);
+};
+
+SAXParser$LSAXHandler$.prototype = new SAXParser;
+
+/**
+ * @constructor
+ * @param {SAXHandler} handler
+ * @param {!boolean} strict
+ */
+function SAXParser$LSAXHandler$B(handler, strict) {
+ this.q = "";
+ this.c = "";
+ this.bufferCheckPosition = 0;
+ this.looseCase = "";
+ this.tags = [ ];
+ this.closed = false;
+ this.closedRoot = false;
+ this.sawRoot = false;
+ this.tag = null;
+ this.error = null;
+ this.handler = null;
+ this.ENTITIES = null;
+ this.strict = false;
+ this.tagName = "";
+ this.state = 0;
+ this.line = 0;
+ this.column = 0;
+ this.position = 0;
+ this.startTagPosition = 0;
+ this.attribName = "";
+ this.attribValue = "";
+ this.script = "";
+ this.textNode = "";
+ this.attribList = null;
+ this.noscript = false;
+ this.cdata = "";
+ this.procInstBody = "";
+ this.procInstName = "";
+ this.doctype = "";
+ this.entity = "";
+ this.sgmlDecl = "";
+ this.comment = "";
+ this.preTags = 0;
+ this._init$LSAXHandler$B(handler, strict);
+};
+
+SAXParser$LSAXHandler$B.prototype = new SAXParser;
+
+/**
+ * @param {SAXHandler} handler
+ * @param {!boolean} strict
+ */
+SAXParser.prototype._init$LSAXHandler$B = function (handler, strict) {
+ this.handler = handler;
+ this.clearBuffers$();
+ this.q = "";
+ this.bufferCheckPosition = 65536;
+ this.looseCase = 'toLowerCase';
+ this.tags = [ ];
+ this.closed = this.closedRoot = this.sawRoot = false;
+ this.tag = null;
+ this.error = null;
+ this.strict = strict;
+ this.noscript = strict;
+ this.state = 1;
+ this.ENTITIES = _Entities$entity_list$();
+ this.attribList = [ ];
+ this.noscript = false;
+ this.preTags = 0;
+};
+
+/**
+ * @param {!boolean} flag
+ */
+SAXParser.prototype.set_noscript$B = function (flag) {
+ this.noscript = flag;
+};
+
+/**
+ * @return {SAXParser}
+ */
+SAXParser.prototype.resume$ = function () {
+ this.error = null;
+ return this;
+};
+
+/**
+ * @return {SAXParser}
+ */
+SAXParser.prototype.close$ = function () {
+ return this.parse$S('');
+};
+
+/**
+ * @param {!string} chunk
+ * @return {SAXParser}
+ */
+SAXParser.prototype.parse$S = function (chunk) {
+ /** @type {Char} */
+ var _;
+ /** @type {!number} */
+ var i;
+ /** @type {!string} */
+ var c;
+ /** @type {!number} */
+ var starti;
+ /** @type {!number} */
+ var pad;
+ /** @type {!number} */
+ var returnState;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$0;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$1;
+ /** @type {RegExp} */
+ var charclass$2;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$3;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$4;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$5;
+ /** @type {!string} */
+ var text$0;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$6;
+ /** @type {RegExp} */
+ var charclass$7;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$8;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$9;
+ /** @type {RegExp} */
+ var charclass$10;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$11;
+ /** @type {RegExp} */
+ var charclass$12;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$13;
+ /** @type {RegExp} */
+ var charclass$14;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$15;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$16;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$17;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$18;
+ /** @type {RegExp} */
+ var charclass$19;
+ /** @type {RegExp} */
+ var charclass$20;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$21;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$22;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$23;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$24;
+ /** @type {!string} */
+ var comment$0;
+ _ = new Char$();
+ if (this.error) {
+ throw this.error;
+ }
+ if (this.closed) {
+ return this.emiterror$S("Cannot write after close. Assign an onready handler.");
+ }
+ (i = 0, c = "");
+ while (this.c = c = chunk.charAt(i++)) {
+ this.position++;
+ if (c === "\n") {
+ this.handler.line++;
+ this.handler.column = 0;
+ } else {
+ this.handler.column++;
+ }
+ switch (this.state) {
+ case 1:
+ if (c === "<") {
+ this.state = 4;
+ this.startTagPosition = this.position;
+ } else {
+ charclass$0 = _.whitespace;
+ if (! $__jsx_ObjectHasOwnProperty.call(charclass$0, c)) {
+ this.strictFail$S("Non-whitespace before first tag.");
+ this.textNode = c;
+ this.state = 2;
+ }
+ }
+ continue;
+ case 2:
+ if (this.sawRoot && ! this.closedRoot) {
+ starti = i - 1;
+ while (c && c !== "<" && c !== "&") {
+ c = chunk.charAt(i++);
+ if (c) {
+ this.position++;
+ if (c === "\n") {
+ this.handler.line++;
+ this.handler.column = 0;
+ } else {
+ this.handler.column++;
+ }
+ }
+ }
+ this.textNode += chunk.substring(starti, i - 1);
+ }
+ if (c === "<") {
+ this.state = 4;
+ this.startTagPosition = this.position;
+ } else {
+ if (_.not$HBS(_.whitespace, c) && (! this.sawRoot || this.closedRoot)) {
+ this.strictFail$S("Text data outside of root node.");
+ }
+ if (c === "&") {
+ this.state = 3;
+ } else {
+ this.textNode += c;
+ }
+ }
+ continue;
+ case 33:
+ if (c === "<") {
+ this.state = 34;
+ } else {
+ this.script += c;
+ }
+ continue;
+ case 34:
+ if (c === "/") {
+ this.state = 31;
+ } else {
+ this.script += "<" + c;
+ this.state = 33;
+ }
+ continue;
+ case 4:
+ if (c === "!") {
+ this.state = 5;
+ this.sgmlDecl = "";
+ } else {
+ charclass$1 = _.whitespace;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$1, c)) {
+ } else {
+ charclass$2 = _.nameStart;
+ if (charclass$2.test(c)) {
+ this.state = 21;
+ this.tagName = c;
+ } else {
+ if (c === "/") {
+ this.state = 31;
+ this.tagName = "";
+ } else {
+ if (c === "?") {
+ this.state = 18;
+ this.procInstName = this.procInstBody = "";
+ } else {
+ this.strictFail$S("Unencoded <");
+ if (this.startTagPosition + 1 < this.position) {
+ pad = this.position - this.startTagPosition;
+ for (i = 0; i < pad; i++) {
+ c = " " + c;
+ }
+ }
+ this.textNode += "<" + c;
+ this.state = 2;
+ }
+ }
+ }
+ }
+ }
+ continue;
+ case 5:
+ if ((this.sgmlDecl + c).toUpperCase() === _.CDATA) {
+ this.closetext_if_exist$();
+ this.state = 15;
+ this.sgmlDecl = "";
+ this.cdata = "";
+ } else {
+ if (this.sgmlDecl + c === "--") {
+ this.state = 12;
+ this.comment = "";
+ this.sgmlDecl = "";
+ } else {
+ if ((this.sgmlDecl + c).toUpperCase() === _.DOCTYPE) {
+ this.state = 7;
+ if (this.doctype || this.sawRoot) {
+ this.strictFail$S("Inappropriately located doctype declaration");
+ }
+ this.doctype = "";
+ this.sgmlDecl = "";
+ } else {
+ if (c === ">") {
+ this.closetext_if_exist$();
+ this.sgmlDecl = "";
+ this.state = 2;
+ } else {
+ charclass$3 = _.quote;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$3, c)) {
+ this.state = 6;
+ this.sgmlDecl += c;
+ } else {
+ this.sgmlDecl += c;
+ }
+ }
+ }
+ }
+ }
+ continue;
+ case 6:
+ if (c === this.q) {
+ this.state = 5;
+ this.q = "";
+ }
+ this.sgmlDecl += c;
+ continue;
+ case 7:
+ if (c === ">") {
+ this.state = 2;
+ this.closetext_if_exist$();
+ this.doctype.trim();
+ } else {
+ this.doctype += c;
+ if (c === "[") {
+ this.state = 9;
+ } else {
+ charclass$4 = _.quote;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$4, c)) {
+ this.state = 8;
+ this.q = c;
+ }
+ }
+ }
+ continue;
+ case 8:
+ this.doctype += c;
+ if (c === this.q) {
+ this.q = "";
+ this.state = 7;
+ }
+ continue;
+ case 9:
+ this.doctype += c;
+ if (c === "]") {
+ this.state = 7;
+ } else {
+ charclass$5 = _.quote;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$5, c)) {
+ this.state = 10;
+ this.q = c;
+ }
+ }
+ continue;
+ case 10:
+ this.doctype += c;
+ if (c === this.q) {
+ this.state = 9;
+ this.q = "";
+ }
+ continue;
+ case 12:
+ if (c === "-") {
+ this.state = 13;
+ } else {
+ this.comment += c;
+ }
+ continue;
+ case 13:
+ if (c === "-") {
+ this.state = 14;
+ text$0 = this.comment;
+ text$0 = text$0.replace(/[\n\t]/g, ' ');
+ text$0 = text$0.replace(/\s\s+/g, " ");
+ comment$0 = this.comment = text$0;
+ if (comment$0) {
+ this.closetext_if_exist$();
+ this.comment.trim();
+ }
+ this.comment = "";
+ } else {
+ this.comment += "-" + c;
+ this.state = 12;
+ }
+ continue;
+ case 14:
+ if (c !== ">") {
+ this.strictFail$S("Malformed comment");
+ this.comment += "--" + c;
+ this.state = 12;
+ } else {
+ this.state = 2;
+ }
+ continue;
+ case 15:
+ if (c === "]") {
+ this.state = 16;
+ } else {
+ this.cdata += c;
+ }
+ continue;
+ case 16:
+ if (c === "]") {
+ this.state = 17;
+ } else {
+ this.cdata += "]" + c;
+ this.state = 15;
+ }
+ continue;
+ case 17:
+ if (c === ">") {
+ if (this.cdata) {
+ this.closetext_if_exist$();
+ }
+ this.cdata = "";
+ this.state = 2;
+ } else {
+ if (c === "]") {
+ this.cdata += "]";
+ } else {
+ this.cdata += "]]" + c;
+ this.state = 15;
+ }
+ }
+ continue;
+ case 18:
+ if (c === "?") {
+ this.state = 20;
+ } else {
+ charclass$6 = _.whitespace;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$6, c)) {
+ this.state = 19;
+ } else {
+ this.procInstName += c;
+ }
+ }
+ continue;
+ case 19:
+ if (! this.procInstBody && _.is$HBS(_.whitespace, c)) {
+ continue;
+ } else {
+ if (c === "?") {
+ this.state = 20;
+ } else {
+ this.procInstBody += c;
+ }
+ }
+ continue;
+ case 20:
+ if (c === ">") {
+ this.closetext_if_exist$();
+ this.procInstName = this.procInstBody = "";
+ this.state = 2;
+ } else {
+ this.procInstBody += "?" + c;
+ this.state = 19;
+ }
+ continue;
+ case 21:
+ charclass$7 = _.nameBody;
+ if (charclass$7.test(c)) {
+ this.tagName += c;
+ } else {
+ this.newTag$();
+ if (c === ">") {
+ this.openTag$B(false);
+ } else {
+ if (c === "/") {
+ this.state = 22;
+ } else {
+ charclass$8 = _.whitespace;
+ if (! $__jsx_ObjectHasOwnProperty.call(charclass$8, c)) {
+ this.strictFail$S("Invalid character in tag name");
+ }
+ this.state = 23;
+ }
+ }
+ }
+ continue;
+ case 22:
+ if (c === ">") {
+ this.openTag$B(true);
+ this.closeTag$();
+ } else {
+ this.strictFail$S("Forward-slash in opening tag not followed by >");
+ this.state = 23;
+ }
+ continue;
+ case 23:
+ charclass$9 = _.whitespace;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$9, c)) {
+ continue;
+ } else {
+ if (c === ">") {
+ this.openTag$B(false);
+ } else {
+ if (c === "/") {
+ this.state = 22;
+ } else {
+ charclass$10 = _.nameStart;
+ if (charclass$10.test(c)) {
+ this.attribName = c;
+ this.attribValue = "";
+ this.state = 24;
+ } else {
+ this.strictFail$S("Invalid attribute name");
+ }
+ }
+ }
+ }
+ continue;
+ case 24:
+ if (c === "=") {
+ this.state = 26;
+ } else {
+ if (c === ">") {
+ this.strictFail$S("Attribute without value");
+ this.attribValue = this.attribName;
+ this.attrib$();
+ this.openTag$B(false);
+ } else {
+ charclass$11 = _.whitespace;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$11, c)) {
+ this.state = 25;
+ } else {
+ charclass$12 = _.nameBody;
+ if (charclass$12.test(c)) {
+ this.attribName += c;
+ } else {
+ this.strictFail$S("Invalid attribute name");
+ }
+ }
+ }
+ }
+ continue;
+ case 25:
+ if (c === "=") {
+ this.state = 26;
+ } else {
+ charclass$13 = _.whitespace;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$13, c)) {
+ continue;
+ } else {
+ this.strictFail$S("Attribute without value");
+ this.tag.attributes[this.attribName] = "";
+ this.attribValue = "";
+ this.closetext_if_exist$();
+ this.attribName = "";
+ if (c === ">") {
+ this.openTag$B(false);
+ } else {
+ charclass$14 = _.nameStart;
+ if (charclass$14.test(c)) {
+ this.attribName = c;
+ this.state = 24;
+ } else {
+ this.strictFail$S("Invalid attribute name");
+ this.state = 23;
+ }
+ }
+ }
+ }
+ continue;
+ case 26:
+ charclass$15 = _.whitespace;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$15, c)) {
+ continue;
+ } else {
+ charclass$16 = _.quote;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$16, c)) {
+ this.q = c;
+ this.state = 27;
+ } else {
+ this.strictFail$S("Unquoted attribute value");
+ this.state = 28;
+ this.attribValue = c;
+ }
+ }
+ continue;
+ case 27:
+ if (c !== this.q) {
+ if (c === "&") {
+ this.state = 29;
+ } else {
+ this.attribValue += c;
+ }
+ continue;
+ }
+ this.attrib$();
+ this.q = "";
+ this.state = 23;
+ continue;
+ case 28:
+ charclass$17 = _.attribEnd;
+ if (! $__jsx_ObjectHasOwnProperty.call(charclass$17, c)) {
+ if (c === "&") {
+ this.state = 30;
+ } else {
+ this.attribValue += c;
+ }
+ continue;
+ }
+ this.attrib$();
+ if (c === ">") {
+ this.openTag$B(false);
+ } else {
+ this.state = 23;
+ }
+ continue;
+ case 31:
+ if (! this.tagName) {
+ charclass$18 = _.whitespace;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$18, c)) {
+ continue;
+ } else {
+ charclass$19 = _.nameStart;
+ if (! charclass$19.test(c)) {
+ if (this.script) {
+ this.script += "</" + c;
+ this.state = 33;
+ } else {
+ this.strictFail$S("Invalid tagname in closing tag.");
+ }
+ } else {
+ this.tagName = c;
+ }
+ }
+ } else {
+ if (c === ">") {
+ this.closeTag$();
+ } else {
+ charclass$20 = _.nameBody;
+ if (charclass$20.test(c)) {
+ this.tagName += c;
+ } else {
+ if (this.script) {
+ this.script += "</" + this.tagName;
+ this.tagName = "";
+ this.state = 33;
+ } else {
+ charclass$21 = _.whitespace;
+ if (! $__jsx_ObjectHasOwnProperty.call(charclass$21, c)) {
+ this.strictFail$S("Invalid tagname in closing tag");
+ }
+ this.state = 32;
+ }
+ }
+ }
+ }
+ continue;
+ case 32:
+ charclass$22 = _.whitespace;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$22, c)) {
+ continue;
+ }
+ if (c === ">") {
+ this.closeTag$();
+ } else {
+ this.strictFail$S("Invalid characters in closing tag");
+ }
+ continue;
+ case 3:
+ if (c === ";") {
+ this.textNode += this.parseEntity$();
+ this.entity = "";
+ this.state = 2;
+ } else {
+ charclass$23 = _.entity;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$23, c)) {
+ this.entity += c;
+ } else {
+ this.strictFail$S("Invalid character entity");
+ this.textNode += "&" + this.entity + c;
+ this.entity = "";
+ this.state = 2;
+ }
+ }
+ continue;
+ case 29:
+ case 30:
+ if (this.state === 29) {
+ returnState = 27;
+ } else {
+ returnState = 28;
+ }
+ if (c === ";") {
+ this.attribValue += this.parseEntity$();
+ this.entity = "";
+ this.state = (returnState | 0);
+ } else {
+ charclass$24 = _.entity;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$24, c)) {
+ this.entity += c;
+ } else {
+ this.strictFail$S("Invalid character entity");
+ this.attribValue += "&" + this.entity + c;
+ this.entity = "";
+ this.state = (returnState | 0);
+ }
+ }
+ continue;
+ default:
+ throw new Error("Unknown state: " + (this.state + ""));
+ }
+ }
+ this.end$();
+ return this;
+};
+
+/**
+ */
+SAXParser.prototype.clearBuffers$ = function () {
+ this.comment = '';
+ this.sgmlDecl = '';
+ this.textNode = '';
+ this.tagName = '';
+ this.doctype = '';
+ this.procInstName = '';
+ this.procInstBody = '';
+ this.entity = '';
+ this.attribName = '';
+ this.attribValue = '';
+ this.cdata = '';
+ this.script = '';
+};
+
+/**
+ */
+SAXParser.prototype.closetext_if_exist$ = function () {
+ if (this.textNode !== '') {
+ this.closetext$();
+ }
+};
+
+/**
+ */
+SAXParser.prototype.closetext$ = function () {
+ /** @type {!string} */
+ var text;
+ /** @type {!string} */
+ var text$0;
+ if (this.preTags === 0) {
+ text$0 = this.textNode;
+ text$0 = text$0.replace(/[\n\t]/g, ' ');
+ text$0 = text$0.replace(/\s\s+/g, " ");
+ text = text$0;
+ if (text$0) {
+ this.handler.ontext$S(text);
+ }
+ } else {
+ if (this.textNode) {
+ this.handler.ontext$S(this.textNode);
+ }
+ }
+ this.textNode = "";
+};
+
+/**
+ * @param {!string} text
+ * @return {!string}
+ */
+SAXParser.prototype.textopts$S = function (text) {
+ text = text.replace(/[\n\t]/g, ' ');
+ text = text.replace(/\s\s+/g, " ");
+ return text;
+};
+
+/**
+ * @param {!string} er
+ * @return {SAXParser}
+ */
+SAXParser.prototype.emiterror$S = function (er) {
+ /** @type {Error} */
+ var error;
+ this.closetext$();
+ er += "\nLine: " + (this.line + "") + "\nColumn: " + (this.column + "") + "\nChar: " + this.c;
+ error = new Error(er);
+ this.error = error;
+ return this;
+};
+
+/**
+ */
+SAXParser.prototype.end$ = function () {
+ if (! this.closedRoot) {
+ this.strictFail$S("Unclosed root tag");
+ }
+ if (this.state !== 2) {
+ this.emiterror$S("Unexpected end");
+ }
+ this.closetext$();
+ this.c = "";
+ this.closed = true;
+};
+
+/**
+ * @param {!string} message
+ */
+SAXParser.prototype.strictFail$S = function (message) {
+ if (this.strict) {
+ this.emiterror$S(message);
+ }
+};
+
+/**
+ */
+SAXParser.prototype.newTag$ = function () {
+ if (! this.strict) {
+ this.tagName = this.tagName.toLowerCase();
+ }
+ this.tag = ({name: this.tagName, attributes: ({ }), isSelfClosing: false});
+ this.attribList.length = 0;
+};
+
+/**
+ */
+SAXParser.prototype.attrib$ = function () {
+ if (! this.strict) {
+ this.attribName = this.attribName.toLowerCase();
+ }
+ if ($__jsx_ObjectHasOwnProperty.call(this.tag.attributes, this.attribName)) {
+ this.attribName = this.attribValue = "";
+ return;
+ }
+ this.tag.attributes[this.attribName] = this.attribValue;
+ this.closetext_if_exist$();
+ this.attribName = this.attribValue = "";
+};
+
+/**
+ */
+SAXParser.prototype.openTag$ = function () {
+ this.openTag$B(false);
+};
+
+/**
+ * @param {!boolean} selfClosing
+ */
+SAXParser.prototype.openTag$B = function (selfClosing) {
+ /** @type {Tag} */
+ var tag$0;
+ /** @type {Tag} */
+ var tag$1;
+ (tag$0 = this.tag).isSelfClosing = selfClosing;
+ this.sawRoot = true;
+ this.tags.push(tag$0);
+ this.closetext_if_exist$();
+ this.handler.onopentag$SHS((tag$1 = this.tag).name, tag$1.attributes);
+ if (this.tag.name === 'pre') {
+ this.preTags++;
+ }
+ if (! selfClosing) {
+ if (! this.noscript && this.tagName.toLowerCase() === "script") {
+ this.state = 33;
+ } else {
+ this.state = 2;
+ }
+ this.tag = null;
+ this.tagName = "";
+ }
+ this.attribName = this.attribValue = "";
+ this.attribList.length = 0;
+};
+
+/**
+ */
+SAXParser.prototype.closeTag$ = function () {
+ /** @type {!number} */
+ var t;
+ /** @type {!string} */
+ var tagName;
+ /** @type {!string} */
+ var closeTo;
+ /** @type {Tag} */
+ var close;
+ /** @type {!number} */
+ var s;
+ /** @type {Tag} */
+ var tag$0;
+ if (! this.tagName) {
+ this.strictFail$S("Weird empty close tag.");
+ this.textNode += "</>";
+ this.state = 2;
+ return;
+ }
+ if (this.script) {
+ if (this.tagName !== "script") {
+ this.script += "</" + this.tagName + ">";
+ this.tagName = "";
+ this.state = 33;
+ return;
+ }
+ this.closetext_if_exist$();
+ this.script = "";
+ }
+ t = this.tags.length;
+ tagName = this.tagName;
+ if (! this.strict) {
+ tagName = tagName.toLowerCase();
+ }
+ closeTo = tagName;
+ while (t--) {
+ close = this.tags[t];
+ if (close.name !== closeTo) {
+ this.strictFail$S("Unexpected close tag");
+ } else {
+ break;
+ }
+ }
+ if (t < 0) {
+ this.strictFail$S("Unmatched closing tag: " + this.tagName);
+ this.textNode += "</" + this.tagName + ">";
+ this.state = 2;
+ return;
+ }
+ this.tagName = tagName;
+ s = this.tags.length;
+ while (s-- > t) {
+ tag$0 = this.tag = this.tags.pop();
+ this.tagName = tag$0.name;
+ this.closetext_if_exist$();
+ this.handler.onclosetag$S(this.tagName);
+ if (this.tagName === 'pre') {
+ this.preTags--;
+ }
+ }
+ if (t === 0) {
+ this.closedRoot = true;
+ }
+ this.tagName = this.attribValue = this.attribName = "";
+ this.attribList.length = 0;
+ this.state = 2;
+};
+
+/**
+ * @return {!string}
+ */
+SAXParser.prototype.parseEntity$ = function () {
+ /** @type {!string} */
+ var entity;
+ /** @type {!string} */
+ var entityLC;
+ /** @type {!number} */
+ var num;
+ /** @type {!string} */
+ var numStr;
+ entity = this.entity;
+ entityLC = entity.toLowerCase();
+ num = 0;
+ numStr = "";
+ if (this.ENTITIES[entity]) {
+ return this.ENTITIES[entity];
+ }
+ if (this.ENTITIES[entityLC]) {
+ return this.ENTITIES[entityLC];
+ }
+ entity = entityLC;
+ if (entityLC.charAt(0) === "#") {
+ if (entity.charAt(1) === "x") {
+ entity = entity.slice(2);
+ num = $__jsx_parseInt(entity, 16);
+ numStr = num.toString(16);
+ } else {
+ entity = entity.slice(1);
+ num = $__jsx_parseInt(entity, 10);
+ numStr = num.toString(10);
+ }
+ }
+ entity = entity.replace(/^0+/, "");
+ if (numStr.toLowerCase() !== entity) {
+ this.strictFail$S("Invalid character entity");
+ return "&" + this.entity + ";";
+ }
+ return String.fromCharCode(num);
+};
+
+/**
+ * class Char extends Object
+ * @constructor
+ */
+function Char() {
+}
+
+/**
+ * @constructor
+ */
+function Char$() {
+ this.CDATA = "[CDATA[";
+ this.DOCTYPE = "DOCTYPE";
+ this.XML_NAMESPACE = "http://www.w3.org/XML/1998/namespace";
+ this.whitespace = this._charClass$S("\r\n\t ");
+ this.number = this._charClass$S("0124356789");
+ this.letter = this._charClass$S("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ");
+ this.quote = this._charClass$S("'\"");
+ this.entity = this._charClass$S("0124356789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ#");
+ this.attribEnd = this._charClass$S("\r\n\t >");
+ this.nameStart = /[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/;
+ this.nameBody = /[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040\.\d-]/;
+};
+
+Char$.prototype = new Char;
+
+/**
+ * @param {!string} str
+ * @return {Object.<string, undefined|!boolean>}
+ */
+Char.prototype._charClass$S = function (str) {
+ /** @type {Object.<string, undefined|!boolean>} */
+ var result;
+ /** @type {!number} */
+ var i;
+ result = ({ });
+ for (i = 0; i < str.length; i++) {
+ result[str.slice(i, i + 1)] = true;
+ }
+ return result;
+};
+
+/**
+ * @param {RegExp} charclass
+ * @param {!string} c
+ * @return {!boolean}
+ */
+Char.prototype.is$LRegExp$S = function (charclass, c) {
+ return charclass.test(c);
+};
+
+/**
+ * @param {Object.<string, undefined|!boolean>} charclass
+ * @param {!string} c
+ * @return {!boolean}
+ */
+Char.prototype.is$HBS = function (charclass, c) {
+ return $__jsx_ObjectHasOwnProperty.call(charclass, c);
+};
+
+/**
+ * @param {RegExp} charclass
+ * @param {!string} c
+ * @return {!boolean}
+ */
+Char.prototype.not$LRegExp$S = function (charclass, c) {
+ return ! charclass.test(c);
+};
+
+/**
+ * @param {Object.<string, undefined|!boolean>} charclass
+ * @param {!string} c
+ * @return {!boolean}
+ */
+Char.prototype.not$HBS = function (charclass, c) {
+ return ! $__jsx_ObjectHasOwnProperty.call(charclass, c);
+};
+
+/**
+ * class _Entities extends Object
+ * @constructor
+ */
+function _Entities() {
+}
+
+/**
+ * @constructor
+ */
+function _Entities$() {
+};
+
+_Entities$.prototype = new _Entities;
+
+/**
+ * @return {Object.<string, undefined|!string>}
+ */
+_Entities.entity_list$ = function () {
+ /** @type {Object.<string, undefined|!string>} */
+ var result;
+ /** @type {!string} */
+ var key;
+ /** @type {*} */
+ var value;
+ result = ({ });
+ for (key in _Entities._entities) {
+ value = _Entities._entities[key];
+ if (typeof value === 'string') {
+ result[key] = value + "";
+ } else {
+ if (typeof value === 'number') {
+ result[key] = String.fromCharCode(value | 0);
+ }
+ }
+ }
+ return result;
+};
+
+var _Entities$entity_list$ = _Entities.entity_list$;
+
+/**
+ * class BitVector extends Object
+ * @constructor
+ */
+function BitVector() {
+}
+
+/**
+ * @constructor
+ */
+function BitVector$() {
+ /** @type {Array.<undefined|!number>} */
+ var _v$0;
+ /** @type {Array.<undefined|!number>} */
+ var _r$0;
+ _r$0 = this._r = [ ];
+ _v$0 = this._v = [ ];
+ _v$0.length = 0;
+ _r$0.length = 0;
+ this._size = 0;
+ this._size1 = 0;
+};
+
+BitVector$.prototype = new BitVector;
+
+/**
+ */
+BitVector.prototype.build$ = function () {
+ /** @type {!number} */
+ var i;
+ this._size1 = 0;
+ for (i = 0; i < this._v.length; i++) {
+ if (i % 8 === 0) {
+ this._r.push(true ? this._size1 : this._size - this._size1);
+ }
+ this._size1 += this._rank32$IIB(this._v[i], 32, true);
+ }
+};
+
+/**
+ */
+BitVector.prototype.clear$ = function () {
+ this._v.length = 0;
+ this._r.length = 0;
+ this._size = 0;
+ this._size1 = 0;
+};
+
+/**
+ * @return {!number}
+ */
+BitVector.prototype.size$ = function () {
+ return this._size;
+};
+
+/**
+ * @param {!boolean} b
+ * @return {!number}
+ */
+BitVector.prototype.size$B = function (b) {
+ return (b ? this._size1 : this._size - this._size1);
+};
+
+/**
+ * @param {!number} value
+ */
+BitVector.prototype.set$I = function (value) {
+ this.set$IB(value, true);
+};
+
+/**
+ * @param {!number} value
+ * @param {!boolean} flag
+ */
+BitVector.prototype.set$IB = function (value, flag) {
+ /** @type {!number} */
+ var q;
+ /** @type {!number} */
+ var r;
+ /** @type {!number} */
+ var m;
+ if (value >= this._size) {
+ this._size = (value + 1 | 0);
+ }
+ q = (value / 32 | 0);
+ r = (value % 32 | 0);
+ while (q >= this._v.length) {
+ this._v.push(0);
+ }
+ m = 0x1 << r;
+ if (flag) {
+ this._v[q] |= m;
+ } else {
+ this._v[q] &= ~ m;
+ }
+};
+
+/**
+ * @param {!number} value
+ * @return {!boolean}
+ */
+BitVector.prototype.get$I = function (value) {
+ /** @type {!number} */
+ var q;
+ /** @type {!number} */
+ var r;
+ /** @type {!number} */
+ var m;
+ if (value >= this._size) {
+ throw new Error("BitVector.get() : range error");
+ }
+ q = (value / 32 | 0);
+ r = (value % 32 | 0);
+ m = 0x1 << r;
+ return !! (this._v[q] & m);
+};
+
+/**
+ * @param {!number} i
+ * @return {!number}
+ */
+BitVector.prototype.rank$I = function (i) {
+ return this.rank$IB(i, true);
+};
+
+/**
+ * @param {!number} i
+ * @param {!boolean} b
+ * @return {!number}
+ */
+BitVector.prototype.rank$IB = function (i, b) {
+ /** @type {!number} */
+ var q_large;
+ /** @type {!number} */
+ var q_small;
+ /** @type {!number} */
+ var r;
+ /** @type {!number} */
+ var rank;
+ /** @type {!number} */
+ var begin;
+ /** @type {!number} */
+ var j;
+ if (i > this._size) {
+ throw new Error("BitVector.rank() : range error");
+ }
+ if (i === 0) {
+ return 0;
+ }
+ i--;
+ q_large = (Math.floor(i / 256) | 0);
+ q_small = (Math.floor(i / 32) | 0);
+ r = (Math.floor(i % 32) | 0);
+ rank = (this._r[q_large] | 0);
+ if (! b) {
+ rank = q_large * 256 - rank;
+ }
+ begin = q_large * 8;
+ for (j = begin; j < q_small; j++) {
+ rank += this._rank32$IIB(this._v[j], 32, b);
+ }
+ rank += this._rank32$IIB(this._v[q_small], r + 1, b);
+ return rank;
+};
+
+/**
+ * @param {!number} i
+ * @return {!number}
+ */
+BitVector.prototype.select$I = function (i) {
+ return this.select$IB(i, true);
+};
+
+/**
+ * @param {!number} i
+ * @param {!boolean} b
+ * @return {!number}
+ */
+BitVector.prototype.select$IB = function (i, b) {
+ /** @type {!number} */
+ var left;
+ /** @type {!number} */
+ var right;
+ /** @type {!number} */
+ var pivot;
+ /** @type {undefined|!number} */
+ var rank;
+ /** @type {!number} */
+ var j;
+ if (i >= (b ? this._size1 : this._size - this._size1)) {
+ throw new Error("BitVector.select() : range error");
+ }
+ left = 0;
+ right = this._r.length;
+ while (left < right) {
+ pivot = Math.floor((left + right) / 2);
+ rank = this._r[pivot];
+ if (! b) {
+ rank = pivot * 256 - rank;
+ }
+ if (i < rank) {
+ right = pivot;
+ } else {
+ left = pivot + 1;
+ }
+ }
+ right--;
+ if (b) {
+ i -= (this._r[right] | 0);
+ } else {
+ i -= (right * 256 - this._r[right] | 0);
+ }
+ j = right * 8;
+ while (1) {
+ rank = this._rank32$IIB(this._v[j], 32, b);
+ if (i < rank) {
+ break;
+ }
+ j++;
+ i -= (rank | 0);
+ }
+ return (j * 32 + this._select32$IIB(this._v[j], i, b) | 0);
+};
+
+/**
+ * @param {!number} x
+ * @param {!number} i
+ * @param {!boolean} b
+ * @return {!number}
+ */
+BitVector.prototype._rank32$IIB = function (x, i, b) {
+ if (! b) {
+ x = ~ x;
+ }
+ x <<= 32 - i;
+ x = ((x & 0xaaaaaaaa) >>> 1) + (x & 0x55555555);
+ x = ((x & 0xcccccccc) >>> 2) + (x & 0x33333333);
+ x = ((x & 0xf0f0f0f0) >>> 4) + (x & 0x0f0f0f0f);
+ x = ((x & 0xff00ff00) >>> 8) + (x & 0x00ff00ff);
+ x = ((x & 0xffff0000) >>> 16) + (x & 0x0000ffff);
+ return x;
+};
+
+/**
+ * @param {!number} x
+ * @param {!number} i
+ * @param {!boolean} b
+ * @return {!number}
+ */
+BitVector.prototype._select32$IIB = function (x, i, b) {
+ /** @type {!number} */
+ var x1;
+ /** @type {!number} */
+ var x2;
+ /** @type {!number} */
+ var x3;
+ /** @type {!number} */
+ var x4;
+ /** @type {!number} */
+ var x5;
+ /** @type {!number} */
+ var pos;
+ /** @type {!number} */
+ var v5;
+ /** @type {!number} */
+ var v4;
+ /** @type {!number} */
+ var v3;
+ /** @type {!number} */
+ var v2;
+ /** @type {!number} */
+ var v1;
+ /** @type {!number} */
+ var v0;
+ if (! b) {
+ x = ~ x;
+ }
+ x1 = ((x & 0xaaaaaaaa) >>> 1) + (x & 0x55555555);
+ x2 = ((x1 & 0xcccccccc) >>> 2) + (x1 & 0x33333333);
+ x3 = ((x2 & 0xf0f0f0f0) >>> 4) + (x2 & 0x0f0f0f0f);
+ x4 = ((x3 & 0xff00ff00) >>> 8) + (x3 & 0x00ff00ff);
+ x5 = ((x4 & 0xffff0000) >>> 16) + (x4 & 0x0000ffff);
+ i++;
+ pos = 0;
+ v5 = x5 & 0xffffffff;
+ if (i > v5) {
+ i -= (v5 | 0);
+ pos += 32;
+ }
+ v4 = x4 >>> pos & 0x0000ffff;
+ if (i > v4) {
+ i -= (v4 | 0);
+ pos += 16;
+ }
+ v3 = x3 >>> pos & 0x000000ff;
+ if (i > v3) {
+ i -= (v3 | 0);
+ pos += 8;
+ }
+ v2 = x2 >>> pos & 0x0000000f;
+ if (i > v2) {
+ i -= (v2 | 0);
+ pos += 4;
+ }
+ v1 = x1 >>> pos & 0x00000003;
+ if (i > v1) {
+ i -= (v1 | 0);
+ pos += 2;
+ }
+ v0 = x >>> pos & 0x00000001;
+ if (i > v0) {
+ i -= (v0 | 0);
+ pos += 1;
+ }
+ return (pos | 0);
+};
+
+/**
+ * @return {!string}
+ */
+BitVector.prototype.dump$ = function () {
+ /** @type {Array.<undefined|!string>} */
+ var contents;
+ contents = [ ];
+ contents.push(Binary$dump32bitNumber$N(this._size));
+ contents.push(Binary$dump32bitNumberList$AN(this._v));
+ return contents.join('');
+};
+
+/**
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+BitVector.prototype.dump$LCompressionReport$ = function (report) {
+ /** @type {Array.<undefined|!string>} */
+ var contents;
+ contents = [ ];
+ contents.push(Binary$dump32bitNumber$N(this._size));
+ CompressionReport$add$LCompressionReport$II(report, 2, 2);
+ contents.push(Binary$dump32bitNumberList$ANLCompressionReport$(this._v, report));
+ return contents.join('');
+};
+
+/**
+ * @param {!string} data
+ * @return {!number}
+ */
+BitVector.prototype.load$S = function (data) {
+ return this.load$SI(data, 0);
+};
+
+/**
+ * @param {!string} data
+ * @param {!number} offset
+ * @return {!number}
+ */
+BitVector.prototype.load$SI = function (data, offset) {
+ /** @type {LoadedNumberListResult} */
+ var result;
+ /** @type {!number} */
+ var result$0;
+ this._v.length = 0;
+ this._r.length = 0;
+ this._size = 0;
+ this._size1 = 0;
+ result$0 = data.charCodeAt(offset) * 65536 + data.charCodeAt(offset + 1);
+ this._size = (result$0 | 0);
+ result = Binary$load32bitNumberList$SI(data, offset + 2);
+ this._v = result.result;
+ this.build$();
+ return result.offset;
+};
+
+/**
+ * class WaveletMatrix extends Object
+ * @constructor
+ */
+function WaveletMatrix() {
+}
+
+/**
+ * @constructor
+ */
+function WaveletMatrix$() {
+ /** @type {Array.<undefined|BitVector>} */
+ var _bv$0;
+ /** @type {Array.<undefined|!number>} */
+ var _seps$0;
+ this._range = ({ });
+ _bv$0 = this._bv = [ ];
+ _seps$0 = this._seps = [ ];
+ this._bitsize = 16;
+ _bv$0.length = 0;
+ _seps$0.length = 0;
+ this._size = 0;
+};
+
+WaveletMatrix$.prototype = new WaveletMatrix;
+
+/**
+ * @return {!number}
+ */
+WaveletMatrix.prototype.bitsize$ = function () {
+ return this._bitsize;
+};
+
+/**
+ * @param {!number} charCode
+ */
+WaveletMatrix.prototype.setMaxCharCode$I = function (charCode) {
+ this._bitsize = (Math.ceil(Math.log(charCode) / 0.6931471805599453) | 0);
+};
+
+/**
+ */
+WaveletMatrix.prototype.clear$ = function () {
+ this._bv.length = 0;
+ this._seps.length = 0;
+ this._size = 0;
+};
+
+/**
+ * @param {!string} v
+ */
+WaveletMatrix.prototype.build$S = function (v) {
+ /** @type {!number} */
+ var size;
+ /** @type {!number} */
+ var bitsize;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var depth;
+ /** @type {Object.<string, undefined|!number>} */
+ var range_tmp;
+ /** @type {!number} */
+ var code;
+ /** @type {!boolean} */
+ var bit;
+ /** @type {!number} */
+ var key;
+ /** @type {Object.<string, undefined|!number>} */
+ var range_rev;
+ /** @type {!string} */
+ var range_key;
+ /** @type {!number} */
+ var value;
+ /** @type {!number} */
+ var pos0;
+ /** @type {undefined|!number} */
+ var pos1;
+ /** @type {!string} */
+ var range_rev_key;
+ /** @type {!number} */
+ var begin;
+ /** @type {undefined|!number} */
+ var end;
+ /** @type {!number} */
+ var num0;
+ /** @type {!number} */
+ var num1;
+ this._bv.length = 0;
+ this._seps.length = 0;
+ this._size = 0;
+ size = v.length;
+ bitsize = this._bitsize;
+ for (i = 0; i < bitsize; i++) {
+ this._bv.push(new BitVector$());
+ this._seps.push(0);
+ }
+ this._size = (size | 0);
+ for (i = 0; i < size; i++) {
+ this._bv[0].set$IB(i, this._uint2bit$II(v.charCodeAt(i), 0));
+ }
+ this._bv[0].build$();
+ this._seps[0] = this._bv[0].size$B(false);
+ this._range["0"] = 0;
+ this._range["1"] = this._seps[0];
+ depth = 1;
+ while (depth < bitsize) {
+ range_tmp = WaveletMatrix$_shallow_copy$HI(this._range);
+ for (i = 0; i < size; i++) {
+ code = v.charCodeAt(i);
+ bit = this._uint2bit$II(code, depth);
+ key = code >>> bitsize - depth;
+ this._bv[depth].set$IB(range_tmp[key + ""], bit);
+ range_tmp[key + ""]++;
+ }
+ this._bv[depth].build$();
+ this._seps[depth] = this._bv[depth].size$B(false);
+ range_rev = ({ });
+ for (range_key in this._range) {
+ value = this._range[range_key];
+ if (value != range_tmp[range_key]) {
+ range_rev[value + ""] = range_key | 0;
+ }
+ }
+ this._range = ({ });
+ pos0 = 0;
+ pos1 = this._seps[depth];
+ for (range_rev_key in range_rev) {
+ begin = range_rev_key | 0;
+ value = range_rev[range_rev_key];
+ end = range_tmp[value + ""];
+ num0 = this._bv[depth].rank$IB(end, false) - this._bv[depth].rank$IB(begin, false);
+ num1 = end - begin - num0;
+ if (num0 > 0) {
+ this._range[(value << 1) + ""] = (pos0 | 0);
+ pos0 += num0;
+ }
+ if (num1 > 0) {
+ this._range[(value << 1) + 1 + ""] = pos1;
+ pos1 += (num1 | 0);
+ }
+ }
+ depth++;
+ }
+};
+
+/**
+ * @return {!number}
+ */
+WaveletMatrix.prototype.size$ = function () {
+ return this._size;
+};
+
+/**
+ * @param {!number} c
+ * @return {!number}
+ */
+WaveletMatrix.prototype.size$I = function (c) {
+ return this.rank$II(this._size, c);
+};
+
+/**
+ * @param {!number} i
+ * @return {!number}
+ */
+WaveletMatrix.prototype.get$I = function (i) {
+ /** @type {!number} */
+ var value;
+ /** @type {!number} */
+ var depth;
+ /** @type {!boolean} */
+ var bit;
+ if (i >= this._size) {
+ throw new Error("WaveletMatrix.get() : range error");
+ }
+ value = 0;
+ depth = 0;
+ while (depth < this._bitsize) {
+ bit = this._bv[depth].get$I(i);
+ i = this._bv[depth].rank$IB(i, bit);
+ value <<= 1;
+ if (bit) {
+ i += this._seps[depth];
+ value += 1;
+ }
+ depth++;
+ }
+ return (value | 0);
+};
+
+/**
+ * @param {!number} i
+ * @param {!number} c
+ * @return {!number}
+ */
+WaveletMatrix.prototype.rank$II = function (i, c) {
+ /** @type {undefined|!number} */
+ var begin;
+ /** @type {!number} */
+ var end;
+ /** @type {!number} */
+ var depth;
+ /** @type {!boolean} */
+ var bit;
+ if (i > this._size) {
+ throw new Error("WaveletMatrix.rank(): range error");
+ }
+ if (i === 0) {
+ return 0;
+ }
+ begin = this._range[c + ""];
+ if (begin == null) {
+ return 0;
+ }
+ end = i;
+ depth = 0;
+ while (depth < this._bitsize) {
+ bit = this._uint2bit$II(c, depth);
+ end = this._bv[depth].rank$IB(end, bit);
+ if (bit) {
+ end += this._seps[depth];
+ }
+ depth++;
+ }
+ return (end - begin | 0);
+};
+
+/**
+ * @param {!number} i
+ * @param {!number} c
+ * @return {!number}
+ */
+WaveletMatrix.prototype.rank_less_than$II = function (i, c) {
+ /** @type {!number} */
+ var begin;
+ /** @type {!number} */
+ var end;
+ /** @type {!number} */
+ var depth;
+ /** @type {!number} */
+ var rlt;
+ /** @type {!number} */
+ var rank0_begin;
+ /** @type {!number} */
+ var rank0_end;
+ /** @type {Array.<undefined|!number>} */
+ var _seps$0;
+ if (i > this._size) {
+ throw new Error("WaveletMatrix.rank_less_than(): range error");
+ }
+ if (i === 0) {
+ return 0;
+ }
+ begin = 0;
+ end = i;
+ depth = 0;
+ rlt = 0;
+ while (depth < this._bitsize) {
+ rank0_begin = this._bv[depth].rank$IB(begin, false);
+ rank0_end = this._bv[depth].rank$IB(end, false);
+ if (this._uint2bit$II(c, depth)) {
+ rlt += rank0_end - rank0_begin;
+ begin += (_seps$0 = this._seps)[depth] - rank0_begin;
+ end += _seps$0[depth] - rank0_end;
+ } else {
+ begin = rank0_begin;
+ end = rank0_end;
+ }
+ depth++;
+ }
+ return (rlt | 0);
+};
+
+/**
+ * @return {!string}
+ */
+WaveletMatrix.prototype.dump$ = function () {
+ /** @type {Array.<undefined|!string>} */
+ var contents;
+ /** @type {!number} */
+ var i;
+ /** @type {Array.<undefined|!string>} */
+ var range_contents;
+ /** @type {!number} */
+ var counter;
+ /** @type {!string} */
+ var key;
+ contents = [ Binary$dump16bitNumber$I(this._bitsize), Binary$dump32bitNumber$N(this._size) ];
+ for (i = 0; i < this._bitsize; i++) {
+ contents.push(this._bv[i].dump$());
+ }
+ for (i = 0; i < this._bitsize; i++) {
+ contents.push(Binary$dump32bitNumber$N(this._seps[i]));
+ }
+ range_contents = [ ];
+ counter = 0;
+ for (key in this._range) {
+ range_contents.push(Binary$dump32bitNumber$N(key | 0));
+ range_contents.push(Binary$dump32bitNumber$N(this._range[key]));
+ counter++;
+ }
+ contents.push(Binary$dump32bitNumber$N(counter));
+ return contents.join('') + range_contents.join('');
+};
+
+/**
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+WaveletMatrix.prototype.dump$LCompressionReport$ = function (report) {
+ /** @type {Array.<undefined|!string>} */
+ var contents;
+ /** @type {!number} */
+ var i;
+ /** @type {Array.<undefined|!string>} */
+ var range_contents;
+ /** @type {!number} */
+ var counter;
+ /** @type {!string} */
+ var key;
+ contents = [ Binary$dump16bitNumber$I(this._bitsize), Binary$dump32bitNumber$N(this._size) ];
+ CompressionReport$add$LCompressionReport$II(report, 3, 3);
+ for (i = 0; i < this._bitsize; i++) {
+ contents.push(this._bv[i].dump$LCompressionReport$(report));
+ }
+ for (i = 0; i < this._bitsize; i++) {
+ contents.push(Binary$dump32bitNumber$N(this._seps[i]));
+ CompressionReport$add$LCompressionReport$II(report, 2, 2);
+ }
+ range_contents = [ ];
+ counter = 0;
+ for (key in this._range) {
+ range_contents.push(Binary$dump32bitNumber$N(key | 0));
+ range_contents.push(Binary$dump32bitNumber$N(this._range[key]));
+ CompressionReport$add$LCompressionReport$II(report, 4, 4);
+ counter++;
+ }
+ CompressionReport$add$LCompressionReport$II(report, 2, 2);
+ contents.push(Binary$dump32bitNumber$N(counter));
+ return contents.join('') + range_contents.join('');
+};
+
+/**
+ * @param {!string} data
+ * @return {!number}
+ */
+WaveletMatrix.prototype.load$S = function (data) {
+ return this.load$SI(data, 0);
+};
+
+/**
+ * @param {!string} data
+ * @param {!number} offset
+ * @return {!number}
+ */
+WaveletMatrix.prototype.load$SI = function (data, offset) {
+ /** @type {!number} */
+ var i;
+ /** @type {BitVector} */
+ var bit_vector;
+ /** @type {!number} */
+ var range_size;
+ /** @type {!number} */
+ var value;
+ /** @type {!number} */
+ var offset$0;
+ /** @type {!number} */
+ var result$0;
+ /** @type {!number} */
+ var result$1;
+ /** @type {!number} */
+ var result$2;
+ this._bv.length = 0;
+ this._seps.length = 0;
+ this._size = 0;
+ offset$0 = offset++;
+ this._bitsize = (data.charCodeAt(offset$0) | 0);
+ result$0 = data.charCodeAt(offset) * 65536 + data.charCodeAt(offset + 1);
+ this._size = (result$0 | 0);
+ offset += 2;
+ for (i = 0; i < this._bitsize; i++) {
+ bit_vector = new BitVector$();
+ offset = bit_vector.load$SI(data, offset);
+ this._bv.push(bit_vector);
+ }
+ for (i = 0; i < this._bitsize; (i++, offset += 2)) {
+ this._seps.push(Binary$load32bitNumber$SI(data, offset));
+ }
+ result$1 = data.charCodeAt(offset) * 65536 + data.charCodeAt(offset + 1);
+ range_size = result$1;
+ offset += 2;
+ for (i = 0; i < range_size; (i++, offset += 4)) {
+ result$2 = data.charCodeAt(offset) * 65536 + data.charCodeAt(offset + 1);
+ value = Binary$load32bitNumber$SI(data, offset + 2);
+ this._range[result$2 + ""] = (value | 0);
+ }
+ return offset;
+};
+
+/**
+ * @param {Object.<string, undefined|!number>} input
+ * @return {Object.<string, undefined|!number>}
+ */
+WaveletMatrix._shallow_copy$HI = function (input) {
+ /** @type {Object.<string, undefined|!number>} */
+ var result;
+ /** @type {!string} */
+ var key;
+ result = ({ });
+ for (key in input) {
+ result[key] = input[key];
+ }
+ return result;
+};
+
+var WaveletMatrix$_shallow_copy$HI = WaveletMatrix._shallow_copy$HI;
+
+/**
+ * @param {!number} c
+ * @param {!number} i
+ * @return {!boolean}
+ */
+WaveletMatrix.prototype._uint2bit$II = function (c, i) {
+ return (c >>> this._bitsize - 1 - i & 0x1) === 0x1;
+};
+
+/**
+ * class BurrowsWheelerTransform extends Object
+ * @constructor
+ */
+function BurrowsWheelerTransform() {
+}
+
+/**
+ * @constructor
+ */
+function BurrowsWheelerTransform$() {
+ this._str = "";
+ this._size = 0;
+ this._head = 0;
+ this._suffixarray = [ ];
+};
+
+BurrowsWheelerTransform$.prototype = new BurrowsWheelerTransform;
+
+/**
+ * @param {BurrowsWheelerTransform} $this
+ * @return {!number}
+ */
+BurrowsWheelerTransform.size$LBurrowsWheelerTransform$ = function ($this) {
+ return $this._size;
+};
+
+var BurrowsWheelerTransform$size$LBurrowsWheelerTransform$ = BurrowsWheelerTransform.size$LBurrowsWheelerTransform$;
+
+/**
+ * @param {BurrowsWheelerTransform} $this
+ * @return {!number}
+ */
+BurrowsWheelerTransform.head$LBurrowsWheelerTransform$ = function ($this) {
+ return $this._head;
+};
+
+var BurrowsWheelerTransform$head$LBurrowsWheelerTransform$ = BurrowsWheelerTransform.head$LBurrowsWheelerTransform$;
+
+/**
+ * @param {BurrowsWheelerTransform} $this
+ */
+BurrowsWheelerTransform.clear$LBurrowsWheelerTransform$ = function ($this) {
+ $this._str = "";
+ $this._size = 0;
+ $this._head = 0;
+ $this._suffixarray.length = 0;
+};
+
+var BurrowsWheelerTransform$clear$LBurrowsWheelerTransform$ = BurrowsWheelerTransform.clear$LBurrowsWheelerTransform$;
+
+/**
+ * @param {BurrowsWheelerTransform} $this
+ * @param {!string} str
+ */
+BurrowsWheelerTransform.build$LBurrowsWheelerTransform$S = function ($this, str) {
+ /** @type {!string} */
+ var _str$0;
+ /** @type {Array.<undefined|!number>} */
+ var _suffixarray$0;
+ _str$0 = $this._str = str;
+ $this._size = _str$0.length;
+ _suffixarray$0 = $this._suffixarray = SAIS$make$S(str);
+ $this._head = (_suffixarray$0.indexOf(0) | 0);
+};
+
+var BurrowsWheelerTransform$build$LBurrowsWheelerTransform$S = BurrowsWheelerTransform.build$LBurrowsWheelerTransform$S;
+
+/**
+ * @param {BurrowsWheelerTransform} $this
+ * @param {!number} i
+ * @return {!string}
+ */
+BurrowsWheelerTransform.get$LBurrowsWheelerTransform$I = function ($this, i) {
+ /** @type {!number} */
+ var size;
+ /** @type {!number} */
+ var index;
+ size = $this._size;
+ if (i >= size) {
+ throw new Error("BurrowsWheelerTransform.get() : range error");
+ }
+ index = ($this._suffixarray[i] + size - 1) % size;
+ return $this._str.charAt(index);
+};
+
+var BurrowsWheelerTransform$get$LBurrowsWheelerTransform$I = BurrowsWheelerTransform.get$LBurrowsWheelerTransform$I;
+
+/**
+ * @param {BurrowsWheelerTransform} $this
+ * @return {!string}
+ */
+BurrowsWheelerTransform.get$LBurrowsWheelerTransform$ = function ($this) {
+ /** @type {Array.<undefined|!string>} */
+ var str;
+ /** @type {!number} */
+ var size;
+ /** @type {!number} */
+ var i;
+ str = [ ];
+ size = $this._size;
+ for (i = 0; i < size; i++) {
+ str.push(BurrowsWheelerTransform$get$LBurrowsWheelerTransform$I($this, i));
+ }
+ return str.join("");
+};
+
+var BurrowsWheelerTransform$get$LBurrowsWheelerTransform$ = BurrowsWheelerTransform.get$LBurrowsWheelerTransform$;
+
+/**
+ * @param {BurrowsWheelerTransform} $this
+ * @param {!string} replace
+ * @return {!string}
+ */
+BurrowsWheelerTransform.get$LBurrowsWheelerTransform$S = function ($this, replace) {
+ /** @type {!string} */
+ var result;
+ result = BurrowsWheelerTransform$get$LBurrowsWheelerTransform$($this);
+ return result.replace(BurrowsWheelerTransform.END_MARKER, replace);
+};
+
+var BurrowsWheelerTransform$get$LBurrowsWheelerTransform$S = BurrowsWheelerTransform.get$LBurrowsWheelerTransform$S;
+
+/**
+ * class OArray extends Object
+ * @constructor
+ */
+function OArray() {
+}
+
+/**
+ * @constructor
+ * @param {Array.<undefined|!number>} array
+ */
+function OArray$AI(array) {
+ this.array = array;
+ this.offset = 0;
+};
+
+OArray$AI.prototype = new OArray;
+
+/**
+ * @constructor
+ * @param {Array.<undefined|!number>} array
+ * @param {!number} offset
+ */
+function OArray$AII(array, offset) {
+ this.array = array;
+ this.offset = offset;
+};
+
+OArray$AII.prototype = new OArray;
+
+/**
+ * @param {OArray} $this
+ * @param {!number} index
+ * @return {!number}
+ */
+OArray.get$LOArray$I = function ($this, index) {
+ return $this.array[index + $this.offset];
+};
+
+var OArray$get$LOArray$I = OArray.get$LOArray$I;
+
+/**
+ * @param {OArray} $this
+ * @param {!number} index
+ * @param {!number} value
+ */
+OArray.set$LOArray$II = function ($this, index, value) {
+ $this.array[index + $this.offset] = value;
+};
+
+var OArray$set$LOArray$II = OArray.set$LOArray$II;
+
+/**
+ * @param {OArray} $this
+ * @param {!number} index
+ * @return {!boolean}
+ */
+OArray.isS$LOArray$I = function ($this, index) {
+ /** @type {Array.<undefined|!number>} */
+ var array$0;
+ /** @type {!number} */
+ var offset$0;
+ return (array$0 = $this.array)[index + (offset$0 = $this.offset)] < array$0[index + offset$0 + 1];
+};
+
+var OArray$isS$LOArray$I = OArray.isS$LOArray$I;
+
+/**
+ * @param {OArray} $this
+ * @param {!number} index1
+ * @param {!number} index2
+ * @return {!boolean}
+ */
+OArray.compare$LOArray$II = function ($this, index1, index2) {
+ /** @type {Array.<undefined|!number>} */
+ var array$0;
+ /** @type {!number} */
+ var offset$0;
+ return (array$0 = $this.array)[index1 + (offset$0 = $this.offset)] == array$0[index2 + offset$0];
+};
+
+var OArray$compare$LOArray$II = OArray.compare$LOArray$II;
+
+/**
+ * class SAIS extends Object
+ * @constructor
+ */
+function SAIS() {
+}
+
+/**
+ * @constructor
+ */
+function SAIS$() {
+};
+
+SAIS$.prototype = new SAIS;
+
+/**
+ * @param {BitVector} t
+ * @param {!number} i
+ * @return {!boolean}
+ */
+SAIS._isLMS$LBitVector$I = function (t, i) {
+ return i > 0 && t.get$I(i) && ! t.get$I(i - 1);
+};
+
+var SAIS$_isLMS$LBitVector$I = SAIS._isLMS$LBitVector$I;
+
+/**
+ * @param {OArray} s
+ * @param {Array.<undefined|!number>} bkt
+ * @param {!number} n
+ * @param {!number} K
+ * @param {!boolean} end
+ */
+SAIS._getBuckets$LOArray$AIIIB = function (s, bkt, n, K, end) {
+ /** @type {!number} */
+ var sum;
+ /** @type {!number} */
+ var i;
+ sum = 0;
+ for (i = 0; i <= K; i++) {
+ bkt[i] = 0;
+ }
+ for (i = 0; i < n; i++) {
+ bkt[OArray$get$LOArray$I(s, i)]++;
+ }
+ for (i = 0; i <= K; i++) {
+ sum += bkt[i];
+ bkt[i] = ((end ? sum : sum - bkt[i]) | 0);
+ }
+};
+
+var SAIS$_getBuckets$LOArray$AIIIB = SAIS._getBuckets$LOArray$AIIIB;
+
+/**
+ * @param {BitVector} t
+ * @param {Array.<undefined|!number>} SA
+ * @param {OArray} s
+ * @param {Array.<undefined|!number>} bkt
+ * @param {!number} n
+ * @param {!number} K
+ * @param {!boolean} end
+ */
+SAIS._induceSAl$LBitVector$AILOArray$AIIIB = function (t, SA, s, bkt, n, K, end) {
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var j;
+ SAIS$_getBuckets$LOArray$AIIIB(s, bkt, n, K, end);
+ for (i = 0; i < n; i++) {
+ j = SA[i] - 1;
+ if (j >= 0 && ! t.get$I(j)) {
+ SA[bkt[OArray$get$LOArray$I(s, j)]++] = (j | 0);
+ }
+ }
+};
+
+var SAIS$_induceSAl$LBitVector$AILOArray$AIIIB = SAIS._induceSAl$LBitVector$AILOArray$AIIIB;
+
+/**
+ * @param {BitVector} t
+ * @param {Array.<undefined|!number>} SA
+ * @param {OArray} s
+ * @param {Array.<undefined|!number>} bkt
+ * @param {!number} n
+ * @param {!number} K
+ * @param {!boolean} end
+ */
+SAIS._induceSAs$LBitVector$AILOArray$AIIIB = function (t, SA, s, bkt, n, K, end) {
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var j;
+ SAIS$_getBuckets$LOArray$AIIIB(s, bkt, n, K, end);
+ for (i = n - 1; i >= 0; i--) {
+ j = SA[i] - 1;
+ if (j >= 0 && t.get$I(j)) {
+ SA[-- bkt[OArray$get$LOArray$I(s, j)]] = (j | 0);
+ }
+ }
+};
+
+var SAIS$_induceSAs$LBitVector$AILOArray$AIIIB = SAIS._induceSAs$LBitVector$AILOArray$AIIIB;
+
+/**
+ * @param {!string} source
+ * @return {Array.<undefined|!number>}
+ */
+SAIS.make$S = function (source) {
+ /** @type {Array.<undefined|!number>} */
+ var charCodes;
+ /** @type {!number} */
+ var maxCode;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var code;
+ /** @type {Array.<undefined|!number>} */
+ var SA;
+ /** @type {OArray} */
+ var s;
+ charCodes = [ ];
+ charCodes.length = source.length;
+ maxCode = 0;
+ for (i = 0; i < source.length; i++) {
+ code = source.charCodeAt(i);
+ charCodes[i] = (code | 0);
+ maxCode = (code > maxCode ? code : maxCode);
+ }
+ SA = [ ];
+ SA.length = source.length;
+ s = ({offset: 0, array: charCodes});
+ SAIS$_make$LOArray$AIII(s, SA, source.length, maxCode);
+ return SA;
+};
+
+var SAIS$make$S = SAIS.make$S;
+
+/**
+ * @param {OArray} s
+ * @param {Array.<undefined|!number>} SA
+ * @param {!number} n
+ * @param {!number} K
+ */
+SAIS._make$LOArray$AIII = function (s, SA, n, K) {
+ /** @type {BitVector} */
+ var t;
+ /** @type {!number} */
+ var i;
+ /** @type {Array.<undefined|!number>} */
+ var bkt;
+ /** @type {!number} */
+ var n1;
+ /** @type {!number} */
+ var name;
+ /** @type {!number} */
+ var prev;
+ /** @type {undefined|!number} */
+ var pos;
+ /** @type {!boolean} */
+ var diff;
+ /** @type {!number} */
+ var d;
+ /** @type {!number} */
+ var j;
+ /** @type {Array.<undefined|!number>} */
+ var SA1;
+ /** @type {OArray} */
+ var s1;
+ /** @type {!number} */
+ var i$0;
+ /** @type {!number} */
+ var index$0;
+ t = new BitVector$();
+ t.set$IB(n - 2, false);
+ t.set$IB(n - 1, true);
+ for (i = n - 3; i >= 0; i--) {
+ t.set$IB(i, OArray$isS$LOArray$I(s, i) || OArray$compare$LOArray$II(s, i, i + 1) && t.get$I(i + 1));
+ }
+ bkt = [ ];
+ bkt.length = K + 1;
+ SAIS$_getBuckets$LOArray$AIIIB(s, bkt, n, K, true);
+ for (i = 0; i < n; i++) {
+ SA[i] = -1;
+ }
+ for (i = 1; i < n; i++) {
+ if (SAIS$_isLMS$LBitVector$I(t, i)) {
+ SA[-- bkt[OArray$get$LOArray$I(s, i)]] = (i | 0);
+ }
+ }
+ SAIS$_induceSAl$LBitVector$AILOArray$AIIIB(t, SA, s, bkt, n, K, false);
+ SAIS$_induceSAs$LBitVector$AILOArray$AIIIB(t, SA, s, bkt, n, K, true);
+ n1 = 0;
+ for (i = 0; i < n; i++) {
+ i$0 = SA[i];
+ if (i$0 > 0 && t.get$I(i$0) && ! t.get$I(i$0 - 1)) {
+ SA[n1++] = SA[i];
+ }
+ }
+ for (i = n1; i < n; i++) {
+ SA[i] = -1;
+ }
+ name = 0;
+ prev = -1;
+ for (i = 0; i < n1; i++) {
+ pos = SA[i];
+ diff = false;
+ for (d = 0; d < n; d++) {
+ if (prev === -1 || ! OArray$compare$LOArray$II(s, pos + d, prev + d) || t.get$I(pos + d) !== t.get$I(prev + d)) {
+ diff = true;
+ break;
+ } else {
+ if (d > 0 && (SAIS$_isLMS$LBitVector$I(t, pos + d) || SAIS$_isLMS$LBitVector$I(t, prev + d))) {
+ break;
+ }
+ }
+ }
+ if (diff) {
+ name++;
+ prev = pos;
+ }
+ pos = ((pos % 2 === 0 ? pos / 2 : (pos - 1) / 2) | 0);
+ SA[n1 + pos] = (name - 1 | 0);
+ }
+ for ((i = n - 1, j = n - 1); i >= n1; i--) {
+ if (SA[i] >= 0) {
+ SA[j--] = SA[i];
+ }
+ }
+ SA1 = SA;
+ s1 = ({offset: n - n1, array: SA});
+ if (name < n1) {
+ SAIS$_make$LOArray$AIII(s1, SA1, n1, name - 1);
+ } else {
+ for (i = 0; i < n1; i++) {
+ SA1[OArray$get$LOArray$I(s1, i)] = (i | 0);
+ }
+ }
+ bkt = [ ];
+ bkt.length = K + 1;
+ SAIS$_getBuckets$LOArray$AIIIB(s, bkt, n, K, true);
+ for ((i = 1, j = 0); i < n; i++) {
+ if (SAIS$_isLMS$LBitVector$I(t, i)) {
+ OArray$set$LOArray$II(s1, j++, i);
+ }
+ }
+ for (i = 0; i < n1; i++) {
+ index$0 = SA1[i];
+ SA1[i] = s1.array[index$0 + s1.offset];
+ }
+ for (i = n1; i < n; i++) {
+ SA[i] = -1;
+ }
+ for (i = n1 - 1; i >= 0; i--) {
+ j = SA[i];
+ SA[i] = -1;
+ SA[-- bkt[OArray$get$LOArray$I(s, j)]] = (j | 0);
+ }
+ SAIS$_induceSAl$LBitVector$AILOArray$AIIIB(t, SA, s, bkt, n, K, false);
+ SAIS$_induceSAs$LBitVector$AILOArray$AIIIB(t, SA, s, bkt, n, K, true);
+};
+
+var SAIS$_make$LOArray$AIII = SAIS._make$LOArray$AIII;
+
+OktaviaSearch._stemmer = null;
+OktaviaSearch._instance = null;
+$__jsx_lazy_init(Oktavia, "eof", function () {
+ return String.fromCharCode(0);
+});
+$__jsx_lazy_init(Oktavia, "eob", function () {
+ return String.fromCharCode(1);
+});
+$__jsx_lazy_init(Oktavia, "unknown", function () {
+ return String.fromCharCode(3);
+});
+Binary._base64EncodeChars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
+$__jsx_lazy_init(Binary, "_base64DecodeChars", function () {
+ return [ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 62, -1, -1, -1, 63, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, -1, -1, -1, -1, -1, -1, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -1, -1, -1, -1, -1, -1, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, -1, -1, -1, -1 ];
+});
+$__jsx_lazy_init(Style, "console", function () {
+ return ({ 'title': [ '\x1B[32m\x1b[4m', '\x1B[39m\x1b[0m' ], 'url': [ '\x1B[34m', '\x1B[39m' ], 'hit': [ '\x1B[4m', '\x1B[0m' ], 'del': [ '\x1B[9m', '\x1B[0m' ], 'summary': [ '\x1B[90m', '\x1B[39m' ] });
+});
+$__jsx_lazy_init(Style, "html", function () {
+ return ({ 'title': [ '<span class="title">', '</span>' ], 'url': [ '<span class="url">', '</span>' ], 'hit': [ '<span class="hit">', '</span>' ], 'del': [ '<del>', '</del>' ], 'summary': [ '<span class="reuslt">', '</span>' ] });
+});
+$__jsx_lazy_init(Style, "ignore", function () {
+ return ({ 'tilte': [ '', '' ], 'url': [ '', '' ], 'hit': [ '', '' ], 'del': [ '', '' ], 'summary': [ '', '' ] });
+});
+GermanStemmer.serialVersionUID = 1;
+$__jsx_lazy_init(GermanStemmer, "methodObject", function () {
+ return new GermanStemmer$();
+});
+$__jsx_lazy_init(GermanStemmer, "a_0", function () {
+ return [ new Among$SII("", -1, 6), new Among$SII("U", 0, 2), new Among$SII("Y", 0, 1), new Among$SII("\u00E4", 0, 3), new Among$SII("\u00F6", 0, 4), new Among$SII("\u00FC", 0, 5) ];
+});
+$__jsx_lazy_init(GermanStemmer, "a_1", function () {
+ return [ new Among$SII("e", -1, 2), new Among$SII("em", -1, 1), new Among$SII("en", -1, 2), new Among$SII("ern", -1, 1), new Among$SII("er", -1, 1), new Among$SII("s", -1, 3), new Among$SII("es", 5, 2) ];
+});
+$__jsx_lazy_init(GermanStemmer, "a_2", function () {
+ return [ new Among$SII("en", -1, 1), new Among$SII("er", -1, 1), new Among$SII("st", -1, 2), new Among$SII("est", 2, 1) ];
+});
+$__jsx_lazy_init(GermanStemmer, "a_3", function () {
+ return [ new Among$SII("ig", -1, 1), new Among$SII("lich", -1, 1) ];
+});
+$__jsx_lazy_init(GermanStemmer, "a_4", function () {
+ return [ new Among$SII("end", -1, 1), new Among$SII("ig", -1, 2), new Among$SII("ung", -1, 1), new Among$SII("lich", -1, 3), new Among$SII("isch", -1, 2), new Among$SII("ik", -1, 2), new Among$SII("heit", -1, 3), new Among$SII("keit", -1, 4) ];
+});
+$__jsx_lazy_init(GermanStemmer, "g_v", function () {
+ return [ 17, 65, 16, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 32, 8 ];
+});
+$__jsx_lazy_init(GermanStemmer, "g_s_ending", function () {
+ return [ 117, 30, 5 ];
+});
+$__jsx_lazy_init(GermanStemmer, "g_st_ending", function () {
+ return [ 117, 30, 4 ];
+});
+$__jsx_lazy_init(_Common, "buffers", function () {
+ return [ "comment", "sgmlDecl", "textNode", "tagName", "doctype", "procInstName", "procInstBody", "entity", "attribName", "attribValue", "cdata", "script" ];
+});
+$__jsx_lazy_init(_Common, "EVENTS", function () {
+ return [ "text", "processinginstruction", "sgmldeclaration", "doctype", "comment", "attribute", "opentag", "closetag", "opencdata", "cdata", "clo_State.CDATA", "error", "end", "ready", "script", "opennamespace", "closenamespace" ];
+});
+_Common.MAX_BUFFER_LENGTH = 65536;
+_State.BEGIN = 1;
+_State.TEXT = 2;
+_State.TEXT_ENTITY = 3;
+_State.OPEN_WAKA = 4;
+_State.SGML_DECL = 5;
+_State.SGML_DECL_QUOTED = 6;
+_State.DOCTYPE = 7;
+_State.DOCTYPE_QUOTED = 8;
+_State.DOCTYPE_DTD = 9;
+_State.DOCTYPE_DTD_QUOTED = 10;
+_State.COMMENT_STARTING = 11;
+_State.COMMENT = 12;
+_State.COMMENT_ENDING = 13;
+_State.COMMENT_ENDED = 14;
+_State.CDATA = 15;
+_State.CDATA_ENDING = 16;
+_State.CDATA_ENDING_2 = 17;
+_State.PROC_INST = 18;
+_State.PROC_INST_BODY = 19;
+_State.PROC_INST_ENDING = 20;
+_State.OPEN_TAG = 21;
+_State.OPEN_TAG_SLASH = 22;
+_State.ATTRIB = 23;
+_State.ATTRIB_NAME = 24;
+_State.ATTRIB_NAME_SAW_WHITE = 25;
+_State.ATTRIB_VALUE = 26;
+_State.ATTRIB_VALUE_QUOTED = 27;
+_State.ATTRIB_VALUE_UNQUOTED = 28;
+_State.ATTRIB_VALUE_ENTITY_Q = 29;
+_State.ATTRIB_VALUE_ENTITY_U = 30;
+_State.CLOSE_TAG = 31;
+_State.CLOSE_TAG_SAW_WHITE = 32;
+_State.SCRIPT = 33;
+_State.SCRIPT_ENDING = 34;
+$__jsx_lazy_init(_Entities, "_entities", function () {
+ return ({ "amp": "&", "gt": ">", "lt": "<", "quot": "\"", "apos": "'", "AElig": 198, "Aacute": 193, "Acirc": 194, "Agrave": 192, "Aring": 197, "Atilde": 195, "Auml": 196, "Ccedil": 199, "ETH": 208, "Eacute": 201, "Ecirc": 202, "Egrave": 200, "Euml": 203, "Iacute": 205, "Icirc": 206, "Igrave": 204, "Iuml": 207, "Ntilde": 209, "Oacute": 211, "Ocirc": 212, "Ograve": 210, "Oslash": 216, "Otilde": 213, "Ouml": 214, "THORN": 222, "Uacute": 218, "Ucirc": 219, "Ugrave": 217, "Uuml": 220, "Yacute": 221, "aacute": 225, "acirc": 226, "aelig": 230, "agrave": 224, "aring": 229, "atilde": 227, "auml": 228, "ccedil": 231, "eacute": 233, "ecirc": 234, "egrave": 232, "eth": 240, "euml": 235, "iacute": 237, "icirc": 238, "igrave": 236, "iuml": 239, "ntilde": 241, "oacute": 243, "ocirc": 244, "ograve": 242, "oslash": 248, "otilde": 245, "ouml": 246, "szlig": 223, "thorn": 254, "uacute": 250, "ucirc": 251, "ugrave": 249, "uuml": 252, "yacute": 253, "yuml": 255, "copy": 169, "reg": 174, "nbsp": 160, "iexcl": 161, "cent": 162, "pound": 163, "curren": 164, "yen": 165, "brvbar": 166, "sect": 167, "uml": 168, "ordf": 170, "laquo": 171, "not": 172, "shy": 173, "macr": 175, "deg": 176, "plusmn": 177, "sup1": 185, "sup2": 178, "sup3": 179, "acute": 180, "micro": 181, "para": 182, "middot": 183, "cedil": 184, "ordm": 186, "raquo": 187, "frac14": 188, "frac12": 189, "frac34": 190, "iquest": 191, "times": 215, "divide": 247, "OElig": 338, "oelig": 339, "Scaron": 352, "scaron": 353, "Yuml": 376, "fnof": 402, "circ": 710, "tilde": 732, "Alpha": 913, "Beta": 914, "Gamma": 915, "Delta": 916, "Epsilon": 917, "Zeta": 918, "Eta": 919, "Theta": 920, "Iota": 921, "Kappa": 922, "Lambda": 923, "Mu": 924, "Nu": 925, "Xi": 926, "Omicron": 927, "Pi": 928, "Rho": 929, "Sigma": 931, "Tau": 932, "Upsilon": 933, "Phi": 934, "Chi": 935, "Psi": 936, "Omega": 937, "alpha": 945, "beta": 946, "gamma": 947, "delta": 948, "epsilon": 949, "zeta": 950, "eta": 951, "theta": 952, "iota": 953, "kappa": 954, "lambda": 955, "mu": 956, "nu": 957, "xi": 958, "omicron": 959, "pi": 960, "rho": 961, "sigmaf": 962, "sigma": 963, "tau": 964, "upsilon": 965, "phi": 966, "chi": 967, "psi": 968, "omega": 969, "thetasym": 977, "upsih": 978, "piv": 982, "ensp": 8194, "emsp": 8195, "thinsp": 8201, "zwnj": 8204, "zwj": 8205, "lrm": 8206, "rlm": 8207, "ndash": 8211, "mdash": 8212, "lsquo": 8216, "rsquo": 8217, "sbquo": 8218, "ldquo": 8220, "rdquo": 8221, "bdquo": 8222, "dagger": 8224, "Dagger": 8225, "bull": 8226, "hellip": 8230, "permil": 8240, "prime": 8242, "Prime": 8243, "lsaquo": 8249, "rsaquo": 8250, "oline": 8254, "frasl": 8260, "euro": 8364, "image": 8465, "weierp": 8472, "real": 8476, "trade": 8482, "alefsym": 8501, "larr": 8592, "uarr": 8593, "rarr": 8594, "darr": 8595, "harr": 8596, "crarr": 8629, "lArr": 8656, "uArr": 8657, "rArr": 8658, "dArr": 8659, "hArr": 8660, "forall": 8704, "part": 8706, "exist": 8707, "empty": 8709, "nabla": 8711, "isin": 8712, "notin": 8713, "ni": 8715, "prod": 8719, "sum": 8721, "minus": 8722, "lowast": 8727, "radic": 8730, "prop": 8733, "infin": 8734, "ang": 8736, "and": 8743, "or": 8744, "cap": 8745, "cup": 8746, "int": 8747, "there4": 8756, "sim": 8764, "cong": 8773, "asymp": 8776, "ne": 8800, "equiv": 8801, "le": 8804, "ge": 8805, "sub": 8834, "sup": 8835, "nsub": 8836, "sube": 8838, "supe": 8839, "oplus": 8853, "otimes": 8855, "perp": 8869, "sdot": 8901, "lceil": 8968, "rceil": 8969, "lfloor": 8970, "rfloor": 8971, "lang": 9001, "rang": 9002, "loz": 9674, "spades": 9824, "clubs": 9827, "hearts": 9829, "diams": 9830 });
+});
+BitVector.SMALL_BLOCK_SIZE = 32;
+BitVector.LARGE_BLOCK_SIZE = 256;
+BitVector.BLOCK_RATE = 8;
+$__jsx_lazy_init(BurrowsWheelerTransform, "END_MARKER", function () {
+ return String.fromCharCode(0);
+});
+var $__jsx_classMap = {
+ "tool/web/oktavia-german-search.jsx": {
+ _Main: _Main,
+ _Main$: _Main$
+ },
+ "tool/web/oktavia-search.jsx": {
+ _Result: _Result,
+ _Result$SSSI: _Result$SSSI,
+ _Proposal: _Proposal,
+ _Proposal$SSI: _Proposal$SSI,
+ OktaviaSearch: OktaviaSearch,
+ OktaviaSearch$I: OktaviaSearch$I,
+ _Main: _Main$0,
+ _Main$: _Main$0$
+ },
+ "src/oktavia.jsx": {
+ Oktavia: Oktavia,
+ Oktavia$: Oktavia$
+ },
+ "src/binary-util.jsx": {
+ Binary: Binary,
+ Binary$: Binary$,
+ LoadedStringResult: LoadedStringResult,
+ LoadedStringResult$SI: LoadedStringResult$SI,
+ LoadedStringListResult: LoadedStringListResult,
+ LoadedStringListResult$SI: LoadedStringListResult$SI,
+ LoadedStringListMapResult: LoadedStringListMapResult,
+ LoadedStringListMapResult$SI: LoadedStringListMapResult$SI,
+ LoadedNumberListResult: LoadedNumberListResult,
+ LoadedNumberListResult$SI: LoadedNumberListResult$SI,
+ CompressionReport: CompressionReport,
+ CompressionReport$: CompressionReport$
+ },
+ "src/query.jsx": {
+ Query: Query,
+ Query$: Query$
+ },
+ "src/query-string-parser.jsx": {
+ QueryStringParser: QueryStringParser,
+ QueryStringParser$: QueryStringParser$
+ },
+ "src/search-result.jsx": {
+ Proposal: Proposal,
+ Proposal$II: Proposal$II,
+ Position: Position,
+ Position$SIB: Position$SIB,
+ SearchUnit: SearchUnit,
+ SearchUnit$I: SearchUnit$I,
+ SingleResult: SingleResult,
+ SingleResult$: SingleResult$,
+ SingleResult$SBB: SingleResult$SBB,
+ SearchSummary: SearchSummary,
+ SearchSummary$: SearchSummary$,
+ SearchSummary$LOktavia$: SearchSummary$LOktavia$
+ },
+ "src/style.jsx": {
+ Style: Style,
+ Style$S: Style$S,
+ _HTMLHandler: _HTMLHandler,
+ _HTMLHandler$HASB: _HTMLHandler$HASB
+ },
+ "src/stemmer/stemmer.jsx": {
+ Stemmer: Stemmer,
+ Stemmer$: Stemmer$
+ },
+ "src/stemmer/base-stemmer.jsx": {
+ BaseStemmer: BaseStemmer,
+ BaseStemmer$: BaseStemmer$
+ },
+ "src/stemmer/german-stemmer.jsx": {
+ GermanStemmer: GermanStemmer,
+ GermanStemmer$: GermanStemmer$
+ },
+ "src/stemmer/among.jsx": {
+ Among: Among,
+ Among$SII: Among$SII,
+ Among$SIIF$LBaseStemmer$B$LBaseStemmer$: Among$SIIF$LBaseStemmer$B$LBaseStemmer$
+ },
+ "src/metadata.jsx": {
+ Metadata: Metadata,
+ Metadata$LOktavia$: Metadata$LOktavia$,
+ Section: Section,
+ Section$LOktavia$: Section$LOktavia$,
+ Splitter: Splitter,
+ Splitter$LOktavia$: Splitter$LOktavia$,
+ Splitter$LOktavia$S: Splitter$LOktavia$S,
+ Table: Table,
+ Table$LOktavia$AS: Table$LOktavia$AS,
+ Block: Block,
+ Block$LOktavia$: Block$LOktavia$
+ },
+ "src/fm-index.jsx": {
+ FMIndex: FMIndex,
+ FMIndex$: FMIndex$
+ },
+ "src/sax.jsx": {
+ Tag: Tag,
+ Tag$S: Tag$S,
+ _Common: _Common,
+ _Common$: _Common$,
+ _State: _State,
+ _State$: _State$,
+ SAXHandler: SAXHandler,
+ SAXHandler$: SAXHandler$,
+ SAXParser: SAXParser,
+ SAXParser$LSAXHandler$: SAXParser$LSAXHandler$,
+ SAXParser$LSAXHandler$B: SAXParser$LSAXHandler$B,
+ Char: Char,
+ Char$: Char$,
+ _Entities: _Entities,
+ _Entities$: _Entities$
+ },
+ "src/bit-vector.jsx": {
+ BitVector: BitVector,
+ BitVector$: BitVector$
+ },
+ "src/wavelet-matrix.jsx": {
+ WaveletMatrix: WaveletMatrix,
+ WaveletMatrix$: WaveletMatrix$
+ },
+ "src/burrows-wheeler-transform.jsx": {
+ BurrowsWheelerTransform: BurrowsWheelerTransform,
+ BurrowsWheelerTransform$: BurrowsWheelerTransform$
+ },
+ "src/sais.jsx": {
+ OArray: OArray,
+ OArray$AI: OArray$AI,
+ OArray$AII: OArray$AII,
+ SAIS: SAIS,
+ SAIS$: SAIS$
+ }
+};
+
+
+/**
+ * launches _Main.main(:string[]):void invoked by jsx --run|--executable
+ */
+JSX.runMain = function (sourceFile, args) {
+ var module = JSX.require(sourceFile);
+ if (! module) {
+ throw new ReferenceError("entry point module not found in " + sourceFile);
+ }
+ if (! module._Main) {
+ throw new ReferenceError("entry point _Main not found in " + sourceFile);
+ }
+ if (! module._Main.main$AS) {
+ throw new ReferenceError("entry point _Main.main(:string[]):void not found in " + sourceFile);
+ }
+ module._Main.main$AS(args);
+};
+
+/**
+ * launches _Test#test*():void invoked by jsx --test
+ */
+JSX.runTests = function (sourceFile, tests) {
+ var module = JSX.require(sourceFile);
+ var testClass = module._Test$;
+
+ if (!testClass) return; // skip if there's no test class
+
+ if(tests.length === 0) {
+ var p = testClass.prototype;
+ for (var m in p) {
+ if (p[m] instanceof Function
+ && /^test.*[$]$/.test(m)) {
+ tests.push(m);
+ }
+ }
+ }
+ else { // set as process arguments
+ tests = tests.map(function (name) {
+ return name + "$"; // mangle for function test*():void
+ });
+ }
+
+ var testCase = new testClass();
+
+ if (testCase.beforeClass$AS != null)
+ testCase.beforeClass$AS(tests);
+
+ for (var i = 0; i < tests.length; ++i) {
+ (function (method) {
+ if (method in testCase) {
+ testCase.run$SF$V$(method, function() { testCase[method](); });
+ }
+ else {
+ throw new ReferenceError("No such test method: " + method);
+ }
+ }(tests[i]));
+ }
+
+ if (testCase.afterClass$ != null)
+ testCase.afterClass$();
+};
+/**
+ * call a function on load/DOMContentLoaded
+ */
+function $__jsx_onload (event) {
+ window.removeEventListener("load", $__jsx_onload);
+ document.removeEventListener("DOMContentLoaded", $__jsx_onload);
+ JSX.runMain("tool/web/oktavia-german-search.jsx", [])
+}
+
+window.addEventListener("load", $__jsx_onload);
+document.addEventListener("DOMContentLoaded", $__jsx_onload);
+
+})(JSX);
diff --git a/web/server/h2o/libh2o/misc/oktavia/lib/oktavia-hungarian-search.js b/web/server/h2o/libh2o/misc/oktavia/lib/oktavia-hungarian-search.js
new file mode 100644
index 00000000..8fe69650
--- /dev/null
+++ b/web/server/h2o/libh2o/misc/oktavia/lib/oktavia-hungarian-search.js
@@ -0,0 +1,8599 @@
+// generatedy by JSX compiler 0.9.24 (2013-04-05 13:45:00 +0900; 1b229cc6a411f674f0f7cf7a79b7a8b3f8eb7414)
+var JSX = {};
+(function (JSX) {
+/**
+ * copies the implementations from source interface to target
+ */
+function $__jsx_merge_interface(target, source) {
+ for (var k in source.prototype)
+ if (source.prototype.hasOwnProperty(k))
+ target.prototype[k] = source.prototype[k];
+}
+
+/**
+ * defers the initialization of the property
+ */
+function $__jsx_lazy_init(obj, prop, func) {
+ function reset(obj, prop, value) {
+ delete obj[prop];
+ obj[prop] = value;
+ return value;
+ }
+
+ Object.defineProperty(obj, prop, {
+ get: function () {
+ return reset(obj, prop, func());
+ },
+ set: function (v) {
+ reset(obj, prop, v);
+ },
+ enumerable: true,
+ configurable: true
+ });
+}
+
+/**
+ * sideeffect().a /= b
+ */
+function $__jsx_div_assign(obj, prop, divisor) {
+ return obj[prop] = (obj[prop] / divisor) | 0;
+}
+
+/*
+ * global functions, renamed to avoid conflict with local variable names
+ */
+var $__jsx_parseInt = parseInt;
+var $__jsx_parseFloat = parseFloat;
+var $__jsx_isNaN = isNaN;
+var $__jsx_isFinite = isFinite;
+
+var $__jsx_encodeURIComponent = encodeURIComponent;
+var $__jsx_decodeURIComponent = decodeURIComponent;
+var $__jsx_encodeURI = encodeURI;
+var $__jsx_decodeURI = decodeURI;
+
+var $__jsx_ObjectToString = Object.prototype.toString;
+var $__jsx_ObjectHasOwnProperty = Object.prototype.hasOwnProperty;
+
+/*
+ * profiler object, initialized afterwards
+ */
+function $__jsx_profiler() {
+}
+
+/*
+ * public interface to JSX code
+ */
+JSX.require = function (path) {
+ var m = $__jsx_classMap[path];
+ return m !== undefined ? m : null;
+};
+
+JSX.profilerIsRunning = function () {
+ return $__jsx_profiler.getResults != null;
+};
+
+JSX.getProfileResults = function () {
+ return ($__jsx_profiler.getResults || function () { return {}; })();
+};
+
+JSX.postProfileResults = function (url, cb) {
+ if ($__jsx_profiler.postResults == null)
+ throw new Error("profiler has not been turned on");
+ return $__jsx_profiler.postResults(url, cb);
+};
+
+JSX.resetProfileResults = function () {
+ if ($__jsx_profiler.resetResults == null)
+ throw new Error("profiler has not been turned on");
+ return $__jsx_profiler.resetResults();
+};
+JSX.DEBUG = false;
+/**
+ * class _Main extends Object
+ * @constructor
+ */
+function _Main() {
+}
+
+/**
+ * @constructor
+ */
+function _Main$() {
+};
+
+_Main$.prototype = new _Main;
+
+/**
+ * @param {Array.<undefined|!string>} args
+ */
+_Main.main$AS = function (args) {
+ OktaviaSearch$setStemmer$LStemmer$(new HungarianStemmer$());
+};
+
+var _Main$main$AS = _Main.main$AS;
+
+/**
+ * class _Result extends Object
+ * @constructor
+ */
+function _Result() {
+}
+
+/**
+ * @constructor
+ * @param {!string} title
+ * @param {!string} url
+ * @param {!string} content
+ * @param {!number} score
+ */
+function _Result$SSSI(title, url, content, score) {
+ this.title = title;
+ this.url = url;
+ this.content = content;
+ this.score = score;
+};
+
+_Result$SSSI.prototype = new _Result;
+
+/**
+ * class _Proposal extends Object
+ * @constructor
+ */
+function _Proposal() {
+}
+
+/**
+ * @constructor
+ * @param {!string} options
+ * @param {!string} label
+ * @param {!number} count
+ */
+function _Proposal$SSI(options, label, count) {
+ this.options = options;
+ this.label = label;
+ this.count = count;
+};
+
+_Proposal$SSI.prototype = new _Proposal;
+
+/**
+ * class OktaviaSearch extends Object
+ * @constructor
+ */
+function OktaviaSearch() {
+}
+
+/**
+ * @constructor
+ * @param {!number} entriesPerPage
+ */
+function OktaviaSearch$I(entriesPerPage) {
+ this._queries = null;
+ this._highlight = "";
+ this._result = null;
+ this._proposals = null;
+ this._currentFolderDepth = 0;
+ this._oktavia = new Oktavia$();
+ this._entriesPerPage = entriesPerPage;
+ this._currentPage = 1;
+ this._queryString = null;
+ this._callback = null;
+ OktaviaSearch._instance = this;
+};
+
+OktaviaSearch$I.prototype = new OktaviaSearch;
+
+/**
+ * @param {Stemmer} stemmer
+ */
+OktaviaSearch.setStemmer$LStemmer$ = function (stemmer) {
+ /** @type {Oktavia} */
+ var this$0;
+ if (OktaviaSearch._instance) {
+ this$0 = OktaviaSearch._instance._oktavia;
+ this$0._stemmer = stemmer;
+ } else {
+ OktaviaSearch._stemmer = stemmer;
+ }
+};
+
+var OktaviaSearch$setStemmer$LStemmer$ = OktaviaSearch.setStemmer$LStemmer$;
+
+/**
+ * @param {!string} index
+ */
+OktaviaSearch.prototype.loadIndex$S = function (index) {
+ /** @type {Oktavia} */
+ var this$0;
+ /** @type {Stemmer} */
+ var stemmer$0;
+ if (OktaviaSearch._stemmer) {
+ this$0 = this._oktavia;
+ stemmer$0 = OktaviaSearch._stemmer;
+ this$0._stemmer = stemmer$0;
+ }
+ this._oktavia.load$S(Binary$base64decode$S(index));
+ if (this._queryString) {
+ this.search$SF$IIV$(this._queryString, this._callback);
+ this._queryString = null;
+ this._callback = null;
+ }
+};
+
+/**
+ * @param {!string} queryString
+ * @param {*} callback
+ */
+OktaviaSearch.prototype.search$SF$IIV$ = function (queryString, callback) {
+ /** @type {QueryStringParser} */
+ var queryParser;
+ /** @type {SearchSummary} */
+ var summary;
+ /** @type {Array.<undefined|SearchUnit>} */
+ var _result$0;
+ if (this._oktavia) {
+ queryParser = ({queries: [ ]});
+ this._queries = QueryStringParser$parse$LQueryStringParser$S(queryParser, queryString);
+ this._highlight = QueryStringParser$highlight$LQueryStringParser$(queryParser);
+ summary = this._oktavia.search$ALQuery$(this._queries);
+ if (SearchSummary$size$LSearchSummary$(summary) > 0) {
+ this._result = this._sortResult$LSearchSummary$(summary);
+ this._proposals = [ ];
+ this._currentPage = 1;
+ } else {
+ this._result = [ ];
+ if (this._queries.length > 1) {
+ this._proposals = SearchSummary$getProposal$LSearchSummary$(summary);
+ } else {
+ this._proposals = [ ];
+ }
+ this._currentPage = 1;
+ }
+ callback((_result$0 = this._result).length, Math.ceil(_result$0.length / this._entriesPerPage));
+ } else {
+ this._queryString = queryString;
+ this._callback = callback;
+ }
+};
+
+/**
+ * @return {!number}
+ */
+OktaviaSearch.prototype.resultSize$ = function () {
+ return (this._result.length | 0);
+};
+
+/**
+ * @return {!number}
+ */
+OktaviaSearch.prototype.totalPages$ = function () {
+ return (Math.ceil(this._result.length / this._entriesPerPage) | 0);
+};
+
+/**
+ * @return {!number}
+ */
+OktaviaSearch.prototype.currentPage$ = function () {
+ return this._currentPage;
+};
+
+/**
+ * @param {!number} page
+ */
+OktaviaSearch.prototype.setCurrentPage$I = function (page) {
+ this._currentPage = page;
+};
+
+/**
+ * @return {!boolean}
+ */
+OktaviaSearch.prototype.hasPrevPage$ = function () {
+ return this._currentPage !== 1;
+};
+
+/**
+ * @return {!boolean}
+ */
+OktaviaSearch.prototype.hasNextPage$ = function () {
+ return this._currentPage !== Math.ceil(this._result.length / this._entriesPerPage);
+};
+
+/**
+ * @return {Array.<undefined|!string>}
+ */
+OktaviaSearch.prototype.pageIndexes$ = function () {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var total;
+ /** @type {!number} */
+ var i;
+ result = [ ];
+ total = Math.ceil(this._result.length / this._entriesPerPage);
+ if (total < 10) {
+ for (i = 1; i <= total; i++) {
+ result.push(i + "");
+ }
+ } else {
+ if (this._currentPage <= 5) {
+ for (i = 1; i <= 7; i++) {
+ result.push(i + "");
+ }
+ result.push('...', total + "");
+ } else {
+ if (total - 5 <= this._currentPage) {
+ result.push('1', '...');
+ for (i = total - 8; i <= total; i++) {
+ result.push(i + "");
+ }
+ } else {
+ result.push('1', '...');
+ for (i = this._currentPage - 3; i <= this._currentPage + 3; i++) {
+ result.push(i + "");
+ }
+ result.push('...', total + "");
+ }
+ }
+ }
+ return result;
+};
+
+/**
+ * @return {Array.<undefined|_Result>}
+ */
+OktaviaSearch.prototype.getResult$ = function () {
+ /** @type {Style} */
+ var style;
+ /** @type {!number} */
+ var start;
+ /** @type {!number} */
+ var last;
+ /** @type {Metadata} */
+ var metadata;
+ /** @type {!number} */
+ var num;
+ /** @type {Array.<undefined|_Result>} */
+ var results;
+ /** @type {!number} */
+ var i;
+ /** @type {SearchUnit} */
+ var unit;
+ /** @type {Array.<undefined|!string>} */
+ var info;
+ /** @type {!string} */
+ var content;
+ /** @type {Array.<undefined|Position>} */
+ var positions;
+ /** @type {!number} */
+ var end;
+ /** @type {!boolean} */
+ var split;
+ /** @type {!number} */
+ var j;
+ /** @type {Position} */
+ var pos;
+ /** @type {!string} */
+ var text;
+ /** @type {Oktavia} */
+ var this$0;
+ /** @type {!number} */
+ var position$0;
+ /** @type {!number} */
+ var _currentPage$0;
+ /** @type {!number} */
+ var _entriesPerPage$0;
+ style = new Style$S('html');
+ start = ((_currentPage$0 = this._currentPage) - 1) * (_entriesPerPage$0 = this._entriesPerPage);
+ last = Math.min(_currentPage$0 * _entriesPerPage$0, this._result.length);
+ this$0 = this._oktavia;
+ metadata = this$0._metadatas[this$0._metadataLabels[0]];
+ num = 250;
+ results = [ ];
+ for (i = start; i < last; i++) {
+ unit = this._result[i];
+ info = metadata.getInformation$I(unit.id).split(Oktavia.eob);
+ content = metadata.getContent$I(unit.id);
+ start = 0;
+ positions = SearchUnit$getPositions$LSearchUnit$(unit);
+ if (content.indexOf(info[0]) === 1) {
+ content = content.slice(info[0].length + 2, content.length);
+ start += info[0].length + 2;
+ }
+ end = start + num;
+ split = false;
+ if (positions[0].position > end - positions[0].word.length) {
+ end = positions[0].position + Math.floor(num / 2);
+ split = true;
+ }
+ for (j = positions.length - 1; j > -1; j--) {
+ pos = positions[j];
+ if (pos.position + pos.word.length < end) {
+ content = [ content.slice(0, pos.position - start), style.convert$S('<hit>*</hit>').replace('*', content.slice((position$0 = pos.position) - start, position$0 + pos.word.length - start)), content.slice(pos.position + pos.word.length - start, content.length) ].join('');
+ }
+ }
+ if (split) {
+ text = [ content.slice(0, Math.floor(num / 2)) + ' ...', content.slice(- Math.floor(num / 2), end - start) ].join('<br/>');
+ } else {
+ text = content.slice(0, end - start) + ' ...<br/>';
+ }
+ text = text.replace(Oktavia.eob, ' ').replace(/(<br\/>)(<br\/>)+/, '<br/><br/>');
+ results.push(({title: info[0], url: info[1], content: text, score: unit.score}));
+ }
+ return results;
+};
+
+/**
+ * @return {!string}
+ */
+OktaviaSearch.prototype.getHighlight$ = function () {
+ return this._highlight;
+};
+
+/**
+ * @return {Array.<undefined|_Proposal>}
+ */
+OktaviaSearch.prototype.getProposals$ = function () {
+ /** @type {Style} */
+ var style;
+ /** @type {Array.<undefined|_Proposal>} */
+ var results;
+ /** @type {!number} */
+ var i;
+ /** @type {Proposal} */
+ var proposal;
+ /** @type {Array.<undefined|!string>} */
+ var label;
+ /** @type {Array.<undefined|!string>} */
+ var option;
+ /** @type {!number} */
+ var j;
+ style = new Style$S('html');
+ results = [ ];
+ if (this._queries.length > 1) {
+ for (i = 0; i < this._proposals.length; i++) {
+ proposal = this._proposals[i];
+ if (proposal.expect > 0) {
+ label = [ ];
+ option = [ ];
+ for (j = 0; j < this._queries.length; j++) {
+ if (j !== proposal.omit) {
+ label.push(style.convert$S('<hit>' + this._queries[j].toString() + '</hit>'));
+ option.push(this._queries[j].toString());
+ } else {
+ label.push(style.convert$S('<del>' + this._queries[j].toString() + '</del>'));
+ }
+ }
+ results.push(({options: option.join(' '), label: label.join('&nbsp;'), count: proposal.expect}));
+ }
+ }
+ }
+ return results;
+};
+
+/**
+ * @param {SearchSummary} summary
+ * @return {Array.<undefined|SearchUnit>}
+ */
+OktaviaSearch.prototype._sortResult$LSearchSummary$ = function (summary) {
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var score;
+ /** @type {SearchUnit} */
+ var unit;
+ /** @type {!string} */
+ var pos;
+ /** @type {Position} */
+ var position;
+ for (i = 0; i < summary.result.units.length; i++) {
+ score = 0;
+ unit = summary.result.units[i];
+ for (pos in unit.positions) {
+ position = unit.positions[pos];
+ if (this._oktavia.wordPositionType$I(position.position)) {
+ score += 10;
+ } else {
+ score += 1;
+ }
+ if (! position.stemmed) {
+ score += 2;
+ }
+ }
+ unit.score = (score | 0);
+ }
+ return SearchSummary$getSortedResult$LSearchSummary$(summary);
+};
+
+/**
+ * class _Main$0 extends Object
+ * @constructor
+ */
+function _Main$0() {
+}
+
+/**
+ * @constructor
+ */
+function _Main$0$() {
+};
+
+_Main$0$.prototype = new _Main$0;
+
+/**
+ * @param {Array.<undefined|!string>} args
+ */
+_Main$0.main$AS = function (args) {
+};
+
+var _Main$0$main$AS = _Main$0.main$AS;
+
+/**
+ * class Oktavia extends Object
+ * @constructor
+ */
+function Oktavia() {
+}
+
+/**
+ * @constructor
+ */
+function Oktavia$() {
+ /** @type {Array.<undefined|!string>} */
+ var _utf162compressCode$0;
+ this._compressCode2utf16 = null;
+ this._fmindex = new FMIndex$();
+ this._metadatas = ({ });
+ this._metadataLabels = [ ];
+ this._stemmer = null;
+ this._stemmingResult = ({ });
+ _utf162compressCode$0 = this._utf162compressCode = [ Oktavia.eof, Oktavia.eob, Oktavia.unknown ];
+ _utf162compressCode$0.length = 65536;
+ this._compressCode2utf16 = [ Oktavia.eof, Oktavia.eob, Oktavia.unknown ];
+};
+
+Oktavia$.prototype = new Oktavia;
+
+/**
+ * @param {Stemmer} stemmer
+ */
+Oktavia.prototype.setStemmer$LStemmer$ = function (stemmer) {
+ this._stemmer = stemmer;
+};
+
+/**
+ * @return {Metadata}
+ */
+Oktavia.prototype.getPrimaryMetadata$ = function () {
+ return this._metadatas[this._metadataLabels[0]];
+};
+
+/**
+ * @param {!string} key
+ * @return {Section}
+ */
+Oktavia.prototype.addSection$S = function (key) {
+ /** @type {Section} */
+ var section;
+ if (this._metadataLabels.indexOf(key) !== -1) {
+ throw new Error('Metadata name ' + key + ' is already exists');
+ }
+ this._metadataLabels.push(key);
+ section = new Section$LOktavia$(this);
+ this._metadatas[key] = section;
+ return section;
+};
+
+/**
+ * @param {!string} key
+ * @return {Section}
+ */
+Oktavia.prototype.getSection$S = function (key) {
+ if (this._metadataLabels.indexOf(key) === -1) {
+ throw new Error('Metadata name ' + key + " does't exists");
+ }
+ return this._metadatas[key];
+};
+
+/**
+ * @param {!string} key
+ * @return {Splitter}
+ */
+Oktavia.prototype.addSplitter$S = function (key) {
+ /** @type {Splitter} */
+ var splitter;
+ if (this._metadataLabels.indexOf(key) !== -1) {
+ throw new Error('Metadata name ' + key + ' is already exists');
+ }
+ this._metadataLabels.push(key);
+ splitter = new Splitter$LOktavia$(this);
+ this._metadatas[key] = splitter;
+ return splitter;
+};
+
+/**
+ * @param {!string} key
+ * @return {Splitter}
+ */
+Oktavia.prototype.getSplitter$S = function (key) {
+ if (this._metadataLabels.indexOf(key) === -1) {
+ throw new Error('Metadata name ' + key + " does't exists");
+ }
+ return this._metadatas[key];
+};
+
+/**
+ * @param {!string} key
+ * @param {Array.<undefined|!string>} headers
+ * @return {Table}
+ */
+Oktavia.prototype.addTable$SAS = function (key, headers) {
+ /** @type {Table} */
+ var table;
+ if (this._metadataLabels.indexOf(key) !== -1) {
+ throw new Error('Metadata name ' + key + ' is already exists');
+ }
+ this._metadataLabels.push(key);
+ table = new Table$LOktavia$AS(this, headers);
+ this._metadatas[key] = table;
+ return table;
+};
+
+/**
+ * @param {!string} key
+ * @return {Table}
+ */
+Oktavia.prototype.getTable$S = function (key) {
+ if (this._metadataLabels.indexOf(key) === -1) {
+ throw new Error('Metadata name ' + key + " does't exists");
+ }
+ return this._metadatas[key];
+};
+
+/**
+ * @param {!string} key
+ * @return {Block}
+ */
+Oktavia.prototype.addBlock$S = function (key) {
+ /** @type {Block} */
+ var block;
+ if (this._metadataLabels.indexOf(key) !== -1) {
+ throw new Error('Metadata name ' + key + ' is already exists');
+ }
+ this._metadataLabels.push(key);
+ block = new Block$LOktavia$(this);
+ this._metadatas[key] = block;
+ return block;
+};
+
+/**
+ * @param {!string} key
+ * @return {Block}
+ */
+Oktavia.prototype.getBlock$S = function (key) {
+ if (this._metadataLabels.indexOf(key) === -1) {
+ throw new Error('Metadata name ' + key + " does't exists");
+ }
+ return this._metadatas[key];
+};
+
+/**
+ */
+Oktavia.prototype.addEndOfBlock$ = function () {
+ this._fmindex.push$S(Oktavia.eob);
+};
+
+/**
+ * @param {!string} words
+ */
+Oktavia.prototype.addWord$S = function (words) {
+ /** @type {Array.<undefined|!string>} */
+ var str;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var charCode;
+ /** @type {undefined|!string} */
+ var newCharCode;
+ str = [ ];
+ str.length = words.length;
+ for (i = 0; i < words.length; i++) {
+ charCode = words.charCodeAt(i);
+ newCharCode = this._utf162compressCode[charCode];
+ if (newCharCode == null) {
+ newCharCode = String.fromCharCode(this._compressCode2utf16.length);
+ this._utf162compressCode[charCode] = newCharCode;
+ this._compressCode2utf16.push(String.fromCharCode(charCode));
+ }
+ str.push(newCharCode);
+ }
+ this._fmindex.push$S(str.join(''));
+};
+
+/**
+ * @param {!string} words
+ * @param {!boolean} stemming
+ */
+Oktavia.prototype.addWord$SB = function (words, stemming) {
+ /** @type {Array.<undefined|!string>} */
+ var wordList;
+ /** @type {!number} */
+ var i;
+ /** @type {undefined|!string} */
+ var originalWord;
+ /** @type {!string} */
+ var smallWord;
+ /** @type {undefined|!string} */
+ var registerWord;
+ /** @type {!string} */
+ var baseWord;
+ /** @type {!string} */
+ var compressedCodeWord;
+ /** @type {Array.<undefined|!string>} */
+ var stemmedList;
+ this.addWord$S(words);
+ wordList = words.split(/\s+/);
+ for (i = 0; i < wordList.length; i++) {
+ originalWord = wordList[i];
+ smallWord = originalWord.slice(0, 1).toLowerCase() + originalWord.slice(1);
+ registerWord = null;
+ if (stemming && this._stemmer) {
+ baseWord = this._stemmer.stemWord$S(originalWord.toLowerCase());
+ if (originalWord.indexOf(baseWord) === -1) {
+ registerWord = baseWord;
+ }
+ } else {
+ if (originalWord != smallWord) {
+ registerWord = smallWord;
+ }
+ }
+ if (registerWord) {
+ compressedCodeWord = this._convertToCompressionCode$S(originalWord);
+ stemmedList = this._stemmingResult[registerWord];
+ if (! stemmedList) {
+ stemmedList = [ compressedCodeWord ];
+ this._stemmingResult[registerWord] = stemmedList;
+ } else {
+ if (stemmedList.indexOf(compressedCodeWord) === -1) {
+ stemmedList.push(compressedCodeWord);
+ }
+ }
+ }
+ }
+};
+
+/**
+ * @param {!string} keyword
+ * @return {!string}
+ */
+Oktavia.prototype._convertToCompressionCode$S = function (keyword) {
+ /** @type {Array.<undefined|!string>} */
+ var resultChars;
+ /** @type {!number} */
+ var i;
+ /** @type {undefined|!string} */
+ var chr;
+ resultChars = [ ];
+ for (i = 0; i < keyword.length; i++) {
+ chr = this._utf162compressCode[keyword.charCodeAt(i)];
+ if (chr == null) {
+ resultChars.push(Oktavia.unknown);
+ } else {
+ resultChars.push(chr);
+ }
+ }
+ return resultChars.join('');
+};
+
+/**
+ * @param {!string} keyword
+ * @param {!boolean} stemming
+ * @return {Array.<undefined|!number>}
+ */
+Oktavia.prototype.rawSearch$SB = function (keyword, stemming) {
+ /** @type {Array.<undefined|!number>} */
+ var result;
+ /** @type {!string} */
+ var baseWord;
+ /** @type {Array.<undefined|!string>} */
+ var stemmedList;
+ /** @type {!number} */
+ var i;
+ /** @type {undefined|!string} */
+ var word;
+ if (stemming) {
+ result = [ ];
+ if (this._stemmer) {
+ baseWord = this._stemmer.stemWord$S(keyword.toLowerCase());
+ stemmedList = this._stemmingResult[baseWord];
+ if (stemmedList) {
+ for (i = 0; i < stemmedList.length; i++) {
+ word = stemmedList[i];
+ result = result.concat(this._fmindex.search$S(word));
+ }
+ }
+ }
+ } else {
+ result = this._fmindex.search$S(this._convertToCompressionCode$S(keyword));
+ }
+ return result;
+};
+
+/**
+ * @param {Array.<undefined|Query>} queries
+ * @return {SearchSummary}
+ */
+Oktavia.prototype.search$ALQuery$ = function (queries) {
+ /** @type {SearchSummary} */
+ var summary;
+ /** @type {!number} */
+ var i;
+ /** @type {SingleResult} */
+ var result$0;
+ summary = ({sourceResults: [ ], result: null, oktavia: this});
+ for (i = 0; i < queries.length; i++) {
+ result$0 = this._searchQuery$LQuery$(queries[i]);
+ summary.sourceResults.push(result$0);
+ }
+ summary.result = SearchSummary$mergeResult$LSearchSummary$ALSingleResult$(summary, summary.sourceResults);
+ return summary;
+};
+
+/**
+ * @param {Query} query
+ * @return {SingleResult}
+ */
+Oktavia.prototype._searchQuery$LQuery$ = function (query) {
+ /** @type {SingleResult} */
+ var result;
+ /** @type {Array.<undefined|!number>} */
+ var positions;
+ result = new SingleResult$SBB(query.word, query.or, query.not);
+ if (query.raw) {
+ positions = this.rawSearch$SB(query.word, false);
+ } else {
+ positions = this.rawSearch$SB(query.word, false).concat(this.rawSearch$SB(query.word, true));
+ }
+ this._metadatas[this._metadataLabels[0]].grouping$LSingleResult$AISB(result, positions, query.word, ! query.raw);
+ return result;
+};
+
+/**
+ */
+Oktavia.prototype.build$ = function () {
+ this.build$IB(5, false);
+};
+
+/**
+ * @param {!number} cacheDensity
+ * @param {!boolean} verbose
+ */
+Oktavia.prototype.build$IB = function (cacheDensity, verbose) {
+ /** @type {!string} */
+ var key;
+ /** @type {!number} */
+ var cacheRange;
+ /** @type {!number} */
+ var maxChar;
+ for (key in this._metadatas) {
+ this._metadatas[key]._build$();
+ }
+ cacheRange = Math.round(Math.max(1, 100 / Math.min(100, Math.max(0.01, cacheDensity))));
+ maxChar = this._compressCode2utf16.length;
+ this._fmindex.build$SIIB(Oktavia.eof, maxChar, cacheRange, verbose);
+};
+
+/**
+ * @return {!string}
+ */
+Oktavia.prototype.dump$ = function () {
+ return this.dump$B(false);
+};
+
+/**
+ * @param {!boolean} verbose
+ * @return {!string}
+ */
+Oktavia.prototype.dump$B = function (verbose) {
+ /** @type {!string} */
+ var header;
+ /** @type {!string} */
+ var fmdata;
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var i;
+ /** @type {CompressionReport} */
+ var report;
+ /** @type {undefined|!string} */
+ var name;
+ /** @type {!string} */
+ var data;
+ header = Binary$dumpString$SLCompressionReport$("oktavia-01", null).slice(1);
+ if (verbose) {
+ console.log("Source text size: " + (this._fmindex.size$() * 2 + "") + ' bytes');
+ }
+ fmdata = this._fmindex.dump$B(verbose);
+ result = [ header, fmdata ];
+ result.push(Binary$dump16bitNumber$I(this._compressCode2utf16.length));
+ for (i = 3; i < this._compressCode2utf16.length; i++) {
+ result.push(this._compressCode2utf16[i]);
+ }
+ if (verbose) {
+ console.log('Char Code Map: ' + (this._compressCode2utf16.length * 2 - 2 + "") + ' bytes');
+ }
+ report = ({source: 0, result: 0});
+ result.push(Binary$dumpStringListMap$HASLCompressionReport$(this._stemmingResult, report));
+ if (verbose) {
+ console.log('Stemmed Word Table: ' + (result[result.length - 1].length + "") + ' bytes (' + (Math.round(report.result * 100.0 / report.source) + "") + '%)');
+ }
+ result.push(Binary$dump16bitNumber$I(this._metadataLabels.length));
+ for (i = 0; i < this._metadataLabels.length; i++) {
+ report = ({source: 0, result: 0});
+ name = this._metadataLabels[i];
+ data = this._metadatas[name]._dump$LCompressionReport$(report);
+ result.push(Binary$dumpString$SLCompressionReport$(name, report), data);
+ if (verbose) {
+ console.log('Meta Data ' + name + ': ' + (data.length * 2 + "") + ' bytes (' + (Math.round(report.result * 100.0 / report.source) + "") + '%)');
+ }
+ }
+ return result.join('');
+};
+
+/**
+ * @param {!string} data
+ */
+Oktavia.prototype.load$S = function (data) {
+ /** @type {!string} */
+ var header;
+ /** @type {!number} */
+ var offset;
+ /** @type {!number} */
+ var charCodeCount;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var charCode;
+ /** @type {LoadedStringListMapResult} */
+ var stemmedWords;
+ /** @type {!number} */
+ var metadataCount;
+ /** @type {LoadedStringResult} */
+ var nameResult;
+ /** @type {!string} */
+ var name;
+ /** @type {!number} */
+ var type;
+ header = Binary$dumpString$SLCompressionReport$("oktavia-01", null).slice(1);
+ if (data.slice(0, 5) !== header) {
+ throw new Error('Invalid data file');
+ }
+ this._metadatas = ({ });
+ this._metadataLabels = [ ];
+ offset = 5;
+ offset = this._fmindex.load$SI(data, offset);
+ charCodeCount = Binary$load16bitNumber$SI(data, offset++);
+ this._compressCode2utf16 = [ Oktavia.eof, Oktavia.eob, Oktavia.unknown ];
+ this._utf162compressCode = [ Oktavia.eof, Oktavia.eob, Oktavia.unknown ];
+ for (i = 3; i < charCodeCount; i++) {
+ charCode = Binary$load16bitNumber$SI(data, offset++);
+ this._compressCode2utf16.push(String.fromCharCode(charCode));
+ this._utf162compressCode[charCode] = String.fromCharCode(i);
+ }
+ stemmedWords = Binary$loadStringListMap$SI(data, offset);
+ this._stemmingResult = stemmedWords.result;
+ offset = stemmedWords.offset;
+ metadataCount = Binary$load16bitNumber$SI(data, offset++);
+ for (i = 0; i < metadataCount; i++) {
+ nameResult = Binary$loadString$SI(data, offset);
+ name = nameResult.result;
+ offset = nameResult.offset;
+ type = Binary$load16bitNumber$SI(data, offset++);
+ switch (type) {
+ case 0:
+ offset = Section$_load$LOktavia$SSI(this, name, data, offset);
+ break;
+ case 1:
+ offset = Splitter$_load$LOktavia$SSI(this, name, data, offset);
+ break;
+ case 2:
+ offset = Table$_load$LOktavia$SSI(this, name, data, offset);
+ break;
+ case 3:
+ offset = Block$_load$LOktavia$SSI(this, name, data, offset);
+ break;
+ }
+ }
+};
+
+/**
+ * @return {!number}
+ */
+Oktavia.prototype.contentSize$ = function () {
+ /** @type {FMIndex} */
+ var this$0;
+ this$0 = this._fmindex;
+ return this$0._substr.length;
+};
+
+/**
+ * @param {!number} position
+ * @return {!number}
+ */
+Oktavia.prototype.wordPositionType$I = function (position) {
+ /** @type {!number} */
+ var result;
+ /** @type {!string} */
+ var ahead;
+ result = 0;
+ if (position === 0) {
+ result = 4;
+ } else {
+ ahead = this._fmindex.getSubstring$II(position - 1, 1);
+ if (/\s/.test(ahead)) {
+ result = 2;
+ } else {
+ if (/\W/.test(ahead)) {
+ result = 1;
+ } else {
+ if (Oktavia.eob === ahead) {
+ result = 3;
+ }
+ }
+ }
+ }
+ return (result | 0);
+};
+
+/**
+ * @param {!number} position
+ * @param {!number} length
+ * @return {!string}
+ */
+Oktavia.prototype._getSubstring$II = function (position, length) {
+ /** @type {!string} */
+ var result;
+ /** @type {Array.<undefined|!string>} */
+ var str;
+ /** @type {!number} */
+ var i;
+ result = this._fmindex.getSubstring$II(position, length);
+ str = [ ];
+ for (i = 0; i < result.length; i++) {
+ str.push(this._compressCode2utf16[result.charCodeAt(i)]);
+ }
+ return str.join('');
+};
+
+/**
+ * class Binary extends Object
+ * @constructor
+ */
+function Binary() {
+}
+
+/**
+ * @constructor
+ */
+function Binary$() {
+};
+
+Binary$.prototype = new Binary;
+
+/**
+ * @param {!number} num
+ * @return {!string}
+ */
+Binary.dump32bitNumber$N = function (num) {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ result = [ String.fromCharCode(Math.floor(num / 65536)) ];
+ result.push(String.fromCharCode(num % 65536));
+ return result.join("");
+};
+
+var Binary$dump32bitNumber$N = Binary.dump32bitNumber$N;
+
+/**
+ * @param {!string} buffer
+ * @param {!number} offset
+ * @return {!number}
+ */
+Binary.load32bitNumber$SI = function (buffer, offset) {
+ /** @type {!number} */
+ var result;
+ result = buffer.charCodeAt(offset) * 65536 + buffer.charCodeAt(offset + 1);
+ return result;
+};
+
+var Binary$load32bitNumber$SI = Binary.load32bitNumber$SI;
+
+/**
+ * @param {!number} num
+ * @return {!string}
+ */
+Binary.dump16bitNumber$I = function (num) {
+ return String.fromCharCode(num % 65536);
+};
+
+var Binary$dump16bitNumber$I = Binary.dump16bitNumber$I;
+
+/**
+ * @param {!string} buffer
+ * @param {!number} offset
+ * @return {!number}
+ */
+Binary.load16bitNumber$SI = function (buffer, offset) {
+ return (buffer.charCodeAt(offset) | 0);
+};
+
+var Binary$load16bitNumber$SI = Binary.load16bitNumber$SI;
+
+/**
+ * @param {!string} str
+ * @return {!string}
+ */
+Binary.dumpString$S = function (str) {
+ return Binary$dumpString$SLCompressionReport$(str, null);
+};
+
+var Binary$dumpString$S = Binary.dumpString$S;
+
+/**
+ * @param {!string} str
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+Binary.dumpString$SLCompressionReport$ = function (str, report) {
+ /** @type {!number} */
+ var length;
+ /** @type {!boolean} */
+ var compress;
+ /** @type {Array.<undefined|!number>} */
+ var charCodes;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var charCode;
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {undefined|!number} */
+ var bytes;
+ if (str.length > 32768) {
+ str = str.slice(0, 32768);
+ }
+ length = str.length;
+ compress = true;
+ charCodes = [ ];
+ for (i = 0; i < length; i++) {
+ charCode = str.charCodeAt(i);
+ if (charCode > 255) {
+ compress = false;
+ break;
+ }
+ charCodes.push(charCode);
+ }
+ if (compress) {
+ result = [ Binary$dump16bitNumber$I(length + 32768) ];
+ for (i = 0; i < length; i += 2) {
+ bytes = charCodes[i];
+ if (i !== length - 1) {
+ bytes += charCodes[i + 1] << 8;
+ }
+ result.push(String.fromCharCode(bytes % 65536));
+ }
+ if (report) {
+ CompressionReport$add$LCompressionReport$II(report, length, Math.ceil(length / 2));
+ }
+ } else {
+ result = [ Binary$dump16bitNumber$I(length), str ];
+ if (report) {
+ CompressionReport$add$LCompressionReport$II(report, length, length);
+ }
+ }
+ return result.join('');
+};
+
+var Binary$dumpString$SLCompressionReport$ = Binary.dumpString$SLCompressionReport$;
+
+/**
+ * @param {!string} buffer
+ * @param {!number} offset
+ * @return {LoadedStringResult}
+ */
+Binary.loadString$SI = function (buffer, offset) {
+ return new LoadedStringResult$SI(buffer, offset);
+};
+
+var Binary$loadString$SI = Binary.loadString$SI;
+
+/**
+ * @param {Array.<undefined|!string>} strList
+ * @return {!string}
+ */
+Binary.dumpStringList$AS = function (strList) {
+ return Binary$dumpStringList$ASLCompressionReport$(strList, null);
+};
+
+var Binary$dumpStringList$AS = Binary.dumpStringList$AS;
+
+/**
+ * @param {Array.<undefined|!string>} strList
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+Binary.dumpStringList$ASLCompressionReport$ = function (strList, report) {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var i;
+ result = [ Binary$dump32bitNumber$N(strList.length) ];
+ for (i = 0; i < strList.length; i++) {
+ result.push(Binary$dumpString$SLCompressionReport$(strList[i], report));
+ }
+ return result.join('');
+};
+
+var Binary$dumpStringList$ASLCompressionReport$ = Binary.dumpStringList$ASLCompressionReport$;
+
+/**
+ * @param {!string} buffer
+ * @param {!number} offset
+ * @return {LoadedStringListResult}
+ */
+Binary.loadStringList$SI = function (buffer, offset) {
+ return new LoadedStringListResult$SI(buffer, offset);
+};
+
+var Binary$loadStringList$SI = Binary.loadStringList$SI;
+
+/**
+ * @param {Object.<string, undefined|Array.<undefined|!string>>} strMap
+ * @return {!string}
+ */
+Binary.dumpStringListMap$HAS = function (strMap) {
+ return Binary$dumpStringListMap$HASLCompressionReport$(strMap, null);
+};
+
+var Binary$dumpStringListMap$HAS = Binary.dumpStringListMap$HAS;
+
+/**
+ * @param {Object.<string, undefined|Array.<undefined|!string>>} strMap
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+Binary.dumpStringListMap$HASLCompressionReport$ = function (strMap, report) {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var counter;
+ /** @type {!string} */
+ var key;
+ result = [ ];
+ counter = 0;
+ for (key in strMap) {
+ result.push(Binary$dumpString$SLCompressionReport$(key, report));
+ result.push(Binary$dumpStringList$ASLCompressionReport$(strMap[key], report));
+ counter++;
+ }
+ return Binary$dump32bitNumber$N(counter) + result.join('');
+};
+
+var Binary$dumpStringListMap$HASLCompressionReport$ = Binary.dumpStringListMap$HASLCompressionReport$;
+
+/**
+ * @param {!string} buffer
+ * @param {!number} offset
+ * @return {LoadedStringListMapResult}
+ */
+Binary.loadStringListMap$SI = function (buffer, offset) {
+ return new LoadedStringListMapResult$SI(buffer, offset);
+};
+
+var Binary$loadStringListMap$SI = Binary.loadStringListMap$SI;
+
+/**
+ * @param {Array.<undefined|!number>} array
+ * @return {!string}
+ */
+Binary.dump32bitNumberList$AN = function (array) {
+ return Binary$dump32bitNumberList$ANLCompressionReport$(array, null);
+};
+
+var Binary$dump32bitNumberList$AN = Binary.dump32bitNumberList$AN;
+
+/**
+ * @param {Array.<undefined|!number>} array
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+Binary.dump32bitNumberList$ANLCompressionReport$ = function (array, report) {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var index;
+ /** @type {!number} */
+ var inputLength;
+ /** @type {!number} */
+ var length;
+ /** @type {!string} */
+ var resultString;
+ /** @type {!number} */
+ var value1$0;
+ /** @type {!number} */
+ var value2$0;
+ result = [ Binary$dump32bitNumber$N(array.length) ];
+ index = 0;
+ inputLength = array.length;
+ while (index < inputLength) {
+ if (array[index] == 0) {
+ length = Binary$_countZero$ANI(array, index);
+ result.push(Binary$_zeroBlock$I(length));
+ index += length;
+ } else {
+ if (Binary$_shouldZebraCode$ANI(array, index)) {
+ result.push(Binary$_createZebraCode$ANI(array, index));
+ value1$0 = array.length;
+ value2$0 = index + 15;
+ index = (value1$0 <= value2$0 ? value1$0 : value2$0);
+ } else {
+ length = Binary$_searchDoubleZero$ANI(array, index);
+ result.push(Binary$_nonZeroBlock$ANII(array, index, length));
+ if (length === 0) {
+ throw new Error('');
+ }
+ index += length;
+ }
+ }
+ }
+ resultString = result.join('');
+ if (report) {
+ CompressionReport$add$LCompressionReport$II(report, array.length * 2 + 2, resultString.length);
+ }
+ return resultString;
+};
+
+var Binary$dump32bitNumberList$ANLCompressionReport$ = Binary.dump32bitNumberList$ANLCompressionReport$;
+
+/**
+ * @param {!string} buffer
+ * @param {!number} offset
+ * @return {LoadedNumberListResult}
+ */
+Binary.load32bitNumberList$SI = function (buffer, offset) {
+ return new LoadedNumberListResult$SI(buffer, offset);
+};
+
+var Binary$load32bitNumberList$SI = Binary.load32bitNumberList$SI;
+
+/**
+ * @param {Array.<undefined|!number>} array
+ * @param {!number} offset
+ * @return {!number}
+ */
+Binary._countZero$ANI = function (array, offset) {
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var array$len$0;
+ for ((i = offset, array$len$0 = array.length); i < array$len$0; i++) {
+ if (array[i] != 0) {
+ return (i - offset | 0);
+ }
+ }
+ return (array.length - offset | 0);
+};
+
+var Binary$_countZero$ANI = Binary._countZero$ANI;
+
+/**
+ * @param {!number} length
+ * @return {!string}
+ */
+Binary._zeroBlock$I = function (length) {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ result = [ ];
+ while (length > 0) {
+ if (length > 16384) {
+ result.push(Binary$dump16bitNumber$I(16383));
+ length -= 16384;
+ } else {
+ result.push(Binary$dump16bitNumber$I(length - 1));
+ length = 0;
+ }
+ }
+ return result.join('');
+};
+
+var Binary$_zeroBlock$I = Binary._zeroBlock$I;
+
+/**
+ * @param {Array.<undefined|!number>} array
+ * @param {!number} offset
+ * @return {!boolean}
+ */
+Binary._shouldZebraCode$ANI = function (array, offset) {
+ /** @type {!number} */
+ var change;
+ /** @type {!boolean} */
+ var isLastZero;
+ /** @type {!number} */
+ var i;
+ if (array.length - offset < 16) {
+ return true;
+ }
+ change = 0;
+ isLastZero = false;
+ for (i = offset; i < offset + 15; i++) {
+ if (array[i] == 0) {
+ if (! isLastZero) {
+ isLastZero = true;
+ change++;
+ }
+ } else {
+ if (isLastZero) {
+ isLastZero = false;
+ change++;
+ }
+ }
+ }
+ return change > 2;
+};
+
+var Binary$_shouldZebraCode$ANI = Binary._shouldZebraCode$ANI;
+
+/**
+ * @param {Array.<undefined|!number>} array
+ * @param {!number} offset
+ * @return {!number}
+ */
+Binary._searchDoubleZero$ANI = function (array, offset) {
+ /** @type {!boolean} */
+ var isLastZero;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var array$len$0;
+ isLastZero = false;
+ for ((i = offset, array$len$0 = array.length); i < array$len$0; i++) {
+ if (array[i] == 0) {
+ if (isLastZero) {
+ return (i - offset - 1 | 0);
+ }
+ isLastZero = true;
+ } else {
+ isLastZero = false;
+ }
+ }
+ return (array.length - offset | 0);
+};
+
+var Binary$_searchDoubleZero$ANI = Binary._searchDoubleZero$ANI;
+
+/**
+ * @param {Array.<undefined|!number>} array
+ * @param {!number} offset
+ * @param {!number} length
+ * @return {!string}
+ */
+Binary._nonZeroBlock$ANII = function (array, offset, length) {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var blockLength;
+ /** @type {!number} */
+ var i;
+ result = [ ];
+ while (length > 0) {
+ if (length > 16384) {
+ blockLength = 16384;
+ length -= 16384;
+ } else {
+ blockLength = length;
+ length = 0;
+ }
+ result.push(Binary$dump16bitNumber$I(blockLength - 1 + 0x4000));
+ for (i = offset; i < offset + blockLength; i++) {
+ result.push(Binary$dump32bitNumber$N(array[i]));
+ }
+ offset += blockLength;
+ }
+ return result.join('');
+};
+
+var Binary$_nonZeroBlock$ANII = Binary._nonZeroBlock$ANII;
+
+/**
+ * @param {Array.<undefined|!number>} array
+ * @param {!number} offset
+ * @return {!string}
+ */
+Binary._createZebraCode$ANI = function (array, offset) {
+ /** @type {!number} */
+ var last;
+ /** @type {!number} */
+ var code;
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var value1$0;
+ /** @type {!number} */
+ var value2$0;
+ value1$0 = offset + 15;
+ value2$0 = array.length;
+ last = (value1$0 <= value2$0 ? value1$0 : value2$0);
+ code = 0x8000;
+ result = [ ];
+ for (i = offset; i < last; i++) {
+ if (array[i] != 0) {
+ result.push(Binary$dump32bitNumber$N(array[i]));
+ code = code + (0x1 << i - offset);
+ }
+ }
+ return String.fromCharCode(code) + result.join('');
+};
+
+var Binary$_createZebraCode$ANI = Binary._createZebraCode$ANI;
+
+/**
+ * @param {!string} str
+ * @return {!string}
+ */
+Binary.base64encode$S = function (str) {
+ /** @type {Array.<undefined|!string>} */
+ var out;
+ /** @type {Array.<undefined|!number>} */
+ var source;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var code;
+ /** @type {!number} */
+ var len;
+ /** @type {!number} */
+ var c1;
+ /** @type {undefined|!number} */
+ var c2;
+ /** @type {undefined|!number} */
+ var c3;
+ out = [ ];
+ source = [ ];
+ for (i = 0; i < str.length; i++) {
+ code = str.charCodeAt(i);
+ source.push(code & 0x00ff, code >>> 8);
+ }
+ len = str.length * 2;
+ i = 0;
+ while (i < len) {
+ c1 = source[i++] & 0xff;
+ if (i === len) {
+ out.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(c1 >> 2));
+ out.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((c1 & 0x3) << 4));
+ out.push("==");
+ break;
+ }
+ c2 = source[i++];
+ if (i === len) {
+ out.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(c1 >> 2));
+ out.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((c1 & 0x3) << 4 | (c2 & 0xF0) >> 4));
+ out.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((c2 & 0xF) << 2));
+ out.push("=");
+ break;
+ }
+ c3 = source[i++];
+ out.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(c1 >> 2));
+ out.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((c1 & 0x3) << 4 | (c2 & 0xF0) >> 4));
+ out.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((c2 & 0xF) << 2 | (c3 & 0xC0) >> 6));
+ out.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(c3 & 0x3F));
+ }
+ return out.join('');
+};
+
+var Binary$base64encode$S = Binary.base64encode$S;
+
+/**
+ * @param {Array.<undefined|!number>} source
+ * @return {!string}
+ */
+Binary._mergeCharCode$AI = function (source) {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var i;
+ result = [ ];
+ for (i = 0; i < source.length; i += 2) {
+ result.push(String.fromCharCode(source[i] + (source[i + 1] << 8)));
+ }
+ return result.join('');
+};
+
+var Binary$_mergeCharCode$AI = Binary._mergeCharCode$AI;
+
+/**
+ * @param {!string} str
+ * @return {!string}
+ */
+Binary.base64decode$S = function (str) {
+ /** @type {!number} */
+ var len;
+ /** @type {!number} */
+ var i;
+ /** @type {Array.<undefined|!number>} */
+ var out;
+ /** @type {undefined|!number} */
+ var c1;
+ /** @type {undefined|!number} */
+ var c2;
+ /** @type {!number} */
+ var c3;
+ /** @type {!number} */
+ var c4;
+ len = str.length;
+ i = 0;
+ out = [ ];
+ while (i < len) {
+ do {
+ c1 = Binary._base64DecodeChars[str.charCodeAt(i++) & 0xff];
+ } while (i < len && c1 == -1);
+ if (c1 == -1) {
+ break;
+ }
+ do {
+ c2 = Binary._base64DecodeChars[str.charCodeAt(i++) & 0xff];
+ } while (i < len && c2 == -1);
+ if (c2 == -1) {
+ break;
+ }
+ out.push(c1 << 2 | (c2 & 0x30) >> 4);
+ do {
+ c3 = str.charCodeAt(i++) & 0xff;
+ if (c3 === 61) {
+ return Binary$_mergeCharCode$AI(out);
+ }
+ c3 = Binary._base64DecodeChars[c3];
+ } while (i < len && c3 === -1);
+ if (c3 === -1) {
+ break;
+ }
+ out.push((c2 & 0XF) << 4 | (c3 & 0x3C) >> 2);
+ do {
+ c4 = str.charCodeAt(i++) & 0xff;
+ if (c4 === 61) {
+ return Binary$_mergeCharCode$AI(out);
+ }
+ c4 = (Binary._base64DecodeChars[c4] | 0);
+ } while (i < len && c4 === -1);
+ if (c4 === -1) {
+ break;
+ }
+ out.push((c3 & 0x03) << 6 | c4);
+ }
+ return Binary$_mergeCharCode$AI(out);
+};
+
+var Binary$base64decode$S = Binary.base64decode$S;
+
+/**
+ * class LoadedStringResult extends Object
+ * @constructor
+ */
+function LoadedStringResult() {
+}
+
+/**
+ * @constructor
+ * @param {!string} data
+ * @param {!number} offset
+ */
+function LoadedStringResult$SI(data, offset) {
+ /** @type {!number} */
+ var strLength;
+ /** @type {Array.<undefined|!string>} */
+ var bytes;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var code;
+ /** @type {!number} */
+ var offset$0;
+ this.result = "";
+ this.offset = 0;
+ offset$0 = offset++;
+ strLength = data.charCodeAt(offset$0);
+ if (strLength > 32767) {
+ strLength = strLength - 32768;
+ bytes = [ ];
+ for (i = 0; i < strLength; i += 2) {
+ code = data.charCodeAt(offset);
+ bytes.push(String.fromCharCode(code & 0x00ff));
+ if (i !== strLength - 1) {
+ bytes.push(String.fromCharCode(code >>> 8));
+ }
+ offset++;
+ }
+ this.result = bytes.join('');
+ this.offset = offset;
+ } else {
+ this.result = data.slice(offset, offset + strLength);
+ this.offset = (offset + strLength | 0);
+ }
+};
+
+LoadedStringResult$SI.prototype = new LoadedStringResult;
+
+/**
+ * class LoadedStringListResult extends Object
+ * @constructor
+ */
+function LoadedStringListResult() {
+}
+
+/**
+ * @constructor
+ * @param {!string} data
+ * @param {!number} offset
+ */
+function LoadedStringListResult$SI(data, offset) {
+ /** @type {!number} */
+ var length;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var strLength;
+ /** @type {!string} */
+ var resultStr;
+ /** @type {Array.<undefined|!string>} */
+ var bytes;
+ /** @type {!number} */
+ var j;
+ /** @type {!number} */
+ var code;
+ /** @type {!number} */
+ var result$0;
+ /** @type {!number} */
+ var offset$0;
+ this.offset = 0;
+ this.result = [ ];
+ result$0 = data.charCodeAt(offset) * 65536 + data.charCodeAt(offset + 1);
+ length = result$0;
+ offset += 2;
+ for (i = 0; i < length; i++) {
+ offset$0 = offset++;
+ strLength = data.charCodeAt(offset$0);
+ if (strLength > 32767) {
+ strLength = strLength - 32768;
+ bytes = [ ];
+ for (j = 0; j < strLength; j += 2) {
+ code = data.charCodeAt(offset);
+ bytes.push(String.fromCharCode(code & 0x00ff));
+ if (j !== strLength - 1) {
+ bytes.push(String.fromCharCode(code >>> 8));
+ }
+ offset++;
+ }
+ resultStr = bytes.join('');
+ } else {
+ resultStr = data.slice(offset, offset + strLength);
+ offset = (offset + strLength | 0);
+ }
+ this.result.push(resultStr);
+ }
+ this.offset = offset;
+};
+
+LoadedStringListResult$SI.prototype = new LoadedStringListResult;
+
+/**
+ * class LoadedStringListMapResult extends Object
+ * @constructor
+ */
+function LoadedStringListMapResult() {
+}
+
+/**
+ * @constructor
+ * @param {!string} data
+ * @param {!number} offset
+ */
+function LoadedStringListMapResult$SI(data, offset) {
+ /** @type {!number} */
+ var length;
+ /** @type {!number} */
+ var i;
+ /** @type {LoadedStringResult} */
+ var keyResult;
+ /** @type {LoadedStringListResult} */
+ var valueResult;
+ /** @type {!number} */
+ var result$0;
+ /** @type {!number} */
+ var offset$0;
+ this.offset = 0;
+ this.result = ({ });
+ result$0 = data.charCodeAt(offset) * 65536 + data.charCodeAt(offset + 1);
+ length = result$0;
+ offset += 2;
+ for (i = 0; i < length; i++) {
+ keyResult = new LoadedStringResult$SI(data, offset);
+ offset$0 = keyResult.offset;
+ valueResult = new LoadedStringListResult$SI(data, offset$0);
+ this.result[keyResult.result] = valueResult.result;
+ offset = valueResult.offset;
+ }
+ this.offset = offset;
+};
+
+LoadedStringListMapResult$SI.prototype = new LoadedStringListMapResult;
+
+/**
+ * class LoadedNumberListResult extends Object
+ * @constructor
+ */
+function LoadedNumberListResult() {
+}
+
+/**
+ * @constructor
+ * @param {!string} data
+ * @param {!number} offset
+ */
+function LoadedNumberListResult$SI(data, offset) {
+ /** @type {!number} */
+ var resultLength;
+ /** @type {!number} */
+ var originalOffset;
+ /** @type {Array.<undefined|!number>} */
+ var result;
+ /** @type {!number} */
+ var tag;
+ /** @type {!number} */
+ var length;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var result$0;
+ /** @type {!number} */
+ var value1$0;
+ this.result = null;
+ this.offset = 0;
+ result$0 = data.charCodeAt(offset) * 65536 + data.charCodeAt(offset + 1);
+ resultLength = result$0;
+ originalOffset = offset;
+ offset += 2;
+ result = [ ];
+ while (result.length < resultLength) {
+ tag = data.charCodeAt(offset++);
+ if (tag >>> 15 === 1) {
+ value1$0 = resultLength - result.length;
+ length = (value1$0 <= 15 ? value1$0 : 15);
+ for (i = 0; i < length; i++) {
+ if (tag >>> i & 0x1) {
+ result.push(Binary$load32bitNumber$SI(data, offset));
+ offset += 2;
+ } else {
+ result.push(0);
+ }
+ }
+ } else {
+ if (tag >>> 14 === 1) {
+ length = tag - 0x4000 + 1;
+ for (i = 0; i < length; i++) {
+ result.push(Binary$load32bitNumber$SI(data, offset));
+ offset += 2;
+ }
+ } else {
+ length = tag + 1;
+ for (i = 0; i < length; i++) {
+ result.push(0);
+ }
+ }
+ }
+ }
+ this.result = result;
+ this.offset = offset;
+};
+
+LoadedNumberListResult$SI.prototype = new LoadedNumberListResult;
+
+/**
+ * class CompressionReport extends Object
+ * @constructor
+ */
+function CompressionReport() {
+}
+
+/**
+ * @constructor
+ */
+function CompressionReport$() {
+ this.source = 0;
+ this.result = 0;
+};
+
+CompressionReport$.prototype = new CompressionReport;
+
+/**
+ * @param {CompressionReport} $this
+ * @param {!number} source
+ * @param {!number} result
+ */
+CompressionReport.add$LCompressionReport$II = function ($this, source, result) {
+ $this.source += source;
+ $this.result += result;
+};
+
+var CompressionReport$add$LCompressionReport$II = CompressionReport.add$LCompressionReport$II;
+
+/**
+ * @param {CompressionReport} $this
+ * @return {!number}
+ */
+CompressionReport.rate$LCompressionReport$ = function ($this) {
+ return (Math.round($this.result * 100.0 / $this.source) | 0);
+};
+
+var CompressionReport$rate$LCompressionReport$ = CompressionReport.rate$LCompressionReport$;
+
+/**
+ * class Query extends Object
+ * @constructor
+ */
+function Query() {
+}
+
+/**
+ * @constructor
+ */
+function Query$() {
+ this.word = '';
+ this.or = false;
+ this.not = false;
+ this.raw = false;
+};
+
+Query$.prototype = new Query;
+
+/**
+ * @return {!string}
+ */
+Query.prototype.toString = function () {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ result = [ ];
+ if (this.or) {
+ result.push("OR ");
+ }
+ if (this.not) {
+ result.push("-");
+ }
+ if (this.raw) {
+ result.push('"', this.word, '"');
+ } else {
+ result.push(this.word);
+ }
+ return result.join('');
+};
+
+/**
+ * class QueryStringParser extends Object
+ * @constructor
+ */
+function QueryStringParser() {
+}
+
+/**
+ * @constructor
+ */
+function QueryStringParser$() {
+ this.queries = [ ];
+};
+
+QueryStringParser$.prototype = new QueryStringParser;
+
+/**
+ * @param {QueryStringParser} $this
+ * @param {!string} queryString
+ * @return {Array.<undefined|Query>}
+ */
+QueryStringParser.parse$LQueryStringParser$S = function ($this, queryString) {
+ /** @type {!boolean} */
+ var nextOr;
+ /** @type {!boolean} */
+ var nextNot;
+ /** @type {!number} */
+ var currentWordStart;
+ /** @type {!number} */
+ var status;
+ /** @type {RegExp} */
+ var isSpace;
+ /** @type {!number} */
+ var i;
+ /** @type {!string} */
+ var ch;
+ /** @type {!string} */
+ var word;
+ /** @type {Query} */
+ var query;
+ nextOr = false;
+ nextNot = false;
+ currentWordStart = 0;
+ status = 0;
+ isSpace = /[\s\u3000]/;
+ for (i = 0; i < queryString.length; i++) {
+ ch = queryString.charAt(i);
+ switch (status) {
+ case 0:
+ if (! isSpace.test(ch)) {
+ if (ch === '-') {
+ nextNot = true;
+ } else {
+ if (ch === '"') {
+ currentWordStart = i + 1;
+ status = 2;
+ } else {
+ currentWordStart = i;
+ status = 1;
+ }
+ }
+ } else {
+ nextNot = false;
+ }
+ break;
+ case 1:
+ if (isSpace.test(ch)) {
+ word = queryString.slice(currentWordStart, i);
+ if (word === 'OR') {
+ nextOr = true;
+ } else {
+ query = new Query$();
+ query.word = word;
+ query.or = nextOr;
+ query.not = nextNot;
+ $this.queries.push(query);
+ nextOr = false;
+ nextNot = false;
+ }
+ status = 0;
+ }
+ break;
+ case 2:
+ if (ch === '"') {
+ word = queryString.slice(currentWordStart, i);
+ query = new Query$();
+ query.word = word;
+ query.or = nextOr;
+ query.not = nextNot;
+ query.raw = true;
+ $this.queries.push(query);
+ nextOr = false;
+ nextNot = false;
+ status = 0;
+ }
+ break;
+ }
+ }
+ switch (status) {
+ case 0:
+ break;
+ case 1:
+ query = new Query$();
+ word = queryString.slice(currentWordStart, queryString.length);
+ if (word !== 'OR') {
+ query.word = word;
+ query.or = nextOr;
+ query.not = nextNot;
+ $this.queries.push(query);
+ }
+ break;
+ case 2:
+ query = new Query$();
+ query.word = queryString.slice(currentWordStart, queryString.length);
+ query.or = nextOr;
+ query.not = nextNot;
+ query.raw = true;
+ $this.queries.push(query);
+ break;
+ }
+ return $this.queries;
+};
+
+var QueryStringParser$parse$LQueryStringParser$S = QueryStringParser.parse$LQueryStringParser$S;
+
+/**
+ * @param {QueryStringParser} $this
+ * @return {!string}
+ */
+QueryStringParser.highlight$LQueryStringParser$ = function ($this) {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var i;
+ /** @type {Query} */
+ var query;
+ result = [ ];
+ for (i = 0; i < $this.queries.length; i++) {
+ query = $this.queries[i];
+ if (! query.not) {
+ result.push("highlight=" + $__jsx_encodeURIComponent(query.word));
+ }
+ }
+ return '?' + result.join('&');
+};
+
+var QueryStringParser$highlight$LQueryStringParser$ = QueryStringParser.highlight$LQueryStringParser$;
+
+/**
+ * class Proposal extends Object
+ * @constructor
+ */
+function Proposal() {
+}
+
+/**
+ * @constructor
+ * @param {!number} omit
+ * @param {!number} expect
+ */
+function Proposal$II(omit, expect) {
+ this.omit = omit;
+ this.expect = expect;
+};
+
+Proposal$II.prototype = new Proposal;
+
+/**
+ * class Position extends Object
+ * @constructor
+ */
+function Position() {
+}
+
+/**
+ * @constructor
+ * @param {!string} word
+ * @param {!number} position
+ * @param {!boolean} stemmed
+ */
+function Position$SIB(word, position, stemmed) {
+ this.word = word;
+ this.position = position;
+ this.stemmed = stemmed;
+};
+
+Position$SIB.prototype = new Position;
+
+/**
+ * class SearchUnit extends Object
+ * @constructor
+ */
+function SearchUnit() {
+}
+
+/**
+ * @constructor
+ * @param {!number} id
+ */
+function SearchUnit$I(id) {
+ this.positions = ({ });
+ this.id = id;
+ this._size = 0;
+ this.score = 0;
+ this.startPosition = -1;
+};
+
+SearchUnit$I.prototype = new SearchUnit;
+
+/**
+ * @param {SearchUnit} $this
+ * @param {!string} word
+ * @param {!number} position
+ * @param {!boolean} stemmed
+ */
+SearchUnit.addPosition$LSearchUnit$SIB = function ($this, word, position, stemmed) {
+ /** @type {Position} */
+ var positionObj;
+ positionObj = $this.positions[position + ""];
+ if (! positionObj) {
+ $this._size++;
+ $this.positions[position + ""] = ({word: word, position: position, stemmed: stemmed});
+ } else {
+ if (positionObj.word.length < word.length) {
+ positionObj.word = word;
+ }
+ positionObj.stemmed = positionObj.stemmed && stemmed;
+ }
+};
+
+var SearchUnit$addPosition$LSearchUnit$SIB = SearchUnit.addPosition$LSearchUnit$SIB;
+
+/**
+ * @param {SearchUnit} $this
+ * @param {!number} position
+ * @return {Position}
+ */
+SearchUnit.get$LSearchUnit$I = function ($this, position) {
+ return $this.positions[position + ""];
+};
+
+var SearchUnit$get$LSearchUnit$I = SearchUnit.get$LSearchUnit$I;
+
+/**
+ * @param {SearchUnit} $this
+ * @return {!number}
+ */
+SearchUnit.size$LSearchUnit$ = function ($this) {
+ return $this._size;
+};
+
+var SearchUnit$size$LSearchUnit$ = SearchUnit.size$LSearchUnit$;
+
+/**
+ * @param {SearchUnit} $this
+ * @param {SearchUnit} rhs
+ */
+SearchUnit.merge$LSearchUnit$LSearchUnit$ = function ($this, rhs) {
+ /** @type {!string} */
+ var position;
+ /** @type {Position} */
+ var pos;
+ for (position in rhs.positions) {
+ pos = rhs.positions[position];
+ SearchUnit$addPosition$LSearchUnit$SIB($this, pos.word, pos.position, pos.stemmed);
+ }
+};
+
+var SearchUnit$merge$LSearchUnit$LSearchUnit$ = SearchUnit.merge$LSearchUnit$LSearchUnit$;
+
+/**
+ * @param {SearchUnit} $this
+ * @return {Array.<undefined|Position>}
+ */
+SearchUnit.getPositions$LSearchUnit$ = function ($this) {
+ /** @type {Array.<undefined|Position>} */
+ var result;
+ /** @type {!string} */
+ var pos;
+ result = [ ];
+ for (pos in $this.positions) {
+ result.push($this.positions[pos]);
+ }
+ result.sort((function (a, b) {
+ return a.position - b.position;
+ }));
+ return result;
+};
+
+var SearchUnit$getPositions$LSearchUnit$ = SearchUnit.getPositions$LSearchUnit$;
+
+/**
+ * class SingleResult extends Object
+ * @constructor
+ */
+function SingleResult() {
+}
+
+/**
+ * @constructor
+ */
+function SingleResult$() {
+ this.units = [ ];
+ this.unitIds = [ ];
+ this.or = false;
+ this.not = false;
+ this.searchWord = '';
+};
+
+SingleResult$.prototype = new SingleResult;
+
+/**
+ * @constructor
+ * @param {!string} searchWord
+ * @param {!boolean} or
+ * @param {!boolean} not
+ */
+function SingleResult$SBB(searchWord, or, not) {
+ this.units = [ ];
+ this.unitIds = [ ];
+ this.or = or;
+ this.not = not;
+ this.searchWord = searchWord;
+};
+
+SingleResult$SBB.prototype = new SingleResult;
+
+/**
+ * @param {SingleResult} $this
+ * @param {!number} unitId
+ * @return {SearchUnit}
+ */
+SingleResult.getSearchUnit$LSingleResult$I = function ($this, unitId) {
+ /** @type {!number} */
+ var existing;
+ /** @type {SearchUnit} */
+ var result;
+ existing = $this.unitIds.indexOf(unitId);
+ if (existing === -1) {
+ result = ({positions: ({ }), id: unitId, _size: 0, score: 0, startPosition: -1});
+ $this.units.push(result);
+ $this.unitIds.push(unitId);
+ } else {
+ result = $this.units[existing];
+ }
+ return result;
+};
+
+var SingleResult$getSearchUnit$LSingleResult$I = SingleResult.getSearchUnit$LSingleResult$I;
+
+/**
+ * @param {SingleResult} $this
+ * @param {SingleResult} rhs
+ * @return {SingleResult}
+ */
+SingleResult.merge$LSingleResult$LSingleResult$ = function ($this, rhs) {
+ /** @type {SingleResult} */
+ var result;
+ result = ({units: [ ], unitIds: [ ], or: false, not: false, searchWord: ''});
+ if (rhs.or) {
+ SingleResult$_orMerge$LSingleResult$LSingleResult$LSingleResult$($this, result, rhs);
+ } else {
+ if (rhs.not) {
+ SingleResult$_notMerge$LSingleResult$LSingleResult$LSingleResult$($this, result, rhs);
+ } else {
+ SingleResult$_andMerge$LSingleResult$LSingleResult$LSingleResult$($this, result, rhs);
+ }
+ }
+ return result;
+};
+
+var SingleResult$merge$LSingleResult$LSingleResult$ = SingleResult.merge$LSingleResult$LSingleResult$;
+
+/**
+ * @param {SingleResult} $this
+ * @return {!number}
+ */
+SingleResult.size$LSingleResult$ = function ($this) {
+ return ($this.units.length | 0);
+};
+
+var SingleResult$size$LSingleResult$ = SingleResult.size$LSingleResult$;
+
+/**
+ * @param {SingleResult} $this
+ * @param {SingleResult} result
+ * @param {SingleResult} rhs
+ */
+SingleResult._andMerge$LSingleResult$LSingleResult$LSingleResult$ = function ($this, result, rhs) {
+ /** @type {!number} */
+ var i;
+ /** @type {undefined|!number} */
+ var id;
+ /** @type {SearchUnit} */
+ var lhsSection;
+ for (i = 0; i < $this.unitIds.length; i++) {
+ id = $this.unitIds[i];
+ if (rhs.unitIds.indexOf(id) !== -1) {
+ lhsSection = $this.units[i];
+ result.unitIds.push(id);
+ result.units.push(lhsSection);
+ }
+ }
+};
+
+var SingleResult$_andMerge$LSingleResult$LSingleResult$LSingleResult$ = SingleResult._andMerge$LSingleResult$LSingleResult$LSingleResult$;
+
+/**
+ * @param {SingleResult} $this
+ * @param {SingleResult} result
+ * @param {SingleResult} rhs
+ */
+SingleResult._orMerge$LSingleResult$LSingleResult$LSingleResult$ = function ($this, result, rhs) {
+ /** @type {!number} */
+ var i;
+ /** @type {undefined|!number} */
+ var id;
+ /** @type {SearchUnit} */
+ var rhsSection;
+ /** @type {SearchUnit} */
+ var lhsSection;
+ /** @type {Array.<undefined|!number>} */
+ var unitIds$0;
+ /** @type {Array.<undefined|SearchUnit>} */
+ var units$0;
+ result.unitIds = (unitIds$0 = $this.unitIds).slice(0, unitIds$0.length);
+ result.units = (units$0 = $this.units).slice(0, units$0.length);
+ for (i = 0; i < rhs.unitIds.length; i++) {
+ id = rhs.unitIds[i];
+ rhsSection = rhs.units[i];
+ if (result.unitIds.indexOf(id) !== -1) {
+ lhsSection = result.units[result.unitIds.indexOf(id)];
+ SearchUnit$merge$LSearchUnit$LSearchUnit$(lhsSection, rhsSection);
+ } else {
+ result.unitIds.push(id);
+ result.units.push(rhsSection);
+ }
+ }
+};
+
+var SingleResult$_orMerge$LSingleResult$LSingleResult$LSingleResult$ = SingleResult._orMerge$LSingleResult$LSingleResult$LSingleResult$;
+
+/**
+ * @param {SingleResult} $this
+ * @param {SingleResult} result
+ * @param {SingleResult} rhs
+ */
+SingleResult._notMerge$LSingleResult$LSingleResult$LSingleResult$ = function ($this, result, rhs) {
+ /** @type {!number} */
+ var i;
+ /** @type {undefined|!number} */
+ var id;
+ /** @type {SearchUnit} */
+ var lhsSection;
+ for (i = 0; i < $this.unitIds.length; i++) {
+ id = $this.unitIds[i];
+ if (rhs.unitIds.indexOf(id) === -1) {
+ lhsSection = $this.units[i];
+ result.unitIds.push(id);
+ result.units.push(lhsSection);
+ }
+ }
+};
+
+var SingleResult$_notMerge$LSingleResult$LSingleResult$LSingleResult$ = SingleResult._notMerge$LSingleResult$LSingleResult$LSingleResult$;
+
+/**
+ * class SearchSummary extends Object
+ * @constructor
+ */
+function SearchSummary() {
+}
+
+/**
+ * @constructor
+ */
+function SearchSummary$() {
+ this.sourceResults = [ ];
+ this.result = null;
+ this.oktavia = null;
+};
+
+SearchSummary$.prototype = new SearchSummary;
+
+/**
+ * @constructor
+ * @param {Oktavia} oktavia
+ */
+function SearchSummary$LOktavia$(oktavia) {
+ this.sourceResults = [ ];
+ this.result = null;
+ this.oktavia = oktavia;
+};
+
+SearchSummary$LOktavia$.prototype = new SearchSummary;
+
+/**
+ * @param {SearchSummary} $this
+ * @param {SingleResult} result
+ */
+SearchSummary.addQuery$LSearchSummary$LSingleResult$ = function ($this, result) {
+ $this.sourceResults.push(result);
+};
+
+var SearchSummary$addQuery$LSearchSummary$LSingleResult$ = SearchSummary.addQuery$LSearchSummary$LSingleResult$;
+
+/**
+ * @param {SearchSummary} $this
+ */
+SearchSummary.mergeResult$LSearchSummary$ = function ($this) {
+ $this.result = SearchSummary$mergeResult$LSearchSummary$ALSingleResult$($this, $this.sourceResults);
+};
+
+var SearchSummary$mergeResult$LSearchSummary$ = SearchSummary.mergeResult$LSearchSummary$;
+
+/**
+ * @param {SearchSummary} $this
+ * @param {Array.<undefined|SingleResult>} results
+ * @return {SingleResult}
+ */
+SearchSummary.mergeResult$LSearchSummary$ALSingleResult$ = function ($this, results) {
+ /** @type {SingleResult} */
+ var rhs;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var results$len$0;
+ rhs = results[0];
+ for ((i = 1, results$len$0 = results.length); i < results$len$0; i++) {
+ rhs = SingleResult$merge$LSingleResult$LSingleResult$(rhs, results[i]);
+ }
+ return rhs;
+};
+
+var SearchSummary$mergeResult$LSearchSummary$ALSingleResult$ = SearchSummary.mergeResult$LSearchSummary$ALSingleResult$;
+
+/**
+ * @param {SearchSummary} $this
+ * @return {Array.<undefined|Proposal>}
+ */
+SearchSummary.getProposal$LSearchSummary$ = function ($this) {
+ /** @type {Array.<undefined|Proposal>} */
+ var proposals;
+ /** @type {!number} */
+ var i;
+ /** @type {Array.<undefined|SingleResult>} */
+ var tmpSource;
+ /** @type {!number} */
+ var j;
+ /** @type {SingleResult} */
+ var result;
+ proposals = [ ];
+ for (i = 0; i < $this.sourceResults.length; i++) {
+ tmpSource = [ ];
+ for (j = 0; j < $this.sourceResults.length; j++) {
+ if (i !== j) {
+ tmpSource.push($this.sourceResults[j]);
+ }
+ }
+ result = SearchSummary$mergeResult$LSearchSummary$ALSingleResult$($this, tmpSource);
+ proposals.push(({omit: i, expect: result.units.length}));
+ }
+ proposals.sort((function (a, b) {
+ return b.expect - a.expect;
+ }));
+ return proposals;
+};
+
+var SearchSummary$getProposal$LSearchSummary$ = SearchSummary.getProposal$LSearchSummary$;
+
+/**
+ * @param {SearchSummary} $this
+ * @return {Array.<undefined|SearchUnit>}
+ */
+SearchSummary.getSortedResult$LSearchSummary$ = function ($this) {
+ /** @type {Array.<undefined|SearchUnit>} */
+ var result;
+ /** @type {Array.<undefined|SearchUnit>} */
+ var units$0;
+ result = (units$0 = $this.result.units).slice(0, units$0.length);
+ result.sort((function (a, b) {
+ return b.score - a.score;
+ }));
+ return result;
+};
+
+var SearchSummary$getSortedResult$LSearchSummary$ = SearchSummary.getSortedResult$LSearchSummary$;
+
+/**
+ * @param {SearchSummary} $this
+ * @return {!number}
+ */
+SearchSummary.size$LSearchSummary$ = function ($this) {
+ /** @type {SingleResult} */
+ var this$0;
+ this$0 = $this.result;
+ return (this$0.units.length | 0);
+};
+
+var SearchSummary$size$LSearchSummary$ = SearchSummary.size$LSearchSummary$;
+
+/**
+ * @param {SearchSummary} $this
+ * @param {SingleResult} result
+ */
+SearchSummary.add$LSearchSummary$LSingleResult$ = function ($this, result) {
+ $this.sourceResults.push(result);
+};
+
+var SearchSummary$add$LSearchSummary$LSingleResult$ = SearchSummary.add$LSearchSummary$LSingleResult$;
+
+/**
+ * class Style extends Object
+ * @constructor
+ */
+function Style() {
+}
+
+/**
+ * @constructor
+ * @param {!string} mode
+ */
+function Style$S(mode) {
+ this.styles = null;
+ this.escapeHTML = false;
+ switch (mode) {
+ case 'console':
+ this.styles = Style.console;
+ break;
+ case 'html':
+ this.styles = Style.html;
+ break;
+ case 'ignore':
+ this.styles = Style.ignore;
+ break;
+ default:
+ this.styles = Style.ignore;
+ break;
+ }
+ this.escapeHTML = mode === 'html';
+};
+
+Style$S.prototype = new Style;
+
+/**
+ * @param {!string} source
+ * @return {!string}
+ */
+Style.prototype.convert$S = function (source) {
+ /** @type {_HTMLHandler} */
+ var handler;
+ /** @type {SAXParser} */
+ var parser;
+ handler = new _HTMLHandler$HASB(this.styles, this.escapeHTML);
+ parser = new SAXParser$LSAXHandler$(handler);
+ parser.parse$S(source);
+ return handler.text.join('');
+};
+
+/**
+ * class Stemmer
+ * @constructor
+ */
+function Stemmer() {
+}
+
+Stemmer.prototype.$__jsx_implements_Stemmer = true;
+
+/**
+ * @constructor
+ */
+function Stemmer$() {
+};
+
+Stemmer$.prototype = new Stemmer;
+
+/**
+ * class BaseStemmer extends Object
+ * @constructor
+ */
+function BaseStemmer() {
+}
+
+$__jsx_merge_interface(BaseStemmer, Stemmer);
+
+/**
+ * @constructor
+ */
+function BaseStemmer$() {
+ /** @type {!string} */
+ var current$0;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var limit$0;
+ this.cache = ({ });
+ current$0 = this.current = "";
+ cursor$0 = this.cursor = 0;
+ limit$0 = this.limit = current$0.length;
+ this.limit_backward = 0;
+ this.bra = cursor$0;
+ this.ket = limit$0;
+};
+
+BaseStemmer$.prototype = new BaseStemmer;
+
+/**
+ * @param {!string} value
+ */
+BaseStemmer.prototype.setCurrent$S = function (value) {
+ /** @type {!string} */
+ var current$0;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var limit$0;
+ current$0 = this.current = value;
+ cursor$0 = this.cursor = 0;
+ limit$0 = this.limit = current$0.length;
+ this.limit_backward = 0;
+ this.bra = cursor$0;
+ this.ket = limit$0;
+};
+
+/**
+ * @return {!string}
+ */
+BaseStemmer.prototype.getCurrent$ = function () {
+ return this.current;
+};
+
+/**
+ * @param {BaseStemmer} other
+ */
+BaseStemmer.prototype.copy_from$LBaseStemmer$ = function (other) {
+ this.current = other.current;
+ this.cursor = other.cursor;
+ this.limit = other.limit;
+ this.limit_backward = other.limit_backward;
+ this.bra = other.bra;
+ this.ket = other.ket;
+};
+
+/**
+ * @param {Array.<undefined|!number>} s
+ * @param {!number} min
+ * @param {!number} max
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.in_grouping$AIII = function (s, min, max) {
+ /** @type {!number} */
+ var ch;
+ if (this.cursor >= this.limit) {
+ return false;
+ }
+ ch = this.current.charCodeAt(this.cursor);
+ if (ch > max || ch < min) {
+ return false;
+ }
+ ch -= min;
+ if ((s[ch >>> 3] & 0x1 << (ch & 0x7)) === 0) {
+ return false;
+ }
+ this.cursor++;
+ return true;
+};
+
+/**
+ * @param {Array.<undefined|!number>} s
+ * @param {!number} min
+ * @param {!number} max
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.in_grouping_b$AIII = function (s, min, max) {
+ /** @type {!number} */
+ var ch;
+ if (this.cursor <= this.limit_backward) {
+ return false;
+ }
+ ch = this.current.charCodeAt(this.cursor - 1);
+ if (ch > max || ch < min) {
+ return false;
+ }
+ ch -= min;
+ if ((s[ch >>> 3] & 0x1 << (ch & 0x7)) === 0) {
+ return false;
+ }
+ this.cursor--;
+ return true;
+};
+
+/**
+ * @param {Array.<undefined|!number>} s
+ * @param {!number} min
+ * @param {!number} max
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.out_grouping$AIII = function (s, min, max) {
+ /** @type {!number} */
+ var ch;
+ if (this.cursor >= this.limit) {
+ return false;
+ }
+ ch = this.current.charCodeAt(this.cursor);
+ if (ch > max || ch < min) {
+ this.cursor++;
+ return true;
+ }
+ ch -= min;
+ if ((s[ch >>> 3] & 0X1 << (ch & 0x7)) === 0) {
+ this.cursor++;
+ return true;
+ }
+ return false;
+};
+
+/**
+ * @param {Array.<undefined|!number>} s
+ * @param {!number} min
+ * @param {!number} max
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.out_grouping_b$AIII = function (s, min, max) {
+ /** @type {!number} */
+ var ch;
+ if (this.cursor <= this.limit_backward) {
+ return false;
+ }
+ ch = this.current.charCodeAt(this.cursor - 1);
+ if (ch > max || ch < min) {
+ this.cursor--;
+ return true;
+ }
+ ch -= min;
+ if ((s[ch >>> 3] & 0x1 << (ch & 0x7)) === 0) {
+ this.cursor--;
+ return true;
+ }
+ return false;
+};
+
+/**
+ * @param {!number} min
+ * @param {!number} max
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.in_range$II = function (min, max) {
+ /** @type {!number} */
+ var ch;
+ if (this.cursor >= this.limit) {
+ return false;
+ }
+ ch = this.current.charCodeAt(this.cursor);
+ if (ch > max || ch < min) {
+ return false;
+ }
+ this.cursor++;
+ return true;
+};
+
+/**
+ * @param {!number} min
+ * @param {!number} max
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.in_range_b$II = function (min, max) {
+ /** @type {!number} */
+ var ch;
+ if (this.cursor <= this.limit_backward) {
+ return false;
+ }
+ ch = this.current.charCodeAt(this.cursor - 1);
+ if (ch > max || ch < min) {
+ return false;
+ }
+ this.cursor--;
+ return true;
+};
+
+/**
+ * @param {!number} min
+ * @param {!number} max
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.out_range$II = function (min, max) {
+ /** @type {!number} */
+ var ch;
+ if (this.cursor >= this.limit) {
+ return false;
+ }
+ ch = this.current.charCodeAt(this.cursor);
+ if (! (ch > max || ch < min)) {
+ return false;
+ }
+ this.cursor++;
+ return true;
+};
+
+/**
+ * @param {!number} min
+ * @param {!number} max
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.out_range_b$II = function (min, max) {
+ /** @type {!number} */
+ var ch;
+ if (this.cursor <= this.limit_backward) {
+ return false;
+ }
+ ch = this.current.charCodeAt(this.cursor - 1);
+ if (! (ch > max || ch < min)) {
+ return false;
+ }
+ this.cursor--;
+ return true;
+};
+
+/**
+ * @param {!number} s_size
+ * @param {!string} s
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.eq_s$IS = function (s_size, s) {
+ /** @type {!number} */
+ var cursor$0;
+ if (this.limit - this.cursor < s_size) {
+ return false;
+ }
+ if (this.current.slice(cursor$0 = this.cursor, cursor$0 + s_size) !== s) {
+ return false;
+ }
+ this.cursor += s_size;
+ return true;
+};
+
+/**
+ * @param {!number} s_size
+ * @param {!string} s
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.eq_s_b$IS = function (s_size, s) {
+ /** @type {!number} */
+ var cursor$0;
+ if (this.cursor - this.limit_backward < s_size) {
+ return false;
+ }
+ if (this.current.slice((cursor$0 = this.cursor) - s_size, cursor$0) !== s) {
+ return false;
+ }
+ this.cursor -= s_size;
+ return true;
+};
+
+/**
+ * @param {!string} s
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.eq_v$S = function (s) {
+ return this.eq_s$IS(s.length, s);
+};
+
+/**
+ * @param {!string} s
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.eq_v_b$S = function (s) {
+ return this.eq_s_b$IS(s.length, s);
+};
+
+/**
+ * @param {Array.<undefined|Among>} v
+ * @param {!number} v_size
+ * @return {!number}
+ */
+BaseStemmer.prototype.find_among$ALAmong$I = function (v, v_size) {
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var j;
+ /** @type {!number} */
+ var c;
+ /** @type {!number} */
+ var l;
+ /** @type {!number} */
+ var common_i;
+ /** @type {!number} */
+ var common_j;
+ /** @type {!boolean} */
+ var first_key_inspected;
+ /** @type {!number} */
+ var k;
+ /** @type {!number} */
+ var diff;
+ /** @type {!number} */
+ var common;
+ /** @type {Among} */
+ var w;
+ /** @type {!number} */
+ var i2;
+ /** @type {!boolean} */
+ var res;
+ i = 0;
+ j = v_size;
+ c = this.cursor;
+ l = this.limit;
+ common_i = 0;
+ common_j = 0;
+ first_key_inspected = false;
+ while (true) {
+ k = i + (j - i >>> 1);
+ diff = 0;
+ common = (common_i < common_j ? common_i : common_j);
+ w = v[k];
+ for (i2 = common; i2 < w.s_size; i2++) {
+ if (c + common === l) {
+ diff = -1;
+ break;
+ }
+ diff = this.current.charCodeAt(c + common) - w.s.charCodeAt(i2);
+ if (diff !== 0) {
+ break;
+ }
+ common++;
+ }
+ if (diff < 0) {
+ j = k;
+ common_j = common;
+ } else {
+ i = k;
+ common_i = common;
+ }
+ if (j - i <= 1) {
+ if (i > 0) {
+ break;
+ }
+ if (j === i) {
+ break;
+ }
+ if (first_key_inspected) {
+ break;
+ }
+ first_key_inspected = true;
+ }
+ }
+ while (true) {
+ w = v[i];
+ if (common_i >= w.s_size) {
+ this.cursor = (c + w.s_size | 0);
+ if (w.method == null) {
+ return w.result;
+ }
+ res = w.method(w.instance);
+ this.cursor = (c + w.s_size | 0);
+ if (res) {
+ return w.result;
+ }
+ }
+ i = w.substring_i;
+ if (i < 0) {
+ return 0;
+ }
+ }
+ return -1;
+};
+
+/**
+ * @param {Array.<undefined|Among>} v
+ * @param {!number} v_size
+ * @return {!number}
+ */
+BaseStemmer.prototype.find_among_b$ALAmong$I = function (v, v_size) {
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var j;
+ /** @type {!number} */
+ var c;
+ /** @type {!number} */
+ var lb;
+ /** @type {!number} */
+ var common_i;
+ /** @type {!number} */
+ var common_j;
+ /** @type {!boolean} */
+ var first_key_inspected;
+ /** @type {!number} */
+ var k;
+ /** @type {!number} */
+ var diff;
+ /** @type {!number} */
+ var common;
+ /** @type {Among} */
+ var w;
+ /** @type {!number} */
+ var i2;
+ /** @type {!boolean} */
+ var res;
+ i = 0;
+ j = v_size;
+ c = this.cursor;
+ lb = this.limit_backward;
+ common_i = 0;
+ common_j = 0;
+ first_key_inspected = false;
+ while (true) {
+ k = i + (j - i >> 1);
+ diff = 0;
+ common = (common_i < common_j ? common_i : common_j);
+ w = v[k];
+ for (i2 = w.s_size - 1 - common; i2 >= 0; i2--) {
+ if (c - common === lb) {
+ diff = -1;
+ break;
+ }
+ diff = this.current.charCodeAt(c - 1 - common) - w.s.charCodeAt(i2);
+ if (diff !== 0) {
+ break;
+ }
+ common++;
+ }
+ if (diff < 0) {
+ j = k;
+ common_j = common;
+ } else {
+ i = k;
+ common_i = common;
+ }
+ if (j - i <= 1) {
+ if (i > 0) {
+ break;
+ }
+ if (j === i) {
+ break;
+ }
+ if (first_key_inspected) {
+ break;
+ }
+ first_key_inspected = true;
+ }
+ }
+ while (true) {
+ w = v[i];
+ if (common_i >= w.s_size) {
+ this.cursor = (c - w.s_size | 0);
+ if (w.method == null) {
+ return w.result;
+ }
+ res = w.method(this);
+ this.cursor = (c - w.s_size | 0);
+ if (res) {
+ return w.result;
+ }
+ }
+ i = w.substring_i;
+ if (i < 0) {
+ return 0;
+ }
+ }
+ return -1;
+};
+
+/**
+ * @param {!number} c_bra
+ * @param {!number} c_ket
+ * @param {!string} s
+ * @return {!number}
+ */
+BaseStemmer.prototype.replace_s$IIS = function (c_bra, c_ket, s) {
+ /** @type {!number} */
+ var adjustment;
+ adjustment = s.length - (c_ket - c_bra);
+ this.current = this.current.slice(0, c_bra) + s + this.current.slice(c_ket);
+ this.limit += (adjustment | 0);
+ if (this.cursor >= c_ket) {
+ this.cursor += (adjustment | 0);
+ } else {
+ if (this.cursor > c_bra) {
+ this.cursor = c_bra;
+ }
+ }
+ return (adjustment | 0);
+};
+
+/**
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.slice_check$ = function () {
+ /** @type {!number} */
+ var bra$0;
+ /** @type {!number} */
+ var ket$0;
+ /** @type {!number} */
+ var limit$0;
+ return ((bra$0 = this.bra) < 0 || bra$0 > (ket$0 = this.ket) || ket$0 > (limit$0 = this.limit) || limit$0 > this.current.length ? false : true);
+};
+
+/**
+ * @param {!string} s
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.slice_from$S = function (s) {
+ /** @type {!boolean} */
+ var result;
+ /** @type {!number} */
+ var bra$0;
+ /** @type {!number} */
+ var ket$0;
+ /** @type {!number} */
+ var limit$0;
+ result = false;
+ if ((bra$0 = this.bra) < 0 || bra$0 > (ket$0 = this.ket) || ket$0 > (limit$0 = this.limit) || limit$0 > this.current.length ? false : true) {
+ this.replace_s$IIS(this.bra, this.ket, s);
+ result = true;
+ }
+ return result;
+};
+
+/**
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.slice_del$ = function () {
+ return this.slice_from$S("");
+};
+
+/**
+ * @param {!number} c_bra
+ * @param {!number} c_ket
+ * @param {!string} s
+ */
+BaseStemmer.prototype.insert$IIS = function (c_bra, c_ket, s) {
+ /** @type {!number} */
+ var adjustment;
+ adjustment = this.replace_s$IIS(c_bra, c_ket, s);
+ if (c_bra <= this.bra) {
+ this.bra += (adjustment | 0);
+ }
+ if (c_bra <= this.ket) {
+ this.ket += (adjustment | 0);
+ }
+};
+
+/**
+ * @param {!string} s
+ * @return {!string}
+ */
+BaseStemmer.prototype.slice_to$S = function (s) {
+ /** @type {!string} */
+ var result;
+ /** @type {!number} */
+ var bra$0;
+ /** @type {!number} */
+ var ket$0;
+ /** @type {!number} */
+ var limit$0;
+ result = '';
+ if ((bra$0 = this.bra) < 0 || bra$0 > (ket$0 = this.ket) || ket$0 > (limit$0 = this.limit) || limit$0 > this.current.length ? false : true) {
+ result = this.current.slice(this.bra, this.ket);
+ }
+ return result;
+};
+
+/**
+ * @param {!string} s
+ * @return {!string}
+ */
+BaseStemmer.prototype.assign_to$S = function (s) {
+ return this.current.slice(0, this.limit);
+};
+
+/**
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.stem$ = function () {
+ return false;
+};
+
+/**
+ * @param {!string} word
+ * @return {!string}
+ */
+BaseStemmer.prototype.stemWord$S = function (word) {
+ /** @type {undefined|!string} */
+ var result;
+ /** @type {!string} */
+ var current$0;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var limit$0;
+ result = this.cache['.' + word];
+ if (result == null) {
+ current$0 = this.current = word;
+ cursor$0 = this.cursor = 0;
+ limit$0 = this.limit = current$0.length;
+ this.limit_backward = 0;
+ this.bra = cursor$0;
+ this.ket = limit$0;
+ this.stem$();
+ result = this.current;
+ this.cache['.' + word] = result;
+ }
+ return result;
+};
+
+/**
+ * @param {Array.<undefined|!string>} words
+ * @return {Array.<undefined|!string>}
+ */
+BaseStemmer.prototype.stemWords$AS = function (words) {
+ /** @type {Array.<undefined|!string>} */
+ var results;
+ /** @type {!number} */
+ var i;
+ /** @type {undefined|!string} */
+ var word;
+ /** @type {undefined|!string} */
+ var result;
+ /** @type {!string} */
+ var current$0;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var limit$0;
+ results = [ ];
+ for (i = 0; i < words.length; i++) {
+ word = words[i];
+ result = this.cache['.' + word];
+ if (result == null) {
+ current$0 = this.current = word;
+ cursor$0 = this.cursor = 0;
+ limit$0 = this.limit = current$0.length;
+ this.limit_backward = 0;
+ this.bra = cursor$0;
+ this.ket = limit$0;
+ this.stem$();
+ result = this.current;
+ this.cache['.' + word] = result;
+ }
+ results.push(result);
+ }
+ return results;
+};
+
+/**
+ * class HungarianStemmer extends BaseStemmer
+ * @constructor
+ */
+function HungarianStemmer() {
+}
+
+HungarianStemmer.prototype = new BaseStemmer;
+/**
+ * @constructor
+ */
+function HungarianStemmer$() {
+ BaseStemmer$.call(this);
+ this.I_p1 = 0;
+};
+
+HungarianStemmer$.prototype = new HungarianStemmer;
+
+/**
+ * @param {HungarianStemmer} other
+ */
+HungarianStemmer.prototype.copy_from$LHungarianStemmer$ = function (other) {
+ this.I_p1 = other.I_p1;
+ BaseStemmer.prototype.copy_from$LBaseStemmer$.call(this, other);
+};
+
+/**
+ * @return {!boolean}
+ */
+HungarianStemmer.prototype.r_mark_regions$ = function () {
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var v_3;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!boolean} */
+ var lab3;
+ /** @type {!boolean} */
+ var lab4;
+ /** @type {!boolean} */
+ var lab5;
+ /** @type {!boolean} */
+ var lab7;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var cursor$1;
+ this.I_p1 = this.limit;
+ lab0 = true;
+lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ v_1 = this.cursor;
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ if (! this.in_grouping$AIII(HungarianStemmer.g_v, 97, 252)) {
+ break lab1;
+ }
+ golab2:
+ while (true) {
+ v_2 = this.cursor;
+ lab3 = true;
+ lab3:
+ while (lab3 === true) {
+ lab3 = false;
+ if (! this.out_grouping$AIII(HungarianStemmer.g_v, 97, 252)) {
+ break lab3;
+ }
+ this.cursor = v_2;
+ break golab2;
+ }
+ cursor$0 = this.cursor = v_2;
+ if (cursor$0 >= this.limit) {
+ break lab1;
+ }
+ this.cursor++;
+ }
+ lab4 = true;
+ lab4:
+ while (lab4 === true) {
+ lab4 = false;
+ v_3 = this.cursor;
+ lab5 = true;
+ lab5:
+ while (lab5 === true) {
+ lab5 = false;
+ if (this.find_among$ALAmong$I(HungarianStemmer.a_0, 8) === 0) {
+ break lab5;
+ }
+ break lab4;
+ }
+ cursor$1 = this.cursor = v_3;
+ if (cursor$1 >= this.limit) {
+ break lab1;
+ }
+ this.cursor++;
+ }
+ this.I_p1 = this.cursor;
+ break lab0;
+ }
+ this.cursor = v_1;
+ if (! this.out_grouping$AIII(HungarianStemmer.g_v, 97, 252)) {
+ return false;
+ }
+ golab6:
+ while (true) {
+ lab7 = true;
+ lab7:
+ while (lab7 === true) {
+ lab7 = false;
+ if (! this.in_grouping$AIII(HungarianStemmer.g_v, 97, 252)) {
+ break lab7;
+ }
+ break golab6;
+ }
+ if (this.cursor >= this.limit) {
+ return false;
+ }
+ this.cursor++;
+ }
+ this.I_p1 = this.cursor;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+HungarianStemmer.prototype.r_R1$ = function () {
+ return (! (this.I_p1 <= this.cursor) ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+HungarianStemmer.prototype.r_v_ending$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var cursor$0;
+ this.ket = this.cursor;
+ among_var = this.find_among_b$ALAmong$I(HungarianStemmer.a_1, 2);
+ if (among_var === 0) {
+ return false;
+ }
+ this.bra = cursor$0 = this.cursor;
+ if (! (! (this.I_p1 <= cursor$0) ? false : true)) {
+ return false;
+ }
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ if (! this.slice_from$S("a")) {
+ return false;
+ }
+ break;
+ case 2:
+ if (! this.slice_from$S("e")) {
+ return false;
+ }
+ break;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+HungarianStemmer.prototype.r_double$ = function () {
+ /** @type {!number} */
+ var v_1;
+ v_1 = this.limit - this.cursor;
+ if (this.find_among_b$ALAmong$I(HungarianStemmer.a_2, 23) === 0) {
+ return false;
+ }
+ this.cursor = this.limit - v_1;
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+HungarianStemmer.prototype.r_undouble$ = function () {
+ /** @type {!number} */
+ var c;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var cursor$1;
+ if (this.cursor <= this.limit_backward) {
+ return false;
+ }
+ this.cursor--;
+ this.ket = cursor$0 = this.cursor;
+ c = (cursor$0 - 1 | 0);
+ if (this.limit_backward > c || c > this.limit) {
+ return false;
+ }
+ cursor$1 = this.cursor = c;
+ this.bra = cursor$1;
+ return (! this.slice_from$S("") ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+HungarianStemmer.prototype.r_instrum$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var cursor$0;
+ this.ket = this.cursor;
+ among_var = this.find_among_b$ALAmong$I(HungarianStemmer.a_3, 2);
+ if (among_var === 0) {
+ return false;
+ }
+ this.bra = cursor$0 = this.cursor;
+ if (! (! (this.I_p1 <= cursor$0) ? false : true)) {
+ return false;
+ }
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ if (! this.r_double$()) {
+ return false;
+ }
+ break;
+ case 2:
+ if (! this.r_double$()) {
+ return false;
+ }
+ break;
+ }
+ return (! this.slice_from$S("") ? false : ! this.r_undouble$() ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+HungarianStemmer.prototype.r_case$ = function () {
+ /** @type {!number} */
+ var cursor$0;
+ this.ket = this.cursor;
+ if (this.find_among_b$ALAmong$I(HungarianStemmer.a_4, 44) === 0) {
+ return false;
+ }
+ this.bra = cursor$0 = this.cursor;
+ return (! (! (this.I_p1 <= cursor$0) ? false : true) ? false : ! this.slice_from$S("") ? false : ! this.r_v_ending$() ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+HungarianStemmer.prototype.r_case_special$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var cursor$0;
+ this.ket = this.cursor;
+ among_var = this.find_among_b$ALAmong$I(HungarianStemmer.a_5, 3);
+ if (among_var === 0) {
+ return false;
+ }
+ this.bra = cursor$0 = this.cursor;
+ if (! (! (this.I_p1 <= cursor$0) ? false : true)) {
+ return false;
+ }
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ if (! this.slice_from$S("e")) {
+ return false;
+ }
+ break;
+ case 2:
+ if (! this.slice_from$S("a")) {
+ return false;
+ }
+ break;
+ case 3:
+ if (! this.slice_from$S("a")) {
+ return false;
+ }
+ break;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+HungarianStemmer.prototype.r_case_other$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var cursor$0;
+ this.ket = this.cursor;
+ among_var = this.find_among_b$ALAmong$I(HungarianStemmer.a_6, 6);
+ if (among_var === 0) {
+ return false;
+ }
+ this.bra = cursor$0 = this.cursor;
+ if (! (! (this.I_p1 <= cursor$0) ? false : true)) {
+ return false;
+ }
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 2:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 3:
+ if (! this.slice_from$S("a")) {
+ return false;
+ }
+ break;
+ case 4:
+ if (! this.slice_from$S("e")) {
+ return false;
+ }
+ break;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+HungarianStemmer.prototype.r_factive$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var cursor$0;
+ this.ket = this.cursor;
+ among_var = this.find_among_b$ALAmong$I(HungarianStemmer.a_7, 2);
+ if (among_var === 0) {
+ return false;
+ }
+ this.bra = cursor$0 = this.cursor;
+ if (! (! (this.I_p1 <= cursor$0) ? false : true)) {
+ return false;
+ }
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ if (! this.r_double$()) {
+ return false;
+ }
+ break;
+ case 2:
+ if (! this.r_double$()) {
+ return false;
+ }
+ break;
+ }
+ return (! this.slice_from$S("") ? false : ! this.r_undouble$() ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+HungarianStemmer.prototype.r_plural$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var cursor$0;
+ this.ket = this.cursor;
+ among_var = this.find_among_b$ALAmong$I(HungarianStemmer.a_8, 7);
+ if (among_var === 0) {
+ return false;
+ }
+ this.bra = cursor$0 = this.cursor;
+ if (! (! (this.I_p1 <= cursor$0) ? false : true)) {
+ return false;
+ }
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ if (! this.slice_from$S("a")) {
+ return false;
+ }
+ break;
+ case 2:
+ if (! this.slice_from$S("e")) {
+ return false;
+ }
+ break;
+ case 3:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 4:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 5:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 6:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 7:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+HungarianStemmer.prototype.r_owned$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var cursor$0;
+ this.ket = this.cursor;
+ among_var = this.find_among_b$ALAmong$I(HungarianStemmer.a_9, 12);
+ if (among_var === 0) {
+ return false;
+ }
+ this.bra = cursor$0 = this.cursor;
+ if (! (! (this.I_p1 <= cursor$0) ? false : true)) {
+ return false;
+ }
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 2:
+ if (! this.slice_from$S("e")) {
+ return false;
+ }
+ break;
+ case 3:
+ if (! this.slice_from$S("a")) {
+ return false;
+ }
+ break;
+ case 4:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 5:
+ if (! this.slice_from$S("e")) {
+ return false;
+ }
+ break;
+ case 6:
+ if (! this.slice_from$S("a")) {
+ return false;
+ }
+ break;
+ case 7:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 8:
+ if (! this.slice_from$S("e")) {
+ return false;
+ }
+ break;
+ case 9:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+HungarianStemmer.prototype.r_sing_owner$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var cursor$0;
+ this.ket = this.cursor;
+ among_var = this.find_among_b$ALAmong$I(HungarianStemmer.a_10, 31);
+ if (among_var === 0) {
+ return false;
+ }
+ this.bra = cursor$0 = this.cursor;
+ if (! (! (this.I_p1 <= cursor$0) ? false : true)) {
+ return false;
+ }
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 2:
+ if (! this.slice_from$S("a")) {
+ return false;
+ }
+ break;
+ case 3:
+ if (! this.slice_from$S("e")) {
+ return false;
+ }
+ break;
+ case 4:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 5:
+ if (! this.slice_from$S("a")) {
+ return false;
+ }
+ break;
+ case 6:
+ if (! this.slice_from$S("e")) {
+ return false;
+ }
+ break;
+ case 7:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 8:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 9:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 10:
+ if (! this.slice_from$S("a")) {
+ return false;
+ }
+ break;
+ case 11:
+ if (! this.slice_from$S("e")) {
+ return false;
+ }
+ break;
+ case 12:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 13:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 14:
+ if (! this.slice_from$S("a")) {
+ return false;
+ }
+ break;
+ case 15:
+ if (! this.slice_from$S("e")) {
+ return false;
+ }
+ break;
+ case 16:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 17:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 18:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 19:
+ if (! this.slice_from$S("a")) {
+ return false;
+ }
+ break;
+ case 20:
+ if (! this.slice_from$S("e")) {
+ return false;
+ }
+ break;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+HungarianStemmer.prototype.r_plur_owner$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var cursor$0;
+ this.ket = this.cursor;
+ among_var = this.find_among_b$ALAmong$I(HungarianStemmer.a_11, 42);
+ if (among_var === 0) {
+ return false;
+ }
+ this.bra = cursor$0 = this.cursor;
+ if (! (! (this.I_p1 <= cursor$0) ? false : true)) {
+ return false;
+ }
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 2:
+ if (! this.slice_from$S("a")) {
+ return false;
+ }
+ break;
+ case 3:
+ if (! this.slice_from$S("e")) {
+ return false;
+ }
+ break;
+ case 4:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 5:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 6:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 7:
+ if (! this.slice_from$S("a")) {
+ return false;
+ }
+ break;
+ case 8:
+ if (! this.slice_from$S("e")) {
+ return false;
+ }
+ break;
+ case 9:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 10:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 11:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 12:
+ if (! this.slice_from$S("a")) {
+ return false;
+ }
+ break;
+ case 13:
+ if (! this.slice_from$S("e")) {
+ return false;
+ }
+ break;
+ case 14:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 15:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 16:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 17:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 18:
+ if (! this.slice_from$S("a")) {
+ return false;
+ }
+ break;
+ case 19:
+ if (! this.slice_from$S("e")) {
+ return false;
+ }
+ break;
+ case 20:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 21:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 22:
+ if (! this.slice_from$S("a")) {
+ return false;
+ }
+ break;
+ case 23:
+ if (! this.slice_from$S("e")) {
+ return false;
+ }
+ break;
+ case 24:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 25:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 26:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 27:
+ if (! this.slice_from$S("a")) {
+ return false;
+ }
+ break;
+ case 28:
+ if (! this.slice_from$S("e")) {
+ return false;
+ }
+ break;
+ case 29:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+HungarianStemmer.prototype.stem$ = function () {
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var v_3;
+ /** @type {!number} */
+ var v_4;
+ /** @type {!number} */
+ var v_5;
+ /** @type {!number} */
+ var v_6;
+ /** @type {!number} */
+ var v_7;
+ /** @type {!number} */
+ var v_8;
+ /** @type {!number} */
+ var v_9;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!boolean} */
+ var lab2;
+ /** @type {!boolean} */
+ var lab3;
+ /** @type {!boolean} */
+ var lab4;
+ /** @type {!boolean} */
+ var lab5;
+ /** @type {!boolean} */
+ var lab6;
+ /** @type {!boolean} */
+ var lab7;
+ /** @type {!boolean} */
+ var lab8;
+ /** @type {!boolean} */
+ var lab9;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var limit$0;
+ /** @type {!number} */
+ var cursor$1;
+ /** @type {!number} */
+ var limit$1;
+ /** @type {!number} */
+ var cursor$2;
+ /** @type {!number} */
+ var limit$2;
+ /** @type {!number} */
+ var cursor$3;
+ /** @type {!number} */
+ var limit$3;
+ /** @type {!number} */
+ var cursor$4;
+ /** @type {!number} */
+ var limit$4;
+ /** @type {!number} */
+ var cursor$5;
+ /** @type {!number} */
+ var limit$5;
+ /** @type {!number} */
+ var cursor$6;
+ /** @type {!number} */
+ var limit$6;
+ /** @type {!number} */
+ var cursor$7;
+ /** @type {!number} */
+ var limit$7;
+ /** @type {!number} */
+ var cursor$8;
+ v_1 = this.cursor;
+ lab0 = true;
+lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ if (! this.r_mark_regions$()) {
+ break lab0;
+ }
+ }
+ cursor$0 = this.cursor = v_1;
+ this.limit_backward = cursor$0;
+ cursor$1 = this.cursor = limit$0 = this.limit;
+ v_2 = limit$0 - cursor$1;
+ lab1 = true;
+lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ if (! this.r_instrum$()) {
+ break lab1;
+ }
+ }
+ cursor$2 = this.cursor = (limit$1 = this.limit) - v_2;
+ v_3 = limit$1 - cursor$2;
+ lab2 = true;
+lab2:
+ while (lab2 === true) {
+ lab2 = false;
+ if (! this.r_case$()) {
+ break lab2;
+ }
+ }
+ cursor$3 = this.cursor = (limit$2 = this.limit) - v_3;
+ v_4 = limit$2 - cursor$3;
+ lab3 = true;
+lab3:
+ while (lab3 === true) {
+ lab3 = false;
+ if (! this.r_case_special$()) {
+ break lab3;
+ }
+ }
+ cursor$4 = this.cursor = (limit$3 = this.limit) - v_4;
+ v_5 = limit$3 - cursor$4;
+ lab4 = true;
+lab4:
+ while (lab4 === true) {
+ lab4 = false;
+ if (! this.r_case_other$()) {
+ break lab4;
+ }
+ }
+ cursor$5 = this.cursor = (limit$4 = this.limit) - v_5;
+ v_6 = limit$4 - cursor$5;
+ lab5 = true;
+lab5:
+ while (lab5 === true) {
+ lab5 = false;
+ if (! this.r_factive$()) {
+ break lab5;
+ }
+ }
+ cursor$6 = this.cursor = (limit$5 = this.limit) - v_6;
+ v_7 = limit$5 - cursor$6;
+ lab6 = true;
+lab6:
+ while (lab6 === true) {
+ lab6 = false;
+ if (! this.r_owned$()) {
+ break lab6;
+ }
+ }
+ cursor$7 = this.cursor = (limit$6 = this.limit) - v_7;
+ v_8 = limit$6 - cursor$7;
+ lab7 = true;
+lab7:
+ while (lab7 === true) {
+ lab7 = false;
+ if (! this.r_sing_owner$()) {
+ break lab7;
+ }
+ }
+ cursor$8 = this.cursor = (limit$7 = this.limit) - v_8;
+ v_9 = limit$7 - cursor$8;
+ lab8 = true;
+lab8:
+ while (lab8 === true) {
+ lab8 = false;
+ if (! this.r_plur_owner$()) {
+ break lab8;
+ }
+ }
+ this.cursor = this.limit - v_9;
+ lab9 = true;
+lab9:
+ while (lab9 === true) {
+ lab9 = false;
+ if (! this.r_plural$()) {
+ break lab9;
+ }
+ }
+ this.cursor = this.limit_backward;
+ return true;
+};
+
+/**
+ * @param {*} o
+ * @return {!boolean}
+ */
+HungarianStemmer.prototype.equals$X = function (o) {
+ return o instanceof HungarianStemmer;
+};
+
+/**
+ * @return {!number}
+ */
+HungarianStemmer.prototype.hashCode$ = function () {
+ /** @type {!string} */
+ var classname;
+ /** @type {!number} */
+ var hash;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var char;
+ classname = "HungarianStemmer";
+ hash = 0;
+ if ("HungarianStemmer".length === 0) {
+ return (hash | 0);
+ }
+ for (i = 0; i < classname.length; i++) {
+ char = classname.charCodeAt(i);
+ hash = (hash << 5) - hash + char;
+ hash = hash & hash;
+ }
+ return (hash | 0);
+};
+
+/**
+ * class Among extends Object
+ * @constructor
+ */
+function Among() {
+}
+
+/**
+ * @constructor
+ * @param {!string} s
+ * @param {!number} substring_i
+ * @param {!number} result
+ */
+function Among$SII(s, substring_i, result) {
+ this.s_size = s.length;
+ this.s = s;
+ this.substring_i = substring_i;
+ this.result = result;
+ this.method = null;
+ this.instance = null;
+};
+
+Among$SII.prototype = new Among;
+
+/**
+ * @constructor
+ * @param {!string} s
+ * @param {!number} substring_i
+ * @param {!number} result
+ * @param {*} method
+ * @param {BaseStemmer} instance
+ */
+function Among$SIIF$LBaseStemmer$B$LBaseStemmer$(s, substring_i, result, method, instance) {
+ this.s_size = s.length;
+ this.s = s;
+ this.substring_i = substring_i;
+ this.result = result;
+ this.method = method;
+ this.instance = instance;
+};
+
+Among$SIIF$LBaseStemmer$B$LBaseStemmer$.prototype = new Among;
+
+/**
+ * class Metadata extends Object
+ * @constructor
+ */
+function Metadata() {
+}
+
+/**
+ * @constructor
+ * @param {Oktavia} parent
+ */
+function Metadata$LOktavia$(parent) {
+ this._parent = parent;
+ this._bitVector = new BitVector$();
+};
+
+Metadata$LOktavia$.prototype = new Metadata;
+
+/**
+ * @return {!number}
+ */
+Metadata.prototype._size$ = function () {
+ /** @type {BitVector} */
+ var this$0;
+ /** @type {!number} */
+ var i$0;
+ /** @type {BitVector} */
+ var _bitVector$0;
+ this$0 = _bitVector$0 = this._bitVector;
+ i$0 = _bitVector$0._size;
+ return this$0.rank$IB(i$0, true);
+};
+
+/**
+ * @param {!number} index
+ * @return {!string}
+ */
+Metadata.prototype.getContent$I = function (index) {
+ /** @type {!number} */
+ var startPosition;
+ /** @type {!number} */
+ var length;
+ if (index < 0 || this._size$() <= index) {
+ throw new Error("Section.getContent() : range error " + (index + ""));
+ }
+ startPosition = 0;
+ if (index > 0) {
+ startPosition = this._bitVector.select$I(index - 1) + 1;
+ }
+ length = this._bitVector.select$I(index) - startPosition + 1;
+ return this._parent._getSubstring$II(startPosition, length);
+};
+
+/**
+ * @param {!number} index
+ * @return {!number}
+ */
+Metadata.prototype.getStartPosition$I = function (index) {
+ /** @type {!number} */
+ var startPosition;
+ if (index < 0 || this._size$() <= index) {
+ throw new Error("Section.getContent() : range error " + (index + ""));
+ }
+ startPosition = 0;
+ if (index > 0) {
+ startPosition = this._bitVector.select$I(index - 1) + 1;
+ }
+ return (startPosition | 0);
+};
+
+/**
+ * @param {SingleResult} result
+ * @param {Array.<undefined|!number>} positions
+ * @param {!string} word
+ * @param {!boolean} stemmed
+ */
+Metadata.prototype.grouping$LSingleResult$AISB = function (result, positions, word, stemmed) {
+};
+
+/**
+ * @param {!number} index
+ * @return {!string}
+ */
+Metadata.prototype.getInformation$I = function (index) {
+ return '';
+};
+
+/**
+ */
+Metadata.prototype._build$ = function () {
+ this._bitVector.build$();
+};
+
+/**
+ * @param {!string} name
+ * @param {!string} data
+ * @param {!number} offset
+ * @return {!number}
+ */
+Metadata.prototype._load$SSI = function (name, data, offset) {
+ offset = this._bitVector.load$SI(data, offset);
+ this._parent._metadataLabels.push(name);
+ this._parent._metadatas[name] = this;
+ return offset;
+};
+
+/**
+ * @return {!string}
+ */
+Metadata.prototype._dump$ = function () {
+ /** @type {BitVector} */
+ var this$0;
+ /** @type {Array.<undefined|!string>} */
+ var contents$0;
+ this$0 = this._bitVector;
+ contents$0 = [ ];
+ contents$0.push(Binary$dump32bitNumber$N(this$0._size));
+ contents$0.push(Binary$dump32bitNumberList$AN(this$0._v));
+ return contents$0.join('');
+};
+
+/**
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+Metadata.prototype._dump$LCompressionReport$ = function (report) {
+ /** @type {BitVector} */
+ var this$0;
+ /** @type {Array.<undefined|!string>} */
+ var contents$0;
+ this$0 = this._bitVector;
+ contents$0 = [ ];
+ contents$0.push(Binary$dump32bitNumber$N(this$0._size));
+ CompressionReport$add$LCompressionReport$II(report, 2, 2);
+ contents$0.push(Binary$dump32bitNumberList$ANLCompressionReport$(this$0._v, report));
+ return contents$0.join('');
+};
+
+/**
+ * class Section extends Metadata
+ * @constructor
+ */
+function Section() {
+}
+
+Section.prototype = new Metadata;
+/**
+ * @constructor
+ * @param {Oktavia} parent
+ */
+function Section$LOktavia$(parent) {
+ this._parent = parent;
+ this._bitVector = new BitVector$();
+ this._names = [ ];
+};
+
+Section$LOktavia$.prototype = new Section;
+
+/**
+ * @param {!string} name
+ */
+Section.prototype.setTail$S = function (name) {
+ /** @type {!number} */
+ var index$0;
+ /** @type {Oktavia} */
+ var this$0;
+ /** @type {FMIndex} */
+ var this$0$0;
+ this$0 = this._parent;
+ this$0$0 = this$0._fmindex;
+ index$0 = this$0$0._substr.length;
+ this._names.push(name);
+ this._bitVector.set$I(index$0 - 1);
+};
+
+/**
+ * @param {!string} name
+ * @param {!number} index
+ */
+Section.prototype.setTail$SI = function (name, index) {
+ this._names.push(name);
+ this._bitVector.set$I(index - 1);
+};
+
+/**
+ * @return {!number}
+ */
+Section.prototype.size$ = function () {
+ return (this._names.length | 0);
+};
+
+/**
+ * @param {!number} position
+ * @return {!number}
+ */
+Section.prototype.getSectionIndex$I = function (position) {
+ /** @type {BitVector} */
+ var this$0;
+ if (position < 0 || this._bitVector.size$() <= position) {
+ throw new Error("Section.getSectionIndex() : range error " + (position + ""));
+ }
+ this$0 = this._bitVector;
+ return this$0.rank$IB(position, true);
+};
+
+/**
+ * @param {!number} index
+ * @return {!string}
+ */
+Section.prototype.getName$I = function (index) {
+ if (index < 0 || this._names.length <= index) {
+ throw new Error("Section.getName() : range error");
+ }
+ return this._names[index];
+};
+
+/**
+ * @param {SingleResult} result
+ * @param {Array.<undefined|!number>} positions
+ * @param {!string} word
+ * @param {!boolean} stemmed
+ */
+Section.prototype.grouping$LSingleResult$AISB = function (result, positions, word, stemmed) {
+ /** @type {!number} */
+ var i;
+ /** @type {undefined|!number} */
+ var position;
+ /** @type {!number} */
+ var index;
+ /** @type {SearchUnit} */
+ var unit;
+ for (i = 0; i < positions.length; i++) {
+ position = positions[i];
+ index = this.getSectionIndex$I(position);
+ unit = SingleResult$getSearchUnit$LSingleResult$I(result, index);
+ if (unit.startPosition < 0) {
+ unit.startPosition = this.getStartPosition$I(index);
+ }
+ SearchUnit$addPosition$LSearchUnit$SIB(unit, word, position - unit.startPosition, stemmed);
+ }
+};
+
+/**
+ * @param {!number} index
+ * @return {!string}
+ */
+Section.prototype.getInformation$I = function (index) {
+ return this.getName$I(index);
+};
+
+/**
+ * @param {Oktavia} parent
+ * @param {!string} name
+ * @param {!string} data
+ * @param {!number} offset
+ * @return {!number}
+ */
+Section._load$LOktavia$SSI = function (parent, name, data, offset) {
+ /** @type {LoadedStringListResult} */
+ var strs;
+ /** @type {Section} */
+ var section;
+ /** @type {!number} */
+ var offset$0;
+ strs = new LoadedStringListResult$SI(data, offset);
+ section = new Section$LOktavia$(parent);
+ section._names = strs.result;
+ offset$0 = strs.offset;
+ offset$0 = section._bitVector.load$SI(data, offset$0);
+ section._parent._metadataLabels.push(name);
+ section._parent._metadatas[name] = section;
+ return offset$0;
+};
+
+var Section$_load$LOktavia$SSI = Section._load$LOktavia$SSI;
+
+/**
+ * @return {!string}
+ */
+Section.prototype._dump$ = function () {
+ return [ Binary$dump16bitNumber$I(0), Binary$dumpStringList$AS(this._names), Metadata.prototype._dump$.call(this) ].join('');
+};
+
+/**
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+Section.prototype._dump$LCompressionReport$ = function (report) {
+ CompressionReport$add$LCompressionReport$II(report, 1, 1);
+ return [ Binary$dump16bitNumber$I(0), Binary$dumpStringList$ASLCompressionReport$(this._names, report), Metadata.prototype._dump$LCompressionReport$.call(this, report) ].join('');
+};
+
+/**
+ * class Splitter extends Metadata
+ * @constructor
+ */
+function Splitter() {
+}
+
+Splitter.prototype = new Metadata;
+/**
+ * @constructor
+ * @param {Oktavia} parent
+ */
+function Splitter$LOktavia$(parent) {
+ this._parent = parent;
+ this._bitVector = new BitVector$();
+ this.name = null;
+};
+
+Splitter$LOktavia$.prototype = new Splitter;
+
+/**
+ * @constructor
+ * @param {Oktavia} parent
+ * @param {!string} name
+ */
+function Splitter$LOktavia$S(parent, name) {
+ this._parent = parent;
+ this._bitVector = new BitVector$();
+ this.name = name;
+};
+
+Splitter$LOktavia$S.prototype = new Splitter;
+
+/**
+ * @return {!number}
+ */
+Splitter.prototype.size$ = function () {
+ /** @type {BitVector} */
+ var this$0$0;
+ /** @type {!number} */
+ var i$0$0;
+ /** @type {BitVector} */
+ var _bitVector$0;
+ this$0$0 = _bitVector$0 = this._bitVector;
+ i$0$0 = _bitVector$0._size;
+ return this$0$0.rank$IB(i$0$0, true);
+};
+
+/**
+ */
+Splitter.prototype.split$ = function () {
+ /** @type {!number} */
+ var index$0;
+ /** @type {Oktavia} */
+ var this$0;
+ /** @type {FMIndex} */
+ var this$0$0;
+ this$0 = this._parent;
+ this$0$0 = this$0._fmindex;
+ index$0 = this$0$0._substr.length;
+ this._bitVector.set$I(index$0 - 1);
+};
+
+/**
+ * @param {!number} index
+ */
+Splitter.prototype.split$I = function (index) {
+ this._bitVector.set$I(index - 1);
+};
+
+/**
+ * @param {!number} position
+ * @return {!number}
+ */
+Splitter.prototype.getIndex$I = function (position) {
+ /** @type {BitVector} */
+ var this$0;
+ if (position < 0 || this._bitVector.size$() <= position) {
+ throw new Error("Section.getSectionIndex() : range error");
+ }
+ this$0 = this._bitVector;
+ return this$0.rank$IB(position, true);
+};
+
+/**
+ * @param {SingleResult} result
+ * @param {Array.<undefined|!number>} positions
+ * @param {!string} word
+ * @param {!boolean} stemmed
+ */
+Splitter.prototype.grouping$LSingleResult$AISB = function (result, positions, word, stemmed) {
+ /** @type {!number} */
+ var i;
+ /** @type {undefined|!number} */
+ var position;
+ /** @type {!number} */
+ var index;
+ /** @type {SearchUnit} */
+ var unit;
+ for (i = 0; i < positions.length; i++) {
+ position = positions[i];
+ index = this.getIndex$I(position);
+ unit = SingleResult$getSearchUnit$LSingleResult$I(result, index);
+ if (unit.startPosition < 0) {
+ unit.startPosition = this.getStartPosition$I(index);
+ }
+ SearchUnit$addPosition$LSearchUnit$SIB(unit, word, position - unit.startPosition, stemmed);
+ }
+};
+
+/**
+ * @param {!number} index
+ * @return {!string}
+ */
+Splitter.prototype.getInformation$I = function (index) {
+ return (this.name != null ? this.name + (index + 1 + "") : '');
+};
+
+/**
+ * @param {Oktavia} parent
+ * @param {!string} name
+ * @param {!string} data
+ * @param {!number} offset
+ * @return {!number}
+ */
+Splitter._load$LOktavia$SSI = function (parent, name, data, offset) {
+ /** @type {Splitter} */
+ var section;
+ section = new Splitter$LOktavia$(parent);
+ offset = section._bitVector.load$SI(data, offset);
+ section._parent._metadataLabels.push(name);
+ section._parent._metadatas[name] = section;
+ return offset;
+};
+
+var Splitter$_load$LOktavia$SSI = Splitter._load$LOktavia$SSI;
+
+/**
+ * @return {!string}
+ */
+Splitter.prototype._dump$ = function () {
+ return [ Binary$dump16bitNumber$I(1), Metadata.prototype._dump$.call(this) ].join('');
+};
+
+/**
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+Splitter.prototype._dump$LCompressionReport$ = function (report) {
+ CompressionReport$add$LCompressionReport$II(report, 1, 1);
+ return [ Binary$dump16bitNumber$I(1), Metadata.prototype._dump$LCompressionReport$.call(this, report) ].join('');
+};
+
+/**
+ * class Table extends Metadata
+ * @constructor
+ */
+function Table() {
+}
+
+Table.prototype = new Metadata;
+/**
+ * @constructor
+ * @param {Oktavia} parent
+ * @param {Array.<undefined|!string>} headers
+ */
+function Table$LOktavia$AS(parent, headers) {
+ this._parent = parent;
+ this._bitVector = new BitVector$();
+ this._headers = headers;
+ this._columnTails = new BitVector$();
+};
+
+Table$LOktavia$AS.prototype = new Table;
+
+/**
+ * @return {!number}
+ */
+Table.prototype.rowSize$ = function () {
+ /** @type {BitVector} */
+ var this$0$0;
+ /** @type {!number} */
+ var i$0$0;
+ /** @type {BitVector} */
+ var _bitVector$0;
+ this$0$0 = _bitVector$0 = this._bitVector;
+ i$0$0 = _bitVector$0._size;
+ return this$0$0.rank$IB(i$0$0, true);
+};
+
+/**
+ * @return {!number}
+ */
+Table.prototype.columnSize$ = function () {
+ return (this._headers.length | 0);
+};
+
+/**
+ */
+Table.prototype.setColumnTail$ = function () {
+ /** @type {!number} */
+ var index;
+ /** @type {Oktavia} */
+ var this$0;
+ /** @type {FMIndex} */
+ var this$0$0;
+ /** @type {Oktavia} */
+ var _parent$0;
+ this$0 = _parent$0 = this._parent;
+ this$0$0 = this$0._fmindex;
+ index = this$0$0._substr.length;
+ _parent$0._fmindex.push$S(Oktavia.eob);
+ this._columnTails.set$I(index - 1);
+};
+
+/**
+ */
+Table.prototype.setRowTail$ = function () {
+ /** @type {!number} */
+ var index;
+ /** @type {Oktavia} */
+ var this$0;
+ /** @type {FMIndex} */
+ var this$0$0;
+ this$0 = this._parent;
+ this$0$0 = this$0._fmindex;
+ index = this$0$0._substr.length;
+ this._bitVector.set$I(index - 1);
+};
+
+/**
+ * @param {!number} position
+ * @return {Array.<undefined|!number>}
+ */
+Table.prototype.getCell$I = function (position) {
+ /** @type {!number} */
+ var row;
+ /** @type {!number} */
+ var currentColumn;
+ /** @type {!number} */
+ var lastRowColumn;
+ /** @type {!number} */
+ var startPosition;
+ /** @type {Array.<undefined|!number>} */
+ var result;
+ /** @type {BitVector} */
+ var this$0;
+ /** @type {BitVector} */
+ var this$1;
+ if (position < 0 || this._bitVector.size$() <= position) {
+ throw new Error("Section.getSectionIndex() : range error " + (position + ""));
+ }
+ this$0 = this._bitVector;
+ row = this$0.rank$IB(position, true);
+ this$1 = this._columnTails;
+ currentColumn = this$1.rank$IB(position, true);
+ lastRowColumn = 0;
+ if (row > 0) {
+ startPosition = this._bitVector.select$I(row - 1) + 1;
+ lastRowColumn = this._columnTails.rank$I(startPosition);
+ }
+ result = [ row, currentColumn - lastRowColumn ];
+ return result;
+};
+
+/**
+ * @param {!number} rowIndex
+ * @return {Object.<string, undefined|!string>}
+ */
+Table.prototype.getRowContent$I = function (rowIndex) {
+ /** @type {!string} */
+ var content;
+ /** @type {Array.<undefined|!string>} */
+ var values;
+ /** @type {Object.<string, undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var i;
+ content = this.getContent$I(rowIndex);
+ values = content.split(Oktavia.eob, this._headers.length);
+ result = ({ });
+ for (i in this._headers) {
+ if (i < values.length) {
+ result[this._headers[i]] = values[i];
+ } else {
+ result[this._headers[i]] = '';
+ }
+ }
+ return result;
+};
+
+/**
+ * @param {SingleResult} result
+ * @param {Array.<undefined|!number>} positions
+ * @param {!string} word
+ * @param {!boolean} stemmed
+ */
+Table.prototype.grouping$LSingleResult$AISB = function (result, positions, word, stemmed) {
+};
+
+/**
+ * @param {!number} index
+ * @return {!string}
+ */
+Table.prototype.getInformation$I = function (index) {
+ return '';
+};
+
+/**
+ */
+Table.prototype._build$ = function () {
+ this._bitVector.build$();
+ this._columnTails.build$();
+};
+
+/**
+ * @param {Oktavia} parent
+ * @param {!string} name
+ * @param {!string} data
+ * @param {!number} offset
+ * @return {!number}
+ */
+Table._load$LOktavia$SSI = function (parent, name, data, offset) {
+ /** @type {LoadedStringListResult} */
+ var strs;
+ /** @type {Table} */
+ var table;
+ /** @type {!number} */
+ var offset$0;
+ strs = new LoadedStringListResult$SI(data, offset);
+ table = new Table$LOktavia$AS(parent, strs.result);
+ offset$0 = strs.offset;
+ offset$0 = table._bitVector.load$SI(data, offset$0);
+ table._parent._metadataLabels.push(name);
+ table._parent._metadatas[name] = table;
+ offset = offset$0;
+ return table._columnTails.load$SI(data, offset$0);
+};
+
+var Table$_load$LOktavia$SSI = Table._load$LOktavia$SSI;
+
+/**
+ * @return {!string}
+ */
+Table.prototype._dump$ = function () {
+ return [ Binary$dump16bitNumber$I(2), Binary$dumpStringList$AS(this._headers), Metadata.prototype._dump$.call(this), this._columnTails.dump$() ].join('');
+};
+
+/**
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+Table.prototype._dump$LCompressionReport$ = function (report) {
+ CompressionReport$add$LCompressionReport$II(report, 1, 1);
+ return [ Binary$dump16bitNumber$I(2), Binary$dumpStringList$ASLCompressionReport$(this._headers, report), Metadata.prototype._dump$LCompressionReport$.call(this, report), this._columnTails.dump$LCompressionReport$(report) ].join('');
+};
+
+/**
+ * class Block extends Metadata
+ * @constructor
+ */
+function Block() {
+}
+
+Block.prototype = new Metadata;
+/**
+ * @constructor
+ * @param {Oktavia} parent
+ */
+function Block$LOktavia$(parent) {
+ this._parent = parent;
+ this._bitVector = new BitVector$();
+ this._names = [ ];
+ this._start = false;
+};
+
+Block$LOktavia$.prototype = new Block;
+
+/**
+ * @param {!string} blockName
+ */
+Block.prototype.startBlock$S = function (blockName) {
+ this.startBlock$SI(blockName, this._parent.contentSize$());
+};
+
+/**
+ * @param {!string} blockName
+ * @param {!number} index
+ */
+Block.prototype.startBlock$SI = function (blockName, index) {
+ if (this._start) {
+ throw new Error('Splitter `' + this._names[this._names.length - 1] + '` is not closed');
+ }
+ this._start = true;
+ this._names.push(blockName);
+ this._bitVector.set$I(index - 1);
+};
+
+/**
+ */
+Block.prototype.endBlock$ = function () {
+ this.endBlock$I(this._parent.contentSize$());
+};
+
+/**
+ * @param {!number} index
+ */
+Block.prototype.endBlock$I = function (index) {
+ if (! this._start) {
+ throw new Error('Splitter is not started');
+ }
+ this._start = false;
+ this._bitVector.set$I(index - 1);
+};
+
+/**
+ * @return {!number}
+ */
+Block.prototype.size$ = function () {
+ return (this._names.length | 0);
+};
+
+/**
+ * @param {!number} position
+ * @return {!number}
+ */
+Block.prototype.blockIndex$I = function (position) {
+ /** @type {!number} */
+ var result;
+ /** @type {BitVector} */
+ var this$0;
+ if (position < 0 || this._parent._fmindex.size$() - 1 <= position) {
+ throw new Error("Block.blockIndex() : range error " + (position + ""));
+ }
+ if (position >= this._bitVector.size$()) {
+ position = (this._bitVector.size$() - 1 | 0);
+ result = (this._bitVector.rank$I(position) + 1 | 0);
+ } else {
+ this$0 = this._bitVector;
+ result = this$0.rank$IB(position, true);
+ }
+ return result;
+};
+
+/**
+ * @param {!number} position
+ * @return {!boolean}
+ */
+Block.prototype.inBlock$I = function (position) {
+ /** @type {!number} */
+ var blockIndex;
+ blockIndex = this.blockIndex$I(position);
+ return blockIndex % 2 !== 0;
+};
+
+/**
+ * @param {!number} position
+ * @return {!string}
+ */
+Block.prototype.getBlockContent$I = function (position) {
+ /** @type {!number} */
+ var blockIndex;
+ /** @type {!string} */
+ var result;
+ blockIndex = this.blockIndex$I(position);
+ if (blockIndex % 2 !== 0) {
+ result = this.getContent$I(blockIndex);
+ } else {
+ result = '';
+ }
+ return result;
+};
+
+/**
+ * @param {!number} position
+ * @return {!string}
+ */
+Block.prototype.getBlockName$I = function (position) {
+ /** @type {!number} */
+ var blockIndex;
+ /** @type {!string} */
+ var result;
+ blockIndex = this.blockIndex$I(position);
+ if (blockIndex % 2 !== 0) {
+ result = this._names[blockIndex >>> 1];
+ } else {
+ result = '';
+ }
+ return result;
+};
+
+/**
+ * @param {SingleResult} result
+ * @param {Array.<undefined|!number>} positions
+ * @param {!string} word
+ * @param {!boolean} stemmed
+ */
+Block.prototype.grouping$LSingleResult$AISB = function (result, positions, word, stemmed) {
+};
+
+/**
+ * @param {!number} index
+ * @return {!string}
+ */
+Block.prototype.getInformation$I = function (index) {
+ return '';
+};
+
+/**
+ * @param {Oktavia} parent
+ * @param {!string} name
+ * @param {!string} data
+ * @param {!number} offset
+ * @return {!number}
+ */
+Block._load$LOktavia$SSI = function (parent, name, data, offset) {
+ /** @type {LoadedStringListResult} */
+ var strs;
+ /** @type {Block} */
+ var block;
+ /** @type {!number} */
+ var offset$0;
+ strs = new LoadedStringListResult$SI(data, offset);
+ block = new Block$LOktavia$(parent);
+ block._names = strs.result;
+ offset$0 = strs.offset;
+ offset$0 = block._bitVector.load$SI(data, offset$0);
+ block._parent._metadataLabels.push(name);
+ block._parent._metadatas[name] = block;
+ return offset$0;
+};
+
+var Block$_load$LOktavia$SSI = Block._load$LOktavia$SSI;
+
+/**
+ * @return {!string}
+ */
+Block.prototype._dump$ = function () {
+ return [ Binary$dump16bitNumber$I(3), Binary$dumpStringList$AS(this._names), Metadata.prototype._dump$.call(this) ].join('');
+};
+
+/**
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+Block.prototype._dump$LCompressionReport$ = function (report) {
+ CompressionReport$add$LCompressionReport$II(report, 1, 1);
+ return [ Binary$dump16bitNumber$I(3), Binary$dumpStringList$ASLCompressionReport$(this._names, report), Metadata.prototype._dump$LCompressionReport$.call(this, report) ].join('');
+};
+
+/**
+ * class FMIndex extends Object
+ * @constructor
+ */
+function FMIndex() {
+}
+
+/**
+ * @constructor
+ */
+function FMIndex$() {
+ /** @type {Array.<undefined|!number>} */
+ var _rlt$0;
+ this._ssize = 0;
+ (this._ddic = 0, this._head = 0);
+ this._substr = "";
+ this._sv = new WaveletMatrix$();
+ this._posdic = [ ];
+ this._idic = [ ];
+ _rlt$0 = this._rlt = [ ];
+ _rlt$0.length = 65536;
+};
+
+FMIndex$.prototype = new FMIndex;
+
+/**
+ */
+FMIndex.prototype.clear$ = function () {
+ /** @type {WaveletMatrix} */
+ var this$0;
+ this$0 = this._sv;
+ this$0._bv.length = 0;
+ this$0._seps.length = 0;
+ this$0._size = 0;
+ this._posdic.length = 0;
+ this._idic.length = 0;
+ this._ddic = 0;
+ this._head = 0;
+ this._substr = "";
+};
+
+/**
+ * @return {!number}
+ */
+FMIndex.prototype.size$ = function () {
+ /** @type {WaveletMatrix} */
+ var this$0;
+ this$0 = this._sv;
+ return this$0._size;
+};
+
+/**
+ * @return {!number}
+ */
+FMIndex.prototype.contentSize$ = function () {
+ return this._substr.length;
+};
+
+/**
+ * @param {!string} key
+ * @return {!number}
+ */
+FMIndex.prototype.getRows$S = function (key) {
+ /** @type {Array.<undefined|!number>} */
+ var pos;
+ pos = [ ];
+ return this.getRows$SAI(key, pos);
+};
+
+/**
+ * @param {!string} key
+ * @param {Array.<undefined|!number>} pos
+ * @return {!number}
+ */
+FMIndex.prototype.getRows$SAI = function (key, pos) {
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var code;
+ /** @type {!number} */
+ var first;
+ /** @type {undefined|!number} */
+ var last;
+ /** @type {!number} */
+ var c;
+ /** @type {Array.<undefined|!number>} */
+ var _rlt$0;
+ i = key.length - 1;
+ code = key.charCodeAt(i);
+ first = (_rlt$0 = this._rlt)[code] + 1;
+ last = _rlt$0[code + 1];
+ while (first <= last) {
+ if (i === 0) {
+ pos[0] = (-- first | 0);
+ pos[1] = -- last;
+ return (last - first + 1 | 0);
+ }
+ i--;
+ c = key.charCodeAt(i);
+ first = this._rlt[c] + this._sv.rank$II(first - 1, c) + 1;
+ last = this._rlt[c] + this._sv.rank$II(last, c);
+ }
+ return 0;
+};
+
+/**
+ * @param {!number} i
+ * @return {!number}
+ */
+FMIndex.prototype.getPosition$I = function (i) {
+ /** @type {!number} */
+ var pos;
+ /** @type {!number} */
+ var c;
+ if (i >= this.size$()) {
+ throw new Error("FMIndex.getPosition() : range error");
+ }
+ pos = 0;
+ while (i !== this._head) {
+ if (i % this._ddic === 0) {
+ pos += this._posdic[i / this._ddic] + 1;
+ break;
+ }
+ c = this._sv.get$I(i);
+ i = this._rlt[c] + this._sv.rank$II(i, c);
+ pos++;
+ }
+ return (pos % this.size$() | 0);
+};
+
+/**
+ * @param {!number} pos
+ * @param {!number} len
+ * @return {!string}
+ */
+FMIndex.prototype.getSubstring$II = function (pos, len) {
+ /** @type {!number} */
+ var pos_end;
+ /** @type {!number} */
+ var pos_tmp;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var pos_idic;
+ /** @type {!string} */
+ var substr;
+ /** @type {!number} */
+ var c;
+ /** @type {!number} */
+ var _ddic$0;
+ if (pos >= this.size$()) {
+ throw new Error("FMIndex.getSubstring() : range error");
+ }
+ pos_end = Math.min(pos + len, this.size$());
+ pos_tmp = this.size$() - 1;
+ i = this._head;
+ pos_idic = Math.floor((pos_end + (_ddic$0 = this._ddic) - 2) / _ddic$0);
+ if (pos_idic < this._idic.length) {
+ pos_tmp = pos_idic * this._ddic;
+ i = this._idic[pos_idic];
+ }
+ substr = "";
+ while (pos_tmp >= pos) {
+ c = this._sv.get$I(i);
+ i = this._rlt[c] + this._sv.rank$II(i, c);
+ if (pos_tmp < pos_end) {
+ substr = String.fromCharCode(c) + substr;
+ }
+ if (pos_tmp === 0) {
+ break;
+ }
+ pos_tmp--;
+ }
+ return substr;
+};
+
+/**
+ */
+FMIndex.prototype.build$ = function () {
+ this.build$SIIB(String.fromCharCode(0), 65535, 20, false);
+};
+
+/**
+ * @param {!string} end_marker
+ * @param {!number} ddic
+ * @param {!boolean} verbose
+ */
+FMIndex.prototype.build$SIB = function (end_marker, ddic, verbose) {
+ this.build$SIIB(end_marker, 65535, ddic, verbose);
+};
+
+/**
+ * @param {!string} end_marker
+ * @param {!number} maxChar
+ * @param {!number} ddic
+ * @param {!boolean} verbose
+ */
+FMIndex.prototype.build$SIIB = function (end_marker, maxChar, ddic, verbose) {
+ /** @type {BurrowsWheelerTransform} */
+ var b;
+ /** @type {!string} */
+ var s;
+ /** @type {!number} */
+ var c;
+ /** @type {!string} */
+ var str$0;
+ /** @type {WaveletMatrix} */
+ var this$0;
+ /** @type {!string} */
+ var _str$0;
+ /** @type {Array.<undefined|!number>} */
+ var _suffixarray$0;
+ if (verbose) {
+ console.time("building burrows-wheeler transform");
+ }
+ this._substr += end_marker;
+ b = ({_str: "", _size: 0, _head: 0, _suffixarray: [ ]});
+ str$0 = this._substr;
+ _str$0 = b._str = str$0;
+ b._size = _str$0.length;
+ _suffixarray$0 = b._suffixarray = SAIS$make$S(str$0);
+ b._head = (_suffixarray$0.indexOf(0) | 0);
+ s = BurrowsWheelerTransform$get$LBurrowsWheelerTransform$(b);
+ this._ssize = s.length;
+ this._head = b._head;
+ b._str = "";
+ b._size = 0;
+ b._head = 0;
+ b._suffixarray.length = 0;
+ this._substr = "";
+ if (verbose) {
+ console.timeEnd("building burrows-wheeler transform");
+ }
+ if (verbose) {
+ console.time("building wavelet matrix");
+ }
+ this$0 = this._sv;
+ this$0._bitsize = (Math.ceil(Math.log(maxChar) / 0.6931471805599453) | 0);
+ if (verbose) {
+ console.log(" maxCharCode: ", maxChar);
+ console.log(" bitSize: ", this._sv.bitsize$());
+ }
+ this._sv.build$S(s);
+ if (verbose) {
+ console.timeEnd("building wavelet matrix");
+ }
+ if (verbose) {
+ console.time("caching rank less than");
+ }
+ for (c = 0; c < maxChar; c++) {
+ this._rlt[c] = this._sv.rank_less_than$II(this._sv.size$(), c);
+ }
+ if (verbose) {
+ console.timeEnd("caching rank less than");
+ }
+ this._ddic = ddic;
+ if (verbose) {
+ console.time("building dictionaries");
+ }
+ this._buildDictionaries$();
+ if (verbose) {
+ console.timeEnd("building dictionaries");
+ console.log('');
+ }
+};
+
+/**
+ */
+FMIndex.prototype._buildDictionaries$ = function () {
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var pos;
+ /** @type {!number} */
+ var c;
+ for (i = 0; i < this._ssize / this._ddic + 1; i++) {
+ this._posdic.push(0);
+ this._idic.push(0);
+ }
+ i = this._head;
+ pos = this.size$() - 1;
+ do {
+ if (i % this._ddic === 0) {
+ this._posdic[Math.floor(i / this._ddic)] = (pos | 0);
+ }
+ if (pos % this._ddic === 0) {
+ this._idic[Math.floor(pos / this._ddic)] = (i | 0);
+ }
+ c = this._sv.get$I(i);
+ i = this._rlt[c] + this._sv.rank$II(i, c);
+ pos--;
+ } while (i !== this._head);
+};
+
+/**
+ * @param {!string} doc
+ */
+FMIndex.prototype.push$S = function (doc) {
+ if (doc.length <= 0) {
+ throw new Error("FMIndex::push(): empty string");
+ }
+ this._substr += doc;
+};
+
+/**
+ * @param {!string} keyword
+ * @return {Array.<undefined|!number>}
+ */
+FMIndex.prototype.search$S = function (keyword) {
+ /** @type {Array.<undefined|!number>} */
+ var result;
+ /** @type {Array.<undefined|!number>} */
+ var position;
+ /** @type {!number} */
+ var rows;
+ /** @type {undefined|!number} */
+ var first;
+ /** @type {undefined|!number} */
+ var last;
+ /** @type {undefined|!number} */
+ var i;
+ result = [ ];
+ position = [ ];
+ rows = this.getRows$SAI(keyword, position);
+ if (rows > 0) {
+ first = position[0];
+ last = position[1];
+ for (i = first; i <= last; i++) {
+ result.push(this.getPosition$I(i));
+ }
+ }
+ return result;
+};
+
+/**
+ * @return {!string}
+ */
+FMIndex.prototype.dump$ = function () {
+ return this.dump$B(false);
+};
+
+/**
+ * @param {!boolean} verbose
+ * @return {!string}
+ */
+FMIndex.prototype.dump$B = function (verbose) {
+ /** @type {Array.<undefined|!string>} */
+ var contents;
+ /** @type {CompressionReport} */
+ var report;
+ /** @type {!number} */
+ var i;
+ contents = [ ];
+ report = ({source: 0, result: 0});
+ contents.push(Binary$dump32bitNumber$N(this._ddic));
+ contents.push(Binary$dump32bitNumber$N(this._ssize));
+ contents.push(Binary$dump32bitNumber$N(this._head));
+ CompressionReport$add$LCompressionReport$II(report, 6, 6);
+ contents.push(this._sv.dump$LCompressionReport$(report));
+ if (verbose) {
+ console.log("Serializing FM-index");
+ console.log(' Wavelet Matrix: ' + (contents[3].length * 2 + "") + ' bytes (' + (Math.round(report.result * 100.0 / report.source) + "") + '%)');
+ }
+ contents.push(Binary$dump32bitNumber$N(this._posdic.length));
+ for (i in this._posdic) {
+ contents.push(Binary$dump32bitNumber$N(this._posdic[i]));
+ }
+ for (i in this._idic) {
+ contents.push(Binary$dump32bitNumber$N(this._idic[i]));
+ }
+ if (verbose) {
+ console.log(' Dictionary Cache: ' + (this._idic.length * 16 + "") + ' bytes');
+ }
+ return contents.join("");
+};
+
+/**
+ * @param {!string} data
+ * @return {!number}
+ */
+FMIndex.prototype.load$S = function (data) {
+ return this.load$SI(data, 0);
+};
+
+/**
+ * @param {!string} data
+ * @param {!number} offset
+ * @return {!number}
+ */
+FMIndex.prototype.load$SI = function (data, offset) {
+ /** @type {!number} */
+ var maxChar;
+ /** @type {!number} */
+ var c;
+ /** @type {!number} */
+ var size;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var result$0;
+ /** @type {!number} */
+ var result$1;
+ result$0 = data.charCodeAt(offset) * 65536 + data.charCodeAt(offset + 1);
+ this._ddic = (result$0 | 0);
+ this._ssize = (Binary$load32bitNumber$SI(data, offset + 2) | 0);
+ this._head = (Binary$load32bitNumber$SI(data, offset + 4) | 0);
+ offset = this._sv.load$SI(data, offset + 6);
+ maxChar = Math.pow(2, this._sv.bitsize$());
+ for (c = 0; c < maxChar; c++) {
+ this._rlt[c] = this._sv.rank_less_than$II(this._sv.size$(), c);
+ }
+ result$1 = data.charCodeAt(offset) * 65536 + data.charCodeAt(offset + 1);
+ size = result$1;
+ offset += 2;
+ for (i = 0; i < size; (i++, offset += 2)) {
+ this._posdic.push(Binary$load32bitNumber$SI(data, offset));
+ }
+ for (i = 0; i < size; (i++, offset += 2)) {
+ this._idic.push(Binary$load32bitNumber$SI(data, offset));
+ }
+ return offset;
+};
+
+/**
+ * class Tag extends Object
+ * @constructor
+ */
+function Tag() {
+}
+
+/**
+ * @constructor
+ * @param {!string} name
+ */
+function Tag$S(name) {
+ this.name = name;
+ this.attributes = ({ });
+ this.isSelfClosing = false;
+};
+
+Tag$S.prototype = new Tag;
+
+/**
+ * class _Common extends Object
+ * @constructor
+ */
+function _Common() {
+}
+
+/**
+ * @constructor
+ */
+function _Common$() {
+};
+
+_Common$.prototype = new _Common;
+
+/**
+ * class _State extends Object
+ * @constructor
+ */
+function _State() {
+}
+
+/**
+ * @constructor
+ */
+function _State$() {
+};
+
+_State$.prototype = new _State;
+
+/**
+ * class SAXHandler extends Object
+ * @constructor
+ */
+function SAXHandler() {
+}
+
+/**
+ * @constructor
+ */
+function SAXHandler$() {
+ this.position = 0;
+ this.column = 0;
+ this.line = 0;
+};
+
+SAXHandler$.prototype = new SAXHandler;
+
+/**
+ * @param {Error} error
+ */
+SAXHandler.prototype.onerror$LError$ = function (error) {
+};
+
+/**
+ * @param {!string} text
+ */
+SAXHandler.prototype.ontext$S = function (text) {
+};
+
+/**
+ * @param {!string} doctype
+ */
+SAXHandler.prototype.ondoctype$S = function (doctype) {
+};
+
+/**
+ * @param {!string} name
+ * @param {!string} body
+ */
+SAXHandler.prototype.onprocessinginstruction$SS = function (name, body) {
+};
+
+/**
+ * @param {!string} sgmlDecl
+ */
+SAXHandler.prototype.onsgmldeclaration$S = function (sgmlDecl) {
+};
+
+/**
+ * @param {!string} tagname
+ * @param {Object.<string, undefined|!string>} attributes
+ */
+SAXHandler.prototype.onopentag$SHS = function (tagname, attributes) {
+};
+
+/**
+ * @param {!string} tagname
+ */
+SAXHandler.prototype.onclosetag$S = function (tagname) {
+};
+
+/**
+ * @param {!string} name
+ * @param {!string} value
+ */
+SAXHandler.prototype.onattribute$SS = function (name, value) {
+};
+
+/**
+ * @param {!string} comment
+ */
+SAXHandler.prototype.oncomment$S = function (comment) {
+};
+
+/**
+ */
+SAXHandler.prototype.onopencdata$ = function () {
+};
+
+/**
+ * @param {!string} cdata
+ */
+SAXHandler.prototype.oncdata$S = function (cdata) {
+};
+
+/**
+ */
+SAXHandler.prototype.onclosecdata$ = function () {
+};
+
+/**
+ */
+SAXHandler.prototype.onend$ = function () {
+};
+
+/**
+ */
+SAXHandler.prototype.onready$ = function () {
+};
+
+/**
+ * @param {!string} script
+ */
+SAXHandler.prototype.onscript$S = function (script) {
+};
+
+/**
+ * class _HTMLHandler extends SAXHandler
+ * @constructor
+ */
+function _HTMLHandler() {
+}
+
+_HTMLHandler.prototype = new SAXHandler;
+/**
+ * @constructor
+ * @param {Object.<string, undefined|Array.<undefined|!string>>} styles
+ * @param {!boolean} escape
+ */
+function _HTMLHandler$HASB(styles, escape) {
+ this.position = 0;
+ this.column = 0;
+ this.line = 0;
+ this.text = [ ];
+ this.escape = escape;
+ this.styles = styles;
+};
+
+_HTMLHandler$HASB.prototype = new _HTMLHandler;
+
+/**
+ * @param {!string} str
+ * @return {!string}
+ */
+_HTMLHandler.escapeHTML$S = function (str) {
+ return str.replace(/\n/g, "<br/>").replace(/&/g, "&amp;").replace(/"/g, "&quot;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
+};
+
+var _HTMLHandler$escapeHTML$S = _HTMLHandler.escapeHTML$S;
+
+/**
+ * @param {!string} tagname
+ * @param {Object.<string, undefined|!string>} attributes
+ */
+_HTMLHandler.prototype.onopentag$SHS = function (tagname, attributes) {
+ this.text.push(this.styles[tagname][0]);
+};
+
+/**
+ * @param {!string} tagname
+ */
+_HTMLHandler.prototype.onclosetag$S = function (tagname) {
+ this.text.push(this.styles[tagname][1]);
+};
+
+/**
+ * @param {!string} text
+ */
+_HTMLHandler.prototype.ontext$S = function (text) {
+ if (this.escape) {
+ this.text.push(text.replace(/\n/g, "<br/>").replace(/&/g, "&amp;").replace(/"/g, "&quot;").replace(/</g, "&lt;").replace(/>/g, "&gt;"));
+ } else {
+ this.text.push(text);
+ }
+};
+
+/**
+ * @return {!string}
+ */
+_HTMLHandler.prototype.result$ = function () {
+ return this.text.join('');
+};
+
+/**
+ * class SAXParser extends Object
+ * @constructor
+ */
+function SAXParser() {
+}
+
+/**
+ * @constructor
+ * @param {SAXHandler} handler
+ */
+function SAXParser$LSAXHandler$(handler) {
+ this.q = "";
+ this.c = "";
+ this.bufferCheckPosition = 0;
+ this.looseCase = "";
+ this.tags = [ ];
+ this.closed = false;
+ this.closedRoot = false;
+ this.sawRoot = false;
+ this.tag = null;
+ this.error = null;
+ this.handler = null;
+ this.ENTITIES = null;
+ this.strict = false;
+ this.tagName = "";
+ this.state = 0;
+ this.line = 0;
+ this.column = 0;
+ this.position = 0;
+ this.startTagPosition = 0;
+ this.attribName = "";
+ this.attribValue = "";
+ this.script = "";
+ this.textNode = "";
+ this.attribList = null;
+ this.noscript = false;
+ this.cdata = "";
+ this.procInstBody = "";
+ this.procInstName = "";
+ this.doctype = "";
+ this.entity = "";
+ this.sgmlDecl = "";
+ this.comment = "";
+ this.preTags = 0;
+ this._init$LSAXHandler$B(handler, false);
+};
+
+SAXParser$LSAXHandler$.prototype = new SAXParser;
+
+/**
+ * @constructor
+ * @param {SAXHandler} handler
+ * @param {!boolean} strict
+ */
+function SAXParser$LSAXHandler$B(handler, strict) {
+ this.q = "";
+ this.c = "";
+ this.bufferCheckPosition = 0;
+ this.looseCase = "";
+ this.tags = [ ];
+ this.closed = false;
+ this.closedRoot = false;
+ this.sawRoot = false;
+ this.tag = null;
+ this.error = null;
+ this.handler = null;
+ this.ENTITIES = null;
+ this.strict = false;
+ this.tagName = "";
+ this.state = 0;
+ this.line = 0;
+ this.column = 0;
+ this.position = 0;
+ this.startTagPosition = 0;
+ this.attribName = "";
+ this.attribValue = "";
+ this.script = "";
+ this.textNode = "";
+ this.attribList = null;
+ this.noscript = false;
+ this.cdata = "";
+ this.procInstBody = "";
+ this.procInstName = "";
+ this.doctype = "";
+ this.entity = "";
+ this.sgmlDecl = "";
+ this.comment = "";
+ this.preTags = 0;
+ this._init$LSAXHandler$B(handler, strict);
+};
+
+SAXParser$LSAXHandler$B.prototype = new SAXParser;
+
+/**
+ * @param {SAXHandler} handler
+ * @param {!boolean} strict
+ */
+SAXParser.prototype._init$LSAXHandler$B = function (handler, strict) {
+ this.handler = handler;
+ this.clearBuffers$();
+ this.q = "";
+ this.bufferCheckPosition = 65536;
+ this.looseCase = 'toLowerCase';
+ this.tags = [ ];
+ this.closed = this.closedRoot = this.sawRoot = false;
+ this.tag = null;
+ this.error = null;
+ this.strict = strict;
+ this.noscript = strict;
+ this.state = 1;
+ this.ENTITIES = _Entities$entity_list$();
+ this.attribList = [ ];
+ this.noscript = false;
+ this.preTags = 0;
+};
+
+/**
+ * @param {!boolean} flag
+ */
+SAXParser.prototype.set_noscript$B = function (flag) {
+ this.noscript = flag;
+};
+
+/**
+ * @return {SAXParser}
+ */
+SAXParser.prototype.resume$ = function () {
+ this.error = null;
+ return this;
+};
+
+/**
+ * @return {SAXParser}
+ */
+SAXParser.prototype.close$ = function () {
+ return this.parse$S('');
+};
+
+/**
+ * @param {!string} chunk
+ * @return {SAXParser}
+ */
+SAXParser.prototype.parse$S = function (chunk) {
+ /** @type {Char} */
+ var _;
+ /** @type {!number} */
+ var i;
+ /** @type {!string} */
+ var c;
+ /** @type {!number} */
+ var starti;
+ /** @type {!number} */
+ var pad;
+ /** @type {!number} */
+ var returnState;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$0;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$1;
+ /** @type {RegExp} */
+ var charclass$2;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$3;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$4;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$5;
+ /** @type {!string} */
+ var text$0;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$6;
+ /** @type {RegExp} */
+ var charclass$7;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$8;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$9;
+ /** @type {RegExp} */
+ var charclass$10;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$11;
+ /** @type {RegExp} */
+ var charclass$12;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$13;
+ /** @type {RegExp} */
+ var charclass$14;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$15;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$16;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$17;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$18;
+ /** @type {RegExp} */
+ var charclass$19;
+ /** @type {RegExp} */
+ var charclass$20;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$21;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$22;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$23;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$24;
+ /** @type {!string} */
+ var comment$0;
+ _ = new Char$();
+ if (this.error) {
+ throw this.error;
+ }
+ if (this.closed) {
+ return this.emiterror$S("Cannot write after close. Assign an onready handler.");
+ }
+ (i = 0, c = "");
+ while (this.c = c = chunk.charAt(i++)) {
+ this.position++;
+ if (c === "\n") {
+ this.handler.line++;
+ this.handler.column = 0;
+ } else {
+ this.handler.column++;
+ }
+ switch (this.state) {
+ case 1:
+ if (c === "<") {
+ this.state = 4;
+ this.startTagPosition = this.position;
+ } else {
+ charclass$0 = _.whitespace;
+ if (! $__jsx_ObjectHasOwnProperty.call(charclass$0, c)) {
+ this.strictFail$S("Non-whitespace before first tag.");
+ this.textNode = c;
+ this.state = 2;
+ }
+ }
+ continue;
+ case 2:
+ if (this.sawRoot && ! this.closedRoot) {
+ starti = i - 1;
+ while (c && c !== "<" && c !== "&") {
+ c = chunk.charAt(i++);
+ if (c) {
+ this.position++;
+ if (c === "\n") {
+ this.handler.line++;
+ this.handler.column = 0;
+ } else {
+ this.handler.column++;
+ }
+ }
+ }
+ this.textNode += chunk.substring(starti, i - 1);
+ }
+ if (c === "<") {
+ this.state = 4;
+ this.startTagPosition = this.position;
+ } else {
+ if (_.not$HBS(_.whitespace, c) && (! this.sawRoot || this.closedRoot)) {
+ this.strictFail$S("Text data outside of root node.");
+ }
+ if (c === "&") {
+ this.state = 3;
+ } else {
+ this.textNode += c;
+ }
+ }
+ continue;
+ case 33:
+ if (c === "<") {
+ this.state = 34;
+ } else {
+ this.script += c;
+ }
+ continue;
+ case 34:
+ if (c === "/") {
+ this.state = 31;
+ } else {
+ this.script += "<" + c;
+ this.state = 33;
+ }
+ continue;
+ case 4:
+ if (c === "!") {
+ this.state = 5;
+ this.sgmlDecl = "";
+ } else {
+ charclass$1 = _.whitespace;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$1, c)) {
+ } else {
+ charclass$2 = _.nameStart;
+ if (charclass$2.test(c)) {
+ this.state = 21;
+ this.tagName = c;
+ } else {
+ if (c === "/") {
+ this.state = 31;
+ this.tagName = "";
+ } else {
+ if (c === "?") {
+ this.state = 18;
+ this.procInstName = this.procInstBody = "";
+ } else {
+ this.strictFail$S("Unencoded <");
+ if (this.startTagPosition + 1 < this.position) {
+ pad = this.position - this.startTagPosition;
+ for (i = 0; i < pad; i++) {
+ c = " " + c;
+ }
+ }
+ this.textNode += "<" + c;
+ this.state = 2;
+ }
+ }
+ }
+ }
+ }
+ continue;
+ case 5:
+ if ((this.sgmlDecl + c).toUpperCase() === _.CDATA) {
+ this.closetext_if_exist$();
+ this.state = 15;
+ this.sgmlDecl = "";
+ this.cdata = "";
+ } else {
+ if (this.sgmlDecl + c === "--") {
+ this.state = 12;
+ this.comment = "";
+ this.sgmlDecl = "";
+ } else {
+ if ((this.sgmlDecl + c).toUpperCase() === _.DOCTYPE) {
+ this.state = 7;
+ if (this.doctype || this.sawRoot) {
+ this.strictFail$S("Inappropriately located doctype declaration");
+ }
+ this.doctype = "";
+ this.sgmlDecl = "";
+ } else {
+ if (c === ">") {
+ this.closetext_if_exist$();
+ this.sgmlDecl = "";
+ this.state = 2;
+ } else {
+ charclass$3 = _.quote;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$3, c)) {
+ this.state = 6;
+ this.sgmlDecl += c;
+ } else {
+ this.sgmlDecl += c;
+ }
+ }
+ }
+ }
+ }
+ continue;
+ case 6:
+ if (c === this.q) {
+ this.state = 5;
+ this.q = "";
+ }
+ this.sgmlDecl += c;
+ continue;
+ case 7:
+ if (c === ">") {
+ this.state = 2;
+ this.closetext_if_exist$();
+ this.doctype.trim();
+ } else {
+ this.doctype += c;
+ if (c === "[") {
+ this.state = 9;
+ } else {
+ charclass$4 = _.quote;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$4, c)) {
+ this.state = 8;
+ this.q = c;
+ }
+ }
+ }
+ continue;
+ case 8:
+ this.doctype += c;
+ if (c === this.q) {
+ this.q = "";
+ this.state = 7;
+ }
+ continue;
+ case 9:
+ this.doctype += c;
+ if (c === "]") {
+ this.state = 7;
+ } else {
+ charclass$5 = _.quote;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$5, c)) {
+ this.state = 10;
+ this.q = c;
+ }
+ }
+ continue;
+ case 10:
+ this.doctype += c;
+ if (c === this.q) {
+ this.state = 9;
+ this.q = "";
+ }
+ continue;
+ case 12:
+ if (c === "-") {
+ this.state = 13;
+ } else {
+ this.comment += c;
+ }
+ continue;
+ case 13:
+ if (c === "-") {
+ this.state = 14;
+ text$0 = this.comment;
+ text$0 = text$0.replace(/[\n\t]/g, ' ');
+ text$0 = text$0.replace(/\s\s+/g, " ");
+ comment$0 = this.comment = text$0;
+ if (comment$0) {
+ this.closetext_if_exist$();
+ this.comment.trim();
+ }
+ this.comment = "";
+ } else {
+ this.comment += "-" + c;
+ this.state = 12;
+ }
+ continue;
+ case 14:
+ if (c !== ">") {
+ this.strictFail$S("Malformed comment");
+ this.comment += "--" + c;
+ this.state = 12;
+ } else {
+ this.state = 2;
+ }
+ continue;
+ case 15:
+ if (c === "]") {
+ this.state = 16;
+ } else {
+ this.cdata += c;
+ }
+ continue;
+ case 16:
+ if (c === "]") {
+ this.state = 17;
+ } else {
+ this.cdata += "]" + c;
+ this.state = 15;
+ }
+ continue;
+ case 17:
+ if (c === ">") {
+ if (this.cdata) {
+ this.closetext_if_exist$();
+ }
+ this.cdata = "";
+ this.state = 2;
+ } else {
+ if (c === "]") {
+ this.cdata += "]";
+ } else {
+ this.cdata += "]]" + c;
+ this.state = 15;
+ }
+ }
+ continue;
+ case 18:
+ if (c === "?") {
+ this.state = 20;
+ } else {
+ charclass$6 = _.whitespace;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$6, c)) {
+ this.state = 19;
+ } else {
+ this.procInstName += c;
+ }
+ }
+ continue;
+ case 19:
+ if (! this.procInstBody && _.is$HBS(_.whitespace, c)) {
+ continue;
+ } else {
+ if (c === "?") {
+ this.state = 20;
+ } else {
+ this.procInstBody += c;
+ }
+ }
+ continue;
+ case 20:
+ if (c === ">") {
+ this.closetext_if_exist$();
+ this.procInstName = this.procInstBody = "";
+ this.state = 2;
+ } else {
+ this.procInstBody += "?" + c;
+ this.state = 19;
+ }
+ continue;
+ case 21:
+ charclass$7 = _.nameBody;
+ if (charclass$7.test(c)) {
+ this.tagName += c;
+ } else {
+ this.newTag$();
+ if (c === ">") {
+ this.openTag$B(false);
+ } else {
+ if (c === "/") {
+ this.state = 22;
+ } else {
+ charclass$8 = _.whitespace;
+ if (! $__jsx_ObjectHasOwnProperty.call(charclass$8, c)) {
+ this.strictFail$S("Invalid character in tag name");
+ }
+ this.state = 23;
+ }
+ }
+ }
+ continue;
+ case 22:
+ if (c === ">") {
+ this.openTag$B(true);
+ this.closeTag$();
+ } else {
+ this.strictFail$S("Forward-slash in opening tag not followed by >");
+ this.state = 23;
+ }
+ continue;
+ case 23:
+ charclass$9 = _.whitespace;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$9, c)) {
+ continue;
+ } else {
+ if (c === ">") {
+ this.openTag$B(false);
+ } else {
+ if (c === "/") {
+ this.state = 22;
+ } else {
+ charclass$10 = _.nameStart;
+ if (charclass$10.test(c)) {
+ this.attribName = c;
+ this.attribValue = "";
+ this.state = 24;
+ } else {
+ this.strictFail$S("Invalid attribute name");
+ }
+ }
+ }
+ }
+ continue;
+ case 24:
+ if (c === "=") {
+ this.state = 26;
+ } else {
+ if (c === ">") {
+ this.strictFail$S("Attribute without value");
+ this.attribValue = this.attribName;
+ this.attrib$();
+ this.openTag$B(false);
+ } else {
+ charclass$11 = _.whitespace;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$11, c)) {
+ this.state = 25;
+ } else {
+ charclass$12 = _.nameBody;
+ if (charclass$12.test(c)) {
+ this.attribName += c;
+ } else {
+ this.strictFail$S("Invalid attribute name");
+ }
+ }
+ }
+ }
+ continue;
+ case 25:
+ if (c === "=") {
+ this.state = 26;
+ } else {
+ charclass$13 = _.whitespace;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$13, c)) {
+ continue;
+ } else {
+ this.strictFail$S("Attribute without value");
+ this.tag.attributes[this.attribName] = "";
+ this.attribValue = "";
+ this.closetext_if_exist$();
+ this.attribName = "";
+ if (c === ">") {
+ this.openTag$B(false);
+ } else {
+ charclass$14 = _.nameStart;
+ if (charclass$14.test(c)) {
+ this.attribName = c;
+ this.state = 24;
+ } else {
+ this.strictFail$S("Invalid attribute name");
+ this.state = 23;
+ }
+ }
+ }
+ }
+ continue;
+ case 26:
+ charclass$15 = _.whitespace;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$15, c)) {
+ continue;
+ } else {
+ charclass$16 = _.quote;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$16, c)) {
+ this.q = c;
+ this.state = 27;
+ } else {
+ this.strictFail$S("Unquoted attribute value");
+ this.state = 28;
+ this.attribValue = c;
+ }
+ }
+ continue;
+ case 27:
+ if (c !== this.q) {
+ if (c === "&") {
+ this.state = 29;
+ } else {
+ this.attribValue += c;
+ }
+ continue;
+ }
+ this.attrib$();
+ this.q = "";
+ this.state = 23;
+ continue;
+ case 28:
+ charclass$17 = _.attribEnd;
+ if (! $__jsx_ObjectHasOwnProperty.call(charclass$17, c)) {
+ if (c === "&") {
+ this.state = 30;
+ } else {
+ this.attribValue += c;
+ }
+ continue;
+ }
+ this.attrib$();
+ if (c === ">") {
+ this.openTag$B(false);
+ } else {
+ this.state = 23;
+ }
+ continue;
+ case 31:
+ if (! this.tagName) {
+ charclass$18 = _.whitespace;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$18, c)) {
+ continue;
+ } else {
+ charclass$19 = _.nameStart;
+ if (! charclass$19.test(c)) {
+ if (this.script) {
+ this.script += "</" + c;
+ this.state = 33;
+ } else {
+ this.strictFail$S("Invalid tagname in closing tag.");
+ }
+ } else {
+ this.tagName = c;
+ }
+ }
+ } else {
+ if (c === ">") {
+ this.closeTag$();
+ } else {
+ charclass$20 = _.nameBody;
+ if (charclass$20.test(c)) {
+ this.tagName += c;
+ } else {
+ if (this.script) {
+ this.script += "</" + this.tagName;
+ this.tagName = "";
+ this.state = 33;
+ } else {
+ charclass$21 = _.whitespace;
+ if (! $__jsx_ObjectHasOwnProperty.call(charclass$21, c)) {
+ this.strictFail$S("Invalid tagname in closing tag");
+ }
+ this.state = 32;
+ }
+ }
+ }
+ }
+ continue;
+ case 32:
+ charclass$22 = _.whitespace;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$22, c)) {
+ continue;
+ }
+ if (c === ">") {
+ this.closeTag$();
+ } else {
+ this.strictFail$S("Invalid characters in closing tag");
+ }
+ continue;
+ case 3:
+ if (c === ";") {
+ this.textNode += this.parseEntity$();
+ this.entity = "";
+ this.state = 2;
+ } else {
+ charclass$23 = _.entity;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$23, c)) {
+ this.entity += c;
+ } else {
+ this.strictFail$S("Invalid character entity");
+ this.textNode += "&" + this.entity + c;
+ this.entity = "";
+ this.state = 2;
+ }
+ }
+ continue;
+ case 29:
+ case 30:
+ if (this.state === 29) {
+ returnState = 27;
+ } else {
+ returnState = 28;
+ }
+ if (c === ";") {
+ this.attribValue += this.parseEntity$();
+ this.entity = "";
+ this.state = (returnState | 0);
+ } else {
+ charclass$24 = _.entity;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$24, c)) {
+ this.entity += c;
+ } else {
+ this.strictFail$S("Invalid character entity");
+ this.attribValue += "&" + this.entity + c;
+ this.entity = "";
+ this.state = (returnState | 0);
+ }
+ }
+ continue;
+ default:
+ throw new Error("Unknown state: " + (this.state + ""));
+ }
+ }
+ this.end$();
+ return this;
+};
+
+/**
+ */
+SAXParser.prototype.clearBuffers$ = function () {
+ this.comment = '';
+ this.sgmlDecl = '';
+ this.textNode = '';
+ this.tagName = '';
+ this.doctype = '';
+ this.procInstName = '';
+ this.procInstBody = '';
+ this.entity = '';
+ this.attribName = '';
+ this.attribValue = '';
+ this.cdata = '';
+ this.script = '';
+};
+
+/**
+ */
+SAXParser.prototype.closetext_if_exist$ = function () {
+ if (this.textNode !== '') {
+ this.closetext$();
+ }
+};
+
+/**
+ */
+SAXParser.prototype.closetext$ = function () {
+ /** @type {!string} */
+ var text;
+ /** @type {!string} */
+ var text$0;
+ if (this.preTags === 0) {
+ text$0 = this.textNode;
+ text$0 = text$0.replace(/[\n\t]/g, ' ');
+ text$0 = text$0.replace(/\s\s+/g, " ");
+ text = text$0;
+ if (text$0) {
+ this.handler.ontext$S(text);
+ }
+ } else {
+ if (this.textNode) {
+ this.handler.ontext$S(this.textNode);
+ }
+ }
+ this.textNode = "";
+};
+
+/**
+ * @param {!string} text
+ * @return {!string}
+ */
+SAXParser.prototype.textopts$S = function (text) {
+ text = text.replace(/[\n\t]/g, ' ');
+ text = text.replace(/\s\s+/g, " ");
+ return text;
+};
+
+/**
+ * @param {!string} er
+ * @return {SAXParser}
+ */
+SAXParser.prototype.emiterror$S = function (er) {
+ /** @type {Error} */
+ var error;
+ this.closetext$();
+ er += "\nLine: " + (this.line + "") + "\nColumn: " + (this.column + "") + "\nChar: " + this.c;
+ error = new Error(er);
+ this.error = error;
+ return this;
+};
+
+/**
+ */
+SAXParser.prototype.end$ = function () {
+ if (! this.closedRoot) {
+ this.strictFail$S("Unclosed root tag");
+ }
+ if (this.state !== 2) {
+ this.emiterror$S("Unexpected end");
+ }
+ this.closetext$();
+ this.c = "";
+ this.closed = true;
+};
+
+/**
+ * @param {!string} message
+ */
+SAXParser.prototype.strictFail$S = function (message) {
+ if (this.strict) {
+ this.emiterror$S(message);
+ }
+};
+
+/**
+ */
+SAXParser.prototype.newTag$ = function () {
+ if (! this.strict) {
+ this.tagName = this.tagName.toLowerCase();
+ }
+ this.tag = ({name: this.tagName, attributes: ({ }), isSelfClosing: false});
+ this.attribList.length = 0;
+};
+
+/**
+ */
+SAXParser.prototype.attrib$ = function () {
+ if (! this.strict) {
+ this.attribName = this.attribName.toLowerCase();
+ }
+ if ($__jsx_ObjectHasOwnProperty.call(this.tag.attributes, this.attribName)) {
+ this.attribName = this.attribValue = "";
+ return;
+ }
+ this.tag.attributes[this.attribName] = this.attribValue;
+ this.closetext_if_exist$();
+ this.attribName = this.attribValue = "";
+};
+
+/**
+ */
+SAXParser.prototype.openTag$ = function () {
+ this.openTag$B(false);
+};
+
+/**
+ * @param {!boolean} selfClosing
+ */
+SAXParser.prototype.openTag$B = function (selfClosing) {
+ /** @type {Tag} */
+ var tag$0;
+ /** @type {Tag} */
+ var tag$1;
+ (tag$0 = this.tag).isSelfClosing = selfClosing;
+ this.sawRoot = true;
+ this.tags.push(tag$0);
+ this.closetext_if_exist$();
+ this.handler.onopentag$SHS((tag$1 = this.tag).name, tag$1.attributes);
+ if (this.tag.name === 'pre') {
+ this.preTags++;
+ }
+ if (! selfClosing) {
+ if (! this.noscript && this.tagName.toLowerCase() === "script") {
+ this.state = 33;
+ } else {
+ this.state = 2;
+ }
+ this.tag = null;
+ this.tagName = "";
+ }
+ this.attribName = this.attribValue = "";
+ this.attribList.length = 0;
+};
+
+/**
+ */
+SAXParser.prototype.closeTag$ = function () {
+ /** @type {!number} */
+ var t;
+ /** @type {!string} */
+ var tagName;
+ /** @type {!string} */
+ var closeTo;
+ /** @type {Tag} */
+ var close;
+ /** @type {!number} */
+ var s;
+ /** @type {Tag} */
+ var tag$0;
+ if (! this.tagName) {
+ this.strictFail$S("Weird empty close tag.");
+ this.textNode += "</>";
+ this.state = 2;
+ return;
+ }
+ if (this.script) {
+ if (this.tagName !== "script") {
+ this.script += "</" + this.tagName + ">";
+ this.tagName = "";
+ this.state = 33;
+ return;
+ }
+ this.closetext_if_exist$();
+ this.script = "";
+ }
+ t = this.tags.length;
+ tagName = this.tagName;
+ if (! this.strict) {
+ tagName = tagName.toLowerCase();
+ }
+ closeTo = tagName;
+ while (t--) {
+ close = this.tags[t];
+ if (close.name !== closeTo) {
+ this.strictFail$S("Unexpected close tag");
+ } else {
+ break;
+ }
+ }
+ if (t < 0) {
+ this.strictFail$S("Unmatched closing tag: " + this.tagName);
+ this.textNode += "</" + this.tagName + ">";
+ this.state = 2;
+ return;
+ }
+ this.tagName = tagName;
+ s = this.tags.length;
+ while (s-- > t) {
+ tag$0 = this.tag = this.tags.pop();
+ this.tagName = tag$0.name;
+ this.closetext_if_exist$();
+ this.handler.onclosetag$S(this.tagName);
+ if (this.tagName === 'pre') {
+ this.preTags--;
+ }
+ }
+ if (t === 0) {
+ this.closedRoot = true;
+ }
+ this.tagName = this.attribValue = this.attribName = "";
+ this.attribList.length = 0;
+ this.state = 2;
+};
+
+/**
+ * @return {!string}
+ */
+SAXParser.prototype.parseEntity$ = function () {
+ /** @type {!string} */
+ var entity;
+ /** @type {!string} */
+ var entityLC;
+ /** @type {!number} */
+ var num;
+ /** @type {!string} */
+ var numStr;
+ entity = this.entity;
+ entityLC = entity.toLowerCase();
+ num = 0;
+ numStr = "";
+ if (this.ENTITIES[entity]) {
+ return this.ENTITIES[entity];
+ }
+ if (this.ENTITIES[entityLC]) {
+ return this.ENTITIES[entityLC];
+ }
+ entity = entityLC;
+ if (entityLC.charAt(0) === "#") {
+ if (entity.charAt(1) === "x") {
+ entity = entity.slice(2);
+ num = $__jsx_parseInt(entity, 16);
+ numStr = num.toString(16);
+ } else {
+ entity = entity.slice(1);
+ num = $__jsx_parseInt(entity, 10);
+ numStr = num.toString(10);
+ }
+ }
+ entity = entity.replace(/^0+/, "");
+ if (numStr.toLowerCase() !== entity) {
+ this.strictFail$S("Invalid character entity");
+ return "&" + this.entity + ";";
+ }
+ return String.fromCharCode(num);
+};
+
+/**
+ * class Char extends Object
+ * @constructor
+ */
+function Char() {
+}
+
+/**
+ * @constructor
+ */
+function Char$() {
+ this.CDATA = "[CDATA[";
+ this.DOCTYPE = "DOCTYPE";
+ this.XML_NAMESPACE = "http://www.w3.org/XML/1998/namespace";
+ this.whitespace = this._charClass$S("\r\n\t ");
+ this.number = this._charClass$S("0124356789");
+ this.letter = this._charClass$S("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ");
+ this.quote = this._charClass$S("'\"");
+ this.entity = this._charClass$S("0124356789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ#");
+ this.attribEnd = this._charClass$S("\r\n\t >");
+ this.nameStart = /[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/;
+ this.nameBody = /[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040\.\d-]/;
+};
+
+Char$.prototype = new Char;
+
+/**
+ * @param {!string} str
+ * @return {Object.<string, undefined|!boolean>}
+ */
+Char.prototype._charClass$S = function (str) {
+ /** @type {Object.<string, undefined|!boolean>} */
+ var result;
+ /** @type {!number} */
+ var i;
+ result = ({ });
+ for (i = 0; i < str.length; i++) {
+ result[str.slice(i, i + 1)] = true;
+ }
+ return result;
+};
+
+/**
+ * @param {RegExp} charclass
+ * @param {!string} c
+ * @return {!boolean}
+ */
+Char.prototype.is$LRegExp$S = function (charclass, c) {
+ return charclass.test(c);
+};
+
+/**
+ * @param {Object.<string, undefined|!boolean>} charclass
+ * @param {!string} c
+ * @return {!boolean}
+ */
+Char.prototype.is$HBS = function (charclass, c) {
+ return $__jsx_ObjectHasOwnProperty.call(charclass, c);
+};
+
+/**
+ * @param {RegExp} charclass
+ * @param {!string} c
+ * @return {!boolean}
+ */
+Char.prototype.not$LRegExp$S = function (charclass, c) {
+ return ! charclass.test(c);
+};
+
+/**
+ * @param {Object.<string, undefined|!boolean>} charclass
+ * @param {!string} c
+ * @return {!boolean}
+ */
+Char.prototype.not$HBS = function (charclass, c) {
+ return ! $__jsx_ObjectHasOwnProperty.call(charclass, c);
+};
+
+/**
+ * class _Entities extends Object
+ * @constructor
+ */
+function _Entities() {
+}
+
+/**
+ * @constructor
+ */
+function _Entities$() {
+};
+
+_Entities$.prototype = new _Entities;
+
+/**
+ * @return {Object.<string, undefined|!string>}
+ */
+_Entities.entity_list$ = function () {
+ /** @type {Object.<string, undefined|!string>} */
+ var result;
+ /** @type {!string} */
+ var key;
+ /** @type {*} */
+ var value;
+ result = ({ });
+ for (key in _Entities._entities) {
+ value = _Entities._entities[key];
+ if (typeof value === 'string') {
+ result[key] = value + "";
+ } else {
+ if (typeof value === 'number') {
+ result[key] = String.fromCharCode(value | 0);
+ }
+ }
+ }
+ return result;
+};
+
+var _Entities$entity_list$ = _Entities.entity_list$;
+
+/**
+ * class BitVector extends Object
+ * @constructor
+ */
+function BitVector() {
+}
+
+/**
+ * @constructor
+ */
+function BitVector$() {
+ /** @type {Array.<undefined|!number>} */
+ var _v$0;
+ /** @type {Array.<undefined|!number>} */
+ var _r$0;
+ _r$0 = this._r = [ ];
+ _v$0 = this._v = [ ];
+ _v$0.length = 0;
+ _r$0.length = 0;
+ this._size = 0;
+ this._size1 = 0;
+};
+
+BitVector$.prototype = new BitVector;
+
+/**
+ */
+BitVector.prototype.build$ = function () {
+ /** @type {!number} */
+ var i;
+ this._size1 = 0;
+ for (i = 0; i < this._v.length; i++) {
+ if (i % 8 === 0) {
+ this._r.push(true ? this._size1 : this._size - this._size1);
+ }
+ this._size1 += this._rank32$IIB(this._v[i], 32, true);
+ }
+};
+
+/**
+ */
+BitVector.prototype.clear$ = function () {
+ this._v.length = 0;
+ this._r.length = 0;
+ this._size = 0;
+ this._size1 = 0;
+};
+
+/**
+ * @return {!number}
+ */
+BitVector.prototype.size$ = function () {
+ return this._size;
+};
+
+/**
+ * @param {!boolean} b
+ * @return {!number}
+ */
+BitVector.prototype.size$B = function (b) {
+ return (b ? this._size1 : this._size - this._size1);
+};
+
+/**
+ * @param {!number} value
+ */
+BitVector.prototype.set$I = function (value) {
+ this.set$IB(value, true);
+};
+
+/**
+ * @param {!number} value
+ * @param {!boolean} flag
+ */
+BitVector.prototype.set$IB = function (value, flag) {
+ /** @type {!number} */
+ var q;
+ /** @type {!number} */
+ var r;
+ /** @type {!number} */
+ var m;
+ if (value >= this._size) {
+ this._size = (value + 1 | 0);
+ }
+ q = (value / 32 | 0);
+ r = (value % 32 | 0);
+ while (q >= this._v.length) {
+ this._v.push(0);
+ }
+ m = 0x1 << r;
+ if (flag) {
+ this._v[q] |= m;
+ } else {
+ this._v[q] &= ~ m;
+ }
+};
+
+/**
+ * @param {!number} value
+ * @return {!boolean}
+ */
+BitVector.prototype.get$I = function (value) {
+ /** @type {!number} */
+ var q;
+ /** @type {!number} */
+ var r;
+ /** @type {!number} */
+ var m;
+ if (value >= this._size) {
+ throw new Error("BitVector.get() : range error");
+ }
+ q = (value / 32 | 0);
+ r = (value % 32 | 0);
+ m = 0x1 << r;
+ return !! (this._v[q] & m);
+};
+
+/**
+ * @param {!number} i
+ * @return {!number}
+ */
+BitVector.prototype.rank$I = function (i) {
+ return this.rank$IB(i, true);
+};
+
+/**
+ * @param {!number} i
+ * @param {!boolean} b
+ * @return {!number}
+ */
+BitVector.prototype.rank$IB = function (i, b) {
+ /** @type {!number} */
+ var q_large;
+ /** @type {!number} */
+ var q_small;
+ /** @type {!number} */
+ var r;
+ /** @type {!number} */
+ var rank;
+ /** @type {!number} */
+ var begin;
+ /** @type {!number} */
+ var j;
+ if (i > this._size) {
+ throw new Error("BitVector.rank() : range error");
+ }
+ if (i === 0) {
+ return 0;
+ }
+ i--;
+ q_large = (Math.floor(i / 256) | 0);
+ q_small = (Math.floor(i / 32) | 0);
+ r = (Math.floor(i % 32) | 0);
+ rank = (this._r[q_large] | 0);
+ if (! b) {
+ rank = q_large * 256 - rank;
+ }
+ begin = q_large * 8;
+ for (j = begin; j < q_small; j++) {
+ rank += this._rank32$IIB(this._v[j], 32, b);
+ }
+ rank += this._rank32$IIB(this._v[q_small], r + 1, b);
+ return rank;
+};
+
+/**
+ * @param {!number} i
+ * @return {!number}
+ */
+BitVector.prototype.select$I = function (i) {
+ return this.select$IB(i, true);
+};
+
+/**
+ * @param {!number} i
+ * @param {!boolean} b
+ * @return {!number}
+ */
+BitVector.prototype.select$IB = function (i, b) {
+ /** @type {!number} */
+ var left;
+ /** @type {!number} */
+ var right;
+ /** @type {!number} */
+ var pivot;
+ /** @type {undefined|!number} */
+ var rank;
+ /** @type {!number} */
+ var j;
+ if (i >= (b ? this._size1 : this._size - this._size1)) {
+ throw new Error("BitVector.select() : range error");
+ }
+ left = 0;
+ right = this._r.length;
+ while (left < right) {
+ pivot = Math.floor((left + right) / 2);
+ rank = this._r[pivot];
+ if (! b) {
+ rank = pivot * 256 - rank;
+ }
+ if (i < rank) {
+ right = pivot;
+ } else {
+ left = pivot + 1;
+ }
+ }
+ right--;
+ if (b) {
+ i -= (this._r[right] | 0);
+ } else {
+ i -= (right * 256 - this._r[right] | 0);
+ }
+ j = right * 8;
+ while (1) {
+ rank = this._rank32$IIB(this._v[j], 32, b);
+ if (i < rank) {
+ break;
+ }
+ j++;
+ i -= (rank | 0);
+ }
+ return (j * 32 + this._select32$IIB(this._v[j], i, b) | 0);
+};
+
+/**
+ * @param {!number} x
+ * @param {!number} i
+ * @param {!boolean} b
+ * @return {!number}
+ */
+BitVector.prototype._rank32$IIB = function (x, i, b) {
+ if (! b) {
+ x = ~ x;
+ }
+ x <<= 32 - i;
+ x = ((x & 0xaaaaaaaa) >>> 1) + (x & 0x55555555);
+ x = ((x & 0xcccccccc) >>> 2) + (x & 0x33333333);
+ x = ((x & 0xf0f0f0f0) >>> 4) + (x & 0x0f0f0f0f);
+ x = ((x & 0xff00ff00) >>> 8) + (x & 0x00ff00ff);
+ x = ((x & 0xffff0000) >>> 16) + (x & 0x0000ffff);
+ return x;
+};
+
+/**
+ * @param {!number} x
+ * @param {!number} i
+ * @param {!boolean} b
+ * @return {!number}
+ */
+BitVector.prototype._select32$IIB = function (x, i, b) {
+ /** @type {!number} */
+ var x1;
+ /** @type {!number} */
+ var x2;
+ /** @type {!number} */
+ var x3;
+ /** @type {!number} */
+ var x4;
+ /** @type {!number} */
+ var x5;
+ /** @type {!number} */
+ var pos;
+ /** @type {!number} */
+ var v5;
+ /** @type {!number} */
+ var v4;
+ /** @type {!number} */
+ var v3;
+ /** @type {!number} */
+ var v2;
+ /** @type {!number} */
+ var v1;
+ /** @type {!number} */
+ var v0;
+ if (! b) {
+ x = ~ x;
+ }
+ x1 = ((x & 0xaaaaaaaa) >>> 1) + (x & 0x55555555);
+ x2 = ((x1 & 0xcccccccc) >>> 2) + (x1 & 0x33333333);
+ x3 = ((x2 & 0xf0f0f0f0) >>> 4) + (x2 & 0x0f0f0f0f);
+ x4 = ((x3 & 0xff00ff00) >>> 8) + (x3 & 0x00ff00ff);
+ x5 = ((x4 & 0xffff0000) >>> 16) + (x4 & 0x0000ffff);
+ i++;
+ pos = 0;
+ v5 = x5 & 0xffffffff;
+ if (i > v5) {
+ i -= (v5 | 0);
+ pos += 32;
+ }
+ v4 = x4 >>> pos & 0x0000ffff;
+ if (i > v4) {
+ i -= (v4 | 0);
+ pos += 16;
+ }
+ v3 = x3 >>> pos & 0x000000ff;
+ if (i > v3) {
+ i -= (v3 | 0);
+ pos += 8;
+ }
+ v2 = x2 >>> pos & 0x0000000f;
+ if (i > v2) {
+ i -= (v2 | 0);
+ pos += 4;
+ }
+ v1 = x1 >>> pos & 0x00000003;
+ if (i > v1) {
+ i -= (v1 | 0);
+ pos += 2;
+ }
+ v0 = x >>> pos & 0x00000001;
+ if (i > v0) {
+ i -= (v0 | 0);
+ pos += 1;
+ }
+ return (pos | 0);
+};
+
+/**
+ * @return {!string}
+ */
+BitVector.prototype.dump$ = function () {
+ /** @type {Array.<undefined|!string>} */
+ var contents;
+ contents = [ ];
+ contents.push(Binary$dump32bitNumber$N(this._size));
+ contents.push(Binary$dump32bitNumberList$AN(this._v));
+ return contents.join('');
+};
+
+/**
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+BitVector.prototype.dump$LCompressionReport$ = function (report) {
+ /** @type {Array.<undefined|!string>} */
+ var contents;
+ contents = [ ];
+ contents.push(Binary$dump32bitNumber$N(this._size));
+ CompressionReport$add$LCompressionReport$II(report, 2, 2);
+ contents.push(Binary$dump32bitNumberList$ANLCompressionReport$(this._v, report));
+ return contents.join('');
+};
+
+/**
+ * @param {!string} data
+ * @return {!number}
+ */
+BitVector.prototype.load$S = function (data) {
+ return this.load$SI(data, 0);
+};
+
+/**
+ * @param {!string} data
+ * @param {!number} offset
+ * @return {!number}
+ */
+BitVector.prototype.load$SI = function (data, offset) {
+ /** @type {LoadedNumberListResult} */
+ var result;
+ /** @type {!number} */
+ var result$0;
+ this._v.length = 0;
+ this._r.length = 0;
+ this._size = 0;
+ this._size1 = 0;
+ result$0 = data.charCodeAt(offset) * 65536 + data.charCodeAt(offset + 1);
+ this._size = (result$0 | 0);
+ result = Binary$load32bitNumberList$SI(data, offset + 2);
+ this._v = result.result;
+ this.build$();
+ return result.offset;
+};
+
+/**
+ * class WaveletMatrix extends Object
+ * @constructor
+ */
+function WaveletMatrix() {
+}
+
+/**
+ * @constructor
+ */
+function WaveletMatrix$() {
+ /** @type {Array.<undefined|BitVector>} */
+ var _bv$0;
+ /** @type {Array.<undefined|!number>} */
+ var _seps$0;
+ this._range = ({ });
+ _bv$0 = this._bv = [ ];
+ _seps$0 = this._seps = [ ];
+ this._bitsize = 16;
+ _bv$0.length = 0;
+ _seps$0.length = 0;
+ this._size = 0;
+};
+
+WaveletMatrix$.prototype = new WaveletMatrix;
+
+/**
+ * @return {!number}
+ */
+WaveletMatrix.prototype.bitsize$ = function () {
+ return this._bitsize;
+};
+
+/**
+ * @param {!number} charCode
+ */
+WaveletMatrix.prototype.setMaxCharCode$I = function (charCode) {
+ this._bitsize = (Math.ceil(Math.log(charCode) / 0.6931471805599453) | 0);
+};
+
+/**
+ */
+WaveletMatrix.prototype.clear$ = function () {
+ this._bv.length = 0;
+ this._seps.length = 0;
+ this._size = 0;
+};
+
+/**
+ * @param {!string} v
+ */
+WaveletMatrix.prototype.build$S = function (v) {
+ /** @type {!number} */
+ var size;
+ /** @type {!number} */
+ var bitsize;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var depth;
+ /** @type {Object.<string, undefined|!number>} */
+ var range_tmp;
+ /** @type {!number} */
+ var code;
+ /** @type {!boolean} */
+ var bit;
+ /** @type {!number} */
+ var key;
+ /** @type {Object.<string, undefined|!number>} */
+ var range_rev;
+ /** @type {!string} */
+ var range_key;
+ /** @type {!number} */
+ var value;
+ /** @type {!number} */
+ var pos0;
+ /** @type {undefined|!number} */
+ var pos1;
+ /** @type {!string} */
+ var range_rev_key;
+ /** @type {!number} */
+ var begin;
+ /** @type {undefined|!number} */
+ var end;
+ /** @type {!number} */
+ var num0;
+ /** @type {!number} */
+ var num1;
+ this._bv.length = 0;
+ this._seps.length = 0;
+ this._size = 0;
+ size = v.length;
+ bitsize = this._bitsize;
+ for (i = 0; i < bitsize; i++) {
+ this._bv.push(new BitVector$());
+ this._seps.push(0);
+ }
+ this._size = (size | 0);
+ for (i = 0; i < size; i++) {
+ this._bv[0].set$IB(i, this._uint2bit$II(v.charCodeAt(i), 0));
+ }
+ this._bv[0].build$();
+ this._seps[0] = this._bv[0].size$B(false);
+ this._range["0"] = 0;
+ this._range["1"] = this._seps[0];
+ depth = 1;
+ while (depth < bitsize) {
+ range_tmp = WaveletMatrix$_shallow_copy$HI(this._range);
+ for (i = 0; i < size; i++) {
+ code = v.charCodeAt(i);
+ bit = this._uint2bit$II(code, depth);
+ key = code >>> bitsize - depth;
+ this._bv[depth].set$IB(range_tmp[key + ""], bit);
+ range_tmp[key + ""]++;
+ }
+ this._bv[depth].build$();
+ this._seps[depth] = this._bv[depth].size$B(false);
+ range_rev = ({ });
+ for (range_key in this._range) {
+ value = this._range[range_key];
+ if (value != range_tmp[range_key]) {
+ range_rev[value + ""] = range_key | 0;
+ }
+ }
+ this._range = ({ });
+ pos0 = 0;
+ pos1 = this._seps[depth];
+ for (range_rev_key in range_rev) {
+ begin = range_rev_key | 0;
+ value = range_rev[range_rev_key];
+ end = range_tmp[value + ""];
+ num0 = this._bv[depth].rank$IB(end, false) - this._bv[depth].rank$IB(begin, false);
+ num1 = end - begin - num0;
+ if (num0 > 0) {
+ this._range[(value << 1) + ""] = (pos0 | 0);
+ pos0 += num0;
+ }
+ if (num1 > 0) {
+ this._range[(value << 1) + 1 + ""] = pos1;
+ pos1 += (num1 | 0);
+ }
+ }
+ depth++;
+ }
+};
+
+/**
+ * @return {!number}
+ */
+WaveletMatrix.prototype.size$ = function () {
+ return this._size;
+};
+
+/**
+ * @param {!number} c
+ * @return {!number}
+ */
+WaveletMatrix.prototype.size$I = function (c) {
+ return this.rank$II(this._size, c);
+};
+
+/**
+ * @param {!number} i
+ * @return {!number}
+ */
+WaveletMatrix.prototype.get$I = function (i) {
+ /** @type {!number} */
+ var value;
+ /** @type {!number} */
+ var depth;
+ /** @type {!boolean} */
+ var bit;
+ if (i >= this._size) {
+ throw new Error("WaveletMatrix.get() : range error");
+ }
+ value = 0;
+ depth = 0;
+ while (depth < this._bitsize) {
+ bit = this._bv[depth].get$I(i);
+ i = this._bv[depth].rank$IB(i, bit);
+ value <<= 1;
+ if (bit) {
+ i += this._seps[depth];
+ value += 1;
+ }
+ depth++;
+ }
+ return (value | 0);
+};
+
+/**
+ * @param {!number} i
+ * @param {!number} c
+ * @return {!number}
+ */
+WaveletMatrix.prototype.rank$II = function (i, c) {
+ /** @type {undefined|!number} */
+ var begin;
+ /** @type {!number} */
+ var end;
+ /** @type {!number} */
+ var depth;
+ /** @type {!boolean} */
+ var bit;
+ if (i > this._size) {
+ throw new Error("WaveletMatrix.rank(): range error");
+ }
+ if (i === 0) {
+ return 0;
+ }
+ begin = this._range[c + ""];
+ if (begin == null) {
+ return 0;
+ }
+ end = i;
+ depth = 0;
+ while (depth < this._bitsize) {
+ bit = this._uint2bit$II(c, depth);
+ end = this._bv[depth].rank$IB(end, bit);
+ if (bit) {
+ end += this._seps[depth];
+ }
+ depth++;
+ }
+ return (end - begin | 0);
+};
+
+/**
+ * @param {!number} i
+ * @param {!number} c
+ * @return {!number}
+ */
+WaveletMatrix.prototype.rank_less_than$II = function (i, c) {
+ /** @type {!number} */
+ var begin;
+ /** @type {!number} */
+ var end;
+ /** @type {!number} */
+ var depth;
+ /** @type {!number} */
+ var rlt;
+ /** @type {!number} */
+ var rank0_begin;
+ /** @type {!number} */
+ var rank0_end;
+ /** @type {Array.<undefined|!number>} */
+ var _seps$0;
+ if (i > this._size) {
+ throw new Error("WaveletMatrix.rank_less_than(): range error");
+ }
+ if (i === 0) {
+ return 0;
+ }
+ begin = 0;
+ end = i;
+ depth = 0;
+ rlt = 0;
+ while (depth < this._bitsize) {
+ rank0_begin = this._bv[depth].rank$IB(begin, false);
+ rank0_end = this._bv[depth].rank$IB(end, false);
+ if (this._uint2bit$II(c, depth)) {
+ rlt += rank0_end - rank0_begin;
+ begin += (_seps$0 = this._seps)[depth] - rank0_begin;
+ end += _seps$0[depth] - rank0_end;
+ } else {
+ begin = rank0_begin;
+ end = rank0_end;
+ }
+ depth++;
+ }
+ return (rlt | 0);
+};
+
+/**
+ * @return {!string}
+ */
+WaveletMatrix.prototype.dump$ = function () {
+ /** @type {Array.<undefined|!string>} */
+ var contents;
+ /** @type {!number} */
+ var i;
+ /** @type {Array.<undefined|!string>} */
+ var range_contents;
+ /** @type {!number} */
+ var counter;
+ /** @type {!string} */
+ var key;
+ contents = [ Binary$dump16bitNumber$I(this._bitsize), Binary$dump32bitNumber$N(this._size) ];
+ for (i = 0; i < this._bitsize; i++) {
+ contents.push(this._bv[i].dump$());
+ }
+ for (i = 0; i < this._bitsize; i++) {
+ contents.push(Binary$dump32bitNumber$N(this._seps[i]));
+ }
+ range_contents = [ ];
+ counter = 0;
+ for (key in this._range) {
+ range_contents.push(Binary$dump32bitNumber$N(key | 0));
+ range_contents.push(Binary$dump32bitNumber$N(this._range[key]));
+ counter++;
+ }
+ contents.push(Binary$dump32bitNumber$N(counter));
+ return contents.join('') + range_contents.join('');
+};
+
+/**
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+WaveletMatrix.prototype.dump$LCompressionReport$ = function (report) {
+ /** @type {Array.<undefined|!string>} */
+ var contents;
+ /** @type {!number} */
+ var i;
+ /** @type {Array.<undefined|!string>} */
+ var range_contents;
+ /** @type {!number} */
+ var counter;
+ /** @type {!string} */
+ var key;
+ contents = [ Binary$dump16bitNumber$I(this._bitsize), Binary$dump32bitNumber$N(this._size) ];
+ CompressionReport$add$LCompressionReport$II(report, 3, 3);
+ for (i = 0; i < this._bitsize; i++) {
+ contents.push(this._bv[i].dump$LCompressionReport$(report));
+ }
+ for (i = 0; i < this._bitsize; i++) {
+ contents.push(Binary$dump32bitNumber$N(this._seps[i]));
+ CompressionReport$add$LCompressionReport$II(report, 2, 2);
+ }
+ range_contents = [ ];
+ counter = 0;
+ for (key in this._range) {
+ range_contents.push(Binary$dump32bitNumber$N(key | 0));
+ range_contents.push(Binary$dump32bitNumber$N(this._range[key]));
+ CompressionReport$add$LCompressionReport$II(report, 4, 4);
+ counter++;
+ }
+ CompressionReport$add$LCompressionReport$II(report, 2, 2);
+ contents.push(Binary$dump32bitNumber$N(counter));
+ return contents.join('') + range_contents.join('');
+};
+
+/**
+ * @param {!string} data
+ * @return {!number}
+ */
+WaveletMatrix.prototype.load$S = function (data) {
+ return this.load$SI(data, 0);
+};
+
+/**
+ * @param {!string} data
+ * @param {!number} offset
+ * @return {!number}
+ */
+WaveletMatrix.prototype.load$SI = function (data, offset) {
+ /** @type {!number} */
+ var i;
+ /** @type {BitVector} */
+ var bit_vector;
+ /** @type {!number} */
+ var range_size;
+ /** @type {!number} */
+ var value;
+ /** @type {!number} */
+ var offset$0;
+ /** @type {!number} */
+ var result$0;
+ /** @type {!number} */
+ var result$1;
+ /** @type {!number} */
+ var result$2;
+ this._bv.length = 0;
+ this._seps.length = 0;
+ this._size = 0;
+ offset$0 = offset++;
+ this._bitsize = (data.charCodeAt(offset$0) | 0);
+ result$0 = data.charCodeAt(offset) * 65536 + data.charCodeAt(offset + 1);
+ this._size = (result$0 | 0);
+ offset += 2;
+ for (i = 0; i < this._bitsize; i++) {
+ bit_vector = new BitVector$();
+ offset = bit_vector.load$SI(data, offset);
+ this._bv.push(bit_vector);
+ }
+ for (i = 0; i < this._bitsize; (i++, offset += 2)) {
+ this._seps.push(Binary$load32bitNumber$SI(data, offset));
+ }
+ result$1 = data.charCodeAt(offset) * 65536 + data.charCodeAt(offset + 1);
+ range_size = result$1;
+ offset += 2;
+ for (i = 0; i < range_size; (i++, offset += 4)) {
+ result$2 = data.charCodeAt(offset) * 65536 + data.charCodeAt(offset + 1);
+ value = Binary$load32bitNumber$SI(data, offset + 2);
+ this._range[result$2 + ""] = (value | 0);
+ }
+ return offset;
+};
+
+/**
+ * @param {Object.<string, undefined|!number>} input
+ * @return {Object.<string, undefined|!number>}
+ */
+WaveletMatrix._shallow_copy$HI = function (input) {
+ /** @type {Object.<string, undefined|!number>} */
+ var result;
+ /** @type {!string} */
+ var key;
+ result = ({ });
+ for (key in input) {
+ result[key] = input[key];
+ }
+ return result;
+};
+
+var WaveletMatrix$_shallow_copy$HI = WaveletMatrix._shallow_copy$HI;
+
+/**
+ * @param {!number} c
+ * @param {!number} i
+ * @return {!boolean}
+ */
+WaveletMatrix.prototype._uint2bit$II = function (c, i) {
+ return (c >>> this._bitsize - 1 - i & 0x1) === 0x1;
+};
+
+/**
+ * class BurrowsWheelerTransform extends Object
+ * @constructor
+ */
+function BurrowsWheelerTransform() {
+}
+
+/**
+ * @constructor
+ */
+function BurrowsWheelerTransform$() {
+ this._str = "";
+ this._size = 0;
+ this._head = 0;
+ this._suffixarray = [ ];
+};
+
+BurrowsWheelerTransform$.prototype = new BurrowsWheelerTransform;
+
+/**
+ * @param {BurrowsWheelerTransform} $this
+ * @return {!number}
+ */
+BurrowsWheelerTransform.size$LBurrowsWheelerTransform$ = function ($this) {
+ return $this._size;
+};
+
+var BurrowsWheelerTransform$size$LBurrowsWheelerTransform$ = BurrowsWheelerTransform.size$LBurrowsWheelerTransform$;
+
+/**
+ * @param {BurrowsWheelerTransform} $this
+ * @return {!number}
+ */
+BurrowsWheelerTransform.head$LBurrowsWheelerTransform$ = function ($this) {
+ return $this._head;
+};
+
+var BurrowsWheelerTransform$head$LBurrowsWheelerTransform$ = BurrowsWheelerTransform.head$LBurrowsWheelerTransform$;
+
+/**
+ * @param {BurrowsWheelerTransform} $this
+ */
+BurrowsWheelerTransform.clear$LBurrowsWheelerTransform$ = function ($this) {
+ $this._str = "";
+ $this._size = 0;
+ $this._head = 0;
+ $this._suffixarray.length = 0;
+};
+
+var BurrowsWheelerTransform$clear$LBurrowsWheelerTransform$ = BurrowsWheelerTransform.clear$LBurrowsWheelerTransform$;
+
+/**
+ * @param {BurrowsWheelerTransform} $this
+ * @param {!string} str
+ */
+BurrowsWheelerTransform.build$LBurrowsWheelerTransform$S = function ($this, str) {
+ /** @type {!string} */
+ var _str$0;
+ /** @type {Array.<undefined|!number>} */
+ var _suffixarray$0;
+ _str$0 = $this._str = str;
+ $this._size = _str$0.length;
+ _suffixarray$0 = $this._suffixarray = SAIS$make$S(str);
+ $this._head = (_suffixarray$0.indexOf(0) | 0);
+};
+
+var BurrowsWheelerTransform$build$LBurrowsWheelerTransform$S = BurrowsWheelerTransform.build$LBurrowsWheelerTransform$S;
+
+/**
+ * @param {BurrowsWheelerTransform} $this
+ * @param {!number} i
+ * @return {!string}
+ */
+BurrowsWheelerTransform.get$LBurrowsWheelerTransform$I = function ($this, i) {
+ /** @type {!number} */
+ var size;
+ /** @type {!number} */
+ var index;
+ size = $this._size;
+ if (i >= size) {
+ throw new Error("BurrowsWheelerTransform.get() : range error");
+ }
+ index = ($this._suffixarray[i] + size - 1) % size;
+ return $this._str.charAt(index);
+};
+
+var BurrowsWheelerTransform$get$LBurrowsWheelerTransform$I = BurrowsWheelerTransform.get$LBurrowsWheelerTransform$I;
+
+/**
+ * @param {BurrowsWheelerTransform} $this
+ * @return {!string}
+ */
+BurrowsWheelerTransform.get$LBurrowsWheelerTransform$ = function ($this) {
+ /** @type {Array.<undefined|!string>} */
+ var str;
+ /** @type {!number} */
+ var size;
+ /** @type {!number} */
+ var i;
+ str = [ ];
+ size = $this._size;
+ for (i = 0; i < size; i++) {
+ str.push(BurrowsWheelerTransform$get$LBurrowsWheelerTransform$I($this, i));
+ }
+ return str.join("");
+};
+
+var BurrowsWheelerTransform$get$LBurrowsWheelerTransform$ = BurrowsWheelerTransform.get$LBurrowsWheelerTransform$;
+
+/**
+ * @param {BurrowsWheelerTransform} $this
+ * @param {!string} replace
+ * @return {!string}
+ */
+BurrowsWheelerTransform.get$LBurrowsWheelerTransform$S = function ($this, replace) {
+ /** @type {!string} */
+ var result;
+ result = BurrowsWheelerTransform$get$LBurrowsWheelerTransform$($this);
+ return result.replace(BurrowsWheelerTransform.END_MARKER, replace);
+};
+
+var BurrowsWheelerTransform$get$LBurrowsWheelerTransform$S = BurrowsWheelerTransform.get$LBurrowsWheelerTransform$S;
+
+/**
+ * class OArray extends Object
+ * @constructor
+ */
+function OArray() {
+}
+
+/**
+ * @constructor
+ * @param {Array.<undefined|!number>} array
+ */
+function OArray$AI(array) {
+ this.array = array;
+ this.offset = 0;
+};
+
+OArray$AI.prototype = new OArray;
+
+/**
+ * @constructor
+ * @param {Array.<undefined|!number>} array
+ * @param {!number} offset
+ */
+function OArray$AII(array, offset) {
+ this.array = array;
+ this.offset = offset;
+};
+
+OArray$AII.prototype = new OArray;
+
+/**
+ * @param {OArray} $this
+ * @param {!number} index
+ * @return {!number}
+ */
+OArray.get$LOArray$I = function ($this, index) {
+ return $this.array[index + $this.offset];
+};
+
+var OArray$get$LOArray$I = OArray.get$LOArray$I;
+
+/**
+ * @param {OArray} $this
+ * @param {!number} index
+ * @param {!number} value
+ */
+OArray.set$LOArray$II = function ($this, index, value) {
+ $this.array[index + $this.offset] = value;
+};
+
+var OArray$set$LOArray$II = OArray.set$LOArray$II;
+
+/**
+ * @param {OArray} $this
+ * @param {!number} index
+ * @return {!boolean}
+ */
+OArray.isS$LOArray$I = function ($this, index) {
+ /** @type {Array.<undefined|!number>} */
+ var array$0;
+ /** @type {!number} */
+ var offset$0;
+ return (array$0 = $this.array)[index + (offset$0 = $this.offset)] < array$0[index + offset$0 + 1];
+};
+
+var OArray$isS$LOArray$I = OArray.isS$LOArray$I;
+
+/**
+ * @param {OArray} $this
+ * @param {!number} index1
+ * @param {!number} index2
+ * @return {!boolean}
+ */
+OArray.compare$LOArray$II = function ($this, index1, index2) {
+ /** @type {Array.<undefined|!number>} */
+ var array$0;
+ /** @type {!number} */
+ var offset$0;
+ return (array$0 = $this.array)[index1 + (offset$0 = $this.offset)] == array$0[index2 + offset$0];
+};
+
+var OArray$compare$LOArray$II = OArray.compare$LOArray$II;
+
+/**
+ * class SAIS extends Object
+ * @constructor
+ */
+function SAIS() {
+}
+
+/**
+ * @constructor
+ */
+function SAIS$() {
+};
+
+SAIS$.prototype = new SAIS;
+
+/**
+ * @param {BitVector} t
+ * @param {!number} i
+ * @return {!boolean}
+ */
+SAIS._isLMS$LBitVector$I = function (t, i) {
+ return i > 0 && t.get$I(i) && ! t.get$I(i - 1);
+};
+
+var SAIS$_isLMS$LBitVector$I = SAIS._isLMS$LBitVector$I;
+
+/**
+ * @param {OArray} s
+ * @param {Array.<undefined|!number>} bkt
+ * @param {!number} n
+ * @param {!number} K
+ * @param {!boolean} end
+ */
+SAIS._getBuckets$LOArray$AIIIB = function (s, bkt, n, K, end) {
+ /** @type {!number} */
+ var sum;
+ /** @type {!number} */
+ var i;
+ sum = 0;
+ for (i = 0; i <= K; i++) {
+ bkt[i] = 0;
+ }
+ for (i = 0; i < n; i++) {
+ bkt[OArray$get$LOArray$I(s, i)]++;
+ }
+ for (i = 0; i <= K; i++) {
+ sum += bkt[i];
+ bkt[i] = ((end ? sum : sum - bkt[i]) | 0);
+ }
+};
+
+var SAIS$_getBuckets$LOArray$AIIIB = SAIS._getBuckets$LOArray$AIIIB;
+
+/**
+ * @param {BitVector} t
+ * @param {Array.<undefined|!number>} SA
+ * @param {OArray} s
+ * @param {Array.<undefined|!number>} bkt
+ * @param {!number} n
+ * @param {!number} K
+ * @param {!boolean} end
+ */
+SAIS._induceSAl$LBitVector$AILOArray$AIIIB = function (t, SA, s, bkt, n, K, end) {
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var j;
+ SAIS$_getBuckets$LOArray$AIIIB(s, bkt, n, K, end);
+ for (i = 0; i < n; i++) {
+ j = SA[i] - 1;
+ if (j >= 0 && ! t.get$I(j)) {
+ SA[bkt[OArray$get$LOArray$I(s, j)]++] = (j | 0);
+ }
+ }
+};
+
+var SAIS$_induceSAl$LBitVector$AILOArray$AIIIB = SAIS._induceSAl$LBitVector$AILOArray$AIIIB;
+
+/**
+ * @param {BitVector} t
+ * @param {Array.<undefined|!number>} SA
+ * @param {OArray} s
+ * @param {Array.<undefined|!number>} bkt
+ * @param {!number} n
+ * @param {!number} K
+ * @param {!boolean} end
+ */
+SAIS._induceSAs$LBitVector$AILOArray$AIIIB = function (t, SA, s, bkt, n, K, end) {
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var j;
+ SAIS$_getBuckets$LOArray$AIIIB(s, bkt, n, K, end);
+ for (i = n - 1; i >= 0; i--) {
+ j = SA[i] - 1;
+ if (j >= 0 && t.get$I(j)) {
+ SA[-- bkt[OArray$get$LOArray$I(s, j)]] = (j | 0);
+ }
+ }
+};
+
+var SAIS$_induceSAs$LBitVector$AILOArray$AIIIB = SAIS._induceSAs$LBitVector$AILOArray$AIIIB;
+
+/**
+ * @param {!string} source
+ * @return {Array.<undefined|!number>}
+ */
+SAIS.make$S = function (source) {
+ /** @type {Array.<undefined|!number>} */
+ var charCodes;
+ /** @type {!number} */
+ var maxCode;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var code;
+ /** @type {Array.<undefined|!number>} */
+ var SA;
+ /** @type {OArray} */
+ var s;
+ charCodes = [ ];
+ charCodes.length = source.length;
+ maxCode = 0;
+ for (i = 0; i < source.length; i++) {
+ code = source.charCodeAt(i);
+ charCodes[i] = (code | 0);
+ maxCode = (code > maxCode ? code : maxCode);
+ }
+ SA = [ ];
+ SA.length = source.length;
+ s = ({offset: 0, array: charCodes});
+ SAIS$_make$LOArray$AIII(s, SA, source.length, maxCode);
+ return SA;
+};
+
+var SAIS$make$S = SAIS.make$S;
+
+/**
+ * @param {OArray} s
+ * @param {Array.<undefined|!number>} SA
+ * @param {!number} n
+ * @param {!number} K
+ */
+SAIS._make$LOArray$AIII = function (s, SA, n, K) {
+ /** @type {BitVector} */
+ var t;
+ /** @type {!number} */
+ var i;
+ /** @type {Array.<undefined|!number>} */
+ var bkt;
+ /** @type {!number} */
+ var n1;
+ /** @type {!number} */
+ var name;
+ /** @type {!number} */
+ var prev;
+ /** @type {undefined|!number} */
+ var pos;
+ /** @type {!boolean} */
+ var diff;
+ /** @type {!number} */
+ var d;
+ /** @type {!number} */
+ var j;
+ /** @type {Array.<undefined|!number>} */
+ var SA1;
+ /** @type {OArray} */
+ var s1;
+ /** @type {!number} */
+ var i$0;
+ /** @type {!number} */
+ var index$0;
+ t = new BitVector$();
+ t.set$IB(n - 2, false);
+ t.set$IB(n - 1, true);
+ for (i = n - 3; i >= 0; i--) {
+ t.set$IB(i, OArray$isS$LOArray$I(s, i) || OArray$compare$LOArray$II(s, i, i + 1) && t.get$I(i + 1));
+ }
+ bkt = [ ];
+ bkt.length = K + 1;
+ SAIS$_getBuckets$LOArray$AIIIB(s, bkt, n, K, true);
+ for (i = 0; i < n; i++) {
+ SA[i] = -1;
+ }
+ for (i = 1; i < n; i++) {
+ if (SAIS$_isLMS$LBitVector$I(t, i)) {
+ SA[-- bkt[OArray$get$LOArray$I(s, i)]] = (i | 0);
+ }
+ }
+ SAIS$_induceSAl$LBitVector$AILOArray$AIIIB(t, SA, s, bkt, n, K, false);
+ SAIS$_induceSAs$LBitVector$AILOArray$AIIIB(t, SA, s, bkt, n, K, true);
+ n1 = 0;
+ for (i = 0; i < n; i++) {
+ i$0 = SA[i];
+ if (i$0 > 0 && t.get$I(i$0) && ! t.get$I(i$0 - 1)) {
+ SA[n1++] = SA[i];
+ }
+ }
+ for (i = n1; i < n; i++) {
+ SA[i] = -1;
+ }
+ name = 0;
+ prev = -1;
+ for (i = 0; i < n1; i++) {
+ pos = SA[i];
+ diff = false;
+ for (d = 0; d < n; d++) {
+ if (prev === -1 || ! OArray$compare$LOArray$II(s, pos + d, prev + d) || t.get$I(pos + d) !== t.get$I(prev + d)) {
+ diff = true;
+ break;
+ } else {
+ if (d > 0 && (SAIS$_isLMS$LBitVector$I(t, pos + d) || SAIS$_isLMS$LBitVector$I(t, prev + d))) {
+ break;
+ }
+ }
+ }
+ if (diff) {
+ name++;
+ prev = pos;
+ }
+ pos = ((pos % 2 === 0 ? pos / 2 : (pos - 1) / 2) | 0);
+ SA[n1 + pos] = (name - 1 | 0);
+ }
+ for ((i = n - 1, j = n - 1); i >= n1; i--) {
+ if (SA[i] >= 0) {
+ SA[j--] = SA[i];
+ }
+ }
+ SA1 = SA;
+ s1 = ({offset: n - n1, array: SA});
+ if (name < n1) {
+ SAIS$_make$LOArray$AIII(s1, SA1, n1, name - 1);
+ } else {
+ for (i = 0; i < n1; i++) {
+ SA1[OArray$get$LOArray$I(s1, i)] = (i | 0);
+ }
+ }
+ bkt = [ ];
+ bkt.length = K + 1;
+ SAIS$_getBuckets$LOArray$AIIIB(s, bkt, n, K, true);
+ for ((i = 1, j = 0); i < n; i++) {
+ if (SAIS$_isLMS$LBitVector$I(t, i)) {
+ OArray$set$LOArray$II(s1, j++, i);
+ }
+ }
+ for (i = 0; i < n1; i++) {
+ index$0 = SA1[i];
+ SA1[i] = s1.array[index$0 + s1.offset];
+ }
+ for (i = n1; i < n; i++) {
+ SA[i] = -1;
+ }
+ for (i = n1 - 1; i >= 0; i--) {
+ j = SA[i];
+ SA[i] = -1;
+ SA[-- bkt[OArray$get$LOArray$I(s, j)]] = (j | 0);
+ }
+ SAIS$_induceSAl$LBitVector$AILOArray$AIIIB(t, SA, s, bkt, n, K, false);
+ SAIS$_induceSAs$LBitVector$AILOArray$AIIIB(t, SA, s, bkt, n, K, true);
+};
+
+var SAIS$_make$LOArray$AIII = SAIS._make$LOArray$AIII;
+
+OktaviaSearch._stemmer = null;
+OktaviaSearch._instance = null;
+$__jsx_lazy_init(Oktavia, "eof", function () {
+ return String.fromCharCode(0);
+});
+$__jsx_lazy_init(Oktavia, "eob", function () {
+ return String.fromCharCode(1);
+});
+$__jsx_lazy_init(Oktavia, "unknown", function () {
+ return String.fromCharCode(3);
+});
+Binary._base64EncodeChars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
+$__jsx_lazy_init(Binary, "_base64DecodeChars", function () {
+ return [ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 62, -1, -1, -1, 63, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, -1, -1, -1, -1, -1, -1, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -1, -1, -1, -1, -1, -1, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, -1, -1, -1, -1 ];
+});
+$__jsx_lazy_init(Style, "console", function () {
+ return ({ 'title': [ '\x1B[32m\x1b[4m', '\x1B[39m\x1b[0m' ], 'url': [ '\x1B[34m', '\x1B[39m' ], 'hit': [ '\x1B[4m', '\x1B[0m' ], 'del': [ '\x1B[9m', '\x1B[0m' ], 'summary': [ '\x1B[90m', '\x1B[39m' ] });
+});
+$__jsx_lazy_init(Style, "html", function () {
+ return ({ 'title': [ '<span class="title">', '</span>' ], 'url': [ '<span class="url">', '</span>' ], 'hit': [ '<span class="hit">', '</span>' ], 'del': [ '<del>', '</del>' ], 'summary': [ '<span class="reuslt">', '</span>' ] });
+});
+$__jsx_lazy_init(Style, "ignore", function () {
+ return ({ 'tilte': [ '', '' ], 'url': [ '', '' ], 'hit': [ '', '' ], 'del': [ '', '' ], 'summary': [ '', '' ] });
+});
+HungarianStemmer.serialVersionUID = 1;
+$__jsx_lazy_init(HungarianStemmer, "methodObject", function () {
+ return new HungarianStemmer$();
+});
+$__jsx_lazy_init(HungarianStemmer, "a_0", function () {
+ return [ new Among$SII("cs", -1, -1), new Among$SII("dzs", -1, -1), new Among$SII("gy", -1, -1), new Among$SII("ly", -1, -1), new Among$SII("ny", -1, -1), new Among$SII("sz", -1, -1), new Among$SII("ty", -1, -1), new Among$SII("zs", -1, -1) ];
+});
+$__jsx_lazy_init(HungarianStemmer, "a_1", function () {
+ return [ new Among$SII("\u00E1", -1, 1), new Among$SII("\u00E9", -1, 2) ];
+});
+$__jsx_lazy_init(HungarianStemmer, "a_2", function () {
+ return [ new Among$SII("bb", -1, -1), new Among$SII("cc", -1, -1), new Among$SII("dd", -1, -1), new Among$SII("ff", -1, -1), new Among$SII("gg", -1, -1), new Among$SII("jj", -1, -1), new Among$SII("kk", -1, -1), new Among$SII("ll", -1, -1), new Among$SII("mm", -1, -1), new Among$SII("nn", -1, -1), new Among$SII("pp", -1, -1), new Among$SII("rr", -1, -1), new Among$SII("ccs", -1, -1), new Among$SII("ss", -1, -1), new Among$SII("zzs", -1, -1), new Among$SII("tt", -1, -1), new Among$SII("vv", -1, -1), new Among$SII("ggy", -1, -1), new Among$SII("lly", -1, -1), new Among$SII("nny", -1, -1), new Among$SII("tty", -1, -1), new Among$SII("ssz", -1, -1), new Among$SII("zz", -1, -1) ];
+});
+$__jsx_lazy_init(HungarianStemmer, "a_3", function () {
+ return [ new Among$SII("al", -1, 1), new Among$SII("el", -1, 2) ];
+});
+$__jsx_lazy_init(HungarianStemmer, "a_4", function () {
+ return [ new Among$SII("ba", -1, -1), new Among$SII("ra", -1, -1), new Among$SII("be", -1, -1), new Among$SII("re", -1, -1), new Among$SII("ig", -1, -1), new Among$SII("nak", -1, -1), new Among$SII("nek", -1, -1), new Among$SII("val", -1, -1), new Among$SII("vel", -1, -1), new Among$SII("ul", -1, -1), new Among$SII("n\u00E1l", -1, -1), new Among$SII("n\u00E9l", -1, -1), new Among$SII("b\u00F3l", -1, -1), new Among$SII("r\u00F3l", -1, -1), new Among$SII("t\u00F3l", -1, -1), new Among$SII("b\u00F5l", -1, -1), new Among$SII("r\u00F5l", -1, -1), new Among$SII("t\u00F5l", -1, -1), new Among$SII("\u00FCl", -1, -1), new Among$SII("n", -1, -1), new Among$SII("an", 19, -1), new Among$SII("ban", 20, -1), new Among$SII("en", 19, -1), new Among$SII("ben", 22, -1), new Among$SII("k\u00E9ppen", 22, -1), new Among$SII("on", 19, -1), new Among$SII("\u00F6n", 19, -1), new Among$SII("k\u00E9pp", -1, -1), new Among$SII("kor", -1, -1), new Among$SII("t", -1, -1), new Among$SII("at", 29, -1), new Among$SII("et", 29, -1), new Among$SII("k\u00E9nt", 29, -1), new Among$SII("ank\u00E9nt", 32, -1), new Among$SII("enk\u00E9nt", 32, -1), new Among$SII("onk\u00E9nt", 32, -1), new Among$SII("ot", 29, -1), new Among$SII("\u00E9rt", 29, -1), new Among$SII("\u00F6t", 29, -1), new Among$SII("hez", -1, -1), new Among$SII("hoz", -1, -1), new Among$SII("h\u00F6z", -1, -1), new Among$SII("v\u00E1", -1, -1), new Among$SII("v\u00E9", -1, -1) ];
+});
+$__jsx_lazy_init(HungarianStemmer, "a_5", function () {
+ return [ new Among$SII("\u00E1n", -1, 2), new Among$SII("\u00E9n", -1, 1), new Among$SII("\u00E1nk\u00E9nt", -1, 3) ];
+});
+$__jsx_lazy_init(HungarianStemmer, "a_6", function () {
+ return [ new Among$SII("stul", -1, 2), new Among$SII("astul", 0, 1), new Among$SII("\u00E1stul", 0, 3), new Among$SII("st\u00FCl", -1, 2), new Among$SII("est\u00FCl", 3, 1), new Among$SII("\u00E9st\u00FCl", 3, 4) ];
+});
+$__jsx_lazy_init(HungarianStemmer, "a_7", function () {
+ return [ new Among$SII("\u00E1", -1, 1), new Among$SII("\u00E9", -1, 2) ];
+});
+$__jsx_lazy_init(HungarianStemmer, "a_8", function () {
+ return [ new Among$SII("k", -1, 7), new Among$SII("ak", 0, 4), new Among$SII("ek", 0, 6), new Among$SII("ok", 0, 5), new Among$SII("\u00E1k", 0, 1), new Among$SII("\u00E9k", 0, 2), new Among$SII("\u00F6k", 0, 3) ];
+});
+$__jsx_lazy_init(HungarianStemmer, "a_9", function () {
+ return [ new Among$SII("\u00E9i", -1, 7), new Among$SII("\u00E1\u00E9i", 0, 6), new Among$SII("\u00E9\u00E9i", 0, 5), new Among$SII("\u00E9", -1, 9), new Among$SII("k\u00E9", 3, 4), new Among$SII("ak\u00E9", 4, 1), new Among$SII("ek\u00E9", 4, 1), new Among$SII("ok\u00E9", 4, 1), new Among$SII("\u00E1k\u00E9", 4, 3), new Among$SII("\u00E9k\u00E9", 4, 2), new Among$SII("\u00F6k\u00E9", 4, 1), new Among$SII("\u00E9\u00E9", 3, 8) ];
+});
+$__jsx_lazy_init(HungarianStemmer, "a_10", function () {
+ return [ new Among$SII("a", -1, 18), new Among$SII("ja", 0, 17), new Among$SII("d", -1, 16), new Among$SII("ad", 2, 13), new Among$SII("ed", 2, 13), new Among$SII("od", 2, 13), new Among$SII("\u00E1d", 2, 14), new Among$SII("\u00E9d", 2, 15), new Among$SII("\u00F6d", 2, 13), new Among$SII("e", -1, 18), new Among$SII("je", 9, 17), new Among$SII("nk", -1, 4), new Among$SII("unk", 11, 1), new Among$SII("\u00E1nk", 11, 2), new Among$SII("\u00E9nk", 11, 3), new Among$SII("\u00FCnk", 11, 1), new Among$SII("uk", -1, 8), new Among$SII("juk", 16, 7), new Among$SII("\u00E1juk", 17, 5), new Among$SII("\u00FCk", -1, 8), new Among$SII("j\u00FCk", 19, 7), new Among$SII("\u00E9j\u00FCk", 20, 6), new Among$SII("m", -1, 12), new Among$SII("am", 22, 9), new Among$SII("em", 22, 9), new Among$SII("om", 22, 9), new Among$SII("\u00E1m", 22, 10), new Among$SII("\u00E9m", 22, 11), new Among$SII("o", -1, 18), new Among$SII("\u00E1", -1, 19), new Among$SII("\u00E9", -1, 20) ];
+});
+$__jsx_lazy_init(HungarianStemmer, "a_11", function () {
+ return [ new Among$SII("id", -1, 10), new Among$SII("aid", 0, 9), new Among$SII("jaid", 1, 6), new Among$SII("eid", 0, 9), new Among$SII("jeid", 3, 6), new Among$SII("\u00E1id", 0, 7), new Among$SII("\u00E9id", 0, 8), new Among$SII("i", -1, 15), new Among$SII("ai", 7, 14), new Among$SII("jai", 8, 11), new Among$SII("ei", 7, 14), new Among$SII("jei", 10, 11), new Among$SII("\u00E1i", 7, 12), new Among$SII("\u00E9i", 7, 13), new Among$SII("itek", -1, 24), new Among$SII("eitek", 14, 21), new Among$SII("jeitek", 15, 20), new Among$SII("\u00E9itek", 14, 23), new Among$SII("ik", -1, 29), new Among$SII("aik", 18, 26), new Among$SII("jaik", 19, 25), new Among$SII("eik", 18, 26), new Among$SII("jeik", 21, 25), new Among$SII("\u00E1ik", 18, 27), new Among$SII("\u00E9ik", 18, 28), new Among$SII("ink", -1, 20), new Among$SII("aink", 25, 17), new Among$SII("jaink", 26, 16), new Among$SII("eink", 25, 17), new Among$SII("jeink", 28, 16), new Among$SII("\u00E1ink", 25, 18), new Among$SII("\u00E9ink", 25, 19), new Among$SII("aitok", -1, 21), new Among$SII("jaitok", 32, 20), new Among$SII("\u00E1itok", -1, 22), new Among$SII("im", -1, 5), new Among$SII("aim", 35, 4), new Among$SII("jaim", 36, 1), new Among$SII("eim", 35, 4), new Among$SII("jeim", 38, 1), new Among$SII("\u00E1im", 35, 2), new Among$SII("\u00E9im", 35, 3) ];
+});
+$__jsx_lazy_init(HungarianStemmer, "g_v", function () {
+ return [ 17, 65, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 17, 52, 14 ];
+});
+$__jsx_lazy_init(_Common, "buffers", function () {
+ return [ "comment", "sgmlDecl", "textNode", "tagName", "doctype", "procInstName", "procInstBody", "entity", "attribName", "attribValue", "cdata", "script" ];
+});
+$__jsx_lazy_init(_Common, "EVENTS", function () {
+ return [ "text", "processinginstruction", "sgmldeclaration", "doctype", "comment", "attribute", "opentag", "closetag", "opencdata", "cdata", "clo_State.CDATA", "error", "end", "ready", "script", "opennamespace", "closenamespace" ];
+});
+_Common.MAX_BUFFER_LENGTH = 65536;
+_State.BEGIN = 1;
+_State.TEXT = 2;
+_State.TEXT_ENTITY = 3;
+_State.OPEN_WAKA = 4;
+_State.SGML_DECL = 5;
+_State.SGML_DECL_QUOTED = 6;
+_State.DOCTYPE = 7;
+_State.DOCTYPE_QUOTED = 8;
+_State.DOCTYPE_DTD = 9;
+_State.DOCTYPE_DTD_QUOTED = 10;
+_State.COMMENT_STARTING = 11;
+_State.COMMENT = 12;
+_State.COMMENT_ENDING = 13;
+_State.COMMENT_ENDED = 14;
+_State.CDATA = 15;
+_State.CDATA_ENDING = 16;
+_State.CDATA_ENDING_2 = 17;
+_State.PROC_INST = 18;
+_State.PROC_INST_BODY = 19;
+_State.PROC_INST_ENDING = 20;
+_State.OPEN_TAG = 21;
+_State.OPEN_TAG_SLASH = 22;
+_State.ATTRIB = 23;
+_State.ATTRIB_NAME = 24;
+_State.ATTRIB_NAME_SAW_WHITE = 25;
+_State.ATTRIB_VALUE = 26;
+_State.ATTRIB_VALUE_QUOTED = 27;
+_State.ATTRIB_VALUE_UNQUOTED = 28;
+_State.ATTRIB_VALUE_ENTITY_Q = 29;
+_State.ATTRIB_VALUE_ENTITY_U = 30;
+_State.CLOSE_TAG = 31;
+_State.CLOSE_TAG_SAW_WHITE = 32;
+_State.SCRIPT = 33;
+_State.SCRIPT_ENDING = 34;
+$__jsx_lazy_init(_Entities, "_entities", function () {
+ return ({ "amp": "&", "gt": ">", "lt": "<", "quot": "\"", "apos": "'", "AElig": 198, "Aacute": 193, "Acirc": 194, "Agrave": 192, "Aring": 197, "Atilde": 195, "Auml": 196, "Ccedil": 199, "ETH": 208, "Eacute": 201, "Ecirc": 202, "Egrave": 200, "Euml": 203, "Iacute": 205, "Icirc": 206, "Igrave": 204, "Iuml": 207, "Ntilde": 209, "Oacute": 211, "Ocirc": 212, "Ograve": 210, "Oslash": 216, "Otilde": 213, "Ouml": 214, "THORN": 222, "Uacute": 218, "Ucirc": 219, "Ugrave": 217, "Uuml": 220, "Yacute": 221, "aacute": 225, "acirc": 226, "aelig": 230, "agrave": 224, "aring": 229, "atilde": 227, "auml": 228, "ccedil": 231, "eacute": 233, "ecirc": 234, "egrave": 232, "eth": 240, "euml": 235, "iacute": 237, "icirc": 238, "igrave": 236, "iuml": 239, "ntilde": 241, "oacute": 243, "ocirc": 244, "ograve": 242, "oslash": 248, "otilde": 245, "ouml": 246, "szlig": 223, "thorn": 254, "uacute": 250, "ucirc": 251, "ugrave": 249, "uuml": 252, "yacute": 253, "yuml": 255, "copy": 169, "reg": 174, "nbsp": 160, "iexcl": 161, "cent": 162, "pound": 163, "curren": 164, "yen": 165, "brvbar": 166, "sect": 167, "uml": 168, "ordf": 170, "laquo": 171, "not": 172, "shy": 173, "macr": 175, "deg": 176, "plusmn": 177, "sup1": 185, "sup2": 178, "sup3": 179, "acute": 180, "micro": 181, "para": 182, "middot": 183, "cedil": 184, "ordm": 186, "raquo": 187, "frac14": 188, "frac12": 189, "frac34": 190, "iquest": 191, "times": 215, "divide": 247, "OElig": 338, "oelig": 339, "Scaron": 352, "scaron": 353, "Yuml": 376, "fnof": 402, "circ": 710, "tilde": 732, "Alpha": 913, "Beta": 914, "Gamma": 915, "Delta": 916, "Epsilon": 917, "Zeta": 918, "Eta": 919, "Theta": 920, "Iota": 921, "Kappa": 922, "Lambda": 923, "Mu": 924, "Nu": 925, "Xi": 926, "Omicron": 927, "Pi": 928, "Rho": 929, "Sigma": 931, "Tau": 932, "Upsilon": 933, "Phi": 934, "Chi": 935, "Psi": 936, "Omega": 937, "alpha": 945, "beta": 946, "gamma": 947, "delta": 948, "epsilon": 949, "zeta": 950, "eta": 951, "theta": 952, "iota": 953, "kappa": 954, "lambda": 955, "mu": 956, "nu": 957, "xi": 958, "omicron": 959, "pi": 960, "rho": 961, "sigmaf": 962, "sigma": 963, "tau": 964, "upsilon": 965, "phi": 966, "chi": 967, "psi": 968, "omega": 969, "thetasym": 977, "upsih": 978, "piv": 982, "ensp": 8194, "emsp": 8195, "thinsp": 8201, "zwnj": 8204, "zwj": 8205, "lrm": 8206, "rlm": 8207, "ndash": 8211, "mdash": 8212, "lsquo": 8216, "rsquo": 8217, "sbquo": 8218, "ldquo": 8220, "rdquo": 8221, "bdquo": 8222, "dagger": 8224, "Dagger": 8225, "bull": 8226, "hellip": 8230, "permil": 8240, "prime": 8242, "Prime": 8243, "lsaquo": 8249, "rsaquo": 8250, "oline": 8254, "frasl": 8260, "euro": 8364, "image": 8465, "weierp": 8472, "real": 8476, "trade": 8482, "alefsym": 8501, "larr": 8592, "uarr": 8593, "rarr": 8594, "darr": 8595, "harr": 8596, "crarr": 8629, "lArr": 8656, "uArr": 8657, "rArr": 8658, "dArr": 8659, "hArr": 8660, "forall": 8704, "part": 8706, "exist": 8707, "empty": 8709, "nabla": 8711, "isin": 8712, "notin": 8713, "ni": 8715, "prod": 8719, "sum": 8721, "minus": 8722, "lowast": 8727, "radic": 8730, "prop": 8733, "infin": 8734, "ang": 8736, "and": 8743, "or": 8744, "cap": 8745, "cup": 8746, "int": 8747, "there4": 8756, "sim": 8764, "cong": 8773, "asymp": 8776, "ne": 8800, "equiv": 8801, "le": 8804, "ge": 8805, "sub": 8834, "sup": 8835, "nsub": 8836, "sube": 8838, "supe": 8839, "oplus": 8853, "otimes": 8855, "perp": 8869, "sdot": 8901, "lceil": 8968, "rceil": 8969, "lfloor": 8970, "rfloor": 8971, "lang": 9001, "rang": 9002, "loz": 9674, "spades": 9824, "clubs": 9827, "hearts": 9829, "diams": 9830 });
+});
+BitVector.SMALL_BLOCK_SIZE = 32;
+BitVector.LARGE_BLOCK_SIZE = 256;
+BitVector.BLOCK_RATE = 8;
+$__jsx_lazy_init(BurrowsWheelerTransform, "END_MARKER", function () {
+ return String.fromCharCode(0);
+});
+var $__jsx_classMap = {
+ "tool/web/oktavia-hungarian-search.jsx": {
+ _Main: _Main,
+ _Main$: _Main$
+ },
+ "tool/web/oktavia-search.jsx": {
+ _Result: _Result,
+ _Result$SSSI: _Result$SSSI,
+ _Proposal: _Proposal,
+ _Proposal$SSI: _Proposal$SSI,
+ OktaviaSearch: OktaviaSearch,
+ OktaviaSearch$I: OktaviaSearch$I,
+ _Main: _Main$0,
+ _Main$: _Main$0$
+ },
+ "src/oktavia.jsx": {
+ Oktavia: Oktavia,
+ Oktavia$: Oktavia$
+ },
+ "src/binary-util.jsx": {
+ Binary: Binary,
+ Binary$: Binary$,
+ LoadedStringResult: LoadedStringResult,
+ LoadedStringResult$SI: LoadedStringResult$SI,
+ LoadedStringListResult: LoadedStringListResult,
+ LoadedStringListResult$SI: LoadedStringListResult$SI,
+ LoadedStringListMapResult: LoadedStringListMapResult,
+ LoadedStringListMapResult$SI: LoadedStringListMapResult$SI,
+ LoadedNumberListResult: LoadedNumberListResult,
+ LoadedNumberListResult$SI: LoadedNumberListResult$SI,
+ CompressionReport: CompressionReport,
+ CompressionReport$: CompressionReport$
+ },
+ "src/query.jsx": {
+ Query: Query,
+ Query$: Query$
+ },
+ "src/query-string-parser.jsx": {
+ QueryStringParser: QueryStringParser,
+ QueryStringParser$: QueryStringParser$
+ },
+ "src/search-result.jsx": {
+ Proposal: Proposal,
+ Proposal$II: Proposal$II,
+ Position: Position,
+ Position$SIB: Position$SIB,
+ SearchUnit: SearchUnit,
+ SearchUnit$I: SearchUnit$I,
+ SingleResult: SingleResult,
+ SingleResult$: SingleResult$,
+ SingleResult$SBB: SingleResult$SBB,
+ SearchSummary: SearchSummary,
+ SearchSummary$: SearchSummary$,
+ SearchSummary$LOktavia$: SearchSummary$LOktavia$
+ },
+ "src/style.jsx": {
+ Style: Style,
+ Style$S: Style$S,
+ _HTMLHandler: _HTMLHandler,
+ _HTMLHandler$HASB: _HTMLHandler$HASB
+ },
+ "src/stemmer/stemmer.jsx": {
+ Stemmer: Stemmer,
+ Stemmer$: Stemmer$
+ },
+ "src/stemmer/base-stemmer.jsx": {
+ BaseStemmer: BaseStemmer,
+ BaseStemmer$: BaseStemmer$
+ },
+ "src/stemmer/hungarian-stemmer.jsx": {
+ HungarianStemmer: HungarianStemmer,
+ HungarianStemmer$: HungarianStemmer$
+ },
+ "src/stemmer/among.jsx": {
+ Among: Among,
+ Among$SII: Among$SII,
+ Among$SIIF$LBaseStemmer$B$LBaseStemmer$: Among$SIIF$LBaseStemmer$B$LBaseStemmer$
+ },
+ "src/metadata.jsx": {
+ Metadata: Metadata,
+ Metadata$LOktavia$: Metadata$LOktavia$,
+ Section: Section,
+ Section$LOktavia$: Section$LOktavia$,
+ Splitter: Splitter,
+ Splitter$LOktavia$: Splitter$LOktavia$,
+ Splitter$LOktavia$S: Splitter$LOktavia$S,
+ Table: Table,
+ Table$LOktavia$AS: Table$LOktavia$AS,
+ Block: Block,
+ Block$LOktavia$: Block$LOktavia$
+ },
+ "src/fm-index.jsx": {
+ FMIndex: FMIndex,
+ FMIndex$: FMIndex$
+ },
+ "src/sax.jsx": {
+ Tag: Tag,
+ Tag$S: Tag$S,
+ _Common: _Common,
+ _Common$: _Common$,
+ _State: _State,
+ _State$: _State$,
+ SAXHandler: SAXHandler,
+ SAXHandler$: SAXHandler$,
+ SAXParser: SAXParser,
+ SAXParser$LSAXHandler$: SAXParser$LSAXHandler$,
+ SAXParser$LSAXHandler$B: SAXParser$LSAXHandler$B,
+ Char: Char,
+ Char$: Char$,
+ _Entities: _Entities,
+ _Entities$: _Entities$
+ },
+ "src/bit-vector.jsx": {
+ BitVector: BitVector,
+ BitVector$: BitVector$
+ },
+ "src/wavelet-matrix.jsx": {
+ WaveletMatrix: WaveletMatrix,
+ WaveletMatrix$: WaveletMatrix$
+ },
+ "src/burrows-wheeler-transform.jsx": {
+ BurrowsWheelerTransform: BurrowsWheelerTransform,
+ BurrowsWheelerTransform$: BurrowsWheelerTransform$
+ },
+ "src/sais.jsx": {
+ OArray: OArray,
+ OArray$AI: OArray$AI,
+ OArray$AII: OArray$AII,
+ SAIS: SAIS,
+ SAIS$: SAIS$
+ }
+};
+
+
+/**
+ * launches _Main.main(:string[]):void invoked by jsx --run|--executable
+ */
+JSX.runMain = function (sourceFile, args) {
+ var module = JSX.require(sourceFile);
+ if (! module) {
+ throw new ReferenceError("entry point module not found in " + sourceFile);
+ }
+ if (! module._Main) {
+ throw new ReferenceError("entry point _Main not found in " + sourceFile);
+ }
+ if (! module._Main.main$AS) {
+ throw new ReferenceError("entry point _Main.main(:string[]):void not found in " + sourceFile);
+ }
+ module._Main.main$AS(args);
+};
+
+/**
+ * launches _Test#test*():void invoked by jsx --test
+ */
+JSX.runTests = function (sourceFile, tests) {
+ var module = JSX.require(sourceFile);
+ var testClass = module._Test$;
+
+ if (!testClass) return; // skip if there's no test class
+
+ if(tests.length === 0) {
+ var p = testClass.prototype;
+ for (var m in p) {
+ if (p[m] instanceof Function
+ && /^test.*[$]$/.test(m)) {
+ tests.push(m);
+ }
+ }
+ }
+ else { // set as process arguments
+ tests = tests.map(function (name) {
+ return name + "$"; // mangle for function test*():void
+ });
+ }
+
+ var testCase = new testClass();
+
+ if (testCase.beforeClass$AS != null)
+ testCase.beforeClass$AS(tests);
+
+ for (var i = 0; i < tests.length; ++i) {
+ (function (method) {
+ if (method in testCase) {
+ testCase.run$SF$V$(method, function() { testCase[method](); });
+ }
+ else {
+ throw new ReferenceError("No such test method: " + method);
+ }
+ }(tests[i]));
+ }
+
+ if (testCase.afterClass$ != null)
+ testCase.afterClass$();
+};
+/**
+ * call a function on load/DOMContentLoaded
+ */
+function $__jsx_onload (event) {
+ window.removeEventListener("load", $__jsx_onload);
+ document.removeEventListener("DOMContentLoaded", $__jsx_onload);
+ JSX.runMain("tool/web/oktavia-hungarian-search.jsx", [])
+}
+
+window.addEventListener("load", $__jsx_onload);
+document.addEventListener("DOMContentLoaded", $__jsx_onload);
+
+})(JSX);
diff --git a/web/server/h2o/libh2o/misc/oktavia/lib/oktavia-italian-search.js b/web/server/h2o/libh2o/misc/oktavia/lib/oktavia-italian-search.js
new file mode 100644
index 00000000..fa33ac16
--- /dev/null
+++ b/web/server/h2o/libh2o/misc/oktavia/lib/oktavia-italian-search.js
@@ -0,0 +1,8633 @@
+// generatedy by JSX compiler 0.9.24 (2013-04-05 13:45:00 +0900; 1b229cc6a411f674f0f7cf7a79b7a8b3f8eb7414)
+var JSX = {};
+(function (JSX) {
+/**
+ * copies the implementations from source interface to target
+ */
+function $__jsx_merge_interface(target, source) {
+ for (var k in source.prototype)
+ if (source.prototype.hasOwnProperty(k))
+ target.prototype[k] = source.prototype[k];
+}
+
+/**
+ * defers the initialization of the property
+ */
+function $__jsx_lazy_init(obj, prop, func) {
+ function reset(obj, prop, value) {
+ delete obj[prop];
+ obj[prop] = value;
+ return value;
+ }
+
+ Object.defineProperty(obj, prop, {
+ get: function () {
+ return reset(obj, prop, func());
+ },
+ set: function (v) {
+ reset(obj, prop, v);
+ },
+ enumerable: true,
+ configurable: true
+ });
+}
+
+/**
+ * sideeffect().a /= b
+ */
+function $__jsx_div_assign(obj, prop, divisor) {
+ return obj[prop] = (obj[prop] / divisor) | 0;
+}
+
+/*
+ * global functions, renamed to avoid conflict with local variable names
+ */
+var $__jsx_parseInt = parseInt;
+var $__jsx_parseFloat = parseFloat;
+var $__jsx_isNaN = isNaN;
+var $__jsx_isFinite = isFinite;
+
+var $__jsx_encodeURIComponent = encodeURIComponent;
+var $__jsx_decodeURIComponent = decodeURIComponent;
+var $__jsx_encodeURI = encodeURI;
+var $__jsx_decodeURI = decodeURI;
+
+var $__jsx_ObjectToString = Object.prototype.toString;
+var $__jsx_ObjectHasOwnProperty = Object.prototype.hasOwnProperty;
+
+/*
+ * profiler object, initialized afterwards
+ */
+function $__jsx_profiler() {
+}
+
+/*
+ * public interface to JSX code
+ */
+JSX.require = function (path) {
+ var m = $__jsx_classMap[path];
+ return m !== undefined ? m : null;
+};
+
+JSX.profilerIsRunning = function () {
+ return $__jsx_profiler.getResults != null;
+};
+
+JSX.getProfileResults = function () {
+ return ($__jsx_profiler.getResults || function () { return {}; })();
+};
+
+JSX.postProfileResults = function (url, cb) {
+ if ($__jsx_profiler.postResults == null)
+ throw new Error("profiler has not been turned on");
+ return $__jsx_profiler.postResults(url, cb);
+};
+
+JSX.resetProfileResults = function () {
+ if ($__jsx_profiler.resetResults == null)
+ throw new Error("profiler has not been turned on");
+ return $__jsx_profiler.resetResults();
+};
+JSX.DEBUG = false;
+/**
+ * class _Main extends Object
+ * @constructor
+ */
+function _Main() {
+}
+
+/**
+ * @constructor
+ */
+function _Main$() {
+};
+
+_Main$.prototype = new _Main;
+
+/**
+ * @param {Array.<undefined|!string>} args
+ */
+_Main.main$AS = function (args) {
+ OktaviaSearch$setStemmer$LStemmer$(new ItalianStemmer$());
+};
+
+var _Main$main$AS = _Main.main$AS;
+
+/**
+ * class _Result extends Object
+ * @constructor
+ */
+function _Result() {
+}
+
+/**
+ * @constructor
+ * @param {!string} title
+ * @param {!string} url
+ * @param {!string} content
+ * @param {!number} score
+ */
+function _Result$SSSI(title, url, content, score) {
+ this.title = title;
+ this.url = url;
+ this.content = content;
+ this.score = score;
+};
+
+_Result$SSSI.prototype = new _Result;
+
+/**
+ * class _Proposal extends Object
+ * @constructor
+ */
+function _Proposal() {
+}
+
+/**
+ * @constructor
+ * @param {!string} options
+ * @param {!string} label
+ * @param {!number} count
+ */
+function _Proposal$SSI(options, label, count) {
+ this.options = options;
+ this.label = label;
+ this.count = count;
+};
+
+_Proposal$SSI.prototype = new _Proposal;
+
+/**
+ * class OktaviaSearch extends Object
+ * @constructor
+ */
+function OktaviaSearch() {
+}
+
+/**
+ * @constructor
+ * @param {!number} entriesPerPage
+ */
+function OktaviaSearch$I(entriesPerPage) {
+ this._queries = null;
+ this._highlight = "";
+ this._result = null;
+ this._proposals = null;
+ this._currentFolderDepth = 0;
+ this._oktavia = new Oktavia$();
+ this._entriesPerPage = entriesPerPage;
+ this._currentPage = 1;
+ this._queryString = null;
+ this._callback = null;
+ OktaviaSearch._instance = this;
+};
+
+OktaviaSearch$I.prototype = new OktaviaSearch;
+
+/**
+ * @param {Stemmer} stemmer
+ */
+OktaviaSearch.setStemmer$LStemmer$ = function (stemmer) {
+ /** @type {Oktavia} */
+ var this$0;
+ if (OktaviaSearch._instance) {
+ this$0 = OktaviaSearch._instance._oktavia;
+ this$0._stemmer = stemmer;
+ } else {
+ OktaviaSearch._stemmer = stemmer;
+ }
+};
+
+var OktaviaSearch$setStemmer$LStemmer$ = OktaviaSearch.setStemmer$LStemmer$;
+
+/**
+ * @param {!string} index
+ */
+OktaviaSearch.prototype.loadIndex$S = function (index) {
+ /** @type {Oktavia} */
+ var this$0;
+ /** @type {Stemmer} */
+ var stemmer$0;
+ if (OktaviaSearch._stemmer) {
+ this$0 = this._oktavia;
+ stemmer$0 = OktaviaSearch._stemmer;
+ this$0._stemmer = stemmer$0;
+ }
+ this._oktavia.load$S(Binary$base64decode$S(index));
+ if (this._queryString) {
+ this.search$SF$IIV$(this._queryString, this._callback);
+ this._queryString = null;
+ this._callback = null;
+ }
+};
+
+/**
+ * @param {!string} queryString
+ * @param {*} callback
+ */
+OktaviaSearch.prototype.search$SF$IIV$ = function (queryString, callback) {
+ /** @type {QueryStringParser} */
+ var queryParser;
+ /** @type {SearchSummary} */
+ var summary;
+ /** @type {Array.<undefined|SearchUnit>} */
+ var _result$0;
+ if (this._oktavia) {
+ queryParser = ({queries: [ ]});
+ this._queries = QueryStringParser$parse$LQueryStringParser$S(queryParser, queryString);
+ this._highlight = QueryStringParser$highlight$LQueryStringParser$(queryParser);
+ summary = this._oktavia.search$ALQuery$(this._queries);
+ if (SearchSummary$size$LSearchSummary$(summary) > 0) {
+ this._result = this._sortResult$LSearchSummary$(summary);
+ this._proposals = [ ];
+ this._currentPage = 1;
+ } else {
+ this._result = [ ];
+ if (this._queries.length > 1) {
+ this._proposals = SearchSummary$getProposal$LSearchSummary$(summary);
+ } else {
+ this._proposals = [ ];
+ }
+ this._currentPage = 1;
+ }
+ callback((_result$0 = this._result).length, Math.ceil(_result$0.length / this._entriesPerPage));
+ } else {
+ this._queryString = queryString;
+ this._callback = callback;
+ }
+};
+
+/**
+ * @return {!number}
+ */
+OktaviaSearch.prototype.resultSize$ = function () {
+ return (this._result.length | 0);
+};
+
+/**
+ * @return {!number}
+ */
+OktaviaSearch.prototype.totalPages$ = function () {
+ return (Math.ceil(this._result.length / this._entriesPerPage) | 0);
+};
+
+/**
+ * @return {!number}
+ */
+OktaviaSearch.prototype.currentPage$ = function () {
+ return this._currentPage;
+};
+
+/**
+ * @param {!number} page
+ */
+OktaviaSearch.prototype.setCurrentPage$I = function (page) {
+ this._currentPage = page;
+};
+
+/**
+ * @return {!boolean}
+ */
+OktaviaSearch.prototype.hasPrevPage$ = function () {
+ return this._currentPage !== 1;
+};
+
+/**
+ * @return {!boolean}
+ */
+OktaviaSearch.prototype.hasNextPage$ = function () {
+ return this._currentPage !== Math.ceil(this._result.length / this._entriesPerPage);
+};
+
+/**
+ * @return {Array.<undefined|!string>}
+ */
+OktaviaSearch.prototype.pageIndexes$ = function () {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var total;
+ /** @type {!number} */
+ var i;
+ result = [ ];
+ total = Math.ceil(this._result.length / this._entriesPerPage);
+ if (total < 10) {
+ for (i = 1; i <= total; i++) {
+ result.push(i + "");
+ }
+ } else {
+ if (this._currentPage <= 5) {
+ for (i = 1; i <= 7; i++) {
+ result.push(i + "");
+ }
+ result.push('...', total + "");
+ } else {
+ if (total - 5 <= this._currentPage) {
+ result.push('1', '...');
+ for (i = total - 8; i <= total; i++) {
+ result.push(i + "");
+ }
+ } else {
+ result.push('1', '...');
+ for (i = this._currentPage - 3; i <= this._currentPage + 3; i++) {
+ result.push(i + "");
+ }
+ result.push('...', total + "");
+ }
+ }
+ }
+ return result;
+};
+
+/**
+ * @return {Array.<undefined|_Result>}
+ */
+OktaviaSearch.prototype.getResult$ = function () {
+ /** @type {Style} */
+ var style;
+ /** @type {!number} */
+ var start;
+ /** @type {!number} */
+ var last;
+ /** @type {Metadata} */
+ var metadata;
+ /** @type {!number} */
+ var num;
+ /** @type {Array.<undefined|_Result>} */
+ var results;
+ /** @type {!number} */
+ var i;
+ /** @type {SearchUnit} */
+ var unit;
+ /** @type {Array.<undefined|!string>} */
+ var info;
+ /** @type {!string} */
+ var content;
+ /** @type {Array.<undefined|Position>} */
+ var positions;
+ /** @type {!number} */
+ var end;
+ /** @type {!boolean} */
+ var split;
+ /** @type {!number} */
+ var j;
+ /** @type {Position} */
+ var pos;
+ /** @type {!string} */
+ var text;
+ /** @type {Oktavia} */
+ var this$0;
+ /** @type {!number} */
+ var position$0;
+ /** @type {!number} */
+ var _currentPage$0;
+ /** @type {!number} */
+ var _entriesPerPage$0;
+ style = new Style$S('html');
+ start = ((_currentPage$0 = this._currentPage) - 1) * (_entriesPerPage$0 = this._entriesPerPage);
+ last = Math.min(_currentPage$0 * _entriesPerPage$0, this._result.length);
+ this$0 = this._oktavia;
+ metadata = this$0._metadatas[this$0._metadataLabels[0]];
+ num = 250;
+ results = [ ];
+ for (i = start; i < last; i++) {
+ unit = this._result[i];
+ info = metadata.getInformation$I(unit.id).split(Oktavia.eob);
+ content = metadata.getContent$I(unit.id);
+ start = 0;
+ positions = SearchUnit$getPositions$LSearchUnit$(unit);
+ if (content.indexOf(info[0]) === 1) {
+ content = content.slice(info[0].length + 2, content.length);
+ start += info[0].length + 2;
+ }
+ end = start + num;
+ split = false;
+ if (positions[0].position > end - positions[0].word.length) {
+ end = positions[0].position + Math.floor(num / 2);
+ split = true;
+ }
+ for (j = positions.length - 1; j > -1; j--) {
+ pos = positions[j];
+ if (pos.position + pos.word.length < end) {
+ content = [ content.slice(0, pos.position - start), style.convert$S('<hit>*</hit>').replace('*', content.slice((position$0 = pos.position) - start, position$0 + pos.word.length - start)), content.slice(pos.position + pos.word.length - start, content.length) ].join('');
+ }
+ }
+ if (split) {
+ text = [ content.slice(0, Math.floor(num / 2)) + ' ...', content.slice(- Math.floor(num / 2), end - start) ].join('<br/>');
+ } else {
+ text = content.slice(0, end - start) + ' ...<br/>';
+ }
+ text = text.replace(Oktavia.eob, ' ').replace(/(<br\/>)(<br\/>)+/, '<br/><br/>');
+ results.push(({title: info[0], url: info[1], content: text, score: unit.score}));
+ }
+ return results;
+};
+
+/**
+ * @return {!string}
+ */
+OktaviaSearch.prototype.getHighlight$ = function () {
+ return this._highlight;
+};
+
+/**
+ * @return {Array.<undefined|_Proposal>}
+ */
+OktaviaSearch.prototype.getProposals$ = function () {
+ /** @type {Style} */
+ var style;
+ /** @type {Array.<undefined|_Proposal>} */
+ var results;
+ /** @type {!number} */
+ var i;
+ /** @type {Proposal} */
+ var proposal;
+ /** @type {Array.<undefined|!string>} */
+ var label;
+ /** @type {Array.<undefined|!string>} */
+ var option;
+ /** @type {!number} */
+ var j;
+ style = new Style$S('html');
+ results = [ ];
+ if (this._queries.length > 1) {
+ for (i = 0; i < this._proposals.length; i++) {
+ proposal = this._proposals[i];
+ if (proposal.expect > 0) {
+ label = [ ];
+ option = [ ];
+ for (j = 0; j < this._queries.length; j++) {
+ if (j !== proposal.omit) {
+ label.push(style.convert$S('<hit>' + this._queries[j].toString() + '</hit>'));
+ option.push(this._queries[j].toString());
+ } else {
+ label.push(style.convert$S('<del>' + this._queries[j].toString() + '</del>'));
+ }
+ }
+ results.push(({options: option.join(' '), label: label.join('&nbsp;'), count: proposal.expect}));
+ }
+ }
+ }
+ return results;
+};
+
+/**
+ * @param {SearchSummary} summary
+ * @return {Array.<undefined|SearchUnit>}
+ */
+OktaviaSearch.prototype._sortResult$LSearchSummary$ = function (summary) {
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var score;
+ /** @type {SearchUnit} */
+ var unit;
+ /** @type {!string} */
+ var pos;
+ /** @type {Position} */
+ var position;
+ for (i = 0; i < summary.result.units.length; i++) {
+ score = 0;
+ unit = summary.result.units[i];
+ for (pos in unit.positions) {
+ position = unit.positions[pos];
+ if (this._oktavia.wordPositionType$I(position.position)) {
+ score += 10;
+ } else {
+ score += 1;
+ }
+ if (! position.stemmed) {
+ score += 2;
+ }
+ }
+ unit.score = (score | 0);
+ }
+ return SearchSummary$getSortedResult$LSearchSummary$(summary);
+};
+
+/**
+ * class _Main$0 extends Object
+ * @constructor
+ */
+function _Main$0() {
+}
+
+/**
+ * @constructor
+ */
+function _Main$0$() {
+};
+
+_Main$0$.prototype = new _Main$0;
+
+/**
+ * @param {Array.<undefined|!string>} args
+ */
+_Main$0.main$AS = function (args) {
+};
+
+var _Main$0$main$AS = _Main$0.main$AS;
+
+/**
+ * class Oktavia extends Object
+ * @constructor
+ */
+function Oktavia() {
+}
+
+/**
+ * @constructor
+ */
+function Oktavia$() {
+ /** @type {Array.<undefined|!string>} */
+ var _utf162compressCode$0;
+ this._compressCode2utf16 = null;
+ this._fmindex = new FMIndex$();
+ this._metadatas = ({ });
+ this._metadataLabels = [ ];
+ this._stemmer = null;
+ this._stemmingResult = ({ });
+ _utf162compressCode$0 = this._utf162compressCode = [ Oktavia.eof, Oktavia.eob, Oktavia.unknown ];
+ _utf162compressCode$0.length = 65536;
+ this._compressCode2utf16 = [ Oktavia.eof, Oktavia.eob, Oktavia.unknown ];
+};
+
+Oktavia$.prototype = new Oktavia;
+
+/**
+ * @param {Stemmer} stemmer
+ */
+Oktavia.prototype.setStemmer$LStemmer$ = function (stemmer) {
+ this._stemmer = stemmer;
+};
+
+/**
+ * @return {Metadata}
+ */
+Oktavia.prototype.getPrimaryMetadata$ = function () {
+ return this._metadatas[this._metadataLabels[0]];
+};
+
+/**
+ * @param {!string} key
+ * @return {Section}
+ */
+Oktavia.prototype.addSection$S = function (key) {
+ /** @type {Section} */
+ var section;
+ if (this._metadataLabels.indexOf(key) !== -1) {
+ throw new Error('Metadata name ' + key + ' is already exists');
+ }
+ this._metadataLabels.push(key);
+ section = new Section$LOktavia$(this);
+ this._metadatas[key] = section;
+ return section;
+};
+
+/**
+ * @param {!string} key
+ * @return {Section}
+ */
+Oktavia.prototype.getSection$S = function (key) {
+ if (this._metadataLabels.indexOf(key) === -1) {
+ throw new Error('Metadata name ' + key + " does't exists");
+ }
+ return this._metadatas[key];
+};
+
+/**
+ * @param {!string} key
+ * @return {Splitter}
+ */
+Oktavia.prototype.addSplitter$S = function (key) {
+ /** @type {Splitter} */
+ var splitter;
+ if (this._metadataLabels.indexOf(key) !== -1) {
+ throw new Error('Metadata name ' + key + ' is already exists');
+ }
+ this._metadataLabels.push(key);
+ splitter = new Splitter$LOktavia$(this);
+ this._metadatas[key] = splitter;
+ return splitter;
+};
+
+/**
+ * @param {!string} key
+ * @return {Splitter}
+ */
+Oktavia.prototype.getSplitter$S = function (key) {
+ if (this._metadataLabels.indexOf(key) === -1) {
+ throw new Error('Metadata name ' + key + " does't exists");
+ }
+ return this._metadatas[key];
+};
+
+/**
+ * @param {!string} key
+ * @param {Array.<undefined|!string>} headers
+ * @return {Table}
+ */
+Oktavia.prototype.addTable$SAS = function (key, headers) {
+ /** @type {Table} */
+ var table;
+ if (this._metadataLabels.indexOf(key) !== -1) {
+ throw new Error('Metadata name ' + key + ' is already exists');
+ }
+ this._metadataLabels.push(key);
+ table = new Table$LOktavia$AS(this, headers);
+ this._metadatas[key] = table;
+ return table;
+};
+
+/**
+ * @param {!string} key
+ * @return {Table}
+ */
+Oktavia.prototype.getTable$S = function (key) {
+ if (this._metadataLabels.indexOf(key) === -1) {
+ throw new Error('Metadata name ' + key + " does't exists");
+ }
+ return this._metadatas[key];
+};
+
+/**
+ * @param {!string} key
+ * @return {Block}
+ */
+Oktavia.prototype.addBlock$S = function (key) {
+ /** @type {Block} */
+ var block;
+ if (this._metadataLabels.indexOf(key) !== -1) {
+ throw new Error('Metadata name ' + key + ' is already exists');
+ }
+ this._metadataLabels.push(key);
+ block = new Block$LOktavia$(this);
+ this._metadatas[key] = block;
+ return block;
+};
+
+/**
+ * @param {!string} key
+ * @return {Block}
+ */
+Oktavia.prototype.getBlock$S = function (key) {
+ if (this._metadataLabels.indexOf(key) === -1) {
+ throw new Error('Metadata name ' + key + " does't exists");
+ }
+ return this._metadatas[key];
+};
+
+/**
+ */
+Oktavia.prototype.addEndOfBlock$ = function () {
+ this._fmindex.push$S(Oktavia.eob);
+};
+
+/**
+ * @param {!string} words
+ */
+Oktavia.prototype.addWord$S = function (words) {
+ /** @type {Array.<undefined|!string>} */
+ var str;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var charCode;
+ /** @type {undefined|!string} */
+ var newCharCode;
+ str = [ ];
+ str.length = words.length;
+ for (i = 0; i < words.length; i++) {
+ charCode = words.charCodeAt(i);
+ newCharCode = this._utf162compressCode[charCode];
+ if (newCharCode == null) {
+ newCharCode = String.fromCharCode(this._compressCode2utf16.length);
+ this._utf162compressCode[charCode] = newCharCode;
+ this._compressCode2utf16.push(String.fromCharCode(charCode));
+ }
+ str.push(newCharCode);
+ }
+ this._fmindex.push$S(str.join(''));
+};
+
+/**
+ * @param {!string} words
+ * @param {!boolean} stemming
+ */
+Oktavia.prototype.addWord$SB = function (words, stemming) {
+ /** @type {Array.<undefined|!string>} */
+ var wordList;
+ /** @type {!number} */
+ var i;
+ /** @type {undefined|!string} */
+ var originalWord;
+ /** @type {!string} */
+ var smallWord;
+ /** @type {undefined|!string} */
+ var registerWord;
+ /** @type {!string} */
+ var baseWord;
+ /** @type {!string} */
+ var compressedCodeWord;
+ /** @type {Array.<undefined|!string>} */
+ var stemmedList;
+ this.addWord$S(words);
+ wordList = words.split(/\s+/);
+ for (i = 0; i < wordList.length; i++) {
+ originalWord = wordList[i];
+ smallWord = originalWord.slice(0, 1).toLowerCase() + originalWord.slice(1);
+ registerWord = null;
+ if (stemming && this._stemmer) {
+ baseWord = this._stemmer.stemWord$S(originalWord.toLowerCase());
+ if (originalWord.indexOf(baseWord) === -1) {
+ registerWord = baseWord;
+ }
+ } else {
+ if (originalWord != smallWord) {
+ registerWord = smallWord;
+ }
+ }
+ if (registerWord) {
+ compressedCodeWord = this._convertToCompressionCode$S(originalWord);
+ stemmedList = this._stemmingResult[registerWord];
+ if (! stemmedList) {
+ stemmedList = [ compressedCodeWord ];
+ this._stemmingResult[registerWord] = stemmedList;
+ } else {
+ if (stemmedList.indexOf(compressedCodeWord) === -1) {
+ stemmedList.push(compressedCodeWord);
+ }
+ }
+ }
+ }
+};
+
+/**
+ * @param {!string} keyword
+ * @return {!string}
+ */
+Oktavia.prototype._convertToCompressionCode$S = function (keyword) {
+ /** @type {Array.<undefined|!string>} */
+ var resultChars;
+ /** @type {!number} */
+ var i;
+ /** @type {undefined|!string} */
+ var chr;
+ resultChars = [ ];
+ for (i = 0; i < keyword.length; i++) {
+ chr = this._utf162compressCode[keyword.charCodeAt(i)];
+ if (chr == null) {
+ resultChars.push(Oktavia.unknown);
+ } else {
+ resultChars.push(chr);
+ }
+ }
+ return resultChars.join('');
+};
+
+/**
+ * @param {!string} keyword
+ * @param {!boolean} stemming
+ * @return {Array.<undefined|!number>}
+ */
+Oktavia.prototype.rawSearch$SB = function (keyword, stemming) {
+ /** @type {Array.<undefined|!number>} */
+ var result;
+ /** @type {!string} */
+ var baseWord;
+ /** @type {Array.<undefined|!string>} */
+ var stemmedList;
+ /** @type {!number} */
+ var i;
+ /** @type {undefined|!string} */
+ var word;
+ if (stemming) {
+ result = [ ];
+ if (this._stemmer) {
+ baseWord = this._stemmer.stemWord$S(keyword.toLowerCase());
+ stemmedList = this._stemmingResult[baseWord];
+ if (stemmedList) {
+ for (i = 0; i < stemmedList.length; i++) {
+ word = stemmedList[i];
+ result = result.concat(this._fmindex.search$S(word));
+ }
+ }
+ }
+ } else {
+ result = this._fmindex.search$S(this._convertToCompressionCode$S(keyword));
+ }
+ return result;
+};
+
+/**
+ * @param {Array.<undefined|Query>} queries
+ * @return {SearchSummary}
+ */
+Oktavia.prototype.search$ALQuery$ = function (queries) {
+ /** @type {SearchSummary} */
+ var summary;
+ /** @type {!number} */
+ var i;
+ /** @type {SingleResult} */
+ var result$0;
+ summary = ({sourceResults: [ ], result: null, oktavia: this});
+ for (i = 0; i < queries.length; i++) {
+ result$0 = this._searchQuery$LQuery$(queries[i]);
+ summary.sourceResults.push(result$0);
+ }
+ summary.result = SearchSummary$mergeResult$LSearchSummary$ALSingleResult$(summary, summary.sourceResults);
+ return summary;
+};
+
+/**
+ * @param {Query} query
+ * @return {SingleResult}
+ */
+Oktavia.prototype._searchQuery$LQuery$ = function (query) {
+ /** @type {SingleResult} */
+ var result;
+ /** @type {Array.<undefined|!number>} */
+ var positions;
+ result = new SingleResult$SBB(query.word, query.or, query.not);
+ if (query.raw) {
+ positions = this.rawSearch$SB(query.word, false);
+ } else {
+ positions = this.rawSearch$SB(query.word, false).concat(this.rawSearch$SB(query.word, true));
+ }
+ this._metadatas[this._metadataLabels[0]].grouping$LSingleResult$AISB(result, positions, query.word, ! query.raw);
+ return result;
+};
+
+/**
+ */
+Oktavia.prototype.build$ = function () {
+ this.build$IB(5, false);
+};
+
+/**
+ * @param {!number} cacheDensity
+ * @param {!boolean} verbose
+ */
+Oktavia.prototype.build$IB = function (cacheDensity, verbose) {
+ /** @type {!string} */
+ var key;
+ /** @type {!number} */
+ var cacheRange;
+ /** @type {!number} */
+ var maxChar;
+ for (key in this._metadatas) {
+ this._metadatas[key]._build$();
+ }
+ cacheRange = Math.round(Math.max(1, 100 / Math.min(100, Math.max(0.01, cacheDensity))));
+ maxChar = this._compressCode2utf16.length;
+ this._fmindex.build$SIIB(Oktavia.eof, maxChar, cacheRange, verbose);
+};
+
+/**
+ * @return {!string}
+ */
+Oktavia.prototype.dump$ = function () {
+ return this.dump$B(false);
+};
+
+/**
+ * @param {!boolean} verbose
+ * @return {!string}
+ */
+Oktavia.prototype.dump$B = function (verbose) {
+ /** @type {!string} */
+ var header;
+ /** @type {!string} */
+ var fmdata;
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var i;
+ /** @type {CompressionReport} */
+ var report;
+ /** @type {undefined|!string} */
+ var name;
+ /** @type {!string} */
+ var data;
+ header = Binary$dumpString$SLCompressionReport$("oktavia-01", null).slice(1);
+ if (verbose) {
+ console.log("Source text size: " + (this._fmindex.size$() * 2 + "") + ' bytes');
+ }
+ fmdata = this._fmindex.dump$B(verbose);
+ result = [ header, fmdata ];
+ result.push(Binary$dump16bitNumber$I(this._compressCode2utf16.length));
+ for (i = 3; i < this._compressCode2utf16.length; i++) {
+ result.push(this._compressCode2utf16[i]);
+ }
+ if (verbose) {
+ console.log('Char Code Map: ' + (this._compressCode2utf16.length * 2 - 2 + "") + ' bytes');
+ }
+ report = ({source: 0, result: 0});
+ result.push(Binary$dumpStringListMap$HASLCompressionReport$(this._stemmingResult, report));
+ if (verbose) {
+ console.log('Stemmed Word Table: ' + (result[result.length - 1].length + "") + ' bytes (' + (Math.round(report.result * 100.0 / report.source) + "") + '%)');
+ }
+ result.push(Binary$dump16bitNumber$I(this._metadataLabels.length));
+ for (i = 0; i < this._metadataLabels.length; i++) {
+ report = ({source: 0, result: 0});
+ name = this._metadataLabels[i];
+ data = this._metadatas[name]._dump$LCompressionReport$(report);
+ result.push(Binary$dumpString$SLCompressionReport$(name, report), data);
+ if (verbose) {
+ console.log('Meta Data ' + name + ': ' + (data.length * 2 + "") + ' bytes (' + (Math.round(report.result * 100.0 / report.source) + "") + '%)');
+ }
+ }
+ return result.join('');
+};
+
+/**
+ * @param {!string} data
+ */
+Oktavia.prototype.load$S = function (data) {
+ /** @type {!string} */
+ var header;
+ /** @type {!number} */
+ var offset;
+ /** @type {!number} */
+ var charCodeCount;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var charCode;
+ /** @type {LoadedStringListMapResult} */
+ var stemmedWords;
+ /** @type {!number} */
+ var metadataCount;
+ /** @type {LoadedStringResult} */
+ var nameResult;
+ /** @type {!string} */
+ var name;
+ /** @type {!number} */
+ var type;
+ header = Binary$dumpString$SLCompressionReport$("oktavia-01", null).slice(1);
+ if (data.slice(0, 5) !== header) {
+ throw new Error('Invalid data file');
+ }
+ this._metadatas = ({ });
+ this._metadataLabels = [ ];
+ offset = 5;
+ offset = this._fmindex.load$SI(data, offset);
+ charCodeCount = Binary$load16bitNumber$SI(data, offset++);
+ this._compressCode2utf16 = [ Oktavia.eof, Oktavia.eob, Oktavia.unknown ];
+ this._utf162compressCode = [ Oktavia.eof, Oktavia.eob, Oktavia.unknown ];
+ for (i = 3; i < charCodeCount; i++) {
+ charCode = Binary$load16bitNumber$SI(data, offset++);
+ this._compressCode2utf16.push(String.fromCharCode(charCode));
+ this._utf162compressCode[charCode] = String.fromCharCode(i);
+ }
+ stemmedWords = Binary$loadStringListMap$SI(data, offset);
+ this._stemmingResult = stemmedWords.result;
+ offset = stemmedWords.offset;
+ metadataCount = Binary$load16bitNumber$SI(data, offset++);
+ for (i = 0; i < metadataCount; i++) {
+ nameResult = Binary$loadString$SI(data, offset);
+ name = nameResult.result;
+ offset = nameResult.offset;
+ type = Binary$load16bitNumber$SI(data, offset++);
+ switch (type) {
+ case 0:
+ offset = Section$_load$LOktavia$SSI(this, name, data, offset);
+ break;
+ case 1:
+ offset = Splitter$_load$LOktavia$SSI(this, name, data, offset);
+ break;
+ case 2:
+ offset = Table$_load$LOktavia$SSI(this, name, data, offset);
+ break;
+ case 3:
+ offset = Block$_load$LOktavia$SSI(this, name, data, offset);
+ break;
+ }
+ }
+};
+
+/**
+ * @return {!number}
+ */
+Oktavia.prototype.contentSize$ = function () {
+ /** @type {FMIndex} */
+ var this$0;
+ this$0 = this._fmindex;
+ return this$0._substr.length;
+};
+
+/**
+ * @param {!number} position
+ * @return {!number}
+ */
+Oktavia.prototype.wordPositionType$I = function (position) {
+ /** @type {!number} */
+ var result;
+ /** @type {!string} */
+ var ahead;
+ result = 0;
+ if (position === 0) {
+ result = 4;
+ } else {
+ ahead = this._fmindex.getSubstring$II(position - 1, 1);
+ if (/\s/.test(ahead)) {
+ result = 2;
+ } else {
+ if (/\W/.test(ahead)) {
+ result = 1;
+ } else {
+ if (Oktavia.eob === ahead) {
+ result = 3;
+ }
+ }
+ }
+ }
+ return (result | 0);
+};
+
+/**
+ * @param {!number} position
+ * @param {!number} length
+ * @return {!string}
+ */
+Oktavia.prototype._getSubstring$II = function (position, length) {
+ /** @type {!string} */
+ var result;
+ /** @type {Array.<undefined|!string>} */
+ var str;
+ /** @type {!number} */
+ var i;
+ result = this._fmindex.getSubstring$II(position, length);
+ str = [ ];
+ for (i = 0; i < result.length; i++) {
+ str.push(this._compressCode2utf16[result.charCodeAt(i)]);
+ }
+ return str.join('');
+};
+
+/**
+ * class Binary extends Object
+ * @constructor
+ */
+function Binary() {
+}
+
+/**
+ * @constructor
+ */
+function Binary$() {
+};
+
+Binary$.prototype = new Binary;
+
+/**
+ * @param {!number} num
+ * @return {!string}
+ */
+Binary.dump32bitNumber$N = function (num) {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ result = [ String.fromCharCode(Math.floor(num / 65536)) ];
+ result.push(String.fromCharCode(num % 65536));
+ return result.join("");
+};
+
+var Binary$dump32bitNumber$N = Binary.dump32bitNumber$N;
+
+/**
+ * @param {!string} buffer
+ * @param {!number} offset
+ * @return {!number}
+ */
+Binary.load32bitNumber$SI = function (buffer, offset) {
+ /** @type {!number} */
+ var result;
+ result = buffer.charCodeAt(offset) * 65536 + buffer.charCodeAt(offset + 1);
+ return result;
+};
+
+var Binary$load32bitNumber$SI = Binary.load32bitNumber$SI;
+
+/**
+ * @param {!number} num
+ * @return {!string}
+ */
+Binary.dump16bitNumber$I = function (num) {
+ return String.fromCharCode(num % 65536);
+};
+
+var Binary$dump16bitNumber$I = Binary.dump16bitNumber$I;
+
+/**
+ * @param {!string} buffer
+ * @param {!number} offset
+ * @return {!number}
+ */
+Binary.load16bitNumber$SI = function (buffer, offset) {
+ return (buffer.charCodeAt(offset) | 0);
+};
+
+var Binary$load16bitNumber$SI = Binary.load16bitNumber$SI;
+
+/**
+ * @param {!string} str
+ * @return {!string}
+ */
+Binary.dumpString$S = function (str) {
+ return Binary$dumpString$SLCompressionReport$(str, null);
+};
+
+var Binary$dumpString$S = Binary.dumpString$S;
+
+/**
+ * @param {!string} str
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+Binary.dumpString$SLCompressionReport$ = function (str, report) {
+ /** @type {!number} */
+ var length;
+ /** @type {!boolean} */
+ var compress;
+ /** @type {Array.<undefined|!number>} */
+ var charCodes;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var charCode;
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {undefined|!number} */
+ var bytes;
+ if (str.length > 32768) {
+ str = str.slice(0, 32768);
+ }
+ length = str.length;
+ compress = true;
+ charCodes = [ ];
+ for (i = 0; i < length; i++) {
+ charCode = str.charCodeAt(i);
+ if (charCode > 255) {
+ compress = false;
+ break;
+ }
+ charCodes.push(charCode);
+ }
+ if (compress) {
+ result = [ Binary$dump16bitNumber$I(length + 32768) ];
+ for (i = 0; i < length; i += 2) {
+ bytes = charCodes[i];
+ if (i !== length - 1) {
+ bytes += charCodes[i + 1] << 8;
+ }
+ result.push(String.fromCharCode(bytes % 65536));
+ }
+ if (report) {
+ CompressionReport$add$LCompressionReport$II(report, length, Math.ceil(length / 2));
+ }
+ } else {
+ result = [ Binary$dump16bitNumber$I(length), str ];
+ if (report) {
+ CompressionReport$add$LCompressionReport$II(report, length, length);
+ }
+ }
+ return result.join('');
+};
+
+var Binary$dumpString$SLCompressionReport$ = Binary.dumpString$SLCompressionReport$;
+
+/**
+ * @param {!string} buffer
+ * @param {!number} offset
+ * @return {LoadedStringResult}
+ */
+Binary.loadString$SI = function (buffer, offset) {
+ return new LoadedStringResult$SI(buffer, offset);
+};
+
+var Binary$loadString$SI = Binary.loadString$SI;
+
+/**
+ * @param {Array.<undefined|!string>} strList
+ * @return {!string}
+ */
+Binary.dumpStringList$AS = function (strList) {
+ return Binary$dumpStringList$ASLCompressionReport$(strList, null);
+};
+
+var Binary$dumpStringList$AS = Binary.dumpStringList$AS;
+
+/**
+ * @param {Array.<undefined|!string>} strList
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+Binary.dumpStringList$ASLCompressionReport$ = function (strList, report) {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var i;
+ result = [ Binary$dump32bitNumber$N(strList.length) ];
+ for (i = 0; i < strList.length; i++) {
+ result.push(Binary$dumpString$SLCompressionReport$(strList[i], report));
+ }
+ return result.join('');
+};
+
+var Binary$dumpStringList$ASLCompressionReport$ = Binary.dumpStringList$ASLCompressionReport$;
+
+/**
+ * @param {!string} buffer
+ * @param {!number} offset
+ * @return {LoadedStringListResult}
+ */
+Binary.loadStringList$SI = function (buffer, offset) {
+ return new LoadedStringListResult$SI(buffer, offset);
+};
+
+var Binary$loadStringList$SI = Binary.loadStringList$SI;
+
+/**
+ * @param {Object.<string, undefined|Array.<undefined|!string>>} strMap
+ * @return {!string}
+ */
+Binary.dumpStringListMap$HAS = function (strMap) {
+ return Binary$dumpStringListMap$HASLCompressionReport$(strMap, null);
+};
+
+var Binary$dumpStringListMap$HAS = Binary.dumpStringListMap$HAS;
+
+/**
+ * @param {Object.<string, undefined|Array.<undefined|!string>>} strMap
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+Binary.dumpStringListMap$HASLCompressionReport$ = function (strMap, report) {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var counter;
+ /** @type {!string} */
+ var key;
+ result = [ ];
+ counter = 0;
+ for (key in strMap) {
+ result.push(Binary$dumpString$SLCompressionReport$(key, report));
+ result.push(Binary$dumpStringList$ASLCompressionReport$(strMap[key], report));
+ counter++;
+ }
+ return Binary$dump32bitNumber$N(counter) + result.join('');
+};
+
+var Binary$dumpStringListMap$HASLCompressionReport$ = Binary.dumpStringListMap$HASLCompressionReport$;
+
+/**
+ * @param {!string} buffer
+ * @param {!number} offset
+ * @return {LoadedStringListMapResult}
+ */
+Binary.loadStringListMap$SI = function (buffer, offset) {
+ return new LoadedStringListMapResult$SI(buffer, offset);
+};
+
+var Binary$loadStringListMap$SI = Binary.loadStringListMap$SI;
+
+/**
+ * @param {Array.<undefined|!number>} array
+ * @return {!string}
+ */
+Binary.dump32bitNumberList$AN = function (array) {
+ return Binary$dump32bitNumberList$ANLCompressionReport$(array, null);
+};
+
+var Binary$dump32bitNumberList$AN = Binary.dump32bitNumberList$AN;
+
+/**
+ * @param {Array.<undefined|!number>} array
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+Binary.dump32bitNumberList$ANLCompressionReport$ = function (array, report) {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var index;
+ /** @type {!number} */
+ var inputLength;
+ /** @type {!number} */
+ var length;
+ /** @type {!string} */
+ var resultString;
+ /** @type {!number} */
+ var value1$0;
+ /** @type {!number} */
+ var value2$0;
+ result = [ Binary$dump32bitNumber$N(array.length) ];
+ index = 0;
+ inputLength = array.length;
+ while (index < inputLength) {
+ if (array[index] == 0) {
+ length = Binary$_countZero$ANI(array, index);
+ result.push(Binary$_zeroBlock$I(length));
+ index += length;
+ } else {
+ if (Binary$_shouldZebraCode$ANI(array, index)) {
+ result.push(Binary$_createZebraCode$ANI(array, index));
+ value1$0 = array.length;
+ value2$0 = index + 15;
+ index = (value1$0 <= value2$0 ? value1$0 : value2$0);
+ } else {
+ length = Binary$_searchDoubleZero$ANI(array, index);
+ result.push(Binary$_nonZeroBlock$ANII(array, index, length));
+ if (length === 0) {
+ throw new Error('');
+ }
+ index += length;
+ }
+ }
+ }
+ resultString = result.join('');
+ if (report) {
+ CompressionReport$add$LCompressionReport$II(report, array.length * 2 + 2, resultString.length);
+ }
+ return resultString;
+};
+
+var Binary$dump32bitNumberList$ANLCompressionReport$ = Binary.dump32bitNumberList$ANLCompressionReport$;
+
+/**
+ * @param {!string} buffer
+ * @param {!number} offset
+ * @return {LoadedNumberListResult}
+ */
+Binary.load32bitNumberList$SI = function (buffer, offset) {
+ return new LoadedNumberListResult$SI(buffer, offset);
+};
+
+var Binary$load32bitNumberList$SI = Binary.load32bitNumberList$SI;
+
+/**
+ * @param {Array.<undefined|!number>} array
+ * @param {!number} offset
+ * @return {!number}
+ */
+Binary._countZero$ANI = function (array, offset) {
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var array$len$0;
+ for ((i = offset, array$len$0 = array.length); i < array$len$0; i++) {
+ if (array[i] != 0) {
+ return (i - offset | 0);
+ }
+ }
+ return (array.length - offset | 0);
+};
+
+var Binary$_countZero$ANI = Binary._countZero$ANI;
+
+/**
+ * @param {!number} length
+ * @return {!string}
+ */
+Binary._zeroBlock$I = function (length) {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ result = [ ];
+ while (length > 0) {
+ if (length > 16384) {
+ result.push(Binary$dump16bitNumber$I(16383));
+ length -= 16384;
+ } else {
+ result.push(Binary$dump16bitNumber$I(length - 1));
+ length = 0;
+ }
+ }
+ return result.join('');
+};
+
+var Binary$_zeroBlock$I = Binary._zeroBlock$I;
+
+/**
+ * @param {Array.<undefined|!number>} array
+ * @param {!number} offset
+ * @return {!boolean}
+ */
+Binary._shouldZebraCode$ANI = function (array, offset) {
+ /** @type {!number} */
+ var change;
+ /** @type {!boolean} */
+ var isLastZero;
+ /** @type {!number} */
+ var i;
+ if (array.length - offset < 16) {
+ return true;
+ }
+ change = 0;
+ isLastZero = false;
+ for (i = offset; i < offset + 15; i++) {
+ if (array[i] == 0) {
+ if (! isLastZero) {
+ isLastZero = true;
+ change++;
+ }
+ } else {
+ if (isLastZero) {
+ isLastZero = false;
+ change++;
+ }
+ }
+ }
+ return change > 2;
+};
+
+var Binary$_shouldZebraCode$ANI = Binary._shouldZebraCode$ANI;
+
+/**
+ * @param {Array.<undefined|!number>} array
+ * @param {!number} offset
+ * @return {!number}
+ */
+Binary._searchDoubleZero$ANI = function (array, offset) {
+ /** @type {!boolean} */
+ var isLastZero;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var array$len$0;
+ isLastZero = false;
+ for ((i = offset, array$len$0 = array.length); i < array$len$0; i++) {
+ if (array[i] == 0) {
+ if (isLastZero) {
+ return (i - offset - 1 | 0);
+ }
+ isLastZero = true;
+ } else {
+ isLastZero = false;
+ }
+ }
+ return (array.length - offset | 0);
+};
+
+var Binary$_searchDoubleZero$ANI = Binary._searchDoubleZero$ANI;
+
+/**
+ * @param {Array.<undefined|!number>} array
+ * @param {!number} offset
+ * @param {!number} length
+ * @return {!string}
+ */
+Binary._nonZeroBlock$ANII = function (array, offset, length) {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var blockLength;
+ /** @type {!number} */
+ var i;
+ result = [ ];
+ while (length > 0) {
+ if (length > 16384) {
+ blockLength = 16384;
+ length -= 16384;
+ } else {
+ blockLength = length;
+ length = 0;
+ }
+ result.push(Binary$dump16bitNumber$I(blockLength - 1 + 0x4000));
+ for (i = offset; i < offset + blockLength; i++) {
+ result.push(Binary$dump32bitNumber$N(array[i]));
+ }
+ offset += blockLength;
+ }
+ return result.join('');
+};
+
+var Binary$_nonZeroBlock$ANII = Binary._nonZeroBlock$ANII;
+
+/**
+ * @param {Array.<undefined|!number>} array
+ * @param {!number} offset
+ * @return {!string}
+ */
+Binary._createZebraCode$ANI = function (array, offset) {
+ /** @type {!number} */
+ var last;
+ /** @type {!number} */
+ var code;
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var value1$0;
+ /** @type {!number} */
+ var value2$0;
+ value1$0 = offset + 15;
+ value2$0 = array.length;
+ last = (value1$0 <= value2$0 ? value1$0 : value2$0);
+ code = 0x8000;
+ result = [ ];
+ for (i = offset; i < last; i++) {
+ if (array[i] != 0) {
+ result.push(Binary$dump32bitNumber$N(array[i]));
+ code = code + (0x1 << i - offset);
+ }
+ }
+ return String.fromCharCode(code) + result.join('');
+};
+
+var Binary$_createZebraCode$ANI = Binary._createZebraCode$ANI;
+
+/**
+ * @param {!string} str
+ * @return {!string}
+ */
+Binary.base64encode$S = function (str) {
+ /** @type {Array.<undefined|!string>} */
+ var out;
+ /** @type {Array.<undefined|!number>} */
+ var source;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var code;
+ /** @type {!number} */
+ var len;
+ /** @type {!number} */
+ var c1;
+ /** @type {undefined|!number} */
+ var c2;
+ /** @type {undefined|!number} */
+ var c3;
+ out = [ ];
+ source = [ ];
+ for (i = 0; i < str.length; i++) {
+ code = str.charCodeAt(i);
+ source.push(code & 0x00ff, code >>> 8);
+ }
+ len = str.length * 2;
+ i = 0;
+ while (i < len) {
+ c1 = source[i++] & 0xff;
+ if (i === len) {
+ out.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(c1 >> 2));
+ out.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((c1 & 0x3) << 4));
+ out.push("==");
+ break;
+ }
+ c2 = source[i++];
+ if (i === len) {
+ out.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(c1 >> 2));
+ out.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((c1 & 0x3) << 4 | (c2 & 0xF0) >> 4));
+ out.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((c2 & 0xF) << 2));
+ out.push("=");
+ break;
+ }
+ c3 = source[i++];
+ out.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(c1 >> 2));
+ out.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((c1 & 0x3) << 4 | (c2 & 0xF0) >> 4));
+ out.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((c2 & 0xF) << 2 | (c3 & 0xC0) >> 6));
+ out.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(c3 & 0x3F));
+ }
+ return out.join('');
+};
+
+var Binary$base64encode$S = Binary.base64encode$S;
+
+/**
+ * @param {Array.<undefined|!number>} source
+ * @return {!string}
+ */
+Binary._mergeCharCode$AI = function (source) {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var i;
+ result = [ ];
+ for (i = 0; i < source.length; i += 2) {
+ result.push(String.fromCharCode(source[i] + (source[i + 1] << 8)));
+ }
+ return result.join('');
+};
+
+var Binary$_mergeCharCode$AI = Binary._mergeCharCode$AI;
+
+/**
+ * @param {!string} str
+ * @return {!string}
+ */
+Binary.base64decode$S = function (str) {
+ /** @type {!number} */
+ var len;
+ /** @type {!number} */
+ var i;
+ /** @type {Array.<undefined|!number>} */
+ var out;
+ /** @type {undefined|!number} */
+ var c1;
+ /** @type {undefined|!number} */
+ var c2;
+ /** @type {!number} */
+ var c3;
+ /** @type {!number} */
+ var c4;
+ len = str.length;
+ i = 0;
+ out = [ ];
+ while (i < len) {
+ do {
+ c1 = Binary._base64DecodeChars[str.charCodeAt(i++) & 0xff];
+ } while (i < len && c1 == -1);
+ if (c1 == -1) {
+ break;
+ }
+ do {
+ c2 = Binary._base64DecodeChars[str.charCodeAt(i++) & 0xff];
+ } while (i < len && c2 == -1);
+ if (c2 == -1) {
+ break;
+ }
+ out.push(c1 << 2 | (c2 & 0x30) >> 4);
+ do {
+ c3 = str.charCodeAt(i++) & 0xff;
+ if (c3 === 61) {
+ return Binary$_mergeCharCode$AI(out);
+ }
+ c3 = Binary._base64DecodeChars[c3];
+ } while (i < len && c3 === -1);
+ if (c3 === -1) {
+ break;
+ }
+ out.push((c2 & 0XF) << 4 | (c3 & 0x3C) >> 2);
+ do {
+ c4 = str.charCodeAt(i++) & 0xff;
+ if (c4 === 61) {
+ return Binary$_mergeCharCode$AI(out);
+ }
+ c4 = (Binary._base64DecodeChars[c4] | 0);
+ } while (i < len && c4 === -1);
+ if (c4 === -1) {
+ break;
+ }
+ out.push((c3 & 0x03) << 6 | c4);
+ }
+ return Binary$_mergeCharCode$AI(out);
+};
+
+var Binary$base64decode$S = Binary.base64decode$S;
+
+/**
+ * class LoadedStringResult extends Object
+ * @constructor
+ */
+function LoadedStringResult() {
+}
+
+/**
+ * @constructor
+ * @param {!string} data
+ * @param {!number} offset
+ */
+function LoadedStringResult$SI(data, offset) {
+ /** @type {!number} */
+ var strLength;
+ /** @type {Array.<undefined|!string>} */
+ var bytes;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var code;
+ /** @type {!number} */
+ var offset$0;
+ this.result = "";
+ this.offset = 0;
+ offset$0 = offset++;
+ strLength = data.charCodeAt(offset$0);
+ if (strLength > 32767) {
+ strLength = strLength - 32768;
+ bytes = [ ];
+ for (i = 0; i < strLength; i += 2) {
+ code = data.charCodeAt(offset);
+ bytes.push(String.fromCharCode(code & 0x00ff));
+ if (i !== strLength - 1) {
+ bytes.push(String.fromCharCode(code >>> 8));
+ }
+ offset++;
+ }
+ this.result = bytes.join('');
+ this.offset = offset;
+ } else {
+ this.result = data.slice(offset, offset + strLength);
+ this.offset = (offset + strLength | 0);
+ }
+};
+
+LoadedStringResult$SI.prototype = new LoadedStringResult;
+
+/**
+ * class LoadedStringListResult extends Object
+ * @constructor
+ */
+function LoadedStringListResult() {
+}
+
+/**
+ * @constructor
+ * @param {!string} data
+ * @param {!number} offset
+ */
+function LoadedStringListResult$SI(data, offset) {
+ /** @type {!number} */
+ var length;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var strLength;
+ /** @type {!string} */
+ var resultStr;
+ /** @type {Array.<undefined|!string>} */
+ var bytes;
+ /** @type {!number} */
+ var j;
+ /** @type {!number} */
+ var code;
+ /** @type {!number} */
+ var result$0;
+ /** @type {!number} */
+ var offset$0;
+ this.offset = 0;
+ this.result = [ ];
+ result$0 = data.charCodeAt(offset) * 65536 + data.charCodeAt(offset + 1);
+ length = result$0;
+ offset += 2;
+ for (i = 0; i < length; i++) {
+ offset$0 = offset++;
+ strLength = data.charCodeAt(offset$0);
+ if (strLength > 32767) {
+ strLength = strLength - 32768;
+ bytes = [ ];
+ for (j = 0; j < strLength; j += 2) {
+ code = data.charCodeAt(offset);
+ bytes.push(String.fromCharCode(code & 0x00ff));
+ if (j !== strLength - 1) {
+ bytes.push(String.fromCharCode(code >>> 8));
+ }
+ offset++;
+ }
+ resultStr = bytes.join('');
+ } else {
+ resultStr = data.slice(offset, offset + strLength);
+ offset = (offset + strLength | 0);
+ }
+ this.result.push(resultStr);
+ }
+ this.offset = offset;
+};
+
+LoadedStringListResult$SI.prototype = new LoadedStringListResult;
+
+/**
+ * class LoadedStringListMapResult extends Object
+ * @constructor
+ */
+function LoadedStringListMapResult() {
+}
+
+/**
+ * @constructor
+ * @param {!string} data
+ * @param {!number} offset
+ */
+function LoadedStringListMapResult$SI(data, offset) {
+ /** @type {!number} */
+ var length;
+ /** @type {!number} */
+ var i;
+ /** @type {LoadedStringResult} */
+ var keyResult;
+ /** @type {LoadedStringListResult} */
+ var valueResult;
+ /** @type {!number} */
+ var result$0;
+ /** @type {!number} */
+ var offset$0;
+ this.offset = 0;
+ this.result = ({ });
+ result$0 = data.charCodeAt(offset) * 65536 + data.charCodeAt(offset + 1);
+ length = result$0;
+ offset += 2;
+ for (i = 0; i < length; i++) {
+ keyResult = new LoadedStringResult$SI(data, offset);
+ offset$0 = keyResult.offset;
+ valueResult = new LoadedStringListResult$SI(data, offset$0);
+ this.result[keyResult.result] = valueResult.result;
+ offset = valueResult.offset;
+ }
+ this.offset = offset;
+};
+
+LoadedStringListMapResult$SI.prototype = new LoadedStringListMapResult;
+
+/**
+ * class LoadedNumberListResult extends Object
+ * @constructor
+ */
+function LoadedNumberListResult() {
+}
+
+/**
+ * @constructor
+ * @param {!string} data
+ * @param {!number} offset
+ */
+function LoadedNumberListResult$SI(data, offset) {
+ /** @type {!number} */
+ var resultLength;
+ /** @type {!number} */
+ var originalOffset;
+ /** @type {Array.<undefined|!number>} */
+ var result;
+ /** @type {!number} */
+ var tag;
+ /** @type {!number} */
+ var length;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var result$0;
+ /** @type {!number} */
+ var value1$0;
+ this.result = null;
+ this.offset = 0;
+ result$0 = data.charCodeAt(offset) * 65536 + data.charCodeAt(offset + 1);
+ resultLength = result$0;
+ originalOffset = offset;
+ offset += 2;
+ result = [ ];
+ while (result.length < resultLength) {
+ tag = data.charCodeAt(offset++);
+ if (tag >>> 15 === 1) {
+ value1$0 = resultLength - result.length;
+ length = (value1$0 <= 15 ? value1$0 : 15);
+ for (i = 0; i < length; i++) {
+ if (tag >>> i & 0x1) {
+ result.push(Binary$load32bitNumber$SI(data, offset));
+ offset += 2;
+ } else {
+ result.push(0);
+ }
+ }
+ } else {
+ if (tag >>> 14 === 1) {
+ length = tag - 0x4000 + 1;
+ for (i = 0; i < length; i++) {
+ result.push(Binary$load32bitNumber$SI(data, offset));
+ offset += 2;
+ }
+ } else {
+ length = tag + 1;
+ for (i = 0; i < length; i++) {
+ result.push(0);
+ }
+ }
+ }
+ }
+ this.result = result;
+ this.offset = offset;
+};
+
+LoadedNumberListResult$SI.prototype = new LoadedNumberListResult;
+
+/**
+ * class CompressionReport extends Object
+ * @constructor
+ */
+function CompressionReport() {
+}
+
+/**
+ * @constructor
+ */
+function CompressionReport$() {
+ this.source = 0;
+ this.result = 0;
+};
+
+CompressionReport$.prototype = new CompressionReport;
+
+/**
+ * @param {CompressionReport} $this
+ * @param {!number} source
+ * @param {!number} result
+ */
+CompressionReport.add$LCompressionReport$II = function ($this, source, result) {
+ $this.source += source;
+ $this.result += result;
+};
+
+var CompressionReport$add$LCompressionReport$II = CompressionReport.add$LCompressionReport$II;
+
+/**
+ * @param {CompressionReport} $this
+ * @return {!number}
+ */
+CompressionReport.rate$LCompressionReport$ = function ($this) {
+ return (Math.round($this.result * 100.0 / $this.source) | 0);
+};
+
+var CompressionReport$rate$LCompressionReport$ = CompressionReport.rate$LCompressionReport$;
+
+/**
+ * class Query extends Object
+ * @constructor
+ */
+function Query() {
+}
+
+/**
+ * @constructor
+ */
+function Query$() {
+ this.word = '';
+ this.or = false;
+ this.not = false;
+ this.raw = false;
+};
+
+Query$.prototype = new Query;
+
+/**
+ * @return {!string}
+ */
+Query.prototype.toString = function () {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ result = [ ];
+ if (this.or) {
+ result.push("OR ");
+ }
+ if (this.not) {
+ result.push("-");
+ }
+ if (this.raw) {
+ result.push('"', this.word, '"');
+ } else {
+ result.push(this.word);
+ }
+ return result.join('');
+};
+
+/**
+ * class QueryStringParser extends Object
+ * @constructor
+ */
+function QueryStringParser() {
+}
+
+/**
+ * @constructor
+ */
+function QueryStringParser$() {
+ this.queries = [ ];
+};
+
+QueryStringParser$.prototype = new QueryStringParser;
+
+/**
+ * @param {QueryStringParser} $this
+ * @param {!string} queryString
+ * @return {Array.<undefined|Query>}
+ */
+QueryStringParser.parse$LQueryStringParser$S = function ($this, queryString) {
+ /** @type {!boolean} */
+ var nextOr;
+ /** @type {!boolean} */
+ var nextNot;
+ /** @type {!number} */
+ var currentWordStart;
+ /** @type {!number} */
+ var status;
+ /** @type {RegExp} */
+ var isSpace;
+ /** @type {!number} */
+ var i;
+ /** @type {!string} */
+ var ch;
+ /** @type {!string} */
+ var word;
+ /** @type {Query} */
+ var query;
+ nextOr = false;
+ nextNot = false;
+ currentWordStart = 0;
+ status = 0;
+ isSpace = /[\s\u3000]/;
+ for (i = 0; i < queryString.length; i++) {
+ ch = queryString.charAt(i);
+ switch (status) {
+ case 0:
+ if (! isSpace.test(ch)) {
+ if (ch === '-') {
+ nextNot = true;
+ } else {
+ if (ch === '"') {
+ currentWordStart = i + 1;
+ status = 2;
+ } else {
+ currentWordStart = i;
+ status = 1;
+ }
+ }
+ } else {
+ nextNot = false;
+ }
+ break;
+ case 1:
+ if (isSpace.test(ch)) {
+ word = queryString.slice(currentWordStart, i);
+ if (word === 'OR') {
+ nextOr = true;
+ } else {
+ query = new Query$();
+ query.word = word;
+ query.or = nextOr;
+ query.not = nextNot;
+ $this.queries.push(query);
+ nextOr = false;
+ nextNot = false;
+ }
+ status = 0;
+ }
+ break;
+ case 2:
+ if (ch === '"') {
+ word = queryString.slice(currentWordStart, i);
+ query = new Query$();
+ query.word = word;
+ query.or = nextOr;
+ query.not = nextNot;
+ query.raw = true;
+ $this.queries.push(query);
+ nextOr = false;
+ nextNot = false;
+ status = 0;
+ }
+ break;
+ }
+ }
+ switch (status) {
+ case 0:
+ break;
+ case 1:
+ query = new Query$();
+ word = queryString.slice(currentWordStart, queryString.length);
+ if (word !== 'OR') {
+ query.word = word;
+ query.or = nextOr;
+ query.not = nextNot;
+ $this.queries.push(query);
+ }
+ break;
+ case 2:
+ query = new Query$();
+ query.word = queryString.slice(currentWordStart, queryString.length);
+ query.or = nextOr;
+ query.not = nextNot;
+ query.raw = true;
+ $this.queries.push(query);
+ break;
+ }
+ return $this.queries;
+};
+
+var QueryStringParser$parse$LQueryStringParser$S = QueryStringParser.parse$LQueryStringParser$S;
+
+/**
+ * @param {QueryStringParser} $this
+ * @return {!string}
+ */
+QueryStringParser.highlight$LQueryStringParser$ = function ($this) {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var i;
+ /** @type {Query} */
+ var query;
+ result = [ ];
+ for (i = 0; i < $this.queries.length; i++) {
+ query = $this.queries[i];
+ if (! query.not) {
+ result.push("highlight=" + $__jsx_encodeURIComponent(query.word));
+ }
+ }
+ return '?' + result.join('&');
+};
+
+var QueryStringParser$highlight$LQueryStringParser$ = QueryStringParser.highlight$LQueryStringParser$;
+
+/**
+ * class Proposal extends Object
+ * @constructor
+ */
+function Proposal() {
+}
+
+/**
+ * @constructor
+ * @param {!number} omit
+ * @param {!number} expect
+ */
+function Proposal$II(omit, expect) {
+ this.omit = omit;
+ this.expect = expect;
+};
+
+Proposal$II.prototype = new Proposal;
+
+/**
+ * class Position extends Object
+ * @constructor
+ */
+function Position() {
+}
+
+/**
+ * @constructor
+ * @param {!string} word
+ * @param {!number} position
+ * @param {!boolean} stemmed
+ */
+function Position$SIB(word, position, stemmed) {
+ this.word = word;
+ this.position = position;
+ this.stemmed = stemmed;
+};
+
+Position$SIB.prototype = new Position;
+
+/**
+ * class SearchUnit extends Object
+ * @constructor
+ */
+function SearchUnit() {
+}
+
+/**
+ * @constructor
+ * @param {!number} id
+ */
+function SearchUnit$I(id) {
+ this.positions = ({ });
+ this.id = id;
+ this._size = 0;
+ this.score = 0;
+ this.startPosition = -1;
+};
+
+SearchUnit$I.prototype = new SearchUnit;
+
+/**
+ * @param {SearchUnit} $this
+ * @param {!string} word
+ * @param {!number} position
+ * @param {!boolean} stemmed
+ */
+SearchUnit.addPosition$LSearchUnit$SIB = function ($this, word, position, stemmed) {
+ /** @type {Position} */
+ var positionObj;
+ positionObj = $this.positions[position + ""];
+ if (! positionObj) {
+ $this._size++;
+ $this.positions[position + ""] = ({word: word, position: position, stemmed: stemmed});
+ } else {
+ if (positionObj.word.length < word.length) {
+ positionObj.word = word;
+ }
+ positionObj.stemmed = positionObj.stemmed && stemmed;
+ }
+};
+
+var SearchUnit$addPosition$LSearchUnit$SIB = SearchUnit.addPosition$LSearchUnit$SIB;
+
+/**
+ * @param {SearchUnit} $this
+ * @param {!number} position
+ * @return {Position}
+ */
+SearchUnit.get$LSearchUnit$I = function ($this, position) {
+ return $this.positions[position + ""];
+};
+
+var SearchUnit$get$LSearchUnit$I = SearchUnit.get$LSearchUnit$I;
+
+/**
+ * @param {SearchUnit} $this
+ * @return {!number}
+ */
+SearchUnit.size$LSearchUnit$ = function ($this) {
+ return $this._size;
+};
+
+var SearchUnit$size$LSearchUnit$ = SearchUnit.size$LSearchUnit$;
+
+/**
+ * @param {SearchUnit} $this
+ * @param {SearchUnit} rhs
+ */
+SearchUnit.merge$LSearchUnit$LSearchUnit$ = function ($this, rhs) {
+ /** @type {!string} */
+ var position;
+ /** @type {Position} */
+ var pos;
+ for (position in rhs.positions) {
+ pos = rhs.positions[position];
+ SearchUnit$addPosition$LSearchUnit$SIB($this, pos.word, pos.position, pos.stemmed);
+ }
+};
+
+var SearchUnit$merge$LSearchUnit$LSearchUnit$ = SearchUnit.merge$LSearchUnit$LSearchUnit$;
+
+/**
+ * @param {SearchUnit} $this
+ * @return {Array.<undefined|Position>}
+ */
+SearchUnit.getPositions$LSearchUnit$ = function ($this) {
+ /** @type {Array.<undefined|Position>} */
+ var result;
+ /** @type {!string} */
+ var pos;
+ result = [ ];
+ for (pos in $this.positions) {
+ result.push($this.positions[pos]);
+ }
+ result.sort((function (a, b) {
+ return a.position - b.position;
+ }));
+ return result;
+};
+
+var SearchUnit$getPositions$LSearchUnit$ = SearchUnit.getPositions$LSearchUnit$;
+
+/**
+ * class SingleResult extends Object
+ * @constructor
+ */
+function SingleResult() {
+}
+
+/**
+ * @constructor
+ */
+function SingleResult$() {
+ this.units = [ ];
+ this.unitIds = [ ];
+ this.or = false;
+ this.not = false;
+ this.searchWord = '';
+};
+
+SingleResult$.prototype = new SingleResult;
+
+/**
+ * @constructor
+ * @param {!string} searchWord
+ * @param {!boolean} or
+ * @param {!boolean} not
+ */
+function SingleResult$SBB(searchWord, or, not) {
+ this.units = [ ];
+ this.unitIds = [ ];
+ this.or = or;
+ this.not = not;
+ this.searchWord = searchWord;
+};
+
+SingleResult$SBB.prototype = new SingleResult;
+
+/**
+ * @param {SingleResult} $this
+ * @param {!number} unitId
+ * @return {SearchUnit}
+ */
+SingleResult.getSearchUnit$LSingleResult$I = function ($this, unitId) {
+ /** @type {!number} */
+ var existing;
+ /** @type {SearchUnit} */
+ var result;
+ existing = $this.unitIds.indexOf(unitId);
+ if (existing === -1) {
+ result = ({positions: ({ }), id: unitId, _size: 0, score: 0, startPosition: -1});
+ $this.units.push(result);
+ $this.unitIds.push(unitId);
+ } else {
+ result = $this.units[existing];
+ }
+ return result;
+};
+
+var SingleResult$getSearchUnit$LSingleResult$I = SingleResult.getSearchUnit$LSingleResult$I;
+
+/**
+ * @param {SingleResult} $this
+ * @param {SingleResult} rhs
+ * @return {SingleResult}
+ */
+SingleResult.merge$LSingleResult$LSingleResult$ = function ($this, rhs) {
+ /** @type {SingleResult} */
+ var result;
+ result = ({units: [ ], unitIds: [ ], or: false, not: false, searchWord: ''});
+ if (rhs.or) {
+ SingleResult$_orMerge$LSingleResult$LSingleResult$LSingleResult$($this, result, rhs);
+ } else {
+ if (rhs.not) {
+ SingleResult$_notMerge$LSingleResult$LSingleResult$LSingleResult$($this, result, rhs);
+ } else {
+ SingleResult$_andMerge$LSingleResult$LSingleResult$LSingleResult$($this, result, rhs);
+ }
+ }
+ return result;
+};
+
+var SingleResult$merge$LSingleResult$LSingleResult$ = SingleResult.merge$LSingleResult$LSingleResult$;
+
+/**
+ * @param {SingleResult} $this
+ * @return {!number}
+ */
+SingleResult.size$LSingleResult$ = function ($this) {
+ return ($this.units.length | 0);
+};
+
+var SingleResult$size$LSingleResult$ = SingleResult.size$LSingleResult$;
+
+/**
+ * @param {SingleResult} $this
+ * @param {SingleResult} result
+ * @param {SingleResult} rhs
+ */
+SingleResult._andMerge$LSingleResult$LSingleResult$LSingleResult$ = function ($this, result, rhs) {
+ /** @type {!number} */
+ var i;
+ /** @type {undefined|!number} */
+ var id;
+ /** @type {SearchUnit} */
+ var lhsSection;
+ for (i = 0; i < $this.unitIds.length; i++) {
+ id = $this.unitIds[i];
+ if (rhs.unitIds.indexOf(id) !== -1) {
+ lhsSection = $this.units[i];
+ result.unitIds.push(id);
+ result.units.push(lhsSection);
+ }
+ }
+};
+
+var SingleResult$_andMerge$LSingleResult$LSingleResult$LSingleResult$ = SingleResult._andMerge$LSingleResult$LSingleResult$LSingleResult$;
+
+/**
+ * @param {SingleResult} $this
+ * @param {SingleResult} result
+ * @param {SingleResult} rhs
+ */
+SingleResult._orMerge$LSingleResult$LSingleResult$LSingleResult$ = function ($this, result, rhs) {
+ /** @type {!number} */
+ var i;
+ /** @type {undefined|!number} */
+ var id;
+ /** @type {SearchUnit} */
+ var rhsSection;
+ /** @type {SearchUnit} */
+ var lhsSection;
+ /** @type {Array.<undefined|!number>} */
+ var unitIds$0;
+ /** @type {Array.<undefined|SearchUnit>} */
+ var units$0;
+ result.unitIds = (unitIds$0 = $this.unitIds).slice(0, unitIds$0.length);
+ result.units = (units$0 = $this.units).slice(0, units$0.length);
+ for (i = 0; i < rhs.unitIds.length; i++) {
+ id = rhs.unitIds[i];
+ rhsSection = rhs.units[i];
+ if (result.unitIds.indexOf(id) !== -1) {
+ lhsSection = result.units[result.unitIds.indexOf(id)];
+ SearchUnit$merge$LSearchUnit$LSearchUnit$(lhsSection, rhsSection);
+ } else {
+ result.unitIds.push(id);
+ result.units.push(rhsSection);
+ }
+ }
+};
+
+var SingleResult$_orMerge$LSingleResult$LSingleResult$LSingleResult$ = SingleResult._orMerge$LSingleResult$LSingleResult$LSingleResult$;
+
+/**
+ * @param {SingleResult} $this
+ * @param {SingleResult} result
+ * @param {SingleResult} rhs
+ */
+SingleResult._notMerge$LSingleResult$LSingleResult$LSingleResult$ = function ($this, result, rhs) {
+ /** @type {!number} */
+ var i;
+ /** @type {undefined|!number} */
+ var id;
+ /** @type {SearchUnit} */
+ var lhsSection;
+ for (i = 0; i < $this.unitIds.length; i++) {
+ id = $this.unitIds[i];
+ if (rhs.unitIds.indexOf(id) === -1) {
+ lhsSection = $this.units[i];
+ result.unitIds.push(id);
+ result.units.push(lhsSection);
+ }
+ }
+};
+
+var SingleResult$_notMerge$LSingleResult$LSingleResult$LSingleResult$ = SingleResult._notMerge$LSingleResult$LSingleResult$LSingleResult$;
+
+/**
+ * class SearchSummary extends Object
+ * @constructor
+ */
+function SearchSummary() {
+}
+
+/**
+ * @constructor
+ */
+function SearchSummary$() {
+ this.sourceResults = [ ];
+ this.result = null;
+ this.oktavia = null;
+};
+
+SearchSummary$.prototype = new SearchSummary;
+
+/**
+ * @constructor
+ * @param {Oktavia} oktavia
+ */
+function SearchSummary$LOktavia$(oktavia) {
+ this.sourceResults = [ ];
+ this.result = null;
+ this.oktavia = oktavia;
+};
+
+SearchSummary$LOktavia$.prototype = new SearchSummary;
+
+/**
+ * @param {SearchSummary} $this
+ * @param {SingleResult} result
+ */
+SearchSummary.addQuery$LSearchSummary$LSingleResult$ = function ($this, result) {
+ $this.sourceResults.push(result);
+};
+
+var SearchSummary$addQuery$LSearchSummary$LSingleResult$ = SearchSummary.addQuery$LSearchSummary$LSingleResult$;
+
+/**
+ * @param {SearchSummary} $this
+ */
+SearchSummary.mergeResult$LSearchSummary$ = function ($this) {
+ $this.result = SearchSummary$mergeResult$LSearchSummary$ALSingleResult$($this, $this.sourceResults);
+};
+
+var SearchSummary$mergeResult$LSearchSummary$ = SearchSummary.mergeResult$LSearchSummary$;
+
+/**
+ * @param {SearchSummary} $this
+ * @param {Array.<undefined|SingleResult>} results
+ * @return {SingleResult}
+ */
+SearchSummary.mergeResult$LSearchSummary$ALSingleResult$ = function ($this, results) {
+ /** @type {SingleResult} */
+ var rhs;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var results$len$0;
+ rhs = results[0];
+ for ((i = 1, results$len$0 = results.length); i < results$len$0; i++) {
+ rhs = SingleResult$merge$LSingleResult$LSingleResult$(rhs, results[i]);
+ }
+ return rhs;
+};
+
+var SearchSummary$mergeResult$LSearchSummary$ALSingleResult$ = SearchSummary.mergeResult$LSearchSummary$ALSingleResult$;
+
+/**
+ * @param {SearchSummary} $this
+ * @return {Array.<undefined|Proposal>}
+ */
+SearchSummary.getProposal$LSearchSummary$ = function ($this) {
+ /** @type {Array.<undefined|Proposal>} */
+ var proposals;
+ /** @type {!number} */
+ var i;
+ /** @type {Array.<undefined|SingleResult>} */
+ var tmpSource;
+ /** @type {!number} */
+ var j;
+ /** @type {SingleResult} */
+ var result;
+ proposals = [ ];
+ for (i = 0; i < $this.sourceResults.length; i++) {
+ tmpSource = [ ];
+ for (j = 0; j < $this.sourceResults.length; j++) {
+ if (i !== j) {
+ tmpSource.push($this.sourceResults[j]);
+ }
+ }
+ result = SearchSummary$mergeResult$LSearchSummary$ALSingleResult$($this, tmpSource);
+ proposals.push(({omit: i, expect: result.units.length}));
+ }
+ proposals.sort((function (a, b) {
+ return b.expect - a.expect;
+ }));
+ return proposals;
+};
+
+var SearchSummary$getProposal$LSearchSummary$ = SearchSummary.getProposal$LSearchSummary$;
+
+/**
+ * @param {SearchSummary} $this
+ * @return {Array.<undefined|SearchUnit>}
+ */
+SearchSummary.getSortedResult$LSearchSummary$ = function ($this) {
+ /** @type {Array.<undefined|SearchUnit>} */
+ var result;
+ /** @type {Array.<undefined|SearchUnit>} */
+ var units$0;
+ result = (units$0 = $this.result.units).slice(0, units$0.length);
+ result.sort((function (a, b) {
+ return b.score - a.score;
+ }));
+ return result;
+};
+
+var SearchSummary$getSortedResult$LSearchSummary$ = SearchSummary.getSortedResult$LSearchSummary$;
+
+/**
+ * @param {SearchSummary} $this
+ * @return {!number}
+ */
+SearchSummary.size$LSearchSummary$ = function ($this) {
+ /** @type {SingleResult} */
+ var this$0;
+ this$0 = $this.result;
+ return (this$0.units.length | 0);
+};
+
+var SearchSummary$size$LSearchSummary$ = SearchSummary.size$LSearchSummary$;
+
+/**
+ * @param {SearchSummary} $this
+ * @param {SingleResult} result
+ */
+SearchSummary.add$LSearchSummary$LSingleResult$ = function ($this, result) {
+ $this.sourceResults.push(result);
+};
+
+var SearchSummary$add$LSearchSummary$LSingleResult$ = SearchSummary.add$LSearchSummary$LSingleResult$;
+
+/**
+ * class Style extends Object
+ * @constructor
+ */
+function Style() {
+}
+
+/**
+ * @constructor
+ * @param {!string} mode
+ */
+function Style$S(mode) {
+ this.styles = null;
+ this.escapeHTML = false;
+ switch (mode) {
+ case 'console':
+ this.styles = Style.console;
+ break;
+ case 'html':
+ this.styles = Style.html;
+ break;
+ case 'ignore':
+ this.styles = Style.ignore;
+ break;
+ default:
+ this.styles = Style.ignore;
+ break;
+ }
+ this.escapeHTML = mode === 'html';
+};
+
+Style$S.prototype = new Style;
+
+/**
+ * @param {!string} source
+ * @return {!string}
+ */
+Style.prototype.convert$S = function (source) {
+ /** @type {_HTMLHandler} */
+ var handler;
+ /** @type {SAXParser} */
+ var parser;
+ handler = new _HTMLHandler$HASB(this.styles, this.escapeHTML);
+ parser = new SAXParser$LSAXHandler$(handler);
+ parser.parse$S(source);
+ return handler.text.join('');
+};
+
+/**
+ * class Stemmer
+ * @constructor
+ */
+function Stemmer() {
+}
+
+Stemmer.prototype.$__jsx_implements_Stemmer = true;
+
+/**
+ * @constructor
+ */
+function Stemmer$() {
+};
+
+Stemmer$.prototype = new Stemmer;
+
+/**
+ * class BaseStemmer extends Object
+ * @constructor
+ */
+function BaseStemmer() {
+}
+
+$__jsx_merge_interface(BaseStemmer, Stemmer);
+
+/**
+ * @constructor
+ */
+function BaseStemmer$() {
+ /** @type {!string} */
+ var current$0;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var limit$0;
+ this.cache = ({ });
+ current$0 = this.current = "";
+ cursor$0 = this.cursor = 0;
+ limit$0 = this.limit = current$0.length;
+ this.limit_backward = 0;
+ this.bra = cursor$0;
+ this.ket = limit$0;
+};
+
+BaseStemmer$.prototype = new BaseStemmer;
+
+/**
+ * @param {!string} value
+ */
+BaseStemmer.prototype.setCurrent$S = function (value) {
+ /** @type {!string} */
+ var current$0;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var limit$0;
+ current$0 = this.current = value;
+ cursor$0 = this.cursor = 0;
+ limit$0 = this.limit = current$0.length;
+ this.limit_backward = 0;
+ this.bra = cursor$0;
+ this.ket = limit$0;
+};
+
+/**
+ * @return {!string}
+ */
+BaseStemmer.prototype.getCurrent$ = function () {
+ return this.current;
+};
+
+/**
+ * @param {BaseStemmer} other
+ */
+BaseStemmer.prototype.copy_from$LBaseStemmer$ = function (other) {
+ this.current = other.current;
+ this.cursor = other.cursor;
+ this.limit = other.limit;
+ this.limit_backward = other.limit_backward;
+ this.bra = other.bra;
+ this.ket = other.ket;
+};
+
+/**
+ * @param {Array.<undefined|!number>} s
+ * @param {!number} min
+ * @param {!number} max
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.in_grouping$AIII = function (s, min, max) {
+ /** @type {!number} */
+ var ch;
+ if (this.cursor >= this.limit) {
+ return false;
+ }
+ ch = this.current.charCodeAt(this.cursor);
+ if (ch > max || ch < min) {
+ return false;
+ }
+ ch -= min;
+ if ((s[ch >>> 3] & 0x1 << (ch & 0x7)) === 0) {
+ return false;
+ }
+ this.cursor++;
+ return true;
+};
+
+/**
+ * @param {Array.<undefined|!number>} s
+ * @param {!number} min
+ * @param {!number} max
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.in_grouping_b$AIII = function (s, min, max) {
+ /** @type {!number} */
+ var ch;
+ if (this.cursor <= this.limit_backward) {
+ return false;
+ }
+ ch = this.current.charCodeAt(this.cursor - 1);
+ if (ch > max || ch < min) {
+ return false;
+ }
+ ch -= min;
+ if ((s[ch >>> 3] & 0x1 << (ch & 0x7)) === 0) {
+ return false;
+ }
+ this.cursor--;
+ return true;
+};
+
+/**
+ * @param {Array.<undefined|!number>} s
+ * @param {!number} min
+ * @param {!number} max
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.out_grouping$AIII = function (s, min, max) {
+ /** @type {!number} */
+ var ch;
+ if (this.cursor >= this.limit) {
+ return false;
+ }
+ ch = this.current.charCodeAt(this.cursor);
+ if (ch > max || ch < min) {
+ this.cursor++;
+ return true;
+ }
+ ch -= min;
+ if ((s[ch >>> 3] & 0X1 << (ch & 0x7)) === 0) {
+ this.cursor++;
+ return true;
+ }
+ return false;
+};
+
+/**
+ * @param {Array.<undefined|!number>} s
+ * @param {!number} min
+ * @param {!number} max
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.out_grouping_b$AIII = function (s, min, max) {
+ /** @type {!number} */
+ var ch;
+ if (this.cursor <= this.limit_backward) {
+ return false;
+ }
+ ch = this.current.charCodeAt(this.cursor - 1);
+ if (ch > max || ch < min) {
+ this.cursor--;
+ return true;
+ }
+ ch -= min;
+ if ((s[ch >>> 3] & 0x1 << (ch & 0x7)) === 0) {
+ this.cursor--;
+ return true;
+ }
+ return false;
+};
+
+/**
+ * @param {!number} min
+ * @param {!number} max
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.in_range$II = function (min, max) {
+ /** @type {!number} */
+ var ch;
+ if (this.cursor >= this.limit) {
+ return false;
+ }
+ ch = this.current.charCodeAt(this.cursor);
+ if (ch > max || ch < min) {
+ return false;
+ }
+ this.cursor++;
+ return true;
+};
+
+/**
+ * @param {!number} min
+ * @param {!number} max
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.in_range_b$II = function (min, max) {
+ /** @type {!number} */
+ var ch;
+ if (this.cursor <= this.limit_backward) {
+ return false;
+ }
+ ch = this.current.charCodeAt(this.cursor - 1);
+ if (ch > max || ch < min) {
+ return false;
+ }
+ this.cursor--;
+ return true;
+};
+
+/**
+ * @param {!number} min
+ * @param {!number} max
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.out_range$II = function (min, max) {
+ /** @type {!number} */
+ var ch;
+ if (this.cursor >= this.limit) {
+ return false;
+ }
+ ch = this.current.charCodeAt(this.cursor);
+ if (! (ch > max || ch < min)) {
+ return false;
+ }
+ this.cursor++;
+ return true;
+};
+
+/**
+ * @param {!number} min
+ * @param {!number} max
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.out_range_b$II = function (min, max) {
+ /** @type {!number} */
+ var ch;
+ if (this.cursor <= this.limit_backward) {
+ return false;
+ }
+ ch = this.current.charCodeAt(this.cursor - 1);
+ if (! (ch > max || ch < min)) {
+ return false;
+ }
+ this.cursor--;
+ return true;
+};
+
+/**
+ * @param {!number} s_size
+ * @param {!string} s
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.eq_s$IS = function (s_size, s) {
+ /** @type {!number} */
+ var cursor$0;
+ if (this.limit - this.cursor < s_size) {
+ return false;
+ }
+ if (this.current.slice(cursor$0 = this.cursor, cursor$0 + s_size) !== s) {
+ return false;
+ }
+ this.cursor += s_size;
+ return true;
+};
+
+/**
+ * @param {!number} s_size
+ * @param {!string} s
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.eq_s_b$IS = function (s_size, s) {
+ /** @type {!number} */
+ var cursor$0;
+ if (this.cursor - this.limit_backward < s_size) {
+ return false;
+ }
+ if (this.current.slice((cursor$0 = this.cursor) - s_size, cursor$0) !== s) {
+ return false;
+ }
+ this.cursor -= s_size;
+ return true;
+};
+
+/**
+ * @param {!string} s
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.eq_v$S = function (s) {
+ return this.eq_s$IS(s.length, s);
+};
+
+/**
+ * @param {!string} s
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.eq_v_b$S = function (s) {
+ return this.eq_s_b$IS(s.length, s);
+};
+
+/**
+ * @param {Array.<undefined|Among>} v
+ * @param {!number} v_size
+ * @return {!number}
+ */
+BaseStemmer.prototype.find_among$ALAmong$I = function (v, v_size) {
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var j;
+ /** @type {!number} */
+ var c;
+ /** @type {!number} */
+ var l;
+ /** @type {!number} */
+ var common_i;
+ /** @type {!number} */
+ var common_j;
+ /** @type {!boolean} */
+ var first_key_inspected;
+ /** @type {!number} */
+ var k;
+ /** @type {!number} */
+ var diff;
+ /** @type {!number} */
+ var common;
+ /** @type {Among} */
+ var w;
+ /** @type {!number} */
+ var i2;
+ /** @type {!boolean} */
+ var res;
+ i = 0;
+ j = v_size;
+ c = this.cursor;
+ l = this.limit;
+ common_i = 0;
+ common_j = 0;
+ first_key_inspected = false;
+ while (true) {
+ k = i + (j - i >>> 1);
+ diff = 0;
+ common = (common_i < common_j ? common_i : common_j);
+ w = v[k];
+ for (i2 = common; i2 < w.s_size; i2++) {
+ if (c + common === l) {
+ diff = -1;
+ break;
+ }
+ diff = this.current.charCodeAt(c + common) - w.s.charCodeAt(i2);
+ if (diff !== 0) {
+ break;
+ }
+ common++;
+ }
+ if (diff < 0) {
+ j = k;
+ common_j = common;
+ } else {
+ i = k;
+ common_i = common;
+ }
+ if (j - i <= 1) {
+ if (i > 0) {
+ break;
+ }
+ if (j === i) {
+ break;
+ }
+ if (first_key_inspected) {
+ break;
+ }
+ first_key_inspected = true;
+ }
+ }
+ while (true) {
+ w = v[i];
+ if (common_i >= w.s_size) {
+ this.cursor = (c + w.s_size | 0);
+ if (w.method == null) {
+ return w.result;
+ }
+ res = w.method(w.instance);
+ this.cursor = (c + w.s_size | 0);
+ if (res) {
+ return w.result;
+ }
+ }
+ i = w.substring_i;
+ if (i < 0) {
+ return 0;
+ }
+ }
+ return -1;
+};
+
+/**
+ * @param {Array.<undefined|Among>} v
+ * @param {!number} v_size
+ * @return {!number}
+ */
+BaseStemmer.prototype.find_among_b$ALAmong$I = function (v, v_size) {
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var j;
+ /** @type {!number} */
+ var c;
+ /** @type {!number} */
+ var lb;
+ /** @type {!number} */
+ var common_i;
+ /** @type {!number} */
+ var common_j;
+ /** @type {!boolean} */
+ var first_key_inspected;
+ /** @type {!number} */
+ var k;
+ /** @type {!number} */
+ var diff;
+ /** @type {!number} */
+ var common;
+ /** @type {Among} */
+ var w;
+ /** @type {!number} */
+ var i2;
+ /** @type {!boolean} */
+ var res;
+ i = 0;
+ j = v_size;
+ c = this.cursor;
+ lb = this.limit_backward;
+ common_i = 0;
+ common_j = 0;
+ first_key_inspected = false;
+ while (true) {
+ k = i + (j - i >> 1);
+ diff = 0;
+ common = (common_i < common_j ? common_i : common_j);
+ w = v[k];
+ for (i2 = w.s_size - 1 - common; i2 >= 0; i2--) {
+ if (c - common === lb) {
+ diff = -1;
+ break;
+ }
+ diff = this.current.charCodeAt(c - 1 - common) - w.s.charCodeAt(i2);
+ if (diff !== 0) {
+ break;
+ }
+ common++;
+ }
+ if (diff < 0) {
+ j = k;
+ common_j = common;
+ } else {
+ i = k;
+ common_i = common;
+ }
+ if (j - i <= 1) {
+ if (i > 0) {
+ break;
+ }
+ if (j === i) {
+ break;
+ }
+ if (first_key_inspected) {
+ break;
+ }
+ first_key_inspected = true;
+ }
+ }
+ while (true) {
+ w = v[i];
+ if (common_i >= w.s_size) {
+ this.cursor = (c - w.s_size | 0);
+ if (w.method == null) {
+ return w.result;
+ }
+ res = w.method(this);
+ this.cursor = (c - w.s_size | 0);
+ if (res) {
+ return w.result;
+ }
+ }
+ i = w.substring_i;
+ if (i < 0) {
+ return 0;
+ }
+ }
+ return -1;
+};
+
+/**
+ * @param {!number} c_bra
+ * @param {!number} c_ket
+ * @param {!string} s
+ * @return {!number}
+ */
+BaseStemmer.prototype.replace_s$IIS = function (c_bra, c_ket, s) {
+ /** @type {!number} */
+ var adjustment;
+ adjustment = s.length - (c_ket - c_bra);
+ this.current = this.current.slice(0, c_bra) + s + this.current.slice(c_ket);
+ this.limit += (adjustment | 0);
+ if (this.cursor >= c_ket) {
+ this.cursor += (adjustment | 0);
+ } else {
+ if (this.cursor > c_bra) {
+ this.cursor = c_bra;
+ }
+ }
+ return (adjustment | 0);
+};
+
+/**
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.slice_check$ = function () {
+ /** @type {!number} */
+ var bra$0;
+ /** @type {!number} */
+ var ket$0;
+ /** @type {!number} */
+ var limit$0;
+ return ((bra$0 = this.bra) < 0 || bra$0 > (ket$0 = this.ket) || ket$0 > (limit$0 = this.limit) || limit$0 > this.current.length ? false : true);
+};
+
+/**
+ * @param {!string} s
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.slice_from$S = function (s) {
+ /** @type {!boolean} */
+ var result;
+ /** @type {!number} */
+ var bra$0;
+ /** @type {!number} */
+ var ket$0;
+ /** @type {!number} */
+ var limit$0;
+ result = false;
+ if ((bra$0 = this.bra) < 0 || bra$0 > (ket$0 = this.ket) || ket$0 > (limit$0 = this.limit) || limit$0 > this.current.length ? false : true) {
+ this.replace_s$IIS(this.bra, this.ket, s);
+ result = true;
+ }
+ return result;
+};
+
+/**
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.slice_del$ = function () {
+ return this.slice_from$S("");
+};
+
+/**
+ * @param {!number} c_bra
+ * @param {!number} c_ket
+ * @param {!string} s
+ */
+BaseStemmer.prototype.insert$IIS = function (c_bra, c_ket, s) {
+ /** @type {!number} */
+ var adjustment;
+ adjustment = this.replace_s$IIS(c_bra, c_ket, s);
+ if (c_bra <= this.bra) {
+ this.bra += (adjustment | 0);
+ }
+ if (c_bra <= this.ket) {
+ this.ket += (adjustment | 0);
+ }
+};
+
+/**
+ * @param {!string} s
+ * @return {!string}
+ */
+BaseStemmer.prototype.slice_to$S = function (s) {
+ /** @type {!string} */
+ var result;
+ /** @type {!number} */
+ var bra$0;
+ /** @type {!number} */
+ var ket$0;
+ /** @type {!number} */
+ var limit$0;
+ result = '';
+ if ((bra$0 = this.bra) < 0 || bra$0 > (ket$0 = this.ket) || ket$0 > (limit$0 = this.limit) || limit$0 > this.current.length ? false : true) {
+ result = this.current.slice(this.bra, this.ket);
+ }
+ return result;
+};
+
+/**
+ * @param {!string} s
+ * @return {!string}
+ */
+BaseStemmer.prototype.assign_to$S = function (s) {
+ return this.current.slice(0, this.limit);
+};
+
+/**
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.stem$ = function () {
+ return false;
+};
+
+/**
+ * @param {!string} word
+ * @return {!string}
+ */
+BaseStemmer.prototype.stemWord$S = function (word) {
+ /** @type {undefined|!string} */
+ var result;
+ /** @type {!string} */
+ var current$0;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var limit$0;
+ result = this.cache['.' + word];
+ if (result == null) {
+ current$0 = this.current = word;
+ cursor$0 = this.cursor = 0;
+ limit$0 = this.limit = current$0.length;
+ this.limit_backward = 0;
+ this.bra = cursor$0;
+ this.ket = limit$0;
+ this.stem$();
+ result = this.current;
+ this.cache['.' + word] = result;
+ }
+ return result;
+};
+
+/**
+ * @param {Array.<undefined|!string>} words
+ * @return {Array.<undefined|!string>}
+ */
+BaseStemmer.prototype.stemWords$AS = function (words) {
+ /** @type {Array.<undefined|!string>} */
+ var results;
+ /** @type {!number} */
+ var i;
+ /** @type {undefined|!string} */
+ var word;
+ /** @type {undefined|!string} */
+ var result;
+ /** @type {!string} */
+ var current$0;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var limit$0;
+ results = [ ];
+ for (i = 0; i < words.length; i++) {
+ word = words[i];
+ result = this.cache['.' + word];
+ if (result == null) {
+ current$0 = this.current = word;
+ cursor$0 = this.cursor = 0;
+ limit$0 = this.limit = current$0.length;
+ this.limit_backward = 0;
+ this.bra = cursor$0;
+ this.ket = limit$0;
+ this.stem$();
+ result = this.current;
+ this.cache['.' + word] = result;
+ }
+ results.push(result);
+ }
+ return results;
+};
+
+/**
+ * class ItalianStemmer extends BaseStemmer
+ * @constructor
+ */
+function ItalianStemmer() {
+}
+
+ItalianStemmer.prototype = new BaseStemmer;
+/**
+ * @constructor
+ */
+function ItalianStemmer$() {
+ BaseStemmer$.call(this);
+ this.I_p2 = 0;
+ this.I_p1 = 0;
+ this.I_pV = 0;
+};
+
+ItalianStemmer$.prototype = new ItalianStemmer;
+
+/**
+ * @param {ItalianStemmer} other
+ */
+ItalianStemmer.prototype.copy_from$LItalianStemmer$ = function (other) {
+ this.I_p2 = other.I_p2;
+ this.I_p1 = other.I_p1;
+ this.I_pV = other.I_pV;
+ BaseStemmer.prototype.copy_from$LBaseStemmer$.call(this, other);
+};
+
+/**
+ * @return {!boolean}
+ */
+ItalianStemmer.prototype.r_prelude$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var v_3;
+ /** @type {!number} */
+ var v_4;
+ /** @type {!number} */
+ var v_5;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!boolean} */
+ var lab3;
+ /** @type {!boolean} */
+ var lab5;
+ /** @type {!boolean} */
+ var lab6;
+ /** @type {!boolean} */
+ var lab7;
+ /** @type {!number} */
+ var cursor$0;
+ v_1 = this.cursor;
+replab0:
+ while (true) {
+ v_2 = this.cursor;
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ this.bra = this.cursor;
+ among_var = this.find_among$ALAmong$I(ItalianStemmer.a_0, 7);
+ if (among_var === 0) {
+ break lab1;
+ }
+ this.ket = this.cursor;
+ switch (among_var) {
+ case 0:
+ break lab1;
+ case 1:
+ if (! this.slice_from$S("\u00E0")) {
+ return false;
+ }
+ break;
+ case 2:
+ if (! this.slice_from$S("\u00E8")) {
+ return false;
+ }
+ break;
+ case 3:
+ if (! this.slice_from$S("\u00EC")) {
+ return false;
+ }
+ break;
+ case 4:
+ if (! this.slice_from$S("\u00F2")) {
+ return false;
+ }
+ break;
+ case 5:
+ if (! this.slice_from$S("\u00F9")) {
+ return false;
+ }
+ break;
+ case 6:
+ if (! this.slice_from$S("qU")) {
+ return false;
+ }
+ break;
+ case 7:
+ if (this.cursor >= this.limit) {
+ break lab1;
+ }
+ this.cursor++;
+ break;
+ }
+ continue replab0;
+ }
+ this.cursor = v_2;
+ break replab0;
+ }
+ this.cursor = v_1;
+replab2:
+ while (true) {
+ v_3 = this.cursor;
+ lab3 = true;
+ lab3:
+ while (lab3 === true) {
+ lab3 = false;
+ golab4:
+ while (true) {
+ v_4 = this.cursor;
+ lab5 = true;
+ lab5:
+ while (lab5 === true) {
+ lab5 = false;
+ if (! this.in_grouping$AIII(ItalianStemmer.g_v, 97, 249)) {
+ break lab5;
+ }
+ this.bra = this.cursor;
+ lab6 = true;
+ lab6:
+ while (lab6 === true) {
+ lab6 = false;
+ v_5 = this.cursor;
+ lab7 = true;
+ lab7:
+ while (lab7 === true) {
+ lab7 = false;
+ if (! this.eq_s$IS(1, "u")) {
+ break lab7;
+ }
+ this.ket = this.cursor;
+ if (! this.in_grouping$AIII(ItalianStemmer.g_v, 97, 249)) {
+ break lab7;
+ }
+ if (! this.slice_from$S("U")) {
+ return false;
+ }
+ break lab6;
+ }
+ this.cursor = v_5;
+ if (! this.eq_s$IS(1, "i")) {
+ break lab5;
+ }
+ this.ket = this.cursor;
+ if (! this.in_grouping$AIII(ItalianStemmer.g_v, 97, 249)) {
+ break lab5;
+ }
+ if (! this.slice_from$S("I")) {
+ return false;
+ }
+ }
+ this.cursor = v_4;
+ break golab4;
+ }
+ cursor$0 = this.cursor = v_4;
+ if (cursor$0 >= this.limit) {
+ break lab3;
+ }
+ this.cursor++;
+ }
+ continue replab2;
+ }
+ this.cursor = v_3;
+ break replab2;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+ItalianStemmer.prototype.r_mark_regions$ = function () {
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var v_3;
+ /** @type {!number} */
+ var v_6;
+ /** @type {!number} */
+ var v_8;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!boolean} */
+ var lab2;
+ /** @type {!boolean} */
+ var lab3;
+ /** @type {!boolean} */
+ var lab4;
+ /** @type {!boolean} */
+ var lab6;
+ /** @type {!boolean} */
+ var lab8;
+ /** @type {!boolean} */
+ var lab9;
+ /** @type {!boolean} */
+ var lab10;
+ /** @type {!boolean} */
+ var lab12;
+ /** @type {!boolean} */
+ var lab13;
+ /** @type {!boolean} */
+ var lab15;
+ /** @type {!boolean} */
+ var lab17;
+ /** @type {!boolean} */
+ var lab19;
+ /** @type {!boolean} */
+ var lab21;
+ /** @type {!number} */
+ var limit$0;
+ /** @type {!number} */
+ var cursor$0;
+ this.I_pV = limit$0 = this.limit;
+ this.I_p1 = limit$0;
+ this.I_p2 = limit$0;
+ v_1 = this.cursor;
+ lab0 = true;
+lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ v_2 = this.cursor;
+ lab2 = true;
+ lab2:
+ while (lab2 === true) {
+ lab2 = false;
+ if (! this.in_grouping$AIII(ItalianStemmer.g_v, 97, 249)) {
+ break lab2;
+ }
+ lab3 = true;
+ lab3:
+ while (lab3 === true) {
+ lab3 = false;
+ v_3 = this.cursor;
+ lab4 = true;
+ lab4:
+ while (lab4 === true) {
+ lab4 = false;
+ if (! this.out_grouping$AIII(ItalianStemmer.g_v, 97, 249)) {
+ break lab4;
+ }
+ golab5:
+ while (true) {
+ lab6 = true;
+ lab6:
+ while (lab6 === true) {
+ lab6 = false;
+ if (! this.in_grouping$AIII(ItalianStemmer.g_v, 97, 249)) {
+ break lab6;
+ }
+ break golab5;
+ }
+ if (this.cursor >= this.limit) {
+ break lab4;
+ }
+ this.cursor++;
+ }
+ break lab3;
+ }
+ this.cursor = v_3;
+ if (! this.in_grouping$AIII(ItalianStemmer.g_v, 97, 249)) {
+ break lab2;
+ }
+ golab7:
+ while (true) {
+ lab8 = true;
+ lab8:
+ while (lab8 === true) {
+ lab8 = false;
+ if (! this.out_grouping$AIII(ItalianStemmer.g_v, 97, 249)) {
+ break lab8;
+ }
+ break golab7;
+ }
+ if (this.cursor >= this.limit) {
+ break lab2;
+ }
+ this.cursor++;
+ }
+ }
+ break lab1;
+ }
+ this.cursor = v_2;
+ if (! this.out_grouping$AIII(ItalianStemmer.g_v, 97, 249)) {
+ break lab0;
+ }
+ lab9 = true;
+ lab9:
+ while (lab9 === true) {
+ lab9 = false;
+ v_6 = this.cursor;
+ lab10 = true;
+ lab10:
+ while (lab10 === true) {
+ lab10 = false;
+ if (! this.out_grouping$AIII(ItalianStemmer.g_v, 97, 249)) {
+ break lab10;
+ }
+ golab11:
+ while (true) {
+ lab12 = true;
+ lab12:
+ while (lab12 === true) {
+ lab12 = false;
+ if (! this.in_grouping$AIII(ItalianStemmer.g_v, 97, 249)) {
+ break lab12;
+ }
+ break golab11;
+ }
+ if (this.cursor >= this.limit) {
+ break lab10;
+ }
+ this.cursor++;
+ }
+ break lab9;
+ }
+ this.cursor = v_6;
+ if (! this.in_grouping$AIII(ItalianStemmer.g_v, 97, 249)) {
+ break lab0;
+ }
+ if (this.cursor >= this.limit) {
+ break lab0;
+ }
+ this.cursor++;
+ }
+ }
+ this.I_pV = this.cursor;
+ }
+ cursor$0 = this.cursor = v_1;
+ v_8 = cursor$0;
+ lab13 = true;
+lab13:
+ while (lab13 === true) {
+ lab13 = false;
+ golab14:
+ while (true) {
+ lab15 = true;
+ lab15:
+ while (lab15 === true) {
+ lab15 = false;
+ if (! this.in_grouping$AIII(ItalianStemmer.g_v, 97, 249)) {
+ break lab15;
+ }
+ break golab14;
+ }
+ if (this.cursor >= this.limit) {
+ break lab13;
+ }
+ this.cursor++;
+ }
+ golab16:
+ while (true) {
+ lab17 = true;
+ lab17:
+ while (lab17 === true) {
+ lab17 = false;
+ if (! this.out_grouping$AIII(ItalianStemmer.g_v, 97, 249)) {
+ break lab17;
+ }
+ break golab16;
+ }
+ if (this.cursor >= this.limit) {
+ break lab13;
+ }
+ this.cursor++;
+ }
+ this.I_p1 = this.cursor;
+ golab18:
+ while (true) {
+ lab19 = true;
+ lab19:
+ while (lab19 === true) {
+ lab19 = false;
+ if (! this.in_grouping$AIII(ItalianStemmer.g_v, 97, 249)) {
+ break lab19;
+ }
+ break golab18;
+ }
+ if (this.cursor >= this.limit) {
+ break lab13;
+ }
+ this.cursor++;
+ }
+ golab20:
+ while (true) {
+ lab21 = true;
+ lab21:
+ while (lab21 === true) {
+ lab21 = false;
+ if (! this.out_grouping$AIII(ItalianStemmer.g_v, 97, 249)) {
+ break lab21;
+ }
+ break golab20;
+ }
+ if (this.cursor >= this.limit) {
+ break lab13;
+ }
+ this.cursor++;
+ }
+ this.I_p2 = this.cursor;
+ }
+ this.cursor = v_8;
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+ItalianStemmer.prototype.r_postlude$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var v_1;
+ /** @type {!boolean} */
+ var lab1;
+replab0:
+ while (true) {
+ v_1 = this.cursor;
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ this.bra = this.cursor;
+ among_var = this.find_among$ALAmong$I(ItalianStemmer.a_1, 3);
+ if (among_var === 0) {
+ break lab1;
+ }
+ this.ket = this.cursor;
+ switch (among_var) {
+ case 0:
+ break lab1;
+ case 1:
+ if (! this.slice_from$S("i")) {
+ return false;
+ }
+ break;
+ case 2:
+ if (! this.slice_from$S("u")) {
+ return false;
+ }
+ break;
+ case 3:
+ if (this.cursor >= this.limit) {
+ break lab1;
+ }
+ this.cursor++;
+ break;
+ }
+ continue replab0;
+ }
+ this.cursor = v_1;
+ break replab0;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+ItalianStemmer.prototype.r_RV$ = function () {
+ return (! (this.I_pV <= this.cursor) ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+ItalianStemmer.prototype.r_R1$ = function () {
+ return (! (this.I_p1 <= this.cursor) ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+ItalianStemmer.prototype.r_R2$ = function () {
+ return (! (this.I_p2 <= this.cursor) ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+ItalianStemmer.prototype.r_attached_pronoun$ = function () {
+ /** @type {!number} */
+ var among_var;
+ this.ket = this.cursor;
+ if (this.find_among_b$ALAmong$I(ItalianStemmer.a_2, 37) === 0) {
+ return false;
+ }
+ this.bra = this.cursor;
+ among_var = this.find_among_b$ALAmong$I(ItalianStemmer.a_3, 5);
+ if (among_var === 0) {
+ return false;
+ }
+ if (! (! (this.I_pV <= this.cursor) ? false : true)) {
+ return false;
+ }
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 2:
+ if (! this.slice_from$S("e")) {
+ return false;
+ }
+ break;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+ItalianStemmer.prototype.r_standard_suffix$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var v_3;
+ /** @type {!number} */
+ var v_4;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!boolean} */
+ var lab2;
+ /** @type {!boolean} */
+ var lab3;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var cursor$1;
+ /** @type {!number} */
+ var cursor$2;
+ /** @type {!number} */
+ var cursor$3;
+ /** @type {!number} */
+ var cursor$4;
+ this.ket = this.cursor;
+ among_var = this.find_among_b$ALAmong$I(ItalianStemmer.a_6, 51);
+ if (among_var === 0) {
+ return false;
+ }
+ this.bra = this.cursor;
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ if (! (! (this.I_p2 <= this.cursor) ? false : true)) {
+ return false;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 2:
+ if (! (! (this.I_p2 <= this.cursor) ? false : true)) {
+ return false;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ v_1 = this.limit - this.cursor;
+ lab0 = true;
+ lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ this.ket = this.cursor;
+ if (! this.eq_s_b$IS(2, "ic")) {
+ this.cursor = this.limit - v_1;
+ break lab0;
+ }
+ this.bra = cursor$0 = this.cursor;
+ if (! (! (this.I_p2 <= cursor$0) ? false : true)) {
+ this.cursor = this.limit - v_1;
+ break lab0;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ }
+ break;
+ case 3:
+ if (! (! (this.I_p2 <= this.cursor) ? false : true)) {
+ return false;
+ }
+ if (! this.slice_from$S("log")) {
+ return false;
+ }
+ break;
+ case 4:
+ if (! (! (this.I_p2 <= this.cursor) ? false : true)) {
+ return false;
+ }
+ if (! this.slice_from$S("u")) {
+ return false;
+ }
+ break;
+ case 5:
+ if (! (! (this.I_p2 <= this.cursor) ? false : true)) {
+ return false;
+ }
+ if (! this.slice_from$S("ente")) {
+ return false;
+ }
+ break;
+ case 6:
+ if (! (! (this.I_pV <= this.cursor) ? false : true)) {
+ return false;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 7:
+ if (! (! (this.I_p1 <= this.cursor) ? false : true)) {
+ return false;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ v_2 = this.limit - this.cursor;
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ this.ket = this.cursor;
+ among_var = this.find_among_b$ALAmong$I(ItalianStemmer.a_4, 4);
+ if (among_var === 0) {
+ this.cursor = this.limit - v_2;
+ break lab1;
+ }
+ this.bra = cursor$1 = this.cursor;
+ if (! (! (this.I_p2 <= cursor$1) ? false : true)) {
+ this.cursor = this.limit - v_2;
+ break lab1;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ switch (among_var) {
+ case 0:
+ this.cursor = this.limit - v_2;
+ break lab1;
+ case 1:
+ this.ket = this.cursor;
+ if (! this.eq_s_b$IS(2, "at")) {
+ this.cursor = this.limit - v_2;
+ break lab1;
+ }
+ this.bra = cursor$2 = this.cursor;
+ if (! (! (this.I_p2 <= cursor$2) ? false : true)) {
+ this.cursor = this.limit - v_2;
+ break lab1;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ }
+ }
+ break;
+ case 8:
+ if (! (! (this.I_p2 <= this.cursor) ? false : true)) {
+ return false;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ v_3 = this.limit - this.cursor;
+ lab2 = true;
+ lab2:
+ while (lab2 === true) {
+ lab2 = false;
+ this.ket = this.cursor;
+ among_var = this.find_among_b$ALAmong$I(ItalianStemmer.a_5, 3);
+ if (among_var === 0) {
+ this.cursor = this.limit - v_3;
+ break lab2;
+ }
+ this.bra = this.cursor;
+ switch (among_var) {
+ case 0:
+ this.cursor = this.limit - v_3;
+ break lab2;
+ case 1:
+ if (! (! (this.I_p2 <= this.cursor) ? false : true)) {
+ this.cursor = this.limit - v_3;
+ break lab2;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ }
+ }
+ break;
+ case 9:
+ if (! (! (this.I_p2 <= this.cursor) ? false : true)) {
+ return false;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ v_4 = this.limit - this.cursor;
+ lab3 = true;
+ lab3:
+ while (lab3 === true) {
+ lab3 = false;
+ this.ket = this.cursor;
+ if (! this.eq_s_b$IS(2, "at")) {
+ this.cursor = this.limit - v_4;
+ break lab3;
+ }
+ this.bra = cursor$3 = this.cursor;
+ if (! (! (this.I_p2 <= cursor$3) ? false : true)) {
+ this.cursor = this.limit - v_4;
+ break lab3;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ this.ket = this.cursor;
+ if (! this.eq_s_b$IS(2, "ic")) {
+ this.cursor = this.limit - v_4;
+ break lab3;
+ }
+ this.bra = cursor$4 = this.cursor;
+ if (! (! (this.I_p2 <= cursor$4) ? false : true)) {
+ this.cursor = this.limit - v_4;
+ break lab3;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ }
+ break;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+ItalianStemmer.prototype.r_verb_suffix$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var cursor$1;
+ /** @type {!number} */
+ var cursor$2;
+ v_1 = this.limit - (cursor$0 = this.cursor);
+ if (cursor$0 < this.I_pV) {
+ return false;
+ }
+ cursor$1 = this.cursor = this.I_pV;
+ v_2 = this.limit_backward;
+ this.limit_backward = cursor$1;
+ cursor$2 = this.cursor = this.limit - v_1;
+ this.ket = cursor$2;
+ among_var = this.find_among_b$ALAmong$I(ItalianStemmer.a_7, 87);
+ if (among_var === 0) {
+ this.limit_backward = v_2;
+ return false;
+ }
+ this.bra = this.cursor;
+ switch (among_var) {
+ case 0:
+ this.limit_backward = v_2;
+ return false;
+ case 1:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ }
+ this.limit_backward = v_2;
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+ItalianStemmer.prototype.r_vowel_suffix$ = function () {
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var cursor$1;
+ v_1 = this.limit - this.cursor;
+ lab0 = true;
+lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ this.ket = this.cursor;
+ if (! this.in_grouping_b$AIII(ItalianStemmer.g_AEIO, 97, 242)) {
+ this.cursor = this.limit - v_1;
+ break lab0;
+ }
+ this.bra = cursor$0 = this.cursor;
+ if (! (! (this.I_pV <= cursor$0) ? false : true)) {
+ this.cursor = this.limit - v_1;
+ break lab0;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ this.ket = this.cursor;
+ if (! this.eq_s_b$IS(1, "i")) {
+ this.cursor = this.limit - v_1;
+ break lab0;
+ }
+ this.bra = cursor$1 = this.cursor;
+ if (! (! (this.I_pV <= cursor$1) ? false : true)) {
+ this.cursor = this.limit - v_1;
+ break lab0;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ }
+ v_2 = this.limit - this.cursor;
+ lab1 = true;
+lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ this.ket = this.cursor;
+ if (! this.eq_s_b$IS(1, "h")) {
+ this.cursor = this.limit - v_2;
+ break lab1;
+ }
+ this.bra = this.cursor;
+ if (! this.in_grouping_b$AIII(ItalianStemmer.g_CG, 99, 103)) {
+ this.cursor = this.limit - v_2;
+ break lab1;
+ }
+ if (! (! (this.I_pV <= this.cursor) ? false : true)) {
+ this.cursor = this.limit - v_2;
+ break lab1;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+ItalianStemmer.prototype.stem$ = function () {
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var v_3;
+ /** @type {!number} */
+ var v_4;
+ /** @type {!number} */
+ var v_5;
+ /** @type {!number} */
+ var v_7;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!boolean} */
+ var lab2;
+ /** @type {!boolean} */
+ var lab3;
+ /** @type {!boolean} */
+ var lab4;
+ /** @type {!boolean} */
+ var lab5;
+ /** @type {!boolean} */
+ var lab6;
+ /** @type {!boolean} */
+ var lab7;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var cursor$1;
+ /** @type {!number} */
+ var limit$0;
+ /** @type {!number} */
+ var cursor$2;
+ /** @type {!number} */
+ var limit$1;
+ /** @type {!number} */
+ var cursor$3;
+ /** @type {!number} */
+ var cursor$4;
+ v_1 = this.cursor;
+ lab0 = true;
+lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ if (! this.r_prelude$()) {
+ break lab0;
+ }
+ }
+ cursor$0 = this.cursor = v_1;
+ v_2 = cursor$0;
+ lab1 = true;
+lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ if (! this.r_mark_regions$()) {
+ break lab1;
+ }
+ }
+ cursor$1 = this.cursor = v_2;
+ this.limit_backward = cursor$1;
+ cursor$2 = this.cursor = limit$0 = this.limit;
+ v_3 = limit$0 - cursor$2;
+ lab2 = true;
+lab2:
+ while (lab2 === true) {
+ lab2 = false;
+ if (! this.r_attached_pronoun$()) {
+ break lab2;
+ }
+ }
+ cursor$3 = this.cursor = (limit$1 = this.limit) - v_3;
+ v_4 = limit$1 - cursor$3;
+ lab3 = true;
+lab3:
+ while (lab3 === true) {
+ lab3 = false;
+ lab4 = true;
+ lab4:
+ while (lab4 === true) {
+ lab4 = false;
+ v_5 = this.limit - this.cursor;
+ lab5 = true;
+ lab5:
+ while (lab5 === true) {
+ lab5 = false;
+ if (! this.r_standard_suffix$()) {
+ break lab5;
+ }
+ break lab4;
+ }
+ this.cursor = this.limit - v_5;
+ if (! this.r_verb_suffix$()) {
+ break lab3;
+ }
+ }
+ }
+ this.cursor = this.limit - v_4;
+ lab6 = true;
+lab6:
+ while (lab6 === true) {
+ lab6 = false;
+ if (! this.r_vowel_suffix$()) {
+ break lab6;
+ }
+ }
+ cursor$4 = this.cursor = this.limit_backward;
+ v_7 = cursor$4;
+ lab7 = true;
+lab7:
+ while (lab7 === true) {
+ lab7 = false;
+ if (! this.r_postlude$()) {
+ break lab7;
+ }
+ }
+ this.cursor = v_7;
+ return true;
+};
+
+/**
+ * @param {*} o
+ * @return {!boolean}
+ */
+ItalianStemmer.prototype.equals$X = function (o) {
+ return o instanceof ItalianStemmer;
+};
+
+/**
+ * @return {!number}
+ */
+ItalianStemmer.prototype.hashCode$ = function () {
+ /** @type {!string} */
+ var classname;
+ /** @type {!number} */
+ var hash;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var char;
+ classname = "ItalianStemmer";
+ hash = 0;
+ if ("ItalianStemmer".length === 0) {
+ return (hash | 0);
+ }
+ for (i = 0; i < classname.length; i++) {
+ char = classname.charCodeAt(i);
+ hash = (hash << 5) - hash + char;
+ hash = hash & hash;
+ }
+ return (hash | 0);
+};
+
+/**
+ * class Among extends Object
+ * @constructor
+ */
+function Among() {
+}
+
+/**
+ * @constructor
+ * @param {!string} s
+ * @param {!number} substring_i
+ * @param {!number} result
+ */
+function Among$SII(s, substring_i, result) {
+ this.s_size = s.length;
+ this.s = s;
+ this.substring_i = substring_i;
+ this.result = result;
+ this.method = null;
+ this.instance = null;
+};
+
+Among$SII.prototype = new Among;
+
+/**
+ * @constructor
+ * @param {!string} s
+ * @param {!number} substring_i
+ * @param {!number} result
+ * @param {*} method
+ * @param {BaseStemmer} instance
+ */
+function Among$SIIF$LBaseStemmer$B$LBaseStemmer$(s, substring_i, result, method, instance) {
+ this.s_size = s.length;
+ this.s = s;
+ this.substring_i = substring_i;
+ this.result = result;
+ this.method = method;
+ this.instance = instance;
+};
+
+Among$SIIF$LBaseStemmer$B$LBaseStemmer$.prototype = new Among;
+
+/**
+ * class Metadata extends Object
+ * @constructor
+ */
+function Metadata() {
+}
+
+/**
+ * @constructor
+ * @param {Oktavia} parent
+ */
+function Metadata$LOktavia$(parent) {
+ this._parent = parent;
+ this._bitVector = new BitVector$();
+};
+
+Metadata$LOktavia$.prototype = new Metadata;
+
+/**
+ * @return {!number}
+ */
+Metadata.prototype._size$ = function () {
+ /** @type {BitVector} */
+ var this$0;
+ /** @type {!number} */
+ var i$0;
+ /** @type {BitVector} */
+ var _bitVector$0;
+ this$0 = _bitVector$0 = this._bitVector;
+ i$0 = _bitVector$0._size;
+ return this$0.rank$IB(i$0, true);
+};
+
+/**
+ * @param {!number} index
+ * @return {!string}
+ */
+Metadata.prototype.getContent$I = function (index) {
+ /** @type {!number} */
+ var startPosition;
+ /** @type {!number} */
+ var length;
+ if (index < 0 || this._size$() <= index) {
+ throw new Error("Section.getContent() : range error " + (index + ""));
+ }
+ startPosition = 0;
+ if (index > 0) {
+ startPosition = this._bitVector.select$I(index - 1) + 1;
+ }
+ length = this._bitVector.select$I(index) - startPosition + 1;
+ return this._parent._getSubstring$II(startPosition, length);
+};
+
+/**
+ * @param {!number} index
+ * @return {!number}
+ */
+Metadata.prototype.getStartPosition$I = function (index) {
+ /** @type {!number} */
+ var startPosition;
+ if (index < 0 || this._size$() <= index) {
+ throw new Error("Section.getContent() : range error " + (index + ""));
+ }
+ startPosition = 0;
+ if (index > 0) {
+ startPosition = this._bitVector.select$I(index - 1) + 1;
+ }
+ return (startPosition | 0);
+};
+
+/**
+ * @param {SingleResult} result
+ * @param {Array.<undefined|!number>} positions
+ * @param {!string} word
+ * @param {!boolean} stemmed
+ */
+Metadata.prototype.grouping$LSingleResult$AISB = function (result, positions, word, stemmed) {
+};
+
+/**
+ * @param {!number} index
+ * @return {!string}
+ */
+Metadata.prototype.getInformation$I = function (index) {
+ return '';
+};
+
+/**
+ */
+Metadata.prototype._build$ = function () {
+ this._bitVector.build$();
+};
+
+/**
+ * @param {!string} name
+ * @param {!string} data
+ * @param {!number} offset
+ * @return {!number}
+ */
+Metadata.prototype._load$SSI = function (name, data, offset) {
+ offset = this._bitVector.load$SI(data, offset);
+ this._parent._metadataLabels.push(name);
+ this._parent._metadatas[name] = this;
+ return offset;
+};
+
+/**
+ * @return {!string}
+ */
+Metadata.prototype._dump$ = function () {
+ /** @type {BitVector} */
+ var this$0;
+ /** @type {Array.<undefined|!string>} */
+ var contents$0;
+ this$0 = this._bitVector;
+ contents$0 = [ ];
+ contents$0.push(Binary$dump32bitNumber$N(this$0._size));
+ contents$0.push(Binary$dump32bitNumberList$AN(this$0._v));
+ return contents$0.join('');
+};
+
+/**
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+Metadata.prototype._dump$LCompressionReport$ = function (report) {
+ /** @type {BitVector} */
+ var this$0;
+ /** @type {Array.<undefined|!string>} */
+ var contents$0;
+ this$0 = this._bitVector;
+ contents$0 = [ ];
+ contents$0.push(Binary$dump32bitNumber$N(this$0._size));
+ CompressionReport$add$LCompressionReport$II(report, 2, 2);
+ contents$0.push(Binary$dump32bitNumberList$ANLCompressionReport$(this$0._v, report));
+ return contents$0.join('');
+};
+
+/**
+ * class Section extends Metadata
+ * @constructor
+ */
+function Section() {
+}
+
+Section.prototype = new Metadata;
+/**
+ * @constructor
+ * @param {Oktavia} parent
+ */
+function Section$LOktavia$(parent) {
+ this._parent = parent;
+ this._bitVector = new BitVector$();
+ this._names = [ ];
+};
+
+Section$LOktavia$.prototype = new Section;
+
+/**
+ * @param {!string} name
+ */
+Section.prototype.setTail$S = function (name) {
+ /** @type {!number} */
+ var index$0;
+ /** @type {Oktavia} */
+ var this$0;
+ /** @type {FMIndex} */
+ var this$0$0;
+ this$0 = this._parent;
+ this$0$0 = this$0._fmindex;
+ index$0 = this$0$0._substr.length;
+ this._names.push(name);
+ this._bitVector.set$I(index$0 - 1);
+};
+
+/**
+ * @param {!string} name
+ * @param {!number} index
+ */
+Section.prototype.setTail$SI = function (name, index) {
+ this._names.push(name);
+ this._bitVector.set$I(index - 1);
+};
+
+/**
+ * @return {!number}
+ */
+Section.prototype.size$ = function () {
+ return (this._names.length | 0);
+};
+
+/**
+ * @param {!number} position
+ * @return {!number}
+ */
+Section.prototype.getSectionIndex$I = function (position) {
+ /** @type {BitVector} */
+ var this$0;
+ if (position < 0 || this._bitVector.size$() <= position) {
+ throw new Error("Section.getSectionIndex() : range error " + (position + ""));
+ }
+ this$0 = this._bitVector;
+ return this$0.rank$IB(position, true);
+};
+
+/**
+ * @param {!number} index
+ * @return {!string}
+ */
+Section.prototype.getName$I = function (index) {
+ if (index < 0 || this._names.length <= index) {
+ throw new Error("Section.getName() : range error");
+ }
+ return this._names[index];
+};
+
+/**
+ * @param {SingleResult} result
+ * @param {Array.<undefined|!number>} positions
+ * @param {!string} word
+ * @param {!boolean} stemmed
+ */
+Section.prototype.grouping$LSingleResult$AISB = function (result, positions, word, stemmed) {
+ /** @type {!number} */
+ var i;
+ /** @type {undefined|!number} */
+ var position;
+ /** @type {!number} */
+ var index;
+ /** @type {SearchUnit} */
+ var unit;
+ for (i = 0; i < positions.length; i++) {
+ position = positions[i];
+ index = this.getSectionIndex$I(position);
+ unit = SingleResult$getSearchUnit$LSingleResult$I(result, index);
+ if (unit.startPosition < 0) {
+ unit.startPosition = this.getStartPosition$I(index);
+ }
+ SearchUnit$addPosition$LSearchUnit$SIB(unit, word, position - unit.startPosition, stemmed);
+ }
+};
+
+/**
+ * @param {!number} index
+ * @return {!string}
+ */
+Section.prototype.getInformation$I = function (index) {
+ return this.getName$I(index);
+};
+
+/**
+ * @param {Oktavia} parent
+ * @param {!string} name
+ * @param {!string} data
+ * @param {!number} offset
+ * @return {!number}
+ */
+Section._load$LOktavia$SSI = function (parent, name, data, offset) {
+ /** @type {LoadedStringListResult} */
+ var strs;
+ /** @type {Section} */
+ var section;
+ /** @type {!number} */
+ var offset$0;
+ strs = new LoadedStringListResult$SI(data, offset);
+ section = new Section$LOktavia$(parent);
+ section._names = strs.result;
+ offset$0 = strs.offset;
+ offset$0 = section._bitVector.load$SI(data, offset$0);
+ section._parent._metadataLabels.push(name);
+ section._parent._metadatas[name] = section;
+ return offset$0;
+};
+
+var Section$_load$LOktavia$SSI = Section._load$LOktavia$SSI;
+
+/**
+ * @return {!string}
+ */
+Section.prototype._dump$ = function () {
+ return [ Binary$dump16bitNumber$I(0), Binary$dumpStringList$AS(this._names), Metadata.prototype._dump$.call(this) ].join('');
+};
+
+/**
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+Section.prototype._dump$LCompressionReport$ = function (report) {
+ CompressionReport$add$LCompressionReport$II(report, 1, 1);
+ return [ Binary$dump16bitNumber$I(0), Binary$dumpStringList$ASLCompressionReport$(this._names, report), Metadata.prototype._dump$LCompressionReport$.call(this, report) ].join('');
+};
+
+/**
+ * class Splitter extends Metadata
+ * @constructor
+ */
+function Splitter() {
+}
+
+Splitter.prototype = new Metadata;
+/**
+ * @constructor
+ * @param {Oktavia} parent
+ */
+function Splitter$LOktavia$(parent) {
+ this._parent = parent;
+ this._bitVector = new BitVector$();
+ this.name = null;
+};
+
+Splitter$LOktavia$.prototype = new Splitter;
+
+/**
+ * @constructor
+ * @param {Oktavia} parent
+ * @param {!string} name
+ */
+function Splitter$LOktavia$S(parent, name) {
+ this._parent = parent;
+ this._bitVector = new BitVector$();
+ this.name = name;
+};
+
+Splitter$LOktavia$S.prototype = new Splitter;
+
+/**
+ * @return {!number}
+ */
+Splitter.prototype.size$ = function () {
+ /** @type {BitVector} */
+ var this$0$0;
+ /** @type {!number} */
+ var i$0$0;
+ /** @type {BitVector} */
+ var _bitVector$0;
+ this$0$0 = _bitVector$0 = this._bitVector;
+ i$0$0 = _bitVector$0._size;
+ return this$0$0.rank$IB(i$0$0, true);
+};
+
+/**
+ */
+Splitter.prototype.split$ = function () {
+ /** @type {!number} */
+ var index$0;
+ /** @type {Oktavia} */
+ var this$0;
+ /** @type {FMIndex} */
+ var this$0$0;
+ this$0 = this._parent;
+ this$0$0 = this$0._fmindex;
+ index$0 = this$0$0._substr.length;
+ this._bitVector.set$I(index$0 - 1);
+};
+
+/**
+ * @param {!number} index
+ */
+Splitter.prototype.split$I = function (index) {
+ this._bitVector.set$I(index - 1);
+};
+
+/**
+ * @param {!number} position
+ * @return {!number}
+ */
+Splitter.prototype.getIndex$I = function (position) {
+ /** @type {BitVector} */
+ var this$0;
+ if (position < 0 || this._bitVector.size$() <= position) {
+ throw new Error("Section.getSectionIndex() : range error");
+ }
+ this$0 = this._bitVector;
+ return this$0.rank$IB(position, true);
+};
+
+/**
+ * @param {SingleResult} result
+ * @param {Array.<undefined|!number>} positions
+ * @param {!string} word
+ * @param {!boolean} stemmed
+ */
+Splitter.prototype.grouping$LSingleResult$AISB = function (result, positions, word, stemmed) {
+ /** @type {!number} */
+ var i;
+ /** @type {undefined|!number} */
+ var position;
+ /** @type {!number} */
+ var index;
+ /** @type {SearchUnit} */
+ var unit;
+ for (i = 0; i < positions.length; i++) {
+ position = positions[i];
+ index = this.getIndex$I(position);
+ unit = SingleResult$getSearchUnit$LSingleResult$I(result, index);
+ if (unit.startPosition < 0) {
+ unit.startPosition = this.getStartPosition$I(index);
+ }
+ SearchUnit$addPosition$LSearchUnit$SIB(unit, word, position - unit.startPosition, stemmed);
+ }
+};
+
+/**
+ * @param {!number} index
+ * @return {!string}
+ */
+Splitter.prototype.getInformation$I = function (index) {
+ return (this.name != null ? this.name + (index + 1 + "") : '');
+};
+
+/**
+ * @param {Oktavia} parent
+ * @param {!string} name
+ * @param {!string} data
+ * @param {!number} offset
+ * @return {!number}
+ */
+Splitter._load$LOktavia$SSI = function (parent, name, data, offset) {
+ /** @type {Splitter} */
+ var section;
+ section = new Splitter$LOktavia$(parent);
+ offset = section._bitVector.load$SI(data, offset);
+ section._parent._metadataLabels.push(name);
+ section._parent._metadatas[name] = section;
+ return offset;
+};
+
+var Splitter$_load$LOktavia$SSI = Splitter._load$LOktavia$SSI;
+
+/**
+ * @return {!string}
+ */
+Splitter.prototype._dump$ = function () {
+ return [ Binary$dump16bitNumber$I(1), Metadata.prototype._dump$.call(this) ].join('');
+};
+
+/**
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+Splitter.prototype._dump$LCompressionReport$ = function (report) {
+ CompressionReport$add$LCompressionReport$II(report, 1, 1);
+ return [ Binary$dump16bitNumber$I(1), Metadata.prototype._dump$LCompressionReport$.call(this, report) ].join('');
+};
+
+/**
+ * class Table extends Metadata
+ * @constructor
+ */
+function Table() {
+}
+
+Table.prototype = new Metadata;
+/**
+ * @constructor
+ * @param {Oktavia} parent
+ * @param {Array.<undefined|!string>} headers
+ */
+function Table$LOktavia$AS(parent, headers) {
+ this._parent = parent;
+ this._bitVector = new BitVector$();
+ this._headers = headers;
+ this._columnTails = new BitVector$();
+};
+
+Table$LOktavia$AS.prototype = new Table;
+
+/**
+ * @return {!number}
+ */
+Table.prototype.rowSize$ = function () {
+ /** @type {BitVector} */
+ var this$0$0;
+ /** @type {!number} */
+ var i$0$0;
+ /** @type {BitVector} */
+ var _bitVector$0;
+ this$0$0 = _bitVector$0 = this._bitVector;
+ i$0$0 = _bitVector$0._size;
+ return this$0$0.rank$IB(i$0$0, true);
+};
+
+/**
+ * @return {!number}
+ */
+Table.prototype.columnSize$ = function () {
+ return (this._headers.length | 0);
+};
+
+/**
+ */
+Table.prototype.setColumnTail$ = function () {
+ /** @type {!number} */
+ var index;
+ /** @type {Oktavia} */
+ var this$0;
+ /** @type {FMIndex} */
+ var this$0$0;
+ /** @type {Oktavia} */
+ var _parent$0;
+ this$0 = _parent$0 = this._parent;
+ this$0$0 = this$0._fmindex;
+ index = this$0$0._substr.length;
+ _parent$0._fmindex.push$S(Oktavia.eob);
+ this._columnTails.set$I(index - 1);
+};
+
+/**
+ */
+Table.prototype.setRowTail$ = function () {
+ /** @type {!number} */
+ var index;
+ /** @type {Oktavia} */
+ var this$0;
+ /** @type {FMIndex} */
+ var this$0$0;
+ this$0 = this._parent;
+ this$0$0 = this$0._fmindex;
+ index = this$0$0._substr.length;
+ this._bitVector.set$I(index - 1);
+};
+
+/**
+ * @param {!number} position
+ * @return {Array.<undefined|!number>}
+ */
+Table.prototype.getCell$I = function (position) {
+ /** @type {!number} */
+ var row;
+ /** @type {!number} */
+ var currentColumn;
+ /** @type {!number} */
+ var lastRowColumn;
+ /** @type {!number} */
+ var startPosition;
+ /** @type {Array.<undefined|!number>} */
+ var result;
+ /** @type {BitVector} */
+ var this$0;
+ /** @type {BitVector} */
+ var this$1;
+ if (position < 0 || this._bitVector.size$() <= position) {
+ throw new Error("Section.getSectionIndex() : range error " + (position + ""));
+ }
+ this$0 = this._bitVector;
+ row = this$0.rank$IB(position, true);
+ this$1 = this._columnTails;
+ currentColumn = this$1.rank$IB(position, true);
+ lastRowColumn = 0;
+ if (row > 0) {
+ startPosition = this._bitVector.select$I(row - 1) + 1;
+ lastRowColumn = this._columnTails.rank$I(startPosition);
+ }
+ result = [ row, currentColumn - lastRowColumn ];
+ return result;
+};
+
+/**
+ * @param {!number} rowIndex
+ * @return {Object.<string, undefined|!string>}
+ */
+Table.prototype.getRowContent$I = function (rowIndex) {
+ /** @type {!string} */
+ var content;
+ /** @type {Array.<undefined|!string>} */
+ var values;
+ /** @type {Object.<string, undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var i;
+ content = this.getContent$I(rowIndex);
+ values = content.split(Oktavia.eob, this._headers.length);
+ result = ({ });
+ for (i in this._headers) {
+ if (i < values.length) {
+ result[this._headers[i]] = values[i];
+ } else {
+ result[this._headers[i]] = '';
+ }
+ }
+ return result;
+};
+
+/**
+ * @param {SingleResult} result
+ * @param {Array.<undefined|!number>} positions
+ * @param {!string} word
+ * @param {!boolean} stemmed
+ */
+Table.prototype.grouping$LSingleResult$AISB = function (result, positions, word, stemmed) {
+};
+
+/**
+ * @param {!number} index
+ * @return {!string}
+ */
+Table.prototype.getInformation$I = function (index) {
+ return '';
+};
+
+/**
+ */
+Table.prototype._build$ = function () {
+ this._bitVector.build$();
+ this._columnTails.build$();
+};
+
+/**
+ * @param {Oktavia} parent
+ * @param {!string} name
+ * @param {!string} data
+ * @param {!number} offset
+ * @return {!number}
+ */
+Table._load$LOktavia$SSI = function (parent, name, data, offset) {
+ /** @type {LoadedStringListResult} */
+ var strs;
+ /** @type {Table} */
+ var table;
+ /** @type {!number} */
+ var offset$0;
+ strs = new LoadedStringListResult$SI(data, offset);
+ table = new Table$LOktavia$AS(parent, strs.result);
+ offset$0 = strs.offset;
+ offset$0 = table._bitVector.load$SI(data, offset$0);
+ table._parent._metadataLabels.push(name);
+ table._parent._metadatas[name] = table;
+ offset = offset$0;
+ return table._columnTails.load$SI(data, offset$0);
+};
+
+var Table$_load$LOktavia$SSI = Table._load$LOktavia$SSI;
+
+/**
+ * @return {!string}
+ */
+Table.prototype._dump$ = function () {
+ return [ Binary$dump16bitNumber$I(2), Binary$dumpStringList$AS(this._headers), Metadata.prototype._dump$.call(this), this._columnTails.dump$() ].join('');
+};
+
+/**
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+Table.prototype._dump$LCompressionReport$ = function (report) {
+ CompressionReport$add$LCompressionReport$II(report, 1, 1);
+ return [ Binary$dump16bitNumber$I(2), Binary$dumpStringList$ASLCompressionReport$(this._headers, report), Metadata.prototype._dump$LCompressionReport$.call(this, report), this._columnTails.dump$LCompressionReport$(report) ].join('');
+};
+
+/**
+ * class Block extends Metadata
+ * @constructor
+ */
+function Block() {
+}
+
+Block.prototype = new Metadata;
+/**
+ * @constructor
+ * @param {Oktavia} parent
+ */
+function Block$LOktavia$(parent) {
+ this._parent = parent;
+ this._bitVector = new BitVector$();
+ this._names = [ ];
+ this._start = false;
+};
+
+Block$LOktavia$.prototype = new Block;
+
+/**
+ * @param {!string} blockName
+ */
+Block.prototype.startBlock$S = function (blockName) {
+ this.startBlock$SI(blockName, this._parent.contentSize$());
+};
+
+/**
+ * @param {!string} blockName
+ * @param {!number} index
+ */
+Block.prototype.startBlock$SI = function (blockName, index) {
+ if (this._start) {
+ throw new Error('Splitter `' + this._names[this._names.length - 1] + '` is not closed');
+ }
+ this._start = true;
+ this._names.push(blockName);
+ this._bitVector.set$I(index - 1);
+};
+
+/**
+ */
+Block.prototype.endBlock$ = function () {
+ this.endBlock$I(this._parent.contentSize$());
+};
+
+/**
+ * @param {!number} index
+ */
+Block.prototype.endBlock$I = function (index) {
+ if (! this._start) {
+ throw new Error('Splitter is not started');
+ }
+ this._start = false;
+ this._bitVector.set$I(index - 1);
+};
+
+/**
+ * @return {!number}
+ */
+Block.prototype.size$ = function () {
+ return (this._names.length | 0);
+};
+
+/**
+ * @param {!number} position
+ * @return {!number}
+ */
+Block.prototype.blockIndex$I = function (position) {
+ /** @type {!number} */
+ var result;
+ /** @type {BitVector} */
+ var this$0;
+ if (position < 0 || this._parent._fmindex.size$() - 1 <= position) {
+ throw new Error("Block.blockIndex() : range error " + (position + ""));
+ }
+ if (position >= this._bitVector.size$()) {
+ position = (this._bitVector.size$() - 1 | 0);
+ result = (this._bitVector.rank$I(position) + 1 | 0);
+ } else {
+ this$0 = this._bitVector;
+ result = this$0.rank$IB(position, true);
+ }
+ return result;
+};
+
+/**
+ * @param {!number} position
+ * @return {!boolean}
+ */
+Block.prototype.inBlock$I = function (position) {
+ /** @type {!number} */
+ var blockIndex;
+ blockIndex = this.blockIndex$I(position);
+ return blockIndex % 2 !== 0;
+};
+
+/**
+ * @param {!number} position
+ * @return {!string}
+ */
+Block.prototype.getBlockContent$I = function (position) {
+ /** @type {!number} */
+ var blockIndex;
+ /** @type {!string} */
+ var result;
+ blockIndex = this.blockIndex$I(position);
+ if (blockIndex % 2 !== 0) {
+ result = this.getContent$I(blockIndex);
+ } else {
+ result = '';
+ }
+ return result;
+};
+
+/**
+ * @param {!number} position
+ * @return {!string}
+ */
+Block.prototype.getBlockName$I = function (position) {
+ /** @type {!number} */
+ var blockIndex;
+ /** @type {!string} */
+ var result;
+ blockIndex = this.blockIndex$I(position);
+ if (blockIndex % 2 !== 0) {
+ result = this._names[blockIndex >>> 1];
+ } else {
+ result = '';
+ }
+ return result;
+};
+
+/**
+ * @param {SingleResult} result
+ * @param {Array.<undefined|!number>} positions
+ * @param {!string} word
+ * @param {!boolean} stemmed
+ */
+Block.prototype.grouping$LSingleResult$AISB = function (result, positions, word, stemmed) {
+};
+
+/**
+ * @param {!number} index
+ * @return {!string}
+ */
+Block.prototype.getInformation$I = function (index) {
+ return '';
+};
+
+/**
+ * @param {Oktavia} parent
+ * @param {!string} name
+ * @param {!string} data
+ * @param {!number} offset
+ * @return {!number}
+ */
+Block._load$LOktavia$SSI = function (parent, name, data, offset) {
+ /** @type {LoadedStringListResult} */
+ var strs;
+ /** @type {Block} */
+ var block;
+ /** @type {!number} */
+ var offset$0;
+ strs = new LoadedStringListResult$SI(data, offset);
+ block = new Block$LOktavia$(parent);
+ block._names = strs.result;
+ offset$0 = strs.offset;
+ offset$0 = block._bitVector.load$SI(data, offset$0);
+ block._parent._metadataLabels.push(name);
+ block._parent._metadatas[name] = block;
+ return offset$0;
+};
+
+var Block$_load$LOktavia$SSI = Block._load$LOktavia$SSI;
+
+/**
+ * @return {!string}
+ */
+Block.prototype._dump$ = function () {
+ return [ Binary$dump16bitNumber$I(3), Binary$dumpStringList$AS(this._names), Metadata.prototype._dump$.call(this) ].join('');
+};
+
+/**
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+Block.prototype._dump$LCompressionReport$ = function (report) {
+ CompressionReport$add$LCompressionReport$II(report, 1, 1);
+ return [ Binary$dump16bitNumber$I(3), Binary$dumpStringList$ASLCompressionReport$(this._names, report), Metadata.prototype._dump$LCompressionReport$.call(this, report) ].join('');
+};
+
+/**
+ * class FMIndex extends Object
+ * @constructor
+ */
+function FMIndex() {
+}
+
+/**
+ * @constructor
+ */
+function FMIndex$() {
+ /** @type {Array.<undefined|!number>} */
+ var _rlt$0;
+ this._ssize = 0;
+ (this._ddic = 0, this._head = 0);
+ this._substr = "";
+ this._sv = new WaveletMatrix$();
+ this._posdic = [ ];
+ this._idic = [ ];
+ _rlt$0 = this._rlt = [ ];
+ _rlt$0.length = 65536;
+};
+
+FMIndex$.prototype = new FMIndex;
+
+/**
+ */
+FMIndex.prototype.clear$ = function () {
+ /** @type {WaveletMatrix} */
+ var this$0;
+ this$0 = this._sv;
+ this$0._bv.length = 0;
+ this$0._seps.length = 0;
+ this$0._size = 0;
+ this._posdic.length = 0;
+ this._idic.length = 0;
+ this._ddic = 0;
+ this._head = 0;
+ this._substr = "";
+};
+
+/**
+ * @return {!number}
+ */
+FMIndex.prototype.size$ = function () {
+ /** @type {WaveletMatrix} */
+ var this$0;
+ this$0 = this._sv;
+ return this$0._size;
+};
+
+/**
+ * @return {!number}
+ */
+FMIndex.prototype.contentSize$ = function () {
+ return this._substr.length;
+};
+
+/**
+ * @param {!string} key
+ * @return {!number}
+ */
+FMIndex.prototype.getRows$S = function (key) {
+ /** @type {Array.<undefined|!number>} */
+ var pos;
+ pos = [ ];
+ return this.getRows$SAI(key, pos);
+};
+
+/**
+ * @param {!string} key
+ * @param {Array.<undefined|!number>} pos
+ * @return {!number}
+ */
+FMIndex.prototype.getRows$SAI = function (key, pos) {
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var code;
+ /** @type {!number} */
+ var first;
+ /** @type {undefined|!number} */
+ var last;
+ /** @type {!number} */
+ var c;
+ /** @type {Array.<undefined|!number>} */
+ var _rlt$0;
+ i = key.length - 1;
+ code = key.charCodeAt(i);
+ first = (_rlt$0 = this._rlt)[code] + 1;
+ last = _rlt$0[code + 1];
+ while (first <= last) {
+ if (i === 0) {
+ pos[0] = (-- first | 0);
+ pos[1] = -- last;
+ return (last - first + 1 | 0);
+ }
+ i--;
+ c = key.charCodeAt(i);
+ first = this._rlt[c] + this._sv.rank$II(first - 1, c) + 1;
+ last = this._rlt[c] + this._sv.rank$II(last, c);
+ }
+ return 0;
+};
+
+/**
+ * @param {!number} i
+ * @return {!number}
+ */
+FMIndex.prototype.getPosition$I = function (i) {
+ /** @type {!number} */
+ var pos;
+ /** @type {!number} */
+ var c;
+ if (i >= this.size$()) {
+ throw new Error("FMIndex.getPosition() : range error");
+ }
+ pos = 0;
+ while (i !== this._head) {
+ if (i % this._ddic === 0) {
+ pos += this._posdic[i / this._ddic] + 1;
+ break;
+ }
+ c = this._sv.get$I(i);
+ i = this._rlt[c] + this._sv.rank$II(i, c);
+ pos++;
+ }
+ return (pos % this.size$() | 0);
+};
+
+/**
+ * @param {!number} pos
+ * @param {!number} len
+ * @return {!string}
+ */
+FMIndex.prototype.getSubstring$II = function (pos, len) {
+ /** @type {!number} */
+ var pos_end;
+ /** @type {!number} */
+ var pos_tmp;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var pos_idic;
+ /** @type {!string} */
+ var substr;
+ /** @type {!number} */
+ var c;
+ /** @type {!number} */
+ var _ddic$0;
+ if (pos >= this.size$()) {
+ throw new Error("FMIndex.getSubstring() : range error");
+ }
+ pos_end = Math.min(pos + len, this.size$());
+ pos_tmp = this.size$() - 1;
+ i = this._head;
+ pos_idic = Math.floor((pos_end + (_ddic$0 = this._ddic) - 2) / _ddic$0);
+ if (pos_idic < this._idic.length) {
+ pos_tmp = pos_idic * this._ddic;
+ i = this._idic[pos_idic];
+ }
+ substr = "";
+ while (pos_tmp >= pos) {
+ c = this._sv.get$I(i);
+ i = this._rlt[c] + this._sv.rank$II(i, c);
+ if (pos_tmp < pos_end) {
+ substr = String.fromCharCode(c) + substr;
+ }
+ if (pos_tmp === 0) {
+ break;
+ }
+ pos_tmp--;
+ }
+ return substr;
+};
+
+/**
+ */
+FMIndex.prototype.build$ = function () {
+ this.build$SIIB(String.fromCharCode(0), 65535, 20, false);
+};
+
+/**
+ * @param {!string} end_marker
+ * @param {!number} ddic
+ * @param {!boolean} verbose
+ */
+FMIndex.prototype.build$SIB = function (end_marker, ddic, verbose) {
+ this.build$SIIB(end_marker, 65535, ddic, verbose);
+};
+
+/**
+ * @param {!string} end_marker
+ * @param {!number} maxChar
+ * @param {!number} ddic
+ * @param {!boolean} verbose
+ */
+FMIndex.prototype.build$SIIB = function (end_marker, maxChar, ddic, verbose) {
+ /** @type {BurrowsWheelerTransform} */
+ var b;
+ /** @type {!string} */
+ var s;
+ /** @type {!number} */
+ var c;
+ /** @type {!string} */
+ var str$0;
+ /** @type {WaveletMatrix} */
+ var this$0;
+ /** @type {!string} */
+ var _str$0;
+ /** @type {Array.<undefined|!number>} */
+ var _suffixarray$0;
+ if (verbose) {
+ console.time("building burrows-wheeler transform");
+ }
+ this._substr += end_marker;
+ b = ({_str: "", _size: 0, _head: 0, _suffixarray: [ ]});
+ str$0 = this._substr;
+ _str$0 = b._str = str$0;
+ b._size = _str$0.length;
+ _suffixarray$0 = b._suffixarray = SAIS$make$S(str$0);
+ b._head = (_suffixarray$0.indexOf(0) | 0);
+ s = BurrowsWheelerTransform$get$LBurrowsWheelerTransform$(b);
+ this._ssize = s.length;
+ this._head = b._head;
+ b._str = "";
+ b._size = 0;
+ b._head = 0;
+ b._suffixarray.length = 0;
+ this._substr = "";
+ if (verbose) {
+ console.timeEnd("building burrows-wheeler transform");
+ }
+ if (verbose) {
+ console.time("building wavelet matrix");
+ }
+ this$0 = this._sv;
+ this$0._bitsize = (Math.ceil(Math.log(maxChar) / 0.6931471805599453) | 0);
+ if (verbose) {
+ console.log(" maxCharCode: ", maxChar);
+ console.log(" bitSize: ", this._sv.bitsize$());
+ }
+ this._sv.build$S(s);
+ if (verbose) {
+ console.timeEnd("building wavelet matrix");
+ }
+ if (verbose) {
+ console.time("caching rank less than");
+ }
+ for (c = 0; c < maxChar; c++) {
+ this._rlt[c] = this._sv.rank_less_than$II(this._sv.size$(), c);
+ }
+ if (verbose) {
+ console.timeEnd("caching rank less than");
+ }
+ this._ddic = ddic;
+ if (verbose) {
+ console.time("building dictionaries");
+ }
+ this._buildDictionaries$();
+ if (verbose) {
+ console.timeEnd("building dictionaries");
+ console.log('');
+ }
+};
+
+/**
+ */
+FMIndex.prototype._buildDictionaries$ = function () {
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var pos;
+ /** @type {!number} */
+ var c;
+ for (i = 0; i < this._ssize / this._ddic + 1; i++) {
+ this._posdic.push(0);
+ this._idic.push(0);
+ }
+ i = this._head;
+ pos = this.size$() - 1;
+ do {
+ if (i % this._ddic === 0) {
+ this._posdic[Math.floor(i / this._ddic)] = (pos | 0);
+ }
+ if (pos % this._ddic === 0) {
+ this._idic[Math.floor(pos / this._ddic)] = (i | 0);
+ }
+ c = this._sv.get$I(i);
+ i = this._rlt[c] + this._sv.rank$II(i, c);
+ pos--;
+ } while (i !== this._head);
+};
+
+/**
+ * @param {!string} doc
+ */
+FMIndex.prototype.push$S = function (doc) {
+ if (doc.length <= 0) {
+ throw new Error("FMIndex::push(): empty string");
+ }
+ this._substr += doc;
+};
+
+/**
+ * @param {!string} keyword
+ * @return {Array.<undefined|!number>}
+ */
+FMIndex.prototype.search$S = function (keyword) {
+ /** @type {Array.<undefined|!number>} */
+ var result;
+ /** @type {Array.<undefined|!number>} */
+ var position;
+ /** @type {!number} */
+ var rows;
+ /** @type {undefined|!number} */
+ var first;
+ /** @type {undefined|!number} */
+ var last;
+ /** @type {undefined|!number} */
+ var i;
+ result = [ ];
+ position = [ ];
+ rows = this.getRows$SAI(keyword, position);
+ if (rows > 0) {
+ first = position[0];
+ last = position[1];
+ for (i = first; i <= last; i++) {
+ result.push(this.getPosition$I(i));
+ }
+ }
+ return result;
+};
+
+/**
+ * @return {!string}
+ */
+FMIndex.prototype.dump$ = function () {
+ return this.dump$B(false);
+};
+
+/**
+ * @param {!boolean} verbose
+ * @return {!string}
+ */
+FMIndex.prototype.dump$B = function (verbose) {
+ /** @type {Array.<undefined|!string>} */
+ var contents;
+ /** @type {CompressionReport} */
+ var report;
+ /** @type {!number} */
+ var i;
+ contents = [ ];
+ report = ({source: 0, result: 0});
+ contents.push(Binary$dump32bitNumber$N(this._ddic));
+ contents.push(Binary$dump32bitNumber$N(this._ssize));
+ contents.push(Binary$dump32bitNumber$N(this._head));
+ CompressionReport$add$LCompressionReport$II(report, 6, 6);
+ contents.push(this._sv.dump$LCompressionReport$(report));
+ if (verbose) {
+ console.log("Serializing FM-index");
+ console.log(' Wavelet Matrix: ' + (contents[3].length * 2 + "") + ' bytes (' + (Math.round(report.result * 100.0 / report.source) + "") + '%)');
+ }
+ contents.push(Binary$dump32bitNumber$N(this._posdic.length));
+ for (i in this._posdic) {
+ contents.push(Binary$dump32bitNumber$N(this._posdic[i]));
+ }
+ for (i in this._idic) {
+ contents.push(Binary$dump32bitNumber$N(this._idic[i]));
+ }
+ if (verbose) {
+ console.log(' Dictionary Cache: ' + (this._idic.length * 16 + "") + ' bytes');
+ }
+ return contents.join("");
+};
+
+/**
+ * @param {!string} data
+ * @return {!number}
+ */
+FMIndex.prototype.load$S = function (data) {
+ return this.load$SI(data, 0);
+};
+
+/**
+ * @param {!string} data
+ * @param {!number} offset
+ * @return {!number}
+ */
+FMIndex.prototype.load$SI = function (data, offset) {
+ /** @type {!number} */
+ var maxChar;
+ /** @type {!number} */
+ var c;
+ /** @type {!number} */
+ var size;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var result$0;
+ /** @type {!number} */
+ var result$1;
+ result$0 = data.charCodeAt(offset) * 65536 + data.charCodeAt(offset + 1);
+ this._ddic = (result$0 | 0);
+ this._ssize = (Binary$load32bitNumber$SI(data, offset + 2) | 0);
+ this._head = (Binary$load32bitNumber$SI(data, offset + 4) | 0);
+ offset = this._sv.load$SI(data, offset + 6);
+ maxChar = Math.pow(2, this._sv.bitsize$());
+ for (c = 0; c < maxChar; c++) {
+ this._rlt[c] = this._sv.rank_less_than$II(this._sv.size$(), c);
+ }
+ result$1 = data.charCodeAt(offset) * 65536 + data.charCodeAt(offset + 1);
+ size = result$1;
+ offset += 2;
+ for (i = 0; i < size; (i++, offset += 2)) {
+ this._posdic.push(Binary$load32bitNumber$SI(data, offset));
+ }
+ for (i = 0; i < size; (i++, offset += 2)) {
+ this._idic.push(Binary$load32bitNumber$SI(data, offset));
+ }
+ return offset;
+};
+
+/**
+ * class Tag extends Object
+ * @constructor
+ */
+function Tag() {
+}
+
+/**
+ * @constructor
+ * @param {!string} name
+ */
+function Tag$S(name) {
+ this.name = name;
+ this.attributes = ({ });
+ this.isSelfClosing = false;
+};
+
+Tag$S.prototype = new Tag;
+
+/**
+ * class _Common extends Object
+ * @constructor
+ */
+function _Common() {
+}
+
+/**
+ * @constructor
+ */
+function _Common$() {
+};
+
+_Common$.prototype = new _Common;
+
+/**
+ * class _State extends Object
+ * @constructor
+ */
+function _State() {
+}
+
+/**
+ * @constructor
+ */
+function _State$() {
+};
+
+_State$.prototype = new _State;
+
+/**
+ * class SAXHandler extends Object
+ * @constructor
+ */
+function SAXHandler() {
+}
+
+/**
+ * @constructor
+ */
+function SAXHandler$() {
+ this.position = 0;
+ this.column = 0;
+ this.line = 0;
+};
+
+SAXHandler$.prototype = new SAXHandler;
+
+/**
+ * @param {Error} error
+ */
+SAXHandler.prototype.onerror$LError$ = function (error) {
+};
+
+/**
+ * @param {!string} text
+ */
+SAXHandler.prototype.ontext$S = function (text) {
+};
+
+/**
+ * @param {!string} doctype
+ */
+SAXHandler.prototype.ondoctype$S = function (doctype) {
+};
+
+/**
+ * @param {!string} name
+ * @param {!string} body
+ */
+SAXHandler.prototype.onprocessinginstruction$SS = function (name, body) {
+};
+
+/**
+ * @param {!string} sgmlDecl
+ */
+SAXHandler.prototype.onsgmldeclaration$S = function (sgmlDecl) {
+};
+
+/**
+ * @param {!string} tagname
+ * @param {Object.<string, undefined|!string>} attributes
+ */
+SAXHandler.prototype.onopentag$SHS = function (tagname, attributes) {
+};
+
+/**
+ * @param {!string} tagname
+ */
+SAXHandler.prototype.onclosetag$S = function (tagname) {
+};
+
+/**
+ * @param {!string} name
+ * @param {!string} value
+ */
+SAXHandler.prototype.onattribute$SS = function (name, value) {
+};
+
+/**
+ * @param {!string} comment
+ */
+SAXHandler.prototype.oncomment$S = function (comment) {
+};
+
+/**
+ */
+SAXHandler.prototype.onopencdata$ = function () {
+};
+
+/**
+ * @param {!string} cdata
+ */
+SAXHandler.prototype.oncdata$S = function (cdata) {
+};
+
+/**
+ */
+SAXHandler.prototype.onclosecdata$ = function () {
+};
+
+/**
+ */
+SAXHandler.prototype.onend$ = function () {
+};
+
+/**
+ */
+SAXHandler.prototype.onready$ = function () {
+};
+
+/**
+ * @param {!string} script
+ */
+SAXHandler.prototype.onscript$S = function (script) {
+};
+
+/**
+ * class _HTMLHandler extends SAXHandler
+ * @constructor
+ */
+function _HTMLHandler() {
+}
+
+_HTMLHandler.prototype = new SAXHandler;
+/**
+ * @constructor
+ * @param {Object.<string, undefined|Array.<undefined|!string>>} styles
+ * @param {!boolean} escape
+ */
+function _HTMLHandler$HASB(styles, escape) {
+ this.position = 0;
+ this.column = 0;
+ this.line = 0;
+ this.text = [ ];
+ this.escape = escape;
+ this.styles = styles;
+};
+
+_HTMLHandler$HASB.prototype = new _HTMLHandler;
+
+/**
+ * @param {!string} str
+ * @return {!string}
+ */
+_HTMLHandler.escapeHTML$S = function (str) {
+ return str.replace(/\n/g, "<br/>").replace(/&/g, "&amp;").replace(/"/g, "&quot;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
+};
+
+var _HTMLHandler$escapeHTML$S = _HTMLHandler.escapeHTML$S;
+
+/**
+ * @param {!string} tagname
+ * @param {Object.<string, undefined|!string>} attributes
+ */
+_HTMLHandler.prototype.onopentag$SHS = function (tagname, attributes) {
+ this.text.push(this.styles[tagname][0]);
+};
+
+/**
+ * @param {!string} tagname
+ */
+_HTMLHandler.prototype.onclosetag$S = function (tagname) {
+ this.text.push(this.styles[tagname][1]);
+};
+
+/**
+ * @param {!string} text
+ */
+_HTMLHandler.prototype.ontext$S = function (text) {
+ if (this.escape) {
+ this.text.push(text.replace(/\n/g, "<br/>").replace(/&/g, "&amp;").replace(/"/g, "&quot;").replace(/</g, "&lt;").replace(/>/g, "&gt;"));
+ } else {
+ this.text.push(text);
+ }
+};
+
+/**
+ * @return {!string}
+ */
+_HTMLHandler.prototype.result$ = function () {
+ return this.text.join('');
+};
+
+/**
+ * class SAXParser extends Object
+ * @constructor
+ */
+function SAXParser() {
+}
+
+/**
+ * @constructor
+ * @param {SAXHandler} handler
+ */
+function SAXParser$LSAXHandler$(handler) {
+ this.q = "";
+ this.c = "";
+ this.bufferCheckPosition = 0;
+ this.looseCase = "";
+ this.tags = [ ];
+ this.closed = false;
+ this.closedRoot = false;
+ this.sawRoot = false;
+ this.tag = null;
+ this.error = null;
+ this.handler = null;
+ this.ENTITIES = null;
+ this.strict = false;
+ this.tagName = "";
+ this.state = 0;
+ this.line = 0;
+ this.column = 0;
+ this.position = 0;
+ this.startTagPosition = 0;
+ this.attribName = "";
+ this.attribValue = "";
+ this.script = "";
+ this.textNode = "";
+ this.attribList = null;
+ this.noscript = false;
+ this.cdata = "";
+ this.procInstBody = "";
+ this.procInstName = "";
+ this.doctype = "";
+ this.entity = "";
+ this.sgmlDecl = "";
+ this.comment = "";
+ this.preTags = 0;
+ this._init$LSAXHandler$B(handler, false);
+};
+
+SAXParser$LSAXHandler$.prototype = new SAXParser;
+
+/**
+ * @constructor
+ * @param {SAXHandler} handler
+ * @param {!boolean} strict
+ */
+function SAXParser$LSAXHandler$B(handler, strict) {
+ this.q = "";
+ this.c = "";
+ this.bufferCheckPosition = 0;
+ this.looseCase = "";
+ this.tags = [ ];
+ this.closed = false;
+ this.closedRoot = false;
+ this.sawRoot = false;
+ this.tag = null;
+ this.error = null;
+ this.handler = null;
+ this.ENTITIES = null;
+ this.strict = false;
+ this.tagName = "";
+ this.state = 0;
+ this.line = 0;
+ this.column = 0;
+ this.position = 0;
+ this.startTagPosition = 0;
+ this.attribName = "";
+ this.attribValue = "";
+ this.script = "";
+ this.textNode = "";
+ this.attribList = null;
+ this.noscript = false;
+ this.cdata = "";
+ this.procInstBody = "";
+ this.procInstName = "";
+ this.doctype = "";
+ this.entity = "";
+ this.sgmlDecl = "";
+ this.comment = "";
+ this.preTags = 0;
+ this._init$LSAXHandler$B(handler, strict);
+};
+
+SAXParser$LSAXHandler$B.prototype = new SAXParser;
+
+/**
+ * @param {SAXHandler} handler
+ * @param {!boolean} strict
+ */
+SAXParser.prototype._init$LSAXHandler$B = function (handler, strict) {
+ this.handler = handler;
+ this.clearBuffers$();
+ this.q = "";
+ this.bufferCheckPosition = 65536;
+ this.looseCase = 'toLowerCase';
+ this.tags = [ ];
+ this.closed = this.closedRoot = this.sawRoot = false;
+ this.tag = null;
+ this.error = null;
+ this.strict = strict;
+ this.noscript = strict;
+ this.state = 1;
+ this.ENTITIES = _Entities$entity_list$();
+ this.attribList = [ ];
+ this.noscript = false;
+ this.preTags = 0;
+};
+
+/**
+ * @param {!boolean} flag
+ */
+SAXParser.prototype.set_noscript$B = function (flag) {
+ this.noscript = flag;
+};
+
+/**
+ * @return {SAXParser}
+ */
+SAXParser.prototype.resume$ = function () {
+ this.error = null;
+ return this;
+};
+
+/**
+ * @return {SAXParser}
+ */
+SAXParser.prototype.close$ = function () {
+ return this.parse$S('');
+};
+
+/**
+ * @param {!string} chunk
+ * @return {SAXParser}
+ */
+SAXParser.prototype.parse$S = function (chunk) {
+ /** @type {Char} */
+ var _;
+ /** @type {!number} */
+ var i;
+ /** @type {!string} */
+ var c;
+ /** @type {!number} */
+ var starti;
+ /** @type {!number} */
+ var pad;
+ /** @type {!number} */
+ var returnState;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$0;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$1;
+ /** @type {RegExp} */
+ var charclass$2;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$3;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$4;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$5;
+ /** @type {!string} */
+ var text$0;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$6;
+ /** @type {RegExp} */
+ var charclass$7;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$8;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$9;
+ /** @type {RegExp} */
+ var charclass$10;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$11;
+ /** @type {RegExp} */
+ var charclass$12;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$13;
+ /** @type {RegExp} */
+ var charclass$14;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$15;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$16;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$17;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$18;
+ /** @type {RegExp} */
+ var charclass$19;
+ /** @type {RegExp} */
+ var charclass$20;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$21;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$22;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$23;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$24;
+ /** @type {!string} */
+ var comment$0;
+ _ = new Char$();
+ if (this.error) {
+ throw this.error;
+ }
+ if (this.closed) {
+ return this.emiterror$S("Cannot write after close. Assign an onready handler.");
+ }
+ (i = 0, c = "");
+ while (this.c = c = chunk.charAt(i++)) {
+ this.position++;
+ if (c === "\n") {
+ this.handler.line++;
+ this.handler.column = 0;
+ } else {
+ this.handler.column++;
+ }
+ switch (this.state) {
+ case 1:
+ if (c === "<") {
+ this.state = 4;
+ this.startTagPosition = this.position;
+ } else {
+ charclass$0 = _.whitespace;
+ if (! $__jsx_ObjectHasOwnProperty.call(charclass$0, c)) {
+ this.strictFail$S("Non-whitespace before first tag.");
+ this.textNode = c;
+ this.state = 2;
+ }
+ }
+ continue;
+ case 2:
+ if (this.sawRoot && ! this.closedRoot) {
+ starti = i - 1;
+ while (c && c !== "<" && c !== "&") {
+ c = chunk.charAt(i++);
+ if (c) {
+ this.position++;
+ if (c === "\n") {
+ this.handler.line++;
+ this.handler.column = 0;
+ } else {
+ this.handler.column++;
+ }
+ }
+ }
+ this.textNode += chunk.substring(starti, i - 1);
+ }
+ if (c === "<") {
+ this.state = 4;
+ this.startTagPosition = this.position;
+ } else {
+ if (_.not$HBS(_.whitespace, c) && (! this.sawRoot || this.closedRoot)) {
+ this.strictFail$S("Text data outside of root node.");
+ }
+ if (c === "&") {
+ this.state = 3;
+ } else {
+ this.textNode += c;
+ }
+ }
+ continue;
+ case 33:
+ if (c === "<") {
+ this.state = 34;
+ } else {
+ this.script += c;
+ }
+ continue;
+ case 34:
+ if (c === "/") {
+ this.state = 31;
+ } else {
+ this.script += "<" + c;
+ this.state = 33;
+ }
+ continue;
+ case 4:
+ if (c === "!") {
+ this.state = 5;
+ this.sgmlDecl = "";
+ } else {
+ charclass$1 = _.whitespace;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$1, c)) {
+ } else {
+ charclass$2 = _.nameStart;
+ if (charclass$2.test(c)) {
+ this.state = 21;
+ this.tagName = c;
+ } else {
+ if (c === "/") {
+ this.state = 31;
+ this.tagName = "";
+ } else {
+ if (c === "?") {
+ this.state = 18;
+ this.procInstName = this.procInstBody = "";
+ } else {
+ this.strictFail$S("Unencoded <");
+ if (this.startTagPosition + 1 < this.position) {
+ pad = this.position - this.startTagPosition;
+ for (i = 0; i < pad; i++) {
+ c = " " + c;
+ }
+ }
+ this.textNode += "<" + c;
+ this.state = 2;
+ }
+ }
+ }
+ }
+ }
+ continue;
+ case 5:
+ if ((this.sgmlDecl + c).toUpperCase() === _.CDATA) {
+ this.closetext_if_exist$();
+ this.state = 15;
+ this.sgmlDecl = "";
+ this.cdata = "";
+ } else {
+ if (this.sgmlDecl + c === "--") {
+ this.state = 12;
+ this.comment = "";
+ this.sgmlDecl = "";
+ } else {
+ if ((this.sgmlDecl + c).toUpperCase() === _.DOCTYPE) {
+ this.state = 7;
+ if (this.doctype || this.sawRoot) {
+ this.strictFail$S("Inappropriately located doctype declaration");
+ }
+ this.doctype = "";
+ this.sgmlDecl = "";
+ } else {
+ if (c === ">") {
+ this.closetext_if_exist$();
+ this.sgmlDecl = "";
+ this.state = 2;
+ } else {
+ charclass$3 = _.quote;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$3, c)) {
+ this.state = 6;
+ this.sgmlDecl += c;
+ } else {
+ this.sgmlDecl += c;
+ }
+ }
+ }
+ }
+ }
+ continue;
+ case 6:
+ if (c === this.q) {
+ this.state = 5;
+ this.q = "";
+ }
+ this.sgmlDecl += c;
+ continue;
+ case 7:
+ if (c === ">") {
+ this.state = 2;
+ this.closetext_if_exist$();
+ this.doctype.trim();
+ } else {
+ this.doctype += c;
+ if (c === "[") {
+ this.state = 9;
+ } else {
+ charclass$4 = _.quote;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$4, c)) {
+ this.state = 8;
+ this.q = c;
+ }
+ }
+ }
+ continue;
+ case 8:
+ this.doctype += c;
+ if (c === this.q) {
+ this.q = "";
+ this.state = 7;
+ }
+ continue;
+ case 9:
+ this.doctype += c;
+ if (c === "]") {
+ this.state = 7;
+ } else {
+ charclass$5 = _.quote;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$5, c)) {
+ this.state = 10;
+ this.q = c;
+ }
+ }
+ continue;
+ case 10:
+ this.doctype += c;
+ if (c === this.q) {
+ this.state = 9;
+ this.q = "";
+ }
+ continue;
+ case 12:
+ if (c === "-") {
+ this.state = 13;
+ } else {
+ this.comment += c;
+ }
+ continue;
+ case 13:
+ if (c === "-") {
+ this.state = 14;
+ text$0 = this.comment;
+ text$0 = text$0.replace(/[\n\t]/g, ' ');
+ text$0 = text$0.replace(/\s\s+/g, " ");
+ comment$0 = this.comment = text$0;
+ if (comment$0) {
+ this.closetext_if_exist$();
+ this.comment.trim();
+ }
+ this.comment = "";
+ } else {
+ this.comment += "-" + c;
+ this.state = 12;
+ }
+ continue;
+ case 14:
+ if (c !== ">") {
+ this.strictFail$S("Malformed comment");
+ this.comment += "--" + c;
+ this.state = 12;
+ } else {
+ this.state = 2;
+ }
+ continue;
+ case 15:
+ if (c === "]") {
+ this.state = 16;
+ } else {
+ this.cdata += c;
+ }
+ continue;
+ case 16:
+ if (c === "]") {
+ this.state = 17;
+ } else {
+ this.cdata += "]" + c;
+ this.state = 15;
+ }
+ continue;
+ case 17:
+ if (c === ">") {
+ if (this.cdata) {
+ this.closetext_if_exist$();
+ }
+ this.cdata = "";
+ this.state = 2;
+ } else {
+ if (c === "]") {
+ this.cdata += "]";
+ } else {
+ this.cdata += "]]" + c;
+ this.state = 15;
+ }
+ }
+ continue;
+ case 18:
+ if (c === "?") {
+ this.state = 20;
+ } else {
+ charclass$6 = _.whitespace;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$6, c)) {
+ this.state = 19;
+ } else {
+ this.procInstName += c;
+ }
+ }
+ continue;
+ case 19:
+ if (! this.procInstBody && _.is$HBS(_.whitespace, c)) {
+ continue;
+ } else {
+ if (c === "?") {
+ this.state = 20;
+ } else {
+ this.procInstBody += c;
+ }
+ }
+ continue;
+ case 20:
+ if (c === ">") {
+ this.closetext_if_exist$();
+ this.procInstName = this.procInstBody = "";
+ this.state = 2;
+ } else {
+ this.procInstBody += "?" + c;
+ this.state = 19;
+ }
+ continue;
+ case 21:
+ charclass$7 = _.nameBody;
+ if (charclass$7.test(c)) {
+ this.tagName += c;
+ } else {
+ this.newTag$();
+ if (c === ">") {
+ this.openTag$B(false);
+ } else {
+ if (c === "/") {
+ this.state = 22;
+ } else {
+ charclass$8 = _.whitespace;
+ if (! $__jsx_ObjectHasOwnProperty.call(charclass$8, c)) {
+ this.strictFail$S("Invalid character in tag name");
+ }
+ this.state = 23;
+ }
+ }
+ }
+ continue;
+ case 22:
+ if (c === ">") {
+ this.openTag$B(true);
+ this.closeTag$();
+ } else {
+ this.strictFail$S("Forward-slash in opening tag not followed by >");
+ this.state = 23;
+ }
+ continue;
+ case 23:
+ charclass$9 = _.whitespace;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$9, c)) {
+ continue;
+ } else {
+ if (c === ">") {
+ this.openTag$B(false);
+ } else {
+ if (c === "/") {
+ this.state = 22;
+ } else {
+ charclass$10 = _.nameStart;
+ if (charclass$10.test(c)) {
+ this.attribName = c;
+ this.attribValue = "";
+ this.state = 24;
+ } else {
+ this.strictFail$S("Invalid attribute name");
+ }
+ }
+ }
+ }
+ continue;
+ case 24:
+ if (c === "=") {
+ this.state = 26;
+ } else {
+ if (c === ">") {
+ this.strictFail$S("Attribute without value");
+ this.attribValue = this.attribName;
+ this.attrib$();
+ this.openTag$B(false);
+ } else {
+ charclass$11 = _.whitespace;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$11, c)) {
+ this.state = 25;
+ } else {
+ charclass$12 = _.nameBody;
+ if (charclass$12.test(c)) {
+ this.attribName += c;
+ } else {
+ this.strictFail$S("Invalid attribute name");
+ }
+ }
+ }
+ }
+ continue;
+ case 25:
+ if (c === "=") {
+ this.state = 26;
+ } else {
+ charclass$13 = _.whitespace;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$13, c)) {
+ continue;
+ } else {
+ this.strictFail$S("Attribute without value");
+ this.tag.attributes[this.attribName] = "";
+ this.attribValue = "";
+ this.closetext_if_exist$();
+ this.attribName = "";
+ if (c === ">") {
+ this.openTag$B(false);
+ } else {
+ charclass$14 = _.nameStart;
+ if (charclass$14.test(c)) {
+ this.attribName = c;
+ this.state = 24;
+ } else {
+ this.strictFail$S("Invalid attribute name");
+ this.state = 23;
+ }
+ }
+ }
+ }
+ continue;
+ case 26:
+ charclass$15 = _.whitespace;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$15, c)) {
+ continue;
+ } else {
+ charclass$16 = _.quote;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$16, c)) {
+ this.q = c;
+ this.state = 27;
+ } else {
+ this.strictFail$S("Unquoted attribute value");
+ this.state = 28;
+ this.attribValue = c;
+ }
+ }
+ continue;
+ case 27:
+ if (c !== this.q) {
+ if (c === "&") {
+ this.state = 29;
+ } else {
+ this.attribValue += c;
+ }
+ continue;
+ }
+ this.attrib$();
+ this.q = "";
+ this.state = 23;
+ continue;
+ case 28:
+ charclass$17 = _.attribEnd;
+ if (! $__jsx_ObjectHasOwnProperty.call(charclass$17, c)) {
+ if (c === "&") {
+ this.state = 30;
+ } else {
+ this.attribValue += c;
+ }
+ continue;
+ }
+ this.attrib$();
+ if (c === ">") {
+ this.openTag$B(false);
+ } else {
+ this.state = 23;
+ }
+ continue;
+ case 31:
+ if (! this.tagName) {
+ charclass$18 = _.whitespace;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$18, c)) {
+ continue;
+ } else {
+ charclass$19 = _.nameStart;
+ if (! charclass$19.test(c)) {
+ if (this.script) {
+ this.script += "</" + c;
+ this.state = 33;
+ } else {
+ this.strictFail$S("Invalid tagname in closing tag.");
+ }
+ } else {
+ this.tagName = c;
+ }
+ }
+ } else {
+ if (c === ">") {
+ this.closeTag$();
+ } else {
+ charclass$20 = _.nameBody;
+ if (charclass$20.test(c)) {
+ this.tagName += c;
+ } else {
+ if (this.script) {
+ this.script += "</" + this.tagName;
+ this.tagName = "";
+ this.state = 33;
+ } else {
+ charclass$21 = _.whitespace;
+ if (! $__jsx_ObjectHasOwnProperty.call(charclass$21, c)) {
+ this.strictFail$S("Invalid tagname in closing tag");
+ }
+ this.state = 32;
+ }
+ }
+ }
+ }
+ continue;
+ case 32:
+ charclass$22 = _.whitespace;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$22, c)) {
+ continue;
+ }
+ if (c === ">") {
+ this.closeTag$();
+ } else {
+ this.strictFail$S("Invalid characters in closing tag");
+ }
+ continue;
+ case 3:
+ if (c === ";") {
+ this.textNode += this.parseEntity$();
+ this.entity = "";
+ this.state = 2;
+ } else {
+ charclass$23 = _.entity;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$23, c)) {
+ this.entity += c;
+ } else {
+ this.strictFail$S("Invalid character entity");
+ this.textNode += "&" + this.entity + c;
+ this.entity = "";
+ this.state = 2;
+ }
+ }
+ continue;
+ case 29:
+ case 30:
+ if (this.state === 29) {
+ returnState = 27;
+ } else {
+ returnState = 28;
+ }
+ if (c === ";") {
+ this.attribValue += this.parseEntity$();
+ this.entity = "";
+ this.state = (returnState | 0);
+ } else {
+ charclass$24 = _.entity;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$24, c)) {
+ this.entity += c;
+ } else {
+ this.strictFail$S("Invalid character entity");
+ this.attribValue += "&" + this.entity + c;
+ this.entity = "";
+ this.state = (returnState | 0);
+ }
+ }
+ continue;
+ default:
+ throw new Error("Unknown state: " + (this.state + ""));
+ }
+ }
+ this.end$();
+ return this;
+};
+
+/**
+ */
+SAXParser.prototype.clearBuffers$ = function () {
+ this.comment = '';
+ this.sgmlDecl = '';
+ this.textNode = '';
+ this.tagName = '';
+ this.doctype = '';
+ this.procInstName = '';
+ this.procInstBody = '';
+ this.entity = '';
+ this.attribName = '';
+ this.attribValue = '';
+ this.cdata = '';
+ this.script = '';
+};
+
+/**
+ */
+SAXParser.prototype.closetext_if_exist$ = function () {
+ if (this.textNode !== '') {
+ this.closetext$();
+ }
+};
+
+/**
+ */
+SAXParser.prototype.closetext$ = function () {
+ /** @type {!string} */
+ var text;
+ /** @type {!string} */
+ var text$0;
+ if (this.preTags === 0) {
+ text$0 = this.textNode;
+ text$0 = text$0.replace(/[\n\t]/g, ' ');
+ text$0 = text$0.replace(/\s\s+/g, " ");
+ text = text$0;
+ if (text$0) {
+ this.handler.ontext$S(text);
+ }
+ } else {
+ if (this.textNode) {
+ this.handler.ontext$S(this.textNode);
+ }
+ }
+ this.textNode = "";
+};
+
+/**
+ * @param {!string} text
+ * @return {!string}
+ */
+SAXParser.prototype.textopts$S = function (text) {
+ text = text.replace(/[\n\t]/g, ' ');
+ text = text.replace(/\s\s+/g, " ");
+ return text;
+};
+
+/**
+ * @param {!string} er
+ * @return {SAXParser}
+ */
+SAXParser.prototype.emiterror$S = function (er) {
+ /** @type {Error} */
+ var error;
+ this.closetext$();
+ er += "\nLine: " + (this.line + "") + "\nColumn: " + (this.column + "") + "\nChar: " + this.c;
+ error = new Error(er);
+ this.error = error;
+ return this;
+};
+
+/**
+ */
+SAXParser.prototype.end$ = function () {
+ if (! this.closedRoot) {
+ this.strictFail$S("Unclosed root tag");
+ }
+ if (this.state !== 2) {
+ this.emiterror$S("Unexpected end");
+ }
+ this.closetext$();
+ this.c = "";
+ this.closed = true;
+};
+
+/**
+ * @param {!string} message
+ */
+SAXParser.prototype.strictFail$S = function (message) {
+ if (this.strict) {
+ this.emiterror$S(message);
+ }
+};
+
+/**
+ */
+SAXParser.prototype.newTag$ = function () {
+ if (! this.strict) {
+ this.tagName = this.tagName.toLowerCase();
+ }
+ this.tag = ({name: this.tagName, attributes: ({ }), isSelfClosing: false});
+ this.attribList.length = 0;
+};
+
+/**
+ */
+SAXParser.prototype.attrib$ = function () {
+ if (! this.strict) {
+ this.attribName = this.attribName.toLowerCase();
+ }
+ if ($__jsx_ObjectHasOwnProperty.call(this.tag.attributes, this.attribName)) {
+ this.attribName = this.attribValue = "";
+ return;
+ }
+ this.tag.attributes[this.attribName] = this.attribValue;
+ this.closetext_if_exist$();
+ this.attribName = this.attribValue = "";
+};
+
+/**
+ */
+SAXParser.prototype.openTag$ = function () {
+ this.openTag$B(false);
+};
+
+/**
+ * @param {!boolean} selfClosing
+ */
+SAXParser.prototype.openTag$B = function (selfClosing) {
+ /** @type {Tag} */
+ var tag$0;
+ /** @type {Tag} */
+ var tag$1;
+ (tag$0 = this.tag).isSelfClosing = selfClosing;
+ this.sawRoot = true;
+ this.tags.push(tag$0);
+ this.closetext_if_exist$();
+ this.handler.onopentag$SHS((tag$1 = this.tag).name, tag$1.attributes);
+ if (this.tag.name === 'pre') {
+ this.preTags++;
+ }
+ if (! selfClosing) {
+ if (! this.noscript && this.tagName.toLowerCase() === "script") {
+ this.state = 33;
+ } else {
+ this.state = 2;
+ }
+ this.tag = null;
+ this.tagName = "";
+ }
+ this.attribName = this.attribValue = "";
+ this.attribList.length = 0;
+};
+
+/**
+ */
+SAXParser.prototype.closeTag$ = function () {
+ /** @type {!number} */
+ var t;
+ /** @type {!string} */
+ var tagName;
+ /** @type {!string} */
+ var closeTo;
+ /** @type {Tag} */
+ var close;
+ /** @type {!number} */
+ var s;
+ /** @type {Tag} */
+ var tag$0;
+ if (! this.tagName) {
+ this.strictFail$S("Weird empty close tag.");
+ this.textNode += "</>";
+ this.state = 2;
+ return;
+ }
+ if (this.script) {
+ if (this.tagName !== "script") {
+ this.script += "</" + this.tagName + ">";
+ this.tagName = "";
+ this.state = 33;
+ return;
+ }
+ this.closetext_if_exist$();
+ this.script = "";
+ }
+ t = this.tags.length;
+ tagName = this.tagName;
+ if (! this.strict) {
+ tagName = tagName.toLowerCase();
+ }
+ closeTo = tagName;
+ while (t--) {
+ close = this.tags[t];
+ if (close.name !== closeTo) {
+ this.strictFail$S("Unexpected close tag");
+ } else {
+ break;
+ }
+ }
+ if (t < 0) {
+ this.strictFail$S("Unmatched closing tag: " + this.tagName);
+ this.textNode += "</" + this.tagName + ">";
+ this.state = 2;
+ return;
+ }
+ this.tagName = tagName;
+ s = this.tags.length;
+ while (s-- > t) {
+ tag$0 = this.tag = this.tags.pop();
+ this.tagName = tag$0.name;
+ this.closetext_if_exist$();
+ this.handler.onclosetag$S(this.tagName);
+ if (this.tagName === 'pre') {
+ this.preTags--;
+ }
+ }
+ if (t === 0) {
+ this.closedRoot = true;
+ }
+ this.tagName = this.attribValue = this.attribName = "";
+ this.attribList.length = 0;
+ this.state = 2;
+};
+
+/**
+ * @return {!string}
+ */
+SAXParser.prototype.parseEntity$ = function () {
+ /** @type {!string} */
+ var entity;
+ /** @type {!string} */
+ var entityLC;
+ /** @type {!number} */
+ var num;
+ /** @type {!string} */
+ var numStr;
+ entity = this.entity;
+ entityLC = entity.toLowerCase();
+ num = 0;
+ numStr = "";
+ if (this.ENTITIES[entity]) {
+ return this.ENTITIES[entity];
+ }
+ if (this.ENTITIES[entityLC]) {
+ return this.ENTITIES[entityLC];
+ }
+ entity = entityLC;
+ if (entityLC.charAt(0) === "#") {
+ if (entity.charAt(1) === "x") {
+ entity = entity.slice(2);
+ num = $__jsx_parseInt(entity, 16);
+ numStr = num.toString(16);
+ } else {
+ entity = entity.slice(1);
+ num = $__jsx_parseInt(entity, 10);
+ numStr = num.toString(10);
+ }
+ }
+ entity = entity.replace(/^0+/, "");
+ if (numStr.toLowerCase() !== entity) {
+ this.strictFail$S("Invalid character entity");
+ return "&" + this.entity + ";";
+ }
+ return String.fromCharCode(num);
+};
+
+/**
+ * class Char extends Object
+ * @constructor
+ */
+function Char() {
+}
+
+/**
+ * @constructor
+ */
+function Char$() {
+ this.CDATA = "[CDATA[";
+ this.DOCTYPE = "DOCTYPE";
+ this.XML_NAMESPACE = "http://www.w3.org/XML/1998/namespace";
+ this.whitespace = this._charClass$S("\r\n\t ");
+ this.number = this._charClass$S("0124356789");
+ this.letter = this._charClass$S("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ");
+ this.quote = this._charClass$S("'\"");
+ this.entity = this._charClass$S("0124356789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ#");
+ this.attribEnd = this._charClass$S("\r\n\t >");
+ this.nameStart = /[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/;
+ this.nameBody = /[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040\.\d-]/;
+};
+
+Char$.prototype = new Char;
+
+/**
+ * @param {!string} str
+ * @return {Object.<string, undefined|!boolean>}
+ */
+Char.prototype._charClass$S = function (str) {
+ /** @type {Object.<string, undefined|!boolean>} */
+ var result;
+ /** @type {!number} */
+ var i;
+ result = ({ });
+ for (i = 0; i < str.length; i++) {
+ result[str.slice(i, i + 1)] = true;
+ }
+ return result;
+};
+
+/**
+ * @param {RegExp} charclass
+ * @param {!string} c
+ * @return {!boolean}
+ */
+Char.prototype.is$LRegExp$S = function (charclass, c) {
+ return charclass.test(c);
+};
+
+/**
+ * @param {Object.<string, undefined|!boolean>} charclass
+ * @param {!string} c
+ * @return {!boolean}
+ */
+Char.prototype.is$HBS = function (charclass, c) {
+ return $__jsx_ObjectHasOwnProperty.call(charclass, c);
+};
+
+/**
+ * @param {RegExp} charclass
+ * @param {!string} c
+ * @return {!boolean}
+ */
+Char.prototype.not$LRegExp$S = function (charclass, c) {
+ return ! charclass.test(c);
+};
+
+/**
+ * @param {Object.<string, undefined|!boolean>} charclass
+ * @param {!string} c
+ * @return {!boolean}
+ */
+Char.prototype.not$HBS = function (charclass, c) {
+ return ! $__jsx_ObjectHasOwnProperty.call(charclass, c);
+};
+
+/**
+ * class _Entities extends Object
+ * @constructor
+ */
+function _Entities() {
+}
+
+/**
+ * @constructor
+ */
+function _Entities$() {
+};
+
+_Entities$.prototype = new _Entities;
+
+/**
+ * @return {Object.<string, undefined|!string>}
+ */
+_Entities.entity_list$ = function () {
+ /** @type {Object.<string, undefined|!string>} */
+ var result;
+ /** @type {!string} */
+ var key;
+ /** @type {*} */
+ var value;
+ result = ({ });
+ for (key in _Entities._entities) {
+ value = _Entities._entities[key];
+ if (typeof value === 'string') {
+ result[key] = value + "";
+ } else {
+ if (typeof value === 'number') {
+ result[key] = String.fromCharCode(value | 0);
+ }
+ }
+ }
+ return result;
+};
+
+var _Entities$entity_list$ = _Entities.entity_list$;
+
+/**
+ * class BitVector extends Object
+ * @constructor
+ */
+function BitVector() {
+}
+
+/**
+ * @constructor
+ */
+function BitVector$() {
+ /** @type {Array.<undefined|!number>} */
+ var _v$0;
+ /** @type {Array.<undefined|!number>} */
+ var _r$0;
+ _r$0 = this._r = [ ];
+ _v$0 = this._v = [ ];
+ _v$0.length = 0;
+ _r$0.length = 0;
+ this._size = 0;
+ this._size1 = 0;
+};
+
+BitVector$.prototype = new BitVector;
+
+/**
+ */
+BitVector.prototype.build$ = function () {
+ /** @type {!number} */
+ var i;
+ this._size1 = 0;
+ for (i = 0; i < this._v.length; i++) {
+ if (i % 8 === 0) {
+ this._r.push(true ? this._size1 : this._size - this._size1);
+ }
+ this._size1 += this._rank32$IIB(this._v[i], 32, true);
+ }
+};
+
+/**
+ */
+BitVector.prototype.clear$ = function () {
+ this._v.length = 0;
+ this._r.length = 0;
+ this._size = 0;
+ this._size1 = 0;
+};
+
+/**
+ * @return {!number}
+ */
+BitVector.prototype.size$ = function () {
+ return this._size;
+};
+
+/**
+ * @param {!boolean} b
+ * @return {!number}
+ */
+BitVector.prototype.size$B = function (b) {
+ return (b ? this._size1 : this._size - this._size1);
+};
+
+/**
+ * @param {!number} value
+ */
+BitVector.prototype.set$I = function (value) {
+ this.set$IB(value, true);
+};
+
+/**
+ * @param {!number} value
+ * @param {!boolean} flag
+ */
+BitVector.prototype.set$IB = function (value, flag) {
+ /** @type {!number} */
+ var q;
+ /** @type {!number} */
+ var r;
+ /** @type {!number} */
+ var m;
+ if (value >= this._size) {
+ this._size = (value + 1 | 0);
+ }
+ q = (value / 32 | 0);
+ r = (value % 32 | 0);
+ while (q >= this._v.length) {
+ this._v.push(0);
+ }
+ m = 0x1 << r;
+ if (flag) {
+ this._v[q] |= m;
+ } else {
+ this._v[q] &= ~ m;
+ }
+};
+
+/**
+ * @param {!number} value
+ * @return {!boolean}
+ */
+BitVector.prototype.get$I = function (value) {
+ /** @type {!number} */
+ var q;
+ /** @type {!number} */
+ var r;
+ /** @type {!number} */
+ var m;
+ if (value >= this._size) {
+ throw new Error("BitVector.get() : range error");
+ }
+ q = (value / 32 | 0);
+ r = (value % 32 | 0);
+ m = 0x1 << r;
+ return !! (this._v[q] & m);
+};
+
+/**
+ * @param {!number} i
+ * @return {!number}
+ */
+BitVector.prototype.rank$I = function (i) {
+ return this.rank$IB(i, true);
+};
+
+/**
+ * @param {!number} i
+ * @param {!boolean} b
+ * @return {!number}
+ */
+BitVector.prototype.rank$IB = function (i, b) {
+ /** @type {!number} */
+ var q_large;
+ /** @type {!number} */
+ var q_small;
+ /** @type {!number} */
+ var r;
+ /** @type {!number} */
+ var rank;
+ /** @type {!number} */
+ var begin;
+ /** @type {!number} */
+ var j;
+ if (i > this._size) {
+ throw new Error("BitVector.rank() : range error");
+ }
+ if (i === 0) {
+ return 0;
+ }
+ i--;
+ q_large = (Math.floor(i / 256) | 0);
+ q_small = (Math.floor(i / 32) | 0);
+ r = (Math.floor(i % 32) | 0);
+ rank = (this._r[q_large] | 0);
+ if (! b) {
+ rank = q_large * 256 - rank;
+ }
+ begin = q_large * 8;
+ for (j = begin; j < q_small; j++) {
+ rank += this._rank32$IIB(this._v[j], 32, b);
+ }
+ rank += this._rank32$IIB(this._v[q_small], r + 1, b);
+ return rank;
+};
+
+/**
+ * @param {!number} i
+ * @return {!number}
+ */
+BitVector.prototype.select$I = function (i) {
+ return this.select$IB(i, true);
+};
+
+/**
+ * @param {!number} i
+ * @param {!boolean} b
+ * @return {!number}
+ */
+BitVector.prototype.select$IB = function (i, b) {
+ /** @type {!number} */
+ var left;
+ /** @type {!number} */
+ var right;
+ /** @type {!number} */
+ var pivot;
+ /** @type {undefined|!number} */
+ var rank;
+ /** @type {!number} */
+ var j;
+ if (i >= (b ? this._size1 : this._size - this._size1)) {
+ throw new Error("BitVector.select() : range error");
+ }
+ left = 0;
+ right = this._r.length;
+ while (left < right) {
+ pivot = Math.floor((left + right) / 2);
+ rank = this._r[pivot];
+ if (! b) {
+ rank = pivot * 256 - rank;
+ }
+ if (i < rank) {
+ right = pivot;
+ } else {
+ left = pivot + 1;
+ }
+ }
+ right--;
+ if (b) {
+ i -= (this._r[right] | 0);
+ } else {
+ i -= (right * 256 - this._r[right] | 0);
+ }
+ j = right * 8;
+ while (1) {
+ rank = this._rank32$IIB(this._v[j], 32, b);
+ if (i < rank) {
+ break;
+ }
+ j++;
+ i -= (rank | 0);
+ }
+ return (j * 32 + this._select32$IIB(this._v[j], i, b) | 0);
+};
+
+/**
+ * @param {!number} x
+ * @param {!number} i
+ * @param {!boolean} b
+ * @return {!number}
+ */
+BitVector.prototype._rank32$IIB = function (x, i, b) {
+ if (! b) {
+ x = ~ x;
+ }
+ x <<= 32 - i;
+ x = ((x & 0xaaaaaaaa) >>> 1) + (x & 0x55555555);
+ x = ((x & 0xcccccccc) >>> 2) + (x & 0x33333333);
+ x = ((x & 0xf0f0f0f0) >>> 4) + (x & 0x0f0f0f0f);
+ x = ((x & 0xff00ff00) >>> 8) + (x & 0x00ff00ff);
+ x = ((x & 0xffff0000) >>> 16) + (x & 0x0000ffff);
+ return x;
+};
+
+/**
+ * @param {!number} x
+ * @param {!number} i
+ * @param {!boolean} b
+ * @return {!number}
+ */
+BitVector.prototype._select32$IIB = function (x, i, b) {
+ /** @type {!number} */
+ var x1;
+ /** @type {!number} */
+ var x2;
+ /** @type {!number} */
+ var x3;
+ /** @type {!number} */
+ var x4;
+ /** @type {!number} */
+ var x5;
+ /** @type {!number} */
+ var pos;
+ /** @type {!number} */
+ var v5;
+ /** @type {!number} */
+ var v4;
+ /** @type {!number} */
+ var v3;
+ /** @type {!number} */
+ var v2;
+ /** @type {!number} */
+ var v1;
+ /** @type {!number} */
+ var v0;
+ if (! b) {
+ x = ~ x;
+ }
+ x1 = ((x & 0xaaaaaaaa) >>> 1) + (x & 0x55555555);
+ x2 = ((x1 & 0xcccccccc) >>> 2) + (x1 & 0x33333333);
+ x3 = ((x2 & 0xf0f0f0f0) >>> 4) + (x2 & 0x0f0f0f0f);
+ x4 = ((x3 & 0xff00ff00) >>> 8) + (x3 & 0x00ff00ff);
+ x5 = ((x4 & 0xffff0000) >>> 16) + (x4 & 0x0000ffff);
+ i++;
+ pos = 0;
+ v5 = x5 & 0xffffffff;
+ if (i > v5) {
+ i -= (v5 | 0);
+ pos += 32;
+ }
+ v4 = x4 >>> pos & 0x0000ffff;
+ if (i > v4) {
+ i -= (v4 | 0);
+ pos += 16;
+ }
+ v3 = x3 >>> pos & 0x000000ff;
+ if (i > v3) {
+ i -= (v3 | 0);
+ pos += 8;
+ }
+ v2 = x2 >>> pos & 0x0000000f;
+ if (i > v2) {
+ i -= (v2 | 0);
+ pos += 4;
+ }
+ v1 = x1 >>> pos & 0x00000003;
+ if (i > v1) {
+ i -= (v1 | 0);
+ pos += 2;
+ }
+ v0 = x >>> pos & 0x00000001;
+ if (i > v0) {
+ i -= (v0 | 0);
+ pos += 1;
+ }
+ return (pos | 0);
+};
+
+/**
+ * @return {!string}
+ */
+BitVector.prototype.dump$ = function () {
+ /** @type {Array.<undefined|!string>} */
+ var contents;
+ contents = [ ];
+ contents.push(Binary$dump32bitNumber$N(this._size));
+ contents.push(Binary$dump32bitNumberList$AN(this._v));
+ return contents.join('');
+};
+
+/**
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+BitVector.prototype.dump$LCompressionReport$ = function (report) {
+ /** @type {Array.<undefined|!string>} */
+ var contents;
+ contents = [ ];
+ contents.push(Binary$dump32bitNumber$N(this._size));
+ CompressionReport$add$LCompressionReport$II(report, 2, 2);
+ contents.push(Binary$dump32bitNumberList$ANLCompressionReport$(this._v, report));
+ return contents.join('');
+};
+
+/**
+ * @param {!string} data
+ * @return {!number}
+ */
+BitVector.prototype.load$S = function (data) {
+ return this.load$SI(data, 0);
+};
+
+/**
+ * @param {!string} data
+ * @param {!number} offset
+ * @return {!number}
+ */
+BitVector.prototype.load$SI = function (data, offset) {
+ /** @type {LoadedNumberListResult} */
+ var result;
+ /** @type {!number} */
+ var result$0;
+ this._v.length = 0;
+ this._r.length = 0;
+ this._size = 0;
+ this._size1 = 0;
+ result$0 = data.charCodeAt(offset) * 65536 + data.charCodeAt(offset + 1);
+ this._size = (result$0 | 0);
+ result = Binary$load32bitNumberList$SI(data, offset + 2);
+ this._v = result.result;
+ this.build$();
+ return result.offset;
+};
+
+/**
+ * class WaveletMatrix extends Object
+ * @constructor
+ */
+function WaveletMatrix() {
+}
+
+/**
+ * @constructor
+ */
+function WaveletMatrix$() {
+ /** @type {Array.<undefined|BitVector>} */
+ var _bv$0;
+ /** @type {Array.<undefined|!number>} */
+ var _seps$0;
+ this._range = ({ });
+ _bv$0 = this._bv = [ ];
+ _seps$0 = this._seps = [ ];
+ this._bitsize = 16;
+ _bv$0.length = 0;
+ _seps$0.length = 0;
+ this._size = 0;
+};
+
+WaveletMatrix$.prototype = new WaveletMatrix;
+
+/**
+ * @return {!number}
+ */
+WaveletMatrix.prototype.bitsize$ = function () {
+ return this._bitsize;
+};
+
+/**
+ * @param {!number} charCode
+ */
+WaveletMatrix.prototype.setMaxCharCode$I = function (charCode) {
+ this._bitsize = (Math.ceil(Math.log(charCode) / 0.6931471805599453) | 0);
+};
+
+/**
+ */
+WaveletMatrix.prototype.clear$ = function () {
+ this._bv.length = 0;
+ this._seps.length = 0;
+ this._size = 0;
+};
+
+/**
+ * @param {!string} v
+ */
+WaveletMatrix.prototype.build$S = function (v) {
+ /** @type {!number} */
+ var size;
+ /** @type {!number} */
+ var bitsize;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var depth;
+ /** @type {Object.<string, undefined|!number>} */
+ var range_tmp;
+ /** @type {!number} */
+ var code;
+ /** @type {!boolean} */
+ var bit;
+ /** @type {!number} */
+ var key;
+ /** @type {Object.<string, undefined|!number>} */
+ var range_rev;
+ /** @type {!string} */
+ var range_key;
+ /** @type {!number} */
+ var value;
+ /** @type {!number} */
+ var pos0;
+ /** @type {undefined|!number} */
+ var pos1;
+ /** @type {!string} */
+ var range_rev_key;
+ /** @type {!number} */
+ var begin;
+ /** @type {undefined|!number} */
+ var end;
+ /** @type {!number} */
+ var num0;
+ /** @type {!number} */
+ var num1;
+ this._bv.length = 0;
+ this._seps.length = 0;
+ this._size = 0;
+ size = v.length;
+ bitsize = this._bitsize;
+ for (i = 0; i < bitsize; i++) {
+ this._bv.push(new BitVector$());
+ this._seps.push(0);
+ }
+ this._size = (size | 0);
+ for (i = 0; i < size; i++) {
+ this._bv[0].set$IB(i, this._uint2bit$II(v.charCodeAt(i), 0));
+ }
+ this._bv[0].build$();
+ this._seps[0] = this._bv[0].size$B(false);
+ this._range["0"] = 0;
+ this._range["1"] = this._seps[0];
+ depth = 1;
+ while (depth < bitsize) {
+ range_tmp = WaveletMatrix$_shallow_copy$HI(this._range);
+ for (i = 0; i < size; i++) {
+ code = v.charCodeAt(i);
+ bit = this._uint2bit$II(code, depth);
+ key = code >>> bitsize - depth;
+ this._bv[depth].set$IB(range_tmp[key + ""], bit);
+ range_tmp[key + ""]++;
+ }
+ this._bv[depth].build$();
+ this._seps[depth] = this._bv[depth].size$B(false);
+ range_rev = ({ });
+ for (range_key in this._range) {
+ value = this._range[range_key];
+ if (value != range_tmp[range_key]) {
+ range_rev[value + ""] = range_key | 0;
+ }
+ }
+ this._range = ({ });
+ pos0 = 0;
+ pos1 = this._seps[depth];
+ for (range_rev_key in range_rev) {
+ begin = range_rev_key | 0;
+ value = range_rev[range_rev_key];
+ end = range_tmp[value + ""];
+ num0 = this._bv[depth].rank$IB(end, false) - this._bv[depth].rank$IB(begin, false);
+ num1 = end - begin - num0;
+ if (num0 > 0) {
+ this._range[(value << 1) + ""] = (pos0 | 0);
+ pos0 += num0;
+ }
+ if (num1 > 0) {
+ this._range[(value << 1) + 1 + ""] = pos1;
+ pos1 += (num1 | 0);
+ }
+ }
+ depth++;
+ }
+};
+
+/**
+ * @return {!number}
+ */
+WaveletMatrix.prototype.size$ = function () {
+ return this._size;
+};
+
+/**
+ * @param {!number} c
+ * @return {!number}
+ */
+WaveletMatrix.prototype.size$I = function (c) {
+ return this.rank$II(this._size, c);
+};
+
+/**
+ * @param {!number} i
+ * @return {!number}
+ */
+WaveletMatrix.prototype.get$I = function (i) {
+ /** @type {!number} */
+ var value;
+ /** @type {!number} */
+ var depth;
+ /** @type {!boolean} */
+ var bit;
+ if (i >= this._size) {
+ throw new Error("WaveletMatrix.get() : range error");
+ }
+ value = 0;
+ depth = 0;
+ while (depth < this._bitsize) {
+ bit = this._bv[depth].get$I(i);
+ i = this._bv[depth].rank$IB(i, bit);
+ value <<= 1;
+ if (bit) {
+ i += this._seps[depth];
+ value += 1;
+ }
+ depth++;
+ }
+ return (value | 0);
+};
+
+/**
+ * @param {!number} i
+ * @param {!number} c
+ * @return {!number}
+ */
+WaveletMatrix.prototype.rank$II = function (i, c) {
+ /** @type {undefined|!number} */
+ var begin;
+ /** @type {!number} */
+ var end;
+ /** @type {!number} */
+ var depth;
+ /** @type {!boolean} */
+ var bit;
+ if (i > this._size) {
+ throw new Error("WaveletMatrix.rank(): range error");
+ }
+ if (i === 0) {
+ return 0;
+ }
+ begin = this._range[c + ""];
+ if (begin == null) {
+ return 0;
+ }
+ end = i;
+ depth = 0;
+ while (depth < this._bitsize) {
+ bit = this._uint2bit$II(c, depth);
+ end = this._bv[depth].rank$IB(end, bit);
+ if (bit) {
+ end += this._seps[depth];
+ }
+ depth++;
+ }
+ return (end - begin | 0);
+};
+
+/**
+ * @param {!number} i
+ * @param {!number} c
+ * @return {!number}
+ */
+WaveletMatrix.prototype.rank_less_than$II = function (i, c) {
+ /** @type {!number} */
+ var begin;
+ /** @type {!number} */
+ var end;
+ /** @type {!number} */
+ var depth;
+ /** @type {!number} */
+ var rlt;
+ /** @type {!number} */
+ var rank0_begin;
+ /** @type {!number} */
+ var rank0_end;
+ /** @type {Array.<undefined|!number>} */
+ var _seps$0;
+ if (i > this._size) {
+ throw new Error("WaveletMatrix.rank_less_than(): range error");
+ }
+ if (i === 0) {
+ return 0;
+ }
+ begin = 0;
+ end = i;
+ depth = 0;
+ rlt = 0;
+ while (depth < this._bitsize) {
+ rank0_begin = this._bv[depth].rank$IB(begin, false);
+ rank0_end = this._bv[depth].rank$IB(end, false);
+ if (this._uint2bit$II(c, depth)) {
+ rlt += rank0_end - rank0_begin;
+ begin += (_seps$0 = this._seps)[depth] - rank0_begin;
+ end += _seps$0[depth] - rank0_end;
+ } else {
+ begin = rank0_begin;
+ end = rank0_end;
+ }
+ depth++;
+ }
+ return (rlt | 0);
+};
+
+/**
+ * @return {!string}
+ */
+WaveletMatrix.prototype.dump$ = function () {
+ /** @type {Array.<undefined|!string>} */
+ var contents;
+ /** @type {!number} */
+ var i;
+ /** @type {Array.<undefined|!string>} */
+ var range_contents;
+ /** @type {!number} */
+ var counter;
+ /** @type {!string} */
+ var key;
+ contents = [ Binary$dump16bitNumber$I(this._bitsize), Binary$dump32bitNumber$N(this._size) ];
+ for (i = 0; i < this._bitsize; i++) {
+ contents.push(this._bv[i].dump$());
+ }
+ for (i = 0; i < this._bitsize; i++) {
+ contents.push(Binary$dump32bitNumber$N(this._seps[i]));
+ }
+ range_contents = [ ];
+ counter = 0;
+ for (key in this._range) {
+ range_contents.push(Binary$dump32bitNumber$N(key | 0));
+ range_contents.push(Binary$dump32bitNumber$N(this._range[key]));
+ counter++;
+ }
+ contents.push(Binary$dump32bitNumber$N(counter));
+ return contents.join('') + range_contents.join('');
+};
+
+/**
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+WaveletMatrix.prototype.dump$LCompressionReport$ = function (report) {
+ /** @type {Array.<undefined|!string>} */
+ var contents;
+ /** @type {!number} */
+ var i;
+ /** @type {Array.<undefined|!string>} */
+ var range_contents;
+ /** @type {!number} */
+ var counter;
+ /** @type {!string} */
+ var key;
+ contents = [ Binary$dump16bitNumber$I(this._bitsize), Binary$dump32bitNumber$N(this._size) ];
+ CompressionReport$add$LCompressionReport$II(report, 3, 3);
+ for (i = 0; i < this._bitsize; i++) {
+ contents.push(this._bv[i].dump$LCompressionReport$(report));
+ }
+ for (i = 0; i < this._bitsize; i++) {
+ contents.push(Binary$dump32bitNumber$N(this._seps[i]));
+ CompressionReport$add$LCompressionReport$II(report, 2, 2);
+ }
+ range_contents = [ ];
+ counter = 0;
+ for (key in this._range) {
+ range_contents.push(Binary$dump32bitNumber$N(key | 0));
+ range_contents.push(Binary$dump32bitNumber$N(this._range[key]));
+ CompressionReport$add$LCompressionReport$II(report, 4, 4);
+ counter++;
+ }
+ CompressionReport$add$LCompressionReport$II(report, 2, 2);
+ contents.push(Binary$dump32bitNumber$N(counter));
+ return contents.join('') + range_contents.join('');
+};
+
+/**
+ * @param {!string} data
+ * @return {!number}
+ */
+WaveletMatrix.prototype.load$S = function (data) {
+ return this.load$SI(data, 0);
+};
+
+/**
+ * @param {!string} data
+ * @param {!number} offset
+ * @return {!number}
+ */
+WaveletMatrix.prototype.load$SI = function (data, offset) {
+ /** @type {!number} */
+ var i;
+ /** @type {BitVector} */
+ var bit_vector;
+ /** @type {!number} */
+ var range_size;
+ /** @type {!number} */
+ var value;
+ /** @type {!number} */
+ var offset$0;
+ /** @type {!number} */
+ var result$0;
+ /** @type {!number} */
+ var result$1;
+ /** @type {!number} */
+ var result$2;
+ this._bv.length = 0;
+ this._seps.length = 0;
+ this._size = 0;
+ offset$0 = offset++;
+ this._bitsize = (data.charCodeAt(offset$0) | 0);
+ result$0 = data.charCodeAt(offset) * 65536 + data.charCodeAt(offset + 1);
+ this._size = (result$0 | 0);
+ offset += 2;
+ for (i = 0; i < this._bitsize; i++) {
+ bit_vector = new BitVector$();
+ offset = bit_vector.load$SI(data, offset);
+ this._bv.push(bit_vector);
+ }
+ for (i = 0; i < this._bitsize; (i++, offset += 2)) {
+ this._seps.push(Binary$load32bitNumber$SI(data, offset));
+ }
+ result$1 = data.charCodeAt(offset) * 65536 + data.charCodeAt(offset + 1);
+ range_size = result$1;
+ offset += 2;
+ for (i = 0; i < range_size; (i++, offset += 4)) {
+ result$2 = data.charCodeAt(offset) * 65536 + data.charCodeAt(offset + 1);
+ value = Binary$load32bitNumber$SI(data, offset + 2);
+ this._range[result$2 + ""] = (value | 0);
+ }
+ return offset;
+};
+
+/**
+ * @param {Object.<string, undefined|!number>} input
+ * @return {Object.<string, undefined|!number>}
+ */
+WaveletMatrix._shallow_copy$HI = function (input) {
+ /** @type {Object.<string, undefined|!number>} */
+ var result;
+ /** @type {!string} */
+ var key;
+ result = ({ });
+ for (key in input) {
+ result[key] = input[key];
+ }
+ return result;
+};
+
+var WaveletMatrix$_shallow_copy$HI = WaveletMatrix._shallow_copy$HI;
+
+/**
+ * @param {!number} c
+ * @param {!number} i
+ * @return {!boolean}
+ */
+WaveletMatrix.prototype._uint2bit$II = function (c, i) {
+ return (c >>> this._bitsize - 1 - i & 0x1) === 0x1;
+};
+
+/**
+ * class BurrowsWheelerTransform extends Object
+ * @constructor
+ */
+function BurrowsWheelerTransform() {
+}
+
+/**
+ * @constructor
+ */
+function BurrowsWheelerTransform$() {
+ this._str = "";
+ this._size = 0;
+ this._head = 0;
+ this._suffixarray = [ ];
+};
+
+BurrowsWheelerTransform$.prototype = new BurrowsWheelerTransform;
+
+/**
+ * @param {BurrowsWheelerTransform} $this
+ * @return {!number}
+ */
+BurrowsWheelerTransform.size$LBurrowsWheelerTransform$ = function ($this) {
+ return $this._size;
+};
+
+var BurrowsWheelerTransform$size$LBurrowsWheelerTransform$ = BurrowsWheelerTransform.size$LBurrowsWheelerTransform$;
+
+/**
+ * @param {BurrowsWheelerTransform} $this
+ * @return {!number}
+ */
+BurrowsWheelerTransform.head$LBurrowsWheelerTransform$ = function ($this) {
+ return $this._head;
+};
+
+var BurrowsWheelerTransform$head$LBurrowsWheelerTransform$ = BurrowsWheelerTransform.head$LBurrowsWheelerTransform$;
+
+/**
+ * @param {BurrowsWheelerTransform} $this
+ */
+BurrowsWheelerTransform.clear$LBurrowsWheelerTransform$ = function ($this) {
+ $this._str = "";
+ $this._size = 0;
+ $this._head = 0;
+ $this._suffixarray.length = 0;
+};
+
+var BurrowsWheelerTransform$clear$LBurrowsWheelerTransform$ = BurrowsWheelerTransform.clear$LBurrowsWheelerTransform$;
+
+/**
+ * @param {BurrowsWheelerTransform} $this
+ * @param {!string} str
+ */
+BurrowsWheelerTransform.build$LBurrowsWheelerTransform$S = function ($this, str) {
+ /** @type {!string} */
+ var _str$0;
+ /** @type {Array.<undefined|!number>} */
+ var _suffixarray$0;
+ _str$0 = $this._str = str;
+ $this._size = _str$0.length;
+ _suffixarray$0 = $this._suffixarray = SAIS$make$S(str);
+ $this._head = (_suffixarray$0.indexOf(0) | 0);
+};
+
+var BurrowsWheelerTransform$build$LBurrowsWheelerTransform$S = BurrowsWheelerTransform.build$LBurrowsWheelerTransform$S;
+
+/**
+ * @param {BurrowsWheelerTransform} $this
+ * @param {!number} i
+ * @return {!string}
+ */
+BurrowsWheelerTransform.get$LBurrowsWheelerTransform$I = function ($this, i) {
+ /** @type {!number} */
+ var size;
+ /** @type {!number} */
+ var index;
+ size = $this._size;
+ if (i >= size) {
+ throw new Error("BurrowsWheelerTransform.get() : range error");
+ }
+ index = ($this._suffixarray[i] + size - 1) % size;
+ return $this._str.charAt(index);
+};
+
+var BurrowsWheelerTransform$get$LBurrowsWheelerTransform$I = BurrowsWheelerTransform.get$LBurrowsWheelerTransform$I;
+
+/**
+ * @param {BurrowsWheelerTransform} $this
+ * @return {!string}
+ */
+BurrowsWheelerTransform.get$LBurrowsWheelerTransform$ = function ($this) {
+ /** @type {Array.<undefined|!string>} */
+ var str;
+ /** @type {!number} */
+ var size;
+ /** @type {!number} */
+ var i;
+ str = [ ];
+ size = $this._size;
+ for (i = 0; i < size; i++) {
+ str.push(BurrowsWheelerTransform$get$LBurrowsWheelerTransform$I($this, i));
+ }
+ return str.join("");
+};
+
+var BurrowsWheelerTransform$get$LBurrowsWheelerTransform$ = BurrowsWheelerTransform.get$LBurrowsWheelerTransform$;
+
+/**
+ * @param {BurrowsWheelerTransform} $this
+ * @param {!string} replace
+ * @return {!string}
+ */
+BurrowsWheelerTransform.get$LBurrowsWheelerTransform$S = function ($this, replace) {
+ /** @type {!string} */
+ var result;
+ result = BurrowsWheelerTransform$get$LBurrowsWheelerTransform$($this);
+ return result.replace(BurrowsWheelerTransform.END_MARKER, replace);
+};
+
+var BurrowsWheelerTransform$get$LBurrowsWheelerTransform$S = BurrowsWheelerTransform.get$LBurrowsWheelerTransform$S;
+
+/**
+ * class OArray extends Object
+ * @constructor
+ */
+function OArray() {
+}
+
+/**
+ * @constructor
+ * @param {Array.<undefined|!number>} array
+ */
+function OArray$AI(array) {
+ this.array = array;
+ this.offset = 0;
+};
+
+OArray$AI.prototype = new OArray;
+
+/**
+ * @constructor
+ * @param {Array.<undefined|!number>} array
+ * @param {!number} offset
+ */
+function OArray$AII(array, offset) {
+ this.array = array;
+ this.offset = offset;
+};
+
+OArray$AII.prototype = new OArray;
+
+/**
+ * @param {OArray} $this
+ * @param {!number} index
+ * @return {!number}
+ */
+OArray.get$LOArray$I = function ($this, index) {
+ return $this.array[index + $this.offset];
+};
+
+var OArray$get$LOArray$I = OArray.get$LOArray$I;
+
+/**
+ * @param {OArray} $this
+ * @param {!number} index
+ * @param {!number} value
+ */
+OArray.set$LOArray$II = function ($this, index, value) {
+ $this.array[index + $this.offset] = value;
+};
+
+var OArray$set$LOArray$II = OArray.set$LOArray$II;
+
+/**
+ * @param {OArray} $this
+ * @param {!number} index
+ * @return {!boolean}
+ */
+OArray.isS$LOArray$I = function ($this, index) {
+ /** @type {Array.<undefined|!number>} */
+ var array$0;
+ /** @type {!number} */
+ var offset$0;
+ return (array$0 = $this.array)[index + (offset$0 = $this.offset)] < array$0[index + offset$0 + 1];
+};
+
+var OArray$isS$LOArray$I = OArray.isS$LOArray$I;
+
+/**
+ * @param {OArray} $this
+ * @param {!number} index1
+ * @param {!number} index2
+ * @return {!boolean}
+ */
+OArray.compare$LOArray$II = function ($this, index1, index2) {
+ /** @type {Array.<undefined|!number>} */
+ var array$0;
+ /** @type {!number} */
+ var offset$0;
+ return (array$0 = $this.array)[index1 + (offset$0 = $this.offset)] == array$0[index2 + offset$0];
+};
+
+var OArray$compare$LOArray$II = OArray.compare$LOArray$II;
+
+/**
+ * class SAIS extends Object
+ * @constructor
+ */
+function SAIS() {
+}
+
+/**
+ * @constructor
+ */
+function SAIS$() {
+};
+
+SAIS$.prototype = new SAIS;
+
+/**
+ * @param {BitVector} t
+ * @param {!number} i
+ * @return {!boolean}
+ */
+SAIS._isLMS$LBitVector$I = function (t, i) {
+ return i > 0 && t.get$I(i) && ! t.get$I(i - 1);
+};
+
+var SAIS$_isLMS$LBitVector$I = SAIS._isLMS$LBitVector$I;
+
+/**
+ * @param {OArray} s
+ * @param {Array.<undefined|!number>} bkt
+ * @param {!number} n
+ * @param {!number} K
+ * @param {!boolean} end
+ */
+SAIS._getBuckets$LOArray$AIIIB = function (s, bkt, n, K, end) {
+ /** @type {!number} */
+ var sum;
+ /** @type {!number} */
+ var i;
+ sum = 0;
+ for (i = 0; i <= K; i++) {
+ bkt[i] = 0;
+ }
+ for (i = 0; i < n; i++) {
+ bkt[OArray$get$LOArray$I(s, i)]++;
+ }
+ for (i = 0; i <= K; i++) {
+ sum += bkt[i];
+ bkt[i] = ((end ? sum : sum - bkt[i]) | 0);
+ }
+};
+
+var SAIS$_getBuckets$LOArray$AIIIB = SAIS._getBuckets$LOArray$AIIIB;
+
+/**
+ * @param {BitVector} t
+ * @param {Array.<undefined|!number>} SA
+ * @param {OArray} s
+ * @param {Array.<undefined|!number>} bkt
+ * @param {!number} n
+ * @param {!number} K
+ * @param {!boolean} end
+ */
+SAIS._induceSAl$LBitVector$AILOArray$AIIIB = function (t, SA, s, bkt, n, K, end) {
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var j;
+ SAIS$_getBuckets$LOArray$AIIIB(s, bkt, n, K, end);
+ for (i = 0; i < n; i++) {
+ j = SA[i] - 1;
+ if (j >= 0 && ! t.get$I(j)) {
+ SA[bkt[OArray$get$LOArray$I(s, j)]++] = (j | 0);
+ }
+ }
+};
+
+var SAIS$_induceSAl$LBitVector$AILOArray$AIIIB = SAIS._induceSAl$LBitVector$AILOArray$AIIIB;
+
+/**
+ * @param {BitVector} t
+ * @param {Array.<undefined|!number>} SA
+ * @param {OArray} s
+ * @param {Array.<undefined|!number>} bkt
+ * @param {!number} n
+ * @param {!number} K
+ * @param {!boolean} end
+ */
+SAIS._induceSAs$LBitVector$AILOArray$AIIIB = function (t, SA, s, bkt, n, K, end) {
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var j;
+ SAIS$_getBuckets$LOArray$AIIIB(s, bkt, n, K, end);
+ for (i = n - 1; i >= 0; i--) {
+ j = SA[i] - 1;
+ if (j >= 0 && t.get$I(j)) {
+ SA[-- bkt[OArray$get$LOArray$I(s, j)]] = (j | 0);
+ }
+ }
+};
+
+var SAIS$_induceSAs$LBitVector$AILOArray$AIIIB = SAIS._induceSAs$LBitVector$AILOArray$AIIIB;
+
+/**
+ * @param {!string} source
+ * @return {Array.<undefined|!number>}
+ */
+SAIS.make$S = function (source) {
+ /** @type {Array.<undefined|!number>} */
+ var charCodes;
+ /** @type {!number} */
+ var maxCode;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var code;
+ /** @type {Array.<undefined|!number>} */
+ var SA;
+ /** @type {OArray} */
+ var s;
+ charCodes = [ ];
+ charCodes.length = source.length;
+ maxCode = 0;
+ for (i = 0; i < source.length; i++) {
+ code = source.charCodeAt(i);
+ charCodes[i] = (code | 0);
+ maxCode = (code > maxCode ? code : maxCode);
+ }
+ SA = [ ];
+ SA.length = source.length;
+ s = ({offset: 0, array: charCodes});
+ SAIS$_make$LOArray$AIII(s, SA, source.length, maxCode);
+ return SA;
+};
+
+var SAIS$make$S = SAIS.make$S;
+
+/**
+ * @param {OArray} s
+ * @param {Array.<undefined|!number>} SA
+ * @param {!number} n
+ * @param {!number} K
+ */
+SAIS._make$LOArray$AIII = function (s, SA, n, K) {
+ /** @type {BitVector} */
+ var t;
+ /** @type {!number} */
+ var i;
+ /** @type {Array.<undefined|!number>} */
+ var bkt;
+ /** @type {!number} */
+ var n1;
+ /** @type {!number} */
+ var name;
+ /** @type {!number} */
+ var prev;
+ /** @type {undefined|!number} */
+ var pos;
+ /** @type {!boolean} */
+ var diff;
+ /** @type {!number} */
+ var d;
+ /** @type {!number} */
+ var j;
+ /** @type {Array.<undefined|!number>} */
+ var SA1;
+ /** @type {OArray} */
+ var s1;
+ /** @type {!number} */
+ var i$0;
+ /** @type {!number} */
+ var index$0;
+ t = new BitVector$();
+ t.set$IB(n - 2, false);
+ t.set$IB(n - 1, true);
+ for (i = n - 3; i >= 0; i--) {
+ t.set$IB(i, OArray$isS$LOArray$I(s, i) || OArray$compare$LOArray$II(s, i, i + 1) && t.get$I(i + 1));
+ }
+ bkt = [ ];
+ bkt.length = K + 1;
+ SAIS$_getBuckets$LOArray$AIIIB(s, bkt, n, K, true);
+ for (i = 0; i < n; i++) {
+ SA[i] = -1;
+ }
+ for (i = 1; i < n; i++) {
+ if (SAIS$_isLMS$LBitVector$I(t, i)) {
+ SA[-- bkt[OArray$get$LOArray$I(s, i)]] = (i | 0);
+ }
+ }
+ SAIS$_induceSAl$LBitVector$AILOArray$AIIIB(t, SA, s, bkt, n, K, false);
+ SAIS$_induceSAs$LBitVector$AILOArray$AIIIB(t, SA, s, bkt, n, K, true);
+ n1 = 0;
+ for (i = 0; i < n; i++) {
+ i$0 = SA[i];
+ if (i$0 > 0 && t.get$I(i$0) && ! t.get$I(i$0 - 1)) {
+ SA[n1++] = SA[i];
+ }
+ }
+ for (i = n1; i < n; i++) {
+ SA[i] = -1;
+ }
+ name = 0;
+ prev = -1;
+ for (i = 0; i < n1; i++) {
+ pos = SA[i];
+ diff = false;
+ for (d = 0; d < n; d++) {
+ if (prev === -1 || ! OArray$compare$LOArray$II(s, pos + d, prev + d) || t.get$I(pos + d) !== t.get$I(prev + d)) {
+ diff = true;
+ break;
+ } else {
+ if (d > 0 && (SAIS$_isLMS$LBitVector$I(t, pos + d) || SAIS$_isLMS$LBitVector$I(t, prev + d))) {
+ break;
+ }
+ }
+ }
+ if (diff) {
+ name++;
+ prev = pos;
+ }
+ pos = ((pos % 2 === 0 ? pos / 2 : (pos - 1) / 2) | 0);
+ SA[n1 + pos] = (name - 1 | 0);
+ }
+ for ((i = n - 1, j = n - 1); i >= n1; i--) {
+ if (SA[i] >= 0) {
+ SA[j--] = SA[i];
+ }
+ }
+ SA1 = SA;
+ s1 = ({offset: n - n1, array: SA});
+ if (name < n1) {
+ SAIS$_make$LOArray$AIII(s1, SA1, n1, name - 1);
+ } else {
+ for (i = 0; i < n1; i++) {
+ SA1[OArray$get$LOArray$I(s1, i)] = (i | 0);
+ }
+ }
+ bkt = [ ];
+ bkt.length = K + 1;
+ SAIS$_getBuckets$LOArray$AIIIB(s, bkt, n, K, true);
+ for ((i = 1, j = 0); i < n; i++) {
+ if (SAIS$_isLMS$LBitVector$I(t, i)) {
+ OArray$set$LOArray$II(s1, j++, i);
+ }
+ }
+ for (i = 0; i < n1; i++) {
+ index$0 = SA1[i];
+ SA1[i] = s1.array[index$0 + s1.offset];
+ }
+ for (i = n1; i < n; i++) {
+ SA[i] = -1;
+ }
+ for (i = n1 - 1; i >= 0; i--) {
+ j = SA[i];
+ SA[i] = -1;
+ SA[-- bkt[OArray$get$LOArray$I(s, j)]] = (j | 0);
+ }
+ SAIS$_induceSAl$LBitVector$AILOArray$AIIIB(t, SA, s, bkt, n, K, false);
+ SAIS$_induceSAs$LBitVector$AILOArray$AIIIB(t, SA, s, bkt, n, K, true);
+};
+
+var SAIS$_make$LOArray$AIII = SAIS._make$LOArray$AIII;
+
+OktaviaSearch._stemmer = null;
+OktaviaSearch._instance = null;
+$__jsx_lazy_init(Oktavia, "eof", function () {
+ return String.fromCharCode(0);
+});
+$__jsx_lazy_init(Oktavia, "eob", function () {
+ return String.fromCharCode(1);
+});
+$__jsx_lazy_init(Oktavia, "unknown", function () {
+ return String.fromCharCode(3);
+});
+Binary._base64EncodeChars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
+$__jsx_lazy_init(Binary, "_base64DecodeChars", function () {
+ return [ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 62, -1, -1, -1, 63, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, -1, -1, -1, -1, -1, -1, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -1, -1, -1, -1, -1, -1, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, -1, -1, -1, -1 ];
+});
+$__jsx_lazy_init(Style, "console", function () {
+ return ({ 'title': [ '\x1B[32m\x1b[4m', '\x1B[39m\x1b[0m' ], 'url': [ '\x1B[34m', '\x1B[39m' ], 'hit': [ '\x1B[4m', '\x1B[0m' ], 'del': [ '\x1B[9m', '\x1B[0m' ], 'summary': [ '\x1B[90m', '\x1B[39m' ] });
+});
+$__jsx_lazy_init(Style, "html", function () {
+ return ({ 'title': [ '<span class="title">', '</span>' ], 'url': [ '<span class="url">', '</span>' ], 'hit': [ '<span class="hit">', '</span>' ], 'del': [ '<del>', '</del>' ], 'summary': [ '<span class="reuslt">', '</span>' ] });
+});
+$__jsx_lazy_init(Style, "ignore", function () {
+ return ({ 'tilte': [ '', '' ], 'url': [ '', '' ], 'hit': [ '', '' ], 'del': [ '', '' ], 'summary': [ '', '' ] });
+});
+ItalianStemmer.serialVersionUID = 1;
+$__jsx_lazy_init(ItalianStemmer, "methodObject", function () {
+ return new ItalianStemmer$();
+});
+$__jsx_lazy_init(ItalianStemmer, "a_0", function () {
+ return [ new Among$SII("", -1, 7), new Among$SII("qu", 0, 6), new Among$SII("\u00E1", 0, 1), new Among$SII("\u00E9", 0, 2), new Among$SII("\u00ED", 0, 3), new Among$SII("\u00F3", 0, 4), new Among$SII("\u00FA", 0, 5) ];
+});
+$__jsx_lazy_init(ItalianStemmer, "a_1", function () {
+ return [ new Among$SII("", -1, 3), new Among$SII("I", 0, 1), new Among$SII("U", 0, 2) ];
+});
+$__jsx_lazy_init(ItalianStemmer, "a_2", function () {
+ return [ new Among$SII("la", -1, -1), new Among$SII("cela", 0, -1), new Among$SII("gliela", 0, -1), new Among$SII("mela", 0, -1), new Among$SII("tela", 0, -1), new Among$SII("vela", 0, -1), new Among$SII("le", -1, -1), new Among$SII("cele", 6, -1), new Among$SII("gliele", 6, -1), new Among$SII("mele", 6, -1), new Among$SII("tele", 6, -1), new Among$SII("vele", 6, -1), new Among$SII("ne", -1, -1), new Among$SII("cene", 12, -1), new Among$SII("gliene", 12, -1), new Among$SII("mene", 12, -1), new Among$SII("sene", 12, -1), new Among$SII("tene", 12, -1), new Among$SII("vene", 12, -1), new Among$SII("ci", -1, -1), new Among$SII("li", -1, -1), new Among$SII("celi", 20, -1), new Among$SII("glieli", 20, -1), new Among$SII("meli", 20, -1), new Among$SII("teli", 20, -1), new Among$SII("veli", 20, -1), new Among$SII("gli", 20, -1), new Among$SII("mi", -1, -1), new Among$SII("si", -1, -1), new Among$SII("ti", -1, -1), new Among$SII("vi", -1, -1), new Among$SII("lo", -1, -1), new Among$SII("celo", 31, -1), new Among$SII("glielo", 31, -1), new Among$SII("melo", 31, -1), new Among$SII("telo", 31, -1), new Among$SII("velo", 31, -1) ];
+});
+$__jsx_lazy_init(ItalianStemmer, "a_3", function () {
+ return [ new Among$SII("ando", -1, 1), new Among$SII("endo", -1, 1), new Among$SII("ar", -1, 2), new Among$SII("er", -1, 2), new Among$SII("ir", -1, 2) ];
+});
+$__jsx_lazy_init(ItalianStemmer, "a_4", function () {
+ return [ new Among$SII("ic", -1, -1), new Among$SII("abil", -1, -1), new Among$SII("os", -1, -1), new Among$SII("iv", -1, 1) ];
+});
+$__jsx_lazy_init(ItalianStemmer, "a_5", function () {
+ return [ new Among$SII("ic", -1, 1), new Among$SII("abil", -1, 1), new Among$SII("iv", -1, 1) ];
+});
+$__jsx_lazy_init(ItalianStemmer, "a_6", function () {
+ return [ new Among$SII("ica", -1, 1), new Among$SII("logia", -1, 3), new Among$SII("osa", -1, 1), new Among$SII("ista", -1, 1), new Among$SII("iva", -1, 9), new Among$SII("anza", -1, 1), new Among$SII("enza", -1, 5), new Among$SII("ice", -1, 1), new Among$SII("atrice", 7, 1), new Among$SII("iche", -1, 1), new Among$SII("logie", -1, 3), new Among$SII("abile", -1, 1), new Among$SII("ibile", -1, 1), new Among$SII("usione", -1, 4), new Among$SII("azione", -1, 2), new Among$SII("uzione", -1, 4), new Among$SII("atore", -1, 2), new Among$SII("ose", -1, 1), new Among$SII("ante", -1, 1), new Among$SII("mente", -1, 1), new Among$SII("amente", 19, 7), new Among$SII("iste", -1, 1), new Among$SII("ive", -1, 9), new Among$SII("anze", -1, 1), new Among$SII("enze", -1, 5), new Among$SII("ici", -1, 1), new Among$SII("atrici", 25, 1), new Among$SII("ichi", -1, 1), new Among$SII("abili", -1, 1), new Among$SII("ibili", -1, 1), new Among$SII("ismi", -1, 1), new Among$SII("usioni", -1, 4), new Among$SII("azioni", -1, 2), new Among$SII("uzioni", -1, 4), new Among$SII("atori", -1, 2), new Among$SII("osi", -1, 1), new Among$SII("anti", -1, 1), new Among$SII("amenti", -1, 6), new Among$SII("imenti", -1, 6), new Among$SII("isti", -1, 1), new Among$SII("ivi", -1, 9), new Among$SII("ico", -1, 1), new Among$SII("ismo", -1, 1), new Among$SII("oso", -1, 1), new Among$SII("amento", -1, 6), new Among$SII("imento", -1, 6), new Among$SII("ivo", -1, 9), new Among$SII("it\u00E0", -1, 8), new Among$SII("ist\u00E0", -1, 1), new Among$SII("ist\u00E8", -1, 1), new Among$SII("ist\u00EC", -1, 1) ];
+});
+$__jsx_lazy_init(ItalianStemmer, "a_7", function () {
+ return [ new Among$SII("isca", -1, 1), new Among$SII("enda", -1, 1), new Among$SII("ata", -1, 1), new Among$SII("ita", -1, 1), new Among$SII("uta", -1, 1), new Among$SII("ava", -1, 1), new Among$SII("eva", -1, 1), new Among$SII("iva", -1, 1), new Among$SII("erebbe", -1, 1), new Among$SII("irebbe", -1, 1), new Among$SII("isce", -1, 1), new Among$SII("ende", -1, 1), new Among$SII("are", -1, 1), new Among$SII("ere", -1, 1), new Among$SII("ire", -1, 1), new Among$SII("asse", -1, 1), new Among$SII("ate", -1, 1), new Among$SII("avate", 16, 1), new Among$SII("evate", 16, 1), new Among$SII("ivate", 16, 1), new Among$SII("ete", -1, 1), new Among$SII("erete", 20, 1), new Among$SII("irete", 20, 1), new Among$SII("ite", -1, 1), new Among$SII("ereste", -1, 1), new Among$SII("ireste", -1, 1), new Among$SII("ute", -1, 1), new Among$SII("erai", -1, 1), new Among$SII("irai", -1, 1), new Among$SII("isci", -1, 1), new Among$SII("endi", -1, 1), new Among$SII("erei", -1, 1), new Among$SII("irei", -1, 1), new Among$SII("assi", -1, 1), new Among$SII("ati", -1, 1), new Among$SII("iti", -1, 1), new Among$SII("eresti", -1, 1), new Among$SII("iresti", -1, 1), new Among$SII("uti", -1, 1), new Among$SII("avi", -1, 1), new Among$SII("evi", -1, 1), new Among$SII("ivi", -1, 1), new Among$SII("isco", -1, 1), new Among$SII("ando", -1, 1), new Among$SII("endo", -1, 1), new Among$SII("Yamo", -1, 1), new Among$SII("iamo", -1, 1), new Among$SII("avamo", -1, 1), new Among$SII("evamo", -1, 1), new Among$SII("ivamo", -1, 1), new Among$SII("eremo", -1, 1), new Among$SII("iremo", -1, 1), new Among$SII("assimo", -1, 1), new Among$SII("ammo", -1, 1), new Among$SII("emmo", -1, 1), new Among$SII("eremmo", 54, 1), new Among$SII("iremmo", 54, 1), new Among$SII("immo", -1, 1), new Among$SII("ano", -1, 1), new Among$SII("iscano", 58, 1), new Among$SII("avano", 58, 1), new Among$SII("evano", 58, 1), new Among$SII("ivano", 58, 1), new Among$SII("eranno", -1, 1), new Among$SII("iranno", -1, 1), new Among$SII("ono", -1, 1), new Among$SII("iscono", 65, 1), new Among$SII("arono", 65, 1), new Among$SII("erono", 65, 1), new Among$SII("irono", 65, 1), new Among$SII("erebbero", -1, 1), new Among$SII("irebbero", -1, 1), new Among$SII("assero", -1, 1), new Among$SII("essero", -1, 1), new Among$SII("issero", -1, 1), new Among$SII("ato", -1, 1), new Among$SII("ito", -1, 1), new Among$SII("uto", -1, 1), new Among$SII("avo", -1, 1), new Among$SII("evo", -1, 1), new Among$SII("ivo", -1, 1), new Among$SII("ar", -1, 1), new Among$SII("ir", -1, 1), new Among$SII("er\u00E0", -1, 1), new Among$SII("ir\u00E0", -1, 1), new Among$SII("er\u00F2", -1, 1), new Among$SII("ir\u00F2", -1, 1) ];
+});
+$__jsx_lazy_init(ItalianStemmer, "g_v", function () {
+ return [ 17, 65, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128, 128, 8, 2, 1 ];
+});
+$__jsx_lazy_init(ItalianStemmer, "g_AEIO", function () {
+ return [ 17, 65, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128, 128, 8, 2 ];
+});
+$__jsx_lazy_init(ItalianStemmer, "g_CG", function () {
+ return [ 17 ];
+});
+$__jsx_lazy_init(_Common, "buffers", function () {
+ return [ "comment", "sgmlDecl", "textNode", "tagName", "doctype", "procInstName", "procInstBody", "entity", "attribName", "attribValue", "cdata", "script" ];
+});
+$__jsx_lazy_init(_Common, "EVENTS", function () {
+ return [ "text", "processinginstruction", "sgmldeclaration", "doctype", "comment", "attribute", "opentag", "closetag", "opencdata", "cdata", "clo_State.CDATA", "error", "end", "ready", "script", "opennamespace", "closenamespace" ];
+});
+_Common.MAX_BUFFER_LENGTH = 65536;
+_State.BEGIN = 1;
+_State.TEXT = 2;
+_State.TEXT_ENTITY = 3;
+_State.OPEN_WAKA = 4;
+_State.SGML_DECL = 5;
+_State.SGML_DECL_QUOTED = 6;
+_State.DOCTYPE = 7;
+_State.DOCTYPE_QUOTED = 8;
+_State.DOCTYPE_DTD = 9;
+_State.DOCTYPE_DTD_QUOTED = 10;
+_State.COMMENT_STARTING = 11;
+_State.COMMENT = 12;
+_State.COMMENT_ENDING = 13;
+_State.COMMENT_ENDED = 14;
+_State.CDATA = 15;
+_State.CDATA_ENDING = 16;
+_State.CDATA_ENDING_2 = 17;
+_State.PROC_INST = 18;
+_State.PROC_INST_BODY = 19;
+_State.PROC_INST_ENDING = 20;
+_State.OPEN_TAG = 21;
+_State.OPEN_TAG_SLASH = 22;
+_State.ATTRIB = 23;
+_State.ATTRIB_NAME = 24;
+_State.ATTRIB_NAME_SAW_WHITE = 25;
+_State.ATTRIB_VALUE = 26;
+_State.ATTRIB_VALUE_QUOTED = 27;
+_State.ATTRIB_VALUE_UNQUOTED = 28;
+_State.ATTRIB_VALUE_ENTITY_Q = 29;
+_State.ATTRIB_VALUE_ENTITY_U = 30;
+_State.CLOSE_TAG = 31;
+_State.CLOSE_TAG_SAW_WHITE = 32;
+_State.SCRIPT = 33;
+_State.SCRIPT_ENDING = 34;
+$__jsx_lazy_init(_Entities, "_entities", function () {
+ return ({ "amp": "&", "gt": ">", "lt": "<", "quot": "\"", "apos": "'", "AElig": 198, "Aacute": 193, "Acirc": 194, "Agrave": 192, "Aring": 197, "Atilde": 195, "Auml": 196, "Ccedil": 199, "ETH": 208, "Eacute": 201, "Ecirc": 202, "Egrave": 200, "Euml": 203, "Iacute": 205, "Icirc": 206, "Igrave": 204, "Iuml": 207, "Ntilde": 209, "Oacute": 211, "Ocirc": 212, "Ograve": 210, "Oslash": 216, "Otilde": 213, "Ouml": 214, "THORN": 222, "Uacute": 218, "Ucirc": 219, "Ugrave": 217, "Uuml": 220, "Yacute": 221, "aacute": 225, "acirc": 226, "aelig": 230, "agrave": 224, "aring": 229, "atilde": 227, "auml": 228, "ccedil": 231, "eacute": 233, "ecirc": 234, "egrave": 232, "eth": 240, "euml": 235, "iacute": 237, "icirc": 238, "igrave": 236, "iuml": 239, "ntilde": 241, "oacute": 243, "ocirc": 244, "ograve": 242, "oslash": 248, "otilde": 245, "ouml": 246, "szlig": 223, "thorn": 254, "uacute": 250, "ucirc": 251, "ugrave": 249, "uuml": 252, "yacute": 253, "yuml": 255, "copy": 169, "reg": 174, "nbsp": 160, "iexcl": 161, "cent": 162, "pound": 163, "curren": 164, "yen": 165, "brvbar": 166, "sect": 167, "uml": 168, "ordf": 170, "laquo": 171, "not": 172, "shy": 173, "macr": 175, "deg": 176, "plusmn": 177, "sup1": 185, "sup2": 178, "sup3": 179, "acute": 180, "micro": 181, "para": 182, "middot": 183, "cedil": 184, "ordm": 186, "raquo": 187, "frac14": 188, "frac12": 189, "frac34": 190, "iquest": 191, "times": 215, "divide": 247, "OElig": 338, "oelig": 339, "Scaron": 352, "scaron": 353, "Yuml": 376, "fnof": 402, "circ": 710, "tilde": 732, "Alpha": 913, "Beta": 914, "Gamma": 915, "Delta": 916, "Epsilon": 917, "Zeta": 918, "Eta": 919, "Theta": 920, "Iota": 921, "Kappa": 922, "Lambda": 923, "Mu": 924, "Nu": 925, "Xi": 926, "Omicron": 927, "Pi": 928, "Rho": 929, "Sigma": 931, "Tau": 932, "Upsilon": 933, "Phi": 934, "Chi": 935, "Psi": 936, "Omega": 937, "alpha": 945, "beta": 946, "gamma": 947, "delta": 948, "epsilon": 949, "zeta": 950, "eta": 951, "theta": 952, "iota": 953, "kappa": 954, "lambda": 955, "mu": 956, "nu": 957, "xi": 958, "omicron": 959, "pi": 960, "rho": 961, "sigmaf": 962, "sigma": 963, "tau": 964, "upsilon": 965, "phi": 966, "chi": 967, "psi": 968, "omega": 969, "thetasym": 977, "upsih": 978, "piv": 982, "ensp": 8194, "emsp": 8195, "thinsp": 8201, "zwnj": 8204, "zwj": 8205, "lrm": 8206, "rlm": 8207, "ndash": 8211, "mdash": 8212, "lsquo": 8216, "rsquo": 8217, "sbquo": 8218, "ldquo": 8220, "rdquo": 8221, "bdquo": 8222, "dagger": 8224, "Dagger": 8225, "bull": 8226, "hellip": 8230, "permil": 8240, "prime": 8242, "Prime": 8243, "lsaquo": 8249, "rsaquo": 8250, "oline": 8254, "frasl": 8260, "euro": 8364, "image": 8465, "weierp": 8472, "real": 8476, "trade": 8482, "alefsym": 8501, "larr": 8592, "uarr": 8593, "rarr": 8594, "darr": 8595, "harr": 8596, "crarr": 8629, "lArr": 8656, "uArr": 8657, "rArr": 8658, "dArr": 8659, "hArr": 8660, "forall": 8704, "part": 8706, "exist": 8707, "empty": 8709, "nabla": 8711, "isin": 8712, "notin": 8713, "ni": 8715, "prod": 8719, "sum": 8721, "minus": 8722, "lowast": 8727, "radic": 8730, "prop": 8733, "infin": 8734, "ang": 8736, "and": 8743, "or": 8744, "cap": 8745, "cup": 8746, "int": 8747, "there4": 8756, "sim": 8764, "cong": 8773, "asymp": 8776, "ne": 8800, "equiv": 8801, "le": 8804, "ge": 8805, "sub": 8834, "sup": 8835, "nsub": 8836, "sube": 8838, "supe": 8839, "oplus": 8853, "otimes": 8855, "perp": 8869, "sdot": 8901, "lceil": 8968, "rceil": 8969, "lfloor": 8970, "rfloor": 8971, "lang": 9001, "rang": 9002, "loz": 9674, "spades": 9824, "clubs": 9827, "hearts": 9829, "diams": 9830 });
+});
+BitVector.SMALL_BLOCK_SIZE = 32;
+BitVector.LARGE_BLOCK_SIZE = 256;
+BitVector.BLOCK_RATE = 8;
+$__jsx_lazy_init(BurrowsWheelerTransform, "END_MARKER", function () {
+ return String.fromCharCode(0);
+});
+var $__jsx_classMap = {
+ "tool/web/oktavia-italian-search.jsx": {
+ _Main: _Main,
+ _Main$: _Main$
+ },
+ "tool/web/oktavia-search.jsx": {
+ _Result: _Result,
+ _Result$SSSI: _Result$SSSI,
+ _Proposal: _Proposal,
+ _Proposal$SSI: _Proposal$SSI,
+ OktaviaSearch: OktaviaSearch,
+ OktaviaSearch$I: OktaviaSearch$I,
+ _Main: _Main$0,
+ _Main$: _Main$0$
+ },
+ "src/oktavia.jsx": {
+ Oktavia: Oktavia,
+ Oktavia$: Oktavia$
+ },
+ "src/binary-util.jsx": {
+ Binary: Binary,
+ Binary$: Binary$,
+ LoadedStringResult: LoadedStringResult,
+ LoadedStringResult$SI: LoadedStringResult$SI,
+ LoadedStringListResult: LoadedStringListResult,
+ LoadedStringListResult$SI: LoadedStringListResult$SI,
+ LoadedStringListMapResult: LoadedStringListMapResult,
+ LoadedStringListMapResult$SI: LoadedStringListMapResult$SI,
+ LoadedNumberListResult: LoadedNumberListResult,
+ LoadedNumberListResult$SI: LoadedNumberListResult$SI,
+ CompressionReport: CompressionReport,
+ CompressionReport$: CompressionReport$
+ },
+ "src/query.jsx": {
+ Query: Query,
+ Query$: Query$
+ },
+ "src/query-string-parser.jsx": {
+ QueryStringParser: QueryStringParser,
+ QueryStringParser$: QueryStringParser$
+ },
+ "src/search-result.jsx": {
+ Proposal: Proposal,
+ Proposal$II: Proposal$II,
+ Position: Position,
+ Position$SIB: Position$SIB,
+ SearchUnit: SearchUnit,
+ SearchUnit$I: SearchUnit$I,
+ SingleResult: SingleResult,
+ SingleResult$: SingleResult$,
+ SingleResult$SBB: SingleResult$SBB,
+ SearchSummary: SearchSummary,
+ SearchSummary$: SearchSummary$,
+ SearchSummary$LOktavia$: SearchSummary$LOktavia$
+ },
+ "src/style.jsx": {
+ Style: Style,
+ Style$S: Style$S,
+ _HTMLHandler: _HTMLHandler,
+ _HTMLHandler$HASB: _HTMLHandler$HASB
+ },
+ "src/stemmer/stemmer.jsx": {
+ Stemmer: Stemmer,
+ Stemmer$: Stemmer$
+ },
+ "src/stemmer/base-stemmer.jsx": {
+ BaseStemmer: BaseStemmer,
+ BaseStemmer$: BaseStemmer$
+ },
+ "src/stemmer/italian-stemmer.jsx": {
+ ItalianStemmer: ItalianStemmer,
+ ItalianStemmer$: ItalianStemmer$
+ },
+ "src/stemmer/among.jsx": {
+ Among: Among,
+ Among$SII: Among$SII,
+ Among$SIIF$LBaseStemmer$B$LBaseStemmer$: Among$SIIF$LBaseStemmer$B$LBaseStemmer$
+ },
+ "src/metadata.jsx": {
+ Metadata: Metadata,
+ Metadata$LOktavia$: Metadata$LOktavia$,
+ Section: Section,
+ Section$LOktavia$: Section$LOktavia$,
+ Splitter: Splitter,
+ Splitter$LOktavia$: Splitter$LOktavia$,
+ Splitter$LOktavia$S: Splitter$LOktavia$S,
+ Table: Table,
+ Table$LOktavia$AS: Table$LOktavia$AS,
+ Block: Block,
+ Block$LOktavia$: Block$LOktavia$
+ },
+ "src/fm-index.jsx": {
+ FMIndex: FMIndex,
+ FMIndex$: FMIndex$
+ },
+ "src/sax.jsx": {
+ Tag: Tag,
+ Tag$S: Tag$S,
+ _Common: _Common,
+ _Common$: _Common$,
+ _State: _State,
+ _State$: _State$,
+ SAXHandler: SAXHandler,
+ SAXHandler$: SAXHandler$,
+ SAXParser: SAXParser,
+ SAXParser$LSAXHandler$: SAXParser$LSAXHandler$,
+ SAXParser$LSAXHandler$B: SAXParser$LSAXHandler$B,
+ Char: Char,
+ Char$: Char$,
+ _Entities: _Entities,
+ _Entities$: _Entities$
+ },
+ "src/bit-vector.jsx": {
+ BitVector: BitVector,
+ BitVector$: BitVector$
+ },
+ "src/wavelet-matrix.jsx": {
+ WaveletMatrix: WaveletMatrix,
+ WaveletMatrix$: WaveletMatrix$
+ },
+ "src/burrows-wheeler-transform.jsx": {
+ BurrowsWheelerTransform: BurrowsWheelerTransform,
+ BurrowsWheelerTransform$: BurrowsWheelerTransform$
+ },
+ "src/sais.jsx": {
+ OArray: OArray,
+ OArray$AI: OArray$AI,
+ OArray$AII: OArray$AII,
+ SAIS: SAIS,
+ SAIS$: SAIS$
+ }
+};
+
+
+/**
+ * launches _Main.main(:string[]):void invoked by jsx --run|--executable
+ */
+JSX.runMain = function (sourceFile, args) {
+ var module = JSX.require(sourceFile);
+ if (! module) {
+ throw new ReferenceError("entry point module not found in " + sourceFile);
+ }
+ if (! module._Main) {
+ throw new ReferenceError("entry point _Main not found in " + sourceFile);
+ }
+ if (! module._Main.main$AS) {
+ throw new ReferenceError("entry point _Main.main(:string[]):void not found in " + sourceFile);
+ }
+ module._Main.main$AS(args);
+};
+
+/**
+ * launches _Test#test*():void invoked by jsx --test
+ */
+JSX.runTests = function (sourceFile, tests) {
+ var module = JSX.require(sourceFile);
+ var testClass = module._Test$;
+
+ if (!testClass) return; // skip if there's no test class
+
+ if(tests.length === 0) {
+ var p = testClass.prototype;
+ for (var m in p) {
+ if (p[m] instanceof Function
+ && /^test.*[$]$/.test(m)) {
+ tests.push(m);
+ }
+ }
+ }
+ else { // set as process arguments
+ tests = tests.map(function (name) {
+ return name + "$"; // mangle for function test*():void
+ });
+ }
+
+ var testCase = new testClass();
+
+ if (testCase.beforeClass$AS != null)
+ testCase.beforeClass$AS(tests);
+
+ for (var i = 0; i < tests.length; ++i) {
+ (function (method) {
+ if (method in testCase) {
+ testCase.run$SF$V$(method, function() { testCase[method](); });
+ }
+ else {
+ throw new ReferenceError("No such test method: " + method);
+ }
+ }(tests[i]));
+ }
+
+ if (testCase.afterClass$ != null)
+ testCase.afterClass$();
+};
+/**
+ * call a function on load/DOMContentLoaded
+ */
+function $__jsx_onload (event) {
+ window.removeEventListener("load", $__jsx_onload);
+ document.removeEventListener("DOMContentLoaded", $__jsx_onload);
+ JSX.runMain("tool/web/oktavia-italian-search.jsx", [])
+}
+
+window.addEventListener("load", $__jsx_onload);
+document.addEventListener("DOMContentLoaded", $__jsx_onload);
+
+})(JSX);
diff --git a/web/server/h2o/libh2o/misc/oktavia/lib/oktavia-jquery-highlight.js b/web/server/h2o/libh2o/misc/oktavia/lib/oktavia-jquery-highlight.js
new file mode 100644
index 00000000..519e8876
--- /dev/null
+++ b/web/server/h2o/libh2o/misc/oktavia/lib/oktavia-jquery-highlight.js
@@ -0,0 +1,105 @@
+/**
+ * @fileOverview
+ * A UI script helper that provides search word highlight.
+ * Almost all code came from Sphinx
+ * @author Yoshiki Shibukawa, yoshiki@shibu.jp
+ */
+
+(function ($)
+{
+ /**
+ * small helper function to urldecode strings
+ */
+ function urldecode(x)
+ {
+ return decodeURIComponent(x).replace(/\+/g, ' ');
+ }
+
+ /**
+ * This function returns the parsed url parameters of the
+ * current request. Multiple values per key are supported,
+ * it will always return arrays of strings for the value parts.
+ */
+ function getQueryParameters(s)
+ {
+ if (typeof s == 'undefined')
+ s = document.location.search;
+ var parts = s.substr(s.indexOf('?') + 1).split('&');
+ var result = {};
+ for (var i = 0; i < parts.length; i++)
+ {
+ var tmp = parts[i].split('=', 2);
+ var key = urldecode(tmp[0]);
+ var value = urldecode(tmp[1]);
+ if (key in result)
+ {
+ result[key].push(value);
+ }
+ else
+ {
+ result[key] = [value];
+ }
+ }
+ return result;
+ }
+
+ /**
+ * highlight a given string on a jquery object by wrapping it in
+ * span elements with the given class name.
+ */
+ jQuery.fn.highlightText = function(text, className)
+ {
+ function highlight(node)
+ {
+ if (node.nodeType == 3)
+ {
+ var val = node.nodeValue;
+ var pos = val.toLowerCase().indexOf(text);
+ if (pos >= 0 && !jQuery(node.parentNode).hasClass(className))
+ {
+ var span = document.createElement("span");
+ span.className = className;
+ span.appendChild(document.createTextNode(val.substr(pos, text.length)));
+ node.parentNode.insertBefore(span, node.parentNode.insertBefore(
+ document.createTextNode(val.substr(pos + text.length)),
+ node.nextSibling));
+ node.nodeValue = val.substr(0, pos);
+ }
+ }
+ else if (!jQuery(node).is("button, select, textarea"))
+ {
+ jQuery.each(node.childNodes, function() {
+ highlight(this);
+ });
+ }
+ }
+ return this.each(function() {
+ highlight(this);
+ });
+ };
+
+ /**
+ * highlight the search words provided in the url in the text
+ */
+ function highlightSearchWords(selector)
+ {
+ var params = getQueryParameters();
+ var terms = (params.highlight) ? params.highlight[0].split(/\s+/) : [];
+ if (terms.length)
+ {
+ var body = $(selector);
+ window.setTimeout(function()
+ {
+ $.each(terms, function()
+ {
+ body.highlightText(this.toLowerCase(), 'highlighted');
+ });
+ }, 10);
+ }
+ }
+
+ jQuery(document).ready(function () {
+ highlightSearchWords('body');
+ });
+})(jQuery);
+
diff --git a/web/server/h2o/libh2o/misc/oktavia/lib/oktavia-jquery-ui.js b/web/server/h2o/libh2o/misc/oktavia/lib/oktavia-jquery-ui.js
new file mode 100644
index 00000000..bd1efb8c
--- /dev/null
+++ b/web/server/h2o/libh2o/misc/oktavia/lib/oktavia-jquery-ui.js
@@ -0,0 +1,521 @@
+/**
+ * @fileOverview
+ * A UI script that creates search form, loads an index files and show search results.
+ * It needs jQuery and <tt>oktavia-search.js</tt> or <tt>oktavia-*-search.js</tt>
+ * (stemming library supported versions).
+ * @author Yoshiki Shibukawa, yoshiki@shibu.jp
+ */
+
+(function ($)
+{
+ var logosrc;
+ /**
+ * @name SearchView
+ * @class
+ * Provides searching feature to your website.
+ * @constructor
+ * @param {jQeury} node Target node it has a search form and a search result window.
+ * @param {string} documentRoot Document root folder like '.', '../', '/'
+ * @param {string} index Index file path.
+ */
+ function SearchView(node, documentRoot, index)
+ {
+ var OktaviaSearch = JSX.require("tool/web/oktavia-search.jsx").OktaviaSearch$I;
+
+ /**
+ * Target node it contains a search form and a search result window.
+ * @type jQuery
+ */
+ this.node = node;
+ /**
+ * Search engine core
+ * @type OktaviaSearch
+ */
+ this.engine = new OktaviaSearch(5);
+ if (documentRoot === '')
+ {
+ /**
+ * Document root path
+ * @type string[]
+ */
+ this.documentRoot = [];
+ }
+ else if (documentRoot.slice(-1) === '/')
+ {
+ this.documentRoot = documentRoot.slice(0, -1).split(/\//g);
+ }
+ else
+ {
+ this.documentRoot = documentRoot.split(/\//g);
+ }
+
+ /**
+ * It is true if an index file is loaded.
+ * @type boolean
+ */
+ this.initialized = false;
+ /**
+ * It is true if an user search before loading an index.
+ * @type boolean
+ */
+ this.reserveSearch = false;
+
+ var indexURL;
+ switch (index.charAt(0))
+ {
+ case '.':
+ case '/':
+ indexURL = index;
+ break;
+ default:
+ indexURL = this.getDocumentPath(index);
+ break;
+ }
+ var self = this;
+ function loadIndex()
+ {
+ self.engine.loadIndex$S(window.searchIndex);
+ self.initialized = true;
+ window.searchIndex = null;
+ if (self.reserveSearch)
+ {
+ self.search();
+ }
+ self.reserveSearch = false;
+ }
+ if (window.searchIndex)
+ {
+ loadIndex()
+ }
+ else
+ {
+ this.loadJavaScript(indexURL, loadIndex);
+ }
+ }
+
+ /**
+ * Changes result page.
+ * @param {integer} page Page number
+ * @memberOf SearchView.prototype
+ * @method
+ */
+ SearchView.prototype.changePage = function (page)
+ {
+ this.engine.setCurrentPage$I(page);
+ this.updateResult();
+ };
+
+ /**
+ * Clears a search form and a reult window.
+ * @memberOf SearchView.prototype
+ * @method
+ */
+ SearchView.prototype.clearResult = function ()
+ {
+ $('.oktavia_search', this.node).val('');
+ $('.oktavia_searchresult_box', this.node).hide();
+ };
+
+ /**
+ * Loads an external JavaScript file.
+ *
+ * This code is based on: http://os0x.hatenablog.com/entry/20080827/1219815828
+ * @param {string} src A JavaScript source file path
+ * @param {function} callback It is called when the target JavaScript file is loaded
+ * @memberOf SearchView.prototype
+ * @method
+ */
+ SearchView.prototype.loadJavaScript = function (src, callback)
+ {
+ var sc = document.createElement('script');
+ sc.type = 'text/javascript';
+ if (window.ActiveXObject)
+ {
+ sc.onreadystatechange = function ()
+ {
+ if (sc.readyState === 'complete' || sc.readyState === 'loaded')
+ {
+ callback(sc.readyState);
+ }
+ };
+ }
+ else
+ {
+ sc.onload = function ()
+ {
+ callback('onload');
+ };
+ }
+ sc.src = src;
+ document.body.appendChild(sc);
+ };
+
+ /**
+ * Updates page navigation list.
+ * @memberOf SearchView.prototype
+ * @method
+ */
+ SearchView.prototype.updatePageList = function ()
+ {
+ var self = this;
+ function createCallback(i)
+ {
+ return function () {
+ self.changePage(i);
+ };
+ }
+
+ var currentPage = String(this.engine.currentPage$());
+ var nav = $('.oktavia_searchresult_nav', this.node);
+ nav.empty();
+ var pages = this.engine.pageIndexes$();
+ for (var i = 0; i < pages.length; i++)
+ {
+ var pageItem = $('<span/>').text(pages[i]);
+ if (pages[i] === '...')
+ {
+ pageItem.addClass('leader');
+ }
+ else
+ {
+ pageItem.addClass('page');
+ if (pages[i] !== currentPage)
+ {
+ pageItem.bind('click', createCallback(Number(pages[i])));
+ }
+ else
+ {
+ pageItem.addClass('selected');
+ }
+ }
+ nav.append(pageItem);
+ }
+ };
+
+ /**
+ * Updates result list in a result window.
+ * @memberOf SearchView.prototype
+ * @method
+ */
+ SearchView.prototype.updateResult = function ()
+ {
+ var totalPages = this.engine.totalPages$();
+ var resultslot = $('.oktavia_searchresult', this.node);
+ resultslot.empty();
+ var self = this;
+ function clearCallback()
+ {
+ self.clearResult();
+ }
+ var results = this.engine.getResult$();
+ var searchInput = $('.oktavia_search', this.node);
+ var queryWord = searchInput.val()
+ for (var i = 0; i < results.length; i++)
+ {
+ var result = results[i];
+ var url = this.getDocumentPath(result.url.slice(1))
+ var entry = $('<div/>', { "class": "entry" });
+ var link = $('<a/>', { "href": url + this.engine.getHighlight$() }).text(result.title);
+ link.bind('click', clearCallback);
+ entry.append($('<div/>', { "class": "title" }).append(link));
+ entry.append($('<div/>', { "class": "url" }).text(url));
+ entry.append($('<div/>', { "class": "resultcontent" }).html(result.content));
+ resultslot.append(entry);
+ }
+ this.updatePageList();
+ };
+
+ /**
+ * Searchs again by using proposal search words.
+ * @param {string} option Proposal search words
+ * @memberOf SearchView.prototype
+ * @method
+ */
+ SearchView.prototype.searchProposal = function (option)
+ {
+ $('.oktavia_search', this.node).val(option);
+ this.search();
+ };
+
+ /**
+ * Shows proposals when no result.
+ * @memberOf SearchView.prototype
+ * @method
+ */
+ SearchView.prototype.updateProposal = function ()
+ {
+ var nav = $('.oktavia_searchresult_nav', this.node);
+ var resultslot = $('.oktavia_searchresult', this.node);
+ nav.empty();
+ resultslot.empty();
+ var proposals = this.engine.getProposals$();
+ var self = this;
+ function createCallback(option)
+ {
+ return function ()
+ {
+ self.searchProposal(option);
+ };
+ }
+ for (var i = 0; i < proposals.length; i++)
+ {
+ var proposal = proposals[i];
+ var listitem = $('<div/>', {"class": "proposal"});
+ listitem.append('<span>Search with:&nbsp;</span>');
+ var option = $('<span/>', {"class": "option"});
+ option.html(proposal.label);
+ option.bind('click', createCallback(proposal.options));
+ listitem.append(option);
+ listitem.append('<span>&nbsp;&#x2192;&nbsp;' + proposal.count + ' results.</span>');
+ resultslot.append(listitem);
+ }
+ };
+
+ /**
+ * Performs search and shows results.
+ * @memberOf SearchView.prototype
+ * @method
+ */
+ SearchView.prototype.search = function ()
+ {
+ if (!this.initialized)
+ {
+ this.reserveSearch = true;
+ return;
+ }
+ var searchInput = $('.oktavia_search', this.node);
+ var queryWord = searchInput.val();
+ searchInput.blur();
+ var self = this;
+ this.engine.search$SF$IIV$(queryWord, function (total, pages)
+ {
+ $('.oktavia_searchresult_box', self.node).fadeIn();
+ var summaryNode = $('.oktavia_searchresult_summary', self.node);
+ if (total === 0)
+ {
+ summaryNode.text("No result.");
+ self.updateProposal();
+ }
+ else
+ {
+ summaryNode.text(total + ' results.');
+ self.updateResult();
+ }
+ });
+ };
+
+ /**
+ * Converts file path in index.
+ * @param {string} filePath Source filepath
+ * @returns {string} Result filepath
+ * @memberOf SearchView.prototype
+ * @method
+ */
+ SearchView.prototype.getDocumentPath = function (filePath)
+ {
+ var resultFilePath;
+ if (filePath.charAt(0) === '/')
+ {
+ resultFilePath = filePath;
+ }
+ else
+ {
+ var elements = filePath.split(/\//g);
+ var result = this.documentRoot.slice();
+ for (var i = 0; i < elements.length; i++)
+ {
+ var element = elements[i];
+ switch (element)
+ {
+ case '.':
+ break;
+ case '..':
+ result = result.slice(0, -1);
+ break;
+ default:
+ result.push(element);
+ break;
+ }
+ }
+ resultFilePath = result.join('/');
+ }
+ return resultFilePath;
+ };
+
+ /**
+ * Hides all result windows.
+ * @function
+ */
+ function eraseResultWindow()
+ {
+ $('.oktavia_searchresult_box:visible').hide();
+ }
+
+ /**
+ * jQuery plug-in to create search form and window.
+ * It can receive options from data attributes or an <tt>option</tt> parameter.
+ * @param {object} [option] Option
+ * @param {string} [option.index='search/searchindex.js'] Index file path.
+ * @param {string} [option.documentRoot='.'] Document root folder.
+ * @param {string} [option.logo='true'] Show logo in result windows. <tt>'false'</tt> or <tt>'disable'</tt> or falsy value disable logo.
+ * @name oktaviaSearch
+ * @function
+ */
+ jQuery.fn.oktaviaSearch = function (option)
+ {
+ var data = {
+ 'index': 'search/searchindex.js',
+ 'documentRoot': '.',
+ 'logo': 'true'
+ };
+ if (window.DOCUMENTATION_OPTIONS) // Sphinx
+ {
+ if (window.DOCUMENTATION_OPTIONS.URL_ROOT === '#')
+ {
+ data.documentRoot = '';
+ }
+ else
+ {
+ data.documentRoot = window.DOCUMENTATION_OPTIONS.URL_ROOT;
+ }
+ }
+ var userData = this.data();
+ var key;
+ for (key in userData)
+ {
+ if (userData.hasOwnProperty(key))
+ {
+ data[key] = userData[key];
+ }
+ }
+ for (key in option)
+ {
+ if (option.hasOwnProperty(key))
+ {
+ data[key] = option[key];
+ }
+ }
+ if (data.logo === 'false' || data.logo === 'disable' || !data.logo)
+ {
+ data.logo = false;
+ }
+ else
+ {
+ data.logo = true;
+ }
+ var view = new SearchView(this, data.documentRoot, data.index);
+
+ var form = $('<form class="oktavia_form"><input class="oktavia_search" result="10" type="search" name="search" value="" placeholder="Search" /></form>');
+ form.submit(function (event) {
+ event.stopPropagation();
+ setTimeout(function () {
+ view.search();
+ }, 10);
+ return false;
+ });
+ this.append(form);
+ var resultForm = $([
+ '<div class="oktavia_searchresult_box">',
+ '<div class="oktavia_close_search_box">&times;</div>',
+ '<div class="oktavia_searchresult_summary"></div>',
+ '<div class="oktavia_searchresult"></div>',
+ '<div class="oktavia_searchresult_nav"></div>',
+ '</div>'
+ ].join(''));
+ if (data.logo)
+ {
+ resultForm.append($('<span class="pr">Powered by <a href="http://oktavia.info"><img src="' + logosrc + '" width="86px" height="25px" alt="Oktavia"></img></a></span>'));
+ }
+ this.append(resultForm);
+ $('.oktavia_close_search_box', this.node).bind('click', function (event) {
+ view.clearResult();
+ });
+
+ // Click outside of the result window, close it
+ resultForm.bind('click', function (event) {
+ event.stopPropagation();
+ });
+ };
+
+ /**
+ * Global initailization.
+ * It add some event handlers.
+ * @name initialize
+ * @function
+ */
+ function initialize()
+ {
+
+ function onClick() {
+ eraseResultWindow();
+ return true;
+ }
+ function onKeyDown(event)
+ {
+ switch (event.keyCode)
+ {
+ case 191: // / : focus form
+ eraseResultWindow();
+ var form = $('form.oktavia_form:first input.search');
+ if ($(':focus', form).size() === 0)
+ {
+ form.focus();
+ }
+ break;
+ case 74: // j : down
+ case 75: // k : up
+ case 72: // h : before page
+ case 76: // l : next page
+ case 13: // enter : select
+ var result = $('.oktavia_searchresult_box:visible:first');
+ if (result.size() === 1)
+ {
+ switch (event.keyCode)
+ {
+ case 74: // j : down
+ console.log('down');
+ break;
+ case 75: // k : up
+ console.log('up');
+ break;
+ case 72: // h : before page
+ console.log('before');
+ break;
+ case 76: // l : next page
+ console.log('next');
+ break;
+ case 13: // enter : select
+ console.log('select');
+ break;
+ }
+ }
+ break;
+ }
+ return true;
+ }
+ var version = $.fn.jquery.split(/\./g);
+ var major = Number(version[0]);
+ var minor = Number(version[1]);
+ if (major === 1 && minor < 7)
+ {
+ $(document).live('click', onClick);
+ $(document).live('keydown', onKeyDown);
+ }
+ else
+ {
+ $(document).on('click', onClick);
+ $(document).on('keydown', onKeyDown);
+ }
+ }
+
+ var logosrc = "data:image/jpeg;base64, /9j/4AAQSkZJRgABAQEASABIAAD/4ge4SUNDX1BST0ZJTEUAAQEAAAeoYXBwbAIgAABtbnRyUkdCIFhZWiAH2QACABkACwAaAAthY3NwQVBQTAAAAABhcHBsAAAAAAAAAAAAAAAAAAAAAAAA9tYAAQAAAADTLWFwcGwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAtkZXNjAAABCAAAAG9kc2NtAAABeAAABWxjcHJ0AAAG5AAAADh3dHB0AAAHHAAAABRyWFlaAAAHMAAAABRnWFlaAAAHRAAAABRiWFlaAAAHWAAAABRyVFJDAAAHbAAAAA5jaGFkAAAHfAAAACxiVFJDAAAHbAAAAA5nVFJDAAAHbAAAAA5kZXNjAAAAAAAAABRHZW5lcmljIFJHQiBQcm9maWxlAAAAAAAAAAAAAAAUR2VuZXJpYyBSR0IgUHJvZmlsZQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAbWx1YwAAAAAAAAAeAAAADHNrU0sAAAAoAAABeGhySFIAAAAoAAABoGNhRVMAAAAkAAAByHB0QlIAAAAmAAAB7HVrVUEAAAAqAAACEmZyRlUAAAAoAAACPHpoVFcAAAAWAAACZGl0SVQAAAAoAAACem5iTk8AAAAmAAAComtvS1IAAAAWAAACyGNzQ1oAAAAiAAAC3mhlSUwAAAAeAAADAGRlREUAAAAsAAADHmh1SFUAAAAoAAADSnN2U0UAAAAmAAAConpoQ04AAAAWAAADcmphSlAAAAAaAAADiHJvUk8AAAAkAAADomVsR1IAAAAiAAADxnB0UE8AAAAmAAAD6G5sTkwAAAAoAAAEDmVzRVMAAAAmAAAD6HRoVEgAAAAkAAAENnRyVFIAAAAiAAAEWmZpRkkAAAAoAAAEfHBsUEwAAAAsAAAEpHJ1UlUAAAAiAAAE0GFyRUcAAAAmAAAE8mVuVVMAAAAmAAAFGGRhREsAAAAuAAAFPgBWAWEAZQBvAGIAZQBjAG4A/QAgAFIARwBCACAAcAByAG8AZgBpAGwARwBlAG4AZQByAGkBDQBrAGkAIABSAEcAQgAgAHAAcgBvAGYAaQBsAFAAZQByAGYAaQBsACAAUgBHAEIAIABnAGUAbgDoAHIAaQBjAFAAZQByAGYAaQBsACAAUgBHAEIAIABHAGUAbgDpAHIAaQBjAG8EFwQwBDMEMAQ7BEwEPQQ4BDkAIAQ/BEAEPgREBDAEOQQ7ACAAUgBHAEIAUAByAG8AZgBpAGwAIABnAOkAbgDpAHIAaQBxAHUAZQAgAFIAVgBCkBp1KAAgAFIARwBCACCCcl9pY8+P8ABQAHIAbwBmAGkAbABvACAAUgBHAEIAIABnAGUAbgBlAHIAaQBjAG8ARwBlAG4AZQByAGkAcwBrACAAUgBHAEIALQBwAHIAbwBmAGkAbMd8vBgAIABSAEcAQgAg1QS4XNMMx3wATwBiAGUAYwBuAP0AIABSAEcAQgAgAHAAcgBvAGYAaQBsBeQF6AXVBeQF2QXcACAAUgBHAEIAIAXbBdwF3AXZAEEAbABsAGcAZQBtAGUAaQBuAGUAcwAgAFIARwBCAC0AUAByAG8AZgBpAGwAwQBsAHQAYQBsAOEAbgBvAHMAIABSAEcAQgAgAHAAcgBvAGYAaQBsZm6QGgAgAFIARwBCACBjz4/wZYdO9k4AgiwAIABSAEcAQgAgMNcw7TDVMKEwpDDrAFAAcgBvAGYAaQBsACAAUgBHAEIAIABnAGUAbgBlAHIAaQBjA5MDtQO9A7kDugPMACADwAPBA78DxgOvA7sAIABSAEcAQgBQAGUAcgBmAGkAbAAgAFIARwBCACAAZwBlAG4A6QByAGkAYwBvAEEAbABnAGUAbQBlAGUAbgAgAFIARwBCAC0AcAByAG8AZgBpAGUAbA5CDhsOIw5EDh8OJQ5MACAAUgBHAEIAIA4XDjEOSA4nDkQOGwBHAGUAbgBlAGwAIABSAEcAQgAgAFAAcgBvAGYAaQBsAGkAWQBsAGUAaQBuAGUAbgAgAFIARwBCAC0AcAByAG8AZgBpAGkAbABpAFUAbgBpAHcAZQByAHMAYQBsAG4AeQAgAHAAcgBvAGYAaQBsACAAUgBHAEIEHgQxBEkEOAQ5ACAEPwRABD4ERAQ4BDsETAAgAFIARwBCBkUGRAZBACAGKgY5BjEGSgZBACAAUgBHAEIAIAYnBkQGOQYnBkUARwBlAG4AZQByAGkAYwAgAFIARwBCACAAUAByAG8AZgBpAGwAZQBHAGUAbgBlAHIAZQBsACAAUgBHAEIALQBiAGUAcwBrAHIAaQB2AGUAbABzAGV0ZXh0AAAAAENvcHlyaWdodCAyMDA3IEFwcGxlIEluYy4sIGFsbCByaWdodHMgcmVzZXJ2ZWQuAFhZWiAAAAAAAADzUgABAAAAARbPWFlaIAAAAAAAAHRNAAA97gAAA9BYWVogAAAAAAAAWnUAAKxzAAAXNFhZWiAAAAAAAAAoGgAAFZ8AALg2Y3VydgAAAAAAAAABAc0AAHNmMzIAAAAAAAEMQgAABd7///MmAAAHkgAA/ZH///ui///9owAAA9wAAMBs/+EAgEV4aWYAAE1NACoAAAAIAAUBEgADAAAAAQABAAABGgAFAAAAAQAAAEoBGwAFAAAAAQAAAFIBKAADAAAAAQACAACHaQAEAAAAAQAAAFoAAAAAAAAASAAAAAEAAABIAAAAAQACoAIABAAAAAEAAABWoAMABAAAAAEAAAAYAAAAAP/bAEMAAgICAgIBAgICAgICAgMDBgQDAwMDBwUFBAYIBwgICAcICAkKDQsJCQwKCAgLDwsMDQ4ODg4JCxARDw4RDQ4ODv/bAEMBAgICAwMDBgQEBg4JCAkODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODv/AABEIABgAVgMBIgACEQEDEQH/xAAfAAABBQEBAQEBAQAAAAAAAAAAAQIDBAUGBwgJCgv/xAC1EAACAQMDAgQDBQUEBAAAAX0BAgMABBEFEiExQQYTUWEHInEUMoGRoQgjQrHBFVLR8CQzYnKCCQoWFxgZGiUmJygpKjQ1Njc4OTpDREVGR0hJSlNUVVZXWFlaY2RlZmdoaWpzdHV2d3h5eoOEhYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3uLm6wsPExcbHyMnK0tPU1dbX2Nna4eLj5OXm5+jp6vHy8/T19vf4+fr/xAAfAQADAQEBAQEBAQEBAAAAAAAAAQIDBAUGBwgJCgv/xAC1EQACAQIEBAMEBwUEBAABAncAAQIDEQQFITEGEkFRB2FxEyIygQgUQpGhscEJIzNS8BVictEKFiQ04SXxFxgZGiYnKCkqNTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqCg4SFhoeIiYqSk5SVlpeYmZqio6Slpqeoqaqys7S1tre4ubrCw8TFxsfIycrS09TV1tfY2dri4+Tl5ufo6ery8/T19vf4+fr/2gAMAwEAAhEDEQA/AP3571+dfjn4ofEz4+/tjeJPg38JPE+peAfh/wCE9Q/szxJ4g0namo6xqCoss9tBM6sLe2gRlEkqqXLNtXnFfooa/Lj9jvU7PwH+3T+0D8J/E00Vt4usvHOs3MfmsAbqDUbmO+tp1J6qyN5ZPZkCnqBTQG7pnwW1VP2lde8FfB74qfF3R/E3hrT459f8Val4xutRsIryVd8Nq1ncGRZlYD5zlSoPHTBufD39oH4y+F9H8Xaj8Ur2w8SxeCvES6P4+0tLBIbzSklI8m/t5IwFmt2BBwVB/PI9Z+DOtWfhn/goR+0p8P8AxDcw6f4j1XV7bxLo0dw4U3+nyWwQvHk/MI3RlbH3a+SvG/jnRdbi/bY+JOkyJc+HvF0mm+BvBoiGf+Eh1OGPy3a2H/LUBnHzLkYXNfa0KNGnmlDCxpKVOpGmndXb5knKSb1i7t2cbWtrfW/w+IjiK2WVsRKu41ISm42dlGzajFpWUlZK6le921bS36G+GPHWq61+2r4+8I/2jFdeGdO8N6Xf6fEkKja1wZdz7wNzBgq8E4Fcr8T/ANpDwX4U0bw63hzxb4P1S5vPE8Gm3zveCRLW2WULdzDacHyhwxzhSwJz0Pxp430f4ww/H74qeEvABimudH+FHhxvFdvFcvDqGoW8KSCSztJFB2STBZlL9QFwOWr2L4k+IPh1r/7Fn7MuufDG00638E3XxJ8Pw6dbQQqPsymdlkgcdQ6uCrg8lgc5r1P7EwEcVhqk1zRlyK0bJL92neWm8nqu9m7nl1MzzN4PE0oS5Jpzd5Xb1ntHXaK0v00SXU+s9e+M/wAKfDGg6NqevfEDwrpljq9st1pckt8v+lwtyssYGSyH+8Bj3rQ0v4o/DrW7Hw/daR408OajBrl09ppElveowu50Xc0SY6yBeSvXHavmb/hIr7Uv22vivD8EvhJoXirxTpP2LTPFfibxX4ke0s7aRYQ8VpawiKVgqo4ZtiopJzyea+e7PQfFGteEv2tLyxh8Op8QPAXjrTfE+nW3htX+xLfWtos00UO7DfPGJImJAJYtx2rzcNw5g6tP35ODtF6uL+NpK8VrFJyTu3qleyvp6tfPsxp1PdhGSvJaKS+FNu0no20mrJWTduZ21/Rf4l6/d6N8PWtNC8UeF/C/jLU3Nv4cfXojLb3NyqmTyjGrKzAqrZKnKj5sHGD5j4L8W6fZfC6y+M3xg+IHguN9UQjSxY6iP7G0qFiR5Fs7HNxM2DvmILNgqoVBg+X6B4vsPj9+14vjbQ5xdeB/AXgBbq0kVt0b6tq1uZCPTfDbAA9wZe1eNfCXxXp9x8Ev2UdE8N/DhfiX8Xl8F3uq6PFqet/YdL0qzM5iluZiVcNIWwi7Y2Yc4IzzyUuFaLSlVlLnjbmjdJK8aklrKyWkY3b25no2kj13xhjIUKlCjThySb5Z8rcnZwi0mtWm3L3Vvy7pSlf9C/BnxO+H3xE+2f8ACEeMNB8TPaAG6isboPJCD0LJ94A+uMUV8JaxqPjex/4KWaZ/wmlh4A8NeJrr4bXUslp4Su5pdsI1C1VPtErpGXcndtwgAAPWisswyGlTlB0p6SSfR2+asntvZHDg+Iq/LKNan7ybV1dX+Tu16XZyPjX4k/tYftcfF/xR8Kvgh4b1/wDZ7+EOkanc6R4p8f8AiK2e31O6khkMcsVqqsGUHBwIW3FWy00BG1vWrX/gnT8EtJ+DfhvS/Dmq+NfDPxL0dnmT4m6dfKuvXs8mDI10zKY54jhQIXUqiqoXGM0UV8wfXC6h+xb418baxpK/Fv8Aad+IHjrRtOt5LSOKy8PadpV9PbyAeZDJexRmYI+BuCFc4x0yD6x8Lv2Pfgl8J/GOleINE0rX9e1jSQ40WfxHrM2oJpW8kubWJz5ULMScuqBj60UV00sdiKUXGE2k1Z2fTt6eRhPC0Zu8op9fn39dD2fTfhx4Y0r9oPxP8TrOG9XxXr+mWmnajK92zRNDamQwhYz8qkGR8kcnPPQV5ZqX7Kvwh1L4deMfCbWHiGx0HxF4lTxJLaWOuTwLp+pK277TZ7WH2Zi3JVMKTnjk0UVdLMsXTlzQqNPTq/s/D93TsKeEozVpRT3/AB3+8zT+yX8OIfEY1nSPEvxc8N6xPpdvp+sX2keOL22n1tIF2JJeOrZmn28GbIkOBluK9C+G/wADPhv8Jtc8WXngTR7nR4vEa2/9qWbX0s9vI0KMgkCSFsSOGYyPnMjEsxJ5ooq62bY2rBwnVk09GrvW21/Syt2M45fhozU1BXXWxL8MPgl8Pfg98LtY8H+A9KuNM0TU7+e9vElu3mkaSZQrYdiSFVQqqvRQABXAT/snfCj/AIQX4daNpD+NfC134GspLHw5rmh+JLi01O3tpGLPA86nMsbE5KuGFFFEc1xiqSqKrLmk7t3ers1r30bXo2U8Fh3BQ5FZdLfMS3/ZL+Elp4qtvEUA8aHxWtrPbXmvz+JrqfUNRSWSJ2+0zSMxlwYUCZ4RQVUKCRRRRTnm+Nl8VVv1ZCy3CramvuP/2Q==";
+ initialize();
+})(jQuery);
+
+jQuery(document).ready(function () {
+ var form = jQuery('#oktavia_search_form');
+ if (form.size() > 0)
+ {
+ form.oktaviaSearch();
+ }
+});
diff --git a/web/server/h2o/libh2o/misc/oktavia/lib/oktavia-norwegian-search.js b/web/server/h2o/libh2o/misc/oktavia/lib/oktavia-norwegian-search.js
new file mode 100644
index 00000000..55bb7d7f
--- /dev/null
+++ b/web/server/h2o/libh2o/misc/oktavia/lib/oktavia-norwegian-search.js
@@ -0,0 +1,7952 @@
+// generatedy by JSX compiler 0.9.24 (2013-04-05 13:45:00 +0900; 1b229cc6a411f674f0f7cf7a79b7a8b3f8eb7414)
+var JSX = {};
+(function (JSX) {
+/**
+ * copies the implementations from source interface to target
+ */
+function $__jsx_merge_interface(target, source) {
+ for (var k in source.prototype)
+ if (source.prototype.hasOwnProperty(k))
+ target.prototype[k] = source.prototype[k];
+}
+
+/**
+ * defers the initialization of the property
+ */
+function $__jsx_lazy_init(obj, prop, func) {
+ function reset(obj, prop, value) {
+ delete obj[prop];
+ obj[prop] = value;
+ return value;
+ }
+
+ Object.defineProperty(obj, prop, {
+ get: function () {
+ return reset(obj, prop, func());
+ },
+ set: function (v) {
+ reset(obj, prop, v);
+ },
+ enumerable: true,
+ configurable: true
+ });
+}
+
+/**
+ * sideeffect().a /= b
+ */
+function $__jsx_div_assign(obj, prop, divisor) {
+ return obj[prop] = (obj[prop] / divisor) | 0;
+}
+
+/*
+ * global functions, renamed to avoid conflict with local variable names
+ */
+var $__jsx_parseInt = parseInt;
+var $__jsx_parseFloat = parseFloat;
+var $__jsx_isNaN = isNaN;
+var $__jsx_isFinite = isFinite;
+
+var $__jsx_encodeURIComponent = encodeURIComponent;
+var $__jsx_decodeURIComponent = decodeURIComponent;
+var $__jsx_encodeURI = encodeURI;
+var $__jsx_decodeURI = decodeURI;
+
+var $__jsx_ObjectToString = Object.prototype.toString;
+var $__jsx_ObjectHasOwnProperty = Object.prototype.hasOwnProperty;
+
+/*
+ * profiler object, initialized afterwards
+ */
+function $__jsx_profiler() {
+}
+
+/*
+ * public interface to JSX code
+ */
+JSX.require = function (path) {
+ var m = $__jsx_classMap[path];
+ return m !== undefined ? m : null;
+};
+
+JSX.profilerIsRunning = function () {
+ return $__jsx_profiler.getResults != null;
+};
+
+JSX.getProfileResults = function () {
+ return ($__jsx_profiler.getResults || function () { return {}; })();
+};
+
+JSX.postProfileResults = function (url, cb) {
+ if ($__jsx_profiler.postResults == null)
+ throw new Error("profiler has not been turned on");
+ return $__jsx_profiler.postResults(url, cb);
+};
+
+JSX.resetProfileResults = function () {
+ if ($__jsx_profiler.resetResults == null)
+ throw new Error("profiler has not been turned on");
+ return $__jsx_profiler.resetResults();
+};
+JSX.DEBUG = false;
+/**
+ * class _Main extends Object
+ * @constructor
+ */
+function _Main() {
+}
+
+/**
+ * @constructor
+ */
+function _Main$() {
+};
+
+_Main$.prototype = new _Main;
+
+/**
+ * @param {Array.<undefined|!string>} args
+ */
+_Main.main$AS = function (args) {
+ OktaviaSearch$setStemmer$LStemmer$(new NorwegianStemmer$());
+};
+
+var _Main$main$AS = _Main.main$AS;
+
+/**
+ * class _Result extends Object
+ * @constructor
+ */
+function _Result() {
+}
+
+/**
+ * @constructor
+ * @param {!string} title
+ * @param {!string} url
+ * @param {!string} content
+ * @param {!number} score
+ */
+function _Result$SSSI(title, url, content, score) {
+ this.title = title;
+ this.url = url;
+ this.content = content;
+ this.score = score;
+};
+
+_Result$SSSI.prototype = new _Result;
+
+/**
+ * class _Proposal extends Object
+ * @constructor
+ */
+function _Proposal() {
+}
+
+/**
+ * @constructor
+ * @param {!string} options
+ * @param {!string} label
+ * @param {!number} count
+ */
+function _Proposal$SSI(options, label, count) {
+ this.options = options;
+ this.label = label;
+ this.count = count;
+};
+
+_Proposal$SSI.prototype = new _Proposal;
+
+/**
+ * class OktaviaSearch extends Object
+ * @constructor
+ */
+function OktaviaSearch() {
+}
+
+/**
+ * @constructor
+ * @param {!number} entriesPerPage
+ */
+function OktaviaSearch$I(entriesPerPage) {
+ this._queries = null;
+ this._highlight = "";
+ this._result = null;
+ this._proposals = null;
+ this._currentFolderDepth = 0;
+ this._oktavia = new Oktavia$();
+ this._entriesPerPage = entriesPerPage;
+ this._currentPage = 1;
+ this._queryString = null;
+ this._callback = null;
+ OktaviaSearch._instance = this;
+};
+
+OktaviaSearch$I.prototype = new OktaviaSearch;
+
+/**
+ * @param {Stemmer} stemmer
+ */
+OktaviaSearch.setStemmer$LStemmer$ = function (stemmer) {
+ /** @type {Oktavia} */
+ var this$0;
+ if (OktaviaSearch._instance) {
+ this$0 = OktaviaSearch._instance._oktavia;
+ this$0._stemmer = stemmer;
+ } else {
+ OktaviaSearch._stemmer = stemmer;
+ }
+};
+
+var OktaviaSearch$setStemmer$LStemmer$ = OktaviaSearch.setStemmer$LStemmer$;
+
+/**
+ * @param {!string} index
+ */
+OktaviaSearch.prototype.loadIndex$S = function (index) {
+ /** @type {Oktavia} */
+ var this$0;
+ /** @type {Stemmer} */
+ var stemmer$0;
+ if (OktaviaSearch._stemmer) {
+ this$0 = this._oktavia;
+ stemmer$0 = OktaviaSearch._stemmer;
+ this$0._stemmer = stemmer$0;
+ }
+ this._oktavia.load$S(Binary$base64decode$S(index));
+ if (this._queryString) {
+ this.search$SF$IIV$(this._queryString, this._callback);
+ this._queryString = null;
+ this._callback = null;
+ }
+};
+
+/**
+ * @param {!string} queryString
+ * @param {*} callback
+ */
+OktaviaSearch.prototype.search$SF$IIV$ = function (queryString, callback) {
+ /** @type {QueryStringParser} */
+ var queryParser;
+ /** @type {SearchSummary} */
+ var summary;
+ /** @type {Array.<undefined|SearchUnit>} */
+ var _result$0;
+ if (this._oktavia) {
+ queryParser = ({queries: [ ]});
+ this._queries = QueryStringParser$parse$LQueryStringParser$S(queryParser, queryString);
+ this._highlight = QueryStringParser$highlight$LQueryStringParser$(queryParser);
+ summary = this._oktavia.search$ALQuery$(this._queries);
+ if (SearchSummary$size$LSearchSummary$(summary) > 0) {
+ this._result = this._sortResult$LSearchSummary$(summary);
+ this._proposals = [ ];
+ this._currentPage = 1;
+ } else {
+ this._result = [ ];
+ if (this._queries.length > 1) {
+ this._proposals = SearchSummary$getProposal$LSearchSummary$(summary);
+ } else {
+ this._proposals = [ ];
+ }
+ this._currentPage = 1;
+ }
+ callback((_result$0 = this._result).length, Math.ceil(_result$0.length / this._entriesPerPage));
+ } else {
+ this._queryString = queryString;
+ this._callback = callback;
+ }
+};
+
+/**
+ * @return {!number}
+ */
+OktaviaSearch.prototype.resultSize$ = function () {
+ return (this._result.length | 0);
+};
+
+/**
+ * @return {!number}
+ */
+OktaviaSearch.prototype.totalPages$ = function () {
+ return (Math.ceil(this._result.length / this._entriesPerPage) | 0);
+};
+
+/**
+ * @return {!number}
+ */
+OktaviaSearch.prototype.currentPage$ = function () {
+ return this._currentPage;
+};
+
+/**
+ * @param {!number} page
+ */
+OktaviaSearch.prototype.setCurrentPage$I = function (page) {
+ this._currentPage = page;
+};
+
+/**
+ * @return {!boolean}
+ */
+OktaviaSearch.prototype.hasPrevPage$ = function () {
+ return this._currentPage !== 1;
+};
+
+/**
+ * @return {!boolean}
+ */
+OktaviaSearch.prototype.hasNextPage$ = function () {
+ return this._currentPage !== Math.ceil(this._result.length / this._entriesPerPage);
+};
+
+/**
+ * @return {Array.<undefined|!string>}
+ */
+OktaviaSearch.prototype.pageIndexes$ = function () {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var total;
+ /** @type {!number} */
+ var i;
+ result = [ ];
+ total = Math.ceil(this._result.length / this._entriesPerPage);
+ if (total < 10) {
+ for (i = 1; i <= total; i++) {
+ result.push(i + "");
+ }
+ } else {
+ if (this._currentPage <= 5) {
+ for (i = 1; i <= 7; i++) {
+ result.push(i + "");
+ }
+ result.push('...', total + "");
+ } else {
+ if (total - 5 <= this._currentPage) {
+ result.push('1', '...');
+ for (i = total - 8; i <= total; i++) {
+ result.push(i + "");
+ }
+ } else {
+ result.push('1', '...');
+ for (i = this._currentPage - 3; i <= this._currentPage + 3; i++) {
+ result.push(i + "");
+ }
+ result.push('...', total + "");
+ }
+ }
+ }
+ return result;
+};
+
+/**
+ * @return {Array.<undefined|_Result>}
+ */
+OktaviaSearch.prototype.getResult$ = function () {
+ /** @type {Style} */
+ var style;
+ /** @type {!number} */
+ var start;
+ /** @type {!number} */
+ var last;
+ /** @type {Metadata} */
+ var metadata;
+ /** @type {!number} */
+ var num;
+ /** @type {Array.<undefined|_Result>} */
+ var results;
+ /** @type {!number} */
+ var i;
+ /** @type {SearchUnit} */
+ var unit;
+ /** @type {Array.<undefined|!string>} */
+ var info;
+ /** @type {!string} */
+ var content;
+ /** @type {Array.<undefined|Position>} */
+ var positions;
+ /** @type {!number} */
+ var end;
+ /** @type {!boolean} */
+ var split;
+ /** @type {!number} */
+ var j;
+ /** @type {Position} */
+ var pos;
+ /** @type {!string} */
+ var text;
+ /** @type {Oktavia} */
+ var this$0;
+ /** @type {!number} */
+ var position$0;
+ /** @type {!number} */
+ var _currentPage$0;
+ /** @type {!number} */
+ var _entriesPerPage$0;
+ style = new Style$S('html');
+ start = ((_currentPage$0 = this._currentPage) - 1) * (_entriesPerPage$0 = this._entriesPerPage);
+ last = Math.min(_currentPage$0 * _entriesPerPage$0, this._result.length);
+ this$0 = this._oktavia;
+ metadata = this$0._metadatas[this$0._metadataLabels[0]];
+ num = 250;
+ results = [ ];
+ for (i = start; i < last; i++) {
+ unit = this._result[i];
+ info = metadata.getInformation$I(unit.id).split(Oktavia.eob);
+ content = metadata.getContent$I(unit.id);
+ start = 0;
+ positions = SearchUnit$getPositions$LSearchUnit$(unit);
+ if (content.indexOf(info[0]) === 1) {
+ content = content.slice(info[0].length + 2, content.length);
+ start += info[0].length + 2;
+ }
+ end = start + num;
+ split = false;
+ if (positions[0].position > end - positions[0].word.length) {
+ end = positions[0].position + Math.floor(num / 2);
+ split = true;
+ }
+ for (j = positions.length - 1; j > -1; j--) {
+ pos = positions[j];
+ if (pos.position + pos.word.length < end) {
+ content = [ content.slice(0, pos.position - start), style.convert$S('<hit>*</hit>').replace('*', content.slice((position$0 = pos.position) - start, position$0 + pos.word.length - start)), content.slice(pos.position + pos.word.length - start, content.length) ].join('');
+ }
+ }
+ if (split) {
+ text = [ content.slice(0, Math.floor(num / 2)) + ' ...', content.slice(- Math.floor(num / 2), end - start) ].join('<br/>');
+ } else {
+ text = content.slice(0, end - start) + ' ...<br/>';
+ }
+ text = text.replace(Oktavia.eob, ' ').replace(/(<br\/>)(<br\/>)+/, '<br/><br/>');
+ results.push(({title: info[0], url: info[1], content: text, score: unit.score}));
+ }
+ return results;
+};
+
+/**
+ * @return {!string}
+ */
+OktaviaSearch.prototype.getHighlight$ = function () {
+ return this._highlight;
+};
+
+/**
+ * @return {Array.<undefined|_Proposal>}
+ */
+OktaviaSearch.prototype.getProposals$ = function () {
+ /** @type {Style} */
+ var style;
+ /** @type {Array.<undefined|_Proposal>} */
+ var results;
+ /** @type {!number} */
+ var i;
+ /** @type {Proposal} */
+ var proposal;
+ /** @type {Array.<undefined|!string>} */
+ var label;
+ /** @type {Array.<undefined|!string>} */
+ var option;
+ /** @type {!number} */
+ var j;
+ style = new Style$S('html');
+ results = [ ];
+ if (this._queries.length > 1) {
+ for (i = 0; i < this._proposals.length; i++) {
+ proposal = this._proposals[i];
+ if (proposal.expect > 0) {
+ label = [ ];
+ option = [ ];
+ for (j = 0; j < this._queries.length; j++) {
+ if (j !== proposal.omit) {
+ label.push(style.convert$S('<hit>' + this._queries[j].toString() + '</hit>'));
+ option.push(this._queries[j].toString());
+ } else {
+ label.push(style.convert$S('<del>' + this._queries[j].toString() + '</del>'));
+ }
+ }
+ results.push(({options: option.join(' '), label: label.join('&nbsp;'), count: proposal.expect}));
+ }
+ }
+ }
+ return results;
+};
+
+/**
+ * @param {SearchSummary} summary
+ * @return {Array.<undefined|SearchUnit>}
+ */
+OktaviaSearch.prototype._sortResult$LSearchSummary$ = function (summary) {
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var score;
+ /** @type {SearchUnit} */
+ var unit;
+ /** @type {!string} */
+ var pos;
+ /** @type {Position} */
+ var position;
+ for (i = 0; i < summary.result.units.length; i++) {
+ score = 0;
+ unit = summary.result.units[i];
+ for (pos in unit.positions) {
+ position = unit.positions[pos];
+ if (this._oktavia.wordPositionType$I(position.position)) {
+ score += 10;
+ } else {
+ score += 1;
+ }
+ if (! position.stemmed) {
+ score += 2;
+ }
+ }
+ unit.score = (score | 0);
+ }
+ return SearchSummary$getSortedResult$LSearchSummary$(summary);
+};
+
+/**
+ * class _Main$0 extends Object
+ * @constructor
+ */
+function _Main$0() {
+}
+
+/**
+ * @constructor
+ */
+function _Main$0$() {
+};
+
+_Main$0$.prototype = new _Main$0;
+
+/**
+ * @param {Array.<undefined|!string>} args
+ */
+_Main$0.main$AS = function (args) {
+};
+
+var _Main$0$main$AS = _Main$0.main$AS;
+
+/**
+ * class Oktavia extends Object
+ * @constructor
+ */
+function Oktavia() {
+}
+
+/**
+ * @constructor
+ */
+function Oktavia$() {
+ /** @type {Array.<undefined|!string>} */
+ var _utf162compressCode$0;
+ this._compressCode2utf16 = null;
+ this._fmindex = new FMIndex$();
+ this._metadatas = ({ });
+ this._metadataLabels = [ ];
+ this._stemmer = null;
+ this._stemmingResult = ({ });
+ _utf162compressCode$0 = this._utf162compressCode = [ Oktavia.eof, Oktavia.eob, Oktavia.unknown ];
+ _utf162compressCode$0.length = 65536;
+ this._compressCode2utf16 = [ Oktavia.eof, Oktavia.eob, Oktavia.unknown ];
+};
+
+Oktavia$.prototype = new Oktavia;
+
+/**
+ * @param {Stemmer} stemmer
+ */
+Oktavia.prototype.setStemmer$LStemmer$ = function (stemmer) {
+ this._stemmer = stemmer;
+};
+
+/**
+ * @return {Metadata}
+ */
+Oktavia.prototype.getPrimaryMetadata$ = function () {
+ return this._metadatas[this._metadataLabels[0]];
+};
+
+/**
+ * @param {!string} key
+ * @return {Section}
+ */
+Oktavia.prototype.addSection$S = function (key) {
+ /** @type {Section} */
+ var section;
+ if (this._metadataLabels.indexOf(key) !== -1) {
+ throw new Error('Metadata name ' + key + ' is already exists');
+ }
+ this._metadataLabels.push(key);
+ section = new Section$LOktavia$(this);
+ this._metadatas[key] = section;
+ return section;
+};
+
+/**
+ * @param {!string} key
+ * @return {Section}
+ */
+Oktavia.prototype.getSection$S = function (key) {
+ if (this._metadataLabels.indexOf(key) === -1) {
+ throw new Error('Metadata name ' + key + " does't exists");
+ }
+ return this._metadatas[key];
+};
+
+/**
+ * @param {!string} key
+ * @return {Splitter}
+ */
+Oktavia.prototype.addSplitter$S = function (key) {
+ /** @type {Splitter} */
+ var splitter;
+ if (this._metadataLabels.indexOf(key) !== -1) {
+ throw new Error('Metadata name ' + key + ' is already exists');
+ }
+ this._metadataLabels.push(key);
+ splitter = new Splitter$LOktavia$(this);
+ this._metadatas[key] = splitter;
+ return splitter;
+};
+
+/**
+ * @param {!string} key
+ * @return {Splitter}
+ */
+Oktavia.prototype.getSplitter$S = function (key) {
+ if (this._metadataLabels.indexOf(key) === -1) {
+ throw new Error('Metadata name ' + key + " does't exists");
+ }
+ return this._metadatas[key];
+};
+
+/**
+ * @param {!string} key
+ * @param {Array.<undefined|!string>} headers
+ * @return {Table}
+ */
+Oktavia.prototype.addTable$SAS = function (key, headers) {
+ /** @type {Table} */
+ var table;
+ if (this._metadataLabels.indexOf(key) !== -1) {
+ throw new Error('Metadata name ' + key + ' is already exists');
+ }
+ this._metadataLabels.push(key);
+ table = new Table$LOktavia$AS(this, headers);
+ this._metadatas[key] = table;
+ return table;
+};
+
+/**
+ * @param {!string} key
+ * @return {Table}
+ */
+Oktavia.prototype.getTable$S = function (key) {
+ if (this._metadataLabels.indexOf(key) === -1) {
+ throw new Error('Metadata name ' + key + " does't exists");
+ }
+ return this._metadatas[key];
+};
+
+/**
+ * @param {!string} key
+ * @return {Block}
+ */
+Oktavia.prototype.addBlock$S = function (key) {
+ /** @type {Block} */
+ var block;
+ if (this._metadataLabels.indexOf(key) !== -1) {
+ throw new Error('Metadata name ' + key + ' is already exists');
+ }
+ this._metadataLabels.push(key);
+ block = new Block$LOktavia$(this);
+ this._metadatas[key] = block;
+ return block;
+};
+
+/**
+ * @param {!string} key
+ * @return {Block}
+ */
+Oktavia.prototype.getBlock$S = function (key) {
+ if (this._metadataLabels.indexOf(key) === -1) {
+ throw new Error('Metadata name ' + key + " does't exists");
+ }
+ return this._metadatas[key];
+};
+
+/**
+ */
+Oktavia.prototype.addEndOfBlock$ = function () {
+ this._fmindex.push$S(Oktavia.eob);
+};
+
+/**
+ * @param {!string} words
+ */
+Oktavia.prototype.addWord$S = function (words) {
+ /** @type {Array.<undefined|!string>} */
+ var str;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var charCode;
+ /** @type {undefined|!string} */
+ var newCharCode;
+ str = [ ];
+ str.length = words.length;
+ for (i = 0; i < words.length; i++) {
+ charCode = words.charCodeAt(i);
+ newCharCode = this._utf162compressCode[charCode];
+ if (newCharCode == null) {
+ newCharCode = String.fromCharCode(this._compressCode2utf16.length);
+ this._utf162compressCode[charCode] = newCharCode;
+ this._compressCode2utf16.push(String.fromCharCode(charCode));
+ }
+ str.push(newCharCode);
+ }
+ this._fmindex.push$S(str.join(''));
+};
+
+/**
+ * @param {!string} words
+ * @param {!boolean} stemming
+ */
+Oktavia.prototype.addWord$SB = function (words, stemming) {
+ /** @type {Array.<undefined|!string>} */
+ var wordList;
+ /** @type {!number} */
+ var i;
+ /** @type {undefined|!string} */
+ var originalWord;
+ /** @type {!string} */
+ var smallWord;
+ /** @type {undefined|!string} */
+ var registerWord;
+ /** @type {!string} */
+ var baseWord;
+ /** @type {!string} */
+ var compressedCodeWord;
+ /** @type {Array.<undefined|!string>} */
+ var stemmedList;
+ this.addWord$S(words);
+ wordList = words.split(/\s+/);
+ for (i = 0; i < wordList.length; i++) {
+ originalWord = wordList[i];
+ smallWord = originalWord.slice(0, 1).toLowerCase() + originalWord.slice(1);
+ registerWord = null;
+ if (stemming && this._stemmer) {
+ baseWord = this._stemmer.stemWord$S(originalWord.toLowerCase());
+ if (originalWord.indexOf(baseWord) === -1) {
+ registerWord = baseWord;
+ }
+ } else {
+ if (originalWord != smallWord) {
+ registerWord = smallWord;
+ }
+ }
+ if (registerWord) {
+ compressedCodeWord = this._convertToCompressionCode$S(originalWord);
+ stemmedList = this._stemmingResult[registerWord];
+ if (! stemmedList) {
+ stemmedList = [ compressedCodeWord ];
+ this._stemmingResult[registerWord] = stemmedList;
+ } else {
+ if (stemmedList.indexOf(compressedCodeWord) === -1) {
+ stemmedList.push(compressedCodeWord);
+ }
+ }
+ }
+ }
+};
+
+/**
+ * @param {!string} keyword
+ * @return {!string}
+ */
+Oktavia.prototype._convertToCompressionCode$S = function (keyword) {
+ /** @type {Array.<undefined|!string>} */
+ var resultChars;
+ /** @type {!number} */
+ var i;
+ /** @type {undefined|!string} */
+ var chr;
+ resultChars = [ ];
+ for (i = 0; i < keyword.length; i++) {
+ chr = this._utf162compressCode[keyword.charCodeAt(i)];
+ if (chr == null) {
+ resultChars.push(Oktavia.unknown);
+ } else {
+ resultChars.push(chr);
+ }
+ }
+ return resultChars.join('');
+};
+
+/**
+ * @param {!string} keyword
+ * @param {!boolean} stemming
+ * @return {Array.<undefined|!number>}
+ */
+Oktavia.prototype.rawSearch$SB = function (keyword, stemming) {
+ /** @type {Array.<undefined|!number>} */
+ var result;
+ /** @type {!string} */
+ var baseWord;
+ /** @type {Array.<undefined|!string>} */
+ var stemmedList;
+ /** @type {!number} */
+ var i;
+ /** @type {undefined|!string} */
+ var word;
+ if (stemming) {
+ result = [ ];
+ if (this._stemmer) {
+ baseWord = this._stemmer.stemWord$S(keyword.toLowerCase());
+ stemmedList = this._stemmingResult[baseWord];
+ if (stemmedList) {
+ for (i = 0; i < stemmedList.length; i++) {
+ word = stemmedList[i];
+ result = result.concat(this._fmindex.search$S(word));
+ }
+ }
+ }
+ } else {
+ result = this._fmindex.search$S(this._convertToCompressionCode$S(keyword));
+ }
+ return result;
+};
+
+/**
+ * @param {Array.<undefined|Query>} queries
+ * @return {SearchSummary}
+ */
+Oktavia.prototype.search$ALQuery$ = function (queries) {
+ /** @type {SearchSummary} */
+ var summary;
+ /** @type {!number} */
+ var i;
+ /** @type {SingleResult} */
+ var result$0;
+ summary = ({sourceResults: [ ], result: null, oktavia: this});
+ for (i = 0; i < queries.length; i++) {
+ result$0 = this._searchQuery$LQuery$(queries[i]);
+ summary.sourceResults.push(result$0);
+ }
+ summary.result = SearchSummary$mergeResult$LSearchSummary$ALSingleResult$(summary, summary.sourceResults);
+ return summary;
+};
+
+/**
+ * @param {Query} query
+ * @return {SingleResult}
+ */
+Oktavia.prototype._searchQuery$LQuery$ = function (query) {
+ /** @type {SingleResult} */
+ var result;
+ /** @type {Array.<undefined|!number>} */
+ var positions;
+ result = new SingleResult$SBB(query.word, query.or, query.not);
+ if (query.raw) {
+ positions = this.rawSearch$SB(query.word, false);
+ } else {
+ positions = this.rawSearch$SB(query.word, false).concat(this.rawSearch$SB(query.word, true));
+ }
+ this._metadatas[this._metadataLabels[0]].grouping$LSingleResult$AISB(result, positions, query.word, ! query.raw);
+ return result;
+};
+
+/**
+ */
+Oktavia.prototype.build$ = function () {
+ this.build$IB(5, false);
+};
+
+/**
+ * @param {!number} cacheDensity
+ * @param {!boolean} verbose
+ */
+Oktavia.prototype.build$IB = function (cacheDensity, verbose) {
+ /** @type {!string} */
+ var key;
+ /** @type {!number} */
+ var cacheRange;
+ /** @type {!number} */
+ var maxChar;
+ for (key in this._metadatas) {
+ this._metadatas[key]._build$();
+ }
+ cacheRange = Math.round(Math.max(1, 100 / Math.min(100, Math.max(0.01, cacheDensity))));
+ maxChar = this._compressCode2utf16.length;
+ this._fmindex.build$SIIB(Oktavia.eof, maxChar, cacheRange, verbose);
+};
+
+/**
+ * @return {!string}
+ */
+Oktavia.prototype.dump$ = function () {
+ return this.dump$B(false);
+};
+
+/**
+ * @param {!boolean} verbose
+ * @return {!string}
+ */
+Oktavia.prototype.dump$B = function (verbose) {
+ /** @type {!string} */
+ var header;
+ /** @type {!string} */
+ var fmdata;
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var i;
+ /** @type {CompressionReport} */
+ var report;
+ /** @type {undefined|!string} */
+ var name;
+ /** @type {!string} */
+ var data;
+ header = Binary$dumpString$SLCompressionReport$("oktavia-01", null).slice(1);
+ if (verbose) {
+ console.log("Source text size: " + (this._fmindex.size$() * 2 + "") + ' bytes');
+ }
+ fmdata = this._fmindex.dump$B(verbose);
+ result = [ header, fmdata ];
+ result.push(Binary$dump16bitNumber$I(this._compressCode2utf16.length));
+ for (i = 3; i < this._compressCode2utf16.length; i++) {
+ result.push(this._compressCode2utf16[i]);
+ }
+ if (verbose) {
+ console.log('Char Code Map: ' + (this._compressCode2utf16.length * 2 - 2 + "") + ' bytes');
+ }
+ report = ({source: 0, result: 0});
+ result.push(Binary$dumpStringListMap$HASLCompressionReport$(this._stemmingResult, report));
+ if (verbose) {
+ console.log('Stemmed Word Table: ' + (result[result.length - 1].length + "") + ' bytes (' + (Math.round(report.result * 100.0 / report.source) + "") + '%)');
+ }
+ result.push(Binary$dump16bitNumber$I(this._metadataLabels.length));
+ for (i = 0; i < this._metadataLabels.length; i++) {
+ report = ({source: 0, result: 0});
+ name = this._metadataLabels[i];
+ data = this._metadatas[name]._dump$LCompressionReport$(report);
+ result.push(Binary$dumpString$SLCompressionReport$(name, report), data);
+ if (verbose) {
+ console.log('Meta Data ' + name + ': ' + (data.length * 2 + "") + ' bytes (' + (Math.round(report.result * 100.0 / report.source) + "") + '%)');
+ }
+ }
+ return result.join('');
+};
+
+/**
+ * @param {!string} data
+ */
+Oktavia.prototype.load$S = function (data) {
+ /** @type {!string} */
+ var header;
+ /** @type {!number} */
+ var offset;
+ /** @type {!number} */
+ var charCodeCount;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var charCode;
+ /** @type {LoadedStringListMapResult} */
+ var stemmedWords;
+ /** @type {!number} */
+ var metadataCount;
+ /** @type {LoadedStringResult} */
+ var nameResult;
+ /** @type {!string} */
+ var name;
+ /** @type {!number} */
+ var type;
+ header = Binary$dumpString$SLCompressionReport$("oktavia-01", null).slice(1);
+ if (data.slice(0, 5) !== header) {
+ throw new Error('Invalid data file');
+ }
+ this._metadatas = ({ });
+ this._metadataLabels = [ ];
+ offset = 5;
+ offset = this._fmindex.load$SI(data, offset);
+ charCodeCount = Binary$load16bitNumber$SI(data, offset++);
+ this._compressCode2utf16 = [ Oktavia.eof, Oktavia.eob, Oktavia.unknown ];
+ this._utf162compressCode = [ Oktavia.eof, Oktavia.eob, Oktavia.unknown ];
+ for (i = 3; i < charCodeCount; i++) {
+ charCode = Binary$load16bitNumber$SI(data, offset++);
+ this._compressCode2utf16.push(String.fromCharCode(charCode));
+ this._utf162compressCode[charCode] = String.fromCharCode(i);
+ }
+ stemmedWords = Binary$loadStringListMap$SI(data, offset);
+ this._stemmingResult = stemmedWords.result;
+ offset = stemmedWords.offset;
+ metadataCount = Binary$load16bitNumber$SI(data, offset++);
+ for (i = 0; i < metadataCount; i++) {
+ nameResult = Binary$loadString$SI(data, offset);
+ name = nameResult.result;
+ offset = nameResult.offset;
+ type = Binary$load16bitNumber$SI(data, offset++);
+ switch (type) {
+ case 0:
+ offset = Section$_load$LOktavia$SSI(this, name, data, offset);
+ break;
+ case 1:
+ offset = Splitter$_load$LOktavia$SSI(this, name, data, offset);
+ break;
+ case 2:
+ offset = Table$_load$LOktavia$SSI(this, name, data, offset);
+ break;
+ case 3:
+ offset = Block$_load$LOktavia$SSI(this, name, data, offset);
+ break;
+ }
+ }
+};
+
+/**
+ * @return {!number}
+ */
+Oktavia.prototype.contentSize$ = function () {
+ /** @type {FMIndex} */
+ var this$0;
+ this$0 = this._fmindex;
+ return this$0._substr.length;
+};
+
+/**
+ * @param {!number} position
+ * @return {!number}
+ */
+Oktavia.prototype.wordPositionType$I = function (position) {
+ /** @type {!number} */
+ var result;
+ /** @type {!string} */
+ var ahead;
+ result = 0;
+ if (position === 0) {
+ result = 4;
+ } else {
+ ahead = this._fmindex.getSubstring$II(position - 1, 1);
+ if (/\s/.test(ahead)) {
+ result = 2;
+ } else {
+ if (/\W/.test(ahead)) {
+ result = 1;
+ } else {
+ if (Oktavia.eob === ahead) {
+ result = 3;
+ }
+ }
+ }
+ }
+ return (result | 0);
+};
+
+/**
+ * @param {!number} position
+ * @param {!number} length
+ * @return {!string}
+ */
+Oktavia.prototype._getSubstring$II = function (position, length) {
+ /** @type {!string} */
+ var result;
+ /** @type {Array.<undefined|!string>} */
+ var str;
+ /** @type {!number} */
+ var i;
+ result = this._fmindex.getSubstring$II(position, length);
+ str = [ ];
+ for (i = 0; i < result.length; i++) {
+ str.push(this._compressCode2utf16[result.charCodeAt(i)]);
+ }
+ return str.join('');
+};
+
+/**
+ * class Binary extends Object
+ * @constructor
+ */
+function Binary() {
+}
+
+/**
+ * @constructor
+ */
+function Binary$() {
+};
+
+Binary$.prototype = new Binary;
+
+/**
+ * @param {!number} num
+ * @return {!string}
+ */
+Binary.dump32bitNumber$N = function (num) {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ result = [ String.fromCharCode(Math.floor(num / 65536)) ];
+ result.push(String.fromCharCode(num % 65536));
+ return result.join("");
+};
+
+var Binary$dump32bitNumber$N = Binary.dump32bitNumber$N;
+
+/**
+ * @param {!string} buffer
+ * @param {!number} offset
+ * @return {!number}
+ */
+Binary.load32bitNumber$SI = function (buffer, offset) {
+ /** @type {!number} */
+ var result;
+ result = buffer.charCodeAt(offset) * 65536 + buffer.charCodeAt(offset + 1);
+ return result;
+};
+
+var Binary$load32bitNumber$SI = Binary.load32bitNumber$SI;
+
+/**
+ * @param {!number} num
+ * @return {!string}
+ */
+Binary.dump16bitNumber$I = function (num) {
+ return String.fromCharCode(num % 65536);
+};
+
+var Binary$dump16bitNumber$I = Binary.dump16bitNumber$I;
+
+/**
+ * @param {!string} buffer
+ * @param {!number} offset
+ * @return {!number}
+ */
+Binary.load16bitNumber$SI = function (buffer, offset) {
+ return (buffer.charCodeAt(offset) | 0);
+};
+
+var Binary$load16bitNumber$SI = Binary.load16bitNumber$SI;
+
+/**
+ * @param {!string} str
+ * @return {!string}
+ */
+Binary.dumpString$S = function (str) {
+ return Binary$dumpString$SLCompressionReport$(str, null);
+};
+
+var Binary$dumpString$S = Binary.dumpString$S;
+
+/**
+ * @param {!string} str
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+Binary.dumpString$SLCompressionReport$ = function (str, report) {
+ /** @type {!number} */
+ var length;
+ /** @type {!boolean} */
+ var compress;
+ /** @type {Array.<undefined|!number>} */
+ var charCodes;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var charCode;
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {undefined|!number} */
+ var bytes;
+ if (str.length > 32768) {
+ str = str.slice(0, 32768);
+ }
+ length = str.length;
+ compress = true;
+ charCodes = [ ];
+ for (i = 0; i < length; i++) {
+ charCode = str.charCodeAt(i);
+ if (charCode > 255) {
+ compress = false;
+ break;
+ }
+ charCodes.push(charCode);
+ }
+ if (compress) {
+ result = [ Binary$dump16bitNumber$I(length + 32768) ];
+ for (i = 0; i < length; i += 2) {
+ bytes = charCodes[i];
+ if (i !== length - 1) {
+ bytes += charCodes[i + 1] << 8;
+ }
+ result.push(String.fromCharCode(bytes % 65536));
+ }
+ if (report) {
+ CompressionReport$add$LCompressionReport$II(report, length, Math.ceil(length / 2));
+ }
+ } else {
+ result = [ Binary$dump16bitNumber$I(length), str ];
+ if (report) {
+ CompressionReport$add$LCompressionReport$II(report, length, length);
+ }
+ }
+ return result.join('');
+};
+
+var Binary$dumpString$SLCompressionReport$ = Binary.dumpString$SLCompressionReport$;
+
+/**
+ * @param {!string} buffer
+ * @param {!number} offset
+ * @return {LoadedStringResult}
+ */
+Binary.loadString$SI = function (buffer, offset) {
+ return new LoadedStringResult$SI(buffer, offset);
+};
+
+var Binary$loadString$SI = Binary.loadString$SI;
+
+/**
+ * @param {Array.<undefined|!string>} strList
+ * @return {!string}
+ */
+Binary.dumpStringList$AS = function (strList) {
+ return Binary$dumpStringList$ASLCompressionReport$(strList, null);
+};
+
+var Binary$dumpStringList$AS = Binary.dumpStringList$AS;
+
+/**
+ * @param {Array.<undefined|!string>} strList
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+Binary.dumpStringList$ASLCompressionReport$ = function (strList, report) {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var i;
+ result = [ Binary$dump32bitNumber$N(strList.length) ];
+ for (i = 0; i < strList.length; i++) {
+ result.push(Binary$dumpString$SLCompressionReport$(strList[i], report));
+ }
+ return result.join('');
+};
+
+var Binary$dumpStringList$ASLCompressionReport$ = Binary.dumpStringList$ASLCompressionReport$;
+
+/**
+ * @param {!string} buffer
+ * @param {!number} offset
+ * @return {LoadedStringListResult}
+ */
+Binary.loadStringList$SI = function (buffer, offset) {
+ return new LoadedStringListResult$SI(buffer, offset);
+};
+
+var Binary$loadStringList$SI = Binary.loadStringList$SI;
+
+/**
+ * @param {Object.<string, undefined|Array.<undefined|!string>>} strMap
+ * @return {!string}
+ */
+Binary.dumpStringListMap$HAS = function (strMap) {
+ return Binary$dumpStringListMap$HASLCompressionReport$(strMap, null);
+};
+
+var Binary$dumpStringListMap$HAS = Binary.dumpStringListMap$HAS;
+
+/**
+ * @param {Object.<string, undefined|Array.<undefined|!string>>} strMap
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+Binary.dumpStringListMap$HASLCompressionReport$ = function (strMap, report) {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var counter;
+ /** @type {!string} */
+ var key;
+ result = [ ];
+ counter = 0;
+ for (key in strMap) {
+ result.push(Binary$dumpString$SLCompressionReport$(key, report));
+ result.push(Binary$dumpStringList$ASLCompressionReport$(strMap[key], report));
+ counter++;
+ }
+ return Binary$dump32bitNumber$N(counter) + result.join('');
+};
+
+var Binary$dumpStringListMap$HASLCompressionReport$ = Binary.dumpStringListMap$HASLCompressionReport$;
+
+/**
+ * @param {!string} buffer
+ * @param {!number} offset
+ * @return {LoadedStringListMapResult}
+ */
+Binary.loadStringListMap$SI = function (buffer, offset) {
+ return new LoadedStringListMapResult$SI(buffer, offset);
+};
+
+var Binary$loadStringListMap$SI = Binary.loadStringListMap$SI;
+
+/**
+ * @param {Array.<undefined|!number>} array
+ * @return {!string}
+ */
+Binary.dump32bitNumberList$AN = function (array) {
+ return Binary$dump32bitNumberList$ANLCompressionReport$(array, null);
+};
+
+var Binary$dump32bitNumberList$AN = Binary.dump32bitNumberList$AN;
+
+/**
+ * @param {Array.<undefined|!number>} array
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+Binary.dump32bitNumberList$ANLCompressionReport$ = function (array, report) {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var index;
+ /** @type {!number} */
+ var inputLength;
+ /** @type {!number} */
+ var length;
+ /** @type {!string} */
+ var resultString;
+ /** @type {!number} */
+ var value1$0;
+ /** @type {!number} */
+ var value2$0;
+ result = [ Binary$dump32bitNumber$N(array.length) ];
+ index = 0;
+ inputLength = array.length;
+ while (index < inputLength) {
+ if (array[index] == 0) {
+ length = Binary$_countZero$ANI(array, index);
+ result.push(Binary$_zeroBlock$I(length));
+ index += length;
+ } else {
+ if (Binary$_shouldZebraCode$ANI(array, index)) {
+ result.push(Binary$_createZebraCode$ANI(array, index));
+ value1$0 = array.length;
+ value2$0 = index + 15;
+ index = (value1$0 <= value2$0 ? value1$0 : value2$0);
+ } else {
+ length = Binary$_searchDoubleZero$ANI(array, index);
+ result.push(Binary$_nonZeroBlock$ANII(array, index, length));
+ if (length === 0) {
+ throw new Error('');
+ }
+ index += length;
+ }
+ }
+ }
+ resultString = result.join('');
+ if (report) {
+ CompressionReport$add$LCompressionReport$II(report, array.length * 2 + 2, resultString.length);
+ }
+ return resultString;
+};
+
+var Binary$dump32bitNumberList$ANLCompressionReport$ = Binary.dump32bitNumberList$ANLCompressionReport$;
+
+/**
+ * @param {!string} buffer
+ * @param {!number} offset
+ * @return {LoadedNumberListResult}
+ */
+Binary.load32bitNumberList$SI = function (buffer, offset) {
+ return new LoadedNumberListResult$SI(buffer, offset);
+};
+
+var Binary$load32bitNumberList$SI = Binary.load32bitNumberList$SI;
+
+/**
+ * @param {Array.<undefined|!number>} array
+ * @param {!number} offset
+ * @return {!number}
+ */
+Binary._countZero$ANI = function (array, offset) {
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var array$len$0;
+ for ((i = offset, array$len$0 = array.length); i < array$len$0; i++) {
+ if (array[i] != 0) {
+ return (i - offset | 0);
+ }
+ }
+ return (array.length - offset | 0);
+};
+
+var Binary$_countZero$ANI = Binary._countZero$ANI;
+
+/**
+ * @param {!number} length
+ * @return {!string}
+ */
+Binary._zeroBlock$I = function (length) {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ result = [ ];
+ while (length > 0) {
+ if (length > 16384) {
+ result.push(Binary$dump16bitNumber$I(16383));
+ length -= 16384;
+ } else {
+ result.push(Binary$dump16bitNumber$I(length - 1));
+ length = 0;
+ }
+ }
+ return result.join('');
+};
+
+var Binary$_zeroBlock$I = Binary._zeroBlock$I;
+
+/**
+ * @param {Array.<undefined|!number>} array
+ * @param {!number} offset
+ * @return {!boolean}
+ */
+Binary._shouldZebraCode$ANI = function (array, offset) {
+ /** @type {!number} */
+ var change;
+ /** @type {!boolean} */
+ var isLastZero;
+ /** @type {!number} */
+ var i;
+ if (array.length - offset < 16) {
+ return true;
+ }
+ change = 0;
+ isLastZero = false;
+ for (i = offset; i < offset + 15; i++) {
+ if (array[i] == 0) {
+ if (! isLastZero) {
+ isLastZero = true;
+ change++;
+ }
+ } else {
+ if (isLastZero) {
+ isLastZero = false;
+ change++;
+ }
+ }
+ }
+ return change > 2;
+};
+
+var Binary$_shouldZebraCode$ANI = Binary._shouldZebraCode$ANI;
+
+/**
+ * @param {Array.<undefined|!number>} array
+ * @param {!number} offset
+ * @return {!number}
+ */
+Binary._searchDoubleZero$ANI = function (array, offset) {
+ /** @type {!boolean} */
+ var isLastZero;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var array$len$0;
+ isLastZero = false;
+ for ((i = offset, array$len$0 = array.length); i < array$len$0; i++) {
+ if (array[i] == 0) {
+ if (isLastZero) {
+ return (i - offset - 1 | 0);
+ }
+ isLastZero = true;
+ } else {
+ isLastZero = false;
+ }
+ }
+ return (array.length - offset | 0);
+};
+
+var Binary$_searchDoubleZero$ANI = Binary._searchDoubleZero$ANI;
+
+/**
+ * @param {Array.<undefined|!number>} array
+ * @param {!number} offset
+ * @param {!number} length
+ * @return {!string}
+ */
+Binary._nonZeroBlock$ANII = function (array, offset, length) {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var blockLength;
+ /** @type {!number} */
+ var i;
+ result = [ ];
+ while (length > 0) {
+ if (length > 16384) {
+ blockLength = 16384;
+ length -= 16384;
+ } else {
+ blockLength = length;
+ length = 0;
+ }
+ result.push(Binary$dump16bitNumber$I(blockLength - 1 + 0x4000));
+ for (i = offset; i < offset + blockLength; i++) {
+ result.push(Binary$dump32bitNumber$N(array[i]));
+ }
+ offset += blockLength;
+ }
+ return result.join('');
+};
+
+var Binary$_nonZeroBlock$ANII = Binary._nonZeroBlock$ANII;
+
+/**
+ * @param {Array.<undefined|!number>} array
+ * @param {!number} offset
+ * @return {!string}
+ */
+Binary._createZebraCode$ANI = function (array, offset) {
+ /** @type {!number} */
+ var last;
+ /** @type {!number} */
+ var code;
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var value1$0;
+ /** @type {!number} */
+ var value2$0;
+ value1$0 = offset + 15;
+ value2$0 = array.length;
+ last = (value1$0 <= value2$0 ? value1$0 : value2$0);
+ code = 0x8000;
+ result = [ ];
+ for (i = offset; i < last; i++) {
+ if (array[i] != 0) {
+ result.push(Binary$dump32bitNumber$N(array[i]));
+ code = code + (0x1 << i - offset);
+ }
+ }
+ return String.fromCharCode(code) + result.join('');
+};
+
+var Binary$_createZebraCode$ANI = Binary._createZebraCode$ANI;
+
+/**
+ * @param {!string} str
+ * @return {!string}
+ */
+Binary.base64encode$S = function (str) {
+ /** @type {Array.<undefined|!string>} */
+ var out;
+ /** @type {Array.<undefined|!number>} */
+ var source;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var code;
+ /** @type {!number} */
+ var len;
+ /** @type {!number} */
+ var c1;
+ /** @type {undefined|!number} */
+ var c2;
+ /** @type {undefined|!number} */
+ var c3;
+ out = [ ];
+ source = [ ];
+ for (i = 0; i < str.length; i++) {
+ code = str.charCodeAt(i);
+ source.push(code & 0x00ff, code >>> 8);
+ }
+ len = str.length * 2;
+ i = 0;
+ while (i < len) {
+ c1 = source[i++] & 0xff;
+ if (i === len) {
+ out.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(c1 >> 2));
+ out.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((c1 & 0x3) << 4));
+ out.push("==");
+ break;
+ }
+ c2 = source[i++];
+ if (i === len) {
+ out.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(c1 >> 2));
+ out.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((c1 & 0x3) << 4 | (c2 & 0xF0) >> 4));
+ out.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((c2 & 0xF) << 2));
+ out.push("=");
+ break;
+ }
+ c3 = source[i++];
+ out.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(c1 >> 2));
+ out.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((c1 & 0x3) << 4 | (c2 & 0xF0) >> 4));
+ out.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((c2 & 0xF) << 2 | (c3 & 0xC0) >> 6));
+ out.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(c3 & 0x3F));
+ }
+ return out.join('');
+};
+
+var Binary$base64encode$S = Binary.base64encode$S;
+
+/**
+ * @param {Array.<undefined|!number>} source
+ * @return {!string}
+ */
+Binary._mergeCharCode$AI = function (source) {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var i;
+ result = [ ];
+ for (i = 0; i < source.length; i += 2) {
+ result.push(String.fromCharCode(source[i] + (source[i + 1] << 8)));
+ }
+ return result.join('');
+};
+
+var Binary$_mergeCharCode$AI = Binary._mergeCharCode$AI;
+
+/**
+ * @param {!string} str
+ * @return {!string}
+ */
+Binary.base64decode$S = function (str) {
+ /** @type {!number} */
+ var len;
+ /** @type {!number} */
+ var i;
+ /** @type {Array.<undefined|!number>} */
+ var out;
+ /** @type {undefined|!number} */
+ var c1;
+ /** @type {undefined|!number} */
+ var c2;
+ /** @type {!number} */
+ var c3;
+ /** @type {!number} */
+ var c4;
+ len = str.length;
+ i = 0;
+ out = [ ];
+ while (i < len) {
+ do {
+ c1 = Binary._base64DecodeChars[str.charCodeAt(i++) & 0xff];
+ } while (i < len && c1 == -1);
+ if (c1 == -1) {
+ break;
+ }
+ do {
+ c2 = Binary._base64DecodeChars[str.charCodeAt(i++) & 0xff];
+ } while (i < len && c2 == -1);
+ if (c2 == -1) {
+ break;
+ }
+ out.push(c1 << 2 | (c2 & 0x30) >> 4);
+ do {
+ c3 = str.charCodeAt(i++) & 0xff;
+ if (c3 === 61) {
+ return Binary$_mergeCharCode$AI(out);
+ }
+ c3 = Binary._base64DecodeChars[c3];
+ } while (i < len && c3 === -1);
+ if (c3 === -1) {
+ break;
+ }
+ out.push((c2 & 0XF) << 4 | (c3 & 0x3C) >> 2);
+ do {
+ c4 = str.charCodeAt(i++) & 0xff;
+ if (c4 === 61) {
+ return Binary$_mergeCharCode$AI(out);
+ }
+ c4 = (Binary._base64DecodeChars[c4] | 0);
+ } while (i < len && c4 === -1);
+ if (c4 === -1) {
+ break;
+ }
+ out.push((c3 & 0x03) << 6 | c4);
+ }
+ return Binary$_mergeCharCode$AI(out);
+};
+
+var Binary$base64decode$S = Binary.base64decode$S;
+
+/**
+ * class LoadedStringResult extends Object
+ * @constructor
+ */
+function LoadedStringResult() {
+}
+
+/**
+ * @constructor
+ * @param {!string} data
+ * @param {!number} offset
+ */
+function LoadedStringResult$SI(data, offset) {
+ /** @type {!number} */
+ var strLength;
+ /** @type {Array.<undefined|!string>} */
+ var bytes;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var code;
+ /** @type {!number} */
+ var offset$0;
+ this.result = "";
+ this.offset = 0;
+ offset$0 = offset++;
+ strLength = data.charCodeAt(offset$0);
+ if (strLength > 32767) {
+ strLength = strLength - 32768;
+ bytes = [ ];
+ for (i = 0; i < strLength; i += 2) {
+ code = data.charCodeAt(offset);
+ bytes.push(String.fromCharCode(code & 0x00ff));
+ if (i !== strLength - 1) {
+ bytes.push(String.fromCharCode(code >>> 8));
+ }
+ offset++;
+ }
+ this.result = bytes.join('');
+ this.offset = offset;
+ } else {
+ this.result = data.slice(offset, offset + strLength);
+ this.offset = (offset + strLength | 0);
+ }
+};
+
+LoadedStringResult$SI.prototype = new LoadedStringResult;
+
+/**
+ * class LoadedStringListResult extends Object
+ * @constructor
+ */
+function LoadedStringListResult() {
+}
+
+/**
+ * @constructor
+ * @param {!string} data
+ * @param {!number} offset
+ */
+function LoadedStringListResult$SI(data, offset) {
+ /** @type {!number} */
+ var length;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var strLength;
+ /** @type {!string} */
+ var resultStr;
+ /** @type {Array.<undefined|!string>} */
+ var bytes;
+ /** @type {!number} */
+ var j;
+ /** @type {!number} */
+ var code;
+ /** @type {!number} */
+ var result$0;
+ /** @type {!number} */
+ var offset$0;
+ this.offset = 0;
+ this.result = [ ];
+ result$0 = data.charCodeAt(offset) * 65536 + data.charCodeAt(offset + 1);
+ length = result$0;
+ offset += 2;
+ for (i = 0; i < length; i++) {
+ offset$0 = offset++;
+ strLength = data.charCodeAt(offset$0);
+ if (strLength > 32767) {
+ strLength = strLength - 32768;
+ bytes = [ ];
+ for (j = 0; j < strLength; j += 2) {
+ code = data.charCodeAt(offset);
+ bytes.push(String.fromCharCode(code & 0x00ff));
+ if (j !== strLength - 1) {
+ bytes.push(String.fromCharCode(code >>> 8));
+ }
+ offset++;
+ }
+ resultStr = bytes.join('');
+ } else {
+ resultStr = data.slice(offset, offset + strLength);
+ offset = (offset + strLength | 0);
+ }
+ this.result.push(resultStr);
+ }
+ this.offset = offset;
+};
+
+LoadedStringListResult$SI.prototype = new LoadedStringListResult;
+
+/**
+ * class LoadedStringListMapResult extends Object
+ * @constructor
+ */
+function LoadedStringListMapResult() {
+}
+
+/**
+ * @constructor
+ * @param {!string} data
+ * @param {!number} offset
+ */
+function LoadedStringListMapResult$SI(data, offset) {
+ /** @type {!number} */
+ var length;
+ /** @type {!number} */
+ var i;
+ /** @type {LoadedStringResult} */
+ var keyResult;
+ /** @type {LoadedStringListResult} */
+ var valueResult;
+ /** @type {!number} */
+ var result$0;
+ /** @type {!number} */
+ var offset$0;
+ this.offset = 0;
+ this.result = ({ });
+ result$0 = data.charCodeAt(offset) * 65536 + data.charCodeAt(offset + 1);
+ length = result$0;
+ offset += 2;
+ for (i = 0; i < length; i++) {
+ keyResult = new LoadedStringResult$SI(data, offset);
+ offset$0 = keyResult.offset;
+ valueResult = new LoadedStringListResult$SI(data, offset$0);
+ this.result[keyResult.result] = valueResult.result;
+ offset = valueResult.offset;
+ }
+ this.offset = offset;
+};
+
+LoadedStringListMapResult$SI.prototype = new LoadedStringListMapResult;
+
+/**
+ * class LoadedNumberListResult extends Object
+ * @constructor
+ */
+function LoadedNumberListResult() {
+}
+
+/**
+ * @constructor
+ * @param {!string} data
+ * @param {!number} offset
+ */
+function LoadedNumberListResult$SI(data, offset) {
+ /** @type {!number} */
+ var resultLength;
+ /** @type {!number} */
+ var originalOffset;
+ /** @type {Array.<undefined|!number>} */
+ var result;
+ /** @type {!number} */
+ var tag;
+ /** @type {!number} */
+ var length;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var result$0;
+ /** @type {!number} */
+ var value1$0;
+ this.result = null;
+ this.offset = 0;
+ result$0 = data.charCodeAt(offset) * 65536 + data.charCodeAt(offset + 1);
+ resultLength = result$0;
+ originalOffset = offset;
+ offset += 2;
+ result = [ ];
+ while (result.length < resultLength) {
+ tag = data.charCodeAt(offset++);
+ if (tag >>> 15 === 1) {
+ value1$0 = resultLength - result.length;
+ length = (value1$0 <= 15 ? value1$0 : 15);
+ for (i = 0; i < length; i++) {
+ if (tag >>> i & 0x1) {
+ result.push(Binary$load32bitNumber$SI(data, offset));
+ offset += 2;
+ } else {
+ result.push(0);
+ }
+ }
+ } else {
+ if (tag >>> 14 === 1) {
+ length = tag - 0x4000 + 1;
+ for (i = 0; i < length; i++) {
+ result.push(Binary$load32bitNumber$SI(data, offset));
+ offset += 2;
+ }
+ } else {
+ length = tag + 1;
+ for (i = 0; i < length; i++) {
+ result.push(0);
+ }
+ }
+ }
+ }
+ this.result = result;
+ this.offset = offset;
+};
+
+LoadedNumberListResult$SI.prototype = new LoadedNumberListResult;
+
+/**
+ * class CompressionReport extends Object
+ * @constructor
+ */
+function CompressionReport() {
+}
+
+/**
+ * @constructor
+ */
+function CompressionReport$() {
+ this.source = 0;
+ this.result = 0;
+};
+
+CompressionReport$.prototype = new CompressionReport;
+
+/**
+ * @param {CompressionReport} $this
+ * @param {!number} source
+ * @param {!number} result
+ */
+CompressionReport.add$LCompressionReport$II = function ($this, source, result) {
+ $this.source += source;
+ $this.result += result;
+};
+
+var CompressionReport$add$LCompressionReport$II = CompressionReport.add$LCompressionReport$II;
+
+/**
+ * @param {CompressionReport} $this
+ * @return {!number}
+ */
+CompressionReport.rate$LCompressionReport$ = function ($this) {
+ return (Math.round($this.result * 100.0 / $this.source) | 0);
+};
+
+var CompressionReport$rate$LCompressionReport$ = CompressionReport.rate$LCompressionReport$;
+
+/**
+ * class Query extends Object
+ * @constructor
+ */
+function Query() {
+}
+
+/**
+ * @constructor
+ */
+function Query$() {
+ this.word = '';
+ this.or = false;
+ this.not = false;
+ this.raw = false;
+};
+
+Query$.prototype = new Query;
+
+/**
+ * @return {!string}
+ */
+Query.prototype.toString = function () {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ result = [ ];
+ if (this.or) {
+ result.push("OR ");
+ }
+ if (this.not) {
+ result.push("-");
+ }
+ if (this.raw) {
+ result.push('"', this.word, '"');
+ } else {
+ result.push(this.word);
+ }
+ return result.join('');
+};
+
+/**
+ * class QueryStringParser extends Object
+ * @constructor
+ */
+function QueryStringParser() {
+}
+
+/**
+ * @constructor
+ */
+function QueryStringParser$() {
+ this.queries = [ ];
+};
+
+QueryStringParser$.prototype = new QueryStringParser;
+
+/**
+ * @param {QueryStringParser} $this
+ * @param {!string} queryString
+ * @return {Array.<undefined|Query>}
+ */
+QueryStringParser.parse$LQueryStringParser$S = function ($this, queryString) {
+ /** @type {!boolean} */
+ var nextOr;
+ /** @type {!boolean} */
+ var nextNot;
+ /** @type {!number} */
+ var currentWordStart;
+ /** @type {!number} */
+ var status;
+ /** @type {RegExp} */
+ var isSpace;
+ /** @type {!number} */
+ var i;
+ /** @type {!string} */
+ var ch;
+ /** @type {!string} */
+ var word;
+ /** @type {Query} */
+ var query;
+ nextOr = false;
+ nextNot = false;
+ currentWordStart = 0;
+ status = 0;
+ isSpace = /[\s\u3000]/;
+ for (i = 0; i < queryString.length; i++) {
+ ch = queryString.charAt(i);
+ switch (status) {
+ case 0:
+ if (! isSpace.test(ch)) {
+ if (ch === '-') {
+ nextNot = true;
+ } else {
+ if (ch === '"') {
+ currentWordStart = i + 1;
+ status = 2;
+ } else {
+ currentWordStart = i;
+ status = 1;
+ }
+ }
+ } else {
+ nextNot = false;
+ }
+ break;
+ case 1:
+ if (isSpace.test(ch)) {
+ word = queryString.slice(currentWordStart, i);
+ if (word === 'OR') {
+ nextOr = true;
+ } else {
+ query = new Query$();
+ query.word = word;
+ query.or = nextOr;
+ query.not = nextNot;
+ $this.queries.push(query);
+ nextOr = false;
+ nextNot = false;
+ }
+ status = 0;
+ }
+ break;
+ case 2:
+ if (ch === '"') {
+ word = queryString.slice(currentWordStart, i);
+ query = new Query$();
+ query.word = word;
+ query.or = nextOr;
+ query.not = nextNot;
+ query.raw = true;
+ $this.queries.push(query);
+ nextOr = false;
+ nextNot = false;
+ status = 0;
+ }
+ break;
+ }
+ }
+ switch (status) {
+ case 0:
+ break;
+ case 1:
+ query = new Query$();
+ word = queryString.slice(currentWordStart, queryString.length);
+ if (word !== 'OR') {
+ query.word = word;
+ query.or = nextOr;
+ query.not = nextNot;
+ $this.queries.push(query);
+ }
+ break;
+ case 2:
+ query = new Query$();
+ query.word = queryString.slice(currentWordStart, queryString.length);
+ query.or = nextOr;
+ query.not = nextNot;
+ query.raw = true;
+ $this.queries.push(query);
+ break;
+ }
+ return $this.queries;
+};
+
+var QueryStringParser$parse$LQueryStringParser$S = QueryStringParser.parse$LQueryStringParser$S;
+
+/**
+ * @param {QueryStringParser} $this
+ * @return {!string}
+ */
+QueryStringParser.highlight$LQueryStringParser$ = function ($this) {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var i;
+ /** @type {Query} */
+ var query;
+ result = [ ];
+ for (i = 0; i < $this.queries.length; i++) {
+ query = $this.queries[i];
+ if (! query.not) {
+ result.push("highlight=" + $__jsx_encodeURIComponent(query.word));
+ }
+ }
+ return '?' + result.join('&');
+};
+
+var QueryStringParser$highlight$LQueryStringParser$ = QueryStringParser.highlight$LQueryStringParser$;
+
+/**
+ * class Proposal extends Object
+ * @constructor
+ */
+function Proposal() {
+}
+
+/**
+ * @constructor
+ * @param {!number} omit
+ * @param {!number} expect
+ */
+function Proposal$II(omit, expect) {
+ this.omit = omit;
+ this.expect = expect;
+};
+
+Proposal$II.prototype = new Proposal;
+
+/**
+ * class Position extends Object
+ * @constructor
+ */
+function Position() {
+}
+
+/**
+ * @constructor
+ * @param {!string} word
+ * @param {!number} position
+ * @param {!boolean} stemmed
+ */
+function Position$SIB(word, position, stemmed) {
+ this.word = word;
+ this.position = position;
+ this.stemmed = stemmed;
+};
+
+Position$SIB.prototype = new Position;
+
+/**
+ * class SearchUnit extends Object
+ * @constructor
+ */
+function SearchUnit() {
+}
+
+/**
+ * @constructor
+ * @param {!number} id
+ */
+function SearchUnit$I(id) {
+ this.positions = ({ });
+ this.id = id;
+ this._size = 0;
+ this.score = 0;
+ this.startPosition = -1;
+};
+
+SearchUnit$I.prototype = new SearchUnit;
+
+/**
+ * @param {SearchUnit} $this
+ * @param {!string} word
+ * @param {!number} position
+ * @param {!boolean} stemmed
+ */
+SearchUnit.addPosition$LSearchUnit$SIB = function ($this, word, position, stemmed) {
+ /** @type {Position} */
+ var positionObj;
+ positionObj = $this.positions[position + ""];
+ if (! positionObj) {
+ $this._size++;
+ $this.positions[position + ""] = ({word: word, position: position, stemmed: stemmed});
+ } else {
+ if (positionObj.word.length < word.length) {
+ positionObj.word = word;
+ }
+ positionObj.stemmed = positionObj.stemmed && stemmed;
+ }
+};
+
+var SearchUnit$addPosition$LSearchUnit$SIB = SearchUnit.addPosition$LSearchUnit$SIB;
+
+/**
+ * @param {SearchUnit} $this
+ * @param {!number} position
+ * @return {Position}
+ */
+SearchUnit.get$LSearchUnit$I = function ($this, position) {
+ return $this.positions[position + ""];
+};
+
+var SearchUnit$get$LSearchUnit$I = SearchUnit.get$LSearchUnit$I;
+
+/**
+ * @param {SearchUnit} $this
+ * @return {!number}
+ */
+SearchUnit.size$LSearchUnit$ = function ($this) {
+ return $this._size;
+};
+
+var SearchUnit$size$LSearchUnit$ = SearchUnit.size$LSearchUnit$;
+
+/**
+ * @param {SearchUnit} $this
+ * @param {SearchUnit} rhs
+ */
+SearchUnit.merge$LSearchUnit$LSearchUnit$ = function ($this, rhs) {
+ /** @type {!string} */
+ var position;
+ /** @type {Position} */
+ var pos;
+ for (position in rhs.positions) {
+ pos = rhs.positions[position];
+ SearchUnit$addPosition$LSearchUnit$SIB($this, pos.word, pos.position, pos.stemmed);
+ }
+};
+
+var SearchUnit$merge$LSearchUnit$LSearchUnit$ = SearchUnit.merge$LSearchUnit$LSearchUnit$;
+
+/**
+ * @param {SearchUnit} $this
+ * @return {Array.<undefined|Position>}
+ */
+SearchUnit.getPositions$LSearchUnit$ = function ($this) {
+ /** @type {Array.<undefined|Position>} */
+ var result;
+ /** @type {!string} */
+ var pos;
+ result = [ ];
+ for (pos in $this.positions) {
+ result.push($this.positions[pos]);
+ }
+ result.sort((function (a, b) {
+ return a.position - b.position;
+ }));
+ return result;
+};
+
+var SearchUnit$getPositions$LSearchUnit$ = SearchUnit.getPositions$LSearchUnit$;
+
+/**
+ * class SingleResult extends Object
+ * @constructor
+ */
+function SingleResult() {
+}
+
+/**
+ * @constructor
+ */
+function SingleResult$() {
+ this.units = [ ];
+ this.unitIds = [ ];
+ this.or = false;
+ this.not = false;
+ this.searchWord = '';
+};
+
+SingleResult$.prototype = new SingleResult;
+
+/**
+ * @constructor
+ * @param {!string} searchWord
+ * @param {!boolean} or
+ * @param {!boolean} not
+ */
+function SingleResult$SBB(searchWord, or, not) {
+ this.units = [ ];
+ this.unitIds = [ ];
+ this.or = or;
+ this.not = not;
+ this.searchWord = searchWord;
+};
+
+SingleResult$SBB.prototype = new SingleResult;
+
+/**
+ * @param {SingleResult} $this
+ * @param {!number} unitId
+ * @return {SearchUnit}
+ */
+SingleResult.getSearchUnit$LSingleResult$I = function ($this, unitId) {
+ /** @type {!number} */
+ var existing;
+ /** @type {SearchUnit} */
+ var result;
+ existing = $this.unitIds.indexOf(unitId);
+ if (existing === -1) {
+ result = ({positions: ({ }), id: unitId, _size: 0, score: 0, startPosition: -1});
+ $this.units.push(result);
+ $this.unitIds.push(unitId);
+ } else {
+ result = $this.units[existing];
+ }
+ return result;
+};
+
+var SingleResult$getSearchUnit$LSingleResult$I = SingleResult.getSearchUnit$LSingleResult$I;
+
+/**
+ * @param {SingleResult} $this
+ * @param {SingleResult} rhs
+ * @return {SingleResult}
+ */
+SingleResult.merge$LSingleResult$LSingleResult$ = function ($this, rhs) {
+ /** @type {SingleResult} */
+ var result;
+ result = ({units: [ ], unitIds: [ ], or: false, not: false, searchWord: ''});
+ if (rhs.or) {
+ SingleResult$_orMerge$LSingleResult$LSingleResult$LSingleResult$($this, result, rhs);
+ } else {
+ if (rhs.not) {
+ SingleResult$_notMerge$LSingleResult$LSingleResult$LSingleResult$($this, result, rhs);
+ } else {
+ SingleResult$_andMerge$LSingleResult$LSingleResult$LSingleResult$($this, result, rhs);
+ }
+ }
+ return result;
+};
+
+var SingleResult$merge$LSingleResult$LSingleResult$ = SingleResult.merge$LSingleResult$LSingleResult$;
+
+/**
+ * @param {SingleResult} $this
+ * @return {!number}
+ */
+SingleResult.size$LSingleResult$ = function ($this) {
+ return ($this.units.length | 0);
+};
+
+var SingleResult$size$LSingleResult$ = SingleResult.size$LSingleResult$;
+
+/**
+ * @param {SingleResult} $this
+ * @param {SingleResult} result
+ * @param {SingleResult} rhs
+ */
+SingleResult._andMerge$LSingleResult$LSingleResult$LSingleResult$ = function ($this, result, rhs) {
+ /** @type {!number} */
+ var i;
+ /** @type {undefined|!number} */
+ var id;
+ /** @type {SearchUnit} */
+ var lhsSection;
+ for (i = 0; i < $this.unitIds.length; i++) {
+ id = $this.unitIds[i];
+ if (rhs.unitIds.indexOf(id) !== -1) {
+ lhsSection = $this.units[i];
+ result.unitIds.push(id);
+ result.units.push(lhsSection);
+ }
+ }
+};
+
+var SingleResult$_andMerge$LSingleResult$LSingleResult$LSingleResult$ = SingleResult._andMerge$LSingleResult$LSingleResult$LSingleResult$;
+
+/**
+ * @param {SingleResult} $this
+ * @param {SingleResult} result
+ * @param {SingleResult} rhs
+ */
+SingleResult._orMerge$LSingleResult$LSingleResult$LSingleResult$ = function ($this, result, rhs) {
+ /** @type {!number} */
+ var i;
+ /** @type {undefined|!number} */
+ var id;
+ /** @type {SearchUnit} */
+ var rhsSection;
+ /** @type {SearchUnit} */
+ var lhsSection;
+ /** @type {Array.<undefined|!number>} */
+ var unitIds$0;
+ /** @type {Array.<undefined|SearchUnit>} */
+ var units$0;
+ result.unitIds = (unitIds$0 = $this.unitIds).slice(0, unitIds$0.length);
+ result.units = (units$0 = $this.units).slice(0, units$0.length);
+ for (i = 0; i < rhs.unitIds.length; i++) {
+ id = rhs.unitIds[i];
+ rhsSection = rhs.units[i];
+ if (result.unitIds.indexOf(id) !== -1) {
+ lhsSection = result.units[result.unitIds.indexOf(id)];
+ SearchUnit$merge$LSearchUnit$LSearchUnit$(lhsSection, rhsSection);
+ } else {
+ result.unitIds.push(id);
+ result.units.push(rhsSection);
+ }
+ }
+};
+
+var SingleResult$_orMerge$LSingleResult$LSingleResult$LSingleResult$ = SingleResult._orMerge$LSingleResult$LSingleResult$LSingleResult$;
+
+/**
+ * @param {SingleResult} $this
+ * @param {SingleResult} result
+ * @param {SingleResult} rhs
+ */
+SingleResult._notMerge$LSingleResult$LSingleResult$LSingleResult$ = function ($this, result, rhs) {
+ /** @type {!number} */
+ var i;
+ /** @type {undefined|!number} */
+ var id;
+ /** @type {SearchUnit} */
+ var lhsSection;
+ for (i = 0; i < $this.unitIds.length; i++) {
+ id = $this.unitIds[i];
+ if (rhs.unitIds.indexOf(id) === -1) {
+ lhsSection = $this.units[i];
+ result.unitIds.push(id);
+ result.units.push(lhsSection);
+ }
+ }
+};
+
+var SingleResult$_notMerge$LSingleResult$LSingleResult$LSingleResult$ = SingleResult._notMerge$LSingleResult$LSingleResult$LSingleResult$;
+
+/**
+ * class SearchSummary extends Object
+ * @constructor
+ */
+function SearchSummary() {
+}
+
+/**
+ * @constructor
+ */
+function SearchSummary$() {
+ this.sourceResults = [ ];
+ this.result = null;
+ this.oktavia = null;
+};
+
+SearchSummary$.prototype = new SearchSummary;
+
+/**
+ * @constructor
+ * @param {Oktavia} oktavia
+ */
+function SearchSummary$LOktavia$(oktavia) {
+ this.sourceResults = [ ];
+ this.result = null;
+ this.oktavia = oktavia;
+};
+
+SearchSummary$LOktavia$.prototype = new SearchSummary;
+
+/**
+ * @param {SearchSummary} $this
+ * @param {SingleResult} result
+ */
+SearchSummary.addQuery$LSearchSummary$LSingleResult$ = function ($this, result) {
+ $this.sourceResults.push(result);
+};
+
+var SearchSummary$addQuery$LSearchSummary$LSingleResult$ = SearchSummary.addQuery$LSearchSummary$LSingleResult$;
+
+/**
+ * @param {SearchSummary} $this
+ */
+SearchSummary.mergeResult$LSearchSummary$ = function ($this) {
+ $this.result = SearchSummary$mergeResult$LSearchSummary$ALSingleResult$($this, $this.sourceResults);
+};
+
+var SearchSummary$mergeResult$LSearchSummary$ = SearchSummary.mergeResult$LSearchSummary$;
+
+/**
+ * @param {SearchSummary} $this
+ * @param {Array.<undefined|SingleResult>} results
+ * @return {SingleResult}
+ */
+SearchSummary.mergeResult$LSearchSummary$ALSingleResult$ = function ($this, results) {
+ /** @type {SingleResult} */
+ var rhs;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var results$len$0;
+ rhs = results[0];
+ for ((i = 1, results$len$0 = results.length); i < results$len$0; i++) {
+ rhs = SingleResult$merge$LSingleResult$LSingleResult$(rhs, results[i]);
+ }
+ return rhs;
+};
+
+var SearchSummary$mergeResult$LSearchSummary$ALSingleResult$ = SearchSummary.mergeResult$LSearchSummary$ALSingleResult$;
+
+/**
+ * @param {SearchSummary} $this
+ * @return {Array.<undefined|Proposal>}
+ */
+SearchSummary.getProposal$LSearchSummary$ = function ($this) {
+ /** @type {Array.<undefined|Proposal>} */
+ var proposals;
+ /** @type {!number} */
+ var i;
+ /** @type {Array.<undefined|SingleResult>} */
+ var tmpSource;
+ /** @type {!number} */
+ var j;
+ /** @type {SingleResult} */
+ var result;
+ proposals = [ ];
+ for (i = 0; i < $this.sourceResults.length; i++) {
+ tmpSource = [ ];
+ for (j = 0; j < $this.sourceResults.length; j++) {
+ if (i !== j) {
+ tmpSource.push($this.sourceResults[j]);
+ }
+ }
+ result = SearchSummary$mergeResult$LSearchSummary$ALSingleResult$($this, tmpSource);
+ proposals.push(({omit: i, expect: result.units.length}));
+ }
+ proposals.sort((function (a, b) {
+ return b.expect - a.expect;
+ }));
+ return proposals;
+};
+
+var SearchSummary$getProposal$LSearchSummary$ = SearchSummary.getProposal$LSearchSummary$;
+
+/**
+ * @param {SearchSummary} $this
+ * @return {Array.<undefined|SearchUnit>}
+ */
+SearchSummary.getSortedResult$LSearchSummary$ = function ($this) {
+ /** @type {Array.<undefined|SearchUnit>} */
+ var result;
+ /** @type {Array.<undefined|SearchUnit>} */
+ var units$0;
+ result = (units$0 = $this.result.units).slice(0, units$0.length);
+ result.sort((function (a, b) {
+ return b.score - a.score;
+ }));
+ return result;
+};
+
+var SearchSummary$getSortedResult$LSearchSummary$ = SearchSummary.getSortedResult$LSearchSummary$;
+
+/**
+ * @param {SearchSummary} $this
+ * @return {!number}
+ */
+SearchSummary.size$LSearchSummary$ = function ($this) {
+ /** @type {SingleResult} */
+ var this$0;
+ this$0 = $this.result;
+ return (this$0.units.length | 0);
+};
+
+var SearchSummary$size$LSearchSummary$ = SearchSummary.size$LSearchSummary$;
+
+/**
+ * @param {SearchSummary} $this
+ * @param {SingleResult} result
+ */
+SearchSummary.add$LSearchSummary$LSingleResult$ = function ($this, result) {
+ $this.sourceResults.push(result);
+};
+
+var SearchSummary$add$LSearchSummary$LSingleResult$ = SearchSummary.add$LSearchSummary$LSingleResult$;
+
+/**
+ * class Style extends Object
+ * @constructor
+ */
+function Style() {
+}
+
+/**
+ * @constructor
+ * @param {!string} mode
+ */
+function Style$S(mode) {
+ this.styles = null;
+ this.escapeHTML = false;
+ switch (mode) {
+ case 'console':
+ this.styles = Style.console;
+ break;
+ case 'html':
+ this.styles = Style.html;
+ break;
+ case 'ignore':
+ this.styles = Style.ignore;
+ break;
+ default:
+ this.styles = Style.ignore;
+ break;
+ }
+ this.escapeHTML = mode === 'html';
+};
+
+Style$S.prototype = new Style;
+
+/**
+ * @param {!string} source
+ * @return {!string}
+ */
+Style.prototype.convert$S = function (source) {
+ /** @type {_HTMLHandler} */
+ var handler;
+ /** @type {SAXParser} */
+ var parser;
+ handler = new _HTMLHandler$HASB(this.styles, this.escapeHTML);
+ parser = new SAXParser$LSAXHandler$(handler);
+ parser.parse$S(source);
+ return handler.text.join('');
+};
+
+/**
+ * class Stemmer
+ * @constructor
+ */
+function Stemmer() {
+}
+
+Stemmer.prototype.$__jsx_implements_Stemmer = true;
+
+/**
+ * @constructor
+ */
+function Stemmer$() {
+};
+
+Stemmer$.prototype = new Stemmer;
+
+/**
+ * class BaseStemmer extends Object
+ * @constructor
+ */
+function BaseStemmer() {
+}
+
+$__jsx_merge_interface(BaseStemmer, Stemmer);
+
+/**
+ * @constructor
+ */
+function BaseStemmer$() {
+ /** @type {!string} */
+ var current$0;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var limit$0;
+ this.cache = ({ });
+ current$0 = this.current = "";
+ cursor$0 = this.cursor = 0;
+ limit$0 = this.limit = current$0.length;
+ this.limit_backward = 0;
+ this.bra = cursor$0;
+ this.ket = limit$0;
+};
+
+BaseStemmer$.prototype = new BaseStemmer;
+
+/**
+ * @param {!string} value
+ */
+BaseStemmer.prototype.setCurrent$S = function (value) {
+ /** @type {!string} */
+ var current$0;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var limit$0;
+ current$0 = this.current = value;
+ cursor$0 = this.cursor = 0;
+ limit$0 = this.limit = current$0.length;
+ this.limit_backward = 0;
+ this.bra = cursor$0;
+ this.ket = limit$0;
+};
+
+/**
+ * @return {!string}
+ */
+BaseStemmer.prototype.getCurrent$ = function () {
+ return this.current;
+};
+
+/**
+ * @param {BaseStemmer} other
+ */
+BaseStemmer.prototype.copy_from$LBaseStemmer$ = function (other) {
+ this.current = other.current;
+ this.cursor = other.cursor;
+ this.limit = other.limit;
+ this.limit_backward = other.limit_backward;
+ this.bra = other.bra;
+ this.ket = other.ket;
+};
+
+/**
+ * @param {Array.<undefined|!number>} s
+ * @param {!number} min
+ * @param {!number} max
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.in_grouping$AIII = function (s, min, max) {
+ /** @type {!number} */
+ var ch;
+ if (this.cursor >= this.limit) {
+ return false;
+ }
+ ch = this.current.charCodeAt(this.cursor);
+ if (ch > max || ch < min) {
+ return false;
+ }
+ ch -= min;
+ if ((s[ch >>> 3] & 0x1 << (ch & 0x7)) === 0) {
+ return false;
+ }
+ this.cursor++;
+ return true;
+};
+
+/**
+ * @param {Array.<undefined|!number>} s
+ * @param {!number} min
+ * @param {!number} max
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.in_grouping_b$AIII = function (s, min, max) {
+ /** @type {!number} */
+ var ch;
+ if (this.cursor <= this.limit_backward) {
+ return false;
+ }
+ ch = this.current.charCodeAt(this.cursor - 1);
+ if (ch > max || ch < min) {
+ return false;
+ }
+ ch -= min;
+ if ((s[ch >>> 3] & 0x1 << (ch & 0x7)) === 0) {
+ return false;
+ }
+ this.cursor--;
+ return true;
+};
+
+/**
+ * @param {Array.<undefined|!number>} s
+ * @param {!number} min
+ * @param {!number} max
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.out_grouping$AIII = function (s, min, max) {
+ /** @type {!number} */
+ var ch;
+ if (this.cursor >= this.limit) {
+ return false;
+ }
+ ch = this.current.charCodeAt(this.cursor);
+ if (ch > max || ch < min) {
+ this.cursor++;
+ return true;
+ }
+ ch -= min;
+ if ((s[ch >>> 3] & 0X1 << (ch & 0x7)) === 0) {
+ this.cursor++;
+ return true;
+ }
+ return false;
+};
+
+/**
+ * @param {Array.<undefined|!number>} s
+ * @param {!number} min
+ * @param {!number} max
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.out_grouping_b$AIII = function (s, min, max) {
+ /** @type {!number} */
+ var ch;
+ if (this.cursor <= this.limit_backward) {
+ return false;
+ }
+ ch = this.current.charCodeAt(this.cursor - 1);
+ if (ch > max || ch < min) {
+ this.cursor--;
+ return true;
+ }
+ ch -= min;
+ if ((s[ch >>> 3] & 0x1 << (ch & 0x7)) === 0) {
+ this.cursor--;
+ return true;
+ }
+ return false;
+};
+
+/**
+ * @param {!number} min
+ * @param {!number} max
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.in_range$II = function (min, max) {
+ /** @type {!number} */
+ var ch;
+ if (this.cursor >= this.limit) {
+ return false;
+ }
+ ch = this.current.charCodeAt(this.cursor);
+ if (ch > max || ch < min) {
+ return false;
+ }
+ this.cursor++;
+ return true;
+};
+
+/**
+ * @param {!number} min
+ * @param {!number} max
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.in_range_b$II = function (min, max) {
+ /** @type {!number} */
+ var ch;
+ if (this.cursor <= this.limit_backward) {
+ return false;
+ }
+ ch = this.current.charCodeAt(this.cursor - 1);
+ if (ch > max || ch < min) {
+ return false;
+ }
+ this.cursor--;
+ return true;
+};
+
+/**
+ * @param {!number} min
+ * @param {!number} max
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.out_range$II = function (min, max) {
+ /** @type {!number} */
+ var ch;
+ if (this.cursor >= this.limit) {
+ return false;
+ }
+ ch = this.current.charCodeAt(this.cursor);
+ if (! (ch > max || ch < min)) {
+ return false;
+ }
+ this.cursor++;
+ return true;
+};
+
+/**
+ * @param {!number} min
+ * @param {!number} max
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.out_range_b$II = function (min, max) {
+ /** @type {!number} */
+ var ch;
+ if (this.cursor <= this.limit_backward) {
+ return false;
+ }
+ ch = this.current.charCodeAt(this.cursor - 1);
+ if (! (ch > max || ch < min)) {
+ return false;
+ }
+ this.cursor--;
+ return true;
+};
+
+/**
+ * @param {!number} s_size
+ * @param {!string} s
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.eq_s$IS = function (s_size, s) {
+ /** @type {!number} */
+ var cursor$0;
+ if (this.limit - this.cursor < s_size) {
+ return false;
+ }
+ if (this.current.slice(cursor$0 = this.cursor, cursor$0 + s_size) !== s) {
+ return false;
+ }
+ this.cursor += s_size;
+ return true;
+};
+
+/**
+ * @param {!number} s_size
+ * @param {!string} s
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.eq_s_b$IS = function (s_size, s) {
+ /** @type {!number} */
+ var cursor$0;
+ if (this.cursor - this.limit_backward < s_size) {
+ return false;
+ }
+ if (this.current.slice((cursor$0 = this.cursor) - s_size, cursor$0) !== s) {
+ return false;
+ }
+ this.cursor -= s_size;
+ return true;
+};
+
+/**
+ * @param {!string} s
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.eq_v$S = function (s) {
+ return this.eq_s$IS(s.length, s);
+};
+
+/**
+ * @param {!string} s
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.eq_v_b$S = function (s) {
+ return this.eq_s_b$IS(s.length, s);
+};
+
+/**
+ * @param {Array.<undefined|Among>} v
+ * @param {!number} v_size
+ * @return {!number}
+ */
+BaseStemmer.prototype.find_among$ALAmong$I = function (v, v_size) {
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var j;
+ /** @type {!number} */
+ var c;
+ /** @type {!number} */
+ var l;
+ /** @type {!number} */
+ var common_i;
+ /** @type {!number} */
+ var common_j;
+ /** @type {!boolean} */
+ var first_key_inspected;
+ /** @type {!number} */
+ var k;
+ /** @type {!number} */
+ var diff;
+ /** @type {!number} */
+ var common;
+ /** @type {Among} */
+ var w;
+ /** @type {!number} */
+ var i2;
+ /** @type {!boolean} */
+ var res;
+ i = 0;
+ j = v_size;
+ c = this.cursor;
+ l = this.limit;
+ common_i = 0;
+ common_j = 0;
+ first_key_inspected = false;
+ while (true) {
+ k = i + (j - i >>> 1);
+ diff = 0;
+ common = (common_i < common_j ? common_i : common_j);
+ w = v[k];
+ for (i2 = common; i2 < w.s_size; i2++) {
+ if (c + common === l) {
+ diff = -1;
+ break;
+ }
+ diff = this.current.charCodeAt(c + common) - w.s.charCodeAt(i2);
+ if (diff !== 0) {
+ break;
+ }
+ common++;
+ }
+ if (diff < 0) {
+ j = k;
+ common_j = common;
+ } else {
+ i = k;
+ common_i = common;
+ }
+ if (j - i <= 1) {
+ if (i > 0) {
+ break;
+ }
+ if (j === i) {
+ break;
+ }
+ if (first_key_inspected) {
+ break;
+ }
+ first_key_inspected = true;
+ }
+ }
+ while (true) {
+ w = v[i];
+ if (common_i >= w.s_size) {
+ this.cursor = (c + w.s_size | 0);
+ if (w.method == null) {
+ return w.result;
+ }
+ res = w.method(w.instance);
+ this.cursor = (c + w.s_size | 0);
+ if (res) {
+ return w.result;
+ }
+ }
+ i = w.substring_i;
+ if (i < 0) {
+ return 0;
+ }
+ }
+ return -1;
+};
+
+/**
+ * @param {Array.<undefined|Among>} v
+ * @param {!number} v_size
+ * @return {!number}
+ */
+BaseStemmer.prototype.find_among_b$ALAmong$I = function (v, v_size) {
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var j;
+ /** @type {!number} */
+ var c;
+ /** @type {!number} */
+ var lb;
+ /** @type {!number} */
+ var common_i;
+ /** @type {!number} */
+ var common_j;
+ /** @type {!boolean} */
+ var first_key_inspected;
+ /** @type {!number} */
+ var k;
+ /** @type {!number} */
+ var diff;
+ /** @type {!number} */
+ var common;
+ /** @type {Among} */
+ var w;
+ /** @type {!number} */
+ var i2;
+ /** @type {!boolean} */
+ var res;
+ i = 0;
+ j = v_size;
+ c = this.cursor;
+ lb = this.limit_backward;
+ common_i = 0;
+ common_j = 0;
+ first_key_inspected = false;
+ while (true) {
+ k = i + (j - i >> 1);
+ diff = 0;
+ common = (common_i < common_j ? common_i : common_j);
+ w = v[k];
+ for (i2 = w.s_size - 1 - common; i2 >= 0; i2--) {
+ if (c - common === lb) {
+ diff = -1;
+ break;
+ }
+ diff = this.current.charCodeAt(c - 1 - common) - w.s.charCodeAt(i2);
+ if (diff !== 0) {
+ break;
+ }
+ common++;
+ }
+ if (diff < 0) {
+ j = k;
+ common_j = common;
+ } else {
+ i = k;
+ common_i = common;
+ }
+ if (j - i <= 1) {
+ if (i > 0) {
+ break;
+ }
+ if (j === i) {
+ break;
+ }
+ if (first_key_inspected) {
+ break;
+ }
+ first_key_inspected = true;
+ }
+ }
+ while (true) {
+ w = v[i];
+ if (common_i >= w.s_size) {
+ this.cursor = (c - w.s_size | 0);
+ if (w.method == null) {
+ return w.result;
+ }
+ res = w.method(this);
+ this.cursor = (c - w.s_size | 0);
+ if (res) {
+ return w.result;
+ }
+ }
+ i = w.substring_i;
+ if (i < 0) {
+ return 0;
+ }
+ }
+ return -1;
+};
+
+/**
+ * @param {!number} c_bra
+ * @param {!number} c_ket
+ * @param {!string} s
+ * @return {!number}
+ */
+BaseStemmer.prototype.replace_s$IIS = function (c_bra, c_ket, s) {
+ /** @type {!number} */
+ var adjustment;
+ adjustment = s.length - (c_ket - c_bra);
+ this.current = this.current.slice(0, c_bra) + s + this.current.slice(c_ket);
+ this.limit += (adjustment | 0);
+ if (this.cursor >= c_ket) {
+ this.cursor += (adjustment | 0);
+ } else {
+ if (this.cursor > c_bra) {
+ this.cursor = c_bra;
+ }
+ }
+ return (adjustment | 0);
+};
+
+/**
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.slice_check$ = function () {
+ /** @type {!number} */
+ var bra$0;
+ /** @type {!number} */
+ var ket$0;
+ /** @type {!number} */
+ var limit$0;
+ return ((bra$0 = this.bra) < 0 || bra$0 > (ket$0 = this.ket) || ket$0 > (limit$0 = this.limit) || limit$0 > this.current.length ? false : true);
+};
+
+/**
+ * @param {!string} s
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.slice_from$S = function (s) {
+ /** @type {!boolean} */
+ var result;
+ /** @type {!number} */
+ var bra$0;
+ /** @type {!number} */
+ var ket$0;
+ /** @type {!number} */
+ var limit$0;
+ result = false;
+ if ((bra$0 = this.bra) < 0 || bra$0 > (ket$0 = this.ket) || ket$0 > (limit$0 = this.limit) || limit$0 > this.current.length ? false : true) {
+ this.replace_s$IIS(this.bra, this.ket, s);
+ result = true;
+ }
+ return result;
+};
+
+/**
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.slice_del$ = function () {
+ return this.slice_from$S("");
+};
+
+/**
+ * @param {!number} c_bra
+ * @param {!number} c_ket
+ * @param {!string} s
+ */
+BaseStemmer.prototype.insert$IIS = function (c_bra, c_ket, s) {
+ /** @type {!number} */
+ var adjustment;
+ adjustment = this.replace_s$IIS(c_bra, c_ket, s);
+ if (c_bra <= this.bra) {
+ this.bra += (adjustment | 0);
+ }
+ if (c_bra <= this.ket) {
+ this.ket += (adjustment | 0);
+ }
+};
+
+/**
+ * @param {!string} s
+ * @return {!string}
+ */
+BaseStemmer.prototype.slice_to$S = function (s) {
+ /** @type {!string} */
+ var result;
+ /** @type {!number} */
+ var bra$0;
+ /** @type {!number} */
+ var ket$0;
+ /** @type {!number} */
+ var limit$0;
+ result = '';
+ if ((bra$0 = this.bra) < 0 || bra$0 > (ket$0 = this.ket) || ket$0 > (limit$0 = this.limit) || limit$0 > this.current.length ? false : true) {
+ result = this.current.slice(this.bra, this.ket);
+ }
+ return result;
+};
+
+/**
+ * @param {!string} s
+ * @return {!string}
+ */
+BaseStemmer.prototype.assign_to$S = function (s) {
+ return this.current.slice(0, this.limit);
+};
+
+/**
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.stem$ = function () {
+ return false;
+};
+
+/**
+ * @param {!string} word
+ * @return {!string}
+ */
+BaseStemmer.prototype.stemWord$S = function (word) {
+ /** @type {undefined|!string} */
+ var result;
+ /** @type {!string} */
+ var current$0;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var limit$0;
+ result = this.cache['.' + word];
+ if (result == null) {
+ current$0 = this.current = word;
+ cursor$0 = this.cursor = 0;
+ limit$0 = this.limit = current$0.length;
+ this.limit_backward = 0;
+ this.bra = cursor$0;
+ this.ket = limit$0;
+ this.stem$();
+ result = this.current;
+ this.cache['.' + word] = result;
+ }
+ return result;
+};
+
+/**
+ * @param {Array.<undefined|!string>} words
+ * @return {Array.<undefined|!string>}
+ */
+BaseStemmer.prototype.stemWords$AS = function (words) {
+ /** @type {Array.<undefined|!string>} */
+ var results;
+ /** @type {!number} */
+ var i;
+ /** @type {undefined|!string} */
+ var word;
+ /** @type {undefined|!string} */
+ var result;
+ /** @type {!string} */
+ var current$0;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var limit$0;
+ results = [ ];
+ for (i = 0; i < words.length; i++) {
+ word = words[i];
+ result = this.cache['.' + word];
+ if (result == null) {
+ current$0 = this.current = word;
+ cursor$0 = this.cursor = 0;
+ limit$0 = this.limit = current$0.length;
+ this.limit_backward = 0;
+ this.bra = cursor$0;
+ this.ket = limit$0;
+ this.stem$();
+ result = this.current;
+ this.cache['.' + word] = result;
+ }
+ results.push(result);
+ }
+ return results;
+};
+
+/**
+ * class NorwegianStemmer extends BaseStemmer
+ * @constructor
+ */
+function NorwegianStemmer() {
+}
+
+NorwegianStemmer.prototype = new BaseStemmer;
+/**
+ * @constructor
+ */
+function NorwegianStemmer$() {
+ BaseStemmer$.call(this);
+ this.I_x = 0;
+ this.I_p1 = 0;
+};
+
+NorwegianStemmer$.prototype = new NorwegianStemmer;
+
+/**
+ * @param {NorwegianStemmer} other
+ */
+NorwegianStemmer.prototype.copy_from$LNorwegianStemmer$ = function (other) {
+ this.I_x = other.I_x;
+ this.I_p1 = other.I_p1;
+ BaseStemmer.prototype.copy_from$LBaseStemmer$.call(this, other);
+};
+
+/**
+ * @return {!boolean}
+ */
+NorwegianStemmer.prototype.r_mark_regions$ = function () {
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var c;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!boolean} */
+ var lab3;
+ /** @type {!boolean} */
+ var lab4;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var limit$0;
+ /** @type {!number} */
+ var cursor$1;
+ /** @type {!number} */
+ var cursor$2;
+ this.I_p1 = limit$0 = this.limit;
+ v_1 = cursor$0 = this.cursor;
+ c = (cursor$0 + 3 | 0);
+ if (0 > c || c > limit$0) {
+ return false;
+ }
+ cursor$2 = this.cursor = c;
+ this.I_x = cursor$2;
+ this.cursor = v_1;
+golab0:
+ while (true) {
+ v_2 = this.cursor;
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ if (! this.in_grouping$AIII(NorwegianStemmer.g_v, 97, 248)) {
+ break lab1;
+ }
+ this.cursor = v_2;
+ break golab0;
+ }
+ cursor$1 = this.cursor = v_2;
+ if (cursor$1 >= this.limit) {
+ return false;
+ }
+ this.cursor++;
+ }
+golab2:
+ while (true) {
+ lab3 = true;
+ lab3:
+ while (lab3 === true) {
+ lab3 = false;
+ if (! this.out_grouping$AIII(NorwegianStemmer.g_v, 97, 248)) {
+ break lab3;
+ }
+ break golab2;
+ }
+ if (this.cursor >= this.limit) {
+ return false;
+ }
+ this.cursor++;
+ }
+ this.I_p1 = this.cursor;
+ lab4 = true;
+lab4:
+ while (lab4 === true) {
+ lab4 = false;
+ if (! (this.I_p1 < this.I_x)) {
+ break lab4;
+ }
+ this.I_p1 = this.I_x;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+NorwegianStemmer.prototype.r_main_suffix$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var v_3;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var cursor$1;
+ /** @type {!number} */
+ var cursor$2;
+ v_1 = this.limit - (cursor$0 = this.cursor);
+ if (cursor$0 < this.I_p1) {
+ return false;
+ }
+ cursor$1 = this.cursor = this.I_p1;
+ v_2 = this.limit_backward;
+ this.limit_backward = cursor$1;
+ cursor$2 = this.cursor = this.limit - v_1;
+ this.ket = cursor$2;
+ among_var = this.find_among_b$ALAmong$I(NorwegianStemmer.a_0, 29);
+ if (among_var === 0) {
+ this.limit_backward = v_2;
+ return false;
+ }
+ this.bra = this.cursor;
+ this.limit_backward = v_2;
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 2:
+ lab0 = true;
+ lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ v_3 = this.limit - this.cursor;
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ if (! this.in_grouping_b$AIII(NorwegianStemmer.g_s_ending, 98, 122)) {
+ break lab1;
+ }
+ break lab0;
+ }
+ this.cursor = this.limit - v_3;
+ if (! this.eq_s_b$IS(1, "k")) {
+ return false;
+ }
+ if (! this.out_grouping_b$AIII(NorwegianStemmer.g_v, 97, 248)) {
+ return false;
+ }
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 3:
+ if (! this.slice_from$S("er")) {
+ return false;
+ }
+ break;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+NorwegianStemmer.prototype.r_consonant_pair$ = function () {
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var v_3;
+ /** @type {!number} */
+ var limit$0;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var cursor$1;
+ /** @type {!number} */
+ var cursor$2;
+ /** @type {!number} */
+ var cursor$3;
+ /** @type {!number} */
+ var limit_backward$0;
+ v_1 = (limit$0 = this.limit) - (cursor$0 = this.cursor);
+ v_2 = limit$0 - cursor$0;
+ if (cursor$0 < this.I_p1) {
+ return false;
+ }
+ cursor$1 = this.cursor = this.I_p1;
+ v_3 = this.limit_backward;
+ this.limit_backward = cursor$1;
+ cursor$2 = this.cursor = this.limit - v_2;
+ this.ket = cursor$2;
+ if (this.find_among_b$ALAmong$I(NorwegianStemmer.a_1, 2) === 0) {
+ this.limit_backward = v_3;
+ return false;
+ }
+ this.bra = this.cursor;
+ limit_backward$0 = this.limit_backward = v_3;
+ cursor$3 = this.cursor = this.limit - v_1;
+ if (cursor$3 <= limit_backward$0) {
+ return false;
+ }
+ this.cursor--;
+ this.bra = this.cursor;
+ return (! this.slice_from$S("") ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+NorwegianStemmer.prototype.r_other_suffix$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var cursor$1;
+ /** @type {!number} */
+ var cursor$2;
+ v_1 = this.limit - (cursor$0 = this.cursor);
+ if (cursor$0 < this.I_p1) {
+ return false;
+ }
+ cursor$1 = this.cursor = this.I_p1;
+ v_2 = this.limit_backward;
+ this.limit_backward = cursor$1;
+ cursor$2 = this.cursor = this.limit - v_1;
+ this.ket = cursor$2;
+ among_var = this.find_among_b$ALAmong$I(NorwegianStemmer.a_2, 11);
+ if (among_var === 0) {
+ this.limit_backward = v_2;
+ return false;
+ }
+ this.bra = this.cursor;
+ this.limit_backward = v_2;
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+NorwegianStemmer.prototype.stem$ = function () {
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var v_3;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!boolean} */
+ var lab2;
+ /** @type {!boolean} */
+ var lab3;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var limit$0;
+ /** @type {!number} */
+ var cursor$1;
+ /** @type {!number} */
+ var limit$1;
+ /** @type {!number} */
+ var cursor$2;
+ v_1 = this.cursor;
+ lab0 = true;
+lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ if (! this.r_mark_regions$()) {
+ break lab0;
+ }
+ }
+ cursor$0 = this.cursor = v_1;
+ this.limit_backward = cursor$0;
+ cursor$1 = this.cursor = limit$0 = this.limit;
+ v_2 = limit$0 - cursor$1;
+ lab1 = true;
+lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ if (! this.r_main_suffix$()) {
+ break lab1;
+ }
+ }
+ cursor$2 = this.cursor = (limit$1 = this.limit) - v_2;
+ v_3 = limit$1 - cursor$2;
+ lab2 = true;
+lab2:
+ while (lab2 === true) {
+ lab2 = false;
+ if (! this.r_consonant_pair$()) {
+ break lab2;
+ }
+ }
+ this.cursor = this.limit - v_3;
+ lab3 = true;
+lab3:
+ while (lab3 === true) {
+ lab3 = false;
+ if (! this.r_other_suffix$()) {
+ break lab3;
+ }
+ }
+ this.cursor = this.limit_backward;
+ return true;
+};
+
+/**
+ * @param {*} o
+ * @return {!boolean}
+ */
+NorwegianStemmer.prototype.equals$X = function (o) {
+ return o instanceof NorwegianStemmer;
+};
+
+/**
+ * @return {!number}
+ */
+NorwegianStemmer.prototype.hashCode$ = function () {
+ /** @type {!string} */
+ var classname;
+ /** @type {!number} */
+ var hash;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var char;
+ classname = "NorwegianStemmer";
+ hash = 0;
+ if ("NorwegianStemmer".length === 0) {
+ return (hash | 0);
+ }
+ for (i = 0; i < classname.length; i++) {
+ char = classname.charCodeAt(i);
+ hash = (hash << 5) - hash + char;
+ hash = hash & hash;
+ }
+ return (hash | 0);
+};
+
+/**
+ * class Among extends Object
+ * @constructor
+ */
+function Among() {
+}
+
+/**
+ * @constructor
+ * @param {!string} s
+ * @param {!number} substring_i
+ * @param {!number} result
+ */
+function Among$SII(s, substring_i, result) {
+ this.s_size = s.length;
+ this.s = s;
+ this.substring_i = substring_i;
+ this.result = result;
+ this.method = null;
+ this.instance = null;
+};
+
+Among$SII.prototype = new Among;
+
+/**
+ * @constructor
+ * @param {!string} s
+ * @param {!number} substring_i
+ * @param {!number} result
+ * @param {*} method
+ * @param {BaseStemmer} instance
+ */
+function Among$SIIF$LBaseStemmer$B$LBaseStemmer$(s, substring_i, result, method, instance) {
+ this.s_size = s.length;
+ this.s = s;
+ this.substring_i = substring_i;
+ this.result = result;
+ this.method = method;
+ this.instance = instance;
+};
+
+Among$SIIF$LBaseStemmer$B$LBaseStemmer$.prototype = new Among;
+
+/**
+ * class Metadata extends Object
+ * @constructor
+ */
+function Metadata() {
+}
+
+/**
+ * @constructor
+ * @param {Oktavia} parent
+ */
+function Metadata$LOktavia$(parent) {
+ this._parent = parent;
+ this._bitVector = new BitVector$();
+};
+
+Metadata$LOktavia$.prototype = new Metadata;
+
+/**
+ * @return {!number}
+ */
+Metadata.prototype._size$ = function () {
+ /** @type {BitVector} */
+ var this$0;
+ /** @type {!number} */
+ var i$0;
+ /** @type {BitVector} */
+ var _bitVector$0;
+ this$0 = _bitVector$0 = this._bitVector;
+ i$0 = _bitVector$0._size;
+ return this$0.rank$IB(i$0, true);
+};
+
+/**
+ * @param {!number} index
+ * @return {!string}
+ */
+Metadata.prototype.getContent$I = function (index) {
+ /** @type {!number} */
+ var startPosition;
+ /** @type {!number} */
+ var length;
+ if (index < 0 || this._size$() <= index) {
+ throw new Error("Section.getContent() : range error " + (index + ""));
+ }
+ startPosition = 0;
+ if (index > 0) {
+ startPosition = this._bitVector.select$I(index - 1) + 1;
+ }
+ length = this._bitVector.select$I(index) - startPosition + 1;
+ return this._parent._getSubstring$II(startPosition, length);
+};
+
+/**
+ * @param {!number} index
+ * @return {!number}
+ */
+Metadata.prototype.getStartPosition$I = function (index) {
+ /** @type {!number} */
+ var startPosition;
+ if (index < 0 || this._size$() <= index) {
+ throw new Error("Section.getContent() : range error " + (index + ""));
+ }
+ startPosition = 0;
+ if (index > 0) {
+ startPosition = this._bitVector.select$I(index - 1) + 1;
+ }
+ return (startPosition | 0);
+};
+
+/**
+ * @param {SingleResult} result
+ * @param {Array.<undefined|!number>} positions
+ * @param {!string} word
+ * @param {!boolean} stemmed
+ */
+Metadata.prototype.grouping$LSingleResult$AISB = function (result, positions, word, stemmed) {
+};
+
+/**
+ * @param {!number} index
+ * @return {!string}
+ */
+Metadata.prototype.getInformation$I = function (index) {
+ return '';
+};
+
+/**
+ */
+Metadata.prototype._build$ = function () {
+ this._bitVector.build$();
+};
+
+/**
+ * @param {!string} name
+ * @param {!string} data
+ * @param {!number} offset
+ * @return {!number}
+ */
+Metadata.prototype._load$SSI = function (name, data, offset) {
+ offset = this._bitVector.load$SI(data, offset);
+ this._parent._metadataLabels.push(name);
+ this._parent._metadatas[name] = this;
+ return offset;
+};
+
+/**
+ * @return {!string}
+ */
+Metadata.prototype._dump$ = function () {
+ /** @type {BitVector} */
+ var this$0;
+ /** @type {Array.<undefined|!string>} */
+ var contents$0;
+ this$0 = this._bitVector;
+ contents$0 = [ ];
+ contents$0.push(Binary$dump32bitNumber$N(this$0._size));
+ contents$0.push(Binary$dump32bitNumberList$AN(this$0._v));
+ return contents$0.join('');
+};
+
+/**
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+Metadata.prototype._dump$LCompressionReport$ = function (report) {
+ /** @type {BitVector} */
+ var this$0;
+ /** @type {Array.<undefined|!string>} */
+ var contents$0;
+ this$0 = this._bitVector;
+ contents$0 = [ ];
+ contents$0.push(Binary$dump32bitNumber$N(this$0._size));
+ CompressionReport$add$LCompressionReport$II(report, 2, 2);
+ contents$0.push(Binary$dump32bitNumberList$ANLCompressionReport$(this$0._v, report));
+ return contents$0.join('');
+};
+
+/**
+ * class Section extends Metadata
+ * @constructor
+ */
+function Section() {
+}
+
+Section.prototype = new Metadata;
+/**
+ * @constructor
+ * @param {Oktavia} parent
+ */
+function Section$LOktavia$(parent) {
+ this._parent = parent;
+ this._bitVector = new BitVector$();
+ this._names = [ ];
+};
+
+Section$LOktavia$.prototype = new Section;
+
+/**
+ * @param {!string} name
+ */
+Section.prototype.setTail$S = function (name) {
+ /** @type {!number} */
+ var index$0;
+ /** @type {Oktavia} */
+ var this$0;
+ /** @type {FMIndex} */
+ var this$0$0;
+ this$0 = this._parent;
+ this$0$0 = this$0._fmindex;
+ index$0 = this$0$0._substr.length;
+ this._names.push(name);
+ this._bitVector.set$I(index$0 - 1);
+};
+
+/**
+ * @param {!string} name
+ * @param {!number} index
+ */
+Section.prototype.setTail$SI = function (name, index) {
+ this._names.push(name);
+ this._bitVector.set$I(index - 1);
+};
+
+/**
+ * @return {!number}
+ */
+Section.prototype.size$ = function () {
+ return (this._names.length | 0);
+};
+
+/**
+ * @param {!number} position
+ * @return {!number}
+ */
+Section.prototype.getSectionIndex$I = function (position) {
+ /** @type {BitVector} */
+ var this$0;
+ if (position < 0 || this._bitVector.size$() <= position) {
+ throw new Error("Section.getSectionIndex() : range error " + (position + ""));
+ }
+ this$0 = this._bitVector;
+ return this$0.rank$IB(position, true);
+};
+
+/**
+ * @param {!number} index
+ * @return {!string}
+ */
+Section.prototype.getName$I = function (index) {
+ if (index < 0 || this._names.length <= index) {
+ throw new Error("Section.getName() : range error");
+ }
+ return this._names[index];
+};
+
+/**
+ * @param {SingleResult} result
+ * @param {Array.<undefined|!number>} positions
+ * @param {!string} word
+ * @param {!boolean} stemmed
+ */
+Section.prototype.grouping$LSingleResult$AISB = function (result, positions, word, stemmed) {
+ /** @type {!number} */
+ var i;
+ /** @type {undefined|!number} */
+ var position;
+ /** @type {!number} */
+ var index;
+ /** @type {SearchUnit} */
+ var unit;
+ for (i = 0; i < positions.length; i++) {
+ position = positions[i];
+ index = this.getSectionIndex$I(position);
+ unit = SingleResult$getSearchUnit$LSingleResult$I(result, index);
+ if (unit.startPosition < 0) {
+ unit.startPosition = this.getStartPosition$I(index);
+ }
+ SearchUnit$addPosition$LSearchUnit$SIB(unit, word, position - unit.startPosition, stemmed);
+ }
+};
+
+/**
+ * @param {!number} index
+ * @return {!string}
+ */
+Section.prototype.getInformation$I = function (index) {
+ return this.getName$I(index);
+};
+
+/**
+ * @param {Oktavia} parent
+ * @param {!string} name
+ * @param {!string} data
+ * @param {!number} offset
+ * @return {!number}
+ */
+Section._load$LOktavia$SSI = function (parent, name, data, offset) {
+ /** @type {LoadedStringListResult} */
+ var strs;
+ /** @type {Section} */
+ var section;
+ /** @type {!number} */
+ var offset$0;
+ strs = new LoadedStringListResult$SI(data, offset);
+ section = new Section$LOktavia$(parent);
+ section._names = strs.result;
+ offset$0 = strs.offset;
+ offset$0 = section._bitVector.load$SI(data, offset$0);
+ section._parent._metadataLabels.push(name);
+ section._parent._metadatas[name] = section;
+ return offset$0;
+};
+
+var Section$_load$LOktavia$SSI = Section._load$LOktavia$SSI;
+
+/**
+ * @return {!string}
+ */
+Section.prototype._dump$ = function () {
+ return [ Binary$dump16bitNumber$I(0), Binary$dumpStringList$AS(this._names), Metadata.prototype._dump$.call(this) ].join('');
+};
+
+/**
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+Section.prototype._dump$LCompressionReport$ = function (report) {
+ CompressionReport$add$LCompressionReport$II(report, 1, 1);
+ return [ Binary$dump16bitNumber$I(0), Binary$dumpStringList$ASLCompressionReport$(this._names, report), Metadata.prototype._dump$LCompressionReport$.call(this, report) ].join('');
+};
+
+/**
+ * class Splitter extends Metadata
+ * @constructor
+ */
+function Splitter() {
+}
+
+Splitter.prototype = new Metadata;
+/**
+ * @constructor
+ * @param {Oktavia} parent
+ */
+function Splitter$LOktavia$(parent) {
+ this._parent = parent;
+ this._bitVector = new BitVector$();
+ this.name = null;
+};
+
+Splitter$LOktavia$.prototype = new Splitter;
+
+/**
+ * @constructor
+ * @param {Oktavia} parent
+ * @param {!string} name
+ */
+function Splitter$LOktavia$S(parent, name) {
+ this._parent = parent;
+ this._bitVector = new BitVector$();
+ this.name = name;
+};
+
+Splitter$LOktavia$S.prototype = new Splitter;
+
+/**
+ * @return {!number}
+ */
+Splitter.prototype.size$ = function () {
+ /** @type {BitVector} */
+ var this$0$0;
+ /** @type {!number} */
+ var i$0$0;
+ /** @type {BitVector} */
+ var _bitVector$0;
+ this$0$0 = _bitVector$0 = this._bitVector;
+ i$0$0 = _bitVector$0._size;
+ return this$0$0.rank$IB(i$0$0, true);
+};
+
+/**
+ */
+Splitter.prototype.split$ = function () {
+ /** @type {!number} */
+ var index$0;
+ /** @type {Oktavia} */
+ var this$0;
+ /** @type {FMIndex} */
+ var this$0$0;
+ this$0 = this._parent;
+ this$0$0 = this$0._fmindex;
+ index$0 = this$0$0._substr.length;
+ this._bitVector.set$I(index$0 - 1);
+};
+
+/**
+ * @param {!number} index
+ */
+Splitter.prototype.split$I = function (index) {
+ this._bitVector.set$I(index - 1);
+};
+
+/**
+ * @param {!number} position
+ * @return {!number}
+ */
+Splitter.prototype.getIndex$I = function (position) {
+ /** @type {BitVector} */
+ var this$0;
+ if (position < 0 || this._bitVector.size$() <= position) {
+ throw new Error("Section.getSectionIndex() : range error");
+ }
+ this$0 = this._bitVector;
+ return this$0.rank$IB(position, true);
+};
+
+/**
+ * @param {SingleResult} result
+ * @param {Array.<undefined|!number>} positions
+ * @param {!string} word
+ * @param {!boolean} stemmed
+ */
+Splitter.prototype.grouping$LSingleResult$AISB = function (result, positions, word, stemmed) {
+ /** @type {!number} */
+ var i;
+ /** @type {undefined|!number} */
+ var position;
+ /** @type {!number} */
+ var index;
+ /** @type {SearchUnit} */
+ var unit;
+ for (i = 0; i < positions.length; i++) {
+ position = positions[i];
+ index = this.getIndex$I(position);
+ unit = SingleResult$getSearchUnit$LSingleResult$I(result, index);
+ if (unit.startPosition < 0) {
+ unit.startPosition = this.getStartPosition$I(index);
+ }
+ SearchUnit$addPosition$LSearchUnit$SIB(unit, word, position - unit.startPosition, stemmed);
+ }
+};
+
+/**
+ * @param {!number} index
+ * @return {!string}
+ */
+Splitter.prototype.getInformation$I = function (index) {
+ return (this.name != null ? this.name + (index + 1 + "") : '');
+};
+
+/**
+ * @param {Oktavia} parent
+ * @param {!string} name
+ * @param {!string} data
+ * @param {!number} offset
+ * @return {!number}
+ */
+Splitter._load$LOktavia$SSI = function (parent, name, data, offset) {
+ /** @type {Splitter} */
+ var section;
+ section = new Splitter$LOktavia$(parent);
+ offset = section._bitVector.load$SI(data, offset);
+ section._parent._metadataLabels.push(name);
+ section._parent._metadatas[name] = section;
+ return offset;
+};
+
+var Splitter$_load$LOktavia$SSI = Splitter._load$LOktavia$SSI;
+
+/**
+ * @return {!string}
+ */
+Splitter.prototype._dump$ = function () {
+ return [ Binary$dump16bitNumber$I(1), Metadata.prototype._dump$.call(this) ].join('');
+};
+
+/**
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+Splitter.prototype._dump$LCompressionReport$ = function (report) {
+ CompressionReport$add$LCompressionReport$II(report, 1, 1);
+ return [ Binary$dump16bitNumber$I(1), Metadata.prototype._dump$LCompressionReport$.call(this, report) ].join('');
+};
+
+/**
+ * class Table extends Metadata
+ * @constructor
+ */
+function Table() {
+}
+
+Table.prototype = new Metadata;
+/**
+ * @constructor
+ * @param {Oktavia} parent
+ * @param {Array.<undefined|!string>} headers
+ */
+function Table$LOktavia$AS(parent, headers) {
+ this._parent = parent;
+ this._bitVector = new BitVector$();
+ this._headers = headers;
+ this._columnTails = new BitVector$();
+};
+
+Table$LOktavia$AS.prototype = new Table;
+
+/**
+ * @return {!number}
+ */
+Table.prototype.rowSize$ = function () {
+ /** @type {BitVector} */
+ var this$0$0;
+ /** @type {!number} */
+ var i$0$0;
+ /** @type {BitVector} */
+ var _bitVector$0;
+ this$0$0 = _bitVector$0 = this._bitVector;
+ i$0$0 = _bitVector$0._size;
+ return this$0$0.rank$IB(i$0$0, true);
+};
+
+/**
+ * @return {!number}
+ */
+Table.prototype.columnSize$ = function () {
+ return (this._headers.length | 0);
+};
+
+/**
+ */
+Table.prototype.setColumnTail$ = function () {
+ /** @type {!number} */
+ var index;
+ /** @type {Oktavia} */
+ var this$0;
+ /** @type {FMIndex} */
+ var this$0$0;
+ /** @type {Oktavia} */
+ var _parent$0;
+ this$0 = _parent$0 = this._parent;
+ this$0$0 = this$0._fmindex;
+ index = this$0$0._substr.length;
+ _parent$0._fmindex.push$S(Oktavia.eob);
+ this._columnTails.set$I(index - 1);
+};
+
+/**
+ */
+Table.prototype.setRowTail$ = function () {
+ /** @type {!number} */
+ var index;
+ /** @type {Oktavia} */
+ var this$0;
+ /** @type {FMIndex} */
+ var this$0$0;
+ this$0 = this._parent;
+ this$0$0 = this$0._fmindex;
+ index = this$0$0._substr.length;
+ this._bitVector.set$I(index - 1);
+};
+
+/**
+ * @param {!number} position
+ * @return {Array.<undefined|!number>}
+ */
+Table.prototype.getCell$I = function (position) {
+ /** @type {!number} */
+ var row;
+ /** @type {!number} */
+ var currentColumn;
+ /** @type {!number} */
+ var lastRowColumn;
+ /** @type {!number} */
+ var startPosition;
+ /** @type {Array.<undefined|!number>} */
+ var result;
+ /** @type {BitVector} */
+ var this$0;
+ /** @type {BitVector} */
+ var this$1;
+ if (position < 0 || this._bitVector.size$() <= position) {
+ throw new Error("Section.getSectionIndex() : range error " + (position + ""));
+ }
+ this$0 = this._bitVector;
+ row = this$0.rank$IB(position, true);
+ this$1 = this._columnTails;
+ currentColumn = this$1.rank$IB(position, true);
+ lastRowColumn = 0;
+ if (row > 0) {
+ startPosition = this._bitVector.select$I(row - 1) + 1;
+ lastRowColumn = this._columnTails.rank$I(startPosition);
+ }
+ result = [ row, currentColumn - lastRowColumn ];
+ return result;
+};
+
+/**
+ * @param {!number} rowIndex
+ * @return {Object.<string, undefined|!string>}
+ */
+Table.prototype.getRowContent$I = function (rowIndex) {
+ /** @type {!string} */
+ var content;
+ /** @type {Array.<undefined|!string>} */
+ var values;
+ /** @type {Object.<string, undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var i;
+ content = this.getContent$I(rowIndex);
+ values = content.split(Oktavia.eob, this._headers.length);
+ result = ({ });
+ for (i in this._headers) {
+ if (i < values.length) {
+ result[this._headers[i]] = values[i];
+ } else {
+ result[this._headers[i]] = '';
+ }
+ }
+ return result;
+};
+
+/**
+ * @param {SingleResult} result
+ * @param {Array.<undefined|!number>} positions
+ * @param {!string} word
+ * @param {!boolean} stemmed
+ */
+Table.prototype.grouping$LSingleResult$AISB = function (result, positions, word, stemmed) {
+};
+
+/**
+ * @param {!number} index
+ * @return {!string}
+ */
+Table.prototype.getInformation$I = function (index) {
+ return '';
+};
+
+/**
+ */
+Table.prototype._build$ = function () {
+ this._bitVector.build$();
+ this._columnTails.build$();
+};
+
+/**
+ * @param {Oktavia} parent
+ * @param {!string} name
+ * @param {!string} data
+ * @param {!number} offset
+ * @return {!number}
+ */
+Table._load$LOktavia$SSI = function (parent, name, data, offset) {
+ /** @type {LoadedStringListResult} */
+ var strs;
+ /** @type {Table} */
+ var table;
+ /** @type {!number} */
+ var offset$0;
+ strs = new LoadedStringListResult$SI(data, offset);
+ table = new Table$LOktavia$AS(parent, strs.result);
+ offset$0 = strs.offset;
+ offset$0 = table._bitVector.load$SI(data, offset$0);
+ table._parent._metadataLabels.push(name);
+ table._parent._metadatas[name] = table;
+ offset = offset$0;
+ return table._columnTails.load$SI(data, offset$0);
+};
+
+var Table$_load$LOktavia$SSI = Table._load$LOktavia$SSI;
+
+/**
+ * @return {!string}
+ */
+Table.prototype._dump$ = function () {
+ return [ Binary$dump16bitNumber$I(2), Binary$dumpStringList$AS(this._headers), Metadata.prototype._dump$.call(this), this._columnTails.dump$() ].join('');
+};
+
+/**
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+Table.prototype._dump$LCompressionReport$ = function (report) {
+ CompressionReport$add$LCompressionReport$II(report, 1, 1);
+ return [ Binary$dump16bitNumber$I(2), Binary$dumpStringList$ASLCompressionReport$(this._headers, report), Metadata.prototype._dump$LCompressionReport$.call(this, report), this._columnTails.dump$LCompressionReport$(report) ].join('');
+};
+
+/**
+ * class Block extends Metadata
+ * @constructor
+ */
+function Block() {
+}
+
+Block.prototype = new Metadata;
+/**
+ * @constructor
+ * @param {Oktavia} parent
+ */
+function Block$LOktavia$(parent) {
+ this._parent = parent;
+ this._bitVector = new BitVector$();
+ this._names = [ ];
+ this._start = false;
+};
+
+Block$LOktavia$.prototype = new Block;
+
+/**
+ * @param {!string} blockName
+ */
+Block.prototype.startBlock$S = function (blockName) {
+ this.startBlock$SI(blockName, this._parent.contentSize$());
+};
+
+/**
+ * @param {!string} blockName
+ * @param {!number} index
+ */
+Block.prototype.startBlock$SI = function (blockName, index) {
+ if (this._start) {
+ throw new Error('Splitter `' + this._names[this._names.length - 1] + '` is not closed');
+ }
+ this._start = true;
+ this._names.push(blockName);
+ this._bitVector.set$I(index - 1);
+};
+
+/**
+ */
+Block.prototype.endBlock$ = function () {
+ this.endBlock$I(this._parent.contentSize$());
+};
+
+/**
+ * @param {!number} index
+ */
+Block.prototype.endBlock$I = function (index) {
+ if (! this._start) {
+ throw new Error('Splitter is not started');
+ }
+ this._start = false;
+ this._bitVector.set$I(index - 1);
+};
+
+/**
+ * @return {!number}
+ */
+Block.prototype.size$ = function () {
+ return (this._names.length | 0);
+};
+
+/**
+ * @param {!number} position
+ * @return {!number}
+ */
+Block.prototype.blockIndex$I = function (position) {
+ /** @type {!number} */
+ var result;
+ /** @type {BitVector} */
+ var this$0;
+ if (position < 0 || this._parent._fmindex.size$() - 1 <= position) {
+ throw new Error("Block.blockIndex() : range error " + (position + ""));
+ }
+ if (position >= this._bitVector.size$()) {
+ position = (this._bitVector.size$() - 1 | 0);
+ result = (this._bitVector.rank$I(position) + 1 | 0);
+ } else {
+ this$0 = this._bitVector;
+ result = this$0.rank$IB(position, true);
+ }
+ return result;
+};
+
+/**
+ * @param {!number} position
+ * @return {!boolean}
+ */
+Block.prototype.inBlock$I = function (position) {
+ /** @type {!number} */
+ var blockIndex;
+ blockIndex = this.blockIndex$I(position);
+ return blockIndex % 2 !== 0;
+};
+
+/**
+ * @param {!number} position
+ * @return {!string}
+ */
+Block.prototype.getBlockContent$I = function (position) {
+ /** @type {!number} */
+ var blockIndex;
+ /** @type {!string} */
+ var result;
+ blockIndex = this.blockIndex$I(position);
+ if (blockIndex % 2 !== 0) {
+ result = this.getContent$I(blockIndex);
+ } else {
+ result = '';
+ }
+ return result;
+};
+
+/**
+ * @param {!number} position
+ * @return {!string}
+ */
+Block.prototype.getBlockName$I = function (position) {
+ /** @type {!number} */
+ var blockIndex;
+ /** @type {!string} */
+ var result;
+ blockIndex = this.blockIndex$I(position);
+ if (blockIndex % 2 !== 0) {
+ result = this._names[blockIndex >>> 1];
+ } else {
+ result = '';
+ }
+ return result;
+};
+
+/**
+ * @param {SingleResult} result
+ * @param {Array.<undefined|!number>} positions
+ * @param {!string} word
+ * @param {!boolean} stemmed
+ */
+Block.prototype.grouping$LSingleResult$AISB = function (result, positions, word, stemmed) {
+};
+
+/**
+ * @param {!number} index
+ * @return {!string}
+ */
+Block.prototype.getInformation$I = function (index) {
+ return '';
+};
+
+/**
+ * @param {Oktavia} parent
+ * @param {!string} name
+ * @param {!string} data
+ * @param {!number} offset
+ * @return {!number}
+ */
+Block._load$LOktavia$SSI = function (parent, name, data, offset) {
+ /** @type {LoadedStringListResult} */
+ var strs;
+ /** @type {Block} */
+ var block;
+ /** @type {!number} */
+ var offset$0;
+ strs = new LoadedStringListResult$SI(data, offset);
+ block = new Block$LOktavia$(parent);
+ block._names = strs.result;
+ offset$0 = strs.offset;
+ offset$0 = block._bitVector.load$SI(data, offset$0);
+ block._parent._metadataLabels.push(name);
+ block._parent._metadatas[name] = block;
+ return offset$0;
+};
+
+var Block$_load$LOktavia$SSI = Block._load$LOktavia$SSI;
+
+/**
+ * @return {!string}
+ */
+Block.prototype._dump$ = function () {
+ return [ Binary$dump16bitNumber$I(3), Binary$dumpStringList$AS(this._names), Metadata.prototype._dump$.call(this) ].join('');
+};
+
+/**
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+Block.prototype._dump$LCompressionReport$ = function (report) {
+ CompressionReport$add$LCompressionReport$II(report, 1, 1);
+ return [ Binary$dump16bitNumber$I(3), Binary$dumpStringList$ASLCompressionReport$(this._names, report), Metadata.prototype._dump$LCompressionReport$.call(this, report) ].join('');
+};
+
+/**
+ * class FMIndex extends Object
+ * @constructor
+ */
+function FMIndex() {
+}
+
+/**
+ * @constructor
+ */
+function FMIndex$() {
+ /** @type {Array.<undefined|!number>} */
+ var _rlt$0;
+ this._ssize = 0;
+ (this._ddic = 0, this._head = 0);
+ this._substr = "";
+ this._sv = new WaveletMatrix$();
+ this._posdic = [ ];
+ this._idic = [ ];
+ _rlt$0 = this._rlt = [ ];
+ _rlt$0.length = 65536;
+};
+
+FMIndex$.prototype = new FMIndex;
+
+/**
+ */
+FMIndex.prototype.clear$ = function () {
+ /** @type {WaveletMatrix} */
+ var this$0;
+ this$0 = this._sv;
+ this$0._bv.length = 0;
+ this$0._seps.length = 0;
+ this$0._size = 0;
+ this._posdic.length = 0;
+ this._idic.length = 0;
+ this._ddic = 0;
+ this._head = 0;
+ this._substr = "";
+};
+
+/**
+ * @return {!number}
+ */
+FMIndex.prototype.size$ = function () {
+ /** @type {WaveletMatrix} */
+ var this$0;
+ this$0 = this._sv;
+ return this$0._size;
+};
+
+/**
+ * @return {!number}
+ */
+FMIndex.prototype.contentSize$ = function () {
+ return this._substr.length;
+};
+
+/**
+ * @param {!string} key
+ * @return {!number}
+ */
+FMIndex.prototype.getRows$S = function (key) {
+ /** @type {Array.<undefined|!number>} */
+ var pos;
+ pos = [ ];
+ return this.getRows$SAI(key, pos);
+};
+
+/**
+ * @param {!string} key
+ * @param {Array.<undefined|!number>} pos
+ * @return {!number}
+ */
+FMIndex.prototype.getRows$SAI = function (key, pos) {
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var code;
+ /** @type {!number} */
+ var first;
+ /** @type {undefined|!number} */
+ var last;
+ /** @type {!number} */
+ var c;
+ /** @type {Array.<undefined|!number>} */
+ var _rlt$0;
+ i = key.length - 1;
+ code = key.charCodeAt(i);
+ first = (_rlt$0 = this._rlt)[code] + 1;
+ last = _rlt$0[code + 1];
+ while (first <= last) {
+ if (i === 0) {
+ pos[0] = (-- first | 0);
+ pos[1] = -- last;
+ return (last - first + 1 | 0);
+ }
+ i--;
+ c = key.charCodeAt(i);
+ first = this._rlt[c] + this._sv.rank$II(first - 1, c) + 1;
+ last = this._rlt[c] + this._sv.rank$II(last, c);
+ }
+ return 0;
+};
+
+/**
+ * @param {!number} i
+ * @return {!number}
+ */
+FMIndex.prototype.getPosition$I = function (i) {
+ /** @type {!number} */
+ var pos;
+ /** @type {!number} */
+ var c;
+ if (i >= this.size$()) {
+ throw new Error("FMIndex.getPosition() : range error");
+ }
+ pos = 0;
+ while (i !== this._head) {
+ if (i % this._ddic === 0) {
+ pos += this._posdic[i / this._ddic] + 1;
+ break;
+ }
+ c = this._sv.get$I(i);
+ i = this._rlt[c] + this._sv.rank$II(i, c);
+ pos++;
+ }
+ return (pos % this.size$() | 0);
+};
+
+/**
+ * @param {!number} pos
+ * @param {!number} len
+ * @return {!string}
+ */
+FMIndex.prototype.getSubstring$II = function (pos, len) {
+ /** @type {!number} */
+ var pos_end;
+ /** @type {!number} */
+ var pos_tmp;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var pos_idic;
+ /** @type {!string} */
+ var substr;
+ /** @type {!number} */
+ var c;
+ /** @type {!number} */
+ var _ddic$0;
+ if (pos >= this.size$()) {
+ throw new Error("FMIndex.getSubstring() : range error");
+ }
+ pos_end = Math.min(pos + len, this.size$());
+ pos_tmp = this.size$() - 1;
+ i = this._head;
+ pos_idic = Math.floor((pos_end + (_ddic$0 = this._ddic) - 2) / _ddic$0);
+ if (pos_idic < this._idic.length) {
+ pos_tmp = pos_idic * this._ddic;
+ i = this._idic[pos_idic];
+ }
+ substr = "";
+ while (pos_tmp >= pos) {
+ c = this._sv.get$I(i);
+ i = this._rlt[c] + this._sv.rank$II(i, c);
+ if (pos_tmp < pos_end) {
+ substr = String.fromCharCode(c) + substr;
+ }
+ if (pos_tmp === 0) {
+ break;
+ }
+ pos_tmp--;
+ }
+ return substr;
+};
+
+/**
+ */
+FMIndex.prototype.build$ = function () {
+ this.build$SIIB(String.fromCharCode(0), 65535, 20, false);
+};
+
+/**
+ * @param {!string} end_marker
+ * @param {!number} ddic
+ * @param {!boolean} verbose
+ */
+FMIndex.prototype.build$SIB = function (end_marker, ddic, verbose) {
+ this.build$SIIB(end_marker, 65535, ddic, verbose);
+};
+
+/**
+ * @param {!string} end_marker
+ * @param {!number} maxChar
+ * @param {!number} ddic
+ * @param {!boolean} verbose
+ */
+FMIndex.prototype.build$SIIB = function (end_marker, maxChar, ddic, verbose) {
+ /** @type {BurrowsWheelerTransform} */
+ var b;
+ /** @type {!string} */
+ var s;
+ /** @type {!number} */
+ var c;
+ /** @type {!string} */
+ var str$0;
+ /** @type {WaveletMatrix} */
+ var this$0;
+ /** @type {!string} */
+ var _str$0;
+ /** @type {Array.<undefined|!number>} */
+ var _suffixarray$0;
+ if (verbose) {
+ console.time("building burrows-wheeler transform");
+ }
+ this._substr += end_marker;
+ b = ({_str: "", _size: 0, _head: 0, _suffixarray: [ ]});
+ str$0 = this._substr;
+ _str$0 = b._str = str$0;
+ b._size = _str$0.length;
+ _suffixarray$0 = b._suffixarray = SAIS$make$S(str$0);
+ b._head = (_suffixarray$0.indexOf(0) | 0);
+ s = BurrowsWheelerTransform$get$LBurrowsWheelerTransform$(b);
+ this._ssize = s.length;
+ this._head = b._head;
+ b._str = "";
+ b._size = 0;
+ b._head = 0;
+ b._suffixarray.length = 0;
+ this._substr = "";
+ if (verbose) {
+ console.timeEnd("building burrows-wheeler transform");
+ }
+ if (verbose) {
+ console.time("building wavelet matrix");
+ }
+ this$0 = this._sv;
+ this$0._bitsize = (Math.ceil(Math.log(maxChar) / 0.6931471805599453) | 0);
+ if (verbose) {
+ console.log(" maxCharCode: ", maxChar);
+ console.log(" bitSize: ", this._sv.bitsize$());
+ }
+ this._sv.build$S(s);
+ if (verbose) {
+ console.timeEnd("building wavelet matrix");
+ }
+ if (verbose) {
+ console.time("caching rank less than");
+ }
+ for (c = 0; c < maxChar; c++) {
+ this._rlt[c] = this._sv.rank_less_than$II(this._sv.size$(), c);
+ }
+ if (verbose) {
+ console.timeEnd("caching rank less than");
+ }
+ this._ddic = ddic;
+ if (verbose) {
+ console.time("building dictionaries");
+ }
+ this._buildDictionaries$();
+ if (verbose) {
+ console.timeEnd("building dictionaries");
+ console.log('');
+ }
+};
+
+/**
+ */
+FMIndex.prototype._buildDictionaries$ = function () {
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var pos;
+ /** @type {!number} */
+ var c;
+ for (i = 0; i < this._ssize / this._ddic + 1; i++) {
+ this._posdic.push(0);
+ this._idic.push(0);
+ }
+ i = this._head;
+ pos = this.size$() - 1;
+ do {
+ if (i % this._ddic === 0) {
+ this._posdic[Math.floor(i / this._ddic)] = (pos | 0);
+ }
+ if (pos % this._ddic === 0) {
+ this._idic[Math.floor(pos / this._ddic)] = (i | 0);
+ }
+ c = this._sv.get$I(i);
+ i = this._rlt[c] + this._sv.rank$II(i, c);
+ pos--;
+ } while (i !== this._head);
+};
+
+/**
+ * @param {!string} doc
+ */
+FMIndex.prototype.push$S = function (doc) {
+ if (doc.length <= 0) {
+ throw new Error("FMIndex::push(): empty string");
+ }
+ this._substr += doc;
+};
+
+/**
+ * @param {!string} keyword
+ * @return {Array.<undefined|!number>}
+ */
+FMIndex.prototype.search$S = function (keyword) {
+ /** @type {Array.<undefined|!number>} */
+ var result;
+ /** @type {Array.<undefined|!number>} */
+ var position;
+ /** @type {!number} */
+ var rows;
+ /** @type {undefined|!number} */
+ var first;
+ /** @type {undefined|!number} */
+ var last;
+ /** @type {undefined|!number} */
+ var i;
+ result = [ ];
+ position = [ ];
+ rows = this.getRows$SAI(keyword, position);
+ if (rows > 0) {
+ first = position[0];
+ last = position[1];
+ for (i = first; i <= last; i++) {
+ result.push(this.getPosition$I(i));
+ }
+ }
+ return result;
+};
+
+/**
+ * @return {!string}
+ */
+FMIndex.prototype.dump$ = function () {
+ return this.dump$B(false);
+};
+
+/**
+ * @param {!boolean} verbose
+ * @return {!string}
+ */
+FMIndex.prototype.dump$B = function (verbose) {
+ /** @type {Array.<undefined|!string>} */
+ var contents;
+ /** @type {CompressionReport} */
+ var report;
+ /** @type {!number} */
+ var i;
+ contents = [ ];
+ report = ({source: 0, result: 0});
+ contents.push(Binary$dump32bitNumber$N(this._ddic));
+ contents.push(Binary$dump32bitNumber$N(this._ssize));
+ contents.push(Binary$dump32bitNumber$N(this._head));
+ CompressionReport$add$LCompressionReport$II(report, 6, 6);
+ contents.push(this._sv.dump$LCompressionReport$(report));
+ if (verbose) {
+ console.log("Serializing FM-index");
+ console.log(' Wavelet Matrix: ' + (contents[3].length * 2 + "") + ' bytes (' + (Math.round(report.result * 100.0 / report.source) + "") + '%)');
+ }
+ contents.push(Binary$dump32bitNumber$N(this._posdic.length));
+ for (i in this._posdic) {
+ contents.push(Binary$dump32bitNumber$N(this._posdic[i]));
+ }
+ for (i in this._idic) {
+ contents.push(Binary$dump32bitNumber$N(this._idic[i]));
+ }
+ if (verbose) {
+ console.log(' Dictionary Cache: ' + (this._idic.length * 16 + "") + ' bytes');
+ }
+ return contents.join("");
+};
+
+/**
+ * @param {!string} data
+ * @return {!number}
+ */
+FMIndex.prototype.load$S = function (data) {
+ return this.load$SI(data, 0);
+};
+
+/**
+ * @param {!string} data
+ * @param {!number} offset
+ * @return {!number}
+ */
+FMIndex.prototype.load$SI = function (data, offset) {
+ /** @type {!number} */
+ var maxChar;
+ /** @type {!number} */
+ var c;
+ /** @type {!number} */
+ var size;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var result$0;
+ /** @type {!number} */
+ var result$1;
+ result$0 = data.charCodeAt(offset) * 65536 + data.charCodeAt(offset + 1);
+ this._ddic = (result$0 | 0);
+ this._ssize = (Binary$load32bitNumber$SI(data, offset + 2) | 0);
+ this._head = (Binary$load32bitNumber$SI(data, offset + 4) | 0);
+ offset = this._sv.load$SI(data, offset + 6);
+ maxChar = Math.pow(2, this._sv.bitsize$());
+ for (c = 0; c < maxChar; c++) {
+ this._rlt[c] = this._sv.rank_less_than$II(this._sv.size$(), c);
+ }
+ result$1 = data.charCodeAt(offset) * 65536 + data.charCodeAt(offset + 1);
+ size = result$1;
+ offset += 2;
+ for (i = 0; i < size; (i++, offset += 2)) {
+ this._posdic.push(Binary$load32bitNumber$SI(data, offset));
+ }
+ for (i = 0; i < size; (i++, offset += 2)) {
+ this._idic.push(Binary$load32bitNumber$SI(data, offset));
+ }
+ return offset;
+};
+
+/**
+ * class Tag extends Object
+ * @constructor
+ */
+function Tag() {
+}
+
+/**
+ * @constructor
+ * @param {!string} name
+ */
+function Tag$S(name) {
+ this.name = name;
+ this.attributes = ({ });
+ this.isSelfClosing = false;
+};
+
+Tag$S.prototype = new Tag;
+
+/**
+ * class _Common extends Object
+ * @constructor
+ */
+function _Common() {
+}
+
+/**
+ * @constructor
+ */
+function _Common$() {
+};
+
+_Common$.prototype = new _Common;
+
+/**
+ * class _State extends Object
+ * @constructor
+ */
+function _State() {
+}
+
+/**
+ * @constructor
+ */
+function _State$() {
+};
+
+_State$.prototype = new _State;
+
+/**
+ * class SAXHandler extends Object
+ * @constructor
+ */
+function SAXHandler() {
+}
+
+/**
+ * @constructor
+ */
+function SAXHandler$() {
+ this.position = 0;
+ this.column = 0;
+ this.line = 0;
+};
+
+SAXHandler$.prototype = new SAXHandler;
+
+/**
+ * @param {Error} error
+ */
+SAXHandler.prototype.onerror$LError$ = function (error) {
+};
+
+/**
+ * @param {!string} text
+ */
+SAXHandler.prototype.ontext$S = function (text) {
+};
+
+/**
+ * @param {!string} doctype
+ */
+SAXHandler.prototype.ondoctype$S = function (doctype) {
+};
+
+/**
+ * @param {!string} name
+ * @param {!string} body
+ */
+SAXHandler.prototype.onprocessinginstruction$SS = function (name, body) {
+};
+
+/**
+ * @param {!string} sgmlDecl
+ */
+SAXHandler.prototype.onsgmldeclaration$S = function (sgmlDecl) {
+};
+
+/**
+ * @param {!string} tagname
+ * @param {Object.<string, undefined|!string>} attributes
+ */
+SAXHandler.prototype.onopentag$SHS = function (tagname, attributes) {
+};
+
+/**
+ * @param {!string} tagname
+ */
+SAXHandler.prototype.onclosetag$S = function (tagname) {
+};
+
+/**
+ * @param {!string} name
+ * @param {!string} value
+ */
+SAXHandler.prototype.onattribute$SS = function (name, value) {
+};
+
+/**
+ * @param {!string} comment
+ */
+SAXHandler.prototype.oncomment$S = function (comment) {
+};
+
+/**
+ */
+SAXHandler.prototype.onopencdata$ = function () {
+};
+
+/**
+ * @param {!string} cdata
+ */
+SAXHandler.prototype.oncdata$S = function (cdata) {
+};
+
+/**
+ */
+SAXHandler.prototype.onclosecdata$ = function () {
+};
+
+/**
+ */
+SAXHandler.prototype.onend$ = function () {
+};
+
+/**
+ */
+SAXHandler.prototype.onready$ = function () {
+};
+
+/**
+ * @param {!string} script
+ */
+SAXHandler.prototype.onscript$S = function (script) {
+};
+
+/**
+ * class _HTMLHandler extends SAXHandler
+ * @constructor
+ */
+function _HTMLHandler() {
+}
+
+_HTMLHandler.prototype = new SAXHandler;
+/**
+ * @constructor
+ * @param {Object.<string, undefined|Array.<undefined|!string>>} styles
+ * @param {!boolean} escape
+ */
+function _HTMLHandler$HASB(styles, escape) {
+ this.position = 0;
+ this.column = 0;
+ this.line = 0;
+ this.text = [ ];
+ this.escape = escape;
+ this.styles = styles;
+};
+
+_HTMLHandler$HASB.prototype = new _HTMLHandler;
+
+/**
+ * @param {!string} str
+ * @return {!string}
+ */
+_HTMLHandler.escapeHTML$S = function (str) {
+ return str.replace(/\n/g, "<br/>").replace(/&/g, "&amp;").replace(/"/g, "&quot;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
+};
+
+var _HTMLHandler$escapeHTML$S = _HTMLHandler.escapeHTML$S;
+
+/**
+ * @param {!string} tagname
+ * @param {Object.<string, undefined|!string>} attributes
+ */
+_HTMLHandler.prototype.onopentag$SHS = function (tagname, attributes) {
+ this.text.push(this.styles[tagname][0]);
+};
+
+/**
+ * @param {!string} tagname
+ */
+_HTMLHandler.prototype.onclosetag$S = function (tagname) {
+ this.text.push(this.styles[tagname][1]);
+};
+
+/**
+ * @param {!string} text
+ */
+_HTMLHandler.prototype.ontext$S = function (text) {
+ if (this.escape) {
+ this.text.push(text.replace(/\n/g, "<br/>").replace(/&/g, "&amp;").replace(/"/g, "&quot;").replace(/</g, "&lt;").replace(/>/g, "&gt;"));
+ } else {
+ this.text.push(text);
+ }
+};
+
+/**
+ * @return {!string}
+ */
+_HTMLHandler.prototype.result$ = function () {
+ return this.text.join('');
+};
+
+/**
+ * class SAXParser extends Object
+ * @constructor
+ */
+function SAXParser() {
+}
+
+/**
+ * @constructor
+ * @param {SAXHandler} handler
+ */
+function SAXParser$LSAXHandler$(handler) {
+ this.q = "";
+ this.c = "";
+ this.bufferCheckPosition = 0;
+ this.looseCase = "";
+ this.tags = [ ];
+ this.closed = false;
+ this.closedRoot = false;
+ this.sawRoot = false;
+ this.tag = null;
+ this.error = null;
+ this.handler = null;
+ this.ENTITIES = null;
+ this.strict = false;
+ this.tagName = "";
+ this.state = 0;
+ this.line = 0;
+ this.column = 0;
+ this.position = 0;
+ this.startTagPosition = 0;
+ this.attribName = "";
+ this.attribValue = "";
+ this.script = "";
+ this.textNode = "";
+ this.attribList = null;
+ this.noscript = false;
+ this.cdata = "";
+ this.procInstBody = "";
+ this.procInstName = "";
+ this.doctype = "";
+ this.entity = "";
+ this.sgmlDecl = "";
+ this.comment = "";
+ this.preTags = 0;
+ this._init$LSAXHandler$B(handler, false);
+};
+
+SAXParser$LSAXHandler$.prototype = new SAXParser;
+
+/**
+ * @constructor
+ * @param {SAXHandler} handler
+ * @param {!boolean} strict
+ */
+function SAXParser$LSAXHandler$B(handler, strict) {
+ this.q = "";
+ this.c = "";
+ this.bufferCheckPosition = 0;
+ this.looseCase = "";
+ this.tags = [ ];
+ this.closed = false;
+ this.closedRoot = false;
+ this.sawRoot = false;
+ this.tag = null;
+ this.error = null;
+ this.handler = null;
+ this.ENTITIES = null;
+ this.strict = false;
+ this.tagName = "";
+ this.state = 0;
+ this.line = 0;
+ this.column = 0;
+ this.position = 0;
+ this.startTagPosition = 0;
+ this.attribName = "";
+ this.attribValue = "";
+ this.script = "";
+ this.textNode = "";
+ this.attribList = null;
+ this.noscript = false;
+ this.cdata = "";
+ this.procInstBody = "";
+ this.procInstName = "";
+ this.doctype = "";
+ this.entity = "";
+ this.sgmlDecl = "";
+ this.comment = "";
+ this.preTags = 0;
+ this._init$LSAXHandler$B(handler, strict);
+};
+
+SAXParser$LSAXHandler$B.prototype = new SAXParser;
+
+/**
+ * @param {SAXHandler} handler
+ * @param {!boolean} strict
+ */
+SAXParser.prototype._init$LSAXHandler$B = function (handler, strict) {
+ this.handler = handler;
+ this.clearBuffers$();
+ this.q = "";
+ this.bufferCheckPosition = 65536;
+ this.looseCase = 'toLowerCase';
+ this.tags = [ ];
+ this.closed = this.closedRoot = this.sawRoot = false;
+ this.tag = null;
+ this.error = null;
+ this.strict = strict;
+ this.noscript = strict;
+ this.state = 1;
+ this.ENTITIES = _Entities$entity_list$();
+ this.attribList = [ ];
+ this.noscript = false;
+ this.preTags = 0;
+};
+
+/**
+ * @param {!boolean} flag
+ */
+SAXParser.prototype.set_noscript$B = function (flag) {
+ this.noscript = flag;
+};
+
+/**
+ * @return {SAXParser}
+ */
+SAXParser.prototype.resume$ = function () {
+ this.error = null;
+ return this;
+};
+
+/**
+ * @return {SAXParser}
+ */
+SAXParser.prototype.close$ = function () {
+ return this.parse$S('');
+};
+
+/**
+ * @param {!string} chunk
+ * @return {SAXParser}
+ */
+SAXParser.prototype.parse$S = function (chunk) {
+ /** @type {Char} */
+ var _;
+ /** @type {!number} */
+ var i;
+ /** @type {!string} */
+ var c;
+ /** @type {!number} */
+ var starti;
+ /** @type {!number} */
+ var pad;
+ /** @type {!number} */
+ var returnState;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$0;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$1;
+ /** @type {RegExp} */
+ var charclass$2;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$3;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$4;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$5;
+ /** @type {!string} */
+ var text$0;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$6;
+ /** @type {RegExp} */
+ var charclass$7;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$8;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$9;
+ /** @type {RegExp} */
+ var charclass$10;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$11;
+ /** @type {RegExp} */
+ var charclass$12;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$13;
+ /** @type {RegExp} */
+ var charclass$14;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$15;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$16;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$17;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$18;
+ /** @type {RegExp} */
+ var charclass$19;
+ /** @type {RegExp} */
+ var charclass$20;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$21;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$22;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$23;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$24;
+ /** @type {!string} */
+ var comment$0;
+ _ = new Char$();
+ if (this.error) {
+ throw this.error;
+ }
+ if (this.closed) {
+ return this.emiterror$S("Cannot write after close. Assign an onready handler.");
+ }
+ (i = 0, c = "");
+ while (this.c = c = chunk.charAt(i++)) {
+ this.position++;
+ if (c === "\n") {
+ this.handler.line++;
+ this.handler.column = 0;
+ } else {
+ this.handler.column++;
+ }
+ switch (this.state) {
+ case 1:
+ if (c === "<") {
+ this.state = 4;
+ this.startTagPosition = this.position;
+ } else {
+ charclass$0 = _.whitespace;
+ if (! $__jsx_ObjectHasOwnProperty.call(charclass$0, c)) {
+ this.strictFail$S("Non-whitespace before first tag.");
+ this.textNode = c;
+ this.state = 2;
+ }
+ }
+ continue;
+ case 2:
+ if (this.sawRoot && ! this.closedRoot) {
+ starti = i - 1;
+ while (c && c !== "<" && c !== "&") {
+ c = chunk.charAt(i++);
+ if (c) {
+ this.position++;
+ if (c === "\n") {
+ this.handler.line++;
+ this.handler.column = 0;
+ } else {
+ this.handler.column++;
+ }
+ }
+ }
+ this.textNode += chunk.substring(starti, i - 1);
+ }
+ if (c === "<") {
+ this.state = 4;
+ this.startTagPosition = this.position;
+ } else {
+ if (_.not$HBS(_.whitespace, c) && (! this.sawRoot || this.closedRoot)) {
+ this.strictFail$S("Text data outside of root node.");
+ }
+ if (c === "&") {
+ this.state = 3;
+ } else {
+ this.textNode += c;
+ }
+ }
+ continue;
+ case 33:
+ if (c === "<") {
+ this.state = 34;
+ } else {
+ this.script += c;
+ }
+ continue;
+ case 34:
+ if (c === "/") {
+ this.state = 31;
+ } else {
+ this.script += "<" + c;
+ this.state = 33;
+ }
+ continue;
+ case 4:
+ if (c === "!") {
+ this.state = 5;
+ this.sgmlDecl = "";
+ } else {
+ charclass$1 = _.whitespace;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$1, c)) {
+ } else {
+ charclass$2 = _.nameStart;
+ if (charclass$2.test(c)) {
+ this.state = 21;
+ this.tagName = c;
+ } else {
+ if (c === "/") {
+ this.state = 31;
+ this.tagName = "";
+ } else {
+ if (c === "?") {
+ this.state = 18;
+ this.procInstName = this.procInstBody = "";
+ } else {
+ this.strictFail$S("Unencoded <");
+ if (this.startTagPosition + 1 < this.position) {
+ pad = this.position - this.startTagPosition;
+ for (i = 0; i < pad; i++) {
+ c = " " + c;
+ }
+ }
+ this.textNode += "<" + c;
+ this.state = 2;
+ }
+ }
+ }
+ }
+ }
+ continue;
+ case 5:
+ if ((this.sgmlDecl + c).toUpperCase() === _.CDATA) {
+ this.closetext_if_exist$();
+ this.state = 15;
+ this.sgmlDecl = "";
+ this.cdata = "";
+ } else {
+ if (this.sgmlDecl + c === "--") {
+ this.state = 12;
+ this.comment = "";
+ this.sgmlDecl = "";
+ } else {
+ if ((this.sgmlDecl + c).toUpperCase() === _.DOCTYPE) {
+ this.state = 7;
+ if (this.doctype || this.sawRoot) {
+ this.strictFail$S("Inappropriately located doctype declaration");
+ }
+ this.doctype = "";
+ this.sgmlDecl = "";
+ } else {
+ if (c === ">") {
+ this.closetext_if_exist$();
+ this.sgmlDecl = "";
+ this.state = 2;
+ } else {
+ charclass$3 = _.quote;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$3, c)) {
+ this.state = 6;
+ this.sgmlDecl += c;
+ } else {
+ this.sgmlDecl += c;
+ }
+ }
+ }
+ }
+ }
+ continue;
+ case 6:
+ if (c === this.q) {
+ this.state = 5;
+ this.q = "";
+ }
+ this.sgmlDecl += c;
+ continue;
+ case 7:
+ if (c === ">") {
+ this.state = 2;
+ this.closetext_if_exist$();
+ this.doctype.trim();
+ } else {
+ this.doctype += c;
+ if (c === "[") {
+ this.state = 9;
+ } else {
+ charclass$4 = _.quote;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$4, c)) {
+ this.state = 8;
+ this.q = c;
+ }
+ }
+ }
+ continue;
+ case 8:
+ this.doctype += c;
+ if (c === this.q) {
+ this.q = "";
+ this.state = 7;
+ }
+ continue;
+ case 9:
+ this.doctype += c;
+ if (c === "]") {
+ this.state = 7;
+ } else {
+ charclass$5 = _.quote;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$5, c)) {
+ this.state = 10;
+ this.q = c;
+ }
+ }
+ continue;
+ case 10:
+ this.doctype += c;
+ if (c === this.q) {
+ this.state = 9;
+ this.q = "";
+ }
+ continue;
+ case 12:
+ if (c === "-") {
+ this.state = 13;
+ } else {
+ this.comment += c;
+ }
+ continue;
+ case 13:
+ if (c === "-") {
+ this.state = 14;
+ text$0 = this.comment;
+ text$0 = text$0.replace(/[\n\t]/g, ' ');
+ text$0 = text$0.replace(/\s\s+/g, " ");
+ comment$0 = this.comment = text$0;
+ if (comment$0) {
+ this.closetext_if_exist$();
+ this.comment.trim();
+ }
+ this.comment = "";
+ } else {
+ this.comment += "-" + c;
+ this.state = 12;
+ }
+ continue;
+ case 14:
+ if (c !== ">") {
+ this.strictFail$S("Malformed comment");
+ this.comment += "--" + c;
+ this.state = 12;
+ } else {
+ this.state = 2;
+ }
+ continue;
+ case 15:
+ if (c === "]") {
+ this.state = 16;
+ } else {
+ this.cdata += c;
+ }
+ continue;
+ case 16:
+ if (c === "]") {
+ this.state = 17;
+ } else {
+ this.cdata += "]" + c;
+ this.state = 15;
+ }
+ continue;
+ case 17:
+ if (c === ">") {
+ if (this.cdata) {
+ this.closetext_if_exist$();
+ }
+ this.cdata = "";
+ this.state = 2;
+ } else {
+ if (c === "]") {
+ this.cdata += "]";
+ } else {
+ this.cdata += "]]" + c;
+ this.state = 15;
+ }
+ }
+ continue;
+ case 18:
+ if (c === "?") {
+ this.state = 20;
+ } else {
+ charclass$6 = _.whitespace;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$6, c)) {
+ this.state = 19;
+ } else {
+ this.procInstName += c;
+ }
+ }
+ continue;
+ case 19:
+ if (! this.procInstBody && _.is$HBS(_.whitespace, c)) {
+ continue;
+ } else {
+ if (c === "?") {
+ this.state = 20;
+ } else {
+ this.procInstBody += c;
+ }
+ }
+ continue;
+ case 20:
+ if (c === ">") {
+ this.closetext_if_exist$();
+ this.procInstName = this.procInstBody = "";
+ this.state = 2;
+ } else {
+ this.procInstBody += "?" + c;
+ this.state = 19;
+ }
+ continue;
+ case 21:
+ charclass$7 = _.nameBody;
+ if (charclass$7.test(c)) {
+ this.tagName += c;
+ } else {
+ this.newTag$();
+ if (c === ">") {
+ this.openTag$B(false);
+ } else {
+ if (c === "/") {
+ this.state = 22;
+ } else {
+ charclass$8 = _.whitespace;
+ if (! $__jsx_ObjectHasOwnProperty.call(charclass$8, c)) {
+ this.strictFail$S("Invalid character in tag name");
+ }
+ this.state = 23;
+ }
+ }
+ }
+ continue;
+ case 22:
+ if (c === ">") {
+ this.openTag$B(true);
+ this.closeTag$();
+ } else {
+ this.strictFail$S("Forward-slash in opening tag not followed by >");
+ this.state = 23;
+ }
+ continue;
+ case 23:
+ charclass$9 = _.whitespace;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$9, c)) {
+ continue;
+ } else {
+ if (c === ">") {
+ this.openTag$B(false);
+ } else {
+ if (c === "/") {
+ this.state = 22;
+ } else {
+ charclass$10 = _.nameStart;
+ if (charclass$10.test(c)) {
+ this.attribName = c;
+ this.attribValue = "";
+ this.state = 24;
+ } else {
+ this.strictFail$S("Invalid attribute name");
+ }
+ }
+ }
+ }
+ continue;
+ case 24:
+ if (c === "=") {
+ this.state = 26;
+ } else {
+ if (c === ">") {
+ this.strictFail$S("Attribute without value");
+ this.attribValue = this.attribName;
+ this.attrib$();
+ this.openTag$B(false);
+ } else {
+ charclass$11 = _.whitespace;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$11, c)) {
+ this.state = 25;
+ } else {
+ charclass$12 = _.nameBody;
+ if (charclass$12.test(c)) {
+ this.attribName += c;
+ } else {
+ this.strictFail$S("Invalid attribute name");
+ }
+ }
+ }
+ }
+ continue;
+ case 25:
+ if (c === "=") {
+ this.state = 26;
+ } else {
+ charclass$13 = _.whitespace;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$13, c)) {
+ continue;
+ } else {
+ this.strictFail$S("Attribute without value");
+ this.tag.attributes[this.attribName] = "";
+ this.attribValue = "";
+ this.closetext_if_exist$();
+ this.attribName = "";
+ if (c === ">") {
+ this.openTag$B(false);
+ } else {
+ charclass$14 = _.nameStart;
+ if (charclass$14.test(c)) {
+ this.attribName = c;
+ this.state = 24;
+ } else {
+ this.strictFail$S("Invalid attribute name");
+ this.state = 23;
+ }
+ }
+ }
+ }
+ continue;
+ case 26:
+ charclass$15 = _.whitespace;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$15, c)) {
+ continue;
+ } else {
+ charclass$16 = _.quote;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$16, c)) {
+ this.q = c;
+ this.state = 27;
+ } else {
+ this.strictFail$S("Unquoted attribute value");
+ this.state = 28;
+ this.attribValue = c;
+ }
+ }
+ continue;
+ case 27:
+ if (c !== this.q) {
+ if (c === "&") {
+ this.state = 29;
+ } else {
+ this.attribValue += c;
+ }
+ continue;
+ }
+ this.attrib$();
+ this.q = "";
+ this.state = 23;
+ continue;
+ case 28:
+ charclass$17 = _.attribEnd;
+ if (! $__jsx_ObjectHasOwnProperty.call(charclass$17, c)) {
+ if (c === "&") {
+ this.state = 30;
+ } else {
+ this.attribValue += c;
+ }
+ continue;
+ }
+ this.attrib$();
+ if (c === ">") {
+ this.openTag$B(false);
+ } else {
+ this.state = 23;
+ }
+ continue;
+ case 31:
+ if (! this.tagName) {
+ charclass$18 = _.whitespace;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$18, c)) {
+ continue;
+ } else {
+ charclass$19 = _.nameStart;
+ if (! charclass$19.test(c)) {
+ if (this.script) {
+ this.script += "</" + c;
+ this.state = 33;
+ } else {
+ this.strictFail$S("Invalid tagname in closing tag.");
+ }
+ } else {
+ this.tagName = c;
+ }
+ }
+ } else {
+ if (c === ">") {
+ this.closeTag$();
+ } else {
+ charclass$20 = _.nameBody;
+ if (charclass$20.test(c)) {
+ this.tagName += c;
+ } else {
+ if (this.script) {
+ this.script += "</" + this.tagName;
+ this.tagName = "";
+ this.state = 33;
+ } else {
+ charclass$21 = _.whitespace;
+ if (! $__jsx_ObjectHasOwnProperty.call(charclass$21, c)) {
+ this.strictFail$S("Invalid tagname in closing tag");
+ }
+ this.state = 32;
+ }
+ }
+ }
+ }
+ continue;
+ case 32:
+ charclass$22 = _.whitespace;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$22, c)) {
+ continue;
+ }
+ if (c === ">") {
+ this.closeTag$();
+ } else {
+ this.strictFail$S("Invalid characters in closing tag");
+ }
+ continue;
+ case 3:
+ if (c === ";") {
+ this.textNode += this.parseEntity$();
+ this.entity = "";
+ this.state = 2;
+ } else {
+ charclass$23 = _.entity;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$23, c)) {
+ this.entity += c;
+ } else {
+ this.strictFail$S("Invalid character entity");
+ this.textNode += "&" + this.entity + c;
+ this.entity = "";
+ this.state = 2;
+ }
+ }
+ continue;
+ case 29:
+ case 30:
+ if (this.state === 29) {
+ returnState = 27;
+ } else {
+ returnState = 28;
+ }
+ if (c === ";") {
+ this.attribValue += this.parseEntity$();
+ this.entity = "";
+ this.state = (returnState | 0);
+ } else {
+ charclass$24 = _.entity;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$24, c)) {
+ this.entity += c;
+ } else {
+ this.strictFail$S("Invalid character entity");
+ this.attribValue += "&" + this.entity + c;
+ this.entity = "";
+ this.state = (returnState | 0);
+ }
+ }
+ continue;
+ default:
+ throw new Error("Unknown state: " + (this.state + ""));
+ }
+ }
+ this.end$();
+ return this;
+};
+
+/**
+ */
+SAXParser.prototype.clearBuffers$ = function () {
+ this.comment = '';
+ this.sgmlDecl = '';
+ this.textNode = '';
+ this.tagName = '';
+ this.doctype = '';
+ this.procInstName = '';
+ this.procInstBody = '';
+ this.entity = '';
+ this.attribName = '';
+ this.attribValue = '';
+ this.cdata = '';
+ this.script = '';
+};
+
+/**
+ */
+SAXParser.prototype.closetext_if_exist$ = function () {
+ if (this.textNode !== '') {
+ this.closetext$();
+ }
+};
+
+/**
+ */
+SAXParser.prototype.closetext$ = function () {
+ /** @type {!string} */
+ var text;
+ /** @type {!string} */
+ var text$0;
+ if (this.preTags === 0) {
+ text$0 = this.textNode;
+ text$0 = text$0.replace(/[\n\t]/g, ' ');
+ text$0 = text$0.replace(/\s\s+/g, " ");
+ text = text$0;
+ if (text$0) {
+ this.handler.ontext$S(text);
+ }
+ } else {
+ if (this.textNode) {
+ this.handler.ontext$S(this.textNode);
+ }
+ }
+ this.textNode = "";
+};
+
+/**
+ * @param {!string} text
+ * @return {!string}
+ */
+SAXParser.prototype.textopts$S = function (text) {
+ text = text.replace(/[\n\t]/g, ' ');
+ text = text.replace(/\s\s+/g, " ");
+ return text;
+};
+
+/**
+ * @param {!string} er
+ * @return {SAXParser}
+ */
+SAXParser.prototype.emiterror$S = function (er) {
+ /** @type {Error} */
+ var error;
+ this.closetext$();
+ er += "\nLine: " + (this.line + "") + "\nColumn: " + (this.column + "") + "\nChar: " + this.c;
+ error = new Error(er);
+ this.error = error;
+ return this;
+};
+
+/**
+ */
+SAXParser.prototype.end$ = function () {
+ if (! this.closedRoot) {
+ this.strictFail$S("Unclosed root tag");
+ }
+ if (this.state !== 2) {
+ this.emiterror$S("Unexpected end");
+ }
+ this.closetext$();
+ this.c = "";
+ this.closed = true;
+};
+
+/**
+ * @param {!string} message
+ */
+SAXParser.prototype.strictFail$S = function (message) {
+ if (this.strict) {
+ this.emiterror$S(message);
+ }
+};
+
+/**
+ */
+SAXParser.prototype.newTag$ = function () {
+ if (! this.strict) {
+ this.tagName = this.tagName.toLowerCase();
+ }
+ this.tag = ({name: this.tagName, attributes: ({ }), isSelfClosing: false});
+ this.attribList.length = 0;
+};
+
+/**
+ */
+SAXParser.prototype.attrib$ = function () {
+ if (! this.strict) {
+ this.attribName = this.attribName.toLowerCase();
+ }
+ if ($__jsx_ObjectHasOwnProperty.call(this.tag.attributes, this.attribName)) {
+ this.attribName = this.attribValue = "";
+ return;
+ }
+ this.tag.attributes[this.attribName] = this.attribValue;
+ this.closetext_if_exist$();
+ this.attribName = this.attribValue = "";
+};
+
+/**
+ */
+SAXParser.prototype.openTag$ = function () {
+ this.openTag$B(false);
+};
+
+/**
+ * @param {!boolean} selfClosing
+ */
+SAXParser.prototype.openTag$B = function (selfClosing) {
+ /** @type {Tag} */
+ var tag$0;
+ /** @type {Tag} */
+ var tag$1;
+ (tag$0 = this.tag).isSelfClosing = selfClosing;
+ this.sawRoot = true;
+ this.tags.push(tag$0);
+ this.closetext_if_exist$();
+ this.handler.onopentag$SHS((tag$1 = this.tag).name, tag$1.attributes);
+ if (this.tag.name === 'pre') {
+ this.preTags++;
+ }
+ if (! selfClosing) {
+ if (! this.noscript && this.tagName.toLowerCase() === "script") {
+ this.state = 33;
+ } else {
+ this.state = 2;
+ }
+ this.tag = null;
+ this.tagName = "";
+ }
+ this.attribName = this.attribValue = "";
+ this.attribList.length = 0;
+};
+
+/**
+ */
+SAXParser.prototype.closeTag$ = function () {
+ /** @type {!number} */
+ var t;
+ /** @type {!string} */
+ var tagName;
+ /** @type {!string} */
+ var closeTo;
+ /** @type {Tag} */
+ var close;
+ /** @type {!number} */
+ var s;
+ /** @type {Tag} */
+ var tag$0;
+ if (! this.tagName) {
+ this.strictFail$S("Weird empty close tag.");
+ this.textNode += "</>";
+ this.state = 2;
+ return;
+ }
+ if (this.script) {
+ if (this.tagName !== "script") {
+ this.script += "</" + this.tagName + ">";
+ this.tagName = "";
+ this.state = 33;
+ return;
+ }
+ this.closetext_if_exist$();
+ this.script = "";
+ }
+ t = this.tags.length;
+ tagName = this.tagName;
+ if (! this.strict) {
+ tagName = tagName.toLowerCase();
+ }
+ closeTo = tagName;
+ while (t--) {
+ close = this.tags[t];
+ if (close.name !== closeTo) {
+ this.strictFail$S("Unexpected close tag");
+ } else {
+ break;
+ }
+ }
+ if (t < 0) {
+ this.strictFail$S("Unmatched closing tag: " + this.tagName);
+ this.textNode += "</" + this.tagName + ">";
+ this.state = 2;
+ return;
+ }
+ this.tagName = tagName;
+ s = this.tags.length;
+ while (s-- > t) {
+ tag$0 = this.tag = this.tags.pop();
+ this.tagName = tag$0.name;
+ this.closetext_if_exist$();
+ this.handler.onclosetag$S(this.tagName);
+ if (this.tagName === 'pre') {
+ this.preTags--;
+ }
+ }
+ if (t === 0) {
+ this.closedRoot = true;
+ }
+ this.tagName = this.attribValue = this.attribName = "";
+ this.attribList.length = 0;
+ this.state = 2;
+};
+
+/**
+ * @return {!string}
+ */
+SAXParser.prototype.parseEntity$ = function () {
+ /** @type {!string} */
+ var entity;
+ /** @type {!string} */
+ var entityLC;
+ /** @type {!number} */
+ var num;
+ /** @type {!string} */
+ var numStr;
+ entity = this.entity;
+ entityLC = entity.toLowerCase();
+ num = 0;
+ numStr = "";
+ if (this.ENTITIES[entity]) {
+ return this.ENTITIES[entity];
+ }
+ if (this.ENTITIES[entityLC]) {
+ return this.ENTITIES[entityLC];
+ }
+ entity = entityLC;
+ if (entityLC.charAt(0) === "#") {
+ if (entity.charAt(1) === "x") {
+ entity = entity.slice(2);
+ num = $__jsx_parseInt(entity, 16);
+ numStr = num.toString(16);
+ } else {
+ entity = entity.slice(1);
+ num = $__jsx_parseInt(entity, 10);
+ numStr = num.toString(10);
+ }
+ }
+ entity = entity.replace(/^0+/, "");
+ if (numStr.toLowerCase() !== entity) {
+ this.strictFail$S("Invalid character entity");
+ return "&" + this.entity + ";";
+ }
+ return String.fromCharCode(num);
+};
+
+/**
+ * class Char extends Object
+ * @constructor
+ */
+function Char() {
+}
+
+/**
+ * @constructor
+ */
+function Char$() {
+ this.CDATA = "[CDATA[";
+ this.DOCTYPE = "DOCTYPE";
+ this.XML_NAMESPACE = "http://www.w3.org/XML/1998/namespace";
+ this.whitespace = this._charClass$S("\r\n\t ");
+ this.number = this._charClass$S("0124356789");
+ this.letter = this._charClass$S("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ");
+ this.quote = this._charClass$S("'\"");
+ this.entity = this._charClass$S("0124356789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ#");
+ this.attribEnd = this._charClass$S("\r\n\t >");
+ this.nameStart = /[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/;
+ this.nameBody = /[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040\.\d-]/;
+};
+
+Char$.prototype = new Char;
+
+/**
+ * @param {!string} str
+ * @return {Object.<string, undefined|!boolean>}
+ */
+Char.prototype._charClass$S = function (str) {
+ /** @type {Object.<string, undefined|!boolean>} */
+ var result;
+ /** @type {!number} */
+ var i;
+ result = ({ });
+ for (i = 0; i < str.length; i++) {
+ result[str.slice(i, i + 1)] = true;
+ }
+ return result;
+};
+
+/**
+ * @param {RegExp} charclass
+ * @param {!string} c
+ * @return {!boolean}
+ */
+Char.prototype.is$LRegExp$S = function (charclass, c) {
+ return charclass.test(c);
+};
+
+/**
+ * @param {Object.<string, undefined|!boolean>} charclass
+ * @param {!string} c
+ * @return {!boolean}
+ */
+Char.prototype.is$HBS = function (charclass, c) {
+ return $__jsx_ObjectHasOwnProperty.call(charclass, c);
+};
+
+/**
+ * @param {RegExp} charclass
+ * @param {!string} c
+ * @return {!boolean}
+ */
+Char.prototype.not$LRegExp$S = function (charclass, c) {
+ return ! charclass.test(c);
+};
+
+/**
+ * @param {Object.<string, undefined|!boolean>} charclass
+ * @param {!string} c
+ * @return {!boolean}
+ */
+Char.prototype.not$HBS = function (charclass, c) {
+ return ! $__jsx_ObjectHasOwnProperty.call(charclass, c);
+};
+
+/**
+ * class _Entities extends Object
+ * @constructor
+ */
+function _Entities() {
+}
+
+/**
+ * @constructor
+ */
+function _Entities$() {
+};
+
+_Entities$.prototype = new _Entities;
+
+/**
+ * @return {Object.<string, undefined|!string>}
+ */
+_Entities.entity_list$ = function () {
+ /** @type {Object.<string, undefined|!string>} */
+ var result;
+ /** @type {!string} */
+ var key;
+ /** @type {*} */
+ var value;
+ result = ({ });
+ for (key in _Entities._entities) {
+ value = _Entities._entities[key];
+ if (typeof value === 'string') {
+ result[key] = value + "";
+ } else {
+ if (typeof value === 'number') {
+ result[key] = String.fromCharCode(value | 0);
+ }
+ }
+ }
+ return result;
+};
+
+var _Entities$entity_list$ = _Entities.entity_list$;
+
+/**
+ * class BitVector extends Object
+ * @constructor
+ */
+function BitVector() {
+}
+
+/**
+ * @constructor
+ */
+function BitVector$() {
+ /** @type {Array.<undefined|!number>} */
+ var _v$0;
+ /** @type {Array.<undefined|!number>} */
+ var _r$0;
+ _r$0 = this._r = [ ];
+ _v$0 = this._v = [ ];
+ _v$0.length = 0;
+ _r$0.length = 0;
+ this._size = 0;
+ this._size1 = 0;
+};
+
+BitVector$.prototype = new BitVector;
+
+/**
+ */
+BitVector.prototype.build$ = function () {
+ /** @type {!number} */
+ var i;
+ this._size1 = 0;
+ for (i = 0; i < this._v.length; i++) {
+ if (i % 8 === 0) {
+ this._r.push(true ? this._size1 : this._size - this._size1);
+ }
+ this._size1 += this._rank32$IIB(this._v[i], 32, true);
+ }
+};
+
+/**
+ */
+BitVector.prototype.clear$ = function () {
+ this._v.length = 0;
+ this._r.length = 0;
+ this._size = 0;
+ this._size1 = 0;
+};
+
+/**
+ * @return {!number}
+ */
+BitVector.prototype.size$ = function () {
+ return this._size;
+};
+
+/**
+ * @param {!boolean} b
+ * @return {!number}
+ */
+BitVector.prototype.size$B = function (b) {
+ return (b ? this._size1 : this._size - this._size1);
+};
+
+/**
+ * @param {!number} value
+ */
+BitVector.prototype.set$I = function (value) {
+ this.set$IB(value, true);
+};
+
+/**
+ * @param {!number} value
+ * @param {!boolean} flag
+ */
+BitVector.prototype.set$IB = function (value, flag) {
+ /** @type {!number} */
+ var q;
+ /** @type {!number} */
+ var r;
+ /** @type {!number} */
+ var m;
+ if (value >= this._size) {
+ this._size = (value + 1 | 0);
+ }
+ q = (value / 32 | 0);
+ r = (value % 32 | 0);
+ while (q >= this._v.length) {
+ this._v.push(0);
+ }
+ m = 0x1 << r;
+ if (flag) {
+ this._v[q] |= m;
+ } else {
+ this._v[q] &= ~ m;
+ }
+};
+
+/**
+ * @param {!number} value
+ * @return {!boolean}
+ */
+BitVector.prototype.get$I = function (value) {
+ /** @type {!number} */
+ var q;
+ /** @type {!number} */
+ var r;
+ /** @type {!number} */
+ var m;
+ if (value >= this._size) {
+ throw new Error("BitVector.get() : range error");
+ }
+ q = (value / 32 | 0);
+ r = (value % 32 | 0);
+ m = 0x1 << r;
+ return !! (this._v[q] & m);
+};
+
+/**
+ * @param {!number} i
+ * @return {!number}
+ */
+BitVector.prototype.rank$I = function (i) {
+ return this.rank$IB(i, true);
+};
+
+/**
+ * @param {!number} i
+ * @param {!boolean} b
+ * @return {!number}
+ */
+BitVector.prototype.rank$IB = function (i, b) {
+ /** @type {!number} */
+ var q_large;
+ /** @type {!number} */
+ var q_small;
+ /** @type {!number} */
+ var r;
+ /** @type {!number} */
+ var rank;
+ /** @type {!number} */
+ var begin;
+ /** @type {!number} */
+ var j;
+ if (i > this._size) {
+ throw new Error("BitVector.rank() : range error");
+ }
+ if (i === 0) {
+ return 0;
+ }
+ i--;
+ q_large = (Math.floor(i / 256) | 0);
+ q_small = (Math.floor(i / 32) | 0);
+ r = (Math.floor(i % 32) | 0);
+ rank = (this._r[q_large] | 0);
+ if (! b) {
+ rank = q_large * 256 - rank;
+ }
+ begin = q_large * 8;
+ for (j = begin; j < q_small; j++) {
+ rank += this._rank32$IIB(this._v[j], 32, b);
+ }
+ rank += this._rank32$IIB(this._v[q_small], r + 1, b);
+ return rank;
+};
+
+/**
+ * @param {!number} i
+ * @return {!number}
+ */
+BitVector.prototype.select$I = function (i) {
+ return this.select$IB(i, true);
+};
+
+/**
+ * @param {!number} i
+ * @param {!boolean} b
+ * @return {!number}
+ */
+BitVector.prototype.select$IB = function (i, b) {
+ /** @type {!number} */
+ var left;
+ /** @type {!number} */
+ var right;
+ /** @type {!number} */
+ var pivot;
+ /** @type {undefined|!number} */
+ var rank;
+ /** @type {!number} */
+ var j;
+ if (i >= (b ? this._size1 : this._size - this._size1)) {
+ throw new Error("BitVector.select() : range error");
+ }
+ left = 0;
+ right = this._r.length;
+ while (left < right) {
+ pivot = Math.floor((left + right) / 2);
+ rank = this._r[pivot];
+ if (! b) {
+ rank = pivot * 256 - rank;
+ }
+ if (i < rank) {
+ right = pivot;
+ } else {
+ left = pivot + 1;
+ }
+ }
+ right--;
+ if (b) {
+ i -= (this._r[right] | 0);
+ } else {
+ i -= (right * 256 - this._r[right] | 0);
+ }
+ j = right * 8;
+ while (1) {
+ rank = this._rank32$IIB(this._v[j], 32, b);
+ if (i < rank) {
+ break;
+ }
+ j++;
+ i -= (rank | 0);
+ }
+ return (j * 32 + this._select32$IIB(this._v[j], i, b) | 0);
+};
+
+/**
+ * @param {!number} x
+ * @param {!number} i
+ * @param {!boolean} b
+ * @return {!number}
+ */
+BitVector.prototype._rank32$IIB = function (x, i, b) {
+ if (! b) {
+ x = ~ x;
+ }
+ x <<= 32 - i;
+ x = ((x & 0xaaaaaaaa) >>> 1) + (x & 0x55555555);
+ x = ((x & 0xcccccccc) >>> 2) + (x & 0x33333333);
+ x = ((x & 0xf0f0f0f0) >>> 4) + (x & 0x0f0f0f0f);
+ x = ((x & 0xff00ff00) >>> 8) + (x & 0x00ff00ff);
+ x = ((x & 0xffff0000) >>> 16) + (x & 0x0000ffff);
+ return x;
+};
+
+/**
+ * @param {!number} x
+ * @param {!number} i
+ * @param {!boolean} b
+ * @return {!number}
+ */
+BitVector.prototype._select32$IIB = function (x, i, b) {
+ /** @type {!number} */
+ var x1;
+ /** @type {!number} */
+ var x2;
+ /** @type {!number} */
+ var x3;
+ /** @type {!number} */
+ var x4;
+ /** @type {!number} */
+ var x5;
+ /** @type {!number} */
+ var pos;
+ /** @type {!number} */
+ var v5;
+ /** @type {!number} */
+ var v4;
+ /** @type {!number} */
+ var v3;
+ /** @type {!number} */
+ var v2;
+ /** @type {!number} */
+ var v1;
+ /** @type {!number} */
+ var v0;
+ if (! b) {
+ x = ~ x;
+ }
+ x1 = ((x & 0xaaaaaaaa) >>> 1) + (x & 0x55555555);
+ x2 = ((x1 & 0xcccccccc) >>> 2) + (x1 & 0x33333333);
+ x3 = ((x2 & 0xf0f0f0f0) >>> 4) + (x2 & 0x0f0f0f0f);
+ x4 = ((x3 & 0xff00ff00) >>> 8) + (x3 & 0x00ff00ff);
+ x5 = ((x4 & 0xffff0000) >>> 16) + (x4 & 0x0000ffff);
+ i++;
+ pos = 0;
+ v5 = x5 & 0xffffffff;
+ if (i > v5) {
+ i -= (v5 | 0);
+ pos += 32;
+ }
+ v4 = x4 >>> pos & 0x0000ffff;
+ if (i > v4) {
+ i -= (v4 | 0);
+ pos += 16;
+ }
+ v3 = x3 >>> pos & 0x000000ff;
+ if (i > v3) {
+ i -= (v3 | 0);
+ pos += 8;
+ }
+ v2 = x2 >>> pos & 0x0000000f;
+ if (i > v2) {
+ i -= (v2 | 0);
+ pos += 4;
+ }
+ v1 = x1 >>> pos & 0x00000003;
+ if (i > v1) {
+ i -= (v1 | 0);
+ pos += 2;
+ }
+ v0 = x >>> pos & 0x00000001;
+ if (i > v0) {
+ i -= (v0 | 0);
+ pos += 1;
+ }
+ return (pos | 0);
+};
+
+/**
+ * @return {!string}
+ */
+BitVector.prototype.dump$ = function () {
+ /** @type {Array.<undefined|!string>} */
+ var contents;
+ contents = [ ];
+ contents.push(Binary$dump32bitNumber$N(this._size));
+ contents.push(Binary$dump32bitNumberList$AN(this._v));
+ return contents.join('');
+};
+
+/**
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+BitVector.prototype.dump$LCompressionReport$ = function (report) {
+ /** @type {Array.<undefined|!string>} */
+ var contents;
+ contents = [ ];
+ contents.push(Binary$dump32bitNumber$N(this._size));
+ CompressionReport$add$LCompressionReport$II(report, 2, 2);
+ contents.push(Binary$dump32bitNumberList$ANLCompressionReport$(this._v, report));
+ return contents.join('');
+};
+
+/**
+ * @param {!string} data
+ * @return {!number}
+ */
+BitVector.prototype.load$S = function (data) {
+ return this.load$SI(data, 0);
+};
+
+/**
+ * @param {!string} data
+ * @param {!number} offset
+ * @return {!number}
+ */
+BitVector.prototype.load$SI = function (data, offset) {
+ /** @type {LoadedNumberListResult} */
+ var result;
+ /** @type {!number} */
+ var result$0;
+ this._v.length = 0;
+ this._r.length = 0;
+ this._size = 0;
+ this._size1 = 0;
+ result$0 = data.charCodeAt(offset) * 65536 + data.charCodeAt(offset + 1);
+ this._size = (result$0 | 0);
+ result = Binary$load32bitNumberList$SI(data, offset + 2);
+ this._v = result.result;
+ this.build$();
+ return result.offset;
+};
+
+/**
+ * class WaveletMatrix extends Object
+ * @constructor
+ */
+function WaveletMatrix() {
+}
+
+/**
+ * @constructor
+ */
+function WaveletMatrix$() {
+ /** @type {Array.<undefined|BitVector>} */
+ var _bv$0;
+ /** @type {Array.<undefined|!number>} */
+ var _seps$0;
+ this._range = ({ });
+ _bv$0 = this._bv = [ ];
+ _seps$0 = this._seps = [ ];
+ this._bitsize = 16;
+ _bv$0.length = 0;
+ _seps$0.length = 0;
+ this._size = 0;
+};
+
+WaveletMatrix$.prototype = new WaveletMatrix;
+
+/**
+ * @return {!number}
+ */
+WaveletMatrix.prototype.bitsize$ = function () {
+ return this._bitsize;
+};
+
+/**
+ * @param {!number} charCode
+ */
+WaveletMatrix.prototype.setMaxCharCode$I = function (charCode) {
+ this._bitsize = (Math.ceil(Math.log(charCode) / 0.6931471805599453) | 0);
+};
+
+/**
+ */
+WaveletMatrix.prototype.clear$ = function () {
+ this._bv.length = 0;
+ this._seps.length = 0;
+ this._size = 0;
+};
+
+/**
+ * @param {!string} v
+ */
+WaveletMatrix.prototype.build$S = function (v) {
+ /** @type {!number} */
+ var size;
+ /** @type {!number} */
+ var bitsize;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var depth;
+ /** @type {Object.<string, undefined|!number>} */
+ var range_tmp;
+ /** @type {!number} */
+ var code;
+ /** @type {!boolean} */
+ var bit;
+ /** @type {!number} */
+ var key;
+ /** @type {Object.<string, undefined|!number>} */
+ var range_rev;
+ /** @type {!string} */
+ var range_key;
+ /** @type {!number} */
+ var value;
+ /** @type {!number} */
+ var pos0;
+ /** @type {undefined|!number} */
+ var pos1;
+ /** @type {!string} */
+ var range_rev_key;
+ /** @type {!number} */
+ var begin;
+ /** @type {undefined|!number} */
+ var end;
+ /** @type {!number} */
+ var num0;
+ /** @type {!number} */
+ var num1;
+ this._bv.length = 0;
+ this._seps.length = 0;
+ this._size = 0;
+ size = v.length;
+ bitsize = this._bitsize;
+ for (i = 0; i < bitsize; i++) {
+ this._bv.push(new BitVector$());
+ this._seps.push(0);
+ }
+ this._size = (size | 0);
+ for (i = 0; i < size; i++) {
+ this._bv[0].set$IB(i, this._uint2bit$II(v.charCodeAt(i), 0));
+ }
+ this._bv[0].build$();
+ this._seps[0] = this._bv[0].size$B(false);
+ this._range["0"] = 0;
+ this._range["1"] = this._seps[0];
+ depth = 1;
+ while (depth < bitsize) {
+ range_tmp = WaveletMatrix$_shallow_copy$HI(this._range);
+ for (i = 0; i < size; i++) {
+ code = v.charCodeAt(i);
+ bit = this._uint2bit$II(code, depth);
+ key = code >>> bitsize - depth;
+ this._bv[depth].set$IB(range_tmp[key + ""], bit);
+ range_tmp[key + ""]++;
+ }
+ this._bv[depth].build$();
+ this._seps[depth] = this._bv[depth].size$B(false);
+ range_rev = ({ });
+ for (range_key in this._range) {
+ value = this._range[range_key];
+ if (value != range_tmp[range_key]) {
+ range_rev[value + ""] = range_key | 0;
+ }
+ }
+ this._range = ({ });
+ pos0 = 0;
+ pos1 = this._seps[depth];
+ for (range_rev_key in range_rev) {
+ begin = range_rev_key | 0;
+ value = range_rev[range_rev_key];
+ end = range_tmp[value + ""];
+ num0 = this._bv[depth].rank$IB(end, false) - this._bv[depth].rank$IB(begin, false);
+ num1 = end - begin - num0;
+ if (num0 > 0) {
+ this._range[(value << 1) + ""] = (pos0 | 0);
+ pos0 += num0;
+ }
+ if (num1 > 0) {
+ this._range[(value << 1) + 1 + ""] = pos1;
+ pos1 += (num1 | 0);
+ }
+ }
+ depth++;
+ }
+};
+
+/**
+ * @return {!number}
+ */
+WaveletMatrix.prototype.size$ = function () {
+ return this._size;
+};
+
+/**
+ * @param {!number} c
+ * @return {!number}
+ */
+WaveletMatrix.prototype.size$I = function (c) {
+ return this.rank$II(this._size, c);
+};
+
+/**
+ * @param {!number} i
+ * @return {!number}
+ */
+WaveletMatrix.prototype.get$I = function (i) {
+ /** @type {!number} */
+ var value;
+ /** @type {!number} */
+ var depth;
+ /** @type {!boolean} */
+ var bit;
+ if (i >= this._size) {
+ throw new Error("WaveletMatrix.get() : range error");
+ }
+ value = 0;
+ depth = 0;
+ while (depth < this._bitsize) {
+ bit = this._bv[depth].get$I(i);
+ i = this._bv[depth].rank$IB(i, bit);
+ value <<= 1;
+ if (bit) {
+ i += this._seps[depth];
+ value += 1;
+ }
+ depth++;
+ }
+ return (value | 0);
+};
+
+/**
+ * @param {!number} i
+ * @param {!number} c
+ * @return {!number}
+ */
+WaveletMatrix.prototype.rank$II = function (i, c) {
+ /** @type {undefined|!number} */
+ var begin;
+ /** @type {!number} */
+ var end;
+ /** @type {!number} */
+ var depth;
+ /** @type {!boolean} */
+ var bit;
+ if (i > this._size) {
+ throw new Error("WaveletMatrix.rank(): range error");
+ }
+ if (i === 0) {
+ return 0;
+ }
+ begin = this._range[c + ""];
+ if (begin == null) {
+ return 0;
+ }
+ end = i;
+ depth = 0;
+ while (depth < this._bitsize) {
+ bit = this._uint2bit$II(c, depth);
+ end = this._bv[depth].rank$IB(end, bit);
+ if (bit) {
+ end += this._seps[depth];
+ }
+ depth++;
+ }
+ return (end - begin | 0);
+};
+
+/**
+ * @param {!number} i
+ * @param {!number} c
+ * @return {!number}
+ */
+WaveletMatrix.prototype.rank_less_than$II = function (i, c) {
+ /** @type {!number} */
+ var begin;
+ /** @type {!number} */
+ var end;
+ /** @type {!number} */
+ var depth;
+ /** @type {!number} */
+ var rlt;
+ /** @type {!number} */
+ var rank0_begin;
+ /** @type {!number} */
+ var rank0_end;
+ /** @type {Array.<undefined|!number>} */
+ var _seps$0;
+ if (i > this._size) {
+ throw new Error("WaveletMatrix.rank_less_than(): range error");
+ }
+ if (i === 0) {
+ return 0;
+ }
+ begin = 0;
+ end = i;
+ depth = 0;
+ rlt = 0;
+ while (depth < this._bitsize) {
+ rank0_begin = this._bv[depth].rank$IB(begin, false);
+ rank0_end = this._bv[depth].rank$IB(end, false);
+ if (this._uint2bit$II(c, depth)) {
+ rlt += rank0_end - rank0_begin;
+ begin += (_seps$0 = this._seps)[depth] - rank0_begin;
+ end += _seps$0[depth] - rank0_end;
+ } else {
+ begin = rank0_begin;
+ end = rank0_end;
+ }
+ depth++;
+ }
+ return (rlt | 0);
+};
+
+/**
+ * @return {!string}
+ */
+WaveletMatrix.prototype.dump$ = function () {
+ /** @type {Array.<undefined|!string>} */
+ var contents;
+ /** @type {!number} */
+ var i;
+ /** @type {Array.<undefined|!string>} */
+ var range_contents;
+ /** @type {!number} */
+ var counter;
+ /** @type {!string} */
+ var key;
+ contents = [ Binary$dump16bitNumber$I(this._bitsize), Binary$dump32bitNumber$N(this._size) ];
+ for (i = 0; i < this._bitsize; i++) {
+ contents.push(this._bv[i].dump$());
+ }
+ for (i = 0; i < this._bitsize; i++) {
+ contents.push(Binary$dump32bitNumber$N(this._seps[i]));
+ }
+ range_contents = [ ];
+ counter = 0;
+ for (key in this._range) {
+ range_contents.push(Binary$dump32bitNumber$N(key | 0));
+ range_contents.push(Binary$dump32bitNumber$N(this._range[key]));
+ counter++;
+ }
+ contents.push(Binary$dump32bitNumber$N(counter));
+ return contents.join('') + range_contents.join('');
+};
+
+/**
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+WaveletMatrix.prototype.dump$LCompressionReport$ = function (report) {
+ /** @type {Array.<undefined|!string>} */
+ var contents;
+ /** @type {!number} */
+ var i;
+ /** @type {Array.<undefined|!string>} */
+ var range_contents;
+ /** @type {!number} */
+ var counter;
+ /** @type {!string} */
+ var key;
+ contents = [ Binary$dump16bitNumber$I(this._bitsize), Binary$dump32bitNumber$N(this._size) ];
+ CompressionReport$add$LCompressionReport$II(report, 3, 3);
+ for (i = 0; i < this._bitsize; i++) {
+ contents.push(this._bv[i].dump$LCompressionReport$(report));
+ }
+ for (i = 0; i < this._bitsize; i++) {
+ contents.push(Binary$dump32bitNumber$N(this._seps[i]));
+ CompressionReport$add$LCompressionReport$II(report, 2, 2);
+ }
+ range_contents = [ ];
+ counter = 0;
+ for (key in this._range) {
+ range_contents.push(Binary$dump32bitNumber$N(key | 0));
+ range_contents.push(Binary$dump32bitNumber$N(this._range[key]));
+ CompressionReport$add$LCompressionReport$II(report, 4, 4);
+ counter++;
+ }
+ CompressionReport$add$LCompressionReport$II(report, 2, 2);
+ contents.push(Binary$dump32bitNumber$N(counter));
+ return contents.join('') + range_contents.join('');
+};
+
+/**
+ * @param {!string} data
+ * @return {!number}
+ */
+WaveletMatrix.prototype.load$S = function (data) {
+ return this.load$SI(data, 0);
+};
+
+/**
+ * @param {!string} data
+ * @param {!number} offset
+ * @return {!number}
+ */
+WaveletMatrix.prototype.load$SI = function (data, offset) {
+ /** @type {!number} */
+ var i;
+ /** @type {BitVector} */
+ var bit_vector;
+ /** @type {!number} */
+ var range_size;
+ /** @type {!number} */
+ var value;
+ /** @type {!number} */
+ var offset$0;
+ /** @type {!number} */
+ var result$0;
+ /** @type {!number} */
+ var result$1;
+ /** @type {!number} */
+ var result$2;
+ this._bv.length = 0;
+ this._seps.length = 0;
+ this._size = 0;
+ offset$0 = offset++;
+ this._bitsize = (data.charCodeAt(offset$0) | 0);
+ result$0 = data.charCodeAt(offset) * 65536 + data.charCodeAt(offset + 1);
+ this._size = (result$0 | 0);
+ offset += 2;
+ for (i = 0; i < this._bitsize; i++) {
+ bit_vector = new BitVector$();
+ offset = bit_vector.load$SI(data, offset);
+ this._bv.push(bit_vector);
+ }
+ for (i = 0; i < this._bitsize; (i++, offset += 2)) {
+ this._seps.push(Binary$load32bitNumber$SI(data, offset));
+ }
+ result$1 = data.charCodeAt(offset) * 65536 + data.charCodeAt(offset + 1);
+ range_size = result$1;
+ offset += 2;
+ for (i = 0; i < range_size; (i++, offset += 4)) {
+ result$2 = data.charCodeAt(offset) * 65536 + data.charCodeAt(offset + 1);
+ value = Binary$load32bitNumber$SI(data, offset + 2);
+ this._range[result$2 + ""] = (value | 0);
+ }
+ return offset;
+};
+
+/**
+ * @param {Object.<string, undefined|!number>} input
+ * @return {Object.<string, undefined|!number>}
+ */
+WaveletMatrix._shallow_copy$HI = function (input) {
+ /** @type {Object.<string, undefined|!number>} */
+ var result;
+ /** @type {!string} */
+ var key;
+ result = ({ });
+ for (key in input) {
+ result[key] = input[key];
+ }
+ return result;
+};
+
+var WaveletMatrix$_shallow_copy$HI = WaveletMatrix._shallow_copy$HI;
+
+/**
+ * @param {!number} c
+ * @param {!number} i
+ * @return {!boolean}
+ */
+WaveletMatrix.prototype._uint2bit$II = function (c, i) {
+ return (c >>> this._bitsize - 1 - i & 0x1) === 0x1;
+};
+
+/**
+ * class BurrowsWheelerTransform extends Object
+ * @constructor
+ */
+function BurrowsWheelerTransform() {
+}
+
+/**
+ * @constructor
+ */
+function BurrowsWheelerTransform$() {
+ this._str = "";
+ this._size = 0;
+ this._head = 0;
+ this._suffixarray = [ ];
+};
+
+BurrowsWheelerTransform$.prototype = new BurrowsWheelerTransform;
+
+/**
+ * @param {BurrowsWheelerTransform} $this
+ * @return {!number}
+ */
+BurrowsWheelerTransform.size$LBurrowsWheelerTransform$ = function ($this) {
+ return $this._size;
+};
+
+var BurrowsWheelerTransform$size$LBurrowsWheelerTransform$ = BurrowsWheelerTransform.size$LBurrowsWheelerTransform$;
+
+/**
+ * @param {BurrowsWheelerTransform} $this
+ * @return {!number}
+ */
+BurrowsWheelerTransform.head$LBurrowsWheelerTransform$ = function ($this) {
+ return $this._head;
+};
+
+var BurrowsWheelerTransform$head$LBurrowsWheelerTransform$ = BurrowsWheelerTransform.head$LBurrowsWheelerTransform$;
+
+/**
+ * @param {BurrowsWheelerTransform} $this
+ */
+BurrowsWheelerTransform.clear$LBurrowsWheelerTransform$ = function ($this) {
+ $this._str = "";
+ $this._size = 0;
+ $this._head = 0;
+ $this._suffixarray.length = 0;
+};
+
+var BurrowsWheelerTransform$clear$LBurrowsWheelerTransform$ = BurrowsWheelerTransform.clear$LBurrowsWheelerTransform$;
+
+/**
+ * @param {BurrowsWheelerTransform} $this
+ * @param {!string} str
+ */
+BurrowsWheelerTransform.build$LBurrowsWheelerTransform$S = function ($this, str) {
+ /** @type {!string} */
+ var _str$0;
+ /** @type {Array.<undefined|!number>} */
+ var _suffixarray$0;
+ _str$0 = $this._str = str;
+ $this._size = _str$0.length;
+ _suffixarray$0 = $this._suffixarray = SAIS$make$S(str);
+ $this._head = (_suffixarray$0.indexOf(0) | 0);
+};
+
+var BurrowsWheelerTransform$build$LBurrowsWheelerTransform$S = BurrowsWheelerTransform.build$LBurrowsWheelerTransform$S;
+
+/**
+ * @param {BurrowsWheelerTransform} $this
+ * @param {!number} i
+ * @return {!string}
+ */
+BurrowsWheelerTransform.get$LBurrowsWheelerTransform$I = function ($this, i) {
+ /** @type {!number} */
+ var size;
+ /** @type {!number} */
+ var index;
+ size = $this._size;
+ if (i >= size) {
+ throw new Error("BurrowsWheelerTransform.get() : range error");
+ }
+ index = ($this._suffixarray[i] + size - 1) % size;
+ return $this._str.charAt(index);
+};
+
+var BurrowsWheelerTransform$get$LBurrowsWheelerTransform$I = BurrowsWheelerTransform.get$LBurrowsWheelerTransform$I;
+
+/**
+ * @param {BurrowsWheelerTransform} $this
+ * @return {!string}
+ */
+BurrowsWheelerTransform.get$LBurrowsWheelerTransform$ = function ($this) {
+ /** @type {Array.<undefined|!string>} */
+ var str;
+ /** @type {!number} */
+ var size;
+ /** @type {!number} */
+ var i;
+ str = [ ];
+ size = $this._size;
+ for (i = 0; i < size; i++) {
+ str.push(BurrowsWheelerTransform$get$LBurrowsWheelerTransform$I($this, i));
+ }
+ return str.join("");
+};
+
+var BurrowsWheelerTransform$get$LBurrowsWheelerTransform$ = BurrowsWheelerTransform.get$LBurrowsWheelerTransform$;
+
+/**
+ * @param {BurrowsWheelerTransform} $this
+ * @param {!string} replace
+ * @return {!string}
+ */
+BurrowsWheelerTransform.get$LBurrowsWheelerTransform$S = function ($this, replace) {
+ /** @type {!string} */
+ var result;
+ result = BurrowsWheelerTransform$get$LBurrowsWheelerTransform$($this);
+ return result.replace(BurrowsWheelerTransform.END_MARKER, replace);
+};
+
+var BurrowsWheelerTransform$get$LBurrowsWheelerTransform$S = BurrowsWheelerTransform.get$LBurrowsWheelerTransform$S;
+
+/**
+ * class OArray extends Object
+ * @constructor
+ */
+function OArray() {
+}
+
+/**
+ * @constructor
+ * @param {Array.<undefined|!number>} array
+ */
+function OArray$AI(array) {
+ this.array = array;
+ this.offset = 0;
+};
+
+OArray$AI.prototype = new OArray;
+
+/**
+ * @constructor
+ * @param {Array.<undefined|!number>} array
+ * @param {!number} offset
+ */
+function OArray$AII(array, offset) {
+ this.array = array;
+ this.offset = offset;
+};
+
+OArray$AII.prototype = new OArray;
+
+/**
+ * @param {OArray} $this
+ * @param {!number} index
+ * @return {!number}
+ */
+OArray.get$LOArray$I = function ($this, index) {
+ return $this.array[index + $this.offset];
+};
+
+var OArray$get$LOArray$I = OArray.get$LOArray$I;
+
+/**
+ * @param {OArray} $this
+ * @param {!number} index
+ * @param {!number} value
+ */
+OArray.set$LOArray$II = function ($this, index, value) {
+ $this.array[index + $this.offset] = value;
+};
+
+var OArray$set$LOArray$II = OArray.set$LOArray$II;
+
+/**
+ * @param {OArray} $this
+ * @param {!number} index
+ * @return {!boolean}
+ */
+OArray.isS$LOArray$I = function ($this, index) {
+ /** @type {Array.<undefined|!number>} */
+ var array$0;
+ /** @type {!number} */
+ var offset$0;
+ return (array$0 = $this.array)[index + (offset$0 = $this.offset)] < array$0[index + offset$0 + 1];
+};
+
+var OArray$isS$LOArray$I = OArray.isS$LOArray$I;
+
+/**
+ * @param {OArray} $this
+ * @param {!number} index1
+ * @param {!number} index2
+ * @return {!boolean}
+ */
+OArray.compare$LOArray$II = function ($this, index1, index2) {
+ /** @type {Array.<undefined|!number>} */
+ var array$0;
+ /** @type {!number} */
+ var offset$0;
+ return (array$0 = $this.array)[index1 + (offset$0 = $this.offset)] == array$0[index2 + offset$0];
+};
+
+var OArray$compare$LOArray$II = OArray.compare$LOArray$II;
+
+/**
+ * class SAIS extends Object
+ * @constructor
+ */
+function SAIS() {
+}
+
+/**
+ * @constructor
+ */
+function SAIS$() {
+};
+
+SAIS$.prototype = new SAIS;
+
+/**
+ * @param {BitVector} t
+ * @param {!number} i
+ * @return {!boolean}
+ */
+SAIS._isLMS$LBitVector$I = function (t, i) {
+ return i > 0 && t.get$I(i) && ! t.get$I(i - 1);
+};
+
+var SAIS$_isLMS$LBitVector$I = SAIS._isLMS$LBitVector$I;
+
+/**
+ * @param {OArray} s
+ * @param {Array.<undefined|!number>} bkt
+ * @param {!number} n
+ * @param {!number} K
+ * @param {!boolean} end
+ */
+SAIS._getBuckets$LOArray$AIIIB = function (s, bkt, n, K, end) {
+ /** @type {!number} */
+ var sum;
+ /** @type {!number} */
+ var i;
+ sum = 0;
+ for (i = 0; i <= K; i++) {
+ bkt[i] = 0;
+ }
+ for (i = 0; i < n; i++) {
+ bkt[OArray$get$LOArray$I(s, i)]++;
+ }
+ for (i = 0; i <= K; i++) {
+ sum += bkt[i];
+ bkt[i] = ((end ? sum : sum - bkt[i]) | 0);
+ }
+};
+
+var SAIS$_getBuckets$LOArray$AIIIB = SAIS._getBuckets$LOArray$AIIIB;
+
+/**
+ * @param {BitVector} t
+ * @param {Array.<undefined|!number>} SA
+ * @param {OArray} s
+ * @param {Array.<undefined|!number>} bkt
+ * @param {!number} n
+ * @param {!number} K
+ * @param {!boolean} end
+ */
+SAIS._induceSAl$LBitVector$AILOArray$AIIIB = function (t, SA, s, bkt, n, K, end) {
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var j;
+ SAIS$_getBuckets$LOArray$AIIIB(s, bkt, n, K, end);
+ for (i = 0; i < n; i++) {
+ j = SA[i] - 1;
+ if (j >= 0 && ! t.get$I(j)) {
+ SA[bkt[OArray$get$LOArray$I(s, j)]++] = (j | 0);
+ }
+ }
+};
+
+var SAIS$_induceSAl$LBitVector$AILOArray$AIIIB = SAIS._induceSAl$LBitVector$AILOArray$AIIIB;
+
+/**
+ * @param {BitVector} t
+ * @param {Array.<undefined|!number>} SA
+ * @param {OArray} s
+ * @param {Array.<undefined|!number>} bkt
+ * @param {!number} n
+ * @param {!number} K
+ * @param {!boolean} end
+ */
+SAIS._induceSAs$LBitVector$AILOArray$AIIIB = function (t, SA, s, bkt, n, K, end) {
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var j;
+ SAIS$_getBuckets$LOArray$AIIIB(s, bkt, n, K, end);
+ for (i = n - 1; i >= 0; i--) {
+ j = SA[i] - 1;
+ if (j >= 0 && t.get$I(j)) {
+ SA[-- bkt[OArray$get$LOArray$I(s, j)]] = (j | 0);
+ }
+ }
+};
+
+var SAIS$_induceSAs$LBitVector$AILOArray$AIIIB = SAIS._induceSAs$LBitVector$AILOArray$AIIIB;
+
+/**
+ * @param {!string} source
+ * @return {Array.<undefined|!number>}
+ */
+SAIS.make$S = function (source) {
+ /** @type {Array.<undefined|!number>} */
+ var charCodes;
+ /** @type {!number} */
+ var maxCode;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var code;
+ /** @type {Array.<undefined|!number>} */
+ var SA;
+ /** @type {OArray} */
+ var s;
+ charCodes = [ ];
+ charCodes.length = source.length;
+ maxCode = 0;
+ for (i = 0; i < source.length; i++) {
+ code = source.charCodeAt(i);
+ charCodes[i] = (code | 0);
+ maxCode = (code > maxCode ? code : maxCode);
+ }
+ SA = [ ];
+ SA.length = source.length;
+ s = ({offset: 0, array: charCodes});
+ SAIS$_make$LOArray$AIII(s, SA, source.length, maxCode);
+ return SA;
+};
+
+var SAIS$make$S = SAIS.make$S;
+
+/**
+ * @param {OArray} s
+ * @param {Array.<undefined|!number>} SA
+ * @param {!number} n
+ * @param {!number} K
+ */
+SAIS._make$LOArray$AIII = function (s, SA, n, K) {
+ /** @type {BitVector} */
+ var t;
+ /** @type {!number} */
+ var i;
+ /** @type {Array.<undefined|!number>} */
+ var bkt;
+ /** @type {!number} */
+ var n1;
+ /** @type {!number} */
+ var name;
+ /** @type {!number} */
+ var prev;
+ /** @type {undefined|!number} */
+ var pos;
+ /** @type {!boolean} */
+ var diff;
+ /** @type {!number} */
+ var d;
+ /** @type {!number} */
+ var j;
+ /** @type {Array.<undefined|!number>} */
+ var SA1;
+ /** @type {OArray} */
+ var s1;
+ /** @type {!number} */
+ var i$0;
+ /** @type {!number} */
+ var index$0;
+ t = new BitVector$();
+ t.set$IB(n - 2, false);
+ t.set$IB(n - 1, true);
+ for (i = n - 3; i >= 0; i--) {
+ t.set$IB(i, OArray$isS$LOArray$I(s, i) || OArray$compare$LOArray$II(s, i, i + 1) && t.get$I(i + 1));
+ }
+ bkt = [ ];
+ bkt.length = K + 1;
+ SAIS$_getBuckets$LOArray$AIIIB(s, bkt, n, K, true);
+ for (i = 0; i < n; i++) {
+ SA[i] = -1;
+ }
+ for (i = 1; i < n; i++) {
+ if (SAIS$_isLMS$LBitVector$I(t, i)) {
+ SA[-- bkt[OArray$get$LOArray$I(s, i)]] = (i | 0);
+ }
+ }
+ SAIS$_induceSAl$LBitVector$AILOArray$AIIIB(t, SA, s, bkt, n, K, false);
+ SAIS$_induceSAs$LBitVector$AILOArray$AIIIB(t, SA, s, bkt, n, K, true);
+ n1 = 0;
+ for (i = 0; i < n; i++) {
+ i$0 = SA[i];
+ if (i$0 > 0 && t.get$I(i$0) && ! t.get$I(i$0 - 1)) {
+ SA[n1++] = SA[i];
+ }
+ }
+ for (i = n1; i < n; i++) {
+ SA[i] = -1;
+ }
+ name = 0;
+ prev = -1;
+ for (i = 0; i < n1; i++) {
+ pos = SA[i];
+ diff = false;
+ for (d = 0; d < n; d++) {
+ if (prev === -1 || ! OArray$compare$LOArray$II(s, pos + d, prev + d) || t.get$I(pos + d) !== t.get$I(prev + d)) {
+ diff = true;
+ break;
+ } else {
+ if (d > 0 && (SAIS$_isLMS$LBitVector$I(t, pos + d) || SAIS$_isLMS$LBitVector$I(t, prev + d))) {
+ break;
+ }
+ }
+ }
+ if (diff) {
+ name++;
+ prev = pos;
+ }
+ pos = ((pos % 2 === 0 ? pos / 2 : (pos - 1) / 2) | 0);
+ SA[n1 + pos] = (name - 1 | 0);
+ }
+ for ((i = n - 1, j = n - 1); i >= n1; i--) {
+ if (SA[i] >= 0) {
+ SA[j--] = SA[i];
+ }
+ }
+ SA1 = SA;
+ s1 = ({offset: n - n1, array: SA});
+ if (name < n1) {
+ SAIS$_make$LOArray$AIII(s1, SA1, n1, name - 1);
+ } else {
+ for (i = 0; i < n1; i++) {
+ SA1[OArray$get$LOArray$I(s1, i)] = (i | 0);
+ }
+ }
+ bkt = [ ];
+ bkt.length = K + 1;
+ SAIS$_getBuckets$LOArray$AIIIB(s, bkt, n, K, true);
+ for ((i = 1, j = 0); i < n; i++) {
+ if (SAIS$_isLMS$LBitVector$I(t, i)) {
+ OArray$set$LOArray$II(s1, j++, i);
+ }
+ }
+ for (i = 0; i < n1; i++) {
+ index$0 = SA1[i];
+ SA1[i] = s1.array[index$0 + s1.offset];
+ }
+ for (i = n1; i < n; i++) {
+ SA[i] = -1;
+ }
+ for (i = n1 - 1; i >= 0; i--) {
+ j = SA[i];
+ SA[i] = -1;
+ SA[-- bkt[OArray$get$LOArray$I(s, j)]] = (j | 0);
+ }
+ SAIS$_induceSAl$LBitVector$AILOArray$AIIIB(t, SA, s, bkt, n, K, false);
+ SAIS$_induceSAs$LBitVector$AILOArray$AIIIB(t, SA, s, bkt, n, K, true);
+};
+
+var SAIS$_make$LOArray$AIII = SAIS._make$LOArray$AIII;
+
+OktaviaSearch._stemmer = null;
+OktaviaSearch._instance = null;
+$__jsx_lazy_init(Oktavia, "eof", function () {
+ return String.fromCharCode(0);
+});
+$__jsx_lazy_init(Oktavia, "eob", function () {
+ return String.fromCharCode(1);
+});
+$__jsx_lazy_init(Oktavia, "unknown", function () {
+ return String.fromCharCode(3);
+});
+Binary._base64EncodeChars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
+$__jsx_lazy_init(Binary, "_base64DecodeChars", function () {
+ return [ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 62, -1, -1, -1, 63, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, -1, -1, -1, -1, -1, -1, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -1, -1, -1, -1, -1, -1, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, -1, -1, -1, -1 ];
+});
+$__jsx_lazy_init(Style, "console", function () {
+ return ({ 'title': [ '\x1B[32m\x1b[4m', '\x1B[39m\x1b[0m' ], 'url': [ '\x1B[34m', '\x1B[39m' ], 'hit': [ '\x1B[4m', '\x1B[0m' ], 'del': [ '\x1B[9m', '\x1B[0m' ], 'summary': [ '\x1B[90m', '\x1B[39m' ] });
+});
+$__jsx_lazy_init(Style, "html", function () {
+ return ({ 'title': [ '<span class="title">', '</span>' ], 'url': [ '<span class="url">', '</span>' ], 'hit': [ '<span class="hit">', '</span>' ], 'del': [ '<del>', '</del>' ], 'summary': [ '<span class="reuslt">', '</span>' ] });
+});
+$__jsx_lazy_init(Style, "ignore", function () {
+ return ({ 'tilte': [ '', '' ], 'url': [ '', '' ], 'hit': [ '', '' ], 'del': [ '', '' ], 'summary': [ '', '' ] });
+});
+NorwegianStemmer.serialVersionUID = 1;
+$__jsx_lazy_init(NorwegianStemmer, "methodObject", function () {
+ return new NorwegianStemmer$();
+});
+$__jsx_lazy_init(NorwegianStemmer, "a_0", function () {
+ return [ new Among$SII("a", -1, 1), new Among$SII("e", -1, 1), new Among$SII("ede", 1, 1), new Among$SII("ande", 1, 1), new Among$SII("ende", 1, 1), new Among$SII("ane", 1, 1), new Among$SII("ene", 1, 1), new Among$SII("hetene", 6, 1), new Among$SII("erte", 1, 3), new Among$SII("en", -1, 1), new Among$SII("heten", 9, 1), new Among$SII("ar", -1, 1), new Among$SII("er", -1, 1), new Among$SII("heter", 12, 1), new Among$SII("s", -1, 2), new Among$SII("as", 14, 1), new Among$SII("es", 14, 1), new Among$SII("edes", 16, 1), new Among$SII("endes", 16, 1), new Among$SII("enes", 16, 1), new Among$SII("hetenes", 19, 1), new Among$SII("ens", 14, 1), new Among$SII("hetens", 21, 1), new Among$SII("ers", 14, 1), new Among$SII("ets", 14, 1), new Among$SII("et", -1, 1), new Among$SII("het", 25, 1), new Among$SII("ert", -1, 3), new Among$SII("ast", -1, 1) ];
+});
+$__jsx_lazy_init(NorwegianStemmer, "a_1", function () {
+ return [ new Among$SII("dt", -1, -1), new Among$SII("vt", -1, -1) ];
+});
+$__jsx_lazy_init(NorwegianStemmer, "a_2", function () {
+ return [ new Among$SII("leg", -1, 1), new Among$SII("eleg", 0, 1), new Among$SII("ig", -1, 1), new Among$SII("eig", 2, 1), new Among$SII("lig", 2, 1), new Among$SII("elig", 4, 1), new Among$SII("els", -1, 1), new Among$SII("lov", -1, 1), new Among$SII("elov", 7, 1), new Among$SII("slov", 7, 1), new Among$SII("hetslov", 9, 1) ];
+});
+$__jsx_lazy_init(NorwegianStemmer, "g_v", function () {
+ return [ 17, 65, 16, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 48, 0, 128 ];
+});
+$__jsx_lazy_init(NorwegianStemmer, "g_s_ending", function () {
+ return [ 119, 125, 149, 1 ];
+});
+$__jsx_lazy_init(_Common, "buffers", function () {
+ return [ "comment", "sgmlDecl", "textNode", "tagName", "doctype", "procInstName", "procInstBody", "entity", "attribName", "attribValue", "cdata", "script" ];
+});
+$__jsx_lazy_init(_Common, "EVENTS", function () {
+ return [ "text", "processinginstruction", "sgmldeclaration", "doctype", "comment", "attribute", "opentag", "closetag", "opencdata", "cdata", "clo_State.CDATA", "error", "end", "ready", "script", "opennamespace", "closenamespace" ];
+});
+_Common.MAX_BUFFER_LENGTH = 65536;
+_State.BEGIN = 1;
+_State.TEXT = 2;
+_State.TEXT_ENTITY = 3;
+_State.OPEN_WAKA = 4;
+_State.SGML_DECL = 5;
+_State.SGML_DECL_QUOTED = 6;
+_State.DOCTYPE = 7;
+_State.DOCTYPE_QUOTED = 8;
+_State.DOCTYPE_DTD = 9;
+_State.DOCTYPE_DTD_QUOTED = 10;
+_State.COMMENT_STARTING = 11;
+_State.COMMENT = 12;
+_State.COMMENT_ENDING = 13;
+_State.COMMENT_ENDED = 14;
+_State.CDATA = 15;
+_State.CDATA_ENDING = 16;
+_State.CDATA_ENDING_2 = 17;
+_State.PROC_INST = 18;
+_State.PROC_INST_BODY = 19;
+_State.PROC_INST_ENDING = 20;
+_State.OPEN_TAG = 21;
+_State.OPEN_TAG_SLASH = 22;
+_State.ATTRIB = 23;
+_State.ATTRIB_NAME = 24;
+_State.ATTRIB_NAME_SAW_WHITE = 25;
+_State.ATTRIB_VALUE = 26;
+_State.ATTRIB_VALUE_QUOTED = 27;
+_State.ATTRIB_VALUE_UNQUOTED = 28;
+_State.ATTRIB_VALUE_ENTITY_Q = 29;
+_State.ATTRIB_VALUE_ENTITY_U = 30;
+_State.CLOSE_TAG = 31;
+_State.CLOSE_TAG_SAW_WHITE = 32;
+_State.SCRIPT = 33;
+_State.SCRIPT_ENDING = 34;
+$__jsx_lazy_init(_Entities, "_entities", function () {
+ return ({ "amp": "&", "gt": ">", "lt": "<", "quot": "\"", "apos": "'", "AElig": 198, "Aacute": 193, "Acirc": 194, "Agrave": 192, "Aring": 197, "Atilde": 195, "Auml": 196, "Ccedil": 199, "ETH": 208, "Eacute": 201, "Ecirc": 202, "Egrave": 200, "Euml": 203, "Iacute": 205, "Icirc": 206, "Igrave": 204, "Iuml": 207, "Ntilde": 209, "Oacute": 211, "Ocirc": 212, "Ograve": 210, "Oslash": 216, "Otilde": 213, "Ouml": 214, "THORN": 222, "Uacute": 218, "Ucirc": 219, "Ugrave": 217, "Uuml": 220, "Yacute": 221, "aacute": 225, "acirc": 226, "aelig": 230, "agrave": 224, "aring": 229, "atilde": 227, "auml": 228, "ccedil": 231, "eacute": 233, "ecirc": 234, "egrave": 232, "eth": 240, "euml": 235, "iacute": 237, "icirc": 238, "igrave": 236, "iuml": 239, "ntilde": 241, "oacute": 243, "ocirc": 244, "ograve": 242, "oslash": 248, "otilde": 245, "ouml": 246, "szlig": 223, "thorn": 254, "uacute": 250, "ucirc": 251, "ugrave": 249, "uuml": 252, "yacute": 253, "yuml": 255, "copy": 169, "reg": 174, "nbsp": 160, "iexcl": 161, "cent": 162, "pound": 163, "curren": 164, "yen": 165, "brvbar": 166, "sect": 167, "uml": 168, "ordf": 170, "laquo": 171, "not": 172, "shy": 173, "macr": 175, "deg": 176, "plusmn": 177, "sup1": 185, "sup2": 178, "sup3": 179, "acute": 180, "micro": 181, "para": 182, "middot": 183, "cedil": 184, "ordm": 186, "raquo": 187, "frac14": 188, "frac12": 189, "frac34": 190, "iquest": 191, "times": 215, "divide": 247, "OElig": 338, "oelig": 339, "Scaron": 352, "scaron": 353, "Yuml": 376, "fnof": 402, "circ": 710, "tilde": 732, "Alpha": 913, "Beta": 914, "Gamma": 915, "Delta": 916, "Epsilon": 917, "Zeta": 918, "Eta": 919, "Theta": 920, "Iota": 921, "Kappa": 922, "Lambda": 923, "Mu": 924, "Nu": 925, "Xi": 926, "Omicron": 927, "Pi": 928, "Rho": 929, "Sigma": 931, "Tau": 932, "Upsilon": 933, "Phi": 934, "Chi": 935, "Psi": 936, "Omega": 937, "alpha": 945, "beta": 946, "gamma": 947, "delta": 948, "epsilon": 949, "zeta": 950, "eta": 951, "theta": 952, "iota": 953, "kappa": 954, "lambda": 955, "mu": 956, "nu": 957, "xi": 958, "omicron": 959, "pi": 960, "rho": 961, "sigmaf": 962, "sigma": 963, "tau": 964, "upsilon": 965, "phi": 966, "chi": 967, "psi": 968, "omega": 969, "thetasym": 977, "upsih": 978, "piv": 982, "ensp": 8194, "emsp": 8195, "thinsp": 8201, "zwnj": 8204, "zwj": 8205, "lrm": 8206, "rlm": 8207, "ndash": 8211, "mdash": 8212, "lsquo": 8216, "rsquo": 8217, "sbquo": 8218, "ldquo": 8220, "rdquo": 8221, "bdquo": 8222, "dagger": 8224, "Dagger": 8225, "bull": 8226, "hellip": 8230, "permil": 8240, "prime": 8242, "Prime": 8243, "lsaquo": 8249, "rsaquo": 8250, "oline": 8254, "frasl": 8260, "euro": 8364, "image": 8465, "weierp": 8472, "real": 8476, "trade": 8482, "alefsym": 8501, "larr": 8592, "uarr": 8593, "rarr": 8594, "darr": 8595, "harr": 8596, "crarr": 8629, "lArr": 8656, "uArr": 8657, "rArr": 8658, "dArr": 8659, "hArr": 8660, "forall": 8704, "part": 8706, "exist": 8707, "empty": 8709, "nabla": 8711, "isin": 8712, "notin": 8713, "ni": 8715, "prod": 8719, "sum": 8721, "minus": 8722, "lowast": 8727, "radic": 8730, "prop": 8733, "infin": 8734, "ang": 8736, "and": 8743, "or": 8744, "cap": 8745, "cup": 8746, "int": 8747, "there4": 8756, "sim": 8764, "cong": 8773, "asymp": 8776, "ne": 8800, "equiv": 8801, "le": 8804, "ge": 8805, "sub": 8834, "sup": 8835, "nsub": 8836, "sube": 8838, "supe": 8839, "oplus": 8853, "otimes": 8855, "perp": 8869, "sdot": 8901, "lceil": 8968, "rceil": 8969, "lfloor": 8970, "rfloor": 8971, "lang": 9001, "rang": 9002, "loz": 9674, "spades": 9824, "clubs": 9827, "hearts": 9829, "diams": 9830 });
+});
+BitVector.SMALL_BLOCK_SIZE = 32;
+BitVector.LARGE_BLOCK_SIZE = 256;
+BitVector.BLOCK_RATE = 8;
+$__jsx_lazy_init(BurrowsWheelerTransform, "END_MARKER", function () {
+ return String.fromCharCode(0);
+});
+var $__jsx_classMap = {
+ "tool/web/oktavia-norwegian-search.jsx": {
+ _Main: _Main,
+ _Main$: _Main$
+ },
+ "tool/web/oktavia-search.jsx": {
+ _Result: _Result,
+ _Result$SSSI: _Result$SSSI,
+ _Proposal: _Proposal,
+ _Proposal$SSI: _Proposal$SSI,
+ OktaviaSearch: OktaviaSearch,
+ OktaviaSearch$I: OktaviaSearch$I,
+ _Main: _Main$0,
+ _Main$: _Main$0$
+ },
+ "src/oktavia.jsx": {
+ Oktavia: Oktavia,
+ Oktavia$: Oktavia$
+ },
+ "src/binary-util.jsx": {
+ Binary: Binary,
+ Binary$: Binary$,
+ LoadedStringResult: LoadedStringResult,
+ LoadedStringResult$SI: LoadedStringResult$SI,
+ LoadedStringListResult: LoadedStringListResult,
+ LoadedStringListResult$SI: LoadedStringListResult$SI,
+ LoadedStringListMapResult: LoadedStringListMapResult,
+ LoadedStringListMapResult$SI: LoadedStringListMapResult$SI,
+ LoadedNumberListResult: LoadedNumberListResult,
+ LoadedNumberListResult$SI: LoadedNumberListResult$SI,
+ CompressionReport: CompressionReport,
+ CompressionReport$: CompressionReport$
+ },
+ "src/query.jsx": {
+ Query: Query,
+ Query$: Query$
+ },
+ "src/query-string-parser.jsx": {
+ QueryStringParser: QueryStringParser,
+ QueryStringParser$: QueryStringParser$
+ },
+ "src/search-result.jsx": {
+ Proposal: Proposal,
+ Proposal$II: Proposal$II,
+ Position: Position,
+ Position$SIB: Position$SIB,
+ SearchUnit: SearchUnit,
+ SearchUnit$I: SearchUnit$I,
+ SingleResult: SingleResult,
+ SingleResult$: SingleResult$,
+ SingleResult$SBB: SingleResult$SBB,
+ SearchSummary: SearchSummary,
+ SearchSummary$: SearchSummary$,
+ SearchSummary$LOktavia$: SearchSummary$LOktavia$
+ },
+ "src/style.jsx": {
+ Style: Style,
+ Style$S: Style$S,
+ _HTMLHandler: _HTMLHandler,
+ _HTMLHandler$HASB: _HTMLHandler$HASB
+ },
+ "src/stemmer/stemmer.jsx": {
+ Stemmer: Stemmer,
+ Stemmer$: Stemmer$
+ },
+ "src/stemmer/base-stemmer.jsx": {
+ BaseStemmer: BaseStemmer,
+ BaseStemmer$: BaseStemmer$
+ },
+ "src/stemmer/norwegian-stemmer.jsx": {
+ NorwegianStemmer: NorwegianStemmer,
+ NorwegianStemmer$: NorwegianStemmer$
+ },
+ "src/stemmer/among.jsx": {
+ Among: Among,
+ Among$SII: Among$SII,
+ Among$SIIF$LBaseStemmer$B$LBaseStemmer$: Among$SIIF$LBaseStemmer$B$LBaseStemmer$
+ },
+ "src/metadata.jsx": {
+ Metadata: Metadata,
+ Metadata$LOktavia$: Metadata$LOktavia$,
+ Section: Section,
+ Section$LOktavia$: Section$LOktavia$,
+ Splitter: Splitter,
+ Splitter$LOktavia$: Splitter$LOktavia$,
+ Splitter$LOktavia$S: Splitter$LOktavia$S,
+ Table: Table,
+ Table$LOktavia$AS: Table$LOktavia$AS,
+ Block: Block,
+ Block$LOktavia$: Block$LOktavia$
+ },
+ "src/fm-index.jsx": {
+ FMIndex: FMIndex,
+ FMIndex$: FMIndex$
+ },
+ "src/sax.jsx": {
+ Tag: Tag,
+ Tag$S: Tag$S,
+ _Common: _Common,
+ _Common$: _Common$,
+ _State: _State,
+ _State$: _State$,
+ SAXHandler: SAXHandler,
+ SAXHandler$: SAXHandler$,
+ SAXParser: SAXParser,
+ SAXParser$LSAXHandler$: SAXParser$LSAXHandler$,
+ SAXParser$LSAXHandler$B: SAXParser$LSAXHandler$B,
+ Char: Char,
+ Char$: Char$,
+ _Entities: _Entities,
+ _Entities$: _Entities$
+ },
+ "src/bit-vector.jsx": {
+ BitVector: BitVector,
+ BitVector$: BitVector$
+ },
+ "src/wavelet-matrix.jsx": {
+ WaveletMatrix: WaveletMatrix,
+ WaveletMatrix$: WaveletMatrix$
+ },
+ "src/burrows-wheeler-transform.jsx": {
+ BurrowsWheelerTransform: BurrowsWheelerTransform,
+ BurrowsWheelerTransform$: BurrowsWheelerTransform$
+ },
+ "src/sais.jsx": {
+ OArray: OArray,
+ OArray$AI: OArray$AI,
+ OArray$AII: OArray$AII,
+ SAIS: SAIS,
+ SAIS$: SAIS$
+ }
+};
+
+
+/**
+ * launches _Main.main(:string[]):void invoked by jsx --run|--executable
+ */
+JSX.runMain = function (sourceFile, args) {
+ var module = JSX.require(sourceFile);
+ if (! module) {
+ throw new ReferenceError("entry point module not found in " + sourceFile);
+ }
+ if (! module._Main) {
+ throw new ReferenceError("entry point _Main not found in " + sourceFile);
+ }
+ if (! module._Main.main$AS) {
+ throw new ReferenceError("entry point _Main.main(:string[]):void not found in " + sourceFile);
+ }
+ module._Main.main$AS(args);
+};
+
+/**
+ * launches _Test#test*():void invoked by jsx --test
+ */
+JSX.runTests = function (sourceFile, tests) {
+ var module = JSX.require(sourceFile);
+ var testClass = module._Test$;
+
+ if (!testClass) return; // skip if there's no test class
+
+ if(tests.length === 0) {
+ var p = testClass.prototype;
+ for (var m in p) {
+ if (p[m] instanceof Function
+ && /^test.*[$]$/.test(m)) {
+ tests.push(m);
+ }
+ }
+ }
+ else { // set as process arguments
+ tests = tests.map(function (name) {
+ return name + "$"; // mangle for function test*():void
+ });
+ }
+
+ var testCase = new testClass();
+
+ if (testCase.beforeClass$AS != null)
+ testCase.beforeClass$AS(tests);
+
+ for (var i = 0; i < tests.length; ++i) {
+ (function (method) {
+ if (method in testCase) {
+ testCase.run$SF$V$(method, function() { testCase[method](); });
+ }
+ else {
+ throw new ReferenceError("No such test method: " + method);
+ }
+ }(tests[i]));
+ }
+
+ if (testCase.afterClass$ != null)
+ testCase.afterClass$();
+};
+/**
+ * call a function on load/DOMContentLoaded
+ */
+function $__jsx_onload (event) {
+ window.removeEventListener("load", $__jsx_onload);
+ document.removeEventListener("DOMContentLoaded", $__jsx_onload);
+ JSX.runMain("tool/web/oktavia-norwegian-search.jsx", [])
+}
+
+window.addEventListener("load", $__jsx_onload);
+document.addEventListener("DOMContentLoaded", $__jsx_onload);
+
+})(JSX);
diff --git a/web/server/h2o/libh2o/misc/oktavia/lib/oktavia-porter-search.js b/web/server/h2o/libh2o/misc/oktavia/lib/oktavia-porter-search.js
new file mode 100644
index 00000000..f1bb1801
--- /dev/null
+++ b/web/server/h2o/libh2o/misc/oktavia/lib/oktavia-porter-search.js
@@ -0,0 +1,8494 @@
+// generatedy by JSX compiler 0.9.24 (2013-04-05 13:45:00 +0900; 1b229cc6a411f674f0f7cf7a79b7a8b3f8eb7414)
+var JSX = {};
+(function (JSX) {
+/**
+ * copies the implementations from source interface to target
+ */
+function $__jsx_merge_interface(target, source) {
+ for (var k in source.prototype)
+ if (source.prototype.hasOwnProperty(k))
+ target.prototype[k] = source.prototype[k];
+}
+
+/**
+ * defers the initialization of the property
+ */
+function $__jsx_lazy_init(obj, prop, func) {
+ function reset(obj, prop, value) {
+ delete obj[prop];
+ obj[prop] = value;
+ return value;
+ }
+
+ Object.defineProperty(obj, prop, {
+ get: function () {
+ return reset(obj, prop, func());
+ },
+ set: function (v) {
+ reset(obj, prop, v);
+ },
+ enumerable: true,
+ configurable: true
+ });
+}
+
+/**
+ * sideeffect().a /= b
+ */
+function $__jsx_div_assign(obj, prop, divisor) {
+ return obj[prop] = (obj[prop] / divisor) | 0;
+}
+
+/*
+ * global functions, renamed to avoid conflict with local variable names
+ */
+var $__jsx_parseInt = parseInt;
+var $__jsx_parseFloat = parseFloat;
+var $__jsx_isNaN = isNaN;
+var $__jsx_isFinite = isFinite;
+
+var $__jsx_encodeURIComponent = encodeURIComponent;
+var $__jsx_decodeURIComponent = decodeURIComponent;
+var $__jsx_encodeURI = encodeURI;
+var $__jsx_decodeURI = decodeURI;
+
+var $__jsx_ObjectToString = Object.prototype.toString;
+var $__jsx_ObjectHasOwnProperty = Object.prototype.hasOwnProperty;
+
+/*
+ * profiler object, initialized afterwards
+ */
+function $__jsx_profiler() {
+}
+
+/*
+ * public interface to JSX code
+ */
+JSX.require = function (path) {
+ var m = $__jsx_classMap[path];
+ return m !== undefined ? m : null;
+};
+
+JSX.profilerIsRunning = function () {
+ return $__jsx_profiler.getResults != null;
+};
+
+JSX.getProfileResults = function () {
+ return ($__jsx_profiler.getResults || function () { return {}; })();
+};
+
+JSX.postProfileResults = function (url, cb) {
+ if ($__jsx_profiler.postResults == null)
+ throw new Error("profiler has not been turned on");
+ return $__jsx_profiler.postResults(url, cb);
+};
+
+JSX.resetProfileResults = function () {
+ if ($__jsx_profiler.resetResults == null)
+ throw new Error("profiler has not been turned on");
+ return $__jsx_profiler.resetResults();
+};
+JSX.DEBUG = false;
+/**
+ * class _Main extends Object
+ * @constructor
+ */
+function _Main() {
+}
+
+/**
+ * @constructor
+ */
+function _Main$() {
+};
+
+_Main$.prototype = new _Main;
+
+/**
+ * @param {Array.<undefined|!string>} args
+ */
+_Main.main$AS = function (args) {
+ OktaviaSearch$setStemmer$LStemmer$(new PorterStemmer$());
+};
+
+var _Main$main$AS = _Main.main$AS;
+
+/**
+ * class _Result extends Object
+ * @constructor
+ */
+function _Result() {
+}
+
+/**
+ * @constructor
+ * @param {!string} title
+ * @param {!string} url
+ * @param {!string} content
+ * @param {!number} score
+ */
+function _Result$SSSI(title, url, content, score) {
+ this.title = title;
+ this.url = url;
+ this.content = content;
+ this.score = score;
+};
+
+_Result$SSSI.prototype = new _Result;
+
+/**
+ * class _Proposal extends Object
+ * @constructor
+ */
+function _Proposal() {
+}
+
+/**
+ * @constructor
+ * @param {!string} options
+ * @param {!string} label
+ * @param {!number} count
+ */
+function _Proposal$SSI(options, label, count) {
+ this.options = options;
+ this.label = label;
+ this.count = count;
+};
+
+_Proposal$SSI.prototype = new _Proposal;
+
+/**
+ * class OktaviaSearch extends Object
+ * @constructor
+ */
+function OktaviaSearch() {
+}
+
+/**
+ * @constructor
+ * @param {!number} entriesPerPage
+ */
+function OktaviaSearch$I(entriesPerPage) {
+ this._queries = null;
+ this._highlight = "";
+ this._result = null;
+ this._proposals = null;
+ this._currentFolderDepth = 0;
+ this._oktavia = new Oktavia$();
+ this._entriesPerPage = entriesPerPage;
+ this._currentPage = 1;
+ this._queryString = null;
+ this._callback = null;
+ OktaviaSearch._instance = this;
+};
+
+OktaviaSearch$I.prototype = new OktaviaSearch;
+
+/**
+ * @param {Stemmer} stemmer
+ */
+OktaviaSearch.setStemmer$LStemmer$ = function (stemmer) {
+ /** @type {Oktavia} */
+ var this$0;
+ if (OktaviaSearch._instance) {
+ this$0 = OktaviaSearch._instance._oktavia;
+ this$0._stemmer = stemmer;
+ } else {
+ OktaviaSearch._stemmer = stemmer;
+ }
+};
+
+var OktaviaSearch$setStemmer$LStemmer$ = OktaviaSearch.setStemmer$LStemmer$;
+
+/**
+ * @param {!string} index
+ */
+OktaviaSearch.prototype.loadIndex$S = function (index) {
+ /** @type {Oktavia} */
+ var this$0;
+ /** @type {Stemmer} */
+ var stemmer$0;
+ if (OktaviaSearch._stemmer) {
+ this$0 = this._oktavia;
+ stemmer$0 = OktaviaSearch._stemmer;
+ this$0._stemmer = stemmer$0;
+ }
+ this._oktavia.load$S(Binary$base64decode$S(index));
+ if (this._queryString) {
+ this.search$SF$IIV$(this._queryString, this._callback);
+ this._queryString = null;
+ this._callback = null;
+ }
+};
+
+/**
+ * @param {!string} queryString
+ * @param {*} callback
+ */
+OktaviaSearch.prototype.search$SF$IIV$ = function (queryString, callback) {
+ /** @type {QueryStringParser} */
+ var queryParser;
+ /** @type {SearchSummary} */
+ var summary;
+ /** @type {Array.<undefined|SearchUnit>} */
+ var _result$0;
+ if (this._oktavia) {
+ queryParser = ({queries: [ ]});
+ this._queries = QueryStringParser$parse$LQueryStringParser$S(queryParser, queryString);
+ this._highlight = QueryStringParser$highlight$LQueryStringParser$(queryParser);
+ summary = this._oktavia.search$ALQuery$(this._queries);
+ if (SearchSummary$size$LSearchSummary$(summary) > 0) {
+ this._result = this._sortResult$LSearchSummary$(summary);
+ this._proposals = [ ];
+ this._currentPage = 1;
+ } else {
+ this._result = [ ];
+ if (this._queries.length > 1) {
+ this._proposals = SearchSummary$getProposal$LSearchSummary$(summary);
+ } else {
+ this._proposals = [ ];
+ }
+ this._currentPage = 1;
+ }
+ callback((_result$0 = this._result).length, Math.ceil(_result$0.length / this._entriesPerPage));
+ } else {
+ this._queryString = queryString;
+ this._callback = callback;
+ }
+};
+
+/**
+ * @return {!number}
+ */
+OktaviaSearch.prototype.resultSize$ = function () {
+ return (this._result.length | 0);
+};
+
+/**
+ * @return {!number}
+ */
+OktaviaSearch.prototype.totalPages$ = function () {
+ return (Math.ceil(this._result.length / this._entriesPerPage) | 0);
+};
+
+/**
+ * @return {!number}
+ */
+OktaviaSearch.prototype.currentPage$ = function () {
+ return this._currentPage;
+};
+
+/**
+ * @param {!number} page
+ */
+OktaviaSearch.prototype.setCurrentPage$I = function (page) {
+ this._currentPage = page;
+};
+
+/**
+ * @return {!boolean}
+ */
+OktaviaSearch.prototype.hasPrevPage$ = function () {
+ return this._currentPage !== 1;
+};
+
+/**
+ * @return {!boolean}
+ */
+OktaviaSearch.prototype.hasNextPage$ = function () {
+ return this._currentPage !== Math.ceil(this._result.length / this._entriesPerPage);
+};
+
+/**
+ * @return {Array.<undefined|!string>}
+ */
+OktaviaSearch.prototype.pageIndexes$ = function () {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var total;
+ /** @type {!number} */
+ var i;
+ result = [ ];
+ total = Math.ceil(this._result.length / this._entriesPerPage);
+ if (total < 10) {
+ for (i = 1; i <= total; i++) {
+ result.push(i + "");
+ }
+ } else {
+ if (this._currentPage <= 5) {
+ for (i = 1; i <= 7; i++) {
+ result.push(i + "");
+ }
+ result.push('...', total + "");
+ } else {
+ if (total - 5 <= this._currentPage) {
+ result.push('1', '...');
+ for (i = total - 8; i <= total; i++) {
+ result.push(i + "");
+ }
+ } else {
+ result.push('1', '...');
+ for (i = this._currentPage - 3; i <= this._currentPage + 3; i++) {
+ result.push(i + "");
+ }
+ result.push('...', total + "");
+ }
+ }
+ }
+ return result;
+};
+
+/**
+ * @return {Array.<undefined|_Result>}
+ */
+OktaviaSearch.prototype.getResult$ = function () {
+ /** @type {Style} */
+ var style;
+ /** @type {!number} */
+ var start;
+ /** @type {!number} */
+ var last;
+ /** @type {Metadata} */
+ var metadata;
+ /** @type {!number} */
+ var num;
+ /** @type {Array.<undefined|_Result>} */
+ var results;
+ /** @type {!number} */
+ var i;
+ /** @type {SearchUnit} */
+ var unit;
+ /** @type {Array.<undefined|!string>} */
+ var info;
+ /** @type {!string} */
+ var content;
+ /** @type {Array.<undefined|Position>} */
+ var positions;
+ /** @type {!number} */
+ var end;
+ /** @type {!boolean} */
+ var split;
+ /** @type {!number} */
+ var j;
+ /** @type {Position} */
+ var pos;
+ /** @type {!string} */
+ var text;
+ /** @type {Oktavia} */
+ var this$0;
+ /** @type {!number} */
+ var position$0;
+ /** @type {!number} */
+ var _currentPage$0;
+ /** @type {!number} */
+ var _entriesPerPage$0;
+ style = new Style$S('html');
+ start = ((_currentPage$0 = this._currentPage) - 1) * (_entriesPerPage$0 = this._entriesPerPage);
+ last = Math.min(_currentPage$0 * _entriesPerPage$0, this._result.length);
+ this$0 = this._oktavia;
+ metadata = this$0._metadatas[this$0._metadataLabels[0]];
+ num = 250;
+ results = [ ];
+ for (i = start; i < last; i++) {
+ unit = this._result[i];
+ info = metadata.getInformation$I(unit.id).split(Oktavia.eob);
+ content = metadata.getContent$I(unit.id);
+ start = 0;
+ positions = SearchUnit$getPositions$LSearchUnit$(unit);
+ if (content.indexOf(info[0]) === 1) {
+ content = content.slice(info[0].length + 2, content.length);
+ start += info[0].length + 2;
+ }
+ end = start + num;
+ split = false;
+ if (positions[0].position > end - positions[0].word.length) {
+ end = positions[0].position + Math.floor(num / 2);
+ split = true;
+ }
+ for (j = positions.length - 1; j > -1; j--) {
+ pos = positions[j];
+ if (pos.position + pos.word.length < end) {
+ content = [ content.slice(0, pos.position - start), style.convert$S('<hit>*</hit>').replace('*', content.slice((position$0 = pos.position) - start, position$0 + pos.word.length - start)), content.slice(pos.position + pos.word.length - start, content.length) ].join('');
+ }
+ }
+ if (split) {
+ text = [ content.slice(0, Math.floor(num / 2)) + ' ...', content.slice(- Math.floor(num / 2), end - start) ].join('<br/>');
+ } else {
+ text = content.slice(0, end - start) + ' ...<br/>';
+ }
+ text = text.replace(Oktavia.eob, ' ').replace(/(<br\/>)(<br\/>)+/, '<br/><br/>');
+ results.push(({title: info[0], url: info[1], content: text, score: unit.score}));
+ }
+ return results;
+};
+
+/**
+ * @return {!string}
+ */
+OktaviaSearch.prototype.getHighlight$ = function () {
+ return this._highlight;
+};
+
+/**
+ * @return {Array.<undefined|_Proposal>}
+ */
+OktaviaSearch.prototype.getProposals$ = function () {
+ /** @type {Style} */
+ var style;
+ /** @type {Array.<undefined|_Proposal>} */
+ var results;
+ /** @type {!number} */
+ var i;
+ /** @type {Proposal} */
+ var proposal;
+ /** @type {Array.<undefined|!string>} */
+ var label;
+ /** @type {Array.<undefined|!string>} */
+ var option;
+ /** @type {!number} */
+ var j;
+ style = new Style$S('html');
+ results = [ ];
+ if (this._queries.length > 1) {
+ for (i = 0; i < this._proposals.length; i++) {
+ proposal = this._proposals[i];
+ if (proposal.expect > 0) {
+ label = [ ];
+ option = [ ];
+ for (j = 0; j < this._queries.length; j++) {
+ if (j !== proposal.omit) {
+ label.push(style.convert$S('<hit>' + this._queries[j].toString() + '</hit>'));
+ option.push(this._queries[j].toString());
+ } else {
+ label.push(style.convert$S('<del>' + this._queries[j].toString() + '</del>'));
+ }
+ }
+ results.push(({options: option.join(' '), label: label.join('&nbsp;'), count: proposal.expect}));
+ }
+ }
+ }
+ return results;
+};
+
+/**
+ * @param {SearchSummary} summary
+ * @return {Array.<undefined|SearchUnit>}
+ */
+OktaviaSearch.prototype._sortResult$LSearchSummary$ = function (summary) {
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var score;
+ /** @type {SearchUnit} */
+ var unit;
+ /** @type {!string} */
+ var pos;
+ /** @type {Position} */
+ var position;
+ for (i = 0; i < summary.result.units.length; i++) {
+ score = 0;
+ unit = summary.result.units[i];
+ for (pos in unit.positions) {
+ position = unit.positions[pos];
+ if (this._oktavia.wordPositionType$I(position.position)) {
+ score += 10;
+ } else {
+ score += 1;
+ }
+ if (! position.stemmed) {
+ score += 2;
+ }
+ }
+ unit.score = (score | 0);
+ }
+ return SearchSummary$getSortedResult$LSearchSummary$(summary);
+};
+
+/**
+ * class _Main$0 extends Object
+ * @constructor
+ */
+function _Main$0() {
+}
+
+/**
+ * @constructor
+ */
+function _Main$0$() {
+};
+
+_Main$0$.prototype = new _Main$0;
+
+/**
+ * @param {Array.<undefined|!string>} args
+ */
+_Main$0.main$AS = function (args) {
+};
+
+var _Main$0$main$AS = _Main$0.main$AS;
+
+/**
+ * class Oktavia extends Object
+ * @constructor
+ */
+function Oktavia() {
+}
+
+/**
+ * @constructor
+ */
+function Oktavia$() {
+ /** @type {Array.<undefined|!string>} */
+ var _utf162compressCode$0;
+ this._compressCode2utf16 = null;
+ this._fmindex = new FMIndex$();
+ this._metadatas = ({ });
+ this._metadataLabels = [ ];
+ this._stemmer = null;
+ this._stemmingResult = ({ });
+ _utf162compressCode$0 = this._utf162compressCode = [ Oktavia.eof, Oktavia.eob, Oktavia.unknown ];
+ _utf162compressCode$0.length = 65536;
+ this._compressCode2utf16 = [ Oktavia.eof, Oktavia.eob, Oktavia.unknown ];
+};
+
+Oktavia$.prototype = new Oktavia;
+
+/**
+ * @param {Stemmer} stemmer
+ */
+Oktavia.prototype.setStemmer$LStemmer$ = function (stemmer) {
+ this._stemmer = stemmer;
+};
+
+/**
+ * @return {Metadata}
+ */
+Oktavia.prototype.getPrimaryMetadata$ = function () {
+ return this._metadatas[this._metadataLabels[0]];
+};
+
+/**
+ * @param {!string} key
+ * @return {Section}
+ */
+Oktavia.prototype.addSection$S = function (key) {
+ /** @type {Section} */
+ var section;
+ if (this._metadataLabels.indexOf(key) !== -1) {
+ throw new Error('Metadata name ' + key + ' is already exists');
+ }
+ this._metadataLabels.push(key);
+ section = new Section$LOktavia$(this);
+ this._metadatas[key] = section;
+ return section;
+};
+
+/**
+ * @param {!string} key
+ * @return {Section}
+ */
+Oktavia.prototype.getSection$S = function (key) {
+ if (this._metadataLabels.indexOf(key) === -1) {
+ throw new Error('Metadata name ' + key + " does't exists");
+ }
+ return this._metadatas[key];
+};
+
+/**
+ * @param {!string} key
+ * @return {Splitter}
+ */
+Oktavia.prototype.addSplitter$S = function (key) {
+ /** @type {Splitter} */
+ var splitter;
+ if (this._metadataLabels.indexOf(key) !== -1) {
+ throw new Error('Metadata name ' + key + ' is already exists');
+ }
+ this._metadataLabels.push(key);
+ splitter = new Splitter$LOktavia$(this);
+ this._metadatas[key] = splitter;
+ return splitter;
+};
+
+/**
+ * @param {!string} key
+ * @return {Splitter}
+ */
+Oktavia.prototype.getSplitter$S = function (key) {
+ if (this._metadataLabels.indexOf(key) === -1) {
+ throw new Error('Metadata name ' + key + " does't exists");
+ }
+ return this._metadatas[key];
+};
+
+/**
+ * @param {!string} key
+ * @param {Array.<undefined|!string>} headers
+ * @return {Table}
+ */
+Oktavia.prototype.addTable$SAS = function (key, headers) {
+ /** @type {Table} */
+ var table;
+ if (this._metadataLabels.indexOf(key) !== -1) {
+ throw new Error('Metadata name ' + key + ' is already exists');
+ }
+ this._metadataLabels.push(key);
+ table = new Table$LOktavia$AS(this, headers);
+ this._metadatas[key] = table;
+ return table;
+};
+
+/**
+ * @param {!string} key
+ * @return {Table}
+ */
+Oktavia.prototype.getTable$S = function (key) {
+ if (this._metadataLabels.indexOf(key) === -1) {
+ throw new Error('Metadata name ' + key + " does't exists");
+ }
+ return this._metadatas[key];
+};
+
+/**
+ * @param {!string} key
+ * @return {Block}
+ */
+Oktavia.prototype.addBlock$S = function (key) {
+ /** @type {Block} */
+ var block;
+ if (this._metadataLabels.indexOf(key) !== -1) {
+ throw new Error('Metadata name ' + key + ' is already exists');
+ }
+ this._metadataLabels.push(key);
+ block = new Block$LOktavia$(this);
+ this._metadatas[key] = block;
+ return block;
+};
+
+/**
+ * @param {!string} key
+ * @return {Block}
+ */
+Oktavia.prototype.getBlock$S = function (key) {
+ if (this._metadataLabels.indexOf(key) === -1) {
+ throw new Error('Metadata name ' + key + " does't exists");
+ }
+ return this._metadatas[key];
+};
+
+/**
+ */
+Oktavia.prototype.addEndOfBlock$ = function () {
+ this._fmindex.push$S(Oktavia.eob);
+};
+
+/**
+ * @param {!string} words
+ */
+Oktavia.prototype.addWord$S = function (words) {
+ /** @type {Array.<undefined|!string>} */
+ var str;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var charCode;
+ /** @type {undefined|!string} */
+ var newCharCode;
+ str = [ ];
+ str.length = words.length;
+ for (i = 0; i < words.length; i++) {
+ charCode = words.charCodeAt(i);
+ newCharCode = this._utf162compressCode[charCode];
+ if (newCharCode == null) {
+ newCharCode = String.fromCharCode(this._compressCode2utf16.length);
+ this._utf162compressCode[charCode] = newCharCode;
+ this._compressCode2utf16.push(String.fromCharCode(charCode));
+ }
+ str.push(newCharCode);
+ }
+ this._fmindex.push$S(str.join(''));
+};
+
+/**
+ * @param {!string} words
+ * @param {!boolean} stemming
+ */
+Oktavia.prototype.addWord$SB = function (words, stemming) {
+ /** @type {Array.<undefined|!string>} */
+ var wordList;
+ /** @type {!number} */
+ var i;
+ /** @type {undefined|!string} */
+ var originalWord;
+ /** @type {!string} */
+ var smallWord;
+ /** @type {undefined|!string} */
+ var registerWord;
+ /** @type {!string} */
+ var baseWord;
+ /** @type {!string} */
+ var compressedCodeWord;
+ /** @type {Array.<undefined|!string>} */
+ var stemmedList;
+ this.addWord$S(words);
+ wordList = words.split(/\s+/);
+ for (i = 0; i < wordList.length; i++) {
+ originalWord = wordList[i];
+ smallWord = originalWord.slice(0, 1).toLowerCase() + originalWord.slice(1);
+ registerWord = null;
+ if (stemming && this._stemmer) {
+ baseWord = this._stemmer.stemWord$S(originalWord.toLowerCase());
+ if (originalWord.indexOf(baseWord) === -1) {
+ registerWord = baseWord;
+ }
+ } else {
+ if (originalWord != smallWord) {
+ registerWord = smallWord;
+ }
+ }
+ if (registerWord) {
+ compressedCodeWord = this._convertToCompressionCode$S(originalWord);
+ stemmedList = this._stemmingResult[registerWord];
+ if (! stemmedList) {
+ stemmedList = [ compressedCodeWord ];
+ this._stemmingResult[registerWord] = stemmedList;
+ } else {
+ if (stemmedList.indexOf(compressedCodeWord) === -1) {
+ stemmedList.push(compressedCodeWord);
+ }
+ }
+ }
+ }
+};
+
+/**
+ * @param {!string} keyword
+ * @return {!string}
+ */
+Oktavia.prototype._convertToCompressionCode$S = function (keyword) {
+ /** @type {Array.<undefined|!string>} */
+ var resultChars;
+ /** @type {!number} */
+ var i;
+ /** @type {undefined|!string} */
+ var chr;
+ resultChars = [ ];
+ for (i = 0; i < keyword.length; i++) {
+ chr = this._utf162compressCode[keyword.charCodeAt(i)];
+ if (chr == null) {
+ resultChars.push(Oktavia.unknown);
+ } else {
+ resultChars.push(chr);
+ }
+ }
+ return resultChars.join('');
+};
+
+/**
+ * @param {!string} keyword
+ * @param {!boolean} stemming
+ * @return {Array.<undefined|!number>}
+ */
+Oktavia.prototype.rawSearch$SB = function (keyword, stemming) {
+ /** @type {Array.<undefined|!number>} */
+ var result;
+ /** @type {!string} */
+ var baseWord;
+ /** @type {Array.<undefined|!string>} */
+ var stemmedList;
+ /** @type {!number} */
+ var i;
+ /** @type {undefined|!string} */
+ var word;
+ if (stemming) {
+ result = [ ];
+ if (this._stemmer) {
+ baseWord = this._stemmer.stemWord$S(keyword.toLowerCase());
+ stemmedList = this._stemmingResult[baseWord];
+ if (stemmedList) {
+ for (i = 0; i < stemmedList.length; i++) {
+ word = stemmedList[i];
+ result = result.concat(this._fmindex.search$S(word));
+ }
+ }
+ }
+ } else {
+ result = this._fmindex.search$S(this._convertToCompressionCode$S(keyword));
+ }
+ return result;
+};
+
+/**
+ * @param {Array.<undefined|Query>} queries
+ * @return {SearchSummary}
+ */
+Oktavia.prototype.search$ALQuery$ = function (queries) {
+ /** @type {SearchSummary} */
+ var summary;
+ /** @type {!number} */
+ var i;
+ /** @type {SingleResult} */
+ var result$0;
+ summary = ({sourceResults: [ ], result: null, oktavia: this});
+ for (i = 0; i < queries.length; i++) {
+ result$0 = this._searchQuery$LQuery$(queries[i]);
+ summary.sourceResults.push(result$0);
+ }
+ summary.result = SearchSummary$mergeResult$LSearchSummary$ALSingleResult$(summary, summary.sourceResults);
+ return summary;
+};
+
+/**
+ * @param {Query} query
+ * @return {SingleResult}
+ */
+Oktavia.prototype._searchQuery$LQuery$ = function (query) {
+ /** @type {SingleResult} */
+ var result;
+ /** @type {Array.<undefined|!number>} */
+ var positions;
+ result = new SingleResult$SBB(query.word, query.or, query.not);
+ if (query.raw) {
+ positions = this.rawSearch$SB(query.word, false);
+ } else {
+ positions = this.rawSearch$SB(query.word, false).concat(this.rawSearch$SB(query.word, true));
+ }
+ this._metadatas[this._metadataLabels[0]].grouping$LSingleResult$AISB(result, positions, query.word, ! query.raw);
+ return result;
+};
+
+/**
+ */
+Oktavia.prototype.build$ = function () {
+ this.build$IB(5, false);
+};
+
+/**
+ * @param {!number} cacheDensity
+ * @param {!boolean} verbose
+ */
+Oktavia.prototype.build$IB = function (cacheDensity, verbose) {
+ /** @type {!string} */
+ var key;
+ /** @type {!number} */
+ var cacheRange;
+ /** @type {!number} */
+ var maxChar;
+ for (key in this._metadatas) {
+ this._metadatas[key]._build$();
+ }
+ cacheRange = Math.round(Math.max(1, 100 / Math.min(100, Math.max(0.01, cacheDensity))));
+ maxChar = this._compressCode2utf16.length;
+ this._fmindex.build$SIIB(Oktavia.eof, maxChar, cacheRange, verbose);
+};
+
+/**
+ * @return {!string}
+ */
+Oktavia.prototype.dump$ = function () {
+ return this.dump$B(false);
+};
+
+/**
+ * @param {!boolean} verbose
+ * @return {!string}
+ */
+Oktavia.prototype.dump$B = function (verbose) {
+ /** @type {!string} */
+ var header;
+ /** @type {!string} */
+ var fmdata;
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var i;
+ /** @type {CompressionReport} */
+ var report;
+ /** @type {undefined|!string} */
+ var name;
+ /** @type {!string} */
+ var data;
+ header = Binary$dumpString$SLCompressionReport$("oktavia-01", null).slice(1);
+ if (verbose) {
+ console.log("Source text size: " + (this._fmindex.size$() * 2 + "") + ' bytes');
+ }
+ fmdata = this._fmindex.dump$B(verbose);
+ result = [ header, fmdata ];
+ result.push(Binary$dump16bitNumber$I(this._compressCode2utf16.length));
+ for (i = 3; i < this._compressCode2utf16.length; i++) {
+ result.push(this._compressCode2utf16[i]);
+ }
+ if (verbose) {
+ console.log('Char Code Map: ' + (this._compressCode2utf16.length * 2 - 2 + "") + ' bytes');
+ }
+ report = ({source: 0, result: 0});
+ result.push(Binary$dumpStringListMap$HASLCompressionReport$(this._stemmingResult, report));
+ if (verbose) {
+ console.log('Stemmed Word Table: ' + (result[result.length - 1].length + "") + ' bytes (' + (Math.round(report.result * 100.0 / report.source) + "") + '%)');
+ }
+ result.push(Binary$dump16bitNumber$I(this._metadataLabels.length));
+ for (i = 0; i < this._metadataLabels.length; i++) {
+ report = ({source: 0, result: 0});
+ name = this._metadataLabels[i];
+ data = this._metadatas[name]._dump$LCompressionReport$(report);
+ result.push(Binary$dumpString$SLCompressionReport$(name, report), data);
+ if (verbose) {
+ console.log('Meta Data ' + name + ': ' + (data.length * 2 + "") + ' bytes (' + (Math.round(report.result * 100.0 / report.source) + "") + '%)');
+ }
+ }
+ return result.join('');
+};
+
+/**
+ * @param {!string} data
+ */
+Oktavia.prototype.load$S = function (data) {
+ /** @type {!string} */
+ var header;
+ /** @type {!number} */
+ var offset;
+ /** @type {!number} */
+ var charCodeCount;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var charCode;
+ /** @type {LoadedStringListMapResult} */
+ var stemmedWords;
+ /** @type {!number} */
+ var metadataCount;
+ /** @type {LoadedStringResult} */
+ var nameResult;
+ /** @type {!string} */
+ var name;
+ /** @type {!number} */
+ var type;
+ header = Binary$dumpString$SLCompressionReport$("oktavia-01", null).slice(1);
+ if (data.slice(0, 5) !== header) {
+ throw new Error('Invalid data file');
+ }
+ this._metadatas = ({ });
+ this._metadataLabels = [ ];
+ offset = 5;
+ offset = this._fmindex.load$SI(data, offset);
+ charCodeCount = Binary$load16bitNumber$SI(data, offset++);
+ this._compressCode2utf16 = [ Oktavia.eof, Oktavia.eob, Oktavia.unknown ];
+ this._utf162compressCode = [ Oktavia.eof, Oktavia.eob, Oktavia.unknown ];
+ for (i = 3; i < charCodeCount; i++) {
+ charCode = Binary$load16bitNumber$SI(data, offset++);
+ this._compressCode2utf16.push(String.fromCharCode(charCode));
+ this._utf162compressCode[charCode] = String.fromCharCode(i);
+ }
+ stemmedWords = Binary$loadStringListMap$SI(data, offset);
+ this._stemmingResult = stemmedWords.result;
+ offset = stemmedWords.offset;
+ metadataCount = Binary$load16bitNumber$SI(data, offset++);
+ for (i = 0; i < metadataCount; i++) {
+ nameResult = Binary$loadString$SI(data, offset);
+ name = nameResult.result;
+ offset = nameResult.offset;
+ type = Binary$load16bitNumber$SI(data, offset++);
+ switch (type) {
+ case 0:
+ offset = Section$_load$LOktavia$SSI(this, name, data, offset);
+ break;
+ case 1:
+ offset = Splitter$_load$LOktavia$SSI(this, name, data, offset);
+ break;
+ case 2:
+ offset = Table$_load$LOktavia$SSI(this, name, data, offset);
+ break;
+ case 3:
+ offset = Block$_load$LOktavia$SSI(this, name, data, offset);
+ break;
+ }
+ }
+};
+
+/**
+ * @return {!number}
+ */
+Oktavia.prototype.contentSize$ = function () {
+ /** @type {FMIndex} */
+ var this$0;
+ this$0 = this._fmindex;
+ return this$0._substr.length;
+};
+
+/**
+ * @param {!number} position
+ * @return {!number}
+ */
+Oktavia.prototype.wordPositionType$I = function (position) {
+ /** @type {!number} */
+ var result;
+ /** @type {!string} */
+ var ahead;
+ result = 0;
+ if (position === 0) {
+ result = 4;
+ } else {
+ ahead = this._fmindex.getSubstring$II(position - 1, 1);
+ if (/\s/.test(ahead)) {
+ result = 2;
+ } else {
+ if (/\W/.test(ahead)) {
+ result = 1;
+ } else {
+ if (Oktavia.eob === ahead) {
+ result = 3;
+ }
+ }
+ }
+ }
+ return (result | 0);
+};
+
+/**
+ * @param {!number} position
+ * @param {!number} length
+ * @return {!string}
+ */
+Oktavia.prototype._getSubstring$II = function (position, length) {
+ /** @type {!string} */
+ var result;
+ /** @type {Array.<undefined|!string>} */
+ var str;
+ /** @type {!number} */
+ var i;
+ result = this._fmindex.getSubstring$II(position, length);
+ str = [ ];
+ for (i = 0; i < result.length; i++) {
+ str.push(this._compressCode2utf16[result.charCodeAt(i)]);
+ }
+ return str.join('');
+};
+
+/**
+ * class Binary extends Object
+ * @constructor
+ */
+function Binary() {
+}
+
+/**
+ * @constructor
+ */
+function Binary$() {
+};
+
+Binary$.prototype = new Binary;
+
+/**
+ * @param {!number} num
+ * @return {!string}
+ */
+Binary.dump32bitNumber$N = function (num) {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ result = [ String.fromCharCode(Math.floor(num / 65536)) ];
+ result.push(String.fromCharCode(num % 65536));
+ return result.join("");
+};
+
+var Binary$dump32bitNumber$N = Binary.dump32bitNumber$N;
+
+/**
+ * @param {!string} buffer
+ * @param {!number} offset
+ * @return {!number}
+ */
+Binary.load32bitNumber$SI = function (buffer, offset) {
+ /** @type {!number} */
+ var result;
+ result = buffer.charCodeAt(offset) * 65536 + buffer.charCodeAt(offset + 1);
+ return result;
+};
+
+var Binary$load32bitNumber$SI = Binary.load32bitNumber$SI;
+
+/**
+ * @param {!number} num
+ * @return {!string}
+ */
+Binary.dump16bitNumber$I = function (num) {
+ return String.fromCharCode(num % 65536);
+};
+
+var Binary$dump16bitNumber$I = Binary.dump16bitNumber$I;
+
+/**
+ * @param {!string} buffer
+ * @param {!number} offset
+ * @return {!number}
+ */
+Binary.load16bitNumber$SI = function (buffer, offset) {
+ return (buffer.charCodeAt(offset) | 0);
+};
+
+var Binary$load16bitNumber$SI = Binary.load16bitNumber$SI;
+
+/**
+ * @param {!string} str
+ * @return {!string}
+ */
+Binary.dumpString$S = function (str) {
+ return Binary$dumpString$SLCompressionReport$(str, null);
+};
+
+var Binary$dumpString$S = Binary.dumpString$S;
+
+/**
+ * @param {!string} str
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+Binary.dumpString$SLCompressionReport$ = function (str, report) {
+ /** @type {!number} */
+ var length;
+ /** @type {!boolean} */
+ var compress;
+ /** @type {Array.<undefined|!number>} */
+ var charCodes;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var charCode;
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {undefined|!number} */
+ var bytes;
+ if (str.length > 32768) {
+ str = str.slice(0, 32768);
+ }
+ length = str.length;
+ compress = true;
+ charCodes = [ ];
+ for (i = 0; i < length; i++) {
+ charCode = str.charCodeAt(i);
+ if (charCode > 255) {
+ compress = false;
+ break;
+ }
+ charCodes.push(charCode);
+ }
+ if (compress) {
+ result = [ Binary$dump16bitNumber$I(length + 32768) ];
+ for (i = 0; i < length; i += 2) {
+ bytes = charCodes[i];
+ if (i !== length - 1) {
+ bytes += charCodes[i + 1] << 8;
+ }
+ result.push(String.fromCharCode(bytes % 65536));
+ }
+ if (report) {
+ CompressionReport$add$LCompressionReport$II(report, length, Math.ceil(length / 2));
+ }
+ } else {
+ result = [ Binary$dump16bitNumber$I(length), str ];
+ if (report) {
+ CompressionReport$add$LCompressionReport$II(report, length, length);
+ }
+ }
+ return result.join('');
+};
+
+var Binary$dumpString$SLCompressionReport$ = Binary.dumpString$SLCompressionReport$;
+
+/**
+ * @param {!string} buffer
+ * @param {!number} offset
+ * @return {LoadedStringResult}
+ */
+Binary.loadString$SI = function (buffer, offset) {
+ return new LoadedStringResult$SI(buffer, offset);
+};
+
+var Binary$loadString$SI = Binary.loadString$SI;
+
+/**
+ * @param {Array.<undefined|!string>} strList
+ * @return {!string}
+ */
+Binary.dumpStringList$AS = function (strList) {
+ return Binary$dumpStringList$ASLCompressionReport$(strList, null);
+};
+
+var Binary$dumpStringList$AS = Binary.dumpStringList$AS;
+
+/**
+ * @param {Array.<undefined|!string>} strList
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+Binary.dumpStringList$ASLCompressionReport$ = function (strList, report) {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var i;
+ result = [ Binary$dump32bitNumber$N(strList.length) ];
+ for (i = 0; i < strList.length; i++) {
+ result.push(Binary$dumpString$SLCompressionReport$(strList[i], report));
+ }
+ return result.join('');
+};
+
+var Binary$dumpStringList$ASLCompressionReport$ = Binary.dumpStringList$ASLCompressionReport$;
+
+/**
+ * @param {!string} buffer
+ * @param {!number} offset
+ * @return {LoadedStringListResult}
+ */
+Binary.loadStringList$SI = function (buffer, offset) {
+ return new LoadedStringListResult$SI(buffer, offset);
+};
+
+var Binary$loadStringList$SI = Binary.loadStringList$SI;
+
+/**
+ * @param {Object.<string, undefined|Array.<undefined|!string>>} strMap
+ * @return {!string}
+ */
+Binary.dumpStringListMap$HAS = function (strMap) {
+ return Binary$dumpStringListMap$HASLCompressionReport$(strMap, null);
+};
+
+var Binary$dumpStringListMap$HAS = Binary.dumpStringListMap$HAS;
+
+/**
+ * @param {Object.<string, undefined|Array.<undefined|!string>>} strMap
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+Binary.dumpStringListMap$HASLCompressionReport$ = function (strMap, report) {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var counter;
+ /** @type {!string} */
+ var key;
+ result = [ ];
+ counter = 0;
+ for (key in strMap) {
+ result.push(Binary$dumpString$SLCompressionReport$(key, report));
+ result.push(Binary$dumpStringList$ASLCompressionReport$(strMap[key], report));
+ counter++;
+ }
+ return Binary$dump32bitNumber$N(counter) + result.join('');
+};
+
+var Binary$dumpStringListMap$HASLCompressionReport$ = Binary.dumpStringListMap$HASLCompressionReport$;
+
+/**
+ * @param {!string} buffer
+ * @param {!number} offset
+ * @return {LoadedStringListMapResult}
+ */
+Binary.loadStringListMap$SI = function (buffer, offset) {
+ return new LoadedStringListMapResult$SI(buffer, offset);
+};
+
+var Binary$loadStringListMap$SI = Binary.loadStringListMap$SI;
+
+/**
+ * @param {Array.<undefined|!number>} array
+ * @return {!string}
+ */
+Binary.dump32bitNumberList$AN = function (array) {
+ return Binary$dump32bitNumberList$ANLCompressionReport$(array, null);
+};
+
+var Binary$dump32bitNumberList$AN = Binary.dump32bitNumberList$AN;
+
+/**
+ * @param {Array.<undefined|!number>} array
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+Binary.dump32bitNumberList$ANLCompressionReport$ = function (array, report) {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var index;
+ /** @type {!number} */
+ var inputLength;
+ /** @type {!number} */
+ var length;
+ /** @type {!string} */
+ var resultString;
+ /** @type {!number} */
+ var value1$0;
+ /** @type {!number} */
+ var value2$0;
+ result = [ Binary$dump32bitNumber$N(array.length) ];
+ index = 0;
+ inputLength = array.length;
+ while (index < inputLength) {
+ if (array[index] == 0) {
+ length = Binary$_countZero$ANI(array, index);
+ result.push(Binary$_zeroBlock$I(length));
+ index += length;
+ } else {
+ if (Binary$_shouldZebraCode$ANI(array, index)) {
+ result.push(Binary$_createZebraCode$ANI(array, index));
+ value1$0 = array.length;
+ value2$0 = index + 15;
+ index = (value1$0 <= value2$0 ? value1$0 : value2$0);
+ } else {
+ length = Binary$_searchDoubleZero$ANI(array, index);
+ result.push(Binary$_nonZeroBlock$ANII(array, index, length));
+ if (length === 0) {
+ throw new Error('');
+ }
+ index += length;
+ }
+ }
+ }
+ resultString = result.join('');
+ if (report) {
+ CompressionReport$add$LCompressionReport$II(report, array.length * 2 + 2, resultString.length);
+ }
+ return resultString;
+};
+
+var Binary$dump32bitNumberList$ANLCompressionReport$ = Binary.dump32bitNumberList$ANLCompressionReport$;
+
+/**
+ * @param {!string} buffer
+ * @param {!number} offset
+ * @return {LoadedNumberListResult}
+ */
+Binary.load32bitNumberList$SI = function (buffer, offset) {
+ return new LoadedNumberListResult$SI(buffer, offset);
+};
+
+var Binary$load32bitNumberList$SI = Binary.load32bitNumberList$SI;
+
+/**
+ * @param {Array.<undefined|!number>} array
+ * @param {!number} offset
+ * @return {!number}
+ */
+Binary._countZero$ANI = function (array, offset) {
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var array$len$0;
+ for ((i = offset, array$len$0 = array.length); i < array$len$0; i++) {
+ if (array[i] != 0) {
+ return (i - offset | 0);
+ }
+ }
+ return (array.length - offset | 0);
+};
+
+var Binary$_countZero$ANI = Binary._countZero$ANI;
+
+/**
+ * @param {!number} length
+ * @return {!string}
+ */
+Binary._zeroBlock$I = function (length) {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ result = [ ];
+ while (length > 0) {
+ if (length > 16384) {
+ result.push(Binary$dump16bitNumber$I(16383));
+ length -= 16384;
+ } else {
+ result.push(Binary$dump16bitNumber$I(length - 1));
+ length = 0;
+ }
+ }
+ return result.join('');
+};
+
+var Binary$_zeroBlock$I = Binary._zeroBlock$I;
+
+/**
+ * @param {Array.<undefined|!number>} array
+ * @param {!number} offset
+ * @return {!boolean}
+ */
+Binary._shouldZebraCode$ANI = function (array, offset) {
+ /** @type {!number} */
+ var change;
+ /** @type {!boolean} */
+ var isLastZero;
+ /** @type {!number} */
+ var i;
+ if (array.length - offset < 16) {
+ return true;
+ }
+ change = 0;
+ isLastZero = false;
+ for (i = offset; i < offset + 15; i++) {
+ if (array[i] == 0) {
+ if (! isLastZero) {
+ isLastZero = true;
+ change++;
+ }
+ } else {
+ if (isLastZero) {
+ isLastZero = false;
+ change++;
+ }
+ }
+ }
+ return change > 2;
+};
+
+var Binary$_shouldZebraCode$ANI = Binary._shouldZebraCode$ANI;
+
+/**
+ * @param {Array.<undefined|!number>} array
+ * @param {!number} offset
+ * @return {!number}
+ */
+Binary._searchDoubleZero$ANI = function (array, offset) {
+ /** @type {!boolean} */
+ var isLastZero;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var array$len$0;
+ isLastZero = false;
+ for ((i = offset, array$len$0 = array.length); i < array$len$0; i++) {
+ if (array[i] == 0) {
+ if (isLastZero) {
+ return (i - offset - 1 | 0);
+ }
+ isLastZero = true;
+ } else {
+ isLastZero = false;
+ }
+ }
+ return (array.length - offset | 0);
+};
+
+var Binary$_searchDoubleZero$ANI = Binary._searchDoubleZero$ANI;
+
+/**
+ * @param {Array.<undefined|!number>} array
+ * @param {!number} offset
+ * @param {!number} length
+ * @return {!string}
+ */
+Binary._nonZeroBlock$ANII = function (array, offset, length) {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var blockLength;
+ /** @type {!number} */
+ var i;
+ result = [ ];
+ while (length > 0) {
+ if (length > 16384) {
+ blockLength = 16384;
+ length -= 16384;
+ } else {
+ blockLength = length;
+ length = 0;
+ }
+ result.push(Binary$dump16bitNumber$I(blockLength - 1 + 0x4000));
+ for (i = offset; i < offset + blockLength; i++) {
+ result.push(Binary$dump32bitNumber$N(array[i]));
+ }
+ offset += blockLength;
+ }
+ return result.join('');
+};
+
+var Binary$_nonZeroBlock$ANII = Binary._nonZeroBlock$ANII;
+
+/**
+ * @param {Array.<undefined|!number>} array
+ * @param {!number} offset
+ * @return {!string}
+ */
+Binary._createZebraCode$ANI = function (array, offset) {
+ /** @type {!number} */
+ var last;
+ /** @type {!number} */
+ var code;
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var value1$0;
+ /** @type {!number} */
+ var value2$0;
+ value1$0 = offset + 15;
+ value2$0 = array.length;
+ last = (value1$0 <= value2$0 ? value1$0 : value2$0);
+ code = 0x8000;
+ result = [ ];
+ for (i = offset; i < last; i++) {
+ if (array[i] != 0) {
+ result.push(Binary$dump32bitNumber$N(array[i]));
+ code = code + (0x1 << i - offset);
+ }
+ }
+ return String.fromCharCode(code) + result.join('');
+};
+
+var Binary$_createZebraCode$ANI = Binary._createZebraCode$ANI;
+
+/**
+ * @param {!string} str
+ * @return {!string}
+ */
+Binary.base64encode$S = function (str) {
+ /** @type {Array.<undefined|!string>} */
+ var out;
+ /** @type {Array.<undefined|!number>} */
+ var source;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var code;
+ /** @type {!number} */
+ var len;
+ /** @type {!number} */
+ var c1;
+ /** @type {undefined|!number} */
+ var c2;
+ /** @type {undefined|!number} */
+ var c3;
+ out = [ ];
+ source = [ ];
+ for (i = 0; i < str.length; i++) {
+ code = str.charCodeAt(i);
+ source.push(code & 0x00ff, code >>> 8);
+ }
+ len = str.length * 2;
+ i = 0;
+ while (i < len) {
+ c1 = source[i++] & 0xff;
+ if (i === len) {
+ out.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(c1 >> 2));
+ out.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((c1 & 0x3) << 4));
+ out.push("==");
+ break;
+ }
+ c2 = source[i++];
+ if (i === len) {
+ out.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(c1 >> 2));
+ out.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((c1 & 0x3) << 4 | (c2 & 0xF0) >> 4));
+ out.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((c2 & 0xF) << 2));
+ out.push("=");
+ break;
+ }
+ c3 = source[i++];
+ out.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(c1 >> 2));
+ out.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((c1 & 0x3) << 4 | (c2 & 0xF0) >> 4));
+ out.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((c2 & 0xF) << 2 | (c3 & 0xC0) >> 6));
+ out.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(c3 & 0x3F));
+ }
+ return out.join('');
+};
+
+var Binary$base64encode$S = Binary.base64encode$S;
+
+/**
+ * @param {Array.<undefined|!number>} source
+ * @return {!string}
+ */
+Binary._mergeCharCode$AI = function (source) {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var i;
+ result = [ ];
+ for (i = 0; i < source.length; i += 2) {
+ result.push(String.fromCharCode(source[i] + (source[i + 1] << 8)));
+ }
+ return result.join('');
+};
+
+var Binary$_mergeCharCode$AI = Binary._mergeCharCode$AI;
+
+/**
+ * @param {!string} str
+ * @return {!string}
+ */
+Binary.base64decode$S = function (str) {
+ /** @type {!number} */
+ var len;
+ /** @type {!number} */
+ var i;
+ /** @type {Array.<undefined|!number>} */
+ var out;
+ /** @type {undefined|!number} */
+ var c1;
+ /** @type {undefined|!number} */
+ var c2;
+ /** @type {!number} */
+ var c3;
+ /** @type {!number} */
+ var c4;
+ len = str.length;
+ i = 0;
+ out = [ ];
+ while (i < len) {
+ do {
+ c1 = Binary._base64DecodeChars[str.charCodeAt(i++) & 0xff];
+ } while (i < len && c1 == -1);
+ if (c1 == -1) {
+ break;
+ }
+ do {
+ c2 = Binary._base64DecodeChars[str.charCodeAt(i++) & 0xff];
+ } while (i < len && c2 == -1);
+ if (c2 == -1) {
+ break;
+ }
+ out.push(c1 << 2 | (c2 & 0x30) >> 4);
+ do {
+ c3 = str.charCodeAt(i++) & 0xff;
+ if (c3 === 61) {
+ return Binary$_mergeCharCode$AI(out);
+ }
+ c3 = Binary._base64DecodeChars[c3];
+ } while (i < len && c3 === -1);
+ if (c3 === -1) {
+ break;
+ }
+ out.push((c2 & 0XF) << 4 | (c3 & 0x3C) >> 2);
+ do {
+ c4 = str.charCodeAt(i++) & 0xff;
+ if (c4 === 61) {
+ return Binary$_mergeCharCode$AI(out);
+ }
+ c4 = (Binary._base64DecodeChars[c4] | 0);
+ } while (i < len && c4 === -1);
+ if (c4 === -1) {
+ break;
+ }
+ out.push((c3 & 0x03) << 6 | c4);
+ }
+ return Binary$_mergeCharCode$AI(out);
+};
+
+var Binary$base64decode$S = Binary.base64decode$S;
+
+/**
+ * class LoadedStringResult extends Object
+ * @constructor
+ */
+function LoadedStringResult() {
+}
+
+/**
+ * @constructor
+ * @param {!string} data
+ * @param {!number} offset
+ */
+function LoadedStringResult$SI(data, offset) {
+ /** @type {!number} */
+ var strLength;
+ /** @type {Array.<undefined|!string>} */
+ var bytes;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var code;
+ /** @type {!number} */
+ var offset$0;
+ this.result = "";
+ this.offset = 0;
+ offset$0 = offset++;
+ strLength = data.charCodeAt(offset$0);
+ if (strLength > 32767) {
+ strLength = strLength - 32768;
+ bytes = [ ];
+ for (i = 0; i < strLength; i += 2) {
+ code = data.charCodeAt(offset);
+ bytes.push(String.fromCharCode(code & 0x00ff));
+ if (i !== strLength - 1) {
+ bytes.push(String.fromCharCode(code >>> 8));
+ }
+ offset++;
+ }
+ this.result = bytes.join('');
+ this.offset = offset;
+ } else {
+ this.result = data.slice(offset, offset + strLength);
+ this.offset = (offset + strLength | 0);
+ }
+};
+
+LoadedStringResult$SI.prototype = new LoadedStringResult;
+
+/**
+ * class LoadedStringListResult extends Object
+ * @constructor
+ */
+function LoadedStringListResult() {
+}
+
+/**
+ * @constructor
+ * @param {!string} data
+ * @param {!number} offset
+ */
+function LoadedStringListResult$SI(data, offset) {
+ /** @type {!number} */
+ var length;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var strLength;
+ /** @type {!string} */
+ var resultStr;
+ /** @type {Array.<undefined|!string>} */
+ var bytes;
+ /** @type {!number} */
+ var j;
+ /** @type {!number} */
+ var code;
+ /** @type {!number} */
+ var result$0;
+ /** @type {!number} */
+ var offset$0;
+ this.offset = 0;
+ this.result = [ ];
+ result$0 = data.charCodeAt(offset) * 65536 + data.charCodeAt(offset + 1);
+ length = result$0;
+ offset += 2;
+ for (i = 0; i < length; i++) {
+ offset$0 = offset++;
+ strLength = data.charCodeAt(offset$0);
+ if (strLength > 32767) {
+ strLength = strLength - 32768;
+ bytes = [ ];
+ for (j = 0; j < strLength; j += 2) {
+ code = data.charCodeAt(offset);
+ bytes.push(String.fromCharCode(code & 0x00ff));
+ if (j !== strLength - 1) {
+ bytes.push(String.fromCharCode(code >>> 8));
+ }
+ offset++;
+ }
+ resultStr = bytes.join('');
+ } else {
+ resultStr = data.slice(offset, offset + strLength);
+ offset = (offset + strLength | 0);
+ }
+ this.result.push(resultStr);
+ }
+ this.offset = offset;
+};
+
+LoadedStringListResult$SI.prototype = new LoadedStringListResult;
+
+/**
+ * class LoadedStringListMapResult extends Object
+ * @constructor
+ */
+function LoadedStringListMapResult() {
+}
+
+/**
+ * @constructor
+ * @param {!string} data
+ * @param {!number} offset
+ */
+function LoadedStringListMapResult$SI(data, offset) {
+ /** @type {!number} */
+ var length;
+ /** @type {!number} */
+ var i;
+ /** @type {LoadedStringResult} */
+ var keyResult;
+ /** @type {LoadedStringListResult} */
+ var valueResult;
+ /** @type {!number} */
+ var result$0;
+ /** @type {!number} */
+ var offset$0;
+ this.offset = 0;
+ this.result = ({ });
+ result$0 = data.charCodeAt(offset) * 65536 + data.charCodeAt(offset + 1);
+ length = result$0;
+ offset += 2;
+ for (i = 0; i < length; i++) {
+ keyResult = new LoadedStringResult$SI(data, offset);
+ offset$0 = keyResult.offset;
+ valueResult = new LoadedStringListResult$SI(data, offset$0);
+ this.result[keyResult.result] = valueResult.result;
+ offset = valueResult.offset;
+ }
+ this.offset = offset;
+};
+
+LoadedStringListMapResult$SI.prototype = new LoadedStringListMapResult;
+
+/**
+ * class LoadedNumberListResult extends Object
+ * @constructor
+ */
+function LoadedNumberListResult() {
+}
+
+/**
+ * @constructor
+ * @param {!string} data
+ * @param {!number} offset
+ */
+function LoadedNumberListResult$SI(data, offset) {
+ /** @type {!number} */
+ var resultLength;
+ /** @type {!number} */
+ var originalOffset;
+ /** @type {Array.<undefined|!number>} */
+ var result;
+ /** @type {!number} */
+ var tag;
+ /** @type {!number} */
+ var length;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var result$0;
+ /** @type {!number} */
+ var value1$0;
+ this.result = null;
+ this.offset = 0;
+ result$0 = data.charCodeAt(offset) * 65536 + data.charCodeAt(offset + 1);
+ resultLength = result$0;
+ originalOffset = offset;
+ offset += 2;
+ result = [ ];
+ while (result.length < resultLength) {
+ tag = data.charCodeAt(offset++);
+ if (tag >>> 15 === 1) {
+ value1$0 = resultLength - result.length;
+ length = (value1$0 <= 15 ? value1$0 : 15);
+ for (i = 0; i < length; i++) {
+ if (tag >>> i & 0x1) {
+ result.push(Binary$load32bitNumber$SI(data, offset));
+ offset += 2;
+ } else {
+ result.push(0);
+ }
+ }
+ } else {
+ if (tag >>> 14 === 1) {
+ length = tag - 0x4000 + 1;
+ for (i = 0; i < length; i++) {
+ result.push(Binary$load32bitNumber$SI(data, offset));
+ offset += 2;
+ }
+ } else {
+ length = tag + 1;
+ for (i = 0; i < length; i++) {
+ result.push(0);
+ }
+ }
+ }
+ }
+ this.result = result;
+ this.offset = offset;
+};
+
+LoadedNumberListResult$SI.prototype = new LoadedNumberListResult;
+
+/**
+ * class CompressionReport extends Object
+ * @constructor
+ */
+function CompressionReport() {
+}
+
+/**
+ * @constructor
+ */
+function CompressionReport$() {
+ this.source = 0;
+ this.result = 0;
+};
+
+CompressionReport$.prototype = new CompressionReport;
+
+/**
+ * @param {CompressionReport} $this
+ * @param {!number} source
+ * @param {!number} result
+ */
+CompressionReport.add$LCompressionReport$II = function ($this, source, result) {
+ $this.source += source;
+ $this.result += result;
+};
+
+var CompressionReport$add$LCompressionReport$II = CompressionReport.add$LCompressionReport$II;
+
+/**
+ * @param {CompressionReport} $this
+ * @return {!number}
+ */
+CompressionReport.rate$LCompressionReport$ = function ($this) {
+ return (Math.round($this.result * 100.0 / $this.source) | 0);
+};
+
+var CompressionReport$rate$LCompressionReport$ = CompressionReport.rate$LCompressionReport$;
+
+/**
+ * class Query extends Object
+ * @constructor
+ */
+function Query() {
+}
+
+/**
+ * @constructor
+ */
+function Query$() {
+ this.word = '';
+ this.or = false;
+ this.not = false;
+ this.raw = false;
+};
+
+Query$.prototype = new Query;
+
+/**
+ * @return {!string}
+ */
+Query.prototype.toString = function () {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ result = [ ];
+ if (this.or) {
+ result.push("OR ");
+ }
+ if (this.not) {
+ result.push("-");
+ }
+ if (this.raw) {
+ result.push('"', this.word, '"');
+ } else {
+ result.push(this.word);
+ }
+ return result.join('');
+};
+
+/**
+ * class QueryStringParser extends Object
+ * @constructor
+ */
+function QueryStringParser() {
+}
+
+/**
+ * @constructor
+ */
+function QueryStringParser$() {
+ this.queries = [ ];
+};
+
+QueryStringParser$.prototype = new QueryStringParser;
+
+/**
+ * @param {QueryStringParser} $this
+ * @param {!string} queryString
+ * @return {Array.<undefined|Query>}
+ */
+QueryStringParser.parse$LQueryStringParser$S = function ($this, queryString) {
+ /** @type {!boolean} */
+ var nextOr;
+ /** @type {!boolean} */
+ var nextNot;
+ /** @type {!number} */
+ var currentWordStart;
+ /** @type {!number} */
+ var status;
+ /** @type {RegExp} */
+ var isSpace;
+ /** @type {!number} */
+ var i;
+ /** @type {!string} */
+ var ch;
+ /** @type {!string} */
+ var word;
+ /** @type {Query} */
+ var query;
+ nextOr = false;
+ nextNot = false;
+ currentWordStart = 0;
+ status = 0;
+ isSpace = /[\s\u3000]/;
+ for (i = 0; i < queryString.length; i++) {
+ ch = queryString.charAt(i);
+ switch (status) {
+ case 0:
+ if (! isSpace.test(ch)) {
+ if (ch === '-') {
+ nextNot = true;
+ } else {
+ if (ch === '"') {
+ currentWordStart = i + 1;
+ status = 2;
+ } else {
+ currentWordStart = i;
+ status = 1;
+ }
+ }
+ } else {
+ nextNot = false;
+ }
+ break;
+ case 1:
+ if (isSpace.test(ch)) {
+ word = queryString.slice(currentWordStart, i);
+ if (word === 'OR') {
+ nextOr = true;
+ } else {
+ query = new Query$();
+ query.word = word;
+ query.or = nextOr;
+ query.not = nextNot;
+ $this.queries.push(query);
+ nextOr = false;
+ nextNot = false;
+ }
+ status = 0;
+ }
+ break;
+ case 2:
+ if (ch === '"') {
+ word = queryString.slice(currentWordStart, i);
+ query = new Query$();
+ query.word = word;
+ query.or = nextOr;
+ query.not = nextNot;
+ query.raw = true;
+ $this.queries.push(query);
+ nextOr = false;
+ nextNot = false;
+ status = 0;
+ }
+ break;
+ }
+ }
+ switch (status) {
+ case 0:
+ break;
+ case 1:
+ query = new Query$();
+ word = queryString.slice(currentWordStart, queryString.length);
+ if (word !== 'OR') {
+ query.word = word;
+ query.or = nextOr;
+ query.not = nextNot;
+ $this.queries.push(query);
+ }
+ break;
+ case 2:
+ query = new Query$();
+ query.word = queryString.slice(currentWordStart, queryString.length);
+ query.or = nextOr;
+ query.not = nextNot;
+ query.raw = true;
+ $this.queries.push(query);
+ break;
+ }
+ return $this.queries;
+};
+
+var QueryStringParser$parse$LQueryStringParser$S = QueryStringParser.parse$LQueryStringParser$S;
+
+/**
+ * @param {QueryStringParser} $this
+ * @return {!string}
+ */
+QueryStringParser.highlight$LQueryStringParser$ = function ($this) {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var i;
+ /** @type {Query} */
+ var query;
+ result = [ ];
+ for (i = 0; i < $this.queries.length; i++) {
+ query = $this.queries[i];
+ if (! query.not) {
+ result.push("highlight=" + $__jsx_encodeURIComponent(query.word));
+ }
+ }
+ return '?' + result.join('&');
+};
+
+var QueryStringParser$highlight$LQueryStringParser$ = QueryStringParser.highlight$LQueryStringParser$;
+
+/**
+ * class Proposal extends Object
+ * @constructor
+ */
+function Proposal() {
+}
+
+/**
+ * @constructor
+ * @param {!number} omit
+ * @param {!number} expect
+ */
+function Proposal$II(omit, expect) {
+ this.omit = omit;
+ this.expect = expect;
+};
+
+Proposal$II.prototype = new Proposal;
+
+/**
+ * class Position extends Object
+ * @constructor
+ */
+function Position() {
+}
+
+/**
+ * @constructor
+ * @param {!string} word
+ * @param {!number} position
+ * @param {!boolean} stemmed
+ */
+function Position$SIB(word, position, stemmed) {
+ this.word = word;
+ this.position = position;
+ this.stemmed = stemmed;
+};
+
+Position$SIB.prototype = new Position;
+
+/**
+ * class SearchUnit extends Object
+ * @constructor
+ */
+function SearchUnit() {
+}
+
+/**
+ * @constructor
+ * @param {!number} id
+ */
+function SearchUnit$I(id) {
+ this.positions = ({ });
+ this.id = id;
+ this._size = 0;
+ this.score = 0;
+ this.startPosition = -1;
+};
+
+SearchUnit$I.prototype = new SearchUnit;
+
+/**
+ * @param {SearchUnit} $this
+ * @param {!string} word
+ * @param {!number} position
+ * @param {!boolean} stemmed
+ */
+SearchUnit.addPosition$LSearchUnit$SIB = function ($this, word, position, stemmed) {
+ /** @type {Position} */
+ var positionObj;
+ positionObj = $this.positions[position + ""];
+ if (! positionObj) {
+ $this._size++;
+ $this.positions[position + ""] = ({word: word, position: position, stemmed: stemmed});
+ } else {
+ if (positionObj.word.length < word.length) {
+ positionObj.word = word;
+ }
+ positionObj.stemmed = positionObj.stemmed && stemmed;
+ }
+};
+
+var SearchUnit$addPosition$LSearchUnit$SIB = SearchUnit.addPosition$LSearchUnit$SIB;
+
+/**
+ * @param {SearchUnit} $this
+ * @param {!number} position
+ * @return {Position}
+ */
+SearchUnit.get$LSearchUnit$I = function ($this, position) {
+ return $this.positions[position + ""];
+};
+
+var SearchUnit$get$LSearchUnit$I = SearchUnit.get$LSearchUnit$I;
+
+/**
+ * @param {SearchUnit} $this
+ * @return {!number}
+ */
+SearchUnit.size$LSearchUnit$ = function ($this) {
+ return $this._size;
+};
+
+var SearchUnit$size$LSearchUnit$ = SearchUnit.size$LSearchUnit$;
+
+/**
+ * @param {SearchUnit} $this
+ * @param {SearchUnit} rhs
+ */
+SearchUnit.merge$LSearchUnit$LSearchUnit$ = function ($this, rhs) {
+ /** @type {!string} */
+ var position;
+ /** @type {Position} */
+ var pos;
+ for (position in rhs.positions) {
+ pos = rhs.positions[position];
+ SearchUnit$addPosition$LSearchUnit$SIB($this, pos.word, pos.position, pos.stemmed);
+ }
+};
+
+var SearchUnit$merge$LSearchUnit$LSearchUnit$ = SearchUnit.merge$LSearchUnit$LSearchUnit$;
+
+/**
+ * @param {SearchUnit} $this
+ * @return {Array.<undefined|Position>}
+ */
+SearchUnit.getPositions$LSearchUnit$ = function ($this) {
+ /** @type {Array.<undefined|Position>} */
+ var result;
+ /** @type {!string} */
+ var pos;
+ result = [ ];
+ for (pos in $this.positions) {
+ result.push($this.positions[pos]);
+ }
+ result.sort((function (a, b) {
+ return a.position - b.position;
+ }));
+ return result;
+};
+
+var SearchUnit$getPositions$LSearchUnit$ = SearchUnit.getPositions$LSearchUnit$;
+
+/**
+ * class SingleResult extends Object
+ * @constructor
+ */
+function SingleResult() {
+}
+
+/**
+ * @constructor
+ */
+function SingleResult$() {
+ this.units = [ ];
+ this.unitIds = [ ];
+ this.or = false;
+ this.not = false;
+ this.searchWord = '';
+};
+
+SingleResult$.prototype = new SingleResult;
+
+/**
+ * @constructor
+ * @param {!string} searchWord
+ * @param {!boolean} or
+ * @param {!boolean} not
+ */
+function SingleResult$SBB(searchWord, or, not) {
+ this.units = [ ];
+ this.unitIds = [ ];
+ this.or = or;
+ this.not = not;
+ this.searchWord = searchWord;
+};
+
+SingleResult$SBB.prototype = new SingleResult;
+
+/**
+ * @param {SingleResult} $this
+ * @param {!number} unitId
+ * @return {SearchUnit}
+ */
+SingleResult.getSearchUnit$LSingleResult$I = function ($this, unitId) {
+ /** @type {!number} */
+ var existing;
+ /** @type {SearchUnit} */
+ var result;
+ existing = $this.unitIds.indexOf(unitId);
+ if (existing === -1) {
+ result = ({positions: ({ }), id: unitId, _size: 0, score: 0, startPosition: -1});
+ $this.units.push(result);
+ $this.unitIds.push(unitId);
+ } else {
+ result = $this.units[existing];
+ }
+ return result;
+};
+
+var SingleResult$getSearchUnit$LSingleResult$I = SingleResult.getSearchUnit$LSingleResult$I;
+
+/**
+ * @param {SingleResult} $this
+ * @param {SingleResult} rhs
+ * @return {SingleResult}
+ */
+SingleResult.merge$LSingleResult$LSingleResult$ = function ($this, rhs) {
+ /** @type {SingleResult} */
+ var result;
+ result = ({units: [ ], unitIds: [ ], or: false, not: false, searchWord: ''});
+ if (rhs.or) {
+ SingleResult$_orMerge$LSingleResult$LSingleResult$LSingleResult$($this, result, rhs);
+ } else {
+ if (rhs.not) {
+ SingleResult$_notMerge$LSingleResult$LSingleResult$LSingleResult$($this, result, rhs);
+ } else {
+ SingleResult$_andMerge$LSingleResult$LSingleResult$LSingleResult$($this, result, rhs);
+ }
+ }
+ return result;
+};
+
+var SingleResult$merge$LSingleResult$LSingleResult$ = SingleResult.merge$LSingleResult$LSingleResult$;
+
+/**
+ * @param {SingleResult} $this
+ * @return {!number}
+ */
+SingleResult.size$LSingleResult$ = function ($this) {
+ return ($this.units.length | 0);
+};
+
+var SingleResult$size$LSingleResult$ = SingleResult.size$LSingleResult$;
+
+/**
+ * @param {SingleResult} $this
+ * @param {SingleResult} result
+ * @param {SingleResult} rhs
+ */
+SingleResult._andMerge$LSingleResult$LSingleResult$LSingleResult$ = function ($this, result, rhs) {
+ /** @type {!number} */
+ var i;
+ /** @type {undefined|!number} */
+ var id;
+ /** @type {SearchUnit} */
+ var lhsSection;
+ for (i = 0; i < $this.unitIds.length; i++) {
+ id = $this.unitIds[i];
+ if (rhs.unitIds.indexOf(id) !== -1) {
+ lhsSection = $this.units[i];
+ result.unitIds.push(id);
+ result.units.push(lhsSection);
+ }
+ }
+};
+
+var SingleResult$_andMerge$LSingleResult$LSingleResult$LSingleResult$ = SingleResult._andMerge$LSingleResult$LSingleResult$LSingleResult$;
+
+/**
+ * @param {SingleResult} $this
+ * @param {SingleResult} result
+ * @param {SingleResult} rhs
+ */
+SingleResult._orMerge$LSingleResult$LSingleResult$LSingleResult$ = function ($this, result, rhs) {
+ /** @type {!number} */
+ var i;
+ /** @type {undefined|!number} */
+ var id;
+ /** @type {SearchUnit} */
+ var rhsSection;
+ /** @type {SearchUnit} */
+ var lhsSection;
+ /** @type {Array.<undefined|!number>} */
+ var unitIds$0;
+ /** @type {Array.<undefined|SearchUnit>} */
+ var units$0;
+ result.unitIds = (unitIds$0 = $this.unitIds).slice(0, unitIds$0.length);
+ result.units = (units$0 = $this.units).slice(0, units$0.length);
+ for (i = 0; i < rhs.unitIds.length; i++) {
+ id = rhs.unitIds[i];
+ rhsSection = rhs.units[i];
+ if (result.unitIds.indexOf(id) !== -1) {
+ lhsSection = result.units[result.unitIds.indexOf(id)];
+ SearchUnit$merge$LSearchUnit$LSearchUnit$(lhsSection, rhsSection);
+ } else {
+ result.unitIds.push(id);
+ result.units.push(rhsSection);
+ }
+ }
+};
+
+var SingleResult$_orMerge$LSingleResult$LSingleResult$LSingleResult$ = SingleResult._orMerge$LSingleResult$LSingleResult$LSingleResult$;
+
+/**
+ * @param {SingleResult} $this
+ * @param {SingleResult} result
+ * @param {SingleResult} rhs
+ */
+SingleResult._notMerge$LSingleResult$LSingleResult$LSingleResult$ = function ($this, result, rhs) {
+ /** @type {!number} */
+ var i;
+ /** @type {undefined|!number} */
+ var id;
+ /** @type {SearchUnit} */
+ var lhsSection;
+ for (i = 0; i < $this.unitIds.length; i++) {
+ id = $this.unitIds[i];
+ if (rhs.unitIds.indexOf(id) === -1) {
+ lhsSection = $this.units[i];
+ result.unitIds.push(id);
+ result.units.push(lhsSection);
+ }
+ }
+};
+
+var SingleResult$_notMerge$LSingleResult$LSingleResult$LSingleResult$ = SingleResult._notMerge$LSingleResult$LSingleResult$LSingleResult$;
+
+/**
+ * class SearchSummary extends Object
+ * @constructor
+ */
+function SearchSummary() {
+}
+
+/**
+ * @constructor
+ */
+function SearchSummary$() {
+ this.sourceResults = [ ];
+ this.result = null;
+ this.oktavia = null;
+};
+
+SearchSummary$.prototype = new SearchSummary;
+
+/**
+ * @constructor
+ * @param {Oktavia} oktavia
+ */
+function SearchSummary$LOktavia$(oktavia) {
+ this.sourceResults = [ ];
+ this.result = null;
+ this.oktavia = oktavia;
+};
+
+SearchSummary$LOktavia$.prototype = new SearchSummary;
+
+/**
+ * @param {SearchSummary} $this
+ * @param {SingleResult} result
+ */
+SearchSummary.addQuery$LSearchSummary$LSingleResult$ = function ($this, result) {
+ $this.sourceResults.push(result);
+};
+
+var SearchSummary$addQuery$LSearchSummary$LSingleResult$ = SearchSummary.addQuery$LSearchSummary$LSingleResult$;
+
+/**
+ * @param {SearchSummary} $this
+ */
+SearchSummary.mergeResult$LSearchSummary$ = function ($this) {
+ $this.result = SearchSummary$mergeResult$LSearchSummary$ALSingleResult$($this, $this.sourceResults);
+};
+
+var SearchSummary$mergeResult$LSearchSummary$ = SearchSummary.mergeResult$LSearchSummary$;
+
+/**
+ * @param {SearchSummary} $this
+ * @param {Array.<undefined|SingleResult>} results
+ * @return {SingleResult}
+ */
+SearchSummary.mergeResult$LSearchSummary$ALSingleResult$ = function ($this, results) {
+ /** @type {SingleResult} */
+ var rhs;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var results$len$0;
+ rhs = results[0];
+ for ((i = 1, results$len$0 = results.length); i < results$len$0; i++) {
+ rhs = SingleResult$merge$LSingleResult$LSingleResult$(rhs, results[i]);
+ }
+ return rhs;
+};
+
+var SearchSummary$mergeResult$LSearchSummary$ALSingleResult$ = SearchSummary.mergeResult$LSearchSummary$ALSingleResult$;
+
+/**
+ * @param {SearchSummary} $this
+ * @return {Array.<undefined|Proposal>}
+ */
+SearchSummary.getProposal$LSearchSummary$ = function ($this) {
+ /** @type {Array.<undefined|Proposal>} */
+ var proposals;
+ /** @type {!number} */
+ var i;
+ /** @type {Array.<undefined|SingleResult>} */
+ var tmpSource;
+ /** @type {!number} */
+ var j;
+ /** @type {SingleResult} */
+ var result;
+ proposals = [ ];
+ for (i = 0; i < $this.sourceResults.length; i++) {
+ tmpSource = [ ];
+ for (j = 0; j < $this.sourceResults.length; j++) {
+ if (i !== j) {
+ tmpSource.push($this.sourceResults[j]);
+ }
+ }
+ result = SearchSummary$mergeResult$LSearchSummary$ALSingleResult$($this, tmpSource);
+ proposals.push(({omit: i, expect: result.units.length}));
+ }
+ proposals.sort((function (a, b) {
+ return b.expect - a.expect;
+ }));
+ return proposals;
+};
+
+var SearchSummary$getProposal$LSearchSummary$ = SearchSummary.getProposal$LSearchSummary$;
+
+/**
+ * @param {SearchSummary} $this
+ * @return {Array.<undefined|SearchUnit>}
+ */
+SearchSummary.getSortedResult$LSearchSummary$ = function ($this) {
+ /** @type {Array.<undefined|SearchUnit>} */
+ var result;
+ /** @type {Array.<undefined|SearchUnit>} */
+ var units$0;
+ result = (units$0 = $this.result.units).slice(0, units$0.length);
+ result.sort((function (a, b) {
+ return b.score - a.score;
+ }));
+ return result;
+};
+
+var SearchSummary$getSortedResult$LSearchSummary$ = SearchSummary.getSortedResult$LSearchSummary$;
+
+/**
+ * @param {SearchSummary} $this
+ * @return {!number}
+ */
+SearchSummary.size$LSearchSummary$ = function ($this) {
+ /** @type {SingleResult} */
+ var this$0;
+ this$0 = $this.result;
+ return (this$0.units.length | 0);
+};
+
+var SearchSummary$size$LSearchSummary$ = SearchSummary.size$LSearchSummary$;
+
+/**
+ * @param {SearchSummary} $this
+ * @param {SingleResult} result
+ */
+SearchSummary.add$LSearchSummary$LSingleResult$ = function ($this, result) {
+ $this.sourceResults.push(result);
+};
+
+var SearchSummary$add$LSearchSummary$LSingleResult$ = SearchSummary.add$LSearchSummary$LSingleResult$;
+
+/**
+ * class Style extends Object
+ * @constructor
+ */
+function Style() {
+}
+
+/**
+ * @constructor
+ * @param {!string} mode
+ */
+function Style$S(mode) {
+ this.styles = null;
+ this.escapeHTML = false;
+ switch (mode) {
+ case 'console':
+ this.styles = Style.console;
+ break;
+ case 'html':
+ this.styles = Style.html;
+ break;
+ case 'ignore':
+ this.styles = Style.ignore;
+ break;
+ default:
+ this.styles = Style.ignore;
+ break;
+ }
+ this.escapeHTML = mode === 'html';
+};
+
+Style$S.prototype = new Style;
+
+/**
+ * @param {!string} source
+ * @return {!string}
+ */
+Style.prototype.convert$S = function (source) {
+ /** @type {_HTMLHandler} */
+ var handler;
+ /** @type {SAXParser} */
+ var parser;
+ handler = new _HTMLHandler$HASB(this.styles, this.escapeHTML);
+ parser = new SAXParser$LSAXHandler$(handler);
+ parser.parse$S(source);
+ return handler.text.join('');
+};
+
+/**
+ * class Stemmer
+ * @constructor
+ */
+function Stemmer() {
+}
+
+Stemmer.prototype.$__jsx_implements_Stemmer = true;
+
+/**
+ * @constructor
+ */
+function Stemmer$() {
+};
+
+Stemmer$.prototype = new Stemmer;
+
+/**
+ * class BaseStemmer extends Object
+ * @constructor
+ */
+function BaseStemmer() {
+}
+
+$__jsx_merge_interface(BaseStemmer, Stemmer);
+
+/**
+ * @constructor
+ */
+function BaseStemmer$() {
+ /** @type {!string} */
+ var current$0;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var limit$0;
+ this.cache = ({ });
+ current$0 = this.current = "";
+ cursor$0 = this.cursor = 0;
+ limit$0 = this.limit = current$0.length;
+ this.limit_backward = 0;
+ this.bra = cursor$0;
+ this.ket = limit$0;
+};
+
+BaseStemmer$.prototype = new BaseStemmer;
+
+/**
+ * @param {!string} value
+ */
+BaseStemmer.prototype.setCurrent$S = function (value) {
+ /** @type {!string} */
+ var current$0;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var limit$0;
+ current$0 = this.current = value;
+ cursor$0 = this.cursor = 0;
+ limit$0 = this.limit = current$0.length;
+ this.limit_backward = 0;
+ this.bra = cursor$0;
+ this.ket = limit$0;
+};
+
+/**
+ * @return {!string}
+ */
+BaseStemmer.prototype.getCurrent$ = function () {
+ return this.current;
+};
+
+/**
+ * @param {BaseStemmer} other
+ */
+BaseStemmer.prototype.copy_from$LBaseStemmer$ = function (other) {
+ this.current = other.current;
+ this.cursor = other.cursor;
+ this.limit = other.limit;
+ this.limit_backward = other.limit_backward;
+ this.bra = other.bra;
+ this.ket = other.ket;
+};
+
+/**
+ * @param {Array.<undefined|!number>} s
+ * @param {!number} min
+ * @param {!number} max
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.in_grouping$AIII = function (s, min, max) {
+ /** @type {!number} */
+ var ch;
+ if (this.cursor >= this.limit) {
+ return false;
+ }
+ ch = this.current.charCodeAt(this.cursor);
+ if (ch > max || ch < min) {
+ return false;
+ }
+ ch -= min;
+ if ((s[ch >>> 3] & 0x1 << (ch & 0x7)) === 0) {
+ return false;
+ }
+ this.cursor++;
+ return true;
+};
+
+/**
+ * @param {Array.<undefined|!number>} s
+ * @param {!number} min
+ * @param {!number} max
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.in_grouping_b$AIII = function (s, min, max) {
+ /** @type {!number} */
+ var ch;
+ if (this.cursor <= this.limit_backward) {
+ return false;
+ }
+ ch = this.current.charCodeAt(this.cursor - 1);
+ if (ch > max || ch < min) {
+ return false;
+ }
+ ch -= min;
+ if ((s[ch >>> 3] & 0x1 << (ch & 0x7)) === 0) {
+ return false;
+ }
+ this.cursor--;
+ return true;
+};
+
+/**
+ * @param {Array.<undefined|!number>} s
+ * @param {!number} min
+ * @param {!number} max
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.out_grouping$AIII = function (s, min, max) {
+ /** @type {!number} */
+ var ch;
+ if (this.cursor >= this.limit) {
+ return false;
+ }
+ ch = this.current.charCodeAt(this.cursor);
+ if (ch > max || ch < min) {
+ this.cursor++;
+ return true;
+ }
+ ch -= min;
+ if ((s[ch >>> 3] & 0X1 << (ch & 0x7)) === 0) {
+ this.cursor++;
+ return true;
+ }
+ return false;
+};
+
+/**
+ * @param {Array.<undefined|!number>} s
+ * @param {!number} min
+ * @param {!number} max
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.out_grouping_b$AIII = function (s, min, max) {
+ /** @type {!number} */
+ var ch;
+ if (this.cursor <= this.limit_backward) {
+ return false;
+ }
+ ch = this.current.charCodeAt(this.cursor - 1);
+ if (ch > max || ch < min) {
+ this.cursor--;
+ return true;
+ }
+ ch -= min;
+ if ((s[ch >>> 3] & 0x1 << (ch & 0x7)) === 0) {
+ this.cursor--;
+ return true;
+ }
+ return false;
+};
+
+/**
+ * @param {!number} min
+ * @param {!number} max
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.in_range$II = function (min, max) {
+ /** @type {!number} */
+ var ch;
+ if (this.cursor >= this.limit) {
+ return false;
+ }
+ ch = this.current.charCodeAt(this.cursor);
+ if (ch > max || ch < min) {
+ return false;
+ }
+ this.cursor++;
+ return true;
+};
+
+/**
+ * @param {!number} min
+ * @param {!number} max
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.in_range_b$II = function (min, max) {
+ /** @type {!number} */
+ var ch;
+ if (this.cursor <= this.limit_backward) {
+ return false;
+ }
+ ch = this.current.charCodeAt(this.cursor - 1);
+ if (ch > max || ch < min) {
+ return false;
+ }
+ this.cursor--;
+ return true;
+};
+
+/**
+ * @param {!number} min
+ * @param {!number} max
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.out_range$II = function (min, max) {
+ /** @type {!number} */
+ var ch;
+ if (this.cursor >= this.limit) {
+ return false;
+ }
+ ch = this.current.charCodeAt(this.cursor);
+ if (! (ch > max || ch < min)) {
+ return false;
+ }
+ this.cursor++;
+ return true;
+};
+
+/**
+ * @param {!number} min
+ * @param {!number} max
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.out_range_b$II = function (min, max) {
+ /** @type {!number} */
+ var ch;
+ if (this.cursor <= this.limit_backward) {
+ return false;
+ }
+ ch = this.current.charCodeAt(this.cursor - 1);
+ if (! (ch > max || ch < min)) {
+ return false;
+ }
+ this.cursor--;
+ return true;
+};
+
+/**
+ * @param {!number} s_size
+ * @param {!string} s
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.eq_s$IS = function (s_size, s) {
+ /** @type {!number} */
+ var cursor$0;
+ if (this.limit - this.cursor < s_size) {
+ return false;
+ }
+ if (this.current.slice(cursor$0 = this.cursor, cursor$0 + s_size) !== s) {
+ return false;
+ }
+ this.cursor += s_size;
+ return true;
+};
+
+/**
+ * @param {!number} s_size
+ * @param {!string} s
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.eq_s_b$IS = function (s_size, s) {
+ /** @type {!number} */
+ var cursor$0;
+ if (this.cursor - this.limit_backward < s_size) {
+ return false;
+ }
+ if (this.current.slice((cursor$0 = this.cursor) - s_size, cursor$0) !== s) {
+ return false;
+ }
+ this.cursor -= s_size;
+ return true;
+};
+
+/**
+ * @param {!string} s
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.eq_v$S = function (s) {
+ return this.eq_s$IS(s.length, s);
+};
+
+/**
+ * @param {!string} s
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.eq_v_b$S = function (s) {
+ return this.eq_s_b$IS(s.length, s);
+};
+
+/**
+ * @param {Array.<undefined|Among>} v
+ * @param {!number} v_size
+ * @return {!number}
+ */
+BaseStemmer.prototype.find_among$ALAmong$I = function (v, v_size) {
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var j;
+ /** @type {!number} */
+ var c;
+ /** @type {!number} */
+ var l;
+ /** @type {!number} */
+ var common_i;
+ /** @type {!number} */
+ var common_j;
+ /** @type {!boolean} */
+ var first_key_inspected;
+ /** @type {!number} */
+ var k;
+ /** @type {!number} */
+ var diff;
+ /** @type {!number} */
+ var common;
+ /** @type {Among} */
+ var w;
+ /** @type {!number} */
+ var i2;
+ /** @type {!boolean} */
+ var res;
+ i = 0;
+ j = v_size;
+ c = this.cursor;
+ l = this.limit;
+ common_i = 0;
+ common_j = 0;
+ first_key_inspected = false;
+ while (true) {
+ k = i + (j - i >>> 1);
+ diff = 0;
+ common = (common_i < common_j ? common_i : common_j);
+ w = v[k];
+ for (i2 = common; i2 < w.s_size; i2++) {
+ if (c + common === l) {
+ diff = -1;
+ break;
+ }
+ diff = this.current.charCodeAt(c + common) - w.s.charCodeAt(i2);
+ if (diff !== 0) {
+ break;
+ }
+ common++;
+ }
+ if (diff < 0) {
+ j = k;
+ common_j = common;
+ } else {
+ i = k;
+ common_i = common;
+ }
+ if (j - i <= 1) {
+ if (i > 0) {
+ break;
+ }
+ if (j === i) {
+ break;
+ }
+ if (first_key_inspected) {
+ break;
+ }
+ first_key_inspected = true;
+ }
+ }
+ while (true) {
+ w = v[i];
+ if (common_i >= w.s_size) {
+ this.cursor = (c + w.s_size | 0);
+ if (w.method == null) {
+ return w.result;
+ }
+ res = w.method(w.instance);
+ this.cursor = (c + w.s_size | 0);
+ if (res) {
+ return w.result;
+ }
+ }
+ i = w.substring_i;
+ if (i < 0) {
+ return 0;
+ }
+ }
+ return -1;
+};
+
+/**
+ * @param {Array.<undefined|Among>} v
+ * @param {!number} v_size
+ * @return {!number}
+ */
+BaseStemmer.prototype.find_among_b$ALAmong$I = function (v, v_size) {
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var j;
+ /** @type {!number} */
+ var c;
+ /** @type {!number} */
+ var lb;
+ /** @type {!number} */
+ var common_i;
+ /** @type {!number} */
+ var common_j;
+ /** @type {!boolean} */
+ var first_key_inspected;
+ /** @type {!number} */
+ var k;
+ /** @type {!number} */
+ var diff;
+ /** @type {!number} */
+ var common;
+ /** @type {Among} */
+ var w;
+ /** @type {!number} */
+ var i2;
+ /** @type {!boolean} */
+ var res;
+ i = 0;
+ j = v_size;
+ c = this.cursor;
+ lb = this.limit_backward;
+ common_i = 0;
+ common_j = 0;
+ first_key_inspected = false;
+ while (true) {
+ k = i + (j - i >> 1);
+ diff = 0;
+ common = (common_i < common_j ? common_i : common_j);
+ w = v[k];
+ for (i2 = w.s_size - 1 - common; i2 >= 0; i2--) {
+ if (c - common === lb) {
+ diff = -1;
+ break;
+ }
+ diff = this.current.charCodeAt(c - 1 - common) - w.s.charCodeAt(i2);
+ if (diff !== 0) {
+ break;
+ }
+ common++;
+ }
+ if (diff < 0) {
+ j = k;
+ common_j = common;
+ } else {
+ i = k;
+ common_i = common;
+ }
+ if (j - i <= 1) {
+ if (i > 0) {
+ break;
+ }
+ if (j === i) {
+ break;
+ }
+ if (first_key_inspected) {
+ break;
+ }
+ first_key_inspected = true;
+ }
+ }
+ while (true) {
+ w = v[i];
+ if (common_i >= w.s_size) {
+ this.cursor = (c - w.s_size | 0);
+ if (w.method == null) {
+ return w.result;
+ }
+ res = w.method(this);
+ this.cursor = (c - w.s_size | 0);
+ if (res) {
+ return w.result;
+ }
+ }
+ i = w.substring_i;
+ if (i < 0) {
+ return 0;
+ }
+ }
+ return -1;
+};
+
+/**
+ * @param {!number} c_bra
+ * @param {!number} c_ket
+ * @param {!string} s
+ * @return {!number}
+ */
+BaseStemmer.prototype.replace_s$IIS = function (c_bra, c_ket, s) {
+ /** @type {!number} */
+ var adjustment;
+ adjustment = s.length - (c_ket - c_bra);
+ this.current = this.current.slice(0, c_bra) + s + this.current.slice(c_ket);
+ this.limit += (adjustment | 0);
+ if (this.cursor >= c_ket) {
+ this.cursor += (adjustment | 0);
+ } else {
+ if (this.cursor > c_bra) {
+ this.cursor = c_bra;
+ }
+ }
+ return (adjustment | 0);
+};
+
+/**
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.slice_check$ = function () {
+ /** @type {!number} */
+ var bra$0;
+ /** @type {!number} */
+ var ket$0;
+ /** @type {!number} */
+ var limit$0;
+ return ((bra$0 = this.bra) < 0 || bra$0 > (ket$0 = this.ket) || ket$0 > (limit$0 = this.limit) || limit$0 > this.current.length ? false : true);
+};
+
+/**
+ * @param {!string} s
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.slice_from$S = function (s) {
+ /** @type {!boolean} */
+ var result;
+ /** @type {!number} */
+ var bra$0;
+ /** @type {!number} */
+ var ket$0;
+ /** @type {!number} */
+ var limit$0;
+ result = false;
+ if ((bra$0 = this.bra) < 0 || bra$0 > (ket$0 = this.ket) || ket$0 > (limit$0 = this.limit) || limit$0 > this.current.length ? false : true) {
+ this.replace_s$IIS(this.bra, this.ket, s);
+ result = true;
+ }
+ return result;
+};
+
+/**
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.slice_del$ = function () {
+ return this.slice_from$S("");
+};
+
+/**
+ * @param {!number} c_bra
+ * @param {!number} c_ket
+ * @param {!string} s
+ */
+BaseStemmer.prototype.insert$IIS = function (c_bra, c_ket, s) {
+ /** @type {!number} */
+ var adjustment;
+ adjustment = this.replace_s$IIS(c_bra, c_ket, s);
+ if (c_bra <= this.bra) {
+ this.bra += (adjustment | 0);
+ }
+ if (c_bra <= this.ket) {
+ this.ket += (adjustment | 0);
+ }
+};
+
+/**
+ * @param {!string} s
+ * @return {!string}
+ */
+BaseStemmer.prototype.slice_to$S = function (s) {
+ /** @type {!string} */
+ var result;
+ /** @type {!number} */
+ var bra$0;
+ /** @type {!number} */
+ var ket$0;
+ /** @type {!number} */
+ var limit$0;
+ result = '';
+ if ((bra$0 = this.bra) < 0 || bra$0 > (ket$0 = this.ket) || ket$0 > (limit$0 = this.limit) || limit$0 > this.current.length ? false : true) {
+ result = this.current.slice(this.bra, this.ket);
+ }
+ return result;
+};
+
+/**
+ * @param {!string} s
+ * @return {!string}
+ */
+BaseStemmer.prototype.assign_to$S = function (s) {
+ return this.current.slice(0, this.limit);
+};
+
+/**
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.stem$ = function () {
+ return false;
+};
+
+/**
+ * @param {!string} word
+ * @return {!string}
+ */
+BaseStemmer.prototype.stemWord$S = function (word) {
+ /** @type {undefined|!string} */
+ var result;
+ /** @type {!string} */
+ var current$0;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var limit$0;
+ result = this.cache['.' + word];
+ if (result == null) {
+ current$0 = this.current = word;
+ cursor$0 = this.cursor = 0;
+ limit$0 = this.limit = current$0.length;
+ this.limit_backward = 0;
+ this.bra = cursor$0;
+ this.ket = limit$0;
+ this.stem$();
+ result = this.current;
+ this.cache['.' + word] = result;
+ }
+ return result;
+};
+
+/**
+ * @param {Array.<undefined|!string>} words
+ * @return {Array.<undefined|!string>}
+ */
+BaseStemmer.prototype.stemWords$AS = function (words) {
+ /** @type {Array.<undefined|!string>} */
+ var results;
+ /** @type {!number} */
+ var i;
+ /** @type {undefined|!string} */
+ var word;
+ /** @type {undefined|!string} */
+ var result;
+ /** @type {!string} */
+ var current$0;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var limit$0;
+ results = [ ];
+ for (i = 0; i < words.length; i++) {
+ word = words[i];
+ result = this.cache['.' + word];
+ if (result == null) {
+ current$0 = this.current = word;
+ cursor$0 = this.cursor = 0;
+ limit$0 = this.limit = current$0.length;
+ this.limit_backward = 0;
+ this.bra = cursor$0;
+ this.ket = limit$0;
+ this.stem$();
+ result = this.current;
+ this.cache['.' + word] = result;
+ }
+ results.push(result);
+ }
+ return results;
+};
+
+/**
+ * class PorterStemmer extends BaseStemmer
+ * @constructor
+ */
+function PorterStemmer() {
+}
+
+PorterStemmer.prototype = new BaseStemmer;
+/**
+ * @constructor
+ */
+function PorterStemmer$() {
+ BaseStemmer$.call(this);
+ this.B_Y_found = false;
+ this.I_p2 = 0;
+ this.I_p1 = 0;
+};
+
+PorterStemmer$.prototype = new PorterStemmer;
+
+/**
+ * @param {PorterStemmer} other
+ */
+PorterStemmer.prototype.copy_from$LPorterStemmer$ = function (other) {
+ this.B_Y_found = other.B_Y_found;
+ this.I_p2 = other.I_p2;
+ this.I_p1 = other.I_p1;
+ BaseStemmer.prototype.copy_from$LBaseStemmer$.call(this, other);
+};
+
+/**
+ * @return {!boolean}
+ */
+PorterStemmer.prototype.r_shortv$ = function () {
+ return (! this.out_grouping_b$AIII(PorterStemmer.g_v_WXY, 89, 121) ? false : ! this.in_grouping_b$AIII(PorterStemmer.g_v, 97, 121) ? false : ! this.out_grouping_b$AIII(PorterStemmer.g_v, 97, 121) ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+PorterStemmer.prototype.r_R1$ = function () {
+ return (! (this.I_p1 <= this.cursor) ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+PorterStemmer.prototype.r_R2$ = function () {
+ return (! (this.I_p2 <= this.cursor) ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+PorterStemmer.prototype.r_Step_1a$ = function () {
+ /** @type {!number} */
+ var among_var;
+ this.ket = this.cursor;
+ among_var = this.find_among_b$ALAmong$I(PorterStemmer.a_0, 4);
+ if (among_var === 0) {
+ return false;
+ }
+ this.bra = this.cursor;
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ if (! this.slice_from$S("ss")) {
+ return false;
+ }
+ break;
+ case 2:
+ if (! this.slice_from$S("i")) {
+ return false;
+ }
+ break;
+ case 3:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+PorterStemmer.prototype.r_Step_1b$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_3;
+ /** @type {!number} */
+ var v_4;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!number} */
+ var c;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var cursor$1;
+ /** @type {!number} */
+ var cursor$2;
+ this.ket = this.cursor;
+ among_var = this.find_among_b$ALAmong$I(PorterStemmer.a_2, 3);
+ if (among_var === 0) {
+ return false;
+ }
+ this.bra = this.cursor;
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ if (! (! (this.I_p1 <= this.cursor) ? false : true)) {
+ return false;
+ }
+ if (! this.slice_from$S("ee")) {
+ return false;
+ }
+ break;
+ case 2:
+ v_1 = this.limit - this.cursor;
+ golab0:
+ while (true) {
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ if (! this.in_grouping_b$AIII(PorterStemmer.g_v, 97, 121)) {
+ break lab1;
+ }
+ break golab0;
+ }
+ if (this.cursor <= this.limit_backward) {
+ return false;
+ }
+ this.cursor--;
+ }
+ this.cursor = this.limit - v_1;
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ v_3 = this.limit - this.cursor;
+ among_var = this.find_among_b$ALAmong$I(PorterStemmer.a_1, 13);
+ if (among_var === 0) {
+ return false;
+ }
+ this.cursor = this.limit - v_3;
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ c = cursor$0 = this.cursor;
+ this.insert$IIS(cursor$0, cursor$0, "e");
+ this.cursor = c;
+ break;
+ case 2:
+ this.ket = cursor$1 = this.cursor;
+ if (cursor$1 <= this.limit_backward) {
+ return false;
+ }
+ this.cursor--;
+ this.bra = this.cursor;
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 3:
+ if (this.cursor !== this.I_p1) {
+ return false;
+ }
+ v_4 = this.limit - this.cursor;
+ if (! this.r_shortv$()) {
+ return false;
+ }
+ cursor$2 = this.cursor = this.limit - v_4;
+ c = cursor$2;
+ this.insert$IIS(cursor$2, cursor$2, "e");
+ this.cursor = cursor$2;
+ break;
+ }
+ break;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+PorterStemmer.prototype.r_Step_1c$ = function () {
+ /** @type {!number} */
+ var v_1;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!boolean} */
+ var lab3;
+ this.ket = this.cursor;
+ lab0 = true;
+lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ v_1 = this.limit - this.cursor;
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ if (! this.eq_s_b$IS(1, "y")) {
+ break lab1;
+ }
+ break lab0;
+ }
+ this.cursor = this.limit - v_1;
+ if (! this.eq_s_b$IS(1, "Y")) {
+ return false;
+ }
+ }
+ this.bra = this.cursor;
+golab2:
+ while (true) {
+ lab3 = true;
+ lab3:
+ while (lab3 === true) {
+ lab3 = false;
+ if (! this.in_grouping_b$AIII(PorterStemmer.g_v, 97, 121)) {
+ break lab3;
+ }
+ break golab2;
+ }
+ if (this.cursor <= this.limit_backward) {
+ return false;
+ }
+ this.cursor--;
+ }
+ return (! this.slice_from$S("i") ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+PorterStemmer.prototype.r_Step_2$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var cursor$0;
+ this.ket = this.cursor;
+ among_var = this.find_among_b$ALAmong$I(PorterStemmer.a_3, 20);
+ if (among_var === 0) {
+ return false;
+ }
+ this.bra = cursor$0 = this.cursor;
+ if (! (! (this.I_p1 <= cursor$0) ? false : true)) {
+ return false;
+ }
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ if (! this.slice_from$S("tion")) {
+ return false;
+ }
+ break;
+ case 2:
+ if (! this.slice_from$S("ence")) {
+ return false;
+ }
+ break;
+ case 3:
+ if (! this.slice_from$S("ance")) {
+ return false;
+ }
+ break;
+ case 4:
+ if (! this.slice_from$S("able")) {
+ return false;
+ }
+ break;
+ case 5:
+ if (! this.slice_from$S("ent")) {
+ return false;
+ }
+ break;
+ case 6:
+ if (! this.slice_from$S("e")) {
+ return false;
+ }
+ break;
+ case 7:
+ if (! this.slice_from$S("ize")) {
+ return false;
+ }
+ break;
+ case 8:
+ if (! this.slice_from$S("ate")) {
+ return false;
+ }
+ break;
+ case 9:
+ if (! this.slice_from$S("al")) {
+ return false;
+ }
+ break;
+ case 10:
+ if (! this.slice_from$S("al")) {
+ return false;
+ }
+ break;
+ case 11:
+ if (! this.slice_from$S("ful")) {
+ return false;
+ }
+ break;
+ case 12:
+ if (! this.slice_from$S("ous")) {
+ return false;
+ }
+ break;
+ case 13:
+ if (! this.slice_from$S("ive")) {
+ return false;
+ }
+ break;
+ case 14:
+ if (! this.slice_from$S("ble")) {
+ return false;
+ }
+ break;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+PorterStemmer.prototype.r_Step_3$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var cursor$0;
+ this.ket = this.cursor;
+ among_var = this.find_among_b$ALAmong$I(PorterStemmer.a_4, 7);
+ if (among_var === 0) {
+ return false;
+ }
+ this.bra = cursor$0 = this.cursor;
+ if (! (! (this.I_p1 <= cursor$0) ? false : true)) {
+ return false;
+ }
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ if (! this.slice_from$S("al")) {
+ return false;
+ }
+ break;
+ case 2:
+ if (! this.slice_from$S("ic")) {
+ return false;
+ }
+ break;
+ case 3:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+PorterStemmer.prototype.r_Step_4$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var v_1;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!number} */
+ var cursor$0;
+ this.ket = this.cursor;
+ among_var = this.find_among_b$ALAmong$I(PorterStemmer.a_5, 19);
+ if (among_var === 0) {
+ return false;
+ }
+ this.bra = cursor$0 = this.cursor;
+ if (! (! (this.I_p2 <= cursor$0) ? false : true)) {
+ return false;
+ }
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 2:
+ lab0 = true;
+ lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ v_1 = this.limit - this.cursor;
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ if (! this.eq_s_b$IS(1, "s")) {
+ break lab1;
+ }
+ break lab0;
+ }
+ this.cursor = this.limit - v_1;
+ if (! this.eq_s_b$IS(1, "t")) {
+ return false;
+ }
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+PorterStemmer.prototype.r_Step_5a$ = function () {
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!boolean} */
+ var lab2;
+ /** @type {!number} */
+ var cursor$0;
+ this.ket = this.cursor;
+ if (! this.eq_s_b$IS(1, "e")) {
+ return false;
+ }
+ this.bra = this.cursor;
+ lab0 = true;
+lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ v_1 = this.limit - this.cursor;
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ if (! (! (this.I_p2 <= this.cursor) ? false : true)) {
+ break lab1;
+ }
+ break lab0;
+ }
+ cursor$0 = this.cursor = this.limit - v_1;
+ if (! (! (this.I_p1 <= cursor$0) ? false : true)) {
+ return false;
+ }
+ v_2 = this.limit - this.cursor;
+ lab2 = true;
+ lab2:
+ while (lab2 === true) {
+ lab2 = false;
+ if (! this.r_shortv$()) {
+ break lab2;
+ }
+ return false;
+ }
+ this.cursor = this.limit - v_2;
+ }
+ return (! this.slice_from$S("") ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+PorterStemmer.prototype.r_Step_5b$ = function () {
+ /** @type {!number} */
+ var cursor$0;
+ this.ket = this.cursor;
+ if (! this.eq_s_b$IS(1, "l")) {
+ return false;
+ }
+ this.bra = cursor$0 = this.cursor;
+ return (! (! (this.I_p2 <= cursor$0) ? false : true) ? false : ! this.eq_s_b$IS(1, "l") ? false : ! this.slice_from$S("") ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+PorterStemmer.prototype.stem$ = function () {
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var v_3;
+ /** @type {!number} */
+ var v_4;
+ /** @type {!number} */
+ var v_5;
+ /** @type {!number} */
+ var v_10;
+ /** @type {!number} */
+ var v_11;
+ /** @type {!number} */
+ var v_12;
+ /** @type {!number} */
+ var v_13;
+ /** @type {!number} */
+ var v_14;
+ /** @type {!number} */
+ var v_15;
+ /** @type {!number} */
+ var v_16;
+ /** @type {!number} */
+ var v_18;
+ /** @type {!number} */
+ var v_19;
+ /** @type {!number} */
+ var v_20;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!boolean} */
+ var lab3;
+ /** @type {!boolean} */
+ var lab5;
+ /** @type {!boolean} */
+ var lab6;
+ /** @type {!boolean} */
+ var lab8;
+ /** @type {!boolean} */
+ var lab10;
+ /** @type {!boolean} */
+ var lab12;
+ /** @type {!boolean} */
+ var lab14;
+ /** @type {!boolean} */
+ var lab15;
+ /** @type {!boolean} */
+ var lab16;
+ /** @type {!boolean} */
+ var lab17;
+ /** @type {!boolean} */
+ var lab18;
+ /** @type {!boolean} */
+ var lab19;
+ /** @type {!boolean} */
+ var lab20;
+ /** @type {!boolean} */
+ var lab21;
+ /** @type {!boolean} */
+ var lab22;
+ /** @type {!boolean} */
+ var lab23;
+ /** @type {!boolean} */
+ var lab25;
+ /** @type {!boolean} */
+ var lab27;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var cursor$1;
+ /** @type {!number} */
+ var limit$0;
+ /** @type {!number} */
+ var cursor$2;
+ /** @type {!number} */
+ var cursor$3;
+ /** @type {!number} */
+ var limit$1;
+ /** @type {!number} */
+ var cursor$4;
+ /** @type {!number} */
+ var limit$2;
+ /** @type {!number} */
+ var cursor$5;
+ /** @type {!number} */
+ var limit$3;
+ /** @type {!number} */
+ var cursor$6;
+ /** @type {!number} */
+ var limit$4;
+ /** @type {!number} */
+ var cursor$7;
+ /** @type {!number} */
+ var limit$5;
+ /** @type {!number} */
+ var cursor$8;
+ /** @type {!number} */
+ var limit$6;
+ /** @type {!number} */
+ var cursor$9;
+ /** @type {!number} */
+ var limit$7;
+ /** @type {!number} */
+ var cursor$10;
+ /** @type {!number} */
+ var cursor$11;
+ /** @type {!number} */
+ var cursor$12;
+ this.B_Y_found = false;
+ v_1 = this.cursor;
+ lab0 = true;
+lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ this.bra = this.cursor;
+ if (! this.eq_s$IS(1, "y")) {
+ break lab0;
+ }
+ this.ket = this.cursor;
+ if (! this.slice_from$S("Y")) {
+ return false;
+ }
+ this.B_Y_found = true;
+ }
+ cursor$1 = this.cursor = v_1;
+ v_2 = cursor$1;
+ lab1 = true;
+lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ replab2:
+ while (true) {
+ v_3 = this.cursor;
+ lab3 = true;
+ lab3:
+ while (lab3 === true) {
+ lab3 = false;
+ golab4:
+ while (true) {
+ v_4 = this.cursor;
+ lab5 = true;
+ lab5:
+ while (lab5 === true) {
+ lab5 = false;
+ if (! this.in_grouping$AIII(PorterStemmer.g_v, 97, 121)) {
+ break lab5;
+ }
+ this.bra = this.cursor;
+ if (! this.eq_s$IS(1, "y")) {
+ break lab5;
+ }
+ this.ket = this.cursor;
+ this.cursor = v_4;
+ break golab4;
+ }
+ cursor$0 = this.cursor = v_4;
+ if (cursor$0 >= this.limit) {
+ break lab3;
+ }
+ this.cursor++;
+ }
+ if (! this.slice_from$S("Y")) {
+ return false;
+ }
+ this.B_Y_found = true;
+ continue replab2;
+ }
+ this.cursor = v_3;
+ break replab2;
+ }
+ }
+ cursor$2 = this.cursor = v_2;
+ this.I_p1 = limit$0 = this.limit;
+ this.I_p2 = limit$0;
+ v_5 = cursor$2;
+ lab6 = true;
+lab6:
+ while (lab6 === true) {
+ lab6 = false;
+ golab7:
+ while (true) {
+ lab8 = true;
+ lab8:
+ while (lab8 === true) {
+ lab8 = false;
+ if (! this.in_grouping$AIII(PorterStemmer.g_v, 97, 121)) {
+ break lab8;
+ }
+ break golab7;
+ }
+ if (this.cursor >= this.limit) {
+ break lab6;
+ }
+ this.cursor++;
+ }
+ golab9:
+ while (true) {
+ lab10 = true;
+ lab10:
+ while (lab10 === true) {
+ lab10 = false;
+ if (! this.out_grouping$AIII(PorterStemmer.g_v, 97, 121)) {
+ break lab10;
+ }
+ break golab9;
+ }
+ if (this.cursor >= this.limit) {
+ break lab6;
+ }
+ this.cursor++;
+ }
+ this.I_p1 = this.cursor;
+ golab11:
+ while (true) {
+ lab12 = true;
+ lab12:
+ while (lab12 === true) {
+ lab12 = false;
+ if (! this.in_grouping$AIII(PorterStemmer.g_v, 97, 121)) {
+ break lab12;
+ }
+ break golab11;
+ }
+ if (this.cursor >= this.limit) {
+ break lab6;
+ }
+ this.cursor++;
+ }
+ golab13:
+ while (true) {
+ lab14 = true;
+ lab14:
+ while (lab14 === true) {
+ lab14 = false;
+ if (! this.out_grouping$AIII(PorterStemmer.g_v, 97, 121)) {
+ break lab14;
+ }
+ break golab13;
+ }
+ if (this.cursor >= this.limit) {
+ break lab6;
+ }
+ this.cursor++;
+ }
+ this.I_p2 = this.cursor;
+ }
+ cursor$3 = this.cursor = v_5;
+ this.limit_backward = cursor$3;
+ cursor$4 = this.cursor = limit$1 = this.limit;
+ v_10 = limit$1 - cursor$4;
+ lab15 = true;
+lab15:
+ while (lab15 === true) {
+ lab15 = false;
+ if (! this.r_Step_1a$()) {
+ break lab15;
+ }
+ }
+ cursor$5 = this.cursor = (limit$2 = this.limit) - v_10;
+ v_11 = limit$2 - cursor$5;
+ lab16 = true;
+lab16:
+ while (lab16 === true) {
+ lab16 = false;
+ if (! this.r_Step_1b$()) {
+ break lab16;
+ }
+ }
+ cursor$6 = this.cursor = (limit$3 = this.limit) - v_11;
+ v_12 = limit$3 - cursor$6;
+ lab17 = true;
+lab17:
+ while (lab17 === true) {
+ lab17 = false;
+ if (! this.r_Step_1c$()) {
+ break lab17;
+ }
+ }
+ cursor$7 = this.cursor = (limit$4 = this.limit) - v_12;
+ v_13 = limit$4 - cursor$7;
+ lab18 = true;
+lab18:
+ while (lab18 === true) {
+ lab18 = false;
+ if (! this.r_Step_2$()) {
+ break lab18;
+ }
+ }
+ cursor$8 = this.cursor = (limit$5 = this.limit) - v_13;
+ v_14 = limit$5 - cursor$8;
+ lab19 = true;
+lab19:
+ while (lab19 === true) {
+ lab19 = false;
+ if (! this.r_Step_3$()) {
+ break lab19;
+ }
+ }
+ cursor$9 = this.cursor = (limit$6 = this.limit) - v_14;
+ v_15 = limit$6 - cursor$9;
+ lab20 = true;
+lab20:
+ while (lab20 === true) {
+ lab20 = false;
+ if (! this.r_Step_4$()) {
+ break lab20;
+ }
+ }
+ cursor$10 = this.cursor = (limit$7 = this.limit) - v_15;
+ v_16 = limit$7 - cursor$10;
+ lab21 = true;
+lab21:
+ while (lab21 === true) {
+ lab21 = false;
+ if (! this.r_Step_5a$()) {
+ break lab21;
+ }
+ }
+ this.cursor = this.limit - v_16;
+ lab22 = true;
+lab22:
+ while (lab22 === true) {
+ lab22 = false;
+ if (! this.r_Step_5b$()) {
+ break lab22;
+ }
+ }
+ cursor$12 = this.cursor = this.limit_backward;
+ v_18 = cursor$12;
+ lab23 = true;
+lab23:
+ while (lab23 === true) {
+ lab23 = false;
+ if (! this.B_Y_found) {
+ break lab23;
+ }
+ replab24:
+ while (true) {
+ v_19 = this.cursor;
+ lab25 = true;
+ lab25:
+ while (lab25 === true) {
+ lab25 = false;
+ golab26:
+ while (true) {
+ v_20 = this.cursor;
+ lab27 = true;
+ lab27:
+ while (lab27 === true) {
+ lab27 = false;
+ this.bra = this.cursor;
+ if (! this.eq_s$IS(1, "Y")) {
+ break lab27;
+ }
+ this.ket = this.cursor;
+ this.cursor = v_20;
+ break golab26;
+ }
+ cursor$11 = this.cursor = v_20;
+ if (cursor$11 >= this.limit) {
+ break lab25;
+ }
+ this.cursor++;
+ }
+ if (! this.slice_from$S("y")) {
+ return false;
+ }
+ continue replab24;
+ }
+ this.cursor = v_19;
+ break replab24;
+ }
+ }
+ this.cursor = v_18;
+ return true;
+};
+
+/**
+ * @param {*} o
+ * @return {!boolean}
+ */
+PorterStemmer.prototype.equals$X = function (o) {
+ return o instanceof PorterStemmer;
+};
+
+/**
+ * @return {!number}
+ */
+PorterStemmer.prototype.hashCode$ = function () {
+ /** @type {!string} */
+ var classname;
+ /** @type {!number} */
+ var hash;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var char;
+ classname = "PorterStemmer";
+ hash = 0;
+ if ("PorterStemmer".length === 0) {
+ return (hash | 0);
+ }
+ for (i = 0; i < classname.length; i++) {
+ char = classname.charCodeAt(i);
+ hash = (hash << 5) - hash + char;
+ hash = hash & hash;
+ }
+ return (hash | 0);
+};
+
+/**
+ * class Among extends Object
+ * @constructor
+ */
+function Among() {
+}
+
+/**
+ * @constructor
+ * @param {!string} s
+ * @param {!number} substring_i
+ * @param {!number} result
+ */
+function Among$SII(s, substring_i, result) {
+ this.s_size = s.length;
+ this.s = s;
+ this.substring_i = substring_i;
+ this.result = result;
+ this.method = null;
+ this.instance = null;
+};
+
+Among$SII.prototype = new Among;
+
+/**
+ * @constructor
+ * @param {!string} s
+ * @param {!number} substring_i
+ * @param {!number} result
+ * @param {*} method
+ * @param {BaseStemmer} instance
+ */
+function Among$SIIF$LBaseStemmer$B$LBaseStemmer$(s, substring_i, result, method, instance) {
+ this.s_size = s.length;
+ this.s = s;
+ this.substring_i = substring_i;
+ this.result = result;
+ this.method = method;
+ this.instance = instance;
+};
+
+Among$SIIF$LBaseStemmer$B$LBaseStemmer$.prototype = new Among;
+
+/**
+ * class Metadata extends Object
+ * @constructor
+ */
+function Metadata() {
+}
+
+/**
+ * @constructor
+ * @param {Oktavia} parent
+ */
+function Metadata$LOktavia$(parent) {
+ this._parent = parent;
+ this._bitVector = new BitVector$();
+};
+
+Metadata$LOktavia$.prototype = new Metadata;
+
+/**
+ * @return {!number}
+ */
+Metadata.prototype._size$ = function () {
+ /** @type {BitVector} */
+ var this$0;
+ /** @type {!number} */
+ var i$0;
+ /** @type {BitVector} */
+ var _bitVector$0;
+ this$0 = _bitVector$0 = this._bitVector;
+ i$0 = _bitVector$0._size;
+ return this$0.rank$IB(i$0, true);
+};
+
+/**
+ * @param {!number} index
+ * @return {!string}
+ */
+Metadata.prototype.getContent$I = function (index) {
+ /** @type {!number} */
+ var startPosition;
+ /** @type {!number} */
+ var length;
+ if (index < 0 || this._size$() <= index) {
+ throw new Error("Section.getContent() : range error " + (index + ""));
+ }
+ startPosition = 0;
+ if (index > 0) {
+ startPosition = this._bitVector.select$I(index - 1) + 1;
+ }
+ length = this._bitVector.select$I(index) - startPosition + 1;
+ return this._parent._getSubstring$II(startPosition, length);
+};
+
+/**
+ * @param {!number} index
+ * @return {!number}
+ */
+Metadata.prototype.getStartPosition$I = function (index) {
+ /** @type {!number} */
+ var startPosition;
+ if (index < 0 || this._size$() <= index) {
+ throw new Error("Section.getContent() : range error " + (index + ""));
+ }
+ startPosition = 0;
+ if (index > 0) {
+ startPosition = this._bitVector.select$I(index - 1) + 1;
+ }
+ return (startPosition | 0);
+};
+
+/**
+ * @param {SingleResult} result
+ * @param {Array.<undefined|!number>} positions
+ * @param {!string} word
+ * @param {!boolean} stemmed
+ */
+Metadata.prototype.grouping$LSingleResult$AISB = function (result, positions, word, stemmed) {
+};
+
+/**
+ * @param {!number} index
+ * @return {!string}
+ */
+Metadata.prototype.getInformation$I = function (index) {
+ return '';
+};
+
+/**
+ */
+Metadata.prototype._build$ = function () {
+ this._bitVector.build$();
+};
+
+/**
+ * @param {!string} name
+ * @param {!string} data
+ * @param {!number} offset
+ * @return {!number}
+ */
+Metadata.prototype._load$SSI = function (name, data, offset) {
+ offset = this._bitVector.load$SI(data, offset);
+ this._parent._metadataLabels.push(name);
+ this._parent._metadatas[name] = this;
+ return offset;
+};
+
+/**
+ * @return {!string}
+ */
+Metadata.prototype._dump$ = function () {
+ /** @type {BitVector} */
+ var this$0;
+ /** @type {Array.<undefined|!string>} */
+ var contents$0;
+ this$0 = this._bitVector;
+ contents$0 = [ ];
+ contents$0.push(Binary$dump32bitNumber$N(this$0._size));
+ contents$0.push(Binary$dump32bitNumberList$AN(this$0._v));
+ return contents$0.join('');
+};
+
+/**
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+Metadata.prototype._dump$LCompressionReport$ = function (report) {
+ /** @type {BitVector} */
+ var this$0;
+ /** @type {Array.<undefined|!string>} */
+ var contents$0;
+ this$0 = this._bitVector;
+ contents$0 = [ ];
+ contents$0.push(Binary$dump32bitNumber$N(this$0._size));
+ CompressionReport$add$LCompressionReport$II(report, 2, 2);
+ contents$0.push(Binary$dump32bitNumberList$ANLCompressionReport$(this$0._v, report));
+ return contents$0.join('');
+};
+
+/**
+ * class Section extends Metadata
+ * @constructor
+ */
+function Section() {
+}
+
+Section.prototype = new Metadata;
+/**
+ * @constructor
+ * @param {Oktavia} parent
+ */
+function Section$LOktavia$(parent) {
+ this._parent = parent;
+ this._bitVector = new BitVector$();
+ this._names = [ ];
+};
+
+Section$LOktavia$.prototype = new Section;
+
+/**
+ * @param {!string} name
+ */
+Section.prototype.setTail$S = function (name) {
+ /** @type {!number} */
+ var index$0;
+ /** @type {Oktavia} */
+ var this$0;
+ /** @type {FMIndex} */
+ var this$0$0;
+ this$0 = this._parent;
+ this$0$0 = this$0._fmindex;
+ index$0 = this$0$0._substr.length;
+ this._names.push(name);
+ this._bitVector.set$I(index$0 - 1);
+};
+
+/**
+ * @param {!string} name
+ * @param {!number} index
+ */
+Section.prototype.setTail$SI = function (name, index) {
+ this._names.push(name);
+ this._bitVector.set$I(index - 1);
+};
+
+/**
+ * @return {!number}
+ */
+Section.prototype.size$ = function () {
+ return (this._names.length | 0);
+};
+
+/**
+ * @param {!number} position
+ * @return {!number}
+ */
+Section.prototype.getSectionIndex$I = function (position) {
+ /** @type {BitVector} */
+ var this$0;
+ if (position < 0 || this._bitVector.size$() <= position) {
+ throw new Error("Section.getSectionIndex() : range error " + (position + ""));
+ }
+ this$0 = this._bitVector;
+ return this$0.rank$IB(position, true);
+};
+
+/**
+ * @param {!number} index
+ * @return {!string}
+ */
+Section.prototype.getName$I = function (index) {
+ if (index < 0 || this._names.length <= index) {
+ throw new Error("Section.getName() : range error");
+ }
+ return this._names[index];
+};
+
+/**
+ * @param {SingleResult} result
+ * @param {Array.<undefined|!number>} positions
+ * @param {!string} word
+ * @param {!boolean} stemmed
+ */
+Section.prototype.grouping$LSingleResult$AISB = function (result, positions, word, stemmed) {
+ /** @type {!number} */
+ var i;
+ /** @type {undefined|!number} */
+ var position;
+ /** @type {!number} */
+ var index;
+ /** @type {SearchUnit} */
+ var unit;
+ for (i = 0; i < positions.length; i++) {
+ position = positions[i];
+ index = this.getSectionIndex$I(position);
+ unit = SingleResult$getSearchUnit$LSingleResult$I(result, index);
+ if (unit.startPosition < 0) {
+ unit.startPosition = this.getStartPosition$I(index);
+ }
+ SearchUnit$addPosition$LSearchUnit$SIB(unit, word, position - unit.startPosition, stemmed);
+ }
+};
+
+/**
+ * @param {!number} index
+ * @return {!string}
+ */
+Section.prototype.getInformation$I = function (index) {
+ return this.getName$I(index);
+};
+
+/**
+ * @param {Oktavia} parent
+ * @param {!string} name
+ * @param {!string} data
+ * @param {!number} offset
+ * @return {!number}
+ */
+Section._load$LOktavia$SSI = function (parent, name, data, offset) {
+ /** @type {LoadedStringListResult} */
+ var strs;
+ /** @type {Section} */
+ var section;
+ /** @type {!number} */
+ var offset$0;
+ strs = new LoadedStringListResult$SI(data, offset);
+ section = new Section$LOktavia$(parent);
+ section._names = strs.result;
+ offset$0 = strs.offset;
+ offset$0 = section._bitVector.load$SI(data, offset$0);
+ section._parent._metadataLabels.push(name);
+ section._parent._metadatas[name] = section;
+ return offset$0;
+};
+
+var Section$_load$LOktavia$SSI = Section._load$LOktavia$SSI;
+
+/**
+ * @return {!string}
+ */
+Section.prototype._dump$ = function () {
+ return [ Binary$dump16bitNumber$I(0), Binary$dumpStringList$AS(this._names), Metadata.prototype._dump$.call(this) ].join('');
+};
+
+/**
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+Section.prototype._dump$LCompressionReport$ = function (report) {
+ CompressionReport$add$LCompressionReport$II(report, 1, 1);
+ return [ Binary$dump16bitNumber$I(0), Binary$dumpStringList$ASLCompressionReport$(this._names, report), Metadata.prototype._dump$LCompressionReport$.call(this, report) ].join('');
+};
+
+/**
+ * class Splitter extends Metadata
+ * @constructor
+ */
+function Splitter() {
+}
+
+Splitter.prototype = new Metadata;
+/**
+ * @constructor
+ * @param {Oktavia} parent
+ */
+function Splitter$LOktavia$(parent) {
+ this._parent = parent;
+ this._bitVector = new BitVector$();
+ this.name = null;
+};
+
+Splitter$LOktavia$.prototype = new Splitter;
+
+/**
+ * @constructor
+ * @param {Oktavia} parent
+ * @param {!string} name
+ */
+function Splitter$LOktavia$S(parent, name) {
+ this._parent = parent;
+ this._bitVector = new BitVector$();
+ this.name = name;
+};
+
+Splitter$LOktavia$S.prototype = new Splitter;
+
+/**
+ * @return {!number}
+ */
+Splitter.prototype.size$ = function () {
+ /** @type {BitVector} */
+ var this$0$0;
+ /** @type {!number} */
+ var i$0$0;
+ /** @type {BitVector} */
+ var _bitVector$0;
+ this$0$0 = _bitVector$0 = this._bitVector;
+ i$0$0 = _bitVector$0._size;
+ return this$0$0.rank$IB(i$0$0, true);
+};
+
+/**
+ */
+Splitter.prototype.split$ = function () {
+ /** @type {!number} */
+ var index$0;
+ /** @type {Oktavia} */
+ var this$0;
+ /** @type {FMIndex} */
+ var this$0$0;
+ this$0 = this._parent;
+ this$0$0 = this$0._fmindex;
+ index$0 = this$0$0._substr.length;
+ this._bitVector.set$I(index$0 - 1);
+};
+
+/**
+ * @param {!number} index
+ */
+Splitter.prototype.split$I = function (index) {
+ this._bitVector.set$I(index - 1);
+};
+
+/**
+ * @param {!number} position
+ * @return {!number}
+ */
+Splitter.prototype.getIndex$I = function (position) {
+ /** @type {BitVector} */
+ var this$0;
+ if (position < 0 || this._bitVector.size$() <= position) {
+ throw new Error("Section.getSectionIndex() : range error");
+ }
+ this$0 = this._bitVector;
+ return this$0.rank$IB(position, true);
+};
+
+/**
+ * @param {SingleResult} result
+ * @param {Array.<undefined|!number>} positions
+ * @param {!string} word
+ * @param {!boolean} stemmed
+ */
+Splitter.prototype.grouping$LSingleResult$AISB = function (result, positions, word, stemmed) {
+ /** @type {!number} */
+ var i;
+ /** @type {undefined|!number} */
+ var position;
+ /** @type {!number} */
+ var index;
+ /** @type {SearchUnit} */
+ var unit;
+ for (i = 0; i < positions.length; i++) {
+ position = positions[i];
+ index = this.getIndex$I(position);
+ unit = SingleResult$getSearchUnit$LSingleResult$I(result, index);
+ if (unit.startPosition < 0) {
+ unit.startPosition = this.getStartPosition$I(index);
+ }
+ SearchUnit$addPosition$LSearchUnit$SIB(unit, word, position - unit.startPosition, stemmed);
+ }
+};
+
+/**
+ * @param {!number} index
+ * @return {!string}
+ */
+Splitter.prototype.getInformation$I = function (index) {
+ return (this.name != null ? this.name + (index + 1 + "") : '');
+};
+
+/**
+ * @param {Oktavia} parent
+ * @param {!string} name
+ * @param {!string} data
+ * @param {!number} offset
+ * @return {!number}
+ */
+Splitter._load$LOktavia$SSI = function (parent, name, data, offset) {
+ /** @type {Splitter} */
+ var section;
+ section = new Splitter$LOktavia$(parent);
+ offset = section._bitVector.load$SI(data, offset);
+ section._parent._metadataLabels.push(name);
+ section._parent._metadatas[name] = section;
+ return offset;
+};
+
+var Splitter$_load$LOktavia$SSI = Splitter._load$LOktavia$SSI;
+
+/**
+ * @return {!string}
+ */
+Splitter.prototype._dump$ = function () {
+ return [ Binary$dump16bitNumber$I(1), Metadata.prototype._dump$.call(this) ].join('');
+};
+
+/**
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+Splitter.prototype._dump$LCompressionReport$ = function (report) {
+ CompressionReport$add$LCompressionReport$II(report, 1, 1);
+ return [ Binary$dump16bitNumber$I(1), Metadata.prototype._dump$LCompressionReport$.call(this, report) ].join('');
+};
+
+/**
+ * class Table extends Metadata
+ * @constructor
+ */
+function Table() {
+}
+
+Table.prototype = new Metadata;
+/**
+ * @constructor
+ * @param {Oktavia} parent
+ * @param {Array.<undefined|!string>} headers
+ */
+function Table$LOktavia$AS(parent, headers) {
+ this._parent = parent;
+ this._bitVector = new BitVector$();
+ this._headers = headers;
+ this._columnTails = new BitVector$();
+};
+
+Table$LOktavia$AS.prototype = new Table;
+
+/**
+ * @return {!number}
+ */
+Table.prototype.rowSize$ = function () {
+ /** @type {BitVector} */
+ var this$0$0;
+ /** @type {!number} */
+ var i$0$0;
+ /** @type {BitVector} */
+ var _bitVector$0;
+ this$0$0 = _bitVector$0 = this._bitVector;
+ i$0$0 = _bitVector$0._size;
+ return this$0$0.rank$IB(i$0$0, true);
+};
+
+/**
+ * @return {!number}
+ */
+Table.prototype.columnSize$ = function () {
+ return (this._headers.length | 0);
+};
+
+/**
+ */
+Table.prototype.setColumnTail$ = function () {
+ /** @type {!number} */
+ var index;
+ /** @type {Oktavia} */
+ var this$0;
+ /** @type {FMIndex} */
+ var this$0$0;
+ /** @type {Oktavia} */
+ var _parent$0;
+ this$0 = _parent$0 = this._parent;
+ this$0$0 = this$0._fmindex;
+ index = this$0$0._substr.length;
+ _parent$0._fmindex.push$S(Oktavia.eob);
+ this._columnTails.set$I(index - 1);
+};
+
+/**
+ */
+Table.prototype.setRowTail$ = function () {
+ /** @type {!number} */
+ var index;
+ /** @type {Oktavia} */
+ var this$0;
+ /** @type {FMIndex} */
+ var this$0$0;
+ this$0 = this._parent;
+ this$0$0 = this$0._fmindex;
+ index = this$0$0._substr.length;
+ this._bitVector.set$I(index - 1);
+};
+
+/**
+ * @param {!number} position
+ * @return {Array.<undefined|!number>}
+ */
+Table.prototype.getCell$I = function (position) {
+ /** @type {!number} */
+ var row;
+ /** @type {!number} */
+ var currentColumn;
+ /** @type {!number} */
+ var lastRowColumn;
+ /** @type {!number} */
+ var startPosition;
+ /** @type {Array.<undefined|!number>} */
+ var result;
+ /** @type {BitVector} */
+ var this$0;
+ /** @type {BitVector} */
+ var this$1;
+ if (position < 0 || this._bitVector.size$() <= position) {
+ throw new Error("Section.getSectionIndex() : range error " + (position + ""));
+ }
+ this$0 = this._bitVector;
+ row = this$0.rank$IB(position, true);
+ this$1 = this._columnTails;
+ currentColumn = this$1.rank$IB(position, true);
+ lastRowColumn = 0;
+ if (row > 0) {
+ startPosition = this._bitVector.select$I(row - 1) + 1;
+ lastRowColumn = this._columnTails.rank$I(startPosition);
+ }
+ result = [ row, currentColumn - lastRowColumn ];
+ return result;
+};
+
+/**
+ * @param {!number} rowIndex
+ * @return {Object.<string, undefined|!string>}
+ */
+Table.prototype.getRowContent$I = function (rowIndex) {
+ /** @type {!string} */
+ var content;
+ /** @type {Array.<undefined|!string>} */
+ var values;
+ /** @type {Object.<string, undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var i;
+ content = this.getContent$I(rowIndex);
+ values = content.split(Oktavia.eob, this._headers.length);
+ result = ({ });
+ for (i in this._headers) {
+ if (i < values.length) {
+ result[this._headers[i]] = values[i];
+ } else {
+ result[this._headers[i]] = '';
+ }
+ }
+ return result;
+};
+
+/**
+ * @param {SingleResult} result
+ * @param {Array.<undefined|!number>} positions
+ * @param {!string} word
+ * @param {!boolean} stemmed
+ */
+Table.prototype.grouping$LSingleResult$AISB = function (result, positions, word, stemmed) {
+};
+
+/**
+ * @param {!number} index
+ * @return {!string}
+ */
+Table.prototype.getInformation$I = function (index) {
+ return '';
+};
+
+/**
+ */
+Table.prototype._build$ = function () {
+ this._bitVector.build$();
+ this._columnTails.build$();
+};
+
+/**
+ * @param {Oktavia} parent
+ * @param {!string} name
+ * @param {!string} data
+ * @param {!number} offset
+ * @return {!number}
+ */
+Table._load$LOktavia$SSI = function (parent, name, data, offset) {
+ /** @type {LoadedStringListResult} */
+ var strs;
+ /** @type {Table} */
+ var table;
+ /** @type {!number} */
+ var offset$0;
+ strs = new LoadedStringListResult$SI(data, offset);
+ table = new Table$LOktavia$AS(parent, strs.result);
+ offset$0 = strs.offset;
+ offset$0 = table._bitVector.load$SI(data, offset$0);
+ table._parent._metadataLabels.push(name);
+ table._parent._metadatas[name] = table;
+ offset = offset$0;
+ return table._columnTails.load$SI(data, offset$0);
+};
+
+var Table$_load$LOktavia$SSI = Table._load$LOktavia$SSI;
+
+/**
+ * @return {!string}
+ */
+Table.prototype._dump$ = function () {
+ return [ Binary$dump16bitNumber$I(2), Binary$dumpStringList$AS(this._headers), Metadata.prototype._dump$.call(this), this._columnTails.dump$() ].join('');
+};
+
+/**
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+Table.prototype._dump$LCompressionReport$ = function (report) {
+ CompressionReport$add$LCompressionReport$II(report, 1, 1);
+ return [ Binary$dump16bitNumber$I(2), Binary$dumpStringList$ASLCompressionReport$(this._headers, report), Metadata.prototype._dump$LCompressionReport$.call(this, report), this._columnTails.dump$LCompressionReport$(report) ].join('');
+};
+
+/**
+ * class Block extends Metadata
+ * @constructor
+ */
+function Block() {
+}
+
+Block.prototype = new Metadata;
+/**
+ * @constructor
+ * @param {Oktavia} parent
+ */
+function Block$LOktavia$(parent) {
+ this._parent = parent;
+ this._bitVector = new BitVector$();
+ this._names = [ ];
+ this._start = false;
+};
+
+Block$LOktavia$.prototype = new Block;
+
+/**
+ * @param {!string} blockName
+ */
+Block.prototype.startBlock$S = function (blockName) {
+ this.startBlock$SI(blockName, this._parent.contentSize$());
+};
+
+/**
+ * @param {!string} blockName
+ * @param {!number} index
+ */
+Block.prototype.startBlock$SI = function (blockName, index) {
+ if (this._start) {
+ throw new Error('Splitter `' + this._names[this._names.length - 1] + '` is not closed');
+ }
+ this._start = true;
+ this._names.push(blockName);
+ this._bitVector.set$I(index - 1);
+};
+
+/**
+ */
+Block.prototype.endBlock$ = function () {
+ this.endBlock$I(this._parent.contentSize$());
+};
+
+/**
+ * @param {!number} index
+ */
+Block.prototype.endBlock$I = function (index) {
+ if (! this._start) {
+ throw new Error('Splitter is not started');
+ }
+ this._start = false;
+ this._bitVector.set$I(index - 1);
+};
+
+/**
+ * @return {!number}
+ */
+Block.prototype.size$ = function () {
+ return (this._names.length | 0);
+};
+
+/**
+ * @param {!number} position
+ * @return {!number}
+ */
+Block.prototype.blockIndex$I = function (position) {
+ /** @type {!number} */
+ var result;
+ /** @type {BitVector} */
+ var this$0;
+ if (position < 0 || this._parent._fmindex.size$() - 1 <= position) {
+ throw new Error("Block.blockIndex() : range error " + (position + ""));
+ }
+ if (position >= this._bitVector.size$()) {
+ position = (this._bitVector.size$() - 1 | 0);
+ result = (this._bitVector.rank$I(position) + 1 | 0);
+ } else {
+ this$0 = this._bitVector;
+ result = this$0.rank$IB(position, true);
+ }
+ return result;
+};
+
+/**
+ * @param {!number} position
+ * @return {!boolean}
+ */
+Block.prototype.inBlock$I = function (position) {
+ /** @type {!number} */
+ var blockIndex;
+ blockIndex = this.blockIndex$I(position);
+ return blockIndex % 2 !== 0;
+};
+
+/**
+ * @param {!number} position
+ * @return {!string}
+ */
+Block.prototype.getBlockContent$I = function (position) {
+ /** @type {!number} */
+ var blockIndex;
+ /** @type {!string} */
+ var result;
+ blockIndex = this.blockIndex$I(position);
+ if (blockIndex % 2 !== 0) {
+ result = this.getContent$I(blockIndex);
+ } else {
+ result = '';
+ }
+ return result;
+};
+
+/**
+ * @param {!number} position
+ * @return {!string}
+ */
+Block.prototype.getBlockName$I = function (position) {
+ /** @type {!number} */
+ var blockIndex;
+ /** @type {!string} */
+ var result;
+ blockIndex = this.blockIndex$I(position);
+ if (blockIndex % 2 !== 0) {
+ result = this._names[blockIndex >>> 1];
+ } else {
+ result = '';
+ }
+ return result;
+};
+
+/**
+ * @param {SingleResult} result
+ * @param {Array.<undefined|!number>} positions
+ * @param {!string} word
+ * @param {!boolean} stemmed
+ */
+Block.prototype.grouping$LSingleResult$AISB = function (result, positions, word, stemmed) {
+};
+
+/**
+ * @param {!number} index
+ * @return {!string}
+ */
+Block.prototype.getInformation$I = function (index) {
+ return '';
+};
+
+/**
+ * @param {Oktavia} parent
+ * @param {!string} name
+ * @param {!string} data
+ * @param {!number} offset
+ * @return {!number}
+ */
+Block._load$LOktavia$SSI = function (parent, name, data, offset) {
+ /** @type {LoadedStringListResult} */
+ var strs;
+ /** @type {Block} */
+ var block;
+ /** @type {!number} */
+ var offset$0;
+ strs = new LoadedStringListResult$SI(data, offset);
+ block = new Block$LOktavia$(parent);
+ block._names = strs.result;
+ offset$0 = strs.offset;
+ offset$0 = block._bitVector.load$SI(data, offset$0);
+ block._parent._metadataLabels.push(name);
+ block._parent._metadatas[name] = block;
+ return offset$0;
+};
+
+var Block$_load$LOktavia$SSI = Block._load$LOktavia$SSI;
+
+/**
+ * @return {!string}
+ */
+Block.prototype._dump$ = function () {
+ return [ Binary$dump16bitNumber$I(3), Binary$dumpStringList$AS(this._names), Metadata.prototype._dump$.call(this) ].join('');
+};
+
+/**
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+Block.prototype._dump$LCompressionReport$ = function (report) {
+ CompressionReport$add$LCompressionReport$II(report, 1, 1);
+ return [ Binary$dump16bitNumber$I(3), Binary$dumpStringList$ASLCompressionReport$(this._names, report), Metadata.prototype._dump$LCompressionReport$.call(this, report) ].join('');
+};
+
+/**
+ * class FMIndex extends Object
+ * @constructor
+ */
+function FMIndex() {
+}
+
+/**
+ * @constructor
+ */
+function FMIndex$() {
+ /** @type {Array.<undefined|!number>} */
+ var _rlt$0;
+ this._ssize = 0;
+ (this._ddic = 0, this._head = 0);
+ this._substr = "";
+ this._sv = new WaveletMatrix$();
+ this._posdic = [ ];
+ this._idic = [ ];
+ _rlt$0 = this._rlt = [ ];
+ _rlt$0.length = 65536;
+};
+
+FMIndex$.prototype = new FMIndex;
+
+/**
+ */
+FMIndex.prototype.clear$ = function () {
+ /** @type {WaveletMatrix} */
+ var this$0;
+ this$0 = this._sv;
+ this$0._bv.length = 0;
+ this$0._seps.length = 0;
+ this$0._size = 0;
+ this._posdic.length = 0;
+ this._idic.length = 0;
+ this._ddic = 0;
+ this._head = 0;
+ this._substr = "";
+};
+
+/**
+ * @return {!number}
+ */
+FMIndex.prototype.size$ = function () {
+ /** @type {WaveletMatrix} */
+ var this$0;
+ this$0 = this._sv;
+ return this$0._size;
+};
+
+/**
+ * @return {!number}
+ */
+FMIndex.prototype.contentSize$ = function () {
+ return this._substr.length;
+};
+
+/**
+ * @param {!string} key
+ * @return {!number}
+ */
+FMIndex.prototype.getRows$S = function (key) {
+ /** @type {Array.<undefined|!number>} */
+ var pos;
+ pos = [ ];
+ return this.getRows$SAI(key, pos);
+};
+
+/**
+ * @param {!string} key
+ * @param {Array.<undefined|!number>} pos
+ * @return {!number}
+ */
+FMIndex.prototype.getRows$SAI = function (key, pos) {
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var code;
+ /** @type {!number} */
+ var first;
+ /** @type {undefined|!number} */
+ var last;
+ /** @type {!number} */
+ var c;
+ /** @type {Array.<undefined|!number>} */
+ var _rlt$0;
+ i = key.length - 1;
+ code = key.charCodeAt(i);
+ first = (_rlt$0 = this._rlt)[code] + 1;
+ last = _rlt$0[code + 1];
+ while (first <= last) {
+ if (i === 0) {
+ pos[0] = (-- first | 0);
+ pos[1] = -- last;
+ return (last - first + 1 | 0);
+ }
+ i--;
+ c = key.charCodeAt(i);
+ first = this._rlt[c] + this._sv.rank$II(first - 1, c) + 1;
+ last = this._rlt[c] + this._sv.rank$II(last, c);
+ }
+ return 0;
+};
+
+/**
+ * @param {!number} i
+ * @return {!number}
+ */
+FMIndex.prototype.getPosition$I = function (i) {
+ /** @type {!number} */
+ var pos;
+ /** @type {!number} */
+ var c;
+ if (i >= this.size$()) {
+ throw new Error("FMIndex.getPosition() : range error");
+ }
+ pos = 0;
+ while (i !== this._head) {
+ if (i % this._ddic === 0) {
+ pos += this._posdic[i / this._ddic] + 1;
+ break;
+ }
+ c = this._sv.get$I(i);
+ i = this._rlt[c] + this._sv.rank$II(i, c);
+ pos++;
+ }
+ return (pos % this.size$() | 0);
+};
+
+/**
+ * @param {!number} pos
+ * @param {!number} len
+ * @return {!string}
+ */
+FMIndex.prototype.getSubstring$II = function (pos, len) {
+ /** @type {!number} */
+ var pos_end;
+ /** @type {!number} */
+ var pos_tmp;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var pos_idic;
+ /** @type {!string} */
+ var substr;
+ /** @type {!number} */
+ var c;
+ /** @type {!number} */
+ var _ddic$0;
+ if (pos >= this.size$()) {
+ throw new Error("FMIndex.getSubstring() : range error");
+ }
+ pos_end = Math.min(pos + len, this.size$());
+ pos_tmp = this.size$() - 1;
+ i = this._head;
+ pos_idic = Math.floor((pos_end + (_ddic$0 = this._ddic) - 2) / _ddic$0);
+ if (pos_idic < this._idic.length) {
+ pos_tmp = pos_idic * this._ddic;
+ i = this._idic[pos_idic];
+ }
+ substr = "";
+ while (pos_tmp >= pos) {
+ c = this._sv.get$I(i);
+ i = this._rlt[c] + this._sv.rank$II(i, c);
+ if (pos_tmp < pos_end) {
+ substr = String.fromCharCode(c) + substr;
+ }
+ if (pos_tmp === 0) {
+ break;
+ }
+ pos_tmp--;
+ }
+ return substr;
+};
+
+/**
+ */
+FMIndex.prototype.build$ = function () {
+ this.build$SIIB(String.fromCharCode(0), 65535, 20, false);
+};
+
+/**
+ * @param {!string} end_marker
+ * @param {!number} ddic
+ * @param {!boolean} verbose
+ */
+FMIndex.prototype.build$SIB = function (end_marker, ddic, verbose) {
+ this.build$SIIB(end_marker, 65535, ddic, verbose);
+};
+
+/**
+ * @param {!string} end_marker
+ * @param {!number} maxChar
+ * @param {!number} ddic
+ * @param {!boolean} verbose
+ */
+FMIndex.prototype.build$SIIB = function (end_marker, maxChar, ddic, verbose) {
+ /** @type {BurrowsWheelerTransform} */
+ var b;
+ /** @type {!string} */
+ var s;
+ /** @type {!number} */
+ var c;
+ /** @type {!string} */
+ var str$0;
+ /** @type {WaveletMatrix} */
+ var this$0;
+ /** @type {!string} */
+ var _str$0;
+ /** @type {Array.<undefined|!number>} */
+ var _suffixarray$0;
+ if (verbose) {
+ console.time("building burrows-wheeler transform");
+ }
+ this._substr += end_marker;
+ b = ({_str: "", _size: 0, _head: 0, _suffixarray: [ ]});
+ str$0 = this._substr;
+ _str$0 = b._str = str$0;
+ b._size = _str$0.length;
+ _suffixarray$0 = b._suffixarray = SAIS$make$S(str$0);
+ b._head = (_suffixarray$0.indexOf(0) | 0);
+ s = BurrowsWheelerTransform$get$LBurrowsWheelerTransform$(b);
+ this._ssize = s.length;
+ this._head = b._head;
+ b._str = "";
+ b._size = 0;
+ b._head = 0;
+ b._suffixarray.length = 0;
+ this._substr = "";
+ if (verbose) {
+ console.timeEnd("building burrows-wheeler transform");
+ }
+ if (verbose) {
+ console.time("building wavelet matrix");
+ }
+ this$0 = this._sv;
+ this$0._bitsize = (Math.ceil(Math.log(maxChar) / 0.6931471805599453) | 0);
+ if (verbose) {
+ console.log(" maxCharCode: ", maxChar);
+ console.log(" bitSize: ", this._sv.bitsize$());
+ }
+ this._sv.build$S(s);
+ if (verbose) {
+ console.timeEnd("building wavelet matrix");
+ }
+ if (verbose) {
+ console.time("caching rank less than");
+ }
+ for (c = 0; c < maxChar; c++) {
+ this._rlt[c] = this._sv.rank_less_than$II(this._sv.size$(), c);
+ }
+ if (verbose) {
+ console.timeEnd("caching rank less than");
+ }
+ this._ddic = ddic;
+ if (verbose) {
+ console.time("building dictionaries");
+ }
+ this._buildDictionaries$();
+ if (verbose) {
+ console.timeEnd("building dictionaries");
+ console.log('');
+ }
+};
+
+/**
+ */
+FMIndex.prototype._buildDictionaries$ = function () {
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var pos;
+ /** @type {!number} */
+ var c;
+ for (i = 0; i < this._ssize / this._ddic + 1; i++) {
+ this._posdic.push(0);
+ this._idic.push(0);
+ }
+ i = this._head;
+ pos = this.size$() - 1;
+ do {
+ if (i % this._ddic === 0) {
+ this._posdic[Math.floor(i / this._ddic)] = (pos | 0);
+ }
+ if (pos % this._ddic === 0) {
+ this._idic[Math.floor(pos / this._ddic)] = (i | 0);
+ }
+ c = this._sv.get$I(i);
+ i = this._rlt[c] + this._sv.rank$II(i, c);
+ pos--;
+ } while (i !== this._head);
+};
+
+/**
+ * @param {!string} doc
+ */
+FMIndex.prototype.push$S = function (doc) {
+ if (doc.length <= 0) {
+ throw new Error("FMIndex::push(): empty string");
+ }
+ this._substr += doc;
+};
+
+/**
+ * @param {!string} keyword
+ * @return {Array.<undefined|!number>}
+ */
+FMIndex.prototype.search$S = function (keyword) {
+ /** @type {Array.<undefined|!number>} */
+ var result;
+ /** @type {Array.<undefined|!number>} */
+ var position;
+ /** @type {!number} */
+ var rows;
+ /** @type {undefined|!number} */
+ var first;
+ /** @type {undefined|!number} */
+ var last;
+ /** @type {undefined|!number} */
+ var i;
+ result = [ ];
+ position = [ ];
+ rows = this.getRows$SAI(keyword, position);
+ if (rows > 0) {
+ first = position[0];
+ last = position[1];
+ for (i = first; i <= last; i++) {
+ result.push(this.getPosition$I(i));
+ }
+ }
+ return result;
+};
+
+/**
+ * @return {!string}
+ */
+FMIndex.prototype.dump$ = function () {
+ return this.dump$B(false);
+};
+
+/**
+ * @param {!boolean} verbose
+ * @return {!string}
+ */
+FMIndex.prototype.dump$B = function (verbose) {
+ /** @type {Array.<undefined|!string>} */
+ var contents;
+ /** @type {CompressionReport} */
+ var report;
+ /** @type {!number} */
+ var i;
+ contents = [ ];
+ report = ({source: 0, result: 0});
+ contents.push(Binary$dump32bitNumber$N(this._ddic));
+ contents.push(Binary$dump32bitNumber$N(this._ssize));
+ contents.push(Binary$dump32bitNumber$N(this._head));
+ CompressionReport$add$LCompressionReport$II(report, 6, 6);
+ contents.push(this._sv.dump$LCompressionReport$(report));
+ if (verbose) {
+ console.log("Serializing FM-index");
+ console.log(' Wavelet Matrix: ' + (contents[3].length * 2 + "") + ' bytes (' + (Math.round(report.result * 100.0 / report.source) + "") + '%)');
+ }
+ contents.push(Binary$dump32bitNumber$N(this._posdic.length));
+ for (i in this._posdic) {
+ contents.push(Binary$dump32bitNumber$N(this._posdic[i]));
+ }
+ for (i in this._idic) {
+ contents.push(Binary$dump32bitNumber$N(this._idic[i]));
+ }
+ if (verbose) {
+ console.log(' Dictionary Cache: ' + (this._idic.length * 16 + "") + ' bytes');
+ }
+ return contents.join("");
+};
+
+/**
+ * @param {!string} data
+ * @return {!number}
+ */
+FMIndex.prototype.load$S = function (data) {
+ return this.load$SI(data, 0);
+};
+
+/**
+ * @param {!string} data
+ * @param {!number} offset
+ * @return {!number}
+ */
+FMIndex.prototype.load$SI = function (data, offset) {
+ /** @type {!number} */
+ var maxChar;
+ /** @type {!number} */
+ var c;
+ /** @type {!number} */
+ var size;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var result$0;
+ /** @type {!number} */
+ var result$1;
+ result$0 = data.charCodeAt(offset) * 65536 + data.charCodeAt(offset + 1);
+ this._ddic = (result$0 | 0);
+ this._ssize = (Binary$load32bitNumber$SI(data, offset + 2) | 0);
+ this._head = (Binary$load32bitNumber$SI(data, offset + 4) | 0);
+ offset = this._sv.load$SI(data, offset + 6);
+ maxChar = Math.pow(2, this._sv.bitsize$());
+ for (c = 0; c < maxChar; c++) {
+ this._rlt[c] = this._sv.rank_less_than$II(this._sv.size$(), c);
+ }
+ result$1 = data.charCodeAt(offset) * 65536 + data.charCodeAt(offset + 1);
+ size = result$1;
+ offset += 2;
+ for (i = 0; i < size; (i++, offset += 2)) {
+ this._posdic.push(Binary$load32bitNumber$SI(data, offset));
+ }
+ for (i = 0; i < size; (i++, offset += 2)) {
+ this._idic.push(Binary$load32bitNumber$SI(data, offset));
+ }
+ return offset;
+};
+
+/**
+ * class Tag extends Object
+ * @constructor
+ */
+function Tag() {
+}
+
+/**
+ * @constructor
+ * @param {!string} name
+ */
+function Tag$S(name) {
+ this.name = name;
+ this.attributes = ({ });
+ this.isSelfClosing = false;
+};
+
+Tag$S.prototype = new Tag;
+
+/**
+ * class _Common extends Object
+ * @constructor
+ */
+function _Common() {
+}
+
+/**
+ * @constructor
+ */
+function _Common$() {
+};
+
+_Common$.prototype = new _Common;
+
+/**
+ * class _State extends Object
+ * @constructor
+ */
+function _State() {
+}
+
+/**
+ * @constructor
+ */
+function _State$() {
+};
+
+_State$.prototype = new _State;
+
+/**
+ * class SAXHandler extends Object
+ * @constructor
+ */
+function SAXHandler() {
+}
+
+/**
+ * @constructor
+ */
+function SAXHandler$() {
+ this.position = 0;
+ this.column = 0;
+ this.line = 0;
+};
+
+SAXHandler$.prototype = new SAXHandler;
+
+/**
+ * @param {Error} error
+ */
+SAXHandler.prototype.onerror$LError$ = function (error) {
+};
+
+/**
+ * @param {!string} text
+ */
+SAXHandler.prototype.ontext$S = function (text) {
+};
+
+/**
+ * @param {!string} doctype
+ */
+SAXHandler.prototype.ondoctype$S = function (doctype) {
+};
+
+/**
+ * @param {!string} name
+ * @param {!string} body
+ */
+SAXHandler.prototype.onprocessinginstruction$SS = function (name, body) {
+};
+
+/**
+ * @param {!string} sgmlDecl
+ */
+SAXHandler.prototype.onsgmldeclaration$S = function (sgmlDecl) {
+};
+
+/**
+ * @param {!string} tagname
+ * @param {Object.<string, undefined|!string>} attributes
+ */
+SAXHandler.prototype.onopentag$SHS = function (tagname, attributes) {
+};
+
+/**
+ * @param {!string} tagname
+ */
+SAXHandler.prototype.onclosetag$S = function (tagname) {
+};
+
+/**
+ * @param {!string} name
+ * @param {!string} value
+ */
+SAXHandler.prototype.onattribute$SS = function (name, value) {
+};
+
+/**
+ * @param {!string} comment
+ */
+SAXHandler.prototype.oncomment$S = function (comment) {
+};
+
+/**
+ */
+SAXHandler.prototype.onopencdata$ = function () {
+};
+
+/**
+ * @param {!string} cdata
+ */
+SAXHandler.prototype.oncdata$S = function (cdata) {
+};
+
+/**
+ */
+SAXHandler.prototype.onclosecdata$ = function () {
+};
+
+/**
+ */
+SAXHandler.prototype.onend$ = function () {
+};
+
+/**
+ */
+SAXHandler.prototype.onready$ = function () {
+};
+
+/**
+ * @param {!string} script
+ */
+SAXHandler.prototype.onscript$S = function (script) {
+};
+
+/**
+ * class _HTMLHandler extends SAXHandler
+ * @constructor
+ */
+function _HTMLHandler() {
+}
+
+_HTMLHandler.prototype = new SAXHandler;
+/**
+ * @constructor
+ * @param {Object.<string, undefined|Array.<undefined|!string>>} styles
+ * @param {!boolean} escape
+ */
+function _HTMLHandler$HASB(styles, escape) {
+ this.position = 0;
+ this.column = 0;
+ this.line = 0;
+ this.text = [ ];
+ this.escape = escape;
+ this.styles = styles;
+};
+
+_HTMLHandler$HASB.prototype = new _HTMLHandler;
+
+/**
+ * @param {!string} str
+ * @return {!string}
+ */
+_HTMLHandler.escapeHTML$S = function (str) {
+ return str.replace(/\n/g, "<br/>").replace(/&/g, "&amp;").replace(/"/g, "&quot;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
+};
+
+var _HTMLHandler$escapeHTML$S = _HTMLHandler.escapeHTML$S;
+
+/**
+ * @param {!string} tagname
+ * @param {Object.<string, undefined|!string>} attributes
+ */
+_HTMLHandler.prototype.onopentag$SHS = function (tagname, attributes) {
+ this.text.push(this.styles[tagname][0]);
+};
+
+/**
+ * @param {!string} tagname
+ */
+_HTMLHandler.prototype.onclosetag$S = function (tagname) {
+ this.text.push(this.styles[tagname][1]);
+};
+
+/**
+ * @param {!string} text
+ */
+_HTMLHandler.prototype.ontext$S = function (text) {
+ if (this.escape) {
+ this.text.push(text.replace(/\n/g, "<br/>").replace(/&/g, "&amp;").replace(/"/g, "&quot;").replace(/</g, "&lt;").replace(/>/g, "&gt;"));
+ } else {
+ this.text.push(text);
+ }
+};
+
+/**
+ * @return {!string}
+ */
+_HTMLHandler.prototype.result$ = function () {
+ return this.text.join('');
+};
+
+/**
+ * class SAXParser extends Object
+ * @constructor
+ */
+function SAXParser() {
+}
+
+/**
+ * @constructor
+ * @param {SAXHandler} handler
+ */
+function SAXParser$LSAXHandler$(handler) {
+ this.q = "";
+ this.c = "";
+ this.bufferCheckPosition = 0;
+ this.looseCase = "";
+ this.tags = [ ];
+ this.closed = false;
+ this.closedRoot = false;
+ this.sawRoot = false;
+ this.tag = null;
+ this.error = null;
+ this.handler = null;
+ this.ENTITIES = null;
+ this.strict = false;
+ this.tagName = "";
+ this.state = 0;
+ this.line = 0;
+ this.column = 0;
+ this.position = 0;
+ this.startTagPosition = 0;
+ this.attribName = "";
+ this.attribValue = "";
+ this.script = "";
+ this.textNode = "";
+ this.attribList = null;
+ this.noscript = false;
+ this.cdata = "";
+ this.procInstBody = "";
+ this.procInstName = "";
+ this.doctype = "";
+ this.entity = "";
+ this.sgmlDecl = "";
+ this.comment = "";
+ this.preTags = 0;
+ this._init$LSAXHandler$B(handler, false);
+};
+
+SAXParser$LSAXHandler$.prototype = new SAXParser;
+
+/**
+ * @constructor
+ * @param {SAXHandler} handler
+ * @param {!boolean} strict
+ */
+function SAXParser$LSAXHandler$B(handler, strict) {
+ this.q = "";
+ this.c = "";
+ this.bufferCheckPosition = 0;
+ this.looseCase = "";
+ this.tags = [ ];
+ this.closed = false;
+ this.closedRoot = false;
+ this.sawRoot = false;
+ this.tag = null;
+ this.error = null;
+ this.handler = null;
+ this.ENTITIES = null;
+ this.strict = false;
+ this.tagName = "";
+ this.state = 0;
+ this.line = 0;
+ this.column = 0;
+ this.position = 0;
+ this.startTagPosition = 0;
+ this.attribName = "";
+ this.attribValue = "";
+ this.script = "";
+ this.textNode = "";
+ this.attribList = null;
+ this.noscript = false;
+ this.cdata = "";
+ this.procInstBody = "";
+ this.procInstName = "";
+ this.doctype = "";
+ this.entity = "";
+ this.sgmlDecl = "";
+ this.comment = "";
+ this.preTags = 0;
+ this._init$LSAXHandler$B(handler, strict);
+};
+
+SAXParser$LSAXHandler$B.prototype = new SAXParser;
+
+/**
+ * @param {SAXHandler} handler
+ * @param {!boolean} strict
+ */
+SAXParser.prototype._init$LSAXHandler$B = function (handler, strict) {
+ this.handler = handler;
+ this.clearBuffers$();
+ this.q = "";
+ this.bufferCheckPosition = 65536;
+ this.looseCase = 'toLowerCase';
+ this.tags = [ ];
+ this.closed = this.closedRoot = this.sawRoot = false;
+ this.tag = null;
+ this.error = null;
+ this.strict = strict;
+ this.noscript = strict;
+ this.state = 1;
+ this.ENTITIES = _Entities$entity_list$();
+ this.attribList = [ ];
+ this.noscript = false;
+ this.preTags = 0;
+};
+
+/**
+ * @param {!boolean} flag
+ */
+SAXParser.prototype.set_noscript$B = function (flag) {
+ this.noscript = flag;
+};
+
+/**
+ * @return {SAXParser}
+ */
+SAXParser.prototype.resume$ = function () {
+ this.error = null;
+ return this;
+};
+
+/**
+ * @return {SAXParser}
+ */
+SAXParser.prototype.close$ = function () {
+ return this.parse$S('');
+};
+
+/**
+ * @param {!string} chunk
+ * @return {SAXParser}
+ */
+SAXParser.prototype.parse$S = function (chunk) {
+ /** @type {Char} */
+ var _;
+ /** @type {!number} */
+ var i;
+ /** @type {!string} */
+ var c;
+ /** @type {!number} */
+ var starti;
+ /** @type {!number} */
+ var pad;
+ /** @type {!number} */
+ var returnState;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$0;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$1;
+ /** @type {RegExp} */
+ var charclass$2;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$3;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$4;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$5;
+ /** @type {!string} */
+ var text$0;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$6;
+ /** @type {RegExp} */
+ var charclass$7;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$8;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$9;
+ /** @type {RegExp} */
+ var charclass$10;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$11;
+ /** @type {RegExp} */
+ var charclass$12;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$13;
+ /** @type {RegExp} */
+ var charclass$14;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$15;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$16;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$17;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$18;
+ /** @type {RegExp} */
+ var charclass$19;
+ /** @type {RegExp} */
+ var charclass$20;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$21;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$22;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$23;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$24;
+ /** @type {!string} */
+ var comment$0;
+ _ = new Char$();
+ if (this.error) {
+ throw this.error;
+ }
+ if (this.closed) {
+ return this.emiterror$S("Cannot write after close. Assign an onready handler.");
+ }
+ (i = 0, c = "");
+ while (this.c = c = chunk.charAt(i++)) {
+ this.position++;
+ if (c === "\n") {
+ this.handler.line++;
+ this.handler.column = 0;
+ } else {
+ this.handler.column++;
+ }
+ switch (this.state) {
+ case 1:
+ if (c === "<") {
+ this.state = 4;
+ this.startTagPosition = this.position;
+ } else {
+ charclass$0 = _.whitespace;
+ if (! $__jsx_ObjectHasOwnProperty.call(charclass$0, c)) {
+ this.strictFail$S("Non-whitespace before first tag.");
+ this.textNode = c;
+ this.state = 2;
+ }
+ }
+ continue;
+ case 2:
+ if (this.sawRoot && ! this.closedRoot) {
+ starti = i - 1;
+ while (c && c !== "<" && c !== "&") {
+ c = chunk.charAt(i++);
+ if (c) {
+ this.position++;
+ if (c === "\n") {
+ this.handler.line++;
+ this.handler.column = 0;
+ } else {
+ this.handler.column++;
+ }
+ }
+ }
+ this.textNode += chunk.substring(starti, i - 1);
+ }
+ if (c === "<") {
+ this.state = 4;
+ this.startTagPosition = this.position;
+ } else {
+ if (_.not$HBS(_.whitespace, c) && (! this.sawRoot || this.closedRoot)) {
+ this.strictFail$S("Text data outside of root node.");
+ }
+ if (c === "&") {
+ this.state = 3;
+ } else {
+ this.textNode += c;
+ }
+ }
+ continue;
+ case 33:
+ if (c === "<") {
+ this.state = 34;
+ } else {
+ this.script += c;
+ }
+ continue;
+ case 34:
+ if (c === "/") {
+ this.state = 31;
+ } else {
+ this.script += "<" + c;
+ this.state = 33;
+ }
+ continue;
+ case 4:
+ if (c === "!") {
+ this.state = 5;
+ this.sgmlDecl = "";
+ } else {
+ charclass$1 = _.whitespace;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$1, c)) {
+ } else {
+ charclass$2 = _.nameStart;
+ if (charclass$2.test(c)) {
+ this.state = 21;
+ this.tagName = c;
+ } else {
+ if (c === "/") {
+ this.state = 31;
+ this.tagName = "";
+ } else {
+ if (c === "?") {
+ this.state = 18;
+ this.procInstName = this.procInstBody = "";
+ } else {
+ this.strictFail$S("Unencoded <");
+ if (this.startTagPosition + 1 < this.position) {
+ pad = this.position - this.startTagPosition;
+ for (i = 0; i < pad; i++) {
+ c = " " + c;
+ }
+ }
+ this.textNode += "<" + c;
+ this.state = 2;
+ }
+ }
+ }
+ }
+ }
+ continue;
+ case 5:
+ if ((this.sgmlDecl + c).toUpperCase() === _.CDATA) {
+ this.closetext_if_exist$();
+ this.state = 15;
+ this.sgmlDecl = "";
+ this.cdata = "";
+ } else {
+ if (this.sgmlDecl + c === "--") {
+ this.state = 12;
+ this.comment = "";
+ this.sgmlDecl = "";
+ } else {
+ if ((this.sgmlDecl + c).toUpperCase() === _.DOCTYPE) {
+ this.state = 7;
+ if (this.doctype || this.sawRoot) {
+ this.strictFail$S("Inappropriately located doctype declaration");
+ }
+ this.doctype = "";
+ this.sgmlDecl = "";
+ } else {
+ if (c === ">") {
+ this.closetext_if_exist$();
+ this.sgmlDecl = "";
+ this.state = 2;
+ } else {
+ charclass$3 = _.quote;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$3, c)) {
+ this.state = 6;
+ this.sgmlDecl += c;
+ } else {
+ this.sgmlDecl += c;
+ }
+ }
+ }
+ }
+ }
+ continue;
+ case 6:
+ if (c === this.q) {
+ this.state = 5;
+ this.q = "";
+ }
+ this.sgmlDecl += c;
+ continue;
+ case 7:
+ if (c === ">") {
+ this.state = 2;
+ this.closetext_if_exist$();
+ this.doctype.trim();
+ } else {
+ this.doctype += c;
+ if (c === "[") {
+ this.state = 9;
+ } else {
+ charclass$4 = _.quote;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$4, c)) {
+ this.state = 8;
+ this.q = c;
+ }
+ }
+ }
+ continue;
+ case 8:
+ this.doctype += c;
+ if (c === this.q) {
+ this.q = "";
+ this.state = 7;
+ }
+ continue;
+ case 9:
+ this.doctype += c;
+ if (c === "]") {
+ this.state = 7;
+ } else {
+ charclass$5 = _.quote;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$5, c)) {
+ this.state = 10;
+ this.q = c;
+ }
+ }
+ continue;
+ case 10:
+ this.doctype += c;
+ if (c === this.q) {
+ this.state = 9;
+ this.q = "";
+ }
+ continue;
+ case 12:
+ if (c === "-") {
+ this.state = 13;
+ } else {
+ this.comment += c;
+ }
+ continue;
+ case 13:
+ if (c === "-") {
+ this.state = 14;
+ text$0 = this.comment;
+ text$0 = text$0.replace(/[\n\t]/g, ' ');
+ text$0 = text$0.replace(/\s\s+/g, " ");
+ comment$0 = this.comment = text$0;
+ if (comment$0) {
+ this.closetext_if_exist$();
+ this.comment.trim();
+ }
+ this.comment = "";
+ } else {
+ this.comment += "-" + c;
+ this.state = 12;
+ }
+ continue;
+ case 14:
+ if (c !== ">") {
+ this.strictFail$S("Malformed comment");
+ this.comment += "--" + c;
+ this.state = 12;
+ } else {
+ this.state = 2;
+ }
+ continue;
+ case 15:
+ if (c === "]") {
+ this.state = 16;
+ } else {
+ this.cdata += c;
+ }
+ continue;
+ case 16:
+ if (c === "]") {
+ this.state = 17;
+ } else {
+ this.cdata += "]" + c;
+ this.state = 15;
+ }
+ continue;
+ case 17:
+ if (c === ">") {
+ if (this.cdata) {
+ this.closetext_if_exist$();
+ }
+ this.cdata = "";
+ this.state = 2;
+ } else {
+ if (c === "]") {
+ this.cdata += "]";
+ } else {
+ this.cdata += "]]" + c;
+ this.state = 15;
+ }
+ }
+ continue;
+ case 18:
+ if (c === "?") {
+ this.state = 20;
+ } else {
+ charclass$6 = _.whitespace;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$6, c)) {
+ this.state = 19;
+ } else {
+ this.procInstName += c;
+ }
+ }
+ continue;
+ case 19:
+ if (! this.procInstBody && _.is$HBS(_.whitespace, c)) {
+ continue;
+ } else {
+ if (c === "?") {
+ this.state = 20;
+ } else {
+ this.procInstBody += c;
+ }
+ }
+ continue;
+ case 20:
+ if (c === ">") {
+ this.closetext_if_exist$();
+ this.procInstName = this.procInstBody = "";
+ this.state = 2;
+ } else {
+ this.procInstBody += "?" + c;
+ this.state = 19;
+ }
+ continue;
+ case 21:
+ charclass$7 = _.nameBody;
+ if (charclass$7.test(c)) {
+ this.tagName += c;
+ } else {
+ this.newTag$();
+ if (c === ">") {
+ this.openTag$B(false);
+ } else {
+ if (c === "/") {
+ this.state = 22;
+ } else {
+ charclass$8 = _.whitespace;
+ if (! $__jsx_ObjectHasOwnProperty.call(charclass$8, c)) {
+ this.strictFail$S("Invalid character in tag name");
+ }
+ this.state = 23;
+ }
+ }
+ }
+ continue;
+ case 22:
+ if (c === ">") {
+ this.openTag$B(true);
+ this.closeTag$();
+ } else {
+ this.strictFail$S("Forward-slash in opening tag not followed by >");
+ this.state = 23;
+ }
+ continue;
+ case 23:
+ charclass$9 = _.whitespace;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$9, c)) {
+ continue;
+ } else {
+ if (c === ">") {
+ this.openTag$B(false);
+ } else {
+ if (c === "/") {
+ this.state = 22;
+ } else {
+ charclass$10 = _.nameStart;
+ if (charclass$10.test(c)) {
+ this.attribName = c;
+ this.attribValue = "";
+ this.state = 24;
+ } else {
+ this.strictFail$S("Invalid attribute name");
+ }
+ }
+ }
+ }
+ continue;
+ case 24:
+ if (c === "=") {
+ this.state = 26;
+ } else {
+ if (c === ">") {
+ this.strictFail$S("Attribute without value");
+ this.attribValue = this.attribName;
+ this.attrib$();
+ this.openTag$B(false);
+ } else {
+ charclass$11 = _.whitespace;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$11, c)) {
+ this.state = 25;
+ } else {
+ charclass$12 = _.nameBody;
+ if (charclass$12.test(c)) {
+ this.attribName += c;
+ } else {
+ this.strictFail$S("Invalid attribute name");
+ }
+ }
+ }
+ }
+ continue;
+ case 25:
+ if (c === "=") {
+ this.state = 26;
+ } else {
+ charclass$13 = _.whitespace;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$13, c)) {
+ continue;
+ } else {
+ this.strictFail$S("Attribute without value");
+ this.tag.attributes[this.attribName] = "";
+ this.attribValue = "";
+ this.closetext_if_exist$();
+ this.attribName = "";
+ if (c === ">") {
+ this.openTag$B(false);
+ } else {
+ charclass$14 = _.nameStart;
+ if (charclass$14.test(c)) {
+ this.attribName = c;
+ this.state = 24;
+ } else {
+ this.strictFail$S("Invalid attribute name");
+ this.state = 23;
+ }
+ }
+ }
+ }
+ continue;
+ case 26:
+ charclass$15 = _.whitespace;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$15, c)) {
+ continue;
+ } else {
+ charclass$16 = _.quote;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$16, c)) {
+ this.q = c;
+ this.state = 27;
+ } else {
+ this.strictFail$S("Unquoted attribute value");
+ this.state = 28;
+ this.attribValue = c;
+ }
+ }
+ continue;
+ case 27:
+ if (c !== this.q) {
+ if (c === "&") {
+ this.state = 29;
+ } else {
+ this.attribValue += c;
+ }
+ continue;
+ }
+ this.attrib$();
+ this.q = "";
+ this.state = 23;
+ continue;
+ case 28:
+ charclass$17 = _.attribEnd;
+ if (! $__jsx_ObjectHasOwnProperty.call(charclass$17, c)) {
+ if (c === "&") {
+ this.state = 30;
+ } else {
+ this.attribValue += c;
+ }
+ continue;
+ }
+ this.attrib$();
+ if (c === ">") {
+ this.openTag$B(false);
+ } else {
+ this.state = 23;
+ }
+ continue;
+ case 31:
+ if (! this.tagName) {
+ charclass$18 = _.whitespace;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$18, c)) {
+ continue;
+ } else {
+ charclass$19 = _.nameStart;
+ if (! charclass$19.test(c)) {
+ if (this.script) {
+ this.script += "</" + c;
+ this.state = 33;
+ } else {
+ this.strictFail$S("Invalid tagname in closing tag.");
+ }
+ } else {
+ this.tagName = c;
+ }
+ }
+ } else {
+ if (c === ">") {
+ this.closeTag$();
+ } else {
+ charclass$20 = _.nameBody;
+ if (charclass$20.test(c)) {
+ this.tagName += c;
+ } else {
+ if (this.script) {
+ this.script += "</" + this.tagName;
+ this.tagName = "";
+ this.state = 33;
+ } else {
+ charclass$21 = _.whitespace;
+ if (! $__jsx_ObjectHasOwnProperty.call(charclass$21, c)) {
+ this.strictFail$S("Invalid tagname in closing tag");
+ }
+ this.state = 32;
+ }
+ }
+ }
+ }
+ continue;
+ case 32:
+ charclass$22 = _.whitespace;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$22, c)) {
+ continue;
+ }
+ if (c === ">") {
+ this.closeTag$();
+ } else {
+ this.strictFail$S("Invalid characters in closing tag");
+ }
+ continue;
+ case 3:
+ if (c === ";") {
+ this.textNode += this.parseEntity$();
+ this.entity = "";
+ this.state = 2;
+ } else {
+ charclass$23 = _.entity;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$23, c)) {
+ this.entity += c;
+ } else {
+ this.strictFail$S("Invalid character entity");
+ this.textNode += "&" + this.entity + c;
+ this.entity = "";
+ this.state = 2;
+ }
+ }
+ continue;
+ case 29:
+ case 30:
+ if (this.state === 29) {
+ returnState = 27;
+ } else {
+ returnState = 28;
+ }
+ if (c === ";") {
+ this.attribValue += this.parseEntity$();
+ this.entity = "";
+ this.state = (returnState | 0);
+ } else {
+ charclass$24 = _.entity;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$24, c)) {
+ this.entity += c;
+ } else {
+ this.strictFail$S("Invalid character entity");
+ this.attribValue += "&" + this.entity + c;
+ this.entity = "";
+ this.state = (returnState | 0);
+ }
+ }
+ continue;
+ default:
+ throw new Error("Unknown state: " + (this.state + ""));
+ }
+ }
+ this.end$();
+ return this;
+};
+
+/**
+ */
+SAXParser.prototype.clearBuffers$ = function () {
+ this.comment = '';
+ this.sgmlDecl = '';
+ this.textNode = '';
+ this.tagName = '';
+ this.doctype = '';
+ this.procInstName = '';
+ this.procInstBody = '';
+ this.entity = '';
+ this.attribName = '';
+ this.attribValue = '';
+ this.cdata = '';
+ this.script = '';
+};
+
+/**
+ */
+SAXParser.prototype.closetext_if_exist$ = function () {
+ if (this.textNode !== '') {
+ this.closetext$();
+ }
+};
+
+/**
+ */
+SAXParser.prototype.closetext$ = function () {
+ /** @type {!string} */
+ var text;
+ /** @type {!string} */
+ var text$0;
+ if (this.preTags === 0) {
+ text$0 = this.textNode;
+ text$0 = text$0.replace(/[\n\t]/g, ' ');
+ text$0 = text$0.replace(/\s\s+/g, " ");
+ text = text$0;
+ if (text$0) {
+ this.handler.ontext$S(text);
+ }
+ } else {
+ if (this.textNode) {
+ this.handler.ontext$S(this.textNode);
+ }
+ }
+ this.textNode = "";
+};
+
+/**
+ * @param {!string} text
+ * @return {!string}
+ */
+SAXParser.prototype.textopts$S = function (text) {
+ text = text.replace(/[\n\t]/g, ' ');
+ text = text.replace(/\s\s+/g, " ");
+ return text;
+};
+
+/**
+ * @param {!string} er
+ * @return {SAXParser}
+ */
+SAXParser.prototype.emiterror$S = function (er) {
+ /** @type {Error} */
+ var error;
+ this.closetext$();
+ er += "\nLine: " + (this.line + "") + "\nColumn: " + (this.column + "") + "\nChar: " + this.c;
+ error = new Error(er);
+ this.error = error;
+ return this;
+};
+
+/**
+ */
+SAXParser.prototype.end$ = function () {
+ if (! this.closedRoot) {
+ this.strictFail$S("Unclosed root tag");
+ }
+ if (this.state !== 2) {
+ this.emiterror$S("Unexpected end");
+ }
+ this.closetext$();
+ this.c = "";
+ this.closed = true;
+};
+
+/**
+ * @param {!string} message
+ */
+SAXParser.prototype.strictFail$S = function (message) {
+ if (this.strict) {
+ this.emiterror$S(message);
+ }
+};
+
+/**
+ */
+SAXParser.prototype.newTag$ = function () {
+ if (! this.strict) {
+ this.tagName = this.tagName.toLowerCase();
+ }
+ this.tag = ({name: this.tagName, attributes: ({ }), isSelfClosing: false});
+ this.attribList.length = 0;
+};
+
+/**
+ */
+SAXParser.prototype.attrib$ = function () {
+ if (! this.strict) {
+ this.attribName = this.attribName.toLowerCase();
+ }
+ if ($__jsx_ObjectHasOwnProperty.call(this.tag.attributes, this.attribName)) {
+ this.attribName = this.attribValue = "";
+ return;
+ }
+ this.tag.attributes[this.attribName] = this.attribValue;
+ this.closetext_if_exist$();
+ this.attribName = this.attribValue = "";
+};
+
+/**
+ */
+SAXParser.prototype.openTag$ = function () {
+ this.openTag$B(false);
+};
+
+/**
+ * @param {!boolean} selfClosing
+ */
+SAXParser.prototype.openTag$B = function (selfClosing) {
+ /** @type {Tag} */
+ var tag$0;
+ /** @type {Tag} */
+ var tag$1;
+ (tag$0 = this.tag).isSelfClosing = selfClosing;
+ this.sawRoot = true;
+ this.tags.push(tag$0);
+ this.closetext_if_exist$();
+ this.handler.onopentag$SHS((tag$1 = this.tag).name, tag$1.attributes);
+ if (this.tag.name === 'pre') {
+ this.preTags++;
+ }
+ if (! selfClosing) {
+ if (! this.noscript && this.tagName.toLowerCase() === "script") {
+ this.state = 33;
+ } else {
+ this.state = 2;
+ }
+ this.tag = null;
+ this.tagName = "";
+ }
+ this.attribName = this.attribValue = "";
+ this.attribList.length = 0;
+};
+
+/**
+ */
+SAXParser.prototype.closeTag$ = function () {
+ /** @type {!number} */
+ var t;
+ /** @type {!string} */
+ var tagName;
+ /** @type {!string} */
+ var closeTo;
+ /** @type {Tag} */
+ var close;
+ /** @type {!number} */
+ var s;
+ /** @type {Tag} */
+ var tag$0;
+ if (! this.tagName) {
+ this.strictFail$S("Weird empty close tag.");
+ this.textNode += "</>";
+ this.state = 2;
+ return;
+ }
+ if (this.script) {
+ if (this.tagName !== "script") {
+ this.script += "</" + this.tagName + ">";
+ this.tagName = "";
+ this.state = 33;
+ return;
+ }
+ this.closetext_if_exist$();
+ this.script = "";
+ }
+ t = this.tags.length;
+ tagName = this.tagName;
+ if (! this.strict) {
+ tagName = tagName.toLowerCase();
+ }
+ closeTo = tagName;
+ while (t--) {
+ close = this.tags[t];
+ if (close.name !== closeTo) {
+ this.strictFail$S("Unexpected close tag");
+ } else {
+ break;
+ }
+ }
+ if (t < 0) {
+ this.strictFail$S("Unmatched closing tag: " + this.tagName);
+ this.textNode += "</" + this.tagName + ">";
+ this.state = 2;
+ return;
+ }
+ this.tagName = tagName;
+ s = this.tags.length;
+ while (s-- > t) {
+ tag$0 = this.tag = this.tags.pop();
+ this.tagName = tag$0.name;
+ this.closetext_if_exist$();
+ this.handler.onclosetag$S(this.tagName);
+ if (this.tagName === 'pre') {
+ this.preTags--;
+ }
+ }
+ if (t === 0) {
+ this.closedRoot = true;
+ }
+ this.tagName = this.attribValue = this.attribName = "";
+ this.attribList.length = 0;
+ this.state = 2;
+};
+
+/**
+ * @return {!string}
+ */
+SAXParser.prototype.parseEntity$ = function () {
+ /** @type {!string} */
+ var entity;
+ /** @type {!string} */
+ var entityLC;
+ /** @type {!number} */
+ var num;
+ /** @type {!string} */
+ var numStr;
+ entity = this.entity;
+ entityLC = entity.toLowerCase();
+ num = 0;
+ numStr = "";
+ if (this.ENTITIES[entity]) {
+ return this.ENTITIES[entity];
+ }
+ if (this.ENTITIES[entityLC]) {
+ return this.ENTITIES[entityLC];
+ }
+ entity = entityLC;
+ if (entityLC.charAt(0) === "#") {
+ if (entity.charAt(1) === "x") {
+ entity = entity.slice(2);
+ num = $__jsx_parseInt(entity, 16);
+ numStr = num.toString(16);
+ } else {
+ entity = entity.slice(1);
+ num = $__jsx_parseInt(entity, 10);
+ numStr = num.toString(10);
+ }
+ }
+ entity = entity.replace(/^0+/, "");
+ if (numStr.toLowerCase() !== entity) {
+ this.strictFail$S("Invalid character entity");
+ return "&" + this.entity + ";";
+ }
+ return String.fromCharCode(num);
+};
+
+/**
+ * class Char extends Object
+ * @constructor
+ */
+function Char() {
+}
+
+/**
+ * @constructor
+ */
+function Char$() {
+ this.CDATA = "[CDATA[";
+ this.DOCTYPE = "DOCTYPE";
+ this.XML_NAMESPACE = "http://www.w3.org/XML/1998/namespace";
+ this.whitespace = this._charClass$S("\r\n\t ");
+ this.number = this._charClass$S("0124356789");
+ this.letter = this._charClass$S("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ");
+ this.quote = this._charClass$S("'\"");
+ this.entity = this._charClass$S("0124356789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ#");
+ this.attribEnd = this._charClass$S("\r\n\t >");
+ this.nameStart = /[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/;
+ this.nameBody = /[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040\.\d-]/;
+};
+
+Char$.prototype = new Char;
+
+/**
+ * @param {!string} str
+ * @return {Object.<string, undefined|!boolean>}
+ */
+Char.prototype._charClass$S = function (str) {
+ /** @type {Object.<string, undefined|!boolean>} */
+ var result;
+ /** @type {!number} */
+ var i;
+ result = ({ });
+ for (i = 0; i < str.length; i++) {
+ result[str.slice(i, i + 1)] = true;
+ }
+ return result;
+};
+
+/**
+ * @param {RegExp} charclass
+ * @param {!string} c
+ * @return {!boolean}
+ */
+Char.prototype.is$LRegExp$S = function (charclass, c) {
+ return charclass.test(c);
+};
+
+/**
+ * @param {Object.<string, undefined|!boolean>} charclass
+ * @param {!string} c
+ * @return {!boolean}
+ */
+Char.prototype.is$HBS = function (charclass, c) {
+ return $__jsx_ObjectHasOwnProperty.call(charclass, c);
+};
+
+/**
+ * @param {RegExp} charclass
+ * @param {!string} c
+ * @return {!boolean}
+ */
+Char.prototype.not$LRegExp$S = function (charclass, c) {
+ return ! charclass.test(c);
+};
+
+/**
+ * @param {Object.<string, undefined|!boolean>} charclass
+ * @param {!string} c
+ * @return {!boolean}
+ */
+Char.prototype.not$HBS = function (charclass, c) {
+ return ! $__jsx_ObjectHasOwnProperty.call(charclass, c);
+};
+
+/**
+ * class _Entities extends Object
+ * @constructor
+ */
+function _Entities() {
+}
+
+/**
+ * @constructor
+ */
+function _Entities$() {
+};
+
+_Entities$.prototype = new _Entities;
+
+/**
+ * @return {Object.<string, undefined|!string>}
+ */
+_Entities.entity_list$ = function () {
+ /** @type {Object.<string, undefined|!string>} */
+ var result;
+ /** @type {!string} */
+ var key;
+ /** @type {*} */
+ var value;
+ result = ({ });
+ for (key in _Entities._entities) {
+ value = _Entities._entities[key];
+ if (typeof value === 'string') {
+ result[key] = value + "";
+ } else {
+ if (typeof value === 'number') {
+ result[key] = String.fromCharCode(value | 0);
+ }
+ }
+ }
+ return result;
+};
+
+var _Entities$entity_list$ = _Entities.entity_list$;
+
+/**
+ * class BitVector extends Object
+ * @constructor
+ */
+function BitVector() {
+}
+
+/**
+ * @constructor
+ */
+function BitVector$() {
+ /** @type {Array.<undefined|!number>} */
+ var _v$0;
+ /** @type {Array.<undefined|!number>} */
+ var _r$0;
+ _r$0 = this._r = [ ];
+ _v$0 = this._v = [ ];
+ _v$0.length = 0;
+ _r$0.length = 0;
+ this._size = 0;
+ this._size1 = 0;
+};
+
+BitVector$.prototype = new BitVector;
+
+/**
+ */
+BitVector.prototype.build$ = function () {
+ /** @type {!number} */
+ var i;
+ this._size1 = 0;
+ for (i = 0; i < this._v.length; i++) {
+ if (i % 8 === 0) {
+ this._r.push(true ? this._size1 : this._size - this._size1);
+ }
+ this._size1 += this._rank32$IIB(this._v[i], 32, true);
+ }
+};
+
+/**
+ */
+BitVector.prototype.clear$ = function () {
+ this._v.length = 0;
+ this._r.length = 0;
+ this._size = 0;
+ this._size1 = 0;
+};
+
+/**
+ * @return {!number}
+ */
+BitVector.prototype.size$ = function () {
+ return this._size;
+};
+
+/**
+ * @param {!boolean} b
+ * @return {!number}
+ */
+BitVector.prototype.size$B = function (b) {
+ return (b ? this._size1 : this._size - this._size1);
+};
+
+/**
+ * @param {!number} value
+ */
+BitVector.prototype.set$I = function (value) {
+ this.set$IB(value, true);
+};
+
+/**
+ * @param {!number} value
+ * @param {!boolean} flag
+ */
+BitVector.prototype.set$IB = function (value, flag) {
+ /** @type {!number} */
+ var q;
+ /** @type {!number} */
+ var r;
+ /** @type {!number} */
+ var m;
+ if (value >= this._size) {
+ this._size = (value + 1 | 0);
+ }
+ q = (value / 32 | 0);
+ r = (value % 32 | 0);
+ while (q >= this._v.length) {
+ this._v.push(0);
+ }
+ m = 0x1 << r;
+ if (flag) {
+ this._v[q] |= m;
+ } else {
+ this._v[q] &= ~ m;
+ }
+};
+
+/**
+ * @param {!number} value
+ * @return {!boolean}
+ */
+BitVector.prototype.get$I = function (value) {
+ /** @type {!number} */
+ var q;
+ /** @type {!number} */
+ var r;
+ /** @type {!number} */
+ var m;
+ if (value >= this._size) {
+ throw new Error("BitVector.get() : range error");
+ }
+ q = (value / 32 | 0);
+ r = (value % 32 | 0);
+ m = 0x1 << r;
+ return !! (this._v[q] & m);
+};
+
+/**
+ * @param {!number} i
+ * @return {!number}
+ */
+BitVector.prototype.rank$I = function (i) {
+ return this.rank$IB(i, true);
+};
+
+/**
+ * @param {!number} i
+ * @param {!boolean} b
+ * @return {!number}
+ */
+BitVector.prototype.rank$IB = function (i, b) {
+ /** @type {!number} */
+ var q_large;
+ /** @type {!number} */
+ var q_small;
+ /** @type {!number} */
+ var r;
+ /** @type {!number} */
+ var rank;
+ /** @type {!number} */
+ var begin;
+ /** @type {!number} */
+ var j;
+ if (i > this._size) {
+ throw new Error("BitVector.rank() : range error");
+ }
+ if (i === 0) {
+ return 0;
+ }
+ i--;
+ q_large = (Math.floor(i / 256) | 0);
+ q_small = (Math.floor(i / 32) | 0);
+ r = (Math.floor(i % 32) | 0);
+ rank = (this._r[q_large] | 0);
+ if (! b) {
+ rank = q_large * 256 - rank;
+ }
+ begin = q_large * 8;
+ for (j = begin; j < q_small; j++) {
+ rank += this._rank32$IIB(this._v[j], 32, b);
+ }
+ rank += this._rank32$IIB(this._v[q_small], r + 1, b);
+ return rank;
+};
+
+/**
+ * @param {!number} i
+ * @return {!number}
+ */
+BitVector.prototype.select$I = function (i) {
+ return this.select$IB(i, true);
+};
+
+/**
+ * @param {!number} i
+ * @param {!boolean} b
+ * @return {!number}
+ */
+BitVector.prototype.select$IB = function (i, b) {
+ /** @type {!number} */
+ var left;
+ /** @type {!number} */
+ var right;
+ /** @type {!number} */
+ var pivot;
+ /** @type {undefined|!number} */
+ var rank;
+ /** @type {!number} */
+ var j;
+ if (i >= (b ? this._size1 : this._size - this._size1)) {
+ throw new Error("BitVector.select() : range error");
+ }
+ left = 0;
+ right = this._r.length;
+ while (left < right) {
+ pivot = Math.floor((left + right) / 2);
+ rank = this._r[pivot];
+ if (! b) {
+ rank = pivot * 256 - rank;
+ }
+ if (i < rank) {
+ right = pivot;
+ } else {
+ left = pivot + 1;
+ }
+ }
+ right--;
+ if (b) {
+ i -= (this._r[right] | 0);
+ } else {
+ i -= (right * 256 - this._r[right] | 0);
+ }
+ j = right * 8;
+ while (1) {
+ rank = this._rank32$IIB(this._v[j], 32, b);
+ if (i < rank) {
+ break;
+ }
+ j++;
+ i -= (rank | 0);
+ }
+ return (j * 32 + this._select32$IIB(this._v[j], i, b) | 0);
+};
+
+/**
+ * @param {!number} x
+ * @param {!number} i
+ * @param {!boolean} b
+ * @return {!number}
+ */
+BitVector.prototype._rank32$IIB = function (x, i, b) {
+ if (! b) {
+ x = ~ x;
+ }
+ x <<= 32 - i;
+ x = ((x & 0xaaaaaaaa) >>> 1) + (x & 0x55555555);
+ x = ((x & 0xcccccccc) >>> 2) + (x & 0x33333333);
+ x = ((x & 0xf0f0f0f0) >>> 4) + (x & 0x0f0f0f0f);
+ x = ((x & 0xff00ff00) >>> 8) + (x & 0x00ff00ff);
+ x = ((x & 0xffff0000) >>> 16) + (x & 0x0000ffff);
+ return x;
+};
+
+/**
+ * @param {!number} x
+ * @param {!number} i
+ * @param {!boolean} b
+ * @return {!number}
+ */
+BitVector.prototype._select32$IIB = function (x, i, b) {
+ /** @type {!number} */
+ var x1;
+ /** @type {!number} */
+ var x2;
+ /** @type {!number} */
+ var x3;
+ /** @type {!number} */
+ var x4;
+ /** @type {!number} */
+ var x5;
+ /** @type {!number} */
+ var pos;
+ /** @type {!number} */
+ var v5;
+ /** @type {!number} */
+ var v4;
+ /** @type {!number} */
+ var v3;
+ /** @type {!number} */
+ var v2;
+ /** @type {!number} */
+ var v1;
+ /** @type {!number} */
+ var v0;
+ if (! b) {
+ x = ~ x;
+ }
+ x1 = ((x & 0xaaaaaaaa) >>> 1) + (x & 0x55555555);
+ x2 = ((x1 & 0xcccccccc) >>> 2) + (x1 & 0x33333333);
+ x3 = ((x2 & 0xf0f0f0f0) >>> 4) + (x2 & 0x0f0f0f0f);
+ x4 = ((x3 & 0xff00ff00) >>> 8) + (x3 & 0x00ff00ff);
+ x5 = ((x4 & 0xffff0000) >>> 16) + (x4 & 0x0000ffff);
+ i++;
+ pos = 0;
+ v5 = x5 & 0xffffffff;
+ if (i > v5) {
+ i -= (v5 | 0);
+ pos += 32;
+ }
+ v4 = x4 >>> pos & 0x0000ffff;
+ if (i > v4) {
+ i -= (v4 | 0);
+ pos += 16;
+ }
+ v3 = x3 >>> pos & 0x000000ff;
+ if (i > v3) {
+ i -= (v3 | 0);
+ pos += 8;
+ }
+ v2 = x2 >>> pos & 0x0000000f;
+ if (i > v2) {
+ i -= (v2 | 0);
+ pos += 4;
+ }
+ v1 = x1 >>> pos & 0x00000003;
+ if (i > v1) {
+ i -= (v1 | 0);
+ pos += 2;
+ }
+ v0 = x >>> pos & 0x00000001;
+ if (i > v0) {
+ i -= (v0 | 0);
+ pos += 1;
+ }
+ return (pos | 0);
+};
+
+/**
+ * @return {!string}
+ */
+BitVector.prototype.dump$ = function () {
+ /** @type {Array.<undefined|!string>} */
+ var contents;
+ contents = [ ];
+ contents.push(Binary$dump32bitNumber$N(this._size));
+ contents.push(Binary$dump32bitNumberList$AN(this._v));
+ return contents.join('');
+};
+
+/**
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+BitVector.prototype.dump$LCompressionReport$ = function (report) {
+ /** @type {Array.<undefined|!string>} */
+ var contents;
+ contents = [ ];
+ contents.push(Binary$dump32bitNumber$N(this._size));
+ CompressionReport$add$LCompressionReport$II(report, 2, 2);
+ contents.push(Binary$dump32bitNumberList$ANLCompressionReport$(this._v, report));
+ return contents.join('');
+};
+
+/**
+ * @param {!string} data
+ * @return {!number}
+ */
+BitVector.prototype.load$S = function (data) {
+ return this.load$SI(data, 0);
+};
+
+/**
+ * @param {!string} data
+ * @param {!number} offset
+ * @return {!number}
+ */
+BitVector.prototype.load$SI = function (data, offset) {
+ /** @type {LoadedNumberListResult} */
+ var result;
+ /** @type {!number} */
+ var result$0;
+ this._v.length = 0;
+ this._r.length = 0;
+ this._size = 0;
+ this._size1 = 0;
+ result$0 = data.charCodeAt(offset) * 65536 + data.charCodeAt(offset + 1);
+ this._size = (result$0 | 0);
+ result = Binary$load32bitNumberList$SI(data, offset + 2);
+ this._v = result.result;
+ this.build$();
+ return result.offset;
+};
+
+/**
+ * class WaveletMatrix extends Object
+ * @constructor
+ */
+function WaveletMatrix() {
+}
+
+/**
+ * @constructor
+ */
+function WaveletMatrix$() {
+ /** @type {Array.<undefined|BitVector>} */
+ var _bv$0;
+ /** @type {Array.<undefined|!number>} */
+ var _seps$0;
+ this._range = ({ });
+ _bv$0 = this._bv = [ ];
+ _seps$0 = this._seps = [ ];
+ this._bitsize = 16;
+ _bv$0.length = 0;
+ _seps$0.length = 0;
+ this._size = 0;
+};
+
+WaveletMatrix$.prototype = new WaveletMatrix;
+
+/**
+ * @return {!number}
+ */
+WaveletMatrix.prototype.bitsize$ = function () {
+ return this._bitsize;
+};
+
+/**
+ * @param {!number} charCode
+ */
+WaveletMatrix.prototype.setMaxCharCode$I = function (charCode) {
+ this._bitsize = (Math.ceil(Math.log(charCode) / 0.6931471805599453) | 0);
+};
+
+/**
+ */
+WaveletMatrix.prototype.clear$ = function () {
+ this._bv.length = 0;
+ this._seps.length = 0;
+ this._size = 0;
+};
+
+/**
+ * @param {!string} v
+ */
+WaveletMatrix.prototype.build$S = function (v) {
+ /** @type {!number} */
+ var size;
+ /** @type {!number} */
+ var bitsize;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var depth;
+ /** @type {Object.<string, undefined|!number>} */
+ var range_tmp;
+ /** @type {!number} */
+ var code;
+ /** @type {!boolean} */
+ var bit;
+ /** @type {!number} */
+ var key;
+ /** @type {Object.<string, undefined|!number>} */
+ var range_rev;
+ /** @type {!string} */
+ var range_key;
+ /** @type {!number} */
+ var value;
+ /** @type {!number} */
+ var pos0;
+ /** @type {undefined|!number} */
+ var pos1;
+ /** @type {!string} */
+ var range_rev_key;
+ /** @type {!number} */
+ var begin;
+ /** @type {undefined|!number} */
+ var end;
+ /** @type {!number} */
+ var num0;
+ /** @type {!number} */
+ var num1;
+ this._bv.length = 0;
+ this._seps.length = 0;
+ this._size = 0;
+ size = v.length;
+ bitsize = this._bitsize;
+ for (i = 0; i < bitsize; i++) {
+ this._bv.push(new BitVector$());
+ this._seps.push(0);
+ }
+ this._size = (size | 0);
+ for (i = 0; i < size; i++) {
+ this._bv[0].set$IB(i, this._uint2bit$II(v.charCodeAt(i), 0));
+ }
+ this._bv[0].build$();
+ this._seps[0] = this._bv[0].size$B(false);
+ this._range["0"] = 0;
+ this._range["1"] = this._seps[0];
+ depth = 1;
+ while (depth < bitsize) {
+ range_tmp = WaveletMatrix$_shallow_copy$HI(this._range);
+ for (i = 0; i < size; i++) {
+ code = v.charCodeAt(i);
+ bit = this._uint2bit$II(code, depth);
+ key = code >>> bitsize - depth;
+ this._bv[depth].set$IB(range_tmp[key + ""], bit);
+ range_tmp[key + ""]++;
+ }
+ this._bv[depth].build$();
+ this._seps[depth] = this._bv[depth].size$B(false);
+ range_rev = ({ });
+ for (range_key in this._range) {
+ value = this._range[range_key];
+ if (value != range_tmp[range_key]) {
+ range_rev[value + ""] = range_key | 0;
+ }
+ }
+ this._range = ({ });
+ pos0 = 0;
+ pos1 = this._seps[depth];
+ for (range_rev_key in range_rev) {
+ begin = range_rev_key | 0;
+ value = range_rev[range_rev_key];
+ end = range_tmp[value + ""];
+ num0 = this._bv[depth].rank$IB(end, false) - this._bv[depth].rank$IB(begin, false);
+ num1 = end - begin - num0;
+ if (num0 > 0) {
+ this._range[(value << 1) + ""] = (pos0 | 0);
+ pos0 += num0;
+ }
+ if (num1 > 0) {
+ this._range[(value << 1) + 1 + ""] = pos1;
+ pos1 += (num1 | 0);
+ }
+ }
+ depth++;
+ }
+};
+
+/**
+ * @return {!number}
+ */
+WaveletMatrix.prototype.size$ = function () {
+ return this._size;
+};
+
+/**
+ * @param {!number} c
+ * @return {!number}
+ */
+WaveletMatrix.prototype.size$I = function (c) {
+ return this.rank$II(this._size, c);
+};
+
+/**
+ * @param {!number} i
+ * @return {!number}
+ */
+WaveletMatrix.prototype.get$I = function (i) {
+ /** @type {!number} */
+ var value;
+ /** @type {!number} */
+ var depth;
+ /** @type {!boolean} */
+ var bit;
+ if (i >= this._size) {
+ throw new Error("WaveletMatrix.get() : range error");
+ }
+ value = 0;
+ depth = 0;
+ while (depth < this._bitsize) {
+ bit = this._bv[depth].get$I(i);
+ i = this._bv[depth].rank$IB(i, bit);
+ value <<= 1;
+ if (bit) {
+ i += this._seps[depth];
+ value += 1;
+ }
+ depth++;
+ }
+ return (value | 0);
+};
+
+/**
+ * @param {!number} i
+ * @param {!number} c
+ * @return {!number}
+ */
+WaveletMatrix.prototype.rank$II = function (i, c) {
+ /** @type {undefined|!number} */
+ var begin;
+ /** @type {!number} */
+ var end;
+ /** @type {!number} */
+ var depth;
+ /** @type {!boolean} */
+ var bit;
+ if (i > this._size) {
+ throw new Error("WaveletMatrix.rank(): range error");
+ }
+ if (i === 0) {
+ return 0;
+ }
+ begin = this._range[c + ""];
+ if (begin == null) {
+ return 0;
+ }
+ end = i;
+ depth = 0;
+ while (depth < this._bitsize) {
+ bit = this._uint2bit$II(c, depth);
+ end = this._bv[depth].rank$IB(end, bit);
+ if (bit) {
+ end += this._seps[depth];
+ }
+ depth++;
+ }
+ return (end - begin | 0);
+};
+
+/**
+ * @param {!number} i
+ * @param {!number} c
+ * @return {!number}
+ */
+WaveletMatrix.prototype.rank_less_than$II = function (i, c) {
+ /** @type {!number} */
+ var begin;
+ /** @type {!number} */
+ var end;
+ /** @type {!number} */
+ var depth;
+ /** @type {!number} */
+ var rlt;
+ /** @type {!number} */
+ var rank0_begin;
+ /** @type {!number} */
+ var rank0_end;
+ /** @type {Array.<undefined|!number>} */
+ var _seps$0;
+ if (i > this._size) {
+ throw new Error("WaveletMatrix.rank_less_than(): range error");
+ }
+ if (i === 0) {
+ return 0;
+ }
+ begin = 0;
+ end = i;
+ depth = 0;
+ rlt = 0;
+ while (depth < this._bitsize) {
+ rank0_begin = this._bv[depth].rank$IB(begin, false);
+ rank0_end = this._bv[depth].rank$IB(end, false);
+ if (this._uint2bit$II(c, depth)) {
+ rlt += rank0_end - rank0_begin;
+ begin += (_seps$0 = this._seps)[depth] - rank0_begin;
+ end += _seps$0[depth] - rank0_end;
+ } else {
+ begin = rank0_begin;
+ end = rank0_end;
+ }
+ depth++;
+ }
+ return (rlt | 0);
+};
+
+/**
+ * @return {!string}
+ */
+WaveletMatrix.prototype.dump$ = function () {
+ /** @type {Array.<undefined|!string>} */
+ var contents;
+ /** @type {!number} */
+ var i;
+ /** @type {Array.<undefined|!string>} */
+ var range_contents;
+ /** @type {!number} */
+ var counter;
+ /** @type {!string} */
+ var key;
+ contents = [ Binary$dump16bitNumber$I(this._bitsize), Binary$dump32bitNumber$N(this._size) ];
+ for (i = 0; i < this._bitsize; i++) {
+ contents.push(this._bv[i].dump$());
+ }
+ for (i = 0; i < this._bitsize; i++) {
+ contents.push(Binary$dump32bitNumber$N(this._seps[i]));
+ }
+ range_contents = [ ];
+ counter = 0;
+ for (key in this._range) {
+ range_contents.push(Binary$dump32bitNumber$N(key | 0));
+ range_contents.push(Binary$dump32bitNumber$N(this._range[key]));
+ counter++;
+ }
+ contents.push(Binary$dump32bitNumber$N(counter));
+ return contents.join('') + range_contents.join('');
+};
+
+/**
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+WaveletMatrix.prototype.dump$LCompressionReport$ = function (report) {
+ /** @type {Array.<undefined|!string>} */
+ var contents;
+ /** @type {!number} */
+ var i;
+ /** @type {Array.<undefined|!string>} */
+ var range_contents;
+ /** @type {!number} */
+ var counter;
+ /** @type {!string} */
+ var key;
+ contents = [ Binary$dump16bitNumber$I(this._bitsize), Binary$dump32bitNumber$N(this._size) ];
+ CompressionReport$add$LCompressionReport$II(report, 3, 3);
+ for (i = 0; i < this._bitsize; i++) {
+ contents.push(this._bv[i].dump$LCompressionReport$(report));
+ }
+ for (i = 0; i < this._bitsize; i++) {
+ contents.push(Binary$dump32bitNumber$N(this._seps[i]));
+ CompressionReport$add$LCompressionReport$II(report, 2, 2);
+ }
+ range_contents = [ ];
+ counter = 0;
+ for (key in this._range) {
+ range_contents.push(Binary$dump32bitNumber$N(key | 0));
+ range_contents.push(Binary$dump32bitNumber$N(this._range[key]));
+ CompressionReport$add$LCompressionReport$II(report, 4, 4);
+ counter++;
+ }
+ CompressionReport$add$LCompressionReport$II(report, 2, 2);
+ contents.push(Binary$dump32bitNumber$N(counter));
+ return contents.join('') + range_contents.join('');
+};
+
+/**
+ * @param {!string} data
+ * @return {!number}
+ */
+WaveletMatrix.prototype.load$S = function (data) {
+ return this.load$SI(data, 0);
+};
+
+/**
+ * @param {!string} data
+ * @param {!number} offset
+ * @return {!number}
+ */
+WaveletMatrix.prototype.load$SI = function (data, offset) {
+ /** @type {!number} */
+ var i;
+ /** @type {BitVector} */
+ var bit_vector;
+ /** @type {!number} */
+ var range_size;
+ /** @type {!number} */
+ var value;
+ /** @type {!number} */
+ var offset$0;
+ /** @type {!number} */
+ var result$0;
+ /** @type {!number} */
+ var result$1;
+ /** @type {!number} */
+ var result$2;
+ this._bv.length = 0;
+ this._seps.length = 0;
+ this._size = 0;
+ offset$0 = offset++;
+ this._bitsize = (data.charCodeAt(offset$0) | 0);
+ result$0 = data.charCodeAt(offset) * 65536 + data.charCodeAt(offset + 1);
+ this._size = (result$0 | 0);
+ offset += 2;
+ for (i = 0; i < this._bitsize; i++) {
+ bit_vector = new BitVector$();
+ offset = bit_vector.load$SI(data, offset);
+ this._bv.push(bit_vector);
+ }
+ for (i = 0; i < this._bitsize; (i++, offset += 2)) {
+ this._seps.push(Binary$load32bitNumber$SI(data, offset));
+ }
+ result$1 = data.charCodeAt(offset) * 65536 + data.charCodeAt(offset + 1);
+ range_size = result$1;
+ offset += 2;
+ for (i = 0; i < range_size; (i++, offset += 4)) {
+ result$2 = data.charCodeAt(offset) * 65536 + data.charCodeAt(offset + 1);
+ value = Binary$load32bitNumber$SI(data, offset + 2);
+ this._range[result$2 + ""] = (value | 0);
+ }
+ return offset;
+};
+
+/**
+ * @param {Object.<string, undefined|!number>} input
+ * @return {Object.<string, undefined|!number>}
+ */
+WaveletMatrix._shallow_copy$HI = function (input) {
+ /** @type {Object.<string, undefined|!number>} */
+ var result;
+ /** @type {!string} */
+ var key;
+ result = ({ });
+ for (key in input) {
+ result[key] = input[key];
+ }
+ return result;
+};
+
+var WaveletMatrix$_shallow_copy$HI = WaveletMatrix._shallow_copy$HI;
+
+/**
+ * @param {!number} c
+ * @param {!number} i
+ * @return {!boolean}
+ */
+WaveletMatrix.prototype._uint2bit$II = function (c, i) {
+ return (c >>> this._bitsize - 1 - i & 0x1) === 0x1;
+};
+
+/**
+ * class BurrowsWheelerTransform extends Object
+ * @constructor
+ */
+function BurrowsWheelerTransform() {
+}
+
+/**
+ * @constructor
+ */
+function BurrowsWheelerTransform$() {
+ this._str = "";
+ this._size = 0;
+ this._head = 0;
+ this._suffixarray = [ ];
+};
+
+BurrowsWheelerTransform$.prototype = new BurrowsWheelerTransform;
+
+/**
+ * @param {BurrowsWheelerTransform} $this
+ * @return {!number}
+ */
+BurrowsWheelerTransform.size$LBurrowsWheelerTransform$ = function ($this) {
+ return $this._size;
+};
+
+var BurrowsWheelerTransform$size$LBurrowsWheelerTransform$ = BurrowsWheelerTransform.size$LBurrowsWheelerTransform$;
+
+/**
+ * @param {BurrowsWheelerTransform} $this
+ * @return {!number}
+ */
+BurrowsWheelerTransform.head$LBurrowsWheelerTransform$ = function ($this) {
+ return $this._head;
+};
+
+var BurrowsWheelerTransform$head$LBurrowsWheelerTransform$ = BurrowsWheelerTransform.head$LBurrowsWheelerTransform$;
+
+/**
+ * @param {BurrowsWheelerTransform} $this
+ */
+BurrowsWheelerTransform.clear$LBurrowsWheelerTransform$ = function ($this) {
+ $this._str = "";
+ $this._size = 0;
+ $this._head = 0;
+ $this._suffixarray.length = 0;
+};
+
+var BurrowsWheelerTransform$clear$LBurrowsWheelerTransform$ = BurrowsWheelerTransform.clear$LBurrowsWheelerTransform$;
+
+/**
+ * @param {BurrowsWheelerTransform} $this
+ * @param {!string} str
+ */
+BurrowsWheelerTransform.build$LBurrowsWheelerTransform$S = function ($this, str) {
+ /** @type {!string} */
+ var _str$0;
+ /** @type {Array.<undefined|!number>} */
+ var _suffixarray$0;
+ _str$0 = $this._str = str;
+ $this._size = _str$0.length;
+ _suffixarray$0 = $this._suffixarray = SAIS$make$S(str);
+ $this._head = (_suffixarray$0.indexOf(0) | 0);
+};
+
+var BurrowsWheelerTransform$build$LBurrowsWheelerTransform$S = BurrowsWheelerTransform.build$LBurrowsWheelerTransform$S;
+
+/**
+ * @param {BurrowsWheelerTransform} $this
+ * @param {!number} i
+ * @return {!string}
+ */
+BurrowsWheelerTransform.get$LBurrowsWheelerTransform$I = function ($this, i) {
+ /** @type {!number} */
+ var size;
+ /** @type {!number} */
+ var index;
+ size = $this._size;
+ if (i >= size) {
+ throw new Error("BurrowsWheelerTransform.get() : range error");
+ }
+ index = ($this._suffixarray[i] + size - 1) % size;
+ return $this._str.charAt(index);
+};
+
+var BurrowsWheelerTransform$get$LBurrowsWheelerTransform$I = BurrowsWheelerTransform.get$LBurrowsWheelerTransform$I;
+
+/**
+ * @param {BurrowsWheelerTransform} $this
+ * @return {!string}
+ */
+BurrowsWheelerTransform.get$LBurrowsWheelerTransform$ = function ($this) {
+ /** @type {Array.<undefined|!string>} */
+ var str;
+ /** @type {!number} */
+ var size;
+ /** @type {!number} */
+ var i;
+ str = [ ];
+ size = $this._size;
+ for (i = 0; i < size; i++) {
+ str.push(BurrowsWheelerTransform$get$LBurrowsWheelerTransform$I($this, i));
+ }
+ return str.join("");
+};
+
+var BurrowsWheelerTransform$get$LBurrowsWheelerTransform$ = BurrowsWheelerTransform.get$LBurrowsWheelerTransform$;
+
+/**
+ * @param {BurrowsWheelerTransform} $this
+ * @param {!string} replace
+ * @return {!string}
+ */
+BurrowsWheelerTransform.get$LBurrowsWheelerTransform$S = function ($this, replace) {
+ /** @type {!string} */
+ var result;
+ result = BurrowsWheelerTransform$get$LBurrowsWheelerTransform$($this);
+ return result.replace(BurrowsWheelerTransform.END_MARKER, replace);
+};
+
+var BurrowsWheelerTransform$get$LBurrowsWheelerTransform$S = BurrowsWheelerTransform.get$LBurrowsWheelerTransform$S;
+
+/**
+ * class OArray extends Object
+ * @constructor
+ */
+function OArray() {
+}
+
+/**
+ * @constructor
+ * @param {Array.<undefined|!number>} array
+ */
+function OArray$AI(array) {
+ this.array = array;
+ this.offset = 0;
+};
+
+OArray$AI.prototype = new OArray;
+
+/**
+ * @constructor
+ * @param {Array.<undefined|!number>} array
+ * @param {!number} offset
+ */
+function OArray$AII(array, offset) {
+ this.array = array;
+ this.offset = offset;
+};
+
+OArray$AII.prototype = new OArray;
+
+/**
+ * @param {OArray} $this
+ * @param {!number} index
+ * @return {!number}
+ */
+OArray.get$LOArray$I = function ($this, index) {
+ return $this.array[index + $this.offset];
+};
+
+var OArray$get$LOArray$I = OArray.get$LOArray$I;
+
+/**
+ * @param {OArray} $this
+ * @param {!number} index
+ * @param {!number} value
+ */
+OArray.set$LOArray$II = function ($this, index, value) {
+ $this.array[index + $this.offset] = value;
+};
+
+var OArray$set$LOArray$II = OArray.set$LOArray$II;
+
+/**
+ * @param {OArray} $this
+ * @param {!number} index
+ * @return {!boolean}
+ */
+OArray.isS$LOArray$I = function ($this, index) {
+ /** @type {Array.<undefined|!number>} */
+ var array$0;
+ /** @type {!number} */
+ var offset$0;
+ return (array$0 = $this.array)[index + (offset$0 = $this.offset)] < array$0[index + offset$0 + 1];
+};
+
+var OArray$isS$LOArray$I = OArray.isS$LOArray$I;
+
+/**
+ * @param {OArray} $this
+ * @param {!number} index1
+ * @param {!number} index2
+ * @return {!boolean}
+ */
+OArray.compare$LOArray$II = function ($this, index1, index2) {
+ /** @type {Array.<undefined|!number>} */
+ var array$0;
+ /** @type {!number} */
+ var offset$0;
+ return (array$0 = $this.array)[index1 + (offset$0 = $this.offset)] == array$0[index2 + offset$0];
+};
+
+var OArray$compare$LOArray$II = OArray.compare$LOArray$II;
+
+/**
+ * class SAIS extends Object
+ * @constructor
+ */
+function SAIS() {
+}
+
+/**
+ * @constructor
+ */
+function SAIS$() {
+};
+
+SAIS$.prototype = new SAIS;
+
+/**
+ * @param {BitVector} t
+ * @param {!number} i
+ * @return {!boolean}
+ */
+SAIS._isLMS$LBitVector$I = function (t, i) {
+ return i > 0 && t.get$I(i) && ! t.get$I(i - 1);
+};
+
+var SAIS$_isLMS$LBitVector$I = SAIS._isLMS$LBitVector$I;
+
+/**
+ * @param {OArray} s
+ * @param {Array.<undefined|!number>} bkt
+ * @param {!number} n
+ * @param {!number} K
+ * @param {!boolean} end
+ */
+SAIS._getBuckets$LOArray$AIIIB = function (s, bkt, n, K, end) {
+ /** @type {!number} */
+ var sum;
+ /** @type {!number} */
+ var i;
+ sum = 0;
+ for (i = 0; i <= K; i++) {
+ bkt[i] = 0;
+ }
+ for (i = 0; i < n; i++) {
+ bkt[OArray$get$LOArray$I(s, i)]++;
+ }
+ for (i = 0; i <= K; i++) {
+ sum += bkt[i];
+ bkt[i] = ((end ? sum : sum - bkt[i]) | 0);
+ }
+};
+
+var SAIS$_getBuckets$LOArray$AIIIB = SAIS._getBuckets$LOArray$AIIIB;
+
+/**
+ * @param {BitVector} t
+ * @param {Array.<undefined|!number>} SA
+ * @param {OArray} s
+ * @param {Array.<undefined|!number>} bkt
+ * @param {!number} n
+ * @param {!number} K
+ * @param {!boolean} end
+ */
+SAIS._induceSAl$LBitVector$AILOArray$AIIIB = function (t, SA, s, bkt, n, K, end) {
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var j;
+ SAIS$_getBuckets$LOArray$AIIIB(s, bkt, n, K, end);
+ for (i = 0; i < n; i++) {
+ j = SA[i] - 1;
+ if (j >= 0 && ! t.get$I(j)) {
+ SA[bkt[OArray$get$LOArray$I(s, j)]++] = (j | 0);
+ }
+ }
+};
+
+var SAIS$_induceSAl$LBitVector$AILOArray$AIIIB = SAIS._induceSAl$LBitVector$AILOArray$AIIIB;
+
+/**
+ * @param {BitVector} t
+ * @param {Array.<undefined|!number>} SA
+ * @param {OArray} s
+ * @param {Array.<undefined|!number>} bkt
+ * @param {!number} n
+ * @param {!number} K
+ * @param {!boolean} end
+ */
+SAIS._induceSAs$LBitVector$AILOArray$AIIIB = function (t, SA, s, bkt, n, K, end) {
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var j;
+ SAIS$_getBuckets$LOArray$AIIIB(s, bkt, n, K, end);
+ for (i = n - 1; i >= 0; i--) {
+ j = SA[i] - 1;
+ if (j >= 0 && t.get$I(j)) {
+ SA[-- bkt[OArray$get$LOArray$I(s, j)]] = (j | 0);
+ }
+ }
+};
+
+var SAIS$_induceSAs$LBitVector$AILOArray$AIIIB = SAIS._induceSAs$LBitVector$AILOArray$AIIIB;
+
+/**
+ * @param {!string} source
+ * @return {Array.<undefined|!number>}
+ */
+SAIS.make$S = function (source) {
+ /** @type {Array.<undefined|!number>} */
+ var charCodes;
+ /** @type {!number} */
+ var maxCode;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var code;
+ /** @type {Array.<undefined|!number>} */
+ var SA;
+ /** @type {OArray} */
+ var s;
+ charCodes = [ ];
+ charCodes.length = source.length;
+ maxCode = 0;
+ for (i = 0; i < source.length; i++) {
+ code = source.charCodeAt(i);
+ charCodes[i] = (code | 0);
+ maxCode = (code > maxCode ? code : maxCode);
+ }
+ SA = [ ];
+ SA.length = source.length;
+ s = ({offset: 0, array: charCodes});
+ SAIS$_make$LOArray$AIII(s, SA, source.length, maxCode);
+ return SA;
+};
+
+var SAIS$make$S = SAIS.make$S;
+
+/**
+ * @param {OArray} s
+ * @param {Array.<undefined|!number>} SA
+ * @param {!number} n
+ * @param {!number} K
+ */
+SAIS._make$LOArray$AIII = function (s, SA, n, K) {
+ /** @type {BitVector} */
+ var t;
+ /** @type {!number} */
+ var i;
+ /** @type {Array.<undefined|!number>} */
+ var bkt;
+ /** @type {!number} */
+ var n1;
+ /** @type {!number} */
+ var name;
+ /** @type {!number} */
+ var prev;
+ /** @type {undefined|!number} */
+ var pos;
+ /** @type {!boolean} */
+ var diff;
+ /** @type {!number} */
+ var d;
+ /** @type {!number} */
+ var j;
+ /** @type {Array.<undefined|!number>} */
+ var SA1;
+ /** @type {OArray} */
+ var s1;
+ /** @type {!number} */
+ var i$0;
+ /** @type {!number} */
+ var index$0;
+ t = new BitVector$();
+ t.set$IB(n - 2, false);
+ t.set$IB(n - 1, true);
+ for (i = n - 3; i >= 0; i--) {
+ t.set$IB(i, OArray$isS$LOArray$I(s, i) || OArray$compare$LOArray$II(s, i, i + 1) && t.get$I(i + 1));
+ }
+ bkt = [ ];
+ bkt.length = K + 1;
+ SAIS$_getBuckets$LOArray$AIIIB(s, bkt, n, K, true);
+ for (i = 0; i < n; i++) {
+ SA[i] = -1;
+ }
+ for (i = 1; i < n; i++) {
+ if (SAIS$_isLMS$LBitVector$I(t, i)) {
+ SA[-- bkt[OArray$get$LOArray$I(s, i)]] = (i | 0);
+ }
+ }
+ SAIS$_induceSAl$LBitVector$AILOArray$AIIIB(t, SA, s, bkt, n, K, false);
+ SAIS$_induceSAs$LBitVector$AILOArray$AIIIB(t, SA, s, bkt, n, K, true);
+ n1 = 0;
+ for (i = 0; i < n; i++) {
+ i$0 = SA[i];
+ if (i$0 > 0 && t.get$I(i$0) && ! t.get$I(i$0 - 1)) {
+ SA[n1++] = SA[i];
+ }
+ }
+ for (i = n1; i < n; i++) {
+ SA[i] = -1;
+ }
+ name = 0;
+ prev = -1;
+ for (i = 0; i < n1; i++) {
+ pos = SA[i];
+ diff = false;
+ for (d = 0; d < n; d++) {
+ if (prev === -1 || ! OArray$compare$LOArray$II(s, pos + d, prev + d) || t.get$I(pos + d) !== t.get$I(prev + d)) {
+ diff = true;
+ break;
+ } else {
+ if (d > 0 && (SAIS$_isLMS$LBitVector$I(t, pos + d) || SAIS$_isLMS$LBitVector$I(t, prev + d))) {
+ break;
+ }
+ }
+ }
+ if (diff) {
+ name++;
+ prev = pos;
+ }
+ pos = ((pos % 2 === 0 ? pos / 2 : (pos - 1) / 2) | 0);
+ SA[n1 + pos] = (name - 1 | 0);
+ }
+ for ((i = n - 1, j = n - 1); i >= n1; i--) {
+ if (SA[i] >= 0) {
+ SA[j--] = SA[i];
+ }
+ }
+ SA1 = SA;
+ s1 = ({offset: n - n1, array: SA});
+ if (name < n1) {
+ SAIS$_make$LOArray$AIII(s1, SA1, n1, name - 1);
+ } else {
+ for (i = 0; i < n1; i++) {
+ SA1[OArray$get$LOArray$I(s1, i)] = (i | 0);
+ }
+ }
+ bkt = [ ];
+ bkt.length = K + 1;
+ SAIS$_getBuckets$LOArray$AIIIB(s, bkt, n, K, true);
+ for ((i = 1, j = 0); i < n; i++) {
+ if (SAIS$_isLMS$LBitVector$I(t, i)) {
+ OArray$set$LOArray$II(s1, j++, i);
+ }
+ }
+ for (i = 0; i < n1; i++) {
+ index$0 = SA1[i];
+ SA1[i] = s1.array[index$0 + s1.offset];
+ }
+ for (i = n1; i < n; i++) {
+ SA[i] = -1;
+ }
+ for (i = n1 - 1; i >= 0; i--) {
+ j = SA[i];
+ SA[i] = -1;
+ SA[-- bkt[OArray$get$LOArray$I(s, j)]] = (j | 0);
+ }
+ SAIS$_induceSAl$LBitVector$AILOArray$AIIIB(t, SA, s, bkt, n, K, false);
+ SAIS$_induceSAs$LBitVector$AILOArray$AIIIB(t, SA, s, bkt, n, K, true);
+};
+
+var SAIS$_make$LOArray$AIII = SAIS._make$LOArray$AIII;
+
+OktaviaSearch._stemmer = null;
+OktaviaSearch._instance = null;
+$__jsx_lazy_init(Oktavia, "eof", function () {
+ return String.fromCharCode(0);
+});
+$__jsx_lazy_init(Oktavia, "eob", function () {
+ return String.fromCharCode(1);
+});
+$__jsx_lazy_init(Oktavia, "unknown", function () {
+ return String.fromCharCode(3);
+});
+Binary._base64EncodeChars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
+$__jsx_lazy_init(Binary, "_base64DecodeChars", function () {
+ return [ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 62, -1, -1, -1, 63, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, -1, -1, -1, -1, -1, -1, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -1, -1, -1, -1, -1, -1, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, -1, -1, -1, -1 ];
+});
+$__jsx_lazy_init(Style, "console", function () {
+ return ({ 'title': [ '\x1B[32m\x1b[4m', '\x1B[39m\x1b[0m' ], 'url': [ '\x1B[34m', '\x1B[39m' ], 'hit': [ '\x1B[4m', '\x1B[0m' ], 'del': [ '\x1B[9m', '\x1B[0m' ], 'summary': [ '\x1B[90m', '\x1B[39m' ] });
+});
+$__jsx_lazy_init(Style, "html", function () {
+ return ({ 'title': [ '<span class="title">', '</span>' ], 'url': [ '<span class="url">', '</span>' ], 'hit': [ '<span class="hit">', '</span>' ], 'del': [ '<del>', '</del>' ], 'summary': [ '<span class="reuslt">', '</span>' ] });
+});
+$__jsx_lazy_init(Style, "ignore", function () {
+ return ({ 'tilte': [ '', '' ], 'url': [ '', '' ], 'hit': [ '', '' ], 'del': [ '', '' ], 'summary': [ '', '' ] });
+});
+PorterStemmer.serialVersionUID = 1;
+$__jsx_lazy_init(PorterStemmer, "methodObject", function () {
+ return new PorterStemmer$();
+});
+$__jsx_lazy_init(PorterStemmer, "a_0", function () {
+ return [ new Among$SII("s", -1, 3), new Among$SII("ies", 0, 2), new Among$SII("sses", 0, 1), new Among$SII("ss", 0, -1) ];
+});
+$__jsx_lazy_init(PorterStemmer, "a_1", function () {
+ return [ new Among$SII("", -1, 3), new Among$SII("bb", 0, 2), new Among$SII("dd", 0, 2), new Among$SII("ff", 0, 2), new Among$SII("gg", 0, 2), new Among$SII("bl", 0, 1), new Among$SII("mm", 0, 2), new Among$SII("nn", 0, 2), new Among$SII("pp", 0, 2), new Among$SII("rr", 0, 2), new Among$SII("at", 0, 1), new Among$SII("tt", 0, 2), new Among$SII("iz", 0, 1) ];
+});
+$__jsx_lazy_init(PorterStemmer, "a_2", function () {
+ return [ new Among$SII("ed", -1, 2), new Among$SII("eed", 0, 1), new Among$SII("ing", -1, 2) ];
+});
+$__jsx_lazy_init(PorterStemmer, "a_3", function () {
+ return [ new Among$SII("anci", -1, 3), new Among$SII("enci", -1, 2), new Among$SII("abli", -1, 4), new Among$SII("eli", -1, 6), new Among$SII("alli", -1, 9), new Among$SII("ousli", -1, 12), new Among$SII("entli", -1, 5), new Among$SII("aliti", -1, 10), new Among$SII("biliti", -1, 14), new Among$SII("iviti", -1, 13), new Among$SII("tional", -1, 1), new Among$SII("ational", 10, 8), new Among$SII("alism", -1, 10), new Among$SII("ation", -1, 8), new Among$SII("ization", 13, 7), new Among$SII("izer", -1, 7), new Among$SII("ator", -1, 8), new Among$SII("iveness", -1, 13), new Among$SII("fulness", -1, 11), new Among$SII("ousness", -1, 12) ];
+});
+$__jsx_lazy_init(PorterStemmer, "a_4", function () {
+ return [ new Among$SII("icate", -1, 2), new Among$SII("ative", -1, 3), new Among$SII("alize", -1, 1), new Among$SII("iciti", -1, 2), new Among$SII("ical", -1, 2), new Among$SII("ful", -1, 3), new Among$SII("ness", -1, 3) ];
+});
+$__jsx_lazy_init(PorterStemmer, "a_5", function () {
+ return [ new Among$SII("ic", -1, 1), new Among$SII("ance", -1, 1), new Among$SII("ence", -1, 1), new Among$SII("able", -1, 1), new Among$SII("ible", -1, 1), new Among$SII("ate", -1, 1), new Among$SII("ive", -1, 1), new Among$SII("ize", -1, 1), new Among$SII("iti", -1, 1), new Among$SII("al", -1, 1), new Among$SII("ism", -1, 1), new Among$SII("ion", -1, 2), new Among$SII("er", -1, 1), new Among$SII("ous", -1, 1), new Among$SII("ant", -1, 1), new Among$SII("ent", -1, 1), new Among$SII("ment", 15, 1), new Among$SII("ement", 16, 1), new Among$SII("ou", -1, 1) ];
+});
+$__jsx_lazy_init(PorterStemmer, "g_v", function () {
+ return [ 17, 65, 16, 1 ];
+});
+$__jsx_lazy_init(PorterStemmer, "g_v_WXY", function () {
+ return [ 1, 17, 65, 208, 1 ];
+});
+$__jsx_lazy_init(_Common, "buffers", function () {
+ return [ "comment", "sgmlDecl", "textNode", "tagName", "doctype", "procInstName", "procInstBody", "entity", "attribName", "attribValue", "cdata", "script" ];
+});
+$__jsx_lazy_init(_Common, "EVENTS", function () {
+ return [ "text", "processinginstruction", "sgmldeclaration", "doctype", "comment", "attribute", "opentag", "closetag", "opencdata", "cdata", "clo_State.CDATA", "error", "end", "ready", "script", "opennamespace", "closenamespace" ];
+});
+_Common.MAX_BUFFER_LENGTH = 65536;
+_State.BEGIN = 1;
+_State.TEXT = 2;
+_State.TEXT_ENTITY = 3;
+_State.OPEN_WAKA = 4;
+_State.SGML_DECL = 5;
+_State.SGML_DECL_QUOTED = 6;
+_State.DOCTYPE = 7;
+_State.DOCTYPE_QUOTED = 8;
+_State.DOCTYPE_DTD = 9;
+_State.DOCTYPE_DTD_QUOTED = 10;
+_State.COMMENT_STARTING = 11;
+_State.COMMENT = 12;
+_State.COMMENT_ENDING = 13;
+_State.COMMENT_ENDED = 14;
+_State.CDATA = 15;
+_State.CDATA_ENDING = 16;
+_State.CDATA_ENDING_2 = 17;
+_State.PROC_INST = 18;
+_State.PROC_INST_BODY = 19;
+_State.PROC_INST_ENDING = 20;
+_State.OPEN_TAG = 21;
+_State.OPEN_TAG_SLASH = 22;
+_State.ATTRIB = 23;
+_State.ATTRIB_NAME = 24;
+_State.ATTRIB_NAME_SAW_WHITE = 25;
+_State.ATTRIB_VALUE = 26;
+_State.ATTRIB_VALUE_QUOTED = 27;
+_State.ATTRIB_VALUE_UNQUOTED = 28;
+_State.ATTRIB_VALUE_ENTITY_Q = 29;
+_State.ATTRIB_VALUE_ENTITY_U = 30;
+_State.CLOSE_TAG = 31;
+_State.CLOSE_TAG_SAW_WHITE = 32;
+_State.SCRIPT = 33;
+_State.SCRIPT_ENDING = 34;
+$__jsx_lazy_init(_Entities, "_entities", function () {
+ return ({ "amp": "&", "gt": ">", "lt": "<", "quot": "\"", "apos": "'", "AElig": 198, "Aacute": 193, "Acirc": 194, "Agrave": 192, "Aring": 197, "Atilde": 195, "Auml": 196, "Ccedil": 199, "ETH": 208, "Eacute": 201, "Ecirc": 202, "Egrave": 200, "Euml": 203, "Iacute": 205, "Icirc": 206, "Igrave": 204, "Iuml": 207, "Ntilde": 209, "Oacute": 211, "Ocirc": 212, "Ograve": 210, "Oslash": 216, "Otilde": 213, "Ouml": 214, "THORN": 222, "Uacute": 218, "Ucirc": 219, "Ugrave": 217, "Uuml": 220, "Yacute": 221, "aacute": 225, "acirc": 226, "aelig": 230, "agrave": 224, "aring": 229, "atilde": 227, "auml": 228, "ccedil": 231, "eacute": 233, "ecirc": 234, "egrave": 232, "eth": 240, "euml": 235, "iacute": 237, "icirc": 238, "igrave": 236, "iuml": 239, "ntilde": 241, "oacute": 243, "ocirc": 244, "ograve": 242, "oslash": 248, "otilde": 245, "ouml": 246, "szlig": 223, "thorn": 254, "uacute": 250, "ucirc": 251, "ugrave": 249, "uuml": 252, "yacute": 253, "yuml": 255, "copy": 169, "reg": 174, "nbsp": 160, "iexcl": 161, "cent": 162, "pound": 163, "curren": 164, "yen": 165, "brvbar": 166, "sect": 167, "uml": 168, "ordf": 170, "laquo": 171, "not": 172, "shy": 173, "macr": 175, "deg": 176, "plusmn": 177, "sup1": 185, "sup2": 178, "sup3": 179, "acute": 180, "micro": 181, "para": 182, "middot": 183, "cedil": 184, "ordm": 186, "raquo": 187, "frac14": 188, "frac12": 189, "frac34": 190, "iquest": 191, "times": 215, "divide": 247, "OElig": 338, "oelig": 339, "Scaron": 352, "scaron": 353, "Yuml": 376, "fnof": 402, "circ": 710, "tilde": 732, "Alpha": 913, "Beta": 914, "Gamma": 915, "Delta": 916, "Epsilon": 917, "Zeta": 918, "Eta": 919, "Theta": 920, "Iota": 921, "Kappa": 922, "Lambda": 923, "Mu": 924, "Nu": 925, "Xi": 926, "Omicron": 927, "Pi": 928, "Rho": 929, "Sigma": 931, "Tau": 932, "Upsilon": 933, "Phi": 934, "Chi": 935, "Psi": 936, "Omega": 937, "alpha": 945, "beta": 946, "gamma": 947, "delta": 948, "epsilon": 949, "zeta": 950, "eta": 951, "theta": 952, "iota": 953, "kappa": 954, "lambda": 955, "mu": 956, "nu": 957, "xi": 958, "omicron": 959, "pi": 960, "rho": 961, "sigmaf": 962, "sigma": 963, "tau": 964, "upsilon": 965, "phi": 966, "chi": 967, "psi": 968, "omega": 969, "thetasym": 977, "upsih": 978, "piv": 982, "ensp": 8194, "emsp": 8195, "thinsp": 8201, "zwnj": 8204, "zwj": 8205, "lrm": 8206, "rlm": 8207, "ndash": 8211, "mdash": 8212, "lsquo": 8216, "rsquo": 8217, "sbquo": 8218, "ldquo": 8220, "rdquo": 8221, "bdquo": 8222, "dagger": 8224, "Dagger": 8225, "bull": 8226, "hellip": 8230, "permil": 8240, "prime": 8242, "Prime": 8243, "lsaquo": 8249, "rsaquo": 8250, "oline": 8254, "frasl": 8260, "euro": 8364, "image": 8465, "weierp": 8472, "real": 8476, "trade": 8482, "alefsym": 8501, "larr": 8592, "uarr": 8593, "rarr": 8594, "darr": 8595, "harr": 8596, "crarr": 8629, "lArr": 8656, "uArr": 8657, "rArr": 8658, "dArr": 8659, "hArr": 8660, "forall": 8704, "part": 8706, "exist": 8707, "empty": 8709, "nabla": 8711, "isin": 8712, "notin": 8713, "ni": 8715, "prod": 8719, "sum": 8721, "minus": 8722, "lowast": 8727, "radic": 8730, "prop": 8733, "infin": 8734, "ang": 8736, "and": 8743, "or": 8744, "cap": 8745, "cup": 8746, "int": 8747, "there4": 8756, "sim": 8764, "cong": 8773, "asymp": 8776, "ne": 8800, "equiv": 8801, "le": 8804, "ge": 8805, "sub": 8834, "sup": 8835, "nsub": 8836, "sube": 8838, "supe": 8839, "oplus": 8853, "otimes": 8855, "perp": 8869, "sdot": 8901, "lceil": 8968, "rceil": 8969, "lfloor": 8970, "rfloor": 8971, "lang": 9001, "rang": 9002, "loz": 9674, "spades": 9824, "clubs": 9827, "hearts": 9829, "diams": 9830 });
+});
+BitVector.SMALL_BLOCK_SIZE = 32;
+BitVector.LARGE_BLOCK_SIZE = 256;
+BitVector.BLOCK_RATE = 8;
+$__jsx_lazy_init(BurrowsWheelerTransform, "END_MARKER", function () {
+ return String.fromCharCode(0);
+});
+var $__jsx_classMap = {
+ "tool/web/oktavia-porter-search.jsx": {
+ _Main: _Main,
+ _Main$: _Main$
+ },
+ "tool/web/oktavia-search.jsx": {
+ _Result: _Result,
+ _Result$SSSI: _Result$SSSI,
+ _Proposal: _Proposal,
+ _Proposal$SSI: _Proposal$SSI,
+ OktaviaSearch: OktaviaSearch,
+ OktaviaSearch$I: OktaviaSearch$I,
+ _Main: _Main$0,
+ _Main$: _Main$0$
+ },
+ "src/oktavia.jsx": {
+ Oktavia: Oktavia,
+ Oktavia$: Oktavia$
+ },
+ "src/binary-util.jsx": {
+ Binary: Binary,
+ Binary$: Binary$,
+ LoadedStringResult: LoadedStringResult,
+ LoadedStringResult$SI: LoadedStringResult$SI,
+ LoadedStringListResult: LoadedStringListResult,
+ LoadedStringListResult$SI: LoadedStringListResult$SI,
+ LoadedStringListMapResult: LoadedStringListMapResult,
+ LoadedStringListMapResult$SI: LoadedStringListMapResult$SI,
+ LoadedNumberListResult: LoadedNumberListResult,
+ LoadedNumberListResult$SI: LoadedNumberListResult$SI,
+ CompressionReport: CompressionReport,
+ CompressionReport$: CompressionReport$
+ },
+ "src/query.jsx": {
+ Query: Query,
+ Query$: Query$
+ },
+ "src/query-string-parser.jsx": {
+ QueryStringParser: QueryStringParser,
+ QueryStringParser$: QueryStringParser$
+ },
+ "src/search-result.jsx": {
+ Proposal: Proposal,
+ Proposal$II: Proposal$II,
+ Position: Position,
+ Position$SIB: Position$SIB,
+ SearchUnit: SearchUnit,
+ SearchUnit$I: SearchUnit$I,
+ SingleResult: SingleResult,
+ SingleResult$: SingleResult$,
+ SingleResult$SBB: SingleResult$SBB,
+ SearchSummary: SearchSummary,
+ SearchSummary$: SearchSummary$,
+ SearchSummary$LOktavia$: SearchSummary$LOktavia$
+ },
+ "src/style.jsx": {
+ Style: Style,
+ Style$S: Style$S,
+ _HTMLHandler: _HTMLHandler,
+ _HTMLHandler$HASB: _HTMLHandler$HASB
+ },
+ "src/stemmer/stemmer.jsx": {
+ Stemmer: Stemmer,
+ Stemmer$: Stemmer$
+ },
+ "src/stemmer/base-stemmer.jsx": {
+ BaseStemmer: BaseStemmer,
+ BaseStemmer$: BaseStemmer$
+ },
+ "src/stemmer/porter-stemmer.jsx": {
+ PorterStemmer: PorterStemmer,
+ PorterStemmer$: PorterStemmer$
+ },
+ "src/stemmer/among.jsx": {
+ Among: Among,
+ Among$SII: Among$SII,
+ Among$SIIF$LBaseStemmer$B$LBaseStemmer$: Among$SIIF$LBaseStemmer$B$LBaseStemmer$
+ },
+ "src/metadata.jsx": {
+ Metadata: Metadata,
+ Metadata$LOktavia$: Metadata$LOktavia$,
+ Section: Section,
+ Section$LOktavia$: Section$LOktavia$,
+ Splitter: Splitter,
+ Splitter$LOktavia$: Splitter$LOktavia$,
+ Splitter$LOktavia$S: Splitter$LOktavia$S,
+ Table: Table,
+ Table$LOktavia$AS: Table$LOktavia$AS,
+ Block: Block,
+ Block$LOktavia$: Block$LOktavia$
+ },
+ "src/fm-index.jsx": {
+ FMIndex: FMIndex,
+ FMIndex$: FMIndex$
+ },
+ "src/sax.jsx": {
+ Tag: Tag,
+ Tag$S: Tag$S,
+ _Common: _Common,
+ _Common$: _Common$,
+ _State: _State,
+ _State$: _State$,
+ SAXHandler: SAXHandler,
+ SAXHandler$: SAXHandler$,
+ SAXParser: SAXParser,
+ SAXParser$LSAXHandler$: SAXParser$LSAXHandler$,
+ SAXParser$LSAXHandler$B: SAXParser$LSAXHandler$B,
+ Char: Char,
+ Char$: Char$,
+ _Entities: _Entities,
+ _Entities$: _Entities$
+ },
+ "src/bit-vector.jsx": {
+ BitVector: BitVector,
+ BitVector$: BitVector$
+ },
+ "src/wavelet-matrix.jsx": {
+ WaveletMatrix: WaveletMatrix,
+ WaveletMatrix$: WaveletMatrix$
+ },
+ "src/burrows-wheeler-transform.jsx": {
+ BurrowsWheelerTransform: BurrowsWheelerTransform,
+ BurrowsWheelerTransform$: BurrowsWheelerTransform$
+ },
+ "src/sais.jsx": {
+ OArray: OArray,
+ OArray$AI: OArray$AI,
+ OArray$AII: OArray$AII,
+ SAIS: SAIS,
+ SAIS$: SAIS$
+ }
+};
+
+
+/**
+ * launches _Main.main(:string[]):void invoked by jsx --run|--executable
+ */
+JSX.runMain = function (sourceFile, args) {
+ var module = JSX.require(sourceFile);
+ if (! module) {
+ throw new ReferenceError("entry point module not found in " + sourceFile);
+ }
+ if (! module._Main) {
+ throw new ReferenceError("entry point _Main not found in " + sourceFile);
+ }
+ if (! module._Main.main$AS) {
+ throw new ReferenceError("entry point _Main.main(:string[]):void not found in " + sourceFile);
+ }
+ module._Main.main$AS(args);
+};
+
+/**
+ * launches _Test#test*():void invoked by jsx --test
+ */
+JSX.runTests = function (sourceFile, tests) {
+ var module = JSX.require(sourceFile);
+ var testClass = module._Test$;
+
+ if (!testClass) return; // skip if there's no test class
+
+ if(tests.length === 0) {
+ var p = testClass.prototype;
+ for (var m in p) {
+ if (p[m] instanceof Function
+ && /^test.*[$]$/.test(m)) {
+ tests.push(m);
+ }
+ }
+ }
+ else { // set as process arguments
+ tests = tests.map(function (name) {
+ return name + "$"; // mangle for function test*():void
+ });
+ }
+
+ var testCase = new testClass();
+
+ if (testCase.beforeClass$AS != null)
+ testCase.beforeClass$AS(tests);
+
+ for (var i = 0; i < tests.length; ++i) {
+ (function (method) {
+ if (method in testCase) {
+ testCase.run$SF$V$(method, function() { testCase[method](); });
+ }
+ else {
+ throw new ReferenceError("No such test method: " + method);
+ }
+ }(tests[i]));
+ }
+
+ if (testCase.afterClass$ != null)
+ testCase.afterClass$();
+};
+/**
+ * call a function on load/DOMContentLoaded
+ */
+function $__jsx_onload (event) {
+ window.removeEventListener("load", $__jsx_onload);
+ document.removeEventListener("DOMContentLoaded", $__jsx_onload);
+ JSX.runMain("tool/web/oktavia-porter-search.jsx", [])
+}
+
+window.addEventListener("load", $__jsx_onload);
+document.addEventListener("DOMContentLoaded", $__jsx_onload);
+
+})(JSX);
diff --git a/web/server/h2o/libh2o/misc/oktavia/lib/oktavia-portuguese-search.js b/web/server/h2o/libh2o/misc/oktavia/lib/oktavia-portuguese-search.js
new file mode 100644
index 00000000..1c9a0d53
--- /dev/null
+++ b/web/server/h2o/libh2o/misc/oktavia/lib/oktavia-portuguese-search.js
@@ -0,0 +1,8566 @@
+// generatedy by JSX compiler 0.9.24 (2013-04-05 13:45:00 +0900; 1b229cc6a411f674f0f7cf7a79b7a8b3f8eb7414)
+var JSX = {};
+(function (JSX) {
+/**
+ * copies the implementations from source interface to target
+ */
+function $__jsx_merge_interface(target, source) {
+ for (var k in source.prototype)
+ if (source.prototype.hasOwnProperty(k))
+ target.prototype[k] = source.prototype[k];
+}
+
+/**
+ * defers the initialization of the property
+ */
+function $__jsx_lazy_init(obj, prop, func) {
+ function reset(obj, prop, value) {
+ delete obj[prop];
+ obj[prop] = value;
+ return value;
+ }
+
+ Object.defineProperty(obj, prop, {
+ get: function () {
+ return reset(obj, prop, func());
+ },
+ set: function (v) {
+ reset(obj, prop, v);
+ },
+ enumerable: true,
+ configurable: true
+ });
+}
+
+/**
+ * sideeffect().a /= b
+ */
+function $__jsx_div_assign(obj, prop, divisor) {
+ return obj[prop] = (obj[prop] / divisor) | 0;
+}
+
+/*
+ * global functions, renamed to avoid conflict with local variable names
+ */
+var $__jsx_parseInt = parseInt;
+var $__jsx_parseFloat = parseFloat;
+var $__jsx_isNaN = isNaN;
+var $__jsx_isFinite = isFinite;
+
+var $__jsx_encodeURIComponent = encodeURIComponent;
+var $__jsx_decodeURIComponent = decodeURIComponent;
+var $__jsx_encodeURI = encodeURI;
+var $__jsx_decodeURI = decodeURI;
+
+var $__jsx_ObjectToString = Object.prototype.toString;
+var $__jsx_ObjectHasOwnProperty = Object.prototype.hasOwnProperty;
+
+/*
+ * profiler object, initialized afterwards
+ */
+function $__jsx_profiler() {
+}
+
+/*
+ * public interface to JSX code
+ */
+JSX.require = function (path) {
+ var m = $__jsx_classMap[path];
+ return m !== undefined ? m : null;
+};
+
+JSX.profilerIsRunning = function () {
+ return $__jsx_profiler.getResults != null;
+};
+
+JSX.getProfileResults = function () {
+ return ($__jsx_profiler.getResults || function () { return {}; })();
+};
+
+JSX.postProfileResults = function (url, cb) {
+ if ($__jsx_profiler.postResults == null)
+ throw new Error("profiler has not been turned on");
+ return $__jsx_profiler.postResults(url, cb);
+};
+
+JSX.resetProfileResults = function () {
+ if ($__jsx_profiler.resetResults == null)
+ throw new Error("profiler has not been turned on");
+ return $__jsx_profiler.resetResults();
+};
+JSX.DEBUG = false;
+/**
+ * class _Main extends Object
+ * @constructor
+ */
+function _Main() {
+}
+
+/**
+ * @constructor
+ */
+function _Main$() {
+};
+
+_Main$.prototype = new _Main;
+
+/**
+ * @param {Array.<undefined|!string>} args
+ */
+_Main.main$AS = function (args) {
+ OktaviaSearch$setStemmer$LStemmer$(new PortugueseStemmer$());
+};
+
+var _Main$main$AS = _Main.main$AS;
+
+/**
+ * class _Result extends Object
+ * @constructor
+ */
+function _Result() {
+}
+
+/**
+ * @constructor
+ * @param {!string} title
+ * @param {!string} url
+ * @param {!string} content
+ * @param {!number} score
+ */
+function _Result$SSSI(title, url, content, score) {
+ this.title = title;
+ this.url = url;
+ this.content = content;
+ this.score = score;
+};
+
+_Result$SSSI.prototype = new _Result;
+
+/**
+ * class _Proposal extends Object
+ * @constructor
+ */
+function _Proposal() {
+}
+
+/**
+ * @constructor
+ * @param {!string} options
+ * @param {!string} label
+ * @param {!number} count
+ */
+function _Proposal$SSI(options, label, count) {
+ this.options = options;
+ this.label = label;
+ this.count = count;
+};
+
+_Proposal$SSI.prototype = new _Proposal;
+
+/**
+ * class OktaviaSearch extends Object
+ * @constructor
+ */
+function OktaviaSearch() {
+}
+
+/**
+ * @constructor
+ * @param {!number} entriesPerPage
+ */
+function OktaviaSearch$I(entriesPerPage) {
+ this._queries = null;
+ this._highlight = "";
+ this._result = null;
+ this._proposals = null;
+ this._currentFolderDepth = 0;
+ this._oktavia = new Oktavia$();
+ this._entriesPerPage = entriesPerPage;
+ this._currentPage = 1;
+ this._queryString = null;
+ this._callback = null;
+ OktaviaSearch._instance = this;
+};
+
+OktaviaSearch$I.prototype = new OktaviaSearch;
+
+/**
+ * @param {Stemmer} stemmer
+ */
+OktaviaSearch.setStemmer$LStemmer$ = function (stemmer) {
+ /** @type {Oktavia} */
+ var this$0;
+ if (OktaviaSearch._instance) {
+ this$0 = OktaviaSearch._instance._oktavia;
+ this$0._stemmer = stemmer;
+ } else {
+ OktaviaSearch._stemmer = stemmer;
+ }
+};
+
+var OktaviaSearch$setStemmer$LStemmer$ = OktaviaSearch.setStemmer$LStemmer$;
+
+/**
+ * @param {!string} index
+ */
+OktaviaSearch.prototype.loadIndex$S = function (index) {
+ /** @type {Oktavia} */
+ var this$0;
+ /** @type {Stemmer} */
+ var stemmer$0;
+ if (OktaviaSearch._stemmer) {
+ this$0 = this._oktavia;
+ stemmer$0 = OktaviaSearch._stemmer;
+ this$0._stemmer = stemmer$0;
+ }
+ this._oktavia.load$S(Binary$base64decode$S(index));
+ if (this._queryString) {
+ this.search$SF$IIV$(this._queryString, this._callback);
+ this._queryString = null;
+ this._callback = null;
+ }
+};
+
+/**
+ * @param {!string} queryString
+ * @param {*} callback
+ */
+OktaviaSearch.prototype.search$SF$IIV$ = function (queryString, callback) {
+ /** @type {QueryStringParser} */
+ var queryParser;
+ /** @type {SearchSummary} */
+ var summary;
+ /** @type {Array.<undefined|SearchUnit>} */
+ var _result$0;
+ if (this._oktavia) {
+ queryParser = ({queries: [ ]});
+ this._queries = QueryStringParser$parse$LQueryStringParser$S(queryParser, queryString);
+ this._highlight = QueryStringParser$highlight$LQueryStringParser$(queryParser);
+ summary = this._oktavia.search$ALQuery$(this._queries);
+ if (SearchSummary$size$LSearchSummary$(summary) > 0) {
+ this._result = this._sortResult$LSearchSummary$(summary);
+ this._proposals = [ ];
+ this._currentPage = 1;
+ } else {
+ this._result = [ ];
+ if (this._queries.length > 1) {
+ this._proposals = SearchSummary$getProposal$LSearchSummary$(summary);
+ } else {
+ this._proposals = [ ];
+ }
+ this._currentPage = 1;
+ }
+ callback((_result$0 = this._result).length, Math.ceil(_result$0.length / this._entriesPerPage));
+ } else {
+ this._queryString = queryString;
+ this._callback = callback;
+ }
+};
+
+/**
+ * @return {!number}
+ */
+OktaviaSearch.prototype.resultSize$ = function () {
+ return (this._result.length | 0);
+};
+
+/**
+ * @return {!number}
+ */
+OktaviaSearch.prototype.totalPages$ = function () {
+ return (Math.ceil(this._result.length / this._entriesPerPage) | 0);
+};
+
+/**
+ * @return {!number}
+ */
+OktaviaSearch.prototype.currentPage$ = function () {
+ return this._currentPage;
+};
+
+/**
+ * @param {!number} page
+ */
+OktaviaSearch.prototype.setCurrentPage$I = function (page) {
+ this._currentPage = page;
+};
+
+/**
+ * @return {!boolean}
+ */
+OktaviaSearch.prototype.hasPrevPage$ = function () {
+ return this._currentPage !== 1;
+};
+
+/**
+ * @return {!boolean}
+ */
+OktaviaSearch.prototype.hasNextPage$ = function () {
+ return this._currentPage !== Math.ceil(this._result.length / this._entriesPerPage);
+};
+
+/**
+ * @return {Array.<undefined|!string>}
+ */
+OktaviaSearch.prototype.pageIndexes$ = function () {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var total;
+ /** @type {!number} */
+ var i;
+ result = [ ];
+ total = Math.ceil(this._result.length / this._entriesPerPage);
+ if (total < 10) {
+ for (i = 1; i <= total; i++) {
+ result.push(i + "");
+ }
+ } else {
+ if (this._currentPage <= 5) {
+ for (i = 1; i <= 7; i++) {
+ result.push(i + "");
+ }
+ result.push('...', total + "");
+ } else {
+ if (total - 5 <= this._currentPage) {
+ result.push('1', '...');
+ for (i = total - 8; i <= total; i++) {
+ result.push(i + "");
+ }
+ } else {
+ result.push('1', '...');
+ for (i = this._currentPage - 3; i <= this._currentPage + 3; i++) {
+ result.push(i + "");
+ }
+ result.push('...', total + "");
+ }
+ }
+ }
+ return result;
+};
+
+/**
+ * @return {Array.<undefined|_Result>}
+ */
+OktaviaSearch.prototype.getResult$ = function () {
+ /** @type {Style} */
+ var style;
+ /** @type {!number} */
+ var start;
+ /** @type {!number} */
+ var last;
+ /** @type {Metadata} */
+ var metadata;
+ /** @type {!number} */
+ var num;
+ /** @type {Array.<undefined|_Result>} */
+ var results;
+ /** @type {!number} */
+ var i;
+ /** @type {SearchUnit} */
+ var unit;
+ /** @type {Array.<undefined|!string>} */
+ var info;
+ /** @type {!string} */
+ var content;
+ /** @type {Array.<undefined|Position>} */
+ var positions;
+ /** @type {!number} */
+ var end;
+ /** @type {!boolean} */
+ var split;
+ /** @type {!number} */
+ var j;
+ /** @type {Position} */
+ var pos;
+ /** @type {!string} */
+ var text;
+ /** @type {Oktavia} */
+ var this$0;
+ /** @type {!number} */
+ var position$0;
+ /** @type {!number} */
+ var _currentPage$0;
+ /** @type {!number} */
+ var _entriesPerPage$0;
+ style = new Style$S('html');
+ start = ((_currentPage$0 = this._currentPage) - 1) * (_entriesPerPage$0 = this._entriesPerPage);
+ last = Math.min(_currentPage$0 * _entriesPerPage$0, this._result.length);
+ this$0 = this._oktavia;
+ metadata = this$0._metadatas[this$0._metadataLabels[0]];
+ num = 250;
+ results = [ ];
+ for (i = start; i < last; i++) {
+ unit = this._result[i];
+ info = metadata.getInformation$I(unit.id).split(Oktavia.eob);
+ content = metadata.getContent$I(unit.id);
+ start = 0;
+ positions = SearchUnit$getPositions$LSearchUnit$(unit);
+ if (content.indexOf(info[0]) === 1) {
+ content = content.slice(info[0].length + 2, content.length);
+ start += info[0].length + 2;
+ }
+ end = start + num;
+ split = false;
+ if (positions[0].position > end - positions[0].word.length) {
+ end = positions[0].position + Math.floor(num / 2);
+ split = true;
+ }
+ for (j = positions.length - 1; j > -1; j--) {
+ pos = positions[j];
+ if (pos.position + pos.word.length < end) {
+ content = [ content.slice(0, pos.position - start), style.convert$S('<hit>*</hit>').replace('*', content.slice((position$0 = pos.position) - start, position$0 + pos.word.length - start)), content.slice(pos.position + pos.word.length - start, content.length) ].join('');
+ }
+ }
+ if (split) {
+ text = [ content.slice(0, Math.floor(num / 2)) + ' ...', content.slice(- Math.floor(num / 2), end - start) ].join('<br/>');
+ } else {
+ text = content.slice(0, end - start) + ' ...<br/>';
+ }
+ text = text.replace(Oktavia.eob, ' ').replace(/(<br\/>)(<br\/>)+/, '<br/><br/>');
+ results.push(({title: info[0], url: info[1], content: text, score: unit.score}));
+ }
+ return results;
+};
+
+/**
+ * @return {!string}
+ */
+OktaviaSearch.prototype.getHighlight$ = function () {
+ return this._highlight;
+};
+
+/**
+ * @return {Array.<undefined|_Proposal>}
+ */
+OktaviaSearch.prototype.getProposals$ = function () {
+ /** @type {Style} */
+ var style;
+ /** @type {Array.<undefined|_Proposal>} */
+ var results;
+ /** @type {!number} */
+ var i;
+ /** @type {Proposal} */
+ var proposal;
+ /** @type {Array.<undefined|!string>} */
+ var label;
+ /** @type {Array.<undefined|!string>} */
+ var option;
+ /** @type {!number} */
+ var j;
+ style = new Style$S('html');
+ results = [ ];
+ if (this._queries.length > 1) {
+ for (i = 0; i < this._proposals.length; i++) {
+ proposal = this._proposals[i];
+ if (proposal.expect > 0) {
+ label = [ ];
+ option = [ ];
+ for (j = 0; j < this._queries.length; j++) {
+ if (j !== proposal.omit) {
+ label.push(style.convert$S('<hit>' + this._queries[j].toString() + '</hit>'));
+ option.push(this._queries[j].toString());
+ } else {
+ label.push(style.convert$S('<del>' + this._queries[j].toString() + '</del>'));
+ }
+ }
+ results.push(({options: option.join(' '), label: label.join('&nbsp;'), count: proposal.expect}));
+ }
+ }
+ }
+ return results;
+};
+
+/**
+ * @param {SearchSummary} summary
+ * @return {Array.<undefined|SearchUnit>}
+ */
+OktaviaSearch.prototype._sortResult$LSearchSummary$ = function (summary) {
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var score;
+ /** @type {SearchUnit} */
+ var unit;
+ /** @type {!string} */
+ var pos;
+ /** @type {Position} */
+ var position;
+ for (i = 0; i < summary.result.units.length; i++) {
+ score = 0;
+ unit = summary.result.units[i];
+ for (pos in unit.positions) {
+ position = unit.positions[pos];
+ if (this._oktavia.wordPositionType$I(position.position)) {
+ score += 10;
+ } else {
+ score += 1;
+ }
+ if (! position.stemmed) {
+ score += 2;
+ }
+ }
+ unit.score = (score | 0);
+ }
+ return SearchSummary$getSortedResult$LSearchSummary$(summary);
+};
+
+/**
+ * class _Main$0 extends Object
+ * @constructor
+ */
+function _Main$0() {
+}
+
+/**
+ * @constructor
+ */
+function _Main$0$() {
+};
+
+_Main$0$.prototype = new _Main$0;
+
+/**
+ * @param {Array.<undefined|!string>} args
+ */
+_Main$0.main$AS = function (args) {
+};
+
+var _Main$0$main$AS = _Main$0.main$AS;
+
+/**
+ * class Oktavia extends Object
+ * @constructor
+ */
+function Oktavia() {
+}
+
+/**
+ * @constructor
+ */
+function Oktavia$() {
+ /** @type {Array.<undefined|!string>} */
+ var _utf162compressCode$0;
+ this._compressCode2utf16 = null;
+ this._fmindex = new FMIndex$();
+ this._metadatas = ({ });
+ this._metadataLabels = [ ];
+ this._stemmer = null;
+ this._stemmingResult = ({ });
+ _utf162compressCode$0 = this._utf162compressCode = [ Oktavia.eof, Oktavia.eob, Oktavia.unknown ];
+ _utf162compressCode$0.length = 65536;
+ this._compressCode2utf16 = [ Oktavia.eof, Oktavia.eob, Oktavia.unknown ];
+};
+
+Oktavia$.prototype = new Oktavia;
+
+/**
+ * @param {Stemmer} stemmer
+ */
+Oktavia.prototype.setStemmer$LStemmer$ = function (stemmer) {
+ this._stemmer = stemmer;
+};
+
+/**
+ * @return {Metadata}
+ */
+Oktavia.prototype.getPrimaryMetadata$ = function () {
+ return this._metadatas[this._metadataLabels[0]];
+};
+
+/**
+ * @param {!string} key
+ * @return {Section}
+ */
+Oktavia.prototype.addSection$S = function (key) {
+ /** @type {Section} */
+ var section;
+ if (this._metadataLabels.indexOf(key) !== -1) {
+ throw new Error('Metadata name ' + key + ' is already exists');
+ }
+ this._metadataLabels.push(key);
+ section = new Section$LOktavia$(this);
+ this._metadatas[key] = section;
+ return section;
+};
+
+/**
+ * @param {!string} key
+ * @return {Section}
+ */
+Oktavia.prototype.getSection$S = function (key) {
+ if (this._metadataLabels.indexOf(key) === -1) {
+ throw new Error('Metadata name ' + key + " does't exists");
+ }
+ return this._metadatas[key];
+};
+
+/**
+ * @param {!string} key
+ * @return {Splitter}
+ */
+Oktavia.prototype.addSplitter$S = function (key) {
+ /** @type {Splitter} */
+ var splitter;
+ if (this._metadataLabels.indexOf(key) !== -1) {
+ throw new Error('Metadata name ' + key + ' is already exists');
+ }
+ this._metadataLabels.push(key);
+ splitter = new Splitter$LOktavia$(this);
+ this._metadatas[key] = splitter;
+ return splitter;
+};
+
+/**
+ * @param {!string} key
+ * @return {Splitter}
+ */
+Oktavia.prototype.getSplitter$S = function (key) {
+ if (this._metadataLabels.indexOf(key) === -1) {
+ throw new Error('Metadata name ' + key + " does't exists");
+ }
+ return this._metadatas[key];
+};
+
+/**
+ * @param {!string} key
+ * @param {Array.<undefined|!string>} headers
+ * @return {Table}
+ */
+Oktavia.prototype.addTable$SAS = function (key, headers) {
+ /** @type {Table} */
+ var table;
+ if (this._metadataLabels.indexOf(key) !== -1) {
+ throw new Error('Metadata name ' + key + ' is already exists');
+ }
+ this._metadataLabels.push(key);
+ table = new Table$LOktavia$AS(this, headers);
+ this._metadatas[key] = table;
+ return table;
+};
+
+/**
+ * @param {!string} key
+ * @return {Table}
+ */
+Oktavia.prototype.getTable$S = function (key) {
+ if (this._metadataLabels.indexOf(key) === -1) {
+ throw new Error('Metadata name ' + key + " does't exists");
+ }
+ return this._metadatas[key];
+};
+
+/**
+ * @param {!string} key
+ * @return {Block}
+ */
+Oktavia.prototype.addBlock$S = function (key) {
+ /** @type {Block} */
+ var block;
+ if (this._metadataLabels.indexOf(key) !== -1) {
+ throw new Error('Metadata name ' + key + ' is already exists');
+ }
+ this._metadataLabels.push(key);
+ block = new Block$LOktavia$(this);
+ this._metadatas[key] = block;
+ return block;
+};
+
+/**
+ * @param {!string} key
+ * @return {Block}
+ */
+Oktavia.prototype.getBlock$S = function (key) {
+ if (this._metadataLabels.indexOf(key) === -1) {
+ throw new Error('Metadata name ' + key + " does't exists");
+ }
+ return this._metadatas[key];
+};
+
+/**
+ */
+Oktavia.prototype.addEndOfBlock$ = function () {
+ this._fmindex.push$S(Oktavia.eob);
+};
+
+/**
+ * @param {!string} words
+ */
+Oktavia.prototype.addWord$S = function (words) {
+ /** @type {Array.<undefined|!string>} */
+ var str;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var charCode;
+ /** @type {undefined|!string} */
+ var newCharCode;
+ str = [ ];
+ str.length = words.length;
+ for (i = 0; i < words.length; i++) {
+ charCode = words.charCodeAt(i);
+ newCharCode = this._utf162compressCode[charCode];
+ if (newCharCode == null) {
+ newCharCode = String.fromCharCode(this._compressCode2utf16.length);
+ this._utf162compressCode[charCode] = newCharCode;
+ this._compressCode2utf16.push(String.fromCharCode(charCode));
+ }
+ str.push(newCharCode);
+ }
+ this._fmindex.push$S(str.join(''));
+};
+
+/**
+ * @param {!string} words
+ * @param {!boolean} stemming
+ */
+Oktavia.prototype.addWord$SB = function (words, stemming) {
+ /** @type {Array.<undefined|!string>} */
+ var wordList;
+ /** @type {!number} */
+ var i;
+ /** @type {undefined|!string} */
+ var originalWord;
+ /** @type {!string} */
+ var smallWord;
+ /** @type {undefined|!string} */
+ var registerWord;
+ /** @type {!string} */
+ var baseWord;
+ /** @type {!string} */
+ var compressedCodeWord;
+ /** @type {Array.<undefined|!string>} */
+ var stemmedList;
+ this.addWord$S(words);
+ wordList = words.split(/\s+/);
+ for (i = 0; i < wordList.length; i++) {
+ originalWord = wordList[i];
+ smallWord = originalWord.slice(0, 1).toLowerCase() + originalWord.slice(1);
+ registerWord = null;
+ if (stemming && this._stemmer) {
+ baseWord = this._stemmer.stemWord$S(originalWord.toLowerCase());
+ if (originalWord.indexOf(baseWord) === -1) {
+ registerWord = baseWord;
+ }
+ } else {
+ if (originalWord != smallWord) {
+ registerWord = smallWord;
+ }
+ }
+ if (registerWord) {
+ compressedCodeWord = this._convertToCompressionCode$S(originalWord);
+ stemmedList = this._stemmingResult[registerWord];
+ if (! stemmedList) {
+ stemmedList = [ compressedCodeWord ];
+ this._stemmingResult[registerWord] = stemmedList;
+ } else {
+ if (stemmedList.indexOf(compressedCodeWord) === -1) {
+ stemmedList.push(compressedCodeWord);
+ }
+ }
+ }
+ }
+};
+
+/**
+ * @param {!string} keyword
+ * @return {!string}
+ */
+Oktavia.prototype._convertToCompressionCode$S = function (keyword) {
+ /** @type {Array.<undefined|!string>} */
+ var resultChars;
+ /** @type {!number} */
+ var i;
+ /** @type {undefined|!string} */
+ var chr;
+ resultChars = [ ];
+ for (i = 0; i < keyword.length; i++) {
+ chr = this._utf162compressCode[keyword.charCodeAt(i)];
+ if (chr == null) {
+ resultChars.push(Oktavia.unknown);
+ } else {
+ resultChars.push(chr);
+ }
+ }
+ return resultChars.join('');
+};
+
+/**
+ * @param {!string} keyword
+ * @param {!boolean} stemming
+ * @return {Array.<undefined|!number>}
+ */
+Oktavia.prototype.rawSearch$SB = function (keyword, stemming) {
+ /** @type {Array.<undefined|!number>} */
+ var result;
+ /** @type {!string} */
+ var baseWord;
+ /** @type {Array.<undefined|!string>} */
+ var stemmedList;
+ /** @type {!number} */
+ var i;
+ /** @type {undefined|!string} */
+ var word;
+ if (stemming) {
+ result = [ ];
+ if (this._stemmer) {
+ baseWord = this._stemmer.stemWord$S(keyword.toLowerCase());
+ stemmedList = this._stemmingResult[baseWord];
+ if (stemmedList) {
+ for (i = 0; i < stemmedList.length; i++) {
+ word = stemmedList[i];
+ result = result.concat(this._fmindex.search$S(word));
+ }
+ }
+ }
+ } else {
+ result = this._fmindex.search$S(this._convertToCompressionCode$S(keyword));
+ }
+ return result;
+};
+
+/**
+ * @param {Array.<undefined|Query>} queries
+ * @return {SearchSummary}
+ */
+Oktavia.prototype.search$ALQuery$ = function (queries) {
+ /** @type {SearchSummary} */
+ var summary;
+ /** @type {!number} */
+ var i;
+ /** @type {SingleResult} */
+ var result$0;
+ summary = ({sourceResults: [ ], result: null, oktavia: this});
+ for (i = 0; i < queries.length; i++) {
+ result$0 = this._searchQuery$LQuery$(queries[i]);
+ summary.sourceResults.push(result$0);
+ }
+ summary.result = SearchSummary$mergeResult$LSearchSummary$ALSingleResult$(summary, summary.sourceResults);
+ return summary;
+};
+
+/**
+ * @param {Query} query
+ * @return {SingleResult}
+ */
+Oktavia.prototype._searchQuery$LQuery$ = function (query) {
+ /** @type {SingleResult} */
+ var result;
+ /** @type {Array.<undefined|!number>} */
+ var positions;
+ result = new SingleResult$SBB(query.word, query.or, query.not);
+ if (query.raw) {
+ positions = this.rawSearch$SB(query.word, false);
+ } else {
+ positions = this.rawSearch$SB(query.word, false).concat(this.rawSearch$SB(query.word, true));
+ }
+ this._metadatas[this._metadataLabels[0]].grouping$LSingleResult$AISB(result, positions, query.word, ! query.raw);
+ return result;
+};
+
+/**
+ */
+Oktavia.prototype.build$ = function () {
+ this.build$IB(5, false);
+};
+
+/**
+ * @param {!number} cacheDensity
+ * @param {!boolean} verbose
+ */
+Oktavia.prototype.build$IB = function (cacheDensity, verbose) {
+ /** @type {!string} */
+ var key;
+ /** @type {!number} */
+ var cacheRange;
+ /** @type {!number} */
+ var maxChar;
+ for (key in this._metadatas) {
+ this._metadatas[key]._build$();
+ }
+ cacheRange = Math.round(Math.max(1, 100 / Math.min(100, Math.max(0.01, cacheDensity))));
+ maxChar = this._compressCode2utf16.length;
+ this._fmindex.build$SIIB(Oktavia.eof, maxChar, cacheRange, verbose);
+};
+
+/**
+ * @return {!string}
+ */
+Oktavia.prototype.dump$ = function () {
+ return this.dump$B(false);
+};
+
+/**
+ * @param {!boolean} verbose
+ * @return {!string}
+ */
+Oktavia.prototype.dump$B = function (verbose) {
+ /** @type {!string} */
+ var header;
+ /** @type {!string} */
+ var fmdata;
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var i;
+ /** @type {CompressionReport} */
+ var report;
+ /** @type {undefined|!string} */
+ var name;
+ /** @type {!string} */
+ var data;
+ header = Binary$dumpString$SLCompressionReport$("oktavia-01", null).slice(1);
+ if (verbose) {
+ console.log("Source text size: " + (this._fmindex.size$() * 2 + "") + ' bytes');
+ }
+ fmdata = this._fmindex.dump$B(verbose);
+ result = [ header, fmdata ];
+ result.push(Binary$dump16bitNumber$I(this._compressCode2utf16.length));
+ for (i = 3; i < this._compressCode2utf16.length; i++) {
+ result.push(this._compressCode2utf16[i]);
+ }
+ if (verbose) {
+ console.log('Char Code Map: ' + (this._compressCode2utf16.length * 2 - 2 + "") + ' bytes');
+ }
+ report = ({source: 0, result: 0});
+ result.push(Binary$dumpStringListMap$HASLCompressionReport$(this._stemmingResult, report));
+ if (verbose) {
+ console.log('Stemmed Word Table: ' + (result[result.length - 1].length + "") + ' bytes (' + (Math.round(report.result * 100.0 / report.source) + "") + '%)');
+ }
+ result.push(Binary$dump16bitNumber$I(this._metadataLabels.length));
+ for (i = 0; i < this._metadataLabels.length; i++) {
+ report = ({source: 0, result: 0});
+ name = this._metadataLabels[i];
+ data = this._metadatas[name]._dump$LCompressionReport$(report);
+ result.push(Binary$dumpString$SLCompressionReport$(name, report), data);
+ if (verbose) {
+ console.log('Meta Data ' + name + ': ' + (data.length * 2 + "") + ' bytes (' + (Math.round(report.result * 100.0 / report.source) + "") + '%)');
+ }
+ }
+ return result.join('');
+};
+
+/**
+ * @param {!string} data
+ */
+Oktavia.prototype.load$S = function (data) {
+ /** @type {!string} */
+ var header;
+ /** @type {!number} */
+ var offset;
+ /** @type {!number} */
+ var charCodeCount;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var charCode;
+ /** @type {LoadedStringListMapResult} */
+ var stemmedWords;
+ /** @type {!number} */
+ var metadataCount;
+ /** @type {LoadedStringResult} */
+ var nameResult;
+ /** @type {!string} */
+ var name;
+ /** @type {!number} */
+ var type;
+ header = Binary$dumpString$SLCompressionReport$("oktavia-01", null).slice(1);
+ if (data.slice(0, 5) !== header) {
+ throw new Error('Invalid data file');
+ }
+ this._metadatas = ({ });
+ this._metadataLabels = [ ];
+ offset = 5;
+ offset = this._fmindex.load$SI(data, offset);
+ charCodeCount = Binary$load16bitNumber$SI(data, offset++);
+ this._compressCode2utf16 = [ Oktavia.eof, Oktavia.eob, Oktavia.unknown ];
+ this._utf162compressCode = [ Oktavia.eof, Oktavia.eob, Oktavia.unknown ];
+ for (i = 3; i < charCodeCount; i++) {
+ charCode = Binary$load16bitNumber$SI(data, offset++);
+ this._compressCode2utf16.push(String.fromCharCode(charCode));
+ this._utf162compressCode[charCode] = String.fromCharCode(i);
+ }
+ stemmedWords = Binary$loadStringListMap$SI(data, offset);
+ this._stemmingResult = stemmedWords.result;
+ offset = stemmedWords.offset;
+ metadataCount = Binary$load16bitNumber$SI(data, offset++);
+ for (i = 0; i < metadataCount; i++) {
+ nameResult = Binary$loadString$SI(data, offset);
+ name = nameResult.result;
+ offset = nameResult.offset;
+ type = Binary$load16bitNumber$SI(data, offset++);
+ switch (type) {
+ case 0:
+ offset = Section$_load$LOktavia$SSI(this, name, data, offset);
+ break;
+ case 1:
+ offset = Splitter$_load$LOktavia$SSI(this, name, data, offset);
+ break;
+ case 2:
+ offset = Table$_load$LOktavia$SSI(this, name, data, offset);
+ break;
+ case 3:
+ offset = Block$_load$LOktavia$SSI(this, name, data, offset);
+ break;
+ }
+ }
+};
+
+/**
+ * @return {!number}
+ */
+Oktavia.prototype.contentSize$ = function () {
+ /** @type {FMIndex} */
+ var this$0;
+ this$0 = this._fmindex;
+ return this$0._substr.length;
+};
+
+/**
+ * @param {!number} position
+ * @return {!number}
+ */
+Oktavia.prototype.wordPositionType$I = function (position) {
+ /** @type {!number} */
+ var result;
+ /** @type {!string} */
+ var ahead;
+ result = 0;
+ if (position === 0) {
+ result = 4;
+ } else {
+ ahead = this._fmindex.getSubstring$II(position - 1, 1);
+ if (/\s/.test(ahead)) {
+ result = 2;
+ } else {
+ if (/\W/.test(ahead)) {
+ result = 1;
+ } else {
+ if (Oktavia.eob === ahead) {
+ result = 3;
+ }
+ }
+ }
+ }
+ return (result | 0);
+};
+
+/**
+ * @param {!number} position
+ * @param {!number} length
+ * @return {!string}
+ */
+Oktavia.prototype._getSubstring$II = function (position, length) {
+ /** @type {!string} */
+ var result;
+ /** @type {Array.<undefined|!string>} */
+ var str;
+ /** @type {!number} */
+ var i;
+ result = this._fmindex.getSubstring$II(position, length);
+ str = [ ];
+ for (i = 0; i < result.length; i++) {
+ str.push(this._compressCode2utf16[result.charCodeAt(i)]);
+ }
+ return str.join('');
+};
+
+/**
+ * class Binary extends Object
+ * @constructor
+ */
+function Binary() {
+}
+
+/**
+ * @constructor
+ */
+function Binary$() {
+};
+
+Binary$.prototype = new Binary;
+
+/**
+ * @param {!number} num
+ * @return {!string}
+ */
+Binary.dump32bitNumber$N = function (num) {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ result = [ String.fromCharCode(Math.floor(num / 65536)) ];
+ result.push(String.fromCharCode(num % 65536));
+ return result.join("");
+};
+
+var Binary$dump32bitNumber$N = Binary.dump32bitNumber$N;
+
+/**
+ * @param {!string} buffer
+ * @param {!number} offset
+ * @return {!number}
+ */
+Binary.load32bitNumber$SI = function (buffer, offset) {
+ /** @type {!number} */
+ var result;
+ result = buffer.charCodeAt(offset) * 65536 + buffer.charCodeAt(offset + 1);
+ return result;
+};
+
+var Binary$load32bitNumber$SI = Binary.load32bitNumber$SI;
+
+/**
+ * @param {!number} num
+ * @return {!string}
+ */
+Binary.dump16bitNumber$I = function (num) {
+ return String.fromCharCode(num % 65536);
+};
+
+var Binary$dump16bitNumber$I = Binary.dump16bitNumber$I;
+
+/**
+ * @param {!string} buffer
+ * @param {!number} offset
+ * @return {!number}
+ */
+Binary.load16bitNumber$SI = function (buffer, offset) {
+ return (buffer.charCodeAt(offset) | 0);
+};
+
+var Binary$load16bitNumber$SI = Binary.load16bitNumber$SI;
+
+/**
+ * @param {!string} str
+ * @return {!string}
+ */
+Binary.dumpString$S = function (str) {
+ return Binary$dumpString$SLCompressionReport$(str, null);
+};
+
+var Binary$dumpString$S = Binary.dumpString$S;
+
+/**
+ * @param {!string} str
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+Binary.dumpString$SLCompressionReport$ = function (str, report) {
+ /** @type {!number} */
+ var length;
+ /** @type {!boolean} */
+ var compress;
+ /** @type {Array.<undefined|!number>} */
+ var charCodes;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var charCode;
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {undefined|!number} */
+ var bytes;
+ if (str.length > 32768) {
+ str = str.slice(0, 32768);
+ }
+ length = str.length;
+ compress = true;
+ charCodes = [ ];
+ for (i = 0; i < length; i++) {
+ charCode = str.charCodeAt(i);
+ if (charCode > 255) {
+ compress = false;
+ break;
+ }
+ charCodes.push(charCode);
+ }
+ if (compress) {
+ result = [ Binary$dump16bitNumber$I(length + 32768) ];
+ for (i = 0; i < length; i += 2) {
+ bytes = charCodes[i];
+ if (i !== length - 1) {
+ bytes += charCodes[i + 1] << 8;
+ }
+ result.push(String.fromCharCode(bytes % 65536));
+ }
+ if (report) {
+ CompressionReport$add$LCompressionReport$II(report, length, Math.ceil(length / 2));
+ }
+ } else {
+ result = [ Binary$dump16bitNumber$I(length), str ];
+ if (report) {
+ CompressionReport$add$LCompressionReport$II(report, length, length);
+ }
+ }
+ return result.join('');
+};
+
+var Binary$dumpString$SLCompressionReport$ = Binary.dumpString$SLCompressionReport$;
+
+/**
+ * @param {!string} buffer
+ * @param {!number} offset
+ * @return {LoadedStringResult}
+ */
+Binary.loadString$SI = function (buffer, offset) {
+ return new LoadedStringResult$SI(buffer, offset);
+};
+
+var Binary$loadString$SI = Binary.loadString$SI;
+
+/**
+ * @param {Array.<undefined|!string>} strList
+ * @return {!string}
+ */
+Binary.dumpStringList$AS = function (strList) {
+ return Binary$dumpStringList$ASLCompressionReport$(strList, null);
+};
+
+var Binary$dumpStringList$AS = Binary.dumpStringList$AS;
+
+/**
+ * @param {Array.<undefined|!string>} strList
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+Binary.dumpStringList$ASLCompressionReport$ = function (strList, report) {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var i;
+ result = [ Binary$dump32bitNumber$N(strList.length) ];
+ for (i = 0; i < strList.length; i++) {
+ result.push(Binary$dumpString$SLCompressionReport$(strList[i], report));
+ }
+ return result.join('');
+};
+
+var Binary$dumpStringList$ASLCompressionReport$ = Binary.dumpStringList$ASLCompressionReport$;
+
+/**
+ * @param {!string} buffer
+ * @param {!number} offset
+ * @return {LoadedStringListResult}
+ */
+Binary.loadStringList$SI = function (buffer, offset) {
+ return new LoadedStringListResult$SI(buffer, offset);
+};
+
+var Binary$loadStringList$SI = Binary.loadStringList$SI;
+
+/**
+ * @param {Object.<string, undefined|Array.<undefined|!string>>} strMap
+ * @return {!string}
+ */
+Binary.dumpStringListMap$HAS = function (strMap) {
+ return Binary$dumpStringListMap$HASLCompressionReport$(strMap, null);
+};
+
+var Binary$dumpStringListMap$HAS = Binary.dumpStringListMap$HAS;
+
+/**
+ * @param {Object.<string, undefined|Array.<undefined|!string>>} strMap
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+Binary.dumpStringListMap$HASLCompressionReport$ = function (strMap, report) {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var counter;
+ /** @type {!string} */
+ var key;
+ result = [ ];
+ counter = 0;
+ for (key in strMap) {
+ result.push(Binary$dumpString$SLCompressionReport$(key, report));
+ result.push(Binary$dumpStringList$ASLCompressionReport$(strMap[key], report));
+ counter++;
+ }
+ return Binary$dump32bitNumber$N(counter) + result.join('');
+};
+
+var Binary$dumpStringListMap$HASLCompressionReport$ = Binary.dumpStringListMap$HASLCompressionReport$;
+
+/**
+ * @param {!string} buffer
+ * @param {!number} offset
+ * @return {LoadedStringListMapResult}
+ */
+Binary.loadStringListMap$SI = function (buffer, offset) {
+ return new LoadedStringListMapResult$SI(buffer, offset);
+};
+
+var Binary$loadStringListMap$SI = Binary.loadStringListMap$SI;
+
+/**
+ * @param {Array.<undefined|!number>} array
+ * @return {!string}
+ */
+Binary.dump32bitNumberList$AN = function (array) {
+ return Binary$dump32bitNumberList$ANLCompressionReport$(array, null);
+};
+
+var Binary$dump32bitNumberList$AN = Binary.dump32bitNumberList$AN;
+
+/**
+ * @param {Array.<undefined|!number>} array
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+Binary.dump32bitNumberList$ANLCompressionReport$ = function (array, report) {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var index;
+ /** @type {!number} */
+ var inputLength;
+ /** @type {!number} */
+ var length;
+ /** @type {!string} */
+ var resultString;
+ /** @type {!number} */
+ var value1$0;
+ /** @type {!number} */
+ var value2$0;
+ result = [ Binary$dump32bitNumber$N(array.length) ];
+ index = 0;
+ inputLength = array.length;
+ while (index < inputLength) {
+ if (array[index] == 0) {
+ length = Binary$_countZero$ANI(array, index);
+ result.push(Binary$_zeroBlock$I(length));
+ index += length;
+ } else {
+ if (Binary$_shouldZebraCode$ANI(array, index)) {
+ result.push(Binary$_createZebraCode$ANI(array, index));
+ value1$0 = array.length;
+ value2$0 = index + 15;
+ index = (value1$0 <= value2$0 ? value1$0 : value2$0);
+ } else {
+ length = Binary$_searchDoubleZero$ANI(array, index);
+ result.push(Binary$_nonZeroBlock$ANII(array, index, length));
+ if (length === 0) {
+ throw new Error('');
+ }
+ index += length;
+ }
+ }
+ }
+ resultString = result.join('');
+ if (report) {
+ CompressionReport$add$LCompressionReport$II(report, array.length * 2 + 2, resultString.length);
+ }
+ return resultString;
+};
+
+var Binary$dump32bitNumberList$ANLCompressionReport$ = Binary.dump32bitNumberList$ANLCompressionReport$;
+
+/**
+ * @param {!string} buffer
+ * @param {!number} offset
+ * @return {LoadedNumberListResult}
+ */
+Binary.load32bitNumberList$SI = function (buffer, offset) {
+ return new LoadedNumberListResult$SI(buffer, offset);
+};
+
+var Binary$load32bitNumberList$SI = Binary.load32bitNumberList$SI;
+
+/**
+ * @param {Array.<undefined|!number>} array
+ * @param {!number} offset
+ * @return {!number}
+ */
+Binary._countZero$ANI = function (array, offset) {
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var array$len$0;
+ for ((i = offset, array$len$0 = array.length); i < array$len$0; i++) {
+ if (array[i] != 0) {
+ return (i - offset | 0);
+ }
+ }
+ return (array.length - offset | 0);
+};
+
+var Binary$_countZero$ANI = Binary._countZero$ANI;
+
+/**
+ * @param {!number} length
+ * @return {!string}
+ */
+Binary._zeroBlock$I = function (length) {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ result = [ ];
+ while (length > 0) {
+ if (length > 16384) {
+ result.push(Binary$dump16bitNumber$I(16383));
+ length -= 16384;
+ } else {
+ result.push(Binary$dump16bitNumber$I(length - 1));
+ length = 0;
+ }
+ }
+ return result.join('');
+};
+
+var Binary$_zeroBlock$I = Binary._zeroBlock$I;
+
+/**
+ * @param {Array.<undefined|!number>} array
+ * @param {!number} offset
+ * @return {!boolean}
+ */
+Binary._shouldZebraCode$ANI = function (array, offset) {
+ /** @type {!number} */
+ var change;
+ /** @type {!boolean} */
+ var isLastZero;
+ /** @type {!number} */
+ var i;
+ if (array.length - offset < 16) {
+ return true;
+ }
+ change = 0;
+ isLastZero = false;
+ for (i = offset; i < offset + 15; i++) {
+ if (array[i] == 0) {
+ if (! isLastZero) {
+ isLastZero = true;
+ change++;
+ }
+ } else {
+ if (isLastZero) {
+ isLastZero = false;
+ change++;
+ }
+ }
+ }
+ return change > 2;
+};
+
+var Binary$_shouldZebraCode$ANI = Binary._shouldZebraCode$ANI;
+
+/**
+ * @param {Array.<undefined|!number>} array
+ * @param {!number} offset
+ * @return {!number}
+ */
+Binary._searchDoubleZero$ANI = function (array, offset) {
+ /** @type {!boolean} */
+ var isLastZero;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var array$len$0;
+ isLastZero = false;
+ for ((i = offset, array$len$0 = array.length); i < array$len$0; i++) {
+ if (array[i] == 0) {
+ if (isLastZero) {
+ return (i - offset - 1 | 0);
+ }
+ isLastZero = true;
+ } else {
+ isLastZero = false;
+ }
+ }
+ return (array.length - offset | 0);
+};
+
+var Binary$_searchDoubleZero$ANI = Binary._searchDoubleZero$ANI;
+
+/**
+ * @param {Array.<undefined|!number>} array
+ * @param {!number} offset
+ * @param {!number} length
+ * @return {!string}
+ */
+Binary._nonZeroBlock$ANII = function (array, offset, length) {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var blockLength;
+ /** @type {!number} */
+ var i;
+ result = [ ];
+ while (length > 0) {
+ if (length > 16384) {
+ blockLength = 16384;
+ length -= 16384;
+ } else {
+ blockLength = length;
+ length = 0;
+ }
+ result.push(Binary$dump16bitNumber$I(blockLength - 1 + 0x4000));
+ for (i = offset; i < offset + blockLength; i++) {
+ result.push(Binary$dump32bitNumber$N(array[i]));
+ }
+ offset += blockLength;
+ }
+ return result.join('');
+};
+
+var Binary$_nonZeroBlock$ANII = Binary._nonZeroBlock$ANII;
+
+/**
+ * @param {Array.<undefined|!number>} array
+ * @param {!number} offset
+ * @return {!string}
+ */
+Binary._createZebraCode$ANI = function (array, offset) {
+ /** @type {!number} */
+ var last;
+ /** @type {!number} */
+ var code;
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var value1$0;
+ /** @type {!number} */
+ var value2$0;
+ value1$0 = offset + 15;
+ value2$0 = array.length;
+ last = (value1$0 <= value2$0 ? value1$0 : value2$0);
+ code = 0x8000;
+ result = [ ];
+ for (i = offset; i < last; i++) {
+ if (array[i] != 0) {
+ result.push(Binary$dump32bitNumber$N(array[i]));
+ code = code + (0x1 << i - offset);
+ }
+ }
+ return String.fromCharCode(code) + result.join('');
+};
+
+var Binary$_createZebraCode$ANI = Binary._createZebraCode$ANI;
+
+/**
+ * @param {!string} str
+ * @return {!string}
+ */
+Binary.base64encode$S = function (str) {
+ /** @type {Array.<undefined|!string>} */
+ var out;
+ /** @type {Array.<undefined|!number>} */
+ var source;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var code;
+ /** @type {!number} */
+ var len;
+ /** @type {!number} */
+ var c1;
+ /** @type {undefined|!number} */
+ var c2;
+ /** @type {undefined|!number} */
+ var c3;
+ out = [ ];
+ source = [ ];
+ for (i = 0; i < str.length; i++) {
+ code = str.charCodeAt(i);
+ source.push(code & 0x00ff, code >>> 8);
+ }
+ len = str.length * 2;
+ i = 0;
+ while (i < len) {
+ c1 = source[i++] & 0xff;
+ if (i === len) {
+ out.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(c1 >> 2));
+ out.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((c1 & 0x3) << 4));
+ out.push("==");
+ break;
+ }
+ c2 = source[i++];
+ if (i === len) {
+ out.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(c1 >> 2));
+ out.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((c1 & 0x3) << 4 | (c2 & 0xF0) >> 4));
+ out.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((c2 & 0xF) << 2));
+ out.push("=");
+ break;
+ }
+ c3 = source[i++];
+ out.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(c1 >> 2));
+ out.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((c1 & 0x3) << 4 | (c2 & 0xF0) >> 4));
+ out.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((c2 & 0xF) << 2 | (c3 & 0xC0) >> 6));
+ out.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(c3 & 0x3F));
+ }
+ return out.join('');
+};
+
+var Binary$base64encode$S = Binary.base64encode$S;
+
+/**
+ * @param {Array.<undefined|!number>} source
+ * @return {!string}
+ */
+Binary._mergeCharCode$AI = function (source) {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var i;
+ result = [ ];
+ for (i = 0; i < source.length; i += 2) {
+ result.push(String.fromCharCode(source[i] + (source[i + 1] << 8)));
+ }
+ return result.join('');
+};
+
+var Binary$_mergeCharCode$AI = Binary._mergeCharCode$AI;
+
+/**
+ * @param {!string} str
+ * @return {!string}
+ */
+Binary.base64decode$S = function (str) {
+ /** @type {!number} */
+ var len;
+ /** @type {!number} */
+ var i;
+ /** @type {Array.<undefined|!number>} */
+ var out;
+ /** @type {undefined|!number} */
+ var c1;
+ /** @type {undefined|!number} */
+ var c2;
+ /** @type {!number} */
+ var c3;
+ /** @type {!number} */
+ var c4;
+ len = str.length;
+ i = 0;
+ out = [ ];
+ while (i < len) {
+ do {
+ c1 = Binary._base64DecodeChars[str.charCodeAt(i++) & 0xff];
+ } while (i < len && c1 == -1);
+ if (c1 == -1) {
+ break;
+ }
+ do {
+ c2 = Binary._base64DecodeChars[str.charCodeAt(i++) & 0xff];
+ } while (i < len && c2 == -1);
+ if (c2 == -1) {
+ break;
+ }
+ out.push(c1 << 2 | (c2 & 0x30) >> 4);
+ do {
+ c3 = str.charCodeAt(i++) & 0xff;
+ if (c3 === 61) {
+ return Binary$_mergeCharCode$AI(out);
+ }
+ c3 = Binary._base64DecodeChars[c3];
+ } while (i < len && c3 === -1);
+ if (c3 === -1) {
+ break;
+ }
+ out.push((c2 & 0XF) << 4 | (c3 & 0x3C) >> 2);
+ do {
+ c4 = str.charCodeAt(i++) & 0xff;
+ if (c4 === 61) {
+ return Binary$_mergeCharCode$AI(out);
+ }
+ c4 = (Binary._base64DecodeChars[c4] | 0);
+ } while (i < len && c4 === -1);
+ if (c4 === -1) {
+ break;
+ }
+ out.push((c3 & 0x03) << 6 | c4);
+ }
+ return Binary$_mergeCharCode$AI(out);
+};
+
+var Binary$base64decode$S = Binary.base64decode$S;
+
+/**
+ * class LoadedStringResult extends Object
+ * @constructor
+ */
+function LoadedStringResult() {
+}
+
+/**
+ * @constructor
+ * @param {!string} data
+ * @param {!number} offset
+ */
+function LoadedStringResult$SI(data, offset) {
+ /** @type {!number} */
+ var strLength;
+ /** @type {Array.<undefined|!string>} */
+ var bytes;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var code;
+ /** @type {!number} */
+ var offset$0;
+ this.result = "";
+ this.offset = 0;
+ offset$0 = offset++;
+ strLength = data.charCodeAt(offset$0);
+ if (strLength > 32767) {
+ strLength = strLength - 32768;
+ bytes = [ ];
+ for (i = 0; i < strLength; i += 2) {
+ code = data.charCodeAt(offset);
+ bytes.push(String.fromCharCode(code & 0x00ff));
+ if (i !== strLength - 1) {
+ bytes.push(String.fromCharCode(code >>> 8));
+ }
+ offset++;
+ }
+ this.result = bytes.join('');
+ this.offset = offset;
+ } else {
+ this.result = data.slice(offset, offset + strLength);
+ this.offset = (offset + strLength | 0);
+ }
+};
+
+LoadedStringResult$SI.prototype = new LoadedStringResult;
+
+/**
+ * class LoadedStringListResult extends Object
+ * @constructor
+ */
+function LoadedStringListResult() {
+}
+
+/**
+ * @constructor
+ * @param {!string} data
+ * @param {!number} offset
+ */
+function LoadedStringListResult$SI(data, offset) {
+ /** @type {!number} */
+ var length;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var strLength;
+ /** @type {!string} */
+ var resultStr;
+ /** @type {Array.<undefined|!string>} */
+ var bytes;
+ /** @type {!number} */
+ var j;
+ /** @type {!number} */
+ var code;
+ /** @type {!number} */
+ var result$0;
+ /** @type {!number} */
+ var offset$0;
+ this.offset = 0;
+ this.result = [ ];
+ result$0 = data.charCodeAt(offset) * 65536 + data.charCodeAt(offset + 1);
+ length = result$0;
+ offset += 2;
+ for (i = 0; i < length; i++) {
+ offset$0 = offset++;
+ strLength = data.charCodeAt(offset$0);
+ if (strLength > 32767) {
+ strLength = strLength - 32768;
+ bytes = [ ];
+ for (j = 0; j < strLength; j += 2) {
+ code = data.charCodeAt(offset);
+ bytes.push(String.fromCharCode(code & 0x00ff));
+ if (j !== strLength - 1) {
+ bytes.push(String.fromCharCode(code >>> 8));
+ }
+ offset++;
+ }
+ resultStr = bytes.join('');
+ } else {
+ resultStr = data.slice(offset, offset + strLength);
+ offset = (offset + strLength | 0);
+ }
+ this.result.push(resultStr);
+ }
+ this.offset = offset;
+};
+
+LoadedStringListResult$SI.prototype = new LoadedStringListResult;
+
+/**
+ * class LoadedStringListMapResult extends Object
+ * @constructor
+ */
+function LoadedStringListMapResult() {
+}
+
+/**
+ * @constructor
+ * @param {!string} data
+ * @param {!number} offset
+ */
+function LoadedStringListMapResult$SI(data, offset) {
+ /** @type {!number} */
+ var length;
+ /** @type {!number} */
+ var i;
+ /** @type {LoadedStringResult} */
+ var keyResult;
+ /** @type {LoadedStringListResult} */
+ var valueResult;
+ /** @type {!number} */
+ var result$0;
+ /** @type {!number} */
+ var offset$0;
+ this.offset = 0;
+ this.result = ({ });
+ result$0 = data.charCodeAt(offset) * 65536 + data.charCodeAt(offset + 1);
+ length = result$0;
+ offset += 2;
+ for (i = 0; i < length; i++) {
+ keyResult = new LoadedStringResult$SI(data, offset);
+ offset$0 = keyResult.offset;
+ valueResult = new LoadedStringListResult$SI(data, offset$0);
+ this.result[keyResult.result] = valueResult.result;
+ offset = valueResult.offset;
+ }
+ this.offset = offset;
+};
+
+LoadedStringListMapResult$SI.prototype = new LoadedStringListMapResult;
+
+/**
+ * class LoadedNumberListResult extends Object
+ * @constructor
+ */
+function LoadedNumberListResult() {
+}
+
+/**
+ * @constructor
+ * @param {!string} data
+ * @param {!number} offset
+ */
+function LoadedNumberListResult$SI(data, offset) {
+ /** @type {!number} */
+ var resultLength;
+ /** @type {!number} */
+ var originalOffset;
+ /** @type {Array.<undefined|!number>} */
+ var result;
+ /** @type {!number} */
+ var tag;
+ /** @type {!number} */
+ var length;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var result$0;
+ /** @type {!number} */
+ var value1$0;
+ this.result = null;
+ this.offset = 0;
+ result$0 = data.charCodeAt(offset) * 65536 + data.charCodeAt(offset + 1);
+ resultLength = result$0;
+ originalOffset = offset;
+ offset += 2;
+ result = [ ];
+ while (result.length < resultLength) {
+ tag = data.charCodeAt(offset++);
+ if (tag >>> 15 === 1) {
+ value1$0 = resultLength - result.length;
+ length = (value1$0 <= 15 ? value1$0 : 15);
+ for (i = 0; i < length; i++) {
+ if (tag >>> i & 0x1) {
+ result.push(Binary$load32bitNumber$SI(data, offset));
+ offset += 2;
+ } else {
+ result.push(0);
+ }
+ }
+ } else {
+ if (tag >>> 14 === 1) {
+ length = tag - 0x4000 + 1;
+ for (i = 0; i < length; i++) {
+ result.push(Binary$load32bitNumber$SI(data, offset));
+ offset += 2;
+ }
+ } else {
+ length = tag + 1;
+ for (i = 0; i < length; i++) {
+ result.push(0);
+ }
+ }
+ }
+ }
+ this.result = result;
+ this.offset = offset;
+};
+
+LoadedNumberListResult$SI.prototype = new LoadedNumberListResult;
+
+/**
+ * class CompressionReport extends Object
+ * @constructor
+ */
+function CompressionReport() {
+}
+
+/**
+ * @constructor
+ */
+function CompressionReport$() {
+ this.source = 0;
+ this.result = 0;
+};
+
+CompressionReport$.prototype = new CompressionReport;
+
+/**
+ * @param {CompressionReport} $this
+ * @param {!number} source
+ * @param {!number} result
+ */
+CompressionReport.add$LCompressionReport$II = function ($this, source, result) {
+ $this.source += source;
+ $this.result += result;
+};
+
+var CompressionReport$add$LCompressionReport$II = CompressionReport.add$LCompressionReport$II;
+
+/**
+ * @param {CompressionReport} $this
+ * @return {!number}
+ */
+CompressionReport.rate$LCompressionReport$ = function ($this) {
+ return (Math.round($this.result * 100.0 / $this.source) | 0);
+};
+
+var CompressionReport$rate$LCompressionReport$ = CompressionReport.rate$LCompressionReport$;
+
+/**
+ * class Query extends Object
+ * @constructor
+ */
+function Query() {
+}
+
+/**
+ * @constructor
+ */
+function Query$() {
+ this.word = '';
+ this.or = false;
+ this.not = false;
+ this.raw = false;
+};
+
+Query$.prototype = new Query;
+
+/**
+ * @return {!string}
+ */
+Query.prototype.toString = function () {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ result = [ ];
+ if (this.or) {
+ result.push("OR ");
+ }
+ if (this.not) {
+ result.push("-");
+ }
+ if (this.raw) {
+ result.push('"', this.word, '"');
+ } else {
+ result.push(this.word);
+ }
+ return result.join('');
+};
+
+/**
+ * class QueryStringParser extends Object
+ * @constructor
+ */
+function QueryStringParser() {
+}
+
+/**
+ * @constructor
+ */
+function QueryStringParser$() {
+ this.queries = [ ];
+};
+
+QueryStringParser$.prototype = new QueryStringParser;
+
+/**
+ * @param {QueryStringParser} $this
+ * @param {!string} queryString
+ * @return {Array.<undefined|Query>}
+ */
+QueryStringParser.parse$LQueryStringParser$S = function ($this, queryString) {
+ /** @type {!boolean} */
+ var nextOr;
+ /** @type {!boolean} */
+ var nextNot;
+ /** @type {!number} */
+ var currentWordStart;
+ /** @type {!number} */
+ var status;
+ /** @type {RegExp} */
+ var isSpace;
+ /** @type {!number} */
+ var i;
+ /** @type {!string} */
+ var ch;
+ /** @type {!string} */
+ var word;
+ /** @type {Query} */
+ var query;
+ nextOr = false;
+ nextNot = false;
+ currentWordStart = 0;
+ status = 0;
+ isSpace = /[\s\u3000]/;
+ for (i = 0; i < queryString.length; i++) {
+ ch = queryString.charAt(i);
+ switch (status) {
+ case 0:
+ if (! isSpace.test(ch)) {
+ if (ch === '-') {
+ nextNot = true;
+ } else {
+ if (ch === '"') {
+ currentWordStart = i + 1;
+ status = 2;
+ } else {
+ currentWordStart = i;
+ status = 1;
+ }
+ }
+ } else {
+ nextNot = false;
+ }
+ break;
+ case 1:
+ if (isSpace.test(ch)) {
+ word = queryString.slice(currentWordStart, i);
+ if (word === 'OR') {
+ nextOr = true;
+ } else {
+ query = new Query$();
+ query.word = word;
+ query.or = nextOr;
+ query.not = nextNot;
+ $this.queries.push(query);
+ nextOr = false;
+ nextNot = false;
+ }
+ status = 0;
+ }
+ break;
+ case 2:
+ if (ch === '"') {
+ word = queryString.slice(currentWordStart, i);
+ query = new Query$();
+ query.word = word;
+ query.or = nextOr;
+ query.not = nextNot;
+ query.raw = true;
+ $this.queries.push(query);
+ nextOr = false;
+ nextNot = false;
+ status = 0;
+ }
+ break;
+ }
+ }
+ switch (status) {
+ case 0:
+ break;
+ case 1:
+ query = new Query$();
+ word = queryString.slice(currentWordStart, queryString.length);
+ if (word !== 'OR') {
+ query.word = word;
+ query.or = nextOr;
+ query.not = nextNot;
+ $this.queries.push(query);
+ }
+ break;
+ case 2:
+ query = new Query$();
+ query.word = queryString.slice(currentWordStart, queryString.length);
+ query.or = nextOr;
+ query.not = nextNot;
+ query.raw = true;
+ $this.queries.push(query);
+ break;
+ }
+ return $this.queries;
+};
+
+var QueryStringParser$parse$LQueryStringParser$S = QueryStringParser.parse$LQueryStringParser$S;
+
+/**
+ * @param {QueryStringParser} $this
+ * @return {!string}
+ */
+QueryStringParser.highlight$LQueryStringParser$ = function ($this) {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var i;
+ /** @type {Query} */
+ var query;
+ result = [ ];
+ for (i = 0; i < $this.queries.length; i++) {
+ query = $this.queries[i];
+ if (! query.not) {
+ result.push("highlight=" + $__jsx_encodeURIComponent(query.word));
+ }
+ }
+ return '?' + result.join('&');
+};
+
+var QueryStringParser$highlight$LQueryStringParser$ = QueryStringParser.highlight$LQueryStringParser$;
+
+/**
+ * class Proposal extends Object
+ * @constructor
+ */
+function Proposal() {
+}
+
+/**
+ * @constructor
+ * @param {!number} omit
+ * @param {!number} expect
+ */
+function Proposal$II(omit, expect) {
+ this.omit = omit;
+ this.expect = expect;
+};
+
+Proposal$II.prototype = new Proposal;
+
+/**
+ * class Position extends Object
+ * @constructor
+ */
+function Position() {
+}
+
+/**
+ * @constructor
+ * @param {!string} word
+ * @param {!number} position
+ * @param {!boolean} stemmed
+ */
+function Position$SIB(word, position, stemmed) {
+ this.word = word;
+ this.position = position;
+ this.stemmed = stemmed;
+};
+
+Position$SIB.prototype = new Position;
+
+/**
+ * class SearchUnit extends Object
+ * @constructor
+ */
+function SearchUnit() {
+}
+
+/**
+ * @constructor
+ * @param {!number} id
+ */
+function SearchUnit$I(id) {
+ this.positions = ({ });
+ this.id = id;
+ this._size = 0;
+ this.score = 0;
+ this.startPosition = -1;
+};
+
+SearchUnit$I.prototype = new SearchUnit;
+
+/**
+ * @param {SearchUnit} $this
+ * @param {!string} word
+ * @param {!number} position
+ * @param {!boolean} stemmed
+ */
+SearchUnit.addPosition$LSearchUnit$SIB = function ($this, word, position, stemmed) {
+ /** @type {Position} */
+ var positionObj;
+ positionObj = $this.positions[position + ""];
+ if (! positionObj) {
+ $this._size++;
+ $this.positions[position + ""] = ({word: word, position: position, stemmed: stemmed});
+ } else {
+ if (positionObj.word.length < word.length) {
+ positionObj.word = word;
+ }
+ positionObj.stemmed = positionObj.stemmed && stemmed;
+ }
+};
+
+var SearchUnit$addPosition$LSearchUnit$SIB = SearchUnit.addPosition$LSearchUnit$SIB;
+
+/**
+ * @param {SearchUnit} $this
+ * @param {!number} position
+ * @return {Position}
+ */
+SearchUnit.get$LSearchUnit$I = function ($this, position) {
+ return $this.positions[position + ""];
+};
+
+var SearchUnit$get$LSearchUnit$I = SearchUnit.get$LSearchUnit$I;
+
+/**
+ * @param {SearchUnit} $this
+ * @return {!number}
+ */
+SearchUnit.size$LSearchUnit$ = function ($this) {
+ return $this._size;
+};
+
+var SearchUnit$size$LSearchUnit$ = SearchUnit.size$LSearchUnit$;
+
+/**
+ * @param {SearchUnit} $this
+ * @param {SearchUnit} rhs
+ */
+SearchUnit.merge$LSearchUnit$LSearchUnit$ = function ($this, rhs) {
+ /** @type {!string} */
+ var position;
+ /** @type {Position} */
+ var pos;
+ for (position in rhs.positions) {
+ pos = rhs.positions[position];
+ SearchUnit$addPosition$LSearchUnit$SIB($this, pos.word, pos.position, pos.stemmed);
+ }
+};
+
+var SearchUnit$merge$LSearchUnit$LSearchUnit$ = SearchUnit.merge$LSearchUnit$LSearchUnit$;
+
+/**
+ * @param {SearchUnit} $this
+ * @return {Array.<undefined|Position>}
+ */
+SearchUnit.getPositions$LSearchUnit$ = function ($this) {
+ /** @type {Array.<undefined|Position>} */
+ var result;
+ /** @type {!string} */
+ var pos;
+ result = [ ];
+ for (pos in $this.positions) {
+ result.push($this.positions[pos]);
+ }
+ result.sort((function (a, b) {
+ return a.position - b.position;
+ }));
+ return result;
+};
+
+var SearchUnit$getPositions$LSearchUnit$ = SearchUnit.getPositions$LSearchUnit$;
+
+/**
+ * class SingleResult extends Object
+ * @constructor
+ */
+function SingleResult() {
+}
+
+/**
+ * @constructor
+ */
+function SingleResult$() {
+ this.units = [ ];
+ this.unitIds = [ ];
+ this.or = false;
+ this.not = false;
+ this.searchWord = '';
+};
+
+SingleResult$.prototype = new SingleResult;
+
+/**
+ * @constructor
+ * @param {!string} searchWord
+ * @param {!boolean} or
+ * @param {!boolean} not
+ */
+function SingleResult$SBB(searchWord, or, not) {
+ this.units = [ ];
+ this.unitIds = [ ];
+ this.or = or;
+ this.not = not;
+ this.searchWord = searchWord;
+};
+
+SingleResult$SBB.prototype = new SingleResult;
+
+/**
+ * @param {SingleResult} $this
+ * @param {!number} unitId
+ * @return {SearchUnit}
+ */
+SingleResult.getSearchUnit$LSingleResult$I = function ($this, unitId) {
+ /** @type {!number} */
+ var existing;
+ /** @type {SearchUnit} */
+ var result;
+ existing = $this.unitIds.indexOf(unitId);
+ if (existing === -1) {
+ result = ({positions: ({ }), id: unitId, _size: 0, score: 0, startPosition: -1});
+ $this.units.push(result);
+ $this.unitIds.push(unitId);
+ } else {
+ result = $this.units[existing];
+ }
+ return result;
+};
+
+var SingleResult$getSearchUnit$LSingleResult$I = SingleResult.getSearchUnit$LSingleResult$I;
+
+/**
+ * @param {SingleResult} $this
+ * @param {SingleResult} rhs
+ * @return {SingleResult}
+ */
+SingleResult.merge$LSingleResult$LSingleResult$ = function ($this, rhs) {
+ /** @type {SingleResult} */
+ var result;
+ result = ({units: [ ], unitIds: [ ], or: false, not: false, searchWord: ''});
+ if (rhs.or) {
+ SingleResult$_orMerge$LSingleResult$LSingleResult$LSingleResult$($this, result, rhs);
+ } else {
+ if (rhs.not) {
+ SingleResult$_notMerge$LSingleResult$LSingleResult$LSingleResult$($this, result, rhs);
+ } else {
+ SingleResult$_andMerge$LSingleResult$LSingleResult$LSingleResult$($this, result, rhs);
+ }
+ }
+ return result;
+};
+
+var SingleResult$merge$LSingleResult$LSingleResult$ = SingleResult.merge$LSingleResult$LSingleResult$;
+
+/**
+ * @param {SingleResult} $this
+ * @return {!number}
+ */
+SingleResult.size$LSingleResult$ = function ($this) {
+ return ($this.units.length | 0);
+};
+
+var SingleResult$size$LSingleResult$ = SingleResult.size$LSingleResult$;
+
+/**
+ * @param {SingleResult} $this
+ * @param {SingleResult} result
+ * @param {SingleResult} rhs
+ */
+SingleResult._andMerge$LSingleResult$LSingleResult$LSingleResult$ = function ($this, result, rhs) {
+ /** @type {!number} */
+ var i;
+ /** @type {undefined|!number} */
+ var id;
+ /** @type {SearchUnit} */
+ var lhsSection;
+ for (i = 0; i < $this.unitIds.length; i++) {
+ id = $this.unitIds[i];
+ if (rhs.unitIds.indexOf(id) !== -1) {
+ lhsSection = $this.units[i];
+ result.unitIds.push(id);
+ result.units.push(lhsSection);
+ }
+ }
+};
+
+var SingleResult$_andMerge$LSingleResult$LSingleResult$LSingleResult$ = SingleResult._andMerge$LSingleResult$LSingleResult$LSingleResult$;
+
+/**
+ * @param {SingleResult} $this
+ * @param {SingleResult} result
+ * @param {SingleResult} rhs
+ */
+SingleResult._orMerge$LSingleResult$LSingleResult$LSingleResult$ = function ($this, result, rhs) {
+ /** @type {!number} */
+ var i;
+ /** @type {undefined|!number} */
+ var id;
+ /** @type {SearchUnit} */
+ var rhsSection;
+ /** @type {SearchUnit} */
+ var lhsSection;
+ /** @type {Array.<undefined|!number>} */
+ var unitIds$0;
+ /** @type {Array.<undefined|SearchUnit>} */
+ var units$0;
+ result.unitIds = (unitIds$0 = $this.unitIds).slice(0, unitIds$0.length);
+ result.units = (units$0 = $this.units).slice(0, units$0.length);
+ for (i = 0; i < rhs.unitIds.length; i++) {
+ id = rhs.unitIds[i];
+ rhsSection = rhs.units[i];
+ if (result.unitIds.indexOf(id) !== -1) {
+ lhsSection = result.units[result.unitIds.indexOf(id)];
+ SearchUnit$merge$LSearchUnit$LSearchUnit$(lhsSection, rhsSection);
+ } else {
+ result.unitIds.push(id);
+ result.units.push(rhsSection);
+ }
+ }
+};
+
+var SingleResult$_orMerge$LSingleResult$LSingleResult$LSingleResult$ = SingleResult._orMerge$LSingleResult$LSingleResult$LSingleResult$;
+
+/**
+ * @param {SingleResult} $this
+ * @param {SingleResult} result
+ * @param {SingleResult} rhs
+ */
+SingleResult._notMerge$LSingleResult$LSingleResult$LSingleResult$ = function ($this, result, rhs) {
+ /** @type {!number} */
+ var i;
+ /** @type {undefined|!number} */
+ var id;
+ /** @type {SearchUnit} */
+ var lhsSection;
+ for (i = 0; i < $this.unitIds.length; i++) {
+ id = $this.unitIds[i];
+ if (rhs.unitIds.indexOf(id) === -1) {
+ lhsSection = $this.units[i];
+ result.unitIds.push(id);
+ result.units.push(lhsSection);
+ }
+ }
+};
+
+var SingleResult$_notMerge$LSingleResult$LSingleResult$LSingleResult$ = SingleResult._notMerge$LSingleResult$LSingleResult$LSingleResult$;
+
+/**
+ * class SearchSummary extends Object
+ * @constructor
+ */
+function SearchSummary() {
+}
+
+/**
+ * @constructor
+ */
+function SearchSummary$() {
+ this.sourceResults = [ ];
+ this.result = null;
+ this.oktavia = null;
+};
+
+SearchSummary$.prototype = new SearchSummary;
+
+/**
+ * @constructor
+ * @param {Oktavia} oktavia
+ */
+function SearchSummary$LOktavia$(oktavia) {
+ this.sourceResults = [ ];
+ this.result = null;
+ this.oktavia = oktavia;
+};
+
+SearchSummary$LOktavia$.prototype = new SearchSummary;
+
+/**
+ * @param {SearchSummary} $this
+ * @param {SingleResult} result
+ */
+SearchSummary.addQuery$LSearchSummary$LSingleResult$ = function ($this, result) {
+ $this.sourceResults.push(result);
+};
+
+var SearchSummary$addQuery$LSearchSummary$LSingleResult$ = SearchSummary.addQuery$LSearchSummary$LSingleResult$;
+
+/**
+ * @param {SearchSummary} $this
+ */
+SearchSummary.mergeResult$LSearchSummary$ = function ($this) {
+ $this.result = SearchSummary$mergeResult$LSearchSummary$ALSingleResult$($this, $this.sourceResults);
+};
+
+var SearchSummary$mergeResult$LSearchSummary$ = SearchSummary.mergeResult$LSearchSummary$;
+
+/**
+ * @param {SearchSummary} $this
+ * @param {Array.<undefined|SingleResult>} results
+ * @return {SingleResult}
+ */
+SearchSummary.mergeResult$LSearchSummary$ALSingleResult$ = function ($this, results) {
+ /** @type {SingleResult} */
+ var rhs;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var results$len$0;
+ rhs = results[0];
+ for ((i = 1, results$len$0 = results.length); i < results$len$0; i++) {
+ rhs = SingleResult$merge$LSingleResult$LSingleResult$(rhs, results[i]);
+ }
+ return rhs;
+};
+
+var SearchSummary$mergeResult$LSearchSummary$ALSingleResult$ = SearchSummary.mergeResult$LSearchSummary$ALSingleResult$;
+
+/**
+ * @param {SearchSummary} $this
+ * @return {Array.<undefined|Proposal>}
+ */
+SearchSummary.getProposal$LSearchSummary$ = function ($this) {
+ /** @type {Array.<undefined|Proposal>} */
+ var proposals;
+ /** @type {!number} */
+ var i;
+ /** @type {Array.<undefined|SingleResult>} */
+ var tmpSource;
+ /** @type {!number} */
+ var j;
+ /** @type {SingleResult} */
+ var result;
+ proposals = [ ];
+ for (i = 0; i < $this.sourceResults.length; i++) {
+ tmpSource = [ ];
+ for (j = 0; j < $this.sourceResults.length; j++) {
+ if (i !== j) {
+ tmpSource.push($this.sourceResults[j]);
+ }
+ }
+ result = SearchSummary$mergeResult$LSearchSummary$ALSingleResult$($this, tmpSource);
+ proposals.push(({omit: i, expect: result.units.length}));
+ }
+ proposals.sort((function (a, b) {
+ return b.expect - a.expect;
+ }));
+ return proposals;
+};
+
+var SearchSummary$getProposal$LSearchSummary$ = SearchSummary.getProposal$LSearchSummary$;
+
+/**
+ * @param {SearchSummary} $this
+ * @return {Array.<undefined|SearchUnit>}
+ */
+SearchSummary.getSortedResult$LSearchSummary$ = function ($this) {
+ /** @type {Array.<undefined|SearchUnit>} */
+ var result;
+ /** @type {Array.<undefined|SearchUnit>} */
+ var units$0;
+ result = (units$0 = $this.result.units).slice(0, units$0.length);
+ result.sort((function (a, b) {
+ return b.score - a.score;
+ }));
+ return result;
+};
+
+var SearchSummary$getSortedResult$LSearchSummary$ = SearchSummary.getSortedResult$LSearchSummary$;
+
+/**
+ * @param {SearchSummary} $this
+ * @return {!number}
+ */
+SearchSummary.size$LSearchSummary$ = function ($this) {
+ /** @type {SingleResult} */
+ var this$0;
+ this$0 = $this.result;
+ return (this$0.units.length | 0);
+};
+
+var SearchSummary$size$LSearchSummary$ = SearchSummary.size$LSearchSummary$;
+
+/**
+ * @param {SearchSummary} $this
+ * @param {SingleResult} result
+ */
+SearchSummary.add$LSearchSummary$LSingleResult$ = function ($this, result) {
+ $this.sourceResults.push(result);
+};
+
+var SearchSummary$add$LSearchSummary$LSingleResult$ = SearchSummary.add$LSearchSummary$LSingleResult$;
+
+/**
+ * class Style extends Object
+ * @constructor
+ */
+function Style() {
+}
+
+/**
+ * @constructor
+ * @param {!string} mode
+ */
+function Style$S(mode) {
+ this.styles = null;
+ this.escapeHTML = false;
+ switch (mode) {
+ case 'console':
+ this.styles = Style.console;
+ break;
+ case 'html':
+ this.styles = Style.html;
+ break;
+ case 'ignore':
+ this.styles = Style.ignore;
+ break;
+ default:
+ this.styles = Style.ignore;
+ break;
+ }
+ this.escapeHTML = mode === 'html';
+};
+
+Style$S.prototype = new Style;
+
+/**
+ * @param {!string} source
+ * @return {!string}
+ */
+Style.prototype.convert$S = function (source) {
+ /** @type {_HTMLHandler} */
+ var handler;
+ /** @type {SAXParser} */
+ var parser;
+ handler = new _HTMLHandler$HASB(this.styles, this.escapeHTML);
+ parser = new SAXParser$LSAXHandler$(handler);
+ parser.parse$S(source);
+ return handler.text.join('');
+};
+
+/**
+ * class Stemmer
+ * @constructor
+ */
+function Stemmer() {
+}
+
+Stemmer.prototype.$__jsx_implements_Stemmer = true;
+
+/**
+ * @constructor
+ */
+function Stemmer$() {
+};
+
+Stemmer$.prototype = new Stemmer;
+
+/**
+ * class BaseStemmer extends Object
+ * @constructor
+ */
+function BaseStemmer() {
+}
+
+$__jsx_merge_interface(BaseStemmer, Stemmer);
+
+/**
+ * @constructor
+ */
+function BaseStemmer$() {
+ /** @type {!string} */
+ var current$0;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var limit$0;
+ this.cache = ({ });
+ current$0 = this.current = "";
+ cursor$0 = this.cursor = 0;
+ limit$0 = this.limit = current$0.length;
+ this.limit_backward = 0;
+ this.bra = cursor$0;
+ this.ket = limit$0;
+};
+
+BaseStemmer$.prototype = new BaseStemmer;
+
+/**
+ * @param {!string} value
+ */
+BaseStemmer.prototype.setCurrent$S = function (value) {
+ /** @type {!string} */
+ var current$0;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var limit$0;
+ current$0 = this.current = value;
+ cursor$0 = this.cursor = 0;
+ limit$0 = this.limit = current$0.length;
+ this.limit_backward = 0;
+ this.bra = cursor$0;
+ this.ket = limit$0;
+};
+
+/**
+ * @return {!string}
+ */
+BaseStemmer.prototype.getCurrent$ = function () {
+ return this.current;
+};
+
+/**
+ * @param {BaseStemmer} other
+ */
+BaseStemmer.prototype.copy_from$LBaseStemmer$ = function (other) {
+ this.current = other.current;
+ this.cursor = other.cursor;
+ this.limit = other.limit;
+ this.limit_backward = other.limit_backward;
+ this.bra = other.bra;
+ this.ket = other.ket;
+};
+
+/**
+ * @param {Array.<undefined|!number>} s
+ * @param {!number} min
+ * @param {!number} max
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.in_grouping$AIII = function (s, min, max) {
+ /** @type {!number} */
+ var ch;
+ if (this.cursor >= this.limit) {
+ return false;
+ }
+ ch = this.current.charCodeAt(this.cursor);
+ if (ch > max || ch < min) {
+ return false;
+ }
+ ch -= min;
+ if ((s[ch >>> 3] & 0x1 << (ch & 0x7)) === 0) {
+ return false;
+ }
+ this.cursor++;
+ return true;
+};
+
+/**
+ * @param {Array.<undefined|!number>} s
+ * @param {!number} min
+ * @param {!number} max
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.in_grouping_b$AIII = function (s, min, max) {
+ /** @type {!number} */
+ var ch;
+ if (this.cursor <= this.limit_backward) {
+ return false;
+ }
+ ch = this.current.charCodeAt(this.cursor - 1);
+ if (ch > max || ch < min) {
+ return false;
+ }
+ ch -= min;
+ if ((s[ch >>> 3] & 0x1 << (ch & 0x7)) === 0) {
+ return false;
+ }
+ this.cursor--;
+ return true;
+};
+
+/**
+ * @param {Array.<undefined|!number>} s
+ * @param {!number} min
+ * @param {!number} max
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.out_grouping$AIII = function (s, min, max) {
+ /** @type {!number} */
+ var ch;
+ if (this.cursor >= this.limit) {
+ return false;
+ }
+ ch = this.current.charCodeAt(this.cursor);
+ if (ch > max || ch < min) {
+ this.cursor++;
+ return true;
+ }
+ ch -= min;
+ if ((s[ch >>> 3] & 0X1 << (ch & 0x7)) === 0) {
+ this.cursor++;
+ return true;
+ }
+ return false;
+};
+
+/**
+ * @param {Array.<undefined|!number>} s
+ * @param {!number} min
+ * @param {!number} max
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.out_grouping_b$AIII = function (s, min, max) {
+ /** @type {!number} */
+ var ch;
+ if (this.cursor <= this.limit_backward) {
+ return false;
+ }
+ ch = this.current.charCodeAt(this.cursor - 1);
+ if (ch > max || ch < min) {
+ this.cursor--;
+ return true;
+ }
+ ch -= min;
+ if ((s[ch >>> 3] & 0x1 << (ch & 0x7)) === 0) {
+ this.cursor--;
+ return true;
+ }
+ return false;
+};
+
+/**
+ * @param {!number} min
+ * @param {!number} max
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.in_range$II = function (min, max) {
+ /** @type {!number} */
+ var ch;
+ if (this.cursor >= this.limit) {
+ return false;
+ }
+ ch = this.current.charCodeAt(this.cursor);
+ if (ch > max || ch < min) {
+ return false;
+ }
+ this.cursor++;
+ return true;
+};
+
+/**
+ * @param {!number} min
+ * @param {!number} max
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.in_range_b$II = function (min, max) {
+ /** @type {!number} */
+ var ch;
+ if (this.cursor <= this.limit_backward) {
+ return false;
+ }
+ ch = this.current.charCodeAt(this.cursor - 1);
+ if (ch > max || ch < min) {
+ return false;
+ }
+ this.cursor--;
+ return true;
+};
+
+/**
+ * @param {!number} min
+ * @param {!number} max
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.out_range$II = function (min, max) {
+ /** @type {!number} */
+ var ch;
+ if (this.cursor >= this.limit) {
+ return false;
+ }
+ ch = this.current.charCodeAt(this.cursor);
+ if (! (ch > max || ch < min)) {
+ return false;
+ }
+ this.cursor++;
+ return true;
+};
+
+/**
+ * @param {!number} min
+ * @param {!number} max
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.out_range_b$II = function (min, max) {
+ /** @type {!number} */
+ var ch;
+ if (this.cursor <= this.limit_backward) {
+ return false;
+ }
+ ch = this.current.charCodeAt(this.cursor - 1);
+ if (! (ch > max || ch < min)) {
+ return false;
+ }
+ this.cursor--;
+ return true;
+};
+
+/**
+ * @param {!number} s_size
+ * @param {!string} s
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.eq_s$IS = function (s_size, s) {
+ /** @type {!number} */
+ var cursor$0;
+ if (this.limit - this.cursor < s_size) {
+ return false;
+ }
+ if (this.current.slice(cursor$0 = this.cursor, cursor$0 + s_size) !== s) {
+ return false;
+ }
+ this.cursor += s_size;
+ return true;
+};
+
+/**
+ * @param {!number} s_size
+ * @param {!string} s
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.eq_s_b$IS = function (s_size, s) {
+ /** @type {!number} */
+ var cursor$0;
+ if (this.cursor - this.limit_backward < s_size) {
+ return false;
+ }
+ if (this.current.slice((cursor$0 = this.cursor) - s_size, cursor$0) !== s) {
+ return false;
+ }
+ this.cursor -= s_size;
+ return true;
+};
+
+/**
+ * @param {!string} s
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.eq_v$S = function (s) {
+ return this.eq_s$IS(s.length, s);
+};
+
+/**
+ * @param {!string} s
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.eq_v_b$S = function (s) {
+ return this.eq_s_b$IS(s.length, s);
+};
+
+/**
+ * @param {Array.<undefined|Among>} v
+ * @param {!number} v_size
+ * @return {!number}
+ */
+BaseStemmer.prototype.find_among$ALAmong$I = function (v, v_size) {
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var j;
+ /** @type {!number} */
+ var c;
+ /** @type {!number} */
+ var l;
+ /** @type {!number} */
+ var common_i;
+ /** @type {!number} */
+ var common_j;
+ /** @type {!boolean} */
+ var first_key_inspected;
+ /** @type {!number} */
+ var k;
+ /** @type {!number} */
+ var diff;
+ /** @type {!number} */
+ var common;
+ /** @type {Among} */
+ var w;
+ /** @type {!number} */
+ var i2;
+ /** @type {!boolean} */
+ var res;
+ i = 0;
+ j = v_size;
+ c = this.cursor;
+ l = this.limit;
+ common_i = 0;
+ common_j = 0;
+ first_key_inspected = false;
+ while (true) {
+ k = i + (j - i >>> 1);
+ diff = 0;
+ common = (common_i < common_j ? common_i : common_j);
+ w = v[k];
+ for (i2 = common; i2 < w.s_size; i2++) {
+ if (c + common === l) {
+ diff = -1;
+ break;
+ }
+ diff = this.current.charCodeAt(c + common) - w.s.charCodeAt(i2);
+ if (diff !== 0) {
+ break;
+ }
+ common++;
+ }
+ if (diff < 0) {
+ j = k;
+ common_j = common;
+ } else {
+ i = k;
+ common_i = common;
+ }
+ if (j - i <= 1) {
+ if (i > 0) {
+ break;
+ }
+ if (j === i) {
+ break;
+ }
+ if (first_key_inspected) {
+ break;
+ }
+ first_key_inspected = true;
+ }
+ }
+ while (true) {
+ w = v[i];
+ if (common_i >= w.s_size) {
+ this.cursor = (c + w.s_size | 0);
+ if (w.method == null) {
+ return w.result;
+ }
+ res = w.method(w.instance);
+ this.cursor = (c + w.s_size | 0);
+ if (res) {
+ return w.result;
+ }
+ }
+ i = w.substring_i;
+ if (i < 0) {
+ return 0;
+ }
+ }
+ return -1;
+};
+
+/**
+ * @param {Array.<undefined|Among>} v
+ * @param {!number} v_size
+ * @return {!number}
+ */
+BaseStemmer.prototype.find_among_b$ALAmong$I = function (v, v_size) {
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var j;
+ /** @type {!number} */
+ var c;
+ /** @type {!number} */
+ var lb;
+ /** @type {!number} */
+ var common_i;
+ /** @type {!number} */
+ var common_j;
+ /** @type {!boolean} */
+ var first_key_inspected;
+ /** @type {!number} */
+ var k;
+ /** @type {!number} */
+ var diff;
+ /** @type {!number} */
+ var common;
+ /** @type {Among} */
+ var w;
+ /** @type {!number} */
+ var i2;
+ /** @type {!boolean} */
+ var res;
+ i = 0;
+ j = v_size;
+ c = this.cursor;
+ lb = this.limit_backward;
+ common_i = 0;
+ common_j = 0;
+ first_key_inspected = false;
+ while (true) {
+ k = i + (j - i >> 1);
+ diff = 0;
+ common = (common_i < common_j ? common_i : common_j);
+ w = v[k];
+ for (i2 = w.s_size - 1 - common; i2 >= 0; i2--) {
+ if (c - common === lb) {
+ diff = -1;
+ break;
+ }
+ diff = this.current.charCodeAt(c - 1 - common) - w.s.charCodeAt(i2);
+ if (diff !== 0) {
+ break;
+ }
+ common++;
+ }
+ if (diff < 0) {
+ j = k;
+ common_j = common;
+ } else {
+ i = k;
+ common_i = common;
+ }
+ if (j - i <= 1) {
+ if (i > 0) {
+ break;
+ }
+ if (j === i) {
+ break;
+ }
+ if (first_key_inspected) {
+ break;
+ }
+ first_key_inspected = true;
+ }
+ }
+ while (true) {
+ w = v[i];
+ if (common_i >= w.s_size) {
+ this.cursor = (c - w.s_size | 0);
+ if (w.method == null) {
+ return w.result;
+ }
+ res = w.method(this);
+ this.cursor = (c - w.s_size | 0);
+ if (res) {
+ return w.result;
+ }
+ }
+ i = w.substring_i;
+ if (i < 0) {
+ return 0;
+ }
+ }
+ return -1;
+};
+
+/**
+ * @param {!number} c_bra
+ * @param {!number} c_ket
+ * @param {!string} s
+ * @return {!number}
+ */
+BaseStemmer.prototype.replace_s$IIS = function (c_bra, c_ket, s) {
+ /** @type {!number} */
+ var adjustment;
+ adjustment = s.length - (c_ket - c_bra);
+ this.current = this.current.slice(0, c_bra) + s + this.current.slice(c_ket);
+ this.limit += (adjustment | 0);
+ if (this.cursor >= c_ket) {
+ this.cursor += (adjustment | 0);
+ } else {
+ if (this.cursor > c_bra) {
+ this.cursor = c_bra;
+ }
+ }
+ return (adjustment | 0);
+};
+
+/**
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.slice_check$ = function () {
+ /** @type {!number} */
+ var bra$0;
+ /** @type {!number} */
+ var ket$0;
+ /** @type {!number} */
+ var limit$0;
+ return ((bra$0 = this.bra) < 0 || bra$0 > (ket$0 = this.ket) || ket$0 > (limit$0 = this.limit) || limit$0 > this.current.length ? false : true);
+};
+
+/**
+ * @param {!string} s
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.slice_from$S = function (s) {
+ /** @type {!boolean} */
+ var result;
+ /** @type {!number} */
+ var bra$0;
+ /** @type {!number} */
+ var ket$0;
+ /** @type {!number} */
+ var limit$0;
+ result = false;
+ if ((bra$0 = this.bra) < 0 || bra$0 > (ket$0 = this.ket) || ket$0 > (limit$0 = this.limit) || limit$0 > this.current.length ? false : true) {
+ this.replace_s$IIS(this.bra, this.ket, s);
+ result = true;
+ }
+ return result;
+};
+
+/**
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.slice_del$ = function () {
+ return this.slice_from$S("");
+};
+
+/**
+ * @param {!number} c_bra
+ * @param {!number} c_ket
+ * @param {!string} s
+ */
+BaseStemmer.prototype.insert$IIS = function (c_bra, c_ket, s) {
+ /** @type {!number} */
+ var adjustment;
+ adjustment = this.replace_s$IIS(c_bra, c_ket, s);
+ if (c_bra <= this.bra) {
+ this.bra += (adjustment | 0);
+ }
+ if (c_bra <= this.ket) {
+ this.ket += (adjustment | 0);
+ }
+};
+
+/**
+ * @param {!string} s
+ * @return {!string}
+ */
+BaseStemmer.prototype.slice_to$S = function (s) {
+ /** @type {!string} */
+ var result;
+ /** @type {!number} */
+ var bra$0;
+ /** @type {!number} */
+ var ket$0;
+ /** @type {!number} */
+ var limit$0;
+ result = '';
+ if ((bra$0 = this.bra) < 0 || bra$0 > (ket$0 = this.ket) || ket$0 > (limit$0 = this.limit) || limit$0 > this.current.length ? false : true) {
+ result = this.current.slice(this.bra, this.ket);
+ }
+ return result;
+};
+
+/**
+ * @param {!string} s
+ * @return {!string}
+ */
+BaseStemmer.prototype.assign_to$S = function (s) {
+ return this.current.slice(0, this.limit);
+};
+
+/**
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.stem$ = function () {
+ return false;
+};
+
+/**
+ * @param {!string} word
+ * @return {!string}
+ */
+BaseStemmer.prototype.stemWord$S = function (word) {
+ /** @type {undefined|!string} */
+ var result;
+ /** @type {!string} */
+ var current$0;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var limit$0;
+ result = this.cache['.' + word];
+ if (result == null) {
+ current$0 = this.current = word;
+ cursor$0 = this.cursor = 0;
+ limit$0 = this.limit = current$0.length;
+ this.limit_backward = 0;
+ this.bra = cursor$0;
+ this.ket = limit$0;
+ this.stem$();
+ result = this.current;
+ this.cache['.' + word] = result;
+ }
+ return result;
+};
+
+/**
+ * @param {Array.<undefined|!string>} words
+ * @return {Array.<undefined|!string>}
+ */
+BaseStemmer.prototype.stemWords$AS = function (words) {
+ /** @type {Array.<undefined|!string>} */
+ var results;
+ /** @type {!number} */
+ var i;
+ /** @type {undefined|!string} */
+ var word;
+ /** @type {undefined|!string} */
+ var result;
+ /** @type {!string} */
+ var current$0;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var limit$0;
+ results = [ ];
+ for (i = 0; i < words.length; i++) {
+ word = words[i];
+ result = this.cache['.' + word];
+ if (result == null) {
+ current$0 = this.current = word;
+ cursor$0 = this.cursor = 0;
+ limit$0 = this.limit = current$0.length;
+ this.limit_backward = 0;
+ this.bra = cursor$0;
+ this.ket = limit$0;
+ this.stem$();
+ result = this.current;
+ this.cache['.' + word] = result;
+ }
+ results.push(result);
+ }
+ return results;
+};
+
+/**
+ * class PortugueseStemmer extends BaseStemmer
+ * @constructor
+ */
+function PortugueseStemmer() {
+}
+
+PortugueseStemmer.prototype = new BaseStemmer;
+/**
+ * @constructor
+ */
+function PortugueseStemmer$() {
+ BaseStemmer$.call(this);
+ this.I_p2 = 0;
+ this.I_p1 = 0;
+ this.I_pV = 0;
+};
+
+PortugueseStemmer$.prototype = new PortugueseStemmer;
+
+/**
+ * @param {PortugueseStemmer} other
+ */
+PortugueseStemmer.prototype.copy_from$LPortugueseStemmer$ = function (other) {
+ this.I_p2 = other.I_p2;
+ this.I_p1 = other.I_p1;
+ this.I_pV = other.I_pV;
+ BaseStemmer.prototype.copy_from$LBaseStemmer$.call(this, other);
+};
+
+/**
+ * @return {!boolean}
+ */
+PortugueseStemmer.prototype.r_prelude$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var v_1;
+ /** @type {!boolean} */
+ var lab1;
+replab0:
+ while (true) {
+ v_1 = this.cursor;
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ this.bra = this.cursor;
+ among_var = this.find_among$ALAmong$I(PortugueseStemmer.a_0, 3);
+ if (among_var === 0) {
+ break lab1;
+ }
+ this.ket = this.cursor;
+ switch (among_var) {
+ case 0:
+ break lab1;
+ case 1:
+ if (! this.slice_from$S("a~")) {
+ return false;
+ }
+ break;
+ case 2:
+ if (! this.slice_from$S("o~")) {
+ return false;
+ }
+ break;
+ case 3:
+ if (this.cursor >= this.limit) {
+ break lab1;
+ }
+ this.cursor++;
+ break;
+ }
+ continue replab0;
+ }
+ this.cursor = v_1;
+ break replab0;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+PortugueseStemmer.prototype.r_mark_regions$ = function () {
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var v_3;
+ /** @type {!number} */
+ var v_6;
+ /** @type {!number} */
+ var v_8;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!boolean} */
+ var lab2;
+ /** @type {!boolean} */
+ var lab3;
+ /** @type {!boolean} */
+ var lab4;
+ /** @type {!boolean} */
+ var lab6;
+ /** @type {!boolean} */
+ var lab8;
+ /** @type {!boolean} */
+ var lab9;
+ /** @type {!boolean} */
+ var lab10;
+ /** @type {!boolean} */
+ var lab12;
+ /** @type {!boolean} */
+ var lab13;
+ /** @type {!boolean} */
+ var lab15;
+ /** @type {!boolean} */
+ var lab17;
+ /** @type {!boolean} */
+ var lab19;
+ /** @type {!boolean} */
+ var lab21;
+ /** @type {!number} */
+ var limit$0;
+ /** @type {!number} */
+ var cursor$0;
+ this.I_pV = limit$0 = this.limit;
+ this.I_p1 = limit$0;
+ this.I_p2 = limit$0;
+ v_1 = this.cursor;
+ lab0 = true;
+lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ v_2 = this.cursor;
+ lab2 = true;
+ lab2:
+ while (lab2 === true) {
+ lab2 = false;
+ if (! this.in_grouping$AIII(PortugueseStemmer.g_v, 97, 250)) {
+ break lab2;
+ }
+ lab3 = true;
+ lab3:
+ while (lab3 === true) {
+ lab3 = false;
+ v_3 = this.cursor;
+ lab4 = true;
+ lab4:
+ while (lab4 === true) {
+ lab4 = false;
+ if (! this.out_grouping$AIII(PortugueseStemmer.g_v, 97, 250)) {
+ break lab4;
+ }
+ golab5:
+ while (true) {
+ lab6 = true;
+ lab6:
+ while (lab6 === true) {
+ lab6 = false;
+ if (! this.in_grouping$AIII(PortugueseStemmer.g_v, 97, 250)) {
+ break lab6;
+ }
+ break golab5;
+ }
+ if (this.cursor >= this.limit) {
+ break lab4;
+ }
+ this.cursor++;
+ }
+ break lab3;
+ }
+ this.cursor = v_3;
+ if (! this.in_grouping$AIII(PortugueseStemmer.g_v, 97, 250)) {
+ break lab2;
+ }
+ golab7:
+ while (true) {
+ lab8 = true;
+ lab8:
+ while (lab8 === true) {
+ lab8 = false;
+ if (! this.out_grouping$AIII(PortugueseStemmer.g_v, 97, 250)) {
+ break lab8;
+ }
+ break golab7;
+ }
+ if (this.cursor >= this.limit) {
+ break lab2;
+ }
+ this.cursor++;
+ }
+ }
+ break lab1;
+ }
+ this.cursor = v_2;
+ if (! this.out_grouping$AIII(PortugueseStemmer.g_v, 97, 250)) {
+ break lab0;
+ }
+ lab9 = true;
+ lab9:
+ while (lab9 === true) {
+ lab9 = false;
+ v_6 = this.cursor;
+ lab10 = true;
+ lab10:
+ while (lab10 === true) {
+ lab10 = false;
+ if (! this.out_grouping$AIII(PortugueseStemmer.g_v, 97, 250)) {
+ break lab10;
+ }
+ golab11:
+ while (true) {
+ lab12 = true;
+ lab12:
+ while (lab12 === true) {
+ lab12 = false;
+ if (! this.in_grouping$AIII(PortugueseStemmer.g_v, 97, 250)) {
+ break lab12;
+ }
+ break golab11;
+ }
+ if (this.cursor >= this.limit) {
+ break lab10;
+ }
+ this.cursor++;
+ }
+ break lab9;
+ }
+ this.cursor = v_6;
+ if (! this.in_grouping$AIII(PortugueseStemmer.g_v, 97, 250)) {
+ break lab0;
+ }
+ if (this.cursor >= this.limit) {
+ break lab0;
+ }
+ this.cursor++;
+ }
+ }
+ this.I_pV = this.cursor;
+ }
+ cursor$0 = this.cursor = v_1;
+ v_8 = cursor$0;
+ lab13 = true;
+lab13:
+ while (lab13 === true) {
+ lab13 = false;
+ golab14:
+ while (true) {
+ lab15 = true;
+ lab15:
+ while (lab15 === true) {
+ lab15 = false;
+ if (! this.in_grouping$AIII(PortugueseStemmer.g_v, 97, 250)) {
+ break lab15;
+ }
+ break golab14;
+ }
+ if (this.cursor >= this.limit) {
+ break lab13;
+ }
+ this.cursor++;
+ }
+ golab16:
+ while (true) {
+ lab17 = true;
+ lab17:
+ while (lab17 === true) {
+ lab17 = false;
+ if (! this.out_grouping$AIII(PortugueseStemmer.g_v, 97, 250)) {
+ break lab17;
+ }
+ break golab16;
+ }
+ if (this.cursor >= this.limit) {
+ break lab13;
+ }
+ this.cursor++;
+ }
+ this.I_p1 = this.cursor;
+ golab18:
+ while (true) {
+ lab19 = true;
+ lab19:
+ while (lab19 === true) {
+ lab19 = false;
+ if (! this.in_grouping$AIII(PortugueseStemmer.g_v, 97, 250)) {
+ break lab19;
+ }
+ break golab18;
+ }
+ if (this.cursor >= this.limit) {
+ break lab13;
+ }
+ this.cursor++;
+ }
+ golab20:
+ while (true) {
+ lab21 = true;
+ lab21:
+ while (lab21 === true) {
+ lab21 = false;
+ if (! this.out_grouping$AIII(PortugueseStemmer.g_v, 97, 250)) {
+ break lab21;
+ }
+ break golab20;
+ }
+ if (this.cursor >= this.limit) {
+ break lab13;
+ }
+ this.cursor++;
+ }
+ this.I_p2 = this.cursor;
+ }
+ this.cursor = v_8;
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+PortugueseStemmer.prototype.r_postlude$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var v_1;
+ /** @type {!boolean} */
+ var lab1;
+replab0:
+ while (true) {
+ v_1 = this.cursor;
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ this.bra = this.cursor;
+ among_var = this.find_among$ALAmong$I(PortugueseStemmer.a_1, 3);
+ if (among_var === 0) {
+ break lab1;
+ }
+ this.ket = this.cursor;
+ switch (among_var) {
+ case 0:
+ break lab1;
+ case 1:
+ if (! this.slice_from$S("\u00E3")) {
+ return false;
+ }
+ break;
+ case 2:
+ if (! this.slice_from$S("\u00F5")) {
+ return false;
+ }
+ break;
+ case 3:
+ if (this.cursor >= this.limit) {
+ break lab1;
+ }
+ this.cursor++;
+ break;
+ }
+ continue replab0;
+ }
+ this.cursor = v_1;
+ break replab0;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+PortugueseStemmer.prototype.r_RV$ = function () {
+ return (! (this.I_pV <= this.cursor) ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+PortugueseStemmer.prototype.r_R1$ = function () {
+ return (! (this.I_p1 <= this.cursor) ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+PortugueseStemmer.prototype.r_R2$ = function () {
+ return (! (this.I_p2 <= this.cursor) ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+PortugueseStemmer.prototype.r_standard_suffix$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var v_3;
+ /** @type {!number} */
+ var v_4;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!boolean} */
+ var lab2;
+ /** @type {!boolean} */
+ var lab3;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var cursor$1;
+ /** @type {!number} */
+ var cursor$2;
+ this.ket = this.cursor;
+ among_var = this.find_among_b$ALAmong$I(PortugueseStemmer.a_5, 45);
+ if (among_var === 0) {
+ return false;
+ }
+ this.bra = this.cursor;
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ if (! (! (this.I_p2 <= this.cursor) ? false : true)) {
+ return false;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 2:
+ if (! (! (this.I_p2 <= this.cursor) ? false : true)) {
+ return false;
+ }
+ if (! this.slice_from$S("log")) {
+ return false;
+ }
+ break;
+ case 3:
+ if (! (! (this.I_p2 <= this.cursor) ? false : true)) {
+ return false;
+ }
+ if (! this.slice_from$S("u")) {
+ return false;
+ }
+ break;
+ case 4:
+ if (! (! (this.I_p2 <= this.cursor) ? false : true)) {
+ return false;
+ }
+ if (! this.slice_from$S("ente")) {
+ return false;
+ }
+ break;
+ case 5:
+ if (! (! (this.I_p1 <= this.cursor) ? false : true)) {
+ return false;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ v_1 = this.limit - this.cursor;
+ lab0 = true;
+ lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ this.ket = this.cursor;
+ among_var = this.find_among_b$ALAmong$I(PortugueseStemmer.a_2, 4);
+ if (among_var === 0) {
+ this.cursor = this.limit - v_1;
+ break lab0;
+ }
+ this.bra = cursor$0 = this.cursor;
+ if (! (! (this.I_p2 <= cursor$0) ? false : true)) {
+ this.cursor = this.limit - v_1;
+ break lab0;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ switch (among_var) {
+ case 0:
+ this.cursor = this.limit - v_1;
+ break lab0;
+ case 1:
+ this.ket = this.cursor;
+ if (! this.eq_s_b$IS(2, "at")) {
+ this.cursor = this.limit - v_1;
+ break lab0;
+ }
+ this.bra = cursor$1 = this.cursor;
+ if (! (! (this.I_p2 <= cursor$1) ? false : true)) {
+ this.cursor = this.limit - v_1;
+ break lab0;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ }
+ }
+ break;
+ case 6:
+ if (! (! (this.I_p2 <= this.cursor) ? false : true)) {
+ return false;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ v_2 = this.limit - this.cursor;
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ this.ket = this.cursor;
+ among_var = this.find_among_b$ALAmong$I(PortugueseStemmer.a_3, 3);
+ if (among_var === 0) {
+ this.cursor = this.limit - v_2;
+ break lab1;
+ }
+ this.bra = this.cursor;
+ switch (among_var) {
+ case 0:
+ this.cursor = this.limit - v_2;
+ break lab1;
+ case 1:
+ if (! (! (this.I_p2 <= this.cursor) ? false : true)) {
+ this.cursor = this.limit - v_2;
+ break lab1;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ }
+ }
+ break;
+ case 7:
+ if (! (! (this.I_p2 <= this.cursor) ? false : true)) {
+ return false;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ v_3 = this.limit - this.cursor;
+ lab2 = true;
+ lab2:
+ while (lab2 === true) {
+ lab2 = false;
+ this.ket = this.cursor;
+ among_var = this.find_among_b$ALAmong$I(PortugueseStemmer.a_4, 3);
+ if (among_var === 0) {
+ this.cursor = this.limit - v_3;
+ break lab2;
+ }
+ this.bra = this.cursor;
+ switch (among_var) {
+ case 0:
+ this.cursor = this.limit - v_3;
+ break lab2;
+ case 1:
+ if (! (! (this.I_p2 <= this.cursor) ? false : true)) {
+ this.cursor = this.limit - v_3;
+ break lab2;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ }
+ }
+ break;
+ case 8:
+ if (! (! (this.I_p2 <= this.cursor) ? false : true)) {
+ return false;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ v_4 = this.limit - this.cursor;
+ lab3 = true;
+ lab3:
+ while (lab3 === true) {
+ lab3 = false;
+ this.ket = this.cursor;
+ if (! this.eq_s_b$IS(2, "at")) {
+ this.cursor = this.limit - v_4;
+ break lab3;
+ }
+ this.bra = cursor$2 = this.cursor;
+ if (! (! (this.I_p2 <= cursor$2) ? false : true)) {
+ this.cursor = this.limit - v_4;
+ break lab3;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ }
+ break;
+ case 9:
+ if (! (! (this.I_pV <= this.cursor) ? false : true)) {
+ return false;
+ }
+ if (! this.eq_s_b$IS(1, "e")) {
+ return false;
+ }
+ if (! this.slice_from$S("ir")) {
+ return false;
+ }
+ break;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+PortugueseStemmer.prototype.r_verb_suffix$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var cursor$1;
+ /** @type {!number} */
+ var cursor$2;
+ v_1 = this.limit - (cursor$0 = this.cursor);
+ if (cursor$0 < this.I_pV) {
+ return false;
+ }
+ cursor$1 = this.cursor = this.I_pV;
+ v_2 = this.limit_backward;
+ this.limit_backward = cursor$1;
+ cursor$2 = this.cursor = this.limit - v_1;
+ this.ket = cursor$2;
+ among_var = this.find_among_b$ALAmong$I(PortugueseStemmer.a_6, 120);
+ if (among_var === 0) {
+ this.limit_backward = v_2;
+ return false;
+ }
+ this.bra = this.cursor;
+ switch (among_var) {
+ case 0:
+ this.limit_backward = v_2;
+ return false;
+ case 1:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ }
+ this.limit_backward = v_2;
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+PortugueseStemmer.prototype.r_residual_suffix$ = function () {
+ /** @type {!number} */
+ var among_var;
+ this.ket = this.cursor;
+ among_var = this.find_among_b$ALAmong$I(PortugueseStemmer.a_7, 7);
+ if (among_var === 0) {
+ return false;
+ }
+ this.bra = this.cursor;
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ if (! (! (this.I_pV <= this.cursor) ? false : true)) {
+ return false;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+PortugueseStemmer.prototype.r_residual_form$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var v_3;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var cursor$1;
+ this.ket = this.cursor;
+ among_var = this.find_among_b$ALAmong$I(PortugueseStemmer.a_8, 4);
+ if (among_var === 0) {
+ return false;
+ }
+ this.bra = this.cursor;
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ if (! (! (this.I_pV <= this.cursor) ? false : true)) {
+ return false;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ this.ket = this.cursor;
+ lab0 = true;
+ lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ v_1 = this.limit - this.cursor;
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ if (! this.eq_s_b$IS(1, "u")) {
+ break lab1;
+ }
+ this.bra = cursor$0 = this.cursor;
+ v_2 = this.limit - cursor$0;
+ if (! this.eq_s_b$IS(1, "g")) {
+ break lab1;
+ }
+ this.cursor = this.limit - v_2;
+ break lab0;
+ }
+ this.cursor = this.limit - v_1;
+ if (! this.eq_s_b$IS(1, "i")) {
+ return false;
+ }
+ this.bra = cursor$1 = this.cursor;
+ v_3 = this.limit - cursor$1;
+ if (! this.eq_s_b$IS(1, "c")) {
+ return false;
+ }
+ this.cursor = this.limit - v_3;
+ }
+ if (! (! (this.I_pV <= this.cursor) ? false : true)) {
+ return false;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 2:
+ if (! this.slice_from$S("c")) {
+ return false;
+ }
+ break;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+PortugueseStemmer.prototype.stem$ = function () {
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var v_3;
+ /** @type {!number} */
+ var v_4;
+ /** @type {!number} */
+ var v_5;
+ /** @type {!number} */
+ var v_6;
+ /** @type {!number} */
+ var v_7;
+ /** @type {!number} */
+ var v_8;
+ /** @type {!number} */
+ var v_10;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!boolean} */
+ var lab2;
+ /** @type {!boolean} */
+ var lab3;
+ /** @type {!boolean} */
+ var lab4;
+ /** @type {!boolean} */
+ var lab5;
+ /** @type {!boolean} */
+ var lab6;
+ /** @type {!boolean} */
+ var lab7;
+ /** @type {!boolean} */
+ var lab8;
+ /** @type {!boolean} */
+ var lab9;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var cursor$1;
+ /** @type {!number} */
+ var cursor$2;
+ /** @type {!number} */
+ var limit$0;
+ /** @type {!number} */
+ var cursor$3;
+ /** @type {!number} */
+ var cursor$4;
+ /** @type {!number} */
+ var limit$1;
+ /** @type {!number} */
+ var cursor$5;
+ /** @type {!number} */
+ var cursor$6;
+ v_1 = this.cursor;
+ lab0 = true;
+lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ if (! this.r_prelude$()) {
+ break lab0;
+ }
+ }
+ cursor$0 = this.cursor = v_1;
+ v_2 = cursor$0;
+ lab1 = true;
+lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ if (! this.r_mark_regions$()) {
+ break lab1;
+ }
+ }
+ cursor$4 = this.cursor = v_2;
+ this.limit_backward = cursor$4;
+ cursor$5 = this.cursor = limit$1 = this.limit;
+ v_3 = limit$1 - cursor$5;
+ lab2 = true;
+lab2:
+ while (lab2 === true) {
+ lab2 = false;
+ lab3 = true;
+ lab3:
+ while (lab3 === true) {
+ lab3 = false;
+ v_4 = this.limit - this.cursor;
+ lab4 = true;
+ lab4:
+ while (lab4 === true) {
+ lab4 = false;
+ v_5 = this.limit - this.cursor;
+ lab5 = true;
+ lab5:
+ while (lab5 === true) {
+ lab5 = false;
+ v_6 = this.limit - this.cursor;
+ lab6 = true;
+ lab6:
+ while (lab6 === true) {
+ lab6 = false;
+ if (! this.r_standard_suffix$()) {
+ break lab6;
+ }
+ break lab5;
+ }
+ this.cursor = this.limit - v_6;
+ if (! this.r_verb_suffix$()) {
+ break lab4;
+ }
+ }
+ cursor$3 = this.cursor = (limit$0 = this.limit) - v_5;
+ v_7 = limit$0 - cursor$3;
+ lab7 = true;
+ lab7:
+ while (lab7 === true) {
+ lab7 = false;
+ this.ket = this.cursor;
+ if (! this.eq_s_b$IS(1, "i")) {
+ break lab7;
+ }
+ this.bra = cursor$1 = this.cursor;
+ v_8 = this.limit - cursor$1;
+ if (! this.eq_s_b$IS(1, "c")) {
+ break lab7;
+ }
+ cursor$2 = this.cursor = this.limit - v_8;
+ if (! (! (this.I_pV <= cursor$2) ? false : true)) {
+ break lab7;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ }
+ this.cursor = this.limit - v_7;
+ break lab3;
+ }
+ this.cursor = this.limit - v_4;
+ if (! this.r_residual_suffix$()) {
+ break lab2;
+ }
+ }
+ }
+ this.cursor = this.limit - v_3;
+ lab8 = true;
+lab8:
+ while (lab8 === true) {
+ lab8 = false;
+ if (! this.r_residual_form$()) {
+ break lab8;
+ }
+ }
+ cursor$6 = this.cursor = this.limit_backward;
+ v_10 = cursor$6;
+ lab9 = true;
+lab9:
+ while (lab9 === true) {
+ lab9 = false;
+ if (! this.r_postlude$()) {
+ break lab9;
+ }
+ }
+ this.cursor = v_10;
+ return true;
+};
+
+/**
+ * @param {*} o
+ * @return {!boolean}
+ */
+PortugueseStemmer.prototype.equals$X = function (o) {
+ return o instanceof PortugueseStemmer;
+};
+
+/**
+ * @return {!number}
+ */
+PortugueseStemmer.prototype.hashCode$ = function () {
+ /** @type {!string} */
+ var classname;
+ /** @type {!number} */
+ var hash;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var char;
+ classname = "PortugueseStemmer";
+ hash = 0;
+ if ("PortugueseStemmer".length === 0) {
+ return (hash | 0);
+ }
+ for (i = 0; i < classname.length; i++) {
+ char = classname.charCodeAt(i);
+ hash = (hash << 5) - hash + char;
+ hash = hash & hash;
+ }
+ return (hash | 0);
+};
+
+/**
+ * class Among extends Object
+ * @constructor
+ */
+function Among() {
+}
+
+/**
+ * @constructor
+ * @param {!string} s
+ * @param {!number} substring_i
+ * @param {!number} result
+ */
+function Among$SII(s, substring_i, result) {
+ this.s_size = s.length;
+ this.s = s;
+ this.substring_i = substring_i;
+ this.result = result;
+ this.method = null;
+ this.instance = null;
+};
+
+Among$SII.prototype = new Among;
+
+/**
+ * @constructor
+ * @param {!string} s
+ * @param {!number} substring_i
+ * @param {!number} result
+ * @param {*} method
+ * @param {BaseStemmer} instance
+ */
+function Among$SIIF$LBaseStemmer$B$LBaseStemmer$(s, substring_i, result, method, instance) {
+ this.s_size = s.length;
+ this.s = s;
+ this.substring_i = substring_i;
+ this.result = result;
+ this.method = method;
+ this.instance = instance;
+};
+
+Among$SIIF$LBaseStemmer$B$LBaseStemmer$.prototype = new Among;
+
+/**
+ * class Metadata extends Object
+ * @constructor
+ */
+function Metadata() {
+}
+
+/**
+ * @constructor
+ * @param {Oktavia} parent
+ */
+function Metadata$LOktavia$(parent) {
+ this._parent = parent;
+ this._bitVector = new BitVector$();
+};
+
+Metadata$LOktavia$.prototype = new Metadata;
+
+/**
+ * @return {!number}
+ */
+Metadata.prototype._size$ = function () {
+ /** @type {BitVector} */
+ var this$0;
+ /** @type {!number} */
+ var i$0;
+ /** @type {BitVector} */
+ var _bitVector$0;
+ this$0 = _bitVector$0 = this._bitVector;
+ i$0 = _bitVector$0._size;
+ return this$0.rank$IB(i$0, true);
+};
+
+/**
+ * @param {!number} index
+ * @return {!string}
+ */
+Metadata.prototype.getContent$I = function (index) {
+ /** @type {!number} */
+ var startPosition;
+ /** @type {!number} */
+ var length;
+ if (index < 0 || this._size$() <= index) {
+ throw new Error("Section.getContent() : range error " + (index + ""));
+ }
+ startPosition = 0;
+ if (index > 0) {
+ startPosition = this._bitVector.select$I(index - 1) + 1;
+ }
+ length = this._bitVector.select$I(index) - startPosition + 1;
+ return this._parent._getSubstring$II(startPosition, length);
+};
+
+/**
+ * @param {!number} index
+ * @return {!number}
+ */
+Metadata.prototype.getStartPosition$I = function (index) {
+ /** @type {!number} */
+ var startPosition;
+ if (index < 0 || this._size$() <= index) {
+ throw new Error("Section.getContent() : range error " + (index + ""));
+ }
+ startPosition = 0;
+ if (index > 0) {
+ startPosition = this._bitVector.select$I(index - 1) + 1;
+ }
+ return (startPosition | 0);
+};
+
+/**
+ * @param {SingleResult} result
+ * @param {Array.<undefined|!number>} positions
+ * @param {!string} word
+ * @param {!boolean} stemmed
+ */
+Metadata.prototype.grouping$LSingleResult$AISB = function (result, positions, word, stemmed) {
+};
+
+/**
+ * @param {!number} index
+ * @return {!string}
+ */
+Metadata.prototype.getInformation$I = function (index) {
+ return '';
+};
+
+/**
+ */
+Metadata.prototype._build$ = function () {
+ this._bitVector.build$();
+};
+
+/**
+ * @param {!string} name
+ * @param {!string} data
+ * @param {!number} offset
+ * @return {!number}
+ */
+Metadata.prototype._load$SSI = function (name, data, offset) {
+ offset = this._bitVector.load$SI(data, offset);
+ this._parent._metadataLabels.push(name);
+ this._parent._metadatas[name] = this;
+ return offset;
+};
+
+/**
+ * @return {!string}
+ */
+Metadata.prototype._dump$ = function () {
+ /** @type {BitVector} */
+ var this$0;
+ /** @type {Array.<undefined|!string>} */
+ var contents$0;
+ this$0 = this._bitVector;
+ contents$0 = [ ];
+ contents$0.push(Binary$dump32bitNumber$N(this$0._size));
+ contents$0.push(Binary$dump32bitNumberList$AN(this$0._v));
+ return contents$0.join('');
+};
+
+/**
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+Metadata.prototype._dump$LCompressionReport$ = function (report) {
+ /** @type {BitVector} */
+ var this$0;
+ /** @type {Array.<undefined|!string>} */
+ var contents$0;
+ this$0 = this._bitVector;
+ contents$0 = [ ];
+ contents$0.push(Binary$dump32bitNumber$N(this$0._size));
+ CompressionReport$add$LCompressionReport$II(report, 2, 2);
+ contents$0.push(Binary$dump32bitNumberList$ANLCompressionReport$(this$0._v, report));
+ return contents$0.join('');
+};
+
+/**
+ * class Section extends Metadata
+ * @constructor
+ */
+function Section() {
+}
+
+Section.prototype = new Metadata;
+/**
+ * @constructor
+ * @param {Oktavia} parent
+ */
+function Section$LOktavia$(parent) {
+ this._parent = parent;
+ this._bitVector = new BitVector$();
+ this._names = [ ];
+};
+
+Section$LOktavia$.prototype = new Section;
+
+/**
+ * @param {!string} name
+ */
+Section.prototype.setTail$S = function (name) {
+ /** @type {!number} */
+ var index$0;
+ /** @type {Oktavia} */
+ var this$0;
+ /** @type {FMIndex} */
+ var this$0$0;
+ this$0 = this._parent;
+ this$0$0 = this$0._fmindex;
+ index$0 = this$0$0._substr.length;
+ this._names.push(name);
+ this._bitVector.set$I(index$0 - 1);
+};
+
+/**
+ * @param {!string} name
+ * @param {!number} index
+ */
+Section.prototype.setTail$SI = function (name, index) {
+ this._names.push(name);
+ this._bitVector.set$I(index - 1);
+};
+
+/**
+ * @return {!number}
+ */
+Section.prototype.size$ = function () {
+ return (this._names.length | 0);
+};
+
+/**
+ * @param {!number} position
+ * @return {!number}
+ */
+Section.prototype.getSectionIndex$I = function (position) {
+ /** @type {BitVector} */
+ var this$0;
+ if (position < 0 || this._bitVector.size$() <= position) {
+ throw new Error("Section.getSectionIndex() : range error " + (position + ""));
+ }
+ this$0 = this._bitVector;
+ return this$0.rank$IB(position, true);
+};
+
+/**
+ * @param {!number} index
+ * @return {!string}
+ */
+Section.prototype.getName$I = function (index) {
+ if (index < 0 || this._names.length <= index) {
+ throw new Error("Section.getName() : range error");
+ }
+ return this._names[index];
+};
+
+/**
+ * @param {SingleResult} result
+ * @param {Array.<undefined|!number>} positions
+ * @param {!string} word
+ * @param {!boolean} stemmed
+ */
+Section.prototype.grouping$LSingleResult$AISB = function (result, positions, word, stemmed) {
+ /** @type {!number} */
+ var i;
+ /** @type {undefined|!number} */
+ var position;
+ /** @type {!number} */
+ var index;
+ /** @type {SearchUnit} */
+ var unit;
+ for (i = 0; i < positions.length; i++) {
+ position = positions[i];
+ index = this.getSectionIndex$I(position);
+ unit = SingleResult$getSearchUnit$LSingleResult$I(result, index);
+ if (unit.startPosition < 0) {
+ unit.startPosition = this.getStartPosition$I(index);
+ }
+ SearchUnit$addPosition$LSearchUnit$SIB(unit, word, position - unit.startPosition, stemmed);
+ }
+};
+
+/**
+ * @param {!number} index
+ * @return {!string}
+ */
+Section.prototype.getInformation$I = function (index) {
+ return this.getName$I(index);
+};
+
+/**
+ * @param {Oktavia} parent
+ * @param {!string} name
+ * @param {!string} data
+ * @param {!number} offset
+ * @return {!number}
+ */
+Section._load$LOktavia$SSI = function (parent, name, data, offset) {
+ /** @type {LoadedStringListResult} */
+ var strs;
+ /** @type {Section} */
+ var section;
+ /** @type {!number} */
+ var offset$0;
+ strs = new LoadedStringListResult$SI(data, offset);
+ section = new Section$LOktavia$(parent);
+ section._names = strs.result;
+ offset$0 = strs.offset;
+ offset$0 = section._bitVector.load$SI(data, offset$0);
+ section._parent._metadataLabels.push(name);
+ section._parent._metadatas[name] = section;
+ return offset$0;
+};
+
+var Section$_load$LOktavia$SSI = Section._load$LOktavia$SSI;
+
+/**
+ * @return {!string}
+ */
+Section.prototype._dump$ = function () {
+ return [ Binary$dump16bitNumber$I(0), Binary$dumpStringList$AS(this._names), Metadata.prototype._dump$.call(this) ].join('');
+};
+
+/**
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+Section.prototype._dump$LCompressionReport$ = function (report) {
+ CompressionReport$add$LCompressionReport$II(report, 1, 1);
+ return [ Binary$dump16bitNumber$I(0), Binary$dumpStringList$ASLCompressionReport$(this._names, report), Metadata.prototype._dump$LCompressionReport$.call(this, report) ].join('');
+};
+
+/**
+ * class Splitter extends Metadata
+ * @constructor
+ */
+function Splitter() {
+}
+
+Splitter.prototype = new Metadata;
+/**
+ * @constructor
+ * @param {Oktavia} parent
+ */
+function Splitter$LOktavia$(parent) {
+ this._parent = parent;
+ this._bitVector = new BitVector$();
+ this.name = null;
+};
+
+Splitter$LOktavia$.prototype = new Splitter;
+
+/**
+ * @constructor
+ * @param {Oktavia} parent
+ * @param {!string} name
+ */
+function Splitter$LOktavia$S(parent, name) {
+ this._parent = parent;
+ this._bitVector = new BitVector$();
+ this.name = name;
+};
+
+Splitter$LOktavia$S.prototype = new Splitter;
+
+/**
+ * @return {!number}
+ */
+Splitter.prototype.size$ = function () {
+ /** @type {BitVector} */
+ var this$0$0;
+ /** @type {!number} */
+ var i$0$0;
+ /** @type {BitVector} */
+ var _bitVector$0;
+ this$0$0 = _bitVector$0 = this._bitVector;
+ i$0$0 = _bitVector$0._size;
+ return this$0$0.rank$IB(i$0$0, true);
+};
+
+/**
+ */
+Splitter.prototype.split$ = function () {
+ /** @type {!number} */
+ var index$0;
+ /** @type {Oktavia} */
+ var this$0;
+ /** @type {FMIndex} */
+ var this$0$0;
+ this$0 = this._parent;
+ this$0$0 = this$0._fmindex;
+ index$0 = this$0$0._substr.length;
+ this._bitVector.set$I(index$0 - 1);
+};
+
+/**
+ * @param {!number} index
+ */
+Splitter.prototype.split$I = function (index) {
+ this._bitVector.set$I(index - 1);
+};
+
+/**
+ * @param {!number} position
+ * @return {!number}
+ */
+Splitter.prototype.getIndex$I = function (position) {
+ /** @type {BitVector} */
+ var this$0;
+ if (position < 0 || this._bitVector.size$() <= position) {
+ throw new Error("Section.getSectionIndex() : range error");
+ }
+ this$0 = this._bitVector;
+ return this$0.rank$IB(position, true);
+};
+
+/**
+ * @param {SingleResult} result
+ * @param {Array.<undefined|!number>} positions
+ * @param {!string} word
+ * @param {!boolean} stemmed
+ */
+Splitter.prototype.grouping$LSingleResult$AISB = function (result, positions, word, stemmed) {
+ /** @type {!number} */
+ var i;
+ /** @type {undefined|!number} */
+ var position;
+ /** @type {!number} */
+ var index;
+ /** @type {SearchUnit} */
+ var unit;
+ for (i = 0; i < positions.length; i++) {
+ position = positions[i];
+ index = this.getIndex$I(position);
+ unit = SingleResult$getSearchUnit$LSingleResult$I(result, index);
+ if (unit.startPosition < 0) {
+ unit.startPosition = this.getStartPosition$I(index);
+ }
+ SearchUnit$addPosition$LSearchUnit$SIB(unit, word, position - unit.startPosition, stemmed);
+ }
+};
+
+/**
+ * @param {!number} index
+ * @return {!string}
+ */
+Splitter.prototype.getInformation$I = function (index) {
+ return (this.name != null ? this.name + (index + 1 + "") : '');
+};
+
+/**
+ * @param {Oktavia} parent
+ * @param {!string} name
+ * @param {!string} data
+ * @param {!number} offset
+ * @return {!number}
+ */
+Splitter._load$LOktavia$SSI = function (parent, name, data, offset) {
+ /** @type {Splitter} */
+ var section;
+ section = new Splitter$LOktavia$(parent);
+ offset = section._bitVector.load$SI(data, offset);
+ section._parent._metadataLabels.push(name);
+ section._parent._metadatas[name] = section;
+ return offset;
+};
+
+var Splitter$_load$LOktavia$SSI = Splitter._load$LOktavia$SSI;
+
+/**
+ * @return {!string}
+ */
+Splitter.prototype._dump$ = function () {
+ return [ Binary$dump16bitNumber$I(1), Metadata.prototype._dump$.call(this) ].join('');
+};
+
+/**
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+Splitter.prototype._dump$LCompressionReport$ = function (report) {
+ CompressionReport$add$LCompressionReport$II(report, 1, 1);
+ return [ Binary$dump16bitNumber$I(1), Metadata.prototype._dump$LCompressionReport$.call(this, report) ].join('');
+};
+
+/**
+ * class Table extends Metadata
+ * @constructor
+ */
+function Table() {
+}
+
+Table.prototype = new Metadata;
+/**
+ * @constructor
+ * @param {Oktavia} parent
+ * @param {Array.<undefined|!string>} headers
+ */
+function Table$LOktavia$AS(parent, headers) {
+ this._parent = parent;
+ this._bitVector = new BitVector$();
+ this._headers = headers;
+ this._columnTails = new BitVector$();
+};
+
+Table$LOktavia$AS.prototype = new Table;
+
+/**
+ * @return {!number}
+ */
+Table.prototype.rowSize$ = function () {
+ /** @type {BitVector} */
+ var this$0$0;
+ /** @type {!number} */
+ var i$0$0;
+ /** @type {BitVector} */
+ var _bitVector$0;
+ this$0$0 = _bitVector$0 = this._bitVector;
+ i$0$0 = _bitVector$0._size;
+ return this$0$0.rank$IB(i$0$0, true);
+};
+
+/**
+ * @return {!number}
+ */
+Table.prototype.columnSize$ = function () {
+ return (this._headers.length | 0);
+};
+
+/**
+ */
+Table.prototype.setColumnTail$ = function () {
+ /** @type {!number} */
+ var index;
+ /** @type {Oktavia} */
+ var this$0;
+ /** @type {FMIndex} */
+ var this$0$0;
+ /** @type {Oktavia} */
+ var _parent$0;
+ this$0 = _parent$0 = this._parent;
+ this$0$0 = this$0._fmindex;
+ index = this$0$0._substr.length;
+ _parent$0._fmindex.push$S(Oktavia.eob);
+ this._columnTails.set$I(index - 1);
+};
+
+/**
+ */
+Table.prototype.setRowTail$ = function () {
+ /** @type {!number} */
+ var index;
+ /** @type {Oktavia} */
+ var this$0;
+ /** @type {FMIndex} */
+ var this$0$0;
+ this$0 = this._parent;
+ this$0$0 = this$0._fmindex;
+ index = this$0$0._substr.length;
+ this._bitVector.set$I(index - 1);
+};
+
+/**
+ * @param {!number} position
+ * @return {Array.<undefined|!number>}
+ */
+Table.prototype.getCell$I = function (position) {
+ /** @type {!number} */
+ var row;
+ /** @type {!number} */
+ var currentColumn;
+ /** @type {!number} */
+ var lastRowColumn;
+ /** @type {!number} */
+ var startPosition;
+ /** @type {Array.<undefined|!number>} */
+ var result;
+ /** @type {BitVector} */
+ var this$0;
+ /** @type {BitVector} */
+ var this$1;
+ if (position < 0 || this._bitVector.size$() <= position) {
+ throw new Error("Section.getSectionIndex() : range error " + (position + ""));
+ }
+ this$0 = this._bitVector;
+ row = this$0.rank$IB(position, true);
+ this$1 = this._columnTails;
+ currentColumn = this$1.rank$IB(position, true);
+ lastRowColumn = 0;
+ if (row > 0) {
+ startPosition = this._bitVector.select$I(row - 1) + 1;
+ lastRowColumn = this._columnTails.rank$I(startPosition);
+ }
+ result = [ row, currentColumn - lastRowColumn ];
+ return result;
+};
+
+/**
+ * @param {!number} rowIndex
+ * @return {Object.<string, undefined|!string>}
+ */
+Table.prototype.getRowContent$I = function (rowIndex) {
+ /** @type {!string} */
+ var content;
+ /** @type {Array.<undefined|!string>} */
+ var values;
+ /** @type {Object.<string, undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var i;
+ content = this.getContent$I(rowIndex);
+ values = content.split(Oktavia.eob, this._headers.length);
+ result = ({ });
+ for (i in this._headers) {
+ if (i < values.length) {
+ result[this._headers[i]] = values[i];
+ } else {
+ result[this._headers[i]] = '';
+ }
+ }
+ return result;
+};
+
+/**
+ * @param {SingleResult} result
+ * @param {Array.<undefined|!number>} positions
+ * @param {!string} word
+ * @param {!boolean} stemmed
+ */
+Table.prototype.grouping$LSingleResult$AISB = function (result, positions, word, stemmed) {
+};
+
+/**
+ * @param {!number} index
+ * @return {!string}
+ */
+Table.prototype.getInformation$I = function (index) {
+ return '';
+};
+
+/**
+ */
+Table.prototype._build$ = function () {
+ this._bitVector.build$();
+ this._columnTails.build$();
+};
+
+/**
+ * @param {Oktavia} parent
+ * @param {!string} name
+ * @param {!string} data
+ * @param {!number} offset
+ * @return {!number}
+ */
+Table._load$LOktavia$SSI = function (parent, name, data, offset) {
+ /** @type {LoadedStringListResult} */
+ var strs;
+ /** @type {Table} */
+ var table;
+ /** @type {!number} */
+ var offset$0;
+ strs = new LoadedStringListResult$SI(data, offset);
+ table = new Table$LOktavia$AS(parent, strs.result);
+ offset$0 = strs.offset;
+ offset$0 = table._bitVector.load$SI(data, offset$0);
+ table._parent._metadataLabels.push(name);
+ table._parent._metadatas[name] = table;
+ offset = offset$0;
+ return table._columnTails.load$SI(data, offset$0);
+};
+
+var Table$_load$LOktavia$SSI = Table._load$LOktavia$SSI;
+
+/**
+ * @return {!string}
+ */
+Table.prototype._dump$ = function () {
+ return [ Binary$dump16bitNumber$I(2), Binary$dumpStringList$AS(this._headers), Metadata.prototype._dump$.call(this), this._columnTails.dump$() ].join('');
+};
+
+/**
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+Table.prototype._dump$LCompressionReport$ = function (report) {
+ CompressionReport$add$LCompressionReport$II(report, 1, 1);
+ return [ Binary$dump16bitNumber$I(2), Binary$dumpStringList$ASLCompressionReport$(this._headers, report), Metadata.prototype._dump$LCompressionReport$.call(this, report), this._columnTails.dump$LCompressionReport$(report) ].join('');
+};
+
+/**
+ * class Block extends Metadata
+ * @constructor
+ */
+function Block() {
+}
+
+Block.prototype = new Metadata;
+/**
+ * @constructor
+ * @param {Oktavia} parent
+ */
+function Block$LOktavia$(parent) {
+ this._parent = parent;
+ this._bitVector = new BitVector$();
+ this._names = [ ];
+ this._start = false;
+};
+
+Block$LOktavia$.prototype = new Block;
+
+/**
+ * @param {!string} blockName
+ */
+Block.prototype.startBlock$S = function (blockName) {
+ this.startBlock$SI(blockName, this._parent.contentSize$());
+};
+
+/**
+ * @param {!string} blockName
+ * @param {!number} index
+ */
+Block.prototype.startBlock$SI = function (blockName, index) {
+ if (this._start) {
+ throw new Error('Splitter `' + this._names[this._names.length - 1] + '` is not closed');
+ }
+ this._start = true;
+ this._names.push(blockName);
+ this._bitVector.set$I(index - 1);
+};
+
+/**
+ */
+Block.prototype.endBlock$ = function () {
+ this.endBlock$I(this._parent.contentSize$());
+};
+
+/**
+ * @param {!number} index
+ */
+Block.prototype.endBlock$I = function (index) {
+ if (! this._start) {
+ throw new Error('Splitter is not started');
+ }
+ this._start = false;
+ this._bitVector.set$I(index - 1);
+};
+
+/**
+ * @return {!number}
+ */
+Block.prototype.size$ = function () {
+ return (this._names.length | 0);
+};
+
+/**
+ * @param {!number} position
+ * @return {!number}
+ */
+Block.prototype.blockIndex$I = function (position) {
+ /** @type {!number} */
+ var result;
+ /** @type {BitVector} */
+ var this$0;
+ if (position < 0 || this._parent._fmindex.size$() - 1 <= position) {
+ throw new Error("Block.blockIndex() : range error " + (position + ""));
+ }
+ if (position >= this._bitVector.size$()) {
+ position = (this._bitVector.size$() - 1 | 0);
+ result = (this._bitVector.rank$I(position) + 1 | 0);
+ } else {
+ this$0 = this._bitVector;
+ result = this$0.rank$IB(position, true);
+ }
+ return result;
+};
+
+/**
+ * @param {!number} position
+ * @return {!boolean}
+ */
+Block.prototype.inBlock$I = function (position) {
+ /** @type {!number} */
+ var blockIndex;
+ blockIndex = this.blockIndex$I(position);
+ return blockIndex % 2 !== 0;
+};
+
+/**
+ * @param {!number} position
+ * @return {!string}
+ */
+Block.prototype.getBlockContent$I = function (position) {
+ /** @type {!number} */
+ var blockIndex;
+ /** @type {!string} */
+ var result;
+ blockIndex = this.blockIndex$I(position);
+ if (blockIndex % 2 !== 0) {
+ result = this.getContent$I(blockIndex);
+ } else {
+ result = '';
+ }
+ return result;
+};
+
+/**
+ * @param {!number} position
+ * @return {!string}
+ */
+Block.prototype.getBlockName$I = function (position) {
+ /** @type {!number} */
+ var blockIndex;
+ /** @type {!string} */
+ var result;
+ blockIndex = this.blockIndex$I(position);
+ if (blockIndex % 2 !== 0) {
+ result = this._names[blockIndex >>> 1];
+ } else {
+ result = '';
+ }
+ return result;
+};
+
+/**
+ * @param {SingleResult} result
+ * @param {Array.<undefined|!number>} positions
+ * @param {!string} word
+ * @param {!boolean} stemmed
+ */
+Block.prototype.grouping$LSingleResult$AISB = function (result, positions, word, stemmed) {
+};
+
+/**
+ * @param {!number} index
+ * @return {!string}
+ */
+Block.prototype.getInformation$I = function (index) {
+ return '';
+};
+
+/**
+ * @param {Oktavia} parent
+ * @param {!string} name
+ * @param {!string} data
+ * @param {!number} offset
+ * @return {!number}
+ */
+Block._load$LOktavia$SSI = function (parent, name, data, offset) {
+ /** @type {LoadedStringListResult} */
+ var strs;
+ /** @type {Block} */
+ var block;
+ /** @type {!number} */
+ var offset$0;
+ strs = new LoadedStringListResult$SI(data, offset);
+ block = new Block$LOktavia$(parent);
+ block._names = strs.result;
+ offset$0 = strs.offset;
+ offset$0 = block._bitVector.load$SI(data, offset$0);
+ block._parent._metadataLabels.push(name);
+ block._parent._metadatas[name] = block;
+ return offset$0;
+};
+
+var Block$_load$LOktavia$SSI = Block._load$LOktavia$SSI;
+
+/**
+ * @return {!string}
+ */
+Block.prototype._dump$ = function () {
+ return [ Binary$dump16bitNumber$I(3), Binary$dumpStringList$AS(this._names), Metadata.prototype._dump$.call(this) ].join('');
+};
+
+/**
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+Block.prototype._dump$LCompressionReport$ = function (report) {
+ CompressionReport$add$LCompressionReport$II(report, 1, 1);
+ return [ Binary$dump16bitNumber$I(3), Binary$dumpStringList$ASLCompressionReport$(this._names, report), Metadata.prototype._dump$LCompressionReport$.call(this, report) ].join('');
+};
+
+/**
+ * class FMIndex extends Object
+ * @constructor
+ */
+function FMIndex() {
+}
+
+/**
+ * @constructor
+ */
+function FMIndex$() {
+ /** @type {Array.<undefined|!number>} */
+ var _rlt$0;
+ this._ssize = 0;
+ (this._ddic = 0, this._head = 0);
+ this._substr = "";
+ this._sv = new WaveletMatrix$();
+ this._posdic = [ ];
+ this._idic = [ ];
+ _rlt$0 = this._rlt = [ ];
+ _rlt$0.length = 65536;
+};
+
+FMIndex$.prototype = new FMIndex;
+
+/**
+ */
+FMIndex.prototype.clear$ = function () {
+ /** @type {WaveletMatrix} */
+ var this$0;
+ this$0 = this._sv;
+ this$0._bv.length = 0;
+ this$0._seps.length = 0;
+ this$0._size = 0;
+ this._posdic.length = 0;
+ this._idic.length = 0;
+ this._ddic = 0;
+ this._head = 0;
+ this._substr = "";
+};
+
+/**
+ * @return {!number}
+ */
+FMIndex.prototype.size$ = function () {
+ /** @type {WaveletMatrix} */
+ var this$0;
+ this$0 = this._sv;
+ return this$0._size;
+};
+
+/**
+ * @return {!number}
+ */
+FMIndex.prototype.contentSize$ = function () {
+ return this._substr.length;
+};
+
+/**
+ * @param {!string} key
+ * @return {!number}
+ */
+FMIndex.prototype.getRows$S = function (key) {
+ /** @type {Array.<undefined|!number>} */
+ var pos;
+ pos = [ ];
+ return this.getRows$SAI(key, pos);
+};
+
+/**
+ * @param {!string} key
+ * @param {Array.<undefined|!number>} pos
+ * @return {!number}
+ */
+FMIndex.prototype.getRows$SAI = function (key, pos) {
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var code;
+ /** @type {!number} */
+ var first;
+ /** @type {undefined|!number} */
+ var last;
+ /** @type {!number} */
+ var c;
+ /** @type {Array.<undefined|!number>} */
+ var _rlt$0;
+ i = key.length - 1;
+ code = key.charCodeAt(i);
+ first = (_rlt$0 = this._rlt)[code] + 1;
+ last = _rlt$0[code + 1];
+ while (first <= last) {
+ if (i === 0) {
+ pos[0] = (-- first | 0);
+ pos[1] = -- last;
+ return (last - first + 1 | 0);
+ }
+ i--;
+ c = key.charCodeAt(i);
+ first = this._rlt[c] + this._sv.rank$II(first - 1, c) + 1;
+ last = this._rlt[c] + this._sv.rank$II(last, c);
+ }
+ return 0;
+};
+
+/**
+ * @param {!number} i
+ * @return {!number}
+ */
+FMIndex.prototype.getPosition$I = function (i) {
+ /** @type {!number} */
+ var pos;
+ /** @type {!number} */
+ var c;
+ if (i >= this.size$()) {
+ throw new Error("FMIndex.getPosition() : range error");
+ }
+ pos = 0;
+ while (i !== this._head) {
+ if (i % this._ddic === 0) {
+ pos += this._posdic[i / this._ddic] + 1;
+ break;
+ }
+ c = this._sv.get$I(i);
+ i = this._rlt[c] + this._sv.rank$II(i, c);
+ pos++;
+ }
+ return (pos % this.size$() | 0);
+};
+
+/**
+ * @param {!number} pos
+ * @param {!number} len
+ * @return {!string}
+ */
+FMIndex.prototype.getSubstring$II = function (pos, len) {
+ /** @type {!number} */
+ var pos_end;
+ /** @type {!number} */
+ var pos_tmp;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var pos_idic;
+ /** @type {!string} */
+ var substr;
+ /** @type {!number} */
+ var c;
+ /** @type {!number} */
+ var _ddic$0;
+ if (pos >= this.size$()) {
+ throw new Error("FMIndex.getSubstring() : range error");
+ }
+ pos_end = Math.min(pos + len, this.size$());
+ pos_tmp = this.size$() - 1;
+ i = this._head;
+ pos_idic = Math.floor((pos_end + (_ddic$0 = this._ddic) - 2) / _ddic$0);
+ if (pos_idic < this._idic.length) {
+ pos_tmp = pos_idic * this._ddic;
+ i = this._idic[pos_idic];
+ }
+ substr = "";
+ while (pos_tmp >= pos) {
+ c = this._sv.get$I(i);
+ i = this._rlt[c] + this._sv.rank$II(i, c);
+ if (pos_tmp < pos_end) {
+ substr = String.fromCharCode(c) + substr;
+ }
+ if (pos_tmp === 0) {
+ break;
+ }
+ pos_tmp--;
+ }
+ return substr;
+};
+
+/**
+ */
+FMIndex.prototype.build$ = function () {
+ this.build$SIIB(String.fromCharCode(0), 65535, 20, false);
+};
+
+/**
+ * @param {!string} end_marker
+ * @param {!number} ddic
+ * @param {!boolean} verbose
+ */
+FMIndex.prototype.build$SIB = function (end_marker, ddic, verbose) {
+ this.build$SIIB(end_marker, 65535, ddic, verbose);
+};
+
+/**
+ * @param {!string} end_marker
+ * @param {!number} maxChar
+ * @param {!number} ddic
+ * @param {!boolean} verbose
+ */
+FMIndex.prototype.build$SIIB = function (end_marker, maxChar, ddic, verbose) {
+ /** @type {BurrowsWheelerTransform} */
+ var b;
+ /** @type {!string} */
+ var s;
+ /** @type {!number} */
+ var c;
+ /** @type {!string} */
+ var str$0;
+ /** @type {WaveletMatrix} */
+ var this$0;
+ /** @type {!string} */
+ var _str$0;
+ /** @type {Array.<undefined|!number>} */
+ var _suffixarray$0;
+ if (verbose) {
+ console.time("building burrows-wheeler transform");
+ }
+ this._substr += end_marker;
+ b = ({_str: "", _size: 0, _head: 0, _suffixarray: [ ]});
+ str$0 = this._substr;
+ _str$0 = b._str = str$0;
+ b._size = _str$0.length;
+ _suffixarray$0 = b._suffixarray = SAIS$make$S(str$0);
+ b._head = (_suffixarray$0.indexOf(0) | 0);
+ s = BurrowsWheelerTransform$get$LBurrowsWheelerTransform$(b);
+ this._ssize = s.length;
+ this._head = b._head;
+ b._str = "";
+ b._size = 0;
+ b._head = 0;
+ b._suffixarray.length = 0;
+ this._substr = "";
+ if (verbose) {
+ console.timeEnd("building burrows-wheeler transform");
+ }
+ if (verbose) {
+ console.time("building wavelet matrix");
+ }
+ this$0 = this._sv;
+ this$0._bitsize = (Math.ceil(Math.log(maxChar) / 0.6931471805599453) | 0);
+ if (verbose) {
+ console.log(" maxCharCode: ", maxChar);
+ console.log(" bitSize: ", this._sv.bitsize$());
+ }
+ this._sv.build$S(s);
+ if (verbose) {
+ console.timeEnd("building wavelet matrix");
+ }
+ if (verbose) {
+ console.time("caching rank less than");
+ }
+ for (c = 0; c < maxChar; c++) {
+ this._rlt[c] = this._sv.rank_less_than$II(this._sv.size$(), c);
+ }
+ if (verbose) {
+ console.timeEnd("caching rank less than");
+ }
+ this._ddic = ddic;
+ if (verbose) {
+ console.time("building dictionaries");
+ }
+ this._buildDictionaries$();
+ if (verbose) {
+ console.timeEnd("building dictionaries");
+ console.log('');
+ }
+};
+
+/**
+ */
+FMIndex.prototype._buildDictionaries$ = function () {
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var pos;
+ /** @type {!number} */
+ var c;
+ for (i = 0; i < this._ssize / this._ddic + 1; i++) {
+ this._posdic.push(0);
+ this._idic.push(0);
+ }
+ i = this._head;
+ pos = this.size$() - 1;
+ do {
+ if (i % this._ddic === 0) {
+ this._posdic[Math.floor(i / this._ddic)] = (pos | 0);
+ }
+ if (pos % this._ddic === 0) {
+ this._idic[Math.floor(pos / this._ddic)] = (i | 0);
+ }
+ c = this._sv.get$I(i);
+ i = this._rlt[c] + this._sv.rank$II(i, c);
+ pos--;
+ } while (i !== this._head);
+};
+
+/**
+ * @param {!string} doc
+ */
+FMIndex.prototype.push$S = function (doc) {
+ if (doc.length <= 0) {
+ throw new Error("FMIndex::push(): empty string");
+ }
+ this._substr += doc;
+};
+
+/**
+ * @param {!string} keyword
+ * @return {Array.<undefined|!number>}
+ */
+FMIndex.prototype.search$S = function (keyword) {
+ /** @type {Array.<undefined|!number>} */
+ var result;
+ /** @type {Array.<undefined|!number>} */
+ var position;
+ /** @type {!number} */
+ var rows;
+ /** @type {undefined|!number} */
+ var first;
+ /** @type {undefined|!number} */
+ var last;
+ /** @type {undefined|!number} */
+ var i;
+ result = [ ];
+ position = [ ];
+ rows = this.getRows$SAI(keyword, position);
+ if (rows > 0) {
+ first = position[0];
+ last = position[1];
+ for (i = first; i <= last; i++) {
+ result.push(this.getPosition$I(i));
+ }
+ }
+ return result;
+};
+
+/**
+ * @return {!string}
+ */
+FMIndex.prototype.dump$ = function () {
+ return this.dump$B(false);
+};
+
+/**
+ * @param {!boolean} verbose
+ * @return {!string}
+ */
+FMIndex.prototype.dump$B = function (verbose) {
+ /** @type {Array.<undefined|!string>} */
+ var contents;
+ /** @type {CompressionReport} */
+ var report;
+ /** @type {!number} */
+ var i;
+ contents = [ ];
+ report = ({source: 0, result: 0});
+ contents.push(Binary$dump32bitNumber$N(this._ddic));
+ contents.push(Binary$dump32bitNumber$N(this._ssize));
+ contents.push(Binary$dump32bitNumber$N(this._head));
+ CompressionReport$add$LCompressionReport$II(report, 6, 6);
+ contents.push(this._sv.dump$LCompressionReport$(report));
+ if (verbose) {
+ console.log("Serializing FM-index");
+ console.log(' Wavelet Matrix: ' + (contents[3].length * 2 + "") + ' bytes (' + (Math.round(report.result * 100.0 / report.source) + "") + '%)');
+ }
+ contents.push(Binary$dump32bitNumber$N(this._posdic.length));
+ for (i in this._posdic) {
+ contents.push(Binary$dump32bitNumber$N(this._posdic[i]));
+ }
+ for (i in this._idic) {
+ contents.push(Binary$dump32bitNumber$N(this._idic[i]));
+ }
+ if (verbose) {
+ console.log(' Dictionary Cache: ' + (this._idic.length * 16 + "") + ' bytes');
+ }
+ return contents.join("");
+};
+
+/**
+ * @param {!string} data
+ * @return {!number}
+ */
+FMIndex.prototype.load$S = function (data) {
+ return this.load$SI(data, 0);
+};
+
+/**
+ * @param {!string} data
+ * @param {!number} offset
+ * @return {!number}
+ */
+FMIndex.prototype.load$SI = function (data, offset) {
+ /** @type {!number} */
+ var maxChar;
+ /** @type {!number} */
+ var c;
+ /** @type {!number} */
+ var size;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var result$0;
+ /** @type {!number} */
+ var result$1;
+ result$0 = data.charCodeAt(offset) * 65536 + data.charCodeAt(offset + 1);
+ this._ddic = (result$0 | 0);
+ this._ssize = (Binary$load32bitNumber$SI(data, offset + 2) | 0);
+ this._head = (Binary$load32bitNumber$SI(data, offset + 4) | 0);
+ offset = this._sv.load$SI(data, offset + 6);
+ maxChar = Math.pow(2, this._sv.bitsize$());
+ for (c = 0; c < maxChar; c++) {
+ this._rlt[c] = this._sv.rank_less_than$II(this._sv.size$(), c);
+ }
+ result$1 = data.charCodeAt(offset) * 65536 + data.charCodeAt(offset + 1);
+ size = result$1;
+ offset += 2;
+ for (i = 0; i < size; (i++, offset += 2)) {
+ this._posdic.push(Binary$load32bitNumber$SI(data, offset));
+ }
+ for (i = 0; i < size; (i++, offset += 2)) {
+ this._idic.push(Binary$load32bitNumber$SI(data, offset));
+ }
+ return offset;
+};
+
+/**
+ * class Tag extends Object
+ * @constructor
+ */
+function Tag() {
+}
+
+/**
+ * @constructor
+ * @param {!string} name
+ */
+function Tag$S(name) {
+ this.name = name;
+ this.attributes = ({ });
+ this.isSelfClosing = false;
+};
+
+Tag$S.prototype = new Tag;
+
+/**
+ * class _Common extends Object
+ * @constructor
+ */
+function _Common() {
+}
+
+/**
+ * @constructor
+ */
+function _Common$() {
+};
+
+_Common$.prototype = new _Common;
+
+/**
+ * class _State extends Object
+ * @constructor
+ */
+function _State() {
+}
+
+/**
+ * @constructor
+ */
+function _State$() {
+};
+
+_State$.prototype = new _State;
+
+/**
+ * class SAXHandler extends Object
+ * @constructor
+ */
+function SAXHandler() {
+}
+
+/**
+ * @constructor
+ */
+function SAXHandler$() {
+ this.position = 0;
+ this.column = 0;
+ this.line = 0;
+};
+
+SAXHandler$.prototype = new SAXHandler;
+
+/**
+ * @param {Error} error
+ */
+SAXHandler.prototype.onerror$LError$ = function (error) {
+};
+
+/**
+ * @param {!string} text
+ */
+SAXHandler.prototype.ontext$S = function (text) {
+};
+
+/**
+ * @param {!string} doctype
+ */
+SAXHandler.prototype.ondoctype$S = function (doctype) {
+};
+
+/**
+ * @param {!string} name
+ * @param {!string} body
+ */
+SAXHandler.prototype.onprocessinginstruction$SS = function (name, body) {
+};
+
+/**
+ * @param {!string} sgmlDecl
+ */
+SAXHandler.prototype.onsgmldeclaration$S = function (sgmlDecl) {
+};
+
+/**
+ * @param {!string} tagname
+ * @param {Object.<string, undefined|!string>} attributes
+ */
+SAXHandler.prototype.onopentag$SHS = function (tagname, attributes) {
+};
+
+/**
+ * @param {!string} tagname
+ */
+SAXHandler.prototype.onclosetag$S = function (tagname) {
+};
+
+/**
+ * @param {!string} name
+ * @param {!string} value
+ */
+SAXHandler.prototype.onattribute$SS = function (name, value) {
+};
+
+/**
+ * @param {!string} comment
+ */
+SAXHandler.prototype.oncomment$S = function (comment) {
+};
+
+/**
+ */
+SAXHandler.prototype.onopencdata$ = function () {
+};
+
+/**
+ * @param {!string} cdata
+ */
+SAXHandler.prototype.oncdata$S = function (cdata) {
+};
+
+/**
+ */
+SAXHandler.prototype.onclosecdata$ = function () {
+};
+
+/**
+ */
+SAXHandler.prototype.onend$ = function () {
+};
+
+/**
+ */
+SAXHandler.prototype.onready$ = function () {
+};
+
+/**
+ * @param {!string} script
+ */
+SAXHandler.prototype.onscript$S = function (script) {
+};
+
+/**
+ * class _HTMLHandler extends SAXHandler
+ * @constructor
+ */
+function _HTMLHandler() {
+}
+
+_HTMLHandler.prototype = new SAXHandler;
+/**
+ * @constructor
+ * @param {Object.<string, undefined|Array.<undefined|!string>>} styles
+ * @param {!boolean} escape
+ */
+function _HTMLHandler$HASB(styles, escape) {
+ this.position = 0;
+ this.column = 0;
+ this.line = 0;
+ this.text = [ ];
+ this.escape = escape;
+ this.styles = styles;
+};
+
+_HTMLHandler$HASB.prototype = new _HTMLHandler;
+
+/**
+ * @param {!string} str
+ * @return {!string}
+ */
+_HTMLHandler.escapeHTML$S = function (str) {
+ return str.replace(/\n/g, "<br/>").replace(/&/g, "&amp;").replace(/"/g, "&quot;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
+};
+
+var _HTMLHandler$escapeHTML$S = _HTMLHandler.escapeHTML$S;
+
+/**
+ * @param {!string} tagname
+ * @param {Object.<string, undefined|!string>} attributes
+ */
+_HTMLHandler.prototype.onopentag$SHS = function (tagname, attributes) {
+ this.text.push(this.styles[tagname][0]);
+};
+
+/**
+ * @param {!string} tagname
+ */
+_HTMLHandler.prototype.onclosetag$S = function (tagname) {
+ this.text.push(this.styles[tagname][1]);
+};
+
+/**
+ * @param {!string} text
+ */
+_HTMLHandler.prototype.ontext$S = function (text) {
+ if (this.escape) {
+ this.text.push(text.replace(/\n/g, "<br/>").replace(/&/g, "&amp;").replace(/"/g, "&quot;").replace(/</g, "&lt;").replace(/>/g, "&gt;"));
+ } else {
+ this.text.push(text);
+ }
+};
+
+/**
+ * @return {!string}
+ */
+_HTMLHandler.prototype.result$ = function () {
+ return this.text.join('');
+};
+
+/**
+ * class SAXParser extends Object
+ * @constructor
+ */
+function SAXParser() {
+}
+
+/**
+ * @constructor
+ * @param {SAXHandler} handler
+ */
+function SAXParser$LSAXHandler$(handler) {
+ this.q = "";
+ this.c = "";
+ this.bufferCheckPosition = 0;
+ this.looseCase = "";
+ this.tags = [ ];
+ this.closed = false;
+ this.closedRoot = false;
+ this.sawRoot = false;
+ this.tag = null;
+ this.error = null;
+ this.handler = null;
+ this.ENTITIES = null;
+ this.strict = false;
+ this.tagName = "";
+ this.state = 0;
+ this.line = 0;
+ this.column = 0;
+ this.position = 0;
+ this.startTagPosition = 0;
+ this.attribName = "";
+ this.attribValue = "";
+ this.script = "";
+ this.textNode = "";
+ this.attribList = null;
+ this.noscript = false;
+ this.cdata = "";
+ this.procInstBody = "";
+ this.procInstName = "";
+ this.doctype = "";
+ this.entity = "";
+ this.sgmlDecl = "";
+ this.comment = "";
+ this.preTags = 0;
+ this._init$LSAXHandler$B(handler, false);
+};
+
+SAXParser$LSAXHandler$.prototype = new SAXParser;
+
+/**
+ * @constructor
+ * @param {SAXHandler} handler
+ * @param {!boolean} strict
+ */
+function SAXParser$LSAXHandler$B(handler, strict) {
+ this.q = "";
+ this.c = "";
+ this.bufferCheckPosition = 0;
+ this.looseCase = "";
+ this.tags = [ ];
+ this.closed = false;
+ this.closedRoot = false;
+ this.sawRoot = false;
+ this.tag = null;
+ this.error = null;
+ this.handler = null;
+ this.ENTITIES = null;
+ this.strict = false;
+ this.tagName = "";
+ this.state = 0;
+ this.line = 0;
+ this.column = 0;
+ this.position = 0;
+ this.startTagPosition = 0;
+ this.attribName = "";
+ this.attribValue = "";
+ this.script = "";
+ this.textNode = "";
+ this.attribList = null;
+ this.noscript = false;
+ this.cdata = "";
+ this.procInstBody = "";
+ this.procInstName = "";
+ this.doctype = "";
+ this.entity = "";
+ this.sgmlDecl = "";
+ this.comment = "";
+ this.preTags = 0;
+ this._init$LSAXHandler$B(handler, strict);
+};
+
+SAXParser$LSAXHandler$B.prototype = new SAXParser;
+
+/**
+ * @param {SAXHandler} handler
+ * @param {!boolean} strict
+ */
+SAXParser.prototype._init$LSAXHandler$B = function (handler, strict) {
+ this.handler = handler;
+ this.clearBuffers$();
+ this.q = "";
+ this.bufferCheckPosition = 65536;
+ this.looseCase = 'toLowerCase';
+ this.tags = [ ];
+ this.closed = this.closedRoot = this.sawRoot = false;
+ this.tag = null;
+ this.error = null;
+ this.strict = strict;
+ this.noscript = strict;
+ this.state = 1;
+ this.ENTITIES = _Entities$entity_list$();
+ this.attribList = [ ];
+ this.noscript = false;
+ this.preTags = 0;
+};
+
+/**
+ * @param {!boolean} flag
+ */
+SAXParser.prototype.set_noscript$B = function (flag) {
+ this.noscript = flag;
+};
+
+/**
+ * @return {SAXParser}
+ */
+SAXParser.prototype.resume$ = function () {
+ this.error = null;
+ return this;
+};
+
+/**
+ * @return {SAXParser}
+ */
+SAXParser.prototype.close$ = function () {
+ return this.parse$S('');
+};
+
+/**
+ * @param {!string} chunk
+ * @return {SAXParser}
+ */
+SAXParser.prototype.parse$S = function (chunk) {
+ /** @type {Char} */
+ var _;
+ /** @type {!number} */
+ var i;
+ /** @type {!string} */
+ var c;
+ /** @type {!number} */
+ var starti;
+ /** @type {!number} */
+ var pad;
+ /** @type {!number} */
+ var returnState;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$0;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$1;
+ /** @type {RegExp} */
+ var charclass$2;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$3;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$4;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$5;
+ /** @type {!string} */
+ var text$0;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$6;
+ /** @type {RegExp} */
+ var charclass$7;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$8;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$9;
+ /** @type {RegExp} */
+ var charclass$10;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$11;
+ /** @type {RegExp} */
+ var charclass$12;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$13;
+ /** @type {RegExp} */
+ var charclass$14;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$15;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$16;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$17;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$18;
+ /** @type {RegExp} */
+ var charclass$19;
+ /** @type {RegExp} */
+ var charclass$20;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$21;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$22;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$23;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$24;
+ /** @type {!string} */
+ var comment$0;
+ _ = new Char$();
+ if (this.error) {
+ throw this.error;
+ }
+ if (this.closed) {
+ return this.emiterror$S("Cannot write after close. Assign an onready handler.");
+ }
+ (i = 0, c = "");
+ while (this.c = c = chunk.charAt(i++)) {
+ this.position++;
+ if (c === "\n") {
+ this.handler.line++;
+ this.handler.column = 0;
+ } else {
+ this.handler.column++;
+ }
+ switch (this.state) {
+ case 1:
+ if (c === "<") {
+ this.state = 4;
+ this.startTagPosition = this.position;
+ } else {
+ charclass$0 = _.whitespace;
+ if (! $__jsx_ObjectHasOwnProperty.call(charclass$0, c)) {
+ this.strictFail$S("Non-whitespace before first tag.");
+ this.textNode = c;
+ this.state = 2;
+ }
+ }
+ continue;
+ case 2:
+ if (this.sawRoot && ! this.closedRoot) {
+ starti = i - 1;
+ while (c && c !== "<" && c !== "&") {
+ c = chunk.charAt(i++);
+ if (c) {
+ this.position++;
+ if (c === "\n") {
+ this.handler.line++;
+ this.handler.column = 0;
+ } else {
+ this.handler.column++;
+ }
+ }
+ }
+ this.textNode += chunk.substring(starti, i - 1);
+ }
+ if (c === "<") {
+ this.state = 4;
+ this.startTagPosition = this.position;
+ } else {
+ if (_.not$HBS(_.whitespace, c) && (! this.sawRoot || this.closedRoot)) {
+ this.strictFail$S("Text data outside of root node.");
+ }
+ if (c === "&") {
+ this.state = 3;
+ } else {
+ this.textNode += c;
+ }
+ }
+ continue;
+ case 33:
+ if (c === "<") {
+ this.state = 34;
+ } else {
+ this.script += c;
+ }
+ continue;
+ case 34:
+ if (c === "/") {
+ this.state = 31;
+ } else {
+ this.script += "<" + c;
+ this.state = 33;
+ }
+ continue;
+ case 4:
+ if (c === "!") {
+ this.state = 5;
+ this.sgmlDecl = "";
+ } else {
+ charclass$1 = _.whitespace;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$1, c)) {
+ } else {
+ charclass$2 = _.nameStart;
+ if (charclass$2.test(c)) {
+ this.state = 21;
+ this.tagName = c;
+ } else {
+ if (c === "/") {
+ this.state = 31;
+ this.tagName = "";
+ } else {
+ if (c === "?") {
+ this.state = 18;
+ this.procInstName = this.procInstBody = "";
+ } else {
+ this.strictFail$S("Unencoded <");
+ if (this.startTagPosition + 1 < this.position) {
+ pad = this.position - this.startTagPosition;
+ for (i = 0; i < pad; i++) {
+ c = " " + c;
+ }
+ }
+ this.textNode += "<" + c;
+ this.state = 2;
+ }
+ }
+ }
+ }
+ }
+ continue;
+ case 5:
+ if ((this.sgmlDecl + c).toUpperCase() === _.CDATA) {
+ this.closetext_if_exist$();
+ this.state = 15;
+ this.sgmlDecl = "";
+ this.cdata = "";
+ } else {
+ if (this.sgmlDecl + c === "--") {
+ this.state = 12;
+ this.comment = "";
+ this.sgmlDecl = "";
+ } else {
+ if ((this.sgmlDecl + c).toUpperCase() === _.DOCTYPE) {
+ this.state = 7;
+ if (this.doctype || this.sawRoot) {
+ this.strictFail$S("Inappropriately located doctype declaration");
+ }
+ this.doctype = "";
+ this.sgmlDecl = "";
+ } else {
+ if (c === ">") {
+ this.closetext_if_exist$();
+ this.sgmlDecl = "";
+ this.state = 2;
+ } else {
+ charclass$3 = _.quote;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$3, c)) {
+ this.state = 6;
+ this.sgmlDecl += c;
+ } else {
+ this.sgmlDecl += c;
+ }
+ }
+ }
+ }
+ }
+ continue;
+ case 6:
+ if (c === this.q) {
+ this.state = 5;
+ this.q = "";
+ }
+ this.sgmlDecl += c;
+ continue;
+ case 7:
+ if (c === ">") {
+ this.state = 2;
+ this.closetext_if_exist$();
+ this.doctype.trim();
+ } else {
+ this.doctype += c;
+ if (c === "[") {
+ this.state = 9;
+ } else {
+ charclass$4 = _.quote;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$4, c)) {
+ this.state = 8;
+ this.q = c;
+ }
+ }
+ }
+ continue;
+ case 8:
+ this.doctype += c;
+ if (c === this.q) {
+ this.q = "";
+ this.state = 7;
+ }
+ continue;
+ case 9:
+ this.doctype += c;
+ if (c === "]") {
+ this.state = 7;
+ } else {
+ charclass$5 = _.quote;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$5, c)) {
+ this.state = 10;
+ this.q = c;
+ }
+ }
+ continue;
+ case 10:
+ this.doctype += c;
+ if (c === this.q) {
+ this.state = 9;
+ this.q = "";
+ }
+ continue;
+ case 12:
+ if (c === "-") {
+ this.state = 13;
+ } else {
+ this.comment += c;
+ }
+ continue;
+ case 13:
+ if (c === "-") {
+ this.state = 14;
+ text$0 = this.comment;
+ text$0 = text$0.replace(/[\n\t]/g, ' ');
+ text$0 = text$0.replace(/\s\s+/g, " ");
+ comment$0 = this.comment = text$0;
+ if (comment$0) {
+ this.closetext_if_exist$();
+ this.comment.trim();
+ }
+ this.comment = "";
+ } else {
+ this.comment += "-" + c;
+ this.state = 12;
+ }
+ continue;
+ case 14:
+ if (c !== ">") {
+ this.strictFail$S("Malformed comment");
+ this.comment += "--" + c;
+ this.state = 12;
+ } else {
+ this.state = 2;
+ }
+ continue;
+ case 15:
+ if (c === "]") {
+ this.state = 16;
+ } else {
+ this.cdata += c;
+ }
+ continue;
+ case 16:
+ if (c === "]") {
+ this.state = 17;
+ } else {
+ this.cdata += "]" + c;
+ this.state = 15;
+ }
+ continue;
+ case 17:
+ if (c === ">") {
+ if (this.cdata) {
+ this.closetext_if_exist$();
+ }
+ this.cdata = "";
+ this.state = 2;
+ } else {
+ if (c === "]") {
+ this.cdata += "]";
+ } else {
+ this.cdata += "]]" + c;
+ this.state = 15;
+ }
+ }
+ continue;
+ case 18:
+ if (c === "?") {
+ this.state = 20;
+ } else {
+ charclass$6 = _.whitespace;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$6, c)) {
+ this.state = 19;
+ } else {
+ this.procInstName += c;
+ }
+ }
+ continue;
+ case 19:
+ if (! this.procInstBody && _.is$HBS(_.whitespace, c)) {
+ continue;
+ } else {
+ if (c === "?") {
+ this.state = 20;
+ } else {
+ this.procInstBody += c;
+ }
+ }
+ continue;
+ case 20:
+ if (c === ">") {
+ this.closetext_if_exist$();
+ this.procInstName = this.procInstBody = "";
+ this.state = 2;
+ } else {
+ this.procInstBody += "?" + c;
+ this.state = 19;
+ }
+ continue;
+ case 21:
+ charclass$7 = _.nameBody;
+ if (charclass$7.test(c)) {
+ this.tagName += c;
+ } else {
+ this.newTag$();
+ if (c === ">") {
+ this.openTag$B(false);
+ } else {
+ if (c === "/") {
+ this.state = 22;
+ } else {
+ charclass$8 = _.whitespace;
+ if (! $__jsx_ObjectHasOwnProperty.call(charclass$8, c)) {
+ this.strictFail$S("Invalid character in tag name");
+ }
+ this.state = 23;
+ }
+ }
+ }
+ continue;
+ case 22:
+ if (c === ">") {
+ this.openTag$B(true);
+ this.closeTag$();
+ } else {
+ this.strictFail$S("Forward-slash in opening tag not followed by >");
+ this.state = 23;
+ }
+ continue;
+ case 23:
+ charclass$9 = _.whitespace;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$9, c)) {
+ continue;
+ } else {
+ if (c === ">") {
+ this.openTag$B(false);
+ } else {
+ if (c === "/") {
+ this.state = 22;
+ } else {
+ charclass$10 = _.nameStart;
+ if (charclass$10.test(c)) {
+ this.attribName = c;
+ this.attribValue = "";
+ this.state = 24;
+ } else {
+ this.strictFail$S("Invalid attribute name");
+ }
+ }
+ }
+ }
+ continue;
+ case 24:
+ if (c === "=") {
+ this.state = 26;
+ } else {
+ if (c === ">") {
+ this.strictFail$S("Attribute without value");
+ this.attribValue = this.attribName;
+ this.attrib$();
+ this.openTag$B(false);
+ } else {
+ charclass$11 = _.whitespace;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$11, c)) {
+ this.state = 25;
+ } else {
+ charclass$12 = _.nameBody;
+ if (charclass$12.test(c)) {
+ this.attribName += c;
+ } else {
+ this.strictFail$S("Invalid attribute name");
+ }
+ }
+ }
+ }
+ continue;
+ case 25:
+ if (c === "=") {
+ this.state = 26;
+ } else {
+ charclass$13 = _.whitespace;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$13, c)) {
+ continue;
+ } else {
+ this.strictFail$S("Attribute without value");
+ this.tag.attributes[this.attribName] = "";
+ this.attribValue = "";
+ this.closetext_if_exist$();
+ this.attribName = "";
+ if (c === ">") {
+ this.openTag$B(false);
+ } else {
+ charclass$14 = _.nameStart;
+ if (charclass$14.test(c)) {
+ this.attribName = c;
+ this.state = 24;
+ } else {
+ this.strictFail$S("Invalid attribute name");
+ this.state = 23;
+ }
+ }
+ }
+ }
+ continue;
+ case 26:
+ charclass$15 = _.whitespace;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$15, c)) {
+ continue;
+ } else {
+ charclass$16 = _.quote;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$16, c)) {
+ this.q = c;
+ this.state = 27;
+ } else {
+ this.strictFail$S("Unquoted attribute value");
+ this.state = 28;
+ this.attribValue = c;
+ }
+ }
+ continue;
+ case 27:
+ if (c !== this.q) {
+ if (c === "&") {
+ this.state = 29;
+ } else {
+ this.attribValue += c;
+ }
+ continue;
+ }
+ this.attrib$();
+ this.q = "";
+ this.state = 23;
+ continue;
+ case 28:
+ charclass$17 = _.attribEnd;
+ if (! $__jsx_ObjectHasOwnProperty.call(charclass$17, c)) {
+ if (c === "&") {
+ this.state = 30;
+ } else {
+ this.attribValue += c;
+ }
+ continue;
+ }
+ this.attrib$();
+ if (c === ">") {
+ this.openTag$B(false);
+ } else {
+ this.state = 23;
+ }
+ continue;
+ case 31:
+ if (! this.tagName) {
+ charclass$18 = _.whitespace;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$18, c)) {
+ continue;
+ } else {
+ charclass$19 = _.nameStart;
+ if (! charclass$19.test(c)) {
+ if (this.script) {
+ this.script += "</" + c;
+ this.state = 33;
+ } else {
+ this.strictFail$S("Invalid tagname in closing tag.");
+ }
+ } else {
+ this.tagName = c;
+ }
+ }
+ } else {
+ if (c === ">") {
+ this.closeTag$();
+ } else {
+ charclass$20 = _.nameBody;
+ if (charclass$20.test(c)) {
+ this.tagName += c;
+ } else {
+ if (this.script) {
+ this.script += "</" + this.tagName;
+ this.tagName = "";
+ this.state = 33;
+ } else {
+ charclass$21 = _.whitespace;
+ if (! $__jsx_ObjectHasOwnProperty.call(charclass$21, c)) {
+ this.strictFail$S("Invalid tagname in closing tag");
+ }
+ this.state = 32;
+ }
+ }
+ }
+ }
+ continue;
+ case 32:
+ charclass$22 = _.whitespace;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$22, c)) {
+ continue;
+ }
+ if (c === ">") {
+ this.closeTag$();
+ } else {
+ this.strictFail$S("Invalid characters in closing tag");
+ }
+ continue;
+ case 3:
+ if (c === ";") {
+ this.textNode += this.parseEntity$();
+ this.entity = "";
+ this.state = 2;
+ } else {
+ charclass$23 = _.entity;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$23, c)) {
+ this.entity += c;
+ } else {
+ this.strictFail$S("Invalid character entity");
+ this.textNode += "&" + this.entity + c;
+ this.entity = "";
+ this.state = 2;
+ }
+ }
+ continue;
+ case 29:
+ case 30:
+ if (this.state === 29) {
+ returnState = 27;
+ } else {
+ returnState = 28;
+ }
+ if (c === ";") {
+ this.attribValue += this.parseEntity$();
+ this.entity = "";
+ this.state = (returnState | 0);
+ } else {
+ charclass$24 = _.entity;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$24, c)) {
+ this.entity += c;
+ } else {
+ this.strictFail$S("Invalid character entity");
+ this.attribValue += "&" + this.entity + c;
+ this.entity = "";
+ this.state = (returnState | 0);
+ }
+ }
+ continue;
+ default:
+ throw new Error("Unknown state: " + (this.state + ""));
+ }
+ }
+ this.end$();
+ return this;
+};
+
+/**
+ */
+SAXParser.prototype.clearBuffers$ = function () {
+ this.comment = '';
+ this.sgmlDecl = '';
+ this.textNode = '';
+ this.tagName = '';
+ this.doctype = '';
+ this.procInstName = '';
+ this.procInstBody = '';
+ this.entity = '';
+ this.attribName = '';
+ this.attribValue = '';
+ this.cdata = '';
+ this.script = '';
+};
+
+/**
+ */
+SAXParser.prototype.closetext_if_exist$ = function () {
+ if (this.textNode !== '') {
+ this.closetext$();
+ }
+};
+
+/**
+ */
+SAXParser.prototype.closetext$ = function () {
+ /** @type {!string} */
+ var text;
+ /** @type {!string} */
+ var text$0;
+ if (this.preTags === 0) {
+ text$0 = this.textNode;
+ text$0 = text$0.replace(/[\n\t]/g, ' ');
+ text$0 = text$0.replace(/\s\s+/g, " ");
+ text = text$0;
+ if (text$0) {
+ this.handler.ontext$S(text);
+ }
+ } else {
+ if (this.textNode) {
+ this.handler.ontext$S(this.textNode);
+ }
+ }
+ this.textNode = "";
+};
+
+/**
+ * @param {!string} text
+ * @return {!string}
+ */
+SAXParser.prototype.textopts$S = function (text) {
+ text = text.replace(/[\n\t]/g, ' ');
+ text = text.replace(/\s\s+/g, " ");
+ return text;
+};
+
+/**
+ * @param {!string} er
+ * @return {SAXParser}
+ */
+SAXParser.prototype.emiterror$S = function (er) {
+ /** @type {Error} */
+ var error;
+ this.closetext$();
+ er += "\nLine: " + (this.line + "") + "\nColumn: " + (this.column + "") + "\nChar: " + this.c;
+ error = new Error(er);
+ this.error = error;
+ return this;
+};
+
+/**
+ */
+SAXParser.prototype.end$ = function () {
+ if (! this.closedRoot) {
+ this.strictFail$S("Unclosed root tag");
+ }
+ if (this.state !== 2) {
+ this.emiterror$S("Unexpected end");
+ }
+ this.closetext$();
+ this.c = "";
+ this.closed = true;
+};
+
+/**
+ * @param {!string} message
+ */
+SAXParser.prototype.strictFail$S = function (message) {
+ if (this.strict) {
+ this.emiterror$S(message);
+ }
+};
+
+/**
+ */
+SAXParser.prototype.newTag$ = function () {
+ if (! this.strict) {
+ this.tagName = this.tagName.toLowerCase();
+ }
+ this.tag = ({name: this.tagName, attributes: ({ }), isSelfClosing: false});
+ this.attribList.length = 0;
+};
+
+/**
+ */
+SAXParser.prototype.attrib$ = function () {
+ if (! this.strict) {
+ this.attribName = this.attribName.toLowerCase();
+ }
+ if ($__jsx_ObjectHasOwnProperty.call(this.tag.attributes, this.attribName)) {
+ this.attribName = this.attribValue = "";
+ return;
+ }
+ this.tag.attributes[this.attribName] = this.attribValue;
+ this.closetext_if_exist$();
+ this.attribName = this.attribValue = "";
+};
+
+/**
+ */
+SAXParser.prototype.openTag$ = function () {
+ this.openTag$B(false);
+};
+
+/**
+ * @param {!boolean} selfClosing
+ */
+SAXParser.prototype.openTag$B = function (selfClosing) {
+ /** @type {Tag} */
+ var tag$0;
+ /** @type {Tag} */
+ var tag$1;
+ (tag$0 = this.tag).isSelfClosing = selfClosing;
+ this.sawRoot = true;
+ this.tags.push(tag$0);
+ this.closetext_if_exist$();
+ this.handler.onopentag$SHS((tag$1 = this.tag).name, tag$1.attributes);
+ if (this.tag.name === 'pre') {
+ this.preTags++;
+ }
+ if (! selfClosing) {
+ if (! this.noscript && this.tagName.toLowerCase() === "script") {
+ this.state = 33;
+ } else {
+ this.state = 2;
+ }
+ this.tag = null;
+ this.tagName = "";
+ }
+ this.attribName = this.attribValue = "";
+ this.attribList.length = 0;
+};
+
+/**
+ */
+SAXParser.prototype.closeTag$ = function () {
+ /** @type {!number} */
+ var t;
+ /** @type {!string} */
+ var tagName;
+ /** @type {!string} */
+ var closeTo;
+ /** @type {Tag} */
+ var close;
+ /** @type {!number} */
+ var s;
+ /** @type {Tag} */
+ var tag$0;
+ if (! this.tagName) {
+ this.strictFail$S("Weird empty close tag.");
+ this.textNode += "</>";
+ this.state = 2;
+ return;
+ }
+ if (this.script) {
+ if (this.tagName !== "script") {
+ this.script += "</" + this.tagName + ">";
+ this.tagName = "";
+ this.state = 33;
+ return;
+ }
+ this.closetext_if_exist$();
+ this.script = "";
+ }
+ t = this.tags.length;
+ tagName = this.tagName;
+ if (! this.strict) {
+ tagName = tagName.toLowerCase();
+ }
+ closeTo = tagName;
+ while (t--) {
+ close = this.tags[t];
+ if (close.name !== closeTo) {
+ this.strictFail$S("Unexpected close tag");
+ } else {
+ break;
+ }
+ }
+ if (t < 0) {
+ this.strictFail$S("Unmatched closing tag: " + this.tagName);
+ this.textNode += "</" + this.tagName + ">";
+ this.state = 2;
+ return;
+ }
+ this.tagName = tagName;
+ s = this.tags.length;
+ while (s-- > t) {
+ tag$0 = this.tag = this.tags.pop();
+ this.tagName = tag$0.name;
+ this.closetext_if_exist$();
+ this.handler.onclosetag$S(this.tagName);
+ if (this.tagName === 'pre') {
+ this.preTags--;
+ }
+ }
+ if (t === 0) {
+ this.closedRoot = true;
+ }
+ this.tagName = this.attribValue = this.attribName = "";
+ this.attribList.length = 0;
+ this.state = 2;
+};
+
+/**
+ * @return {!string}
+ */
+SAXParser.prototype.parseEntity$ = function () {
+ /** @type {!string} */
+ var entity;
+ /** @type {!string} */
+ var entityLC;
+ /** @type {!number} */
+ var num;
+ /** @type {!string} */
+ var numStr;
+ entity = this.entity;
+ entityLC = entity.toLowerCase();
+ num = 0;
+ numStr = "";
+ if (this.ENTITIES[entity]) {
+ return this.ENTITIES[entity];
+ }
+ if (this.ENTITIES[entityLC]) {
+ return this.ENTITIES[entityLC];
+ }
+ entity = entityLC;
+ if (entityLC.charAt(0) === "#") {
+ if (entity.charAt(1) === "x") {
+ entity = entity.slice(2);
+ num = $__jsx_parseInt(entity, 16);
+ numStr = num.toString(16);
+ } else {
+ entity = entity.slice(1);
+ num = $__jsx_parseInt(entity, 10);
+ numStr = num.toString(10);
+ }
+ }
+ entity = entity.replace(/^0+/, "");
+ if (numStr.toLowerCase() !== entity) {
+ this.strictFail$S("Invalid character entity");
+ return "&" + this.entity + ";";
+ }
+ return String.fromCharCode(num);
+};
+
+/**
+ * class Char extends Object
+ * @constructor
+ */
+function Char() {
+}
+
+/**
+ * @constructor
+ */
+function Char$() {
+ this.CDATA = "[CDATA[";
+ this.DOCTYPE = "DOCTYPE";
+ this.XML_NAMESPACE = "http://www.w3.org/XML/1998/namespace";
+ this.whitespace = this._charClass$S("\r\n\t ");
+ this.number = this._charClass$S("0124356789");
+ this.letter = this._charClass$S("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ");
+ this.quote = this._charClass$S("'\"");
+ this.entity = this._charClass$S("0124356789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ#");
+ this.attribEnd = this._charClass$S("\r\n\t >");
+ this.nameStart = /[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/;
+ this.nameBody = /[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040\.\d-]/;
+};
+
+Char$.prototype = new Char;
+
+/**
+ * @param {!string} str
+ * @return {Object.<string, undefined|!boolean>}
+ */
+Char.prototype._charClass$S = function (str) {
+ /** @type {Object.<string, undefined|!boolean>} */
+ var result;
+ /** @type {!number} */
+ var i;
+ result = ({ });
+ for (i = 0; i < str.length; i++) {
+ result[str.slice(i, i + 1)] = true;
+ }
+ return result;
+};
+
+/**
+ * @param {RegExp} charclass
+ * @param {!string} c
+ * @return {!boolean}
+ */
+Char.prototype.is$LRegExp$S = function (charclass, c) {
+ return charclass.test(c);
+};
+
+/**
+ * @param {Object.<string, undefined|!boolean>} charclass
+ * @param {!string} c
+ * @return {!boolean}
+ */
+Char.prototype.is$HBS = function (charclass, c) {
+ return $__jsx_ObjectHasOwnProperty.call(charclass, c);
+};
+
+/**
+ * @param {RegExp} charclass
+ * @param {!string} c
+ * @return {!boolean}
+ */
+Char.prototype.not$LRegExp$S = function (charclass, c) {
+ return ! charclass.test(c);
+};
+
+/**
+ * @param {Object.<string, undefined|!boolean>} charclass
+ * @param {!string} c
+ * @return {!boolean}
+ */
+Char.prototype.not$HBS = function (charclass, c) {
+ return ! $__jsx_ObjectHasOwnProperty.call(charclass, c);
+};
+
+/**
+ * class _Entities extends Object
+ * @constructor
+ */
+function _Entities() {
+}
+
+/**
+ * @constructor
+ */
+function _Entities$() {
+};
+
+_Entities$.prototype = new _Entities;
+
+/**
+ * @return {Object.<string, undefined|!string>}
+ */
+_Entities.entity_list$ = function () {
+ /** @type {Object.<string, undefined|!string>} */
+ var result;
+ /** @type {!string} */
+ var key;
+ /** @type {*} */
+ var value;
+ result = ({ });
+ for (key in _Entities._entities) {
+ value = _Entities._entities[key];
+ if (typeof value === 'string') {
+ result[key] = value + "";
+ } else {
+ if (typeof value === 'number') {
+ result[key] = String.fromCharCode(value | 0);
+ }
+ }
+ }
+ return result;
+};
+
+var _Entities$entity_list$ = _Entities.entity_list$;
+
+/**
+ * class BitVector extends Object
+ * @constructor
+ */
+function BitVector() {
+}
+
+/**
+ * @constructor
+ */
+function BitVector$() {
+ /** @type {Array.<undefined|!number>} */
+ var _v$0;
+ /** @type {Array.<undefined|!number>} */
+ var _r$0;
+ _r$0 = this._r = [ ];
+ _v$0 = this._v = [ ];
+ _v$0.length = 0;
+ _r$0.length = 0;
+ this._size = 0;
+ this._size1 = 0;
+};
+
+BitVector$.prototype = new BitVector;
+
+/**
+ */
+BitVector.prototype.build$ = function () {
+ /** @type {!number} */
+ var i;
+ this._size1 = 0;
+ for (i = 0; i < this._v.length; i++) {
+ if (i % 8 === 0) {
+ this._r.push(true ? this._size1 : this._size - this._size1);
+ }
+ this._size1 += this._rank32$IIB(this._v[i], 32, true);
+ }
+};
+
+/**
+ */
+BitVector.prototype.clear$ = function () {
+ this._v.length = 0;
+ this._r.length = 0;
+ this._size = 0;
+ this._size1 = 0;
+};
+
+/**
+ * @return {!number}
+ */
+BitVector.prototype.size$ = function () {
+ return this._size;
+};
+
+/**
+ * @param {!boolean} b
+ * @return {!number}
+ */
+BitVector.prototype.size$B = function (b) {
+ return (b ? this._size1 : this._size - this._size1);
+};
+
+/**
+ * @param {!number} value
+ */
+BitVector.prototype.set$I = function (value) {
+ this.set$IB(value, true);
+};
+
+/**
+ * @param {!number} value
+ * @param {!boolean} flag
+ */
+BitVector.prototype.set$IB = function (value, flag) {
+ /** @type {!number} */
+ var q;
+ /** @type {!number} */
+ var r;
+ /** @type {!number} */
+ var m;
+ if (value >= this._size) {
+ this._size = (value + 1 | 0);
+ }
+ q = (value / 32 | 0);
+ r = (value % 32 | 0);
+ while (q >= this._v.length) {
+ this._v.push(0);
+ }
+ m = 0x1 << r;
+ if (flag) {
+ this._v[q] |= m;
+ } else {
+ this._v[q] &= ~ m;
+ }
+};
+
+/**
+ * @param {!number} value
+ * @return {!boolean}
+ */
+BitVector.prototype.get$I = function (value) {
+ /** @type {!number} */
+ var q;
+ /** @type {!number} */
+ var r;
+ /** @type {!number} */
+ var m;
+ if (value >= this._size) {
+ throw new Error("BitVector.get() : range error");
+ }
+ q = (value / 32 | 0);
+ r = (value % 32 | 0);
+ m = 0x1 << r;
+ return !! (this._v[q] & m);
+};
+
+/**
+ * @param {!number} i
+ * @return {!number}
+ */
+BitVector.prototype.rank$I = function (i) {
+ return this.rank$IB(i, true);
+};
+
+/**
+ * @param {!number} i
+ * @param {!boolean} b
+ * @return {!number}
+ */
+BitVector.prototype.rank$IB = function (i, b) {
+ /** @type {!number} */
+ var q_large;
+ /** @type {!number} */
+ var q_small;
+ /** @type {!number} */
+ var r;
+ /** @type {!number} */
+ var rank;
+ /** @type {!number} */
+ var begin;
+ /** @type {!number} */
+ var j;
+ if (i > this._size) {
+ throw new Error("BitVector.rank() : range error");
+ }
+ if (i === 0) {
+ return 0;
+ }
+ i--;
+ q_large = (Math.floor(i / 256) | 0);
+ q_small = (Math.floor(i / 32) | 0);
+ r = (Math.floor(i % 32) | 0);
+ rank = (this._r[q_large] | 0);
+ if (! b) {
+ rank = q_large * 256 - rank;
+ }
+ begin = q_large * 8;
+ for (j = begin; j < q_small; j++) {
+ rank += this._rank32$IIB(this._v[j], 32, b);
+ }
+ rank += this._rank32$IIB(this._v[q_small], r + 1, b);
+ return rank;
+};
+
+/**
+ * @param {!number} i
+ * @return {!number}
+ */
+BitVector.prototype.select$I = function (i) {
+ return this.select$IB(i, true);
+};
+
+/**
+ * @param {!number} i
+ * @param {!boolean} b
+ * @return {!number}
+ */
+BitVector.prototype.select$IB = function (i, b) {
+ /** @type {!number} */
+ var left;
+ /** @type {!number} */
+ var right;
+ /** @type {!number} */
+ var pivot;
+ /** @type {undefined|!number} */
+ var rank;
+ /** @type {!number} */
+ var j;
+ if (i >= (b ? this._size1 : this._size - this._size1)) {
+ throw new Error("BitVector.select() : range error");
+ }
+ left = 0;
+ right = this._r.length;
+ while (left < right) {
+ pivot = Math.floor((left + right) / 2);
+ rank = this._r[pivot];
+ if (! b) {
+ rank = pivot * 256 - rank;
+ }
+ if (i < rank) {
+ right = pivot;
+ } else {
+ left = pivot + 1;
+ }
+ }
+ right--;
+ if (b) {
+ i -= (this._r[right] | 0);
+ } else {
+ i -= (right * 256 - this._r[right] | 0);
+ }
+ j = right * 8;
+ while (1) {
+ rank = this._rank32$IIB(this._v[j], 32, b);
+ if (i < rank) {
+ break;
+ }
+ j++;
+ i -= (rank | 0);
+ }
+ return (j * 32 + this._select32$IIB(this._v[j], i, b) | 0);
+};
+
+/**
+ * @param {!number} x
+ * @param {!number} i
+ * @param {!boolean} b
+ * @return {!number}
+ */
+BitVector.prototype._rank32$IIB = function (x, i, b) {
+ if (! b) {
+ x = ~ x;
+ }
+ x <<= 32 - i;
+ x = ((x & 0xaaaaaaaa) >>> 1) + (x & 0x55555555);
+ x = ((x & 0xcccccccc) >>> 2) + (x & 0x33333333);
+ x = ((x & 0xf0f0f0f0) >>> 4) + (x & 0x0f0f0f0f);
+ x = ((x & 0xff00ff00) >>> 8) + (x & 0x00ff00ff);
+ x = ((x & 0xffff0000) >>> 16) + (x & 0x0000ffff);
+ return x;
+};
+
+/**
+ * @param {!number} x
+ * @param {!number} i
+ * @param {!boolean} b
+ * @return {!number}
+ */
+BitVector.prototype._select32$IIB = function (x, i, b) {
+ /** @type {!number} */
+ var x1;
+ /** @type {!number} */
+ var x2;
+ /** @type {!number} */
+ var x3;
+ /** @type {!number} */
+ var x4;
+ /** @type {!number} */
+ var x5;
+ /** @type {!number} */
+ var pos;
+ /** @type {!number} */
+ var v5;
+ /** @type {!number} */
+ var v4;
+ /** @type {!number} */
+ var v3;
+ /** @type {!number} */
+ var v2;
+ /** @type {!number} */
+ var v1;
+ /** @type {!number} */
+ var v0;
+ if (! b) {
+ x = ~ x;
+ }
+ x1 = ((x & 0xaaaaaaaa) >>> 1) + (x & 0x55555555);
+ x2 = ((x1 & 0xcccccccc) >>> 2) + (x1 & 0x33333333);
+ x3 = ((x2 & 0xf0f0f0f0) >>> 4) + (x2 & 0x0f0f0f0f);
+ x4 = ((x3 & 0xff00ff00) >>> 8) + (x3 & 0x00ff00ff);
+ x5 = ((x4 & 0xffff0000) >>> 16) + (x4 & 0x0000ffff);
+ i++;
+ pos = 0;
+ v5 = x5 & 0xffffffff;
+ if (i > v5) {
+ i -= (v5 | 0);
+ pos += 32;
+ }
+ v4 = x4 >>> pos & 0x0000ffff;
+ if (i > v4) {
+ i -= (v4 | 0);
+ pos += 16;
+ }
+ v3 = x3 >>> pos & 0x000000ff;
+ if (i > v3) {
+ i -= (v3 | 0);
+ pos += 8;
+ }
+ v2 = x2 >>> pos & 0x0000000f;
+ if (i > v2) {
+ i -= (v2 | 0);
+ pos += 4;
+ }
+ v1 = x1 >>> pos & 0x00000003;
+ if (i > v1) {
+ i -= (v1 | 0);
+ pos += 2;
+ }
+ v0 = x >>> pos & 0x00000001;
+ if (i > v0) {
+ i -= (v0 | 0);
+ pos += 1;
+ }
+ return (pos | 0);
+};
+
+/**
+ * @return {!string}
+ */
+BitVector.prototype.dump$ = function () {
+ /** @type {Array.<undefined|!string>} */
+ var contents;
+ contents = [ ];
+ contents.push(Binary$dump32bitNumber$N(this._size));
+ contents.push(Binary$dump32bitNumberList$AN(this._v));
+ return contents.join('');
+};
+
+/**
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+BitVector.prototype.dump$LCompressionReport$ = function (report) {
+ /** @type {Array.<undefined|!string>} */
+ var contents;
+ contents = [ ];
+ contents.push(Binary$dump32bitNumber$N(this._size));
+ CompressionReport$add$LCompressionReport$II(report, 2, 2);
+ contents.push(Binary$dump32bitNumberList$ANLCompressionReport$(this._v, report));
+ return contents.join('');
+};
+
+/**
+ * @param {!string} data
+ * @return {!number}
+ */
+BitVector.prototype.load$S = function (data) {
+ return this.load$SI(data, 0);
+};
+
+/**
+ * @param {!string} data
+ * @param {!number} offset
+ * @return {!number}
+ */
+BitVector.prototype.load$SI = function (data, offset) {
+ /** @type {LoadedNumberListResult} */
+ var result;
+ /** @type {!number} */
+ var result$0;
+ this._v.length = 0;
+ this._r.length = 0;
+ this._size = 0;
+ this._size1 = 0;
+ result$0 = data.charCodeAt(offset) * 65536 + data.charCodeAt(offset + 1);
+ this._size = (result$0 | 0);
+ result = Binary$load32bitNumberList$SI(data, offset + 2);
+ this._v = result.result;
+ this.build$();
+ return result.offset;
+};
+
+/**
+ * class WaveletMatrix extends Object
+ * @constructor
+ */
+function WaveletMatrix() {
+}
+
+/**
+ * @constructor
+ */
+function WaveletMatrix$() {
+ /** @type {Array.<undefined|BitVector>} */
+ var _bv$0;
+ /** @type {Array.<undefined|!number>} */
+ var _seps$0;
+ this._range = ({ });
+ _bv$0 = this._bv = [ ];
+ _seps$0 = this._seps = [ ];
+ this._bitsize = 16;
+ _bv$0.length = 0;
+ _seps$0.length = 0;
+ this._size = 0;
+};
+
+WaveletMatrix$.prototype = new WaveletMatrix;
+
+/**
+ * @return {!number}
+ */
+WaveletMatrix.prototype.bitsize$ = function () {
+ return this._bitsize;
+};
+
+/**
+ * @param {!number} charCode
+ */
+WaveletMatrix.prototype.setMaxCharCode$I = function (charCode) {
+ this._bitsize = (Math.ceil(Math.log(charCode) / 0.6931471805599453) | 0);
+};
+
+/**
+ */
+WaveletMatrix.prototype.clear$ = function () {
+ this._bv.length = 0;
+ this._seps.length = 0;
+ this._size = 0;
+};
+
+/**
+ * @param {!string} v
+ */
+WaveletMatrix.prototype.build$S = function (v) {
+ /** @type {!number} */
+ var size;
+ /** @type {!number} */
+ var bitsize;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var depth;
+ /** @type {Object.<string, undefined|!number>} */
+ var range_tmp;
+ /** @type {!number} */
+ var code;
+ /** @type {!boolean} */
+ var bit;
+ /** @type {!number} */
+ var key;
+ /** @type {Object.<string, undefined|!number>} */
+ var range_rev;
+ /** @type {!string} */
+ var range_key;
+ /** @type {!number} */
+ var value;
+ /** @type {!number} */
+ var pos0;
+ /** @type {undefined|!number} */
+ var pos1;
+ /** @type {!string} */
+ var range_rev_key;
+ /** @type {!number} */
+ var begin;
+ /** @type {undefined|!number} */
+ var end;
+ /** @type {!number} */
+ var num0;
+ /** @type {!number} */
+ var num1;
+ this._bv.length = 0;
+ this._seps.length = 0;
+ this._size = 0;
+ size = v.length;
+ bitsize = this._bitsize;
+ for (i = 0; i < bitsize; i++) {
+ this._bv.push(new BitVector$());
+ this._seps.push(0);
+ }
+ this._size = (size | 0);
+ for (i = 0; i < size; i++) {
+ this._bv[0].set$IB(i, this._uint2bit$II(v.charCodeAt(i), 0));
+ }
+ this._bv[0].build$();
+ this._seps[0] = this._bv[0].size$B(false);
+ this._range["0"] = 0;
+ this._range["1"] = this._seps[0];
+ depth = 1;
+ while (depth < bitsize) {
+ range_tmp = WaveletMatrix$_shallow_copy$HI(this._range);
+ for (i = 0; i < size; i++) {
+ code = v.charCodeAt(i);
+ bit = this._uint2bit$II(code, depth);
+ key = code >>> bitsize - depth;
+ this._bv[depth].set$IB(range_tmp[key + ""], bit);
+ range_tmp[key + ""]++;
+ }
+ this._bv[depth].build$();
+ this._seps[depth] = this._bv[depth].size$B(false);
+ range_rev = ({ });
+ for (range_key in this._range) {
+ value = this._range[range_key];
+ if (value != range_tmp[range_key]) {
+ range_rev[value + ""] = range_key | 0;
+ }
+ }
+ this._range = ({ });
+ pos0 = 0;
+ pos1 = this._seps[depth];
+ for (range_rev_key in range_rev) {
+ begin = range_rev_key | 0;
+ value = range_rev[range_rev_key];
+ end = range_tmp[value + ""];
+ num0 = this._bv[depth].rank$IB(end, false) - this._bv[depth].rank$IB(begin, false);
+ num1 = end - begin - num0;
+ if (num0 > 0) {
+ this._range[(value << 1) + ""] = (pos0 | 0);
+ pos0 += num0;
+ }
+ if (num1 > 0) {
+ this._range[(value << 1) + 1 + ""] = pos1;
+ pos1 += (num1 | 0);
+ }
+ }
+ depth++;
+ }
+};
+
+/**
+ * @return {!number}
+ */
+WaveletMatrix.prototype.size$ = function () {
+ return this._size;
+};
+
+/**
+ * @param {!number} c
+ * @return {!number}
+ */
+WaveletMatrix.prototype.size$I = function (c) {
+ return this.rank$II(this._size, c);
+};
+
+/**
+ * @param {!number} i
+ * @return {!number}
+ */
+WaveletMatrix.prototype.get$I = function (i) {
+ /** @type {!number} */
+ var value;
+ /** @type {!number} */
+ var depth;
+ /** @type {!boolean} */
+ var bit;
+ if (i >= this._size) {
+ throw new Error("WaveletMatrix.get() : range error");
+ }
+ value = 0;
+ depth = 0;
+ while (depth < this._bitsize) {
+ bit = this._bv[depth].get$I(i);
+ i = this._bv[depth].rank$IB(i, bit);
+ value <<= 1;
+ if (bit) {
+ i += this._seps[depth];
+ value += 1;
+ }
+ depth++;
+ }
+ return (value | 0);
+};
+
+/**
+ * @param {!number} i
+ * @param {!number} c
+ * @return {!number}
+ */
+WaveletMatrix.prototype.rank$II = function (i, c) {
+ /** @type {undefined|!number} */
+ var begin;
+ /** @type {!number} */
+ var end;
+ /** @type {!number} */
+ var depth;
+ /** @type {!boolean} */
+ var bit;
+ if (i > this._size) {
+ throw new Error("WaveletMatrix.rank(): range error");
+ }
+ if (i === 0) {
+ return 0;
+ }
+ begin = this._range[c + ""];
+ if (begin == null) {
+ return 0;
+ }
+ end = i;
+ depth = 0;
+ while (depth < this._bitsize) {
+ bit = this._uint2bit$II(c, depth);
+ end = this._bv[depth].rank$IB(end, bit);
+ if (bit) {
+ end += this._seps[depth];
+ }
+ depth++;
+ }
+ return (end - begin | 0);
+};
+
+/**
+ * @param {!number} i
+ * @param {!number} c
+ * @return {!number}
+ */
+WaveletMatrix.prototype.rank_less_than$II = function (i, c) {
+ /** @type {!number} */
+ var begin;
+ /** @type {!number} */
+ var end;
+ /** @type {!number} */
+ var depth;
+ /** @type {!number} */
+ var rlt;
+ /** @type {!number} */
+ var rank0_begin;
+ /** @type {!number} */
+ var rank0_end;
+ /** @type {Array.<undefined|!number>} */
+ var _seps$0;
+ if (i > this._size) {
+ throw new Error("WaveletMatrix.rank_less_than(): range error");
+ }
+ if (i === 0) {
+ return 0;
+ }
+ begin = 0;
+ end = i;
+ depth = 0;
+ rlt = 0;
+ while (depth < this._bitsize) {
+ rank0_begin = this._bv[depth].rank$IB(begin, false);
+ rank0_end = this._bv[depth].rank$IB(end, false);
+ if (this._uint2bit$II(c, depth)) {
+ rlt += rank0_end - rank0_begin;
+ begin += (_seps$0 = this._seps)[depth] - rank0_begin;
+ end += _seps$0[depth] - rank0_end;
+ } else {
+ begin = rank0_begin;
+ end = rank0_end;
+ }
+ depth++;
+ }
+ return (rlt | 0);
+};
+
+/**
+ * @return {!string}
+ */
+WaveletMatrix.prototype.dump$ = function () {
+ /** @type {Array.<undefined|!string>} */
+ var contents;
+ /** @type {!number} */
+ var i;
+ /** @type {Array.<undefined|!string>} */
+ var range_contents;
+ /** @type {!number} */
+ var counter;
+ /** @type {!string} */
+ var key;
+ contents = [ Binary$dump16bitNumber$I(this._bitsize), Binary$dump32bitNumber$N(this._size) ];
+ for (i = 0; i < this._bitsize; i++) {
+ contents.push(this._bv[i].dump$());
+ }
+ for (i = 0; i < this._bitsize; i++) {
+ contents.push(Binary$dump32bitNumber$N(this._seps[i]));
+ }
+ range_contents = [ ];
+ counter = 0;
+ for (key in this._range) {
+ range_contents.push(Binary$dump32bitNumber$N(key | 0));
+ range_contents.push(Binary$dump32bitNumber$N(this._range[key]));
+ counter++;
+ }
+ contents.push(Binary$dump32bitNumber$N(counter));
+ return contents.join('') + range_contents.join('');
+};
+
+/**
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+WaveletMatrix.prototype.dump$LCompressionReport$ = function (report) {
+ /** @type {Array.<undefined|!string>} */
+ var contents;
+ /** @type {!number} */
+ var i;
+ /** @type {Array.<undefined|!string>} */
+ var range_contents;
+ /** @type {!number} */
+ var counter;
+ /** @type {!string} */
+ var key;
+ contents = [ Binary$dump16bitNumber$I(this._bitsize), Binary$dump32bitNumber$N(this._size) ];
+ CompressionReport$add$LCompressionReport$II(report, 3, 3);
+ for (i = 0; i < this._bitsize; i++) {
+ contents.push(this._bv[i].dump$LCompressionReport$(report));
+ }
+ for (i = 0; i < this._bitsize; i++) {
+ contents.push(Binary$dump32bitNumber$N(this._seps[i]));
+ CompressionReport$add$LCompressionReport$II(report, 2, 2);
+ }
+ range_contents = [ ];
+ counter = 0;
+ for (key in this._range) {
+ range_contents.push(Binary$dump32bitNumber$N(key | 0));
+ range_contents.push(Binary$dump32bitNumber$N(this._range[key]));
+ CompressionReport$add$LCompressionReport$II(report, 4, 4);
+ counter++;
+ }
+ CompressionReport$add$LCompressionReport$II(report, 2, 2);
+ contents.push(Binary$dump32bitNumber$N(counter));
+ return contents.join('') + range_contents.join('');
+};
+
+/**
+ * @param {!string} data
+ * @return {!number}
+ */
+WaveletMatrix.prototype.load$S = function (data) {
+ return this.load$SI(data, 0);
+};
+
+/**
+ * @param {!string} data
+ * @param {!number} offset
+ * @return {!number}
+ */
+WaveletMatrix.prototype.load$SI = function (data, offset) {
+ /** @type {!number} */
+ var i;
+ /** @type {BitVector} */
+ var bit_vector;
+ /** @type {!number} */
+ var range_size;
+ /** @type {!number} */
+ var value;
+ /** @type {!number} */
+ var offset$0;
+ /** @type {!number} */
+ var result$0;
+ /** @type {!number} */
+ var result$1;
+ /** @type {!number} */
+ var result$2;
+ this._bv.length = 0;
+ this._seps.length = 0;
+ this._size = 0;
+ offset$0 = offset++;
+ this._bitsize = (data.charCodeAt(offset$0) | 0);
+ result$0 = data.charCodeAt(offset) * 65536 + data.charCodeAt(offset + 1);
+ this._size = (result$0 | 0);
+ offset += 2;
+ for (i = 0; i < this._bitsize; i++) {
+ bit_vector = new BitVector$();
+ offset = bit_vector.load$SI(data, offset);
+ this._bv.push(bit_vector);
+ }
+ for (i = 0; i < this._bitsize; (i++, offset += 2)) {
+ this._seps.push(Binary$load32bitNumber$SI(data, offset));
+ }
+ result$1 = data.charCodeAt(offset) * 65536 + data.charCodeAt(offset + 1);
+ range_size = result$1;
+ offset += 2;
+ for (i = 0; i < range_size; (i++, offset += 4)) {
+ result$2 = data.charCodeAt(offset) * 65536 + data.charCodeAt(offset + 1);
+ value = Binary$load32bitNumber$SI(data, offset + 2);
+ this._range[result$2 + ""] = (value | 0);
+ }
+ return offset;
+};
+
+/**
+ * @param {Object.<string, undefined|!number>} input
+ * @return {Object.<string, undefined|!number>}
+ */
+WaveletMatrix._shallow_copy$HI = function (input) {
+ /** @type {Object.<string, undefined|!number>} */
+ var result;
+ /** @type {!string} */
+ var key;
+ result = ({ });
+ for (key in input) {
+ result[key] = input[key];
+ }
+ return result;
+};
+
+var WaveletMatrix$_shallow_copy$HI = WaveletMatrix._shallow_copy$HI;
+
+/**
+ * @param {!number} c
+ * @param {!number} i
+ * @return {!boolean}
+ */
+WaveletMatrix.prototype._uint2bit$II = function (c, i) {
+ return (c >>> this._bitsize - 1 - i & 0x1) === 0x1;
+};
+
+/**
+ * class BurrowsWheelerTransform extends Object
+ * @constructor
+ */
+function BurrowsWheelerTransform() {
+}
+
+/**
+ * @constructor
+ */
+function BurrowsWheelerTransform$() {
+ this._str = "";
+ this._size = 0;
+ this._head = 0;
+ this._suffixarray = [ ];
+};
+
+BurrowsWheelerTransform$.prototype = new BurrowsWheelerTransform;
+
+/**
+ * @param {BurrowsWheelerTransform} $this
+ * @return {!number}
+ */
+BurrowsWheelerTransform.size$LBurrowsWheelerTransform$ = function ($this) {
+ return $this._size;
+};
+
+var BurrowsWheelerTransform$size$LBurrowsWheelerTransform$ = BurrowsWheelerTransform.size$LBurrowsWheelerTransform$;
+
+/**
+ * @param {BurrowsWheelerTransform} $this
+ * @return {!number}
+ */
+BurrowsWheelerTransform.head$LBurrowsWheelerTransform$ = function ($this) {
+ return $this._head;
+};
+
+var BurrowsWheelerTransform$head$LBurrowsWheelerTransform$ = BurrowsWheelerTransform.head$LBurrowsWheelerTransform$;
+
+/**
+ * @param {BurrowsWheelerTransform} $this
+ */
+BurrowsWheelerTransform.clear$LBurrowsWheelerTransform$ = function ($this) {
+ $this._str = "";
+ $this._size = 0;
+ $this._head = 0;
+ $this._suffixarray.length = 0;
+};
+
+var BurrowsWheelerTransform$clear$LBurrowsWheelerTransform$ = BurrowsWheelerTransform.clear$LBurrowsWheelerTransform$;
+
+/**
+ * @param {BurrowsWheelerTransform} $this
+ * @param {!string} str
+ */
+BurrowsWheelerTransform.build$LBurrowsWheelerTransform$S = function ($this, str) {
+ /** @type {!string} */
+ var _str$0;
+ /** @type {Array.<undefined|!number>} */
+ var _suffixarray$0;
+ _str$0 = $this._str = str;
+ $this._size = _str$0.length;
+ _suffixarray$0 = $this._suffixarray = SAIS$make$S(str);
+ $this._head = (_suffixarray$0.indexOf(0) | 0);
+};
+
+var BurrowsWheelerTransform$build$LBurrowsWheelerTransform$S = BurrowsWheelerTransform.build$LBurrowsWheelerTransform$S;
+
+/**
+ * @param {BurrowsWheelerTransform} $this
+ * @param {!number} i
+ * @return {!string}
+ */
+BurrowsWheelerTransform.get$LBurrowsWheelerTransform$I = function ($this, i) {
+ /** @type {!number} */
+ var size;
+ /** @type {!number} */
+ var index;
+ size = $this._size;
+ if (i >= size) {
+ throw new Error("BurrowsWheelerTransform.get() : range error");
+ }
+ index = ($this._suffixarray[i] + size - 1) % size;
+ return $this._str.charAt(index);
+};
+
+var BurrowsWheelerTransform$get$LBurrowsWheelerTransform$I = BurrowsWheelerTransform.get$LBurrowsWheelerTransform$I;
+
+/**
+ * @param {BurrowsWheelerTransform} $this
+ * @return {!string}
+ */
+BurrowsWheelerTransform.get$LBurrowsWheelerTransform$ = function ($this) {
+ /** @type {Array.<undefined|!string>} */
+ var str;
+ /** @type {!number} */
+ var size;
+ /** @type {!number} */
+ var i;
+ str = [ ];
+ size = $this._size;
+ for (i = 0; i < size; i++) {
+ str.push(BurrowsWheelerTransform$get$LBurrowsWheelerTransform$I($this, i));
+ }
+ return str.join("");
+};
+
+var BurrowsWheelerTransform$get$LBurrowsWheelerTransform$ = BurrowsWheelerTransform.get$LBurrowsWheelerTransform$;
+
+/**
+ * @param {BurrowsWheelerTransform} $this
+ * @param {!string} replace
+ * @return {!string}
+ */
+BurrowsWheelerTransform.get$LBurrowsWheelerTransform$S = function ($this, replace) {
+ /** @type {!string} */
+ var result;
+ result = BurrowsWheelerTransform$get$LBurrowsWheelerTransform$($this);
+ return result.replace(BurrowsWheelerTransform.END_MARKER, replace);
+};
+
+var BurrowsWheelerTransform$get$LBurrowsWheelerTransform$S = BurrowsWheelerTransform.get$LBurrowsWheelerTransform$S;
+
+/**
+ * class OArray extends Object
+ * @constructor
+ */
+function OArray() {
+}
+
+/**
+ * @constructor
+ * @param {Array.<undefined|!number>} array
+ */
+function OArray$AI(array) {
+ this.array = array;
+ this.offset = 0;
+};
+
+OArray$AI.prototype = new OArray;
+
+/**
+ * @constructor
+ * @param {Array.<undefined|!number>} array
+ * @param {!number} offset
+ */
+function OArray$AII(array, offset) {
+ this.array = array;
+ this.offset = offset;
+};
+
+OArray$AII.prototype = new OArray;
+
+/**
+ * @param {OArray} $this
+ * @param {!number} index
+ * @return {!number}
+ */
+OArray.get$LOArray$I = function ($this, index) {
+ return $this.array[index + $this.offset];
+};
+
+var OArray$get$LOArray$I = OArray.get$LOArray$I;
+
+/**
+ * @param {OArray} $this
+ * @param {!number} index
+ * @param {!number} value
+ */
+OArray.set$LOArray$II = function ($this, index, value) {
+ $this.array[index + $this.offset] = value;
+};
+
+var OArray$set$LOArray$II = OArray.set$LOArray$II;
+
+/**
+ * @param {OArray} $this
+ * @param {!number} index
+ * @return {!boolean}
+ */
+OArray.isS$LOArray$I = function ($this, index) {
+ /** @type {Array.<undefined|!number>} */
+ var array$0;
+ /** @type {!number} */
+ var offset$0;
+ return (array$0 = $this.array)[index + (offset$0 = $this.offset)] < array$0[index + offset$0 + 1];
+};
+
+var OArray$isS$LOArray$I = OArray.isS$LOArray$I;
+
+/**
+ * @param {OArray} $this
+ * @param {!number} index1
+ * @param {!number} index2
+ * @return {!boolean}
+ */
+OArray.compare$LOArray$II = function ($this, index1, index2) {
+ /** @type {Array.<undefined|!number>} */
+ var array$0;
+ /** @type {!number} */
+ var offset$0;
+ return (array$0 = $this.array)[index1 + (offset$0 = $this.offset)] == array$0[index2 + offset$0];
+};
+
+var OArray$compare$LOArray$II = OArray.compare$LOArray$II;
+
+/**
+ * class SAIS extends Object
+ * @constructor
+ */
+function SAIS() {
+}
+
+/**
+ * @constructor
+ */
+function SAIS$() {
+};
+
+SAIS$.prototype = new SAIS;
+
+/**
+ * @param {BitVector} t
+ * @param {!number} i
+ * @return {!boolean}
+ */
+SAIS._isLMS$LBitVector$I = function (t, i) {
+ return i > 0 && t.get$I(i) && ! t.get$I(i - 1);
+};
+
+var SAIS$_isLMS$LBitVector$I = SAIS._isLMS$LBitVector$I;
+
+/**
+ * @param {OArray} s
+ * @param {Array.<undefined|!number>} bkt
+ * @param {!number} n
+ * @param {!number} K
+ * @param {!boolean} end
+ */
+SAIS._getBuckets$LOArray$AIIIB = function (s, bkt, n, K, end) {
+ /** @type {!number} */
+ var sum;
+ /** @type {!number} */
+ var i;
+ sum = 0;
+ for (i = 0; i <= K; i++) {
+ bkt[i] = 0;
+ }
+ for (i = 0; i < n; i++) {
+ bkt[OArray$get$LOArray$I(s, i)]++;
+ }
+ for (i = 0; i <= K; i++) {
+ sum += bkt[i];
+ bkt[i] = ((end ? sum : sum - bkt[i]) | 0);
+ }
+};
+
+var SAIS$_getBuckets$LOArray$AIIIB = SAIS._getBuckets$LOArray$AIIIB;
+
+/**
+ * @param {BitVector} t
+ * @param {Array.<undefined|!number>} SA
+ * @param {OArray} s
+ * @param {Array.<undefined|!number>} bkt
+ * @param {!number} n
+ * @param {!number} K
+ * @param {!boolean} end
+ */
+SAIS._induceSAl$LBitVector$AILOArray$AIIIB = function (t, SA, s, bkt, n, K, end) {
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var j;
+ SAIS$_getBuckets$LOArray$AIIIB(s, bkt, n, K, end);
+ for (i = 0; i < n; i++) {
+ j = SA[i] - 1;
+ if (j >= 0 && ! t.get$I(j)) {
+ SA[bkt[OArray$get$LOArray$I(s, j)]++] = (j | 0);
+ }
+ }
+};
+
+var SAIS$_induceSAl$LBitVector$AILOArray$AIIIB = SAIS._induceSAl$LBitVector$AILOArray$AIIIB;
+
+/**
+ * @param {BitVector} t
+ * @param {Array.<undefined|!number>} SA
+ * @param {OArray} s
+ * @param {Array.<undefined|!number>} bkt
+ * @param {!number} n
+ * @param {!number} K
+ * @param {!boolean} end
+ */
+SAIS._induceSAs$LBitVector$AILOArray$AIIIB = function (t, SA, s, bkt, n, K, end) {
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var j;
+ SAIS$_getBuckets$LOArray$AIIIB(s, bkt, n, K, end);
+ for (i = n - 1; i >= 0; i--) {
+ j = SA[i] - 1;
+ if (j >= 0 && t.get$I(j)) {
+ SA[-- bkt[OArray$get$LOArray$I(s, j)]] = (j | 0);
+ }
+ }
+};
+
+var SAIS$_induceSAs$LBitVector$AILOArray$AIIIB = SAIS._induceSAs$LBitVector$AILOArray$AIIIB;
+
+/**
+ * @param {!string} source
+ * @return {Array.<undefined|!number>}
+ */
+SAIS.make$S = function (source) {
+ /** @type {Array.<undefined|!number>} */
+ var charCodes;
+ /** @type {!number} */
+ var maxCode;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var code;
+ /** @type {Array.<undefined|!number>} */
+ var SA;
+ /** @type {OArray} */
+ var s;
+ charCodes = [ ];
+ charCodes.length = source.length;
+ maxCode = 0;
+ for (i = 0; i < source.length; i++) {
+ code = source.charCodeAt(i);
+ charCodes[i] = (code | 0);
+ maxCode = (code > maxCode ? code : maxCode);
+ }
+ SA = [ ];
+ SA.length = source.length;
+ s = ({offset: 0, array: charCodes});
+ SAIS$_make$LOArray$AIII(s, SA, source.length, maxCode);
+ return SA;
+};
+
+var SAIS$make$S = SAIS.make$S;
+
+/**
+ * @param {OArray} s
+ * @param {Array.<undefined|!number>} SA
+ * @param {!number} n
+ * @param {!number} K
+ */
+SAIS._make$LOArray$AIII = function (s, SA, n, K) {
+ /** @type {BitVector} */
+ var t;
+ /** @type {!number} */
+ var i;
+ /** @type {Array.<undefined|!number>} */
+ var bkt;
+ /** @type {!number} */
+ var n1;
+ /** @type {!number} */
+ var name;
+ /** @type {!number} */
+ var prev;
+ /** @type {undefined|!number} */
+ var pos;
+ /** @type {!boolean} */
+ var diff;
+ /** @type {!number} */
+ var d;
+ /** @type {!number} */
+ var j;
+ /** @type {Array.<undefined|!number>} */
+ var SA1;
+ /** @type {OArray} */
+ var s1;
+ /** @type {!number} */
+ var i$0;
+ /** @type {!number} */
+ var index$0;
+ t = new BitVector$();
+ t.set$IB(n - 2, false);
+ t.set$IB(n - 1, true);
+ for (i = n - 3; i >= 0; i--) {
+ t.set$IB(i, OArray$isS$LOArray$I(s, i) || OArray$compare$LOArray$II(s, i, i + 1) && t.get$I(i + 1));
+ }
+ bkt = [ ];
+ bkt.length = K + 1;
+ SAIS$_getBuckets$LOArray$AIIIB(s, bkt, n, K, true);
+ for (i = 0; i < n; i++) {
+ SA[i] = -1;
+ }
+ for (i = 1; i < n; i++) {
+ if (SAIS$_isLMS$LBitVector$I(t, i)) {
+ SA[-- bkt[OArray$get$LOArray$I(s, i)]] = (i | 0);
+ }
+ }
+ SAIS$_induceSAl$LBitVector$AILOArray$AIIIB(t, SA, s, bkt, n, K, false);
+ SAIS$_induceSAs$LBitVector$AILOArray$AIIIB(t, SA, s, bkt, n, K, true);
+ n1 = 0;
+ for (i = 0; i < n; i++) {
+ i$0 = SA[i];
+ if (i$0 > 0 && t.get$I(i$0) && ! t.get$I(i$0 - 1)) {
+ SA[n1++] = SA[i];
+ }
+ }
+ for (i = n1; i < n; i++) {
+ SA[i] = -1;
+ }
+ name = 0;
+ prev = -1;
+ for (i = 0; i < n1; i++) {
+ pos = SA[i];
+ diff = false;
+ for (d = 0; d < n; d++) {
+ if (prev === -1 || ! OArray$compare$LOArray$II(s, pos + d, prev + d) || t.get$I(pos + d) !== t.get$I(prev + d)) {
+ diff = true;
+ break;
+ } else {
+ if (d > 0 && (SAIS$_isLMS$LBitVector$I(t, pos + d) || SAIS$_isLMS$LBitVector$I(t, prev + d))) {
+ break;
+ }
+ }
+ }
+ if (diff) {
+ name++;
+ prev = pos;
+ }
+ pos = ((pos % 2 === 0 ? pos / 2 : (pos - 1) / 2) | 0);
+ SA[n1 + pos] = (name - 1 | 0);
+ }
+ for ((i = n - 1, j = n - 1); i >= n1; i--) {
+ if (SA[i] >= 0) {
+ SA[j--] = SA[i];
+ }
+ }
+ SA1 = SA;
+ s1 = ({offset: n - n1, array: SA});
+ if (name < n1) {
+ SAIS$_make$LOArray$AIII(s1, SA1, n1, name - 1);
+ } else {
+ for (i = 0; i < n1; i++) {
+ SA1[OArray$get$LOArray$I(s1, i)] = (i | 0);
+ }
+ }
+ bkt = [ ];
+ bkt.length = K + 1;
+ SAIS$_getBuckets$LOArray$AIIIB(s, bkt, n, K, true);
+ for ((i = 1, j = 0); i < n; i++) {
+ if (SAIS$_isLMS$LBitVector$I(t, i)) {
+ OArray$set$LOArray$II(s1, j++, i);
+ }
+ }
+ for (i = 0; i < n1; i++) {
+ index$0 = SA1[i];
+ SA1[i] = s1.array[index$0 + s1.offset];
+ }
+ for (i = n1; i < n; i++) {
+ SA[i] = -1;
+ }
+ for (i = n1 - 1; i >= 0; i--) {
+ j = SA[i];
+ SA[i] = -1;
+ SA[-- bkt[OArray$get$LOArray$I(s, j)]] = (j | 0);
+ }
+ SAIS$_induceSAl$LBitVector$AILOArray$AIIIB(t, SA, s, bkt, n, K, false);
+ SAIS$_induceSAs$LBitVector$AILOArray$AIIIB(t, SA, s, bkt, n, K, true);
+};
+
+var SAIS$_make$LOArray$AIII = SAIS._make$LOArray$AIII;
+
+OktaviaSearch._stemmer = null;
+OktaviaSearch._instance = null;
+$__jsx_lazy_init(Oktavia, "eof", function () {
+ return String.fromCharCode(0);
+});
+$__jsx_lazy_init(Oktavia, "eob", function () {
+ return String.fromCharCode(1);
+});
+$__jsx_lazy_init(Oktavia, "unknown", function () {
+ return String.fromCharCode(3);
+});
+Binary._base64EncodeChars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
+$__jsx_lazy_init(Binary, "_base64DecodeChars", function () {
+ return [ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 62, -1, -1, -1, 63, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, -1, -1, -1, -1, -1, -1, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -1, -1, -1, -1, -1, -1, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, -1, -1, -1, -1 ];
+});
+$__jsx_lazy_init(Style, "console", function () {
+ return ({ 'title': [ '\x1B[32m\x1b[4m', '\x1B[39m\x1b[0m' ], 'url': [ '\x1B[34m', '\x1B[39m' ], 'hit': [ '\x1B[4m', '\x1B[0m' ], 'del': [ '\x1B[9m', '\x1B[0m' ], 'summary': [ '\x1B[90m', '\x1B[39m' ] });
+});
+$__jsx_lazy_init(Style, "html", function () {
+ return ({ 'title': [ '<span class="title">', '</span>' ], 'url': [ '<span class="url">', '</span>' ], 'hit': [ '<span class="hit">', '</span>' ], 'del': [ '<del>', '</del>' ], 'summary': [ '<span class="reuslt">', '</span>' ] });
+});
+$__jsx_lazy_init(Style, "ignore", function () {
+ return ({ 'tilte': [ '', '' ], 'url': [ '', '' ], 'hit': [ '', '' ], 'del': [ '', '' ], 'summary': [ '', '' ] });
+});
+PortugueseStemmer.serialVersionUID = 1;
+$__jsx_lazy_init(PortugueseStemmer, "methodObject", function () {
+ return new PortugueseStemmer$();
+});
+$__jsx_lazy_init(PortugueseStemmer, "a_0", function () {
+ return [ new Among$SII("", -1, 3), new Among$SII("\u00E3", 0, 1), new Among$SII("\u00F5", 0, 2) ];
+});
+$__jsx_lazy_init(PortugueseStemmer, "a_1", function () {
+ return [ new Among$SII("", -1, 3), new Among$SII("a~", 0, 1), new Among$SII("o~", 0, 2) ];
+});
+$__jsx_lazy_init(PortugueseStemmer, "a_2", function () {
+ return [ new Among$SII("ic", -1, -1), new Among$SII("ad", -1, -1), new Among$SII("os", -1, -1), new Among$SII("iv", -1, 1) ];
+});
+$__jsx_lazy_init(PortugueseStemmer, "a_3", function () {
+ return [ new Among$SII("ante", -1, 1), new Among$SII("avel", -1, 1), new Among$SII("\u00EDvel", -1, 1) ];
+});
+$__jsx_lazy_init(PortugueseStemmer, "a_4", function () {
+ return [ new Among$SII("ic", -1, 1), new Among$SII("abil", -1, 1), new Among$SII("iv", -1, 1) ];
+});
+$__jsx_lazy_init(PortugueseStemmer, "a_5", function () {
+ return [ new Among$SII("ica", -1, 1), new Among$SII("\u00E2ncia", -1, 1), new Among$SII("\u00EAncia", -1, 4), new Among$SII("ira", -1, 9), new Among$SII("adora", -1, 1), new Among$SII("osa", -1, 1), new Among$SII("ista", -1, 1), new Among$SII("iva", -1, 8), new Among$SII("eza", -1, 1), new Among$SII("log\u00EDa", -1, 2), new Among$SII("idade", -1, 7), new Among$SII("ante", -1, 1), new Among$SII("mente", -1, 6), new Among$SII("amente", 12, 5), new Among$SII("\u00E1vel", -1, 1), new Among$SII("\u00EDvel", -1, 1), new Among$SII("uci\u00F3n", -1, 3), new Among$SII("ico", -1, 1), new Among$SII("ismo", -1, 1), new Among$SII("oso", -1, 1), new Among$SII("amento", -1, 1), new Among$SII("imento", -1, 1), new Among$SII("ivo", -1, 8), new Among$SII("a\u00E7a~o", -1, 1), new Among$SII("ador", -1, 1), new Among$SII("icas", -1, 1), new Among$SII("\u00EAncias", -1, 4), new Among$SII("iras", -1, 9), new Among$SII("adoras", -1, 1), new Among$SII("osas", -1, 1), new Among$SII("istas", -1, 1), new Among$SII("ivas", -1, 8), new Among$SII("ezas", -1, 1), new Among$SII("log\u00EDas", -1, 2), new Among$SII("idades", -1, 7), new Among$SII("uciones", -1, 3), new Among$SII("adores", -1, 1), new Among$SII("antes", -1, 1), new Among$SII("a\u00E7o~es", -1, 1), new Among$SII("icos", -1, 1), new Among$SII("ismos", -1, 1), new Among$SII("osos", -1, 1), new Among$SII("amentos", -1, 1), new Among$SII("imentos", -1, 1), new Among$SII("ivos", -1, 8) ];
+});
+$__jsx_lazy_init(PortugueseStemmer, "a_6", function () {
+ return [ new Among$SII("ada", -1, 1), new Among$SII("ida", -1, 1), new Among$SII("ia", -1, 1), new Among$SII("aria", 2, 1), new Among$SII("eria", 2, 1), new Among$SII("iria", 2, 1), new Among$SII("ara", -1, 1), new Among$SII("era", -1, 1), new Among$SII("ira", -1, 1), new Among$SII("ava", -1, 1), new Among$SII("asse", -1, 1), new Among$SII("esse", -1, 1), new Among$SII("isse", -1, 1), new Among$SII("aste", -1, 1), new Among$SII("este", -1, 1), new Among$SII("iste", -1, 1), new Among$SII("ei", -1, 1), new Among$SII("arei", 16, 1), new Among$SII("erei", 16, 1), new Among$SII("irei", 16, 1), new Among$SII("am", -1, 1), new Among$SII("iam", 20, 1), new Among$SII("ariam", 21, 1), new Among$SII("eriam", 21, 1), new Among$SII("iriam", 21, 1), new Among$SII("aram", 20, 1), new Among$SII("eram", 20, 1), new Among$SII("iram", 20, 1), new Among$SII("avam", 20, 1), new Among$SII("em", -1, 1), new Among$SII("arem", 29, 1), new Among$SII("erem", 29, 1), new Among$SII("irem", 29, 1), new Among$SII("assem", 29, 1), new Among$SII("essem", 29, 1), new Among$SII("issem", 29, 1), new Among$SII("ado", -1, 1), new Among$SII("ido", -1, 1), new Among$SII("ando", -1, 1), new Among$SII("endo", -1, 1), new Among$SII("indo", -1, 1), new Among$SII("ara~o", -1, 1), new Among$SII("era~o", -1, 1), new Among$SII("ira~o", -1, 1), new Among$SII("ar", -1, 1), new Among$SII("er", -1, 1), new Among$SII("ir", -1, 1), new Among$SII("as", -1, 1), new Among$SII("adas", 47, 1), new Among$SII("idas", 47, 1), new Among$SII("ias", 47, 1), new Among$SII("arias", 50, 1), new Among$SII("erias", 50, 1), new Among$SII("irias", 50, 1), new Among$SII("aras", 47, 1), new Among$SII("eras", 47, 1), new Among$SII("iras", 47, 1), new Among$SII("avas", 47, 1), new Among$SII("es", -1, 1), new Among$SII("ardes", 58, 1), new Among$SII("erdes", 58, 1), new Among$SII("irdes", 58, 1), new Among$SII("ares", 58, 1), new Among$SII("eres", 58, 1), new Among$SII("ires", 58, 1), new Among$SII("asses", 58, 1), new Among$SII("esses", 58, 1), new Among$SII("isses", 58, 1), new Among$SII("astes", 58, 1), new Among$SII("estes", 58, 1), new Among$SII("istes", 58, 1), new Among$SII("is", -1, 1), new Among$SII("ais", 71, 1), new Among$SII("eis", 71, 1), new Among$SII("areis", 73, 1), new Among$SII("ereis", 73, 1), new Among$SII("ireis", 73, 1), new Among$SII("\u00E1reis", 73, 1), new Among$SII("\u00E9reis", 73, 1), new Among$SII("\u00EDreis", 73, 1), new Among$SII("\u00E1sseis", 73, 1), new Among$SII("\u00E9sseis", 73, 1), new Among$SII("\u00EDsseis", 73, 1), new Among$SII("\u00E1veis", 73, 1), new Among$SII("\u00EDeis", 73, 1), new Among$SII("ar\u00EDeis", 84, 1), new Among$SII("er\u00EDeis", 84, 1), new Among$SII("ir\u00EDeis", 84, 1), new Among$SII("ados", -1, 1), new Among$SII("idos", -1, 1), new Among$SII("amos", -1, 1), new Among$SII("\u00E1ramos", 90, 1), new Among$SII("\u00E9ramos", 90, 1), new Among$SII("\u00EDramos", 90, 1), new Among$SII("\u00E1vamos", 90, 1), new Among$SII("\u00EDamos", 90, 1), new Among$SII("ar\u00EDamos", 95, 1), new Among$SII("er\u00EDamos", 95, 1), new Among$SII("ir\u00EDamos", 95, 1), new Among$SII("emos", -1, 1), new Among$SII("aremos", 99, 1), new Among$SII("eremos", 99, 1), new Among$SII("iremos", 99, 1), new Among$SII("\u00E1ssemos", 99, 1), new Among$SII("\u00EAssemos", 99, 1), new Among$SII("\u00EDssemos", 99, 1), new Among$SII("imos", -1, 1), new Among$SII("armos", -1, 1), new Among$SII("ermos", -1, 1), new Among$SII("irmos", -1, 1), new Among$SII("\u00E1mos", -1, 1), new Among$SII("ar\u00E1s", -1, 1), new Among$SII("er\u00E1s", -1, 1), new Among$SII("ir\u00E1s", -1, 1), new Among$SII("eu", -1, 1), new Among$SII("iu", -1, 1), new Among$SII("ou", -1, 1), new Among$SII("ar\u00E1", -1, 1), new Among$SII("er\u00E1", -1, 1), new Among$SII("ir\u00E1", -1, 1) ];
+});
+$__jsx_lazy_init(PortugueseStemmer, "a_7", function () {
+ return [ new Among$SII("a", -1, 1), new Among$SII("i", -1, 1), new Among$SII("o", -1, 1), new Among$SII("os", -1, 1), new Among$SII("\u00E1", -1, 1), new Among$SII("\u00ED", -1, 1), new Among$SII("\u00F3", -1, 1) ];
+});
+$__jsx_lazy_init(PortugueseStemmer, "a_8", function () {
+ return [ new Among$SII("e", -1, 1), new Among$SII("\u00E7", -1, 2), new Among$SII("\u00E9", -1, 1), new Among$SII("\u00EA", -1, 1) ];
+});
+$__jsx_lazy_init(PortugueseStemmer, "g_v", function () {
+ return [ 17, 65, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 19, 12, 2 ];
+});
+$__jsx_lazy_init(_Common, "buffers", function () {
+ return [ "comment", "sgmlDecl", "textNode", "tagName", "doctype", "procInstName", "procInstBody", "entity", "attribName", "attribValue", "cdata", "script" ];
+});
+$__jsx_lazy_init(_Common, "EVENTS", function () {
+ return [ "text", "processinginstruction", "sgmldeclaration", "doctype", "comment", "attribute", "opentag", "closetag", "opencdata", "cdata", "clo_State.CDATA", "error", "end", "ready", "script", "opennamespace", "closenamespace" ];
+});
+_Common.MAX_BUFFER_LENGTH = 65536;
+_State.BEGIN = 1;
+_State.TEXT = 2;
+_State.TEXT_ENTITY = 3;
+_State.OPEN_WAKA = 4;
+_State.SGML_DECL = 5;
+_State.SGML_DECL_QUOTED = 6;
+_State.DOCTYPE = 7;
+_State.DOCTYPE_QUOTED = 8;
+_State.DOCTYPE_DTD = 9;
+_State.DOCTYPE_DTD_QUOTED = 10;
+_State.COMMENT_STARTING = 11;
+_State.COMMENT = 12;
+_State.COMMENT_ENDING = 13;
+_State.COMMENT_ENDED = 14;
+_State.CDATA = 15;
+_State.CDATA_ENDING = 16;
+_State.CDATA_ENDING_2 = 17;
+_State.PROC_INST = 18;
+_State.PROC_INST_BODY = 19;
+_State.PROC_INST_ENDING = 20;
+_State.OPEN_TAG = 21;
+_State.OPEN_TAG_SLASH = 22;
+_State.ATTRIB = 23;
+_State.ATTRIB_NAME = 24;
+_State.ATTRIB_NAME_SAW_WHITE = 25;
+_State.ATTRIB_VALUE = 26;
+_State.ATTRIB_VALUE_QUOTED = 27;
+_State.ATTRIB_VALUE_UNQUOTED = 28;
+_State.ATTRIB_VALUE_ENTITY_Q = 29;
+_State.ATTRIB_VALUE_ENTITY_U = 30;
+_State.CLOSE_TAG = 31;
+_State.CLOSE_TAG_SAW_WHITE = 32;
+_State.SCRIPT = 33;
+_State.SCRIPT_ENDING = 34;
+$__jsx_lazy_init(_Entities, "_entities", function () {
+ return ({ "amp": "&", "gt": ">", "lt": "<", "quot": "\"", "apos": "'", "AElig": 198, "Aacute": 193, "Acirc": 194, "Agrave": 192, "Aring": 197, "Atilde": 195, "Auml": 196, "Ccedil": 199, "ETH": 208, "Eacute": 201, "Ecirc": 202, "Egrave": 200, "Euml": 203, "Iacute": 205, "Icirc": 206, "Igrave": 204, "Iuml": 207, "Ntilde": 209, "Oacute": 211, "Ocirc": 212, "Ograve": 210, "Oslash": 216, "Otilde": 213, "Ouml": 214, "THORN": 222, "Uacute": 218, "Ucirc": 219, "Ugrave": 217, "Uuml": 220, "Yacute": 221, "aacute": 225, "acirc": 226, "aelig": 230, "agrave": 224, "aring": 229, "atilde": 227, "auml": 228, "ccedil": 231, "eacute": 233, "ecirc": 234, "egrave": 232, "eth": 240, "euml": 235, "iacute": 237, "icirc": 238, "igrave": 236, "iuml": 239, "ntilde": 241, "oacute": 243, "ocirc": 244, "ograve": 242, "oslash": 248, "otilde": 245, "ouml": 246, "szlig": 223, "thorn": 254, "uacute": 250, "ucirc": 251, "ugrave": 249, "uuml": 252, "yacute": 253, "yuml": 255, "copy": 169, "reg": 174, "nbsp": 160, "iexcl": 161, "cent": 162, "pound": 163, "curren": 164, "yen": 165, "brvbar": 166, "sect": 167, "uml": 168, "ordf": 170, "laquo": 171, "not": 172, "shy": 173, "macr": 175, "deg": 176, "plusmn": 177, "sup1": 185, "sup2": 178, "sup3": 179, "acute": 180, "micro": 181, "para": 182, "middot": 183, "cedil": 184, "ordm": 186, "raquo": 187, "frac14": 188, "frac12": 189, "frac34": 190, "iquest": 191, "times": 215, "divide": 247, "OElig": 338, "oelig": 339, "Scaron": 352, "scaron": 353, "Yuml": 376, "fnof": 402, "circ": 710, "tilde": 732, "Alpha": 913, "Beta": 914, "Gamma": 915, "Delta": 916, "Epsilon": 917, "Zeta": 918, "Eta": 919, "Theta": 920, "Iota": 921, "Kappa": 922, "Lambda": 923, "Mu": 924, "Nu": 925, "Xi": 926, "Omicron": 927, "Pi": 928, "Rho": 929, "Sigma": 931, "Tau": 932, "Upsilon": 933, "Phi": 934, "Chi": 935, "Psi": 936, "Omega": 937, "alpha": 945, "beta": 946, "gamma": 947, "delta": 948, "epsilon": 949, "zeta": 950, "eta": 951, "theta": 952, "iota": 953, "kappa": 954, "lambda": 955, "mu": 956, "nu": 957, "xi": 958, "omicron": 959, "pi": 960, "rho": 961, "sigmaf": 962, "sigma": 963, "tau": 964, "upsilon": 965, "phi": 966, "chi": 967, "psi": 968, "omega": 969, "thetasym": 977, "upsih": 978, "piv": 982, "ensp": 8194, "emsp": 8195, "thinsp": 8201, "zwnj": 8204, "zwj": 8205, "lrm": 8206, "rlm": 8207, "ndash": 8211, "mdash": 8212, "lsquo": 8216, "rsquo": 8217, "sbquo": 8218, "ldquo": 8220, "rdquo": 8221, "bdquo": 8222, "dagger": 8224, "Dagger": 8225, "bull": 8226, "hellip": 8230, "permil": 8240, "prime": 8242, "Prime": 8243, "lsaquo": 8249, "rsaquo": 8250, "oline": 8254, "frasl": 8260, "euro": 8364, "image": 8465, "weierp": 8472, "real": 8476, "trade": 8482, "alefsym": 8501, "larr": 8592, "uarr": 8593, "rarr": 8594, "darr": 8595, "harr": 8596, "crarr": 8629, "lArr": 8656, "uArr": 8657, "rArr": 8658, "dArr": 8659, "hArr": 8660, "forall": 8704, "part": 8706, "exist": 8707, "empty": 8709, "nabla": 8711, "isin": 8712, "notin": 8713, "ni": 8715, "prod": 8719, "sum": 8721, "minus": 8722, "lowast": 8727, "radic": 8730, "prop": 8733, "infin": 8734, "ang": 8736, "and": 8743, "or": 8744, "cap": 8745, "cup": 8746, "int": 8747, "there4": 8756, "sim": 8764, "cong": 8773, "asymp": 8776, "ne": 8800, "equiv": 8801, "le": 8804, "ge": 8805, "sub": 8834, "sup": 8835, "nsub": 8836, "sube": 8838, "supe": 8839, "oplus": 8853, "otimes": 8855, "perp": 8869, "sdot": 8901, "lceil": 8968, "rceil": 8969, "lfloor": 8970, "rfloor": 8971, "lang": 9001, "rang": 9002, "loz": 9674, "spades": 9824, "clubs": 9827, "hearts": 9829, "diams": 9830 });
+});
+BitVector.SMALL_BLOCK_SIZE = 32;
+BitVector.LARGE_BLOCK_SIZE = 256;
+BitVector.BLOCK_RATE = 8;
+$__jsx_lazy_init(BurrowsWheelerTransform, "END_MARKER", function () {
+ return String.fromCharCode(0);
+});
+var $__jsx_classMap = {
+ "tool/web/oktavia-portuguese-search.jsx": {
+ _Main: _Main,
+ _Main$: _Main$
+ },
+ "tool/web/oktavia-search.jsx": {
+ _Result: _Result,
+ _Result$SSSI: _Result$SSSI,
+ _Proposal: _Proposal,
+ _Proposal$SSI: _Proposal$SSI,
+ OktaviaSearch: OktaviaSearch,
+ OktaviaSearch$I: OktaviaSearch$I,
+ _Main: _Main$0,
+ _Main$: _Main$0$
+ },
+ "src/oktavia.jsx": {
+ Oktavia: Oktavia,
+ Oktavia$: Oktavia$
+ },
+ "src/binary-util.jsx": {
+ Binary: Binary,
+ Binary$: Binary$,
+ LoadedStringResult: LoadedStringResult,
+ LoadedStringResult$SI: LoadedStringResult$SI,
+ LoadedStringListResult: LoadedStringListResult,
+ LoadedStringListResult$SI: LoadedStringListResult$SI,
+ LoadedStringListMapResult: LoadedStringListMapResult,
+ LoadedStringListMapResult$SI: LoadedStringListMapResult$SI,
+ LoadedNumberListResult: LoadedNumberListResult,
+ LoadedNumberListResult$SI: LoadedNumberListResult$SI,
+ CompressionReport: CompressionReport,
+ CompressionReport$: CompressionReport$
+ },
+ "src/query.jsx": {
+ Query: Query,
+ Query$: Query$
+ },
+ "src/query-string-parser.jsx": {
+ QueryStringParser: QueryStringParser,
+ QueryStringParser$: QueryStringParser$
+ },
+ "src/search-result.jsx": {
+ Proposal: Proposal,
+ Proposal$II: Proposal$II,
+ Position: Position,
+ Position$SIB: Position$SIB,
+ SearchUnit: SearchUnit,
+ SearchUnit$I: SearchUnit$I,
+ SingleResult: SingleResult,
+ SingleResult$: SingleResult$,
+ SingleResult$SBB: SingleResult$SBB,
+ SearchSummary: SearchSummary,
+ SearchSummary$: SearchSummary$,
+ SearchSummary$LOktavia$: SearchSummary$LOktavia$
+ },
+ "src/style.jsx": {
+ Style: Style,
+ Style$S: Style$S,
+ _HTMLHandler: _HTMLHandler,
+ _HTMLHandler$HASB: _HTMLHandler$HASB
+ },
+ "src/stemmer/stemmer.jsx": {
+ Stemmer: Stemmer,
+ Stemmer$: Stemmer$
+ },
+ "src/stemmer/base-stemmer.jsx": {
+ BaseStemmer: BaseStemmer,
+ BaseStemmer$: BaseStemmer$
+ },
+ "src/stemmer/portuguese-stemmer.jsx": {
+ PortugueseStemmer: PortugueseStemmer,
+ PortugueseStemmer$: PortugueseStemmer$
+ },
+ "src/stemmer/among.jsx": {
+ Among: Among,
+ Among$SII: Among$SII,
+ Among$SIIF$LBaseStemmer$B$LBaseStemmer$: Among$SIIF$LBaseStemmer$B$LBaseStemmer$
+ },
+ "src/metadata.jsx": {
+ Metadata: Metadata,
+ Metadata$LOktavia$: Metadata$LOktavia$,
+ Section: Section,
+ Section$LOktavia$: Section$LOktavia$,
+ Splitter: Splitter,
+ Splitter$LOktavia$: Splitter$LOktavia$,
+ Splitter$LOktavia$S: Splitter$LOktavia$S,
+ Table: Table,
+ Table$LOktavia$AS: Table$LOktavia$AS,
+ Block: Block,
+ Block$LOktavia$: Block$LOktavia$
+ },
+ "src/fm-index.jsx": {
+ FMIndex: FMIndex,
+ FMIndex$: FMIndex$
+ },
+ "src/sax.jsx": {
+ Tag: Tag,
+ Tag$S: Tag$S,
+ _Common: _Common,
+ _Common$: _Common$,
+ _State: _State,
+ _State$: _State$,
+ SAXHandler: SAXHandler,
+ SAXHandler$: SAXHandler$,
+ SAXParser: SAXParser,
+ SAXParser$LSAXHandler$: SAXParser$LSAXHandler$,
+ SAXParser$LSAXHandler$B: SAXParser$LSAXHandler$B,
+ Char: Char,
+ Char$: Char$,
+ _Entities: _Entities,
+ _Entities$: _Entities$
+ },
+ "src/bit-vector.jsx": {
+ BitVector: BitVector,
+ BitVector$: BitVector$
+ },
+ "src/wavelet-matrix.jsx": {
+ WaveletMatrix: WaveletMatrix,
+ WaveletMatrix$: WaveletMatrix$
+ },
+ "src/burrows-wheeler-transform.jsx": {
+ BurrowsWheelerTransform: BurrowsWheelerTransform,
+ BurrowsWheelerTransform$: BurrowsWheelerTransform$
+ },
+ "src/sais.jsx": {
+ OArray: OArray,
+ OArray$AI: OArray$AI,
+ OArray$AII: OArray$AII,
+ SAIS: SAIS,
+ SAIS$: SAIS$
+ }
+};
+
+
+/**
+ * launches _Main.main(:string[]):void invoked by jsx --run|--executable
+ */
+JSX.runMain = function (sourceFile, args) {
+ var module = JSX.require(sourceFile);
+ if (! module) {
+ throw new ReferenceError("entry point module not found in " + sourceFile);
+ }
+ if (! module._Main) {
+ throw new ReferenceError("entry point _Main not found in " + sourceFile);
+ }
+ if (! module._Main.main$AS) {
+ throw new ReferenceError("entry point _Main.main(:string[]):void not found in " + sourceFile);
+ }
+ module._Main.main$AS(args);
+};
+
+/**
+ * launches _Test#test*():void invoked by jsx --test
+ */
+JSX.runTests = function (sourceFile, tests) {
+ var module = JSX.require(sourceFile);
+ var testClass = module._Test$;
+
+ if (!testClass) return; // skip if there's no test class
+
+ if(tests.length === 0) {
+ var p = testClass.prototype;
+ for (var m in p) {
+ if (p[m] instanceof Function
+ && /^test.*[$]$/.test(m)) {
+ tests.push(m);
+ }
+ }
+ }
+ else { // set as process arguments
+ tests = tests.map(function (name) {
+ return name + "$"; // mangle for function test*():void
+ });
+ }
+
+ var testCase = new testClass();
+
+ if (testCase.beforeClass$AS != null)
+ testCase.beforeClass$AS(tests);
+
+ for (var i = 0; i < tests.length; ++i) {
+ (function (method) {
+ if (method in testCase) {
+ testCase.run$SF$V$(method, function() { testCase[method](); });
+ }
+ else {
+ throw new ReferenceError("No such test method: " + method);
+ }
+ }(tests[i]));
+ }
+
+ if (testCase.afterClass$ != null)
+ testCase.afterClass$();
+};
+/**
+ * call a function on load/DOMContentLoaded
+ */
+function $__jsx_onload (event) {
+ window.removeEventListener("load", $__jsx_onload);
+ document.removeEventListener("DOMContentLoaded", $__jsx_onload);
+ JSX.runMain("tool/web/oktavia-portuguese-search.jsx", [])
+}
+
+window.addEventListener("load", $__jsx_onload);
+document.addEventListener("DOMContentLoaded", $__jsx_onload);
+
+})(JSX);
diff --git a/web/server/h2o/libh2o/misc/oktavia/lib/oktavia-romanian-search.js b/web/server/h2o/libh2o/misc/oktavia/lib/oktavia-romanian-search.js
new file mode 100644
index 00000000..4e4e65a8
--- /dev/null
+++ b/web/server/h2o/libh2o/misc/oktavia/lib/oktavia-romanian-search.js
@@ -0,0 +1,8488 @@
+// generatedy by JSX compiler 0.9.24 (2013-04-05 13:45:00 +0900; 1b229cc6a411f674f0f7cf7a79b7a8b3f8eb7414)
+var JSX = {};
+(function (JSX) {
+/**
+ * copies the implementations from source interface to target
+ */
+function $__jsx_merge_interface(target, source) {
+ for (var k in source.prototype)
+ if (source.prototype.hasOwnProperty(k))
+ target.prototype[k] = source.prototype[k];
+}
+
+/**
+ * defers the initialization of the property
+ */
+function $__jsx_lazy_init(obj, prop, func) {
+ function reset(obj, prop, value) {
+ delete obj[prop];
+ obj[prop] = value;
+ return value;
+ }
+
+ Object.defineProperty(obj, prop, {
+ get: function () {
+ return reset(obj, prop, func());
+ },
+ set: function (v) {
+ reset(obj, prop, v);
+ },
+ enumerable: true,
+ configurable: true
+ });
+}
+
+/**
+ * sideeffect().a /= b
+ */
+function $__jsx_div_assign(obj, prop, divisor) {
+ return obj[prop] = (obj[prop] / divisor) | 0;
+}
+
+/*
+ * global functions, renamed to avoid conflict with local variable names
+ */
+var $__jsx_parseInt = parseInt;
+var $__jsx_parseFloat = parseFloat;
+var $__jsx_isNaN = isNaN;
+var $__jsx_isFinite = isFinite;
+
+var $__jsx_encodeURIComponent = encodeURIComponent;
+var $__jsx_decodeURIComponent = decodeURIComponent;
+var $__jsx_encodeURI = encodeURI;
+var $__jsx_decodeURI = decodeURI;
+
+var $__jsx_ObjectToString = Object.prototype.toString;
+var $__jsx_ObjectHasOwnProperty = Object.prototype.hasOwnProperty;
+
+/*
+ * profiler object, initialized afterwards
+ */
+function $__jsx_profiler() {
+}
+
+/*
+ * public interface to JSX code
+ */
+JSX.require = function (path) {
+ var m = $__jsx_classMap[path];
+ return m !== undefined ? m : null;
+};
+
+JSX.profilerIsRunning = function () {
+ return $__jsx_profiler.getResults != null;
+};
+
+JSX.getProfileResults = function () {
+ return ($__jsx_profiler.getResults || function () { return {}; })();
+};
+
+JSX.postProfileResults = function (url, cb) {
+ if ($__jsx_profiler.postResults == null)
+ throw new Error("profiler has not been turned on");
+ return $__jsx_profiler.postResults(url, cb);
+};
+
+JSX.resetProfileResults = function () {
+ if ($__jsx_profiler.resetResults == null)
+ throw new Error("profiler has not been turned on");
+ return $__jsx_profiler.resetResults();
+};
+JSX.DEBUG = false;
+/**
+ * class _Main extends Object
+ * @constructor
+ */
+function _Main() {
+}
+
+/**
+ * @constructor
+ */
+function _Main$() {
+};
+
+_Main$.prototype = new _Main;
+
+/**
+ * @param {Array.<undefined|!string>} args
+ */
+_Main.main$AS = function (args) {
+ OktaviaSearch$setStemmer$LStemmer$(new RomanianStemmer$());
+};
+
+var _Main$main$AS = _Main.main$AS;
+
+/**
+ * class _Result extends Object
+ * @constructor
+ */
+function _Result() {
+}
+
+/**
+ * @constructor
+ * @param {!string} title
+ * @param {!string} url
+ * @param {!string} content
+ * @param {!number} score
+ */
+function _Result$SSSI(title, url, content, score) {
+ this.title = title;
+ this.url = url;
+ this.content = content;
+ this.score = score;
+};
+
+_Result$SSSI.prototype = new _Result;
+
+/**
+ * class _Proposal extends Object
+ * @constructor
+ */
+function _Proposal() {
+}
+
+/**
+ * @constructor
+ * @param {!string} options
+ * @param {!string} label
+ * @param {!number} count
+ */
+function _Proposal$SSI(options, label, count) {
+ this.options = options;
+ this.label = label;
+ this.count = count;
+};
+
+_Proposal$SSI.prototype = new _Proposal;
+
+/**
+ * class OktaviaSearch extends Object
+ * @constructor
+ */
+function OktaviaSearch() {
+}
+
+/**
+ * @constructor
+ * @param {!number} entriesPerPage
+ */
+function OktaviaSearch$I(entriesPerPage) {
+ this._queries = null;
+ this._highlight = "";
+ this._result = null;
+ this._proposals = null;
+ this._currentFolderDepth = 0;
+ this._oktavia = new Oktavia$();
+ this._entriesPerPage = entriesPerPage;
+ this._currentPage = 1;
+ this._queryString = null;
+ this._callback = null;
+ OktaviaSearch._instance = this;
+};
+
+OktaviaSearch$I.prototype = new OktaviaSearch;
+
+/**
+ * @param {Stemmer} stemmer
+ */
+OktaviaSearch.setStemmer$LStemmer$ = function (stemmer) {
+ /** @type {Oktavia} */
+ var this$0;
+ if (OktaviaSearch._instance) {
+ this$0 = OktaviaSearch._instance._oktavia;
+ this$0._stemmer = stemmer;
+ } else {
+ OktaviaSearch._stemmer = stemmer;
+ }
+};
+
+var OktaviaSearch$setStemmer$LStemmer$ = OktaviaSearch.setStemmer$LStemmer$;
+
+/**
+ * @param {!string} index
+ */
+OktaviaSearch.prototype.loadIndex$S = function (index) {
+ /** @type {Oktavia} */
+ var this$0;
+ /** @type {Stemmer} */
+ var stemmer$0;
+ if (OktaviaSearch._stemmer) {
+ this$0 = this._oktavia;
+ stemmer$0 = OktaviaSearch._stemmer;
+ this$0._stemmer = stemmer$0;
+ }
+ this._oktavia.load$S(Binary$base64decode$S(index));
+ if (this._queryString) {
+ this.search$SF$IIV$(this._queryString, this._callback);
+ this._queryString = null;
+ this._callback = null;
+ }
+};
+
+/**
+ * @param {!string} queryString
+ * @param {*} callback
+ */
+OktaviaSearch.prototype.search$SF$IIV$ = function (queryString, callback) {
+ /** @type {QueryStringParser} */
+ var queryParser;
+ /** @type {SearchSummary} */
+ var summary;
+ /** @type {Array.<undefined|SearchUnit>} */
+ var _result$0;
+ if (this._oktavia) {
+ queryParser = ({queries: [ ]});
+ this._queries = QueryStringParser$parse$LQueryStringParser$S(queryParser, queryString);
+ this._highlight = QueryStringParser$highlight$LQueryStringParser$(queryParser);
+ summary = this._oktavia.search$ALQuery$(this._queries);
+ if (SearchSummary$size$LSearchSummary$(summary) > 0) {
+ this._result = this._sortResult$LSearchSummary$(summary);
+ this._proposals = [ ];
+ this._currentPage = 1;
+ } else {
+ this._result = [ ];
+ if (this._queries.length > 1) {
+ this._proposals = SearchSummary$getProposal$LSearchSummary$(summary);
+ } else {
+ this._proposals = [ ];
+ }
+ this._currentPage = 1;
+ }
+ callback((_result$0 = this._result).length, Math.ceil(_result$0.length / this._entriesPerPage));
+ } else {
+ this._queryString = queryString;
+ this._callback = callback;
+ }
+};
+
+/**
+ * @return {!number}
+ */
+OktaviaSearch.prototype.resultSize$ = function () {
+ return (this._result.length | 0);
+};
+
+/**
+ * @return {!number}
+ */
+OktaviaSearch.prototype.totalPages$ = function () {
+ return (Math.ceil(this._result.length / this._entriesPerPage) | 0);
+};
+
+/**
+ * @return {!number}
+ */
+OktaviaSearch.prototype.currentPage$ = function () {
+ return this._currentPage;
+};
+
+/**
+ * @param {!number} page
+ */
+OktaviaSearch.prototype.setCurrentPage$I = function (page) {
+ this._currentPage = page;
+};
+
+/**
+ * @return {!boolean}
+ */
+OktaviaSearch.prototype.hasPrevPage$ = function () {
+ return this._currentPage !== 1;
+};
+
+/**
+ * @return {!boolean}
+ */
+OktaviaSearch.prototype.hasNextPage$ = function () {
+ return this._currentPage !== Math.ceil(this._result.length / this._entriesPerPage);
+};
+
+/**
+ * @return {Array.<undefined|!string>}
+ */
+OktaviaSearch.prototype.pageIndexes$ = function () {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var total;
+ /** @type {!number} */
+ var i;
+ result = [ ];
+ total = Math.ceil(this._result.length / this._entriesPerPage);
+ if (total < 10) {
+ for (i = 1; i <= total; i++) {
+ result.push(i + "");
+ }
+ } else {
+ if (this._currentPage <= 5) {
+ for (i = 1; i <= 7; i++) {
+ result.push(i + "");
+ }
+ result.push('...', total + "");
+ } else {
+ if (total - 5 <= this._currentPage) {
+ result.push('1', '...');
+ for (i = total - 8; i <= total; i++) {
+ result.push(i + "");
+ }
+ } else {
+ result.push('1', '...');
+ for (i = this._currentPage - 3; i <= this._currentPage + 3; i++) {
+ result.push(i + "");
+ }
+ result.push('...', total + "");
+ }
+ }
+ }
+ return result;
+};
+
+/**
+ * @return {Array.<undefined|_Result>}
+ */
+OktaviaSearch.prototype.getResult$ = function () {
+ /** @type {Style} */
+ var style;
+ /** @type {!number} */
+ var start;
+ /** @type {!number} */
+ var last;
+ /** @type {Metadata} */
+ var metadata;
+ /** @type {!number} */
+ var num;
+ /** @type {Array.<undefined|_Result>} */
+ var results;
+ /** @type {!number} */
+ var i;
+ /** @type {SearchUnit} */
+ var unit;
+ /** @type {Array.<undefined|!string>} */
+ var info;
+ /** @type {!string} */
+ var content;
+ /** @type {Array.<undefined|Position>} */
+ var positions;
+ /** @type {!number} */
+ var end;
+ /** @type {!boolean} */
+ var split;
+ /** @type {!number} */
+ var j;
+ /** @type {Position} */
+ var pos;
+ /** @type {!string} */
+ var text;
+ /** @type {Oktavia} */
+ var this$0;
+ /** @type {!number} */
+ var position$0;
+ /** @type {!number} */
+ var _currentPage$0;
+ /** @type {!number} */
+ var _entriesPerPage$0;
+ style = new Style$S('html');
+ start = ((_currentPage$0 = this._currentPage) - 1) * (_entriesPerPage$0 = this._entriesPerPage);
+ last = Math.min(_currentPage$0 * _entriesPerPage$0, this._result.length);
+ this$0 = this._oktavia;
+ metadata = this$0._metadatas[this$0._metadataLabels[0]];
+ num = 250;
+ results = [ ];
+ for (i = start; i < last; i++) {
+ unit = this._result[i];
+ info = metadata.getInformation$I(unit.id).split(Oktavia.eob);
+ content = metadata.getContent$I(unit.id);
+ start = 0;
+ positions = SearchUnit$getPositions$LSearchUnit$(unit);
+ if (content.indexOf(info[0]) === 1) {
+ content = content.slice(info[0].length + 2, content.length);
+ start += info[0].length + 2;
+ }
+ end = start + num;
+ split = false;
+ if (positions[0].position > end - positions[0].word.length) {
+ end = positions[0].position + Math.floor(num / 2);
+ split = true;
+ }
+ for (j = positions.length - 1; j > -1; j--) {
+ pos = positions[j];
+ if (pos.position + pos.word.length < end) {
+ content = [ content.slice(0, pos.position - start), style.convert$S('<hit>*</hit>').replace('*', content.slice((position$0 = pos.position) - start, position$0 + pos.word.length - start)), content.slice(pos.position + pos.word.length - start, content.length) ].join('');
+ }
+ }
+ if (split) {
+ text = [ content.slice(0, Math.floor(num / 2)) + ' ...', content.slice(- Math.floor(num / 2), end - start) ].join('<br/>');
+ } else {
+ text = content.slice(0, end - start) + ' ...<br/>';
+ }
+ text = text.replace(Oktavia.eob, ' ').replace(/(<br\/>)(<br\/>)+/, '<br/><br/>');
+ results.push(({title: info[0], url: info[1], content: text, score: unit.score}));
+ }
+ return results;
+};
+
+/**
+ * @return {!string}
+ */
+OktaviaSearch.prototype.getHighlight$ = function () {
+ return this._highlight;
+};
+
+/**
+ * @return {Array.<undefined|_Proposal>}
+ */
+OktaviaSearch.prototype.getProposals$ = function () {
+ /** @type {Style} */
+ var style;
+ /** @type {Array.<undefined|_Proposal>} */
+ var results;
+ /** @type {!number} */
+ var i;
+ /** @type {Proposal} */
+ var proposal;
+ /** @type {Array.<undefined|!string>} */
+ var label;
+ /** @type {Array.<undefined|!string>} */
+ var option;
+ /** @type {!number} */
+ var j;
+ style = new Style$S('html');
+ results = [ ];
+ if (this._queries.length > 1) {
+ for (i = 0; i < this._proposals.length; i++) {
+ proposal = this._proposals[i];
+ if (proposal.expect > 0) {
+ label = [ ];
+ option = [ ];
+ for (j = 0; j < this._queries.length; j++) {
+ if (j !== proposal.omit) {
+ label.push(style.convert$S('<hit>' + this._queries[j].toString() + '</hit>'));
+ option.push(this._queries[j].toString());
+ } else {
+ label.push(style.convert$S('<del>' + this._queries[j].toString() + '</del>'));
+ }
+ }
+ results.push(({options: option.join(' '), label: label.join('&nbsp;'), count: proposal.expect}));
+ }
+ }
+ }
+ return results;
+};
+
+/**
+ * @param {SearchSummary} summary
+ * @return {Array.<undefined|SearchUnit>}
+ */
+OktaviaSearch.prototype._sortResult$LSearchSummary$ = function (summary) {
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var score;
+ /** @type {SearchUnit} */
+ var unit;
+ /** @type {!string} */
+ var pos;
+ /** @type {Position} */
+ var position;
+ for (i = 0; i < summary.result.units.length; i++) {
+ score = 0;
+ unit = summary.result.units[i];
+ for (pos in unit.positions) {
+ position = unit.positions[pos];
+ if (this._oktavia.wordPositionType$I(position.position)) {
+ score += 10;
+ } else {
+ score += 1;
+ }
+ if (! position.stemmed) {
+ score += 2;
+ }
+ }
+ unit.score = (score | 0);
+ }
+ return SearchSummary$getSortedResult$LSearchSummary$(summary);
+};
+
+/**
+ * class _Main$0 extends Object
+ * @constructor
+ */
+function _Main$0() {
+}
+
+/**
+ * @constructor
+ */
+function _Main$0$() {
+};
+
+_Main$0$.prototype = new _Main$0;
+
+/**
+ * @param {Array.<undefined|!string>} args
+ */
+_Main$0.main$AS = function (args) {
+};
+
+var _Main$0$main$AS = _Main$0.main$AS;
+
+/**
+ * class Oktavia extends Object
+ * @constructor
+ */
+function Oktavia() {
+}
+
+/**
+ * @constructor
+ */
+function Oktavia$() {
+ /** @type {Array.<undefined|!string>} */
+ var _utf162compressCode$0;
+ this._compressCode2utf16 = null;
+ this._fmindex = new FMIndex$();
+ this._metadatas = ({ });
+ this._metadataLabels = [ ];
+ this._stemmer = null;
+ this._stemmingResult = ({ });
+ _utf162compressCode$0 = this._utf162compressCode = [ Oktavia.eof, Oktavia.eob, Oktavia.unknown ];
+ _utf162compressCode$0.length = 65536;
+ this._compressCode2utf16 = [ Oktavia.eof, Oktavia.eob, Oktavia.unknown ];
+};
+
+Oktavia$.prototype = new Oktavia;
+
+/**
+ * @param {Stemmer} stemmer
+ */
+Oktavia.prototype.setStemmer$LStemmer$ = function (stemmer) {
+ this._stemmer = stemmer;
+};
+
+/**
+ * @return {Metadata}
+ */
+Oktavia.prototype.getPrimaryMetadata$ = function () {
+ return this._metadatas[this._metadataLabels[0]];
+};
+
+/**
+ * @param {!string} key
+ * @return {Section}
+ */
+Oktavia.prototype.addSection$S = function (key) {
+ /** @type {Section} */
+ var section;
+ if (this._metadataLabels.indexOf(key) !== -1) {
+ throw new Error('Metadata name ' + key + ' is already exists');
+ }
+ this._metadataLabels.push(key);
+ section = new Section$LOktavia$(this);
+ this._metadatas[key] = section;
+ return section;
+};
+
+/**
+ * @param {!string} key
+ * @return {Section}
+ */
+Oktavia.prototype.getSection$S = function (key) {
+ if (this._metadataLabels.indexOf(key) === -1) {
+ throw new Error('Metadata name ' + key + " does't exists");
+ }
+ return this._metadatas[key];
+};
+
+/**
+ * @param {!string} key
+ * @return {Splitter}
+ */
+Oktavia.prototype.addSplitter$S = function (key) {
+ /** @type {Splitter} */
+ var splitter;
+ if (this._metadataLabels.indexOf(key) !== -1) {
+ throw new Error('Metadata name ' + key + ' is already exists');
+ }
+ this._metadataLabels.push(key);
+ splitter = new Splitter$LOktavia$(this);
+ this._metadatas[key] = splitter;
+ return splitter;
+};
+
+/**
+ * @param {!string} key
+ * @return {Splitter}
+ */
+Oktavia.prototype.getSplitter$S = function (key) {
+ if (this._metadataLabels.indexOf(key) === -1) {
+ throw new Error('Metadata name ' + key + " does't exists");
+ }
+ return this._metadatas[key];
+};
+
+/**
+ * @param {!string} key
+ * @param {Array.<undefined|!string>} headers
+ * @return {Table}
+ */
+Oktavia.prototype.addTable$SAS = function (key, headers) {
+ /** @type {Table} */
+ var table;
+ if (this._metadataLabels.indexOf(key) !== -1) {
+ throw new Error('Metadata name ' + key + ' is already exists');
+ }
+ this._metadataLabels.push(key);
+ table = new Table$LOktavia$AS(this, headers);
+ this._metadatas[key] = table;
+ return table;
+};
+
+/**
+ * @param {!string} key
+ * @return {Table}
+ */
+Oktavia.prototype.getTable$S = function (key) {
+ if (this._metadataLabels.indexOf(key) === -1) {
+ throw new Error('Metadata name ' + key + " does't exists");
+ }
+ return this._metadatas[key];
+};
+
+/**
+ * @param {!string} key
+ * @return {Block}
+ */
+Oktavia.prototype.addBlock$S = function (key) {
+ /** @type {Block} */
+ var block;
+ if (this._metadataLabels.indexOf(key) !== -1) {
+ throw new Error('Metadata name ' + key + ' is already exists');
+ }
+ this._metadataLabels.push(key);
+ block = new Block$LOktavia$(this);
+ this._metadatas[key] = block;
+ return block;
+};
+
+/**
+ * @param {!string} key
+ * @return {Block}
+ */
+Oktavia.prototype.getBlock$S = function (key) {
+ if (this._metadataLabels.indexOf(key) === -1) {
+ throw new Error('Metadata name ' + key + " does't exists");
+ }
+ return this._metadatas[key];
+};
+
+/**
+ */
+Oktavia.prototype.addEndOfBlock$ = function () {
+ this._fmindex.push$S(Oktavia.eob);
+};
+
+/**
+ * @param {!string} words
+ */
+Oktavia.prototype.addWord$S = function (words) {
+ /** @type {Array.<undefined|!string>} */
+ var str;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var charCode;
+ /** @type {undefined|!string} */
+ var newCharCode;
+ str = [ ];
+ str.length = words.length;
+ for (i = 0; i < words.length; i++) {
+ charCode = words.charCodeAt(i);
+ newCharCode = this._utf162compressCode[charCode];
+ if (newCharCode == null) {
+ newCharCode = String.fromCharCode(this._compressCode2utf16.length);
+ this._utf162compressCode[charCode] = newCharCode;
+ this._compressCode2utf16.push(String.fromCharCode(charCode));
+ }
+ str.push(newCharCode);
+ }
+ this._fmindex.push$S(str.join(''));
+};
+
+/**
+ * @param {!string} words
+ * @param {!boolean} stemming
+ */
+Oktavia.prototype.addWord$SB = function (words, stemming) {
+ /** @type {Array.<undefined|!string>} */
+ var wordList;
+ /** @type {!number} */
+ var i;
+ /** @type {undefined|!string} */
+ var originalWord;
+ /** @type {!string} */
+ var smallWord;
+ /** @type {undefined|!string} */
+ var registerWord;
+ /** @type {!string} */
+ var baseWord;
+ /** @type {!string} */
+ var compressedCodeWord;
+ /** @type {Array.<undefined|!string>} */
+ var stemmedList;
+ this.addWord$S(words);
+ wordList = words.split(/\s+/);
+ for (i = 0; i < wordList.length; i++) {
+ originalWord = wordList[i];
+ smallWord = originalWord.slice(0, 1).toLowerCase() + originalWord.slice(1);
+ registerWord = null;
+ if (stemming && this._stemmer) {
+ baseWord = this._stemmer.stemWord$S(originalWord.toLowerCase());
+ if (originalWord.indexOf(baseWord) === -1) {
+ registerWord = baseWord;
+ }
+ } else {
+ if (originalWord != smallWord) {
+ registerWord = smallWord;
+ }
+ }
+ if (registerWord) {
+ compressedCodeWord = this._convertToCompressionCode$S(originalWord);
+ stemmedList = this._stemmingResult[registerWord];
+ if (! stemmedList) {
+ stemmedList = [ compressedCodeWord ];
+ this._stemmingResult[registerWord] = stemmedList;
+ } else {
+ if (stemmedList.indexOf(compressedCodeWord) === -1) {
+ stemmedList.push(compressedCodeWord);
+ }
+ }
+ }
+ }
+};
+
+/**
+ * @param {!string} keyword
+ * @return {!string}
+ */
+Oktavia.prototype._convertToCompressionCode$S = function (keyword) {
+ /** @type {Array.<undefined|!string>} */
+ var resultChars;
+ /** @type {!number} */
+ var i;
+ /** @type {undefined|!string} */
+ var chr;
+ resultChars = [ ];
+ for (i = 0; i < keyword.length; i++) {
+ chr = this._utf162compressCode[keyword.charCodeAt(i)];
+ if (chr == null) {
+ resultChars.push(Oktavia.unknown);
+ } else {
+ resultChars.push(chr);
+ }
+ }
+ return resultChars.join('');
+};
+
+/**
+ * @param {!string} keyword
+ * @param {!boolean} stemming
+ * @return {Array.<undefined|!number>}
+ */
+Oktavia.prototype.rawSearch$SB = function (keyword, stemming) {
+ /** @type {Array.<undefined|!number>} */
+ var result;
+ /** @type {!string} */
+ var baseWord;
+ /** @type {Array.<undefined|!string>} */
+ var stemmedList;
+ /** @type {!number} */
+ var i;
+ /** @type {undefined|!string} */
+ var word;
+ if (stemming) {
+ result = [ ];
+ if (this._stemmer) {
+ baseWord = this._stemmer.stemWord$S(keyword.toLowerCase());
+ stemmedList = this._stemmingResult[baseWord];
+ if (stemmedList) {
+ for (i = 0; i < stemmedList.length; i++) {
+ word = stemmedList[i];
+ result = result.concat(this._fmindex.search$S(word));
+ }
+ }
+ }
+ } else {
+ result = this._fmindex.search$S(this._convertToCompressionCode$S(keyword));
+ }
+ return result;
+};
+
+/**
+ * @param {Array.<undefined|Query>} queries
+ * @return {SearchSummary}
+ */
+Oktavia.prototype.search$ALQuery$ = function (queries) {
+ /** @type {SearchSummary} */
+ var summary;
+ /** @type {!number} */
+ var i;
+ /** @type {SingleResult} */
+ var result$0;
+ summary = ({sourceResults: [ ], result: null, oktavia: this});
+ for (i = 0; i < queries.length; i++) {
+ result$0 = this._searchQuery$LQuery$(queries[i]);
+ summary.sourceResults.push(result$0);
+ }
+ summary.result = SearchSummary$mergeResult$LSearchSummary$ALSingleResult$(summary, summary.sourceResults);
+ return summary;
+};
+
+/**
+ * @param {Query} query
+ * @return {SingleResult}
+ */
+Oktavia.prototype._searchQuery$LQuery$ = function (query) {
+ /** @type {SingleResult} */
+ var result;
+ /** @type {Array.<undefined|!number>} */
+ var positions;
+ result = new SingleResult$SBB(query.word, query.or, query.not);
+ if (query.raw) {
+ positions = this.rawSearch$SB(query.word, false);
+ } else {
+ positions = this.rawSearch$SB(query.word, false).concat(this.rawSearch$SB(query.word, true));
+ }
+ this._metadatas[this._metadataLabels[0]].grouping$LSingleResult$AISB(result, positions, query.word, ! query.raw);
+ return result;
+};
+
+/**
+ */
+Oktavia.prototype.build$ = function () {
+ this.build$IB(5, false);
+};
+
+/**
+ * @param {!number} cacheDensity
+ * @param {!boolean} verbose
+ */
+Oktavia.prototype.build$IB = function (cacheDensity, verbose) {
+ /** @type {!string} */
+ var key;
+ /** @type {!number} */
+ var cacheRange;
+ /** @type {!number} */
+ var maxChar;
+ for (key in this._metadatas) {
+ this._metadatas[key]._build$();
+ }
+ cacheRange = Math.round(Math.max(1, 100 / Math.min(100, Math.max(0.01, cacheDensity))));
+ maxChar = this._compressCode2utf16.length;
+ this._fmindex.build$SIIB(Oktavia.eof, maxChar, cacheRange, verbose);
+};
+
+/**
+ * @return {!string}
+ */
+Oktavia.prototype.dump$ = function () {
+ return this.dump$B(false);
+};
+
+/**
+ * @param {!boolean} verbose
+ * @return {!string}
+ */
+Oktavia.prototype.dump$B = function (verbose) {
+ /** @type {!string} */
+ var header;
+ /** @type {!string} */
+ var fmdata;
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var i;
+ /** @type {CompressionReport} */
+ var report;
+ /** @type {undefined|!string} */
+ var name;
+ /** @type {!string} */
+ var data;
+ header = Binary$dumpString$SLCompressionReport$("oktavia-01", null).slice(1);
+ if (verbose) {
+ console.log("Source text size: " + (this._fmindex.size$() * 2 + "") + ' bytes');
+ }
+ fmdata = this._fmindex.dump$B(verbose);
+ result = [ header, fmdata ];
+ result.push(Binary$dump16bitNumber$I(this._compressCode2utf16.length));
+ for (i = 3; i < this._compressCode2utf16.length; i++) {
+ result.push(this._compressCode2utf16[i]);
+ }
+ if (verbose) {
+ console.log('Char Code Map: ' + (this._compressCode2utf16.length * 2 - 2 + "") + ' bytes');
+ }
+ report = ({source: 0, result: 0});
+ result.push(Binary$dumpStringListMap$HASLCompressionReport$(this._stemmingResult, report));
+ if (verbose) {
+ console.log('Stemmed Word Table: ' + (result[result.length - 1].length + "") + ' bytes (' + (Math.round(report.result * 100.0 / report.source) + "") + '%)');
+ }
+ result.push(Binary$dump16bitNumber$I(this._metadataLabels.length));
+ for (i = 0; i < this._metadataLabels.length; i++) {
+ report = ({source: 0, result: 0});
+ name = this._metadataLabels[i];
+ data = this._metadatas[name]._dump$LCompressionReport$(report);
+ result.push(Binary$dumpString$SLCompressionReport$(name, report), data);
+ if (verbose) {
+ console.log('Meta Data ' + name + ': ' + (data.length * 2 + "") + ' bytes (' + (Math.round(report.result * 100.0 / report.source) + "") + '%)');
+ }
+ }
+ return result.join('');
+};
+
+/**
+ * @param {!string} data
+ */
+Oktavia.prototype.load$S = function (data) {
+ /** @type {!string} */
+ var header;
+ /** @type {!number} */
+ var offset;
+ /** @type {!number} */
+ var charCodeCount;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var charCode;
+ /** @type {LoadedStringListMapResult} */
+ var stemmedWords;
+ /** @type {!number} */
+ var metadataCount;
+ /** @type {LoadedStringResult} */
+ var nameResult;
+ /** @type {!string} */
+ var name;
+ /** @type {!number} */
+ var type;
+ header = Binary$dumpString$SLCompressionReport$("oktavia-01", null).slice(1);
+ if (data.slice(0, 5) !== header) {
+ throw new Error('Invalid data file');
+ }
+ this._metadatas = ({ });
+ this._metadataLabels = [ ];
+ offset = 5;
+ offset = this._fmindex.load$SI(data, offset);
+ charCodeCount = Binary$load16bitNumber$SI(data, offset++);
+ this._compressCode2utf16 = [ Oktavia.eof, Oktavia.eob, Oktavia.unknown ];
+ this._utf162compressCode = [ Oktavia.eof, Oktavia.eob, Oktavia.unknown ];
+ for (i = 3; i < charCodeCount; i++) {
+ charCode = Binary$load16bitNumber$SI(data, offset++);
+ this._compressCode2utf16.push(String.fromCharCode(charCode));
+ this._utf162compressCode[charCode] = String.fromCharCode(i);
+ }
+ stemmedWords = Binary$loadStringListMap$SI(data, offset);
+ this._stemmingResult = stemmedWords.result;
+ offset = stemmedWords.offset;
+ metadataCount = Binary$load16bitNumber$SI(data, offset++);
+ for (i = 0; i < metadataCount; i++) {
+ nameResult = Binary$loadString$SI(data, offset);
+ name = nameResult.result;
+ offset = nameResult.offset;
+ type = Binary$load16bitNumber$SI(data, offset++);
+ switch (type) {
+ case 0:
+ offset = Section$_load$LOktavia$SSI(this, name, data, offset);
+ break;
+ case 1:
+ offset = Splitter$_load$LOktavia$SSI(this, name, data, offset);
+ break;
+ case 2:
+ offset = Table$_load$LOktavia$SSI(this, name, data, offset);
+ break;
+ case 3:
+ offset = Block$_load$LOktavia$SSI(this, name, data, offset);
+ break;
+ }
+ }
+};
+
+/**
+ * @return {!number}
+ */
+Oktavia.prototype.contentSize$ = function () {
+ /** @type {FMIndex} */
+ var this$0;
+ this$0 = this._fmindex;
+ return this$0._substr.length;
+};
+
+/**
+ * @param {!number} position
+ * @return {!number}
+ */
+Oktavia.prototype.wordPositionType$I = function (position) {
+ /** @type {!number} */
+ var result;
+ /** @type {!string} */
+ var ahead;
+ result = 0;
+ if (position === 0) {
+ result = 4;
+ } else {
+ ahead = this._fmindex.getSubstring$II(position - 1, 1);
+ if (/\s/.test(ahead)) {
+ result = 2;
+ } else {
+ if (/\W/.test(ahead)) {
+ result = 1;
+ } else {
+ if (Oktavia.eob === ahead) {
+ result = 3;
+ }
+ }
+ }
+ }
+ return (result | 0);
+};
+
+/**
+ * @param {!number} position
+ * @param {!number} length
+ * @return {!string}
+ */
+Oktavia.prototype._getSubstring$II = function (position, length) {
+ /** @type {!string} */
+ var result;
+ /** @type {Array.<undefined|!string>} */
+ var str;
+ /** @type {!number} */
+ var i;
+ result = this._fmindex.getSubstring$II(position, length);
+ str = [ ];
+ for (i = 0; i < result.length; i++) {
+ str.push(this._compressCode2utf16[result.charCodeAt(i)]);
+ }
+ return str.join('');
+};
+
+/**
+ * class Binary extends Object
+ * @constructor
+ */
+function Binary() {
+}
+
+/**
+ * @constructor
+ */
+function Binary$() {
+};
+
+Binary$.prototype = new Binary;
+
+/**
+ * @param {!number} num
+ * @return {!string}
+ */
+Binary.dump32bitNumber$N = function (num) {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ result = [ String.fromCharCode(Math.floor(num / 65536)) ];
+ result.push(String.fromCharCode(num % 65536));
+ return result.join("");
+};
+
+var Binary$dump32bitNumber$N = Binary.dump32bitNumber$N;
+
+/**
+ * @param {!string} buffer
+ * @param {!number} offset
+ * @return {!number}
+ */
+Binary.load32bitNumber$SI = function (buffer, offset) {
+ /** @type {!number} */
+ var result;
+ result = buffer.charCodeAt(offset) * 65536 + buffer.charCodeAt(offset + 1);
+ return result;
+};
+
+var Binary$load32bitNumber$SI = Binary.load32bitNumber$SI;
+
+/**
+ * @param {!number} num
+ * @return {!string}
+ */
+Binary.dump16bitNumber$I = function (num) {
+ return String.fromCharCode(num % 65536);
+};
+
+var Binary$dump16bitNumber$I = Binary.dump16bitNumber$I;
+
+/**
+ * @param {!string} buffer
+ * @param {!number} offset
+ * @return {!number}
+ */
+Binary.load16bitNumber$SI = function (buffer, offset) {
+ return (buffer.charCodeAt(offset) | 0);
+};
+
+var Binary$load16bitNumber$SI = Binary.load16bitNumber$SI;
+
+/**
+ * @param {!string} str
+ * @return {!string}
+ */
+Binary.dumpString$S = function (str) {
+ return Binary$dumpString$SLCompressionReport$(str, null);
+};
+
+var Binary$dumpString$S = Binary.dumpString$S;
+
+/**
+ * @param {!string} str
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+Binary.dumpString$SLCompressionReport$ = function (str, report) {
+ /** @type {!number} */
+ var length;
+ /** @type {!boolean} */
+ var compress;
+ /** @type {Array.<undefined|!number>} */
+ var charCodes;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var charCode;
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {undefined|!number} */
+ var bytes;
+ if (str.length > 32768) {
+ str = str.slice(0, 32768);
+ }
+ length = str.length;
+ compress = true;
+ charCodes = [ ];
+ for (i = 0; i < length; i++) {
+ charCode = str.charCodeAt(i);
+ if (charCode > 255) {
+ compress = false;
+ break;
+ }
+ charCodes.push(charCode);
+ }
+ if (compress) {
+ result = [ Binary$dump16bitNumber$I(length + 32768) ];
+ for (i = 0; i < length; i += 2) {
+ bytes = charCodes[i];
+ if (i !== length - 1) {
+ bytes += charCodes[i + 1] << 8;
+ }
+ result.push(String.fromCharCode(bytes % 65536));
+ }
+ if (report) {
+ CompressionReport$add$LCompressionReport$II(report, length, Math.ceil(length / 2));
+ }
+ } else {
+ result = [ Binary$dump16bitNumber$I(length), str ];
+ if (report) {
+ CompressionReport$add$LCompressionReport$II(report, length, length);
+ }
+ }
+ return result.join('');
+};
+
+var Binary$dumpString$SLCompressionReport$ = Binary.dumpString$SLCompressionReport$;
+
+/**
+ * @param {!string} buffer
+ * @param {!number} offset
+ * @return {LoadedStringResult}
+ */
+Binary.loadString$SI = function (buffer, offset) {
+ return new LoadedStringResult$SI(buffer, offset);
+};
+
+var Binary$loadString$SI = Binary.loadString$SI;
+
+/**
+ * @param {Array.<undefined|!string>} strList
+ * @return {!string}
+ */
+Binary.dumpStringList$AS = function (strList) {
+ return Binary$dumpStringList$ASLCompressionReport$(strList, null);
+};
+
+var Binary$dumpStringList$AS = Binary.dumpStringList$AS;
+
+/**
+ * @param {Array.<undefined|!string>} strList
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+Binary.dumpStringList$ASLCompressionReport$ = function (strList, report) {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var i;
+ result = [ Binary$dump32bitNumber$N(strList.length) ];
+ for (i = 0; i < strList.length; i++) {
+ result.push(Binary$dumpString$SLCompressionReport$(strList[i], report));
+ }
+ return result.join('');
+};
+
+var Binary$dumpStringList$ASLCompressionReport$ = Binary.dumpStringList$ASLCompressionReport$;
+
+/**
+ * @param {!string} buffer
+ * @param {!number} offset
+ * @return {LoadedStringListResult}
+ */
+Binary.loadStringList$SI = function (buffer, offset) {
+ return new LoadedStringListResult$SI(buffer, offset);
+};
+
+var Binary$loadStringList$SI = Binary.loadStringList$SI;
+
+/**
+ * @param {Object.<string, undefined|Array.<undefined|!string>>} strMap
+ * @return {!string}
+ */
+Binary.dumpStringListMap$HAS = function (strMap) {
+ return Binary$dumpStringListMap$HASLCompressionReport$(strMap, null);
+};
+
+var Binary$dumpStringListMap$HAS = Binary.dumpStringListMap$HAS;
+
+/**
+ * @param {Object.<string, undefined|Array.<undefined|!string>>} strMap
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+Binary.dumpStringListMap$HASLCompressionReport$ = function (strMap, report) {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var counter;
+ /** @type {!string} */
+ var key;
+ result = [ ];
+ counter = 0;
+ for (key in strMap) {
+ result.push(Binary$dumpString$SLCompressionReport$(key, report));
+ result.push(Binary$dumpStringList$ASLCompressionReport$(strMap[key], report));
+ counter++;
+ }
+ return Binary$dump32bitNumber$N(counter) + result.join('');
+};
+
+var Binary$dumpStringListMap$HASLCompressionReport$ = Binary.dumpStringListMap$HASLCompressionReport$;
+
+/**
+ * @param {!string} buffer
+ * @param {!number} offset
+ * @return {LoadedStringListMapResult}
+ */
+Binary.loadStringListMap$SI = function (buffer, offset) {
+ return new LoadedStringListMapResult$SI(buffer, offset);
+};
+
+var Binary$loadStringListMap$SI = Binary.loadStringListMap$SI;
+
+/**
+ * @param {Array.<undefined|!number>} array
+ * @return {!string}
+ */
+Binary.dump32bitNumberList$AN = function (array) {
+ return Binary$dump32bitNumberList$ANLCompressionReport$(array, null);
+};
+
+var Binary$dump32bitNumberList$AN = Binary.dump32bitNumberList$AN;
+
+/**
+ * @param {Array.<undefined|!number>} array
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+Binary.dump32bitNumberList$ANLCompressionReport$ = function (array, report) {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var index;
+ /** @type {!number} */
+ var inputLength;
+ /** @type {!number} */
+ var length;
+ /** @type {!string} */
+ var resultString;
+ /** @type {!number} */
+ var value1$0;
+ /** @type {!number} */
+ var value2$0;
+ result = [ Binary$dump32bitNumber$N(array.length) ];
+ index = 0;
+ inputLength = array.length;
+ while (index < inputLength) {
+ if (array[index] == 0) {
+ length = Binary$_countZero$ANI(array, index);
+ result.push(Binary$_zeroBlock$I(length));
+ index += length;
+ } else {
+ if (Binary$_shouldZebraCode$ANI(array, index)) {
+ result.push(Binary$_createZebraCode$ANI(array, index));
+ value1$0 = array.length;
+ value2$0 = index + 15;
+ index = (value1$0 <= value2$0 ? value1$0 : value2$0);
+ } else {
+ length = Binary$_searchDoubleZero$ANI(array, index);
+ result.push(Binary$_nonZeroBlock$ANII(array, index, length));
+ if (length === 0) {
+ throw new Error('');
+ }
+ index += length;
+ }
+ }
+ }
+ resultString = result.join('');
+ if (report) {
+ CompressionReport$add$LCompressionReport$II(report, array.length * 2 + 2, resultString.length);
+ }
+ return resultString;
+};
+
+var Binary$dump32bitNumberList$ANLCompressionReport$ = Binary.dump32bitNumberList$ANLCompressionReport$;
+
+/**
+ * @param {!string} buffer
+ * @param {!number} offset
+ * @return {LoadedNumberListResult}
+ */
+Binary.load32bitNumberList$SI = function (buffer, offset) {
+ return new LoadedNumberListResult$SI(buffer, offset);
+};
+
+var Binary$load32bitNumberList$SI = Binary.load32bitNumberList$SI;
+
+/**
+ * @param {Array.<undefined|!number>} array
+ * @param {!number} offset
+ * @return {!number}
+ */
+Binary._countZero$ANI = function (array, offset) {
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var array$len$0;
+ for ((i = offset, array$len$0 = array.length); i < array$len$0; i++) {
+ if (array[i] != 0) {
+ return (i - offset | 0);
+ }
+ }
+ return (array.length - offset | 0);
+};
+
+var Binary$_countZero$ANI = Binary._countZero$ANI;
+
+/**
+ * @param {!number} length
+ * @return {!string}
+ */
+Binary._zeroBlock$I = function (length) {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ result = [ ];
+ while (length > 0) {
+ if (length > 16384) {
+ result.push(Binary$dump16bitNumber$I(16383));
+ length -= 16384;
+ } else {
+ result.push(Binary$dump16bitNumber$I(length - 1));
+ length = 0;
+ }
+ }
+ return result.join('');
+};
+
+var Binary$_zeroBlock$I = Binary._zeroBlock$I;
+
+/**
+ * @param {Array.<undefined|!number>} array
+ * @param {!number} offset
+ * @return {!boolean}
+ */
+Binary._shouldZebraCode$ANI = function (array, offset) {
+ /** @type {!number} */
+ var change;
+ /** @type {!boolean} */
+ var isLastZero;
+ /** @type {!number} */
+ var i;
+ if (array.length - offset < 16) {
+ return true;
+ }
+ change = 0;
+ isLastZero = false;
+ for (i = offset; i < offset + 15; i++) {
+ if (array[i] == 0) {
+ if (! isLastZero) {
+ isLastZero = true;
+ change++;
+ }
+ } else {
+ if (isLastZero) {
+ isLastZero = false;
+ change++;
+ }
+ }
+ }
+ return change > 2;
+};
+
+var Binary$_shouldZebraCode$ANI = Binary._shouldZebraCode$ANI;
+
+/**
+ * @param {Array.<undefined|!number>} array
+ * @param {!number} offset
+ * @return {!number}
+ */
+Binary._searchDoubleZero$ANI = function (array, offset) {
+ /** @type {!boolean} */
+ var isLastZero;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var array$len$0;
+ isLastZero = false;
+ for ((i = offset, array$len$0 = array.length); i < array$len$0; i++) {
+ if (array[i] == 0) {
+ if (isLastZero) {
+ return (i - offset - 1 | 0);
+ }
+ isLastZero = true;
+ } else {
+ isLastZero = false;
+ }
+ }
+ return (array.length - offset | 0);
+};
+
+var Binary$_searchDoubleZero$ANI = Binary._searchDoubleZero$ANI;
+
+/**
+ * @param {Array.<undefined|!number>} array
+ * @param {!number} offset
+ * @param {!number} length
+ * @return {!string}
+ */
+Binary._nonZeroBlock$ANII = function (array, offset, length) {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var blockLength;
+ /** @type {!number} */
+ var i;
+ result = [ ];
+ while (length > 0) {
+ if (length > 16384) {
+ blockLength = 16384;
+ length -= 16384;
+ } else {
+ blockLength = length;
+ length = 0;
+ }
+ result.push(Binary$dump16bitNumber$I(blockLength - 1 + 0x4000));
+ for (i = offset; i < offset + blockLength; i++) {
+ result.push(Binary$dump32bitNumber$N(array[i]));
+ }
+ offset += blockLength;
+ }
+ return result.join('');
+};
+
+var Binary$_nonZeroBlock$ANII = Binary._nonZeroBlock$ANII;
+
+/**
+ * @param {Array.<undefined|!number>} array
+ * @param {!number} offset
+ * @return {!string}
+ */
+Binary._createZebraCode$ANI = function (array, offset) {
+ /** @type {!number} */
+ var last;
+ /** @type {!number} */
+ var code;
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var value1$0;
+ /** @type {!number} */
+ var value2$0;
+ value1$0 = offset + 15;
+ value2$0 = array.length;
+ last = (value1$0 <= value2$0 ? value1$0 : value2$0);
+ code = 0x8000;
+ result = [ ];
+ for (i = offset; i < last; i++) {
+ if (array[i] != 0) {
+ result.push(Binary$dump32bitNumber$N(array[i]));
+ code = code + (0x1 << i - offset);
+ }
+ }
+ return String.fromCharCode(code) + result.join('');
+};
+
+var Binary$_createZebraCode$ANI = Binary._createZebraCode$ANI;
+
+/**
+ * @param {!string} str
+ * @return {!string}
+ */
+Binary.base64encode$S = function (str) {
+ /** @type {Array.<undefined|!string>} */
+ var out;
+ /** @type {Array.<undefined|!number>} */
+ var source;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var code;
+ /** @type {!number} */
+ var len;
+ /** @type {!number} */
+ var c1;
+ /** @type {undefined|!number} */
+ var c2;
+ /** @type {undefined|!number} */
+ var c3;
+ out = [ ];
+ source = [ ];
+ for (i = 0; i < str.length; i++) {
+ code = str.charCodeAt(i);
+ source.push(code & 0x00ff, code >>> 8);
+ }
+ len = str.length * 2;
+ i = 0;
+ while (i < len) {
+ c1 = source[i++] & 0xff;
+ if (i === len) {
+ out.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(c1 >> 2));
+ out.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((c1 & 0x3) << 4));
+ out.push("==");
+ break;
+ }
+ c2 = source[i++];
+ if (i === len) {
+ out.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(c1 >> 2));
+ out.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((c1 & 0x3) << 4 | (c2 & 0xF0) >> 4));
+ out.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((c2 & 0xF) << 2));
+ out.push("=");
+ break;
+ }
+ c3 = source[i++];
+ out.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(c1 >> 2));
+ out.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((c1 & 0x3) << 4 | (c2 & 0xF0) >> 4));
+ out.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((c2 & 0xF) << 2 | (c3 & 0xC0) >> 6));
+ out.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(c3 & 0x3F));
+ }
+ return out.join('');
+};
+
+var Binary$base64encode$S = Binary.base64encode$S;
+
+/**
+ * @param {Array.<undefined|!number>} source
+ * @return {!string}
+ */
+Binary._mergeCharCode$AI = function (source) {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var i;
+ result = [ ];
+ for (i = 0; i < source.length; i += 2) {
+ result.push(String.fromCharCode(source[i] + (source[i + 1] << 8)));
+ }
+ return result.join('');
+};
+
+var Binary$_mergeCharCode$AI = Binary._mergeCharCode$AI;
+
+/**
+ * @param {!string} str
+ * @return {!string}
+ */
+Binary.base64decode$S = function (str) {
+ /** @type {!number} */
+ var len;
+ /** @type {!number} */
+ var i;
+ /** @type {Array.<undefined|!number>} */
+ var out;
+ /** @type {undefined|!number} */
+ var c1;
+ /** @type {undefined|!number} */
+ var c2;
+ /** @type {!number} */
+ var c3;
+ /** @type {!number} */
+ var c4;
+ len = str.length;
+ i = 0;
+ out = [ ];
+ while (i < len) {
+ do {
+ c1 = Binary._base64DecodeChars[str.charCodeAt(i++) & 0xff];
+ } while (i < len && c1 == -1);
+ if (c1 == -1) {
+ break;
+ }
+ do {
+ c2 = Binary._base64DecodeChars[str.charCodeAt(i++) & 0xff];
+ } while (i < len && c2 == -1);
+ if (c2 == -1) {
+ break;
+ }
+ out.push(c1 << 2 | (c2 & 0x30) >> 4);
+ do {
+ c3 = str.charCodeAt(i++) & 0xff;
+ if (c3 === 61) {
+ return Binary$_mergeCharCode$AI(out);
+ }
+ c3 = Binary._base64DecodeChars[c3];
+ } while (i < len && c3 === -1);
+ if (c3 === -1) {
+ break;
+ }
+ out.push((c2 & 0XF) << 4 | (c3 & 0x3C) >> 2);
+ do {
+ c4 = str.charCodeAt(i++) & 0xff;
+ if (c4 === 61) {
+ return Binary$_mergeCharCode$AI(out);
+ }
+ c4 = (Binary._base64DecodeChars[c4] | 0);
+ } while (i < len && c4 === -1);
+ if (c4 === -1) {
+ break;
+ }
+ out.push((c3 & 0x03) << 6 | c4);
+ }
+ return Binary$_mergeCharCode$AI(out);
+};
+
+var Binary$base64decode$S = Binary.base64decode$S;
+
+/**
+ * class LoadedStringResult extends Object
+ * @constructor
+ */
+function LoadedStringResult() {
+}
+
+/**
+ * @constructor
+ * @param {!string} data
+ * @param {!number} offset
+ */
+function LoadedStringResult$SI(data, offset) {
+ /** @type {!number} */
+ var strLength;
+ /** @type {Array.<undefined|!string>} */
+ var bytes;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var code;
+ /** @type {!number} */
+ var offset$0;
+ this.result = "";
+ this.offset = 0;
+ offset$0 = offset++;
+ strLength = data.charCodeAt(offset$0);
+ if (strLength > 32767) {
+ strLength = strLength - 32768;
+ bytes = [ ];
+ for (i = 0; i < strLength; i += 2) {
+ code = data.charCodeAt(offset);
+ bytes.push(String.fromCharCode(code & 0x00ff));
+ if (i !== strLength - 1) {
+ bytes.push(String.fromCharCode(code >>> 8));
+ }
+ offset++;
+ }
+ this.result = bytes.join('');
+ this.offset = offset;
+ } else {
+ this.result = data.slice(offset, offset + strLength);
+ this.offset = (offset + strLength | 0);
+ }
+};
+
+LoadedStringResult$SI.prototype = new LoadedStringResult;
+
+/**
+ * class LoadedStringListResult extends Object
+ * @constructor
+ */
+function LoadedStringListResult() {
+}
+
+/**
+ * @constructor
+ * @param {!string} data
+ * @param {!number} offset
+ */
+function LoadedStringListResult$SI(data, offset) {
+ /** @type {!number} */
+ var length;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var strLength;
+ /** @type {!string} */
+ var resultStr;
+ /** @type {Array.<undefined|!string>} */
+ var bytes;
+ /** @type {!number} */
+ var j;
+ /** @type {!number} */
+ var code;
+ /** @type {!number} */
+ var result$0;
+ /** @type {!number} */
+ var offset$0;
+ this.offset = 0;
+ this.result = [ ];
+ result$0 = data.charCodeAt(offset) * 65536 + data.charCodeAt(offset + 1);
+ length = result$0;
+ offset += 2;
+ for (i = 0; i < length; i++) {
+ offset$0 = offset++;
+ strLength = data.charCodeAt(offset$0);
+ if (strLength > 32767) {
+ strLength = strLength - 32768;
+ bytes = [ ];
+ for (j = 0; j < strLength; j += 2) {
+ code = data.charCodeAt(offset);
+ bytes.push(String.fromCharCode(code & 0x00ff));
+ if (j !== strLength - 1) {
+ bytes.push(String.fromCharCode(code >>> 8));
+ }
+ offset++;
+ }
+ resultStr = bytes.join('');
+ } else {
+ resultStr = data.slice(offset, offset + strLength);
+ offset = (offset + strLength | 0);
+ }
+ this.result.push(resultStr);
+ }
+ this.offset = offset;
+};
+
+LoadedStringListResult$SI.prototype = new LoadedStringListResult;
+
+/**
+ * class LoadedStringListMapResult extends Object
+ * @constructor
+ */
+function LoadedStringListMapResult() {
+}
+
+/**
+ * @constructor
+ * @param {!string} data
+ * @param {!number} offset
+ */
+function LoadedStringListMapResult$SI(data, offset) {
+ /** @type {!number} */
+ var length;
+ /** @type {!number} */
+ var i;
+ /** @type {LoadedStringResult} */
+ var keyResult;
+ /** @type {LoadedStringListResult} */
+ var valueResult;
+ /** @type {!number} */
+ var result$0;
+ /** @type {!number} */
+ var offset$0;
+ this.offset = 0;
+ this.result = ({ });
+ result$0 = data.charCodeAt(offset) * 65536 + data.charCodeAt(offset + 1);
+ length = result$0;
+ offset += 2;
+ for (i = 0; i < length; i++) {
+ keyResult = new LoadedStringResult$SI(data, offset);
+ offset$0 = keyResult.offset;
+ valueResult = new LoadedStringListResult$SI(data, offset$0);
+ this.result[keyResult.result] = valueResult.result;
+ offset = valueResult.offset;
+ }
+ this.offset = offset;
+};
+
+LoadedStringListMapResult$SI.prototype = new LoadedStringListMapResult;
+
+/**
+ * class LoadedNumberListResult extends Object
+ * @constructor
+ */
+function LoadedNumberListResult() {
+}
+
+/**
+ * @constructor
+ * @param {!string} data
+ * @param {!number} offset
+ */
+function LoadedNumberListResult$SI(data, offset) {
+ /** @type {!number} */
+ var resultLength;
+ /** @type {!number} */
+ var originalOffset;
+ /** @type {Array.<undefined|!number>} */
+ var result;
+ /** @type {!number} */
+ var tag;
+ /** @type {!number} */
+ var length;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var result$0;
+ /** @type {!number} */
+ var value1$0;
+ this.result = null;
+ this.offset = 0;
+ result$0 = data.charCodeAt(offset) * 65536 + data.charCodeAt(offset + 1);
+ resultLength = result$0;
+ originalOffset = offset;
+ offset += 2;
+ result = [ ];
+ while (result.length < resultLength) {
+ tag = data.charCodeAt(offset++);
+ if (tag >>> 15 === 1) {
+ value1$0 = resultLength - result.length;
+ length = (value1$0 <= 15 ? value1$0 : 15);
+ for (i = 0; i < length; i++) {
+ if (tag >>> i & 0x1) {
+ result.push(Binary$load32bitNumber$SI(data, offset));
+ offset += 2;
+ } else {
+ result.push(0);
+ }
+ }
+ } else {
+ if (tag >>> 14 === 1) {
+ length = tag - 0x4000 + 1;
+ for (i = 0; i < length; i++) {
+ result.push(Binary$load32bitNumber$SI(data, offset));
+ offset += 2;
+ }
+ } else {
+ length = tag + 1;
+ for (i = 0; i < length; i++) {
+ result.push(0);
+ }
+ }
+ }
+ }
+ this.result = result;
+ this.offset = offset;
+};
+
+LoadedNumberListResult$SI.prototype = new LoadedNumberListResult;
+
+/**
+ * class CompressionReport extends Object
+ * @constructor
+ */
+function CompressionReport() {
+}
+
+/**
+ * @constructor
+ */
+function CompressionReport$() {
+ this.source = 0;
+ this.result = 0;
+};
+
+CompressionReport$.prototype = new CompressionReport;
+
+/**
+ * @param {CompressionReport} $this
+ * @param {!number} source
+ * @param {!number} result
+ */
+CompressionReport.add$LCompressionReport$II = function ($this, source, result) {
+ $this.source += source;
+ $this.result += result;
+};
+
+var CompressionReport$add$LCompressionReport$II = CompressionReport.add$LCompressionReport$II;
+
+/**
+ * @param {CompressionReport} $this
+ * @return {!number}
+ */
+CompressionReport.rate$LCompressionReport$ = function ($this) {
+ return (Math.round($this.result * 100.0 / $this.source) | 0);
+};
+
+var CompressionReport$rate$LCompressionReport$ = CompressionReport.rate$LCompressionReport$;
+
+/**
+ * class Query extends Object
+ * @constructor
+ */
+function Query() {
+}
+
+/**
+ * @constructor
+ */
+function Query$() {
+ this.word = '';
+ this.or = false;
+ this.not = false;
+ this.raw = false;
+};
+
+Query$.prototype = new Query;
+
+/**
+ * @return {!string}
+ */
+Query.prototype.toString = function () {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ result = [ ];
+ if (this.or) {
+ result.push("OR ");
+ }
+ if (this.not) {
+ result.push("-");
+ }
+ if (this.raw) {
+ result.push('"', this.word, '"');
+ } else {
+ result.push(this.word);
+ }
+ return result.join('');
+};
+
+/**
+ * class QueryStringParser extends Object
+ * @constructor
+ */
+function QueryStringParser() {
+}
+
+/**
+ * @constructor
+ */
+function QueryStringParser$() {
+ this.queries = [ ];
+};
+
+QueryStringParser$.prototype = new QueryStringParser;
+
+/**
+ * @param {QueryStringParser} $this
+ * @param {!string} queryString
+ * @return {Array.<undefined|Query>}
+ */
+QueryStringParser.parse$LQueryStringParser$S = function ($this, queryString) {
+ /** @type {!boolean} */
+ var nextOr;
+ /** @type {!boolean} */
+ var nextNot;
+ /** @type {!number} */
+ var currentWordStart;
+ /** @type {!number} */
+ var status;
+ /** @type {RegExp} */
+ var isSpace;
+ /** @type {!number} */
+ var i;
+ /** @type {!string} */
+ var ch;
+ /** @type {!string} */
+ var word;
+ /** @type {Query} */
+ var query;
+ nextOr = false;
+ nextNot = false;
+ currentWordStart = 0;
+ status = 0;
+ isSpace = /[\s\u3000]/;
+ for (i = 0; i < queryString.length; i++) {
+ ch = queryString.charAt(i);
+ switch (status) {
+ case 0:
+ if (! isSpace.test(ch)) {
+ if (ch === '-') {
+ nextNot = true;
+ } else {
+ if (ch === '"') {
+ currentWordStart = i + 1;
+ status = 2;
+ } else {
+ currentWordStart = i;
+ status = 1;
+ }
+ }
+ } else {
+ nextNot = false;
+ }
+ break;
+ case 1:
+ if (isSpace.test(ch)) {
+ word = queryString.slice(currentWordStart, i);
+ if (word === 'OR') {
+ nextOr = true;
+ } else {
+ query = new Query$();
+ query.word = word;
+ query.or = nextOr;
+ query.not = nextNot;
+ $this.queries.push(query);
+ nextOr = false;
+ nextNot = false;
+ }
+ status = 0;
+ }
+ break;
+ case 2:
+ if (ch === '"') {
+ word = queryString.slice(currentWordStart, i);
+ query = new Query$();
+ query.word = word;
+ query.or = nextOr;
+ query.not = nextNot;
+ query.raw = true;
+ $this.queries.push(query);
+ nextOr = false;
+ nextNot = false;
+ status = 0;
+ }
+ break;
+ }
+ }
+ switch (status) {
+ case 0:
+ break;
+ case 1:
+ query = new Query$();
+ word = queryString.slice(currentWordStart, queryString.length);
+ if (word !== 'OR') {
+ query.word = word;
+ query.or = nextOr;
+ query.not = nextNot;
+ $this.queries.push(query);
+ }
+ break;
+ case 2:
+ query = new Query$();
+ query.word = queryString.slice(currentWordStart, queryString.length);
+ query.or = nextOr;
+ query.not = nextNot;
+ query.raw = true;
+ $this.queries.push(query);
+ break;
+ }
+ return $this.queries;
+};
+
+var QueryStringParser$parse$LQueryStringParser$S = QueryStringParser.parse$LQueryStringParser$S;
+
+/**
+ * @param {QueryStringParser} $this
+ * @return {!string}
+ */
+QueryStringParser.highlight$LQueryStringParser$ = function ($this) {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var i;
+ /** @type {Query} */
+ var query;
+ result = [ ];
+ for (i = 0; i < $this.queries.length; i++) {
+ query = $this.queries[i];
+ if (! query.not) {
+ result.push("highlight=" + $__jsx_encodeURIComponent(query.word));
+ }
+ }
+ return '?' + result.join('&');
+};
+
+var QueryStringParser$highlight$LQueryStringParser$ = QueryStringParser.highlight$LQueryStringParser$;
+
+/**
+ * class Proposal extends Object
+ * @constructor
+ */
+function Proposal() {
+}
+
+/**
+ * @constructor
+ * @param {!number} omit
+ * @param {!number} expect
+ */
+function Proposal$II(omit, expect) {
+ this.omit = omit;
+ this.expect = expect;
+};
+
+Proposal$II.prototype = new Proposal;
+
+/**
+ * class Position extends Object
+ * @constructor
+ */
+function Position() {
+}
+
+/**
+ * @constructor
+ * @param {!string} word
+ * @param {!number} position
+ * @param {!boolean} stemmed
+ */
+function Position$SIB(word, position, stemmed) {
+ this.word = word;
+ this.position = position;
+ this.stemmed = stemmed;
+};
+
+Position$SIB.prototype = new Position;
+
+/**
+ * class SearchUnit extends Object
+ * @constructor
+ */
+function SearchUnit() {
+}
+
+/**
+ * @constructor
+ * @param {!number} id
+ */
+function SearchUnit$I(id) {
+ this.positions = ({ });
+ this.id = id;
+ this._size = 0;
+ this.score = 0;
+ this.startPosition = -1;
+};
+
+SearchUnit$I.prototype = new SearchUnit;
+
+/**
+ * @param {SearchUnit} $this
+ * @param {!string} word
+ * @param {!number} position
+ * @param {!boolean} stemmed
+ */
+SearchUnit.addPosition$LSearchUnit$SIB = function ($this, word, position, stemmed) {
+ /** @type {Position} */
+ var positionObj;
+ positionObj = $this.positions[position + ""];
+ if (! positionObj) {
+ $this._size++;
+ $this.positions[position + ""] = ({word: word, position: position, stemmed: stemmed});
+ } else {
+ if (positionObj.word.length < word.length) {
+ positionObj.word = word;
+ }
+ positionObj.stemmed = positionObj.stemmed && stemmed;
+ }
+};
+
+var SearchUnit$addPosition$LSearchUnit$SIB = SearchUnit.addPosition$LSearchUnit$SIB;
+
+/**
+ * @param {SearchUnit} $this
+ * @param {!number} position
+ * @return {Position}
+ */
+SearchUnit.get$LSearchUnit$I = function ($this, position) {
+ return $this.positions[position + ""];
+};
+
+var SearchUnit$get$LSearchUnit$I = SearchUnit.get$LSearchUnit$I;
+
+/**
+ * @param {SearchUnit} $this
+ * @return {!number}
+ */
+SearchUnit.size$LSearchUnit$ = function ($this) {
+ return $this._size;
+};
+
+var SearchUnit$size$LSearchUnit$ = SearchUnit.size$LSearchUnit$;
+
+/**
+ * @param {SearchUnit} $this
+ * @param {SearchUnit} rhs
+ */
+SearchUnit.merge$LSearchUnit$LSearchUnit$ = function ($this, rhs) {
+ /** @type {!string} */
+ var position;
+ /** @type {Position} */
+ var pos;
+ for (position in rhs.positions) {
+ pos = rhs.positions[position];
+ SearchUnit$addPosition$LSearchUnit$SIB($this, pos.word, pos.position, pos.stemmed);
+ }
+};
+
+var SearchUnit$merge$LSearchUnit$LSearchUnit$ = SearchUnit.merge$LSearchUnit$LSearchUnit$;
+
+/**
+ * @param {SearchUnit} $this
+ * @return {Array.<undefined|Position>}
+ */
+SearchUnit.getPositions$LSearchUnit$ = function ($this) {
+ /** @type {Array.<undefined|Position>} */
+ var result;
+ /** @type {!string} */
+ var pos;
+ result = [ ];
+ for (pos in $this.positions) {
+ result.push($this.positions[pos]);
+ }
+ result.sort((function (a, b) {
+ return a.position - b.position;
+ }));
+ return result;
+};
+
+var SearchUnit$getPositions$LSearchUnit$ = SearchUnit.getPositions$LSearchUnit$;
+
+/**
+ * class SingleResult extends Object
+ * @constructor
+ */
+function SingleResult() {
+}
+
+/**
+ * @constructor
+ */
+function SingleResult$() {
+ this.units = [ ];
+ this.unitIds = [ ];
+ this.or = false;
+ this.not = false;
+ this.searchWord = '';
+};
+
+SingleResult$.prototype = new SingleResult;
+
+/**
+ * @constructor
+ * @param {!string} searchWord
+ * @param {!boolean} or
+ * @param {!boolean} not
+ */
+function SingleResult$SBB(searchWord, or, not) {
+ this.units = [ ];
+ this.unitIds = [ ];
+ this.or = or;
+ this.not = not;
+ this.searchWord = searchWord;
+};
+
+SingleResult$SBB.prototype = new SingleResult;
+
+/**
+ * @param {SingleResult} $this
+ * @param {!number} unitId
+ * @return {SearchUnit}
+ */
+SingleResult.getSearchUnit$LSingleResult$I = function ($this, unitId) {
+ /** @type {!number} */
+ var existing;
+ /** @type {SearchUnit} */
+ var result;
+ existing = $this.unitIds.indexOf(unitId);
+ if (existing === -1) {
+ result = ({positions: ({ }), id: unitId, _size: 0, score: 0, startPosition: -1});
+ $this.units.push(result);
+ $this.unitIds.push(unitId);
+ } else {
+ result = $this.units[existing];
+ }
+ return result;
+};
+
+var SingleResult$getSearchUnit$LSingleResult$I = SingleResult.getSearchUnit$LSingleResult$I;
+
+/**
+ * @param {SingleResult} $this
+ * @param {SingleResult} rhs
+ * @return {SingleResult}
+ */
+SingleResult.merge$LSingleResult$LSingleResult$ = function ($this, rhs) {
+ /** @type {SingleResult} */
+ var result;
+ result = ({units: [ ], unitIds: [ ], or: false, not: false, searchWord: ''});
+ if (rhs.or) {
+ SingleResult$_orMerge$LSingleResult$LSingleResult$LSingleResult$($this, result, rhs);
+ } else {
+ if (rhs.not) {
+ SingleResult$_notMerge$LSingleResult$LSingleResult$LSingleResult$($this, result, rhs);
+ } else {
+ SingleResult$_andMerge$LSingleResult$LSingleResult$LSingleResult$($this, result, rhs);
+ }
+ }
+ return result;
+};
+
+var SingleResult$merge$LSingleResult$LSingleResult$ = SingleResult.merge$LSingleResult$LSingleResult$;
+
+/**
+ * @param {SingleResult} $this
+ * @return {!number}
+ */
+SingleResult.size$LSingleResult$ = function ($this) {
+ return ($this.units.length | 0);
+};
+
+var SingleResult$size$LSingleResult$ = SingleResult.size$LSingleResult$;
+
+/**
+ * @param {SingleResult} $this
+ * @param {SingleResult} result
+ * @param {SingleResult} rhs
+ */
+SingleResult._andMerge$LSingleResult$LSingleResult$LSingleResult$ = function ($this, result, rhs) {
+ /** @type {!number} */
+ var i;
+ /** @type {undefined|!number} */
+ var id;
+ /** @type {SearchUnit} */
+ var lhsSection;
+ for (i = 0; i < $this.unitIds.length; i++) {
+ id = $this.unitIds[i];
+ if (rhs.unitIds.indexOf(id) !== -1) {
+ lhsSection = $this.units[i];
+ result.unitIds.push(id);
+ result.units.push(lhsSection);
+ }
+ }
+};
+
+var SingleResult$_andMerge$LSingleResult$LSingleResult$LSingleResult$ = SingleResult._andMerge$LSingleResult$LSingleResult$LSingleResult$;
+
+/**
+ * @param {SingleResult} $this
+ * @param {SingleResult} result
+ * @param {SingleResult} rhs
+ */
+SingleResult._orMerge$LSingleResult$LSingleResult$LSingleResult$ = function ($this, result, rhs) {
+ /** @type {!number} */
+ var i;
+ /** @type {undefined|!number} */
+ var id;
+ /** @type {SearchUnit} */
+ var rhsSection;
+ /** @type {SearchUnit} */
+ var lhsSection;
+ /** @type {Array.<undefined|!number>} */
+ var unitIds$0;
+ /** @type {Array.<undefined|SearchUnit>} */
+ var units$0;
+ result.unitIds = (unitIds$0 = $this.unitIds).slice(0, unitIds$0.length);
+ result.units = (units$0 = $this.units).slice(0, units$0.length);
+ for (i = 0; i < rhs.unitIds.length; i++) {
+ id = rhs.unitIds[i];
+ rhsSection = rhs.units[i];
+ if (result.unitIds.indexOf(id) !== -1) {
+ lhsSection = result.units[result.unitIds.indexOf(id)];
+ SearchUnit$merge$LSearchUnit$LSearchUnit$(lhsSection, rhsSection);
+ } else {
+ result.unitIds.push(id);
+ result.units.push(rhsSection);
+ }
+ }
+};
+
+var SingleResult$_orMerge$LSingleResult$LSingleResult$LSingleResult$ = SingleResult._orMerge$LSingleResult$LSingleResult$LSingleResult$;
+
+/**
+ * @param {SingleResult} $this
+ * @param {SingleResult} result
+ * @param {SingleResult} rhs
+ */
+SingleResult._notMerge$LSingleResult$LSingleResult$LSingleResult$ = function ($this, result, rhs) {
+ /** @type {!number} */
+ var i;
+ /** @type {undefined|!number} */
+ var id;
+ /** @type {SearchUnit} */
+ var lhsSection;
+ for (i = 0; i < $this.unitIds.length; i++) {
+ id = $this.unitIds[i];
+ if (rhs.unitIds.indexOf(id) === -1) {
+ lhsSection = $this.units[i];
+ result.unitIds.push(id);
+ result.units.push(lhsSection);
+ }
+ }
+};
+
+var SingleResult$_notMerge$LSingleResult$LSingleResult$LSingleResult$ = SingleResult._notMerge$LSingleResult$LSingleResult$LSingleResult$;
+
+/**
+ * class SearchSummary extends Object
+ * @constructor
+ */
+function SearchSummary() {
+}
+
+/**
+ * @constructor
+ */
+function SearchSummary$() {
+ this.sourceResults = [ ];
+ this.result = null;
+ this.oktavia = null;
+};
+
+SearchSummary$.prototype = new SearchSummary;
+
+/**
+ * @constructor
+ * @param {Oktavia} oktavia
+ */
+function SearchSummary$LOktavia$(oktavia) {
+ this.sourceResults = [ ];
+ this.result = null;
+ this.oktavia = oktavia;
+};
+
+SearchSummary$LOktavia$.prototype = new SearchSummary;
+
+/**
+ * @param {SearchSummary} $this
+ * @param {SingleResult} result
+ */
+SearchSummary.addQuery$LSearchSummary$LSingleResult$ = function ($this, result) {
+ $this.sourceResults.push(result);
+};
+
+var SearchSummary$addQuery$LSearchSummary$LSingleResult$ = SearchSummary.addQuery$LSearchSummary$LSingleResult$;
+
+/**
+ * @param {SearchSummary} $this
+ */
+SearchSummary.mergeResult$LSearchSummary$ = function ($this) {
+ $this.result = SearchSummary$mergeResult$LSearchSummary$ALSingleResult$($this, $this.sourceResults);
+};
+
+var SearchSummary$mergeResult$LSearchSummary$ = SearchSummary.mergeResult$LSearchSummary$;
+
+/**
+ * @param {SearchSummary} $this
+ * @param {Array.<undefined|SingleResult>} results
+ * @return {SingleResult}
+ */
+SearchSummary.mergeResult$LSearchSummary$ALSingleResult$ = function ($this, results) {
+ /** @type {SingleResult} */
+ var rhs;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var results$len$0;
+ rhs = results[0];
+ for ((i = 1, results$len$0 = results.length); i < results$len$0; i++) {
+ rhs = SingleResult$merge$LSingleResult$LSingleResult$(rhs, results[i]);
+ }
+ return rhs;
+};
+
+var SearchSummary$mergeResult$LSearchSummary$ALSingleResult$ = SearchSummary.mergeResult$LSearchSummary$ALSingleResult$;
+
+/**
+ * @param {SearchSummary} $this
+ * @return {Array.<undefined|Proposal>}
+ */
+SearchSummary.getProposal$LSearchSummary$ = function ($this) {
+ /** @type {Array.<undefined|Proposal>} */
+ var proposals;
+ /** @type {!number} */
+ var i;
+ /** @type {Array.<undefined|SingleResult>} */
+ var tmpSource;
+ /** @type {!number} */
+ var j;
+ /** @type {SingleResult} */
+ var result;
+ proposals = [ ];
+ for (i = 0; i < $this.sourceResults.length; i++) {
+ tmpSource = [ ];
+ for (j = 0; j < $this.sourceResults.length; j++) {
+ if (i !== j) {
+ tmpSource.push($this.sourceResults[j]);
+ }
+ }
+ result = SearchSummary$mergeResult$LSearchSummary$ALSingleResult$($this, tmpSource);
+ proposals.push(({omit: i, expect: result.units.length}));
+ }
+ proposals.sort((function (a, b) {
+ return b.expect - a.expect;
+ }));
+ return proposals;
+};
+
+var SearchSummary$getProposal$LSearchSummary$ = SearchSummary.getProposal$LSearchSummary$;
+
+/**
+ * @param {SearchSummary} $this
+ * @return {Array.<undefined|SearchUnit>}
+ */
+SearchSummary.getSortedResult$LSearchSummary$ = function ($this) {
+ /** @type {Array.<undefined|SearchUnit>} */
+ var result;
+ /** @type {Array.<undefined|SearchUnit>} */
+ var units$0;
+ result = (units$0 = $this.result.units).slice(0, units$0.length);
+ result.sort((function (a, b) {
+ return b.score - a.score;
+ }));
+ return result;
+};
+
+var SearchSummary$getSortedResult$LSearchSummary$ = SearchSummary.getSortedResult$LSearchSummary$;
+
+/**
+ * @param {SearchSummary} $this
+ * @return {!number}
+ */
+SearchSummary.size$LSearchSummary$ = function ($this) {
+ /** @type {SingleResult} */
+ var this$0;
+ this$0 = $this.result;
+ return (this$0.units.length | 0);
+};
+
+var SearchSummary$size$LSearchSummary$ = SearchSummary.size$LSearchSummary$;
+
+/**
+ * @param {SearchSummary} $this
+ * @param {SingleResult} result
+ */
+SearchSummary.add$LSearchSummary$LSingleResult$ = function ($this, result) {
+ $this.sourceResults.push(result);
+};
+
+var SearchSummary$add$LSearchSummary$LSingleResult$ = SearchSummary.add$LSearchSummary$LSingleResult$;
+
+/**
+ * class Style extends Object
+ * @constructor
+ */
+function Style() {
+}
+
+/**
+ * @constructor
+ * @param {!string} mode
+ */
+function Style$S(mode) {
+ this.styles = null;
+ this.escapeHTML = false;
+ switch (mode) {
+ case 'console':
+ this.styles = Style.console;
+ break;
+ case 'html':
+ this.styles = Style.html;
+ break;
+ case 'ignore':
+ this.styles = Style.ignore;
+ break;
+ default:
+ this.styles = Style.ignore;
+ break;
+ }
+ this.escapeHTML = mode === 'html';
+};
+
+Style$S.prototype = new Style;
+
+/**
+ * @param {!string} source
+ * @return {!string}
+ */
+Style.prototype.convert$S = function (source) {
+ /** @type {_HTMLHandler} */
+ var handler;
+ /** @type {SAXParser} */
+ var parser;
+ handler = new _HTMLHandler$HASB(this.styles, this.escapeHTML);
+ parser = new SAXParser$LSAXHandler$(handler);
+ parser.parse$S(source);
+ return handler.text.join('');
+};
+
+/**
+ * class Stemmer
+ * @constructor
+ */
+function Stemmer() {
+}
+
+Stemmer.prototype.$__jsx_implements_Stemmer = true;
+
+/**
+ * @constructor
+ */
+function Stemmer$() {
+};
+
+Stemmer$.prototype = new Stemmer;
+
+/**
+ * class BaseStemmer extends Object
+ * @constructor
+ */
+function BaseStemmer() {
+}
+
+$__jsx_merge_interface(BaseStemmer, Stemmer);
+
+/**
+ * @constructor
+ */
+function BaseStemmer$() {
+ /** @type {!string} */
+ var current$0;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var limit$0;
+ this.cache = ({ });
+ current$0 = this.current = "";
+ cursor$0 = this.cursor = 0;
+ limit$0 = this.limit = current$0.length;
+ this.limit_backward = 0;
+ this.bra = cursor$0;
+ this.ket = limit$0;
+};
+
+BaseStemmer$.prototype = new BaseStemmer;
+
+/**
+ * @param {!string} value
+ */
+BaseStemmer.prototype.setCurrent$S = function (value) {
+ /** @type {!string} */
+ var current$0;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var limit$0;
+ current$0 = this.current = value;
+ cursor$0 = this.cursor = 0;
+ limit$0 = this.limit = current$0.length;
+ this.limit_backward = 0;
+ this.bra = cursor$0;
+ this.ket = limit$0;
+};
+
+/**
+ * @return {!string}
+ */
+BaseStemmer.prototype.getCurrent$ = function () {
+ return this.current;
+};
+
+/**
+ * @param {BaseStemmer} other
+ */
+BaseStemmer.prototype.copy_from$LBaseStemmer$ = function (other) {
+ this.current = other.current;
+ this.cursor = other.cursor;
+ this.limit = other.limit;
+ this.limit_backward = other.limit_backward;
+ this.bra = other.bra;
+ this.ket = other.ket;
+};
+
+/**
+ * @param {Array.<undefined|!number>} s
+ * @param {!number} min
+ * @param {!number} max
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.in_grouping$AIII = function (s, min, max) {
+ /** @type {!number} */
+ var ch;
+ if (this.cursor >= this.limit) {
+ return false;
+ }
+ ch = this.current.charCodeAt(this.cursor);
+ if (ch > max || ch < min) {
+ return false;
+ }
+ ch -= min;
+ if ((s[ch >>> 3] & 0x1 << (ch & 0x7)) === 0) {
+ return false;
+ }
+ this.cursor++;
+ return true;
+};
+
+/**
+ * @param {Array.<undefined|!number>} s
+ * @param {!number} min
+ * @param {!number} max
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.in_grouping_b$AIII = function (s, min, max) {
+ /** @type {!number} */
+ var ch;
+ if (this.cursor <= this.limit_backward) {
+ return false;
+ }
+ ch = this.current.charCodeAt(this.cursor - 1);
+ if (ch > max || ch < min) {
+ return false;
+ }
+ ch -= min;
+ if ((s[ch >>> 3] & 0x1 << (ch & 0x7)) === 0) {
+ return false;
+ }
+ this.cursor--;
+ return true;
+};
+
+/**
+ * @param {Array.<undefined|!number>} s
+ * @param {!number} min
+ * @param {!number} max
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.out_grouping$AIII = function (s, min, max) {
+ /** @type {!number} */
+ var ch;
+ if (this.cursor >= this.limit) {
+ return false;
+ }
+ ch = this.current.charCodeAt(this.cursor);
+ if (ch > max || ch < min) {
+ this.cursor++;
+ return true;
+ }
+ ch -= min;
+ if ((s[ch >>> 3] & 0X1 << (ch & 0x7)) === 0) {
+ this.cursor++;
+ return true;
+ }
+ return false;
+};
+
+/**
+ * @param {Array.<undefined|!number>} s
+ * @param {!number} min
+ * @param {!number} max
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.out_grouping_b$AIII = function (s, min, max) {
+ /** @type {!number} */
+ var ch;
+ if (this.cursor <= this.limit_backward) {
+ return false;
+ }
+ ch = this.current.charCodeAt(this.cursor - 1);
+ if (ch > max || ch < min) {
+ this.cursor--;
+ return true;
+ }
+ ch -= min;
+ if ((s[ch >>> 3] & 0x1 << (ch & 0x7)) === 0) {
+ this.cursor--;
+ return true;
+ }
+ return false;
+};
+
+/**
+ * @param {!number} min
+ * @param {!number} max
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.in_range$II = function (min, max) {
+ /** @type {!number} */
+ var ch;
+ if (this.cursor >= this.limit) {
+ return false;
+ }
+ ch = this.current.charCodeAt(this.cursor);
+ if (ch > max || ch < min) {
+ return false;
+ }
+ this.cursor++;
+ return true;
+};
+
+/**
+ * @param {!number} min
+ * @param {!number} max
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.in_range_b$II = function (min, max) {
+ /** @type {!number} */
+ var ch;
+ if (this.cursor <= this.limit_backward) {
+ return false;
+ }
+ ch = this.current.charCodeAt(this.cursor - 1);
+ if (ch > max || ch < min) {
+ return false;
+ }
+ this.cursor--;
+ return true;
+};
+
+/**
+ * @param {!number} min
+ * @param {!number} max
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.out_range$II = function (min, max) {
+ /** @type {!number} */
+ var ch;
+ if (this.cursor >= this.limit) {
+ return false;
+ }
+ ch = this.current.charCodeAt(this.cursor);
+ if (! (ch > max || ch < min)) {
+ return false;
+ }
+ this.cursor++;
+ return true;
+};
+
+/**
+ * @param {!number} min
+ * @param {!number} max
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.out_range_b$II = function (min, max) {
+ /** @type {!number} */
+ var ch;
+ if (this.cursor <= this.limit_backward) {
+ return false;
+ }
+ ch = this.current.charCodeAt(this.cursor - 1);
+ if (! (ch > max || ch < min)) {
+ return false;
+ }
+ this.cursor--;
+ return true;
+};
+
+/**
+ * @param {!number} s_size
+ * @param {!string} s
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.eq_s$IS = function (s_size, s) {
+ /** @type {!number} */
+ var cursor$0;
+ if (this.limit - this.cursor < s_size) {
+ return false;
+ }
+ if (this.current.slice(cursor$0 = this.cursor, cursor$0 + s_size) !== s) {
+ return false;
+ }
+ this.cursor += s_size;
+ return true;
+};
+
+/**
+ * @param {!number} s_size
+ * @param {!string} s
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.eq_s_b$IS = function (s_size, s) {
+ /** @type {!number} */
+ var cursor$0;
+ if (this.cursor - this.limit_backward < s_size) {
+ return false;
+ }
+ if (this.current.slice((cursor$0 = this.cursor) - s_size, cursor$0) !== s) {
+ return false;
+ }
+ this.cursor -= s_size;
+ return true;
+};
+
+/**
+ * @param {!string} s
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.eq_v$S = function (s) {
+ return this.eq_s$IS(s.length, s);
+};
+
+/**
+ * @param {!string} s
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.eq_v_b$S = function (s) {
+ return this.eq_s_b$IS(s.length, s);
+};
+
+/**
+ * @param {Array.<undefined|Among>} v
+ * @param {!number} v_size
+ * @return {!number}
+ */
+BaseStemmer.prototype.find_among$ALAmong$I = function (v, v_size) {
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var j;
+ /** @type {!number} */
+ var c;
+ /** @type {!number} */
+ var l;
+ /** @type {!number} */
+ var common_i;
+ /** @type {!number} */
+ var common_j;
+ /** @type {!boolean} */
+ var first_key_inspected;
+ /** @type {!number} */
+ var k;
+ /** @type {!number} */
+ var diff;
+ /** @type {!number} */
+ var common;
+ /** @type {Among} */
+ var w;
+ /** @type {!number} */
+ var i2;
+ /** @type {!boolean} */
+ var res;
+ i = 0;
+ j = v_size;
+ c = this.cursor;
+ l = this.limit;
+ common_i = 0;
+ common_j = 0;
+ first_key_inspected = false;
+ while (true) {
+ k = i + (j - i >>> 1);
+ diff = 0;
+ common = (common_i < common_j ? common_i : common_j);
+ w = v[k];
+ for (i2 = common; i2 < w.s_size; i2++) {
+ if (c + common === l) {
+ diff = -1;
+ break;
+ }
+ diff = this.current.charCodeAt(c + common) - w.s.charCodeAt(i2);
+ if (diff !== 0) {
+ break;
+ }
+ common++;
+ }
+ if (diff < 0) {
+ j = k;
+ common_j = common;
+ } else {
+ i = k;
+ common_i = common;
+ }
+ if (j - i <= 1) {
+ if (i > 0) {
+ break;
+ }
+ if (j === i) {
+ break;
+ }
+ if (first_key_inspected) {
+ break;
+ }
+ first_key_inspected = true;
+ }
+ }
+ while (true) {
+ w = v[i];
+ if (common_i >= w.s_size) {
+ this.cursor = (c + w.s_size | 0);
+ if (w.method == null) {
+ return w.result;
+ }
+ res = w.method(w.instance);
+ this.cursor = (c + w.s_size | 0);
+ if (res) {
+ return w.result;
+ }
+ }
+ i = w.substring_i;
+ if (i < 0) {
+ return 0;
+ }
+ }
+ return -1;
+};
+
+/**
+ * @param {Array.<undefined|Among>} v
+ * @param {!number} v_size
+ * @return {!number}
+ */
+BaseStemmer.prototype.find_among_b$ALAmong$I = function (v, v_size) {
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var j;
+ /** @type {!number} */
+ var c;
+ /** @type {!number} */
+ var lb;
+ /** @type {!number} */
+ var common_i;
+ /** @type {!number} */
+ var common_j;
+ /** @type {!boolean} */
+ var first_key_inspected;
+ /** @type {!number} */
+ var k;
+ /** @type {!number} */
+ var diff;
+ /** @type {!number} */
+ var common;
+ /** @type {Among} */
+ var w;
+ /** @type {!number} */
+ var i2;
+ /** @type {!boolean} */
+ var res;
+ i = 0;
+ j = v_size;
+ c = this.cursor;
+ lb = this.limit_backward;
+ common_i = 0;
+ common_j = 0;
+ first_key_inspected = false;
+ while (true) {
+ k = i + (j - i >> 1);
+ diff = 0;
+ common = (common_i < common_j ? common_i : common_j);
+ w = v[k];
+ for (i2 = w.s_size - 1 - common; i2 >= 0; i2--) {
+ if (c - common === lb) {
+ diff = -1;
+ break;
+ }
+ diff = this.current.charCodeAt(c - 1 - common) - w.s.charCodeAt(i2);
+ if (diff !== 0) {
+ break;
+ }
+ common++;
+ }
+ if (diff < 0) {
+ j = k;
+ common_j = common;
+ } else {
+ i = k;
+ common_i = common;
+ }
+ if (j - i <= 1) {
+ if (i > 0) {
+ break;
+ }
+ if (j === i) {
+ break;
+ }
+ if (first_key_inspected) {
+ break;
+ }
+ first_key_inspected = true;
+ }
+ }
+ while (true) {
+ w = v[i];
+ if (common_i >= w.s_size) {
+ this.cursor = (c - w.s_size | 0);
+ if (w.method == null) {
+ return w.result;
+ }
+ res = w.method(this);
+ this.cursor = (c - w.s_size | 0);
+ if (res) {
+ return w.result;
+ }
+ }
+ i = w.substring_i;
+ if (i < 0) {
+ return 0;
+ }
+ }
+ return -1;
+};
+
+/**
+ * @param {!number} c_bra
+ * @param {!number} c_ket
+ * @param {!string} s
+ * @return {!number}
+ */
+BaseStemmer.prototype.replace_s$IIS = function (c_bra, c_ket, s) {
+ /** @type {!number} */
+ var adjustment;
+ adjustment = s.length - (c_ket - c_bra);
+ this.current = this.current.slice(0, c_bra) + s + this.current.slice(c_ket);
+ this.limit += (adjustment | 0);
+ if (this.cursor >= c_ket) {
+ this.cursor += (adjustment | 0);
+ } else {
+ if (this.cursor > c_bra) {
+ this.cursor = c_bra;
+ }
+ }
+ return (adjustment | 0);
+};
+
+/**
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.slice_check$ = function () {
+ /** @type {!number} */
+ var bra$0;
+ /** @type {!number} */
+ var ket$0;
+ /** @type {!number} */
+ var limit$0;
+ return ((bra$0 = this.bra) < 0 || bra$0 > (ket$0 = this.ket) || ket$0 > (limit$0 = this.limit) || limit$0 > this.current.length ? false : true);
+};
+
+/**
+ * @param {!string} s
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.slice_from$S = function (s) {
+ /** @type {!boolean} */
+ var result;
+ /** @type {!number} */
+ var bra$0;
+ /** @type {!number} */
+ var ket$0;
+ /** @type {!number} */
+ var limit$0;
+ result = false;
+ if ((bra$0 = this.bra) < 0 || bra$0 > (ket$0 = this.ket) || ket$0 > (limit$0 = this.limit) || limit$0 > this.current.length ? false : true) {
+ this.replace_s$IIS(this.bra, this.ket, s);
+ result = true;
+ }
+ return result;
+};
+
+/**
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.slice_del$ = function () {
+ return this.slice_from$S("");
+};
+
+/**
+ * @param {!number} c_bra
+ * @param {!number} c_ket
+ * @param {!string} s
+ */
+BaseStemmer.prototype.insert$IIS = function (c_bra, c_ket, s) {
+ /** @type {!number} */
+ var adjustment;
+ adjustment = this.replace_s$IIS(c_bra, c_ket, s);
+ if (c_bra <= this.bra) {
+ this.bra += (adjustment | 0);
+ }
+ if (c_bra <= this.ket) {
+ this.ket += (adjustment | 0);
+ }
+};
+
+/**
+ * @param {!string} s
+ * @return {!string}
+ */
+BaseStemmer.prototype.slice_to$S = function (s) {
+ /** @type {!string} */
+ var result;
+ /** @type {!number} */
+ var bra$0;
+ /** @type {!number} */
+ var ket$0;
+ /** @type {!number} */
+ var limit$0;
+ result = '';
+ if ((bra$0 = this.bra) < 0 || bra$0 > (ket$0 = this.ket) || ket$0 > (limit$0 = this.limit) || limit$0 > this.current.length ? false : true) {
+ result = this.current.slice(this.bra, this.ket);
+ }
+ return result;
+};
+
+/**
+ * @param {!string} s
+ * @return {!string}
+ */
+BaseStemmer.prototype.assign_to$S = function (s) {
+ return this.current.slice(0, this.limit);
+};
+
+/**
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.stem$ = function () {
+ return false;
+};
+
+/**
+ * @param {!string} word
+ * @return {!string}
+ */
+BaseStemmer.prototype.stemWord$S = function (word) {
+ /** @type {undefined|!string} */
+ var result;
+ /** @type {!string} */
+ var current$0;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var limit$0;
+ result = this.cache['.' + word];
+ if (result == null) {
+ current$0 = this.current = word;
+ cursor$0 = this.cursor = 0;
+ limit$0 = this.limit = current$0.length;
+ this.limit_backward = 0;
+ this.bra = cursor$0;
+ this.ket = limit$0;
+ this.stem$();
+ result = this.current;
+ this.cache['.' + word] = result;
+ }
+ return result;
+};
+
+/**
+ * @param {Array.<undefined|!string>} words
+ * @return {Array.<undefined|!string>}
+ */
+BaseStemmer.prototype.stemWords$AS = function (words) {
+ /** @type {Array.<undefined|!string>} */
+ var results;
+ /** @type {!number} */
+ var i;
+ /** @type {undefined|!string} */
+ var word;
+ /** @type {undefined|!string} */
+ var result;
+ /** @type {!string} */
+ var current$0;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var limit$0;
+ results = [ ];
+ for (i = 0; i < words.length; i++) {
+ word = words[i];
+ result = this.cache['.' + word];
+ if (result == null) {
+ current$0 = this.current = word;
+ cursor$0 = this.cursor = 0;
+ limit$0 = this.limit = current$0.length;
+ this.limit_backward = 0;
+ this.bra = cursor$0;
+ this.ket = limit$0;
+ this.stem$();
+ result = this.current;
+ this.cache['.' + word] = result;
+ }
+ results.push(result);
+ }
+ return results;
+};
+
+/**
+ * class RomanianStemmer extends BaseStemmer
+ * @constructor
+ */
+function RomanianStemmer() {
+}
+
+RomanianStemmer.prototype = new BaseStemmer;
+/**
+ * @constructor
+ */
+function RomanianStemmer$() {
+ BaseStemmer$.call(this);
+ this.B_standard_suffix_removed = false;
+ this.I_p2 = 0;
+ this.I_p1 = 0;
+ this.I_pV = 0;
+};
+
+RomanianStemmer$.prototype = new RomanianStemmer;
+
+/**
+ * @param {RomanianStemmer} other
+ */
+RomanianStemmer.prototype.copy_from$LRomanianStemmer$ = function (other) {
+ this.B_standard_suffix_removed = other.B_standard_suffix_removed;
+ this.I_p2 = other.I_p2;
+ this.I_p1 = other.I_p1;
+ this.I_pV = other.I_pV;
+ BaseStemmer.prototype.copy_from$LBaseStemmer$.call(this, other);
+};
+
+/**
+ * @return {!boolean}
+ */
+RomanianStemmer.prototype.r_prelude$ = function () {
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var v_3;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!boolean} */
+ var lab3;
+ /** @type {!boolean} */
+ var lab4;
+ /** @type {!boolean} */
+ var lab5;
+ /** @type {!number} */
+ var cursor$0;
+replab0:
+ while (true) {
+ v_1 = this.cursor;
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ golab2:
+ while (true) {
+ v_2 = this.cursor;
+ lab3 = true;
+ lab3:
+ while (lab3 === true) {
+ lab3 = false;
+ if (! this.in_grouping$AIII(RomanianStemmer.g_v, 97, 259)) {
+ break lab3;
+ }
+ this.bra = this.cursor;
+ lab4 = true;
+ lab4:
+ while (lab4 === true) {
+ lab4 = false;
+ v_3 = this.cursor;
+ lab5 = true;
+ lab5:
+ while (lab5 === true) {
+ lab5 = false;
+ if (! this.eq_s$IS(1, "u")) {
+ break lab5;
+ }
+ this.ket = this.cursor;
+ if (! this.in_grouping$AIII(RomanianStemmer.g_v, 97, 259)) {
+ break lab5;
+ }
+ if (! this.slice_from$S("U")) {
+ return false;
+ }
+ break lab4;
+ }
+ this.cursor = v_3;
+ if (! this.eq_s$IS(1, "i")) {
+ break lab3;
+ }
+ this.ket = this.cursor;
+ if (! this.in_grouping$AIII(RomanianStemmer.g_v, 97, 259)) {
+ break lab3;
+ }
+ if (! this.slice_from$S("I")) {
+ return false;
+ }
+ }
+ this.cursor = v_2;
+ break golab2;
+ }
+ cursor$0 = this.cursor = v_2;
+ if (cursor$0 >= this.limit) {
+ break lab1;
+ }
+ this.cursor++;
+ }
+ continue replab0;
+ }
+ this.cursor = v_1;
+ break replab0;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+RomanianStemmer.prototype.r_mark_regions$ = function () {
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var v_3;
+ /** @type {!number} */
+ var v_6;
+ /** @type {!number} */
+ var v_8;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!boolean} */
+ var lab2;
+ /** @type {!boolean} */
+ var lab3;
+ /** @type {!boolean} */
+ var lab4;
+ /** @type {!boolean} */
+ var lab6;
+ /** @type {!boolean} */
+ var lab8;
+ /** @type {!boolean} */
+ var lab9;
+ /** @type {!boolean} */
+ var lab10;
+ /** @type {!boolean} */
+ var lab12;
+ /** @type {!boolean} */
+ var lab13;
+ /** @type {!boolean} */
+ var lab15;
+ /** @type {!boolean} */
+ var lab17;
+ /** @type {!boolean} */
+ var lab19;
+ /** @type {!boolean} */
+ var lab21;
+ /** @type {!number} */
+ var limit$0;
+ /** @type {!number} */
+ var cursor$0;
+ this.I_pV = limit$0 = this.limit;
+ this.I_p1 = limit$0;
+ this.I_p2 = limit$0;
+ v_1 = this.cursor;
+ lab0 = true;
+lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ v_2 = this.cursor;
+ lab2 = true;
+ lab2:
+ while (lab2 === true) {
+ lab2 = false;
+ if (! this.in_grouping$AIII(RomanianStemmer.g_v, 97, 259)) {
+ break lab2;
+ }
+ lab3 = true;
+ lab3:
+ while (lab3 === true) {
+ lab3 = false;
+ v_3 = this.cursor;
+ lab4 = true;
+ lab4:
+ while (lab4 === true) {
+ lab4 = false;
+ if (! this.out_grouping$AIII(RomanianStemmer.g_v, 97, 259)) {
+ break lab4;
+ }
+ golab5:
+ while (true) {
+ lab6 = true;
+ lab6:
+ while (lab6 === true) {
+ lab6 = false;
+ if (! this.in_grouping$AIII(RomanianStemmer.g_v, 97, 259)) {
+ break lab6;
+ }
+ break golab5;
+ }
+ if (this.cursor >= this.limit) {
+ break lab4;
+ }
+ this.cursor++;
+ }
+ break lab3;
+ }
+ this.cursor = v_3;
+ if (! this.in_grouping$AIII(RomanianStemmer.g_v, 97, 259)) {
+ break lab2;
+ }
+ golab7:
+ while (true) {
+ lab8 = true;
+ lab8:
+ while (lab8 === true) {
+ lab8 = false;
+ if (! this.out_grouping$AIII(RomanianStemmer.g_v, 97, 259)) {
+ break lab8;
+ }
+ break golab7;
+ }
+ if (this.cursor >= this.limit) {
+ break lab2;
+ }
+ this.cursor++;
+ }
+ }
+ break lab1;
+ }
+ this.cursor = v_2;
+ if (! this.out_grouping$AIII(RomanianStemmer.g_v, 97, 259)) {
+ break lab0;
+ }
+ lab9 = true;
+ lab9:
+ while (lab9 === true) {
+ lab9 = false;
+ v_6 = this.cursor;
+ lab10 = true;
+ lab10:
+ while (lab10 === true) {
+ lab10 = false;
+ if (! this.out_grouping$AIII(RomanianStemmer.g_v, 97, 259)) {
+ break lab10;
+ }
+ golab11:
+ while (true) {
+ lab12 = true;
+ lab12:
+ while (lab12 === true) {
+ lab12 = false;
+ if (! this.in_grouping$AIII(RomanianStemmer.g_v, 97, 259)) {
+ break lab12;
+ }
+ break golab11;
+ }
+ if (this.cursor >= this.limit) {
+ break lab10;
+ }
+ this.cursor++;
+ }
+ break lab9;
+ }
+ this.cursor = v_6;
+ if (! this.in_grouping$AIII(RomanianStemmer.g_v, 97, 259)) {
+ break lab0;
+ }
+ if (this.cursor >= this.limit) {
+ break lab0;
+ }
+ this.cursor++;
+ }
+ }
+ this.I_pV = this.cursor;
+ }
+ cursor$0 = this.cursor = v_1;
+ v_8 = cursor$0;
+ lab13 = true;
+lab13:
+ while (lab13 === true) {
+ lab13 = false;
+ golab14:
+ while (true) {
+ lab15 = true;
+ lab15:
+ while (lab15 === true) {
+ lab15 = false;
+ if (! this.in_grouping$AIII(RomanianStemmer.g_v, 97, 259)) {
+ break lab15;
+ }
+ break golab14;
+ }
+ if (this.cursor >= this.limit) {
+ break lab13;
+ }
+ this.cursor++;
+ }
+ golab16:
+ while (true) {
+ lab17 = true;
+ lab17:
+ while (lab17 === true) {
+ lab17 = false;
+ if (! this.out_grouping$AIII(RomanianStemmer.g_v, 97, 259)) {
+ break lab17;
+ }
+ break golab16;
+ }
+ if (this.cursor >= this.limit) {
+ break lab13;
+ }
+ this.cursor++;
+ }
+ this.I_p1 = this.cursor;
+ golab18:
+ while (true) {
+ lab19 = true;
+ lab19:
+ while (lab19 === true) {
+ lab19 = false;
+ if (! this.in_grouping$AIII(RomanianStemmer.g_v, 97, 259)) {
+ break lab19;
+ }
+ break golab18;
+ }
+ if (this.cursor >= this.limit) {
+ break lab13;
+ }
+ this.cursor++;
+ }
+ golab20:
+ while (true) {
+ lab21 = true;
+ lab21:
+ while (lab21 === true) {
+ lab21 = false;
+ if (! this.out_grouping$AIII(RomanianStemmer.g_v, 97, 259)) {
+ break lab21;
+ }
+ break golab20;
+ }
+ if (this.cursor >= this.limit) {
+ break lab13;
+ }
+ this.cursor++;
+ }
+ this.I_p2 = this.cursor;
+ }
+ this.cursor = v_8;
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+RomanianStemmer.prototype.r_postlude$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var v_1;
+ /** @type {!boolean} */
+ var lab1;
+replab0:
+ while (true) {
+ v_1 = this.cursor;
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ this.bra = this.cursor;
+ among_var = this.find_among$ALAmong$I(RomanianStemmer.a_0, 3);
+ if (among_var === 0) {
+ break lab1;
+ }
+ this.ket = this.cursor;
+ switch (among_var) {
+ case 0:
+ break lab1;
+ case 1:
+ if (! this.slice_from$S("i")) {
+ return false;
+ }
+ break;
+ case 2:
+ if (! this.slice_from$S("u")) {
+ return false;
+ }
+ break;
+ case 3:
+ if (this.cursor >= this.limit) {
+ break lab1;
+ }
+ this.cursor++;
+ break;
+ }
+ continue replab0;
+ }
+ this.cursor = v_1;
+ break replab0;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+RomanianStemmer.prototype.r_RV$ = function () {
+ return (! (this.I_pV <= this.cursor) ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+RomanianStemmer.prototype.r_R1$ = function () {
+ return (! (this.I_p1 <= this.cursor) ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+RomanianStemmer.prototype.r_R2$ = function () {
+ return (! (this.I_p2 <= this.cursor) ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+RomanianStemmer.prototype.r_step_0$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var v_1;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!number} */
+ var cursor$0;
+ this.ket = this.cursor;
+ among_var = this.find_among_b$ALAmong$I(RomanianStemmer.a_1, 16);
+ if (among_var === 0) {
+ return false;
+ }
+ this.bra = cursor$0 = this.cursor;
+ if (! (! (this.I_p1 <= cursor$0) ? false : true)) {
+ return false;
+ }
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 2:
+ if (! this.slice_from$S("a")) {
+ return false;
+ }
+ break;
+ case 3:
+ if (! this.slice_from$S("e")) {
+ return false;
+ }
+ break;
+ case 4:
+ if (! this.slice_from$S("i")) {
+ return false;
+ }
+ break;
+ case 5:
+ v_1 = this.limit - this.cursor;
+ lab0 = true;
+ lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ if (! this.eq_s_b$IS(2, "ab")) {
+ break lab0;
+ }
+ return false;
+ }
+ this.cursor = this.limit - v_1;
+ if (! this.slice_from$S("i")) {
+ return false;
+ }
+ break;
+ case 6:
+ if (! this.slice_from$S("at")) {
+ return false;
+ }
+ break;
+ case 7:
+ if (! this.slice_from$S("a\u0163i")) {
+ return false;
+ }
+ break;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+RomanianStemmer.prototype.r_combo_suffix$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var cursor$1;
+ v_1 = this.limit - (cursor$0 = this.cursor);
+ this.ket = cursor$0;
+ among_var = this.find_among_b$ALAmong$I(RomanianStemmer.a_2, 46);
+ if (among_var === 0) {
+ return false;
+ }
+ this.bra = cursor$1 = this.cursor;
+ if (! (! (this.I_p1 <= cursor$1) ? false : true)) {
+ return false;
+ }
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ if (! this.slice_from$S("abil")) {
+ return false;
+ }
+ break;
+ case 2:
+ if (! this.slice_from$S("ibil")) {
+ return false;
+ }
+ break;
+ case 3:
+ if (! this.slice_from$S("iv")) {
+ return false;
+ }
+ break;
+ case 4:
+ if (! this.slice_from$S("ic")) {
+ return false;
+ }
+ break;
+ case 5:
+ if (! this.slice_from$S("at")) {
+ return false;
+ }
+ break;
+ case 6:
+ if (! this.slice_from$S("it")) {
+ return false;
+ }
+ break;
+ }
+ this.B_standard_suffix_removed = true;
+ this.cursor = this.limit - v_1;
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+RomanianStemmer.prototype.r_standard_suffix$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var v_1;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!number} */
+ var cursor$0;
+ this.B_standard_suffix_removed = false;
+replab0:
+ while (true) {
+ v_1 = this.limit - this.cursor;
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ if (! this.r_combo_suffix$()) {
+ break lab1;
+ }
+ continue replab0;
+ }
+ this.cursor = this.limit - v_1;
+ break replab0;
+ }
+ this.ket = this.cursor;
+ among_var = this.find_among_b$ALAmong$I(RomanianStemmer.a_3, 62);
+ if (among_var === 0) {
+ return false;
+ }
+ this.bra = cursor$0 = this.cursor;
+ if (! (! (this.I_p2 <= cursor$0) ? false : true)) {
+ return false;
+ }
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 2:
+ if (! this.eq_s_b$IS(1, "\u0163")) {
+ return false;
+ }
+ this.bra = this.cursor;
+ if (! this.slice_from$S("t")) {
+ return false;
+ }
+ break;
+ case 3:
+ if (! this.slice_from$S("ist")) {
+ return false;
+ }
+ break;
+ }
+ this.B_standard_suffix_removed = true;
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+RomanianStemmer.prototype.r_verb_suffix$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var v_3;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var cursor$1;
+ /** @type {!number} */
+ var cursor$2;
+ v_1 = this.limit - (cursor$0 = this.cursor);
+ if (cursor$0 < this.I_pV) {
+ return false;
+ }
+ cursor$1 = this.cursor = this.I_pV;
+ v_2 = this.limit_backward;
+ this.limit_backward = cursor$1;
+ cursor$2 = this.cursor = this.limit - v_1;
+ this.ket = cursor$2;
+ among_var = this.find_among_b$ALAmong$I(RomanianStemmer.a_4, 94);
+ if (among_var === 0) {
+ this.limit_backward = v_2;
+ return false;
+ }
+ this.bra = this.cursor;
+ switch (among_var) {
+ case 0:
+ this.limit_backward = v_2;
+ return false;
+ case 1:
+ lab0 = true;
+ lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ v_3 = this.limit - this.cursor;
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ if (! this.out_grouping_b$AIII(RomanianStemmer.g_v, 97, 259)) {
+ break lab1;
+ }
+ break lab0;
+ }
+ this.cursor = this.limit - v_3;
+ if (! this.eq_s_b$IS(1, "u")) {
+ this.limit_backward = v_2;
+ return false;
+ }
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 2:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ }
+ this.limit_backward = v_2;
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+RomanianStemmer.prototype.r_vowel_suffix$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var cursor$0;
+ this.ket = this.cursor;
+ among_var = this.find_among_b$ALAmong$I(RomanianStemmer.a_5, 5);
+ if (among_var === 0) {
+ return false;
+ }
+ this.bra = cursor$0 = this.cursor;
+ if (! (! (this.I_pV <= cursor$0) ? false : true)) {
+ return false;
+ }
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+RomanianStemmer.prototype.stem$ = function () {
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var v_3;
+ /** @type {!number} */
+ var v_4;
+ /** @type {!number} */
+ var v_5;
+ /** @type {!number} */
+ var v_6;
+ /** @type {!number} */
+ var v_8;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!boolean} */
+ var lab2;
+ /** @type {!boolean} */
+ var lab3;
+ /** @type {!boolean} */
+ var lab4;
+ /** @type {!boolean} */
+ var lab5;
+ /** @type {!boolean} */
+ var lab6;
+ /** @type {!boolean} */
+ var lab7;
+ /** @type {!boolean} */
+ var lab8;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var cursor$1;
+ /** @type {!number} */
+ var limit$0;
+ /** @type {!number} */
+ var cursor$2;
+ /** @type {!number} */
+ var limit$1;
+ /** @type {!number} */
+ var cursor$3;
+ /** @type {!number} */
+ var limit$2;
+ /** @type {!number} */
+ var cursor$4;
+ /** @type {!number} */
+ var cursor$5;
+ v_1 = this.cursor;
+ lab0 = true;
+lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ if (! this.r_prelude$()) {
+ break lab0;
+ }
+ }
+ cursor$0 = this.cursor = v_1;
+ v_2 = cursor$0;
+ lab1 = true;
+lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ if (! this.r_mark_regions$()) {
+ break lab1;
+ }
+ }
+ cursor$1 = this.cursor = v_2;
+ this.limit_backward = cursor$1;
+ cursor$2 = this.cursor = limit$0 = this.limit;
+ v_3 = limit$0 - cursor$2;
+ lab2 = true;
+lab2:
+ while (lab2 === true) {
+ lab2 = false;
+ if (! this.r_step_0$()) {
+ break lab2;
+ }
+ }
+ cursor$3 = this.cursor = (limit$1 = this.limit) - v_3;
+ v_4 = limit$1 - cursor$3;
+ lab3 = true;
+lab3:
+ while (lab3 === true) {
+ lab3 = false;
+ if (! this.r_standard_suffix$()) {
+ break lab3;
+ }
+ }
+ cursor$4 = this.cursor = (limit$2 = this.limit) - v_4;
+ v_5 = limit$2 - cursor$4;
+ lab4 = true;
+lab4:
+ while (lab4 === true) {
+ lab4 = false;
+ lab5 = true;
+ lab5:
+ while (lab5 === true) {
+ lab5 = false;
+ v_6 = this.limit - this.cursor;
+ lab6 = true;
+ lab6:
+ while (lab6 === true) {
+ lab6 = false;
+ if (! this.B_standard_suffix_removed) {
+ break lab6;
+ }
+ break lab5;
+ }
+ this.cursor = this.limit - v_6;
+ if (! this.r_verb_suffix$()) {
+ break lab4;
+ }
+ }
+ }
+ this.cursor = this.limit - v_5;
+ lab7 = true;
+lab7:
+ while (lab7 === true) {
+ lab7 = false;
+ if (! this.r_vowel_suffix$()) {
+ break lab7;
+ }
+ }
+ cursor$5 = this.cursor = this.limit_backward;
+ v_8 = cursor$5;
+ lab8 = true;
+lab8:
+ while (lab8 === true) {
+ lab8 = false;
+ if (! this.r_postlude$()) {
+ break lab8;
+ }
+ }
+ this.cursor = v_8;
+ return true;
+};
+
+/**
+ * @param {*} o
+ * @return {!boolean}
+ */
+RomanianStemmer.prototype.equals$X = function (o) {
+ return o instanceof RomanianStemmer;
+};
+
+/**
+ * @return {!number}
+ */
+RomanianStemmer.prototype.hashCode$ = function () {
+ /** @type {!string} */
+ var classname;
+ /** @type {!number} */
+ var hash;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var char;
+ classname = "RomanianStemmer";
+ hash = 0;
+ if ("RomanianStemmer".length === 0) {
+ return (hash | 0);
+ }
+ for (i = 0; i < classname.length; i++) {
+ char = classname.charCodeAt(i);
+ hash = (hash << 5) - hash + char;
+ hash = hash & hash;
+ }
+ return (hash | 0);
+};
+
+/**
+ * class Among extends Object
+ * @constructor
+ */
+function Among() {
+}
+
+/**
+ * @constructor
+ * @param {!string} s
+ * @param {!number} substring_i
+ * @param {!number} result
+ */
+function Among$SII(s, substring_i, result) {
+ this.s_size = s.length;
+ this.s = s;
+ this.substring_i = substring_i;
+ this.result = result;
+ this.method = null;
+ this.instance = null;
+};
+
+Among$SII.prototype = new Among;
+
+/**
+ * @constructor
+ * @param {!string} s
+ * @param {!number} substring_i
+ * @param {!number} result
+ * @param {*} method
+ * @param {BaseStemmer} instance
+ */
+function Among$SIIF$LBaseStemmer$B$LBaseStemmer$(s, substring_i, result, method, instance) {
+ this.s_size = s.length;
+ this.s = s;
+ this.substring_i = substring_i;
+ this.result = result;
+ this.method = method;
+ this.instance = instance;
+};
+
+Among$SIIF$LBaseStemmer$B$LBaseStemmer$.prototype = new Among;
+
+/**
+ * class Metadata extends Object
+ * @constructor
+ */
+function Metadata() {
+}
+
+/**
+ * @constructor
+ * @param {Oktavia} parent
+ */
+function Metadata$LOktavia$(parent) {
+ this._parent = parent;
+ this._bitVector = new BitVector$();
+};
+
+Metadata$LOktavia$.prototype = new Metadata;
+
+/**
+ * @return {!number}
+ */
+Metadata.prototype._size$ = function () {
+ /** @type {BitVector} */
+ var this$0;
+ /** @type {!number} */
+ var i$0;
+ /** @type {BitVector} */
+ var _bitVector$0;
+ this$0 = _bitVector$0 = this._bitVector;
+ i$0 = _bitVector$0._size;
+ return this$0.rank$IB(i$0, true);
+};
+
+/**
+ * @param {!number} index
+ * @return {!string}
+ */
+Metadata.prototype.getContent$I = function (index) {
+ /** @type {!number} */
+ var startPosition;
+ /** @type {!number} */
+ var length;
+ if (index < 0 || this._size$() <= index) {
+ throw new Error("Section.getContent() : range error " + (index + ""));
+ }
+ startPosition = 0;
+ if (index > 0) {
+ startPosition = this._bitVector.select$I(index - 1) + 1;
+ }
+ length = this._bitVector.select$I(index) - startPosition + 1;
+ return this._parent._getSubstring$II(startPosition, length);
+};
+
+/**
+ * @param {!number} index
+ * @return {!number}
+ */
+Metadata.prototype.getStartPosition$I = function (index) {
+ /** @type {!number} */
+ var startPosition;
+ if (index < 0 || this._size$() <= index) {
+ throw new Error("Section.getContent() : range error " + (index + ""));
+ }
+ startPosition = 0;
+ if (index > 0) {
+ startPosition = this._bitVector.select$I(index - 1) + 1;
+ }
+ return (startPosition | 0);
+};
+
+/**
+ * @param {SingleResult} result
+ * @param {Array.<undefined|!number>} positions
+ * @param {!string} word
+ * @param {!boolean} stemmed
+ */
+Metadata.prototype.grouping$LSingleResult$AISB = function (result, positions, word, stemmed) {
+};
+
+/**
+ * @param {!number} index
+ * @return {!string}
+ */
+Metadata.prototype.getInformation$I = function (index) {
+ return '';
+};
+
+/**
+ */
+Metadata.prototype._build$ = function () {
+ this._bitVector.build$();
+};
+
+/**
+ * @param {!string} name
+ * @param {!string} data
+ * @param {!number} offset
+ * @return {!number}
+ */
+Metadata.prototype._load$SSI = function (name, data, offset) {
+ offset = this._bitVector.load$SI(data, offset);
+ this._parent._metadataLabels.push(name);
+ this._parent._metadatas[name] = this;
+ return offset;
+};
+
+/**
+ * @return {!string}
+ */
+Metadata.prototype._dump$ = function () {
+ /** @type {BitVector} */
+ var this$0;
+ /** @type {Array.<undefined|!string>} */
+ var contents$0;
+ this$0 = this._bitVector;
+ contents$0 = [ ];
+ contents$0.push(Binary$dump32bitNumber$N(this$0._size));
+ contents$0.push(Binary$dump32bitNumberList$AN(this$0._v));
+ return contents$0.join('');
+};
+
+/**
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+Metadata.prototype._dump$LCompressionReport$ = function (report) {
+ /** @type {BitVector} */
+ var this$0;
+ /** @type {Array.<undefined|!string>} */
+ var contents$0;
+ this$0 = this._bitVector;
+ contents$0 = [ ];
+ contents$0.push(Binary$dump32bitNumber$N(this$0._size));
+ CompressionReport$add$LCompressionReport$II(report, 2, 2);
+ contents$0.push(Binary$dump32bitNumberList$ANLCompressionReport$(this$0._v, report));
+ return contents$0.join('');
+};
+
+/**
+ * class Section extends Metadata
+ * @constructor
+ */
+function Section() {
+}
+
+Section.prototype = new Metadata;
+/**
+ * @constructor
+ * @param {Oktavia} parent
+ */
+function Section$LOktavia$(parent) {
+ this._parent = parent;
+ this._bitVector = new BitVector$();
+ this._names = [ ];
+};
+
+Section$LOktavia$.prototype = new Section;
+
+/**
+ * @param {!string} name
+ */
+Section.prototype.setTail$S = function (name) {
+ /** @type {!number} */
+ var index$0;
+ /** @type {Oktavia} */
+ var this$0;
+ /** @type {FMIndex} */
+ var this$0$0;
+ this$0 = this._parent;
+ this$0$0 = this$0._fmindex;
+ index$0 = this$0$0._substr.length;
+ this._names.push(name);
+ this._bitVector.set$I(index$0 - 1);
+};
+
+/**
+ * @param {!string} name
+ * @param {!number} index
+ */
+Section.prototype.setTail$SI = function (name, index) {
+ this._names.push(name);
+ this._bitVector.set$I(index - 1);
+};
+
+/**
+ * @return {!number}
+ */
+Section.prototype.size$ = function () {
+ return (this._names.length | 0);
+};
+
+/**
+ * @param {!number} position
+ * @return {!number}
+ */
+Section.prototype.getSectionIndex$I = function (position) {
+ /** @type {BitVector} */
+ var this$0;
+ if (position < 0 || this._bitVector.size$() <= position) {
+ throw new Error("Section.getSectionIndex() : range error " + (position + ""));
+ }
+ this$0 = this._bitVector;
+ return this$0.rank$IB(position, true);
+};
+
+/**
+ * @param {!number} index
+ * @return {!string}
+ */
+Section.prototype.getName$I = function (index) {
+ if (index < 0 || this._names.length <= index) {
+ throw new Error("Section.getName() : range error");
+ }
+ return this._names[index];
+};
+
+/**
+ * @param {SingleResult} result
+ * @param {Array.<undefined|!number>} positions
+ * @param {!string} word
+ * @param {!boolean} stemmed
+ */
+Section.prototype.grouping$LSingleResult$AISB = function (result, positions, word, stemmed) {
+ /** @type {!number} */
+ var i;
+ /** @type {undefined|!number} */
+ var position;
+ /** @type {!number} */
+ var index;
+ /** @type {SearchUnit} */
+ var unit;
+ for (i = 0; i < positions.length; i++) {
+ position = positions[i];
+ index = this.getSectionIndex$I(position);
+ unit = SingleResult$getSearchUnit$LSingleResult$I(result, index);
+ if (unit.startPosition < 0) {
+ unit.startPosition = this.getStartPosition$I(index);
+ }
+ SearchUnit$addPosition$LSearchUnit$SIB(unit, word, position - unit.startPosition, stemmed);
+ }
+};
+
+/**
+ * @param {!number} index
+ * @return {!string}
+ */
+Section.prototype.getInformation$I = function (index) {
+ return this.getName$I(index);
+};
+
+/**
+ * @param {Oktavia} parent
+ * @param {!string} name
+ * @param {!string} data
+ * @param {!number} offset
+ * @return {!number}
+ */
+Section._load$LOktavia$SSI = function (parent, name, data, offset) {
+ /** @type {LoadedStringListResult} */
+ var strs;
+ /** @type {Section} */
+ var section;
+ /** @type {!number} */
+ var offset$0;
+ strs = new LoadedStringListResult$SI(data, offset);
+ section = new Section$LOktavia$(parent);
+ section._names = strs.result;
+ offset$0 = strs.offset;
+ offset$0 = section._bitVector.load$SI(data, offset$0);
+ section._parent._metadataLabels.push(name);
+ section._parent._metadatas[name] = section;
+ return offset$0;
+};
+
+var Section$_load$LOktavia$SSI = Section._load$LOktavia$SSI;
+
+/**
+ * @return {!string}
+ */
+Section.prototype._dump$ = function () {
+ return [ Binary$dump16bitNumber$I(0), Binary$dumpStringList$AS(this._names), Metadata.prototype._dump$.call(this) ].join('');
+};
+
+/**
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+Section.prototype._dump$LCompressionReport$ = function (report) {
+ CompressionReport$add$LCompressionReport$II(report, 1, 1);
+ return [ Binary$dump16bitNumber$I(0), Binary$dumpStringList$ASLCompressionReport$(this._names, report), Metadata.prototype._dump$LCompressionReport$.call(this, report) ].join('');
+};
+
+/**
+ * class Splitter extends Metadata
+ * @constructor
+ */
+function Splitter() {
+}
+
+Splitter.prototype = new Metadata;
+/**
+ * @constructor
+ * @param {Oktavia} parent
+ */
+function Splitter$LOktavia$(parent) {
+ this._parent = parent;
+ this._bitVector = new BitVector$();
+ this.name = null;
+};
+
+Splitter$LOktavia$.prototype = new Splitter;
+
+/**
+ * @constructor
+ * @param {Oktavia} parent
+ * @param {!string} name
+ */
+function Splitter$LOktavia$S(parent, name) {
+ this._parent = parent;
+ this._bitVector = new BitVector$();
+ this.name = name;
+};
+
+Splitter$LOktavia$S.prototype = new Splitter;
+
+/**
+ * @return {!number}
+ */
+Splitter.prototype.size$ = function () {
+ /** @type {BitVector} */
+ var this$0$0;
+ /** @type {!number} */
+ var i$0$0;
+ /** @type {BitVector} */
+ var _bitVector$0;
+ this$0$0 = _bitVector$0 = this._bitVector;
+ i$0$0 = _bitVector$0._size;
+ return this$0$0.rank$IB(i$0$0, true);
+};
+
+/**
+ */
+Splitter.prototype.split$ = function () {
+ /** @type {!number} */
+ var index$0;
+ /** @type {Oktavia} */
+ var this$0;
+ /** @type {FMIndex} */
+ var this$0$0;
+ this$0 = this._parent;
+ this$0$0 = this$0._fmindex;
+ index$0 = this$0$0._substr.length;
+ this._bitVector.set$I(index$0 - 1);
+};
+
+/**
+ * @param {!number} index
+ */
+Splitter.prototype.split$I = function (index) {
+ this._bitVector.set$I(index - 1);
+};
+
+/**
+ * @param {!number} position
+ * @return {!number}
+ */
+Splitter.prototype.getIndex$I = function (position) {
+ /** @type {BitVector} */
+ var this$0;
+ if (position < 0 || this._bitVector.size$() <= position) {
+ throw new Error("Section.getSectionIndex() : range error");
+ }
+ this$0 = this._bitVector;
+ return this$0.rank$IB(position, true);
+};
+
+/**
+ * @param {SingleResult} result
+ * @param {Array.<undefined|!number>} positions
+ * @param {!string} word
+ * @param {!boolean} stemmed
+ */
+Splitter.prototype.grouping$LSingleResult$AISB = function (result, positions, word, stemmed) {
+ /** @type {!number} */
+ var i;
+ /** @type {undefined|!number} */
+ var position;
+ /** @type {!number} */
+ var index;
+ /** @type {SearchUnit} */
+ var unit;
+ for (i = 0; i < positions.length; i++) {
+ position = positions[i];
+ index = this.getIndex$I(position);
+ unit = SingleResult$getSearchUnit$LSingleResult$I(result, index);
+ if (unit.startPosition < 0) {
+ unit.startPosition = this.getStartPosition$I(index);
+ }
+ SearchUnit$addPosition$LSearchUnit$SIB(unit, word, position - unit.startPosition, stemmed);
+ }
+};
+
+/**
+ * @param {!number} index
+ * @return {!string}
+ */
+Splitter.prototype.getInformation$I = function (index) {
+ return (this.name != null ? this.name + (index + 1 + "") : '');
+};
+
+/**
+ * @param {Oktavia} parent
+ * @param {!string} name
+ * @param {!string} data
+ * @param {!number} offset
+ * @return {!number}
+ */
+Splitter._load$LOktavia$SSI = function (parent, name, data, offset) {
+ /** @type {Splitter} */
+ var section;
+ section = new Splitter$LOktavia$(parent);
+ offset = section._bitVector.load$SI(data, offset);
+ section._parent._metadataLabels.push(name);
+ section._parent._metadatas[name] = section;
+ return offset;
+};
+
+var Splitter$_load$LOktavia$SSI = Splitter._load$LOktavia$SSI;
+
+/**
+ * @return {!string}
+ */
+Splitter.prototype._dump$ = function () {
+ return [ Binary$dump16bitNumber$I(1), Metadata.prototype._dump$.call(this) ].join('');
+};
+
+/**
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+Splitter.prototype._dump$LCompressionReport$ = function (report) {
+ CompressionReport$add$LCompressionReport$II(report, 1, 1);
+ return [ Binary$dump16bitNumber$I(1), Metadata.prototype._dump$LCompressionReport$.call(this, report) ].join('');
+};
+
+/**
+ * class Table extends Metadata
+ * @constructor
+ */
+function Table() {
+}
+
+Table.prototype = new Metadata;
+/**
+ * @constructor
+ * @param {Oktavia} parent
+ * @param {Array.<undefined|!string>} headers
+ */
+function Table$LOktavia$AS(parent, headers) {
+ this._parent = parent;
+ this._bitVector = new BitVector$();
+ this._headers = headers;
+ this._columnTails = new BitVector$();
+};
+
+Table$LOktavia$AS.prototype = new Table;
+
+/**
+ * @return {!number}
+ */
+Table.prototype.rowSize$ = function () {
+ /** @type {BitVector} */
+ var this$0$0;
+ /** @type {!number} */
+ var i$0$0;
+ /** @type {BitVector} */
+ var _bitVector$0;
+ this$0$0 = _bitVector$0 = this._bitVector;
+ i$0$0 = _bitVector$0._size;
+ return this$0$0.rank$IB(i$0$0, true);
+};
+
+/**
+ * @return {!number}
+ */
+Table.prototype.columnSize$ = function () {
+ return (this._headers.length | 0);
+};
+
+/**
+ */
+Table.prototype.setColumnTail$ = function () {
+ /** @type {!number} */
+ var index;
+ /** @type {Oktavia} */
+ var this$0;
+ /** @type {FMIndex} */
+ var this$0$0;
+ /** @type {Oktavia} */
+ var _parent$0;
+ this$0 = _parent$0 = this._parent;
+ this$0$0 = this$0._fmindex;
+ index = this$0$0._substr.length;
+ _parent$0._fmindex.push$S(Oktavia.eob);
+ this._columnTails.set$I(index - 1);
+};
+
+/**
+ */
+Table.prototype.setRowTail$ = function () {
+ /** @type {!number} */
+ var index;
+ /** @type {Oktavia} */
+ var this$0;
+ /** @type {FMIndex} */
+ var this$0$0;
+ this$0 = this._parent;
+ this$0$0 = this$0._fmindex;
+ index = this$0$0._substr.length;
+ this._bitVector.set$I(index - 1);
+};
+
+/**
+ * @param {!number} position
+ * @return {Array.<undefined|!number>}
+ */
+Table.prototype.getCell$I = function (position) {
+ /** @type {!number} */
+ var row;
+ /** @type {!number} */
+ var currentColumn;
+ /** @type {!number} */
+ var lastRowColumn;
+ /** @type {!number} */
+ var startPosition;
+ /** @type {Array.<undefined|!number>} */
+ var result;
+ /** @type {BitVector} */
+ var this$0;
+ /** @type {BitVector} */
+ var this$1;
+ if (position < 0 || this._bitVector.size$() <= position) {
+ throw new Error("Section.getSectionIndex() : range error " + (position + ""));
+ }
+ this$0 = this._bitVector;
+ row = this$0.rank$IB(position, true);
+ this$1 = this._columnTails;
+ currentColumn = this$1.rank$IB(position, true);
+ lastRowColumn = 0;
+ if (row > 0) {
+ startPosition = this._bitVector.select$I(row - 1) + 1;
+ lastRowColumn = this._columnTails.rank$I(startPosition);
+ }
+ result = [ row, currentColumn - lastRowColumn ];
+ return result;
+};
+
+/**
+ * @param {!number} rowIndex
+ * @return {Object.<string, undefined|!string>}
+ */
+Table.prototype.getRowContent$I = function (rowIndex) {
+ /** @type {!string} */
+ var content;
+ /** @type {Array.<undefined|!string>} */
+ var values;
+ /** @type {Object.<string, undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var i;
+ content = this.getContent$I(rowIndex);
+ values = content.split(Oktavia.eob, this._headers.length);
+ result = ({ });
+ for (i in this._headers) {
+ if (i < values.length) {
+ result[this._headers[i]] = values[i];
+ } else {
+ result[this._headers[i]] = '';
+ }
+ }
+ return result;
+};
+
+/**
+ * @param {SingleResult} result
+ * @param {Array.<undefined|!number>} positions
+ * @param {!string} word
+ * @param {!boolean} stemmed
+ */
+Table.prototype.grouping$LSingleResult$AISB = function (result, positions, word, stemmed) {
+};
+
+/**
+ * @param {!number} index
+ * @return {!string}
+ */
+Table.prototype.getInformation$I = function (index) {
+ return '';
+};
+
+/**
+ */
+Table.prototype._build$ = function () {
+ this._bitVector.build$();
+ this._columnTails.build$();
+};
+
+/**
+ * @param {Oktavia} parent
+ * @param {!string} name
+ * @param {!string} data
+ * @param {!number} offset
+ * @return {!number}
+ */
+Table._load$LOktavia$SSI = function (parent, name, data, offset) {
+ /** @type {LoadedStringListResult} */
+ var strs;
+ /** @type {Table} */
+ var table;
+ /** @type {!number} */
+ var offset$0;
+ strs = new LoadedStringListResult$SI(data, offset);
+ table = new Table$LOktavia$AS(parent, strs.result);
+ offset$0 = strs.offset;
+ offset$0 = table._bitVector.load$SI(data, offset$0);
+ table._parent._metadataLabels.push(name);
+ table._parent._metadatas[name] = table;
+ offset = offset$0;
+ return table._columnTails.load$SI(data, offset$0);
+};
+
+var Table$_load$LOktavia$SSI = Table._load$LOktavia$SSI;
+
+/**
+ * @return {!string}
+ */
+Table.prototype._dump$ = function () {
+ return [ Binary$dump16bitNumber$I(2), Binary$dumpStringList$AS(this._headers), Metadata.prototype._dump$.call(this), this._columnTails.dump$() ].join('');
+};
+
+/**
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+Table.prototype._dump$LCompressionReport$ = function (report) {
+ CompressionReport$add$LCompressionReport$II(report, 1, 1);
+ return [ Binary$dump16bitNumber$I(2), Binary$dumpStringList$ASLCompressionReport$(this._headers, report), Metadata.prototype._dump$LCompressionReport$.call(this, report), this._columnTails.dump$LCompressionReport$(report) ].join('');
+};
+
+/**
+ * class Block extends Metadata
+ * @constructor
+ */
+function Block() {
+}
+
+Block.prototype = new Metadata;
+/**
+ * @constructor
+ * @param {Oktavia} parent
+ */
+function Block$LOktavia$(parent) {
+ this._parent = parent;
+ this._bitVector = new BitVector$();
+ this._names = [ ];
+ this._start = false;
+};
+
+Block$LOktavia$.prototype = new Block;
+
+/**
+ * @param {!string} blockName
+ */
+Block.prototype.startBlock$S = function (blockName) {
+ this.startBlock$SI(blockName, this._parent.contentSize$());
+};
+
+/**
+ * @param {!string} blockName
+ * @param {!number} index
+ */
+Block.prototype.startBlock$SI = function (blockName, index) {
+ if (this._start) {
+ throw new Error('Splitter `' + this._names[this._names.length - 1] + '` is not closed');
+ }
+ this._start = true;
+ this._names.push(blockName);
+ this._bitVector.set$I(index - 1);
+};
+
+/**
+ */
+Block.prototype.endBlock$ = function () {
+ this.endBlock$I(this._parent.contentSize$());
+};
+
+/**
+ * @param {!number} index
+ */
+Block.prototype.endBlock$I = function (index) {
+ if (! this._start) {
+ throw new Error('Splitter is not started');
+ }
+ this._start = false;
+ this._bitVector.set$I(index - 1);
+};
+
+/**
+ * @return {!number}
+ */
+Block.prototype.size$ = function () {
+ return (this._names.length | 0);
+};
+
+/**
+ * @param {!number} position
+ * @return {!number}
+ */
+Block.prototype.blockIndex$I = function (position) {
+ /** @type {!number} */
+ var result;
+ /** @type {BitVector} */
+ var this$0;
+ if (position < 0 || this._parent._fmindex.size$() - 1 <= position) {
+ throw new Error("Block.blockIndex() : range error " + (position + ""));
+ }
+ if (position >= this._bitVector.size$()) {
+ position = (this._bitVector.size$() - 1 | 0);
+ result = (this._bitVector.rank$I(position) + 1 | 0);
+ } else {
+ this$0 = this._bitVector;
+ result = this$0.rank$IB(position, true);
+ }
+ return result;
+};
+
+/**
+ * @param {!number} position
+ * @return {!boolean}
+ */
+Block.prototype.inBlock$I = function (position) {
+ /** @type {!number} */
+ var blockIndex;
+ blockIndex = this.blockIndex$I(position);
+ return blockIndex % 2 !== 0;
+};
+
+/**
+ * @param {!number} position
+ * @return {!string}
+ */
+Block.prototype.getBlockContent$I = function (position) {
+ /** @type {!number} */
+ var blockIndex;
+ /** @type {!string} */
+ var result;
+ blockIndex = this.blockIndex$I(position);
+ if (blockIndex % 2 !== 0) {
+ result = this.getContent$I(blockIndex);
+ } else {
+ result = '';
+ }
+ return result;
+};
+
+/**
+ * @param {!number} position
+ * @return {!string}
+ */
+Block.prototype.getBlockName$I = function (position) {
+ /** @type {!number} */
+ var blockIndex;
+ /** @type {!string} */
+ var result;
+ blockIndex = this.blockIndex$I(position);
+ if (blockIndex % 2 !== 0) {
+ result = this._names[blockIndex >>> 1];
+ } else {
+ result = '';
+ }
+ return result;
+};
+
+/**
+ * @param {SingleResult} result
+ * @param {Array.<undefined|!number>} positions
+ * @param {!string} word
+ * @param {!boolean} stemmed
+ */
+Block.prototype.grouping$LSingleResult$AISB = function (result, positions, word, stemmed) {
+};
+
+/**
+ * @param {!number} index
+ * @return {!string}
+ */
+Block.prototype.getInformation$I = function (index) {
+ return '';
+};
+
+/**
+ * @param {Oktavia} parent
+ * @param {!string} name
+ * @param {!string} data
+ * @param {!number} offset
+ * @return {!number}
+ */
+Block._load$LOktavia$SSI = function (parent, name, data, offset) {
+ /** @type {LoadedStringListResult} */
+ var strs;
+ /** @type {Block} */
+ var block;
+ /** @type {!number} */
+ var offset$0;
+ strs = new LoadedStringListResult$SI(data, offset);
+ block = new Block$LOktavia$(parent);
+ block._names = strs.result;
+ offset$0 = strs.offset;
+ offset$0 = block._bitVector.load$SI(data, offset$0);
+ block._parent._metadataLabels.push(name);
+ block._parent._metadatas[name] = block;
+ return offset$0;
+};
+
+var Block$_load$LOktavia$SSI = Block._load$LOktavia$SSI;
+
+/**
+ * @return {!string}
+ */
+Block.prototype._dump$ = function () {
+ return [ Binary$dump16bitNumber$I(3), Binary$dumpStringList$AS(this._names), Metadata.prototype._dump$.call(this) ].join('');
+};
+
+/**
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+Block.prototype._dump$LCompressionReport$ = function (report) {
+ CompressionReport$add$LCompressionReport$II(report, 1, 1);
+ return [ Binary$dump16bitNumber$I(3), Binary$dumpStringList$ASLCompressionReport$(this._names, report), Metadata.prototype._dump$LCompressionReport$.call(this, report) ].join('');
+};
+
+/**
+ * class FMIndex extends Object
+ * @constructor
+ */
+function FMIndex() {
+}
+
+/**
+ * @constructor
+ */
+function FMIndex$() {
+ /** @type {Array.<undefined|!number>} */
+ var _rlt$0;
+ this._ssize = 0;
+ (this._ddic = 0, this._head = 0);
+ this._substr = "";
+ this._sv = new WaveletMatrix$();
+ this._posdic = [ ];
+ this._idic = [ ];
+ _rlt$0 = this._rlt = [ ];
+ _rlt$0.length = 65536;
+};
+
+FMIndex$.prototype = new FMIndex;
+
+/**
+ */
+FMIndex.prototype.clear$ = function () {
+ /** @type {WaveletMatrix} */
+ var this$0;
+ this$0 = this._sv;
+ this$0._bv.length = 0;
+ this$0._seps.length = 0;
+ this$0._size = 0;
+ this._posdic.length = 0;
+ this._idic.length = 0;
+ this._ddic = 0;
+ this._head = 0;
+ this._substr = "";
+};
+
+/**
+ * @return {!number}
+ */
+FMIndex.prototype.size$ = function () {
+ /** @type {WaveletMatrix} */
+ var this$0;
+ this$0 = this._sv;
+ return this$0._size;
+};
+
+/**
+ * @return {!number}
+ */
+FMIndex.prototype.contentSize$ = function () {
+ return this._substr.length;
+};
+
+/**
+ * @param {!string} key
+ * @return {!number}
+ */
+FMIndex.prototype.getRows$S = function (key) {
+ /** @type {Array.<undefined|!number>} */
+ var pos;
+ pos = [ ];
+ return this.getRows$SAI(key, pos);
+};
+
+/**
+ * @param {!string} key
+ * @param {Array.<undefined|!number>} pos
+ * @return {!number}
+ */
+FMIndex.prototype.getRows$SAI = function (key, pos) {
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var code;
+ /** @type {!number} */
+ var first;
+ /** @type {undefined|!number} */
+ var last;
+ /** @type {!number} */
+ var c;
+ /** @type {Array.<undefined|!number>} */
+ var _rlt$0;
+ i = key.length - 1;
+ code = key.charCodeAt(i);
+ first = (_rlt$0 = this._rlt)[code] + 1;
+ last = _rlt$0[code + 1];
+ while (first <= last) {
+ if (i === 0) {
+ pos[0] = (-- first | 0);
+ pos[1] = -- last;
+ return (last - first + 1 | 0);
+ }
+ i--;
+ c = key.charCodeAt(i);
+ first = this._rlt[c] + this._sv.rank$II(first - 1, c) + 1;
+ last = this._rlt[c] + this._sv.rank$II(last, c);
+ }
+ return 0;
+};
+
+/**
+ * @param {!number} i
+ * @return {!number}
+ */
+FMIndex.prototype.getPosition$I = function (i) {
+ /** @type {!number} */
+ var pos;
+ /** @type {!number} */
+ var c;
+ if (i >= this.size$()) {
+ throw new Error("FMIndex.getPosition() : range error");
+ }
+ pos = 0;
+ while (i !== this._head) {
+ if (i % this._ddic === 0) {
+ pos += this._posdic[i / this._ddic] + 1;
+ break;
+ }
+ c = this._sv.get$I(i);
+ i = this._rlt[c] + this._sv.rank$II(i, c);
+ pos++;
+ }
+ return (pos % this.size$() | 0);
+};
+
+/**
+ * @param {!number} pos
+ * @param {!number} len
+ * @return {!string}
+ */
+FMIndex.prototype.getSubstring$II = function (pos, len) {
+ /** @type {!number} */
+ var pos_end;
+ /** @type {!number} */
+ var pos_tmp;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var pos_idic;
+ /** @type {!string} */
+ var substr;
+ /** @type {!number} */
+ var c;
+ /** @type {!number} */
+ var _ddic$0;
+ if (pos >= this.size$()) {
+ throw new Error("FMIndex.getSubstring() : range error");
+ }
+ pos_end = Math.min(pos + len, this.size$());
+ pos_tmp = this.size$() - 1;
+ i = this._head;
+ pos_idic = Math.floor((pos_end + (_ddic$0 = this._ddic) - 2) / _ddic$0);
+ if (pos_idic < this._idic.length) {
+ pos_tmp = pos_idic * this._ddic;
+ i = this._idic[pos_idic];
+ }
+ substr = "";
+ while (pos_tmp >= pos) {
+ c = this._sv.get$I(i);
+ i = this._rlt[c] + this._sv.rank$II(i, c);
+ if (pos_tmp < pos_end) {
+ substr = String.fromCharCode(c) + substr;
+ }
+ if (pos_tmp === 0) {
+ break;
+ }
+ pos_tmp--;
+ }
+ return substr;
+};
+
+/**
+ */
+FMIndex.prototype.build$ = function () {
+ this.build$SIIB(String.fromCharCode(0), 65535, 20, false);
+};
+
+/**
+ * @param {!string} end_marker
+ * @param {!number} ddic
+ * @param {!boolean} verbose
+ */
+FMIndex.prototype.build$SIB = function (end_marker, ddic, verbose) {
+ this.build$SIIB(end_marker, 65535, ddic, verbose);
+};
+
+/**
+ * @param {!string} end_marker
+ * @param {!number} maxChar
+ * @param {!number} ddic
+ * @param {!boolean} verbose
+ */
+FMIndex.prototype.build$SIIB = function (end_marker, maxChar, ddic, verbose) {
+ /** @type {BurrowsWheelerTransform} */
+ var b;
+ /** @type {!string} */
+ var s;
+ /** @type {!number} */
+ var c;
+ /** @type {!string} */
+ var str$0;
+ /** @type {WaveletMatrix} */
+ var this$0;
+ /** @type {!string} */
+ var _str$0;
+ /** @type {Array.<undefined|!number>} */
+ var _suffixarray$0;
+ if (verbose) {
+ console.time("building burrows-wheeler transform");
+ }
+ this._substr += end_marker;
+ b = ({_str: "", _size: 0, _head: 0, _suffixarray: [ ]});
+ str$0 = this._substr;
+ _str$0 = b._str = str$0;
+ b._size = _str$0.length;
+ _suffixarray$0 = b._suffixarray = SAIS$make$S(str$0);
+ b._head = (_suffixarray$0.indexOf(0) | 0);
+ s = BurrowsWheelerTransform$get$LBurrowsWheelerTransform$(b);
+ this._ssize = s.length;
+ this._head = b._head;
+ b._str = "";
+ b._size = 0;
+ b._head = 0;
+ b._suffixarray.length = 0;
+ this._substr = "";
+ if (verbose) {
+ console.timeEnd("building burrows-wheeler transform");
+ }
+ if (verbose) {
+ console.time("building wavelet matrix");
+ }
+ this$0 = this._sv;
+ this$0._bitsize = (Math.ceil(Math.log(maxChar) / 0.6931471805599453) | 0);
+ if (verbose) {
+ console.log(" maxCharCode: ", maxChar);
+ console.log(" bitSize: ", this._sv.bitsize$());
+ }
+ this._sv.build$S(s);
+ if (verbose) {
+ console.timeEnd("building wavelet matrix");
+ }
+ if (verbose) {
+ console.time("caching rank less than");
+ }
+ for (c = 0; c < maxChar; c++) {
+ this._rlt[c] = this._sv.rank_less_than$II(this._sv.size$(), c);
+ }
+ if (verbose) {
+ console.timeEnd("caching rank less than");
+ }
+ this._ddic = ddic;
+ if (verbose) {
+ console.time("building dictionaries");
+ }
+ this._buildDictionaries$();
+ if (verbose) {
+ console.timeEnd("building dictionaries");
+ console.log('');
+ }
+};
+
+/**
+ */
+FMIndex.prototype._buildDictionaries$ = function () {
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var pos;
+ /** @type {!number} */
+ var c;
+ for (i = 0; i < this._ssize / this._ddic + 1; i++) {
+ this._posdic.push(0);
+ this._idic.push(0);
+ }
+ i = this._head;
+ pos = this.size$() - 1;
+ do {
+ if (i % this._ddic === 0) {
+ this._posdic[Math.floor(i / this._ddic)] = (pos | 0);
+ }
+ if (pos % this._ddic === 0) {
+ this._idic[Math.floor(pos / this._ddic)] = (i | 0);
+ }
+ c = this._sv.get$I(i);
+ i = this._rlt[c] + this._sv.rank$II(i, c);
+ pos--;
+ } while (i !== this._head);
+};
+
+/**
+ * @param {!string} doc
+ */
+FMIndex.prototype.push$S = function (doc) {
+ if (doc.length <= 0) {
+ throw new Error("FMIndex::push(): empty string");
+ }
+ this._substr += doc;
+};
+
+/**
+ * @param {!string} keyword
+ * @return {Array.<undefined|!number>}
+ */
+FMIndex.prototype.search$S = function (keyword) {
+ /** @type {Array.<undefined|!number>} */
+ var result;
+ /** @type {Array.<undefined|!number>} */
+ var position;
+ /** @type {!number} */
+ var rows;
+ /** @type {undefined|!number} */
+ var first;
+ /** @type {undefined|!number} */
+ var last;
+ /** @type {undefined|!number} */
+ var i;
+ result = [ ];
+ position = [ ];
+ rows = this.getRows$SAI(keyword, position);
+ if (rows > 0) {
+ first = position[0];
+ last = position[1];
+ for (i = first; i <= last; i++) {
+ result.push(this.getPosition$I(i));
+ }
+ }
+ return result;
+};
+
+/**
+ * @return {!string}
+ */
+FMIndex.prototype.dump$ = function () {
+ return this.dump$B(false);
+};
+
+/**
+ * @param {!boolean} verbose
+ * @return {!string}
+ */
+FMIndex.prototype.dump$B = function (verbose) {
+ /** @type {Array.<undefined|!string>} */
+ var contents;
+ /** @type {CompressionReport} */
+ var report;
+ /** @type {!number} */
+ var i;
+ contents = [ ];
+ report = ({source: 0, result: 0});
+ contents.push(Binary$dump32bitNumber$N(this._ddic));
+ contents.push(Binary$dump32bitNumber$N(this._ssize));
+ contents.push(Binary$dump32bitNumber$N(this._head));
+ CompressionReport$add$LCompressionReport$II(report, 6, 6);
+ contents.push(this._sv.dump$LCompressionReport$(report));
+ if (verbose) {
+ console.log("Serializing FM-index");
+ console.log(' Wavelet Matrix: ' + (contents[3].length * 2 + "") + ' bytes (' + (Math.round(report.result * 100.0 / report.source) + "") + '%)');
+ }
+ contents.push(Binary$dump32bitNumber$N(this._posdic.length));
+ for (i in this._posdic) {
+ contents.push(Binary$dump32bitNumber$N(this._posdic[i]));
+ }
+ for (i in this._idic) {
+ contents.push(Binary$dump32bitNumber$N(this._idic[i]));
+ }
+ if (verbose) {
+ console.log(' Dictionary Cache: ' + (this._idic.length * 16 + "") + ' bytes');
+ }
+ return contents.join("");
+};
+
+/**
+ * @param {!string} data
+ * @return {!number}
+ */
+FMIndex.prototype.load$S = function (data) {
+ return this.load$SI(data, 0);
+};
+
+/**
+ * @param {!string} data
+ * @param {!number} offset
+ * @return {!number}
+ */
+FMIndex.prototype.load$SI = function (data, offset) {
+ /** @type {!number} */
+ var maxChar;
+ /** @type {!number} */
+ var c;
+ /** @type {!number} */
+ var size;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var result$0;
+ /** @type {!number} */
+ var result$1;
+ result$0 = data.charCodeAt(offset) * 65536 + data.charCodeAt(offset + 1);
+ this._ddic = (result$0 | 0);
+ this._ssize = (Binary$load32bitNumber$SI(data, offset + 2) | 0);
+ this._head = (Binary$load32bitNumber$SI(data, offset + 4) | 0);
+ offset = this._sv.load$SI(data, offset + 6);
+ maxChar = Math.pow(2, this._sv.bitsize$());
+ for (c = 0; c < maxChar; c++) {
+ this._rlt[c] = this._sv.rank_less_than$II(this._sv.size$(), c);
+ }
+ result$1 = data.charCodeAt(offset) * 65536 + data.charCodeAt(offset + 1);
+ size = result$1;
+ offset += 2;
+ for (i = 0; i < size; (i++, offset += 2)) {
+ this._posdic.push(Binary$load32bitNumber$SI(data, offset));
+ }
+ for (i = 0; i < size; (i++, offset += 2)) {
+ this._idic.push(Binary$load32bitNumber$SI(data, offset));
+ }
+ return offset;
+};
+
+/**
+ * class Tag extends Object
+ * @constructor
+ */
+function Tag() {
+}
+
+/**
+ * @constructor
+ * @param {!string} name
+ */
+function Tag$S(name) {
+ this.name = name;
+ this.attributes = ({ });
+ this.isSelfClosing = false;
+};
+
+Tag$S.prototype = new Tag;
+
+/**
+ * class _Common extends Object
+ * @constructor
+ */
+function _Common() {
+}
+
+/**
+ * @constructor
+ */
+function _Common$() {
+};
+
+_Common$.prototype = new _Common;
+
+/**
+ * class _State extends Object
+ * @constructor
+ */
+function _State() {
+}
+
+/**
+ * @constructor
+ */
+function _State$() {
+};
+
+_State$.prototype = new _State;
+
+/**
+ * class SAXHandler extends Object
+ * @constructor
+ */
+function SAXHandler() {
+}
+
+/**
+ * @constructor
+ */
+function SAXHandler$() {
+ this.position = 0;
+ this.column = 0;
+ this.line = 0;
+};
+
+SAXHandler$.prototype = new SAXHandler;
+
+/**
+ * @param {Error} error
+ */
+SAXHandler.prototype.onerror$LError$ = function (error) {
+};
+
+/**
+ * @param {!string} text
+ */
+SAXHandler.prototype.ontext$S = function (text) {
+};
+
+/**
+ * @param {!string} doctype
+ */
+SAXHandler.prototype.ondoctype$S = function (doctype) {
+};
+
+/**
+ * @param {!string} name
+ * @param {!string} body
+ */
+SAXHandler.prototype.onprocessinginstruction$SS = function (name, body) {
+};
+
+/**
+ * @param {!string} sgmlDecl
+ */
+SAXHandler.prototype.onsgmldeclaration$S = function (sgmlDecl) {
+};
+
+/**
+ * @param {!string} tagname
+ * @param {Object.<string, undefined|!string>} attributes
+ */
+SAXHandler.prototype.onopentag$SHS = function (tagname, attributes) {
+};
+
+/**
+ * @param {!string} tagname
+ */
+SAXHandler.prototype.onclosetag$S = function (tagname) {
+};
+
+/**
+ * @param {!string} name
+ * @param {!string} value
+ */
+SAXHandler.prototype.onattribute$SS = function (name, value) {
+};
+
+/**
+ * @param {!string} comment
+ */
+SAXHandler.prototype.oncomment$S = function (comment) {
+};
+
+/**
+ */
+SAXHandler.prototype.onopencdata$ = function () {
+};
+
+/**
+ * @param {!string} cdata
+ */
+SAXHandler.prototype.oncdata$S = function (cdata) {
+};
+
+/**
+ */
+SAXHandler.prototype.onclosecdata$ = function () {
+};
+
+/**
+ */
+SAXHandler.prototype.onend$ = function () {
+};
+
+/**
+ */
+SAXHandler.prototype.onready$ = function () {
+};
+
+/**
+ * @param {!string} script
+ */
+SAXHandler.prototype.onscript$S = function (script) {
+};
+
+/**
+ * class _HTMLHandler extends SAXHandler
+ * @constructor
+ */
+function _HTMLHandler() {
+}
+
+_HTMLHandler.prototype = new SAXHandler;
+/**
+ * @constructor
+ * @param {Object.<string, undefined|Array.<undefined|!string>>} styles
+ * @param {!boolean} escape
+ */
+function _HTMLHandler$HASB(styles, escape) {
+ this.position = 0;
+ this.column = 0;
+ this.line = 0;
+ this.text = [ ];
+ this.escape = escape;
+ this.styles = styles;
+};
+
+_HTMLHandler$HASB.prototype = new _HTMLHandler;
+
+/**
+ * @param {!string} str
+ * @return {!string}
+ */
+_HTMLHandler.escapeHTML$S = function (str) {
+ return str.replace(/\n/g, "<br/>").replace(/&/g, "&amp;").replace(/"/g, "&quot;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
+};
+
+var _HTMLHandler$escapeHTML$S = _HTMLHandler.escapeHTML$S;
+
+/**
+ * @param {!string} tagname
+ * @param {Object.<string, undefined|!string>} attributes
+ */
+_HTMLHandler.prototype.onopentag$SHS = function (tagname, attributes) {
+ this.text.push(this.styles[tagname][0]);
+};
+
+/**
+ * @param {!string} tagname
+ */
+_HTMLHandler.prototype.onclosetag$S = function (tagname) {
+ this.text.push(this.styles[tagname][1]);
+};
+
+/**
+ * @param {!string} text
+ */
+_HTMLHandler.prototype.ontext$S = function (text) {
+ if (this.escape) {
+ this.text.push(text.replace(/\n/g, "<br/>").replace(/&/g, "&amp;").replace(/"/g, "&quot;").replace(/</g, "&lt;").replace(/>/g, "&gt;"));
+ } else {
+ this.text.push(text);
+ }
+};
+
+/**
+ * @return {!string}
+ */
+_HTMLHandler.prototype.result$ = function () {
+ return this.text.join('');
+};
+
+/**
+ * class SAXParser extends Object
+ * @constructor
+ */
+function SAXParser() {
+}
+
+/**
+ * @constructor
+ * @param {SAXHandler} handler
+ */
+function SAXParser$LSAXHandler$(handler) {
+ this.q = "";
+ this.c = "";
+ this.bufferCheckPosition = 0;
+ this.looseCase = "";
+ this.tags = [ ];
+ this.closed = false;
+ this.closedRoot = false;
+ this.sawRoot = false;
+ this.tag = null;
+ this.error = null;
+ this.handler = null;
+ this.ENTITIES = null;
+ this.strict = false;
+ this.tagName = "";
+ this.state = 0;
+ this.line = 0;
+ this.column = 0;
+ this.position = 0;
+ this.startTagPosition = 0;
+ this.attribName = "";
+ this.attribValue = "";
+ this.script = "";
+ this.textNode = "";
+ this.attribList = null;
+ this.noscript = false;
+ this.cdata = "";
+ this.procInstBody = "";
+ this.procInstName = "";
+ this.doctype = "";
+ this.entity = "";
+ this.sgmlDecl = "";
+ this.comment = "";
+ this.preTags = 0;
+ this._init$LSAXHandler$B(handler, false);
+};
+
+SAXParser$LSAXHandler$.prototype = new SAXParser;
+
+/**
+ * @constructor
+ * @param {SAXHandler} handler
+ * @param {!boolean} strict
+ */
+function SAXParser$LSAXHandler$B(handler, strict) {
+ this.q = "";
+ this.c = "";
+ this.bufferCheckPosition = 0;
+ this.looseCase = "";
+ this.tags = [ ];
+ this.closed = false;
+ this.closedRoot = false;
+ this.sawRoot = false;
+ this.tag = null;
+ this.error = null;
+ this.handler = null;
+ this.ENTITIES = null;
+ this.strict = false;
+ this.tagName = "";
+ this.state = 0;
+ this.line = 0;
+ this.column = 0;
+ this.position = 0;
+ this.startTagPosition = 0;
+ this.attribName = "";
+ this.attribValue = "";
+ this.script = "";
+ this.textNode = "";
+ this.attribList = null;
+ this.noscript = false;
+ this.cdata = "";
+ this.procInstBody = "";
+ this.procInstName = "";
+ this.doctype = "";
+ this.entity = "";
+ this.sgmlDecl = "";
+ this.comment = "";
+ this.preTags = 0;
+ this._init$LSAXHandler$B(handler, strict);
+};
+
+SAXParser$LSAXHandler$B.prototype = new SAXParser;
+
+/**
+ * @param {SAXHandler} handler
+ * @param {!boolean} strict
+ */
+SAXParser.prototype._init$LSAXHandler$B = function (handler, strict) {
+ this.handler = handler;
+ this.clearBuffers$();
+ this.q = "";
+ this.bufferCheckPosition = 65536;
+ this.looseCase = 'toLowerCase';
+ this.tags = [ ];
+ this.closed = this.closedRoot = this.sawRoot = false;
+ this.tag = null;
+ this.error = null;
+ this.strict = strict;
+ this.noscript = strict;
+ this.state = 1;
+ this.ENTITIES = _Entities$entity_list$();
+ this.attribList = [ ];
+ this.noscript = false;
+ this.preTags = 0;
+};
+
+/**
+ * @param {!boolean} flag
+ */
+SAXParser.prototype.set_noscript$B = function (flag) {
+ this.noscript = flag;
+};
+
+/**
+ * @return {SAXParser}
+ */
+SAXParser.prototype.resume$ = function () {
+ this.error = null;
+ return this;
+};
+
+/**
+ * @return {SAXParser}
+ */
+SAXParser.prototype.close$ = function () {
+ return this.parse$S('');
+};
+
+/**
+ * @param {!string} chunk
+ * @return {SAXParser}
+ */
+SAXParser.prototype.parse$S = function (chunk) {
+ /** @type {Char} */
+ var _;
+ /** @type {!number} */
+ var i;
+ /** @type {!string} */
+ var c;
+ /** @type {!number} */
+ var starti;
+ /** @type {!number} */
+ var pad;
+ /** @type {!number} */
+ var returnState;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$0;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$1;
+ /** @type {RegExp} */
+ var charclass$2;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$3;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$4;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$5;
+ /** @type {!string} */
+ var text$0;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$6;
+ /** @type {RegExp} */
+ var charclass$7;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$8;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$9;
+ /** @type {RegExp} */
+ var charclass$10;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$11;
+ /** @type {RegExp} */
+ var charclass$12;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$13;
+ /** @type {RegExp} */
+ var charclass$14;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$15;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$16;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$17;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$18;
+ /** @type {RegExp} */
+ var charclass$19;
+ /** @type {RegExp} */
+ var charclass$20;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$21;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$22;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$23;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$24;
+ /** @type {!string} */
+ var comment$0;
+ _ = new Char$();
+ if (this.error) {
+ throw this.error;
+ }
+ if (this.closed) {
+ return this.emiterror$S("Cannot write after close. Assign an onready handler.");
+ }
+ (i = 0, c = "");
+ while (this.c = c = chunk.charAt(i++)) {
+ this.position++;
+ if (c === "\n") {
+ this.handler.line++;
+ this.handler.column = 0;
+ } else {
+ this.handler.column++;
+ }
+ switch (this.state) {
+ case 1:
+ if (c === "<") {
+ this.state = 4;
+ this.startTagPosition = this.position;
+ } else {
+ charclass$0 = _.whitespace;
+ if (! $__jsx_ObjectHasOwnProperty.call(charclass$0, c)) {
+ this.strictFail$S("Non-whitespace before first tag.");
+ this.textNode = c;
+ this.state = 2;
+ }
+ }
+ continue;
+ case 2:
+ if (this.sawRoot && ! this.closedRoot) {
+ starti = i - 1;
+ while (c && c !== "<" && c !== "&") {
+ c = chunk.charAt(i++);
+ if (c) {
+ this.position++;
+ if (c === "\n") {
+ this.handler.line++;
+ this.handler.column = 0;
+ } else {
+ this.handler.column++;
+ }
+ }
+ }
+ this.textNode += chunk.substring(starti, i - 1);
+ }
+ if (c === "<") {
+ this.state = 4;
+ this.startTagPosition = this.position;
+ } else {
+ if (_.not$HBS(_.whitespace, c) && (! this.sawRoot || this.closedRoot)) {
+ this.strictFail$S("Text data outside of root node.");
+ }
+ if (c === "&") {
+ this.state = 3;
+ } else {
+ this.textNode += c;
+ }
+ }
+ continue;
+ case 33:
+ if (c === "<") {
+ this.state = 34;
+ } else {
+ this.script += c;
+ }
+ continue;
+ case 34:
+ if (c === "/") {
+ this.state = 31;
+ } else {
+ this.script += "<" + c;
+ this.state = 33;
+ }
+ continue;
+ case 4:
+ if (c === "!") {
+ this.state = 5;
+ this.sgmlDecl = "";
+ } else {
+ charclass$1 = _.whitespace;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$1, c)) {
+ } else {
+ charclass$2 = _.nameStart;
+ if (charclass$2.test(c)) {
+ this.state = 21;
+ this.tagName = c;
+ } else {
+ if (c === "/") {
+ this.state = 31;
+ this.tagName = "";
+ } else {
+ if (c === "?") {
+ this.state = 18;
+ this.procInstName = this.procInstBody = "";
+ } else {
+ this.strictFail$S("Unencoded <");
+ if (this.startTagPosition + 1 < this.position) {
+ pad = this.position - this.startTagPosition;
+ for (i = 0; i < pad; i++) {
+ c = " " + c;
+ }
+ }
+ this.textNode += "<" + c;
+ this.state = 2;
+ }
+ }
+ }
+ }
+ }
+ continue;
+ case 5:
+ if ((this.sgmlDecl + c).toUpperCase() === _.CDATA) {
+ this.closetext_if_exist$();
+ this.state = 15;
+ this.sgmlDecl = "";
+ this.cdata = "";
+ } else {
+ if (this.sgmlDecl + c === "--") {
+ this.state = 12;
+ this.comment = "";
+ this.sgmlDecl = "";
+ } else {
+ if ((this.sgmlDecl + c).toUpperCase() === _.DOCTYPE) {
+ this.state = 7;
+ if (this.doctype || this.sawRoot) {
+ this.strictFail$S("Inappropriately located doctype declaration");
+ }
+ this.doctype = "";
+ this.sgmlDecl = "";
+ } else {
+ if (c === ">") {
+ this.closetext_if_exist$();
+ this.sgmlDecl = "";
+ this.state = 2;
+ } else {
+ charclass$3 = _.quote;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$3, c)) {
+ this.state = 6;
+ this.sgmlDecl += c;
+ } else {
+ this.sgmlDecl += c;
+ }
+ }
+ }
+ }
+ }
+ continue;
+ case 6:
+ if (c === this.q) {
+ this.state = 5;
+ this.q = "";
+ }
+ this.sgmlDecl += c;
+ continue;
+ case 7:
+ if (c === ">") {
+ this.state = 2;
+ this.closetext_if_exist$();
+ this.doctype.trim();
+ } else {
+ this.doctype += c;
+ if (c === "[") {
+ this.state = 9;
+ } else {
+ charclass$4 = _.quote;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$4, c)) {
+ this.state = 8;
+ this.q = c;
+ }
+ }
+ }
+ continue;
+ case 8:
+ this.doctype += c;
+ if (c === this.q) {
+ this.q = "";
+ this.state = 7;
+ }
+ continue;
+ case 9:
+ this.doctype += c;
+ if (c === "]") {
+ this.state = 7;
+ } else {
+ charclass$5 = _.quote;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$5, c)) {
+ this.state = 10;
+ this.q = c;
+ }
+ }
+ continue;
+ case 10:
+ this.doctype += c;
+ if (c === this.q) {
+ this.state = 9;
+ this.q = "";
+ }
+ continue;
+ case 12:
+ if (c === "-") {
+ this.state = 13;
+ } else {
+ this.comment += c;
+ }
+ continue;
+ case 13:
+ if (c === "-") {
+ this.state = 14;
+ text$0 = this.comment;
+ text$0 = text$0.replace(/[\n\t]/g, ' ');
+ text$0 = text$0.replace(/\s\s+/g, " ");
+ comment$0 = this.comment = text$0;
+ if (comment$0) {
+ this.closetext_if_exist$();
+ this.comment.trim();
+ }
+ this.comment = "";
+ } else {
+ this.comment += "-" + c;
+ this.state = 12;
+ }
+ continue;
+ case 14:
+ if (c !== ">") {
+ this.strictFail$S("Malformed comment");
+ this.comment += "--" + c;
+ this.state = 12;
+ } else {
+ this.state = 2;
+ }
+ continue;
+ case 15:
+ if (c === "]") {
+ this.state = 16;
+ } else {
+ this.cdata += c;
+ }
+ continue;
+ case 16:
+ if (c === "]") {
+ this.state = 17;
+ } else {
+ this.cdata += "]" + c;
+ this.state = 15;
+ }
+ continue;
+ case 17:
+ if (c === ">") {
+ if (this.cdata) {
+ this.closetext_if_exist$();
+ }
+ this.cdata = "";
+ this.state = 2;
+ } else {
+ if (c === "]") {
+ this.cdata += "]";
+ } else {
+ this.cdata += "]]" + c;
+ this.state = 15;
+ }
+ }
+ continue;
+ case 18:
+ if (c === "?") {
+ this.state = 20;
+ } else {
+ charclass$6 = _.whitespace;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$6, c)) {
+ this.state = 19;
+ } else {
+ this.procInstName += c;
+ }
+ }
+ continue;
+ case 19:
+ if (! this.procInstBody && _.is$HBS(_.whitespace, c)) {
+ continue;
+ } else {
+ if (c === "?") {
+ this.state = 20;
+ } else {
+ this.procInstBody += c;
+ }
+ }
+ continue;
+ case 20:
+ if (c === ">") {
+ this.closetext_if_exist$();
+ this.procInstName = this.procInstBody = "";
+ this.state = 2;
+ } else {
+ this.procInstBody += "?" + c;
+ this.state = 19;
+ }
+ continue;
+ case 21:
+ charclass$7 = _.nameBody;
+ if (charclass$7.test(c)) {
+ this.tagName += c;
+ } else {
+ this.newTag$();
+ if (c === ">") {
+ this.openTag$B(false);
+ } else {
+ if (c === "/") {
+ this.state = 22;
+ } else {
+ charclass$8 = _.whitespace;
+ if (! $__jsx_ObjectHasOwnProperty.call(charclass$8, c)) {
+ this.strictFail$S("Invalid character in tag name");
+ }
+ this.state = 23;
+ }
+ }
+ }
+ continue;
+ case 22:
+ if (c === ">") {
+ this.openTag$B(true);
+ this.closeTag$();
+ } else {
+ this.strictFail$S("Forward-slash in opening tag not followed by >");
+ this.state = 23;
+ }
+ continue;
+ case 23:
+ charclass$9 = _.whitespace;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$9, c)) {
+ continue;
+ } else {
+ if (c === ">") {
+ this.openTag$B(false);
+ } else {
+ if (c === "/") {
+ this.state = 22;
+ } else {
+ charclass$10 = _.nameStart;
+ if (charclass$10.test(c)) {
+ this.attribName = c;
+ this.attribValue = "";
+ this.state = 24;
+ } else {
+ this.strictFail$S("Invalid attribute name");
+ }
+ }
+ }
+ }
+ continue;
+ case 24:
+ if (c === "=") {
+ this.state = 26;
+ } else {
+ if (c === ">") {
+ this.strictFail$S("Attribute without value");
+ this.attribValue = this.attribName;
+ this.attrib$();
+ this.openTag$B(false);
+ } else {
+ charclass$11 = _.whitespace;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$11, c)) {
+ this.state = 25;
+ } else {
+ charclass$12 = _.nameBody;
+ if (charclass$12.test(c)) {
+ this.attribName += c;
+ } else {
+ this.strictFail$S("Invalid attribute name");
+ }
+ }
+ }
+ }
+ continue;
+ case 25:
+ if (c === "=") {
+ this.state = 26;
+ } else {
+ charclass$13 = _.whitespace;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$13, c)) {
+ continue;
+ } else {
+ this.strictFail$S("Attribute without value");
+ this.tag.attributes[this.attribName] = "";
+ this.attribValue = "";
+ this.closetext_if_exist$();
+ this.attribName = "";
+ if (c === ">") {
+ this.openTag$B(false);
+ } else {
+ charclass$14 = _.nameStart;
+ if (charclass$14.test(c)) {
+ this.attribName = c;
+ this.state = 24;
+ } else {
+ this.strictFail$S("Invalid attribute name");
+ this.state = 23;
+ }
+ }
+ }
+ }
+ continue;
+ case 26:
+ charclass$15 = _.whitespace;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$15, c)) {
+ continue;
+ } else {
+ charclass$16 = _.quote;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$16, c)) {
+ this.q = c;
+ this.state = 27;
+ } else {
+ this.strictFail$S("Unquoted attribute value");
+ this.state = 28;
+ this.attribValue = c;
+ }
+ }
+ continue;
+ case 27:
+ if (c !== this.q) {
+ if (c === "&") {
+ this.state = 29;
+ } else {
+ this.attribValue += c;
+ }
+ continue;
+ }
+ this.attrib$();
+ this.q = "";
+ this.state = 23;
+ continue;
+ case 28:
+ charclass$17 = _.attribEnd;
+ if (! $__jsx_ObjectHasOwnProperty.call(charclass$17, c)) {
+ if (c === "&") {
+ this.state = 30;
+ } else {
+ this.attribValue += c;
+ }
+ continue;
+ }
+ this.attrib$();
+ if (c === ">") {
+ this.openTag$B(false);
+ } else {
+ this.state = 23;
+ }
+ continue;
+ case 31:
+ if (! this.tagName) {
+ charclass$18 = _.whitespace;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$18, c)) {
+ continue;
+ } else {
+ charclass$19 = _.nameStart;
+ if (! charclass$19.test(c)) {
+ if (this.script) {
+ this.script += "</" + c;
+ this.state = 33;
+ } else {
+ this.strictFail$S("Invalid tagname in closing tag.");
+ }
+ } else {
+ this.tagName = c;
+ }
+ }
+ } else {
+ if (c === ">") {
+ this.closeTag$();
+ } else {
+ charclass$20 = _.nameBody;
+ if (charclass$20.test(c)) {
+ this.tagName += c;
+ } else {
+ if (this.script) {
+ this.script += "</" + this.tagName;
+ this.tagName = "";
+ this.state = 33;
+ } else {
+ charclass$21 = _.whitespace;
+ if (! $__jsx_ObjectHasOwnProperty.call(charclass$21, c)) {
+ this.strictFail$S("Invalid tagname in closing tag");
+ }
+ this.state = 32;
+ }
+ }
+ }
+ }
+ continue;
+ case 32:
+ charclass$22 = _.whitespace;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$22, c)) {
+ continue;
+ }
+ if (c === ">") {
+ this.closeTag$();
+ } else {
+ this.strictFail$S("Invalid characters in closing tag");
+ }
+ continue;
+ case 3:
+ if (c === ";") {
+ this.textNode += this.parseEntity$();
+ this.entity = "";
+ this.state = 2;
+ } else {
+ charclass$23 = _.entity;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$23, c)) {
+ this.entity += c;
+ } else {
+ this.strictFail$S("Invalid character entity");
+ this.textNode += "&" + this.entity + c;
+ this.entity = "";
+ this.state = 2;
+ }
+ }
+ continue;
+ case 29:
+ case 30:
+ if (this.state === 29) {
+ returnState = 27;
+ } else {
+ returnState = 28;
+ }
+ if (c === ";") {
+ this.attribValue += this.parseEntity$();
+ this.entity = "";
+ this.state = (returnState | 0);
+ } else {
+ charclass$24 = _.entity;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$24, c)) {
+ this.entity += c;
+ } else {
+ this.strictFail$S("Invalid character entity");
+ this.attribValue += "&" + this.entity + c;
+ this.entity = "";
+ this.state = (returnState | 0);
+ }
+ }
+ continue;
+ default:
+ throw new Error("Unknown state: " + (this.state + ""));
+ }
+ }
+ this.end$();
+ return this;
+};
+
+/**
+ */
+SAXParser.prototype.clearBuffers$ = function () {
+ this.comment = '';
+ this.sgmlDecl = '';
+ this.textNode = '';
+ this.tagName = '';
+ this.doctype = '';
+ this.procInstName = '';
+ this.procInstBody = '';
+ this.entity = '';
+ this.attribName = '';
+ this.attribValue = '';
+ this.cdata = '';
+ this.script = '';
+};
+
+/**
+ */
+SAXParser.prototype.closetext_if_exist$ = function () {
+ if (this.textNode !== '') {
+ this.closetext$();
+ }
+};
+
+/**
+ */
+SAXParser.prototype.closetext$ = function () {
+ /** @type {!string} */
+ var text;
+ /** @type {!string} */
+ var text$0;
+ if (this.preTags === 0) {
+ text$0 = this.textNode;
+ text$0 = text$0.replace(/[\n\t]/g, ' ');
+ text$0 = text$0.replace(/\s\s+/g, " ");
+ text = text$0;
+ if (text$0) {
+ this.handler.ontext$S(text);
+ }
+ } else {
+ if (this.textNode) {
+ this.handler.ontext$S(this.textNode);
+ }
+ }
+ this.textNode = "";
+};
+
+/**
+ * @param {!string} text
+ * @return {!string}
+ */
+SAXParser.prototype.textopts$S = function (text) {
+ text = text.replace(/[\n\t]/g, ' ');
+ text = text.replace(/\s\s+/g, " ");
+ return text;
+};
+
+/**
+ * @param {!string} er
+ * @return {SAXParser}
+ */
+SAXParser.prototype.emiterror$S = function (er) {
+ /** @type {Error} */
+ var error;
+ this.closetext$();
+ er += "\nLine: " + (this.line + "") + "\nColumn: " + (this.column + "") + "\nChar: " + this.c;
+ error = new Error(er);
+ this.error = error;
+ return this;
+};
+
+/**
+ */
+SAXParser.prototype.end$ = function () {
+ if (! this.closedRoot) {
+ this.strictFail$S("Unclosed root tag");
+ }
+ if (this.state !== 2) {
+ this.emiterror$S("Unexpected end");
+ }
+ this.closetext$();
+ this.c = "";
+ this.closed = true;
+};
+
+/**
+ * @param {!string} message
+ */
+SAXParser.prototype.strictFail$S = function (message) {
+ if (this.strict) {
+ this.emiterror$S(message);
+ }
+};
+
+/**
+ */
+SAXParser.prototype.newTag$ = function () {
+ if (! this.strict) {
+ this.tagName = this.tagName.toLowerCase();
+ }
+ this.tag = ({name: this.tagName, attributes: ({ }), isSelfClosing: false});
+ this.attribList.length = 0;
+};
+
+/**
+ */
+SAXParser.prototype.attrib$ = function () {
+ if (! this.strict) {
+ this.attribName = this.attribName.toLowerCase();
+ }
+ if ($__jsx_ObjectHasOwnProperty.call(this.tag.attributes, this.attribName)) {
+ this.attribName = this.attribValue = "";
+ return;
+ }
+ this.tag.attributes[this.attribName] = this.attribValue;
+ this.closetext_if_exist$();
+ this.attribName = this.attribValue = "";
+};
+
+/**
+ */
+SAXParser.prototype.openTag$ = function () {
+ this.openTag$B(false);
+};
+
+/**
+ * @param {!boolean} selfClosing
+ */
+SAXParser.prototype.openTag$B = function (selfClosing) {
+ /** @type {Tag} */
+ var tag$0;
+ /** @type {Tag} */
+ var tag$1;
+ (tag$0 = this.tag).isSelfClosing = selfClosing;
+ this.sawRoot = true;
+ this.tags.push(tag$0);
+ this.closetext_if_exist$();
+ this.handler.onopentag$SHS((tag$1 = this.tag).name, tag$1.attributes);
+ if (this.tag.name === 'pre') {
+ this.preTags++;
+ }
+ if (! selfClosing) {
+ if (! this.noscript && this.tagName.toLowerCase() === "script") {
+ this.state = 33;
+ } else {
+ this.state = 2;
+ }
+ this.tag = null;
+ this.tagName = "";
+ }
+ this.attribName = this.attribValue = "";
+ this.attribList.length = 0;
+};
+
+/**
+ */
+SAXParser.prototype.closeTag$ = function () {
+ /** @type {!number} */
+ var t;
+ /** @type {!string} */
+ var tagName;
+ /** @type {!string} */
+ var closeTo;
+ /** @type {Tag} */
+ var close;
+ /** @type {!number} */
+ var s;
+ /** @type {Tag} */
+ var tag$0;
+ if (! this.tagName) {
+ this.strictFail$S("Weird empty close tag.");
+ this.textNode += "</>";
+ this.state = 2;
+ return;
+ }
+ if (this.script) {
+ if (this.tagName !== "script") {
+ this.script += "</" + this.tagName + ">";
+ this.tagName = "";
+ this.state = 33;
+ return;
+ }
+ this.closetext_if_exist$();
+ this.script = "";
+ }
+ t = this.tags.length;
+ tagName = this.tagName;
+ if (! this.strict) {
+ tagName = tagName.toLowerCase();
+ }
+ closeTo = tagName;
+ while (t--) {
+ close = this.tags[t];
+ if (close.name !== closeTo) {
+ this.strictFail$S("Unexpected close tag");
+ } else {
+ break;
+ }
+ }
+ if (t < 0) {
+ this.strictFail$S("Unmatched closing tag: " + this.tagName);
+ this.textNode += "</" + this.tagName + ">";
+ this.state = 2;
+ return;
+ }
+ this.tagName = tagName;
+ s = this.tags.length;
+ while (s-- > t) {
+ tag$0 = this.tag = this.tags.pop();
+ this.tagName = tag$0.name;
+ this.closetext_if_exist$();
+ this.handler.onclosetag$S(this.tagName);
+ if (this.tagName === 'pre') {
+ this.preTags--;
+ }
+ }
+ if (t === 0) {
+ this.closedRoot = true;
+ }
+ this.tagName = this.attribValue = this.attribName = "";
+ this.attribList.length = 0;
+ this.state = 2;
+};
+
+/**
+ * @return {!string}
+ */
+SAXParser.prototype.parseEntity$ = function () {
+ /** @type {!string} */
+ var entity;
+ /** @type {!string} */
+ var entityLC;
+ /** @type {!number} */
+ var num;
+ /** @type {!string} */
+ var numStr;
+ entity = this.entity;
+ entityLC = entity.toLowerCase();
+ num = 0;
+ numStr = "";
+ if (this.ENTITIES[entity]) {
+ return this.ENTITIES[entity];
+ }
+ if (this.ENTITIES[entityLC]) {
+ return this.ENTITIES[entityLC];
+ }
+ entity = entityLC;
+ if (entityLC.charAt(0) === "#") {
+ if (entity.charAt(1) === "x") {
+ entity = entity.slice(2);
+ num = $__jsx_parseInt(entity, 16);
+ numStr = num.toString(16);
+ } else {
+ entity = entity.slice(1);
+ num = $__jsx_parseInt(entity, 10);
+ numStr = num.toString(10);
+ }
+ }
+ entity = entity.replace(/^0+/, "");
+ if (numStr.toLowerCase() !== entity) {
+ this.strictFail$S("Invalid character entity");
+ return "&" + this.entity + ";";
+ }
+ return String.fromCharCode(num);
+};
+
+/**
+ * class Char extends Object
+ * @constructor
+ */
+function Char() {
+}
+
+/**
+ * @constructor
+ */
+function Char$() {
+ this.CDATA = "[CDATA[";
+ this.DOCTYPE = "DOCTYPE";
+ this.XML_NAMESPACE = "http://www.w3.org/XML/1998/namespace";
+ this.whitespace = this._charClass$S("\r\n\t ");
+ this.number = this._charClass$S("0124356789");
+ this.letter = this._charClass$S("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ");
+ this.quote = this._charClass$S("'\"");
+ this.entity = this._charClass$S("0124356789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ#");
+ this.attribEnd = this._charClass$S("\r\n\t >");
+ this.nameStart = /[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/;
+ this.nameBody = /[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040\.\d-]/;
+};
+
+Char$.prototype = new Char;
+
+/**
+ * @param {!string} str
+ * @return {Object.<string, undefined|!boolean>}
+ */
+Char.prototype._charClass$S = function (str) {
+ /** @type {Object.<string, undefined|!boolean>} */
+ var result;
+ /** @type {!number} */
+ var i;
+ result = ({ });
+ for (i = 0; i < str.length; i++) {
+ result[str.slice(i, i + 1)] = true;
+ }
+ return result;
+};
+
+/**
+ * @param {RegExp} charclass
+ * @param {!string} c
+ * @return {!boolean}
+ */
+Char.prototype.is$LRegExp$S = function (charclass, c) {
+ return charclass.test(c);
+};
+
+/**
+ * @param {Object.<string, undefined|!boolean>} charclass
+ * @param {!string} c
+ * @return {!boolean}
+ */
+Char.prototype.is$HBS = function (charclass, c) {
+ return $__jsx_ObjectHasOwnProperty.call(charclass, c);
+};
+
+/**
+ * @param {RegExp} charclass
+ * @param {!string} c
+ * @return {!boolean}
+ */
+Char.prototype.not$LRegExp$S = function (charclass, c) {
+ return ! charclass.test(c);
+};
+
+/**
+ * @param {Object.<string, undefined|!boolean>} charclass
+ * @param {!string} c
+ * @return {!boolean}
+ */
+Char.prototype.not$HBS = function (charclass, c) {
+ return ! $__jsx_ObjectHasOwnProperty.call(charclass, c);
+};
+
+/**
+ * class _Entities extends Object
+ * @constructor
+ */
+function _Entities() {
+}
+
+/**
+ * @constructor
+ */
+function _Entities$() {
+};
+
+_Entities$.prototype = new _Entities;
+
+/**
+ * @return {Object.<string, undefined|!string>}
+ */
+_Entities.entity_list$ = function () {
+ /** @type {Object.<string, undefined|!string>} */
+ var result;
+ /** @type {!string} */
+ var key;
+ /** @type {*} */
+ var value;
+ result = ({ });
+ for (key in _Entities._entities) {
+ value = _Entities._entities[key];
+ if (typeof value === 'string') {
+ result[key] = value + "";
+ } else {
+ if (typeof value === 'number') {
+ result[key] = String.fromCharCode(value | 0);
+ }
+ }
+ }
+ return result;
+};
+
+var _Entities$entity_list$ = _Entities.entity_list$;
+
+/**
+ * class BitVector extends Object
+ * @constructor
+ */
+function BitVector() {
+}
+
+/**
+ * @constructor
+ */
+function BitVector$() {
+ /** @type {Array.<undefined|!number>} */
+ var _v$0;
+ /** @type {Array.<undefined|!number>} */
+ var _r$0;
+ _r$0 = this._r = [ ];
+ _v$0 = this._v = [ ];
+ _v$0.length = 0;
+ _r$0.length = 0;
+ this._size = 0;
+ this._size1 = 0;
+};
+
+BitVector$.prototype = new BitVector;
+
+/**
+ */
+BitVector.prototype.build$ = function () {
+ /** @type {!number} */
+ var i;
+ this._size1 = 0;
+ for (i = 0; i < this._v.length; i++) {
+ if (i % 8 === 0) {
+ this._r.push(true ? this._size1 : this._size - this._size1);
+ }
+ this._size1 += this._rank32$IIB(this._v[i], 32, true);
+ }
+};
+
+/**
+ */
+BitVector.prototype.clear$ = function () {
+ this._v.length = 0;
+ this._r.length = 0;
+ this._size = 0;
+ this._size1 = 0;
+};
+
+/**
+ * @return {!number}
+ */
+BitVector.prototype.size$ = function () {
+ return this._size;
+};
+
+/**
+ * @param {!boolean} b
+ * @return {!number}
+ */
+BitVector.prototype.size$B = function (b) {
+ return (b ? this._size1 : this._size - this._size1);
+};
+
+/**
+ * @param {!number} value
+ */
+BitVector.prototype.set$I = function (value) {
+ this.set$IB(value, true);
+};
+
+/**
+ * @param {!number} value
+ * @param {!boolean} flag
+ */
+BitVector.prototype.set$IB = function (value, flag) {
+ /** @type {!number} */
+ var q;
+ /** @type {!number} */
+ var r;
+ /** @type {!number} */
+ var m;
+ if (value >= this._size) {
+ this._size = (value + 1 | 0);
+ }
+ q = (value / 32 | 0);
+ r = (value % 32 | 0);
+ while (q >= this._v.length) {
+ this._v.push(0);
+ }
+ m = 0x1 << r;
+ if (flag) {
+ this._v[q] |= m;
+ } else {
+ this._v[q] &= ~ m;
+ }
+};
+
+/**
+ * @param {!number} value
+ * @return {!boolean}
+ */
+BitVector.prototype.get$I = function (value) {
+ /** @type {!number} */
+ var q;
+ /** @type {!number} */
+ var r;
+ /** @type {!number} */
+ var m;
+ if (value >= this._size) {
+ throw new Error("BitVector.get() : range error");
+ }
+ q = (value / 32 | 0);
+ r = (value % 32 | 0);
+ m = 0x1 << r;
+ return !! (this._v[q] & m);
+};
+
+/**
+ * @param {!number} i
+ * @return {!number}
+ */
+BitVector.prototype.rank$I = function (i) {
+ return this.rank$IB(i, true);
+};
+
+/**
+ * @param {!number} i
+ * @param {!boolean} b
+ * @return {!number}
+ */
+BitVector.prototype.rank$IB = function (i, b) {
+ /** @type {!number} */
+ var q_large;
+ /** @type {!number} */
+ var q_small;
+ /** @type {!number} */
+ var r;
+ /** @type {!number} */
+ var rank;
+ /** @type {!number} */
+ var begin;
+ /** @type {!number} */
+ var j;
+ if (i > this._size) {
+ throw new Error("BitVector.rank() : range error");
+ }
+ if (i === 0) {
+ return 0;
+ }
+ i--;
+ q_large = (Math.floor(i / 256) | 0);
+ q_small = (Math.floor(i / 32) | 0);
+ r = (Math.floor(i % 32) | 0);
+ rank = (this._r[q_large] | 0);
+ if (! b) {
+ rank = q_large * 256 - rank;
+ }
+ begin = q_large * 8;
+ for (j = begin; j < q_small; j++) {
+ rank += this._rank32$IIB(this._v[j], 32, b);
+ }
+ rank += this._rank32$IIB(this._v[q_small], r + 1, b);
+ return rank;
+};
+
+/**
+ * @param {!number} i
+ * @return {!number}
+ */
+BitVector.prototype.select$I = function (i) {
+ return this.select$IB(i, true);
+};
+
+/**
+ * @param {!number} i
+ * @param {!boolean} b
+ * @return {!number}
+ */
+BitVector.prototype.select$IB = function (i, b) {
+ /** @type {!number} */
+ var left;
+ /** @type {!number} */
+ var right;
+ /** @type {!number} */
+ var pivot;
+ /** @type {undefined|!number} */
+ var rank;
+ /** @type {!number} */
+ var j;
+ if (i >= (b ? this._size1 : this._size - this._size1)) {
+ throw new Error("BitVector.select() : range error");
+ }
+ left = 0;
+ right = this._r.length;
+ while (left < right) {
+ pivot = Math.floor((left + right) / 2);
+ rank = this._r[pivot];
+ if (! b) {
+ rank = pivot * 256 - rank;
+ }
+ if (i < rank) {
+ right = pivot;
+ } else {
+ left = pivot + 1;
+ }
+ }
+ right--;
+ if (b) {
+ i -= (this._r[right] | 0);
+ } else {
+ i -= (right * 256 - this._r[right] | 0);
+ }
+ j = right * 8;
+ while (1) {
+ rank = this._rank32$IIB(this._v[j], 32, b);
+ if (i < rank) {
+ break;
+ }
+ j++;
+ i -= (rank | 0);
+ }
+ return (j * 32 + this._select32$IIB(this._v[j], i, b) | 0);
+};
+
+/**
+ * @param {!number} x
+ * @param {!number} i
+ * @param {!boolean} b
+ * @return {!number}
+ */
+BitVector.prototype._rank32$IIB = function (x, i, b) {
+ if (! b) {
+ x = ~ x;
+ }
+ x <<= 32 - i;
+ x = ((x & 0xaaaaaaaa) >>> 1) + (x & 0x55555555);
+ x = ((x & 0xcccccccc) >>> 2) + (x & 0x33333333);
+ x = ((x & 0xf0f0f0f0) >>> 4) + (x & 0x0f0f0f0f);
+ x = ((x & 0xff00ff00) >>> 8) + (x & 0x00ff00ff);
+ x = ((x & 0xffff0000) >>> 16) + (x & 0x0000ffff);
+ return x;
+};
+
+/**
+ * @param {!number} x
+ * @param {!number} i
+ * @param {!boolean} b
+ * @return {!number}
+ */
+BitVector.prototype._select32$IIB = function (x, i, b) {
+ /** @type {!number} */
+ var x1;
+ /** @type {!number} */
+ var x2;
+ /** @type {!number} */
+ var x3;
+ /** @type {!number} */
+ var x4;
+ /** @type {!number} */
+ var x5;
+ /** @type {!number} */
+ var pos;
+ /** @type {!number} */
+ var v5;
+ /** @type {!number} */
+ var v4;
+ /** @type {!number} */
+ var v3;
+ /** @type {!number} */
+ var v2;
+ /** @type {!number} */
+ var v1;
+ /** @type {!number} */
+ var v0;
+ if (! b) {
+ x = ~ x;
+ }
+ x1 = ((x & 0xaaaaaaaa) >>> 1) + (x & 0x55555555);
+ x2 = ((x1 & 0xcccccccc) >>> 2) + (x1 & 0x33333333);
+ x3 = ((x2 & 0xf0f0f0f0) >>> 4) + (x2 & 0x0f0f0f0f);
+ x4 = ((x3 & 0xff00ff00) >>> 8) + (x3 & 0x00ff00ff);
+ x5 = ((x4 & 0xffff0000) >>> 16) + (x4 & 0x0000ffff);
+ i++;
+ pos = 0;
+ v5 = x5 & 0xffffffff;
+ if (i > v5) {
+ i -= (v5 | 0);
+ pos += 32;
+ }
+ v4 = x4 >>> pos & 0x0000ffff;
+ if (i > v4) {
+ i -= (v4 | 0);
+ pos += 16;
+ }
+ v3 = x3 >>> pos & 0x000000ff;
+ if (i > v3) {
+ i -= (v3 | 0);
+ pos += 8;
+ }
+ v2 = x2 >>> pos & 0x0000000f;
+ if (i > v2) {
+ i -= (v2 | 0);
+ pos += 4;
+ }
+ v1 = x1 >>> pos & 0x00000003;
+ if (i > v1) {
+ i -= (v1 | 0);
+ pos += 2;
+ }
+ v0 = x >>> pos & 0x00000001;
+ if (i > v0) {
+ i -= (v0 | 0);
+ pos += 1;
+ }
+ return (pos | 0);
+};
+
+/**
+ * @return {!string}
+ */
+BitVector.prototype.dump$ = function () {
+ /** @type {Array.<undefined|!string>} */
+ var contents;
+ contents = [ ];
+ contents.push(Binary$dump32bitNumber$N(this._size));
+ contents.push(Binary$dump32bitNumberList$AN(this._v));
+ return contents.join('');
+};
+
+/**
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+BitVector.prototype.dump$LCompressionReport$ = function (report) {
+ /** @type {Array.<undefined|!string>} */
+ var contents;
+ contents = [ ];
+ contents.push(Binary$dump32bitNumber$N(this._size));
+ CompressionReport$add$LCompressionReport$II(report, 2, 2);
+ contents.push(Binary$dump32bitNumberList$ANLCompressionReport$(this._v, report));
+ return contents.join('');
+};
+
+/**
+ * @param {!string} data
+ * @return {!number}
+ */
+BitVector.prototype.load$S = function (data) {
+ return this.load$SI(data, 0);
+};
+
+/**
+ * @param {!string} data
+ * @param {!number} offset
+ * @return {!number}
+ */
+BitVector.prototype.load$SI = function (data, offset) {
+ /** @type {LoadedNumberListResult} */
+ var result;
+ /** @type {!number} */
+ var result$0;
+ this._v.length = 0;
+ this._r.length = 0;
+ this._size = 0;
+ this._size1 = 0;
+ result$0 = data.charCodeAt(offset) * 65536 + data.charCodeAt(offset + 1);
+ this._size = (result$0 | 0);
+ result = Binary$load32bitNumberList$SI(data, offset + 2);
+ this._v = result.result;
+ this.build$();
+ return result.offset;
+};
+
+/**
+ * class WaveletMatrix extends Object
+ * @constructor
+ */
+function WaveletMatrix() {
+}
+
+/**
+ * @constructor
+ */
+function WaveletMatrix$() {
+ /** @type {Array.<undefined|BitVector>} */
+ var _bv$0;
+ /** @type {Array.<undefined|!number>} */
+ var _seps$0;
+ this._range = ({ });
+ _bv$0 = this._bv = [ ];
+ _seps$0 = this._seps = [ ];
+ this._bitsize = 16;
+ _bv$0.length = 0;
+ _seps$0.length = 0;
+ this._size = 0;
+};
+
+WaveletMatrix$.prototype = new WaveletMatrix;
+
+/**
+ * @return {!number}
+ */
+WaveletMatrix.prototype.bitsize$ = function () {
+ return this._bitsize;
+};
+
+/**
+ * @param {!number} charCode
+ */
+WaveletMatrix.prototype.setMaxCharCode$I = function (charCode) {
+ this._bitsize = (Math.ceil(Math.log(charCode) / 0.6931471805599453) | 0);
+};
+
+/**
+ */
+WaveletMatrix.prototype.clear$ = function () {
+ this._bv.length = 0;
+ this._seps.length = 0;
+ this._size = 0;
+};
+
+/**
+ * @param {!string} v
+ */
+WaveletMatrix.prototype.build$S = function (v) {
+ /** @type {!number} */
+ var size;
+ /** @type {!number} */
+ var bitsize;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var depth;
+ /** @type {Object.<string, undefined|!number>} */
+ var range_tmp;
+ /** @type {!number} */
+ var code;
+ /** @type {!boolean} */
+ var bit;
+ /** @type {!number} */
+ var key;
+ /** @type {Object.<string, undefined|!number>} */
+ var range_rev;
+ /** @type {!string} */
+ var range_key;
+ /** @type {!number} */
+ var value;
+ /** @type {!number} */
+ var pos0;
+ /** @type {undefined|!number} */
+ var pos1;
+ /** @type {!string} */
+ var range_rev_key;
+ /** @type {!number} */
+ var begin;
+ /** @type {undefined|!number} */
+ var end;
+ /** @type {!number} */
+ var num0;
+ /** @type {!number} */
+ var num1;
+ this._bv.length = 0;
+ this._seps.length = 0;
+ this._size = 0;
+ size = v.length;
+ bitsize = this._bitsize;
+ for (i = 0; i < bitsize; i++) {
+ this._bv.push(new BitVector$());
+ this._seps.push(0);
+ }
+ this._size = (size | 0);
+ for (i = 0; i < size; i++) {
+ this._bv[0].set$IB(i, this._uint2bit$II(v.charCodeAt(i), 0));
+ }
+ this._bv[0].build$();
+ this._seps[0] = this._bv[0].size$B(false);
+ this._range["0"] = 0;
+ this._range["1"] = this._seps[0];
+ depth = 1;
+ while (depth < bitsize) {
+ range_tmp = WaveletMatrix$_shallow_copy$HI(this._range);
+ for (i = 0; i < size; i++) {
+ code = v.charCodeAt(i);
+ bit = this._uint2bit$II(code, depth);
+ key = code >>> bitsize - depth;
+ this._bv[depth].set$IB(range_tmp[key + ""], bit);
+ range_tmp[key + ""]++;
+ }
+ this._bv[depth].build$();
+ this._seps[depth] = this._bv[depth].size$B(false);
+ range_rev = ({ });
+ for (range_key in this._range) {
+ value = this._range[range_key];
+ if (value != range_tmp[range_key]) {
+ range_rev[value + ""] = range_key | 0;
+ }
+ }
+ this._range = ({ });
+ pos0 = 0;
+ pos1 = this._seps[depth];
+ for (range_rev_key in range_rev) {
+ begin = range_rev_key | 0;
+ value = range_rev[range_rev_key];
+ end = range_tmp[value + ""];
+ num0 = this._bv[depth].rank$IB(end, false) - this._bv[depth].rank$IB(begin, false);
+ num1 = end - begin - num0;
+ if (num0 > 0) {
+ this._range[(value << 1) + ""] = (pos0 | 0);
+ pos0 += num0;
+ }
+ if (num1 > 0) {
+ this._range[(value << 1) + 1 + ""] = pos1;
+ pos1 += (num1 | 0);
+ }
+ }
+ depth++;
+ }
+};
+
+/**
+ * @return {!number}
+ */
+WaveletMatrix.prototype.size$ = function () {
+ return this._size;
+};
+
+/**
+ * @param {!number} c
+ * @return {!number}
+ */
+WaveletMatrix.prototype.size$I = function (c) {
+ return this.rank$II(this._size, c);
+};
+
+/**
+ * @param {!number} i
+ * @return {!number}
+ */
+WaveletMatrix.prototype.get$I = function (i) {
+ /** @type {!number} */
+ var value;
+ /** @type {!number} */
+ var depth;
+ /** @type {!boolean} */
+ var bit;
+ if (i >= this._size) {
+ throw new Error("WaveletMatrix.get() : range error");
+ }
+ value = 0;
+ depth = 0;
+ while (depth < this._bitsize) {
+ bit = this._bv[depth].get$I(i);
+ i = this._bv[depth].rank$IB(i, bit);
+ value <<= 1;
+ if (bit) {
+ i += this._seps[depth];
+ value += 1;
+ }
+ depth++;
+ }
+ return (value | 0);
+};
+
+/**
+ * @param {!number} i
+ * @param {!number} c
+ * @return {!number}
+ */
+WaveletMatrix.prototype.rank$II = function (i, c) {
+ /** @type {undefined|!number} */
+ var begin;
+ /** @type {!number} */
+ var end;
+ /** @type {!number} */
+ var depth;
+ /** @type {!boolean} */
+ var bit;
+ if (i > this._size) {
+ throw new Error("WaveletMatrix.rank(): range error");
+ }
+ if (i === 0) {
+ return 0;
+ }
+ begin = this._range[c + ""];
+ if (begin == null) {
+ return 0;
+ }
+ end = i;
+ depth = 0;
+ while (depth < this._bitsize) {
+ bit = this._uint2bit$II(c, depth);
+ end = this._bv[depth].rank$IB(end, bit);
+ if (bit) {
+ end += this._seps[depth];
+ }
+ depth++;
+ }
+ return (end - begin | 0);
+};
+
+/**
+ * @param {!number} i
+ * @param {!number} c
+ * @return {!number}
+ */
+WaveletMatrix.prototype.rank_less_than$II = function (i, c) {
+ /** @type {!number} */
+ var begin;
+ /** @type {!number} */
+ var end;
+ /** @type {!number} */
+ var depth;
+ /** @type {!number} */
+ var rlt;
+ /** @type {!number} */
+ var rank0_begin;
+ /** @type {!number} */
+ var rank0_end;
+ /** @type {Array.<undefined|!number>} */
+ var _seps$0;
+ if (i > this._size) {
+ throw new Error("WaveletMatrix.rank_less_than(): range error");
+ }
+ if (i === 0) {
+ return 0;
+ }
+ begin = 0;
+ end = i;
+ depth = 0;
+ rlt = 0;
+ while (depth < this._bitsize) {
+ rank0_begin = this._bv[depth].rank$IB(begin, false);
+ rank0_end = this._bv[depth].rank$IB(end, false);
+ if (this._uint2bit$II(c, depth)) {
+ rlt += rank0_end - rank0_begin;
+ begin += (_seps$0 = this._seps)[depth] - rank0_begin;
+ end += _seps$0[depth] - rank0_end;
+ } else {
+ begin = rank0_begin;
+ end = rank0_end;
+ }
+ depth++;
+ }
+ return (rlt | 0);
+};
+
+/**
+ * @return {!string}
+ */
+WaveletMatrix.prototype.dump$ = function () {
+ /** @type {Array.<undefined|!string>} */
+ var contents;
+ /** @type {!number} */
+ var i;
+ /** @type {Array.<undefined|!string>} */
+ var range_contents;
+ /** @type {!number} */
+ var counter;
+ /** @type {!string} */
+ var key;
+ contents = [ Binary$dump16bitNumber$I(this._bitsize), Binary$dump32bitNumber$N(this._size) ];
+ for (i = 0; i < this._bitsize; i++) {
+ contents.push(this._bv[i].dump$());
+ }
+ for (i = 0; i < this._bitsize; i++) {
+ contents.push(Binary$dump32bitNumber$N(this._seps[i]));
+ }
+ range_contents = [ ];
+ counter = 0;
+ for (key in this._range) {
+ range_contents.push(Binary$dump32bitNumber$N(key | 0));
+ range_contents.push(Binary$dump32bitNumber$N(this._range[key]));
+ counter++;
+ }
+ contents.push(Binary$dump32bitNumber$N(counter));
+ return contents.join('') + range_contents.join('');
+};
+
+/**
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+WaveletMatrix.prototype.dump$LCompressionReport$ = function (report) {
+ /** @type {Array.<undefined|!string>} */
+ var contents;
+ /** @type {!number} */
+ var i;
+ /** @type {Array.<undefined|!string>} */
+ var range_contents;
+ /** @type {!number} */
+ var counter;
+ /** @type {!string} */
+ var key;
+ contents = [ Binary$dump16bitNumber$I(this._bitsize), Binary$dump32bitNumber$N(this._size) ];
+ CompressionReport$add$LCompressionReport$II(report, 3, 3);
+ for (i = 0; i < this._bitsize; i++) {
+ contents.push(this._bv[i].dump$LCompressionReport$(report));
+ }
+ for (i = 0; i < this._bitsize; i++) {
+ contents.push(Binary$dump32bitNumber$N(this._seps[i]));
+ CompressionReport$add$LCompressionReport$II(report, 2, 2);
+ }
+ range_contents = [ ];
+ counter = 0;
+ for (key in this._range) {
+ range_contents.push(Binary$dump32bitNumber$N(key | 0));
+ range_contents.push(Binary$dump32bitNumber$N(this._range[key]));
+ CompressionReport$add$LCompressionReport$II(report, 4, 4);
+ counter++;
+ }
+ CompressionReport$add$LCompressionReport$II(report, 2, 2);
+ contents.push(Binary$dump32bitNumber$N(counter));
+ return contents.join('') + range_contents.join('');
+};
+
+/**
+ * @param {!string} data
+ * @return {!number}
+ */
+WaveletMatrix.prototype.load$S = function (data) {
+ return this.load$SI(data, 0);
+};
+
+/**
+ * @param {!string} data
+ * @param {!number} offset
+ * @return {!number}
+ */
+WaveletMatrix.prototype.load$SI = function (data, offset) {
+ /** @type {!number} */
+ var i;
+ /** @type {BitVector} */
+ var bit_vector;
+ /** @type {!number} */
+ var range_size;
+ /** @type {!number} */
+ var value;
+ /** @type {!number} */
+ var offset$0;
+ /** @type {!number} */
+ var result$0;
+ /** @type {!number} */
+ var result$1;
+ /** @type {!number} */
+ var result$2;
+ this._bv.length = 0;
+ this._seps.length = 0;
+ this._size = 0;
+ offset$0 = offset++;
+ this._bitsize = (data.charCodeAt(offset$0) | 0);
+ result$0 = data.charCodeAt(offset) * 65536 + data.charCodeAt(offset + 1);
+ this._size = (result$0 | 0);
+ offset += 2;
+ for (i = 0; i < this._bitsize; i++) {
+ bit_vector = new BitVector$();
+ offset = bit_vector.load$SI(data, offset);
+ this._bv.push(bit_vector);
+ }
+ for (i = 0; i < this._bitsize; (i++, offset += 2)) {
+ this._seps.push(Binary$load32bitNumber$SI(data, offset));
+ }
+ result$1 = data.charCodeAt(offset) * 65536 + data.charCodeAt(offset + 1);
+ range_size = result$1;
+ offset += 2;
+ for (i = 0; i < range_size; (i++, offset += 4)) {
+ result$2 = data.charCodeAt(offset) * 65536 + data.charCodeAt(offset + 1);
+ value = Binary$load32bitNumber$SI(data, offset + 2);
+ this._range[result$2 + ""] = (value | 0);
+ }
+ return offset;
+};
+
+/**
+ * @param {Object.<string, undefined|!number>} input
+ * @return {Object.<string, undefined|!number>}
+ */
+WaveletMatrix._shallow_copy$HI = function (input) {
+ /** @type {Object.<string, undefined|!number>} */
+ var result;
+ /** @type {!string} */
+ var key;
+ result = ({ });
+ for (key in input) {
+ result[key] = input[key];
+ }
+ return result;
+};
+
+var WaveletMatrix$_shallow_copy$HI = WaveletMatrix._shallow_copy$HI;
+
+/**
+ * @param {!number} c
+ * @param {!number} i
+ * @return {!boolean}
+ */
+WaveletMatrix.prototype._uint2bit$II = function (c, i) {
+ return (c >>> this._bitsize - 1 - i & 0x1) === 0x1;
+};
+
+/**
+ * class BurrowsWheelerTransform extends Object
+ * @constructor
+ */
+function BurrowsWheelerTransform() {
+}
+
+/**
+ * @constructor
+ */
+function BurrowsWheelerTransform$() {
+ this._str = "";
+ this._size = 0;
+ this._head = 0;
+ this._suffixarray = [ ];
+};
+
+BurrowsWheelerTransform$.prototype = new BurrowsWheelerTransform;
+
+/**
+ * @param {BurrowsWheelerTransform} $this
+ * @return {!number}
+ */
+BurrowsWheelerTransform.size$LBurrowsWheelerTransform$ = function ($this) {
+ return $this._size;
+};
+
+var BurrowsWheelerTransform$size$LBurrowsWheelerTransform$ = BurrowsWheelerTransform.size$LBurrowsWheelerTransform$;
+
+/**
+ * @param {BurrowsWheelerTransform} $this
+ * @return {!number}
+ */
+BurrowsWheelerTransform.head$LBurrowsWheelerTransform$ = function ($this) {
+ return $this._head;
+};
+
+var BurrowsWheelerTransform$head$LBurrowsWheelerTransform$ = BurrowsWheelerTransform.head$LBurrowsWheelerTransform$;
+
+/**
+ * @param {BurrowsWheelerTransform} $this
+ */
+BurrowsWheelerTransform.clear$LBurrowsWheelerTransform$ = function ($this) {
+ $this._str = "";
+ $this._size = 0;
+ $this._head = 0;
+ $this._suffixarray.length = 0;
+};
+
+var BurrowsWheelerTransform$clear$LBurrowsWheelerTransform$ = BurrowsWheelerTransform.clear$LBurrowsWheelerTransform$;
+
+/**
+ * @param {BurrowsWheelerTransform} $this
+ * @param {!string} str
+ */
+BurrowsWheelerTransform.build$LBurrowsWheelerTransform$S = function ($this, str) {
+ /** @type {!string} */
+ var _str$0;
+ /** @type {Array.<undefined|!number>} */
+ var _suffixarray$0;
+ _str$0 = $this._str = str;
+ $this._size = _str$0.length;
+ _suffixarray$0 = $this._suffixarray = SAIS$make$S(str);
+ $this._head = (_suffixarray$0.indexOf(0) | 0);
+};
+
+var BurrowsWheelerTransform$build$LBurrowsWheelerTransform$S = BurrowsWheelerTransform.build$LBurrowsWheelerTransform$S;
+
+/**
+ * @param {BurrowsWheelerTransform} $this
+ * @param {!number} i
+ * @return {!string}
+ */
+BurrowsWheelerTransform.get$LBurrowsWheelerTransform$I = function ($this, i) {
+ /** @type {!number} */
+ var size;
+ /** @type {!number} */
+ var index;
+ size = $this._size;
+ if (i >= size) {
+ throw new Error("BurrowsWheelerTransform.get() : range error");
+ }
+ index = ($this._suffixarray[i] + size - 1) % size;
+ return $this._str.charAt(index);
+};
+
+var BurrowsWheelerTransform$get$LBurrowsWheelerTransform$I = BurrowsWheelerTransform.get$LBurrowsWheelerTransform$I;
+
+/**
+ * @param {BurrowsWheelerTransform} $this
+ * @return {!string}
+ */
+BurrowsWheelerTransform.get$LBurrowsWheelerTransform$ = function ($this) {
+ /** @type {Array.<undefined|!string>} */
+ var str;
+ /** @type {!number} */
+ var size;
+ /** @type {!number} */
+ var i;
+ str = [ ];
+ size = $this._size;
+ for (i = 0; i < size; i++) {
+ str.push(BurrowsWheelerTransform$get$LBurrowsWheelerTransform$I($this, i));
+ }
+ return str.join("");
+};
+
+var BurrowsWheelerTransform$get$LBurrowsWheelerTransform$ = BurrowsWheelerTransform.get$LBurrowsWheelerTransform$;
+
+/**
+ * @param {BurrowsWheelerTransform} $this
+ * @param {!string} replace
+ * @return {!string}
+ */
+BurrowsWheelerTransform.get$LBurrowsWheelerTransform$S = function ($this, replace) {
+ /** @type {!string} */
+ var result;
+ result = BurrowsWheelerTransform$get$LBurrowsWheelerTransform$($this);
+ return result.replace(BurrowsWheelerTransform.END_MARKER, replace);
+};
+
+var BurrowsWheelerTransform$get$LBurrowsWheelerTransform$S = BurrowsWheelerTransform.get$LBurrowsWheelerTransform$S;
+
+/**
+ * class OArray extends Object
+ * @constructor
+ */
+function OArray() {
+}
+
+/**
+ * @constructor
+ * @param {Array.<undefined|!number>} array
+ */
+function OArray$AI(array) {
+ this.array = array;
+ this.offset = 0;
+};
+
+OArray$AI.prototype = new OArray;
+
+/**
+ * @constructor
+ * @param {Array.<undefined|!number>} array
+ * @param {!number} offset
+ */
+function OArray$AII(array, offset) {
+ this.array = array;
+ this.offset = offset;
+};
+
+OArray$AII.prototype = new OArray;
+
+/**
+ * @param {OArray} $this
+ * @param {!number} index
+ * @return {!number}
+ */
+OArray.get$LOArray$I = function ($this, index) {
+ return $this.array[index + $this.offset];
+};
+
+var OArray$get$LOArray$I = OArray.get$LOArray$I;
+
+/**
+ * @param {OArray} $this
+ * @param {!number} index
+ * @param {!number} value
+ */
+OArray.set$LOArray$II = function ($this, index, value) {
+ $this.array[index + $this.offset] = value;
+};
+
+var OArray$set$LOArray$II = OArray.set$LOArray$II;
+
+/**
+ * @param {OArray} $this
+ * @param {!number} index
+ * @return {!boolean}
+ */
+OArray.isS$LOArray$I = function ($this, index) {
+ /** @type {Array.<undefined|!number>} */
+ var array$0;
+ /** @type {!number} */
+ var offset$0;
+ return (array$0 = $this.array)[index + (offset$0 = $this.offset)] < array$0[index + offset$0 + 1];
+};
+
+var OArray$isS$LOArray$I = OArray.isS$LOArray$I;
+
+/**
+ * @param {OArray} $this
+ * @param {!number} index1
+ * @param {!number} index2
+ * @return {!boolean}
+ */
+OArray.compare$LOArray$II = function ($this, index1, index2) {
+ /** @type {Array.<undefined|!number>} */
+ var array$0;
+ /** @type {!number} */
+ var offset$0;
+ return (array$0 = $this.array)[index1 + (offset$0 = $this.offset)] == array$0[index2 + offset$0];
+};
+
+var OArray$compare$LOArray$II = OArray.compare$LOArray$II;
+
+/**
+ * class SAIS extends Object
+ * @constructor
+ */
+function SAIS() {
+}
+
+/**
+ * @constructor
+ */
+function SAIS$() {
+};
+
+SAIS$.prototype = new SAIS;
+
+/**
+ * @param {BitVector} t
+ * @param {!number} i
+ * @return {!boolean}
+ */
+SAIS._isLMS$LBitVector$I = function (t, i) {
+ return i > 0 && t.get$I(i) && ! t.get$I(i - 1);
+};
+
+var SAIS$_isLMS$LBitVector$I = SAIS._isLMS$LBitVector$I;
+
+/**
+ * @param {OArray} s
+ * @param {Array.<undefined|!number>} bkt
+ * @param {!number} n
+ * @param {!number} K
+ * @param {!boolean} end
+ */
+SAIS._getBuckets$LOArray$AIIIB = function (s, bkt, n, K, end) {
+ /** @type {!number} */
+ var sum;
+ /** @type {!number} */
+ var i;
+ sum = 0;
+ for (i = 0; i <= K; i++) {
+ bkt[i] = 0;
+ }
+ for (i = 0; i < n; i++) {
+ bkt[OArray$get$LOArray$I(s, i)]++;
+ }
+ for (i = 0; i <= K; i++) {
+ sum += bkt[i];
+ bkt[i] = ((end ? sum : sum - bkt[i]) | 0);
+ }
+};
+
+var SAIS$_getBuckets$LOArray$AIIIB = SAIS._getBuckets$LOArray$AIIIB;
+
+/**
+ * @param {BitVector} t
+ * @param {Array.<undefined|!number>} SA
+ * @param {OArray} s
+ * @param {Array.<undefined|!number>} bkt
+ * @param {!number} n
+ * @param {!number} K
+ * @param {!boolean} end
+ */
+SAIS._induceSAl$LBitVector$AILOArray$AIIIB = function (t, SA, s, bkt, n, K, end) {
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var j;
+ SAIS$_getBuckets$LOArray$AIIIB(s, bkt, n, K, end);
+ for (i = 0; i < n; i++) {
+ j = SA[i] - 1;
+ if (j >= 0 && ! t.get$I(j)) {
+ SA[bkt[OArray$get$LOArray$I(s, j)]++] = (j | 0);
+ }
+ }
+};
+
+var SAIS$_induceSAl$LBitVector$AILOArray$AIIIB = SAIS._induceSAl$LBitVector$AILOArray$AIIIB;
+
+/**
+ * @param {BitVector} t
+ * @param {Array.<undefined|!number>} SA
+ * @param {OArray} s
+ * @param {Array.<undefined|!number>} bkt
+ * @param {!number} n
+ * @param {!number} K
+ * @param {!boolean} end
+ */
+SAIS._induceSAs$LBitVector$AILOArray$AIIIB = function (t, SA, s, bkt, n, K, end) {
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var j;
+ SAIS$_getBuckets$LOArray$AIIIB(s, bkt, n, K, end);
+ for (i = n - 1; i >= 0; i--) {
+ j = SA[i] - 1;
+ if (j >= 0 && t.get$I(j)) {
+ SA[-- bkt[OArray$get$LOArray$I(s, j)]] = (j | 0);
+ }
+ }
+};
+
+var SAIS$_induceSAs$LBitVector$AILOArray$AIIIB = SAIS._induceSAs$LBitVector$AILOArray$AIIIB;
+
+/**
+ * @param {!string} source
+ * @return {Array.<undefined|!number>}
+ */
+SAIS.make$S = function (source) {
+ /** @type {Array.<undefined|!number>} */
+ var charCodes;
+ /** @type {!number} */
+ var maxCode;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var code;
+ /** @type {Array.<undefined|!number>} */
+ var SA;
+ /** @type {OArray} */
+ var s;
+ charCodes = [ ];
+ charCodes.length = source.length;
+ maxCode = 0;
+ for (i = 0; i < source.length; i++) {
+ code = source.charCodeAt(i);
+ charCodes[i] = (code | 0);
+ maxCode = (code > maxCode ? code : maxCode);
+ }
+ SA = [ ];
+ SA.length = source.length;
+ s = ({offset: 0, array: charCodes});
+ SAIS$_make$LOArray$AIII(s, SA, source.length, maxCode);
+ return SA;
+};
+
+var SAIS$make$S = SAIS.make$S;
+
+/**
+ * @param {OArray} s
+ * @param {Array.<undefined|!number>} SA
+ * @param {!number} n
+ * @param {!number} K
+ */
+SAIS._make$LOArray$AIII = function (s, SA, n, K) {
+ /** @type {BitVector} */
+ var t;
+ /** @type {!number} */
+ var i;
+ /** @type {Array.<undefined|!number>} */
+ var bkt;
+ /** @type {!number} */
+ var n1;
+ /** @type {!number} */
+ var name;
+ /** @type {!number} */
+ var prev;
+ /** @type {undefined|!number} */
+ var pos;
+ /** @type {!boolean} */
+ var diff;
+ /** @type {!number} */
+ var d;
+ /** @type {!number} */
+ var j;
+ /** @type {Array.<undefined|!number>} */
+ var SA1;
+ /** @type {OArray} */
+ var s1;
+ /** @type {!number} */
+ var i$0;
+ /** @type {!number} */
+ var index$0;
+ t = new BitVector$();
+ t.set$IB(n - 2, false);
+ t.set$IB(n - 1, true);
+ for (i = n - 3; i >= 0; i--) {
+ t.set$IB(i, OArray$isS$LOArray$I(s, i) || OArray$compare$LOArray$II(s, i, i + 1) && t.get$I(i + 1));
+ }
+ bkt = [ ];
+ bkt.length = K + 1;
+ SAIS$_getBuckets$LOArray$AIIIB(s, bkt, n, K, true);
+ for (i = 0; i < n; i++) {
+ SA[i] = -1;
+ }
+ for (i = 1; i < n; i++) {
+ if (SAIS$_isLMS$LBitVector$I(t, i)) {
+ SA[-- bkt[OArray$get$LOArray$I(s, i)]] = (i | 0);
+ }
+ }
+ SAIS$_induceSAl$LBitVector$AILOArray$AIIIB(t, SA, s, bkt, n, K, false);
+ SAIS$_induceSAs$LBitVector$AILOArray$AIIIB(t, SA, s, bkt, n, K, true);
+ n1 = 0;
+ for (i = 0; i < n; i++) {
+ i$0 = SA[i];
+ if (i$0 > 0 && t.get$I(i$0) && ! t.get$I(i$0 - 1)) {
+ SA[n1++] = SA[i];
+ }
+ }
+ for (i = n1; i < n; i++) {
+ SA[i] = -1;
+ }
+ name = 0;
+ prev = -1;
+ for (i = 0; i < n1; i++) {
+ pos = SA[i];
+ diff = false;
+ for (d = 0; d < n; d++) {
+ if (prev === -1 || ! OArray$compare$LOArray$II(s, pos + d, prev + d) || t.get$I(pos + d) !== t.get$I(prev + d)) {
+ diff = true;
+ break;
+ } else {
+ if (d > 0 && (SAIS$_isLMS$LBitVector$I(t, pos + d) || SAIS$_isLMS$LBitVector$I(t, prev + d))) {
+ break;
+ }
+ }
+ }
+ if (diff) {
+ name++;
+ prev = pos;
+ }
+ pos = ((pos % 2 === 0 ? pos / 2 : (pos - 1) / 2) | 0);
+ SA[n1 + pos] = (name - 1 | 0);
+ }
+ for ((i = n - 1, j = n - 1); i >= n1; i--) {
+ if (SA[i] >= 0) {
+ SA[j--] = SA[i];
+ }
+ }
+ SA1 = SA;
+ s1 = ({offset: n - n1, array: SA});
+ if (name < n1) {
+ SAIS$_make$LOArray$AIII(s1, SA1, n1, name - 1);
+ } else {
+ for (i = 0; i < n1; i++) {
+ SA1[OArray$get$LOArray$I(s1, i)] = (i | 0);
+ }
+ }
+ bkt = [ ];
+ bkt.length = K + 1;
+ SAIS$_getBuckets$LOArray$AIIIB(s, bkt, n, K, true);
+ for ((i = 1, j = 0); i < n; i++) {
+ if (SAIS$_isLMS$LBitVector$I(t, i)) {
+ OArray$set$LOArray$II(s1, j++, i);
+ }
+ }
+ for (i = 0; i < n1; i++) {
+ index$0 = SA1[i];
+ SA1[i] = s1.array[index$0 + s1.offset];
+ }
+ for (i = n1; i < n; i++) {
+ SA[i] = -1;
+ }
+ for (i = n1 - 1; i >= 0; i--) {
+ j = SA[i];
+ SA[i] = -1;
+ SA[-- bkt[OArray$get$LOArray$I(s, j)]] = (j | 0);
+ }
+ SAIS$_induceSAl$LBitVector$AILOArray$AIIIB(t, SA, s, bkt, n, K, false);
+ SAIS$_induceSAs$LBitVector$AILOArray$AIIIB(t, SA, s, bkt, n, K, true);
+};
+
+var SAIS$_make$LOArray$AIII = SAIS._make$LOArray$AIII;
+
+OktaviaSearch._stemmer = null;
+OktaviaSearch._instance = null;
+$__jsx_lazy_init(Oktavia, "eof", function () {
+ return String.fromCharCode(0);
+});
+$__jsx_lazy_init(Oktavia, "eob", function () {
+ return String.fromCharCode(1);
+});
+$__jsx_lazy_init(Oktavia, "unknown", function () {
+ return String.fromCharCode(3);
+});
+Binary._base64EncodeChars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
+$__jsx_lazy_init(Binary, "_base64DecodeChars", function () {
+ return [ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 62, -1, -1, -1, 63, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, -1, -1, -1, -1, -1, -1, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -1, -1, -1, -1, -1, -1, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, -1, -1, -1, -1 ];
+});
+$__jsx_lazy_init(Style, "console", function () {
+ return ({ 'title': [ '\x1B[32m\x1b[4m', '\x1B[39m\x1b[0m' ], 'url': [ '\x1B[34m', '\x1B[39m' ], 'hit': [ '\x1B[4m', '\x1B[0m' ], 'del': [ '\x1B[9m', '\x1B[0m' ], 'summary': [ '\x1B[90m', '\x1B[39m' ] });
+});
+$__jsx_lazy_init(Style, "html", function () {
+ return ({ 'title': [ '<span class="title">', '</span>' ], 'url': [ '<span class="url">', '</span>' ], 'hit': [ '<span class="hit">', '</span>' ], 'del': [ '<del>', '</del>' ], 'summary': [ '<span class="reuslt">', '</span>' ] });
+});
+$__jsx_lazy_init(Style, "ignore", function () {
+ return ({ 'tilte': [ '', '' ], 'url': [ '', '' ], 'hit': [ '', '' ], 'del': [ '', '' ], 'summary': [ '', '' ] });
+});
+RomanianStemmer.serialVersionUID = 1;
+$__jsx_lazy_init(RomanianStemmer, "methodObject", function () {
+ return new RomanianStemmer$();
+});
+$__jsx_lazy_init(RomanianStemmer, "a_0", function () {
+ return [ new Among$SII("", -1, 3), new Among$SII("I", 0, 1), new Among$SII("U", 0, 2) ];
+});
+$__jsx_lazy_init(RomanianStemmer, "a_1", function () {
+ return [ new Among$SII("ea", -1, 3), new Among$SII("a\u0163ia", -1, 7), new Among$SII("aua", -1, 2), new Among$SII("iua", -1, 4), new Among$SII("a\u0163ie", -1, 7), new Among$SII("ele", -1, 3), new Among$SII("ile", -1, 5), new Among$SII("iile", 6, 4), new Among$SII("iei", -1, 4), new Among$SII("atei", -1, 6), new Among$SII("ii", -1, 4), new Among$SII("ului", -1, 1), new Among$SII("ul", -1, 1), new Among$SII("elor", -1, 3), new Among$SII("ilor", -1, 4), new Among$SII("iilor", 14, 4) ];
+});
+$__jsx_lazy_init(RomanianStemmer, "a_2", function () {
+ return [ new Among$SII("icala", -1, 4), new Among$SII("iciva", -1, 4), new Among$SII("ativa", -1, 5), new Among$SII("itiva", -1, 6), new Among$SII("icale", -1, 4), new Among$SII("a\u0163iune", -1, 5), new Among$SII("i\u0163iune", -1, 6), new Among$SII("atoare", -1, 5), new Among$SII("itoare", -1, 6), new Among$SII("\u0103toare", -1, 5), new Among$SII("icitate", -1, 4), new Among$SII("abilitate", -1, 1), new Among$SII("ibilitate", -1, 2), new Among$SII("ivitate", -1, 3), new Among$SII("icive", -1, 4), new Among$SII("ative", -1, 5), new Among$SII("itive", -1, 6), new Among$SII("icali", -1, 4), new Among$SII("atori", -1, 5), new Among$SII("icatori", 18, 4), new Among$SII("itori", -1, 6), new Among$SII("\u0103tori", -1, 5), new Among$SII("icitati", -1, 4), new Among$SII("abilitati", -1, 1), new Among$SII("ivitati", -1, 3), new Among$SII("icivi", -1, 4), new Among$SII("ativi", -1, 5), new Among$SII("itivi", -1, 6), new Among$SII("icit\u0103i", -1, 4), new Among$SII("abilit\u0103i", -1, 1), new Among$SII("ivit\u0103i", -1, 3), new Among$SII("icit\u0103\u0163i", -1, 4), new Among$SII("abilit\u0103\u0163i", -1, 1), new Among$SII("ivit\u0103\u0163i", -1, 3), new Among$SII("ical", -1, 4), new Among$SII("ator", -1, 5), new Among$SII("icator", 35, 4), new Among$SII("itor", -1, 6), new Among$SII("\u0103tor", -1, 5), new Among$SII("iciv", -1, 4), new Among$SII("ativ", -1, 5), new Among$SII("itiv", -1, 6), new Among$SII("ical\u0103", -1, 4), new Among$SII("iciv\u0103", -1, 4), new Among$SII("ativ\u0103", -1, 5), new Among$SII("itiv\u0103", -1, 6) ];
+});
+$__jsx_lazy_init(RomanianStemmer, "a_3", function () {
+ return [ new Among$SII("ica", -1, 1), new Among$SII("abila", -1, 1), new Among$SII("ibila", -1, 1), new Among$SII("oasa", -1, 1), new Among$SII("ata", -1, 1), new Among$SII("ita", -1, 1), new Among$SII("anta", -1, 1), new Among$SII("ista", -1, 3), new Among$SII("uta", -1, 1), new Among$SII("iva", -1, 1), new Among$SII("ic", -1, 1), new Among$SII("ice", -1, 1), new Among$SII("abile", -1, 1), new Among$SII("ibile", -1, 1), new Among$SII("isme", -1, 3), new Among$SII("iune", -1, 2), new Among$SII("oase", -1, 1), new Among$SII("ate", -1, 1), new Among$SII("itate", 17, 1), new Among$SII("ite", -1, 1), new Among$SII("ante", -1, 1), new Among$SII("iste", -1, 3), new Among$SII("ute", -1, 1), new Among$SII("ive", -1, 1), new Among$SII("ici", -1, 1), new Among$SII("abili", -1, 1), new Among$SII("ibili", -1, 1), new Among$SII("iuni", -1, 2), new Among$SII("atori", -1, 1), new Among$SII("osi", -1, 1), new Among$SII("ati", -1, 1), new Among$SII("itati", 30, 1), new Among$SII("iti", -1, 1), new Among$SII("anti", -1, 1), new Among$SII("isti", -1, 3), new Among$SII("uti", -1, 1), new Among$SII("i\u015Fti", -1, 3), new Among$SII("ivi", -1, 1), new Among$SII("it\u0103i", -1, 1), new Among$SII("o\u015Fi", -1, 1), new Among$SII("it\u0103\u0163i", -1, 1), new Among$SII("abil", -1, 1), new Among$SII("ibil", -1, 1), new Among$SII("ism", -1, 3), new Among$SII("ator", -1, 1), new Among$SII("os", -1, 1), new Among$SII("at", -1, 1), new Among$SII("it", -1, 1), new Among$SII("ant", -1, 1), new Among$SII("ist", -1, 3), new Among$SII("ut", -1, 1), new Among$SII("iv", -1, 1), new Among$SII("ic\u0103", -1, 1), new Among$SII("abil\u0103", -1, 1), new Among$SII("ibil\u0103", -1, 1), new Among$SII("oas\u0103", -1, 1), new Among$SII("at\u0103", -1, 1), new Among$SII("it\u0103", -1, 1), new Among$SII("ant\u0103", -1, 1), new Among$SII("ist\u0103", -1, 3), new Among$SII("ut\u0103", -1, 1), new Among$SII("iv\u0103", -1, 1) ];
+});
+$__jsx_lazy_init(RomanianStemmer, "a_4", function () {
+ return [ new Among$SII("ea", -1, 1), new Among$SII("ia", -1, 1), new Among$SII("esc", -1, 1), new Among$SII("\u0103sc", -1, 1), new Among$SII("ind", -1, 1), new Among$SII("\u00E2nd", -1, 1), new Among$SII("are", -1, 1), new Among$SII("ere", -1, 1), new Among$SII("ire", -1, 1), new Among$SII("\u00E2re", -1, 1), new Among$SII("se", -1, 2), new Among$SII("ase", 10, 1), new Among$SII("sese", 10, 2), new Among$SII("ise", 10, 1), new Among$SII("use", 10, 1), new Among$SII("\u00E2se", 10, 1), new Among$SII("e\u015Fte", -1, 1), new Among$SII("\u0103\u015Fte", -1, 1), new Among$SII("eze", -1, 1), new Among$SII("ai", -1, 1), new Among$SII("eai", 19, 1), new Among$SII("iai", 19, 1), new Among$SII("sei", -1, 2), new Among$SII("e\u015Fti", -1, 1), new Among$SII("\u0103\u015Fti", -1, 1), new Among$SII("ui", -1, 1), new Among$SII("ezi", -1, 1), new Among$SII("\u00E2i", -1, 1), new Among$SII("a\u015Fi", -1, 1), new Among$SII("se\u015Fi", -1, 2), new Among$SII("ase\u015Fi", 29, 1), new Among$SII("sese\u015Fi", 29, 2), new Among$SII("ise\u015Fi", 29, 1), new Among$SII("use\u015Fi", 29, 1), new Among$SII("\u00E2se\u015Fi", 29, 1), new Among$SII("i\u015Fi", -1, 1), new Among$SII("u\u015Fi", -1, 1), new Among$SII("\u00E2\u015Fi", -1, 1), new Among$SII("a\u0163i", -1, 2), new Among$SII("ea\u0163i", 38, 1), new Among$SII("ia\u0163i", 38, 1), new Among$SII("e\u0163i", -1, 2), new Among$SII("i\u0163i", -1, 2), new Among$SII("\u00E2\u0163i", -1, 2), new Among$SII("ar\u0103\u0163i", -1, 1), new Among$SII("ser\u0103\u0163i", -1, 2), new Among$SII("aser\u0103\u0163i", 45, 1), new Among$SII("seser\u0103\u0163i", 45, 2), new Among$SII("iser\u0103\u0163i", 45, 1), new Among$SII("user\u0103\u0163i", 45, 1), new Among$SII("\u00E2ser\u0103\u0163i", 45, 1), new Among$SII("ir\u0103\u0163i", -1, 1), new Among$SII("ur\u0103\u0163i", -1, 1), new Among$SII("\u00E2r\u0103\u0163i", -1, 1), new Among$SII("am", -1, 1), new Among$SII("eam", 54, 1), new Among$SII("iam", 54, 1), new Among$SII("em", -1, 2), new Among$SII("asem", 57, 1), new Among$SII("sesem", 57, 2), new Among$SII("isem", 57, 1), new Among$SII("usem", 57, 1), new Among$SII("\u00E2sem", 57, 1), new Among$SII("im", -1, 2), new Among$SII("\u00E2m", -1, 2), new Among$SII("\u0103m", -1, 2), new Among$SII("ar\u0103m", 65, 1), new Among$SII("ser\u0103m", 65, 2), new Among$SII("aser\u0103m", 67, 1), new Among$SII("seser\u0103m", 67, 2), new Among$SII("iser\u0103m", 67, 1), new Among$SII("user\u0103m", 67, 1), new Among$SII("\u00E2ser\u0103m", 67, 1), new Among$SII("ir\u0103m", 65, 1), new Among$SII("ur\u0103m", 65, 1), new Among$SII("\u00E2r\u0103m", 65, 1), new Among$SII("au", -1, 1), new Among$SII("eau", 76, 1), new Among$SII("iau", 76, 1), new Among$SII("indu", -1, 1), new Among$SII("\u00E2ndu", -1, 1), new Among$SII("ez", -1, 1), new Among$SII("easc\u0103", -1, 1), new Among$SII("ar\u0103", -1, 1), new Among$SII("ser\u0103", -1, 2), new Among$SII("aser\u0103", 84, 1), new Among$SII("seser\u0103", 84, 2), new Among$SII("iser\u0103", 84, 1), new Among$SII("user\u0103", 84, 1), new Among$SII("\u00E2ser\u0103", 84, 1), new Among$SII("ir\u0103", -1, 1), new Among$SII("ur\u0103", -1, 1), new Among$SII("\u00E2r\u0103", -1, 1), new Among$SII("eaz\u0103", -1, 1) ];
+});
+$__jsx_lazy_init(RomanianStemmer, "a_5", function () {
+ return [ new Among$SII("a", -1, 1), new Among$SII("e", -1, 1), new Among$SII("ie", 1, 1), new Among$SII("i", -1, 1), new Among$SII("\u0103", -1, 1) ];
+});
+$__jsx_lazy_init(RomanianStemmer, "g_v", function () {
+ return [ 17, 65, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 32, 0, 0, 4 ];
+});
+$__jsx_lazy_init(_Common, "buffers", function () {
+ return [ "comment", "sgmlDecl", "textNode", "tagName", "doctype", "procInstName", "procInstBody", "entity", "attribName", "attribValue", "cdata", "script" ];
+});
+$__jsx_lazy_init(_Common, "EVENTS", function () {
+ return [ "text", "processinginstruction", "sgmldeclaration", "doctype", "comment", "attribute", "opentag", "closetag", "opencdata", "cdata", "clo_State.CDATA", "error", "end", "ready", "script", "opennamespace", "closenamespace" ];
+});
+_Common.MAX_BUFFER_LENGTH = 65536;
+_State.BEGIN = 1;
+_State.TEXT = 2;
+_State.TEXT_ENTITY = 3;
+_State.OPEN_WAKA = 4;
+_State.SGML_DECL = 5;
+_State.SGML_DECL_QUOTED = 6;
+_State.DOCTYPE = 7;
+_State.DOCTYPE_QUOTED = 8;
+_State.DOCTYPE_DTD = 9;
+_State.DOCTYPE_DTD_QUOTED = 10;
+_State.COMMENT_STARTING = 11;
+_State.COMMENT = 12;
+_State.COMMENT_ENDING = 13;
+_State.COMMENT_ENDED = 14;
+_State.CDATA = 15;
+_State.CDATA_ENDING = 16;
+_State.CDATA_ENDING_2 = 17;
+_State.PROC_INST = 18;
+_State.PROC_INST_BODY = 19;
+_State.PROC_INST_ENDING = 20;
+_State.OPEN_TAG = 21;
+_State.OPEN_TAG_SLASH = 22;
+_State.ATTRIB = 23;
+_State.ATTRIB_NAME = 24;
+_State.ATTRIB_NAME_SAW_WHITE = 25;
+_State.ATTRIB_VALUE = 26;
+_State.ATTRIB_VALUE_QUOTED = 27;
+_State.ATTRIB_VALUE_UNQUOTED = 28;
+_State.ATTRIB_VALUE_ENTITY_Q = 29;
+_State.ATTRIB_VALUE_ENTITY_U = 30;
+_State.CLOSE_TAG = 31;
+_State.CLOSE_TAG_SAW_WHITE = 32;
+_State.SCRIPT = 33;
+_State.SCRIPT_ENDING = 34;
+$__jsx_lazy_init(_Entities, "_entities", function () {
+ return ({ "amp": "&", "gt": ">", "lt": "<", "quot": "\"", "apos": "'", "AElig": 198, "Aacute": 193, "Acirc": 194, "Agrave": 192, "Aring": 197, "Atilde": 195, "Auml": 196, "Ccedil": 199, "ETH": 208, "Eacute": 201, "Ecirc": 202, "Egrave": 200, "Euml": 203, "Iacute": 205, "Icirc": 206, "Igrave": 204, "Iuml": 207, "Ntilde": 209, "Oacute": 211, "Ocirc": 212, "Ograve": 210, "Oslash": 216, "Otilde": 213, "Ouml": 214, "THORN": 222, "Uacute": 218, "Ucirc": 219, "Ugrave": 217, "Uuml": 220, "Yacute": 221, "aacute": 225, "acirc": 226, "aelig": 230, "agrave": 224, "aring": 229, "atilde": 227, "auml": 228, "ccedil": 231, "eacute": 233, "ecirc": 234, "egrave": 232, "eth": 240, "euml": 235, "iacute": 237, "icirc": 238, "igrave": 236, "iuml": 239, "ntilde": 241, "oacute": 243, "ocirc": 244, "ograve": 242, "oslash": 248, "otilde": 245, "ouml": 246, "szlig": 223, "thorn": 254, "uacute": 250, "ucirc": 251, "ugrave": 249, "uuml": 252, "yacute": 253, "yuml": 255, "copy": 169, "reg": 174, "nbsp": 160, "iexcl": 161, "cent": 162, "pound": 163, "curren": 164, "yen": 165, "brvbar": 166, "sect": 167, "uml": 168, "ordf": 170, "laquo": 171, "not": 172, "shy": 173, "macr": 175, "deg": 176, "plusmn": 177, "sup1": 185, "sup2": 178, "sup3": 179, "acute": 180, "micro": 181, "para": 182, "middot": 183, "cedil": 184, "ordm": 186, "raquo": 187, "frac14": 188, "frac12": 189, "frac34": 190, "iquest": 191, "times": 215, "divide": 247, "OElig": 338, "oelig": 339, "Scaron": 352, "scaron": 353, "Yuml": 376, "fnof": 402, "circ": 710, "tilde": 732, "Alpha": 913, "Beta": 914, "Gamma": 915, "Delta": 916, "Epsilon": 917, "Zeta": 918, "Eta": 919, "Theta": 920, "Iota": 921, "Kappa": 922, "Lambda": 923, "Mu": 924, "Nu": 925, "Xi": 926, "Omicron": 927, "Pi": 928, "Rho": 929, "Sigma": 931, "Tau": 932, "Upsilon": 933, "Phi": 934, "Chi": 935, "Psi": 936, "Omega": 937, "alpha": 945, "beta": 946, "gamma": 947, "delta": 948, "epsilon": 949, "zeta": 950, "eta": 951, "theta": 952, "iota": 953, "kappa": 954, "lambda": 955, "mu": 956, "nu": 957, "xi": 958, "omicron": 959, "pi": 960, "rho": 961, "sigmaf": 962, "sigma": 963, "tau": 964, "upsilon": 965, "phi": 966, "chi": 967, "psi": 968, "omega": 969, "thetasym": 977, "upsih": 978, "piv": 982, "ensp": 8194, "emsp": 8195, "thinsp": 8201, "zwnj": 8204, "zwj": 8205, "lrm": 8206, "rlm": 8207, "ndash": 8211, "mdash": 8212, "lsquo": 8216, "rsquo": 8217, "sbquo": 8218, "ldquo": 8220, "rdquo": 8221, "bdquo": 8222, "dagger": 8224, "Dagger": 8225, "bull": 8226, "hellip": 8230, "permil": 8240, "prime": 8242, "Prime": 8243, "lsaquo": 8249, "rsaquo": 8250, "oline": 8254, "frasl": 8260, "euro": 8364, "image": 8465, "weierp": 8472, "real": 8476, "trade": 8482, "alefsym": 8501, "larr": 8592, "uarr": 8593, "rarr": 8594, "darr": 8595, "harr": 8596, "crarr": 8629, "lArr": 8656, "uArr": 8657, "rArr": 8658, "dArr": 8659, "hArr": 8660, "forall": 8704, "part": 8706, "exist": 8707, "empty": 8709, "nabla": 8711, "isin": 8712, "notin": 8713, "ni": 8715, "prod": 8719, "sum": 8721, "minus": 8722, "lowast": 8727, "radic": 8730, "prop": 8733, "infin": 8734, "ang": 8736, "and": 8743, "or": 8744, "cap": 8745, "cup": 8746, "int": 8747, "there4": 8756, "sim": 8764, "cong": 8773, "asymp": 8776, "ne": 8800, "equiv": 8801, "le": 8804, "ge": 8805, "sub": 8834, "sup": 8835, "nsub": 8836, "sube": 8838, "supe": 8839, "oplus": 8853, "otimes": 8855, "perp": 8869, "sdot": 8901, "lceil": 8968, "rceil": 8969, "lfloor": 8970, "rfloor": 8971, "lang": 9001, "rang": 9002, "loz": 9674, "spades": 9824, "clubs": 9827, "hearts": 9829, "diams": 9830 });
+});
+BitVector.SMALL_BLOCK_SIZE = 32;
+BitVector.LARGE_BLOCK_SIZE = 256;
+BitVector.BLOCK_RATE = 8;
+$__jsx_lazy_init(BurrowsWheelerTransform, "END_MARKER", function () {
+ return String.fromCharCode(0);
+});
+var $__jsx_classMap = {
+ "tool/web/oktavia-romanian-search.jsx": {
+ _Main: _Main,
+ _Main$: _Main$
+ },
+ "tool/web/oktavia-search.jsx": {
+ _Result: _Result,
+ _Result$SSSI: _Result$SSSI,
+ _Proposal: _Proposal,
+ _Proposal$SSI: _Proposal$SSI,
+ OktaviaSearch: OktaviaSearch,
+ OktaviaSearch$I: OktaviaSearch$I,
+ _Main: _Main$0,
+ _Main$: _Main$0$
+ },
+ "src/oktavia.jsx": {
+ Oktavia: Oktavia,
+ Oktavia$: Oktavia$
+ },
+ "src/binary-util.jsx": {
+ Binary: Binary,
+ Binary$: Binary$,
+ LoadedStringResult: LoadedStringResult,
+ LoadedStringResult$SI: LoadedStringResult$SI,
+ LoadedStringListResult: LoadedStringListResult,
+ LoadedStringListResult$SI: LoadedStringListResult$SI,
+ LoadedStringListMapResult: LoadedStringListMapResult,
+ LoadedStringListMapResult$SI: LoadedStringListMapResult$SI,
+ LoadedNumberListResult: LoadedNumberListResult,
+ LoadedNumberListResult$SI: LoadedNumberListResult$SI,
+ CompressionReport: CompressionReport,
+ CompressionReport$: CompressionReport$
+ },
+ "src/query.jsx": {
+ Query: Query,
+ Query$: Query$
+ },
+ "src/query-string-parser.jsx": {
+ QueryStringParser: QueryStringParser,
+ QueryStringParser$: QueryStringParser$
+ },
+ "src/search-result.jsx": {
+ Proposal: Proposal,
+ Proposal$II: Proposal$II,
+ Position: Position,
+ Position$SIB: Position$SIB,
+ SearchUnit: SearchUnit,
+ SearchUnit$I: SearchUnit$I,
+ SingleResult: SingleResult,
+ SingleResult$: SingleResult$,
+ SingleResult$SBB: SingleResult$SBB,
+ SearchSummary: SearchSummary,
+ SearchSummary$: SearchSummary$,
+ SearchSummary$LOktavia$: SearchSummary$LOktavia$
+ },
+ "src/style.jsx": {
+ Style: Style,
+ Style$S: Style$S,
+ _HTMLHandler: _HTMLHandler,
+ _HTMLHandler$HASB: _HTMLHandler$HASB
+ },
+ "src/stemmer/stemmer.jsx": {
+ Stemmer: Stemmer,
+ Stemmer$: Stemmer$
+ },
+ "src/stemmer/base-stemmer.jsx": {
+ BaseStemmer: BaseStemmer,
+ BaseStemmer$: BaseStemmer$
+ },
+ "src/stemmer/romanian-stemmer.jsx": {
+ RomanianStemmer: RomanianStemmer,
+ RomanianStemmer$: RomanianStemmer$
+ },
+ "src/stemmer/among.jsx": {
+ Among: Among,
+ Among$SII: Among$SII,
+ Among$SIIF$LBaseStemmer$B$LBaseStemmer$: Among$SIIF$LBaseStemmer$B$LBaseStemmer$
+ },
+ "src/metadata.jsx": {
+ Metadata: Metadata,
+ Metadata$LOktavia$: Metadata$LOktavia$,
+ Section: Section,
+ Section$LOktavia$: Section$LOktavia$,
+ Splitter: Splitter,
+ Splitter$LOktavia$: Splitter$LOktavia$,
+ Splitter$LOktavia$S: Splitter$LOktavia$S,
+ Table: Table,
+ Table$LOktavia$AS: Table$LOktavia$AS,
+ Block: Block,
+ Block$LOktavia$: Block$LOktavia$
+ },
+ "src/fm-index.jsx": {
+ FMIndex: FMIndex,
+ FMIndex$: FMIndex$
+ },
+ "src/sax.jsx": {
+ Tag: Tag,
+ Tag$S: Tag$S,
+ _Common: _Common,
+ _Common$: _Common$,
+ _State: _State,
+ _State$: _State$,
+ SAXHandler: SAXHandler,
+ SAXHandler$: SAXHandler$,
+ SAXParser: SAXParser,
+ SAXParser$LSAXHandler$: SAXParser$LSAXHandler$,
+ SAXParser$LSAXHandler$B: SAXParser$LSAXHandler$B,
+ Char: Char,
+ Char$: Char$,
+ _Entities: _Entities,
+ _Entities$: _Entities$
+ },
+ "src/bit-vector.jsx": {
+ BitVector: BitVector,
+ BitVector$: BitVector$
+ },
+ "src/wavelet-matrix.jsx": {
+ WaveletMatrix: WaveletMatrix,
+ WaveletMatrix$: WaveletMatrix$
+ },
+ "src/burrows-wheeler-transform.jsx": {
+ BurrowsWheelerTransform: BurrowsWheelerTransform,
+ BurrowsWheelerTransform$: BurrowsWheelerTransform$
+ },
+ "src/sais.jsx": {
+ OArray: OArray,
+ OArray$AI: OArray$AI,
+ OArray$AII: OArray$AII,
+ SAIS: SAIS,
+ SAIS$: SAIS$
+ }
+};
+
+
+/**
+ * launches _Main.main(:string[]):void invoked by jsx --run|--executable
+ */
+JSX.runMain = function (sourceFile, args) {
+ var module = JSX.require(sourceFile);
+ if (! module) {
+ throw new ReferenceError("entry point module not found in " + sourceFile);
+ }
+ if (! module._Main) {
+ throw new ReferenceError("entry point _Main not found in " + sourceFile);
+ }
+ if (! module._Main.main$AS) {
+ throw new ReferenceError("entry point _Main.main(:string[]):void not found in " + sourceFile);
+ }
+ module._Main.main$AS(args);
+};
+
+/**
+ * launches _Test#test*():void invoked by jsx --test
+ */
+JSX.runTests = function (sourceFile, tests) {
+ var module = JSX.require(sourceFile);
+ var testClass = module._Test$;
+
+ if (!testClass) return; // skip if there's no test class
+
+ if(tests.length === 0) {
+ var p = testClass.prototype;
+ for (var m in p) {
+ if (p[m] instanceof Function
+ && /^test.*[$]$/.test(m)) {
+ tests.push(m);
+ }
+ }
+ }
+ else { // set as process arguments
+ tests = tests.map(function (name) {
+ return name + "$"; // mangle for function test*():void
+ });
+ }
+
+ var testCase = new testClass();
+
+ if (testCase.beforeClass$AS != null)
+ testCase.beforeClass$AS(tests);
+
+ for (var i = 0; i < tests.length; ++i) {
+ (function (method) {
+ if (method in testCase) {
+ testCase.run$SF$V$(method, function() { testCase[method](); });
+ }
+ else {
+ throw new ReferenceError("No such test method: " + method);
+ }
+ }(tests[i]));
+ }
+
+ if (testCase.afterClass$ != null)
+ testCase.afterClass$();
+};
+/**
+ * call a function on load/DOMContentLoaded
+ */
+function $__jsx_onload (event) {
+ window.removeEventListener("load", $__jsx_onload);
+ document.removeEventListener("DOMContentLoaded", $__jsx_onload);
+ JSX.runMain("tool/web/oktavia-romanian-search.jsx", [])
+}
+
+window.addEventListener("load", $__jsx_onload);
+document.addEventListener("DOMContentLoaded", $__jsx_onload);
+
+})(JSX);
diff --git a/web/server/h2o/libh2o/misc/oktavia/lib/oktavia-russian-search.js b/web/server/h2o/libh2o/misc/oktavia/lib/oktavia-russian-search.js
new file mode 100644
index 00000000..5cbe8951
--- /dev/null
+++ b/web/server/h2o/libh2o/misc/oktavia/lib/oktavia-russian-search.js
@@ -0,0 +1,8254 @@
+// generatedy by JSX compiler 0.9.24 (2013-04-05 13:45:00 +0900; 1b229cc6a411f674f0f7cf7a79b7a8b3f8eb7414)
+var JSX = {};
+(function (JSX) {
+/**
+ * copies the implementations from source interface to target
+ */
+function $__jsx_merge_interface(target, source) {
+ for (var k in source.prototype)
+ if (source.prototype.hasOwnProperty(k))
+ target.prototype[k] = source.prototype[k];
+}
+
+/**
+ * defers the initialization of the property
+ */
+function $__jsx_lazy_init(obj, prop, func) {
+ function reset(obj, prop, value) {
+ delete obj[prop];
+ obj[prop] = value;
+ return value;
+ }
+
+ Object.defineProperty(obj, prop, {
+ get: function () {
+ return reset(obj, prop, func());
+ },
+ set: function (v) {
+ reset(obj, prop, v);
+ },
+ enumerable: true,
+ configurable: true
+ });
+}
+
+/**
+ * sideeffect().a /= b
+ */
+function $__jsx_div_assign(obj, prop, divisor) {
+ return obj[prop] = (obj[prop] / divisor) | 0;
+}
+
+/*
+ * global functions, renamed to avoid conflict with local variable names
+ */
+var $__jsx_parseInt = parseInt;
+var $__jsx_parseFloat = parseFloat;
+var $__jsx_isNaN = isNaN;
+var $__jsx_isFinite = isFinite;
+
+var $__jsx_encodeURIComponent = encodeURIComponent;
+var $__jsx_decodeURIComponent = decodeURIComponent;
+var $__jsx_encodeURI = encodeURI;
+var $__jsx_decodeURI = decodeURI;
+
+var $__jsx_ObjectToString = Object.prototype.toString;
+var $__jsx_ObjectHasOwnProperty = Object.prototype.hasOwnProperty;
+
+/*
+ * profiler object, initialized afterwards
+ */
+function $__jsx_profiler() {
+}
+
+/*
+ * public interface to JSX code
+ */
+JSX.require = function (path) {
+ var m = $__jsx_classMap[path];
+ return m !== undefined ? m : null;
+};
+
+JSX.profilerIsRunning = function () {
+ return $__jsx_profiler.getResults != null;
+};
+
+JSX.getProfileResults = function () {
+ return ($__jsx_profiler.getResults || function () { return {}; })();
+};
+
+JSX.postProfileResults = function (url, cb) {
+ if ($__jsx_profiler.postResults == null)
+ throw new Error("profiler has not been turned on");
+ return $__jsx_profiler.postResults(url, cb);
+};
+
+JSX.resetProfileResults = function () {
+ if ($__jsx_profiler.resetResults == null)
+ throw new Error("profiler has not been turned on");
+ return $__jsx_profiler.resetResults();
+};
+JSX.DEBUG = false;
+/**
+ * class _Main extends Object
+ * @constructor
+ */
+function _Main() {
+}
+
+/**
+ * @constructor
+ */
+function _Main$() {
+};
+
+_Main$.prototype = new _Main;
+
+/**
+ * @param {Array.<undefined|!string>} args
+ */
+_Main.main$AS = function (args) {
+ OktaviaSearch$setStemmer$LStemmer$(new RussianStemmer$());
+};
+
+var _Main$main$AS = _Main.main$AS;
+
+/**
+ * class _Result extends Object
+ * @constructor
+ */
+function _Result() {
+}
+
+/**
+ * @constructor
+ * @param {!string} title
+ * @param {!string} url
+ * @param {!string} content
+ * @param {!number} score
+ */
+function _Result$SSSI(title, url, content, score) {
+ this.title = title;
+ this.url = url;
+ this.content = content;
+ this.score = score;
+};
+
+_Result$SSSI.prototype = new _Result;
+
+/**
+ * class _Proposal extends Object
+ * @constructor
+ */
+function _Proposal() {
+}
+
+/**
+ * @constructor
+ * @param {!string} options
+ * @param {!string} label
+ * @param {!number} count
+ */
+function _Proposal$SSI(options, label, count) {
+ this.options = options;
+ this.label = label;
+ this.count = count;
+};
+
+_Proposal$SSI.prototype = new _Proposal;
+
+/**
+ * class OktaviaSearch extends Object
+ * @constructor
+ */
+function OktaviaSearch() {
+}
+
+/**
+ * @constructor
+ * @param {!number} entriesPerPage
+ */
+function OktaviaSearch$I(entriesPerPage) {
+ this._queries = null;
+ this._highlight = "";
+ this._result = null;
+ this._proposals = null;
+ this._currentFolderDepth = 0;
+ this._oktavia = new Oktavia$();
+ this._entriesPerPage = entriesPerPage;
+ this._currentPage = 1;
+ this._queryString = null;
+ this._callback = null;
+ OktaviaSearch._instance = this;
+};
+
+OktaviaSearch$I.prototype = new OktaviaSearch;
+
+/**
+ * @param {Stemmer} stemmer
+ */
+OktaviaSearch.setStemmer$LStemmer$ = function (stemmer) {
+ /** @type {Oktavia} */
+ var this$0;
+ if (OktaviaSearch._instance) {
+ this$0 = OktaviaSearch._instance._oktavia;
+ this$0._stemmer = stemmer;
+ } else {
+ OktaviaSearch._stemmer = stemmer;
+ }
+};
+
+var OktaviaSearch$setStemmer$LStemmer$ = OktaviaSearch.setStemmer$LStemmer$;
+
+/**
+ * @param {!string} index
+ */
+OktaviaSearch.prototype.loadIndex$S = function (index) {
+ /** @type {Oktavia} */
+ var this$0;
+ /** @type {Stemmer} */
+ var stemmer$0;
+ if (OktaviaSearch._stemmer) {
+ this$0 = this._oktavia;
+ stemmer$0 = OktaviaSearch._stemmer;
+ this$0._stemmer = stemmer$0;
+ }
+ this._oktavia.load$S(Binary$base64decode$S(index));
+ if (this._queryString) {
+ this.search$SF$IIV$(this._queryString, this._callback);
+ this._queryString = null;
+ this._callback = null;
+ }
+};
+
+/**
+ * @param {!string} queryString
+ * @param {*} callback
+ */
+OktaviaSearch.prototype.search$SF$IIV$ = function (queryString, callback) {
+ /** @type {QueryStringParser} */
+ var queryParser;
+ /** @type {SearchSummary} */
+ var summary;
+ /** @type {Array.<undefined|SearchUnit>} */
+ var _result$0;
+ if (this._oktavia) {
+ queryParser = ({queries: [ ]});
+ this._queries = QueryStringParser$parse$LQueryStringParser$S(queryParser, queryString);
+ this._highlight = QueryStringParser$highlight$LQueryStringParser$(queryParser);
+ summary = this._oktavia.search$ALQuery$(this._queries);
+ if (SearchSummary$size$LSearchSummary$(summary) > 0) {
+ this._result = this._sortResult$LSearchSummary$(summary);
+ this._proposals = [ ];
+ this._currentPage = 1;
+ } else {
+ this._result = [ ];
+ if (this._queries.length > 1) {
+ this._proposals = SearchSummary$getProposal$LSearchSummary$(summary);
+ } else {
+ this._proposals = [ ];
+ }
+ this._currentPage = 1;
+ }
+ callback((_result$0 = this._result).length, Math.ceil(_result$0.length / this._entriesPerPage));
+ } else {
+ this._queryString = queryString;
+ this._callback = callback;
+ }
+};
+
+/**
+ * @return {!number}
+ */
+OktaviaSearch.prototype.resultSize$ = function () {
+ return (this._result.length | 0);
+};
+
+/**
+ * @return {!number}
+ */
+OktaviaSearch.prototype.totalPages$ = function () {
+ return (Math.ceil(this._result.length / this._entriesPerPage) | 0);
+};
+
+/**
+ * @return {!number}
+ */
+OktaviaSearch.prototype.currentPage$ = function () {
+ return this._currentPage;
+};
+
+/**
+ * @param {!number} page
+ */
+OktaviaSearch.prototype.setCurrentPage$I = function (page) {
+ this._currentPage = page;
+};
+
+/**
+ * @return {!boolean}
+ */
+OktaviaSearch.prototype.hasPrevPage$ = function () {
+ return this._currentPage !== 1;
+};
+
+/**
+ * @return {!boolean}
+ */
+OktaviaSearch.prototype.hasNextPage$ = function () {
+ return this._currentPage !== Math.ceil(this._result.length / this._entriesPerPage);
+};
+
+/**
+ * @return {Array.<undefined|!string>}
+ */
+OktaviaSearch.prototype.pageIndexes$ = function () {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var total;
+ /** @type {!number} */
+ var i;
+ result = [ ];
+ total = Math.ceil(this._result.length / this._entriesPerPage);
+ if (total < 10) {
+ for (i = 1; i <= total; i++) {
+ result.push(i + "");
+ }
+ } else {
+ if (this._currentPage <= 5) {
+ for (i = 1; i <= 7; i++) {
+ result.push(i + "");
+ }
+ result.push('...', total + "");
+ } else {
+ if (total - 5 <= this._currentPage) {
+ result.push('1', '...');
+ for (i = total - 8; i <= total; i++) {
+ result.push(i + "");
+ }
+ } else {
+ result.push('1', '...');
+ for (i = this._currentPage - 3; i <= this._currentPage + 3; i++) {
+ result.push(i + "");
+ }
+ result.push('...', total + "");
+ }
+ }
+ }
+ return result;
+};
+
+/**
+ * @return {Array.<undefined|_Result>}
+ */
+OktaviaSearch.prototype.getResult$ = function () {
+ /** @type {Style} */
+ var style;
+ /** @type {!number} */
+ var start;
+ /** @type {!number} */
+ var last;
+ /** @type {Metadata} */
+ var metadata;
+ /** @type {!number} */
+ var num;
+ /** @type {Array.<undefined|_Result>} */
+ var results;
+ /** @type {!number} */
+ var i;
+ /** @type {SearchUnit} */
+ var unit;
+ /** @type {Array.<undefined|!string>} */
+ var info;
+ /** @type {!string} */
+ var content;
+ /** @type {Array.<undefined|Position>} */
+ var positions;
+ /** @type {!number} */
+ var end;
+ /** @type {!boolean} */
+ var split;
+ /** @type {!number} */
+ var j;
+ /** @type {Position} */
+ var pos;
+ /** @type {!string} */
+ var text;
+ /** @type {Oktavia} */
+ var this$0;
+ /** @type {!number} */
+ var position$0;
+ /** @type {!number} */
+ var _currentPage$0;
+ /** @type {!number} */
+ var _entriesPerPage$0;
+ style = new Style$S('html');
+ start = ((_currentPage$0 = this._currentPage) - 1) * (_entriesPerPage$0 = this._entriesPerPage);
+ last = Math.min(_currentPage$0 * _entriesPerPage$0, this._result.length);
+ this$0 = this._oktavia;
+ metadata = this$0._metadatas[this$0._metadataLabels[0]];
+ num = 250;
+ results = [ ];
+ for (i = start; i < last; i++) {
+ unit = this._result[i];
+ info = metadata.getInformation$I(unit.id).split(Oktavia.eob);
+ content = metadata.getContent$I(unit.id);
+ start = 0;
+ positions = SearchUnit$getPositions$LSearchUnit$(unit);
+ if (content.indexOf(info[0]) === 1) {
+ content = content.slice(info[0].length + 2, content.length);
+ start += info[0].length + 2;
+ }
+ end = start + num;
+ split = false;
+ if (positions[0].position > end - positions[0].word.length) {
+ end = positions[0].position + Math.floor(num / 2);
+ split = true;
+ }
+ for (j = positions.length - 1; j > -1; j--) {
+ pos = positions[j];
+ if (pos.position + pos.word.length < end) {
+ content = [ content.slice(0, pos.position - start), style.convert$S('<hit>*</hit>').replace('*', content.slice((position$0 = pos.position) - start, position$0 + pos.word.length - start)), content.slice(pos.position + pos.word.length - start, content.length) ].join('');
+ }
+ }
+ if (split) {
+ text = [ content.slice(0, Math.floor(num / 2)) + ' ...', content.slice(- Math.floor(num / 2), end - start) ].join('<br/>');
+ } else {
+ text = content.slice(0, end - start) + ' ...<br/>';
+ }
+ text = text.replace(Oktavia.eob, ' ').replace(/(<br\/>)(<br\/>)+/, '<br/><br/>');
+ results.push(({title: info[0], url: info[1], content: text, score: unit.score}));
+ }
+ return results;
+};
+
+/**
+ * @return {!string}
+ */
+OktaviaSearch.prototype.getHighlight$ = function () {
+ return this._highlight;
+};
+
+/**
+ * @return {Array.<undefined|_Proposal>}
+ */
+OktaviaSearch.prototype.getProposals$ = function () {
+ /** @type {Style} */
+ var style;
+ /** @type {Array.<undefined|_Proposal>} */
+ var results;
+ /** @type {!number} */
+ var i;
+ /** @type {Proposal} */
+ var proposal;
+ /** @type {Array.<undefined|!string>} */
+ var label;
+ /** @type {Array.<undefined|!string>} */
+ var option;
+ /** @type {!number} */
+ var j;
+ style = new Style$S('html');
+ results = [ ];
+ if (this._queries.length > 1) {
+ for (i = 0; i < this._proposals.length; i++) {
+ proposal = this._proposals[i];
+ if (proposal.expect > 0) {
+ label = [ ];
+ option = [ ];
+ for (j = 0; j < this._queries.length; j++) {
+ if (j !== proposal.omit) {
+ label.push(style.convert$S('<hit>' + this._queries[j].toString() + '</hit>'));
+ option.push(this._queries[j].toString());
+ } else {
+ label.push(style.convert$S('<del>' + this._queries[j].toString() + '</del>'));
+ }
+ }
+ results.push(({options: option.join(' '), label: label.join('&nbsp;'), count: proposal.expect}));
+ }
+ }
+ }
+ return results;
+};
+
+/**
+ * @param {SearchSummary} summary
+ * @return {Array.<undefined|SearchUnit>}
+ */
+OktaviaSearch.prototype._sortResult$LSearchSummary$ = function (summary) {
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var score;
+ /** @type {SearchUnit} */
+ var unit;
+ /** @type {!string} */
+ var pos;
+ /** @type {Position} */
+ var position;
+ for (i = 0; i < summary.result.units.length; i++) {
+ score = 0;
+ unit = summary.result.units[i];
+ for (pos in unit.positions) {
+ position = unit.positions[pos];
+ if (this._oktavia.wordPositionType$I(position.position)) {
+ score += 10;
+ } else {
+ score += 1;
+ }
+ if (! position.stemmed) {
+ score += 2;
+ }
+ }
+ unit.score = (score | 0);
+ }
+ return SearchSummary$getSortedResult$LSearchSummary$(summary);
+};
+
+/**
+ * class _Main$0 extends Object
+ * @constructor
+ */
+function _Main$0() {
+}
+
+/**
+ * @constructor
+ */
+function _Main$0$() {
+};
+
+_Main$0$.prototype = new _Main$0;
+
+/**
+ * @param {Array.<undefined|!string>} args
+ */
+_Main$0.main$AS = function (args) {
+};
+
+var _Main$0$main$AS = _Main$0.main$AS;
+
+/**
+ * class Oktavia extends Object
+ * @constructor
+ */
+function Oktavia() {
+}
+
+/**
+ * @constructor
+ */
+function Oktavia$() {
+ /** @type {Array.<undefined|!string>} */
+ var _utf162compressCode$0;
+ this._compressCode2utf16 = null;
+ this._fmindex = new FMIndex$();
+ this._metadatas = ({ });
+ this._metadataLabels = [ ];
+ this._stemmer = null;
+ this._stemmingResult = ({ });
+ _utf162compressCode$0 = this._utf162compressCode = [ Oktavia.eof, Oktavia.eob, Oktavia.unknown ];
+ _utf162compressCode$0.length = 65536;
+ this._compressCode2utf16 = [ Oktavia.eof, Oktavia.eob, Oktavia.unknown ];
+};
+
+Oktavia$.prototype = new Oktavia;
+
+/**
+ * @param {Stemmer} stemmer
+ */
+Oktavia.prototype.setStemmer$LStemmer$ = function (stemmer) {
+ this._stemmer = stemmer;
+};
+
+/**
+ * @return {Metadata}
+ */
+Oktavia.prototype.getPrimaryMetadata$ = function () {
+ return this._metadatas[this._metadataLabels[0]];
+};
+
+/**
+ * @param {!string} key
+ * @return {Section}
+ */
+Oktavia.prototype.addSection$S = function (key) {
+ /** @type {Section} */
+ var section;
+ if (this._metadataLabels.indexOf(key) !== -1) {
+ throw new Error('Metadata name ' + key + ' is already exists');
+ }
+ this._metadataLabels.push(key);
+ section = new Section$LOktavia$(this);
+ this._metadatas[key] = section;
+ return section;
+};
+
+/**
+ * @param {!string} key
+ * @return {Section}
+ */
+Oktavia.prototype.getSection$S = function (key) {
+ if (this._metadataLabels.indexOf(key) === -1) {
+ throw new Error('Metadata name ' + key + " does't exists");
+ }
+ return this._metadatas[key];
+};
+
+/**
+ * @param {!string} key
+ * @return {Splitter}
+ */
+Oktavia.prototype.addSplitter$S = function (key) {
+ /** @type {Splitter} */
+ var splitter;
+ if (this._metadataLabels.indexOf(key) !== -1) {
+ throw new Error('Metadata name ' + key + ' is already exists');
+ }
+ this._metadataLabels.push(key);
+ splitter = new Splitter$LOktavia$(this);
+ this._metadatas[key] = splitter;
+ return splitter;
+};
+
+/**
+ * @param {!string} key
+ * @return {Splitter}
+ */
+Oktavia.prototype.getSplitter$S = function (key) {
+ if (this._metadataLabels.indexOf(key) === -1) {
+ throw new Error('Metadata name ' + key + " does't exists");
+ }
+ return this._metadatas[key];
+};
+
+/**
+ * @param {!string} key
+ * @param {Array.<undefined|!string>} headers
+ * @return {Table}
+ */
+Oktavia.prototype.addTable$SAS = function (key, headers) {
+ /** @type {Table} */
+ var table;
+ if (this._metadataLabels.indexOf(key) !== -1) {
+ throw new Error('Metadata name ' + key + ' is already exists');
+ }
+ this._metadataLabels.push(key);
+ table = new Table$LOktavia$AS(this, headers);
+ this._metadatas[key] = table;
+ return table;
+};
+
+/**
+ * @param {!string} key
+ * @return {Table}
+ */
+Oktavia.prototype.getTable$S = function (key) {
+ if (this._metadataLabels.indexOf(key) === -1) {
+ throw new Error('Metadata name ' + key + " does't exists");
+ }
+ return this._metadatas[key];
+};
+
+/**
+ * @param {!string} key
+ * @return {Block}
+ */
+Oktavia.prototype.addBlock$S = function (key) {
+ /** @type {Block} */
+ var block;
+ if (this._metadataLabels.indexOf(key) !== -1) {
+ throw new Error('Metadata name ' + key + ' is already exists');
+ }
+ this._metadataLabels.push(key);
+ block = new Block$LOktavia$(this);
+ this._metadatas[key] = block;
+ return block;
+};
+
+/**
+ * @param {!string} key
+ * @return {Block}
+ */
+Oktavia.prototype.getBlock$S = function (key) {
+ if (this._metadataLabels.indexOf(key) === -1) {
+ throw new Error('Metadata name ' + key + " does't exists");
+ }
+ return this._metadatas[key];
+};
+
+/**
+ */
+Oktavia.prototype.addEndOfBlock$ = function () {
+ this._fmindex.push$S(Oktavia.eob);
+};
+
+/**
+ * @param {!string} words
+ */
+Oktavia.prototype.addWord$S = function (words) {
+ /** @type {Array.<undefined|!string>} */
+ var str;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var charCode;
+ /** @type {undefined|!string} */
+ var newCharCode;
+ str = [ ];
+ str.length = words.length;
+ for (i = 0; i < words.length; i++) {
+ charCode = words.charCodeAt(i);
+ newCharCode = this._utf162compressCode[charCode];
+ if (newCharCode == null) {
+ newCharCode = String.fromCharCode(this._compressCode2utf16.length);
+ this._utf162compressCode[charCode] = newCharCode;
+ this._compressCode2utf16.push(String.fromCharCode(charCode));
+ }
+ str.push(newCharCode);
+ }
+ this._fmindex.push$S(str.join(''));
+};
+
+/**
+ * @param {!string} words
+ * @param {!boolean} stemming
+ */
+Oktavia.prototype.addWord$SB = function (words, stemming) {
+ /** @type {Array.<undefined|!string>} */
+ var wordList;
+ /** @type {!number} */
+ var i;
+ /** @type {undefined|!string} */
+ var originalWord;
+ /** @type {!string} */
+ var smallWord;
+ /** @type {undefined|!string} */
+ var registerWord;
+ /** @type {!string} */
+ var baseWord;
+ /** @type {!string} */
+ var compressedCodeWord;
+ /** @type {Array.<undefined|!string>} */
+ var stemmedList;
+ this.addWord$S(words);
+ wordList = words.split(/\s+/);
+ for (i = 0; i < wordList.length; i++) {
+ originalWord = wordList[i];
+ smallWord = originalWord.slice(0, 1).toLowerCase() + originalWord.slice(1);
+ registerWord = null;
+ if (stemming && this._stemmer) {
+ baseWord = this._stemmer.stemWord$S(originalWord.toLowerCase());
+ if (originalWord.indexOf(baseWord) === -1) {
+ registerWord = baseWord;
+ }
+ } else {
+ if (originalWord != smallWord) {
+ registerWord = smallWord;
+ }
+ }
+ if (registerWord) {
+ compressedCodeWord = this._convertToCompressionCode$S(originalWord);
+ stemmedList = this._stemmingResult[registerWord];
+ if (! stemmedList) {
+ stemmedList = [ compressedCodeWord ];
+ this._stemmingResult[registerWord] = stemmedList;
+ } else {
+ if (stemmedList.indexOf(compressedCodeWord) === -1) {
+ stemmedList.push(compressedCodeWord);
+ }
+ }
+ }
+ }
+};
+
+/**
+ * @param {!string} keyword
+ * @return {!string}
+ */
+Oktavia.prototype._convertToCompressionCode$S = function (keyword) {
+ /** @type {Array.<undefined|!string>} */
+ var resultChars;
+ /** @type {!number} */
+ var i;
+ /** @type {undefined|!string} */
+ var chr;
+ resultChars = [ ];
+ for (i = 0; i < keyword.length; i++) {
+ chr = this._utf162compressCode[keyword.charCodeAt(i)];
+ if (chr == null) {
+ resultChars.push(Oktavia.unknown);
+ } else {
+ resultChars.push(chr);
+ }
+ }
+ return resultChars.join('');
+};
+
+/**
+ * @param {!string} keyword
+ * @param {!boolean} stemming
+ * @return {Array.<undefined|!number>}
+ */
+Oktavia.prototype.rawSearch$SB = function (keyword, stemming) {
+ /** @type {Array.<undefined|!number>} */
+ var result;
+ /** @type {!string} */
+ var baseWord;
+ /** @type {Array.<undefined|!string>} */
+ var stemmedList;
+ /** @type {!number} */
+ var i;
+ /** @type {undefined|!string} */
+ var word;
+ if (stemming) {
+ result = [ ];
+ if (this._stemmer) {
+ baseWord = this._stemmer.stemWord$S(keyword.toLowerCase());
+ stemmedList = this._stemmingResult[baseWord];
+ if (stemmedList) {
+ for (i = 0; i < stemmedList.length; i++) {
+ word = stemmedList[i];
+ result = result.concat(this._fmindex.search$S(word));
+ }
+ }
+ }
+ } else {
+ result = this._fmindex.search$S(this._convertToCompressionCode$S(keyword));
+ }
+ return result;
+};
+
+/**
+ * @param {Array.<undefined|Query>} queries
+ * @return {SearchSummary}
+ */
+Oktavia.prototype.search$ALQuery$ = function (queries) {
+ /** @type {SearchSummary} */
+ var summary;
+ /** @type {!number} */
+ var i;
+ /** @type {SingleResult} */
+ var result$0;
+ summary = ({sourceResults: [ ], result: null, oktavia: this});
+ for (i = 0; i < queries.length; i++) {
+ result$0 = this._searchQuery$LQuery$(queries[i]);
+ summary.sourceResults.push(result$0);
+ }
+ summary.result = SearchSummary$mergeResult$LSearchSummary$ALSingleResult$(summary, summary.sourceResults);
+ return summary;
+};
+
+/**
+ * @param {Query} query
+ * @return {SingleResult}
+ */
+Oktavia.prototype._searchQuery$LQuery$ = function (query) {
+ /** @type {SingleResult} */
+ var result;
+ /** @type {Array.<undefined|!number>} */
+ var positions;
+ result = new SingleResult$SBB(query.word, query.or, query.not);
+ if (query.raw) {
+ positions = this.rawSearch$SB(query.word, false);
+ } else {
+ positions = this.rawSearch$SB(query.word, false).concat(this.rawSearch$SB(query.word, true));
+ }
+ this._metadatas[this._metadataLabels[0]].grouping$LSingleResult$AISB(result, positions, query.word, ! query.raw);
+ return result;
+};
+
+/**
+ */
+Oktavia.prototype.build$ = function () {
+ this.build$IB(5, false);
+};
+
+/**
+ * @param {!number} cacheDensity
+ * @param {!boolean} verbose
+ */
+Oktavia.prototype.build$IB = function (cacheDensity, verbose) {
+ /** @type {!string} */
+ var key;
+ /** @type {!number} */
+ var cacheRange;
+ /** @type {!number} */
+ var maxChar;
+ for (key in this._metadatas) {
+ this._metadatas[key]._build$();
+ }
+ cacheRange = Math.round(Math.max(1, 100 / Math.min(100, Math.max(0.01, cacheDensity))));
+ maxChar = this._compressCode2utf16.length;
+ this._fmindex.build$SIIB(Oktavia.eof, maxChar, cacheRange, verbose);
+};
+
+/**
+ * @return {!string}
+ */
+Oktavia.prototype.dump$ = function () {
+ return this.dump$B(false);
+};
+
+/**
+ * @param {!boolean} verbose
+ * @return {!string}
+ */
+Oktavia.prototype.dump$B = function (verbose) {
+ /** @type {!string} */
+ var header;
+ /** @type {!string} */
+ var fmdata;
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var i;
+ /** @type {CompressionReport} */
+ var report;
+ /** @type {undefined|!string} */
+ var name;
+ /** @type {!string} */
+ var data;
+ header = Binary$dumpString$SLCompressionReport$("oktavia-01", null).slice(1);
+ if (verbose) {
+ console.log("Source text size: " + (this._fmindex.size$() * 2 + "") + ' bytes');
+ }
+ fmdata = this._fmindex.dump$B(verbose);
+ result = [ header, fmdata ];
+ result.push(Binary$dump16bitNumber$I(this._compressCode2utf16.length));
+ for (i = 3; i < this._compressCode2utf16.length; i++) {
+ result.push(this._compressCode2utf16[i]);
+ }
+ if (verbose) {
+ console.log('Char Code Map: ' + (this._compressCode2utf16.length * 2 - 2 + "") + ' bytes');
+ }
+ report = ({source: 0, result: 0});
+ result.push(Binary$dumpStringListMap$HASLCompressionReport$(this._stemmingResult, report));
+ if (verbose) {
+ console.log('Stemmed Word Table: ' + (result[result.length - 1].length + "") + ' bytes (' + (Math.round(report.result * 100.0 / report.source) + "") + '%)');
+ }
+ result.push(Binary$dump16bitNumber$I(this._metadataLabels.length));
+ for (i = 0; i < this._metadataLabels.length; i++) {
+ report = ({source: 0, result: 0});
+ name = this._metadataLabels[i];
+ data = this._metadatas[name]._dump$LCompressionReport$(report);
+ result.push(Binary$dumpString$SLCompressionReport$(name, report), data);
+ if (verbose) {
+ console.log('Meta Data ' + name + ': ' + (data.length * 2 + "") + ' bytes (' + (Math.round(report.result * 100.0 / report.source) + "") + '%)');
+ }
+ }
+ return result.join('');
+};
+
+/**
+ * @param {!string} data
+ */
+Oktavia.prototype.load$S = function (data) {
+ /** @type {!string} */
+ var header;
+ /** @type {!number} */
+ var offset;
+ /** @type {!number} */
+ var charCodeCount;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var charCode;
+ /** @type {LoadedStringListMapResult} */
+ var stemmedWords;
+ /** @type {!number} */
+ var metadataCount;
+ /** @type {LoadedStringResult} */
+ var nameResult;
+ /** @type {!string} */
+ var name;
+ /** @type {!number} */
+ var type;
+ header = Binary$dumpString$SLCompressionReport$("oktavia-01", null).slice(1);
+ if (data.slice(0, 5) !== header) {
+ throw new Error('Invalid data file');
+ }
+ this._metadatas = ({ });
+ this._metadataLabels = [ ];
+ offset = 5;
+ offset = this._fmindex.load$SI(data, offset);
+ charCodeCount = Binary$load16bitNumber$SI(data, offset++);
+ this._compressCode2utf16 = [ Oktavia.eof, Oktavia.eob, Oktavia.unknown ];
+ this._utf162compressCode = [ Oktavia.eof, Oktavia.eob, Oktavia.unknown ];
+ for (i = 3; i < charCodeCount; i++) {
+ charCode = Binary$load16bitNumber$SI(data, offset++);
+ this._compressCode2utf16.push(String.fromCharCode(charCode));
+ this._utf162compressCode[charCode] = String.fromCharCode(i);
+ }
+ stemmedWords = Binary$loadStringListMap$SI(data, offset);
+ this._stemmingResult = stemmedWords.result;
+ offset = stemmedWords.offset;
+ metadataCount = Binary$load16bitNumber$SI(data, offset++);
+ for (i = 0; i < metadataCount; i++) {
+ nameResult = Binary$loadString$SI(data, offset);
+ name = nameResult.result;
+ offset = nameResult.offset;
+ type = Binary$load16bitNumber$SI(data, offset++);
+ switch (type) {
+ case 0:
+ offset = Section$_load$LOktavia$SSI(this, name, data, offset);
+ break;
+ case 1:
+ offset = Splitter$_load$LOktavia$SSI(this, name, data, offset);
+ break;
+ case 2:
+ offset = Table$_load$LOktavia$SSI(this, name, data, offset);
+ break;
+ case 3:
+ offset = Block$_load$LOktavia$SSI(this, name, data, offset);
+ break;
+ }
+ }
+};
+
+/**
+ * @return {!number}
+ */
+Oktavia.prototype.contentSize$ = function () {
+ /** @type {FMIndex} */
+ var this$0;
+ this$0 = this._fmindex;
+ return this$0._substr.length;
+};
+
+/**
+ * @param {!number} position
+ * @return {!number}
+ */
+Oktavia.prototype.wordPositionType$I = function (position) {
+ /** @type {!number} */
+ var result;
+ /** @type {!string} */
+ var ahead;
+ result = 0;
+ if (position === 0) {
+ result = 4;
+ } else {
+ ahead = this._fmindex.getSubstring$II(position - 1, 1);
+ if (/\s/.test(ahead)) {
+ result = 2;
+ } else {
+ if (/\W/.test(ahead)) {
+ result = 1;
+ } else {
+ if (Oktavia.eob === ahead) {
+ result = 3;
+ }
+ }
+ }
+ }
+ return (result | 0);
+};
+
+/**
+ * @param {!number} position
+ * @param {!number} length
+ * @return {!string}
+ */
+Oktavia.prototype._getSubstring$II = function (position, length) {
+ /** @type {!string} */
+ var result;
+ /** @type {Array.<undefined|!string>} */
+ var str;
+ /** @type {!number} */
+ var i;
+ result = this._fmindex.getSubstring$II(position, length);
+ str = [ ];
+ for (i = 0; i < result.length; i++) {
+ str.push(this._compressCode2utf16[result.charCodeAt(i)]);
+ }
+ return str.join('');
+};
+
+/**
+ * class Binary extends Object
+ * @constructor
+ */
+function Binary() {
+}
+
+/**
+ * @constructor
+ */
+function Binary$() {
+};
+
+Binary$.prototype = new Binary;
+
+/**
+ * @param {!number} num
+ * @return {!string}
+ */
+Binary.dump32bitNumber$N = function (num) {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ result = [ String.fromCharCode(Math.floor(num / 65536)) ];
+ result.push(String.fromCharCode(num % 65536));
+ return result.join("");
+};
+
+var Binary$dump32bitNumber$N = Binary.dump32bitNumber$N;
+
+/**
+ * @param {!string} buffer
+ * @param {!number} offset
+ * @return {!number}
+ */
+Binary.load32bitNumber$SI = function (buffer, offset) {
+ /** @type {!number} */
+ var result;
+ result = buffer.charCodeAt(offset) * 65536 + buffer.charCodeAt(offset + 1);
+ return result;
+};
+
+var Binary$load32bitNumber$SI = Binary.load32bitNumber$SI;
+
+/**
+ * @param {!number} num
+ * @return {!string}
+ */
+Binary.dump16bitNumber$I = function (num) {
+ return String.fromCharCode(num % 65536);
+};
+
+var Binary$dump16bitNumber$I = Binary.dump16bitNumber$I;
+
+/**
+ * @param {!string} buffer
+ * @param {!number} offset
+ * @return {!number}
+ */
+Binary.load16bitNumber$SI = function (buffer, offset) {
+ return (buffer.charCodeAt(offset) | 0);
+};
+
+var Binary$load16bitNumber$SI = Binary.load16bitNumber$SI;
+
+/**
+ * @param {!string} str
+ * @return {!string}
+ */
+Binary.dumpString$S = function (str) {
+ return Binary$dumpString$SLCompressionReport$(str, null);
+};
+
+var Binary$dumpString$S = Binary.dumpString$S;
+
+/**
+ * @param {!string} str
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+Binary.dumpString$SLCompressionReport$ = function (str, report) {
+ /** @type {!number} */
+ var length;
+ /** @type {!boolean} */
+ var compress;
+ /** @type {Array.<undefined|!number>} */
+ var charCodes;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var charCode;
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {undefined|!number} */
+ var bytes;
+ if (str.length > 32768) {
+ str = str.slice(0, 32768);
+ }
+ length = str.length;
+ compress = true;
+ charCodes = [ ];
+ for (i = 0; i < length; i++) {
+ charCode = str.charCodeAt(i);
+ if (charCode > 255) {
+ compress = false;
+ break;
+ }
+ charCodes.push(charCode);
+ }
+ if (compress) {
+ result = [ Binary$dump16bitNumber$I(length + 32768) ];
+ for (i = 0; i < length; i += 2) {
+ bytes = charCodes[i];
+ if (i !== length - 1) {
+ bytes += charCodes[i + 1] << 8;
+ }
+ result.push(String.fromCharCode(bytes % 65536));
+ }
+ if (report) {
+ CompressionReport$add$LCompressionReport$II(report, length, Math.ceil(length / 2));
+ }
+ } else {
+ result = [ Binary$dump16bitNumber$I(length), str ];
+ if (report) {
+ CompressionReport$add$LCompressionReport$II(report, length, length);
+ }
+ }
+ return result.join('');
+};
+
+var Binary$dumpString$SLCompressionReport$ = Binary.dumpString$SLCompressionReport$;
+
+/**
+ * @param {!string} buffer
+ * @param {!number} offset
+ * @return {LoadedStringResult}
+ */
+Binary.loadString$SI = function (buffer, offset) {
+ return new LoadedStringResult$SI(buffer, offset);
+};
+
+var Binary$loadString$SI = Binary.loadString$SI;
+
+/**
+ * @param {Array.<undefined|!string>} strList
+ * @return {!string}
+ */
+Binary.dumpStringList$AS = function (strList) {
+ return Binary$dumpStringList$ASLCompressionReport$(strList, null);
+};
+
+var Binary$dumpStringList$AS = Binary.dumpStringList$AS;
+
+/**
+ * @param {Array.<undefined|!string>} strList
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+Binary.dumpStringList$ASLCompressionReport$ = function (strList, report) {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var i;
+ result = [ Binary$dump32bitNumber$N(strList.length) ];
+ for (i = 0; i < strList.length; i++) {
+ result.push(Binary$dumpString$SLCompressionReport$(strList[i], report));
+ }
+ return result.join('');
+};
+
+var Binary$dumpStringList$ASLCompressionReport$ = Binary.dumpStringList$ASLCompressionReport$;
+
+/**
+ * @param {!string} buffer
+ * @param {!number} offset
+ * @return {LoadedStringListResult}
+ */
+Binary.loadStringList$SI = function (buffer, offset) {
+ return new LoadedStringListResult$SI(buffer, offset);
+};
+
+var Binary$loadStringList$SI = Binary.loadStringList$SI;
+
+/**
+ * @param {Object.<string, undefined|Array.<undefined|!string>>} strMap
+ * @return {!string}
+ */
+Binary.dumpStringListMap$HAS = function (strMap) {
+ return Binary$dumpStringListMap$HASLCompressionReport$(strMap, null);
+};
+
+var Binary$dumpStringListMap$HAS = Binary.dumpStringListMap$HAS;
+
+/**
+ * @param {Object.<string, undefined|Array.<undefined|!string>>} strMap
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+Binary.dumpStringListMap$HASLCompressionReport$ = function (strMap, report) {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var counter;
+ /** @type {!string} */
+ var key;
+ result = [ ];
+ counter = 0;
+ for (key in strMap) {
+ result.push(Binary$dumpString$SLCompressionReport$(key, report));
+ result.push(Binary$dumpStringList$ASLCompressionReport$(strMap[key], report));
+ counter++;
+ }
+ return Binary$dump32bitNumber$N(counter) + result.join('');
+};
+
+var Binary$dumpStringListMap$HASLCompressionReport$ = Binary.dumpStringListMap$HASLCompressionReport$;
+
+/**
+ * @param {!string} buffer
+ * @param {!number} offset
+ * @return {LoadedStringListMapResult}
+ */
+Binary.loadStringListMap$SI = function (buffer, offset) {
+ return new LoadedStringListMapResult$SI(buffer, offset);
+};
+
+var Binary$loadStringListMap$SI = Binary.loadStringListMap$SI;
+
+/**
+ * @param {Array.<undefined|!number>} array
+ * @return {!string}
+ */
+Binary.dump32bitNumberList$AN = function (array) {
+ return Binary$dump32bitNumberList$ANLCompressionReport$(array, null);
+};
+
+var Binary$dump32bitNumberList$AN = Binary.dump32bitNumberList$AN;
+
+/**
+ * @param {Array.<undefined|!number>} array
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+Binary.dump32bitNumberList$ANLCompressionReport$ = function (array, report) {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var index;
+ /** @type {!number} */
+ var inputLength;
+ /** @type {!number} */
+ var length;
+ /** @type {!string} */
+ var resultString;
+ /** @type {!number} */
+ var value1$0;
+ /** @type {!number} */
+ var value2$0;
+ result = [ Binary$dump32bitNumber$N(array.length) ];
+ index = 0;
+ inputLength = array.length;
+ while (index < inputLength) {
+ if (array[index] == 0) {
+ length = Binary$_countZero$ANI(array, index);
+ result.push(Binary$_zeroBlock$I(length));
+ index += length;
+ } else {
+ if (Binary$_shouldZebraCode$ANI(array, index)) {
+ result.push(Binary$_createZebraCode$ANI(array, index));
+ value1$0 = array.length;
+ value2$0 = index + 15;
+ index = (value1$0 <= value2$0 ? value1$0 : value2$0);
+ } else {
+ length = Binary$_searchDoubleZero$ANI(array, index);
+ result.push(Binary$_nonZeroBlock$ANII(array, index, length));
+ if (length === 0) {
+ throw new Error('');
+ }
+ index += length;
+ }
+ }
+ }
+ resultString = result.join('');
+ if (report) {
+ CompressionReport$add$LCompressionReport$II(report, array.length * 2 + 2, resultString.length);
+ }
+ return resultString;
+};
+
+var Binary$dump32bitNumberList$ANLCompressionReport$ = Binary.dump32bitNumberList$ANLCompressionReport$;
+
+/**
+ * @param {!string} buffer
+ * @param {!number} offset
+ * @return {LoadedNumberListResult}
+ */
+Binary.load32bitNumberList$SI = function (buffer, offset) {
+ return new LoadedNumberListResult$SI(buffer, offset);
+};
+
+var Binary$load32bitNumberList$SI = Binary.load32bitNumberList$SI;
+
+/**
+ * @param {Array.<undefined|!number>} array
+ * @param {!number} offset
+ * @return {!number}
+ */
+Binary._countZero$ANI = function (array, offset) {
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var array$len$0;
+ for ((i = offset, array$len$0 = array.length); i < array$len$0; i++) {
+ if (array[i] != 0) {
+ return (i - offset | 0);
+ }
+ }
+ return (array.length - offset | 0);
+};
+
+var Binary$_countZero$ANI = Binary._countZero$ANI;
+
+/**
+ * @param {!number} length
+ * @return {!string}
+ */
+Binary._zeroBlock$I = function (length) {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ result = [ ];
+ while (length > 0) {
+ if (length > 16384) {
+ result.push(Binary$dump16bitNumber$I(16383));
+ length -= 16384;
+ } else {
+ result.push(Binary$dump16bitNumber$I(length - 1));
+ length = 0;
+ }
+ }
+ return result.join('');
+};
+
+var Binary$_zeroBlock$I = Binary._zeroBlock$I;
+
+/**
+ * @param {Array.<undefined|!number>} array
+ * @param {!number} offset
+ * @return {!boolean}
+ */
+Binary._shouldZebraCode$ANI = function (array, offset) {
+ /** @type {!number} */
+ var change;
+ /** @type {!boolean} */
+ var isLastZero;
+ /** @type {!number} */
+ var i;
+ if (array.length - offset < 16) {
+ return true;
+ }
+ change = 0;
+ isLastZero = false;
+ for (i = offset; i < offset + 15; i++) {
+ if (array[i] == 0) {
+ if (! isLastZero) {
+ isLastZero = true;
+ change++;
+ }
+ } else {
+ if (isLastZero) {
+ isLastZero = false;
+ change++;
+ }
+ }
+ }
+ return change > 2;
+};
+
+var Binary$_shouldZebraCode$ANI = Binary._shouldZebraCode$ANI;
+
+/**
+ * @param {Array.<undefined|!number>} array
+ * @param {!number} offset
+ * @return {!number}
+ */
+Binary._searchDoubleZero$ANI = function (array, offset) {
+ /** @type {!boolean} */
+ var isLastZero;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var array$len$0;
+ isLastZero = false;
+ for ((i = offset, array$len$0 = array.length); i < array$len$0; i++) {
+ if (array[i] == 0) {
+ if (isLastZero) {
+ return (i - offset - 1 | 0);
+ }
+ isLastZero = true;
+ } else {
+ isLastZero = false;
+ }
+ }
+ return (array.length - offset | 0);
+};
+
+var Binary$_searchDoubleZero$ANI = Binary._searchDoubleZero$ANI;
+
+/**
+ * @param {Array.<undefined|!number>} array
+ * @param {!number} offset
+ * @param {!number} length
+ * @return {!string}
+ */
+Binary._nonZeroBlock$ANII = function (array, offset, length) {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var blockLength;
+ /** @type {!number} */
+ var i;
+ result = [ ];
+ while (length > 0) {
+ if (length > 16384) {
+ blockLength = 16384;
+ length -= 16384;
+ } else {
+ blockLength = length;
+ length = 0;
+ }
+ result.push(Binary$dump16bitNumber$I(blockLength - 1 + 0x4000));
+ for (i = offset; i < offset + blockLength; i++) {
+ result.push(Binary$dump32bitNumber$N(array[i]));
+ }
+ offset += blockLength;
+ }
+ return result.join('');
+};
+
+var Binary$_nonZeroBlock$ANII = Binary._nonZeroBlock$ANII;
+
+/**
+ * @param {Array.<undefined|!number>} array
+ * @param {!number} offset
+ * @return {!string}
+ */
+Binary._createZebraCode$ANI = function (array, offset) {
+ /** @type {!number} */
+ var last;
+ /** @type {!number} */
+ var code;
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var value1$0;
+ /** @type {!number} */
+ var value2$0;
+ value1$0 = offset + 15;
+ value2$0 = array.length;
+ last = (value1$0 <= value2$0 ? value1$0 : value2$0);
+ code = 0x8000;
+ result = [ ];
+ for (i = offset; i < last; i++) {
+ if (array[i] != 0) {
+ result.push(Binary$dump32bitNumber$N(array[i]));
+ code = code + (0x1 << i - offset);
+ }
+ }
+ return String.fromCharCode(code) + result.join('');
+};
+
+var Binary$_createZebraCode$ANI = Binary._createZebraCode$ANI;
+
+/**
+ * @param {!string} str
+ * @return {!string}
+ */
+Binary.base64encode$S = function (str) {
+ /** @type {Array.<undefined|!string>} */
+ var out;
+ /** @type {Array.<undefined|!number>} */
+ var source;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var code;
+ /** @type {!number} */
+ var len;
+ /** @type {!number} */
+ var c1;
+ /** @type {undefined|!number} */
+ var c2;
+ /** @type {undefined|!number} */
+ var c3;
+ out = [ ];
+ source = [ ];
+ for (i = 0; i < str.length; i++) {
+ code = str.charCodeAt(i);
+ source.push(code & 0x00ff, code >>> 8);
+ }
+ len = str.length * 2;
+ i = 0;
+ while (i < len) {
+ c1 = source[i++] & 0xff;
+ if (i === len) {
+ out.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(c1 >> 2));
+ out.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((c1 & 0x3) << 4));
+ out.push("==");
+ break;
+ }
+ c2 = source[i++];
+ if (i === len) {
+ out.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(c1 >> 2));
+ out.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((c1 & 0x3) << 4 | (c2 & 0xF0) >> 4));
+ out.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((c2 & 0xF) << 2));
+ out.push("=");
+ break;
+ }
+ c3 = source[i++];
+ out.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(c1 >> 2));
+ out.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((c1 & 0x3) << 4 | (c2 & 0xF0) >> 4));
+ out.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((c2 & 0xF) << 2 | (c3 & 0xC0) >> 6));
+ out.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(c3 & 0x3F));
+ }
+ return out.join('');
+};
+
+var Binary$base64encode$S = Binary.base64encode$S;
+
+/**
+ * @param {Array.<undefined|!number>} source
+ * @return {!string}
+ */
+Binary._mergeCharCode$AI = function (source) {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var i;
+ result = [ ];
+ for (i = 0; i < source.length; i += 2) {
+ result.push(String.fromCharCode(source[i] + (source[i + 1] << 8)));
+ }
+ return result.join('');
+};
+
+var Binary$_mergeCharCode$AI = Binary._mergeCharCode$AI;
+
+/**
+ * @param {!string} str
+ * @return {!string}
+ */
+Binary.base64decode$S = function (str) {
+ /** @type {!number} */
+ var len;
+ /** @type {!number} */
+ var i;
+ /** @type {Array.<undefined|!number>} */
+ var out;
+ /** @type {undefined|!number} */
+ var c1;
+ /** @type {undefined|!number} */
+ var c2;
+ /** @type {!number} */
+ var c3;
+ /** @type {!number} */
+ var c4;
+ len = str.length;
+ i = 0;
+ out = [ ];
+ while (i < len) {
+ do {
+ c1 = Binary._base64DecodeChars[str.charCodeAt(i++) & 0xff];
+ } while (i < len && c1 == -1);
+ if (c1 == -1) {
+ break;
+ }
+ do {
+ c2 = Binary._base64DecodeChars[str.charCodeAt(i++) & 0xff];
+ } while (i < len && c2 == -1);
+ if (c2 == -1) {
+ break;
+ }
+ out.push(c1 << 2 | (c2 & 0x30) >> 4);
+ do {
+ c3 = str.charCodeAt(i++) & 0xff;
+ if (c3 === 61) {
+ return Binary$_mergeCharCode$AI(out);
+ }
+ c3 = Binary._base64DecodeChars[c3];
+ } while (i < len && c3 === -1);
+ if (c3 === -1) {
+ break;
+ }
+ out.push((c2 & 0XF) << 4 | (c3 & 0x3C) >> 2);
+ do {
+ c4 = str.charCodeAt(i++) & 0xff;
+ if (c4 === 61) {
+ return Binary$_mergeCharCode$AI(out);
+ }
+ c4 = (Binary._base64DecodeChars[c4] | 0);
+ } while (i < len && c4 === -1);
+ if (c4 === -1) {
+ break;
+ }
+ out.push((c3 & 0x03) << 6 | c4);
+ }
+ return Binary$_mergeCharCode$AI(out);
+};
+
+var Binary$base64decode$S = Binary.base64decode$S;
+
+/**
+ * class LoadedStringResult extends Object
+ * @constructor
+ */
+function LoadedStringResult() {
+}
+
+/**
+ * @constructor
+ * @param {!string} data
+ * @param {!number} offset
+ */
+function LoadedStringResult$SI(data, offset) {
+ /** @type {!number} */
+ var strLength;
+ /** @type {Array.<undefined|!string>} */
+ var bytes;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var code;
+ /** @type {!number} */
+ var offset$0;
+ this.result = "";
+ this.offset = 0;
+ offset$0 = offset++;
+ strLength = data.charCodeAt(offset$0);
+ if (strLength > 32767) {
+ strLength = strLength - 32768;
+ bytes = [ ];
+ for (i = 0; i < strLength; i += 2) {
+ code = data.charCodeAt(offset);
+ bytes.push(String.fromCharCode(code & 0x00ff));
+ if (i !== strLength - 1) {
+ bytes.push(String.fromCharCode(code >>> 8));
+ }
+ offset++;
+ }
+ this.result = bytes.join('');
+ this.offset = offset;
+ } else {
+ this.result = data.slice(offset, offset + strLength);
+ this.offset = (offset + strLength | 0);
+ }
+};
+
+LoadedStringResult$SI.prototype = new LoadedStringResult;
+
+/**
+ * class LoadedStringListResult extends Object
+ * @constructor
+ */
+function LoadedStringListResult() {
+}
+
+/**
+ * @constructor
+ * @param {!string} data
+ * @param {!number} offset
+ */
+function LoadedStringListResult$SI(data, offset) {
+ /** @type {!number} */
+ var length;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var strLength;
+ /** @type {!string} */
+ var resultStr;
+ /** @type {Array.<undefined|!string>} */
+ var bytes;
+ /** @type {!number} */
+ var j;
+ /** @type {!number} */
+ var code;
+ /** @type {!number} */
+ var result$0;
+ /** @type {!number} */
+ var offset$0;
+ this.offset = 0;
+ this.result = [ ];
+ result$0 = data.charCodeAt(offset) * 65536 + data.charCodeAt(offset + 1);
+ length = result$0;
+ offset += 2;
+ for (i = 0; i < length; i++) {
+ offset$0 = offset++;
+ strLength = data.charCodeAt(offset$0);
+ if (strLength > 32767) {
+ strLength = strLength - 32768;
+ bytes = [ ];
+ for (j = 0; j < strLength; j += 2) {
+ code = data.charCodeAt(offset);
+ bytes.push(String.fromCharCode(code & 0x00ff));
+ if (j !== strLength - 1) {
+ bytes.push(String.fromCharCode(code >>> 8));
+ }
+ offset++;
+ }
+ resultStr = bytes.join('');
+ } else {
+ resultStr = data.slice(offset, offset + strLength);
+ offset = (offset + strLength | 0);
+ }
+ this.result.push(resultStr);
+ }
+ this.offset = offset;
+};
+
+LoadedStringListResult$SI.prototype = new LoadedStringListResult;
+
+/**
+ * class LoadedStringListMapResult extends Object
+ * @constructor
+ */
+function LoadedStringListMapResult() {
+}
+
+/**
+ * @constructor
+ * @param {!string} data
+ * @param {!number} offset
+ */
+function LoadedStringListMapResult$SI(data, offset) {
+ /** @type {!number} */
+ var length;
+ /** @type {!number} */
+ var i;
+ /** @type {LoadedStringResult} */
+ var keyResult;
+ /** @type {LoadedStringListResult} */
+ var valueResult;
+ /** @type {!number} */
+ var result$0;
+ /** @type {!number} */
+ var offset$0;
+ this.offset = 0;
+ this.result = ({ });
+ result$0 = data.charCodeAt(offset) * 65536 + data.charCodeAt(offset + 1);
+ length = result$0;
+ offset += 2;
+ for (i = 0; i < length; i++) {
+ keyResult = new LoadedStringResult$SI(data, offset);
+ offset$0 = keyResult.offset;
+ valueResult = new LoadedStringListResult$SI(data, offset$0);
+ this.result[keyResult.result] = valueResult.result;
+ offset = valueResult.offset;
+ }
+ this.offset = offset;
+};
+
+LoadedStringListMapResult$SI.prototype = new LoadedStringListMapResult;
+
+/**
+ * class LoadedNumberListResult extends Object
+ * @constructor
+ */
+function LoadedNumberListResult() {
+}
+
+/**
+ * @constructor
+ * @param {!string} data
+ * @param {!number} offset
+ */
+function LoadedNumberListResult$SI(data, offset) {
+ /** @type {!number} */
+ var resultLength;
+ /** @type {!number} */
+ var originalOffset;
+ /** @type {Array.<undefined|!number>} */
+ var result;
+ /** @type {!number} */
+ var tag;
+ /** @type {!number} */
+ var length;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var result$0;
+ /** @type {!number} */
+ var value1$0;
+ this.result = null;
+ this.offset = 0;
+ result$0 = data.charCodeAt(offset) * 65536 + data.charCodeAt(offset + 1);
+ resultLength = result$0;
+ originalOffset = offset;
+ offset += 2;
+ result = [ ];
+ while (result.length < resultLength) {
+ tag = data.charCodeAt(offset++);
+ if (tag >>> 15 === 1) {
+ value1$0 = resultLength - result.length;
+ length = (value1$0 <= 15 ? value1$0 : 15);
+ for (i = 0; i < length; i++) {
+ if (tag >>> i & 0x1) {
+ result.push(Binary$load32bitNumber$SI(data, offset));
+ offset += 2;
+ } else {
+ result.push(0);
+ }
+ }
+ } else {
+ if (tag >>> 14 === 1) {
+ length = tag - 0x4000 + 1;
+ for (i = 0; i < length; i++) {
+ result.push(Binary$load32bitNumber$SI(data, offset));
+ offset += 2;
+ }
+ } else {
+ length = tag + 1;
+ for (i = 0; i < length; i++) {
+ result.push(0);
+ }
+ }
+ }
+ }
+ this.result = result;
+ this.offset = offset;
+};
+
+LoadedNumberListResult$SI.prototype = new LoadedNumberListResult;
+
+/**
+ * class CompressionReport extends Object
+ * @constructor
+ */
+function CompressionReport() {
+}
+
+/**
+ * @constructor
+ */
+function CompressionReport$() {
+ this.source = 0;
+ this.result = 0;
+};
+
+CompressionReport$.prototype = new CompressionReport;
+
+/**
+ * @param {CompressionReport} $this
+ * @param {!number} source
+ * @param {!number} result
+ */
+CompressionReport.add$LCompressionReport$II = function ($this, source, result) {
+ $this.source += source;
+ $this.result += result;
+};
+
+var CompressionReport$add$LCompressionReport$II = CompressionReport.add$LCompressionReport$II;
+
+/**
+ * @param {CompressionReport} $this
+ * @return {!number}
+ */
+CompressionReport.rate$LCompressionReport$ = function ($this) {
+ return (Math.round($this.result * 100.0 / $this.source) | 0);
+};
+
+var CompressionReport$rate$LCompressionReport$ = CompressionReport.rate$LCompressionReport$;
+
+/**
+ * class Query extends Object
+ * @constructor
+ */
+function Query() {
+}
+
+/**
+ * @constructor
+ */
+function Query$() {
+ this.word = '';
+ this.or = false;
+ this.not = false;
+ this.raw = false;
+};
+
+Query$.prototype = new Query;
+
+/**
+ * @return {!string}
+ */
+Query.prototype.toString = function () {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ result = [ ];
+ if (this.or) {
+ result.push("OR ");
+ }
+ if (this.not) {
+ result.push("-");
+ }
+ if (this.raw) {
+ result.push('"', this.word, '"');
+ } else {
+ result.push(this.word);
+ }
+ return result.join('');
+};
+
+/**
+ * class QueryStringParser extends Object
+ * @constructor
+ */
+function QueryStringParser() {
+}
+
+/**
+ * @constructor
+ */
+function QueryStringParser$() {
+ this.queries = [ ];
+};
+
+QueryStringParser$.prototype = new QueryStringParser;
+
+/**
+ * @param {QueryStringParser} $this
+ * @param {!string} queryString
+ * @return {Array.<undefined|Query>}
+ */
+QueryStringParser.parse$LQueryStringParser$S = function ($this, queryString) {
+ /** @type {!boolean} */
+ var nextOr;
+ /** @type {!boolean} */
+ var nextNot;
+ /** @type {!number} */
+ var currentWordStart;
+ /** @type {!number} */
+ var status;
+ /** @type {RegExp} */
+ var isSpace;
+ /** @type {!number} */
+ var i;
+ /** @type {!string} */
+ var ch;
+ /** @type {!string} */
+ var word;
+ /** @type {Query} */
+ var query;
+ nextOr = false;
+ nextNot = false;
+ currentWordStart = 0;
+ status = 0;
+ isSpace = /[\s\u3000]/;
+ for (i = 0; i < queryString.length; i++) {
+ ch = queryString.charAt(i);
+ switch (status) {
+ case 0:
+ if (! isSpace.test(ch)) {
+ if (ch === '-') {
+ nextNot = true;
+ } else {
+ if (ch === '"') {
+ currentWordStart = i + 1;
+ status = 2;
+ } else {
+ currentWordStart = i;
+ status = 1;
+ }
+ }
+ } else {
+ nextNot = false;
+ }
+ break;
+ case 1:
+ if (isSpace.test(ch)) {
+ word = queryString.slice(currentWordStart, i);
+ if (word === 'OR') {
+ nextOr = true;
+ } else {
+ query = new Query$();
+ query.word = word;
+ query.or = nextOr;
+ query.not = nextNot;
+ $this.queries.push(query);
+ nextOr = false;
+ nextNot = false;
+ }
+ status = 0;
+ }
+ break;
+ case 2:
+ if (ch === '"') {
+ word = queryString.slice(currentWordStart, i);
+ query = new Query$();
+ query.word = word;
+ query.or = nextOr;
+ query.not = nextNot;
+ query.raw = true;
+ $this.queries.push(query);
+ nextOr = false;
+ nextNot = false;
+ status = 0;
+ }
+ break;
+ }
+ }
+ switch (status) {
+ case 0:
+ break;
+ case 1:
+ query = new Query$();
+ word = queryString.slice(currentWordStart, queryString.length);
+ if (word !== 'OR') {
+ query.word = word;
+ query.or = nextOr;
+ query.not = nextNot;
+ $this.queries.push(query);
+ }
+ break;
+ case 2:
+ query = new Query$();
+ query.word = queryString.slice(currentWordStart, queryString.length);
+ query.or = nextOr;
+ query.not = nextNot;
+ query.raw = true;
+ $this.queries.push(query);
+ break;
+ }
+ return $this.queries;
+};
+
+var QueryStringParser$parse$LQueryStringParser$S = QueryStringParser.parse$LQueryStringParser$S;
+
+/**
+ * @param {QueryStringParser} $this
+ * @return {!string}
+ */
+QueryStringParser.highlight$LQueryStringParser$ = function ($this) {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var i;
+ /** @type {Query} */
+ var query;
+ result = [ ];
+ for (i = 0; i < $this.queries.length; i++) {
+ query = $this.queries[i];
+ if (! query.not) {
+ result.push("highlight=" + $__jsx_encodeURIComponent(query.word));
+ }
+ }
+ return '?' + result.join('&');
+};
+
+var QueryStringParser$highlight$LQueryStringParser$ = QueryStringParser.highlight$LQueryStringParser$;
+
+/**
+ * class Proposal extends Object
+ * @constructor
+ */
+function Proposal() {
+}
+
+/**
+ * @constructor
+ * @param {!number} omit
+ * @param {!number} expect
+ */
+function Proposal$II(omit, expect) {
+ this.omit = omit;
+ this.expect = expect;
+};
+
+Proposal$II.prototype = new Proposal;
+
+/**
+ * class Position extends Object
+ * @constructor
+ */
+function Position() {
+}
+
+/**
+ * @constructor
+ * @param {!string} word
+ * @param {!number} position
+ * @param {!boolean} stemmed
+ */
+function Position$SIB(word, position, stemmed) {
+ this.word = word;
+ this.position = position;
+ this.stemmed = stemmed;
+};
+
+Position$SIB.prototype = new Position;
+
+/**
+ * class SearchUnit extends Object
+ * @constructor
+ */
+function SearchUnit() {
+}
+
+/**
+ * @constructor
+ * @param {!number} id
+ */
+function SearchUnit$I(id) {
+ this.positions = ({ });
+ this.id = id;
+ this._size = 0;
+ this.score = 0;
+ this.startPosition = -1;
+};
+
+SearchUnit$I.prototype = new SearchUnit;
+
+/**
+ * @param {SearchUnit} $this
+ * @param {!string} word
+ * @param {!number} position
+ * @param {!boolean} stemmed
+ */
+SearchUnit.addPosition$LSearchUnit$SIB = function ($this, word, position, stemmed) {
+ /** @type {Position} */
+ var positionObj;
+ positionObj = $this.positions[position + ""];
+ if (! positionObj) {
+ $this._size++;
+ $this.positions[position + ""] = ({word: word, position: position, stemmed: stemmed});
+ } else {
+ if (positionObj.word.length < word.length) {
+ positionObj.word = word;
+ }
+ positionObj.stemmed = positionObj.stemmed && stemmed;
+ }
+};
+
+var SearchUnit$addPosition$LSearchUnit$SIB = SearchUnit.addPosition$LSearchUnit$SIB;
+
+/**
+ * @param {SearchUnit} $this
+ * @param {!number} position
+ * @return {Position}
+ */
+SearchUnit.get$LSearchUnit$I = function ($this, position) {
+ return $this.positions[position + ""];
+};
+
+var SearchUnit$get$LSearchUnit$I = SearchUnit.get$LSearchUnit$I;
+
+/**
+ * @param {SearchUnit} $this
+ * @return {!number}
+ */
+SearchUnit.size$LSearchUnit$ = function ($this) {
+ return $this._size;
+};
+
+var SearchUnit$size$LSearchUnit$ = SearchUnit.size$LSearchUnit$;
+
+/**
+ * @param {SearchUnit} $this
+ * @param {SearchUnit} rhs
+ */
+SearchUnit.merge$LSearchUnit$LSearchUnit$ = function ($this, rhs) {
+ /** @type {!string} */
+ var position;
+ /** @type {Position} */
+ var pos;
+ for (position in rhs.positions) {
+ pos = rhs.positions[position];
+ SearchUnit$addPosition$LSearchUnit$SIB($this, pos.word, pos.position, pos.stemmed);
+ }
+};
+
+var SearchUnit$merge$LSearchUnit$LSearchUnit$ = SearchUnit.merge$LSearchUnit$LSearchUnit$;
+
+/**
+ * @param {SearchUnit} $this
+ * @return {Array.<undefined|Position>}
+ */
+SearchUnit.getPositions$LSearchUnit$ = function ($this) {
+ /** @type {Array.<undefined|Position>} */
+ var result;
+ /** @type {!string} */
+ var pos;
+ result = [ ];
+ for (pos in $this.positions) {
+ result.push($this.positions[pos]);
+ }
+ result.sort((function (a, b) {
+ return a.position - b.position;
+ }));
+ return result;
+};
+
+var SearchUnit$getPositions$LSearchUnit$ = SearchUnit.getPositions$LSearchUnit$;
+
+/**
+ * class SingleResult extends Object
+ * @constructor
+ */
+function SingleResult() {
+}
+
+/**
+ * @constructor
+ */
+function SingleResult$() {
+ this.units = [ ];
+ this.unitIds = [ ];
+ this.or = false;
+ this.not = false;
+ this.searchWord = '';
+};
+
+SingleResult$.prototype = new SingleResult;
+
+/**
+ * @constructor
+ * @param {!string} searchWord
+ * @param {!boolean} or
+ * @param {!boolean} not
+ */
+function SingleResult$SBB(searchWord, or, not) {
+ this.units = [ ];
+ this.unitIds = [ ];
+ this.or = or;
+ this.not = not;
+ this.searchWord = searchWord;
+};
+
+SingleResult$SBB.prototype = new SingleResult;
+
+/**
+ * @param {SingleResult} $this
+ * @param {!number} unitId
+ * @return {SearchUnit}
+ */
+SingleResult.getSearchUnit$LSingleResult$I = function ($this, unitId) {
+ /** @type {!number} */
+ var existing;
+ /** @type {SearchUnit} */
+ var result;
+ existing = $this.unitIds.indexOf(unitId);
+ if (existing === -1) {
+ result = ({positions: ({ }), id: unitId, _size: 0, score: 0, startPosition: -1});
+ $this.units.push(result);
+ $this.unitIds.push(unitId);
+ } else {
+ result = $this.units[existing];
+ }
+ return result;
+};
+
+var SingleResult$getSearchUnit$LSingleResult$I = SingleResult.getSearchUnit$LSingleResult$I;
+
+/**
+ * @param {SingleResult} $this
+ * @param {SingleResult} rhs
+ * @return {SingleResult}
+ */
+SingleResult.merge$LSingleResult$LSingleResult$ = function ($this, rhs) {
+ /** @type {SingleResult} */
+ var result;
+ result = ({units: [ ], unitIds: [ ], or: false, not: false, searchWord: ''});
+ if (rhs.or) {
+ SingleResult$_orMerge$LSingleResult$LSingleResult$LSingleResult$($this, result, rhs);
+ } else {
+ if (rhs.not) {
+ SingleResult$_notMerge$LSingleResult$LSingleResult$LSingleResult$($this, result, rhs);
+ } else {
+ SingleResult$_andMerge$LSingleResult$LSingleResult$LSingleResult$($this, result, rhs);
+ }
+ }
+ return result;
+};
+
+var SingleResult$merge$LSingleResult$LSingleResult$ = SingleResult.merge$LSingleResult$LSingleResult$;
+
+/**
+ * @param {SingleResult} $this
+ * @return {!number}
+ */
+SingleResult.size$LSingleResult$ = function ($this) {
+ return ($this.units.length | 0);
+};
+
+var SingleResult$size$LSingleResult$ = SingleResult.size$LSingleResult$;
+
+/**
+ * @param {SingleResult} $this
+ * @param {SingleResult} result
+ * @param {SingleResult} rhs
+ */
+SingleResult._andMerge$LSingleResult$LSingleResult$LSingleResult$ = function ($this, result, rhs) {
+ /** @type {!number} */
+ var i;
+ /** @type {undefined|!number} */
+ var id;
+ /** @type {SearchUnit} */
+ var lhsSection;
+ for (i = 0; i < $this.unitIds.length; i++) {
+ id = $this.unitIds[i];
+ if (rhs.unitIds.indexOf(id) !== -1) {
+ lhsSection = $this.units[i];
+ result.unitIds.push(id);
+ result.units.push(lhsSection);
+ }
+ }
+};
+
+var SingleResult$_andMerge$LSingleResult$LSingleResult$LSingleResult$ = SingleResult._andMerge$LSingleResult$LSingleResult$LSingleResult$;
+
+/**
+ * @param {SingleResult} $this
+ * @param {SingleResult} result
+ * @param {SingleResult} rhs
+ */
+SingleResult._orMerge$LSingleResult$LSingleResult$LSingleResult$ = function ($this, result, rhs) {
+ /** @type {!number} */
+ var i;
+ /** @type {undefined|!number} */
+ var id;
+ /** @type {SearchUnit} */
+ var rhsSection;
+ /** @type {SearchUnit} */
+ var lhsSection;
+ /** @type {Array.<undefined|!number>} */
+ var unitIds$0;
+ /** @type {Array.<undefined|SearchUnit>} */
+ var units$0;
+ result.unitIds = (unitIds$0 = $this.unitIds).slice(0, unitIds$0.length);
+ result.units = (units$0 = $this.units).slice(0, units$0.length);
+ for (i = 0; i < rhs.unitIds.length; i++) {
+ id = rhs.unitIds[i];
+ rhsSection = rhs.units[i];
+ if (result.unitIds.indexOf(id) !== -1) {
+ lhsSection = result.units[result.unitIds.indexOf(id)];
+ SearchUnit$merge$LSearchUnit$LSearchUnit$(lhsSection, rhsSection);
+ } else {
+ result.unitIds.push(id);
+ result.units.push(rhsSection);
+ }
+ }
+};
+
+var SingleResult$_orMerge$LSingleResult$LSingleResult$LSingleResult$ = SingleResult._orMerge$LSingleResult$LSingleResult$LSingleResult$;
+
+/**
+ * @param {SingleResult} $this
+ * @param {SingleResult} result
+ * @param {SingleResult} rhs
+ */
+SingleResult._notMerge$LSingleResult$LSingleResult$LSingleResult$ = function ($this, result, rhs) {
+ /** @type {!number} */
+ var i;
+ /** @type {undefined|!number} */
+ var id;
+ /** @type {SearchUnit} */
+ var lhsSection;
+ for (i = 0; i < $this.unitIds.length; i++) {
+ id = $this.unitIds[i];
+ if (rhs.unitIds.indexOf(id) === -1) {
+ lhsSection = $this.units[i];
+ result.unitIds.push(id);
+ result.units.push(lhsSection);
+ }
+ }
+};
+
+var SingleResult$_notMerge$LSingleResult$LSingleResult$LSingleResult$ = SingleResult._notMerge$LSingleResult$LSingleResult$LSingleResult$;
+
+/**
+ * class SearchSummary extends Object
+ * @constructor
+ */
+function SearchSummary() {
+}
+
+/**
+ * @constructor
+ */
+function SearchSummary$() {
+ this.sourceResults = [ ];
+ this.result = null;
+ this.oktavia = null;
+};
+
+SearchSummary$.prototype = new SearchSummary;
+
+/**
+ * @constructor
+ * @param {Oktavia} oktavia
+ */
+function SearchSummary$LOktavia$(oktavia) {
+ this.sourceResults = [ ];
+ this.result = null;
+ this.oktavia = oktavia;
+};
+
+SearchSummary$LOktavia$.prototype = new SearchSummary;
+
+/**
+ * @param {SearchSummary} $this
+ * @param {SingleResult} result
+ */
+SearchSummary.addQuery$LSearchSummary$LSingleResult$ = function ($this, result) {
+ $this.sourceResults.push(result);
+};
+
+var SearchSummary$addQuery$LSearchSummary$LSingleResult$ = SearchSummary.addQuery$LSearchSummary$LSingleResult$;
+
+/**
+ * @param {SearchSummary} $this
+ */
+SearchSummary.mergeResult$LSearchSummary$ = function ($this) {
+ $this.result = SearchSummary$mergeResult$LSearchSummary$ALSingleResult$($this, $this.sourceResults);
+};
+
+var SearchSummary$mergeResult$LSearchSummary$ = SearchSummary.mergeResult$LSearchSummary$;
+
+/**
+ * @param {SearchSummary} $this
+ * @param {Array.<undefined|SingleResult>} results
+ * @return {SingleResult}
+ */
+SearchSummary.mergeResult$LSearchSummary$ALSingleResult$ = function ($this, results) {
+ /** @type {SingleResult} */
+ var rhs;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var results$len$0;
+ rhs = results[0];
+ for ((i = 1, results$len$0 = results.length); i < results$len$0; i++) {
+ rhs = SingleResult$merge$LSingleResult$LSingleResult$(rhs, results[i]);
+ }
+ return rhs;
+};
+
+var SearchSummary$mergeResult$LSearchSummary$ALSingleResult$ = SearchSummary.mergeResult$LSearchSummary$ALSingleResult$;
+
+/**
+ * @param {SearchSummary} $this
+ * @return {Array.<undefined|Proposal>}
+ */
+SearchSummary.getProposal$LSearchSummary$ = function ($this) {
+ /** @type {Array.<undefined|Proposal>} */
+ var proposals;
+ /** @type {!number} */
+ var i;
+ /** @type {Array.<undefined|SingleResult>} */
+ var tmpSource;
+ /** @type {!number} */
+ var j;
+ /** @type {SingleResult} */
+ var result;
+ proposals = [ ];
+ for (i = 0; i < $this.sourceResults.length; i++) {
+ tmpSource = [ ];
+ for (j = 0; j < $this.sourceResults.length; j++) {
+ if (i !== j) {
+ tmpSource.push($this.sourceResults[j]);
+ }
+ }
+ result = SearchSummary$mergeResult$LSearchSummary$ALSingleResult$($this, tmpSource);
+ proposals.push(({omit: i, expect: result.units.length}));
+ }
+ proposals.sort((function (a, b) {
+ return b.expect - a.expect;
+ }));
+ return proposals;
+};
+
+var SearchSummary$getProposal$LSearchSummary$ = SearchSummary.getProposal$LSearchSummary$;
+
+/**
+ * @param {SearchSummary} $this
+ * @return {Array.<undefined|SearchUnit>}
+ */
+SearchSummary.getSortedResult$LSearchSummary$ = function ($this) {
+ /** @type {Array.<undefined|SearchUnit>} */
+ var result;
+ /** @type {Array.<undefined|SearchUnit>} */
+ var units$0;
+ result = (units$0 = $this.result.units).slice(0, units$0.length);
+ result.sort((function (a, b) {
+ return b.score - a.score;
+ }));
+ return result;
+};
+
+var SearchSummary$getSortedResult$LSearchSummary$ = SearchSummary.getSortedResult$LSearchSummary$;
+
+/**
+ * @param {SearchSummary} $this
+ * @return {!number}
+ */
+SearchSummary.size$LSearchSummary$ = function ($this) {
+ /** @type {SingleResult} */
+ var this$0;
+ this$0 = $this.result;
+ return (this$0.units.length | 0);
+};
+
+var SearchSummary$size$LSearchSummary$ = SearchSummary.size$LSearchSummary$;
+
+/**
+ * @param {SearchSummary} $this
+ * @param {SingleResult} result
+ */
+SearchSummary.add$LSearchSummary$LSingleResult$ = function ($this, result) {
+ $this.sourceResults.push(result);
+};
+
+var SearchSummary$add$LSearchSummary$LSingleResult$ = SearchSummary.add$LSearchSummary$LSingleResult$;
+
+/**
+ * class Style extends Object
+ * @constructor
+ */
+function Style() {
+}
+
+/**
+ * @constructor
+ * @param {!string} mode
+ */
+function Style$S(mode) {
+ this.styles = null;
+ this.escapeHTML = false;
+ switch (mode) {
+ case 'console':
+ this.styles = Style.console;
+ break;
+ case 'html':
+ this.styles = Style.html;
+ break;
+ case 'ignore':
+ this.styles = Style.ignore;
+ break;
+ default:
+ this.styles = Style.ignore;
+ break;
+ }
+ this.escapeHTML = mode === 'html';
+};
+
+Style$S.prototype = new Style;
+
+/**
+ * @param {!string} source
+ * @return {!string}
+ */
+Style.prototype.convert$S = function (source) {
+ /** @type {_HTMLHandler} */
+ var handler;
+ /** @type {SAXParser} */
+ var parser;
+ handler = new _HTMLHandler$HASB(this.styles, this.escapeHTML);
+ parser = new SAXParser$LSAXHandler$(handler);
+ parser.parse$S(source);
+ return handler.text.join('');
+};
+
+/**
+ * class Stemmer
+ * @constructor
+ */
+function Stemmer() {
+}
+
+Stemmer.prototype.$__jsx_implements_Stemmer = true;
+
+/**
+ * @constructor
+ */
+function Stemmer$() {
+};
+
+Stemmer$.prototype = new Stemmer;
+
+/**
+ * class BaseStemmer extends Object
+ * @constructor
+ */
+function BaseStemmer() {
+}
+
+$__jsx_merge_interface(BaseStemmer, Stemmer);
+
+/**
+ * @constructor
+ */
+function BaseStemmer$() {
+ /** @type {!string} */
+ var current$0;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var limit$0;
+ this.cache = ({ });
+ current$0 = this.current = "";
+ cursor$0 = this.cursor = 0;
+ limit$0 = this.limit = current$0.length;
+ this.limit_backward = 0;
+ this.bra = cursor$0;
+ this.ket = limit$0;
+};
+
+BaseStemmer$.prototype = new BaseStemmer;
+
+/**
+ * @param {!string} value
+ */
+BaseStemmer.prototype.setCurrent$S = function (value) {
+ /** @type {!string} */
+ var current$0;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var limit$0;
+ current$0 = this.current = value;
+ cursor$0 = this.cursor = 0;
+ limit$0 = this.limit = current$0.length;
+ this.limit_backward = 0;
+ this.bra = cursor$0;
+ this.ket = limit$0;
+};
+
+/**
+ * @return {!string}
+ */
+BaseStemmer.prototype.getCurrent$ = function () {
+ return this.current;
+};
+
+/**
+ * @param {BaseStemmer} other
+ */
+BaseStemmer.prototype.copy_from$LBaseStemmer$ = function (other) {
+ this.current = other.current;
+ this.cursor = other.cursor;
+ this.limit = other.limit;
+ this.limit_backward = other.limit_backward;
+ this.bra = other.bra;
+ this.ket = other.ket;
+};
+
+/**
+ * @param {Array.<undefined|!number>} s
+ * @param {!number} min
+ * @param {!number} max
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.in_grouping$AIII = function (s, min, max) {
+ /** @type {!number} */
+ var ch;
+ if (this.cursor >= this.limit) {
+ return false;
+ }
+ ch = this.current.charCodeAt(this.cursor);
+ if (ch > max || ch < min) {
+ return false;
+ }
+ ch -= min;
+ if ((s[ch >>> 3] & 0x1 << (ch & 0x7)) === 0) {
+ return false;
+ }
+ this.cursor++;
+ return true;
+};
+
+/**
+ * @param {Array.<undefined|!number>} s
+ * @param {!number} min
+ * @param {!number} max
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.in_grouping_b$AIII = function (s, min, max) {
+ /** @type {!number} */
+ var ch;
+ if (this.cursor <= this.limit_backward) {
+ return false;
+ }
+ ch = this.current.charCodeAt(this.cursor - 1);
+ if (ch > max || ch < min) {
+ return false;
+ }
+ ch -= min;
+ if ((s[ch >>> 3] & 0x1 << (ch & 0x7)) === 0) {
+ return false;
+ }
+ this.cursor--;
+ return true;
+};
+
+/**
+ * @param {Array.<undefined|!number>} s
+ * @param {!number} min
+ * @param {!number} max
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.out_grouping$AIII = function (s, min, max) {
+ /** @type {!number} */
+ var ch;
+ if (this.cursor >= this.limit) {
+ return false;
+ }
+ ch = this.current.charCodeAt(this.cursor);
+ if (ch > max || ch < min) {
+ this.cursor++;
+ return true;
+ }
+ ch -= min;
+ if ((s[ch >>> 3] & 0X1 << (ch & 0x7)) === 0) {
+ this.cursor++;
+ return true;
+ }
+ return false;
+};
+
+/**
+ * @param {Array.<undefined|!number>} s
+ * @param {!number} min
+ * @param {!number} max
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.out_grouping_b$AIII = function (s, min, max) {
+ /** @type {!number} */
+ var ch;
+ if (this.cursor <= this.limit_backward) {
+ return false;
+ }
+ ch = this.current.charCodeAt(this.cursor - 1);
+ if (ch > max || ch < min) {
+ this.cursor--;
+ return true;
+ }
+ ch -= min;
+ if ((s[ch >>> 3] & 0x1 << (ch & 0x7)) === 0) {
+ this.cursor--;
+ return true;
+ }
+ return false;
+};
+
+/**
+ * @param {!number} min
+ * @param {!number} max
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.in_range$II = function (min, max) {
+ /** @type {!number} */
+ var ch;
+ if (this.cursor >= this.limit) {
+ return false;
+ }
+ ch = this.current.charCodeAt(this.cursor);
+ if (ch > max || ch < min) {
+ return false;
+ }
+ this.cursor++;
+ return true;
+};
+
+/**
+ * @param {!number} min
+ * @param {!number} max
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.in_range_b$II = function (min, max) {
+ /** @type {!number} */
+ var ch;
+ if (this.cursor <= this.limit_backward) {
+ return false;
+ }
+ ch = this.current.charCodeAt(this.cursor - 1);
+ if (ch > max || ch < min) {
+ return false;
+ }
+ this.cursor--;
+ return true;
+};
+
+/**
+ * @param {!number} min
+ * @param {!number} max
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.out_range$II = function (min, max) {
+ /** @type {!number} */
+ var ch;
+ if (this.cursor >= this.limit) {
+ return false;
+ }
+ ch = this.current.charCodeAt(this.cursor);
+ if (! (ch > max || ch < min)) {
+ return false;
+ }
+ this.cursor++;
+ return true;
+};
+
+/**
+ * @param {!number} min
+ * @param {!number} max
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.out_range_b$II = function (min, max) {
+ /** @type {!number} */
+ var ch;
+ if (this.cursor <= this.limit_backward) {
+ return false;
+ }
+ ch = this.current.charCodeAt(this.cursor - 1);
+ if (! (ch > max || ch < min)) {
+ return false;
+ }
+ this.cursor--;
+ return true;
+};
+
+/**
+ * @param {!number} s_size
+ * @param {!string} s
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.eq_s$IS = function (s_size, s) {
+ /** @type {!number} */
+ var cursor$0;
+ if (this.limit - this.cursor < s_size) {
+ return false;
+ }
+ if (this.current.slice(cursor$0 = this.cursor, cursor$0 + s_size) !== s) {
+ return false;
+ }
+ this.cursor += s_size;
+ return true;
+};
+
+/**
+ * @param {!number} s_size
+ * @param {!string} s
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.eq_s_b$IS = function (s_size, s) {
+ /** @type {!number} */
+ var cursor$0;
+ if (this.cursor - this.limit_backward < s_size) {
+ return false;
+ }
+ if (this.current.slice((cursor$0 = this.cursor) - s_size, cursor$0) !== s) {
+ return false;
+ }
+ this.cursor -= s_size;
+ return true;
+};
+
+/**
+ * @param {!string} s
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.eq_v$S = function (s) {
+ return this.eq_s$IS(s.length, s);
+};
+
+/**
+ * @param {!string} s
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.eq_v_b$S = function (s) {
+ return this.eq_s_b$IS(s.length, s);
+};
+
+/**
+ * @param {Array.<undefined|Among>} v
+ * @param {!number} v_size
+ * @return {!number}
+ */
+BaseStemmer.prototype.find_among$ALAmong$I = function (v, v_size) {
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var j;
+ /** @type {!number} */
+ var c;
+ /** @type {!number} */
+ var l;
+ /** @type {!number} */
+ var common_i;
+ /** @type {!number} */
+ var common_j;
+ /** @type {!boolean} */
+ var first_key_inspected;
+ /** @type {!number} */
+ var k;
+ /** @type {!number} */
+ var diff;
+ /** @type {!number} */
+ var common;
+ /** @type {Among} */
+ var w;
+ /** @type {!number} */
+ var i2;
+ /** @type {!boolean} */
+ var res;
+ i = 0;
+ j = v_size;
+ c = this.cursor;
+ l = this.limit;
+ common_i = 0;
+ common_j = 0;
+ first_key_inspected = false;
+ while (true) {
+ k = i + (j - i >>> 1);
+ diff = 0;
+ common = (common_i < common_j ? common_i : common_j);
+ w = v[k];
+ for (i2 = common; i2 < w.s_size; i2++) {
+ if (c + common === l) {
+ diff = -1;
+ break;
+ }
+ diff = this.current.charCodeAt(c + common) - w.s.charCodeAt(i2);
+ if (diff !== 0) {
+ break;
+ }
+ common++;
+ }
+ if (diff < 0) {
+ j = k;
+ common_j = common;
+ } else {
+ i = k;
+ common_i = common;
+ }
+ if (j - i <= 1) {
+ if (i > 0) {
+ break;
+ }
+ if (j === i) {
+ break;
+ }
+ if (first_key_inspected) {
+ break;
+ }
+ first_key_inspected = true;
+ }
+ }
+ while (true) {
+ w = v[i];
+ if (common_i >= w.s_size) {
+ this.cursor = (c + w.s_size | 0);
+ if (w.method == null) {
+ return w.result;
+ }
+ res = w.method(w.instance);
+ this.cursor = (c + w.s_size | 0);
+ if (res) {
+ return w.result;
+ }
+ }
+ i = w.substring_i;
+ if (i < 0) {
+ return 0;
+ }
+ }
+ return -1;
+};
+
+/**
+ * @param {Array.<undefined|Among>} v
+ * @param {!number} v_size
+ * @return {!number}
+ */
+BaseStemmer.prototype.find_among_b$ALAmong$I = function (v, v_size) {
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var j;
+ /** @type {!number} */
+ var c;
+ /** @type {!number} */
+ var lb;
+ /** @type {!number} */
+ var common_i;
+ /** @type {!number} */
+ var common_j;
+ /** @type {!boolean} */
+ var first_key_inspected;
+ /** @type {!number} */
+ var k;
+ /** @type {!number} */
+ var diff;
+ /** @type {!number} */
+ var common;
+ /** @type {Among} */
+ var w;
+ /** @type {!number} */
+ var i2;
+ /** @type {!boolean} */
+ var res;
+ i = 0;
+ j = v_size;
+ c = this.cursor;
+ lb = this.limit_backward;
+ common_i = 0;
+ common_j = 0;
+ first_key_inspected = false;
+ while (true) {
+ k = i + (j - i >> 1);
+ diff = 0;
+ common = (common_i < common_j ? common_i : common_j);
+ w = v[k];
+ for (i2 = w.s_size - 1 - common; i2 >= 0; i2--) {
+ if (c - common === lb) {
+ diff = -1;
+ break;
+ }
+ diff = this.current.charCodeAt(c - 1 - common) - w.s.charCodeAt(i2);
+ if (diff !== 0) {
+ break;
+ }
+ common++;
+ }
+ if (diff < 0) {
+ j = k;
+ common_j = common;
+ } else {
+ i = k;
+ common_i = common;
+ }
+ if (j - i <= 1) {
+ if (i > 0) {
+ break;
+ }
+ if (j === i) {
+ break;
+ }
+ if (first_key_inspected) {
+ break;
+ }
+ first_key_inspected = true;
+ }
+ }
+ while (true) {
+ w = v[i];
+ if (common_i >= w.s_size) {
+ this.cursor = (c - w.s_size | 0);
+ if (w.method == null) {
+ return w.result;
+ }
+ res = w.method(this);
+ this.cursor = (c - w.s_size | 0);
+ if (res) {
+ return w.result;
+ }
+ }
+ i = w.substring_i;
+ if (i < 0) {
+ return 0;
+ }
+ }
+ return -1;
+};
+
+/**
+ * @param {!number} c_bra
+ * @param {!number} c_ket
+ * @param {!string} s
+ * @return {!number}
+ */
+BaseStemmer.prototype.replace_s$IIS = function (c_bra, c_ket, s) {
+ /** @type {!number} */
+ var adjustment;
+ adjustment = s.length - (c_ket - c_bra);
+ this.current = this.current.slice(0, c_bra) + s + this.current.slice(c_ket);
+ this.limit += (adjustment | 0);
+ if (this.cursor >= c_ket) {
+ this.cursor += (adjustment | 0);
+ } else {
+ if (this.cursor > c_bra) {
+ this.cursor = c_bra;
+ }
+ }
+ return (adjustment | 0);
+};
+
+/**
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.slice_check$ = function () {
+ /** @type {!number} */
+ var bra$0;
+ /** @type {!number} */
+ var ket$0;
+ /** @type {!number} */
+ var limit$0;
+ return ((bra$0 = this.bra) < 0 || bra$0 > (ket$0 = this.ket) || ket$0 > (limit$0 = this.limit) || limit$0 > this.current.length ? false : true);
+};
+
+/**
+ * @param {!string} s
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.slice_from$S = function (s) {
+ /** @type {!boolean} */
+ var result;
+ /** @type {!number} */
+ var bra$0;
+ /** @type {!number} */
+ var ket$0;
+ /** @type {!number} */
+ var limit$0;
+ result = false;
+ if ((bra$0 = this.bra) < 0 || bra$0 > (ket$0 = this.ket) || ket$0 > (limit$0 = this.limit) || limit$0 > this.current.length ? false : true) {
+ this.replace_s$IIS(this.bra, this.ket, s);
+ result = true;
+ }
+ return result;
+};
+
+/**
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.slice_del$ = function () {
+ return this.slice_from$S("");
+};
+
+/**
+ * @param {!number} c_bra
+ * @param {!number} c_ket
+ * @param {!string} s
+ */
+BaseStemmer.prototype.insert$IIS = function (c_bra, c_ket, s) {
+ /** @type {!number} */
+ var adjustment;
+ adjustment = this.replace_s$IIS(c_bra, c_ket, s);
+ if (c_bra <= this.bra) {
+ this.bra += (adjustment | 0);
+ }
+ if (c_bra <= this.ket) {
+ this.ket += (adjustment | 0);
+ }
+};
+
+/**
+ * @param {!string} s
+ * @return {!string}
+ */
+BaseStemmer.prototype.slice_to$S = function (s) {
+ /** @type {!string} */
+ var result;
+ /** @type {!number} */
+ var bra$0;
+ /** @type {!number} */
+ var ket$0;
+ /** @type {!number} */
+ var limit$0;
+ result = '';
+ if ((bra$0 = this.bra) < 0 || bra$0 > (ket$0 = this.ket) || ket$0 > (limit$0 = this.limit) || limit$0 > this.current.length ? false : true) {
+ result = this.current.slice(this.bra, this.ket);
+ }
+ return result;
+};
+
+/**
+ * @param {!string} s
+ * @return {!string}
+ */
+BaseStemmer.prototype.assign_to$S = function (s) {
+ return this.current.slice(0, this.limit);
+};
+
+/**
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.stem$ = function () {
+ return false;
+};
+
+/**
+ * @param {!string} word
+ * @return {!string}
+ */
+BaseStemmer.prototype.stemWord$S = function (word) {
+ /** @type {undefined|!string} */
+ var result;
+ /** @type {!string} */
+ var current$0;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var limit$0;
+ result = this.cache['.' + word];
+ if (result == null) {
+ current$0 = this.current = word;
+ cursor$0 = this.cursor = 0;
+ limit$0 = this.limit = current$0.length;
+ this.limit_backward = 0;
+ this.bra = cursor$0;
+ this.ket = limit$0;
+ this.stem$();
+ result = this.current;
+ this.cache['.' + word] = result;
+ }
+ return result;
+};
+
+/**
+ * @param {Array.<undefined|!string>} words
+ * @return {Array.<undefined|!string>}
+ */
+BaseStemmer.prototype.stemWords$AS = function (words) {
+ /** @type {Array.<undefined|!string>} */
+ var results;
+ /** @type {!number} */
+ var i;
+ /** @type {undefined|!string} */
+ var word;
+ /** @type {undefined|!string} */
+ var result;
+ /** @type {!string} */
+ var current$0;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var limit$0;
+ results = [ ];
+ for (i = 0; i < words.length; i++) {
+ word = words[i];
+ result = this.cache['.' + word];
+ if (result == null) {
+ current$0 = this.current = word;
+ cursor$0 = this.cursor = 0;
+ limit$0 = this.limit = current$0.length;
+ this.limit_backward = 0;
+ this.bra = cursor$0;
+ this.ket = limit$0;
+ this.stem$();
+ result = this.current;
+ this.cache['.' + word] = result;
+ }
+ results.push(result);
+ }
+ return results;
+};
+
+/**
+ * class RussianStemmer extends BaseStemmer
+ * @constructor
+ */
+function RussianStemmer() {
+}
+
+RussianStemmer.prototype = new BaseStemmer;
+/**
+ * @constructor
+ */
+function RussianStemmer$() {
+ BaseStemmer$.call(this);
+ this.I_p2 = 0;
+ this.I_pV = 0;
+};
+
+RussianStemmer$.prototype = new RussianStemmer;
+
+/**
+ * @param {RussianStemmer} other
+ */
+RussianStemmer.prototype.copy_from$LRussianStemmer$ = function (other) {
+ this.I_p2 = other.I_p2;
+ this.I_pV = other.I_pV;
+ BaseStemmer.prototype.copy_from$LBaseStemmer$.call(this, other);
+};
+
+/**
+ * @return {!boolean}
+ */
+RussianStemmer.prototype.r_mark_regions$ = function () {
+ /** @type {!number} */
+ var v_1;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!boolean} */
+ var lab2;
+ /** @type {!boolean} */
+ var lab4;
+ /** @type {!boolean} */
+ var lab6;
+ /** @type {!boolean} */
+ var lab8;
+ /** @type {!number} */
+ var limit$0;
+ this.I_pV = limit$0 = this.limit;
+ this.I_p2 = limit$0;
+ v_1 = this.cursor;
+ lab0 = true;
+lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ golab1:
+ while (true) {
+ lab2 = true;
+ lab2:
+ while (lab2 === true) {
+ lab2 = false;
+ if (! this.in_grouping$AIII(RussianStemmer.g_v, 1072, 1103)) {
+ break lab2;
+ }
+ break golab1;
+ }
+ if (this.cursor >= this.limit) {
+ break lab0;
+ }
+ this.cursor++;
+ }
+ this.I_pV = this.cursor;
+ golab3:
+ while (true) {
+ lab4 = true;
+ lab4:
+ while (lab4 === true) {
+ lab4 = false;
+ if (! this.out_grouping$AIII(RussianStemmer.g_v, 1072, 1103)) {
+ break lab4;
+ }
+ break golab3;
+ }
+ if (this.cursor >= this.limit) {
+ break lab0;
+ }
+ this.cursor++;
+ }
+ golab5:
+ while (true) {
+ lab6 = true;
+ lab6:
+ while (lab6 === true) {
+ lab6 = false;
+ if (! this.in_grouping$AIII(RussianStemmer.g_v, 1072, 1103)) {
+ break lab6;
+ }
+ break golab5;
+ }
+ if (this.cursor >= this.limit) {
+ break lab0;
+ }
+ this.cursor++;
+ }
+ golab7:
+ while (true) {
+ lab8 = true;
+ lab8:
+ while (lab8 === true) {
+ lab8 = false;
+ if (! this.out_grouping$AIII(RussianStemmer.g_v, 1072, 1103)) {
+ break lab8;
+ }
+ break golab7;
+ }
+ if (this.cursor >= this.limit) {
+ break lab0;
+ }
+ this.cursor++;
+ }
+ this.I_p2 = this.cursor;
+ }
+ this.cursor = v_1;
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+RussianStemmer.prototype.r_R2$ = function () {
+ return (! (this.I_p2 <= this.cursor) ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+RussianStemmer.prototype.r_perfective_gerund$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var v_1;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!boolean} */
+ var lab1;
+ this.ket = this.cursor;
+ among_var = this.find_among_b$ALAmong$I(RussianStemmer.a_0, 9);
+ if (among_var === 0) {
+ return false;
+ }
+ this.bra = this.cursor;
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ lab0 = true;
+ lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ v_1 = this.limit - this.cursor;
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ if (! this.eq_s_b$IS(1, "\u0430")) {
+ break lab1;
+ }
+ break lab0;
+ }
+ this.cursor = this.limit - v_1;
+ if (! this.eq_s_b$IS(1, "\u044F")) {
+ return false;
+ }
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 2:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+RussianStemmer.prototype.r_adjective$ = function () {
+ /** @type {!number} */
+ var among_var;
+ this.ket = this.cursor;
+ among_var = this.find_among_b$ALAmong$I(RussianStemmer.a_1, 26);
+ if (among_var === 0) {
+ return false;
+ }
+ this.bra = this.cursor;
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+RussianStemmer.prototype.r_adjectival$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!boolean} */
+ var lab2;
+ if (! this.r_adjective$()) {
+ return false;
+ }
+ v_1 = this.limit - this.cursor;
+ lab0 = true;
+lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ this.ket = this.cursor;
+ among_var = this.find_among_b$ALAmong$I(RussianStemmer.a_2, 8);
+ if (among_var === 0) {
+ this.cursor = this.limit - v_1;
+ break lab0;
+ }
+ this.bra = this.cursor;
+ switch (among_var) {
+ case 0:
+ this.cursor = this.limit - v_1;
+ break lab0;
+ case 1:
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ v_2 = this.limit - this.cursor;
+ lab2 = true;
+ lab2:
+ while (lab2 === true) {
+ lab2 = false;
+ if (! this.eq_s_b$IS(1, "\u0430")) {
+ break lab2;
+ }
+ break lab1;
+ }
+ this.cursor = this.limit - v_2;
+ if (! this.eq_s_b$IS(1, "\u044F")) {
+ this.cursor = this.limit - v_1;
+ break lab0;
+ }
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 2:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ }
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+RussianStemmer.prototype.r_reflexive$ = function () {
+ /** @type {!number} */
+ var among_var;
+ this.ket = this.cursor;
+ among_var = this.find_among_b$ALAmong$I(RussianStemmer.a_3, 2);
+ if (among_var === 0) {
+ return false;
+ }
+ this.bra = this.cursor;
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+RussianStemmer.prototype.r_verb$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var v_1;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!boolean} */
+ var lab1;
+ this.ket = this.cursor;
+ among_var = this.find_among_b$ALAmong$I(RussianStemmer.a_4, 46);
+ if (among_var === 0) {
+ return false;
+ }
+ this.bra = this.cursor;
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ lab0 = true;
+ lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ v_1 = this.limit - this.cursor;
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ if (! this.eq_s_b$IS(1, "\u0430")) {
+ break lab1;
+ }
+ break lab0;
+ }
+ this.cursor = this.limit - v_1;
+ if (! this.eq_s_b$IS(1, "\u044F")) {
+ return false;
+ }
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 2:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+RussianStemmer.prototype.r_noun$ = function () {
+ /** @type {!number} */
+ var among_var;
+ this.ket = this.cursor;
+ among_var = this.find_among_b$ALAmong$I(RussianStemmer.a_5, 36);
+ if (among_var === 0) {
+ return false;
+ }
+ this.bra = this.cursor;
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+RussianStemmer.prototype.r_derivational$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var cursor$0;
+ this.ket = this.cursor;
+ among_var = this.find_among_b$ALAmong$I(RussianStemmer.a_6, 2);
+ if (among_var === 0) {
+ return false;
+ }
+ this.bra = cursor$0 = this.cursor;
+ if (! (! (this.I_p2 <= cursor$0) ? false : true)) {
+ return false;
+ }
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+RussianStemmer.prototype.r_tidy_up$ = function () {
+ /** @type {!number} */
+ var among_var;
+ this.ket = this.cursor;
+ among_var = this.find_among_b$ALAmong$I(RussianStemmer.a_7, 4);
+ if (among_var === 0) {
+ return false;
+ }
+ this.bra = this.cursor;
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ this.ket = this.cursor;
+ if (! this.eq_s_b$IS(1, "\u043D")) {
+ return false;
+ }
+ this.bra = this.cursor;
+ if (! this.eq_s_b$IS(1, "\u043D")) {
+ return false;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 2:
+ if (! this.eq_s_b$IS(1, "\u043D")) {
+ return false;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 3:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+RussianStemmer.prototype.stem$ = function () {
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var v_3;
+ /** @type {!number} */
+ var v_4;
+ /** @type {!number} */
+ var v_5;
+ /** @type {!number} */
+ var v_6;
+ /** @type {!number} */
+ var v_7;
+ /** @type {!number} */
+ var v_8;
+ /** @type {!number} */
+ var v_9;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!boolean} */
+ var lab2;
+ /** @type {!boolean} */
+ var lab3;
+ /** @type {!boolean} */
+ var lab4;
+ /** @type {!boolean} */
+ var lab5;
+ /** @type {!boolean} */
+ var lab6;
+ /** @type {!boolean} */
+ var lab7;
+ /** @type {!boolean} */
+ var lab8;
+ /** @type {!boolean} */
+ var lab9;
+ /** @type {!boolean} */
+ var lab10;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var limit$0;
+ /** @type {!number} */
+ var cursor$1;
+ /** @type {!number} */
+ var limit$1;
+ /** @type {!number} */
+ var cursor$2;
+ /** @type {!number} */
+ var cursor$3;
+ /** @type {!number} */
+ var limit$2;
+ /** @type {!number} */
+ var cursor$4;
+ /** @type {!number} */
+ var limit$3;
+ /** @type {!number} */
+ var cursor$5;
+ /** @type {!number} */
+ var limit_backward$0;
+ v_1 = this.cursor;
+ lab0 = true;
+lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ if (! this.r_mark_regions$()) {
+ break lab0;
+ }
+ }
+ cursor$0 = this.cursor = v_1;
+ this.limit_backward = cursor$0;
+ cursor$1 = this.cursor = limit$0 = this.limit;
+ v_2 = limit$0 - cursor$1;
+ if (cursor$1 < this.I_pV) {
+ return false;
+ }
+ cursor$3 = this.cursor = this.I_pV;
+ v_3 = this.limit_backward;
+ this.limit_backward = cursor$3;
+ cursor$4 = this.cursor = (limit$2 = this.limit) - v_2;
+ v_4 = limit$2 - cursor$4;
+ lab1 = true;
+lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ lab2 = true;
+ lab2:
+ while (lab2 === true) {
+ lab2 = false;
+ v_5 = this.limit - this.cursor;
+ lab3 = true;
+ lab3:
+ while (lab3 === true) {
+ lab3 = false;
+ if (! this.r_perfective_gerund$()) {
+ break lab3;
+ }
+ break lab2;
+ }
+ cursor$2 = this.cursor = (limit$1 = this.limit) - v_5;
+ v_6 = limit$1 - cursor$2;
+ lab4 = true;
+ lab4:
+ while (lab4 === true) {
+ lab4 = false;
+ if (! this.r_reflexive$()) {
+ this.cursor = this.limit - v_6;
+ break lab4;
+ }
+ }
+ lab5 = true;
+ lab5:
+ while (lab5 === true) {
+ lab5 = false;
+ v_7 = this.limit - this.cursor;
+ lab6 = true;
+ lab6:
+ while (lab6 === true) {
+ lab6 = false;
+ if (! this.r_adjectival$()) {
+ break lab6;
+ }
+ break lab5;
+ }
+ this.cursor = this.limit - v_7;
+ lab7 = true;
+ lab7:
+ while (lab7 === true) {
+ lab7 = false;
+ if (! this.r_verb$()) {
+ break lab7;
+ }
+ break lab5;
+ }
+ this.cursor = this.limit - v_7;
+ if (! this.r_noun$()) {
+ break lab1;
+ }
+ }
+ }
+ }
+ cursor$5 = this.cursor = (limit$3 = this.limit) - v_4;
+ v_8 = limit$3 - cursor$5;
+ lab8 = true;
+lab8:
+ while (lab8 === true) {
+ lab8 = false;
+ this.ket = this.cursor;
+ if (! this.eq_s_b$IS(1, "\u0438")) {
+ this.cursor = this.limit - v_8;
+ break lab8;
+ }
+ this.bra = this.cursor;
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ }
+ v_9 = this.limit - this.cursor;
+ lab9 = true;
+lab9:
+ while (lab9 === true) {
+ lab9 = false;
+ if (! this.r_derivational$()) {
+ break lab9;
+ }
+ }
+ this.cursor = this.limit - v_9;
+ lab10 = true;
+lab10:
+ while (lab10 === true) {
+ lab10 = false;
+ if (! this.r_tidy_up$()) {
+ break lab10;
+ }
+ }
+ limit_backward$0 = this.limit_backward = v_3;
+ this.cursor = limit_backward$0;
+ return true;
+};
+
+/**
+ * @param {*} o
+ * @return {!boolean}
+ */
+RussianStemmer.prototype.equals$X = function (o) {
+ return o instanceof RussianStemmer;
+};
+
+/**
+ * @return {!number}
+ */
+RussianStemmer.prototype.hashCode$ = function () {
+ /** @type {!string} */
+ var classname;
+ /** @type {!number} */
+ var hash;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var char;
+ classname = "RussianStemmer";
+ hash = 0;
+ if ("RussianStemmer".length === 0) {
+ return (hash | 0);
+ }
+ for (i = 0; i < classname.length; i++) {
+ char = classname.charCodeAt(i);
+ hash = (hash << 5) - hash + char;
+ hash = hash & hash;
+ }
+ return (hash | 0);
+};
+
+/**
+ * class Among extends Object
+ * @constructor
+ */
+function Among() {
+}
+
+/**
+ * @constructor
+ * @param {!string} s
+ * @param {!number} substring_i
+ * @param {!number} result
+ */
+function Among$SII(s, substring_i, result) {
+ this.s_size = s.length;
+ this.s = s;
+ this.substring_i = substring_i;
+ this.result = result;
+ this.method = null;
+ this.instance = null;
+};
+
+Among$SII.prototype = new Among;
+
+/**
+ * @constructor
+ * @param {!string} s
+ * @param {!number} substring_i
+ * @param {!number} result
+ * @param {*} method
+ * @param {BaseStemmer} instance
+ */
+function Among$SIIF$LBaseStemmer$B$LBaseStemmer$(s, substring_i, result, method, instance) {
+ this.s_size = s.length;
+ this.s = s;
+ this.substring_i = substring_i;
+ this.result = result;
+ this.method = method;
+ this.instance = instance;
+};
+
+Among$SIIF$LBaseStemmer$B$LBaseStemmer$.prototype = new Among;
+
+/**
+ * class Metadata extends Object
+ * @constructor
+ */
+function Metadata() {
+}
+
+/**
+ * @constructor
+ * @param {Oktavia} parent
+ */
+function Metadata$LOktavia$(parent) {
+ this._parent = parent;
+ this._bitVector = new BitVector$();
+};
+
+Metadata$LOktavia$.prototype = new Metadata;
+
+/**
+ * @return {!number}
+ */
+Metadata.prototype._size$ = function () {
+ /** @type {BitVector} */
+ var this$0;
+ /** @type {!number} */
+ var i$0;
+ /** @type {BitVector} */
+ var _bitVector$0;
+ this$0 = _bitVector$0 = this._bitVector;
+ i$0 = _bitVector$0._size;
+ return this$0.rank$IB(i$0, true);
+};
+
+/**
+ * @param {!number} index
+ * @return {!string}
+ */
+Metadata.prototype.getContent$I = function (index) {
+ /** @type {!number} */
+ var startPosition;
+ /** @type {!number} */
+ var length;
+ if (index < 0 || this._size$() <= index) {
+ throw new Error("Section.getContent() : range error " + (index + ""));
+ }
+ startPosition = 0;
+ if (index > 0) {
+ startPosition = this._bitVector.select$I(index - 1) + 1;
+ }
+ length = this._bitVector.select$I(index) - startPosition + 1;
+ return this._parent._getSubstring$II(startPosition, length);
+};
+
+/**
+ * @param {!number} index
+ * @return {!number}
+ */
+Metadata.prototype.getStartPosition$I = function (index) {
+ /** @type {!number} */
+ var startPosition;
+ if (index < 0 || this._size$() <= index) {
+ throw new Error("Section.getContent() : range error " + (index + ""));
+ }
+ startPosition = 0;
+ if (index > 0) {
+ startPosition = this._bitVector.select$I(index - 1) + 1;
+ }
+ return (startPosition | 0);
+};
+
+/**
+ * @param {SingleResult} result
+ * @param {Array.<undefined|!number>} positions
+ * @param {!string} word
+ * @param {!boolean} stemmed
+ */
+Metadata.prototype.grouping$LSingleResult$AISB = function (result, positions, word, stemmed) {
+};
+
+/**
+ * @param {!number} index
+ * @return {!string}
+ */
+Metadata.prototype.getInformation$I = function (index) {
+ return '';
+};
+
+/**
+ */
+Metadata.prototype._build$ = function () {
+ this._bitVector.build$();
+};
+
+/**
+ * @param {!string} name
+ * @param {!string} data
+ * @param {!number} offset
+ * @return {!number}
+ */
+Metadata.prototype._load$SSI = function (name, data, offset) {
+ offset = this._bitVector.load$SI(data, offset);
+ this._parent._metadataLabels.push(name);
+ this._parent._metadatas[name] = this;
+ return offset;
+};
+
+/**
+ * @return {!string}
+ */
+Metadata.prototype._dump$ = function () {
+ /** @type {BitVector} */
+ var this$0;
+ /** @type {Array.<undefined|!string>} */
+ var contents$0;
+ this$0 = this._bitVector;
+ contents$0 = [ ];
+ contents$0.push(Binary$dump32bitNumber$N(this$0._size));
+ contents$0.push(Binary$dump32bitNumberList$AN(this$0._v));
+ return contents$0.join('');
+};
+
+/**
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+Metadata.prototype._dump$LCompressionReport$ = function (report) {
+ /** @type {BitVector} */
+ var this$0;
+ /** @type {Array.<undefined|!string>} */
+ var contents$0;
+ this$0 = this._bitVector;
+ contents$0 = [ ];
+ contents$0.push(Binary$dump32bitNumber$N(this$0._size));
+ CompressionReport$add$LCompressionReport$II(report, 2, 2);
+ contents$0.push(Binary$dump32bitNumberList$ANLCompressionReport$(this$0._v, report));
+ return contents$0.join('');
+};
+
+/**
+ * class Section extends Metadata
+ * @constructor
+ */
+function Section() {
+}
+
+Section.prototype = new Metadata;
+/**
+ * @constructor
+ * @param {Oktavia} parent
+ */
+function Section$LOktavia$(parent) {
+ this._parent = parent;
+ this._bitVector = new BitVector$();
+ this._names = [ ];
+};
+
+Section$LOktavia$.prototype = new Section;
+
+/**
+ * @param {!string} name
+ */
+Section.prototype.setTail$S = function (name) {
+ /** @type {!number} */
+ var index$0;
+ /** @type {Oktavia} */
+ var this$0;
+ /** @type {FMIndex} */
+ var this$0$0;
+ this$0 = this._parent;
+ this$0$0 = this$0._fmindex;
+ index$0 = this$0$0._substr.length;
+ this._names.push(name);
+ this._bitVector.set$I(index$0 - 1);
+};
+
+/**
+ * @param {!string} name
+ * @param {!number} index
+ */
+Section.prototype.setTail$SI = function (name, index) {
+ this._names.push(name);
+ this._bitVector.set$I(index - 1);
+};
+
+/**
+ * @return {!number}
+ */
+Section.prototype.size$ = function () {
+ return (this._names.length | 0);
+};
+
+/**
+ * @param {!number} position
+ * @return {!number}
+ */
+Section.prototype.getSectionIndex$I = function (position) {
+ /** @type {BitVector} */
+ var this$0;
+ if (position < 0 || this._bitVector.size$() <= position) {
+ throw new Error("Section.getSectionIndex() : range error " + (position + ""));
+ }
+ this$0 = this._bitVector;
+ return this$0.rank$IB(position, true);
+};
+
+/**
+ * @param {!number} index
+ * @return {!string}
+ */
+Section.prototype.getName$I = function (index) {
+ if (index < 0 || this._names.length <= index) {
+ throw new Error("Section.getName() : range error");
+ }
+ return this._names[index];
+};
+
+/**
+ * @param {SingleResult} result
+ * @param {Array.<undefined|!number>} positions
+ * @param {!string} word
+ * @param {!boolean} stemmed
+ */
+Section.prototype.grouping$LSingleResult$AISB = function (result, positions, word, stemmed) {
+ /** @type {!number} */
+ var i;
+ /** @type {undefined|!number} */
+ var position;
+ /** @type {!number} */
+ var index;
+ /** @type {SearchUnit} */
+ var unit;
+ for (i = 0; i < positions.length; i++) {
+ position = positions[i];
+ index = this.getSectionIndex$I(position);
+ unit = SingleResult$getSearchUnit$LSingleResult$I(result, index);
+ if (unit.startPosition < 0) {
+ unit.startPosition = this.getStartPosition$I(index);
+ }
+ SearchUnit$addPosition$LSearchUnit$SIB(unit, word, position - unit.startPosition, stemmed);
+ }
+};
+
+/**
+ * @param {!number} index
+ * @return {!string}
+ */
+Section.prototype.getInformation$I = function (index) {
+ return this.getName$I(index);
+};
+
+/**
+ * @param {Oktavia} parent
+ * @param {!string} name
+ * @param {!string} data
+ * @param {!number} offset
+ * @return {!number}
+ */
+Section._load$LOktavia$SSI = function (parent, name, data, offset) {
+ /** @type {LoadedStringListResult} */
+ var strs;
+ /** @type {Section} */
+ var section;
+ /** @type {!number} */
+ var offset$0;
+ strs = new LoadedStringListResult$SI(data, offset);
+ section = new Section$LOktavia$(parent);
+ section._names = strs.result;
+ offset$0 = strs.offset;
+ offset$0 = section._bitVector.load$SI(data, offset$0);
+ section._parent._metadataLabels.push(name);
+ section._parent._metadatas[name] = section;
+ return offset$0;
+};
+
+var Section$_load$LOktavia$SSI = Section._load$LOktavia$SSI;
+
+/**
+ * @return {!string}
+ */
+Section.prototype._dump$ = function () {
+ return [ Binary$dump16bitNumber$I(0), Binary$dumpStringList$AS(this._names), Metadata.prototype._dump$.call(this) ].join('');
+};
+
+/**
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+Section.prototype._dump$LCompressionReport$ = function (report) {
+ CompressionReport$add$LCompressionReport$II(report, 1, 1);
+ return [ Binary$dump16bitNumber$I(0), Binary$dumpStringList$ASLCompressionReport$(this._names, report), Metadata.prototype._dump$LCompressionReport$.call(this, report) ].join('');
+};
+
+/**
+ * class Splitter extends Metadata
+ * @constructor
+ */
+function Splitter() {
+}
+
+Splitter.prototype = new Metadata;
+/**
+ * @constructor
+ * @param {Oktavia} parent
+ */
+function Splitter$LOktavia$(parent) {
+ this._parent = parent;
+ this._bitVector = new BitVector$();
+ this.name = null;
+};
+
+Splitter$LOktavia$.prototype = new Splitter;
+
+/**
+ * @constructor
+ * @param {Oktavia} parent
+ * @param {!string} name
+ */
+function Splitter$LOktavia$S(parent, name) {
+ this._parent = parent;
+ this._bitVector = new BitVector$();
+ this.name = name;
+};
+
+Splitter$LOktavia$S.prototype = new Splitter;
+
+/**
+ * @return {!number}
+ */
+Splitter.prototype.size$ = function () {
+ /** @type {BitVector} */
+ var this$0$0;
+ /** @type {!number} */
+ var i$0$0;
+ /** @type {BitVector} */
+ var _bitVector$0;
+ this$0$0 = _bitVector$0 = this._bitVector;
+ i$0$0 = _bitVector$0._size;
+ return this$0$0.rank$IB(i$0$0, true);
+};
+
+/**
+ */
+Splitter.prototype.split$ = function () {
+ /** @type {!number} */
+ var index$0;
+ /** @type {Oktavia} */
+ var this$0;
+ /** @type {FMIndex} */
+ var this$0$0;
+ this$0 = this._parent;
+ this$0$0 = this$0._fmindex;
+ index$0 = this$0$0._substr.length;
+ this._bitVector.set$I(index$0 - 1);
+};
+
+/**
+ * @param {!number} index
+ */
+Splitter.prototype.split$I = function (index) {
+ this._bitVector.set$I(index - 1);
+};
+
+/**
+ * @param {!number} position
+ * @return {!number}
+ */
+Splitter.prototype.getIndex$I = function (position) {
+ /** @type {BitVector} */
+ var this$0;
+ if (position < 0 || this._bitVector.size$() <= position) {
+ throw new Error("Section.getSectionIndex() : range error");
+ }
+ this$0 = this._bitVector;
+ return this$0.rank$IB(position, true);
+};
+
+/**
+ * @param {SingleResult} result
+ * @param {Array.<undefined|!number>} positions
+ * @param {!string} word
+ * @param {!boolean} stemmed
+ */
+Splitter.prototype.grouping$LSingleResult$AISB = function (result, positions, word, stemmed) {
+ /** @type {!number} */
+ var i;
+ /** @type {undefined|!number} */
+ var position;
+ /** @type {!number} */
+ var index;
+ /** @type {SearchUnit} */
+ var unit;
+ for (i = 0; i < positions.length; i++) {
+ position = positions[i];
+ index = this.getIndex$I(position);
+ unit = SingleResult$getSearchUnit$LSingleResult$I(result, index);
+ if (unit.startPosition < 0) {
+ unit.startPosition = this.getStartPosition$I(index);
+ }
+ SearchUnit$addPosition$LSearchUnit$SIB(unit, word, position - unit.startPosition, stemmed);
+ }
+};
+
+/**
+ * @param {!number} index
+ * @return {!string}
+ */
+Splitter.prototype.getInformation$I = function (index) {
+ return (this.name != null ? this.name + (index + 1 + "") : '');
+};
+
+/**
+ * @param {Oktavia} parent
+ * @param {!string} name
+ * @param {!string} data
+ * @param {!number} offset
+ * @return {!number}
+ */
+Splitter._load$LOktavia$SSI = function (parent, name, data, offset) {
+ /** @type {Splitter} */
+ var section;
+ section = new Splitter$LOktavia$(parent);
+ offset = section._bitVector.load$SI(data, offset);
+ section._parent._metadataLabels.push(name);
+ section._parent._metadatas[name] = section;
+ return offset;
+};
+
+var Splitter$_load$LOktavia$SSI = Splitter._load$LOktavia$SSI;
+
+/**
+ * @return {!string}
+ */
+Splitter.prototype._dump$ = function () {
+ return [ Binary$dump16bitNumber$I(1), Metadata.prototype._dump$.call(this) ].join('');
+};
+
+/**
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+Splitter.prototype._dump$LCompressionReport$ = function (report) {
+ CompressionReport$add$LCompressionReport$II(report, 1, 1);
+ return [ Binary$dump16bitNumber$I(1), Metadata.prototype._dump$LCompressionReport$.call(this, report) ].join('');
+};
+
+/**
+ * class Table extends Metadata
+ * @constructor
+ */
+function Table() {
+}
+
+Table.prototype = new Metadata;
+/**
+ * @constructor
+ * @param {Oktavia} parent
+ * @param {Array.<undefined|!string>} headers
+ */
+function Table$LOktavia$AS(parent, headers) {
+ this._parent = parent;
+ this._bitVector = new BitVector$();
+ this._headers = headers;
+ this._columnTails = new BitVector$();
+};
+
+Table$LOktavia$AS.prototype = new Table;
+
+/**
+ * @return {!number}
+ */
+Table.prototype.rowSize$ = function () {
+ /** @type {BitVector} */
+ var this$0$0;
+ /** @type {!number} */
+ var i$0$0;
+ /** @type {BitVector} */
+ var _bitVector$0;
+ this$0$0 = _bitVector$0 = this._bitVector;
+ i$0$0 = _bitVector$0._size;
+ return this$0$0.rank$IB(i$0$0, true);
+};
+
+/**
+ * @return {!number}
+ */
+Table.prototype.columnSize$ = function () {
+ return (this._headers.length | 0);
+};
+
+/**
+ */
+Table.prototype.setColumnTail$ = function () {
+ /** @type {!number} */
+ var index;
+ /** @type {Oktavia} */
+ var this$0;
+ /** @type {FMIndex} */
+ var this$0$0;
+ /** @type {Oktavia} */
+ var _parent$0;
+ this$0 = _parent$0 = this._parent;
+ this$0$0 = this$0._fmindex;
+ index = this$0$0._substr.length;
+ _parent$0._fmindex.push$S(Oktavia.eob);
+ this._columnTails.set$I(index - 1);
+};
+
+/**
+ */
+Table.prototype.setRowTail$ = function () {
+ /** @type {!number} */
+ var index;
+ /** @type {Oktavia} */
+ var this$0;
+ /** @type {FMIndex} */
+ var this$0$0;
+ this$0 = this._parent;
+ this$0$0 = this$0._fmindex;
+ index = this$0$0._substr.length;
+ this._bitVector.set$I(index - 1);
+};
+
+/**
+ * @param {!number} position
+ * @return {Array.<undefined|!number>}
+ */
+Table.prototype.getCell$I = function (position) {
+ /** @type {!number} */
+ var row;
+ /** @type {!number} */
+ var currentColumn;
+ /** @type {!number} */
+ var lastRowColumn;
+ /** @type {!number} */
+ var startPosition;
+ /** @type {Array.<undefined|!number>} */
+ var result;
+ /** @type {BitVector} */
+ var this$0;
+ /** @type {BitVector} */
+ var this$1;
+ if (position < 0 || this._bitVector.size$() <= position) {
+ throw new Error("Section.getSectionIndex() : range error " + (position + ""));
+ }
+ this$0 = this._bitVector;
+ row = this$0.rank$IB(position, true);
+ this$1 = this._columnTails;
+ currentColumn = this$1.rank$IB(position, true);
+ lastRowColumn = 0;
+ if (row > 0) {
+ startPosition = this._bitVector.select$I(row - 1) + 1;
+ lastRowColumn = this._columnTails.rank$I(startPosition);
+ }
+ result = [ row, currentColumn - lastRowColumn ];
+ return result;
+};
+
+/**
+ * @param {!number} rowIndex
+ * @return {Object.<string, undefined|!string>}
+ */
+Table.prototype.getRowContent$I = function (rowIndex) {
+ /** @type {!string} */
+ var content;
+ /** @type {Array.<undefined|!string>} */
+ var values;
+ /** @type {Object.<string, undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var i;
+ content = this.getContent$I(rowIndex);
+ values = content.split(Oktavia.eob, this._headers.length);
+ result = ({ });
+ for (i in this._headers) {
+ if (i < values.length) {
+ result[this._headers[i]] = values[i];
+ } else {
+ result[this._headers[i]] = '';
+ }
+ }
+ return result;
+};
+
+/**
+ * @param {SingleResult} result
+ * @param {Array.<undefined|!number>} positions
+ * @param {!string} word
+ * @param {!boolean} stemmed
+ */
+Table.prototype.grouping$LSingleResult$AISB = function (result, positions, word, stemmed) {
+};
+
+/**
+ * @param {!number} index
+ * @return {!string}
+ */
+Table.prototype.getInformation$I = function (index) {
+ return '';
+};
+
+/**
+ */
+Table.prototype._build$ = function () {
+ this._bitVector.build$();
+ this._columnTails.build$();
+};
+
+/**
+ * @param {Oktavia} parent
+ * @param {!string} name
+ * @param {!string} data
+ * @param {!number} offset
+ * @return {!number}
+ */
+Table._load$LOktavia$SSI = function (parent, name, data, offset) {
+ /** @type {LoadedStringListResult} */
+ var strs;
+ /** @type {Table} */
+ var table;
+ /** @type {!number} */
+ var offset$0;
+ strs = new LoadedStringListResult$SI(data, offset);
+ table = new Table$LOktavia$AS(parent, strs.result);
+ offset$0 = strs.offset;
+ offset$0 = table._bitVector.load$SI(data, offset$0);
+ table._parent._metadataLabels.push(name);
+ table._parent._metadatas[name] = table;
+ offset = offset$0;
+ return table._columnTails.load$SI(data, offset$0);
+};
+
+var Table$_load$LOktavia$SSI = Table._load$LOktavia$SSI;
+
+/**
+ * @return {!string}
+ */
+Table.prototype._dump$ = function () {
+ return [ Binary$dump16bitNumber$I(2), Binary$dumpStringList$AS(this._headers), Metadata.prototype._dump$.call(this), this._columnTails.dump$() ].join('');
+};
+
+/**
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+Table.prototype._dump$LCompressionReport$ = function (report) {
+ CompressionReport$add$LCompressionReport$II(report, 1, 1);
+ return [ Binary$dump16bitNumber$I(2), Binary$dumpStringList$ASLCompressionReport$(this._headers, report), Metadata.prototype._dump$LCompressionReport$.call(this, report), this._columnTails.dump$LCompressionReport$(report) ].join('');
+};
+
+/**
+ * class Block extends Metadata
+ * @constructor
+ */
+function Block() {
+}
+
+Block.prototype = new Metadata;
+/**
+ * @constructor
+ * @param {Oktavia} parent
+ */
+function Block$LOktavia$(parent) {
+ this._parent = parent;
+ this._bitVector = new BitVector$();
+ this._names = [ ];
+ this._start = false;
+};
+
+Block$LOktavia$.prototype = new Block;
+
+/**
+ * @param {!string} blockName
+ */
+Block.prototype.startBlock$S = function (blockName) {
+ this.startBlock$SI(blockName, this._parent.contentSize$());
+};
+
+/**
+ * @param {!string} blockName
+ * @param {!number} index
+ */
+Block.prototype.startBlock$SI = function (blockName, index) {
+ if (this._start) {
+ throw new Error('Splitter `' + this._names[this._names.length - 1] + '` is not closed');
+ }
+ this._start = true;
+ this._names.push(blockName);
+ this._bitVector.set$I(index - 1);
+};
+
+/**
+ */
+Block.prototype.endBlock$ = function () {
+ this.endBlock$I(this._parent.contentSize$());
+};
+
+/**
+ * @param {!number} index
+ */
+Block.prototype.endBlock$I = function (index) {
+ if (! this._start) {
+ throw new Error('Splitter is not started');
+ }
+ this._start = false;
+ this._bitVector.set$I(index - 1);
+};
+
+/**
+ * @return {!number}
+ */
+Block.prototype.size$ = function () {
+ return (this._names.length | 0);
+};
+
+/**
+ * @param {!number} position
+ * @return {!number}
+ */
+Block.prototype.blockIndex$I = function (position) {
+ /** @type {!number} */
+ var result;
+ /** @type {BitVector} */
+ var this$0;
+ if (position < 0 || this._parent._fmindex.size$() - 1 <= position) {
+ throw new Error("Block.blockIndex() : range error " + (position + ""));
+ }
+ if (position >= this._bitVector.size$()) {
+ position = (this._bitVector.size$() - 1 | 0);
+ result = (this._bitVector.rank$I(position) + 1 | 0);
+ } else {
+ this$0 = this._bitVector;
+ result = this$0.rank$IB(position, true);
+ }
+ return result;
+};
+
+/**
+ * @param {!number} position
+ * @return {!boolean}
+ */
+Block.prototype.inBlock$I = function (position) {
+ /** @type {!number} */
+ var blockIndex;
+ blockIndex = this.blockIndex$I(position);
+ return blockIndex % 2 !== 0;
+};
+
+/**
+ * @param {!number} position
+ * @return {!string}
+ */
+Block.prototype.getBlockContent$I = function (position) {
+ /** @type {!number} */
+ var blockIndex;
+ /** @type {!string} */
+ var result;
+ blockIndex = this.blockIndex$I(position);
+ if (blockIndex % 2 !== 0) {
+ result = this.getContent$I(blockIndex);
+ } else {
+ result = '';
+ }
+ return result;
+};
+
+/**
+ * @param {!number} position
+ * @return {!string}
+ */
+Block.prototype.getBlockName$I = function (position) {
+ /** @type {!number} */
+ var blockIndex;
+ /** @type {!string} */
+ var result;
+ blockIndex = this.blockIndex$I(position);
+ if (blockIndex % 2 !== 0) {
+ result = this._names[blockIndex >>> 1];
+ } else {
+ result = '';
+ }
+ return result;
+};
+
+/**
+ * @param {SingleResult} result
+ * @param {Array.<undefined|!number>} positions
+ * @param {!string} word
+ * @param {!boolean} stemmed
+ */
+Block.prototype.grouping$LSingleResult$AISB = function (result, positions, word, stemmed) {
+};
+
+/**
+ * @param {!number} index
+ * @return {!string}
+ */
+Block.prototype.getInformation$I = function (index) {
+ return '';
+};
+
+/**
+ * @param {Oktavia} parent
+ * @param {!string} name
+ * @param {!string} data
+ * @param {!number} offset
+ * @return {!number}
+ */
+Block._load$LOktavia$SSI = function (parent, name, data, offset) {
+ /** @type {LoadedStringListResult} */
+ var strs;
+ /** @type {Block} */
+ var block;
+ /** @type {!number} */
+ var offset$0;
+ strs = new LoadedStringListResult$SI(data, offset);
+ block = new Block$LOktavia$(parent);
+ block._names = strs.result;
+ offset$0 = strs.offset;
+ offset$0 = block._bitVector.load$SI(data, offset$0);
+ block._parent._metadataLabels.push(name);
+ block._parent._metadatas[name] = block;
+ return offset$0;
+};
+
+var Block$_load$LOktavia$SSI = Block._load$LOktavia$SSI;
+
+/**
+ * @return {!string}
+ */
+Block.prototype._dump$ = function () {
+ return [ Binary$dump16bitNumber$I(3), Binary$dumpStringList$AS(this._names), Metadata.prototype._dump$.call(this) ].join('');
+};
+
+/**
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+Block.prototype._dump$LCompressionReport$ = function (report) {
+ CompressionReport$add$LCompressionReport$II(report, 1, 1);
+ return [ Binary$dump16bitNumber$I(3), Binary$dumpStringList$ASLCompressionReport$(this._names, report), Metadata.prototype._dump$LCompressionReport$.call(this, report) ].join('');
+};
+
+/**
+ * class FMIndex extends Object
+ * @constructor
+ */
+function FMIndex() {
+}
+
+/**
+ * @constructor
+ */
+function FMIndex$() {
+ /** @type {Array.<undefined|!number>} */
+ var _rlt$0;
+ this._ssize = 0;
+ (this._ddic = 0, this._head = 0);
+ this._substr = "";
+ this._sv = new WaveletMatrix$();
+ this._posdic = [ ];
+ this._idic = [ ];
+ _rlt$0 = this._rlt = [ ];
+ _rlt$0.length = 65536;
+};
+
+FMIndex$.prototype = new FMIndex;
+
+/**
+ */
+FMIndex.prototype.clear$ = function () {
+ /** @type {WaveletMatrix} */
+ var this$0;
+ this$0 = this._sv;
+ this$0._bv.length = 0;
+ this$0._seps.length = 0;
+ this$0._size = 0;
+ this._posdic.length = 0;
+ this._idic.length = 0;
+ this._ddic = 0;
+ this._head = 0;
+ this._substr = "";
+};
+
+/**
+ * @return {!number}
+ */
+FMIndex.prototype.size$ = function () {
+ /** @type {WaveletMatrix} */
+ var this$0;
+ this$0 = this._sv;
+ return this$0._size;
+};
+
+/**
+ * @return {!number}
+ */
+FMIndex.prototype.contentSize$ = function () {
+ return this._substr.length;
+};
+
+/**
+ * @param {!string} key
+ * @return {!number}
+ */
+FMIndex.prototype.getRows$S = function (key) {
+ /** @type {Array.<undefined|!number>} */
+ var pos;
+ pos = [ ];
+ return this.getRows$SAI(key, pos);
+};
+
+/**
+ * @param {!string} key
+ * @param {Array.<undefined|!number>} pos
+ * @return {!number}
+ */
+FMIndex.prototype.getRows$SAI = function (key, pos) {
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var code;
+ /** @type {!number} */
+ var first;
+ /** @type {undefined|!number} */
+ var last;
+ /** @type {!number} */
+ var c;
+ /** @type {Array.<undefined|!number>} */
+ var _rlt$0;
+ i = key.length - 1;
+ code = key.charCodeAt(i);
+ first = (_rlt$0 = this._rlt)[code] + 1;
+ last = _rlt$0[code + 1];
+ while (first <= last) {
+ if (i === 0) {
+ pos[0] = (-- first | 0);
+ pos[1] = -- last;
+ return (last - first + 1 | 0);
+ }
+ i--;
+ c = key.charCodeAt(i);
+ first = this._rlt[c] + this._sv.rank$II(first - 1, c) + 1;
+ last = this._rlt[c] + this._sv.rank$II(last, c);
+ }
+ return 0;
+};
+
+/**
+ * @param {!number} i
+ * @return {!number}
+ */
+FMIndex.prototype.getPosition$I = function (i) {
+ /** @type {!number} */
+ var pos;
+ /** @type {!number} */
+ var c;
+ if (i >= this.size$()) {
+ throw new Error("FMIndex.getPosition() : range error");
+ }
+ pos = 0;
+ while (i !== this._head) {
+ if (i % this._ddic === 0) {
+ pos += this._posdic[i / this._ddic] + 1;
+ break;
+ }
+ c = this._sv.get$I(i);
+ i = this._rlt[c] + this._sv.rank$II(i, c);
+ pos++;
+ }
+ return (pos % this.size$() | 0);
+};
+
+/**
+ * @param {!number} pos
+ * @param {!number} len
+ * @return {!string}
+ */
+FMIndex.prototype.getSubstring$II = function (pos, len) {
+ /** @type {!number} */
+ var pos_end;
+ /** @type {!number} */
+ var pos_tmp;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var pos_idic;
+ /** @type {!string} */
+ var substr;
+ /** @type {!number} */
+ var c;
+ /** @type {!number} */
+ var _ddic$0;
+ if (pos >= this.size$()) {
+ throw new Error("FMIndex.getSubstring() : range error");
+ }
+ pos_end = Math.min(pos + len, this.size$());
+ pos_tmp = this.size$() - 1;
+ i = this._head;
+ pos_idic = Math.floor((pos_end + (_ddic$0 = this._ddic) - 2) / _ddic$0);
+ if (pos_idic < this._idic.length) {
+ pos_tmp = pos_idic * this._ddic;
+ i = this._idic[pos_idic];
+ }
+ substr = "";
+ while (pos_tmp >= pos) {
+ c = this._sv.get$I(i);
+ i = this._rlt[c] + this._sv.rank$II(i, c);
+ if (pos_tmp < pos_end) {
+ substr = String.fromCharCode(c) + substr;
+ }
+ if (pos_tmp === 0) {
+ break;
+ }
+ pos_tmp--;
+ }
+ return substr;
+};
+
+/**
+ */
+FMIndex.prototype.build$ = function () {
+ this.build$SIIB(String.fromCharCode(0), 65535, 20, false);
+};
+
+/**
+ * @param {!string} end_marker
+ * @param {!number} ddic
+ * @param {!boolean} verbose
+ */
+FMIndex.prototype.build$SIB = function (end_marker, ddic, verbose) {
+ this.build$SIIB(end_marker, 65535, ddic, verbose);
+};
+
+/**
+ * @param {!string} end_marker
+ * @param {!number} maxChar
+ * @param {!number} ddic
+ * @param {!boolean} verbose
+ */
+FMIndex.prototype.build$SIIB = function (end_marker, maxChar, ddic, verbose) {
+ /** @type {BurrowsWheelerTransform} */
+ var b;
+ /** @type {!string} */
+ var s;
+ /** @type {!number} */
+ var c;
+ /** @type {!string} */
+ var str$0;
+ /** @type {WaveletMatrix} */
+ var this$0;
+ /** @type {!string} */
+ var _str$0;
+ /** @type {Array.<undefined|!number>} */
+ var _suffixarray$0;
+ if (verbose) {
+ console.time("building burrows-wheeler transform");
+ }
+ this._substr += end_marker;
+ b = ({_str: "", _size: 0, _head: 0, _suffixarray: [ ]});
+ str$0 = this._substr;
+ _str$0 = b._str = str$0;
+ b._size = _str$0.length;
+ _suffixarray$0 = b._suffixarray = SAIS$make$S(str$0);
+ b._head = (_suffixarray$0.indexOf(0) | 0);
+ s = BurrowsWheelerTransform$get$LBurrowsWheelerTransform$(b);
+ this._ssize = s.length;
+ this._head = b._head;
+ b._str = "";
+ b._size = 0;
+ b._head = 0;
+ b._suffixarray.length = 0;
+ this._substr = "";
+ if (verbose) {
+ console.timeEnd("building burrows-wheeler transform");
+ }
+ if (verbose) {
+ console.time("building wavelet matrix");
+ }
+ this$0 = this._sv;
+ this$0._bitsize = (Math.ceil(Math.log(maxChar) / 0.6931471805599453) | 0);
+ if (verbose) {
+ console.log(" maxCharCode: ", maxChar);
+ console.log(" bitSize: ", this._sv.bitsize$());
+ }
+ this._sv.build$S(s);
+ if (verbose) {
+ console.timeEnd("building wavelet matrix");
+ }
+ if (verbose) {
+ console.time("caching rank less than");
+ }
+ for (c = 0; c < maxChar; c++) {
+ this._rlt[c] = this._sv.rank_less_than$II(this._sv.size$(), c);
+ }
+ if (verbose) {
+ console.timeEnd("caching rank less than");
+ }
+ this._ddic = ddic;
+ if (verbose) {
+ console.time("building dictionaries");
+ }
+ this._buildDictionaries$();
+ if (verbose) {
+ console.timeEnd("building dictionaries");
+ console.log('');
+ }
+};
+
+/**
+ */
+FMIndex.prototype._buildDictionaries$ = function () {
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var pos;
+ /** @type {!number} */
+ var c;
+ for (i = 0; i < this._ssize / this._ddic + 1; i++) {
+ this._posdic.push(0);
+ this._idic.push(0);
+ }
+ i = this._head;
+ pos = this.size$() - 1;
+ do {
+ if (i % this._ddic === 0) {
+ this._posdic[Math.floor(i / this._ddic)] = (pos | 0);
+ }
+ if (pos % this._ddic === 0) {
+ this._idic[Math.floor(pos / this._ddic)] = (i | 0);
+ }
+ c = this._sv.get$I(i);
+ i = this._rlt[c] + this._sv.rank$II(i, c);
+ pos--;
+ } while (i !== this._head);
+};
+
+/**
+ * @param {!string} doc
+ */
+FMIndex.prototype.push$S = function (doc) {
+ if (doc.length <= 0) {
+ throw new Error("FMIndex::push(): empty string");
+ }
+ this._substr += doc;
+};
+
+/**
+ * @param {!string} keyword
+ * @return {Array.<undefined|!number>}
+ */
+FMIndex.prototype.search$S = function (keyword) {
+ /** @type {Array.<undefined|!number>} */
+ var result;
+ /** @type {Array.<undefined|!number>} */
+ var position;
+ /** @type {!number} */
+ var rows;
+ /** @type {undefined|!number} */
+ var first;
+ /** @type {undefined|!number} */
+ var last;
+ /** @type {undefined|!number} */
+ var i;
+ result = [ ];
+ position = [ ];
+ rows = this.getRows$SAI(keyword, position);
+ if (rows > 0) {
+ first = position[0];
+ last = position[1];
+ for (i = first; i <= last; i++) {
+ result.push(this.getPosition$I(i));
+ }
+ }
+ return result;
+};
+
+/**
+ * @return {!string}
+ */
+FMIndex.prototype.dump$ = function () {
+ return this.dump$B(false);
+};
+
+/**
+ * @param {!boolean} verbose
+ * @return {!string}
+ */
+FMIndex.prototype.dump$B = function (verbose) {
+ /** @type {Array.<undefined|!string>} */
+ var contents;
+ /** @type {CompressionReport} */
+ var report;
+ /** @type {!number} */
+ var i;
+ contents = [ ];
+ report = ({source: 0, result: 0});
+ contents.push(Binary$dump32bitNumber$N(this._ddic));
+ contents.push(Binary$dump32bitNumber$N(this._ssize));
+ contents.push(Binary$dump32bitNumber$N(this._head));
+ CompressionReport$add$LCompressionReport$II(report, 6, 6);
+ contents.push(this._sv.dump$LCompressionReport$(report));
+ if (verbose) {
+ console.log("Serializing FM-index");
+ console.log(' Wavelet Matrix: ' + (contents[3].length * 2 + "") + ' bytes (' + (Math.round(report.result * 100.0 / report.source) + "") + '%)');
+ }
+ contents.push(Binary$dump32bitNumber$N(this._posdic.length));
+ for (i in this._posdic) {
+ contents.push(Binary$dump32bitNumber$N(this._posdic[i]));
+ }
+ for (i in this._idic) {
+ contents.push(Binary$dump32bitNumber$N(this._idic[i]));
+ }
+ if (verbose) {
+ console.log(' Dictionary Cache: ' + (this._idic.length * 16 + "") + ' bytes');
+ }
+ return contents.join("");
+};
+
+/**
+ * @param {!string} data
+ * @return {!number}
+ */
+FMIndex.prototype.load$S = function (data) {
+ return this.load$SI(data, 0);
+};
+
+/**
+ * @param {!string} data
+ * @param {!number} offset
+ * @return {!number}
+ */
+FMIndex.prototype.load$SI = function (data, offset) {
+ /** @type {!number} */
+ var maxChar;
+ /** @type {!number} */
+ var c;
+ /** @type {!number} */
+ var size;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var result$0;
+ /** @type {!number} */
+ var result$1;
+ result$0 = data.charCodeAt(offset) * 65536 + data.charCodeAt(offset + 1);
+ this._ddic = (result$0 | 0);
+ this._ssize = (Binary$load32bitNumber$SI(data, offset + 2) | 0);
+ this._head = (Binary$load32bitNumber$SI(data, offset + 4) | 0);
+ offset = this._sv.load$SI(data, offset + 6);
+ maxChar = Math.pow(2, this._sv.bitsize$());
+ for (c = 0; c < maxChar; c++) {
+ this._rlt[c] = this._sv.rank_less_than$II(this._sv.size$(), c);
+ }
+ result$1 = data.charCodeAt(offset) * 65536 + data.charCodeAt(offset + 1);
+ size = result$1;
+ offset += 2;
+ for (i = 0; i < size; (i++, offset += 2)) {
+ this._posdic.push(Binary$load32bitNumber$SI(data, offset));
+ }
+ for (i = 0; i < size; (i++, offset += 2)) {
+ this._idic.push(Binary$load32bitNumber$SI(data, offset));
+ }
+ return offset;
+};
+
+/**
+ * class Tag extends Object
+ * @constructor
+ */
+function Tag() {
+}
+
+/**
+ * @constructor
+ * @param {!string} name
+ */
+function Tag$S(name) {
+ this.name = name;
+ this.attributes = ({ });
+ this.isSelfClosing = false;
+};
+
+Tag$S.prototype = new Tag;
+
+/**
+ * class _Common extends Object
+ * @constructor
+ */
+function _Common() {
+}
+
+/**
+ * @constructor
+ */
+function _Common$() {
+};
+
+_Common$.prototype = new _Common;
+
+/**
+ * class _State extends Object
+ * @constructor
+ */
+function _State() {
+}
+
+/**
+ * @constructor
+ */
+function _State$() {
+};
+
+_State$.prototype = new _State;
+
+/**
+ * class SAXHandler extends Object
+ * @constructor
+ */
+function SAXHandler() {
+}
+
+/**
+ * @constructor
+ */
+function SAXHandler$() {
+ this.position = 0;
+ this.column = 0;
+ this.line = 0;
+};
+
+SAXHandler$.prototype = new SAXHandler;
+
+/**
+ * @param {Error} error
+ */
+SAXHandler.prototype.onerror$LError$ = function (error) {
+};
+
+/**
+ * @param {!string} text
+ */
+SAXHandler.prototype.ontext$S = function (text) {
+};
+
+/**
+ * @param {!string} doctype
+ */
+SAXHandler.prototype.ondoctype$S = function (doctype) {
+};
+
+/**
+ * @param {!string} name
+ * @param {!string} body
+ */
+SAXHandler.prototype.onprocessinginstruction$SS = function (name, body) {
+};
+
+/**
+ * @param {!string} sgmlDecl
+ */
+SAXHandler.prototype.onsgmldeclaration$S = function (sgmlDecl) {
+};
+
+/**
+ * @param {!string} tagname
+ * @param {Object.<string, undefined|!string>} attributes
+ */
+SAXHandler.prototype.onopentag$SHS = function (tagname, attributes) {
+};
+
+/**
+ * @param {!string} tagname
+ */
+SAXHandler.prototype.onclosetag$S = function (tagname) {
+};
+
+/**
+ * @param {!string} name
+ * @param {!string} value
+ */
+SAXHandler.prototype.onattribute$SS = function (name, value) {
+};
+
+/**
+ * @param {!string} comment
+ */
+SAXHandler.prototype.oncomment$S = function (comment) {
+};
+
+/**
+ */
+SAXHandler.prototype.onopencdata$ = function () {
+};
+
+/**
+ * @param {!string} cdata
+ */
+SAXHandler.prototype.oncdata$S = function (cdata) {
+};
+
+/**
+ */
+SAXHandler.prototype.onclosecdata$ = function () {
+};
+
+/**
+ */
+SAXHandler.prototype.onend$ = function () {
+};
+
+/**
+ */
+SAXHandler.prototype.onready$ = function () {
+};
+
+/**
+ * @param {!string} script
+ */
+SAXHandler.prototype.onscript$S = function (script) {
+};
+
+/**
+ * class _HTMLHandler extends SAXHandler
+ * @constructor
+ */
+function _HTMLHandler() {
+}
+
+_HTMLHandler.prototype = new SAXHandler;
+/**
+ * @constructor
+ * @param {Object.<string, undefined|Array.<undefined|!string>>} styles
+ * @param {!boolean} escape
+ */
+function _HTMLHandler$HASB(styles, escape) {
+ this.position = 0;
+ this.column = 0;
+ this.line = 0;
+ this.text = [ ];
+ this.escape = escape;
+ this.styles = styles;
+};
+
+_HTMLHandler$HASB.prototype = new _HTMLHandler;
+
+/**
+ * @param {!string} str
+ * @return {!string}
+ */
+_HTMLHandler.escapeHTML$S = function (str) {
+ return str.replace(/\n/g, "<br/>").replace(/&/g, "&amp;").replace(/"/g, "&quot;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
+};
+
+var _HTMLHandler$escapeHTML$S = _HTMLHandler.escapeHTML$S;
+
+/**
+ * @param {!string} tagname
+ * @param {Object.<string, undefined|!string>} attributes
+ */
+_HTMLHandler.prototype.onopentag$SHS = function (tagname, attributes) {
+ this.text.push(this.styles[tagname][0]);
+};
+
+/**
+ * @param {!string} tagname
+ */
+_HTMLHandler.prototype.onclosetag$S = function (tagname) {
+ this.text.push(this.styles[tagname][1]);
+};
+
+/**
+ * @param {!string} text
+ */
+_HTMLHandler.prototype.ontext$S = function (text) {
+ if (this.escape) {
+ this.text.push(text.replace(/\n/g, "<br/>").replace(/&/g, "&amp;").replace(/"/g, "&quot;").replace(/</g, "&lt;").replace(/>/g, "&gt;"));
+ } else {
+ this.text.push(text);
+ }
+};
+
+/**
+ * @return {!string}
+ */
+_HTMLHandler.prototype.result$ = function () {
+ return this.text.join('');
+};
+
+/**
+ * class SAXParser extends Object
+ * @constructor
+ */
+function SAXParser() {
+}
+
+/**
+ * @constructor
+ * @param {SAXHandler} handler
+ */
+function SAXParser$LSAXHandler$(handler) {
+ this.q = "";
+ this.c = "";
+ this.bufferCheckPosition = 0;
+ this.looseCase = "";
+ this.tags = [ ];
+ this.closed = false;
+ this.closedRoot = false;
+ this.sawRoot = false;
+ this.tag = null;
+ this.error = null;
+ this.handler = null;
+ this.ENTITIES = null;
+ this.strict = false;
+ this.tagName = "";
+ this.state = 0;
+ this.line = 0;
+ this.column = 0;
+ this.position = 0;
+ this.startTagPosition = 0;
+ this.attribName = "";
+ this.attribValue = "";
+ this.script = "";
+ this.textNode = "";
+ this.attribList = null;
+ this.noscript = false;
+ this.cdata = "";
+ this.procInstBody = "";
+ this.procInstName = "";
+ this.doctype = "";
+ this.entity = "";
+ this.sgmlDecl = "";
+ this.comment = "";
+ this.preTags = 0;
+ this._init$LSAXHandler$B(handler, false);
+};
+
+SAXParser$LSAXHandler$.prototype = new SAXParser;
+
+/**
+ * @constructor
+ * @param {SAXHandler} handler
+ * @param {!boolean} strict
+ */
+function SAXParser$LSAXHandler$B(handler, strict) {
+ this.q = "";
+ this.c = "";
+ this.bufferCheckPosition = 0;
+ this.looseCase = "";
+ this.tags = [ ];
+ this.closed = false;
+ this.closedRoot = false;
+ this.sawRoot = false;
+ this.tag = null;
+ this.error = null;
+ this.handler = null;
+ this.ENTITIES = null;
+ this.strict = false;
+ this.tagName = "";
+ this.state = 0;
+ this.line = 0;
+ this.column = 0;
+ this.position = 0;
+ this.startTagPosition = 0;
+ this.attribName = "";
+ this.attribValue = "";
+ this.script = "";
+ this.textNode = "";
+ this.attribList = null;
+ this.noscript = false;
+ this.cdata = "";
+ this.procInstBody = "";
+ this.procInstName = "";
+ this.doctype = "";
+ this.entity = "";
+ this.sgmlDecl = "";
+ this.comment = "";
+ this.preTags = 0;
+ this._init$LSAXHandler$B(handler, strict);
+};
+
+SAXParser$LSAXHandler$B.prototype = new SAXParser;
+
+/**
+ * @param {SAXHandler} handler
+ * @param {!boolean} strict
+ */
+SAXParser.prototype._init$LSAXHandler$B = function (handler, strict) {
+ this.handler = handler;
+ this.clearBuffers$();
+ this.q = "";
+ this.bufferCheckPosition = 65536;
+ this.looseCase = 'toLowerCase';
+ this.tags = [ ];
+ this.closed = this.closedRoot = this.sawRoot = false;
+ this.tag = null;
+ this.error = null;
+ this.strict = strict;
+ this.noscript = strict;
+ this.state = 1;
+ this.ENTITIES = _Entities$entity_list$();
+ this.attribList = [ ];
+ this.noscript = false;
+ this.preTags = 0;
+};
+
+/**
+ * @param {!boolean} flag
+ */
+SAXParser.prototype.set_noscript$B = function (flag) {
+ this.noscript = flag;
+};
+
+/**
+ * @return {SAXParser}
+ */
+SAXParser.prototype.resume$ = function () {
+ this.error = null;
+ return this;
+};
+
+/**
+ * @return {SAXParser}
+ */
+SAXParser.prototype.close$ = function () {
+ return this.parse$S('');
+};
+
+/**
+ * @param {!string} chunk
+ * @return {SAXParser}
+ */
+SAXParser.prototype.parse$S = function (chunk) {
+ /** @type {Char} */
+ var _;
+ /** @type {!number} */
+ var i;
+ /** @type {!string} */
+ var c;
+ /** @type {!number} */
+ var starti;
+ /** @type {!number} */
+ var pad;
+ /** @type {!number} */
+ var returnState;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$0;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$1;
+ /** @type {RegExp} */
+ var charclass$2;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$3;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$4;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$5;
+ /** @type {!string} */
+ var text$0;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$6;
+ /** @type {RegExp} */
+ var charclass$7;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$8;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$9;
+ /** @type {RegExp} */
+ var charclass$10;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$11;
+ /** @type {RegExp} */
+ var charclass$12;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$13;
+ /** @type {RegExp} */
+ var charclass$14;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$15;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$16;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$17;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$18;
+ /** @type {RegExp} */
+ var charclass$19;
+ /** @type {RegExp} */
+ var charclass$20;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$21;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$22;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$23;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$24;
+ /** @type {!string} */
+ var comment$0;
+ _ = new Char$();
+ if (this.error) {
+ throw this.error;
+ }
+ if (this.closed) {
+ return this.emiterror$S("Cannot write after close. Assign an onready handler.");
+ }
+ (i = 0, c = "");
+ while (this.c = c = chunk.charAt(i++)) {
+ this.position++;
+ if (c === "\n") {
+ this.handler.line++;
+ this.handler.column = 0;
+ } else {
+ this.handler.column++;
+ }
+ switch (this.state) {
+ case 1:
+ if (c === "<") {
+ this.state = 4;
+ this.startTagPosition = this.position;
+ } else {
+ charclass$0 = _.whitespace;
+ if (! $__jsx_ObjectHasOwnProperty.call(charclass$0, c)) {
+ this.strictFail$S("Non-whitespace before first tag.");
+ this.textNode = c;
+ this.state = 2;
+ }
+ }
+ continue;
+ case 2:
+ if (this.sawRoot && ! this.closedRoot) {
+ starti = i - 1;
+ while (c && c !== "<" && c !== "&") {
+ c = chunk.charAt(i++);
+ if (c) {
+ this.position++;
+ if (c === "\n") {
+ this.handler.line++;
+ this.handler.column = 0;
+ } else {
+ this.handler.column++;
+ }
+ }
+ }
+ this.textNode += chunk.substring(starti, i - 1);
+ }
+ if (c === "<") {
+ this.state = 4;
+ this.startTagPosition = this.position;
+ } else {
+ if (_.not$HBS(_.whitespace, c) && (! this.sawRoot || this.closedRoot)) {
+ this.strictFail$S("Text data outside of root node.");
+ }
+ if (c === "&") {
+ this.state = 3;
+ } else {
+ this.textNode += c;
+ }
+ }
+ continue;
+ case 33:
+ if (c === "<") {
+ this.state = 34;
+ } else {
+ this.script += c;
+ }
+ continue;
+ case 34:
+ if (c === "/") {
+ this.state = 31;
+ } else {
+ this.script += "<" + c;
+ this.state = 33;
+ }
+ continue;
+ case 4:
+ if (c === "!") {
+ this.state = 5;
+ this.sgmlDecl = "";
+ } else {
+ charclass$1 = _.whitespace;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$1, c)) {
+ } else {
+ charclass$2 = _.nameStart;
+ if (charclass$2.test(c)) {
+ this.state = 21;
+ this.tagName = c;
+ } else {
+ if (c === "/") {
+ this.state = 31;
+ this.tagName = "";
+ } else {
+ if (c === "?") {
+ this.state = 18;
+ this.procInstName = this.procInstBody = "";
+ } else {
+ this.strictFail$S("Unencoded <");
+ if (this.startTagPosition + 1 < this.position) {
+ pad = this.position - this.startTagPosition;
+ for (i = 0; i < pad; i++) {
+ c = " " + c;
+ }
+ }
+ this.textNode += "<" + c;
+ this.state = 2;
+ }
+ }
+ }
+ }
+ }
+ continue;
+ case 5:
+ if ((this.sgmlDecl + c).toUpperCase() === _.CDATA) {
+ this.closetext_if_exist$();
+ this.state = 15;
+ this.sgmlDecl = "";
+ this.cdata = "";
+ } else {
+ if (this.sgmlDecl + c === "--") {
+ this.state = 12;
+ this.comment = "";
+ this.sgmlDecl = "";
+ } else {
+ if ((this.sgmlDecl + c).toUpperCase() === _.DOCTYPE) {
+ this.state = 7;
+ if (this.doctype || this.sawRoot) {
+ this.strictFail$S("Inappropriately located doctype declaration");
+ }
+ this.doctype = "";
+ this.sgmlDecl = "";
+ } else {
+ if (c === ">") {
+ this.closetext_if_exist$();
+ this.sgmlDecl = "";
+ this.state = 2;
+ } else {
+ charclass$3 = _.quote;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$3, c)) {
+ this.state = 6;
+ this.sgmlDecl += c;
+ } else {
+ this.sgmlDecl += c;
+ }
+ }
+ }
+ }
+ }
+ continue;
+ case 6:
+ if (c === this.q) {
+ this.state = 5;
+ this.q = "";
+ }
+ this.sgmlDecl += c;
+ continue;
+ case 7:
+ if (c === ">") {
+ this.state = 2;
+ this.closetext_if_exist$();
+ this.doctype.trim();
+ } else {
+ this.doctype += c;
+ if (c === "[") {
+ this.state = 9;
+ } else {
+ charclass$4 = _.quote;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$4, c)) {
+ this.state = 8;
+ this.q = c;
+ }
+ }
+ }
+ continue;
+ case 8:
+ this.doctype += c;
+ if (c === this.q) {
+ this.q = "";
+ this.state = 7;
+ }
+ continue;
+ case 9:
+ this.doctype += c;
+ if (c === "]") {
+ this.state = 7;
+ } else {
+ charclass$5 = _.quote;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$5, c)) {
+ this.state = 10;
+ this.q = c;
+ }
+ }
+ continue;
+ case 10:
+ this.doctype += c;
+ if (c === this.q) {
+ this.state = 9;
+ this.q = "";
+ }
+ continue;
+ case 12:
+ if (c === "-") {
+ this.state = 13;
+ } else {
+ this.comment += c;
+ }
+ continue;
+ case 13:
+ if (c === "-") {
+ this.state = 14;
+ text$0 = this.comment;
+ text$0 = text$0.replace(/[\n\t]/g, ' ');
+ text$0 = text$0.replace(/\s\s+/g, " ");
+ comment$0 = this.comment = text$0;
+ if (comment$0) {
+ this.closetext_if_exist$();
+ this.comment.trim();
+ }
+ this.comment = "";
+ } else {
+ this.comment += "-" + c;
+ this.state = 12;
+ }
+ continue;
+ case 14:
+ if (c !== ">") {
+ this.strictFail$S("Malformed comment");
+ this.comment += "--" + c;
+ this.state = 12;
+ } else {
+ this.state = 2;
+ }
+ continue;
+ case 15:
+ if (c === "]") {
+ this.state = 16;
+ } else {
+ this.cdata += c;
+ }
+ continue;
+ case 16:
+ if (c === "]") {
+ this.state = 17;
+ } else {
+ this.cdata += "]" + c;
+ this.state = 15;
+ }
+ continue;
+ case 17:
+ if (c === ">") {
+ if (this.cdata) {
+ this.closetext_if_exist$();
+ }
+ this.cdata = "";
+ this.state = 2;
+ } else {
+ if (c === "]") {
+ this.cdata += "]";
+ } else {
+ this.cdata += "]]" + c;
+ this.state = 15;
+ }
+ }
+ continue;
+ case 18:
+ if (c === "?") {
+ this.state = 20;
+ } else {
+ charclass$6 = _.whitespace;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$6, c)) {
+ this.state = 19;
+ } else {
+ this.procInstName += c;
+ }
+ }
+ continue;
+ case 19:
+ if (! this.procInstBody && _.is$HBS(_.whitespace, c)) {
+ continue;
+ } else {
+ if (c === "?") {
+ this.state = 20;
+ } else {
+ this.procInstBody += c;
+ }
+ }
+ continue;
+ case 20:
+ if (c === ">") {
+ this.closetext_if_exist$();
+ this.procInstName = this.procInstBody = "";
+ this.state = 2;
+ } else {
+ this.procInstBody += "?" + c;
+ this.state = 19;
+ }
+ continue;
+ case 21:
+ charclass$7 = _.nameBody;
+ if (charclass$7.test(c)) {
+ this.tagName += c;
+ } else {
+ this.newTag$();
+ if (c === ">") {
+ this.openTag$B(false);
+ } else {
+ if (c === "/") {
+ this.state = 22;
+ } else {
+ charclass$8 = _.whitespace;
+ if (! $__jsx_ObjectHasOwnProperty.call(charclass$8, c)) {
+ this.strictFail$S("Invalid character in tag name");
+ }
+ this.state = 23;
+ }
+ }
+ }
+ continue;
+ case 22:
+ if (c === ">") {
+ this.openTag$B(true);
+ this.closeTag$();
+ } else {
+ this.strictFail$S("Forward-slash in opening tag not followed by >");
+ this.state = 23;
+ }
+ continue;
+ case 23:
+ charclass$9 = _.whitespace;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$9, c)) {
+ continue;
+ } else {
+ if (c === ">") {
+ this.openTag$B(false);
+ } else {
+ if (c === "/") {
+ this.state = 22;
+ } else {
+ charclass$10 = _.nameStart;
+ if (charclass$10.test(c)) {
+ this.attribName = c;
+ this.attribValue = "";
+ this.state = 24;
+ } else {
+ this.strictFail$S("Invalid attribute name");
+ }
+ }
+ }
+ }
+ continue;
+ case 24:
+ if (c === "=") {
+ this.state = 26;
+ } else {
+ if (c === ">") {
+ this.strictFail$S("Attribute without value");
+ this.attribValue = this.attribName;
+ this.attrib$();
+ this.openTag$B(false);
+ } else {
+ charclass$11 = _.whitespace;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$11, c)) {
+ this.state = 25;
+ } else {
+ charclass$12 = _.nameBody;
+ if (charclass$12.test(c)) {
+ this.attribName += c;
+ } else {
+ this.strictFail$S("Invalid attribute name");
+ }
+ }
+ }
+ }
+ continue;
+ case 25:
+ if (c === "=") {
+ this.state = 26;
+ } else {
+ charclass$13 = _.whitespace;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$13, c)) {
+ continue;
+ } else {
+ this.strictFail$S("Attribute without value");
+ this.tag.attributes[this.attribName] = "";
+ this.attribValue = "";
+ this.closetext_if_exist$();
+ this.attribName = "";
+ if (c === ">") {
+ this.openTag$B(false);
+ } else {
+ charclass$14 = _.nameStart;
+ if (charclass$14.test(c)) {
+ this.attribName = c;
+ this.state = 24;
+ } else {
+ this.strictFail$S("Invalid attribute name");
+ this.state = 23;
+ }
+ }
+ }
+ }
+ continue;
+ case 26:
+ charclass$15 = _.whitespace;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$15, c)) {
+ continue;
+ } else {
+ charclass$16 = _.quote;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$16, c)) {
+ this.q = c;
+ this.state = 27;
+ } else {
+ this.strictFail$S("Unquoted attribute value");
+ this.state = 28;
+ this.attribValue = c;
+ }
+ }
+ continue;
+ case 27:
+ if (c !== this.q) {
+ if (c === "&") {
+ this.state = 29;
+ } else {
+ this.attribValue += c;
+ }
+ continue;
+ }
+ this.attrib$();
+ this.q = "";
+ this.state = 23;
+ continue;
+ case 28:
+ charclass$17 = _.attribEnd;
+ if (! $__jsx_ObjectHasOwnProperty.call(charclass$17, c)) {
+ if (c === "&") {
+ this.state = 30;
+ } else {
+ this.attribValue += c;
+ }
+ continue;
+ }
+ this.attrib$();
+ if (c === ">") {
+ this.openTag$B(false);
+ } else {
+ this.state = 23;
+ }
+ continue;
+ case 31:
+ if (! this.tagName) {
+ charclass$18 = _.whitespace;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$18, c)) {
+ continue;
+ } else {
+ charclass$19 = _.nameStart;
+ if (! charclass$19.test(c)) {
+ if (this.script) {
+ this.script += "</" + c;
+ this.state = 33;
+ } else {
+ this.strictFail$S("Invalid tagname in closing tag.");
+ }
+ } else {
+ this.tagName = c;
+ }
+ }
+ } else {
+ if (c === ">") {
+ this.closeTag$();
+ } else {
+ charclass$20 = _.nameBody;
+ if (charclass$20.test(c)) {
+ this.tagName += c;
+ } else {
+ if (this.script) {
+ this.script += "</" + this.tagName;
+ this.tagName = "";
+ this.state = 33;
+ } else {
+ charclass$21 = _.whitespace;
+ if (! $__jsx_ObjectHasOwnProperty.call(charclass$21, c)) {
+ this.strictFail$S("Invalid tagname in closing tag");
+ }
+ this.state = 32;
+ }
+ }
+ }
+ }
+ continue;
+ case 32:
+ charclass$22 = _.whitespace;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$22, c)) {
+ continue;
+ }
+ if (c === ">") {
+ this.closeTag$();
+ } else {
+ this.strictFail$S("Invalid characters in closing tag");
+ }
+ continue;
+ case 3:
+ if (c === ";") {
+ this.textNode += this.parseEntity$();
+ this.entity = "";
+ this.state = 2;
+ } else {
+ charclass$23 = _.entity;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$23, c)) {
+ this.entity += c;
+ } else {
+ this.strictFail$S("Invalid character entity");
+ this.textNode += "&" + this.entity + c;
+ this.entity = "";
+ this.state = 2;
+ }
+ }
+ continue;
+ case 29:
+ case 30:
+ if (this.state === 29) {
+ returnState = 27;
+ } else {
+ returnState = 28;
+ }
+ if (c === ";") {
+ this.attribValue += this.parseEntity$();
+ this.entity = "";
+ this.state = (returnState | 0);
+ } else {
+ charclass$24 = _.entity;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$24, c)) {
+ this.entity += c;
+ } else {
+ this.strictFail$S("Invalid character entity");
+ this.attribValue += "&" + this.entity + c;
+ this.entity = "";
+ this.state = (returnState | 0);
+ }
+ }
+ continue;
+ default:
+ throw new Error("Unknown state: " + (this.state + ""));
+ }
+ }
+ this.end$();
+ return this;
+};
+
+/**
+ */
+SAXParser.prototype.clearBuffers$ = function () {
+ this.comment = '';
+ this.sgmlDecl = '';
+ this.textNode = '';
+ this.tagName = '';
+ this.doctype = '';
+ this.procInstName = '';
+ this.procInstBody = '';
+ this.entity = '';
+ this.attribName = '';
+ this.attribValue = '';
+ this.cdata = '';
+ this.script = '';
+};
+
+/**
+ */
+SAXParser.prototype.closetext_if_exist$ = function () {
+ if (this.textNode !== '') {
+ this.closetext$();
+ }
+};
+
+/**
+ */
+SAXParser.prototype.closetext$ = function () {
+ /** @type {!string} */
+ var text;
+ /** @type {!string} */
+ var text$0;
+ if (this.preTags === 0) {
+ text$0 = this.textNode;
+ text$0 = text$0.replace(/[\n\t]/g, ' ');
+ text$0 = text$0.replace(/\s\s+/g, " ");
+ text = text$0;
+ if (text$0) {
+ this.handler.ontext$S(text);
+ }
+ } else {
+ if (this.textNode) {
+ this.handler.ontext$S(this.textNode);
+ }
+ }
+ this.textNode = "";
+};
+
+/**
+ * @param {!string} text
+ * @return {!string}
+ */
+SAXParser.prototype.textopts$S = function (text) {
+ text = text.replace(/[\n\t]/g, ' ');
+ text = text.replace(/\s\s+/g, " ");
+ return text;
+};
+
+/**
+ * @param {!string} er
+ * @return {SAXParser}
+ */
+SAXParser.prototype.emiterror$S = function (er) {
+ /** @type {Error} */
+ var error;
+ this.closetext$();
+ er += "\nLine: " + (this.line + "") + "\nColumn: " + (this.column + "") + "\nChar: " + this.c;
+ error = new Error(er);
+ this.error = error;
+ return this;
+};
+
+/**
+ */
+SAXParser.prototype.end$ = function () {
+ if (! this.closedRoot) {
+ this.strictFail$S("Unclosed root tag");
+ }
+ if (this.state !== 2) {
+ this.emiterror$S("Unexpected end");
+ }
+ this.closetext$();
+ this.c = "";
+ this.closed = true;
+};
+
+/**
+ * @param {!string} message
+ */
+SAXParser.prototype.strictFail$S = function (message) {
+ if (this.strict) {
+ this.emiterror$S(message);
+ }
+};
+
+/**
+ */
+SAXParser.prototype.newTag$ = function () {
+ if (! this.strict) {
+ this.tagName = this.tagName.toLowerCase();
+ }
+ this.tag = ({name: this.tagName, attributes: ({ }), isSelfClosing: false});
+ this.attribList.length = 0;
+};
+
+/**
+ */
+SAXParser.prototype.attrib$ = function () {
+ if (! this.strict) {
+ this.attribName = this.attribName.toLowerCase();
+ }
+ if ($__jsx_ObjectHasOwnProperty.call(this.tag.attributes, this.attribName)) {
+ this.attribName = this.attribValue = "";
+ return;
+ }
+ this.tag.attributes[this.attribName] = this.attribValue;
+ this.closetext_if_exist$();
+ this.attribName = this.attribValue = "";
+};
+
+/**
+ */
+SAXParser.prototype.openTag$ = function () {
+ this.openTag$B(false);
+};
+
+/**
+ * @param {!boolean} selfClosing
+ */
+SAXParser.prototype.openTag$B = function (selfClosing) {
+ /** @type {Tag} */
+ var tag$0;
+ /** @type {Tag} */
+ var tag$1;
+ (tag$0 = this.tag).isSelfClosing = selfClosing;
+ this.sawRoot = true;
+ this.tags.push(tag$0);
+ this.closetext_if_exist$();
+ this.handler.onopentag$SHS((tag$1 = this.tag).name, tag$1.attributes);
+ if (this.tag.name === 'pre') {
+ this.preTags++;
+ }
+ if (! selfClosing) {
+ if (! this.noscript && this.tagName.toLowerCase() === "script") {
+ this.state = 33;
+ } else {
+ this.state = 2;
+ }
+ this.tag = null;
+ this.tagName = "";
+ }
+ this.attribName = this.attribValue = "";
+ this.attribList.length = 0;
+};
+
+/**
+ */
+SAXParser.prototype.closeTag$ = function () {
+ /** @type {!number} */
+ var t;
+ /** @type {!string} */
+ var tagName;
+ /** @type {!string} */
+ var closeTo;
+ /** @type {Tag} */
+ var close;
+ /** @type {!number} */
+ var s;
+ /** @type {Tag} */
+ var tag$0;
+ if (! this.tagName) {
+ this.strictFail$S("Weird empty close tag.");
+ this.textNode += "</>";
+ this.state = 2;
+ return;
+ }
+ if (this.script) {
+ if (this.tagName !== "script") {
+ this.script += "</" + this.tagName + ">";
+ this.tagName = "";
+ this.state = 33;
+ return;
+ }
+ this.closetext_if_exist$();
+ this.script = "";
+ }
+ t = this.tags.length;
+ tagName = this.tagName;
+ if (! this.strict) {
+ tagName = tagName.toLowerCase();
+ }
+ closeTo = tagName;
+ while (t--) {
+ close = this.tags[t];
+ if (close.name !== closeTo) {
+ this.strictFail$S("Unexpected close tag");
+ } else {
+ break;
+ }
+ }
+ if (t < 0) {
+ this.strictFail$S("Unmatched closing tag: " + this.tagName);
+ this.textNode += "</" + this.tagName + ">";
+ this.state = 2;
+ return;
+ }
+ this.tagName = tagName;
+ s = this.tags.length;
+ while (s-- > t) {
+ tag$0 = this.tag = this.tags.pop();
+ this.tagName = tag$0.name;
+ this.closetext_if_exist$();
+ this.handler.onclosetag$S(this.tagName);
+ if (this.tagName === 'pre') {
+ this.preTags--;
+ }
+ }
+ if (t === 0) {
+ this.closedRoot = true;
+ }
+ this.tagName = this.attribValue = this.attribName = "";
+ this.attribList.length = 0;
+ this.state = 2;
+};
+
+/**
+ * @return {!string}
+ */
+SAXParser.prototype.parseEntity$ = function () {
+ /** @type {!string} */
+ var entity;
+ /** @type {!string} */
+ var entityLC;
+ /** @type {!number} */
+ var num;
+ /** @type {!string} */
+ var numStr;
+ entity = this.entity;
+ entityLC = entity.toLowerCase();
+ num = 0;
+ numStr = "";
+ if (this.ENTITIES[entity]) {
+ return this.ENTITIES[entity];
+ }
+ if (this.ENTITIES[entityLC]) {
+ return this.ENTITIES[entityLC];
+ }
+ entity = entityLC;
+ if (entityLC.charAt(0) === "#") {
+ if (entity.charAt(1) === "x") {
+ entity = entity.slice(2);
+ num = $__jsx_parseInt(entity, 16);
+ numStr = num.toString(16);
+ } else {
+ entity = entity.slice(1);
+ num = $__jsx_parseInt(entity, 10);
+ numStr = num.toString(10);
+ }
+ }
+ entity = entity.replace(/^0+/, "");
+ if (numStr.toLowerCase() !== entity) {
+ this.strictFail$S("Invalid character entity");
+ return "&" + this.entity + ";";
+ }
+ return String.fromCharCode(num);
+};
+
+/**
+ * class Char extends Object
+ * @constructor
+ */
+function Char() {
+}
+
+/**
+ * @constructor
+ */
+function Char$() {
+ this.CDATA = "[CDATA[";
+ this.DOCTYPE = "DOCTYPE";
+ this.XML_NAMESPACE = "http://www.w3.org/XML/1998/namespace";
+ this.whitespace = this._charClass$S("\r\n\t ");
+ this.number = this._charClass$S("0124356789");
+ this.letter = this._charClass$S("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ");
+ this.quote = this._charClass$S("'\"");
+ this.entity = this._charClass$S("0124356789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ#");
+ this.attribEnd = this._charClass$S("\r\n\t >");
+ this.nameStart = /[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/;
+ this.nameBody = /[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040\.\d-]/;
+};
+
+Char$.prototype = new Char;
+
+/**
+ * @param {!string} str
+ * @return {Object.<string, undefined|!boolean>}
+ */
+Char.prototype._charClass$S = function (str) {
+ /** @type {Object.<string, undefined|!boolean>} */
+ var result;
+ /** @type {!number} */
+ var i;
+ result = ({ });
+ for (i = 0; i < str.length; i++) {
+ result[str.slice(i, i + 1)] = true;
+ }
+ return result;
+};
+
+/**
+ * @param {RegExp} charclass
+ * @param {!string} c
+ * @return {!boolean}
+ */
+Char.prototype.is$LRegExp$S = function (charclass, c) {
+ return charclass.test(c);
+};
+
+/**
+ * @param {Object.<string, undefined|!boolean>} charclass
+ * @param {!string} c
+ * @return {!boolean}
+ */
+Char.prototype.is$HBS = function (charclass, c) {
+ return $__jsx_ObjectHasOwnProperty.call(charclass, c);
+};
+
+/**
+ * @param {RegExp} charclass
+ * @param {!string} c
+ * @return {!boolean}
+ */
+Char.prototype.not$LRegExp$S = function (charclass, c) {
+ return ! charclass.test(c);
+};
+
+/**
+ * @param {Object.<string, undefined|!boolean>} charclass
+ * @param {!string} c
+ * @return {!boolean}
+ */
+Char.prototype.not$HBS = function (charclass, c) {
+ return ! $__jsx_ObjectHasOwnProperty.call(charclass, c);
+};
+
+/**
+ * class _Entities extends Object
+ * @constructor
+ */
+function _Entities() {
+}
+
+/**
+ * @constructor
+ */
+function _Entities$() {
+};
+
+_Entities$.prototype = new _Entities;
+
+/**
+ * @return {Object.<string, undefined|!string>}
+ */
+_Entities.entity_list$ = function () {
+ /** @type {Object.<string, undefined|!string>} */
+ var result;
+ /** @type {!string} */
+ var key;
+ /** @type {*} */
+ var value;
+ result = ({ });
+ for (key in _Entities._entities) {
+ value = _Entities._entities[key];
+ if (typeof value === 'string') {
+ result[key] = value + "";
+ } else {
+ if (typeof value === 'number') {
+ result[key] = String.fromCharCode(value | 0);
+ }
+ }
+ }
+ return result;
+};
+
+var _Entities$entity_list$ = _Entities.entity_list$;
+
+/**
+ * class BitVector extends Object
+ * @constructor
+ */
+function BitVector() {
+}
+
+/**
+ * @constructor
+ */
+function BitVector$() {
+ /** @type {Array.<undefined|!number>} */
+ var _v$0;
+ /** @type {Array.<undefined|!number>} */
+ var _r$0;
+ _r$0 = this._r = [ ];
+ _v$0 = this._v = [ ];
+ _v$0.length = 0;
+ _r$0.length = 0;
+ this._size = 0;
+ this._size1 = 0;
+};
+
+BitVector$.prototype = new BitVector;
+
+/**
+ */
+BitVector.prototype.build$ = function () {
+ /** @type {!number} */
+ var i;
+ this._size1 = 0;
+ for (i = 0; i < this._v.length; i++) {
+ if (i % 8 === 0) {
+ this._r.push(true ? this._size1 : this._size - this._size1);
+ }
+ this._size1 += this._rank32$IIB(this._v[i], 32, true);
+ }
+};
+
+/**
+ */
+BitVector.prototype.clear$ = function () {
+ this._v.length = 0;
+ this._r.length = 0;
+ this._size = 0;
+ this._size1 = 0;
+};
+
+/**
+ * @return {!number}
+ */
+BitVector.prototype.size$ = function () {
+ return this._size;
+};
+
+/**
+ * @param {!boolean} b
+ * @return {!number}
+ */
+BitVector.prototype.size$B = function (b) {
+ return (b ? this._size1 : this._size - this._size1);
+};
+
+/**
+ * @param {!number} value
+ */
+BitVector.prototype.set$I = function (value) {
+ this.set$IB(value, true);
+};
+
+/**
+ * @param {!number} value
+ * @param {!boolean} flag
+ */
+BitVector.prototype.set$IB = function (value, flag) {
+ /** @type {!number} */
+ var q;
+ /** @type {!number} */
+ var r;
+ /** @type {!number} */
+ var m;
+ if (value >= this._size) {
+ this._size = (value + 1 | 0);
+ }
+ q = (value / 32 | 0);
+ r = (value % 32 | 0);
+ while (q >= this._v.length) {
+ this._v.push(0);
+ }
+ m = 0x1 << r;
+ if (flag) {
+ this._v[q] |= m;
+ } else {
+ this._v[q] &= ~ m;
+ }
+};
+
+/**
+ * @param {!number} value
+ * @return {!boolean}
+ */
+BitVector.prototype.get$I = function (value) {
+ /** @type {!number} */
+ var q;
+ /** @type {!number} */
+ var r;
+ /** @type {!number} */
+ var m;
+ if (value >= this._size) {
+ throw new Error("BitVector.get() : range error");
+ }
+ q = (value / 32 | 0);
+ r = (value % 32 | 0);
+ m = 0x1 << r;
+ return !! (this._v[q] & m);
+};
+
+/**
+ * @param {!number} i
+ * @return {!number}
+ */
+BitVector.prototype.rank$I = function (i) {
+ return this.rank$IB(i, true);
+};
+
+/**
+ * @param {!number} i
+ * @param {!boolean} b
+ * @return {!number}
+ */
+BitVector.prototype.rank$IB = function (i, b) {
+ /** @type {!number} */
+ var q_large;
+ /** @type {!number} */
+ var q_small;
+ /** @type {!number} */
+ var r;
+ /** @type {!number} */
+ var rank;
+ /** @type {!number} */
+ var begin;
+ /** @type {!number} */
+ var j;
+ if (i > this._size) {
+ throw new Error("BitVector.rank() : range error");
+ }
+ if (i === 0) {
+ return 0;
+ }
+ i--;
+ q_large = (Math.floor(i / 256) | 0);
+ q_small = (Math.floor(i / 32) | 0);
+ r = (Math.floor(i % 32) | 0);
+ rank = (this._r[q_large] | 0);
+ if (! b) {
+ rank = q_large * 256 - rank;
+ }
+ begin = q_large * 8;
+ for (j = begin; j < q_small; j++) {
+ rank += this._rank32$IIB(this._v[j], 32, b);
+ }
+ rank += this._rank32$IIB(this._v[q_small], r + 1, b);
+ return rank;
+};
+
+/**
+ * @param {!number} i
+ * @return {!number}
+ */
+BitVector.prototype.select$I = function (i) {
+ return this.select$IB(i, true);
+};
+
+/**
+ * @param {!number} i
+ * @param {!boolean} b
+ * @return {!number}
+ */
+BitVector.prototype.select$IB = function (i, b) {
+ /** @type {!number} */
+ var left;
+ /** @type {!number} */
+ var right;
+ /** @type {!number} */
+ var pivot;
+ /** @type {undefined|!number} */
+ var rank;
+ /** @type {!number} */
+ var j;
+ if (i >= (b ? this._size1 : this._size - this._size1)) {
+ throw new Error("BitVector.select() : range error");
+ }
+ left = 0;
+ right = this._r.length;
+ while (left < right) {
+ pivot = Math.floor((left + right) / 2);
+ rank = this._r[pivot];
+ if (! b) {
+ rank = pivot * 256 - rank;
+ }
+ if (i < rank) {
+ right = pivot;
+ } else {
+ left = pivot + 1;
+ }
+ }
+ right--;
+ if (b) {
+ i -= (this._r[right] | 0);
+ } else {
+ i -= (right * 256 - this._r[right] | 0);
+ }
+ j = right * 8;
+ while (1) {
+ rank = this._rank32$IIB(this._v[j], 32, b);
+ if (i < rank) {
+ break;
+ }
+ j++;
+ i -= (rank | 0);
+ }
+ return (j * 32 + this._select32$IIB(this._v[j], i, b) | 0);
+};
+
+/**
+ * @param {!number} x
+ * @param {!number} i
+ * @param {!boolean} b
+ * @return {!number}
+ */
+BitVector.prototype._rank32$IIB = function (x, i, b) {
+ if (! b) {
+ x = ~ x;
+ }
+ x <<= 32 - i;
+ x = ((x & 0xaaaaaaaa) >>> 1) + (x & 0x55555555);
+ x = ((x & 0xcccccccc) >>> 2) + (x & 0x33333333);
+ x = ((x & 0xf0f0f0f0) >>> 4) + (x & 0x0f0f0f0f);
+ x = ((x & 0xff00ff00) >>> 8) + (x & 0x00ff00ff);
+ x = ((x & 0xffff0000) >>> 16) + (x & 0x0000ffff);
+ return x;
+};
+
+/**
+ * @param {!number} x
+ * @param {!number} i
+ * @param {!boolean} b
+ * @return {!number}
+ */
+BitVector.prototype._select32$IIB = function (x, i, b) {
+ /** @type {!number} */
+ var x1;
+ /** @type {!number} */
+ var x2;
+ /** @type {!number} */
+ var x3;
+ /** @type {!number} */
+ var x4;
+ /** @type {!number} */
+ var x5;
+ /** @type {!number} */
+ var pos;
+ /** @type {!number} */
+ var v5;
+ /** @type {!number} */
+ var v4;
+ /** @type {!number} */
+ var v3;
+ /** @type {!number} */
+ var v2;
+ /** @type {!number} */
+ var v1;
+ /** @type {!number} */
+ var v0;
+ if (! b) {
+ x = ~ x;
+ }
+ x1 = ((x & 0xaaaaaaaa) >>> 1) + (x & 0x55555555);
+ x2 = ((x1 & 0xcccccccc) >>> 2) + (x1 & 0x33333333);
+ x3 = ((x2 & 0xf0f0f0f0) >>> 4) + (x2 & 0x0f0f0f0f);
+ x4 = ((x3 & 0xff00ff00) >>> 8) + (x3 & 0x00ff00ff);
+ x5 = ((x4 & 0xffff0000) >>> 16) + (x4 & 0x0000ffff);
+ i++;
+ pos = 0;
+ v5 = x5 & 0xffffffff;
+ if (i > v5) {
+ i -= (v5 | 0);
+ pos += 32;
+ }
+ v4 = x4 >>> pos & 0x0000ffff;
+ if (i > v4) {
+ i -= (v4 | 0);
+ pos += 16;
+ }
+ v3 = x3 >>> pos & 0x000000ff;
+ if (i > v3) {
+ i -= (v3 | 0);
+ pos += 8;
+ }
+ v2 = x2 >>> pos & 0x0000000f;
+ if (i > v2) {
+ i -= (v2 | 0);
+ pos += 4;
+ }
+ v1 = x1 >>> pos & 0x00000003;
+ if (i > v1) {
+ i -= (v1 | 0);
+ pos += 2;
+ }
+ v0 = x >>> pos & 0x00000001;
+ if (i > v0) {
+ i -= (v0 | 0);
+ pos += 1;
+ }
+ return (pos | 0);
+};
+
+/**
+ * @return {!string}
+ */
+BitVector.prototype.dump$ = function () {
+ /** @type {Array.<undefined|!string>} */
+ var contents;
+ contents = [ ];
+ contents.push(Binary$dump32bitNumber$N(this._size));
+ contents.push(Binary$dump32bitNumberList$AN(this._v));
+ return contents.join('');
+};
+
+/**
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+BitVector.prototype.dump$LCompressionReport$ = function (report) {
+ /** @type {Array.<undefined|!string>} */
+ var contents;
+ contents = [ ];
+ contents.push(Binary$dump32bitNumber$N(this._size));
+ CompressionReport$add$LCompressionReport$II(report, 2, 2);
+ contents.push(Binary$dump32bitNumberList$ANLCompressionReport$(this._v, report));
+ return contents.join('');
+};
+
+/**
+ * @param {!string} data
+ * @return {!number}
+ */
+BitVector.prototype.load$S = function (data) {
+ return this.load$SI(data, 0);
+};
+
+/**
+ * @param {!string} data
+ * @param {!number} offset
+ * @return {!number}
+ */
+BitVector.prototype.load$SI = function (data, offset) {
+ /** @type {LoadedNumberListResult} */
+ var result;
+ /** @type {!number} */
+ var result$0;
+ this._v.length = 0;
+ this._r.length = 0;
+ this._size = 0;
+ this._size1 = 0;
+ result$0 = data.charCodeAt(offset) * 65536 + data.charCodeAt(offset + 1);
+ this._size = (result$0 | 0);
+ result = Binary$load32bitNumberList$SI(data, offset + 2);
+ this._v = result.result;
+ this.build$();
+ return result.offset;
+};
+
+/**
+ * class WaveletMatrix extends Object
+ * @constructor
+ */
+function WaveletMatrix() {
+}
+
+/**
+ * @constructor
+ */
+function WaveletMatrix$() {
+ /** @type {Array.<undefined|BitVector>} */
+ var _bv$0;
+ /** @type {Array.<undefined|!number>} */
+ var _seps$0;
+ this._range = ({ });
+ _bv$0 = this._bv = [ ];
+ _seps$0 = this._seps = [ ];
+ this._bitsize = 16;
+ _bv$0.length = 0;
+ _seps$0.length = 0;
+ this._size = 0;
+};
+
+WaveletMatrix$.prototype = new WaveletMatrix;
+
+/**
+ * @return {!number}
+ */
+WaveletMatrix.prototype.bitsize$ = function () {
+ return this._bitsize;
+};
+
+/**
+ * @param {!number} charCode
+ */
+WaveletMatrix.prototype.setMaxCharCode$I = function (charCode) {
+ this._bitsize = (Math.ceil(Math.log(charCode) / 0.6931471805599453) | 0);
+};
+
+/**
+ */
+WaveletMatrix.prototype.clear$ = function () {
+ this._bv.length = 0;
+ this._seps.length = 0;
+ this._size = 0;
+};
+
+/**
+ * @param {!string} v
+ */
+WaveletMatrix.prototype.build$S = function (v) {
+ /** @type {!number} */
+ var size;
+ /** @type {!number} */
+ var bitsize;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var depth;
+ /** @type {Object.<string, undefined|!number>} */
+ var range_tmp;
+ /** @type {!number} */
+ var code;
+ /** @type {!boolean} */
+ var bit;
+ /** @type {!number} */
+ var key;
+ /** @type {Object.<string, undefined|!number>} */
+ var range_rev;
+ /** @type {!string} */
+ var range_key;
+ /** @type {!number} */
+ var value;
+ /** @type {!number} */
+ var pos0;
+ /** @type {undefined|!number} */
+ var pos1;
+ /** @type {!string} */
+ var range_rev_key;
+ /** @type {!number} */
+ var begin;
+ /** @type {undefined|!number} */
+ var end;
+ /** @type {!number} */
+ var num0;
+ /** @type {!number} */
+ var num1;
+ this._bv.length = 0;
+ this._seps.length = 0;
+ this._size = 0;
+ size = v.length;
+ bitsize = this._bitsize;
+ for (i = 0; i < bitsize; i++) {
+ this._bv.push(new BitVector$());
+ this._seps.push(0);
+ }
+ this._size = (size | 0);
+ for (i = 0; i < size; i++) {
+ this._bv[0].set$IB(i, this._uint2bit$II(v.charCodeAt(i), 0));
+ }
+ this._bv[0].build$();
+ this._seps[0] = this._bv[0].size$B(false);
+ this._range["0"] = 0;
+ this._range["1"] = this._seps[0];
+ depth = 1;
+ while (depth < bitsize) {
+ range_tmp = WaveletMatrix$_shallow_copy$HI(this._range);
+ for (i = 0; i < size; i++) {
+ code = v.charCodeAt(i);
+ bit = this._uint2bit$II(code, depth);
+ key = code >>> bitsize - depth;
+ this._bv[depth].set$IB(range_tmp[key + ""], bit);
+ range_tmp[key + ""]++;
+ }
+ this._bv[depth].build$();
+ this._seps[depth] = this._bv[depth].size$B(false);
+ range_rev = ({ });
+ for (range_key in this._range) {
+ value = this._range[range_key];
+ if (value != range_tmp[range_key]) {
+ range_rev[value + ""] = range_key | 0;
+ }
+ }
+ this._range = ({ });
+ pos0 = 0;
+ pos1 = this._seps[depth];
+ for (range_rev_key in range_rev) {
+ begin = range_rev_key | 0;
+ value = range_rev[range_rev_key];
+ end = range_tmp[value + ""];
+ num0 = this._bv[depth].rank$IB(end, false) - this._bv[depth].rank$IB(begin, false);
+ num1 = end - begin - num0;
+ if (num0 > 0) {
+ this._range[(value << 1) + ""] = (pos0 | 0);
+ pos0 += num0;
+ }
+ if (num1 > 0) {
+ this._range[(value << 1) + 1 + ""] = pos1;
+ pos1 += (num1 | 0);
+ }
+ }
+ depth++;
+ }
+};
+
+/**
+ * @return {!number}
+ */
+WaveletMatrix.prototype.size$ = function () {
+ return this._size;
+};
+
+/**
+ * @param {!number} c
+ * @return {!number}
+ */
+WaveletMatrix.prototype.size$I = function (c) {
+ return this.rank$II(this._size, c);
+};
+
+/**
+ * @param {!number} i
+ * @return {!number}
+ */
+WaveletMatrix.prototype.get$I = function (i) {
+ /** @type {!number} */
+ var value;
+ /** @type {!number} */
+ var depth;
+ /** @type {!boolean} */
+ var bit;
+ if (i >= this._size) {
+ throw new Error("WaveletMatrix.get() : range error");
+ }
+ value = 0;
+ depth = 0;
+ while (depth < this._bitsize) {
+ bit = this._bv[depth].get$I(i);
+ i = this._bv[depth].rank$IB(i, bit);
+ value <<= 1;
+ if (bit) {
+ i += this._seps[depth];
+ value += 1;
+ }
+ depth++;
+ }
+ return (value | 0);
+};
+
+/**
+ * @param {!number} i
+ * @param {!number} c
+ * @return {!number}
+ */
+WaveletMatrix.prototype.rank$II = function (i, c) {
+ /** @type {undefined|!number} */
+ var begin;
+ /** @type {!number} */
+ var end;
+ /** @type {!number} */
+ var depth;
+ /** @type {!boolean} */
+ var bit;
+ if (i > this._size) {
+ throw new Error("WaveletMatrix.rank(): range error");
+ }
+ if (i === 0) {
+ return 0;
+ }
+ begin = this._range[c + ""];
+ if (begin == null) {
+ return 0;
+ }
+ end = i;
+ depth = 0;
+ while (depth < this._bitsize) {
+ bit = this._uint2bit$II(c, depth);
+ end = this._bv[depth].rank$IB(end, bit);
+ if (bit) {
+ end += this._seps[depth];
+ }
+ depth++;
+ }
+ return (end - begin | 0);
+};
+
+/**
+ * @param {!number} i
+ * @param {!number} c
+ * @return {!number}
+ */
+WaveletMatrix.prototype.rank_less_than$II = function (i, c) {
+ /** @type {!number} */
+ var begin;
+ /** @type {!number} */
+ var end;
+ /** @type {!number} */
+ var depth;
+ /** @type {!number} */
+ var rlt;
+ /** @type {!number} */
+ var rank0_begin;
+ /** @type {!number} */
+ var rank0_end;
+ /** @type {Array.<undefined|!number>} */
+ var _seps$0;
+ if (i > this._size) {
+ throw new Error("WaveletMatrix.rank_less_than(): range error");
+ }
+ if (i === 0) {
+ return 0;
+ }
+ begin = 0;
+ end = i;
+ depth = 0;
+ rlt = 0;
+ while (depth < this._bitsize) {
+ rank0_begin = this._bv[depth].rank$IB(begin, false);
+ rank0_end = this._bv[depth].rank$IB(end, false);
+ if (this._uint2bit$II(c, depth)) {
+ rlt += rank0_end - rank0_begin;
+ begin += (_seps$0 = this._seps)[depth] - rank0_begin;
+ end += _seps$0[depth] - rank0_end;
+ } else {
+ begin = rank0_begin;
+ end = rank0_end;
+ }
+ depth++;
+ }
+ return (rlt | 0);
+};
+
+/**
+ * @return {!string}
+ */
+WaveletMatrix.prototype.dump$ = function () {
+ /** @type {Array.<undefined|!string>} */
+ var contents;
+ /** @type {!number} */
+ var i;
+ /** @type {Array.<undefined|!string>} */
+ var range_contents;
+ /** @type {!number} */
+ var counter;
+ /** @type {!string} */
+ var key;
+ contents = [ Binary$dump16bitNumber$I(this._bitsize), Binary$dump32bitNumber$N(this._size) ];
+ for (i = 0; i < this._bitsize; i++) {
+ contents.push(this._bv[i].dump$());
+ }
+ for (i = 0; i < this._bitsize; i++) {
+ contents.push(Binary$dump32bitNumber$N(this._seps[i]));
+ }
+ range_contents = [ ];
+ counter = 0;
+ for (key in this._range) {
+ range_contents.push(Binary$dump32bitNumber$N(key | 0));
+ range_contents.push(Binary$dump32bitNumber$N(this._range[key]));
+ counter++;
+ }
+ contents.push(Binary$dump32bitNumber$N(counter));
+ return contents.join('') + range_contents.join('');
+};
+
+/**
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+WaveletMatrix.prototype.dump$LCompressionReport$ = function (report) {
+ /** @type {Array.<undefined|!string>} */
+ var contents;
+ /** @type {!number} */
+ var i;
+ /** @type {Array.<undefined|!string>} */
+ var range_contents;
+ /** @type {!number} */
+ var counter;
+ /** @type {!string} */
+ var key;
+ contents = [ Binary$dump16bitNumber$I(this._bitsize), Binary$dump32bitNumber$N(this._size) ];
+ CompressionReport$add$LCompressionReport$II(report, 3, 3);
+ for (i = 0; i < this._bitsize; i++) {
+ contents.push(this._bv[i].dump$LCompressionReport$(report));
+ }
+ for (i = 0; i < this._bitsize; i++) {
+ contents.push(Binary$dump32bitNumber$N(this._seps[i]));
+ CompressionReport$add$LCompressionReport$II(report, 2, 2);
+ }
+ range_contents = [ ];
+ counter = 0;
+ for (key in this._range) {
+ range_contents.push(Binary$dump32bitNumber$N(key | 0));
+ range_contents.push(Binary$dump32bitNumber$N(this._range[key]));
+ CompressionReport$add$LCompressionReport$II(report, 4, 4);
+ counter++;
+ }
+ CompressionReport$add$LCompressionReport$II(report, 2, 2);
+ contents.push(Binary$dump32bitNumber$N(counter));
+ return contents.join('') + range_contents.join('');
+};
+
+/**
+ * @param {!string} data
+ * @return {!number}
+ */
+WaveletMatrix.prototype.load$S = function (data) {
+ return this.load$SI(data, 0);
+};
+
+/**
+ * @param {!string} data
+ * @param {!number} offset
+ * @return {!number}
+ */
+WaveletMatrix.prototype.load$SI = function (data, offset) {
+ /** @type {!number} */
+ var i;
+ /** @type {BitVector} */
+ var bit_vector;
+ /** @type {!number} */
+ var range_size;
+ /** @type {!number} */
+ var value;
+ /** @type {!number} */
+ var offset$0;
+ /** @type {!number} */
+ var result$0;
+ /** @type {!number} */
+ var result$1;
+ /** @type {!number} */
+ var result$2;
+ this._bv.length = 0;
+ this._seps.length = 0;
+ this._size = 0;
+ offset$0 = offset++;
+ this._bitsize = (data.charCodeAt(offset$0) | 0);
+ result$0 = data.charCodeAt(offset) * 65536 + data.charCodeAt(offset + 1);
+ this._size = (result$0 | 0);
+ offset += 2;
+ for (i = 0; i < this._bitsize; i++) {
+ bit_vector = new BitVector$();
+ offset = bit_vector.load$SI(data, offset);
+ this._bv.push(bit_vector);
+ }
+ for (i = 0; i < this._bitsize; (i++, offset += 2)) {
+ this._seps.push(Binary$load32bitNumber$SI(data, offset));
+ }
+ result$1 = data.charCodeAt(offset) * 65536 + data.charCodeAt(offset + 1);
+ range_size = result$1;
+ offset += 2;
+ for (i = 0; i < range_size; (i++, offset += 4)) {
+ result$2 = data.charCodeAt(offset) * 65536 + data.charCodeAt(offset + 1);
+ value = Binary$load32bitNumber$SI(data, offset + 2);
+ this._range[result$2 + ""] = (value | 0);
+ }
+ return offset;
+};
+
+/**
+ * @param {Object.<string, undefined|!number>} input
+ * @return {Object.<string, undefined|!number>}
+ */
+WaveletMatrix._shallow_copy$HI = function (input) {
+ /** @type {Object.<string, undefined|!number>} */
+ var result;
+ /** @type {!string} */
+ var key;
+ result = ({ });
+ for (key in input) {
+ result[key] = input[key];
+ }
+ return result;
+};
+
+var WaveletMatrix$_shallow_copy$HI = WaveletMatrix._shallow_copy$HI;
+
+/**
+ * @param {!number} c
+ * @param {!number} i
+ * @return {!boolean}
+ */
+WaveletMatrix.prototype._uint2bit$II = function (c, i) {
+ return (c >>> this._bitsize - 1 - i & 0x1) === 0x1;
+};
+
+/**
+ * class BurrowsWheelerTransform extends Object
+ * @constructor
+ */
+function BurrowsWheelerTransform() {
+}
+
+/**
+ * @constructor
+ */
+function BurrowsWheelerTransform$() {
+ this._str = "";
+ this._size = 0;
+ this._head = 0;
+ this._suffixarray = [ ];
+};
+
+BurrowsWheelerTransform$.prototype = new BurrowsWheelerTransform;
+
+/**
+ * @param {BurrowsWheelerTransform} $this
+ * @return {!number}
+ */
+BurrowsWheelerTransform.size$LBurrowsWheelerTransform$ = function ($this) {
+ return $this._size;
+};
+
+var BurrowsWheelerTransform$size$LBurrowsWheelerTransform$ = BurrowsWheelerTransform.size$LBurrowsWheelerTransform$;
+
+/**
+ * @param {BurrowsWheelerTransform} $this
+ * @return {!number}
+ */
+BurrowsWheelerTransform.head$LBurrowsWheelerTransform$ = function ($this) {
+ return $this._head;
+};
+
+var BurrowsWheelerTransform$head$LBurrowsWheelerTransform$ = BurrowsWheelerTransform.head$LBurrowsWheelerTransform$;
+
+/**
+ * @param {BurrowsWheelerTransform} $this
+ */
+BurrowsWheelerTransform.clear$LBurrowsWheelerTransform$ = function ($this) {
+ $this._str = "";
+ $this._size = 0;
+ $this._head = 0;
+ $this._suffixarray.length = 0;
+};
+
+var BurrowsWheelerTransform$clear$LBurrowsWheelerTransform$ = BurrowsWheelerTransform.clear$LBurrowsWheelerTransform$;
+
+/**
+ * @param {BurrowsWheelerTransform} $this
+ * @param {!string} str
+ */
+BurrowsWheelerTransform.build$LBurrowsWheelerTransform$S = function ($this, str) {
+ /** @type {!string} */
+ var _str$0;
+ /** @type {Array.<undefined|!number>} */
+ var _suffixarray$0;
+ _str$0 = $this._str = str;
+ $this._size = _str$0.length;
+ _suffixarray$0 = $this._suffixarray = SAIS$make$S(str);
+ $this._head = (_suffixarray$0.indexOf(0) | 0);
+};
+
+var BurrowsWheelerTransform$build$LBurrowsWheelerTransform$S = BurrowsWheelerTransform.build$LBurrowsWheelerTransform$S;
+
+/**
+ * @param {BurrowsWheelerTransform} $this
+ * @param {!number} i
+ * @return {!string}
+ */
+BurrowsWheelerTransform.get$LBurrowsWheelerTransform$I = function ($this, i) {
+ /** @type {!number} */
+ var size;
+ /** @type {!number} */
+ var index;
+ size = $this._size;
+ if (i >= size) {
+ throw new Error("BurrowsWheelerTransform.get() : range error");
+ }
+ index = ($this._suffixarray[i] + size - 1) % size;
+ return $this._str.charAt(index);
+};
+
+var BurrowsWheelerTransform$get$LBurrowsWheelerTransform$I = BurrowsWheelerTransform.get$LBurrowsWheelerTransform$I;
+
+/**
+ * @param {BurrowsWheelerTransform} $this
+ * @return {!string}
+ */
+BurrowsWheelerTransform.get$LBurrowsWheelerTransform$ = function ($this) {
+ /** @type {Array.<undefined|!string>} */
+ var str;
+ /** @type {!number} */
+ var size;
+ /** @type {!number} */
+ var i;
+ str = [ ];
+ size = $this._size;
+ for (i = 0; i < size; i++) {
+ str.push(BurrowsWheelerTransform$get$LBurrowsWheelerTransform$I($this, i));
+ }
+ return str.join("");
+};
+
+var BurrowsWheelerTransform$get$LBurrowsWheelerTransform$ = BurrowsWheelerTransform.get$LBurrowsWheelerTransform$;
+
+/**
+ * @param {BurrowsWheelerTransform} $this
+ * @param {!string} replace
+ * @return {!string}
+ */
+BurrowsWheelerTransform.get$LBurrowsWheelerTransform$S = function ($this, replace) {
+ /** @type {!string} */
+ var result;
+ result = BurrowsWheelerTransform$get$LBurrowsWheelerTransform$($this);
+ return result.replace(BurrowsWheelerTransform.END_MARKER, replace);
+};
+
+var BurrowsWheelerTransform$get$LBurrowsWheelerTransform$S = BurrowsWheelerTransform.get$LBurrowsWheelerTransform$S;
+
+/**
+ * class OArray extends Object
+ * @constructor
+ */
+function OArray() {
+}
+
+/**
+ * @constructor
+ * @param {Array.<undefined|!number>} array
+ */
+function OArray$AI(array) {
+ this.array = array;
+ this.offset = 0;
+};
+
+OArray$AI.prototype = new OArray;
+
+/**
+ * @constructor
+ * @param {Array.<undefined|!number>} array
+ * @param {!number} offset
+ */
+function OArray$AII(array, offset) {
+ this.array = array;
+ this.offset = offset;
+};
+
+OArray$AII.prototype = new OArray;
+
+/**
+ * @param {OArray} $this
+ * @param {!number} index
+ * @return {!number}
+ */
+OArray.get$LOArray$I = function ($this, index) {
+ return $this.array[index + $this.offset];
+};
+
+var OArray$get$LOArray$I = OArray.get$LOArray$I;
+
+/**
+ * @param {OArray} $this
+ * @param {!number} index
+ * @param {!number} value
+ */
+OArray.set$LOArray$II = function ($this, index, value) {
+ $this.array[index + $this.offset] = value;
+};
+
+var OArray$set$LOArray$II = OArray.set$LOArray$II;
+
+/**
+ * @param {OArray} $this
+ * @param {!number} index
+ * @return {!boolean}
+ */
+OArray.isS$LOArray$I = function ($this, index) {
+ /** @type {Array.<undefined|!number>} */
+ var array$0;
+ /** @type {!number} */
+ var offset$0;
+ return (array$0 = $this.array)[index + (offset$0 = $this.offset)] < array$0[index + offset$0 + 1];
+};
+
+var OArray$isS$LOArray$I = OArray.isS$LOArray$I;
+
+/**
+ * @param {OArray} $this
+ * @param {!number} index1
+ * @param {!number} index2
+ * @return {!boolean}
+ */
+OArray.compare$LOArray$II = function ($this, index1, index2) {
+ /** @type {Array.<undefined|!number>} */
+ var array$0;
+ /** @type {!number} */
+ var offset$0;
+ return (array$0 = $this.array)[index1 + (offset$0 = $this.offset)] == array$0[index2 + offset$0];
+};
+
+var OArray$compare$LOArray$II = OArray.compare$LOArray$II;
+
+/**
+ * class SAIS extends Object
+ * @constructor
+ */
+function SAIS() {
+}
+
+/**
+ * @constructor
+ */
+function SAIS$() {
+};
+
+SAIS$.prototype = new SAIS;
+
+/**
+ * @param {BitVector} t
+ * @param {!number} i
+ * @return {!boolean}
+ */
+SAIS._isLMS$LBitVector$I = function (t, i) {
+ return i > 0 && t.get$I(i) && ! t.get$I(i - 1);
+};
+
+var SAIS$_isLMS$LBitVector$I = SAIS._isLMS$LBitVector$I;
+
+/**
+ * @param {OArray} s
+ * @param {Array.<undefined|!number>} bkt
+ * @param {!number} n
+ * @param {!number} K
+ * @param {!boolean} end
+ */
+SAIS._getBuckets$LOArray$AIIIB = function (s, bkt, n, K, end) {
+ /** @type {!number} */
+ var sum;
+ /** @type {!number} */
+ var i;
+ sum = 0;
+ for (i = 0; i <= K; i++) {
+ bkt[i] = 0;
+ }
+ for (i = 0; i < n; i++) {
+ bkt[OArray$get$LOArray$I(s, i)]++;
+ }
+ for (i = 0; i <= K; i++) {
+ sum += bkt[i];
+ bkt[i] = ((end ? sum : sum - bkt[i]) | 0);
+ }
+};
+
+var SAIS$_getBuckets$LOArray$AIIIB = SAIS._getBuckets$LOArray$AIIIB;
+
+/**
+ * @param {BitVector} t
+ * @param {Array.<undefined|!number>} SA
+ * @param {OArray} s
+ * @param {Array.<undefined|!number>} bkt
+ * @param {!number} n
+ * @param {!number} K
+ * @param {!boolean} end
+ */
+SAIS._induceSAl$LBitVector$AILOArray$AIIIB = function (t, SA, s, bkt, n, K, end) {
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var j;
+ SAIS$_getBuckets$LOArray$AIIIB(s, bkt, n, K, end);
+ for (i = 0; i < n; i++) {
+ j = SA[i] - 1;
+ if (j >= 0 && ! t.get$I(j)) {
+ SA[bkt[OArray$get$LOArray$I(s, j)]++] = (j | 0);
+ }
+ }
+};
+
+var SAIS$_induceSAl$LBitVector$AILOArray$AIIIB = SAIS._induceSAl$LBitVector$AILOArray$AIIIB;
+
+/**
+ * @param {BitVector} t
+ * @param {Array.<undefined|!number>} SA
+ * @param {OArray} s
+ * @param {Array.<undefined|!number>} bkt
+ * @param {!number} n
+ * @param {!number} K
+ * @param {!boolean} end
+ */
+SAIS._induceSAs$LBitVector$AILOArray$AIIIB = function (t, SA, s, bkt, n, K, end) {
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var j;
+ SAIS$_getBuckets$LOArray$AIIIB(s, bkt, n, K, end);
+ for (i = n - 1; i >= 0; i--) {
+ j = SA[i] - 1;
+ if (j >= 0 && t.get$I(j)) {
+ SA[-- bkt[OArray$get$LOArray$I(s, j)]] = (j | 0);
+ }
+ }
+};
+
+var SAIS$_induceSAs$LBitVector$AILOArray$AIIIB = SAIS._induceSAs$LBitVector$AILOArray$AIIIB;
+
+/**
+ * @param {!string} source
+ * @return {Array.<undefined|!number>}
+ */
+SAIS.make$S = function (source) {
+ /** @type {Array.<undefined|!number>} */
+ var charCodes;
+ /** @type {!number} */
+ var maxCode;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var code;
+ /** @type {Array.<undefined|!number>} */
+ var SA;
+ /** @type {OArray} */
+ var s;
+ charCodes = [ ];
+ charCodes.length = source.length;
+ maxCode = 0;
+ for (i = 0; i < source.length; i++) {
+ code = source.charCodeAt(i);
+ charCodes[i] = (code | 0);
+ maxCode = (code > maxCode ? code : maxCode);
+ }
+ SA = [ ];
+ SA.length = source.length;
+ s = ({offset: 0, array: charCodes});
+ SAIS$_make$LOArray$AIII(s, SA, source.length, maxCode);
+ return SA;
+};
+
+var SAIS$make$S = SAIS.make$S;
+
+/**
+ * @param {OArray} s
+ * @param {Array.<undefined|!number>} SA
+ * @param {!number} n
+ * @param {!number} K
+ */
+SAIS._make$LOArray$AIII = function (s, SA, n, K) {
+ /** @type {BitVector} */
+ var t;
+ /** @type {!number} */
+ var i;
+ /** @type {Array.<undefined|!number>} */
+ var bkt;
+ /** @type {!number} */
+ var n1;
+ /** @type {!number} */
+ var name;
+ /** @type {!number} */
+ var prev;
+ /** @type {undefined|!number} */
+ var pos;
+ /** @type {!boolean} */
+ var diff;
+ /** @type {!number} */
+ var d;
+ /** @type {!number} */
+ var j;
+ /** @type {Array.<undefined|!number>} */
+ var SA1;
+ /** @type {OArray} */
+ var s1;
+ /** @type {!number} */
+ var i$0;
+ /** @type {!number} */
+ var index$0;
+ t = new BitVector$();
+ t.set$IB(n - 2, false);
+ t.set$IB(n - 1, true);
+ for (i = n - 3; i >= 0; i--) {
+ t.set$IB(i, OArray$isS$LOArray$I(s, i) || OArray$compare$LOArray$II(s, i, i + 1) && t.get$I(i + 1));
+ }
+ bkt = [ ];
+ bkt.length = K + 1;
+ SAIS$_getBuckets$LOArray$AIIIB(s, bkt, n, K, true);
+ for (i = 0; i < n; i++) {
+ SA[i] = -1;
+ }
+ for (i = 1; i < n; i++) {
+ if (SAIS$_isLMS$LBitVector$I(t, i)) {
+ SA[-- bkt[OArray$get$LOArray$I(s, i)]] = (i | 0);
+ }
+ }
+ SAIS$_induceSAl$LBitVector$AILOArray$AIIIB(t, SA, s, bkt, n, K, false);
+ SAIS$_induceSAs$LBitVector$AILOArray$AIIIB(t, SA, s, bkt, n, K, true);
+ n1 = 0;
+ for (i = 0; i < n; i++) {
+ i$0 = SA[i];
+ if (i$0 > 0 && t.get$I(i$0) && ! t.get$I(i$0 - 1)) {
+ SA[n1++] = SA[i];
+ }
+ }
+ for (i = n1; i < n; i++) {
+ SA[i] = -1;
+ }
+ name = 0;
+ prev = -1;
+ for (i = 0; i < n1; i++) {
+ pos = SA[i];
+ diff = false;
+ for (d = 0; d < n; d++) {
+ if (prev === -1 || ! OArray$compare$LOArray$II(s, pos + d, prev + d) || t.get$I(pos + d) !== t.get$I(prev + d)) {
+ diff = true;
+ break;
+ } else {
+ if (d > 0 && (SAIS$_isLMS$LBitVector$I(t, pos + d) || SAIS$_isLMS$LBitVector$I(t, prev + d))) {
+ break;
+ }
+ }
+ }
+ if (diff) {
+ name++;
+ prev = pos;
+ }
+ pos = ((pos % 2 === 0 ? pos / 2 : (pos - 1) / 2) | 0);
+ SA[n1 + pos] = (name - 1 | 0);
+ }
+ for ((i = n - 1, j = n - 1); i >= n1; i--) {
+ if (SA[i] >= 0) {
+ SA[j--] = SA[i];
+ }
+ }
+ SA1 = SA;
+ s1 = ({offset: n - n1, array: SA});
+ if (name < n1) {
+ SAIS$_make$LOArray$AIII(s1, SA1, n1, name - 1);
+ } else {
+ for (i = 0; i < n1; i++) {
+ SA1[OArray$get$LOArray$I(s1, i)] = (i | 0);
+ }
+ }
+ bkt = [ ];
+ bkt.length = K + 1;
+ SAIS$_getBuckets$LOArray$AIIIB(s, bkt, n, K, true);
+ for ((i = 1, j = 0); i < n; i++) {
+ if (SAIS$_isLMS$LBitVector$I(t, i)) {
+ OArray$set$LOArray$II(s1, j++, i);
+ }
+ }
+ for (i = 0; i < n1; i++) {
+ index$0 = SA1[i];
+ SA1[i] = s1.array[index$0 + s1.offset];
+ }
+ for (i = n1; i < n; i++) {
+ SA[i] = -1;
+ }
+ for (i = n1 - 1; i >= 0; i--) {
+ j = SA[i];
+ SA[i] = -1;
+ SA[-- bkt[OArray$get$LOArray$I(s, j)]] = (j | 0);
+ }
+ SAIS$_induceSAl$LBitVector$AILOArray$AIIIB(t, SA, s, bkt, n, K, false);
+ SAIS$_induceSAs$LBitVector$AILOArray$AIIIB(t, SA, s, bkt, n, K, true);
+};
+
+var SAIS$_make$LOArray$AIII = SAIS._make$LOArray$AIII;
+
+OktaviaSearch._stemmer = null;
+OktaviaSearch._instance = null;
+$__jsx_lazy_init(Oktavia, "eof", function () {
+ return String.fromCharCode(0);
+});
+$__jsx_lazy_init(Oktavia, "eob", function () {
+ return String.fromCharCode(1);
+});
+$__jsx_lazy_init(Oktavia, "unknown", function () {
+ return String.fromCharCode(3);
+});
+Binary._base64EncodeChars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
+$__jsx_lazy_init(Binary, "_base64DecodeChars", function () {
+ return [ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 62, -1, -1, -1, 63, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, -1, -1, -1, -1, -1, -1, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -1, -1, -1, -1, -1, -1, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, -1, -1, -1, -1 ];
+});
+$__jsx_lazy_init(Style, "console", function () {
+ return ({ 'title': [ '\x1B[32m\x1b[4m', '\x1B[39m\x1b[0m' ], 'url': [ '\x1B[34m', '\x1B[39m' ], 'hit': [ '\x1B[4m', '\x1B[0m' ], 'del': [ '\x1B[9m', '\x1B[0m' ], 'summary': [ '\x1B[90m', '\x1B[39m' ] });
+});
+$__jsx_lazy_init(Style, "html", function () {
+ return ({ 'title': [ '<span class="title">', '</span>' ], 'url': [ '<span class="url">', '</span>' ], 'hit': [ '<span class="hit">', '</span>' ], 'del': [ '<del>', '</del>' ], 'summary': [ '<span class="reuslt">', '</span>' ] });
+});
+$__jsx_lazy_init(Style, "ignore", function () {
+ return ({ 'tilte': [ '', '' ], 'url': [ '', '' ], 'hit': [ '', '' ], 'del': [ '', '' ], 'summary': [ '', '' ] });
+});
+RussianStemmer.serialVersionUID = 1;
+$__jsx_lazy_init(RussianStemmer, "methodObject", function () {
+ return new RussianStemmer$();
+});
+$__jsx_lazy_init(RussianStemmer, "a_0", function () {
+ return [ new Among$SII("\u0432", -1, 1), new Among$SII("\u0438\u0432", 0, 2), new Among$SII("\u044B\u0432", 0, 2), new Among$SII("\u0432\u0448\u0438", -1, 1), new Among$SII("\u0438\u0432\u0448\u0438", 3, 2), new Among$SII("\u044B\u0432\u0448\u0438", 3, 2), new Among$SII("\u0432\u0448\u0438\u0441\u044C", -1, 1), new Among$SII("\u0438\u0432\u0448\u0438\u0441\u044C", 6, 2), new Among$SII("\u044B\u0432\u0448\u0438\u0441\u044C", 6, 2) ];
+});
+$__jsx_lazy_init(RussianStemmer, "a_1", function () {
+ return [ new Among$SII("\u0435\u0435", -1, 1), new Among$SII("\u0438\u0435", -1, 1), new Among$SII("\u043E\u0435", -1, 1), new Among$SII("\u044B\u0435", -1, 1), new Among$SII("\u0438\u043C\u0438", -1, 1), new Among$SII("\u044B\u043C\u0438", -1, 1), new Among$SII("\u0435\u0439", -1, 1), new Among$SII("\u0438\u0439", -1, 1), new Among$SII("\u043E\u0439", -1, 1), new Among$SII("\u044B\u0439", -1, 1), new Among$SII("\u0435\u043C", -1, 1), new Among$SII("\u0438\u043C", -1, 1), new Among$SII("\u043E\u043C", -1, 1), new Among$SII("\u044B\u043C", -1, 1), new Among$SII("\u0435\u0433\u043E", -1, 1), new Among$SII("\u043E\u0433\u043E", -1, 1), new Among$SII("\u0435\u043C\u0443", -1, 1), new Among$SII("\u043E\u043C\u0443", -1, 1), new Among$SII("\u0438\u0445", -1, 1), new Among$SII("\u044B\u0445", -1, 1), new Among$SII("\u0435\u044E", -1, 1), new Among$SII("\u043E\u044E", -1, 1), new Among$SII("\u0443\u044E", -1, 1), new Among$SII("\u044E\u044E", -1, 1), new Among$SII("\u0430\u044F", -1, 1), new Among$SII("\u044F\u044F", -1, 1) ];
+});
+$__jsx_lazy_init(RussianStemmer, "a_2", function () {
+ return [ new Among$SII("\u0435\u043C", -1, 1), new Among$SII("\u043D\u043D", -1, 1), new Among$SII("\u0432\u0448", -1, 1), new Among$SII("\u0438\u0432\u0448", 2, 2), new Among$SII("\u044B\u0432\u0448", 2, 2), new Among$SII("\u0449", -1, 1), new Among$SII("\u044E\u0449", 5, 1), new Among$SII("\u0443\u044E\u0449", 6, 2) ];
+});
+$__jsx_lazy_init(RussianStemmer, "a_3", function () {
+ return [ new Among$SII("\u0441\u044C", -1, 1), new Among$SII("\u0441\u044F", -1, 1) ];
+});
+$__jsx_lazy_init(RussianStemmer, "a_4", function () {
+ return [ new Among$SII("\u043B\u0430", -1, 1), new Among$SII("\u0438\u043B\u0430", 0, 2), new Among$SII("\u044B\u043B\u0430", 0, 2), new Among$SII("\u043D\u0430", -1, 1), new Among$SII("\u0435\u043D\u0430", 3, 2), new Among$SII("\u0435\u0442\u0435", -1, 1), new Among$SII("\u0438\u0442\u0435", -1, 2), new Among$SII("\u0439\u0442\u0435", -1, 1), new Among$SII("\u0435\u0439\u0442\u0435", 7, 2), new Among$SII("\u0443\u0439\u0442\u0435", 7, 2), new Among$SII("\u043B\u0438", -1, 1), new Among$SII("\u0438\u043B\u0438", 10, 2), new Among$SII("\u044B\u043B\u0438", 10, 2), new Among$SII("\u0439", -1, 1), new Among$SII("\u0435\u0439", 13, 2), new Among$SII("\u0443\u0439", 13, 2), new Among$SII("\u043B", -1, 1), new Among$SII("\u0438\u043B", 16, 2), new Among$SII("\u044B\u043B", 16, 2), new Among$SII("\u0435\u043C", -1, 1), new Among$SII("\u0438\u043C", -1, 2), new Among$SII("\u044B\u043C", -1, 2), new Among$SII("\u043D", -1, 1), new Among$SII("\u0435\u043D", 22, 2), new Among$SII("\u043B\u043E", -1, 1), new Among$SII("\u0438\u043B\u043E", 24, 2), new Among$SII("\u044B\u043B\u043E", 24, 2), new Among$SII("\u043D\u043E", -1, 1), new Among$SII("\u0435\u043D\u043E", 27, 2), new Among$SII("\u043D\u043D\u043E", 27, 1), new Among$SII("\u0435\u0442", -1, 1), new Among$SII("\u0443\u0435\u0442", 30, 2), new Among$SII("\u0438\u0442", -1, 2), new Among$SII("\u044B\u0442", -1, 2), new Among$SII("\u044E\u0442", -1, 1), new Among$SII("\u0443\u044E\u0442", 34, 2), new Among$SII("\u044F\u0442", -1, 2), new Among$SII("\u043D\u044B", -1, 1), new Among$SII("\u0435\u043D\u044B", 37, 2), new Among$SII("\u0442\u044C", -1, 1), new Among$SII("\u0438\u0442\u044C", 39, 2), new Among$SII("\u044B\u0442\u044C", 39, 2), new Among$SII("\u0435\u0448\u044C", -1, 1), new Among$SII("\u0438\u0448\u044C", -1, 2), new Among$SII("\u044E", -1, 2), new Among$SII("\u0443\u044E", 44, 2) ];
+});
+$__jsx_lazy_init(RussianStemmer, "a_5", function () {
+ return [ new Among$SII("\u0430", -1, 1), new Among$SII("\u0435\u0432", -1, 1), new Among$SII("\u043E\u0432", -1, 1), new Among$SII("\u0435", -1, 1), new Among$SII("\u0438\u0435", 3, 1), new Among$SII("\u044C\u0435", 3, 1), new Among$SII("\u0438", -1, 1), new Among$SII("\u0435\u0438", 6, 1), new Among$SII("\u0438\u0438", 6, 1), new Among$SII("\u0430\u043C\u0438", 6, 1), new Among$SII("\u044F\u043C\u0438", 6, 1), new Among$SII("\u0438\u044F\u043C\u0438", 10, 1), new Among$SII("\u0439", -1, 1), new Among$SII("\u0435\u0439", 12, 1), new Among$SII("\u0438\u0435\u0439", 13, 1), new Among$SII("\u0438\u0439", 12, 1), new Among$SII("\u043E\u0439", 12, 1), new Among$SII("\u0430\u043C", -1, 1), new Among$SII("\u0435\u043C", -1, 1), new Among$SII("\u0438\u0435\u043C", 18, 1), new Among$SII("\u043E\u043C", -1, 1), new Among$SII("\u044F\u043C", -1, 1), new Among$SII("\u0438\u044F\u043C", 21, 1), new Among$SII("\u043E", -1, 1), new Among$SII("\u0443", -1, 1), new Among$SII("\u0430\u0445", -1, 1), new Among$SII("\u044F\u0445", -1, 1), new Among$SII("\u0438\u044F\u0445", 26, 1), new Among$SII("\u044B", -1, 1), new Among$SII("\u044C", -1, 1), new Among$SII("\u044E", -1, 1), new Among$SII("\u0438\u044E", 30, 1), new Among$SII("\u044C\u044E", 30, 1), new Among$SII("\u044F", -1, 1), new Among$SII("\u0438\u044F", 33, 1), new Among$SII("\u044C\u044F", 33, 1) ];
+});
+$__jsx_lazy_init(RussianStemmer, "a_6", function () {
+ return [ new Among$SII("\u043E\u0441\u0442", -1, 1), new Among$SII("\u043E\u0441\u0442\u044C", -1, 1) ];
+});
+$__jsx_lazy_init(RussianStemmer, "a_7", function () {
+ return [ new Among$SII("\u0435\u0439\u0448\u0435", -1, 1), new Among$SII("\u043D", -1, 2), new Among$SII("\u0435\u0439\u0448", -1, 1), new Among$SII("\u044C", -1, 3) ];
+});
+$__jsx_lazy_init(RussianStemmer, "g_v", function () {
+ return [ 33, 65, 8, 232 ];
+});
+$__jsx_lazy_init(_Common, "buffers", function () {
+ return [ "comment", "sgmlDecl", "textNode", "tagName", "doctype", "procInstName", "procInstBody", "entity", "attribName", "attribValue", "cdata", "script" ];
+});
+$__jsx_lazy_init(_Common, "EVENTS", function () {
+ return [ "text", "processinginstruction", "sgmldeclaration", "doctype", "comment", "attribute", "opentag", "closetag", "opencdata", "cdata", "clo_State.CDATA", "error", "end", "ready", "script", "opennamespace", "closenamespace" ];
+});
+_Common.MAX_BUFFER_LENGTH = 65536;
+_State.BEGIN = 1;
+_State.TEXT = 2;
+_State.TEXT_ENTITY = 3;
+_State.OPEN_WAKA = 4;
+_State.SGML_DECL = 5;
+_State.SGML_DECL_QUOTED = 6;
+_State.DOCTYPE = 7;
+_State.DOCTYPE_QUOTED = 8;
+_State.DOCTYPE_DTD = 9;
+_State.DOCTYPE_DTD_QUOTED = 10;
+_State.COMMENT_STARTING = 11;
+_State.COMMENT = 12;
+_State.COMMENT_ENDING = 13;
+_State.COMMENT_ENDED = 14;
+_State.CDATA = 15;
+_State.CDATA_ENDING = 16;
+_State.CDATA_ENDING_2 = 17;
+_State.PROC_INST = 18;
+_State.PROC_INST_BODY = 19;
+_State.PROC_INST_ENDING = 20;
+_State.OPEN_TAG = 21;
+_State.OPEN_TAG_SLASH = 22;
+_State.ATTRIB = 23;
+_State.ATTRIB_NAME = 24;
+_State.ATTRIB_NAME_SAW_WHITE = 25;
+_State.ATTRIB_VALUE = 26;
+_State.ATTRIB_VALUE_QUOTED = 27;
+_State.ATTRIB_VALUE_UNQUOTED = 28;
+_State.ATTRIB_VALUE_ENTITY_Q = 29;
+_State.ATTRIB_VALUE_ENTITY_U = 30;
+_State.CLOSE_TAG = 31;
+_State.CLOSE_TAG_SAW_WHITE = 32;
+_State.SCRIPT = 33;
+_State.SCRIPT_ENDING = 34;
+$__jsx_lazy_init(_Entities, "_entities", function () {
+ return ({ "amp": "&", "gt": ">", "lt": "<", "quot": "\"", "apos": "'", "AElig": 198, "Aacute": 193, "Acirc": 194, "Agrave": 192, "Aring": 197, "Atilde": 195, "Auml": 196, "Ccedil": 199, "ETH": 208, "Eacute": 201, "Ecirc": 202, "Egrave": 200, "Euml": 203, "Iacute": 205, "Icirc": 206, "Igrave": 204, "Iuml": 207, "Ntilde": 209, "Oacute": 211, "Ocirc": 212, "Ograve": 210, "Oslash": 216, "Otilde": 213, "Ouml": 214, "THORN": 222, "Uacute": 218, "Ucirc": 219, "Ugrave": 217, "Uuml": 220, "Yacute": 221, "aacute": 225, "acirc": 226, "aelig": 230, "agrave": 224, "aring": 229, "atilde": 227, "auml": 228, "ccedil": 231, "eacute": 233, "ecirc": 234, "egrave": 232, "eth": 240, "euml": 235, "iacute": 237, "icirc": 238, "igrave": 236, "iuml": 239, "ntilde": 241, "oacute": 243, "ocirc": 244, "ograve": 242, "oslash": 248, "otilde": 245, "ouml": 246, "szlig": 223, "thorn": 254, "uacute": 250, "ucirc": 251, "ugrave": 249, "uuml": 252, "yacute": 253, "yuml": 255, "copy": 169, "reg": 174, "nbsp": 160, "iexcl": 161, "cent": 162, "pound": 163, "curren": 164, "yen": 165, "brvbar": 166, "sect": 167, "uml": 168, "ordf": 170, "laquo": 171, "not": 172, "shy": 173, "macr": 175, "deg": 176, "plusmn": 177, "sup1": 185, "sup2": 178, "sup3": 179, "acute": 180, "micro": 181, "para": 182, "middot": 183, "cedil": 184, "ordm": 186, "raquo": 187, "frac14": 188, "frac12": 189, "frac34": 190, "iquest": 191, "times": 215, "divide": 247, "OElig": 338, "oelig": 339, "Scaron": 352, "scaron": 353, "Yuml": 376, "fnof": 402, "circ": 710, "tilde": 732, "Alpha": 913, "Beta": 914, "Gamma": 915, "Delta": 916, "Epsilon": 917, "Zeta": 918, "Eta": 919, "Theta": 920, "Iota": 921, "Kappa": 922, "Lambda": 923, "Mu": 924, "Nu": 925, "Xi": 926, "Omicron": 927, "Pi": 928, "Rho": 929, "Sigma": 931, "Tau": 932, "Upsilon": 933, "Phi": 934, "Chi": 935, "Psi": 936, "Omega": 937, "alpha": 945, "beta": 946, "gamma": 947, "delta": 948, "epsilon": 949, "zeta": 950, "eta": 951, "theta": 952, "iota": 953, "kappa": 954, "lambda": 955, "mu": 956, "nu": 957, "xi": 958, "omicron": 959, "pi": 960, "rho": 961, "sigmaf": 962, "sigma": 963, "tau": 964, "upsilon": 965, "phi": 966, "chi": 967, "psi": 968, "omega": 969, "thetasym": 977, "upsih": 978, "piv": 982, "ensp": 8194, "emsp": 8195, "thinsp": 8201, "zwnj": 8204, "zwj": 8205, "lrm": 8206, "rlm": 8207, "ndash": 8211, "mdash": 8212, "lsquo": 8216, "rsquo": 8217, "sbquo": 8218, "ldquo": 8220, "rdquo": 8221, "bdquo": 8222, "dagger": 8224, "Dagger": 8225, "bull": 8226, "hellip": 8230, "permil": 8240, "prime": 8242, "Prime": 8243, "lsaquo": 8249, "rsaquo": 8250, "oline": 8254, "frasl": 8260, "euro": 8364, "image": 8465, "weierp": 8472, "real": 8476, "trade": 8482, "alefsym": 8501, "larr": 8592, "uarr": 8593, "rarr": 8594, "darr": 8595, "harr": 8596, "crarr": 8629, "lArr": 8656, "uArr": 8657, "rArr": 8658, "dArr": 8659, "hArr": 8660, "forall": 8704, "part": 8706, "exist": 8707, "empty": 8709, "nabla": 8711, "isin": 8712, "notin": 8713, "ni": 8715, "prod": 8719, "sum": 8721, "minus": 8722, "lowast": 8727, "radic": 8730, "prop": 8733, "infin": 8734, "ang": 8736, "and": 8743, "or": 8744, "cap": 8745, "cup": 8746, "int": 8747, "there4": 8756, "sim": 8764, "cong": 8773, "asymp": 8776, "ne": 8800, "equiv": 8801, "le": 8804, "ge": 8805, "sub": 8834, "sup": 8835, "nsub": 8836, "sube": 8838, "supe": 8839, "oplus": 8853, "otimes": 8855, "perp": 8869, "sdot": 8901, "lceil": 8968, "rceil": 8969, "lfloor": 8970, "rfloor": 8971, "lang": 9001, "rang": 9002, "loz": 9674, "spades": 9824, "clubs": 9827, "hearts": 9829, "diams": 9830 });
+});
+BitVector.SMALL_BLOCK_SIZE = 32;
+BitVector.LARGE_BLOCK_SIZE = 256;
+BitVector.BLOCK_RATE = 8;
+$__jsx_lazy_init(BurrowsWheelerTransform, "END_MARKER", function () {
+ return String.fromCharCode(0);
+});
+var $__jsx_classMap = {
+ "tool/web/oktavia-russian-search.jsx": {
+ _Main: _Main,
+ _Main$: _Main$
+ },
+ "tool/web/oktavia-search.jsx": {
+ _Result: _Result,
+ _Result$SSSI: _Result$SSSI,
+ _Proposal: _Proposal,
+ _Proposal$SSI: _Proposal$SSI,
+ OktaviaSearch: OktaviaSearch,
+ OktaviaSearch$I: OktaviaSearch$I,
+ _Main: _Main$0,
+ _Main$: _Main$0$
+ },
+ "src/oktavia.jsx": {
+ Oktavia: Oktavia,
+ Oktavia$: Oktavia$
+ },
+ "src/binary-util.jsx": {
+ Binary: Binary,
+ Binary$: Binary$,
+ LoadedStringResult: LoadedStringResult,
+ LoadedStringResult$SI: LoadedStringResult$SI,
+ LoadedStringListResult: LoadedStringListResult,
+ LoadedStringListResult$SI: LoadedStringListResult$SI,
+ LoadedStringListMapResult: LoadedStringListMapResult,
+ LoadedStringListMapResult$SI: LoadedStringListMapResult$SI,
+ LoadedNumberListResult: LoadedNumberListResult,
+ LoadedNumberListResult$SI: LoadedNumberListResult$SI,
+ CompressionReport: CompressionReport,
+ CompressionReport$: CompressionReport$
+ },
+ "src/query.jsx": {
+ Query: Query,
+ Query$: Query$
+ },
+ "src/query-string-parser.jsx": {
+ QueryStringParser: QueryStringParser,
+ QueryStringParser$: QueryStringParser$
+ },
+ "src/search-result.jsx": {
+ Proposal: Proposal,
+ Proposal$II: Proposal$II,
+ Position: Position,
+ Position$SIB: Position$SIB,
+ SearchUnit: SearchUnit,
+ SearchUnit$I: SearchUnit$I,
+ SingleResult: SingleResult,
+ SingleResult$: SingleResult$,
+ SingleResult$SBB: SingleResult$SBB,
+ SearchSummary: SearchSummary,
+ SearchSummary$: SearchSummary$,
+ SearchSummary$LOktavia$: SearchSummary$LOktavia$
+ },
+ "src/style.jsx": {
+ Style: Style,
+ Style$S: Style$S,
+ _HTMLHandler: _HTMLHandler,
+ _HTMLHandler$HASB: _HTMLHandler$HASB
+ },
+ "src/stemmer/stemmer.jsx": {
+ Stemmer: Stemmer,
+ Stemmer$: Stemmer$
+ },
+ "src/stemmer/base-stemmer.jsx": {
+ BaseStemmer: BaseStemmer,
+ BaseStemmer$: BaseStemmer$
+ },
+ "src/stemmer/russian-stemmer.jsx": {
+ RussianStemmer: RussianStemmer,
+ RussianStemmer$: RussianStemmer$
+ },
+ "src/stemmer/among.jsx": {
+ Among: Among,
+ Among$SII: Among$SII,
+ Among$SIIF$LBaseStemmer$B$LBaseStemmer$: Among$SIIF$LBaseStemmer$B$LBaseStemmer$
+ },
+ "src/metadata.jsx": {
+ Metadata: Metadata,
+ Metadata$LOktavia$: Metadata$LOktavia$,
+ Section: Section,
+ Section$LOktavia$: Section$LOktavia$,
+ Splitter: Splitter,
+ Splitter$LOktavia$: Splitter$LOktavia$,
+ Splitter$LOktavia$S: Splitter$LOktavia$S,
+ Table: Table,
+ Table$LOktavia$AS: Table$LOktavia$AS,
+ Block: Block,
+ Block$LOktavia$: Block$LOktavia$
+ },
+ "src/fm-index.jsx": {
+ FMIndex: FMIndex,
+ FMIndex$: FMIndex$
+ },
+ "src/sax.jsx": {
+ Tag: Tag,
+ Tag$S: Tag$S,
+ _Common: _Common,
+ _Common$: _Common$,
+ _State: _State,
+ _State$: _State$,
+ SAXHandler: SAXHandler,
+ SAXHandler$: SAXHandler$,
+ SAXParser: SAXParser,
+ SAXParser$LSAXHandler$: SAXParser$LSAXHandler$,
+ SAXParser$LSAXHandler$B: SAXParser$LSAXHandler$B,
+ Char: Char,
+ Char$: Char$,
+ _Entities: _Entities,
+ _Entities$: _Entities$
+ },
+ "src/bit-vector.jsx": {
+ BitVector: BitVector,
+ BitVector$: BitVector$
+ },
+ "src/wavelet-matrix.jsx": {
+ WaveletMatrix: WaveletMatrix,
+ WaveletMatrix$: WaveletMatrix$
+ },
+ "src/burrows-wheeler-transform.jsx": {
+ BurrowsWheelerTransform: BurrowsWheelerTransform,
+ BurrowsWheelerTransform$: BurrowsWheelerTransform$
+ },
+ "src/sais.jsx": {
+ OArray: OArray,
+ OArray$AI: OArray$AI,
+ OArray$AII: OArray$AII,
+ SAIS: SAIS,
+ SAIS$: SAIS$
+ }
+};
+
+
+/**
+ * launches _Main.main(:string[]):void invoked by jsx --run|--executable
+ */
+JSX.runMain = function (sourceFile, args) {
+ var module = JSX.require(sourceFile);
+ if (! module) {
+ throw new ReferenceError("entry point module not found in " + sourceFile);
+ }
+ if (! module._Main) {
+ throw new ReferenceError("entry point _Main not found in " + sourceFile);
+ }
+ if (! module._Main.main$AS) {
+ throw new ReferenceError("entry point _Main.main(:string[]):void not found in " + sourceFile);
+ }
+ module._Main.main$AS(args);
+};
+
+/**
+ * launches _Test#test*():void invoked by jsx --test
+ */
+JSX.runTests = function (sourceFile, tests) {
+ var module = JSX.require(sourceFile);
+ var testClass = module._Test$;
+
+ if (!testClass) return; // skip if there's no test class
+
+ if(tests.length === 0) {
+ var p = testClass.prototype;
+ for (var m in p) {
+ if (p[m] instanceof Function
+ && /^test.*[$]$/.test(m)) {
+ tests.push(m);
+ }
+ }
+ }
+ else { // set as process arguments
+ tests = tests.map(function (name) {
+ return name + "$"; // mangle for function test*():void
+ });
+ }
+
+ var testCase = new testClass();
+
+ if (testCase.beforeClass$AS != null)
+ testCase.beforeClass$AS(tests);
+
+ for (var i = 0; i < tests.length; ++i) {
+ (function (method) {
+ if (method in testCase) {
+ testCase.run$SF$V$(method, function() { testCase[method](); });
+ }
+ else {
+ throw new ReferenceError("No such test method: " + method);
+ }
+ }(tests[i]));
+ }
+
+ if (testCase.afterClass$ != null)
+ testCase.afterClass$();
+};
+/**
+ * call a function on load/DOMContentLoaded
+ */
+function $__jsx_onload (event) {
+ window.removeEventListener("load", $__jsx_onload);
+ document.removeEventListener("DOMContentLoaded", $__jsx_onload);
+ JSX.runMain("tool/web/oktavia-russian-search.jsx", [])
+}
+
+window.addEventListener("load", $__jsx_onload);
+document.addEventListener("DOMContentLoaded", $__jsx_onload);
+
+})(JSX);
diff --git a/web/server/h2o/libh2o/misc/oktavia/lib/oktavia-search.js b/web/server/h2o/libh2o/misc/oktavia/lib/oktavia-search.js
new file mode 100644
index 00000000..fce9732a
--- /dev/null
+++ b/web/server/h2o/libh2o/misc/oktavia/lib/oktavia-search.js
@@ -0,0 +1,6795 @@
+// generatedy by JSX compiler 0.9.24 (2013-04-05 13:45:00 +0900; 1b229cc6a411f674f0f7cf7a79b7a8b3f8eb7414)
+var JSX = {};
+(function (JSX) {
+/**
+ * copies the implementations from source interface to target
+ */
+function $__jsx_merge_interface(target, source) {
+ for (var k in source.prototype)
+ if (source.prototype.hasOwnProperty(k))
+ target.prototype[k] = source.prototype[k];
+}
+
+/**
+ * defers the initialization of the property
+ */
+function $__jsx_lazy_init(obj, prop, func) {
+ function reset(obj, prop, value) {
+ delete obj[prop];
+ obj[prop] = value;
+ return value;
+ }
+
+ Object.defineProperty(obj, prop, {
+ get: function () {
+ return reset(obj, prop, func());
+ },
+ set: function (v) {
+ reset(obj, prop, v);
+ },
+ enumerable: true,
+ configurable: true
+ });
+}
+
+/**
+ * sideeffect().a /= b
+ */
+function $__jsx_div_assign(obj, prop, divisor) {
+ return obj[prop] = (obj[prop] / divisor) | 0;
+}
+
+/*
+ * global functions, renamed to avoid conflict with local variable names
+ */
+var $__jsx_parseInt = parseInt;
+var $__jsx_parseFloat = parseFloat;
+var $__jsx_isNaN = isNaN;
+var $__jsx_isFinite = isFinite;
+
+var $__jsx_encodeURIComponent = encodeURIComponent;
+var $__jsx_decodeURIComponent = decodeURIComponent;
+var $__jsx_encodeURI = encodeURI;
+var $__jsx_decodeURI = decodeURI;
+
+var $__jsx_ObjectToString = Object.prototype.toString;
+var $__jsx_ObjectHasOwnProperty = Object.prototype.hasOwnProperty;
+
+/*
+ * profiler object, initialized afterwards
+ */
+function $__jsx_profiler() {
+}
+
+/*
+ * public interface to JSX code
+ */
+JSX.require = function (path) {
+ var m = $__jsx_classMap[path];
+ return m !== undefined ? m : null;
+};
+
+JSX.profilerIsRunning = function () {
+ return $__jsx_profiler.getResults != null;
+};
+
+JSX.getProfileResults = function () {
+ return ($__jsx_profiler.getResults || function () { return {}; })();
+};
+
+JSX.postProfileResults = function (url, cb) {
+ if ($__jsx_profiler.postResults == null)
+ throw new Error("profiler has not been turned on");
+ return $__jsx_profiler.postResults(url, cb);
+};
+
+JSX.resetProfileResults = function () {
+ if ($__jsx_profiler.resetResults == null)
+ throw new Error("profiler has not been turned on");
+ return $__jsx_profiler.resetResults();
+};
+JSX.DEBUG = false;
+/**
+ * class _Result extends Object
+ * @constructor
+ */
+function _Result() {
+}
+
+/**
+ * @constructor
+ * @param {!string} title
+ * @param {!string} url
+ * @param {!string} content
+ * @param {!number} score
+ */
+function _Result$SSSI(title, url, content, score) {
+ this.title = title;
+ this.url = url;
+ this.content = content;
+ this.score = score;
+};
+
+_Result$SSSI.prototype = new _Result;
+
+/**
+ * class _Proposal extends Object
+ * @constructor
+ */
+function _Proposal() {
+}
+
+/**
+ * @constructor
+ * @param {!string} options
+ * @param {!string} label
+ * @param {!number} count
+ */
+function _Proposal$SSI(options, label, count) {
+ this.options = options;
+ this.label = label;
+ this.count = count;
+};
+
+_Proposal$SSI.prototype = new _Proposal;
+
+/**
+ * class OktaviaSearch extends Object
+ * @constructor
+ */
+function OktaviaSearch() {
+}
+
+/**
+ * @constructor
+ * @param {!number} entriesPerPage
+ */
+function OktaviaSearch$I(entriesPerPage) {
+ this._queries = null;
+ this._highlight = "";
+ this._result = null;
+ this._proposals = null;
+ this._currentFolderDepth = 0;
+ this._oktavia = new Oktavia$();
+ this._entriesPerPage = entriesPerPage;
+ this._currentPage = 1;
+ this._queryString = null;
+ this._callback = null;
+ OktaviaSearch._instance = this;
+};
+
+OktaviaSearch$I.prototype = new OktaviaSearch;
+
+/**
+ * @param {Stemmer} stemmer
+ */
+OktaviaSearch.setStemmer$LStemmer$ = function (stemmer) {
+ /** @type {Oktavia} */
+ var this$0;
+ if (OktaviaSearch._instance) {
+ this$0 = OktaviaSearch._instance._oktavia;
+ this$0._stemmer = stemmer;
+ } else {
+ OktaviaSearch._stemmer = stemmer;
+ }
+};
+
+var OktaviaSearch$setStemmer$LStemmer$ = OktaviaSearch.setStemmer$LStemmer$;
+
+/**
+ * @param {!string} index
+ */
+OktaviaSearch.prototype.loadIndex$S = function (index) {
+ /** @type {Oktavia} */
+ var this$0;
+ /** @type {Stemmer} */
+ var stemmer$0;
+ if (OktaviaSearch._stemmer) {
+ this$0 = this._oktavia;
+ stemmer$0 = OktaviaSearch._stemmer;
+ this$0._stemmer = stemmer$0;
+ }
+ this._oktavia.load$S(Binary$base64decode$S(index));
+ if (this._queryString) {
+ this.search$SF$IIV$(this._queryString, this._callback);
+ this._queryString = null;
+ this._callback = null;
+ }
+};
+
+/**
+ * @param {!string} queryString
+ * @param {*} callback
+ */
+OktaviaSearch.prototype.search$SF$IIV$ = function (queryString, callback) {
+ /** @type {QueryStringParser} */
+ var queryParser;
+ /** @type {SearchSummary} */
+ var summary;
+ /** @type {Array.<undefined|SearchUnit>} */
+ var _result$0;
+ if (this._oktavia) {
+ queryParser = ({queries: [ ]});
+ this._queries = QueryStringParser$parse$LQueryStringParser$S(queryParser, queryString);
+ this._highlight = QueryStringParser$highlight$LQueryStringParser$(queryParser);
+ summary = this._oktavia.search$ALQuery$(this._queries);
+ if (SearchSummary$size$LSearchSummary$(summary) > 0) {
+ this._result = this._sortResult$LSearchSummary$(summary);
+ this._proposals = [ ];
+ this._currentPage = 1;
+ } else {
+ this._result = [ ];
+ if (this._queries.length > 1) {
+ this._proposals = SearchSummary$getProposal$LSearchSummary$(summary);
+ } else {
+ this._proposals = [ ];
+ }
+ this._currentPage = 1;
+ }
+ callback((_result$0 = this._result).length, Math.ceil(_result$0.length / this._entriesPerPage));
+ } else {
+ this._queryString = queryString;
+ this._callback = callback;
+ }
+};
+
+/**
+ * @return {!number}
+ */
+OktaviaSearch.prototype.resultSize$ = function () {
+ return (this._result.length | 0);
+};
+
+/**
+ * @return {!number}
+ */
+OktaviaSearch.prototype.totalPages$ = function () {
+ return (Math.ceil(this._result.length / this._entriesPerPage) | 0);
+};
+
+/**
+ * @return {!number}
+ */
+OktaviaSearch.prototype.currentPage$ = function () {
+ return this._currentPage;
+};
+
+/**
+ * @param {!number} page
+ */
+OktaviaSearch.prototype.setCurrentPage$I = function (page) {
+ this._currentPage = page;
+};
+
+/**
+ * @return {!boolean}
+ */
+OktaviaSearch.prototype.hasPrevPage$ = function () {
+ return this._currentPage !== 1;
+};
+
+/**
+ * @return {!boolean}
+ */
+OktaviaSearch.prototype.hasNextPage$ = function () {
+ return this._currentPage !== Math.ceil(this._result.length / this._entriesPerPage);
+};
+
+/**
+ * @return {Array.<undefined|!string>}
+ */
+OktaviaSearch.prototype.pageIndexes$ = function () {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var total;
+ /** @type {!number} */
+ var i;
+ result = [ ];
+ total = Math.ceil(this._result.length / this._entriesPerPage);
+ if (total < 10) {
+ for (i = 1; i <= total; i++) {
+ result.push(i + "");
+ }
+ } else {
+ if (this._currentPage <= 5) {
+ for (i = 1; i <= 7; i++) {
+ result.push(i + "");
+ }
+ result.push('...', total + "");
+ } else {
+ if (total - 5 <= this._currentPage) {
+ result.push('1', '...');
+ for (i = total - 8; i <= total; i++) {
+ result.push(i + "");
+ }
+ } else {
+ result.push('1', '...');
+ for (i = this._currentPage - 3; i <= this._currentPage + 3; i++) {
+ result.push(i + "");
+ }
+ result.push('...', total + "");
+ }
+ }
+ }
+ return result;
+};
+
+/**
+ * @return {Array.<undefined|_Result>}
+ */
+OktaviaSearch.prototype.getResult$ = function () {
+ /** @type {Style} */
+ var style;
+ /** @type {!number} */
+ var start;
+ /** @type {!number} */
+ var last;
+ /** @type {Metadata} */
+ var metadata;
+ /** @type {!number} */
+ var num;
+ /** @type {Array.<undefined|_Result>} */
+ var results;
+ /** @type {!number} */
+ var i;
+ /** @type {SearchUnit} */
+ var unit;
+ /** @type {Array.<undefined|!string>} */
+ var info;
+ /** @type {!string} */
+ var content;
+ /** @type {Array.<undefined|Position>} */
+ var positions;
+ /** @type {!number} */
+ var end;
+ /** @type {!boolean} */
+ var split;
+ /** @type {!number} */
+ var j;
+ /** @type {Position} */
+ var pos;
+ /** @type {!string} */
+ var text;
+ /** @type {Oktavia} */
+ var this$0;
+ /** @type {!number} */
+ var position$0;
+ /** @type {!number} */
+ var _currentPage$0;
+ /** @type {!number} */
+ var _entriesPerPage$0;
+ style = new Style$S('html');
+ start = ((_currentPage$0 = this._currentPage) - 1) * (_entriesPerPage$0 = this._entriesPerPage);
+ last = Math.min(_currentPage$0 * _entriesPerPage$0, this._result.length);
+ this$0 = this._oktavia;
+ metadata = this$0._metadatas[this$0._metadataLabels[0]];
+ num = 250;
+ results = [ ];
+ for (i = start; i < last; i++) {
+ unit = this._result[i];
+ info = metadata.getInformation$I(unit.id).split(Oktavia.eob);
+ content = metadata.getContent$I(unit.id);
+ start = 0;
+ positions = SearchUnit$getPositions$LSearchUnit$(unit);
+ if (content.indexOf(info[0]) === 1) {
+ content = content.slice(info[0].length + 2, content.length);
+ start += info[0].length + 2;
+ }
+ end = start + num;
+ split = false;
+ if (positions[0].position > end - positions[0].word.length) {
+ end = positions[0].position + Math.floor(num / 2);
+ split = true;
+ }
+ for (j = positions.length - 1; j > -1; j--) {
+ pos = positions[j];
+ if (pos.position + pos.word.length < end) {
+ content = [ content.slice(0, pos.position - start), style.convert$S('<hit>*</hit>').replace('*', content.slice((position$0 = pos.position) - start, position$0 + pos.word.length - start)), content.slice(pos.position + pos.word.length - start, content.length) ].join('');
+ }
+ }
+ if (split) {
+ text = [ content.slice(0, Math.floor(num / 2)) + ' ...', content.slice(- Math.floor(num / 2), end - start) ].join('<br/>');
+ } else {
+ text = content.slice(0, end - start) + ' ...<br/>';
+ }
+ text = text.replace(Oktavia.eob, ' ').replace(/(<br\/>)(<br\/>)+/, '<br/><br/>');
+ results.push(({title: info[0], url: info[1], content: text, score: unit.score}));
+ }
+ return results;
+};
+
+/**
+ * @return {!string}
+ */
+OktaviaSearch.prototype.getHighlight$ = function () {
+ return this._highlight;
+};
+
+/**
+ * @return {Array.<undefined|_Proposal>}
+ */
+OktaviaSearch.prototype.getProposals$ = function () {
+ /** @type {Style} */
+ var style;
+ /** @type {Array.<undefined|_Proposal>} */
+ var results;
+ /** @type {!number} */
+ var i;
+ /** @type {Proposal} */
+ var proposal;
+ /** @type {Array.<undefined|!string>} */
+ var label;
+ /** @type {Array.<undefined|!string>} */
+ var option;
+ /** @type {!number} */
+ var j;
+ style = new Style$S('html');
+ results = [ ];
+ if (this._queries.length > 1) {
+ for (i = 0; i < this._proposals.length; i++) {
+ proposal = this._proposals[i];
+ if (proposal.expect > 0) {
+ label = [ ];
+ option = [ ];
+ for (j = 0; j < this._queries.length; j++) {
+ if (j !== proposal.omit) {
+ label.push(style.convert$S('<hit>' + this._queries[j].toString() + '</hit>'));
+ option.push(this._queries[j].toString());
+ } else {
+ label.push(style.convert$S('<del>' + this._queries[j].toString() + '</del>'));
+ }
+ }
+ results.push(({options: option.join(' '), label: label.join('&nbsp;'), count: proposal.expect}));
+ }
+ }
+ }
+ return results;
+};
+
+/**
+ * @param {SearchSummary} summary
+ * @return {Array.<undefined|SearchUnit>}
+ */
+OktaviaSearch.prototype._sortResult$LSearchSummary$ = function (summary) {
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var score;
+ /** @type {SearchUnit} */
+ var unit;
+ /** @type {!string} */
+ var pos;
+ /** @type {Position} */
+ var position;
+ for (i = 0; i < summary.result.units.length; i++) {
+ score = 0;
+ unit = summary.result.units[i];
+ for (pos in unit.positions) {
+ position = unit.positions[pos];
+ if (this._oktavia.wordPositionType$I(position.position)) {
+ score += 10;
+ } else {
+ score += 1;
+ }
+ if (! position.stemmed) {
+ score += 2;
+ }
+ }
+ unit.score = (score | 0);
+ }
+ return SearchSummary$getSortedResult$LSearchSummary$(summary);
+};
+
+/**
+ * class _Main extends Object
+ * @constructor
+ */
+function _Main() {
+}
+
+/**
+ * @constructor
+ */
+function _Main$() {
+};
+
+_Main$.prototype = new _Main;
+
+/**
+ * @param {Array.<undefined|!string>} args
+ */
+_Main.main$AS = function (args) {
+};
+
+var _Main$main$AS = _Main.main$AS;
+
+/**
+ * class Oktavia extends Object
+ * @constructor
+ */
+function Oktavia() {
+}
+
+/**
+ * @constructor
+ */
+function Oktavia$() {
+ /** @type {Array.<undefined|!string>} */
+ var _utf162compressCode$0;
+ this._compressCode2utf16 = null;
+ this._fmindex = new FMIndex$();
+ this._metadatas = ({ });
+ this._metadataLabels = [ ];
+ this._stemmer = null;
+ this._stemmingResult = ({ });
+ _utf162compressCode$0 = this._utf162compressCode = [ Oktavia.eof, Oktavia.eob, Oktavia.unknown ];
+ _utf162compressCode$0.length = 65536;
+ this._compressCode2utf16 = [ Oktavia.eof, Oktavia.eob, Oktavia.unknown ];
+};
+
+Oktavia$.prototype = new Oktavia;
+
+/**
+ * @param {Stemmer} stemmer
+ */
+Oktavia.prototype.setStemmer$LStemmer$ = function (stemmer) {
+ this._stemmer = stemmer;
+};
+
+/**
+ * @return {Metadata}
+ */
+Oktavia.prototype.getPrimaryMetadata$ = function () {
+ return this._metadatas[this._metadataLabels[0]];
+};
+
+/**
+ * @param {!string} key
+ * @return {Section}
+ */
+Oktavia.prototype.addSection$S = function (key) {
+ /** @type {Section} */
+ var section;
+ if (this._metadataLabels.indexOf(key) !== -1) {
+ throw new Error('Metadata name ' + key + ' is already exists');
+ }
+ this._metadataLabels.push(key);
+ section = new Section$LOktavia$(this);
+ this._metadatas[key] = section;
+ return section;
+};
+
+/**
+ * @param {!string} key
+ * @return {Section}
+ */
+Oktavia.prototype.getSection$S = function (key) {
+ if (this._metadataLabels.indexOf(key) === -1) {
+ throw new Error('Metadata name ' + key + " does't exists");
+ }
+ return this._metadatas[key];
+};
+
+/**
+ * @param {!string} key
+ * @return {Splitter}
+ */
+Oktavia.prototype.addSplitter$S = function (key) {
+ /** @type {Splitter} */
+ var splitter;
+ if (this._metadataLabels.indexOf(key) !== -1) {
+ throw new Error('Metadata name ' + key + ' is already exists');
+ }
+ this._metadataLabels.push(key);
+ splitter = new Splitter$LOktavia$(this);
+ this._metadatas[key] = splitter;
+ return splitter;
+};
+
+/**
+ * @param {!string} key
+ * @return {Splitter}
+ */
+Oktavia.prototype.getSplitter$S = function (key) {
+ if (this._metadataLabels.indexOf(key) === -1) {
+ throw new Error('Metadata name ' + key + " does't exists");
+ }
+ return this._metadatas[key];
+};
+
+/**
+ * @param {!string} key
+ * @param {Array.<undefined|!string>} headers
+ * @return {Table}
+ */
+Oktavia.prototype.addTable$SAS = function (key, headers) {
+ /** @type {Table} */
+ var table;
+ if (this._metadataLabels.indexOf(key) !== -1) {
+ throw new Error('Metadata name ' + key + ' is already exists');
+ }
+ this._metadataLabels.push(key);
+ table = new Table$LOktavia$AS(this, headers);
+ this._metadatas[key] = table;
+ return table;
+};
+
+/**
+ * @param {!string} key
+ * @return {Table}
+ */
+Oktavia.prototype.getTable$S = function (key) {
+ if (this._metadataLabels.indexOf(key) === -1) {
+ throw new Error('Metadata name ' + key + " does't exists");
+ }
+ return this._metadatas[key];
+};
+
+/**
+ * @param {!string} key
+ * @return {Block}
+ */
+Oktavia.prototype.addBlock$S = function (key) {
+ /** @type {Block} */
+ var block;
+ if (this._metadataLabels.indexOf(key) !== -1) {
+ throw new Error('Metadata name ' + key + ' is already exists');
+ }
+ this._metadataLabels.push(key);
+ block = new Block$LOktavia$(this);
+ this._metadatas[key] = block;
+ return block;
+};
+
+/**
+ * @param {!string} key
+ * @return {Block}
+ */
+Oktavia.prototype.getBlock$S = function (key) {
+ if (this._metadataLabels.indexOf(key) === -1) {
+ throw new Error('Metadata name ' + key + " does't exists");
+ }
+ return this._metadatas[key];
+};
+
+/**
+ */
+Oktavia.prototype.addEndOfBlock$ = function () {
+ this._fmindex.push$S(Oktavia.eob);
+};
+
+/**
+ * @param {!string} words
+ */
+Oktavia.prototype.addWord$S = function (words) {
+ /** @type {Array.<undefined|!string>} */
+ var str;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var charCode;
+ /** @type {undefined|!string} */
+ var newCharCode;
+ str = [ ];
+ str.length = words.length;
+ for (i = 0; i < words.length; i++) {
+ charCode = words.charCodeAt(i);
+ newCharCode = this._utf162compressCode[charCode];
+ if (newCharCode == null) {
+ newCharCode = String.fromCharCode(this._compressCode2utf16.length);
+ this._utf162compressCode[charCode] = newCharCode;
+ this._compressCode2utf16.push(String.fromCharCode(charCode));
+ }
+ str.push(newCharCode);
+ }
+ this._fmindex.push$S(str.join(''));
+};
+
+/**
+ * @param {!string} words
+ * @param {!boolean} stemming
+ */
+Oktavia.prototype.addWord$SB = function (words, stemming) {
+ /** @type {Array.<undefined|!string>} */
+ var wordList;
+ /** @type {!number} */
+ var i;
+ /** @type {undefined|!string} */
+ var originalWord;
+ /** @type {!string} */
+ var smallWord;
+ /** @type {undefined|!string} */
+ var registerWord;
+ /** @type {!string} */
+ var baseWord;
+ /** @type {!string} */
+ var compressedCodeWord;
+ /** @type {Array.<undefined|!string>} */
+ var stemmedList;
+ this.addWord$S(words);
+ wordList = words.split(/\s+/);
+ for (i = 0; i < wordList.length; i++) {
+ originalWord = wordList[i];
+ smallWord = originalWord.slice(0, 1).toLowerCase() + originalWord.slice(1);
+ registerWord = null;
+ if (stemming && this._stemmer) {
+ baseWord = this._stemmer.stemWord$S(originalWord.toLowerCase());
+ if (originalWord.indexOf(baseWord) === -1) {
+ registerWord = baseWord;
+ }
+ } else {
+ if (originalWord != smallWord) {
+ registerWord = smallWord;
+ }
+ }
+ if (registerWord) {
+ compressedCodeWord = this._convertToCompressionCode$S(originalWord);
+ stemmedList = this._stemmingResult[registerWord];
+ if (! stemmedList) {
+ stemmedList = [ compressedCodeWord ];
+ this._stemmingResult[registerWord] = stemmedList;
+ } else {
+ if (stemmedList.indexOf(compressedCodeWord) === -1) {
+ stemmedList.push(compressedCodeWord);
+ }
+ }
+ }
+ }
+};
+
+/**
+ * @param {!string} keyword
+ * @return {!string}
+ */
+Oktavia.prototype._convertToCompressionCode$S = function (keyword) {
+ /** @type {Array.<undefined|!string>} */
+ var resultChars;
+ /** @type {!number} */
+ var i;
+ /** @type {undefined|!string} */
+ var chr;
+ resultChars = [ ];
+ for (i = 0; i < keyword.length; i++) {
+ chr = this._utf162compressCode[keyword.charCodeAt(i)];
+ if (chr == null) {
+ resultChars.push(Oktavia.unknown);
+ } else {
+ resultChars.push(chr);
+ }
+ }
+ return resultChars.join('');
+};
+
+/**
+ * @param {!string} keyword
+ * @param {!boolean} stemming
+ * @return {Array.<undefined|!number>}
+ */
+Oktavia.prototype.rawSearch$SB = function (keyword, stemming) {
+ /** @type {Array.<undefined|!number>} */
+ var result;
+ /** @type {!string} */
+ var baseWord;
+ /** @type {Array.<undefined|!string>} */
+ var stemmedList;
+ /** @type {!number} */
+ var i;
+ /** @type {undefined|!string} */
+ var word;
+ if (stemming) {
+ result = [ ];
+ if (this._stemmer) {
+ baseWord = this._stemmer.stemWord$S(keyword.toLowerCase());
+ stemmedList = this._stemmingResult[baseWord];
+ if (stemmedList) {
+ for (i = 0; i < stemmedList.length; i++) {
+ word = stemmedList[i];
+ result = result.concat(this._fmindex.search$S(word));
+ }
+ }
+ }
+ } else {
+ result = this._fmindex.search$S(this._convertToCompressionCode$S(keyword));
+ }
+ return result;
+};
+
+/**
+ * @param {Array.<undefined|Query>} queries
+ * @return {SearchSummary}
+ */
+Oktavia.prototype.search$ALQuery$ = function (queries) {
+ /** @type {SearchSummary} */
+ var summary;
+ /** @type {!number} */
+ var i;
+ /** @type {SingleResult} */
+ var result$0;
+ summary = ({sourceResults: [ ], result: null, oktavia: this});
+ for (i = 0; i < queries.length; i++) {
+ result$0 = this._searchQuery$LQuery$(queries[i]);
+ summary.sourceResults.push(result$0);
+ }
+ summary.result = SearchSummary$mergeResult$LSearchSummary$ALSingleResult$(summary, summary.sourceResults);
+ return summary;
+};
+
+/**
+ * @param {Query} query
+ * @return {SingleResult}
+ */
+Oktavia.prototype._searchQuery$LQuery$ = function (query) {
+ /** @type {SingleResult} */
+ var result;
+ /** @type {Array.<undefined|!number>} */
+ var positions;
+ result = new SingleResult$SBB(query.word, query.or, query.not);
+ if (query.raw) {
+ positions = this.rawSearch$SB(query.word, false);
+ } else {
+ positions = this.rawSearch$SB(query.word, false).concat(this.rawSearch$SB(query.word, true));
+ }
+ this._metadatas[this._metadataLabels[0]].grouping$LSingleResult$AISB(result, positions, query.word, ! query.raw);
+ return result;
+};
+
+/**
+ */
+Oktavia.prototype.build$ = function () {
+ this.build$IB(5, false);
+};
+
+/**
+ * @param {!number} cacheDensity
+ * @param {!boolean} verbose
+ */
+Oktavia.prototype.build$IB = function (cacheDensity, verbose) {
+ /** @type {!string} */
+ var key;
+ /** @type {!number} */
+ var cacheRange;
+ /** @type {!number} */
+ var maxChar;
+ for (key in this._metadatas) {
+ this._metadatas[key]._build$();
+ }
+ cacheRange = Math.round(Math.max(1, 100 / Math.min(100, Math.max(0.01, cacheDensity))));
+ maxChar = this._compressCode2utf16.length;
+ this._fmindex.build$SIIB(Oktavia.eof, maxChar, cacheRange, verbose);
+};
+
+/**
+ * @return {!string}
+ */
+Oktavia.prototype.dump$ = function () {
+ return this.dump$B(false);
+};
+
+/**
+ * @param {!boolean} verbose
+ * @return {!string}
+ */
+Oktavia.prototype.dump$B = function (verbose) {
+ /** @type {!string} */
+ var header;
+ /** @type {!string} */
+ var fmdata;
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var i;
+ /** @type {CompressionReport} */
+ var report;
+ /** @type {undefined|!string} */
+ var name;
+ /** @type {!string} */
+ var data;
+ header = Binary$dumpString$SLCompressionReport$("oktavia-01", null).slice(1);
+ if (verbose) {
+ console.log("Source text size: " + (this._fmindex.size$() * 2 + "") + ' bytes');
+ }
+ fmdata = this._fmindex.dump$B(verbose);
+ result = [ header, fmdata ];
+ result.push(Binary$dump16bitNumber$I(this._compressCode2utf16.length));
+ for (i = 3; i < this._compressCode2utf16.length; i++) {
+ result.push(this._compressCode2utf16[i]);
+ }
+ if (verbose) {
+ console.log('Char Code Map: ' + (this._compressCode2utf16.length * 2 - 2 + "") + ' bytes');
+ }
+ report = ({source: 0, result: 0});
+ result.push(Binary$dumpStringListMap$HASLCompressionReport$(this._stemmingResult, report));
+ if (verbose) {
+ console.log('Stemmed Word Table: ' + (result[result.length - 1].length + "") + ' bytes (' + (Math.round(report.result * 100.0 / report.source) + "") + '%)');
+ }
+ result.push(Binary$dump16bitNumber$I(this._metadataLabels.length));
+ for (i = 0; i < this._metadataLabels.length; i++) {
+ report = ({source: 0, result: 0});
+ name = this._metadataLabels[i];
+ data = this._metadatas[name]._dump$LCompressionReport$(report);
+ result.push(Binary$dumpString$SLCompressionReport$(name, report), data);
+ if (verbose) {
+ console.log('Meta Data ' + name + ': ' + (data.length * 2 + "") + ' bytes (' + (Math.round(report.result * 100.0 / report.source) + "") + '%)');
+ }
+ }
+ return result.join('');
+};
+
+/**
+ * @param {!string} data
+ */
+Oktavia.prototype.load$S = function (data) {
+ /** @type {!string} */
+ var header;
+ /** @type {!number} */
+ var offset;
+ /** @type {!number} */
+ var charCodeCount;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var charCode;
+ /** @type {LoadedStringListMapResult} */
+ var stemmedWords;
+ /** @type {!number} */
+ var metadataCount;
+ /** @type {LoadedStringResult} */
+ var nameResult;
+ /** @type {!string} */
+ var name;
+ /** @type {!number} */
+ var type;
+ header = Binary$dumpString$SLCompressionReport$("oktavia-01", null).slice(1);
+ if (data.slice(0, 5) !== header) {
+ throw new Error('Invalid data file');
+ }
+ this._metadatas = ({ });
+ this._metadataLabels = [ ];
+ offset = 5;
+ offset = this._fmindex.load$SI(data, offset);
+ charCodeCount = Binary$load16bitNumber$SI(data, offset++);
+ this._compressCode2utf16 = [ Oktavia.eof, Oktavia.eob, Oktavia.unknown ];
+ this._utf162compressCode = [ Oktavia.eof, Oktavia.eob, Oktavia.unknown ];
+ for (i = 3; i < charCodeCount; i++) {
+ charCode = Binary$load16bitNumber$SI(data, offset++);
+ this._compressCode2utf16.push(String.fromCharCode(charCode));
+ this._utf162compressCode[charCode] = String.fromCharCode(i);
+ }
+ stemmedWords = Binary$loadStringListMap$SI(data, offset);
+ this._stemmingResult = stemmedWords.result;
+ offset = stemmedWords.offset;
+ metadataCount = Binary$load16bitNumber$SI(data, offset++);
+ for (i = 0; i < metadataCount; i++) {
+ nameResult = Binary$loadString$SI(data, offset);
+ name = nameResult.result;
+ offset = nameResult.offset;
+ type = Binary$load16bitNumber$SI(data, offset++);
+ switch (type) {
+ case 0:
+ offset = Section$_load$LOktavia$SSI(this, name, data, offset);
+ break;
+ case 1:
+ offset = Splitter$_load$LOktavia$SSI(this, name, data, offset);
+ break;
+ case 2:
+ offset = Table$_load$LOktavia$SSI(this, name, data, offset);
+ break;
+ case 3:
+ offset = Block$_load$LOktavia$SSI(this, name, data, offset);
+ break;
+ }
+ }
+};
+
+/**
+ * @return {!number}
+ */
+Oktavia.prototype.contentSize$ = function () {
+ /** @type {FMIndex} */
+ var this$0;
+ this$0 = this._fmindex;
+ return this$0._substr.length;
+};
+
+/**
+ * @param {!number} position
+ * @return {!number}
+ */
+Oktavia.prototype.wordPositionType$I = function (position) {
+ /** @type {!number} */
+ var result;
+ /** @type {!string} */
+ var ahead;
+ result = 0;
+ if (position === 0) {
+ result = 4;
+ } else {
+ ahead = this._fmindex.getSubstring$II(position - 1, 1);
+ if (/\s/.test(ahead)) {
+ result = 2;
+ } else {
+ if (/\W/.test(ahead)) {
+ result = 1;
+ } else {
+ if (Oktavia.eob === ahead) {
+ result = 3;
+ }
+ }
+ }
+ }
+ return (result | 0);
+};
+
+/**
+ * @param {!number} position
+ * @param {!number} length
+ * @return {!string}
+ */
+Oktavia.prototype._getSubstring$II = function (position, length) {
+ /** @type {!string} */
+ var result;
+ /** @type {Array.<undefined|!string>} */
+ var str;
+ /** @type {!number} */
+ var i;
+ result = this._fmindex.getSubstring$II(position, length);
+ str = [ ];
+ for (i = 0; i < result.length; i++) {
+ str.push(this._compressCode2utf16[result.charCodeAt(i)]);
+ }
+ return str.join('');
+};
+
+/**
+ * class Binary extends Object
+ * @constructor
+ */
+function Binary() {
+}
+
+/**
+ * @constructor
+ */
+function Binary$() {
+};
+
+Binary$.prototype = new Binary;
+
+/**
+ * @param {!number} num
+ * @return {!string}
+ */
+Binary.dump32bitNumber$N = function (num) {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ result = [ String.fromCharCode(Math.floor(num / 65536)) ];
+ result.push(String.fromCharCode(num % 65536));
+ return result.join("");
+};
+
+var Binary$dump32bitNumber$N = Binary.dump32bitNumber$N;
+
+/**
+ * @param {!string} buffer
+ * @param {!number} offset
+ * @return {!number}
+ */
+Binary.load32bitNumber$SI = function (buffer, offset) {
+ /** @type {!number} */
+ var result;
+ result = buffer.charCodeAt(offset) * 65536 + buffer.charCodeAt(offset + 1);
+ return result;
+};
+
+var Binary$load32bitNumber$SI = Binary.load32bitNumber$SI;
+
+/**
+ * @param {!number} num
+ * @return {!string}
+ */
+Binary.dump16bitNumber$I = function (num) {
+ return String.fromCharCode(num % 65536);
+};
+
+var Binary$dump16bitNumber$I = Binary.dump16bitNumber$I;
+
+/**
+ * @param {!string} buffer
+ * @param {!number} offset
+ * @return {!number}
+ */
+Binary.load16bitNumber$SI = function (buffer, offset) {
+ return (buffer.charCodeAt(offset) | 0);
+};
+
+var Binary$load16bitNumber$SI = Binary.load16bitNumber$SI;
+
+/**
+ * @param {!string} str
+ * @return {!string}
+ */
+Binary.dumpString$S = function (str) {
+ return Binary$dumpString$SLCompressionReport$(str, null);
+};
+
+var Binary$dumpString$S = Binary.dumpString$S;
+
+/**
+ * @param {!string} str
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+Binary.dumpString$SLCompressionReport$ = function (str, report) {
+ /** @type {!number} */
+ var length;
+ /** @type {!boolean} */
+ var compress;
+ /** @type {Array.<undefined|!number>} */
+ var charCodes;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var charCode;
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {undefined|!number} */
+ var bytes;
+ if (str.length > 32768) {
+ str = str.slice(0, 32768);
+ }
+ length = str.length;
+ compress = true;
+ charCodes = [ ];
+ for (i = 0; i < length; i++) {
+ charCode = str.charCodeAt(i);
+ if (charCode > 255) {
+ compress = false;
+ break;
+ }
+ charCodes.push(charCode);
+ }
+ if (compress) {
+ result = [ Binary$dump16bitNumber$I(length + 32768) ];
+ for (i = 0; i < length; i += 2) {
+ bytes = charCodes[i];
+ if (i !== length - 1) {
+ bytes += charCodes[i + 1] << 8;
+ }
+ result.push(String.fromCharCode(bytes % 65536));
+ }
+ if (report) {
+ CompressionReport$add$LCompressionReport$II(report, length, Math.ceil(length / 2));
+ }
+ } else {
+ result = [ Binary$dump16bitNumber$I(length), str ];
+ if (report) {
+ CompressionReport$add$LCompressionReport$II(report, length, length);
+ }
+ }
+ return result.join('');
+};
+
+var Binary$dumpString$SLCompressionReport$ = Binary.dumpString$SLCompressionReport$;
+
+/**
+ * @param {!string} buffer
+ * @param {!number} offset
+ * @return {LoadedStringResult}
+ */
+Binary.loadString$SI = function (buffer, offset) {
+ return new LoadedStringResult$SI(buffer, offset);
+};
+
+var Binary$loadString$SI = Binary.loadString$SI;
+
+/**
+ * @param {Array.<undefined|!string>} strList
+ * @return {!string}
+ */
+Binary.dumpStringList$AS = function (strList) {
+ return Binary$dumpStringList$ASLCompressionReport$(strList, null);
+};
+
+var Binary$dumpStringList$AS = Binary.dumpStringList$AS;
+
+/**
+ * @param {Array.<undefined|!string>} strList
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+Binary.dumpStringList$ASLCompressionReport$ = function (strList, report) {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var i;
+ result = [ Binary$dump32bitNumber$N(strList.length) ];
+ for (i = 0; i < strList.length; i++) {
+ result.push(Binary$dumpString$SLCompressionReport$(strList[i], report));
+ }
+ return result.join('');
+};
+
+var Binary$dumpStringList$ASLCompressionReport$ = Binary.dumpStringList$ASLCompressionReport$;
+
+/**
+ * @param {!string} buffer
+ * @param {!number} offset
+ * @return {LoadedStringListResult}
+ */
+Binary.loadStringList$SI = function (buffer, offset) {
+ return new LoadedStringListResult$SI(buffer, offset);
+};
+
+var Binary$loadStringList$SI = Binary.loadStringList$SI;
+
+/**
+ * @param {Object.<string, undefined|Array.<undefined|!string>>} strMap
+ * @return {!string}
+ */
+Binary.dumpStringListMap$HAS = function (strMap) {
+ return Binary$dumpStringListMap$HASLCompressionReport$(strMap, null);
+};
+
+var Binary$dumpStringListMap$HAS = Binary.dumpStringListMap$HAS;
+
+/**
+ * @param {Object.<string, undefined|Array.<undefined|!string>>} strMap
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+Binary.dumpStringListMap$HASLCompressionReport$ = function (strMap, report) {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var counter;
+ /** @type {!string} */
+ var key;
+ result = [ ];
+ counter = 0;
+ for (key in strMap) {
+ result.push(Binary$dumpString$SLCompressionReport$(key, report));
+ result.push(Binary$dumpStringList$ASLCompressionReport$(strMap[key], report));
+ counter++;
+ }
+ return Binary$dump32bitNumber$N(counter) + result.join('');
+};
+
+var Binary$dumpStringListMap$HASLCompressionReport$ = Binary.dumpStringListMap$HASLCompressionReport$;
+
+/**
+ * @param {!string} buffer
+ * @param {!number} offset
+ * @return {LoadedStringListMapResult}
+ */
+Binary.loadStringListMap$SI = function (buffer, offset) {
+ return new LoadedStringListMapResult$SI(buffer, offset);
+};
+
+var Binary$loadStringListMap$SI = Binary.loadStringListMap$SI;
+
+/**
+ * @param {Array.<undefined|!number>} array
+ * @return {!string}
+ */
+Binary.dump32bitNumberList$AN = function (array) {
+ return Binary$dump32bitNumberList$ANLCompressionReport$(array, null);
+};
+
+var Binary$dump32bitNumberList$AN = Binary.dump32bitNumberList$AN;
+
+/**
+ * @param {Array.<undefined|!number>} array
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+Binary.dump32bitNumberList$ANLCompressionReport$ = function (array, report) {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var index;
+ /** @type {!number} */
+ var inputLength;
+ /** @type {!number} */
+ var length;
+ /** @type {!string} */
+ var resultString;
+ /** @type {!number} */
+ var value1$0;
+ /** @type {!number} */
+ var value2$0;
+ result = [ Binary$dump32bitNumber$N(array.length) ];
+ index = 0;
+ inputLength = array.length;
+ while (index < inputLength) {
+ if (array[index] == 0) {
+ length = Binary$_countZero$ANI(array, index);
+ result.push(Binary$_zeroBlock$I(length));
+ index += length;
+ } else {
+ if (Binary$_shouldZebraCode$ANI(array, index)) {
+ result.push(Binary$_createZebraCode$ANI(array, index));
+ value1$0 = array.length;
+ value2$0 = index + 15;
+ index = (value1$0 <= value2$0 ? value1$0 : value2$0);
+ } else {
+ length = Binary$_searchDoubleZero$ANI(array, index);
+ result.push(Binary$_nonZeroBlock$ANII(array, index, length));
+ if (length === 0) {
+ throw new Error('');
+ }
+ index += length;
+ }
+ }
+ }
+ resultString = result.join('');
+ if (report) {
+ CompressionReport$add$LCompressionReport$II(report, array.length * 2 + 2, resultString.length);
+ }
+ return resultString;
+};
+
+var Binary$dump32bitNumberList$ANLCompressionReport$ = Binary.dump32bitNumberList$ANLCompressionReport$;
+
+/**
+ * @param {!string} buffer
+ * @param {!number} offset
+ * @return {LoadedNumberListResult}
+ */
+Binary.load32bitNumberList$SI = function (buffer, offset) {
+ return new LoadedNumberListResult$SI(buffer, offset);
+};
+
+var Binary$load32bitNumberList$SI = Binary.load32bitNumberList$SI;
+
+/**
+ * @param {Array.<undefined|!number>} array
+ * @param {!number} offset
+ * @return {!number}
+ */
+Binary._countZero$ANI = function (array, offset) {
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var array$len$0;
+ for ((i = offset, array$len$0 = array.length); i < array$len$0; i++) {
+ if (array[i] != 0) {
+ return (i - offset | 0);
+ }
+ }
+ return (array.length - offset | 0);
+};
+
+var Binary$_countZero$ANI = Binary._countZero$ANI;
+
+/**
+ * @param {!number} length
+ * @return {!string}
+ */
+Binary._zeroBlock$I = function (length) {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ result = [ ];
+ while (length > 0) {
+ if (length > 16384) {
+ result.push(Binary$dump16bitNumber$I(16383));
+ length -= 16384;
+ } else {
+ result.push(Binary$dump16bitNumber$I(length - 1));
+ length = 0;
+ }
+ }
+ return result.join('');
+};
+
+var Binary$_zeroBlock$I = Binary._zeroBlock$I;
+
+/**
+ * @param {Array.<undefined|!number>} array
+ * @param {!number} offset
+ * @return {!boolean}
+ */
+Binary._shouldZebraCode$ANI = function (array, offset) {
+ /** @type {!number} */
+ var change;
+ /** @type {!boolean} */
+ var isLastZero;
+ /** @type {!number} */
+ var i;
+ if (array.length - offset < 16) {
+ return true;
+ }
+ change = 0;
+ isLastZero = false;
+ for (i = offset; i < offset + 15; i++) {
+ if (array[i] == 0) {
+ if (! isLastZero) {
+ isLastZero = true;
+ change++;
+ }
+ } else {
+ if (isLastZero) {
+ isLastZero = false;
+ change++;
+ }
+ }
+ }
+ return change > 2;
+};
+
+var Binary$_shouldZebraCode$ANI = Binary._shouldZebraCode$ANI;
+
+/**
+ * @param {Array.<undefined|!number>} array
+ * @param {!number} offset
+ * @return {!number}
+ */
+Binary._searchDoubleZero$ANI = function (array, offset) {
+ /** @type {!boolean} */
+ var isLastZero;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var array$len$0;
+ isLastZero = false;
+ for ((i = offset, array$len$0 = array.length); i < array$len$0; i++) {
+ if (array[i] == 0) {
+ if (isLastZero) {
+ return (i - offset - 1 | 0);
+ }
+ isLastZero = true;
+ } else {
+ isLastZero = false;
+ }
+ }
+ return (array.length - offset | 0);
+};
+
+var Binary$_searchDoubleZero$ANI = Binary._searchDoubleZero$ANI;
+
+/**
+ * @param {Array.<undefined|!number>} array
+ * @param {!number} offset
+ * @param {!number} length
+ * @return {!string}
+ */
+Binary._nonZeroBlock$ANII = function (array, offset, length) {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var blockLength;
+ /** @type {!number} */
+ var i;
+ result = [ ];
+ while (length > 0) {
+ if (length > 16384) {
+ blockLength = 16384;
+ length -= 16384;
+ } else {
+ blockLength = length;
+ length = 0;
+ }
+ result.push(Binary$dump16bitNumber$I(blockLength - 1 + 0x4000));
+ for (i = offset; i < offset + blockLength; i++) {
+ result.push(Binary$dump32bitNumber$N(array[i]));
+ }
+ offset += blockLength;
+ }
+ return result.join('');
+};
+
+var Binary$_nonZeroBlock$ANII = Binary._nonZeroBlock$ANII;
+
+/**
+ * @param {Array.<undefined|!number>} array
+ * @param {!number} offset
+ * @return {!string}
+ */
+Binary._createZebraCode$ANI = function (array, offset) {
+ /** @type {!number} */
+ var last;
+ /** @type {!number} */
+ var code;
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var value1$0;
+ /** @type {!number} */
+ var value2$0;
+ value1$0 = offset + 15;
+ value2$0 = array.length;
+ last = (value1$0 <= value2$0 ? value1$0 : value2$0);
+ code = 0x8000;
+ result = [ ];
+ for (i = offset; i < last; i++) {
+ if (array[i] != 0) {
+ result.push(Binary$dump32bitNumber$N(array[i]));
+ code = code + (0x1 << i - offset);
+ }
+ }
+ return String.fromCharCode(code) + result.join('');
+};
+
+var Binary$_createZebraCode$ANI = Binary._createZebraCode$ANI;
+
+/**
+ * @param {!string} str
+ * @return {!string}
+ */
+Binary.base64encode$S = function (str) {
+ /** @type {Array.<undefined|!string>} */
+ var out;
+ /** @type {Array.<undefined|!number>} */
+ var source;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var code;
+ /** @type {!number} */
+ var len;
+ /** @type {!number} */
+ var c1;
+ /** @type {undefined|!number} */
+ var c2;
+ /** @type {undefined|!number} */
+ var c3;
+ out = [ ];
+ source = [ ];
+ for (i = 0; i < str.length; i++) {
+ code = str.charCodeAt(i);
+ source.push(code & 0x00ff, code >>> 8);
+ }
+ len = str.length * 2;
+ i = 0;
+ while (i < len) {
+ c1 = source[i++] & 0xff;
+ if (i === len) {
+ out.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(c1 >> 2));
+ out.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((c1 & 0x3) << 4));
+ out.push("==");
+ break;
+ }
+ c2 = source[i++];
+ if (i === len) {
+ out.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(c1 >> 2));
+ out.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((c1 & 0x3) << 4 | (c2 & 0xF0) >> 4));
+ out.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((c2 & 0xF) << 2));
+ out.push("=");
+ break;
+ }
+ c3 = source[i++];
+ out.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(c1 >> 2));
+ out.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((c1 & 0x3) << 4 | (c2 & 0xF0) >> 4));
+ out.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((c2 & 0xF) << 2 | (c3 & 0xC0) >> 6));
+ out.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(c3 & 0x3F));
+ }
+ return out.join('');
+};
+
+var Binary$base64encode$S = Binary.base64encode$S;
+
+/**
+ * @param {Array.<undefined|!number>} source
+ * @return {!string}
+ */
+Binary._mergeCharCode$AI = function (source) {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var i;
+ result = [ ];
+ for (i = 0; i < source.length; i += 2) {
+ result.push(String.fromCharCode(source[i] + (source[i + 1] << 8)));
+ }
+ return result.join('');
+};
+
+var Binary$_mergeCharCode$AI = Binary._mergeCharCode$AI;
+
+/**
+ * @param {!string} str
+ * @return {!string}
+ */
+Binary.base64decode$S = function (str) {
+ /** @type {!number} */
+ var len;
+ /** @type {!number} */
+ var i;
+ /** @type {Array.<undefined|!number>} */
+ var out;
+ /** @type {undefined|!number} */
+ var c1;
+ /** @type {undefined|!number} */
+ var c2;
+ /** @type {!number} */
+ var c3;
+ /** @type {!number} */
+ var c4;
+ len = str.length;
+ i = 0;
+ out = [ ];
+ while (i < len) {
+ do {
+ c1 = Binary._base64DecodeChars[str.charCodeAt(i++) & 0xff];
+ } while (i < len && c1 == -1);
+ if (c1 == -1) {
+ break;
+ }
+ do {
+ c2 = Binary._base64DecodeChars[str.charCodeAt(i++) & 0xff];
+ } while (i < len && c2 == -1);
+ if (c2 == -1) {
+ break;
+ }
+ out.push(c1 << 2 | (c2 & 0x30) >> 4);
+ do {
+ c3 = str.charCodeAt(i++) & 0xff;
+ if (c3 === 61) {
+ return Binary$_mergeCharCode$AI(out);
+ }
+ c3 = Binary._base64DecodeChars[c3];
+ } while (i < len && c3 === -1);
+ if (c3 === -1) {
+ break;
+ }
+ out.push((c2 & 0XF) << 4 | (c3 & 0x3C) >> 2);
+ do {
+ c4 = str.charCodeAt(i++) & 0xff;
+ if (c4 === 61) {
+ return Binary$_mergeCharCode$AI(out);
+ }
+ c4 = (Binary._base64DecodeChars[c4] | 0);
+ } while (i < len && c4 === -1);
+ if (c4 === -1) {
+ break;
+ }
+ out.push((c3 & 0x03) << 6 | c4);
+ }
+ return Binary$_mergeCharCode$AI(out);
+};
+
+var Binary$base64decode$S = Binary.base64decode$S;
+
+/**
+ * class LoadedStringResult extends Object
+ * @constructor
+ */
+function LoadedStringResult() {
+}
+
+/**
+ * @constructor
+ * @param {!string} data
+ * @param {!number} offset
+ */
+function LoadedStringResult$SI(data, offset) {
+ /** @type {!number} */
+ var strLength;
+ /** @type {Array.<undefined|!string>} */
+ var bytes;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var code;
+ /** @type {!number} */
+ var offset$0;
+ this.result = "";
+ this.offset = 0;
+ offset$0 = offset++;
+ strLength = data.charCodeAt(offset$0);
+ if (strLength > 32767) {
+ strLength = strLength - 32768;
+ bytes = [ ];
+ for (i = 0; i < strLength; i += 2) {
+ code = data.charCodeAt(offset);
+ bytes.push(String.fromCharCode(code & 0x00ff));
+ if (i !== strLength - 1) {
+ bytes.push(String.fromCharCode(code >>> 8));
+ }
+ offset++;
+ }
+ this.result = bytes.join('');
+ this.offset = offset;
+ } else {
+ this.result = data.slice(offset, offset + strLength);
+ this.offset = (offset + strLength | 0);
+ }
+};
+
+LoadedStringResult$SI.prototype = new LoadedStringResult;
+
+/**
+ * class LoadedStringListResult extends Object
+ * @constructor
+ */
+function LoadedStringListResult() {
+}
+
+/**
+ * @constructor
+ * @param {!string} data
+ * @param {!number} offset
+ */
+function LoadedStringListResult$SI(data, offset) {
+ /** @type {!number} */
+ var length;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var strLength;
+ /** @type {!string} */
+ var resultStr;
+ /** @type {Array.<undefined|!string>} */
+ var bytes;
+ /** @type {!number} */
+ var j;
+ /** @type {!number} */
+ var code;
+ /** @type {!number} */
+ var result$0;
+ /** @type {!number} */
+ var offset$0;
+ this.offset = 0;
+ this.result = [ ];
+ result$0 = data.charCodeAt(offset) * 65536 + data.charCodeAt(offset + 1);
+ length = result$0;
+ offset += 2;
+ for (i = 0; i < length; i++) {
+ offset$0 = offset++;
+ strLength = data.charCodeAt(offset$0);
+ if (strLength > 32767) {
+ strLength = strLength - 32768;
+ bytes = [ ];
+ for (j = 0; j < strLength; j += 2) {
+ code = data.charCodeAt(offset);
+ bytes.push(String.fromCharCode(code & 0x00ff));
+ if (j !== strLength - 1) {
+ bytes.push(String.fromCharCode(code >>> 8));
+ }
+ offset++;
+ }
+ resultStr = bytes.join('');
+ } else {
+ resultStr = data.slice(offset, offset + strLength);
+ offset = (offset + strLength | 0);
+ }
+ this.result.push(resultStr);
+ }
+ this.offset = offset;
+};
+
+LoadedStringListResult$SI.prototype = new LoadedStringListResult;
+
+/**
+ * class LoadedStringListMapResult extends Object
+ * @constructor
+ */
+function LoadedStringListMapResult() {
+}
+
+/**
+ * @constructor
+ * @param {!string} data
+ * @param {!number} offset
+ */
+function LoadedStringListMapResult$SI(data, offset) {
+ /** @type {!number} */
+ var length;
+ /** @type {!number} */
+ var i;
+ /** @type {LoadedStringResult} */
+ var keyResult;
+ /** @type {LoadedStringListResult} */
+ var valueResult;
+ /** @type {!number} */
+ var result$0;
+ /** @type {!number} */
+ var offset$0;
+ this.offset = 0;
+ this.result = ({ });
+ result$0 = data.charCodeAt(offset) * 65536 + data.charCodeAt(offset + 1);
+ length = result$0;
+ offset += 2;
+ for (i = 0; i < length; i++) {
+ keyResult = new LoadedStringResult$SI(data, offset);
+ offset$0 = keyResult.offset;
+ valueResult = new LoadedStringListResult$SI(data, offset$0);
+ this.result[keyResult.result] = valueResult.result;
+ offset = valueResult.offset;
+ }
+ this.offset = offset;
+};
+
+LoadedStringListMapResult$SI.prototype = new LoadedStringListMapResult;
+
+/**
+ * class LoadedNumberListResult extends Object
+ * @constructor
+ */
+function LoadedNumberListResult() {
+}
+
+/**
+ * @constructor
+ * @param {!string} data
+ * @param {!number} offset
+ */
+function LoadedNumberListResult$SI(data, offset) {
+ /** @type {!number} */
+ var resultLength;
+ /** @type {!number} */
+ var originalOffset;
+ /** @type {Array.<undefined|!number>} */
+ var result;
+ /** @type {!number} */
+ var tag;
+ /** @type {!number} */
+ var length;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var result$0;
+ /** @type {!number} */
+ var value1$0;
+ this.result = null;
+ this.offset = 0;
+ result$0 = data.charCodeAt(offset) * 65536 + data.charCodeAt(offset + 1);
+ resultLength = result$0;
+ originalOffset = offset;
+ offset += 2;
+ result = [ ];
+ while (result.length < resultLength) {
+ tag = data.charCodeAt(offset++);
+ if (tag >>> 15 === 1) {
+ value1$0 = resultLength - result.length;
+ length = (value1$0 <= 15 ? value1$0 : 15);
+ for (i = 0; i < length; i++) {
+ if (tag >>> i & 0x1) {
+ result.push(Binary$load32bitNumber$SI(data, offset));
+ offset += 2;
+ } else {
+ result.push(0);
+ }
+ }
+ } else {
+ if (tag >>> 14 === 1) {
+ length = tag - 0x4000 + 1;
+ for (i = 0; i < length; i++) {
+ result.push(Binary$load32bitNumber$SI(data, offset));
+ offset += 2;
+ }
+ } else {
+ length = tag + 1;
+ for (i = 0; i < length; i++) {
+ result.push(0);
+ }
+ }
+ }
+ }
+ this.result = result;
+ this.offset = offset;
+};
+
+LoadedNumberListResult$SI.prototype = new LoadedNumberListResult;
+
+/**
+ * class CompressionReport extends Object
+ * @constructor
+ */
+function CompressionReport() {
+}
+
+/**
+ * @constructor
+ */
+function CompressionReport$() {
+ this.source = 0;
+ this.result = 0;
+};
+
+CompressionReport$.prototype = new CompressionReport;
+
+/**
+ * @param {CompressionReport} $this
+ * @param {!number} source
+ * @param {!number} result
+ */
+CompressionReport.add$LCompressionReport$II = function ($this, source, result) {
+ $this.source += source;
+ $this.result += result;
+};
+
+var CompressionReport$add$LCompressionReport$II = CompressionReport.add$LCompressionReport$II;
+
+/**
+ * @param {CompressionReport} $this
+ * @return {!number}
+ */
+CompressionReport.rate$LCompressionReport$ = function ($this) {
+ return (Math.round($this.result * 100.0 / $this.source) | 0);
+};
+
+var CompressionReport$rate$LCompressionReport$ = CompressionReport.rate$LCompressionReport$;
+
+/**
+ * class Query extends Object
+ * @constructor
+ */
+function Query() {
+}
+
+/**
+ * @constructor
+ */
+function Query$() {
+ this.word = '';
+ this.or = false;
+ this.not = false;
+ this.raw = false;
+};
+
+Query$.prototype = new Query;
+
+/**
+ * @return {!string}
+ */
+Query.prototype.toString = function () {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ result = [ ];
+ if (this.or) {
+ result.push("OR ");
+ }
+ if (this.not) {
+ result.push("-");
+ }
+ if (this.raw) {
+ result.push('"', this.word, '"');
+ } else {
+ result.push(this.word);
+ }
+ return result.join('');
+};
+
+/**
+ * class QueryStringParser extends Object
+ * @constructor
+ */
+function QueryStringParser() {
+}
+
+/**
+ * @constructor
+ */
+function QueryStringParser$() {
+ this.queries = [ ];
+};
+
+QueryStringParser$.prototype = new QueryStringParser;
+
+/**
+ * @param {QueryStringParser} $this
+ * @param {!string} queryString
+ * @return {Array.<undefined|Query>}
+ */
+QueryStringParser.parse$LQueryStringParser$S = function ($this, queryString) {
+ /** @type {!boolean} */
+ var nextOr;
+ /** @type {!boolean} */
+ var nextNot;
+ /** @type {!number} */
+ var currentWordStart;
+ /** @type {!number} */
+ var status;
+ /** @type {RegExp} */
+ var isSpace;
+ /** @type {!number} */
+ var i;
+ /** @type {!string} */
+ var ch;
+ /** @type {!string} */
+ var word;
+ /** @type {Query} */
+ var query;
+ nextOr = false;
+ nextNot = false;
+ currentWordStart = 0;
+ status = 0;
+ isSpace = /[\s\u3000]/;
+ for (i = 0; i < queryString.length; i++) {
+ ch = queryString.charAt(i);
+ switch (status) {
+ case 0:
+ if (! isSpace.test(ch)) {
+ if (ch === '-') {
+ nextNot = true;
+ } else {
+ if (ch === '"') {
+ currentWordStart = i + 1;
+ status = 2;
+ } else {
+ currentWordStart = i;
+ status = 1;
+ }
+ }
+ } else {
+ nextNot = false;
+ }
+ break;
+ case 1:
+ if (isSpace.test(ch)) {
+ word = queryString.slice(currentWordStart, i);
+ if (word === 'OR') {
+ nextOr = true;
+ } else {
+ query = new Query$();
+ query.word = word;
+ query.or = nextOr;
+ query.not = nextNot;
+ $this.queries.push(query);
+ nextOr = false;
+ nextNot = false;
+ }
+ status = 0;
+ }
+ break;
+ case 2:
+ if (ch === '"') {
+ word = queryString.slice(currentWordStart, i);
+ query = new Query$();
+ query.word = word;
+ query.or = nextOr;
+ query.not = nextNot;
+ query.raw = true;
+ $this.queries.push(query);
+ nextOr = false;
+ nextNot = false;
+ status = 0;
+ }
+ break;
+ }
+ }
+ switch (status) {
+ case 0:
+ break;
+ case 1:
+ query = new Query$();
+ word = queryString.slice(currentWordStart, queryString.length);
+ if (word !== 'OR') {
+ query.word = word;
+ query.or = nextOr;
+ query.not = nextNot;
+ $this.queries.push(query);
+ }
+ break;
+ case 2:
+ query = new Query$();
+ query.word = queryString.slice(currentWordStart, queryString.length);
+ query.or = nextOr;
+ query.not = nextNot;
+ query.raw = true;
+ $this.queries.push(query);
+ break;
+ }
+ return $this.queries;
+};
+
+var QueryStringParser$parse$LQueryStringParser$S = QueryStringParser.parse$LQueryStringParser$S;
+
+/**
+ * @param {QueryStringParser} $this
+ * @return {!string}
+ */
+QueryStringParser.highlight$LQueryStringParser$ = function ($this) {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var i;
+ /** @type {Query} */
+ var query;
+ result = [ ];
+ for (i = 0; i < $this.queries.length; i++) {
+ query = $this.queries[i];
+ if (! query.not) {
+ result.push("highlight=" + $__jsx_encodeURIComponent(query.word));
+ }
+ }
+ return '?' + result.join('&');
+};
+
+var QueryStringParser$highlight$LQueryStringParser$ = QueryStringParser.highlight$LQueryStringParser$;
+
+/**
+ * class Proposal extends Object
+ * @constructor
+ */
+function Proposal() {
+}
+
+/**
+ * @constructor
+ * @param {!number} omit
+ * @param {!number} expect
+ */
+function Proposal$II(omit, expect) {
+ this.omit = omit;
+ this.expect = expect;
+};
+
+Proposal$II.prototype = new Proposal;
+
+/**
+ * class Position extends Object
+ * @constructor
+ */
+function Position() {
+}
+
+/**
+ * @constructor
+ * @param {!string} word
+ * @param {!number} position
+ * @param {!boolean} stemmed
+ */
+function Position$SIB(word, position, stemmed) {
+ this.word = word;
+ this.position = position;
+ this.stemmed = stemmed;
+};
+
+Position$SIB.prototype = new Position;
+
+/**
+ * class SearchUnit extends Object
+ * @constructor
+ */
+function SearchUnit() {
+}
+
+/**
+ * @constructor
+ * @param {!number} id
+ */
+function SearchUnit$I(id) {
+ this.positions = ({ });
+ this.id = id;
+ this._size = 0;
+ this.score = 0;
+ this.startPosition = -1;
+};
+
+SearchUnit$I.prototype = new SearchUnit;
+
+/**
+ * @param {SearchUnit} $this
+ * @param {!string} word
+ * @param {!number} position
+ * @param {!boolean} stemmed
+ */
+SearchUnit.addPosition$LSearchUnit$SIB = function ($this, word, position, stemmed) {
+ /** @type {Position} */
+ var positionObj;
+ positionObj = $this.positions[position + ""];
+ if (! positionObj) {
+ $this._size++;
+ $this.positions[position + ""] = ({word: word, position: position, stemmed: stemmed});
+ } else {
+ if (positionObj.word.length < word.length) {
+ positionObj.word = word;
+ }
+ positionObj.stemmed = positionObj.stemmed && stemmed;
+ }
+};
+
+var SearchUnit$addPosition$LSearchUnit$SIB = SearchUnit.addPosition$LSearchUnit$SIB;
+
+/**
+ * @param {SearchUnit} $this
+ * @param {!number} position
+ * @return {Position}
+ */
+SearchUnit.get$LSearchUnit$I = function ($this, position) {
+ return $this.positions[position + ""];
+};
+
+var SearchUnit$get$LSearchUnit$I = SearchUnit.get$LSearchUnit$I;
+
+/**
+ * @param {SearchUnit} $this
+ * @return {!number}
+ */
+SearchUnit.size$LSearchUnit$ = function ($this) {
+ return $this._size;
+};
+
+var SearchUnit$size$LSearchUnit$ = SearchUnit.size$LSearchUnit$;
+
+/**
+ * @param {SearchUnit} $this
+ * @param {SearchUnit} rhs
+ */
+SearchUnit.merge$LSearchUnit$LSearchUnit$ = function ($this, rhs) {
+ /** @type {!string} */
+ var position;
+ /** @type {Position} */
+ var pos;
+ for (position in rhs.positions) {
+ pos = rhs.positions[position];
+ SearchUnit$addPosition$LSearchUnit$SIB($this, pos.word, pos.position, pos.stemmed);
+ }
+};
+
+var SearchUnit$merge$LSearchUnit$LSearchUnit$ = SearchUnit.merge$LSearchUnit$LSearchUnit$;
+
+/**
+ * @param {SearchUnit} $this
+ * @return {Array.<undefined|Position>}
+ */
+SearchUnit.getPositions$LSearchUnit$ = function ($this) {
+ /** @type {Array.<undefined|Position>} */
+ var result;
+ /** @type {!string} */
+ var pos;
+ result = [ ];
+ for (pos in $this.positions) {
+ result.push($this.positions[pos]);
+ }
+ result.sort((function (a, b) {
+ return a.position - b.position;
+ }));
+ return result;
+};
+
+var SearchUnit$getPositions$LSearchUnit$ = SearchUnit.getPositions$LSearchUnit$;
+
+/**
+ * class SingleResult extends Object
+ * @constructor
+ */
+function SingleResult() {
+}
+
+/**
+ * @constructor
+ */
+function SingleResult$() {
+ this.units = [ ];
+ this.unitIds = [ ];
+ this.or = false;
+ this.not = false;
+ this.searchWord = '';
+};
+
+SingleResult$.prototype = new SingleResult;
+
+/**
+ * @constructor
+ * @param {!string} searchWord
+ * @param {!boolean} or
+ * @param {!boolean} not
+ */
+function SingleResult$SBB(searchWord, or, not) {
+ this.units = [ ];
+ this.unitIds = [ ];
+ this.or = or;
+ this.not = not;
+ this.searchWord = searchWord;
+};
+
+SingleResult$SBB.prototype = new SingleResult;
+
+/**
+ * @param {SingleResult} $this
+ * @param {!number} unitId
+ * @return {SearchUnit}
+ */
+SingleResult.getSearchUnit$LSingleResult$I = function ($this, unitId) {
+ /** @type {!number} */
+ var existing;
+ /** @type {SearchUnit} */
+ var result;
+ existing = $this.unitIds.indexOf(unitId);
+ if (existing === -1) {
+ result = ({positions: ({ }), id: unitId, _size: 0, score: 0, startPosition: -1});
+ $this.units.push(result);
+ $this.unitIds.push(unitId);
+ } else {
+ result = $this.units[existing];
+ }
+ return result;
+};
+
+var SingleResult$getSearchUnit$LSingleResult$I = SingleResult.getSearchUnit$LSingleResult$I;
+
+/**
+ * @param {SingleResult} $this
+ * @param {SingleResult} rhs
+ * @return {SingleResult}
+ */
+SingleResult.merge$LSingleResult$LSingleResult$ = function ($this, rhs) {
+ /** @type {SingleResult} */
+ var result;
+ result = ({units: [ ], unitIds: [ ], or: false, not: false, searchWord: ''});
+ if (rhs.or) {
+ SingleResult$_orMerge$LSingleResult$LSingleResult$LSingleResult$($this, result, rhs);
+ } else {
+ if (rhs.not) {
+ SingleResult$_notMerge$LSingleResult$LSingleResult$LSingleResult$($this, result, rhs);
+ } else {
+ SingleResult$_andMerge$LSingleResult$LSingleResult$LSingleResult$($this, result, rhs);
+ }
+ }
+ return result;
+};
+
+var SingleResult$merge$LSingleResult$LSingleResult$ = SingleResult.merge$LSingleResult$LSingleResult$;
+
+/**
+ * @param {SingleResult} $this
+ * @return {!number}
+ */
+SingleResult.size$LSingleResult$ = function ($this) {
+ return ($this.units.length | 0);
+};
+
+var SingleResult$size$LSingleResult$ = SingleResult.size$LSingleResult$;
+
+/**
+ * @param {SingleResult} $this
+ * @param {SingleResult} result
+ * @param {SingleResult} rhs
+ */
+SingleResult._andMerge$LSingleResult$LSingleResult$LSingleResult$ = function ($this, result, rhs) {
+ /** @type {!number} */
+ var i;
+ /** @type {undefined|!number} */
+ var id;
+ /** @type {SearchUnit} */
+ var lhsSection;
+ for (i = 0; i < $this.unitIds.length; i++) {
+ id = $this.unitIds[i];
+ if (rhs.unitIds.indexOf(id) !== -1) {
+ lhsSection = $this.units[i];
+ result.unitIds.push(id);
+ result.units.push(lhsSection);
+ }
+ }
+};
+
+var SingleResult$_andMerge$LSingleResult$LSingleResult$LSingleResult$ = SingleResult._andMerge$LSingleResult$LSingleResult$LSingleResult$;
+
+/**
+ * @param {SingleResult} $this
+ * @param {SingleResult} result
+ * @param {SingleResult} rhs
+ */
+SingleResult._orMerge$LSingleResult$LSingleResult$LSingleResult$ = function ($this, result, rhs) {
+ /** @type {!number} */
+ var i;
+ /** @type {undefined|!number} */
+ var id;
+ /** @type {SearchUnit} */
+ var rhsSection;
+ /** @type {SearchUnit} */
+ var lhsSection;
+ /** @type {Array.<undefined|!number>} */
+ var unitIds$0;
+ /** @type {Array.<undefined|SearchUnit>} */
+ var units$0;
+ result.unitIds = (unitIds$0 = $this.unitIds).slice(0, unitIds$0.length);
+ result.units = (units$0 = $this.units).slice(0, units$0.length);
+ for (i = 0; i < rhs.unitIds.length; i++) {
+ id = rhs.unitIds[i];
+ rhsSection = rhs.units[i];
+ if (result.unitIds.indexOf(id) !== -1) {
+ lhsSection = result.units[result.unitIds.indexOf(id)];
+ SearchUnit$merge$LSearchUnit$LSearchUnit$(lhsSection, rhsSection);
+ } else {
+ result.unitIds.push(id);
+ result.units.push(rhsSection);
+ }
+ }
+};
+
+var SingleResult$_orMerge$LSingleResult$LSingleResult$LSingleResult$ = SingleResult._orMerge$LSingleResult$LSingleResult$LSingleResult$;
+
+/**
+ * @param {SingleResult} $this
+ * @param {SingleResult} result
+ * @param {SingleResult} rhs
+ */
+SingleResult._notMerge$LSingleResult$LSingleResult$LSingleResult$ = function ($this, result, rhs) {
+ /** @type {!number} */
+ var i;
+ /** @type {undefined|!number} */
+ var id;
+ /** @type {SearchUnit} */
+ var lhsSection;
+ for (i = 0; i < $this.unitIds.length; i++) {
+ id = $this.unitIds[i];
+ if (rhs.unitIds.indexOf(id) === -1) {
+ lhsSection = $this.units[i];
+ result.unitIds.push(id);
+ result.units.push(lhsSection);
+ }
+ }
+};
+
+var SingleResult$_notMerge$LSingleResult$LSingleResult$LSingleResult$ = SingleResult._notMerge$LSingleResult$LSingleResult$LSingleResult$;
+
+/**
+ * class SearchSummary extends Object
+ * @constructor
+ */
+function SearchSummary() {
+}
+
+/**
+ * @constructor
+ */
+function SearchSummary$() {
+ this.sourceResults = [ ];
+ this.result = null;
+ this.oktavia = null;
+};
+
+SearchSummary$.prototype = new SearchSummary;
+
+/**
+ * @constructor
+ * @param {Oktavia} oktavia
+ */
+function SearchSummary$LOktavia$(oktavia) {
+ this.sourceResults = [ ];
+ this.result = null;
+ this.oktavia = oktavia;
+};
+
+SearchSummary$LOktavia$.prototype = new SearchSummary;
+
+/**
+ * @param {SearchSummary} $this
+ * @param {SingleResult} result
+ */
+SearchSummary.addQuery$LSearchSummary$LSingleResult$ = function ($this, result) {
+ $this.sourceResults.push(result);
+};
+
+var SearchSummary$addQuery$LSearchSummary$LSingleResult$ = SearchSummary.addQuery$LSearchSummary$LSingleResult$;
+
+/**
+ * @param {SearchSummary} $this
+ */
+SearchSummary.mergeResult$LSearchSummary$ = function ($this) {
+ $this.result = SearchSummary$mergeResult$LSearchSummary$ALSingleResult$($this, $this.sourceResults);
+};
+
+var SearchSummary$mergeResult$LSearchSummary$ = SearchSummary.mergeResult$LSearchSummary$;
+
+/**
+ * @param {SearchSummary} $this
+ * @param {Array.<undefined|SingleResult>} results
+ * @return {SingleResult}
+ */
+SearchSummary.mergeResult$LSearchSummary$ALSingleResult$ = function ($this, results) {
+ /** @type {SingleResult} */
+ var rhs;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var results$len$0;
+ rhs = results[0];
+ for ((i = 1, results$len$0 = results.length); i < results$len$0; i++) {
+ rhs = SingleResult$merge$LSingleResult$LSingleResult$(rhs, results[i]);
+ }
+ return rhs;
+};
+
+var SearchSummary$mergeResult$LSearchSummary$ALSingleResult$ = SearchSummary.mergeResult$LSearchSummary$ALSingleResult$;
+
+/**
+ * @param {SearchSummary} $this
+ * @return {Array.<undefined|Proposal>}
+ */
+SearchSummary.getProposal$LSearchSummary$ = function ($this) {
+ /** @type {Array.<undefined|Proposal>} */
+ var proposals;
+ /** @type {!number} */
+ var i;
+ /** @type {Array.<undefined|SingleResult>} */
+ var tmpSource;
+ /** @type {!number} */
+ var j;
+ /** @type {SingleResult} */
+ var result;
+ proposals = [ ];
+ for (i = 0; i < $this.sourceResults.length; i++) {
+ tmpSource = [ ];
+ for (j = 0; j < $this.sourceResults.length; j++) {
+ if (i !== j) {
+ tmpSource.push($this.sourceResults[j]);
+ }
+ }
+ result = SearchSummary$mergeResult$LSearchSummary$ALSingleResult$($this, tmpSource);
+ proposals.push(({omit: i, expect: result.units.length}));
+ }
+ proposals.sort((function (a, b) {
+ return b.expect - a.expect;
+ }));
+ return proposals;
+};
+
+var SearchSummary$getProposal$LSearchSummary$ = SearchSummary.getProposal$LSearchSummary$;
+
+/**
+ * @param {SearchSummary} $this
+ * @return {Array.<undefined|SearchUnit>}
+ */
+SearchSummary.getSortedResult$LSearchSummary$ = function ($this) {
+ /** @type {Array.<undefined|SearchUnit>} */
+ var result;
+ /** @type {Array.<undefined|SearchUnit>} */
+ var units$0;
+ result = (units$0 = $this.result.units).slice(0, units$0.length);
+ result.sort((function (a, b) {
+ return b.score - a.score;
+ }));
+ return result;
+};
+
+var SearchSummary$getSortedResult$LSearchSummary$ = SearchSummary.getSortedResult$LSearchSummary$;
+
+/**
+ * @param {SearchSummary} $this
+ * @return {!number}
+ */
+SearchSummary.size$LSearchSummary$ = function ($this) {
+ /** @type {SingleResult} */
+ var this$0;
+ this$0 = $this.result;
+ return (this$0.units.length | 0);
+};
+
+var SearchSummary$size$LSearchSummary$ = SearchSummary.size$LSearchSummary$;
+
+/**
+ * @param {SearchSummary} $this
+ * @param {SingleResult} result
+ */
+SearchSummary.add$LSearchSummary$LSingleResult$ = function ($this, result) {
+ $this.sourceResults.push(result);
+};
+
+var SearchSummary$add$LSearchSummary$LSingleResult$ = SearchSummary.add$LSearchSummary$LSingleResult$;
+
+/**
+ * class Style extends Object
+ * @constructor
+ */
+function Style() {
+}
+
+/**
+ * @constructor
+ * @param {!string} mode
+ */
+function Style$S(mode) {
+ this.styles = null;
+ this.escapeHTML = false;
+ switch (mode) {
+ case 'console':
+ this.styles = Style.console;
+ break;
+ case 'html':
+ this.styles = Style.html;
+ break;
+ case 'ignore':
+ this.styles = Style.ignore;
+ break;
+ default:
+ this.styles = Style.ignore;
+ break;
+ }
+ this.escapeHTML = mode === 'html';
+};
+
+Style$S.prototype = new Style;
+
+/**
+ * @param {!string} source
+ * @return {!string}
+ */
+Style.prototype.convert$S = function (source) {
+ /** @type {_HTMLHandler} */
+ var handler;
+ /** @type {SAXParser} */
+ var parser;
+ handler = new _HTMLHandler$HASB(this.styles, this.escapeHTML);
+ parser = new SAXParser$LSAXHandler$(handler);
+ parser.parse$S(source);
+ return handler.text.join('');
+};
+
+/**
+ * class Stemmer
+ * @constructor
+ */
+function Stemmer() {
+}
+
+Stemmer.prototype.$__jsx_implements_Stemmer = true;
+
+/**
+ * @constructor
+ */
+function Stemmer$() {
+};
+
+Stemmer$.prototype = new Stemmer;
+
+/**
+ * class Metadata extends Object
+ * @constructor
+ */
+function Metadata() {
+}
+
+/**
+ * @constructor
+ * @param {Oktavia} parent
+ */
+function Metadata$LOktavia$(parent) {
+ this._parent = parent;
+ this._bitVector = new BitVector$();
+};
+
+Metadata$LOktavia$.prototype = new Metadata;
+
+/**
+ * @return {!number}
+ */
+Metadata.prototype._size$ = function () {
+ /** @type {BitVector} */
+ var this$0;
+ /** @type {!number} */
+ var i$0;
+ /** @type {BitVector} */
+ var _bitVector$0;
+ this$0 = _bitVector$0 = this._bitVector;
+ i$0 = _bitVector$0._size;
+ return this$0.rank$IB(i$0, true);
+};
+
+/**
+ * @param {!number} index
+ * @return {!string}
+ */
+Metadata.prototype.getContent$I = function (index) {
+ /** @type {!number} */
+ var startPosition;
+ /** @type {!number} */
+ var length;
+ if (index < 0 || this._size$() <= index) {
+ throw new Error("Section.getContent() : range error " + (index + ""));
+ }
+ startPosition = 0;
+ if (index > 0) {
+ startPosition = this._bitVector.select$I(index - 1) + 1;
+ }
+ length = this._bitVector.select$I(index) - startPosition + 1;
+ return this._parent._getSubstring$II(startPosition, length);
+};
+
+/**
+ * @param {!number} index
+ * @return {!number}
+ */
+Metadata.prototype.getStartPosition$I = function (index) {
+ /** @type {!number} */
+ var startPosition;
+ if (index < 0 || this._size$() <= index) {
+ throw new Error("Section.getContent() : range error " + (index + ""));
+ }
+ startPosition = 0;
+ if (index > 0) {
+ startPosition = this._bitVector.select$I(index - 1) + 1;
+ }
+ return (startPosition | 0);
+};
+
+/**
+ * @param {SingleResult} result
+ * @param {Array.<undefined|!number>} positions
+ * @param {!string} word
+ * @param {!boolean} stemmed
+ */
+Metadata.prototype.grouping$LSingleResult$AISB = function (result, positions, word, stemmed) {
+};
+
+/**
+ * @param {!number} index
+ * @return {!string}
+ */
+Metadata.prototype.getInformation$I = function (index) {
+ return '';
+};
+
+/**
+ */
+Metadata.prototype._build$ = function () {
+ this._bitVector.build$();
+};
+
+/**
+ * @param {!string} name
+ * @param {!string} data
+ * @param {!number} offset
+ * @return {!number}
+ */
+Metadata.prototype._load$SSI = function (name, data, offset) {
+ offset = this._bitVector.load$SI(data, offset);
+ this._parent._metadataLabels.push(name);
+ this._parent._metadatas[name] = this;
+ return offset;
+};
+
+/**
+ * @return {!string}
+ */
+Metadata.prototype._dump$ = function () {
+ /** @type {BitVector} */
+ var this$0;
+ /** @type {Array.<undefined|!string>} */
+ var contents$0;
+ this$0 = this._bitVector;
+ contents$0 = [ ];
+ contents$0.push(Binary$dump32bitNumber$N(this$0._size));
+ contents$0.push(Binary$dump32bitNumberList$AN(this$0._v));
+ return contents$0.join('');
+};
+
+/**
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+Metadata.prototype._dump$LCompressionReport$ = function (report) {
+ /** @type {BitVector} */
+ var this$0;
+ /** @type {Array.<undefined|!string>} */
+ var contents$0;
+ this$0 = this._bitVector;
+ contents$0 = [ ];
+ contents$0.push(Binary$dump32bitNumber$N(this$0._size));
+ CompressionReport$add$LCompressionReport$II(report, 2, 2);
+ contents$0.push(Binary$dump32bitNumberList$ANLCompressionReport$(this$0._v, report));
+ return contents$0.join('');
+};
+
+/**
+ * class Section extends Metadata
+ * @constructor
+ */
+function Section() {
+}
+
+Section.prototype = new Metadata;
+/**
+ * @constructor
+ * @param {Oktavia} parent
+ */
+function Section$LOktavia$(parent) {
+ this._parent = parent;
+ this._bitVector = new BitVector$();
+ this._names = [ ];
+};
+
+Section$LOktavia$.prototype = new Section;
+
+/**
+ * @param {!string} name
+ */
+Section.prototype.setTail$S = function (name) {
+ /** @type {!number} */
+ var index$0;
+ /** @type {Oktavia} */
+ var this$0;
+ /** @type {FMIndex} */
+ var this$0$0;
+ this$0 = this._parent;
+ this$0$0 = this$0._fmindex;
+ index$0 = this$0$0._substr.length;
+ this._names.push(name);
+ this._bitVector.set$I(index$0 - 1);
+};
+
+/**
+ * @param {!string} name
+ * @param {!number} index
+ */
+Section.prototype.setTail$SI = function (name, index) {
+ this._names.push(name);
+ this._bitVector.set$I(index - 1);
+};
+
+/**
+ * @return {!number}
+ */
+Section.prototype.size$ = function () {
+ return (this._names.length | 0);
+};
+
+/**
+ * @param {!number} position
+ * @return {!number}
+ */
+Section.prototype.getSectionIndex$I = function (position) {
+ /** @type {BitVector} */
+ var this$0;
+ if (position < 0 || this._bitVector.size$() <= position) {
+ throw new Error("Section.getSectionIndex() : range error " + (position + ""));
+ }
+ this$0 = this._bitVector;
+ return this$0.rank$IB(position, true);
+};
+
+/**
+ * @param {!number} index
+ * @return {!string}
+ */
+Section.prototype.getName$I = function (index) {
+ if (index < 0 || this._names.length <= index) {
+ throw new Error("Section.getName() : range error");
+ }
+ return this._names[index];
+};
+
+/**
+ * @param {SingleResult} result
+ * @param {Array.<undefined|!number>} positions
+ * @param {!string} word
+ * @param {!boolean} stemmed
+ */
+Section.prototype.grouping$LSingleResult$AISB = function (result, positions, word, stemmed) {
+ /** @type {!number} */
+ var i;
+ /** @type {undefined|!number} */
+ var position;
+ /** @type {!number} */
+ var index;
+ /** @type {SearchUnit} */
+ var unit;
+ for (i = 0; i < positions.length; i++) {
+ position = positions[i];
+ index = this.getSectionIndex$I(position);
+ unit = SingleResult$getSearchUnit$LSingleResult$I(result, index);
+ if (unit.startPosition < 0) {
+ unit.startPosition = this.getStartPosition$I(index);
+ }
+ SearchUnit$addPosition$LSearchUnit$SIB(unit, word, position - unit.startPosition, stemmed);
+ }
+};
+
+/**
+ * @param {!number} index
+ * @return {!string}
+ */
+Section.prototype.getInformation$I = function (index) {
+ return this.getName$I(index);
+};
+
+/**
+ * @param {Oktavia} parent
+ * @param {!string} name
+ * @param {!string} data
+ * @param {!number} offset
+ * @return {!number}
+ */
+Section._load$LOktavia$SSI = function (parent, name, data, offset) {
+ /** @type {LoadedStringListResult} */
+ var strs;
+ /** @type {Section} */
+ var section;
+ /** @type {!number} */
+ var offset$0;
+ strs = new LoadedStringListResult$SI(data, offset);
+ section = new Section$LOktavia$(parent);
+ section._names = strs.result;
+ offset$0 = strs.offset;
+ offset$0 = section._bitVector.load$SI(data, offset$0);
+ section._parent._metadataLabels.push(name);
+ section._parent._metadatas[name] = section;
+ return offset$0;
+};
+
+var Section$_load$LOktavia$SSI = Section._load$LOktavia$SSI;
+
+/**
+ * @return {!string}
+ */
+Section.prototype._dump$ = function () {
+ return [ Binary$dump16bitNumber$I(0), Binary$dumpStringList$AS(this._names), Metadata.prototype._dump$.call(this) ].join('');
+};
+
+/**
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+Section.prototype._dump$LCompressionReport$ = function (report) {
+ CompressionReport$add$LCompressionReport$II(report, 1, 1);
+ return [ Binary$dump16bitNumber$I(0), Binary$dumpStringList$ASLCompressionReport$(this._names, report), Metadata.prototype._dump$LCompressionReport$.call(this, report) ].join('');
+};
+
+/**
+ * class Splitter extends Metadata
+ * @constructor
+ */
+function Splitter() {
+}
+
+Splitter.prototype = new Metadata;
+/**
+ * @constructor
+ * @param {Oktavia} parent
+ */
+function Splitter$LOktavia$(parent) {
+ this._parent = parent;
+ this._bitVector = new BitVector$();
+ this.name = null;
+};
+
+Splitter$LOktavia$.prototype = new Splitter;
+
+/**
+ * @constructor
+ * @param {Oktavia} parent
+ * @param {!string} name
+ */
+function Splitter$LOktavia$S(parent, name) {
+ this._parent = parent;
+ this._bitVector = new BitVector$();
+ this.name = name;
+};
+
+Splitter$LOktavia$S.prototype = new Splitter;
+
+/**
+ * @return {!number}
+ */
+Splitter.prototype.size$ = function () {
+ /** @type {BitVector} */
+ var this$0$0;
+ /** @type {!number} */
+ var i$0$0;
+ /** @type {BitVector} */
+ var _bitVector$0;
+ this$0$0 = _bitVector$0 = this._bitVector;
+ i$0$0 = _bitVector$0._size;
+ return this$0$0.rank$IB(i$0$0, true);
+};
+
+/**
+ */
+Splitter.prototype.split$ = function () {
+ /** @type {!number} */
+ var index$0;
+ /** @type {Oktavia} */
+ var this$0;
+ /** @type {FMIndex} */
+ var this$0$0;
+ this$0 = this._parent;
+ this$0$0 = this$0._fmindex;
+ index$0 = this$0$0._substr.length;
+ this._bitVector.set$I(index$0 - 1);
+};
+
+/**
+ * @param {!number} index
+ */
+Splitter.prototype.split$I = function (index) {
+ this._bitVector.set$I(index - 1);
+};
+
+/**
+ * @param {!number} position
+ * @return {!number}
+ */
+Splitter.prototype.getIndex$I = function (position) {
+ /** @type {BitVector} */
+ var this$0;
+ if (position < 0 || this._bitVector.size$() <= position) {
+ throw new Error("Section.getSectionIndex() : range error");
+ }
+ this$0 = this._bitVector;
+ return this$0.rank$IB(position, true);
+};
+
+/**
+ * @param {SingleResult} result
+ * @param {Array.<undefined|!number>} positions
+ * @param {!string} word
+ * @param {!boolean} stemmed
+ */
+Splitter.prototype.grouping$LSingleResult$AISB = function (result, positions, word, stemmed) {
+ /** @type {!number} */
+ var i;
+ /** @type {undefined|!number} */
+ var position;
+ /** @type {!number} */
+ var index;
+ /** @type {SearchUnit} */
+ var unit;
+ for (i = 0; i < positions.length; i++) {
+ position = positions[i];
+ index = this.getIndex$I(position);
+ unit = SingleResult$getSearchUnit$LSingleResult$I(result, index);
+ if (unit.startPosition < 0) {
+ unit.startPosition = this.getStartPosition$I(index);
+ }
+ SearchUnit$addPosition$LSearchUnit$SIB(unit, word, position - unit.startPosition, stemmed);
+ }
+};
+
+/**
+ * @param {!number} index
+ * @return {!string}
+ */
+Splitter.prototype.getInformation$I = function (index) {
+ return (this.name != null ? this.name + (index + 1 + "") : '');
+};
+
+/**
+ * @param {Oktavia} parent
+ * @param {!string} name
+ * @param {!string} data
+ * @param {!number} offset
+ * @return {!number}
+ */
+Splitter._load$LOktavia$SSI = function (parent, name, data, offset) {
+ /** @type {Splitter} */
+ var section;
+ section = new Splitter$LOktavia$(parent);
+ offset = section._bitVector.load$SI(data, offset);
+ section._parent._metadataLabels.push(name);
+ section._parent._metadatas[name] = section;
+ return offset;
+};
+
+var Splitter$_load$LOktavia$SSI = Splitter._load$LOktavia$SSI;
+
+/**
+ * @return {!string}
+ */
+Splitter.prototype._dump$ = function () {
+ return [ Binary$dump16bitNumber$I(1), Metadata.prototype._dump$.call(this) ].join('');
+};
+
+/**
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+Splitter.prototype._dump$LCompressionReport$ = function (report) {
+ CompressionReport$add$LCompressionReport$II(report, 1, 1);
+ return [ Binary$dump16bitNumber$I(1), Metadata.prototype._dump$LCompressionReport$.call(this, report) ].join('');
+};
+
+/**
+ * class Table extends Metadata
+ * @constructor
+ */
+function Table() {
+}
+
+Table.prototype = new Metadata;
+/**
+ * @constructor
+ * @param {Oktavia} parent
+ * @param {Array.<undefined|!string>} headers
+ */
+function Table$LOktavia$AS(parent, headers) {
+ this._parent = parent;
+ this._bitVector = new BitVector$();
+ this._headers = headers;
+ this._columnTails = new BitVector$();
+};
+
+Table$LOktavia$AS.prototype = new Table;
+
+/**
+ * @return {!number}
+ */
+Table.prototype.rowSize$ = function () {
+ /** @type {BitVector} */
+ var this$0$0;
+ /** @type {!number} */
+ var i$0$0;
+ /** @type {BitVector} */
+ var _bitVector$0;
+ this$0$0 = _bitVector$0 = this._bitVector;
+ i$0$0 = _bitVector$0._size;
+ return this$0$0.rank$IB(i$0$0, true);
+};
+
+/**
+ * @return {!number}
+ */
+Table.prototype.columnSize$ = function () {
+ return (this._headers.length | 0);
+};
+
+/**
+ */
+Table.prototype.setColumnTail$ = function () {
+ /** @type {!number} */
+ var index;
+ /** @type {Oktavia} */
+ var this$0;
+ /** @type {FMIndex} */
+ var this$0$0;
+ /** @type {Oktavia} */
+ var _parent$0;
+ this$0 = _parent$0 = this._parent;
+ this$0$0 = this$0._fmindex;
+ index = this$0$0._substr.length;
+ _parent$0._fmindex.push$S(Oktavia.eob);
+ this._columnTails.set$I(index - 1);
+};
+
+/**
+ */
+Table.prototype.setRowTail$ = function () {
+ /** @type {!number} */
+ var index;
+ /** @type {Oktavia} */
+ var this$0;
+ /** @type {FMIndex} */
+ var this$0$0;
+ this$0 = this._parent;
+ this$0$0 = this$0._fmindex;
+ index = this$0$0._substr.length;
+ this._bitVector.set$I(index - 1);
+};
+
+/**
+ * @param {!number} position
+ * @return {Array.<undefined|!number>}
+ */
+Table.prototype.getCell$I = function (position) {
+ /** @type {!number} */
+ var row;
+ /** @type {!number} */
+ var currentColumn;
+ /** @type {!number} */
+ var lastRowColumn;
+ /** @type {!number} */
+ var startPosition;
+ /** @type {Array.<undefined|!number>} */
+ var result;
+ /** @type {BitVector} */
+ var this$0;
+ /** @type {BitVector} */
+ var this$1;
+ if (position < 0 || this._bitVector.size$() <= position) {
+ throw new Error("Section.getSectionIndex() : range error " + (position + ""));
+ }
+ this$0 = this._bitVector;
+ row = this$0.rank$IB(position, true);
+ this$1 = this._columnTails;
+ currentColumn = this$1.rank$IB(position, true);
+ lastRowColumn = 0;
+ if (row > 0) {
+ startPosition = this._bitVector.select$I(row - 1) + 1;
+ lastRowColumn = this._columnTails.rank$I(startPosition);
+ }
+ result = [ row, currentColumn - lastRowColumn ];
+ return result;
+};
+
+/**
+ * @param {!number} rowIndex
+ * @return {Object.<string, undefined|!string>}
+ */
+Table.prototype.getRowContent$I = function (rowIndex) {
+ /** @type {!string} */
+ var content;
+ /** @type {Array.<undefined|!string>} */
+ var values;
+ /** @type {Object.<string, undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var i;
+ content = this.getContent$I(rowIndex);
+ values = content.split(Oktavia.eob, this._headers.length);
+ result = ({ });
+ for (i in this._headers) {
+ if (i < values.length) {
+ result[this._headers[i]] = values[i];
+ } else {
+ result[this._headers[i]] = '';
+ }
+ }
+ return result;
+};
+
+/**
+ * @param {SingleResult} result
+ * @param {Array.<undefined|!number>} positions
+ * @param {!string} word
+ * @param {!boolean} stemmed
+ */
+Table.prototype.grouping$LSingleResult$AISB = function (result, positions, word, stemmed) {
+};
+
+/**
+ * @param {!number} index
+ * @return {!string}
+ */
+Table.prototype.getInformation$I = function (index) {
+ return '';
+};
+
+/**
+ */
+Table.prototype._build$ = function () {
+ this._bitVector.build$();
+ this._columnTails.build$();
+};
+
+/**
+ * @param {Oktavia} parent
+ * @param {!string} name
+ * @param {!string} data
+ * @param {!number} offset
+ * @return {!number}
+ */
+Table._load$LOktavia$SSI = function (parent, name, data, offset) {
+ /** @type {LoadedStringListResult} */
+ var strs;
+ /** @type {Table} */
+ var table;
+ /** @type {!number} */
+ var offset$0;
+ strs = new LoadedStringListResult$SI(data, offset);
+ table = new Table$LOktavia$AS(parent, strs.result);
+ offset$0 = strs.offset;
+ offset$0 = table._bitVector.load$SI(data, offset$0);
+ table._parent._metadataLabels.push(name);
+ table._parent._metadatas[name] = table;
+ offset = offset$0;
+ return table._columnTails.load$SI(data, offset$0);
+};
+
+var Table$_load$LOktavia$SSI = Table._load$LOktavia$SSI;
+
+/**
+ * @return {!string}
+ */
+Table.prototype._dump$ = function () {
+ return [ Binary$dump16bitNumber$I(2), Binary$dumpStringList$AS(this._headers), Metadata.prototype._dump$.call(this), this._columnTails.dump$() ].join('');
+};
+
+/**
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+Table.prototype._dump$LCompressionReport$ = function (report) {
+ CompressionReport$add$LCompressionReport$II(report, 1, 1);
+ return [ Binary$dump16bitNumber$I(2), Binary$dumpStringList$ASLCompressionReport$(this._headers, report), Metadata.prototype._dump$LCompressionReport$.call(this, report), this._columnTails.dump$LCompressionReport$(report) ].join('');
+};
+
+/**
+ * class Block extends Metadata
+ * @constructor
+ */
+function Block() {
+}
+
+Block.prototype = new Metadata;
+/**
+ * @constructor
+ * @param {Oktavia} parent
+ */
+function Block$LOktavia$(parent) {
+ this._parent = parent;
+ this._bitVector = new BitVector$();
+ this._names = [ ];
+ this._start = false;
+};
+
+Block$LOktavia$.prototype = new Block;
+
+/**
+ * @param {!string} blockName
+ */
+Block.prototype.startBlock$S = function (blockName) {
+ this.startBlock$SI(blockName, this._parent.contentSize$());
+};
+
+/**
+ * @param {!string} blockName
+ * @param {!number} index
+ */
+Block.prototype.startBlock$SI = function (blockName, index) {
+ if (this._start) {
+ throw new Error('Splitter `' + this._names[this._names.length - 1] + '` is not closed');
+ }
+ this._start = true;
+ this._names.push(blockName);
+ this._bitVector.set$I(index - 1);
+};
+
+/**
+ */
+Block.prototype.endBlock$ = function () {
+ this.endBlock$I(this._parent.contentSize$());
+};
+
+/**
+ * @param {!number} index
+ */
+Block.prototype.endBlock$I = function (index) {
+ if (! this._start) {
+ throw new Error('Splitter is not started');
+ }
+ this._start = false;
+ this._bitVector.set$I(index - 1);
+};
+
+/**
+ * @return {!number}
+ */
+Block.prototype.size$ = function () {
+ return (this._names.length | 0);
+};
+
+/**
+ * @param {!number} position
+ * @return {!number}
+ */
+Block.prototype.blockIndex$I = function (position) {
+ /** @type {!number} */
+ var result;
+ /** @type {BitVector} */
+ var this$0;
+ if (position < 0 || this._parent._fmindex.size$() - 1 <= position) {
+ throw new Error("Block.blockIndex() : range error " + (position + ""));
+ }
+ if (position >= this._bitVector.size$()) {
+ position = (this._bitVector.size$() - 1 | 0);
+ result = (this._bitVector.rank$I(position) + 1 | 0);
+ } else {
+ this$0 = this._bitVector;
+ result = this$0.rank$IB(position, true);
+ }
+ return result;
+};
+
+/**
+ * @param {!number} position
+ * @return {!boolean}
+ */
+Block.prototype.inBlock$I = function (position) {
+ /** @type {!number} */
+ var blockIndex;
+ blockIndex = this.blockIndex$I(position);
+ return blockIndex % 2 !== 0;
+};
+
+/**
+ * @param {!number} position
+ * @return {!string}
+ */
+Block.prototype.getBlockContent$I = function (position) {
+ /** @type {!number} */
+ var blockIndex;
+ /** @type {!string} */
+ var result;
+ blockIndex = this.blockIndex$I(position);
+ if (blockIndex % 2 !== 0) {
+ result = this.getContent$I(blockIndex);
+ } else {
+ result = '';
+ }
+ return result;
+};
+
+/**
+ * @param {!number} position
+ * @return {!string}
+ */
+Block.prototype.getBlockName$I = function (position) {
+ /** @type {!number} */
+ var blockIndex;
+ /** @type {!string} */
+ var result;
+ blockIndex = this.blockIndex$I(position);
+ if (blockIndex % 2 !== 0) {
+ result = this._names[blockIndex >>> 1];
+ } else {
+ result = '';
+ }
+ return result;
+};
+
+/**
+ * @param {SingleResult} result
+ * @param {Array.<undefined|!number>} positions
+ * @param {!string} word
+ * @param {!boolean} stemmed
+ */
+Block.prototype.grouping$LSingleResult$AISB = function (result, positions, word, stemmed) {
+};
+
+/**
+ * @param {!number} index
+ * @return {!string}
+ */
+Block.prototype.getInformation$I = function (index) {
+ return '';
+};
+
+/**
+ * @param {Oktavia} parent
+ * @param {!string} name
+ * @param {!string} data
+ * @param {!number} offset
+ * @return {!number}
+ */
+Block._load$LOktavia$SSI = function (parent, name, data, offset) {
+ /** @type {LoadedStringListResult} */
+ var strs;
+ /** @type {Block} */
+ var block;
+ /** @type {!number} */
+ var offset$0;
+ strs = new LoadedStringListResult$SI(data, offset);
+ block = new Block$LOktavia$(parent);
+ block._names = strs.result;
+ offset$0 = strs.offset;
+ offset$0 = block._bitVector.load$SI(data, offset$0);
+ block._parent._metadataLabels.push(name);
+ block._parent._metadatas[name] = block;
+ return offset$0;
+};
+
+var Block$_load$LOktavia$SSI = Block._load$LOktavia$SSI;
+
+/**
+ * @return {!string}
+ */
+Block.prototype._dump$ = function () {
+ return [ Binary$dump16bitNumber$I(3), Binary$dumpStringList$AS(this._names), Metadata.prototype._dump$.call(this) ].join('');
+};
+
+/**
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+Block.prototype._dump$LCompressionReport$ = function (report) {
+ CompressionReport$add$LCompressionReport$II(report, 1, 1);
+ return [ Binary$dump16bitNumber$I(3), Binary$dumpStringList$ASLCompressionReport$(this._names, report), Metadata.prototype._dump$LCompressionReport$.call(this, report) ].join('');
+};
+
+/**
+ * class FMIndex extends Object
+ * @constructor
+ */
+function FMIndex() {
+}
+
+/**
+ * @constructor
+ */
+function FMIndex$() {
+ /** @type {Array.<undefined|!number>} */
+ var _rlt$0;
+ this._ssize = 0;
+ (this._ddic = 0, this._head = 0);
+ this._substr = "";
+ this._sv = new WaveletMatrix$();
+ this._posdic = [ ];
+ this._idic = [ ];
+ _rlt$0 = this._rlt = [ ];
+ _rlt$0.length = 65536;
+};
+
+FMIndex$.prototype = new FMIndex;
+
+/**
+ */
+FMIndex.prototype.clear$ = function () {
+ /** @type {WaveletMatrix} */
+ var this$0;
+ this$0 = this._sv;
+ this$0._bv.length = 0;
+ this$0._seps.length = 0;
+ this$0._size = 0;
+ this._posdic.length = 0;
+ this._idic.length = 0;
+ this._ddic = 0;
+ this._head = 0;
+ this._substr = "";
+};
+
+/**
+ * @return {!number}
+ */
+FMIndex.prototype.size$ = function () {
+ /** @type {WaveletMatrix} */
+ var this$0;
+ this$0 = this._sv;
+ return this$0._size;
+};
+
+/**
+ * @return {!number}
+ */
+FMIndex.prototype.contentSize$ = function () {
+ return this._substr.length;
+};
+
+/**
+ * @param {!string} key
+ * @return {!number}
+ */
+FMIndex.prototype.getRows$S = function (key) {
+ /** @type {Array.<undefined|!number>} */
+ var pos;
+ pos = [ ];
+ return this.getRows$SAI(key, pos);
+};
+
+/**
+ * @param {!string} key
+ * @param {Array.<undefined|!number>} pos
+ * @return {!number}
+ */
+FMIndex.prototype.getRows$SAI = function (key, pos) {
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var code;
+ /** @type {!number} */
+ var first;
+ /** @type {undefined|!number} */
+ var last;
+ /** @type {!number} */
+ var c;
+ /** @type {Array.<undefined|!number>} */
+ var _rlt$0;
+ i = key.length - 1;
+ code = key.charCodeAt(i);
+ first = (_rlt$0 = this._rlt)[code] + 1;
+ last = _rlt$0[code + 1];
+ while (first <= last) {
+ if (i === 0) {
+ pos[0] = (-- first | 0);
+ pos[1] = -- last;
+ return (last - first + 1 | 0);
+ }
+ i--;
+ c = key.charCodeAt(i);
+ first = this._rlt[c] + this._sv.rank$II(first - 1, c) + 1;
+ last = this._rlt[c] + this._sv.rank$II(last, c);
+ }
+ return 0;
+};
+
+/**
+ * @param {!number} i
+ * @return {!number}
+ */
+FMIndex.prototype.getPosition$I = function (i) {
+ /** @type {!number} */
+ var pos;
+ /** @type {!number} */
+ var c;
+ if (i >= this.size$()) {
+ throw new Error("FMIndex.getPosition() : range error");
+ }
+ pos = 0;
+ while (i !== this._head) {
+ if (i % this._ddic === 0) {
+ pos += this._posdic[i / this._ddic] + 1;
+ break;
+ }
+ c = this._sv.get$I(i);
+ i = this._rlt[c] + this._sv.rank$II(i, c);
+ pos++;
+ }
+ return (pos % this.size$() | 0);
+};
+
+/**
+ * @param {!number} pos
+ * @param {!number} len
+ * @return {!string}
+ */
+FMIndex.prototype.getSubstring$II = function (pos, len) {
+ /** @type {!number} */
+ var pos_end;
+ /** @type {!number} */
+ var pos_tmp;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var pos_idic;
+ /** @type {!string} */
+ var substr;
+ /** @type {!number} */
+ var c;
+ /** @type {!number} */
+ var _ddic$0;
+ if (pos >= this.size$()) {
+ throw new Error("FMIndex.getSubstring() : range error");
+ }
+ pos_end = Math.min(pos + len, this.size$());
+ pos_tmp = this.size$() - 1;
+ i = this._head;
+ pos_idic = Math.floor((pos_end + (_ddic$0 = this._ddic) - 2) / _ddic$0);
+ if (pos_idic < this._idic.length) {
+ pos_tmp = pos_idic * this._ddic;
+ i = this._idic[pos_idic];
+ }
+ substr = "";
+ while (pos_tmp >= pos) {
+ c = this._sv.get$I(i);
+ i = this._rlt[c] + this._sv.rank$II(i, c);
+ if (pos_tmp < pos_end) {
+ substr = String.fromCharCode(c) + substr;
+ }
+ if (pos_tmp === 0) {
+ break;
+ }
+ pos_tmp--;
+ }
+ return substr;
+};
+
+/**
+ */
+FMIndex.prototype.build$ = function () {
+ this.build$SIIB(String.fromCharCode(0), 65535, 20, false);
+};
+
+/**
+ * @param {!string} end_marker
+ * @param {!number} ddic
+ * @param {!boolean} verbose
+ */
+FMIndex.prototype.build$SIB = function (end_marker, ddic, verbose) {
+ this.build$SIIB(end_marker, 65535, ddic, verbose);
+};
+
+/**
+ * @param {!string} end_marker
+ * @param {!number} maxChar
+ * @param {!number} ddic
+ * @param {!boolean} verbose
+ */
+FMIndex.prototype.build$SIIB = function (end_marker, maxChar, ddic, verbose) {
+ /** @type {BurrowsWheelerTransform} */
+ var b;
+ /** @type {!string} */
+ var s;
+ /** @type {!number} */
+ var c;
+ /** @type {!string} */
+ var str$0;
+ /** @type {WaveletMatrix} */
+ var this$0;
+ /** @type {!string} */
+ var _str$0;
+ /** @type {Array.<undefined|!number>} */
+ var _suffixarray$0;
+ if (verbose) {
+ console.time("building burrows-wheeler transform");
+ }
+ this._substr += end_marker;
+ b = ({_str: "", _size: 0, _head: 0, _suffixarray: [ ]});
+ str$0 = this._substr;
+ _str$0 = b._str = str$0;
+ b._size = _str$0.length;
+ _suffixarray$0 = b._suffixarray = SAIS$make$S(str$0);
+ b._head = (_suffixarray$0.indexOf(0) | 0);
+ s = BurrowsWheelerTransform$get$LBurrowsWheelerTransform$(b);
+ this._ssize = s.length;
+ this._head = b._head;
+ b._str = "";
+ b._size = 0;
+ b._head = 0;
+ b._suffixarray.length = 0;
+ this._substr = "";
+ if (verbose) {
+ console.timeEnd("building burrows-wheeler transform");
+ }
+ if (verbose) {
+ console.time("building wavelet matrix");
+ }
+ this$0 = this._sv;
+ this$0._bitsize = (Math.ceil(Math.log(maxChar) / 0.6931471805599453) | 0);
+ if (verbose) {
+ console.log(" maxCharCode: ", maxChar);
+ console.log(" bitSize: ", this._sv.bitsize$());
+ }
+ this._sv.build$S(s);
+ if (verbose) {
+ console.timeEnd("building wavelet matrix");
+ }
+ if (verbose) {
+ console.time("caching rank less than");
+ }
+ for (c = 0; c < maxChar; c++) {
+ this._rlt[c] = this._sv.rank_less_than$II(this._sv.size$(), c);
+ }
+ if (verbose) {
+ console.timeEnd("caching rank less than");
+ }
+ this._ddic = ddic;
+ if (verbose) {
+ console.time("building dictionaries");
+ }
+ this._buildDictionaries$();
+ if (verbose) {
+ console.timeEnd("building dictionaries");
+ console.log('');
+ }
+};
+
+/**
+ */
+FMIndex.prototype._buildDictionaries$ = function () {
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var pos;
+ /** @type {!number} */
+ var c;
+ for (i = 0; i < this._ssize / this._ddic + 1; i++) {
+ this._posdic.push(0);
+ this._idic.push(0);
+ }
+ i = this._head;
+ pos = this.size$() - 1;
+ do {
+ if (i % this._ddic === 0) {
+ this._posdic[Math.floor(i / this._ddic)] = (pos | 0);
+ }
+ if (pos % this._ddic === 0) {
+ this._idic[Math.floor(pos / this._ddic)] = (i | 0);
+ }
+ c = this._sv.get$I(i);
+ i = this._rlt[c] + this._sv.rank$II(i, c);
+ pos--;
+ } while (i !== this._head);
+};
+
+/**
+ * @param {!string} doc
+ */
+FMIndex.prototype.push$S = function (doc) {
+ if (doc.length <= 0) {
+ throw new Error("FMIndex::push(): empty string");
+ }
+ this._substr += doc;
+};
+
+/**
+ * @param {!string} keyword
+ * @return {Array.<undefined|!number>}
+ */
+FMIndex.prototype.search$S = function (keyword) {
+ /** @type {Array.<undefined|!number>} */
+ var result;
+ /** @type {Array.<undefined|!number>} */
+ var position;
+ /** @type {!number} */
+ var rows;
+ /** @type {undefined|!number} */
+ var first;
+ /** @type {undefined|!number} */
+ var last;
+ /** @type {undefined|!number} */
+ var i;
+ result = [ ];
+ position = [ ];
+ rows = this.getRows$SAI(keyword, position);
+ if (rows > 0) {
+ first = position[0];
+ last = position[1];
+ for (i = first; i <= last; i++) {
+ result.push(this.getPosition$I(i));
+ }
+ }
+ return result;
+};
+
+/**
+ * @return {!string}
+ */
+FMIndex.prototype.dump$ = function () {
+ return this.dump$B(false);
+};
+
+/**
+ * @param {!boolean} verbose
+ * @return {!string}
+ */
+FMIndex.prototype.dump$B = function (verbose) {
+ /** @type {Array.<undefined|!string>} */
+ var contents;
+ /** @type {CompressionReport} */
+ var report;
+ /** @type {!number} */
+ var i;
+ contents = [ ];
+ report = ({source: 0, result: 0});
+ contents.push(Binary$dump32bitNumber$N(this._ddic));
+ contents.push(Binary$dump32bitNumber$N(this._ssize));
+ contents.push(Binary$dump32bitNumber$N(this._head));
+ CompressionReport$add$LCompressionReport$II(report, 6, 6);
+ contents.push(this._sv.dump$LCompressionReport$(report));
+ if (verbose) {
+ console.log("Serializing FM-index");
+ console.log(' Wavelet Matrix: ' + (contents[3].length * 2 + "") + ' bytes (' + (Math.round(report.result * 100.0 / report.source) + "") + '%)');
+ }
+ contents.push(Binary$dump32bitNumber$N(this._posdic.length));
+ for (i in this._posdic) {
+ contents.push(Binary$dump32bitNumber$N(this._posdic[i]));
+ }
+ for (i in this._idic) {
+ contents.push(Binary$dump32bitNumber$N(this._idic[i]));
+ }
+ if (verbose) {
+ console.log(' Dictionary Cache: ' + (this._idic.length * 16 + "") + ' bytes');
+ }
+ return contents.join("");
+};
+
+/**
+ * @param {!string} data
+ * @return {!number}
+ */
+FMIndex.prototype.load$S = function (data) {
+ return this.load$SI(data, 0);
+};
+
+/**
+ * @param {!string} data
+ * @param {!number} offset
+ * @return {!number}
+ */
+FMIndex.prototype.load$SI = function (data, offset) {
+ /** @type {!number} */
+ var maxChar;
+ /** @type {!number} */
+ var c;
+ /** @type {!number} */
+ var size;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var result$0;
+ /** @type {!number} */
+ var result$1;
+ result$0 = data.charCodeAt(offset) * 65536 + data.charCodeAt(offset + 1);
+ this._ddic = (result$0 | 0);
+ this._ssize = (Binary$load32bitNumber$SI(data, offset + 2) | 0);
+ this._head = (Binary$load32bitNumber$SI(data, offset + 4) | 0);
+ offset = this._sv.load$SI(data, offset + 6);
+ maxChar = Math.pow(2, this._sv.bitsize$());
+ for (c = 0; c < maxChar; c++) {
+ this._rlt[c] = this._sv.rank_less_than$II(this._sv.size$(), c);
+ }
+ result$1 = data.charCodeAt(offset) * 65536 + data.charCodeAt(offset + 1);
+ size = result$1;
+ offset += 2;
+ for (i = 0; i < size; (i++, offset += 2)) {
+ this._posdic.push(Binary$load32bitNumber$SI(data, offset));
+ }
+ for (i = 0; i < size; (i++, offset += 2)) {
+ this._idic.push(Binary$load32bitNumber$SI(data, offset));
+ }
+ return offset;
+};
+
+/**
+ * class Tag extends Object
+ * @constructor
+ */
+function Tag() {
+}
+
+/**
+ * @constructor
+ * @param {!string} name
+ */
+function Tag$S(name) {
+ this.name = name;
+ this.attributes = ({ });
+ this.isSelfClosing = false;
+};
+
+Tag$S.prototype = new Tag;
+
+/**
+ * class _Common extends Object
+ * @constructor
+ */
+function _Common() {
+}
+
+/**
+ * @constructor
+ */
+function _Common$() {
+};
+
+_Common$.prototype = new _Common;
+
+/**
+ * class _State extends Object
+ * @constructor
+ */
+function _State() {
+}
+
+/**
+ * @constructor
+ */
+function _State$() {
+};
+
+_State$.prototype = new _State;
+
+/**
+ * class SAXHandler extends Object
+ * @constructor
+ */
+function SAXHandler() {
+}
+
+/**
+ * @constructor
+ */
+function SAXHandler$() {
+ this.position = 0;
+ this.column = 0;
+ this.line = 0;
+};
+
+SAXHandler$.prototype = new SAXHandler;
+
+/**
+ * @param {Error} error
+ */
+SAXHandler.prototype.onerror$LError$ = function (error) {
+};
+
+/**
+ * @param {!string} text
+ */
+SAXHandler.prototype.ontext$S = function (text) {
+};
+
+/**
+ * @param {!string} doctype
+ */
+SAXHandler.prototype.ondoctype$S = function (doctype) {
+};
+
+/**
+ * @param {!string} name
+ * @param {!string} body
+ */
+SAXHandler.prototype.onprocessinginstruction$SS = function (name, body) {
+};
+
+/**
+ * @param {!string} sgmlDecl
+ */
+SAXHandler.prototype.onsgmldeclaration$S = function (sgmlDecl) {
+};
+
+/**
+ * @param {!string} tagname
+ * @param {Object.<string, undefined|!string>} attributes
+ */
+SAXHandler.prototype.onopentag$SHS = function (tagname, attributes) {
+};
+
+/**
+ * @param {!string} tagname
+ */
+SAXHandler.prototype.onclosetag$S = function (tagname) {
+};
+
+/**
+ * @param {!string} name
+ * @param {!string} value
+ */
+SAXHandler.prototype.onattribute$SS = function (name, value) {
+};
+
+/**
+ * @param {!string} comment
+ */
+SAXHandler.prototype.oncomment$S = function (comment) {
+};
+
+/**
+ */
+SAXHandler.prototype.onopencdata$ = function () {
+};
+
+/**
+ * @param {!string} cdata
+ */
+SAXHandler.prototype.oncdata$S = function (cdata) {
+};
+
+/**
+ */
+SAXHandler.prototype.onclosecdata$ = function () {
+};
+
+/**
+ */
+SAXHandler.prototype.onend$ = function () {
+};
+
+/**
+ */
+SAXHandler.prototype.onready$ = function () {
+};
+
+/**
+ * @param {!string} script
+ */
+SAXHandler.prototype.onscript$S = function (script) {
+};
+
+/**
+ * class _HTMLHandler extends SAXHandler
+ * @constructor
+ */
+function _HTMLHandler() {
+}
+
+_HTMLHandler.prototype = new SAXHandler;
+/**
+ * @constructor
+ * @param {Object.<string, undefined|Array.<undefined|!string>>} styles
+ * @param {!boolean} escape
+ */
+function _HTMLHandler$HASB(styles, escape) {
+ this.position = 0;
+ this.column = 0;
+ this.line = 0;
+ this.text = [ ];
+ this.escape = escape;
+ this.styles = styles;
+};
+
+_HTMLHandler$HASB.prototype = new _HTMLHandler;
+
+/**
+ * @param {!string} str
+ * @return {!string}
+ */
+_HTMLHandler.escapeHTML$S = function (str) {
+ return str.replace(/\n/g, "<br/>").replace(/&/g, "&amp;").replace(/"/g, "&quot;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
+};
+
+var _HTMLHandler$escapeHTML$S = _HTMLHandler.escapeHTML$S;
+
+/**
+ * @param {!string} tagname
+ * @param {Object.<string, undefined|!string>} attributes
+ */
+_HTMLHandler.prototype.onopentag$SHS = function (tagname, attributes) {
+ this.text.push(this.styles[tagname][0]);
+};
+
+/**
+ * @param {!string} tagname
+ */
+_HTMLHandler.prototype.onclosetag$S = function (tagname) {
+ this.text.push(this.styles[tagname][1]);
+};
+
+/**
+ * @param {!string} text
+ */
+_HTMLHandler.prototype.ontext$S = function (text) {
+ if (this.escape) {
+ this.text.push(text.replace(/\n/g, "<br/>").replace(/&/g, "&amp;").replace(/"/g, "&quot;").replace(/</g, "&lt;").replace(/>/g, "&gt;"));
+ } else {
+ this.text.push(text);
+ }
+};
+
+/**
+ * @return {!string}
+ */
+_HTMLHandler.prototype.result$ = function () {
+ return this.text.join('');
+};
+
+/**
+ * class SAXParser extends Object
+ * @constructor
+ */
+function SAXParser() {
+}
+
+/**
+ * @constructor
+ * @param {SAXHandler} handler
+ */
+function SAXParser$LSAXHandler$(handler) {
+ this.q = "";
+ this.c = "";
+ this.bufferCheckPosition = 0;
+ this.looseCase = "";
+ this.tags = [ ];
+ this.closed = false;
+ this.closedRoot = false;
+ this.sawRoot = false;
+ this.tag = null;
+ this.error = null;
+ this.handler = null;
+ this.ENTITIES = null;
+ this.strict = false;
+ this.tagName = "";
+ this.state = 0;
+ this.line = 0;
+ this.column = 0;
+ this.position = 0;
+ this.startTagPosition = 0;
+ this.attribName = "";
+ this.attribValue = "";
+ this.script = "";
+ this.textNode = "";
+ this.attribList = null;
+ this.noscript = false;
+ this.cdata = "";
+ this.procInstBody = "";
+ this.procInstName = "";
+ this.doctype = "";
+ this.entity = "";
+ this.sgmlDecl = "";
+ this.comment = "";
+ this.preTags = 0;
+ this._init$LSAXHandler$B(handler, false);
+};
+
+SAXParser$LSAXHandler$.prototype = new SAXParser;
+
+/**
+ * @constructor
+ * @param {SAXHandler} handler
+ * @param {!boolean} strict
+ */
+function SAXParser$LSAXHandler$B(handler, strict) {
+ this.q = "";
+ this.c = "";
+ this.bufferCheckPosition = 0;
+ this.looseCase = "";
+ this.tags = [ ];
+ this.closed = false;
+ this.closedRoot = false;
+ this.sawRoot = false;
+ this.tag = null;
+ this.error = null;
+ this.handler = null;
+ this.ENTITIES = null;
+ this.strict = false;
+ this.tagName = "";
+ this.state = 0;
+ this.line = 0;
+ this.column = 0;
+ this.position = 0;
+ this.startTagPosition = 0;
+ this.attribName = "";
+ this.attribValue = "";
+ this.script = "";
+ this.textNode = "";
+ this.attribList = null;
+ this.noscript = false;
+ this.cdata = "";
+ this.procInstBody = "";
+ this.procInstName = "";
+ this.doctype = "";
+ this.entity = "";
+ this.sgmlDecl = "";
+ this.comment = "";
+ this.preTags = 0;
+ this._init$LSAXHandler$B(handler, strict);
+};
+
+SAXParser$LSAXHandler$B.prototype = new SAXParser;
+
+/**
+ * @param {SAXHandler} handler
+ * @param {!boolean} strict
+ */
+SAXParser.prototype._init$LSAXHandler$B = function (handler, strict) {
+ this.handler = handler;
+ this.clearBuffers$();
+ this.q = "";
+ this.bufferCheckPosition = 65536;
+ this.looseCase = 'toLowerCase';
+ this.tags = [ ];
+ this.closed = this.closedRoot = this.sawRoot = false;
+ this.tag = null;
+ this.error = null;
+ this.strict = strict;
+ this.noscript = strict;
+ this.state = 1;
+ this.ENTITIES = _Entities$entity_list$();
+ this.attribList = [ ];
+ this.noscript = false;
+ this.preTags = 0;
+};
+
+/**
+ * @param {!boolean} flag
+ */
+SAXParser.prototype.set_noscript$B = function (flag) {
+ this.noscript = flag;
+};
+
+/**
+ * @return {SAXParser}
+ */
+SAXParser.prototype.resume$ = function () {
+ this.error = null;
+ return this;
+};
+
+/**
+ * @return {SAXParser}
+ */
+SAXParser.prototype.close$ = function () {
+ return this.parse$S('');
+};
+
+/**
+ * @param {!string} chunk
+ * @return {SAXParser}
+ */
+SAXParser.prototype.parse$S = function (chunk) {
+ /** @type {Char} */
+ var _;
+ /** @type {!number} */
+ var i;
+ /** @type {!string} */
+ var c;
+ /** @type {!number} */
+ var starti;
+ /** @type {!number} */
+ var pad;
+ /** @type {!number} */
+ var returnState;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$0;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$1;
+ /** @type {RegExp} */
+ var charclass$2;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$3;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$4;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$5;
+ /** @type {!string} */
+ var text$0;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$6;
+ /** @type {RegExp} */
+ var charclass$7;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$8;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$9;
+ /** @type {RegExp} */
+ var charclass$10;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$11;
+ /** @type {RegExp} */
+ var charclass$12;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$13;
+ /** @type {RegExp} */
+ var charclass$14;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$15;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$16;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$17;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$18;
+ /** @type {RegExp} */
+ var charclass$19;
+ /** @type {RegExp} */
+ var charclass$20;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$21;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$22;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$23;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$24;
+ /** @type {!string} */
+ var comment$0;
+ _ = new Char$();
+ if (this.error) {
+ throw this.error;
+ }
+ if (this.closed) {
+ return this.emiterror$S("Cannot write after close. Assign an onready handler.");
+ }
+ (i = 0, c = "");
+ while (this.c = c = chunk.charAt(i++)) {
+ this.position++;
+ if (c === "\n") {
+ this.handler.line++;
+ this.handler.column = 0;
+ } else {
+ this.handler.column++;
+ }
+ switch (this.state) {
+ case 1:
+ if (c === "<") {
+ this.state = 4;
+ this.startTagPosition = this.position;
+ } else {
+ charclass$0 = _.whitespace;
+ if (! $__jsx_ObjectHasOwnProperty.call(charclass$0, c)) {
+ this.strictFail$S("Non-whitespace before first tag.");
+ this.textNode = c;
+ this.state = 2;
+ }
+ }
+ continue;
+ case 2:
+ if (this.sawRoot && ! this.closedRoot) {
+ starti = i - 1;
+ while (c && c !== "<" && c !== "&") {
+ c = chunk.charAt(i++);
+ if (c) {
+ this.position++;
+ if (c === "\n") {
+ this.handler.line++;
+ this.handler.column = 0;
+ } else {
+ this.handler.column++;
+ }
+ }
+ }
+ this.textNode += chunk.substring(starti, i - 1);
+ }
+ if (c === "<") {
+ this.state = 4;
+ this.startTagPosition = this.position;
+ } else {
+ if (_.not$HBS(_.whitespace, c) && (! this.sawRoot || this.closedRoot)) {
+ this.strictFail$S("Text data outside of root node.");
+ }
+ if (c === "&") {
+ this.state = 3;
+ } else {
+ this.textNode += c;
+ }
+ }
+ continue;
+ case 33:
+ if (c === "<") {
+ this.state = 34;
+ } else {
+ this.script += c;
+ }
+ continue;
+ case 34:
+ if (c === "/") {
+ this.state = 31;
+ } else {
+ this.script += "<" + c;
+ this.state = 33;
+ }
+ continue;
+ case 4:
+ if (c === "!") {
+ this.state = 5;
+ this.sgmlDecl = "";
+ } else {
+ charclass$1 = _.whitespace;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$1, c)) {
+ } else {
+ charclass$2 = _.nameStart;
+ if (charclass$2.test(c)) {
+ this.state = 21;
+ this.tagName = c;
+ } else {
+ if (c === "/") {
+ this.state = 31;
+ this.tagName = "";
+ } else {
+ if (c === "?") {
+ this.state = 18;
+ this.procInstName = this.procInstBody = "";
+ } else {
+ this.strictFail$S("Unencoded <");
+ if (this.startTagPosition + 1 < this.position) {
+ pad = this.position - this.startTagPosition;
+ for (i = 0; i < pad; i++) {
+ c = " " + c;
+ }
+ }
+ this.textNode += "<" + c;
+ this.state = 2;
+ }
+ }
+ }
+ }
+ }
+ continue;
+ case 5:
+ if ((this.sgmlDecl + c).toUpperCase() === _.CDATA) {
+ this.closetext_if_exist$();
+ this.state = 15;
+ this.sgmlDecl = "";
+ this.cdata = "";
+ } else {
+ if (this.sgmlDecl + c === "--") {
+ this.state = 12;
+ this.comment = "";
+ this.sgmlDecl = "";
+ } else {
+ if ((this.sgmlDecl + c).toUpperCase() === _.DOCTYPE) {
+ this.state = 7;
+ if (this.doctype || this.sawRoot) {
+ this.strictFail$S("Inappropriately located doctype declaration");
+ }
+ this.doctype = "";
+ this.sgmlDecl = "";
+ } else {
+ if (c === ">") {
+ this.closetext_if_exist$();
+ this.sgmlDecl = "";
+ this.state = 2;
+ } else {
+ charclass$3 = _.quote;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$3, c)) {
+ this.state = 6;
+ this.sgmlDecl += c;
+ } else {
+ this.sgmlDecl += c;
+ }
+ }
+ }
+ }
+ }
+ continue;
+ case 6:
+ if (c === this.q) {
+ this.state = 5;
+ this.q = "";
+ }
+ this.sgmlDecl += c;
+ continue;
+ case 7:
+ if (c === ">") {
+ this.state = 2;
+ this.closetext_if_exist$();
+ this.doctype.trim();
+ } else {
+ this.doctype += c;
+ if (c === "[") {
+ this.state = 9;
+ } else {
+ charclass$4 = _.quote;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$4, c)) {
+ this.state = 8;
+ this.q = c;
+ }
+ }
+ }
+ continue;
+ case 8:
+ this.doctype += c;
+ if (c === this.q) {
+ this.q = "";
+ this.state = 7;
+ }
+ continue;
+ case 9:
+ this.doctype += c;
+ if (c === "]") {
+ this.state = 7;
+ } else {
+ charclass$5 = _.quote;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$5, c)) {
+ this.state = 10;
+ this.q = c;
+ }
+ }
+ continue;
+ case 10:
+ this.doctype += c;
+ if (c === this.q) {
+ this.state = 9;
+ this.q = "";
+ }
+ continue;
+ case 12:
+ if (c === "-") {
+ this.state = 13;
+ } else {
+ this.comment += c;
+ }
+ continue;
+ case 13:
+ if (c === "-") {
+ this.state = 14;
+ text$0 = this.comment;
+ text$0 = text$0.replace(/[\n\t]/g, ' ');
+ text$0 = text$0.replace(/\s\s+/g, " ");
+ comment$0 = this.comment = text$0;
+ if (comment$0) {
+ this.closetext_if_exist$();
+ this.comment.trim();
+ }
+ this.comment = "";
+ } else {
+ this.comment += "-" + c;
+ this.state = 12;
+ }
+ continue;
+ case 14:
+ if (c !== ">") {
+ this.strictFail$S("Malformed comment");
+ this.comment += "--" + c;
+ this.state = 12;
+ } else {
+ this.state = 2;
+ }
+ continue;
+ case 15:
+ if (c === "]") {
+ this.state = 16;
+ } else {
+ this.cdata += c;
+ }
+ continue;
+ case 16:
+ if (c === "]") {
+ this.state = 17;
+ } else {
+ this.cdata += "]" + c;
+ this.state = 15;
+ }
+ continue;
+ case 17:
+ if (c === ">") {
+ if (this.cdata) {
+ this.closetext_if_exist$();
+ }
+ this.cdata = "";
+ this.state = 2;
+ } else {
+ if (c === "]") {
+ this.cdata += "]";
+ } else {
+ this.cdata += "]]" + c;
+ this.state = 15;
+ }
+ }
+ continue;
+ case 18:
+ if (c === "?") {
+ this.state = 20;
+ } else {
+ charclass$6 = _.whitespace;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$6, c)) {
+ this.state = 19;
+ } else {
+ this.procInstName += c;
+ }
+ }
+ continue;
+ case 19:
+ if (! this.procInstBody && _.is$HBS(_.whitespace, c)) {
+ continue;
+ } else {
+ if (c === "?") {
+ this.state = 20;
+ } else {
+ this.procInstBody += c;
+ }
+ }
+ continue;
+ case 20:
+ if (c === ">") {
+ this.closetext_if_exist$();
+ this.procInstName = this.procInstBody = "";
+ this.state = 2;
+ } else {
+ this.procInstBody += "?" + c;
+ this.state = 19;
+ }
+ continue;
+ case 21:
+ charclass$7 = _.nameBody;
+ if (charclass$7.test(c)) {
+ this.tagName += c;
+ } else {
+ this.newTag$();
+ if (c === ">") {
+ this.openTag$B(false);
+ } else {
+ if (c === "/") {
+ this.state = 22;
+ } else {
+ charclass$8 = _.whitespace;
+ if (! $__jsx_ObjectHasOwnProperty.call(charclass$8, c)) {
+ this.strictFail$S("Invalid character in tag name");
+ }
+ this.state = 23;
+ }
+ }
+ }
+ continue;
+ case 22:
+ if (c === ">") {
+ this.openTag$B(true);
+ this.closeTag$();
+ } else {
+ this.strictFail$S("Forward-slash in opening tag not followed by >");
+ this.state = 23;
+ }
+ continue;
+ case 23:
+ charclass$9 = _.whitespace;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$9, c)) {
+ continue;
+ } else {
+ if (c === ">") {
+ this.openTag$B(false);
+ } else {
+ if (c === "/") {
+ this.state = 22;
+ } else {
+ charclass$10 = _.nameStart;
+ if (charclass$10.test(c)) {
+ this.attribName = c;
+ this.attribValue = "";
+ this.state = 24;
+ } else {
+ this.strictFail$S("Invalid attribute name");
+ }
+ }
+ }
+ }
+ continue;
+ case 24:
+ if (c === "=") {
+ this.state = 26;
+ } else {
+ if (c === ">") {
+ this.strictFail$S("Attribute without value");
+ this.attribValue = this.attribName;
+ this.attrib$();
+ this.openTag$B(false);
+ } else {
+ charclass$11 = _.whitespace;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$11, c)) {
+ this.state = 25;
+ } else {
+ charclass$12 = _.nameBody;
+ if (charclass$12.test(c)) {
+ this.attribName += c;
+ } else {
+ this.strictFail$S("Invalid attribute name");
+ }
+ }
+ }
+ }
+ continue;
+ case 25:
+ if (c === "=") {
+ this.state = 26;
+ } else {
+ charclass$13 = _.whitespace;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$13, c)) {
+ continue;
+ } else {
+ this.strictFail$S("Attribute without value");
+ this.tag.attributes[this.attribName] = "";
+ this.attribValue = "";
+ this.closetext_if_exist$();
+ this.attribName = "";
+ if (c === ">") {
+ this.openTag$B(false);
+ } else {
+ charclass$14 = _.nameStart;
+ if (charclass$14.test(c)) {
+ this.attribName = c;
+ this.state = 24;
+ } else {
+ this.strictFail$S("Invalid attribute name");
+ this.state = 23;
+ }
+ }
+ }
+ }
+ continue;
+ case 26:
+ charclass$15 = _.whitespace;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$15, c)) {
+ continue;
+ } else {
+ charclass$16 = _.quote;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$16, c)) {
+ this.q = c;
+ this.state = 27;
+ } else {
+ this.strictFail$S("Unquoted attribute value");
+ this.state = 28;
+ this.attribValue = c;
+ }
+ }
+ continue;
+ case 27:
+ if (c !== this.q) {
+ if (c === "&") {
+ this.state = 29;
+ } else {
+ this.attribValue += c;
+ }
+ continue;
+ }
+ this.attrib$();
+ this.q = "";
+ this.state = 23;
+ continue;
+ case 28:
+ charclass$17 = _.attribEnd;
+ if (! $__jsx_ObjectHasOwnProperty.call(charclass$17, c)) {
+ if (c === "&") {
+ this.state = 30;
+ } else {
+ this.attribValue += c;
+ }
+ continue;
+ }
+ this.attrib$();
+ if (c === ">") {
+ this.openTag$B(false);
+ } else {
+ this.state = 23;
+ }
+ continue;
+ case 31:
+ if (! this.tagName) {
+ charclass$18 = _.whitespace;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$18, c)) {
+ continue;
+ } else {
+ charclass$19 = _.nameStart;
+ if (! charclass$19.test(c)) {
+ if (this.script) {
+ this.script += "</" + c;
+ this.state = 33;
+ } else {
+ this.strictFail$S("Invalid tagname in closing tag.");
+ }
+ } else {
+ this.tagName = c;
+ }
+ }
+ } else {
+ if (c === ">") {
+ this.closeTag$();
+ } else {
+ charclass$20 = _.nameBody;
+ if (charclass$20.test(c)) {
+ this.tagName += c;
+ } else {
+ if (this.script) {
+ this.script += "</" + this.tagName;
+ this.tagName = "";
+ this.state = 33;
+ } else {
+ charclass$21 = _.whitespace;
+ if (! $__jsx_ObjectHasOwnProperty.call(charclass$21, c)) {
+ this.strictFail$S("Invalid tagname in closing tag");
+ }
+ this.state = 32;
+ }
+ }
+ }
+ }
+ continue;
+ case 32:
+ charclass$22 = _.whitespace;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$22, c)) {
+ continue;
+ }
+ if (c === ">") {
+ this.closeTag$();
+ } else {
+ this.strictFail$S("Invalid characters in closing tag");
+ }
+ continue;
+ case 3:
+ if (c === ";") {
+ this.textNode += this.parseEntity$();
+ this.entity = "";
+ this.state = 2;
+ } else {
+ charclass$23 = _.entity;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$23, c)) {
+ this.entity += c;
+ } else {
+ this.strictFail$S("Invalid character entity");
+ this.textNode += "&" + this.entity + c;
+ this.entity = "";
+ this.state = 2;
+ }
+ }
+ continue;
+ case 29:
+ case 30:
+ if (this.state === 29) {
+ returnState = 27;
+ } else {
+ returnState = 28;
+ }
+ if (c === ";") {
+ this.attribValue += this.parseEntity$();
+ this.entity = "";
+ this.state = (returnState | 0);
+ } else {
+ charclass$24 = _.entity;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$24, c)) {
+ this.entity += c;
+ } else {
+ this.strictFail$S("Invalid character entity");
+ this.attribValue += "&" + this.entity + c;
+ this.entity = "";
+ this.state = (returnState | 0);
+ }
+ }
+ continue;
+ default:
+ throw new Error("Unknown state: " + (this.state + ""));
+ }
+ }
+ this.end$();
+ return this;
+};
+
+/**
+ */
+SAXParser.prototype.clearBuffers$ = function () {
+ this.comment = '';
+ this.sgmlDecl = '';
+ this.textNode = '';
+ this.tagName = '';
+ this.doctype = '';
+ this.procInstName = '';
+ this.procInstBody = '';
+ this.entity = '';
+ this.attribName = '';
+ this.attribValue = '';
+ this.cdata = '';
+ this.script = '';
+};
+
+/**
+ */
+SAXParser.prototype.closetext_if_exist$ = function () {
+ if (this.textNode !== '') {
+ this.closetext$();
+ }
+};
+
+/**
+ */
+SAXParser.prototype.closetext$ = function () {
+ /** @type {!string} */
+ var text;
+ /** @type {!string} */
+ var text$0;
+ if (this.preTags === 0) {
+ text$0 = this.textNode;
+ text$0 = text$0.replace(/[\n\t]/g, ' ');
+ text$0 = text$0.replace(/\s\s+/g, " ");
+ text = text$0;
+ if (text$0) {
+ this.handler.ontext$S(text);
+ }
+ } else {
+ if (this.textNode) {
+ this.handler.ontext$S(this.textNode);
+ }
+ }
+ this.textNode = "";
+};
+
+/**
+ * @param {!string} text
+ * @return {!string}
+ */
+SAXParser.prototype.textopts$S = function (text) {
+ text = text.replace(/[\n\t]/g, ' ');
+ text = text.replace(/\s\s+/g, " ");
+ return text;
+};
+
+/**
+ * @param {!string} er
+ * @return {SAXParser}
+ */
+SAXParser.prototype.emiterror$S = function (er) {
+ /** @type {Error} */
+ var error;
+ this.closetext$();
+ er += "\nLine: " + (this.line + "") + "\nColumn: " + (this.column + "") + "\nChar: " + this.c;
+ error = new Error(er);
+ this.error = error;
+ return this;
+};
+
+/**
+ */
+SAXParser.prototype.end$ = function () {
+ if (! this.closedRoot) {
+ this.strictFail$S("Unclosed root tag");
+ }
+ if (this.state !== 2) {
+ this.emiterror$S("Unexpected end");
+ }
+ this.closetext$();
+ this.c = "";
+ this.closed = true;
+};
+
+/**
+ * @param {!string} message
+ */
+SAXParser.prototype.strictFail$S = function (message) {
+ if (this.strict) {
+ this.emiterror$S(message);
+ }
+};
+
+/**
+ */
+SAXParser.prototype.newTag$ = function () {
+ if (! this.strict) {
+ this.tagName = this.tagName.toLowerCase();
+ }
+ this.tag = ({name: this.tagName, attributes: ({ }), isSelfClosing: false});
+ this.attribList.length = 0;
+};
+
+/**
+ */
+SAXParser.prototype.attrib$ = function () {
+ if (! this.strict) {
+ this.attribName = this.attribName.toLowerCase();
+ }
+ if ($__jsx_ObjectHasOwnProperty.call(this.tag.attributes, this.attribName)) {
+ this.attribName = this.attribValue = "";
+ return;
+ }
+ this.tag.attributes[this.attribName] = this.attribValue;
+ this.closetext_if_exist$();
+ this.attribName = this.attribValue = "";
+};
+
+/**
+ */
+SAXParser.prototype.openTag$ = function () {
+ this.openTag$B(false);
+};
+
+/**
+ * @param {!boolean} selfClosing
+ */
+SAXParser.prototype.openTag$B = function (selfClosing) {
+ /** @type {Tag} */
+ var tag$0;
+ /** @type {Tag} */
+ var tag$1;
+ (tag$0 = this.tag).isSelfClosing = selfClosing;
+ this.sawRoot = true;
+ this.tags.push(tag$0);
+ this.closetext_if_exist$();
+ this.handler.onopentag$SHS((tag$1 = this.tag).name, tag$1.attributes);
+ if (this.tag.name === 'pre') {
+ this.preTags++;
+ }
+ if (! selfClosing) {
+ if (! this.noscript && this.tagName.toLowerCase() === "script") {
+ this.state = 33;
+ } else {
+ this.state = 2;
+ }
+ this.tag = null;
+ this.tagName = "";
+ }
+ this.attribName = this.attribValue = "";
+ this.attribList.length = 0;
+};
+
+/**
+ */
+SAXParser.prototype.closeTag$ = function () {
+ /** @type {!number} */
+ var t;
+ /** @type {!string} */
+ var tagName;
+ /** @type {!string} */
+ var closeTo;
+ /** @type {Tag} */
+ var close;
+ /** @type {!number} */
+ var s;
+ /** @type {Tag} */
+ var tag$0;
+ if (! this.tagName) {
+ this.strictFail$S("Weird empty close tag.");
+ this.textNode += "</>";
+ this.state = 2;
+ return;
+ }
+ if (this.script) {
+ if (this.tagName !== "script") {
+ this.script += "</" + this.tagName + ">";
+ this.tagName = "";
+ this.state = 33;
+ return;
+ }
+ this.closetext_if_exist$();
+ this.script = "";
+ }
+ t = this.tags.length;
+ tagName = this.tagName;
+ if (! this.strict) {
+ tagName = tagName.toLowerCase();
+ }
+ closeTo = tagName;
+ while (t--) {
+ close = this.tags[t];
+ if (close.name !== closeTo) {
+ this.strictFail$S("Unexpected close tag");
+ } else {
+ break;
+ }
+ }
+ if (t < 0) {
+ this.strictFail$S("Unmatched closing tag: " + this.tagName);
+ this.textNode += "</" + this.tagName + ">";
+ this.state = 2;
+ return;
+ }
+ this.tagName = tagName;
+ s = this.tags.length;
+ while (s-- > t) {
+ tag$0 = this.tag = this.tags.pop();
+ this.tagName = tag$0.name;
+ this.closetext_if_exist$();
+ this.handler.onclosetag$S(this.tagName);
+ if (this.tagName === 'pre') {
+ this.preTags--;
+ }
+ }
+ if (t === 0) {
+ this.closedRoot = true;
+ }
+ this.tagName = this.attribValue = this.attribName = "";
+ this.attribList.length = 0;
+ this.state = 2;
+};
+
+/**
+ * @return {!string}
+ */
+SAXParser.prototype.parseEntity$ = function () {
+ /** @type {!string} */
+ var entity;
+ /** @type {!string} */
+ var entityLC;
+ /** @type {!number} */
+ var num;
+ /** @type {!string} */
+ var numStr;
+ entity = this.entity;
+ entityLC = entity.toLowerCase();
+ num = 0;
+ numStr = "";
+ if (this.ENTITIES[entity]) {
+ return this.ENTITIES[entity];
+ }
+ if (this.ENTITIES[entityLC]) {
+ return this.ENTITIES[entityLC];
+ }
+ entity = entityLC;
+ if (entityLC.charAt(0) === "#") {
+ if (entity.charAt(1) === "x") {
+ entity = entity.slice(2);
+ num = $__jsx_parseInt(entity, 16);
+ numStr = num.toString(16);
+ } else {
+ entity = entity.slice(1);
+ num = $__jsx_parseInt(entity, 10);
+ numStr = num.toString(10);
+ }
+ }
+ entity = entity.replace(/^0+/, "");
+ if (numStr.toLowerCase() !== entity) {
+ this.strictFail$S("Invalid character entity");
+ return "&" + this.entity + ";";
+ }
+ return String.fromCharCode(num);
+};
+
+/**
+ * class Char extends Object
+ * @constructor
+ */
+function Char() {
+}
+
+/**
+ * @constructor
+ */
+function Char$() {
+ this.CDATA = "[CDATA[";
+ this.DOCTYPE = "DOCTYPE";
+ this.XML_NAMESPACE = "http://www.w3.org/XML/1998/namespace";
+ this.whitespace = this._charClass$S("\r\n\t ");
+ this.number = this._charClass$S("0124356789");
+ this.letter = this._charClass$S("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ");
+ this.quote = this._charClass$S("'\"");
+ this.entity = this._charClass$S("0124356789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ#");
+ this.attribEnd = this._charClass$S("\r\n\t >");
+ this.nameStart = /[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/;
+ this.nameBody = /[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040\.\d-]/;
+};
+
+Char$.prototype = new Char;
+
+/**
+ * @param {!string} str
+ * @return {Object.<string, undefined|!boolean>}
+ */
+Char.prototype._charClass$S = function (str) {
+ /** @type {Object.<string, undefined|!boolean>} */
+ var result;
+ /** @type {!number} */
+ var i;
+ result = ({ });
+ for (i = 0; i < str.length; i++) {
+ result[str.slice(i, i + 1)] = true;
+ }
+ return result;
+};
+
+/**
+ * @param {RegExp} charclass
+ * @param {!string} c
+ * @return {!boolean}
+ */
+Char.prototype.is$LRegExp$S = function (charclass, c) {
+ return charclass.test(c);
+};
+
+/**
+ * @param {Object.<string, undefined|!boolean>} charclass
+ * @param {!string} c
+ * @return {!boolean}
+ */
+Char.prototype.is$HBS = function (charclass, c) {
+ return $__jsx_ObjectHasOwnProperty.call(charclass, c);
+};
+
+/**
+ * @param {RegExp} charclass
+ * @param {!string} c
+ * @return {!boolean}
+ */
+Char.prototype.not$LRegExp$S = function (charclass, c) {
+ return ! charclass.test(c);
+};
+
+/**
+ * @param {Object.<string, undefined|!boolean>} charclass
+ * @param {!string} c
+ * @return {!boolean}
+ */
+Char.prototype.not$HBS = function (charclass, c) {
+ return ! $__jsx_ObjectHasOwnProperty.call(charclass, c);
+};
+
+/**
+ * class _Entities extends Object
+ * @constructor
+ */
+function _Entities() {
+}
+
+/**
+ * @constructor
+ */
+function _Entities$() {
+};
+
+_Entities$.prototype = new _Entities;
+
+/**
+ * @return {Object.<string, undefined|!string>}
+ */
+_Entities.entity_list$ = function () {
+ /** @type {Object.<string, undefined|!string>} */
+ var result;
+ /** @type {!string} */
+ var key;
+ /** @type {*} */
+ var value;
+ result = ({ });
+ for (key in _Entities._entities) {
+ value = _Entities._entities[key];
+ if (typeof value === 'string') {
+ result[key] = value + "";
+ } else {
+ if (typeof value === 'number') {
+ result[key] = String.fromCharCode(value | 0);
+ }
+ }
+ }
+ return result;
+};
+
+var _Entities$entity_list$ = _Entities.entity_list$;
+
+/**
+ * class BitVector extends Object
+ * @constructor
+ */
+function BitVector() {
+}
+
+/**
+ * @constructor
+ */
+function BitVector$() {
+ /** @type {Array.<undefined|!number>} */
+ var _v$0;
+ /** @type {Array.<undefined|!number>} */
+ var _r$0;
+ _r$0 = this._r = [ ];
+ _v$0 = this._v = [ ];
+ _v$0.length = 0;
+ _r$0.length = 0;
+ this._size = 0;
+ this._size1 = 0;
+};
+
+BitVector$.prototype = new BitVector;
+
+/**
+ */
+BitVector.prototype.build$ = function () {
+ /** @type {!number} */
+ var i;
+ this._size1 = 0;
+ for (i = 0; i < this._v.length; i++) {
+ if (i % 8 === 0) {
+ this._r.push(true ? this._size1 : this._size - this._size1);
+ }
+ this._size1 += this._rank32$IIB(this._v[i], 32, true);
+ }
+};
+
+/**
+ */
+BitVector.prototype.clear$ = function () {
+ this._v.length = 0;
+ this._r.length = 0;
+ this._size = 0;
+ this._size1 = 0;
+};
+
+/**
+ * @return {!number}
+ */
+BitVector.prototype.size$ = function () {
+ return this._size;
+};
+
+/**
+ * @param {!boolean} b
+ * @return {!number}
+ */
+BitVector.prototype.size$B = function (b) {
+ return (b ? this._size1 : this._size - this._size1);
+};
+
+/**
+ * @param {!number} value
+ */
+BitVector.prototype.set$I = function (value) {
+ this.set$IB(value, true);
+};
+
+/**
+ * @param {!number} value
+ * @param {!boolean} flag
+ */
+BitVector.prototype.set$IB = function (value, flag) {
+ /** @type {!number} */
+ var q;
+ /** @type {!number} */
+ var r;
+ /** @type {!number} */
+ var m;
+ if (value >= this._size) {
+ this._size = (value + 1 | 0);
+ }
+ q = (value / 32 | 0);
+ r = (value % 32 | 0);
+ while (q >= this._v.length) {
+ this._v.push(0);
+ }
+ m = 0x1 << r;
+ if (flag) {
+ this._v[q] |= m;
+ } else {
+ this._v[q] &= ~ m;
+ }
+};
+
+/**
+ * @param {!number} value
+ * @return {!boolean}
+ */
+BitVector.prototype.get$I = function (value) {
+ /** @type {!number} */
+ var q;
+ /** @type {!number} */
+ var r;
+ /** @type {!number} */
+ var m;
+ if (value >= this._size) {
+ throw new Error("BitVector.get() : range error");
+ }
+ q = (value / 32 | 0);
+ r = (value % 32 | 0);
+ m = 0x1 << r;
+ return !! (this._v[q] & m);
+};
+
+/**
+ * @param {!number} i
+ * @return {!number}
+ */
+BitVector.prototype.rank$I = function (i) {
+ return this.rank$IB(i, true);
+};
+
+/**
+ * @param {!number} i
+ * @param {!boolean} b
+ * @return {!number}
+ */
+BitVector.prototype.rank$IB = function (i, b) {
+ /** @type {!number} */
+ var q_large;
+ /** @type {!number} */
+ var q_small;
+ /** @type {!number} */
+ var r;
+ /** @type {!number} */
+ var rank;
+ /** @type {!number} */
+ var begin;
+ /** @type {!number} */
+ var j;
+ if (i > this._size) {
+ throw new Error("BitVector.rank() : range error");
+ }
+ if (i === 0) {
+ return 0;
+ }
+ i--;
+ q_large = (Math.floor(i / 256) | 0);
+ q_small = (Math.floor(i / 32) | 0);
+ r = (Math.floor(i % 32) | 0);
+ rank = (this._r[q_large] | 0);
+ if (! b) {
+ rank = q_large * 256 - rank;
+ }
+ begin = q_large * 8;
+ for (j = begin; j < q_small; j++) {
+ rank += this._rank32$IIB(this._v[j], 32, b);
+ }
+ rank += this._rank32$IIB(this._v[q_small], r + 1, b);
+ return rank;
+};
+
+/**
+ * @param {!number} i
+ * @return {!number}
+ */
+BitVector.prototype.select$I = function (i) {
+ return this.select$IB(i, true);
+};
+
+/**
+ * @param {!number} i
+ * @param {!boolean} b
+ * @return {!number}
+ */
+BitVector.prototype.select$IB = function (i, b) {
+ /** @type {!number} */
+ var left;
+ /** @type {!number} */
+ var right;
+ /** @type {!number} */
+ var pivot;
+ /** @type {undefined|!number} */
+ var rank;
+ /** @type {!number} */
+ var j;
+ if (i >= (b ? this._size1 : this._size - this._size1)) {
+ throw new Error("BitVector.select() : range error");
+ }
+ left = 0;
+ right = this._r.length;
+ while (left < right) {
+ pivot = Math.floor((left + right) / 2);
+ rank = this._r[pivot];
+ if (! b) {
+ rank = pivot * 256 - rank;
+ }
+ if (i < rank) {
+ right = pivot;
+ } else {
+ left = pivot + 1;
+ }
+ }
+ right--;
+ if (b) {
+ i -= (this._r[right] | 0);
+ } else {
+ i -= (right * 256 - this._r[right] | 0);
+ }
+ j = right * 8;
+ while (1) {
+ rank = this._rank32$IIB(this._v[j], 32, b);
+ if (i < rank) {
+ break;
+ }
+ j++;
+ i -= (rank | 0);
+ }
+ return (j * 32 + this._select32$IIB(this._v[j], i, b) | 0);
+};
+
+/**
+ * @param {!number} x
+ * @param {!number} i
+ * @param {!boolean} b
+ * @return {!number}
+ */
+BitVector.prototype._rank32$IIB = function (x, i, b) {
+ if (! b) {
+ x = ~ x;
+ }
+ x <<= 32 - i;
+ x = ((x & 0xaaaaaaaa) >>> 1) + (x & 0x55555555);
+ x = ((x & 0xcccccccc) >>> 2) + (x & 0x33333333);
+ x = ((x & 0xf0f0f0f0) >>> 4) + (x & 0x0f0f0f0f);
+ x = ((x & 0xff00ff00) >>> 8) + (x & 0x00ff00ff);
+ x = ((x & 0xffff0000) >>> 16) + (x & 0x0000ffff);
+ return x;
+};
+
+/**
+ * @param {!number} x
+ * @param {!number} i
+ * @param {!boolean} b
+ * @return {!number}
+ */
+BitVector.prototype._select32$IIB = function (x, i, b) {
+ /** @type {!number} */
+ var x1;
+ /** @type {!number} */
+ var x2;
+ /** @type {!number} */
+ var x3;
+ /** @type {!number} */
+ var x4;
+ /** @type {!number} */
+ var x5;
+ /** @type {!number} */
+ var pos;
+ /** @type {!number} */
+ var v5;
+ /** @type {!number} */
+ var v4;
+ /** @type {!number} */
+ var v3;
+ /** @type {!number} */
+ var v2;
+ /** @type {!number} */
+ var v1;
+ /** @type {!number} */
+ var v0;
+ if (! b) {
+ x = ~ x;
+ }
+ x1 = ((x & 0xaaaaaaaa) >>> 1) + (x & 0x55555555);
+ x2 = ((x1 & 0xcccccccc) >>> 2) + (x1 & 0x33333333);
+ x3 = ((x2 & 0xf0f0f0f0) >>> 4) + (x2 & 0x0f0f0f0f);
+ x4 = ((x3 & 0xff00ff00) >>> 8) + (x3 & 0x00ff00ff);
+ x5 = ((x4 & 0xffff0000) >>> 16) + (x4 & 0x0000ffff);
+ i++;
+ pos = 0;
+ v5 = x5 & 0xffffffff;
+ if (i > v5) {
+ i -= (v5 | 0);
+ pos += 32;
+ }
+ v4 = x4 >>> pos & 0x0000ffff;
+ if (i > v4) {
+ i -= (v4 | 0);
+ pos += 16;
+ }
+ v3 = x3 >>> pos & 0x000000ff;
+ if (i > v3) {
+ i -= (v3 | 0);
+ pos += 8;
+ }
+ v2 = x2 >>> pos & 0x0000000f;
+ if (i > v2) {
+ i -= (v2 | 0);
+ pos += 4;
+ }
+ v1 = x1 >>> pos & 0x00000003;
+ if (i > v1) {
+ i -= (v1 | 0);
+ pos += 2;
+ }
+ v0 = x >>> pos & 0x00000001;
+ if (i > v0) {
+ i -= (v0 | 0);
+ pos += 1;
+ }
+ return (pos | 0);
+};
+
+/**
+ * @return {!string}
+ */
+BitVector.prototype.dump$ = function () {
+ /** @type {Array.<undefined|!string>} */
+ var contents;
+ contents = [ ];
+ contents.push(Binary$dump32bitNumber$N(this._size));
+ contents.push(Binary$dump32bitNumberList$AN(this._v));
+ return contents.join('');
+};
+
+/**
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+BitVector.prototype.dump$LCompressionReport$ = function (report) {
+ /** @type {Array.<undefined|!string>} */
+ var contents;
+ contents = [ ];
+ contents.push(Binary$dump32bitNumber$N(this._size));
+ CompressionReport$add$LCompressionReport$II(report, 2, 2);
+ contents.push(Binary$dump32bitNumberList$ANLCompressionReport$(this._v, report));
+ return contents.join('');
+};
+
+/**
+ * @param {!string} data
+ * @return {!number}
+ */
+BitVector.prototype.load$S = function (data) {
+ return this.load$SI(data, 0);
+};
+
+/**
+ * @param {!string} data
+ * @param {!number} offset
+ * @return {!number}
+ */
+BitVector.prototype.load$SI = function (data, offset) {
+ /** @type {LoadedNumberListResult} */
+ var result;
+ /** @type {!number} */
+ var result$0;
+ this._v.length = 0;
+ this._r.length = 0;
+ this._size = 0;
+ this._size1 = 0;
+ result$0 = data.charCodeAt(offset) * 65536 + data.charCodeAt(offset + 1);
+ this._size = (result$0 | 0);
+ result = Binary$load32bitNumberList$SI(data, offset + 2);
+ this._v = result.result;
+ this.build$();
+ return result.offset;
+};
+
+/**
+ * class WaveletMatrix extends Object
+ * @constructor
+ */
+function WaveletMatrix() {
+}
+
+/**
+ * @constructor
+ */
+function WaveletMatrix$() {
+ /** @type {Array.<undefined|BitVector>} */
+ var _bv$0;
+ /** @type {Array.<undefined|!number>} */
+ var _seps$0;
+ this._range = ({ });
+ _bv$0 = this._bv = [ ];
+ _seps$0 = this._seps = [ ];
+ this._bitsize = 16;
+ _bv$0.length = 0;
+ _seps$0.length = 0;
+ this._size = 0;
+};
+
+WaveletMatrix$.prototype = new WaveletMatrix;
+
+/**
+ * @return {!number}
+ */
+WaveletMatrix.prototype.bitsize$ = function () {
+ return this._bitsize;
+};
+
+/**
+ * @param {!number} charCode
+ */
+WaveletMatrix.prototype.setMaxCharCode$I = function (charCode) {
+ this._bitsize = (Math.ceil(Math.log(charCode) / 0.6931471805599453) | 0);
+};
+
+/**
+ */
+WaveletMatrix.prototype.clear$ = function () {
+ this._bv.length = 0;
+ this._seps.length = 0;
+ this._size = 0;
+};
+
+/**
+ * @param {!string} v
+ */
+WaveletMatrix.prototype.build$S = function (v) {
+ /** @type {!number} */
+ var size;
+ /** @type {!number} */
+ var bitsize;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var depth;
+ /** @type {Object.<string, undefined|!number>} */
+ var range_tmp;
+ /** @type {!number} */
+ var code;
+ /** @type {!boolean} */
+ var bit;
+ /** @type {!number} */
+ var key;
+ /** @type {Object.<string, undefined|!number>} */
+ var range_rev;
+ /** @type {!string} */
+ var range_key;
+ /** @type {!number} */
+ var value;
+ /** @type {!number} */
+ var pos0;
+ /** @type {undefined|!number} */
+ var pos1;
+ /** @type {!string} */
+ var range_rev_key;
+ /** @type {!number} */
+ var begin;
+ /** @type {undefined|!number} */
+ var end;
+ /** @type {!number} */
+ var num0;
+ /** @type {!number} */
+ var num1;
+ this._bv.length = 0;
+ this._seps.length = 0;
+ this._size = 0;
+ size = v.length;
+ bitsize = this._bitsize;
+ for (i = 0; i < bitsize; i++) {
+ this._bv.push(new BitVector$());
+ this._seps.push(0);
+ }
+ this._size = (size | 0);
+ for (i = 0; i < size; i++) {
+ this._bv[0].set$IB(i, this._uint2bit$II(v.charCodeAt(i), 0));
+ }
+ this._bv[0].build$();
+ this._seps[0] = this._bv[0].size$B(false);
+ this._range["0"] = 0;
+ this._range["1"] = this._seps[0];
+ depth = 1;
+ while (depth < bitsize) {
+ range_tmp = WaveletMatrix$_shallow_copy$HI(this._range);
+ for (i = 0; i < size; i++) {
+ code = v.charCodeAt(i);
+ bit = this._uint2bit$II(code, depth);
+ key = code >>> bitsize - depth;
+ this._bv[depth].set$IB(range_tmp[key + ""], bit);
+ range_tmp[key + ""]++;
+ }
+ this._bv[depth].build$();
+ this._seps[depth] = this._bv[depth].size$B(false);
+ range_rev = ({ });
+ for (range_key in this._range) {
+ value = this._range[range_key];
+ if (value != range_tmp[range_key]) {
+ range_rev[value + ""] = range_key | 0;
+ }
+ }
+ this._range = ({ });
+ pos0 = 0;
+ pos1 = this._seps[depth];
+ for (range_rev_key in range_rev) {
+ begin = range_rev_key | 0;
+ value = range_rev[range_rev_key];
+ end = range_tmp[value + ""];
+ num0 = this._bv[depth].rank$IB(end, false) - this._bv[depth].rank$IB(begin, false);
+ num1 = end - begin - num0;
+ if (num0 > 0) {
+ this._range[(value << 1) + ""] = (pos0 | 0);
+ pos0 += num0;
+ }
+ if (num1 > 0) {
+ this._range[(value << 1) + 1 + ""] = pos1;
+ pos1 += (num1 | 0);
+ }
+ }
+ depth++;
+ }
+};
+
+/**
+ * @return {!number}
+ */
+WaveletMatrix.prototype.size$ = function () {
+ return this._size;
+};
+
+/**
+ * @param {!number} c
+ * @return {!number}
+ */
+WaveletMatrix.prototype.size$I = function (c) {
+ return this.rank$II(this._size, c);
+};
+
+/**
+ * @param {!number} i
+ * @return {!number}
+ */
+WaveletMatrix.prototype.get$I = function (i) {
+ /** @type {!number} */
+ var value;
+ /** @type {!number} */
+ var depth;
+ /** @type {!boolean} */
+ var bit;
+ if (i >= this._size) {
+ throw new Error("WaveletMatrix.get() : range error");
+ }
+ value = 0;
+ depth = 0;
+ while (depth < this._bitsize) {
+ bit = this._bv[depth].get$I(i);
+ i = this._bv[depth].rank$IB(i, bit);
+ value <<= 1;
+ if (bit) {
+ i += this._seps[depth];
+ value += 1;
+ }
+ depth++;
+ }
+ return (value | 0);
+};
+
+/**
+ * @param {!number} i
+ * @param {!number} c
+ * @return {!number}
+ */
+WaveletMatrix.prototype.rank$II = function (i, c) {
+ /** @type {undefined|!number} */
+ var begin;
+ /** @type {!number} */
+ var end;
+ /** @type {!number} */
+ var depth;
+ /** @type {!boolean} */
+ var bit;
+ if (i > this._size) {
+ throw new Error("WaveletMatrix.rank(): range error");
+ }
+ if (i === 0) {
+ return 0;
+ }
+ begin = this._range[c + ""];
+ if (begin == null) {
+ return 0;
+ }
+ end = i;
+ depth = 0;
+ while (depth < this._bitsize) {
+ bit = this._uint2bit$II(c, depth);
+ end = this._bv[depth].rank$IB(end, bit);
+ if (bit) {
+ end += this._seps[depth];
+ }
+ depth++;
+ }
+ return (end - begin | 0);
+};
+
+/**
+ * @param {!number} i
+ * @param {!number} c
+ * @return {!number}
+ */
+WaveletMatrix.prototype.rank_less_than$II = function (i, c) {
+ /** @type {!number} */
+ var begin;
+ /** @type {!number} */
+ var end;
+ /** @type {!number} */
+ var depth;
+ /** @type {!number} */
+ var rlt;
+ /** @type {!number} */
+ var rank0_begin;
+ /** @type {!number} */
+ var rank0_end;
+ /** @type {Array.<undefined|!number>} */
+ var _seps$0;
+ if (i > this._size) {
+ throw new Error("WaveletMatrix.rank_less_than(): range error");
+ }
+ if (i === 0) {
+ return 0;
+ }
+ begin = 0;
+ end = i;
+ depth = 0;
+ rlt = 0;
+ while (depth < this._bitsize) {
+ rank0_begin = this._bv[depth].rank$IB(begin, false);
+ rank0_end = this._bv[depth].rank$IB(end, false);
+ if (this._uint2bit$II(c, depth)) {
+ rlt += rank0_end - rank0_begin;
+ begin += (_seps$0 = this._seps)[depth] - rank0_begin;
+ end += _seps$0[depth] - rank0_end;
+ } else {
+ begin = rank0_begin;
+ end = rank0_end;
+ }
+ depth++;
+ }
+ return (rlt | 0);
+};
+
+/**
+ * @return {!string}
+ */
+WaveletMatrix.prototype.dump$ = function () {
+ /** @type {Array.<undefined|!string>} */
+ var contents;
+ /** @type {!number} */
+ var i;
+ /** @type {Array.<undefined|!string>} */
+ var range_contents;
+ /** @type {!number} */
+ var counter;
+ /** @type {!string} */
+ var key;
+ contents = [ Binary$dump16bitNumber$I(this._bitsize), Binary$dump32bitNumber$N(this._size) ];
+ for (i = 0; i < this._bitsize; i++) {
+ contents.push(this._bv[i].dump$());
+ }
+ for (i = 0; i < this._bitsize; i++) {
+ contents.push(Binary$dump32bitNumber$N(this._seps[i]));
+ }
+ range_contents = [ ];
+ counter = 0;
+ for (key in this._range) {
+ range_contents.push(Binary$dump32bitNumber$N(key | 0));
+ range_contents.push(Binary$dump32bitNumber$N(this._range[key]));
+ counter++;
+ }
+ contents.push(Binary$dump32bitNumber$N(counter));
+ return contents.join('') + range_contents.join('');
+};
+
+/**
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+WaveletMatrix.prototype.dump$LCompressionReport$ = function (report) {
+ /** @type {Array.<undefined|!string>} */
+ var contents;
+ /** @type {!number} */
+ var i;
+ /** @type {Array.<undefined|!string>} */
+ var range_contents;
+ /** @type {!number} */
+ var counter;
+ /** @type {!string} */
+ var key;
+ contents = [ Binary$dump16bitNumber$I(this._bitsize), Binary$dump32bitNumber$N(this._size) ];
+ CompressionReport$add$LCompressionReport$II(report, 3, 3);
+ for (i = 0; i < this._bitsize; i++) {
+ contents.push(this._bv[i].dump$LCompressionReport$(report));
+ }
+ for (i = 0; i < this._bitsize; i++) {
+ contents.push(Binary$dump32bitNumber$N(this._seps[i]));
+ CompressionReport$add$LCompressionReport$II(report, 2, 2);
+ }
+ range_contents = [ ];
+ counter = 0;
+ for (key in this._range) {
+ range_contents.push(Binary$dump32bitNumber$N(key | 0));
+ range_contents.push(Binary$dump32bitNumber$N(this._range[key]));
+ CompressionReport$add$LCompressionReport$II(report, 4, 4);
+ counter++;
+ }
+ CompressionReport$add$LCompressionReport$II(report, 2, 2);
+ contents.push(Binary$dump32bitNumber$N(counter));
+ return contents.join('') + range_contents.join('');
+};
+
+/**
+ * @param {!string} data
+ * @return {!number}
+ */
+WaveletMatrix.prototype.load$S = function (data) {
+ return this.load$SI(data, 0);
+};
+
+/**
+ * @param {!string} data
+ * @param {!number} offset
+ * @return {!number}
+ */
+WaveletMatrix.prototype.load$SI = function (data, offset) {
+ /** @type {!number} */
+ var i;
+ /** @type {BitVector} */
+ var bit_vector;
+ /** @type {!number} */
+ var range_size;
+ /** @type {!number} */
+ var value;
+ /** @type {!number} */
+ var offset$0;
+ /** @type {!number} */
+ var result$0;
+ /** @type {!number} */
+ var result$1;
+ /** @type {!number} */
+ var result$2;
+ this._bv.length = 0;
+ this._seps.length = 0;
+ this._size = 0;
+ offset$0 = offset++;
+ this._bitsize = (data.charCodeAt(offset$0) | 0);
+ result$0 = data.charCodeAt(offset) * 65536 + data.charCodeAt(offset + 1);
+ this._size = (result$0 | 0);
+ offset += 2;
+ for (i = 0; i < this._bitsize; i++) {
+ bit_vector = new BitVector$();
+ offset = bit_vector.load$SI(data, offset);
+ this._bv.push(bit_vector);
+ }
+ for (i = 0; i < this._bitsize; (i++, offset += 2)) {
+ this._seps.push(Binary$load32bitNumber$SI(data, offset));
+ }
+ result$1 = data.charCodeAt(offset) * 65536 + data.charCodeAt(offset + 1);
+ range_size = result$1;
+ offset += 2;
+ for (i = 0; i < range_size; (i++, offset += 4)) {
+ result$2 = data.charCodeAt(offset) * 65536 + data.charCodeAt(offset + 1);
+ value = Binary$load32bitNumber$SI(data, offset + 2);
+ this._range[result$2 + ""] = (value | 0);
+ }
+ return offset;
+};
+
+/**
+ * @param {Object.<string, undefined|!number>} input
+ * @return {Object.<string, undefined|!number>}
+ */
+WaveletMatrix._shallow_copy$HI = function (input) {
+ /** @type {Object.<string, undefined|!number>} */
+ var result;
+ /** @type {!string} */
+ var key;
+ result = ({ });
+ for (key in input) {
+ result[key] = input[key];
+ }
+ return result;
+};
+
+var WaveletMatrix$_shallow_copy$HI = WaveletMatrix._shallow_copy$HI;
+
+/**
+ * @param {!number} c
+ * @param {!number} i
+ * @return {!boolean}
+ */
+WaveletMatrix.prototype._uint2bit$II = function (c, i) {
+ return (c >>> this._bitsize - 1 - i & 0x1) === 0x1;
+};
+
+/**
+ * class BurrowsWheelerTransform extends Object
+ * @constructor
+ */
+function BurrowsWheelerTransform() {
+}
+
+/**
+ * @constructor
+ */
+function BurrowsWheelerTransform$() {
+ this._str = "";
+ this._size = 0;
+ this._head = 0;
+ this._suffixarray = [ ];
+};
+
+BurrowsWheelerTransform$.prototype = new BurrowsWheelerTransform;
+
+/**
+ * @param {BurrowsWheelerTransform} $this
+ * @return {!number}
+ */
+BurrowsWheelerTransform.size$LBurrowsWheelerTransform$ = function ($this) {
+ return $this._size;
+};
+
+var BurrowsWheelerTransform$size$LBurrowsWheelerTransform$ = BurrowsWheelerTransform.size$LBurrowsWheelerTransform$;
+
+/**
+ * @param {BurrowsWheelerTransform} $this
+ * @return {!number}
+ */
+BurrowsWheelerTransform.head$LBurrowsWheelerTransform$ = function ($this) {
+ return $this._head;
+};
+
+var BurrowsWheelerTransform$head$LBurrowsWheelerTransform$ = BurrowsWheelerTransform.head$LBurrowsWheelerTransform$;
+
+/**
+ * @param {BurrowsWheelerTransform} $this
+ */
+BurrowsWheelerTransform.clear$LBurrowsWheelerTransform$ = function ($this) {
+ $this._str = "";
+ $this._size = 0;
+ $this._head = 0;
+ $this._suffixarray.length = 0;
+};
+
+var BurrowsWheelerTransform$clear$LBurrowsWheelerTransform$ = BurrowsWheelerTransform.clear$LBurrowsWheelerTransform$;
+
+/**
+ * @param {BurrowsWheelerTransform} $this
+ * @param {!string} str
+ */
+BurrowsWheelerTransform.build$LBurrowsWheelerTransform$S = function ($this, str) {
+ /** @type {!string} */
+ var _str$0;
+ /** @type {Array.<undefined|!number>} */
+ var _suffixarray$0;
+ _str$0 = $this._str = str;
+ $this._size = _str$0.length;
+ _suffixarray$0 = $this._suffixarray = SAIS$make$S(str);
+ $this._head = (_suffixarray$0.indexOf(0) | 0);
+};
+
+var BurrowsWheelerTransform$build$LBurrowsWheelerTransform$S = BurrowsWheelerTransform.build$LBurrowsWheelerTransform$S;
+
+/**
+ * @param {BurrowsWheelerTransform} $this
+ * @param {!number} i
+ * @return {!string}
+ */
+BurrowsWheelerTransform.get$LBurrowsWheelerTransform$I = function ($this, i) {
+ /** @type {!number} */
+ var size;
+ /** @type {!number} */
+ var index;
+ size = $this._size;
+ if (i >= size) {
+ throw new Error("BurrowsWheelerTransform.get() : range error");
+ }
+ index = ($this._suffixarray[i] + size - 1) % size;
+ return $this._str.charAt(index);
+};
+
+var BurrowsWheelerTransform$get$LBurrowsWheelerTransform$I = BurrowsWheelerTransform.get$LBurrowsWheelerTransform$I;
+
+/**
+ * @param {BurrowsWheelerTransform} $this
+ * @return {!string}
+ */
+BurrowsWheelerTransform.get$LBurrowsWheelerTransform$ = function ($this) {
+ /** @type {Array.<undefined|!string>} */
+ var str;
+ /** @type {!number} */
+ var size;
+ /** @type {!number} */
+ var i;
+ str = [ ];
+ size = $this._size;
+ for (i = 0; i < size; i++) {
+ str.push(BurrowsWheelerTransform$get$LBurrowsWheelerTransform$I($this, i));
+ }
+ return str.join("");
+};
+
+var BurrowsWheelerTransform$get$LBurrowsWheelerTransform$ = BurrowsWheelerTransform.get$LBurrowsWheelerTransform$;
+
+/**
+ * @param {BurrowsWheelerTransform} $this
+ * @param {!string} replace
+ * @return {!string}
+ */
+BurrowsWheelerTransform.get$LBurrowsWheelerTransform$S = function ($this, replace) {
+ /** @type {!string} */
+ var result;
+ result = BurrowsWheelerTransform$get$LBurrowsWheelerTransform$($this);
+ return result.replace(BurrowsWheelerTransform.END_MARKER, replace);
+};
+
+var BurrowsWheelerTransform$get$LBurrowsWheelerTransform$S = BurrowsWheelerTransform.get$LBurrowsWheelerTransform$S;
+
+/**
+ * class OArray extends Object
+ * @constructor
+ */
+function OArray() {
+}
+
+/**
+ * @constructor
+ * @param {Array.<undefined|!number>} array
+ */
+function OArray$AI(array) {
+ this.array = array;
+ this.offset = 0;
+};
+
+OArray$AI.prototype = new OArray;
+
+/**
+ * @constructor
+ * @param {Array.<undefined|!number>} array
+ * @param {!number} offset
+ */
+function OArray$AII(array, offset) {
+ this.array = array;
+ this.offset = offset;
+};
+
+OArray$AII.prototype = new OArray;
+
+/**
+ * @param {OArray} $this
+ * @param {!number} index
+ * @return {!number}
+ */
+OArray.get$LOArray$I = function ($this, index) {
+ return $this.array[index + $this.offset];
+};
+
+var OArray$get$LOArray$I = OArray.get$LOArray$I;
+
+/**
+ * @param {OArray} $this
+ * @param {!number} index
+ * @param {!number} value
+ */
+OArray.set$LOArray$II = function ($this, index, value) {
+ $this.array[index + $this.offset] = value;
+};
+
+var OArray$set$LOArray$II = OArray.set$LOArray$II;
+
+/**
+ * @param {OArray} $this
+ * @param {!number} index
+ * @return {!boolean}
+ */
+OArray.isS$LOArray$I = function ($this, index) {
+ /** @type {Array.<undefined|!number>} */
+ var array$0;
+ /** @type {!number} */
+ var offset$0;
+ return (array$0 = $this.array)[index + (offset$0 = $this.offset)] < array$0[index + offset$0 + 1];
+};
+
+var OArray$isS$LOArray$I = OArray.isS$LOArray$I;
+
+/**
+ * @param {OArray} $this
+ * @param {!number} index1
+ * @param {!number} index2
+ * @return {!boolean}
+ */
+OArray.compare$LOArray$II = function ($this, index1, index2) {
+ /** @type {Array.<undefined|!number>} */
+ var array$0;
+ /** @type {!number} */
+ var offset$0;
+ return (array$0 = $this.array)[index1 + (offset$0 = $this.offset)] == array$0[index2 + offset$0];
+};
+
+var OArray$compare$LOArray$II = OArray.compare$LOArray$II;
+
+/**
+ * class SAIS extends Object
+ * @constructor
+ */
+function SAIS() {
+}
+
+/**
+ * @constructor
+ */
+function SAIS$() {
+};
+
+SAIS$.prototype = new SAIS;
+
+/**
+ * @param {BitVector} t
+ * @param {!number} i
+ * @return {!boolean}
+ */
+SAIS._isLMS$LBitVector$I = function (t, i) {
+ return i > 0 && t.get$I(i) && ! t.get$I(i - 1);
+};
+
+var SAIS$_isLMS$LBitVector$I = SAIS._isLMS$LBitVector$I;
+
+/**
+ * @param {OArray} s
+ * @param {Array.<undefined|!number>} bkt
+ * @param {!number} n
+ * @param {!number} K
+ * @param {!boolean} end
+ */
+SAIS._getBuckets$LOArray$AIIIB = function (s, bkt, n, K, end) {
+ /** @type {!number} */
+ var sum;
+ /** @type {!number} */
+ var i;
+ sum = 0;
+ for (i = 0; i <= K; i++) {
+ bkt[i] = 0;
+ }
+ for (i = 0; i < n; i++) {
+ bkt[OArray$get$LOArray$I(s, i)]++;
+ }
+ for (i = 0; i <= K; i++) {
+ sum += bkt[i];
+ bkt[i] = ((end ? sum : sum - bkt[i]) | 0);
+ }
+};
+
+var SAIS$_getBuckets$LOArray$AIIIB = SAIS._getBuckets$LOArray$AIIIB;
+
+/**
+ * @param {BitVector} t
+ * @param {Array.<undefined|!number>} SA
+ * @param {OArray} s
+ * @param {Array.<undefined|!number>} bkt
+ * @param {!number} n
+ * @param {!number} K
+ * @param {!boolean} end
+ */
+SAIS._induceSAl$LBitVector$AILOArray$AIIIB = function (t, SA, s, bkt, n, K, end) {
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var j;
+ SAIS$_getBuckets$LOArray$AIIIB(s, bkt, n, K, end);
+ for (i = 0; i < n; i++) {
+ j = SA[i] - 1;
+ if (j >= 0 && ! t.get$I(j)) {
+ SA[bkt[OArray$get$LOArray$I(s, j)]++] = (j | 0);
+ }
+ }
+};
+
+var SAIS$_induceSAl$LBitVector$AILOArray$AIIIB = SAIS._induceSAl$LBitVector$AILOArray$AIIIB;
+
+/**
+ * @param {BitVector} t
+ * @param {Array.<undefined|!number>} SA
+ * @param {OArray} s
+ * @param {Array.<undefined|!number>} bkt
+ * @param {!number} n
+ * @param {!number} K
+ * @param {!boolean} end
+ */
+SAIS._induceSAs$LBitVector$AILOArray$AIIIB = function (t, SA, s, bkt, n, K, end) {
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var j;
+ SAIS$_getBuckets$LOArray$AIIIB(s, bkt, n, K, end);
+ for (i = n - 1; i >= 0; i--) {
+ j = SA[i] - 1;
+ if (j >= 0 && t.get$I(j)) {
+ SA[-- bkt[OArray$get$LOArray$I(s, j)]] = (j | 0);
+ }
+ }
+};
+
+var SAIS$_induceSAs$LBitVector$AILOArray$AIIIB = SAIS._induceSAs$LBitVector$AILOArray$AIIIB;
+
+/**
+ * @param {!string} source
+ * @return {Array.<undefined|!number>}
+ */
+SAIS.make$S = function (source) {
+ /** @type {Array.<undefined|!number>} */
+ var charCodes;
+ /** @type {!number} */
+ var maxCode;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var code;
+ /** @type {Array.<undefined|!number>} */
+ var SA;
+ /** @type {OArray} */
+ var s;
+ charCodes = [ ];
+ charCodes.length = source.length;
+ maxCode = 0;
+ for (i = 0; i < source.length; i++) {
+ code = source.charCodeAt(i);
+ charCodes[i] = (code | 0);
+ maxCode = (code > maxCode ? code : maxCode);
+ }
+ SA = [ ];
+ SA.length = source.length;
+ s = ({offset: 0, array: charCodes});
+ SAIS$_make$LOArray$AIII(s, SA, source.length, maxCode);
+ return SA;
+};
+
+var SAIS$make$S = SAIS.make$S;
+
+/**
+ * @param {OArray} s
+ * @param {Array.<undefined|!number>} SA
+ * @param {!number} n
+ * @param {!number} K
+ */
+SAIS._make$LOArray$AIII = function (s, SA, n, K) {
+ /** @type {BitVector} */
+ var t;
+ /** @type {!number} */
+ var i;
+ /** @type {Array.<undefined|!number>} */
+ var bkt;
+ /** @type {!number} */
+ var n1;
+ /** @type {!number} */
+ var name;
+ /** @type {!number} */
+ var prev;
+ /** @type {undefined|!number} */
+ var pos;
+ /** @type {!boolean} */
+ var diff;
+ /** @type {!number} */
+ var d;
+ /** @type {!number} */
+ var j;
+ /** @type {Array.<undefined|!number>} */
+ var SA1;
+ /** @type {OArray} */
+ var s1;
+ /** @type {!number} */
+ var i$0;
+ /** @type {!number} */
+ var index$0;
+ t = new BitVector$();
+ t.set$IB(n - 2, false);
+ t.set$IB(n - 1, true);
+ for (i = n - 3; i >= 0; i--) {
+ t.set$IB(i, OArray$isS$LOArray$I(s, i) || OArray$compare$LOArray$II(s, i, i + 1) && t.get$I(i + 1));
+ }
+ bkt = [ ];
+ bkt.length = K + 1;
+ SAIS$_getBuckets$LOArray$AIIIB(s, bkt, n, K, true);
+ for (i = 0; i < n; i++) {
+ SA[i] = -1;
+ }
+ for (i = 1; i < n; i++) {
+ if (SAIS$_isLMS$LBitVector$I(t, i)) {
+ SA[-- bkt[OArray$get$LOArray$I(s, i)]] = (i | 0);
+ }
+ }
+ SAIS$_induceSAl$LBitVector$AILOArray$AIIIB(t, SA, s, bkt, n, K, false);
+ SAIS$_induceSAs$LBitVector$AILOArray$AIIIB(t, SA, s, bkt, n, K, true);
+ n1 = 0;
+ for (i = 0; i < n; i++) {
+ i$0 = SA[i];
+ if (i$0 > 0 && t.get$I(i$0) && ! t.get$I(i$0 - 1)) {
+ SA[n1++] = SA[i];
+ }
+ }
+ for (i = n1; i < n; i++) {
+ SA[i] = -1;
+ }
+ name = 0;
+ prev = -1;
+ for (i = 0; i < n1; i++) {
+ pos = SA[i];
+ diff = false;
+ for (d = 0; d < n; d++) {
+ if (prev === -1 || ! OArray$compare$LOArray$II(s, pos + d, prev + d) || t.get$I(pos + d) !== t.get$I(prev + d)) {
+ diff = true;
+ break;
+ } else {
+ if (d > 0 && (SAIS$_isLMS$LBitVector$I(t, pos + d) || SAIS$_isLMS$LBitVector$I(t, prev + d))) {
+ break;
+ }
+ }
+ }
+ if (diff) {
+ name++;
+ prev = pos;
+ }
+ pos = ((pos % 2 === 0 ? pos / 2 : (pos - 1) / 2) | 0);
+ SA[n1 + pos] = (name - 1 | 0);
+ }
+ for ((i = n - 1, j = n - 1); i >= n1; i--) {
+ if (SA[i] >= 0) {
+ SA[j--] = SA[i];
+ }
+ }
+ SA1 = SA;
+ s1 = ({offset: n - n1, array: SA});
+ if (name < n1) {
+ SAIS$_make$LOArray$AIII(s1, SA1, n1, name - 1);
+ } else {
+ for (i = 0; i < n1; i++) {
+ SA1[OArray$get$LOArray$I(s1, i)] = (i | 0);
+ }
+ }
+ bkt = [ ];
+ bkt.length = K + 1;
+ SAIS$_getBuckets$LOArray$AIIIB(s, bkt, n, K, true);
+ for ((i = 1, j = 0); i < n; i++) {
+ if (SAIS$_isLMS$LBitVector$I(t, i)) {
+ OArray$set$LOArray$II(s1, j++, i);
+ }
+ }
+ for (i = 0; i < n1; i++) {
+ index$0 = SA1[i];
+ SA1[i] = s1.array[index$0 + s1.offset];
+ }
+ for (i = n1; i < n; i++) {
+ SA[i] = -1;
+ }
+ for (i = n1 - 1; i >= 0; i--) {
+ j = SA[i];
+ SA[i] = -1;
+ SA[-- bkt[OArray$get$LOArray$I(s, j)]] = (j | 0);
+ }
+ SAIS$_induceSAl$LBitVector$AILOArray$AIIIB(t, SA, s, bkt, n, K, false);
+ SAIS$_induceSAs$LBitVector$AILOArray$AIIIB(t, SA, s, bkt, n, K, true);
+};
+
+var SAIS$_make$LOArray$AIII = SAIS._make$LOArray$AIII;
+
+OktaviaSearch._stemmer = null;
+OktaviaSearch._instance = null;
+$__jsx_lazy_init(Oktavia, "eof", function () {
+ return String.fromCharCode(0);
+});
+$__jsx_lazy_init(Oktavia, "eob", function () {
+ return String.fromCharCode(1);
+});
+$__jsx_lazy_init(Oktavia, "unknown", function () {
+ return String.fromCharCode(3);
+});
+Binary._base64EncodeChars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
+$__jsx_lazy_init(Binary, "_base64DecodeChars", function () {
+ return [ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 62, -1, -1, -1, 63, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, -1, -1, -1, -1, -1, -1, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -1, -1, -1, -1, -1, -1, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, -1, -1, -1, -1 ];
+});
+$__jsx_lazy_init(Style, "console", function () {
+ return ({ 'title': [ '\x1B[32m\x1b[4m', '\x1B[39m\x1b[0m' ], 'url': [ '\x1B[34m', '\x1B[39m' ], 'hit': [ '\x1B[4m', '\x1B[0m' ], 'del': [ '\x1B[9m', '\x1B[0m' ], 'summary': [ '\x1B[90m', '\x1B[39m' ] });
+});
+$__jsx_lazy_init(Style, "html", function () {
+ return ({ 'title': [ '<span class="title">', '</span>' ], 'url': [ '<span class="url">', '</span>' ], 'hit': [ '<span class="hit">', '</span>' ], 'del': [ '<del>', '</del>' ], 'summary': [ '<span class="reuslt">', '</span>' ] });
+});
+$__jsx_lazy_init(Style, "ignore", function () {
+ return ({ 'tilte': [ '', '' ], 'url': [ '', '' ], 'hit': [ '', '' ], 'del': [ '', '' ], 'summary': [ '', '' ] });
+});
+$__jsx_lazy_init(_Common, "buffers", function () {
+ return [ "comment", "sgmlDecl", "textNode", "tagName", "doctype", "procInstName", "procInstBody", "entity", "attribName", "attribValue", "cdata", "script" ];
+});
+$__jsx_lazy_init(_Common, "EVENTS", function () {
+ return [ "text", "processinginstruction", "sgmldeclaration", "doctype", "comment", "attribute", "opentag", "closetag", "opencdata", "cdata", "clo_State.CDATA", "error", "end", "ready", "script", "opennamespace", "closenamespace" ];
+});
+_Common.MAX_BUFFER_LENGTH = 65536;
+_State.BEGIN = 1;
+_State.TEXT = 2;
+_State.TEXT_ENTITY = 3;
+_State.OPEN_WAKA = 4;
+_State.SGML_DECL = 5;
+_State.SGML_DECL_QUOTED = 6;
+_State.DOCTYPE = 7;
+_State.DOCTYPE_QUOTED = 8;
+_State.DOCTYPE_DTD = 9;
+_State.DOCTYPE_DTD_QUOTED = 10;
+_State.COMMENT_STARTING = 11;
+_State.COMMENT = 12;
+_State.COMMENT_ENDING = 13;
+_State.COMMENT_ENDED = 14;
+_State.CDATA = 15;
+_State.CDATA_ENDING = 16;
+_State.CDATA_ENDING_2 = 17;
+_State.PROC_INST = 18;
+_State.PROC_INST_BODY = 19;
+_State.PROC_INST_ENDING = 20;
+_State.OPEN_TAG = 21;
+_State.OPEN_TAG_SLASH = 22;
+_State.ATTRIB = 23;
+_State.ATTRIB_NAME = 24;
+_State.ATTRIB_NAME_SAW_WHITE = 25;
+_State.ATTRIB_VALUE = 26;
+_State.ATTRIB_VALUE_QUOTED = 27;
+_State.ATTRIB_VALUE_UNQUOTED = 28;
+_State.ATTRIB_VALUE_ENTITY_Q = 29;
+_State.ATTRIB_VALUE_ENTITY_U = 30;
+_State.CLOSE_TAG = 31;
+_State.CLOSE_TAG_SAW_WHITE = 32;
+_State.SCRIPT = 33;
+_State.SCRIPT_ENDING = 34;
+$__jsx_lazy_init(_Entities, "_entities", function () {
+ return ({ "amp": "&", "gt": ">", "lt": "<", "quot": "\"", "apos": "'", "AElig": 198, "Aacute": 193, "Acirc": 194, "Agrave": 192, "Aring": 197, "Atilde": 195, "Auml": 196, "Ccedil": 199, "ETH": 208, "Eacute": 201, "Ecirc": 202, "Egrave": 200, "Euml": 203, "Iacute": 205, "Icirc": 206, "Igrave": 204, "Iuml": 207, "Ntilde": 209, "Oacute": 211, "Ocirc": 212, "Ograve": 210, "Oslash": 216, "Otilde": 213, "Ouml": 214, "THORN": 222, "Uacute": 218, "Ucirc": 219, "Ugrave": 217, "Uuml": 220, "Yacute": 221, "aacute": 225, "acirc": 226, "aelig": 230, "agrave": 224, "aring": 229, "atilde": 227, "auml": 228, "ccedil": 231, "eacute": 233, "ecirc": 234, "egrave": 232, "eth": 240, "euml": 235, "iacute": 237, "icirc": 238, "igrave": 236, "iuml": 239, "ntilde": 241, "oacute": 243, "ocirc": 244, "ograve": 242, "oslash": 248, "otilde": 245, "ouml": 246, "szlig": 223, "thorn": 254, "uacute": 250, "ucirc": 251, "ugrave": 249, "uuml": 252, "yacute": 253, "yuml": 255, "copy": 169, "reg": 174, "nbsp": 160, "iexcl": 161, "cent": 162, "pound": 163, "curren": 164, "yen": 165, "brvbar": 166, "sect": 167, "uml": 168, "ordf": 170, "laquo": 171, "not": 172, "shy": 173, "macr": 175, "deg": 176, "plusmn": 177, "sup1": 185, "sup2": 178, "sup3": 179, "acute": 180, "micro": 181, "para": 182, "middot": 183, "cedil": 184, "ordm": 186, "raquo": 187, "frac14": 188, "frac12": 189, "frac34": 190, "iquest": 191, "times": 215, "divide": 247, "OElig": 338, "oelig": 339, "Scaron": 352, "scaron": 353, "Yuml": 376, "fnof": 402, "circ": 710, "tilde": 732, "Alpha": 913, "Beta": 914, "Gamma": 915, "Delta": 916, "Epsilon": 917, "Zeta": 918, "Eta": 919, "Theta": 920, "Iota": 921, "Kappa": 922, "Lambda": 923, "Mu": 924, "Nu": 925, "Xi": 926, "Omicron": 927, "Pi": 928, "Rho": 929, "Sigma": 931, "Tau": 932, "Upsilon": 933, "Phi": 934, "Chi": 935, "Psi": 936, "Omega": 937, "alpha": 945, "beta": 946, "gamma": 947, "delta": 948, "epsilon": 949, "zeta": 950, "eta": 951, "theta": 952, "iota": 953, "kappa": 954, "lambda": 955, "mu": 956, "nu": 957, "xi": 958, "omicron": 959, "pi": 960, "rho": 961, "sigmaf": 962, "sigma": 963, "tau": 964, "upsilon": 965, "phi": 966, "chi": 967, "psi": 968, "omega": 969, "thetasym": 977, "upsih": 978, "piv": 982, "ensp": 8194, "emsp": 8195, "thinsp": 8201, "zwnj": 8204, "zwj": 8205, "lrm": 8206, "rlm": 8207, "ndash": 8211, "mdash": 8212, "lsquo": 8216, "rsquo": 8217, "sbquo": 8218, "ldquo": 8220, "rdquo": 8221, "bdquo": 8222, "dagger": 8224, "Dagger": 8225, "bull": 8226, "hellip": 8230, "permil": 8240, "prime": 8242, "Prime": 8243, "lsaquo": 8249, "rsaquo": 8250, "oline": 8254, "frasl": 8260, "euro": 8364, "image": 8465, "weierp": 8472, "real": 8476, "trade": 8482, "alefsym": 8501, "larr": 8592, "uarr": 8593, "rarr": 8594, "darr": 8595, "harr": 8596, "crarr": 8629, "lArr": 8656, "uArr": 8657, "rArr": 8658, "dArr": 8659, "hArr": 8660, "forall": 8704, "part": 8706, "exist": 8707, "empty": 8709, "nabla": 8711, "isin": 8712, "notin": 8713, "ni": 8715, "prod": 8719, "sum": 8721, "minus": 8722, "lowast": 8727, "radic": 8730, "prop": 8733, "infin": 8734, "ang": 8736, "and": 8743, "or": 8744, "cap": 8745, "cup": 8746, "int": 8747, "there4": 8756, "sim": 8764, "cong": 8773, "asymp": 8776, "ne": 8800, "equiv": 8801, "le": 8804, "ge": 8805, "sub": 8834, "sup": 8835, "nsub": 8836, "sube": 8838, "supe": 8839, "oplus": 8853, "otimes": 8855, "perp": 8869, "sdot": 8901, "lceil": 8968, "rceil": 8969, "lfloor": 8970, "rfloor": 8971, "lang": 9001, "rang": 9002, "loz": 9674, "spades": 9824, "clubs": 9827, "hearts": 9829, "diams": 9830 });
+});
+BitVector.SMALL_BLOCK_SIZE = 32;
+BitVector.LARGE_BLOCK_SIZE = 256;
+BitVector.BLOCK_RATE = 8;
+$__jsx_lazy_init(BurrowsWheelerTransform, "END_MARKER", function () {
+ return String.fromCharCode(0);
+});
+var $__jsx_classMap = {
+ "tool/web/oktavia-search.jsx": {
+ _Result: _Result,
+ _Result$SSSI: _Result$SSSI,
+ _Proposal: _Proposal,
+ _Proposal$SSI: _Proposal$SSI,
+ OktaviaSearch: OktaviaSearch,
+ OktaviaSearch$I: OktaviaSearch$I,
+ _Main: _Main,
+ _Main$: _Main$
+ },
+ "src/oktavia.jsx": {
+ Oktavia: Oktavia,
+ Oktavia$: Oktavia$
+ },
+ "src/binary-util.jsx": {
+ Binary: Binary,
+ Binary$: Binary$,
+ LoadedStringResult: LoadedStringResult,
+ LoadedStringResult$SI: LoadedStringResult$SI,
+ LoadedStringListResult: LoadedStringListResult,
+ LoadedStringListResult$SI: LoadedStringListResult$SI,
+ LoadedStringListMapResult: LoadedStringListMapResult,
+ LoadedStringListMapResult$SI: LoadedStringListMapResult$SI,
+ LoadedNumberListResult: LoadedNumberListResult,
+ LoadedNumberListResult$SI: LoadedNumberListResult$SI,
+ CompressionReport: CompressionReport,
+ CompressionReport$: CompressionReport$
+ },
+ "src/query.jsx": {
+ Query: Query,
+ Query$: Query$
+ },
+ "src/query-string-parser.jsx": {
+ QueryStringParser: QueryStringParser,
+ QueryStringParser$: QueryStringParser$
+ },
+ "src/search-result.jsx": {
+ Proposal: Proposal,
+ Proposal$II: Proposal$II,
+ Position: Position,
+ Position$SIB: Position$SIB,
+ SearchUnit: SearchUnit,
+ SearchUnit$I: SearchUnit$I,
+ SingleResult: SingleResult,
+ SingleResult$: SingleResult$,
+ SingleResult$SBB: SingleResult$SBB,
+ SearchSummary: SearchSummary,
+ SearchSummary$: SearchSummary$,
+ SearchSummary$LOktavia$: SearchSummary$LOktavia$
+ },
+ "src/style.jsx": {
+ Style: Style,
+ Style$S: Style$S,
+ _HTMLHandler: _HTMLHandler,
+ _HTMLHandler$HASB: _HTMLHandler$HASB
+ },
+ "src/stemmer/stemmer.jsx": {
+ Stemmer: Stemmer,
+ Stemmer$: Stemmer$
+ },
+ "src/metadata.jsx": {
+ Metadata: Metadata,
+ Metadata$LOktavia$: Metadata$LOktavia$,
+ Section: Section,
+ Section$LOktavia$: Section$LOktavia$,
+ Splitter: Splitter,
+ Splitter$LOktavia$: Splitter$LOktavia$,
+ Splitter$LOktavia$S: Splitter$LOktavia$S,
+ Table: Table,
+ Table$LOktavia$AS: Table$LOktavia$AS,
+ Block: Block,
+ Block$LOktavia$: Block$LOktavia$
+ },
+ "src/fm-index.jsx": {
+ FMIndex: FMIndex,
+ FMIndex$: FMIndex$
+ },
+ "src/sax.jsx": {
+ Tag: Tag,
+ Tag$S: Tag$S,
+ _Common: _Common,
+ _Common$: _Common$,
+ _State: _State,
+ _State$: _State$,
+ SAXHandler: SAXHandler,
+ SAXHandler$: SAXHandler$,
+ SAXParser: SAXParser,
+ SAXParser$LSAXHandler$: SAXParser$LSAXHandler$,
+ SAXParser$LSAXHandler$B: SAXParser$LSAXHandler$B,
+ Char: Char,
+ Char$: Char$,
+ _Entities: _Entities,
+ _Entities$: _Entities$
+ },
+ "src/bit-vector.jsx": {
+ BitVector: BitVector,
+ BitVector$: BitVector$
+ },
+ "src/wavelet-matrix.jsx": {
+ WaveletMatrix: WaveletMatrix,
+ WaveletMatrix$: WaveletMatrix$
+ },
+ "src/burrows-wheeler-transform.jsx": {
+ BurrowsWheelerTransform: BurrowsWheelerTransform,
+ BurrowsWheelerTransform$: BurrowsWheelerTransform$
+ },
+ "src/sais.jsx": {
+ OArray: OArray,
+ OArray$AI: OArray$AI,
+ OArray$AII: OArray$AII,
+ SAIS: SAIS,
+ SAIS$: SAIS$
+ }
+};
+
+
+/**
+ * launches _Main.main(:string[]):void invoked by jsx --run|--executable
+ */
+JSX.runMain = function (sourceFile, args) {
+ var module = JSX.require(sourceFile);
+ if (! module) {
+ throw new ReferenceError("entry point module not found in " + sourceFile);
+ }
+ if (! module._Main) {
+ throw new ReferenceError("entry point _Main not found in " + sourceFile);
+ }
+ if (! module._Main.main$AS) {
+ throw new ReferenceError("entry point _Main.main(:string[]):void not found in " + sourceFile);
+ }
+ module._Main.main$AS(args);
+};
+
+/**
+ * launches _Test#test*():void invoked by jsx --test
+ */
+JSX.runTests = function (sourceFile, tests) {
+ var module = JSX.require(sourceFile);
+ var testClass = module._Test$;
+
+ if (!testClass) return; // skip if there's no test class
+
+ if(tests.length === 0) {
+ var p = testClass.prototype;
+ for (var m in p) {
+ if (p[m] instanceof Function
+ && /^test.*[$]$/.test(m)) {
+ tests.push(m);
+ }
+ }
+ }
+ else { // set as process arguments
+ tests = tests.map(function (name) {
+ return name + "$"; // mangle for function test*():void
+ });
+ }
+
+ var testCase = new testClass();
+
+ if (testCase.beforeClass$AS != null)
+ testCase.beforeClass$AS(tests);
+
+ for (var i = 0; i < tests.length; ++i) {
+ (function (method) {
+ if (method in testCase) {
+ testCase.run$SF$V$(method, function() { testCase[method](); });
+ }
+ else {
+ throw new ReferenceError("No such test method: " + method);
+ }
+ }(tests[i]));
+ }
+
+ if (testCase.afterClass$ != null)
+ testCase.afterClass$();
+};
+/**
+ * call a function on load/DOMContentLoaded
+ */
+function $__jsx_onload (event) {
+ window.removeEventListener("load", $__jsx_onload);
+ document.removeEventListener("DOMContentLoaded", $__jsx_onload);
+ JSX.runMain("tool/web/oktavia-search.jsx", [])
+}
+
+window.addEventListener("load", $__jsx_onload);
+document.addEventListener("DOMContentLoaded", $__jsx_onload);
+
+})(JSX);
diff --git a/web/server/h2o/libh2o/misc/oktavia/lib/oktavia-spanish-search.js b/web/server/h2o/libh2o/misc/oktavia/lib/oktavia-spanish-search.js
new file mode 100644
index 00000000..7a8c74dd
--- /dev/null
+++ b/web/server/h2o/libh2o/misc/oktavia/lib/oktavia-spanish-search.js
@@ -0,0 +1,8607 @@
+// generatedy by JSX compiler 0.9.24 (2013-04-05 13:45:00 +0900; 1b229cc6a411f674f0f7cf7a79b7a8b3f8eb7414)
+var JSX = {};
+(function (JSX) {
+/**
+ * copies the implementations from source interface to target
+ */
+function $__jsx_merge_interface(target, source) {
+ for (var k in source.prototype)
+ if (source.prototype.hasOwnProperty(k))
+ target.prototype[k] = source.prototype[k];
+}
+
+/**
+ * defers the initialization of the property
+ */
+function $__jsx_lazy_init(obj, prop, func) {
+ function reset(obj, prop, value) {
+ delete obj[prop];
+ obj[prop] = value;
+ return value;
+ }
+
+ Object.defineProperty(obj, prop, {
+ get: function () {
+ return reset(obj, prop, func());
+ },
+ set: function (v) {
+ reset(obj, prop, v);
+ },
+ enumerable: true,
+ configurable: true
+ });
+}
+
+/**
+ * sideeffect().a /= b
+ */
+function $__jsx_div_assign(obj, prop, divisor) {
+ return obj[prop] = (obj[prop] / divisor) | 0;
+}
+
+/*
+ * global functions, renamed to avoid conflict with local variable names
+ */
+var $__jsx_parseInt = parseInt;
+var $__jsx_parseFloat = parseFloat;
+var $__jsx_isNaN = isNaN;
+var $__jsx_isFinite = isFinite;
+
+var $__jsx_encodeURIComponent = encodeURIComponent;
+var $__jsx_decodeURIComponent = decodeURIComponent;
+var $__jsx_encodeURI = encodeURI;
+var $__jsx_decodeURI = decodeURI;
+
+var $__jsx_ObjectToString = Object.prototype.toString;
+var $__jsx_ObjectHasOwnProperty = Object.prototype.hasOwnProperty;
+
+/*
+ * profiler object, initialized afterwards
+ */
+function $__jsx_profiler() {
+}
+
+/*
+ * public interface to JSX code
+ */
+JSX.require = function (path) {
+ var m = $__jsx_classMap[path];
+ return m !== undefined ? m : null;
+};
+
+JSX.profilerIsRunning = function () {
+ return $__jsx_profiler.getResults != null;
+};
+
+JSX.getProfileResults = function () {
+ return ($__jsx_profiler.getResults || function () { return {}; })();
+};
+
+JSX.postProfileResults = function (url, cb) {
+ if ($__jsx_profiler.postResults == null)
+ throw new Error("profiler has not been turned on");
+ return $__jsx_profiler.postResults(url, cb);
+};
+
+JSX.resetProfileResults = function () {
+ if ($__jsx_profiler.resetResults == null)
+ throw new Error("profiler has not been turned on");
+ return $__jsx_profiler.resetResults();
+};
+JSX.DEBUG = false;
+/**
+ * class _Main extends Object
+ * @constructor
+ */
+function _Main() {
+}
+
+/**
+ * @constructor
+ */
+function _Main$() {
+};
+
+_Main$.prototype = new _Main;
+
+/**
+ * @param {Array.<undefined|!string>} args
+ */
+_Main.main$AS = function (args) {
+ OktaviaSearch$setStemmer$LStemmer$(new SpanishStemmer$());
+};
+
+var _Main$main$AS = _Main.main$AS;
+
+/**
+ * class _Result extends Object
+ * @constructor
+ */
+function _Result() {
+}
+
+/**
+ * @constructor
+ * @param {!string} title
+ * @param {!string} url
+ * @param {!string} content
+ * @param {!number} score
+ */
+function _Result$SSSI(title, url, content, score) {
+ this.title = title;
+ this.url = url;
+ this.content = content;
+ this.score = score;
+};
+
+_Result$SSSI.prototype = new _Result;
+
+/**
+ * class _Proposal extends Object
+ * @constructor
+ */
+function _Proposal() {
+}
+
+/**
+ * @constructor
+ * @param {!string} options
+ * @param {!string} label
+ * @param {!number} count
+ */
+function _Proposal$SSI(options, label, count) {
+ this.options = options;
+ this.label = label;
+ this.count = count;
+};
+
+_Proposal$SSI.prototype = new _Proposal;
+
+/**
+ * class OktaviaSearch extends Object
+ * @constructor
+ */
+function OktaviaSearch() {
+}
+
+/**
+ * @constructor
+ * @param {!number} entriesPerPage
+ */
+function OktaviaSearch$I(entriesPerPage) {
+ this._queries = null;
+ this._highlight = "";
+ this._result = null;
+ this._proposals = null;
+ this._currentFolderDepth = 0;
+ this._oktavia = new Oktavia$();
+ this._entriesPerPage = entriesPerPage;
+ this._currentPage = 1;
+ this._queryString = null;
+ this._callback = null;
+ OktaviaSearch._instance = this;
+};
+
+OktaviaSearch$I.prototype = new OktaviaSearch;
+
+/**
+ * @param {Stemmer} stemmer
+ */
+OktaviaSearch.setStemmer$LStemmer$ = function (stemmer) {
+ /** @type {Oktavia} */
+ var this$0;
+ if (OktaviaSearch._instance) {
+ this$0 = OktaviaSearch._instance._oktavia;
+ this$0._stemmer = stemmer;
+ } else {
+ OktaviaSearch._stemmer = stemmer;
+ }
+};
+
+var OktaviaSearch$setStemmer$LStemmer$ = OktaviaSearch.setStemmer$LStemmer$;
+
+/**
+ * @param {!string} index
+ */
+OktaviaSearch.prototype.loadIndex$S = function (index) {
+ /** @type {Oktavia} */
+ var this$0;
+ /** @type {Stemmer} */
+ var stemmer$0;
+ if (OktaviaSearch._stemmer) {
+ this$0 = this._oktavia;
+ stemmer$0 = OktaviaSearch._stemmer;
+ this$0._stemmer = stemmer$0;
+ }
+ this._oktavia.load$S(Binary$base64decode$S(index));
+ if (this._queryString) {
+ this.search$SF$IIV$(this._queryString, this._callback);
+ this._queryString = null;
+ this._callback = null;
+ }
+};
+
+/**
+ * @param {!string} queryString
+ * @param {*} callback
+ */
+OktaviaSearch.prototype.search$SF$IIV$ = function (queryString, callback) {
+ /** @type {QueryStringParser} */
+ var queryParser;
+ /** @type {SearchSummary} */
+ var summary;
+ /** @type {Array.<undefined|SearchUnit>} */
+ var _result$0;
+ if (this._oktavia) {
+ queryParser = ({queries: [ ]});
+ this._queries = QueryStringParser$parse$LQueryStringParser$S(queryParser, queryString);
+ this._highlight = QueryStringParser$highlight$LQueryStringParser$(queryParser);
+ summary = this._oktavia.search$ALQuery$(this._queries);
+ if (SearchSummary$size$LSearchSummary$(summary) > 0) {
+ this._result = this._sortResult$LSearchSummary$(summary);
+ this._proposals = [ ];
+ this._currentPage = 1;
+ } else {
+ this._result = [ ];
+ if (this._queries.length > 1) {
+ this._proposals = SearchSummary$getProposal$LSearchSummary$(summary);
+ } else {
+ this._proposals = [ ];
+ }
+ this._currentPage = 1;
+ }
+ callback((_result$0 = this._result).length, Math.ceil(_result$0.length / this._entriesPerPage));
+ } else {
+ this._queryString = queryString;
+ this._callback = callback;
+ }
+};
+
+/**
+ * @return {!number}
+ */
+OktaviaSearch.prototype.resultSize$ = function () {
+ return (this._result.length | 0);
+};
+
+/**
+ * @return {!number}
+ */
+OktaviaSearch.prototype.totalPages$ = function () {
+ return (Math.ceil(this._result.length / this._entriesPerPage) | 0);
+};
+
+/**
+ * @return {!number}
+ */
+OktaviaSearch.prototype.currentPage$ = function () {
+ return this._currentPage;
+};
+
+/**
+ * @param {!number} page
+ */
+OktaviaSearch.prototype.setCurrentPage$I = function (page) {
+ this._currentPage = page;
+};
+
+/**
+ * @return {!boolean}
+ */
+OktaviaSearch.prototype.hasPrevPage$ = function () {
+ return this._currentPage !== 1;
+};
+
+/**
+ * @return {!boolean}
+ */
+OktaviaSearch.prototype.hasNextPage$ = function () {
+ return this._currentPage !== Math.ceil(this._result.length / this._entriesPerPage);
+};
+
+/**
+ * @return {Array.<undefined|!string>}
+ */
+OktaviaSearch.prototype.pageIndexes$ = function () {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var total;
+ /** @type {!number} */
+ var i;
+ result = [ ];
+ total = Math.ceil(this._result.length / this._entriesPerPage);
+ if (total < 10) {
+ for (i = 1; i <= total; i++) {
+ result.push(i + "");
+ }
+ } else {
+ if (this._currentPage <= 5) {
+ for (i = 1; i <= 7; i++) {
+ result.push(i + "");
+ }
+ result.push('...', total + "");
+ } else {
+ if (total - 5 <= this._currentPage) {
+ result.push('1', '...');
+ for (i = total - 8; i <= total; i++) {
+ result.push(i + "");
+ }
+ } else {
+ result.push('1', '...');
+ for (i = this._currentPage - 3; i <= this._currentPage + 3; i++) {
+ result.push(i + "");
+ }
+ result.push('...', total + "");
+ }
+ }
+ }
+ return result;
+};
+
+/**
+ * @return {Array.<undefined|_Result>}
+ */
+OktaviaSearch.prototype.getResult$ = function () {
+ /** @type {Style} */
+ var style;
+ /** @type {!number} */
+ var start;
+ /** @type {!number} */
+ var last;
+ /** @type {Metadata} */
+ var metadata;
+ /** @type {!number} */
+ var num;
+ /** @type {Array.<undefined|_Result>} */
+ var results;
+ /** @type {!number} */
+ var i;
+ /** @type {SearchUnit} */
+ var unit;
+ /** @type {Array.<undefined|!string>} */
+ var info;
+ /** @type {!string} */
+ var content;
+ /** @type {Array.<undefined|Position>} */
+ var positions;
+ /** @type {!number} */
+ var end;
+ /** @type {!boolean} */
+ var split;
+ /** @type {!number} */
+ var j;
+ /** @type {Position} */
+ var pos;
+ /** @type {!string} */
+ var text;
+ /** @type {Oktavia} */
+ var this$0;
+ /** @type {!number} */
+ var position$0;
+ /** @type {!number} */
+ var _currentPage$0;
+ /** @type {!number} */
+ var _entriesPerPage$0;
+ style = new Style$S('html');
+ start = ((_currentPage$0 = this._currentPage) - 1) * (_entriesPerPage$0 = this._entriesPerPage);
+ last = Math.min(_currentPage$0 * _entriesPerPage$0, this._result.length);
+ this$0 = this._oktavia;
+ metadata = this$0._metadatas[this$0._metadataLabels[0]];
+ num = 250;
+ results = [ ];
+ for (i = start; i < last; i++) {
+ unit = this._result[i];
+ info = metadata.getInformation$I(unit.id).split(Oktavia.eob);
+ content = metadata.getContent$I(unit.id);
+ start = 0;
+ positions = SearchUnit$getPositions$LSearchUnit$(unit);
+ if (content.indexOf(info[0]) === 1) {
+ content = content.slice(info[0].length + 2, content.length);
+ start += info[0].length + 2;
+ }
+ end = start + num;
+ split = false;
+ if (positions[0].position > end - positions[0].word.length) {
+ end = positions[0].position + Math.floor(num / 2);
+ split = true;
+ }
+ for (j = positions.length - 1; j > -1; j--) {
+ pos = positions[j];
+ if (pos.position + pos.word.length < end) {
+ content = [ content.slice(0, pos.position - start), style.convert$S('<hit>*</hit>').replace('*', content.slice((position$0 = pos.position) - start, position$0 + pos.word.length - start)), content.slice(pos.position + pos.word.length - start, content.length) ].join('');
+ }
+ }
+ if (split) {
+ text = [ content.slice(0, Math.floor(num / 2)) + ' ...', content.slice(- Math.floor(num / 2), end - start) ].join('<br/>');
+ } else {
+ text = content.slice(0, end - start) + ' ...<br/>';
+ }
+ text = text.replace(Oktavia.eob, ' ').replace(/(<br\/>)(<br\/>)+/, '<br/><br/>');
+ results.push(({title: info[0], url: info[1], content: text, score: unit.score}));
+ }
+ return results;
+};
+
+/**
+ * @return {!string}
+ */
+OktaviaSearch.prototype.getHighlight$ = function () {
+ return this._highlight;
+};
+
+/**
+ * @return {Array.<undefined|_Proposal>}
+ */
+OktaviaSearch.prototype.getProposals$ = function () {
+ /** @type {Style} */
+ var style;
+ /** @type {Array.<undefined|_Proposal>} */
+ var results;
+ /** @type {!number} */
+ var i;
+ /** @type {Proposal} */
+ var proposal;
+ /** @type {Array.<undefined|!string>} */
+ var label;
+ /** @type {Array.<undefined|!string>} */
+ var option;
+ /** @type {!number} */
+ var j;
+ style = new Style$S('html');
+ results = [ ];
+ if (this._queries.length > 1) {
+ for (i = 0; i < this._proposals.length; i++) {
+ proposal = this._proposals[i];
+ if (proposal.expect > 0) {
+ label = [ ];
+ option = [ ];
+ for (j = 0; j < this._queries.length; j++) {
+ if (j !== proposal.omit) {
+ label.push(style.convert$S('<hit>' + this._queries[j].toString() + '</hit>'));
+ option.push(this._queries[j].toString());
+ } else {
+ label.push(style.convert$S('<del>' + this._queries[j].toString() + '</del>'));
+ }
+ }
+ results.push(({options: option.join(' '), label: label.join('&nbsp;'), count: proposal.expect}));
+ }
+ }
+ }
+ return results;
+};
+
+/**
+ * @param {SearchSummary} summary
+ * @return {Array.<undefined|SearchUnit>}
+ */
+OktaviaSearch.prototype._sortResult$LSearchSummary$ = function (summary) {
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var score;
+ /** @type {SearchUnit} */
+ var unit;
+ /** @type {!string} */
+ var pos;
+ /** @type {Position} */
+ var position;
+ for (i = 0; i < summary.result.units.length; i++) {
+ score = 0;
+ unit = summary.result.units[i];
+ for (pos in unit.positions) {
+ position = unit.positions[pos];
+ if (this._oktavia.wordPositionType$I(position.position)) {
+ score += 10;
+ } else {
+ score += 1;
+ }
+ if (! position.stemmed) {
+ score += 2;
+ }
+ }
+ unit.score = (score | 0);
+ }
+ return SearchSummary$getSortedResult$LSearchSummary$(summary);
+};
+
+/**
+ * class _Main$0 extends Object
+ * @constructor
+ */
+function _Main$0() {
+}
+
+/**
+ * @constructor
+ */
+function _Main$0$() {
+};
+
+_Main$0$.prototype = new _Main$0;
+
+/**
+ * @param {Array.<undefined|!string>} args
+ */
+_Main$0.main$AS = function (args) {
+};
+
+var _Main$0$main$AS = _Main$0.main$AS;
+
+/**
+ * class Oktavia extends Object
+ * @constructor
+ */
+function Oktavia() {
+}
+
+/**
+ * @constructor
+ */
+function Oktavia$() {
+ /** @type {Array.<undefined|!string>} */
+ var _utf162compressCode$0;
+ this._compressCode2utf16 = null;
+ this._fmindex = new FMIndex$();
+ this._metadatas = ({ });
+ this._metadataLabels = [ ];
+ this._stemmer = null;
+ this._stemmingResult = ({ });
+ _utf162compressCode$0 = this._utf162compressCode = [ Oktavia.eof, Oktavia.eob, Oktavia.unknown ];
+ _utf162compressCode$0.length = 65536;
+ this._compressCode2utf16 = [ Oktavia.eof, Oktavia.eob, Oktavia.unknown ];
+};
+
+Oktavia$.prototype = new Oktavia;
+
+/**
+ * @param {Stemmer} stemmer
+ */
+Oktavia.prototype.setStemmer$LStemmer$ = function (stemmer) {
+ this._stemmer = stemmer;
+};
+
+/**
+ * @return {Metadata}
+ */
+Oktavia.prototype.getPrimaryMetadata$ = function () {
+ return this._metadatas[this._metadataLabels[0]];
+};
+
+/**
+ * @param {!string} key
+ * @return {Section}
+ */
+Oktavia.prototype.addSection$S = function (key) {
+ /** @type {Section} */
+ var section;
+ if (this._metadataLabels.indexOf(key) !== -1) {
+ throw new Error('Metadata name ' + key + ' is already exists');
+ }
+ this._metadataLabels.push(key);
+ section = new Section$LOktavia$(this);
+ this._metadatas[key] = section;
+ return section;
+};
+
+/**
+ * @param {!string} key
+ * @return {Section}
+ */
+Oktavia.prototype.getSection$S = function (key) {
+ if (this._metadataLabels.indexOf(key) === -1) {
+ throw new Error('Metadata name ' + key + " does't exists");
+ }
+ return this._metadatas[key];
+};
+
+/**
+ * @param {!string} key
+ * @return {Splitter}
+ */
+Oktavia.prototype.addSplitter$S = function (key) {
+ /** @type {Splitter} */
+ var splitter;
+ if (this._metadataLabels.indexOf(key) !== -1) {
+ throw new Error('Metadata name ' + key + ' is already exists');
+ }
+ this._metadataLabels.push(key);
+ splitter = new Splitter$LOktavia$(this);
+ this._metadatas[key] = splitter;
+ return splitter;
+};
+
+/**
+ * @param {!string} key
+ * @return {Splitter}
+ */
+Oktavia.prototype.getSplitter$S = function (key) {
+ if (this._metadataLabels.indexOf(key) === -1) {
+ throw new Error('Metadata name ' + key + " does't exists");
+ }
+ return this._metadatas[key];
+};
+
+/**
+ * @param {!string} key
+ * @param {Array.<undefined|!string>} headers
+ * @return {Table}
+ */
+Oktavia.prototype.addTable$SAS = function (key, headers) {
+ /** @type {Table} */
+ var table;
+ if (this._metadataLabels.indexOf(key) !== -1) {
+ throw new Error('Metadata name ' + key + ' is already exists');
+ }
+ this._metadataLabels.push(key);
+ table = new Table$LOktavia$AS(this, headers);
+ this._metadatas[key] = table;
+ return table;
+};
+
+/**
+ * @param {!string} key
+ * @return {Table}
+ */
+Oktavia.prototype.getTable$S = function (key) {
+ if (this._metadataLabels.indexOf(key) === -1) {
+ throw new Error('Metadata name ' + key + " does't exists");
+ }
+ return this._metadatas[key];
+};
+
+/**
+ * @param {!string} key
+ * @return {Block}
+ */
+Oktavia.prototype.addBlock$S = function (key) {
+ /** @type {Block} */
+ var block;
+ if (this._metadataLabels.indexOf(key) !== -1) {
+ throw new Error('Metadata name ' + key + ' is already exists');
+ }
+ this._metadataLabels.push(key);
+ block = new Block$LOktavia$(this);
+ this._metadatas[key] = block;
+ return block;
+};
+
+/**
+ * @param {!string} key
+ * @return {Block}
+ */
+Oktavia.prototype.getBlock$S = function (key) {
+ if (this._metadataLabels.indexOf(key) === -1) {
+ throw new Error('Metadata name ' + key + " does't exists");
+ }
+ return this._metadatas[key];
+};
+
+/**
+ */
+Oktavia.prototype.addEndOfBlock$ = function () {
+ this._fmindex.push$S(Oktavia.eob);
+};
+
+/**
+ * @param {!string} words
+ */
+Oktavia.prototype.addWord$S = function (words) {
+ /** @type {Array.<undefined|!string>} */
+ var str;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var charCode;
+ /** @type {undefined|!string} */
+ var newCharCode;
+ str = [ ];
+ str.length = words.length;
+ for (i = 0; i < words.length; i++) {
+ charCode = words.charCodeAt(i);
+ newCharCode = this._utf162compressCode[charCode];
+ if (newCharCode == null) {
+ newCharCode = String.fromCharCode(this._compressCode2utf16.length);
+ this._utf162compressCode[charCode] = newCharCode;
+ this._compressCode2utf16.push(String.fromCharCode(charCode));
+ }
+ str.push(newCharCode);
+ }
+ this._fmindex.push$S(str.join(''));
+};
+
+/**
+ * @param {!string} words
+ * @param {!boolean} stemming
+ */
+Oktavia.prototype.addWord$SB = function (words, stemming) {
+ /** @type {Array.<undefined|!string>} */
+ var wordList;
+ /** @type {!number} */
+ var i;
+ /** @type {undefined|!string} */
+ var originalWord;
+ /** @type {!string} */
+ var smallWord;
+ /** @type {undefined|!string} */
+ var registerWord;
+ /** @type {!string} */
+ var baseWord;
+ /** @type {!string} */
+ var compressedCodeWord;
+ /** @type {Array.<undefined|!string>} */
+ var stemmedList;
+ this.addWord$S(words);
+ wordList = words.split(/\s+/);
+ for (i = 0; i < wordList.length; i++) {
+ originalWord = wordList[i];
+ smallWord = originalWord.slice(0, 1).toLowerCase() + originalWord.slice(1);
+ registerWord = null;
+ if (stemming && this._stemmer) {
+ baseWord = this._stemmer.stemWord$S(originalWord.toLowerCase());
+ if (originalWord.indexOf(baseWord) === -1) {
+ registerWord = baseWord;
+ }
+ } else {
+ if (originalWord != smallWord) {
+ registerWord = smallWord;
+ }
+ }
+ if (registerWord) {
+ compressedCodeWord = this._convertToCompressionCode$S(originalWord);
+ stemmedList = this._stemmingResult[registerWord];
+ if (! stemmedList) {
+ stemmedList = [ compressedCodeWord ];
+ this._stemmingResult[registerWord] = stemmedList;
+ } else {
+ if (stemmedList.indexOf(compressedCodeWord) === -1) {
+ stemmedList.push(compressedCodeWord);
+ }
+ }
+ }
+ }
+};
+
+/**
+ * @param {!string} keyword
+ * @return {!string}
+ */
+Oktavia.prototype._convertToCompressionCode$S = function (keyword) {
+ /** @type {Array.<undefined|!string>} */
+ var resultChars;
+ /** @type {!number} */
+ var i;
+ /** @type {undefined|!string} */
+ var chr;
+ resultChars = [ ];
+ for (i = 0; i < keyword.length; i++) {
+ chr = this._utf162compressCode[keyword.charCodeAt(i)];
+ if (chr == null) {
+ resultChars.push(Oktavia.unknown);
+ } else {
+ resultChars.push(chr);
+ }
+ }
+ return resultChars.join('');
+};
+
+/**
+ * @param {!string} keyword
+ * @param {!boolean} stemming
+ * @return {Array.<undefined|!number>}
+ */
+Oktavia.prototype.rawSearch$SB = function (keyword, stemming) {
+ /** @type {Array.<undefined|!number>} */
+ var result;
+ /** @type {!string} */
+ var baseWord;
+ /** @type {Array.<undefined|!string>} */
+ var stemmedList;
+ /** @type {!number} */
+ var i;
+ /** @type {undefined|!string} */
+ var word;
+ if (stemming) {
+ result = [ ];
+ if (this._stemmer) {
+ baseWord = this._stemmer.stemWord$S(keyword.toLowerCase());
+ stemmedList = this._stemmingResult[baseWord];
+ if (stemmedList) {
+ for (i = 0; i < stemmedList.length; i++) {
+ word = stemmedList[i];
+ result = result.concat(this._fmindex.search$S(word));
+ }
+ }
+ }
+ } else {
+ result = this._fmindex.search$S(this._convertToCompressionCode$S(keyword));
+ }
+ return result;
+};
+
+/**
+ * @param {Array.<undefined|Query>} queries
+ * @return {SearchSummary}
+ */
+Oktavia.prototype.search$ALQuery$ = function (queries) {
+ /** @type {SearchSummary} */
+ var summary;
+ /** @type {!number} */
+ var i;
+ /** @type {SingleResult} */
+ var result$0;
+ summary = ({sourceResults: [ ], result: null, oktavia: this});
+ for (i = 0; i < queries.length; i++) {
+ result$0 = this._searchQuery$LQuery$(queries[i]);
+ summary.sourceResults.push(result$0);
+ }
+ summary.result = SearchSummary$mergeResult$LSearchSummary$ALSingleResult$(summary, summary.sourceResults);
+ return summary;
+};
+
+/**
+ * @param {Query} query
+ * @return {SingleResult}
+ */
+Oktavia.prototype._searchQuery$LQuery$ = function (query) {
+ /** @type {SingleResult} */
+ var result;
+ /** @type {Array.<undefined|!number>} */
+ var positions;
+ result = new SingleResult$SBB(query.word, query.or, query.not);
+ if (query.raw) {
+ positions = this.rawSearch$SB(query.word, false);
+ } else {
+ positions = this.rawSearch$SB(query.word, false).concat(this.rawSearch$SB(query.word, true));
+ }
+ this._metadatas[this._metadataLabels[0]].grouping$LSingleResult$AISB(result, positions, query.word, ! query.raw);
+ return result;
+};
+
+/**
+ */
+Oktavia.prototype.build$ = function () {
+ this.build$IB(5, false);
+};
+
+/**
+ * @param {!number} cacheDensity
+ * @param {!boolean} verbose
+ */
+Oktavia.prototype.build$IB = function (cacheDensity, verbose) {
+ /** @type {!string} */
+ var key;
+ /** @type {!number} */
+ var cacheRange;
+ /** @type {!number} */
+ var maxChar;
+ for (key in this._metadatas) {
+ this._metadatas[key]._build$();
+ }
+ cacheRange = Math.round(Math.max(1, 100 / Math.min(100, Math.max(0.01, cacheDensity))));
+ maxChar = this._compressCode2utf16.length;
+ this._fmindex.build$SIIB(Oktavia.eof, maxChar, cacheRange, verbose);
+};
+
+/**
+ * @return {!string}
+ */
+Oktavia.prototype.dump$ = function () {
+ return this.dump$B(false);
+};
+
+/**
+ * @param {!boolean} verbose
+ * @return {!string}
+ */
+Oktavia.prototype.dump$B = function (verbose) {
+ /** @type {!string} */
+ var header;
+ /** @type {!string} */
+ var fmdata;
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var i;
+ /** @type {CompressionReport} */
+ var report;
+ /** @type {undefined|!string} */
+ var name;
+ /** @type {!string} */
+ var data;
+ header = Binary$dumpString$SLCompressionReport$("oktavia-01", null).slice(1);
+ if (verbose) {
+ console.log("Source text size: " + (this._fmindex.size$() * 2 + "") + ' bytes');
+ }
+ fmdata = this._fmindex.dump$B(verbose);
+ result = [ header, fmdata ];
+ result.push(Binary$dump16bitNumber$I(this._compressCode2utf16.length));
+ for (i = 3; i < this._compressCode2utf16.length; i++) {
+ result.push(this._compressCode2utf16[i]);
+ }
+ if (verbose) {
+ console.log('Char Code Map: ' + (this._compressCode2utf16.length * 2 - 2 + "") + ' bytes');
+ }
+ report = ({source: 0, result: 0});
+ result.push(Binary$dumpStringListMap$HASLCompressionReport$(this._stemmingResult, report));
+ if (verbose) {
+ console.log('Stemmed Word Table: ' + (result[result.length - 1].length + "") + ' bytes (' + (Math.round(report.result * 100.0 / report.source) + "") + '%)');
+ }
+ result.push(Binary$dump16bitNumber$I(this._metadataLabels.length));
+ for (i = 0; i < this._metadataLabels.length; i++) {
+ report = ({source: 0, result: 0});
+ name = this._metadataLabels[i];
+ data = this._metadatas[name]._dump$LCompressionReport$(report);
+ result.push(Binary$dumpString$SLCompressionReport$(name, report), data);
+ if (verbose) {
+ console.log('Meta Data ' + name + ': ' + (data.length * 2 + "") + ' bytes (' + (Math.round(report.result * 100.0 / report.source) + "") + '%)');
+ }
+ }
+ return result.join('');
+};
+
+/**
+ * @param {!string} data
+ */
+Oktavia.prototype.load$S = function (data) {
+ /** @type {!string} */
+ var header;
+ /** @type {!number} */
+ var offset;
+ /** @type {!number} */
+ var charCodeCount;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var charCode;
+ /** @type {LoadedStringListMapResult} */
+ var stemmedWords;
+ /** @type {!number} */
+ var metadataCount;
+ /** @type {LoadedStringResult} */
+ var nameResult;
+ /** @type {!string} */
+ var name;
+ /** @type {!number} */
+ var type;
+ header = Binary$dumpString$SLCompressionReport$("oktavia-01", null).slice(1);
+ if (data.slice(0, 5) !== header) {
+ throw new Error('Invalid data file');
+ }
+ this._metadatas = ({ });
+ this._metadataLabels = [ ];
+ offset = 5;
+ offset = this._fmindex.load$SI(data, offset);
+ charCodeCount = Binary$load16bitNumber$SI(data, offset++);
+ this._compressCode2utf16 = [ Oktavia.eof, Oktavia.eob, Oktavia.unknown ];
+ this._utf162compressCode = [ Oktavia.eof, Oktavia.eob, Oktavia.unknown ];
+ for (i = 3; i < charCodeCount; i++) {
+ charCode = Binary$load16bitNumber$SI(data, offset++);
+ this._compressCode2utf16.push(String.fromCharCode(charCode));
+ this._utf162compressCode[charCode] = String.fromCharCode(i);
+ }
+ stemmedWords = Binary$loadStringListMap$SI(data, offset);
+ this._stemmingResult = stemmedWords.result;
+ offset = stemmedWords.offset;
+ metadataCount = Binary$load16bitNumber$SI(data, offset++);
+ for (i = 0; i < metadataCount; i++) {
+ nameResult = Binary$loadString$SI(data, offset);
+ name = nameResult.result;
+ offset = nameResult.offset;
+ type = Binary$load16bitNumber$SI(data, offset++);
+ switch (type) {
+ case 0:
+ offset = Section$_load$LOktavia$SSI(this, name, data, offset);
+ break;
+ case 1:
+ offset = Splitter$_load$LOktavia$SSI(this, name, data, offset);
+ break;
+ case 2:
+ offset = Table$_load$LOktavia$SSI(this, name, data, offset);
+ break;
+ case 3:
+ offset = Block$_load$LOktavia$SSI(this, name, data, offset);
+ break;
+ }
+ }
+};
+
+/**
+ * @return {!number}
+ */
+Oktavia.prototype.contentSize$ = function () {
+ /** @type {FMIndex} */
+ var this$0;
+ this$0 = this._fmindex;
+ return this$0._substr.length;
+};
+
+/**
+ * @param {!number} position
+ * @return {!number}
+ */
+Oktavia.prototype.wordPositionType$I = function (position) {
+ /** @type {!number} */
+ var result;
+ /** @type {!string} */
+ var ahead;
+ result = 0;
+ if (position === 0) {
+ result = 4;
+ } else {
+ ahead = this._fmindex.getSubstring$II(position - 1, 1);
+ if (/\s/.test(ahead)) {
+ result = 2;
+ } else {
+ if (/\W/.test(ahead)) {
+ result = 1;
+ } else {
+ if (Oktavia.eob === ahead) {
+ result = 3;
+ }
+ }
+ }
+ }
+ return (result | 0);
+};
+
+/**
+ * @param {!number} position
+ * @param {!number} length
+ * @return {!string}
+ */
+Oktavia.prototype._getSubstring$II = function (position, length) {
+ /** @type {!string} */
+ var result;
+ /** @type {Array.<undefined|!string>} */
+ var str;
+ /** @type {!number} */
+ var i;
+ result = this._fmindex.getSubstring$II(position, length);
+ str = [ ];
+ for (i = 0; i < result.length; i++) {
+ str.push(this._compressCode2utf16[result.charCodeAt(i)]);
+ }
+ return str.join('');
+};
+
+/**
+ * class Binary extends Object
+ * @constructor
+ */
+function Binary() {
+}
+
+/**
+ * @constructor
+ */
+function Binary$() {
+};
+
+Binary$.prototype = new Binary;
+
+/**
+ * @param {!number} num
+ * @return {!string}
+ */
+Binary.dump32bitNumber$N = function (num) {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ result = [ String.fromCharCode(Math.floor(num / 65536)) ];
+ result.push(String.fromCharCode(num % 65536));
+ return result.join("");
+};
+
+var Binary$dump32bitNumber$N = Binary.dump32bitNumber$N;
+
+/**
+ * @param {!string} buffer
+ * @param {!number} offset
+ * @return {!number}
+ */
+Binary.load32bitNumber$SI = function (buffer, offset) {
+ /** @type {!number} */
+ var result;
+ result = buffer.charCodeAt(offset) * 65536 + buffer.charCodeAt(offset + 1);
+ return result;
+};
+
+var Binary$load32bitNumber$SI = Binary.load32bitNumber$SI;
+
+/**
+ * @param {!number} num
+ * @return {!string}
+ */
+Binary.dump16bitNumber$I = function (num) {
+ return String.fromCharCode(num % 65536);
+};
+
+var Binary$dump16bitNumber$I = Binary.dump16bitNumber$I;
+
+/**
+ * @param {!string} buffer
+ * @param {!number} offset
+ * @return {!number}
+ */
+Binary.load16bitNumber$SI = function (buffer, offset) {
+ return (buffer.charCodeAt(offset) | 0);
+};
+
+var Binary$load16bitNumber$SI = Binary.load16bitNumber$SI;
+
+/**
+ * @param {!string} str
+ * @return {!string}
+ */
+Binary.dumpString$S = function (str) {
+ return Binary$dumpString$SLCompressionReport$(str, null);
+};
+
+var Binary$dumpString$S = Binary.dumpString$S;
+
+/**
+ * @param {!string} str
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+Binary.dumpString$SLCompressionReport$ = function (str, report) {
+ /** @type {!number} */
+ var length;
+ /** @type {!boolean} */
+ var compress;
+ /** @type {Array.<undefined|!number>} */
+ var charCodes;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var charCode;
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {undefined|!number} */
+ var bytes;
+ if (str.length > 32768) {
+ str = str.slice(0, 32768);
+ }
+ length = str.length;
+ compress = true;
+ charCodes = [ ];
+ for (i = 0; i < length; i++) {
+ charCode = str.charCodeAt(i);
+ if (charCode > 255) {
+ compress = false;
+ break;
+ }
+ charCodes.push(charCode);
+ }
+ if (compress) {
+ result = [ Binary$dump16bitNumber$I(length + 32768) ];
+ for (i = 0; i < length; i += 2) {
+ bytes = charCodes[i];
+ if (i !== length - 1) {
+ bytes += charCodes[i + 1] << 8;
+ }
+ result.push(String.fromCharCode(bytes % 65536));
+ }
+ if (report) {
+ CompressionReport$add$LCompressionReport$II(report, length, Math.ceil(length / 2));
+ }
+ } else {
+ result = [ Binary$dump16bitNumber$I(length), str ];
+ if (report) {
+ CompressionReport$add$LCompressionReport$II(report, length, length);
+ }
+ }
+ return result.join('');
+};
+
+var Binary$dumpString$SLCompressionReport$ = Binary.dumpString$SLCompressionReport$;
+
+/**
+ * @param {!string} buffer
+ * @param {!number} offset
+ * @return {LoadedStringResult}
+ */
+Binary.loadString$SI = function (buffer, offset) {
+ return new LoadedStringResult$SI(buffer, offset);
+};
+
+var Binary$loadString$SI = Binary.loadString$SI;
+
+/**
+ * @param {Array.<undefined|!string>} strList
+ * @return {!string}
+ */
+Binary.dumpStringList$AS = function (strList) {
+ return Binary$dumpStringList$ASLCompressionReport$(strList, null);
+};
+
+var Binary$dumpStringList$AS = Binary.dumpStringList$AS;
+
+/**
+ * @param {Array.<undefined|!string>} strList
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+Binary.dumpStringList$ASLCompressionReport$ = function (strList, report) {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var i;
+ result = [ Binary$dump32bitNumber$N(strList.length) ];
+ for (i = 0; i < strList.length; i++) {
+ result.push(Binary$dumpString$SLCompressionReport$(strList[i], report));
+ }
+ return result.join('');
+};
+
+var Binary$dumpStringList$ASLCompressionReport$ = Binary.dumpStringList$ASLCompressionReport$;
+
+/**
+ * @param {!string} buffer
+ * @param {!number} offset
+ * @return {LoadedStringListResult}
+ */
+Binary.loadStringList$SI = function (buffer, offset) {
+ return new LoadedStringListResult$SI(buffer, offset);
+};
+
+var Binary$loadStringList$SI = Binary.loadStringList$SI;
+
+/**
+ * @param {Object.<string, undefined|Array.<undefined|!string>>} strMap
+ * @return {!string}
+ */
+Binary.dumpStringListMap$HAS = function (strMap) {
+ return Binary$dumpStringListMap$HASLCompressionReport$(strMap, null);
+};
+
+var Binary$dumpStringListMap$HAS = Binary.dumpStringListMap$HAS;
+
+/**
+ * @param {Object.<string, undefined|Array.<undefined|!string>>} strMap
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+Binary.dumpStringListMap$HASLCompressionReport$ = function (strMap, report) {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var counter;
+ /** @type {!string} */
+ var key;
+ result = [ ];
+ counter = 0;
+ for (key in strMap) {
+ result.push(Binary$dumpString$SLCompressionReport$(key, report));
+ result.push(Binary$dumpStringList$ASLCompressionReport$(strMap[key], report));
+ counter++;
+ }
+ return Binary$dump32bitNumber$N(counter) + result.join('');
+};
+
+var Binary$dumpStringListMap$HASLCompressionReport$ = Binary.dumpStringListMap$HASLCompressionReport$;
+
+/**
+ * @param {!string} buffer
+ * @param {!number} offset
+ * @return {LoadedStringListMapResult}
+ */
+Binary.loadStringListMap$SI = function (buffer, offset) {
+ return new LoadedStringListMapResult$SI(buffer, offset);
+};
+
+var Binary$loadStringListMap$SI = Binary.loadStringListMap$SI;
+
+/**
+ * @param {Array.<undefined|!number>} array
+ * @return {!string}
+ */
+Binary.dump32bitNumberList$AN = function (array) {
+ return Binary$dump32bitNumberList$ANLCompressionReport$(array, null);
+};
+
+var Binary$dump32bitNumberList$AN = Binary.dump32bitNumberList$AN;
+
+/**
+ * @param {Array.<undefined|!number>} array
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+Binary.dump32bitNumberList$ANLCompressionReport$ = function (array, report) {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var index;
+ /** @type {!number} */
+ var inputLength;
+ /** @type {!number} */
+ var length;
+ /** @type {!string} */
+ var resultString;
+ /** @type {!number} */
+ var value1$0;
+ /** @type {!number} */
+ var value2$0;
+ result = [ Binary$dump32bitNumber$N(array.length) ];
+ index = 0;
+ inputLength = array.length;
+ while (index < inputLength) {
+ if (array[index] == 0) {
+ length = Binary$_countZero$ANI(array, index);
+ result.push(Binary$_zeroBlock$I(length));
+ index += length;
+ } else {
+ if (Binary$_shouldZebraCode$ANI(array, index)) {
+ result.push(Binary$_createZebraCode$ANI(array, index));
+ value1$0 = array.length;
+ value2$0 = index + 15;
+ index = (value1$0 <= value2$0 ? value1$0 : value2$0);
+ } else {
+ length = Binary$_searchDoubleZero$ANI(array, index);
+ result.push(Binary$_nonZeroBlock$ANII(array, index, length));
+ if (length === 0) {
+ throw new Error('');
+ }
+ index += length;
+ }
+ }
+ }
+ resultString = result.join('');
+ if (report) {
+ CompressionReport$add$LCompressionReport$II(report, array.length * 2 + 2, resultString.length);
+ }
+ return resultString;
+};
+
+var Binary$dump32bitNumberList$ANLCompressionReport$ = Binary.dump32bitNumberList$ANLCompressionReport$;
+
+/**
+ * @param {!string} buffer
+ * @param {!number} offset
+ * @return {LoadedNumberListResult}
+ */
+Binary.load32bitNumberList$SI = function (buffer, offset) {
+ return new LoadedNumberListResult$SI(buffer, offset);
+};
+
+var Binary$load32bitNumberList$SI = Binary.load32bitNumberList$SI;
+
+/**
+ * @param {Array.<undefined|!number>} array
+ * @param {!number} offset
+ * @return {!number}
+ */
+Binary._countZero$ANI = function (array, offset) {
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var array$len$0;
+ for ((i = offset, array$len$0 = array.length); i < array$len$0; i++) {
+ if (array[i] != 0) {
+ return (i - offset | 0);
+ }
+ }
+ return (array.length - offset | 0);
+};
+
+var Binary$_countZero$ANI = Binary._countZero$ANI;
+
+/**
+ * @param {!number} length
+ * @return {!string}
+ */
+Binary._zeroBlock$I = function (length) {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ result = [ ];
+ while (length > 0) {
+ if (length > 16384) {
+ result.push(Binary$dump16bitNumber$I(16383));
+ length -= 16384;
+ } else {
+ result.push(Binary$dump16bitNumber$I(length - 1));
+ length = 0;
+ }
+ }
+ return result.join('');
+};
+
+var Binary$_zeroBlock$I = Binary._zeroBlock$I;
+
+/**
+ * @param {Array.<undefined|!number>} array
+ * @param {!number} offset
+ * @return {!boolean}
+ */
+Binary._shouldZebraCode$ANI = function (array, offset) {
+ /** @type {!number} */
+ var change;
+ /** @type {!boolean} */
+ var isLastZero;
+ /** @type {!number} */
+ var i;
+ if (array.length - offset < 16) {
+ return true;
+ }
+ change = 0;
+ isLastZero = false;
+ for (i = offset; i < offset + 15; i++) {
+ if (array[i] == 0) {
+ if (! isLastZero) {
+ isLastZero = true;
+ change++;
+ }
+ } else {
+ if (isLastZero) {
+ isLastZero = false;
+ change++;
+ }
+ }
+ }
+ return change > 2;
+};
+
+var Binary$_shouldZebraCode$ANI = Binary._shouldZebraCode$ANI;
+
+/**
+ * @param {Array.<undefined|!number>} array
+ * @param {!number} offset
+ * @return {!number}
+ */
+Binary._searchDoubleZero$ANI = function (array, offset) {
+ /** @type {!boolean} */
+ var isLastZero;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var array$len$0;
+ isLastZero = false;
+ for ((i = offset, array$len$0 = array.length); i < array$len$0; i++) {
+ if (array[i] == 0) {
+ if (isLastZero) {
+ return (i - offset - 1 | 0);
+ }
+ isLastZero = true;
+ } else {
+ isLastZero = false;
+ }
+ }
+ return (array.length - offset | 0);
+};
+
+var Binary$_searchDoubleZero$ANI = Binary._searchDoubleZero$ANI;
+
+/**
+ * @param {Array.<undefined|!number>} array
+ * @param {!number} offset
+ * @param {!number} length
+ * @return {!string}
+ */
+Binary._nonZeroBlock$ANII = function (array, offset, length) {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var blockLength;
+ /** @type {!number} */
+ var i;
+ result = [ ];
+ while (length > 0) {
+ if (length > 16384) {
+ blockLength = 16384;
+ length -= 16384;
+ } else {
+ blockLength = length;
+ length = 0;
+ }
+ result.push(Binary$dump16bitNumber$I(blockLength - 1 + 0x4000));
+ for (i = offset; i < offset + blockLength; i++) {
+ result.push(Binary$dump32bitNumber$N(array[i]));
+ }
+ offset += blockLength;
+ }
+ return result.join('');
+};
+
+var Binary$_nonZeroBlock$ANII = Binary._nonZeroBlock$ANII;
+
+/**
+ * @param {Array.<undefined|!number>} array
+ * @param {!number} offset
+ * @return {!string}
+ */
+Binary._createZebraCode$ANI = function (array, offset) {
+ /** @type {!number} */
+ var last;
+ /** @type {!number} */
+ var code;
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var value1$0;
+ /** @type {!number} */
+ var value2$0;
+ value1$0 = offset + 15;
+ value2$0 = array.length;
+ last = (value1$0 <= value2$0 ? value1$0 : value2$0);
+ code = 0x8000;
+ result = [ ];
+ for (i = offset; i < last; i++) {
+ if (array[i] != 0) {
+ result.push(Binary$dump32bitNumber$N(array[i]));
+ code = code + (0x1 << i - offset);
+ }
+ }
+ return String.fromCharCode(code) + result.join('');
+};
+
+var Binary$_createZebraCode$ANI = Binary._createZebraCode$ANI;
+
+/**
+ * @param {!string} str
+ * @return {!string}
+ */
+Binary.base64encode$S = function (str) {
+ /** @type {Array.<undefined|!string>} */
+ var out;
+ /** @type {Array.<undefined|!number>} */
+ var source;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var code;
+ /** @type {!number} */
+ var len;
+ /** @type {!number} */
+ var c1;
+ /** @type {undefined|!number} */
+ var c2;
+ /** @type {undefined|!number} */
+ var c3;
+ out = [ ];
+ source = [ ];
+ for (i = 0; i < str.length; i++) {
+ code = str.charCodeAt(i);
+ source.push(code & 0x00ff, code >>> 8);
+ }
+ len = str.length * 2;
+ i = 0;
+ while (i < len) {
+ c1 = source[i++] & 0xff;
+ if (i === len) {
+ out.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(c1 >> 2));
+ out.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((c1 & 0x3) << 4));
+ out.push("==");
+ break;
+ }
+ c2 = source[i++];
+ if (i === len) {
+ out.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(c1 >> 2));
+ out.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((c1 & 0x3) << 4 | (c2 & 0xF0) >> 4));
+ out.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((c2 & 0xF) << 2));
+ out.push("=");
+ break;
+ }
+ c3 = source[i++];
+ out.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(c1 >> 2));
+ out.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((c1 & 0x3) << 4 | (c2 & 0xF0) >> 4));
+ out.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((c2 & 0xF) << 2 | (c3 & 0xC0) >> 6));
+ out.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(c3 & 0x3F));
+ }
+ return out.join('');
+};
+
+var Binary$base64encode$S = Binary.base64encode$S;
+
+/**
+ * @param {Array.<undefined|!number>} source
+ * @return {!string}
+ */
+Binary._mergeCharCode$AI = function (source) {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var i;
+ result = [ ];
+ for (i = 0; i < source.length; i += 2) {
+ result.push(String.fromCharCode(source[i] + (source[i + 1] << 8)));
+ }
+ return result.join('');
+};
+
+var Binary$_mergeCharCode$AI = Binary._mergeCharCode$AI;
+
+/**
+ * @param {!string} str
+ * @return {!string}
+ */
+Binary.base64decode$S = function (str) {
+ /** @type {!number} */
+ var len;
+ /** @type {!number} */
+ var i;
+ /** @type {Array.<undefined|!number>} */
+ var out;
+ /** @type {undefined|!number} */
+ var c1;
+ /** @type {undefined|!number} */
+ var c2;
+ /** @type {!number} */
+ var c3;
+ /** @type {!number} */
+ var c4;
+ len = str.length;
+ i = 0;
+ out = [ ];
+ while (i < len) {
+ do {
+ c1 = Binary._base64DecodeChars[str.charCodeAt(i++) & 0xff];
+ } while (i < len && c1 == -1);
+ if (c1 == -1) {
+ break;
+ }
+ do {
+ c2 = Binary._base64DecodeChars[str.charCodeAt(i++) & 0xff];
+ } while (i < len && c2 == -1);
+ if (c2 == -1) {
+ break;
+ }
+ out.push(c1 << 2 | (c2 & 0x30) >> 4);
+ do {
+ c3 = str.charCodeAt(i++) & 0xff;
+ if (c3 === 61) {
+ return Binary$_mergeCharCode$AI(out);
+ }
+ c3 = Binary._base64DecodeChars[c3];
+ } while (i < len && c3 === -1);
+ if (c3 === -1) {
+ break;
+ }
+ out.push((c2 & 0XF) << 4 | (c3 & 0x3C) >> 2);
+ do {
+ c4 = str.charCodeAt(i++) & 0xff;
+ if (c4 === 61) {
+ return Binary$_mergeCharCode$AI(out);
+ }
+ c4 = (Binary._base64DecodeChars[c4] | 0);
+ } while (i < len && c4 === -1);
+ if (c4 === -1) {
+ break;
+ }
+ out.push((c3 & 0x03) << 6 | c4);
+ }
+ return Binary$_mergeCharCode$AI(out);
+};
+
+var Binary$base64decode$S = Binary.base64decode$S;
+
+/**
+ * class LoadedStringResult extends Object
+ * @constructor
+ */
+function LoadedStringResult() {
+}
+
+/**
+ * @constructor
+ * @param {!string} data
+ * @param {!number} offset
+ */
+function LoadedStringResult$SI(data, offset) {
+ /** @type {!number} */
+ var strLength;
+ /** @type {Array.<undefined|!string>} */
+ var bytes;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var code;
+ /** @type {!number} */
+ var offset$0;
+ this.result = "";
+ this.offset = 0;
+ offset$0 = offset++;
+ strLength = data.charCodeAt(offset$0);
+ if (strLength > 32767) {
+ strLength = strLength - 32768;
+ bytes = [ ];
+ for (i = 0; i < strLength; i += 2) {
+ code = data.charCodeAt(offset);
+ bytes.push(String.fromCharCode(code & 0x00ff));
+ if (i !== strLength - 1) {
+ bytes.push(String.fromCharCode(code >>> 8));
+ }
+ offset++;
+ }
+ this.result = bytes.join('');
+ this.offset = offset;
+ } else {
+ this.result = data.slice(offset, offset + strLength);
+ this.offset = (offset + strLength | 0);
+ }
+};
+
+LoadedStringResult$SI.prototype = new LoadedStringResult;
+
+/**
+ * class LoadedStringListResult extends Object
+ * @constructor
+ */
+function LoadedStringListResult() {
+}
+
+/**
+ * @constructor
+ * @param {!string} data
+ * @param {!number} offset
+ */
+function LoadedStringListResult$SI(data, offset) {
+ /** @type {!number} */
+ var length;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var strLength;
+ /** @type {!string} */
+ var resultStr;
+ /** @type {Array.<undefined|!string>} */
+ var bytes;
+ /** @type {!number} */
+ var j;
+ /** @type {!number} */
+ var code;
+ /** @type {!number} */
+ var result$0;
+ /** @type {!number} */
+ var offset$0;
+ this.offset = 0;
+ this.result = [ ];
+ result$0 = data.charCodeAt(offset) * 65536 + data.charCodeAt(offset + 1);
+ length = result$0;
+ offset += 2;
+ for (i = 0; i < length; i++) {
+ offset$0 = offset++;
+ strLength = data.charCodeAt(offset$0);
+ if (strLength > 32767) {
+ strLength = strLength - 32768;
+ bytes = [ ];
+ for (j = 0; j < strLength; j += 2) {
+ code = data.charCodeAt(offset);
+ bytes.push(String.fromCharCode(code & 0x00ff));
+ if (j !== strLength - 1) {
+ bytes.push(String.fromCharCode(code >>> 8));
+ }
+ offset++;
+ }
+ resultStr = bytes.join('');
+ } else {
+ resultStr = data.slice(offset, offset + strLength);
+ offset = (offset + strLength | 0);
+ }
+ this.result.push(resultStr);
+ }
+ this.offset = offset;
+};
+
+LoadedStringListResult$SI.prototype = new LoadedStringListResult;
+
+/**
+ * class LoadedStringListMapResult extends Object
+ * @constructor
+ */
+function LoadedStringListMapResult() {
+}
+
+/**
+ * @constructor
+ * @param {!string} data
+ * @param {!number} offset
+ */
+function LoadedStringListMapResult$SI(data, offset) {
+ /** @type {!number} */
+ var length;
+ /** @type {!number} */
+ var i;
+ /** @type {LoadedStringResult} */
+ var keyResult;
+ /** @type {LoadedStringListResult} */
+ var valueResult;
+ /** @type {!number} */
+ var result$0;
+ /** @type {!number} */
+ var offset$0;
+ this.offset = 0;
+ this.result = ({ });
+ result$0 = data.charCodeAt(offset) * 65536 + data.charCodeAt(offset + 1);
+ length = result$0;
+ offset += 2;
+ for (i = 0; i < length; i++) {
+ keyResult = new LoadedStringResult$SI(data, offset);
+ offset$0 = keyResult.offset;
+ valueResult = new LoadedStringListResult$SI(data, offset$0);
+ this.result[keyResult.result] = valueResult.result;
+ offset = valueResult.offset;
+ }
+ this.offset = offset;
+};
+
+LoadedStringListMapResult$SI.prototype = new LoadedStringListMapResult;
+
+/**
+ * class LoadedNumberListResult extends Object
+ * @constructor
+ */
+function LoadedNumberListResult() {
+}
+
+/**
+ * @constructor
+ * @param {!string} data
+ * @param {!number} offset
+ */
+function LoadedNumberListResult$SI(data, offset) {
+ /** @type {!number} */
+ var resultLength;
+ /** @type {!number} */
+ var originalOffset;
+ /** @type {Array.<undefined|!number>} */
+ var result;
+ /** @type {!number} */
+ var tag;
+ /** @type {!number} */
+ var length;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var result$0;
+ /** @type {!number} */
+ var value1$0;
+ this.result = null;
+ this.offset = 0;
+ result$0 = data.charCodeAt(offset) * 65536 + data.charCodeAt(offset + 1);
+ resultLength = result$0;
+ originalOffset = offset;
+ offset += 2;
+ result = [ ];
+ while (result.length < resultLength) {
+ tag = data.charCodeAt(offset++);
+ if (tag >>> 15 === 1) {
+ value1$0 = resultLength - result.length;
+ length = (value1$0 <= 15 ? value1$0 : 15);
+ for (i = 0; i < length; i++) {
+ if (tag >>> i & 0x1) {
+ result.push(Binary$load32bitNumber$SI(data, offset));
+ offset += 2;
+ } else {
+ result.push(0);
+ }
+ }
+ } else {
+ if (tag >>> 14 === 1) {
+ length = tag - 0x4000 + 1;
+ for (i = 0; i < length; i++) {
+ result.push(Binary$load32bitNumber$SI(data, offset));
+ offset += 2;
+ }
+ } else {
+ length = tag + 1;
+ for (i = 0; i < length; i++) {
+ result.push(0);
+ }
+ }
+ }
+ }
+ this.result = result;
+ this.offset = offset;
+};
+
+LoadedNumberListResult$SI.prototype = new LoadedNumberListResult;
+
+/**
+ * class CompressionReport extends Object
+ * @constructor
+ */
+function CompressionReport() {
+}
+
+/**
+ * @constructor
+ */
+function CompressionReport$() {
+ this.source = 0;
+ this.result = 0;
+};
+
+CompressionReport$.prototype = new CompressionReport;
+
+/**
+ * @param {CompressionReport} $this
+ * @param {!number} source
+ * @param {!number} result
+ */
+CompressionReport.add$LCompressionReport$II = function ($this, source, result) {
+ $this.source += source;
+ $this.result += result;
+};
+
+var CompressionReport$add$LCompressionReport$II = CompressionReport.add$LCompressionReport$II;
+
+/**
+ * @param {CompressionReport} $this
+ * @return {!number}
+ */
+CompressionReport.rate$LCompressionReport$ = function ($this) {
+ return (Math.round($this.result * 100.0 / $this.source) | 0);
+};
+
+var CompressionReport$rate$LCompressionReport$ = CompressionReport.rate$LCompressionReport$;
+
+/**
+ * class Query extends Object
+ * @constructor
+ */
+function Query() {
+}
+
+/**
+ * @constructor
+ */
+function Query$() {
+ this.word = '';
+ this.or = false;
+ this.not = false;
+ this.raw = false;
+};
+
+Query$.prototype = new Query;
+
+/**
+ * @return {!string}
+ */
+Query.prototype.toString = function () {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ result = [ ];
+ if (this.or) {
+ result.push("OR ");
+ }
+ if (this.not) {
+ result.push("-");
+ }
+ if (this.raw) {
+ result.push('"', this.word, '"');
+ } else {
+ result.push(this.word);
+ }
+ return result.join('');
+};
+
+/**
+ * class QueryStringParser extends Object
+ * @constructor
+ */
+function QueryStringParser() {
+}
+
+/**
+ * @constructor
+ */
+function QueryStringParser$() {
+ this.queries = [ ];
+};
+
+QueryStringParser$.prototype = new QueryStringParser;
+
+/**
+ * @param {QueryStringParser} $this
+ * @param {!string} queryString
+ * @return {Array.<undefined|Query>}
+ */
+QueryStringParser.parse$LQueryStringParser$S = function ($this, queryString) {
+ /** @type {!boolean} */
+ var nextOr;
+ /** @type {!boolean} */
+ var nextNot;
+ /** @type {!number} */
+ var currentWordStart;
+ /** @type {!number} */
+ var status;
+ /** @type {RegExp} */
+ var isSpace;
+ /** @type {!number} */
+ var i;
+ /** @type {!string} */
+ var ch;
+ /** @type {!string} */
+ var word;
+ /** @type {Query} */
+ var query;
+ nextOr = false;
+ nextNot = false;
+ currentWordStart = 0;
+ status = 0;
+ isSpace = /[\s\u3000]/;
+ for (i = 0; i < queryString.length; i++) {
+ ch = queryString.charAt(i);
+ switch (status) {
+ case 0:
+ if (! isSpace.test(ch)) {
+ if (ch === '-') {
+ nextNot = true;
+ } else {
+ if (ch === '"') {
+ currentWordStart = i + 1;
+ status = 2;
+ } else {
+ currentWordStart = i;
+ status = 1;
+ }
+ }
+ } else {
+ nextNot = false;
+ }
+ break;
+ case 1:
+ if (isSpace.test(ch)) {
+ word = queryString.slice(currentWordStart, i);
+ if (word === 'OR') {
+ nextOr = true;
+ } else {
+ query = new Query$();
+ query.word = word;
+ query.or = nextOr;
+ query.not = nextNot;
+ $this.queries.push(query);
+ nextOr = false;
+ nextNot = false;
+ }
+ status = 0;
+ }
+ break;
+ case 2:
+ if (ch === '"') {
+ word = queryString.slice(currentWordStart, i);
+ query = new Query$();
+ query.word = word;
+ query.or = nextOr;
+ query.not = nextNot;
+ query.raw = true;
+ $this.queries.push(query);
+ nextOr = false;
+ nextNot = false;
+ status = 0;
+ }
+ break;
+ }
+ }
+ switch (status) {
+ case 0:
+ break;
+ case 1:
+ query = new Query$();
+ word = queryString.slice(currentWordStart, queryString.length);
+ if (word !== 'OR') {
+ query.word = word;
+ query.or = nextOr;
+ query.not = nextNot;
+ $this.queries.push(query);
+ }
+ break;
+ case 2:
+ query = new Query$();
+ query.word = queryString.slice(currentWordStart, queryString.length);
+ query.or = nextOr;
+ query.not = nextNot;
+ query.raw = true;
+ $this.queries.push(query);
+ break;
+ }
+ return $this.queries;
+};
+
+var QueryStringParser$parse$LQueryStringParser$S = QueryStringParser.parse$LQueryStringParser$S;
+
+/**
+ * @param {QueryStringParser} $this
+ * @return {!string}
+ */
+QueryStringParser.highlight$LQueryStringParser$ = function ($this) {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var i;
+ /** @type {Query} */
+ var query;
+ result = [ ];
+ for (i = 0; i < $this.queries.length; i++) {
+ query = $this.queries[i];
+ if (! query.not) {
+ result.push("highlight=" + $__jsx_encodeURIComponent(query.word));
+ }
+ }
+ return '?' + result.join('&');
+};
+
+var QueryStringParser$highlight$LQueryStringParser$ = QueryStringParser.highlight$LQueryStringParser$;
+
+/**
+ * class Proposal extends Object
+ * @constructor
+ */
+function Proposal() {
+}
+
+/**
+ * @constructor
+ * @param {!number} omit
+ * @param {!number} expect
+ */
+function Proposal$II(omit, expect) {
+ this.omit = omit;
+ this.expect = expect;
+};
+
+Proposal$II.prototype = new Proposal;
+
+/**
+ * class Position extends Object
+ * @constructor
+ */
+function Position() {
+}
+
+/**
+ * @constructor
+ * @param {!string} word
+ * @param {!number} position
+ * @param {!boolean} stemmed
+ */
+function Position$SIB(word, position, stemmed) {
+ this.word = word;
+ this.position = position;
+ this.stemmed = stemmed;
+};
+
+Position$SIB.prototype = new Position;
+
+/**
+ * class SearchUnit extends Object
+ * @constructor
+ */
+function SearchUnit() {
+}
+
+/**
+ * @constructor
+ * @param {!number} id
+ */
+function SearchUnit$I(id) {
+ this.positions = ({ });
+ this.id = id;
+ this._size = 0;
+ this.score = 0;
+ this.startPosition = -1;
+};
+
+SearchUnit$I.prototype = new SearchUnit;
+
+/**
+ * @param {SearchUnit} $this
+ * @param {!string} word
+ * @param {!number} position
+ * @param {!boolean} stemmed
+ */
+SearchUnit.addPosition$LSearchUnit$SIB = function ($this, word, position, stemmed) {
+ /** @type {Position} */
+ var positionObj;
+ positionObj = $this.positions[position + ""];
+ if (! positionObj) {
+ $this._size++;
+ $this.positions[position + ""] = ({word: word, position: position, stemmed: stemmed});
+ } else {
+ if (positionObj.word.length < word.length) {
+ positionObj.word = word;
+ }
+ positionObj.stemmed = positionObj.stemmed && stemmed;
+ }
+};
+
+var SearchUnit$addPosition$LSearchUnit$SIB = SearchUnit.addPosition$LSearchUnit$SIB;
+
+/**
+ * @param {SearchUnit} $this
+ * @param {!number} position
+ * @return {Position}
+ */
+SearchUnit.get$LSearchUnit$I = function ($this, position) {
+ return $this.positions[position + ""];
+};
+
+var SearchUnit$get$LSearchUnit$I = SearchUnit.get$LSearchUnit$I;
+
+/**
+ * @param {SearchUnit} $this
+ * @return {!number}
+ */
+SearchUnit.size$LSearchUnit$ = function ($this) {
+ return $this._size;
+};
+
+var SearchUnit$size$LSearchUnit$ = SearchUnit.size$LSearchUnit$;
+
+/**
+ * @param {SearchUnit} $this
+ * @param {SearchUnit} rhs
+ */
+SearchUnit.merge$LSearchUnit$LSearchUnit$ = function ($this, rhs) {
+ /** @type {!string} */
+ var position;
+ /** @type {Position} */
+ var pos;
+ for (position in rhs.positions) {
+ pos = rhs.positions[position];
+ SearchUnit$addPosition$LSearchUnit$SIB($this, pos.word, pos.position, pos.stemmed);
+ }
+};
+
+var SearchUnit$merge$LSearchUnit$LSearchUnit$ = SearchUnit.merge$LSearchUnit$LSearchUnit$;
+
+/**
+ * @param {SearchUnit} $this
+ * @return {Array.<undefined|Position>}
+ */
+SearchUnit.getPositions$LSearchUnit$ = function ($this) {
+ /** @type {Array.<undefined|Position>} */
+ var result;
+ /** @type {!string} */
+ var pos;
+ result = [ ];
+ for (pos in $this.positions) {
+ result.push($this.positions[pos]);
+ }
+ result.sort((function (a, b) {
+ return a.position - b.position;
+ }));
+ return result;
+};
+
+var SearchUnit$getPositions$LSearchUnit$ = SearchUnit.getPositions$LSearchUnit$;
+
+/**
+ * class SingleResult extends Object
+ * @constructor
+ */
+function SingleResult() {
+}
+
+/**
+ * @constructor
+ */
+function SingleResult$() {
+ this.units = [ ];
+ this.unitIds = [ ];
+ this.or = false;
+ this.not = false;
+ this.searchWord = '';
+};
+
+SingleResult$.prototype = new SingleResult;
+
+/**
+ * @constructor
+ * @param {!string} searchWord
+ * @param {!boolean} or
+ * @param {!boolean} not
+ */
+function SingleResult$SBB(searchWord, or, not) {
+ this.units = [ ];
+ this.unitIds = [ ];
+ this.or = or;
+ this.not = not;
+ this.searchWord = searchWord;
+};
+
+SingleResult$SBB.prototype = new SingleResult;
+
+/**
+ * @param {SingleResult} $this
+ * @param {!number} unitId
+ * @return {SearchUnit}
+ */
+SingleResult.getSearchUnit$LSingleResult$I = function ($this, unitId) {
+ /** @type {!number} */
+ var existing;
+ /** @type {SearchUnit} */
+ var result;
+ existing = $this.unitIds.indexOf(unitId);
+ if (existing === -1) {
+ result = ({positions: ({ }), id: unitId, _size: 0, score: 0, startPosition: -1});
+ $this.units.push(result);
+ $this.unitIds.push(unitId);
+ } else {
+ result = $this.units[existing];
+ }
+ return result;
+};
+
+var SingleResult$getSearchUnit$LSingleResult$I = SingleResult.getSearchUnit$LSingleResult$I;
+
+/**
+ * @param {SingleResult} $this
+ * @param {SingleResult} rhs
+ * @return {SingleResult}
+ */
+SingleResult.merge$LSingleResult$LSingleResult$ = function ($this, rhs) {
+ /** @type {SingleResult} */
+ var result;
+ result = ({units: [ ], unitIds: [ ], or: false, not: false, searchWord: ''});
+ if (rhs.or) {
+ SingleResult$_orMerge$LSingleResult$LSingleResult$LSingleResult$($this, result, rhs);
+ } else {
+ if (rhs.not) {
+ SingleResult$_notMerge$LSingleResult$LSingleResult$LSingleResult$($this, result, rhs);
+ } else {
+ SingleResult$_andMerge$LSingleResult$LSingleResult$LSingleResult$($this, result, rhs);
+ }
+ }
+ return result;
+};
+
+var SingleResult$merge$LSingleResult$LSingleResult$ = SingleResult.merge$LSingleResult$LSingleResult$;
+
+/**
+ * @param {SingleResult} $this
+ * @return {!number}
+ */
+SingleResult.size$LSingleResult$ = function ($this) {
+ return ($this.units.length | 0);
+};
+
+var SingleResult$size$LSingleResult$ = SingleResult.size$LSingleResult$;
+
+/**
+ * @param {SingleResult} $this
+ * @param {SingleResult} result
+ * @param {SingleResult} rhs
+ */
+SingleResult._andMerge$LSingleResult$LSingleResult$LSingleResult$ = function ($this, result, rhs) {
+ /** @type {!number} */
+ var i;
+ /** @type {undefined|!number} */
+ var id;
+ /** @type {SearchUnit} */
+ var lhsSection;
+ for (i = 0; i < $this.unitIds.length; i++) {
+ id = $this.unitIds[i];
+ if (rhs.unitIds.indexOf(id) !== -1) {
+ lhsSection = $this.units[i];
+ result.unitIds.push(id);
+ result.units.push(lhsSection);
+ }
+ }
+};
+
+var SingleResult$_andMerge$LSingleResult$LSingleResult$LSingleResult$ = SingleResult._andMerge$LSingleResult$LSingleResult$LSingleResult$;
+
+/**
+ * @param {SingleResult} $this
+ * @param {SingleResult} result
+ * @param {SingleResult} rhs
+ */
+SingleResult._orMerge$LSingleResult$LSingleResult$LSingleResult$ = function ($this, result, rhs) {
+ /** @type {!number} */
+ var i;
+ /** @type {undefined|!number} */
+ var id;
+ /** @type {SearchUnit} */
+ var rhsSection;
+ /** @type {SearchUnit} */
+ var lhsSection;
+ /** @type {Array.<undefined|!number>} */
+ var unitIds$0;
+ /** @type {Array.<undefined|SearchUnit>} */
+ var units$0;
+ result.unitIds = (unitIds$0 = $this.unitIds).slice(0, unitIds$0.length);
+ result.units = (units$0 = $this.units).slice(0, units$0.length);
+ for (i = 0; i < rhs.unitIds.length; i++) {
+ id = rhs.unitIds[i];
+ rhsSection = rhs.units[i];
+ if (result.unitIds.indexOf(id) !== -1) {
+ lhsSection = result.units[result.unitIds.indexOf(id)];
+ SearchUnit$merge$LSearchUnit$LSearchUnit$(lhsSection, rhsSection);
+ } else {
+ result.unitIds.push(id);
+ result.units.push(rhsSection);
+ }
+ }
+};
+
+var SingleResult$_orMerge$LSingleResult$LSingleResult$LSingleResult$ = SingleResult._orMerge$LSingleResult$LSingleResult$LSingleResult$;
+
+/**
+ * @param {SingleResult} $this
+ * @param {SingleResult} result
+ * @param {SingleResult} rhs
+ */
+SingleResult._notMerge$LSingleResult$LSingleResult$LSingleResult$ = function ($this, result, rhs) {
+ /** @type {!number} */
+ var i;
+ /** @type {undefined|!number} */
+ var id;
+ /** @type {SearchUnit} */
+ var lhsSection;
+ for (i = 0; i < $this.unitIds.length; i++) {
+ id = $this.unitIds[i];
+ if (rhs.unitIds.indexOf(id) === -1) {
+ lhsSection = $this.units[i];
+ result.unitIds.push(id);
+ result.units.push(lhsSection);
+ }
+ }
+};
+
+var SingleResult$_notMerge$LSingleResult$LSingleResult$LSingleResult$ = SingleResult._notMerge$LSingleResult$LSingleResult$LSingleResult$;
+
+/**
+ * class SearchSummary extends Object
+ * @constructor
+ */
+function SearchSummary() {
+}
+
+/**
+ * @constructor
+ */
+function SearchSummary$() {
+ this.sourceResults = [ ];
+ this.result = null;
+ this.oktavia = null;
+};
+
+SearchSummary$.prototype = new SearchSummary;
+
+/**
+ * @constructor
+ * @param {Oktavia} oktavia
+ */
+function SearchSummary$LOktavia$(oktavia) {
+ this.sourceResults = [ ];
+ this.result = null;
+ this.oktavia = oktavia;
+};
+
+SearchSummary$LOktavia$.prototype = new SearchSummary;
+
+/**
+ * @param {SearchSummary} $this
+ * @param {SingleResult} result
+ */
+SearchSummary.addQuery$LSearchSummary$LSingleResult$ = function ($this, result) {
+ $this.sourceResults.push(result);
+};
+
+var SearchSummary$addQuery$LSearchSummary$LSingleResult$ = SearchSummary.addQuery$LSearchSummary$LSingleResult$;
+
+/**
+ * @param {SearchSummary} $this
+ */
+SearchSummary.mergeResult$LSearchSummary$ = function ($this) {
+ $this.result = SearchSummary$mergeResult$LSearchSummary$ALSingleResult$($this, $this.sourceResults);
+};
+
+var SearchSummary$mergeResult$LSearchSummary$ = SearchSummary.mergeResult$LSearchSummary$;
+
+/**
+ * @param {SearchSummary} $this
+ * @param {Array.<undefined|SingleResult>} results
+ * @return {SingleResult}
+ */
+SearchSummary.mergeResult$LSearchSummary$ALSingleResult$ = function ($this, results) {
+ /** @type {SingleResult} */
+ var rhs;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var results$len$0;
+ rhs = results[0];
+ for ((i = 1, results$len$0 = results.length); i < results$len$0; i++) {
+ rhs = SingleResult$merge$LSingleResult$LSingleResult$(rhs, results[i]);
+ }
+ return rhs;
+};
+
+var SearchSummary$mergeResult$LSearchSummary$ALSingleResult$ = SearchSummary.mergeResult$LSearchSummary$ALSingleResult$;
+
+/**
+ * @param {SearchSummary} $this
+ * @return {Array.<undefined|Proposal>}
+ */
+SearchSummary.getProposal$LSearchSummary$ = function ($this) {
+ /** @type {Array.<undefined|Proposal>} */
+ var proposals;
+ /** @type {!number} */
+ var i;
+ /** @type {Array.<undefined|SingleResult>} */
+ var tmpSource;
+ /** @type {!number} */
+ var j;
+ /** @type {SingleResult} */
+ var result;
+ proposals = [ ];
+ for (i = 0; i < $this.sourceResults.length; i++) {
+ tmpSource = [ ];
+ for (j = 0; j < $this.sourceResults.length; j++) {
+ if (i !== j) {
+ tmpSource.push($this.sourceResults[j]);
+ }
+ }
+ result = SearchSummary$mergeResult$LSearchSummary$ALSingleResult$($this, tmpSource);
+ proposals.push(({omit: i, expect: result.units.length}));
+ }
+ proposals.sort((function (a, b) {
+ return b.expect - a.expect;
+ }));
+ return proposals;
+};
+
+var SearchSummary$getProposal$LSearchSummary$ = SearchSummary.getProposal$LSearchSummary$;
+
+/**
+ * @param {SearchSummary} $this
+ * @return {Array.<undefined|SearchUnit>}
+ */
+SearchSummary.getSortedResult$LSearchSummary$ = function ($this) {
+ /** @type {Array.<undefined|SearchUnit>} */
+ var result;
+ /** @type {Array.<undefined|SearchUnit>} */
+ var units$0;
+ result = (units$0 = $this.result.units).slice(0, units$0.length);
+ result.sort((function (a, b) {
+ return b.score - a.score;
+ }));
+ return result;
+};
+
+var SearchSummary$getSortedResult$LSearchSummary$ = SearchSummary.getSortedResult$LSearchSummary$;
+
+/**
+ * @param {SearchSummary} $this
+ * @return {!number}
+ */
+SearchSummary.size$LSearchSummary$ = function ($this) {
+ /** @type {SingleResult} */
+ var this$0;
+ this$0 = $this.result;
+ return (this$0.units.length | 0);
+};
+
+var SearchSummary$size$LSearchSummary$ = SearchSummary.size$LSearchSummary$;
+
+/**
+ * @param {SearchSummary} $this
+ * @param {SingleResult} result
+ */
+SearchSummary.add$LSearchSummary$LSingleResult$ = function ($this, result) {
+ $this.sourceResults.push(result);
+};
+
+var SearchSummary$add$LSearchSummary$LSingleResult$ = SearchSummary.add$LSearchSummary$LSingleResult$;
+
+/**
+ * class Style extends Object
+ * @constructor
+ */
+function Style() {
+}
+
+/**
+ * @constructor
+ * @param {!string} mode
+ */
+function Style$S(mode) {
+ this.styles = null;
+ this.escapeHTML = false;
+ switch (mode) {
+ case 'console':
+ this.styles = Style.console;
+ break;
+ case 'html':
+ this.styles = Style.html;
+ break;
+ case 'ignore':
+ this.styles = Style.ignore;
+ break;
+ default:
+ this.styles = Style.ignore;
+ break;
+ }
+ this.escapeHTML = mode === 'html';
+};
+
+Style$S.prototype = new Style;
+
+/**
+ * @param {!string} source
+ * @return {!string}
+ */
+Style.prototype.convert$S = function (source) {
+ /** @type {_HTMLHandler} */
+ var handler;
+ /** @type {SAXParser} */
+ var parser;
+ handler = new _HTMLHandler$HASB(this.styles, this.escapeHTML);
+ parser = new SAXParser$LSAXHandler$(handler);
+ parser.parse$S(source);
+ return handler.text.join('');
+};
+
+/**
+ * class Stemmer
+ * @constructor
+ */
+function Stemmer() {
+}
+
+Stemmer.prototype.$__jsx_implements_Stemmer = true;
+
+/**
+ * @constructor
+ */
+function Stemmer$() {
+};
+
+Stemmer$.prototype = new Stemmer;
+
+/**
+ * class BaseStemmer extends Object
+ * @constructor
+ */
+function BaseStemmer() {
+}
+
+$__jsx_merge_interface(BaseStemmer, Stemmer);
+
+/**
+ * @constructor
+ */
+function BaseStemmer$() {
+ /** @type {!string} */
+ var current$0;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var limit$0;
+ this.cache = ({ });
+ current$0 = this.current = "";
+ cursor$0 = this.cursor = 0;
+ limit$0 = this.limit = current$0.length;
+ this.limit_backward = 0;
+ this.bra = cursor$0;
+ this.ket = limit$0;
+};
+
+BaseStemmer$.prototype = new BaseStemmer;
+
+/**
+ * @param {!string} value
+ */
+BaseStemmer.prototype.setCurrent$S = function (value) {
+ /** @type {!string} */
+ var current$0;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var limit$0;
+ current$0 = this.current = value;
+ cursor$0 = this.cursor = 0;
+ limit$0 = this.limit = current$0.length;
+ this.limit_backward = 0;
+ this.bra = cursor$0;
+ this.ket = limit$0;
+};
+
+/**
+ * @return {!string}
+ */
+BaseStemmer.prototype.getCurrent$ = function () {
+ return this.current;
+};
+
+/**
+ * @param {BaseStemmer} other
+ */
+BaseStemmer.prototype.copy_from$LBaseStemmer$ = function (other) {
+ this.current = other.current;
+ this.cursor = other.cursor;
+ this.limit = other.limit;
+ this.limit_backward = other.limit_backward;
+ this.bra = other.bra;
+ this.ket = other.ket;
+};
+
+/**
+ * @param {Array.<undefined|!number>} s
+ * @param {!number} min
+ * @param {!number} max
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.in_grouping$AIII = function (s, min, max) {
+ /** @type {!number} */
+ var ch;
+ if (this.cursor >= this.limit) {
+ return false;
+ }
+ ch = this.current.charCodeAt(this.cursor);
+ if (ch > max || ch < min) {
+ return false;
+ }
+ ch -= min;
+ if ((s[ch >>> 3] & 0x1 << (ch & 0x7)) === 0) {
+ return false;
+ }
+ this.cursor++;
+ return true;
+};
+
+/**
+ * @param {Array.<undefined|!number>} s
+ * @param {!number} min
+ * @param {!number} max
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.in_grouping_b$AIII = function (s, min, max) {
+ /** @type {!number} */
+ var ch;
+ if (this.cursor <= this.limit_backward) {
+ return false;
+ }
+ ch = this.current.charCodeAt(this.cursor - 1);
+ if (ch > max || ch < min) {
+ return false;
+ }
+ ch -= min;
+ if ((s[ch >>> 3] & 0x1 << (ch & 0x7)) === 0) {
+ return false;
+ }
+ this.cursor--;
+ return true;
+};
+
+/**
+ * @param {Array.<undefined|!number>} s
+ * @param {!number} min
+ * @param {!number} max
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.out_grouping$AIII = function (s, min, max) {
+ /** @type {!number} */
+ var ch;
+ if (this.cursor >= this.limit) {
+ return false;
+ }
+ ch = this.current.charCodeAt(this.cursor);
+ if (ch > max || ch < min) {
+ this.cursor++;
+ return true;
+ }
+ ch -= min;
+ if ((s[ch >>> 3] & 0X1 << (ch & 0x7)) === 0) {
+ this.cursor++;
+ return true;
+ }
+ return false;
+};
+
+/**
+ * @param {Array.<undefined|!number>} s
+ * @param {!number} min
+ * @param {!number} max
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.out_grouping_b$AIII = function (s, min, max) {
+ /** @type {!number} */
+ var ch;
+ if (this.cursor <= this.limit_backward) {
+ return false;
+ }
+ ch = this.current.charCodeAt(this.cursor - 1);
+ if (ch > max || ch < min) {
+ this.cursor--;
+ return true;
+ }
+ ch -= min;
+ if ((s[ch >>> 3] & 0x1 << (ch & 0x7)) === 0) {
+ this.cursor--;
+ return true;
+ }
+ return false;
+};
+
+/**
+ * @param {!number} min
+ * @param {!number} max
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.in_range$II = function (min, max) {
+ /** @type {!number} */
+ var ch;
+ if (this.cursor >= this.limit) {
+ return false;
+ }
+ ch = this.current.charCodeAt(this.cursor);
+ if (ch > max || ch < min) {
+ return false;
+ }
+ this.cursor++;
+ return true;
+};
+
+/**
+ * @param {!number} min
+ * @param {!number} max
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.in_range_b$II = function (min, max) {
+ /** @type {!number} */
+ var ch;
+ if (this.cursor <= this.limit_backward) {
+ return false;
+ }
+ ch = this.current.charCodeAt(this.cursor - 1);
+ if (ch > max || ch < min) {
+ return false;
+ }
+ this.cursor--;
+ return true;
+};
+
+/**
+ * @param {!number} min
+ * @param {!number} max
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.out_range$II = function (min, max) {
+ /** @type {!number} */
+ var ch;
+ if (this.cursor >= this.limit) {
+ return false;
+ }
+ ch = this.current.charCodeAt(this.cursor);
+ if (! (ch > max || ch < min)) {
+ return false;
+ }
+ this.cursor++;
+ return true;
+};
+
+/**
+ * @param {!number} min
+ * @param {!number} max
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.out_range_b$II = function (min, max) {
+ /** @type {!number} */
+ var ch;
+ if (this.cursor <= this.limit_backward) {
+ return false;
+ }
+ ch = this.current.charCodeAt(this.cursor - 1);
+ if (! (ch > max || ch < min)) {
+ return false;
+ }
+ this.cursor--;
+ return true;
+};
+
+/**
+ * @param {!number} s_size
+ * @param {!string} s
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.eq_s$IS = function (s_size, s) {
+ /** @type {!number} */
+ var cursor$0;
+ if (this.limit - this.cursor < s_size) {
+ return false;
+ }
+ if (this.current.slice(cursor$0 = this.cursor, cursor$0 + s_size) !== s) {
+ return false;
+ }
+ this.cursor += s_size;
+ return true;
+};
+
+/**
+ * @param {!number} s_size
+ * @param {!string} s
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.eq_s_b$IS = function (s_size, s) {
+ /** @type {!number} */
+ var cursor$0;
+ if (this.cursor - this.limit_backward < s_size) {
+ return false;
+ }
+ if (this.current.slice((cursor$0 = this.cursor) - s_size, cursor$0) !== s) {
+ return false;
+ }
+ this.cursor -= s_size;
+ return true;
+};
+
+/**
+ * @param {!string} s
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.eq_v$S = function (s) {
+ return this.eq_s$IS(s.length, s);
+};
+
+/**
+ * @param {!string} s
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.eq_v_b$S = function (s) {
+ return this.eq_s_b$IS(s.length, s);
+};
+
+/**
+ * @param {Array.<undefined|Among>} v
+ * @param {!number} v_size
+ * @return {!number}
+ */
+BaseStemmer.prototype.find_among$ALAmong$I = function (v, v_size) {
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var j;
+ /** @type {!number} */
+ var c;
+ /** @type {!number} */
+ var l;
+ /** @type {!number} */
+ var common_i;
+ /** @type {!number} */
+ var common_j;
+ /** @type {!boolean} */
+ var first_key_inspected;
+ /** @type {!number} */
+ var k;
+ /** @type {!number} */
+ var diff;
+ /** @type {!number} */
+ var common;
+ /** @type {Among} */
+ var w;
+ /** @type {!number} */
+ var i2;
+ /** @type {!boolean} */
+ var res;
+ i = 0;
+ j = v_size;
+ c = this.cursor;
+ l = this.limit;
+ common_i = 0;
+ common_j = 0;
+ first_key_inspected = false;
+ while (true) {
+ k = i + (j - i >>> 1);
+ diff = 0;
+ common = (common_i < common_j ? common_i : common_j);
+ w = v[k];
+ for (i2 = common; i2 < w.s_size; i2++) {
+ if (c + common === l) {
+ diff = -1;
+ break;
+ }
+ diff = this.current.charCodeAt(c + common) - w.s.charCodeAt(i2);
+ if (diff !== 0) {
+ break;
+ }
+ common++;
+ }
+ if (diff < 0) {
+ j = k;
+ common_j = common;
+ } else {
+ i = k;
+ common_i = common;
+ }
+ if (j - i <= 1) {
+ if (i > 0) {
+ break;
+ }
+ if (j === i) {
+ break;
+ }
+ if (first_key_inspected) {
+ break;
+ }
+ first_key_inspected = true;
+ }
+ }
+ while (true) {
+ w = v[i];
+ if (common_i >= w.s_size) {
+ this.cursor = (c + w.s_size | 0);
+ if (w.method == null) {
+ return w.result;
+ }
+ res = w.method(w.instance);
+ this.cursor = (c + w.s_size | 0);
+ if (res) {
+ return w.result;
+ }
+ }
+ i = w.substring_i;
+ if (i < 0) {
+ return 0;
+ }
+ }
+ return -1;
+};
+
+/**
+ * @param {Array.<undefined|Among>} v
+ * @param {!number} v_size
+ * @return {!number}
+ */
+BaseStemmer.prototype.find_among_b$ALAmong$I = function (v, v_size) {
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var j;
+ /** @type {!number} */
+ var c;
+ /** @type {!number} */
+ var lb;
+ /** @type {!number} */
+ var common_i;
+ /** @type {!number} */
+ var common_j;
+ /** @type {!boolean} */
+ var first_key_inspected;
+ /** @type {!number} */
+ var k;
+ /** @type {!number} */
+ var diff;
+ /** @type {!number} */
+ var common;
+ /** @type {Among} */
+ var w;
+ /** @type {!number} */
+ var i2;
+ /** @type {!boolean} */
+ var res;
+ i = 0;
+ j = v_size;
+ c = this.cursor;
+ lb = this.limit_backward;
+ common_i = 0;
+ common_j = 0;
+ first_key_inspected = false;
+ while (true) {
+ k = i + (j - i >> 1);
+ diff = 0;
+ common = (common_i < common_j ? common_i : common_j);
+ w = v[k];
+ for (i2 = w.s_size - 1 - common; i2 >= 0; i2--) {
+ if (c - common === lb) {
+ diff = -1;
+ break;
+ }
+ diff = this.current.charCodeAt(c - 1 - common) - w.s.charCodeAt(i2);
+ if (diff !== 0) {
+ break;
+ }
+ common++;
+ }
+ if (diff < 0) {
+ j = k;
+ common_j = common;
+ } else {
+ i = k;
+ common_i = common;
+ }
+ if (j - i <= 1) {
+ if (i > 0) {
+ break;
+ }
+ if (j === i) {
+ break;
+ }
+ if (first_key_inspected) {
+ break;
+ }
+ first_key_inspected = true;
+ }
+ }
+ while (true) {
+ w = v[i];
+ if (common_i >= w.s_size) {
+ this.cursor = (c - w.s_size | 0);
+ if (w.method == null) {
+ return w.result;
+ }
+ res = w.method(this);
+ this.cursor = (c - w.s_size | 0);
+ if (res) {
+ return w.result;
+ }
+ }
+ i = w.substring_i;
+ if (i < 0) {
+ return 0;
+ }
+ }
+ return -1;
+};
+
+/**
+ * @param {!number} c_bra
+ * @param {!number} c_ket
+ * @param {!string} s
+ * @return {!number}
+ */
+BaseStemmer.prototype.replace_s$IIS = function (c_bra, c_ket, s) {
+ /** @type {!number} */
+ var adjustment;
+ adjustment = s.length - (c_ket - c_bra);
+ this.current = this.current.slice(0, c_bra) + s + this.current.slice(c_ket);
+ this.limit += (adjustment | 0);
+ if (this.cursor >= c_ket) {
+ this.cursor += (adjustment | 0);
+ } else {
+ if (this.cursor > c_bra) {
+ this.cursor = c_bra;
+ }
+ }
+ return (adjustment | 0);
+};
+
+/**
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.slice_check$ = function () {
+ /** @type {!number} */
+ var bra$0;
+ /** @type {!number} */
+ var ket$0;
+ /** @type {!number} */
+ var limit$0;
+ return ((bra$0 = this.bra) < 0 || bra$0 > (ket$0 = this.ket) || ket$0 > (limit$0 = this.limit) || limit$0 > this.current.length ? false : true);
+};
+
+/**
+ * @param {!string} s
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.slice_from$S = function (s) {
+ /** @type {!boolean} */
+ var result;
+ /** @type {!number} */
+ var bra$0;
+ /** @type {!number} */
+ var ket$0;
+ /** @type {!number} */
+ var limit$0;
+ result = false;
+ if ((bra$0 = this.bra) < 0 || bra$0 > (ket$0 = this.ket) || ket$0 > (limit$0 = this.limit) || limit$0 > this.current.length ? false : true) {
+ this.replace_s$IIS(this.bra, this.ket, s);
+ result = true;
+ }
+ return result;
+};
+
+/**
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.slice_del$ = function () {
+ return this.slice_from$S("");
+};
+
+/**
+ * @param {!number} c_bra
+ * @param {!number} c_ket
+ * @param {!string} s
+ */
+BaseStemmer.prototype.insert$IIS = function (c_bra, c_ket, s) {
+ /** @type {!number} */
+ var adjustment;
+ adjustment = this.replace_s$IIS(c_bra, c_ket, s);
+ if (c_bra <= this.bra) {
+ this.bra += (adjustment | 0);
+ }
+ if (c_bra <= this.ket) {
+ this.ket += (adjustment | 0);
+ }
+};
+
+/**
+ * @param {!string} s
+ * @return {!string}
+ */
+BaseStemmer.prototype.slice_to$S = function (s) {
+ /** @type {!string} */
+ var result;
+ /** @type {!number} */
+ var bra$0;
+ /** @type {!number} */
+ var ket$0;
+ /** @type {!number} */
+ var limit$0;
+ result = '';
+ if ((bra$0 = this.bra) < 0 || bra$0 > (ket$0 = this.ket) || ket$0 > (limit$0 = this.limit) || limit$0 > this.current.length ? false : true) {
+ result = this.current.slice(this.bra, this.ket);
+ }
+ return result;
+};
+
+/**
+ * @param {!string} s
+ * @return {!string}
+ */
+BaseStemmer.prototype.assign_to$S = function (s) {
+ return this.current.slice(0, this.limit);
+};
+
+/**
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.stem$ = function () {
+ return false;
+};
+
+/**
+ * @param {!string} word
+ * @return {!string}
+ */
+BaseStemmer.prototype.stemWord$S = function (word) {
+ /** @type {undefined|!string} */
+ var result;
+ /** @type {!string} */
+ var current$0;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var limit$0;
+ result = this.cache['.' + word];
+ if (result == null) {
+ current$0 = this.current = word;
+ cursor$0 = this.cursor = 0;
+ limit$0 = this.limit = current$0.length;
+ this.limit_backward = 0;
+ this.bra = cursor$0;
+ this.ket = limit$0;
+ this.stem$();
+ result = this.current;
+ this.cache['.' + word] = result;
+ }
+ return result;
+};
+
+/**
+ * @param {Array.<undefined|!string>} words
+ * @return {Array.<undefined|!string>}
+ */
+BaseStemmer.prototype.stemWords$AS = function (words) {
+ /** @type {Array.<undefined|!string>} */
+ var results;
+ /** @type {!number} */
+ var i;
+ /** @type {undefined|!string} */
+ var word;
+ /** @type {undefined|!string} */
+ var result;
+ /** @type {!string} */
+ var current$0;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var limit$0;
+ results = [ ];
+ for (i = 0; i < words.length; i++) {
+ word = words[i];
+ result = this.cache['.' + word];
+ if (result == null) {
+ current$0 = this.current = word;
+ cursor$0 = this.cursor = 0;
+ limit$0 = this.limit = current$0.length;
+ this.limit_backward = 0;
+ this.bra = cursor$0;
+ this.ket = limit$0;
+ this.stem$();
+ result = this.current;
+ this.cache['.' + word] = result;
+ }
+ results.push(result);
+ }
+ return results;
+};
+
+/**
+ * class SpanishStemmer extends BaseStemmer
+ * @constructor
+ */
+function SpanishStemmer() {
+}
+
+SpanishStemmer.prototype = new BaseStemmer;
+/**
+ * @constructor
+ */
+function SpanishStemmer$() {
+ BaseStemmer$.call(this);
+ this.I_p2 = 0;
+ this.I_p1 = 0;
+ this.I_pV = 0;
+};
+
+SpanishStemmer$.prototype = new SpanishStemmer;
+
+/**
+ * @param {SpanishStemmer} other
+ */
+SpanishStemmer.prototype.copy_from$LSpanishStemmer$ = function (other) {
+ this.I_p2 = other.I_p2;
+ this.I_p1 = other.I_p1;
+ this.I_pV = other.I_pV;
+ BaseStemmer.prototype.copy_from$LBaseStemmer$.call(this, other);
+};
+
+/**
+ * @return {!boolean}
+ */
+SpanishStemmer.prototype.r_mark_regions$ = function () {
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var v_3;
+ /** @type {!number} */
+ var v_6;
+ /** @type {!number} */
+ var v_8;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!boolean} */
+ var lab2;
+ /** @type {!boolean} */
+ var lab3;
+ /** @type {!boolean} */
+ var lab4;
+ /** @type {!boolean} */
+ var lab6;
+ /** @type {!boolean} */
+ var lab8;
+ /** @type {!boolean} */
+ var lab9;
+ /** @type {!boolean} */
+ var lab10;
+ /** @type {!boolean} */
+ var lab12;
+ /** @type {!boolean} */
+ var lab13;
+ /** @type {!boolean} */
+ var lab15;
+ /** @type {!boolean} */
+ var lab17;
+ /** @type {!boolean} */
+ var lab19;
+ /** @type {!boolean} */
+ var lab21;
+ /** @type {!number} */
+ var limit$0;
+ /** @type {!number} */
+ var cursor$0;
+ this.I_pV = limit$0 = this.limit;
+ this.I_p1 = limit$0;
+ this.I_p2 = limit$0;
+ v_1 = this.cursor;
+ lab0 = true;
+lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ v_2 = this.cursor;
+ lab2 = true;
+ lab2:
+ while (lab2 === true) {
+ lab2 = false;
+ if (! this.in_grouping$AIII(SpanishStemmer.g_v, 97, 252)) {
+ break lab2;
+ }
+ lab3 = true;
+ lab3:
+ while (lab3 === true) {
+ lab3 = false;
+ v_3 = this.cursor;
+ lab4 = true;
+ lab4:
+ while (lab4 === true) {
+ lab4 = false;
+ if (! this.out_grouping$AIII(SpanishStemmer.g_v, 97, 252)) {
+ break lab4;
+ }
+ golab5:
+ while (true) {
+ lab6 = true;
+ lab6:
+ while (lab6 === true) {
+ lab6 = false;
+ if (! this.in_grouping$AIII(SpanishStemmer.g_v, 97, 252)) {
+ break lab6;
+ }
+ break golab5;
+ }
+ if (this.cursor >= this.limit) {
+ break lab4;
+ }
+ this.cursor++;
+ }
+ break lab3;
+ }
+ this.cursor = v_3;
+ if (! this.in_grouping$AIII(SpanishStemmer.g_v, 97, 252)) {
+ break lab2;
+ }
+ golab7:
+ while (true) {
+ lab8 = true;
+ lab8:
+ while (lab8 === true) {
+ lab8 = false;
+ if (! this.out_grouping$AIII(SpanishStemmer.g_v, 97, 252)) {
+ break lab8;
+ }
+ break golab7;
+ }
+ if (this.cursor >= this.limit) {
+ break lab2;
+ }
+ this.cursor++;
+ }
+ }
+ break lab1;
+ }
+ this.cursor = v_2;
+ if (! this.out_grouping$AIII(SpanishStemmer.g_v, 97, 252)) {
+ break lab0;
+ }
+ lab9 = true;
+ lab9:
+ while (lab9 === true) {
+ lab9 = false;
+ v_6 = this.cursor;
+ lab10 = true;
+ lab10:
+ while (lab10 === true) {
+ lab10 = false;
+ if (! this.out_grouping$AIII(SpanishStemmer.g_v, 97, 252)) {
+ break lab10;
+ }
+ golab11:
+ while (true) {
+ lab12 = true;
+ lab12:
+ while (lab12 === true) {
+ lab12 = false;
+ if (! this.in_grouping$AIII(SpanishStemmer.g_v, 97, 252)) {
+ break lab12;
+ }
+ break golab11;
+ }
+ if (this.cursor >= this.limit) {
+ break lab10;
+ }
+ this.cursor++;
+ }
+ break lab9;
+ }
+ this.cursor = v_6;
+ if (! this.in_grouping$AIII(SpanishStemmer.g_v, 97, 252)) {
+ break lab0;
+ }
+ if (this.cursor >= this.limit) {
+ break lab0;
+ }
+ this.cursor++;
+ }
+ }
+ this.I_pV = this.cursor;
+ }
+ cursor$0 = this.cursor = v_1;
+ v_8 = cursor$0;
+ lab13 = true;
+lab13:
+ while (lab13 === true) {
+ lab13 = false;
+ golab14:
+ while (true) {
+ lab15 = true;
+ lab15:
+ while (lab15 === true) {
+ lab15 = false;
+ if (! this.in_grouping$AIII(SpanishStemmer.g_v, 97, 252)) {
+ break lab15;
+ }
+ break golab14;
+ }
+ if (this.cursor >= this.limit) {
+ break lab13;
+ }
+ this.cursor++;
+ }
+ golab16:
+ while (true) {
+ lab17 = true;
+ lab17:
+ while (lab17 === true) {
+ lab17 = false;
+ if (! this.out_grouping$AIII(SpanishStemmer.g_v, 97, 252)) {
+ break lab17;
+ }
+ break golab16;
+ }
+ if (this.cursor >= this.limit) {
+ break lab13;
+ }
+ this.cursor++;
+ }
+ this.I_p1 = this.cursor;
+ golab18:
+ while (true) {
+ lab19 = true;
+ lab19:
+ while (lab19 === true) {
+ lab19 = false;
+ if (! this.in_grouping$AIII(SpanishStemmer.g_v, 97, 252)) {
+ break lab19;
+ }
+ break golab18;
+ }
+ if (this.cursor >= this.limit) {
+ break lab13;
+ }
+ this.cursor++;
+ }
+ golab20:
+ while (true) {
+ lab21 = true;
+ lab21:
+ while (lab21 === true) {
+ lab21 = false;
+ if (! this.out_grouping$AIII(SpanishStemmer.g_v, 97, 252)) {
+ break lab21;
+ }
+ break golab20;
+ }
+ if (this.cursor >= this.limit) {
+ break lab13;
+ }
+ this.cursor++;
+ }
+ this.I_p2 = this.cursor;
+ }
+ this.cursor = v_8;
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+SpanishStemmer.prototype.r_postlude$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var v_1;
+ /** @type {!boolean} */
+ var lab1;
+replab0:
+ while (true) {
+ v_1 = this.cursor;
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ this.bra = this.cursor;
+ among_var = this.find_among$ALAmong$I(SpanishStemmer.a_0, 6);
+ if (among_var === 0) {
+ break lab1;
+ }
+ this.ket = this.cursor;
+ switch (among_var) {
+ case 0:
+ break lab1;
+ case 1:
+ if (! this.slice_from$S("a")) {
+ return false;
+ }
+ break;
+ case 2:
+ if (! this.slice_from$S("e")) {
+ return false;
+ }
+ break;
+ case 3:
+ if (! this.slice_from$S("i")) {
+ return false;
+ }
+ break;
+ case 4:
+ if (! this.slice_from$S("o")) {
+ return false;
+ }
+ break;
+ case 5:
+ if (! this.slice_from$S("u")) {
+ return false;
+ }
+ break;
+ case 6:
+ if (this.cursor >= this.limit) {
+ break lab1;
+ }
+ this.cursor++;
+ break;
+ }
+ continue replab0;
+ }
+ this.cursor = v_1;
+ break replab0;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+SpanishStemmer.prototype.r_RV$ = function () {
+ return (! (this.I_pV <= this.cursor) ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+SpanishStemmer.prototype.r_R1$ = function () {
+ return (! (this.I_p1 <= this.cursor) ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+SpanishStemmer.prototype.r_R2$ = function () {
+ return (! (this.I_p2 <= this.cursor) ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+SpanishStemmer.prototype.r_attached_pronoun$ = function () {
+ /** @type {!number} */
+ var among_var;
+ this.ket = this.cursor;
+ if (this.find_among_b$ALAmong$I(SpanishStemmer.a_1, 13) === 0) {
+ return false;
+ }
+ this.bra = this.cursor;
+ among_var = this.find_among_b$ALAmong$I(SpanishStemmer.a_2, 11);
+ if (among_var === 0) {
+ return false;
+ }
+ if (! (! (this.I_pV <= this.cursor) ? false : true)) {
+ return false;
+ }
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ this.bra = this.cursor;
+ if (! this.slice_from$S("iendo")) {
+ return false;
+ }
+ break;
+ case 2:
+ this.bra = this.cursor;
+ if (! this.slice_from$S("ando")) {
+ return false;
+ }
+ break;
+ case 3:
+ this.bra = this.cursor;
+ if (! this.slice_from$S("ar")) {
+ return false;
+ }
+ break;
+ case 4:
+ this.bra = this.cursor;
+ if (! this.slice_from$S("er")) {
+ return false;
+ }
+ break;
+ case 5:
+ this.bra = this.cursor;
+ if (! this.slice_from$S("ir")) {
+ return false;
+ }
+ break;
+ case 6:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 7:
+ if (! this.eq_s_b$IS(1, "u")) {
+ return false;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+SpanishStemmer.prototype.r_standard_suffix$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var v_3;
+ /** @type {!number} */
+ var v_4;
+ /** @type {!number} */
+ var v_5;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!boolean} */
+ var lab2;
+ /** @type {!boolean} */
+ var lab3;
+ /** @type {!boolean} */
+ var lab4;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var cursor$1;
+ /** @type {!number} */
+ var cursor$2;
+ /** @type {!number} */
+ var cursor$3;
+ this.ket = this.cursor;
+ among_var = this.find_among_b$ALAmong$I(SpanishStemmer.a_6, 46);
+ if (among_var === 0) {
+ return false;
+ }
+ this.bra = this.cursor;
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ if (! (! (this.I_p2 <= this.cursor) ? false : true)) {
+ return false;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 2:
+ if (! (! (this.I_p2 <= this.cursor) ? false : true)) {
+ return false;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ v_1 = this.limit - this.cursor;
+ lab0 = true;
+ lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ this.ket = this.cursor;
+ if (! this.eq_s_b$IS(2, "ic")) {
+ this.cursor = this.limit - v_1;
+ break lab0;
+ }
+ this.bra = cursor$0 = this.cursor;
+ if (! (! (this.I_p2 <= cursor$0) ? false : true)) {
+ this.cursor = this.limit - v_1;
+ break lab0;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ }
+ break;
+ case 3:
+ if (! (! (this.I_p2 <= this.cursor) ? false : true)) {
+ return false;
+ }
+ if (! this.slice_from$S("log")) {
+ return false;
+ }
+ break;
+ case 4:
+ if (! (! (this.I_p2 <= this.cursor) ? false : true)) {
+ return false;
+ }
+ if (! this.slice_from$S("u")) {
+ return false;
+ }
+ break;
+ case 5:
+ if (! (! (this.I_p2 <= this.cursor) ? false : true)) {
+ return false;
+ }
+ if (! this.slice_from$S("ente")) {
+ return false;
+ }
+ break;
+ case 6:
+ if (! (! (this.I_p1 <= this.cursor) ? false : true)) {
+ return false;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ v_2 = this.limit - this.cursor;
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ this.ket = this.cursor;
+ among_var = this.find_among_b$ALAmong$I(SpanishStemmer.a_3, 4);
+ if (among_var === 0) {
+ this.cursor = this.limit - v_2;
+ break lab1;
+ }
+ this.bra = cursor$1 = this.cursor;
+ if (! (! (this.I_p2 <= cursor$1) ? false : true)) {
+ this.cursor = this.limit - v_2;
+ break lab1;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ switch (among_var) {
+ case 0:
+ this.cursor = this.limit - v_2;
+ break lab1;
+ case 1:
+ this.ket = this.cursor;
+ if (! this.eq_s_b$IS(2, "at")) {
+ this.cursor = this.limit - v_2;
+ break lab1;
+ }
+ this.bra = cursor$2 = this.cursor;
+ if (! (! (this.I_p2 <= cursor$2) ? false : true)) {
+ this.cursor = this.limit - v_2;
+ break lab1;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ }
+ }
+ break;
+ case 7:
+ if (! (! (this.I_p2 <= this.cursor) ? false : true)) {
+ return false;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ v_3 = this.limit - this.cursor;
+ lab2 = true;
+ lab2:
+ while (lab2 === true) {
+ lab2 = false;
+ this.ket = this.cursor;
+ among_var = this.find_among_b$ALAmong$I(SpanishStemmer.a_4, 3);
+ if (among_var === 0) {
+ this.cursor = this.limit - v_3;
+ break lab2;
+ }
+ this.bra = this.cursor;
+ switch (among_var) {
+ case 0:
+ this.cursor = this.limit - v_3;
+ break lab2;
+ case 1:
+ if (! (! (this.I_p2 <= this.cursor) ? false : true)) {
+ this.cursor = this.limit - v_3;
+ break lab2;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ }
+ }
+ break;
+ case 8:
+ if (! (! (this.I_p2 <= this.cursor) ? false : true)) {
+ return false;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ v_4 = this.limit - this.cursor;
+ lab3 = true;
+ lab3:
+ while (lab3 === true) {
+ lab3 = false;
+ this.ket = this.cursor;
+ among_var = this.find_among_b$ALAmong$I(SpanishStemmer.a_5, 3);
+ if (among_var === 0) {
+ this.cursor = this.limit - v_4;
+ break lab3;
+ }
+ this.bra = this.cursor;
+ switch (among_var) {
+ case 0:
+ this.cursor = this.limit - v_4;
+ break lab3;
+ case 1:
+ if (! (! (this.I_p2 <= this.cursor) ? false : true)) {
+ this.cursor = this.limit - v_4;
+ break lab3;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ }
+ }
+ break;
+ case 9:
+ if (! (! (this.I_p2 <= this.cursor) ? false : true)) {
+ return false;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ v_5 = this.limit - this.cursor;
+ lab4 = true;
+ lab4:
+ while (lab4 === true) {
+ lab4 = false;
+ this.ket = this.cursor;
+ if (! this.eq_s_b$IS(2, "at")) {
+ this.cursor = this.limit - v_5;
+ break lab4;
+ }
+ this.bra = cursor$3 = this.cursor;
+ if (! (! (this.I_p2 <= cursor$3) ? false : true)) {
+ this.cursor = this.limit - v_5;
+ break lab4;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ }
+ break;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+SpanishStemmer.prototype.r_y_verb_suffix$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var cursor$1;
+ /** @type {!number} */
+ var cursor$2;
+ v_1 = this.limit - (cursor$0 = this.cursor);
+ if (cursor$0 < this.I_pV) {
+ return false;
+ }
+ cursor$1 = this.cursor = this.I_pV;
+ v_2 = this.limit_backward;
+ this.limit_backward = cursor$1;
+ cursor$2 = this.cursor = this.limit - v_1;
+ this.ket = cursor$2;
+ among_var = this.find_among_b$ALAmong$I(SpanishStemmer.a_7, 12);
+ if (among_var === 0) {
+ this.limit_backward = v_2;
+ return false;
+ }
+ this.bra = this.cursor;
+ this.limit_backward = v_2;
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ if (! this.eq_s_b$IS(1, "u")) {
+ return false;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+SpanishStemmer.prototype.r_verb_suffix$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var v_3;
+ /** @type {!number} */
+ var v_4;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var cursor$1;
+ /** @type {!number} */
+ var cursor$2;
+ v_1 = this.limit - (cursor$0 = this.cursor);
+ if (cursor$0 < this.I_pV) {
+ return false;
+ }
+ cursor$1 = this.cursor = this.I_pV;
+ v_2 = this.limit_backward;
+ this.limit_backward = cursor$1;
+ cursor$2 = this.cursor = this.limit - v_1;
+ this.ket = cursor$2;
+ among_var = this.find_among_b$ALAmong$I(SpanishStemmer.a_8, 96);
+ if (among_var === 0) {
+ this.limit_backward = v_2;
+ return false;
+ }
+ this.bra = this.cursor;
+ this.limit_backward = v_2;
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ v_3 = this.limit - this.cursor;
+ lab0 = true;
+ lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ if (! this.eq_s_b$IS(1, "u")) {
+ this.cursor = this.limit - v_3;
+ break lab0;
+ }
+ v_4 = this.limit - this.cursor;
+ if (! this.eq_s_b$IS(1, "g")) {
+ this.cursor = this.limit - v_3;
+ break lab0;
+ }
+ this.cursor = this.limit - v_4;
+ }
+ this.bra = this.cursor;
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 2:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+SpanishStemmer.prototype.r_residual_suffix$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var cursor$1;
+ this.ket = this.cursor;
+ among_var = this.find_among_b$ALAmong$I(SpanishStemmer.a_9, 8);
+ if (among_var === 0) {
+ return false;
+ }
+ this.bra = this.cursor;
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ if (! (! (this.I_pV <= this.cursor) ? false : true)) {
+ return false;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 2:
+ if (! (! (this.I_pV <= this.cursor) ? false : true)) {
+ return false;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ v_1 = this.limit - this.cursor;
+ lab0 = true;
+ lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ this.ket = this.cursor;
+ if (! this.eq_s_b$IS(1, "u")) {
+ this.cursor = this.limit - v_1;
+ break lab0;
+ }
+ this.bra = cursor$0 = this.cursor;
+ v_2 = this.limit - cursor$0;
+ if (! this.eq_s_b$IS(1, "g")) {
+ this.cursor = this.limit - v_1;
+ break lab0;
+ }
+ cursor$1 = this.cursor = this.limit - v_2;
+ if (! (! (this.I_pV <= cursor$1) ? false : true)) {
+ this.cursor = this.limit - v_1;
+ break lab0;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ }
+ break;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+SpanishStemmer.prototype.stem$ = function () {
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var v_3;
+ /** @type {!number} */
+ var v_4;
+ /** @type {!number} */
+ var v_6;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!boolean} */
+ var lab2;
+ /** @type {!boolean} */
+ var lab3;
+ /** @type {!boolean} */
+ var lab4;
+ /** @type {!boolean} */
+ var lab5;
+ /** @type {!boolean} */
+ var lab6;
+ /** @type {!boolean} */
+ var lab7;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var limit$0;
+ /** @type {!number} */
+ var cursor$1;
+ /** @type {!number} */
+ var limit$1;
+ /** @type {!number} */
+ var cursor$2;
+ /** @type {!number} */
+ var cursor$3;
+ v_1 = this.cursor;
+ lab0 = true;
+lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ if (! this.r_mark_regions$()) {
+ break lab0;
+ }
+ }
+ cursor$0 = this.cursor = v_1;
+ this.limit_backward = cursor$0;
+ cursor$1 = this.cursor = limit$0 = this.limit;
+ v_2 = limit$0 - cursor$1;
+ lab1 = true;
+lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ if (! this.r_attached_pronoun$()) {
+ break lab1;
+ }
+ }
+ cursor$2 = this.cursor = (limit$1 = this.limit) - v_2;
+ v_3 = limit$1 - cursor$2;
+ lab2 = true;
+lab2:
+ while (lab2 === true) {
+ lab2 = false;
+ lab3 = true;
+ lab3:
+ while (lab3 === true) {
+ lab3 = false;
+ v_4 = this.limit - this.cursor;
+ lab4 = true;
+ lab4:
+ while (lab4 === true) {
+ lab4 = false;
+ if (! this.r_standard_suffix$()) {
+ break lab4;
+ }
+ break lab3;
+ }
+ this.cursor = this.limit - v_4;
+ lab5 = true;
+ lab5:
+ while (lab5 === true) {
+ lab5 = false;
+ if (! this.r_y_verb_suffix$()) {
+ break lab5;
+ }
+ break lab3;
+ }
+ this.cursor = this.limit - v_4;
+ if (! this.r_verb_suffix$()) {
+ break lab2;
+ }
+ }
+ }
+ this.cursor = this.limit - v_3;
+ lab6 = true;
+lab6:
+ while (lab6 === true) {
+ lab6 = false;
+ if (! this.r_residual_suffix$()) {
+ break lab6;
+ }
+ }
+ cursor$3 = this.cursor = this.limit_backward;
+ v_6 = cursor$3;
+ lab7 = true;
+lab7:
+ while (lab7 === true) {
+ lab7 = false;
+ if (! this.r_postlude$()) {
+ break lab7;
+ }
+ }
+ this.cursor = v_6;
+ return true;
+};
+
+/**
+ * @param {*} o
+ * @return {!boolean}
+ */
+SpanishStemmer.prototype.equals$X = function (o) {
+ return o instanceof SpanishStemmer;
+};
+
+/**
+ * @return {!number}
+ */
+SpanishStemmer.prototype.hashCode$ = function () {
+ /** @type {!string} */
+ var classname;
+ /** @type {!number} */
+ var hash;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var char;
+ classname = "SpanishStemmer";
+ hash = 0;
+ if ("SpanishStemmer".length === 0) {
+ return (hash | 0);
+ }
+ for (i = 0; i < classname.length; i++) {
+ char = classname.charCodeAt(i);
+ hash = (hash << 5) - hash + char;
+ hash = hash & hash;
+ }
+ return (hash | 0);
+};
+
+/**
+ * class Among extends Object
+ * @constructor
+ */
+function Among() {
+}
+
+/**
+ * @constructor
+ * @param {!string} s
+ * @param {!number} substring_i
+ * @param {!number} result
+ */
+function Among$SII(s, substring_i, result) {
+ this.s_size = s.length;
+ this.s = s;
+ this.substring_i = substring_i;
+ this.result = result;
+ this.method = null;
+ this.instance = null;
+};
+
+Among$SII.prototype = new Among;
+
+/**
+ * @constructor
+ * @param {!string} s
+ * @param {!number} substring_i
+ * @param {!number} result
+ * @param {*} method
+ * @param {BaseStemmer} instance
+ */
+function Among$SIIF$LBaseStemmer$B$LBaseStemmer$(s, substring_i, result, method, instance) {
+ this.s_size = s.length;
+ this.s = s;
+ this.substring_i = substring_i;
+ this.result = result;
+ this.method = method;
+ this.instance = instance;
+};
+
+Among$SIIF$LBaseStemmer$B$LBaseStemmer$.prototype = new Among;
+
+/**
+ * class Metadata extends Object
+ * @constructor
+ */
+function Metadata() {
+}
+
+/**
+ * @constructor
+ * @param {Oktavia} parent
+ */
+function Metadata$LOktavia$(parent) {
+ this._parent = parent;
+ this._bitVector = new BitVector$();
+};
+
+Metadata$LOktavia$.prototype = new Metadata;
+
+/**
+ * @return {!number}
+ */
+Metadata.prototype._size$ = function () {
+ /** @type {BitVector} */
+ var this$0;
+ /** @type {!number} */
+ var i$0;
+ /** @type {BitVector} */
+ var _bitVector$0;
+ this$0 = _bitVector$0 = this._bitVector;
+ i$0 = _bitVector$0._size;
+ return this$0.rank$IB(i$0, true);
+};
+
+/**
+ * @param {!number} index
+ * @return {!string}
+ */
+Metadata.prototype.getContent$I = function (index) {
+ /** @type {!number} */
+ var startPosition;
+ /** @type {!number} */
+ var length;
+ if (index < 0 || this._size$() <= index) {
+ throw new Error("Section.getContent() : range error " + (index + ""));
+ }
+ startPosition = 0;
+ if (index > 0) {
+ startPosition = this._bitVector.select$I(index - 1) + 1;
+ }
+ length = this._bitVector.select$I(index) - startPosition + 1;
+ return this._parent._getSubstring$II(startPosition, length);
+};
+
+/**
+ * @param {!number} index
+ * @return {!number}
+ */
+Metadata.prototype.getStartPosition$I = function (index) {
+ /** @type {!number} */
+ var startPosition;
+ if (index < 0 || this._size$() <= index) {
+ throw new Error("Section.getContent() : range error " + (index + ""));
+ }
+ startPosition = 0;
+ if (index > 0) {
+ startPosition = this._bitVector.select$I(index - 1) + 1;
+ }
+ return (startPosition | 0);
+};
+
+/**
+ * @param {SingleResult} result
+ * @param {Array.<undefined|!number>} positions
+ * @param {!string} word
+ * @param {!boolean} stemmed
+ */
+Metadata.prototype.grouping$LSingleResult$AISB = function (result, positions, word, stemmed) {
+};
+
+/**
+ * @param {!number} index
+ * @return {!string}
+ */
+Metadata.prototype.getInformation$I = function (index) {
+ return '';
+};
+
+/**
+ */
+Metadata.prototype._build$ = function () {
+ this._bitVector.build$();
+};
+
+/**
+ * @param {!string} name
+ * @param {!string} data
+ * @param {!number} offset
+ * @return {!number}
+ */
+Metadata.prototype._load$SSI = function (name, data, offset) {
+ offset = this._bitVector.load$SI(data, offset);
+ this._parent._metadataLabels.push(name);
+ this._parent._metadatas[name] = this;
+ return offset;
+};
+
+/**
+ * @return {!string}
+ */
+Metadata.prototype._dump$ = function () {
+ /** @type {BitVector} */
+ var this$0;
+ /** @type {Array.<undefined|!string>} */
+ var contents$0;
+ this$0 = this._bitVector;
+ contents$0 = [ ];
+ contents$0.push(Binary$dump32bitNumber$N(this$0._size));
+ contents$0.push(Binary$dump32bitNumberList$AN(this$0._v));
+ return contents$0.join('');
+};
+
+/**
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+Metadata.prototype._dump$LCompressionReport$ = function (report) {
+ /** @type {BitVector} */
+ var this$0;
+ /** @type {Array.<undefined|!string>} */
+ var contents$0;
+ this$0 = this._bitVector;
+ contents$0 = [ ];
+ contents$0.push(Binary$dump32bitNumber$N(this$0._size));
+ CompressionReport$add$LCompressionReport$II(report, 2, 2);
+ contents$0.push(Binary$dump32bitNumberList$ANLCompressionReport$(this$0._v, report));
+ return contents$0.join('');
+};
+
+/**
+ * class Section extends Metadata
+ * @constructor
+ */
+function Section() {
+}
+
+Section.prototype = new Metadata;
+/**
+ * @constructor
+ * @param {Oktavia} parent
+ */
+function Section$LOktavia$(parent) {
+ this._parent = parent;
+ this._bitVector = new BitVector$();
+ this._names = [ ];
+};
+
+Section$LOktavia$.prototype = new Section;
+
+/**
+ * @param {!string} name
+ */
+Section.prototype.setTail$S = function (name) {
+ /** @type {!number} */
+ var index$0;
+ /** @type {Oktavia} */
+ var this$0;
+ /** @type {FMIndex} */
+ var this$0$0;
+ this$0 = this._parent;
+ this$0$0 = this$0._fmindex;
+ index$0 = this$0$0._substr.length;
+ this._names.push(name);
+ this._bitVector.set$I(index$0 - 1);
+};
+
+/**
+ * @param {!string} name
+ * @param {!number} index
+ */
+Section.prototype.setTail$SI = function (name, index) {
+ this._names.push(name);
+ this._bitVector.set$I(index - 1);
+};
+
+/**
+ * @return {!number}
+ */
+Section.prototype.size$ = function () {
+ return (this._names.length | 0);
+};
+
+/**
+ * @param {!number} position
+ * @return {!number}
+ */
+Section.prototype.getSectionIndex$I = function (position) {
+ /** @type {BitVector} */
+ var this$0;
+ if (position < 0 || this._bitVector.size$() <= position) {
+ throw new Error("Section.getSectionIndex() : range error " + (position + ""));
+ }
+ this$0 = this._bitVector;
+ return this$0.rank$IB(position, true);
+};
+
+/**
+ * @param {!number} index
+ * @return {!string}
+ */
+Section.prototype.getName$I = function (index) {
+ if (index < 0 || this._names.length <= index) {
+ throw new Error("Section.getName() : range error");
+ }
+ return this._names[index];
+};
+
+/**
+ * @param {SingleResult} result
+ * @param {Array.<undefined|!number>} positions
+ * @param {!string} word
+ * @param {!boolean} stemmed
+ */
+Section.prototype.grouping$LSingleResult$AISB = function (result, positions, word, stemmed) {
+ /** @type {!number} */
+ var i;
+ /** @type {undefined|!number} */
+ var position;
+ /** @type {!number} */
+ var index;
+ /** @type {SearchUnit} */
+ var unit;
+ for (i = 0; i < positions.length; i++) {
+ position = positions[i];
+ index = this.getSectionIndex$I(position);
+ unit = SingleResult$getSearchUnit$LSingleResult$I(result, index);
+ if (unit.startPosition < 0) {
+ unit.startPosition = this.getStartPosition$I(index);
+ }
+ SearchUnit$addPosition$LSearchUnit$SIB(unit, word, position - unit.startPosition, stemmed);
+ }
+};
+
+/**
+ * @param {!number} index
+ * @return {!string}
+ */
+Section.prototype.getInformation$I = function (index) {
+ return this.getName$I(index);
+};
+
+/**
+ * @param {Oktavia} parent
+ * @param {!string} name
+ * @param {!string} data
+ * @param {!number} offset
+ * @return {!number}
+ */
+Section._load$LOktavia$SSI = function (parent, name, data, offset) {
+ /** @type {LoadedStringListResult} */
+ var strs;
+ /** @type {Section} */
+ var section;
+ /** @type {!number} */
+ var offset$0;
+ strs = new LoadedStringListResult$SI(data, offset);
+ section = new Section$LOktavia$(parent);
+ section._names = strs.result;
+ offset$0 = strs.offset;
+ offset$0 = section._bitVector.load$SI(data, offset$0);
+ section._parent._metadataLabels.push(name);
+ section._parent._metadatas[name] = section;
+ return offset$0;
+};
+
+var Section$_load$LOktavia$SSI = Section._load$LOktavia$SSI;
+
+/**
+ * @return {!string}
+ */
+Section.prototype._dump$ = function () {
+ return [ Binary$dump16bitNumber$I(0), Binary$dumpStringList$AS(this._names), Metadata.prototype._dump$.call(this) ].join('');
+};
+
+/**
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+Section.prototype._dump$LCompressionReport$ = function (report) {
+ CompressionReport$add$LCompressionReport$II(report, 1, 1);
+ return [ Binary$dump16bitNumber$I(0), Binary$dumpStringList$ASLCompressionReport$(this._names, report), Metadata.prototype._dump$LCompressionReport$.call(this, report) ].join('');
+};
+
+/**
+ * class Splitter extends Metadata
+ * @constructor
+ */
+function Splitter() {
+}
+
+Splitter.prototype = new Metadata;
+/**
+ * @constructor
+ * @param {Oktavia} parent
+ */
+function Splitter$LOktavia$(parent) {
+ this._parent = parent;
+ this._bitVector = new BitVector$();
+ this.name = null;
+};
+
+Splitter$LOktavia$.prototype = new Splitter;
+
+/**
+ * @constructor
+ * @param {Oktavia} parent
+ * @param {!string} name
+ */
+function Splitter$LOktavia$S(parent, name) {
+ this._parent = parent;
+ this._bitVector = new BitVector$();
+ this.name = name;
+};
+
+Splitter$LOktavia$S.prototype = new Splitter;
+
+/**
+ * @return {!number}
+ */
+Splitter.prototype.size$ = function () {
+ /** @type {BitVector} */
+ var this$0$0;
+ /** @type {!number} */
+ var i$0$0;
+ /** @type {BitVector} */
+ var _bitVector$0;
+ this$0$0 = _bitVector$0 = this._bitVector;
+ i$0$0 = _bitVector$0._size;
+ return this$0$0.rank$IB(i$0$0, true);
+};
+
+/**
+ */
+Splitter.prototype.split$ = function () {
+ /** @type {!number} */
+ var index$0;
+ /** @type {Oktavia} */
+ var this$0;
+ /** @type {FMIndex} */
+ var this$0$0;
+ this$0 = this._parent;
+ this$0$0 = this$0._fmindex;
+ index$0 = this$0$0._substr.length;
+ this._bitVector.set$I(index$0 - 1);
+};
+
+/**
+ * @param {!number} index
+ */
+Splitter.prototype.split$I = function (index) {
+ this._bitVector.set$I(index - 1);
+};
+
+/**
+ * @param {!number} position
+ * @return {!number}
+ */
+Splitter.prototype.getIndex$I = function (position) {
+ /** @type {BitVector} */
+ var this$0;
+ if (position < 0 || this._bitVector.size$() <= position) {
+ throw new Error("Section.getSectionIndex() : range error");
+ }
+ this$0 = this._bitVector;
+ return this$0.rank$IB(position, true);
+};
+
+/**
+ * @param {SingleResult} result
+ * @param {Array.<undefined|!number>} positions
+ * @param {!string} word
+ * @param {!boolean} stemmed
+ */
+Splitter.prototype.grouping$LSingleResult$AISB = function (result, positions, word, stemmed) {
+ /** @type {!number} */
+ var i;
+ /** @type {undefined|!number} */
+ var position;
+ /** @type {!number} */
+ var index;
+ /** @type {SearchUnit} */
+ var unit;
+ for (i = 0; i < positions.length; i++) {
+ position = positions[i];
+ index = this.getIndex$I(position);
+ unit = SingleResult$getSearchUnit$LSingleResult$I(result, index);
+ if (unit.startPosition < 0) {
+ unit.startPosition = this.getStartPosition$I(index);
+ }
+ SearchUnit$addPosition$LSearchUnit$SIB(unit, word, position - unit.startPosition, stemmed);
+ }
+};
+
+/**
+ * @param {!number} index
+ * @return {!string}
+ */
+Splitter.prototype.getInformation$I = function (index) {
+ return (this.name != null ? this.name + (index + 1 + "") : '');
+};
+
+/**
+ * @param {Oktavia} parent
+ * @param {!string} name
+ * @param {!string} data
+ * @param {!number} offset
+ * @return {!number}
+ */
+Splitter._load$LOktavia$SSI = function (parent, name, data, offset) {
+ /** @type {Splitter} */
+ var section;
+ section = new Splitter$LOktavia$(parent);
+ offset = section._bitVector.load$SI(data, offset);
+ section._parent._metadataLabels.push(name);
+ section._parent._metadatas[name] = section;
+ return offset;
+};
+
+var Splitter$_load$LOktavia$SSI = Splitter._load$LOktavia$SSI;
+
+/**
+ * @return {!string}
+ */
+Splitter.prototype._dump$ = function () {
+ return [ Binary$dump16bitNumber$I(1), Metadata.prototype._dump$.call(this) ].join('');
+};
+
+/**
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+Splitter.prototype._dump$LCompressionReport$ = function (report) {
+ CompressionReport$add$LCompressionReport$II(report, 1, 1);
+ return [ Binary$dump16bitNumber$I(1), Metadata.prototype._dump$LCompressionReport$.call(this, report) ].join('');
+};
+
+/**
+ * class Table extends Metadata
+ * @constructor
+ */
+function Table() {
+}
+
+Table.prototype = new Metadata;
+/**
+ * @constructor
+ * @param {Oktavia} parent
+ * @param {Array.<undefined|!string>} headers
+ */
+function Table$LOktavia$AS(parent, headers) {
+ this._parent = parent;
+ this._bitVector = new BitVector$();
+ this._headers = headers;
+ this._columnTails = new BitVector$();
+};
+
+Table$LOktavia$AS.prototype = new Table;
+
+/**
+ * @return {!number}
+ */
+Table.prototype.rowSize$ = function () {
+ /** @type {BitVector} */
+ var this$0$0;
+ /** @type {!number} */
+ var i$0$0;
+ /** @type {BitVector} */
+ var _bitVector$0;
+ this$0$0 = _bitVector$0 = this._bitVector;
+ i$0$0 = _bitVector$0._size;
+ return this$0$0.rank$IB(i$0$0, true);
+};
+
+/**
+ * @return {!number}
+ */
+Table.prototype.columnSize$ = function () {
+ return (this._headers.length | 0);
+};
+
+/**
+ */
+Table.prototype.setColumnTail$ = function () {
+ /** @type {!number} */
+ var index;
+ /** @type {Oktavia} */
+ var this$0;
+ /** @type {FMIndex} */
+ var this$0$0;
+ /** @type {Oktavia} */
+ var _parent$0;
+ this$0 = _parent$0 = this._parent;
+ this$0$0 = this$0._fmindex;
+ index = this$0$0._substr.length;
+ _parent$0._fmindex.push$S(Oktavia.eob);
+ this._columnTails.set$I(index - 1);
+};
+
+/**
+ */
+Table.prototype.setRowTail$ = function () {
+ /** @type {!number} */
+ var index;
+ /** @type {Oktavia} */
+ var this$0;
+ /** @type {FMIndex} */
+ var this$0$0;
+ this$0 = this._parent;
+ this$0$0 = this$0._fmindex;
+ index = this$0$0._substr.length;
+ this._bitVector.set$I(index - 1);
+};
+
+/**
+ * @param {!number} position
+ * @return {Array.<undefined|!number>}
+ */
+Table.prototype.getCell$I = function (position) {
+ /** @type {!number} */
+ var row;
+ /** @type {!number} */
+ var currentColumn;
+ /** @type {!number} */
+ var lastRowColumn;
+ /** @type {!number} */
+ var startPosition;
+ /** @type {Array.<undefined|!number>} */
+ var result;
+ /** @type {BitVector} */
+ var this$0;
+ /** @type {BitVector} */
+ var this$1;
+ if (position < 0 || this._bitVector.size$() <= position) {
+ throw new Error("Section.getSectionIndex() : range error " + (position + ""));
+ }
+ this$0 = this._bitVector;
+ row = this$0.rank$IB(position, true);
+ this$1 = this._columnTails;
+ currentColumn = this$1.rank$IB(position, true);
+ lastRowColumn = 0;
+ if (row > 0) {
+ startPosition = this._bitVector.select$I(row - 1) + 1;
+ lastRowColumn = this._columnTails.rank$I(startPosition);
+ }
+ result = [ row, currentColumn - lastRowColumn ];
+ return result;
+};
+
+/**
+ * @param {!number} rowIndex
+ * @return {Object.<string, undefined|!string>}
+ */
+Table.prototype.getRowContent$I = function (rowIndex) {
+ /** @type {!string} */
+ var content;
+ /** @type {Array.<undefined|!string>} */
+ var values;
+ /** @type {Object.<string, undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var i;
+ content = this.getContent$I(rowIndex);
+ values = content.split(Oktavia.eob, this._headers.length);
+ result = ({ });
+ for (i in this._headers) {
+ if (i < values.length) {
+ result[this._headers[i]] = values[i];
+ } else {
+ result[this._headers[i]] = '';
+ }
+ }
+ return result;
+};
+
+/**
+ * @param {SingleResult} result
+ * @param {Array.<undefined|!number>} positions
+ * @param {!string} word
+ * @param {!boolean} stemmed
+ */
+Table.prototype.grouping$LSingleResult$AISB = function (result, positions, word, stemmed) {
+};
+
+/**
+ * @param {!number} index
+ * @return {!string}
+ */
+Table.prototype.getInformation$I = function (index) {
+ return '';
+};
+
+/**
+ */
+Table.prototype._build$ = function () {
+ this._bitVector.build$();
+ this._columnTails.build$();
+};
+
+/**
+ * @param {Oktavia} parent
+ * @param {!string} name
+ * @param {!string} data
+ * @param {!number} offset
+ * @return {!number}
+ */
+Table._load$LOktavia$SSI = function (parent, name, data, offset) {
+ /** @type {LoadedStringListResult} */
+ var strs;
+ /** @type {Table} */
+ var table;
+ /** @type {!number} */
+ var offset$0;
+ strs = new LoadedStringListResult$SI(data, offset);
+ table = new Table$LOktavia$AS(parent, strs.result);
+ offset$0 = strs.offset;
+ offset$0 = table._bitVector.load$SI(data, offset$0);
+ table._parent._metadataLabels.push(name);
+ table._parent._metadatas[name] = table;
+ offset = offset$0;
+ return table._columnTails.load$SI(data, offset$0);
+};
+
+var Table$_load$LOktavia$SSI = Table._load$LOktavia$SSI;
+
+/**
+ * @return {!string}
+ */
+Table.prototype._dump$ = function () {
+ return [ Binary$dump16bitNumber$I(2), Binary$dumpStringList$AS(this._headers), Metadata.prototype._dump$.call(this), this._columnTails.dump$() ].join('');
+};
+
+/**
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+Table.prototype._dump$LCompressionReport$ = function (report) {
+ CompressionReport$add$LCompressionReport$II(report, 1, 1);
+ return [ Binary$dump16bitNumber$I(2), Binary$dumpStringList$ASLCompressionReport$(this._headers, report), Metadata.prototype._dump$LCompressionReport$.call(this, report), this._columnTails.dump$LCompressionReport$(report) ].join('');
+};
+
+/**
+ * class Block extends Metadata
+ * @constructor
+ */
+function Block() {
+}
+
+Block.prototype = new Metadata;
+/**
+ * @constructor
+ * @param {Oktavia} parent
+ */
+function Block$LOktavia$(parent) {
+ this._parent = parent;
+ this._bitVector = new BitVector$();
+ this._names = [ ];
+ this._start = false;
+};
+
+Block$LOktavia$.prototype = new Block;
+
+/**
+ * @param {!string} blockName
+ */
+Block.prototype.startBlock$S = function (blockName) {
+ this.startBlock$SI(blockName, this._parent.contentSize$());
+};
+
+/**
+ * @param {!string} blockName
+ * @param {!number} index
+ */
+Block.prototype.startBlock$SI = function (blockName, index) {
+ if (this._start) {
+ throw new Error('Splitter `' + this._names[this._names.length - 1] + '` is not closed');
+ }
+ this._start = true;
+ this._names.push(blockName);
+ this._bitVector.set$I(index - 1);
+};
+
+/**
+ */
+Block.prototype.endBlock$ = function () {
+ this.endBlock$I(this._parent.contentSize$());
+};
+
+/**
+ * @param {!number} index
+ */
+Block.prototype.endBlock$I = function (index) {
+ if (! this._start) {
+ throw new Error('Splitter is not started');
+ }
+ this._start = false;
+ this._bitVector.set$I(index - 1);
+};
+
+/**
+ * @return {!number}
+ */
+Block.prototype.size$ = function () {
+ return (this._names.length | 0);
+};
+
+/**
+ * @param {!number} position
+ * @return {!number}
+ */
+Block.prototype.blockIndex$I = function (position) {
+ /** @type {!number} */
+ var result;
+ /** @type {BitVector} */
+ var this$0;
+ if (position < 0 || this._parent._fmindex.size$() - 1 <= position) {
+ throw new Error("Block.blockIndex() : range error " + (position + ""));
+ }
+ if (position >= this._bitVector.size$()) {
+ position = (this._bitVector.size$() - 1 | 0);
+ result = (this._bitVector.rank$I(position) + 1 | 0);
+ } else {
+ this$0 = this._bitVector;
+ result = this$0.rank$IB(position, true);
+ }
+ return result;
+};
+
+/**
+ * @param {!number} position
+ * @return {!boolean}
+ */
+Block.prototype.inBlock$I = function (position) {
+ /** @type {!number} */
+ var blockIndex;
+ blockIndex = this.blockIndex$I(position);
+ return blockIndex % 2 !== 0;
+};
+
+/**
+ * @param {!number} position
+ * @return {!string}
+ */
+Block.prototype.getBlockContent$I = function (position) {
+ /** @type {!number} */
+ var blockIndex;
+ /** @type {!string} */
+ var result;
+ blockIndex = this.blockIndex$I(position);
+ if (blockIndex % 2 !== 0) {
+ result = this.getContent$I(blockIndex);
+ } else {
+ result = '';
+ }
+ return result;
+};
+
+/**
+ * @param {!number} position
+ * @return {!string}
+ */
+Block.prototype.getBlockName$I = function (position) {
+ /** @type {!number} */
+ var blockIndex;
+ /** @type {!string} */
+ var result;
+ blockIndex = this.blockIndex$I(position);
+ if (blockIndex % 2 !== 0) {
+ result = this._names[blockIndex >>> 1];
+ } else {
+ result = '';
+ }
+ return result;
+};
+
+/**
+ * @param {SingleResult} result
+ * @param {Array.<undefined|!number>} positions
+ * @param {!string} word
+ * @param {!boolean} stemmed
+ */
+Block.prototype.grouping$LSingleResult$AISB = function (result, positions, word, stemmed) {
+};
+
+/**
+ * @param {!number} index
+ * @return {!string}
+ */
+Block.prototype.getInformation$I = function (index) {
+ return '';
+};
+
+/**
+ * @param {Oktavia} parent
+ * @param {!string} name
+ * @param {!string} data
+ * @param {!number} offset
+ * @return {!number}
+ */
+Block._load$LOktavia$SSI = function (parent, name, data, offset) {
+ /** @type {LoadedStringListResult} */
+ var strs;
+ /** @type {Block} */
+ var block;
+ /** @type {!number} */
+ var offset$0;
+ strs = new LoadedStringListResult$SI(data, offset);
+ block = new Block$LOktavia$(parent);
+ block._names = strs.result;
+ offset$0 = strs.offset;
+ offset$0 = block._bitVector.load$SI(data, offset$0);
+ block._parent._metadataLabels.push(name);
+ block._parent._metadatas[name] = block;
+ return offset$0;
+};
+
+var Block$_load$LOktavia$SSI = Block._load$LOktavia$SSI;
+
+/**
+ * @return {!string}
+ */
+Block.prototype._dump$ = function () {
+ return [ Binary$dump16bitNumber$I(3), Binary$dumpStringList$AS(this._names), Metadata.prototype._dump$.call(this) ].join('');
+};
+
+/**
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+Block.prototype._dump$LCompressionReport$ = function (report) {
+ CompressionReport$add$LCompressionReport$II(report, 1, 1);
+ return [ Binary$dump16bitNumber$I(3), Binary$dumpStringList$ASLCompressionReport$(this._names, report), Metadata.prototype._dump$LCompressionReport$.call(this, report) ].join('');
+};
+
+/**
+ * class FMIndex extends Object
+ * @constructor
+ */
+function FMIndex() {
+}
+
+/**
+ * @constructor
+ */
+function FMIndex$() {
+ /** @type {Array.<undefined|!number>} */
+ var _rlt$0;
+ this._ssize = 0;
+ (this._ddic = 0, this._head = 0);
+ this._substr = "";
+ this._sv = new WaveletMatrix$();
+ this._posdic = [ ];
+ this._idic = [ ];
+ _rlt$0 = this._rlt = [ ];
+ _rlt$0.length = 65536;
+};
+
+FMIndex$.prototype = new FMIndex;
+
+/**
+ */
+FMIndex.prototype.clear$ = function () {
+ /** @type {WaveletMatrix} */
+ var this$0;
+ this$0 = this._sv;
+ this$0._bv.length = 0;
+ this$0._seps.length = 0;
+ this$0._size = 0;
+ this._posdic.length = 0;
+ this._idic.length = 0;
+ this._ddic = 0;
+ this._head = 0;
+ this._substr = "";
+};
+
+/**
+ * @return {!number}
+ */
+FMIndex.prototype.size$ = function () {
+ /** @type {WaveletMatrix} */
+ var this$0;
+ this$0 = this._sv;
+ return this$0._size;
+};
+
+/**
+ * @return {!number}
+ */
+FMIndex.prototype.contentSize$ = function () {
+ return this._substr.length;
+};
+
+/**
+ * @param {!string} key
+ * @return {!number}
+ */
+FMIndex.prototype.getRows$S = function (key) {
+ /** @type {Array.<undefined|!number>} */
+ var pos;
+ pos = [ ];
+ return this.getRows$SAI(key, pos);
+};
+
+/**
+ * @param {!string} key
+ * @param {Array.<undefined|!number>} pos
+ * @return {!number}
+ */
+FMIndex.prototype.getRows$SAI = function (key, pos) {
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var code;
+ /** @type {!number} */
+ var first;
+ /** @type {undefined|!number} */
+ var last;
+ /** @type {!number} */
+ var c;
+ /** @type {Array.<undefined|!number>} */
+ var _rlt$0;
+ i = key.length - 1;
+ code = key.charCodeAt(i);
+ first = (_rlt$0 = this._rlt)[code] + 1;
+ last = _rlt$0[code + 1];
+ while (first <= last) {
+ if (i === 0) {
+ pos[0] = (-- first | 0);
+ pos[1] = -- last;
+ return (last - first + 1 | 0);
+ }
+ i--;
+ c = key.charCodeAt(i);
+ first = this._rlt[c] + this._sv.rank$II(first - 1, c) + 1;
+ last = this._rlt[c] + this._sv.rank$II(last, c);
+ }
+ return 0;
+};
+
+/**
+ * @param {!number} i
+ * @return {!number}
+ */
+FMIndex.prototype.getPosition$I = function (i) {
+ /** @type {!number} */
+ var pos;
+ /** @type {!number} */
+ var c;
+ if (i >= this.size$()) {
+ throw new Error("FMIndex.getPosition() : range error");
+ }
+ pos = 0;
+ while (i !== this._head) {
+ if (i % this._ddic === 0) {
+ pos += this._posdic[i / this._ddic] + 1;
+ break;
+ }
+ c = this._sv.get$I(i);
+ i = this._rlt[c] + this._sv.rank$II(i, c);
+ pos++;
+ }
+ return (pos % this.size$() | 0);
+};
+
+/**
+ * @param {!number} pos
+ * @param {!number} len
+ * @return {!string}
+ */
+FMIndex.prototype.getSubstring$II = function (pos, len) {
+ /** @type {!number} */
+ var pos_end;
+ /** @type {!number} */
+ var pos_tmp;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var pos_idic;
+ /** @type {!string} */
+ var substr;
+ /** @type {!number} */
+ var c;
+ /** @type {!number} */
+ var _ddic$0;
+ if (pos >= this.size$()) {
+ throw new Error("FMIndex.getSubstring() : range error");
+ }
+ pos_end = Math.min(pos + len, this.size$());
+ pos_tmp = this.size$() - 1;
+ i = this._head;
+ pos_idic = Math.floor((pos_end + (_ddic$0 = this._ddic) - 2) / _ddic$0);
+ if (pos_idic < this._idic.length) {
+ pos_tmp = pos_idic * this._ddic;
+ i = this._idic[pos_idic];
+ }
+ substr = "";
+ while (pos_tmp >= pos) {
+ c = this._sv.get$I(i);
+ i = this._rlt[c] + this._sv.rank$II(i, c);
+ if (pos_tmp < pos_end) {
+ substr = String.fromCharCode(c) + substr;
+ }
+ if (pos_tmp === 0) {
+ break;
+ }
+ pos_tmp--;
+ }
+ return substr;
+};
+
+/**
+ */
+FMIndex.prototype.build$ = function () {
+ this.build$SIIB(String.fromCharCode(0), 65535, 20, false);
+};
+
+/**
+ * @param {!string} end_marker
+ * @param {!number} ddic
+ * @param {!boolean} verbose
+ */
+FMIndex.prototype.build$SIB = function (end_marker, ddic, verbose) {
+ this.build$SIIB(end_marker, 65535, ddic, verbose);
+};
+
+/**
+ * @param {!string} end_marker
+ * @param {!number} maxChar
+ * @param {!number} ddic
+ * @param {!boolean} verbose
+ */
+FMIndex.prototype.build$SIIB = function (end_marker, maxChar, ddic, verbose) {
+ /** @type {BurrowsWheelerTransform} */
+ var b;
+ /** @type {!string} */
+ var s;
+ /** @type {!number} */
+ var c;
+ /** @type {!string} */
+ var str$0;
+ /** @type {WaveletMatrix} */
+ var this$0;
+ /** @type {!string} */
+ var _str$0;
+ /** @type {Array.<undefined|!number>} */
+ var _suffixarray$0;
+ if (verbose) {
+ console.time("building burrows-wheeler transform");
+ }
+ this._substr += end_marker;
+ b = ({_str: "", _size: 0, _head: 0, _suffixarray: [ ]});
+ str$0 = this._substr;
+ _str$0 = b._str = str$0;
+ b._size = _str$0.length;
+ _suffixarray$0 = b._suffixarray = SAIS$make$S(str$0);
+ b._head = (_suffixarray$0.indexOf(0) | 0);
+ s = BurrowsWheelerTransform$get$LBurrowsWheelerTransform$(b);
+ this._ssize = s.length;
+ this._head = b._head;
+ b._str = "";
+ b._size = 0;
+ b._head = 0;
+ b._suffixarray.length = 0;
+ this._substr = "";
+ if (verbose) {
+ console.timeEnd("building burrows-wheeler transform");
+ }
+ if (verbose) {
+ console.time("building wavelet matrix");
+ }
+ this$0 = this._sv;
+ this$0._bitsize = (Math.ceil(Math.log(maxChar) / 0.6931471805599453) | 0);
+ if (verbose) {
+ console.log(" maxCharCode: ", maxChar);
+ console.log(" bitSize: ", this._sv.bitsize$());
+ }
+ this._sv.build$S(s);
+ if (verbose) {
+ console.timeEnd("building wavelet matrix");
+ }
+ if (verbose) {
+ console.time("caching rank less than");
+ }
+ for (c = 0; c < maxChar; c++) {
+ this._rlt[c] = this._sv.rank_less_than$II(this._sv.size$(), c);
+ }
+ if (verbose) {
+ console.timeEnd("caching rank less than");
+ }
+ this._ddic = ddic;
+ if (verbose) {
+ console.time("building dictionaries");
+ }
+ this._buildDictionaries$();
+ if (verbose) {
+ console.timeEnd("building dictionaries");
+ console.log('');
+ }
+};
+
+/**
+ */
+FMIndex.prototype._buildDictionaries$ = function () {
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var pos;
+ /** @type {!number} */
+ var c;
+ for (i = 0; i < this._ssize / this._ddic + 1; i++) {
+ this._posdic.push(0);
+ this._idic.push(0);
+ }
+ i = this._head;
+ pos = this.size$() - 1;
+ do {
+ if (i % this._ddic === 0) {
+ this._posdic[Math.floor(i / this._ddic)] = (pos | 0);
+ }
+ if (pos % this._ddic === 0) {
+ this._idic[Math.floor(pos / this._ddic)] = (i | 0);
+ }
+ c = this._sv.get$I(i);
+ i = this._rlt[c] + this._sv.rank$II(i, c);
+ pos--;
+ } while (i !== this._head);
+};
+
+/**
+ * @param {!string} doc
+ */
+FMIndex.prototype.push$S = function (doc) {
+ if (doc.length <= 0) {
+ throw new Error("FMIndex::push(): empty string");
+ }
+ this._substr += doc;
+};
+
+/**
+ * @param {!string} keyword
+ * @return {Array.<undefined|!number>}
+ */
+FMIndex.prototype.search$S = function (keyword) {
+ /** @type {Array.<undefined|!number>} */
+ var result;
+ /** @type {Array.<undefined|!number>} */
+ var position;
+ /** @type {!number} */
+ var rows;
+ /** @type {undefined|!number} */
+ var first;
+ /** @type {undefined|!number} */
+ var last;
+ /** @type {undefined|!number} */
+ var i;
+ result = [ ];
+ position = [ ];
+ rows = this.getRows$SAI(keyword, position);
+ if (rows > 0) {
+ first = position[0];
+ last = position[1];
+ for (i = first; i <= last; i++) {
+ result.push(this.getPosition$I(i));
+ }
+ }
+ return result;
+};
+
+/**
+ * @return {!string}
+ */
+FMIndex.prototype.dump$ = function () {
+ return this.dump$B(false);
+};
+
+/**
+ * @param {!boolean} verbose
+ * @return {!string}
+ */
+FMIndex.prototype.dump$B = function (verbose) {
+ /** @type {Array.<undefined|!string>} */
+ var contents;
+ /** @type {CompressionReport} */
+ var report;
+ /** @type {!number} */
+ var i;
+ contents = [ ];
+ report = ({source: 0, result: 0});
+ contents.push(Binary$dump32bitNumber$N(this._ddic));
+ contents.push(Binary$dump32bitNumber$N(this._ssize));
+ contents.push(Binary$dump32bitNumber$N(this._head));
+ CompressionReport$add$LCompressionReport$II(report, 6, 6);
+ contents.push(this._sv.dump$LCompressionReport$(report));
+ if (verbose) {
+ console.log("Serializing FM-index");
+ console.log(' Wavelet Matrix: ' + (contents[3].length * 2 + "") + ' bytes (' + (Math.round(report.result * 100.0 / report.source) + "") + '%)');
+ }
+ contents.push(Binary$dump32bitNumber$N(this._posdic.length));
+ for (i in this._posdic) {
+ contents.push(Binary$dump32bitNumber$N(this._posdic[i]));
+ }
+ for (i in this._idic) {
+ contents.push(Binary$dump32bitNumber$N(this._idic[i]));
+ }
+ if (verbose) {
+ console.log(' Dictionary Cache: ' + (this._idic.length * 16 + "") + ' bytes');
+ }
+ return contents.join("");
+};
+
+/**
+ * @param {!string} data
+ * @return {!number}
+ */
+FMIndex.prototype.load$S = function (data) {
+ return this.load$SI(data, 0);
+};
+
+/**
+ * @param {!string} data
+ * @param {!number} offset
+ * @return {!number}
+ */
+FMIndex.prototype.load$SI = function (data, offset) {
+ /** @type {!number} */
+ var maxChar;
+ /** @type {!number} */
+ var c;
+ /** @type {!number} */
+ var size;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var result$0;
+ /** @type {!number} */
+ var result$1;
+ result$0 = data.charCodeAt(offset) * 65536 + data.charCodeAt(offset + 1);
+ this._ddic = (result$0 | 0);
+ this._ssize = (Binary$load32bitNumber$SI(data, offset + 2) | 0);
+ this._head = (Binary$load32bitNumber$SI(data, offset + 4) | 0);
+ offset = this._sv.load$SI(data, offset + 6);
+ maxChar = Math.pow(2, this._sv.bitsize$());
+ for (c = 0; c < maxChar; c++) {
+ this._rlt[c] = this._sv.rank_less_than$II(this._sv.size$(), c);
+ }
+ result$1 = data.charCodeAt(offset) * 65536 + data.charCodeAt(offset + 1);
+ size = result$1;
+ offset += 2;
+ for (i = 0; i < size; (i++, offset += 2)) {
+ this._posdic.push(Binary$load32bitNumber$SI(data, offset));
+ }
+ for (i = 0; i < size; (i++, offset += 2)) {
+ this._idic.push(Binary$load32bitNumber$SI(data, offset));
+ }
+ return offset;
+};
+
+/**
+ * class Tag extends Object
+ * @constructor
+ */
+function Tag() {
+}
+
+/**
+ * @constructor
+ * @param {!string} name
+ */
+function Tag$S(name) {
+ this.name = name;
+ this.attributes = ({ });
+ this.isSelfClosing = false;
+};
+
+Tag$S.prototype = new Tag;
+
+/**
+ * class _Common extends Object
+ * @constructor
+ */
+function _Common() {
+}
+
+/**
+ * @constructor
+ */
+function _Common$() {
+};
+
+_Common$.prototype = new _Common;
+
+/**
+ * class _State extends Object
+ * @constructor
+ */
+function _State() {
+}
+
+/**
+ * @constructor
+ */
+function _State$() {
+};
+
+_State$.prototype = new _State;
+
+/**
+ * class SAXHandler extends Object
+ * @constructor
+ */
+function SAXHandler() {
+}
+
+/**
+ * @constructor
+ */
+function SAXHandler$() {
+ this.position = 0;
+ this.column = 0;
+ this.line = 0;
+};
+
+SAXHandler$.prototype = new SAXHandler;
+
+/**
+ * @param {Error} error
+ */
+SAXHandler.prototype.onerror$LError$ = function (error) {
+};
+
+/**
+ * @param {!string} text
+ */
+SAXHandler.prototype.ontext$S = function (text) {
+};
+
+/**
+ * @param {!string} doctype
+ */
+SAXHandler.prototype.ondoctype$S = function (doctype) {
+};
+
+/**
+ * @param {!string} name
+ * @param {!string} body
+ */
+SAXHandler.prototype.onprocessinginstruction$SS = function (name, body) {
+};
+
+/**
+ * @param {!string} sgmlDecl
+ */
+SAXHandler.prototype.onsgmldeclaration$S = function (sgmlDecl) {
+};
+
+/**
+ * @param {!string} tagname
+ * @param {Object.<string, undefined|!string>} attributes
+ */
+SAXHandler.prototype.onopentag$SHS = function (tagname, attributes) {
+};
+
+/**
+ * @param {!string} tagname
+ */
+SAXHandler.prototype.onclosetag$S = function (tagname) {
+};
+
+/**
+ * @param {!string} name
+ * @param {!string} value
+ */
+SAXHandler.prototype.onattribute$SS = function (name, value) {
+};
+
+/**
+ * @param {!string} comment
+ */
+SAXHandler.prototype.oncomment$S = function (comment) {
+};
+
+/**
+ */
+SAXHandler.prototype.onopencdata$ = function () {
+};
+
+/**
+ * @param {!string} cdata
+ */
+SAXHandler.prototype.oncdata$S = function (cdata) {
+};
+
+/**
+ */
+SAXHandler.prototype.onclosecdata$ = function () {
+};
+
+/**
+ */
+SAXHandler.prototype.onend$ = function () {
+};
+
+/**
+ */
+SAXHandler.prototype.onready$ = function () {
+};
+
+/**
+ * @param {!string} script
+ */
+SAXHandler.prototype.onscript$S = function (script) {
+};
+
+/**
+ * class _HTMLHandler extends SAXHandler
+ * @constructor
+ */
+function _HTMLHandler() {
+}
+
+_HTMLHandler.prototype = new SAXHandler;
+/**
+ * @constructor
+ * @param {Object.<string, undefined|Array.<undefined|!string>>} styles
+ * @param {!boolean} escape
+ */
+function _HTMLHandler$HASB(styles, escape) {
+ this.position = 0;
+ this.column = 0;
+ this.line = 0;
+ this.text = [ ];
+ this.escape = escape;
+ this.styles = styles;
+};
+
+_HTMLHandler$HASB.prototype = new _HTMLHandler;
+
+/**
+ * @param {!string} str
+ * @return {!string}
+ */
+_HTMLHandler.escapeHTML$S = function (str) {
+ return str.replace(/\n/g, "<br/>").replace(/&/g, "&amp;").replace(/"/g, "&quot;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
+};
+
+var _HTMLHandler$escapeHTML$S = _HTMLHandler.escapeHTML$S;
+
+/**
+ * @param {!string} tagname
+ * @param {Object.<string, undefined|!string>} attributes
+ */
+_HTMLHandler.prototype.onopentag$SHS = function (tagname, attributes) {
+ this.text.push(this.styles[tagname][0]);
+};
+
+/**
+ * @param {!string} tagname
+ */
+_HTMLHandler.prototype.onclosetag$S = function (tagname) {
+ this.text.push(this.styles[tagname][1]);
+};
+
+/**
+ * @param {!string} text
+ */
+_HTMLHandler.prototype.ontext$S = function (text) {
+ if (this.escape) {
+ this.text.push(text.replace(/\n/g, "<br/>").replace(/&/g, "&amp;").replace(/"/g, "&quot;").replace(/</g, "&lt;").replace(/>/g, "&gt;"));
+ } else {
+ this.text.push(text);
+ }
+};
+
+/**
+ * @return {!string}
+ */
+_HTMLHandler.prototype.result$ = function () {
+ return this.text.join('');
+};
+
+/**
+ * class SAXParser extends Object
+ * @constructor
+ */
+function SAXParser() {
+}
+
+/**
+ * @constructor
+ * @param {SAXHandler} handler
+ */
+function SAXParser$LSAXHandler$(handler) {
+ this.q = "";
+ this.c = "";
+ this.bufferCheckPosition = 0;
+ this.looseCase = "";
+ this.tags = [ ];
+ this.closed = false;
+ this.closedRoot = false;
+ this.sawRoot = false;
+ this.tag = null;
+ this.error = null;
+ this.handler = null;
+ this.ENTITIES = null;
+ this.strict = false;
+ this.tagName = "";
+ this.state = 0;
+ this.line = 0;
+ this.column = 0;
+ this.position = 0;
+ this.startTagPosition = 0;
+ this.attribName = "";
+ this.attribValue = "";
+ this.script = "";
+ this.textNode = "";
+ this.attribList = null;
+ this.noscript = false;
+ this.cdata = "";
+ this.procInstBody = "";
+ this.procInstName = "";
+ this.doctype = "";
+ this.entity = "";
+ this.sgmlDecl = "";
+ this.comment = "";
+ this.preTags = 0;
+ this._init$LSAXHandler$B(handler, false);
+};
+
+SAXParser$LSAXHandler$.prototype = new SAXParser;
+
+/**
+ * @constructor
+ * @param {SAXHandler} handler
+ * @param {!boolean} strict
+ */
+function SAXParser$LSAXHandler$B(handler, strict) {
+ this.q = "";
+ this.c = "";
+ this.bufferCheckPosition = 0;
+ this.looseCase = "";
+ this.tags = [ ];
+ this.closed = false;
+ this.closedRoot = false;
+ this.sawRoot = false;
+ this.tag = null;
+ this.error = null;
+ this.handler = null;
+ this.ENTITIES = null;
+ this.strict = false;
+ this.tagName = "";
+ this.state = 0;
+ this.line = 0;
+ this.column = 0;
+ this.position = 0;
+ this.startTagPosition = 0;
+ this.attribName = "";
+ this.attribValue = "";
+ this.script = "";
+ this.textNode = "";
+ this.attribList = null;
+ this.noscript = false;
+ this.cdata = "";
+ this.procInstBody = "";
+ this.procInstName = "";
+ this.doctype = "";
+ this.entity = "";
+ this.sgmlDecl = "";
+ this.comment = "";
+ this.preTags = 0;
+ this._init$LSAXHandler$B(handler, strict);
+};
+
+SAXParser$LSAXHandler$B.prototype = new SAXParser;
+
+/**
+ * @param {SAXHandler} handler
+ * @param {!boolean} strict
+ */
+SAXParser.prototype._init$LSAXHandler$B = function (handler, strict) {
+ this.handler = handler;
+ this.clearBuffers$();
+ this.q = "";
+ this.bufferCheckPosition = 65536;
+ this.looseCase = 'toLowerCase';
+ this.tags = [ ];
+ this.closed = this.closedRoot = this.sawRoot = false;
+ this.tag = null;
+ this.error = null;
+ this.strict = strict;
+ this.noscript = strict;
+ this.state = 1;
+ this.ENTITIES = _Entities$entity_list$();
+ this.attribList = [ ];
+ this.noscript = false;
+ this.preTags = 0;
+};
+
+/**
+ * @param {!boolean} flag
+ */
+SAXParser.prototype.set_noscript$B = function (flag) {
+ this.noscript = flag;
+};
+
+/**
+ * @return {SAXParser}
+ */
+SAXParser.prototype.resume$ = function () {
+ this.error = null;
+ return this;
+};
+
+/**
+ * @return {SAXParser}
+ */
+SAXParser.prototype.close$ = function () {
+ return this.parse$S('');
+};
+
+/**
+ * @param {!string} chunk
+ * @return {SAXParser}
+ */
+SAXParser.prototype.parse$S = function (chunk) {
+ /** @type {Char} */
+ var _;
+ /** @type {!number} */
+ var i;
+ /** @type {!string} */
+ var c;
+ /** @type {!number} */
+ var starti;
+ /** @type {!number} */
+ var pad;
+ /** @type {!number} */
+ var returnState;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$0;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$1;
+ /** @type {RegExp} */
+ var charclass$2;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$3;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$4;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$5;
+ /** @type {!string} */
+ var text$0;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$6;
+ /** @type {RegExp} */
+ var charclass$7;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$8;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$9;
+ /** @type {RegExp} */
+ var charclass$10;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$11;
+ /** @type {RegExp} */
+ var charclass$12;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$13;
+ /** @type {RegExp} */
+ var charclass$14;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$15;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$16;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$17;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$18;
+ /** @type {RegExp} */
+ var charclass$19;
+ /** @type {RegExp} */
+ var charclass$20;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$21;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$22;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$23;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$24;
+ /** @type {!string} */
+ var comment$0;
+ _ = new Char$();
+ if (this.error) {
+ throw this.error;
+ }
+ if (this.closed) {
+ return this.emiterror$S("Cannot write after close. Assign an onready handler.");
+ }
+ (i = 0, c = "");
+ while (this.c = c = chunk.charAt(i++)) {
+ this.position++;
+ if (c === "\n") {
+ this.handler.line++;
+ this.handler.column = 0;
+ } else {
+ this.handler.column++;
+ }
+ switch (this.state) {
+ case 1:
+ if (c === "<") {
+ this.state = 4;
+ this.startTagPosition = this.position;
+ } else {
+ charclass$0 = _.whitespace;
+ if (! $__jsx_ObjectHasOwnProperty.call(charclass$0, c)) {
+ this.strictFail$S("Non-whitespace before first tag.");
+ this.textNode = c;
+ this.state = 2;
+ }
+ }
+ continue;
+ case 2:
+ if (this.sawRoot && ! this.closedRoot) {
+ starti = i - 1;
+ while (c && c !== "<" && c !== "&") {
+ c = chunk.charAt(i++);
+ if (c) {
+ this.position++;
+ if (c === "\n") {
+ this.handler.line++;
+ this.handler.column = 0;
+ } else {
+ this.handler.column++;
+ }
+ }
+ }
+ this.textNode += chunk.substring(starti, i - 1);
+ }
+ if (c === "<") {
+ this.state = 4;
+ this.startTagPosition = this.position;
+ } else {
+ if (_.not$HBS(_.whitespace, c) && (! this.sawRoot || this.closedRoot)) {
+ this.strictFail$S("Text data outside of root node.");
+ }
+ if (c === "&") {
+ this.state = 3;
+ } else {
+ this.textNode += c;
+ }
+ }
+ continue;
+ case 33:
+ if (c === "<") {
+ this.state = 34;
+ } else {
+ this.script += c;
+ }
+ continue;
+ case 34:
+ if (c === "/") {
+ this.state = 31;
+ } else {
+ this.script += "<" + c;
+ this.state = 33;
+ }
+ continue;
+ case 4:
+ if (c === "!") {
+ this.state = 5;
+ this.sgmlDecl = "";
+ } else {
+ charclass$1 = _.whitespace;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$1, c)) {
+ } else {
+ charclass$2 = _.nameStart;
+ if (charclass$2.test(c)) {
+ this.state = 21;
+ this.tagName = c;
+ } else {
+ if (c === "/") {
+ this.state = 31;
+ this.tagName = "";
+ } else {
+ if (c === "?") {
+ this.state = 18;
+ this.procInstName = this.procInstBody = "";
+ } else {
+ this.strictFail$S("Unencoded <");
+ if (this.startTagPosition + 1 < this.position) {
+ pad = this.position - this.startTagPosition;
+ for (i = 0; i < pad; i++) {
+ c = " " + c;
+ }
+ }
+ this.textNode += "<" + c;
+ this.state = 2;
+ }
+ }
+ }
+ }
+ }
+ continue;
+ case 5:
+ if ((this.sgmlDecl + c).toUpperCase() === _.CDATA) {
+ this.closetext_if_exist$();
+ this.state = 15;
+ this.sgmlDecl = "";
+ this.cdata = "";
+ } else {
+ if (this.sgmlDecl + c === "--") {
+ this.state = 12;
+ this.comment = "";
+ this.sgmlDecl = "";
+ } else {
+ if ((this.sgmlDecl + c).toUpperCase() === _.DOCTYPE) {
+ this.state = 7;
+ if (this.doctype || this.sawRoot) {
+ this.strictFail$S("Inappropriately located doctype declaration");
+ }
+ this.doctype = "";
+ this.sgmlDecl = "";
+ } else {
+ if (c === ">") {
+ this.closetext_if_exist$();
+ this.sgmlDecl = "";
+ this.state = 2;
+ } else {
+ charclass$3 = _.quote;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$3, c)) {
+ this.state = 6;
+ this.sgmlDecl += c;
+ } else {
+ this.sgmlDecl += c;
+ }
+ }
+ }
+ }
+ }
+ continue;
+ case 6:
+ if (c === this.q) {
+ this.state = 5;
+ this.q = "";
+ }
+ this.sgmlDecl += c;
+ continue;
+ case 7:
+ if (c === ">") {
+ this.state = 2;
+ this.closetext_if_exist$();
+ this.doctype.trim();
+ } else {
+ this.doctype += c;
+ if (c === "[") {
+ this.state = 9;
+ } else {
+ charclass$4 = _.quote;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$4, c)) {
+ this.state = 8;
+ this.q = c;
+ }
+ }
+ }
+ continue;
+ case 8:
+ this.doctype += c;
+ if (c === this.q) {
+ this.q = "";
+ this.state = 7;
+ }
+ continue;
+ case 9:
+ this.doctype += c;
+ if (c === "]") {
+ this.state = 7;
+ } else {
+ charclass$5 = _.quote;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$5, c)) {
+ this.state = 10;
+ this.q = c;
+ }
+ }
+ continue;
+ case 10:
+ this.doctype += c;
+ if (c === this.q) {
+ this.state = 9;
+ this.q = "";
+ }
+ continue;
+ case 12:
+ if (c === "-") {
+ this.state = 13;
+ } else {
+ this.comment += c;
+ }
+ continue;
+ case 13:
+ if (c === "-") {
+ this.state = 14;
+ text$0 = this.comment;
+ text$0 = text$0.replace(/[\n\t]/g, ' ');
+ text$0 = text$0.replace(/\s\s+/g, " ");
+ comment$0 = this.comment = text$0;
+ if (comment$0) {
+ this.closetext_if_exist$();
+ this.comment.trim();
+ }
+ this.comment = "";
+ } else {
+ this.comment += "-" + c;
+ this.state = 12;
+ }
+ continue;
+ case 14:
+ if (c !== ">") {
+ this.strictFail$S("Malformed comment");
+ this.comment += "--" + c;
+ this.state = 12;
+ } else {
+ this.state = 2;
+ }
+ continue;
+ case 15:
+ if (c === "]") {
+ this.state = 16;
+ } else {
+ this.cdata += c;
+ }
+ continue;
+ case 16:
+ if (c === "]") {
+ this.state = 17;
+ } else {
+ this.cdata += "]" + c;
+ this.state = 15;
+ }
+ continue;
+ case 17:
+ if (c === ">") {
+ if (this.cdata) {
+ this.closetext_if_exist$();
+ }
+ this.cdata = "";
+ this.state = 2;
+ } else {
+ if (c === "]") {
+ this.cdata += "]";
+ } else {
+ this.cdata += "]]" + c;
+ this.state = 15;
+ }
+ }
+ continue;
+ case 18:
+ if (c === "?") {
+ this.state = 20;
+ } else {
+ charclass$6 = _.whitespace;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$6, c)) {
+ this.state = 19;
+ } else {
+ this.procInstName += c;
+ }
+ }
+ continue;
+ case 19:
+ if (! this.procInstBody && _.is$HBS(_.whitespace, c)) {
+ continue;
+ } else {
+ if (c === "?") {
+ this.state = 20;
+ } else {
+ this.procInstBody += c;
+ }
+ }
+ continue;
+ case 20:
+ if (c === ">") {
+ this.closetext_if_exist$();
+ this.procInstName = this.procInstBody = "";
+ this.state = 2;
+ } else {
+ this.procInstBody += "?" + c;
+ this.state = 19;
+ }
+ continue;
+ case 21:
+ charclass$7 = _.nameBody;
+ if (charclass$7.test(c)) {
+ this.tagName += c;
+ } else {
+ this.newTag$();
+ if (c === ">") {
+ this.openTag$B(false);
+ } else {
+ if (c === "/") {
+ this.state = 22;
+ } else {
+ charclass$8 = _.whitespace;
+ if (! $__jsx_ObjectHasOwnProperty.call(charclass$8, c)) {
+ this.strictFail$S("Invalid character in tag name");
+ }
+ this.state = 23;
+ }
+ }
+ }
+ continue;
+ case 22:
+ if (c === ">") {
+ this.openTag$B(true);
+ this.closeTag$();
+ } else {
+ this.strictFail$S("Forward-slash in opening tag not followed by >");
+ this.state = 23;
+ }
+ continue;
+ case 23:
+ charclass$9 = _.whitespace;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$9, c)) {
+ continue;
+ } else {
+ if (c === ">") {
+ this.openTag$B(false);
+ } else {
+ if (c === "/") {
+ this.state = 22;
+ } else {
+ charclass$10 = _.nameStart;
+ if (charclass$10.test(c)) {
+ this.attribName = c;
+ this.attribValue = "";
+ this.state = 24;
+ } else {
+ this.strictFail$S("Invalid attribute name");
+ }
+ }
+ }
+ }
+ continue;
+ case 24:
+ if (c === "=") {
+ this.state = 26;
+ } else {
+ if (c === ">") {
+ this.strictFail$S("Attribute without value");
+ this.attribValue = this.attribName;
+ this.attrib$();
+ this.openTag$B(false);
+ } else {
+ charclass$11 = _.whitespace;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$11, c)) {
+ this.state = 25;
+ } else {
+ charclass$12 = _.nameBody;
+ if (charclass$12.test(c)) {
+ this.attribName += c;
+ } else {
+ this.strictFail$S("Invalid attribute name");
+ }
+ }
+ }
+ }
+ continue;
+ case 25:
+ if (c === "=") {
+ this.state = 26;
+ } else {
+ charclass$13 = _.whitespace;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$13, c)) {
+ continue;
+ } else {
+ this.strictFail$S("Attribute without value");
+ this.tag.attributes[this.attribName] = "";
+ this.attribValue = "";
+ this.closetext_if_exist$();
+ this.attribName = "";
+ if (c === ">") {
+ this.openTag$B(false);
+ } else {
+ charclass$14 = _.nameStart;
+ if (charclass$14.test(c)) {
+ this.attribName = c;
+ this.state = 24;
+ } else {
+ this.strictFail$S("Invalid attribute name");
+ this.state = 23;
+ }
+ }
+ }
+ }
+ continue;
+ case 26:
+ charclass$15 = _.whitespace;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$15, c)) {
+ continue;
+ } else {
+ charclass$16 = _.quote;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$16, c)) {
+ this.q = c;
+ this.state = 27;
+ } else {
+ this.strictFail$S("Unquoted attribute value");
+ this.state = 28;
+ this.attribValue = c;
+ }
+ }
+ continue;
+ case 27:
+ if (c !== this.q) {
+ if (c === "&") {
+ this.state = 29;
+ } else {
+ this.attribValue += c;
+ }
+ continue;
+ }
+ this.attrib$();
+ this.q = "";
+ this.state = 23;
+ continue;
+ case 28:
+ charclass$17 = _.attribEnd;
+ if (! $__jsx_ObjectHasOwnProperty.call(charclass$17, c)) {
+ if (c === "&") {
+ this.state = 30;
+ } else {
+ this.attribValue += c;
+ }
+ continue;
+ }
+ this.attrib$();
+ if (c === ">") {
+ this.openTag$B(false);
+ } else {
+ this.state = 23;
+ }
+ continue;
+ case 31:
+ if (! this.tagName) {
+ charclass$18 = _.whitespace;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$18, c)) {
+ continue;
+ } else {
+ charclass$19 = _.nameStart;
+ if (! charclass$19.test(c)) {
+ if (this.script) {
+ this.script += "</" + c;
+ this.state = 33;
+ } else {
+ this.strictFail$S("Invalid tagname in closing tag.");
+ }
+ } else {
+ this.tagName = c;
+ }
+ }
+ } else {
+ if (c === ">") {
+ this.closeTag$();
+ } else {
+ charclass$20 = _.nameBody;
+ if (charclass$20.test(c)) {
+ this.tagName += c;
+ } else {
+ if (this.script) {
+ this.script += "</" + this.tagName;
+ this.tagName = "";
+ this.state = 33;
+ } else {
+ charclass$21 = _.whitespace;
+ if (! $__jsx_ObjectHasOwnProperty.call(charclass$21, c)) {
+ this.strictFail$S("Invalid tagname in closing tag");
+ }
+ this.state = 32;
+ }
+ }
+ }
+ }
+ continue;
+ case 32:
+ charclass$22 = _.whitespace;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$22, c)) {
+ continue;
+ }
+ if (c === ">") {
+ this.closeTag$();
+ } else {
+ this.strictFail$S("Invalid characters in closing tag");
+ }
+ continue;
+ case 3:
+ if (c === ";") {
+ this.textNode += this.parseEntity$();
+ this.entity = "";
+ this.state = 2;
+ } else {
+ charclass$23 = _.entity;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$23, c)) {
+ this.entity += c;
+ } else {
+ this.strictFail$S("Invalid character entity");
+ this.textNode += "&" + this.entity + c;
+ this.entity = "";
+ this.state = 2;
+ }
+ }
+ continue;
+ case 29:
+ case 30:
+ if (this.state === 29) {
+ returnState = 27;
+ } else {
+ returnState = 28;
+ }
+ if (c === ";") {
+ this.attribValue += this.parseEntity$();
+ this.entity = "";
+ this.state = (returnState | 0);
+ } else {
+ charclass$24 = _.entity;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$24, c)) {
+ this.entity += c;
+ } else {
+ this.strictFail$S("Invalid character entity");
+ this.attribValue += "&" + this.entity + c;
+ this.entity = "";
+ this.state = (returnState | 0);
+ }
+ }
+ continue;
+ default:
+ throw new Error("Unknown state: " + (this.state + ""));
+ }
+ }
+ this.end$();
+ return this;
+};
+
+/**
+ */
+SAXParser.prototype.clearBuffers$ = function () {
+ this.comment = '';
+ this.sgmlDecl = '';
+ this.textNode = '';
+ this.tagName = '';
+ this.doctype = '';
+ this.procInstName = '';
+ this.procInstBody = '';
+ this.entity = '';
+ this.attribName = '';
+ this.attribValue = '';
+ this.cdata = '';
+ this.script = '';
+};
+
+/**
+ */
+SAXParser.prototype.closetext_if_exist$ = function () {
+ if (this.textNode !== '') {
+ this.closetext$();
+ }
+};
+
+/**
+ */
+SAXParser.prototype.closetext$ = function () {
+ /** @type {!string} */
+ var text;
+ /** @type {!string} */
+ var text$0;
+ if (this.preTags === 0) {
+ text$0 = this.textNode;
+ text$0 = text$0.replace(/[\n\t]/g, ' ');
+ text$0 = text$0.replace(/\s\s+/g, " ");
+ text = text$0;
+ if (text$0) {
+ this.handler.ontext$S(text);
+ }
+ } else {
+ if (this.textNode) {
+ this.handler.ontext$S(this.textNode);
+ }
+ }
+ this.textNode = "";
+};
+
+/**
+ * @param {!string} text
+ * @return {!string}
+ */
+SAXParser.prototype.textopts$S = function (text) {
+ text = text.replace(/[\n\t]/g, ' ');
+ text = text.replace(/\s\s+/g, " ");
+ return text;
+};
+
+/**
+ * @param {!string} er
+ * @return {SAXParser}
+ */
+SAXParser.prototype.emiterror$S = function (er) {
+ /** @type {Error} */
+ var error;
+ this.closetext$();
+ er += "\nLine: " + (this.line + "") + "\nColumn: " + (this.column + "") + "\nChar: " + this.c;
+ error = new Error(er);
+ this.error = error;
+ return this;
+};
+
+/**
+ */
+SAXParser.prototype.end$ = function () {
+ if (! this.closedRoot) {
+ this.strictFail$S("Unclosed root tag");
+ }
+ if (this.state !== 2) {
+ this.emiterror$S("Unexpected end");
+ }
+ this.closetext$();
+ this.c = "";
+ this.closed = true;
+};
+
+/**
+ * @param {!string} message
+ */
+SAXParser.prototype.strictFail$S = function (message) {
+ if (this.strict) {
+ this.emiterror$S(message);
+ }
+};
+
+/**
+ */
+SAXParser.prototype.newTag$ = function () {
+ if (! this.strict) {
+ this.tagName = this.tagName.toLowerCase();
+ }
+ this.tag = ({name: this.tagName, attributes: ({ }), isSelfClosing: false});
+ this.attribList.length = 0;
+};
+
+/**
+ */
+SAXParser.prototype.attrib$ = function () {
+ if (! this.strict) {
+ this.attribName = this.attribName.toLowerCase();
+ }
+ if ($__jsx_ObjectHasOwnProperty.call(this.tag.attributes, this.attribName)) {
+ this.attribName = this.attribValue = "";
+ return;
+ }
+ this.tag.attributes[this.attribName] = this.attribValue;
+ this.closetext_if_exist$();
+ this.attribName = this.attribValue = "";
+};
+
+/**
+ */
+SAXParser.prototype.openTag$ = function () {
+ this.openTag$B(false);
+};
+
+/**
+ * @param {!boolean} selfClosing
+ */
+SAXParser.prototype.openTag$B = function (selfClosing) {
+ /** @type {Tag} */
+ var tag$0;
+ /** @type {Tag} */
+ var tag$1;
+ (tag$0 = this.tag).isSelfClosing = selfClosing;
+ this.sawRoot = true;
+ this.tags.push(tag$0);
+ this.closetext_if_exist$();
+ this.handler.onopentag$SHS((tag$1 = this.tag).name, tag$1.attributes);
+ if (this.tag.name === 'pre') {
+ this.preTags++;
+ }
+ if (! selfClosing) {
+ if (! this.noscript && this.tagName.toLowerCase() === "script") {
+ this.state = 33;
+ } else {
+ this.state = 2;
+ }
+ this.tag = null;
+ this.tagName = "";
+ }
+ this.attribName = this.attribValue = "";
+ this.attribList.length = 0;
+};
+
+/**
+ */
+SAXParser.prototype.closeTag$ = function () {
+ /** @type {!number} */
+ var t;
+ /** @type {!string} */
+ var tagName;
+ /** @type {!string} */
+ var closeTo;
+ /** @type {Tag} */
+ var close;
+ /** @type {!number} */
+ var s;
+ /** @type {Tag} */
+ var tag$0;
+ if (! this.tagName) {
+ this.strictFail$S("Weird empty close tag.");
+ this.textNode += "</>";
+ this.state = 2;
+ return;
+ }
+ if (this.script) {
+ if (this.tagName !== "script") {
+ this.script += "</" + this.tagName + ">";
+ this.tagName = "";
+ this.state = 33;
+ return;
+ }
+ this.closetext_if_exist$();
+ this.script = "";
+ }
+ t = this.tags.length;
+ tagName = this.tagName;
+ if (! this.strict) {
+ tagName = tagName.toLowerCase();
+ }
+ closeTo = tagName;
+ while (t--) {
+ close = this.tags[t];
+ if (close.name !== closeTo) {
+ this.strictFail$S("Unexpected close tag");
+ } else {
+ break;
+ }
+ }
+ if (t < 0) {
+ this.strictFail$S("Unmatched closing tag: " + this.tagName);
+ this.textNode += "</" + this.tagName + ">";
+ this.state = 2;
+ return;
+ }
+ this.tagName = tagName;
+ s = this.tags.length;
+ while (s-- > t) {
+ tag$0 = this.tag = this.tags.pop();
+ this.tagName = tag$0.name;
+ this.closetext_if_exist$();
+ this.handler.onclosetag$S(this.tagName);
+ if (this.tagName === 'pre') {
+ this.preTags--;
+ }
+ }
+ if (t === 0) {
+ this.closedRoot = true;
+ }
+ this.tagName = this.attribValue = this.attribName = "";
+ this.attribList.length = 0;
+ this.state = 2;
+};
+
+/**
+ * @return {!string}
+ */
+SAXParser.prototype.parseEntity$ = function () {
+ /** @type {!string} */
+ var entity;
+ /** @type {!string} */
+ var entityLC;
+ /** @type {!number} */
+ var num;
+ /** @type {!string} */
+ var numStr;
+ entity = this.entity;
+ entityLC = entity.toLowerCase();
+ num = 0;
+ numStr = "";
+ if (this.ENTITIES[entity]) {
+ return this.ENTITIES[entity];
+ }
+ if (this.ENTITIES[entityLC]) {
+ return this.ENTITIES[entityLC];
+ }
+ entity = entityLC;
+ if (entityLC.charAt(0) === "#") {
+ if (entity.charAt(1) === "x") {
+ entity = entity.slice(2);
+ num = $__jsx_parseInt(entity, 16);
+ numStr = num.toString(16);
+ } else {
+ entity = entity.slice(1);
+ num = $__jsx_parseInt(entity, 10);
+ numStr = num.toString(10);
+ }
+ }
+ entity = entity.replace(/^0+/, "");
+ if (numStr.toLowerCase() !== entity) {
+ this.strictFail$S("Invalid character entity");
+ return "&" + this.entity + ";";
+ }
+ return String.fromCharCode(num);
+};
+
+/**
+ * class Char extends Object
+ * @constructor
+ */
+function Char() {
+}
+
+/**
+ * @constructor
+ */
+function Char$() {
+ this.CDATA = "[CDATA[";
+ this.DOCTYPE = "DOCTYPE";
+ this.XML_NAMESPACE = "http://www.w3.org/XML/1998/namespace";
+ this.whitespace = this._charClass$S("\r\n\t ");
+ this.number = this._charClass$S("0124356789");
+ this.letter = this._charClass$S("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ");
+ this.quote = this._charClass$S("'\"");
+ this.entity = this._charClass$S("0124356789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ#");
+ this.attribEnd = this._charClass$S("\r\n\t >");
+ this.nameStart = /[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/;
+ this.nameBody = /[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040\.\d-]/;
+};
+
+Char$.prototype = new Char;
+
+/**
+ * @param {!string} str
+ * @return {Object.<string, undefined|!boolean>}
+ */
+Char.prototype._charClass$S = function (str) {
+ /** @type {Object.<string, undefined|!boolean>} */
+ var result;
+ /** @type {!number} */
+ var i;
+ result = ({ });
+ for (i = 0; i < str.length; i++) {
+ result[str.slice(i, i + 1)] = true;
+ }
+ return result;
+};
+
+/**
+ * @param {RegExp} charclass
+ * @param {!string} c
+ * @return {!boolean}
+ */
+Char.prototype.is$LRegExp$S = function (charclass, c) {
+ return charclass.test(c);
+};
+
+/**
+ * @param {Object.<string, undefined|!boolean>} charclass
+ * @param {!string} c
+ * @return {!boolean}
+ */
+Char.prototype.is$HBS = function (charclass, c) {
+ return $__jsx_ObjectHasOwnProperty.call(charclass, c);
+};
+
+/**
+ * @param {RegExp} charclass
+ * @param {!string} c
+ * @return {!boolean}
+ */
+Char.prototype.not$LRegExp$S = function (charclass, c) {
+ return ! charclass.test(c);
+};
+
+/**
+ * @param {Object.<string, undefined|!boolean>} charclass
+ * @param {!string} c
+ * @return {!boolean}
+ */
+Char.prototype.not$HBS = function (charclass, c) {
+ return ! $__jsx_ObjectHasOwnProperty.call(charclass, c);
+};
+
+/**
+ * class _Entities extends Object
+ * @constructor
+ */
+function _Entities() {
+}
+
+/**
+ * @constructor
+ */
+function _Entities$() {
+};
+
+_Entities$.prototype = new _Entities;
+
+/**
+ * @return {Object.<string, undefined|!string>}
+ */
+_Entities.entity_list$ = function () {
+ /** @type {Object.<string, undefined|!string>} */
+ var result;
+ /** @type {!string} */
+ var key;
+ /** @type {*} */
+ var value;
+ result = ({ });
+ for (key in _Entities._entities) {
+ value = _Entities._entities[key];
+ if (typeof value === 'string') {
+ result[key] = value + "";
+ } else {
+ if (typeof value === 'number') {
+ result[key] = String.fromCharCode(value | 0);
+ }
+ }
+ }
+ return result;
+};
+
+var _Entities$entity_list$ = _Entities.entity_list$;
+
+/**
+ * class BitVector extends Object
+ * @constructor
+ */
+function BitVector() {
+}
+
+/**
+ * @constructor
+ */
+function BitVector$() {
+ /** @type {Array.<undefined|!number>} */
+ var _v$0;
+ /** @type {Array.<undefined|!number>} */
+ var _r$0;
+ _r$0 = this._r = [ ];
+ _v$0 = this._v = [ ];
+ _v$0.length = 0;
+ _r$0.length = 0;
+ this._size = 0;
+ this._size1 = 0;
+};
+
+BitVector$.prototype = new BitVector;
+
+/**
+ */
+BitVector.prototype.build$ = function () {
+ /** @type {!number} */
+ var i;
+ this._size1 = 0;
+ for (i = 0; i < this._v.length; i++) {
+ if (i % 8 === 0) {
+ this._r.push(true ? this._size1 : this._size - this._size1);
+ }
+ this._size1 += this._rank32$IIB(this._v[i], 32, true);
+ }
+};
+
+/**
+ */
+BitVector.prototype.clear$ = function () {
+ this._v.length = 0;
+ this._r.length = 0;
+ this._size = 0;
+ this._size1 = 0;
+};
+
+/**
+ * @return {!number}
+ */
+BitVector.prototype.size$ = function () {
+ return this._size;
+};
+
+/**
+ * @param {!boolean} b
+ * @return {!number}
+ */
+BitVector.prototype.size$B = function (b) {
+ return (b ? this._size1 : this._size - this._size1);
+};
+
+/**
+ * @param {!number} value
+ */
+BitVector.prototype.set$I = function (value) {
+ this.set$IB(value, true);
+};
+
+/**
+ * @param {!number} value
+ * @param {!boolean} flag
+ */
+BitVector.prototype.set$IB = function (value, flag) {
+ /** @type {!number} */
+ var q;
+ /** @type {!number} */
+ var r;
+ /** @type {!number} */
+ var m;
+ if (value >= this._size) {
+ this._size = (value + 1 | 0);
+ }
+ q = (value / 32 | 0);
+ r = (value % 32 | 0);
+ while (q >= this._v.length) {
+ this._v.push(0);
+ }
+ m = 0x1 << r;
+ if (flag) {
+ this._v[q] |= m;
+ } else {
+ this._v[q] &= ~ m;
+ }
+};
+
+/**
+ * @param {!number} value
+ * @return {!boolean}
+ */
+BitVector.prototype.get$I = function (value) {
+ /** @type {!number} */
+ var q;
+ /** @type {!number} */
+ var r;
+ /** @type {!number} */
+ var m;
+ if (value >= this._size) {
+ throw new Error("BitVector.get() : range error");
+ }
+ q = (value / 32 | 0);
+ r = (value % 32 | 0);
+ m = 0x1 << r;
+ return !! (this._v[q] & m);
+};
+
+/**
+ * @param {!number} i
+ * @return {!number}
+ */
+BitVector.prototype.rank$I = function (i) {
+ return this.rank$IB(i, true);
+};
+
+/**
+ * @param {!number} i
+ * @param {!boolean} b
+ * @return {!number}
+ */
+BitVector.prototype.rank$IB = function (i, b) {
+ /** @type {!number} */
+ var q_large;
+ /** @type {!number} */
+ var q_small;
+ /** @type {!number} */
+ var r;
+ /** @type {!number} */
+ var rank;
+ /** @type {!number} */
+ var begin;
+ /** @type {!number} */
+ var j;
+ if (i > this._size) {
+ throw new Error("BitVector.rank() : range error");
+ }
+ if (i === 0) {
+ return 0;
+ }
+ i--;
+ q_large = (Math.floor(i / 256) | 0);
+ q_small = (Math.floor(i / 32) | 0);
+ r = (Math.floor(i % 32) | 0);
+ rank = (this._r[q_large] | 0);
+ if (! b) {
+ rank = q_large * 256 - rank;
+ }
+ begin = q_large * 8;
+ for (j = begin; j < q_small; j++) {
+ rank += this._rank32$IIB(this._v[j], 32, b);
+ }
+ rank += this._rank32$IIB(this._v[q_small], r + 1, b);
+ return rank;
+};
+
+/**
+ * @param {!number} i
+ * @return {!number}
+ */
+BitVector.prototype.select$I = function (i) {
+ return this.select$IB(i, true);
+};
+
+/**
+ * @param {!number} i
+ * @param {!boolean} b
+ * @return {!number}
+ */
+BitVector.prototype.select$IB = function (i, b) {
+ /** @type {!number} */
+ var left;
+ /** @type {!number} */
+ var right;
+ /** @type {!number} */
+ var pivot;
+ /** @type {undefined|!number} */
+ var rank;
+ /** @type {!number} */
+ var j;
+ if (i >= (b ? this._size1 : this._size - this._size1)) {
+ throw new Error("BitVector.select() : range error");
+ }
+ left = 0;
+ right = this._r.length;
+ while (left < right) {
+ pivot = Math.floor((left + right) / 2);
+ rank = this._r[pivot];
+ if (! b) {
+ rank = pivot * 256 - rank;
+ }
+ if (i < rank) {
+ right = pivot;
+ } else {
+ left = pivot + 1;
+ }
+ }
+ right--;
+ if (b) {
+ i -= (this._r[right] | 0);
+ } else {
+ i -= (right * 256 - this._r[right] | 0);
+ }
+ j = right * 8;
+ while (1) {
+ rank = this._rank32$IIB(this._v[j], 32, b);
+ if (i < rank) {
+ break;
+ }
+ j++;
+ i -= (rank | 0);
+ }
+ return (j * 32 + this._select32$IIB(this._v[j], i, b) | 0);
+};
+
+/**
+ * @param {!number} x
+ * @param {!number} i
+ * @param {!boolean} b
+ * @return {!number}
+ */
+BitVector.prototype._rank32$IIB = function (x, i, b) {
+ if (! b) {
+ x = ~ x;
+ }
+ x <<= 32 - i;
+ x = ((x & 0xaaaaaaaa) >>> 1) + (x & 0x55555555);
+ x = ((x & 0xcccccccc) >>> 2) + (x & 0x33333333);
+ x = ((x & 0xf0f0f0f0) >>> 4) + (x & 0x0f0f0f0f);
+ x = ((x & 0xff00ff00) >>> 8) + (x & 0x00ff00ff);
+ x = ((x & 0xffff0000) >>> 16) + (x & 0x0000ffff);
+ return x;
+};
+
+/**
+ * @param {!number} x
+ * @param {!number} i
+ * @param {!boolean} b
+ * @return {!number}
+ */
+BitVector.prototype._select32$IIB = function (x, i, b) {
+ /** @type {!number} */
+ var x1;
+ /** @type {!number} */
+ var x2;
+ /** @type {!number} */
+ var x3;
+ /** @type {!number} */
+ var x4;
+ /** @type {!number} */
+ var x5;
+ /** @type {!number} */
+ var pos;
+ /** @type {!number} */
+ var v5;
+ /** @type {!number} */
+ var v4;
+ /** @type {!number} */
+ var v3;
+ /** @type {!number} */
+ var v2;
+ /** @type {!number} */
+ var v1;
+ /** @type {!number} */
+ var v0;
+ if (! b) {
+ x = ~ x;
+ }
+ x1 = ((x & 0xaaaaaaaa) >>> 1) + (x & 0x55555555);
+ x2 = ((x1 & 0xcccccccc) >>> 2) + (x1 & 0x33333333);
+ x3 = ((x2 & 0xf0f0f0f0) >>> 4) + (x2 & 0x0f0f0f0f);
+ x4 = ((x3 & 0xff00ff00) >>> 8) + (x3 & 0x00ff00ff);
+ x5 = ((x4 & 0xffff0000) >>> 16) + (x4 & 0x0000ffff);
+ i++;
+ pos = 0;
+ v5 = x5 & 0xffffffff;
+ if (i > v5) {
+ i -= (v5 | 0);
+ pos += 32;
+ }
+ v4 = x4 >>> pos & 0x0000ffff;
+ if (i > v4) {
+ i -= (v4 | 0);
+ pos += 16;
+ }
+ v3 = x3 >>> pos & 0x000000ff;
+ if (i > v3) {
+ i -= (v3 | 0);
+ pos += 8;
+ }
+ v2 = x2 >>> pos & 0x0000000f;
+ if (i > v2) {
+ i -= (v2 | 0);
+ pos += 4;
+ }
+ v1 = x1 >>> pos & 0x00000003;
+ if (i > v1) {
+ i -= (v1 | 0);
+ pos += 2;
+ }
+ v0 = x >>> pos & 0x00000001;
+ if (i > v0) {
+ i -= (v0 | 0);
+ pos += 1;
+ }
+ return (pos | 0);
+};
+
+/**
+ * @return {!string}
+ */
+BitVector.prototype.dump$ = function () {
+ /** @type {Array.<undefined|!string>} */
+ var contents;
+ contents = [ ];
+ contents.push(Binary$dump32bitNumber$N(this._size));
+ contents.push(Binary$dump32bitNumberList$AN(this._v));
+ return contents.join('');
+};
+
+/**
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+BitVector.prototype.dump$LCompressionReport$ = function (report) {
+ /** @type {Array.<undefined|!string>} */
+ var contents;
+ contents = [ ];
+ contents.push(Binary$dump32bitNumber$N(this._size));
+ CompressionReport$add$LCompressionReport$II(report, 2, 2);
+ contents.push(Binary$dump32bitNumberList$ANLCompressionReport$(this._v, report));
+ return contents.join('');
+};
+
+/**
+ * @param {!string} data
+ * @return {!number}
+ */
+BitVector.prototype.load$S = function (data) {
+ return this.load$SI(data, 0);
+};
+
+/**
+ * @param {!string} data
+ * @param {!number} offset
+ * @return {!number}
+ */
+BitVector.prototype.load$SI = function (data, offset) {
+ /** @type {LoadedNumberListResult} */
+ var result;
+ /** @type {!number} */
+ var result$0;
+ this._v.length = 0;
+ this._r.length = 0;
+ this._size = 0;
+ this._size1 = 0;
+ result$0 = data.charCodeAt(offset) * 65536 + data.charCodeAt(offset + 1);
+ this._size = (result$0 | 0);
+ result = Binary$load32bitNumberList$SI(data, offset + 2);
+ this._v = result.result;
+ this.build$();
+ return result.offset;
+};
+
+/**
+ * class WaveletMatrix extends Object
+ * @constructor
+ */
+function WaveletMatrix() {
+}
+
+/**
+ * @constructor
+ */
+function WaveletMatrix$() {
+ /** @type {Array.<undefined|BitVector>} */
+ var _bv$0;
+ /** @type {Array.<undefined|!number>} */
+ var _seps$0;
+ this._range = ({ });
+ _bv$0 = this._bv = [ ];
+ _seps$0 = this._seps = [ ];
+ this._bitsize = 16;
+ _bv$0.length = 0;
+ _seps$0.length = 0;
+ this._size = 0;
+};
+
+WaveletMatrix$.prototype = new WaveletMatrix;
+
+/**
+ * @return {!number}
+ */
+WaveletMatrix.prototype.bitsize$ = function () {
+ return this._bitsize;
+};
+
+/**
+ * @param {!number} charCode
+ */
+WaveletMatrix.prototype.setMaxCharCode$I = function (charCode) {
+ this._bitsize = (Math.ceil(Math.log(charCode) / 0.6931471805599453) | 0);
+};
+
+/**
+ */
+WaveletMatrix.prototype.clear$ = function () {
+ this._bv.length = 0;
+ this._seps.length = 0;
+ this._size = 0;
+};
+
+/**
+ * @param {!string} v
+ */
+WaveletMatrix.prototype.build$S = function (v) {
+ /** @type {!number} */
+ var size;
+ /** @type {!number} */
+ var bitsize;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var depth;
+ /** @type {Object.<string, undefined|!number>} */
+ var range_tmp;
+ /** @type {!number} */
+ var code;
+ /** @type {!boolean} */
+ var bit;
+ /** @type {!number} */
+ var key;
+ /** @type {Object.<string, undefined|!number>} */
+ var range_rev;
+ /** @type {!string} */
+ var range_key;
+ /** @type {!number} */
+ var value;
+ /** @type {!number} */
+ var pos0;
+ /** @type {undefined|!number} */
+ var pos1;
+ /** @type {!string} */
+ var range_rev_key;
+ /** @type {!number} */
+ var begin;
+ /** @type {undefined|!number} */
+ var end;
+ /** @type {!number} */
+ var num0;
+ /** @type {!number} */
+ var num1;
+ this._bv.length = 0;
+ this._seps.length = 0;
+ this._size = 0;
+ size = v.length;
+ bitsize = this._bitsize;
+ for (i = 0; i < bitsize; i++) {
+ this._bv.push(new BitVector$());
+ this._seps.push(0);
+ }
+ this._size = (size | 0);
+ for (i = 0; i < size; i++) {
+ this._bv[0].set$IB(i, this._uint2bit$II(v.charCodeAt(i), 0));
+ }
+ this._bv[0].build$();
+ this._seps[0] = this._bv[0].size$B(false);
+ this._range["0"] = 0;
+ this._range["1"] = this._seps[0];
+ depth = 1;
+ while (depth < bitsize) {
+ range_tmp = WaveletMatrix$_shallow_copy$HI(this._range);
+ for (i = 0; i < size; i++) {
+ code = v.charCodeAt(i);
+ bit = this._uint2bit$II(code, depth);
+ key = code >>> bitsize - depth;
+ this._bv[depth].set$IB(range_tmp[key + ""], bit);
+ range_tmp[key + ""]++;
+ }
+ this._bv[depth].build$();
+ this._seps[depth] = this._bv[depth].size$B(false);
+ range_rev = ({ });
+ for (range_key in this._range) {
+ value = this._range[range_key];
+ if (value != range_tmp[range_key]) {
+ range_rev[value + ""] = range_key | 0;
+ }
+ }
+ this._range = ({ });
+ pos0 = 0;
+ pos1 = this._seps[depth];
+ for (range_rev_key in range_rev) {
+ begin = range_rev_key | 0;
+ value = range_rev[range_rev_key];
+ end = range_tmp[value + ""];
+ num0 = this._bv[depth].rank$IB(end, false) - this._bv[depth].rank$IB(begin, false);
+ num1 = end - begin - num0;
+ if (num0 > 0) {
+ this._range[(value << 1) + ""] = (pos0 | 0);
+ pos0 += num0;
+ }
+ if (num1 > 0) {
+ this._range[(value << 1) + 1 + ""] = pos1;
+ pos1 += (num1 | 0);
+ }
+ }
+ depth++;
+ }
+};
+
+/**
+ * @return {!number}
+ */
+WaveletMatrix.prototype.size$ = function () {
+ return this._size;
+};
+
+/**
+ * @param {!number} c
+ * @return {!number}
+ */
+WaveletMatrix.prototype.size$I = function (c) {
+ return this.rank$II(this._size, c);
+};
+
+/**
+ * @param {!number} i
+ * @return {!number}
+ */
+WaveletMatrix.prototype.get$I = function (i) {
+ /** @type {!number} */
+ var value;
+ /** @type {!number} */
+ var depth;
+ /** @type {!boolean} */
+ var bit;
+ if (i >= this._size) {
+ throw new Error("WaveletMatrix.get() : range error");
+ }
+ value = 0;
+ depth = 0;
+ while (depth < this._bitsize) {
+ bit = this._bv[depth].get$I(i);
+ i = this._bv[depth].rank$IB(i, bit);
+ value <<= 1;
+ if (bit) {
+ i += this._seps[depth];
+ value += 1;
+ }
+ depth++;
+ }
+ return (value | 0);
+};
+
+/**
+ * @param {!number} i
+ * @param {!number} c
+ * @return {!number}
+ */
+WaveletMatrix.prototype.rank$II = function (i, c) {
+ /** @type {undefined|!number} */
+ var begin;
+ /** @type {!number} */
+ var end;
+ /** @type {!number} */
+ var depth;
+ /** @type {!boolean} */
+ var bit;
+ if (i > this._size) {
+ throw new Error("WaveletMatrix.rank(): range error");
+ }
+ if (i === 0) {
+ return 0;
+ }
+ begin = this._range[c + ""];
+ if (begin == null) {
+ return 0;
+ }
+ end = i;
+ depth = 0;
+ while (depth < this._bitsize) {
+ bit = this._uint2bit$II(c, depth);
+ end = this._bv[depth].rank$IB(end, bit);
+ if (bit) {
+ end += this._seps[depth];
+ }
+ depth++;
+ }
+ return (end - begin | 0);
+};
+
+/**
+ * @param {!number} i
+ * @param {!number} c
+ * @return {!number}
+ */
+WaveletMatrix.prototype.rank_less_than$II = function (i, c) {
+ /** @type {!number} */
+ var begin;
+ /** @type {!number} */
+ var end;
+ /** @type {!number} */
+ var depth;
+ /** @type {!number} */
+ var rlt;
+ /** @type {!number} */
+ var rank0_begin;
+ /** @type {!number} */
+ var rank0_end;
+ /** @type {Array.<undefined|!number>} */
+ var _seps$0;
+ if (i > this._size) {
+ throw new Error("WaveletMatrix.rank_less_than(): range error");
+ }
+ if (i === 0) {
+ return 0;
+ }
+ begin = 0;
+ end = i;
+ depth = 0;
+ rlt = 0;
+ while (depth < this._bitsize) {
+ rank0_begin = this._bv[depth].rank$IB(begin, false);
+ rank0_end = this._bv[depth].rank$IB(end, false);
+ if (this._uint2bit$II(c, depth)) {
+ rlt += rank0_end - rank0_begin;
+ begin += (_seps$0 = this._seps)[depth] - rank0_begin;
+ end += _seps$0[depth] - rank0_end;
+ } else {
+ begin = rank0_begin;
+ end = rank0_end;
+ }
+ depth++;
+ }
+ return (rlt | 0);
+};
+
+/**
+ * @return {!string}
+ */
+WaveletMatrix.prototype.dump$ = function () {
+ /** @type {Array.<undefined|!string>} */
+ var contents;
+ /** @type {!number} */
+ var i;
+ /** @type {Array.<undefined|!string>} */
+ var range_contents;
+ /** @type {!number} */
+ var counter;
+ /** @type {!string} */
+ var key;
+ contents = [ Binary$dump16bitNumber$I(this._bitsize), Binary$dump32bitNumber$N(this._size) ];
+ for (i = 0; i < this._bitsize; i++) {
+ contents.push(this._bv[i].dump$());
+ }
+ for (i = 0; i < this._bitsize; i++) {
+ contents.push(Binary$dump32bitNumber$N(this._seps[i]));
+ }
+ range_contents = [ ];
+ counter = 0;
+ for (key in this._range) {
+ range_contents.push(Binary$dump32bitNumber$N(key | 0));
+ range_contents.push(Binary$dump32bitNumber$N(this._range[key]));
+ counter++;
+ }
+ contents.push(Binary$dump32bitNumber$N(counter));
+ return contents.join('') + range_contents.join('');
+};
+
+/**
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+WaveletMatrix.prototype.dump$LCompressionReport$ = function (report) {
+ /** @type {Array.<undefined|!string>} */
+ var contents;
+ /** @type {!number} */
+ var i;
+ /** @type {Array.<undefined|!string>} */
+ var range_contents;
+ /** @type {!number} */
+ var counter;
+ /** @type {!string} */
+ var key;
+ contents = [ Binary$dump16bitNumber$I(this._bitsize), Binary$dump32bitNumber$N(this._size) ];
+ CompressionReport$add$LCompressionReport$II(report, 3, 3);
+ for (i = 0; i < this._bitsize; i++) {
+ contents.push(this._bv[i].dump$LCompressionReport$(report));
+ }
+ for (i = 0; i < this._bitsize; i++) {
+ contents.push(Binary$dump32bitNumber$N(this._seps[i]));
+ CompressionReport$add$LCompressionReport$II(report, 2, 2);
+ }
+ range_contents = [ ];
+ counter = 0;
+ for (key in this._range) {
+ range_contents.push(Binary$dump32bitNumber$N(key | 0));
+ range_contents.push(Binary$dump32bitNumber$N(this._range[key]));
+ CompressionReport$add$LCompressionReport$II(report, 4, 4);
+ counter++;
+ }
+ CompressionReport$add$LCompressionReport$II(report, 2, 2);
+ contents.push(Binary$dump32bitNumber$N(counter));
+ return contents.join('') + range_contents.join('');
+};
+
+/**
+ * @param {!string} data
+ * @return {!number}
+ */
+WaveletMatrix.prototype.load$S = function (data) {
+ return this.load$SI(data, 0);
+};
+
+/**
+ * @param {!string} data
+ * @param {!number} offset
+ * @return {!number}
+ */
+WaveletMatrix.prototype.load$SI = function (data, offset) {
+ /** @type {!number} */
+ var i;
+ /** @type {BitVector} */
+ var bit_vector;
+ /** @type {!number} */
+ var range_size;
+ /** @type {!number} */
+ var value;
+ /** @type {!number} */
+ var offset$0;
+ /** @type {!number} */
+ var result$0;
+ /** @type {!number} */
+ var result$1;
+ /** @type {!number} */
+ var result$2;
+ this._bv.length = 0;
+ this._seps.length = 0;
+ this._size = 0;
+ offset$0 = offset++;
+ this._bitsize = (data.charCodeAt(offset$0) | 0);
+ result$0 = data.charCodeAt(offset) * 65536 + data.charCodeAt(offset + 1);
+ this._size = (result$0 | 0);
+ offset += 2;
+ for (i = 0; i < this._bitsize; i++) {
+ bit_vector = new BitVector$();
+ offset = bit_vector.load$SI(data, offset);
+ this._bv.push(bit_vector);
+ }
+ for (i = 0; i < this._bitsize; (i++, offset += 2)) {
+ this._seps.push(Binary$load32bitNumber$SI(data, offset));
+ }
+ result$1 = data.charCodeAt(offset) * 65536 + data.charCodeAt(offset + 1);
+ range_size = result$1;
+ offset += 2;
+ for (i = 0; i < range_size; (i++, offset += 4)) {
+ result$2 = data.charCodeAt(offset) * 65536 + data.charCodeAt(offset + 1);
+ value = Binary$load32bitNumber$SI(data, offset + 2);
+ this._range[result$2 + ""] = (value | 0);
+ }
+ return offset;
+};
+
+/**
+ * @param {Object.<string, undefined|!number>} input
+ * @return {Object.<string, undefined|!number>}
+ */
+WaveletMatrix._shallow_copy$HI = function (input) {
+ /** @type {Object.<string, undefined|!number>} */
+ var result;
+ /** @type {!string} */
+ var key;
+ result = ({ });
+ for (key in input) {
+ result[key] = input[key];
+ }
+ return result;
+};
+
+var WaveletMatrix$_shallow_copy$HI = WaveletMatrix._shallow_copy$HI;
+
+/**
+ * @param {!number} c
+ * @param {!number} i
+ * @return {!boolean}
+ */
+WaveletMatrix.prototype._uint2bit$II = function (c, i) {
+ return (c >>> this._bitsize - 1 - i & 0x1) === 0x1;
+};
+
+/**
+ * class BurrowsWheelerTransform extends Object
+ * @constructor
+ */
+function BurrowsWheelerTransform() {
+}
+
+/**
+ * @constructor
+ */
+function BurrowsWheelerTransform$() {
+ this._str = "";
+ this._size = 0;
+ this._head = 0;
+ this._suffixarray = [ ];
+};
+
+BurrowsWheelerTransform$.prototype = new BurrowsWheelerTransform;
+
+/**
+ * @param {BurrowsWheelerTransform} $this
+ * @return {!number}
+ */
+BurrowsWheelerTransform.size$LBurrowsWheelerTransform$ = function ($this) {
+ return $this._size;
+};
+
+var BurrowsWheelerTransform$size$LBurrowsWheelerTransform$ = BurrowsWheelerTransform.size$LBurrowsWheelerTransform$;
+
+/**
+ * @param {BurrowsWheelerTransform} $this
+ * @return {!number}
+ */
+BurrowsWheelerTransform.head$LBurrowsWheelerTransform$ = function ($this) {
+ return $this._head;
+};
+
+var BurrowsWheelerTransform$head$LBurrowsWheelerTransform$ = BurrowsWheelerTransform.head$LBurrowsWheelerTransform$;
+
+/**
+ * @param {BurrowsWheelerTransform} $this
+ */
+BurrowsWheelerTransform.clear$LBurrowsWheelerTransform$ = function ($this) {
+ $this._str = "";
+ $this._size = 0;
+ $this._head = 0;
+ $this._suffixarray.length = 0;
+};
+
+var BurrowsWheelerTransform$clear$LBurrowsWheelerTransform$ = BurrowsWheelerTransform.clear$LBurrowsWheelerTransform$;
+
+/**
+ * @param {BurrowsWheelerTransform} $this
+ * @param {!string} str
+ */
+BurrowsWheelerTransform.build$LBurrowsWheelerTransform$S = function ($this, str) {
+ /** @type {!string} */
+ var _str$0;
+ /** @type {Array.<undefined|!number>} */
+ var _suffixarray$0;
+ _str$0 = $this._str = str;
+ $this._size = _str$0.length;
+ _suffixarray$0 = $this._suffixarray = SAIS$make$S(str);
+ $this._head = (_suffixarray$0.indexOf(0) | 0);
+};
+
+var BurrowsWheelerTransform$build$LBurrowsWheelerTransform$S = BurrowsWheelerTransform.build$LBurrowsWheelerTransform$S;
+
+/**
+ * @param {BurrowsWheelerTransform} $this
+ * @param {!number} i
+ * @return {!string}
+ */
+BurrowsWheelerTransform.get$LBurrowsWheelerTransform$I = function ($this, i) {
+ /** @type {!number} */
+ var size;
+ /** @type {!number} */
+ var index;
+ size = $this._size;
+ if (i >= size) {
+ throw new Error("BurrowsWheelerTransform.get() : range error");
+ }
+ index = ($this._suffixarray[i] + size - 1) % size;
+ return $this._str.charAt(index);
+};
+
+var BurrowsWheelerTransform$get$LBurrowsWheelerTransform$I = BurrowsWheelerTransform.get$LBurrowsWheelerTransform$I;
+
+/**
+ * @param {BurrowsWheelerTransform} $this
+ * @return {!string}
+ */
+BurrowsWheelerTransform.get$LBurrowsWheelerTransform$ = function ($this) {
+ /** @type {Array.<undefined|!string>} */
+ var str;
+ /** @type {!number} */
+ var size;
+ /** @type {!number} */
+ var i;
+ str = [ ];
+ size = $this._size;
+ for (i = 0; i < size; i++) {
+ str.push(BurrowsWheelerTransform$get$LBurrowsWheelerTransform$I($this, i));
+ }
+ return str.join("");
+};
+
+var BurrowsWheelerTransform$get$LBurrowsWheelerTransform$ = BurrowsWheelerTransform.get$LBurrowsWheelerTransform$;
+
+/**
+ * @param {BurrowsWheelerTransform} $this
+ * @param {!string} replace
+ * @return {!string}
+ */
+BurrowsWheelerTransform.get$LBurrowsWheelerTransform$S = function ($this, replace) {
+ /** @type {!string} */
+ var result;
+ result = BurrowsWheelerTransform$get$LBurrowsWheelerTransform$($this);
+ return result.replace(BurrowsWheelerTransform.END_MARKER, replace);
+};
+
+var BurrowsWheelerTransform$get$LBurrowsWheelerTransform$S = BurrowsWheelerTransform.get$LBurrowsWheelerTransform$S;
+
+/**
+ * class OArray extends Object
+ * @constructor
+ */
+function OArray() {
+}
+
+/**
+ * @constructor
+ * @param {Array.<undefined|!number>} array
+ */
+function OArray$AI(array) {
+ this.array = array;
+ this.offset = 0;
+};
+
+OArray$AI.prototype = new OArray;
+
+/**
+ * @constructor
+ * @param {Array.<undefined|!number>} array
+ * @param {!number} offset
+ */
+function OArray$AII(array, offset) {
+ this.array = array;
+ this.offset = offset;
+};
+
+OArray$AII.prototype = new OArray;
+
+/**
+ * @param {OArray} $this
+ * @param {!number} index
+ * @return {!number}
+ */
+OArray.get$LOArray$I = function ($this, index) {
+ return $this.array[index + $this.offset];
+};
+
+var OArray$get$LOArray$I = OArray.get$LOArray$I;
+
+/**
+ * @param {OArray} $this
+ * @param {!number} index
+ * @param {!number} value
+ */
+OArray.set$LOArray$II = function ($this, index, value) {
+ $this.array[index + $this.offset] = value;
+};
+
+var OArray$set$LOArray$II = OArray.set$LOArray$II;
+
+/**
+ * @param {OArray} $this
+ * @param {!number} index
+ * @return {!boolean}
+ */
+OArray.isS$LOArray$I = function ($this, index) {
+ /** @type {Array.<undefined|!number>} */
+ var array$0;
+ /** @type {!number} */
+ var offset$0;
+ return (array$0 = $this.array)[index + (offset$0 = $this.offset)] < array$0[index + offset$0 + 1];
+};
+
+var OArray$isS$LOArray$I = OArray.isS$LOArray$I;
+
+/**
+ * @param {OArray} $this
+ * @param {!number} index1
+ * @param {!number} index2
+ * @return {!boolean}
+ */
+OArray.compare$LOArray$II = function ($this, index1, index2) {
+ /** @type {Array.<undefined|!number>} */
+ var array$0;
+ /** @type {!number} */
+ var offset$0;
+ return (array$0 = $this.array)[index1 + (offset$0 = $this.offset)] == array$0[index2 + offset$0];
+};
+
+var OArray$compare$LOArray$II = OArray.compare$LOArray$II;
+
+/**
+ * class SAIS extends Object
+ * @constructor
+ */
+function SAIS() {
+}
+
+/**
+ * @constructor
+ */
+function SAIS$() {
+};
+
+SAIS$.prototype = new SAIS;
+
+/**
+ * @param {BitVector} t
+ * @param {!number} i
+ * @return {!boolean}
+ */
+SAIS._isLMS$LBitVector$I = function (t, i) {
+ return i > 0 && t.get$I(i) && ! t.get$I(i - 1);
+};
+
+var SAIS$_isLMS$LBitVector$I = SAIS._isLMS$LBitVector$I;
+
+/**
+ * @param {OArray} s
+ * @param {Array.<undefined|!number>} bkt
+ * @param {!number} n
+ * @param {!number} K
+ * @param {!boolean} end
+ */
+SAIS._getBuckets$LOArray$AIIIB = function (s, bkt, n, K, end) {
+ /** @type {!number} */
+ var sum;
+ /** @type {!number} */
+ var i;
+ sum = 0;
+ for (i = 0; i <= K; i++) {
+ bkt[i] = 0;
+ }
+ for (i = 0; i < n; i++) {
+ bkt[OArray$get$LOArray$I(s, i)]++;
+ }
+ for (i = 0; i <= K; i++) {
+ sum += bkt[i];
+ bkt[i] = ((end ? sum : sum - bkt[i]) | 0);
+ }
+};
+
+var SAIS$_getBuckets$LOArray$AIIIB = SAIS._getBuckets$LOArray$AIIIB;
+
+/**
+ * @param {BitVector} t
+ * @param {Array.<undefined|!number>} SA
+ * @param {OArray} s
+ * @param {Array.<undefined|!number>} bkt
+ * @param {!number} n
+ * @param {!number} K
+ * @param {!boolean} end
+ */
+SAIS._induceSAl$LBitVector$AILOArray$AIIIB = function (t, SA, s, bkt, n, K, end) {
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var j;
+ SAIS$_getBuckets$LOArray$AIIIB(s, bkt, n, K, end);
+ for (i = 0; i < n; i++) {
+ j = SA[i] - 1;
+ if (j >= 0 && ! t.get$I(j)) {
+ SA[bkt[OArray$get$LOArray$I(s, j)]++] = (j | 0);
+ }
+ }
+};
+
+var SAIS$_induceSAl$LBitVector$AILOArray$AIIIB = SAIS._induceSAl$LBitVector$AILOArray$AIIIB;
+
+/**
+ * @param {BitVector} t
+ * @param {Array.<undefined|!number>} SA
+ * @param {OArray} s
+ * @param {Array.<undefined|!number>} bkt
+ * @param {!number} n
+ * @param {!number} K
+ * @param {!boolean} end
+ */
+SAIS._induceSAs$LBitVector$AILOArray$AIIIB = function (t, SA, s, bkt, n, K, end) {
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var j;
+ SAIS$_getBuckets$LOArray$AIIIB(s, bkt, n, K, end);
+ for (i = n - 1; i >= 0; i--) {
+ j = SA[i] - 1;
+ if (j >= 0 && t.get$I(j)) {
+ SA[-- bkt[OArray$get$LOArray$I(s, j)]] = (j | 0);
+ }
+ }
+};
+
+var SAIS$_induceSAs$LBitVector$AILOArray$AIIIB = SAIS._induceSAs$LBitVector$AILOArray$AIIIB;
+
+/**
+ * @param {!string} source
+ * @return {Array.<undefined|!number>}
+ */
+SAIS.make$S = function (source) {
+ /** @type {Array.<undefined|!number>} */
+ var charCodes;
+ /** @type {!number} */
+ var maxCode;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var code;
+ /** @type {Array.<undefined|!number>} */
+ var SA;
+ /** @type {OArray} */
+ var s;
+ charCodes = [ ];
+ charCodes.length = source.length;
+ maxCode = 0;
+ for (i = 0; i < source.length; i++) {
+ code = source.charCodeAt(i);
+ charCodes[i] = (code | 0);
+ maxCode = (code > maxCode ? code : maxCode);
+ }
+ SA = [ ];
+ SA.length = source.length;
+ s = ({offset: 0, array: charCodes});
+ SAIS$_make$LOArray$AIII(s, SA, source.length, maxCode);
+ return SA;
+};
+
+var SAIS$make$S = SAIS.make$S;
+
+/**
+ * @param {OArray} s
+ * @param {Array.<undefined|!number>} SA
+ * @param {!number} n
+ * @param {!number} K
+ */
+SAIS._make$LOArray$AIII = function (s, SA, n, K) {
+ /** @type {BitVector} */
+ var t;
+ /** @type {!number} */
+ var i;
+ /** @type {Array.<undefined|!number>} */
+ var bkt;
+ /** @type {!number} */
+ var n1;
+ /** @type {!number} */
+ var name;
+ /** @type {!number} */
+ var prev;
+ /** @type {undefined|!number} */
+ var pos;
+ /** @type {!boolean} */
+ var diff;
+ /** @type {!number} */
+ var d;
+ /** @type {!number} */
+ var j;
+ /** @type {Array.<undefined|!number>} */
+ var SA1;
+ /** @type {OArray} */
+ var s1;
+ /** @type {!number} */
+ var i$0;
+ /** @type {!number} */
+ var index$0;
+ t = new BitVector$();
+ t.set$IB(n - 2, false);
+ t.set$IB(n - 1, true);
+ for (i = n - 3; i >= 0; i--) {
+ t.set$IB(i, OArray$isS$LOArray$I(s, i) || OArray$compare$LOArray$II(s, i, i + 1) && t.get$I(i + 1));
+ }
+ bkt = [ ];
+ bkt.length = K + 1;
+ SAIS$_getBuckets$LOArray$AIIIB(s, bkt, n, K, true);
+ for (i = 0; i < n; i++) {
+ SA[i] = -1;
+ }
+ for (i = 1; i < n; i++) {
+ if (SAIS$_isLMS$LBitVector$I(t, i)) {
+ SA[-- bkt[OArray$get$LOArray$I(s, i)]] = (i | 0);
+ }
+ }
+ SAIS$_induceSAl$LBitVector$AILOArray$AIIIB(t, SA, s, bkt, n, K, false);
+ SAIS$_induceSAs$LBitVector$AILOArray$AIIIB(t, SA, s, bkt, n, K, true);
+ n1 = 0;
+ for (i = 0; i < n; i++) {
+ i$0 = SA[i];
+ if (i$0 > 0 && t.get$I(i$0) && ! t.get$I(i$0 - 1)) {
+ SA[n1++] = SA[i];
+ }
+ }
+ for (i = n1; i < n; i++) {
+ SA[i] = -1;
+ }
+ name = 0;
+ prev = -1;
+ for (i = 0; i < n1; i++) {
+ pos = SA[i];
+ diff = false;
+ for (d = 0; d < n; d++) {
+ if (prev === -1 || ! OArray$compare$LOArray$II(s, pos + d, prev + d) || t.get$I(pos + d) !== t.get$I(prev + d)) {
+ diff = true;
+ break;
+ } else {
+ if (d > 0 && (SAIS$_isLMS$LBitVector$I(t, pos + d) || SAIS$_isLMS$LBitVector$I(t, prev + d))) {
+ break;
+ }
+ }
+ }
+ if (diff) {
+ name++;
+ prev = pos;
+ }
+ pos = ((pos % 2 === 0 ? pos / 2 : (pos - 1) / 2) | 0);
+ SA[n1 + pos] = (name - 1 | 0);
+ }
+ for ((i = n - 1, j = n - 1); i >= n1; i--) {
+ if (SA[i] >= 0) {
+ SA[j--] = SA[i];
+ }
+ }
+ SA1 = SA;
+ s1 = ({offset: n - n1, array: SA});
+ if (name < n1) {
+ SAIS$_make$LOArray$AIII(s1, SA1, n1, name - 1);
+ } else {
+ for (i = 0; i < n1; i++) {
+ SA1[OArray$get$LOArray$I(s1, i)] = (i | 0);
+ }
+ }
+ bkt = [ ];
+ bkt.length = K + 1;
+ SAIS$_getBuckets$LOArray$AIIIB(s, bkt, n, K, true);
+ for ((i = 1, j = 0); i < n; i++) {
+ if (SAIS$_isLMS$LBitVector$I(t, i)) {
+ OArray$set$LOArray$II(s1, j++, i);
+ }
+ }
+ for (i = 0; i < n1; i++) {
+ index$0 = SA1[i];
+ SA1[i] = s1.array[index$0 + s1.offset];
+ }
+ for (i = n1; i < n; i++) {
+ SA[i] = -1;
+ }
+ for (i = n1 - 1; i >= 0; i--) {
+ j = SA[i];
+ SA[i] = -1;
+ SA[-- bkt[OArray$get$LOArray$I(s, j)]] = (j | 0);
+ }
+ SAIS$_induceSAl$LBitVector$AILOArray$AIIIB(t, SA, s, bkt, n, K, false);
+ SAIS$_induceSAs$LBitVector$AILOArray$AIIIB(t, SA, s, bkt, n, K, true);
+};
+
+var SAIS$_make$LOArray$AIII = SAIS._make$LOArray$AIII;
+
+OktaviaSearch._stemmer = null;
+OktaviaSearch._instance = null;
+$__jsx_lazy_init(Oktavia, "eof", function () {
+ return String.fromCharCode(0);
+});
+$__jsx_lazy_init(Oktavia, "eob", function () {
+ return String.fromCharCode(1);
+});
+$__jsx_lazy_init(Oktavia, "unknown", function () {
+ return String.fromCharCode(3);
+});
+Binary._base64EncodeChars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
+$__jsx_lazy_init(Binary, "_base64DecodeChars", function () {
+ return [ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 62, -1, -1, -1, 63, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, -1, -1, -1, -1, -1, -1, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -1, -1, -1, -1, -1, -1, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, -1, -1, -1, -1 ];
+});
+$__jsx_lazy_init(Style, "console", function () {
+ return ({ 'title': [ '\x1B[32m\x1b[4m', '\x1B[39m\x1b[0m' ], 'url': [ '\x1B[34m', '\x1B[39m' ], 'hit': [ '\x1B[4m', '\x1B[0m' ], 'del': [ '\x1B[9m', '\x1B[0m' ], 'summary': [ '\x1B[90m', '\x1B[39m' ] });
+});
+$__jsx_lazy_init(Style, "html", function () {
+ return ({ 'title': [ '<span class="title">', '</span>' ], 'url': [ '<span class="url">', '</span>' ], 'hit': [ '<span class="hit">', '</span>' ], 'del': [ '<del>', '</del>' ], 'summary': [ '<span class="reuslt">', '</span>' ] });
+});
+$__jsx_lazy_init(Style, "ignore", function () {
+ return ({ 'tilte': [ '', '' ], 'url': [ '', '' ], 'hit': [ '', '' ], 'del': [ '', '' ], 'summary': [ '', '' ] });
+});
+SpanishStemmer.serialVersionUID = 1;
+$__jsx_lazy_init(SpanishStemmer, "methodObject", function () {
+ return new SpanishStemmer$();
+});
+$__jsx_lazy_init(SpanishStemmer, "a_0", function () {
+ return [ new Among$SII("", -1, 6), new Among$SII("\u00E1", 0, 1), new Among$SII("\u00E9", 0, 2), new Among$SII("\u00ED", 0, 3), new Among$SII("\u00F3", 0, 4), new Among$SII("\u00FA", 0, 5) ];
+});
+$__jsx_lazy_init(SpanishStemmer, "a_1", function () {
+ return [ new Among$SII("la", -1, -1), new Among$SII("sela", 0, -1), new Among$SII("le", -1, -1), new Among$SII("me", -1, -1), new Among$SII("se", -1, -1), new Among$SII("lo", -1, -1), new Among$SII("selo", 5, -1), new Among$SII("las", -1, -1), new Among$SII("selas", 7, -1), new Among$SII("les", -1, -1), new Among$SII("los", -1, -1), new Among$SII("selos", 10, -1), new Among$SII("nos", -1, -1) ];
+});
+$__jsx_lazy_init(SpanishStemmer, "a_2", function () {
+ return [ new Among$SII("ando", -1, 6), new Among$SII("iendo", -1, 6), new Among$SII("yendo", -1, 7), new Among$SII("\u00E1ndo", -1, 2), new Among$SII("i\u00E9ndo", -1, 1), new Among$SII("ar", -1, 6), new Among$SII("er", -1, 6), new Among$SII("ir", -1, 6), new Among$SII("\u00E1r", -1, 3), new Among$SII("\u00E9r", -1, 4), new Among$SII("\u00EDr", -1, 5) ];
+});
+$__jsx_lazy_init(SpanishStemmer, "a_3", function () {
+ return [ new Among$SII("ic", -1, -1), new Among$SII("ad", -1, -1), new Among$SII("os", -1, -1), new Among$SII("iv", -1, 1) ];
+});
+$__jsx_lazy_init(SpanishStemmer, "a_4", function () {
+ return [ new Among$SII("able", -1, 1), new Among$SII("ible", -1, 1), new Among$SII("ante", -1, 1) ];
+});
+$__jsx_lazy_init(SpanishStemmer, "a_5", function () {
+ return [ new Among$SII("ic", -1, 1), new Among$SII("abil", -1, 1), new Among$SII("iv", -1, 1) ];
+});
+$__jsx_lazy_init(SpanishStemmer, "a_6", function () {
+ return [ new Among$SII("ica", -1, 1), new Among$SII("ancia", -1, 2), new Among$SII("encia", -1, 5), new Among$SII("adora", -1, 2), new Among$SII("osa", -1, 1), new Among$SII("ista", -1, 1), new Among$SII("iva", -1, 9), new Among$SII("anza", -1, 1), new Among$SII("log\u00EDa", -1, 3), new Among$SII("idad", -1, 8), new Among$SII("able", -1, 1), new Among$SII("ible", -1, 1), new Among$SII("ante", -1, 2), new Among$SII("mente", -1, 7), new Among$SII("amente", 13, 6), new Among$SII("aci\u00F3n", -1, 2), new Among$SII("uci\u00F3n", -1, 4), new Among$SII("ico", -1, 1), new Among$SII("ismo", -1, 1), new Among$SII("oso", -1, 1), new Among$SII("amiento", -1, 1), new Among$SII("imiento", -1, 1), new Among$SII("ivo", -1, 9), new Among$SII("ador", -1, 2), new Among$SII("icas", -1, 1), new Among$SII("ancias", -1, 2), new Among$SII("encias", -1, 5), new Among$SII("adoras", -1, 2), new Among$SII("osas", -1, 1), new Among$SII("istas", -1, 1), new Among$SII("ivas", -1, 9), new Among$SII("anzas", -1, 1), new Among$SII("log\u00EDas", -1, 3), new Among$SII("idades", -1, 8), new Among$SII("ables", -1, 1), new Among$SII("ibles", -1, 1), new Among$SII("aciones", -1, 2), new Among$SII("uciones", -1, 4), new Among$SII("adores", -1, 2), new Among$SII("antes", -1, 2), new Among$SII("icos", -1, 1), new Among$SII("ismos", -1, 1), new Among$SII("osos", -1, 1), new Among$SII("amientos", -1, 1), new Among$SII("imientos", -1, 1), new Among$SII("ivos", -1, 9) ];
+});
+$__jsx_lazy_init(SpanishStemmer, "a_7", function () {
+ return [ new Among$SII("ya", -1, 1), new Among$SII("ye", -1, 1), new Among$SII("yan", -1, 1), new Among$SII("yen", -1, 1), new Among$SII("yeron", -1, 1), new Among$SII("yendo", -1, 1), new Among$SII("yo", -1, 1), new Among$SII("yas", -1, 1), new Among$SII("yes", -1, 1), new Among$SII("yais", -1, 1), new Among$SII("yamos", -1, 1), new Among$SII("y\u00F3", -1, 1) ];
+});
+$__jsx_lazy_init(SpanishStemmer, "a_8", function () {
+ return [ new Among$SII("aba", -1, 2), new Among$SII("ada", -1, 2), new Among$SII("ida", -1, 2), new Among$SII("ara", -1, 2), new Among$SII("iera", -1, 2), new Among$SII("\u00EDa", -1, 2), new Among$SII("ar\u00EDa", 5, 2), new Among$SII("er\u00EDa", 5, 2), new Among$SII("ir\u00EDa", 5, 2), new Among$SII("ad", -1, 2), new Among$SII("ed", -1, 2), new Among$SII("id", -1, 2), new Among$SII("ase", -1, 2), new Among$SII("iese", -1, 2), new Among$SII("aste", -1, 2), new Among$SII("iste", -1, 2), new Among$SII("an", -1, 2), new Among$SII("aban", 16, 2), new Among$SII("aran", 16, 2), new Among$SII("ieran", 16, 2), new Among$SII("\u00EDan", 16, 2), new Among$SII("ar\u00EDan", 20, 2), new Among$SII("er\u00EDan", 20, 2), new Among$SII("ir\u00EDan", 20, 2), new Among$SII("en", -1, 1), new Among$SII("asen", 24, 2), new Among$SII("iesen", 24, 2), new Among$SII("aron", -1, 2), new Among$SII("ieron", -1, 2), new Among$SII("ar\u00E1n", -1, 2), new Among$SII("er\u00E1n", -1, 2), new Among$SII("ir\u00E1n", -1, 2), new Among$SII("ado", -1, 2), new Among$SII("ido", -1, 2), new Among$SII("ando", -1, 2), new Among$SII("iendo", -1, 2), new Among$SII("ar", -1, 2), new Among$SII("er", -1, 2), new Among$SII("ir", -1, 2), new Among$SII("as", -1, 2), new Among$SII("abas", 39, 2), new Among$SII("adas", 39, 2), new Among$SII("idas", 39, 2), new Among$SII("aras", 39, 2), new Among$SII("ieras", 39, 2), new Among$SII("\u00EDas", 39, 2), new Among$SII("ar\u00EDas", 45, 2), new Among$SII("er\u00EDas", 45, 2), new Among$SII("ir\u00EDas", 45, 2), new Among$SII("es", -1, 1), new Among$SII("ases", 49, 2), new Among$SII("ieses", 49, 2), new Among$SII("abais", -1, 2), new Among$SII("arais", -1, 2), new Among$SII("ierais", -1, 2), new Among$SII("\u00EDais", -1, 2), new Among$SII("ar\u00EDais", 55, 2), new Among$SII("er\u00EDais", 55, 2), new Among$SII("ir\u00EDais", 55, 2), new Among$SII("aseis", -1, 2), new Among$SII("ieseis", -1, 2), new Among$SII("asteis", -1, 2), new Among$SII("isteis", -1, 2), new Among$SII("\u00E1is", -1, 2), new Among$SII("\u00E9is", -1, 1), new Among$SII("ar\u00E9is", 64, 2), new Among$SII("er\u00E9is", 64, 2), new Among$SII("ir\u00E9is", 64, 2), new Among$SII("ados", -1, 2), new Among$SII("idos", -1, 2), new Among$SII("amos", -1, 2), new Among$SII("\u00E1bamos", 70, 2), new Among$SII("\u00E1ramos", 70, 2), new Among$SII("i\u00E9ramos", 70, 2), new Among$SII("\u00EDamos", 70, 2), new Among$SII("ar\u00EDamos", 74, 2), new Among$SII("er\u00EDamos", 74, 2), new Among$SII("ir\u00EDamos", 74, 2), new Among$SII("emos", -1, 1), new Among$SII("aremos", 78, 2), new Among$SII("eremos", 78, 2), new Among$SII("iremos", 78, 2), new Among$SII("\u00E1semos", 78, 2), new Among$SII("i\u00E9semos", 78, 2), new Among$SII("imos", -1, 2), new Among$SII("ar\u00E1s", -1, 2), new Among$SII("er\u00E1s", -1, 2), new Among$SII("ir\u00E1s", -1, 2), new Among$SII("\u00EDs", -1, 2), new Among$SII("ar\u00E1", -1, 2), new Among$SII("er\u00E1", -1, 2), new Among$SII("ir\u00E1", -1, 2), new Among$SII("ar\u00E9", -1, 2), new Among$SII("er\u00E9", -1, 2), new Among$SII("ir\u00E9", -1, 2), new Among$SII("i\u00F3", -1, 2) ];
+});
+$__jsx_lazy_init(SpanishStemmer, "a_9", function () {
+ return [ new Among$SII("a", -1, 1), new Among$SII("e", -1, 2), new Among$SII("o", -1, 1), new Among$SII("os", -1, 1), new Among$SII("\u00E1", -1, 1), new Among$SII("\u00E9", -1, 2), new Among$SII("\u00ED", -1, 1), new Among$SII("\u00F3", -1, 1) ];
+});
+$__jsx_lazy_init(SpanishStemmer, "g_v", function () {
+ return [ 17, 65, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 17, 4, 10 ];
+});
+$__jsx_lazy_init(_Common, "buffers", function () {
+ return [ "comment", "sgmlDecl", "textNode", "tagName", "doctype", "procInstName", "procInstBody", "entity", "attribName", "attribValue", "cdata", "script" ];
+});
+$__jsx_lazy_init(_Common, "EVENTS", function () {
+ return [ "text", "processinginstruction", "sgmldeclaration", "doctype", "comment", "attribute", "opentag", "closetag", "opencdata", "cdata", "clo_State.CDATA", "error", "end", "ready", "script", "opennamespace", "closenamespace" ];
+});
+_Common.MAX_BUFFER_LENGTH = 65536;
+_State.BEGIN = 1;
+_State.TEXT = 2;
+_State.TEXT_ENTITY = 3;
+_State.OPEN_WAKA = 4;
+_State.SGML_DECL = 5;
+_State.SGML_DECL_QUOTED = 6;
+_State.DOCTYPE = 7;
+_State.DOCTYPE_QUOTED = 8;
+_State.DOCTYPE_DTD = 9;
+_State.DOCTYPE_DTD_QUOTED = 10;
+_State.COMMENT_STARTING = 11;
+_State.COMMENT = 12;
+_State.COMMENT_ENDING = 13;
+_State.COMMENT_ENDED = 14;
+_State.CDATA = 15;
+_State.CDATA_ENDING = 16;
+_State.CDATA_ENDING_2 = 17;
+_State.PROC_INST = 18;
+_State.PROC_INST_BODY = 19;
+_State.PROC_INST_ENDING = 20;
+_State.OPEN_TAG = 21;
+_State.OPEN_TAG_SLASH = 22;
+_State.ATTRIB = 23;
+_State.ATTRIB_NAME = 24;
+_State.ATTRIB_NAME_SAW_WHITE = 25;
+_State.ATTRIB_VALUE = 26;
+_State.ATTRIB_VALUE_QUOTED = 27;
+_State.ATTRIB_VALUE_UNQUOTED = 28;
+_State.ATTRIB_VALUE_ENTITY_Q = 29;
+_State.ATTRIB_VALUE_ENTITY_U = 30;
+_State.CLOSE_TAG = 31;
+_State.CLOSE_TAG_SAW_WHITE = 32;
+_State.SCRIPT = 33;
+_State.SCRIPT_ENDING = 34;
+$__jsx_lazy_init(_Entities, "_entities", function () {
+ return ({ "amp": "&", "gt": ">", "lt": "<", "quot": "\"", "apos": "'", "AElig": 198, "Aacute": 193, "Acirc": 194, "Agrave": 192, "Aring": 197, "Atilde": 195, "Auml": 196, "Ccedil": 199, "ETH": 208, "Eacute": 201, "Ecirc": 202, "Egrave": 200, "Euml": 203, "Iacute": 205, "Icirc": 206, "Igrave": 204, "Iuml": 207, "Ntilde": 209, "Oacute": 211, "Ocirc": 212, "Ograve": 210, "Oslash": 216, "Otilde": 213, "Ouml": 214, "THORN": 222, "Uacute": 218, "Ucirc": 219, "Ugrave": 217, "Uuml": 220, "Yacute": 221, "aacute": 225, "acirc": 226, "aelig": 230, "agrave": 224, "aring": 229, "atilde": 227, "auml": 228, "ccedil": 231, "eacute": 233, "ecirc": 234, "egrave": 232, "eth": 240, "euml": 235, "iacute": 237, "icirc": 238, "igrave": 236, "iuml": 239, "ntilde": 241, "oacute": 243, "ocirc": 244, "ograve": 242, "oslash": 248, "otilde": 245, "ouml": 246, "szlig": 223, "thorn": 254, "uacute": 250, "ucirc": 251, "ugrave": 249, "uuml": 252, "yacute": 253, "yuml": 255, "copy": 169, "reg": 174, "nbsp": 160, "iexcl": 161, "cent": 162, "pound": 163, "curren": 164, "yen": 165, "brvbar": 166, "sect": 167, "uml": 168, "ordf": 170, "laquo": 171, "not": 172, "shy": 173, "macr": 175, "deg": 176, "plusmn": 177, "sup1": 185, "sup2": 178, "sup3": 179, "acute": 180, "micro": 181, "para": 182, "middot": 183, "cedil": 184, "ordm": 186, "raquo": 187, "frac14": 188, "frac12": 189, "frac34": 190, "iquest": 191, "times": 215, "divide": 247, "OElig": 338, "oelig": 339, "Scaron": 352, "scaron": 353, "Yuml": 376, "fnof": 402, "circ": 710, "tilde": 732, "Alpha": 913, "Beta": 914, "Gamma": 915, "Delta": 916, "Epsilon": 917, "Zeta": 918, "Eta": 919, "Theta": 920, "Iota": 921, "Kappa": 922, "Lambda": 923, "Mu": 924, "Nu": 925, "Xi": 926, "Omicron": 927, "Pi": 928, "Rho": 929, "Sigma": 931, "Tau": 932, "Upsilon": 933, "Phi": 934, "Chi": 935, "Psi": 936, "Omega": 937, "alpha": 945, "beta": 946, "gamma": 947, "delta": 948, "epsilon": 949, "zeta": 950, "eta": 951, "theta": 952, "iota": 953, "kappa": 954, "lambda": 955, "mu": 956, "nu": 957, "xi": 958, "omicron": 959, "pi": 960, "rho": 961, "sigmaf": 962, "sigma": 963, "tau": 964, "upsilon": 965, "phi": 966, "chi": 967, "psi": 968, "omega": 969, "thetasym": 977, "upsih": 978, "piv": 982, "ensp": 8194, "emsp": 8195, "thinsp": 8201, "zwnj": 8204, "zwj": 8205, "lrm": 8206, "rlm": 8207, "ndash": 8211, "mdash": 8212, "lsquo": 8216, "rsquo": 8217, "sbquo": 8218, "ldquo": 8220, "rdquo": 8221, "bdquo": 8222, "dagger": 8224, "Dagger": 8225, "bull": 8226, "hellip": 8230, "permil": 8240, "prime": 8242, "Prime": 8243, "lsaquo": 8249, "rsaquo": 8250, "oline": 8254, "frasl": 8260, "euro": 8364, "image": 8465, "weierp": 8472, "real": 8476, "trade": 8482, "alefsym": 8501, "larr": 8592, "uarr": 8593, "rarr": 8594, "darr": 8595, "harr": 8596, "crarr": 8629, "lArr": 8656, "uArr": 8657, "rArr": 8658, "dArr": 8659, "hArr": 8660, "forall": 8704, "part": 8706, "exist": 8707, "empty": 8709, "nabla": 8711, "isin": 8712, "notin": 8713, "ni": 8715, "prod": 8719, "sum": 8721, "minus": 8722, "lowast": 8727, "radic": 8730, "prop": 8733, "infin": 8734, "ang": 8736, "and": 8743, "or": 8744, "cap": 8745, "cup": 8746, "int": 8747, "there4": 8756, "sim": 8764, "cong": 8773, "asymp": 8776, "ne": 8800, "equiv": 8801, "le": 8804, "ge": 8805, "sub": 8834, "sup": 8835, "nsub": 8836, "sube": 8838, "supe": 8839, "oplus": 8853, "otimes": 8855, "perp": 8869, "sdot": 8901, "lceil": 8968, "rceil": 8969, "lfloor": 8970, "rfloor": 8971, "lang": 9001, "rang": 9002, "loz": 9674, "spades": 9824, "clubs": 9827, "hearts": 9829, "diams": 9830 });
+});
+BitVector.SMALL_BLOCK_SIZE = 32;
+BitVector.LARGE_BLOCK_SIZE = 256;
+BitVector.BLOCK_RATE = 8;
+$__jsx_lazy_init(BurrowsWheelerTransform, "END_MARKER", function () {
+ return String.fromCharCode(0);
+});
+var $__jsx_classMap = {
+ "tool/web/oktavia-spanish-search.jsx": {
+ _Main: _Main,
+ _Main$: _Main$
+ },
+ "tool/web/oktavia-search.jsx": {
+ _Result: _Result,
+ _Result$SSSI: _Result$SSSI,
+ _Proposal: _Proposal,
+ _Proposal$SSI: _Proposal$SSI,
+ OktaviaSearch: OktaviaSearch,
+ OktaviaSearch$I: OktaviaSearch$I,
+ _Main: _Main$0,
+ _Main$: _Main$0$
+ },
+ "src/oktavia.jsx": {
+ Oktavia: Oktavia,
+ Oktavia$: Oktavia$
+ },
+ "src/binary-util.jsx": {
+ Binary: Binary,
+ Binary$: Binary$,
+ LoadedStringResult: LoadedStringResult,
+ LoadedStringResult$SI: LoadedStringResult$SI,
+ LoadedStringListResult: LoadedStringListResult,
+ LoadedStringListResult$SI: LoadedStringListResult$SI,
+ LoadedStringListMapResult: LoadedStringListMapResult,
+ LoadedStringListMapResult$SI: LoadedStringListMapResult$SI,
+ LoadedNumberListResult: LoadedNumberListResult,
+ LoadedNumberListResult$SI: LoadedNumberListResult$SI,
+ CompressionReport: CompressionReport,
+ CompressionReport$: CompressionReport$
+ },
+ "src/query.jsx": {
+ Query: Query,
+ Query$: Query$
+ },
+ "src/query-string-parser.jsx": {
+ QueryStringParser: QueryStringParser,
+ QueryStringParser$: QueryStringParser$
+ },
+ "src/search-result.jsx": {
+ Proposal: Proposal,
+ Proposal$II: Proposal$II,
+ Position: Position,
+ Position$SIB: Position$SIB,
+ SearchUnit: SearchUnit,
+ SearchUnit$I: SearchUnit$I,
+ SingleResult: SingleResult,
+ SingleResult$: SingleResult$,
+ SingleResult$SBB: SingleResult$SBB,
+ SearchSummary: SearchSummary,
+ SearchSummary$: SearchSummary$,
+ SearchSummary$LOktavia$: SearchSummary$LOktavia$
+ },
+ "src/style.jsx": {
+ Style: Style,
+ Style$S: Style$S,
+ _HTMLHandler: _HTMLHandler,
+ _HTMLHandler$HASB: _HTMLHandler$HASB
+ },
+ "src/stemmer/stemmer.jsx": {
+ Stemmer: Stemmer,
+ Stemmer$: Stemmer$
+ },
+ "src/stemmer/base-stemmer.jsx": {
+ BaseStemmer: BaseStemmer,
+ BaseStemmer$: BaseStemmer$
+ },
+ "src/stemmer/spanish-stemmer.jsx": {
+ SpanishStemmer: SpanishStemmer,
+ SpanishStemmer$: SpanishStemmer$
+ },
+ "src/stemmer/among.jsx": {
+ Among: Among,
+ Among$SII: Among$SII,
+ Among$SIIF$LBaseStemmer$B$LBaseStemmer$: Among$SIIF$LBaseStemmer$B$LBaseStemmer$
+ },
+ "src/metadata.jsx": {
+ Metadata: Metadata,
+ Metadata$LOktavia$: Metadata$LOktavia$,
+ Section: Section,
+ Section$LOktavia$: Section$LOktavia$,
+ Splitter: Splitter,
+ Splitter$LOktavia$: Splitter$LOktavia$,
+ Splitter$LOktavia$S: Splitter$LOktavia$S,
+ Table: Table,
+ Table$LOktavia$AS: Table$LOktavia$AS,
+ Block: Block,
+ Block$LOktavia$: Block$LOktavia$
+ },
+ "src/fm-index.jsx": {
+ FMIndex: FMIndex,
+ FMIndex$: FMIndex$
+ },
+ "src/sax.jsx": {
+ Tag: Tag,
+ Tag$S: Tag$S,
+ _Common: _Common,
+ _Common$: _Common$,
+ _State: _State,
+ _State$: _State$,
+ SAXHandler: SAXHandler,
+ SAXHandler$: SAXHandler$,
+ SAXParser: SAXParser,
+ SAXParser$LSAXHandler$: SAXParser$LSAXHandler$,
+ SAXParser$LSAXHandler$B: SAXParser$LSAXHandler$B,
+ Char: Char,
+ Char$: Char$,
+ _Entities: _Entities,
+ _Entities$: _Entities$
+ },
+ "src/bit-vector.jsx": {
+ BitVector: BitVector,
+ BitVector$: BitVector$
+ },
+ "src/wavelet-matrix.jsx": {
+ WaveletMatrix: WaveletMatrix,
+ WaveletMatrix$: WaveletMatrix$
+ },
+ "src/burrows-wheeler-transform.jsx": {
+ BurrowsWheelerTransform: BurrowsWheelerTransform,
+ BurrowsWheelerTransform$: BurrowsWheelerTransform$
+ },
+ "src/sais.jsx": {
+ OArray: OArray,
+ OArray$AI: OArray$AI,
+ OArray$AII: OArray$AII,
+ SAIS: SAIS,
+ SAIS$: SAIS$
+ }
+};
+
+
+/**
+ * launches _Main.main(:string[]):void invoked by jsx --run|--executable
+ */
+JSX.runMain = function (sourceFile, args) {
+ var module = JSX.require(sourceFile);
+ if (! module) {
+ throw new ReferenceError("entry point module not found in " + sourceFile);
+ }
+ if (! module._Main) {
+ throw new ReferenceError("entry point _Main not found in " + sourceFile);
+ }
+ if (! module._Main.main$AS) {
+ throw new ReferenceError("entry point _Main.main(:string[]):void not found in " + sourceFile);
+ }
+ module._Main.main$AS(args);
+};
+
+/**
+ * launches _Test#test*():void invoked by jsx --test
+ */
+JSX.runTests = function (sourceFile, tests) {
+ var module = JSX.require(sourceFile);
+ var testClass = module._Test$;
+
+ if (!testClass) return; // skip if there's no test class
+
+ if(tests.length === 0) {
+ var p = testClass.prototype;
+ for (var m in p) {
+ if (p[m] instanceof Function
+ && /^test.*[$]$/.test(m)) {
+ tests.push(m);
+ }
+ }
+ }
+ else { // set as process arguments
+ tests = tests.map(function (name) {
+ return name + "$"; // mangle for function test*():void
+ });
+ }
+
+ var testCase = new testClass();
+
+ if (testCase.beforeClass$AS != null)
+ testCase.beforeClass$AS(tests);
+
+ for (var i = 0; i < tests.length; ++i) {
+ (function (method) {
+ if (method in testCase) {
+ testCase.run$SF$V$(method, function() { testCase[method](); });
+ }
+ else {
+ throw new ReferenceError("No such test method: " + method);
+ }
+ }(tests[i]));
+ }
+
+ if (testCase.afterClass$ != null)
+ testCase.afterClass$();
+};
+/**
+ * call a function on load/DOMContentLoaded
+ */
+function $__jsx_onload (event) {
+ window.removeEventListener("load", $__jsx_onload);
+ document.removeEventListener("DOMContentLoaded", $__jsx_onload);
+ JSX.runMain("tool/web/oktavia-spanish-search.jsx", [])
+}
+
+window.addEventListener("load", $__jsx_onload);
+document.addEventListener("DOMContentLoaded", $__jsx_onload);
+
+})(JSX);
diff --git a/web/server/h2o/libh2o/misc/oktavia/lib/oktavia-swedish-search.js b/web/server/h2o/libh2o/misc/oktavia/lib/oktavia-swedish-search.js
new file mode 100644
index 00000000..c36b3db8
--- /dev/null
+++ b/web/server/h2o/libh2o/misc/oktavia/lib/oktavia-swedish-search.js
@@ -0,0 +1,7934 @@
+// generatedy by JSX compiler 0.9.24 (2013-04-05 13:45:00 +0900; 1b229cc6a411f674f0f7cf7a79b7a8b3f8eb7414)
+var JSX = {};
+(function (JSX) {
+/**
+ * copies the implementations from source interface to target
+ */
+function $__jsx_merge_interface(target, source) {
+ for (var k in source.prototype)
+ if (source.prototype.hasOwnProperty(k))
+ target.prototype[k] = source.prototype[k];
+}
+
+/**
+ * defers the initialization of the property
+ */
+function $__jsx_lazy_init(obj, prop, func) {
+ function reset(obj, prop, value) {
+ delete obj[prop];
+ obj[prop] = value;
+ return value;
+ }
+
+ Object.defineProperty(obj, prop, {
+ get: function () {
+ return reset(obj, prop, func());
+ },
+ set: function (v) {
+ reset(obj, prop, v);
+ },
+ enumerable: true,
+ configurable: true
+ });
+}
+
+/**
+ * sideeffect().a /= b
+ */
+function $__jsx_div_assign(obj, prop, divisor) {
+ return obj[prop] = (obj[prop] / divisor) | 0;
+}
+
+/*
+ * global functions, renamed to avoid conflict with local variable names
+ */
+var $__jsx_parseInt = parseInt;
+var $__jsx_parseFloat = parseFloat;
+var $__jsx_isNaN = isNaN;
+var $__jsx_isFinite = isFinite;
+
+var $__jsx_encodeURIComponent = encodeURIComponent;
+var $__jsx_decodeURIComponent = decodeURIComponent;
+var $__jsx_encodeURI = encodeURI;
+var $__jsx_decodeURI = decodeURI;
+
+var $__jsx_ObjectToString = Object.prototype.toString;
+var $__jsx_ObjectHasOwnProperty = Object.prototype.hasOwnProperty;
+
+/*
+ * profiler object, initialized afterwards
+ */
+function $__jsx_profiler() {
+}
+
+/*
+ * public interface to JSX code
+ */
+JSX.require = function (path) {
+ var m = $__jsx_classMap[path];
+ return m !== undefined ? m : null;
+};
+
+JSX.profilerIsRunning = function () {
+ return $__jsx_profiler.getResults != null;
+};
+
+JSX.getProfileResults = function () {
+ return ($__jsx_profiler.getResults || function () { return {}; })();
+};
+
+JSX.postProfileResults = function (url, cb) {
+ if ($__jsx_profiler.postResults == null)
+ throw new Error("profiler has not been turned on");
+ return $__jsx_profiler.postResults(url, cb);
+};
+
+JSX.resetProfileResults = function () {
+ if ($__jsx_profiler.resetResults == null)
+ throw new Error("profiler has not been turned on");
+ return $__jsx_profiler.resetResults();
+};
+JSX.DEBUG = false;
+/**
+ * class _Main extends Object
+ * @constructor
+ */
+function _Main() {
+}
+
+/**
+ * @constructor
+ */
+function _Main$() {
+};
+
+_Main$.prototype = new _Main;
+
+/**
+ * @param {Array.<undefined|!string>} args
+ */
+_Main.main$AS = function (args) {
+ OktaviaSearch$setStemmer$LStemmer$(new SwedishStemmer$());
+};
+
+var _Main$main$AS = _Main.main$AS;
+
+/**
+ * class _Result extends Object
+ * @constructor
+ */
+function _Result() {
+}
+
+/**
+ * @constructor
+ * @param {!string} title
+ * @param {!string} url
+ * @param {!string} content
+ * @param {!number} score
+ */
+function _Result$SSSI(title, url, content, score) {
+ this.title = title;
+ this.url = url;
+ this.content = content;
+ this.score = score;
+};
+
+_Result$SSSI.prototype = new _Result;
+
+/**
+ * class _Proposal extends Object
+ * @constructor
+ */
+function _Proposal() {
+}
+
+/**
+ * @constructor
+ * @param {!string} options
+ * @param {!string} label
+ * @param {!number} count
+ */
+function _Proposal$SSI(options, label, count) {
+ this.options = options;
+ this.label = label;
+ this.count = count;
+};
+
+_Proposal$SSI.prototype = new _Proposal;
+
+/**
+ * class OktaviaSearch extends Object
+ * @constructor
+ */
+function OktaviaSearch() {
+}
+
+/**
+ * @constructor
+ * @param {!number} entriesPerPage
+ */
+function OktaviaSearch$I(entriesPerPage) {
+ this._queries = null;
+ this._highlight = "";
+ this._result = null;
+ this._proposals = null;
+ this._currentFolderDepth = 0;
+ this._oktavia = new Oktavia$();
+ this._entriesPerPage = entriesPerPage;
+ this._currentPage = 1;
+ this._queryString = null;
+ this._callback = null;
+ OktaviaSearch._instance = this;
+};
+
+OktaviaSearch$I.prototype = new OktaviaSearch;
+
+/**
+ * @param {Stemmer} stemmer
+ */
+OktaviaSearch.setStemmer$LStemmer$ = function (stemmer) {
+ /** @type {Oktavia} */
+ var this$0;
+ if (OktaviaSearch._instance) {
+ this$0 = OktaviaSearch._instance._oktavia;
+ this$0._stemmer = stemmer;
+ } else {
+ OktaviaSearch._stemmer = stemmer;
+ }
+};
+
+var OktaviaSearch$setStemmer$LStemmer$ = OktaviaSearch.setStemmer$LStemmer$;
+
+/**
+ * @param {!string} index
+ */
+OktaviaSearch.prototype.loadIndex$S = function (index) {
+ /** @type {Oktavia} */
+ var this$0;
+ /** @type {Stemmer} */
+ var stemmer$0;
+ if (OktaviaSearch._stemmer) {
+ this$0 = this._oktavia;
+ stemmer$0 = OktaviaSearch._stemmer;
+ this$0._stemmer = stemmer$0;
+ }
+ this._oktavia.load$S(Binary$base64decode$S(index));
+ if (this._queryString) {
+ this.search$SF$IIV$(this._queryString, this._callback);
+ this._queryString = null;
+ this._callback = null;
+ }
+};
+
+/**
+ * @param {!string} queryString
+ * @param {*} callback
+ */
+OktaviaSearch.prototype.search$SF$IIV$ = function (queryString, callback) {
+ /** @type {QueryStringParser} */
+ var queryParser;
+ /** @type {SearchSummary} */
+ var summary;
+ /** @type {Array.<undefined|SearchUnit>} */
+ var _result$0;
+ if (this._oktavia) {
+ queryParser = ({queries: [ ]});
+ this._queries = QueryStringParser$parse$LQueryStringParser$S(queryParser, queryString);
+ this._highlight = QueryStringParser$highlight$LQueryStringParser$(queryParser);
+ summary = this._oktavia.search$ALQuery$(this._queries);
+ if (SearchSummary$size$LSearchSummary$(summary) > 0) {
+ this._result = this._sortResult$LSearchSummary$(summary);
+ this._proposals = [ ];
+ this._currentPage = 1;
+ } else {
+ this._result = [ ];
+ if (this._queries.length > 1) {
+ this._proposals = SearchSummary$getProposal$LSearchSummary$(summary);
+ } else {
+ this._proposals = [ ];
+ }
+ this._currentPage = 1;
+ }
+ callback((_result$0 = this._result).length, Math.ceil(_result$0.length / this._entriesPerPage));
+ } else {
+ this._queryString = queryString;
+ this._callback = callback;
+ }
+};
+
+/**
+ * @return {!number}
+ */
+OktaviaSearch.prototype.resultSize$ = function () {
+ return (this._result.length | 0);
+};
+
+/**
+ * @return {!number}
+ */
+OktaviaSearch.prototype.totalPages$ = function () {
+ return (Math.ceil(this._result.length / this._entriesPerPage) | 0);
+};
+
+/**
+ * @return {!number}
+ */
+OktaviaSearch.prototype.currentPage$ = function () {
+ return this._currentPage;
+};
+
+/**
+ * @param {!number} page
+ */
+OktaviaSearch.prototype.setCurrentPage$I = function (page) {
+ this._currentPage = page;
+};
+
+/**
+ * @return {!boolean}
+ */
+OktaviaSearch.prototype.hasPrevPage$ = function () {
+ return this._currentPage !== 1;
+};
+
+/**
+ * @return {!boolean}
+ */
+OktaviaSearch.prototype.hasNextPage$ = function () {
+ return this._currentPage !== Math.ceil(this._result.length / this._entriesPerPage);
+};
+
+/**
+ * @return {Array.<undefined|!string>}
+ */
+OktaviaSearch.prototype.pageIndexes$ = function () {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var total;
+ /** @type {!number} */
+ var i;
+ result = [ ];
+ total = Math.ceil(this._result.length / this._entriesPerPage);
+ if (total < 10) {
+ for (i = 1; i <= total; i++) {
+ result.push(i + "");
+ }
+ } else {
+ if (this._currentPage <= 5) {
+ for (i = 1; i <= 7; i++) {
+ result.push(i + "");
+ }
+ result.push('...', total + "");
+ } else {
+ if (total - 5 <= this._currentPage) {
+ result.push('1', '...');
+ for (i = total - 8; i <= total; i++) {
+ result.push(i + "");
+ }
+ } else {
+ result.push('1', '...');
+ for (i = this._currentPage - 3; i <= this._currentPage + 3; i++) {
+ result.push(i + "");
+ }
+ result.push('...', total + "");
+ }
+ }
+ }
+ return result;
+};
+
+/**
+ * @return {Array.<undefined|_Result>}
+ */
+OktaviaSearch.prototype.getResult$ = function () {
+ /** @type {Style} */
+ var style;
+ /** @type {!number} */
+ var start;
+ /** @type {!number} */
+ var last;
+ /** @type {Metadata} */
+ var metadata;
+ /** @type {!number} */
+ var num;
+ /** @type {Array.<undefined|_Result>} */
+ var results;
+ /** @type {!number} */
+ var i;
+ /** @type {SearchUnit} */
+ var unit;
+ /** @type {Array.<undefined|!string>} */
+ var info;
+ /** @type {!string} */
+ var content;
+ /** @type {Array.<undefined|Position>} */
+ var positions;
+ /** @type {!number} */
+ var end;
+ /** @type {!boolean} */
+ var split;
+ /** @type {!number} */
+ var j;
+ /** @type {Position} */
+ var pos;
+ /** @type {!string} */
+ var text;
+ /** @type {Oktavia} */
+ var this$0;
+ /** @type {!number} */
+ var position$0;
+ /** @type {!number} */
+ var _currentPage$0;
+ /** @type {!number} */
+ var _entriesPerPage$0;
+ style = new Style$S('html');
+ start = ((_currentPage$0 = this._currentPage) - 1) * (_entriesPerPage$0 = this._entriesPerPage);
+ last = Math.min(_currentPage$0 * _entriesPerPage$0, this._result.length);
+ this$0 = this._oktavia;
+ metadata = this$0._metadatas[this$0._metadataLabels[0]];
+ num = 250;
+ results = [ ];
+ for (i = start; i < last; i++) {
+ unit = this._result[i];
+ info = metadata.getInformation$I(unit.id).split(Oktavia.eob);
+ content = metadata.getContent$I(unit.id);
+ start = 0;
+ positions = SearchUnit$getPositions$LSearchUnit$(unit);
+ if (content.indexOf(info[0]) === 1) {
+ content = content.slice(info[0].length + 2, content.length);
+ start += info[0].length + 2;
+ }
+ end = start + num;
+ split = false;
+ if (positions[0].position > end - positions[0].word.length) {
+ end = positions[0].position + Math.floor(num / 2);
+ split = true;
+ }
+ for (j = positions.length - 1; j > -1; j--) {
+ pos = positions[j];
+ if (pos.position + pos.word.length < end) {
+ content = [ content.slice(0, pos.position - start), style.convert$S('<hit>*</hit>').replace('*', content.slice((position$0 = pos.position) - start, position$0 + pos.word.length - start)), content.slice(pos.position + pos.word.length - start, content.length) ].join('');
+ }
+ }
+ if (split) {
+ text = [ content.slice(0, Math.floor(num / 2)) + ' ...', content.slice(- Math.floor(num / 2), end - start) ].join('<br/>');
+ } else {
+ text = content.slice(0, end - start) + ' ...<br/>';
+ }
+ text = text.replace(Oktavia.eob, ' ').replace(/(<br\/>)(<br\/>)+/, '<br/><br/>');
+ results.push(({title: info[0], url: info[1], content: text, score: unit.score}));
+ }
+ return results;
+};
+
+/**
+ * @return {!string}
+ */
+OktaviaSearch.prototype.getHighlight$ = function () {
+ return this._highlight;
+};
+
+/**
+ * @return {Array.<undefined|_Proposal>}
+ */
+OktaviaSearch.prototype.getProposals$ = function () {
+ /** @type {Style} */
+ var style;
+ /** @type {Array.<undefined|_Proposal>} */
+ var results;
+ /** @type {!number} */
+ var i;
+ /** @type {Proposal} */
+ var proposal;
+ /** @type {Array.<undefined|!string>} */
+ var label;
+ /** @type {Array.<undefined|!string>} */
+ var option;
+ /** @type {!number} */
+ var j;
+ style = new Style$S('html');
+ results = [ ];
+ if (this._queries.length > 1) {
+ for (i = 0; i < this._proposals.length; i++) {
+ proposal = this._proposals[i];
+ if (proposal.expect > 0) {
+ label = [ ];
+ option = [ ];
+ for (j = 0; j < this._queries.length; j++) {
+ if (j !== proposal.omit) {
+ label.push(style.convert$S('<hit>' + this._queries[j].toString() + '</hit>'));
+ option.push(this._queries[j].toString());
+ } else {
+ label.push(style.convert$S('<del>' + this._queries[j].toString() + '</del>'));
+ }
+ }
+ results.push(({options: option.join(' '), label: label.join('&nbsp;'), count: proposal.expect}));
+ }
+ }
+ }
+ return results;
+};
+
+/**
+ * @param {SearchSummary} summary
+ * @return {Array.<undefined|SearchUnit>}
+ */
+OktaviaSearch.prototype._sortResult$LSearchSummary$ = function (summary) {
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var score;
+ /** @type {SearchUnit} */
+ var unit;
+ /** @type {!string} */
+ var pos;
+ /** @type {Position} */
+ var position;
+ for (i = 0; i < summary.result.units.length; i++) {
+ score = 0;
+ unit = summary.result.units[i];
+ for (pos in unit.positions) {
+ position = unit.positions[pos];
+ if (this._oktavia.wordPositionType$I(position.position)) {
+ score += 10;
+ } else {
+ score += 1;
+ }
+ if (! position.stemmed) {
+ score += 2;
+ }
+ }
+ unit.score = (score | 0);
+ }
+ return SearchSummary$getSortedResult$LSearchSummary$(summary);
+};
+
+/**
+ * class _Main$0 extends Object
+ * @constructor
+ */
+function _Main$0() {
+}
+
+/**
+ * @constructor
+ */
+function _Main$0$() {
+};
+
+_Main$0$.prototype = new _Main$0;
+
+/**
+ * @param {Array.<undefined|!string>} args
+ */
+_Main$0.main$AS = function (args) {
+};
+
+var _Main$0$main$AS = _Main$0.main$AS;
+
+/**
+ * class Oktavia extends Object
+ * @constructor
+ */
+function Oktavia() {
+}
+
+/**
+ * @constructor
+ */
+function Oktavia$() {
+ /** @type {Array.<undefined|!string>} */
+ var _utf162compressCode$0;
+ this._compressCode2utf16 = null;
+ this._fmindex = new FMIndex$();
+ this._metadatas = ({ });
+ this._metadataLabels = [ ];
+ this._stemmer = null;
+ this._stemmingResult = ({ });
+ _utf162compressCode$0 = this._utf162compressCode = [ Oktavia.eof, Oktavia.eob, Oktavia.unknown ];
+ _utf162compressCode$0.length = 65536;
+ this._compressCode2utf16 = [ Oktavia.eof, Oktavia.eob, Oktavia.unknown ];
+};
+
+Oktavia$.prototype = new Oktavia;
+
+/**
+ * @param {Stemmer} stemmer
+ */
+Oktavia.prototype.setStemmer$LStemmer$ = function (stemmer) {
+ this._stemmer = stemmer;
+};
+
+/**
+ * @return {Metadata}
+ */
+Oktavia.prototype.getPrimaryMetadata$ = function () {
+ return this._metadatas[this._metadataLabels[0]];
+};
+
+/**
+ * @param {!string} key
+ * @return {Section}
+ */
+Oktavia.prototype.addSection$S = function (key) {
+ /** @type {Section} */
+ var section;
+ if (this._metadataLabels.indexOf(key) !== -1) {
+ throw new Error('Metadata name ' + key + ' is already exists');
+ }
+ this._metadataLabels.push(key);
+ section = new Section$LOktavia$(this);
+ this._metadatas[key] = section;
+ return section;
+};
+
+/**
+ * @param {!string} key
+ * @return {Section}
+ */
+Oktavia.prototype.getSection$S = function (key) {
+ if (this._metadataLabels.indexOf(key) === -1) {
+ throw new Error('Metadata name ' + key + " does't exists");
+ }
+ return this._metadatas[key];
+};
+
+/**
+ * @param {!string} key
+ * @return {Splitter}
+ */
+Oktavia.prototype.addSplitter$S = function (key) {
+ /** @type {Splitter} */
+ var splitter;
+ if (this._metadataLabels.indexOf(key) !== -1) {
+ throw new Error('Metadata name ' + key + ' is already exists');
+ }
+ this._metadataLabels.push(key);
+ splitter = new Splitter$LOktavia$(this);
+ this._metadatas[key] = splitter;
+ return splitter;
+};
+
+/**
+ * @param {!string} key
+ * @return {Splitter}
+ */
+Oktavia.prototype.getSplitter$S = function (key) {
+ if (this._metadataLabels.indexOf(key) === -1) {
+ throw new Error('Metadata name ' + key + " does't exists");
+ }
+ return this._metadatas[key];
+};
+
+/**
+ * @param {!string} key
+ * @param {Array.<undefined|!string>} headers
+ * @return {Table}
+ */
+Oktavia.prototype.addTable$SAS = function (key, headers) {
+ /** @type {Table} */
+ var table;
+ if (this._metadataLabels.indexOf(key) !== -1) {
+ throw new Error('Metadata name ' + key + ' is already exists');
+ }
+ this._metadataLabels.push(key);
+ table = new Table$LOktavia$AS(this, headers);
+ this._metadatas[key] = table;
+ return table;
+};
+
+/**
+ * @param {!string} key
+ * @return {Table}
+ */
+Oktavia.prototype.getTable$S = function (key) {
+ if (this._metadataLabels.indexOf(key) === -1) {
+ throw new Error('Metadata name ' + key + " does't exists");
+ }
+ return this._metadatas[key];
+};
+
+/**
+ * @param {!string} key
+ * @return {Block}
+ */
+Oktavia.prototype.addBlock$S = function (key) {
+ /** @type {Block} */
+ var block;
+ if (this._metadataLabels.indexOf(key) !== -1) {
+ throw new Error('Metadata name ' + key + ' is already exists');
+ }
+ this._metadataLabels.push(key);
+ block = new Block$LOktavia$(this);
+ this._metadatas[key] = block;
+ return block;
+};
+
+/**
+ * @param {!string} key
+ * @return {Block}
+ */
+Oktavia.prototype.getBlock$S = function (key) {
+ if (this._metadataLabels.indexOf(key) === -1) {
+ throw new Error('Metadata name ' + key + " does't exists");
+ }
+ return this._metadatas[key];
+};
+
+/**
+ */
+Oktavia.prototype.addEndOfBlock$ = function () {
+ this._fmindex.push$S(Oktavia.eob);
+};
+
+/**
+ * @param {!string} words
+ */
+Oktavia.prototype.addWord$S = function (words) {
+ /** @type {Array.<undefined|!string>} */
+ var str;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var charCode;
+ /** @type {undefined|!string} */
+ var newCharCode;
+ str = [ ];
+ str.length = words.length;
+ for (i = 0; i < words.length; i++) {
+ charCode = words.charCodeAt(i);
+ newCharCode = this._utf162compressCode[charCode];
+ if (newCharCode == null) {
+ newCharCode = String.fromCharCode(this._compressCode2utf16.length);
+ this._utf162compressCode[charCode] = newCharCode;
+ this._compressCode2utf16.push(String.fromCharCode(charCode));
+ }
+ str.push(newCharCode);
+ }
+ this._fmindex.push$S(str.join(''));
+};
+
+/**
+ * @param {!string} words
+ * @param {!boolean} stemming
+ */
+Oktavia.prototype.addWord$SB = function (words, stemming) {
+ /** @type {Array.<undefined|!string>} */
+ var wordList;
+ /** @type {!number} */
+ var i;
+ /** @type {undefined|!string} */
+ var originalWord;
+ /** @type {!string} */
+ var smallWord;
+ /** @type {undefined|!string} */
+ var registerWord;
+ /** @type {!string} */
+ var baseWord;
+ /** @type {!string} */
+ var compressedCodeWord;
+ /** @type {Array.<undefined|!string>} */
+ var stemmedList;
+ this.addWord$S(words);
+ wordList = words.split(/\s+/);
+ for (i = 0; i < wordList.length; i++) {
+ originalWord = wordList[i];
+ smallWord = originalWord.slice(0, 1).toLowerCase() + originalWord.slice(1);
+ registerWord = null;
+ if (stemming && this._stemmer) {
+ baseWord = this._stemmer.stemWord$S(originalWord.toLowerCase());
+ if (originalWord.indexOf(baseWord) === -1) {
+ registerWord = baseWord;
+ }
+ } else {
+ if (originalWord != smallWord) {
+ registerWord = smallWord;
+ }
+ }
+ if (registerWord) {
+ compressedCodeWord = this._convertToCompressionCode$S(originalWord);
+ stemmedList = this._stemmingResult[registerWord];
+ if (! stemmedList) {
+ stemmedList = [ compressedCodeWord ];
+ this._stemmingResult[registerWord] = stemmedList;
+ } else {
+ if (stemmedList.indexOf(compressedCodeWord) === -1) {
+ stemmedList.push(compressedCodeWord);
+ }
+ }
+ }
+ }
+};
+
+/**
+ * @param {!string} keyword
+ * @return {!string}
+ */
+Oktavia.prototype._convertToCompressionCode$S = function (keyword) {
+ /** @type {Array.<undefined|!string>} */
+ var resultChars;
+ /** @type {!number} */
+ var i;
+ /** @type {undefined|!string} */
+ var chr;
+ resultChars = [ ];
+ for (i = 0; i < keyword.length; i++) {
+ chr = this._utf162compressCode[keyword.charCodeAt(i)];
+ if (chr == null) {
+ resultChars.push(Oktavia.unknown);
+ } else {
+ resultChars.push(chr);
+ }
+ }
+ return resultChars.join('');
+};
+
+/**
+ * @param {!string} keyword
+ * @param {!boolean} stemming
+ * @return {Array.<undefined|!number>}
+ */
+Oktavia.prototype.rawSearch$SB = function (keyword, stemming) {
+ /** @type {Array.<undefined|!number>} */
+ var result;
+ /** @type {!string} */
+ var baseWord;
+ /** @type {Array.<undefined|!string>} */
+ var stemmedList;
+ /** @type {!number} */
+ var i;
+ /** @type {undefined|!string} */
+ var word;
+ if (stemming) {
+ result = [ ];
+ if (this._stemmer) {
+ baseWord = this._stemmer.stemWord$S(keyword.toLowerCase());
+ stemmedList = this._stemmingResult[baseWord];
+ if (stemmedList) {
+ for (i = 0; i < stemmedList.length; i++) {
+ word = stemmedList[i];
+ result = result.concat(this._fmindex.search$S(word));
+ }
+ }
+ }
+ } else {
+ result = this._fmindex.search$S(this._convertToCompressionCode$S(keyword));
+ }
+ return result;
+};
+
+/**
+ * @param {Array.<undefined|Query>} queries
+ * @return {SearchSummary}
+ */
+Oktavia.prototype.search$ALQuery$ = function (queries) {
+ /** @type {SearchSummary} */
+ var summary;
+ /** @type {!number} */
+ var i;
+ /** @type {SingleResult} */
+ var result$0;
+ summary = ({sourceResults: [ ], result: null, oktavia: this});
+ for (i = 0; i < queries.length; i++) {
+ result$0 = this._searchQuery$LQuery$(queries[i]);
+ summary.sourceResults.push(result$0);
+ }
+ summary.result = SearchSummary$mergeResult$LSearchSummary$ALSingleResult$(summary, summary.sourceResults);
+ return summary;
+};
+
+/**
+ * @param {Query} query
+ * @return {SingleResult}
+ */
+Oktavia.prototype._searchQuery$LQuery$ = function (query) {
+ /** @type {SingleResult} */
+ var result;
+ /** @type {Array.<undefined|!number>} */
+ var positions;
+ result = new SingleResult$SBB(query.word, query.or, query.not);
+ if (query.raw) {
+ positions = this.rawSearch$SB(query.word, false);
+ } else {
+ positions = this.rawSearch$SB(query.word, false).concat(this.rawSearch$SB(query.word, true));
+ }
+ this._metadatas[this._metadataLabels[0]].grouping$LSingleResult$AISB(result, positions, query.word, ! query.raw);
+ return result;
+};
+
+/**
+ */
+Oktavia.prototype.build$ = function () {
+ this.build$IB(5, false);
+};
+
+/**
+ * @param {!number} cacheDensity
+ * @param {!boolean} verbose
+ */
+Oktavia.prototype.build$IB = function (cacheDensity, verbose) {
+ /** @type {!string} */
+ var key;
+ /** @type {!number} */
+ var cacheRange;
+ /** @type {!number} */
+ var maxChar;
+ for (key in this._metadatas) {
+ this._metadatas[key]._build$();
+ }
+ cacheRange = Math.round(Math.max(1, 100 / Math.min(100, Math.max(0.01, cacheDensity))));
+ maxChar = this._compressCode2utf16.length;
+ this._fmindex.build$SIIB(Oktavia.eof, maxChar, cacheRange, verbose);
+};
+
+/**
+ * @return {!string}
+ */
+Oktavia.prototype.dump$ = function () {
+ return this.dump$B(false);
+};
+
+/**
+ * @param {!boolean} verbose
+ * @return {!string}
+ */
+Oktavia.prototype.dump$B = function (verbose) {
+ /** @type {!string} */
+ var header;
+ /** @type {!string} */
+ var fmdata;
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var i;
+ /** @type {CompressionReport} */
+ var report;
+ /** @type {undefined|!string} */
+ var name;
+ /** @type {!string} */
+ var data;
+ header = Binary$dumpString$SLCompressionReport$("oktavia-01", null).slice(1);
+ if (verbose) {
+ console.log("Source text size: " + (this._fmindex.size$() * 2 + "") + ' bytes');
+ }
+ fmdata = this._fmindex.dump$B(verbose);
+ result = [ header, fmdata ];
+ result.push(Binary$dump16bitNumber$I(this._compressCode2utf16.length));
+ for (i = 3; i < this._compressCode2utf16.length; i++) {
+ result.push(this._compressCode2utf16[i]);
+ }
+ if (verbose) {
+ console.log('Char Code Map: ' + (this._compressCode2utf16.length * 2 - 2 + "") + ' bytes');
+ }
+ report = ({source: 0, result: 0});
+ result.push(Binary$dumpStringListMap$HASLCompressionReport$(this._stemmingResult, report));
+ if (verbose) {
+ console.log('Stemmed Word Table: ' + (result[result.length - 1].length + "") + ' bytes (' + (Math.round(report.result * 100.0 / report.source) + "") + '%)');
+ }
+ result.push(Binary$dump16bitNumber$I(this._metadataLabels.length));
+ for (i = 0; i < this._metadataLabels.length; i++) {
+ report = ({source: 0, result: 0});
+ name = this._metadataLabels[i];
+ data = this._metadatas[name]._dump$LCompressionReport$(report);
+ result.push(Binary$dumpString$SLCompressionReport$(name, report), data);
+ if (verbose) {
+ console.log('Meta Data ' + name + ': ' + (data.length * 2 + "") + ' bytes (' + (Math.round(report.result * 100.0 / report.source) + "") + '%)');
+ }
+ }
+ return result.join('');
+};
+
+/**
+ * @param {!string} data
+ */
+Oktavia.prototype.load$S = function (data) {
+ /** @type {!string} */
+ var header;
+ /** @type {!number} */
+ var offset;
+ /** @type {!number} */
+ var charCodeCount;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var charCode;
+ /** @type {LoadedStringListMapResult} */
+ var stemmedWords;
+ /** @type {!number} */
+ var metadataCount;
+ /** @type {LoadedStringResult} */
+ var nameResult;
+ /** @type {!string} */
+ var name;
+ /** @type {!number} */
+ var type;
+ header = Binary$dumpString$SLCompressionReport$("oktavia-01", null).slice(1);
+ if (data.slice(0, 5) !== header) {
+ throw new Error('Invalid data file');
+ }
+ this._metadatas = ({ });
+ this._metadataLabels = [ ];
+ offset = 5;
+ offset = this._fmindex.load$SI(data, offset);
+ charCodeCount = Binary$load16bitNumber$SI(data, offset++);
+ this._compressCode2utf16 = [ Oktavia.eof, Oktavia.eob, Oktavia.unknown ];
+ this._utf162compressCode = [ Oktavia.eof, Oktavia.eob, Oktavia.unknown ];
+ for (i = 3; i < charCodeCount; i++) {
+ charCode = Binary$load16bitNumber$SI(data, offset++);
+ this._compressCode2utf16.push(String.fromCharCode(charCode));
+ this._utf162compressCode[charCode] = String.fromCharCode(i);
+ }
+ stemmedWords = Binary$loadStringListMap$SI(data, offset);
+ this._stemmingResult = stemmedWords.result;
+ offset = stemmedWords.offset;
+ metadataCount = Binary$load16bitNumber$SI(data, offset++);
+ for (i = 0; i < metadataCount; i++) {
+ nameResult = Binary$loadString$SI(data, offset);
+ name = nameResult.result;
+ offset = nameResult.offset;
+ type = Binary$load16bitNumber$SI(data, offset++);
+ switch (type) {
+ case 0:
+ offset = Section$_load$LOktavia$SSI(this, name, data, offset);
+ break;
+ case 1:
+ offset = Splitter$_load$LOktavia$SSI(this, name, data, offset);
+ break;
+ case 2:
+ offset = Table$_load$LOktavia$SSI(this, name, data, offset);
+ break;
+ case 3:
+ offset = Block$_load$LOktavia$SSI(this, name, data, offset);
+ break;
+ }
+ }
+};
+
+/**
+ * @return {!number}
+ */
+Oktavia.prototype.contentSize$ = function () {
+ /** @type {FMIndex} */
+ var this$0;
+ this$0 = this._fmindex;
+ return this$0._substr.length;
+};
+
+/**
+ * @param {!number} position
+ * @return {!number}
+ */
+Oktavia.prototype.wordPositionType$I = function (position) {
+ /** @type {!number} */
+ var result;
+ /** @type {!string} */
+ var ahead;
+ result = 0;
+ if (position === 0) {
+ result = 4;
+ } else {
+ ahead = this._fmindex.getSubstring$II(position - 1, 1);
+ if (/\s/.test(ahead)) {
+ result = 2;
+ } else {
+ if (/\W/.test(ahead)) {
+ result = 1;
+ } else {
+ if (Oktavia.eob === ahead) {
+ result = 3;
+ }
+ }
+ }
+ }
+ return (result | 0);
+};
+
+/**
+ * @param {!number} position
+ * @param {!number} length
+ * @return {!string}
+ */
+Oktavia.prototype._getSubstring$II = function (position, length) {
+ /** @type {!string} */
+ var result;
+ /** @type {Array.<undefined|!string>} */
+ var str;
+ /** @type {!number} */
+ var i;
+ result = this._fmindex.getSubstring$II(position, length);
+ str = [ ];
+ for (i = 0; i < result.length; i++) {
+ str.push(this._compressCode2utf16[result.charCodeAt(i)]);
+ }
+ return str.join('');
+};
+
+/**
+ * class Binary extends Object
+ * @constructor
+ */
+function Binary() {
+}
+
+/**
+ * @constructor
+ */
+function Binary$() {
+};
+
+Binary$.prototype = new Binary;
+
+/**
+ * @param {!number} num
+ * @return {!string}
+ */
+Binary.dump32bitNumber$N = function (num) {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ result = [ String.fromCharCode(Math.floor(num / 65536)) ];
+ result.push(String.fromCharCode(num % 65536));
+ return result.join("");
+};
+
+var Binary$dump32bitNumber$N = Binary.dump32bitNumber$N;
+
+/**
+ * @param {!string} buffer
+ * @param {!number} offset
+ * @return {!number}
+ */
+Binary.load32bitNumber$SI = function (buffer, offset) {
+ /** @type {!number} */
+ var result;
+ result = buffer.charCodeAt(offset) * 65536 + buffer.charCodeAt(offset + 1);
+ return result;
+};
+
+var Binary$load32bitNumber$SI = Binary.load32bitNumber$SI;
+
+/**
+ * @param {!number} num
+ * @return {!string}
+ */
+Binary.dump16bitNumber$I = function (num) {
+ return String.fromCharCode(num % 65536);
+};
+
+var Binary$dump16bitNumber$I = Binary.dump16bitNumber$I;
+
+/**
+ * @param {!string} buffer
+ * @param {!number} offset
+ * @return {!number}
+ */
+Binary.load16bitNumber$SI = function (buffer, offset) {
+ return (buffer.charCodeAt(offset) | 0);
+};
+
+var Binary$load16bitNumber$SI = Binary.load16bitNumber$SI;
+
+/**
+ * @param {!string} str
+ * @return {!string}
+ */
+Binary.dumpString$S = function (str) {
+ return Binary$dumpString$SLCompressionReport$(str, null);
+};
+
+var Binary$dumpString$S = Binary.dumpString$S;
+
+/**
+ * @param {!string} str
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+Binary.dumpString$SLCompressionReport$ = function (str, report) {
+ /** @type {!number} */
+ var length;
+ /** @type {!boolean} */
+ var compress;
+ /** @type {Array.<undefined|!number>} */
+ var charCodes;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var charCode;
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {undefined|!number} */
+ var bytes;
+ if (str.length > 32768) {
+ str = str.slice(0, 32768);
+ }
+ length = str.length;
+ compress = true;
+ charCodes = [ ];
+ for (i = 0; i < length; i++) {
+ charCode = str.charCodeAt(i);
+ if (charCode > 255) {
+ compress = false;
+ break;
+ }
+ charCodes.push(charCode);
+ }
+ if (compress) {
+ result = [ Binary$dump16bitNumber$I(length + 32768) ];
+ for (i = 0; i < length; i += 2) {
+ bytes = charCodes[i];
+ if (i !== length - 1) {
+ bytes += charCodes[i + 1] << 8;
+ }
+ result.push(String.fromCharCode(bytes % 65536));
+ }
+ if (report) {
+ CompressionReport$add$LCompressionReport$II(report, length, Math.ceil(length / 2));
+ }
+ } else {
+ result = [ Binary$dump16bitNumber$I(length), str ];
+ if (report) {
+ CompressionReport$add$LCompressionReport$II(report, length, length);
+ }
+ }
+ return result.join('');
+};
+
+var Binary$dumpString$SLCompressionReport$ = Binary.dumpString$SLCompressionReport$;
+
+/**
+ * @param {!string} buffer
+ * @param {!number} offset
+ * @return {LoadedStringResult}
+ */
+Binary.loadString$SI = function (buffer, offset) {
+ return new LoadedStringResult$SI(buffer, offset);
+};
+
+var Binary$loadString$SI = Binary.loadString$SI;
+
+/**
+ * @param {Array.<undefined|!string>} strList
+ * @return {!string}
+ */
+Binary.dumpStringList$AS = function (strList) {
+ return Binary$dumpStringList$ASLCompressionReport$(strList, null);
+};
+
+var Binary$dumpStringList$AS = Binary.dumpStringList$AS;
+
+/**
+ * @param {Array.<undefined|!string>} strList
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+Binary.dumpStringList$ASLCompressionReport$ = function (strList, report) {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var i;
+ result = [ Binary$dump32bitNumber$N(strList.length) ];
+ for (i = 0; i < strList.length; i++) {
+ result.push(Binary$dumpString$SLCompressionReport$(strList[i], report));
+ }
+ return result.join('');
+};
+
+var Binary$dumpStringList$ASLCompressionReport$ = Binary.dumpStringList$ASLCompressionReport$;
+
+/**
+ * @param {!string} buffer
+ * @param {!number} offset
+ * @return {LoadedStringListResult}
+ */
+Binary.loadStringList$SI = function (buffer, offset) {
+ return new LoadedStringListResult$SI(buffer, offset);
+};
+
+var Binary$loadStringList$SI = Binary.loadStringList$SI;
+
+/**
+ * @param {Object.<string, undefined|Array.<undefined|!string>>} strMap
+ * @return {!string}
+ */
+Binary.dumpStringListMap$HAS = function (strMap) {
+ return Binary$dumpStringListMap$HASLCompressionReport$(strMap, null);
+};
+
+var Binary$dumpStringListMap$HAS = Binary.dumpStringListMap$HAS;
+
+/**
+ * @param {Object.<string, undefined|Array.<undefined|!string>>} strMap
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+Binary.dumpStringListMap$HASLCompressionReport$ = function (strMap, report) {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var counter;
+ /** @type {!string} */
+ var key;
+ result = [ ];
+ counter = 0;
+ for (key in strMap) {
+ result.push(Binary$dumpString$SLCompressionReport$(key, report));
+ result.push(Binary$dumpStringList$ASLCompressionReport$(strMap[key], report));
+ counter++;
+ }
+ return Binary$dump32bitNumber$N(counter) + result.join('');
+};
+
+var Binary$dumpStringListMap$HASLCompressionReport$ = Binary.dumpStringListMap$HASLCompressionReport$;
+
+/**
+ * @param {!string} buffer
+ * @param {!number} offset
+ * @return {LoadedStringListMapResult}
+ */
+Binary.loadStringListMap$SI = function (buffer, offset) {
+ return new LoadedStringListMapResult$SI(buffer, offset);
+};
+
+var Binary$loadStringListMap$SI = Binary.loadStringListMap$SI;
+
+/**
+ * @param {Array.<undefined|!number>} array
+ * @return {!string}
+ */
+Binary.dump32bitNumberList$AN = function (array) {
+ return Binary$dump32bitNumberList$ANLCompressionReport$(array, null);
+};
+
+var Binary$dump32bitNumberList$AN = Binary.dump32bitNumberList$AN;
+
+/**
+ * @param {Array.<undefined|!number>} array
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+Binary.dump32bitNumberList$ANLCompressionReport$ = function (array, report) {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var index;
+ /** @type {!number} */
+ var inputLength;
+ /** @type {!number} */
+ var length;
+ /** @type {!string} */
+ var resultString;
+ /** @type {!number} */
+ var value1$0;
+ /** @type {!number} */
+ var value2$0;
+ result = [ Binary$dump32bitNumber$N(array.length) ];
+ index = 0;
+ inputLength = array.length;
+ while (index < inputLength) {
+ if (array[index] == 0) {
+ length = Binary$_countZero$ANI(array, index);
+ result.push(Binary$_zeroBlock$I(length));
+ index += length;
+ } else {
+ if (Binary$_shouldZebraCode$ANI(array, index)) {
+ result.push(Binary$_createZebraCode$ANI(array, index));
+ value1$0 = array.length;
+ value2$0 = index + 15;
+ index = (value1$0 <= value2$0 ? value1$0 : value2$0);
+ } else {
+ length = Binary$_searchDoubleZero$ANI(array, index);
+ result.push(Binary$_nonZeroBlock$ANII(array, index, length));
+ if (length === 0) {
+ throw new Error('');
+ }
+ index += length;
+ }
+ }
+ }
+ resultString = result.join('');
+ if (report) {
+ CompressionReport$add$LCompressionReport$II(report, array.length * 2 + 2, resultString.length);
+ }
+ return resultString;
+};
+
+var Binary$dump32bitNumberList$ANLCompressionReport$ = Binary.dump32bitNumberList$ANLCompressionReport$;
+
+/**
+ * @param {!string} buffer
+ * @param {!number} offset
+ * @return {LoadedNumberListResult}
+ */
+Binary.load32bitNumberList$SI = function (buffer, offset) {
+ return new LoadedNumberListResult$SI(buffer, offset);
+};
+
+var Binary$load32bitNumberList$SI = Binary.load32bitNumberList$SI;
+
+/**
+ * @param {Array.<undefined|!number>} array
+ * @param {!number} offset
+ * @return {!number}
+ */
+Binary._countZero$ANI = function (array, offset) {
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var array$len$0;
+ for ((i = offset, array$len$0 = array.length); i < array$len$0; i++) {
+ if (array[i] != 0) {
+ return (i - offset | 0);
+ }
+ }
+ return (array.length - offset | 0);
+};
+
+var Binary$_countZero$ANI = Binary._countZero$ANI;
+
+/**
+ * @param {!number} length
+ * @return {!string}
+ */
+Binary._zeroBlock$I = function (length) {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ result = [ ];
+ while (length > 0) {
+ if (length > 16384) {
+ result.push(Binary$dump16bitNumber$I(16383));
+ length -= 16384;
+ } else {
+ result.push(Binary$dump16bitNumber$I(length - 1));
+ length = 0;
+ }
+ }
+ return result.join('');
+};
+
+var Binary$_zeroBlock$I = Binary._zeroBlock$I;
+
+/**
+ * @param {Array.<undefined|!number>} array
+ * @param {!number} offset
+ * @return {!boolean}
+ */
+Binary._shouldZebraCode$ANI = function (array, offset) {
+ /** @type {!number} */
+ var change;
+ /** @type {!boolean} */
+ var isLastZero;
+ /** @type {!number} */
+ var i;
+ if (array.length - offset < 16) {
+ return true;
+ }
+ change = 0;
+ isLastZero = false;
+ for (i = offset; i < offset + 15; i++) {
+ if (array[i] == 0) {
+ if (! isLastZero) {
+ isLastZero = true;
+ change++;
+ }
+ } else {
+ if (isLastZero) {
+ isLastZero = false;
+ change++;
+ }
+ }
+ }
+ return change > 2;
+};
+
+var Binary$_shouldZebraCode$ANI = Binary._shouldZebraCode$ANI;
+
+/**
+ * @param {Array.<undefined|!number>} array
+ * @param {!number} offset
+ * @return {!number}
+ */
+Binary._searchDoubleZero$ANI = function (array, offset) {
+ /** @type {!boolean} */
+ var isLastZero;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var array$len$0;
+ isLastZero = false;
+ for ((i = offset, array$len$0 = array.length); i < array$len$0; i++) {
+ if (array[i] == 0) {
+ if (isLastZero) {
+ return (i - offset - 1 | 0);
+ }
+ isLastZero = true;
+ } else {
+ isLastZero = false;
+ }
+ }
+ return (array.length - offset | 0);
+};
+
+var Binary$_searchDoubleZero$ANI = Binary._searchDoubleZero$ANI;
+
+/**
+ * @param {Array.<undefined|!number>} array
+ * @param {!number} offset
+ * @param {!number} length
+ * @return {!string}
+ */
+Binary._nonZeroBlock$ANII = function (array, offset, length) {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var blockLength;
+ /** @type {!number} */
+ var i;
+ result = [ ];
+ while (length > 0) {
+ if (length > 16384) {
+ blockLength = 16384;
+ length -= 16384;
+ } else {
+ blockLength = length;
+ length = 0;
+ }
+ result.push(Binary$dump16bitNumber$I(blockLength - 1 + 0x4000));
+ for (i = offset; i < offset + blockLength; i++) {
+ result.push(Binary$dump32bitNumber$N(array[i]));
+ }
+ offset += blockLength;
+ }
+ return result.join('');
+};
+
+var Binary$_nonZeroBlock$ANII = Binary._nonZeroBlock$ANII;
+
+/**
+ * @param {Array.<undefined|!number>} array
+ * @param {!number} offset
+ * @return {!string}
+ */
+Binary._createZebraCode$ANI = function (array, offset) {
+ /** @type {!number} */
+ var last;
+ /** @type {!number} */
+ var code;
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var value1$0;
+ /** @type {!number} */
+ var value2$0;
+ value1$0 = offset + 15;
+ value2$0 = array.length;
+ last = (value1$0 <= value2$0 ? value1$0 : value2$0);
+ code = 0x8000;
+ result = [ ];
+ for (i = offset; i < last; i++) {
+ if (array[i] != 0) {
+ result.push(Binary$dump32bitNumber$N(array[i]));
+ code = code + (0x1 << i - offset);
+ }
+ }
+ return String.fromCharCode(code) + result.join('');
+};
+
+var Binary$_createZebraCode$ANI = Binary._createZebraCode$ANI;
+
+/**
+ * @param {!string} str
+ * @return {!string}
+ */
+Binary.base64encode$S = function (str) {
+ /** @type {Array.<undefined|!string>} */
+ var out;
+ /** @type {Array.<undefined|!number>} */
+ var source;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var code;
+ /** @type {!number} */
+ var len;
+ /** @type {!number} */
+ var c1;
+ /** @type {undefined|!number} */
+ var c2;
+ /** @type {undefined|!number} */
+ var c3;
+ out = [ ];
+ source = [ ];
+ for (i = 0; i < str.length; i++) {
+ code = str.charCodeAt(i);
+ source.push(code & 0x00ff, code >>> 8);
+ }
+ len = str.length * 2;
+ i = 0;
+ while (i < len) {
+ c1 = source[i++] & 0xff;
+ if (i === len) {
+ out.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(c1 >> 2));
+ out.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((c1 & 0x3) << 4));
+ out.push("==");
+ break;
+ }
+ c2 = source[i++];
+ if (i === len) {
+ out.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(c1 >> 2));
+ out.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((c1 & 0x3) << 4 | (c2 & 0xF0) >> 4));
+ out.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((c2 & 0xF) << 2));
+ out.push("=");
+ break;
+ }
+ c3 = source[i++];
+ out.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(c1 >> 2));
+ out.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((c1 & 0x3) << 4 | (c2 & 0xF0) >> 4));
+ out.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((c2 & 0xF) << 2 | (c3 & 0xC0) >> 6));
+ out.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(c3 & 0x3F));
+ }
+ return out.join('');
+};
+
+var Binary$base64encode$S = Binary.base64encode$S;
+
+/**
+ * @param {Array.<undefined|!number>} source
+ * @return {!string}
+ */
+Binary._mergeCharCode$AI = function (source) {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var i;
+ result = [ ];
+ for (i = 0; i < source.length; i += 2) {
+ result.push(String.fromCharCode(source[i] + (source[i + 1] << 8)));
+ }
+ return result.join('');
+};
+
+var Binary$_mergeCharCode$AI = Binary._mergeCharCode$AI;
+
+/**
+ * @param {!string} str
+ * @return {!string}
+ */
+Binary.base64decode$S = function (str) {
+ /** @type {!number} */
+ var len;
+ /** @type {!number} */
+ var i;
+ /** @type {Array.<undefined|!number>} */
+ var out;
+ /** @type {undefined|!number} */
+ var c1;
+ /** @type {undefined|!number} */
+ var c2;
+ /** @type {!number} */
+ var c3;
+ /** @type {!number} */
+ var c4;
+ len = str.length;
+ i = 0;
+ out = [ ];
+ while (i < len) {
+ do {
+ c1 = Binary._base64DecodeChars[str.charCodeAt(i++) & 0xff];
+ } while (i < len && c1 == -1);
+ if (c1 == -1) {
+ break;
+ }
+ do {
+ c2 = Binary._base64DecodeChars[str.charCodeAt(i++) & 0xff];
+ } while (i < len && c2 == -1);
+ if (c2 == -1) {
+ break;
+ }
+ out.push(c1 << 2 | (c2 & 0x30) >> 4);
+ do {
+ c3 = str.charCodeAt(i++) & 0xff;
+ if (c3 === 61) {
+ return Binary$_mergeCharCode$AI(out);
+ }
+ c3 = Binary._base64DecodeChars[c3];
+ } while (i < len && c3 === -1);
+ if (c3 === -1) {
+ break;
+ }
+ out.push((c2 & 0XF) << 4 | (c3 & 0x3C) >> 2);
+ do {
+ c4 = str.charCodeAt(i++) & 0xff;
+ if (c4 === 61) {
+ return Binary$_mergeCharCode$AI(out);
+ }
+ c4 = (Binary._base64DecodeChars[c4] | 0);
+ } while (i < len && c4 === -1);
+ if (c4 === -1) {
+ break;
+ }
+ out.push((c3 & 0x03) << 6 | c4);
+ }
+ return Binary$_mergeCharCode$AI(out);
+};
+
+var Binary$base64decode$S = Binary.base64decode$S;
+
+/**
+ * class LoadedStringResult extends Object
+ * @constructor
+ */
+function LoadedStringResult() {
+}
+
+/**
+ * @constructor
+ * @param {!string} data
+ * @param {!number} offset
+ */
+function LoadedStringResult$SI(data, offset) {
+ /** @type {!number} */
+ var strLength;
+ /** @type {Array.<undefined|!string>} */
+ var bytes;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var code;
+ /** @type {!number} */
+ var offset$0;
+ this.result = "";
+ this.offset = 0;
+ offset$0 = offset++;
+ strLength = data.charCodeAt(offset$0);
+ if (strLength > 32767) {
+ strLength = strLength - 32768;
+ bytes = [ ];
+ for (i = 0; i < strLength; i += 2) {
+ code = data.charCodeAt(offset);
+ bytes.push(String.fromCharCode(code & 0x00ff));
+ if (i !== strLength - 1) {
+ bytes.push(String.fromCharCode(code >>> 8));
+ }
+ offset++;
+ }
+ this.result = bytes.join('');
+ this.offset = offset;
+ } else {
+ this.result = data.slice(offset, offset + strLength);
+ this.offset = (offset + strLength | 0);
+ }
+};
+
+LoadedStringResult$SI.prototype = new LoadedStringResult;
+
+/**
+ * class LoadedStringListResult extends Object
+ * @constructor
+ */
+function LoadedStringListResult() {
+}
+
+/**
+ * @constructor
+ * @param {!string} data
+ * @param {!number} offset
+ */
+function LoadedStringListResult$SI(data, offset) {
+ /** @type {!number} */
+ var length;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var strLength;
+ /** @type {!string} */
+ var resultStr;
+ /** @type {Array.<undefined|!string>} */
+ var bytes;
+ /** @type {!number} */
+ var j;
+ /** @type {!number} */
+ var code;
+ /** @type {!number} */
+ var result$0;
+ /** @type {!number} */
+ var offset$0;
+ this.offset = 0;
+ this.result = [ ];
+ result$0 = data.charCodeAt(offset) * 65536 + data.charCodeAt(offset + 1);
+ length = result$0;
+ offset += 2;
+ for (i = 0; i < length; i++) {
+ offset$0 = offset++;
+ strLength = data.charCodeAt(offset$0);
+ if (strLength > 32767) {
+ strLength = strLength - 32768;
+ bytes = [ ];
+ for (j = 0; j < strLength; j += 2) {
+ code = data.charCodeAt(offset);
+ bytes.push(String.fromCharCode(code & 0x00ff));
+ if (j !== strLength - 1) {
+ bytes.push(String.fromCharCode(code >>> 8));
+ }
+ offset++;
+ }
+ resultStr = bytes.join('');
+ } else {
+ resultStr = data.slice(offset, offset + strLength);
+ offset = (offset + strLength | 0);
+ }
+ this.result.push(resultStr);
+ }
+ this.offset = offset;
+};
+
+LoadedStringListResult$SI.prototype = new LoadedStringListResult;
+
+/**
+ * class LoadedStringListMapResult extends Object
+ * @constructor
+ */
+function LoadedStringListMapResult() {
+}
+
+/**
+ * @constructor
+ * @param {!string} data
+ * @param {!number} offset
+ */
+function LoadedStringListMapResult$SI(data, offset) {
+ /** @type {!number} */
+ var length;
+ /** @type {!number} */
+ var i;
+ /** @type {LoadedStringResult} */
+ var keyResult;
+ /** @type {LoadedStringListResult} */
+ var valueResult;
+ /** @type {!number} */
+ var result$0;
+ /** @type {!number} */
+ var offset$0;
+ this.offset = 0;
+ this.result = ({ });
+ result$0 = data.charCodeAt(offset) * 65536 + data.charCodeAt(offset + 1);
+ length = result$0;
+ offset += 2;
+ for (i = 0; i < length; i++) {
+ keyResult = new LoadedStringResult$SI(data, offset);
+ offset$0 = keyResult.offset;
+ valueResult = new LoadedStringListResult$SI(data, offset$0);
+ this.result[keyResult.result] = valueResult.result;
+ offset = valueResult.offset;
+ }
+ this.offset = offset;
+};
+
+LoadedStringListMapResult$SI.prototype = new LoadedStringListMapResult;
+
+/**
+ * class LoadedNumberListResult extends Object
+ * @constructor
+ */
+function LoadedNumberListResult() {
+}
+
+/**
+ * @constructor
+ * @param {!string} data
+ * @param {!number} offset
+ */
+function LoadedNumberListResult$SI(data, offset) {
+ /** @type {!number} */
+ var resultLength;
+ /** @type {!number} */
+ var originalOffset;
+ /** @type {Array.<undefined|!number>} */
+ var result;
+ /** @type {!number} */
+ var tag;
+ /** @type {!number} */
+ var length;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var result$0;
+ /** @type {!number} */
+ var value1$0;
+ this.result = null;
+ this.offset = 0;
+ result$0 = data.charCodeAt(offset) * 65536 + data.charCodeAt(offset + 1);
+ resultLength = result$0;
+ originalOffset = offset;
+ offset += 2;
+ result = [ ];
+ while (result.length < resultLength) {
+ tag = data.charCodeAt(offset++);
+ if (tag >>> 15 === 1) {
+ value1$0 = resultLength - result.length;
+ length = (value1$0 <= 15 ? value1$0 : 15);
+ for (i = 0; i < length; i++) {
+ if (tag >>> i & 0x1) {
+ result.push(Binary$load32bitNumber$SI(data, offset));
+ offset += 2;
+ } else {
+ result.push(0);
+ }
+ }
+ } else {
+ if (tag >>> 14 === 1) {
+ length = tag - 0x4000 + 1;
+ for (i = 0; i < length; i++) {
+ result.push(Binary$load32bitNumber$SI(data, offset));
+ offset += 2;
+ }
+ } else {
+ length = tag + 1;
+ for (i = 0; i < length; i++) {
+ result.push(0);
+ }
+ }
+ }
+ }
+ this.result = result;
+ this.offset = offset;
+};
+
+LoadedNumberListResult$SI.prototype = new LoadedNumberListResult;
+
+/**
+ * class CompressionReport extends Object
+ * @constructor
+ */
+function CompressionReport() {
+}
+
+/**
+ * @constructor
+ */
+function CompressionReport$() {
+ this.source = 0;
+ this.result = 0;
+};
+
+CompressionReport$.prototype = new CompressionReport;
+
+/**
+ * @param {CompressionReport} $this
+ * @param {!number} source
+ * @param {!number} result
+ */
+CompressionReport.add$LCompressionReport$II = function ($this, source, result) {
+ $this.source += source;
+ $this.result += result;
+};
+
+var CompressionReport$add$LCompressionReport$II = CompressionReport.add$LCompressionReport$II;
+
+/**
+ * @param {CompressionReport} $this
+ * @return {!number}
+ */
+CompressionReport.rate$LCompressionReport$ = function ($this) {
+ return (Math.round($this.result * 100.0 / $this.source) | 0);
+};
+
+var CompressionReport$rate$LCompressionReport$ = CompressionReport.rate$LCompressionReport$;
+
+/**
+ * class Query extends Object
+ * @constructor
+ */
+function Query() {
+}
+
+/**
+ * @constructor
+ */
+function Query$() {
+ this.word = '';
+ this.or = false;
+ this.not = false;
+ this.raw = false;
+};
+
+Query$.prototype = new Query;
+
+/**
+ * @return {!string}
+ */
+Query.prototype.toString = function () {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ result = [ ];
+ if (this.or) {
+ result.push("OR ");
+ }
+ if (this.not) {
+ result.push("-");
+ }
+ if (this.raw) {
+ result.push('"', this.word, '"');
+ } else {
+ result.push(this.word);
+ }
+ return result.join('');
+};
+
+/**
+ * class QueryStringParser extends Object
+ * @constructor
+ */
+function QueryStringParser() {
+}
+
+/**
+ * @constructor
+ */
+function QueryStringParser$() {
+ this.queries = [ ];
+};
+
+QueryStringParser$.prototype = new QueryStringParser;
+
+/**
+ * @param {QueryStringParser} $this
+ * @param {!string} queryString
+ * @return {Array.<undefined|Query>}
+ */
+QueryStringParser.parse$LQueryStringParser$S = function ($this, queryString) {
+ /** @type {!boolean} */
+ var nextOr;
+ /** @type {!boolean} */
+ var nextNot;
+ /** @type {!number} */
+ var currentWordStart;
+ /** @type {!number} */
+ var status;
+ /** @type {RegExp} */
+ var isSpace;
+ /** @type {!number} */
+ var i;
+ /** @type {!string} */
+ var ch;
+ /** @type {!string} */
+ var word;
+ /** @type {Query} */
+ var query;
+ nextOr = false;
+ nextNot = false;
+ currentWordStart = 0;
+ status = 0;
+ isSpace = /[\s\u3000]/;
+ for (i = 0; i < queryString.length; i++) {
+ ch = queryString.charAt(i);
+ switch (status) {
+ case 0:
+ if (! isSpace.test(ch)) {
+ if (ch === '-') {
+ nextNot = true;
+ } else {
+ if (ch === '"') {
+ currentWordStart = i + 1;
+ status = 2;
+ } else {
+ currentWordStart = i;
+ status = 1;
+ }
+ }
+ } else {
+ nextNot = false;
+ }
+ break;
+ case 1:
+ if (isSpace.test(ch)) {
+ word = queryString.slice(currentWordStart, i);
+ if (word === 'OR') {
+ nextOr = true;
+ } else {
+ query = new Query$();
+ query.word = word;
+ query.or = nextOr;
+ query.not = nextNot;
+ $this.queries.push(query);
+ nextOr = false;
+ nextNot = false;
+ }
+ status = 0;
+ }
+ break;
+ case 2:
+ if (ch === '"') {
+ word = queryString.slice(currentWordStart, i);
+ query = new Query$();
+ query.word = word;
+ query.or = nextOr;
+ query.not = nextNot;
+ query.raw = true;
+ $this.queries.push(query);
+ nextOr = false;
+ nextNot = false;
+ status = 0;
+ }
+ break;
+ }
+ }
+ switch (status) {
+ case 0:
+ break;
+ case 1:
+ query = new Query$();
+ word = queryString.slice(currentWordStart, queryString.length);
+ if (word !== 'OR') {
+ query.word = word;
+ query.or = nextOr;
+ query.not = nextNot;
+ $this.queries.push(query);
+ }
+ break;
+ case 2:
+ query = new Query$();
+ query.word = queryString.slice(currentWordStart, queryString.length);
+ query.or = nextOr;
+ query.not = nextNot;
+ query.raw = true;
+ $this.queries.push(query);
+ break;
+ }
+ return $this.queries;
+};
+
+var QueryStringParser$parse$LQueryStringParser$S = QueryStringParser.parse$LQueryStringParser$S;
+
+/**
+ * @param {QueryStringParser} $this
+ * @return {!string}
+ */
+QueryStringParser.highlight$LQueryStringParser$ = function ($this) {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var i;
+ /** @type {Query} */
+ var query;
+ result = [ ];
+ for (i = 0; i < $this.queries.length; i++) {
+ query = $this.queries[i];
+ if (! query.not) {
+ result.push("highlight=" + $__jsx_encodeURIComponent(query.word));
+ }
+ }
+ return '?' + result.join('&');
+};
+
+var QueryStringParser$highlight$LQueryStringParser$ = QueryStringParser.highlight$LQueryStringParser$;
+
+/**
+ * class Proposal extends Object
+ * @constructor
+ */
+function Proposal() {
+}
+
+/**
+ * @constructor
+ * @param {!number} omit
+ * @param {!number} expect
+ */
+function Proposal$II(omit, expect) {
+ this.omit = omit;
+ this.expect = expect;
+};
+
+Proposal$II.prototype = new Proposal;
+
+/**
+ * class Position extends Object
+ * @constructor
+ */
+function Position() {
+}
+
+/**
+ * @constructor
+ * @param {!string} word
+ * @param {!number} position
+ * @param {!boolean} stemmed
+ */
+function Position$SIB(word, position, stemmed) {
+ this.word = word;
+ this.position = position;
+ this.stemmed = stemmed;
+};
+
+Position$SIB.prototype = new Position;
+
+/**
+ * class SearchUnit extends Object
+ * @constructor
+ */
+function SearchUnit() {
+}
+
+/**
+ * @constructor
+ * @param {!number} id
+ */
+function SearchUnit$I(id) {
+ this.positions = ({ });
+ this.id = id;
+ this._size = 0;
+ this.score = 0;
+ this.startPosition = -1;
+};
+
+SearchUnit$I.prototype = new SearchUnit;
+
+/**
+ * @param {SearchUnit} $this
+ * @param {!string} word
+ * @param {!number} position
+ * @param {!boolean} stemmed
+ */
+SearchUnit.addPosition$LSearchUnit$SIB = function ($this, word, position, stemmed) {
+ /** @type {Position} */
+ var positionObj;
+ positionObj = $this.positions[position + ""];
+ if (! positionObj) {
+ $this._size++;
+ $this.positions[position + ""] = ({word: word, position: position, stemmed: stemmed});
+ } else {
+ if (positionObj.word.length < word.length) {
+ positionObj.word = word;
+ }
+ positionObj.stemmed = positionObj.stemmed && stemmed;
+ }
+};
+
+var SearchUnit$addPosition$LSearchUnit$SIB = SearchUnit.addPosition$LSearchUnit$SIB;
+
+/**
+ * @param {SearchUnit} $this
+ * @param {!number} position
+ * @return {Position}
+ */
+SearchUnit.get$LSearchUnit$I = function ($this, position) {
+ return $this.positions[position + ""];
+};
+
+var SearchUnit$get$LSearchUnit$I = SearchUnit.get$LSearchUnit$I;
+
+/**
+ * @param {SearchUnit} $this
+ * @return {!number}
+ */
+SearchUnit.size$LSearchUnit$ = function ($this) {
+ return $this._size;
+};
+
+var SearchUnit$size$LSearchUnit$ = SearchUnit.size$LSearchUnit$;
+
+/**
+ * @param {SearchUnit} $this
+ * @param {SearchUnit} rhs
+ */
+SearchUnit.merge$LSearchUnit$LSearchUnit$ = function ($this, rhs) {
+ /** @type {!string} */
+ var position;
+ /** @type {Position} */
+ var pos;
+ for (position in rhs.positions) {
+ pos = rhs.positions[position];
+ SearchUnit$addPosition$LSearchUnit$SIB($this, pos.word, pos.position, pos.stemmed);
+ }
+};
+
+var SearchUnit$merge$LSearchUnit$LSearchUnit$ = SearchUnit.merge$LSearchUnit$LSearchUnit$;
+
+/**
+ * @param {SearchUnit} $this
+ * @return {Array.<undefined|Position>}
+ */
+SearchUnit.getPositions$LSearchUnit$ = function ($this) {
+ /** @type {Array.<undefined|Position>} */
+ var result;
+ /** @type {!string} */
+ var pos;
+ result = [ ];
+ for (pos in $this.positions) {
+ result.push($this.positions[pos]);
+ }
+ result.sort((function (a, b) {
+ return a.position - b.position;
+ }));
+ return result;
+};
+
+var SearchUnit$getPositions$LSearchUnit$ = SearchUnit.getPositions$LSearchUnit$;
+
+/**
+ * class SingleResult extends Object
+ * @constructor
+ */
+function SingleResult() {
+}
+
+/**
+ * @constructor
+ */
+function SingleResult$() {
+ this.units = [ ];
+ this.unitIds = [ ];
+ this.or = false;
+ this.not = false;
+ this.searchWord = '';
+};
+
+SingleResult$.prototype = new SingleResult;
+
+/**
+ * @constructor
+ * @param {!string} searchWord
+ * @param {!boolean} or
+ * @param {!boolean} not
+ */
+function SingleResult$SBB(searchWord, or, not) {
+ this.units = [ ];
+ this.unitIds = [ ];
+ this.or = or;
+ this.not = not;
+ this.searchWord = searchWord;
+};
+
+SingleResult$SBB.prototype = new SingleResult;
+
+/**
+ * @param {SingleResult} $this
+ * @param {!number} unitId
+ * @return {SearchUnit}
+ */
+SingleResult.getSearchUnit$LSingleResult$I = function ($this, unitId) {
+ /** @type {!number} */
+ var existing;
+ /** @type {SearchUnit} */
+ var result;
+ existing = $this.unitIds.indexOf(unitId);
+ if (existing === -1) {
+ result = ({positions: ({ }), id: unitId, _size: 0, score: 0, startPosition: -1});
+ $this.units.push(result);
+ $this.unitIds.push(unitId);
+ } else {
+ result = $this.units[existing];
+ }
+ return result;
+};
+
+var SingleResult$getSearchUnit$LSingleResult$I = SingleResult.getSearchUnit$LSingleResult$I;
+
+/**
+ * @param {SingleResult} $this
+ * @param {SingleResult} rhs
+ * @return {SingleResult}
+ */
+SingleResult.merge$LSingleResult$LSingleResult$ = function ($this, rhs) {
+ /** @type {SingleResult} */
+ var result;
+ result = ({units: [ ], unitIds: [ ], or: false, not: false, searchWord: ''});
+ if (rhs.or) {
+ SingleResult$_orMerge$LSingleResult$LSingleResult$LSingleResult$($this, result, rhs);
+ } else {
+ if (rhs.not) {
+ SingleResult$_notMerge$LSingleResult$LSingleResult$LSingleResult$($this, result, rhs);
+ } else {
+ SingleResult$_andMerge$LSingleResult$LSingleResult$LSingleResult$($this, result, rhs);
+ }
+ }
+ return result;
+};
+
+var SingleResult$merge$LSingleResult$LSingleResult$ = SingleResult.merge$LSingleResult$LSingleResult$;
+
+/**
+ * @param {SingleResult} $this
+ * @return {!number}
+ */
+SingleResult.size$LSingleResult$ = function ($this) {
+ return ($this.units.length | 0);
+};
+
+var SingleResult$size$LSingleResult$ = SingleResult.size$LSingleResult$;
+
+/**
+ * @param {SingleResult} $this
+ * @param {SingleResult} result
+ * @param {SingleResult} rhs
+ */
+SingleResult._andMerge$LSingleResult$LSingleResult$LSingleResult$ = function ($this, result, rhs) {
+ /** @type {!number} */
+ var i;
+ /** @type {undefined|!number} */
+ var id;
+ /** @type {SearchUnit} */
+ var lhsSection;
+ for (i = 0; i < $this.unitIds.length; i++) {
+ id = $this.unitIds[i];
+ if (rhs.unitIds.indexOf(id) !== -1) {
+ lhsSection = $this.units[i];
+ result.unitIds.push(id);
+ result.units.push(lhsSection);
+ }
+ }
+};
+
+var SingleResult$_andMerge$LSingleResult$LSingleResult$LSingleResult$ = SingleResult._andMerge$LSingleResult$LSingleResult$LSingleResult$;
+
+/**
+ * @param {SingleResult} $this
+ * @param {SingleResult} result
+ * @param {SingleResult} rhs
+ */
+SingleResult._orMerge$LSingleResult$LSingleResult$LSingleResult$ = function ($this, result, rhs) {
+ /** @type {!number} */
+ var i;
+ /** @type {undefined|!number} */
+ var id;
+ /** @type {SearchUnit} */
+ var rhsSection;
+ /** @type {SearchUnit} */
+ var lhsSection;
+ /** @type {Array.<undefined|!number>} */
+ var unitIds$0;
+ /** @type {Array.<undefined|SearchUnit>} */
+ var units$0;
+ result.unitIds = (unitIds$0 = $this.unitIds).slice(0, unitIds$0.length);
+ result.units = (units$0 = $this.units).slice(0, units$0.length);
+ for (i = 0; i < rhs.unitIds.length; i++) {
+ id = rhs.unitIds[i];
+ rhsSection = rhs.units[i];
+ if (result.unitIds.indexOf(id) !== -1) {
+ lhsSection = result.units[result.unitIds.indexOf(id)];
+ SearchUnit$merge$LSearchUnit$LSearchUnit$(lhsSection, rhsSection);
+ } else {
+ result.unitIds.push(id);
+ result.units.push(rhsSection);
+ }
+ }
+};
+
+var SingleResult$_orMerge$LSingleResult$LSingleResult$LSingleResult$ = SingleResult._orMerge$LSingleResult$LSingleResult$LSingleResult$;
+
+/**
+ * @param {SingleResult} $this
+ * @param {SingleResult} result
+ * @param {SingleResult} rhs
+ */
+SingleResult._notMerge$LSingleResult$LSingleResult$LSingleResult$ = function ($this, result, rhs) {
+ /** @type {!number} */
+ var i;
+ /** @type {undefined|!number} */
+ var id;
+ /** @type {SearchUnit} */
+ var lhsSection;
+ for (i = 0; i < $this.unitIds.length; i++) {
+ id = $this.unitIds[i];
+ if (rhs.unitIds.indexOf(id) === -1) {
+ lhsSection = $this.units[i];
+ result.unitIds.push(id);
+ result.units.push(lhsSection);
+ }
+ }
+};
+
+var SingleResult$_notMerge$LSingleResult$LSingleResult$LSingleResult$ = SingleResult._notMerge$LSingleResult$LSingleResult$LSingleResult$;
+
+/**
+ * class SearchSummary extends Object
+ * @constructor
+ */
+function SearchSummary() {
+}
+
+/**
+ * @constructor
+ */
+function SearchSummary$() {
+ this.sourceResults = [ ];
+ this.result = null;
+ this.oktavia = null;
+};
+
+SearchSummary$.prototype = new SearchSummary;
+
+/**
+ * @constructor
+ * @param {Oktavia} oktavia
+ */
+function SearchSummary$LOktavia$(oktavia) {
+ this.sourceResults = [ ];
+ this.result = null;
+ this.oktavia = oktavia;
+};
+
+SearchSummary$LOktavia$.prototype = new SearchSummary;
+
+/**
+ * @param {SearchSummary} $this
+ * @param {SingleResult} result
+ */
+SearchSummary.addQuery$LSearchSummary$LSingleResult$ = function ($this, result) {
+ $this.sourceResults.push(result);
+};
+
+var SearchSummary$addQuery$LSearchSummary$LSingleResult$ = SearchSummary.addQuery$LSearchSummary$LSingleResult$;
+
+/**
+ * @param {SearchSummary} $this
+ */
+SearchSummary.mergeResult$LSearchSummary$ = function ($this) {
+ $this.result = SearchSummary$mergeResult$LSearchSummary$ALSingleResult$($this, $this.sourceResults);
+};
+
+var SearchSummary$mergeResult$LSearchSummary$ = SearchSummary.mergeResult$LSearchSummary$;
+
+/**
+ * @param {SearchSummary} $this
+ * @param {Array.<undefined|SingleResult>} results
+ * @return {SingleResult}
+ */
+SearchSummary.mergeResult$LSearchSummary$ALSingleResult$ = function ($this, results) {
+ /** @type {SingleResult} */
+ var rhs;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var results$len$0;
+ rhs = results[0];
+ for ((i = 1, results$len$0 = results.length); i < results$len$0; i++) {
+ rhs = SingleResult$merge$LSingleResult$LSingleResult$(rhs, results[i]);
+ }
+ return rhs;
+};
+
+var SearchSummary$mergeResult$LSearchSummary$ALSingleResult$ = SearchSummary.mergeResult$LSearchSummary$ALSingleResult$;
+
+/**
+ * @param {SearchSummary} $this
+ * @return {Array.<undefined|Proposal>}
+ */
+SearchSummary.getProposal$LSearchSummary$ = function ($this) {
+ /** @type {Array.<undefined|Proposal>} */
+ var proposals;
+ /** @type {!number} */
+ var i;
+ /** @type {Array.<undefined|SingleResult>} */
+ var tmpSource;
+ /** @type {!number} */
+ var j;
+ /** @type {SingleResult} */
+ var result;
+ proposals = [ ];
+ for (i = 0; i < $this.sourceResults.length; i++) {
+ tmpSource = [ ];
+ for (j = 0; j < $this.sourceResults.length; j++) {
+ if (i !== j) {
+ tmpSource.push($this.sourceResults[j]);
+ }
+ }
+ result = SearchSummary$mergeResult$LSearchSummary$ALSingleResult$($this, tmpSource);
+ proposals.push(({omit: i, expect: result.units.length}));
+ }
+ proposals.sort((function (a, b) {
+ return b.expect - a.expect;
+ }));
+ return proposals;
+};
+
+var SearchSummary$getProposal$LSearchSummary$ = SearchSummary.getProposal$LSearchSummary$;
+
+/**
+ * @param {SearchSummary} $this
+ * @return {Array.<undefined|SearchUnit>}
+ */
+SearchSummary.getSortedResult$LSearchSummary$ = function ($this) {
+ /** @type {Array.<undefined|SearchUnit>} */
+ var result;
+ /** @type {Array.<undefined|SearchUnit>} */
+ var units$0;
+ result = (units$0 = $this.result.units).slice(0, units$0.length);
+ result.sort((function (a, b) {
+ return b.score - a.score;
+ }));
+ return result;
+};
+
+var SearchSummary$getSortedResult$LSearchSummary$ = SearchSummary.getSortedResult$LSearchSummary$;
+
+/**
+ * @param {SearchSummary} $this
+ * @return {!number}
+ */
+SearchSummary.size$LSearchSummary$ = function ($this) {
+ /** @type {SingleResult} */
+ var this$0;
+ this$0 = $this.result;
+ return (this$0.units.length | 0);
+};
+
+var SearchSummary$size$LSearchSummary$ = SearchSummary.size$LSearchSummary$;
+
+/**
+ * @param {SearchSummary} $this
+ * @param {SingleResult} result
+ */
+SearchSummary.add$LSearchSummary$LSingleResult$ = function ($this, result) {
+ $this.sourceResults.push(result);
+};
+
+var SearchSummary$add$LSearchSummary$LSingleResult$ = SearchSummary.add$LSearchSummary$LSingleResult$;
+
+/**
+ * class Style extends Object
+ * @constructor
+ */
+function Style() {
+}
+
+/**
+ * @constructor
+ * @param {!string} mode
+ */
+function Style$S(mode) {
+ this.styles = null;
+ this.escapeHTML = false;
+ switch (mode) {
+ case 'console':
+ this.styles = Style.console;
+ break;
+ case 'html':
+ this.styles = Style.html;
+ break;
+ case 'ignore':
+ this.styles = Style.ignore;
+ break;
+ default:
+ this.styles = Style.ignore;
+ break;
+ }
+ this.escapeHTML = mode === 'html';
+};
+
+Style$S.prototype = new Style;
+
+/**
+ * @param {!string} source
+ * @return {!string}
+ */
+Style.prototype.convert$S = function (source) {
+ /** @type {_HTMLHandler} */
+ var handler;
+ /** @type {SAXParser} */
+ var parser;
+ handler = new _HTMLHandler$HASB(this.styles, this.escapeHTML);
+ parser = new SAXParser$LSAXHandler$(handler);
+ parser.parse$S(source);
+ return handler.text.join('');
+};
+
+/**
+ * class Stemmer
+ * @constructor
+ */
+function Stemmer() {
+}
+
+Stemmer.prototype.$__jsx_implements_Stemmer = true;
+
+/**
+ * @constructor
+ */
+function Stemmer$() {
+};
+
+Stemmer$.prototype = new Stemmer;
+
+/**
+ * class BaseStemmer extends Object
+ * @constructor
+ */
+function BaseStemmer() {
+}
+
+$__jsx_merge_interface(BaseStemmer, Stemmer);
+
+/**
+ * @constructor
+ */
+function BaseStemmer$() {
+ /** @type {!string} */
+ var current$0;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var limit$0;
+ this.cache = ({ });
+ current$0 = this.current = "";
+ cursor$0 = this.cursor = 0;
+ limit$0 = this.limit = current$0.length;
+ this.limit_backward = 0;
+ this.bra = cursor$0;
+ this.ket = limit$0;
+};
+
+BaseStemmer$.prototype = new BaseStemmer;
+
+/**
+ * @param {!string} value
+ */
+BaseStemmer.prototype.setCurrent$S = function (value) {
+ /** @type {!string} */
+ var current$0;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var limit$0;
+ current$0 = this.current = value;
+ cursor$0 = this.cursor = 0;
+ limit$0 = this.limit = current$0.length;
+ this.limit_backward = 0;
+ this.bra = cursor$0;
+ this.ket = limit$0;
+};
+
+/**
+ * @return {!string}
+ */
+BaseStemmer.prototype.getCurrent$ = function () {
+ return this.current;
+};
+
+/**
+ * @param {BaseStemmer} other
+ */
+BaseStemmer.prototype.copy_from$LBaseStemmer$ = function (other) {
+ this.current = other.current;
+ this.cursor = other.cursor;
+ this.limit = other.limit;
+ this.limit_backward = other.limit_backward;
+ this.bra = other.bra;
+ this.ket = other.ket;
+};
+
+/**
+ * @param {Array.<undefined|!number>} s
+ * @param {!number} min
+ * @param {!number} max
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.in_grouping$AIII = function (s, min, max) {
+ /** @type {!number} */
+ var ch;
+ if (this.cursor >= this.limit) {
+ return false;
+ }
+ ch = this.current.charCodeAt(this.cursor);
+ if (ch > max || ch < min) {
+ return false;
+ }
+ ch -= min;
+ if ((s[ch >>> 3] & 0x1 << (ch & 0x7)) === 0) {
+ return false;
+ }
+ this.cursor++;
+ return true;
+};
+
+/**
+ * @param {Array.<undefined|!number>} s
+ * @param {!number} min
+ * @param {!number} max
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.in_grouping_b$AIII = function (s, min, max) {
+ /** @type {!number} */
+ var ch;
+ if (this.cursor <= this.limit_backward) {
+ return false;
+ }
+ ch = this.current.charCodeAt(this.cursor - 1);
+ if (ch > max || ch < min) {
+ return false;
+ }
+ ch -= min;
+ if ((s[ch >>> 3] & 0x1 << (ch & 0x7)) === 0) {
+ return false;
+ }
+ this.cursor--;
+ return true;
+};
+
+/**
+ * @param {Array.<undefined|!number>} s
+ * @param {!number} min
+ * @param {!number} max
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.out_grouping$AIII = function (s, min, max) {
+ /** @type {!number} */
+ var ch;
+ if (this.cursor >= this.limit) {
+ return false;
+ }
+ ch = this.current.charCodeAt(this.cursor);
+ if (ch > max || ch < min) {
+ this.cursor++;
+ return true;
+ }
+ ch -= min;
+ if ((s[ch >>> 3] & 0X1 << (ch & 0x7)) === 0) {
+ this.cursor++;
+ return true;
+ }
+ return false;
+};
+
+/**
+ * @param {Array.<undefined|!number>} s
+ * @param {!number} min
+ * @param {!number} max
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.out_grouping_b$AIII = function (s, min, max) {
+ /** @type {!number} */
+ var ch;
+ if (this.cursor <= this.limit_backward) {
+ return false;
+ }
+ ch = this.current.charCodeAt(this.cursor - 1);
+ if (ch > max || ch < min) {
+ this.cursor--;
+ return true;
+ }
+ ch -= min;
+ if ((s[ch >>> 3] & 0x1 << (ch & 0x7)) === 0) {
+ this.cursor--;
+ return true;
+ }
+ return false;
+};
+
+/**
+ * @param {!number} min
+ * @param {!number} max
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.in_range$II = function (min, max) {
+ /** @type {!number} */
+ var ch;
+ if (this.cursor >= this.limit) {
+ return false;
+ }
+ ch = this.current.charCodeAt(this.cursor);
+ if (ch > max || ch < min) {
+ return false;
+ }
+ this.cursor++;
+ return true;
+};
+
+/**
+ * @param {!number} min
+ * @param {!number} max
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.in_range_b$II = function (min, max) {
+ /** @type {!number} */
+ var ch;
+ if (this.cursor <= this.limit_backward) {
+ return false;
+ }
+ ch = this.current.charCodeAt(this.cursor - 1);
+ if (ch > max || ch < min) {
+ return false;
+ }
+ this.cursor--;
+ return true;
+};
+
+/**
+ * @param {!number} min
+ * @param {!number} max
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.out_range$II = function (min, max) {
+ /** @type {!number} */
+ var ch;
+ if (this.cursor >= this.limit) {
+ return false;
+ }
+ ch = this.current.charCodeAt(this.cursor);
+ if (! (ch > max || ch < min)) {
+ return false;
+ }
+ this.cursor++;
+ return true;
+};
+
+/**
+ * @param {!number} min
+ * @param {!number} max
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.out_range_b$II = function (min, max) {
+ /** @type {!number} */
+ var ch;
+ if (this.cursor <= this.limit_backward) {
+ return false;
+ }
+ ch = this.current.charCodeAt(this.cursor - 1);
+ if (! (ch > max || ch < min)) {
+ return false;
+ }
+ this.cursor--;
+ return true;
+};
+
+/**
+ * @param {!number} s_size
+ * @param {!string} s
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.eq_s$IS = function (s_size, s) {
+ /** @type {!number} */
+ var cursor$0;
+ if (this.limit - this.cursor < s_size) {
+ return false;
+ }
+ if (this.current.slice(cursor$0 = this.cursor, cursor$0 + s_size) !== s) {
+ return false;
+ }
+ this.cursor += s_size;
+ return true;
+};
+
+/**
+ * @param {!number} s_size
+ * @param {!string} s
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.eq_s_b$IS = function (s_size, s) {
+ /** @type {!number} */
+ var cursor$0;
+ if (this.cursor - this.limit_backward < s_size) {
+ return false;
+ }
+ if (this.current.slice((cursor$0 = this.cursor) - s_size, cursor$0) !== s) {
+ return false;
+ }
+ this.cursor -= s_size;
+ return true;
+};
+
+/**
+ * @param {!string} s
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.eq_v$S = function (s) {
+ return this.eq_s$IS(s.length, s);
+};
+
+/**
+ * @param {!string} s
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.eq_v_b$S = function (s) {
+ return this.eq_s_b$IS(s.length, s);
+};
+
+/**
+ * @param {Array.<undefined|Among>} v
+ * @param {!number} v_size
+ * @return {!number}
+ */
+BaseStemmer.prototype.find_among$ALAmong$I = function (v, v_size) {
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var j;
+ /** @type {!number} */
+ var c;
+ /** @type {!number} */
+ var l;
+ /** @type {!number} */
+ var common_i;
+ /** @type {!number} */
+ var common_j;
+ /** @type {!boolean} */
+ var first_key_inspected;
+ /** @type {!number} */
+ var k;
+ /** @type {!number} */
+ var diff;
+ /** @type {!number} */
+ var common;
+ /** @type {Among} */
+ var w;
+ /** @type {!number} */
+ var i2;
+ /** @type {!boolean} */
+ var res;
+ i = 0;
+ j = v_size;
+ c = this.cursor;
+ l = this.limit;
+ common_i = 0;
+ common_j = 0;
+ first_key_inspected = false;
+ while (true) {
+ k = i + (j - i >>> 1);
+ diff = 0;
+ common = (common_i < common_j ? common_i : common_j);
+ w = v[k];
+ for (i2 = common; i2 < w.s_size; i2++) {
+ if (c + common === l) {
+ diff = -1;
+ break;
+ }
+ diff = this.current.charCodeAt(c + common) - w.s.charCodeAt(i2);
+ if (diff !== 0) {
+ break;
+ }
+ common++;
+ }
+ if (diff < 0) {
+ j = k;
+ common_j = common;
+ } else {
+ i = k;
+ common_i = common;
+ }
+ if (j - i <= 1) {
+ if (i > 0) {
+ break;
+ }
+ if (j === i) {
+ break;
+ }
+ if (first_key_inspected) {
+ break;
+ }
+ first_key_inspected = true;
+ }
+ }
+ while (true) {
+ w = v[i];
+ if (common_i >= w.s_size) {
+ this.cursor = (c + w.s_size | 0);
+ if (w.method == null) {
+ return w.result;
+ }
+ res = w.method(w.instance);
+ this.cursor = (c + w.s_size | 0);
+ if (res) {
+ return w.result;
+ }
+ }
+ i = w.substring_i;
+ if (i < 0) {
+ return 0;
+ }
+ }
+ return -1;
+};
+
+/**
+ * @param {Array.<undefined|Among>} v
+ * @param {!number} v_size
+ * @return {!number}
+ */
+BaseStemmer.prototype.find_among_b$ALAmong$I = function (v, v_size) {
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var j;
+ /** @type {!number} */
+ var c;
+ /** @type {!number} */
+ var lb;
+ /** @type {!number} */
+ var common_i;
+ /** @type {!number} */
+ var common_j;
+ /** @type {!boolean} */
+ var first_key_inspected;
+ /** @type {!number} */
+ var k;
+ /** @type {!number} */
+ var diff;
+ /** @type {!number} */
+ var common;
+ /** @type {Among} */
+ var w;
+ /** @type {!number} */
+ var i2;
+ /** @type {!boolean} */
+ var res;
+ i = 0;
+ j = v_size;
+ c = this.cursor;
+ lb = this.limit_backward;
+ common_i = 0;
+ common_j = 0;
+ first_key_inspected = false;
+ while (true) {
+ k = i + (j - i >> 1);
+ diff = 0;
+ common = (common_i < common_j ? common_i : common_j);
+ w = v[k];
+ for (i2 = w.s_size - 1 - common; i2 >= 0; i2--) {
+ if (c - common === lb) {
+ diff = -1;
+ break;
+ }
+ diff = this.current.charCodeAt(c - 1 - common) - w.s.charCodeAt(i2);
+ if (diff !== 0) {
+ break;
+ }
+ common++;
+ }
+ if (diff < 0) {
+ j = k;
+ common_j = common;
+ } else {
+ i = k;
+ common_i = common;
+ }
+ if (j - i <= 1) {
+ if (i > 0) {
+ break;
+ }
+ if (j === i) {
+ break;
+ }
+ if (first_key_inspected) {
+ break;
+ }
+ first_key_inspected = true;
+ }
+ }
+ while (true) {
+ w = v[i];
+ if (common_i >= w.s_size) {
+ this.cursor = (c - w.s_size | 0);
+ if (w.method == null) {
+ return w.result;
+ }
+ res = w.method(this);
+ this.cursor = (c - w.s_size | 0);
+ if (res) {
+ return w.result;
+ }
+ }
+ i = w.substring_i;
+ if (i < 0) {
+ return 0;
+ }
+ }
+ return -1;
+};
+
+/**
+ * @param {!number} c_bra
+ * @param {!number} c_ket
+ * @param {!string} s
+ * @return {!number}
+ */
+BaseStemmer.prototype.replace_s$IIS = function (c_bra, c_ket, s) {
+ /** @type {!number} */
+ var adjustment;
+ adjustment = s.length - (c_ket - c_bra);
+ this.current = this.current.slice(0, c_bra) + s + this.current.slice(c_ket);
+ this.limit += (adjustment | 0);
+ if (this.cursor >= c_ket) {
+ this.cursor += (adjustment | 0);
+ } else {
+ if (this.cursor > c_bra) {
+ this.cursor = c_bra;
+ }
+ }
+ return (adjustment | 0);
+};
+
+/**
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.slice_check$ = function () {
+ /** @type {!number} */
+ var bra$0;
+ /** @type {!number} */
+ var ket$0;
+ /** @type {!number} */
+ var limit$0;
+ return ((bra$0 = this.bra) < 0 || bra$0 > (ket$0 = this.ket) || ket$0 > (limit$0 = this.limit) || limit$0 > this.current.length ? false : true);
+};
+
+/**
+ * @param {!string} s
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.slice_from$S = function (s) {
+ /** @type {!boolean} */
+ var result;
+ /** @type {!number} */
+ var bra$0;
+ /** @type {!number} */
+ var ket$0;
+ /** @type {!number} */
+ var limit$0;
+ result = false;
+ if ((bra$0 = this.bra) < 0 || bra$0 > (ket$0 = this.ket) || ket$0 > (limit$0 = this.limit) || limit$0 > this.current.length ? false : true) {
+ this.replace_s$IIS(this.bra, this.ket, s);
+ result = true;
+ }
+ return result;
+};
+
+/**
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.slice_del$ = function () {
+ return this.slice_from$S("");
+};
+
+/**
+ * @param {!number} c_bra
+ * @param {!number} c_ket
+ * @param {!string} s
+ */
+BaseStemmer.prototype.insert$IIS = function (c_bra, c_ket, s) {
+ /** @type {!number} */
+ var adjustment;
+ adjustment = this.replace_s$IIS(c_bra, c_ket, s);
+ if (c_bra <= this.bra) {
+ this.bra += (adjustment | 0);
+ }
+ if (c_bra <= this.ket) {
+ this.ket += (adjustment | 0);
+ }
+};
+
+/**
+ * @param {!string} s
+ * @return {!string}
+ */
+BaseStemmer.prototype.slice_to$S = function (s) {
+ /** @type {!string} */
+ var result;
+ /** @type {!number} */
+ var bra$0;
+ /** @type {!number} */
+ var ket$0;
+ /** @type {!number} */
+ var limit$0;
+ result = '';
+ if ((bra$0 = this.bra) < 0 || bra$0 > (ket$0 = this.ket) || ket$0 > (limit$0 = this.limit) || limit$0 > this.current.length ? false : true) {
+ result = this.current.slice(this.bra, this.ket);
+ }
+ return result;
+};
+
+/**
+ * @param {!string} s
+ * @return {!string}
+ */
+BaseStemmer.prototype.assign_to$S = function (s) {
+ return this.current.slice(0, this.limit);
+};
+
+/**
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.stem$ = function () {
+ return false;
+};
+
+/**
+ * @param {!string} word
+ * @return {!string}
+ */
+BaseStemmer.prototype.stemWord$S = function (word) {
+ /** @type {undefined|!string} */
+ var result;
+ /** @type {!string} */
+ var current$0;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var limit$0;
+ result = this.cache['.' + word];
+ if (result == null) {
+ current$0 = this.current = word;
+ cursor$0 = this.cursor = 0;
+ limit$0 = this.limit = current$0.length;
+ this.limit_backward = 0;
+ this.bra = cursor$0;
+ this.ket = limit$0;
+ this.stem$();
+ result = this.current;
+ this.cache['.' + word] = result;
+ }
+ return result;
+};
+
+/**
+ * @param {Array.<undefined|!string>} words
+ * @return {Array.<undefined|!string>}
+ */
+BaseStemmer.prototype.stemWords$AS = function (words) {
+ /** @type {Array.<undefined|!string>} */
+ var results;
+ /** @type {!number} */
+ var i;
+ /** @type {undefined|!string} */
+ var word;
+ /** @type {undefined|!string} */
+ var result;
+ /** @type {!string} */
+ var current$0;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var limit$0;
+ results = [ ];
+ for (i = 0; i < words.length; i++) {
+ word = words[i];
+ result = this.cache['.' + word];
+ if (result == null) {
+ current$0 = this.current = word;
+ cursor$0 = this.cursor = 0;
+ limit$0 = this.limit = current$0.length;
+ this.limit_backward = 0;
+ this.bra = cursor$0;
+ this.ket = limit$0;
+ this.stem$();
+ result = this.current;
+ this.cache['.' + word] = result;
+ }
+ results.push(result);
+ }
+ return results;
+};
+
+/**
+ * class SwedishStemmer extends BaseStemmer
+ * @constructor
+ */
+function SwedishStemmer() {
+}
+
+SwedishStemmer.prototype = new BaseStemmer;
+/**
+ * @constructor
+ */
+function SwedishStemmer$() {
+ BaseStemmer$.call(this);
+ this.I_x = 0;
+ this.I_p1 = 0;
+};
+
+SwedishStemmer$.prototype = new SwedishStemmer;
+
+/**
+ * @param {SwedishStemmer} other
+ */
+SwedishStemmer.prototype.copy_from$LSwedishStemmer$ = function (other) {
+ this.I_x = other.I_x;
+ this.I_p1 = other.I_p1;
+ BaseStemmer.prototype.copy_from$LBaseStemmer$.call(this, other);
+};
+
+/**
+ * @return {!boolean}
+ */
+SwedishStemmer.prototype.r_mark_regions$ = function () {
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var c;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!boolean} */
+ var lab3;
+ /** @type {!boolean} */
+ var lab4;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var limit$0;
+ /** @type {!number} */
+ var cursor$1;
+ /** @type {!number} */
+ var cursor$2;
+ this.I_p1 = limit$0 = this.limit;
+ v_1 = cursor$0 = this.cursor;
+ c = (cursor$0 + 3 | 0);
+ if (0 > c || c > limit$0) {
+ return false;
+ }
+ cursor$2 = this.cursor = c;
+ this.I_x = cursor$2;
+ this.cursor = v_1;
+golab0:
+ while (true) {
+ v_2 = this.cursor;
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ if (! this.in_grouping$AIII(SwedishStemmer.g_v, 97, 246)) {
+ break lab1;
+ }
+ this.cursor = v_2;
+ break golab0;
+ }
+ cursor$1 = this.cursor = v_2;
+ if (cursor$1 >= this.limit) {
+ return false;
+ }
+ this.cursor++;
+ }
+golab2:
+ while (true) {
+ lab3 = true;
+ lab3:
+ while (lab3 === true) {
+ lab3 = false;
+ if (! this.out_grouping$AIII(SwedishStemmer.g_v, 97, 246)) {
+ break lab3;
+ }
+ break golab2;
+ }
+ if (this.cursor >= this.limit) {
+ return false;
+ }
+ this.cursor++;
+ }
+ this.I_p1 = this.cursor;
+ lab4 = true;
+lab4:
+ while (lab4 === true) {
+ lab4 = false;
+ if (! (this.I_p1 < this.I_x)) {
+ break lab4;
+ }
+ this.I_p1 = this.I_x;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+SwedishStemmer.prototype.r_main_suffix$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var cursor$1;
+ /** @type {!number} */
+ var cursor$2;
+ v_1 = this.limit - (cursor$0 = this.cursor);
+ if (cursor$0 < this.I_p1) {
+ return false;
+ }
+ cursor$1 = this.cursor = this.I_p1;
+ v_2 = this.limit_backward;
+ this.limit_backward = cursor$1;
+ cursor$2 = this.cursor = this.limit - v_1;
+ this.ket = cursor$2;
+ among_var = this.find_among_b$ALAmong$I(SwedishStemmer.a_0, 37);
+ if (among_var === 0) {
+ this.limit_backward = v_2;
+ return false;
+ }
+ this.bra = this.cursor;
+ this.limit_backward = v_2;
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 2:
+ if (! this.in_grouping_b$AIII(SwedishStemmer.g_s_ending, 98, 121)) {
+ return false;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+SwedishStemmer.prototype.r_consonant_pair$ = function () {
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var v_3;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var cursor$1;
+ /** @type {!number} */
+ var limit$0;
+ /** @type {!number} */
+ var cursor$2;
+ /** @type {!number} */
+ var cursor$3;
+ v_1 = this.limit - (cursor$0 = this.cursor);
+ if (cursor$0 < this.I_p1) {
+ return false;
+ }
+ cursor$1 = this.cursor = this.I_p1;
+ v_2 = this.limit_backward;
+ this.limit_backward = cursor$1;
+ cursor$2 = this.cursor = (limit$0 = this.limit) - v_1;
+ v_3 = limit$0 - cursor$2;
+ if (this.find_among_b$ALAmong$I(SwedishStemmer.a_1, 7) === 0) {
+ this.limit_backward = v_2;
+ return false;
+ }
+ cursor$3 = this.cursor = this.limit - v_3;
+ this.ket = cursor$3;
+ if (cursor$3 <= this.limit_backward) {
+ this.limit_backward = v_2;
+ return false;
+ }
+ this.cursor--;
+ this.bra = this.cursor;
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ this.limit_backward = v_2;
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+SwedishStemmer.prototype.r_other_suffix$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var cursor$1;
+ /** @type {!number} */
+ var cursor$2;
+ v_1 = this.limit - (cursor$0 = this.cursor);
+ if (cursor$0 < this.I_p1) {
+ return false;
+ }
+ cursor$1 = this.cursor = this.I_p1;
+ v_2 = this.limit_backward;
+ this.limit_backward = cursor$1;
+ cursor$2 = this.cursor = this.limit - v_1;
+ this.ket = cursor$2;
+ among_var = this.find_among_b$ALAmong$I(SwedishStemmer.a_2, 5);
+ if (among_var === 0) {
+ this.limit_backward = v_2;
+ return false;
+ }
+ this.bra = this.cursor;
+ switch (among_var) {
+ case 0:
+ this.limit_backward = v_2;
+ return false;
+ case 1:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 2:
+ if (! this.slice_from$S("l\u00F6s")) {
+ return false;
+ }
+ break;
+ case 3:
+ if (! this.slice_from$S("full")) {
+ return false;
+ }
+ break;
+ }
+ this.limit_backward = v_2;
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+SwedishStemmer.prototype.stem$ = function () {
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var v_3;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!boolean} */
+ var lab2;
+ /** @type {!boolean} */
+ var lab3;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var limit$0;
+ /** @type {!number} */
+ var cursor$1;
+ /** @type {!number} */
+ var limit$1;
+ /** @type {!number} */
+ var cursor$2;
+ v_1 = this.cursor;
+ lab0 = true;
+lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ if (! this.r_mark_regions$()) {
+ break lab0;
+ }
+ }
+ cursor$0 = this.cursor = v_1;
+ this.limit_backward = cursor$0;
+ cursor$1 = this.cursor = limit$0 = this.limit;
+ v_2 = limit$0 - cursor$1;
+ lab1 = true;
+lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ if (! this.r_main_suffix$()) {
+ break lab1;
+ }
+ }
+ cursor$2 = this.cursor = (limit$1 = this.limit) - v_2;
+ v_3 = limit$1 - cursor$2;
+ lab2 = true;
+lab2:
+ while (lab2 === true) {
+ lab2 = false;
+ if (! this.r_consonant_pair$()) {
+ break lab2;
+ }
+ }
+ this.cursor = this.limit - v_3;
+ lab3 = true;
+lab3:
+ while (lab3 === true) {
+ lab3 = false;
+ if (! this.r_other_suffix$()) {
+ break lab3;
+ }
+ }
+ this.cursor = this.limit_backward;
+ return true;
+};
+
+/**
+ * @param {*} o
+ * @return {!boolean}
+ */
+SwedishStemmer.prototype.equals$X = function (o) {
+ return o instanceof SwedishStemmer;
+};
+
+/**
+ * @return {!number}
+ */
+SwedishStemmer.prototype.hashCode$ = function () {
+ /** @type {!string} */
+ var classname;
+ /** @type {!number} */
+ var hash;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var char;
+ classname = "SwedishStemmer";
+ hash = 0;
+ if ("SwedishStemmer".length === 0) {
+ return (hash | 0);
+ }
+ for (i = 0; i < classname.length; i++) {
+ char = classname.charCodeAt(i);
+ hash = (hash << 5) - hash + char;
+ hash = hash & hash;
+ }
+ return (hash | 0);
+};
+
+/**
+ * class Among extends Object
+ * @constructor
+ */
+function Among() {
+}
+
+/**
+ * @constructor
+ * @param {!string} s
+ * @param {!number} substring_i
+ * @param {!number} result
+ */
+function Among$SII(s, substring_i, result) {
+ this.s_size = s.length;
+ this.s = s;
+ this.substring_i = substring_i;
+ this.result = result;
+ this.method = null;
+ this.instance = null;
+};
+
+Among$SII.prototype = new Among;
+
+/**
+ * @constructor
+ * @param {!string} s
+ * @param {!number} substring_i
+ * @param {!number} result
+ * @param {*} method
+ * @param {BaseStemmer} instance
+ */
+function Among$SIIF$LBaseStemmer$B$LBaseStemmer$(s, substring_i, result, method, instance) {
+ this.s_size = s.length;
+ this.s = s;
+ this.substring_i = substring_i;
+ this.result = result;
+ this.method = method;
+ this.instance = instance;
+};
+
+Among$SIIF$LBaseStemmer$B$LBaseStemmer$.prototype = new Among;
+
+/**
+ * class Metadata extends Object
+ * @constructor
+ */
+function Metadata() {
+}
+
+/**
+ * @constructor
+ * @param {Oktavia} parent
+ */
+function Metadata$LOktavia$(parent) {
+ this._parent = parent;
+ this._bitVector = new BitVector$();
+};
+
+Metadata$LOktavia$.prototype = new Metadata;
+
+/**
+ * @return {!number}
+ */
+Metadata.prototype._size$ = function () {
+ /** @type {BitVector} */
+ var this$0;
+ /** @type {!number} */
+ var i$0;
+ /** @type {BitVector} */
+ var _bitVector$0;
+ this$0 = _bitVector$0 = this._bitVector;
+ i$0 = _bitVector$0._size;
+ return this$0.rank$IB(i$0, true);
+};
+
+/**
+ * @param {!number} index
+ * @return {!string}
+ */
+Metadata.prototype.getContent$I = function (index) {
+ /** @type {!number} */
+ var startPosition;
+ /** @type {!number} */
+ var length;
+ if (index < 0 || this._size$() <= index) {
+ throw new Error("Section.getContent() : range error " + (index + ""));
+ }
+ startPosition = 0;
+ if (index > 0) {
+ startPosition = this._bitVector.select$I(index - 1) + 1;
+ }
+ length = this._bitVector.select$I(index) - startPosition + 1;
+ return this._parent._getSubstring$II(startPosition, length);
+};
+
+/**
+ * @param {!number} index
+ * @return {!number}
+ */
+Metadata.prototype.getStartPosition$I = function (index) {
+ /** @type {!number} */
+ var startPosition;
+ if (index < 0 || this._size$() <= index) {
+ throw new Error("Section.getContent() : range error " + (index + ""));
+ }
+ startPosition = 0;
+ if (index > 0) {
+ startPosition = this._bitVector.select$I(index - 1) + 1;
+ }
+ return (startPosition | 0);
+};
+
+/**
+ * @param {SingleResult} result
+ * @param {Array.<undefined|!number>} positions
+ * @param {!string} word
+ * @param {!boolean} stemmed
+ */
+Metadata.prototype.grouping$LSingleResult$AISB = function (result, positions, word, stemmed) {
+};
+
+/**
+ * @param {!number} index
+ * @return {!string}
+ */
+Metadata.prototype.getInformation$I = function (index) {
+ return '';
+};
+
+/**
+ */
+Metadata.prototype._build$ = function () {
+ this._bitVector.build$();
+};
+
+/**
+ * @param {!string} name
+ * @param {!string} data
+ * @param {!number} offset
+ * @return {!number}
+ */
+Metadata.prototype._load$SSI = function (name, data, offset) {
+ offset = this._bitVector.load$SI(data, offset);
+ this._parent._metadataLabels.push(name);
+ this._parent._metadatas[name] = this;
+ return offset;
+};
+
+/**
+ * @return {!string}
+ */
+Metadata.prototype._dump$ = function () {
+ /** @type {BitVector} */
+ var this$0;
+ /** @type {Array.<undefined|!string>} */
+ var contents$0;
+ this$0 = this._bitVector;
+ contents$0 = [ ];
+ contents$0.push(Binary$dump32bitNumber$N(this$0._size));
+ contents$0.push(Binary$dump32bitNumberList$AN(this$0._v));
+ return contents$0.join('');
+};
+
+/**
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+Metadata.prototype._dump$LCompressionReport$ = function (report) {
+ /** @type {BitVector} */
+ var this$0;
+ /** @type {Array.<undefined|!string>} */
+ var contents$0;
+ this$0 = this._bitVector;
+ contents$0 = [ ];
+ contents$0.push(Binary$dump32bitNumber$N(this$0._size));
+ CompressionReport$add$LCompressionReport$II(report, 2, 2);
+ contents$0.push(Binary$dump32bitNumberList$ANLCompressionReport$(this$0._v, report));
+ return contents$0.join('');
+};
+
+/**
+ * class Section extends Metadata
+ * @constructor
+ */
+function Section() {
+}
+
+Section.prototype = new Metadata;
+/**
+ * @constructor
+ * @param {Oktavia} parent
+ */
+function Section$LOktavia$(parent) {
+ this._parent = parent;
+ this._bitVector = new BitVector$();
+ this._names = [ ];
+};
+
+Section$LOktavia$.prototype = new Section;
+
+/**
+ * @param {!string} name
+ */
+Section.prototype.setTail$S = function (name) {
+ /** @type {!number} */
+ var index$0;
+ /** @type {Oktavia} */
+ var this$0;
+ /** @type {FMIndex} */
+ var this$0$0;
+ this$0 = this._parent;
+ this$0$0 = this$0._fmindex;
+ index$0 = this$0$0._substr.length;
+ this._names.push(name);
+ this._bitVector.set$I(index$0 - 1);
+};
+
+/**
+ * @param {!string} name
+ * @param {!number} index
+ */
+Section.prototype.setTail$SI = function (name, index) {
+ this._names.push(name);
+ this._bitVector.set$I(index - 1);
+};
+
+/**
+ * @return {!number}
+ */
+Section.prototype.size$ = function () {
+ return (this._names.length | 0);
+};
+
+/**
+ * @param {!number} position
+ * @return {!number}
+ */
+Section.prototype.getSectionIndex$I = function (position) {
+ /** @type {BitVector} */
+ var this$0;
+ if (position < 0 || this._bitVector.size$() <= position) {
+ throw new Error("Section.getSectionIndex() : range error " + (position + ""));
+ }
+ this$0 = this._bitVector;
+ return this$0.rank$IB(position, true);
+};
+
+/**
+ * @param {!number} index
+ * @return {!string}
+ */
+Section.prototype.getName$I = function (index) {
+ if (index < 0 || this._names.length <= index) {
+ throw new Error("Section.getName() : range error");
+ }
+ return this._names[index];
+};
+
+/**
+ * @param {SingleResult} result
+ * @param {Array.<undefined|!number>} positions
+ * @param {!string} word
+ * @param {!boolean} stemmed
+ */
+Section.prototype.grouping$LSingleResult$AISB = function (result, positions, word, stemmed) {
+ /** @type {!number} */
+ var i;
+ /** @type {undefined|!number} */
+ var position;
+ /** @type {!number} */
+ var index;
+ /** @type {SearchUnit} */
+ var unit;
+ for (i = 0; i < positions.length; i++) {
+ position = positions[i];
+ index = this.getSectionIndex$I(position);
+ unit = SingleResult$getSearchUnit$LSingleResult$I(result, index);
+ if (unit.startPosition < 0) {
+ unit.startPosition = this.getStartPosition$I(index);
+ }
+ SearchUnit$addPosition$LSearchUnit$SIB(unit, word, position - unit.startPosition, stemmed);
+ }
+};
+
+/**
+ * @param {!number} index
+ * @return {!string}
+ */
+Section.prototype.getInformation$I = function (index) {
+ return this.getName$I(index);
+};
+
+/**
+ * @param {Oktavia} parent
+ * @param {!string} name
+ * @param {!string} data
+ * @param {!number} offset
+ * @return {!number}
+ */
+Section._load$LOktavia$SSI = function (parent, name, data, offset) {
+ /** @type {LoadedStringListResult} */
+ var strs;
+ /** @type {Section} */
+ var section;
+ /** @type {!number} */
+ var offset$0;
+ strs = new LoadedStringListResult$SI(data, offset);
+ section = new Section$LOktavia$(parent);
+ section._names = strs.result;
+ offset$0 = strs.offset;
+ offset$0 = section._bitVector.load$SI(data, offset$0);
+ section._parent._metadataLabels.push(name);
+ section._parent._metadatas[name] = section;
+ return offset$0;
+};
+
+var Section$_load$LOktavia$SSI = Section._load$LOktavia$SSI;
+
+/**
+ * @return {!string}
+ */
+Section.prototype._dump$ = function () {
+ return [ Binary$dump16bitNumber$I(0), Binary$dumpStringList$AS(this._names), Metadata.prototype._dump$.call(this) ].join('');
+};
+
+/**
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+Section.prototype._dump$LCompressionReport$ = function (report) {
+ CompressionReport$add$LCompressionReport$II(report, 1, 1);
+ return [ Binary$dump16bitNumber$I(0), Binary$dumpStringList$ASLCompressionReport$(this._names, report), Metadata.prototype._dump$LCompressionReport$.call(this, report) ].join('');
+};
+
+/**
+ * class Splitter extends Metadata
+ * @constructor
+ */
+function Splitter() {
+}
+
+Splitter.prototype = new Metadata;
+/**
+ * @constructor
+ * @param {Oktavia} parent
+ */
+function Splitter$LOktavia$(parent) {
+ this._parent = parent;
+ this._bitVector = new BitVector$();
+ this.name = null;
+};
+
+Splitter$LOktavia$.prototype = new Splitter;
+
+/**
+ * @constructor
+ * @param {Oktavia} parent
+ * @param {!string} name
+ */
+function Splitter$LOktavia$S(parent, name) {
+ this._parent = parent;
+ this._bitVector = new BitVector$();
+ this.name = name;
+};
+
+Splitter$LOktavia$S.prototype = new Splitter;
+
+/**
+ * @return {!number}
+ */
+Splitter.prototype.size$ = function () {
+ /** @type {BitVector} */
+ var this$0$0;
+ /** @type {!number} */
+ var i$0$0;
+ /** @type {BitVector} */
+ var _bitVector$0;
+ this$0$0 = _bitVector$0 = this._bitVector;
+ i$0$0 = _bitVector$0._size;
+ return this$0$0.rank$IB(i$0$0, true);
+};
+
+/**
+ */
+Splitter.prototype.split$ = function () {
+ /** @type {!number} */
+ var index$0;
+ /** @type {Oktavia} */
+ var this$0;
+ /** @type {FMIndex} */
+ var this$0$0;
+ this$0 = this._parent;
+ this$0$0 = this$0._fmindex;
+ index$0 = this$0$0._substr.length;
+ this._bitVector.set$I(index$0 - 1);
+};
+
+/**
+ * @param {!number} index
+ */
+Splitter.prototype.split$I = function (index) {
+ this._bitVector.set$I(index - 1);
+};
+
+/**
+ * @param {!number} position
+ * @return {!number}
+ */
+Splitter.prototype.getIndex$I = function (position) {
+ /** @type {BitVector} */
+ var this$0;
+ if (position < 0 || this._bitVector.size$() <= position) {
+ throw new Error("Section.getSectionIndex() : range error");
+ }
+ this$0 = this._bitVector;
+ return this$0.rank$IB(position, true);
+};
+
+/**
+ * @param {SingleResult} result
+ * @param {Array.<undefined|!number>} positions
+ * @param {!string} word
+ * @param {!boolean} stemmed
+ */
+Splitter.prototype.grouping$LSingleResult$AISB = function (result, positions, word, stemmed) {
+ /** @type {!number} */
+ var i;
+ /** @type {undefined|!number} */
+ var position;
+ /** @type {!number} */
+ var index;
+ /** @type {SearchUnit} */
+ var unit;
+ for (i = 0; i < positions.length; i++) {
+ position = positions[i];
+ index = this.getIndex$I(position);
+ unit = SingleResult$getSearchUnit$LSingleResult$I(result, index);
+ if (unit.startPosition < 0) {
+ unit.startPosition = this.getStartPosition$I(index);
+ }
+ SearchUnit$addPosition$LSearchUnit$SIB(unit, word, position - unit.startPosition, stemmed);
+ }
+};
+
+/**
+ * @param {!number} index
+ * @return {!string}
+ */
+Splitter.prototype.getInformation$I = function (index) {
+ return (this.name != null ? this.name + (index + 1 + "") : '');
+};
+
+/**
+ * @param {Oktavia} parent
+ * @param {!string} name
+ * @param {!string} data
+ * @param {!number} offset
+ * @return {!number}
+ */
+Splitter._load$LOktavia$SSI = function (parent, name, data, offset) {
+ /** @type {Splitter} */
+ var section;
+ section = new Splitter$LOktavia$(parent);
+ offset = section._bitVector.load$SI(data, offset);
+ section._parent._metadataLabels.push(name);
+ section._parent._metadatas[name] = section;
+ return offset;
+};
+
+var Splitter$_load$LOktavia$SSI = Splitter._load$LOktavia$SSI;
+
+/**
+ * @return {!string}
+ */
+Splitter.prototype._dump$ = function () {
+ return [ Binary$dump16bitNumber$I(1), Metadata.prototype._dump$.call(this) ].join('');
+};
+
+/**
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+Splitter.prototype._dump$LCompressionReport$ = function (report) {
+ CompressionReport$add$LCompressionReport$II(report, 1, 1);
+ return [ Binary$dump16bitNumber$I(1), Metadata.prototype._dump$LCompressionReport$.call(this, report) ].join('');
+};
+
+/**
+ * class Table extends Metadata
+ * @constructor
+ */
+function Table() {
+}
+
+Table.prototype = new Metadata;
+/**
+ * @constructor
+ * @param {Oktavia} parent
+ * @param {Array.<undefined|!string>} headers
+ */
+function Table$LOktavia$AS(parent, headers) {
+ this._parent = parent;
+ this._bitVector = new BitVector$();
+ this._headers = headers;
+ this._columnTails = new BitVector$();
+};
+
+Table$LOktavia$AS.prototype = new Table;
+
+/**
+ * @return {!number}
+ */
+Table.prototype.rowSize$ = function () {
+ /** @type {BitVector} */
+ var this$0$0;
+ /** @type {!number} */
+ var i$0$0;
+ /** @type {BitVector} */
+ var _bitVector$0;
+ this$0$0 = _bitVector$0 = this._bitVector;
+ i$0$0 = _bitVector$0._size;
+ return this$0$0.rank$IB(i$0$0, true);
+};
+
+/**
+ * @return {!number}
+ */
+Table.prototype.columnSize$ = function () {
+ return (this._headers.length | 0);
+};
+
+/**
+ */
+Table.prototype.setColumnTail$ = function () {
+ /** @type {!number} */
+ var index;
+ /** @type {Oktavia} */
+ var this$0;
+ /** @type {FMIndex} */
+ var this$0$0;
+ /** @type {Oktavia} */
+ var _parent$0;
+ this$0 = _parent$0 = this._parent;
+ this$0$0 = this$0._fmindex;
+ index = this$0$0._substr.length;
+ _parent$0._fmindex.push$S(Oktavia.eob);
+ this._columnTails.set$I(index - 1);
+};
+
+/**
+ */
+Table.prototype.setRowTail$ = function () {
+ /** @type {!number} */
+ var index;
+ /** @type {Oktavia} */
+ var this$0;
+ /** @type {FMIndex} */
+ var this$0$0;
+ this$0 = this._parent;
+ this$0$0 = this$0._fmindex;
+ index = this$0$0._substr.length;
+ this._bitVector.set$I(index - 1);
+};
+
+/**
+ * @param {!number} position
+ * @return {Array.<undefined|!number>}
+ */
+Table.prototype.getCell$I = function (position) {
+ /** @type {!number} */
+ var row;
+ /** @type {!number} */
+ var currentColumn;
+ /** @type {!number} */
+ var lastRowColumn;
+ /** @type {!number} */
+ var startPosition;
+ /** @type {Array.<undefined|!number>} */
+ var result;
+ /** @type {BitVector} */
+ var this$0;
+ /** @type {BitVector} */
+ var this$1;
+ if (position < 0 || this._bitVector.size$() <= position) {
+ throw new Error("Section.getSectionIndex() : range error " + (position + ""));
+ }
+ this$0 = this._bitVector;
+ row = this$0.rank$IB(position, true);
+ this$1 = this._columnTails;
+ currentColumn = this$1.rank$IB(position, true);
+ lastRowColumn = 0;
+ if (row > 0) {
+ startPosition = this._bitVector.select$I(row - 1) + 1;
+ lastRowColumn = this._columnTails.rank$I(startPosition);
+ }
+ result = [ row, currentColumn - lastRowColumn ];
+ return result;
+};
+
+/**
+ * @param {!number} rowIndex
+ * @return {Object.<string, undefined|!string>}
+ */
+Table.prototype.getRowContent$I = function (rowIndex) {
+ /** @type {!string} */
+ var content;
+ /** @type {Array.<undefined|!string>} */
+ var values;
+ /** @type {Object.<string, undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var i;
+ content = this.getContent$I(rowIndex);
+ values = content.split(Oktavia.eob, this._headers.length);
+ result = ({ });
+ for (i in this._headers) {
+ if (i < values.length) {
+ result[this._headers[i]] = values[i];
+ } else {
+ result[this._headers[i]] = '';
+ }
+ }
+ return result;
+};
+
+/**
+ * @param {SingleResult} result
+ * @param {Array.<undefined|!number>} positions
+ * @param {!string} word
+ * @param {!boolean} stemmed
+ */
+Table.prototype.grouping$LSingleResult$AISB = function (result, positions, word, stemmed) {
+};
+
+/**
+ * @param {!number} index
+ * @return {!string}
+ */
+Table.prototype.getInformation$I = function (index) {
+ return '';
+};
+
+/**
+ */
+Table.prototype._build$ = function () {
+ this._bitVector.build$();
+ this._columnTails.build$();
+};
+
+/**
+ * @param {Oktavia} parent
+ * @param {!string} name
+ * @param {!string} data
+ * @param {!number} offset
+ * @return {!number}
+ */
+Table._load$LOktavia$SSI = function (parent, name, data, offset) {
+ /** @type {LoadedStringListResult} */
+ var strs;
+ /** @type {Table} */
+ var table;
+ /** @type {!number} */
+ var offset$0;
+ strs = new LoadedStringListResult$SI(data, offset);
+ table = new Table$LOktavia$AS(parent, strs.result);
+ offset$0 = strs.offset;
+ offset$0 = table._bitVector.load$SI(data, offset$0);
+ table._parent._metadataLabels.push(name);
+ table._parent._metadatas[name] = table;
+ offset = offset$0;
+ return table._columnTails.load$SI(data, offset$0);
+};
+
+var Table$_load$LOktavia$SSI = Table._load$LOktavia$SSI;
+
+/**
+ * @return {!string}
+ */
+Table.prototype._dump$ = function () {
+ return [ Binary$dump16bitNumber$I(2), Binary$dumpStringList$AS(this._headers), Metadata.prototype._dump$.call(this), this._columnTails.dump$() ].join('');
+};
+
+/**
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+Table.prototype._dump$LCompressionReport$ = function (report) {
+ CompressionReport$add$LCompressionReport$II(report, 1, 1);
+ return [ Binary$dump16bitNumber$I(2), Binary$dumpStringList$ASLCompressionReport$(this._headers, report), Metadata.prototype._dump$LCompressionReport$.call(this, report), this._columnTails.dump$LCompressionReport$(report) ].join('');
+};
+
+/**
+ * class Block extends Metadata
+ * @constructor
+ */
+function Block() {
+}
+
+Block.prototype = new Metadata;
+/**
+ * @constructor
+ * @param {Oktavia} parent
+ */
+function Block$LOktavia$(parent) {
+ this._parent = parent;
+ this._bitVector = new BitVector$();
+ this._names = [ ];
+ this._start = false;
+};
+
+Block$LOktavia$.prototype = new Block;
+
+/**
+ * @param {!string} blockName
+ */
+Block.prototype.startBlock$S = function (blockName) {
+ this.startBlock$SI(blockName, this._parent.contentSize$());
+};
+
+/**
+ * @param {!string} blockName
+ * @param {!number} index
+ */
+Block.prototype.startBlock$SI = function (blockName, index) {
+ if (this._start) {
+ throw new Error('Splitter `' + this._names[this._names.length - 1] + '` is not closed');
+ }
+ this._start = true;
+ this._names.push(blockName);
+ this._bitVector.set$I(index - 1);
+};
+
+/**
+ */
+Block.prototype.endBlock$ = function () {
+ this.endBlock$I(this._parent.contentSize$());
+};
+
+/**
+ * @param {!number} index
+ */
+Block.prototype.endBlock$I = function (index) {
+ if (! this._start) {
+ throw new Error('Splitter is not started');
+ }
+ this._start = false;
+ this._bitVector.set$I(index - 1);
+};
+
+/**
+ * @return {!number}
+ */
+Block.prototype.size$ = function () {
+ return (this._names.length | 0);
+};
+
+/**
+ * @param {!number} position
+ * @return {!number}
+ */
+Block.prototype.blockIndex$I = function (position) {
+ /** @type {!number} */
+ var result;
+ /** @type {BitVector} */
+ var this$0;
+ if (position < 0 || this._parent._fmindex.size$() - 1 <= position) {
+ throw new Error("Block.blockIndex() : range error " + (position + ""));
+ }
+ if (position >= this._bitVector.size$()) {
+ position = (this._bitVector.size$() - 1 | 0);
+ result = (this._bitVector.rank$I(position) + 1 | 0);
+ } else {
+ this$0 = this._bitVector;
+ result = this$0.rank$IB(position, true);
+ }
+ return result;
+};
+
+/**
+ * @param {!number} position
+ * @return {!boolean}
+ */
+Block.prototype.inBlock$I = function (position) {
+ /** @type {!number} */
+ var blockIndex;
+ blockIndex = this.blockIndex$I(position);
+ return blockIndex % 2 !== 0;
+};
+
+/**
+ * @param {!number} position
+ * @return {!string}
+ */
+Block.prototype.getBlockContent$I = function (position) {
+ /** @type {!number} */
+ var blockIndex;
+ /** @type {!string} */
+ var result;
+ blockIndex = this.blockIndex$I(position);
+ if (blockIndex % 2 !== 0) {
+ result = this.getContent$I(blockIndex);
+ } else {
+ result = '';
+ }
+ return result;
+};
+
+/**
+ * @param {!number} position
+ * @return {!string}
+ */
+Block.prototype.getBlockName$I = function (position) {
+ /** @type {!number} */
+ var blockIndex;
+ /** @type {!string} */
+ var result;
+ blockIndex = this.blockIndex$I(position);
+ if (blockIndex % 2 !== 0) {
+ result = this._names[blockIndex >>> 1];
+ } else {
+ result = '';
+ }
+ return result;
+};
+
+/**
+ * @param {SingleResult} result
+ * @param {Array.<undefined|!number>} positions
+ * @param {!string} word
+ * @param {!boolean} stemmed
+ */
+Block.prototype.grouping$LSingleResult$AISB = function (result, positions, word, stemmed) {
+};
+
+/**
+ * @param {!number} index
+ * @return {!string}
+ */
+Block.prototype.getInformation$I = function (index) {
+ return '';
+};
+
+/**
+ * @param {Oktavia} parent
+ * @param {!string} name
+ * @param {!string} data
+ * @param {!number} offset
+ * @return {!number}
+ */
+Block._load$LOktavia$SSI = function (parent, name, data, offset) {
+ /** @type {LoadedStringListResult} */
+ var strs;
+ /** @type {Block} */
+ var block;
+ /** @type {!number} */
+ var offset$0;
+ strs = new LoadedStringListResult$SI(data, offset);
+ block = new Block$LOktavia$(parent);
+ block._names = strs.result;
+ offset$0 = strs.offset;
+ offset$0 = block._bitVector.load$SI(data, offset$0);
+ block._parent._metadataLabels.push(name);
+ block._parent._metadatas[name] = block;
+ return offset$0;
+};
+
+var Block$_load$LOktavia$SSI = Block._load$LOktavia$SSI;
+
+/**
+ * @return {!string}
+ */
+Block.prototype._dump$ = function () {
+ return [ Binary$dump16bitNumber$I(3), Binary$dumpStringList$AS(this._names), Metadata.prototype._dump$.call(this) ].join('');
+};
+
+/**
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+Block.prototype._dump$LCompressionReport$ = function (report) {
+ CompressionReport$add$LCompressionReport$II(report, 1, 1);
+ return [ Binary$dump16bitNumber$I(3), Binary$dumpStringList$ASLCompressionReport$(this._names, report), Metadata.prototype._dump$LCompressionReport$.call(this, report) ].join('');
+};
+
+/**
+ * class FMIndex extends Object
+ * @constructor
+ */
+function FMIndex() {
+}
+
+/**
+ * @constructor
+ */
+function FMIndex$() {
+ /** @type {Array.<undefined|!number>} */
+ var _rlt$0;
+ this._ssize = 0;
+ (this._ddic = 0, this._head = 0);
+ this._substr = "";
+ this._sv = new WaveletMatrix$();
+ this._posdic = [ ];
+ this._idic = [ ];
+ _rlt$0 = this._rlt = [ ];
+ _rlt$0.length = 65536;
+};
+
+FMIndex$.prototype = new FMIndex;
+
+/**
+ */
+FMIndex.prototype.clear$ = function () {
+ /** @type {WaveletMatrix} */
+ var this$0;
+ this$0 = this._sv;
+ this$0._bv.length = 0;
+ this$0._seps.length = 0;
+ this$0._size = 0;
+ this._posdic.length = 0;
+ this._idic.length = 0;
+ this._ddic = 0;
+ this._head = 0;
+ this._substr = "";
+};
+
+/**
+ * @return {!number}
+ */
+FMIndex.prototype.size$ = function () {
+ /** @type {WaveletMatrix} */
+ var this$0;
+ this$0 = this._sv;
+ return this$0._size;
+};
+
+/**
+ * @return {!number}
+ */
+FMIndex.prototype.contentSize$ = function () {
+ return this._substr.length;
+};
+
+/**
+ * @param {!string} key
+ * @return {!number}
+ */
+FMIndex.prototype.getRows$S = function (key) {
+ /** @type {Array.<undefined|!number>} */
+ var pos;
+ pos = [ ];
+ return this.getRows$SAI(key, pos);
+};
+
+/**
+ * @param {!string} key
+ * @param {Array.<undefined|!number>} pos
+ * @return {!number}
+ */
+FMIndex.prototype.getRows$SAI = function (key, pos) {
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var code;
+ /** @type {!number} */
+ var first;
+ /** @type {undefined|!number} */
+ var last;
+ /** @type {!number} */
+ var c;
+ /** @type {Array.<undefined|!number>} */
+ var _rlt$0;
+ i = key.length - 1;
+ code = key.charCodeAt(i);
+ first = (_rlt$0 = this._rlt)[code] + 1;
+ last = _rlt$0[code + 1];
+ while (first <= last) {
+ if (i === 0) {
+ pos[0] = (-- first | 0);
+ pos[1] = -- last;
+ return (last - first + 1 | 0);
+ }
+ i--;
+ c = key.charCodeAt(i);
+ first = this._rlt[c] + this._sv.rank$II(first - 1, c) + 1;
+ last = this._rlt[c] + this._sv.rank$II(last, c);
+ }
+ return 0;
+};
+
+/**
+ * @param {!number} i
+ * @return {!number}
+ */
+FMIndex.prototype.getPosition$I = function (i) {
+ /** @type {!number} */
+ var pos;
+ /** @type {!number} */
+ var c;
+ if (i >= this.size$()) {
+ throw new Error("FMIndex.getPosition() : range error");
+ }
+ pos = 0;
+ while (i !== this._head) {
+ if (i % this._ddic === 0) {
+ pos += this._posdic[i / this._ddic] + 1;
+ break;
+ }
+ c = this._sv.get$I(i);
+ i = this._rlt[c] + this._sv.rank$II(i, c);
+ pos++;
+ }
+ return (pos % this.size$() | 0);
+};
+
+/**
+ * @param {!number} pos
+ * @param {!number} len
+ * @return {!string}
+ */
+FMIndex.prototype.getSubstring$II = function (pos, len) {
+ /** @type {!number} */
+ var pos_end;
+ /** @type {!number} */
+ var pos_tmp;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var pos_idic;
+ /** @type {!string} */
+ var substr;
+ /** @type {!number} */
+ var c;
+ /** @type {!number} */
+ var _ddic$0;
+ if (pos >= this.size$()) {
+ throw new Error("FMIndex.getSubstring() : range error");
+ }
+ pos_end = Math.min(pos + len, this.size$());
+ pos_tmp = this.size$() - 1;
+ i = this._head;
+ pos_idic = Math.floor((pos_end + (_ddic$0 = this._ddic) - 2) / _ddic$0);
+ if (pos_idic < this._idic.length) {
+ pos_tmp = pos_idic * this._ddic;
+ i = this._idic[pos_idic];
+ }
+ substr = "";
+ while (pos_tmp >= pos) {
+ c = this._sv.get$I(i);
+ i = this._rlt[c] + this._sv.rank$II(i, c);
+ if (pos_tmp < pos_end) {
+ substr = String.fromCharCode(c) + substr;
+ }
+ if (pos_tmp === 0) {
+ break;
+ }
+ pos_tmp--;
+ }
+ return substr;
+};
+
+/**
+ */
+FMIndex.prototype.build$ = function () {
+ this.build$SIIB(String.fromCharCode(0), 65535, 20, false);
+};
+
+/**
+ * @param {!string} end_marker
+ * @param {!number} ddic
+ * @param {!boolean} verbose
+ */
+FMIndex.prototype.build$SIB = function (end_marker, ddic, verbose) {
+ this.build$SIIB(end_marker, 65535, ddic, verbose);
+};
+
+/**
+ * @param {!string} end_marker
+ * @param {!number} maxChar
+ * @param {!number} ddic
+ * @param {!boolean} verbose
+ */
+FMIndex.prototype.build$SIIB = function (end_marker, maxChar, ddic, verbose) {
+ /** @type {BurrowsWheelerTransform} */
+ var b;
+ /** @type {!string} */
+ var s;
+ /** @type {!number} */
+ var c;
+ /** @type {!string} */
+ var str$0;
+ /** @type {WaveletMatrix} */
+ var this$0;
+ /** @type {!string} */
+ var _str$0;
+ /** @type {Array.<undefined|!number>} */
+ var _suffixarray$0;
+ if (verbose) {
+ console.time("building burrows-wheeler transform");
+ }
+ this._substr += end_marker;
+ b = ({_str: "", _size: 0, _head: 0, _suffixarray: [ ]});
+ str$0 = this._substr;
+ _str$0 = b._str = str$0;
+ b._size = _str$0.length;
+ _suffixarray$0 = b._suffixarray = SAIS$make$S(str$0);
+ b._head = (_suffixarray$0.indexOf(0) | 0);
+ s = BurrowsWheelerTransform$get$LBurrowsWheelerTransform$(b);
+ this._ssize = s.length;
+ this._head = b._head;
+ b._str = "";
+ b._size = 0;
+ b._head = 0;
+ b._suffixarray.length = 0;
+ this._substr = "";
+ if (verbose) {
+ console.timeEnd("building burrows-wheeler transform");
+ }
+ if (verbose) {
+ console.time("building wavelet matrix");
+ }
+ this$0 = this._sv;
+ this$0._bitsize = (Math.ceil(Math.log(maxChar) / 0.6931471805599453) | 0);
+ if (verbose) {
+ console.log(" maxCharCode: ", maxChar);
+ console.log(" bitSize: ", this._sv.bitsize$());
+ }
+ this._sv.build$S(s);
+ if (verbose) {
+ console.timeEnd("building wavelet matrix");
+ }
+ if (verbose) {
+ console.time("caching rank less than");
+ }
+ for (c = 0; c < maxChar; c++) {
+ this._rlt[c] = this._sv.rank_less_than$II(this._sv.size$(), c);
+ }
+ if (verbose) {
+ console.timeEnd("caching rank less than");
+ }
+ this._ddic = ddic;
+ if (verbose) {
+ console.time("building dictionaries");
+ }
+ this._buildDictionaries$();
+ if (verbose) {
+ console.timeEnd("building dictionaries");
+ console.log('');
+ }
+};
+
+/**
+ */
+FMIndex.prototype._buildDictionaries$ = function () {
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var pos;
+ /** @type {!number} */
+ var c;
+ for (i = 0; i < this._ssize / this._ddic + 1; i++) {
+ this._posdic.push(0);
+ this._idic.push(0);
+ }
+ i = this._head;
+ pos = this.size$() - 1;
+ do {
+ if (i % this._ddic === 0) {
+ this._posdic[Math.floor(i / this._ddic)] = (pos | 0);
+ }
+ if (pos % this._ddic === 0) {
+ this._idic[Math.floor(pos / this._ddic)] = (i | 0);
+ }
+ c = this._sv.get$I(i);
+ i = this._rlt[c] + this._sv.rank$II(i, c);
+ pos--;
+ } while (i !== this._head);
+};
+
+/**
+ * @param {!string} doc
+ */
+FMIndex.prototype.push$S = function (doc) {
+ if (doc.length <= 0) {
+ throw new Error("FMIndex::push(): empty string");
+ }
+ this._substr += doc;
+};
+
+/**
+ * @param {!string} keyword
+ * @return {Array.<undefined|!number>}
+ */
+FMIndex.prototype.search$S = function (keyword) {
+ /** @type {Array.<undefined|!number>} */
+ var result;
+ /** @type {Array.<undefined|!number>} */
+ var position;
+ /** @type {!number} */
+ var rows;
+ /** @type {undefined|!number} */
+ var first;
+ /** @type {undefined|!number} */
+ var last;
+ /** @type {undefined|!number} */
+ var i;
+ result = [ ];
+ position = [ ];
+ rows = this.getRows$SAI(keyword, position);
+ if (rows > 0) {
+ first = position[0];
+ last = position[1];
+ for (i = first; i <= last; i++) {
+ result.push(this.getPosition$I(i));
+ }
+ }
+ return result;
+};
+
+/**
+ * @return {!string}
+ */
+FMIndex.prototype.dump$ = function () {
+ return this.dump$B(false);
+};
+
+/**
+ * @param {!boolean} verbose
+ * @return {!string}
+ */
+FMIndex.prototype.dump$B = function (verbose) {
+ /** @type {Array.<undefined|!string>} */
+ var contents;
+ /** @type {CompressionReport} */
+ var report;
+ /** @type {!number} */
+ var i;
+ contents = [ ];
+ report = ({source: 0, result: 0});
+ contents.push(Binary$dump32bitNumber$N(this._ddic));
+ contents.push(Binary$dump32bitNumber$N(this._ssize));
+ contents.push(Binary$dump32bitNumber$N(this._head));
+ CompressionReport$add$LCompressionReport$II(report, 6, 6);
+ contents.push(this._sv.dump$LCompressionReport$(report));
+ if (verbose) {
+ console.log("Serializing FM-index");
+ console.log(' Wavelet Matrix: ' + (contents[3].length * 2 + "") + ' bytes (' + (Math.round(report.result * 100.0 / report.source) + "") + '%)');
+ }
+ contents.push(Binary$dump32bitNumber$N(this._posdic.length));
+ for (i in this._posdic) {
+ contents.push(Binary$dump32bitNumber$N(this._posdic[i]));
+ }
+ for (i in this._idic) {
+ contents.push(Binary$dump32bitNumber$N(this._idic[i]));
+ }
+ if (verbose) {
+ console.log(' Dictionary Cache: ' + (this._idic.length * 16 + "") + ' bytes');
+ }
+ return contents.join("");
+};
+
+/**
+ * @param {!string} data
+ * @return {!number}
+ */
+FMIndex.prototype.load$S = function (data) {
+ return this.load$SI(data, 0);
+};
+
+/**
+ * @param {!string} data
+ * @param {!number} offset
+ * @return {!number}
+ */
+FMIndex.prototype.load$SI = function (data, offset) {
+ /** @type {!number} */
+ var maxChar;
+ /** @type {!number} */
+ var c;
+ /** @type {!number} */
+ var size;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var result$0;
+ /** @type {!number} */
+ var result$1;
+ result$0 = data.charCodeAt(offset) * 65536 + data.charCodeAt(offset + 1);
+ this._ddic = (result$0 | 0);
+ this._ssize = (Binary$load32bitNumber$SI(data, offset + 2) | 0);
+ this._head = (Binary$load32bitNumber$SI(data, offset + 4) | 0);
+ offset = this._sv.load$SI(data, offset + 6);
+ maxChar = Math.pow(2, this._sv.bitsize$());
+ for (c = 0; c < maxChar; c++) {
+ this._rlt[c] = this._sv.rank_less_than$II(this._sv.size$(), c);
+ }
+ result$1 = data.charCodeAt(offset) * 65536 + data.charCodeAt(offset + 1);
+ size = result$1;
+ offset += 2;
+ for (i = 0; i < size; (i++, offset += 2)) {
+ this._posdic.push(Binary$load32bitNumber$SI(data, offset));
+ }
+ for (i = 0; i < size; (i++, offset += 2)) {
+ this._idic.push(Binary$load32bitNumber$SI(data, offset));
+ }
+ return offset;
+};
+
+/**
+ * class Tag extends Object
+ * @constructor
+ */
+function Tag() {
+}
+
+/**
+ * @constructor
+ * @param {!string} name
+ */
+function Tag$S(name) {
+ this.name = name;
+ this.attributes = ({ });
+ this.isSelfClosing = false;
+};
+
+Tag$S.prototype = new Tag;
+
+/**
+ * class _Common extends Object
+ * @constructor
+ */
+function _Common() {
+}
+
+/**
+ * @constructor
+ */
+function _Common$() {
+};
+
+_Common$.prototype = new _Common;
+
+/**
+ * class _State extends Object
+ * @constructor
+ */
+function _State() {
+}
+
+/**
+ * @constructor
+ */
+function _State$() {
+};
+
+_State$.prototype = new _State;
+
+/**
+ * class SAXHandler extends Object
+ * @constructor
+ */
+function SAXHandler() {
+}
+
+/**
+ * @constructor
+ */
+function SAXHandler$() {
+ this.position = 0;
+ this.column = 0;
+ this.line = 0;
+};
+
+SAXHandler$.prototype = new SAXHandler;
+
+/**
+ * @param {Error} error
+ */
+SAXHandler.prototype.onerror$LError$ = function (error) {
+};
+
+/**
+ * @param {!string} text
+ */
+SAXHandler.prototype.ontext$S = function (text) {
+};
+
+/**
+ * @param {!string} doctype
+ */
+SAXHandler.prototype.ondoctype$S = function (doctype) {
+};
+
+/**
+ * @param {!string} name
+ * @param {!string} body
+ */
+SAXHandler.prototype.onprocessinginstruction$SS = function (name, body) {
+};
+
+/**
+ * @param {!string} sgmlDecl
+ */
+SAXHandler.prototype.onsgmldeclaration$S = function (sgmlDecl) {
+};
+
+/**
+ * @param {!string} tagname
+ * @param {Object.<string, undefined|!string>} attributes
+ */
+SAXHandler.prototype.onopentag$SHS = function (tagname, attributes) {
+};
+
+/**
+ * @param {!string} tagname
+ */
+SAXHandler.prototype.onclosetag$S = function (tagname) {
+};
+
+/**
+ * @param {!string} name
+ * @param {!string} value
+ */
+SAXHandler.prototype.onattribute$SS = function (name, value) {
+};
+
+/**
+ * @param {!string} comment
+ */
+SAXHandler.prototype.oncomment$S = function (comment) {
+};
+
+/**
+ */
+SAXHandler.prototype.onopencdata$ = function () {
+};
+
+/**
+ * @param {!string} cdata
+ */
+SAXHandler.prototype.oncdata$S = function (cdata) {
+};
+
+/**
+ */
+SAXHandler.prototype.onclosecdata$ = function () {
+};
+
+/**
+ */
+SAXHandler.prototype.onend$ = function () {
+};
+
+/**
+ */
+SAXHandler.prototype.onready$ = function () {
+};
+
+/**
+ * @param {!string} script
+ */
+SAXHandler.prototype.onscript$S = function (script) {
+};
+
+/**
+ * class _HTMLHandler extends SAXHandler
+ * @constructor
+ */
+function _HTMLHandler() {
+}
+
+_HTMLHandler.prototype = new SAXHandler;
+/**
+ * @constructor
+ * @param {Object.<string, undefined|Array.<undefined|!string>>} styles
+ * @param {!boolean} escape
+ */
+function _HTMLHandler$HASB(styles, escape) {
+ this.position = 0;
+ this.column = 0;
+ this.line = 0;
+ this.text = [ ];
+ this.escape = escape;
+ this.styles = styles;
+};
+
+_HTMLHandler$HASB.prototype = new _HTMLHandler;
+
+/**
+ * @param {!string} str
+ * @return {!string}
+ */
+_HTMLHandler.escapeHTML$S = function (str) {
+ return str.replace(/\n/g, "<br/>").replace(/&/g, "&amp;").replace(/"/g, "&quot;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
+};
+
+var _HTMLHandler$escapeHTML$S = _HTMLHandler.escapeHTML$S;
+
+/**
+ * @param {!string} tagname
+ * @param {Object.<string, undefined|!string>} attributes
+ */
+_HTMLHandler.prototype.onopentag$SHS = function (tagname, attributes) {
+ this.text.push(this.styles[tagname][0]);
+};
+
+/**
+ * @param {!string} tagname
+ */
+_HTMLHandler.prototype.onclosetag$S = function (tagname) {
+ this.text.push(this.styles[tagname][1]);
+};
+
+/**
+ * @param {!string} text
+ */
+_HTMLHandler.prototype.ontext$S = function (text) {
+ if (this.escape) {
+ this.text.push(text.replace(/\n/g, "<br/>").replace(/&/g, "&amp;").replace(/"/g, "&quot;").replace(/</g, "&lt;").replace(/>/g, "&gt;"));
+ } else {
+ this.text.push(text);
+ }
+};
+
+/**
+ * @return {!string}
+ */
+_HTMLHandler.prototype.result$ = function () {
+ return this.text.join('');
+};
+
+/**
+ * class SAXParser extends Object
+ * @constructor
+ */
+function SAXParser() {
+}
+
+/**
+ * @constructor
+ * @param {SAXHandler} handler
+ */
+function SAXParser$LSAXHandler$(handler) {
+ this.q = "";
+ this.c = "";
+ this.bufferCheckPosition = 0;
+ this.looseCase = "";
+ this.tags = [ ];
+ this.closed = false;
+ this.closedRoot = false;
+ this.sawRoot = false;
+ this.tag = null;
+ this.error = null;
+ this.handler = null;
+ this.ENTITIES = null;
+ this.strict = false;
+ this.tagName = "";
+ this.state = 0;
+ this.line = 0;
+ this.column = 0;
+ this.position = 0;
+ this.startTagPosition = 0;
+ this.attribName = "";
+ this.attribValue = "";
+ this.script = "";
+ this.textNode = "";
+ this.attribList = null;
+ this.noscript = false;
+ this.cdata = "";
+ this.procInstBody = "";
+ this.procInstName = "";
+ this.doctype = "";
+ this.entity = "";
+ this.sgmlDecl = "";
+ this.comment = "";
+ this.preTags = 0;
+ this._init$LSAXHandler$B(handler, false);
+};
+
+SAXParser$LSAXHandler$.prototype = new SAXParser;
+
+/**
+ * @constructor
+ * @param {SAXHandler} handler
+ * @param {!boolean} strict
+ */
+function SAXParser$LSAXHandler$B(handler, strict) {
+ this.q = "";
+ this.c = "";
+ this.bufferCheckPosition = 0;
+ this.looseCase = "";
+ this.tags = [ ];
+ this.closed = false;
+ this.closedRoot = false;
+ this.sawRoot = false;
+ this.tag = null;
+ this.error = null;
+ this.handler = null;
+ this.ENTITIES = null;
+ this.strict = false;
+ this.tagName = "";
+ this.state = 0;
+ this.line = 0;
+ this.column = 0;
+ this.position = 0;
+ this.startTagPosition = 0;
+ this.attribName = "";
+ this.attribValue = "";
+ this.script = "";
+ this.textNode = "";
+ this.attribList = null;
+ this.noscript = false;
+ this.cdata = "";
+ this.procInstBody = "";
+ this.procInstName = "";
+ this.doctype = "";
+ this.entity = "";
+ this.sgmlDecl = "";
+ this.comment = "";
+ this.preTags = 0;
+ this._init$LSAXHandler$B(handler, strict);
+};
+
+SAXParser$LSAXHandler$B.prototype = new SAXParser;
+
+/**
+ * @param {SAXHandler} handler
+ * @param {!boolean} strict
+ */
+SAXParser.prototype._init$LSAXHandler$B = function (handler, strict) {
+ this.handler = handler;
+ this.clearBuffers$();
+ this.q = "";
+ this.bufferCheckPosition = 65536;
+ this.looseCase = 'toLowerCase';
+ this.tags = [ ];
+ this.closed = this.closedRoot = this.sawRoot = false;
+ this.tag = null;
+ this.error = null;
+ this.strict = strict;
+ this.noscript = strict;
+ this.state = 1;
+ this.ENTITIES = _Entities$entity_list$();
+ this.attribList = [ ];
+ this.noscript = false;
+ this.preTags = 0;
+};
+
+/**
+ * @param {!boolean} flag
+ */
+SAXParser.prototype.set_noscript$B = function (flag) {
+ this.noscript = flag;
+};
+
+/**
+ * @return {SAXParser}
+ */
+SAXParser.prototype.resume$ = function () {
+ this.error = null;
+ return this;
+};
+
+/**
+ * @return {SAXParser}
+ */
+SAXParser.prototype.close$ = function () {
+ return this.parse$S('');
+};
+
+/**
+ * @param {!string} chunk
+ * @return {SAXParser}
+ */
+SAXParser.prototype.parse$S = function (chunk) {
+ /** @type {Char} */
+ var _;
+ /** @type {!number} */
+ var i;
+ /** @type {!string} */
+ var c;
+ /** @type {!number} */
+ var starti;
+ /** @type {!number} */
+ var pad;
+ /** @type {!number} */
+ var returnState;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$0;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$1;
+ /** @type {RegExp} */
+ var charclass$2;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$3;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$4;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$5;
+ /** @type {!string} */
+ var text$0;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$6;
+ /** @type {RegExp} */
+ var charclass$7;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$8;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$9;
+ /** @type {RegExp} */
+ var charclass$10;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$11;
+ /** @type {RegExp} */
+ var charclass$12;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$13;
+ /** @type {RegExp} */
+ var charclass$14;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$15;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$16;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$17;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$18;
+ /** @type {RegExp} */
+ var charclass$19;
+ /** @type {RegExp} */
+ var charclass$20;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$21;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$22;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$23;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$24;
+ /** @type {!string} */
+ var comment$0;
+ _ = new Char$();
+ if (this.error) {
+ throw this.error;
+ }
+ if (this.closed) {
+ return this.emiterror$S("Cannot write after close. Assign an onready handler.");
+ }
+ (i = 0, c = "");
+ while (this.c = c = chunk.charAt(i++)) {
+ this.position++;
+ if (c === "\n") {
+ this.handler.line++;
+ this.handler.column = 0;
+ } else {
+ this.handler.column++;
+ }
+ switch (this.state) {
+ case 1:
+ if (c === "<") {
+ this.state = 4;
+ this.startTagPosition = this.position;
+ } else {
+ charclass$0 = _.whitespace;
+ if (! $__jsx_ObjectHasOwnProperty.call(charclass$0, c)) {
+ this.strictFail$S("Non-whitespace before first tag.");
+ this.textNode = c;
+ this.state = 2;
+ }
+ }
+ continue;
+ case 2:
+ if (this.sawRoot && ! this.closedRoot) {
+ starti = i - 1;
+ while (c && c !== "<" && c !== "&") {
+ c = chunk.charAt(i++);
+ if (c) {
+ this.position++;
+ if (c === "\n") {
+ this.handler.line++;
+ this.handler.column = 0;
+ } else {
+ this.handler.column++;
+ }
+ }
+ }
+ this.textNode += chunk.substring(starti, i - 1);
+ }
+ if (c === "<") {
+ this.state = 4;
+ this.startTagPosition = this.position;
+ } else {
+ if (_.not$HBS(_.whitespace, c) && (! this.sawRoot || this.closedRoot)) {
+ this.strictFail$S("Text data outside of root node.");
+ }
+ if (c === "&") {
+ this.state = 3;
+ } else {
+ this.textNode += c;
+ }
+ }
+ continue;
+ case 33:
+ if (c === "<") {
+ this.state = 34;
+ } else {
+ this.script += c;
+ }
+ continue;
+ case 34:
+ if (c === "/") {
+ this.state = 31;
+ } else {
+ this.script += "<" + c;
+ this.state = 33;
+ }
+ continue;
+ case 4:
+ if (c === "!") {
+ this.state = 5;
+ this.sgmlDecl = "";
+ } else {
+ charclass$1 = _.whitespace;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$1, c)) {
+ } else {
+ charclass$2 = _.nameStart;
+ if (charclass$2.test(c)) {
+ this.state = 21;
+ this.tagName = c;
+ } else {
+ if (c === "/") {
+ this.state = 31;
+ this.tagName = "";
+ } else {
+ if (c === "?") {
+ this.state = 18;
+ this.procInstName = this.procInstBody = "";
+ } else {
+ this.strictFail$S("Unencoded <");
+ if (this.startTagPosition + 1 < this.position) {
+ pad = this.position - this.startTagPosition;
+ for (i = 0; i < pad; i++) {
+ c = " " + c;
+ }
+ }
+ this.textNode += "<" + c;
+ this.state = 2;
+ }
+ }
+ }
+ }
+ }
+ continue;
+ case 5:
+ if ((this.sgmlDecl + c).toUpperCase() === _.CDATA) {
+ this.closetext_if_exist$();
+ this.state = 15;
+ this.sgmlDecl = "";
+ this.cdata = "";
+ } else {
+ if (this.sgmlDecl + c === "--") {
+ this.state = 12;
+ this.comment = "";
+ this.sgmlDecl = "";
+ } else {
+ if ((this.sgmlDecl + c).toUpperCase() === _.DOCTYPE) {
+ this.state = 7;
+ if (this.doctype || this.sawRoot) {
+ this.strictFail$S("Inappropriately located doctype declaration");
+ }
+ this.doctype = "";
+ this.sgmlDecl = "";
+ } else {
+ if (c === ">") {
+ this.closetext_if_exist$();
+ this.sgmlDecl = "";
+ this.state = 2;
+ } else {
+ charclass$3 = _.quote;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$3, c)) {
+ this.state = 6;
+ this.sgmlDecl += c;
+ } else {
+ this.sgmlDecl += c;
+ }
+ }
+ }
+ }
+ }
+ continue;
+ case 6:
+ if (c === this.q) {
+ this.state = 5;
+ this.q = "";
+ }
+ this.sgmlDecl += c;
+ continue;
+ case 7:
+ if (c === ">") {
+ this.state = 2;
+ this.closetext_if_exist$();
+ this.doctype.trim();
+ } else {
+ this.doctype += c;
+ if (c === "[") {
+ this.state = 9;
+ } else {
+ charclass$4 = _.quote;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$4, c)) {
+ this.state = 8;
+ this.q = c;
+ }
+ }
+ }
+ continue;
+ case 8:
+ this.doctype += c;
+ if (c === this.q) {
+ this.q = "";
+ this.state = 7;
+ }
+ continue;
+ case 9:
+ this.doctype += c;
+ if (c === "]") {
+ this.state = 7;
+ } else {
+ charclass$5 = _.quote;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$5, c)) {
+ this.state = 10;
+ this.q = c;
+ }
+ }
+ continue;
+ case 10:
+ this.doctype += c;
+ if (c === this.q) {
+ this.state = 9;
+ this.q = "";
+ }
+ continue;
+ case 12:
+ if (c === "-") {
+ this.state = 13;
+ } else {
+ this.comment += c;
+ }
+ continue;
+ case 13:
+ if (c === "-") {
+ this.state = 14;
+ text$0 = this.comment;
+ text$0 = text$0.replace(/[\n\t]/g, ' ');
+ text$0 = text$0.replace(/\s\s+/g, " ");
+ comment$0 = this.comment = text$0;
+ if (comment$0) {
+ this.closetext_if_exist$();
+ this.comment.trim();
+ }
+ this.comment = "";
+ } else {
+ this.comment += "-" + c;
+ this.state = 12;
+ }
+ continue;
+ case 14:
+ if (c !== ">") {
+ this.strictFail$S("Malformed comment");
+ this.comment += "--" + c;
+ this.state = 12;
+ } else {
+ this.state = 2;
+ }
+ continue;
+ case 15:
+ if (c === "]") {
+ this.state = 16;
+ } else {
+ this.cdata += c;
+ }
+ continue;
+ case 16:
+ if (c === "]") {
+ this.state = 17;
+ } else {
+ this.cdata += "]" + c;
+ this.state = 15;
+ }
+ continue;
+ case 17:
+ if (c === ">") {
+ if (this.cdata) {
+ this.closetext_if_exist$();
+ }
+ this.cdata = "";
+ this.state = 2;
+ } else {
+ if (c === "]") {
+ this.cdata += "]";
+ } else {
+ this.cdata += "]]" + c;
+ this.state = 15;
+ }
+ }
+ continue;
+ case 18:
+ if (c === "?") {
+ this.state = 20;
+ } else {
+ charclass$6 = _.whitespace;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$6, c)) {
+ this.state = 19;
+ } else {
+ this.procInstName += c;
+ }
+ }
+ continue;
+ case 19:
+ if (! this.procInstBody && _.is$HBS(_.whitespace, c)) {
+ continue;
+ } else {
+ if (c === "?") {
+ this.state = 20;
+ } else {
+ this.procInstBody += c;
+ }
+ }
+ continue;
+ case 20:
+ if (c === ">") {
+ this.closetext_if_exist$();
+ this.procInstName = this.procInstBody = "";
+ this.state = 2;
+ } else {
+ this.procInstBody += "?" + c;
+ this.state = 19;
+ }
+ continue;
+ case 21:
+ charclass$7 = _.nameBody;
+ if (charclass$7.test(c)) {
+ this.tagName += c;
+ } else {
+ this.newTag$();
+ if (c === ">") {
+ this.openTag$B(false);
+ } else {
+ if (c === "/") {
+ this.state = 22;
+ } else {
+ charclass$8 = _.whitespace;
+ if (! $__jsx_ObjectHasOwnProperty.call(charclass$8, c)) {
+ this.strictFail$S("Invalid character in tag name");
+ }
+ this.state = 23;
+ }
+ }
+ }
+ continue;
+ case 22:
+ if (c === ">") {
+ this.openTag$B(true);
+ this.closeTag$();
+ } else {
+ this.strictFail$S("Forward-slash in opening tag not followed by >");
+ this.state = 23;
+ }
+ continue;
+ case 23:
+ charclass$9 = _.whitespace;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$9, c)) {
+ continue;
+ } else {
+ if (c === ">") {
+ this.openTag$B(false);
+ } else {
+ if (c === "/") {
+ this.state = 22;
+ } else {
+ charclass$10 = _.nameStart;
+ if (charclass$10.test(c)) {
+ this.attribName = c;
+ this.attribValue = "";
+ this.state = 24;
+ } else {
+ this.strictFail$S("Invalid attribute name");
+ }
+ }
+ }
+ }
+ continue;
+ case 24:
+ if (c === "=") {
+ this.state = 26;
+ } else {
+ if (c === ">") {
+ this.strictFail$S("Attribute without value");
+ this.attribValue = this.attribName;
+ this.attrib$();
+ this.openTag$B(false);
+ } else {
+ charclass$11 = _.whitespace;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$11, c)) {
+ this.state = 25;
+ } else {
+ charclass$12 = _.nameBody;
+ if (charclass$12.test(c)) {
+ this.attribName += c;
+ } else {
+ this.strictFail$S("Invalid attribute name");
+ }
+ }
+ }
+ }
+ continue;
+ case 25:
+ if (c === "=") {
+ this.state = 26;
+ } else {
+ charclass$13 = _.whitespace;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$13, c)) {
+ continue;
+ } else {
+ this.strictFail$S("Attribute without value");
+ this.tag.attributes[this.attribName] = "";
+ this.attribValue = "";
+ this.closetext_if_exist$();
+ this.attribName = "";
+ if (c === ">") {
+ this.openTag$B(false);
+ } else {
+ charclass$14 = _.nameStart;
+ if (charclass$14.test(c)) {
+ this.attribName = c;
+ this.state = 24;
+ } else {
+ this.strictFail$S("Invalid attribute name");
+ this.state = 23;
+ }
+ }
+ }
+ }
+ continue;
+ case 26:
+ charclass$15 = _.whitespace;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$15, c)) {
+ continue;
+ } else {
+ charclass$16 = _.quote;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$16, c)) {
+ this.q = c;
+ this.state = 27;
+ } else {
+ this.strictFail$S("Unquoted attribute value");
+ this.state = 28;
+ this.attribValue = c;
+ }
+ }
+ continue;
+ case 27:
+ if (c !== this.q) {
+ if (c === "&") {
+ this.state = 29;
+ } else {
+ this.attribValue += c;
+ }
+ continue;
+ }
+ this.attrib$();
+ this.q = "";
+ this.state = 23;
+ continue;
+ case 28:
+ charclass$17 = _.attribEnd;
+ if (! $__jsx_ObjectHasOwnProperty.call(charclass$17, c)) {
+ if (c === "&") {
+ this.state = 30;
+ } else {
+ this.attribValue += c;
+ }
+ continue;
+ }
+ this.attrib$();
+ if (c === ">") {
+ this.openTag$B(false);
+ } else {
+ this.state = 23;
+ }
+ continue;
+ case 31:
+ if (! this.tagName) {
+ charclass$18 = _.whitespace;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$18, c)) {
+ continue;
+ } else {
+ charclass$19 = _.nameStart;
+ if (! charclass$19.test(c)) {
+ if (this.script) {
+ this.script += "</" + c;
+ this.state = 33;
+ } else {
+ this.strictFail$S("Invalid tagname in closing tag.");
+ }
+ } else {
+ this.tagName = c;
+ }
+ }
+ } else {
+ if (c === ">") {
+ this.closeTag$();
+ } else {
+ charclass$20 = _.nameBody;
+ if (charclass$20.test(c)) {
+ this.tagName += c;
+ } else {
+ if (this.script) {
+ this.script += "</" + this.tagName;
+ this.tagName = "";
+ this.state = 33;
+ } else {
+ charclass$21 = _.whitespace;
+ if (! $__jsx_ObjectHasOwnProperty.call(charclass$21, c)) {
+ this.strictFail$S("Invalid tagname in closing tag");
+ }
+ this.state = 32;
+ }
+ }
+ }
+ }
+ continue;
+ case 32:
+ charclass$22 = _.whitespace;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$22, c)) {
+ continue;
+ }
+ if (c === ">") {
+ this.closeTag$();
+ } else {
+ this.strictFail$S("Invalid characters in closing tag");
+ }
+ continue;
+ case 3:
+ if (c === ";") {
+ this.textNode += this.parseEntity$();
+ this.entity = "";
+ this.state = 2;
+ } else {
+ charclass$23 = _.entity;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$23, c)) {
+ this.entity += c;
+ } else {
+ this.strictFail$S("Invalid character entity");
+ this.textNode += "&" + this.entity + c;
+ this.entity = "";
+ this.state = 2;
+ }
+ }
+ continue;
+ case 29:
+ case 30:
+ if (this.state === 29) {
+ returnState = 27;
+ } else {
+ returnState = 28;
+ }
+ if (c === ";") {
+ this.attribValue += this.parseEntity$();
+ this.entity = "";
+ this.state = (returnState | 0);
+ } else {
+ charclass$24 = _.entity;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$24, c)) {
+ this.entity += c;
+ } else {
+ this.strictFail$S("Invalid character entity");
+ this.attribValue += "&" + this.entity + c;
+ this.entity = "";
+ this.state = (returnState | 0);
+ }
+ }
+ continue;
+ default:
+ throw new Error("Unknown state: " + (this.state + ""));
+ }
+ }
+ this.end$();
+ return this;
+};
+
+/**
+ */
+SAXParser.prototype.clearBuffers$ = function () {
+ this.comment = '';
+ this.sgmlDecl = '';
+ this.textNode = '';
+ this.tagName = '';
+ this.doctype = '';
+ this.procInstName = '';
+ this.procInstBody = '';
+ this.entity = '';
+ this.attribName = '';
+ this.attribValue = '';
+ this.cdata = '';
+ this.script = '';
+};
+
+/**
+ */
+SAXParser.prototype.closetext_if_exist$ = function () {
+ if (this.textNode !== '') {
+ this.closetext$();
+ }
+};
+
+/**
+ */
+SAXParser.prototype.closetext$ = function () {
+ /** @type {!string} */
+ var text;
+ /** @type {!string} */
+ var text$0;
+ if (this.preTags === 0) {
+ text$0 = this.textNode;
+ text$0 = text$0.replace(/[\n\t]/g, ' ');
+ text$0 = text$0.replace(/\s\s+/g, " ");
+ text = text$0;
+ if (text$0) {
+ this.handler.ontext$S(text);
+ }
+ } else {
+ if (this.textNode) {
+ this.handler.ontext$S(this.textNode);
+ }
+ }
+ this.textNode = "";
+};
+
+/**
+ * @param {!string} text
+ * @return {!string}
+ */
+SAXParser.prototype.textopts$S = function (text) {
+ text = text.replace(/[\n\t]/g, ' ');
+ text = text.replace(/\s\s+/g, " ");
+ return text;
+};
+
+/**
+ * @param {!string} er
+ * @return {SAXParser}
+ */
+SAXParser.prototype.emiterror$S = function (er) {
+ /** @type {Error} */
+ var error;
+ this.closetext$();
+ er += "\nLine: " + (this.line + "") + "\nColumn: " + (this.column + "") + "\nChar: " + this.c;
+ error = new Error(er);
+ this.error = error;
+ return this;
+};
+
+/**
+ */
+SAXParser.prototype.end$ = function () {
+ if (! this.closedRoot) {
+ this.strictFail$S("Unclosed root tag");
+ }
+ if (this.state !== 2) {
+ this.emiterror$S("Unexpected end");
+ }
+ this.closetext$();
+ this.c = "";
+ this.closed = true;
+};
+
+/**
+ * @param {!string} message
+ */
+SAXParser.prototype.strictFail$S = function (message) {
+ if (this.strict) {
+ this.emiterror$S(message);
+ }
+};
+
+/**
+ */
+SAXParser.prototype.newTag$ = function () {
+ if (! this.strict) {
+ this.tagName = this.tagName.toLowerCase();
+ }
+ this.tag = ({name: this.tagName, attributes: ({ }), isSelfClosing: false});
+ this.attribList.length = 0;
+};
+
+/**
+ */
+SAXParser.prototype.attrib$ = function () {
+ if (! this.strict) {
+ this.attribName = this.attribName.toLowerCase();
+ }
+ if ($__jsx_ObjectHasOwnProperty.call(this.tag.attributes, this.attribName)) {
+ this.attribName = this.attribValue = "";
+ return;
+ }
+ this.tag.attributes[this.attribName] = this.attribValue;
+ this.closetext_if_exist$();
+ this.attribName = this.attribValue = "";
+};
+
+/**
+ */
+SAXParser.prototype.openTag$ = function () {
+ this.openTag$B(false);
+};
+
+/**
+ * @param {!boolean} selfClosing
+ */
+SAXParser.prototype.openTag$B = function (selfClosing) {
+ /** @type {Tag} */
+ var tag$0;
+ /** @type {Tag} */
+ var tag$1;
+ (tag$0 = this.tag).isSelfClosing = selfClosing;
+ this.sawRoot = true;
+ this.tags.push(tag$0);
+ this.closetext_if_exist$();
+ this.handler.onopentag$SHS((tag$1 = this.tag).name, tag$1.attributes);
+ if (this.tag.name === 'pre') {
+ this.preTags++;
+ }
+ if (! selfClosing) {
+ if (! this.noscript && this.tagName.toLowerCase() === "script") {
+ this.state = 33;
+ } else {
+ this.state = 2;
+ }
+ this.tag = null;
+ this.tagName = "";
+ }
+ this.attribName = this.attribValue = "";
+ this.attribList.length = 0;
+};
+
+/**
+ */
+SAXParser.prototype.closeTag$ = function () {
+ /** @type {!number} */
+ var t;
+ /** @type {!string} */
+ var tagName;
+ /** @type {!string} */
+ var closeTo;
+ /** @type {Tag} */
+ var close;
+ /** @type {!number} */
+ var s;
+ /** @type {Tag} */
+ var tag$0;
+ if (! this.tagName) {
+ this.strictFail$S("Weird empty close tag.");
+ this.textNode += "</>";
+ this.state = 2;
+ return;
+ }
+ if (this.script) {
+ if (this.tagName !== "script") {
+ this.script += "</" + this.tagName + ">";
+ this.tagName = "";
+ this.state = 33;
+ return;
+ }
+ this.closetext_if_exist$();
+ this.script = "";
+ }
+ t = this.tags.length;
+ tagName = this.tagName;
+ if (! this.strict) {
+ tagName = tagName.toLowerCase();
+ }
+ closeTo = tagName;
+ while (t--) {
+ close = this.tags[t];
+ if (close.name !== closeTo) {
+ this.strictFail$S("Unexpected close tag");
+ } else {
+ break;
+ }
+ }
+ if (t < 0) {
+ this.strictFail$S("Unmatched closing tag: " + this.tagName);
+ this.textNode += "</" + this.tagName + ">";
+ this.state = 2;
+ return;
+ }
+ this.tagName = tagName;
+ s = this.tags.length;
+ while (s-- > t) {
+ tag$0 = this.tag = this.tags.pop();
+ this.tagName = tag$0.name;
+ this.closetext_if_exist$();
+ this.handler.onclosetag$S(this.tagName);
+ if (this.tagName === 'pre') {
+ this.preTags--;
+ }
+ }
+ if (t === 0) {
+ this.closedRoot = true;
+ }
+ this.tagName = this.attribValue = this.attribName = "";
+ this.attribList.length = 0;
+ this.state = 2;
+};
+
+/**
+ * @return {!string}
+ */
+SAXParser.prototype.parseEntity$ = function () {
+ /** @type {!string} */
+ var entity;
+ /** @type {!string} */
+ var entityLC;
+ /** @type {!number} */
+ var num;
+ /** @type {!string} */
+ var numStr;
+ entity = this.entity;
+ entityLC = entity.toLowerCase();
+ num = 0;
+ numStr = "";
+ if (this.ENTITIES[entity]) {
+ return this.ENTITIES[entity];
+ }
+ if (this.ENTITIES[entityLC]) {
+ return this.ENTITIES[entityLC];
+ }
+ entity = entityLC;
+ if (entityLC.charAt(0) === "#") {
+ if (entity.charAt(1) === "x") {
+ entity = entity.slice(2);
+ num = $__jsx_parseInt(entity, 16);
+ numStr = num.toString(16);
+ } else {
+ entity = entity.slice(1);
+ num = $__jsx_parseInt(entity, 10);
+ numStr = num.toString(10);
+ }
+ }
+ entity = entity.replace(/^0+/, "");
+ if (numStr.toLowerCase() !== entity) {
+ this.strictFail$S("Invalid character entity");
+ return "&" + this.entity + ";";
+ }
+ return String.fromCharCode(num);
+};
+
+/**
+ * class Char extends Object
+ * @constructor
+ */
+function Char() {
+}
+
+/**
+ * @constructor
+ */
+function Char$() {
+ this.CDATA = "[CDATA[";
+ this.DOCTYPE = "DOCTYPE";
+ this.XML_NAMESPACE = "http://www.w3.org/XML/1998/namespace";
+ this.whitespace = this._charClass$S("\r\n\t ");
+ this.number = this._charClass$S("0124356789");
+ this.letter = this._charClass$S("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ");
+ this.quote = this._charClass$S("'\"");
+ this.entity = this._charClass$S("0124356789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ#");
+ this.attribEnd = this._charClass$S("\r\n\t >");
+ this.nameStart = /[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/;
+ this.nameBody = /[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040\.\d-]/;
+};
+
+Char$.prototype = new Char;
+
+/**
+ * @param {!string} str
+ * @return {Object.<string, undefined|!boolean>}
+ */
+Char.prototype._charClass$S = function (str) {
+ /** @type {Object.<string, undefined|!boolean>} */
+ var result;
+ /** @type {!number} */
+ var i;
+ result = ({ });
+ for (i = 0; i < str.length; i++) {
+ result[str.slice(i, i + 1)] = true;
+ }
+ return result;
+};
+
+/**
+ * @param {RegExp} charclass
+ * @param {!string} c
+ * @return {!boolean}
+ */
+Char.prototype.is$LRegExp$S = function (charclass, c) {
+ return charclass.test(c);
+};
+
+/**
+ * @param {Object.<string, undefined|!boolean>} charclass
+ * @param {!string} c
+ * @return {!boolean}
+ */
+Char.prototype.is$HBS = function (charclass, c) {
+ return $__jsx_ObjectHasOwnProperty.call(charclass, c);
+};
+
+/**
+ * @param {RegExp} charclass
+ * @param {!string} c
+ * @return {!boolean}
+ */
+Char.prototype.not$LRegExp$S = function (charclass, c) {
+ return ! charclass.test(c);
+};
+
+/**
+ * @param {Object.<string, undefined|!boolean>} charclass
+ * @param {!string} c
+ * @return {!boolean}
+ */
+Char.prototype.not$HBS = function (charclass, c) {
+ return ! $__jsx_ObjectHasOwnProperty.call(charclass, c);
+};
+
+/**
+ * class _Entities extends Object
+ * @constructor
+ */
+function _Entities() {
+}
+
+/**
+ * @constructor
+ */
+function _Entities$() {
+};
+
+_Entities$.prototype = new _Entities;
+
+/**
+ * @return {Object.<string, undefined|!string>}
+ */
+_Entities.entity_list$ = function () {
+ /** @type {Object.<string, undefined|!string>} */
+ var result;
+ /** @type {!string} */
+ var key;
+ /** @type {*} */
+ var value;
+ result = ({ });
+ for (key in _Entities._entities) {
+ value = _Entities._entities[key];
+ if (typeof value === 'string') {
+ result[key] = value + "";
+ } else {
+ if (typeof value === 'number') {
+ result[key] = String.fromCharCode(value | 0);
+ }
+ }
+ }
+ return result;
+};
+
+var _Entities$entity_list$ = _Entities.entity_list$;
+
+/**
+ * class BitVector extends Object
+ * @constructor
+ */
+function BitVector() {
+}
+
+/**
+ * @constructor
+ */
+function BitVector$() {
+ /** @type {Array.<undefined|!number>} */
+ var _v$0;
+ /** @type {Array.<undefined|!number>} */
+ var _r$0;
+ _r$0 = this._r = [ ];
+ _v$0 = this._v = [ ];
+ _v$0.length = 0;
+ _r$0.length = 0;
+ this._size = 0;
+ this._size1 = 0;
+};
+
+BitVector$.prototype = new BitVector;
+
+/**
+ */
+BitVector.prototype.build$ = function () {
+ /** @type {!number} */
+ var i;
+ this._size1 = 0;
+ for (i = 0; i < this._v.length; i++) {
+ if (i % 8 === 0) {
+ this._r.push(true ? this._size1 : this._size - this._size1);
+ }
+ this._size1 += this._rank32$IIB(this._v[i], 32, true);
+ }
+};
+
+/**
+ */
+BitVector.prototype.clear$ = function () {
+ this._v.length = 0;
+ this._r.length = 0;
+ this._size = 0;
+ this._size1 = 0;
+};
+
+/**
+ * @return {!number}
+ */
+BitVector.prototype.size$ = function () {
+ return this._size;
+};
+
+/**
+ * @param {!boolean} b
+ * @return {!number}
+ */
+BitVector.prototype.size$B = function (b) {
+ return (b ? this._size1 : this._size - this._size1);
+};
+
+/**
+ * @param {!number} value
+ */
+BitVector.prototype.set$I = function (value) {
+ this.set$IB(value, true);
+};
+
+/**
+ * @param {!number} value
+ * @param {!boolean} flag
+ */
+BitVector.prototype.set$IB = function (value, flag) {
+ /** @type {!number} */
+ var q;
+ /** @type {!number} */
+ var r;
+ /** @type {!number} */
+ var m;
+ if (value >= this._size) {
+ this._size = (value + 1 | 0);
+ }
+ q = (value / 32 | 0);
+ r = (value % 32 | 0);
+ while (q >= this._v.length) {
+ this._v.push(0);
+ }
+ m = 0x1 << r;
+ if (flag) {
+ this._v[q] |= m;
+ } else {
+ this._v[q] &= ~ m;
+ }
+};
+
+/**
+ * @param {!number} value
+ * @return {!boolean}
+ */
+BitVector.prototype.get$I = function (value) {
+ /** @type {!number} */
+ var q;
+ /** @type {!number} */
+ var r;
+ /** @type {!number} */
+ var m;
+ if (value >= this._size) {
+ throw new Error("BitVector.get() : range error");
+ }
+ q = (value / 32 | 0);
+ r = (value % 32 | 0);
+ m = 0x1 << r;
+ return !! (this._v[q] & m);
+};
+
+/**
+ * @param {!number} i
+ * @return {!number}
+ */
+BitVector.prototype.rank$I = function (i) {
+ return this.rank$IB(i, true);
+};
+
+/**
+ * @param {!number} i
+ * @param {!boolean} b
+ * @return {!number}
+ */
+BitVector.prototype.rank$IB = function (i, b) {
+ /** @type {!number} */
+ var q_large;
+ /** @type {!number} */
+ var q_small;
+ /** @type {!number} */
+ var r;
+ /** @type {!number} */
+ var rank;
+ /** @type {!number} */
+ var begin;
+ /** @type {!number} */
+ var j;
+ if (i > this._size) {
+ throw new Error("BitVector.rank() : range error");
+ }
+ if (i === 0) {
+ return 0;
+ }
+ i--;
+ q_large = (Math.floor(i / 256) | 0);
+ q_small = (Math.floor(i / 32) | 0);
+ r = (Math.floor(i % 32) | 0);
+ rank = (this._r[q_large] | 0);
+ if (! b) {
+ rank = q_large * 256 - rank;
+ }
+ begin = q_large * 8;
+ for (j = begin; j < q_small; j++) {
+ rank += this._rank32$IIB(this._v[j], 32, b);
+ }
+ rank += this._rank32$IIB(this._v[q_small], r + 1, b);
+ return rank;
+};
+
+/**
+ * @param {!number} i
+ * @return {!number}
+ */
+BitVector.prototype.select$I = function (i) {
+ return this.select$IB(i, true);
+};
+
+/**
+ * @param {!number} i
+ * @param {!boolean} b
+ * @return {!number}
+ */
+BitVector.prototype.select$IB = function (i, b) {
+ /** @type {!number} */
+ var left;
+ /** @type {!number} */
+ var right;
+ /** @type {!number} */
+ var pivot;
+ /** @type {undefined|!number} */
+ var rank;
+ /** @type {!number} */
+ var j;
+ if (i >= (b ? this._size1 : this._size - this._size1)) {
+ throw new Error("BitVector.select() : range error");
+ }
+ left = 0;
+ right = this._r.length;
+ while (left < right) {
+ pivot = Math.floor((left + right) / 2);
+ rank = this._r[pivot];
+ if (! b) {
+ rank = pivot * 256 - rank;
+ }
+ if (i < rank) {
+ right = pivot;
+ } else {
+ left = pivot + 1;
+ }
+ }
+ right--;
+ if (b) {
+ i -= (this._r[right] | 0);
+ } else {
+ i -= (right * 256 - this._r[right] | 0);
+ }
+ j = right * 8;
+ while (1) {
+ rank = this._rank32$IIB(this._v[j], 32, b);
+ if (i < rank) {
+ break;
+ }
+ j++;
+ i -= (rank | 0);
+ }
+ return (j * 32 + this._select32$IIB(this._v[j], i, b) | 0);
+};
+
+/**
+ * @param {!number} x
+ * @param {!number} i
+ * @param {!boolean} b
+ * @return {!number}
+ */
+BitVector.prototype._rank32$IIB = function (x, i, b) {
+ if (! b) {
+ x = ~ x;
+ }
+ x <<= 32 - i;
+ x = ((x & 0xaaaaaaaa) >>> 1) + (x & 0x55555555);
+ x = ((x & 0xcccccccc) >>> 2) + (x & 0x33333333);
+ x = ((x & 0xf0f0f0f0) >>> 4) + (x & 0x0f0f0f0f);
+ x = ((x & 0xff00ff00) >>> 8) + (x & 0x00ff00ff);
+ x = ((x & 0xffff0000) >>> 16) + (x & 0x0000ffff);
+ return x;
+};
+
+/**
+ * @param {!number} x
+ * @param {!number} i
+ * @param {!boolean} b
+ * @return {!number}
+ */
+BitVector.prototype._select32$IIB = function (x, i, b) {
+ /** @type {!number} */
+ var x1;
+ /** @type {!number} */
+ var x2;
+ /** @type {!number} */
+ var x3;
+ /** @type {!number} */
+ var x4;
+ /** @type {!number} */
+ var x5;
+ /** @type {!number} */
+ var pos;
+ /** @type {!number} */
+ var v5;
+ /** @type {!number} */
+ var v4;
+ /** @type {!number} */
+ var v3;
+ /** @type {!number} */
+ var v2;
+ /** @type {!number} */
+ var v1;
+ /** @type {!number} */
+ var v0;
+ if (! b) {
+ x = ~ x;
+ }
+ x1 = ((x & 0xaaaaaaaa) >>> 1) + (x & 0x55555555);
+ x2 = ((x1 & 0xcccccccc) >>> 2) + (x1 & 0x33333333);
+ x3 = ((x2 & 0xf0f0f0f0) >>> 4) + (x2 & 0x0f0f0f0f);
+ x4 = ((x3 & 0xff00ff00) >>> 8) + (x3 & 0x00ff00ff);
+ x5 = ((x4 & 0xffff0000) >>> 16) + (x4 & 0x0000ffff);
+ i++;
+ pos = 0;
+ v5 = x5 & 0xffffffff;
+ if (i > v5) {
+ i -= (v5 | 0);
+ pos += 32;
+ }
+ v4 = x4 >>> pos & 0x0000ffff;
+ if (i > v4) {
+ i -= (v4 | 0);
+ pos += 16;
+ }
+ v3 = x3 >>> pos & 0x000000ff;
+ if (i > v3) {
+ i -= (v3 | 0);
+ pos += 8;
+ }
+ v2 = x2 >>> pos & 0x0000000f;
+ if (i > v2) {
+ i -= (v2 | 0);
+ pos += 4;
+ }
+ v1 = x1 >>> pos & 0x00000003;
+ if (i > v1) {
+ i -= (v1 | 0);
+ pos += 2;
+ }
+ v0 = x >>> pos & 0x00000001;
+ if (i > v0) {
+ i -= (v0 | 0);
+ pos += 1;
+ }
+ return (pos | 0);
+};
+
+/**
+ * @return {!string}
+ */
+BitVector.prototype.dump$ = function () {
+ /** @type {Array.<undefined|!string>} */
+ var contents;
+ contents = [ ];
+ contents.push(Binary$dump32bitNumber$N(this._size));
+ contents.push(Binary$dump32bitNumberList$AN(this._v));
+ return contents.join('');
+};
+
+/**
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+BitVector.prototype.dump$LCompressionReport$ = function (report) {
+ /** @type {Array.<undefined|!string>} */
+ var contents;
+ contents = [ ];
+ contents.push(Binary$dump32bitNumber$N(this._size));
+ CompressionReport$add$LCompressionReport$II(report, 2, 2);
+ contents.push(Binary$dump32bitNumberList$ANLCompressionReport$(this._v, report));
+ return contents.join('');
+};
+
+/**
+ * @param {!string} data
+ * @return {!number}
+ */
+BitVector.prototype.load$S = function (data) {
+ return this.load$SI(data, 0);
+};
+
+/**
+ * @param {!string} data
+ * @param {!number} offset
+ * @return {!number}
+ */
+BitVector.prototype.load$SI = function (data, offset) {
+ /** @type {LoadedNumberListResult} */
+ var result;
+ /** @type {!number} */
+ var result$0;
+ this._v.length = 0;
+ this._r.length = 0;
+ this._size = 0;
+ this._size1 = 0;
+ result$0 = data.charCodeAt(offset) * 65536 + data.charCodeAt(offset + 1);
+ this._size = (result$0 | 0);
+ result = Binary$load32bitNumberList$SI(data, offset + 2);
+ this._v = result.result;
+ this.build$();
+ return result.offset;
+};
+
+/**
+ * class WaveletMatrix extends Object
+ * @constructor
+ */
+function WaveletMatrix() {
+}
+
+/**
+ * @constructor
+ */
+function WaveletMatrix$() {
+ /** @type {Array.<undefined|BitVector>} */
+ var _bv$0;
+ /** @type {Array.<undefined|!number>} */
+ var _seps$0;
+ this._range = ({ });
+ _bv$0 = this._bv = [ ];
+ _seps$0 = this._seps = [ ];
+ this._bitsize = 16;
+ _bv$0.length = 0;
+ _seps$0.length = 0;
+ this._size = 0;
+};
+
+WaveletMatrix$.prototype = new WaveletMatrix;
+
+/**
+ * @return {!number}
+ */
+WaveletMatrix.prototype.bitsize$ = function () {
+ return this._bitsize;
+};
+
+/**
+ * @param {!number} charCode
+ */
+WaveletMatrix.prototype.setMaxCharCode$I = function (charCode) {
+ this._bitsize = (Math.ceil(Math.log(charCode) / 0.6931471805599453) | 0);
+};
+
+/**
+ */
+WaveletMatrix.prototype.clear$ = function () {
+ this._bv.length = 0;
+ this._seps.length = 0;
+ this._size = 0;
+};
+
+/**
+ * @param {!string} v
+ */
+WaveletMatrix.prototype.build$S = function (v) {
+ /** @type {!number} */
+ var size;
+ /** @type {!number} */
+ var bitsize;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var depth;
+ /** @type {Object.<string, undefined|!number>} */
+ var range_tmp;
+ /** @type {!number} */
+ var code;
+ /** @type {!boolean} */
+ var bit;
+ /** @type {!number} */
+ var key;
+ /** @type {Object.<string, undefined|!number>} */
+ var range_rev;
+ /** @type {!string} */
+ var range_key;
+ /** @type {!number} */
+ var value;
+ /** @type {!number} */
+ var pos0;
+ /** @type {undefined|!number} */
+ var pos1;
+ /** @type {!string} */
+ var range_rev_key;
+ /** @type {!number} */
+ var begin;
+ /** @type {undefined|!number} */
+ var end;
+ /** @type {!number} */
+ var num0;
+ /** @type {!number} */
+ var num1;
+ this._bv.length = 0;
+ this._seps.length = 0;
+ this._size = 0;
+ size = v.length;
+ bitsize = this._bitsize;
+ for (i = 0; i < bitsize; i++) {
+ this._bv.push(new BitVector$());
+ this._seps.push(0);
+ }
+ this._size = (size | 0);
+ for (i = 0; i < size; i++) {
+ this._bv[0].set$IB(i, this._uint2bit$II(v.charCodeAt(i), 0));
+ }
+ this._bv[0].build$();
+ this._seps[0] = this._bv[0].size$B(false);
+ this._range["0"] = 0;
+ this._range["1"] = this._seps[0];
+ depth = 1;
+ while (depth < bitsize) {
+ range_tmp = WaveletMatrix$_shallow_copy$HI(this._range);
+ for (i = 0; i < size; i++) {
+ code = v.charCodeAt(i);
+ bit = this._uint2bit$II(code, depth);
+ key = code >>> bitsize - depth;
+ this._bv[depth].set$IB(range_tmp[key + ""], bit);
+ range_tmp[key + ""]++;
+ }
+ this._bv[depth].build$();
+ this._seps[depth] = this._bv[depth].size$B(false);
+ range_rev = ({ });
+ for (range_key in this._range) {
+ value = this._range[range_key];
+ if (value != range_tmp[range_key]) {
+ range_rev[value + ""] = range_key | 0;
+ }
+ }
+ this._range = ({ });
+ pos0 = 0;
+ pos1 = this._seps[depth];
+ for (range_rev_key in range_rev) {
+ begin = range_rev_key | 0;
+ value = range_rev[range_rev_key];
+ end = range_tmp[value + ""];
+ num0 = this._bv[depth].rank$IB(end, false) - this._bv[depth].rank$IB(begin, false);
+ num1 = end - begin - num0;
+ if (num0 > 0) {
+ this._range[(value << 1) + ""] = (pos0 | 0);
+ pos0 += num0;
+ }
+ if (num1 > 0) {
+ this._range[(value << 1) + 1 + ""] = pos1;
+ pos1 += (num1 | 0);
+ }
+ }
+ depth++;
+ }
+};
+
+/**
+ * @return {!number}
+ */
+WaveletMatrix.prototype.size$ = function () {
+ return this._size;
+};
+
+/**
+ * @param {!number} c
+ * @return {!number}
+ */
+WaveletMatrix.prototype.size$I = function (c) {
+ return this.rank$II(this._size, c);
+};
+
+/**
+ * @param {!number} i
+ * @return {!number}
+ */
+WaveletMatrix.prototype.get$I = function (i) {
+ /** @type {!number} */
+ var value;
+ /** @type {!number} */
+ var depth;
+ /** @type {!boolean} */
+ var bit;
+ if (i >= this._size) {
+ throw new Error("WaveletMatrix.get() : range error");
+ }
+ value = 0;
+ depth = 0;
+ while (depth < this._bitsize) {
+ bit = this._bv[depth].get$I(i);
+ i = this._bv[depth].rank$IB(i, bit);
+ value <<= 1;
+ if (bit) {
+ i += this._seps[depth];
+ value += 1;
+ }
+ depth++;
+ }
+ return (value | 0);
+};
+
+/**
+ * @param {!number} i
+ * @param {!number} c
+ * @return {!number}
+ */
+WaveletMatrix.prototype.rank$II = function (i, c) {
+ /** @type {undefined|!number} */
+ var begin;
+ /** @type {!number} */
+ var end;
+ /** @type {!number} */
+ var depth;
+ /** @type {!boolean} */
+ var bit;
+ if (i > this._size) {
+ throw new Error("WaveletMatrix.rank(): range error");
+ }
+ if (i === 0) {
+ return 0;
+ }
+ begin = this._range[c + ""];
+ if (begin == null) {
+ return 0;
+ }
+ end = i;
+ depth = 0;
+ while (depth < this._bitsize) {
+ bit = this._uint2bit$II(c, depth);
+ end = this._bv[depth].rank$IB(end, bit);
+ if (bit) {
+ end += this._seps[depth];
+ }
+ depth++;
+ }
+ return (end - begin | 0);
+};
+
+/**
+ * @param {!number} i
+ * @param {!number} c
+ * @return {!number}
+ */
+WaveletMatrix.prototype.rank_less_than$II = function (i, c) {
+ /** @type {!number} */
+ var begin;
+ /** @type {!number} */
+ var end;
+ /** @type {!number} */
+ var depth;
+ /** @type {!number} */
+ var rlt;
+ /** @type {!number} */
+ var rank0_begin;
+ /** @type {!number} */
+ var rank0_end;
+ /** @type {Array.<undefined|!number>} */
+ var _seps$0;
+ if (i > this._size) {
+ throw new Error("WaveletMatrix.rank_less_than(): range error");
+ }
+ if (i === 0) {
+ return 0;
+ }
+ begin = 0;
+ end = i;
+ depth = 0;
+ rlt = 0;
+ while (depth < this._bitsize) {
+ rank0_begin = this._bv[depth].rank$IB(begin, false);
+ rank0_end = this._bv[depth].rank$IB(end, false);
+ if (this._uint2bit$II(c, depth)) {
+ rlt += rank0_end - rank0_begin;
+ begin += (_seps$0 = this._seps)[depth] - rank0_begin;
+ end += _seps$0[depth] - rank0_end;
+ } else {
+ begin = rank0_begin;
+ end = rank0_end;
+ }
+ depth++;
+ }
+ return (rlt | 0);
+};
+
+/**
+ * @return {!string}
+ */
+WaveletMatrix.prototype.dump$ = function () {
+ /** @type {Array.<undefined|!string>} */
+ var contents;
+ /** @type {!number} */
+ var i;
+ /** @type {Array.<undefined|!string>} */
+ var range_contents;
+ /** @type {!number} */
+ var counter;
+ /** @type {!string} */
+ var key;
+ contents = [ Binary$dump16bitNumber$I(this._bitsize), Binary$dump32bitNumber$N(this._size) ];
+ for (i = 0; i < this._bitsize; i++) {
+ contents.push(this._bv[i].dump$());
+ }
+ for (i = 0; i < this._bitsize; i++) {
+ contents.push(Binary$dump32bitNumber$N(this._seps[i]));
+ }
+ range_contents = [ ];
+ counter = 0;
+ for (key in this._range) {
+ range_contents.push(Binary$dump32bitNumber$N(key | 0));
+ range_contents.push(Binary$dump32bitNumber$N(this._range[key]));
+ counter++;
+ }
+ contents.push(Binary$dump32bitNumber$N(counter));
+ return contents.join('') + range_contents.join('');
+};
+
+/**
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+WaveletMatrix.prototype.dump$LCompressionReport$ = function (report) {
+ /** @type {Array.<undefined|!string>} */
+ var contents;
+ /** @type {!number} */
+ var i;
+ /** @type {Array.<undefined|!string>} */
+ var range_contents;
+ /** @type {!number} */
+ var counter;
+ /** @type {!string} */
+ var key;
+ contents = [ Binary$dump16bitNumber$I(this._bitsize), Binary$dump32bitNumber$N(this._size) ];
+ CompressionReport$add$LCompressionReport$II(report, 3, 3);
+ for (i = 0; i < this._bitsize; i++) {
+ contents.push(this._bv[i].dump$LCompressionReport$(report));
+ }
+ for (i = 0; i < this._bitsize; i++) {
+ contents.push(Binary$dump32bitNumber$N(this._seps[i]));
+ CompressionReport$add$LCompressionReport$II(report, 2, 2);
+ }
+ range_contents = [ ];
+ counter = 0;
+ for (key in this._range) {
+ range_contents.push(Binary$dump32bitNumber$N(key | 0));
+ range_contents.push(Binary$dump32bitNumber$N(this._range[key]));
+ CompressionReport$add$LCompressionReport$II(report, 4, 4);
+ counter++;
+ }
+ CompressionReport$add$LCompressionReport$II(report, 2, 2);
+ contents.push(Binary$dump32bitNumber$N(counter));
+ return contents.join('') + range_contents.join('');
+};
+
+/**
+ * @param {!string} data
+ * @return {!number}
+ */
+WaveletMatrix.prototype.load$S = function (data) {
+ return this.load$SI(data, 0);
+};
+
+/**
+ * @param {!string} data
+ * @param {!number} offset
+ * @return {!number}
+ */
+WaveletMatrix.prototype.load$SI = function (data, offset) {
+ /** @type {!number} */
+ var i;
+ /** @type {BitVector} */
+ var bit_vector;
+ /** @type {!number} */
+ var range_size;
+ /** @type {!number} */
+ var value;
+ /** @type {!number} */
+ var offset$0;
+ /** @type {!number} */
+ var result$0;
+ /** @type {!number} */
+ var result$1;
+ /** @type {!number} */
+ var result$2;
+ this._bv.length = 0;
+ this._seps.length = 0;
+ this._size = 0;
+ offset$0 = offset++;
+ this._bitsize = (data.charCodeAt(offset$0) | 0);
+ result$0 = data.charCodeAt(offset) * 65536 + data.charCodeAt(offset + 1);
+ this._size = (result$0 | 0);
+ offset += 2;
+ for (i = 0; i < this._bitsize; i++) {
+ bit_vector = new BitVector$();
+ offset = bit_vector.load$SI(data, offset);
+ this._bv.push(bit_vector);
+ }
+ for (i = 0; i < this._bitsize; (i++, offset += 2)) {
+ this._seps.push(Binary$load32bitNumber$SI(data, offset));
+ }
+ result$1 = data.charCodeAt(offset) * 65536 + data.charCodeAt(offset + 1);
+ range_size = result$1;
+ offset += 2;
+ for (i = 0; i < range_size; (i++, offset += 4)) {
+ result$2 = data.charCodeAt(offset) * 65536 + data.charCodeAt(offset + 1);
+ value = Binary$load32bitNumber$SI(data, offset + 2);
+ this._range[result$2 + ""] = (value | 0);
+ }
+ return offset;
+};
+
+/**
+ * @param {Object.<string, undefined|!number>} input
+ * @return {Object.<string, undefined|!number>}
+ */
+WaveletMatrix._shallow_copy$HI = function (input) {
+ /** @type {Object.<string, undefined|!number>} */
+ var result;
+ /** @type {!string} */
+ var key;
+ result = ({ });
+ for (key in input) {
+ result[key] = input[key];
+ }
+ return result;
+};
+
+var WaveletMatrix$_shallow_copy$HI = WaveletMatrix._shallow_copy$HI;
+
+/**
+ * @param {!number} c
+ * @param {!number} i
+ * @return {!boolean}
+ */
+WaveletMatrix.prototype._uint2bit$II = function (c, i) {
+ return (c >>> this._bitsize - 1 - i & 0x1) === 0x1;
+};
+
+/**
+ * class BurrowsWheelerTransform extends Object
+ * @constructor
+ */
+function BurrowsWheelerTransform() {
+}
+
+/**
+ * @constructor
+ */
+function BurrowsWheelerTransform$() {
+ this._str = "";
+ this._size = 0;
+ this._head = 0;
+ this._suffixarray = [ ];
+};
+
+BurrowsWheelerTransform$.prototype = new BurrowsWheelerTransform;
+
+/**
+ * @param {BurrowsWheelerTransform} $this
+ * @return {!number}
+ */
+BurrowsWheelerTransform.size$LBurrowsWheelerTransform$ = function ($this) {
+ return $this._size;
+};
+
+var BurrowsWheelerTransform$size$LBurrowsWheelerTransform$ = BurrowsWheelerTransform.size$LBurrowsWheelerTransform$;
+
+/**
+ * @param {BurrowsWheelerTransform} $this
+ * @return {!number}
+ */
+BurrowsWheelerTransform.head$LBurrowsWheelerTransform$ = function ($this) {
+ return $this._head;
+};
+
+var BurrowsWheelerTransform$head$LBurrowsWheelerTransform$ = BurrowsWheelerTransform.head$LBurrowsWheelerTransform$;
+
+/**
+ * @param {BurrowsWheelerTransform} $this
+ */
+BurrowsWheelerTransform.clear$LBurrowsWheelerTransform$ = function ($this) {
+ $this._str = "";
+ $this._size = 0;
+ $this._head = 0;
+ $this._suffixarray.length = 0;
+};
+
+var BurrowsWheelerTransform$clear$LBurrowsWheelerTransform$ = BurrowsWheelerTransform.clear$LBurrowsWheelerTransform$;
+
+/**
+ * @param {BurrowsWheelerTransform} $this
+ * @param {!string} str
+ */
+BurrowsWheelerTransform.build$LBurrowsWheelerTransform$S = function ($this, str) {
+ /** @type {!string} */
+ var _str$0;
+ /** @type {Array.<undefined|!number>} */
+ var _suffixarray$0;
+ _str$0 = $this._str = str;
+ $this._size = _str$0.length;
+ _suffixarray$0 = $this._suffixarray = SAIS$make$S(str);
+ $this._head = (_suffixarray$0.indexOf(0) | 0);
+};
+
+var BurrowsWheelerTransform$build$LBurrowsWheelerTransform$S = BurrowsWheelerTransform.build$LBurrowsWheelerTransform$S;
+
+/**
+ * @param {BurrowsWheelerTransform} $this
+ * @param {!number} i
+ * @return {!string}
+ */
+BurrowsWheelerTransform.get$LBurrowsWheelerTransform$I = function ($this, i) {
+ /** @type {!number} */
+ var size;
+ /** @type {!number} */
+ var index;
+ size = $this._size;
+ if (i >= size) {
+ throw new Error("BurrowsWheelerTransform.get() : range error");
+ }
+ index = ($this._suffixarray[i] + size - 1) % size;
+ return $this._str.charAt(index);
+};
+
+var BurrowsWheelerTransform$get$LBurrowsWheelerTransform$I = BurrowsWheelerTransform.get$LBurrowsWheelerTransform$I;
+
+/**
+ * @param {BurrowsWheelerTransform} $this
+ * @return {!string}
+ */
+BurrowsWheelerTransform.get$LBurrowsWheelerTransform$ = function ($this) {
+ /** @type {Array.<undefined|!string>} */
+ var str;
+ /** @type {!number} */
+ var size;
+ /** @type {!number} */
+ var i;
+ str = [ ];
+ size = $this._size;
+ for (i = 0; i < size; i++) {
+ str.push(BurrowsWheelerTransform$get$LBurrowsWheelerTransform$I($this, i));
+ }
+ return str.join("");
+};
+
+var BurrowsWheelerTransform$get$LBurrowsWheelerTransform$ = BurrowsWheelerTransform.get$LBurrowsWheelerTransform$;
+
+/**
+ * @param {BurrowsWheelerTransform} $this
+ * @param {!string} replace
+ * @return {!string}
+ */
+BurrowsWheelerTransform.get$LBurrowsWheelerTransform$S = function ($this, replace) {
+ /** @type {!string} */
+ var result;
+ result = BurrowsWheelerTransform$get$LBurrowsWheelerTransform$($this);
+ return result.replace(BurrowsWheelerTransform.END_MARKER, replace);
+};
+
+var BurrowsWheelerTransform$get$LBurrowsWheelerTransform$S = BurrowsWheelerTransform.get$LBurrowsWheelerTransform$S;
+
+/**
+ * class OArray extends Object
+ * @constructor
+ */
+function OArray() {
+}
+
+/**
+ * @constructor
+ * @param {Array.<undefined|!number>} array
+ */
+function OArray$AI(array) {
+ this.array = array;
+ this.offset = 0;
+};
+
+OArray$AI.prototype = new OArray;
+
+/**
+ * @constructor
+ * @param {Array.<undefined|!number>} array
+ * @param {!number} offset
+ */
+function OArray$AII(array, offset) {
+ this.array = array;
+ this.offset = offset;
+};
+
+OArray$AII.prototype = new OArray;
+
+/**
+ * @param {OArray} $this
+ * @param {!number} index
+ * @return {!number}
+ */
+OArray.get$LOArray$I = function ($this, index) {
+ return $this.array[index + $this.offset];
+};
+
+var OArray$get$LOArray$I = OArray.get$LOArray$I;
+
+/**
+ * @param {OArray} $this
+ * @param {!number} index
+ * @param {!number} value
+ */
+OArray.set$LOArray$II = function ($this, index, value) {
+ $this.array[index + $this.offset] = value;
+};
+
+var OArray$set$LOArray$II = OArray.set$LOArray$II;
+
+/**
+ * @param {OArray} $this
+ * @param {!number} index
+ * @return {!boolean}
+ */
+OArray.isS$LOArray$I = function ($this, index) {
+ /** @type {Array.<undefined|!number>} */
+ var array$0;
+ /** @type {!number} */
+ var offset$0;
+ return (array$0 = $this.array)[index + (offset$0 = $this.offset)] < array$0[index + offset$0 + 1];
+};
+
+var OArray$isS$LOArray$I = OArray.isS$LOArray$I;
+
+/**
+ * @param {OArray} $this
+ * @param {!number} index1
+ * @param {!number} index2
+ * @return {!boolean}
+ */
+OArray.compare$LOArray$II = function ($this, index1, index2) {
+ /** @type {Array.<undefined|!number>} */
+ var array$0;
+ /** @type {!number} */
+ var offset$0;
+ return (array$0 = $this.array)[index1 + (offset$0 = $this.offset)] == array$0[index2 + offset$0];
+};
+
+var OArray$compare$LOArray$II = OArray.compare$LOArray$II;
+
+/**
+ * class SAIS extends Object
+ * @constructor
+ */
+function SAIS() {
+}
+
+/**
+ * @constructor
+ */
+function SAIS$() {
+};
+
+SAIS$.prototype = new SAIS;
+
+/**
+ * @param {BitVector} t
+ * @param {!number} i
+ * @return {!boolean}
+ */
+SAIS._isLMS$LBitVector$I = function (t, i) {
+ return i > 0 && t.get$I(i) && ! t.get$I(i - 1);
+};
+
+var SAIS$_isLMS$LBitVector$I = SAIS._isLMS$LBitVector$I;
+
+/**
+ * @param {OArray} s
+ * @param {Array.<undefined|!number>} bkt
+ * @param {!number} n
+ * @param {!number} K
+ * @param {!boolean} end
+ */
+SAIS._getBuckets$LOArray$AIIIB = function (s, bkt, n, K, end) {
+ /** @type {!number} */
+ var sum;
+ /** @type {!number} */
+ var i;
+ sum = 0;
+ for (i = 0; i <= K; i++) {
+ bkt[i] = 0;
+ }
+ for (i = 0; i < n; i++) {
+ bkt[OArray$get$LOArray$I(s, i)]++;
+ }
+ for (i = 0; i <= K; i++) {
+ sum += bkt[i];
+ bkt[i] = ((end ? sum : sum - bkt[i]) | 0);
+ }
+};
+
+var SAIS$_getBuckets$LOArray$AIIIB = SAIS._getBuckets$LOArray$AIIIB;
+
+/**
+ * @param {BitVector} t
+ * @param {Array.<undefined|!number>} SA
+ * @param {OArray} s
+ * @param {Array.<undefined|!number>} bkt
+ * @param {!number} n
+ * @param {!number} K
+ * @param {!boolean} end
+ */
+SAIS._induceSAl$LBitVector$AILOArray$AIIIB = function (t, SA, s, bkt, n, K, end) {
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var j;
+ SAIS$_getBuckets$LOArray$AIIIB(s, bkt, n, K, end);
+ for (i = 0; i < n; i++) {
+ j = SA[i] - 1;
+ if (j >= 0 && ! t.get$I(j)) {
+ SA[bkt[OArray$get$LOArray$I(s, j)]++] = (j | 0);
+ }
+ }
+};
+
+var SAIS$_induceSAl$LBitVector$AILOArray$AIIIB = SAIS._induceSAl$LBitVector$AILOArray$AIIIB;
+
+/**
+ * @param {BitVector} t
+ * @param {Array.<undefined|!number>} SA
+ * @param {OArray} s
+ * @param {Array.<undefined|!number>} bkt
+ * @param {!number} n
+ * @param {!number} K
+ * @param {!boolean} end
+ */
+SAIS._induceSAs$LBitVector$AILOArray$AIIIB = function (t, SA, s, bkt, n, K, end) {
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var j;
+ SAIS$_getBuckets$LOArray$AIIIB(s, bkt, n, K, end);
+ for (i = n - 1; i >= 0; i--) {
+ j = SA[i] - 1;
+ if (j >= 0 && t.get$I(j)) {
+ SA[-- bkt[OArray$get$LOArray$I(s, j)]] = (j | 0);
+ }
+ }
+};
+
+var SAIS$_induceSAs$LBitVector$AILOArray$AIIIB = SAIS._induceSAs$LBitVector$AILOArray$AIIIB;
+
+/**
+ * @param {!string} source
+ * @return {Array.<undefined|!number>}
+ */
+SAIS.make$S = function (source) {
+ /** @type {Array.<undefined|!number>} */
+ var charCodes;
+ /** @type {!number} */
+ var maxCode;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var code;
+ /** @type {Array.<undefined|!number>} */
+ var SA;
+ /** @type {OArray} */
+ var s;
+ charCodes = [ ];
+ charCodes.length = source.length;
+ maxCode = 0;
+ for (i = 0; i < source.length; i++) {
+ code = source.charCodeAt(i);
+ charCodes[i] = (code | 0);
+ maxCode = (code > maxCode ? code : maxCode);
+ }
+ SA = [ ];
+ SA.length = source.length;
+ s = ({offset: 0, array: charCodes});
+ SAIS$_make$LOArray$AIII(s, SA, source.length, maxCode);
+ return SA;
+};
+
+var SAIS$make$S = SAIS.make$S;
+
+/**
+ * @param {OArray} s
+ * @param {Array.<undefined|!number>} SA
+ * @param {!number} n
+ * @param {!number} K
+ */
+SAIS._make$LOArray$AIII = function (s, SA, n, K) {
+ /** @type {BitVector} */
+ var t;
+ /** @type {!number} */
+ var i;
+ /** @type {Array.<undefined|!number>} */
+ var bkt;
+ /** @type {!number} */
+ var n1;
+ /** @type {!number} */
+ var name;
+ /** @type {!number} */
+ var prev;
+ /** @type {undefined|!number} */
+ var pos;
+ /** @type {!boolean} */
+ var diff;
+ /** @type {!number} */
+ var d;
+ /** @type {!number} */
+ var j;
+ /** @type {Array.<undefined|!number>} */
+ var SA1;
+ /** @type {OArray} */
+ var s1;
+ /** @type {!number} */
+ var i$0;
+ /** @type {!number} */
+ var index$0;
+ t = new BitVector$();
+ t.set$IB(n - 2, false);
+ t.set$IB(n - 1, true);
+ for (i = n - 3; i >= 0; i--) {
+ t.set$IB(i, OArray$isS$LOArray$I(s, i) || OArray$compare$LOArray$II(s, i, i + 1) && t.get$I(i + 1));
+ }
+ bkt = [ ];
+ bkt.length = K + 1;
+ SAIS$_getBuckets$LOArray$AIIIB(s, bkt, n, K, true);
+ for (i = 0; i < n; i++) {
+ SA[i] = -1;
+ }
+ for (i = 1; i < n; i++) {
+ if (SAIS$_isLMS$LBitVector$I(t, i)) {
+ SA[-- bkt[OArray$get$LOArray$I(s, i)]] = (i | 0);
+ }
+ }
+ SAIS$_induceSAl$LBitVector$AILOArray$AIIIB(t, SA, s, bkt, n, K, false);
+ SAIS$_induceSAs$LBitVector$AILOArray$AIIIB(t, SA, s, bkt, n, K, true);
+ n1 = 0;
+ for (i = 0; i < n; i++) {
+ i$0 = SA[i];
+ if (i$0 > 0 && t.get$I(i$0) && ! t.get$I(i$0 - 1)) {
+ SA[n1++] = SA[i];
+ }
+ }
+ for (i = n1; i < n; i++) {
+ SA[i] = -1;
+ }
+ name = 0;
+ prev = -1;
+ for (i = 0; i < n1; i++) {
+ pos = SA[i];
+ diff = false;
+ for (d = 0; d < n; d++) {
+ if (prev === -1 || ! OArray$compare$LOArray$II(s, pos + d, prev + d) || t.get$I(pos + d) !== t.get$I(prev + d)) {
+ diff = true;
+ break;
+ } else {
+ if (d > 0 && (SAIS$_isLMS$LBitVector$I(t, pos + d) || SAIS$_isLMS$LBitVector$I(t, prev + d))) {
+ break;
+ }
+ }
+ }
+ if (diff) {
+ name++;
+ prev = pos;
+ }
+ pos = ((pos % 2 === 0 ? pos / 2 : (pos - 1) / 2) | 0);
+ SA[n1 + pos] = (name - 1 | 0);
+ }
+ for ((i = n - 1, j = n - 1); i >= n1; i--) {
+ if (SA[i] >= 0) {
+ SA[j--] = SA[i];
+ }
+ }
+ SA1 = SA;
+ s1 = ({offset: n - n1, array: SA});
+ if (name < n1) {
+ SAIS$_make$LOArray$AIII(s1, SA1, n1, name - 1);
+ } else {
+ for (i = 0; i < n1; i++) {
+ SA1[OArray$get$LOArray$I(s1, i)] = (i | 0);
+ }
+ }
+ bkt = [ ];
+ bkt.length = K + 1;
+ SAIS$_getBuckets$LOArray$AIIIB(s, bkt, n, K, true);
+ for ((i = 1, j = 0); i < n; i++) {
+ if (SAIS$_isLMS$LBitVector$I(t, i)) {
+ OArray$set$LOArray$II(s1, j++, i);
+ }
+ }
+ for (i = 0; i < n1; i++) {
+ index$0 = SA1[i];
+ SA1[i] = s1.array[index$0 + s1.offset];
+ }
+ for (i = n1; i < n; i++) {
+ SA[i] = -1;
+ }
+ for (i = n1 - 1; i >= 0; i--) {
+ j = SA[i];
+ SA[i] = -1;
+ SA[-- bkt[OArray$get$LOArray$I(s, j)]] = (j | 0);
+ }
+ SAIS$_induceSAl$LBitVector$AILOArray$AIIIB(t, SA, s, bkt, n, K, false);
+ SAIS$_induceSAs$LBitVector$AILOArray$AIIIB(t, SA, s, bkt, n, K, true);
+};
+
+var SAIS$_make$LOArray$AIII = SAIS._make$LOArray$AIII;
+
+OktaviaSearch._stemmer = null;
+OktaviaSearch._instance = null;
+$__jsx_lazy_init(Oktavia, "eof", function () {
+ return String.fromCharCode(0);
+});
+$__jsx_lazy_init(Oktavia, "eob", function () {
+ return String.fromCharCode(1);
+});
+$__jsx_lazy_init(Oktavia, "unknown", function () {
+ return String.fromCharCode(3);
+});
+Binary._base64EncodeChars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
+$__jsx_lazy_init(Binary, "_base64DecodeChars", function () {
+ return [ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 62, -1, -1, -1, 63, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, -1, -1, -1, -1, -1, -1, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -1, -1, -1, -1, -1, -1, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, -1, -1, -1, -1 ];
+});
+$__jsx_lazy_init(Style, "console", function () {
+ return ({ 'title': [ '\x1B[32m\x1b[4m', '\x1B[39m\x1b[0m' ], 'url': [ '\x1B[34m', '\x1B[39m' ], 'hit': [ '\x1B[4m', '\x1B[0m' ], 'del': [ '\x1B[9m', '\x1B[0m' ], 'summary': [ '\x1B[90m', '\x1B[39m' ] });
+});
+$__jsx_lazy_init(Style, "html", function () {
+ return ({ 'title': [ '<span class="title">', '</span>' ], 'url': [ '<span class="url">', '</span>' ], 'hit': [ '<span class="hit">', '</span>' ], 'del': [ '<del>', '</del>' ], 'summary': [ '<span class="reuslt">', '</span>' ] });
+});
+$__jsx_lazy_init(Style, "ignore", function () {
+ return ({ 'tilte': [ '', '' ], 'url': [ '', '' ], 'hit': [ '', '' ], 'del': [ '', '' ], 'summary': [ '', '' ] });
+});
+SwedishStemmer.serialVersionUID = 1;
+$__jsx_lazy_init(SwedishStemmer, "methodObject", function () {
+ return new SwedishStemmer$();
+});
+$__jsx_lazy_init(SwedishStemmer, "a_0", function () {
+ return [ new Among$SII("a", -1, 1), new Among$SII("arna", 0, 1), new Among$SII("erna", 0, 1), new Among$SII("heterna", 2, 1), new Among$SII("orna", 0, 1), new Among$SII("ad", -1, 1), new Among$SII("e", -1, 1), new Among$SII("ade", 6, 1), new Among$SII("ande", 6, 1), new Among$SII("arne", 6, 1), new Among$SII("are", 6, 1), new Among$SII("aste", 6, 1), new Among$SII("en", -1, 1), new Among$SII("anden", 12, 1), new Among$SII("aren", 12, 1), new Among$SII("heten", 12, 1), new Among$SII("ern", -1, 1), new Among$SII("ar", -1, 1), new Among$SII("er", -1, 1), new Among$SII("heter", 18, 1), new Among$SII("or", -1, 1), new Among$SII("s", -1, 2), new Among$SII("as", 21, 1), new Among$SII("arnas", 22, 1), new Among$SII("ernas", 22, 1), new Among$SII("ornas", 22, 1), new Among$SII("es", 21, 1), new Among$SII("ades", 26, 1), new Among$SII("andes", 26, 1), new Among$SII("ens", 21, 1), new Among$SII("arens", 29, 1), new Among$SII("hetens", 29, 1), new Among$SII("erns", 21, 1), new Among$SII("at", -1, 1), new Among$SII("andet", -1, 1), new Among$SII("het", -1, 1), new Among$SII("ast", -1, 1) ];
+});
+$__jsx_lazy_init(SwedishStemmer, "a_1", function () {
+ return [ new Among$SII("dd", -1, -1), new Among$SII("gd", -1, -1), new Among$SII("nn", -1, -1), new Among$SII("dt", -1, -1), new Among$SII("gt", -1, -1), new Among$SII("kt", -1, -1), new Among$SII("tt", -1, -1) ];
+});
+$__jsx_lazy_init(SwedishStemmer, "a_2", function () {
+ return [ new Among$SII("ig", -1, 1), new Among$SII("lig", 0, 1), new Among$SII("els", -1, 1), new Among$SII("fullt", -1, 3), new Among$SII("l\u00F6st", -1, 2) ];
+});
+$__jsx_lazy_init(SwedishStemmer, "g_v", function () {
+ return [ 17, 65, 16, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 24, 0, 32 ];
+});
+$__jsx_lazy_init(SwedishStemmer, "g_s_ending", function () {
+ return [ 119, 127, 149 ];
+});
+$__jsx_lazy_init(_Common, "buffers", function () {
+ return [ "comment", "sgmlDecl", "textNode", "tagName", "doctype", "procInstName", "procInstBody", "entity", "attribName", "attribValue", "cdata", "script" ];
+});
+$__jsx_lazy_init(_Common, "EVENTS", function () {
+ return [ "text", "processinginstruction", "sgmldeclaration", "doctype", "comment", "attribute", "opentag", "closetag", "opencdata", "cdata", "clo_State.CDATA", "error", "end", "ready", "script", "opennamespace", "closenamespace" ];
+});
+_Common.MAX_BUFFER_LENGTH = 65536;
+_State.BEGIN = 1;
+_State.TEXT = 2;
+_State.TEXT_ENTITY = 3;
+_State.OPEN_WAKA = 4;
+_State.SGML_DECL = 5;
+_State.SGML_DECL_QUOTED = 6;
+_State.DOCTYPE = 7;
+_State.DOCTYPE_QUOTED = 8;
+_State.DOCTYPE_DTD = 9;
+_State.DOCTYPE_DTD_QUOTED = 10;
+_State.COMMENT_STARTING = 11;
+_State.COMMENT = 12;
+_State.COMMENT_ENDING = 13;
+_State.COMMENT_ENDED = 14;
+_State.CDATA = 15;
+_State.CDATA_ENDING = 16;
+_State.CDATA_ENDING_2 = 17;
+_State.PROC_INST = 18;
+_State.PROC_INST_BODY = 19;
+_State.PROC_INST_ENDING = 20;
+_State.OPEN_TAG = 21;
+_State.OPEN_TAG_SLASH = 22;
+_State.ATTRIB = 23;
+_State.ATTRIB_NAME = 24;
+_State.ATTRIB_NAME_SAW_WHITE = 25;
+_State.ATTRIB_VALUE = 26;
+_State.ATTRIB_VALUE_QUOTED = 27;
+_State.ATTRIB_VALUE_UNQUOTED = 28;
+_State.ATTRIB_VALUE_ENTITY_Q = 29;
+_State.ATTRIB_VALUE_ENTITY_U = 30;
+_State.CLOSE_TAG = 31;
+_State.CLOSE_TAG_SAW_WHITE = 32;
+_State.SCRIPT = 33;
+_State.SCRIPT_ENDING = 34;
+$__jsx_lazy_init(_Entities, "_entities", function () {
+ return ({ "amp": "&", "gt": ">", "lt": "<", "quot": "\"", "apos": "'", "AElig": 198, "Aacute": 193, "Acirc": 194, "Agrave": 192, "Aring": 197, "Atilde": 195, "Auml": 196, "Ccedil": 199, "ETH": 208, "Eacute": 201, "Ecirc": 202, "Egrave": 200, "Euml": 203, "Iacute": 205, "Icirc": 206, "Igrave": 204, "Iuml": 207, "Ntilde": 209, "Oacute": 211, "Ocirc": 212, "Ograve": 210, "Oslash": 216, "Otilde": 213, "Ouml": 214, "THORN": 222, "Uacute": 218, "Ucirc": 219, "Ugrave": 217, "Uuml": 220, "Yacute": 221, "aacute": 225, "acirc": 226, "aelig": 230, "agrave": 224, "aring": 229, "atilde": 227, "auml": 228, "ccedil": 231, "eacute": 233, "ecirc": 234, "egrave": 232, "eth": 240, "euml": 235, "iacute": 237, "icirc": 238, "igrave": 236, "iuml": 239, "ntilde": 241, "oacute": 243, "ocirc": 244, "ograve": 242, "oslash": 248, "otilde": 245, "ouml": 246, "szlig": 223, "thorn": 254, "uacute": 250, "ucirc": 251, "ugrave": 249, "uuml": 252, "yacute": 253, "yuml": 255, "copy": 169, "reg": 174, "nbsp": 160, "iexcl": 161, "cent": 162, "pound": 163, "curren": 164, "yen": 165, "brvbar": 166, "sect": 167, "uml": 168, "ordf": 170, "laquo": 171, "not": 172, "shy": 173, "macr": 175, "deg": 176, "plusmn": 177, "sup1": 185, "sup2": 178, "sup3": 179, "acute": 180, "micro": 181, "para": 182, "middot": 183, "cedil": 184, "ordm": 186, "raquo": 187, "frac14": 188, "frac12": 189, "frac34": 190, "iquest": 191, "times": 215, "divide": 247, "OElig": 338, "oelig": 339, "Scaron": 352, "scaron": 353, "Yuml": 376, "fnof": 402, "circ": 710, "tilde": 732, "Alpha": 913, "Beta": 914, "Gamma": 915, "Delta": 916, "Epsilon": 917, "Zeta": 918, "Eta": 919, "Theta": 920, "Iota": 921, "Kappa": 922, "Lambda": 923, "Mu": 924, "Nu": 925, "Xi": 926, "Omicron": 927, "Pi": 928, "Rho": 929, "Sigma": 931, "Tau": 932, "Upsilon": 933, "Phi": 934, "Chi": 935, "Psi": 936, "Omega": 937, "alpha": 945, "beta": 946, "gamma": 947, "delta": 948, "epsilon": 949, "zeta": 950, "eta": 951, "theta": 952, "iota": 953, "kappa": 954, "lambda": 955, "mu": 956, "nu": 957, "xi": 958, "omicron": 959, "pi": 960, "rho": 961, "sigmaf": 962, "sigma": 963, "tau": 964, "upsilon": 965, "phi": 966, "chi": 967, "psi": 968, "omega": 969, "thetasym": 977, "upsih": 978, "piv": 982, "ensp": 8194, "emsp": 8195, "thinsp": 8201, "zwnj": 8204, "zwj": 8205, "lrm": 8206, "rlm": 8207, "ndash": 8211, "mdash": 8212, "lsquo": 8216, "rsquo": 8217, "sbquo": 8218, "ldquo": 8220, "rdquo": 8221, "bdquo": 8222, "dagger": 8224, "Dagger": 8225, "bull": 8226, "hellip": 8230, "permil": 8240, "prime": 8242, "Prime": 8243, "lsaquo": 8249, "rsaquo": 8250, "oline": 8254, "frasl": 8260, "euro": 8364, "image": 8465, "weierp": 8472, "real": 8476, "trade": 8482, "alefsym": 8501, "larr": 8592, "uarr": 8593, "rarr": 8594, "darr": 8595, "harr": 8596, "crarr": 8629, "lArr": 8656, "uArr": 8657, "rArr": 8658, "dArr": 8659, "hArr": 8660, "forall": 8704, "part": 8706, "exist": 8707, "empty": 8709, "nabla": 8711, "isin": 8712, "notin": 8713, "ni": 8715, "prod": 8719, "sum": 8721, "minus": 8722, "lowast": 8727, "radic": 8730, "prop": 8733, "infin": 8734, "ang": 8736, "and": 8743, "or": 8744, "cap": 8745, "cup": 8746, "int": 8747, "there4": 8756, "sim": 8764, "cong": 8773, "asymp": 8776, "ne": 8800, "equiv": 8801, "le": 8804, "ge": 8805, "sub": 8834, "sup": 8835, "nsub": 8836, "sube": 8838, "supe": 8839, "oplus": 8853, "otimes": 8855, "perp": 8869, "sdot": 8901, "lceil": 8968, "rceil": 8969, "lfloor": 8970, "rfloor": 8971, "lang": 9001, "rang": 9002, "loz": 9674, "spades": 9824, "clubs": 9827, "hearts": 9829, "diams": 9830 });
+});
+BitVector.SMALL_BLOCK_SIZE = 32;
+BitVector.LARGE_BLOCK_SIZE = 256;
+BitVector.BLOCK_RATE = 8;
+$__jsx_lazy_init(BurrowsWheelerTransform, "END_MARKER", function () {
+ return String.fromCharCode(0);
+});
+var $__jsx_classMap = {
+ "tool/web/oktavia-swedish-search.jsx": {
+ _Main: _Main,
+ _Main$: _Main$
+ },
+ "tool/web/oktavia-search.jsx": {
+ _Result: _Result,
+ _Result$SSSI: _Result$SSSI,
+ _Proposal: _Proposal,
+ _Proposal$SSI: _Proposal$SSI,
+ OktaviaSearch: OktaviaSearch,
+ OktaviaSearch$I: OktaviaSearch$I,
+ _Main: _Main$0,
+ _Main$: _Main$0$
+ },
+ "src/oktavia.jsx": {
+ Oktavia: Oktavia,
+ Oktavia$: Oktavia$
+ },
+ "src/binary-util.jsx": {
+ Binary: Binary,
+ Binary$: Binary$,
+ LoadedStringResult: LoadedStringResult,
+ LoadedStringResult$SI: LoadedStringResult$SI,
+ LoadedStringListResult: LoadedStringListResult,
+ LoadedStringListResult$SI: LoadedStringListResult$SI,
+ LoadedStringListMapResult: LoadedStringListMapResult,
+ LoadedStringListMapResult$SI: LoadedStringListMapResult$SI,
+ LoadedNumberListResult: LoadedNumberListResult,
+ LoadedNumberListResult$SI: LoadedNumberListResult$SI,
+ CompressionReport: CompressionReport,
+ CompressionReport$: CompressionReport$
+ },
+ "src/query.jsx": {
+ Query: Query,
+ Query$: Query$
+ },
+ "src/query-string-parser.jsx": {
+ QueryStringParser: QueryStringParser,
+ QueryStringParser$: QueryStringParser$
+ },
+ "src/search-result.jsx": {
+ Proposal: Proposal,
+ Proposal$II: Proposal$II,
+ Position: Position,
+ Position$SIB: Position$SIB,
+ SearchUnit: SearchUnit,
+ SearchUnit$I: SearchUnit$I,
+ SingleResult: SingleResult,
+ SingleResult$: SingleResult$,
+ SingleResult$SBB: SingleResult$SBB,
+ SearchSummary: SearchSummary,
+ SearchSummary$: SearchSummary$,
+ SearchSummary$LOktavia$: SearchSummary$LOktavia$
+ },
+ "src/style.jsx": {
+ Style: Style,
+ Style$S: Style$S,
+ _HTMLHandler: _HTMLHandler,
+ _HTMLHandler$HASB: _HTMLHandler$HASB
+ },
+ "src/stemmer/stemmer.jsx": {
+ Stemmer: Stemmer,
+ Stemmer$: Stemmer$
+ },
+ "src/stemmer/base-stemmer.jsx": {
+ BaseStemmer: BaseStemmer,
+ BaseStemmer$: BaseStemmer$
+ },
+ "src/stemmer/swedish-stemmer.jsx": {
+ SwedishStemmer: SwedishStemmer,
+ SwedishStemmer$: SwedishStemmer$
+ },
+ "src/stemmer/among.jsx": {
+ Among: Among,
+ Among$SII: Among$SII,
+ Among$SIIF$LBaseStemmer$B$LBaseStemmer$: Among$SIIF$LBaseStemmer$B$LBaseStemmer$
+ },
+ "src/metadata.jsx": {
+ Metadata: Metadata,
+ Metadata$LOktavia$: Metadata$LOktavia$,
+ Section: Section,
+ Section$LOktavia$: Section$LOktavia$,
+ Splitter: Splitter,
+ Splitter$LOktavia$: Splitter$LOktavia$,
+ Splitter$LOktavia$S: Splitter$LOktavia$S,
+ Table: Table,
+ Table$LOktavia$AS: Table$LOktavia$AS,
+ Block: Block,
+ Block$LOktavia$: Block$LOktavia$
+ },
+ "src/fm-index.jsx": {
+ FMIndex: FMIndex,
+ FMIndex$: FMIndex$
+ },
+ "src/sax.jsx": {
+ Tag: Tag,
+ Tag$S: Tag$S,
+ _Common: _Common,
+ _Common$: _Common$,
+ _State: _State,
+ _State$: _State$,
+ SAXHandler: SAXHandler,
+ SAXHandler$: SAXHandler$,
+ SAXParser: SAXParser,
+ SAXParser$LSAXHandler$: SAXParser$LSAXHandler$,
+ SAXParser$LSAXHandler$B: SAXParser$LSAXHandler$B,
+ Char: Char,
+ Char$: Char$,
+ _Entities: _Entities,
+ _Entities$: _Entities$
+ },
+ "src/bit-vector.jsx": {
+ BitVector: BitVector,
+ BitVector$: BitVector$
+ },
+ "src/wavelet-matrix.jsx": {
+ WaveletMatrix: WaveletMatrix,
+ WaveletMatrix$: WaveletMatrix$
+ },
+ "src/burrows-wheeler-transform.jsx": {
+ BurrowsWheelerTransform: BurrowsWheelerTransform,
+ BurrowsWheelerTransform$: BurrowsWheelerTransform$
+ },
+ "src/sais.jsx": {
+ OArray: OArray,
+ OArray$AI: OArray$AI,
+ OArray$AII: OArray$AII,
+ SAIS: SAIS,
+ SAIS$: SAIS$
+ }
+};
+
+
+/**
+ * launches _Main.main(:string[]):void invoked by jsx --run|--executable
+ */
+JSX.runMain = function (sourceFile, args) {
+ var module = JSX.require(sourceFile);
+ if (! module) {
+ throw new ReferenceError("entry point module not found in " + sourceFile);
+ }
+ if (! module._Main) {
+ throw new ReferenceError("entry point _Main not found in " + sourceFile);
+ }
+ if (! module._Main.main$AS) {
+ throw new ReferenceError("entry point _Main.main(:string[]):void not found in " + sourceFile);
+ }
+ module._Main.main$AS(args);
+};
+
+/**
+ * launches _Test#test*():void invoked by jsx --test
+ */
+JSX.runTests = function (sourceFile, tests) {
+ var module = JSX.require(sourceFile);
+ var testClass = module._Test$;
+
+ if (!testClass) return; // skip if there's no test class
+
+ if(tests.length === 0) {
+ var p = testClass.prototype;
+ for (var m in p) {
+ if (p[m] instanceof Function
+ && /^test.*[$]$/.test(m)) {
+ tests.push(m);
+ }
+ }
+ }
+ else { // set as process arguments
+ tests = tests.map(function (name) {
+ return name + "$"; // mangle for function test*():void
+ });
+ }
+
+ var testCase = new testClass();
+
+ if (testCase.beforeClass$AS != null)
+ testCase.beforeClass$AS(tests);
+
+ for (var i = 0; i < tests.length; ++i) {
+ (function (method) {
+ if (method in testCase) {
+ testCase.run$SF$V$(method, function() { testCase[method](); });
+ }
+ else {
+ throw new ReferenceError("No such test method: " + method);
+ }
+ }(tests[i]));
+ }
+
+ if (testCase.afterClass$ != null)
+ testCase.afterClass$();
+};
+/**
+ * call a function on load/DOMContentLoaded
+ */
+function $__jsx_onload (event) {
+ window.removeEventListener("load", $__jsx_onload);
+ document.removeEventListener("DOMContentLoaded", $__jsx_onload);
+ JSX.runMain("tool/web/oktavia-swedish-search.jsx", [])
+}
+
+window.addEventListener("load", $__jsx_onload);
+document.addEventListener("DOMContentLoaded", $__jsx_onload);
+
+})(JSX);
diff --git a/web/server/h2o/libh2o/misc/oktavia/lib/oktavia-turkish-search.js b/web/server/h2o/libh2o/misc/oktavia/lib/oktavia-turkish-search.js
new file mode 100644
index 00000000..f960dd86
--- /dev/null
+++ b/web/server/h2o/libh2o/misc/oktavia/lib/oktavia-turkish-search.js
@@ -0,0 +1,10729 @@
+// generatedy by JSX compiler 0.9.24 (2013-04-05 13:45:00 +0900; 1b229cc6a411f674f0f7cf7a79b7a8b3f8eb7414)
+var JSX = {};
+(function (JSX) {
+/**
+ * copies the implementations from source interface to target
+ */
+function $__jsx_merge_interface(target, source) {
+ for (var k in source.prototype)
+ if (source.prototype.hasOwnProperty(k))
+ target.prototype[k] = source.prototype[k];
+}
+
+/**
+ * defers the initialization of the property
+ */
+function $__jsx_lazy_init(obj, prop, func) {
+ function reset(obj, prop, value) {
+ delete obj[prop];
+ obj[prop] = value;
+ return value;
+ }
+
+ Object.defineProperty(obj, prop, {
+ get: function () {
+ return reset(obj, prop, func());
+ },
+ set: function (v) {
+ reset(obj, prop, v);
+ },
+ enumerable: true,
+ configurable: true
+ });
+}
+
+/**
+ * sideeffect().a /= b
+ */
+function $__jsx_div_assign(obj, prop, divisor) {
+ return obj[prop] = (obj[prop] / divisor) | 0;
+}
+
+/*
+ * global functions, renamed to avoid conflict with local variable names
+ */
+var $__jsx_parseInt = parseInt;
+var $__jsx_parseFloat = parseFloat;
+var $__jsx_isNaN = isNaN;
+var $__jsx_isFinite = isFinite;
+
+var $__jsx_encodeURIComponent = encodeURIComponent;
+var $__jsx_decodeURIComponent = decodeURIComponent;
+var $__jsx_encodeURI = encodeURI;
+var $__jsx_decodeURI = decodeURI;
+
+var $__jsx_ObjectToString = Object.prototype.toString;
+var $__jsx_ObjectHasOwnProperty = Object.prototype.hasOwnProperty;
+
+/*
+ * profiler object, initialized afterwards
+ */
+function $__jsx_profiler() {
+}
+
+/*
+ * public interface to JSX code
+ */
+JSX.require = function (path) {
+ var m = $__jsx_classMap[path];
+ return m !== undefined ? m : null;
+};
+
+JSX.profilerIsRunning = function () {
+ return $__jsx_profiler.getResults != null;
+};
+
+JSX.getProfileResults = function () {
+ return ($__jsx_profiler.getResults || function () { return {}; })();
+};
+
+JSX.postProfileResults = function (url, cb) {
+ if ($__jsx_profiler.postResults == null)
+ throw new Error("profiler has not been turned on");
+ return $__jsx_profiler.postResults(url, cb);
+};
+
+JSX.resetProfileResults = function () {
+ if ($__jsx_profiler.resetResults == null)
+ throw new Error("profiler has not been turned on");
+ return $__jsx_profiler.resetResults();
+};
+JSX.DEBUG = false;
+/**
+ * class _Main extends Object
+ * @constructor
+ */
+function _Main() {
+}
+
+/**
+ * @constructor
+ */
+function _Main$() {
+};
+
+_Main$.prototype = new _Main;
+
+/**
+ * @param {Array.<undefined|!string>} args
+ */
+_Main.main$AS = function (args) {
+ OktaviaSearch$setStemmer$LStemmer$(new TurkishStemmer$());
+};
+
+var _Main$main$AS = _Main.main$AS;
+
+/**
+ * class _Result extends Object
+ * @constructor
+ */
+function _Result() {
+}
+
+/**
+ * @constructor
+ * @param {!string} title
+ * @param {!string} url
+ * @param {!string} content
+ * @param {!number} score
+ */
+function _Result$SSSI(title, url, content, score) {
+ this.title = title;
+ this.url = url;
+ this.content = content;
+ this.score = score;
+};
+
+_Result$SSSI.prototype = new _Result;
+
+/**
+ * class _Proposal extends Object
+ * @constructor
+ */
+function _Proposal() {
+}
+
+/**
+ * @constructor
+ * @param {!string} options
+ * @param {!string} label
+ * @param {!number} count
+ */
+function _Proposal$SSI(options, label, count) {
+ this.options = options;
+ this.label = label;
+ this.count = count;
+};
+
+_Proposal$SSI.prototype = new _Proposal;
+
+/**
+ * class OktaviaSearch extends Object
+ * @constructor
+ */
+function OktaviaSearch() {
+}
+
+/**
+ * @constructor
+ * @param {!number} entriesPerPage
+ */
+function OktaviaSearch$I(entriesPerPage) {
+ this._queries = null;
+ this._highlight = "";
+ this._result = null;
+ this._proposals = null;
+ this._currentFolderDepth = 0;
+ this._oktavia = new Oktavia$();
+ this._entriesPerPage = entriesPerPage;
+ this._currentPage = 1;
+ this._queryString = null;
+ this._callback = null;
+ OktaviaSearch._instance = this;
+};
+
+OktaviaSearch$I.prototype = new OktaviaSearch;
+
+/**
+ * @param {Stemmer} stemmer
+ */
+OktaviaSearch.setStemmer$LStemmer$ = function (stemmer) {
+ /** @type {Oktavia} */
+ var this$0;
+ if (OktaviaSearch._instance) {
+ this$0 = OktaviaSearch._instance._oktavia;
+ this$0._stemmer = stemmer;
+ } else {
+ OktaviaSearch._stemmer = stemmer;
+ }
+};
+
+var OktaviaSearch$setStemmer$LStemmer$ = OktaviaSearch.setStemmer$LStemmer$;
+
+/**
+ * @param {!string} index
+ */
+OktaviaSearch.prototype.loadIndex$S = function (index) {
+ /** @type {Oktavia} */
+ var this$0;
+ /** @type {Stemmer} */
+ var stemmer$0;
+ if (OktaviaSearch._stemmer) {
+ this$0 = this._oktavia;
+ stemmer$0 = OktaviaSearch._stemmer;
+ this$0._stemmer = stemmer$0;
+ }
+ this._oktavia.load$S(Binary$base64decode$S(index));
+ if (this._queryString) {
+ this.search$SF$IIV$(this._queryString, this._callback);
+ this._queryString = null;
+ this._callback = null;
+ }
+};
+
+/**
+ * @param {!string} queryString
+ * @param {*} callback
+ */
+OktaviaSearch.prototype.search$SF$IIV$ = function (queryString, callback) {
+ /** @type {QueryStringParser} */
+ var queryParser;
+ /** @type {SearchSummary} */
+ var summary;
+ /** @type {Array.<undefined|SearchUnit>} */
+ var _result$0;
+ if (this._oktavia) {
+ queryParser = ({queries: [ ]});
+ this._queries = QueryStringParser$parse$LQueryStringParser$S(queryParser, queryString);
+ this._highlight = QueryStringParser$highlight$LQueryStringParser$(queryParser);
+ summary = this._oktavia.search$ALQuery$(this._queries);
+ if (SearchSummary$size$LSearchSummary$(summary) > 0) {
+ this._result = this._sortResult$LSearchSummary$(summary);
+ this._proposals = [ ];
+ this._currentPage = 1;
+ } else {
+ this._result = [ ];
+ if (this._queries.length > 1) {
+ this._proposals = SearchSummary$getProposal$LSearchSummary$(summary);
+ } else {
+ this._proposals = [ ];
+ }
+ this._currentPage = 1;
+ }
+ callback((_result$0 = this._result).length, Math.ceil(_result$0.length / this._entriesPerPage));
+ } else {
+ this._queryString = queryString;
+ this._callback = callback;
+ }
+};
+
+/**
+ * @return {!number}
+ */
+OktaviaSearch.prototype.resultSize$ = function () {
+ return (this._result.length | 0);
+};
+
+/**
+ * @return {!number}
+ */
+OktaviaSearch.prototype.totalPages$ = function () {
+ return (Math.ceil(this._result.length / this._entriesPerPage) | 0);
+};
+
+/**
+ * @return {!number}
+ */
+OktaviaSearch.prototype.currentPage$ = function () {
+ return this._currentPage;
+};
+
+/**
+ * @param {!number} page
+ */
+OktaviaSearch.prototype.setCurrentPage$I = function (page) {
+ this._currentPage = page;
+};
+
+/**
+ * @return {!boolean}
+ */
+OktaviaSearch.prototype.hasPrevPage$ = function () {
+ return this._currentPage !== 1;
+};
+
+/**
+ * @return {!boolean}
+ */
+OktaviaSearch.prototype.hasNextPage$ = function () {
+ return this._currentPage !== Math.ceil(this._result.length / this._entriesPerPage);
+};
+
+/**
+ * @return {Array.<undefined|!string>}
+ */
+OktaviaSearch.prototype.pageIndexes$ = function () {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var total;
+ /** @type {!number} */
+ var i;
+ result = [ ];
+ total = Math.ceil(this._result.length / this._entriesPerPage);
+ if (total < 10) {
+ for (i = 1; i <= total; i++) {
+ result.push(i + "");
+ }
+ } else {
+ if (this._currentPage <= 5) {
+ for (i = 1; i <= 7; i++) {
+ result.push(i + "");
+ }
+ result.push('...', total + "");
+ } else {
+ if (total - 5 <= this._currentPage) {
+ result.push('1', '...');
+ for (i = total - 8; i <= total; i++) {
+ result.push(i + "");
+ }
+ } else {
+ result.push('1', '...');
+ for (i = this._currentPage - 3; i <= this._currentPage + 3; i++) {
+ result.push(i + "");
+ }
+ result.push('...', total + "");
+ }
+ }
+ }
+ return result;
+};
+
+/**
+ * @return {Array.<undefined|_Result>}
+ */
+OktaviaSearch.prototype.getResult$ = function () {
+ /** @type {Style} */
+ var style;
+ /** @type {!number} */
+ var start;
+ /** @type {!number} */
+ var last;
+ /** @type {Metadata} */
+ var metadata;
+ /** @type {!number} */
+ var num;
+ /** @type {Array.<undefined|_Result>} */
+ var results;
+ /** @type {!number} */
+ var i;
+ /** @type {SearchUnit} */
+ var unit;
+ /** @type {Array.<undefined|!string>} */
+ var info;
+ /** @type {!string} */
+ var content;
+ /** @type {Array.<undefined|Position>} */
+ var positions;
+ /** @type {!number} */
+ var end;
+ /** @type {!boolean} */
+ var split;
+ /** @type {!number} */
+ var j;
+ /** @type {Position} */
+ var pos;
+ /** @type {!string} */
+ var text;
+ /** @type {Oktavia} */
+ var this$0;
+ /** @type {!number} */
+ var position$0;
+ /** @type {!number} */
+ var _currentPage$0;
+ /** @type {!number} */
+ var _entriesPerPage$0;
+ style = new Style$S('html');
+ start = ((_currentPage$0 = this._currentPage) - 1) * (_entriesPerPage$0 = this._entriesPerPage);
+ last = Math.min(_currentPage$0 * _entriesPerPage$0, this._result.length);
+ this$0 = this._oktavia;
+ metadata = this$0._metadatas[this$0._metadataLabels[0]];
+ num = 250;
+ results = [ ];
+ for (i = start; i < last; i++) {
+ unit = this._result[i];
+ info = metadata.getInformation$I(unit.id).split(Oktavia.eob);
+ content = metadata.getContent$I(unit.id);
+ start = 0;
+ positions = SearchUnit$getPositions$LSearchUnit$(unit);
+ if (content.indexOf(info[0]) === 1) {
+ content = content.slice(info[0].length + 2, content.length);
+ start += info[0].length + 2;
+ }
+ end = start + num;
+ split = false;
+ if (positions[0].position > end - positions[0].word.length) {
+ end = positions[0].position + Math.floor(num / 2);
+ split = true;
+ }
+ for (j = positions.length - 1; j > -1; j--) {
+ pos = positions[j];
+ if (pos.position + pos.word.length < end) {
+ content = [ content.slice(0, pos.position - start), style.convert$S('<hit>*</hit>').replace('*', content.slice((position$0 = pos.position) - start, position$0 + pos.word.length - start)), content.slice(pos.position + pos.word.length - start, content.length) ].join('');
+ }
+ }
+ if (split) {
+ text = [ content.slice(0, Math.floor(num / 2)) + ' ...', content.slice(- Math.floor(num / 2), end - start) ].join('<br/>');
+ } else {
+ text = content.slice(0, end - start) + ' ...<br/>';
+ }
+ text = text.replace(Oktavia.eob, ' ').replace(/(<br\/>)(<br\/>)+/, '<br/><br/>');
+ results.push(({title: info[0], url: info[1], content: text, score: unit.score}));
+ }
+ return results;
+};
+
+/**
+ * @return {!string}
+ */
+OktaviaSearch.prototype.getHighlight$ = function () {
+ return this._highlight;
+};
+
+/**
+ * @return {Array.<undefined|_Proposal>}
+ */
+OktaviaSearch.prototype.getProposals$ = function () {
+ /** @type {Style} */
+ var style;
+ /** @type {Array.<undefined|_Proposal>} */
+ var results;
+ /** @type {!number} */
+ var i;
+ /** @type {Proposal} */
+ var proposal;
+ /** @type {Array.<undefined|!string>} */
+ var label;
+ /** @type {Array.<undefined|!string>} */
+ var option;
+ /** @type {!number} */
+ var j;
+ style = new Style$S('html');
+ results = [ ];
+ if (this._queries.length > 1) {
+ for (i = 0; i < this._proposals.length; i++) {
+ proposal = this._proposals[i];
+ if (proposal.expect > 0) {
+ label = [ ];
+ option = [ ];
+ for (j = 0; j < this._queries.length; j++) {
+ if (j !== proposal.omit) {
+ label.push(style.convert$S('<hit>' + this._queries[j].toString() + '</hit>'));
+ option.push(this._queries[j].toString());
+ } else {
+ label.push(style.convert$S('<del>' + this._queries[j].toString() + '</del>'));
+ }
+ }
+ results.push(({options: option.join(' '), label: label.join('&nbsp;'), count: proposal.expect}));
+ }
+ }
+ }
+ return results;
+};
+
+/**
+ * @param {SearchSummary} summary
+ * @return {Array.<undefined|SearchUnit>}
+ */
+OktaviaSearch.prototype._sortResult$LSearchSummary$ = function (summary) {
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var score;
+ /** @type {SearchUnit} */
+ var unit;
+ /** @type {!string} */
+ var pos;
+ /** @type {Position} */
+ var position;
+ for (i = 0; i < summary.result.units.length; i++) {
+ score = 0;
+ unit = summary.result.units[i];
+ for (pos in unit.positions) {
+ position = unit.positions[pos];
+ if (this._oktavia.wordPositionType$I(position.position)) {
+ score += 10;
+ } else {
+ score += 1;
+ }
+ if (! position.stemmed) {
+ score += 2;
+ }
+ }
+ unit.score = (score | 0);
+ }
+ return SearchSummary$getSortedResult$LSearchSummary$(summary);
+};
+
+/**
+ * class _Main$0 extends Object
+ * @constructor
+ */
+function _Main$0() {
+}
+
+/**
+ * @constructor
+ */
+function _Main$0$() {
+};
+
+_Main$0$.prototype = new _Main$0;
+
+/**
+ * @param {Array.<undefined|!string>} args
+ */
+_Main$0.main$AS = function (args) {
+};
+
+var _Main$0$main$AS = _Main$0.main$AS;
+
+/**
+ * class Oktavia extends Object
+ * @constructor
+ */
+function Oktavia() {
+}
+
+/**
+ * @constructor
+ */
+function Oktavia$() {
+ /** @type {Array.<undefined|!string>} */
+ var _utf162compressCode$0;
+ this._compressCode2utf16 = null;
+ this._fmindex = new FMIndex$();
+ this._metadatas = ({ });
+ this._metadataLabels = [ ];
+ this._stemmer = null;
+ this._stemmingResult = ({ });
+ _utf162compressCode$0 = this._utf162compressCode = [ Oktavia.eof, Oktavia.eob, Oktavia.unknown ];
+ _utf162compressCode$0.length = 65536;
+ this._compressCode2utf16 = [ Oktavia.eof, Oktavia.eob, Oktavia.unknown ];
+};
+
+Oktavia$.prototype = new Oktavia;
+
+/**
+ * @param {Stemmer} stemmer
+ */
+Oktavia.prototype.setStemmer$LStemmer$ = function (stemmer) {
+ this._stemmer = stemmer;
+};
+
+/**
+ * @return {Metadata}
+ */
+Oktavia.prototype.getPrimaryMetadata$ = function () {
+ return this._metadatas[this._metadataLabels[0]];
+};
+
+/**
+ * @param {!string} key
+ * @return {Section}
+ */
+Oktavia.prototype.addSection$S = function (key) {
+ /** @type {Section} */
+ var section;
+ if (this._metadataLabels.indexOf(key) !== -1) {
+ throw new Error('Metadata name ' + key + ' is already exists');
+ }
+ this._metadataLabels.push(key);
+ section = new Section$LOktavia$(this);
+ this._metadatas[key] = section;
+ return section;
+};
+
+/**
+ * @param {!string} key
+ * @return {Section}
+ */
+Oktavia.prototype.getSection$S = function (key) {
+ if (this._metadataLabels.indexOf(key) === -1) {
+ throw new Error('Metadata name ' + key + " does't exists");
+ }
+ return this._metadatas[key];
+};
+
+/**
+ * @param {!string} key
+ * @return {Splitter}
+ */
+Oktavia.prototype.addSplitter$S = function (key) {
+ /** @type {Splitter} */
+ var splitter;
+ if (this._metadataLabels.indexOf(key) !== -1) {
+ throw new Error('Metadata name ' + key + ' is already exists');
+ }
+ this._metadataLabels.push(key);
+ splitter = new Splitter$LOktavia$(this);
+ this._metadatas[key] = splitter;
+ return splitter;
+};
+
+/**
+ * @param {!string} key
+ * @return {Splitter}
+ */
+Oktavia.prototype.getSplitter$S = function (key) {
+ if (this._metadataLabels.indexOf(key) === -1) {
+ throw new Error('Metadata name ' + key + " does't exists");
+ }
+ return this._metadatas[key];
+};
+
+/**
+ * @param {!string} key
+ * @param {Array.<undefined|!string>} headers
+ * @return {Table}
+ */
+Oktavia.prototype.addTable$SAS = function (key, headers) {
+ /** @type {Table} */
+ var table;
+ if (this._metadataLabels.indexOf(key) !== -1) {
+ throw new Error('Metadata name ' + key + ' is already exists');
+ }
+ this._metadataLabels.push(key);
+ table = new Table$LOktavia$AS(this, headers);
+ this._metadatas[key] = table;
+ return table;
+};
+
+/**
+ * @param {!string} key
+ * @return {Table}
+ */
+Oktavia.prototype.getTable$S = function (key) {
+ if (this._metadataLabels.indexOf(key) === -1) {
+ throw new Error('Metadata name ' + key + " does't exists");
+ }
+ return this._metadatas[key];
+};
+
+/**
+ * @param {!string} key
+ * @return {Block}
+ */
+Oktavia.prototype.addBlock$S = function (key) {
+ /** @type {Block} */
+ var block;
+ if (this._metadataLabels.indexOf(key) !== -1) {
+ throw new Error('Metadata name ' + key + ' is already exists');
+ }
+ this._metadataLabels.push(key);
+ block = new Block$LOktavia$(this);
+ this._metadatas[key] = block;
+ return block;
+};
+
+/**
+ * @param {!string} key
+ * @return {Block}
+ */
+Oktavia.prototype.getBlock$S = function (key) {
+ if (this._metadataLabels.indexOf(key) === -1) {
+ throw new Error('Metadata name ' + key + " does't exists");
+ }
+ return this._metadatas[key];
+};
+
+/**
+ */
+Oktavia.prototype.addEndOfBlock$ = function () {
+ this._fmindex.push$S(Oktavia.eob);
+};
+
+/**
+ * @param {!string} words
+ */
+Oktavia.prototype.addWord$S = function (words) {
+ /** @type {Array.<undefined|!string>} */
+ var str;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var charCode;
+ /** @type {undefined|!string} */
+ var newCharCode;
+ str = [ ];
+ str.length = words.length;
+ for (i = 0; i < words.length; i++) {
+ charCode = words.charCodeAt(i);
+ newCharCode = this._utf162compressCode[charCode];
+ if (newCharCode == null) {
+ newCharCode = String.fromCharCode(this._compressCode2utf16.length);
+ this._utf162compressCode[charCode] = newCharCode;
+ this._compressCode2utf16.push(String.fromCharCode(charCode));
+ }
+ str.push(newCharCode);
+ }
+ this._fmindex.push$S(str.join(''));
+};
+
+/**
+ * @param {!string} words
+ * @param {!boolean} stemming
+ */
+Oktavia.prototype.addWord$SB = function (words, stemming) {
+ /** @type {Array.<undefined|!string>} */
+ var wordList;
+ /** @type {!number} */
+ var i;
+ /** @type {undefined|!string} */
+ var originalWord;
+ /** @type {!string} */
+ var smallWord;
+ /** @type {undefined|!string} */
+ var registerWord;
+ /** @type {!string} */
+ var baseWord;
+ /** @type {!string} */
+ var compressedCodeWord;
+ /** @type {Array.<undefined|!string>} */
+ var stemmedList;
+ this.addWord$S(words);
+ wordList = words.split(/\s+/);
+ for (i = 0; i < wordList.length; i++) {
+ originalWord = wordList[i];
+ smallWord = originalWord.slice(0, 1).toLowerCase() + originalWord.slice(1);
+ registerWord = null;
+ if (stemming && this._stemmer) {
+ baseWord = this._stemmer.stemWord$S(originalWord.toLowerCase());
+ if (originalWord.indexOf(baseWord) === -1) {
+ registerWord = baseWord;
+ }
+ } else {
+ if (originalWord != smallWord) {
+ registerWord = smallWord;
+ }
+ }
+ if (registerWord) {
+ compressedCodeWord = this._convertToCompressionCode$S(originalWord);
+ stemmedList = this._stemmingResult[registerWord];
+ if (! stemmedList) {
+ stemmedList = [ compressedCodeWord ];
+ this._stemmingResult[registerWord] = stemmedList;
+ } else {
+ if (stemmedList.indexOf(compressedCodeWord) === -1) {
+ stemmedList.push(compressedCodeWord);
+ }
+ }
+ }
+ }
+};
+
+/**
+ * @param {!string} keyword
+ * @return {!string}
+ */
+Oktavia.prototype._convertToCompressionCode$S = function (keyword) {
+ /** @type {Array.<undefined|!string>} */
+ var resultChars;
+ /** @type {!number} */
+ var i;
+ /** @type {undefined|!string} */
+ var chr;
+ resultChars = [ ];
+ for (i = 0; i < keyword.length; i++) {
+ chr = this._utf162compressCode[keyword.charCodeAt(i)];
+ if (chr == null) {
+ resultChars.push(Oktavia.unknown);
+ } else {
+ resultChars.push(chr);
+ }
+ }
+ return resultChars.join('');
+};
+
+/**
+ * @param {!string} keyword
+ * @param {!boolean} stemming
+ * @return {Array.<undefined|!number>}
+ */
+Oktavia.prototype.rawSearch$SB = function (keyword, stemming) {
+ /** @type {Array.<undefined|!number>} */
+ var result;
+ /** @type {!string} */
+ var baseWord;
+ /** @type {Array.<undefined|!string>} */
+ var stemmedList;
+ /** @type {!number} */
+ var i;
+ /** @type {undefined|!string} */
+ var word;
+ if (stemming) {
+ result = [ ];
+ if (this._stemmer) {
+ baseWord = this._stemmer.stemWord$S(keyword.toLowerCase());
+ stemmedList = this._stemmingResult[baseWord];
+ if (stemmedList) {
+ for (i = 0; i < stemmedList.length; i++) {
+ word = stemmedList[i];
+ result = result.concat(this._fmindex.search$S(word));
+ }
+ }
+ }
+ } else {
+ result = this._fmindex.search$S(this._convertToCompressionCode$S(keyword));
+ }
+ return result;
+};
+
+/**
+ * @param {Array.<undefined|Query>} queries
+ * @return {SearchSummary}
+ */
+Oktavia.prototype.search$ALQuery$ = function (queries) {
+ /** @type {SearchSummary} */
+ var summary;
+ /** @type {!number} */
+ var i;
+ /** @type {SingleResult} */
+ var result$0;
+ summary = ({sourceResults: [ ], result: null, oktavia: this});
+ for (i = 0; i < queries.length; i++) {
+ result$0 = this._searchQuery$LQuery$(queries[i]);
+ summary.sourceResults.push(result$0);
+ }
+ summary.result = SearchSummary$mergeResult$LSearchSummary$ALSingleResult$(summary, summary.sourceResults);
+ return summary;
+};
+
+/**
+ * @param {Query} query
+ * @return {SingleResult}
+ */
+Oktavia.prototype._searchQuery$LQuery$ = function (query) {
+ /** @type {SingleResult} */
+ var result;
+ /** @type {Array.<undefined|!number>} */
+ var positions;
+ result = new SingleResult$SBB(query.word, query.or, query.not);
+ if (query.raw) {
+ positions = this.rawSearch$SB(query.word, false);
+ } else {
+ positions = this.rawSearch$SB(query.word, false).concat(this.rawSearch$SB(query.word, true));
+ }
+ this._metadatas[this._metadataLabels[0]].grouping$LSingleResult$AISB(result, positions, query.word, ! query.raw);
+ return result;
+};
+
+/**
+ */
+Oktavia.prototype.build$ = function () {
+ this.build$IB(5, false);
+};
+
+/**
+ * @param {!number} cacheDensity
+ * @param {!boolean} verbose
+ */
+Oktavia.prototype.build$IB = function (cacheDensity, verbose) {
+ /** @type {!string} */
+ var key;
+ /** @type {!number} */
+ var cacheRange;
+ /** @type {!number} */
+ var maxChar;
+ for (key in this._metadatas) {
+ this._metadatas[key]._build$();
+ }
+ cacheRange = Math.round(Math.max(1, 100 / Math.min(100, Math.max(0.01, cacheDensity))));
+ maxChar = this._compressCode2utf16.length;
+ this._fmindex.build$SIIB(Oktavia.eof, maxChar, cacheRange, verbose);
+};
+
+/**
+ * @return {!string}
+ */
+Oktavia.prototype.dump$ = function () {
+ return this.dump$B(false);
+};
+
+/**
+ * @param {!boolean} verbose
+ * @return {!string}
+ */
+Oktavia.prototype.dump$B = function (verbose) {
+ /** @type {!string} */
+ var header;
+ /** @type {!string} */
+ var fmdata;
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var i;
+ /** @type {CompressionReport} */
+ var report;
+ /** @type {undefined|!string} */
+ var name;
+ /** @type {!string} */
+ var data;
+ header = Binary$dumpString$SLCompressionReport$("oktavia-01", null).slice(1);
+ if (verbose) {
+ console.log("Source text size: " + (this._fmindex.size$() * 2 + "") + ' bytes');
+ }
+ fmdata = this._fmindex.dump$B(verbose);
+ result = [ header, fmdata ];
+ result.push(Binary$dump16bitNumber$I(this._compressCode2utf16.length));
+ for (i = 3; i < this._compressCode2utf16.length; i++) {
+ result.push(this._compressCode2utf16[i]);
+ }
+ if (verbose) {
+ console.log('Char Code Map: ' + (this._compressCode2utf16.length * 2 - 2 + "") + ' bytes');
+ }
+ report = ({source: 0, result: 0});
+ result.push(Binary$dumpStringListMap$HASLCompressionReport$(this._stemmingResult, report));
+ if (verbose) {
+ console.log('Stemmed Word Table: ' + (result[result.length - 1].length + "") + ' bytes (' + (Math.round(report.result * 100.0 / report.source) + "") + '%)');
+ }
+ result.push(Binary$dump16bitNumber$I(this._metadataLabels.length));
+ for (i = 0; i < this._metadataLabels.length; i++) {
+ report = ({source: 0, result: 0});
+ name = this._metadataLabels[i];
+ data = this._metadatas[name]._dump$LCompressionReport$(report);
+ result.push(Binary$dumpString$SLCompressionReport$(name, report), data);
+ if (verbose) {
+ console.log('Meta Data ' + name + ': ' + (data.length * 2 + "") + ' bytes (' + (Math.round(report.result * 100.0 / report.source) + "") + '%)');
+ }
+ }
+ return result.join('');
+};
+
+/**
+ * @param {!string} data
+ */
+Oktavia.prototype.load$S = function (data) {
+ /** @type {!string} */
+ var header;
+ /** @type {!number} */
+ var offset;
+ /** @type {!number} */
+ var charCodeCount;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var charCode;
+ /** @type {LoadedStringListMapResult} */
+ var stemmedWords;
+ /** @type {!number} */
+ var metadataCount;
+ /** @type {LoadedStringResult} */
+ var nameResult;
+ /** @type {!string} */
+ var name;
+ /** @type {!number} */
+ var type;
+ header = Binary$dumpString$SLCompressionReport$("oktavia-01", null).slice(1);
+ if (data.slice(0, 5) !== header) {
+ throw new Error('Invalid data file');
+ }
+ this._metadatas = ({ });
+ this._metadataLabels = [ ];
+ offset = 5;
+ offset = this._fmindex.load$SI(data, offset);
+ charCodeCount = Binary$load16bitNumber$SI(data, offset++);
+ this._compressCode2utf16 = [ Oktavia.eof, Oktavia.eob, Oktavia.unknown ];
+ this._utf162compressCode = [ Oktavia.eof, Oktavia.eob, Oktavia.unknown ];
+ for (i = 3; i < charCodeCount; i++) {
+ charCode = Binary$load16bitNumber$SI(data, offset++);
+ this._compressCode2utf16.push(String.fromCharCode(charCode));
+ this._utf162compressCode[charCode] = String.fromCharCode(i);
+ }
+ stemmedWords = Binary$loadStringListMap$SI(data, offset);
+ this._stemmingResult = stemmedWords.result;
+ offset = stemmedWords.offset;
+ metadataCount = Binary$load16bitNumber$SI(data, offset++);
+ for (i = 0; i < metadataCount; i++) {
+ nameResult = Binary$loadString$SI(data, offset);
+ name = nameResult.result;
+ offset = nameResult.offset;
+ type = Binary$load16bitNumber$SI(data, offset++);
+ switch (type) {
+ case 0:
+ offset = Section$_load$LOktavia$SSI(this, name, data, offset);
+ break;
+ case 1:
+ offset = Splitter$_load$LOktavia$SSI(this, name, data, offset);
+ break;
+ case 2:
+ offset = Table$_load$LOktavia$SSI(this, name, data, offset);
+ break;
+ case 3:
+ offset = Block$_load$LOktavia$SSI(this, name, data, offset);
+ break;
+ }
+ }
+};
+
+/**
+ * @return {!number}
+ */
+Oktavia.prototype.contentSize$ = function () {
+ /** @type {FMIndex} */
+ var this$0;
+ this$0 = this._fmindex;
+ return this$0._substr.length;
+};
+
+/**
+ * @param {!number} position
+ * @return {!number}
+ */
+Oktavia.prototype.wordPositionType$I = function (position) {
+ /** @type {!number} */
+ var result;
+ /** @type {!string} */
+ var ahead;
+ result = 0;
+ if (position === 0) {
+ result = 4;
+ } else {
+ ahead = this._fmindex.getSubstring$II(position - 1, 1);
+ if (/\s/.test(ahead)) {
+ result = 2;
+ } else {
+ if (/\W/.test(ahead)) {
+ result = 1;
+ } else {
+ if (Oktavia.eob === ahead) {
+ result = 3;
+ }
+ }
+ }
+ }
+ return (result | 0);
+};
+
+/**
+ * @param {!number} position
+ * @param {!number} length
+ * @return {!string}
+ */
+Oktavia.prototype._getSubstring$II = function (position, length) {
+ /** @type {!string} */
+ var result;
+ /** @type {Array.<undefined|!string>} */
+ var str;
+ /** @type {!number} */
+ var i;
+ result = this._fmindex.getSubstring$II(position, length);
+ str = [ ];
+ for (i = 0; i < result.length; i++) {
+ str.push(this._compressCode2utf16[result.charCodeAt(i)]);
+ }
+ return str.join('');
+};
+
+/**
+ * class Binary extends Object
+ * @constructor
+ */
+function Binary() {
+}
+
+/**
+ * @constructor
+ */
+function Binary$() {
+};
+
+Binary$.prototype = new Binary;
+
+/**
+ * @param {!number} num
+ * @return {!string}
+ */
+Binary.dump32bitNumber$N = function (num) {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ result = [ String.fromCharCode(Math.floor(num / 65536)) ];
+ result.push(String.fromCharCode(num % 65536));
+ return result.join("");
+};
+
+var Binary$dump32bitNumber$N = Binary.dump32bitNumber$N;
+
+/**
+ * @param {!string} buffer
+ * @param {!number} offset
+ * @return {!number}
+ */
+Binary.load32bitNumber$SI = function (buffer, offset) {
+ /** @type {!number} */
+ var result;
+ result = buffer.charCodeAt(offset) * 65536 + buffer.charCodeAt(offset + 1);
+ return result;
+};
+
+var Binary$load32bitNumber$SI = Binary.load32bitNumber$SI;
+
+/**
+ * @param {!number} num
+ * @return {!string}
+ */
+Binary.dump16bitNumber$I = function (num) {
+ return String.fromCharCode(num % 65536);
+};
+
+var Binary$dump16bitNumber$I = Binary.dump16bitNumber$I;
+
+/**
+ * @param {!string} buffer
+ * @param {!number} offset
+ * @return {!number}
+ */
+Binary.load16bitNumber$SI = function (buffer, offset) {
+ return (buffer.charCodeAt(offset) | 0);
+};
+
+var Binary$load16bitNumber$SI = Binary.load16bitNumber$SI;
+
+/**
+ * @param {!string} str
+ * @return {!string}
+ */
+Binary.dumpString$S = function (str) {
+ return Binary$dumpString$SLCompressionReport$(str, null);
+};
+
+var Binary$dumpString$S = Binary.dumpString$S;
+
+/**
+ * @param {!string} str
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+Binary.dumpString$SLCompressionReport$ = function (str, report) {
+ /** @type {!number} */
+ var length;
+ /** @type {!boolean} */
+ var compress;
+ /** @type {Array.<undefined|!number>} */
+ var charCodes;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var charCode;
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {undefined|!number} */
+ var bytes;
+ if (str.length > 32768) {
+ str = str.slice(0, 32768);
+ }
+ length = str.length;
+ compress = true;
+ charCodes = [ ];
+ for (i = 0; i < length; i++) {
+ charCode = str.charCodeAt(i);
+ if (charCode > 255) {
+ compress = false;
+ break;
+ }
+ charCodes.push(charCode);
+ }
+ if (compress) {
+ result = [ Binary$dump16bitNumber$I(length + 32768) ];
+ for (i = 0; i < length; i += 2) {
+ bytes = charCodes[i];
+ if (i !== length - 1) {
+ bytes += charCodes[i + 1] << 8;
+ }
+ result.push(String.fromCharCode(bytes % 65536));
+ }
+ if (report) {
+ CompressionReport$add$LCompressionReport$II(report, length, Math.ceil(length / 2));
+ }
+ } else {
+ result = [ Binary$dump16bitNumber$I(length), str ];
+ if (report) {
+ CompressionReport$add$LCompressionReport$II(report, length, length);
+ }
+ }
+ return result.join('');
+};
+
+var Binary$dumpString$SLCompressionReport$ = Binary.dumpString$SLCompressionReport$;
+
+/**
+ * @param {!string} buffer
+ * @param {!number} offset
+ * @return {LoadedStringResult}
+ */
+Binary.loadString$SI = function (buffer, offset) {
+ return new LoadedStringResult$SI(buffer, offset);
+};
+
+var Binary$loadString$SI = Binary.loadString$SI;
+
+/**
+ * @param {Array.<undefined|!string>} strList
+ * @return {!string}
+ */
+Binary.dumpStringList$AS = function (strList) {
+ return Binary$dumpStringList$ASLCompressionReport$(strList, null);
+};
+
+var Binary$dumpStringList$AS = Binary.dumpStringList$AS;
+
+/**
+ * @param {Array.<undefined|!string>} strList
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+Binary.dumpStringList$ASLCompressionReport$ = function (strList, report) {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var i;
+ result = [ Binary$dump32bitNumber$N(strList.length) ];
+ for (i = 0; i < strList.length; i++) {
+ result.push(Binary$dumpString$SLCompressionReport$(strList[i], report));
+ }
+ return result.join('');
+};
+
+var Binary$dumpStringList$ASLCompressionReport$ = Binary.dumpStringList$ASLCompressionReport$;
+
+/**
+ * @param {!string} buffer
+ * @param {!number} offset
+ * @return {LoadedStringListResult}
+ */
+Binary.loadStringList$SI = function (buffer, offset) {
+ return new LoadedStringListResult$SI(buffer, offset);
+};
+
+var Binary$loadStringList$SI = Binary.loadStringList$SI;
+
+/**
+ * @param {Object.<string, undefined|Array.<undefined|!string>>} strMap
+ * @return {!string}
+ */
+Binary.dumpStringListMap$HAS = function (strMap) {
+ return Binary$dumpStringListMap$HASLCompressionReport$(strMap, null);
+};
+
+var Binary$dumpStringListMap$HAS = Binary.dumpStringListMap$HAS;
+
+/**
+ * @param {Object.<string, undefined|Array.<undefined|!string>>} strMap
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+Binary.dumpStringListMap$HASLCompressionReport$ = function (strMap, report) {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var counter;
+ /** @type {!string} */
+ var key;
+ result = [ ];
+ counter = 0;
+ for (key in strMap) {
+ result.push(Binary$dumpString$SLCompressionReport$(key, report));
+ result.push(Binary$dumpStringList$ASLCompressionReport$(strMap[key], report));
+ counter++;
+ }
+ return Binary$dump32bitNumber$N(counter) + result.join('');
+};
+
+var Binary$dumpStringListMap$HASLCompressionReport$ = Binary.dumpStringListMap$HASLCompressionReport$;
+
+/**
+ * @param {!string} buffer
+ * @param {!number} offset
+ * @return {LoadedStringListMapResult}
+ */
+Binary.loadStringListMap$SI = function (buffer, offset) {
+ return new LoadedStringListMapResult$SI(buffer, offset);
+};
+
+var Binary$loadStringListMap$SI = Binary.loadStringListMap$SI;
+
+/**
+ * @param {Array.<undefined|!number>} array
+ * @return {!string}
+ */
+Binary.dump32bitNumberList$AN = function (array) {
+ return Binary$dump32bitNumberList$ANLCompressionReport$(array, null);
+};
+
+var Binary$dump32bitNumberList$AN = Binary.dump32bitNumberList$AN;
+
+/**
+ * @param {Array.<undefined|!number>} array
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+Binary.dump32bitNumberList$ANLCompressionReport$ = function (array, report) {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var index;
+ /** @type {!number} */
+ var inputLength;
+ /** @type {!number} */
+ var length;
+ /** @type {!string} */
+ var resultString;
+ /** @type {!number} */
+ var value1$0;
+ /** @type {!number} */
+ var value2$0;
+ result = [ Binary$dump32bitNumber$N(array.length) ];
+ index = 0;
+ inputLength = array.length;
+ while (index < inputLength) {
+ if (array[index] == 0) {
+ length = Binary$_countZero$ANI(array, index);
+ result.push(Binary$_zeroBlock$I(length));
+ index += length;
+ } else {
+ if (Binary$_shouldZebraCode$ANI(array, index)) {
+ result.push(Binary$_createZebraCode$ANI(array, index));
+ value1$0 = array.length;
+ value2$0 = index + 15;
+ index = (value1$0 <= value2$0 ? value1$0 : value2$0);
+ } else {
+ length = Binary$_searchDoubleZero$ANI(array, index);
+ result.push(Binary$_nonZeroBlock$ANII(array, index, length));
+ if (length === 0) {
+ throw new Error('');
+ }
+ index += length;
+ }
+ }
+ }
+ resultString = result.join('');
+ if (report) {
+ CompressionReport$add$LCompressionReport$II(report, array.length * 2 + 2, resultString.length);
+ }
+ return resultString;
+};
+
+var Binary$dump32bitNumberList$ANLCompressionReport$ = Binary.dump32bitNumberList$ANLCompressionReport$;
+
+/**
+ * @param {!string} buffer
+ * @param {!number} offset
+ * @return {LoadedNumberListResult}
+ */
+Binary.load32bitNumberList$SI = function (buffer, offset) {
+ return new LoadedNumberListResult$SI(buffer, offset);
+};
+
+var Binary$load32bitNumberList$SI = Binary.load32bitNumberList$SI;
+
+/**
+ * @param {Array.<undefined|!number>} array
+ * @param {!number} offset
+ * @return {!number}
+ */
+Binary._countZero$ANI = function (array, offset) {
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var array$len$0;
+ for ((i = offset, array$len$0 = array.length); i < array$len$0; i++) {
+ if (array[i] != 0) {
+ return (i - offset | 0);
+ }
+ }
+ return (array.length - offset | 0);
+};
+
+var Binary$_countZero$ANI = Binary._countZero$ANI;
+
+/**
+ * @param {!number} length
+ * @return {!string}
+ */
+Binary._zeroBlock$I = function (length) {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ result = [ ];
+ while (length > 0) {
+ if (length > 16384) {
+ result.push(Binary$dump16bitNumber$I(16383));
+ length -= 16384;
+ } else {
+ result.push(Binary$dump16bitNumber$I(length - 1));
+ length = 0;
+ }
+ }
+ return result.join('');
+};
+
+var Binary$_zeroBlock$I = Binary._zeroBlock$I;
+
+/**
+ * @param {Array.<undefined|!number>} array
+ * @param {!number} offset
+ * @return {!boolean}
+ */
+Binary._shouldZebraCode$ANI = function (array, offset) {
+ /** @type {!number} */
+ var change;
+ /** @type {!boolean} */
+ var isLastZero;
+ /** @type {!number} */
+ var i;
+ if (array.length - offset < 16) {
+ return true;
+ }
+ change = 0;
+ isLastZero = false;
+ for (i = offset; i < offset + 15; i++) {
+ if (array[i] == 0) {
+ if (! isLastZero) {
+ isLastZero = true;
+ change++;
+ }
+ } else {
+ if (isLastZero) {
+ isLastZero = false;
+ change++;
+ }
+ }
+ }
+ return change > 2;
+};
+
+var Binary$_shouldZebraCode$ANI = Binary._shouldZebraCode$ANI;
+
+/**
+ * @param {Array.<undefined|!number>} array
+ * @param {!number} offset
+ * @return {!number}
+ */
+Binary._searchDoubleZero$ANI = function (array, offset) {
+ /** @type {!boolean} */
+ var isLastZero;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var array$len$0;
+ isLastZero = false;
+ for ((i = offset, array$len$0 = array.length); i < array$len$0; i++) {
+ if (array[i] == 0) {
+ if (isLastZero) {
+ return (i - offset - 1 | 0);
+ }
+ isLastZero = true;
+ } else {
+ isLastZero = false;
+ }
+ }
+ return (array.length - offset | 0);
+};
+
+var Binary$_searchDoubleZero$ANI = Binary._searchDoubleZero$ANI;
+
+/**
+ * @param {Array.<undefined|!number>} array
+ * @param {!number} offset
+ * @param {!number} length
+ * @return {!string}
+ */
+Binary._nonZeroBlock$ANII = function (array, offset, length) {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var blockLength;
+ /** @type {!number} */
+ var i;
+ result = [ ];
+ while (length > 0) {
+ if (length > 16384) {
+ blockLength = 16384;
+ length -= 16384;
+ } else {
+ blockLength = length;
+ length = 0;
+ }
+ result.push(Binary$dump16bitNumber$I(blockLength - 1 + 0x4000));
+ for (i = offset; i < offset + blockLength; i++) {
+ result.push(Binary$dump32bitNumber$N(array[i]));
+ }
+ offset += blockLength;
+ }
+ return result.join('');
+};
+
+var Binary$_nonZeroBlock$ANII = Binary._nonZeroBlock$ANII;
+
+/**
+ * @param {Array.<undefined|!number>} array
+ * @param {!number} offset
+ * @return {!string}
+ */
+Binary._createZebraCode$ANI = function (array, offset) {
+ /** @type {!number} */
+ var last;
+ /** @type {!number} */
+ var code;
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var value1$0;
+ /** @type {!number} */
+ var value2$0;
+ value1$0 = offset + 15;
+ value2$0 = array.length;
+ last = (value1$0 <= value2$0 ? value1$0 : value2$0);
+ code = 0x8000;
+ result = [ ];
+ for (i = offset; i < last; i++) {
+ if (array[i] != 0) {
+ result.push(Binary$dump32bitNumber$N(array[i]));
+ code = code + (0x1 << i - offset);
+ }
+ }
+ return String.fromCharCode(code) + result.join('');
+};
+
+var Binary$_createZebraCode$ANI = Binary._createZebraCode$ANI;
+
+/**
+ * @param {!string} str
+ * @return {!string}
+ */
+Binary.base64encode$S = function (str) {
+ /** @type {Array.<undefined|!string>} */
+ var out;
+ /** @type {Array.<undefined|!number>} */
+ var source;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var code;
+ /** @type {!number} */
+ var len;
+ /** @type {!number} */
+ var c1;
+ /** @type {undefined|!number} */
+ var c2;
+ /** @type {undefined|!number} */
+ var c3;
+ out = [ ];
+ source = [ ];
+ for (i = 0; i < str.length; i++) {
+ code = str.charCodeAt(i);
+ source.push(code & 0x00ff, code >>> 8);
+ }
+ len = str.length * 2;
+ i = 0;
+ while (i < len) {
+ c1 = source[i++] & 0xff;
+ if (i === len) {
+ out.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(c1 >> 2));
+ out.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((c1 & 0x3) << 4));
+ out.push("==");
+ break;
+ }
+ c2 = source[i++];
+ if (i === len) {
+ out.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(c1 >> 2));
+ out.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((c1 & 0x3) << 4 | (c2 & 0xF0) >> 4));
+ out.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((c2 & 0xF) << 2));
+ out.push("=");
+ break;
+ }
+ c3 = source[i++];
+ out.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(c1 >> 2));
+ out.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((c1 & 0x3) << 4 | (c2 & 0xF0) >> 4));
+ out.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((c2 & 0xF) << 2 | (c3 & 0xC0) >> 6));
+ out.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(c3 & 0x3F));
+ }
+ return out.join('');
+};
+
+var Binary$base64encode$S = Binary.base64encode$S;
+
+/**
+ * @param {Array.<undefined|!number>} source
+ * @return {!string}
+ */
+Binary._mergeCharCode$AI = function (source) {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var i;
+ result = [ ];
+ for (i = 0; i < source.length; i += 2) {
+ result.push(String.fromCharCode(source[i] + (source[i + 1] << 8)));
+ }
+ return result.join('');
+};
+
+var Binary$_mergeCharCode$AI = Binary._mergeCharCode$AI;
+
+/**
+ * @param {!string} str
+ * @return {!string}
+ */
+Binary.base64decode$S = function (str) {
+ /** @type {!number} */
+ var len;
+ /** @type {!number} */
+ var i;
+ /** @type {Array.<undefined|!number>} */
+ var out;
+ /** @type {undefined|!number} */
+ var c1;
+ /** @type {undefined|!number} */
+ var c2;
+ /** @type {!number} */
+ var c3;
+ /** @type {!number} */
+ var c4;
+ len = str.length;
+ i = 0;
+ out = [ ];
+ while (i < len) {
+ do {
+ c1 = Binary._base64DecodeChars[str.charCodeAt(i++) & 0xff];
+ } while (i < len && c1 == -1);
+ if (c1 == -1) {
+ break;
+ }
+ do {
+ c2 = Binary._base64DecodeChars[str.charCodeAt(i++) & 0xff];
+ } while (i < len && c2 == -1);
+ if (c2 == -1) {
+ break;
+ }
+ out.push(c1 << 2 | (c2 & 0x30) >> 4);
+ do {
+ c3 = str.charCodeAt(i++) & 0xff;
+ if (c3 === 61) {
+ return Binary$_mergeCharCode$AI(out);
+ }
+ c3 = Binary._base64DecodeChars[c3];
+ } while (i < len && c3 === -1);
+ if (c3 === -1) {
+ break;
+ }
+ out.push((c2 & 0XF) << 4 | (c3 & 0x3C) >> 2);
+ do {
+ c4 = str.charCodeAt(i++) & 0xff;
+ if (c4 === 61) {
+ return Binary$_mergeCharCode$AI(out);
+ }
+ c4 = (Binary._base64DecodeChars[c4] | 0);
+ } while (i < len && c4 === -1);
+ if (c4 === -1) {
+ break;
+ }
+ out.push((c3 & 0x03) << 6 | c4);
+ }
+ return Binary$_mergeCharCode$AI(out);
+};
+
+var Binary$base64decode$S = Binary.base64decode$S;
+
+/**
+ * class LoadedStringResult extends Object
+ * @constructor
+ */
+function LoadedStringResult() {
+}
+
+/**
+ * @constructor
+ * @param {!string} data
+ * @param {!number} offset
+ */
+function LoadedStringResult$SI(data, offset) {
+ /** @type {!number} */
+ var strLength;
+ /** @type {Array.<undefined|!string>} */
+ var bytes;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var code;
+ /** @type {!number} */
+ var offset$0;
+ this.result = "";
+ this.offset = 0;
+ offset$0 = offset++;
+ strLength = data.charCodeAt(offset$0);
+ if (strLength > 32767) {
+ strLength = strLength - 32768;
+ bytes = [ ];
+ for (i = 0; i < strLength; i += 2) {
+ code = data.charCodeAt(offset);
+ bytes.push(String.fromCharCode(code & 0x00ff));
+ if (i !== strLength - 1) {
+ bytes.push(String.fromCharCode(code >>> 8));
+ }
+ offset++;
+ }
+ this.result = bytes.join('');
+ this.offset = offset;
+ } else {
+ this.result = data.slice(offset, offset + strLength);
+ this.offset = (offset + strLength | 0);
+ }
+};
+
+LoadedStringResult$SI.prototype = new LoadedStringResult;
+
+/**
+ * class LoadedStringListResult extends Object
+ * @constructor
+ */
+function LoadedStringListResult() {
+}
+
+/**
+ * @constructor
+ * @param {!string} data
+ * @param {!number} offset
+ */
+function LoadedStringListResult$SI(data, offset) {
+ /** @type {!number} */
+ var length;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var strLength;
+ /** @type {!string} */
+ var resultStr;
+ /** @type {Array.<undefined|!string>} */
+ var bytes;
+ /** @type {!number} */
+ var j;
+ /** @type {!number} */
+ var code;
+ /** @type {!number} */
+ var result$0;
+ /** @type {!number} */
+ var offset$0;
+ this.offset = 0;
+ this.result = [ ];
+ result$0 = data.charCodeAt(offset) * 65536 + data.charCodeAt(offset + 1);
+ length = result$0;
+ offset += 2;
+ for (i = 0; i < length; i++) {
+ offset$0 = offset++;
+ strLength = data.charCodeAt(offset$0);
+ if (strLength > 32767) {
+ strLength = strLength - 32768;
+ bytes = [ ];
+ for (j = 0; j < strLength; j += 2) {
+ code = data.charCodeAt(offset);
+ bytes.push(String.fromCharCode(code & 0x00ff));
+ if (j !== strLength - 1) {
+ bytes.push(String.fromCharCode(code >>> 8));
+ }
+ offset++;
+ }
+ resultStr = bytes.join('');
+ } else {
+ resultStr = data.slice(offset, offset + strLength);
+ offset = (offset + strLength | 0);
+ }
+ this.result.push(resultStr);
+ }
+ this.offset = offset;
+};
+
+LoadedStringListResult$SI.prototype = new LoadedStringListResult;
+
+/**
+ * class LoadedStringListMapResult extends Object
+ * @constructor
+ */
+function LoadedStringListMapResult() {
+}
+
+/**
+ * @constructor
+ * @param {!string} data
+ * @param {!number} offset
+ */
+function LoadedStringListMapResult$SI(data, offset) {
+ /** @type {!number} */
+ var length;
+ /** @type {!number} */
+ var i;
+ /** @type {LoadedStringResult} */
+ var keyResult;
+ /** @type {LoadedStringListResult} */
+ var valueResult;
+ /** @type {!number} */
+ var result$0;
+ /** @type {!number} */
+ var offset$0;
+ this.offset = 0;
+ this.result = ({ });
+ result$0 = data.charCodeAt(offset) * 65536 + data.charCodeAt(offset + 1);
+ length = result$0;
+ offset += 2;
+ for (i = 0; i < length; i++) {
+ keyResult = new LoadedStringResult$SI(data, offset);
+ offset$0 = keyResult.offset;
+ valueResult = new LoadedStringListResult$SI(data, offset$0);
+ this.result[keyResult.result] = valueResult.result;
+ offset = valueResult.offset;
+ }
+ this.offset = offset;
+};
+
+LoadedStringListMapResult$SI.prototype = new LoadedStringListMapResult;
+
+/**
+ * class LoadedNumberListResult extends Object
+ * @constructor
+ */
+function LoadedNumberListResult() {
+}
+
+/**
+ * @constructor
+ * @param {!string} data
+ * @param {!number} offset
+ */
+function LoadedNumberListResult$SI(data, offset) {
+ /** @type {!number} */
+ var resultLength;
+ /** @type {!number} */
+ var originalOffset;
+ /** @type {Array.<undefined|!number>} */
+ var result;
+ /** @type {!number} */
+ var tag;
+ /** @type {!number} */
+ var length;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var result$0;
+ /** @type {!number} */
+ var value1$0;
+ this.result = null;
+ this.offset = 0;
+ result$0 = data.charCodeAt(offset) * 65536 + data.charCodeAt(offset + 1);
+ resultLength = result$0;
+ originalOffset = offset;
+ offset += 2;
+ result = [ ];
+ while (result.length < resultLength) {
+ tag = data.charCodeAt(offset++);
+ if (tag >>> 15 === 1) {
+ value1$0 = resultLength - result.length;
+ length = (value1$0 <= 15 ? value1$0 : 15);
+ for (i = 0; i < length; i++) {
+ if (tag >>> i & 0x1) {
+ result.push(Binary$load32bitNumber$SI(data, offset));
+ offset += 2;
+ } else {
+ result.push(0);
+ }
+ }
+ } else {
+ if (tag >>> 14 === 1) {
+ length = tag - 0x4000 + 1;
+ for (i = 0; i < length; i++) {
+ result.push(Binary$load32bitNumber$SI(data, offset));
+ offset += 2;
+ }
+ } else {
+ length = tag + 1;
+ for (i = 0; i < length; i++) {
+ result.push(0);
+ }
+ }
+ }
+ }
+ this.result = result;
+ this.offset = offset;
+};
+
+LoadedNumberListResult$SI.prototype = new LoadedNumberListResult;
+
+/**
+ * class CompressionReport extends Object
+ * @constructor
+ */
+function CompressionReport() {
+}
+
+/**
+ * @constructor
+ */
+function CompressionReport$() {
+ this.source = 0;
+ this.result = 0;
+};
+
+CompressionReport$.prototype = new CompressionReport;
+
+/**
+ * @param {CompressionReport} $this
+ * @param {!number} source
+ * @param {!number} result
+ */
+CompressionReport.add$LCompressionReport$II = function ($this, source, result) {
+ $this.source += source;
+ $this.result += result;
+};
+
+var CompressionReport$add$LCompressionReport$II = CompressionReport.add$LCompressionReport$II;
+
+/**
+ * @param {CompressionReport} $this
+ * @return {!number}
+ */
+CompressionReport.rate$LCompressionReport$ = function ($this) {
+ return (Math.round($this.result * 100.0 / $this.source) | 0);
+};
+
+var CompressionReport$rate$LCompressionReport$ = CompressionReport.rate$LCompressionReport$;
+
+/**
+ * class Query extends Object
+ * @constructor
+ */
+function Query() {
+}
+
+/**
+ * @constructor
+ */
+function Query$() {
+ this.word = '';
+ this.or = false;
+ this.not = false;
+ this.raw = false;
+};
+
+Query$.prototype = new Query;
+
+/**
+ * @return {!string}
+ */
+Query.prototype.toString = function () {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ result = [ ];
+ if (this.or) {
+ result.push("OR ");
+ }
+ if (this.not) {
+ result.push("-");
+ }
+ if (this.raw) {
+ result.push('"', this.word, '"');
+ } else {
+ result.push(this.word);
+ }
+ return result.join('');
+};
+
+/**
+ * class QueryStringParser extends Object
+ * @constructor
+ */
+function QueryStringParser() {
+}
+
+/**
+ * @constructor
+ */
+function QueryStringParser$() {
+ this.queries = [ ];
+};
+
+QueryStringParser$.prototype = new QueryStringParser;
+
+/**
+ * @param {QueryStringParser} $this
+ * @param {!string} queryString
+ * @return {Array.<undefined|Query>}
+ */
+QueryStringParser.parse$LQueryStringParser$S = function ($this, queryString) {
+ /** @type {!boolean} */
+ var nextOr;
+ /** @type {!boolean} */
+ var nextNot;
+ /** @type {!number} */
+ var currentWordStart;
+ /** @type {!number} */
+ var status;
+ /** @type {RegExp} */
+ var isSpace;
+ /** @type {!number} */
+ var i;
+ /** @type {!string} */
+ var ch;
+ /** @type {!string} */
+ var word;
+ /** @type {Query} */
+ var query;
+ nextOr = false;
+ nextNot = false;
+ currentWordStart = 0;
+ status = 0;
+ isSpace = /[\s\u3000]/;
+ for (i = 0; i < queryString.length; i++) {
+ ch = queryString.charAt(i);
+ switch (status) {
+ case 0:
+ if (! isSpace.test(ch)) {
+ if (ch === '-') {
+ nextNot = true;
+ } else {
+ if (ch === '"') {
+ currentWordStart = i + 1;
+ status = 2;
+ } else {
+ currentWordStart = i;
+ status = 1;
+ }
+ }
+ } else {
+ nextNot = false;
+ }
+ break;
+ case 1:
+ if (isSpace.test(ch)) {
+ word = queryString.slice(currentWordStart, i);
+ if (word === 'OR') {
+ nextOr = true;
+ } else {
+ query = new Query$();
+ query.word = word;
+ query.or = nextOr;
+ query.not = nextNot;
+ $this.queries.push(query);
+ nextOr = false;
+ nextNot = false;
+ }
+ status = 0;
+ }
+ break;
+ case 2:
+ if (ch === '"') {
+ word = queryString.slice(currentWordStart, i);
+ query = new Query$();
+ query.word = word;
+ query.or = nextOr;
+ query.not = nextNot;
+ query.raw = true;
+ $this.queries.push(query);
+ nextOr = false;
+ nextNot = false;
+ status = 0;
+ }
+ break;
+ }
+ }
+ switch (status) {
+ case 0:
+ break;
+ case 1:
+ query = new Query$();
+ word = queryString.slice(currentWordStart, queryString.length);
+ if (word !== 'OR') {
+ query.word = word;
+ query.or = nextOr;
+ query.not = nextNot;
+ $this.queries.push(query);
+ }
+ break;
+ case 2:
+ query = new Query$();
+ query.word = queryString.slice(currentWordStart, queryString.length);
+ query.or = nextOr;
+ query.not = nextNot;
+ query.raw = true;
+ $this.queries.push(query);
+ break;
+ }
+ return $this.queries;
+};
+
+var QueryStringParser$parse$LQueryStringParser$S = QueryStringParser.parse$LQueryStringParser$S;
+
+/**
+ * @param {QueryStringParser} $this
+ * @return {!string}
+ */
+QueryStringParser.highlight$LQueryStringParser$ = function ($this) {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var i;
+ /** @type {Query} */
+ var query;
+ result = [ ];
+ for (i = 0; i < $this.queries.length; i++) {
+ query = $this.queries[i];
+ if (! query.not) {
+ result.push("highlight=" + $__jsx_encodeURIComponent(query.word));
+ }
+ }
+ return '?' + result.join('&');
+};
+
+var QueryStringParser$highlight$LQueryStringParser$ = QueryStringParser.highlight$LQueryStringParser$;
+
+/**
+ * class Proposal extends Object
+ * @constructor
+ */
+function Proposal() {
+}
+
+/**
+ * @constructor
+ * @param {!number} omit
+ * @param {!number} expect
+ */
+function Proposal$II(omit, expect) {
+ this.omit = omit;
+ this.expect = expect;
+};
+
+Proposal$II.prototype = new Proposal;
+
+/**
+ * class Position extends Object
+ * @constructor
+ */
+function Position() {
+}
+
+/**
+ * @constructor
+ * @param {!string} word
+ * @param {!number} position
+ * @param {!boolean} stemmed
+ */
+function Position$SIB(word, position, stemmed) {
+ this.word = word;
+ this.position = position;
+ this.stemmed = stemmed;
+};
+
+Position$SIB.prototype = new Position;
+
+/**
+ * class SearchUnit extends Object
+ * @constructor
+ */
+function SearchUnit() {
+}
+
+/**
+ * @constructor
+ * @param {!number} id
+ */
+function SearchUnit$I(id) {
+ this.positions = ({ });
+ this.id = id;
+ this._size = 0;
+ this.score = 0;
+ this.startPosition = -1;
+};
+
+SearchUnit$I.prototype = new SearchUnit;
+
+/**
+ * @param {SearchUnit} $this
+ * @param {!string} word
+ * @param {!number} position
+ * @param {!boolean} stemmed
+ */
+SearchUnit.addPosition$LSearchUnit$SIB = function ($this, word, position, stemmed) {
+ /** @type {Position} */
+ var positionObj;
+ positionObj = $this.positions[position + ""];
+ if (! positionObj) {
+ $this._size++;
+ $this.positions[position + ""] = ({word: word, position: position, stemmed: stemmed});
+ } else {
+ if (positionObj.word.length < word.length) {
+ positionObj.word = word;
+ }
+ positionObj.stemmed = positionObj.stemmed && stemmed;
+ }
+};
+
+var SearchUnit$addPosition$LSearchUnit$SIB = SearchUnit.addPosition$LSearchUnit$SIB;
+
+/**
+ * @param {SearchUnit} $this
+ * @param {!number} position
+ * @return {Position}
+ */
+SearchUnit.get$LSearchUnit$I = function ($this, position) {
+ return $this.positions[position + ""];
+};
+
+var SearchUnit$get$LSearchUnit$I = SearchUnit.get$LSearchUnit$I;
+
+/**
+ * @param {SearchUnit} $this
+ * @return {!number}
+ */
+SearchUnit.size$LSearchUnit$ = function ($this) {
+ return $this._size;
+};
+
+var SearchUnit$size$LSearchUnit$ = SearchUnit.size$LSearchUnit$;
+
+/**
+ * @param {SearchUnit} $this
+ * @param {SearchUnit} rhs
+ */
+SearchUnit.merge$LSearchUnit$LSearchUnit$ = function ($this, rhs) {
+ /** @type {!string} */
+ var position;
+ /** @type {Position} */
+ var pos;
+ for (position in rhs.positions) {
+ pos = rhs.positions[position];
+ SearchUnit$addPosition$LSearchUnit$SIB($this, pos.word, pos.position, pos.stemmed);
+ }
+};
+
+var SearchUnit$merge$LSearchUnit$LSearchUnit$ = SearchUnit.merge$LSearchUnit$LSearchUnit$;
+
+/**
+ * @param {SearchUnit} $this
+ * @return {Array.<undefined|Position>}
+ */
+SearchUnit.getPositions$LSearchUnit$ = function ($this) {
+ /** @type {Array.<undefined|Position>} */
+ var result;
+ /** @type {!string} */
+ var pos;
+ result = [ ];
+ for (pos in $this.positions) {
+ result.push($this.positions[pos]);
+ }
+ result.sort((function (a, b) {
+ return a.position - b.position;
+ }));
+ return result;
+};
+
+var SearchUnit$getPositions$LSearchUnit$ = SearchUnit.getPositions$LSearchUnit$;
+
+/**
+ * class SingleResult extends Object
+ * @constructor
+ */
+function SingleResult() {
+}
+
+/**
+ * @constructor
+ */
+function SingleResult$() {
+ this.units = [ ];
+ this.unitIds = [ ];
+ this.or = false;
+ this.not = false;
+ this.searchWord = '';
+};
+
+SingleResult$.prototype = new SingleResult;
+
+/**
+ * @constructor
+ * @param {!string} searchWord
+ * @param {!boolean} or
+ * @param {!boolean} not
+ */
+function SingleResult$SBB(searchWord, or, not) {
+ this.units = [ ];
+ this.unitIds = [ ];
+ this.or = or;
+ this.not = not;
+ this.searchWord = searchWord;
+};
+
+SingleResult$SBB.prototype = new SingleResult;
+
+/**
+ * @param {SingleResult} $this
+ * @param {!number} unitId
+ * @return {SearchUnit}
+ */
+SingleResult.getSearchUnit$LSingleResult$I = function ($this, unitId) {
+ /** @type {!number} */
+ var existing;
+ /** @type {SearchUnit} */
+ var result;
+ existing = $this.unitIds.indexOf(unitId);
+ if (existing === -1) {
+ result = ({positions: ({ }), id: unitId, _size: 0, score: 0, startPosition: -1});
+ $this.units.push(result);
+ $this.unitIds.push(unitId);
+ } else {
+ result = $this.units[existing];
+ }
+ return result;
+};
+
+var SingleResult$getSearchUnit$LSingleResult$I = SingleResult.getSearchUnit$LSingleResult$I;
+
+/**
+ * @param {SingleResult} $this
+ * @param {SingleResult} rhs
+ * @return {SingleResult}
+ */
+SingleResult.merge$LSingleResult$LSingleResult$ = function ($this, rhs) {
+ /** @type {SingleResult} */
+ var result;
+ result = ({units: [ ], unitIds: [ ], or: false, not: false, searchWord: ''});
+ if (rhs.or) {
+ SingleResult$_orMerge$LSingleResult$LSingleResult$LSingleResult$($this, result, rhs);
+ } else {
+ if (rhs.not) {
+ SingleResult$_notMerge$LSingleResult$LSingleResult$LSingleResult$($this, result, rhs);
+ } else {
+ SingleResult$_andMerge$LSingleResult$LSingleResult$LSingleResult$($this, result, rhs);
+ }
+ }
+ return result;
+};
+
+var SingleResult$merge$LSingleResult$LSingleResult$ = SingleResult.merge$LSingleResult$LSingleResult$;
+
+/**
+ * @param {SingleResult} $this
+ * @return {!number}
+ */
+SingleResult.size$LSingleResult$ = function ($this) {
+ return ($this.units.length | 0);
+};
+
+var SingleResult$size$LSingleResult$ = SingleResult.size$LSingleResult$;
+
+/**
+ * @param {SingleResult} $this
+ * @param {SingleResult} result
+ * @param {SingleResult} rhs
+ */
+SingleResult._andMerge$LSingleResult$LSingleResult$LSingleResult$ = function ($this, result, rhs) {
+ /** @type {!number} */
+ var i;
+ /** @type {undefined|!number} */
+ var id;
+ /** @type {SearchUnit} */
+ var lhsSection;
+ for (i = 0; i < $this.unitIds.length; i++) {
+ id = $this.unitIds[i];
+ if (rhs.unitIds.indexOf(id) !== -1) {
+ lhsSection = $this.units[i];
+ result.unitIds.push(id);
+ result.units.push(lhsSection);
+ }
+ }
+};
+
+var SingleResult$_andMerge$LSingleResult$LSingleResult$LSingleResult$ = SingleResult._andMerge$LSingleResult$LSingleResult$LSingleResult$;
+
+/**
+ * @param {SingleResult} $this
+ * @param {SingleResult} result
+ * @param {SingleResult} rhs
+ */
+SingleResult._orMerge$LSingleResult$LSingleResult$LSingleResult$ = function ($this, result, rhs) {
+ /** @type {!number} */
+ var i;
+ /** @type {undefined|!number} */
+ var id;
+ /** @type {SearchUnit} */
+ var rhsSection;
+ /** @type {SearchUnit} */
+ var lhsSection;
+ /** @type {Array.<undefined|!number>} */
+ var unitIds$0;
+ /** @type {Array.<undefined|SearchUnit>} */
+ var units$0;
+ result.unitIds = (unitIds$0 = $this.unitIds).slice(0, unitIds$0.length);
+ result.units = (units$0 = $this.units).slice(0, units$0.length);
+ for (i = 0; i < rhs.unitIds.length; i++) {
+ id = rhs.unitIds[i];
+ rhsSection = rhs.units[i];
+ if (result.unitIds.indexOf(id) !== -1) {
+ lhsSection = result.units[result.unitIds.indexOf(id)];
+ SearchUnit$merge$LSearchUnit$LSearchUnit$(lhsSection, rhsSection);
+ } else {
+ result.unitIds.push(id);
+ result.units.push(rhsSection);
+ }
+ }
+};
+
+var SingleResult$_orMerge$LSingleResult$LSingleResult$LSingleResult$ = SingleResult._orMerge$LSingleResult$LSingleResult$LSingleResult$;
+
+/**
+ * @param {SingleResult} $this
+ * @param {SingleResult} result
+ * @param {SingleResult} rhs
+ */
+SingleResult._notMerge$LSingleResult$LSingleResult$LSingleResult$ = function ($this, result, rhs) {
+ /** @type {!number} */
+ var i;
+ /** @type {undefined|!number} */
+ var id;
+ /** @type {SearchUnit} */
+ var lhsSection;
+ for (i = 0; i < $this.unitIds.length; i++) {
+ id = $this.unitIds[i];
+ if (rhs.unitIds.indexOf(id) === -1) {
+ lhsSection = $this.units[i];
+ result.unitIds.push(id);
+ result.units.push(lhsSection);
+ }
+ }
+};
+
+var SingleResult$_notMerge$LSingleResult$LSingleResult$LSingleResult$ = SingleResult._notMerge$LSingleResult$LSingleResult$LSingleResult$;
+
+/**
+ * class SearchSummary extends Object
+ * @constructor
+ */
+function SearchSummary() {
+}
+
+/**
+ * @constructor
+ */
+function SearchSummary$() {
+ this.sourceResults = [ ];
+ this.result = null;
+ this.oktavia = null;
+};
+
+SearchSummary$.prototype = new SearchSummary;
+
+/**
+ * @constructor
+ * @param {Oktavia} oktavia
+ */
+function SearchSummary$LOktavia$(oktavia) {
+ this.sourceResults = [ ];
+ this.result = null;
+ this.oktavia = oktavia;
+};
+
+SearchSummary$LOktavia$.prototype = new SearchSummary;
+
+/**
+ * @param {SearchSummary} $this
+ * @param {SingleResult} result
+ */
+SearchSummary.addQuery$LSearchSummary$LSingleResult$ = function ($this, result) {
+ $this.sourceResults.push(result);
+};
+
+var SearchSummary$addQuery$LSearchSummary$LSingleResult$ = SearchSummary.addQuery$LSearchSummary$LSingleResult$;
+
+/**
+ * @param {SearchSummary} $this
+ */
+SearchSummary.mergeResult$LSearchSummary$ = function ($this) {
+ $this.result = SearchSummary$mergeResult$LSearchSummary$ALSingleResult$($this, $this.sourceResults);
+};
+
+var SearchSummary$mergeResult$LSearchSummary$ = SearchSummary.mergeResult$LSearchSummary$;
+
+/**
+ * @param {SearchSummary} $this
+ * @param {Array.<undefined|SingleResult>} results
+ * @return {SingleResult}
+ */
+SearchSummary.mergeResult$LSearchSummary$ALSingleResult$ = function ($this, results) {
+ /** @type {SingleResult} */
+ var rhs;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var results$len$0;
+ rhs = results[0];
+ for ((i = 1, results$len$0 = results.length); i < results$len$0; i++) {
+ rhs = SingleResult$merge$LSingleResult$LSingleResult$(rhs, results[i]);
+ }
+ return rhs;
+};
+
+var SearchSummary$mergeResult$LSearchSummary$ALSingleResult$ = SearchSummary.mergeResult$LSearchSummary$ALSingleResult$;
+
+/**
+ * @param {SearchSummary} $this
+ * @return {Array.<undefined|Proposal>}
+ */
+SearchSummary.getProposal$LSearchSummary$ = function ($this) {
+ /** @type {Array.<undefined|Proposal>} */
+ var proposals;
+ /** @type {!number} */
+ var i;
+ /** @type {Array.<undefined|SingleResult>} */
+ var tmpSource;
+ /** @type {!number} */
+ var j;
+ /** @type {SingleResult} */
+ var result;
+ proposals = [ ];
+ for (i = 0; i < $this.sourceResults.length; i++) {
+ tmpSource = [ ];
+ for (j = 0; j < $this.sourceResults.length; j++) {
+ if (i !== j) {
+ tmpSource.push($this.sourceResults[j]);
+ }
+ }
+ result = SearchSummary$mergeResult$LSearchSummary$ALSingleResult$($this, tmpSource);
+ proposals.push(({omit: i, expect: result.units.length}));
+ }
+ proposals.sort((function (a, b) {
+ return b.expect - a.expect;
+ }));
+ return proposals;
+};
+
+var SearchSummary$getProposal$LSearchSummary$ = SearchSummary.getProposal$LSearchSummary$;
+
+/**
+ * @param {SearchSummary} $this
+ * @return {Array.<undefined|SearchUnit>}
+ */
+SearchSummary.getSortedResult$LSearchSummary$ = function ($this) {
+ /** @type {Array.<undefined|SearchUnit>} */
+ var result;
+ /** @type {Array.<undefined|SearchUnit>} */
+ var units$0;
+ result = (units$0 = $this.result.units).slice(0, units$0.length);
+ result.sort((function (a, b) {
+ return b.score - a.score;
+ }));
+ return result;
+};
+
+var SearchSummary$getSortedResult$LSearchSummary$ = SearchSummary.getSortedResult$LSearchSummary$;
+
+/**
+ * @param {SearchSummary} $this
+ * @return {!number}
+ */
+SearchSummary.size$LSearchSummary$ = function ($this) {
+ /** @type {SingleResult} */
+ var this$0;
+ this$0 = $this.result;
+ return (this$0.units.length | 0);
+};
+
+var SearchSummary$size$LSearchSummary$ = SearchSummary.size$LSearchSummary$;
+
+/**
+ * @param {SearchSummary} $this
+ * @param {SingleResult} result
+ */
+SearchSummary.add$LSearchSummary$LSingleResult$ = function ($this, result) {
+ $this.sourceResults.push(result);
+};
+
+var SearchSummary$add$LSearchSummary$LSingleResult$ = SearchSummary.add$LSearchSummary$LSingleResult$;
+
+/**
+ * class Style extends Object
+ * @constructor
+ */
+function Style() {
+}
+
+/**
+ * @constructor
+ * @param {!string} mode
+ */
+function Style$S(mode) {
+ this.styles = null;
+ this.escapeHTML = false;
+ switch (mode) {
+ case 'console':
+ this.styles = Style.console;
+ break;
+ case 'html':
+ this.styles = Style.html;
+ break;
+ case 'ignore':
+ this.styles = Style.ignore;
+ break;
+ default:
+ this.styles = Style.ignore;
+ break;
+ }
+ this.escapeHTML = mode === 'html';
+};
+
+Style$S.prototype = new Style;
+
+/**
+ * @param {!string} source
+ * @return {!string}
+ */
+Style.prototype.convert$S = function (source) {
+ /** @type {_HTMLHandler} */
+ var handler;
+ /** @type {SAXParser} */
+ var parser;
+ handler = new _HTMLHandler$HASB(this.styles, this.escapeHTML);
+ parser = new SAXParser$LSAXHandler$(handler);
+ parser.parse$S(source);
+ return handler.text.join('');
+};
+
+/**
+ * class Stemmer
+ * @constructor
+ */
+function Stemmer() {
+}
+
+Stemmer.prototype.$__jsx_implements_Stemmer = true;
+
+/**
+ * @constructor
+ */
+function Stemmer$() {
+};
+
+Stemmer$.prototype = new Stemmer;
+
+/**
+ * class BaseStemmer extends Object
+ * @constructor
+ */
+function BaseStemmer() {
+}
+
+$__jsx_merge_interface(BaseStemmer, Stemmer);
+
+/**
+ * @constructor
+ */
+function BaseStemmer$() {
+ /** @type {!string} */
+ var current$0;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var limit$0;
+ this.cache = ({ });
+ current$0 = this.current = "";
+ cursor$0 = this.cursor = 0;
+ limit$0 = this.limit = current$0.length;
+ this.limit_backward = 0;
+ this.bra = cursor$0;
+ this.ket = limit$0;
+};
+
+BaseStemmer$.prototype = new BaseStemmer;
+
+/**
+ * @param {!string} value
+ */
+BaseStemmer.prototype.setCurrent$S = function (value) {
+ /** @type {!string} */
+ var current$0;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var limit$0;
+ current$0 = this.current = value;
+ cursor$0 = this.cursor = 0;
+ limit$0 = this.limit = current$0.length;
+ this.limit_backward = 0;
+ this.bra = cursor$0;
+ this.ket = limit$0;
+};
+
+/**
+ * @return {!string}
+ */
+BaseStemmer.prototype.getCurrent$ = function () {
+ return this.current;
+};
+
+/**
+ * @param {BaseStemmer} other
+ */
+BaseStemmer.prototype.copy_from$LBaseStemmer$ = function (other) {
+ this.current = other.current;
+ this.cursor = other.cursor;
+ this.limit = other.limit;
+ this.limit_backward = other.limit_backward;
+ this.bra = other.bra;
+ this.ket = other.ket;
+};
+
+/**
+ * @param {Array.<undefined|!number>} s
+ * @param {!number} min
+ * @param {!number} max
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.in_grouping$AIII = function (s, min, max) {
+ /** @type {!number} */
+ var ch;
+ if (this.cursor >= this.limit) {
+ return false;
+ }
+ ch = this.current.charCodeAt(this.cursor);
+ if (ch > max || ch < min) {
+ return false;
+ }
+ ch -= min;
+ if ((s[ch >>> 3] & 0x1 << (ch & 0x7)) === 0) {
+ return false;
+ }
+ this.cursor++;
+ return true;
+};
+
+/**
+ * @param {Array.<undefined|!number>} s
+ * @param {!number} min
+ * @param {!number} max
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.in_grouping_b$AIII = function (s, min, max) {
+ /** @type {!number} */
+ var ch;
+ if (this.cursor <= this.limit_backward) {
+ return false;
+ }
+ ch = this.current.charCodeAt(this.cursor - 1);
+ if (ch > max || ch < min) {
+ return false;
+ }
+ ch -= min;
+ if ((s[ch >>> 3] & 0x1 << (ch & 0x7)) === 0) {
+ return false;
+ }
+ this.cursor--;
+ return true;
+};
+
+/**
+ * @param {Array.<undefined|!number>} s
+ * @param {!number} min
+ * @param {!number} max
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.out_grouping$AIII = function (s, min, max) {
+ /** @type {!number} */
+ var ch;
+ if (this.cursor >= this.limit) {
+ return false;
+ }
+ ch = this.current.charCodeAt(this.cursor);
+ if (ch > max || ch < min) {
+ this.cursor++;
+ return true;
+ }
+ ch -= min;
+ if ((s[ch >>> 3] & 0X1 << (ch & 0x7)) === 0) {
+ this.cursor++;
+ return true;
+ }
+ return false;
+};
+
+/**
+ * @param {Array.<undefined|!number>} s
+ * @param {!number} min
+ * @param {!number} max
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.out_grouping_b$AIII = function (s, min, max) {
+ /** @type {!number} */
+ var ch;
+ if (this.cursor <= this.limit_backward) {
+ return false;
+ }
+ ch = this.current.charCodeAt(this.cursor - 1);
+ if (ch > max || ch < min) {
+ this.cursor--;
+ return true;
+ }
+ ch -= min;
+ if ((s[ch >>> 3] & 0x1 << (ch & 0x7)) === 0) {
+ this.cursor--;
+ return true;
+ }
+ return false;
+};
+
+/**
+ * @param {!number} min
+ * @param {!number} max
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.in_range$II = function (min, max) {
+ /** @type {!number} */
+ var ch;
+ if (this.cursor >= this.limit) {
+ return false;
+ }
+ ch = this.current.charCodeAt(this.cursor);
+ if (ch > max || ch < min) {
+ return false;
+ }
+ this.cursor++;
+ return true;
+};
+
+/**
+ * @param {!number} min
+ * @param {!number} max
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.in_range_b$II = function (min, max) {
+ /** @type {!number} */
+ var ch;
+ if (this.cursor <= this.limit_backward) {
+ return false;
+ }
+ ch = this.current.charCodeAt(this.cursor - 1);
+ if (ch > max || ch < min) {
+ return false;
+ }
+ this.cursor--;
+ return true;
+};
+
+/**
+ * @param {!number} min
+ * @param {!number} max
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.out_range$II = function (min, max) {
+ /** @type {!number} */
+ var ch;
+ if (this.cursor >= this.limit) {
+ return false;
+ }
+ ch = this.current.charCodeAt(this.cursor);
+ if (! (ch > max || ch < min)) {
+ return false;
+ }
+ this.cursor++;
+ return true;
+};
+
+/**
+ * @param {!number} min
+ * @param {!number} max
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.out_range_b$II = function (min, max) {
+ /** @type {!number} */
+ var ch;
+ if (this.cursor <= this.limit_backward) {
+ return false;
+ }
+ ch = this.current.charCodeAt(this.cursor - 1);
+ if (! (ch > max || ch < min)) {
+ return false;
+ }
+ this.cursor--;
+ return true;
+};
+
+/**
+ * @param {!number} s_size
+ * @param {!string} s
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.eq_s$IS = function (s_size, s) {
+ /** @type {!number} */
+ var cursor$0;
+ if (this.limit - this.cursor < s_size) {
+ return false;
+ }
+ if (this.current.slice(cursor$0 = this.cursor, cursor$0 + s_size) !== s) {
+ return false;
+ }
+ this.cursor += s_size;
+ return true;
+};
+
+/**
+ * @param {!number} s_size
+ * @param {!string} s
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.eq_s_b$IS = function (s_size, s) {
+ /** @type {!number} */
+ var cursor$0;
+ if (this.cursor - this.limit_backward < s_size) {
+ return false;
+ }
+ if (this.current.slice((cursor$0 = this.cursor) - s_size, cursor$0) !== s) {
+ return false;
+ }
+ this.cursor -= s_size;
+ return true;
+};
+
+/**
+ * @param {!string} s
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.eq_v$S = function (s) {
+ return this.eq_s$IS(s.length, s);
+};
+
+/**
+ * @param {!string} s
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.eq_v_b$S = function (s) {
+ return this.eq_s_b$IS(s.length, s);
+};
+
+/**
+ * @param {Array.<undefined|Among>} v
+ * @param {!number} v_size
+ * @return {!number}
+ */
+BaseStemmer.prototype.find_among$ALAmong$I = function (v, v_size) {
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var j;
+ /** @type {!number} */
+ var c;
+ /** @type {!number} */
+ var l;
+ /** @type {!number} */
+ var common_i;
+ /** @type {!number} */
+ var common_j;
+ /** @type {!boolean} */
+ var first_key_inspected;
+ /** @type {!number} */
+ var k;
+ /** @type {!number} */
+ var diff;
+ /** @type {!number} */
+ var common;
+ /** @type {Among} */
+ var w;
+ /** @type {!number} */
+ var i2;
+ /** @type {!boolean} */
+ var res;
+ i = 0;
+ j = v_size;
+ c = this.cursor;
+ l = this.limit;
+ common_i = 0;
+ common_j = 0;
+ first_key_inspected = false;
+ while (true) {
+ k = i + (j - i >>> 1);
+ diff = 0;
+ common = (common_i < common_j ? common_i : common_j);
+ w = v[k];
+ for (i2 = common; i2 < w.s_size; i2++) {
+ if (c + common === l) {
+ diff = -1;
+ break;
+ }
+ diff = this.current.charCodeAt(c + common) - w.s.charCodeAt(i2);
+ if (diff !== 0) {
+ break;
+ }
+ common++;
+ }
+ if (diff < 0) {
+ j = k;
+ common_j = common;
+ } else {
+ i = k;
+ common_i = common;
+ }
+ if (j - i <= 1) {
+ if (i > 0) {
+ break;
+ }
+ if (j === i) {
+ break;
+ }
+ if (first_key_inspected) {
+ break;
+ }
+ first_key_inspected = true;
+ }
+ }
+ while (true) {
+ w = v[i];
+ if (common_i >= w.s_size) {
+ this.cursor = (c + w.s_size | 0);
+ if (w.method == null) {
+ return w.result;
+ }
+ res = w.method(w.instance);
+ this.cursor = (c + w.s_size | 0);
+ if (res) {
+ return w.result;
+ }
+ }
+ i = w.substring_i;
+ if (i < 0) {
+ return 0;
+ }
+ }
+ return -1;
+};
+
+/**
+ * @param {Array.<undefined|Among>} v
+ * @param {!number} v_size
+ * @return {!number}
+ */
+BaseStemmer.prototype.find_among_b$ALAmong$I = function (v, v_size) {
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var j;
+ /** @type {!number} */
+ var c;
+ /** @type {!number} */
+ var lb;
+ /** @type {!number} */
+ var common_i;
+ /** @type {!number} */
+ var common_j;
+ /** @type {!boolean} */
+ var first_key_inspected;
+ /** @type {!number} */
+ var k;
+ /** @type {!number} */
+ var diff;
+ /** @type {!number} */
+ var common;
+ /** @type {Among} */
+ var w;
+ /** @type {!number} */
+ var i2;
+ /** @type {!boolean} */
+ var res;
+ i = 0;
+ j = v_size;
+ c = this.cursor;
+ lb = this.limit_backward;
+ common_i = 0;
+ common_j = 0;
+ first_key_inspected = false;
+ while (true) {
+ k = i + (j - i >> 1);
+ diff = 0;
+ common = (common_i < common_j ? common_i : common_j);
+ w = v[k];
+ for (i2 = w.s_size - 1 - common; i2 >= 0; i2--) {
+ if (c - common === lb) {
+ diff = -1;
+ break;
+ }
+ diff = this.current.charCodeAt(c - 1 - common) - w.s.charCodeAt(i2);
+ if (diff !== 0) {
+ break;
+ }
+ common++;
+ }
+ if (diff < 0) {
+ j = k;
+ common_j = common;
+ } else {
+ i = k;
+ common_i = common;
+ }
+ if (j - i <= 1) {
+ if (i > 0) {
+ break;
+ }
+ if (j === i) {
+ break;
+ }
+ if (first_key_inspected) {
+ break;
+ }
+ first_key_inspected = true;
+ }
+ }
+ while (true) {
+ w = v[i];
+ if (common_i >= w.s_size) {
+ this.cursor = (c - w.s_size | 0);
+ if (w.method == null) {
+ return w.result;
+ }
+ res = w.method(this);
+ this.cursor = (c - w.s_size | 0);
+ if (res) {
+ return w.result;
+ }
+ }
+ i = w.substring_i;
+ if (i < 0) {
+ return 0;
+ }
+ }
+ return -1;
+};
+
+/**
+ * @param {!number} c_bra
+ * @param {!number} c_ket
+ * @param {!string} s
+ * @return {!number}
+ */
+BaseStemmer.prototype.replace_s$IIS = function (c_bra, c_ket, s) {
+ /** @type {!number} */
+ var adjustment;
+ adjustment = s.length - (c_ket - c_bra);
+ this.current = this.current.slice(0, c_bra) + s + this.current.slice(c_ket);
+ this.limit += (adjustment | 0);
+ if (this.cursor >= c_ket) {
+ this.cursor += (adjustment | 0);
+ } else {
+ if (this.cursor > c_bra) {
+ this.cursor = c_bra;
+ }
+ }
+ return (adjustment | 0);
+};
+
+/**
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.slice_check$ = function () {
+ /** @type {!number} */
+ var bra$0;
+ /** @type {!number} */
+ var ket$0;
+ /** @type {!number} */
+ var limit$0;
+ return ((bra$0 = this.bra) < 0 || bra$0 > (ket$0 = this.ket) || ket$0 > (limit$0 = this.limit) || limit$0 > this.current.length ? false : true);
+};
+
+/**
+ * @param {!string} s
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.slice_from$S = function (s) {
+ /** @type {!boolean} */
+ var result;
+ /** @type {!number} */
+ var bra$0;
+ /** @type {!number} */
+ var ket$0;
+ /** @type {!number} */
+ var limit$0;
+ result = false;
+ if ((bra$0 = this.bra) < 0 || bra$0 > (ket$0 = this.ket) || ket$0 > (limit$0 = this.limit) || limit$0 > this.current.length ? false : true) {
+ this.replace_s$IIS(this.bra, this.ket, s);
+ result = true;
+ }
+ return result;
+};
+
+/**
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.slice_del$ = function () {
+ return this.slice_from$S("");
+};
+
+/**
+ * @param {!number} c_bra
+ * @param {!number} c_ket
+ * @param {!string} s
+ */
+BaseStemmer.prototype.insert$IIS = function (c_bra, c_ket, s) {
+ /** @type {!number} */
+ var adjustment;
+ adjustment = this.replace_s$IIS(c_bra, c_ket, s);
+ if (c_bra <= this.bra) {
+ this.bra += (adjustment | 0);
+ }
+ if (c_bra <= this.ket) {
+ this.ket += (adjustment | 0);
+ }
+};
+
+/**
+ * @param {!string} s
+ * @return {!string}
+ */
+BaseStemmer.prototype.slice_to$S = function (s) {
+ /** @type {!string} */
+ var result;
+ /** @type {!number} */
+ var bra$0;
+ /** @type {!number} */
+ var ket$0;
+ /** @type {!number} */
+ var limit$0;
+ result = '';
+ if ((bra$0 = this.bra) < 0 || bra$0 > (ket$0 = this.ket) || ket$0 > (limit$0 = this.limit) || limit$0 > this.current.length ? false : true) {
+ result = this.current.slice(this.bra, this.ket);
+ }
+ return result;
+};
+
+/**
+ * @param {!string} s
+ * @return {!string}
+ */
+BaseStemmer.prototype.assign_to$S = function (s) {
+ return this.current.slice(0, this.limit);
+};
+
+/**
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.stem$ = function () {
+ return false;
+};
+
+/**
+ * @param {!string} word
+ * @return {!string}
+ */
+BaseStemmer.prototype.stemWord$S = function (word) {
+ /** @type {undefined|!string} */
+ var result;
+ /** @type {!string} */
+ var current$0;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var limit$0;
+ result = this.cache['.' + word];
+ if (result == null) {
+ current$0 = this.current = word;
+ cursor$0 = this.cursor = 0;
+ limit$0 = this.limit = current$0.length;
+ this.limit_backward = 0;
+ this.bra = cursor$0;
+ this.ket = limit$0;
+ this.stem$();
+ result = this.current;
+ this.cache['.' + word] = result;
+ }
+ return result;
+};
+
+/**
+ * @param {Array.<undefined|!string>} words
+ * @return {Array.<undefined|!string>}
+ */
+BaseStemmer.prototype.stemWords$AS = function (words) {
+ /** @type {Array.<undefined|!string>} */
+ var results;
+ /** @type {!number} */
+ var i;
+ /** @type {undefined|!string} */
+ var word;
+ /** @type {undefined|!string} */
+ var result;
+ /** @type {!string} */
+ var current$0;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var limit$0;
+ results = [ ];
+ for (i = 0; i < words.length; i++) {
+ word = words[i];
+ result = this.cache['.' + word];
+ if (result == null) {
+ current$0 = this.current = word;
+ cursor$0 = this.cursor = 0;
+ limit$0 = this.limit = current$0.length;
+ this.limit_backward = 0;
+ this.bra = cursor$0;
+ this.ket = limit$0;
+ this.stem$();
+ result = this.current;
+ this.cache['.' + word] = result;
+ }
+ results.push(result);
+ }
+ return results;
+};
+
+/**
+ * class TurkishStemmer extends BaseStemmer
+ * @constructor
+ */
+function TurkishStemmer() {
+}
+
+TurkishStemmer.prototype = new BaseStemmer;
+/**
+ * @constructor
+ */
+function TurkishStemmer$() {
+ BaseStemmer$.call(this);
+ this.B_continue_stemming_noun_suffixes = false;
+ this.I_strlen = 0;
+};
+
+TurkishStemmer$.prototype = new TurkishStemmer;
+
+/**
+ * @param {TurkishStemmer} other
+ */
+TurkishStemmer.prototype.copy_from$LTurkishStemmer$ = function (other) {
+ this.B_continue_stemming_noun_suffixes = other.B_continue_stemming_noun_suffixes;
+ this.I_strlen = other.I_strlen;
+ BaseStemmer.prototype.copy_from$LBaseStemmer$.call(this, other);
+};
+
+/**
+ * @return {!boolean}
+ */
+TurkishStemmer.prototype.r_check_vowel_harmony$ = function () {
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var v_3;
+ /** @type {!number} */
+ var v_4;
+ /** @type {!number} */
+ var v_5;
+ /** @type {!number} */
+ var v_6;
+ /** @type {!number} */
+ var v_7;
+ /** @type {!number} */
+ var v_8;
+ /** @type {!number} */
+ var v_9;
+ /** @type {!number} */
+ var v_10;
+ /** @type {!number} */
+ var v_11;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!boolean} */
+ var lab2;
+ /** @type {!boolean} */
+ var lab3;
+ /** @type {!boolean} */
+ var lab5;
+ /** @type {!boolean} */
+ var lab6;
+ /** @type {!boolean} */
+ var lab8;
+ /** @type {!boolean} */
+ var lab9;
+ /** @type {!boolean} */
+ var lab11;
+ /** @type {!boolean} */
+ var lab12;
+ /** @type {!boolean} */
+ var lab14;
+ /** @type {!boolean} */
+ var lab15;
+ /** @type {!boolean} */
+ var lab17;
+ /** @type {!boolean} */
+ var lab18;
+ /** @type {!boolean} */
+ var lab20;
+ /** @type {!boolean} */
+ var lab21;
+ /** @type {!boolean} */
+ var lab23;
+ /** @type {!boolean} */
+ var lab25;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var cursor$1;
+ /** @type {!number} */
+ var cursor$2;
+ /** @type {!number} */
+ var cursor$3;
+ /** @type {!number} */
+ var cursor$4;
+ /** @type {!number} */
+ var cursor$5;
+ /** @type {!number} */
+ var cursor$6;
+ /** @type {!number} */
+ var cursor$7;
+ /** @type {!number} */
+ var cursor$8;
+ v_1 = this.limit - this.cursor;
+golab0:
+ while (true) {
+ v_2 = this.limit - this.cursor;
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ if (! this.in_grouping_b$AIII(TurkishStemmer.g_vowel, 97, 305)) {
+ break lab1;
+ }
+ this.cursor = this.limit - v_2;
+ break golab0;
+ }
+ cursor$0 = this.cursor = this.limit - v_2;
+ if (cursor$0 <= this.limit_backward) {
+ return false;
+ }
+ this.cursor--;
+ }
+ lab2 = true;
+lab2:
+ while (lab2 === true) {
+ lab2 = false;
+ v_3 = this.limit - this.cursor;
+ lab3 = true;
+ lab3:
+ while (lab3 === true) {
+ lab3 = false;
+ if (! this.eq_s_b$IS(1, "a")) {
+ break lab3;
+ }
+ golab4:
+ while (true) {
+ v_4 = this.limit - this.cursor;
+ lab5 = true;
+ lab5:
+ while (lab5 === true) {
+ lab5 = false;
+ if (! this.in_grouping_b$AIII(TurkishStemmer.g_vowel1, 97, 305)) {
+ break lab5;
+ }
+ this.cursor = this.limit - v_4;
+ break golab4;
+ }
+ cursor$1 = this.cursor = this.limit - v_4;
+ if (cursor$1 <= this.limit_backward) {
+ break lab3;
+ }
+ this.cursor--;
+ }
+ break lab2;
+ }
+ this.cursor = this.limit - v_3;
+ lab6 = true;
+ lab6:
+ while (lab6 === true) {
+ lab6 = false;
+ if (! this.eq_s_b$IS(1, "e")) {
+ break lab6;
+ }
+ golab7:
+ while (true) {
+ v_5 = this.limit - this.cursor;
+ lab8 = true;
+ lab8:
+ while (lab8 === true) {
+ lab8 = false;
+ if (! this.in_grouping_b$AIII(TurkishStemmer.g_vowel2, 101, 252)) {
+ break lab8;
+ }
+ this.cursor = this.limit - v_5;
+ break golab7;
+ }
+ cursor$2 = this.cursor = this.limit - v_5;
+ if (cursor$2 <= this.limit_backward) {
+ break lab6;
+ }
+ this.cursor--;
+ }
+ break lab2;
+ }
+ this.cursor = this.limit - v_3;
+ lab9 = true;
+ lab9:
+ while (lab9 === true) {
+ lab9 = false;
+ if (! this.eq_s_b$IS(1, "\u0131")) {
+ break lab9;
+ }
+ golab10:
+ while (true) {
+ v_6 = this.limit - this.cursor;
+ lab11 = true;
+ lab11:
+ while (lab11 === true) {
+ lab11 = false;
+ if (! this.in_grouping_b$AIII(TurkishStemmer.g_vowel3, 97, 305)) {
+ break lab11;
+ }
+ this.cursor = this.limit - v_6;
+ break golab10;
+ }
+ cursor$3 = this.cursor = this.limit - v_6;
+ if (cursor$3 <= this.limit_backward) {
+ break lab9;
+ }
+ this.cursor--;
+ }
+ break lab2;
+ }
+ this.cursor = this.limit - v_3;
+ lab12 = true;
+ lab12:
+ while (lab12 === true) {
+ lab12 = false;
+ if (! this.eq_s_b$IS(1, "i")) {
+ break lab12;
+ }
+ golab13:
+ while (true) {
+ v_7 = this.limit - this.cursor;
+ lab14 = true;
+ lab14:
+ while (lab14 === true) {
+ lab14 = false;
+ if (! this.in_grouping_b$AIII(TurkishStemmer.g_vowel4, 101, 105)) {
+ break lab14;
+ }
+ this.cursor = this.limit - v_7;
+ break golab13;
+ }
+ cursor$4 = this.cursor = this.limit - v_7;
+ if (cursor$4 <= this.limit_backward) {
+ break lab12;
+ }
+ this.cursor--;
+ }
+ break lab2;
+ }
+ this.cursor = this.limit - v_3;
+ lab15 = true;
+ lab15:
+ while (lab15 === true) {
+ lab15 = false;
+ if (! this.eq_s_b$IS(1, "o")) {
+ break lab15;
+ }
+ golab16:
+ while (true) {
+ v_8 = this.limit - this.cursor;
+ lab17 = true;
+ lab17:
+ while (lab17 === true) {
+ lab17 = false;
+ if (! this.in_grouping_b$AIII(TurkishStemmer.g_vowel5, 111, 117)) {
+ break lab17;
+ }
+ this.cursor = this.limit - v_8;
+ break golab16;
+ }
+ cursor$5 = this.cursor = this.limit - v_8;
+ if (cursor$5 <= this.limit_backward) {
+ break lab15;
+ }
+ this.cursor--;
+ }
+ break lab2;
+ }
+ this.cursor = this.limit - v_3;
+ lab18 = true;
+ lab18:
+ while (lab18 === true) {
+ lab18 = false;
+ if (! this.eq_s_b$IS(1, "\u00F6")) {
+ break lab18;
+ }
+ golab19:
+ while (true) {
+ v_9 = this.limit - this.cursor;
+ lab20 = true;
+ lab20:
+ while (lab20 === true) {
+ lab20 = false;
+ if (! this.in_grouping_b$AIII(TurkishStemmer.g_vowel6, 246, 252)) {
+ break lab20;
+ }
+ this.cursor = this.limit - v_9;
+ break golab19;
+ }
+ cursor$6 = this.cursor = this.limit - v_9;
+ if (cursor$6 <= this.limit_backward) {
+ break lab18;
+ }
+ this.cursor--;
+ }
+ break lab2;
+ }
+ this.cursor = this.limit - v_3;
+ lab21 = true;
+ lab21:
+ while (lab21 === true) {
+ lab21 = false;
+ if (! this.eq_s_b$IS(1, "u")) {
+ break lab21;
+ }
+ golab22:
+ while (true) {
+ v_10 = this.limit - this.cursor;
+ lab23 = true;
+ lab23:
+ while (lab23 === true) {
+ lab23 = false;
+ if (! this.in_grouping_b$AIII(TurkishStemmer.g_vowel5, 111, 117)) {
+ break lab23;
+ }
+ this.cursor = this.limit - v_10;
+ break golab22;
+ }
+ cursor$7 = this.cursor = this.limit - v_10;
+ if (cursor$7 <= this.limit_backward) {
+ break lab21;
+ }
+ this.cursor--;
+ }
+ break lab2;
+ }
+ this.cursor = this.limit - v_3;
+ if (! this.eq_s_b$IS(1, "\u00FC")) {
+ return false;
+ }
+ golab24:
+ while (true) {
+ v_11 = this.limit - this.cursor;
+ lab25 = true;
+ lab25:
+ while (lab25 === true) {
+ lab25 = false;
+ if (! this.in_grouping_b$AIII(TurkishStemmer.g_vowel6, 246, 252)) {
+ break lab25;
+ }
+ this.cursor = this.limit - v_11;
+ break golab24;
+ }
+ cursor$8 = this.cursor = this.limit - v_11;
+ if (cursor$8 <= this.limit_backward) {
+ return false;
+ }
+ this.cursor--;
+ }
+ }
+ this.cursor = this.limit - v_1;
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+TurkishStemmer.prototype.r_mark_suffix_with_optional_n_consonant$ = function () {
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var v_3;
+ /** @type {!number} */
+ var v_4;
+ /** @type {!number} */
+ var v_5;
+ /** @type {!number} */
+ var v_6;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!boolean} */
+ var lab2;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var limit$0;
+ /** @type {!number} */
+ var cursor$1;
+ /** @type {!number} */
+ var limit$1;
+ /** @type {!number} */
+ var cursor$2;
+ lab0 = true;
+lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ v_1 = this.limit - this.cursor;
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ v_2 = this.limit - this.cursor;
+ if (! this.eq_s_b$IS(1, "n")) {
+ break lab1;
+ }
+ cursor$0 = this.cursor = this.limit - v_2;
+ if (cursor$0 <= this.limit_backward) {
+ break lab1;
+ }
+ this.cursor--;
+ v_3 = this.limit - this.cursor;
+ if (! this.in_grouping_b$AIII(TurkishStemmer.g_vowel, 97, 305)) {
+ break lab1;
+ }
+ this.cursor = this.limit - v_3;
+ break lab0;
+ }
+ cursor$1 = this.cursor = (limit$0 = this.limit) - v_1;
+ v_4 = limit$0 - cursor$1;
+ lab2 = true;
+ lab2:
+ while (lab2 === true) {
+ lab2 = false;
+ v_5 = this.limit - this.cursor;
+ if (! this.eq_s_b$IS(1, "n")) {
+ break lab2;
+ }
+ this.cursor = this.limit - v_5;
+ return false;
+ }
+ cursor$2 = this.cursor = (limit$1 = this.limit) - v_4;
+ v_6 = limit$1 - cursor$2;
+ if (cursor$2 <= this.limit_backward) {
+ return false;
+ }
+ this.cursor--;
+ if (! this.in_grouping_b$AIII(TurkishStemmer.g_vowel, 97, 305)) {
+ return false;
+ }
+ this.cursor = this.limit - v_6;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+TurkishStemmer.prototype.r_mark_suffix_with_optional_s_consonant$ = function () {
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var v_3;
+ /** @type {!number} */
+ var v_4;
+ /** @type {!number} */
+ var v_5;
+ /** @type {!number} */
+ var v_6;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!boolean} */
+ var lab2;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var limit$0;
+ /** @type {!number} */
+ var cursor$1;
+ /** @type {!number} */
+ var limit$1;
+ /** @type {!number} */
+ var cursor$2;
+ lab0 = true;
+lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ v_1 = this.limit - this.cursor;
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ v_2 = this.limit - this.cursor;
+ if (! this.eq_s_b$IS(1, "s")) {
+ break lab1;
+ }
+ cursor$0 = this.cursor = this.limit - v_2;
+ if (cursor$0 <= this.limit_backward) {
+ break lab1;
+ }
+ this.cursor--;
+ v_3 = this.limit - this.cursor;
+ if (! this.in_grouping_b$AIII(TurkishStemmer.g_vowel, 97, 305)) {
+ break lab1;
+ }
+ this.cursor = this.limit - v_3;
+ break lab0;
+ }
+ cursor$1 = this.cursor = (limit$0 = this.limit) - v_1;
+ v_4 = limit$0 - cursor$1;
+ lab2 = true;
+ lab2:
+ while (lab2 === true) {
+ lab2 = false;
+ v_5 = this.limit - this.cursor;
+ if (! this.eq_s_b$IS(1, "s")) {
+ break lab2;
+ }
+ this.cursor = this.limit - v_5;
+ return false;
+ }
+ cursor$2 = this.cursor = (limit$1 = this.limit) - v_4;
+ v_6 = limit$1 - cursor$2;
+ if (cursor$2 <= this.limit_backward) {
+ return false;
+ }
+ this.cursor--;
+ if (! this.in_grouping_b$AIII(TurkishStemmer.g_vowel, 97, 305)) {
+ return false;
+ }
+ this.cursor = this.limit - v_6;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+TurkishStemmer.prototype.r_mark_suffix_with_optional_y_consonant$ = function () {
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var v_3;
+ /** @type {!number} */
+ var v_4;
+ /** @type {!number} */
+ var v_5;
+ /** @type {!number} */
+ var v_6;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!boolean} */
+ var lab2;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var limit$0;
+ /** @type {!number} */
+ var cursor$1;
+ /** @type {!number} */
+ var limit$1;
+ /** @type {!number} */
+ var cursor$2;
+ lab0 = true;
+lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ v_1 = this.limit - this.cursor;
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ v_2 = this.limit - this.cursor;
+ if (! this.eq_s_b$IS(1, "y")) {
+ break lab1;
+ }
+ cursor$0 = this.cursor = this.limit - v_2;
+ if (cursor$0 <= this.limit_backward) {
+ break lab1;
+ }
+ this.cursor--;
+ v_3 = this.limit - this.cursor;
+ if (! this.in_grouping_b$AIII(TurkishStemmer.g_vowel, 97, 305)) {
+ break lab1;
+ }
+ this.cursor = this.limit - v_3;
+ break lab0;
+ }
+ cursor$1 = this.cursor = (limit$0 = this.limit) - v_1;
+ v_4 = limit$0 - cursor$1;
+ lab2 = true;
+ lab2:
+ while (lab2 === true) {
+ lab2 = false;
+ v_5 = this.limit - this.cursor;
+ if (! this.eq_s_b$IS(1, "y")) {
+ break lab2;
+ }
+ this.cursor = this.limit - v_5;
+ return false;
+ }
+ cursor$2 = this.cursor = (limit$1 = this.limit) - v_4;
+ v_6 = limit$1 - cursor$2;
+ if (cursor$2 <= this.limit_backward) {
+ return false;
+ }
+ this.cursor--;
+ if (! this.in_grouping_b$AIII(TurkishStemmer.g_vowel, 97, 305)) {
+ return false;
+ }
+ this.cursor = this.limit - v_6;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+TurkishStemmer.prototype.r_mark_suffix_with_optional_U_vowel$ = function () {
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var v_3;
+ /** @type {!number} */
+ var v_4;
+ /** @type {!number} */
+ var v_5;
+ /** @type {!number} */
+ var v_6;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!boolean} */
+ var lab2;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var limit$0;
+ /** @type {!number} */
+ var cursor$1;
+ /** @type {!number} */
+ var limit$1;
+ /** @type {!number} */
+ var cursor$2;
+ lab0 = true;
+lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ v_1 = this.limit - this.cursor;
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ v_2 = this.limit - this.cursor;
+ if (! this.in_grouping_b$AIII(TurkishStemmer.g_U, 105, 305)) {
+ break lab1;
+ }
+ cursor$0 = this.cursor = this.limit - v_2;
+ if (cursor$0 <= this.limit_backward) {
+ break lab1;
+ }
+ this.cursor--;
+ v_3 = this.limit - this.cursor;
+ if (! this.out_grouping_b$AIII(TurkishStemmer.g_vowel, 97, 305)) {
+ break lab1;
+ }
+ this.cursor = this.limit - v_3;
+ break lab0;
+ }
+ cursor$1 = this.cursor = (limit$0 = this.limit) - v_1;
+ v_4 = limit$0 - cursor$1;
+ lab2 = true;
+ lab2:
+ while (lab2 === true) {
+ lab2 = false;
+ v_5 = this.limit - this.cursor;
+ if (! this.in_grouping_b$AIII(TurkishStemmer.g_U, 105, 305)) {
+ break lab2;
+ }
+ this.cursor = this.limit - v_5;
+ return false;
+ }
+ cursor$2 = this.cursor = (limit$1 = this.limit) - v_4;
+ v_6 = limit$1 - cursor$2;
+ if (cursor$2 <= this.limit_backward) {
+ return false;
+ }
+ this.cursor--;
+ if (! this.out_grouping_b$AIII(TurkishStemmer.g_vowel, 97, 305)) {
+ return false;
+ }
+ this.cursor = this.limit - v_6;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+TurkishStemmer.prototype.r_mark_possessives$ = function () {
+ return (this.find_among_b$ALAmong$I(TurkishStemmer.a_0, 10) === 0 ? false : ! this.r_mark_suffix_with_optional_U_vowel$() ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+TurkishStemmer.prototype.r_mark_sU$ = function () {
+ return (! this.r_check_vowel_harmony$() ? false : ! this.in_grouping_b$AIII(TurkishStemmer.g_U, 105, 305) ? false : ! this.r_mark_suffix_with_optional_s_consonant$() ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+TurkishStemmer.prototype.r_mark_lArI$ = function () {
+ return (this.find_among_b$ALAmong$I(TurkishStemmer.a_1, 2) === 0 ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+TurkishStemmer.prototype.r_mark_yU$ = function () {
+ return (! this.r_check_vowel_harmony$() ? false : ! this.in_grouping_b$AIII(TurkishStemmer.g_U, 105, 305) ? false : ! this.r_mark_suffix_with_optional_y_consonant$() ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+TurkishStemmer.prototype.r_mark_nU$ = function () {
+ return (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_2, 4) === 0 ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+TurkishStemmer.prototype.r_mark_nUn$ = function () {
+ return (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_3, 4) === 0 ? false : ! this.r_mark_suffix_with_optional_n_consonant$() ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+TurkishStemmer.prototype.r_mark_yA$ = function () {
+ return (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_4, 2) === 0 ? false : ! this.r_mark_suffix_with_optional_y_consonant$() ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+TurkishStemmer.prototype.r_mark_nA$ = function () {
+ return (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_5, 2) === 0 ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+TurkishStemmer.prototype.r_mark_DA$ = function () {
+ return (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_6, 4) === 0 ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+TurkishStemmer.prototype.r_mark_ndA$ = function () {
+ return (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_7, 2) === 0 ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+TurkishStemmer.prototype.r_mark_DAn$ = function () {
+ return (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_8, 4) === 0 ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+TurkishStemmer.prototype.r_mark_ndAn$ = function () {
+ return (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_9, 2) === 0 ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+TurkishStemmer.prototype.r_mark_ylA$ = function () {
+ return (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_10, 2) === 0 ? false : ! this.r_mark_suffix_with_optional_y_consonant$() ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+TurkishStemmer.prototype.r_mark_ki$ = function () {
+ return (! this.eq_s_b$IS(2, "ki") ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+TurkishStemmer.prototype.r_mark_ncA$ = function () {
+ return (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_11, 2) === 0 ? false : ! this.r_mark_suffix_with_optional_n_consonant$() ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+TurkishStemmer.prototype.r_mark_yUm$ = function () {
+ return (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_12, 4) === 0 ? false : ! this.r_mark_suffix_with_optional_y_consonant$() ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+TurkishStemmer.prototype.r_mark_sUn$ = function () {
+ return (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_13, 4) === 0 ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+TurkishStemmer.prototype.r_mark_yUz$ = function () {
+ return (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_14, 4) === 0 ? false : ! this.r_mark_suffix_with_optional_y_consonant$() ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+TurkishStemmer.prototype.r_mark_sUnUz$ = function () {
+ return (this.find_among_b$ALAmong$I(TurkishStemmer.a_15, 4) === 0 ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+TurkishStemmer.prototype.r_mark_lAr$ = function () {
+ return (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_16, 2) === 0 ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+TurkishStemmer.prototype.r_mark_nUz$ = function () {
+ return (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_17, 4) === 0 ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+TurkishStemmer.prototype.r_mark_DUr$ = function () {
+ return (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_18, 8) === 0 ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+TurkishStemmer.prototype.r_mark_cAsInA$ = function () {
+ return (this.find_among_b$ALAmong$I(TurkishStemmer.a_19, 2) === 0 ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+TurkishStemmer.prototype.r_mark_yDU$ = function () {
+ return (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_20, 32) === 0 ? false : ! this.r_mark_suffix_with_optional_y_consonant$() ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+TurkishStemmer.prototype.r_mark_ysA$ = function () {
+ return (this.find_among_b$ALAmong$I(TurkishStemmer.a_21, 8) === 0 ? false : ! this.r_mark_suffix_with_optional_y_consonant$() ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+TurkishStemmer.prototype.r_mark_ymUs_$ = function () {
+ return (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_22, 4) === 0 ? false : ! this.r_mark_suffix_with_optional_y_consonant$() ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+TurkishStemmer.prototype.r_mark_yken$ = function () {
+ return (! this.eq_s_b$IS(3, "ken") ? false : ! this.r_mark_suffix_with_optional_y_consonant$() ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+TurkishStemmer.prototype.r_stem_nominal_verb_suffixes$ = function () {
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var v_3;
+ /** @type {!number} */
+ var v_4;
+ /** @type {!number} */
+ var v_5;
+ /** @type {!number} */
+ var v_6;
+ /** @type {!number} */
+ var v_7;
+ /** @type {!number} */
+ var v_8;
+ /** @type {!number} */
+ var v_9;
+ /** @type {!number} */
+ var v_10;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!boolean} */
+ var lab2;
+ /** @type {!boolean} */
+ var lab3;
+ /** @type {!boolean} */
+ var lab4;
+ /** @type {!boolean} */
+ var lab5;
+ /** @type {!boolean} */
+ var lab6;
+ /** @type {!boolean} */
+ var lab7;
+ /** @type {!boolean} */
+ var lab8;
+ /** @type {!boolean} */
+ var lab9;
+ /** @type {!boolean} */
+ var lab10;
+ /** @type {!boolean} */
+ var lab11;
+ /** @type {!boolean} */
+ var lab12;
+ /** @type {!boolean} */
+ var lab13;
+ /** @type {!boolean} */
+ var lab14;
+ /** @type {!boolean} */
+ var lab15;
+ /** @type {!boolean} */
+ var lab16;
+ /** @type {!boolean} */
+ var lab17;
+ /** @type {!boolean} */
+ var lab18;
+ /** @type {!boolean} */
+ var lab19;
+ /** @type {!boolean} */
+ var lab20;
+ /** @type {!boolean} */
+ var lab21;
+ /** @type {!boolean} */
+ var lab22;
+ /** @type {!boolean} */
+ var lab23;
+ /** @type {!boolean} */
+ var lab24;
+ /** @type {!boolean} */
+ var lab25;
+ /** @type {!boolean} */
+ var lab26;
+ /** @type {!boolean} */
+ var lab27;
+ /** @type {!boolean} */
+ var lab28;
+ /** @type {!boolean} */
+ var lab29;
+ /** @type {!boolean} */
+ var lab30;
+ /** @type {!boolean} */
+ var lab31;
+ /** @type {!boolean} */
+ var lab32;
+ /** @type {!boolean} */
+ var lab33;
+ /** @type {!boolean} */
+ var lab34;
+ this.ket = this.cursor;
+ this.B_continue_stemming_noun_suffixes = true;
+ lab0 = true;
+lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ v_1 = this.limit - this.cursor;
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ lab2 = true;
+ lab2:
+ while (lab2 === true) {
+ lab2 = false;
+ v_2 = this.limit - this.cursor;
+ lab3 = true;
+ lab3:
+ while (lab3 === true) {
+ lab3 = false;
+ if (! (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_22, 4) === 0 ? false : ! this.r_mark_suffix_with_optional_y_consonant$() ? false : true)) {
+ break lab3;
+ }
+ break lab2;
+ }
+ this.cursor = this.limit - v_2;
+ lab4 = true;
+ lab4:
+ while (lab4 === true) {
+ lab4 = false;
+ if (! (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_20, 32) === 0 ? false : ! this.r_mark_suffix_with_optional_y_consonant$() ? false : true)) {
+ break lab4;
+ }
+ break lab2;
+ }
+ this.cursor = this.limit - v_2;
+ lab5 = true;
+ lab5:
+ while (lab5 === true) {
+ lab5 = false;
+ if (! (this.find_among_b$ALAmong$I(TurkishStemmer.a_21, 8) === 0 ? false : ! this.r_mark_suffix_with_optional_y_consonant$() ? false : true)) {
+ break lab5;
+ }
+ break lab2;
+ }
+ this.cursor = this.limit - v_2;
+ if (! (! this.eq_s_b$IS(3, "ken") ? false : ! this.r_mark_suffix_with_optional_y_consonant$() ? false : true)) {
+ break lab1;
+ }
+ }
+ break lab0;
+ }
+ this.cursor = this.limit - v_1;
+ lab6 = true;
+ lab6:
+ while (lab6 === true) {
+ lab6 = false;
+ if (! (this.find_among_b$ALAmong$I(TurkishStemmer.a_19, 2) === 0 ? false : true)) {
+ break lab6;
+ }
+ lab7 = true;
+ lab7:
+ while (lab7 === true) {
+ lab7 = false;
+ v_3 = this.limit - this.cursor;
+ lab8 = true;
+ lab8:
+ while (lab8 === true) {
+ lab8 = false;
+ if (! (this.find_among_b$ALAmong$I(TurkishStemmer.a_15, 4) === 0 ? false : true)) {
+ break lab8;
+ }
+ break lab7;
+ }
+ this.cursor = this.limit - v_3;
+ lab9 = true;
+ lab9:
+ while (lab9 === true) {
+ lab9 = false;
+ if (! (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_16, 2) === 0 ? false : true)) {
+ break lab9;
+ }
+ break lab7;
+ }
+ this.cursor = this.limit - v_3;
+ lab10 = true;
+ lab10:
+ while (lab10 === true) {
+ lab10 = false;
+ if (! (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_12, 4) === 0 ? false : ! this.r_mark_suffix_with_optional_y_consonant$() ? false : true)) {
+ break lab10;
+ }
+ break lab7;
+ }
+ this.cursor = this.limit - v_3;
+ lab11 = true;
+ lab11:
+ while (lab11 === true) {
+ lab11 = false;
+ if (! (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_13, 4) === 0 ? false : true)) {
+ break lab11;
+ }
+ break lab7;
+ }
+ this.cursor = this.limit - v_3;
+ lab12 = true;
+ lab12:
+ while (lab12 === true) {
+ lab12 = false;
+ if (! (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_14, 4) === 0 ? false : ! this.r_mark_suffix_with_optional_y_consonant$() ? false : true)) {
+ break lab12;
+ }
+ break lab7;
+ }
+ this.cursor = this.limit - v_3;
+ }
+ if (! (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_22, 4) === 0 ? false : ! this.r_mark_suffix_with_optional_y_consonant$() ? false : true)) {
+ break lab6;
+ }
+ break lab0;
+ }
+ this.cursor = this.limit - v_1;
+ lab13 = true;
+ lab13:
+ while (lab13 === true) {
+ lab13 = false;
+ if (! (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_16, 2) === 0 ? false : true)) {
+ break lab13;
+ }
+ this.bra = this.cursor;
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ v_4 = this.limit - this.cursor;
+ lab14 = true;
+ lab14:
+ while (lab14 === true) {
+ lab14 = false;
+ this.ket = this.cursor;
+ lab15 = true;
+ lab15:
+ while (lab15 === true) {
+ lab15 = false;
+ v_5 = this.limit - this.cursor;
+ lab16 = true;
+ lab16:
+ while (lab16 === true) {
+ lab16 = false;
+ if (! (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_18, 8) === 0 ? false : true)) {
+ break lab16;
+ }
+ break lab15;
+ }
+ this.cursor = this.limit - v_5;
+ lab17 = true;
+ lab17:
+ while (lab17 === true) {
+ lab17 = false;
+ if (! (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_20, 32) === 0 ? false : ! this.r_mark_suffix_with_optional_y_consonant$() ? false : true)) {
+ break lab17;
+ }
+ break lab15;
+ }
+ this.cursor = this.limit - v_5;
+ lab18 = true;
+ lab18:
+ while (lab18 === true) {
+ lab18 = false;
+ if (! (this.find_among_b$ALAmong$I(TurkishStemmer.a_21, 8) === 0 ? false : ! this.r_mark_suffix_with_optional_y_consonant$() ? false : true)) {
+ break lab18;
+ }
+ break lab15;
+ }
+ this.cursor = this.limit - v_5;
+ if (! (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_22, 4) === 0 ? false : ! this.r_mark_suffix_with_optional_y_consonant$() ? false : true)) {
+ this.cursor = this.limit - v_4;
+ break lab14;
+ }
+ }
+ }
+ this.B_continue_stemming_noun_suffixes = false;
+ break lab0;
+ }
+ this.cursor = this.limit - v_1;
+ lab19 = true;
+ lab19:
+ while (lab19 === true) {
+ lab19 = false;
+ if (! (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_17, 4) === 0 ? false : true)) {
+ break lab19;
+ }
+ lab20 = true;
+ lab20:
+ while (lab20 === true) {
+ lab20 = false;
+ v_6 = this.limit - this.cursor;
+ lab21 = true;
+ lab21:
+ while (lab21 === true) {
+ lab21 = false;
+ if (! (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_20, 32) === 0 ? false : ! this.r_mark_suffix_with_optional_y_consonant$() ? false : true)) {
+ break lab21;
+ }
+ break lab20;
+ }
+ this.cursor = this.limit - v_6;
+ if (! (this.find_among_b$ALAmong$I(TurkishStemmer.a_21, 8) === 0 ? false : ! this.r_mark_suffix_with_optional_y_consonant$() ? false : true)) {
+ break lab19;
+ }
+ }
+ break lab0;
+ }
+ this.cursor = this.limit - v_1;
+ lab22 = true;
+ lab22:
+ while (lab22 === true) {
+ lab22 = false;
+ lab23 = true;
+ lab23:
+ while (lab23 === true) {
+ lab23 = false;
+ v_7 = this.limit - this.cursor;
+ lab24 = true;
+ lab24:
+ while (lab24 === true) {
+ lab24 = false;
+ if (! (this.find_among_b$ALAmong$I(TurkishStemmer.a_15, 4) === 0 ? false : true)) {
+ break lab24;
+ }
+ break lab23;
+ }
+ this.cursor = this.limit - v_7;
+ lab25 = true;
+ lab25:
+ while (lab25 === true) {
+ lab25 = false;
+ if (! (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_14, 4) === 0 ? false : ! this.r_mark_suffix_with_optional_y_consonant$() ? false : true)) {
+ break lab25;
+ }
+ break lab23;
+ }
+ this.cursor = this.limit - v_7;
+ lab26 = true;
+ lab26:
+ while (lab26 === true) {
+ lab26 = false;
+ if (! (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_13, 4) === 0 ? false : true)) {
+ break lab26;
+ }
+ break lab23;
+ }
+ this.cursor = this.limit - v_7;
+ if (! (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_12, 4) === 0 ? false : ! this.r_mark_suffix_with_optional_y_consonant$() ? false : true)) {
+ break lab22;
+ }
+ }
+ this.bra = this.cursor;
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ v_8 = this.limit - this.cursor;
+ lab27 = true;
+ lab27:
+ while (lab27 === true) {
+ lab27 = false;
+ this.ket = this.cursor;
+ if (! (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_22, 4) === 0 ? false : ! this.r_mark_suffix_with_optional_y_consonant$() ? false : true)) {
+ this.cursor = this.limit - v_8;
+ break lab27;
+ }
+ }
+ break lab0;
+ }
+ this.cursor = this.limit - v_1;
+ if (! (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_18, 8) === 0 ? false : true)) {
+ return false;
+ }
+ this.bra = this.cursor;
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ v_9 = this.limit - this.cursor;
+ lab28 = true;
+ lab28:
+ while (lab28 === true) {
+ lab28 = false;
+ this.ket = this.cursor;
+ lab29 = true;
+ lab29:
+ while (lab29 === true) {
+ lab29 = false;
+ v_10 = this.limit - this.cursor;
+ lab30 = true;
+ lab30:
+ while (lab30 === true) {
+ lab30 = false;
+ if (! (this.find_among_b$ALAmong$I(TurkishStemmer.a_15, 4) === 0 ? false : true)) {
+ break lab30;
+ }
+ break lab29;
+ }
+ this.cursor = this.limit - v_10;
+ lab31 = true;
+ lab31:
+ while (lab31 === true) {
+ lab31 = false;
+ if (! (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_16, 2) === 0 ? false : true)) {
+ break lab31;
+ }
+ break lab29;
+ }
+ this.cursor = this.limit - v_10;
+ lab32 = true;
+ lab32:
+ while (lab32 === true) {
+ lab32 = false;
+ if (! (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_12, 4) === 0 ? false : ! this.r_mark_suffix_with_optional_y_consonant$() ? false : true)) {
+ break lab32;
+ }
+ break lab29;
+ }
+ this.cursor = this.limit - v_10;
+ lab33 = true;
+ lab33:
+ while (lab33 === true) {
+ lab33 = false;
+ if (! (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_13, 4) === 0 ? false : true)) {
+ break lab33;
+ }
+ break lab29;
+ }
+ this.cursor = this.limit - v_10;
+ lab34 = true;
+ lab34:
+ while (lab34 === true) {
+ lab34 = false;
+ if (! (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_14, 4) === 0 ? false : ! this.r_mark_suffix_with_optional_y_consonant$() ? false : true)) {
+ break lab34;
+ }
+ break lab29;
+ }
+ this.cursor = this.limit - v_10;
+ }
+ if (! (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_22, 4) === 0 ? false : ! this.r_mark_suffix_with_optional_y_consonant$() ? false : true)) {
+ this.cursor = this.limit - v_9;
+ break lab28;
+ }
+ }
+ }
+ this.bra = this.cursor;
+ return (! this.slice_from$S("") ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+TurkishStemmer.prototype.r_stem_suffix_chain_before_ki$ = function () {
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var v_3;
+ /** @type {!number} */
+ var v_4;
+ /** @type {!number} */
+ var v_5;
+ /** @type {!number} */
+ var v_6;
+ /** @type {!number} */
+ var v_7;
+ /** @type {!number} */
+ var v_8;
+ /** @type {!number} */
+ var v_9;
+ /** @type {!number} */
+ var v_10;
+ /** @type {!number} */
+ var v_11;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!boolean} */
+ var lab2;
+ /** @type {!boolean} */
+ var lab3;
+ /** @type {!boolean} */
+ var lab4;
+ /** @type {!boolean} */
+ var lab5;
+ /** @type {!boolean} */
+ var lab6;
+ /** @type {!boolean} */
+ var lab7;
+ /** @type {!boolean} */
+ var lab8;
+ /** @type {!boolean} */
+ var lab9;
+ /** @type {!boolean} */
+ var lab10;
+ /** @type {!boolean} */
+ var lab11;
+ /** @type {!boolean} */
+ var lab12;
+ /** @type {!boolean} */
+ var lab13;
+ /** @type {!boolean} */
+ var lab14;
+ /** @type {!boolean} */
+ var lab15;
+ /** @type {!boolean} */
+ var lab16;
+ /** @type {!boolean} */
+ var lab17;
+ /** @type {!boolean} */
+ var lab18;
+ this.ket = this.cursor;
+ if (! (! this.eq_s_b$IS(2, "ki") ? false : true)) {
+ return false;
+ }
+ lab0 = true;
+lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ v_1 = this.limit - this.cursor;
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ if (! (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_6, 4) === 0 ? false : true)) {
+ break lab1;
+ }
+ this.bra = this.cursor;
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ v_2 = this.limit - this.cursor;
+ lab2 = true;
+ lab2:
+ while (lab2 === true) {
+ lab2 = false;
+ this.ket = this.cursor;
+ lab3 = true;
+ lab3:
+ while (lab3 === true) {
+ lab3 = false;
+ v_3 = this.limit - this.cursor;
+ lab4 = true;
+ lab4:
+ while (lab4 === true) {
+ lab4 = false;
+ if (! (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_16, 2) === 0 ? false : true)) {
+ break lab4;
+ }
+ this.bra = this.cursor;
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ v_4 = this.limit - this.cursor;
+ lab5 = true;
+ lab5:
+ while (lab5 === true) {
+ lab5 = false;
+ if (! this.r_stem_suffix_chain_before_ki$()) {
+ this.cursor = this.limit - v_4;
+ break lab5;
+ }
+ }
+ break lab3;
+ }
+ this.cursor = this.limit - v_3;
+ if (! (this.find_among_b$ALAmong$I(TurkishStemmer.a_0, 10) === 0 ? false : ! this.r_mark_suffix_with_optional_U_vowel$() ? false : true)) {
+ this.cursor = this.limit - v_2;
+ break lab2;
+ }
+ this.bra = this.cursor;
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ v_5 = this.limit - this.cursor;
+ lab6 = true;
+ lab6:
+ while (lab6 === true) {
+ lab6 = false;
+ this.ket = this.cursor;
+ if (! (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_16, 2) === 0 ? false : true)) {
+ this.cursor = this.limit - v_5;
+ break lab6;
+ }
+ this.bra = this.cursor;
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ if (! this.r_stem_suffix_chain_before_ki$()) {
+ this.cursor = this.limit - v_5;
+ break lab6;
+ }
+ }
+ }
+ }
+ break lab0;
+ }
+ this.cursor = this.limit - v_1;
+ lab7 = true;
+ lab7:
+ while (lab7 === true) {
+ lab7 = false;
+ if (! (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_3, 4) === 0 ? false : ! this.r_mark_suffix_with_optional_n_consonant$() ? false : true)) {
+ break lab7;
+ }
+ this.bra = this.cursor;
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ v_6 = this.limit - this.cursor;
+ lab8 = true;
+ lab8:
+ while (lab8 === true) {
+ lab8 = false;
+ this.ket = this.cursor;
+ lab9 = true;
+ lab9:
+ while (lab9 === true) {
+ lab9 = false;
+ v_7 = this.limit - this.cursor;
+ lab10 = true;
+ lab10:
+ while (lab10 === true) {
+ lab10 = false;
+ if (! (this.find_among_b$ALAmong$I(TurkishStemmer.a_1, 2) === 0 ? false : true)) {
+ break lab10;
+ }
+ this.bra = this.cursor;
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break lab9;
+ }
+ this.cursor = this.limit - v_7;
+ lab11 = true;
+ lab11:
+ while (lab11 === true) {
+ lab11 = false;
+ this.ket = this.cursor;
+ lab12 = true;
+ lab12:
+ while (lab12 === true) {
+ lab12 = false;
+ v_8 = this.limit - this.cursor;
+ lab13 = true;
+ lab13:
+ while (lab13 === true) {
+ lab13 = false;
+ if (! (this.find_among_b$ALAmong$I(TurkishStemmer.a_0, 10) === 0 ? false : ! this.r_mark_suffix_with_optional_U_vowel$() ? false : true)) {
+ break lab13;
+ }
+ break lab12;
+ }
+ this.cursor = this.limit - v_8;
+ if (! (! this.r_check_vowel_harmony$() ? false : ! this.in_grouping_b$AIII(TurkishStemmer.g_U, 105, 305) ? false : ! this.r_mark_suffix_with_optional_s_consonant$() ? false : true)) {
+ break lab11;
+ }
+ }
+ this.bra = this.cursor;
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ v_9 = this.limit - this.cursor;
+ lab14 = true;
+ lab14:
+ while (lab14 === true) {
+ lab14 = false;
+ this.ket = this.cursor;
+ if (! (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_16, 2) === 0 ? false : true)) {
+ this.cursor = this.limit - v_9;
+ break lab14;
+ }
+ this.bra = this.cursor;
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ if (! this.r_stem_suffix_chain_before_ki$()) {
+ this.cursor = this.limit - v_9;
+ break lab14;
+ }
+ }
+ break lab9;
+ }
+ this.cursor = this.limit - v_7;
+ if (! this.r_stem_suffix_chain_before_ki$()) {
+ this.cursor = this.limit - v_6;
+ break lab8;
+ }
+ }
+ }
+ break lab0;
+ }
+ this.cursor = this.limit - v_1;
+ if (! (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_7, 2) === 0 ? false : true)) {
+ return false;
+ }
+ lab15 = true;
+ lab15:
+ while (lab15 === true) {
+ lab15 = false;
+ v_10 = this.limit - this.cursor;
+ lab16 = true;
+ lab16:
+ while (lab16 === true) {
+ lab16 = false;
+ if (! (this.find_among_b$ALAmong$I(TurkishStemmer.a_1, 2) === 0 ? false : true)) {
+ break lab16;
+ }
+ this.bra = this.cursor;
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break lab15;
+ }
+ this.cursor = this.limit - v_10;
+ lab17 = true;
+ lab17:
+ while (lab17 === true) {
+ lab17 = false;
+ if (! (! this.r_check_vowel_harmony$() ? false : ! this.in_grouping_b$AIII(TurkishStemmer.g_U, 105, 305) ? false : ! this.r_mark_suffix_with_optional_s_consonant$() ? false : true)) {
+ break lab17;
+ }
+ this.bra = this.cursor;
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ v_11 = this.limit - this.cursor;
+ lab18 = true;
+ lab18:
+ while (lab18 === true) {
+ lab18 = false;
+ this.ket = this.cursor;
+ if (! (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_16, 2) === 0 ? false : true)) {
+ this.cursor = this.limit - v_11;
+ break lab18;
+ }
+ this.bra = this.cursor;
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ if (! this.r_stem_suffix_chain_before_ki$()) {
+ this.cursor = this.limit - v_11;
+ break lab18;
+ }
+ }
+ break lab15;
+ }
+ this.cursor = this.limit - v_10;
+ if (! this.r_stem_suffix_chain_before_ki$()) {
+ return false;
+ }
+ }
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+TurkishStemmer.prototype.r_stem_noun_suffixes$ = function () {
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var v_3;
+ /** @type {!number} */
+ var v_4;
+ /** @type {!number} */
+ var v_5;
+ /** @type {!number} */
+ var v_6;
+ /** @type {!number} */
+ var v_7;
+ /** @type {!number} */
+ var v_8;
+ /** @type {!number} */
+ var v_9;
+ /** @type {!number} */
+ var v_10;
+ /** @type {!number} */
+ var v_11;
+ /** @type {!number} */
+ var v_12;
+ /** @type {!number} */
+ var v_13;
+ /** @type {!number} */
+ var v_14;
+ /** @type {!number} */
+ var v_15;
+ /** @type {!number} */
+ var v_16;
+ /** @type {!number} */
+ var v_17;
+ /** @type {!number} */
+ var v_18;
+ /** @type {!number} */
+ var v_19;
+ /** @type {!number} */
+ var v_20;
+ /** @type {!number} */
+ var v_21;
+ /** @type {!number} */
+ var v_22;
+ /** @type {!number} */
+ var v_23;
+ /** @type {!number} */
+ var v_24;
+ /** @type {!number} */
+ var v_25;
+ /** @type {!number} */
+ var v_26;
+ /** @type {!number} */
+ var v_27;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!boolean} */
+ var lab2;
+ /** @type {!boolean} */
+ var lab3;
+ /** @type {!boolean} */
+ var lab4;
+ /** @type {!boolean} */
+ var lab5;
+ /** @type {!boolean} */
+ var lab6;
+ /** @type {!boolean} */
+ var lab7;
+ /** @type {!boolean} */
+ var lab8;
+ /** @type {!boolean} */
+ var lab9;
+ /** @type {!boolean} */
+ var lab10;
+ /** @type {!boolean} */
+ var lab11;
+ /** @type {!boolean} */
+ var lab12;
+ /** @type {!boolean} */
+ var lab13;
+ /** @type {!boolean} */
+ var lab14;
+ /** @type {!boolean} */
+ var lab15;
+ /** @type {!boolean} */
+ var lab16;
+ /** @type {!boolean} */
+ var lab17;
+ /** @type {!boolean} */
+ var lab18;
+ /** @type {!boolean} */
+ var lab19;
+ /** @type {!boolean} */
+ var lab20;
+ /** @type {!boolean} */
+ var lab21;
+ /** @type {!boolean} */
+ var lab22;
+ /** @type {!boolean} */
+ var lab23;
+ /** @type {!boolean} */
+ var lab24;
+ /** @type {!boolean} */
+ var lab25;
+ /** @type {!boolean} */
+ var lab26;
+ /** @type {!boolean} */
+ var lab27;
+ /** @type {!boolean} */
+ var lab28;
+ /** @type {!boolean} */
+ var lab29;
+ /** @type {!boolean} */
+ var lab30;
+ /** @type {!boolean} */
+ var lab31;
+ /** @type {!boolean} */
+ var lab32;
+ /** @type {!boolean} */
+ var lab33;
+ /** @type {!boolean} */
+ var lab34;
+ /** @type {!boolean} */
+ var lab35;
+ /** @type {!boolean} */
+ var lab36;
+ /** @type {!boolean} */
+ var lab37;
+ /** @type {!boolean} */
+ var lab38;
+ /** @type {!boolean} */
+ var lab39;
+ /** @type {!boolean} */
+ var lab40;
+ /** @type {!boolean} */
+ var lab41;
+ /** @type {!boolean} */
+ var lab42;
+ /** @type {!boolean} */
+ var lab43;
+ /** @type {!boolean} */
+ var lab44;
+ /** @type {!boolean} */
+ var lab45;
+ /** @type {!boolean} */
+ var lab46;
+ /** @type {!boolean} */
+ var lab47;
+ /** @type {!boolean} */
+ var lab48;
+ /** @type {!boolean} */
+ var lab49;
+ /** @type {!boolean} */
+ var lab50;
+ /** @type {!boolean} */
+ var lab51;
+ /** @type {!boolean} */
+ var lab52;
+ /** @type {!boolean} */
+ var lab53;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var cursor$1;
+ lab0 = true;
+lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ v_1 = this.limit - this.cursor;
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ this.ket = this.cursor;
+ if (! (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_16, 2) === 0 ? false : true)) {
+ break lab1;
+ }
+ this.bra = this.cursor;
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ v_2 = this.limit - this.cursor;
+ lab2 = true;
+ lab2:
+ while (lab2 === true) {
+ lab2 = false;
+ if (! this.r_stem_suffix_chain_before_ki$()) {
+ this.cursor = this.limit - v_2;
+ break lab2;
+ }
+ }
+ break lab0;
+ }
+ this.cursor = this.limit - v_1;
+ lab3 = true;
+ lab3:
+ while (lab3 === true) {
+ lab3 = false;
+ this.ket = this.cursor;
+ if (! (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_11, 2) === 0 ? false : ! this.r_mark_suffix_with_optional_n_consonant$() ? false : true)) {
+ break lab3;
+ }
+ this.bra = this.cursor;
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ v_3 = this.limit - this.cursor;
+ lab4 = true;
+ lab4:
+ while (lab4 === true) {
+ lab4 = false;
+ lab5 = true;
+ lab5:
+ while (lab5 === true) {
+ lab5 = false;
+ v_4 = this.limit - this.cursor;
+ lab6 = true;
+ lab6:
+ while (lab6 === true) {
+ lab6 = false;
+ this.ket = this.cursor;
+ if (! (this.find_among_b$ALAmong$I(TurkishStemmer.a_1, 2) === 0 ? false : true)) {
+ break lab6;
+ }
+ this.bra = this.cursor;
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break lab5;
+ }
+ this.cursor = this.limit - v_4;
+ lab7 = true;
+ lab7:
+ while (lab7 === true) {
+ lab7 = false;
+ this.ket = this.cursor;
+ lab8 = true;
+ lab8:
+ while (lab8 === true) {
+ lab8 = false;
+ v_5 = this.limit - this.cursor;
+ lab9 = true;
+ lab9:
+ while (lab9 === true) {
+ lab9 = false;
+ if (! (this.find_among_b$ALAmong$I(TurkishStemmer.a_0, 10) === 0 ? false : ! this.r_mark_suffix_with_optional_U_vowel$() ? false : true)) {
+ break lab9;
+ }
+ break lab8;
+ }
+ this.cursor = this.limit - v_5;
+ if (! (! this.r_check_vowel_harmony$() ? false : ! this.in_grouping_b$AIII(TurkishStemmer.g_U, 105, 305) ? false : ! this.r_mark_suffix_with_optional_s_consonant$() ? false : true)) {
+ break lab7;
+ }
+ }
+ this.bra = this.cursor;
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ v_6 = this.limit - this.cursor;
+ lab10 = true;
+ lab10:
+ while (lab10 === true) {
+ lab10 = false;
+ this.ket = this.cursor;
+ if (! (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_16, 2) === 0 ? false : true)) {
+ this.cursor = this.limit - v_6;
+ break lab10;
+ }
+ this.bra = this.cursor;
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ if (! this.r_stem_suffix_chain_before_ki$()) {
+ this.cursor = this.limit - v_6;
+ break lab10;
+ }
+ }
+ break lab5;
+ }
+ cursor$0 = this.cursor = this.limit - v_4;
+ this.ket = cursor$0;
+ if (! (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_16, 2) === 0 ? false : true)) {
+ this.cursor = this.limit - v_3;
+ break lab4;
+ }
+ this.bra = this.cursor;
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ if (! this.r_stem_suffix_chain_before_ki$()) {
+ this.cursor = this.limit - v_3;
+ break lab4;
+ }
+ }
+ }
+ break lab0;
+ }
+ this.cursor = this.limit - v_1;
+ lab11 = true;
+ lab11:
+ while (lab11 === true) {
+ lab11 = false;
+ this.ket = this.cursor;
+ lab12 = true;
+ lab12:
+ while (lab12 === true) {
+ lab12 = false;
+ v_7 = this.limit - this.cursor;
+ lab13 = true;
+ lab13:
+ while (lab13 === true) {
+ lab13 = false;
+ if (! (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_7, 2) === 0 ? false : true)) {
+ break lab13;
+ }
+ break lab12;
+ }
+ this.cursor = this.limit - v_7;
+ if (! (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_5, 2) === 0 ? false : true)) {
+ break lab11;
+ }
+ }
+ lab14 = true;
+ lab14:
+ while (lab14 === true) {
+ lab14 = false;
+ v_8 = this.limit - this.cursor;
+ lab15 = true;
+ lab15:
+ while (lab15 === true) {
+ lab15 = false;
+ if (! (this.find_among_b$ALAmong$I(TurkishStemmer.a_1, 2) === 0 ? false : true)) {
+ break lab15;
+ }
+ this.bra = this.cursor;
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break lab14;
+ }
+ this.cursor = this.limit - v_8;
+ lab16 = true;
+ lab16:
+ while (lab16 === true) {
+ lab16 = false;
+ if (! (! this.r_check_vowel_harmony$() ? false : ! this.in_grouping_b$AIII(TurkishStemmer.g_U, 105, 305) ? false : ! this.r_mark_suffix_with_optional_s_consonant$() ? false : true)) {
+ break lab16;
+ }
+ this.bra = this.cursor;
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ v_9 = this.limit - this.cursor;
+ lab17 = true;
+ lab17:
+ while (lab17 === true) {
+ lab17 = false;
+ this.ket = this.cursor;
+ if (! (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_16, 2) === 0 ? false : true)) {
+ this.cursor = this.limit - v_9;
+ break lab17;
+ }
+ this.bra = this.cursor;
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ if (! this.r_stem_suffix_chain_before_ki$()) {
+ this.cursor = this.limit - v_9;
+ break lab17;
+ }
+ }
+ break lab14;
+ }
+ this.cursor = this.limit - v_8;
+ if (! this.r_stem_suffix_chain_before_ki$()) {
+ break lab11;
+ }
+ }
+ break lab0;
+ }
+ this.cursor = this.limit - v_1;
+ lab18 = true;
+ lab18:
+ while (lab18 === true) {
+ lab18 = false;
+ this.ket = this.cursor;
+ lab19 = true;
+ lab19:
+ while (lab19 === true) {
+ lab19 = false;
+ v_10 = this.limit - this.cursor;
+ lab20 = true;
+ lab20:
+ while (lab20 === true) {
+ lab20 = false;
+ if (! (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_9, 2) === 0 ? false : true)) {
+ break lab20;
+ }
+ break lab19;
+ }
+ this.cursor = this.limit - v_10;
+ if (! (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_2, 4) === 0 ? false : true)) {
+ break lab18;
+ }
+ }
+ lab21 = true;
+ lab21:
+ while (lab21 === true) {
+ lab21 = false;
+ v_11 = this.limit - this.cursor;
+ lab22 = true;
+ lab22:
+ while (lab22 === true) {
+ lab22 = false;
+ if (! (! this.r_check_vowel_harmony$() ? false : ! this.in_grouping_b$AIII(TurkishStemmer.g_U, 105, 305) ? false : ! this.r_mark_suffix_with_optional_s_consonant$() ? false : true)) {
+ break lab22;
+ }
+ this.bra = this.cursor;
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ v_12 = this.limit - this.cursor;
+ lab23 = true;
+ lab23:
+ while (lab23 === true) {
+ lab23 = false;
+ this.ket = this.cursor;
+ if (! (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_16, 2) === 0 ? false : true)) {
+ this.cursor = this.limit - v_12;
+ break lab23;
+ }
+ this.bra = this.cursor;
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ if (! this.r_stem_suffix_chain_before_ki$()) {
+ this.cursor = this.limit - v_12;
+ break lab23;
+ }
+ }
+ break lab21;
+ }
+ this.cursor = this.limit - v_11;
+ if (! (this.find_among_b$ALAmong$I(TurkishStemmer.a_1, 2) === 0 ? false : true)) {
+ break lab18;
+ }
+ }
+ break lab0;
+ }
+ this.cursor = this.limit - v_1;
+ lab24 = true;
+ lab24:
+ while (lab24 === true) {
+ lab24 = false;
+ this.ket = this.cursor;
+ if (! (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_8, 4) === 0 ? false : true)) {
+ break lab24;
+ }
+ this.bra = this.cursor;
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ v_13 = this.limit - this.cursor;
+ lab25 = true;
+ lab25:
+ while (lab25 === true) {
+ lab25 = false;
+ this.ket = this.cursor;
+ lab26 = true;
+ lab26:
+ while (lab26 === true) {
+ lab26 = false;
+ v_14 = this.limit - this.cursor;
+ lab27 = true;
+ lab27:
+ while (lab27 === true) {
+ lab27 = false;
+ if (! (this.find_among_b$ALAmong$I(TurkishStemmer.a_0, 10) === 0 ? false : ! this.r_mark_suffix_with_optional_U_vowel$() ? false : true)) {
+ break lab27;
+ }
+ this.bra = this.cursor;
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ v_15 = this.limit - this.cursor;
+ lab28 = true;
+ lab28:
+ while (lab28 === true) {
+ lab28 = false;
+ this.ket = this.cursor;
+ if (! (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_16, 2) === 0 ? false : true)) {
+ this.cursor = this.limit - v_15;
+ break lab28;
+ }
+ this.bra = this.cursor;
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ if (! this.r_stem_suffix_chain_before_ki$()) {
+ this.cursor = this.limit - v_15;
+ break lab28;
+ }
+ }
+ break lab26;
+ }
+ this.cursor = this.limit - v_14;
+ lab29 = true;
+ lab29:
+ while (lab29 === true) {
+ lab29 = false;
+ if (! (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_16, 2) === 0 ? false : true)) {
+ break lab29;
+ }
+ this.bra = this.cursor;
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ v_16 = this.limit - this.cursor;
+ lab30 = true;
+ lab30:
+ while (lab30 === true) {
+ lab30 = false;
+ if (! this.r_stem_suffix_chain_before_ki$()) {
+ this.cursor = this.limit - v_16;
+ break lab30;
+ }
+ }
+ break lab26;
+ }
+ this.cursor = this.limit - v_14;
+ if (! this.r_stem_suffix_chain_before_ki$()) {
+ this.cursor = this.limit - v_13;
+ break lab25;
+ }
+ }
+ }
+ break lab0;
+ }
+ this.cursor = this.limit - v_1;
+ lab31 = true;
+ lab31:
+ while (lab31 === true) {
+ lab31 = false;
+ this.ket = this.cursor;
+ lab32 = true;
+ lab32:
+ while (lab32 === true) {
+ lab32 = false;
+ v_17 = this.limit - this.cursor;
+ lab33 = true;
+ lab33:
+ while (lab33 === true) {
+ lab33 = false;
+ if (! (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_3, 4) === 0 ? false : ! this.r_mark_suffix_with_optional_n_consonant$() ? false : true)) {
+ break lab33;
+ }
+ break lab32;
+ }
+ this.cursor = this.limit - v_17;
+ if (! (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_10, 2) === 0 ? false : ! this.r_mark_suffix_with_optional_y_consonant$() ? false : true)) {
+ break lab31;
+ }
+ }
+ this.bra = this.cursor;
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ v_18 = this.limit - this.cursor;
+ lab34 = true;
+ lab34:
+ while (lab34 === true) {
+ lab34 = false;
+ lab35 = true;
+ lab35:
+ while (lab35 === true) {
+ lab35 = false;
+ v_19 = this.limit - this.cursor;
+ lab36 = true;
+ lab36:
+ while (lab36 === true) {
+ lab36 = false;
+ this.ket = this.cursor;
+ if (! (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_16, 2) === 0 ? false : true)) {
+ break lab36;
+ }
+ this.bra = this.cursor;
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ if (! this.r_stem_suffix_chain_before_ki$()) {
+ break lab36;
+ }
+ break lab35;
+ }
+ this.cursor = this.limit - v_19;
+ lab37 = true;
+ lab37:
+ while (lab37 === true) {
+ lab37 = false;
+ this.ket = this.cursor;
+ lab38 = true;
+ lab38:
+ while (lab38 === true) {
+ lab38 = false;
+ v_20 = this.limit - this.cursor;
+ lab39 = true;
+ lab39:
+ while (lab39 === true) {
+ lab39 = false;
+ if (! (this.find_among_b$ALAmong$I(TurkishStemmer.a_0, 10) === 0 ? false : ! this.r_mark_suffix_with_optional_U_vowel$() ? false : true)) {
+ break lab39;
+ }
+ break lab38;
+ }
+ this.cursor = this.limit - v_20;
+ if (! (! this.r_check_vowel_harmony$() ? false : ! this.in_grouping_b$AIII(TurkishStemmer.g_U, 105, 305) ? false : ! this.r_mark_suffix_with_optional_s_consonant$() ? false : true)) {
+ break lab37;
+ }
+ }
+ this.bra = this.cursor;
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ v_21 = this.limit - this.cursor;
+ lab40 = true;
+ lab40:
+ while (lab40 === true) {
+ lab40 = false;
+ this.ket = this.cursor;
+ if (! (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_16, 2) === 0 ? false : true)) {
+ this.cursor = this.limit - v_21;
+ break lab40;
+ }
+ this.bra = this.cursor;
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ if (! this.r_stem_suffix_chain_before_ki$()) {
+ this.cursor = this.limit - v_21;
+ break lab40;
+ }
+ }
+ break lab35;
+ }
+ this.cursor = this.limit - v_19;
+ if (! this.r_stem_suffix_chain_before_ki$()) {
+ this.cursor = this.limit - v_18;
+ break lab34;
+ }
+ }
+ }
+ break lab0;
+ }
+ this.cursor = this.limit - v_1;
+ lab41 = true;
+ lab41:
+ while (lab41 === true) {
+ lab41 = false;
+ this.ket = this.cursor;
+ if (! (this.find_among_b$ALAmong$I(TurkishStemmer.a_1, 2) === 0 ? false : true)) {
+ break lab41;
+ }
+ this.bra = this.cursor;
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break lab0;
+ }
+ this.cursor = this.limit - v_1;
+ lab42 = true;
+ lab42:
+ while (lab42 === true) {
+ lab42 = false;
+ if (! this.r_stem_suffix_chain_before_ki$()) {
+ break lab42;
+ }
+ break lab0;
+ }
+ this.cursor = this.limit - v_1;
+ lab43 = true;
+ lab43:
+ while (lab43 === true) {
+ lab43 = false;
+ this.ket = this.cursor;
+ lab44 = true;
+ lab44:
+ while (lab44 === true) {
+ lab44 = false;
+ v_22 = this.limit - this.cursor;
+ lab45 = true;
+ lab45:
+ while (lab45 === true) {
+ lab45 = false;
+ if (! (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_6, 4) === 0 ? false : true)) {
+ break lab45;
+ }
+ break lab44;
+ }
+ this.cursor = this.limit - v_22;
+ lab46 = true;
+ lab46:
+ while (lab46 === true) {
+ lab46 = false;
+ if (! (! this.r_check_vowel_harmony$() ? false : ! this.in_grouping_b$AIII(TurkishStemmer.g_U, 105, 305) ? false : ! this.r_mark_suffix_with_optional_y_consonant$() ? false : true)) {
+ break lab46;
+ }
+ break lab44;
+ }
+ this.cursor = this.limit - v_22;
+ if (! (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_4, 2) === 0 ? false : ! this.r_mark_suffix_with_optional_y_consonant$() ? false : true)) {
+ break lab43;
+ }
+ }
+ this.bra = this.cursor;
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ v_23 = this.limit - this.cursor;
+ lab47 = true;
+ lab47:
+ while (lab47 === true) {
+ lab47 = false;
+ this.ket = this.cursor;
+ lab48 = true;
+ lab48:
+ while (lab48 === true) {
+ lab48 = false;
+ v_24 = this.limit - this.cursor;
+ lab49 = true;
+ lab49:
+ while (lab49 === true) {
+ lab49 = false;
+ if (! (this.find_among_b$ALAmong$I(TurkishStemmer.a_0, 10) === 0 ? false : ! this.r_mark_suffix_with_optional_U_vowel$() ? false : true)) {
+ break lab49;
+ }
+ this.bra = this.cursor;
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ v_25 = this.limit - this.cursor;
+ lab50 = true;
+ lab50:
+ while (lab50 === true) {
+ lab50 = false;
+ this.ket = this.cursor;
+ if (! (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_16, 2) === 0 ? false : true)) {
+ this.cursor = this.limit - v_25;
+ break lab50;
+ }
+ }
+ break lab48;
+ }
+ this.cursor = this.limit - v_24;
+ if (! (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_16, 2) === 0 ? false : true)) {
+ this.cursor = this.limit - v_23;
+ break lab47;
+ }
+ }
+ this.bra = this.cursor;
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ this.ket = this.cursor;
+ if (! this.r_stem_suffix_chain_before_ki$()) {
+ this.cursor = this.limit - v_23;
+ break lab47;
+ }
+ }
+ break lab0;
+ }
+ cursor$1 = this.cursor = this.limit - v_1;
+ this.ket = cursor$1;
+ lab51 = true;
+ lab51:
+ while (lab51 === true) {
+ lab51 = false;
+ v_26 = this.limit - this.cursor;
+ lab52 = true;
+ lab52:
+ while (lab52 === true) {
+ lab52 = false;
+ if (! (this.find_among_b$ALAmong$I(TurkishStemmer.a_0, 10) === 0 ? false : ! this.r_mark_suffix_with_optional_U_vowel$() ? false : true)) {
+ break lab52;
+ }
+ break lab51;
+ }
+ this.cursor = this.limit - v_26;
+ if (! (! this.r_check_vowel_harmony$() ? false : ! this.in_grouping_b$AIII(TurkishStemmer.g_U, 105, 305) ? false : ! this.r_mark_suffix_with_optional_s_consonant$() ? false : true)) {
+ return false;
+ }
+ }
+ this.bra = this.cursor;
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ v_27 = this.limit - this.cursor;
+ lab53 = true;
+ lab53:
+ while (lab53 === true) {
+ lab53 = false;
+ this.ket = this.cursor;
+ if (! (! this.r_check_vowel_harmony$() ? false : this.find_among_b$ALAmong$I(TurkishStemmer.a_16, 2) === 0 ? false : true)) {
+ this.cursor = this.limit - v_27;
+ break lab53;
+ }
+ this.bra = this.cursor;
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ if (! this.r_stem_suffix_chain_before_ki$()) {
+ this.cursor = this.limit - v_27;
+ break lab53;
+ }
+ }
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+TurkishStemmer.prototype.r_post_process_last_consonants$ = function () {
+ /** @type {!number} */
+ var among_var;
+ this.ket = this.cursor;
+ among_var = this.find_among_b$ALAmong$I(TurkishStemmer.a_23, 4);
+ if (among_var === 0) {
+ return false;
+ }
+ this.bra = this.cursor;
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ if (! this.slice_from$S("p")) {
+ return false;
+ }
+ break;
+ case 2:
+ if (! this.slice_from$S("\u00E7")) {
+ return false;
+ }
+ break;
+ case 3:
+ if (! this.slice_from$S("t")) {
+ return false;
+ }
+ break;
+ case 4:
+ if (! this.slice_from$S("k")) {
+ return false;
+ }
+ break;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+TurkishStemmer.prototype.r_append_U_to_stems_ending_with_d_or_g$ = function () {
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var v_3;
+ /** @type {!number} */
+ var v_4;
+ /** @type {!number} */
+ var v_5;
+ /** @type {!number} */
+ var v_6;
+ /** @type {!number} */
+ var v_7;
+ /** @type {!number} */
+ var v_8;
+ /** @type {!number} */
+ var v_9;
+ /** @type {!number} */
+ var v_10;
+ /** @type {!number} */
+ var v_11;
+ /** @type {!number} */
+ var v_12;
+ /** @type {!number} */
+ var v_13;
+ /** @type {!number} */
+ var v_14;
+ /** @type {!number} */
+ var v_15;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!boolean} */
+ var lab2;
+ /** @type {!boolean} */
+ var lab3;
+ /** @type {!boolean} */
+ var lab5;
+ /** @type {!boolean} */
+ var lab6;
+ /** @type {!boolean} */
+ var lab7;
+ /** @type {!boolean} */
+ var lab8;
+ /** @type {!boolean} */
+ var lab10;
+ /** @type {!boolean} */
+ var lab11;
+ /** @type {!boolean} */
+ var lab12;
+ /** @type {!boolean} */
+ var lab13;
+ /** @type {!boolean} */
+ var lab15;
+ /** @type {!boolean} */
+ var lab16;
+ /** @type {!boolean} */
+ var lab17;
+ /** @type {!boolean} */
+ var lab19;
+ /** @type {!boolean} */
+ var lab20;
+ /** @type {!boolean} */
+ var lab21;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var cursor$1;
+ /** @type {!number} */
+ var cursor$2;
+ /** @type {!number} */
+ var cursor$3;
+ /** @type {!number} */
+ var cursor$4;
+ /** @type {!number} */
+ var cursor$5;
+ /** @type {!number} */
+ var cursor$6;
+ /** @type {!number} */
+ var limit$0;
+ /** @type {!number} */
+ var cursor$7;
+ /** @type {!number} */
+ var cursor$8;
+ v_1 = this.limit - this.cursor;
+ lab0 = true;
+lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ v_2 = this.limit - this.cursor;
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ if (! this.eq_s_b$IS(1, "d")) {
+ break lab1;
+ }
+ break lab0;
+ }
+ this.cursor = this.limit - v_2;
+ if (! this.eq_s_b$IS(1, "g")) {
+ return false;
+ }
+ }
+ this.cursor = this.limit - v_1;
+ lab2 = true;
+lab2:
+ while (lab2 === true) {
+ lab2 = false;
+ v_3 = this.limit - this.cursor;
+ lab3 = true;
+ lab3:
+ while (lab3 === true) {
+ lab3 = false;
+ v_4 = this.limit - this.cursor;
+ golab4:
+ while (true) {
+ v_5 = this.limit - this.cursor;
+ lab5 = true;
+ lab5:
+ while (lab5 === true) {
+ lab5 = false;
+ if (! this.in_grouping_b$AIII(TurkishStemmer.g_vowel, 97, 305)) {
+ break lab5;
+ }
+ this.cursor = this.limit - v_5;
+ break golab4;
+ }
+ cursor$0 = this.cursor = this.limit - v_5;
+ if (cursor$0 <= this.limit_backward) {
+ break lab3;
+ }
+ this.cursor--;
+ }
+ lab6 = true;
+ lab6:
+ while (lab6 === true) {
+ lab6 = false;
+ v_6 = this.limit - this.cursor;
+ lab7 = true;
+ lab7:
+ while (lab7 === true) {
+ lab7 = false;
+ if (! this.eq_s_b$IS(1, "a")) {
+ break lab7;
+ }
+ break lab6;
+ }
+ this.cursor = this.limit - v_6;
+ if (! this.eq_s_b$IS(1, "\u0131")) {
+ break lab3;
+ }
+ }
+ cursor$1 = this.cursor = this.limit - v_4;
+ this.insert$IIS(cursor$1, cursor$1, "\u0131");
+ this.cursor = cursor$1;
+ break lab2;
+ }
+ this.cursor = this.limit - v_3;
+ lab8 = true;
+ lab8:
+ while (lab8 === true) {
+ lab8 = false;
+ v_7 = this.limit - this.cursor;
+ golab9:
+ while (true) {
+ v_8 = this.limit - this.cursor;
+ lab10 = true;
+ lab10:
+ while (lab10 === true) {
+ lab10 = false;
+ if (! this.in_grouping_b$AIII(TurkishStemmer.g_vowel, 97, 305)) {
+ break lab10;
+ }
+ this.cursor = this.limit - v_8;
+ break golab9;
+ }
+ cursor$2 = this.cursor = this.limit - v_8;
+ if (cursor$2 <= this.limit_backward) {
+ break lab8;
+ }
+ this.cursor--;
+ }
+ lab11 = true;
+ lab11:
+ while (lab11 === true) {
+ lab11 = false;
+ v_9 = this.limit - this.cursor;
+ lab12 = true;
+ lab12:
+ while (lab12 === true) {
+ lab12 = false;
+ if (! this.eq_s_b$IS(1, "e")) {
+ break lab12;
+ }
+ break lab11;
+ }
+ this.cursor = this.limit - v_9;
+ if (! this.eq_s_b$IS(1, "i")) {
+ break lab8;
+ }
+ }
+ cursor$3 = this.cursor = this.limit - v_7;
+ this.insert$IIS(cursor$3, cursor$3, "i");
+ this.cursor = cursor$3;
+ break lab2;
+ }
+ this.cursor = this.limit - v_3;
+ lab13 = true;
+ lab13:
+ while (lab13 === true) {
+ lab13 = false;
+ v_10 = this.limit - this.cursor;
+ golab14:
+ while (true) {
+ v_11 = this.limit - this.cursor;
+ lab15 = true;
+ lab15:
+ while (lab15 === true) {
+ lab15 = false;
+ if (! this.in_grouping_b$AIII(TurkishStemmer.g_vowel, 97, 305)) {
+ break lab15;
+ }
+ this.cursor = this.limit - v_11;
+ break golab14;
+ }
+ cursor$4 = this.cursor = this.limit - v_11;
+ if (cursor$4 <= this.limit_backward) {
+ break lab13;
+ }
+ this.cursor--;
+ }
+ lab16 = true;
+ lab16:
+ while (lab16 === true) {
+ lab16 = false;
+ v_12 = this.limit - this.cursor;
+ lab17 = true;
+ lab17:
+ while (lab17 === true) {
+ lab17 = false;
+ if (! this.eq_s_b$IS(1, "o")) {
+ break lab17;
+ }
+ break lab16;
+ }
+ this.cursor = this.limit - v_12;
+ if (! this.eq_s_b$IS(1, "u")) {
+ break lab13;
+ }
+ }
+ cursor$5 = this.cursor = this.limit - v_10;
+ this.insert$IIS(cursor$5, cursor$5, "u");
+ this.cursor = cursor$5;
+ break lab2;
+ }
+ cursor$7 = this.cursor = (limit$0 = this.limit) - v_3;
+ v_13 = limit$0 - cursor$7;
+ golab18:
+ while (true) {
+ v_14 = this.limit - this.cursor;
+ lab19 = true;
+ lab19:
+ while (lab19 === true) {
+ lab19 = false;
+ if (! this.in_grouping_b$AIII(TurkishStemmer.g_vowel, 97, 305)) {
+ break lab19;
+ }
+ this.cursor = this.limit - v_14;
+ break golab18;
+ }
+ cursor$6 = this.cursor = this.limit - v_14;
+ if (cursor$6 <= this.limit_backward) {
+ return false;
+ }
+ this.cursor--;
+ }
+ lab20 = true;
+ lab20:
+ while (lab20 === true) {
+ lab20 = false;
+ v_15 = this.limit - this.cursor;
+ lab21 = true;
+ lab21:
+ while (lab21 === true) {
+ lab21 = false;
+ if (! this.eq_s_b$IS(1, "\u00F6")) {
+ break lab21;
+ }
+ break lab20;
+ }
+ this.cursor = this.limit - v_15;
+ if (! this.eq_s_b$IS(1, "\u00FC")) {
+ return false;
+ }
+ }
+ cursor$8 = this.cursor = this.limit - v_13;
+ this.insert$IIS(cursor$8, cursor$8, "\u00FC");
+ this.cursor = cursor$8;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+TurkishStemmer.prototype.r_more_than_one_syllable_word$ = function () {
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_3;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!boolean} */
+ var lab3;
+ v_1 = this.cursor;
+ v_2 = 2;
+replab0:
+ while (true) {
+ v_3 = this.cursor;
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ golab2:
+ while (true) {
+ lab3 = true;
+ lab3:
+ while (lab3 === true) {
+ lab3 = false;
+ if (! this.in_grouping$AIII(TurkishStemmer.g_vowel, 97, 305)) {
+ break lab3;
+ }
+ break golab2;
+ }
+ if (this.cursor >= this.limit) {
+ break lab1;
+ }
+ this.cursor++;
+ }
+ v_2--;
+ continue replab0;
+ }
+ this.cursor = v_3;
+ break replab0;
+ }
+ if (v_2 > 0) {
+ return false;
+ }
+ this.cursor = v_1;
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+TurkishStemmer.prototype.r_is_reserved_word$ = function () {
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var v_4;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!boolean} */
+ var lab3;
+ /** @type {!boolean} */
+ var lab5;
+ /** @type {!number} */
+ var I_strlen$0;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var I_strlen$1;
+ lab0 = true;
+lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ v_1 = this.cursor;
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ v_2 = this.cursor;
+ golab2:
+ while (true) {
+ lab3 = true;
+ lab3:
+ while (lab3 === true) {
+ lab3 = false;
+ if (! this.eq_s$IS(2, "ad")) {
+ break lab3;
+ }
+ break golab2;
+ }
+ if (this.cursor >= this.limit) {
+ break lab1;
+ }
+ this.cursor++;
+ }
+ I_strlen$0 = this.I_strlen = 2;
+ if (! (I_strlen$0 === this.limit)) {
+ break lab1;
+ }
+ this.cursor = v_2;
+ break lab0;
+ }
+ cursor$0 = this.cursor = v_1;
+ v_4 = cursor$0;
+ golab4:
+ while (true) {
+ lab5 = true;
+ lab5:
+ while (lab5 === true) {
+ lab5 = false;
+ if (! this.eq_s$IS(5, "soyad")) {
+ break lab5;
+ }
+ break golab4;
+ }
+ if (this.cursor >= this.limit) {
+ return false;
+ }
+ this.cursor++;
+ }
+ I_strlen$1 = this.I_strlen = 5;
+ if (! (I_strlen$1 === this.limit)) {
+ return false;
+ }
+ this.cursor = v_4;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+TurkishStemmer.prototype.r_postlude$ = function () {
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!boolean} */
+ var lab2;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var limit$0;
+ /** @type {!number} */
+ var cursor$1;
+ v_1 = this.cursor;
+ lab0 = true;
+lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ if (! this.r_is_reserved_word$()) {
+ break lab0;
+ }
+ return false;
+ }
+ cursor$0 = this.cursor = v_1;
+ this.limit_backward = cursor$0;
+ cursor$1 = this.cursor = limit$0 = this.limit;
+ v_2 = limit$0 - cursor$1;
+ lab1 = true;
+lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ if (! this.r_append_U_to_stems_ending_with_d_or_g$()) {
+ break lab1;
+ }
+ }
+ this.cursor = this.limit - v_2;
+ lab2 = true;
+lab2:
+ while (lab2 === true) {
+ lab2 = false;
+ if (! this.r_post_process_last_consonants$()) {
+ break lab2;
+ }
+ }
+ this.cursor = this.limit_backward;
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+TurkishStemmer.prototype.stem$ = function () {
+ /** @type {!number} */
+ var v_1;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!number} */
+ var limit$0;
+ /** @type {!number} */
+ var cursor$0;
+ if (! this.r_more_than_one_syllable_word$()) {
+ return false;
+ }
+ this.limit_backward = this.cursor;
+ cursor$0 = this.cursor = limit$0 = this.limit;
+ v_1 = limit$0 - cursor$0;
+ lab0 = true;
+lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ if (! this.r_stem_nominal_verb_suffixes$()) {
+ break lab0;
+ }
+ }
+ this.cursor = this.limit - v_1;
+ if (! this.B_continue_stemming_noun_suffixes) {
+ return false;
+ }
+ lab1 = true;
+lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ if (! this.r_stem_noun_suffixes$()) {
+ break lab1;
+ }
+ }
+ this.cursor = this.limit_backward;
+ return (! this.r_postlude$() ? false : true);
+};
+
+/**
+ * @param {*} o
+ * @return {!boolean}
+ */
+TurkishStemmer.prototype.equals$X = function (o) {
+ return o instanceof TurkishStemmer;
+};
+
+/**
+ * @return {!number}
+ */
+TurkishStemmer.prototype.hashCode$ = function () {
+ /** @type {!string} */
+ var classname;
+ /** @type {!number} */
+ var hash;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var char;
+ classname = "TurkishStemmer";
+ hash = 0;
+ if ("TurkishStemmer".length === 0) {
+ return (hash | 0);
+ }
+ for (i = 0; i < classname.length; i++) {
+ char = classname.charCodeAt(i);
+ hash = (hash << 5) - hash + char;
+ hash = hash & hash;
+ }
+ return (hash | 0);
+};
+
+/**
+ * class Among extends Object
+ * @constructor
+ */
+function Among() {
+}
+
+/**
+ * @constructor
+ * @param {!string} s
+ * @param {!number} substring_i
+ * @param {!number} result
+ */
+function Among$SII(s, substring_i, result) {
+ this.s_size = s.length;
+ this.s = s;
+ this.substring_i = substring_i;
+ this.result = result;
+ this.method = null;
+ this.instance = null;
+};
+
+Among$SII.prototype = new Among;
+
+/**
+ * @constructor
+ * @param {!string} s
+ * @param {!number} substring_i
+ * @param {!number} result
+ * @param {*} method
+ * @param {BaseStemmer} instance
+ */
+function Among$SIIF$LBaseStemmer$B$LBaseStemmer$(s, substring_i, result, method, instance) {
+ this.s_size = s.length;
+ this.s = s;
+ this.substring_i = substring_i;
+ this.result = result;
+ this.method = method;
+ this.instance = instance;
+};
+
+Among$SIIF$LBaseStemmer$B$LBaseStemmer$.prototype = new Among;
+
+/**
+ * class Metadata extends Object
+ * @constructor
+ */
+function Metadata() {
+}
+
+/**
+ * @constructor
+ * @param {Oktavia} parent
+ */
+function Metadata$LOktavia$(parent) {
+ this._parent = parent;
+ this._bitVector = new BitVector$();
+};
+
+Metadata$LOktavia$.prototype = new Metadata;
+
+/**
+ * @return {!number}
+ */
+Metadata.prototype._size$ = function () {
+ /** @type {BitVector} */
+ var this$0;
+ /** @type {!number} */
+ var i$0;
+ /** @type {BitVector} */
+ var _bitVector$0;
+ this$0 = _bitVector$0 = this._bitVector;
+ i$0 = _bitVector$0._size;
+ return this$0.rank$IB(i$0, true);
+};
+
+/**
+ * @param {!number} index
+ * @return {!string}
+ */
+Metadata.prototype.getContent$I = function (index) {
+ /** @type {!number} */
+ var startPosition;
+ /** @type {!number} */
+ var length;
+ if (index < 0 || this._size$() <= index) {
+ throw new Error("Section.getContent() : range error " + (index + ""));
+ }
+ startPosition = 0;
+ if (index > 0) {
+ startPosition = this._bitVector.select$I(index - 1) + 1;
+ }
+ length = this._bitVector.select$I(index) - startPosition + 1;
+ return this._parent._getSubstring$II(startPosition, length);
+};
+
+/**
+ * @param {!number} index
+ * @return {!number}
+ */
+Metadata.prototype.getStartPosition$I = function (index) {
+ /** @type {!number} */
+ var startPosition;
+ if (index < 0 || this._size$() <= index) {
+ throw new Error("Section.getContent() : range error " + (index + ""));
+ }
+ startPosition = 0;
+ if (index > 0) {
+ startPosition = this._bitVector.select$I(index - 1) + 1;
+ }
+ return (startPosition | 0);
+};
+
+/**
+ * @param {SingleResult} result
+ * @param {Array.<undefined|!number>} positions
+ * @param {!string} word
+ * @param {!boolean} stemmed
+ */
+Metadata.prototype.grouping$LSingleResult$AISB = function (result, positions, word, stemmed) {
+};
+
+/**
+ * @param {!number} index
+ * @return {!string}
+ */
+Metadata.prototype.getInformation$I = function (index) {
+ return '';
+};
+
+/**
+ */
+Metadata.prototype._build$ = function () {
+ this._bitVector.build$();
+};
+
+/**
+ * @param {!string} name
+ * @param {!string} data
+ * @param {!number} offset
+ * @return {!number}
+ */
+Metadata.prototype._load$SSI = function (name, data, offset) {
+ offset = this._bitVector.load$SI(data, offset);
+ this._parent._metadataLabels.push(name);
+ this._parent._metadatas[name] = this;
+ return offset;
+};
+
+/**
+ * @return {!string}
+ */
+Metadata.prototype._dump$ = function () {
+ /** @type {BitVector} */
+ var this$0;
+ /** @type {Array.<undefined|!string>} */
+ var contents$0;
+ this$0 = this._bitVector;
+ contents$0 = [ ];
+ contents$0.push(Binary$dump32bitNumber$N(this$0._size));
+ contents$0.push(Binary$dump32bitNumberList$AN(this$0._v));
+ return contents$0.join('');
+};
+
+/**
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+Metadata.prototype._dump$LCompressionReport$ = function (report) {
+ /** @type {BitVector} */
+ var this$0;
+ /** @type {Array.<undefined|!string>} */
+ var contents$0;
+ this$0 = this._bitVector;
+ contents$0 = [ ];
+ contents$0.push(Binary$dump32bitNumber$N(this$0._size));
+ CompressionReport$add$LCompressionReport$II(report, 2, 2);
+ contents$0.push(Binary$dump32bitNumberList$ANLCompressionReport$(this$0._v, report));
+ return contents$0.join('');
+};
+
+/**
+ * class Section extends Metadata
+ * @constructor
+ */
+function Section() {
+}
+
+Section.prototype = new Metadata;
+/**
+ * @constructor
+ * @param {Oktavia} parent
+ */
+function Section$LOktavia$(parent) {
+ this._parent = parent;
+ this._bitVector = new BitVector$();
+ this._names = [ ];
+};
+
+Section$LOktavia$.prototype = new Section;
+
+/**
+ * @param {!string} name
+ */
+Section.prototype.setTail$S = function (name) {
+ /** @type {!number} */
+ var index$0;
+ /** @type {Oktavia} */
+ var this$0;
+ /** @type {FMIndex} */
+ var this$0$0;
+ this$0 = this._parent;
+ this$0$0 = this$0._fmindex;
+ index$0 = this$0$0._substr.length;
+ this._names.push(name);
+ this._bitVector.set$I(index$0 - 1);
+};
+
+/**
+ * @param {!string} name
+ * @param {!number} index
+ */
+Section.prototype.setTail$SI = function (name, index) {
+ this._names.push(name);
+ this._bitVector.set$I(index - 1);
+};
+
+/**
+ * @return {!number}
+ */
+Section.prototype.size$ = function () {
+ return (this._names.length | 0);
+};
+
+/**
+ * @param {!number} position
+ * @return {!number}
+ */
+Section.prototype.getSectionIndex$I = function (position) {
+ /** @type {BitVector} */
+ var this$0;
+ if (position < 0 || this._bitVector.size$() <= position) {
+ throw new Error("Section.getSectionIndex() : range error " + (position + ""));
+ }
+ this$0 = this._bitVector;
+ return this$0.rank$IB(position, true);
+};
+
+/**
+ * @param {!number} index
+ * @return {!string}
+ */
+Section.prototype.getName$I = function (index) {
+ if (index < 0 || this._names.length <= index) {
+ throw new Error("Section.getName() : range error");
+ }
+ return this._names[index];
+};
+
+/**
+ * @param {SingleResult} result
+ * @param {Array.<undefined|!number>} positions
+ * @param {!string} word
+ * @param {!boolean} stemmed
+ */
+Section.prototype.grouping$LSingleResult$AISB = function (result, positions, word, stemmed) {
+ /** @type {!number} */
+ var i;
+ /** @type {undefined|!number} */
+ var position;
+ /** @type {!number} */
+ var index;
+ /** @type {SearchUnit} */
+ var unit;
+ for (i = 0; i < positions.length; i++) {
+ position = positions[i];
+ index = this.getSectionIndex$I(position);
+ unit = SingleResult$getSearchUnit$LSingleResult$I(result, index);
+ if (unit.startPosition < 0) {
+ unit.startPosition = this.getStartPosition$I(index);
+ }
+ SearchUnit$addPosition$LSearchUnit$SIB(unit, word, position - unit.startPosition, stemmed);
+ }
+};
+
+/**
+ * @param {!number} index
+ * @return {!string}
+ */
+Section.prototype.getInformation$I = function (index) {
+ return this.getName$I(index);
+};
+
+/**
+ * @param {Oktavia} parent
+ * @param {!string} name
+ * @param {!string} data
+ * @param {!number} offset
+ * @return {!number}
+ */
+Section._load$LOktavia$SSI = function (parent, name, data, offset) {
+ /** @type {LoadedStringListResult} */
+ var strs;
+ /** @type {Section} */
+ var section;
+ /** @type {!number} */
+ var offset$0;
+ strs = new LoadedStringListResult$SI(data, offset);
+ section = new Section$LOktavia$(parent);
+ section._names = strs.result;
+ offset$0 = strs.offset;
+ offset$0 = section._bitVector.load$SI(data, offset$0);
+ section._parent._metadataLabels.push(name);
+ section._parent._metadatas[name] = section;
+ return offset$0;
+};
+
+var Section$_load$LOktavia$SSI = Section._load$LOktavia$SSI;
+
+/**
+ * @return {!string}
+ */
+Section.prototype._dump$ = function () {
+ return [ Binary$dump16bitNumber$I(0), Binary$dumpStringList$AS(this._names), Metadata.prototype._dump$.call(this) ].join('');
+};
+
+/**
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+Section.prototype._dump$LCompressionReport$ = function (report) {
+ CompressionReport$add$LCompressionReport$II(report, 1, 1);
+ return [ Binary$dump16bitNumber$I(0), Binary$dumpStringList$ASLCompressionReport$(this._names, report), Metadata.prototype._dump$LCompressionReport$.call(this, report) ].join('');
+};
+
+/**
+ * class Splitter extends Metadata
+ * @constructor
+ */
+function Splitter() {
+}
+
+Splitter.prototype = new Metadata;
+/**
+ * @constructor
+ * @param {Oktavia} parent
+ */
+function Splitter$LOktavia$(parent) {
+ this._parent = parent;
+ this._bitVector = new BitVector$();
+ this.name = null;
+};
+
+Splitter$LOktavia$.prototype = new Splitter;
+
+/**
+ * @constructor
+ * @param {Oktavia} parent
+ * @param {!string} name
+ */
+function Splitter$LOktavia$S(parent, name) {
+ this._parent = parent;
+ this._bitVector = new BitVector$();
+ this.name = name;
+};
+
+Splitter$LOktavia$S.prototype = new Splitter;
+
+/**
+ * @return {!number}
+ */
+Splitter.prototype.size$ = function () {
+ /** @type {BitVector} */
+ var this$0$0;
+ /** @type {!number} */
+ var i$0$0;
+ /** @type {BitVector} */
+ var _bitVector$0;
+ this$0$0 = _bitVector$0 = this._bitVector;
+ i$0$0 = _bitVector$0._size;
+ return this$0$0.rank$IB(i$0$0, true);
+};
+
+/**
+ */
+Splitter.prototype.split$ = function () {
+ /** @type {!number} */
+ var index$0;
+ /** @type {Oktavia} */
+ var this$0;
+ /** @type {FMIndex} */
+ var this$0$0;
+ this$0 = this._parent;
+ this$0$0 = this$0._fmindex;
+ index$0 = this$0$0._substr.length;
+ this._bitVector.set$I(index$0 - 1);
+};
+
+/**
+ * @param {!number} index
+ */
+Splitter.prototype.split$I = function (index) {
+ this._bitVector.set$I(index - 1);
+};
+
+/**
+ * @param {!number} position
+ * @return {!number}
+ */
+Splitter.prototype.getIndex$I = function (position) {
+ /** @type {BitVector} */
+ var this$0;
+ if (position < 0 || this._bitVector.size$() <= position) {
+ throw new Error("Section.getSectionIndex() : range error");
+ }
+ this$0 = this._bitVector;
+ return this$0.rank$IB(position, true);
+};
+
+/**
+ * @param {SingleResult} result
+ * @param {Array.<undefined|!number>} positions
+ * @param {!string} word
+ * @param {!boolean} stemmed
+ */
+Splitter.prototype.grouping$LSingleResult$AISB = function (result, positions, word, stemmed) {
+ /** @type {!number} */
+ var i;
+ /** @type {undefined|!number} */
+ var position;
+ /** @type {!number} */
+ var index;
+ /** @type {SearchUnit} */
+ var unit;
+ for (i = 0; i < positions.length; i++) {
+ position = positions[i];
+ index = this.getIndex$I(position);
+ unit = SingleResult$getSearchUnit$LSingleResult$I(result, index);
+ if (unit.startPosition < 0) {
+ unit.startPosition = this.getStartPosition$I(index);
+ }
+ SearchUnit$addPosition$LSearchUnit$SIB(unit, word, position - unit.startPosition, stemmed);
+ }
+};
+
+/**
+ * @param {!number} index
+ * @return {!string}
+ */
+Splitter.prototype.getInformation$I = function (index) {
+ return (this.name != null ? this.name + (index + 1 + "") : '');
+};
+
+/**
+ * @param {Oktavia} parent
+ * @param {!string} name
+ * @param {!string} data
+ * @param {!number} offset
+ * @return {!number}
+ */
+Splitter._load$LOktavia$SSI = function (parent, name, data, offset) {
+ /** @type {Splitter} */
+ var section;
+ section = new Splitter$LOktavia$(parent);
+ offset = section._bitVector.load$SI(data, offset);
+ section._parent._metadataLabels.push(name);
+ section._parent._metadatas[name] = section;
+ return offset;
+};
+
+var Splitter$_load$LOktavia$SSI = Splitter._load$LOktavia$SSI;
+
+/**
+ * @return {!string}
+ */
+Splitter.prototype._dump$ = function () {
+ return [ Binary$dump16bitNumber$I(1), Metadata.prototype._dump$.call(this) ].join('');
+};
+
+/**
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+Splitter.prototype._dump$LCompressionReport$ = function (report) {
+ CompressionReport$add$LCompressionReport$II(report, 1, 1);
+ return [ Binary$dump16bitNumber$I(1), Metadata.prototype._dump$LCompressionReport$.call(this, report) ].join('');
+};
+
+/**
+ * class Table extends Metadata
+ * @constructor
+ */
+function Table() {
+}
+
+Table.prototype = new Metadata;
+/**
+ * @constructor
+ * @param {Oktavia} parent
+ * @param {Array.<undefined|!string>} headers
+ */
+function Table$LOktavia$AS(parent, headers) {
+ this._parent = parent;
+ this._bitVector = new BitVector$();
+ this._headers = headers;
+ this._columnTails = new BitVector$();
+};
+
+Table$LOktavia$AS.prototype = new Table;
+
+/**
+ * @return {!number}
+ */
+Table.prototype.rowSize$ = function () {
+ /** @type {BitVector} */
+ var this$0$0;
+ /** @type {!number} */
+ var i$0$0;
+ /** @type {BitVector} */
+ var _bitVector$0;
+ this$0$0 = _bitVector$0 = this._bitVector;
+ i$0$0 = _bitVector$0._size;
+ return this$0$0.rank$IB(i$0$0, true);
+};
+
+/**
+ * @return {!number}
+ */
+Table.prototype.columnSize$ = function () {
+ return (this._headers.length | 0);
+};
+
+/**
+ */
+Table.prototype.setColumnTail$ = function () {
+ /** @type {!number} */
+ var index;
+ /** @type {Oktavia} */
+ var this$0;
+ /** @type {FMIndex} */
+ var this$0$0;
+ /** @type {Oktavia} */
+ var _parent$0;
+ this$0 = _parent$0 = this._parent;
+ this$0$0 = this$0._fmindex;
+ index = this$0$0._substr.length;
+ _parent$0._fmindex.push$S(Oktavia.eob);
+ this._columnTails.set$I(index - 1);
+};
+
+/**
+ */
+Table.prototype.setRowTail$ = function () {
+ /** @type {!number} */
+ var index;
+ /** @type {Oktavia} */
+ var this$0;
+ /** @type {FMIndex} */
+ var this$0$0;
+ this$0 = this._parent;
+ this$0$0 = this$0._fmindex;
+ index = this$0$0._substr.length;
+ this._bitVector.set$I(index - 1);
+};
+
+/**
+ * @param {!number} position
+ * @return {Array.<undefined|!number>}
+ */
+Table.prototype.getCell$I = function (position) {
+ /** @type {!number} */
+ var row;
+ /** @type {!number} */
+ var currentColumn;
+ /** @type {!number} */
+ var lastRowColumn;
+ /** @type {!number} */
+ var startPosition;
+ /** @type {Array.<undefined|!number>} */
+ var result;
+ /** @type {BitVector} */
+ var this$0;
+ /** @type {BitVector} */
+ var this$1;
+ if (position < 0 || this._bitVector.size$() <= position) {
+ throw new Error("Section.getSectionIndex() : range error " + (position + ""));
+ }
+ this$0 = this._bitVector;
+ row = this$0.rank$IB(position, true);
+ this$1 = this._columnTails;
+ currentColumn = this$1.rank$IB(position, true);
+ lastRowColumn = 0;
+ if (row > 0) {
+ startPosition = this._bitVector.select$I(row - 1) + 1;
+ lastRowColumn = this._columnTails.rank$I(startPosition);
+ }
+ result = [ row, currentColumn - lastRowColumn ];
+ return result;
+};
+
+/**
+ * @param {!number} rowIndex
+ * @return {Object.<string, undefined|!string>}
+ */
+Table.prototype.getRowContent$I = function (rowIndex) {
+ /** @type {!string} */
+ var content;
+ /** @type {Array.<undefined|!string>} */
+ var values;
+ /** @type {Object.<string, undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var i;
+ content = this.getContent$I(rowIndex);
+ values = content.split(Oktavia.eob, this._headers.length);
+ result = ({ });
+ for (i in this._headers) {
+ if (i < values.length) {
+ result[this._headers[i]] = values[i];
+ } else {
+ result[this._headers[i]] = '';
+ }
+ }
+ return result;
+};
+
+/**
+ * @param {SingleResult} result
+ * @param {Array.<undefined|!number>} positions
+ * @param {!string} word
+ * @param {!boolean} stemmed
+ */
+Table.prototype.grouping$LSingleResult$AISB = function (result, positions, word, stemmed) {
+};
+
+/**
+ * @param {!number} index
+ * @return {!string}
+ */
+Table.prototype.getInformation$I = function (index) {
+ return '';
+};
+
+/**
+ */
+Table.prototype._build$ = function () {
+ this._bitVector.build$();
+ this._columnTails.build$();
+};
+
+/**
+ * @param {Oktavia} parent
+ * @param {!string} name
+ * @param {!string} data
+ * @param {!number} offset
+ * @return {!number}
+ */
+Table._load$LOktavia$SSI = function (parent, name, data, offset) {
+ /** @type {LoadedStringListResult} */
+ var strs;
+ /** @type {Table} */
+ var table;
+ /** @type {!number} */
+ var offset$0;
+ strs = new LoadedStringListResult$SI(data, offset);
+ table = new Table$LOktavia$AS(parent, strs.result);
+ offset$0 = strs.offset;
+ offset$0 = table._bitVector.load$SI(data, offset$0);
+ table._parent._metadataLabels.push(name);
+ table._parent._metadatas[name] = table;
+ offset = offset$0;
+ return table._columnTails.load$SI(data, offset$0);
+};
+
+var Table$_load$LOktavia$SSI = Table._load$LOktavia$SSI;
+
+/**
+ * @return {!string}
+ */
+Table.prototype._dump$ = function () {
+ return [ Binary$dump16bitNumber$I(2), Binary$dumpStringList$AS(this._headers), Metadata.prototype._dump$.call(this), this._columnTails.dump$() ].join('');
+};
+
+/**
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+Table.prototype._dump$LCompressionReport$ = function (report) {
+ CompressionReport$add$LCompressionReport$II(report, 1, 1);
+ return [ Binary$dump16bitNumber$I(2), Binary$dumpStringList$ASLCompressionReport$(this._headers, report), Metadata.prototype._dump$LCompressionReport$.call(this, report), this._columnTails.dump$LCompressionReport$(report) ].join('');
+};
+
+/**
+ * class Block extends Metadata
+ * @constructor
+ */
+function Block() {
+}
+
+Block.prototype = new Metadata;
+/**
+ * @constructor
+ * @param {Oktavia} parent
+ */
+function Block$LOktavia$(parent) {
+ this._parent = parent;
+ this._bitVector = new BitVector$();
+ this._names = [ ];
+ this._start = false;
+};
+
+Block$LOktavia$.prototype = new Block;
+
+/**
+ * @param {!string} blockName
+ */
+Block.prototype.startBlock$S = function (blockName) {
+ this.startBlock$SI(blockName, this._parent.contentSize$());
+};
+
+/**
+ * @param {!string} blockName
+ * @param {!number} index
+ */
+Block.prototype.startBlock$SI = function (blockName, index) {
+ if (this._start) {
+ throw new Error('Splitter `' + this._names[this._names.length - 1] + '` is not closed');
+ }
+ this._start = true;
+ this._names.push(blockName);
+ this._bitVector.set$I(index - 1);
+};
+
+/**
+ */
+Block.prototype.endBlock$ = function () {
+ this.endBlock$I(this._parent.contentSize$());
+};
+
+/**
+ * @param {!number} index
+ */
+Block.prototype.endBlock$I = function (index) {
+ if (! this._start) {
+ throw new Error('Splitter is not started');
+ }
+ this._start = false;
+ this._bitVector.set$I(index - 1);
+};
+
+/**
+ * @return {!number}
+ */
+Block.prototype.size$ = function () {
+ return (this._names.length | 0);
+};
+
+/**
+ * @param {!number} position
+ * @return {!number}
+ */
+Block.prototype.blockIndex$I = function (position) {
+ /** @type {!number} */
+ var result;
+ /** @type {BitVector} */
+ var this$0;
+ if (position < 0 || this._parent._fmindex.size$() - 1 <= position) {
+ throw new Error("Block.blockIndex() : range error " + (position + ""));
+ }
+ if (position >= this._bitVector.size$()) {
+ position = (this._bitVector.size$() - 1 | 0);
+ result = (this._bitVector.rank$I(position) + 1 | 0);
+ } else {
+ this$0 = this._bitVector;
+ result = this$0.rank$IB(position, true);
+ }
+ return result;
+};
+
+/**
+ * @param {!number} position
+ * @return {!boolean}
+ */
+Block.prototype.inBlock$I = function (position) {
+ /** @type {!number} */
+ var blockIndex;
+ blockIndex = this.blockIndex$I(position);
+ return blockIndex % 2 !== 0;
+};
+
+/**
+ * @param {!number} position
+ * @return {!string}
+ */
+Block.prototype.getBlockContent$I = function (position) {
+ /** @type {!number} */
+ var blockIndex;
+ /** @type {!string} */
+ var result;
+ blockIndex = this.blockIndex$I(position);
+ if (blockIndex % 2 !== 0) {
+ result = this.getContent$I(blockIndex);
+ } else {
+ result = '';
+ }
+ return result;
+};
+
+/**
+ * @param {!number} position
+ * @return {!string}
+ */
+Block.prototype.getBlockName$I = function (position) {
+ /** @type {!number} */
+ var blockIndex;
+ /** @type {!string} */
+ var result;
+ blockIndex = this.blockIndex$I(position);
+ if (blockIndex % 2 !== 0) {
+ result = this._names[blockIndex >>> 1];
+ } else {
+ result = '';
+ }
+ return result;
+};
+
+/**
+ * @param {SingleResult} result
+ * @param {Array.<undefined|!number>} positions
+ * @param {!string} word
+ * @param {!boolean} stemmed
+ */
+Block.prototype.grouping$LSingleResult$AISB = function (result, positions, word, stemmed) {
+};
+
+/**
+ * @param {!number} index
+ * @return {!string}
+ */
+Block.prototype.getInformation$I = function (index) {
+ return '';
+};
+
+/**
+ * @param {Oktavia} parent
+ * @param {!string} name
+ * @param {!string} data
+ * @param {!number} offset
+ * @return {!number}
+ */
+Block._load$LOktavia$SSI = function (parent, name, data, offset) {
+ /** @type {LoadedStringListResult} */
+ var strs;
+ /** @type {Block} */
+ var block;
+ /** @type {!number} */
+ var offset$0;
+ strs = new LoadedStringListResult$SI(data, offset);
+ block = new Block$LOktavia$(parent);
+ block._names = strs.result;
+ offset$0 = strs.offset;
+ offset$0 = block._bitVector.load$SI(data, offset$0);
+ block._parent._metadataLabels.push(name);
+ block._parent._metadatas[name] = block;
+ return offset$0;
+};
+
+var Block$_load$LOktavia$SSI = Block._load$LOktavia$SSI;
+
+/**
+ * @return {!string}
+ */
+Block.prototype._dump$ = function () {
+ return [ Binary$dump16bitNumber$I(3), Binary$dumpStringList$AS(this._names), Metadata.prototype._dump$.call(this) ].join('');
+};
+
+/**
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+Block.prototype._dump$LCompressionReport$ = function (report) {
+ CompressionReport$add$LCompressionReport$II(report, 1, 1);
+ return [ Binary$dump16bitNumber$I(3), Binary$dumpStringList$ASLCompressionReport$(this._names, report), Metadata.prototype._dump$LCompressionReport$.call(this, report) ].join('');
+};
+
+/**
+ * class FMIndex extends Object
+ * @constructor
+ */
+function FMIndex() {
+}
+
+/**
+ * @constructor
+ */
+function FMIndex$() {
+ /** @type {Array.<undefined|!number>} */
+ var _rlt$0;
+ this._ssize = 0;
+ (this._ddic = 0, this._head = 0);
+ this._substr = "";
+ this._sv = new WaveletMatrix$();
+ this._posdic = [ ];
+ this._idic = [ ];
+ _rlt$0 = this._rlt = [ ];
+ _rlt$0.length = 65536;
+};
+
+FMIndex$.prototype = new FMIndex;
+
+/**
+ */
+FMIndex.prototype.clear$ = function () {
+ /** @type {WaveletMatrix} */
+ var this$0;
+ this$0 = this._sv;
+ this$0._bv.length = 0;
+ this$0._seps.length = 0;
+ this$0._size = 0;
+ this._posdic.length = 0;
+ this._idic.length = 0;
+ this._ddic = 0;
+ this._head = 0;
+ this._substr = "";
+};
+
+/**
+ * @return {!number}
+ */
+FMIndex.prototype.size$ = function () {
+ /** @type {WaveletMatrix} */
+ var this$0;
+ this$0 = this._sv;
+ return this$0._size;
+};
+
+/**
+ * @return {!number}
+ */
+FMIndex.prototype.contentSize$ = function () {
+ return this._substr.length;
+};
+
+/**
+ * @param {!string} key
+ * @return {!number}
+ */
+FMIndex.prototype.getRows$S = function (key) {
+ /** @type {Array.<undefined|!number>} */
+ var pos;
+ pos = [ ];
+ return this.getRows$SAI(key, pos);
+};
+
+/**
+ * @param {!string} key
+ * @param {Array.<undefined|!number>} pos
+ * @return {!number}
+ */
+FMIndex.prototype.getRows$SAI = function (key, pos) {
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var code;
+ /** @type {!number} */
+ var first;
+ /** @type {undefined|!number} */
+ var last;
+ /** @type {!number} */
+ var c;
+ /** @type {Array.<undefined|!number>} */
+ var _rlt$0;
+ i = key.length - 1;
+ code = key.charCodeAt(i);
+ first = (_rlt$0 = this._rlt)[code] + 1;
+ last = _rlt$0[code + 1];
+ while (first <= last) {
+ if (i === 0) {
+ pos[0] = (-- first | 0);
+ pos[1] = -- last;
+ return (last - first + 1 | 0);
+ }
+ i--;
+ c = key.charCodeAt(i);
+ first = this._rlt[c] + this._sv.rank$II(first - 1, c) + 1;
+ last = this._rlt[c] + this._sv.rank$II(last, c);
+ }
+ return 0;
+};
+
+/**
+ * @param {!number} i
+ * @return {!number}
+ */
+FMIndex.prototype.getPosition$I = function (i) {
+ /** @type {!number} */
+ var pos;
+ /** @type {!number} */
+ var c;
+ if (i >= this.size$()) {
+ throw new Error("FMIndex.getPosition() : range error");
+ }
+ pos = 0;
+ while (i !== this._head) {
+ if (i % this._ddic === 0) {
+ pos += this._posdic[i / this._ddic] + 1;
+ break;
+ }
+ c = this._sv.get$I(i);
+ i = this._rlt[c] + this._sv.rank$II(i, c);
+ pos++;
+ }
+ return (pos % this.size$() | 0);
+};
+
+/**
+ * @param {!number} pos
+ * @param {!number} len
+ * @return {!string}
+ */
+FMIndex.prototype.getSubstring$II = function (pos, len) {
+ /** @type {!number} */
+ var pos_end;
+ /** @type {!number} */
+ var pos_tmp;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var pos_idic;
+ /** @type {!string} */
+ var substr;
+ /** @type {!number} */
+ var c;
+ /** @type {!number} */
+ var _ddic$0;
+ if (pos >= this.size$()) {
+ throw new Error("FMIndex.getSubstring() : range error");
+ }
+ pos_end = Math.min(pos + len, this.size$());
+ pos_tmp = this.size$() - 1;
+ i = this._head;
+ pos_idic = Math.floor((pos_end + (_ddic$0 = this._ddic) - 2) / _ddic$0);
+ if (pos_idic < this._idic.length) {
+ pos_tmp = pos_idic * this._ddic;
+ i = this._idic[pos_idic];
+ }
+ substr = "";
+ while (pos_tmp >= pos) {
+ c = this._sv.get$I(i);
+ i = this._rlt[c] + this._sv.rank$II(i, c);
+ if (pos_tmp < pos_end) {
+ substr = String.fromCharCode(c) + substr;
+ }
+ if (pos_tmp === 0) {
+ break;
+ }
+ pos_tmp--;
+ }
+ return substr;
+};
+
+/**
+ */
+FMIndex.prototype.build$ = function () {
+ this.build$SIIB(String.fromCharCode(0), 65535, 20, false);
+};
+
+/**
+ * @param {!string} end_marker
+ * @param {!number} ddic
+ * @param {!boolean} verbose
+ */
+FMIndex.prototype.build$SIB = function (end_marker, ddic, verbose) {
+ this.build$SIIB(end_marker, 65535, ddic, verbose);
+};
+
+/**
+ * @param {!string} end_marker
+ * @param {!number} maxChar
+ * @param {!number} ddic
+ * @param {!boolean} verbose
+ */
+FMIndex.prototype.build$SIIB = function (end_marker, maxChar, ddic, verbose) {
+ /** @type {BurrowsWheelerTransform} */
+ var b;
+ /** @type {!string} */
+ var s;
+ /** @type {!number} */
+ var c;
+ /** @type {!string} */
+ var str$0;
+ /** @type {WaveletMatrix} */
+ var this$0;
+ /** @type {!string} */
+ var _str$0;
+ /** @type {Array.<undefined|!number>} */
+ var _suffixarray$0;
+ if (verbose) {
+ console.time("building burrows-wheeler transform");
+ }
+ this._substr += end_marker;
+ b = ({_str: "", _size: 0, _head: 0, _suffixarray: [ ]});
+ str$0 = this._substr;
+ _str$0 = b._str = str$0;
+ b._size = _str$0.length;
+ _suffixarray$0 = b._suffixarray = SAIS$make$S(str$0);
+ b._head = (_suffixarray$0.indexOf(0) | 0);
+ s = BurrowsWheelerTransform$get$LBurrowsWheelerTransform$(b);
+ this._ssize = s.length;
+ this._head = b._head;
+ b._str = "";
+ b._size = 0;
+ b._head = 0;
+ b._suffixarray.length = 0;
+ this._substr = "";
+ if (verbose) {
+ console.timeEnd("building burrows-wheeler transform");
+ }
+ if (verbose) {
+ console.time("building wavelet matrix");
+ }
+ this$0 = this._sv;
+ this$0._bitsize = (Math.ceil(Math.log(maxChar) / 0.6931471805599453) | 0);
+ if (verbose) {
+ console.log(" maxCharCode: ", maxChar);
+ console.log(" bitSize: ", this._sv.bitsize$());
+ }
+ this._sv.build$S(s);
+ if (verbose) {
+ console.timeEnd("building wavelet matrix");
+ }
+ if (verbose) {
+ console.time("caching rank less than");
+ }
+ for (c = 0; c < maxChar; c++) {
+ this._rlt[c] = this._sv.rank_less_than$II(this._sv.size$(), c);
+ }
+ if (verbose) {
+ console.timeEnd("caching rank less than");
+ }
+ this._ddic = ddic;
+ if (verbose) {
+ console.time("building dictionaries");
+ }
+ this._buildDictionaries$();
+ if (verbose) {
+ console.timeEnd("building dictionaries");
+ console.log('');
+ }
+};
+
+/**
+ */
+FMIndex.prototype._buildDictionaries$ = function () {
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var pos;
+ /** @type {!number} */
+ var c;
+ for (i = 0; i < this._ssize / this._ddic + 1; i++) {
+ this._posdic.push(0);
+ this._idic.push(0);
+ }
+ i = this._head;
+ pos = this.size$() - 1;
+ do {
+ if (i % this._ddic === 0) {
+ this._posdic[Math.floor(i / this._ddic)] = (pos | 0);
+ }
+ if (pos % this._ddic === 0) {
+ this._idic[Math.floor(pos / this._ddic)] = (i | 0);
+ }
+ c = this._sv.get$I(i);
+ i = this._rlt[c] + this._sv.rank$II(i, c);
+ pos--;
+ } while (i !== this._head);
+};
+
+/**
+ * @param {!string} doc
+ */
+FMIndex.prototype.push$S = function (doc) {
+ if (doc.length <= 0) {
+ throw new Error("FMIndex::push(): empty string");
+ }
+ this._substr += doc;
+};
+
+/**
+ * @param {!string} keyword
+ * @return {Array.<undefined|!number>}
+ */
+FMIndex.prototype.search$S = function (keyword) {
+ /** @type {Array.<undefined|!number>} */
+ var result;
+ /** @type {Array.<undefined|!number>} */
+ var position;
+ /** @type {!number} */
+ var rows;
+ /** @type {undefined|!number} */
+ var first;
+ /** @type {undefined|!number} */
+ var last;
+ /** @type {undefined|!number} */
+ var i;
+ result = [ ];
+ position = [ ];
+ rows = this.getRows$SAI(keyword, position);
+ if (rows > 0) {
+ first = position[0];
+ last = position[1];
+ for (i = first; i <= last; i++) {
+ result.push(this.getPosition$I(i));
+ }
+ }
+ return result;
+};
+
+/**
+ * @return {!string}
+ */
+FMIndex.prototype.dump$ = function () {
+ return this.dump$B(false);
+};
+
+/**
+ * @param {!boolean} verbose
+ * @return {!string}
+ */
+FMIndex.prototype.dump$B = function (verbose) {
+ /** @type {Array.<undefined|!string>} */
+ var contents;
+ /** @type {CompressionReport} */
+ var report;
+ /** @type {!number} */
+ var i;
+ contents = [ ];
+ report = ({source: 0, result: 0});
+ contents.push(Binary$dump32bitNumber$N(this._ddic));
+ contents.push(Binary$dump32bitNumber$N(this._ssize));
+ contents.push(Binary$dump32bitNumber$N(this._head));
+ CompressionReport$add$LCompressionReport$II(report, 6, 6);
+ contents.push(this._sv.dump$LCompressionReport$(report));
+ if (verbose) {
+ console.log("Serializing FM-index");
+ console.log(' Wavelet Matrix: ' + (contents[3].length * 2 + "") + ' bytes (' + (Math.round(report.result * 100.0 / report.source) + "") + '%)');
+ }
+ contents.push(Binary$dump32bitNumber$N(this._posdic.length));
+ for (i in this._posdic) {
+ contents.push(Binary$dump32bitNumber$N(this._posdic[i]));
+ }
+ for (i in this._idic) {
+ contents.push(Binary$dump32bitNumber$N(this._idic[i]));
+ }
+ if (verbose) {
+ console.log(' Dictionary Cache: ' + (this._idic.length * 16 + "") + ' bytes');
+ }
+ return contents.join("");
+};
+
+/**
+ * @param {!string} data
+ * @return {!number}
+ */
+FMIndex.prototype.load$S = function (data) {
+ return this.load$SI(data, 0);
+};
+
+/**
+ * @param {!string} data
+ * @param {!number} offset
+ * @return {!number}
+ */
+FMIndex.prototype.load$SI = function (data, offset) {
+ /** @type {!number} */
+ var maxChar;
+ /** @type {!number} */
+ var c;
+ /** @type {!number} */
+ var size;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var result$0;
+ /** @type {!number} */
+ var result$1;
+ result$0 = data.charCodeAt(offset) * 65536 + data.charCodeAt(offset + 1);
+ this._ddic = (result$0 | 0);
+ this._ssize = (Binary$load32bitNumber$SI(data, offset + 2) | 0);
+ this._head = (Binary$load32bitNumber$SI(data, offset + 4) | 0);
+ offset = this._sv.load$SI(data, offset + 6);
+ maxChar = Math.pow(2, this._sv.bitsize$());
+ for (c = 0; c < maxChar; c++) {
+ this._rlt[c] = this._sv.rank_less_than$II(this._sv.size$(), c);
+ }
+ result$1 = data.charCodeAt(offset) * 65536 + data.charCodeAt(offset + 1);
+ size = result$1;
+ offset += 2;
+ for (i = 0; i < size; (i++, offset += 2)) {
+ this._posdic.push(Binary$load32bitNumber$SI(data, offset));
+ }
+ for (i = 0; i < size; (i++, offset += 2)) {
+ this._idic.push(Binary$load32bitNumber$SI(data, offset));
+ }
+ return offset;
+};
+
+/**
+ * class Tag extends Object
+ * @constructor
+ */
+function Tag() {
+}
+
+/**
+ * @constructor
+ * @param {!string} name
+ */
+function Tag$S(name) {
+ this.name = name;
+ this.attributes = ({ });
+ this.isSelfClosing = false;
+};
+
+Tag$S.prototype = new Tag;
+
+/**
+ * class _Common extends Object
+ * @constructor
+ */
+function _Common() {
+}
+
+/**
+ * @constructor
+ */
+function _Common$() {
+};
+
+_Common$.prototype = new _Common;
+
+/**
+ * class _State extends Object
+ * @constructor
+ */
+function _State() {
+}
+
+/**
+ * @constructor
+ */
+function _State$() {
+};
+
+_State$.prototype = new _State;
+
+/**
+ * class SAXHandler extends Object
+ * @constructor
+ */
+function SAXHandler() {
+}
+
+/**
+ * @constructor
+ */
+function SAXHandler$() {
+ this.position = 0;
+ this.column = 0;
+ this.line = 0;
+};
+
+SAXHandler$.prototype = new SAXHandler;
+
+/**
+ * @param {Error} error
+ */
+SAXHandler.prototype.onerror$LError$ = function (error) {
+};
+
+/**
+ * @param {!string} text
+ */
+SAXHandler.prototype.ontext$S = function (text) {
+};
+
+/**
+ * @param {!string} doctype
+ */
+SAXHandler.prototype.ondoctype$S = function (doctype) {
+};
+
+/**
+ * @param {!string} name
+ * @param {!string} body
+ */
+SAXHandler.prototype.onprocessinginstruction$SS = function (name, body) {
+};
+
+/**
+ * @param {!string} sgmlDecl
+ */
+SAXHandler.prototype.onsgmldeclaration$S = function (sgmlDecl) {
+};
+
+/**
+ * @param {!string} tagname
+ * @param {Object.<string, undefined|!string>} attributes
+ */
+SAXHandler.prototype.onopentag$SHS = function (tagname, attributes) {
+};
+
+/**
+ * @param {!string} tagname
+ */
+SAXHandler.prototype.onclosetag$S = function (tagname) {
+};
+
+/**
+ * @param {!string} name
+ * @param {!string} value
+ */
+SAXHandler.prototype.onattribute$SS = function (name, value) {
+};
+
+/**
+ * @param {!string} comment
+ */
+SAXHandler.prototype.oncomment$S = function (comment) {
+};
+
+/**
+ */
+SAXHandler.prototype.onopencdata$ = function () {
+};
+
+/**
+ * @param {!string} cdata
+ */
+SAXHandler.prototype.oncdata$S = function (cdata) {
+};
+
+/**
+ */
+SAXHandler.prototype.onclosecdata$ = function () {
+};
+
+/**
+ */
+SAXHandler.prototype.onend$ = function () {
+};
+
+/**
+ */
+SAXHandler.prototype.onready$ = function () {
+};
+
+/**
+ * @param {!string} script
+ */
+SAXHandler.prototype.onscript$S = function (script) {
+};
+
+/**
+ * class _HTMLHandler extends SAXHandler
+ * @constructor
+ */
+function _HTMLHandler() {
+}
+
+_HTMLHandler.prototype = new SAXHandler;
+/**
+ * @constructor
+ * @param {Object.<string, undefined|Array.<undefined|!string>>} styles
+ * @param {!boolean} escape
+ */
+function _HTMLHandler$HASB(styles, escape) {
+ this.position = 0;
+ this.column = 0;
+ this.line = 0;
+ this.text = [ ];
+ this.escape = escape;
+ this.styles = styles;
+};
+
+_HTMLHandler$HASB.prototype = new _HTMLHandler;
+
+/**
+ * @param {!string} str
+ * @return {!string}
+ */
+_HTMLHandler.escapeHTML$S = function (str) {
+ return str.replace(/\n/g, "<br/>").replace(/&/g, "&amp;").replace(/"/g, "&quot;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
+};
+
+var _HTMLHandler$escapeHTML$S = _HTMLHandler.escapeHTML$S;
+
+/**
+ * @param {!string} tagname
+ * @param {Object.<string, undefined|!string>} attributes
+ */
+_HTMLHandler.prototype.onopentag$SHS = function (tagname, attributes) {
+ this.text.push(this.styles[tagname][0]);
+};
+
+/**
+ * @param {!string} tagname
+ */
+_HTMLHandler.prototype.onclosetag$S = function (tagname) {
+ this.text.push(this.styles[tagname][1]);
+};
+
+/**
+ * @param {!string} text
+ */
+_HTMLHandler.prototype.ontext$S = function (text) {
+ if (this.escape) {
+ this.text.push(text.replace(/\n/g, "<br/>").replace(/&/g, "&amp;").replace(/"/g, "&quot;").replace(/</g, "&lt;").replace(/>/g, "&gt;"));
+ } else {
+ this.text.push(text);
+ }
+};
+
+/**
+ * @return {!string}
+ */
+_HTMLHandler.prototype.result$ = function () {
+ return this.text.join('');
+};
+
+/**
+ * class SAXParser extends Object
+ * @constructor
+ */
+function SAXParser() {
+}
+
+/**
+ * @constructor
+ * @param {SAXHandler} handler
+ */
+function SAXParser$LSAXHandler$(handler) {
+ this.q = "";
+ this.c = "";
+ this.bufferCheckPosition = 0;
+ this.looseCase = "";
+ this.tags = [ ];
+ this.closed = false;
+ this.closedRoot = false;
+ this.sawRoot = false;
+ this.tag = null;
+ this.error = null;
+ this.handler = null;
+ this.ENTITIES = null;
+ this.strict = false;
+ this.tagName = "";
+ this.state = 0;
+ this.line = 0;
+ this.column = 0;
+ this.position = 0;
+ this.startTagPosition = 0;
+ this.attribName = "";
+ this.attribValue = "";
+ this.script = "";
+ this.textNode = "";
+ this.attribList = null;
+ this.noscript = false;
+ this.cdata = "";
+ this.procInstBody = "";
+ this.procInstName = "";
+ this.doctype = "";
+ this.entity = "";
+ this.sgmlDecl = "";
+ this.comment = "";
+ this.preTags = 0;
+ this._init$LSAXHandler$B(handler, false);
+};
+
+SAXParser$LSAXHandler$.prototype = new SAXParser;
+
+/**
+ * @constructor
+ * @param {SAXHandler} handler
+ * @param {!boolean} strict
+ */
+function SAXParser$LSAXHandler$B(handler, strict) {
+ this.q = "";
+ this.c = "";
+ this.bufferCheckPosition = 0;
+ this.looseCase = "";
+ this.tags = [ ];
+ this.closed = false;
+ this.closedRoot = false;
+ this.sawRoot = false;
+ this.tag = null;
+ this.error = null;
+ this.handler = null;
+ this.ENTITIES = null;
+ this.strict = false;
+ this.tagName = "";
+ this.state = 0;
+ this.line = 0;
+ this.column = 0;
+ this.position = 0;
+ this.startTagPosition = 0;
+ this.attribName = "";
+ this.attribValue = "";
+ this.script = "";
+ this.textNode = "";
+ this.attribList = null;
+ this.noscript = false;
+ this.cdata = "";
+ this.procInstBody = "";
+ this.procInstName = "";
+ this.doctype = "";
+ this.entity = "";
+ this.sgmlDecl = "";
+ this.comment = "";
+ this.preTags = 0;
+ this._init$LSAXHandler$B(handler, strict);
+};
+
+SAXParser$LSAXHandler$B.prototype = new SAXParser;
+
+/**
+ * @param {SAXHandler} handler
+ * @param {!boolean} strict
+ */
+SAXParser.prototype._init$LSAXHandler$B = function (handler, strict) {
+ this.handler = handler;
+ this.clearBuffers$();
+ this.q = "";
+ this.bufferCheckPosition = 65536;
+ this.looseCase = 'toLowerCase';
+ this.tags = [ ];
+ this.closed = this.closedRoot = this.sawRoot = false;
+ this.tag = null;
+ this.error = null;
+ this.strict = strict;
+ this.noscript = strict;
+ this.state = 1;
+ this.ENTITIES = _Entities$entity_list$();
+ this.attribList = [ ];
+ this.noscript = false;
+ this.preTags = 0;
+};
+
+/**
+ * @param {!boolean} flag
+ */
+SAXParser.prototype.set_noscript$B = function (flag) {
+ this.noscript = flag;
+};
+
+/**
+ * @return {SAXParser}
+ */
+SAXParser.prototype.resume$ = function () {
+ this.error = null;
+ return this;
+};
+
+/**
+ * @return {SAXParser}
+ */
+SAXParser.prototype.close$ = function () {
+ return this.parse$S('');
+};
+
+/**
+ * @param {!string} chunk
+ * @return {SAXParser}
+ */
+SAXParser.prototype.parse$S = function (chunk) {
+ /** @type {Char} */
+ var _;
+ /** @type {!number} */
+ var i;
+ /** @type {!string} */
+ var c;
+ /** @type {!number} */
+ var starti;
+ /** @type {!number} */
+ var pad;
+ /** @type {!number} */
+ var returnState;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$0;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$1;
+ /** @type {RegExp} */
+ var charclass$2;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$3;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$4;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$5;
+ /** @type {!string} */
+ var text$0;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$6;
+ /** @type {RegExp} */
+ var charclass$7;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$8;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$9;
+ /** @type {RegExp} */
+ var charclass$10;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$11;
+ /** @type {RegExp} */
+ var charclass$12;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$13;
+ /** @type {RegExp} */
+ var charclass$14;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$15;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$16;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$17;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$18;
+ /** @type {RegExp} */
+ var charclass$19;
+ /** @type {RegExp} */
+ var charclass$20;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$21;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$22;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$23;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$24;
+ /** @type {!string} */
+ var comment$0;
+ _ = new Char$();
+ if (this.error) {
+ throw this.error;
+ }
+ if (this.closed) {
+ return this.emiterror$S("Cannot write after close. Assign an onready handler.");
+ }
+ (i = 0, c = "");
+ while (this.c = c = chunk.charAt(i++)) {
+ this.position++;
+ if (c === "\n") {
+ this.handler.line++;
+ this.handler.column = 0;
+ } else {
+ this.handler.column++;
+ }
+ switch (this.state) {
+ case 1:
+ if (c === "<") {
+ this.state = 4;
+ this.startTagPosition = this.position;
+ } else {
+ charclass$0 = _.whitespace;
+ if (! $__jsx_ObjectHasOwnProperty.call(charclass$0, c)) {
+ this.strictFail$S("Non-whitespace before first tag.");
+ this.textNode = c;
+ this.state = 2;
+ }
+ }
+ continue;
+ case 2:
+ if (this.sawRoot && ! this.closedRoot) {
+ starti = i - 1;
+ while (c && c !== "<" && c !== "&") {
+ c = chunk.charAt(i++);
+ if (c) {
+ this.position++;
+ if (c === "\n") {
+ this.handler.line++;
+ this.handler.column = 0;
+ } else {
+ this.handler.column++;
+ }
+ }
+ }
+ this.textNode += chunk.substring(starti, i - 1);
+ }
+ if (c === "<") {
+ this.state = 4;
+ this.startTagPosition = this.position;
+ } else {
+ if (_.not$HBS(_.whitespace, c) && (! this.sawRoot || this.closedRoot)) {
+ this.strictFail$S("Text data outside of root node.");
+ }
+ if (c === "&") {
+ this.state = 3;
+ } else {
+ this.textNode += c;
+ }
+ }
+ continue;
+ case 33:
+ if (c === "<") {
+ this.state = 34;
+ } else {
+ this.script += c;
+ }
+ continue;
+ case 34:
+ if (c === "/") {
+ this.state = 31;
+ } else {
+ this.script += "<" + c;
+ this.state = 33;
+ }
+ continue;
+ case 4:
+ if (c === "!") {
+ this.state = 5;
+ this.sgmlDecl = "";
+ } else {
+ charclass$1 = _.whitespace;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$1, c)) {
+ } else {
+ charclass$2 = _.nameStart;
+ if (charclass$2.test(c)) {
+ this.state = 21;
+ this.tagName = c;
+ } else {
+ if (c === "/") {
+ this.state = 31;
+ this.tagName = "";
+ } else {
+ if (c === "?") {
+ this.state = 18;
+ this.procInstName = this.procInstBody = "";
+ } else {
+ this.strictFail$S("Unencoded <");
+ if (this.startTagPosition + 1 < this.position) {
+ pad = this.position - this.startTagPosition;
+ for (i = 0; i < pad; i++) {
+ c = " " + c;
+ }
+ }
+ this.textNode += "<" + c;
+ this.state = 2;
+ }
+ }
+ }
+ }
+ }
+ continue;
+ case 5:
+ if ((this.sgmlDecl + c).toUpperCase() === _.CDATA) {
+ this.closetext_if_exist$();
+ this.state = 15;
+ this.sgmlDecl = "";
+ this.cdata = "";
+ } else {
+ if (this.sgmlDecl + c === "--") {
+ this.state = 12;
+ this.comment = "";
+ this.sgmlDecl = "";
+ } else {
+ if ((this.sgmlDecl + c).toUpperCase() === _.DOCTYPE) {
+ this.state = 7;
+ if (this.doctype || this.sawRoot) {
+ this.strictFail$S("Inappropriately located doctype declaration");
+ }
+ this.doctype = "";
+ this.sgmlDecl = "";
+ } else {
+ if (c === ">") {
+ this.closetext_if_exist$();
+ this.sgmlDecl = "";
+ this.state = 2;
+ } else {
+ charclass$3 = _.quote;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$3, c)) {
+ this.state = 6;
+ this.sgmlDecl += c;
+ } else {
+ this.sgmlDecl += c;
+ }
+ }
+ }
+ }
+ }
+ continue;
+ case 6:
+ if (c === this.q) {
+ this.state = 5;
+ this.q = "";
+ }
+ this.sgmlDecl += c;
+ continue;
+ case 7:
+ if (c === ">") {
+ this.state = 2;
+ this.closetext_if_exist$();
+ this.doctype.trim();
+ } else {
+ this.doctype += c;
+ if (c === "[") {
+ this.state = 9;
+ } else {
+ charclass$4 = _.quote;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$4, c)) {
+ this.state = 8;
+ this.q = c;
+ }
+ }
+ }
+ continue;
+ case 8:
+ this.doctype += c;
+ if (c === this.q) {
+ this.q = "";
+ this.state = 7;
+ }
+ continue;
+ case 9:
+ this.doctype += c;
+ if (c === "]") {
+ this.state = 7;
+ } else {
+ charclass$5 = _.quote;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$5, c)) {
+ this.state = 10;
+ this.q = c;
+ }
+ }
+ continue;
+ case 10:
+ this.doctype += c;
+ if (c === this.q) {
+ this.state = 9;
+ this.q = "";
+ }
+ continue;
+ case 12:
+ if (c === "-") {
+ this.state = 13;
+ } else {
+ this.comment += c;
+ }
+ continue;
+ case 13:
+ if (c === "-") {
+ this.state = 14;
+ text$0 = this.comment;
+ text$0 = text$0.replace(/[\n\t]/g, ' ');
+ text$0 = text$0.replace(/\s\s+/g, " ");
+ comment$0 = this.comment = text$0;
+ if (comment$0) {
+ this.closetext_if_exist$();
+ this.comment.trim();
+ }
+ this.comment = "";
+ } else {
+ this.comment += "-" + c;
+ this.state = 12;
+ }
+ continue;
+ case 14:
+ if (c !== ">") {
+ this.strictFail$S("Malformed comment");
+ this.comment += "--" + c;
+ this.state = 12;
+ } else {
+ this.state = 2;
+ }
+ continue;
+ case 15:
+ if (c === "]") {
+ this.state = 16;
+ } else {
+ this.cdata += c;
+ }
+ continue;
+ case 16:
+ if (c === "]") {
+ this.state = 17;
+ } else {
+ this.cdata += "]" + c;
+ this.state = 15;
+ }
+ continue;
+ case 17:
+ if (c === ">") {
+ if (this.cdata) {
+ this.closetext_if_exist$();
+ }
+ this.cdata = "";
+ this.state = 2;
+ } else {
+ if (c === "]") {
+ this.cdata += "]";
+ } else {
+ this.cdata += "]]" + c;
+ this.state = 15;
+ }
+ }
+ continue;
+ case 18:
+ if (c === "?") {
+ this.state = 20;
+ } else {
+ charclass$6 = _.whitespace;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$6, c)) {
+ this.state = 19;
+ } else {
+ this.procInstName += c;
+ }
+ }
+ continue;
+ case 19:
+ if (! this.procInstBody && _.is$HBS(_.whitespace, c)) {
+ continue;
+ } else {
+ if (c === "?") {
+ this.state = 20;
+ } else {
+ this.procInstBody += c;
+ }
+ }
+ continue;
+ case 20:
+ if (c === ">") {
+ this.closetext_if_exist$();
+ this.procInstName = this.procInstBody = "";
+ this.state = 2;
+ } else {
+ this.procInstBody += "?" + c;
+ this.state = 19;
+ }
+ continue;
+ case 21:
+ charclass$7 = _.nameBody;
+ if (charclass$7.test(c)) {
+ this.tagName += c;
+ } else {
+ this.newTag$();
+ if (c === ">") {
+ this.openTag$B(false);
+ } else {
+ if (c === "/") {
+ this.state = 22;
+ } else {
+ charclass$8 = _.whitespace;
+ if (! $__jsx_ObjectHasOwnProperty.call(charclass$8, c)) {
+ this.strictFail$S("Invalid character in tag name");
+ }
+ this.state = 23;
+ }
+ }
+ }
+ continue;
+ case 22:
+ if (c === ">") {
+ this.openTag$B(true);
+ this.closeTag$();
+ } else {
+ this.strictFail$S("Forward-slash in opening tag not followed by >");
+ this.state = 23;
+ }
+ continue;
+ case 23:
+ charclass$9 = _.whitespace;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$9, c)) {
+ continue;
+ } else {
+ if (c === ">") {
+ this.openTag$B(false);
+ } else {
+ if (c === "/") {
+ this.state = 22;
+ } else {
+ charclass$10 = _.nameStart;
+ if (charclass$10.test(c)) {
+ this.attribName = c;
+ this.attribValue = "";
+ this.state = 24;
+ } else {
+ this.strictFail$S("Invalid attribute name");
+ }
+ }
+ }
+ }
+ continue;
+ case 24:
+ if (c === "=") {
+ this.state = 26;
+ } else {
+ if (c === ">") {
+ this.strictFail$S("Attribute without value");
+ this.attribValue = this.attribName;
+ this.attrib$();
+ this.openTag$B(false);
+ } else {
+ charclass$11 = _.whitespace;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$11, c)) {
+ this.state = 25;
+ } else {
+ charclass$12 = _.nameBody;
+ if (charclass$12.test(c)) {
+ this.attribName += c;
+ } else {
+ this.strictFail$S("Invalid attribute name");
+ }
+ }
+ }
+ }
+ continue;
+ case 25:
+ if (c === "=") {
+ this.state = 26;
+ } else {
+ charclass$13 = _.whitespace;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$13, c)) {
+ continue;
+ } else {
+ this.strictFail$S("Attribute without value");
+ this.tag.attributes[this.attribName] = "";
+ this.attribValue = "";
+ this.closetext_if_exist$();
+ this.attribName = "";
+ if (c === ">") {
+ this.openTag$B(false);
+ } else {
+ charclass$14 = _.nameStart;
+ if (charclass$14.test(c)) {
+ this.attribName = c;
+ this.state = 24;
+ } else {
+ this.strictFail$S("Invalid attribute name");
+ this.state = 23;
+ }
+ }
+ }
+ }
+ continue;
+ case 26:
+ charclass$15 = _.whitespace;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$15, c)) {
+ continue;
+ } else {
+ charclass$16 = _.quote;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$16, c)) {
+ this.q = c;
+ this.state = 27;
+ } else {
+ this.strictFail$S("Unquoted attribute value");
+ this.state = 28;
+ this.attribValue = c;
+ }
+ }
+ continue;
+ case 27:
+ if (c !== this.q) {
+ if (c === "&") {
+ this.state = 29;
+ } else {
+ this.attribValue += c;
+ }
+ continue;
+ }
+ this.attrib$();
+ this.q = "";
+ this.state = 23;
+ continue;
+ case 28:
+ charclass$17 = _.attribEnd;
+ if (! $__jsx_ObjectHasOwnProperty.call(charclass$17, c)) {
+ if (c === "&") {
+ this.state = 30;
+ } else {
+ this.attribValue += c;
+ }
+ continue;
+ }
+ this.attrib$();
+ if (c === ">") {
+ this.openTag$B(false);
+ } else {
+ this.state = 23;
+ }
+ continue;
+ case 31:
+ if (! this.tagName) {
+ charclass$18 = _.whitespace;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$18, c)) {
+ continue;
+ } else {
+ charclass$19 = _.nameStart;
+ if (! charclass$19.test(c)) {
+ if (this.script) {
+ this.script += "</" + c;
+ this.state = 33;
+ } else {
+ this.strictFail$S("Invalid tagname in closing tag.");
+ }
+ } else {
+ this.tagName = c;
+ }
+ }
+ } else {
+ if (c === ">") {
+ this.closeTag$();
+ } else {
+ charclass$20 = _.nameBody;
+ if (charclass$20.test(c)) {
+ this.tagName += c;
+ } else {
+ if (this.script) {
+ this.script += "</" + this.tagName;
+ this.tagName = "";
+ this.state = 33;
+ } else {
+ charclass$21 = _.whitespace;
+ if (! $__jsx_ObjectHasOwnProperty.call(charclass$21, c)) {
+ this.strictFail$S("Invalid tagname in closing tag");
+ }
+ this.state = 32;
+ }
+ }
+ }
+ }
+ continue;
+ case 32:
+ charclass$22 = _.whitespace;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$22, c)) {
+ continue;
+ }
+ if (c === ">") {
+ this.closeTag$();
+ } else {
+ this.strictFail$S("Invalid characters in closing tag");
+ }
+ continue;
+ case 3:
+ if (c === ";") {
+ this.textNode += this.parseEntity$();
+ this.entity = "";
+ this.state = 2;
+ } else {
+ charclass$23 = _.entity;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$23, c)) {
+ this.entity += c;
+ } else {
+ this.strictFail$S("Invalid character entity");
+ this.textNode += "&" + this.entity + c;
+ this.entity = "";
+ this.state = 2;
+ }
+ }
+ continue;
+ case 29:
+ case 30:
+ if (this.state === 29) {
+ returnState = 27;
+ } else {
+ returnState = 28;
+ }
+ if (c === ";") {
+ this.attribValue += this.parseEntity$();
+ this.entity = "";
+ this.state = (returnState | 0);
+ } else {
+ charclass$24 = _.entity;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$24, c)) {
+ this.entity += c;
+ } else {
+ this.strictFail$S("Invalid character entity");
+ this.attribValue += "&" + this.entity + c;
+ this.entity = "";
+ this.state = (returnState | 0);
+ }
+ }
+ continue;
+ default:
+ throw new Error("Unknown state: " + (this.state + ""));
+ }
+ }
+ this.end$();
+ return this;
+};
+
+/**
+ */
+SAXParser.prototype.clearBuffers$ = function () {
+ this.comment = '';
+ this.sgmlDecl = '';
+ this.textNode = '';
+ this.tagName = '';
+ this.doctype = '';
+ this.procInstName = '';
+ this.procInstBody = '';
+ this.entity = '';
+ this.attribName = '';
+ this.attribValue = '';
+ this.cdata = '';
+ this.script = '';
+};
+
+/**
+ */
+SAXParser.prototype.closetext_if_exist$ = function () {
+ if (this.textNode !== '') {
+ this.closetext$();
+ }
+};
+
+/**
+ */
+SAXParser.prototype.closetext$ = function () {
+ /** @type {!string} */
+ var text;
+ /** @type {!string} */
+ var text$0;
+ if (this.preTags === 0) {
+ text$0 = this.textNode;
+ text$0 = text$0.replace(/[\n\t]/g, ' ');
+ text$0 = text$0.replace(/\s\s+/g, " ");
+ text = text$0;
+ if (text$0) {
+ this.handler.ontext$S(text);
+ }
+ } else {
+ if (this.textNode) {
+ this.handler.ontext$S(this.textNode);
+ }
+ }
+ this.textNode = "";
+};
+
+/**
+ * @param {!string} text
+ * @return {!string}
+ */
+SAXParser.prototype.textopts$S = function (text) {
+ text = text.replace(/[\n\t]/g, ' ');
+ text = text.replace(/\s\s+/g, " ");
+ return text;
+};
+
+/**
+ * @param {!string} er
+ * @return {SAXParser}
+ */
+SAXParser.prototype.emiterror$S = function (er) {
+ /** @type {Error} */
+ var error;
+ this.closetext$();
+ er += "\nLine: " + (this.line + "") + "\nColumn: " + (this.column + "") + "\nChar: " + this.c;
+ error = new Error(er);
+ this.error = error;
+ return this;
+};
+
+/**
+ */
+SAXParser.prototype.end$ = function () {
+ if (! this.closedRoot) {
+ this.strictFail$S("Unclosed root tag");
+ }
+ if (this.state !== 2) {
+ this.emiterror$S("Unexpected end");
+ }
+ this.closetext$();
+ this.c = "";
+ this.closed = true;
+};
+
+/**
+ * @param {!string} message
+ */
+SAXParser.prototype.strictFail$S = function (message) {
+ if (this.strict) {
+ this.emiterror$S(message);
+ }
+};
+
+/**
+ */
+SAXParser.prototype.newTag$ = function () {
+ if (! this.strict) {
+ this.tagName = this.tagName.toLowerCase();
+ }
+ this.tag = ({name: this.tagName, attributes: ({ }), isSelfClosing: false});
+ this.attribList.length = 0;
+};
+
+/**
+ */
+SAXParser.prototype.attrib$ = function () {
+ if (! this.strict) {
+ this.attribName = this.attribName.toLowerCase();
+ }
+ if ($__jsx_ObjectHasOwnProperty.call(this.tag.attributes, this.attribName)) {
+ this.attribName = this.attribValue = "";
+ return;
+ }
+ this.tag.attributes[this.attribName] = this.attribValue;
+ this.closetext_if_exist$();
+ this.attribName = this.attribValue = "";
+};
+
+/**
+ */
+SAXParser.prototype.openTag$ = function () {
+ this.openTag$B(false);
+};
+
+/**
+ * @param {!boolean} selfClosing
+ */
+SAXParser.prototype.openTag$B = function (selfClosing) {
+ /** @type {Tag} */
+ var tag$0;
+ /** @type {Tag} */
+ var tag$1;
+ (tag$0 = this.tag).isSelfClosing = selfClosing;
+ this.sawRoot = true;
+ this.tags.push(tag$0);
+ this.closetext_if_exist$();
+ this.handler.onopentag$SHS((tag$1 = this.tag).name, tag$1.attributes);
+ if (this.tag.name === 'pre') {
+ this.preTags++;
+ }
+ if (! selfClosing) {
+ if (! this.noscript && this.tagName.toLowerCase() === "script") {
+ this.state = 33;
+ } else {
+ this.state = 2;
+ }
+ this.tag = null;
+ this.tagName = "";
+ }
+ this.attribName = this.attribValue = "";
+ this.attribList.length = 0;
+};
+
+/**
+ */
+SAXParser.prototype.closeTag$ = function () {
+ /** @type {!number} */
+ var t;
+ /** @type {!string} */
+ var tagName;
+ /** @type {!string} */
+ var closeTo;
+ /** @type {Tag} */
+ var close;
+ /** @type {!number} */
+ var s;
+ /** @type {Tag} */
+ var tag$0;
+ if (! this.tagName) {
+ this.strictFail$S("Weird empty close tag.");
+ this.textNode += "</>";
+ this.state = 2;
+ return;
+ }
+ if (this.script) {
+ if (this.tagName !== "script") {
+ this.script += "</" + this.tagName + ">";
+ this.tagName = "";
+ this.state = 33;
+ return;
+ }
+ this.closetext_if_exist$();
+ this.script = "";
+ }
+ t = this.tags.length;
+ tagName = this.tagName;
+ if (! this.strict) {
+ tagName = tagName.toLowerCase();
+ }
+ closeTo = tagName;
+ while (t--) {
+ close = this.tags[t];
+ if (close.name !== closeTo) {
+ this.strictFail$S("Unexpected close tag");
+ } else {
+ break;
+ }
+ }
+ if (t < 0) {
+ this.strictFail$S("Unmatched closing tag: " + this.tagName);
+ this.textNode += "</" + this.tagName + ">";
+ this.state = 2;
+ return;
+ }
+ this.tagName = tagName;
+ s = this.tags.length;
+ while (s-- > t) {
+ tag$0 = this.tag = this.tags.pop();
+ this.tagName = tag$0.name;
+ this.closetext_if_exist$();
+ this.handler.onclosetag$S(this.tagName);
+ if (this.tagName === 'pre') {
+ this.preTags--;
+ }
+ }
+ if (t === 0) {
+ this.closedRoot = true;
+ }
+ this.tagName = this.attribValue = this.attribName = "";
+ this.attribList.length = 0;
+ this.state = 2;
+};
+
+/**
+ * @return {!string}
+ */
+SAXParser.prototype.parseEntity$ = function () {
+ /** @type {!string} */
+ var entity;
+ /** @type {!string} */
+ var entityLC;
+ /** @type {!number} */
+ var num;
+ /** @type {!string} */
+ var numStr;
+ entity = this.entity;
+ entityLC = entity.toLowerCase();
+ num = 0;
+ numStr = "";
+ if (this.ENTITIES[entity]) {
+ return this.ENTITIES[entity];
+ }
+ if (this.ENTITIES[entityLC]) {
+ return this.ENTITIES[entityLC];
+ }
+ entity = entityLC;
+ if (entityLC.charAt(0) === "#") {
+ if (entity.charAt(1) === "x") {
+ entity = entity.slice(2);
+ num = $__jsx_parseInt(entity, 16);
+ numStr = num.toString(16);
+ } else {
+ entity = entity.slice(1);
+ num = $__jsx_parseInt(entity, 10);
+ numStr = num.toString(10);
+ }
+ }
+ entity = entity.replace(/^0+/, "");
+ if (numStr.toLowerCase() !== entity) {
+ this.strictFail$S("Invalid character entity");
+ return "&" + this.entity + ";";
+ }
+ return String.fromCharCode(num);
+};
+
+/**
+ * class Char extends Object
+ * @constructor
+ */
+function Char() {
+}
+
+/**
+ * @constructor
+ */
+function Char$() {
+ this.CDATA = "[CDATA[";
+ this.DOCTYPE = "DOCTYPE";
+ this.XML_NAMESPACE = "http://www.w3.org/XML/1998/namespace";
+ this.whitespace = this._charClass$S("\r\n\t ");
+ this.number = this._charClass$S("0124356789");
+ this.letter = this._charClass$S("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ");
+ this.quote = this._charClass$S("'\"");
+ this.entity = this._charClass$S("0124356789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ#");
+ this.attribEnd = this._charClass$S("\r\n\t >");
+ this.nameStart = /[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/;
+ this.nameBody = /[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040\.\d-]/;
+};
+
+Char$.prototype = new Char;
+
+/**
+ * @param {!string} str
+ * @return {Object.<string, undefined|!boolean>}
+ */
+Char.prototype._charClass$S = function (str) {
+ /** @type {Object.<string, undefined|!boolean>} */
+ var result;
+ /** @type {!number} */
+ var i;
+ result = ({ });
+ for (i = 0; i < str.length; i++) {
+ result[str.slice(i, i + 1)] = true;
+ }
+ return result;
+};
+
+/**
+ * @param {RegExp} charclass
+ * @param {!string} c
+ * @return {!boolean}
+ */
+Char.prototype.is$LRegExp$S = function (charclass, c) {
+ return charclass.test(c);
+};
+
+/**
+ * @param {Object.<string, undefined|!boolean>} charclass
+ * @param {!string} c
+ * @return {!boolean}
+ */
+Char.prototype.is$HBS = function (charclass, c) {
+ return $__jsx_ObjectHasOwnProperty.call(charclass, c);
+};
+
+/**
+ * @param {RegExp} charclass
+ * @param {!string} c
+ * @return {!boolean}
+ */
+Char.prototype.not$LRegExp$S = function (charclass, c) {
+ return ! charclass.test(c);
+};
+
+/**
+ * @param {Object.<string, undefined|!boolean>} charclass
+ * @param {!string} c
+ * @return {!boolean}
+ */
+Char.prototype.not$HBS = function (charclass, c) {
+ return ! $__jsx_ObjectHasOwnProperty.call(charclass, c);
+};
+
+/**
+ * class _Entities extends Object
+ * @constructor
+ */
+function _Entities() {
+}
+
+/**
+ * @constructor
+ */
+function _Entities$() {
+};
+
+_Entities$.prototype = new _Entities;
+
+/**
+ * @return {Object.<string, undefined|!string>}
+ */
+_Entities.entity_list$ = function () {
+ /** @type {Object.<string, undefined|!string>} */
+ var result;
+ /** @type {!string} */
+ var key;
+ /** @type {*} */
+ var value;
+ result = ({ });
+ for (key in _Entities._entities) {
+ value = _Entities._entities[key];
+ if (typeof value === 'string') {
+ result[key] = value + "";
+ } else {
+ if (typeof value === 'number') {
+ result[key] = String.fromCharCode(value | 0);
+ }
+ }
+ }
+ return result;
+};
+
+var _Entities$entity_list$ = _Entities.entity_list$;
+
+/**
+ * class BitVector extends Object
+ * @constructor
+ */
+function BitVector() {
+}
+
+/**
+ * @constructor
+ */
+function BitVector$() {
+ /** @type {Array.<undefined|!number>} */
+ var _v$0;
+ /** @type {Array.<undefined|!number>} */
+ var _r$0;
+ _r$0 = this._r = [ ];
+ _v$0 = this._v = [ ];
+ _v$0.length = 0;
+ _r$0.length = 0;
+ this._size = 0;
+ this._size1 = 0;
+};
+
+BitVector$.prototype = new BitVector;
+
+/**
+ */
+BitVector.prototype.build$ = function () {
+ /** @type {!number} */
+ var i;
+ this._size1 = 0;
+ for (i = 0; i < this._v.length; i++) {
+ if (i % 8 === 0) {
+ this._r.push(true ? this._size1 : this._size - this._size1);
+ }
+ this._size1 += this._rank32$IIB(this._v[i], 32, true);
+ }
+};
+
+/**
+ */
+BitVector.prototype.clear$ = function () {
+ this._v.length = 0;
+ this._r.length = 0;
+ this._size = 0;
+ this._size1 = 0;
+};
+
+/**
+ * @return {!number}
+ */
+BitVector.prototype.size$ = function () {
+ return this._size;
+};
+
+/**
+ * @param {!boolean} b
+ * @return {!number}
+ */
+BitVector.prototype.size$B = function (b) {
+ return (b ? this._size1 : this._size - this._size1);
+};
+
+/**
+ * @param {!number} value
+ */
+BitVector.prototype.set$I = function (value) {
+ this.set$IB(value, true);
+};
+
+/**
+ * @param {!number} value
+ * @param {!boolean} flag
+ */
+BitVector.prototype.set$IB = function (value, flag) {
+ /** @type {!number} */
+ var q;
+ /** @type {!number} */
+ var r;
+ /** @type {!number} */
+ var m;
+ if (value >= this._size) {
+ this._size = (value + 1 | 0);
+ }
+ q = (value / 32 | 0);
+ r = (value % 32 | 0);
+ while (q >= this._v.length) {
+ this._v.push(0);
+ }
+ m = 0x1 << r;
+ if (flag) {
+ this._v[q] |= m;
+ } else {
+ this._v[q] &= ~ m;
+ }
+};
+
+/**
+ * @param {!number} value
+ * @return {!boolean}
+ */
+BitVector.prototype.get$I = function (value) {
+ /** @type {!number} */
+ var q;
+ /** @type {!number} */
+ var r;
+ /** @type {!number} */
+ var m;
+ if (value >= this._size) {
+ throw new Error("BitVector.get() : range error");
+ }
+ q = (value / 32 | 0);
+ r = (value % 32 | 0);
+ m = 0x1 << r;
+ return !! (this._v[q] & m);
+};
+
+/**
+ * @param {!number} i
+ * @return {!number}
+ */
+BitVector.prototype.rank$I = function (i) {
+ return this.rank$IB(i, true);
+};
+
+/**
+ * @param {!number} i
+ * @param {!boolean} b
+ * @return {!number}
+ */
+BitVector.prototype.rank$IB = function (i, b) {
+ /** @type {!number} */
+ var q_large;
+ /** @type {!number} */
+ var q_small;
+ /** @type {!number} */
+ var r;
+ /** @type {!number} */
+ var rank;
+ /** @type {!number} */
+ var begin;
+ /** @type {!number} */
+ var j;
+ if (i > this._size) {
+ throw new Error("BitVector.rank() : range error");
+ }
+ if (i === 0) {
+ return 0;
+ }
+ i--;
+ q_large = (Math.floor(i / 256) | 0);
+ q_small = (Math.floor(i / 32) | 0);
+ r = (Math.floor(i % 32) | 0);
+ rank = (this._r[q_large] | 0);
+ if (! b) {
+ rank = q_large * 256 - rank;
+ }
+ begin = q_large * 8;
+ for (j = begin; j < q_small; j++) {
+ rank += this._rank32$IIB(this._v[j], 32, b);
+ }
+ rank += this._rank32$IIB(this._v[q_small], r + 1, b);
+ return rank;
+};
+
+/**
+ * @param {!number} i
+ * @return {!number}
+ */
+BitVector.prototype.select$I = function (i) {
+ return this.select$IB(i, true);
+};
+
+/**
+ * @param {!number} i
+ * @param {!boolean} b
+ * @return {!number}
+ */
+BitVector.prototype.select$IB = function (i, b) {
+ /** @type {!number} */
+ var left;
+ /** @type {!number} */
+ var right;
+ /** @type {!number} */
+ var pivot;
+ /** @type {undefined|!number} */
+ var rank;
+ /** @type {!number} */
+ var j;
+ if (i >= (b ? this._size1 : this._size - this._size1)) {
+ throw new Error("BitVector.select() : range error");
+ }
+ left = 0;
+ right = this._r.length;
+ while (left < right) {
+ pivot = Math.floor((left + right) / 2);
+ rank = this._r[pivot];
+ if (! b) {
+ rank = pivot * 256 - rank;
+ }
+ if (i < rank) {
+ right = pivot;
+ } else {
+ left = pivot + 1;
+ }
+ }
+ right--;
+ if (b) {
+ i -= (this._r[right] | 0);
+ } else {
+ i -= (right * 256 - this._r[right] | 0);
+ }
+ j = right * 8;
+ while (1) {
+ rank = this._rank32$IIB(this._v[j], 32, b);
+ if (i < rank) {
+ break;
+ }
+ j++;
+ i -= (rank | 0);
+ }
+ return (j * 32 + this._select32$IIB(this._v[j], i, b) | 0);
+};
+
+/**
+ * @param {!number} x
+ * @param {!number} i
+ * @param {!boolean} b
+ * @return {!number}
+ */
+BitVector.prototype._rank32$IIB = function (x, i, b) {
+ if (! b) {
+ x = ~ x;
+ }
+ x <<= 32 - i;
+ x = ((x & 0xaaaaaaaa) >>> 1) + (x & 0x55555555);
+ x = ((x & 0xcccccccc) >>> 2) + (x & 0x33333333);
+ x = ((x & 0xf0f0f0f0) >>> 4) + (x & 0x0f0f0f0f);
+ x = ((x & 0xff00ff00) >>> 8) + (x & 0x00ff00ff);
+ x = ((x & 0xffff0000) >>> 16) + (x & 0x0000ffff);
+ return x;
+};
+
+/**
+ * @param {!number} x
+ * @param {!number} i
+ * @param {!boolean} b
+ * @return {!number}
+ */
+BitVector.prototype._select32$IIB = function (x, i, b) {
+ /** @type {!number} */
+ var x1;
+ /** @type {!number} */
+ var x2;
+ /** @type {!number} */
+ var x3;
+ /** @type {!number} */
+ var x4;
+ /** @type {!number} */
+ var x5;
+ /** @type {!number} */
+ var pos;
+ /** @type {!number} */
+ var v5;
+ /** @type {!number} */
+ var v4;
+ /** @type {!number} */
+ var v3;
+ /** @type {!number} */
+ var v2;
+ /** @type {!number} */
+ var v1;
+ /** @type {!number} */
+ var v0;
+ if (! b) {
+ x = ~ x;
+ }
+ x1 = ((x & 0xaaaaaaaa) >>> 1) + (x & 0x55555555);
+ x2 = ((x1 & 0xcccccccc) >>> 2) + (x1 & 0x33333333);
+ x3 = ((x2 & 0xf0f0f0f0) >>> 4) + (x2 & 0x0f0f0f0f);
+ x4 = ((x3 & 0xff00ff00) >>> 8) + (x3 & 0x00ff00ff);
+ x5 = ((x4 & 0xffff0000) >>> 16) + (x4 & 0x0000ffff);
+ i++;
+ pos = 0;
+ v5 = x5 & 0xffffffff;
+ if (i > v5) {
+ i -= (v5 | 0);
+ pos += 32;
+ }
+ v4 = x4 >>> pos & 0x0000ffff;
+ if (i > v4) {
+ i -= (v4 | 0);
+ pos += 16;
+ }
+ v3 = x3 >>> pos & 0x000000ff;
+ if (i > v3) {
+ i -= (v3 | 0);
+ pos += 8;
+ }
+ v2 = x2 >>> pos & 0x0000000f;
+ if (i > v2) {
+ i -= (v2 | 0);
+ pos += 4;
+ }
+ v1 = x1 >>> pos & 0x00000003;
+ if (i > v1) {
+ i -= (v1 | 0);
+ pos += 2;
+ }
+ v0 = x >>> pos & 0x00000001;
+ if (i > v0) {
+ i -= (v0 | 0);
+ pos += 1;
+ }
+ return (pos | 0);
+};
+
+/**
+ * @return {!string}
+ */
+BitVector.prototype.dump$ = function () {
+ /** @type {Array.<undefined|!string>} */
+ var contents;
+ contents = [ ];
+ contents.push(Binary$dump32bitNumber$N(this._size));
+ contents.push(Binary$dump32bitNumberList$AN(this._v));
+ return contents.join('');
+};
+
+/**
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+BitVector.prototype.dump$LCompressionReport$ = function (report) {
+ /** @type {Array.<undefined|!string>} */
+ var contents;
+ contents = [ ];
+ contents.push(Binary$dump32bitNumber$N(this._size));
+ CompressionReport$add$LCompressionReport$II(report, 2, 2);
+ contents.push(Binary$dump32bitNumberList$ANLCompressionReport$(this._v, report));
+ return contents.join('');
+};
+
+/**
+ * @param {!string} data
+ * @return {!number}
+ */
+BitVector.prototype.load$S = function (data) {
+ return this.load$SI(data, 0);
+};
+
+/**
+ * @param {!string} data
+ * @param {!number} offset
+ * @return {!number}
+ */
+BitVector.prototype.load$SI = function (data, offset) {
+ /** @type {LoadedNumberListResult} */
+ var result;
+ /** @type {!number} */
+ var result$0;
+ this._v.length = 0;
+ this._r.length = 0;
+ this._size = 0;
+ this._size1 = 0;
+ result$0 = data.charCodeAt(offset) * 65536 + data.charCodeAt(offset + 1);
+ this._size = (result$0 | 0);
+ result = Binary$load32bitNumberList$SI(data, offset + 2);
+ this._v = result.result;
+ this.build$();
+ return result.offset;
+};
+
+/**
+ * class WaveletMatrix extends Object
+ * @constructor
+ */
+function WaveletMatrix() {
+}
+
+/**
+ * @constructor
+ */
+function WaveletMatrix$() {
+ /** @type {Array.<undefined|BitVector>} */
+ var _bv$0;
+ /** @type {Array.<undefined|!number>} */
+ var _seps$0;
+ this._range = ({ });
+ _bv$0 = this._bv = [ ];
+ _seps$0 = this._seps = [ ];
+ this._bitsize = 16;
+ _bv$0.length = 0;
+ _seps$0.length = 0;
+ this._size = 0;
+};
+
+WaveletMatrix$.prototype = new WaveletMatrix;
+
+/**
+ * @return {!number}
+ */
+WaveletMatrix.prototype.bitsize$ = function () {
+ return this._bitsize;
+};
+
+/**
+ * @param {!number} charCode
+ */
+WaveletMatrix.prototype.setMaxCharCode$I = function (charCode) {
+ this._bitsize = (Math.ceil(Math.log(charCode) / 0.6931471805599453) | 0);
+};
+
+/**
+ */
+WaveletMatrix.prototype.clear$ = function () {
+ this._bv.length = 0;
+ this._seps.length = 0;
+ this._size = 0;
+};
+
+/**
+ * @param {!string} v
+ */
+WaveletMatrix.prototype.build$S = function (v) {
+ /** @type {!number} */
+ var size;
+ /** @type {!number} */
+ var bitsize;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var depth;
+ /** @type {Object.<string, undefined|!number>} */
+ var range_tmp;
+ /** @type {!number} */
+ var code;
+ /** @type {!boolean} */
+ var bit;
+ /** @type {!number} */
+ var key;
+ /** @type {Object.<string, undefined|!number>} */
+ var range_rev;
+ /** @type {!string} */
+ var range_key;
+ /** @type {!number} */
+ var value;
+ /** @type {!number} */
+ var pos0;
+ /** @type {undefined|!number} */
+ var pos1;
+ /** @type {!string} */
+ var range_rev_key;
+ /** @type {!number} */
+ var begin;
+ /** @type {undefined|!number} */
+ var end;
+ /** @type {!number} */
+ var num0;
+ /** @type {!number} */
+ var num1;
+ this._bv.length = 0;
+ this._seps.length = 0;
+ this._size = 0;
+ size = v.length;
+ bitsize = this._bitsize;
+ for (i = 0; i < bitsize; i++) {
+ this._bv.push(new BitVector$());
+ this._seps.push(0);
+ }
+ this._size = (size | 0);
+ for (i = 0; i < size; i++) {
+ this._bv[0].set$IB(i, this._uint2bit$II(v.charCodeAt(i), 0));
+ }
+ this._bv[0].build$();
+ this._seps[0] = this._bv[0].size$B(false);
+ this._range["0"] = 0;
+ this._range["1"] = this._seps[0];
+ depth = 1;
+ while (depth < bitsize) {
+ range_tmp = WaveletMatrix$_shallow_copy$HI(this._range);
+ for (i = 0; i < size; i++) {
+ code = v.charCodeAt(i);
+ bit = this._uint2bit$II(code, depth);
+ key = code >>> bitsize - depth;
+ this._bv[depth].set$IB(range_tmp[key + ""], bit);
+ range_tmp[key + ""]++;
+ }
+ this._bv[depth].build$();
+ this._seps[depth] = this._bv[depth].size$B(false);
+ range_rev = ({ });
+ for (range_key in this._range) {
+ value = this._range[range_key];
+ if (value != range_tmp[range_key]) {
+ range_rev[value + ""] = range_key | 0;
+ }
+ }
+ this._range = ({ });
+ pos0 = 0;
+ pos1 = this._seps[depth];
+ for (range_rev_key in range_rev) {
+ begin = range_rev_key | 0;
+ value = range_rev[range_rev_key];
+ end = range_tmp[value + ""];
+ num0 = this._bv[depth].rank$IB(end, false) - this._bv[depth].rank$IB(begin, false);
+ num1 = end - begin - num0;
+ if (num0 > 0) {
+ this._range[(value << 1) + ""] = (pos0 | 0);
+ pos0 += num0;
+ }
+ if (num1 > 0) {
+ this._range[(value << 1) + 1 + ""] = pos1;
+ pos1 += (num1 | 0);
+ }
+ }
+ depth++;
+ }
+};
+
+/**
+ * @return {!number}
+ */
+WaveletMatrix.prototype.size$ = function () {
+ return this._size;
+};
+
+/**
+ * @param {!number} c
+ * @return {!number}
+ */
+WaveletMatrix.prototype.size$I = function (c) {
+ return this.rank$II(this._size, c);
+};
+
+/**
+ * @param {!number} i
+ * @return {!number}
+ */
+WaveletMatrix.prototype.get$I = function (i) {
+ /** @type {!number} */
+ var value;
+ /** @type {!number} */
+ var depth;
+ /** @type {!boolean} */
+ var bit;
+ if (i >= this._size) {
+ throw new Error("WaveletMatrix.get() : range error");
+ }
+ value = 0;
+ depth = 0;
+ while (depth < this._bitsize) {
+ bit = this._bv[depth].get$I(i);
+ i = this._bv[depth].rank$IB(i, bit);
+ value <<= 1;
+ if (bit) {
+ i += this._seps[depth];
+ value += 1;
+ }
+ depth++;
+ }
+ return (value | 0);
+};
+
+/**
+ * @param {!number} i
+ * @param {!number} c
+ * @return {!number}
+ */
+WaveletMatrix.prototype.rank$II = function (i, c) {
+ /** @type {undefined|!number} */
+ var begin;
+ /** @type {!number} */
+ var end;
+ /** @type {!number} */
+ var depth;
+ /** @type {!boolean} */
+ var bit;
+ if (i > this._size) {
+ throw new Error("WaveletMatrix.rank(): range error");
+ }
+ if (i === 0) {
+ return 0;
+ }
+ begin = this._range[c + ""];
+ if (begin == null) {
+ return 0;
+ }
+ end = i;
+ depth = 0;
+ while (depth < this._bitsize) {
+ bit = this._uint2bit$II(c, depth);
+ end = this._bv[depth].rank$IB(end, bit);
+ if (bit) {
+ end += this._seps[depth];
+ }
+ depth++;
+ }
+ return (end - begin | 0);
+};
+
+/**
+ * @param {!number} i
+ * @param {!number} c
+ * @return {!number}
+ */
+WaveletMatrix.prototype.rank_less_than$II = function (i, c) {
+ /** @type {!number} */
+ var begin;
+ /** @type {!number} */
+ var end;
+ /** @type {!number} */
+ var depth;
+ /** @type {!number} */
+ var rlt;
+ /** @type {!number} */
+ var rank0_begin;
+ /** @type {!number} */
+ var rank0_end;
+ /** @type {Array.<undefined|!number>} */
+ var _seps$0;
+ if (i > this._size) {
+ throw new Error("WaveletMatrix.rank_less_than(): range error");
+ }
+ if (i === 0) {
+ return 0;
+ }
+ begin = 0;
+ end = i;
+ depth = 0;
+ rlt = 0;
+ while (depth < this._bitsize) {
+ rank0_begin = this._bv[depth].rank$IB(begin, false);
+ rank0_end = this._bv[depth].rank$IB(end, false);
+ if (this._uint2bit$II(c, depth)) {
+ rlt += rank0_end - rank0_begin;
+ begin += (_seps$0 = this._seps)[depth] - rank0_begin;
+ end += _seps$0[depth] - rank0_end;
+ } else {
+ begin = rank0_begin;
+ end = rank0_end;
+ }
+ depth++;
+ }
+ return (rlt | 0);
+};
+
+/**
+ * @return {!string}
+ */
+WaveletMatrix.prototype.dump$ = function () {
+ /** @type {Array.<undefined|!string>} */
+ var contents;
+ /** @type {!number} */
+ var i;
+ /** @type {Array.<undefined|!string>} */
+ var range_contents;
+ /** @type {!number} */
+ var counter;
+ /** @type {!string} */
+ var key;
+ contents = [ Binary$dump16bitNumber$I(this._bitsize), Binary$dump32bitNumber$N(this._size) ];
+ for (i = 0; i < this._bitsize; i++) {
+ contents.push(this._bv[i].dump$());
+ }
+ for (i = 0; i < this._bitsize; i++) {
+ contents.push(Binary$dump32bitNumber$N(this._seps[i]));
+ }
+ range_contents = [ ];
+ counter = 0;
+ for (key in this._range) {
+ range_contents.push(Binary$dump32bitNumber$N(key | 0));
+ range_contents.push(Binary$dump32bitNumber$N(this._range[key]));
+ counter++;
+ }
+ contents.push(Binary$dump32bitNumber$N(counter));
+ return contents.join('') + range_contents.join('');
+};
+
+/**
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+WaveletMatrix.prototype.dump$LCompressionReport$ = function (report) {
+ /** @type {Array.<undefined|!string>} */
+ var contents;
+ /** @type {!number} */
+ var i;
+ /** @type {Array.<undefined|!string>} */
+ var range_contents;
+ /** @type {!number} */
+ var counter;
+ /** @type {!string} */
+ var key;
+ contents = [ Binary$dump16bitNumber$I(this._bitsize), Binary$dump32bitNumber$N(this._size) ];
+ CompressionReport$add$LCompressionReport$II(report, 3, 3);
+ for (i = 0; i < this._bitsize; i++) {
+ contents.push(this._bv[i].dump$LCompressionReport$(report));
+ }
+ for (i = 0; i < this._bitsize; i++) {
+ contents.push(Binary$dump32bitNumber$N(this._seps[i]));
+ CompressionReport$add$LCompressionReport$II(report, 2, 2);
+ }
+ range_contents = [ ];
+ counter = 0;
+ for (key in this._range) {
+ range_contents.push(Binary$dump32bitNumber$N(key | 0));
+ range_contents.push(Binary$dump32bitNumber$N(this._range[key]));
+ CompressionReport$add$LCompressionReport$II(report, 4, 4);
+ counter++;
+ }
+ CompressionReport$add$LCompressionReport$II(report, 2, 2);
+ contents.push(Binary$dump32bitNumber$N(counter));
+ return contents.join('') + range_contents.join('');
+};
+
+/**
+ * @param {!string} data
+ * @return {!number}
+ */
+WaveletMatrix.prototype.load$S = function (data) {
+ return this.load$SI(data, 0);
+};
+
+/**
+ * @param {!string} data
+ * @param {!number} offset
+ * @return {!number}
+ */
+WaveletMatrix.prototype.load$SI = function (data, offset) {
+ /** @type {!number} */
+ var i;
+ /** @type {BitVector} */
+ var bit_vector;
+ /** @type {!number} */
+ var range_size;
+ /** @type {!number} */
+ var value;
+ /** @type {!number} */
+ var offset$0;
+ /** @type {!number} */
+ var result$0;
+ /** @type {!number} */
+ var result$1;
+ /** @type {!number} */
+ var result$2;
+ this._bv.length = 0;
+ this._seps.length = 0;
+ this._size = 0;
+ offset$0 = offset++;
+ this._bitsize = (data.charCodeAt(offset$0) | 0);
+ result$0 = data.charCodeAt(offset) * 65536 + data.charCodeAt(offset + 1);
+ this._size = (result$0 | 0);
+ offset += 2;
+ for (i = 0; i < this._bitsize; i++) {
+ bit_vector = new BitVector$();
+ offset = bit_vector.load$SI(data, offset);
+ this._bv.push(bit_vector);
+ }
+ for (i = 0; i < this._bitsize; (i++, offset += 2)) {
+ this._seps.push(Binary$load32bitNumber$SI(data, offset));
+ }
+ result$1 = data.charCodeAt(offset) * 65536 + data.charCodeAt(offset + 1);
+ range_size = result$1;
+ offset += 2;
+ for (i = 0; i < range_size; (i++, offset += 4)) {
+ result$2 = data.charCodeAt(offset) * 65536 + data.charCodeAt(offset + 1);
+ value = Binary$load32bitNumber$SI(data, offset + 2);
+ this._range[result$2 + ""] = (value | 0);
+ }
+ return offset;
+};
+
+/**
+ * @param {Object.<string, undefined|!number>} input
+ * @return {Object.<string, undefined|!number>}
+ */
+WaveletMatrix._shallow_copy$HI = function (input) {
+ /** @type {Object.<string, undefined|!number>} */
+ var result;
+ /** @type {!string} */
+ var key;
+ result = ({ });
+ for (key in input) {
+ result[key] = input[key];
+ }
+ return result;
+};
+
+var WaveletMatrix$_shallow_copy$HI = WaveletMatrix._shallow_copy$HI;
+
+/**
+ * @param {!number} c
+ * @param {!number} i
+ * @return {!boolean}
+ */
+WaveletMatrix.prototype._uint2bit$II = function (c, i) {
+ return (c >>> this._bitsize - 1 - i & 0x1) === 0x1;
+};
+
+/**
+ * class BurrowsWheelerTransform extends Object
+ * @constructor
+ */
+function BurrowsWheelerTransform() {
+}
+
+/**
+ * @constructor
+ */
+function BurrowsWheelerTransform$() {
+ this._str = "";
+ this._size = 0;
+ this._head = 0;
+ this._suffixarray = [ ];
+};
+
+BurrowsWheelerTransform$.prototype = new BurrowsWheelerTransform;
+
+/**
+ * @param {BurrowsWheelerTransform} $this
+ * @return {!number}
+ */
+BurrowsWheelerTransform.size$LBurrowsWheelerTransform$ = function ($this) {
+ return $this._size;
+};
+
+var BurrowsWheelerTransform$size$LBurrowsWheelerTransform$ = BurrowsWheelerTransform.size$LBurrowsWheelerTransform$;
+
+/**
+ * @param {BurrowsWheelerTransform} $this
+ * @return {!number}
+ */
+BurrowsWheelerTransform.head$LBurrowsWheelerTransform$ = function ($this) {
+ return $this._head;
+};
+
+var BurrowsWheelerTransform$head$LBurrowsWheelerTransform$ = BurrowsWheelerTransform.head$LBurrowsWheelerTransform$;
+
+/**
+ * @param {BurrowsWheelerTransform} $this
+ */
+BurrowsWheelerTransform.clear$LBurrowsWheelerTransform$ = function ($this) {
+ $this._str = "";
+ $this._size = 0;
+ $this._head = 0;
+ $this._suffixarray.length = 0;
+};
+
+var BurrowsWheelerTransform$clear$LBurrowsWheelerTransform$ = BurrowsWheelerTransform.clear$LBurrowsWheelerTransform$;
+
+/**
+ * @param {BurrowsWheelerTransform} $this
+ * @param {!string} str
+ */
+BurrowsWheelerTransform.build$LBurrowsWheelerTransform$S = function ($this, str) {
+ /** @type {!string} */
+ var _str$0;
+ /** @type {Array.<undefined|!number>} */
+ var _suffixarray$0;
+ _str$0 = $this._str = str;
+ $this._size = _str$0.length;
+ _suffixarray$0 = $this._suffixarray = SAIS$make$S(str);
+ $this._head = (_suffixarray$0.indexOf(0) | 0);
+};
+
+var BurrowsWheelerTransform$build$LBurrowsWheelerTransform$S = BurrowsWheelerTransform.build$LBurrowsWheelerTransform$S;
+
+/**
+ * @param {BurrowsWheelerTransform} $this
+ * @param {!number} i
+ * @return {!string}
+ */
+BurrowsWheelerTransform.get$LBurrowsWheelerTransform$I = function ($this, i) {
+ /** @type {!number} */
+ var size;
+ /** @type {!number} */
+ var index;
+ size = $this._size;
+ if (i >= size) {
+ throw new Error("BurrowsWheelerTransform.get() : range error");
+ }
+ index = ($this._suffixarray[i] + size - 1) % size;
+ return $this._str.charAt(index);
+};
+
+var BurrowsWheelerTransform$get$LBurrowsWheelerTransform$I = BurrowsWheelerTransform.get$LBurrowsWheelerTransform$I;
+
+/**
+ * @param {BurrowsWheelerTransform} $this
+ * @return {!string}
+ */
+BurrowsWheelerTransform.get$LBurrowsWheelerTransform$ = function ($this) {
+ /** @type {Array.<undefined|!string>} */
+ var str;
+ /** @type {!number} */
+ var size;
+ /** @type {!number} */
+ var i;
+ str = [ ];
+ size = $this._size;
+ for (i = 0; i < size; i++) {
+ str.push(BurrowsWheelerTransform$get$LBurrowsWheelerTransform$I($this, i));
+ }
+ return str.join("");
+};
+
+var BurrowsWheelerTransform$get$LBurrowsWheelerTransform$ = BurrowsWheelerTransform.get$LBurrowsWheelerTransform$;
+
+/**
+ * @param {BurrowsWheelerTransform} $this
+ * @param {!string} replace
+ * @return {!string}
+ */
+BurrowsWheelerTransform.get$LBurrowsWheelerTransform$S = function ($this, replace) {
+ /** @type {!string} */
+ var result;
+ result = BurrowsWheelerTransform$get$LBurrowsWheelerTransform$($this);
+ return result.replace(BurrowsWheelerTransform.END_MARKER, replace);
+};
+
+var BurrowsWheelerTransform$get$LBurrowsWheelerTransform$S = BurrowsWheelerTransform.get$LBurrowsWheelerTransform$S;
+
+/**
+ * class OArray extends Object
+ * @constructor
+ */
+function OArray() {
+}
+
+/**
+ * @constructor
+ * @param {Array.<undefined|!number>} array
+ */
+function OArray$AI(array) {
+ this.array = array;
+ this.offset = 0;
+};
+
+OArray$AI.prototype = new OArray;
+
+/**
+ * @constructor
+ * @param {Array.<undefined|!number>} array
+ * @param {!number} offset
+ */
+function OArray$AII(array, offset) {
+ this.array = array;
+ this.offset = offset;
+};
+
+OArray$AII.prototype = new OArray;
+
+/**
+ * @param {OArray} $this
+ * @param {!number} index
+ * @return {!number}
+ */
+OArray.get$LOArray$I = function ($this, index) {
+ return $this.array[index + $this.offset];
+};
+
+var OArray$get$LOArray$I = OArray.get$LOArray$I;
+
+/**
+ * @param {OArray} $this
+ * @param {!number} index
+ * @param {!number} value
+ */
+OArray.set$LOArray$II = function ($this, index, value) {
+ $this.array[index + $this.offset] = value;
+};
+
+var OArray$set$LOArray$II = OArray.set$LOArray$II;
+
+/**
+ * @param {OArray} $this
+ * @param {!number} index
+ * @return {!boolean}
+ */
+OArray.isS$LOArray$I = function ($this, index) {
+ /** @type {Array.<undefined|!number>} */
+ var array$0;
+ /** @type {!number} */
+ var offset$0;
+ return (array$0 = $this.array)[index + (offset$0 = $this.offset)] < array$0[index + offset$0 + 1];
+};
+
+var OArray$isS$LOArray$I = OArray.isS$LOArray$I;
+
+/**
+ * @param {OArray} $this
+ * @param {!number} index1
+ * @param {!number} index2
+ * @return {!boolean}
+ */
+OArray.compare$LOArray$II = function ($this, index1, index2) {
+ /** @type {Array.<undefined|!number>} */
+ var array$0;
+ /** @type {!number} */
+ var offset$0;
+ return (array$0 = $this.array)[index1 + (offset$0 = $this.offset)] == array$0[index2 + offset$0];
+};
+
+var OArray$compare$LOArray$II = OArray.compare$LOArray$II;
+
+/**
+ * class SAIS extends Object
+ * @constructor
+ */
+function SAIS() {
+}
+
+/**
+ * @constructor
+ */
+function SAIS$() {
+};
+
+SAIS$.prototype = new SAIS;
+
+/**
+ * @param {BitVector} t
+ * @param {!number} i
+ * @return {!boolean}
+ */
+SAIS._isLMS$LBitVector$I = function (t, i) {
+ return i > 0 && t.get$I(i) && ! t.get$I(i - 1);
+};
+
+var SAIS$_isLMS$LBitVector$I = SAIS._isLMS$LBitVector$I;
+
+/**
+ * @param {OArray} s
+ * @param {Array.<undefined|!number>} bkt
+ * @param {!number} n
+ * @param {!number} K
+ * @param {!boolean} end
+ */
+SAIS._getBuckets$LOArray$AIIIB = function (s, bkt, n, K, end) {
+ /** @type {!number} */
+ var sum;
+ /** @type {!number} */
+ var i;
+ sum = 0;
+ for (i = 0; i <= K; i++) {
+ bkt[i] = 0;
+ }
+ for (i = 0; i < n; i++) {
+ bkt[OArray$get$LOArray$I(s, i)]++;
+ }
+ for (i = 0; i <= K; i++) {
+ sum += bkt[i];
+ bkt[i] = ((end ? sum : sum - bkt[i]) | 0);
+ }
+};
+
+var SAIS$_getBuckets$LOArray$AIIIB = SAIS._getBuckets$LOArray$AIIIB;
+
+/**
+ * @param {BitVector} t
+ * @param {Array.<undefined|!number>} SA
+ * @param {OArray} s
+ * @param {Array.<undefined|!number>} bkt
+ * @param {!number} n
+ * @param {!number} K
+ * @param {!boolean} end
+ */
+SAIS._induceSAl$LBitVector$AILOArray$AIIIB = function (t, SA, s, bkt, n, K, end) {
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var j;
+ SAIS$_getBuckets$LOArray$AIIIB(s, bkt, n, K, end);
+ for (i = 0; i < n; i++) {
+ j = SA[i] - 1;
+ if (j >= 0 && ! t.get$I(j)) {
+ SA[bkt[OArray$get$LOArray$I(s, j)]++] = (j | 0);
+ }
+ }
+};
+
+var SAIS$_induceSAl$LBitVector$AILOArray$AIIIB = SAIS._induceSAl$LBitVector$AILOArray$AIIIB;
+
+/**
+ * @param {BitVector} t
+ * @param {Array.<undefined|!number>} SA
+ * @param {OArray} s
+ * @param {Array.<undefined|!number>} bkt
+ * @param {!number} n
+ * @param {!number} K
+ * @param {!boolean} end
+ */
+SAIS._induceSAs$LBitVector$AILOArray$AIIIB = function (t, SA, s, bkt, n, K, end) {
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var j;
+ SAIS$_getBuckets$LOArray$AIIIB(s, bkt, n, K, end);
+ for (i = n - 1; i >= 0; i--) {
+ j = SA[i] - 1;
+ if (j >= 0 && t.get$I(j)) {
+ SA[-- bkt[OArray$get$LOArray$I(s, j)]] = (j | 0);
+ }
+ }
+};
+
+var SAIS$_induceSAs$LBitVector$AILOArray$AIIIB = SAIS._induceSAs$LBitVector$AILOArray$AIIIB;
+
+/**
+ * @param {!string} source
+ * @return {Array.<undefined|!number>}
+ */
+SAIS.make$S = function (source) {
+ /** @type {Array.<undefined|!number>} */
+ var charCodes;
+ /** @type {!number} */
+ var maxCode;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var code;
+ /** @type {Array.<undefined|!number>} */
+ var SA;
+ /** @type {OArray} */
+ var s;
+ charCodes = [ ];
+ charCodes.length = source.length;
+ maxCode = 0;
+ for (i = 0; i < source.length; i++) {
+ code = source.charCodeAt(i);
+ charCodes[i] = (code | 0);
+ maxCode = (code > maxCode ? code : maxCode);
+ }
+ SA = [ ];
+ SA.length = source.length;
+ s = ({offset: 0, array: charCodes});
+ SAIS$_make$LOArray$AIII(s, SA, source.length, maxCode);
+ return SA;
+};
+
+var SAIS$make$S = SAIS.make$S;
+
+/**
+ * @param {OArray} s
+ * @param {Array.<undefined|!number>} SA
+ * @param {!number} n
+ * @param {!number} K
+ */
+SAIS._make$LOArray$AIII = function (s, SA, n, K) {
+ /** @type {BitVector} */
+ var t;
+ /** @type {!number} */
+ var i;
+ /** @type {Array.<undefined|!number>} */
+ var bkt;
+ /** @type {!number} */
+ var n1;
+ /** @type {!number} */
+ var name;
+ /** @type {!number} */
+ var prev;
+ /** @type {undefined|!number} */
+ var pos;
+ /** @type {!boolean} */
+ var diff;
+ /** @type {!number} */
+ var d;
+ /** @type {!number} */
+ var j;
+ /** @type {Array.<undefined|!number>} */
+ var SA1;
+ /** @type {OArray} */
+ var s1;
+ /** @type {!number} */
+ var i$0;
+ /** @type {!number} */
+ var index$0;
+ t = new BitVector$();
+ t.set$IB(n - 2, false);
+ t.set$IB(n - 1, true);
+ for (i = n - 3; i >= 0; i--) {
+ t.set$IB(i, OArray$isS$LOArray$I(s, i) || OArray$compare$LOArray$II(s, i, i + 1) && t.get$I(i + 1));
+ }
+ bkt = [ ];
+ bkt.length = K + 1;
+ SAIS$_getBuckets$LOArray$AIIIB(s, bkt, n, K, true);
+ for (i = 0; i < n; i++) {
+ SA[i] = -1;
+ }
+ for (i = 1; i < n; i++) {
+ if (SAIS$_isLMS$LBitVector$I(t, i)) {
+ SA[-- bkt[OArray$get$LOArray$I(s, i)]] = (i | 0);
+ }
+ }
+ SAIS$_induceSAl$LBitVector$AILOArray$AIIIB(t, SA, s, bkt, n, K, false);
+ SAIS$_induceSAs$LBitVector$AILOArray$AIIIB(t, SA, s, bkt, n, K, true);
+ n1 = 0;
+ for (i = 0; i < n; i++) {
+ i$0 = SA[i];
+ if (i$0 > 0 && t.get$I(i$0) && ! t.get$I(i$0 - 1)) {
+ SA[n1++] = SA[i];
+ }
+ }
+ for (i = n1; i < n; i++) {
+ SA[i] = -1;
+ }
+ name = 0;
+ prev = -1;
+ for (i = 0; i < n1; i++) {
+ pos = SA[i];
+ diff = false;
+ for (d = 0; d < n; d++) {
+ if (prev === -1 || ! OArray$compare$LOArray$II(s, pos + d, prev + d) || t.get$I(pos + d) !== t.get$I(prev + d)) {
+ diff = true;
+ break;
+ } else {
+ if (d > 0 && (SAIS$_isLMS$LBitVector$I(t, pos + d) || SAIS$_isLMS$LBitVector$I(t, prev + d))) {
+ break;
+ }
+ }
+ }
+ if (diff) {
+ name++;
+ prev = pos;
+ }
+ pos = ((pos % 2 === 0 ? pos / 2 : (pos - 1) / 2) | 0);
+ SA[n1 + pos] = (name - 1 | 0);
+ }
+ for ((i = n - 1, j = n - 1); i >= n1; i--) {
+ if (SA[i] >= 0) {
+ SA[j--] = SA[i];
+ }
+ }
+ SA1 = SA;
+ s1 = ({offset: n - n1, array: SA});
+ if (name < n1) {
+ SAIS$_make$LOArray$AIII(s1, SA1, n1, name - 1);
+ } else {
+ for (i = 0; i < n1; i++) {
+ SA1[OArray$get$LOArray$I(s1, i)] = (i | 0);
+ }
+ }
+ bkt = [ ];
+ bkt.length = K + 1;
+ SAIS$_getBuckets$LOArray$AIIIB(s, bkt, n, K, true);
+ for ((i = 1, j = 0); i < n; i++) {
+ if (SAIS$_isLMS$LBitVector$I(t, i)) {
+ OArray$set$LOArray$II(s1, j++, i);
+ }
+ }
+ for (i = 0; i < n1; i++) {
+ index$0 = SA1[i];
+ SA1[i] = s1.array[index$0 + s1.offset];
+ }
+ for (i = n1; i < n; i++) {
+ SA[i] = -1;
+ }
+ for (i = n1 - 1; i >= 0; i--) {
+ j = SA[i];
+ SA[i] = -1;
+ SA[-- bkt[OArray$get$LOArray$I(s, j)]] = (j | 0);
+ }
+ SAIS$_induceSAl$LBitVector$AILOArray$AIIIB(t, SA, s, bkt, n, K, false);
+ SAIS$_induceSAs$LBitVector$AILOArray$AIIIB(t, SA, s, bkt, n, K, true);
+};
+
+var SAIS$_make$LOArray$AIII = SAIS._make$LOArray$AIII;
+
+OktaviaSearch._stemmer = null;
+OktaviaSearch._instance = null;
+$__jsx_lazy_init(Oktavia, "eof", function () {
+ return String.fromCharCode(0);
+});
+$__jsx_lazy_init(Oktavia, "eob", function () {
+ return String.fromCharCode(1);
+});
+$__jsx_lazy_init(Oktavia, "unknown", function () {
+ return String.fromCharCode(3);
+});
+Binary._base64EncodeChars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
+$__jsx_lazy_init(Binary, "_base64DecodeChars", function () {
+ return [ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 62, -1, -1, -1, 63, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, -1, -1, -1, -1, -1, -1, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -1, -1, -1, -1, -1, -1, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, -1, -1, -1, -1 ];
+});
+$__jsx_lazy_init(Style, "console", function () {
+ return ({ 'title': [ '\x1B[32m\x1b[4m', '\x1B[39m\x1b[0m' ], 'url': [ '\x1B[34m', '\x1B[39m' ], 'hit': [ '\x1B[4m', '\x1B[0m' ], 'del': [ '\x1B[9m', '\x1B[0m' ], 'summary': [ '\x1B[90m', '\x1B[39m' ] });
+});
+$__jsx_lazy_init(Style, "html", function () {
+ return ({ 'title': [ '<span class="title">', '</span>' ], 'url': [ '<span class="url">', '</span>' ], 'hit': [ '<span class="hit">', '</span>' ], 'del': [ '<del>', '</del>' ], 'summary': [ '<span class="reuslt">', '</span>' ] });
+});
+$__jsx_lazy_init(Style, "ignore", function () {
+ return ({ 'tilte': [ '', '' ], 'url': [ '', '' ], 'hit': [ '', '' ], 'del': [ '', '' ], 'summary': [ '', '' ] });
+});
+TurkishStemmer.serialVersionUID = 1;
+$__jsx_lazy_init(TurkishStemmer, "methodObject", function () {
+ return new TurkishStemmer$();
+});
+$__jsx_lazy_init(TurkishStemmer, "a_0", function () {
+ return [ new Among$SII("m", -1, -1), new Among$SII("n", -1, -1), new Among$SII("miz", -1, -1), new Among$SII("niz", -1, -1), new Among$SII("muz", -1, -1), new Among$SII("nuz", -1, -1), new Among$SII("m\u00FCz", -1, -1), new Among$SII("n\u00FCz", -1, -1), new Among$SII("m\u0131z", -1, -1), new Among$SII("n\u0131z", -1, -1) ];
+});
+$__jsx_lazy_init(TurkishStemmer, "a_1", function () {
+ return [ new Among$SII("leri", -1, -1), new Among$SII("lar\u0131", -1, -1) ];
+});
+$__jsx_lazy_init(TurkishStemmer, "a_2", function () {
+ return [ new Among$SII("ni", -1, -1), new Among$SII("nu", -1, -1), new Among$SII("n\u00FC", -1, -1), new Among$SII("n\u0131", -1, -1) ];
+});
+$__jsx_lazy_init(TurkishStemmer, "a_3", function () {
+ return [ new Among$SII("in", -1, -1), new Among$SII("un", -1, -1), new Among$SII("\u00FCn", -1, -1), new Among$SII("\u0131n", -1, -1) ];
+});
+$__jsx_lazy_init(TurkishStemmer, "a_4", function () {
+ return [ new Among$SII("a", -1, -1), new Among$SII("e", -1, -1) ];
+});
+$__jsx_lazy_init(TurkishStemmer, "a_5", function () {
+ return [ new Among$SII("na", -1, -1), new Among$SII("ne", -1, -1) ];
+});
+$__jsx_lazy_init(TurkishStemmer, "a_6", function () {
+ return [ new Among$SII("da", -1, -1), new Among$SII("ta", -1, -1), new Among$SII("de", -1, -1), new Among$SII("te", -1, -1) ];
+});
+$__jsx_lazy_init(TurkishStemmer, "a_7", function () {
+ return [ new Among$SII("nda", -1, -1), new Among$SII("nde", -1, -1) ];
+});
+$__jsx_lazy_init(TurkishStemmer, "a_8", function () {
+ return [ new Among$SII("dan", -1, -1), new Among$SII("tan", -1, -1), new Among$SII("den", -1, -1), new Among$SII("ten", -1, -1) ];
+});
+$__jsx_lazy_init(TurkishStemmer, "a_9", function () {
+ return [ new Among$SII("ndan", -1, -1), new Among$SII("nden", -1, -1) ];
+});
+$__jsx_lazy_init(TurkishStemmer, "a_10", function () {
+ return [ new Among$SII("la", -1, -1), new Among$SII("le", -1, -1) ];
+});
+$__jsx_lazy_init(TurkishStemmer, "a_11", function () {
+ return [ new Among$SII("ca", -1, -1), new Among$SII("ce", -1, -1) ];
+});
+$__jsx_lazy_init(TurkishStemmer, "a_12", function () {
+ return [ new Among$SII("im", -1, -1), new Among$SII("um", -1, -1), new Among$SII("\u00FCm", -1, -1), new Among$SII("\u0131m", -1, -1) ];
+});
+$__jsx_lazy_init(TurkishStemmer, "a_13", function () {
+ return [ new Among$SII("sin", -1, -1), new Among$SII("sun", -1, -1), new Among$SII("s\u00FCn", -1, -1), new Among$SII("s\u0131n", -1, -1) ];
+});
+$__jsx_lazy_init(TurkishStemmer, "a_14", function () {
+ return [ new Among$SII("iz", -1, -1), new Among$SII("uz", -1, -1), new Among$SII("\u00FCz", -1, -1), new Among$SII("\u0131z", -1, -1) ];
+});
+$__jsx_lazy_init(TurkishStemmer, "a_15", function () {
+ return [ new Among$SII("siniz", -1, -1), new Among$SII("sunuz", -1, -1), new Among$SII("s\u00FCn\u00FCz", -1, -1), new Among$SII("s\u0131n\u0131z", -1, -1) ];
+});
+$__jsx_lazy_init(TurkishStemmer, "a_16", function () {
+ return [ new Among$SII("lar", -1, -1), new Among$SII("ler", -1, -1) ];
+});
+$__jsx_lazy_init(TurkishStemmer, "a_17", function () {
+ return [ new Among$SII("niz", -1, -1), new Among$SII("nuz", -1, -1), new Among$SII("n\u00FCz", -1, -1), new Among$SII("n\u0131z", -1, -1) ];
+});
+$__jsx_lazy_init(TurkishStemmer, "a_18", function () {
+ return [ new Among$SII("dir", -1, -1), new Among$SII("tir", -1, -1), new Among$SII("dur", -1, -1), new Among$SII("tur", -1, -1), new Among$SII("d\u00FCr", -1, -1), new Among$SII("t\u00FCr", -1, -1), new Among$SII("d\u0131r", -1, -1), new Among$SII("t\u0131r", -1, -1) ];
+});
+$__jsx_lazy_init(TurkishStemmer, "a_19", function () {
+ return [ new Among$SII("cas\u0131na", -1, -1), new Among$SII("cesine", -1, -1) ];
+});
+$__jsx_lazy_init(TurkishStemmer, "a_20", function () {
+ return [ new Among$SII("di", -1, -1), new Among$SII("ti", -1, -1), new Among$SII("dik", -1, -1), new Among$SII("tik", -1, -1), new Among$SII("duk", -1, -1), new Among$SII("tuk", -1, -1), new Among$SII("d\u00FCk", -1, -1), new Among$SII("t\u00FCk", -1, -1), new Among$SII("d\u0131k", -1, -1), new Among$SII("t\u0131k", -1, -1), new Among$SII("dim", -1, -1), new Among$SII("tim", -1, -1), new Among$SII("dum", -1, -1), new Among$SII("tum", -1, -1), new Among$SII("d\u00FCm", -1, -1), new Among$SII("t\u00FCm", -1, -1), new Among$SII("d\u0131m", -1, -1), new Among$SII("t\u0131m", -1, -1), new Among$SII("din", -1, -1), new Among$SII("tin", -1, -1), new Among$SII("dun", -1, -1), new Among$SII("tun", -1, -1), new Among$SII("d\u00FCn", -1, -1), new Among$SII("t\u00FCn", -1, -1), new Among$SII("d\u0131n", -1, -1), new Among$SII("t\u0131n", -1, -1), new Among$SII("du", -1, -1), new Among$SII("tu", -1, -1), new Among$SII("d\u00FC", -1, -1), new Among$SII("t\u00FC", -1, -1), new Among$SII("d\u0131", -1, -1), new Among$SII("t\u0131", -1, -1) ];
+});
+$__jsx_lazy_init(TurkishStemmer, "a_21", function () {
+ return [ new Among$SII("sa", -1, -1), new Among$SII("se", -1, -1), new Among$SII("sak", -1, -1), new Among$SII("sek", -1, -1), new Among$SII("sam", -1, -1), new Among$SII("sem", -1, -1), new Among$SII("san", -1, -1), new Among$SII("sen", -1, -1) ];
+});
+$__jsx_lazy_init(TurkishStemmer, "a_22", function () {
+ return [ new Among$SII("mi\u015F", -1, -1), new Among$SII("mu\u015F", -1, -1), new Among$SII("m\u00FC\u015F", -1, -1), new Among$SII("m\u0131\u015F", -1, -1) ];
+});
+$__jsx_lazy_init(TurkishStemmer, "a_23", function () {
+ return [ new Among$SII("b", -1, 1), new Among$SII("c", -1, 2), new Among$SII("d", -1, 3), new Among$SII("\u011F", -1, 4) ];
+});
+$__jsx_lazy_init(TurkishStemmer, "g_vowel", function () {
+ return [ 17, 65, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 8, 0, 0, 0, 0, 0, 0, 1 ];
+});
+$__jsx_lazy_init(TurkishStemmer, "g_U", function () {
+ return [ 1, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 1 ];
+});
+$__jsx_lazy_init(TurkishStemmer, "g_vowel1", function () {
+ return [ 1, 64, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1 ];
+});
+$__jsx_lazy_init(TurkishStemmer, "g_vowel2", function () {
+ return [ 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 130 ];
+});
+$__jsx_lazy_init(TurkishStemmer, "g_vowel3", function () {
+ return [ 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1 ];
+});
+$__jsx_lazy_init(TurkishStemmer, "g_vowel4", function () {
+ return [ 17 ];
+});
+$__jsx_lazy_init(TurkishStemmer, "g_vowel5", function () {
+ return [ 65 ];
+});
+$__jsx_lazy_init(TurkishStemmer, "g_vowel6", function () {
+ return [ 65 ];
+});
+$__jsx_lazy_init(_Common, "buffers", function () {
+ return [ "comment", "sgmlDecl", "textNode", "tagName", "doctype", "procInstName", "procInstBody", "entity", "attribName", "attribValue", "cdata", "script" ];
+});
+$__jsx_lazy_init(_Common, "EVENTS", function () {
+ return [ "text", "processinginstruction", "sgmldeclaration", "doctype", "comment", "attribute", "opentag", "closetag", "opencdata", "cdata", "clo_State.CDATA", "error", "end", "ready", "script", "opennamespace", "closenamespace" ];
+});
+_Common.MAX_BUFFER_LENGTH = 65536;
+_State.BEGIN = 1;
+_State.TEXT = 2;
+_State.TEXT_ENTITY = 3;
+_State.OPEN_WAKA = 4;
+_State.SGML_DECL = 5;
+_State.SGML_DECL_QUOTED = 6;
+_State.DOCTYPE = 7;
+_State.DOCTYPE_QUOTED = 8;
+_State.DOCTYPE_DTD = 9;
+_State.DOCTYPE_DTD_QUOTED = 10;
+_State.COMMENT_STARTING = 11;
+_State.COMMENT = 12;
+_State.COMMENT_ENDING = 13;
+_State.COMMENT_ENDED = 14;
+_State.CDATA = 15;
+_State.CDATA_ENDING = 16;
+_State.CDATA_ENDING_2 = 17;
+_State.PROC_INST = 18;
+_State.PROC_INST_BODY = 19;
+_State.PROC_INST_ENDING = 20;
+_State.OPEN_TAG = 21;
+_State.OPEN_TAG_SLASH = 22;
+_State.ATTRIB = 23;
+_State.ATTRIB_NAME = 24;
+_State.ATTRIB_NAME_SAW_WHITE = 25;
+_State.ATTRIB_VALUE = 26;
+_State.ATTRIB_VALUE_QUOTED = 27;
+_State.ATTRIB_VALUE_UNQUOTED = 28;
+_State.ATTRIB_VALUE_ENTITY_Q = 29;
+_State.ATTRIB_VALUE_ENTITY_U = 30;
+_State.CLOSE_TAG = 31;
+_State.CLOSE_TAG_SAW_WHITE = 32;
+_State.SCRIPT = 33;
+_State.SCRIPT_ENDING = 34;
+$__jsx_lazy_init(_Entities, "_entities", function () {
+ return ({ "amp": "&", "gt": ">", "lt": "<", "quot": "\"", "apos": "'", "AElig": 198, "Aacute": 193, "Acirc": 194, "Agrave": 192, "Aring": 197, "Atilde": 195, "Auml": 196, "Ccedil": 199, "ETH": 208, "Eacute": 201, "Ecirc": 202, "Egrave": 200, "Euml": 203, "Iacute": 205, "Icirc": 206, "Igrave": 204, "Iuml": 207, "Ntilde": 209, "Oacute": 211, "Ocirc": 212, "Ograve": 210, "Oslash": 216, "Otilde": 213, "Ouml": 214, "THORN": 222, "Uacute": 218, "Ucirc": 219, "Ugrave": 217, "Uuml": 220, "Yacute": 221, "aacute": 225, "acirc": 226, "aelig": 230, "agrave": 224, "aring": 229, "atilde": 227, "auml": 228, "ccedil": 231, "eacute": 233, "ecirc": 234, "egrave": 232, "eth": 240, "euml": 235, "iacute": 237, "icirc": 238, "igrave": 236, "iuml": 239, "ntilde": 241, "oacute": 243, "ocirc": 244, "ograve": 242, "oslash": 248, "otilde": 245, "ouml": 246, "szlig": 223, "thorn": 254, "uacute": 250, "ucirc": 251, "ugrave": 249, "uuml": 252, "yacute": 253, "yuml": 255, "copy": 169, "reg": 174, "nbsp": 160, "iexcl": 161, "cent": 162, "pound": 163, "curren": 164, "yen": 165, "brvbar": 166, "sect": 167, "uml": 168, "ordf": 170, "laquo": 171, "not": 172, "shy": 173, "macr": 175, "deg": 176, "plusmn": 177, "sup1": 185, "sup2": 178, "sup3": 179, "acute": 180, "micro": 181, "para": 182, "middot": 183, "cedil": 184, "ordm": 186, "raquo": 187, "frac14": 188, "frac12": 189, "frac34": 190, "iquest": 191, "times": 215, "divide": 247, "OElig": 338, "oelig": 339, "Scaron": 352, "scaron": 353, "Yuml": 376, "fnof": 402, "circ": 710, "tilde": 732, "Alpha": 913, "Beta": 914, "Gamma": 915, "Delta": 916, "Epsilon": 917, "Zeta": 918, "Eta": 919, "Theta": 920, "Iota": 921, "Kappa": 922, "Lambda": 923, "Mu": 924, "Nu": 925, "Xi": 926, "Omicron": 927, "Pi": 928, "Rho": 929, "Sigma": 931, "Tau": 932, "Upsilon": 933, "Phi": 934, "Chi": 935, "Psi": 936, "Omega": 937, "alpha": 945, "beta": 946, "gamma": 947, "delta": 948, "epsilon": 949, "zeta": 950, "eta": 951, "theta": 952, "iota": 953, "kappa": 954, "lambda": 955, "mu": 956, "nu": 957, "xi": 958, "omicron": 959, "pi": 960, "rho": 961, "sigmaf": 962, "sigma": 963, "tau": 964, "upsilon": 965, "phi": 966, "chi": 967, "psi": 968, "omega": 969, "thetasym": 977, "upsih": 978, "piv": 982, "ensp": 8194, "emsp": 8195, "thinsp": 8201, "zwnj": 8204, "zwj": 8205, "lrm": 8206, "rlm": 8207, "ndash": 8211, "mdash": 8212, "lsquo": 8216, "rsquo": 8217, "sbquo": 8218, "ldquo": 8220, "rdquo": 8221, "bdquo": 8222, "dagger": 8224, "Dagger": 8225, "bull": 8226, "hellip": 8230, "permil": 8240, "prime": 8242, "Prime": 8243, "lsaquo": 8249, "rsaquo": 8250, "oline": 8254, "frasl": 8260, "euro": 8364, "image": 8465, "weierp": 8472, "real": 8476, "trade": 8482, "alefsym": 8501, "larr": 8592, "uarr": 8593, "rarr": 8594, "darr": 8595, "harr": 8596, "crarr": 8629, "lArr": 8656, "uArr": 8657, "rArr": 8658, "dArr": 8659, "hArr": 8660, "forall": 8704, "part": 8706, "exist": 8707, "empty": 8709, "nabla": 8711, "isin": 8712, "notin": 8713, "ni": 8715, "prod": 8719, "sum": 8721, "minus": 8722, "lowast": 8727, "radic": 8730, "prop": 8733, "infin": 8734, "ang": 8736, "and": 8743, "or": 8744, "cap": 8745, "cup": 8746, "int": 8747, "there4": 8756, "sim": 8764, "cong": 8773, "asymp": 8776, "ne": 8800, "equiv": 8801, "le": 8804, "ge": 8805, "sub": 8834, "sup": 8835, "nsub": 8836, "sube": 8838, "supe": 8839, "oplus": 8853, "otimes": 8855, "perp": 8869, "sdot": 8901, "lceil": 8968, "rceil": 8969, "lfloor": 8970, "rfloor": 8971, "lang": 9001, "rang": 9002, "loz": 9674, "spades": 9824, "clubs": 9827, "hearts": 9829, "diams": 9830 });
+});
+BitVector.SMALL_BLOCK_SIZE = 32;
+BitVector.LARGE_BLOCK_SIZE = 256;
+BitVector.BLOCK_RATE = 8;
+$__jsx_lazy_init(BurrowsWheelerTransform, "END_MARKER", function () {
+ return String.fromCharCode(0);
+});
+var $__jsx_classMap = {
+ "tool/web/oktavia-turkish-search.jsx": {
+ _Main: _Main,
+ _Main$: _Main$
+ },
+ "tool/web/oktavia-search.jsx": {
+ _Result: _Result,
+ _Result$SSSI: _Result$SSSI,
+ _Proposal: _Proposal,
+ _Proposal$SSI: _Proposal$SSI,
+ OktaviaSearch: OktaviaSearch,
+ OktaviaSearch$I: OktaviaSearch$I,
+ _Main: _Main$0,
+ _Main$: _Main$0$
+ },
+ "src/oktavia.jsx": {
+ Oktavia: Oktavia,
+ Oktavia$: Oktavia$
+ },
+ "src/binary-util.jsx": {
+ Binary: Binary,
+ Binary$: Binary$,
+ LoadedStringResult: LoadedStringResult,
+ LoadedStringResult$SI: LoadedStringResult$SI,
+ LoadedStringListResult: LoadedStringListResult,
+ LoadedStringListResult$SI: LoadedStringListResult$SI,
+ LoadedStringListMapResult: LoadedStringListMapResult,
+ LoadedStringListMapResult$SI: LoadedStringListMapResult$SI,
+ LoadedNumberListResult: LoadedNumberListResult,
+ LoadedNumberListResult$SI: LoadedNumberListResult$SI,
+ CompressionReport: CompressionReport,
+ CompressionReport$: CompressionReport$
+ },
+ "src/query.jsx": {
+ Query: Query,
+ Query$: Query$
+ },
+ "src/query-string-parser.jsx": {
+ QueryStringParser: QueryStringParser,
+ QueryStringParser$: QueryStringParser$
+ },
+ "src/search-result.jsx": {
+ Proposal: Proposal,
+ Proposal$II: Proposal$II,
+ Position: Position,
+ Position$SIB: Position$SIB,
+ SearchUnit: SearchUnit,
+ SearchUnit$I: SearchUnit$I,
+ SingleResult: SingleResult,
+ SingleResult$: SingleResult$,
+ SingleResult$SBB: SingleResult$SBB,
+ SearchSummary: SearchSummary,
+ SearchSummary$: SearchSummary$,
+ SearchSummary$LOktavia$: SearchSummary$LOktavia$
+ },
+ "src/style.jsx": {
+ Style: Style,
+ Style$S: Style$S,
+ _HTMLHandler: _HTMLHandler,
+ _HTMLHandler$HASB: _HTMLHandler$HASB
+ },
+ "src/stemmer/stemmer.jsx": {
+ Stemmer: Stemmer,
+ Stemmer$: Stemmer$
+ },
+ "src/stemmer/base-stemmer.jsx": {
+ BaseStemmer: BaseStemmer,
+ BaseStemmer$: BaseStemmer$
+ },
+ "src/stemmer/turkish-stemmer.jsx": {
+ TurkishStemmer: TurkishStemmer,
+ TurkishStemmer$: TurkishStemmer$
+ },
+ "src/stemmer/among.jsx": {
+ Among: Among,
+ Among$SII: Among$SII,
+ Among$SIIF$LBaseStemmer$B$LBaseStemmer$: Among$SIIF$LBaseStemmer$B$LBaseStemmer$
+ },
+ "src/metadata.jsx": {
+ Metadata: Metadata,
+ Metadata$LOktavia$: Metadata$LOktavia$,
+ Section: Section,
+ Section$LOktavia$: Section$LOktavia$,
+ Splitter: Splitter,
+ Splitter$LOktavia$: Splitter$LOktavia$,
+ Splitter$LOktavia$S: Splitter$LOktavia$S,
+ Table: Table,
+ Table$LOktavia$AS: Table$LOktavia$AS,
+ Block: Block,
+ Block$LOktavia$: Block$LOktavia$
+ },
+ "src/fm-index.jsx": {
+ FMIndex: FMIndex,
+ FMIndex$: FMIndex$
+ },
+ "src/sax.jsx": {
+ Tag: Tag,
+ Tag$S: Tag$S,
+ _Common: _Common,
+ _Common$: _Common$,
+ _State: _State,
+ _State$: _State$,
+ SAXHandler: SAXHandler,
+ SAXHandler$: SAXHandler$,
+ SAXParser: SAXParser,
+ SAXParser$LSAXHandler$: SAXParser$LSAXHandler$,
+ SAXParser$LSAXHandler$B: SAXParser$LSAXHandler$B,
+ Char: Char,
+ Char$: Char$,
+ _Entities: _Entities,
+ _Entities$: _Entities$
+ },
+ "src/bit-vector.jsx": {
+ BitVector: BitVector,
+ BitVector$: BitVector$
+ },
+ "src/wavelet-matrix.jsx": {
+ WaveletMatrix: WaveletMatrix,
+ WaveletMatrix$: WaveletMatrix$
+ },
+ "src/burrows-wheeler-transform.jsx": {
+ BurrowsWheelerTransform: BurrowsWheelerTransform,
+ BurrowsWheelerTransform$: BurrowsWheelerTransform$
+ },
+ "src/sais.jsx": {
+ OArray: OArray,
+ OArray$AI: OArray$AI,
+ OArray$AII: OArray$AII,
+ SAIS: SAIS,
+ SAIS$: SAIS$
+ }
+};
+
+
+/**
+ * launches _Main.main(:string[]):void invoked by jsx --run|--executable
+ */
+JSX.runMain = function (sourceFile, args) {
+ var module = JSX.require(sourceFile);
+ if (! module) {
+ throw new ReferenceError("entry point module not found in " + sourceFile);
+ }
+ if (! module._Main) {
+ throw new ReferenceError("entry point _Main not found in " + sourceFile);
+ }
+ if (! module._Main.main$AS) {
+ throw new ReferenceError("entry point _Main.main(:string[]):void not found in " + sourceFile);
+ }
+ module._Main.main$AS(args);
+};
+
+/**
+ * launches _Test#test*():void invoked by jsx --test
+ */
+JSX.runTests = function (sourceFile, tests) {
+ var module = JSX.require(sourceFile);
+ var testClass = module._Test$;
+
+ if (!testClass) return; // skip if there's no test class
+
+ if(tests.length === 0) {
+ var p = testClass.prototype;
+ for (var m in p) {
+ if (p[m] instanceof Function
+ && /^test.*[$]$/.test(m)) {
+ tests.push(m);
+ }
+ }
+ }
+ else { // set as process arguments
+ tests = tests.map(function (name) {
+ return name + "$"; // mangle for function test*():void
+ });
+ }
+
+ var testCase = new testClass();
+
+ if (testCase.beforeClass$AS != null)
+ testCase.beforeClass$AS(tests);
+
+ for (var i = 0; i < tests.length; ++i) {
+ (function (method) {
+ if (method in testCase) {
+ testCase.run$SF$V$(method, function() { testCase[method](); });
+ }
+ else {
+ throw new ReferenceError("No such test method: " + method);
+ }
+ }(tests[i]));
+ }
+
+ if (testCase.afterClass$ != null)
+ testCase.afterClass$();
+};
+/**
+ * call a function on load/DOMContentLoaded
+ */
+function $__jsx_onload (event) {
+ window.removeEventListener("load", $__jsx_onload);
+ document.removeEventListener("DOMContentLoaded", $__jsx_onload);
+ JSX.runMain("tool/web/oktavia-turkish-search.jsx", [])
+}
+
+window.addEventListener("load", $__jsx_onload);
+document.addEventListener("DOMContentLoaded", $__jsx_onload);
+
+})(JSX);
diff --git a/web/server/h2o/libh2o/misc/oktavia/lib/searchstyle.css b/web/server/h2o/libh2o/misc/oktavia/lib/searchstyle.css
new file mode 100644
index 00000000..a3d51d43
--- /dev/null
+++ b/web/server/h2o/libh2o/misc/oktavia/lib/searchstyle.css
@@ -0,0 +1,174 @@
+form.oktavia_form {
+ position: relative;
+ display: block;
+ width: 240px;
+ height: 25px;
+}
+
+input.oktavia_search {
+ -webkit-appearance: searchfield;
+ -webkit-user-select: text;
+ cursor: auto;
+ background-color: white;
+ color: black;
+ line-height: normal;
+ display: inline-block;
+ padding: 1px;
+ text-align: start;
+ margin: 2px 0px 2px 0px;
+ padding: 1px;
+}
+
+div.oktavia_searchresult_box {
+ display: none;
+ position: absolute;
+ width: 500px;
+ padding: 10px;
+ right: 10px;
+ background-color: #ffffff;
+ -moz-border-radius: 8px;
+ border-radius: 8px;
+ -moz-box-shadow: 3px 3px 5px 5px #b5b2b2;
+ box-shadow: 3px 3px 5px 5px #b5b2b2;
+ opacity: 0.95;
+ z-index: 100000;
+}
+
+div.oktavia_close_search_box {
+ position: absolute;
+ top: 10px;
+ right: 10px;
+ width: 20px;
+ height: 20px;
+ text-align: center;
+ vertical-align: middle;
+ color: #666;
+}
+
+div.oktavia_close_search_box:hover {
+ background-color: #d1e8ff;
+ border: 1px solid gray;
+}
+
+div.oktavia_close_search_box:active {
+ background-color: #b4c8db;
+ border: 1px solid gray;
+}
+
+
+div.oktavia_searchresult_summary {
+ color: #444;
+}
+
+div.oktavia_searchresult .entry {
+ margin: 10px 10px 10px 10px;
+ color: black;
+}
+
+div.oktavia_searchresult .entry .title {
+ font-size: normal;
+}
+
+div.oktavia_searchresult .entry .title a:link {
+ color: #0000EE;
+ text-decoration: underline;
+}
+
+div.oktavia_searchresult .entry .title a:visited {
+ color: #551A8B;
+ text-decoration: underline;
+}
+
+div.oktavia_searchresult .entry .title a:hover {
+}
+
+div.oktavia_searchresult .entry .title a:active {
+ color: #FF0000;
+ text-decoration: underline;
+}
+
+div.oktavia_searchresult .entry .url {
+ font-size: 14px!important;
+ color: #093;
+ font-style: normal;
+ font-family: arial,sans-serif;
+}
+
+div.oktavia_searchresult .entry .resultcontent {
+ font-size: small;
+ font-family: arial,sans-serif;
+ color: #222;
+}
+
+div.oktavia_searchresult .entry .resultcontent .hit {
+ font-weight: bolder;
+ text-decoration: underline;
+}
+
+div.oktavia_searchresult .proposal {
+ margin: 10px 10px 10px 10px;
+ color: #222;
+ font-size: small;
+ font-family: arial,sans-serif;
+}
+
+div.oktavia_searchresult .proposal .option {
+ background-color: #e8f4ff;
+ border-bottom: 1px solid blue;
+}
+
+div.oktavia_searchresult .proposal .option:hover {
+ background-color: #d1e8ff;
+}
+
+div.oktavia_searchresult .proposal .option:active {
+ background-color: #b4c8db;
+}
+
+div.oktavia_searchresult_nav span.leader {
+ color: #228;
+}
+
+div.oktavia_searchresult_nav span.page {
+ background-color: #ffffff;
+ border: 1px solid #888888;
+ padding: 5px;
+ margin: 5px;
+ color: #222;
+}
+
+div.oktavia_searchresult_nav span.page:hover {
+ background-color: #d1e8ff;
+ border: 1px solid #7d98ff;
+}
+
+div.oktavia_searchresult_nav span.page:active {
+ background-color: #b4c8db;
+ border: 1px solid #6c83db;
+}
+
+div.oktavia_searchresult_nav span.selected {
+ background-color: #b4c8db;
+ border: 1px solid #6c83db;
+}
+
+div.oktavia_searchresult_nav span.selected:hover {
+ background-color: #b4c8db;
+ border: 1px solid #6c83db;
+}
+
+div.oktavia_searchresult_nav span.selected:active {
+ background-color: #b4c8db;
+ border: 1px solid #6c83db;
+}
+
+div.oktavia_searchresult_box span.pr {
+ position: absolute;
+ right: 10px;
+ bottom: 10px;
+ color: #555;
+}
+
+.highlighted {
+ background-color: #fbe54e;
+}
diff --git a/web/server/h2o/libh2o/misc/oktavia/package.json b/web/server/h2o/libh2o/misc/oktavia/package.json
new file mode 100644
index 00000000..3d0a1b29
--- /dev/null
+++ b/web/server/h2o/libh2o/misc/oktavia/package.json
@@ -0,0 +1,23 @@
+{
+ "author": "Yoshiki Shibukawa <yoshiki@shibu.jp>",
+ "name": "oktavia",
+ "description": "A full text search engine for JavaScript environment. It is based on FM-index algorithm.",
+ "version": "0.1.0",
+ "homepage": "http://oktavia.info",
+ "main": "./tool/oktavia-mkindex.jsx",
+ "repository": {
+ "type": "git",
+ "url": "git@github.com:shibukawa/oktavia.git"
+ },
+ "scripts": {
+ "test": "prove",
+ "install": "make"
+ },
+ "engines": {
+ "node": ">= 0.8"
+ },
+ "dependencies": {},
+ "devDependencies": {
+ "jsx": "latest"
+ }
+}
diff --git a/web/server/h2o/libh2o/misc/oktavia/resource/favicon.ai b/web/server/h2o/libh2o/misc/oktavia/resource/favicon.ai
new file mode 100644
index 00000000..14e3ce21
--- /dev/null
+++ b/web/server/h2o/libh2o/misc/oktavia/resource/favicon.ai
@@ -0,0 +1,1176 @@
+%PDF-1.5 %âãÏÓ
+1 0 obj <</Metadata 2 0 R/OCProperties<</D<</ON[5 0 R]/Order 6 0 R/RBGroups[]>>/OCGs[5 0 R]>>/Pages 3 0 R/Type/Catalog>> endobj 2 0 obj <</Length 51892/Subtype/XML/Type/Metadata>>stream
+<?xpacket begin="" id="W5M0MpCehiHzreSzNTczkc9d"?>
+<x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="Adobe XMP Core 5.0-c060 61.134777, 2010/02/12-17:32:00 ">
+ <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
+ <rdf:Description rdf:about=""
+ xmlns:dc="http://purl.org/dc/elements/1.1/">
+ <dc:format>application/pdf</dc:format>
+ <dc:title>
+ <rdf:Alt>
+ <rdf:li xml:lang="x-default">favicon</rdf:li>
+ </rdf:Alt>
+ </dc:title>
+ </rdf:Description>
+ <rdf:Description rdf:about=""
+ xmlns:xmp="http://ns.adobe.com/xap/1.0/"
+ xmlns:xmpGImg="http://ns.adobe.com/xap/1.0/g/img/">
+ <xmp:CreatorTool>Adobe Illustrator CS5</xmp:CreatorTool>
+ <xmp:CreateDate>2013-04-05T08:48:31-07:00</xmp:CreateDate>
+ <xmp:ModifyDate>2013-04-05T08:48:31-07:00</xmp:ModifyDate>
+ <xmp:MetadataDate>2013-04-05T08:48:31-07:00</xmp:MetadataDate>
+ <xmp:Thumbnails>
+ <rdf:Alt>
+ <rdf:li rdf:parseType="Resource">
+ <xmpGImg:width>256</xmpGImg:width>
+ <xmpGImg:height>184</xmpGImg:height>
+ <xmpGImg:format>JPEG</xmpGImg:format>
+ <xmpGImg:image>/9j/4AAQSkZJRgABAgEASABIAAD/7QAsUGhvdG9zaG9wIDMuMAA4QklNA+0AAAAAABAASAAAAAEA&#xA;AQBIAAAAAQAB/+4ADkFkb2JlAGTAAAAAAf/bAIQABgQEBAUEBgUFBgkGBQYJCwgGBggLDAoKCwoK&#xA;DBAMDAwMDAwQDA4PEA8ODBMTFBQTExwbGxscHx8fHx8fHx8fHwEHBwcNDA0YEBAYGhURFRofHx8f&#xA;Hx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8f/8AAEQgAuAEAAwER&#xA;AAIRAQMRAf/EAaIAAAAHAQEBAQEAAAAAAAAAAAQFAwIGAQAHCAkKCwEAAgIDAQEBAQEAAAAAAAAA&#xA;AQACAwQFBgcICQoLEAACAQMDAgQCBgcDBAIGAnMBAgMRBAAFIRIxQVEGE2EicYEUMpGhBxWxQiPB&#xA;UtHhMxZi8CRygvElQzRTkqKyY3PCNUQnk6OzNhdUZHTD0uIIJoMJChgZhJRFRqS0VtNVKBry4/PE&#xA;1OT0ZXWFlaW1xdXl9WZ2hpamtsbW5vY3R1dnd4eXp7fH1+f3OEhYaHiImKi4yNjo+Ck5SVlpeYmZ&#xA;qbnJ2en5KjpKWmp6ipqqusra6voRAAICAQIDBQUEBQYECAMDbQEAAhEDBCESMUEFURNhIgZxgZEy&#xA;obHwFMHR4SNCFVJicvEzJDRDghaSUyWiY7LCB3PSNeJEgxdUkwgJChgZJjZFGidkdFU38qOzwygp&#xA;0+PzhJSktMTU5PRldYWVpbXF1eX1RlZmdoaWprbG1ub2R1dnd4eXp7fH1+f3OEhYaHiImKi4yNjo&#xA;+DlJWWl5iZmpucnZ6fkqOkpaanqKmqq6ytrq+v/aAAwDAQACEQMRAD8A9U4q7FXYq7FXYq7FXYq7&#xA;FXYq7FXYq7FXYqoXt/ZWNs9ze3Edtbpu80zBEHzZiBirzjzD+ffliwLRaTDJqsw29QfuYa/6zAuf&#xA;oX6cKvPdX/PDzzfki2mh06I7BbeMFqe7y+oa/KmKGLXvmvzNfk/XNVu5wf2XnkK+Gy1oMVS5nZ2L&#xA;MSzHqTuTiq5HZWDKSrDoRsRiqaWPmfzHYkfU9Uu7cD9mOaRV+4GmFWVaR+dHnexKieeLUIh+xcRi&#xA;tP8AXj4N99cFKz7y/wDnp5fvCsWr28mmynYyr++hr7lQHH/An540l6JYahY6hbLdWNxHc27/AGZY&#xA;mDqfao74FRGKuxV2KuxV2KuxV2KuxV2KuxV2KuxV2KuxV2KuxV2KuxV2KuxV2KvNfP351aPoDSaf&#xA;pATUtWX4XINbeFv8tl+2w/lU/MjDSvCPMHmvX/MV2brV7x7l6/u4yaRoPBIxRV+gYoSwHFVwOKVw&#xA;OKF4OKrgcVXA4quBwqvBxVM9D8xa1ol0LnS7uS2k25BT8DgdnQ/Cw+YwK9Bg/PbzG6IjWlmJQACx&#xA;WUhm8aCQUzYaLDp8npyGUZfCvudL2pqdbh9eGMJw7qPF9h3CI/5XT5p/5ZbH/kXN/wBVc3P8h4e+&#xA;X2fqeY/0Wan+bj+Uv+KV7X87NaV63en20qbbRGSI++7GX9WQn2Fj/hkR9v6mzF7W5gfXCJHlY/TJ&#xA;kGmfnPoFwVS/tprJid3FJowPEleL/cmYWXsPLH6SJfZ+Pm7TTe1mCVDJGUP9kP0H7GaaXrekatD6&#xA;2nXcV0lAWEbAstenJftL9IzVZsE8ZqYIeh02sxZxeOQl+Oo5j4o3KnJdirsVdirsVdirsVdirsVd&#xA;irsVdirsVdirTuiIzuwVFBLMTQADckk4q8C/NP8AOmW/aXRfLMzRWAql1qK7PN2KxEbrH/ldW+XU&#xA;q8hBxVcDihPvLHkzzJ5ln9PSLJ5kU0kuW+CFP9aQ/DX26+2KvWdG/IPRrGFbnzNqvqU3aKAiGEHw&#xA;Mj/E30BcUp/b2X5SaN8NppcFy6inIxG4b6HnqPuOKEdB520VZAlho7FhvGsaRq1fYIGxpUxTVJb0&#xA;Vn8tysG3f1Ej3p/xkC1xVBar5V/L65gWTWNFttMjkPFZpPRtSWpUDnDIN/mcnDHKZqIJ9zVmz48Q&#xA;uchEeZA+9i2t/kJplxGZ/L+oNCWHJIbj97Ea/wAsiDkB9DZA7c20EEWHlvmLyh5i8uz+nqtm8KMa&#xA;R3A+KF/9WQfDX26+2FUoBxVcDiqMtLsqeEh+E9Ce2bns/tQ46hPePf3fseV7Z9nxmvLh2ydR0l+o&#xA;/f8Aaj86gEEWHgpRINHm7FCrbXVzazrPayvBOm6SxsUYfJhQ4JQEhRFhlDJKB4okiQ6jYvSfKf5v&#xA;zRlLTzCPVj6Lfxr8Y3/3Yi7MPdd/Y5odZ2KD6sXy/U9d2b7USj6dRuP5w5/Efq38i9Vtrm3uYEuL&#xA;eRZoJRyjlQhlYHuCM52UTE0di9tjyRnESibBVMizdirsVdirsVdirsVdirsVdirsVdirwb87/wA0&#xA;nmmm8qaLNSCMlNWuUP226GBSP2R+34nbpWpV4uDihcDil7D+XP5L/WrdNc82VttOA9SKwYmN5F68&#xA;pm2KJ7dT7d1Wf6j52s7C3XTvLltHBbQjhHIECooH++4wAPpP3Y0hILa013zBeHiXuZB9uWQnggPi&#xA;TsPkMKsy0n8vdOtwsmoMbubqUFVjB+j4j/ntgtaZPbWlrax+nbQpCn8sahR+GBKD1/XtP0LTJNQv&#xA;n4xJsiCnORz0RB3J/t6Zfp9PLNMRi4mt1uPTYzkmdvtJ7g8A80ea9S8xaibq8bjEtRbWyk8IlPYe&#xA;JP7Td/uzs9JpIYI8Mfie98w7R7QyarJxz5dB0H46nqs0PzVruhy89Ou3iStXgJ5RN/rIar9PXDqN&#xA;Jjyj1i/vY6PX5tMbxyI8uh+H4L1fyp+YGk+bEOjatZKt3MpDQlTLbygCrdQeHyb765zWu7LOEcUT&#xA;cPt/a912R2/HUnw5jhyeXI/q+PzYb+YX5NvYpLqvltWltFq8+nVLPGBuWiJ3dR/Kd/n21VvQvKRh&#xA;VdirKPIyaDqGpJpWtSS263J4Wl5EygJIdlSQMGBVu3Sh9umw03aeXDHhFGPm6TX9g4NTPjNxl5df&#xA;fsy7X/yh1/T0abTpF1OFRVkQenMKAk0jJYN/sWqfDNzp+2cU9peg/Z83ltb7MZ8QuB8QeWx+X6iT&#xA;5MFlSSGV4pUMcsZKvG4KsrDYgg7gjNwCCLDzsokGjsQt5YWNMn8keer3y3ecG5T6XM1bm1ruD09S&#xA;OvRx/wAN0PYjX6/QRzx7pjkf0F3HZHa09HPvxn6o/pHn9/I9CO9WN9aX9nDeWkomtp1DxSL0IP8A&#xA;HxGcdkxyhIxkKIfTMOaGWAnA3GXJXyDa7FXYq7FXYq7FXYq7FXYq7FWB/nF58/wp5ZKWknHWNS5Q&#xA;2RB+KMAfvJv9gCKe5GKvlYuzMWYksTUk7kk4VXA4oe1fk/8AlpaRWa+cfMqBbWMCXTbaToQOkzqe&#xA;u/8Adjv18MVZF5l803esTFFrFYof3cHjT9p/E/qwqq+VvKk+ryevNWKwQ/E/dyOqp/E42r0yzsrW&#xA;yt1t7WJYoU6Iv6z4n3yKVbFWndUUu5CooJZiaAAdSTiBaCa3L56/MDzg/mPWmeJiNNtax2Sbio/a&#xA;kIPdyPuoM7Ps7RjBj3+o8/1fB8x7Z7ROqzWPojtH9fx/UxjlmwdRSf8Ak/yfqfma+MNtSK1iI+tX&#xA;bCqoD4D9pjTYfqzD1mthgjZ3J5B2XZvZeTVzqO0RzPd+s+X3PefL3ljR9AsxbadCEJA9WdqGWQju&#xA;7d/l0HbOQ1Oqnmlcj+oPo+i7PxaaPDjHvPU+8/gJrmO5rx783vy1XhN5k0aLiVq+pWqDYjqZ1H/E&#xA;x9PjhCHjoOFWwcVfRP5Tecz5g0L6pdyctU04LHMWPxSRnZJPc7cW99++ApTXzh5E0nzJblpFFvqK&#xA;CkN6g+L/AFXG3Nfn07Zm6PXzwHbePc6ntPsfFqxZ9M+kv194/AeCa3o+oaLqUun38fp3ER7bqyno&#xA;6nupzr8GeOWIlHk+b6rSTwZDCYqQ/FhA8sucenof5S+c30/Ul0O8f/Qb1qWxP+65z0A9pOnzp75p&#xA;e19Hxx8SP1R5+Y/Y9P7OdpnFk8GR9E+XlL9v315vas5Z792KuxV2KuxV2KuxV2KuxV2KvkP81PN5&#xA;8z+c7y8jctYW5+q2A7elESOQ/wBdqt9OFWJg4qzv8ovIv+LPMqrcqTpOn8Z789n3+CKv+WRv/kg4&#xA;q9f85eYBfXIsLQhdPtDxVV2VmXaoptQdFxCEF5Y0CTWNQEZqtrFRriQdl7KPdsKvWIIIbeFIYUEc&#xA;UYCog6ADIpX4q7FWBfnD5kOmeXV0+B+N1qhMZI6iBKGT/gqhfkTm37H03Hk4jyj9/R532k1nhYPD&#xA;H1ZNvh1/V83hPLOrfP6Rek6dd6rqVtp1ovK4unEcY3oK9WNK7KNz7ZXlyjHEyPINuDTyyzEI/VIv&#xA;pby9oNjoOkw6bZLSOIVkkp8Ukh+1I3u39mcRqNRLLMyk+paLRw0+MY4ch9p7/wAe5Msoct2KuIDA&#xA;gioOxB6UxV83fmp5MHlvzAXtU46Vf1ltABsjV+OL/Yk1HsRhQw0HCrIvIXmVvL3me0vyxFsW9G8A&#xA;7wyEBtv8nZh7jAr6hBDAEGoO4I6UwJYh+ZPk1PMOjNLbp/uVslL2rDq46tEf9b9n3+nNj2brPBnR&#xA;+iXP9bpO2+zBqcVxH7yPLz8v1efxfPfLOxfOKcHIIINCOhxWn0n5D8xfp/yzaXzsDdKDDd0/37Hs&#xA;SaAU5CjU984nX6fwcpiOXMe78bPqHZOs/MaeMz9XI+8fr5/FkGYbsnYq7FXYq7FXYq7FXYqxH81/&#xA;MX6B8hareI3G4li+q2xHX1Lj93Uf6qkt9GKvkAHCq4HFX0t5R0xfJn5YWyBeGra0PXnb9oGVage3&#xA;pxUHsxxQkQBJAAqTsAOtcKvXfLOjLpWkxQED13HqXDeLt2/2PTIpTXFXYq7FXzz+bWtHUfOd1Grc&#xA;oLALaxU8U3k+n1GYfRnX9lYeDCO+W/4+D5z2/qPF1Uh0h6f1/bbDeWbJ01PVPyL0NZry+1uVKi2A&#xA;trZiKjm45SEe6rQfJs0XbeeojGOu5/H45PV+y+kucsp/h2HvPP7PveyZzb2jsVdirsVYr+Zvltde&#xA;8o3kCLW7tR9atD35xAkqP9ZKriFfMgOSQuBxV9MflfrZ1fyVp8rtyntlNrMe/KH4Vr7lOJyJSyvF&#xA;Xzt+amgro3m649JQtrfAXcIHQeoSHH/IwNt4UzsOy9R4mEXzjt+Pg+cdu6TwdSa+mXqHx5/bbEOW&#xA;bF09PUPyL1sxarfaQ7fu7qIXEIJ6SRGjAD/KVqn/AFc0fbeG4Cfdt8/x9r1PsvqOHJLGeUhfxH67&#xA;+x7RnNPbOxV2KuxV2KuxV2KuxV4j/wA5PasY9M0TSVY/6RNLdSKP+KVCJX/ka2Kvn4HCqe+SNGXW&#xA;/Nuk6U45RXVzGsw/4qB5Sf8ACA4q+hvzAvvW1oWq/wB3ZxhAo6cnHI/hQYhBQvkvThe6/AGFY7es&#xA;7j/U+z/wxGEq9WyKXYq7FVskiRxtI5oiAsx8ABU4QL2QTQt8l397Le31xeTGstzK80h/ypGLH8Tn&#xA;ewiIxER0fJ8szORkecjfzUOWSYU+jPyk04WfkWwYpwkuzJcye5dyEP8AyLVc5DtXJxZz5bfj4von&#xA;YOHg0sdqMrP6vspmOa53DsVdirsVdir5S86aQNH816ppyrxihuGMK+EUnxx/8IwwoScHCr2f/nH7&#xA;UiYNX01jsjRXMa+7go5/4VcBV69gS8v/AD505ZNF07UgPjtrhoDT+WZOW/yMQ+/N32Hkqco94v5f&#xA;2vL+1GG8cJ90q+Y/Y8S5Z0rxdMh/L3UmsPOujzggcrlYGJ6cZ/3LH6A+Ymvhx4ZDyv5buw7KyeHq&#xA;cZ/pV89v0vpzOKfTHYq7FXYq7FXYq7FXYq+a/wDnJq7L+c9OtgQVh09X2PRpJpQQR8kGKvIgcKvT&#xA;P+ce7Rbj8x4JSKm0tbiYHwJURf8AM3FXoGtz/WNYvZuzzyFflyIH4YUMt/LO2HC+uSNyUjU/KrN+&#xA;sYCoZxgS7FXYqlHm+YweU9ZmDcWSxuSrVp8XpNx/HMjSi8sR/SH3uJrzWDIR/Ml9z5U5Z3D5jTuW&#xA;K0+rfKkH1fyvo8BABjsrdWp0qIlr+OcNqpXlkf6R+99P0MDHBAHpCP3JrlDlOxV2KuxV2Kvnn887&#xA;UQeefVH/AB9WkMx+gtF/zLwoefA4Vel/kLcFPN91D+zNZSbe6yRkH7q4Cr3zAlhv5vQLL+X+pMRV&#xA;oTDInsRMgJ/4Fjmx7KlWoj8fudR29G9JL4f7oPm/lnXvntKtpdPbXUNwho8LrIp36qQR0+WRlGwR&#xA;3soSMSJDmH17nAvq7sVdirsVdirsVdirsVfLv/OSJ/5CJH/zAQf8Tkwq8tBxV67/AM4zn/ne7/8A&#xA;7Zcv/URb4FZRcEmeQk1Jdqn6ckh6J+W4H6EnNNzcsCflGmAqGV4EuxV2Ksf/ADB/5QjW/wDmEl/4&#xA;jmVof76PvcLtL/F5/wBUvljlnavm1O5YrT6/01VXTrVVACiGMADYABRnB5PqPvfU8Y9I9yIyDN2K&#xA;uxV2KuxV4J/zkCU/xVp4FOf1FeXjT1pKfxwhDzEHFXoP5H8z56j41oLabnTwoOv00xV9EYEsY/M7&#xA;/lAtZ/4wf8brmZ2f/fx97r+1f8Wn7ny/yzs3zmncsVp9j5wD6s7FXYq7FXYq7FXYq7FXzT/zk/as&#xA;nnLS7qnwzaesfbcxTSE/hIMVePA4Vem/849Xy2/5lWsTHe8t7iFfmE9X/mVir0PWITBq15Cf2J5F&#xA;+gMaYUM4/LWYHTLuHuk/P/g0A/40wFQy/Al2KuxVIvPkJl8la4gNCLG4bx+xGWp9NMydGazQ/rBw&#xA;+0Benn/VP3PlDlnavnFO5YrT6+0K4FzoenXAIImtoZAR0+OMHavzzhc0amR3Evp2nnxY4y7wPuR2&#xA;VtrsVdirsVdir50/PS9E/nt4q1+qWsMJ9q8pf+ZuFDz8HFXpv5BW5k83Xc2/GGyfcfzPJGAD9FcV&#xA;e/YEsP8AzdnMP5eauwbizLCg6b8541I39icz+zBeePx+4ur7akRpZ15feHzHyzr3gKXwo0syRJu8&#xA;jBVHuxoMBNJESTQ5vsnOCfUnYq7FXYq7FXYq7FXYq8P/AOcpNIaXRdE1dV2tbiS1kI8LhA61+RgP&#xA;34q+dQcVT3yXrn6C816Tq5/u7O5jkmp1MXKkg+lCcKvozz1ZrDrjXEdDDeIs0bLup24mh+iv04Qh&#xA;GflxeiLVLi0Y0FzHyUeLRmtP+BY4Coei4EuxV2KqN9aR3llcWkn93cxPE/f4XUqf15KEuEgjoxnA&#xA;SiYnkXxvPFLbzyQSrxliZkkXwZTQj787sEEWHzOUCDR5hT5YWNPqj8rtTGo+QdGmrVooBbMNqg25&#xA;MQrT2QHON7Qx8OeQ87+e76B2Xk49PA9wr5bMqzDdg7FXYq7FXEgAkmgHU4q+SPOGsjWfNOqamrco&#xA;7i4cwn/ipTxj/wCEUYUJSDir27/nHrTCtnq+qMu0kkdtE3/GMF3H/JRcSr1/Al5h/wA5Aamtv5St&#xA;bINSS9u1JXxjiVmb/himbfsaF5Se4Oh9oMlYRH+dL7vwHz5yzp3jaT/yFYNqPnTRbQLyDXcTyL4x&#xA;xN6kn/CIcxtZPhxSPk5nZ+IzzwH9IfZu+s84p9EdirsVdirsVdirsVdirFPzS8tHzH5D1fTY053P&#xA;ome0A6+tAfUQD3bjx+nFXxapwqqK2BX0n5K1keb/AMr7aQtz1by7/o10v7TQqKI30xgGvipwoWaX&#xA;fPYajb3idYXDEeK9GH0jbCr2aCeKeGOeJuUUqh0Yd1YVGRSvxV2KuxV8ufm/ojaP581BQKQXxF9C&#xA;T3E9S/8AyVDjOv7NzceEeW3y/Y8L2tp/D1Eu6Xq+f7bYXyzOdbT2/wD5x38yI0Oo+XpW+NWF7ag9&#xA;1NElH0EIae5zQdtYdxMe79T0/s/qNpYz7x+n9D2jNC9K7FXYq7FWF/m35pXQPJ9yI3432oA2lqB1&#xA;HMfvH/2KV38aYq+YQcKF4OKvqb8sdCbRfJWm20i8biZPrNwDsec3x0PuqkL9GBLKcVfOX58eY11H&#xA;zemnQvyt9Ji9I0NR68lHlp9HBT7jOo7Iw8GLiPOX3PG9u5+PNwjlAfaef6HmvLNq6Wnqf/OPuiNd&#xA;+abnVnWsOmwFUbwmn+Af8kw+ajtjLWMR/nH7vwHe9gYOLKZ/zR9p/Zb6EzmXr3Yq7FXYq7FXYq7F&#xA;XYq7FXx7+dPktvK3ni6SFOOm6kTeWJHQCRj6kf8AsHqKeFMKsFBwKzT8qvPr+TvM8d3NV9Kuh9X1&#xA;OECtYidnA/mjO49qjvir23zHpEVlcR3Vm4m0q+UTWU6HkhRhyAB+R28RkkMl/L/zArR/oi4b41q1&#xA;oT3HVk+jqMBUM2wJdirsVeWfn95WbUPLkOuW8fK50pqT8RubeQgMf9g1D7Cpzb9kajhnwHlL73Sd&#xA;uabjxiY5x+587cs6Z5Gk08seYrzy9rtpq9nvLauGZK0DodnQ+zKSMpz4RkgYnq36bPLDkE49H11o&#xA;Wt6frek22qafIJbW6QOh7g9GVh2ZTsRnGZcUscjGXMPfYcsckRKPIo7K2x2KrJpooYXmmdY4YlLy&#xA;SMQFVVFSST0AGKvlv8zvO7ea/Mbzwsf0ZaAw6ehqKpX4pCD3kO/yoO2FDEwcVZX+WflZvMfmy0tH&#xA;TlZQH6xfHt6UZB4n/Xai/Tir6owJY55/85WnlPy7PqMpDXTAx2NuTvJMw+Hb+VftN7ZlaTTHNMR6&#xA;dXE1uqGDGZHn0975Lurue6uZbq4cy3E7tJNI3Vnc8mY/MnOxjEAUOQeCkTIknmVLlkkU+p/yh8qt&#xA;5f8AJlss6cL6/P1u6B6qZAPTQ/6sYFR41zke0dR4mU1yGz2/ZWl8HCAfqluWa5gOydirsVdirsVd&#xA;irsVdirsVeQf85Hz+TpfKqWupXax69C/raTCg5zEnZwyj7Mbr1J7gdaUxV8vg4qvBxV65+UX5nWV&#xA;ra/4Q80yV0S4b/QL1jvaSt2JPSMk1r+yevwk0KvQdW0jUNDvUJY8a87W6j+ywG4II6H2woegeVfN&#xA;MOrwCGYhNQjH7xOgcD9tf4jtgISn+BXYqp3FvBc28tvOgkgmRo5Y23DI4oyn2IOGJINhEogijyfJ&#xA;f5jeS7nyj5kmsGDNYzEy6dOd+cJOwJ/mT7Lff0IzsNHqhmhfXq8Pr9GcGQj+E8vd+xi3LMtwqZ1+&#xA;V/5nXfk+/MFwGn0O6YG6txuyN09WKv7QHUftD6MwNdoRmFj6w7Ps7XnBKj9B5/rfTekavpmsafDq&#xA;Gm3CXVnOOUcsZqPcEdQw7g7jOVyY5QlwyFF6/FljOIlE2CjCQoLMaAbknoBkGx4D+cf5rJqjSeXd&#xA;CmDaappfXkZ2nYH+7QjrGO5/aPt1KvJAcUKiBmYKoLMxoqjckntir6f/ACn8kf4Y8uhrpKarqHGa&#xA;8r1QU/dxf7AHf3JwJT7zT5s0Tyxpb6jq04ijFRFEKGWV/wCSNf2j+A77Zdg088suGIaNRqYYY8Ui&#xA;+WfPPnnVPN+stf3v7uCOqWdmpqkMda092P7Td/lQDrdLpY4Y8I+JeK1mrnnnxS5dB3Mc5ZkuLT0H&#xA;8m/Ib+ZvMS3l3HXRtMZZbksPhlk6xw79andv8n5jNd2lq/ChQ+qX4t2nZWi8XJxH6I/b5PqDOUey&#xA;dirsVdirsVdirsVdiryT8yf+cgND8verpvl/hqusiqtKDW1gYbfGyn94w/lU/M9sVeLad+d35i2N&#xA;xqtyNSM9xqqhWedQ4gZT8L26fYjIBIpxp7VxVhN9fXl/dy3l7O9zdzsXmnlYu7se7MdziqjirYOK&#xA;rwcVeoflz+cc2i2iaB5jhbVPLh+GMdZ7YeMRNKqP5a7dj2wq9Yh0eC+tY9b8o3w1OxryRoWpPEw3&#xA;4suzch4UDe2NoZHoPnyNiLTWR6Fwp4/WKUUn/LX9k/h8saVl8ckciB42DowqrKQQR7EYErsVY756&#xA;8laZ5u0OTTrz93MtXs7oD4opabH3U9GHce9DmTpdTLDPiHxcXV6WOeHCfge58oeZfLes+W9Vk0zV&#xA;oDDcR7q3VJEJoJI2/aU0/rvnXYc8cseKJ2eMz6eeKXDIboOwsL/ULpLSwt5Lq5kNEhhUu5+ha5Oc&#xA;xEWTQa4YpTNRFl7r+W3kzUPIFvJ5i81a0NJtGU8tJWQMkhK7er9oM4/ZWOre/UZzvaOux5RwxF/0&#xA;v1PT9mdn5MPqlKv6P6/2fNiv5k/nRf8AmJZdL0UPZaKarLITSa4HQ8qfZQ/yjr38M1DunmYOKrwc&#xA;Vekfldb+StImXzL5q1S2ieA8tO07l60wcf7ukijDstP2AR/leGZOPR5Z/TEuLl1mKH1SDJ/NP/OR&#xA;9lGjweWbFppTsL28+CMe6xKeTf7Ir8s2WDsY88h+AdXqO24jbGL8z+P1PF9e8ya1r9+1/q9293ct&#xA;sGc/Cq9eKKKKi+wGbvFhjjFRFB5/NmnllxTNlLeWWtVMi8keStY836wun6evGJaNd3jAmOGOv2m8&#xA;Sf2V7/KpGNqdTHDHil8B3uTpNJPPPhj8T3PrDyz5c0zy5otvpOmx8LeAbsftSOftSOe7Mf6dM5HP&#xA;mlkkZS5vaYMEcUBGPIJplTc7FXYq7FXYq7FUn80ebvL/AJX01tQ1u8S1g3EaneSRgK8I0HxM3y+n&#xA;FXzP+ZP57+YPNPq6fpfPSdDb4TErf6RMv/Fsi9FP8i7eJbFXl+KuxVWs7O7vbqK0s4XuLqZgkUES&#xA;l3Zj2VRUnFXvv5bf844qnpap5z+Jtni0aNth3/0iRTv/AKin5ntirX5wfkJyMuv+TrcA05XmjRLT&#xA;p1e3A/GP/gfDFXgBDo5RwVdSQykUII6gjCq4HAqa6D5k1zQb0Xuj3stlcilXiagYDs6mquPZgRhV&#xA;6tpH/OQMF5GkHnDQ4r6gAN/Z/upqD/IJAJ+TqPbFWaaF+Yn5bsQ2k+ZptIdz8VpexsYxXx5L6f8A&#xA;w+KGc6d518uypWTzBpNwn+/YbmNDXwKF3p/wWBKJm87eTYE5za9p6L4tdQivfb4t8VYP578+fktq&#xA;9iLXWrlNV9JuUK2iStKpHXhMgQAHv8e+X4NRPEbiaaM+nhlFTFsDn/O3StGtXsvIvl6DSonFDd3A&#xA;DSt4EqpNWHi7tkcuaeQ3I2yxYYYxUQA861zzJrmvXhvNXvZLyffiZD8Kg9kQUVB7KMrbUADihcDi&#xA;lqWcIKKav3PYf25u9B2bfryDbu/W6LtDtTh9GM79T+pDcs37zjXLCtNqSxCqCSdgB1JwKA9O8h/k&#xA;Z5j16SO71lX0jSTRj6i0uZB4JG32a/zP9AOazVdqQx7R9UvsdtpOyJ5N5+mP2vory95c0by9pkem&#xA;6TbLbWse5A3Z2PV3Y7sx8T+rOczZpZJcUjZelw4Y448MRQTLKm12KuxV2KuxV2KvJPzJ/wCcgND8&#xA;verpvl/hqusiqtKDW1gYbfGyn94w/lU/M9sVfNnmHzLrnmLUpNS1m7e8u5P2nPwqP5UUfCi+yjFU&#xA;txV2KuxV61+TH5U+c7/WbDzMkjaLp1rIs0N26/vZ1HVYozSqOvwlm+Gh25dMKvqbArsVecfmR+SX&#xA;lzzeZL+3ppmukV+uRrVJSBt66CnL/WHxfPpir5t84fl35t8o3Bj1iyZbcmkV9FV7d/Ckg6H/ACWo&#xA;fbCrHQcCqgOFV4OKrwcVXA4quBxVeDiq8HFWQeVvJHmfzPP6ej2TzRqaSXLfBAn+tI3w19uuKshv&#xA;fyN/M6IlLfTY516c47mAEj/no6UGbfRS02P1SNy9x2dProanJ6Yj0+/cpav5Lfme0piGhychWpM1&#xA;uF2/yzJx/HNt/KWD+d97qP5Mz/zftH60wsvyA/Mu4YCa0gswerTXEZA+fomU5XLtXAOpPwbY9kZj&#xA;zofH9TL9E/5xklJV9c1oAftQWUZJI9pZaU/5F5h5O2v5kfm5mLsQfxy+X4/Q9Q8rfll5L8s8ZNN0&#xA;5Ddr/wAfs/76eviGb7H+wAzV59bly/Udu52mDR4sX0jfv6spzFcp2KuxV2KuxV2KpP5o83eX/K+m&#xA;tqGt3iWsG4jU7ySMBXhGg+Jm+X04q+Z/zJ/PfzB5p9XT9L56TobfCYlb/SJl/wCLZF6Kf5F28S2K&#xA;vL8VdirsVTDQvL+s6/qMenaPaSXl5J0jjHQd2ZjRVUd2Y0xV9Iflt/zj3o2h+lqXmX09U1YUZLWl&#xA;bWE/I/3rDxYU9u+KvYAABQdMVdirsVdiqye3guIXguI1mhkHGSKRQysD2KmoOKvMvNH/ADjz5E1h&#xA;nnsFk0W6apra0MBJ8YX2A9kK4q8v1v8A5xs89WTs2lzW2qwj7AV/QlPzSWiD/kZirDb/APLbz/p5&#xA;P1ny/fADq8cLyoN6btGHX8cKpRJpGrQkCayuIyegeJ16fMYqvh0nVpjSKynkI6hInY/gMVTvT/y5&#xA;8+X5AttAviD0eSB4kPb7cgRe3jirMtE/5x2883jK2oyW2lxbcg7+tLQ+CxclP0uMVemeWvyA8l6U&#xA;yTah6usXK7/v/ggr7RJ1+TM2BXpNtbW1rAlvbRJBbxDjHDEoRFHgqrQDFVTFXYq7FXYq7FXYq7FX&#xA;Yq7FXYq8n/Mn8/tC8uerp2hcNV1lfhZga20Lf5br9th/Kp+ZGKvmrzF5m1zzHqT6lrN293dPsGbZ&#xA;VX+VFHwqo8BiqWYq7FXYq9L/AC2/I3zF5sMV/fctK0JqMLmRf3sy/wDFEZ7H+dtvDl0xV9NeU/Jn&#xA;l3yppwsNEtFt4zQzSn4pZWH7Ukh3Y/gO1MVTvFXYq7FXYq7FXYq7FXYq7FXYq7FXYq7FXYq7FXYq&#xA;7FXYq7FXYq7FXYq7FXYq+WfzX/OvzVrF7eaDaRS6Hp0EjwXNuTS6kKkqyzOv2R/kLt4k4VeS4Fdi&#xA;rsVTDQvL+s6/qMenaPaSXl5J0jjHQd2ZjRVUd2Y0xV9Iflt/zj3o2h+lqXmX09U1YUZLWlbWE/I/&#xA;3rDxYU9u+KvYAABQdMVdirsVdirsVdirsVdirsVdirsVdirsVdirsVdirsVdirsVdirsVdirsVdi&#xA;rsVdirwT/nI78tvVi/xnpcX7yMLHrMSDdl2WO42/l2V/ah7HFXz1irsVel/lt+RvmLzYYr++5aVo&#xA;TUYXMi/vZl/4ojPY/wA7beHLpir6a8p+TPLvlTThYaJaLbxmhmlPxSysP2pJDux/AdqYqneKuxV2&#xA;KuxV2KuxV2KuxV2KuxV2KuxV2KuxV2KuxV2KuxV2KuxV2KuxV2KuxV2KuxV2KqdxbwXNvLb3Eayw&#xA;TI0csTCqsjijKR4EHFXyP56/J7zBpPnr9BaJZS31tf1n0pk+L9zWjLI5+FfSJozMelD3xV65+W3/&#xA;ADj3o2h+lqXmX09U1YUZLWlbWE/I/wB6w8WFPbvir2AAAUHTFXYq7FXYq7FXYq7FXYq7FXYq7FXY&#xA;q7FXYq7FXYq7FXYq7FXYq7FXYq7FXYq7FXYq7FXYq7FX/9k=</xmpGImg:image>
+ </rdf:li>
+ </rdf:Alt>
+ </xmp:Thumbnails>
+ </rdf:Description>
+ <rdf:Description rdf:about=""
+ xmlns:xmpMM="http://ns.adobe.com/xap/1.0/mm/"
+ xmlns:stRef="http://ns.adobe.com/xap/1.0/sType/ResourceRef#"
+ xmlns:stEvt="http://ns.adobe.com/xap/1.0/sType/ResourceEvent#">
+ <xmpMM:DocumentID>xmp.did:F87F1174072068118083FFCA059709C7</xmpMM:DocumentID>
+ <xmpMM:InstanceID>uuid:877c9053-4997-5b44-9e97-702d22d152ca</xmpMM:InstanceID>
+ <xmpMM:OriginalDocumentID>uuid:158E45247E8EE2119A5495E790BEF36B</xmpMM:OriginalDocumentID>
+ <xmpMM:RenditionClass>proof:pdf</xmpMM:RenditionClass>
+ <xmpMM:DerivedFrom rdf:parseType="Resource">
+ <stRef:instanceID>xmp.iid:F77F1174072068118083FFCA059709C7</stRef:instanceID>
+ <stRef:documentID>xmp.did:F77F1174072068118083FFCA059709C7</stRef:documentID>
+ <stRef:originalDocumentID>uuid:158E45247E8EE2119A5495E790BEF36B</stRef:originalDocumentID>
+ </xmpMM:DerivedFrom>
+ <xmpMM:History>
+ <rdf:Seq>
+ <rdf:li rdf:parseType="Resource">
+ <stEvt:action>converted</stEvt:action>
+ <stEvt:parameters>from application/postscript to application/vnd.adobe.illustrator</stEvt:parameters>
+ </rdf:li>
+ <rdf:li rdf:parseType="Resource">
+ <stEvt:action>saved</stEvt:action>
+ <stEvt:instanceID>xmp.iid:F77F1174072068118083FFCA059709C7</stEvt:instanceID>
+ <stEvt:when>2013-04-05T00:02:23-07:00</stEvt:when>
+ <stEvt:softwareAgent>Adobe Illustrator CS5</stEvt:softwareAgent>
+ <stEvt:changed>/</stEvt:changed>
+ </rdf:li>
+ <rdf:li rdf:parseType="Resource">
+ <stEvt:action>converted</stEvt:action>
+ <stEvt:parameters>from application/postscript to application/vnd.adobe.illustrator</stEvt:parameters>
+ </rdf:li>
+ <rdf:li rdf:parseType="Resource">
+ <stEvt:action>saved</stEvt:action>
+ <stEvt:instanceID>xmp.iid:F87F1174072068118083FFCA059709C7</stEvt:instanceID>
+ <stEvt:when>2013-04-05T08:48:29-07:00</stEvt:when>
+ <stEvt:softwareAgent>Adobe Illustrator CS5</stEvt:softwareAgent>
+ <stEvt:changed>/</stEvt:changed>
+ </rdf:li>
+ </rdf:Seq>
+ </xmpMM:History>
+ </rdf:Description>
+ <rdf:Description rdf:about=""
+ xmlns:illustrator="http://ns.adobe.com/illustrator/1.0/">
+ <illustrator:StartupProfile>Print</illustrator:StartupProfile>
+ <illustrator:Type>Document</illustrator:Type>
+ </rdf:Description>
+ <rdf:Description rdf:about=""
+ xmlns:xmpTPg="http://ns.adobe.com/xap/1.0/t/pg/"
+ xmlns:stDim="http://ns.adobe.com/xap/1.0/sType/Dimensions#"
+ xmlns:xmpG="http://ns.adobe.com/xap/1.0/g/">
+ <xmpTPg:NPages>1</xmpTPg:NPages>
+ <xmpTPg:HasVisibleTransparency>False</xmpTPg:HasVisibleTransparency>
+ <xmpTPg:HasVisibleOverprint>False</xmpTPg:HasVisibleOverprint>
+ <xmpTPg:MaxPageSize rdf:parseType="Resource">
+ <stDim:w>259.840820</stDim:w>
+ <stDim:h>260.000000</stDim:h>
+ <stDim:unit>Pixels</stDim:unit>
+ </xmpTPg:MaxPageSize>
+ <xmpTPg:PlateNames>
+ <rdf:Seq>
+ <rdf:li>Cyan</rdf:li>
+ <rdf:li>Magenta</rdf:li>
+ <rdf:li>Black</rdf:li>
+ </rdf:Seq>
+ </xmpTPg:PlateNames>
+ <xmpTPg:SwatchGroups>
+ <rdf:Seq>
+ <rdf:li rdf:parseType="Resource">
+ <xmpG:groupName>Default Swatch Group</xmpG:groupName>
+ <xmpG:groupType>0</xmpG:groupType>
+ <xmpG:Colorants>
+ <rdf:Seq>
+ <rdf:li rdf:parseType="Resource">
+ <xmpG:swatchName>White</xmpG:swatchName>
+ <xmpG:mode>CMYK</xmpG:mode>
+ <xmpG:type>PROCESS</xmpG:type>
+ <xmpG:cyan>0.000000</xmpG:cyan>
+ <xmpG:magenta>0.000000</xmpG:magenta>
+ <xmpG:yellow>0.000000</xmpG:yellow>
+ <xmpG:black>0.000000</xmpG:black>
+ </rdf:li>
+ <rdf:li rdf:parseType="Resource">
+ <xmpG:swatchName>Black</xmpG:swatchName>
+ <xmpG:mode>CMYK</xmpG:mode>
+ <xmpG:type>PROCESS</xmpG:type>
+ <xmpG:cyan>0.000000</xmpG:cyan>
+ <xmpG:magenta>0.000000</xmpG:magenta>
+ <xmpG:yellow>0.000000</xmpG:yellow>
+ <xmpG:black>100.000000</xmpG:black>
+ </rdf:li>
+ <rdf:li rdf:parseType="Resource">
+ <xmpG:swatchName>CMYK Red</xmpG:swatchName>
+ <xmpG:mode>CMYK</xmpG:mode>
+ <xmpG:type>PROCESS</xmpG:type>
+ <xmpG:cyan>0.000000</xmpG:cyan>
+ <xmpG:magenta>100.000000</xmpG:magenta>
+ <xmpG:yellow>100.000000</xmpG:yellow>
+ <xmpG:black>0.000000</xmpG:black>
+ </rdf:li>
+ <rdf:li rdf:parseType="Resource">
+ <xmpG:swatchName>CMYK Yellow</xmpG:swatchName>
+ <xmpG:mode>CMYK</xmpG:mode>
+ <xmpG:type>PROCESS</xmpG:type>
+ <xmpG:cyan>0.000000</xmpG:cyan>
+ <xmpG:magenta>0.000000</xmpG:magenta>
+ <xmpG:yellow>100.000000</xmpG:yellow>
+ <xmpG:black>0.000000</xmpG:black>
+ </rdf:li>
+ <rdf:li rdf:parseType="Resource">
+ <xmpG:swatchName>CMYK Green</xmpG:swatchName>
+ <xmpG:mode>CMYK</xmpG:mode>
+ <xmpG:type>PROCESS</xmpG:type>
+ <xmpG:cyan>100.000000</xmpG:cyan>
+ <xmpG:magenta>0.000000</xmpG:magenta>
+ <xmpG:yellow>100.000000</xmpG:yellow>
+ <xmpG:black>0.000000</xmpG:black>
+ </rdf:li>
+ <rdf:li rdf:parseType="Resource">
+ <xmpG:swatchName>CMYK Cyan</xmpG:swatchName>
+ <xmpG:mode>CMYK</xmpG:mode>
+ <xmpG:type>PROCESS</xmpG:type>
+ <xmpG:cyan>100.000000</xmpG:cyan>
+ <xmpG:magenta>0.000000</xmpG:magenta>
+ <xmpG:yellow>0.000000</xmpG:yellow>
+ <xmpG:black>0.000000</xmpG:black>
+ </rdf:li>
+ <rdf:li rdf:parseType="Resource">
+ <xmpG:swatchName>CMYK Blue</xmpG:swatchName>
+ <xmpG:mode>CMYK</xmpG:mode>
+ <xmpG:type>PROCESS</xmpG:type>
+ <xmpG:cyan>100.000000</xmpG:cyan>
+ <xmpG:magenta>100.000000</xmpG:magenta>
+ <xmpG:yellow>0.000000</xmpG:yellow>
+ <xmpG:black>0.000000</xmpG:black>
+ </rdf:li>
+ <rdf:li rdf:parseType="Resource">
+ <xmpG:swatchName>CMYK Magenta</xmpG:swatchName>
+ <xmpG:mode>CMYK</xmpG:mode>
+ <xmpG:type>PROCESS</xmpG:type>
+ <xmpG:cyan>0.000000</xmpG:cyan>
+ <xmpG:magenta>100.000000</xmpG:magenta>
+ <xmpG:yellow>0.000000</xmpG:yellow>
+ <xmpG:black>0.000000</xmpG:black>
+ </rdf:li>
+ <rdf:li rdf:parseType="Resource">
+ <xmpG:swatchName>C=15 M=100 Y=90 K=10</xmpG:swatchName>
+ <xmpG:mode>CMYK</xmpG:mode>
+ <xmpG:type>PROCESS</xmpG:type>
+ <xmpG:cyan>14.999998</xmpG:cyan>
+ <xmpG:magenta>100.000000</xmpG:magenta>
+ <xmpG:yellow>90.000000</xmpG:yellow>
+ <xmpG:black>10.000002</xmpG:black>
+ </rdf:li>
+ <rdf:li rdf:parseType="Resource">
+ <xmpG:swatchName>C=0 M=90 Y=85 K=0</xmpG:swatchName>
+ <xmpG:mode>CMYK</xmpG:mode>
+ <xmpG:type>PROCESS</xmpG:type>
+ <xmpG:cyan>0.000000</xmpG:cyan>
+ <xmpG:magenta>90.000000</xmpG:magenta>
+ <xmpG:yellow>85.000000</xmpG:yellow>
+ <xmpG:black>0.000000</xmpG:black>
+ </rdf:li>
+ <rdf:li rdf:parseType="Resource">
+ <xmpG:swatchName>C=0 M=80 Y=95 K=0</xmpG:swatchName>
+ <xmpG:mode>CMYK</xmpG:mode>
+ <xmpG:type>PROCESS</xmpG:type>
+ <xmpG:cyan>0.000000</xmpG:cyan>
+ <xmpG:magenta>80.000000</xmpG:magenta>
+ <xmpG:yellow>95.000000</xmpG:yellow>
+ <xmpG:black>0.000000</xmpG:black>
+ </rdf:li>
+ <rdf:li rdf:parseType="Resource">
+ <xmpG:swatchName>C=0 M=50 Y=100 K=0</xmpG:swatchName>
+ <xmpG:mode>CMYK</xmpG:mode>
+ <xmpG:type>PROCESS</xmpG:type>
+ <xmpG:cyan>0.000000</xmpG:cyan>
+ <xmpG:magenta>50.000000</xmpG:magenta>
+ <xmpG:yellow>100.000000</xmpG:yellow>
+ <xmpG:black>0.000000</xmpG:black>
+ </rdf:li>
+ <rdf:li rdf:parseType="Resource">
+ <xmpG:swatchName>C=0 M=35 Y=85 K=0</xmpG:swatchName>
+ <xmpG:mode>CMYK</xmpG:mode>
+ <xmpG:type>PROCESS</xmpG:type>
+ <xmpG:cyan>0.000000</xmpG:cyan>
+ <xmpG:magenta>35.000004</xmpG:magenta>
+ <xmpG:yellow>85.000000</xmpG:yellow>
+ <xmpG:black>0.000000</xmpG:black>
+ </rdf:li>
+ <rdf:li rdf:parseType="Resource">
+ <xmpG:swatchName>C=5 M=0 Y=90 K=0</xmpG:swatchName>
+ <xmpG:mode>CMYK</xmpG:mode>
+ <xmpG:type>PROCESS</xmpG:type>
+ <xmpG:cyan>5.000001</xmpG:cyan>
+ <xmpG:magenta>0.000000</xmpG:magenta>
+ <xmpG:yellow>90.000000</xmpG:yellow>
+ <xmpG:black>0.000000</xmpG:black>
+ </rdf:li>
+ <rdf:li rdf:parseType="Resource">
+ <xmpG:swatchName>C=20 M=0 Y=100 K=0</xmpG:swatchName>
+ <xmpG:mode>CMYK</xmpG:mode>
+ <xmpG:type>PROCESS</xmpG:type>
+ <xmpG:cyan>19.999998</xmpG:cyan>
+ <xmpG:magenta>0.000000</xmpG:magenta>
+ <xmpG:yellow>100.000000</xmpG:yellow>
+ <xmpG:black>0.000000</xmpG:black>
+ </rdf:li>
+ <rdf:li rdf:parseType="Resource">
+ <xmpG:swatchName>C=50 M=0 Y=100 K=0</xmpG:swatchName>
+ <xmpG:mode>CMYK</xmpG:mode>
+ <xmpG:type>PROCESS</xmpG:type>
+ <xmpG:cyan>50.000000</xmpG:cyan>
+ <xmpG:magenta>0.000000</xmpG:magenta>
+ <xmpG:yellow>100.000000</xmpG:yellow>
+ <xmpG:black>0.000000</xmpG:black>
+ </rdf:li>
+ <rdf:li rdf:parseType="Resource">
+ <xmpG:swatchName>C=75 M=0 Y=100 K=0</xmpG:swatchName>
+ <xmpG:mode>CMYK</xmpG:mode>
+ <xmpG:type>PROCESS</xmpG:type>
+ <xmpG:cyan>75.000000</xmpG:cyan>
+ <xmpG:magenta>0.000000</xmpG:magenta>
+ <xmpG:yellow>100.000000</xmpG:yellow>
+ <xmpG:black>0.000000</xmpG:black>
+ </rdf:li>
+ <rdf:li rdf:parseType="Resource">
+ <xmpG:swatchName>C=85 M=10 Y=100 K=10</xmpG:swatchName>
+ <xmpG:mode>CMYK</xmpG:mode>
+ <xmpG:type>PROCESS</xmpG:type>
+ <xmpG:cyan>85.000000</xmpG:cyan>
+ <xmpG:magenta>10.000002</xmpG:magenta>
+ <xmpG:yellow>100.000000</xmpG:yellow>
+ <xmpG:black>10.000002</xmpG:black>
+ </rdf:li>
+ <rdf:li rdf:parseType="Resource">
+ <xmpG:swatchName>C=90 M=30 Y=95 K=30</xmpG:swatchName>
+ <xmpG:mode>CMYK</xmpG:mode>
+ <xmpG:type>PROCESS</xmpG:type>
+ <xmpG:cyan>90.000000</xmpG:cyan>
+ <xmpG:magenta>30.000002</xmpG:magenta>
+ <xmpG:yellow>95.000000</xmpG:yellow>
+ <xmpG:black>30.000002</xmpG:black>
+ </rdf:li>
+ <rdf:li rdf:parseType="Resource">
+ <xmpG:swatchName>C=75 M=0 Y=75 K=0</xmpG:swatchName>
+ <xmpG:mode>CMYK</xmpG:mode>
+ <xmpG:type>PROCESS</xmpG:type>
+ <xmpG:cyan>75.000000</xmpG:cyan>
+ <xmpG:magenta>0.000000</xmpG:magenta>
+ <xmpG:yellow>75.000000</xmpG:yellow>
+ <xmpG:black>0.000000</xmpG:black>
+ </rdf:li>
+ <rdf:li rdf:parseType="Resource">
+ <xmpG:swatchName>C=80 M=10 Y=45 K=0</xmpG:swatchName>
+ <xmpG:mode>CMYK</xmpG:mode>
+ <xmpG:type>PROCESS</xmpG:type>
+ <xmpG:cyan>80.000000</xmpG:cyan>
+ <xmpG:magenta>10.000002</xmpG:magenta>
+ <xmpG:yellow>45.000000</xmpG:yellow>
+ <xmpG:black>0.000000</xmpG:black>
+ </rdf:li>
+ <rdf:li rdf:parseType="Resource">
+ <xmpG:swatchName>C=70 M=15 Y=0 K=0</xmpG:swatchName>
+ <xmpG:mode>CMYK</xmpG:mode>
+ <xmpG:type>PROCESS</xmpG:type>
+ <xmpG:cyan>70.000000</xmpG:cyan>
+ <xmpG:magenta>14.999998</xmpG:magenta>
+ <xmpG:yellow>0.000000</xmpG:yellow>
+ <xmpG:black>0.000000</xmpG:black>
+ </rdf:li>
+ <rdf:li rdf:parseType="Resource">
+ <xmpG:swatchName>C=85 M=50 Y=0 K=0</xmpG:swatchName>
+ <xmpG:mode>CMYK</xmpG:mode>
+ <xmpG:type>PROCESS</xmpG:type>
+ <xmpG:cyan>85.000000</xmpG:cyan>
+ <xmpG:magenta>50.000000</xmpG:magenta>
+ <xmpG:yellow>0.000000</xmpG:yellow>
+ <xmpG:black>0.000000</xmpG:black>
+ </rdf:li>
+ <rdf:li rdf:parseType="Resource">
+ <xmpG:swatchName>C=100 M=95 Y=5 K=0</xmpG:swatchName>
+ <xmpG:mode>CMYK</xmpG:mode>
+ <xmpG:type>PROCESS</xmpG:type>
+ <xmpG:cyan>100.000000</xmpG:cyan>
+ <xmpG:magenta>95.000000</xmpG:magenta>
+ <xmpG:yellow>5.000001</xmpG:yellow>
+ <xmpG:black>0.000000</xmpG:black>
+ </rdf:li>
+ <rdf:li rdf:parseType="Resource">
+ <xmpG:swatchName>C=100 M=100 Y=25 K=25</xmpG:swatchName>
+ <xmpG:mode>CMYK</xmpG:mode>
+ <xmpG:type>PROCESS</xmpG:type>
+ <xmpG:cyan>100.000000</xmpG:cyan>
+ <xmpG:magenta>100.000000</xmpG:magenta>
+ <xmpG:yellow>25.000000</xmpG:yellow>
+ <xmpG:black>25.000000</xmpG:black>
+ </rdf:li>
+ <rdf:li rdf:parseType="Resource">
+ <xmpG:swatchName>C=75 M=100 Y=0 K=0</xmpG:swatchName>
+ <xmpG:mode>CMYK</xmpG:mode>
+ <xmpG:type>PROCESS</xmpG:type>
+ <xmpG:cyan>75.000000</xmpG:cyan>
+ <xmpG:magenta>100.000000</xmpG:magenta>
+ <xmpG:yellow>0.000000</xmpG:yellow>
+ <xmpG:black>0.000000</xmpG:black>
+ </rdf:li>
+ <rdf:li rdf:parseType="Resource">
+ <xmpG:swatchName>C=50 M=100 Y=0 K=0</xmpG:swatchName>
+ <xmpG:mode>CMYK</xmpG:mode>
+ <xmpG:type>PROCESS</xmpG:type>
+ <xmpG:cyan>50.000000</xmpG:cyan>
+ <xmpG:magenta>100.000000</xmpG:magenta>
+ <xmpG:yellow>0.000000</xmpG:yellow>
+ <xmpG:black>0.000000</xmpG:black>
+ </rdf:li>
+ <rdf:li rdf:parseType="Resource">
+ <xmpG:swatchName>C=35 M=100 Y=35 K=10</xmpG:swatchName>
+ <xmpG:mode>CMYK</xmpG:mode>
+ <xmpG:type>PROCESS</xmpG:type>
+ <xmpG:cyan>35.000004</xmpG:cyan>
+ <xmpG:magenta>100.000000</xmpG:magenta>
+ <xmpG:yellow>35.000004</xmpG:yellow>
+ <xmpG:black>10.000002</xmpG:black>
+ </rdf:li>
+ <rdf:li rdf:parseType="Resource">
+ <xmpG:swatchName>C=10 M=100 Y=50 K=0</xmpG:swatchName>
+ <xmpG:mode>CMYK</xmpG:mode>
+ <xmpG:type>PROCESS</xmpG:type>
+ <xmpG:cyan>10.000002</xmpG:cyan>
+ <xmpG:magenta>100.000000</xmpG:magenta>
+ <xmpG:yellow>50.000000</xmpG:yellow>
+ <xmpG:black>0.000000</xmpG:black>
+ </rdf:li>
+ <rdf:li rdf:parseType="Resource">
+ <xmpG:swatchName>C=0 M=95 Y=20 K=0</xmpG:swatchName>
+ <xmpG:mode>CMYK</xmpG:mode>
+ <xmpG:type>PROCESS</xmpG:type>
+ <xmpG:cyan>0.000000</xmpG:cyan>
+ <xmpG:magenta>95.000000</xmpG:magenta>
+ <xmpG:yellow>19.999998</xmpG:yellow>
+ <xmpG:black>0.000000</xmpG:black>
+ </rdf:li>
+ <rdf:li rdf:parseType="Resource">
+ <xmpG:swatchName>C=25 M=25 Y=40 K=0</xmpG:swatchName>
+ <xmpG:mode>CMYK</xmpG:mode>
+ <xmpG:type>PROCESS</xmpG:type>
+ <xmpG:cyan>25.000000</xmpG:cyan>
+ <xmpG:magenta>25.000000</xmpG:magenta>
+ <xmpG:yellow>39.999996</xmpG:yellow>
+ <xmpG:black>0.000000</xmpG:black>
+ </rdf:li>
+ <rdf:li rdf:parseType="Resource">
+ <xmpG:swatchName>C=40 M=45 Y=50 K=5</xmpG:swatchName>
+ <xmpG:mode>CMYK</xmpG:mode>
+ <xmpG:type>PROCESS</xmpG:type>
+ <xmpG:cyan>39.999996</xmpG:cyan>
+ <xmpG:magenta>45.000000</xmpG:magenta>
+ <xmpG:yellow>50.000000</xmpG:yellow>
+ <xmpG:black>5.000001</xmpG:black>
+ </rdf:li>
+ <rdf:li rdf:parseType="Resource">
+ <xmpG:swatchName>C=50 M=50 Y=60 K=25</xmpG:swatchName>
+ <xmpG:mode>CMYK</xmpG:mode>
+ <xmpG:type>PROCESS</xmpG:type>
+ <xmpG:cyan>50.000000</xmpG:cyan>
+ <xmpG:magenta>50.000000</xmpG:magenta>
+ <xmpG:yellow>60.000004</xmpG:yellow>
+ <xmpG:black>25.000000</xmpG:black>
+ </rdf:li>
+ <rdf:li rdf:parseType="Resource">
+ <xmpG:swatchName>C=55 M=60 Y=65 K=40</xmpG:swatchName>
+ <xmpG:mode>CMYK</xmpG:mode>
+ <xmpG:type>PROCESS</xmpG:type>
+ <xmpG:cyan>55.000000</xmpG:cyan>
+ <xmpG:magenta>60.000004</xmpG:magenta>
+ <xmpG:yellow>65.000000</xmpG:yellow>
+ <xmpG:black>39.999996</xmpG:black>
+ </rdf:li>
+ <rdf:li rdf:parseType="Resource">
+ <xmpG:swatchName>C=25 M=40 Y=65 K=0</xmpG:swatchName>
+ <xmpG:mode>CMYK</xmpG:mode>
+ <xmpG:type>PROCESS</xmpG:type>
+ <xmpG:cyan>25.000000</xmpG:cyan>
+ <xmpG:magenta>39.999996</xmpG:magenta>
+ <xmpG:yellow>65.000000</xmpG:yellow>
+ <xmpG:black>0.000000</xmpG:black>
+ </rdf:li>
+ <rdf:li rdf:parseType="Resource">
+ <xmpG:swatchName>C=30 M=50 Y=75 K=10</xmpG:swatchName>
+ <xmpG:mode>CMYK</xmpG:mode>
+ <xmpG:type>PROCESS</xmpG:type>
+ <xmpG:cyan>30.000002</xmpG:cyan>
+ <xmpG:magenta>50.000000</xmpG:magenta>
+ <xmpG:yellow>75.000000</xmpG:yellow>
+ <xmpG:black>10.000002</xmpG:black>
+ </rdf:li>
+ <rdf:li rdf:parseType="Resource">
+ <xmpG:swatchName>C=35 M=60 Y=80 K=25</xmpG:swatchName>
+ <xmpG:mode>CMYK</xmpG:mode>
+ <xmpG:type>PROCESS</xmpG:type>
+ <xmpG:cyan>35.000004</xmpG:cyan>
+ <xmpG:magenta>60.000004</xmpG:magenta>
+ <xmpG:yellow>80.000000</xmpG:yellow>
+ <xmpG:black>25.000000</xmpG:black>
+ </rdf:li>
+ <rdf:li rdf:parseType="Resource">
+ <xmpG:swatchName>C=40 M=65 Y=90 K=35</xmpG:swatchName>
+ <xmpG:mode>CMYK</xmpG:mode>
+ <xmpG:type>PROCESS</xmpG:type>
+ <xmpG:cyan>39.999996</xmpG:cyan>
+ <xmpG:magenta>65.000000</xmpG:magenta>
+ <xmpG:yellow>90.000000</xmpG:yellow>
+ <xmpG:black>35.000004</xmpG:black>
+ </rdf:li>
+ <rdf:li rdf:parseType="Resource">
+ <xmpG:swatchName>C=40 M=70 Y=100 K=50</xmpG:swatchName>
+ <xmpG:mode>CMYK</xmpG:mode>
+ <xmpG:type>PROCESS</xmpG:type>
+ <xmpG:cyan>39.999996</xmpG:cyan>
+ <xmpG:magenta>70.000000</xmpG:magenta>
+ <xmpG:yellow>100.000000</xmpG:yellow>
+ <xmpG:black>50.000000</xmpG:black>
+ </rdf:li>
+ <rdf:li rdf:parseType="Resource">
+ <xmpG:swatchName>C=50 M=70 Y=80 K=70</xmpG:swatchName>
+ <xmpG:mode>CMYK</xmpG:mode>
+ <xmpG:type>PROCESS</xmpG:type>
+ <xmpG:cyan>50.000000</xmpG:cyan>
+ <xmpG:magenta>70.000000</xmpG:magenta>
+ <xmpG:yellow>80.000000</xmpG:yellow>
+ <xmpG:black>70.000000</xmpG:black>
+ </rdf:li>
+ </rdf:Seq>
+ </xmpG:Colorants>
+ </rdf:li>
+ <rdf:li rdf:parseType="Resource">
+ <xmpG:groupName>Print Color Group</xmpG:groupName>
+ <xmpG:groupType>1</xmpG:groupType>
+ <xmpG:Colorants>
+ <rdf:Seq>
+ <rdf:li rdf:parseType="Resource">
+ <xmpG:swatchName>C=0 M=30 Y=70 K=0</xmpG:swatchName>
+ <xmpG:mode>CMYK</xmpG:mode>
+ <xmpG:type>PROCESS</xmpG:type>
+ <xmpG:cyan>0.000000</xmpG:cyan>
+ <xmpG:magenta>30.000002</xmpG:magenta>
+ <xmpG:yellow>70.000000</xmpG:yellow>
+ <xmpG:black>0.000000</xmpG:black>
+ </rdf:li>
+ <rdf:li rdf:parseType="Resource">
+ <xmpG:swatchName>C=5 M=70 Y=90 K=0</xmpG:swatchName>
+ <xmpG:mode>CMYK</xmpG:mode>
+ <xmpG:type>PROCESS</xmpG:type>
+ <xmpG:cyan>5.000001</xmpG:cyan>
+ <xmpG:magenta>70.000000</xmpG:magenta>
+ <xmpG:yellow>90.000000</xmpG:yellow>
+ <xmpG:black>0.000000</xmpG:black>
+ </rdf:li>
+ <rdf:li rdf:parseType="Resource">
+ <xmpG:swatchName>C=5 M=90 Y=75 K=0</xmpG:swatchName>
+ <xmpG:mode>CMYK</xmpG:mode>
+ <xmpG:type>PROCESS</xmpG:type>
+ <xmpG:cyan>5.000001</xmpG:cyan>
+ <xmpG:magenta>90.000000</xmpG:magenta>
+ <xmpG:yellow>75.000000</xmpG:yellow>
+ <xmpG:black>0.000000</xmpG:black>
+ </rdf:li>
+ <rdf:li rdf:parseType="Resource">
+ <xmpG:swatchName>C=30 M=0 Y=95 K=0</xmpG:swatchName>
+ <xmpG:mode>CMYK</xmpG:mode>
+ <xmpG:type>PROCESS</xmpG:type>
+ <xmpG:cyan>30.000002</xmpG:cyan>
+ <xmpG:magenta>0.000000</xmpG:magenta>
+ <xmpG:yellow>95.000000</xmpG:yellow>
+ <xmpG:black>0.000000</xmpG:black>
+ </rdf:li>
+ <rdf:li rdf:parseType="Resource">
+ <xmpG:swatchName>C=60 M=5 Y=95 K=0</xmpG:swatchName>
+ <xmpG:mode>CMYK</xmpG:mode>
+ <xmpG:type>PROCESS</xmpG:type>
+ <xmpG:cyan>60.000004</xmpG:cyan>
+ <xmpG:magenta>5.000001</xmpG:magenta>
+ <xmpG:yellow>95.000000</xmpG:yellow>
+ <xmpG:black>0.000000</xmpG:black>
+ </rdf:li>
+ <rdf:li rdf:parseType="Resource">
+ <xmpG:swatchName>C=30 M=0 Y=10 K=0</xmpG:swatchName>
+ <xmpG:mode>CMYK</xmpG:mode>
+ <xmpG:type>PROCESS</xmpG:type>
+ <xmpG:cyan>30.000002</xmpG:cyan>
+ <xmpG:magenta>0.000000</xmpG:magenta>
+ <xmpG:yellow>10.000002</xmpG:yellow>
+ <xmpG:black>0.000000</xmpG:black>
+ </rdf:li>
+ <rdf:li rdf:parseType="Resource">
+ <xmpG:swatchName>C=60 M=10 Y=5 K=0</xmpG:swatchName>
+ <xmpG:mode>CMYK</xmpG:mode>
+ <xmpG:type>PROCESS</xmpG:type>
+ <xmpG:cyan>60.000004</xmpG:cyan>
+ <xmpG:magenta>10.000002</xmpG:magenta>
+ <xmpG:yellow>5.000001</xmpG:yellow>
+ <xmpG:black>0.000000</xmpG:black>
+ </rdf:li>
+ <rdf:li rdf:parseType="Resource">
+ <xmpG:swatchName>C=80 M=5 Y=10 K=0</xmpG:swatchName>
+ <xmpG:mode>CMYK</xmpG:mode>
+ <xmpG:type>PROCESS</xmpG:type>
+ <xmpG:cyan>80.000000</xmpG:cyan>
+ <xmpG:magenta>5.000001</xmpG:magenta>
+ <xmpG:yellow>10.000002</xmpG:yellow>
+ <xmpG:black>0.000000</xmpG:black>
+ </rdf:li>
+ </rdf:Seq>
+ </xmpG:Colorants>
+ </rdf:li>
+ <rdf:li rdf:parseType="Resource">
+ <xmpG:groupName>Grayscale</xmpG:groupName>
+ <xmpG:groupType>1</xmpG:groupType>
+ <xmpG:Colorants>
+ <rdf:Seq>
+ <rdf:li rdf:parseType="Resource">
+ <xmpG:swatchName>K=100</xmpG:swatchName>
+ <xmpG:mode>GRAY</xmpG:mode>
+ <xmpG:type>PROCESS</xmpG:type>
+ <xmpG:gray>255</xmpG:gray>
+ </rdf:li>
+ <rdf:li rdf:parseType="Resource">
+ <xmpG:swatchName>K=90</xmpG:swatchName>
+ <xmpG:mode>GRAY</xmpG:mode>
+ <xmpG:type>PROCESS</xmpG:type>
+ <xmpG:gray>229</xmpG:gray>
+ </rdf:li>
+ <rdf:li rdf:parseType="Resource">
+ <xmpG:swatchName>K=80</xmpG:swatchName>
+ <xmpG:mode>GRAY</xmpG:mode>
+ <xmpG:type>PROCESS</xmpG:type>
+ <xmpG:gray>203</xmpG:gray>
+ </rdf:li>
+ <rdf:li rdf:parseType="Resource">
+ <xmpG:swatchName>K=70</xmpG:swatchName>
+ <xmpG:mode>GRAY</xmpG:mode>
+ <xmpG:type>PROCESS</xmpG:type>
+ <xmpG:gray>178</xmpG:gray>
+ </rdf:li>
+ <rdf:li rdf:parseType="Resource">
+ <xmpG:swatchName>K=60</xmpG:swatchName>
+ <xmpG:mode>GRAY</xmpG:mode>
+ <xmpG:type>PROCESS</xmpG:type>
+ <xmpG:gray>152</xmpG:gray>
+ </rdf:li>
+ <rdf:li rdf:parseType="Resource">
+ <xmpG:swatchName>K=50</xmpG:swatchName>
+ <xmpG:mode>GRAY</xmpG:mode>
+ <xmpG:type>PROCESS</xmpG:type>
+ <xmpG:gray>127</xmpG:gray>
+ </rdf:li>
+ <rdf:li rdf:parseType="Resource">
+ <xmpG:swatchName>K=40</xmpG:swatchName>
+ <xmpG:mode>GRAY</xmpG:mode>
+ <xmpG:type>PROCESS</xmpG:type>
+ <xmpG:gray>101</xmpG:gray>
+ </rdf:li>
+ <rdf:li rdf:parseType="Resource">
+ <xmpG:swatchName>K=30</xmpG:swatchName>
+ <xmpG:mode>GRAY</xmpG:mode>
+ <xmpG:type>PROCESS</xmpG:type>
+ <xmpG:gray>76</xmpG:gray>
+ </rdf:li>
+ <rdf:li rdf:parseType="Resource">
+ <xmpG:swatchName>K=20</xmpG:swatchName>
+ <xmpG:mode>GRAY</xmpG:mode>
+ <xmpG:type>PROCESS</xmpG:type>
+ <xmpG:gray>50</xmpG:gray>
+ </rdf:li>
+ <rdf:li rdf:parseType="Resource">
+ <xmpG:swatchName>K=10</xmpG:swatchName>
+ <xmpG:mode>GRAY</xmpG:mode>
+ <xmpG:type>PROCESS</xmpG:type>
+ <xmpG:gray>25</xmpG:gray>
+ </rdf:li>
+ <rdf:li rdf:parseType="Resource">
+ <xmpG:swatchName>K=5</xmpG:swatchName>
+ <xmpG:mode>GRAY</xmpG:mode>
+ <xmpG:type>PROCESS</xmpG:type>
+ <xmpG:gray>12</xmpG:gray>
+ </rdf:li>
+ </rdf:Seq>
+ </xmpG:Colorants>
+ </rdf:li>
+ </rdf:Seq>
+ </xmpTPg:SwatchGroups>
+ </rdf:Description>
+ <rdf:Description rdf:about=""
+ xmlns:pdf="http://ns.adobe.com/pdf/1.3/">
+ <pdf:Producer>Adobe PDF library 9.90</pdf:Producer>
+ </rdf:Description>
+ </rdf:RDF>
+</x:xmpmeta>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+<?xpacket end="w"?> endstream endobj 3 0 obj <</Count 1/Kids[7 0 R]/Type/Pages>> endobj 7 0 obj <</ArtBox[0.0 0.0 259.841 260.0]/BleedBox[0.0 0.0 259.841 260.0]/Contents 8 0 R/LastModified(D:20130405084831-07'00')/MediaBox[0.0 0.0 259.841 260.0]/Parent 3 0 R/PieceInfo<</Illustrator 9 0 R>>/Resources<</ColorSpace<</CS0 10 0 R/CS1 11 0 R>>/ExtGState<</GS0 12 0 R>>/Properties<</MC0 5 0 R>>/Shading<</Sh0 13 0 R/Sh1 14 0 R>>>>/Thumb 15 0 R/TrimBox[0.0 0.0 259.841 260.0]/Type/Page>> endobj 8 0 obj <</Filter/FlateDecode/Length 1913>>stream
+H‰”—K‹%Ç…÷÷WäÚÐ9ù~l5^ c´°ömj cýÐw"ëq«Ó4U·22'ND~ùÛW÷åç¯ÁýðãW÷úþ
+.5þëô£D÷¡Åÿùú‡û¿ØŸ/î÷×—¿þÜ¿ÿx}wѤÑÅÐ|î…gõ±äæ>¿ÙŽo¯”|
+ÕícY•Ñ}¾bñ5V7‹Ÿ©ºÌ#v7§Ÿ¥»š}MÅÍê˨|›‡m¸Ù|ʦ9·èfðÅ1øZ»ëÃO¾üˆÑ·2\m¾MNß—)Ørÿö#úôuĨÒÜÇôqN—º¯S¿ŸRt¹ûRËæ«Y‘²i ¨~fé*¼ŸÙ*×?_ÿúËëïü}E¬©5r,V¥oœTüÀ]Bá»,ÁzÙBdͲú +.Îj¦=$ÛKoµqðì>ÄbÏšöuÑ—ÃS½ÖÒq—l¯DÚ&‘<$ _[.ÌÐF_Ò4ó$Ç釉¨¥îâ
+‰ÓªuŠyŽµÎœ†°‡d»$$4G\dÀJLÒɺÏÉ@ìfÃøC‚ŽBʼnq'*,ô…ª`]£Z»õQ̈»€ý-gÝœ›™cÓrÀó±Á°T ®†Ò‡@ûµ¨¨’TÆ÷ÃQÖñ¯%G.ÇÚ}°› Q_ì¡Ø¤mÌdÞT êÝȨ/º~HPQ•÷f”Öä©Ê"tZÕˆóZöLÇC²]CÕßäeb`Ú\ì re…á.‘'i‘„_ÈŒ<+­¯²‘\®ËpñÐìG0Þ$+YX"šÚS4šŠ‘x’yËFÑJ¯÷#ï僽{£É<²TÀ;a
+Ôf±eKƹwÁŠgª«uŽ"@5SŒ­U+ÏRøÿêLÚêÿ¬4F‰E dØX@ªHŠ+:x@!FÒ[ Èš¤
+taÑ|êîM×|žOèýA2ì±ïˆ¢úÜ©ãÁ>ìåF“³5Ì€Ãß qØŠ®K';UdaµaÍz殡ü)þÌbµÛÎÔl’®k"ïÓΩ|¥cCØùì]@u­+XdÊ"/85.F®bŠ8–gú‚íÀã‰^Œ:k›4
+á’ôh˜Ò€Ó:þ]€õÙÆ®ÕÊ‹€pN$›ëå>À‰ïîïQ‹H¥®ûÔ\W» (}9ªY5¨síx(´Zz›î‰iˆ[u©QõiœªWò÷õ
+ûòÂÃ.¤†MÏÇÝ`°ûPwç€çÄó¡~œr†Û¢û˜Šk¢‹ëŠ‹¢ŠÖæj
+8;YQQbn5UO%#%=sVf8pCW@+:G(p(c,da$uF+?6rZgjP,k`g?,tK__f>7$Y2N[ntP5
+4%rAb"dd>;ajse)G@6`&CNr!E\?*;eaZCarHdp3>*.,PS3Q)l]k=87&"*D!"N/6ks
+^%V5AR%I0h;Ql?=X4`HYH")TB:7q)9`lQabr+\>:o_l1$H'&QOK]tV%f$j*<L1CDa
+s.l'LKO#K=J_^HB25^73,S^/'`Pr1a7\e\:9eQ:$PiDB>\([=LCSggbU&a)n-U6oQ
+rHl3_!2WVAM#~> endstream endobj 16 0 obj [/Indexed/DeviceRGB 255 17 0 R] endobj 17 0 obj <</Filter[/ASCII85Decode/FlateDecode]/Length 428>>stream
+8;X]O>EqN@%''O_@%e@?J;%+8(9e>X=MR6S?i^YgA3=].HDXF.R$lIL@"pJ+EP(%0
+b]6ajmNZn*!='OQZeQ^Y*,=]?C.B+\Ulg9dhD*"iC[;*=3`oP1[!S^)?1)IZ4dup`
+E1r!/,*0[*9.aFIR2&b-C#s<Xl5FH@[<=!#6V)uDBXnIr.F>oRZ7Dl%MLY\.?d>Mn
+6%Q2oYfNRF$$+ON<+]RUJmC0I<jlL.oXisZ;SYU[/7#<&37rclQKqeJe#,UF7Rgb1
+VNWFKf>nDZ4OTs0S!saG>GGKUlQ*Q?45:CI&4J'_2j<etJICj7e7nPMb=O6S7UOH<
+PO7r\I.Hu&e0d&E<.')fERr/l+*W,)q^D*ai5<uuLX.7g/>$XKrcYp0n+Xl_nU*O(
+l[$6Nn+Z_Nq0]s7hs]`XX1nZ8&94a\~> endstream endobj 13 0 obj <</AntiAlias false/ColorSpace 10 0 R/Coords[0.0 0.0 1.0 0.0]/Domain[0.0 1.0]/Extend[true true]/Function 18 0 R/ShadingType 2>> endobj 14 0 obj <</AntiAlias false/ColorSpace 11 0 R/Coords[0.0 0.0 1.0 0.0]/Domain[0.0 1.0]/Extend[true true]/Function 19 0 R/ShadingType 2>> endobj 11 0 obj [/DeviceN[/Black]/DeviceCMYK 20 0 R 21 0 R] endobj 19 0 obj <</Bounds[]/Domain[0.0 1.0]/Encode[0.0 1.0]/FunctionType 3/Functions[22 0 R]>> endobj 22 0 obj <</C0[0.701965]/C1[0.901962]/Domain[0.0 1.0]/FunctionType 2/N 1.00348>> endobj 20 0 obj <</Domain[0.0 1.0]/FunctionType 4/Length 267/Range[0.0 1.0 0.0 1.0 0.0 1.0 0.0 1.0]>>stream
+{1.000000 2 1 roll 1.000000 2 1 roll 1.000000 2 1 roll 0 index 1.000000
+cvr exch sub 2 1 roll 5 -1 roll 1.000000 cvr exch sub 5 1
+roll 4 -1 roll 1.000000 cvr exch sub 4 1 roll 3 -1 roll 1.000000
+cvr exch sub 3 1 roll 2 -1 roll 1.000000 cvr exch sub 2 1
+roll pop } endstream endobj 21 0 obj <</Process 23 0 R/Subtype/NChannel>> endobj 23 0 obj <</ColorSpace/DeviceCMYK/Components[/Cyan/Magenta/Yellow/Black]>> endobj 10 0 obj [/DeviceN[/Cyan/Magenta]/DeviceCMYK 24 0 R 25 0 R] endobj 18 0 obj <</Bounds[]/Domain[0.0 1.0]/Encode[1.0 0.0]/FunctionType 3/Functions[26 0 R]>> endobj 26 0 obj <</C0[1.0 0.839218]/C1[1.0 0.0]/Domain[0.0 1.0]/FunctionType 2/N 1.00069>> endobj 24 0 obj <</Domain[0.0 1.0 0.0 1.0]/FunctionType 4/Length 292/Range[0.0 1.0 0.0 1.0 0.0 1.0 0.0 1.0]>>stream
+{1 index 1.000000 cvr exch sub 3 1 roll 0 index 1.000000 cvr exch sub
+3 1 roll 1.000000 3 1 roll 1.000000 3 1 roll 6 -1 roll 1.000000
+cvr exch sub 6 1 roll 5 -1 roll 1.000000 cvr exch sub 5 1
+roll 4 -1 roll 1.000000 cvr exch sub 4 1 roll 3 -1 roll 1.000000
+cvr exch sub 3 1 roll pop pop } endstream endobj 25 0 obj <</Process 27 0 R/Subtype/NChannel>> endobj 27 0 obj <</ColorSpace/DeviceCMYK/Components[/Cyan/Magenta/Yellow/Black]>> endobj 5 0 obj <</Intent 28 0 R/Name(Layer 1)/Type/OCG/Usage 29 0 R>> endobj 28 0 obj [/View/Design] endobj 29 0 obj <</CreatorInfo<</Creator(Adobe Illustrator 15.0)/Subtype/Artwork>>>> endobj 12 0 obj <</AIS false/BM/Normal/CA 1.0/OP false/OPM 1/SA true/SMask/None/Type/ExtGState/ca 1.0/op false>> endobj 9 0 obj <</LastModified(D:20130405084831-07'00')/Private 30 0 R>> endobj 30 0 obj <</AIMetaData 31 0 R/AIPrivateData1 32 0 R/AIPrivateData2 33 0 R/AIPrivateData3 34 0 R/ContainerVersion 11/CreatorVersion 15/NumBlock 3/RoundtripStreamType 1/RoundtripVersion 15>> endobj 31 0 obj <</Length 946>>stream
+%!PS-Adobe-3.0 %%Creator: Adobe Illustrator(R) 15.0 %%AI8_CreatorVersion: 15.0.2 %%For: (Yoshiki Shibukawa) () %%Title: (favicon.eps) %%CreationDate: 4/5/13 8:48 AM %%Canvassize: 16383 %%BoundingBox: 0 425 260 612 %%HiResBoundingBox: 0 425.3232 259.8408 612 %%DocumentProcessColors: Cyan Magenta Black %AI5_FileFormat 11.0 %AI12_BuildNumber: 399 %AI3_ColorUsage: Color %AI7_ImageSettings: 0 %%CMYKProcessColor: 1 1 1 1 ([Registration]) %AI3_Cropmarks: 0 389 259.8408 649 %AI3_TemplateBox: 396.5 305.5 396.5 305.5 %AI3_TileBox: -176.0796 123 435.9199 915 %AI3_DocumentPreview: None %AI5_ArtSize: 14400 14400 %AI5_RulerUnits: 6 %AI9_ColorModel: 2 %AI5_ArtFlags: 0 0 0 1 0 0 1 0 0 %AI5_TargetResolution: 800 %AI5_NumLayers: 1 %AI9_OpenToView: -104 761 1 991 886 18 0 0 196 134 0 0 0 1 1 0 1 1 0 1 %AI5_OpenViewLayers: 7 %%PageOrigin:0 0 %AI7_GridSettings: 72 8 72 8 1 0 0.8 0.8 0.8 0.9 0.9 0.9 %AI9_Flatten: 1 %AI12_CMSettings: 00.MS %%EndComments endstream endobj 32 0 obj <</Length 10867>>stream
+%%BoundingBox: 0 425 260 612 %%HiResBoundingBox: 0 425.3232 259.8408 612 %AI7_Thumbnail: 128 92 8 %%BeginData: 10730 Hex Bytes %0000330000660000990000CC0033000033330033660033990033CC0033FF %0066000066330066660066990066CC0066FF009900009933009966009999 %0099CC0099FF00CC0000CC3300CC6600CC9900CCCC00CCFF00FF3300FF66 %00FF9900FFCC3300003300333300663300993300CC3300FF333300333333 %3333663333993333CC3333FF3366003366333366663366993366CC3366FF %3399003399333399663399993399CC3399FF33CC0033CC3333CC6633CC99 %33CCCC33CCFF33FF0033FF3333FF6633FF9933FFCC33FFFF660000660033 %6600666600996600CC6600FF6633006633336633666633996633CC6633FF %6666006666336666666666996666CC6666FF669900669933669966669999 %6699CC6699FF66CC0066CC3366CC6666CC9966CCCC66CCFF66FF0066FF33 %66FF6666FF9966FFCC66FFFF9900009900339900669900999900CC9900FF %9933009933339933669933999933CC9933FF996600996633996666996699 %9966CC9966FF9999009999339999669999999999CC9999FF99CC0099CC33 %99CC6699CC9999CCCC99CCFF99FF0099FF3399FF6699FF9999FFCC99FFFF %CC0000CC0033CC0066CC0099CC00CCCC00FFCC3300CC3333CC3366CC3399 %CC33CCCC33FFCC6600CC6633CC6666CC6699CC66CCCC66FFCC9900CC9933 %CC9966CC9999CC99CCCC99FFCCCC00CCCC33CCCC66CCCC99CCCCCCCCCCFF %CCFF00CCFF33CCFF66CCFF99CCFFCCCCFFFFFF0033FF0066FF0099FF00CC %FF3300FF3333FF3366FF3399FF33CCFF33FFFF6600FF6633FF6666FF6699 %FF66CCFF66FFFF9900FF9933FF9966FF9999FF99CCFF99FFFFCC00FFCC33 %FFCC66FFCC99FFCCCCFFCCFFFFFF33FFFF66FFFF99FFFFCC110000001100 %000011111111220000002200000022222222440000004400000044444444 %550000005500000055555555770000007700000077777777880000008800 %000088888888AA000000AA000000AAAAAAAABB000000BB000000BBBBBBBB %DD000000DD000000DDDDDDDDEE000000EE000000EEEEEEEE0000000000FF %00FF0000FFFFFF0000FF00FFFFFF00FFFFFF %524C45FD3FFFA8A87D7D527D525252595252527D7DA8A8FD6CFF7D7D5252 %275228FD0B522852527D7DA8A8FD64FFA87D525227FD105253FD06527DA8 %FD5FFFA8A852522752525227525252285252522EFD0F52277D7DFD5CFF7D %7D28FD0E5253525252535252527D5252527D5253527D525252A8FD58FFA8 %5252275252522852525228FD1B5227597D85606160613C61608584FD4BFF %7D27FD20525352525259FD04525314141B141B141B151B141B1B8BA9FD44 %FF7D5227522752275227522852275252522752275227FD0752275228FD10 %5236141B1415141B1415141B14151485AFFD40FF7DFD10527D7DA8A8FFA8 %FFFFFFA8FFA8A87D7DFD05527D5253527D5253527D52525259151B141B15 %1B141B151B141B151B61FD3EFF52272752285227522E522752525227527D %A8A8FD0FFFA87D525228FD0B5227591415141B1415141B1415141B141514 %85FD3BFFFD045228FD0752275252A8FD06FFA8A884A87EA87DFD04A8FD05 %FFA87DFD0552595252527D5252527D141B141B151B141B151B141B151B14 %1BAFFD38FF52272752275227522752275227527DFFFFFFA8A8FD077DFD04 %A8FFA8FF8461A9FD04FFA8FD0C5227531415141B1415141B1415141B1415 %141B60FD36FFFD0D52A8FD04FFA8A87D847DA884A8A8FD07FF851B151B1B %AFFD04FFA859527D5253527D5259527D5259141B151B141B151B141B151B %141B151B3DFD34FF52272752275227522752272752FFFFFFA8A8FD057DA8 %A8FD09FF8515141B1415141B85FFFFFFA87D27FD0A5259603D1415141B14 %15141B1415141B141514FD32FF7D52275252522752525227527DFFFFFFA8 %7E7DA87D7E7EFD0BFF851B141B141B141B141B1BAFFFFFFF84FD05525952 %52527D527DFFFF851B141B141B141B141B141B141B1AFD30FF7D27275227 %522752275227527DFFFFA8FD057D84A8FD0BFF8515141B1415141B141514 %1514FD04FFA827FD09522E84FFFFFFAF14151415141B1415141B141536FD %2EFFA8522752275252522E5252527DFFFFA87DA87DA87DA8FD0CFFAF1B14 %1B141B141B141B141B3DFD06FFA85252527D5253527D525252FD05FF851B %141B141B141B141B141B85FD2DFF7D275227522752275227527DFFFFA87D %7D7D7E7DA8FD0DFF1B1415141B1415141B141584FD08FFA8FD0B52FD05FF %A91B141B1415141B1415141BA9FD2BFFA8275227525252275252527DFFFF %A87DA87D847DFD0EFF85141B141B141B141B141BAFFD0AFFA85252525952 %52527D52527DFD06FF1B141B141B141B141B141BFD2BFF28522752275227 %52272752FFFFA8FD057DA8FD0EFF14141415141414151415A8FD0CFF7D27 %FD0952A8FD06FF1B14151414141514141485FD29FF7D5252522752525227 %5252FFFFA97DA87DA87DA9FD0EFF3D1B141B141B141B141BA9FD0EFF7D52 %7D5253527D525952A8FD06FFAF1B141B141B141B141B14FD29FF52275227 %522752275227A8FFA87D7E7D7D7DA8FD0EFFA815141414151414141560FD %0FFFA8FD0A52FD07FF8415141414151414141560FD27FFA8275227522852 %2752277DFFFF7D7E7DA87DA8FD0FFF61141B1415141B141514FD11FF7D52 %52535252527D52527DFD07FF141B1415141B1415141BFD27FF5227275227 %5227522752A8FFFD067DA8FD0FFFFD0914AFFD12FFFD0A52A8FD06FFAFFD %091485FD25FFA85227522752285227527DFFA8A87DA87DA8A8FD0FFF8515 %141B1415141B143DFD13FFA8527D5253527D525352A8FD07FF611415141B %1415141B14FD25FF7D275227522752275227FFFFA87D847D7D7DFD10FF1B %14141415FD041484FD13FFA8FD095259FD07FFA8151414141514141415A9 %FD24FF5252275227522752277DFFFF7DA87DA87DAFFD10FF141514151415 %141514FD15FF7D525253525252595259A8FD07FF14151415141514151485 %FD23FF842727522752275227277EFFFD057DA8FD10FF84FD08143DFD15FF %A8FD0952A8FD07FF85FD0914FD23FFA8275227522752275252FFFFA87DA8 %7DA8A8FD10FF61141514151415141585FD16FF7D527D5253527D52527DFD %07FFAF1B141514151415141BFD23FF5227275227522752277DFFA87D847D %7D7DFD11FFFD0914AFFD16FF7DFD08527DFD08FFFD0914AFFD22FF522752 %2752275227277DFFA87E7DA87DA8FD11FF15141414151414141BFD17FFA8 %52525253FD0552FD08FF61141514141415141484FD22FF27272752275227 %5227A8FF7EFD047DA8FD10FFAF0E1414140EFD0414FD17FFA8FD0952A8FD %07FF84140E1414140E141460FD21FFA8522752275227522752FFFF7DA87D %A87DFD11FF85151414141514141461FD18FF5352527D5252527D52A8FD07 %FFAF141514141415141414FD21FFA8272727522752272752FFA8FD047DA8 %FD11FF850E1414140E1414145AFD18FF7DFD08527DFD07FFA9140E141414 %0E141414FD21FF7D27275227522752277DFFA87DA87D7E7DFD11FF60FD08 %1485FD18FF7DFD045253525252A8FD08FFFD0914FD21FF7DF85227272752 %272759FF7D7D7D7E7DA8FD11FF610E140E140E140E1484FD18FF7D27FD07 %527DFD08FF140E140E140E140E14FD21FF7D2727522752275227A8FFA87D %A87D7EA8FD11FF36FD0814AFFD18FF7DFD04527D5252527DFD08FFFD0914 %FD21FF7D27522727275227277DFF7D7D7D847DA8FD11FF610E140E140E14 %0E14A9FD18FFA827FD0852FD08FF140E140E140E140E14FD21FF7D272752 %27522752277EFFA87DA87D84A8FD11FF361414140EFD0414AFFD18FFA8FD %08527DFD08FFFD04140E1414140EFD21FF7D27272752FD04277DFFFD057D %A8FD11FF360D140E140D140E14A8FD18FFA827FD07527DFD08FF140D140E %140D140E14FD21FF7D27275227522752277DFFA87DA87DA8A8FD11FF36FD %0814FD19FF7D52525352525259527EFD08FFFD0914FD21FF7D27272752FD %042752FFFD057DA8FD11FF5A0D140E140D140E1484FD18FF7D27FD07527D %FD08FF140D140E140D140E14FD21FF7D27275227522752277DFFA87DA87D %7EA8FD11FF5A140E1414140E1414A9FD18FF59FD075228A8FD08FF14140E %1414140E1414FD21FFA8FD052752272727FFA87D7D7E7DA8FD11FF850D14 %0D140D140D147EFD18FF52275252522E5252527DFD07FFA8140D140D140D %140D14FD21FFA8522752275227522752A8FF7DA87DA87DFD11FF84140E14 %14140E140E85FD18FFFD055253525252FD08FFAF14140E1414140E1436FD %22FFFD052752272727A8FF847D847D7DA8FD10FFAF0D140D140E140D1436 %FD17FF7EFD0952A8FD07FF7E140D140D140E140D61FD22FF7D2752275227 %52272752FFA87D7DA87DA8FD11FF140E140E140E140D14FD17FF7DFD0852 %7DFD08FF610D140E140E140E1484FD22FF7DFD0627282752A8FFFD057DFD %11FF14140D140D140D140DAFFD16FFFD045228525252277EFD08FF140E0D %140D140D140DAFFD23FF275227522752275227A8FFA87DA87DA8FD11FF85 %0E140E140E140E1484FD15FFA8FD0952A8FD07FFAF140E140E140E140E14 %FD24FF52272827272752272752FFA87D7D847DA8FD10FF84140D140D140D %140D36FD15FF7D27FD0852FD08FF850D0E0D140D140D145AFD24FF7D2727 %52275227522727A8FF7D847DA87DFD11FF0E140E140D140E140DFD15FFFD %09527DFD08FF14140E140D140E140DA9FD24FFA8FD092752FFA8FD047DA8 %FD10FF5A0D140D0E0D140D0E5AFD13FFFD0452275252522752A8FD07FFA8 %0E0D140D0E0D140D14A8FD25FF7D275227522752275227A8FFA87DA87DA8 %FD10FFA9140E140D140E140D14FD12FFA8FD0A52FD08FF5A0D140E140D14 %0E145AFD26FF7EFD062752272728FFA87D7D847DA8FD10FF300E0D0E0D14 %0D0E0D84FD11FF7D275252522852525227A8FD07FFA90D0E0D140D0E0D14 %0DA9FD27FF522727522752275227277DFFA87D7DA87DFD10FFA90D140D14 %0D140D140DAFFD0FFFA827FD0952FD08FF0E140D140D140D140D36FD28FF %A8F8FD09277EFFFD057DFD10FF360D0E0D0E0D0E0D0E0DFD0EFFA8275228 %5227522E5227527DFD07FF5A0E0D0E0D0E0D0E0D0E84FD29FF7D27522752 %275227522752FFFF7DA87D84A8FD0FFF84140D140D140D140D145AFD0DFF %FD0B52FD07FF84140D140D140D140D0E36FD2AFFA8FD06272827272752FF %FF7D7E7D7DA8FD0FFF300E0D0E0D0E0D0E0D0E5AFD0BFF52522752525227 %52525227A8FD06FF840E0D0E0D0E0D0E0D0E0DA9FD2BFF52272752275227 %522752277DFFFF7DA87D7EA8FD0FFF0D140D0E0D140D0E0D0E5AFD09FF53 %FD0952277DFD06FF840E0D140D0E0D140D0E0D84FD2AFFA8FD0C27F852FF %FFFD047DA8FD0EFF840D0E0D0E0D0E0D0E0D0E2FFD07FF52272752275227 %5227522752A8FD05FF5A0E0D0E0D0E0D0E0D0E0D36FD27FF7DFFFF7D2727 %2752275227522752275227522752FFFFA87E7DA8A8FD0EFF850D0E0D140D %0E0D140D0E0DA9FD04FFFD0C52A8FD05FF36140D0E0D140D0E0D140D14A9 %FD25FFA827275252F8FD0A2728272727522752A8FFA8FD047DFD0EFF5A0D %0E0D0E0D0E0D0E0D0D2FFFFFA85252275227522852275228527DFFFFFFA8 %7E0D0D0D0E0D0E0D0E0D0E0D0E84FD24FFA87D21FD042752272727522727 %2752275227522752275227277DFFFFA87D7D7DFD0EFF360D0E0D0E0D0E0D %1484FFFFA8525227525252285252522E527DFFFFA95A0E0D0E0D0E0D0E0D %0E0D0E0D0E7EFD24FF7D28F8FD0D27F8FD082728272752A8FFFF7D7D7DA8 %A8FD0CFF5A0D0D070D0D7EA8FFA853275227522752275227522727525A2F %0EFD050D0E0D0D0D0E0D0D070E7EFD24FF52272752275227522752275227 %522727527D272727522752275227522727277DA8FFFFA87DA884FD0CFF7E %0D367EFFFFFF7D5227FD0C52140D0E0D0E0D0E0D0E0D0E0D0E0D0E0D36A8 %FD23FFA8FD102752FFFF7D20FD06275227272728272752A8FFFFA8A87DA8 %A8FD0AFFAFFFFFA87D2728275227522752275227522752520D0D0E0D0D0D %0E0D0D0D0E0D0D0D0E0D5AA8FD22FFA87D21FD0427522727275227272752 %2752A8FD04FFA8272727522752275227522752272727527DA8FD0EFFA87D %52522752275252522752525227522852520E0D0E0D0E0D0E0D0E0D0E0D0E %0D0D0D85FD23FF7D28F8FD0E277DA8FD06FFA8FD0B2728FD052752527D7D %7E7DA87DA87D7D5252FD0527522752275227522752275227522E0D070D0D %0D070D0D0D070D0D0D070E5AFD24FF522727522752275227522752275227 %522752A8FD09FF5227275227522752275227522752275227522727275227 %52275227522752275227525252275252522752525227532F0E0D0E0D0E0D %0E0D0E0D0E0D0E0D85FD24FFA8FD1227F87DFD0AFF7D5220272728272727 %522727275227272752272827522752275227522752275227522752275227 %5227522753070D0D0D070D0D0D070D070D0D5A7EFD24FFA87D21FD042752 %2727275227272752FD05277DFD0CFFA87D27272752275227522752275227 %52275227522752275227522752275227522752285227522752527E0D300D %300D0E0D302F5A5A85A8FD26FF7D28F8FD112752A8FD0FFFA85227F8FD08 %27522727275227272752275227522752275227522752272727537EFFA8FF %A9FFA8A9A8FFA8FD2AFF5227275227522752275227522752275227522727 %7DFD13FFA87D272727522752275227522752275227522752275227522752 %28522752275252A8FD34FFA8FD1227F852A8FD17FF7D52FD052752272727 %522728275227522752275227272752527DA8FD34FFA87D21FD0427522727 %275227272752FD05277DFD1CFF7D7D5252FD052752272727522727275227 %5252A8A8FD36FF7D28F8FD112752A8FD20FFA8A87D7DFD07527D537D7DA8 %A8FD38FF52272752275227522752275227522752275227277DFD69FFA8FD %1227F852A8FD68FFAF7DFD0527522727275227272752FD05277DFD69FF7D %52F8FD112752A8FD69FF5227275227522752275227522752275227522727 %7DFD69FFA8FD1227F852A8FD69FF7DFD0527522727275227272752FD0527 %7DFD6BFF52FD112752A8FD6DFF522727522752275227522752275227277D %FD6FFFA8FD0C27F852A8FD71FF7DF85227272752FD05277DFD74FF52F8FD %072752A8FD75FFA8272752275227277DFD78FF53272727F852A8FD7AFF52 %27277DFD7CFFA827A8FD77FFFF %%EndData endstream endobj 33 0 obj <</Length 65536>>stream
+%AI12_CompressedDataxœì½ûŽ%Éq§ùù¹ U)<îÁ],—ÊYíˆ#‚¤æ‚Á€(5KTº«‰¾HË}úu3ÿ}ææ'«»I‰3”€é[í~NÄÉáñ…™…'þìûÙ/þüá×_þíû?_ÞL÷wögO_½÷Í—_ýäÞ{ïÿòóÏ¿ýú›¯¬ëG?ÿñ}ÙÞLõMyþJoüï¿úú×â/½™ë‹/¶öþË—_ÿý‡øpÿ‹¿ÿð·ßþûz÷ãûý¸¾úËß|þ¾¾þwïþñÃg_~|óþ·_ÿ˜­Ûy~÷M}uý‹í/Êrþd=ï~j/¿ûøï¾þúÃÿW_,ûr.µïñËo?þúÃÇß<~ùÿþä~º_çí~Þ§û½Øñøùû¯_¿ãÍ2/óý¼]oÎu:õÞç/?ûö‹÷¿ùÙW_~öþ믟¾üü˯¾þÉýÓïÞ}¼ÿé»ßÔWÞÝ?~þ«_|ûÕˇÏß×ïøÅ»oîK±Ýñð—eþÕã·>ÿõøö‹¿}_¿ýr]Ö½üÊ·õ7_×ÔíÙ[÷ñ«¿ü¢öüâý7ßÔ?®~’íÒ§Ÿþ—Ÿÿ€ú=µüè¿þüýo>øA¨;è¿ýX[þêËß~ñî«°Õï—óJ_jÕ‡ÿòý¿ý¼îOÿú˵¿Ùî—i³÷ÿÖ;ëWòwýy9ö7Óqí÷e^î×e{s•ëº¿ŠÞØwÕûüðþŸ~rÿ¾üø¾í–‡¯¾ùE;>ë:Míßí•Ÿûùû¯þæã‡oêߺ[×ÕöËO¿üõûÏr?Çú/Ÿ¿óÝáKéÿnoø廯~óþ›zX¿üüÛo|È|BÝïõîwïí¨•öýÛ÷ùåô¿ñÏË´Þ»íËë*÷çY¿ÝÙ¶n_tYãKÿwÛ°mÆ6ÂÖz¤~VÝ_õá7>þDÛñ«÷Õ‡_÷ãyÌ÷gû—ÿùoÎô¿‹ÿµ¿³~åo¾yÿQwGO?MãbzóÓ_ÔO|ûñ×O_~aûýk÷u4|¬Cåó/Ó^‹ÿöWêêßþ¶ýõÞþU=D?ûêÃGÛæÝðWÎ_ýìóoëKÿî«/¿ýí_~ü»/ï~ÔÎö_~õî³ú¶û¿þÛÿþþ³oê«Žþ_¿øöÃ7ïß¼ûðÛï†ê×úêý}{±®ìMþÿ¯ýüþïêùÕWo½o?þãûÏ¿ümÚlô¼ûøëûÿôî«ßþð¦öù»ï¾º÷þØò_}øÇúÊ»ºú¶{ßï±Ñ:6~[w˜¯âo¹ù€ïyCzé÷ø wßü}EÑû¿þ:¶ÝšãÞú~x{¿øÌFßW÷_}ûõßßÿòË/?ÍŽ/ÅÖÕí½öþŸñ3_áã_l;èõ'é ·ŸT™ó¯îS껿ûê‹ÿš·þôîóÏ?üæ«w¿ýûŸ}ê>ñz|R{íX¿ûâo¿üüÃ×_ôñ”z~öî«o>|öùû_üîëoÞñ}[³½ñw>þºD§[ÿk¿üâ·AÔæÝoßû6¿ùûç/bƒÛ¯*3cÿüÏïæûljÀÿî«w¿þPá]£ž¿ùøñÝï}ÿuÝ—ß}ª³^6êF~}÷_ïþÏ»õi}\Ök=×cÝ×m]×eײNËËòvy^ž–Çåa¹jTt,û²-ë²Ô0§Ì/óÛùy~šç‡ùšÏù˜÷y›×»Ís™§òRÞ–çòTËC¹îþ¯»éþÏ~õøUýÐv=¬©©^![²ßoõª8ù[ê5éWß÷–ǯc Çøò›ú±Ëý«|Ç»êvŸc'³Ï=;jÏÎiÏ–ºo§i*Sý°i¶iŸŽéœ®éazœž¦çéíôR¦RÊ\–²–­ìå(g¹êÎz¬;í¹î¼—yª;r®;´Æ–uïwu7_uw?ÖÝþ\wÿË2-¥Œ¥”­œ£¤«¬ÇzОëÁ{Y§z çz@×z`÷z€Ïz êZŸ×·ëËÝ6me›·e[·mÛ·c;·k{Ø·§íy{»½ìÓ^öy_öußö}?ös¿ö‡ýqÚŸ÷·ûË1å˜åXíØãî8ëx8§ãùx{¼œÓYÎù\ÎõÜÎý<Îó¼Î‡óñ|:ŸÏ·çË5Õp¾–k½¶k¿Žë¼®ëáz¼ž®çëíõr÷0=”‡ùayX¶‡ýáx8®‡‡‡Ç‡§‡ç‡·/Ócyœ—Çõq{ÜÇóñz|x|||z|~|ûøò4=•§ùiyZŸ¶§ýé¸{:Ÿ®§‡§Ç§§§ç§·O/ÏÓsyžŸ—çõy{ÞmœÖ¥0V‹VË5—=‚¸Û±ú}o©c¬¤øo¿_¯7×±¯÷yíO¾üƒ£ó6òÚ¾ õáã{J^÷e(¼¼¼¼}y~yzy|yx¹^ΗãeÙ^Ö—åe~)/ÓÛ—·oß>¿}zûøöáíõö|{¼Ýßno×·ËÛùmy;=¿<¿}~~~z~|~x¾žÏ»çãy¯»w­»y®»{zz©»þ¹‚Çz(®zHŽzl¶zŒ–z¬ÊÓôøRÝs=†õX^õ˜õØnõ/õX—Çéîá¥üç:ë`¸ê 8êàØê Yê`)ÓõRGÏsEu4]uTÕ¬£Ž°µŽ´¹Ž¸é|©£ï¹ŽÂÇ:¯ó¼«Cs¯Ct­Cu®Cv:^êð}®Ãø±ç«룎פֿó¥Ž÷rLûKÿÏõ<x¬çÃUÏ‹£ž[=O–z¾”}ºÛ^ê ô\O¤ÇzB]õÄ:ê ¶Õm©'\Ù¦õ¥žÏ¿?~ïFþ.ÓwøÓ
+ïÊ:Ìë¬ ª{»B©î’
+¨½‚ª~t…V½·Ìþ4¦_võ C<úþêÞÒù×™»2p³»³Öhk¼½œ¹F]ã×èkË‹3Ø(\œÄÆâÅylD®L¾«»ÌÀlh>Ï致aúÉQm°¶åÅ‘=9¶ ܳÃÛð½:ÂërWQ%¹/§/—#ýÁ±n`r¸?;àmyqÌOŽú⸟ùýºÜÕ!±9ýw¿~8ýJpùÕàÁ¯~Uxò+ó_ly±¥^%Úâßû®ýµë¢¥ý³iÙ}9´œZ.-Zc©§´…my®#ªFmÝ݇ûæC~ÕgÍ>ôm™üxñ“à­ŸÏúóý„xð“âj'Æ©ï½û ²ùI²ú‰²hwµ]ç»Ñv¨vmÛÍm—?úidËuçǤv¤v?³6?»V?Ã?Ëf?ÓlñÃnÀϺ·~æ=ûÙW—;-9—/m<Zv_6_ÚПܶ^øÇë4½Ø©ûâ§ï[?…Ûò¤åQ˃–KËËK;[ö;?ó}ñcôš¸ÿ2àÞ}Š¹7Èý.è~
+»Ïw¯È›Øëèá›ñ›¾ó …;‡;‰a1Á08È ¹AùéNêÒ(Ú5~ñ¹hÄ0Vžbˆ\¢õƒÂÿŽ»><JQŒRO¨Føþɡ.w¿ÏÕãÓ<p°ûá.ÑîÝîFÀëOD)Ä)D*Ä*D+Ä+5bñ€…EA aË]D.Ä.D/Ä/D0Ä0D1çxà®öÏéË¡eײùZìLqR¿øâß]Ï~†µåÑ—_Ú§´_v_üÜ€ãíÂÑÈgg䔌_Þúòì‹íz¢>úÉúà'ìå'íé'î¡“×NßÍOáºÜ9¨Uú…^|yë‹ïøzz?ù)þè§ùƒŸê—Ÿî§ŸòvÒ×îüÌßÚe©]wÇu#jÃ[åA#‚1áÙ¹ðälxt><8#®Æ‰»ö׶­níŸvjà˜¶8.+D^Cɳ®tíâWéèPHÿþeùÁef¹ëÿ9,?ôÏô]Ë–XÞ~ïòÜ—»Ü¸¹<}zyüÞåá.®fŸZ®ï]ÎO-wŸ¸¾^öï]¶¾4ðµÈò%ÁÜeàåü>#o€^»„ŒØ{ ¾OgúŸÌõíϼûÎlÿ‡óýOfüwõ$¿Éøÿ9ÍúïZÚÿÇËúïZÚÿýYåÙY©ÿPùÿT¯oŸ_êx.õú°ÔÓz«P:*]¯zyÌ
+|¿ß}ϵxñìñøûg_gQEhóUw_ýh I݈mæÁ7e{ò Ú&my± ßùø*~­Ÿýz¿¨°´ùuoé‡ç9?Ø–Û?O <{<P#[ž¦; Šs«'yÀÞ2‚Ý#…ã‹.,jxôÈÁb‡gjaËótçDñ`bn•5ËZšá™LK—N0.2ÚŸåÛjÿ¼µÃ–·ÓGÅ£¹Õ¾<¹°ìe¿>¦åò¸ÂfšÔ‹ï|lùž®Ë?ôƇlU´$û›i?Ö1žù÷ý‹î«û§n¬ÕÞ˜ßs²ÿ©Æÿ`iƒÿS üÃËÍ5ã_~Ñi›ñbáòÂVxs÷Â×áÍïàܽ*Ž!Îw9Ÿsf«‘‘Îmm vÆp'<òÜ¥¨§Ç=D>Š}¢èö¬áõ ôöPÔ²Ð(q­ÂG+tÙ2©ÜõâÄyëìyRáëÑÉDùëô˜Áî<
+Þk«7{D\¢*öâ±ñ[ñ±ýó¨ÙƒHzªTvܵڎ#wUÕlñ zœý,rf¿UíÙ맨¦=xˆ}©ªæ±öÑŠE­ª£ËD»ñÑ.­ßvÜ‹Ö·>bŸ}Ô>ùÈmËÃ_–._ÚŪ•¸v 鶴K›nFè’§;=^áú»ÁùûáP/ÍGVÿà[¿ׯ'Ÿ|ïÌ¿¥½¢‰Jï?ûòóxwÿüå7L^ªpÝw?¿)óv_jº¹¯žÅZó°ô³ž»ö«o=lø­ÇåÜ/ÿÏ¿óæÿSÿó¿×κ_ïzÿ_ÿÛtÿkïÿÏ?¯ÿO[bÃ_Ô®ñ£þ*zôiÞ3þ¹+¯÷Ñ?ç¯?•”ÿÃÿèÏþ;핉½Òûܽ¼9ÛBy³oËâl}—õlg©GÞÞqù~®1íêíuß­½îóuÿY[c¿TQØçÅÞ³W²ù{¦ÉשÛòOY–U¶Š*ë²[ ö–õœWkO5ðôU&k×])xÿÔÖYl}ë+m•«¾T›õ/*mÇbmû#ô)B[×v,³¿eÝOo—coíö)u ñeÖeÞ­¯òûô÷Tò[»žþå¶2ùÇÔXøŒ0Õ3n¿ên_ö¶ÓÎÅÚ{½ìXûª koë¡Ï©‡si}ËuÕuç7K¥öý~Öo¼íÖÞ¶åðv9XåXüg=3këZìÿ_uDÙþXê´Þ®±y[c©»w¿¬¯L³¿§^¡Š¿g­Gµ¶÷º?ìåÂ>[ÞÔ˜÷¾«¬ö–ãÚü»­u[ûÚvßÄV¯Mmõ]Rüû.ö'¬oj3û{«F}½, ëÔõ½ë¬»»6©xû<Z³^$}/Û‘ÓǶøÑ,Ûæ[=V?˜s9NoÚwµv X¥<?À‹!Ö>ÏÙøfû¡¶÷ÃÛuÔõujà㨎žû´zéôæ¤aw,küe5sò±Fí=«¿çºŽö1SývrÚp>fšü ¨Ç½ýi¥hkDþuj€á§æ>ÅXÖ­n§Ž•Õ>§Îú}¬½ÕƒfCâ¨vkû±Ò ÙŽÉß³55¸¹|æØ°›ê WÛ5̘ûÐ<ýcê_ì=e¿|éØý4º®É_ŸÊ¹s
+Ôð¿âuÍs;V?¡Ï:ö[{óöQƒ8ÖiG¬~Å¡ù{ζKêª=çÑvA"b€iÞUSaK×¼½L—··ýl@«£×Öy©ÿÛÖzl#è¬o^‚tÖ,s']m»}Ig}sû‹}@oõdØN:k—uϤ«]ç¾vÒY»ltÖ^¶‘t›–{ÎÞ2otÞžÒùVNºÚnØé¼½¤³>ßw"µ¯¹“ζYãÓtöש“ÎwZ餫íYä ÒÕ¾
+ÝNºÚ®;¤“n³“rH·m(+¤«­ù˜:éj{¯‘tµoŸ®NºÚ®ñs'ÝVƒ¢© ¤«]5¦>‚tµ]'½~^#éjßâ„éj{;öNºÚ®YÊHºÚw^[n;jœµé¬y”‘tÖwîtÞ®CÔÕv±/›Qg}†+PWÛ–0ê¬=M#êlkê¨KÛ0ÔYsÙFÔY_Y:êü=GG·÷uÞ·tÔY{›;êìëÕSp@íÈãì¨óãY:êl„œËˆº:.¿³ÑPW›–3ê|Ü•u66ÒQWÛ5î訫m_7£ÎƸ­êœ-GG·ÏuÞwuÔùy³tÔ9‹¦uÆšëê¨óöÙQgíózºþ¯Ë5κ¶} ÔY»^uÖ®y〺ڷìÓ¨³ö4ºÚž[ü éjO©yvÎÚõø鬽Ÿ×@ºuröêvÍ9o·伫¬9k—(‡œµ§ö9K†Ì´röžÝ9ã¬y´ˆ0gßìX®`œï­õ ÆÕö^Ê90®öSësÆÕöU/TÁ¸ÕÎÆ:´ãj×rYüÖ W›{«3®6½…PÁ¸Úw­ËŒ[Ï76g!WÛ˲näjߦ8Ë!WÛ¾o€\mïó¼«}‡Øé«ízm?r«ýç9@®öÍóÙ)WÛuÕÊÕf½lœå¬onôqÊY»´ᔳ¶}ÝL9ë«aRP®¶·­EZN9k/Ë1PÎúæ7:åÒ6ŒrÖÜ5ð œtË%œrÖ>Lrmc œ÷µÐÃ)çÓN2§œí‘«ìålO–: œQÛP®ñµ½³‘´ [­¶9x6&Èùà\€œµ—} ÈÙ€Þöc€Üj¶íÈùI0]9o—k€œ÷-k@®aæ È9†–=CÎaÕÈãóö\rÖž'È-çëÄÕúzâêïH‰«µo×Ú7$®ÖΉkmß&®Ö•×ÚW{ý6q]Î!qµUrâê›WïJ‰«µsâêí›ÄÕúrâj휸Ú_v›¸ÚΉ«ï´”¸Öö«Äu¹Æĵ¶‡Äu¹^%®µ+%®µ5$®ëô:q­}CâZÛCâZÛ·‰ë:‰km‰km¿J\×2&®µ=$®ky¸Ö¾œ¸ÖfN\­y›¸Z_N\­×µ¼N\k߸Z;'®Ö¾M\­/'®iιò:q]˘¸ú{Râêí›ÄÕûRâê“WÛæmâjû1'®v8sâjä6qµq”×åWv·‰«Í”¸Z;'®6œo×åW?Râêí›ÄÕûRâj휸z{L\­+'®ÞN‰«µ?•¸.åuâj})qµfN\kûUâj}9q]¦1qµöMâj3zrâj휸Zû6q]¦!qµ·äÄÕÛcâê[M‰ë2‰«·oWëˉ«µsâjÛ¼M\í æÄÕwZJ\—ò:q]ʘ¸Öö¸.åUâºÌ9q­­!q­íW‰kí×Ú×ey•¸Ö®!q­í!qµ×o×Ú7$®µ=$®µý*q­}9q]Ö!qµæmâj}9qõvJ\—õuâj}9q­í!qµömâjëäÄ5mÃPgÍÛÄuYÇÄÕß“Woß$®Þ—WkçÄÕ¾Þmâj;2'®~<Sâj#ä6q]ʸ.eL\}ÜÝ$®66s⺔1q­íW‰«ñœ¸:[Râêí›ÄÕûRâêçMJ\Ecâj¬É‰«·SâjíO%®óò*qµ®œ¸Z;'®Ö¾M\k߸Z;'®µ}“¸Öž!qµvN\­}›¸Î ³Wsâêí1qõ®”¸Z;'®Ö¾M\çeL\í=)qµæmâjß,'®¾·RâZÛ¯×Ú7$®µ=$®óú*q­]9q­Íœ¸Öæ«Äµö ‰ë¼‰«ýÎmâZû†Äµ¶‡Äµ¶_%®µoH\k{H\çýuâ:ïcâ:ïCâZ›¯Wëˉ«µsâ:ï¯Wëˉkm‰«µoWëˉkÚ†QΚ·‰«tJ\­׶Θ¸z_J\ýcRâj{ä6qµ=™W;¢9q­Gü6qµ‘”×yWx7‰«Δ¸Z;'®6 o×yW? Râêí›ÄÕûRâÚ0ÓWÇИ¸:¬Râê픸ZûS‰kÙ^'®Ö×WGJ\­}›¸Ö¾!qµvN\kû6qµ®œ¸Öö¸Úë·‰kÙ†ÄÕVɉ«obL\½+%®ÖΉ«·oWëˉ«µsâjÙmâj_8'®¾ÓRâZÛ¯ײ‰km‰kÙ_%®µ+%®µ5$®åx¸Ö¾!q­í!q­íÛĵv ‰km‰km¿J\Ë9&®µ=$®µý*q­}9q­Íœ¸Zó6qµ¾œ¸Z;%®å|¸Ö¾!qµvN\­}›¸Z_N\Ó6ŒsÖ¼M\Ë9&®þž”¸zû&qõ¾”¸úǤÄÕ¶y›¸Ú~̉«Îœ¸Ú
+g#boj;±#ÏNøíj£×™7Y{lc&;y"ÛæÔ›<“×ÀÞä©lÙîM–ËÚ¶
+ÊWŠµ
+Ê÷éZoƒr¦8”;_{Lî_uŒÉ·åØSH¾·¬¸‡ä-}CòsjUT…ä5JPõÁCrû±ë&$·¡TRH^Cå6Ø’×uÎó&$ßæ¹xŠÉ·UñŽbr…ùcPîã©ås)ë’ƒòc)ëmP^ÇÄž¢òsWíÖ ¯uÔ¹.7å-áî1ù5oí‚©˜¼^«¬$5Æä–6ú“×¼õ»LÖAžžbò-…ãEã•Ç>
+Kû{Zjæ±´µëØ£ü)ìþqijq¨4ÛÕ1j“z·=0j³çuĨÛmœ´3j_§µøøXGŽÚ‰z”ÎQ»tŸKç¨M?kíÎQ;í¯µÃÔ„í«³ÔšÍ@í,µ¾éè,5¢406–š°}Î#KMØnçxc©±d[:LMØÞËÓÒ¢³€©í²uî0­ ÙZ‡i VñS¶·+`êÂöµ0uc{?¦ö½DJ§©Û“ôwhj»ëÔîòÓ¢†KRÛÿ‡v^(Þþ'‚ÒÝ't-RÁ ­R÷µõ5 ¥~ö\AR?áÎy ©ëÚÇ$u_»ƒÔ]ìµ u_û:¤øÛ€Ô­é¶S¤fAÏe Z»ÉñíBV›Ç2`Ôîv(£±aÔ=ës0ꟼïQw¯§-0êë´} F½kŸ£þ1Ûua½ µÝ¸•mòýu[{_Œº­Ý˜çÝ:µA·n#Fm`®AÑÚò[ P´Ä~é-­LDå]D­]–¢E ˆZ»m¶AÔ†Û22T?. µvû¡‚ÆТï82ÔÕȶ‡!ܦù¼ÎmÉmƒpnFÎË@8ëóûÙN8Ó–#L´Æ|ÌßÌunB½ãÍ ë³Þ\…níÀ›IÚG»>;Þ\ä>;ß¼½ xó®i¼a\ƒ7kû„77·Ï%ðfÛ˜¶9ðfíösA7û‚ÛR‚n¾»Ö€›ù«WØfìÙÑf¦ì¶63´½›Ðf®T¡Í$í³†Ž¶M3½2Ú¶-Â:G›I½€N7“´Ër$º™ƒíg¨èfŽ6¶sÆ|lE¸A·mk’ÓÍmÿuá­¶iŒkW½ìA73’í~xs{èf]6˺y»¥N7“œçvé
+ºYß^JÐÍœìe¹oÖ¶Læ›{Ûí`úyÛßp¶3ßü³[bå{Ï…ë–59ßÚ:Wæ›wí7ÿa†7·Ô§sà›»î-ör¾ùÑllr¾Ù¹öyà›)Ú¥ý‡ŸûÛÚF:|ó‘·.ß|p¶ÌÑMýeÛp¦h/Û5
+æl(´X­a®ž­åËs6¢Ý«h˜3°œGÇœµ[¾Ü1Wt¸À\QîæŠnPfÎù”Õ«sÎ4îVœoœ+JGÎÍ>/aÏœ›ùIQqÎÚž­7й:ÙÅ
+·:ësò tîŠ/ýV®ýi¥…w:ûÆ¥ôÄunS¡t¦µ®×˜¸ºúz­º¹²Î:³kmÞB&I¸KKnt³~
+sÖöT½}צpgÈYÏÒŽàáb¥O¾ä¬Ùê‚Á8³œµß‚°ö¼õ™*Ö^·q¦ŠùÙm£Ž8W¼[ÑÏçíiœ­â›m·œqît·ÛFÎ8¸Û9Œ³¾cï³Uš*~㬽µà.gßPìtÆý~'Œ3{õ<Çé*Å‹‹G0ÎLÙ-å¬&Ö^Ç8]Å\³^aœ9Ú_Ž¸bUݯqµÐËWÛ>sÆ™]Êšg¶—¼Ä83¶—³OW±×ż`\1­ç¬&hŸŠÝ qµ]ñ5Þ…(VÊØúl×­ÛÌG\!ùHˆ+TXĸB#Æ™ä<·ü4 ç¾õÙg«Ë­Ê³vÑm* g}ÓÔg«Ä69k¯û8[Å?{rþÝE[ca¶Šw-}¶ŠëâKŸ­b_Ïlà 9s´Ï³ÏVñã9Ï9"W»+öžkŸ®Rà­(çCo§«Øð<ÛL6VN_:æj{Z–qºŠò­ÝDpÌ9XŽ>]ÅÛ-YÌù™Ò2Yç\#ÍœsMãtßÎÔ§«X[7°sÞž^MWñ_›<†pÎ+›Ëœ³ŸU hœ3oò:Ǽլm•ì3+¥à5ÒY!\·§u(Û Î|í­ÝuÔÙï!(' ÔÙ9¹÷´õ°™³kGµ§†¨@mö,ýn«´ÓÔïC ygÔ¹*~Í:3²ç£ç­‡M{ÞƼÕN~c ¨³]Vö^3¥õÜÇ®^\ÜzÞê?D¹ô™yvF[:›W¸ÎýFÄe{§ç­ö¥×5FsÓ¦…:›p,Z6ÔÙŒó’oD˜}Ì=o5C&;ê&Mêɨk²YgMN߷κ©ß¨ÖMúXg5¾Vh¬+ª5fÖ¹øÜóVo—ž·–¢’gfùÖgÏ[ÍÉ>ÊÖYWÛÛ´¬³ßÉšzÞÛ€u>³xD}tË‚êì-=œkk y«w-=ouY|éykÑq ¤³G†œ=oµÃ9O½>g?¸#éêHÒ“tÆ×£ô %6ðÊ9æ­V/­gƒÆŠé⩃®ŽçC³ft§ÝŠk«8èŒ,ÇÑo¸žÍ1@ç¿^\ú WGÍÖAg(š”YºÚ§9dιÓï©ô®§_í×[Î…’@:¤óÙ«*GÒA2ë\Ùb²Ë ×Ék¸ w.ƒ\ØλA
+ë˜îá³äÚ¯…¹2bÇ\fµ+#>¯²Ä:^ò³±ä¿Õ·áaʈµ÷îr¸2²ÙOÎaŒØp½b•ö|ã«ØÀ÷gæ¬W(#v^ᣛ2bç¦ÝÀÐ:®ŒøÌÉ9Œ›½x6Óh-šx¸„häÆH{˜ÍƈmA¿@àƈÍÍ4ÀÇð\ý±;çÚ~Á•›ÒÉO¥lí±<Gé?¾àʈMWô\ÊHL •2bÓFÏŽ€vÀlŽÝƈ½e‘ýaƈ½Ü­±6-Êg¤6Ôll›Yå@ÛŽ?22 TÎH TÎH TÒÈ€RI#Ri#Ry#KåKåKåd–J  6m$x*mdà©´‘à©´‘à©´‘§ÒF‚§ÒF¨ÒF J  J¨²F Ê  Ê¨»¬‘ Ô]Ö@ÝçNËÒ.üíW‰¨»¬ˆº›5NwY#§»¼pºË§»¼‘ŒÓ]Þ8Ý›7Mwy#™¦»¼ÑtoÚ0Ý×xüQÀt—6Lwi#Àt—6’aºKú
+ ´C!v($™v($Ð…Ú¡dÚ¡@;h‡B’i‡BíPHD; ’L; h'ƒØadØa@; ’  ’v2H‚vÍ ØÉ h'‡$h7—íšC2ÀNIÀNIÀNÉ
+IÀN
+ °C!É°C!v($À…$Ã…D°Ã v2H2ë0H` ¬Ã yÅ:)$ëäë
+9{C$’u’HuÒHuòHÔÉ# ÔÉ# ÔÉ#ɨ“F¨“F¨“F2 NI ®i$A:i$é¦H÷餑餑 ¤“F¤“FéJDÜÃÃÔlþ^NI ®Y$éd‘éæN1#I& ¤Ã"uX$ux$ Ôá‘dÖá‘À:<X‡G’Y‡G"Ö¡‘À:4’Ì:4X‡FëÐH2ëP@` ¬C#ɬC#uiÎ:i$uÒHD:,H‡E’I‡FéÐH If‰X'‹$P'‹d@,’@Ìu²HÔÉ" ÔI# ÔI#P'$P'$P'd@4P'‹$P'‹d`,’`,’`]‰\y`If ¬Ã#vˆ$vˆ$À•Øá’dØá’
+èÐI
+ž´’¡‚'%$*xÒJ¢‚'­d¨àI+‰
+^ßF«àI+JxÒJ¨áÉ*‰ž¬’¡†'­$jxÒJ¢†'­d¨áI+!­•UÑž¬’!Ú“UÑž¬’ˆöd•d
+IN
+IÎ’sRH‚srHàIæ‰8‡BçPH2çPHà
+  C!É C!t($€…$ƒ…Ðá
+÷Ãuë:$G˜.b;qoúˆû"‹æ¼h÷EìXøƒ
+å‹Ô¶OJÀ±v<‡Q®‡Îs›Ã±C®Ç‹¸/²¸6ë´zß$›_d²ûYGFìúÞEŽ&ŒXP¯¿åh÷Ø—3ÖñŸq´¸ŠUܱ»„×Ü}»aw\ݱóŒ'4_¤Øt÷¥û"uÇñEJ;XͱÛKFŠU_®.Œ”†÷ž«og[“/RÚ\¹ðE҃ȱÓÕ}‘¢ßôÇQ4®uš/R¿!šû"¥Í
+ÉÀ:9$ÁºBÎÞP'‰d@$’@,’@,’u²Hu²Hu²H2ê$‘ê$‘êtÏ|@ ¨“DéH2éH  ¤Ã"ɤÃ"tX$"I& ¤C"™bnÿUÆ°.$H7Åœt!‘$Ò…D2Eºß$’)ª"M"I¨[–Ø;Žº‹D¨[°Hë,’ƺ‰D¬[Hë,±.,±.,’ĺ°Hĺ°Hĺ°HëÂ"ëÂ"ëÂ"I¬Ã"ui­Hß,’Œ:Y$" ¤C"ɤÃ"tX$‹$³n‘E"ÖI" ÔI"P'‰$PsA$’u’Hu²Hu²HÔÉ" ÔÉ" ÔÉ"P'‹ÔI" ÔI"X'‰$X'‰$XW"WX‡F’Y‡GëðH€"I†" °Ã$v˜$v˜$À“Øa’$Ø!’
+V <¬*xX%¹‚'«$*x}­‚'«d(áÉ*¡†'©$jx’J†ž¬’¨áÉ*‰ž¬’¡†'«„´VRID{’J†hORID{’J"Ú“T’ˆT
+S[ŒÛÛB‰íã­¯âB‰H¡„’Úöa†Pbí£Kg+ßz¹ ŸÄŽ¶ž.â>‰†½?Äë~ó*×½o£=Äms۾Ƨøï-­oDè$6jý1.šyìåÁ¥¯c:‰ükÙC'±óéhFë$vN®ÝtqÄ*‘Ët„O2Û$–æ!­íe?Tî“Ø*×:ɬè$µída¹úf|Ut’yog:ÉœB†NbõP ˆÐI¬ðì?ê/¤¶]eÔ:ípmmî2>‰½ÇF>‰½FY›&e²h
+ÄÞRô<›iå [ÿO *$*$*d@¨t’@¨t’@¨t’ÌPÙ$ÁPÙ$ÁPÙ$C¥“
+âIF( E#¡h$¡h$ „J#ÉE# x$$#DE# „J#Ú4’ ¨4’ ¨4’ M# €J# €J#
+b}§t»•mDzT;vóÚŸGr¶œÔÏt\kë¹!î‚Ø©‡–u¼Èg}®©³Ãâ#lb“ןãO¦­ã³œýá"6|çX§åÊi“Aì Xë[‘Aì4³ˆÄNÃkŠG˜ø)ii¹ÍDE)W{Ü‘dËâÌÉ žé·qã6ˆmBOØqÄ*!–‰Äø\};[{NˆË ÖœÚÉæ2ˆTÖþt!—A¬¯^sB±bÁŒR¼í¢Öá'.ŠnA¬m12ˆímßÄú,LıöÞåãÓ§œgóŸ@É •  • H¥‚ •
+He‚He‚ $•
+$•
+$•
+2T*Hà´¹ AS¹ Må‚Må‚Må‚ 4• 4• N¥‚ 8•
+8•
+8•
+2àT*HàT*8EÉ8ŧ!ð!$ó!žºLBLñA€)>0ÅÉ0ŦòA`)>Hf)>,•JB2JB@)B(EÉ(Åç
+©ú‚¾A… pÂBª¾… o`!èXHÕ7˜ô .ƒ ©
+‚ÂeR8Ȫp!(d
+RN`‚À†T… Aá
+R2D‚ĆT‰ Aã
+‘—Ð I¡#’B'Fä%tbDRè‚I#òÒ91"©sbDÐ9!"/"’:'D$unÏÜ×µhƒ&§Î I¡ Dä¥sâDRçŽÔ°H5/P¤ê :(‚Њ¡ƒAèàD:8‘ªtp"(œJ'R•N¥ƒAé
+P‘—Ð I¡*’B'Tä¥tbERéÄŠ¤Òí¹M®J*R”R¥ƒ‘ÔŠT©‘ÔÁ‰ up"Uê
+¼B—mHè FªÒAŒ u#HÄH‘:€¤`©©R0‚ÔŒ u
+ߺ ‘*rû•«/W¹]Ð*· )*·‹Aåv1#¨Ü.f¤ªÜÌ"·‹Aäv1#Uäv1#ˆÜ.f‘ÛÙ‚‘Ûñ´Håv¶1R¹]ÐH•¹]Ä2·‹AævQ#UævQ#È\¶!™ÛÅT™ÛÅ sû½ÎÓŽüÍ+ve6‚ÌíwžôºÌíÂFªÌíÂF¹]Ø2· ©2· Aæv÷ÎójçFªÎíâF¤s»°„n6R…n6‚ÐíÂFº]ØHº]ØJ· Aéva#Uévq#(Ý.n¥Û{î‘«Ò¥ƒAé F¤t@#Uë€F¤u0#hÌH; Äh±©b'h±ƒAì FªØA vP#ˆÔH;¨ÄjDb4RÅh±Aì€FªØ v@#ˆÐH;ÈÄNèb:RÅt±I±:RÅNäHŠÝ¶dÙÅNäÈKìDŽ¤Ú‰IµÛÖ‘EªÈ‘T;‘#©vBG^j't$ÕNèHªÐ‘—Ú‰ûHµ;’j'vä¥vbGRíhµ zä%v¢GRì‚I­ÛsÓÒË/,ä8µnÏ3ßÐ:Á#/­<‚Ö uÀ#UëîUWªù'ôR=R¥zDR<‚ÔT©Aê€G:à‘*uÀ#HðR<R¥NôJ=‚ÒA|(]Â#Eê’Aë’‘Ø%:RÕ.ÑÉ]’#è]’#UðAñAò©š—誗첗ìHÕ=Øt/Ù„/Ù‘ª|ÉŽ }ÉŽHû@Gªö%:‚ø%:‚ú%:Råt$×zBGr­'täµÖ?’k½¥m±Ø@òZì É-m
+B2‰Ù„dš‡¦µDHž;Û2NVÉs'ÏÚc!$Ïø[!yþ}~"$Ó£š;>Ç*$b;&smê'ÎØØÞf"$v=¶žÉýQ¯a©w\# ’ËBÊç"H®_bFñõ¯’ÇfO Abó£a@ØüøÜ?ñŸÛªÝö$—ëÔ"Hl#@!ÛPX¼‰}M^ôCÉmëÓ»ñ›+0Ôö¬ F"$·uÚ!¹5øo„X/Y¬ÉíE­ŽDHl¼õ7Br{É­#’û—øºAH¦Õ;Öoî
+) B
+C‚‘T!"AH¡HR(’ª¤P$(©(’TRQ$KI…¤œB’j*„䥦BHRM…¤š
+!y©©’TS!$)§bH^r*†9B’r*„¤Ê©’”S$È)I•Sä‚=… ©z
+A‚ž:A‚˜BT1!ALAHS’*¦ $ˆ©´„¤j) Z*„)!©R
+B‚”‚ ¥ $UJ@R!$(©’*¤ $éj!„„¤
+) B
+B‚‚!M„DBš‰„„¤èh"$¡£IHG“ )Bš‰„4 „‚¤
+©t„!©:*„!AFAHªŒ‚HF!HQ$Û‹ ‚… AE!H>T4’¢qÉHã’!‘Æ%DR4.!iœ()\R$Eá H$pP$I
+ B‚ !©B‚À p $Uà@H8N IÕ7é›äMIQ7$ˆ âARÅ ‚qƒ AÜ Hª¸A n$èIÕ7ô „}!©úÖ3ŸJè '„¤ê úB‚À !©úB‚¾ o $UßÀ?Ð7„¤*
+·Ú…!©
+B‚ p $Eá@H$p‰Hà!)
+—I(\$R¸$HŠÂ%A"…K‚D
+—IQ¸$H$q‰Hâ!)—‰4.i\"$Eã! ƒ ‘Ä%AR4. i\$Ò¸$H>4.’¢qÉHã’!‘Æ%DR4.!i\R$R¹¤HŠÊ%E"™ƒ"Aæ HRæ@H9d„¤ê :B‚ÎT!Aç@HÐ9’*t0$:”„¤H ZA‚ÖAT­A‚ÔA u$Uê H:¤NIU:”„¥!©JB‚Ò t $Uê@H:¤„¤j¤„©!©RþÔ u $Uê@HºÕFHI•:¤„©!)R—‰´.i]"$Eë! ­K‚DZ—IѺ$H¤uIHë’ )Z—‰´„DR—I‘ºDH$u‰Hê!)R—IH]$Òº$H¶I‰´. i]$Z—IѺdH¤uÉHë")Z—‰´.)i]R$Eë’"‘ÖA‘ uP$©u $h ZBRµ„­!Aë@HªÖ u $h IÕ:i ZBR´‚­A‚ÔAT©ƒ Aë HRëD¼´NIj]$)u"H^Z'„$µnC•¥u¼¤NIJ’”:!$/©B’R'„$¥NÉKê„¤Ö !I­BòÒ:á©uBHR넼´NIj]¶!­BòÒ:!$©uBHRëöܲ¤Ö u $h] $Ué@H¤t$Rº$HŠÒ%A"¥K‚DJ—IQº$H¤t‰Hê!)R—‰¤.I]"$Eê! ©K‚DRA²½8²Kûcÿ`“ ‘Ò%Aò©t $Ué`HPºÝzI: „Š¡ƒ"©BE‚Љ"I¡E²„NI
+’:!$/¡B’BI꜒—Î !IB’:'†ä¥sbHÐ9!$©sBHªÎ‰ IA’BÉKçD¤ÎhXèIÕ9t‚¡ƒ ©BB‚Ð t $Ué@HP:”„¤* JB‚ÒT¥!Aé@HP:’ªtà( JBR•„¥[m„Ò !©B'„!Aç@HŠÎ%B"K„D:—IQºDHBé H:’*t$ BAR…‚¡!Aè@HªÐ t $I:  BAR•‚¥ƒ AéöÜ%¿”.’¢tÉHé’!‘Ô%DR¤.!I]R$’º¤HŠÔ%E"©ƒ"Aê HRê@H:¤„¤J”„©!©RB‚Ô u0$Uê`H$u+ñtHI‘:¤‚©ƒ ©ZA‚ÖA u$UëD u$HI•:¤„©!©RB‚Ô u $Uê@H:¤„¤J”„¥BR…ü¡!Aè@HªÐ t«:’ªt $H RBR¤.I]"$’ºDHŠÔ%BR—‰´. ’¢uIHë H$uI©K‚DRB"¥K„¤(]"$RºDH¤t‰¥! ¡K‚DB—ÉöÂÈ"ÆJB—‰„. ’¡K„¤]2$ºdH$t‚HŠÌ%D"™KŠD2ERT.)© *E’*'„‘!Aä@HªÈ rÄÛ¡r $Uå@HP9T†¤ª ‰T„•!)*A‚ÊA r$Uå HP9$ˆI9T‚•ƒ ©*B‚Ê r $Uå„ r $ˆI9D„‘!©"B‚Ê r $UæÀ?9d„¤Ê 2·Ú™!©2B‚Ì s $Eæ!‘Ì%B"™K„¤È\"$!sIHæ’ )2—‰d. é\$Eç’ Ù¸ „DB—IºDH$t‰Hè!)B—I(]$Rº$HŠÒ%A"¥K‚DJ—ɇÒ%BR”.)]2$Rº„HŠÖ%D"­KŠDZ—I»¤H$vP$ˆIŠÄ„±!©bB‚Ø v $Uì@H;ƤŠ ‰Ä„±!)bA‚ØA v$Uì H;$ˆI;Ä‚$ÅNÉK설Ømè²ÄNÉKì„¤Ú !IµÛ8²(j'„$ÕNIª’—Ú !IµB’j'„ä¥vÂ?Rí„¤Ú !y©’T»lCjÉK설ØB’Z·çŽ%µ„­!Aë@HªÖ„Ö%A"­K‚¤h‰¤. I]$Eê’ ‘Ô%B"©K„¤H]"$’ºDH$u‰©K„$¤. I]$Eê H¤tIHé’ ùPº…©[ ‰´n1$»‘µ[‰änQ$Ò»E‘Á[‰/)$/)’Ô¼DHP½DH½DHªî {‰ |‰TåK„éK„íƒ!©Ú— ‰Ä/Ô/’"$¹ÖA’k=$¯µž’\륶i±'‚äµØA’[Ú HrG+9zíh!É ­’ÜÐ
+!ymh!Éý¬’tÝ !y¹î„¤ëNIºî„¼\wBHÒuÛ›ôÜ !yyçNIz<wBHÒs—mÈs'„äåºB’¾;!$é»BR}w $øî@HðÝT߉6´$¬ô HêJ‚„• +=’"IHþB"ý[IÀ…H!‘.„¤HàBHB“ ‘.‚¤ˆà"H$ƒ‹ ‘.‚äï*^ùï!±«æPrxdÜñJ+½´õŒô~¾R?¿(9,´ù΀òsX‘ + *‰áH1¬Å“ú0õ‹¨TlŽË6’'9lþÿá…±‰WõÕcÿ|$Y‰ÚG„ö
+®Ä&¶gÚË:#–l %›ùO½$‡˜›_lÌëjWzkÉ#†J6'©J]’à¶7Vòü­gõŒˆ9Ø'ÖŽ}Õ&yîá¾òGWø±òXqƒ%~>v"ádÉsÅéß•ÿLh‰õÖí[”Ci÷Ù6›¶³<‰ûM?Šò$àoǵʓ<“%@U°Be3aŒg›l¶X†ey’_º*DusT̼·p:ü˜HTõºÃÛAu’_Lï×­5óX†O²ä°€¸m'9Ìõ~®;þ}µ¨)´Ä&Mßš-±±ïI½D&= /#Ù+ØeÇbKNa9t¢Fû3'Ø[r: Ð’-9íÙßÕIΨ”Zb*Wäh‰9ñÏž£%§Å %Jb¿Ù<è ´äp¨1?†(³hmÌ¢8±$‚-±@o_.W¡ëYCžÉ–Ø5öùÀ–˜² QÀ¿§ÕÏ'6ŸmÑUÔø/þâþúëßüöÏþíø+»Tzý_By‰¯ ”_A()¾‚P^â+ñƒ’â+奾bPR}Å ¤úŠAy©¯0””`;,¶mL)“*Á”2A‚)e‚SʤJ0¥L`J™ ÁÔ2)L)4XÊÒ`(o Š²4X,Jj00ÊKƒ¡Q¶äPR„Qª¢¤;‰’
+ ŠòR`X”T``”T`h”¢ÀÀ(©À¢QR€ÁQ^ b]å… ©i"ýÍš&E³¦‰ô7kšH³¦IÑ߬H"ý¥¦IÈ/%MŠúfI©ïj Ô7Kšõ…G‘ú‚£ ¾à(U}áQP_xÔW<J_xÄ ñH©ê ‚ú¤¤ú
+Hy©o
+HIé‚ô²LH©z‚Þ¤ w
+j›Rå6¹ƒMAî`S>å6¥Êl
+r›‚ÜÁ¦T¹ƒM‘ܦ x )Uð@SP<Ð4¥*t
+Šç4ʵvØYà¤H^8‘äeI^8)’—N$yYàD’—N–æeitJŠxÊKõ
+ª¥RUJÕSAöÀTªì© {`*Șʧì©TÙSAöÀT=0•*{`*’=(dJ¥Ê”
+²¥‚ìA©TÙTAöLñÓ“½¬uRd/kHö²Ö‰d/kÙËZ'’½¬u"ÙËb'Kö²Ö‰dP%eRå%{°*){‚URõ U^ª®²%¨²dO¤ÊKö6ÖdÈ^ *KõĪ¼eO°Ê’½-%Z²¸JU=Ñ*Kõ„«,Õ¯òV=+Kõ(z‚êQô¤ªEO=Šž {=©²GÁd¢'’=jžTÙ£æ ²—MHö¨yReOÀ
+²'^%eogKSdOÀJÊž€•”=V^¢'`%EOÄ
+¢±REbуXAô VªèA¬Hô
+ª°RU`ÕƒXAõD¬TуXAô V=ˆ•ïDOÄÊKôD¬¤è±’š'bå¥y"VÐ<+©yV^š'`%5OÀJjž€•—æ‰YIͳ#8ßIó({R5²'hžÊž y”=©’GÙ$²'HuOŠäQöɳ²$OÐÊ[ò„­,É·²4/À•·ä‰\Ù’YIÉZ©’´’’µ’š¶òÒ<¸•Ô<À•Ô<È•"z€+)z+)z +/у]IÑËú'½¬RD/ëŸHô²þ‰D/ëŸÑËÚ%½¬¢—åOŠèeù‰Þj"Dò'EóÄ®Hò@W<Е*y°+Hì
+’»REvѼ’š'xå¥y‚WR󤾩y‚W^š'xÍ»’š'vå¥ybWRóÄ®¤æ‰]yižØ•Ô<Á+©y‚W^¢'x%EOðJŠÞÎ>ú-zÀ+Uô€W=àTx¥ªðŠTvÕƒ]©ª»‚êÁ® z°+UõÀWP=ÇUü,7T/+ Õ£ŠD/+ Hõ²JQ½¬€"ÕË
+(R½,²T/+ HõÀWRõàW^ªÁ’ªÂ’ªÃò’= –-ñ•”=ø•*{âWRõ
+Eª—¥PŠêQ
+E¢—¥P$z”B)š—eL¤yY
+%4/+¡ÍËJ(Ò¼ÕDh^VB)¢Æ"ÕƒbAõ Xªê± z`,¨KU=0TŽÙƒc©²Ç‚ì‰cAõàXªêÁ±Hõ„± z`,UôÀX=0DŒ¥Šž04Ž̓c©šÇ‚æÁ± yp,ŸšÇR5Ž̓cAó‚c©ŠÇ"ÅcAñ„±TÁcAðÀX<0–*x"Yл YöÔ»,†Rô.‹¡Hð²Š/‹¡ÁËb(¼,†"ÁËj(K𲊒%”å%xÀ,)xÐ,)xà,/ÁƒgÙ YRï@YªÞ²¤àÁ²¤à³¼š%œ%ž¥žp–Ô;x–Ô;€–—ÞA´¤ÞeUé]VE)z—UQ$xYE‚—UQŠâeE“•û> P¼,ŠR/‹¢HñV¡xY¥(DË‘…”tŠÐR¢ŃhAñ ZªâA´ x -(HKU<¤Éi©’Ò"ɃhAó ZªæA´ y-hDKÕ<ˆD¤Ñi©¢Ò‚è´ z -Ÿ¢ÒRE¤ÑiAô@Zªì´Hö Z=ˆ–ª{-èD ºÑRuOP ºgqÊ­º—uQŠîe]é^ÖE‘îe]”¢{YEº—uQ¤{Yeé^ÖE‘îAµ¼t®%u°%u²å¥{ -PKêTKÕ=¨–Ô=°–¥{âZÞº'°eéÞ–"-ÝÚRuOdË>¡-Kø¶<ë(Â'¸e R>
+¤Tá£@
+ÂG„)Uø(n‚ðQ EÂG}”*|ÔGAø² Ÿê£TÝÜ‚îÛ’²·³£)²'¸%eOpKÊžà–—ì nAö [=è–*{¢[P=èTº¥ªt‹T¸Õn©ªÜ‚ê· zÀ-Uõ€[P=èTº¥ªžèDºуnù½¤[ªê%Ý‚ìZŽì%ÜRuÏá–é+p>g[bWÞqÛR¥ÏÙ–æþËоd[¿d[ªú%Þ‚þÞ¢£†ÀU!¥(`VH‘®
+)’ÀU!¥h á-A™KW…©`–HY*¸*¤HoIL¾å%„.k(Äe-
+r©Þ`\Ö~WËòò‰ry{ù„¹dÈ´; Ïu ›¥Rª—R)xù„ñãä£TJuò©
+`~Ùª”"…RªB)øøŒréÅÇÇþ¦:ù¼œKª Kzù¹¼¼|¢\ÒË'Ê%½|¢\^^>Q.¹ßæ’«?a.¯ÕŸ0—\ý sÉÕŸ0—ªƒ`.ÒÁ¤\¤\ª&å‚:åGÉ¡…‰¹T1|†V
+áÒ¡ÂD\ª&â‚&â‚&âò_?lúùÇ?ý7ÿð¿;ÿÕ?öFþÃ_ÿ»?Æ¿ÿâ¯ÿ·ÿã²ü·?ÿ½ÿù¯þô×ÿþgýûïÿôñï¨ìd–ÀYxû}{¼¦E±üfó‚j¶ŸÿûçþŸñ?þÜ~þþ_þ×íçíöùÏb‡ðjó·bS»?û)BéËßzÙøí·´g¶?þ”ð½ÉîŠx†RúÊϹÆÿë¿ÒÝü¿›öÓB‘þ‡ø¾úÏÿÑš±ÂXWDF[d÷oaWd7¿‡™>Kˆ(JpZ¸îçÝØð µmnªa{ÑáQ¿ŽO'fŒVðÐé®ùéÓ^üåîÈ´“û±Å™²¡0ÍrûUÝvÂé‡ÃÂr­öÖîQaΩô3Â1†^œ1%ÿóŸâœôºÆëíd½]3Ÿ±í±qç!Ûóùwtå!9<ÖC¶g2º"¡¿?dkXÒ£HÆ™éAf#Ÿ±õGd,Æ°<ãÓì47=OùLjÈ#òW=ä~Zñ¥özÈÝ&ŽqåC>›Ì£G¦{H/x\Ò<W}ÛyHÛ—¶ó̇´­»ÜÕ‡<6?]å÷ù¼|«Z ‡4OŠ¥ü.Ïøüág²ëùŒûKxÒP«aˆÚçSÞÖf÷žbyÙÆÍ»¯Øa_ö“çŸýY<u秧ÏûTT¡EožŒ4ì¡q¢ÿü{Z@SߢE kœè›[Ã2t^á¸o¾¡ÖîÕ®ˆ";,ÐÈâñ{&6ö £&4¡ÛVëÙ0?o¸Û«ê†i·ý÷Ó6Ò~o[°\í /\ßE{þŽ¿Öç^§QMÏ¿Ÿi¦¤·ð.ÿÓMYì7‡ð?çÌ.ó8éÒ¼ËÌ aeãD}öü—auô™Oâ›-:Zö™yþÍ©EŸq}öWŸ¶r°°õÙa_ôs ôÙa‹‘çÕ>;ìø×úQ}fžm‹q¥ÏìÈcØ»*}fÎps Ógv¸b)\Õeæƒ?ç|uÙqÇ¥ôÙa~¼»gŸæŠ<îÚiÏ_>,j…qvh¬N³P¿cܯN³kx˜Ç[ÙÂ3ôµÛ·‰#-pèÈÜ-ð|úúÿçcÆõײϺrÚ}Þ÷î8(=?ïȧï1vl3{æÜ÷¸ù§;|/Ó§"ÍÎàš†mô‡Uõ©¯ÿ¹æù =WšÝÊðÇ÷›÷5‘ É>¢À{ëYˆä¶´?ÝœÚØÛ`ýð|H™è4‘›jõÌ8
+é$G)ÀÓ^ËØï‹Nû"îggtÚÓí»Íªê4°·R:ÍB:ì¥ÓN§‹÷ì4 ’8Û|uÚ)i¤ÓNãŒâ„Ò;ÍÎÒ=¼·tš´8Žó[9ƒg¤ÓNûÛõê4DÊM§WDÒiçÐ(æñ«N{uQØ;Í‹ë]Ns}î~Ûgvš¹¯g+ûëõ¹ÿÝi>fgtˆ¹æ,$ÛeV
+ÉÜ–t›¯ljV·}®¨s…ôÈýæK$OäýæK¤¹¿úíÐr“~ó5’…5ªßlt¿zíŸÿþFªÛ¿ÿÕ?ù·ü§Ï–í?<»¶/_Âìû«ú~ú'ÿ·ý—;þË_ü»¿ù÷ÿ;íü½ñÇ?þÕoý¯>þþOÛÏÿðù¿ùú›çÿ½6T?ÞNùfêË£¥GÙŒýÈåiJñå¼­S»ÈÀüíÃ|ØiÖáæÚÈ‘?úíýO?ÅííÏê»fmâç&ÄNÔf͙ɇǤôãG÷f|ûéßøh,ä×ûöÿ7Ìéºù0籌‡“%fì29Ÿ&ó^~ÕŸ›w>ó³àÓ]ØäÂ=»Ï!Œæ€Š&ì9~xW¿æíŽÀ4<öåù2¹Ý˜WÝlyBÂ8 ~{;Ÿ/ÃŒöŸjù0§ÙW5àÉhÀ ý1_ û™—é‡wð5ní´tûQþÜo˜·ƒ²¤.aôò,2> 4õŽÌ¸©/Í<7Ýš—²U«êI]ûÃ;àÖìüq¨ ó©éÖ†EíêúÛ–ƒþ–ÎîGIañžOŒëäÒáýs:P©ß_ñ÷dκÌUÍÚj¸õükÞ>3jbXl“¯Lqã#¨w´kæÖôÝÖ¤2Z¡Þ0ÎÕÀ#¹jÕü•¿ªvó’=¢&Œç³“QGwÂb7Ÿ?6ºÀG§ŒW6i9jÒ³òÇß9Ô/Ï<pŸÜ•¯œÌصG¾ö,0Â8¶l –aanãâÆlÓ,ãÆPz6¶c>©(Eh%|@OIÇøwØŒî°Aüü‡ºÀU}gÔ™/3Œ>͆qb›†½D£æHßßÖ×jv³c_3 X¹ùôŸ©åÍbз¡z »q­íÓ¸là¾øSs50Æ:x4ÝÁ6lF-‘¤Lu¡íìSð<‡Ò7™½}´{ë!l÷Ïkô‡ã3‰«'Ø¢]ãEt›·µz]l§ÕÈ™¾pðV<âYGêðâcëë+ÅÕ|¼\O™ ØŠ^n£köhÔæúmä…ù}lFór/}[Äq¾Þøcì
+©QçfKˆ¸ô“ß} ¨çaGs=G§KÄÔ×13Õ±@ñ™°tòЫõÓW„ö8„vlמ9çµû÷t6Ìkfxõ!êgò†ƹó
+Âèì„–,w—ÑU-î€áâæÆ×á:ƒ‘uŸe –qmåÝ رáQÅ?ŒžÇUß‘Œ[î[ì•¢[Ž267m°lÜcSªßÎl@5ríqïð Í-r?h¸i-9Ó¥c t–†Q£îYþ&3+ÚçjCn¾;_³‘š2Î+Õ(îážeÔxX[ü¹QµG.ÛRf²ÃÚ3= bKÍ‹dcpÝ‘aX£/Ì—Ïéó&Ò|g˾f0Û‘»#oXÆÆt;-.2þÚ•ëçœ>îkJ,4mUßÓÝ5Óbf}km;
+3cÜᘰž¯ý0$ß?wüA‹DÏáÝ8öXú<_YUôY2îÖMXÜè}@ßÎáKëŠ;·—£mÅó‚l‘äÃÖbg×ðrOFH_‹Ý¶ ö§5ì=“A—á¥qé3‡ú1ôzÕac·˜€­ÅØrü/5‡8éw°>¼{¯ñŽÄþ¦é=–r´Ð«A`…Ìl(ú‰Ùǧ‡ßùšÈGŸQpÅßõ•K³ ÃÍw¤'³Î‘fûùvy^-ã¥ùìõ:GpkØ<üÈr—~Dcž¼n\°ÒÖ÷›ïIšå@ØF|‘—ÜãnvæÞv@ãé’m¸6¶2?ÞqNúÜìˆ4’ìÍ'sX³¯ê]êr³ÊÅ‹ðÅ•·êÉþR/ÍCµüZ¯F
+u¯E ·˜ðü`d£gúÝ$lG ·çÆö€¹5Âb#Ô”^Í÷Ž”íÞ‹ÛÝã÷Ó
+]ø´ãÙ›»§»;c÷°¹¹0^‡!E»îÊ+_ø[pæÄ×oܱ8¿[,„5±°íx·ÏÖÍç*áŸzÏ7âDª›»E5ĵ~üƒ£]ѪŸÌØ<Âë=ï_ÿ³êò_{±‚µµî¦ÃVçз?îØóZfý1µGsÊÅ_ía¾‘ŽÙ_cŠólŠž)âÈeåw¯ö·ßß ™?üô{Ãë‡ñûAcù»!îcù_Ã?›ßûÄ~ø9þðÃýQ‡ý^çþð5|¾°?ój¿©k=»ªßë}h» »{'3{&;²™Ú)?fõwWrí0z ­/‰˜¿ŸZ~ú~Êb«ýýôöÉðw&ÍN°?œŠgÚþÑÿÃÅÀï-~¸ÈøáräGSÃïM#?œp¾Ÿœ¾þî<öãOu¼UÏF¯ñ¯Ãk÷hgrÄ·„ãÔL,ÿ² ÚØ[òâ£k¿µÿN¾þò~P
+k¿¡&bʺåÛÛríkfŒ_}oñ_ýñ§€§pD¾3[»žxvŒÚ|\öζ™Ú¯bk7C ¨ÄFÛÁ¾o©GR™¯wz„nñ
+cçlocócž_ú´^=|a×]Ð<m’Œ¾¯_FضãóZÃr9Ó.wß»ñ02*6Ô
+šp³snn¾›¿áÔ¸‹Gª—¸bÿݬ âûÚH0Vmà•6Þ
+·mñq›RÀósÌ›Â(Üxí·Žð´xõûlþ
+1Ò>òÞ×öWª»öè‰_syhPÂâo͸iÄ¡£:ñÞbü|àríZÞ¦{~c iãiè>xå[,9ÜnÔAÀ­X-Ö‹‘ÜøymZôHyû6yÈü1Ûwûi†ö=hwù2^ÎËÏežÔÆûÚ9ÃêÝÇÚ]FÞ׳¥ü¼öŒÊª± /y›eäÙÀ2ïZ@Û»
+¸P“îÞOöí´vå ¼Â¡éÁ”¡0Åhg¶[Ú¼Í^~.Œ&.aÌNô²¹m%Ì×5‡»lˆœëAn”¬·8˜áq—™UÉ<b-â/Ç’Ëñ}ž¾_°­²5çã6ŸgL¯‹/ŒA|+˜üÃè`å瀿ËN£·à¶xãádÀ˜·ÅñQ¹¶…6G@ħɒu柯æÁè4ô'TÞ;Œ®cvæUàç{ʦµÁŸò¥€ÏëúÎ掮ü}šÝ7ôÙ¨,ýùÉpóâ¯j ß§BŽ|Ò²© ÒÛØâÔ6_æ+É0zá2ÿˆ˜åçÉJêTÛĵuûlÁ»§oȦUøŒ=’Çnl2²™™¹%V”…—}õÏåóÝ"P*nçìSÆ=äc
+HÌBåZ ÇM­ðD‚alwàF&}÷U½¯­ÆSÁ=ŨUüg=ζe _±½[<lÕ¸íW¹ƒÎ½ÌAFÍCŠû Ûˆ?Ùøy?}Kõº²EȈ5)™¸Íßxk˜xXqüþŠðV¿+ÜkTңч“_|éºÍÐZßø^w¶?éCïÃCù¾DEkê"—Þ/Ïq6 ï<î+cX¼2a\{M6ós?u;3ôÉS¶ŒbûUÞÆ^ãr¥0ux
+FnàÚ®þq­aX?æyDÜ(ÏÆ|açñymÃÃn.)ydŠñ¹Á~¬—€ÙB‚.³I¥ÕÒÑ^׎Yi@{Á÷µSŽl«[´s¤³Ëù$ãÇ#¼¯=÷M×^y±l~NÄï‹™>ì‘!ÝÑ×ÆŸÆûΣeî¿D4·ŸIEøSqâÞ^ÇqcÃ8A{_{GÜí)r÷£…L±F}™‰CX£Àþ—|…ö?Çä±ÎS ¤58¬ Zî¶ôë2Þëà X—×ù”!2á2Þ{FÈȇðL·ûǵ3Ò6Æ 06—q”j1÷€š£UßgºVí¾·M›t§Vø’q;nDë£6ÿœ3?¤Þ;ƽH§°Ü|3`x³Vöz G‹³ˆ-¾ƒ;ÖL6EÊgG¬Ý-êkŸ{oŒ‡·R(¹ùXÒ{‡CAxWL="ªÌƒè|Ä­Ú¡[¬ÚvsV§³ysb¼LÀÚo–kÍ pádÀ½^Œw¸Y£ež!0ZñcdÏÊ*Ù¼ q®8W ×Uâ;ʵë ~Ɖ- ¦®;ð"C_µQÌ¢™›V‚b™Ã¨3Èk·±Œœ…ïñ•kíà]'Ñ3À÷Oãz„—yj[v;&²Œ#~{ÇáÓŘKÁãì×Z†2?Ïð¡u ÓZ?‹1×Q;gpåZõ¬µª áeôd¤oÁ88MªÞ§¾.<5/ã‘ñeÆñqGNÑ°é˜ÌwòK\Gjî¢Úïk»ÅÐéëJEí%·sÅã,s$ÛsãŒ>¼”¸ðÓè©'h`™7^B”3q–Ýsy©¸°ñs‘@åÊ32„»P1Ëh‹ý#—ÂÕì%;Խ¹-öûÅ~u„¿cº ·ãþ¸v·¸jÆ–Æ]¥¶›¶Ñ8ýÀõ›ÌG¬§}
+n e‘W–DN±F¦l¾Â5ŸÇúBGð´f¶@<ÇɵˆÌŒÃÇeäóDÔ¯kíÞëù“lðn¡Ò:jûªßK"A a{¬»ËžMP1ã$n¦Êr­Å]„ÑÕoãý‹
+n½ÍW$;Ž pÛª!óß½¹Ú.%õ¡ûð~Ówã¹:b
+Å™!o¾ دïŒþ1ñáaycF­LœRÒºO]çû36`—Â2z$FAºbZî–â:ݵ‹u€ŒÁáæñ\-·€CìÌã½ËSãÎbdjm›׎\¶Ø||{»Ö¶Ìý\¾“ãÄÝr?|¼cæè?«û s¿µšÃÙcÆÃ÷¼oã‘뾑;ô+Ošêµw¿}y+LÎ󽇟eçpÃ8v¶Í8BgdàŽ†dõ»G°gûÿâ??¹}D"ÿ£¿U4²%¸‰Ј³
+ö)9²$1×ÉyÍ¡&v†¹H KѹuÝíš]-g`Gv¿¹C»Ú Ne£rØ76b©wˆ$Ó‹Xvsž-dÃHÿÖt¿‡ð–Ö´Ýô™'Òrã8O¾òãÌfÇû¯E³gd\Æ3%ÐÅWÆXýØ $êåyxyÛÞPË2½ñ‚wåXêÖ¶ÞdçyMxûŸîai@úäÁ¶xZ¥ô—‘ã´ã
+MÜ­BóãÕ7z\ëZ3ÞßXžf)"4JÔâÔä­K ¸Œ­£s²L:V|Êc¾5jŒ„ÜÏïÐÁÇÂ4à·ŸŽ¬ª×~ûÃ’oGéíhÀó§òÂ4‰˜±ñéÞZÇ•º?Ù¦B:”™ ŒÏ^å¢cÓ8ƒâó
+8{¬'ÖüE>Ødj)j.€,„¸¹±sNzFDk÷ÊKò¥ÖîÎe¾?G.‡×òÈ*¥)ˆJÁñÑ€•c¡éµWÂèg<Òuí§Ñ5ùyŸbÒ_nDlSÞ5±ð;/Ü]S”g4`é„rVSµ7{è]˜mÒ×µW¾3E­?Æ™óŒ‡àÑ®{ c(tuãmE–u-¡çaišW9â3ó}õrcaT–­Ù})¶{»™¾vŽf¾NzFÁ ´çÔN´“Ì9®w3ÝÜÜãÚIà¾7°a<î+£gkˆ{þío2ËŨåXØt,A'†q¼rJ£Y/ó~53Î’£ðÙ_ºo‚hÛ~g^þ=:Qk Ëxî2ú ÇO´åYöd¼ôj,ÿÖ¾5Mo^Ïlp[1§´$’} à1·6Õ,sÛ¬¤/=B3€þ¾U‚&Ì}WLͦd£Ì'ROLg çü©“ïæ1 ñ²ƒ£?Ê\Á’ÚKz~€i).&œSv­¶q=WƒM¬WwÖïù4p‰´5c@Öj¤'1£gnÓ#\W6 ÿZYZ&Í£×1 £§Uϲ8iŠ§ŠÓ‘óä{º–`kuò…Œ†‹Ñpêƒ mâæ ëO±“m­,y<Z6h¹¸èä&´ú§
+.‘&7ŒçÅÑþ~нL˜Î“ÙSÜë¶vZðäCq[!‰Í}ʲy@N4;rËÈy±úèh…°YÊŽÉ
+—‚öÚ/õý®¢Ò$sËïh¨o®¨Â½ÞŽŒW˧½îÕÀœ
+F?DP·›À
+²é™<̺ã{®0n¹œÓ7g¶‘¨,‹úýdJQ¾=3ùá)„Ýýª—€ ›yàä¸feªûYµ;ŒîaÓDŇ×÷ŒýìAeFa0
+“ñäJÏ,A¤ü³ïæÔ¥¸G$ßÿâY½ðÆš%â÷Gä×ÓÆ8´úNeˆ™²ŠÜ£3ѵ=¯³Ï²Oèvp‘Èóžð¤7ŠG¨‘G{©Ì7™=%‹&ªx.‹":±òÞw›%ð øO¢YUèÑ„ƒÓòqçÚÆW£aìÚì* [4Ð2xÝ€-ª=ä¨ê=·ëu¢4óÌÇ \¹†!”¥÷BUÜ;Ó”W.Ìp F­Ô„#t¿Ö§^McÝÁžƒ^)5{-=7á]ÕÀÃ8æz„kcÌâôè¦ï)ˆÒÏçªÕ9Íh`dÈž-u·–é*ªC¹OƈÃUÛ™Ÿ]§¢èz:",íédÁt'=ßí¬Y³jhÅ7™Û /å^07.±Kžz3ærz¥”°r£Ñ5¹Z!òÉËé
+°Œm÷v–1 ˜ï=×Óç^—ü»/ï.ž="Ìû­ÂÇ9”h÷ãÚo˜s4sHÖoR
+ùÒµÓnß8Up‡v×Ê“‰Áîa°©¸äê²?•GŸ’i@a®Õq”ewóá~ùA¶õ{gB_+×n»0ÖÙ,}û]\Jwn@,7ÐŽCá¼dƳåÔ¦wîa ,|zÎ6³ì É‘f…ã;ߦ£ žç~ïÁhÑ
+wýNÕêÄLô¾suàš D”E¡ÖÀ3ÀÌÛ:ëå—³öŸ6ïkæ‚|DŒD•ÆÚkîùû‘“Y7̘³°ÏúK' ò\z÷å® €áÖ\æÝ™½ÇÌkÎÍ›½s_ºp¹ |òÇf2èØ¢@µ^Bç—gp„«ÇÚÀ%´o·$Wé ˜¢”-ÇTdåóÁÍšÔÌc ï9Å›-?â‰ÑṸ1ñO–0kjI¹N™™^}ÈÐ,‡l°”±×5šöE–ìUNŠñKN–óúØx0±ZZ31J
+jÉ­ÜmärpX\8ºþ§q¤»nmmÇ‘[-žùùLEöë™.úô0ί`­„̬õÉ «¾ï]9·GË5ýˆóÅh E^µµøâYËEæ9N[K˦S°‘õMÜÌ „ortrÓú«ƒ× eœÚíÆÏGÄ¿ihF²ƒ¨=ɺQ^ÃÈ;<ùq™5=xù®×¥ªTÆmí_.£Ãп[ãýPšK.ªåô˸¶ËkÍd^ΉÄÑصÇ!ã¡÷zeÜ0±Ks®$Âä1*/ßV¯™®˜”èqÅê>ÿÖ7YËÈ°Ù>Ìž¶Öq˜êFvÍJß?î0ŠVG~Ýw0°/áF4¤š*¢ÔŒm¯³ ˆ\µv5§Ž;¥d1®fÇúÁp40£˜XΔà¬
+¬‚)7ß¼ç–Ò•òY|4ËÚÛsÁÀï1:GúãQéeºÉðn8ÔdyÅÆß“Í3­g¤ÒQŸvàF5³v5vc‡ªRXêœÉëÝåg²À¹Ô'•âJ¯æí^‰Êävœcñ&gò&#3az>·Á
+1#˜”úZK‹LÛ¥$¥sÙÜó¶E ž€X¦ŽLÆd È«3TŽÒ¾ª“ð$sæJ»ôbËóºÅ2µò
+´»™ãÉõ‘^*U:§•þåµ¥]Ës©4X˜-ƒvÏ‘Çs+ý§®œ&GÍ+'û¶ÀÂü¼‘¨ß$uh[yw?ñ{ tbùüQSÏ´‰¼ü<ŒÏk…=çÔ‘ l‹`Ü÷p³Ìq¹¶Ì¸ÿKåâﯠ0¢q–cÏXè“;]“¢ßÀ•›ÛÌ}wn'_ñ˜½hAË%Œç7c}{nÙ
+” $×Ö»ëMØ<ŽÒ›|“u­Ò9ý°°V‰ŒÜÈ›1ÿÖ:”1óNpbF¥*áuþ­°q(?"Å ¿¿7ö)÷š-§Ákzw©ÉŠªÖ›ß2$õØ1Úž‰vçÌ “u“ÑÇg‡7FºÄÇ
+ueèí骷øǪ́ãõ”Â(úÌžw䩼‡?ÙXÄdß±¯
+ãØׄ×eÃ?0Êi…5›€Þʃ­ >yÿ[çÇ*Ï"⯑Ʃû2$—iÄX˜÷ÍK×Ñ–_H"–Qï8C ¹äó`jage¦‹·±ƒ1Î#‡sž@’EbÂg[ž/Öî C&Q»­,Ÿ“ýÚã,^k×±î ìÙmêõžõø÷ÜÜÚÊîWgˆK7kù>HrÀýî¡u‡'‘éÅ®½ð”“8Øù®ô:ÎLöÝÎŒ8È!níÞ¸¼FCïåÇí–-|ï÷zñû#}Båe‰ãÞÖ0âW{ ™å*É–%Þ„¡¨|K
+,kZ®ÞÎþžçHwÊN"y‹ÔvåïÛž¿ŸL¢+’‘ã1#ÀÏ\7äi…§"Œ‚#‹à‘¬bvâ6dvåY³;­;å¿ÉÜJ=T_ÝÍ„ÆŽðp©‰›DÞ_œLälMóñ—Z†åÚ´D‹»ÌþTûª[8Ëå>Á[­£nÒÛXî,ÖšÁíϳ¬Zô·o¦?÷Yæ-¬ Ñ÷L²[NR`æ>s£sÏõLG:R¶[ä6‹¡¦°#£F.–b[Æ›/ÚÆ5ß(ÄR¿€V¾•šbÈi{ž¼®¼ÏF _têHïÙí‘29ótHX¯uýšyLyG®’Ó N¤j|/‡'äÍð"bÏËM´œ_‹Ë{¬ú}öt .c0¬‘[û¶0wÏîâü‡Úªƒì¶¢B-ý„YñEwÏ%ñ
+j3LýäÍyÀ`f-ÎVè—5°Bäþ»³îÖ[…:é²æÊuêå(2,AÑ*†_å
+ʃ¢<yz7’Íí;;k¶·{hÙfˆ”ÕÕTÞŠž¿Içé`ä‹r-6Eålv•iz’äª>û«ÃŽ¯Ygy@ɯæy‘áØsŠS.%»t‰õt‰Y7ã#©[cÕ@§UÕ.›JŠAë4·+hÅënÎO)¿ŠÜE;ï ã»Ú¿ÇÛ¸BnUØ¡1‰÷°ä kÞ’ÓÃÓ@¤Ó…ñ¼ö­iàÙä8¼ åGΞ¤ý¶¯uö«è3Ξéiý[}-ª<¿$‘Ë=·rÉmO¾‚}ýújÄ»lL¥^±>ã‘åpð¼~|†ìÁçʙԇ¡µ‚t
+€k/k*ÕM3#I®–{Ç“-åY4ž;»ôºÓNlÃ.ÎH í¦ÕºÌµÏå~š]Säæ·œµ™Êr’·wÒ ˜µt%ãKQPOl{CÚMÏM|­‡GG²NºÛo2¯È3¯™÷%ò|ß:<³Œ--—Щ†f>áÈÜŸôMæ5Ýq’æ I†
+­WߥËÎ ªóYI¤ì±Ì5I‚)!•Ýî´q'`fÍfìḖ.j„ØZnÙ šÄ£—i
+©Éx#o‡iÄ‹±"VíÚd©ubÆÁwKZ5)«‰$NMTò®ÛÞ71€¶„²Ã é1sýmGyµ$V™RkM¬FF· T8@«k¦™“pK¥3˜½ñdÅ(hÙŒkÉãYs¶ÕþƨXÖsm?¯(¦—;Y‡ì)~4ÇB¦ôC;réªåÿÆ>é[bd5Ø'¸>¶ûس¹öÚWæ‡Î(ÛivôÏkG|Ë­*_c¶{Äh‰×s–½.@Æ™a›wýò8[³º“Ù»š…̳ YX$  Üä-á<yͦ|È^”ÍŒ[®9Tø6]<™ÙÒk*ãŠq8ÙÍ
+"1××Օ‘Šã“Jjô!µ#ÿX–c±(ð4?žùNÅŽN.lÁ]£'í*Î62(kUlÛ}ð\ød._y}Ît]™ûZš½û 1Y±Ïøó¤A 3ö™_â\¦uòG_3ü.R¿z`kÞäVó•zxŒ89W‚%þp#É-7¤Î_2ÎËÌg–Ö“7Ë«­èùÊî{“ÕvhtØ)ïØi6}gv¦ÜéǦ2
+V-7ß#+=;§ÞøDZŒŒ;#—Vñ3Êyri§ò™|vɺ2Ÿª>bá;7p® ˆçB=«Ç ¯
+Výà(Ã3Îð•»ÑÓjÑ
+{†¿õ¼usÕmj3¦3â<Ã8N&üŒh†²­ ×á4c[ÃX
+Âë'ÝÑ@ÖW·kˆ16
+gF{·3“”œ+çµYe!|¹TÍ:48ãÔí‹Sw3ë=°Öo{Ò—¯ÞHÍ‹¯c“ÃјßIÂQJPœGž
+qs3˘ý¤d¼½aP–G±[GÁ,ö-OÅÎت~ñÜ:8¦ŽtÅn7uä½o™T¶ÌÁèBë•ÍpDŠì½%iÒY2logž˜®ú÷Y‡þ2ÒÙ5Åyp(–-çïtTlY]m6t×]y’bÊø&ag›?2SÒqdœ×ýý(S’% }PÚÖÌ=‰E¨»ÿ7ƒ“ukfìÆlëõŠÖÂ|f"ámè^YÝ|n¢q/^}¤#êöp¢Æ'»ä'àÑFn#ìΞ÷æ‹ã˜¼‰Qâ#¨Óbç
+«Ûguà°ÁÁ_<ëÚþ‹NÖ>m«ÂÒvqœÏow•¹Ky­žXmá;ÓÃH-³3Cx‹ç̉`# |f%᥅‡ðÍœztK{­»«À…Œo#¹1h•6Y×’
+aDÑ¥0»µÊ1˜95x¬7-§IÍo²}îÅÆÏqk­+mÕ…VúúþÓx®º?Ëܳún Ø>WÜh/Û7Ò
+¬Õw}£O£ïjòÒL(§ŸYâìã0Õ#—y“ežÍ©v˵]q –%¶/S­7TŒT
+ÖIFòK“¤µS­6t §x_kyùbZ^„.ËJÄyU²¹_+Šr팘踭q’¾_µ¶ïY&Pã
+ÂÏa¡Dqnä³± =U½7‚!È"/¯³÷ÕÀIÑtχ#[;î=PH\Nµ¶·Ûb»L¥…åà^=†YŸ|Pž:þ&røŠ4 öŸÏ}Å—^êpŸK‹Ì蹂,ØYQ,/ãóñ/…ÃÜjø‚ŠNÜ+#/ŠoVÆ_åCR§z­€Š»mylPŒ{³& Y·8›ŠOv wí¥$Mºã»MvðR
+|P@ºÚVÝ­·yÕ„Q^Rwëe¼¯¹*aÎL\†àí‘ ––Õ ºY©¬UסøîÚAF‡Rw«kÝ­—™¨W3ªÐÊX+õ²½îÖ±J^ìYPrìYƒ»]u·Š±ÔÝ*ÖUwËâOz“1+ø (-Œ_ÙcfÁëIÕĵEݼ_ÿ¤K™(öL†V.=Šk™Öð¨Å5ÖÖ[¡_"x¥muçlÆ=œ¼Ÿ“·U˺Çǵ[á’9l-ÆØ!ðûe%_‹¹&焇‚H¯ü
+íteÚÓëw¬ŠÊ‡si yQ­Ç=0ÚTúIe4päÉðž»–_ VPrØpt¬ÎÞös¹Ic5ß.³1³y»ÎÌ ²Åá.…ÞbúœíÆ=²–ÙÐx^÷x]çÔ¥à%FÆßNØ(¤Jç2:)ËÛ^F{½–ò©O#ËØÀ¡²‰é«Ö©óV®}Þ ŒÀh/£Æ_i Üt.eYi=ÑÀŸ¾»ö¤DË9¤c|,clm¹º*$ë
+q,W*ƒÄZ(}=¢0W¦iÞ”¸öäW²­Ó5Yï^qàç`b¾‚+¦ÛXÒì)ºÚ×\P«ÂýËœã5Y[ü#®2V°nâ»Tò±uÝÅC£½kÛ?ŒG}{Ë|f0¾ÉðM½f¶–Vv(ð,Œùö4 ¬k½~TT:2•U1Zq5Š0/³uä•åÕ´U±7¡|ö^]¨bLgåˆ2}åÚö Ï™e‘19%A÷aÌêÞŒœ—ßÊÁh—2¬}ÅϹEÝÀ¾Jw2{yç{|m˜îyïËê‡
+×Æ’¬±eéqŒ¼ZMZõÚtò^«8r»Á9ÜõB>aKÖÞZºjÁé“صžã¯jàÚ®ï¯Õ¹é»U%]°;8)–Û2€Æ6³"],Û¿Ǿ^¸¥õŸ­½Î~¾¯µŒì±ü»†¥¹S%~™¦«0
+åËðM´÷Ÿd…ÿ>RK˵GDâE«Zãõd±mµ·€ïœ’ûŠž*·nàŒxg=aÄábäÁE¢¼¯U2þÕ¨1–¶‹¥×•¹¸CÑn'ù†d¬±§i×ÚÂ0‹l½øÁ±ªlñóžeÐוëóW8÷Û¨8}>iÌ-R˜F£:*ßù⿹¯+7x¥ v
+–£äJº¿]lg¸ý ¡ÂµÒ_ô#¼ÖR.ƒ-ã® ù¹¢‚ø²u<²Å¯-?üõÝ•C»±ÛVê·Yþ,3nt_£Z€V&ˆ=s¹wXÏ«eªe«mA6¢ôÙc­Ã\ÌG¸Û¿8[uF*×"gý*»±%}–;ò8•k‹ñÈ(íb<#áÀgëàÍÒx_ì2݉ô%è°ãeŒG¸Ã;ò¾öÙ»ªqOR1ŸŽ†ñ¼6ü»zö&a(9]iàŽÄ æ:óPxy÷2:™H˼)lùcG&,°”ü2F¶C%C¹Ö&«K=K™­b´P:ý|3Þzdö[YÀt2¶ŸÅïp'kÖûZQgfT$®!‚÷РSzŒjj.víÞ-ó‘nE%›ûµ±ØËdÓÆoi\žž{üügG5¦§7`ŽÏklœ?¼­—ù.¨8N¼öt ¸SŽàxë—ptjˆÎÂý©…¥_mMšâ˜ˆKãóm¹ òÚß×ú¾|JÇ<yúÛXEãeöQƾÇÂdM÷NÎ$ŒÄ·<3ÑÇc”û~¶÷Gð2zúsœ ËÌIŽm¡ó“mDø¯?åÕaòð÷Ì/¶Dâ·ü
+׋±•ª—æÖ„³i#`!ôÇËÈaêèœçµY®ÐæQÕD-Æó}œ‹9çìòR•B î’OPFvËC_q¹Ö<` ü˨…˜ËÓŸH ±u5"¤-Î>òúu2É(!ï+ùÂËx÷õËLÕûc3yºhNà†×Ä{§Ï¾^›' ¶mé+;T£•K¬Eú›ríL¨øÇÆæ Èý÷ź¨f‹þsòë ”ã‡÷¹lñóƒÂgåJKorkŽçÌpe'¹Ê)EµC>÷LViìV~>ig•qdò¾ö¼Óã<6¢UpͶ%úªŽ8r"™{÷¾k¼Q™ØãõÆQŒôµ ×k¯xoñq)y…ÿ(úÚ©ñ?>ƒ—GÐ6Ù|Š3׌â,žŠ÷!3ÜëÚ-ƒÞ­b<K,n1+¤ïþ%?YÀ ÆÜvæîêÎúœåÚ™µÐÊžm&
+‘ ÀcKÞF¥‹¢Ì=3jØg?ÉXOFu‹,ïw5Ò÷ ˜š×I/¯Ü»ÅØ¢pkvgš9Ý5>ãÜÈYÓ21ßdc¸òlÔqªýþîÚÖ2Ž~,þ&óÈÜyLTÒk•k«‘D’/cÆE¾¬»øÌ5+’@í}«2Òcdj®µPÀNÞU”-Æ÷|U˜3çä4ã«&7µ'‡4 ³³ð•ÌI¬+=_ùͨ²û2z /¿Ç¼ºª4ªÓaœ×¦áê˜35Tùó±'Ù)¡›öuÈUw;Ê(N3¹ßmVŸÝì™ûÏ"Ì·$’àXS}½öÌ
+º[¤0|íp5°Ì}[™oqWЋÏZíÅÇ…ñcª-×ZÀWDyYS[æ¨ÃØ#A2£óª"p{½6B UÏu­!ï<KÒÅ:¬^;Ð@kµÏã;£ƒ
+댋¨ÆJN»0 ña9,ñÙˆÕ‹h(‰ÓgÝä†UCþBKÑ6bõ)dù,³²”ÁT«`FbúHý@%·\Ö ÖºßÚ®W.’L‰\³A•÷[›ËYóZææÔþ‚Áê“fDæ|T_âH®À鳫z8ÎjW›µ:;Îj®Ýéê³£‡b´ÏK¢S÷Ý…7¹¶ëÑr¨ÔüÝëû#yè蔈¤’ÛZ¢5x+qá
+œ>;6ytC¦éŒHTÞú‘\±¬&_uc‹Ú‘èÕ‰i9?6æ“…­¹²`2míß5Öƒ¥ªqN,TÝåÚ®vò›‹¸¬ÈøçšTŒ¾
+¦ÅLˆàZ5°1#pdN7M\Þ˜…¦Äúë˜1}ê• éAÌÄþA̯’Ç`dHòý”8#ÝcÏ>J|tXÕÕî6ÓyuµñùdÐöW}£f«•[Ù‘ËgÍÛ1Ùƒqܯ yÜ[«Ö3ÕSÅìÄäÁv›œ.báöÏa%.Îl%Ç{Ђ&× NÀZ‡ ¤ë¦â:Õ'_åä¼ISÞ²H˜ÜíÔÖ@ê„ ¤VÝ#µpÈäÙ!Wz‡fÄ‘gÍÈ•¿%f*N¹Ëœ8åš3rå°©­éü^Œ±>·Ç܃鳩†r¡TXAؘ+S‰ú@šDΞ­½F âçˆ-G
+Grå3¢µ:Â/© Òhõ÷s¬ŠôødjPW&+„W˜´j‹MŸhxEû…•:!F;ÖTrÎðdcºÊ(#f©-±ŸÀÏöµÕ$afBœ&×LÈc"€B @eLÙ‰yè¢;&÷ HƤù˜ã Z Cc…™åÌ©–ƒTëά—ë$U ‹eÕcRÓÚD:Õl£§I¨mmè¿^GL9–ú·¶híÐ|ÀRfŒ\Ѧ"+¶5E½¶¶Œc—„‘èuËôú”\»)·CYËèÓoÇÞ³îxìö4T»L˜rò¬‰w#`Ö#:2% z­•^´å
+‹§ñJs»ª|B4)_g?’‹¶ƒb>‘Çãœf’ ej©<}vÈѳ&´^›T¹µõ«pÔÑOehÒZÓ«Øy¥æ\8訅ê+ÄèЩR~áŸ'#˜‘kKéWgîèÀ1bBõÝOžE¡K×à ˆˆ£ Þ&ä‘E·T kô×4KäUʼªÄᨰoúìp+بsâYz=ó›ZÇõcÄE¹I÷X¹É’è§ÄÑÃ{öqb?!.]ϳr“fè;0)7qU‘e ®úÄ ¶ñ‰ÁAfoÖ‘a¸ Ðí|m§àk³ ãèFÓë¾JŸÉ“±Ö÷M´ó‘Xu»±îº6^Íô$ØÞɾ0y·¶rkÉœk¨¨5Hî#zxýxjù'ÚtH#y2| ÐÅ0_üµjš¬HÎCõýøä˜ò5.2`õ|ÊË ÉCAÂdó€ì—ªm3iK2;©P›Ú¨^¸ë9yr93“€*<lõ°#£1Où@u‡[Ò×üYkÄ5a$sâÀtfäÊ f_­¬ DWõ—‘íe/x²‹«Ó&Ìt$Îï„ Ô9sw .}äBX&Uªb‰ú@Z5Nž;Qî¬r$¶rzêSò0‚!ÀËŒ¦<Ä$ìÌôm9O›Ì ð†Aý·)<k+øBL«Þ`p؛˜‚Y]úÙP »i8{B´tûº•<‚Ðß0µbnk+š4 I±Þ<äBÏv¨qXàkOˆÓœ€‘<áò&}Mˆ«ò p3Ù‘pÖé³ã½%ÒÃËtþ¾¾ Ä—¸½ùÓÝåÍýåÍߎŽDf;é_üá þÆ5ú«¯ÿûï~{yU>sð«á?ÿýàWýýén_]”ÿüÅkyø«¯ïË7þvø‹^_Ý”¿;Âÿ 3Ç/ÿíàñ¿ýÇÙÕ;þµ;üÕÜÜÏÿòþû7ü»_ýúîîìûå^üåÝÝ7ï®.nÎ/~‚Ÿþbüûóo/¯^Ý]Üð<¿¿¼½9»[ŽO_øÕÞ\žÊ ï÷Ó‰üÈ Ãˆýñä¡rVî.¿ywñ•¿¾8™Õ7go/~{wñß•Ñ~ÿÄéÁÎØÔÄ“˜Ïðîâí»«ûvnSS«£ŸÏéíýåýù·¹¼ÂsOšØÍí×|gS“›Mc>Ûw×<¿?ûÇ“'è75³éðÿíÇžü·<¹½~sûöò~“,ðòæ=«¼Ý{Ä¡ÿÛb6OœÌ×·ïîÎ/~wwöæÛËóÍj9©Û7wg÷·wOœÚûÖà'žÏ8ú÷\š®Tš2Óû§2”ÛoþÏÅùý—·ïn^•‡¾¼ýç¦Vj6ŸùxÏ@G1þbS3úçrß]¾º¼æâšÍÆ?ŸÑ“¬mÍåJuùê=Òé¿þ—¿¾zóíÙK·©™`àó©|{qù·oŸªnî”ÕÑÿ(·üÕW¯¿Ø[{ÿ*kïõÝYQõ®þp{ùöSµ÷¶u‹÷æÞÞÜ‹›šÙÞÜÛØ=Ú›{{sooîÍ¥ø¶T×½¹·ÕyŽ¹·-±¼7÷¶cîýîìÝÛ·—g7_^½û)~|…²³“zÀ㾩ÃñP9ØÉúFû²ùü)ôê«‹\žá¥©0ŸÀNÆÂ_¿~{qÿQ_žÍ²gÞš[nÉ—[›ÕãwçÕSUÅmݘWTÅWOÕ¬66‘ïw¼ð_¿¹8wuvw
+±_Fÿ“ í?Ý^ÞÜŸšÊ´9®óÔã|”š¦ÙÔIxp¢Ÿz ŠNº±¹<0þë©sñ››Ë}xOÄg+ßæõÇwïyzrñí»»×gç_ŸŸ]=5æ³­ü·ù–
+ó÷OžÕ•É™£óÛ«Û»ÿî[9¦74QMf1C“’¿ùç›Û›‹›§[÷ÛšÚƒY<>Ë“Û›·÷gOŸå&'9NâsŒ–l׃°>h²Enÿ)‡K>Q±üù1ƒ-îÇ>zúèÔÎî.�¾¸ßؼ>[¸º¼ÿÓÙåûÔŠM¨ëWgŒ«mj2öb"ïQζ:÷`"á£ÔF1ìÅDžÊµ76¿£ìüýÅÝß~
+¹ùȯâ۔طËÿr×hÒ§±›”[OØ‹çþÆ
+Oä“Ýå~ciÏKŠ›Í³R…6·7ë’…¾¼øÇÅÕ×ßž½ºýî«ÙÚiû˜S†~{÷æÛÛ«Û¿}ÿQ‹¨íºûži¿º¼:ÛX€àƒØÂÛÚ¦Ç`²Ùo2ÙëÝÙ«ËwOMÒvÇÛ*ó¯ƒßMñþ4ØÚÆÖž™=>¯mÕå<“™mk2{föiä¤njž›Æ½-sê¹÷}[³yxៜ‰zô‘§¢î«õÿÕ[òXµþÓyØÆ.Ê&¶®ïÀ¶ä‡ë;ðͶ&¶ï:ðQ¦}λ¬°Û:ˆ°;ˆ¥¯.ß¾¹:;¿¸¾¸¹ÿýÙ›-ʦ§§mm3ž‘´yy´»~O~Ã&ØõÓïü¶fóP©~»C"þ¶æòö± üïO¾=»¹¹¸úúâêâüé©_ojf'1Ÿä?×MòÏ›šäÃI옑zu{÷û³òÐ?·(ˆv0’®ë$¶³7Ï3¶Å&ž+Ž¶åKx®8ÚÖlŠ#à©BsXÿÿðÁºÙnjÖuŽ;ñ»Ÿ¸¥ÇôÇÏn.¯Ï¶™úÿúòêêɾ¨‹‹ÿÚ–J£ŸïtQjÎûê©Âãêòæâl[É‘ã æ3üÿ´‚'w ù‰'¹˜Ìb¦¯^]Þ_þã©“¼» Y½­ù SXLíüüÝõ»÷Go'nª›Íl2ƒ…Ûˆ-O=ï‘Q?µ·TC_»Ûë2Å^ŸOæþö£tbØ‹(ÖûrÙÇ™lëŒqà4éû³»'§z]}wöý¶æ4LàçëD±1ü™ÖÒ¶nßs­¥mÍæçÝî Ú¶Åé?óm›Ú‹g^ýóm¬g^ýÍæ9É0ݦf²O†ù´’a¶vQ>P2Ì' ºx¾­¸÷>æ©zÛ¶|Ø fc'ñóN‡ÙÚf<#fói7~½­hêsÕêmÍæyé0ÛR¬÷é0ût˜}:Ì¿dožg mŒå=SmË]ý\q´­Ù|èt·O‡ùù4ïô>“=lËmò\ö°­Ùìã?û¶zˆélì`¯Úû~¶^þ<wa‹­UžŸ‹òa³Yö¯&x”^ljJÏëÛè6ÖIïy}·Öp]ßÆ“ÛÛ«/·—´¾oÚ¸oÚø/iÚøIÂ|LÎv駵-§æ»ií~‚ŸÂ§¿â¿ÜÖŠ¼7š½çh{Ž¶çh“yåMMi m[+²çh{Žö¯áhw·ï«·ýÚ¶’Ÿ•¡ý;¼×ÐöülÏÏ>^~¶-udül[ ò±ò³­g’¬ˆño+¥d§ÿ¿æ¾L÷øå¶Vgm6smÚMŒ­]›m­ÎÇym>NZw×·ïkn´NZ;åκC÷…o]*ÿÛ–¾(ÿ]þýEù‹ÃMMuL—}FÛ°·oÐ8lSóúmÃt¹ÿü¾Ýß÷ û°óÛ÷ ûñüümÇG{†=½;•ÛØt>ñöTóy½¹8»ÿêÉ[uyóêâõåÍåÆÂv“i|žµXénMÀ¶×þÜ6`[›Ï)Ù–=÷ŒB“Ûë7·o/·iV=½ÖÏÀ&ÙÜÝyntå}SßJhe§²½z…þøî=¯ülœûse[Ԟћe«íÙláìîòþÛë‹ûñîζU?ú¸f÷÷÷„xF‹|S“Á°yÏjou"îÁDÞ“{³Ñòd {1‘§rïMÄï(C÷ÕÕϨ®Þ,»ÜW—þÌÕ¥O
+»þéòŸWº:ûþåÆNÏ·Ãã,#¢As˜¶%ª&3؇“? ³üÌÃÉ<è(ûæ‹íúBþÄ‘§ö!äŸe~ûò>„ü³MgBÞ‡·¡>íCÈ íCÈÌê“ !uùúõ»·§èS¦±7ㆥù¼Í¸ï/®®n¿ûâow7_”;|ñE‘ƒ—»ýâ—·W÷_Ü]¼úâöîìæoÛš÷Þ¾{Êôt×ÎÑ9}SÓÜy{#oC“z®‘·‡±Ýy?‹‘÷ÕeY•›ûSëN¸9åêâªüÂêvÞ–y2üÿ¯ËëwOï=ÚmkZÃè?xÉå'”3¹“1ÿJÖÕ¦¦ôL{~‹SzĤw÷º(_ï€iµ­–äó ,4mÁÉí ¹üG™–ó`ݲ]¶o[Ó›>µ]̯…9¾©).籓‚òõ›‹ób-ÜíýN{¿ÓR‡—I~'sBÑý´÷;íýN{¿ÓÞï´÷;íýN˜ÓÞïô1úžlå^½×ãg·q÷N´Ã½í3p¢½5[qk…“;ÒVxžÜÇãzª{ñ›¾)šàÓ}O›áƒY<>Ë]=lÛâDgñQÅþÞÔ$Ÿå…Ú—Ëÿ‹ùþúrù­2ý}h³>盌Ó=ƒ!l¹IÐ3Y§Ü@ãêòþOg—ïS¡6¡¹~½3¶3}FïŒíÈúޛȮ½3>Ù¹U}æ9òs“Œx/:Ÿ°cÛâÒ{ٹɉìûNmm"û¾S?]-ð6Yå¾çÔÇÕsê=Œægøî{NÍWâ'g–ûÞ ?¹=ð)öNXÑo`[¬éýþøúõÛ‹mæ}®ù·Üð´»‹WÛã ß¡WïQB†Ùm óÃ^Läûs"ßïÍ›ŸŒãlü†>ÁÎùweëɽá¹mÃóëoÏ^Ý~·ÉNÇ{ÓlošíM³'¦ÕojZ{ÓlSÛ±7Í~dvݦ&ó ÓlcÙ›f{ÓlošíM³§/ìgdš=U8¹ôbSsz ž¾»|õô*ÉØlk66øùŒž*o7·7ß?Ç°­ØÎðó·ï/†ZØØA«£ÿyw÷Í»«‹›óŸZ;Û÷Gú× ¦ý‘ö]‚¦ÓûæìíÅoï.þï»rìß#öM‚>ìü>Ã&A¯ïn¯Ÿšð{¼­"v }>ûÛ'Of[øÂùòä:ûnGûnGÏœÝS»í¬­h°OZœ×wgç÷gW¸½ÜXÕîðÅ5ž˜ó…7øãwÐ76+
+sxFÀá|[Æèé.ïÏ¿ýËåÕ“3¡on¿æ;›šÜlóÞ¼»þcaÿxò7Özf:þG#áI|o^ÄÒ‘þ‰”Ân7a})ìÖŽÖ'ÜRf¦X¦xšùþlk•ÏkþØOêjýWš÷Ó‰lç\<fD¬S½›OU÷ÆÎmjj{íû£Ìÿ™+ß{•u+ûò•us¼a¯´î•ÖÕ¹5Kx^fM³±Ù<+³fcsY—W3êò/ßÓç#Ë­ÙÚQÛçÖlÀàû¨âFëL¾m•>ï-¾½Å·­¹·øößÞâÛ[|{‹ooñÕ}®߶¢{‹o;ß'Ö"b»ÕŸz“ˆ'ç0mn>ÙÑŠ†Û²}ö /6µŸcË'óƒÛzà¶3£‡aßYñgžÈ®í;~{u{û>%ùgáb»ež¿„òãºìÛ›ÐcÒÿû'£Ô¾Æ1Ìæ¿suvþ÷/Eº}sv~yÿý¿oÍOo“û¢£ÏJÞÞÞµú„£{EîÑÙ½e玓íÅ]«T¾Jè©¡(ÿä>™¯. M}j>±í±Ü§žâPo¬®ä¸¿¸*cØ¥µå¶ªÊ&ßÏëì¿.¯ß=ݶå#Fÿ¡ãPŸ­a‹ØÇÏ”8[œÒ#öÄ»»×gç_ŸŸ=Ù¬ØÖ]œO`áOÐœÜÞPf=•Ûlj~æðØ-Ûeû¶5½ÙøçS»2çè Ä0»ï¾ÝZ¯Šå4vÒö¾6\Û½º÷AÔ½MŒ½¶·×ö>Omo«hÝ?Lû)«Hu+~óÏ7·7Oב¶ÅyÎâñY~ÔšàÃIìõ¥O4ð)¦Go•éïƒÑfúóc
+›t(=ƒ!|LI‘;²„³»Ëûo¯/¶Öê烰†«Ëû?]¾O‡Ú„æþ÷÷¤7Œ)õ›š †½˜È{4Ñj¬öb"ï)ïÞꎄy*×ÞØDüç);·ªÏ<G~n’ïEçǶc{ѹɉ¬ÓÖ‹ÎMdWѹi\ñØx2âg
+Ò¸Iùõ“à3î;ýüˆ>A@ö5Í•>ÝvºÙf#ä}‹¥3(üŒKW·w¿?+ýó#çï×uÛÙ•gqörˆg¦Ãü® ãíû³K6Áö8ˆ'3„ÃÆþÿ±ÿ(›švàNãkTò1¨N;Ý°Í’?¤[ì[||Ä—h endstream endobj 34 0 obj <</Length 63791>>stream
+³§í™·èÛvÊ<~—žÜãh[WèÝ1Ž¶e îÜã‰9nüº<'ô¸MuŸÉ÷Èœp™pÿ²µî´«Rù>E{³ÛòLa:¯m×0UÛm KøÊ6%-
+&þrwvóöõÏÐâó·ïnÎÿ¼Å›¼ƒ—íþì›IÂÇœlåßÅ}ã·åÐÍ`·†kå”ýnÊ6yÊŽÛÃæp[ózÖ9ûrζyÎÜGÌÎþuŠèÇbÊí¬…þµ¨3¿½¼ÛÖ¼>çú¥-×û¬w…lö¨í½!?°[:‡›Û¯U¬aŸcú<ÌFχÊi\}O¸Ã¿¾ºÚÔª<ñ†ì¼2{ô§<rƒ±yþSÚØlž…ÿ´¹½Y‡
+MÀ+»Yv?ñ…Üú2èòbYhŸcæz4mı-Ûß”!”OõëŒÙ©âDå†;ˆ7 {Èå(»ò‹š](ëV^,ï÷å,â‡bCWÎhìÀ&ùZ¹Ü/#Å¥îÊq/ ¸œ;æ¯áª5/Õ¥}ñ²L&b)Ë>Dß—£[NEŒ=–¶ ~¼ ÑqUÊ:ð àµr@\_V ›ËíË™ì‚×Q¿*gÓ;νwYï”A“µà–à`—ôåÄpóÀlp4ã)+ “¦UˆÙ7¶ÅmÇÜ»V¢¡åÚYú¶×k…£†®%±+[ãHî¬ï”Ý-»–bSÏkìëz´Á&ÆëR¶ŸWý,|¸|&tÜÃÂõSÇ·Âq¯‡¢1‚ò·ž¦pû+ðüéTO×IyñëòÏ–úÃ_üòð¯ÿøÍT
+?Yª>rvWžÜµçvÕ©]qfWØÝÏëªÓºê¬®:©kÎéÊSú‡A„øÃ<ÂÜ ¬ÍúlÎ5iEÜôRéZèü‘˜LØõ•4êOu“Èñ©j]‹u !·õrè¾ìr.\´¢ìG„^ÿ}K=ß ”ç>b¿½ãxÊ>ý¨ã5)óÔNß,c€’€ƒ“{.\“\™É‰tªåµr[2ß+ʳ¦š(9=ÿ9 ¢yæp‚©É^Pž÷ܳàú¢œ>|
+kV$jGY^ÔÔ2¯fÆ’ô‘S)¨Xî¶ì5áˆcÂパè›…ô „¢¶e\ô]
+©ƒ|/·¥Ë>Ì¡V
+»Äê—¥³%Hˆ‘—¶žj§1sË:‹Ó”íÕ˜Ê5î’¸Šo)Áú6´ÑÏ•÷p©– §½ñNi}×%Ž²˜­>ùž«R]Ww¡e.EžÑH!¿ÄïŸàÂ÷bï=mÈ")SAhBvdž2A7æä1RHl1ë´W5ýrÉɽ`œR#Oɇ)Û‚¡@Ð6Ñx 9
+'LMk‚9PGÈn[áÑäm9ÏQ¬ŸŽ‹¢XÈÂÁÒCº“M0^jùR!µÑT°Œ[q
+Rï[ý”Q–\2»Á‰/t)›,Â!tR$(3øen3Ÿ‰#e@}è¥]$¸#
+!´|­¡žeI¿]ö‹|é%ÐÉ*„®õ$àx¾Â•(Otº|ž¾ª\Š\=Ýýr.àHÀ’—›çF7—¼Ü’b™Εchy%1ËiÊAÅ¥
+¹Ãù„JX6îŸTxÎgùdŽàø‰"Ÿ.†¹ÇÁÃþå²)E+Œr`€RôJ(žØåi¹_åôjq(R«0ð¾-·
+RcàÒàçˈ2¤ÔõØP*³Ö……R_äGFUžç´ï…õöüo.ø{YþV¹«¸ßØØDAV–¶÷™ 7Ð7@w ¼‚eÓ<Tr¾—m×ð³…áž’ä˜a–‹ÃÊ‚c˜ Q&Ûz²i'4kÊR¯8òîSzŒ¨ú%ª‘Z&INh:Ù\keàÒˆ“#÷#S‰:K] »9%-EÝ„#´=Üv ýI¦MΞ¿WVÚ¤"Þwpñ©”šN_r8¡Ž"L®³¾Nö^ô]«óL{¢œã¢ S=§ˆ'¥°`z²xÂO¨àf߉»SÝ!p™@Æí¾…Š±Þ‹1J“à5$Ç«zU4ªÊå(ñ½˜mã¡x÷}&Ã(;¤ÌöÉ;±RéFe#'ïÉâI¸6>™r.v\žëew6ß&éÒe8›Àe‘×Oc/÷Y–×”)6¢5_4G®^áH©®•Ì0œp,š¶ÙÃpÂæЭÉírYbM$¶¹wT‚¥æk»Šä%­ÎªQ$¥*[PA;ù¹¤íá8FOý:xÈ*dÙåE?âí<æTÞÛ^·½¥òBm¦j#°€£.\Æ­ +ºá*ôÃz¶v° ‡‘º¬‡äø3•©ÜeݤÞt;Þn×Gññ¦°dÝxªOdöž"ðDD G XE‘4ô “œ$–7…ˆ¬º7ß‚X œÓfEs,…PømÇÅÂ.ùlHyz™½ô>ñ*¨î¢´æ~lrâ”á Cà"k‚Ô硇ýOŸ5…zGÆÔÒåŽ÷2\âLb`QNj’ŒH<Ò˜3²¼Þ¯9³È9 ¾ZØ0,èÒ†w¥÷T›¶Ø¡|QêïŽ:Â)‡^~‘¦y™î+4”ªQYr/3ÅCÙ ô}@:ˆ1€å[βÊÒt½…Þt¬ptøc_m|ÐØý¬Ç‘ó—íW܉ã•ÝtÅö-„²ÈI»ûNŽÂÿù;8=Å€"·aœ%—‡õÎh‡·é ƒÆôd
+û+”uŠ®ãz¨ßé89|¥h˜ÕÚVJ¢êBa: t¡µwÀ„ºq¸UÊu•½@µpø³yÊj 
+•; VüW¤ú]ö¤ç¥|@p0Uz3hÎ$*·ø›>ðÚ–M/óŠÒaÐÂb-«R~;"c&” þöSP\_X×.É7‚ˆC9ß ‰ËB1!ƒ™V|¦7E‡jKQ=jE0ŠpÚFáz¼Š–ë\ÙC\ìsÎP›äÅ 7¨µàï¹ïIÁQàK˜üén \>Îbˆ½Y`½¹è ¡ö(ØŒ•q,\ù†Wl>,•'üµçTa£½PDÎM&¯‡…±o"yÈЦì|Yíbzñ'¼d!(âÅ2 8VÔdô÷x£p­œeù@ƒ‚æÁ+ è8êg^Ž
+¢§®A …ñ“²;…7Q Anüt¸W0´q3`Exé"ç¸ôçâlAN•ír¢³ˆ˜% %üá¦pP§rprfÞjT‰ð'Ìë^n6ø†‡£À‰'3…*œ
+ngîêÈ ´^;<jÍp*Ò%oÏ)iTŽøù";V˜ŠÞ¥&nÏÙ'¹ù·'jÆX@ñ¶s»~³Ø
+YgcÇ &ƒ^‚YGJ¡¹¶iê(–Z§O1b:8ÏñbŸuˆå˜‚ýW?³ÂrÌêKÅÊÔ62<.Š‚Ç™ú ‡ITdZ„·oIÑIõ[
+ÿ€&W)¦¬ ØyØç´ý³³cãs½ -”{^Ézg˜ÛÀ‘F§÷ºÔ¸1ý¬.r¯”4£½×ë$ÕÐPVîá0&í³£¶Í¼ î` •ÜM™BkN’(I©×ÊJi›ì(‡»*B2tíZ%ïµæg{ä*òZ$q˜^^ÂB A:›ùÿ@é²²¨1Ø K9~ÊS»Àr»:…”‹õ€€–rUèÉ-”De·mºÂñ­Þ‰atDûŠ›zs±">
+§<ÓPtxà÷Àòô­ØÉ­”2sI
+ÅyyKsVþB£D¨³Š\‘ÔYÔö†¦“lX
+Épi|;yŠËGoz”–Tqþ$G!1%z*}dÔ{•µ'ï¢vUN¸×¨ðTàè¼/¢5Ü)10—ÆNV×´òžÊ#×­È/…^ù¼…:¯0
+gùU',h]3¹‚R¦\§ÍÎQË€”.õÊÖÜ÷­$Iéí¾%Ûû²'IÇvxK™vmu ƒï1…%#Áøhâ¡Š|TeQºUÁ“zVs=S,tIÚº5-¼8 jÊy‡·±É–Gd ;‡IbXÕÔ“qGÓµ½÷ÆS”¤¶Pï¤Å­  ð’dzú¤/(È‘kª
+²#œ˜B¦ÇL"ªq‡ ÔœSÑàÔ;Ê
+(}¿ìŒ›¼‡"
+÷œ¬ì´¬=£¢É%=Üh9›Ÿ‘¥ÓG|òˆ,ý×¢Éó@wìã^†×¦w:¯<xX›×5•ÓGžûÜü嫽¤p¹š“®)yI-¬Ì㼪UKˆ¬Xû°^Ò‡#ylb/)‚,Î+­îÏk£e¥§ê”ª::Rá"8}äÝzD‹qË1¶Ìr°/vÊ•–ÃÞŽmVN~¡éX<>Vi2WaŒ¶å÷OìW;JØ \×k3!”½/P¶AÔC©V× FßPµt†jü$£Á<[~îÄ.vQ[»ñc×FÓî´(™«
+èì¹Ê$ÖÊ>6ª• I¿ÞÓkXD#µT• z„º+â†GÁ´(Ë´5SÞ•¢qzNJ rªþý0·Ê‚—ǃz·×(¦0=¿óIßUé
+œuÍ­j‘¥“Ä”G™ƒºˆzƬ?§z 9«§³ÔJé†ý•íë^摺QòäˈÂ%±Âä^‡l¬µ1?Ÿ”¶`ŽLÓC‚ïh7¸(4®×õì«úR$²^li8EPQ_í`š±>%#?LŒªÎédeÅÈswM;>S=™â•±æNiVfD½>k•U#‹F_ ÔШ礪”hnJjÂÆï(b¨¼FÛŽ9ñTT»çø]ÓJ©<…¡Ç
+ϸ6ÕÓØy¥³¢ÝÔÅà-»¢†¸$þX¨ØéÚ>e1Æœë§óSí`[øS©8|*+dcNfÄÅ4›¶V1y‹ßó›&ñ³Vqó´áÖHÄ[!(YiÈC, =ò$Ò÷ÊRÕGvÕ1Cxjµ
+*ˆŠ*5—ßÆg „"÷ÈÞ³`eäâÂgý^R(Œ ‰ÇêÒd"=>¤°ö32ãÊ(Y¡&¦ùÙÏuí$ÜäzVÄ«íTT'ùïÝbð]LÓèœíS[Ä–/*þ+ëGÖ„b¢}/)Äre­s‚5*KWéÒv°¬p­çÄx¢>%þ7x¯`)¶ipVñØâSˆpëSòÙ!;£©çª5ãÊ{oÇÝ[ýjg‹Ü¡ˆJ½ÁÿŽ0˜^¬ºC^j;§á=‹­úI`¬ÉÖRBþÔnˆÿ#Dé-6XÓHIS蹦W1XæKŒ‰ë,€lI·åÔE$l¥ê«q¸Ö|™èªÐZ%
+mŽ±b$öˆ!fwŒÆÐ[ÌPâ’ŒÔ+Œu÷ÆZeôyÖWO¡Æô½¢œ¨ÚA%0ƒÿ/Žõ„.ú‚˜;λ ûÊú쉣 „úõÕ¨$Æf ÕÞQt«Ïé­î2"xiš%h*à÷V¤KšMd€Õh¦]Ðl¤^ŠDo\¤· B-F&¥×%hª€@n$v¦Î¾ÆEÙdºè˜¶¦Nþ¤ÔâgÏ‚5¹³ý¢Wè'"c®ŠbÓ*ÿM…ÑŠéXôíÔ^ –Q6UA©•U¤$s#FÓf:¹,HK&Ç-OttK僧`2ÛZ¨CKYjwѱƒÔ ¥6¢Ê*„!®ÌÂÃ0T=Š&µÛ±&Öh¦iy¦ÁÉêT*(òÕÂ…é«×®(O|O¥³æ
+%[TMŸóµLþ4]rtëàKìÎõýjÇœ…ò¢µuS}s¶›¤Haϵbǃy6Qyb)ˉ—íßÍß[Âr~äò}¸L¢þØB©ËÓŠ¥Ò‹ï[,<õ”岯­X°/ß~0OõgtÎnvp­C|«dTai- s½IkÌ'Xž5„œOyUÜ1 ¹WŠiÛi¬ o#JCšýH›*ÉJµ£-.™(úš¤O=øüIýQšÙÙ:»Øv\gaüé#ÏiÈ(øUE¸J“¯¦Ö’³§<Wß–žŽð|Í-hÜU õÞ8ò}ë%‘r`G,»ƒé,]-KU)u6š¾5¤4ta¢Ë‹ç¢ÑZ¯¢F¾Û‡åØj–TuEù!»JoŠ¢ µaÑØ`çÙóuvžæ4„!ˆž\MŠ V5–«Ó & ekÓ§íR:Kì,¿$¨§äpKìS´ª±/IJ9h´"gÇ«éjÖDÝÒ€HµÂ` N,ã-×L%o 5yÁOIÅ‚­ë(/_<cž8­ÏÁJˆ½ò_ÔØR먼r¬#2îHq1 ÷‡/öaLÀ8yô@ò¸X.¢Ú-é*$f4Ùqô:à¡gG´ão×kÏzÝ oÕ²B²©¨zò`Þäœ*s¦vÎtÛªŒ¤v?8Û¹Žj§F6•ˆº8ÖÑ ”V™”~HTv8özŠ>*}Kí$@k;½©<.…‚(výÙAK¨`YRzÒ©‘R¯FtÈ6M–'Ò9¼î‡ç-b䤷ó A 2ðzw•QbØ2K®¡B¯ÆnGÉgÙyÈ3]ªœ¡g5°ê
+µDu~k‘·Þ3yÂ+vh¸Í‡«ý¿è’ÏkµJûÎ2¬êY’’ ¾QuœÚʪ%KýÌêð¢A6q œ˜Z'©Ä2}Žn?,žÒk†v“ßò·D¨ØXOí0ÃQj5­m
+žÊdªæÖä,o­mêÙb½6H¹šèÁz?%óH­QVRoámXʽ¥ÎËŽå´HVËng×9ÓB‘lgÁYN®- F3S>Xøò@âLZik®A ô1Q2Ye?Áª7’¿˜Â¥š…qÚMRçݶæ–y«Väc*Ëì`¤AUÁ/
+(ç0]#ˆ-×u0×b’ì¡Œw“⊪£ˆOÎô"â8éJSCÏ¡œˆbÙê>¬ Y³Í²†8½JÏ9ZEõQò¯·š3€2’ÙŠ‘ÖªO:r ¿©6(×|I>ׄY1$‹SéG-Uð(*׶™ËÞ[{5_NLé7•]b¯7šµÅM)yãBõw/!è+'O ñ BÉÖíH7Ô}q‚‰á>¨.¯cŸ‰t5½œôH‚¸î•:Ø7µÖÍó@@.©^‚?›$VÁ9)ºîj6`*Cƒnê­tº”Ê]@çL+K©C­”51 ª}(íyô2â'%#›ÕÙPMÛ0]c¯º <ƒèP ^
+*H×ç•À˜Y¶“ìSmgâEÇ :W3«ƒqǪ«Ìæ’3]ÍY²/=‹úTgr)(JêÔ·e6*ù|ó˜ƒ
+ZTùJd…Ñô<LU}ÐlF¬v–ªú¯<LPZé º®Z¹Î w£ð3Kã®A£rŸXPFkLj¥Z¡à­]ÁT"æÛ¹\ZnÕž›ÛG×Fëº6ÓÂŽz}0lÊ×?,gÏ}nÎÁU„üšüjÓàûøqÛßá˜z(¢PWAE¼x¹
+,âÅËá"Ê+k
+QW
+w°€²3„^ÚÄ¢Üò50Ô·W
+À ½¹„ÌÐ6¬ÍЛsØ £­
+xw(úâî`ò'-á44…u€JæÞRCë½+¨†Æΰ:Ø;kˆãÌ¡5DÛ\C‚zgx ZP»lð¥!6h\í²AÓj³AÚhCÄ]¡6¨í¶`ænCÆÑp´äÆ‹—»ƒnÐVÚ vƒ¯ì¼Á`áŽÐ´Çvß`´hwø škK
+Á!K`gs Ïa8ŠY³ˆƒCXBq¸;‡œÜ 8Ú©»rÐÚY@r¶;(‡,åa9hXíÌ¡Ó±€æ qwp&,á9H\t(=aÑÁã½;H‡Ü°:H[Bu¸+XGu\?ì¨Êæ²ã±g«»xÔzúŸžšœóò™é9/?L‚Îr"–XSøÿ@Þ‡âö¡¸Ÿ#çÊѽ¹½9,úÅZ~RR×Cw…™¡[j7 ²ö¡fÄ‹w›á;»ÁÍ”Wvœá®ï9ßÙtFéb»ÁÎ<²Í•so|æƒåB<{d?Ù~ÏEzO³ @Q5|`ˆl?ª1âªÆ>±
+н¹¶¦Žæ!tQà5={:ùÊÂƨ QWÀØèňk lä
+_‚Ùˆº„³±g­fíÙ6zs j#ê
+X%°¨k mìHÍÁmŒ¸3¼Þ[ÜuÄÞ\‚ÜuÌÞ\tS—}w¨íô
+°½¸îæ‡.ïZÈ» Лzåw‡½Á›ë€o^¼| úFÔ5à7’lKøQ×
+8c»âTüÇ„ý
+P½¹„Å‘:µǾ·€Æ±ïíŽc/î£×
+ГÒsØœJÜ8§
+ýÝ¡sL—Y€ç˜è^Ÿco®
+P ¼%¬ŽQÀ:F]@ëu¸ŽÞ\Âëuw€½¸„Ø1êdǨ+`vôæ ÓJP;F]€íTênGÔ5€;¦ê- wD]ºc
+àvGÔ5À;zs ôŽÞ\€ï˜>¹;üŽé“
+ÎcÔ<ÏcžÑçó¤Ç¨ò©LÏyO^ºð¬§ê?s¸žÇžÝÇÊÄÊ>ˆ«vŒ|äEyûÏôá|ÚÏÙZŸöC0¡Jà u(ôئ—i +T©s`!£. …ª‘µ;¸Ðøû €¡j~í14µw™Óh¨RçPC=;eq À¡JœCÙŠ“ŽÑOÒkKØ!ÑÎÀCf›, ‡Œº
+ #{su$ê
+°#½¸îÈ~rx$êò¨Rw=2À
+Ø#½¹>2ê
+è£êÎØüȤëþÈDç
+
+‰d^€"‰ºÉlô0’QÐHF]€#½xù<Ò‹—k’L5Z@$Uê$ɨ+`’ôæ(IÔÝ¡’l×wK²Ó·€KuwÀ¤zŸçI•:M2®±6Éø×8ɨ»C'#]€'™Ž¸>ɘø@ɨ+ ”ªšƒ(™ÙFÉìHIR|”Rÿs0%£.à”ª<TzÄ)3zkÀ*UâX霃S{¯T£9ÀÒcÏîÒÒÂÏú¸Cú©×Ï»h÷´ó’-áž>\´á3]ЛƒuA’‡°PF]
+@*ûÞ’ʨáQê–Ê~{0•½¹€¦2Ꜫþöžª.î ªÎiQeû·€È0ê¦Ê¨+€ªìÍT•)~þµ÷UÕ7‡«ª#Þ°ª*¢3È*#ê ÷“%][UÇ»3p•b]5,%õâ
+^eÔðUv*
+;H]Cß;d@:¡Î¸°²ÿ~0$ƒfæ(>øÈÿ<øæñ%ùz$!_¡ùåxÈ¿üò×ççï®ÿ|{†g''|„u+kpœ ´ÿIœ¾;üî Õ$ 2”"€À/2À×;´Ë-G%%5/:ê­H(ÖvÉ4XµMË`UvÖi3"º•E`¤8æceCv@@cöElÍnìUÃr£}¥G®!—CÜåÏÐAÏ‚3¬¾ÓW˜ƒåªû2eÖ3wA;9
+ÚêR;íQXÆN€=Ò¢f™Ø‰ÁjŠÿ²+±±\^Õ –³³<»S'J&´Y0
+WIP
+˜žåÕaðü õjjѵltF,Öþ7ì~øàVž¼~œ!4‡¿ú›ûÂO w<<¿½~sûîæÕáÛoÏÞ\^ß¾º˜0ƒw¿øÓíÕßÏ¿º½?,¢ðþâ®ð
+°970<üÿÿrFl»¦W«Ð.ö„iÉÿûð@yáÌ:Jh¦ ÅÓÓJK½ôH«éxÌàQ©ùàG­«KPÃÄræ¨ö‡Ô–z&ȲŒ’Ý+z&màòGëå_9¤¿‘)Ig ]èLa¯ì+–ÔÀZërŽ¤í`GD©?>˜{?5jpNQîò
+t½¼©ZLEó_¬\èLÃLð6tÑø–ÒiR¶fDhõ&J¨]ÝéV+.¾¥b~,5S»Ê9SõùÅ‹ÀÉ„ÌKNÁÔ
+·0™³¼JýŽ-Ô¢ª8O23ÓðóN<ûz˜“]| „ÐÓ“ºc©nLW…¹›Zšâ
+ÉÀá‚pÉ^ñ](«¼6®ét)˜q¨Ê­plmŠÐ Ø:«õ–XÌŠ®RÄÛGØZù¹¶zõq¢Ñ=¸¶³Ó-\½U(AC$ZÌ4p’†¨òº*ì³òi) Yõa¹Hª8#G"¨†`\7ªy ZõÊè
+ݱ„ùjD´9) ºzÿT³‚ãlÍ9Ã>¸¹1Èì,]4eÂ%qBTpÊPP<
+&œ‹óƒ·âÀÁ´ „oÑ"÷¾±f8°Š!ÿX¤Œ)öÖ 8°k¢™Gk«Œ?˜&THeëc4¹Ñ%áUÃÞ‰lÿ£@Æà[;˜ÍQG3|3g¼­ï‰ ¨“FÚ»l{ yWƒ<}íùŽ
+¦K¨~›ÑCƒ¥¯MÛÕZ*ZGéÕ“
+FW7ôKŠÇ*ëÒ_j¤,C×#îŽfœ!Vв_+ï¡ä„¿ç-tËb p8gu"káÖŽ¦Ä¤„;Ôp)þ7³a|¥gx•;EŠÉÍércAÀºdÞt‰ÚF:‹âœËcljÀýÚû+Ÿª±¸-a&“ªòYÔDG21`D ÷ÒYÕ µ3Ôœ4‚uje¾$ŸP£‰Ï,'ú‚¨¹аŸ&×´œ4Õ"nSu@ÿÇÁèoBJ^Q†ÇHcŽÀk¸ÂóÊÂþ)6³¥«)–äÑê¿ífëM“î‡B^3ÊkQQ”@TëeÈC„næM¯£ÓÃ>Oö ê«ÑušBC!%î¦ÛƒKñ¥ÚÐK,ðXÂ’Š¾‡‹€¥dÄoÃð!FcêÜ?ˆáAëúÄÖÞ)/[<4Z'C¥„`²˜ž¹ÎÚ#:6>TVE}:?PHS™òå„+788.ß°õš,²#8¬k‡È µ’Ž^¥'î6V÷¡³8òâ !°€Å)u›ut﫸Œ¾¢LÀ\-Ö,«ŸžÖ
+öÐpMд™`æl[àD@¢_`©:;—s™£…×Ë΢3Sð‡ÉÒè Xá ¶P.Ïkd£À¾ò.ºƒ>Ò3!†ð™à9ÈÒƒ
+Ä ÏXoSë¸6</›åY&Î&êe—U¾áÔŒ
+F6q}”Œr²`âÃßä̃Íõv¹Å“›pñŸdV]¦e¬É EîÂYÝ°>¦)ça4íne¾ð=¼…”aPüѶ=«;Œ'°½rÇ ¼:Eœ-šyE”Kü9ÈW|~P`?¡’ÁØòf`£ûÃhŽlØšàJ¨ÀÁïè’öt>âB¡ËY13ô'z´œ]ÏžfÁÊ[^ö¾‚ö@ÑláIQýÝç¼Èµa¦#€6zÍ'6š,ÇwR:°Tˆ<I µ_õ!ørU¹µ¼AQŸcôõ‰ì”…ÝXø4 E^rýd¦ôQ4JXeëšLÄ›hdEæìâš©·6†¢Ú`gy®@U©ôU¢ EYzVurÀn+N‚Wp1Ù
+^\,
+ø‡la Õ‹9ëZsÝÀ¦Vö¶¾Q0Luǧ{·gЭæ?J¥)ôB‚PІ>ãž¹ßBzÎ]CÐ&ö€ƒÖÒÛ°—_YêdÍÚñ’u$ P1š[Ý×>èæò$+ŒJœW²· o˜s ®u,ÏYÁn4”è“ÂûB %ô·Wª’çÌc«’GtfƒB69åí ˆÍ¶a+Š
+ƒ‰ìRíèHƒãk«öÚ)½X¤è
+£¶:ªJÞ5”§hå}Át§È6ølû{J-I¿f¨gÙšD“jÐí}ãíÜö(ò+™åXk©Ù¹´· GxjØ‹³‘–o ®eO©^“YWÂWS"àhÒ±Ñ0É”˜)Ž~„XÅê߉³‰ì–`]?*"¦·Cö*ÙÁ²TãëÂ3!‰
+#€Pã‹ì3¢•Û¢ÑΡ
+NŠ¡ô…Ö‡²¥‹_v—à²B2‰Ÿ”—àÿA—å†m7hjµ®‚\\B1BË%:JÏcæàÏNvO´ƒSVÝÐ5•?‹ r_¯[AïJ°_´þÇÔä!ÌVÊŒ÷d2&k6ŽÉ™‹Í!è<.ÌÈÂP¡,¸ŠqP`JqÆrÇ€ê¢à Ü]‚žÅž2}ƒ¥ ƒ)ºu±•2w"“'9aJ}èÛ¬‚1@¿4
+6ÎW n¯«ï˜WÁäL‹€8¦ê3b dËq"¯‚=”SåÕ¬‰rzš6ßYû ¬XPÊ+ßÙH&ɽŠ££ÂÄQŸpìÑÕiÆæ¢qÌ'#ÍK+¤ñÀßóÇl툜5æÀÒJVâ€)qKv„Ò•:¥!ôõìA:BO­¦ÇÁÙ
+]mÞ—áò"Â7
+`˜¤ÙÒ^Q¡›ÚG;[J/HŒŸ0ÚÒ p1V,œXÓ9 ±GŽBdÆ‘²-çˆy]â;±ž4^a.¼Š‰ÐÀ8jí±–I*lÊD*ÆWÕeÈqj`„è cÅ°€Øý Aq&W}LåÆÁ1ÉWá >ŽËFÞåˆú“Œpò8áìv‚‡`ø3>X¯Èžr% tÔH©"r"‡Öêƒe¦ñÕnŒÙ¨´r ¶N©:ʸ*»"FQD1ŒWs°8Ùš<AômÃá¥+Ò¶fª0›E;‰)Kuß҃شÀ3ášíõ¦Âz`¤Éi¦ˆƒ;dtÁeÄ44Nž0
+™_Øä‘“À Èë)";99 b¯Ð#rVáuÅ™BÙ.NöI6lùŽœ^œ;fGW1qú±SvJ2°Sþ:ÇÁ×G}*°<©LUÈŒ‡ U™er]ýX³ ˜ÆEø|wø¿ ÚþE 8²ÓKY]'¯bÑ~z
+µ`‰íaÏ¢°AMŸ
+”_ð¬v…˜„C·)¥=}6­ ^Á2¡óA‡bM “"Ót™“
+VôWïpI¨AÇUÑlT/Å6ÐÁ­$ÕÀtç¬)tÛI„p²º†ÉþeTjX‘A»5H²ÿpø¢“þÅä+0&â0Pëêœ2”P›½TÁ” ›"g]DèóÊöèTÕY^
+–?_X€Gm)f!aôlœREÆ@&6ùuÁ,ô¬Ž³ð…4Õf/
+ Lª„ @HËó¨ÄêòÖÕµK¶ó½!øáÃÆ9àý£—ý¨ ÖÒ¼:0]~E%QËÄQ…¡¢lÔ@…“¡VÅbpÄkLÖ/ŠGÅR
+®¥L·ÇUÏé l[µšEÒˆV=Z6 *#XЋg¼bäM͵Æ$8?*¸õ‚ªi+îžÀ ‘Éî;éd®f¬`O¨:Õ¬:r©^*oËNàÜFÅ©%³#RMGuìVm–¶Z)º!¹(±ÜBz+Òk³’ Õ:ì‹G±œŠ£àŠ R§Ø_MVCPf_u7gíÞËÉ
+ÁÐñGð”ÂbTÕ¬IcÕt|0ŽH턾v”m}> ™1[ jÑÀ¤U—¤'¥*$Ù
+T:Äu¥÷XúX€Õ–ä"¤©Ê ³%@sÀ½A¶µ8Ÿ*ÉÆ Îh½œEm¶æ XgíË,‚ÊÓ ã<:ùLñ)VsO³•ñ¶i†ª7RàA¶¾#ðk1-:n 'ʪ`DfðƒÙ „, ˆÜ0Pï•c
+„ ¿‚^˜(Ïi8¤,„Ã1YƒhèQd¡h Èy€Hö«vÂQ hÁs
+WøGë³þÝÝÙÛ·‹2Äw?^Œø4ö‘#€tfBS­¯Át½ÚÄäg²¦ÆEsÂõZS{ë¦ á`n^:‘hè1½ƒÊV,ìêÎÉÇÖ 1›È2"Ó‚Øb©ìŠHö,G&çWoQ€!4röDòÄ_èÚ….F£‰ªìtšZ)ÑÈ;Âã%C;õÉrûiÑV`ˆ`y®B6GÈÆ]袹ÅÈü/¯Lâ`)Òt×079J9…zѲvisð²  \Lº* ¡Kjã뙹ÈàŽÊù»Šf™ Lq¡(8A¥kÂ…H=&ˆÌNÏô–Dµ¯6‰ñHJ`_«b0O¹6æTd”¢Ð¤hYÎ{HÑE¡è³x£~ù8‘/ÒôðwLó0]ŒÌÔ¯ö–2ÈGàfŒü1’O q1uÃOCR …á(xØw½lqõ‹ÅAˆ–LÔÄVi2l¯¼,üh ¢p&õÔ@8+H}•3N),m² F¢½±Æé³,yAvf•Í „¼,è3Pµƒò³˜&}~€„P¦1õ
+äõÎR¡œÁ? =¬Nuê´ò¦3]¨Þª.*œD/pÙŸ>(8CXFzÒ[EàÒ§}Þ$ÝË¢2# ¢G÷"i¤fõ`‚Á`¤Aàò:Û3‡üžNaZQ°°’Ê ˜ÇÄdµ0”Ö5‘v;vm–1­ M°0züÛ1쉥ñtèAÔˆ*ôÉ#üèôàõßi)ò¼wçƒLœ/áJwÖ¯ÓÁáÀÓÎlVà#´AçbHÖJˆ5Ã1fkfÏú÷Î|
+êˆÑËU,m0¨£Õ¡üÂl¹›e]³-ÎSSØë¶1ÕŽ0àÄ!K¦ž•%f+ø»†õwJð£o¢¨‹ƒÏ&5VëÓËÉG½ŠJHy…¼0¯™ôÖÖ[f£–2سÓM‚ÁEƒ‘#íÁšuÄ„šŠŸcêxcÁ‚‡LT例‹ˆå.ÌûD'çL¥^ð¾ÑɾãÏA! ·åjêEBIú`z«MÿW]%bZÙ~¸ÚÅM›Á’x()(±B7rufäÖÍIçji ®Ógål¦N-èÃck-¨ˆ‚¸ž¡ÿr’yBkýÄ[kÆv×Áúc«ûHY£ž ½¢¥pÒH-u6!ž.lyèLèY&©³ÞÎtÆóÚ*¢WwekT ¨í hóßñNÑÖë= 6dƒ:¦üA׉ ¾ØSšÐõÖΤQ⌊¸‰”0$°KŠÇr¹Ñì8`‚³žyDþ‰­VÌ)i™·ÌúvÑâ¯cÇCÎÚFx‚T`ÁÙ`"~¼ä½Ì¨30 &\~{^X ›6•Å¨x X$³ú2ªQ$S3ÙKŠ11l¹…FŒ$XÉši†Ã!Æ
+…HGk@êÆ€¡ŠXÜTZ1¯ÅÁá¦í-‰ñSU’ 8Ï^qx«Éµk‚…!à åÆYÃ0äcÝ!~Qj­ô;Pß½Rg•¬ŠÃEIpøÔ‹–¸‰wrª®;e¹=6èUëi•ãtXQOs”Â
+hÎ8+~½KêÆÙ´i¾êCǬ:™Çð%”o
+Iú9ºJŠ®’¡«$èfž»…½ú÷HÅ#†“a«} ¾Û5ȺBD1rPÏ.Tù«€¨ø ²*À+
+¶êËÍÂŽÐj=y#6ŽØGYû-de¼äà;†ƒ„e‡DVBB·¥$<ø%ü|¶¨¦ƒÜ¡k$2W>856:Å3‚¨Ì ‰äôÈá²À7¸ü¿‹SàY ãYùv «É&ö²—t6ÑQ­b`ž©«kL ñ;Dw)ÎaJ2óFÏ0FéVž•™æF~Õö:w’³=çæ•¿ìÈ•ºBO¬ÇâÑ'zÂI;•]ÒkÈe`Æ‚·bnU±®ž5ÊÂp"4© '1Ûﳜ¿!Çæ¼I)ZIÓ¤0%g…¨ì|Ù6`¡e/Üw9³œ±„S‚¾Ð;6Ö#HE°.p-ûÑÅsÚ&ÅмͦÅŬ DZwRgàâ´ƒ—P!+§ª]ÖÞ3…ÃɱxrÐ;ÃØBÑ
+B+Û#Zb=je#ͦ8¢N)šè>B…«µcT÷GáÜ4Î\…åŠ! ÿ/p¹i½ZSÒ¡%U`ªô ôn ý?súAÖ œµš./
+ª$&¶€” h@'îy%H ü×N±¬‘¤2niÊÔíN±°B
+8AžR ¬.“]ÆÊfu,—r‡›ŸPúÑf/†êQ<ÅlSØÒÇ"¤ ä9;–£ÎHG”ÏÑD¤Ø N*fnUaZµØ‡v1šÃ5†Œ(ÛÍ#­® €ç(=)éÔ2!à
+ì üvìChtlo­Ìä¤Þâ°(¡‡Ã ‡qÊ_… F&'t
+¸å`©Àbì™B·aú³Ò¤DSª$Ó)(õg ¡–º‡ŠUµG
+ëàŽt©þ0
+áOê m†%J²>Ù¶<@±`C#ã LQwHð6ûå¯ZOAɽšSP‰ü3±÷¨£rðâ¨pQ·Õ u1éåaõÖ<Œ/Ïöð(‚Š|Ä*˜¬YvÖ©“•ÔÜŒìB!Ù[/è¬4b:9RÃXŸ¥zž&qûq¸ ‘’ßJ=Ö£¡ƒ¶¹‹ FA³”Uú®¢—g‰Î§¢B @•NèÅÑ»ÏÌ¥ÀöI¬šöfQ!Ž§ëª.†
+)è8¸Öè–‚ÒDä9&Ü°!2ÚÚþcbÂ
+p¨A-…£ÝSk–âeƒE‚r#jIt%G”ò€ å†N­–LA­!BügœAr‚‰ª(¦D¤ Ílã2S²4NFÆT cìÎëƒÌeuÒÓ ³ØÛ¼äc‘­RîSZœFÉ«îä•”E%HGOSéÈ$¸oÑŸúqž§¦WfÄjgÔ†‹†6Ên¡û80¬e¦lFÔI‰KGˆ[Ëq…«´K=:”bHÖÐE 3$À õ"¥”!
+¼]ˆˆ—ÉþXâដ¹™ JL–r£ví‚A‘X€c°‡á@'p]Š¸{(¢U'N„ÉIXzÖ–äôÙ)5˜Ù´¹¶Ã(¶
+—2ÎöüIÃ:¡ÑXVã¥anºRbøA¼R”Ð×YvHƒÂúáÄ'8p‹uq¤ï£BT$±UùïF†p¹+Ø"¯ I&I Ó)ŠÃ
+Oaç˜X‘%Ç@Ü{Tc@™• !è$ÒgQ˜ô¢u××’"|!5 #dm+. =.ň€_0 9G ÔØ]¥ôÓZОh~†°Væþ-{SXž@h&™C$Óƒ`+4¡F€Üjq3ñ|`ü/0ÐE‚g€oÒú"ni(¸&bQíïÔ £yÅMç\ÈSMü_lQî$Î:¹ûˆÉ#¨?üKª¸3Q˜åâa‰øË2c‹‰;«u“÷„à!ÖŸ9Öv)7Ljì¤E ¸·.UÒ3Œhi45˜ÈSCkbmS*—&óxU
+1NgDꨜd…!iZ±yH  ÓáC[µQy˜ÑEûMŒ¡4NUà•r+_¯—kÈDzA„!tøjO‚²°Ê6×\dr¦«† 21i ø©9K<Fb¶–Z_J˜´€jÅ¿ y@ùµ8XÂ$º5ñt÷wÄ'ju»)ÊX¸*ôZ” dBÈ`|w—;,æÂJén …ÅgHÐÜàsT´ DšÀLê;C·æ¥KÌÚÇ2Æwµ¤zTñqïC2 š å1‚aC0î_
+¤*%B†ˆLA%óŽ,Vÿæº@wd¬Õ¸)U8
+š%“ ˆ)Ÿ ©”Ä~àáÛŠÐØu‘xÄ|®ª‚“ö€`‹Â°XkŠŠ¥å@AÔ¹7Œ€=U ƒ'qK¨Ö†–Þô`gWð¤©<ˆ\ìˆÓ8ÎVƒzJ‰ºRc{–ŒäƒMB>+Ô¾æZIÓ‹€$Êí Ò’ß!dýOJ Ç
+U!zQD@ç^HõOD‚÷†ÈMgn#ÑŽÕ”â5ÈM3ÅEzÚœ\n| Ü"7qéä¨#$4’«à?‡°s¦•´sz9!8 ©d.ƒÄ
+Ö ²‹SUÚJî¡‹àžqÆkJº“§Îä­Ü©VÔµXײ=cñH”¥‡We8’¼´9 —¥3g{–WÀkQ&Òße©:b^‚¢k„à5IS\
+]"Fú\¼XØÿežÛ5c-J”a£k‹Š}¶1h ó²'5ÇKtb(â†KÀ¬â¤µ‰©jHwÀGO5;1/°åEý ©#øÖq$rªŒ ¥ÈbÁé'L´Â×ÏIéŽL5¦o—ˆÐµr£
+†§þ
+9>=N—œÍgÓ˪þYfêÙ¹t‰RR<$¨ Ý<*­
+øBFçùzX§Lmˆ,Ê´ÏFG_è÷*8” ¿É&è7{zV'
+øî+"˜«E÷‚±Ê%JvàâÆê,óLfNà­;‚öEž5•Áˆ²@iÀ¼x)p æ2“aõ$²H/v‰¡ÓzÍivrS¹BÛÉ ‘>ÛB~¢<’ÿö(XìÂ<ÏÃÒ_B*%.•±¿QÊi`•Ö ÙkBä-ì]%cõ^V™9÷½"¡Y*}Í.ef ’c—°{p)e2
+!fÂD™Í
+ù°R(ã •èt‰ªx'²“á*ˆczÍYn«râèÔÅ'gCYqâ*HLÉǤ[+±eø•qŠK‚"Gf a}ÍÊžBy Y¥³½1"_°bé‚¢õšk‚iït%/‹dŸÔÇ„s‹­–e—ù#EZUùÓ šioYÒ¼-Š ¥'ãkåÊ¡æö ÊŘ™¡½„¨P™êq^iÛ!¶k Ñ<³‹‚ù&9Bá'Ž å‘ʾU‚^i¨ü¸À4à”@vr¤Z”7Rf1r [J¥WÓLOÍ”QWÀ½¤qË‘:¡RúW¥!Ó*ôAPHZ‘%H,#韟ITÖ˜#Ò²¡NÉ7iP&°`,‘{Y7¸T’·FD„L–gÞc¢+p\ñ’0ðèˆ(á0ûpß{‰*1Y+àY§HÇ¿-õ1a)Ib—¨Â"2X#˜¸’ÒÂÄsº¿²)Ëò"ýwJEÃÌ®˜sœhoıê§Ê8£ÿ”Á…XÉHr^(„ÿšè“ÒC+üe¾%$w–ð/‡r±A/eÀÕ€¡sÉibqÂÝ9Ò !ÿ ÎN«’'m\fÞÃqÓ&(åóˆÅße'#l(ÚAžéF,R0«…quž¡
+ÛˆÐ9ÑltÚÄ<n5Itˆå…‘oä@-„G‚¡H|å™QHÍÒ‚s\$osŽCλǽ48R©à‰’|b ~1hL&äô ‰Ýb»¬•S‰MRæ"-£ÑÆ ©\ð4Ú¡îˆÓ (bpBJ:5FI-8Tœ$IBîÓÔB¶p»……°êíKG†S Plúnp~ˆPnðX.Ç”G µ™Pß0cëŒ?SËDrfYVT|,:¡€>€È3®%ï3ëQ~§22Lr9’#‡ö©•r2.ŒØv©$
+s ÁR-ÃWáKbÍJÐå'}€Ô4Ï!Å
+²F:AÂBÅ_ƒHµ0¥Õ4”9-OØ
+çJ.žAr²ƒ€dÉON ’•' •,‰ÆÉ\\
+–<6æÅXDLD¢ƒ"eQ#C¡JŸ€À»”ú†r3ñ¾çâ")}J©çàÄ/¦•]–Sð•ÆxÁ2?ZòFqpDâ†*壯 E®%ô¥ B6’jE‹…~Âé§æýÙ-¼ àÙA'Þ<ñ'›‹ëT©£)=ÊpôÁ@ý2?]†\Ò3QÎO$†4LãÙ©¥ÙÑ
+Õ’%a±éÕâÿ¸.‹Hiˆ„ÁÞ,cmûÎ(ŠÁãiÑT˜¡ÏT/dÓ–tUG*nOhôHœß0¥å¡Å²àu…K˱ˆ™ãrà9]Ãp¶gÆûä,”ÈÂÞH5%cNjØ陡ØH!«L)ÏX‡6ÉÔ
+!Nw©L%Èzcd‚ó·ÔÄéåV$ëUKù9߆ã$ò€”4%e…ôù%¢ÈA˜5Ï™ìãÐÀG˜“2ã I†p›…D5!oL­
+§ƒ‚P8jXyÎ× ÄsŠxƒ/š“ž^A¢>ÐA§bì+ôªî/™€Ù)bÊAÂÌ2Bì v!ˆÿXª
+ó†qäÐU‘)^›:EzF»a­æªöcM|l¨¨ã¹¦
+6vvPšUHË<“q€‹ T˜ ÜI!î'Å@~ñÈ”C*êP¤¯lnRR·0ÊI:Ë%Û%¬ ÞY…ZÊØfÖyfôeÔÑ‘tœ_¯à) ¦ß„¹ÀßV‘ä·
+I;AŒ£㲄,@Í$Óq˜Nšf/ñHeÎ2y“ùÊX88´ þ˘B¤ÿ
+Š]G{–ƒ=÷z|gæç©‚ú\*ËF’”"šÝ‘Eâ\„c•õ´Æ€FÕ)‹q¨Œä»âlã8¹à:ÒŒ•¦ÊÌé(¦g:•,
+§dA5+êL ‚“è°í0nÌÌhš7…%pvˆÄR‡XÉ€p‘Ø¢âr‡>Jb@¸‘ ž&±ŽÝ]_´GΡ4õ ˜PW8aŒ8áÏ¥H¹]ÌØæg~…:$ˆíc n’×aÄyaÁj|p@ Ì«NEiTJJÓ§rV2… *F—z¹'_“ã=>¾@œ‚&2>˜™_øÞCc’LñÍQ_!à búÈ- ‡k"‚‚Ü£ü -ŵ
+º\àÙ`bCÇ!¼W**h¥j†¥¡‰•Üa‚ÉÑIU›¼v°NF.MLYõ»b$‹[J¯ÎMg朠}èBVadxEâNV­uHgsL
+ké9ôåv08‹ÔcÈYú4a;讄·dí¡‚¢àu×!†KÌ“Ï,3;ôi1}–ŸK§ªKªP2>’DkÅs,ä{rÐ ^n¼QÐÁ"O4?'&ÖXd©‰|CmáúC8”¥ &‚"ƒÁüPª'N@¦‰¨cëwãœêD •þ«{q°#
+CÂ5šú #%%˜íœØÓàeR;FÏ¢Ò×’Œß¨…K…ÛÃ#›{:ºÏýñ YR£|Ü€™üÈÜÚ¤$O¼#ø€qb1 8ƒÚ‘H£a ’”8X˜EHë¦G¤´‹¡¶1Y0é·È•s!&¥‚XL‘ÅüH4LÙ³8©T‘¥TQå,°d ʺ݀¸‹©:4Ó4àÙ*B«¶LH0ouW*g…œØ‰gFfI&0“ìp¦Xb
+§/Tts2ˆÈ´¨äJT(yUt‰-ë
+z(W8*ùdZáFXŸ\ˆÌk†ÐDæqbüPJÆÌñ%hã‘éšØÃ%å,k\SZêµ-–rˆ%³ÊÃ}3¢”GÚ0K2¢ ÅÂbb›TÃ\b½•*
+Tq~ÓŸ§ëò¨Øe>ÁP¥.J YLwg— ú´H2ÊGÔš*¿‰6@Éà9ìj*ô‘¯e]Zbå‰%©²b;4Ñ"@`°ÒO˜R±Ò¡9ù*áA·€@Шê†n)âNB2×5Pñ¯Š" a6ÌTá`8 Ò*IYÍ‹b)ƒ©)ŽCD3‘-±«,÷H—”'$“ÖU7‡ÄÜ+E¡}èäFõdaäLÉè@+•Ç‡Ñ“E®“PÍ2ÑåÄE³À" ¥€¨ŠJK¡* =<¡Qbß“;!_e¢W5‹2“³X.8PÃTIMušUNØ¥óö€'šÙüàë«Öç؆g±+°R¦’
+­l@@€È²êN¡žÆFáKÛ#•Wámi²p T­³ÆÌ}ÏriFܰϱJh[©ügl/Å'ƒŠ¶T£D];Ð7
+Œuúº+èLC1ï<^ü¯8{@@¤Ë2”Ò¸f
+6.OŸ—Ldf@Åh^Ò©$pìF;´4œyZ}IêÎú±aÏÊ<cݧ]ÒðïÖhW*±Ówvœ¦º¥ª¼á\Ó2Ì] ÒØÐÊsŠ#žÉ’:ÖkÅÚ¥Ž™íÚU»Ì#©×Ok^b¯E}Q±~X¬ð³S»¤NýË5ÚÕCð›©&€ÐÁv<Aô f®¥füPÿ‘¢à3Æ`dÈ,ö—$€­l¼n—Àá–Î<­¾¤Nug}M´~–¯Joôi—´ý»U횣ÒÃæÇ©ÑÇv†”¥ÊÐòYñÈø*µEœL*}TèMô’ÚöþÄ'Ñm™Î2,JÊangÚþõ¸óHÚr$)W̘ͬT¡ ¾žy×òÄK¥7Å‚
+ÎWÏÖ³0ÆÎÎäOšÕår:'[¬§ÓŒ~Yæ/óšÒ¿ fg§Í!£$¸}&Ó°J:šu«",»€h½;A™&vf2 ÏîÌr“")ê3,¥9…×ð]* 9&"d©jhp6ðŒÏ iÇšà)úg-X<Ú+#`Í9LÍ2 šO¶m"åW`ZÅ–B0›ÐÒ1$êÁ7l
+P(HG\’;±±¢‰D-Ïü TL~¥:ÆpÞB¦ZÇ‹yüfЭ87ðê"$œßü@ÿêM_ZÕ 5®Tç‚¡Xaâmä'ʶÊä5ÇV"¡ÙLb¹gìÁ?N·Š¿Ú,¤Lbýç¦\²šßnµKId¹5– ”J½3zŠÈ1 ÞÑÛZ.N!ƒëßÌÑ€ï>7Ä?kËïVH|Ø¡Ì’Xú…:÷`0XD¦Â(V@'dÂJ-^2OFJÎ N%Ûͪ½m%e¨²üí@µ ¼± dW‰ì (›’…‰/=…—)3¡@¢\/Ã(Ãò·¢f@-Žó¯–šaÜÚ`îbÅ5“&~ú7
+J¯ñ´È›)u¯•Ö|»F»z ö´…±RÇ)+Ür³×üRÏK#ÇôD‹TW´·Ì8ªZ…‚X«ŸÔ¼âsêke½)+3«0qïû³+Ü“þ­|«úÍý“ƇQÙ(e³ UwHYåäCëÖÏ
+G>@U èøµ­ƒ":Y©¨.Ì5f+ĨȇæGe=nôWbSSˆñ’y¸±äïŠJ6-]P*2ãU¬\…eU@õ#æW~B· ™Óå0š …@A cÛsÆ ‡²4—ò}I"1‹Þ<ÀµŠíEþa`sA•’œh6K°(w‰:`"z‡€Þ\Ï Û$Š Ò^‰‘ ²‡v)I KÙÄ7…='9 ÊTCl:äµ· ŠÚ±ááÄÆCƒ:¢à±CšfÄC°ôG‡Ð9á,ó8X%uZyh#_pTžÈ¾3r4þĈÐÊTÚì@)Y,Ü V$ J€Þ¶Ü²èÉ6’Û
+£Bvód*j‡‹*0¢„®@‡ Bå¤ (÷®°÷åÓá€Á¡%ei0MpÓE6ݬI íé±½'åKéa!ðå
+1Ú!¨±ù…¥é@ܽ1‹ÒÍ¥Aè8|y`ÁQÇVøÁ8(Ì¿À¶”±™·@S/²Ï”ù–˜'9dŠ†S2e¸”0ÖNGüJ–0¬Ì¼ NAˬ1œ5œ)è¬Ò£‡öÆ“˜—¤ŽF…†²zWtuì CÑïèeœ 6K!c>ß ÝYû;«0Î]1št§ÓîBAµ
+ðQdø MâRUΔ™U™TNU_ÁÃ%4K@;¦`@
+ 2ŽCƒß ¿¸åZÚµÈæ-@[m;à'îŠÓ
+Š¬V’y¦A©ñ
+à7Yñâu«CоƒÓIìn¦ÌÄÊ¢ZÄíÁøpL8+¦ëĹâ½(Z§»\=âA
+<êœ#e-Ê〰½Ô³Cˆ¹DyÆJªì–+PÒX©, Ÿ§Luä0¡tà]WÚ“CK«Å‚`Ýc¦°EIö
+E阱JôÕ1”Ó$þÍIÙ­,¼'™¶# *2¡!™–š ²sJ&CŒDÚ…Yü‰á×Ê™rò`†Ê8̘¥ÅÚf)Å¡‘à¡Jn‰T½æk”¸B|­:l^€q³Š¹™„ #
+Í/zT
+ ’NÈu— Yͼώðß"â~"%?W¡Ç §Sàóab£ÙnLBµo•ÛD”È
+µFÐ4¹5X¼NŽHX¾º´Ì85àc"¦µÎÛ;í˜\_4™¥´FVhAv§Èê–hчÖg
+–Êìõ Œ³çVœXœ9´bMâÐÁˆ*Á¨ÎCÌߤfa–l!(œqšXá›%‡ *°~®ˆfÊÉ}Ú;Ê›&p áRŠ
+Ì–/áà9«… dlŒÈªV ÑO«CtÚD<ŠR_aÇÒJbÌ$Êÿbá6²i+77qB©uÒW’
+‰X¸%‰¥A3k]¹½‰ŽŸ Cá¼eFQK!ç–š‡2_ˆn
+Õ¶«Ê9„ñ§
+"›–J{–›¥ÆUË”œ>ø*w×’OwÂ
+èÑ.PLUD¤ ŒDf¡ÏÆšÙ8³ìçÈÜ0NBäª
+•00>,~šu8™°7#¹µg…xltËŠ
+bc‚ÆEñ…‘ƒ˜Š¤ š<¶ ¼êaîñ$ á…w%+Ëa
+ëŠBbÎ’e,ZOsã …×L˜Z%q’HŽÊ“0úÊ#1–Rœ6TÖ¡¦áÂn•ŠÜò”¹ÁuéDˆN74ô¾&kסÔÅBŽ¶œÎC•Þ¤ÁNE€È²ôˆÀ. ©N” HW‘ _%# 8B,‹¥s«
+€È-YXfàH%ú¦ò“Ÿ‰ž†ÐÔˆ]ê9¥9é¢
+Û¹1!q"‡ _&˜§…ÈÄ Ò¢P‡ìˆR%rr…QâOþ^¨c•B‘ì ™XĤ´Š¶ÈÐ&¤¥½½f³æYÁ󀥌ñB«Í£ÐγƂ# ŒŒm@‹3‡ ­V ‚I”
+OÔ•ïe%n ×‡ÜO-eVÚ=l ‰’(u(7*êô
+± •ò½´Š5§*íÇ
+¤>Ìjð…ü$ÌÝ•˜ʶC~,r
+³"UŒìRp%$¬Ž,X
+DdNDªNw ô°P˜•ð±Å–KÚÔ,W¡ 6!'5À4ŠPS“µ‘UÀÆ#ðbLû6‹<‘–.£ð@ Y žPúK"BÎÒq¨?´oùn¡äá“a‡†…ÂÃÀþAÝ7tµ”ð8¨ÚÄY0Œ?âÀ¶(hÇsŽeQTÚº…Ä$â1‰ËCÌ’ñ:z3r(¡
+ÌYtÎÄ’J"Õ/d™Oø??‡ñ6‡M‘V#žñÃU½Nèú •dŒ!§ÎHg±³S®SÒDG‘§à8Ü¡4‘÷Šs6
+AŠ€o@½(³…B&Yg¡‘TÒåÛǤ?VXij+õ¨)•“$0µ#—Xˆ3iZ“j‘‹JO&âˆ_¹ðF@i Þiê!†
+Q^tôŒå`•EN³Ä(Ç•þ”{Žj+…ò¬ÚŠBn©ì¤ ,§“f`Æ´aÖõ…šGx‚WŠ84)Ö±R+—Þ€4HF‚’OŸ‰vUåCd¤;Ê”
+Ä¿ÅÀA( …0Q“(……ìHÌÉTgg
+øS€{¥Vè87鈼çVxkÙlèªo¸qšÇ21ªAˆ’гïÂÍ dØ*.gÂ
+ °XÜED!LK­pïvâSr&.Ëè†S(ñ
+±g7QŠ­‘Ì”ËJ…º%8@UKÀ1®´Ð«rD%
+倴 ±Zz¦"Ò•È`²Ä:•o(ËÌjØ^ȃ ìäa(ƒTMvÞd)¦ §ê…U®šUE1U"÷¸î(Td¥/ìS¦7Ôn¹<Z"QâÄU—!-2/âš
+!åÔÞêµdÉ¥W€¡Yò’2J#/BòLe‚
+ùH¦|iz<:T/sæÌ`­Ðëz€h6$¥ÖV(¿É2Whêr@ìÀ Êó/7~ZødŨšKë¯\ Yéi­ir©¼ÏŒ9•cè“®Í>TдôD„¹t>{ ;Áh€ÃÂœqdF/ kÂZׯS‰O8÷úæ
+&ðÚZœ3D¤šT$¥Ø(d
+AöPœJ¯@)6•.³æ;;àON”¤–00Vä†ZˆÚ¨šp
+#ZŠîàæbÌ)iÃæ>¢šsìô.gƉd!1E¸zy@¹’Vb((eI0A…ÄâÎ=§j)"ƒJpΙ9æïìèt‰ubèÚ+RèÀ§Å‰Ì¼Í¤)WGöJHo¨A3Ñq¥z/ >¥Vm=qI,{¨)ßá´ –äo™@~¾&J¼±î¿È„oA3¡tƒ"Œ5&³@ ²VXìS„ÚH³A$`µR±a)Ë `áÌô£^ø<RÄs—ÎBÚ gGysNå‘—À=þ›Ó/R¦‘û¡:‡f²æ —ÑQ0`:®AOzpøPi±•ªÅ­"îEäylNÔ]¿g…  Ä¤ÂGe’4…T—w‰‹7+`>
+ÇŒZ›à…!l4õ
+sDvXÿçÄ&kРbÀÊ
+}ÈZp
+
+éz'“o‡J@’ò
+]›(§ƒ_†)@!þI>N³Zì`.èËó›îd-~wÙ™P„泃“_˜IÏ BŽI@$‰° YrQ ˆf£™­òÑ9Oþ‡£Ky
+( d˜ÛªEà¤`EYl5¨°S3†ÇC` ÝAI ŒÖ^,õ6F 0Ýu“m»J*84¾³
+”é¡V€TŒ2/ë0>´R‘ÑÅѵ ,&Ù1¥NWļtиý6©åÎÁ
+„
+3 Q(Wi¡ã/Ê|}Êå2§UIb1ÙÐrpàvˆ›á "öÌчdíMbìI'B– Š~^'î”Ø€rbø`IFW¨Èœ.ÄÎiò Ëƒ)!dÈw.l€BH²â2jö^%Д)=¨<¤£²ÂgbhµPe Kf™óœZf£À5àwé TÊ=@X-ø<AþDX×Ò
+TõWG“H ’Ó~`ˆƒÞʼnhç
+sÃË›S%ãÚ#qR:«‘ùp²8vR$·À,R‡ ~R—.ÑöSe…»Š4¤vH6Ê­jçrÅrË}õ³Ê~í°¢w´4u€ò[ñ|œ=Ô‰…Ž86´ ¤-…vÂÁÅ99ä#fÕ‡wÀÁ©YQÝ›^âdéU•XV2ùAX.ǘº”‰‹Ðh˜ÊÚH}–¦Êb$²5ó*JTŸUÌ ©J‹ F ÎH*êƒ t
+Sj€!AŽŒel¢ôÉ ø
+8’¡IˆˆaApÞÁ@Bœé10yS;ê½ÙxÑBæhAs‘Ê+Ì€þ0öBJg­ÃD1¢”¿ž›IÖ¬“„‹æ74Çç1åçÇRX‰ cÔ?
+#߆‡ÁË@¦¹Ñl`DÊÿ€¹«$ª0Úd‚˜Êúø!§>ª, `m3£*뤑“zP¥Ç}·Š¨Òhá;;¤xr-Sƒ´‚ØVfa´N~=0øbǵODÉS©šÔ™³~®„7$F=ý(˜V*8Vø›'u¶‰Wz`ÀŠ//²¼ò¥†*w g’Àp8ÚোávzZ¬ÔÄÈa‰cHFcè%
+twF€ /B‹gšÿ2R(i€,cz‰ôç TcË*oùð •_{J,*L]UŠd‚PQ±á
+žI6Ä®„Þƒ¸%ü&•¶ÀOb\˜»˜~ûDdC¾ÔÆ|c
+û7
+}@‰¨ÎµÃd·ïEŸÍœ/„™aÛ”1Ó_a\ð³øt=‹hµdâƃY¿' gÑÔâyÃ$‡8ŠmðÔiÑ%ë)™ï„ c`äjÈQBAaŒJkpúFˆ€ŽUh<Y
+ú·DNT:Å਀:šúˆÈ±ŸêÞiFE<ù5Ÿ§òûçF9
+ËNTÒ!ÐfÙ5¸™ÁDÞXŽÂå·¸
+´ !ý¦
+ÀïȼZÄr‘ß›Êôħ¸u˜¥×”<å7°ÊT–ô—Gbv¼Wy©À+î8*°C¬NDÿ +
+Ä2f>! t´ææJaJ \-cäU¦q ™¨üî”ñ1fáг âTB‰4Ó™µ"ã½<*¾ÉCa™½A’B€”žÙÎ.ú’Ê\ÚLgGNçÈ@U5GÂ*x{!ÿJ G‹¤«¨ má
+`%Ãn©*ÙBfâÔƒ»//ƒ§ÉŸ™8DèÇ’–ÇLn*R_,šY: GÂb’`8Ñ
+!‰D³I§s
+1A¤IÄ3 ó:ò;°²oõD´aF^®ƒÄ˜ ÜÎIõ™Ç+2ï䀇‘U\$6v&gÑêé)Eã쳈[ÚB8a¦p
+Õf
+¨Ð2>)'è ¢ZÂI’CwáJŠXÖ4à‰D”“]‘œ‡š`g8¨F72ü~¬ydÞóUcaWÞLQcä¡4ÞedŠQ:6a,~ÀÑYxÂæy¤k¶¥¥¢ã `-*s²q'»CV«¬Ð"i¬˜¨ddäõÜÏ`O0Ê,î/bË0ÆVx©²C
+
+3ð€'Å1 õR‘4Yf¥{Î`›¡Ë<I*å ‰÷=;™è‚‚PÔÓøÒÜzö!€øzàLäÓIby9ý× L< 1Qø¹W=‡1F¦…ÏŽ ´¥AÓy‡y >5â1Ôé‘O
+9†RËwàW(V›VÌ^ÀI £358µ(z,¢O#Zcµ)Å?žôga²¦øçFÃ'î8œºqwW—‰ÔÚüaçÑ)~)ôË“þ™ûóñÑOÝÎtçÊÍãÑQ·uk|69i=lÛ/»ãÖãñqw|uýo-ý¸ßî÷{/ÇíÓ“^ÇZ>ú×ZQëtº×züsÛý}±éÕÖ®{D³}º¶ýLÓ˜Mùˆƒ~{º±½½¤)±êùOGgÃãÏæ#òÅÜç|<|ÒžžÌ´~ÒvzýÖnëÙIoè›òËÛÇQ=%Ë[ÝjóÃawìº6Óîx¸¤ñãñ°=è§í~ëÖßòÚÕÖžV‡[N3kãO^c+æЭ¥z­¸89€ÿÀÐbBtËðƒ×½çïê6®Ö»u6_«l•U§Á_Ø)×JÕ«“#üoã?z¿éì`Ó–†XòÿÿÚN«‹NCv¸‹LI}Ùð/è7Ÿ›ä¼•Ÿw’ÿÌ•¿lÛº÷ºÕÆ–åú¿Öú|ˆ}yl-ž@Vùÿ
+,3§ÔÂæET‹ yànešže Œø+æ¨Ô/îËNëw';×>Ž~òN=ºrs8¶œÒzµuí‘”³ý¯ÝtêÓÏ]ßâÚþhp
+ pÐë»)Å=náö†-5ÐÕ«|ókÖäý·¾èMzG}>pñ ‡ÓvçÕ9žp«=éuêÛ׬VÎæŠÇ@;`S´Ük÷NÝ 5Á®}׆Fz ûõYoÊ;#>²ÿx|8^ñ•šZ¦›»Ñôi·ƒåtì~toð´ëÖוÃÓvÇ}‹«z»Öi÷íÚ5=Φº%Üÿ &¸(€âÕ¸ÿ°æÃbü?”N|ív÷EëÃÖŽë®îâª^í–}ëÊ“ñèt4æúöÃýá´uåóÓIï¸{Û­{k^ÝõGãÞÿU"ýæñOg“)¶®ÎIŠÖµÏ‡½Îè¸ë=M·{“Ó~û7ý“p×-í§îU?hÍß»ö#_kî 7Î+öÁêaì»ç–@§?ê¼ú¥7áØ?lñ«µ>Üqh»Ï¼¸²öGÃã³Þt›E¹æ)X+çXÝ–’¾×ç“ÃÇÇÇœ8tQ¯›ÄNI˜YÁü⨞²bzÖŒñV¿;<þ“y;÷pêqÔ÷¯Èε;¿v;gxþÀ{WHÃô4|]¤a‘“Í>@Òb)”7:ã·'Dy#ßÈÄ72ñÊÄìL|]db„0èˆÄ
+é+ß<u¿RXºñ~‡/óÕdgþêΓNc,W¾<éM»‹XÜnfÖlå.u÷>ÿ´õ´{\5n^Þí#Ÿ¹ŸîŽ»ÝaõKÐøeÿ·¶ÿ!œùáVÿ¬[ußüáaû%
+­õÛ
+ý‚ªOŒó!ðüzÚh‡–Qª?í´Ü"´ŒÒz¸aãåêU9ûÍmÒ`i›XK<Nëï×O‹Óæ÷Ð6FQµKg—&‡ÍlŒ5šYt©mR-=t¡eÒl™Ø÷Ú³IdÛOMRßwZ/Sþ7kÌbZm¡,hÎaêfz 5Æ;dlŒ±'3¯›XãÆë&UÓjFíòæ”V¯ÏÌhì_¡h¼o\½B1ó¾¾wí‹æ<d©ßÒq³qnß«n˜×»,mìl®ö‚ÿ[ÏX^½A®¦·ŽøzÐvÛc't-în
+{-¹Ãž6QCLÉi"çxðâ«_3:÷kFÛ½ææ/Þ_ù²ýswâa?®Î<Bÿù¦ñ¼ïZ§ówð!OFýWíÖíÑô\Z¼Kè
+µ«>ÜûŽÎN¡p?y©óFë¤qÚp=s§MÃP°ó&_8p¿Škqúó2ŸÛK3çeìžæyÉ ¤GV 3n¸ù†z\¸ð´0˜{ZÃEëÆ#bþ( Òæó
+ßiØ”þW܇ÿmÒiC‹´É|¹sB ’«A
+Ý·ü÷ŸÛÕ+”Ö}óçéo§öëµ›c·ã4#3o0èNÛÇnâþø „¿ï~F´Ê­æÃîtò:¼ÄßþÿÉYø°nãÄCÿxÜ5àèùmÓhèNG'Φ݉š~¸d]ÿüÁ¤ [[ò?üa·ÒìãžÍ¯yåòpòCçl2 >\ѸñÎÑö3ø1,~þðÁÏÛ Ï­ÃÉë:8Œáým–ãï\(‘…¤Þ4OÃÑ°ûúM‘û%û±=vÛð°ilG½á±û=|ýÆ×Å_¹
+Î! ^çͲå$ÍŽ}òâ—¿íœô{ÿŠã9;Ý[ˆæ½–cš[ó_‘
+^³ýS½÷ïØ6Ráél~-•†s‡Ëíð¤÷bzgèZÿC•»ß¹~§ãöprÚv­;›Oî×í˜}ùÅ/;=D˜„+õ·Cg_~qpƒí‡vå­þßëgÖ±}6=íŸu6¯Û×k¾úâÀzÀ:ë·;[¸q^·5_}q`Ç=Ô%Þì¿ÝßÛ8©ööº­Ë…q,uŒ¯‹'žc´§]gmŸNÏ
+ÏÕQ0·ŽÖô±Õ‚BVȦ7 ¶»E/¸ü¯¿çÛ —¬÷ùµ[œó¾èwö·b)n¼/™ÿn+'~©ÄÙþÖºÕ;<^*pî;ý3g‡}õðÉÒg|>é΋ҹ—âëØŠª#Ó‹‹ôÞ³‡ª­g·‰1Ô4%‚5Íù
+Û§µ:mÑúÁ¨Ó^ªä.ÞrwôÀA^¶ö—.âÙ;
+%kÆ#rØíßkOÝûcÿô!i& åmEÛûˆùÜ¿ÝlÙü™©èuÑàlŽÎYÝÀkM–¾¨Æ/k9a­Ð¢
+×p]cŽd®õÊ%Pzéb+
+ý¤;=púßä)öQõÜѼBÚ™Óæxf5•¨uó¾ùš¯}!åVSEižûlûØŽñgKü™&‡«Nz¶âGÜ·#þióˆ_áºoøìù€5~úZ³t'ç'‡­ÇsJÁŒÇÝÚT
+žÉÞQ’ʸâÅk¯Á²ž^ §{§H¬š÷OÇ/FMGåŠfµTÈ–N7„å =~5°TÏÖÍǵ¯q‹ÖÓÑéÖmûÎX¨&`EãJÄ7ßz‹æãé¦ÖÕ[oÑvæ­—ŸK ¾µÇë7Ú(šž¶_ºSæÅhSÏãÆHÖšÖ
+ÖñM߸5÷©=[$q5½i}ÓޯÝþ“îøE×?xƒá½…Dó ‡N ¼\3oµhë÷ý-“uv,opÃj<w•ØÂœ.DæB>žt1¶5v?ZN^õNÝ 1|µÝh–}ÃOFG÷®Öø‚Í„ß¹xÚ. 0.~Žecë _õ'Ó=÷?!¤òi¯½|^ëöÁN·ÚX_v|Ì?}Ãô5>×|ÓÛ„so³©}<×~ýÜss“-•®Í·y1îþû¬®~]ÿøhîñËŒÂùÖ¹Ùô6ÑüÛlšœhnr6uœo¸ñÜp“-Z7†»isgmùUò\WMHoR;ò6Nw»?uª]´UëØZ[VÕ•'ãQ§;™h}ó\¯6§ÅTÒí>Pc“¥&^óÚ‹á·UÏy‰5ß½S'ioú†çø2ñì— ÷òMí»ÃIMÚ¸ég¾ä¦÷nLqõÑ=Vþfi·^͘‘»õßË—zUš­Ï€“sm‹dnÌFC°Y&5@}6,ÉpnInX¾çùj³»h/[êîlÞð{&t;Éáß<ÞN‚ͼùú&n,šõÇz´µg6ê¦/ÿŽ/m'Ï!/Â…ÞFºl·‚ÛA<›Õ—íwC43—{á-,Ùµßö´Ýf~¶›Íhv_nRAâ%*È6gõïûÃW-àF7TïM6Î7 º«Öï·â–lðROnüÀŒÈÛ£_†Æ],]yëÃÑpÔ9ÝúþO{Ã5V³¿(ë¼Ëh4²Ü¸}µÜò~7æ.]¼þ…UuàÆzs<ýe4~u«ádYÑc„-ǃ©¿æ6õ{~!-ÓRç¶1OõäžïeŸy×ͳٿ´æÙ½›Sl
+HÛ¼Ò¸—o­„Ï ‹g Ès5Ъ½xw±†nÙPÝÓOO×F|g¦¼‚áÚÝ['…2'tó`Ÿ{”û4™µS¸2-vÙ§íáq•Ž»å‘et…¿-–<o¡ßÕIK›'´©Ð­ÿ®\9³vËÁ4ÖÆñ˜>ÅH¾G])·^“’vps<ÝbGΨ0T›Øb4Ne¸_gŠ¬Hñ˜_ˆ_.))\ÖÞ­”ƺݨnž×dÑ®ëùà˦¿TMÛFunœwt”ì·O…mÐë®\Â5fÙ¦•õé.JÇÙ¯lÃj2‹[(Ã8ýr¯w\/·͆íŨÞaûçîCwÜöÜÄÞœ §}¸hâÖ„§³\I˜q(!ƒ×ÿ¶ÃÉj^Ù|ópÿþý"½ÝÅzÅSß»‘þ˜¿÷ñGׂkï=|ÿ½O¦1þ%}öA\ýðYõ7þðaüñ³é­Û/Ê»¯î½õôzûö‹àùê×è½ëO³“ Wã{×/ì^{çéÎ¥ ïÝxõÑ…«¾./¼Òs?ýøbïÂ{g^xÿáW·/ì£àÚõçWØ}zaÿêgÉ$š<t/wûUòñãoÄ·Š¸È¾Î_´ûãÁ(ÿ2Žë_ƒ{?t÷w.Ç7®Ý|ÿôÑ'ÿú´œÜ(î}ôåÞÁèëä‹;ão¿n}ðüÙÁõ›×;á»7ó¡õ¿ýÙ{û»ï>uý=ÈV WÚ‹”o»[hô`28yæ:yÿ~p-9Ô0ê7›Ó/¢ïG¯.Ç—Cöü¸~ìø»`ò‘{vqöÞ».sàü.·_í]›w“âßþäþy·ïî~~{¶ÓoÇß=üö³åÞÍ¿O?¸ÿýÞÒN¿ûуKsÝÖf½Oï^ZÞéG®Œ'á¥ñòNŸ„ß&£Þ­;ݹTw;yçý‡»+:MO®´ßy~gy§ÉÕoßû(z¹|¤¾Ov.½õùiÿÁ²±·>ý׊N³·ÞŽ¯^_ÑéóëNÝXÝÞ½ðÑåð“ž-íôî½èÙÊé¾¾ñìGvêÖâÑÙoú¥[ÉßžÝx€n¯.~Õ+ÏãoúáU×i2ZXJ‚[Öé“wÞ™ë4M?œÖÖ+YÝþ0þîdølE§ÿjgùÁÛáÒN¿ÿøǧ«:½·séíøʇß.ëG¾›¼uÒ}º¼ÓÏö¯Þø÷ÛƒË:}ïÃþ7êNÝw™]Jï~üõ¿/ï4yþ<8(ƒGK;½xð2ûé z¼¬ÓKÁÁw߬köÖ¥WÇû«:mwßÿñ‹åÞ n¾Ó½’?g§;—æ'xúÖû[§Ïw¯ÌMðÇ’ë6½w¾}u0Óé×òݾ;×éÎ¥ÉÅ{ÝQö´½¹nóÓùõûà›¯Û+:ÍÞÊ_|¿ªÓÛÁÃw¿+Ù)ÖØÜXïÿûƒý4~ôti§‡¾¯ìôÓîa,ë’?ùf78üáêÅec\üô^÷Ñ7__½²´Ó/Þ¾\ÙéáÉg?±ÓK‹cýænðŧ§-ïôA|éóƒ}t}y§§Ÿ\\Ö©“Éèö‹î^œ®˜ào_~üéíå>¼qç‡ï?û~÷øÕ}vŠóeq¬?=OVtúm|7éï.ïôÑO§ƒÇeÏuêza·?Üß®œàñ¥Ã÷.¬èôùçÁÞà“¥v/^ø×w»NŽ¹n?ø÷ü¦9û!ÿÁ:=Š¯Îmš«_?h¿ËN£wn\¹7;ÒÁï~p¾_wêzA·î±?ýÛ ýëãùN'£Ë×­ÓéÇïÍô·ío®ªÓ[ÏÃû³‚ðýñäó\/®Û½E©t—cuîODὋ™:ý8ütwN¾š<ÒI¿ýÁþ§ì½X·oÇí£!: æ:ovG~ý~ra®ÓIúÓvÒ|üÁg{sÓ{qÔýñÙŽéÝöÙìKÝûüò÷£Vþúü³pðŪ_O‚{?^:«]üNôÞ¾¼ân÷ .¿·ïßë§n>÷kV„?<³_'¯Š…]™ O.~µìw Å'÷?øvå¯EôîÓWÿzÒþþjÆ¿]þº³ò×ï ?ŽVÿzôøŇõ¯s3–½õøbçèÞŠ»‹{—ï}ôùD¿¾xçßåܽŸ¿×óÊé‹ðâ 3öùÑ'‡Ãe¿KÊÝ~ïÕxå¯_^:ºvaõ¯ßÞþຟ±%¿ÿxéûüí•¿þ4}rzo寯¾ˆn}Vÿº0cƒW7¾_u·{¥Ï>LWþúI”ÜøjõŒ]ê ¬ºûò…Ë÷¿}wå¯wn><ê®üõ“èã‹áê»y!zûê+~Mïw®¿ëÇüÁ•ç~}ïÙg“í×ý½æwå½g?Þ}÷fý{2IÞ:kíÇï|³oòçÇK}üzjæèÁ©DÏ­Ñä‘þ6#Ç¢éÛ°0÷/ì~R>wæOÏðÇ®\xÿöÓ}üñ%í·Êz“Œ°þÚOoyÉ7¾½sýÉ®ÉsgçÌèc7ÞŠßq7~2àÞ€¥ÓØ×ÃwœûÕ™­/»þ^|Tõ÷ÖµÞõ£«N:]¼3>ûqowFÜŽ/î\ª»¥¥³¢Óì-Ø9ß,ï4yþõÊNÝ!òS8§5ÇJKge§8ò:«:=nvš:¹ÑmñèÖa£Óã˗ߪ;¥ö_uÏM/´ÿj¤wû3^}NëµÙíÌ_VvJíE§ÎtÚÿ÷u§n,3cýne§n‚'ÉêN¡ý¯ìtçôÿ“åcýèÂÞºN¼³²Sêu§Øû3ÝB§x6óU»¥ïž³quÿëãÁ6í¾? ›{EËì­ç«ÇÛ¥'¶îLZÜrcþö¦IË…­ûã•fçiÃAsãàllÂåòá¿ævüµÞ[¼_ÿqãôÊñ33Ö!“dïß8½úÑiõÄ+|ÄòÞÛ?ñ-n”w¿¹íWûzŽkÑdÝ߸sÉþxÿáÈ: 
+ì;¨tK÷>np×OÕhÎûäÄÞ­k'ÝÛ—ª?ž65fó™=®ßF/w›Ãýñ“ͧä^ùó'îÂe(´gïúÙ‘Þnâ¸1‚'—g'°ò¸¹>I/]âX_ÎZIË^êUy¯ôÃÙ;né>|?zçã áG›srÊ´üîìÖ§›&Øˢ_2¾w.¬ßÎ¥z„ücåôßïðâæï÷V5¾wm-!”×Ï×LÖößoÄõ)ËbËÉZó°ðÝ[?¬|ÔÎ6ËÝOÖ‡»çZYõºš9‘µ²î~ûïóÏüÒywÊÍ׶’ÿðÌG·¾.?Y?ï;«'kVô\]=ßß™=ñJѳ³iéÞùöþ¸9Õ+ÏLàe‰žås÷ýè06Á+Þçý;ïë›»p¸|îžï^X)¶WíJúã–íùÅó­yŠqpñÇ_<{¸iªï~zÙ¢ K_äö{s£jžbQuŸì]¶¯¿ Fï¸^¾k@Ë$Œ[;Îœûª1·Õ6l®ó¯^v/÷ÕíŸéýÓ°ýö;÷øòóÿΉ VŸÒ'£÷®û•ÓXÉtê,X¸íÖ=ŠóÞˆò¼»¸ïÚÛî»õ»Î•í‹_ýÿò¾s»qY÷ ôrP[²,‰98[Ñ9Çv·³¶Ýí([¾3óç<û­H (rÖùqÖ^ÓcQT!*¡>w-§ä¹yÿ¹¬R‡#l’±ÜÙŠ[N˜1zAñXÐ =Ê0>_
+ŽòÆÞß%ª_d,Ã^lÏ–{w_¬A®JýáIcÄ
+]’ÀãÛ©Ž.ÉC/É
+=ÏÖW¡ÄTL6cð2X3—C¦Z*”Ò¬oçd=½õ·÷za93Y;ïâåti¸²ÉÔ•{‡nDL:èÛ ó–®P[Aðò¹†E’ÍZÁ·×°H±~½ý×€”ÃɈ½ ô v¥±°BIÛ/ï„×%vÁwbÒ ’¶ê2ÏØõgŽ3–h)ûõŽÃܘŸ#ŽëpùkLë8tþýYsYm¬‚VšçO rŒ2°ãwåpe2·]Ù<L§s”óØ‘•\Ç#“í`nÐO?;“?D߶ŒÎÎò—¯–Ãñ†ázD(Äî—äeZþâ»x‘Ž¸œ<Ú•) Ô‘ˆm9Þœ$l{ª#Ž\e¨¨Çu ]_¦ðÉCÉp’‘ŸÛ£üþº«Smøky¾“¢FP,Á Ž +>dƒovJi:55¦
+ñœCˆ“)¹Š4|„LéÕï¨) |À&º2YÀ˜ÆYÞŠšÒiæαÇHJüþˆÆÔ•s&”/–JnE,áñöËüA…?´d>ß
+”Ÿ¯_ƈFlEõk@…‡ÓwÂJo°rRÒ k.61× AúBDÕ±lY˜ˆ¢KÒC´-댅RuxX5Cçoà¨à™30wÅÉ-èO=]Ì{tÌçGqÚ.|**| ÄXñÖ¸h«ãY°â­H,Åæ‹÷—`ÓJ™)ȪñU^A˜NØ‘L×÷LÜ¡“u:T|o2 âÉä4tÒë=ßß!:!L§DÃçƒ3ĺ˜+‡-ÎISÍå„¡E’O ¥äm( n˜RO}ÆÇ0"0—sVh*)ós~ÒbQ‰öõ\‘h_ÏÑ<‰!iÁĬ²J´“@¢yÞk >J,Y¢OØøÍß•½Ó÷$¬ZœDK½÷Nz‰6»pèd—hH%ûÙ+¡Ã9 šk–ýSœF¡g „”Ðé;σ¦ãmmî0œo >ÏHlŸe=€õôË?3¶´ÌZ°Ï÷†q›Ù‰À§³@ìt"•-”˜bvÌì‡ðf>%¾tÈÇ@U‹$5±$L21ÓžI…Äa€NöB…áPGNÞ“é„ÝÃË1§ „X±jGÂøªh]„µ!<­e±ï)&½<üÊìñŸ‰F³¨ØSž¥²ïù1X$–ݾÿ5ˆÓ…iµ®ZúÖ¨C:Yì{ŠŠ¯ Ç×b„NŒ}GÅ÷^tDµ!_ ókY†táuôœ˜´OsIGBù›‡åêÊPòT†Á´®?9KBOåœÀéÛùy–Xu$ÎIJînª_1{›ŸkÍ™1!s×[Il…åÁZÖ…ö9çô´óyÚàD®Òé"]brÉíIÜ^QÅÔª×FÔR«Þò+“Ò<`¦ç±3×þ>ôL›JÍu÷•_¶-cžÝøÑÑ„z ¦N/lmç!3Ó™ŒD\ÉëºP Ö!ÆØìÜä[‡#
+^ü^¨S‚1²¹\ìlÝ@Ÿ-ë;o±ž…»-÷õ8Q{;¸ž˜;½êLÔÖÔ+ÄÍuâtÎÍ-Ù1t´EÐECccèø:"“sÀÐ1%:&Z0%†Ž £Ñ‚Y0t|]ÈêË€¡ã#èBhÁ :>‚ŽƒL…¡ã#èZ0 ÿ=[C7²qC:߳Ȉ¡ã#èˆ=–Œ¡ %$sfû3Ý8k›ÏFE’]ºém''nϊ᥺yìdØvÔú ˆFz/ÛamŸné¨3¾v4acìyZ˜ ±k+êëø²¬ÿ·šD Ÿññˆñó°ÄÆGb}IÈ9áñE"W£ûE|Òé»Ä@>&D®x]ŠƒÌáXRæ„dM'’
+äö¤P S¥‚8ùc±É éÃƬ 1¹,s¼ê¢6ÅZAì΄L$œ kž5bì€ÝXÇ6a/) ìÆöOù”´ìp“AB®i’Ò‰ BHa1bá,yôÄæN$!ÅdÖm7•ÓKv%Ëí½SÙ)”© ¦û¶#ˆ:Löía²âβ}{l4t–8|¶>"aøíIlÒì'V=¦ÙÅDQ–R–hv ãø¾“ràSàøî’ð/S¡ šÆÁðMéÑø™¥§)V§Vã šìõKÌÎ"xè…#˜±ë'Šã³>“01<fg§#±Ü¢ŸÁÉ ™’†X2Ç‹ÏX8ÀšqÆa¢âƒ $ÚX3ü*Íó‹Z8Ñi=’Xƒä³eGb¾£n–¿Õãã–|¼\„ƒÀódX#ǸQ®dü熻»×œ=ßãKpö×…=hŽâ$’®FuöoՃʵB×R²~ñLšøm·ä C’FTÉa{F®
+W‚Í)#2¡.…ðÈÐ)%MøƒÓ¥ðfNÖbœyÒD»ÄÏNOÅñº½»£‰ÿ:¤<"2›$"“1K ,áiˆŒ{Æ—
+ŒevÞ¸ˆ±¬®œT§˜IüØÊ'“×eþ`&Ÿ  m¾œÓ+C3Ö/ cG—RÀÇFRbÑ‚I¸ºÔI³£ªW'˜¯ÇÅÕQÐQR89ºÅ½¤ŠÚ½”mÉMÕÛ½‹Ÿ *:óÎJLʇ­ä‘SÇÇÃ¥¿l<\\ôþkÞx¸ 8‹x8^†j~x8ŒZgÜx¸˜A™ ®ññp¡l(ï73yãá¢÷Ž:ˆ¸¼ñp‰·䂇 X ¤ZŽ‡‡‹úb¬cD²eGÖ£‚Ë-'H…s"Y¶¥HNäé»PNdÒÞÿzV³š-’ ‘NèÌ%­¾  “Šc:9 ¹F289ðÉ Áuì€Øh¾3Uˆ‘ñ<3˜Éxž$,Dd2£=ç§Y¶a
+Y·!ã^+'ǘÛðâCtr¬qœïtþb,£ås0¡“nû0ðÈ@' d»!¦Åé°¯fܦÅJ³½8ñ6´pT:r[cen4†…à3þÅN‰µH•'ÇM¡Æ̺Xx,Dêíäµ
+.&ªð_€ÂÅÇÇý³ žaH‹úþdð鉙«*r#|ØkÕÜ"ÑD/$¥ EÈHŒ}³]Jfä’á´‡ ýBð‡w;/ˆò8•´’ nŽâê~1¯Ã‰*/:£‚ý‹UãæâÚs×€”¸\Þ{꽜Þ^·§¾;]{zõª{¼¼ßYm g@òwWÌ R6¼ý³ó¹º¶no¶šõûV«ÙØÂ"Gž:*½„»ìFœÂX¬8ÔzI.Fé’;³æ÷iö
+ƒÝî÷vèà3Õ¨þ4[Zœxg!ì´‹sØí¡ÁlTê7y»ÒÞŸ[V£7œF{5›j4ŠÅš¯~QQ¸(ØM;Úö+F `“eØM®G ×ã[xe!쌩©ñý‹v»ä¡Î^ù»÷ãcf£?¶ûO¬Fûüz|çìF;»—=æôN¿© ׬FÂ;²ª°aÝQ“¿\>Ÿ|o!î='ªzSûµ-DQ«ì;﹪sÛˆ1Dw=/i¹ûýU¨¼Ø±@ÊmØ‚­¾9c íÿxÏÚ“œ¡š°ëX ºD‹q:•”œš”çáx¯yV’‹+;s§Š@t‰WI.Uî²-œ"™€†$wB¦ÈëK*"ÇÍë秄"rÌñÅÕ}K*6":¾äZ“žTg$r—Z†úqâû¥×g"b¦»Š ãGzÇAÓ‡I‹¦‹ó¼Zœù¡éï‡Éˆ¦‹‹ F÷Kv4]–n\ä#M‹Ï´Ï‚¦ M‹»gcïË„¦‹#•pCÈhº15rJ4]Ü9¯+sCÓÅaéh?4]–N0·'š..ÖîU`ÏM·º$Ò›+š.θ¡sGóAÓÅaé·Íg@ÓvéiŠm)‹¦‹3N ¥¼Ñtqë“ •M%•XSx,4˶ÌM'>cYÐtRÑ3ñœÐtcÍXj4c•š.[7š.Ž
+eB"&3Ñ°d@zfu*Ò%QQ P].|05V—pÆ S©Ê.óºŸHÁ”0œyâ”]fˆLÔbahEÞüŠxDê´ý‘PØœ™ó«eñ
+Ýe.sGÝs%h’SæŽY]nK«$X掅äÒ %Hðó“ƒBwÙÖªwñ!Re†¥*s—QĉÉ\æεaø…î2—¹s°o …îÄ>¶r¸çJ]9‘ù‹(Ž³ØÊ-Eéc+0¹ÇÆòÀЖ*¢üÉ<åÁu‰¹‡Iü‰0:tž¹x! HFs!aÈNâÆB+œ´ÃId8;ÌÐ_˜“Å*lAËS3Q<^šÊsÜÝP¬óžÞþë˜À®P60UB>¸p6JÌΆbbÝüÄf"ûrA>f?
+ÁŠ‚œëÀÝÕ¤#TÛ5Ž
+•Ùu”Ç$TFì±Hád,;!&¬eÕ€ˆkÞFµGoùÝ
+ˆÄr)dLx z+"ÌhÝÅœÊ㸩L¬÷ÊË¡ž=ÒE$Þh5×gåP÷¿žsA¦ø7§·$FImçUÁ¾Øg ïý“T…ªY§oXx-³9áPáeu¦ “Ã-¬Õª*Þ&Œ»á0]®ê‰
+ˆ¹‘m8_NX¸–W÷MÆ$bšYºŠz¢”1…™; Hùë„1Í—…ê\·Ýß•óe‘])bšYz‹ßãú•ç©@L¬ "¬ÈÑ´é ÃsÛáVþˆasYâù…S"Œk«Î¾U ý—´éR•{$SɶÇ.ò»šê‚œ¾å„q½`^M•Þ†¹ûJUî1¡R^cLŒ+µ?ý4 Ôs2ƺ$Œzæa\Ý.Ķßžgú!âm}é¸ý,·šÍ³öTó¨Pj¯TŽ—ÞoªüÕÛ'è¾îù¯îƒ2³<Ùv íR±c÷¯owån4„‡+”¾¦N/öéPU¸Û|ëò‚‡«°AxŸß7órX&G`xÒ, ûgLM›‡•ß,Þ/f£0–Éî‡Ê«Ô›úyÂltfã®þȪÃV õ‘\Áïë
+Õhšö5cþꪔc¥¼rù×h¡„­9‚áÝF±ôôn-î35¦JÚnû&ˆÁFqלF{Ó»ÑÞÁÔϸFIÝ7k=­Œ6zÈ«#¸uÊn´Ó9é†2» Ùiü~ÎÿËa~Ï.5«ÏxOmIÌ÷h|¥t3;¿&@±:ÿ>ìjÆ|¡ENÿ°Æö„•g‹'ö`Ú$Lª^!§A¡*fɉ“ºh/EM‰6$i4µŠÙ%ädv§Z"Цd`ÓW^•YH@7¡2‹h$©ÍO­b.ÝHehà(M
+u¹y2*-!CÓ™¥‚?E½ÒŽÏZ#î.u•EF—F²´¢ûExÒSeiJ¼N±ãÄéºÒ’§åög$76"®:¿–gÇ×Ñš)ã¹@{Càêë„ìU'¯Ë/jb7
+ ‘¸áeÑSž«N–›hLâÈ•qcÝâ¬SÝk}Õ3²¾EQ€Y/¡»+Ž‰KòZFïŠã8@ññ±pÒHÌëm7U½¶„éææ#ßv£fÜSopÇÚÇäÄ*¹|]¨gÑ8rÈŽÔãcFU´ÁHÁ³õ™ÞaÔ~šY:g¦’Ô³ÈP–dJ…±²SÝs@u)‚yèñbljÖx¨KTª¾{ZMíÚ”PÀçi('}Ï
+˜TÒ8aý‚“÷‡^2PG˜"uc«Ì¤ –TEg&Š®å‹h•l3–ˆådøä2ãŒ%ÖÓI5cÛÚ/±¸pœuèÎؘ(@Q  ð=$,€˜“.€Å
+4Ä[©¡X‹›‡e£Ôú.”Ú?»ýsR@³õ»wxnì¶&WÃÅÍÕÆ×ÃBמzÞªW0mo˽—Óó_këÆÄÐ9xdò™e¹úl"”ñâjua{â“Œjíõ9ymëììºÚ9=_Ç¿`Àû/uíÎ9ný²~ñI<'©1,c6ÂõÐ‘Ä ½>ãý%—IìfÄ|ƒæ,Aý‚ÀÙø€KsDÂLÍ€»ü„­º÷Ãn£ÛQv, ».UÛs¥ïny}cCž›yºö:ºU¡¿°‡·þUú‹íê}¡äU£¿º2ûþ ú‹Ö£ÿ…L}Ñk]°;K?;)ß‘—ÉêïÎÑ_=jÝ:©o(¯O¯J¨¦åõZWÅ/dDïÏòúÊ!~< iß=VqfæœWî§Íyÿ\ D!²WS¾¯-ÉøRqK¯òýÊNÛKöþà„EPëâÎv±ÅD-M+•š†Öÿ15-JeeuÁie¼›/õÇÙµýû¶Û[GKúpÌVØqó:›Je½»!
+<–ìÁö’O¶©÷§û½ß?­Çµ£ïé?ŸûY—c9àdå÷÷ÕjëÏmC–WªÇhÇ5 íóÞ[º³™J¥}ÐB]xÖð6À™ÆÔo¬Òv&û§<úÑ ïø—êÿ¥9$: ¯|üéR¼¾',ð³áýö§äÿEñ&Èþ xì§JÕ~žîÜ?l©ñüW÷ÆòÓ-´)U¦-Iy9*uæì
+lqétšÚܔݳUg@Þ?ÔDnänYÿ]UTö$|ÿ\œ•ñ/ÙÿK¡ßÛyÔð™Óðź7§­vÕªt»S‹¶\¥Þ¢ qY´¾XL= Zxøc¢²¸«JµÆÌ)jäöÄtÛZtuóòó
+~±917øØÃ/àãšú01·s¾>1;˜ú¤47®ȱÆÜ>eo…vÞ\aµ×Ÿ-¸ûiféhÖ•‘°Ù1Ñ«†ì,êÊYç¶{]¹$÷ãÆ^/“=‹öÆÂÖg¦0r¥´k—U"#}AXsoŸ#‚í¬sÉ*îA&ÈÍx_SßÐn;pƒ^ÄBj,keÌC¯Kåò<Ùè¿,Ï“a”åÎÕü¢»U–WçÈ3äá
+°¡<×*UñÄJ€â‰ìtÞ)W\}søª\Ñï"ˆ£W(Å­VÜ<ɵé Ùmª·Þ šÂyPï]^ñºô×YS²úô…1.Þ^ôÇ¿}“žÔmm‰þxµºBhæɤ?JoOFWcþxe.Ñ—–é.oOÚôÇ“ò<ýñªN‘] ®Ä"ýýÇ<Mœ
+š6xt¿×íUúãÊáõñîªd‡¤%8tWî>dzTàƒÐçƒîȽÑZ&
+…ø~JóBÞ «h':Êö;óñ:ÉÙ+ÇïÌÇëDD*ÏïÌÇëÄÕçùùx°ú\¿3¯³àwæãuRÑÑX¿3¯“ò‘cýÎ|¼ÎB‰ïwæãuÞk¼ß™×Xãñ~g>^g¡Ä÷;Y^'ÞDÑoVÝÝÔŒ7#›¯®x
+³F¬«Æˆ°š#½ÈžÖð»nÝÖ¿Õiûù¥ù2ùÖE}ýä‹ž
+íÖmOÖ‘“‰OÛ[­"ì0=Lú*x´½n g¢â:—½m߹ܕ\Iel´½è=pÉÿ,LÓÖ‹–f›ÅÆá÷KÿsïóÏ㟷â\a¡ÐXÛå“·‡÷îg¿Üÿ÷°ý~ÿýÚ狵£ÖƆ¥·û÷ïý"9‚ÖoLßæžs½U÷t>ˆ»;" ýÝ{^Ÿ:\ºmÿ#],S‡òÄû«¨ëKp
+NÔðqÙÙjŽð<Y'¿|JR¹Þp¶Øxe÷¯¿}Ô›ë7®23@&_¯ºçË8ëž Å]æ’€m5ôvá†ðº´~;´½xˆY ¾ G°¼T¥¾¸n-y_´`C_)ÍŸ'+ÞW zG-<®y_Db(èO÷–fƒgt˽Ö¼¿¢ÛîmÔQBÍ‚Ñó«êlµß_¿I …|$1©±¿о&9€ð¬K ¦Ù@@¢TrŒßm „×,íþ^EÛ40˜†'„쬳8ýKµ±sôŒzç¸Jr
+üu)»ªéîJY¶7X«»[<êtÿ~Ð wiŸ ÅÉ€ç ÷×Ï—’÷×UÀmwÊÌÊö²Û›ç•úâjB½†±`°G¹Ù”<SàÕ 2KmZªµÐ¿ªüÓz2º{ÍkÊ¢ä¡Ñ™¹lyÊÌûÇIÇ÷ÒFÀÂ?¯SûåÞe–á•$÷äÕ2üu+{=(Á{®þÕFz£O»³•åó´6¹Ó½Ù)Ù~ZP€}ˆ;&öbdàÒT;Uç Û;Ñ£ãk+æÌüwEëœ5§«ál»jëÚ"9+”V_+ðÕÎfûûv¾ZZéÚÓ‡­ß›Së˃é×íè¹\#$Î!ª¹!q&I;ÍÕ‰3AÐ0É׉3AÈu_ÙŒdÎqR϶õhÆ^T˜yLEôyué¨óÀ‰æ.n9N8¸u|§Ñ òtj`|ïx$nJQßwû:nýSÙ‰[/]¼úqë– R6HäúbŸ&¡¿w£$ÔˀđÙt³®`FÈÌ:R®{=£T^›&ª”Ññ½z”Ð,©¸Oo³î³çÉ*(°;Ýçî‡ÐÌ£u!ãc„ É!ÀhXö*Hd ñQìè$ †ãµåj8˜ c‰'×ß½°ìÅÏ ,¾YÁ+ÞÞ¢xοsÉáä¹jL&1ǘ›¯½«G²ï:ÅY‚÷æzü…˜ ¢ÿ$BïøMxÁû…û½6 r‘g†>ëñzUf/ú@/,ƒ
+¥,Þ¨ï´2Ž÷#êû Í?¾÷#êû`+ã{?¢¾O!“÷#êû86̸ިïƒ36¾÷#êûxÐÌñ¼QߧPÊâýˆú>´—”ÞûqÒe=>øAøÀ‘¥ G–
+ÆT¯åb£ùþþ‚ßuÏŠ¼‹ùÓ?_î^úÅã÷bëè(ù}ú=ùuA*®ÁÿÎÿÿì$2$©®Ÿ ’;@øò?ðaþø þUÔŠ;ÅËßRñæáü° KF]5µ¢fkuYSâkÁ‚¿ Ë.ê2|¥YFÑ +ðÀ4‹ÞtS«ëºªï ²"Õ-ËVŠºe×%ÃÒŠ²&×[.ê@Y²%«(ëvݲa¶ñCWàgšV×4HÙÄŸ)VÝTuxÍZؼ ý°UÉ„æÔº¤©:ühšŠn@— Y~æ?5|`¿Òl¥nÀ8H'5hX’‹ж5M-ʪZ·MY)j¦]·~§©u º
+OL´¿S¥º")ð;Óª+²êP7MøC³Ôº©irqd"[….Ìnq×ç° è2tÇÔá{».+:̳¢›@é’]Wmø‰‚3¤ÁTéŠ\—LÉ¢ž¨8‹:NuðLÃ!Úv)©Š“¯[u [Qp©fß°`ðüN÷`@:ŒÂ” ÏŠ&Õ%]™µŒº!c{0R]EÚ0kŠa‘ßÁÒÚ.¤ Sd)EE–ÈÊ’“ eZ• Ó
+ô^µa¡M왬:tMèN«€oY²f¦1møC¾€Ÿ©„ALËv°uè+þÎÒë6üƒ¿³ºn¨d’¬‡M—“<ÁåÁ>Úºì?€qÁŠÙ†eùàCBΰt³¨À2hŠ…œ+ÎS€?Å
+aðXQS%?ƒ·d&L.…éB®ÑaGÁgÓÝÅÐI‚ëf×á%-x¦È°y%Ù&´5S1Éœ@#ØšŽe¢B@à@Çq*T˜oàz`[Ͳêì˜âÈ&½/4ï@N–OÞÞn_ûÅÇÏÛ‡?xz¦T@ÎÊ2ùÑ#°]mÛÄ¿@&Ú–ik Å€‡+¥¢¡èª"V«&«º¬ëÀi ¸Ø|ùPC¡£[À'5U gR*°
+‚¹üü•¼©ÂŽ’̺{‹ñ2¾‚Û_iÞ‹’oŠ’a_[„ö?ð›f“¡éÏÅÆîûð°ÿþù
+È0ý*¼Œ¶€[5x ‚€$•üÊ}»úCÓ‰
+G"ÒBq` K9ÜÐ4ÜX2lUUCýÆ’ÉÈ`K«Ž~Ò Ãš‰O`Ž@MxCSÔP0# Z0VÔ2lj4%ÉQk¦éN$èO¢G`–@háïœ@ä~ T+(8Ù€V4­ð„(-2%À’Ž"q‹3
+ZÁî²rÄ%ô:iÏg ì_0µ`;ÕÀæ!fqMÆýhÉ°×À-+”`ÑÄm$áÒ‚ï&ŸŠ¬[ƒÍö¶‚{~bZƒ¬ÄÓ€·5 ÌF|›¼Œö>ˆ[`»ñ»ÑLÝ hä#XD°‰ G¸dcüL«ð¿² ˜ Å߳ߎû êÕÆá¢ÊÖ`_  » ´ÐðµÁT^†é&ê­S <x$ƒÄ'Z\!N„‚ i ßRPÙøC6¨nhD,I*yK‚ m@Dm ×Õˆ?-㶠ÍnËp˜‚´®X°÷4 ´ÛKtEE[À„±ÃÒ€‘Œ¢ 6¥Œ&2<
+L9q6ƒÁ ƒ£JäXñº¬ÏÔÖdgNˆ¨Èà³È¨Þ`â,ÓñÁ8Û0¹::´dedƒL¿¶Kð X¢à™B¢9è<ytÐ!6‚Ö€4É"a¯O XÜ^¯ßÄ5À¶ó‡F.Yô1Á©@­€;DSÐœFG^F~DvÁ×q*½NvØ4Ä‚3ÐJ·` Û¸Ø°¦£KLbNî‚ùOФrW4x VÝV •¢„¡.ð5CíÁ*‚™GõÊ&‚Ù:îñ!5º¨@Ø.<Î
+o -Ú… w7S@ ¾ãÜÎàZi¶¤¢´@ÖA“Û@gý°Û$S&6·Çk脃h‡·à[’4wëã
+Êk Ë™H4˜èó@gt =, cwrÃz:ú ¸o t]½!Q ã+Är¸Í{e§åD $ #€0àêûkŠÕeÔiþÁ•0eÚG#›­ånÅÙ“ÂAÁvùvÓ9è¼={­V(•öoûÇŸ·^úŸ…ǯÛÿ×/Þ¾½½o‡ýøŒ‡þ×ðý³_üzzÿ>Ÿx¯—J½náÿÚXÏ endstream endobj 6 0 obj [5 0 R] endobj 35 0 obj <</CreationDate(D:20130405084831-07'00')/Creator(Adobe Illustrator CS5)/ModDate(D:20130405084831-07'00')/Producer(Adobe PDF library 9.90)/Title(favicon)>> endobj xref 0 36 0000000000 65535 f
+0000000016 00000 n
+0000000144 00000 n
+0000052113 00000 n
+0000000000 00000 f
+0000057386 00000 n
+0000199300 00000 n
+0000052164 00000 n
+0000052565 00000 n
+0000057685 00000 n
+0000056578 00000 n
+0000055813 00000 n
+0000057572 00000 n
+0000055527 00000 n
+0000055670 00000 n
+0000054547 00000 n
+0000054966 00000 n
+0000055014 00000 n
+0000056645 00000 n
+0000055873 00000 n
+0000056056 00000 n
+0000056443 00000 n
+0000055968 00000 n
+0000056496 00000 n
+0000056831 00000 n
+0000057251 00000 n
+0000056740 00000 n
+0000057304 00000 n
+0000057456 00000 n
+0000057487 00000 n
+0000057758 00000 n
+0000057954 00000 n
+0000058950 00000 n
+0000069869 00000 n
+0000135457 00000 n
+0000199323 00000 n
+trailer <</Size 36/Root 1 0 R/Info 35 0 R/ID[<D1A851ED02FB4559AF648BAD6C6FE0C2><EFA1EC893C224B00B7B2D62F259DBD74>]>> startxref 199494 %%EOF \ No newline at end of file
diff --git a/web/server/h2o/libh2o/misc/oktavia/resource/oktavia.eps b/web/server/h2o/libh2o/misc/oktavia/resource/oktavia.eps
new file mode 100644
index 00000000..977c77df
--- /dev/null
+++ b/web/server/h2o/libh2o/misc/oktavia/resource/oktavia.eps
Binary files differ
diff --git a/web/server/h2o/libh2o/misc/oktavia/resource/oktavia_large.jpg b/web/server/h2o/libh2o/misc/oktavia/resource/oktavia_large.jpg
new file mode 100644
index 00000000..5be4709e
--- /dev/null
+++ b/web/server/h2o/libh2o/misc/oktavia/resource/oktavia_large.jpg
Binary files differ
diff --git a/web/server/h2o/libh2o/misc/oktavia/resource/oktavia_medium.jpg b/web/server/h2o/libh2o/misc/oktavia/resource/oktavia_medium.jpg
new file mode 100644
index 00000000..2e926f19
--- /dev/null
+++ b/web/server/h2o/libh2o/misc/oktavia/resource/oktavia_medium.jpg
Binary files differ
diff --git a/web/server/h2o/libh2o/misc/oktavia/resource/oktavia_small.jpg b/web/server/h2o/libh2o/misc/oktavia/resource/oktavia_small.jpg
new file mode 100644
index 00000000..5b01e3ec
--- /dev/null
+++ b/web/server/h2o/libh2o/misc/oktavia/resource/oktavia_small.jpg
Binary files differ
diff --git a/web/server/h2o/libh2o/misc/oktavia/src/binary-util.jsx b/web/server/h2o/libh2o/misc/oktavia/src/binary-util.jsx
new file mode 100644
index 00000000..06d5e758
--- /dev/null
+++ b/web/server/h2o/libh2o/misc/oktavia/src/binary-util.jsx
@@ -0,0 +1,597 @@
+class Binary
+{
+ static function dump32bitNumber (num : number) : string
+ {
+ var result = [String.fromCharCode(Math.floor(num / 65536))];
+ result.push(String.fromCharCode(num % 65536));
+ return result.join("");
+ }
+
+ static function load32bitNumber (buffer : string, offset : int) : number
+ {
+ var result = buffer.charCodeAt(offset) * 65536 + buffer.charCodeAt(offset + 1);
+ return result;
+ }
+
+ static function dump16bitNumber (num : int) : string
+ {
+ return String.fromCharCode(num % 65536);
+ }
+
+ static function load16bitNumber (buffer : string, offset : int) : int
+ {
+ return buffer.charCodeAt(offset);
+ }
+
+ static function dumpString (str : string) : string
+ {
+ return Binary.dumpString(str, null);
+ }
+
+ static function dumpString (str : string, report : Nullable.<CompressionReport>) : string
+ {
+ if (str.length > 32768)
+ {
+ str = str.slice(0, 32768);
+ }
+ var length = str.length;
+ var compress = true;
+ var charCodes = [] : int[];
+ for (var i = 0; i < length; i++)
+ {
+ var charCode = str.charCodeAt(i);
+ if (charCode > 255)
+ {
+ compress = false;
+ break;
+ }
+ charCodes.push(charCode);
+ }
+ if (compress)
+ {
+ var result = [Binary.dump16bitNumber(length + 32768)];
+ for (var i = 0; i < length; i += 2)
+ {
+ var bytes = charCodes[i];
+ if (i != length - 1)
+ {
+ bytes += charCodes[i + 1] << 8;
+ }
+ result.push(Binary.dump16bitNumber(bytes));
+ }
+ if (report)
+ {
+ report.add(length, Math.ceil(length / 2));
+ }
+ }
+ else
+ {
+ var result = [Binary.dump16bitNumber(length), str];
+ if (report)
+ {
+ report.add(length, length);
+ }
+ }
+ return result.join('');
+ }
+
+ static function loadString (buffer : string, offset : int) : LoadedStringResult
+ {
+ return new LoadedStringResult(buffer, offset);
+ }
+
+ static function dumpStringList (strList : string[]) : string
+ {
+ return Binary.dumpStringList(strList, null);
+ }
+
+ static function dumpStringList (strList : string[], report : Nullable.<CompressionReport>) : string
+ {
+ var result = [Binary.dump32bitNumber(strList.length)];
+ for (var i = 0; i < strList.length; i++)
+ {
+ result.push(Binary.dumpString(strList[i], report));
+ }
+ return result.join('');
+ }
+
+ static function loadStringList (buffer : string, offset : int) : LoadedStringListResult
+ {
+ return new LoadedStringListResult(buffer, offset);
+ }
+
+ static function dumpStringListMap (strMap : Map.<string[]>) : string
+ {
+ return Binary.dumpStringListMap(strMap, null);
+ }
+
+ static function dumpStringListMap (strMap : Map.<string[]>, report : Nullable.<CompressionReport>) : string
+ {
+ var result = [] : string[];
+ var counter = 0;
+ for (var key in strMap)
+ {
+ result.push(Binary.dumpString(key, report));
+ result.push(Binary.dumpStringList(strMap[key], report));
+ counter++;
+ }
+ return Binary.dump32bitNumber(counter) + result.join('');
+ }
+
+ static function loadStringListMap (buffer : string, offset : int) : LoadedStringListMapResult
+ {
+ return new LoadedStringListMapResult(buffer, offset);
+ }
+
+ static function dump32bitNumberList (array : number[]) : string
+ {
+ return Binary.dump32bitNumberList(array, null);
+ }
+
+ static function dump32bitNumberList (array : number[], report : Nullable.<CompressionReport>) : string
+ {
+ var result = [Binary.dump32bitNumber(array.length)] : string[];
+ var index = 0;
+ var inputLength = array.length;
+ while (index < inputLength)
+ {
+ if (array[index] == 0)
+ {
+ var length = Binary._countZero(array, index);
+ result.push(Binary._zeroBlock(length));
+ index += length;
+ }
+ else if (Binary._shouldZebraCode(array, index))
+ {
+ result.push(Binary._createZebraCode(array, index));
+ index = Math.min(array.length, index + 15);
+ }
+ else
+ {
+ var length = Binary._searchDoubleZero(array, index);
+ result.push(Binary._nonZeroBlock(array, index, length));
+ if (length == 0)
+ {
+ throw new Error('');
+ }
+ index += length;
+ }
+ }
+ var resultString = result.join('');
+ if (report)
+ {
+ report.add(array.length * 2 + 2, resultString.length);
+ }
+ return resultString;
+ }
+
+ static function load32bitNumberList (buffer :string, offset : int) : LoadedNumberListResult
+ {
+ return new LoadedNumberListResult(buffer, offset);
+ }
+
+ static function _countZero (array : number[], offset : int) : int
+ {
+ for (var i = offset; i < array.length; i++)
+ {
+ if (array[i] != 0)
+ {
+ return i - offset;
+ }
+ }
+ return array.length - offset;
+ }
+
+ static function _zeroBlock (length : int) : string
+ {
+ var result = [] : string[];
+ while (length > 0)
+ {
+ if (length > 16384)
+ {
+ result.push(Binary.dump16bitNumber(16384 - 1));
+ length -= 16384;
+ }
+ else
+ {
+ result.push(Binary.dump16bitNumber(length - 1));
+ length = 0;
+ }
+ }
+ return result.join('');
+ }
+
+ static function _shouldZebraCode(array : number[], offset : int) : boolean
+ {
+ if (array.length - offset < 16)
+ {
+ return true;
+ }
+ var change = 0;
+ var isLastZero = false;
+ for (var i = offset; i < offset + 15; i++)
+ {
+ if (array[i] == 0)
+ {
+ if (!isLastZero)
+ {
+ isLastZero = true;
+ change++;
+ }
+ }
+ else
+ {
+ if (isLastZero)
+ {
+ isLastZero = false;
+ change++;
+ }
+ }
+ }
+ return change > 2;
+ }
+
+ static function _searchDoubleZero (array : number[], offset : int) : int
+ {
+ var isLastZero = false;
+ for (var i = offset; i < array.length; i++)
+ {
+ if (array[i] == 0)
+ {
+ if (isLastZero)
+ {
+ return i - offset - 1;
+ }
+ isLastZero = true;
+ }
+ else
+ {
+ isLastZero = false;
+ }
+ }
+ return array.length - offset;
+ }
+
+ static function _nonZeroBlock (array : number[], offset : int, length : int) : string
+ {
+ var result = [] : string[];
+ while (length > 0)
+ {
+ var blockLength : int;
+ if (length > 16384)
+ {
+ blockLength = 16384;
+ length -= 16384;
+ }
+ else
+ {
+ blockLength = length;
+ length = 0;
+ }
+ result.push(Binary.dump16bitNumber((blockLength - 1) + 0x4000));
+ for (var i = offset; i < offset + blockLength; i++)
+ {
+ result.push(Binary.dump32bitNumber(array[i]));
+ }
+ offset += blockLength;
+ }
+ return result.join('');
+ }
+
+ static function _createZebraCode (array : number[], offset : int) : string
+ {
+ var last = Math.min(offset + 15, array.length);
+ var code = 0x8000;
+ var result = [] : string[];
+ for (var i = offset; i < last; i++)
+ {
+ if (array[i] != 0)
+ {
+ result.push(Binary.dump32bitNumber(array[i]));
+ code = code + (0x1 << (i - offset));
+ }
+ }
+ return String.fromCharCode(code) + result.join('');
+ }
+
+ /* These base64 functions are based on http://www.onicos.com/staff/iz/amuse/javascript/expert/base64.txt
+ * original license:
+ * Copyright (C) 1999 Masanao Izumo <iz@onicos.co.jp>
+ * Version: 1.0
+ * LastModified: Dec 25 1999
+ * This library is free. You can redistribute it and/or modify it.
+ */
+ static const _base64EncodeChars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
+
+ static function base64encode (str : string) : string
+ {
+ var out = [] : string[];
+ var source = [] : int[];
+ for (var i = 0; i < str.length; i++)
+ {
+ var code = str.charCodeAt(i);
+ source.push(code & 0x00ff, code >>> 8);
+ }
+ var len = str.length * 2;
+ var i = 0;
+ while (i < len)
+ {
+ var c1 = source[i++] & 0xff;
+ if (i == len)
+ {
+ out.push(Binary._base64EncodeChars.charAt(c1 >> 2));
+ out.push(Binary._base64EncodeChars.charAt((c1 & 0x3) << 4));
+ out.push("==");
+ break;
+ }
+ var c2 = source[i++];
+ if (i == len)
+ {
+ out.push(Binary._base64EncodeChars.charAt(c1 >> 2));
+ out.push(Binary._base64EncodeChars.charAt(((c1 & 0x3)<< 4) | ((c2 & 0xF0) >> 4)));
+ out.push(Binary._base64EncodeChars.charAt((c2 & 0xF) << 2));
+ out.push("=");
+ break;
+ }
+ var c3 = source[i++];
+ out.push(Binary._base64EncodeChars.charAt(c1 >> 2));
+ out.push(Binary._base64EncodeChars.charAt(((c1 & 0x3)<< 4) | ((c2 & 0xF0) >> 4)));
+ out.push(Binary._base64EncodeChars.charAt(((c2 & 0xF) << 2) | ((c3 & 0xC0) >>6)));
+ out.push(Binary._base64EncodeChars.charAt(c3 & 0x3F));
+ }
+ return out.join('');
+ }
+
+ static const _base64DecodeChars = [
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 62, -1, -1, -1, 63,
+ 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, -1, -1, -1, -1, -1, -1,
+ -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
+ 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -1, -1, -1, -1, -1,
+ -1, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
+ 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, -1, -1, -1, -1];
+
+ static function _mergeCharCode (source : int[]) : string
+ {
+ var result = [] : string[];
+ for (var i = 0; i < source.length; i += 2)
+ {
+ result.push(String.fromCharCode(source[i] + (source[i + 1] << 8)));
+ }
+ return result.join('');
+ }
+
+ static function base64decode (str : string) : string
+ {
+ var len = str.length;
+ var i = 0;
+ var out = [] : int[];
+
+ while (i < len)
+ {
+ var c1, c2, c3, c4 : int;
+
+ /* c1 */
+ do {
+ c1 = Binary._base64DecodeChars[str.charCodeAt(i++) & 0xff];
+ } while(i < len && c1 == -1);
+ if (c1 == -1)
+ {
+ break;
+ }
+ /* c2 */
+ do {
+ c2 = Binary._base64DecodeChars[str.charCodeAt(i++) & 0xff];
+ } while(i < len && c2 == -1);
+ if (c2 == -1)
+ {
+ break;
+ }
+ out.push((c1 << 2) | ((c2 & 0x30) >> 4));
+ /* c3 */
+ do {
+ c3 = str.charCodeAt(i++) & 0xff;
+ if (c3 == 61)
+ {
+ return Binary._mergeCharCode(out);
+ }
+ c3 = Binary._base64DecodeChars[c3];
+ } while(i < len && c3 == -1);
+ if (c3 == -1)
+ {
+ break;
+ }
+ out.push(((c2 & 0XF) << 4) | ((c3 & 0x3C) >> 2));
+
+ /* c4 */
+ do {
+ c4 = str.charCodeAt(i++) & 0xff;
+ if (c4 == 61)
+ {
+ return Binary._mergeCharCode(out);
+ }
+ c4 = Binary._base64DecodeChars[c4];
+ } while(i < len && c4 == -1);
+ if (c4 == -1)
+ {
+ break;
+ }
+ out.push(((c3 & 0x03) << 6) | c4);
+ }
+ return Binary._mergeCharCode(out);
+ }
+}
+
+class LoadedStringResult
+{
+ var result : string;
+ var offset : int;
+
+ function constructor (data : string, offset : int)
+ {
+ var strLength = Binary.load16bitNumber(data, offset++);
+ if (strLength > 32767)
+ {
+ strLength = strLength - 32768;
+ var bytes = [] : string[];
+
+ for (var i = 0; i < strLength; i += 2)
+ {
+ var code = data.charCodeAt(offset);
+ bytes.push(String.fromCharCode(code & 0x00ff));
+ if (i != strLength - 1)
+ {
+ bytes.push(String.fromCharCode(code >>> 8));
+ }
+ offset++;
+ }
+ this.result = bytes.join('');
+ this.offset = offset;
+ }
+ else
+ {
+ this.result = data.slice(offset, offset + strLength);
+ this.offset = offset + strLength;
+ }
+ }
+}
+
+class LoadedStringListResult
+{
+ var result : string[];
+ var offset : int;
+
+ function constructor (data : string, offset : int)
+ {
+ this.result = [] : string[];
+
+ var length = Binary.load32bitNumber(data, offset);
+ offset += 2;
+ for (var i = 0; i < length; i++)
+ {
+ var strLength = Binary.load16bitNumber(data, offset++);
+ var resultStr : string;
+ if (strLength > 32767)
+ {
+ var strLength = strLength - 32768;
+ var bytes = [] : string[];
+ for (var j = 0; j < strLength; j += 2)
+ {
+ var code = data.charCodeAt(offset);
+ bytes.push(String.fromCharCode(code & 0x00ff));
+ if (j != strLength - 1)
+ {
+ bytes.push(String.fromCharCode(code >>> 8));
+ }
+ offset++;
+ }
+ resultStr = bytes.join('');
+ }
+ else
+ {
+ resultStr = data.slice(offset, offset + strLength);
+ offset = offset + strLength;
+ }
+ this.result.push(resultStr);
+ }
+ this.offset = offset;
+ }
+}
+
+class LoadedStringListMapResult
+{
+ var result : Map.<string[]>;
+ var offset : int;
+
+ function constructor (data : string, offset : int)
+ {
+ this.result = {} : Map.<string[]>;
+
+ var length = Binary.load32bitNumber(data, offset);
+ offset += 2;
+ for (var i = 0; i < length; i++)
+ {
+ var keyResult = Binary.loadString(data, offset);
+ var valueResult = Binary.loadStringList(data, keyResult.offset);
+ this.result[keyResult.result] = valueResult.result;
+ offset = valueResult.offset;
+ }
+ this.offset = offset;
+ }
+}
+
+class LoadedNumberListResult
+{
+ var result : number[];
+ var offset : int;
+
+ function constructor(data : string, offset : int)
+ {
+ var resultLength = Binary.load32bitNumber(data, offset);
+ var originalOffset = offset;
+ offset += 2;
+ var result = [] : number[];
+ while (result.length < resultLength)
+ {
+ var tag = data.charCodeAt(offset++);
+ if ((tag >>> 15) == 1) // zebra
+ {
+ var length = Math.min(resultLength - result.length, 15);
+ for (var i = 0; i < length; i++)
+ {
+ if ((tag >>> i) & 0x1)
+ {
+ result.push(Binary.load32bitNumber(data, offset));
+ offset += 2;
+ }
+ else
+ {
+ result.push(0);
+ }
+ }
+ }
+ else if ((tag >>> 14) == 1) // non-zero
+ {
+ var length = tag - 0x4000 + 1;
+ for (var i = 0; i < length; i++)
+ {
+ result.push(Binary.load32bitNumber(data, offset));
+ offset += 2;
+ }
+ }
+ else // zero
+ {
+ var length = tag + 1;
+ for (var i = 0; i < length; i++)
+ {
+ result.push(0);
+ }
+ }
+ }
+ this.result = result;
+ this.offset = offset;
+ }
+}
+
+class CompressionReport
+{
+ var source : int;
+ var result : int;
+ function constructor ()
+ {
+ this.source = 0;
+ this.result = 0;
+ }
+
+ function add (source : int, result : int) : void
+ {
+ this.source += source;
+ this.result += result;
+ }
+
+ function rate () : int
+ {
+ return Math.round(this.result * 100.0 / this.source);
+ }
+}
diff --git a/web/server/h2o/libh2o/misc/oktavia/src/bit-vector.jsx b/web/server/h2o/libh2o/misc/oktavia/src/bit-vector.jsx
new file mode 100644
index 00000000..b366e43a
--- /dev/null
+++ b/web/server/h2o/libh2o/misc/oktavia/src/bit-vector.jsx
@@ -0,0 +1,295 @@
+/**
+ * This is a JSX version of shellinford library:
+ * https://code.google.com/p/shellinford/
+ *
+ * License: http://shibu.mit-license.org/
+ */
+
+import "binary-util.jsx";
+
+class BitVector
+{
+ static const SMALL_BLOCK_SIZE : int = 32;
+ static const LARGE_BLOCK_SIZE : int = 256;
+ static const BLOCK_RATE : int = 8;
+
+ var _v : number[];
+ var _r : number[];
+ var _size : int;
+ var _size1 : int;
+
+ function constructor ()
+ {
+ this._r = [] : number[];
+ this._v = [] : number[];
+ this.clear();
+ }
+
+ function build () : void
+ {
+ this._size1 = 0;
+ for (var i = 0; i < this._v.length; i++)
+ {
+ if (i % BitVector.BLOCK_RATE == 0)
+ {
+ this._r.push(this.size(true));
+ }
+ this._size1 += this._rank32(this._v[i], BitVector.SMALL_BLOCK_SIZE, true);
+ }
+ }
+
+ function clear () : void
+ {
+ this._v.length = 0;
+ this._r.length = 0;
+ this._size = 0;
+ this._size1 = 0;
+ }
+
+ function size () : int
+ {
+ return this._size;
+ }
+
+ function size (b : boolean) : int
+ {
+ return b ? (this._size1) : (this._size - this._size1);
+ }
+
+ function set (value : int) : void
+ {
+ this.set(value, true);
+ }
+
+ function set (value : int, flag : boolean) : void
+ {
+ if (value >= this.size())
+ {
+ this._size = value + 1;
+ }
+ var q : int = value / BitVector.SMALL_BLOCK_SIZE;
+ var r : int = value % BitVector.SMALL_BLOCK_SIZE;
+ while (q >= this._v.length)
+ {
+ this._v.push(0);
+ }
+ var m : int = 0x1 << r;
+ if (flag)
+ {
+ this._v[q] |= m;
+ }
+ else
+ {
+ this._v[q] &= ~m;
+ }
+ }
+
+ function get (value : int) : boolean
+ {
+ if (value >= this.size())
+ {
+ throw new Error("BitVector.get() : range error");
+ }
+ var q : int = value / BitVector.SMALL_BLOCK_SIZE;
+ var r : int = value % BitVector.SMALL_BLOCK_SIZE;
+ var m : int = 0x1 << r;
+ return (this._v[q] & m) as boolean;
+ }
+
+ function rank (i : int) : int
+ {
+ return this.rank(i, true);
+ }
+
+ function rank (i : int, b : boolean) : int
+ {
+ if (i > this.size())
+ {
+ throw new Error("BitVector.rank() : range error");
+ }
+ if (i == 0)
+ {
+ return 0;
+ }
+ i--;
+ var q_large : int = Math.floor(i / BitVector.LARGE_BLOCK_SIZE);
+ var q_small : int = Math.floor(i / BitVector.SMALL_BLOCK_SIZE);
+ var r : int = Math.floor(i % BitVector.SMALL_BLOCK_SIZE);
+ var rank : int = this._r[q_large];
+ if (!b)
+ {
+ rank = q_large * BitVector.LARGE_BLOCK_SIZE - rank;
+ }
+ var begin = q_large * BitVector.BLOCK_RATE;
+ for (var j = begin; j < q_small; j++)
+ {
+ rank += this._rank32(this._v[j], BitVector.SMALL_BLOCK_SIZE, b);
+ }
+ rank += this._rank32(this._v[q_small], r + 1, b);
+ return rank;
+ }
+
+ function select(i : int) : int
+ {
+ return this.select(i, true);
+ }
+
+ function select(i : int, b : boolean) : int
+ {
+ if (i >= this.size(b))
+ {
+ throw new Error("BitVector.select() : range error");
+ }
+
+ var left = 0;
+ var right = this._r.length;
+ while (left < right)
+ {
+ var pivot = Math.floor((left + right) / 2);
+ var rank = this._r[pivot];
+ if (!b)
+ {
+ rank = pivot * BitVector.LARGE_BLOCK_SIZE - rank;
+ }
+ if (i < rank)
+ {
+ right = pivot;
+ }
+ else
+ {
+ left = pivot + 1;
+ }
+ }
+ right--;
+
+ if (b)
+ {
+ i -= this._r[right];
+ }
+ else
+ {
+ i -= right * BitVector.LARGE_BLOCK_SIZE - this._r[right];
+ }
+ var j = right * BitVector.BLOCK_RATE;
+ while (1)
+ {
+ var rank = this._rank32(this._v[j], BitVector.SMALL_BLOCK_SIZE, b);
+ if (i < rank)
+ {
+ break;
+ }
+ j++;
+ i -= rank;
+ }
+ return j * BitVector.SMALL_BLOCK_SIZE + this._select32(this._v[j], i, b);
+ }
+
+ function _rank32 (x : int, i : int, b : boolean) : int
+ {
+ if (!b)
+ {
+ x = ~x;
+ }
+ x <<= (BitVector.SMALL_BLOCK_SIZE - i);
+ x = ((x & 0xaaaaaaaa) >>> 1)
+ + (x & 0x55555555);
+ x = ((x & 0xcccccccc) >>> 2)
+ + (x & 0x33333333);
+ x = ((x & 0xf0f0f0f0) >>> 4)
+ + (x & 0x0f0f0f0f);
+ x = ((x & 0xff00ff00) >>> 8)
+ + (x & 0x00ff00ff);
+ x = ((x & 0xffff0000) >>> 16)
+ + (x & 0x0000ffff);
+ return x;
+ }
+
+ function _select32(x : int, i : int, b : boolean) : int
+ {
+ if (!b)
+ {
+ x = ~x;
+ }
+ var x1 = ((x & 0xaaaaaaaa) >>> 1)
+ + (x & 0x55555555);
+ var x2 = ((x1 & 0xcccccccc) >>> 2)
+ + (x1 & 0x33333333);
+ var x3 = ((x2 & 0xf0f0f0f0) >>> 4)
+ + (x2 & 0x0f0f0f0f);
+ var x4 = ((x3 & 0xff00ff00) >>> 8)
+ + (x3 & 0x00ff00ff);
+ var x5 = ((x4 & 0xffff0000) >>> 16)
+ + (x4 & 0x0000ffff);
+ i++;
+ var pos = 0;
+ var v5 = x5 & 0xffffffff;
+ if (i > v5)
+ {
+ i -= v5;
+ pos += 32;
+ }
+ var v4 = (x4 >>> pos) & 0x0000ffff;
+ if (i > v4)
+ {
+ i -= v4;
+ pos += 16;
+ }
+ var v3 = (x3 >>> pos) & 0x000000ff;
+ if (i > v3)
+ {
+ i -= v3;
+ pos += 8;
+ }
+ var v2 = (x2 >>> pos) & 0x0000000f;
+ if (i > v2)
+ {
+ i -= v2;
+ pos += 4;
+ }
+ var v1 = (x1 >>> pos) & 0x00000003;
+ if (i > v1)
+ {
+ i -= v1;
+ pos += 2;
+ }
+ var v0 = (x >>> pos) & 0x00000001;
+ if (i > v0)
+ {
+ i -= v0;
+ pos += 1;
+ }
+ return pos;
+ }
+
+ function dump () : string
+ {
+ var contents = [] : string[];
+ contents.push(Binary.dump32bitNumber(this._size));
+ contents.push(Binary.dump32bitNumberList(this._v));
+ return contents.join('');
+ }
+
+ function dump (report : CompressionReport) : string
+ {
+ var contents = [] : string[];
+ contents.push(Binary.dump32bitNumber(this._size));
+ report.add(2, 2);
+ contents.push(Binary.dump32bitNumberList(this._v, report));
+ return contents.join('');
+ }
+
+ function load (data : string) : int
+ {
+ return this.load(data, 0);
+ }
+
+ function load (data : string, offset : int) : int
+ {
+ this.clear();
+ this._size = Binary.load32bitNumber(data, offset);
+ var result = Binary.load32bitNumberList(data, offset + 2);
+ this._v = result.result;
+ this.build();
+ return result.offset;
+ }
+}
diff --git a/web/server/h2o/libh2o/misc/oktavia/src/burrows-wheeler-transform.jsx b/web/server/h2o/libh2o/misc/oktavia/src/burrows-wheeler-transform.jsx
new file mode 100644
index 00000000..4bdd72fe
--- /dev/null
+++ b/web/server/h2o/libh2o/misc/oktavia/src/burrows-wheeler-transform.jsx
@@ -0,0 +1,73 @@
+import "sais.jsx";
+
+class BurrowsWheelerTransform
+{
+ static var END_MARKER = String.fromCharCode(0);
+
+ var _str : string;
+ var _size : int;
+ var _head : int;
+ var _suffixarray : int[];
+
+ function constructor ()
+ {
+ this._size = 0;
+ this._head = 0;
+ this._suffixarray = [] : int[];
+ }
+
+ function size () : int
+ {
+ return this._size;
+ }
+
+ function head () : int
+ {
+ return this._head;
+ }
+
+ function clear () : void
+ {
+ this._str = "";
+ this._size = 0;
+ this._head = 0;
+ this._suffixarray.length = 0;
+ }
+
+ function build (str : string) : void
+ {
+ this._str = str;
+ this._size = this._str.length;
+ this._suffixarray = SAIS.make(str);
+ this._head = this._suffixarray.indexOf(0);
+ }
+
+ function get (i : int) : string
+ {
+ var size = this.size();
+ if (i >= size)
+ {
+ throw new Error("BurrowsWheelerTransform.get() : range error");
+ }
+ var index = (this._suffixarray[i] + size - 1) % size;
+ return this._str.charAt(index);
+ }
+
+ function get () : string
+ {
+ var str = [] : string [];
+ var size = this.size();
+ for (var i = 0; i < size; i++)
+ {
+ str.push(this.get(i));
+ }
+ return str.join("");
+ }
+
+ function get (replace : string) : string
+ {
+ var result = this.get();
+ return result.replace(BurrowsWheelerTransform.END_MARKER, replace);
+ }
+}
+
diff --git a/web/server/h2o/libh2o/misc/oktavia/src/csvparser.jsx b/web/server/h2o/libh2o/misc/oktavia/src/csvparser.jsx
new file mode 100644
index 00000000..64ed6ac8
--- /dev/null
+++ b/web/server/h2o/libh2o/misc/oktavia/src/csvparser.jsx
@@ -0,0 +1,22 @@
+import "oktavia.jsx";
+import "stemmer/stemmer.jsx";
+
+
+class CSVParser
+{
+ var oktavia : Oktavia;
+ var root : string;
+ var stemmer : Nullable.<Stemmer>;
+
+ function constructor (root : string, stemmer : Stemmer)
+ {
+ this.oktavia = new Oktavia();
+ this.root = root;
+ this.stemmer = stemmer;
+ }
+
+ function parse (filepath : string) : void
+ {
+ log (filepath);
+ }
+}
diff --git a/web/server/h2o/libh2o/misc/oktavia/src/fm-index.jsx b/web/server/h2o/libh2o/misc/oktavia/src/fm-index.jsx
new file mode 100644
index 00000000..502b4fcf
--- /dev/null
+++ b/web/server/h2o/libh2o/misc/oktavia/src/fm-index.jsx
@@ -0,0 +1,323 @@
+/**
+ * This is a JSX version of shellinford library:
+ * https://code.google.com/p/shellinford/
+ *
+ * License: http://shibu.mit-license.org/
+ */
+
+import "wavelet-matrix.jsx";
+import "bit-vector.jsx";
+import "burrows-wheeler-transform.jsx";
+import "binary-util.jsx";
+import "console.jsx";
+
+
+class FMIndex
+{
+ var _substr : string;
+ var _ddic : int;
+ var _ssize : int;
+ var _head : int;
+ var _sv : WaveletMatrix;
+ var _posdic : int[];
+ var _idic : int[];
+ var _rlt : int[];
+
+ function constructor ()
+ {
+ this._ddic = 0,
+ this._head = 0;
+ this._substr = "";
+ this._sv = new WaveletMatrix();
+ this._posdic = [] : int[];
+ this._idic = [] : int[];
+ this._rlt = [] : int[];
+ this._rlt.length = 65536;
+ }
+
+ function clear () : void
+ {
+ this._sv.clear();
+ this._posdic.length = 0;
+ this._idic.length = 0;
+ this._ddic = 0;
+ this._head = 0;
+ this._substr = "";
+ }
+
+ function size () : int
+ {
+ return this._sv.size();
+ }
+
+ function contentSize () : int
+ {
+ return this._substr.length;
+ }
+
+ function getRows (key : string) : int
+ {
+ var pos = [] : int[];
+ return this.getRows(key, pos);
+ }
+ function getRows (key : string, pos : int[]) : int
+ {
+ var i = key.length - 1;
+ var code = key.charCodeAt(i);
+ var first = this._rlt[code] + 1;
+ var last = this._rlt[code + 1];
+ while (first <= last)
+ {
+ if (i == 0)
+ {
+ pos[0] = --first;
+ pos[1] = --last;
+ return (last - first + 1);
+ }
+ i--;
+ var c = key.charCodeAt(i);
+ first = this._rlt[c] + this._sv.rank(first - 1, c) + 1;
+ last = this._rlt[c] + this._sv.rank(last, c);
+ }
+ return 0;
+ }
+
+ function getPosition (i : int) : int
+ {
+ if (i >= this.size())
+ {
+ throw new Error("FMIndex.getPosition() : range error");
+ }
+ var pos = 0;
+ while (i != this._head)
+ {
+ if ((i % this._ddic) == 0)
+ {
+ pos += (this._posdic[i / this._ddic] + 1);
+ break;
+ }
+ var c = this._sv.get(i);
+ i = this._rlt[c] + this._sv.rank(i, c); //LF
+ pos++;
+ }
+ return pos % this.size();
+ }
+
+ function getSubstring (pos : int, len : int) : string
+ {
+ if (pos >= this.size())
+ {
+ throw new Error("FMIndex.getSubstring() : range error");
+ }
+ var pos_end = Math.min(pos + len, this.size());
+ var pos_tmp = this.size() - 1;
+ var i = this._head;
+ var pos_idic = Math.floor((pos_end + this._ddic - 2) / this._ddic);
+ if (pos_idic < this._idic.length)
+ {
+ pos_tmp = pos_idic * this._ddic;
+ i = this._idic[pos_idic];
+ }
+
+ var substr = "";
+ while (pos_tmp >= pos)
+ {
+ var c = this._sv.get(i);
+ i = this._rlt[c] + this._sv.rank(i, c); //LF
+ if (pos_tmp < pos_end)
+ {
+ substr = String.fromCharCode(c) + substr;
+ }
+ if (pos_tmp == 0)
+ {
+ break;
+ }
+ pos_tmp--;
+ }
+ return substr;
+ }
+
+ function build () : void
+ {
+ this.build(String.fromCharCode(0), 65535, 20, false);
+ }
+
+ function build(end_marker : string, ddic : int, verbose : boolean) : void
+ {
+ this.build(end_marker, 65535, ddic, verbose);
+ }
+
+ function build(end_marker : string, maxChar : int, ddic : int, verbose : boolean) : void
+ {
+ if (verbose)
+ {
+ console.time("building burrows-wheeler transform");
+ }
+ this._substr += end_marker;
+ var b = new BurrowsWheelerTransform();
+ b.build(this._substr);
+ var s = b.get();
+ this._ssize = s.length;
+ this._head = b.head();
+ b.clear();
+ this._substr = "";
+ if (verbose)
+ {
+ console.timeEnd("building burrows-wheeler transform");
+ }
+ if (verbose)
+ {
+ console.time("building wavelet matrix");
+ }
+ this._sv.setMaxCharCode(maxChar);
+ if (verbose)
+ {
+ console.log(" maxCharCode: ", maxChar);
+ console.log(" bitSize: ", this._sv.bitsize());
+ }
+ this._sv.build(s);
+ if (verbose)
+ {
+ console.timeEnd("building wavelet matrix");
+ }
+
+ if (verbose)
+ {
+ console.time("caching rank less than");
+ }
+ for (var c = 0; c < maxChar; c++)
+ {
+ this._rlt[c] = this._sv.rank_less_than(this._sv.size(), c);
+ }
+ if (verbose)
+ {
+ console.timeEnd("caching rank less than");
+ }
+ this._ddic = ddic;
+ if (verbose)
+ {
+ console.time("building dictionaries");
+ }
+ this._buildDictionaries();
+ if (verbose)
+ {
+ console.timeEnd("building dictionaries");
+ console.log('');
+ }
+ }
+
+ function _buildDictionaries () : void
+ {
+ for (var i = 0; i < (this._ssize / this._ddic + 1); i++)
+ {
+ this._posdic.push(0);
+ this._idic.push(0);
+ }
+ var i = this._head;
+ var pos = this.size() - 1;
+ do {
+ if ((i % this._ddic) == 0)
+ {
+ this._posdic[Math.floor(i / this._ddic)] = pos;
+ }
+ if ((pos % this._ddic) == 0)
+ {
+ this._idic[Math.floor(pos / this._ddic)] = i;
+ }
+ var c = this._sv.get(i);
+ i = this._rlt[c] + this._sv.rank(i, c); //LF
+ pos--;
+ } while (i != this._head);
+ }
+
+ function push (doc : string) : void
+ {
+ if (doc.length <= 0)
+ {
+ throw new Error("FMIndex::push(): empty string");
+ }
+ this._substr += doc;
+ }
+
+ function search (keyword : string) : int[]
+ {
+ var result_map = {} : Map.<int>;
+ var result = [] : int[];
+ var position = [] : int[];
+ var rows = this.getRows(keyword, position);
+ if (rows > 0)
+ {
+ var first = position[0];
+ var last = position[1];
+ for (var i = first; i <= last; i++)
+ {
+ result.push(this.getPosition(i));
+ }
+ }
+ return result;
+ }
+
+ function dump () : string
+ {
+ return this.dump(false);
+ }
+
+ function dump (verbose : boolean) : string
+ {
+ var contents = [] : string[];
+ var report = new CompressionReport();
+ contents.push(Binary.dump32bitNumber(this._ddic));
+ contents.push(Binary.dump32bitNumber(this._ssize));
+ contents.push(Binary.dump32bitNumber(this._head));
+ report.add(6, 6);
+ contents.push(this._sv.dump(report));
+ if (verbose)
+ {
+ console.log("Serializing FM-index");
+ console.log(' Wavelet Matrix: ' + (contents[3].length * 2) as string + ' bytes (' + report.rate() as string + '%)');
+ }
+ contents.push(Binary.dump32bitNumber(this._posdic.length));
+ for (var i in this._posdic)
+ {
+ contents.push(Binary.dump32bitNumber(this._posdic[i]));
+ }
+ for (var i in this._idic)
+ {
+ contents.push(Binary.dump32bitNumber(this._idic[i]));
+ }
+ if (verbose)
+ {
+ console.log(' Dictionary Cache: ' + (this._idic.length * 16) as string + ' bytes');
+ }
+ return contents.join("");
+ }
+
+ function load (data : string) : int
+ {
+ return this.load(data, 0);
+ }
+
+ function load (data : string, offset : int) : int
+ {
+ this._ddic = Binary.load32bitNumber(data, offset);
+ this._ssize = Binary.load32bitNumber(data, offset + 2);
+ this._head = Binary.load32bitNumber(data, offset + 4);
+ offset = this._sv.load(data, offset + 6);
+ var maxChar = Math.pow(2, this._sv.bitsize());
+ for (var c = 0; c < maxChar; c++)
+ {
+ this._rlt[c] = this._sv.rank_less_than(this._sv.size(), c);
+ }
+ var size = Binary.load32bitNumber(data, offset);
+ offset += 2;
+ for (var i = 0; i < size; i++, offset += 2)
+ {
+ this._posdic.push(Binary.load32bitNumber(data, offset));
+ }
+ for (var i = 0; i < size; i++, offset += 2)
+ {
+ this._idic.push(Binary.load32bitNumber(data, offset));
+ }
+ return offset;
+ }
+}
diff --git a/web/server/h2o/libh2o/misc/oktavia/src/getopt.jsx b/web/server/h2o/libh2o/misc/oktavia/src/getopt.jsx
new file mode 100644
index 00000000..56db655a
--- /dev/null
+++ b/web/server/h2o/libh2o/misc/oktavia/src/getopt.jsx
@@ -0,0 +1,356 @@
+/*
+ * getopt.js: node.js implementation of POSIX getopt() (and then some)
+ *
+ * Copyright 2011 David Pacheco. All rights reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+import "console.jsx";
+
+class CommandOption
+{
+ var option : string;
+ var optarg : Nullable.<string>;
+ var error : boolean;
+
+ function constructor (option : string)
+ {
+ this.option = option;
+ this.optarg = null;
+ this.error = false;
+ }
+
+ function constructor (option : string, optarg : string)
+ {
+ this.option = option;
+ this.optarg = optarg;
+ this.error = false;
+ }
+
+ function constructor (option : string, optarg : string, error : boolean)
+ {
+ this.option = option;
+ this.optarg = optarg;
+ this.error = error;
+ }
+}
+
+
+/*
+ * The BasicParser is our primary interface to the outside world. The
+ * documentation for this object and its public methods is contained in
+ * the included README.md.
+ */
+class BasicParser
+{
+ var _argv : string[];
+ var _options : Map.<boolean>;
+ var _aliases : Map.<string>;
+ var _optind : int;
+ var _subind : int;
+ var _silent : boolean;
+ var _extraoptions : boolean;
+
+ function constructor (optstring : string, argv : string[])
+ {
+ this._argv = argv;
+ this._options = {} : Map.<boolean>;
+ this._aliases = {} : Map.<string>;
+ this._optind = 0;
+ this._subind = 0;
+ this._extraoptions = false;
+
+ this._parseOptstr(optstring);
+ }
+
+ static function _makeError (msg : string) : Error
+ {
+ return (new Error('getopt: ' + msg));
+ }
+
+ /*
+ * Parse the option string and update the following fields:
+ *
+ * _silent Whether to log errors to stderr. Silent mode is
+ * indicated by a leading ':' in the option string.
+ *
+ * _options Maps valid single-letter-options to booleans indicating
+ * whether each option is required.
+ *
+ * _aliases Maps valid long options to the corresponding
+ * single-letter short option.
+ */
+ function _parseOptstr (optstr : string) : void
+ {
+ var i = 0;
+
+ if (optstr.length > 0 && optstr.slice(0, 1) == ':')
+ {
+ this._silent = true;
+ i++;
+ }
+ else
+ {
+ this._silent = false;
+ }
+ while (i < optstr.length)
+ {
+ var chr = optstr.slice(i, i + 1);
+ var arg = false;
+
+ if (!/^[\w\d]$/.test(chr))
+ {
+ throw new Error('invalid optstring: only alphanumeric ' +
+ 'characters may be used as options: ' + chr);
+ }
+
+ if (i + 1 < optstr.length && optstr.slice(i + 1, i + 2) == ':')
+ {
+ arg = true;
+ i++;
+ }
+
+ this._options[chr] = arg;
+
+ while (i + 1 < optstr.length && optstr.slice(i + 1, i + 2) == '(')
+ {
+ i++;
+ var cp = optstr.indexOf(')', i + 1);
+ if (cp == -1)
+ {
+ throw new Error('invalid optstring: missing ' +
+ '")" to match "(" at char ' + i as string);
+ }
+ var alias = optstr.substring(i + 1, cp);
+ this._aliases[alias] = chr;
+ i = cp;
+ }
+ i++;
+ }
+ }
+
+ function optind () : int
+ {
+ return this._optind;
+ }
+
+ /*
+ * For documentation on what getopt() does, see README.md. The following
+ * implementation invariants are maintained by getopt() and its helper methods:
+ *
+ * this._optind Refers to the element of _argv that contains
+ * the next argument to be processed. This may
+ * exceed _argv, in which case the end of input
+ * has been reached.
+ *
+ * this._subind Refers to the character inside
+ * this._options[this._optind] which begins
+ * the next option to be processed. This may never
+ * exceed the length of _argv[_optind], so
+ * when incrementing this value we must always
+ * check if we should instead increment optind and
+ * reset subind to 0.
+ *
+ * That is, when any of these functions is entered, the above indices' values
+ * are as described above. getopt() itself and getoptArgument() may both be
+ * called at the end of the input, so they check whether optind exceeds
+ * argv.length. getoptShort() and getoptLong() are called only when the indices
+ * already point to a valid short or long option, respectively.
+ *
+ * getopt() processes the next option as follows:
+ *
+ * o If _optind > _argv.length, then we already parsed all arguments.
+ *
+ * o If _subind == 0, then we're looking at the start of an argument:
+ *
+ * o Check for special cases like '-', '--', and non-option arguments.
+ * If present, update the indices and return the appropriate value.
+ *
+ * o Check for a long-form option (beginning with '--'). If present,
+ * delegate to getoptLong() and return the result.
+ *
+ * o Otherwise, advance subind past the argument's leading '-' and
+ * continue as though _subind != 0 (since that's now the case).
+ *
+ * o Delegate to getoptShort() and return the result.
+ */
+ function getopt () : Nullable.<CommandOption>
+ {
+ if (this._optind >= this._argv.length)
+ {
+ /* end of input */
+ return null;
+ }
+
+ var arg = this._argv[this._optind];
+ if (this._extraoptions)
+ {
+ this._optind++;
+ return new CommandOption(arg);
+ }
+
+ if (this._subind == 0)
+ {
+ if (arg == '-' || arg == '')
+ {
+ return null;
+ }
+
+ if (arg.charAt(0) != '-')
+ {
+ this._extraoptions = true;
+ this._optind++;
+ return new CommandOption(arg);
+ }
+
+ if (arg == '--')
+ {
+ this._optind++;
+ this._subind = 0;
+ return null;
+ }
+
+ if (arg.slice(1, 2) == '-')
+ {
+ return this._getoptLong();
+ }
+ this._subind++;
+ }
+
+ return this._getoptShort();
+ }
+
+ /*
+ * Implements getopt() for the case where optind/subind point to a short option.
+ */
+ function _getoptShort () : CommandOption
+ {
+ var arg = this._argv[this._optind];
+ var chr = arg.slice(this._subind, this._subind + 1);
+
+ if (++this._subind >= arg.length)
+ {
+ this._optind++;
+ this._subind = 0;
+ }
+
+ if (!(chr in this._options))
+ {
+ return this._errInvalidOption(chr);
+ }
+
+ if (!this._options[chr])
+ {
+ return new CommandOption(chr);
+ }
+ return this._getoptArgument(chr);
+ }
+
+ /*
+ * Implements getopt() for the case where optind/subind point to a long option.
+ */
+ function _getoptLong () : CommandOption
+ {
+ var arg = this._argv[this._optind];
+ var eq = arg.indexOf('=');
+ var alias = arg.substring(2, eq == -1 ? arg.length : eq);
+ if (!(alias in this._aliases))
+ {
+ return this._errInvalidOption(alias);
+ }
+
+ var chr = this._aliases[alias];
+ if (!this._options[chr])
+ {
+ if (eq != -1)
+ {
+ return this._errExtraArg(alias);
+ }
+ this._optind++; /* eat this argument */
+ return new CommandOption(chr);
+ }
+
+ /*
+ * Advance optind/subind for the argument value and retrieve it.
+ */
+ if (eq == -1)
+ {
+ this._optind++;
+ }
+ else
+ {
+ this._subind = eq + 1;
+ }
+ return this._getoptArgument(chr);
+ }
+
+ /*
+ * For the given option letter 'chr' that takes an argument, assumes that
+ * optind/subind point to the argument (or denote the end of input) and return
+ * the appropriate getopt() return value for this option and argument (or return
+ * the appropriate error).
+ */
+ function _getoptArgument (chr : string) : CommandOption
+ {
+ if (this._optind >= this._argv.length)
+ {
+ return this._errMissingArg(chr);
+ }
+
+ var arg = this._argv[this._optind].substring(this._subind);
+ this._optind++;
+ this._subind = 0;
+ return new CommandOption(chr, arg);
+ }
+
+ function _errMissingArg (chr : string) : CommandOption
+ {
+ if (this._silent)
+ {
+ return new CommandOption(':', chr);
+ }
+ console.error('option requires an argument -- ' + chr + '\n');
+ return new CommandOption('?', chr, true);
+ }
+
+ function _errInvalidOption (chr : string) : CommandOption
+ {
+ if (!this._silent)
+ {
+ console.error('illegal option -- ' + chr + '\n');
+ }
+ return new CommandOption('?', chr, true);
+ }
+
+ /*
+ * This error is not specified by POSIX, but neither is the notion of specifying
+ * long option arguments using "=" in the same argv-argument, but it's common
+ * practice and pretty convenient.
+ */
+ function _errExtraArg (chr : string) : CommandOption
+ {
+ if (!this._silent)
+ {
+ console.error('option expects no argument -- ' +
+ chr + '\n');
+ }
+ return new CommandOption('?', chr, true);
+ }
+}
diff --git a/web/server/h2o/libh2o/misc/oktavia/src/htmlparser.jsx b/web/server/h2o/libh2o/misc/oktavia/src/htmlparser.jsx
new file mode 100644
index 00000000..3d0ace78
--- /dev/null
+++ b/web/server/h2o/libh2o/misc/oktavia/src/htmlparser.jsx
@@ -0,0 +1,280 @@
+import "console.jsx";
+import "js/nodejs.jsx";
+import "oktavia.jsx";
+import "metadata.jsx";
+import "sax.jsx";
+import "stemmer/stemmer.jsx";
+
+
+class _HTMLHandler extends SAXHandler
+{
+ var startParse : boolean;
+ var startTag : string;
+ var stack : string [];
+ var oktavia : Oktavia;
+ var section : Section;
+ var tag : Block;
+ var filter : TagFilter;
+ var filepath : string;
+ var unit : int;
+ var currentLink : string;
+ var currentTitle : string;
+ var lastId : string;
+ var waitTitle : boolean;
+ var sectionCount : int;
+ var inCode : boolean;
+ var addText : boolean;
+
+ function constructor (oktavia : Oktavia, filepath : string, unit : int, filter : TagFilter)
+ {
+ super();
+ this.startParse = false;
+ this.stack = [] : string[];
+ this.oktavia = oktavia;
+ this.section = this.oktavia.getSection('section');
+ this.tag = this.oktavia.getBlock('tag');
+ this.unit = unit;
+ this.filter = filter;
+ this.filepath = filepath;
+ this.currentTitle = '';
+ this.lastId = '';
+ this.waitTitle = false;
+ this.addText = false;
+ }
+
+ override function onready () : void
+ {
+ this.currentLink = this.filepath;
+ this.inCode = false;
+ }
+
+ override function onopentag (tagname : string, attributes : Map.<string>) : void
+ {
+ var headingId = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'];
+ if (this.startParse)
+ {
+ this.stack.push(tagname);
+ if ('id' in attributes)
+ {
+ this.lastId = attributes['id'];
+ }
+ switch (tagname)
+ {
+ case 'h1':
+ case 'h2':
+ case 'h3':
+ case 'h4':
+ case 'h5':
+ case 'h6':
+ if (headingId.indexOf(tagname) < this.unit)
+ {
+ if (this.oktavia.contentSize() > 0)
+ {
+ this.section.setTail(this.currentTitle + Oktavia.eob + this.currentLink);
+ }
+ this.currentLink = this.filepath + '#' + this.lastId;
+ this.currentTitle = '';
+ this.waitTitle = true;
+ }
+ this.oktavia.addEndOfBlock();
+ this.tag.startBlock(tagname);
+ break;
+ case 'pre':
+ this.tag.startBlock('pre');
+ this.oktavia.addEndOfBlock();
+ this.inCode = true;
+ break;
+ case 'p':
+ case 'div':
+ case 'blockquote':
+ this.oktavia.addEndOfBlock();
+ break;
+ }
+ }
+ else
+ {
+ if (this.filter.match(tagname, attributes))
+ {
+ this.startParse = true;
+ this.startTag = tagname;
+ this.stack.push(tagname);
+ }
+ }
+ if (tagname == 'title')
+ {
+ this.waitTitle = true;
+ this.currentTitle = '';
+ }
+ }
+
+ override function onclosetag (tagname : string) : void
+ {
+ if (this.startParse)
+ {
+ switch (tagname)
+ {
+ case 'h1':
+ case 'h2':
+ case 'h3':
+ case 'h4':
+ case 'h5':
+ case 'h6':
+ this.tag.endBlock();
+ if (this.addText)
+ {
+ this.oktavia.addWord('\n');
+ this.addText = false;
+ }
+ this.waitTitle = false;
+ break;
+ case 'pre':
+ this.inCode = false;
+ this.tag.endBlock();
+ if (this.addText)
+ {
+ this.oktavia.addWord('\n');
+ this.addText = false;
+ }
+ break;
+ case 'div':
+ case 'p':
+ case 'blockquote':
+ if (this.addText)
+ {
+ this.oktavia.addWord('\n');
+ this.addText = false;
+ }
+ break;
+ }
+ if (this.stack.length == 0)
+ {
+ this.startParse = false;
+ }
+ }
+ if (tagname == 'title')
+ {
+ this.waitTitle = false;
+ }
+ }
+
+ override function ontext (text : string) : void
+ {
+ if (this.startParse)
+ {
+ this.oktavia.addWord(text, !this.inCode);
+ this.addText = true;
+ }
+ if (this.waitTitle)
+ {
+ this.currentTitle += text;
+ }
+ }
+
+ override function onend () : void
+ {
+ this.section.setTail(this.currentTitle + Oktavia.eob + this.currentLink);
+ }
+}
+
+class TagFilter
+{
+ var tags : string[];
+ var ids : string[];
+ var classes : string[];
+ var tagAndClasses : string[];
+
+ function constructor (filters : string[])
+ {
+ this.tags = [] : string[];
+ this.ids = [] : string[];
+ this.classes = [] : string[];
+ this.tagAndClasses = [] : string[];
+
+ for (var i = 0; i < filters.length; i++)
+ {
+ var filter = filters[i];
+ switch (filter.charAt(0))
+ {
+ case '#':
+ this.ids.push(filter.slice(1));
+ break;
+ case '.':
+ this.classes.push(filter.slice(1));
+ break;
+ default:
+ if (filter.indexOf('.') != -1)
+ {
+ this.tags.push(filter);
+ }
+ else
+ {
+ this.tagAndClasses.push(filter);
+ }
+ }
+ }
+ }
+
+ function match (tagname : string, attributes : Map.<string>) : boolean
+ {
+ var result = false;
+ if (this.tags.indexOf(tagname) != -1)
+ {
+ result = true;
+ }
+ else if (attributes['id'] && this.ids.indexOf(attributes['id']) != -1)
+ {
+ result = true;
+ }
+ else if (attributes['class'])
+ {
+ var classname = attributes['class'];
+ if (this.classes.indexOf(classname) != -1 ||
+ this.tagAndClasses.indexOf(tagname + '.' + classname) != -1)
+ {
+ result = true;
+ }
+ }
+ return result;
+ }
+}
+
+class HTMLParser
+{
+ var oktavia : Oktavia;
+ var unit : int;
+ var root : string;
+ var prefix : string;
+ var filter : TagFilter;
+
+ function constructor (unit : int, root : string, prefix : string, filter : string[], stemmer : Nullable.<Stemmer>)
+ {
+ this.unit = unit;
+ this.root = root;
+ this.prefix = prefix;
+ this.filter = new TagFilter(filter);
+ this.oktavia = new Oktavia();
+ this.oktavia.addSection('section');
+ this.oktavia.addBlock('tag');
+ if (stemmer)
+ {
+ this.oktavia.setStemmer(stemmer);
+ }
+ }
+
+ function parse (filepath : string) : void
+ {
+ var relative = this.prefix + node.path.relative(this.root, filepath);
+ console.log('reading: ' + relative);
+ var lines = node.fs.readFileSync(filepath, 'utf8');
+ var handler = new _HTMLHandler(this.oktavia, relative, this.unit, this.filter);
+ var parser = new SAXParser(handler);
+ parser.parse(lines);
+ }
+
+ function dump (cacheDensity : int, verbose : boolean) : string
+ {
+ console.log('\nbuilding...\n');
+ this.oktavia.build(cacheDensity, verbose);
+ return this.oktavia.dump(verbose);
+ }
+}
diff --git a/web/server/h2o/libh2o/misc/oktavia/src/metadata.jsx b/web/server/h2o/libh2o/misc/oktavia/src/metadata.jsx
new file mode 100644
index 00000000..25c38813
--- /dev/null
+++ b/web/server/h2o/libh2o/misc/oktavia/src/metadata.jsx
@@ -0,0 +1,498 @@
+import "bit-vector.jsx";
+import "oktavia.jsx";
+import "binary-util.jsx";
+import "search-result.jsx";
+
+
+class Metadata
+{
+ var _parent : Oktavia;
+ var _bitVector : BitVector;
+
+ function constructor (parent : Oktavia)
+ {
+ this._parent = parent;
+ this._bitVector = new BitVector();
+ }
+
+ function _size () : int
+ {
+ return this._bitVector.rank(this._bitVector.size());
+ }
+
+ function getContent (index : int) : string
+ {
+ if (index < 0 || this._size() <= index)
+ {
+ throw new Error("Section.getContent() : range error " + index as string);
+ }
+ var startPosition = 0;
+ if (index > 0)
+ {
+ startPosition = this._bitVector.select(index - 1) + 1;
+ }
+ var length = this._bitVector.select(index) - startPosition + 1;
+ return this._parent._getSubstring(startPosition, length);
+ }
+
+ function getStartPosition (index : int) : int
+ {
+ if (index < 0 || this._size() <= index)
+ {
+ throw new Error("Section.getContent() : range error " + index as string);
+ }
+ var startPosition = 0;
+ if (index > 0)
+ {
+ startPosition = this._bitVector.select(index - 1) + 1;
+ }
+ return startPosition;
+ }
+
+ function grouping (result : SingleResult, positions : int [], word : string, stemmed : boolean) : void
+ {
+ }
+
+ function getInformation(index : int) : string
+ {
+ return '';
+ }
+
+ function _build () : void
+ {
+ this._bitVector.build();
+ }
+
+ function _load (name : string, data : string, offset : int) : int
+ {
+ offset = this._bitVector.load(data, offset);
+ this._parent._metadataLabels.push(name);
+ this._parent._metadatas[name] = this;
+ return offset;
+ }
+
+ function _dump () : string
+ {
+ return this._bitVector.dump();
+ }
+
+ function _dump (report : CompressionReport) : string
+ {
+ return this._bitVector.dump(report);
+ }
+}
+
+class Section extends Metadata
+{
+ var _names : string[];
+
+ function constructor (parent : Oktavia)
+ {
+ super(parent);
+ this._names = [] : string[];
+ }
+
+ function setTail (name : string) : void
+ {
+ this.setTail(name, this._parent.contentSize());
+ }
+
+ function setTail (name : string, index : int) : void
+ {
+ this._names.push(name);
+ this._bitVector.set(index - 1);
+ }
+
+ function size () : int
+ {
+ return this._names.length;
+ }
+
+ function getSectionIndex (position : int) : int
+ {
+ if (position < 0 || this._bitVector.size() <= position)
+ {
+ throw new Error("Section.getSectionIndex() : range error " + position as string);
+ }
+ return this._bitVector.rank(position);
+ }
+
+ function getName (index : int) : string
+ {
+ if (index < 0 || this.size() <= index)
+ {
+ throw new Error("Section.getName() : range error");
+ }
+ return this._names[index];
+ }
+
+ override function grouping (result : SingleResult, positions : int [], word : string, stemmed : boolean) : void
+ {
+ for (var i = 0; i < positions.length; i++)
+ {
+ var position = positions[i];
+ var index = this.getSectionIndex(position);
+ var unit = result.getSearchUnit(index);
+ if (unit.startPosition < 0)
+ {
+ unit.startPosition = this.getStartPosition(index);
+ }
+ unit.addPosition(word, position - unit.startPosition, stemmed);
+ }
+ }
+
+ override function getInformation(index : int) : string
+ {
+ return this.getName(index);
+ }
+
+ static function _load (parent : Oktavia, name : string, data : string, offset : int) : int
+ {
+ var strs = Binary.loadStringList(data, offset);
+ var section = new Section(parent);
+ section._names = strs.result;
+ return section._load(name, data, strs.offset);
+ }
+
+ override function _dump () : string
+ {
+ return [Binary.dump16bitNumber(0), Binary.dumpStringList(this._names), super._dump()].join('');
+ }
+
+ override function _dump (report : CompressionReport) : string
+ {
+ report.add(1, 1);
+ return [Binary.dump16bitNumber(0), Binary.dumpStringList(this._names, report), super._dump(report)].join('');
+ }
+}
+
+class Splitter extends Metadata
+{
+ var name : Nullable.<string>;
+
+ function constructor (parent : Oktavia)
+ {
+ super(parent);
+ this.name = null;
+ }
+
+ function constructor (parent : Oktavia, name : string)
+ {
+ super(parent);
+ this.name = name;
+ }
+
+ function size () : int
+ {
+ return this._size();
+ }
+
+ function split () : void
+ {
+ this.split(this._parent.contentSize());
+ }
+
+ function split (index : int) : void
+ {
+ this._bitVector.set(index - 1);
+ }
+
+ function getIndex (position : int) : int
+ {
+ if (position < 0 || this._bitVector.size() <= position)
+ {
+ throw new Error("Section.getSectionIndex() : range error");
+ }
+ return this._bitVector.rank(position);
+ }
+
+ override function grouping (result : SingleResult, positions : int [], word : string, stemmed : boolean) : void
+ {
+ for (var i = 0; i < positions.length; i++)
+ {
+ var position = positions[i];
+ var index = this.getIndex(position);
+ var unit = result.getSearchUnit(index);
+ if (unit.startPosition < 0)
+ {
+ unit.startPosition = this.getStartPosition(index);
+ }
+ unit.addPosition(word, position - unit.startPosition, stemmed);
+ }
+ }
+
+ override function getInformation(index : int) : string
+ {
+ if (this.name != null)
+ {
+ return this.name + ((index + 1) as string);
+ }
+ return '';
+ }
+
+ static function _load (parent : Oktavia, name : string, data : string, offset : int) : int
+ {
+ var section = new Splitter(parent);
+ return section._load(name, data, offset);
+ }
+
+ override function _dump () : string
+ {
+ return [Binary.dump16bitNumber(1), super._dump()].join('');
+ }
+
+ override function _dump (report : CompressionReport) : string
+ {
+ report.add(1, 1);
+ return [Binary.dump16bitNumber(1), super._dump(report)].join('');
+ }
+}
+
+class Table extends Metadata
+{
+ var _headers : string[];
+ var _columnTails : BitVector;
+
+ function constructor (parent : Oktavia, headers : string[])
+ {
+ super(parent);
+ this._headers = headers;
+ this._columnTails = new BitVector();
+ }
+
+ function rowSize () : int
+ {
+ return this._size();
+ }
+
+ function columnSize () : int
+ {
+ return this._headers.length;
+ }
+
+ function setColumnTail () : void
+ {
+ var index = this._parent.contentSize();
+ this._parent.addEndOfBlock();
+ this._columnTails.set(index - 1);
+ }
+
+ function setRowTail () : void
+ {
+ var index = this._parent.contentSize();
+ this._bitVector.set(index - 1);
+ }
+
+ function getCell (position : int) : int[]
+ {
+ if (position < 0 || this._bitVector.size() <= position)
+ {
+ throw new Error("Section.getSectionIndex() : range error " + position as string);
+ }
+ var row = this._bitVector.rank(position);
+ var currentColumn = this._columnTails.rank(position);
+
+ var lastRowColumn = 0;
+ if (row > 0)
+ {
+ var startPosition = this._bitVector.select(row - 1) + 1;
+ lastRowColumn = this._columnTails.rank(startPosition);
+ }
+ var result = [row, currentColumn - lastRowColumn] : int[];
+ return result;
+ }
+
+ function getRowContent (rowIndex : int) : Map.<string>
+ {
+ var content = this.getContent(rowIndex);
+ var values = content.split(Oktavia.eob, this._headers.length);
+ var result = {} : Map.<string>;
+ for (var i in this._headers)
+ {
+ if (i < values.length)
+ {
+ result[this._headers[i]] = values[i];
+ }
+ else
+ {
+ result[this._headers[i]] = '';
+ }
+ }
+ return result;
+ }
+
+ override function grouping (result : SingleResult, positions : int [], word : string, stemmed : boolean) : void
+ {
+ // TODO implement
+ }
+
+ override function getInformation(index : int) : string
+ {
+ return '';
+ }
+
+ override function _build () : void
+ {
+ this._bitVector.build();
+ this._columnTails.build();
+ }
+
+ static function _load (parent : Oktavia, name : string, data : string, offset : int) : int
+ {
+ var strs = Binary.loadStringList(data, offset);
+ var table = new Table(parent, strs.result);
+ offset = table._load(name, data, strs.offset);
+ return table._columnTails.load(data, offset);
+ }
+
+ override function _dump () : string
+ {
+ return [
+ Binary.dump16bitNumber(2), Binary.dumpStringList(this._headers),
+ super._dump(), this._columnTails.dump()
+ ].join('');
+ }
+
+ override function _dump (report : CompressionReport) : string
+ {
+ report.add(1, 1);
+ return [
+ Binary.dump16bitNumber(2), Binary.dumpStringList(this._headers, report),
+ super._dump(report), this._columnTails.dump(report)
+ ].join('');
+ }
+}
+
+class Block extends Metadata
+{
+ var _names : string[];
+ var _start : boolean;
+
+ function constructor (parent : Oktavia)
+ {
+ super(parent);
+ this._names = [] : string[];
+ this._start = false;
+ }
+
+ function startBlock (blockName : string) : void
+ {
+ this.startBlock(blockName, this._parent.contentSize());
+ }
+
+ function startBlock (blockName : string, index : int) : void
+ {
+ if (this._start)
+ {
+ throw new Error('Splitter `' + this._names[this._names.length - 1] + '` is not closed');
+ }
+ this._start = true;
+ this._names.push(blockName);
+ this._bitVector.set(index - 1);
+ }
+
+ function endBlock () : void
+ {
+ this.endBlock(this._parent.contentSize());
+ }
+
+ function endBlock (index : int) : void
+ {
+ if (!this._start)
+ {
+ throw new Error('Splitter is not started');
+ }
+ this._start = false;
+ this._bitVector.set(index - 1);
+ }
+
+ function size () : int
+ {
+ return this._names.length;
+ }
+
+ function blockIndex (position : int) : int
+ {
+ if (position < 0 || (this._parent._fmindex.size() - 1) <= position)
+ {
+ throw new Error("Block.blockIndex() : range error " + position as string);
+ }
+ var result : int;
+ if (position >= this._bitVector.size())
+ {
+ position = this._bitVector.size() - 1;
+ result = this._bitVector.rank(position) + 1;
+ }
+ else
+ {
+ result = this._bitVector.rank(position);
+ }
+ return result;
+ }
+
+ function inBlock (position : int) : boolean
+ {
+ var blockIndex = this.blockIndex(position);
+ return (blockIndex % 2) != 0;
+ }
+
+ function getBlockContent (position : int) : string
+ {
+ var blockIndex = this.blockIndex(position);
+ var result : string;
+ if ((blockIndex % 2) != 0)
+ {
+ result = this.getContent(blockIndex);
+ }
+ else
+ {
+ result = '';
+ }
+ return result;
+ }
+
+ function getBlockName (position : int) : string
+ {
+ var blockIndex = this.blockIndex(position);
+ var result : string;
+ if ((blockIndex % 2) != 0)
+ {
+ result = this._names[blockIndex >>> 1];
+ }
+ else
+ {
+ result = '';
+ }
+ return result;
+ }
+
+ override function grouping (result : SingleResult, positions : int [], word : string, stemmed : boolean) : void
+ {
+ // TODO implement
+ }
+
+ override function getInformation(index : int) : string
+ {
+ return '';
+ }
+
+ static function _load (parent : Oktavia, name : string, data : string, offset : int) : int
+ {
+ var strs = Binary.loadStringList(data, offset);
+ var block = new Block(parent);
+ block._names = strs.result;
+ return block._load(name, data, strs.offset);
+ }
+
+ override function _dump () : string
+ {
+ return [Binary.dump16bitNumber(3), Binary.dumpStringList(this._names), super._dump()].join('');
+ }
+
+ override function _dump (report : CompressionReport) : string
+ {
+ report.add(1, 1);
+ return [Binary.dump16bitNumber(3), Binary.dumpStringList(this._names, report), super._dump(report)].join('');
+ }
+}
+
diff --git a/web/server/h2o/libh2o/misc/oktavia/src/node-sqlite3.jsx b/web/server/h2o/libh2o/misc/oktavia/src/node-sqlite3.jsx
new file mode 100644
index 00000000..32196983
--- /dev/null
+++ b/web/server/h2o/libh2o/misc/oktavia/src/node-sqlite3.jsx
@@ -0,0 +1,115 @@
+import "js.jsx";
+
+native __fake__ class _sqlite3database
+{
+ static const OK = 0;
+ static const ERROR = 1;
+ static const INTERNAL = 2;
+ static const PERM = 3;
+ static const ABORT = 4;
+ static const BUSY = 5;
+ static const LOCKED = 6;
+ static const NOMEM = 7;
+ static const READONLY = 8;
+ static const INTERRUPT = 9;
+ static const IOERR = 10;
+ static const CORRUPT = 11;
+ static const NOTFOUND = 12;
+ static const FULL = 13;
+ static const CANTOPEN = 14;
+ static const PROTOCOL = 15;
+ static const EMPTY = 16;
+ static const SCHEMA = 17;
+ static const TOOBIG = 18;
+ static const CONSTRAINT = 19;
+ static const MISMATCH = 20;
+ static const MISUSE = 21;
+ static const NOLFS = 22;
+ static const AUTH = 23;
+ static const FORMAT = 24;
+ static const RANGE = 25;
+
+ function run(...params : variant) : void;
+ function all(...params : variant) : void;
+ function each(...params : variant) : void;
+ function close(...params : variant) : void;
+ function serialize(...params : variant) : void;
+}
+
+native __fake__ class _sqlite3statement
+{
+}
+
+native __fake__ class _sqlite3error
+{
+ var message : string;
+ var errno : int;
+ var code : string;
+}
+
+class SQLite3Database
+{
+ var _instance : _sqlite3database;
+
+ function constructor (filename : string)
+ {
+ var exp = "(function () { var __sqlite3 = require('sqlite3'); return new __sqlite3.Database('" + filename + "');})()";
+ this._instance = js.eval(exp) as __noconvert__ _sqlite3database;
+ }
+
+ function run (sql : string) : SQLite3Database
+ {
+ this._instance.run(sql);
+ return this;
+ }
+
+ function run (sql : string, bind : variant) : SQLite3Database
+ {
+ this._instance.run(sql, bind);
+ return this;
+ }
+
+ function run (sql : string, bind : variant, callback : (Nullable.<_sqlite3error>) -> void) : SQLite3Database
+ {
+ this._instance.run(sql, bind, callback);
+ return this;
+ }
+
+ function run (sql : string, callback : (Nullable.<_sqlite3error>) -> void) : SQLite3Database
+ {
+ this._instance.run(sql, callback);
+ return this;
+ }
+
+ function each (sql : string, callback : (Nullable.<_sqlite3error>, variant) -> void) : SQLite3Database
+ {
+ this._instance.each(sql, callback);
+ return this;
+ }
+
+ function all (sql : string, callback : (Nullable.<_sqlite3error>, variant[]) -> void) : SQLite3Database
+ {
+ this._instance.all(sql, callback);
+ return this;
+ }
+
+ function serialize () : void
+ {
+ this._instance.serialize();
+ }
+
+ function serialize (callback : (Nullable.<_sqlite3error>) -> void) : void
+ {
+ this._instance.serialize(callback);
+ }
+
+ function close () : void
+ {
+ this._instance.close();
+ }
+
+ function close (callback : (Nullable.<_sqlite3error>) -> void) : void
+ {
+ this._instance.close(callback);
+ }
+}
diff --git a/web/server/h2o/libh2o/misc/oktavia/src/oktavia.jsx b/web/server/h2o/libh2o/misc/oktavia/src/oktavia.jsx
new file mode 100644
index 00000000..8109b475
--- /dev/null
+++ b/web/server/h2o/libh2o/misc/oktavia/src/oktavia.jsx
@@ -0,0 +1,427 @@
+import "metadata.jsx";
+import "fm-index.jsx";
+import "binary-util.jsx";
+import "query.jsx";
+import "search-result.jsx";
+import "stemmer/stemmer.jsx";
+import "console.jsx";
+
+
+class Oktavia
+{
+ var _fmindex : FMIndex;
+ var _metadatas : Map.<Metadata>;
+ var _metadataLabels : string[];
+ var _stemmer : Nullable.<Stemmer>;
+ var _stemmingResult : Map.<string[]>;
+
+ // char code remap tables
+ var _utf162compressCode : string[];
+ var _compressCode2utf16 : string[];
+
+ // sentinels
+ static const eof = String.fromCharCode(0);
+ static const eob = String.fromCharCode(1);
+ static const unknown = String.fromCharCode(3);
+
+ function constructor ()
+ {
+ this._fmindex = new FMIndex();
+ this._metadatas = {} : Map.<Metadata>;
+ this._metadataLabels = [] : string[];
+ this._stemmer = null;
+ this._stemmingResult = {} : Map.<string[]>;
+ this._utf162compressCode = [Oktavia.eof, Oktavia.eob, Oktavia.unknown];
+ this._utf162compressCode.length = 65536;
+ this._compressCode2utf16 = [Oktavia.eof, Oktavia.eob, Oktavia.unknown];
+ }
+
+ function setStemmer (stemmer : Stemmer) : void
+ {
+ this._stemmer = stemmer;
+ }
+
+ function getPrimaryMetadata () : Metadata
+ {
+ return this._metadatas[this._metadataLabels[0]];
+ }
+
+ function addSection (key : string) : Section
+ {
+ if (this._metadataLabels.indexOf(key) != -1)
+ {
+ throw new Error('Metadata name ' + key + ' is already exists');
+ }
+ this._metadataLabels.push(key);
+ var section = new Section(this);
+ this._metadatas[key] = section;
+ return section;
+ }
+
+ function getSection (key : string) : Section
+ {
+ if (this._metadataLabels.indexOf(key) == -1)
+ {
+ throw new Error('Metadata name ' + key + " does't exists");
+ }
+ return this._metadatas[key] as Section;
+ }
+
+ function addSplitter (key : string) : Splitter
+ {
+ if (this._metadataLabels.indexOf(key) != -1)
+ {
+ throw new Error('Metadata name ' + key + ' is already exists');
+ }
+ this._metadataLabels.push(key);
+ var splitter = new Splitter(this);
+ this._metadatas[key] = splitter;
+ return splitter;
+ }
+
+ function getSplitter (key : string) : Splitter
+ {
+ if (this._metadataLabels.indexOf(key) == -1)
+ {
+ throw new Error('Metadata name ' + key + " does't exists");
+ }
+ return this._metadatas[key] as Splitter;
+ }
+
+ function addTable (key : string, headers : string[]) : Table
+ {
+ if (this._metadataLabels.indexOf(key) != -1)
+ {
+ throw new Error('Metadata name ' + key + ' is already exists');
+ }
+ this._metadataLabels.push(key);
+ var table = new Table(this, headers);
+ this._metadatas[key] = table;
+ return table;
+ }
+
+ function getTable (key : string) : Table
+ {
+ if (this._metadataLabels.indexOf(key) == -1)
+ {
+ throw new Error('Metadata name ' + key + " does't exists");
+ }
+ return this._metadatas[key] as Table;
+ }
+
+ function addBlock (key : string) : Block
+ {
+ if (this._metadataLabels.indexOf(key) != -1)
+ {
+ throw new Error('Metadata name ' + key + ' is already exists');
+ }
+ this._metadataLabels.push(key);
+ var block = new Block(this);
+ this._metadatas[key] = block;
+ return block;
+ }
+
+ function getBlock (key : string) : Block
+ {
+ if (this._metadataLabels.indexOf(key) == -1)
+ {
+ throw new Error('Metadata name ' + key + " does't exists");
+ }
+ return this._metadatas[key] as Block;
+ }
+
+ function addEndOfBlock () : void
+ {
+ this._fmindex.push(Oktavia.eob);
+ }
+
+ function addWord (words : string) : void
+ {
+ var str = [] : string[];
+ str.length = words.length;
+ for (var i = 0; i < words.length; i++)
+ {
+ var charCode = words.charCodeAt(i);
+ var newCharCode = this._utf162compressCode[charCode];
+ if (newCharCode == null)
+ {
+ newCharCode = String.fromCharCode(this._compressCode2utf16.length);
+ this._utf162compressCode[charCode] = newCharCode;
+ this._compressCode2utf16.push(String.fromCharCode(charCode));
+ }
+ str.push(newCharCode);
+ }
+ this._fmindex.push(str.join(''));
+ }
+
+ function addWord (words : string, stemming : boolean) : void
+ {
+ this.addWord(words);
+ var wordList = words.split(/\s+/);
+ for (var i = 0; i < wordList.length; i++)
+ {
+ var originalWord = wordList[i];
+ var smallWord = originalWord.slice(0, 1).toLowerCase() + originalWord.slice(1);
+ var registerWord : Nullable.<string> = null;
+ if (stemming && this._stemmer)
+ {
+ var baseWord = this._stemmer.stemWord(originalWord.toLowerCase());
+ if (originalWord.indexOf(baseWord) == -1)
+ {
+ registerWord = baseWord;
+ }
+ }
+ else if (originalWord != smallWord)
+ {
+ registerWord = smallWord;
+ }
+ if (registerWord)
+ {
+ var compressedCodeWord = this._convertToCompressionCode(originalWord);
+ var stemmedList = this._stemmingResult[registerWord];
+ if (!stemmedList)
+ {
+ stemmedList = [compressedCodeWord];
+ this._stemmingResult[registerWord] = stemmedList;
+ }
+ else if (stemmedList.indexOf(compressedCodeWord) == -1)
+ {
+ stemmedList.push(compressedCodeWord);
+ }
+ }
+ }
+ }
+
+ function _convertToCompressionCode (keyword : string) : string
+ {
+ var resultChars = [] : string[];
+ for (var i = 0; i < keyword.length; i++)
+ {
+ var chr = this._utf162compressCode[keyword.charCodeAt(i)];
+ if (chr == null)
+ {
+ resultChars.push(Oktavia.unknown);
+ }
+ else
+ {
+ resultChars.push(chr);
+ }
+ }
+ return resultChars.join('');
+ }
+
+ function rawSearch (keyword : string, stemming : boolean) : int[]
+ {
+ var result : int[];
+ if (stemming)
+ {
+ result = [] : int[];
+ if (this._stemmer)
+ {
+ var baseWord = this._stemmer.stemWord(keyword.toLowerCase());
+ var stemmedList = this._stemmingResult[baseWord];
+ if (stemmedList)
+ {
+ for (var i = 0; i < stemmedList.length; i++)
+ {
+ var word = stemmedList[i];
+ result = result.concat(this._fmindex.search(word));
+ }
+ }
+ }
+ }
+ else
+ {
+ result = this._fmindex.search(this._convertToCompressionCode(keyword));
+ }
+ return result;
+ }
+
+ function search (queries : Query[]) : SearchSummary
+ {
+ var summary = new SearchSummary(this);
+ for (var i = 0; i < queries.length; i++)
+ {
+ summary.addQuery(this._searchQuery(queries[i]));
+ }
+ summary.mergeResult();
+ return summary;
+ }
+
+ function _searchQuery (query : Query) : SingleResult
+ {
+ var result = new SingleResult(query.word, query.or, query.not);
+ var positions : int[];
+ if (query.raw)
+ {
+ positions = this.rawSearch(query.word, false);
+ }
+ else
+ {
+ positions = this.rawSearch(query.word, false).concat(this.rawSearch(query.word, true));
+ }
+ this.getPrimaryMetadata().grouping(result, positions, query.word, !query.raw);
+ return result;
+ }
+
+ function build () : void
+ {
+ this.build(5, false);
+ }
+
+ function build (cacheDensity : int, verbose : boolean) : void
+ {
+ for (var key in this._metadatas)
+ {
+ this._metadatas[key]._build();
+ }
+ var cacheRange = Math.round(Math.max(1, (100 / Math.min(100, Math.max(0.01, cacheDensity)))));
+ var maxChar = this._compressCode2utf16.length;
+ this._fmindex.build(Oktavia.eof, maxChar, cacheRange, verbose);
+ }
+
+ function dump () : string
+ {
+ return this.dump(false);
+ }
+
+ function dump (verbose : boolean) : string
+ {
+ var headerSource = "oktavia-01";
+ var header = Binary.dumpString(headerSource).slice(1);
+ if (verbose)
+ {
+ console.log("Source text size: " + (this._fmindex.size() * 2) as string + ' bytes');
+ }
+ var fmdata = this._fmindex.dump(verbose);
+ var result = [
+ header,
+ fmdata
+ ];
+
+ result.push(Binary.dump16bitNumber(this._compressCode2utf16.length));
+ for (var i = 3; i < this._compressCode2utf16.length; i++)
+ {
+ result.push(this._compressCode2utf16[i]);
+ }
+ if (verbose)
+ {
+ console.log('Char Code Map: ' + (this._compressCode2utf16.length * 2 - 2) as string + ' bytes');
+ }
+
+ var report = new CompressionReport();
+ result.push(Binary.dumpStringListMap(this._stemmingResult, report));
+ if (verbose)
+ {
+ console.log('Stemmed Word Table: ' + (result[result.length - 1].length) as string + ' bytes (' + report.rate() as string + '%)');
+ }
+
+ result.push(Binary.dump16bitNumber(this._metadataLabels.length));
+ for (var i = 0; i < this._metadataLabels.length; i++)
+ {
+ var report = new CompressionReport();
+ var name = this._metadataLabels[i];
+ var data = this._metadatas[name]._dump(report);
+ result.push(Binary.dumpString(name, report), data);
+ if (verbose)
+ {
+ console.log('Meta Data ' + name + ': ' + (data.length * 2) as string + ' bytes (' + report.rate() as string + '%)');
+ }
+ }
+ return result.join('');
+ }
+
+ function load (data : string) : void
+ {
+ var headerSource = "oktavia-01";
+ var header = Binary.dumpString(headerSource).slice(1);
+ if (data.slice(0, 5) != header)
+ {
+ throw new Error('Invalid data file');
+ }
+ this._metadatas = {} : Map.<Metadata>;
+ this._metadataLabels = [] : string[];
+
+ var offset = 5;
+ offset = this._fmindex.load(data, offset);
+ var charCodeCount = Binary.load16bitNumber(data, offset++);
+ this._compressCode2utf16 = [Oktavia.eof, Oktavia.eob, Oktavia.unknown];
+ this._utf162compressCode = [Oktavia.eof, Oktavia.eob, Oktavia.unknown];
+ for (var i = 3; i < charCodeCount; i++)
+ {
+ var charCode = Binary.load16bitNumber(data, offset++);
+ this._compressCode2utf16.push(String.fromCharCode(charCode));
+ this._utf162compressCode[charCode] = String.fromCharCode(i);
+ }
+
+ var stemmedWords = Binary.loadStringListMap(data, offset);
+ this._stemmingResult = stemmedWords.result;
+ offset = stemmedWords.offset;
+
+ var metadataCount = Binary.load16bitNumber(data, offset++);
+ for (var i = 0; i < metadataCount; i++)
+ {
+ var nameResult = Binary.loadString(data, offset);
+ var name = nameResult.result;
+ var offset = nameResult.offset;
+ var type = Binary.load16bitNumber(data, offset++);
+ switch (type)
+ {
+ case 0:
+ offset = Section._load(this, name, data, offset);
+ break;
+ case 1:
+ offset = Splitter._load(this, name, data, offset);
+ break;
+ case 2:
+ offset = Table._load(this, name, data, offset);
+ break;
+ case 3:
+ offset = Block._load(this, name, data, offset);
+ break;
+ }
+ }
+ }
+
+ function contentSize () : int
+ {
+ return this._fmindex.contentSize();
+ }
+
+ function wordPositionType (position : int) : int
+ {
+ var result = 0;
+ if (position == 0)
+ {
+ result = 4;
+ }
+ else
+ {
+ var ahead = this._fmindex.getSubstring(position - 1, 1);
+ if (/\s/.test(ahead))
+ {
+ result = 2;
+ }
+ else if (/\W/.test(ahead))
+ {
+ result = 1;
+ }
+ else if (Oktavia.eob == ahead)
+ {
+ result = 3;
+ }
+ }
+ return result;
+ }
+
+ function _getSubstring (position : int, length : int) : string
+ {
+ var result = this._fmindex.getSubstring(position, length);
+ var str = [] : string[];
+ for (var i = 0; i < result.length; i++)
+ {
+ str.push(this._compressCode2utf16[result.charCodeAt(i)]);
+ }
+ return str.join('');
+ }
+}
diff --git a/web/server/h2o/libh2o/misc/oktavia/src/query-parser.jsx b/web/server/h2o/libh2o/misc/oktavia/src/query-parser.jsx
new file mode 100644
index 00000000..86308bcb
--- /dev/null
+++ b/web/server/h2o/libh2o/misc/oktavia/src/query-parser.jsx
@@ -0,0 +1,60 @@
+import "query.jsx";
+
+
+class QueryParser
+{
+ var queries : Query[];
+ function constructor()
+ {
+ this.queries = [] : Query[];
+ }
+
+ function parse (queryStrings : string[]) : Query[]
+ {
+ var nextOr = false;
+ for (var i = 0; i < queryStrings.length; i++)
+ {
+ var word = queryStrings[i];
+ if (word == 'OR')
+ {
+ nextOr = true;
+ }
+ else
+ {
+ var query = new Query();
+ if (nextOr)
+ {
+ query.or = true;
+ nextOr = false;
+ }
+ if (word.slice(0, 1) == '-')
+ {
+ query.not = true;
+ word = word.slice(1);
+ }
+ if (word.slice(0, 1) == '"' && word.slice(word.length -1) == '"')
+ {
+ query.raw = true;
+ word = word.slice(1, word.length -1);
+ }
+ query.word = word;
+ this.queries.push(query);
+ }
+ }
+ return this.queries;
+ }
+
+ function highlight () : string
+ {
+ var result = [] : string[];
+ for (var i = 0; i < this.queries.length; i++)
+ {
+ var query = this.queries[i];
+ if (!query.not)
+ {
+ result.push("highlight=" + String.encodeURIComponent(query.word));
+ }
+ }
+ return '?' + result.join('&');
+ }
+}
diff --git a/web/server/h2o/libh2o/misc/oktavia/src/query-string-parser.jsx b/web/server/h2o/libh2o/misc/oktavia/src/query-string-parser.jsx
new file mode 100644
index 00000000..71d015c9
--- /dev/null
+++ b/web/server/h2o/libh2o/misc/oktavia/src/query-string-parser.jsx
@@ -0,0 +1,128 @@
+import "query.jsx";
+
+
+class QueryStringParser
+{
+ var queries : Query[];
+ function constructor()
+ {
+ this.queries = [] : Query[];
+ }
+
+ function parse (queryString : string) : Query[]
+ {
+ var nextOr = false;
+ var nextNot = false;
+ var currentWordStart = 0;
+ var status = 0;
+ // 0: free
+ // 1: in unquoted word
+ // 2: in quote
+ var isSpace = /[\s\u3000]/;
+ for (var i = 0; i < queryString.length; i++)
+ {
+ var ch = queryString.charAt(i);
+ switch (status)
+ {
+ case 0: // free
+ if (!isSpace.test(ch))
+ {
+ if (ch == '-')
+ {
+ nextNot = true;
+ }
+ else if (ch == '"')
+ {
+ currentWordStart = i + 1;
+ status = 2;
+ }
+ else
+ {
+ currentWordStart = i;
+ status = 1;
+ }
+ }
+ else
+ {
+ nextNot = false;
+ }
+ break;
+ case 1: // unquoted word
+ if (isSpace.test(ch))
+ {
+ var word = queryString.slice(currentWordStart, i);
+ if (word == 'OR')
+ {
+ nextOr = true;
+ }
+ else
+ {
+ var query = new Query();
+ query.word = word;
+ query.or = nextOr;
+ query.not = nextNot;
+ this.queries.push(query);
+ nextOr = false;
+ nextNot = false;
+ }
+ status = 0;
+ }
+ break;
+ case 2: // in quote
+ if (ch == '"')
+ {
+ var word = queryString.slice(currentWordStart, i);
+ var query = new Query();
+ query.word = word;
+ query.or = nextOr;
+ query.not = nextNot;
+ query.raw = true;
+ this.queries.push(query);
+ nextOr = false;
+ nextNot = false;
+ status = 0;
+ }
+ break;
+ }
+ }
+ switch (status)
+ {
+ case 0:
+ break;
+ case 1:
+ var query = new Query();
+ var word = queryString.slice(currentWordStart, queryString.length);
+ if (word != 'OR')
+ {
+ query.word = word;
+ query.or = nextOr;
+ query.not = nextNot;
+ this.queries.push(query);
+ }
+ break;
+ case 2:
+ var query = new Query();
+ query.word = queryString.slice(currentWordStart, queryString.length);
+ query.or = nextOr;
+ query.not = nextNot;
+ query.raw = true;
+ this.queries.push(query);
+ break;
+ }
+ return this.queries;
+ }
+
+ function highlight () : string
+ {
+ var result = [] : string[];
+ for (var i = 0; i < this.queries.length; i++)
+ {
+ var query = this.queries[i];
+ if (!query.not)
+ {
+ result.push("highlight=" + String.encodeURIComponent(query.word));
+ }
+ }
+ return '?' + result.join('&');
+ }
+}
diff --git a/web/server/h2o/libh2o/misc/oktavia/src/query.jsx b/web/server/h2o/libh2o/misc/oktavia/src/query.jsx
new file mode 100644
index 00000000..38c52c71
--- /dev/null
+++ b/web/server/h2o/libh2o/misc/oktavia/src/query.jsx
@@ -0,0 +1,37 @@
+class Query
+{
+ var word : string;
+ var or : boolean;
+ var not : boolean;
+ var raw : boolean;
+
+ function constructor ()
+ {
+ this.word = '';
+ this.or = false;
+ this.not = false;
+ this.raw = false;
+ }
+
+ override function toString () : string
+ {
+ var result = [] : string[];
+ if (this.or)
+ {
+ result.push("OR ");
+ }
+ if (this.not)
+ {
+ result.push("-");
+ }
+ if (this.raw)
+ {
+ result.push('"', this.word, '"');
+ }
+ else
+ {
+ result.push(this.word);
+ }
+ return result.join('');
+ }
+}
diff --git a/web/server/h2o/libh2o/misc/oktavia/src/sais.jsx b/web/server/h2o/libh2o/misc/oktavia/src/sais.jsx
new file mode 100644
index 00000000..9d8fa8fb
--- /dev/null
+++ b/web/server/h2o/libh2o/misc/oktavia/src/sais.jsx
@@ -0,0 +1,250 @@
+/* Original source code:
+ * G. Nong, S. Zhang and W. H. Chan, Two Efficient Algorithms for Linear Time Suffix Array Construction, IEEE Transactions on Computers, To Appear
+ * http://www.cs.sysu.edu.cn/nong/index.files/Two%20Efficient%20Algorithms%20for%20Linear%20Suffix%20Array%20Construction.pdf
+ */
+
+import "bit-vector.jsx";
+
+class OArray
+{
+ var offset : int;
+ var array : int[];
+
+ function constructor (array : int[])
+ {
+ this.array = array;
+ this.offset = 0;
+ }
+
+ function constructor (array : int[], offset : int)
+ {
+ this.array = array;
+ this.offset = offset;
+ }
+
+ function get (index : int) : int
+ {
+ return this.array[index + this.offset];
+ }
+
+ function set (index : int, value : int) : void
+ {
+ this.array[index + this.offset] = value;
+ }
+
+ function isS (index : int) : boolean
+ {
+ return this.array[index + this.offset] < this.array[index + this.offset + 1];
+ }
+
+ function compare (index1 : int, index2 : int) : boolean
+ {
+ return this.array[index1 + this.offset] == this.array[index2 + this.offset];
+ }
+}
+
+
+class SAIS
+{
+ static function _isLMS (t : BitVector, i : int) : boolean
+ {
+ return i > 0 && t.get(i) && !t.get(i - 1);
+ }
+
+ // find the start or end of each bucket
+ static function _getBuckets(s : OArray, bkt : int[], n : int, K : int, end : boolean) : void
+ {
+ var sum = 0;
+ for (var i = 0; i <= K; i++)
+ {
+ bkt[i] = 0; // clear all buckets
+ }
+ for (var i = 0; i < n; i++)
+ {
+ bkt[s.get(i)]++; // compute the size of each bucket
+ }
+ for (var i = 0; i <= K; i++)
+ {
+ sum += bkt[i];
+ bkt[i] = end ? sum : sum - bkt[i];
+ }
+ }
+
+ // compute SAl
+ static function _induceSAl(t : BitVector, SA : int[], s : OArray, bkt : int[], n : int, K : int, end : boolean) : void
+ {
+ SAIS._getBuckets(s, bkt, n, K, end); // find starts of buckets
+ for (var i = 0; i < n; i++)
+ {
+ var j = SA[i] - 1;
+ if (j >= 0 && !t.get(j))
+ {
+ SA[bkt[s.get(j)]++] = j;
+ }
+ }
+ }
+
+ // compute SAs
+ static function _induceSAs(t : BitVector, SA : int[], s : OArray, bkt : int[], n : int, K : int, end : boolean) : void
+ {
+ SAIS._getBuckets(s, bkt, n, K, end); // find ends of buckets
+ for (var i = n - 1; i >= 0; i--)
+ {
+ var j = SA[i] - 1;
+ if (j >=0 && t.get(j))
+ {
+ SA[--bkt[s.get(j)]] = j;
+ }
+ }
+ }
+
+ // find the suffix array SA of s[0..n-1] in {1..K}^n
+ // require s[n-1]=0 (the sentinel!), n>=2
+ // use a working space (excluding s and SA) of at most 2.25n+O(1) for a constant alphabet
+
+ static function make(source : string) : int[]
+ {
+ var charCodes = [] : int[];
+ charCodes.length = source.length;
+ var maxCode = 0;
+ for (var i = 0; i < source.length; i++)
+ {
+ var code = source.charCodeAt(i);
+ charCodes[i] = code;
+ maxCode = (code > maxCode) ? code : maxCode;
+ }
+ var SA = [] : int[];
+ SA.length = source.length;
+ var s = new OArray(charCodes);
+ SAIS._make(s, SA, source.length, maxCode);
+ return SA;
+ }
+
+ static function _make(s : OArray, SA : int[], n : int, K : int) : void
+ {
+ // Classify the type of each character
+ var t = new BitVector();
+ t.set(n - 2, false);
+ t.set(n - 1, true); // the sentinel must be in s1, important!!!
+ for (var i = n - 3; i >= 0; i--)
+ {
+ t.set(i, (s.isS(i) || (s.compare(i, i + 1) && t.get(i + 1))));
+ }
+
+ // stage 1: reduce the problem by at least 1/2
+ // sort all the S-substrings
+ var bkt = [] : int[];
+ bkt.length = K + 1;
+ SAIS._getBuckets(s, bkt, n, K, true); // find ends of buckets
+ for (var i = 0; i < n; i++)
+ {
+ SA[i] = -1;
+ }
+ for (var i = 1; i < n; i++)
+ {
+ if (SAIS._isLMS(t, i))
+ {
+ SA[--bkt[s.get(i)]] = i;
+ }
+ }
+ SAIS._induceSAl(t, SA, s, bkt, n, K, false);
+ SAIS._induceSAs(t, SA, s, bkt, n, K, true);
+ // compact all the sorted substrings into the first n1 items of SA
+ // 2*n1 must be not larger than n (proveable)
+ var n1 = 0;
+ for (var i = 0; i < n; i++)
+ {
+ if (SAIS._isLMS(t, SA[i]))
+ {
+ SA[n1++] = SA[i];
+ }
+ }
+
+ // find the lexicographic names of all substrings
+ for (var i = n1; i < n; i++)
+ {
+ SA[i]=-1; // init the name array buffer
+ }
+ var name = 0;
+ var prev = -1;
+ for (i = 0; i < n1; i++)
+ {
+ var pos = SA[i];
+ var diff = false;
+ for (var d = 0; d < n; d++)
+ {
+ if (prev == -1 || !s.compare(pos + d, prev + d) || t.get(pos + d) != t.get(prev + d))
+ {
+ diff = true;
+ break;
+ }
+ else if (d > 0 && (SAIS._isLMS(t, pos+d) || SAIS._isLMS(t, prev + d)))
+ {
+ break;
+ }
+ }
+ if (diff)
+ {
+ name++;
+ prev = pos;
+ }
+ pos = (pos % 2 == 0) ? pos / 2 : (pos - 1) / 2;
+ SA[n1 + pos] = name - 1;
+ }
+ for (var i = n - 1, j = n - 1; i >= n1; i--)
+ {
+ if (SA[i] >= 0)
+ {
+ SA[j--] = SA[i];
+ }
+ }
+
+ // stage 2: solve the reduced problem
+ // recurse if names are not yet unique
+ var SA1 = SA;
+ var s1 = new OArray(SA, n - n1);
+
+ if (name < n1)
+ {
+ SAIS._make(s1, SA1, n1, name - 1);
+ }
+ else
+ {
+ // generate the suffix array of s1 directly
+ for (i = 0; i < n1; i++)
+ {
+ SA1[s1.get(i)] = i;
+ }
+ }
+
+ // stage 3: induce the result for the original problem
+
+ bkt = [] : int[];
+ bkt.length = K + 1;
+ // put all left-most S characters into their buckets
+ SAIS._getBuckets(s, bkt, n, K, true); // find ends of buckets
+ for (i = 1, j = 0; i < n; i++)
+ {
+ if (SAIS._isLMS(t, i))
+ {
+ s1.set(j++, i); // get p1
+ }
+ }
+ for (i = 0; i < n1; i++)
+ {
+ SA1[i] = s1.get(SA1[i]); // get index in s
+ }
+ for (i = n1; i < n; i++)
+ {
+ SA[i] = -1; // init SA[n1..n-1]
+ }
+ for (i = n1 - 1; i >= 0; i--)
+ {
+ j = SA[i];
+ SA[i] = -1;
+ SA[--bkt[s.get(j)]] = j;
+ }
+ SAIS._induceSAl(t, SA, s, bkt, n, K, false);
+ SAIS._induceSAs(t, SA, s, bkt, n, K, true);
+ }
+}
diff --git a/web/server/h2o/libh2o/misc/oktavia/src/sax.jsx b/web/server/h2o/libh2o/misc/oktavia/src/sax.jsx
new file mode 100644
index 00000000..d34cb825
--- /dev/null
+++ b/web/server/h2o/libh2o/misc/oktavia/src/sax.jsx
@@ -0,0 +1,1356 @@
+// When we pass the MAX_BUFFER_LENGTH position, start checking for buffer overruns.
+// When we check, schedule the next check for MAX_BUFFER_LENGTH - (max(buffer lengths)),
+// since that's the earliest that a buffer overrun could occur. This way, checks are
+// as rare as required, but as often as necessary to ensure never crossing this bound.
+// Furthermore, buffers are only tested at most once per write(), so passing a very
+// large string into write() might have undesirable effects, but this is manageable by
+// the caller, so it is assumed to be safe. Thus, a call to write() may, in the extreme
+// edge case, result in creating at most one complete copy of the string passed in.
+// Set to Infinity to have unlimited buffers.
+
+
+class Tag
+{
+ var name : string;
+ var attributes : Map.<string>;
+ var isSelfClosing : boolean;
+ function constructor (name : string)
+ {
+ this.name = name;
+ this.attributes = {} : Map.<string>;
+ this.isSelfClosing = false;
+ }
+}
+
+class _Common
+{
+ static const buffers = [
+ "comment", "sgmlDecl", "textNode", "tagName", "doctype",
+ "procInstName", "procInstBody", "entity", "attribName",
+ "attribValue", "cdata", "script"
+ ];
+
+ static const EVENTS = // for discoverability.
+ [ "text",
+ "processinginstruction",
+ "sgmldeclaration",
+ "doctype",
+ "comment",
+ "attribute",
+ "opentag",
+ "closetag",
+ "opencdata",
+ "cdata",
+ "clo_State.CDATA",
+ "error",
+ "end",
+ "ready",
+ "script",
+ "opennamespace",
+ "closenamespace"
+ ];
+
+ static const MAX_BUFFER_LENGTH = 64 * 1024;
+}
+
+class _State
+{
+ static const BEGIN = 1;
+ static const TEXT = 2; // general stuff
+ static const TEXT_ENTITY = 3; // &amp and such.
+ static const OPEN_WAKA = 4; // <
+ static const SGML_DECL = 5; // <!BLARG
+ static const SGML_DECL_QUOTED = 6; // <!BLARG foo "bar
+ static const DOCTYPE = 7; // <!DOCTYPE
+ static const DOCTYPE_QUOTED = 8; // <!DOCTYPE "//blah
+ static const DOCTYPE_DTD = 9; // <!DOCTYPE "//blah" [ ...
+ static const DOCTYPE_DTD_QUOTED = 10; // <!DOCTYPE "//blah" [ "foo
+ static const COMMENT_STARTING = 11; // <!-
+ static const COMMENT = 12; // <!--
+ static const COMMENT_ENDING = 13; // <!-- blah -
+ static const COMMENT_ENDED = 14; // <!-- blah --
+ static const CDATA = 15; // <![CDATA[ something
+ static const CDATA_ENDING = 16; // ]
+ static const CDATA_ENDING_2 = 17; // ]]
+ static const PROC_INST = 18; // <?hi
+ static const PROC_INST_BODY = 19; // <?hi there
+ static const PROC_INST_ENDING = 20; // <?hi "there" ?
+ static const OPEN_TAG = 21; // <strong
+ static const OPEN_TAG_SLASH = 22; // <strong /
+ static const ATTRIB = 23; // <a
+ static const ATTRIB_NAME = 24; // <a foo
+ static const ATTRIB_NAME_SAW_WHITE = 25; // <a foo _
+ static const ATTRIB_VALUE = 26; // <a foo=
+ static const ATTRIB_VALUE_QUOTED = 27; // <a foo="bar
+ static const ATTRIB_VALUE_UNQUOTED = 28; // <a foo=bar
+ static const ATTRIB_VALUE_ENTITY_Q = 29; // <foo bar="&quot;"
+ static const ATTRIB_VALUE_ENTITY_U = 30; // <foo bar=&quot;
+ static const CLOSE_TAG = 31; // </a
+ static const CLOSE_TAG_SAW_WHITE = 32; // </a >
+ static const SCRIPT = 33; // <script> ...
+ static const SCRIPT_ENDING = 34; // <script> ... <
+}
+
+
+class SAXHandler
+{
+ var position : int;
+ var column : int;
+ var line : int;
+ function constructor ()
+ {
+ this.position = 0;
+ this.column = 0;
+ this.line = 0;
+ }
+ function onerror (error : Error) : void
+ {
+ }
+ function ontext (text : string) : void
+ {
+ }
+ function ondoctype (doctype : string) : void
+ {
+ }
+ function onprocessinginstruction (name : string, body : string) : void
+ {
+ }
+ function onsgmldeclaration (sgmlDecl : string) : void
+ {
+ }
+ function onopentag (tagname : string, attributes : Map.<string>) : void
+ {
+ }
+ function onclosetag (tagname : string) : void
+ {
+ }
+ function onattribute (name : string, value : string) : void
+ {
+ }
+ function oncomment (comment : string) : void
+ {
+ }
+ function onopencdata () : void
+ {
+ }
+ function oncdata (cdata : string) : void
+ {
+ }
+ function onclosecdata () : void
+ {
+ }
+ function onend () : void
+ {
+ }
+ function onready () : void
+ {
+ }
+ function onscript (script : string) : void
+ {
+ }
+}
+
+class SAXParser
+{
+ var q : string;
+ var c : string;
+ var bufferCheckPosition : int;
+ var looseCase : string;
+ var tags = [] : Tag[];
+ var closed : boolean;
+ var closedRoot : boolean;
+ var sawRoot : boolean;
+ var tag : Nullable.<Tag>;
+ var error : Nullable.<Error>;
+ var handler : SAXHandler;
+ var ENTITIES : Map.<string>;
+ var strict : boolean;
+ var tagName : string;
+ var state : int;
+ var line : int;
+ var column : int;
+ var position : int;
+ var startTagPosition : int;
+ var attribName : string;
+ var attribValue : string;
+ var script : string;
+ var textNode : string;
+ var attribList : string[][];
+ var noscript : boolean;
+ var cdata : string;
+ var procInstBody : string;
+ var procInstName : string;
+ var doctype : string;
+ var entity : string;
+ var sgmlDecl : string;
+ var comment : string;
+ var preTags : int;
+
+ function constructor(handler : SAXHandler)
+ {
+ this._init(handler, false);
+ }
+
+ function constructor(handler : SAXHandler, strict : boolean)
+ {
+ this._init(handler, strict);
+ }
+
+ function _init (handler : SAXHandler, strict : boolean) : void
+ {
+ this.handler = handler;
+ this.clearBuffers();
+ this.q = "";
+ this.bufferCheckPosition = _Common.MAX_BUFFER_LENGTH;
+ //this.opt = opt || {}
+ //this.opt.lowercase = this.opt.lowercase || this.opt.lowercasetags
+ this.looseCase = 'toLowerCase'; // this.opt.lowercase ? "toLowerCase" : "toUpperCase"
+ this.tags = [] : Tag[];
+ this.closed = this.closedRoot = this.sawRoot = false;
+ this.tag = null;
+ this.error = null;
+ this.strict = strict;
+ this.noscript = strict; //!!(strict || this.opt.noscript);
+ this.state = _State.BEGIN;
+ this.ENTITIES = _Entities.entity_list();
+ this.attribList = [] : string[][];
+ this.noscript = false;
+ this.preTags = 0;
+
+ this.handler.onready();
+ }
+
+ function set_noscript (flag : boolean) : void
+ {
+ this.noscript = flag;
+ }
+
+ function resume () : SAXParser
+ {
+ this.error = null;
+ return this;
+ }
+
+ function close () : SAXParser
+ {
+ return this.parse('');
+ }
+
+ function parse (chunk : string) : SAXParser
+ {
+ var _ = new Char();
+ if (this.error)
+ {
+ throw this.error;
+ }
+ if (this.closed)
+ {
+ return this.emiterror("Cannot write after close. Assign an onready handler.");
+ }
+ var i = 0, c = "";
+ while (this.c = c = chunk.charAt(i++))
+ {
+ this.position++;
+ if (c == "\n")
+ {
+ this.handler.line++;
+ this.handler.column = 0;
+ }
+ else
+ {
+ this.handler.column++;
+ }
+ switch (this.state)
+ {
+ case _State.BEGIN:
+ //log "BEGIN";
+ if (c == "<")
+ {
+ this.state = _State.OPEN_WAKA;
+ this.startTagPosition = this.position;
+ }
+ else if (_.not(_.whitespace, c))
+ {
+ // have to process this as a text node.
+ // weird, but happens.
+ this.strictFail("Non-whitespace before first tag.");
+ this.textNode = c;
+ this.state = _State.TEXT;
+ }
+ continue;
+
+ case _State.TEXT:
+ //log "TEXT";
+ if (this.sawRoot && !this.closedRoot)
+ {
+ var starti = i - 1;
+ while (c && c != "<" && c != "&")
+ {
+ c = chunk.charAt(i++);
+ if (c)
+ {
+ this.position++;
+ if (c == "\n")
+ {
+ this.handler.line++;
+ this.handler.column = 0;
+ }
+ else
+ {
+ this.handler.column++;
+ }
+ }
+ }
+ this.textNode += chunk.substring(starti, i - 1);
+ }
+ if (c == "<")
+ {
+ this.state = _State.OPEN_WAKA;
+ this.startTagPosition = this.position;
+ }
+ else
+ {
+ if (_.not(_.whitespace, c) && (!this.sawRoot || this.closedRoot))
+ this.strictFail("Text data outside of root node.");
+ if (c == "&") this.state = _State.TEXT_ENTITY;
+ else this.textNode += c;
+ }
+ continue;
+
+ case _State.SCRIPT:
+ //log "SCRIPT";
+ // only non-strict
+ if (c == "<") {
+ this.state = _State.SCRIPT_ENDING;
+ } else this.script += c;
+ continue;
+
+ case _State.SCRIPT_ENDING:
+ //log "SCRIPT END";
+ if (c == "/") {
+ this.state = _State.CLOSE_TAG;
+ } else {
+ this.script += "<" + c;
+ this.state = _State.SCRIPT;
+ }
+ continue;
+
+ case _State.OPEN_WAKA:
+ //log "OPEN_WAKA";
+ // either a /, ?, !, or text is coming next.
+ if (c == "!") {
+ this.state = _State.SGML_DECL;
+ this.sgmlDecl = "";
+ } else if (_.is(_.whitespace, c)) {
+ // wait for it...
+ } else if (_.is(_.nameStart,c)) {
+ this.state = _State.OPEN_TAG;
+ this.tagName = c;
+ } else if (c == "/") {
+ this.state = _State.CLOSE_TAG;
+ this.tagName = "";
+ } else if (c == "?") {
+ this.state = _State.PROC_INST;
+ this.procInstName = this.procInstBody = "";
+ } else {
+ this.strictFail("Unencoded <");
+ // if there was some whitespace, then add that in.
+ if (this.startTagPosition + 1 < this.position) {
+ var pad = this.position - this.startTagPosition;
+ for (var i = 0; i < pad; i++)
+ {
+ c = " " + c;
+ }
+ }
+ this.textNode += "<" + c;
+ this.state = _State.TEXT;
+ }
+ continue;
+
+ case _State.SGML_DECL:
+ //log "SGML_DECL";
+ if ((this.sgmlDecl+c).toUpperCase() == _.CDATA) {
+ this.closetext_if_exist();
+ this.handler.onopencdata();
+ this.state = _State.CDATA;
+ this.sgmlDecl = "";
+ this.cdata = "";
+ } else if (this.sgmlDecl+c == "--") {
+ this.state = _State.COMMENT;
+ this.comment = "";
+ this.sgmlDecl = "";
+ } else if ((this.sgmlDecl+c).toUpperCase() == _.DOCTYPE) {
+ this.state = _State.DOCTYPE;
+ if (this.doctype || this.sawRoot)
+ {
+ this.strictFail("Inappropriately located doctype declaration");
+ }
+ this.doctype = "";
+ this.sgmlDecl = "";
+ } else if (c == ">") {
+ this.closetext_if_exist();
+ this.handler.onsgmldeclaration(this.sgmlDecl);
+ this.sgmlDecl = "";
+ this.state = _State.TEXT;
+ } else if (_.is(_.quote, c)) {
+ this.state = _State.SGML_DECL_QUOTED;
+ this.sgmlDecl += c;
+ } else this.sgmlDecl += c;
+ continue;
+
+ case _State.SGML_DECL_QUOTED:
+ //log "SGML_DECL_QUOTED";
+ if (c == this.q) {
+ this.state = _State.SGML_DECL;
+ this.q = "";
+ }
+ this.sgmlDecl += c;
+ continue;
+
+ case _State.DOCTYPE:
+ //log "DOCTYPE";
+ if (c == ">") {
+ this.state = _State.TEXT;
+ this.closetext_if_exist();
+ this.handler.ondoctype(this.doctype.trim());
+ } else {
+ this.doctype += c;
+ if (c == "[") this.state = _State.DOCTYPE_DTD;
+ else if (_.is(_.quote, c)) {
+ this.state = _State.DOCTYPE_QUOTED;
+ this.q = c;
+ }
+ }
+ continue;
+
+ case _State.DOCTYPE_QUOTED:
+ //log "DOCTYPE_QUOTED";
+ this.doctype += c;
+ if (c == this.q) {
+ this.q = "";
+ this.state = _State.DOCTYPE;
+ }
+ continue;
+
+ case _State.DOCTYPE_DTD:
+ //log "DOCTYPE_DTD";
+ this.doctype += c;
+ if (c == "]") this.state = _State.DOCTYPE;
+ else if (_.is(_.quote,c)) {
+ this.state = _State.DOCTYPE_DTD_QUOTED;
+ this.q = c;
+ }
+ continue;
+
+ case _State.DOCTYPE_DTD_QUOTED:
+ //log "DOCTYPE_DTD_QUOTED";
+ this.doctype += c;
+ if (c == this.q) {
+ this.state = _State.DOCTYPE_DTD;
+ this.q = "";
+ }
+ continue;
+
+ case _State.COMMENT:
+ //log "COMMENT";
+ if (c == "-") this.state = _State.COMMENT_ENDING;
+ else this.comment += c;
+ continue;
+
+ case _State.COMMENT_ENDING:
+ //log "COMMENT_ENDING";
+ if (c == "-") {
+ this.state = _State.COMMENT_ENDED;
+ this.comment = this.textopts(this.comment);
+ if (this.comment)
+ {
+ this.closetext_if_exist();
+ this.handler.oncomment(this.comment.trim());
+ }
+ this.comment = "";
+ } else {
+ this.comment += "-" + c;
+ this.state = _State.COMMENT;
+ }
+ continue;
+
+ case _State.COMMENT_ENDED:
+ //log "COMMENT_ENDED";
+ if (c != ">") {
+ this.strictFail("Malformed comment");
+ // allow <!-- blah -- bloo --> in non-strict mode,
+ // which is a comment of " blah -- bloo "
+ this.comment += "--" + c;
+ this.state = _State.COMMENT;
+ } else this.state = _State.TEXT;
+ continue;
+
+ case _State.CDATA:
+ //log "CDATA";
+ if (c == "]") this.state = _State.CDATA_ENDING;
+ else this.cdata += c;
+ continue;
+
+ case _State.CDATA_ENDING:
+ //log "CDATA_ENDING";
+ if (c == "]") this.state = _State.CDATA_ENDING_2;
+ else {
+ this.cdata += "]" + c;
+ this.state = _State.CDATA;
+ }
+ continue;
+
+ case _State.CDATA_ENDING_2:
+ //log "CDATA_ENDING 2";
+ if (c == ">") {
+ if (this.cdata)
+ {
+ this.closetext_if_exist();
+ }
+ this.handler.oncdata(this.cdata);
+ this.handler.onclosecdata();
+ this.cdata = "";
+ this.state = _State.TEXT;
+ } else if (c == "]") {
+ this.cdata += "]";
+ } else {
+ this.cdata += "]]" + c;
+ this.state = _State.CDATA;
+ }
+ continue;
+
+ case _State.PROC_INST:
+ if (c == "?") this.state = _State.PROC_INST_ENDING;
+ else if (_.is(_.whitespace, c)) this.state = _State.PROC_INST_BODY;
+ else this.procInstName += c;
+ continue;
+
+ case _State.PROC_INST_BODY:
+ if (!this.procInstBody && _.is(_.whitespace, c)) continue;
+ else if (c == "?") this.state = _State.PROC_INST_ENDING;
+ else this.procInstBody += c;
+ continue;
+
+ case _State.PROC_INST_ENDING:
+ if (c == ">") {
+ this.closetext_if_exist();
+ this.handler.onprocessinginstruction(this.procInstName, this.procInstBody);
+ this.procInstName = this.procInstBody = "";
+ this.state = _State.TEXT;
+ } else {
+ this.procInstBody += "?" + c;
+ this.state = _State.PROC_INST_BODY;
+ }
+ continue;
+
+ case _State.OPEN_TAG:
+ //log "OPEN TAG";
+ if (_.is(_.nameBody, c)) this.tagName += c;
+ else {
+ this.newTag();
+ if (c == ">") this.openTag();
+ else if (c == "/") this.state = _State.OPEN_TAG_SLASH;
+ else {
+ if (_.not(_.whitespace, c)) this.strictFail("Invalid character in tag name");
+ this.state = _State.ATTRIB;
+ }
+ }
+ continue;
+
+ case _State.OPEN_TAG_SLASH:
+ //log "OPEN TAG SLASH";
+ if (c == ">") {
+ this.openTag(true);
+ this.closeTag();
+ } else {
+ this.strictFail("Forward-slash in opening tag not followed by >");
+ this.state = _State.ATTRIB;
+ }
+ continue;
+
+ case _State.ATTRIB:
+ //log "ATTRIB";
+ // haven't read the attribute name yet.
+ if (_.is(_.whitespace, c)) continue;
+ else if (c == ">") this.openTag();
+ else if (c == "/") this.state = _State.OPEN_TAG_SLASH;
+ else if (_.is(_.nameStart, c)) {
+ this.attribName = c;
+ this.attribValue = "";
+ this.state = _State.ATTRIB_NAME;
+ } else this.strictFail("Invalid attribute name");
+ continue;
+
+ case _State.ATTRIB_NAME:
+ //log "ATTRIB_NAME";
+ if (c == "=") this.state = _State.ATTRIB_VALUE;
+ else if (c == ">") {
+ this.strictFail("Attribute without value");
+ this.attribValue = this.attribName;
+ this.attrib();
+ this.openTag();
+ }
+ else if (_.is(_.whitespace, c)) this.state = _State.ATTRIB_NAME_SAW_WHITE;
+ else if (_.is(_.nameBody, c)) this.attribName += c;
+ else this.strictFail("Invalid attribute name");
+ continue;
+
+ case _State.ATTRIB_NAME_SAW_WHITE:
+ if (c == "=") this.state = _State.ATTRIB_VALUE;
+ else if (_.is(_.whitespace, c)) continue;
+ else {
+ this.strictFail( "Attribute without value");
+ this.tag.attributes[this.attribName] = "";
+ this.attribValue = "";
+ this.closetext_if_exist();
+ this.handler.onattribute(this.attribName, "");
+ this.attribName = "";
+ if (c == ">") this.openTag();
+ else if (_.is(_.nameStart, c)) {
+ this.attribName = c;
+ this.state = _State.ATTRIB_NAME;
+ } else {
+ this.strictFail("Invalid attribute name");
+ this.state = _State.ATTRIB;
+ }
+ }
+ continue;
+
+ case _State.ATTRIB_VALUE:
+ if (_.is(_.whitespace, c)) continue;
+ else if (_.is(_.quote, c)) {
+ this.q = c;
+ this.state = _State.ATTRIB_VALUE_QUOTED;
+ } else {
+ this.strictFail("Unquoted attribute value");
+ this.state = _State.ATTRIB_VALUE_UNQUOTED;
+ this.attribValue = c;
+ }
+ continue;
+
+ case _State.ATTRIB_VALUE_QUOTED:
+ if (c != this.q) {
+ if (c == "&") this.state = _State.ATTRIB_VALUE_ENTITY_Q;
+ else this.attribValue += c;
+ continue;
+ }
+ this.attrib();
+ this.q = "";
+ this.state = _State.ATTRIB;
+ continue;
+
+ case _State.ATTRIB_VALUE_UNQUOTED:
+ if (_.not(_.attribEnd,c)) {
+ if (c == "&") this.state = _State.ATTRIB_VALUE_ENTITY_U;
+ else this.attribValue += c;
+ continue;
+ }
+ this.attrib();
+ if (c == ">") this.openTag();
+ else this.state = _State.ATTRIB;
+ continue;
+
+ case _State.CLOSE_TAG:
+ //log "CLOSE_TAG", c;
+ if (!this.tagName)
+ {
+ if (_.is(_.whitespace, c))
+ {
+ continue;
+ }
+ else if (_.not(_.nameStart, c))
+ {
+ if (this.script)
+ {
+ this.script += "</" + c;
+ this.state = _State.SCRIPT;
+ }
+ else
+ {
+ this.strictFail("Invalid tagname in closing tag.");
+ }
+ }
+ else
+ {
+ this.tagName = c;
+ }
+ }
+ else if (c == ">")
+ {
+ this.closeTag();
+ }
+ else if (_.is(_.nameBody, c))
+ {
+ this.tagName += c;
+ }
+ else if (this.script)
+ {
+ this.script += "</" + this.tagName;
+ this.tagName = "";
+ this.state = _State.SCRIPT;
+ }
+ else
+ {
+ if (_.not(_.whitespace, c))
+ {
+ this.strictFail("Invalid tagname in closing tag");
+ }
+ this.state = _State.CLOSE_TAG_SAW_WHITE;
+ }
+ continue;
+
+ case _State.CLOSE_TAG_SAW_WHITE:
+ if (_.is(_.whitespace, c)) continue;
+ if (c == ">") this.closeTag();
+ else this.strictFail("Invalid characters in closing tag");
+ continue;
+
+ case _State.TEXT_ENTITY:
+ //log "TEXT_ENTITY";
+ if (c == ";") {
+ this.textNode += this.parseEntity();
+ this.entity = "";
+ this.state = _State.TEXT;
+ }
+ else if (_.is(_.entity, c)) this.entity += c;
+ else {
+ this.strictFail("Invalid character entity");
+ this.textNode += "&" + this.entity + c;
+ this.entity = "";
+ this.state = _State.TEXT;
+ }
+ continue;
+
+ case _State.ATTRIB_VALUE_ENTITY_Q:
+ case _State.ATTRIB_VALUE_ENTITY_U:
+ var returnState;
+ if (this.state == _State.ATTRIB_VALUE_ENTITY_Q)
+ {
+ returnState = _State.ATTRIB_VALUE_QUOTED;
+ }
+ else
+ {
+ returnState = _State.ATTRIB_VALUE_UNQUOTED;
+ }
+ if (c == ";") {
+ this.attribValue += this.parseEntity();
+ this.entity = "";
+ this.state = returnState;
+ }
+ else if (_.is(_.entity, c)) this.entity += c;
+ else {
+ this.strictFail("Invalid character entity");
+ this.attribValue += "&" + this.entity + c;
+ this.entity = "";
+ this.state = returnState;
+ }
+ continue;
+
+ default:
+ throw new Error("Unknown state: " + (this.state as string));
+ }
+ }
+ this.end();
+ return this;
+ }
+
+ function clearBuffers () : void
+ {
+ this.comment = '';
+ this.sgmlDecl = '';
+ this.textNode = '';
+ this.tagName = '';
+ this.doctype = '';
+ this.procInstName = '';
+ this.procInstBody = '';
+ this.entity = '';
+ this.attribName = '';
+ this.attribValue = '';
+ this.cdata = '';
+ this.script = '';
+ }
+
+ function closetext_if_exist() : void
+ {
+ if (this.textNode != '')
+ {
+ this.closetext();
+ }
+ }
+
+ function closetext () : void
+ {
+ if (this.preTags == 0)
+ {
+ var text = this.textopts(this.textNode);
+ if (text)
+ {
+ this.handler.ontext(text);
+ }
+ }
+ else if (this.textNode)
+ {
+ this.handler.ontext(this.textNode);
+ }
+ this.textNode = "";
+ }
+
+ function textopts (text : string) : string
+ {
+ text = text.replace(/[\n\t]/g, ' ');
+ text = text.replace(/\s\s+/g, " ");
+ return text;
+ }
+
+ function emiterror (er : string) : SAXParser
+ {
+ this.closetext();
+ er += "\nLine: " + (this.line as string) +
+ "\nColumn: " + (this.column as string) +
+ "\nChar: " + this.c;
+ var error = new Error(er);
+ this.error = error;
+ this.handler.onerror(error);
+ return this;
+ }
+
+ function end () : void
+ {
+ if (!this.closedRoot)
+ {
+ this.strictFail("Unclosed root tag");
+ }
+ if (this.state != _State.TEXT)
+ {
+ this.emiterror("Unexpected end");
+ }
+ this.closetext();
+ this.c = "";
+ this.closed = true;
+ this.handler.onend();
+ }
+
+ function strictFail (message : string) : void
+ {
+ if (this.strict)
+ {
+ this.emiterror(message);
+ }
+ }
+
+ function newTag () : void
+ {
+ if (!this.strict) this.tagName = this.tagName.toLowerCase();
+ var parent = this.tags[this.tags.length - 1] || this;
+ var tag = this.tag = new Tag(this.tagName);
+ this.attribList.length = 0;
+ }
+
+ function attrib () : void
+ {
+ if (!this.strict) this.attribName = this.attribName.toLowerCase();
+
+ if (this.tag.attributes.hasOwnProperty(this.attribName)) {
+ this.attribName = this.attribValue = "";
+ return;
+ }
+
+ this.tag.attributes[this.attribName] = this.attribValue;
+ this.closetext_if_exist();
+ this.handler.onattribute(this.attribName, this.attribValue);
+ this.attribName = this.attribValue = "";
+ }
+
+ function openTag () : void
+ {
+ this.openTag(false);
+ }
+
+ function openTag (selfClosing : boolean) : void
+ {
+ this.tag.isSelfClosing = selfClosing;
+
+ // process the tag
+ this.sawRoot = true;
+ this.tags.push(this.tag);
+ this.closetext_if_exist();
+ this.handler.onopentag(this.tag.name, this.tag.attributes);
+ if (this.tag.name == 'pre')
+ {
+ this.preTags++;
+ }
+ if (!selfClosing)
+ {
+ // special case for <script> in non-strict mode.
+ if (!this.noscript && this.tagName.toLowerCase() == "script")
+ {
+ this.state = _State.SCRIPT;
+ }
+ else
+ {
+ this.state = _State.TEXT;
+ }
+ this.tag = null;
+ this.tagName = "";
+ }
+ this.attribName = this.attribValue = "";
+ this.attribList.length = 0;
+ }
+
+ function closeTag () : void
+ {
+ if (!this.tagName)
+ {
+ this.strictFail("Weird empty close tag.");
+ this.textNode += "</>";
+ this.state = _State.TEXT;
+ return;
+ }
+
+ if (this.script)
+ {
+ if (this.tagName != "script")
+ {
+ this.script += "</" + this.tagName + ">";
+ this.tagName = "";
+ this.state = _State.SCRIPT;
+ return;
+ }
+ this.closetext_if_exist();
+ this.handler.onscript(this.script);
+ this.script = "";
+ }
+
+ // first make sure that the closing tag actually exists.
+ // <a><b></c></b></a> will close everything, otherwise.
+ var t = this.tags.length;
+ var tagName = this.tagName;
+ if (!this.strict) tagName = tagName.toLowerCase();
+ var closeTo = tagName;
+ while (t --) {
+ var close = this.tags[t];
+ if (close.name != closeTo) {
+ // fail the first time in strict mode
+ this.strictFail("Unexpected close tag");
+ } else break;
+ }
+
+ // didn't find it. we already failed for strict, so just abort.
+ if (t < 0)
+ {
+ this.strictFail("Unmatched closing tag: "+this.tagName);
+ this.textNode += "</" + this.tagName + ">";
+ this.state = _State.TEXT;
+ return;
+ }
+ this.tagName = tagName;
+ var s = this.tags.length;
+ while (s --> t)
+ {
+ var tag = this.tag = this.tags.pop();
+ this.tagName = this.tag.name;
+ this.closetext_if_exist();
+ this.handler.onclosetag(this.tagName);
+ var parent = this.tags[this.tags.length - 1];
+ if (this.tagName == 'pre')
+ {
+ this.preTags--;
+ }
+ }
+ if (t == 0)
+ {
+ this.closedRoot = true;
+ }
+ this.tagName = this.attribValue = this.attribName = "";
+ this.attribList.length = 0;
+ this.state = _State.TEXT;
+ }
+
+ function parseEntity () : string
+ {
+ var entity = this.entity;
+ var entityLC = entity.toLowerCase();
+ var num = 0;
+ var numStr = "";
+ if (this.ENTITIES[entity])
+ {
+ return this.ENTITIES[entity];
+ }
+ if (this.ENTITIES[entityLC])
+ {
+ return this.ENTITIES[entityLC];
+ }
+ entity = entityLC;
+ if (entity.charAt(0) == "#")
+ {
+ if (entity.charAt(1) == "x")
+ {
+ entity = entity.slice(2);
+ num = Number.parseInt(entity, 16);
+ numStr = num.toString(16);
+ }
+ else
+ {
+ entity = entity.slice(1);
+ num = Number.parseInt(entity, 10);
+ numStr = num.toString(10);
+ }
+ }
+ entity = entity.replace(/^0+/, "");
+ if (numStr.toLowerCase() != entity) {
+ this.strictFail("Invalid character entity");
+ return "&"+this.entity + ";";
+ }
+ return String.fromCharCode(num);
+ }
+}
+
+class Char
+{
+ var whitespace : Map.<boolean>;
+ var number : Map.<boolean>;
+ var letter : Map.<boolean>;
+ var quote : Map.<boolean>;
+ var entity : Map.<boolean>;
+ var attribEnd : Map.<boolean>;
+ var nameStart : RegExp;
+ var nameBody : RegExp;
+ var CDATA : string;
+ var DOCTYPE : string;
+ var XML_NAMESPACE : string;
+
+ function constructor()
+ {
+ // character classes and tokens
+ var whitespace = "\r\n\t ";
+ // this really needs to be replaced with character classes.
+ // XML allows all manner of ridiculous numbers and digits.
+ var number = "0124356789";
+ var letter = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
+ // (Letter | "_" | ":")
+ var quote = "'\"";
+ var entity = number+letter+"#";
+ var attribEnd = whitespace + ">";
+ this.CDATA = "[CDATA[";
+ this.DOCTYPE = "DOCTYPE";
+ this.XML_NAMESPACE = "http://www.w3.org/XML/1998/namespace";
+
+ // turn all the string character sets into character class objects.
+ this.whitespace = this._charClass(whitespace);
+ this.number = this._charClass(number);
+ this.letter = this._charClass(letter);
+ this.quote = this._charClass(quote);
+ this.entity = this._charClass(entity);
+ this.attribEnd = this._charClass(attribEnd);
+ this.nameStart = /[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/;
+
+ this.nameBody = /[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040\.\d-]/;
+ }
+
+ function _charClass (str : string) : Map.<boolean>
+ {
+ var result = {} : Map.<boolean>;
+ for (var i = 0; i < str.length; i++)
+ {
+ result[str.slice(i, i + 1)] = true;
+ }
+ return result;
+ }
+
+ function is (charclass : RegExp, c : string) : boolean
+ {
+ return charclass.test(c);
+ }
+
+ function is (charclass : Map.<boolean>, c : string) : boolean
+ {
+ return charclass.hasOwnProperty(c);
+ }
+
+ function not (charclass : RegExp, c : string) : boolean {
+ return !this.is(charclass, c);
+ }
+
+ function not (charclass : Map.<boolean>, c : string) : boolean {
+ return !this.is(charclass, c);
+ }
+}
+
+
+class _Entities
+{
+ static const _entities = {
+ "amp" : "&",
+ "gt" : ">",
+ "lt" : "<",
+ "quot" : "\"",
+ "apos" : "'",
+ "AElig" : 198,
+ "Aacute" : 193,
+ "Acirc" : 194,
+ "Agrave" : 192,
+ "Aring" : 197,
+ "Atilde" : 195,
+ "Auml" : 196,
+ "Ccedil" : 199,
+ "ETH" : 208,
+ "Eacute" : 201,
+ "Ecirc" : 202,
+ "Egrave" : 200,
+ "Euml" : 203,
+ "Iacute" : 205,
+ "Icirc" : 206,
+ "Igrave" : 204,
+ "Iuml" : 207,
+ "Ntilde" : 209,
+ "Oacute" : 211,
+ "Ocirc" : 212,
+ "Ograve" : 210,
+ "Oslash" : 216,
+ "Otilde" : 213,
+ "Ouml" : 214,
+ "THORN" : 222,
+ "Uacute" : 218,
+ "Ucirc" : 219,
+ "Ugrave" : 217,
+ "Uuml" : 220,
+ "Yacute" : 221,
+ "aacute" : 225,
+ "acirc" : 226,
+ "aelig" : 230,
+ "agrave" : 224,
+ "aring" : 229,
+ "atilde" : 227,
+ "auml" : 228,
+ "ccedil" : 231,
+ "eacute" : 233,
+ "ecirc" : 234,
+ "egrave" : 232,
+ "eth" : 240,
+ "euml" : 235,
+ "iacute" : 237,
+ "icirc" : 238,
+ "igrave" : 236,
+ "iuml" : 239,
+ "ntilde" : 241,
+ "oacute" : 243,
+ "ocirc" : 244,
+ "ograve" : 242,
+ "oslash" : 248,
+ "otilde" : 245,
+ "ouml" : 246,
+ "szlig" : 223,
+ "thorn" : 254,
+ "uacute" : 250,
+ "ucirc" : 251,
+ "ugrave" : 249,
+ "uuml" : 252,
+ "yacute" : 253,
+ "yuml" : 255,
+ "copy" : 169,
+ "reg" : 174,
+ "nbsp" : 160,
+ "iexcl" : 161,
+ "cent" : 162,
+ "pound" : 163,
+ "curren" : 164,
+ "yen" : 165,
+ "brvbar" : 166,
+ "sect" : 167,
+ "uml" : 168,
+ "ordf" : 170,
+ "laquo" : 171,
+ "not" : 172,
+ "shy" : 173,
+ "macr" : 175,
+ "deg" : 176,
+ "plusmn" : 177,
+ "sup1" : 185,
+ "sup2" : 178,
+ "sup3" : 179,
+ "acute" : 180,
+ "micro" : 181,
+ "para" : 182,
+ "middot" : 183,
+ "cedil" : 184,
+ "ordm" : 186,
+ "raquo" : 187,
+ "frac14" : 188,
+ "frac12" : 189,
+ "frac34" : 190,
+ "iquest" : 191,
+ "times" : 215,
+ "divide" : 247,
+ "OElig" : 338,
+ "oelig" : 339,
+ "Scaron" : 352,
+ "scaron" : 353,
+ "Yuml" : 376,
+ "fnof" : 402,
+ "circ" : 710,
+ "tilde" : 732,
+ "Alpha" : 913,
+ "Beta" : 914,
+ "Gamma" : 915,
+ "Delta" : 916,
+ "Epsilon" : 917,
+ "Zeta" : 918,
+ "Eta" : 919,
+ "Theta" : 920,
+ "Iota" : 921,
+ "Kappa" : 922,
+ "Lambda" : 923,
+ "Mu" : 924,
+ "Nu" : 925,
+ "Xi" : 926,
+ "Omicron" : 927,
+ "Pi" : 928,
+ "Rho" : 929,
+ "Sigma" : 931,
+ "Tau" : 932,
+ "Upsilon" : 933,
+ "Phi" : 934,
+ "Chi" : 935,
+ "Psi" : 936,
+ "Omega" : 937,
+ "alpha" : 945,
+ "beta" : 946,
+ "gamma" : 947,
+ "delta" : 948,
+ "epsilon" : 949,
+ "zeta" : 950,
+ "eta" : 951,
+ "theta" : 952,
+ "iota" : 953,
+ "kappa" : 954,
+ "lambda" : 955,
+ "mu" : 956,
+ "nu" : 957,
+ "xi" : 958,
+ "omicron" : 959,
+ "pi" : 960,
+ "rho" : 961,
+ "sigmaf" : 962,
+ "sigma" : 963,
+ "tau" : 964,
+ "upsilon" : 965,
+ "phi" : 966,
+ "chi" : 967,
+ "psi" : 968,
+ "omega" : 969,
+ "thetasym" : 977,
+ "upsih" : 978,
+ "piv" : 982,
+ "ensp" : 8194,
+ "emsp" : 8195,
+ "thinsp" : 8201,
+ "zwnj" : 8204,
+ "zwj" : 8205,
+ "lrm" : 8206,
+ "rlm" : 8207,
+ "ndash" : 8211,
+ "mdash" : 8212,
+ "lsquo" : 8216,
+ "rsquo" : 8217,
+ "sbquo" : 8218,
+ "ldquo" : 8220,
+ "rdquo" : 8221,
+ "bdquo" : 8222,
+ "dagger" : 8224,
+ "Dagger" : 8225,
+ "bull" : 8226,
+ "hellip" : 8230,
+ "permil" : 8240,
+ "prime" : 8242,
+ "Prime" : 8243,
+ "lsaquo" : 8249,
+ "rsaquo" : 8250,
+ "oline" : 8254,
+ "frasl" : 8260,
+ "euro" : 8364,
+ "image" : 8465,
+ "weierp" : 8472,
+ "real" : 8476,
+ "trade" : 8482,
+ "alefsym" : 8501,
+ "larr" : 8592,
+ "uarr" : 8593,
+ "rarr" : 8594,
+ "darr" : 8595,
+ "harr" : 8596,
+ "crarr" : 8629,
+ "lArr" : 8656,
+ "uArr" : 8657,
+ "rArr" : 8658,
+ "dArr" : 8659,
+ "hArr" : 8660,
+ "forall" : 8704,
+ "part" : 8706,
+ "exist" : 8707,
+ "empty" : 8709,
+ "nabla" : 8711,
+ "isin" : 8712,
+ "notin" : 8713,
+ "ni" : 8715,
+ "prod" : 8719,
+ "sum" : 8721,
+ "minus" : 8722,
+ "lowast" : 8727,
+ "radic" : 8730,
+ "prop" : 8733,
+ "infin" : 8734,
+ "ang" : 8736,
+ "and" : 8743,
+ "or" : 8744,
+ "cap" : 8745,
+ "cup" : 8746,
+ "int" : 8747,
+ "there4" : 8756,
+ "sim" : 8764,
+ "cong" : 8773,
+ "asymp" : 8776,
+ "ne" : 8800,
+ "equiv" : 8801,
+ "le" : 8804,
+ "ge" : 8805,
+ "sub" : 8834,
+ "sup" : 8835,
+ "nsub" : 8836,
+ "sube" : 8838,
+ "supe" : 8839,
+ "oplus" : 8853,
+ "otimes" : 8855,
+ "perp" : 8869,
+ "sdot" : 8901,
+ "lceil" : 8968,
+ "rceil" : 8969,
+ "lfloor" : 8970,
+ "rfloor" : 8971,
+ "lang" : 9001,
+ "rang" : 9002,
+ "loz" : 9674,
+ "spades" : 9824,
+ "clubs" : 9827,
+ "hearts" : 9829,
+ "diams" : 9830
+ } : Map.<variant>;
+
+ static function entity_list () : Map.<string>
+ {
+ var result = {} : Map.<string>;
+ for (var key in _Entities._entities)
+ {
+ var value : variant = _Entities._entities[key];
+ if (typeof(value) == 'string')
+ {
+ result[key] = value as string;
+ }
+ else if (typeof(value) == 'number')
+ {
+ result[key] = String.fromCharCode(value as int);
+ }
+ }
+ return result;
+ }
+}
+
diff --git a/web/server/h2o/libh2o/misc/oktavia/src/search-result.jsx b/web/server/h2o/libh2o/misc/oktavia/src/search-result.jsx
new file mode 100644
index 00000000..fb9721fa
--- /dev/null
+++ b/web/server/h2o/libh2o/misc/oktavia/src/search-result.jsx
@@ -0,0 +1,287 @@
+import "oktavia.jsx";
+
+class Proposal
+{
+ var omit : int;
+ var expect : int;
+ function constructor (omit : int, expect : int)
+ {
+ this.omit = omit;
+ this.expect = expect;
+ }
+}
+
+class Position
+{
+ var word : string;
+ var position : int;
+ var stemmed : boolean;
+ function constructor (word : string, position : int, stemmed : boolean)
+ {
+ this.word = word;
+ this.position = position;
+ this.stemmed = stemmed;
+ }
+}
+
+class SearchUnit
+{
+ var positions : Map.<Position>;
+ var id : int;
+ var _size : int;
+ var score : int;
+ var startPosition : int;
+
+ function constructor (id : int)
+ {
+ this.positions = {} : Map.<Position>;
+ this.id = id;
+ this._size = 0;
+ this.score = 0;
+ this.startPosition = -1;
+ }
+
+ function addPosition (word : string, position : int, stemmed : boolean) : void
+ {
+ var positionObj = this.positions[position as string];
+ if (!positionObj)
+ {
+ this._size++;
+ this.positions[position as string] = new Position(word, position, stemmed);
+ }
+ else
+ {
+ if (positionObj.word.length < word.length)
+ {
+ positionObj.word = word;
+ }
+ positionObj.stemmed = positionObj.stemmed && stemmed;
+ }
+ }
+
+ function get (position : int) : Nullable.<Position>
+ {
+ return this.positions[position as string];
+ }
+
+ function size () : int
+ {
+ return this._size;
+ }
+
+ function merge (rhs : SearchUnit) : void
+ {
+ for (var position in rhs.positions)
+ {
+ var pos = rhs.positions[position];
+ this.addPosition(pos.word, pos.position, pos.stemmed);
+ }
+ }
+
+ function getPositions () : Position[]
+ {
+ var result = [] : Position[];
+ for (var pos in this.positions)
+ {
+ result.push(this.positions[pos]);
+ }
+ result.sort((a : Position, b : Position) -> ((a.position - b.position) as number));
+ return result;
+ }
+}
+
+class SingleResult
+{
+ var units : SearchUnit[];
+ var unitIds : int[];
+ var or : boolean;
+ var not : boolean;
+ var searchWord : string;
+
+ function constructor ()
+ {
+ this.units = [] : SearchUnit[];
+ this.unitIds = [] : int[];
+ this.or = false;
+ this.not = false;
+ this.searchWord = '';
+ }
+
+ function constructor (searchWord : string, or : boolean, not : boolean)
+ {
+ this.units = [] : SearchUnit[];
+ this.unitIds = [] : int[];
+ this.or = or;
+ this.not = not;
+ this.searchWord = searchWord;
+ }
+
+ function getSearchUnit (unitId : int) : SearchUnit
+ {
+ var existing = this.unitIds.indexOf(unitId);
+ var result : SearchUnit;
+ if (existing == -1)
+ {
+ result = new SearchUnit(unitId);
+ this.units.push(result);
+ this.unitIds.push(unitId);
+ }
+ else
+ {
+ result = this.units[existing];
+ }
+ return result;
+ }
+
+ function merge (rhs : SingleResult) : SingleResult
+ {
+ var result = new SingleResult();
+ if (rhs.or)
+ {
+ this._orMerge(result, rhs);
+ }
+ else if (rhs.not)
+ {
+ this._notMerge(result, rhs);
+ }
+ else
+ {
+ this._andMerge(result, rhs);
+ }
+ return result;
+ }
+
+ function size () : int
+ {
+ return this.units.length;
+ }
+
+ function _andMerge (result : SingleResult, rhs : SingleResult) : void
+ {
+ for (var i = 0; i < this.unitIds.length; i++)
+ {
+ var id = this.unitIds[i];
+ if (rhs.unitIds.indexOf(id) != -1)
+ {
+ var lhsSection = this.units[i];
+ result.unitIds.push(id);
+ result.units.push(lhsSection);
+ }
+ }
+ }
+
+ function _orMerge (result : SingleResult, rhs : SingleResult) : void
+ {
+ result.unitIds = this.unitIds.slice(0, this.unitIds.length);
+ result.units = this.units.slice(0, this.units.length);
+
+ for (var i = 0; i < rhs.unitIds.length; i++)
+ {
+ var id = rhs.unitIds[i];
+ var rhsSection = rhs.units[i];
+ if (result.unitIds.indexOf(id) != -1)
+ {
+ var lhsSection = result.units[result.unitIds.indexOf(id)];
+ lhsSection.merge(rhsSection);
+ }
+ else
+ {
+ result.unitIds.push(id);
+ result.units.push(rhsSection);
+ }
+ }
+ }
+
+ function _notMerge (result : SingleResult, rhs : SingleResult) : void
+ {
+ for (var i = 0; i < this.unitIds.length; i++)
+ {
+ var id = this.unitIds[i];
+ if (rhs.unitIds.indexOf(id) == -1)
+ {
+ var lhsSection = this.units[i];
+ result.unitIds.push(id);
+ result.units.push(lhsSection);
+ }
+ }
+ }
+}
+
+class SearchSummary
+{
+ var sourceResults : SingleResult[];
+ var result : Nullable.<SingleResult>;
+ var oktavia : Nullable.<Oktavia>;
+
+ function constructor()
+ {
+ this.sourceResults = [] : SingleResult[];
+ this.result = null;
+ this.oktavia = null;
+ }
+
+ function constructor (oktavia : Oktavia)
+ {
+ this.sourceResults = [] : SingleResult[];
+ this.result = null;
+ this.oktavia = oktavia;
+ }
+
+ function addQuery(result : SingleResult) : void
+ {
+ this.sourceResults.push(result);
+ }
+
+ function mergeResult () : void
+ {
+ this.result = this.mergeResult(this.sourceResults);
+ }
+
+ function mergeResult (results : SingleResult[]) : SingleResult
+ {
+ var rhs = results[0];
+ for (var i = 1; i < results.length; i++)
+ {
+ rhs = rhs.merge(results[i]);
+ }
+ return rhs;
+ }
+
+ function getProposal () : Proposal[]
+ {
+ var proposals = [] : Proposal[];
+ for (var i = 0; i < this.sourceResults.length; i++)
+ {
+ var tmpSource = [] : SingleResult[];
+ for (var j = 0; j < this.sourceResults.length; j++)
+ {
+ if (i != j)
+ {
+ tmpSource.push(this.sourceResults[j]);
+ }
+ }
+ var result = this.mergeResult(tmpSource);
+ proposals.push(new Proposal(i, result.size()));
+ }
+ proposals.sort((a : Proposal, b : Proposal) -> ((b.expect - a.expect) as number));
+ return proposals;
+ }
+
+ function getSortedResult () : SearchUnit[]
+ {
+ var result = this.result.units.slice(0, this.result.units.length);
+ result.sort((a : SearchUnit, b : SearchUnit) -> ((b.score - a.score) as number));
+ return result;
+ }
+
+ function size () : int
+ {
+ return this.result.size();
+ }
+
+ function add (result : SingleResult) : void
+ {
+ this.sourceResults.push(result);
+ }
+}
+
diff --git a/web/server/h2o/libh2o/misc/oktavia/src/stemmer/among.jsx b/web/server/h2o/libh2o/misc/oktavia/src/stemmer/among.jsx
new file mode 100644
index 00000000..f695b94b
--- /dev/null
+++ b/web/server/h2o/libh2o/misc/oktavia/src/stemmer/among.jsx
@@ -0,0 +1,34 @@
+import "base-stemmer.jsx";
+
+class Among
+{
+ var s_size : int; /* search string */
+ var s : string; /* search string */
+ var substring_i : int; /* index to longest matching substring */
+ var result : int; /* result of the lookup */
+ var instance : Nullable.<BaseStemmer> ;
+ /* object to invoke method on. It is a BaseStemmer */
+ var method : Nullable.<(BaseStemmer) -> boolean>;
+ /* method to use if substring matches */
+
+ function constructor (s : string, substring_i : int, result : int)
+ {
+ this.s_size = s.length;
+ this.s = s;
+ this.substring_i = substring_i;
+ this.result = result;
+ this.method = null;
+ this.instance = null;
+ }
+
+ function constructor (s : string, substring_i : int, result : int,
+ method : (BaseStemmer) -> boolean, instance : BaseStemmer)
+ {
+ this.s_size = s.length;
+ this.s = s;
+ this.substring_i = substring_i;
+ this.result = result;
+ this.method = method;
+ this.instance = instance;
+ }
+}
diff --git a/web/server/h2o/libh2o/misc/oktavia/src/stemmer/base-stemmer.jsx b/web/server/h2o/libh2o/misc/oktavia/src/stemmer/base-stemmer.jsx
new file mode 100644
index 00000000..dfc0d6ea
--- /dev/null
+++ b/web/server/h2o/libh2o/misc/oktavia/src/stemmer/base-stemmer.jsx
@@ -0,0 +1,419 @@
+import "stemmer.jsx";
+import "among.jsx";
+
+class BaseStemmer implements Stemmer
+{
+ // this.current string
+ var current : string;
+ var cursor : int;
+ var limit : int;
+ var limit_backward : int;
+ var bra : int;
+ var ket : int;
+ var cache : Map.<string>;
+
+ function constructor ()
+ {
+ this.cache = {} : Map.<string>;
+ this.setCurrent("");
+ }
+
+ /**
+ * Set the this.current string.
+ */
+ function setCurrent (value : string) : void
+ {
+ this.current = value;
+ this.cursor = 0;
+ this.limit = this.current.length;
+ this.limit_backward = 0;
+ this.bra = this.cursor;
+ this.ket = this.limit;
+ }
+
+ /**
+ * Get the this.current string.
+ */
+ function getCurrent () : string
+ {
+ return this.current;
+ }
+
+
+ function copy_from (other : BaseStemmer) : void
+ {
+ this.current = other.current;
+ this.cursor = other.cursor;
+ this.limit = other.limit;
+ this.limit_backward = other.limit_backward;
+ this.bra = other.bra;
+ this.ket = other.ket;
+ }
+
+ function in_grouping (s : int[], min : int, max : int) : boolean
+ {
+ if (this.cursor >= this.limit) return false;
+ var ch = this.current.charCodeAt(this.cursor);
+ if (ch > max || ch < min) return false;
+ ch -= min;
+ if ((s[ch >>> 3] & (0x1 << (ch & 0x7))) == 0) return false;
+ this.cursor++;
+ return true;
+ }
+
+ function in_grouping_b (s : int[], min : int, max : int) : boolean
+ {
+ if (this.cursor <= this.limit_backward) return false;
+ var ch = this.current.charCodeAt(this.cursor - 1);
+ if (ch > max || ch < min) return false;
+ ch -= min;
+ if ((s[ch >>> 3] & (0x1 << (ch & 0x7))) == 0) return false;
+ this.cursor--;
+ return true;
+ }
+
+ function out_grouping (s : int[], min : int, max : int) : boolean
+ {
+ if (this.cursor >= this.limit) return false;
+ var ch = this.current.charCodeAt(this.cursor);
+ if (ch > max || ch < min) {
+ this.cursor++;
+ return true;
+ }
+ ch -= min;
+ if ((s[ch >>> 3] & (0X1 << (ch & 0x7))) == 0) {
+ this.cursor++;
+ return true;
+ }
+ return false;
+ }
+
+ function out_grouping_b (s : int[], min : int, max : int) : boolean
+ {
+ if (this.cursor <= this.limit_backward) return false;
+ var ch = this.current.charCodeAt(this.cursor - 1);
+ if (ch > max || ch < min) {
+ this.cursor--;
+ return true;
+ }
+ ch -= min;
+ if ((s[ch >>> 3] & (0x1 << (ch & 0x7))) == 0) {
+ this.cursor--;
+ return true;
+ }
+ return false;
+ }
+
+ function in_range (min : int, max : int) : boolean
+ {
+ if (this.cursor >= this.limit) return false;
+ var ch = this.current.charCodeAt(this.cursor);
+ if (ch > max || ch < min) return false;
+ this.cursor++;
+ return true;
+ }
+
+ function in_range_b (min : int, max : int) : boolean
+ {
+ if (this.cursor <= this.limit_backward) return false;
+ var ch = this.current.charCodeAt(this.cursor - 1);
+ if (ch > max || ch < min) return false;
+ this.cursor--;
+ return true;
+ }
+
+ function out_range (min : int, max : int) : boolean
+ {
+ if (this.cursor >= this.limit) return false;
+ var ch = this.current.charCodeAt(this.cursor);
+ if (!(ch > max || ch < min)) return false;
+ this.cursor++;
+ return true;
+ }
+
+ function out_range_b (min : int, max : int) : boolean
+ {
+ if (this.cursor <= this.limit_backward) return false;
+ var ch = this.current.charCodeAt(this.cursor - 1);
+ if(!(ch > max || ch < min)) return false;
+ this.cursor--;
+ return true;
+ }
+
+ function eq_s (s_size : int, s : string) : boolean
+ {
+ if (this.limit - this.cursor < s_size) return false;
+ if (this.current.slice(this.cursor, this.cursor + s_size) != s)
+ {
+ return false;
+ }
+ this.cursor += s_size;
+ return true;
+ }
+
+ function eq_s_b (s_size : int, s : string) : boolean
+ {
+ if (this.cursor - this.limit_backward < s_size) return false;
+ if (this.current.slice(this.cursor - s_size, this.cursor) != s)
+ {
+ return false;
+ }
+ this.cursor -= s_size;
+ return true;
+ }
+
+ function eq_v (s : string) : boolean
+ {
+ return this.eq_s(s.length, s);
+ }
+
+ function eq_v_b (s : string) : boolean
+ {
+ return this.eq_s_b(s.length, s);
+ }
+
+ function find_among (v : Among[], v_size : int) : int
+ {
+ var i = 0;
+ var j = v_size;
+
+ var c = this.cursor;
+ var l = this.limit;
+
+ var common_i = 0;
+ var common_j = 0;
+
+ var first_key_inspected = false;
+
+ while (true)
+ {
+ var k = i + ((j - i) >>> 1);
+ var diff = 0;
+ var common = common_i < common_j ? common_i : common_j; // smaller
+ var w = v[k];
+ var i2;
+ for (i2 = common; i2 < w.s_size; i2++)
+ {
+ if (c + common == l)
+ {
+ diff = -1;
+ break;
+ }
+ diff = this.current.charCodeAt(c + common) - w.s.charCodeAt(i2);
+ if (diff != 0) break;
+ common++;
+ }
+ if (diff < 0)
+ {
+ j = k;
+ common_j = common;
+ }
+ else
+ {
+ i = k;
+ common_i = common;
+ }
+ if (j - i <= 1)
+ {
+ if (i > 0) break; // v->s has been inspected
+ if (j == i) break; // only one item in v
+
+ // - but now we need to go round once more to get
+ // v->s inspected. This looks messy, but is actually
+ // the optimal approach.
+
+ if (first_key_inspected) break;
+ first_key_inspected = true;
+ }
+ }
+ while (true)
+ {
+ var w = v[i];
+ if (common_i >= w.s_size)
+ {
+ this.cursor = c + w.s_size;
+ if (w.method == null)
+ {
+ return w.result;
+ }
+ var res = w.method(w.instance);
+ this.cursor = c + w.s_size;
+ if (res)
+ {
+ return w.result;
+ }
+ }
+ i = w.substring_i;
+ if (i < 0) return 0;
+ }
+ return -1; // not reachable
+ }
+
+ // find_among_b is for backwards processing. Same comments apply
+ function find_among_b (v : Among[], v_size : int) : int
+ {
+ var i = 0;
+ var j = v_size;
+
+ var c = this.cursor;
+ var lb = this.limit_backward;
+
+ var common_i = 0;
+ var common_j = 0;
+
+ var first_key_inspected = false;
+
+ while (true)
+ {
+ var k = i + ((j - i) >> 1);
+ var diff = 0;
+ var common = common_i < common_j ? common_i : common_j;
+ var w = v[k];
+ var i2;
+ for (i2 = w.s_size - 1 - common; i2 >= 0; i2--)
+ {
+ if (c - common == lb)
+ {
+ diff = -1;
+ break;
+ }
+ diff = this.current.charCodeAt(c - 1 - common) - w.s.charCodeAt(i2);
+ if (diff != 0) break;
+ common++;
+ }
+ if (diff < 0)
+ {
+ j = k;
+ common_j = common;
+ }
+ else
+ {
+ i = k;
+ common_i = common;
+ }
+ if (j - i <= 1)
+ {
+ if (i > 0) break;
+ if (j == i) break;
+ if (first_key_inspected) break;
+ first_key_inspected = true;
+ }
+ }
+ while (true)
+ {
+ var w = v[i];
+ if (common_i >= w.s_size)
+ {
+ this.cursor = c - w.s_size;
+ if (w.method == null) return w.result;
+ var res = w.method(this);
+ this.cursor = c - w.s_size;
+ if (res) return w.result;
+ }
+ i = w.substring_i;
+ if (i < 0) return 0;
+ }
+ return -1; // not reachable
+ }
+
+ /* to replace chars between c_bra and c_ket in this.current by the
+ * chars in s.
+ */
+ function replace_s (c_bra : int, c_ket : int, s : string) : int
+ {
+ var adjustment = s.length - (c_ket - c_bra);
+ this.current = this.current.slice(0, c_bra) + s + this.current.slice(c_ket);
+ this.limit += adjustment;
+ if (this.cursor >= c_ket) this.cursor += adjustment;
+ else if (this.cursor > c_bra) this.cursor = c_bra;
+ return adjustment;
+ }
+
+ function slice_check () : boolean
+ {
+ if (this.bra < 0 ||
+ this.bra > this.ket ||
+ this.ket > this.limit ||
+ this.limit > this.current.length)
+ {
+ return false;
+ }
+ return true;
+ }
+
+ function slice_from (s : string) : boolean
+ {
+ var result = false;
+ if (this.slice_check())
+ {
+ this.replace_s(this.bra, this.ket, s);
+ result = true;
+ }
+ return result;
+ }
+
+ function slice_del () : boolean
+ {
+ return this.slice_from("");
+ }
+
+ function insert (c_bra : int, c_ket : int, s : string) : void
+ {
+ var adjustment = this.replace_s(c_bra, c_ket, s);
+ if (c_bra <= this.bra) this.bra += adjustment;
+ if (c_bra <= this.ket) this.ket += adjustment;
+ }
+
+ /* Copy the slice into the supplied StringBuffer */
+ function slice_to (s : string) : string
+ {
+ var result = '';
+ if (this.slice_check())
+ {
+ result = this.current.slice(this.bra, this.ket);
+ }
+ return result;
+ }
+
+ function assign_to (s : string) : string
+ {
+ return this.current.slice(0, this.limit);
+ }
+
+ function stem () : boolean
+ {
+ return false;
+ }
+
+ override function stemWord (word : string) : string
+ {
+ var result = this.cache['.' + word];
+ if (result == null)
+ {
+ this.setCurrent(word);
+ this.stem();
+ result = this.getCurrent();
+ this.cache['.' + word] = result;
+ }
+ return result;
+ }
+
+ override function stemWords (words : string[]) : string[]
+ {
+ var results = [] : string[];
+ for (var i = 0; i < words.length; i++)
+ {
+ var word = words[i];
+ var result = this.cache['.' + word];
+ if (result == null)
+ {
+ this.setCurrent(word);
+ this.stem();
+ result = this.getCurrent();
+ this.cache['.' + word] = result;
+ }
+ results.push(result);
+ }
+ return results;
+ }
+}
diff --git a/web/server/h2o/libh2o/misc/oktavia/src/stemmer/danish-stemmer.jsx b/web/server/h2o/libh2o/misc/oktavia/src/stemmer/danish-stemmer.jsx
new file mode 100644
index 00000000..ffebd881
--- /dev/null
+++ b/web/server/h2o/libh2o/misc/oktavia/src/stemmer/danish-stemmer.jsx
@@ -0,0 +1,507 @@
+// This file was generated automatically by the Snowball to JSX compiler
+
+import "base-stemmer.jsx";
+import "among.jsx";
+
+ /**
+ * This class was automatically generated by a Snowball to JSX compiler
+ * It implements the stemming algorithm defined by a snowball script.
+ */
+
+class DanishStemmer extends BaseStemmer
+{
+ static const serialVersionUID = 1;
+ static const methodObject = new DanishStemmer();
+
+ static const a_0 = [
+ new Among("hed", -1, 1),
+ new Among("ethed", 0, 1),
+ new Among("ered", -1, 1),
+ new Among("e", -1, 1),
+ new Among("erede", 3, 1),
+ new Among("ende", 3, 1),
+ new Among("erende", 5, 1),
+ new Among("ene", 3, 1),
+ new Among("erne", 3, 1),
+ new Among("ere", 3, 1),
+ new Among("en", -1, 1),
+ new Among("heden", 10, 1),
+ new Among("eren", 10, 1),
+ new Among("er", -1, 1),
+ new Among("heder", 13, 1),
+ new Among("erer", 13, 1),
+ new Among("s", -1, 2),
+ new Among("heds", 16, 1),
+ new Among("es", 16, 1),
+ new Among("endes", 18, 1),
+ new Among("erendes", 19, 1),
+ new Among("enes", 18, 1),
+ new Among("ernes", 18, 1),
+ new Among("eres", 18, 1),
+ new Among("ens", 16, 1),
+ new Among("hedens", 24, 1),
+ new Among("erens", 24, 1),
+ new Among("ers", 16, 1),
+ new Among("ets", 16, 1),
+ new Among("erets", 28, 1),
+ new Among("et", -1, 1),
+ new Among("eret", 30, 1)
+ ];
+
+ static const a_1 = [
+ new Among("gd", -1, -1),
+ new Among("dt", -1, -1),
+ new Among("gt", -1, -1),
+ new Among("kt", -1, -1)
+ ];
+
+ static const a_2 = [
+ new Among("ig", -1, 1),
+ new Among("lig", 0, 1),
+ new Among("elig", 1, 1),
+ new Among("els", -1, 1),
+ new Among("l\u00F8st", -1, 2)
+ ];
+
+ static const g_v = [17, 65, 16, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 48, 0, 128] : int[];
+
+ static const g_s_ending = [239, 254, 42, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16] : int[];
+
+ var I_x : int = 0;
+ var I_p1 : int = 0;
+ var S_ch : string = "";
+
+ function copy_from (other : DanishStemmer) : void
+ {
+ this.I_x = other.I_x;
+ this.I_p1 = other.I_p1;
+ this.S_ch = other.S_ch;
+ super.copy_from(other);
+ }
+
+ function r_mark_regions () : boolean
+ {
+ var v_1 : int;
+ var v_2 : int;
+ // (, line 29
+ this.I_p1 = this.limit;
+ // test, line 33
+ v_1 = this.cursor;
+ // (, line 33
+ // hop, line 33
+ {
+ var c : int = this.cursor + 3;
+ if (0 > c || c > this.limit)
+ {
+ return false;
+ }
+ this.cursor = c;
+ }
+ // setmark x, line 33
+ this.I_x = this.cursor;
+ this.cursor = v_1;
+ // goto, line 34
+ golab0: while(true)
+ {
+ v_2 = this.cursor;
+ var lab1 = true;
+ lab1: while (lab1 == true)
+ {
+ lab1 = false;
+ if (!(this.in_grouping(DanishStemmer.g_v, 97, 248)))
+ {
+ break lab1;
+ }
+ this.cursor = v_2;
+ break golab0;
+ }
+ this.cursor = v_2;
+ if (this.cursor >= this.limit)
+ {
+ return false;
+ }
+ this.cursor++;
+ }
+ // gopast, line 34
+ golab2: while(true)
+ {
+ var lab3 = true;
+ lab3: while (lab3 == true)
+ {
+ lab3 = false;
+ if (!(this.out_grouping(DanishStemmer.g_v, 97, 248)))
+ {
+ break lab3;
+ }
+ break golab2;
+ }
+ if (this.cursor >= this.limit)
+ {
+ return false;
+ }
+ this.cursor++;
+ }
+ // setmark p1, line 34
+ this.I_p1 = this.cursor;
+ // try, line 35
+ var lab4 = true;
+ lab4: while (lab4 == true)
+ {
+ lab4 = false;
+ // (, line 35
+ if (!(this.I_p1 < this.I_x))
+ {
+ break lab4;
+ }
+ this.I_p1 = this.I_x;
+ }
+ return true;
+ }
+
+ function r_main_suffix () : boolean
+ {
+ var among_var : int;
+ var v_1 : int;
+ var v_2 : int;
+ // (, line 40
+ // setlimit, line 41
+ v_1 = this.limit - this.cursor;
+ // tomark, line 41
+ if (this.cursor < this.I_p1)
+ {
+ return false;
+ }
+ this.cursor = this.I_p1;
+ v_2 = this.limit_backward;
+ this.limit_backward = this.cursor;
+ this.cursor = this.limit - v_1;
+ // (, line 41
+ // [, line 41
+ this.ket = this.cursor;
+ // substring, line 41
+ among_var = this.find_among_b(DanishStemmer.a_0, 32);
+ if (among_var == 0)
+ {
+ this.limit_backward = v_2;
+ return false;
+ }
+ // ], line 41
+ this.bra = this.cursor;
+ this.limit_backward = v_2;
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ // (, line 48
+ // delete, line 48
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ break;
+ case 2:
+ // (, line 50
+ if (!(this.in_grouping_b(DanishStemmer.g_s_ending, 97, 229)))
+ {
+ return false;
+ }
+ // delete, line 50
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ break;
+ }
+ return true;
+ }
+
+ function r_consonant_pair () : boolean
+ {
+ var v_1 : int;
+ var v_2 : int;
+ var v_3 : int;
+ // (, line 54
+ // test, line 55
+ v_1 = this.limit - this.cursor;
+ // (, line 55
+ // setlimit, line 56
+ v_2 = this.limit - this.cursor;
+ // tomark, line 56
+ if (this.cursor < this.I_p1)
+ {
+ return false;
+ }
+ this.cursor = this.I_p1;
+ v_3 = this.limit_backward;
+ this.limit_backward = this.cursor;
+ this.cursor = this.limit - v_2;
+ // (, line 56
+ // [, line 56
+ this.ket = this.cursor;
+ // substring, line 56
+ if (this.find_among_b(DanishStemmer.a_1, 4) == 0)
+ {
+ this.limit_backward = v_3;
+ return false;
+ }
+ // ], line 56
+ this.bra = this.cursor;
+ this.limit_backward = v_3;
+ this.cursor = this.limit - v_1;
+ // next, line 62
+ if (this.cursor <= this.limit_backward)
+ {
+ return false;
+ }
+ this.cursor--;
+ // ], line 62
+ this.bra = this.cursor;
+ // delete, line 62
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ return true;
+ }
+
+ function r_other_suffix () : boolean
+ {
+ var among_var : int;
+ var v_1 : int;
+ var v_2 : int;
+ var v_3 : int;
+ var v_4 : int;
+ // (, line 65
+ // do, line 66
+ v_1 = this.limit - this.cursor;
+ var lab0 = true;
+ lab0: while (lab0 == true)
+ {
+ lab0 = false;
+ // (, line 66
+ // [, line 66
+ this.ket = this.cursor;
+ // literal, line 66
+ if (!(this.eq_s_b(2, "st")))
+ {
+ break lab0;
+ }
+ // ], line 66
+ this.bra = this.cursor;
+ // literal, line 66
+ if (!(this.eq_s_b(2, "ig")))
+ {
+ break lab0;
+ }
+ // delete, line 66
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ }
+ this.cursor = this.limit - v_1;
+ // setlimit, line 67
+ v_2 = this.limit - this.cursor;
+ // tomark, line 67
+ if (this.cursor < this.I_p1)
+ {
+ return false;
+ }
+ this.cursor = this.I_p1;
+ v_3 = this.limit_backward;
+ this.limit_backward = this.cursor;
+ this.cursor = this.limit - v_2;
+ // (, line 67
+ // [, line 67
+ this.ket = this.cursor;
+ // substring, line 67
+ among_var = this.find_among_b(DanishStemmer.a_2, 5);
+ if (among_var == 0)
+ {
+ this.limit_backward = v_3;
+ return false;
+ }
+ // ], line 67
+ this.bra = this.cursor;
+ this.limit_backward = v_3;
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ // (, line 70
+ // delete, line 70
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ // do, line 70
+ v_4 = this.limit - this.cursor;
+ var lab1 = true;
+ lab1: while (lab1 == true)
+ {
+ lab1 = false;
+ // call consonant_pair, line 70
+ if (!this.r_consonant_pair())
+ {
+ break lab1;
+ }
+ }
+ this.cursor = this.limit - v_4;
+ break;
+ case 2:
+ // (, line 72
+ // <-, line 72
+ if (!this.slice_from("l\u00F8s"))
+ {
+ return false;
+ }
+ break;
+ }
+ return true;
+ }
+
+ function r_undouble () : boolean
+ {
+ var v_1 : int;
+ var v_2 : int;
+ // (, line 75
+ // setlimit, line 76
+ v_1 = this.limit - this.cursor;
+ // tomark, line 76
+ if (this.cursor < this.I_p1)
+ {
+ return false;
+ }
+ this.cursor = this.I_p1;
+ v_2 = this.limit_backward;
+ this.limit_backward = this.cursor;
+ this.cursor = this.limit - v_1;
+ // (, line 76
+ // [, line 76
+ this.ket = this.cursor;
+ if (!(this.out_grouping_b(DanishStemmer.g_v, 97, 248)))
+ {
+ this.limit_backward = v_2;
+ return false;
+ }
+ // ], line 76
+ this.bra = this.cursor;
+ // -> ch, line 76
+ this.S_ch = this.slice_to(this.S_ch);
+ if (this.S_ch == '')
+ {
+ return false;
+ }
+ this.limit_backward = v_2;
+ // name ch, line 77
+ if (!(this.eq_v_b(this.S_ch)))
+ {
+ return false;
+ }
+ // delete, line 78
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ return true;
+ }
+
+ override function stem () : boolean
+ {
+ var v_1 : int;
+ var v_2 : int;
+ var v_3 : int;
+ var v_4 : int;
+ var v_5 : int;
+ // (, line 82
+ // do, line 84
+ v_1 = this.cursor;
+ var lab0 = true;
+ lab0: while (lab0 == true)
+ {
+ lab0 = false;
+ // call mark_regions, line 84
+ if (!this.r_mark_regions())
+ {
+ break lab0;
+ }
+ }
+ this.cursor = v_1;
+ // backwards, line 85
+ this.limit_backward = this.cursor; this.cursor = this.limit;
+ // (, line 85
+ // do, line 86
+ v_2 = this.limit - this.cursor;
+ var lab1 = true;
+ lab1: while (lab1 == true)
+ {
+ lab1 = false;
+ // call main_suffix, line 86
+ if (!this.r_main_suffix())
+ {
+ break lab1;
+ }
+ }
+ this.cursor = this.limit - v_2;
+ // do, line 87
+ v_3 = this.limit - this.cursor;
+ var lab2 = true;
+ lab2: while (lab2 == true)
+ {
+ lab2 = false;
+ // call consonant_pair, line 87
+ if (!this.r_consonant_pair())
+ {
+ break lab2;
+ }
+ }
+ this.cursor = this.limit - v_3;
+ // do, line 88
+ v_4 = this.limit - this.cursor;
+ var lab3 = true;
+ lab3: while (lab3 == true)
+ {
+ lab3 = false;
+ // call other_suffix, line 88
+ if (!this.r_other_suffix())
+ {
+ break lab3;
+ }
+ }
+ this.cursor = this.limit - v_4;
+ // do, line 89
+ v_5 = this.limit - this.cursor;
+ var lab4 = true;
+ lab4: while (lab4 == true)
+ {
+ lab4 = false;
+ // call undouble, line 89
+ if (!this.r_undouble())
+ {
+ break lab4;
+ }
+ }
+ this.cursor = this.limit - v_5;
+ this.cursor = this.limit_backward; return true;
+ }
+
+ function equals (o : variant) : boolean {
+ return o instanceof DanishStemmer;
+ }
+
+ function hashCode() : int
+ {
+ //http://stackoverflow.com/questions/194846/is-there-any-kind-of-hashcode-function-in-javascript
+ var classname = "DanishStemmer";
+ var hash = 0;
+ if (classname.length == 0) return hash;
+ for (var i = 0; i < classname.length; i++) {
+ var char = classname.charCodeAt(i);
+ hash = ((hash << 5) - hash) + char;
+ hash = hash & hash; // Convert to 32bit integer
+ }
+ return hash;
+ }
+
+}
+
diff --git a/web/server/h2o/libh2o/misc/oktavia/src/stemmer/dutch-stemmer.jsx b/web/server/h2o/libh2o/misc/oktavia/src/stemmer/dutch-stemmer.jsx
new file mode 100644
index 00000000..a8c45d2f
--- /dev/null
+++ b/web/server/h2o/libh2o/misc/oktavia/src/stemmer/dutch-stemmer.jsx
@@ -0,0 +1,1020 @@
+// This file was generated automatically by the Snowball to JSX compiler
+
+import "base-stemmer.jsx";
+import "among.jsx";
+
+ /**
+ * This class was automatically generated by a Snowball to JSX compiler
+ * It implements the stemming algorithm defined by a snowball script.
+ */
+
+class DutchStemmer extends BaseStemmer
+{
+ static const serialVersionUID = 1;
+ static const methodObject = new DutchStemmer();
+
+ static const a_0 = [
+ new Among("", -1, 6),
+ new Among("\u00E1", 0, 1),
+ new Among("\u00E4", 0, 1),
+ new Among("\u00E9", 0, 2),
+ new Among("\u00EB", 0, 2),
+ new Among("\u00ED", 0, 3),
+ new Among("\u00EF", 0, 3),
+ new Among("\u00F3", 0, 4),
+ new Among("\u00F6", 0, 4),
+ new Among("\u00FA", 0, 5),
+ new Among("\u00FC", 0, 5)
+ ];
+
+ static const a_1 = [
+ new Among("", -1, 3),
+ new Among("I", 0, 2),
+ new Among("Y", 0, 1)
+ ];
+
+ static const a_2 = [
+ new Among("dd", -1, -1),
+ new Among("kk", -1, -1),
+ new Among("tt", -1, -1)
+ ];
+
+ static const a_3 = [
+ new Among("ene", -1, 2),
+ new Among("se", -1, 3),
+ new Among("en", -1, 2),
+ new Among("heden", 2, 1),
+ new Among("s", -1, 3)
+ ];
+
+ static const a_4 = [
+ new Among("end", -1, 1),
+ new Among("ig", -1, 2),
+ new Among("ing", -1, 1),
+ new Among("lijk", -1, 3),
+ new Among("baar", -1, 4),
+ new Among("bar", -1, 5)
+ ];
+
+ static const a_5 = [
+ new Among("aa", -1, -1),
+ new Among("ee", -1, -1),
+ new Among("oo", -1, -1),
+ new Among("uu", -1, -1)
+ ];
+
+ static const g_v = [17, 65, 16, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128] : int[];
+
+ static const g_v_I = [1, 0, 0, 17, 65, 16, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128] : int[];
+
+ static const g_v_j = [17, 67, 16, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128] : int[];
+
+ var I_p2 : int = 0;
+ var I_p1 : int = 0;
+ var B_e_found : boolean = false;
+
+ function copy_from (other : DutchStemmer) : void
+ {
+ this.I_p2 = other.I_p2;
+ this.I_p1 = other.I_p1;
+ this.B_e_found = other.B_e_found;
+ super.copy_from(other);
+ }
+
+ function r_prelude () : boolean
+ {
+ var among_var : int;
+ var v_1 : int;
+ var v_2 : int;
+ var v_3 : int;
+ var v_4 : int;
+ var v_5 : int;
+ var v_6 : int;
+ // (, line 41
+ // test, line 42
+ v_1 = this.cursor;
+ // repeat, line 42
+ replab0: while(true)
+ {
+ v_2 = this.cursor;
+ var lab1 = true;
+ lab1: while (lab1 == true)
+ {
+ lab1 = false;
+ // (, line 42
+ // [, line 43
+ this.bra = this.cursor;
+ // substring, line 43
+ among_var = this.find_among(DutchStemmer.a_0, 11);
+ if (among_var == 0)
+ {
+ break lab1;
+ }
+ // ], line 43
+ this.ket = this.cursor;
+ switch (among_var) {
+ case 0:
+ break lab1;
+ case 1:
+ // (, line 45
+ // <-, line 45
+ if (!this.slice_from("a"))
+ {
+ return false;
+ }
+ break;
+ case 2:
+ // (, line 47
+ // <-, line 47
+ if (!this.slice_from("e"))
+ {
+ return false;
+ }
+ break;
+ case 3:
+ // (, line 49
+ // <-, line 49
+ if (!this.slice_from("i"))
+ {
+ return false;
+ }
+ break;
+ case 4:
+ // (, line 51
+ // <-, line 51
+ if (!this.slice_from("o"))
+ {
+ return false;
+ }
+ break;
+ case 5:
+ // (, line 53
+ // <-, line 53
+ if (!this.slice_from("u"))
+ {
+ return false;
+ }
+ break;
+ case 6:
+ // (, line 54
+ // next, line 54
+ if (this.cursor >= this.limit)
+ {
+ break lab1;
+ }
+ this.cursor++;
+ break;
+ }
+ continue replab0;
+ }
+ this.cursor = v_2;
+ break replab0;
+ }
+ this.cursor = v_1;
+ // try, line 57
+ v_3 = this.cursor;
+ var lab2 = true;
+ lab2: while (lab2 == true)
+ {
+ lab2 = false;
+ // (, line 57
+ // [, line 57
+ this.bra = this.cursor;
+ // literal, line 57
+ if (!(this.eq_s(1, "y")))
+ {
+ this.cursor = v_3;
+ break lab2;
+ }
+ // ], line 57
+ this.ket = this.cursor;
+ // <-, line 57
+ if (!this.slice_from("Y"))
+ {
+ return false;
+ }
+ }
+ // repeat, line 58
+ replab3: while(true)
+ {
+ v_4 = this.cursor;
+ var lab4 = true;
+ lab4: while (lab4 == true)
+ {
+ lab4 = false;
+ // goto, line 58
+ golab5: while(true)
+ {
+ v_5 = this.cursor;
+ var lab6 = true;
+ lab6: while (lab6 == true)
+ {
+ lab6 = false;
+ // (, line 58
+ if (!(this.in_grouping(DutchStemmer.g_v, 97, 232)))
+ {
+ break lab6;
+ }
+ // [, line 59
+ this.bra = this.cursor;
+ // or, line 59
+ var lab7 = true;
+ lab7: while (lab7 == true)
+ {
+ lab7 = false;
+ v_6 = this.cursor;
+ var lab8 = true;
+ lab8: while (lab8 == true)
+ {
+ lab8 = false;
+ // (, line 59
+ // literal, line 59
+ if (!(this.eq_s(1, "i")))
+ {
+ break lab8;
+ }
+ // ], line 59
+ this.ket = this.cursor;
+ if (!(this.in_grouping(DutchStemmer.g_v, 97, 232)))
+ {
+ break lab8;
+ }
+ // <-, line 59
+ if (!this.slice_from("I"))
+ {
+ return false;
+ }
+ break lab7;
+ }
+ this.cursor = v_6;
+ // (, line 60
+ // literal, line 60
+ if (!(this.eq_s(1, "y")))
+ {
+ break lab6;
+ }
+ // ], line 60
+ this.ket = this.cursor;
+ // <-, line 60
+ if (!this.slice_from("Y"))
+ {
+ return false;
+ }
+ }
+ this.cursor = v_5;
+ break golab5;
+ }
+ this.cursor = v_5;
+ if (this.cursor >= this.limit)
+ {
+ break lab4;
+ }
+ this.cursor++;
+ }
+ continue replab3;
+ }
+ this.cursor = v_4;
+ break replab3;
+ }
+ return true;
+ }
+
+ function r_mark_regions () : boolean
+ {
+ // (, line 64
+ this.I_p1 = this.limit;
+ this.I_p2 = this.limit;
+ // gopast, line 69
+ golab0: while(true)
+ {
+ var lab1 = true;
+ lab1: while (lab1 == true)
+ {
+ lab1 = false;
+ if (!(this.in_grouping(DutchStemmer.g_v, 97, 232)))
+ {
+ break lab1;
+ }
+ break golab0;
+ }
+ if (this.cursor >= this.limit)
+ {
+ return false;
+ }
+ this.cursor++;
+ }
+ // gopast, line 69
+ golab2: while(true)
+ {
+ var lab3 = true;
+ lab3: while (lab3 == true)
+ {
+ lab3 = false;
+ if (!(this.out_grouping(DutchStemmer.g_v, 97, 232)))
+ {
+ break lab3;
+ }
+ break golab2;
+ }
+ if (this.cursor >= this.limit)
+ {
+ return false;
+ }
+ this.cursor++;
+ }
+ // setmark p1, line 69
+ this.I_p1 = this.cursor;
+ // try, line 70
+ var lab4 = true;
+ lab4: while (lab4 == true)
+ {
+ lab4 = false;
+ // (, line 70
+ if (!(this.I_p1 < 3))
+ {
+ break lab4;
+ }
+ this.I_p1 = 3;
+ }
+ // gopast, line 71
+ golab5: while(true)
+ {
+ var lab6 = true;
+ lab6: while (lab6 == true)
+ {
+ lab6 = false;
+ if (!(this.in_grouping(DutchStemmer.g_v, 97, 232)))
+ {
+ break lab6;
+ }
+ break golab5;
+ }
+ if (this.cursor >= this.limit)
+ {
+ return false;
+ }
+ this.cursor++;
+ }
+ // gopast, line 71
+ golab7: while(true)
+ {
+ var lab8 = true;
+ lab8: while (lab8 == true)
+ {
+ lab8 = false;
+ if (!(this.out_grouping(DutchStemmer.g_v, 97, 232)))
+ {
+ break lab8;
+ }
+ break golab7;
+ }
+ if (this.cursor >= this.limit)
+ {
+ return false;
+ }
+ this.cursor++;
+ }
+ // setmark p2, line 71
+ this.I_p2 = this.cursor;
+ return true;
+ }
+
+ function r_postlude () : boolean
+ {
+ var among_var : int;
+ var v_1 : int;
+ // repeat, line 75
+ replab0: while(true)
+ {
+ v_1 = this.cursor;
+ var lab1 = true;
+ lab1: while (lab1 == true)
+ {
+ lab1 = false;
+ // (, line 75
+ // [, line 77
+ this.bra = this.cursor;
+ // substring, line 77
+ among_var = this.find_among(DutchStemmer.a_1, 3);
+ if (among_var == 0)
+ {
+ break lab1;
+ }
+ // ], line 77
+ this.ket = this.cursor;
+ switch (among_var) {
+ case 0:
+ break lab1;
+ case 1:
+ // (, line 78
+ // <-, line 78
+ if (!this.slice_from("y"))
+ {
+ return false;
+ }
+ break;
+ case 2:
+ // (, line 79
+ // <-, line 79
+ if (!this.slice_from("i"))
+ {
+ return false;
+ }
+ break;
+ case 3:
+ // (, line 80
+ // next, line 80
+ if (this.cursor >= this.limit)
+ {
+ break lab1;
+ }
+ this.cursor++;
+ break;
+ }
+ continue replab0;
+ }
+ this.cursor = v_1;
+ break replab0;
+ }
+ return true;
+ }
+
+ function r_R1 () : boolean
+ {
+ if (!(this.I_p1 <= this.cursor))
+ {
+ return false;
+ }
+ return true;
+ }
+
+ function r_R2 () : boolean
+ {
+ if (!(this.I_p2 <= this.cursor))
+ {
+ return false;
+ }
+ return true;
+ }
+
+ function r_undouble () : boolean
+ {
+ var v_1 : int;
+ // (, line 90
+ // test, line 91
+ v_1 = this.limit - this.cursor;
+ // among, line 91
+ if (this.find_among_b(DutchStemmer.a_2, 3) == 0)
+ {
+ return false;
+ }
+ this.cursor = this.limit - v_1;
+ // [, line 91
+ this.ket = this.cursor;
+ // next, line 91
+ if (this.cursor <= this.limit_backward)
+ {
+ return false;
+ }
+ this.cursor--;
+ // ], line 91
+ this.bra = this.cursor;
+ // delete, line 91
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ return true;
+ }
+
+ function r_e_ending () : boolean
+ {
+ var v_1 : int;
+ // (, line 94
+ // unset e_found, line 95
+ this.B_e_found = false;
+ // [, line 96
+ this.ket = this.cursor;
+ // literal, line 96
+ if (!(this.eq_s_b(1, "e")))
+ {
+ return false;
+ }
+ // ], line 96
+ this.bra = this.cursor;
+ // call R1, line 96
+ if (!this.r_R1())
+ {
+ return false;
+ }
+ // test, line 96
+ v_1 = this.limit - this.cursor;
+ if (!(this.out_grouping_b(DutchStemmer.g_v, 97, 232)))
+ {
+ return false;
+ }
+ this.cursor = this.limit - v_1;
+ // delete, line 96
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ // set e_found, line 97
+ this.B_e_found = true;
+ // call undouble, line 98
+ if (!this.r_undouble())
+ {
+ return false;
+ }
+ return true;
+ }
+
+ function r_en_ending () : boolean
+ {
+ var v_1 : int;
+ var v_2 : int;
+ // (, line 101
+ // call R1, line 102
+ if (!this.r_R1())
+ {
+ return false;
+ }
+ // and, line 102
+ v_1 = this.limit - this.cursor;
+ if (!(this.out_grouping_b(DutchStemmer.g_v, 97, 232)))
+ {
+ return false;
+ }
+ this.cursor = this.limit - v_1;
+ // not, line 102
+ {
+ v_2 = this.limit - this.cursor;
+ var lab0 = true;
+ lab0: while (lab0 == true)
+ {
+ lab0 = false;
+ // literal, line 102
+ if (!(this.eq_s_b(3, "gem")))
+ {
+ break lab0;
+ }
+ return false;
+ }
+ this.cursor = this.limit - v_2;
+ }
+ // delete, line 102
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ // call undouble, line 103
+ if (!this.r_undouble())
+ {
+ return false;
+ }
+ return true;
+ }
+
+ function r_standard_suffix () : boolean
+ {
+ var among_var : int;
+ var v_1 : int;
+ var v_2 : int;
+ var v_3 : int;
+ var v_4 : int;
+ var v_5 : int;
+ var v_6 : int;
+ var v_7 : int;
+ var v_8 : int;
+ var v_9 : int;
+ var v_10 : int;
+ // (, line 106
+ // do, line 107
+ v_1 = this.limit - this.cursor;
+ var lab0 = true;
+ lab0: while (lab0 == true)
+ {
+ lab0 = false;
+ // (, line 107
+ // [, line 108
+ this.ket = this.cursor;
+ // substring, line 108
+ among_var = this.find_among_b(DutchStemmer.a_3, 5);
+ if (among_var == 0)
+ {
+ break lab0;
+ }
+ // ], line 108
+ this.bra = this.cursor;
+ switch (among_var) {
+ case 0:
+ break lab0;
+ case 1:
+ // (, line 110
+ // call R1, line 110
+ if (!this.r_R1())
+ {
+ break lab0;
+ }
+ // <-, line 110
+ if (!this.slice_from("heid"))
+ {
+ return false;
+ }
+ break;
+ case 2:
+ // (, line 113
+ // call en_ending, line 113
+ if (!this.r_en_ending())
+ {
+ break lab0;
+ }
+ break;
+ case 3:
+ // (, line 116
+ // call R1, line 116
+ if (!this.r_R1())
+ {
+ break lab0;
+ }
+ if (!(this.out_grouping_b(DutchStemmer.g_v_j, 97, 232)))
+ {
+ break lab0;
+ }
+ // delete, line 116
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ break;
+ }
+ }
+ this.cursor = this.limit - v_1;
+ // do, line 120
+ v_2 = this.limit - this.cursor;
+ var lab1 = true;
+ lab1: while (lab1 == true)
+ {
+ lab1 = false;
+ // call e_ending, line 120
+ if (!this.r_e_ending())
+ {
+ break lab1;
+ }
+ }
+ this.cursor = this.limit - v_2;
+ // do, line 122
+ v_3 = this.limit - this.cursor;
+ var lab2 = true;
+ lab2: while (lab2 == true)
+ {
+ lab2 = false;
+ // (, line 122
+ // [, line 122
+ this.ket = this.cursor;
+ // literal, line 122
+ if (!(this.eq_s_b(4, "heid")))
+ {
+ break lab2;
+ }
+ // ], line 122
+ this.bra = this.cursor;
+ // call R2, line 122
+ if (!this.r_R2())
+ {
+ break lab2;
+ }
+ // not, line 122
+ {
+ v_4 = this.limit - this.cursor;
+ var lab3 = true;
+ lab3: while (lab3 == true)
+ {
+ lab3 = false;
+ // literal, line 122
+ if (!(this.eq_s_b(1, "c")))
+ {
+ break lab3;
+ }
+ break lab2;
+ }
+ this.cursor = this.limit - v_4;
+ }
+ // delete, line 122
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ // [, line 123
+ this.ket = this.cursor;
+ // literal, line 123
+ if (!(this.eq_s_b(2, "en")))
+ {
+ break lab2;
+ }
+ // ], line 123
+ this.bra = this.cursor;
+ // call en_ending, line 123
+ if (!this.r_en_ending())
+ {
+ break lab2;
+ }
+ }
+ this.cursor = this.limit - v_3;
+ // do, line 126
+ v_5 = this.limit - this.cursor;
+ var lab4 = true;
+ lab4: while (lab4 == true)
+ {
+ lab4 = false;
+ // (, line 126
+ // [, line 127
+ this.ket = this.cursor;
+ // substring, line 127
+ among_var = this.find_among_b(DutchStemmer.a_4, 6);
+ if (among_var == 0)
+ {
+ break lab4;
+ }
+ // ], line 127
+ this.bra = this.cursor;
+ switch (among_var) {
+ case 0:
+ break lab4;
+ case 1:
+ // (, line 129
+ // call R2, line 129
+ if (!this.r_R2())
+ {
+ break lab4;
+ }
+ // delete, line 129
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ // or, line 130
+ var lab5 = true;
+ lab5: while (lab5 == true)
+ {
+ lab5 = false;
+ v_6 = this.limit - this.cursor;
+ var lab6 = true;
+ lab6: while (lab6 == true)
+ {
+ lab6 = false;
+ // (, line 130
+ // [, line 130
+ this.ket = this.cursor;
+ // literal, line 130
+ if (!(this.eq_s_b(2, "ig")))
+ {
+ break lab6;
+ }
+ // ], line 130
+ this.bra = this.cursor;
+ // call R2, line 130
+ if (!this.r_R2())
+ {
+ break lab6;
+ }
+ // not, line 130
+ {
+ v_7 = this.limit - this.cursor;
+ var lab7 = true;
+ lab7: while (lab7 == true)
+ {
+ lab7 = false;
+ // literal, line 130
+ if (!(this.eq_s_b(1, "e")))
+ {
+ break lab7;
+ }
+ break lab6;
+ }
+ this.cursor = this.limit - v_7;
+ }
+ // delete, line 130
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ break lab5;
+ }
+ this.cursor = this.limit - v_6;
+ // call undouble, line 130
+ if (!this.r_undouble())
+ {
+ break lab4;
+ }
+ }
+ break;
+ case 2:
+ // (, line 133
+ // call R2, line 133
+ if (!this.r_R2())
+ {
+ break lab4;
+ }
+ // not, line 133
+ {
+ v_8 = this.limit - this.cursor;
+ var lab8 = true;
+ lab8: while (lab8 == true)
+ {
+ lab8 = false;
+ // literal, line 133
+ if (!(this.eq_s_b(1, "e")))
+ {
+ break lab8;
+ }
+ break lab4;
+ }
+ this.cursor = this.limit - v_8;
+ }
+ // delete, line 133
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ break;
+ case 3:
+ // (, line 136
+ // call R2, line 136
+ if (!this.r_R2())
+ {
+ break lab4;
+ }
+ // delete, line 136
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ // call e_ending, line 136
+ if (!this.r_e_ending())
+ {
+ break lab4;
+ }
+ break;
+ case 4:
+ // (, line 139
+ // call R2, line 139
+ if (!this.r_R2())
+ {
+ break lab4;
+ }
+ // delete, line 139
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ break;
+ case 5:
+ // (, line 142
+ // call R2, line 142
+ if (!this.r_R2())
+ {
+ break lab4;
+ }
+ // Boolean test e_found, line 142
+ if (!(this.B_e_found))
+ {
+ break lab4;
+ }
+ // delete, line 142
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ break;
+ }
+ }
+ this.cursor = this.limit - v_5;
+ // do, line 146
+ v_9 = this.limit - this.cursor;
+ var lab9 = true;
+ lab9: while (lab9 == true)
+ {
+ lab9 = false;
+ // (, line 146
+ if (!(this.out_grouping_b(DutchStemmer.g_v_I, 73, 232)))
+ {
+ break lab9;
+ }
+ // test, line 148
+ v_10 = this.limit - this.cursor;
+ // (, line 148
+ // among, line 149
+ if (this.find_among_b(DutchStemmer.a_5, 4) == 0)
+ {
+ break lab9;
+ }
+ if (!(this.out_grouping_b(DutchStemmer.g_v, 97, 232)))
+ {
+ break lab9;
+ }
+ this.cursor = this.limit - v_10;
+ // [, line 152
+ this.ket = this.cursor;
+ // next, line 152
+ if (this.cursor <= this.limit_backward)
+ {
+ break lab9;
+ }
+ this.cursor--;
+ // ], line 152
+ this.bra = this.cursor;
+ // delete, line 152
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ }
+ this.cursor = this.limit - v_9;
+ return true;
+ }
+
+ override function stem () : boolean
+ {
+ var v_1 : int;
+ var v_2 : int;
+ var v_3 : int;
+ var v_4 : int;
+ // (, line 157
+ // do, line 159
+ v_1 = this.cursor;
+ var lab0 = true;
+ lab0: while (lab0 == true)
+ {
+ lab0 = false;
+ // call prelude, line 159
+ if (!this.r_prelude())
+ {
+ break lab0;
+ }
+ }
+ this.cursor = v_1;
+ // do, line 160
+ v_2 = this.cursor;
+ var lab1 = true;
+ lab1: while (lab1 == true)
+ {
+ lab1 = false;
+ // call mark_regions, line 160
+ if (!this.r_mark_regions())
+ {
+ break lab1;
+ }
+ }
+ this.cursor = v_2;
+ // backwards, line 161
+ this.limit_backward = this.cursor; this.cursor = this.limit;
+ // do, line 162
+ v_3 = this.limit - this.cursor;
+ var lab2 = true;
+ lab2: while (lab2 == true)
+ {
+ lab2 = false;
+ // call standard_suffix, line 162
+ if (!this.r_standard_suffix())
+ {
+ break lab2;
+ }
+ }
+ this.cursor = this.limit - v_3;
+ this.cursor = this.limit_backward; // do, line 163
+ v_4 = this.cursor;
+ var lab3 = true;
+ lab3: while (lab3 == true)
+ {
+ lab3 = false;
+ // call postlude, line 163
+ if (!this.r_postlude())
+ {
+ break lab3;
+ }
+ }
+ this.cursor = v_4;
+ return true;
+ }
+
+ function equals (o : variant) : boolean {
+ return o instanceof DutchStemmer;
+ }
+
+ function hashCode() : int
+ {
+ //http://stackoverflow.com/questions/194846/is-there-any-kind-of-hashcode-function-in-javascript
+ var classname = "DutchStemmer";
+ var hash = 0;
+ if (classname.length == 0) return hash;
+ for (var i = 0; i < classname.length; i++) {
+ var char = classname.charCodeAt(i);
+ hash = ((hash << 5) - hash) + char;
+ hash = hash & hash; // Convert to 32bit integer
+ }
+ return hash;
+ }
+
+}
+
diff --git a/web/server/h2o/libh2o/misc/oktavia/src/stemmer/english-stemmer.jsx b/web/server/h2o/libh2o/misc/oktavia/src/stemmer/english-stemmer.jsx
new file mode 100644
index 00000000..901c12c8
--- /dev/null
+++ b/web/server/h2o/libh2o/misc/oktavia/src/stemmer/english-stemmer.jsx
@@ -0,0 +1,1638 @@
+// This file was generated automatically by the Snowball to JSX compiler
+
+import "base-stemmer.jsx";
+import "among.jsx";
+
+ /**
+ * This class was automatically generated by a Snowball to JSX compiler
+ * It implements the stemming algorithm defined by a snowball script.
+ */
+
+class EnglishStemmer extends BaseStemmer
+{
+ static const serialVersionUID = 1;
+ static const methodObject = new EnglishStemmer();
+
+ static const a_0 = [
+ new Among("arsen", -1, -1),
+ new Among("commun", -1, -1),
+ new Among("gener", -1, -1)
+ ];
+
+ static const a_1 = [
+ new Among("'", -1, 1),
+ new Among("'s'", 0, 1),
+ new Among("'s", -1, 1)
+ ];
+
+ static const a_2 = [
+ new Among("ied", -1, 2),
+ new Among("s", -1, 3),
+ new Among("ies", 1, 2),
+ new Among("sses", 1, 1),
+ new Among("ss", 1, -1),
+ new Among("us", 1, -1)
+ ];
+
+ static const a_3 = [
+ new Among("", -1, 3),
+ new Among("bb", 0, 2),
+ new Among("dd", 0, 2),
+ new Among("ff", 0, 2),
+ new Among("gg", 0, 2),
+ new Among("bl", 0, 1),
+ new Among("mm", 0, 2),
+ new Among("nn", 0, 2),
+ new Among("pp", 0, 2),
+ new Among("rr", 0, 2),
+ new Among("at", 0, 1),
+ new Among("tt", 0, 2),
+ new Among("iz", 0, 1)
+ ];
+
+ static const a_4 = [
+ new Among("ed", -1, 2),
+ new Among("eed", 0, 1),
+ new Among("ing", -1, 2),
+ new Among("edly", -1, 2),
+ new Among("eedly", 3, 1),
+ new Among("ingly", -1, 2)
+ ];
+
+ static const a_5 = [
+ new Among("anci", -1, 3),
+ new Among("enci", -1, 2),
+ new Among("ogi", -1, 13),
+ new Among("li", -1, 16),
+ new Among("bli", 3, 12),
+ new Among("abli", 4, 4),
+ new Among("alli", 3, 8),
+ new Among("fulli", 3, 14),
+ new Among("lessli", 3, 15),
+ new Among("ousli", 3, 10),
+ new Among("entli", 3, 5),
+ new Among("aliti", -1, 8),
+ new Among("biliti", -1, 12),
+ new Among("iviti", -1, 11),
+ new Among("tional", -1, 1),
+ new Among("ational", 14, 7),
+ new Among("alism", -1, 8),
+ new Among("ation", -1, 7),
+ new Among("ization", 17, 6),
+ new Among("izer", -1, 6),
+ new Among("ator", -1, 7),
+ new Among("iveness", -1, 11),
+ new Among("fulness", -1, 9),
+ new Among("ousness", -1, 10)
+ ];
+
+ static const a_6 = [
+ new Among("icate", -1, 4),
+ new Among("ative", -1, 6),
+ new Among("alize", -1, 3),
+ new Among("iciti", -1, 4),
+ new Among("ical", -1, 4),
+ new Among("tional", -1, 1),
+ new Among("ational", 5, 2),
+ new Among("ful", -1, 5),
+ new Among("ness", -1, 5)
+ ];
+
+ static const a_7 = [
+ new Among("ic", -1, 1),
+ new Among("ance", -1, 1),
+ new Among("ence", -1, 1),
+ new Among("able", -1, 1),
+ new Among("ible", -1, 1),
+ new Among("ate", -1, 1),
+ new Among("ive", -1, 1),
+ new Among("ize", -1, 1),
+ new Among("iti", -1, 1),
+ new Among("al", -1, 1),
+ new Among("ism", -1, 1),
+ new Among("ion", -1, 2),
+ new Among("er", -1, 1),
+ new Among("ous", -1, 1),
+ new Among("ant", -1, 1),
+ new Among("ent", -1, 1),
+ new Among("ment", 15, 1),
+ new Among("ement", 16, 1)
+ ];
+
+ static const a_8 = [
+ new Among("e", -1, 1),
+ new Among("l", -1, 2)
+ ];
+
+ static const a_9 = [
+ new Among("succeed", -1, -1),
+ new Among("proceed", -1, -1),
+ new Among("exceed", -1, -1),
+ new Among("canning", -1, -1),
+ new Among("inning", -1, -1),
+ new Among("earring", -1, -1),
+ new Among("herring", -1, -1),
+ new Among("outing", -1, -1)
+ ];
+
+ static const a_10 = [
+ new Among("andes", -1, -1),
+ new Among("atlas", -1, -1),
+ new Among("bias", -1, -1),
+ new Among("cosmos", -1, -1),
+ new Among("dying", -1, 3),
+ new Among("early", -1, 9),
+ new Among("gently", -1, 7),
+ new Among("howe", -1, -1),
+ new Among("idly", -1, 6),
+ new Among("lying", -1, 4),
+ new Among("news", -1, -1),
+ new Among("only", -1, 10),
+ new Among("singly", -1, 11),
+ new Among("skies", -1, 2),
+ new Among("skis", -1, 1),
+ new Among("sky", -1, -1),
+ new Among("tying", -1, 5),
+ new Among("ugly", -1, 8)
+ ];
+
+ static const g_v = [17, 65, 16, 1] : int[];
+
+ static const g_v_WXY = [1, 17, 65, 208, 1] : int[];
+
+ static const g_valid_LI = [55, 141, 2] : int[];
+
+ var B_Y_found : boolean = false;
+ var I_p2 : int = 0;
+ var I_p1 : int = 0;
+
+ function copy_from (other : EnglishStemmer) : void
+ {
+ this.B_Y_found = other.B_Y_found;
+ this.I_p2 = other.I_p2;
+ this.I_p1 = other.I_p1;
+ super.copy_from(other);
+ }
+
+ function r_prelude () : boolean
+ {
+ var v_1 : int;
+ var v_2 : int;
+ var v_3 : int;
+ var v_4 : int;
+ var v_5 : int;
+ // (, line 25
+ // unset Y_found, line 26
+ this.B_Y_found = false;
+ // do, line 27
+ v_1 = this.cursor;
+ var lab0 = true;
+ lab0: while (lab0 == true)
+ {
+ lab0 = false;
+ // (, line 27
+ // [, line 27
+ this.bra = this.cursor;
+ // literal, line 27
+ if (!(this.eq_s(1, "'")))
+ {
+ break lab0;
+ }
+ // ], line 27
+ this.ket = this.cursor;
+ // delete, line 27
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ }
+ this.cursor = v_1;
+ // do, line 28
+ v_2 = this.cursor;
+ var lab1 = true;
+ lab1: while (lab1 == true)
+ {
+ lab1 = false;
+ // (, line 28
+ // [, line 28
+ this.bra = this.cursor;
+ // literal, line 28
+ if (!(this.eq_s(1, "y")))
+ {
+ break lab1;
+ }
+ // ], line 28
+ this.ket = this.cursor;
+ // <-, line 28
+ if (!this.slice_from("Y"))
+ {
+ return false;
+ }
+ // set Y_found, line 28
+ this.B_Y_found = true;
+ }
+ this.cursor = v_2;
+ // do, line 29
+ v_3 = this.cursor;
+ var lab2 = true;
+ lab2: while (lab2 == true)
+ {
+ lab2 = false;
+ // repeat, line 29
+ replab3: while(true)
+ {
+ v_4 = this.cursor;
+ var lab4 = true;
+ lab4: while (lab4 == true)
+ {
+ lab4 = false;
+ // (, line 29
+ // goto, line 29
+ golab5: while(true)
+ {
+ v_5 = this.cursor;
+ var lab6 = true;
+ lab6: while (lab6 == true)
+ {
+ lab6 = false;
+ // (, line 29
+ if (!(this.in_grouping(EnglishStemmer.g_v, 97, 121)))
+ {
+ break lab6;
+ }
+ // [, line 29
+ this.bra = this.cursor;
+ // literal, line 29
+ if (!(this.eq_s(1, "y")))
+ {
+ break lab6;
+ }
+ // ], line 29
+ this.ket = this.cursor;
+ this.cursor = v_5;
+ break golab5;
+ }
+ this.cursor = v_5;
+ if (this.cursor >= this.limit)
+ {
+ break lab4;
+ }
+ this.cursor++;
+ }
+ // <-, line 29
+ if (!this.slice_from("Y"))
+ {
+ return false;
+ }
+ // set Y_found, line 29
+ this.B_Y_found = true;
+ continue replab3;
+ }
+ this.cursor = v_4;
+ break replab3;
+ }
+ }
+ this.cursor = v_3;
+ return true;
+ }
+
+ function r_mark_regions () : boolean
+ {
+ var v_1 : int;
+ var v_2 : int;
+ // (, line 32
+ this.I_p1 = this.limit;
+ this.I_p2 = this.limit;
+ // do, line 35
+ v_1 = this.cursor;
+ var lab0 = true;
+ lab0: while (lab0 == true)
+ {
+ lab0 = false;
+ // (, line 35
+ // or, line 41
+ var lab1 = true;
+ lab1: while (lab1 == true)
+ {
+ lab1 = false;
+ v_2 = this.cursor;
+ var lab2 = true;
+ lab2: while (lab2 == true)
+ {
+ lab2 = false;
+ // among, line 36
+ if (this.find_among(EnglishStemmer.a_0, 3) == 0)
+ {
+ break lab2;
+ }
+ break lab1;
+ }
+ this.cursor = v_2;
+ // (, line 41
+ // gopast, line 41
+ golab3: while(true)
+ {
+ var lab4 = true;
+ lab4: while (lab4 == true)
+ {
+ lab4 = false;
+ if (!(this.in_grouping(EnglishStemmer.g_v, 97, 121)))
+ {
+ break lab4;
+ }
+ break golab3;
+ }
+ if (this.cursor >= this.limit)
+ {
+ break lab0;
+ }
+ this.cursor++;
+ }
+ // gopast, line 41
+ golab5: while(true)
+ {
+ var lab6 = true;
+ lab6: while (lab6 == true)
+ {
+ lab6 = false;
+ if (!(this.out_grouping(EnglishStemmer.g_v, 97, 121)))
+ {
+ break lab6;
+ }
+ break golab5;
+ }
+ if (this.cursor >= this.limit)
+ {
+ break lab0;
+ }
+ this.cursor++;
+ }
+ }
+ // setmark p1, line 42
+ this.I_p1 = this.cursor;
+ // gopast, line 43
+ golab7: while(true)
+ {
+ var lab8 = true;
+ lab8: while (lab8 == true)
+ {
+ lab8 = false;
+ if (!(this.in_grouping(EnglishStemmer.g_v, 97, 121)))
+ {
+ break lab8;
+ }
+ break golab7;
+ }
+ if (this.cursor >= this.limit)
+ {
+ break lab0;
+ }
+ this.cursor++;
+ }
+ // gopast, line 43
+ golab9: while(true)
+ {
+ var lab10 = true;
+ lab10: while (lab10 == true)
+ {
+ lab10 = false;
+ if (!(this.out_grouping(EnglishStemmer.g_v, 97, 121)))
+ {
+ break lab10;
+ }
+ break golab9;
+ }
+ if (this.cursor >= this.limit)
+ {
+ break lab0;
+ }
+ this.cursor++;
+ }
+ // setmark p2, line 43
+ this.I_p2 = this.cursor;
+ }
+ this.cursor = v_1;
+ return true;
+ }
+
+ function r_shortv () : boolean
+ {
+ var v_1 : int;
+ // (, line 49
+ // or, line 51
+ var lab0 = true;
+ lab0: while (lab0 == true)
+ {
+ lab0 = false;
+ v_1 = this.limit - this.cursor;
+ var lab1 = true;
+ lab1: while (lab1 == true)
+ {
+ lab1 = false;
+ // (, line 50
+ if (!(this.out_grouping_b(EnglishStemmer.g_v_WXY, 89, 121)))
+ {
+ break lab1;
+ }
+ if (!(this.in_grouping_b(EnglishStemmer.g_v, 97, 121)))
+ {
+ break lab1;
+ }
+ if (!(this.out_grouping_b(EnglishStemmer.g_v, 97, 121)))
+ {
+ break lab1;
+ }
+ break lab0;
+ }
+ this.cursor = this.limit - v_1;
+ // (, line 52
+ if (!(this.out_grouping_b(EnglishStemmer.g_v, 97, 121)))
+ {
+ return false;
+ }
+ if (!(this.in_grouping_b(EnglishStemmer.g_v, 97, 121)))
+ {
+ return false;
+ }
+ // atlimit, line 52
+ if (this.cursor > this.limit_backward)
+ {
+ return false;
+ }
+ }
+ return true;
+ }
+
+ function r_R1 () : boolean
+ {
+ if (!(this.I_p1 <= this.cursor))
+ {
+ return false;
+ }
+ return true;
+ }
+
+ function r_R2 () : boolean
+ {
+ if (!(this.I_p2 <= this.cursor))
+ {
+ return false;
+ }
+ return true;
+ }
+
+ function r_Step_1a () : boolean
+ {
+ var among_var : int;
+ var v_1 : int;
+ var v_2 : int;
+ // (, line 58
+ // try, line 59
+ v_1 = this.limit - this.cursor;
+ var lab0 = true;
+ lab0: while (lab0 == true)
+ {
+ lab0 = false;
+ // (, line 59
+ // [, line 60
+ this.ket = this.cursor;
+ // substring, line 60
+ among_var = this.find_among_b(EnglishStemmer.a_1, 3);
+ if (among_var == 0)
+ {
+ this.cursor = this.limit - v_1;
+ break lab0;
+ }
+ // ], line 60
+ this.bra = this.cursor;
+ switch (among_var) {
+ case 0:
+ this.cursor = this.limit - v_1;
+ break lab0;
+ case 1:
+ // (, line 62
+ // delete, line 62
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ break;
+ }
+ }
+ // [, line 65
+ this.ket = this.cursor;
+ // substring, line 65
+ among_var = this.find_among_b(EnglishStemmer.a_2, 6);
+ if (among_var == 0)
+ {
+ return false;
+ }
+ // ], line 65
+ this.bra = this.cursor;
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ // (, line 66
+ // <-, line 66
+ if (!this.slice_from("ss"))
+ {
+ return false;
+ }
+ break;
+ case 2:
+ // (, line 68
+ // or, line 68
+ var lab1 = true;
+ lab1: while (lab1 == true)
+ {
+ lab1 = false;
+ v_2 = this.limit - this.cursor;
+ var lab2 = true;
+ lab2: while (lab2 == true)
+ {
+ lab2 = false;
+ // (, line 68
+ // hop, line 68
+ {
+ var c : int = this.cursor - 2;
+ if (this.limit_backward > c || c > this.limit)
+ {
+ break lab2;
+ }
+ this.cursor = c;
+ }
+ // <-, line 68
+ if (!this.slice_from("i"))
+ {
+ return false;
+ }
+ break lab1;
+ }
+ this.cursor = this.limit - v_2;
+ // <-, line 68
+ if (!this.slice_from("ie"))
+ {
+ return false;
+ }
+ }
+ break;
+ case 3:
+ // (, line 69
+ // next, line 69
+ if (this.cursor <= this.limit_backward)
+ {
+ return false;
+ }
+ this.cursor--;
+ // gopast, line 69
+ golab3: while(true)
+ {
+ var lab4 = true;
+ lab4: while (lab4 == true)
+ {
+ lab4 = false;
+ if (!(this.in_grouping_b(EnglishStemmer.g_v, 97, 121)))
+ {
+ break lab4;
+ }
+ break golab3;
+ }
+ if (this.cursor <= this.limit_backward)
+ {
+ return false;
+ }
+ this.cursor--;
+ }
+ // delete, line 69
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ break;
+ }
+ return true;
+ }
+
+ function r_Step_1b () : boolean
+ {
+ var among_var : int;
+ var v_1 : int;
+ var v_3 : int;
+ var v_4 : int;
+ // (, line 74
+ // [, line 75
+ this.ket = this.cursor;
+ // substring, line 75
+ among_var = this.find_among_b(EnglishStemmer.a_4, 6);
+ if (among_var == 0)
+ {
+ return false;
+ }
+ // ], line 75
+ this.bra = this.cursor;
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ // (, line 77
+ // call R1, line 77
+ if (!this.r_R1())
+ {
+ return false;
+ }
+ // <-, line 77
+ if (!this.slice_from("ee"))
+ {
+ return false;
+ }
+ break;
+ case 2:
+ // (, line 79
+ // test, line 80
+ v_1 = this.limit - this.cursor;
+ // gopast, line 80
+ golab0: while(true)
+ {
+ var lab1 = true;
+ lab1: while (lab1 == true)
+ {
+ lab1 = false;
+ if (!(this.in_grouping_b(EnglishStemmer.g_v, 97, 121)))
+ {
+ break lab1;
+ }
+ break golab0;
+ }
+ if (this.cursor <= this.limit_backward)
+ {
+ return false;
+ }
+ this.cursor--;
+ }
+ this.cursor = this.limit - v_1;
+ // delete, line 80
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ // test, line 81
+ v_3 = this.limit - this.cursor;
+ // substring, line 81
+ among_var = this.find_among_b(EnglishStemmer.a_3, 13);
+ if (among_var == 0)
+ {
+ return false;
+ }
+ this.cursor = this.limit - v_3;
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ // (, line 83
+ // <+, line 83
+ {
+ var c : int = this.cursor;
+ this.insert(this.cursor, this.cursor, "e");
+ this.cursor = c;
+ }
+ break;
+ case 2:
+ // (, line 86
+ // [, line 86
+ this.ket = this.cursor;
+ // next, line 86
+ if (this.cursor <= this.limit_backward)
+ {
+ return false;
+ }
+ this.cursor--;
+ // ], line 86
+ this.bra = this.cursor;
+ // delete, line 86
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ break;
+ case 3:
+ // (, line 87
+ // atmark, line 87
+ if (this.cursor != this.I_p1)
+ {
+ return false;
+ }
+ // test, line 87
+ v_4 = this.limit - this.cursor;
+ // call shortv, line 87
+ if (!this.r_shortv())
+ {
+ return false;
+ }
+ this.cursor = this.limit - v_4;
+ // <+, line 87
+ {
+ var c : int = this.cursor;
+ this.insert(this.cursor, this.cursor, "e");
+ this.cursor = c;
+ }
+ break;
+ }
+ break;
+ }
+ return true;
+ }
+
+ function r_Step_1c () : boolean
+ {
+ var v_1 : int;
+ var v_2 : int;
+ // (, line 93
+ // [, line 94
+ this.ket = this.cursor;
+ // or, line 94
+ var lab0 = true;
+ lab0: while (lab0 == true)
+ {
+ lab0 = false;
+ v_1 = this.limit - this.cursor;
+ var lab1 = true;
+ lab1: while (lab1 == true)
+ {
+ lab1 = false;
+ // literal, line 94
+ if (!(this.eq_s_b(1, "y")))
+ {
+ break lab1;
+ }
+ break lab0;
+ }
+ this.cursor = this.limit - v_1;
+ // literal, line 94
+ if (!(this.eq_s_b(1, "Y")))
+ {
+ return false;
+ }
+ }
+ // ], line 94
+ this.bra = this.cursor;
+ if (!(this.out_grouping_b(EnglishStemmer.g_v, 97, 121)))
+ {
+ return false;
+ }
+ // not, line 95
+ {
+ v_2 = this.limit - this.cursor;
+ var lab2 = true;
+ lab2: while (lab2 == true)
+ {
+ lab2 = false;
+ // atlimit, line 95
+ if (this.cursor > this.limit_backward)
+ {
+ break lab2;
+ }
+ return false;
+ }
+ this.cursor = this.limit - v_2;
+ }
+ // <-, line 96
+ if (!this.slice_from("i"))
+ {
+ return false;
+ }
+ return true;
+ }
+
+ function r_Step_2 () : boolean
+ {
+ var among_var : int;
+ // (, line 99
+ // [, line 100
+ this.ket = this.cursor;
+ // substring, line 100
+ among_var = this.find_among_b(EnglishStemmer.a_5, 24);
+ if (among_var == 0)
+ {
+ return false;
+ }
+ // ], line 100
+ this.bra = this.cursor;
+ // call R1, line 100
+ if (!this.r_R1())
+ {
+ return false;
+ }
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ // (, line 101
+ // <-, line 101
+ if (!this.slice_from("tion"))
+ {
+ return false;
+ }
+ break;
+ case 2:
+ // (, line 102
+ // <-, line 102
+ if (!this.slice_from("ence"))
+ {
+ return false;
+ }
+ break;
+ case 3:
+ // (, line 103
+ // <-, line 103
+ if (!this.slice_from("ance"))
+ {
+ return false;
+ }
+ break;
+ case 4:
+ // (, line 104
+ // <-, line 104
+ if (!this.slice_from("able"))
+ {
+ return false;
+ }
+ break;
+ case 5:
+ // (, line 105
+ // <-, line 105
+ if (!this.slice_from("ent"))
+ {
+ return false;
+ }
+ break;
+ case 6:
+ // (, line 107
+ // <-, line 107
+ if (!this.slice_from("ize"))
+ {
+ return false;
+ }
+ break;
+ case 7:
+ // (, line 109
+ // <-, line 109
+ if (!this.slice_from("ate"))
+ {
+ return false;
+ }
+ break;
+ case 8:
+ // (, line 111
+ // <-, line 111
+ if (!this.slice_from("al"))
+ {
+ return false;
+ }
+ break;
+ case 9:
+ // (, line 112
+ // <-, line 112
+ if (!this.slice_from("ful"))
+ {
+ return false;
+ }
+ break;
+ case 10:
+ // (, line 114
+ // <-, line 114
+ if (!this.slice_from("ous"))
+ {
+ return false;
+ }
+ break;
+ case 11:
+ // (, line 116
+ // <-, line 116
+ if (!this.slice_from("ive"))
+ {
+ return false;
+ }
+ break;
+ case 12:
+ // (, line 118
+ // <-, line 118
+ if (!this.slice_from("ble"))
+ {
+ return false;
+ }
+ break;
+ case 13:
+ // (, line 119
+ // literal, line 119
+ if (!(this.eq_s_b(1, "l")))
+ {
+ return false;
+ }
+ // <-, line 119
+ if (!this.slice_from("og"))
+ {
+ return false;
+ }
+ break;
+ case 14:
+ // (, line 120
+ // <-, line 120
+ if (!this.slice_from("ful"))
+ {
+ return false;
+ }
+ break;
+ case 15:
+ // (, line 121
+ // <-, line 121
+ if (!this.slice_from("less"))
+ {
+ return false;
+ }
+ break;
+ case 16:
+ // (, line 122
+ if (!(this.in_grouping_b(EnglishStemmer.g_valid_LI, 99, 116)))
+ {
+ return false;
+ }
+ // delete, line 122
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ break;
+ }
+ return true;
+ }
+
+ function r_Step_3 () : boolean
+ {
+ var among_var : int;
+ // (, line 126
+ // [, line 127
+ this.ket = this.cursor;
+ // substring, line 127
+ among_var = this.find_among_b(EnglishStemmer.a_6, 9);
+ if (among_var == 0)
+ {
+ return false;
+ }
+ // ], line 127
+ this.bra = this.cursor;
+ // call R1, line 127
+ if (!this.r_R1())
+ {
+ return false;
+ }
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ // (, line 128
+ // <-, line 128
+ if (!this.slice_from("tion"))
+ {
+ return false;
+ }
+ break;
+ case 2:
+ // (, line 129
+ // <-, line 129
+ if (!this.slice_from("ate"))
+ {
+ return false;
+ }
+ break;
+ case 3:
+ // (, line 130
+ // <-, line 130
+ if (!this.slice_from("al"))
+ {
+ return false;
+ }
+ break;
+ case 4:
+ // (, line 132
+ // <-, line 132
+ if (!this.slice_from("ic"))
+ {
+ return false;
+ }
+ break;
+ case 5:
+ // (, line 134
+ // delete, line 134
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ break;
+ case 6:
+ // (, line 136
+ // call R2, line 136
+ if (!this.r_R2())
+ {
+ return false;
+ }
+ // delete, line 136
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ break;
+ }
+ return true;
+ }
+
+ function r_Step_4 () : boolean
+ {
+ var among_var : int;
+ var v_1 : int;
+ // (, line 140
+ // [, line 141
+ this.ket = this.cursor;
+ // substring, line 141
+ among_var = this.find_among_b(EnglishStemmer.a_7, 18);
+ if (among_var == 0)
+ {
+ return false;
+ }
+ // ], line 141
+ this.bra = this.cursor;
+ // call R2, line 141
+ if (!this.r_R2())
+ {
+ return false;
+ }
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ // (, line 144
+ // delete, line 144
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ break;
+ case 2:
+ // (, line 145
+ // or, line 145
+ var lab0 = true;
+ lab0: while (lab0 == true)
+ {
+ lab0 = false;
+ v_1 = this.limit - this.cursor;
+ var lab1 = true;
+ lab1: while (lab1 == true)
+ {
+ lab1 = false;
+ // literal, line 145
+ if (!(this.eq_s_b(1, "s")))
+ {
+ break lab1;
+ }
+ break lab0;
+ }
+ this.cursor = this.limit - v_1;
+ // literal, line 145
+ if (!(this.eq_s_b(1, "t")))
+ {
+ return false;
+ }
+ }
+ // delete, line 145
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ break;
+ }
+ return true;
+ }
+
+ function r_Step_5 () : boolean
+ {
+ var among_var : int;
+ var v_1 : int;
+ var v_2 : int;
+ // (, line 149
+ // [, line 150
+ this.ket = this.cursor;
+ // substring, line 150
+ among_var = this.find_among_b(EnglishStemmer.a_8, 2);
+ if (among_var == 0)
+ {
+ return false;
+ }
+ // ], line 150
+ this.bra = this.cursor;
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ // (, line 151
+ // or, line 151
+ var lab0 = true;
+ lab0: while (lab0 == true)
+ {
+ lab0 = false;
+ v_1 = this.limit - this.cursor;
+ var lab1 = true;
+ lab1: while (lab1 == true)
+ {
+ lab1 = false;
+ // call R2, line 151
+ if (!this.r_R2())
+ {
+ break lab1;
+ }
+ break lab0;
+ }
+ this.cursor = this.limit - v_1;
+ // (, line 151
+ // call R1, line 151
+ if (!this.r_R1())
+ {
+ return false;
+ }
+ // not, line 151
+ {
+ v_2 = this.limit - this.cursor;
+ var lab2 = true;
+ lab2: while (lab2 == true)
+ {
+ lab2 = false;
+ // call shortv, line 151
+ if (!this.r_shortv())
+ {
+ break lab2;
+ }
+ return false;
+ }
+ this.cursor = this.limit - v_2;
+ }
+ }
+ // delete, line 151
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ break;
+ case 2:
+ // (, line 152
+ // call R2, line 152
+ if (!this.r_R2())
+ {
+ return false;
+ }
+ // literal, line 152
+ if (!(this.eq_s_b(1, "l")))
+ {
+ return false;
+ }
+ // delete, line 152
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ break;
+ }
+ return true;
+ }
+
+ function r_exception2 () : boolean
+ {
+ // (, line 156
+ // [, line 158
+ this.ket = this.cursor;
+ // substring, line 158
+ if (this.find_among_b(EnglishStemmer.a_9, 8) == 0)
+ {
+ return false;
+ }
+ // ], line 158
+ this.bra = this.cursor;
+ // atlimit, line 158
+ if (this.cursor > this.limit_backward)
+ {
+ return false;
+ }
+ return true;
+ }
+
+ function r_exception1 () : boolean
+ {
+ var among_var : int;
+ // (, line 168
+ // [, line 170
+ this.bra = this.cursor;
+ // substring, line 170
+ among_var = this.find_among(EnglishStemmer.a_10, 18);
+ if (among_var == 0)
+ {
+ return false;
+ }
+ // ], line 170
+ this.ket = this.cursor;
+ // atlimit, line 170
+ if (this.cursor < this.limit)
+ {
+ return false;
+ }
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ // (, line 174
+ // <-, line 174
+ if (!this.slice_from("ski"))
+ {
+ return false;
+ }
+ break;
+ case 2:
+ // (, line 175
+ // <-, line 175
+ if (!this.slice_from("sky"))
+ {
+ return false;
+ }
+ break;
+ case 3:
+ // (, line 176
+ // <-, line 176
+ if (!this.slice_from("die"))
+ {
+ return false;
+ }
+ break;
+ case 4:
+ // (, line 177
+ // <-, line 177
+ if (!this.slice_from("lie"))
+ {
+ return false;
+ }
+ break;
+ case 5:
+ // (, line 178
+ // <-, line 178
+ if (!this.slice_from("tie"))
+ {
+ return false;
+ }
+ break;
+ case 6:
+ // (, line 182
+ // <-, line 182
+ if (!this.slice_from("idl"))
+ {
+ return false;
+ }
+ break;
+ case 7:
+ // (, line 183
+ // <-, line 183
+ if (!this.slice_from("gentl"))
+ {
+ return false;
+ }
+ break;
+ case 8:
+ // (, line 184
+ // <-, line 184
+ if (!this.slice_from("ugli"))
+ {
+ return false;
+ }
+ break;
+ case 9:
+ // (, line 185
+ // <-, line 185
+ if (!this.slice_from("earli"))
+ {
+ return false;
+ }
+ break;
+ case 10:
+ // (, line 186
+ // <-, line 186
+ if (!this.slice_from("onli"))
+ {
+ return false;
+ }
+ break;
+ case 11:
+ // (, line 187
+ // <-, line 187
+ if (!this.slice_from("singl"))
+ {
+ return false;
+ }
+ break;
+ }
+ return true;
+ }
+
+ function r_postlude () : boolean
+ {
+ var v_1 : int;
+ var v_2 : int;
+ // (, line 203
+ // Boolean test Y_found, line 203
+ if (!(this.B_Y_found))
+ {
+ return false;
+ }
+ // repeat, line 203
+ replab0: while(true)
+ {
+ v_1 = this.cursor;
+ var lab1 = true;
+ lab1: while (lab1 == true)
+ {
+ lab1 = false;
+ // (, line 203
+ // goto, line 203
+ golab2: while(true)
+ {
+ v_2 = this.cursor;
+ var lab3 = true;
+ lab3: while (lab3 == true)
+ {
+ lab3 = false;
+ // (, line 203
+ // [, line 203
+ this.bra = this.cursor;
+ // literal, line 203
+ if (!(this.eq_s(1, "Y")))
+ {
+ break lab3;
+ }
+ // ], line 203
+ this.ket = this.cursor;
+ this.cursor = v_2;
+ break golab2;
+ }
+ this.cursor = v_2;
+ if (this.cursor >= this.limit)
+ {
+ break lab1;
+ }
+ this.cursor++;
+ }
+ // <-, line 203
+ if (!this.slice_from("y"))
+ {
+ return false;
+ }
+ continue replab0;
+ }
+ this.cursor = v_1;
+ break replab0;
+ }
+ return true;
+ }
+
+ override function stem () : boolean
+ {
+ var v_1 : int;
+ var v_2 : int;
+ var v_3 : int;
+ var v_4 : int;
+ var v_5 : int;
+ var v_6 : int;
+ var v_7 : int;
+ var v_8 : int;
+ var v_9 : int;
+ var v_10 : int;
+ var v_11 : int;
+ var v_12 : int;
+ var v_13 : int;
+ // (, line 205
+ // or, line 207
+ var lab0 = true;
+ lab0: while (lab0 == true)
+ {
+ lab0 = false;
+ v_1 = this.cursor;
+ var lab1 = true;
+ lab1: while (lab1 == true)
+ {
+ lab1 = false;
+ // call exception1, line 207
+ if (!this.r_exception1())
+ {
+ break lab1;
+ }
+ break lab0;
+ }
+ this.cursor = v_1;
+ var lab2 = true;
+ lab2: while (lab2 == true)
+ {
+ lab2 = false;
+ // not, line 208
+ {
+ v_2 = this.cursor;
+ var lab3 = true;
+ lab3: while (lab3 == true)
+ {
+ lab3 = false;
+ // hop, line 208
+ {
+ var c : int = this.cursor + 3;
+ if (0 > c || c > this.limit)
+ {
+ break lab3;
+ }
+ this.cursor = c;
+ }
+ break lab2;
+ }
+ this.cursor = v_2;
+ }
+ break lab0;
+ }
+ this.cursor = v_1;
+ // (, line 208
+ // do, line 209
+ v_3 = this.cursor;
+ var lab4 = true;
+ lab4: while (lab4 == true)
+ {
+ lab4 = false;
+ // call prelude, line 209
+ if (!this.r_prelude())
+ {
+ break lab4;
+ }
+ }
+ this.cursor = v_3;
+ // do, line 210
+ v_4 = this.cursor;
+ var lab5 = true;
+ lab5: while (lab5 == true)
+ {
+ lab5 = false;
+ // call mark_regions, line 210
+ if (!this.r_mark_regions())
+ {
+ break lab5;
+ }
+ }
+ this.cursor = v_4;
+ // backwards, line 211
+ this.limit_backward = this.cursor; this.cursor = this.limit;
+ // (, line 211
+ // do, line 213
+ v_5 = this.limit - this.cursor;
+ var lab6 = true;
+ lab6: while (lab6 == true)
+ {
+ lab6 = false;
+ // call Step_1a, line 213
+ if (!this.r_Step_1a())
+ {
+ break lab6;
+ }
+ }
+ this.cursor = this.limit - v_5;
+ // or, line 215
+ var lab7 = true;
+ lab7: while (lab7 == true)
+ {
+ lab7 = false;
+ v_6 = this.limit - this.cursor;
+ var lab8 = true;
+ lab8: while (lab8 == true)
+ {
+ lab8 = false;
+ // call exception2, line 215
+ if (!this.r_exception2())
+ {
+ break lab8;
+ }
+ break lab7;
+ }
+ this.cursor = this.limit - v_6;
+ // (, line 215
+ // do, line 217
+ v_7 = this.limit - this.cursor;
+ var lab9 = true;
+ lab9: while (lab9 == true)
+ {
+ lab9 = false;
+ // call Step_1b, line 217
+ if (!this.r_Step_1b())
+ {
+ break lab9;
+ }
+ }
+ this.cursor = this.limit - v_7;
+ // do, line 218
+ v_8 = this.limit - this.cursor;
+ var lab10 = true;
+ lab10: while (lab10 == true)
+ {
+ lab10 = false;
+ // call Step_1c, line 218
+ if (!this.r_Step_1c())
+ {
+ break lab10;
+ }
+ }
+ this.cursor = this.limit - v_8;
+ // do, line 220
+ v_9 = this.limit - this.cursor;
+ var lab11 = true;
+ lab11: while (lab11 == true)
+ {
+ lab11 = false;
+ // call Step_2, line 220
+ if (!this.r_Step_2())
+ {
+ break lab11;
+ }
+ }
+ this.cursor = this.limit - v_9;
+ // do, line 221
+ v_10 = this.limit - this.cursor;
+ var lab12 = true;
+ lab12: while (lab12 == true)
+ {
+ lab12 = false;
+ // call Step_3, line 221
+ if (!this.r_Step_3())
+ {
+ break lab12;
+ }
+ }
+ this.cursor = this.limit - v_10;
+ // do, line 222
+ v_11 = this.limit - this.cursor;
+ var lab13 = true;
+ lab13: while (lab13 == true)
+ {
+ lab13 = false;
+ // call Step_4, line 222
+ if (!this.r_Step_4())
+ {
+ break lab13;
+ }
+ }
+ this.cursor = this.limit - v_11;
+ // do, line 224
+ v_12 = this.limit - this.cursor;
+ var lab14 = true;
+ lab14: while (lab14 == true)
+ {
+ lab14 = false;
+ // call Step_5, line 224
+ if (!this.r_Step_5())
+ {
+ break lab14;
+ }
+ }
+ this.cursor = this.limit - v_12;
+ }
+ this.cursor = this.limit_backward; // do, line 227
+ v_13 = this.cursor;
+ var lab15 = true;
+ lab15: while (lab15 == true)
+ {
+ lab15 = false;
+ // call postlude, line 227
+ if (!this.r_postlude())
+ {
+ break lab15;
+ }
+ }
+ this.cursor = v_13;
+ }
+ return true;
+ }
+
+ function equals (o : variant) : boolean {
+ return o instanceof EnglishStemmer;
+ }
+
+ function hashCode() : int
+ {
+ //http://stackoverflow.com/questions/194846/is-there-any-kind-of-hashcode-function-in-javascript
+ var classname = "EnglishStemmer";
+ var hash = 0;
+ if (classname.length == 0) return hash;
+ for (var i = 0; i < classname.length; i++) {
+ var char = classname.charCodeAt(i);
+ hash = ((hash << 5) - hash) + char;
+ hash = hash & hash; // Convert to 32bit integer
+ }
+ return hash;
+ }
+
+}
+
diff --git a/web/server/h2o/libh2o/misc/oktavia/src/stemmer/finnish-stemmer.jsx b/web/server/h2o/libh2o/misc/oktavia/src/stemmer/finnish-stemmer.jsx
new file mode 100644
index 00000000..35a1d56a
--- /dev/null
+++ b/web/server/h2o/libh2o/misc/oktavia/src/stemmer/finnish-stemmer.jsx
@@ -0,0 +1,1208 @@
+// This file was generated automatically by the Snowball to JSX compiler
+
+import "base-stemmer.jsx";
+import "among.jsx";
+
+ /**
+ * This class was automatically generated by a Snowball to JSX compiler
+ * It implements the stemming algorithm defined by a snowball script.
+ */
+
+class FinnishStemmer extends BaseStemmer
+{
+ static const serialVersionUID = 1;
+ static const methodObject = new FinnishStemmer();
+
+ static const a_0 = [
+ new Among("pa", -1, 1),
+ new Among("sti", -1, 2),
+ new Among("kaan", -1, 1),
+ new Among("han", -1, 1),
+ new Among("kin", -1, 1),
+ new Among("h\u00E4n", -1, 1),
+ new Among("k\u00E4\u00E4n", -1, 1),
+ new Among("ko", -1, 1),
+ new Among("p\u00E4", -1, 1),
+ new Among("k\u00F6", -1, 1)
+ ];
+
+ static const a_1 = [
+ new Among("lla", -1, -1),
+ new Among("na", -1, -1),
+ new Among("ssa", -1, -1),
+ new Among("ta", -1, -1),
+ new Among("lta", 3, -1),
+ new Among("sta", 3, -1)
+ ];
+
+ static const a_2 = [
+ new Among("ll\u00E4", -1, -1),
+ new Among("n\u00E4", -1, -1),
+ new Among("ss\u00E4", -1, -1),
+ new Among("t\u00E4", -1, -1),
+ new Among("lt\u00E4", 3, -1),
+ new Among("st\u00E4", 3, -1)
+ ];
+
+ static const a_3 = [
+ new Among("lle", -1, -1),
+ new Among("ine", -1, -1)
+ ];
+
+ static const a_4 = [
+ new Among("nsa", -1, 3),
+ new Among("mme", -1, 3),
+ new Among("nne", -1, 3),
+ new Among("ni", -1, 2),
+ new Among("si", -1, 1),
+ new Among("an", -1, 4),
+ new Among("en", -1, 6),
+ new Among("\u00E4n", -1, 5),
+ new Among("ns\u00E4", -1, 3)
+ ];
+
+ static const a_5 = [
+ new Among("aa", -1, -1),
+ new Among("ee", -1, -1),
+ new Among("ii", -1, -1),
+ new Among("oo", -1, -1),
+ new Among("uu", -1, -1),
+ new Among("\u00E4\u00E4", -1, -1),
+ new Among("\u00F6\u00F6", -1, -1)
+ ];
+
+ static const a_6 = [
+ new Among("a", -1, 8),
+ new Among("lla", 0, -1),
+ new Among("na", 0, -1),
+ new Among("ssa", 0, -1),
+ new Among("ta", 0, -1),
+ new Among("lta", 4, -1),
+ new Among("sta", 4, -1),
+ new Among("tta", 4, 9),
+ new Among("lle", -1, -1),
+ new Among("ine", -1, -1),
+ new Among("ksi", -1, -1),
+ new Among("n", -1, 7),
+ new Among("han", 11, 1),
+ new Among("den", 11, -1, ((instance : BaseStemmer) : boolean -> (instance as FinnishStemmer).r_VI()), FinnishStemmer.methodObject),
+ new Among("seen", 11, -1, ((instance : BaseStemmer) : boolean -> (instance as FinnishStemmer).r_LONG()), FinnishStemmer.methodObject),
+ new Among("hen", 11, 2),
+ new Among("tten", 11, -1, ((instance : BaseStemmer) : boolean -> (instance as FinnishStemmer).r_VI()), FinnishStemmer.methodObject),
+ new Among("hin", 11, 3),
+ new Among("siin", 11, -1, ((instance : BaseStemmer) : boolean -> (instance as FinnishStemmer).r_VI()), FinnishStemmer.methodObject),
+ new Among("hon", 11, 4),
+ new Among("h\u00E4n", 11, 5),
+ new Among("h\u00F6n", 11, 6),
+ new Among("\u00E4", -1, 8),
+ new Among("ll\u00E4", 22, -1),
+ new Among("n\u00E4", 22, -1),
+ new Among("ss\u00E4", 22, -1),
+ new Among("t\u00E4", 22, -1),
+ new Among("lt\u00E4", 26, -1),
+ new Among("st\u00E4", 26, -1),
+ new Among("tt\u00E4", 26, 9)
+ ];
+
+ static const a_7 = [
+ new Among("eja", -1, -1),
+ new Among("mma", -1, 1),
+ new Among("imma", 1, -1),
+ new Among("mpa", -1, 1),
+ new Among("impa", 3, -1),
+ new Among("mmi", -1, 1),
+ new Among("immi", 5, -1),
+ new Among("mpi", -1, 1),
+ new Among("impi", 7, -1),
+ new Among("ej\u00E4", -1, -1),
+ new Among("mm\u00E4", -1, 1),
+ new Among("imm\u00E4", 10, -1),
+ new Among("mp\u00E4", -1, 1),
+ new Among("imp\u00E4", 12, -1)
+ ];
+
+ static const a_8 = [
+ new Among("i", -1, -1),
+ new Among("j", -1, -1)
+ ];
+
+ static const a_9 = [
+ new Among("mma", -1, 1),
+ new Among("imma", 0, -1)
+ ];
+
+ static const g_AEI = [17, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8] : int[];
+
+ static const g_V1 = [17, 65, 16, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 32] : int[];
+
+ static const g_V2 = [17, 65, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 32] : int[];
+
+ static const g_particle_end = [17, 97, 24, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 32] : int[];
+
+ var B_ending_removed : boolean = false;
+ var S_x : string = "";
+ var I_p2 : int = 0;
+ var I_p1 : int = 0;
+
+ function copy_from (other : FinnishStemmer) : void
+ {
+ this.B_ending_removed = other.B_ending_removed;
+ this.S_x = other.S_x;
+ this.I_p2 = other.I_p2;
+ this.I_p1 = other.I_p1;
+ super.copy_from(other);
+ }
+
+ function r_mark_regions () : boolean
+ {
+ var v_1 : int;
+ var v_3 : int;
+ // (, line 41
+ this.I_p1 = this.limit;
+ this.I_p2 = this.limit;
+ // goto, line 46
+ golab0: while(true)
+ {
+ v_1 = this.cursor;
+ var lab1 = true;
+ lab1: while (lab1 == true)
+ {
+ lab1 = false;
+ if (!(this.in_grouping(FinnishStemmer.g_V1, 97, 246)))
+ {
+ break lab1;
+ }
+ this.cursor = v_1;
+ break golab0;
+ }
+ this.cursor = v_1;
+ if (this.cursor >= this.limit)
+ {
+ return false;
+ }
+ this.cursor++;
+ }
+ // gopast, line 46
+ golab2: while(true)
+ {
+ var lab3 = true;
+ lab3: while (lab3 == true)
+ {
+ lab3 = false;
+ if (!(this.out_grouping(FinnishStemmer.g_V1, 97, 246)))
+ {
+ break lab3;
+ }
+ break golab2;
+ }
+ if (this.cursor >= this.limit)
+ {
+ return false;
+ }
+ this.cursor++;
+ }
+ // setmark p1, line 46
+ this.I_p1 = this.cursor;
+ // goto, line 47
+ golab4: while(true)
+ {
+ v_3 = this.cursor;
+ var lab5 = true;
+ lab5: while (lab5 == true)
+ {
+ lab5 = false;
+ if (!(this.in_grouping(FinnishStemmer.g_V1, 97, 246)))
+ {
+ break lab5;
+ }
+ this.cursor = v_3;
+ break golab4;
+ }
+ this.cursor = v_3;
+ if (this.cursor >= this.limit)
+ {
+ return false;
+ }
+ this.cursor++;
+ }
+ // gopast, line 47
+ golab6: while(true)
+ {
+ var lab7 = true;
+ lab7: while (lab7 == true)
+ {
+ lab7 = false;
+ if (!(this.out_grouping(FinnishStemmer.g_V1, 97, 246)))
+ {
+ break lab7;
+ }
+ break golab6;
+ }
+ if (this.cursor >= this.limit)
+ {
+ return false;
+ }
+ this.cursor++;
+ }
+ // setmark p2, line 47
+ this.I_p2 = this.cursor;
+ return true;
+ }
+
+ function r_R2 () : boolean
+ {
+ if (!(this.I_p2 <= this.cursor))
+ {
+ return false;
+ }
+ return true;
+ }
+
+ function r_particle_etc () : boolean
+ {
+ var among_var : int;
+ var v_1 : int;
+ var v_2 : int;
+ // (, line 54
+ // setlimit, line 55
+ v_1 = this.limit - this.cursor;
+ // tomark, line 55
+ if (this.cursor < this.I_p1)
+ {
+ return false;
+ }
+ this.cursor = this.I_p1;
+ v_2 = this.limit_backward;
+ this.limit_backward = this.cursor;
+ this.cursor = this.limit - v_1;
+ // (, line 55
+ // [, line 55
+ this.ket = this.cursor;
+ // substring, line 55
+ among_var = this.find_among_b(FinnishStemmer.a_0, 10);
+ if (among_var == 0)
+ {
+ this.limit_backward = v_2;
+ return false;
+ }
+ // ], line 55
+ this.bra = this.cursor;
+ this.limit_backward = v_2;
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ // (, line 62
+ if (!(this.in_grouping_b(FinnishStemmer.g_particle_end, 97, 246)))
+ {
+ return false;
+ }
+ break;
+ case 2:
+ // (, line 64
+ // call R2, line 64
+ if (!this.r_R2())
+ {
+ return false;
+ }
+ break;
+ }
+ // delete, line 66
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ return true;
+ }
+
+ function r_possessive () : boolean
+ {
+ var among_var : int;
+ var v_1 : int;
+ var v_2 : int;
+ var v_3 : int;
+ // (, line 68
+ // setlimit, line 69
+ v_1 = this.limit - this.cursor;
+ // tomark, line 69
+ if (this.cursor < this.I_p1)
+ {
+ return false;
+ }
+ this.cursor = this.I_p1;
+ v_2 = this.limit_backward;
+ this.limit_backward = this.cursor;
+ this.cursor = this.limit - v_1;
+ // (, line 69
+ // [, line 69
+ this.ket = this.cursor;
+ // substring, line 69
+ among_var = this.find_among_b(FinnishStemmer.a_4, 9);
+ if (among_var == 0)
+ {
+ this.limit_backward = v_2;
+ return false;
+ }
+ // ], line 69
+ this.bra = this.cursor;
+ this.limit_backward = v_2;
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ // (, line 72
+ // not, line 72
+ {
+ v_3 = this.limit - this.cursor;
+ var lab0 = true;
+ lab0: while (lab0 == true)
+ {
+ lab0 = false;
+ // literal, line 72
+ if (!(this.eq_s_b(1, "k")))
+ {
+ break lab0;
+ }
+ return false;
+ }
+ this.cursor = this.limit - v_3;
+ }
+ // delete, line 72
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ break;
+ case 2:
+ // (, line 74
+ // delete, line 74
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ // [, line 74
+ this.ket = this.cursor;
+ // literal, line 74
+ if (!(this.eq_s_b(3, "kse")))
+ {
+ return false;
+ }
+ // ], line 74
+ this.bra = this.cursor;
+ // <-, line 74
+ if (!this.slice_from("ksi"))
+ {
+ return false;
+ }
+ break;
+ case 3:
+ // (, line 78
+ // delete, line 78
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ break;
+ case 4:
+ // (, line 81
+ // among, line 81
+ if (this.find_among_b(FinnishStemmer.a_1, 6) == 0)
+ {
+ return false;
+ }
+ // delete, line 81
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ break;
+ case 5:
+ // (, line 83
+ // among, line 83
+ if (this.find_among_b(FinnishStemmer.a_2, 6) == 0)
+ {
+ return false;
+ }
+ // delete, line 84
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ break;
+ case 6:
+ // (, line 86
+ // among, line 86
+ if (this.find_among_b(FinnishStemmer.a_3, 2) == 0)
+ {
+ return false;
+ }
+ // delete, line 86
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ break;
+ }
+ return true;
+ }
+
+ function r_LONG () : boolean
+ {
+ // among, line 91
+ if (this.find_among_b(FinnishStemmer.a_5, 7) == 0)
+ {
+ return false;
+ }
+ return true;
+ }
+
+ function r_VI () : boolean
+ {
+ // (, line 93
+ // literal, line 93
+ if (!(this.eq_s_b(1, "i")))
+ {
+ return false;
+ }
+ if (!(this.in_grouping_b(FinnishStemmer.g_V2, 97, 246)))
+ {
+ return false;
+ }
+ return true;
+ }
+
+ function r_case_ending () : boolean
+ {
+ var among_var : int;
+ var v_1 : int;
+ var v_2 : int;
+ var v_3 : int;
+ var v_4 : int;
+ var v_5 : int;
+ // (, line 95
+ // setlimit, line 96
+ v_1 = this.limit - this.cursor;
+ // tomark, line 96
+ if (this.cursor < this.I_p1)
+ {
+ return false;
+ }
+ this.cursor = this.I_p1;
+ v_2 = this.limit_backward;
+ this.limit_backward = this.cursor;
+ this.cursor = this.limit - v_1;
+ // (, line 96
+ // [, line 96
+ this.ket = this.cursor;
+ // substring, line 96
+ among_var = this.find_among_b(FinnishStemmer.a_6, 30);
+ if (among_var == 0)
+ {
+ this.limit_backward = v_2;
+ return false;
+ }
+ // ], line 96
+ this.bra = this.cursor;
+ this.limit_backward = v_2;
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ // (, line 98
+ // literal, line 98
+ if (!(this.eq_s_b(1, "a")))
+ {
+ return false;
+ }
+ break;
+ case 2:
+ // (, line 99
+ // literal, line 99
+ if (!(this.eq_s_b(1, "e")))
+ {
+ return false;
+ }
+ break;
+ case 3:
+ // (, line 100
+ // literal, line 100
+ if (!(this.eq_s_b(1, "i")))
+ {
+ return false;
+ }
+ break;
+ case 4:
+ // (, line 101
+ // literal, line 101
+ if (!(this.eq_s_b(1, "o")))
+ {
+ return false;
+ }
+ break;
+ case 5:
+ // (, line 102
+ // literal, line 102
+ if (!(this.eq_s_b(1, "\u00E4")))
+ {
+ return false;
+ }
+ break;
+ case 6:
+ // (, line 103
+ // literal, line 103
+ if (!(this.eq_s_b(1, "\u00F6")))
+ {
+ return false;
+ }
+ break;
+ case 7:
+ // (, line 111
+ // try, line 111
+ v_3 = this.limit - this.cursor;
+ var lab0 = true;
+ lab0: while (lab0 == true)
+ {
+ lab0 = false;
+ // (, line 111
+ // and, line 113
+ v_4 = this.limit - this.cursor;
+ // or, line 112
+ var lab1 = true;
+ lab1: while (lab1 == true)
+ {
+ lab1 = false;
+ v_5 = this.limit - this.cursor;
+ var lab2 = true;
+ lab2: while (lab2 == true)
+ {
+ lab2 = false;
+ // call LONG, line 111
+ if (!this.r_LONG())
+ {
+ break lab2;
+ }
+ break lab1;
+ }
+ this.cursor = this.limit - v_5;
+ // literal, line 112
+ if (!(this.eq_s_b(2, "ie")))
+ {
+ this.cursor = this.limit - v_3;
+ break lab0;
+ }
+ }
+ this.cursor = this.limit - v_4;
+ // next, line 113
+ if (this.cursor <= this.limit_backward)
+ {
+ this.cursor = this.limit - v_3;
+ break lab0;
+ }
+ this.cursor--;
+ // ], line 113
+ this.bra = this.cursor;
+ }
+ break;
+ case 8:
+ // (, line 119
+ if (!(this.in_grouping_b(FinnishStemmer.g_V1, 97, 246)))
+ {
+ return false;
+ }
+ if (!(this.out_grouping_b(FinnishStemmer.g_V1, 97, 246)))
+ {
+ return false;
+ }
+ break;
+ case 9:
+ // (, line 121
+ // literal, line 121
+ if (!(this.eq_s_b(1, "e")))
+ {
+ return false;
+ }
+ break;
+ }
+ // delete, line 138
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ // set ending_removed, line 139
+ this.B_ending_removed = true;
+ return true;
+ }
+
+ function r_other_endings () : boolean
+ {
+ var among_var : int;
+ var v_1 : int;
+ var v_2 : int;
+ var v_3 : int;
+ // (, line 141
+ // setlimit, line 142
+ v_1 = this.limit - this.cursor;
+ // tomark, line 142
+ if (this.cursor < this.I_p2)
+ {
+ return false;
+ }
+ this.cursor = this.I_p2;
+ v_2 = this.limit_backward;
+ this.limit_backward = this.cursor;
+ this.cursor = this.limit - v_1;
+ // (, line 142
+ // [, line 142
+ this.ket = this.cursor;
+ // substring, line 142
+ among_var = this.find_among_b(FinnishStemmer.a_7, 14);
+ if (among_var == 0)
+ {
+ this.limit_backward = v_2;
+ return false;
+ }
+ // ], line 142
+ this.bra = this.cursor;
+ this.limit_backward = v_2;
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ // (, line 146
+ // not, line 146
+ {
+ v_3 = this.limit - this.cursor;
+ var lab0 = true;
+ lab0: while (lab0 == true)
+ {
+ lab0 = false;
+ // literal, line 146
+ if (!(this.eq_s_b(2, "po")))
+ {
+ break lab0;
+ }
+ return false;
+ }
+ this.cursor = this.limit - v_3;
+ }
+ break;
+ }
+ // delete, line 151
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ return true;
+ }
+
+ function r_i_plural () : boolean
+ {
+ var v_1 : int;
+ var v_2 : int;
+ // (, line 153
+ // setlimit, line 154
+ v_1 = this.limit - this.cursor;
+ // tomark, line 154
+ if (this.cursor < this.I_p1)
+ {
+ return false;
+ }
+ this.cursor = this.I_p1;
+ v_2 = this.limit_backward;
+ this.limit_backward = this.cursor;
+ this.cursor = this.limit - v_1;
+ // (, line 154
+ // [, line 154
+ this.ket = this.cursor;
+ // substring, line 154
+ if (this.find_among_b(FinnishStemmer.a_8, 2) == 0)
+ {
+ this.limit_backward = v_2;
+ return false;
+ }
+ // ], line 154
+ this.bra = this.cursor;
+ this.limit_backward = v_2;
+ // delete, line 158
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ return true;
+ }
+
+ function r_t_plural () : boolean
+ {
+ var among_var : int;
+ var v_1 : int;
+ var v_2 : int;
+ var v_3 : int;
+ var v_4 : int;
+ var v_5 : int;
+ var v_6 : int;
+ // (, line 160
+ // setlimit, line 161
+ v_1 = this.limit - this.cursor;
+ // tomark, line 161
+ if (this.cursor < this.I_p1)
+ {
+ return false;
+ }
+ this.cursor = this.I_p1;
+ v_2 = this.limit_backward;
+ this.limit_backward = this.cursor;
+ this.cursor = this.limit - v_1;
+ // (, line 161
+ // [, line 162
+ this.ket = this.cursor;
+ // literal, line 162
+ if (!(this.eq_s_b(1, "t")))
+ {
+ this.limit_backward = v_2;
+ return false;
+ }
+ // ], line 162
+ this.bra = this.cursor;
+ // test, line 162
+ v_3 = this.limit - this.cursor;
+ if (!(this.in_grouping_b(FinnishStemmer.g_V1, 97, 246)))
+ {
+ this.limit_backward = v_2;
+ return false;
+ }
+ this.cursor = this.limit - v_3;
+ // delete, line 163
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ this.limit_backward = v_2;
+ // setlimit, line 165
+ v_4 = this.limit - this.cursor;
+ // tomark, line 165
+ if (this.cursor < this.I_p2)
+ {
+ return false;
+ }
+ this.cursor = this.I_p2;
+ v_5 = this.limit_backward;
+ this.limit_backward = this.cursor;
+ this.cursor = this.limit - v_4;
+ // (, line 165
+ // [, line 165
+ this.ket = this.cursor;
+ // substring, line 165
+ among_var = this.find_among_b(FinnishStemmer.a_9, 2);
+ if (among_var == 0)
+ {
+ this.limit_backward = v_5;
+ return false;
+ }
+ // ], line 165
+ this.bra = this.cursor;
+ this.limit_backward = v_5;
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ // (, line 167
+ // not, line 167
+ {
+ v_6 = this.limit - this.cursor;
+ var lab0 = true;
+ lab0: while (lab0 == true)
+ {
+ lab0 = false;
+ // literal, line 167
+ if (!(this.eq_s_b(2, "po")))
+ {
+ break lab0;
+ }
+ return false;
+ }
+ this.cursor = this.limit - v_6;
+ }
+ break;
+ }
+ // delete, line 170
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ return true;
+ }
+
+ function r_tidy () : boolean
+ {
+ var v_1 : int;
+ var v_2 : int;
+ var v_3 : int;
+ var v_4 : int;
+ var v_5 : int;
+ var v_6 : int;
+ var v_7 : int;
+ var v_8 : int;
+ var v_9 : int;
+ // (, line 172
+ // setlimit, line 173
+ v_1 = this.limit - this.cursor;
+ // tomark, line 173
+ if (this.cursor < this.I_p1)
+ {
+ return false;
+ }
+ this.cursor = this.I_p1;
+ v_2 = this.limit_backward;
+ this.limit_backward = this.cursor;
+ this.cursor = this.limit - v_1;
+ // (, line 173
+ // do, line 174
+ v_3 = this.limit - this.cursor;
+ var lab0 = true;
+ lab0: while (lab0 == true)
+ {
+ lab0 = false;
+ // (, line 174
+ // and, line 174
+ v_4 = this.limit - this.cursor;
+ // call LONG, line 174
+ if (!this.r_LONG())
+ {
+ break lab0;
+ }
+ this.cursor = this.limit - v_4;
+ // (, line 174
+ // [, line 174
+ this.ket = this.cursor;
+ // next, line 174
+ if (this.cursor <= this.limit_backward)
+ {
+ break lab0;
+ }
+ this.cursor--;
+ // ], line 174
+ this.bra = this.cursor;
+ // delete, line 174
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ }
+ this.cursor = this.limit - v_3;
+ // do, line 175
+ v_5 = this.limit - this.cursor;
+ var lab1 = true;
+ lab1: while (lab1 == true)
+ {
+ lab1 = false;
+ // (, line 175
+ // [, line 175
+ this.ket = this.cursor;
+ if (!(this.in_grouping_b(FinnishStemmer.g_AEI, 97, 228)))
+ {
+ break lab1;
+ }
+ // ], line 175
+ this.bra = this.cursor;
+ if (!(this.out_grouping_b(FinnishStemmer.g_V1, 97, 246)))
+ {
+ break lab1;
+ }
+ // delete, line 175
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ }
+ this.cursor = this.limit - v_5;
+ // do, line 176
+ v_6 = this.limit - this.cursor;
+ var lab2 = true;
+ lab2: while (lab2 == true)
+ {
+ lab2 = false;
+ // (, line 176
+ // [, line 176
+ this.ket = this.cursor;
+ // literal, line 176
+ if (!(this.eq_s_b(1, "j")))
+ {
+ break lab2;
+ }
+ // ], line 176
+ this.bra = this.cursor;
+ // or, line 176
+ var lab3 = true;
+ lab3: while (lab3 == true)
+ {
+ lab3 = false;
+ v_7 = this.limit - this.cursor;
+ var lab4 = true;
+ lab4: while (lab4 == true)
+ {
+ lab4 = false;
+ // literal, line 176
+ if (!(this.eq_s_b(1, "o")))
+ {
+ break lab4;
+ }
+ break lab3;
+ }
+ this.cursor = this.limit - v_7;
+ // literal, line 176
+ if (!(this.eq_s_b(1, "u")))
+ {
+ break lab2;
+ }
+ }
+ // delete, line 176
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ }
+ this.cursor = this.limit - v_6;
+ // do, line 177
+ v_8 = this.limit - this.cursor;
+ var lab5 = true;
+ lab5: while (lab5 == true)
+ {
+ lab5 = false;
+ // (, line 177
+ // [, line 177
+ this.ket = this.cursor;
+ // literal, line 177
+ if (!(this.eq_s_b(1, "o")))
+ {
+ break lab5;
+ }
+ // ], line 177
+ this.bra = this.cursor;
+ // literal, line 177
+ if (!(this.eq_s_b(1, "j")))
+ {
+ break lab5;
+ }
+ // delete, line 177
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ }
+ this.cursor = this.limit - v_8;
+ this.limit_backward = v_2;
+ // goto, line 179
+ golab6: while(true)
+ {
+ v_9 = this.limit - this.cursor;
+ var lab7 = true;
+ lab7: while (lab7 == true)
+ {
+ lab7 = false;
+ if (!(this.out_grouping_b(FinnishStemmer.g_V1, 97, 246)))
+ {
+ break lab7;
+ }
+ this.cursor = this.limit - v_9;
+ break golab6;
+ }
+ this.cursor = this.limit - v_9;
+ if (this.cursor <= this.limit_backward)
+ {
+ return false;
+ }
+ this.cursor--;
+ }
+ // [, line 179
+ this.ket = this.cursor;
+ // next, line 179
+ if (this.cursor <= this.limit_backward)
+ {
+ return false;
+ }
+ this.cursor--;
+ // ], line 179
+ this.bra = this.cursor;
+ // -> x, line 179
+ this.S_x = this.slice_to(this.S_x);
+ if (this.S_x == '')
+ {
+ return false;
+ }
+ // name x, line 179
+ if (!(this.eq_v_b(this.S_x)))
+ {
+ return false;
+ }
+ // delete, line 179
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ return true;
+ }
+
+ override function stem () : boolean
+ {
+ var v_1 : int;
+ var v_2 : int;
+ var v_3 : int;
+ var v_4 : int;
+ var v_5 : int;
+ var v_6 : int;
+ var v_7 : int;
+ var v_8 : int;
+ var v_9 : int;
+ // (, line 183
+ // do, line 185
+ v_1 = this.cursor;
+ var lab0 = true;
+ lab0: while (lab0 == true)
+ {
+ lab0 = false;
+ // call mark_regions, line 185
+ if (!this.r_mark_regions())
+ {
+ break lab0;
+ }
+ }
+ this.cursor = v_1;
+ // unset ending_removed, line 186
+ this.B_ending_removed = false;
+ // backwards, line 187
+ this.limit_backward = this.cursor; this.cursor = this.limit;
+ // (, line 187
+ // do, line 188
+ v_2 = this.limit - this.cursor;
+ var lab1 = true;
+ lab1: while (lab1 == true)
+ {
+ lab1 = false;
+ // call particle_etc, line 188
+ if (!this.r_particle_etc())
+ {
+ break lab1;
+ }
+ }
+ this.cursor = this.limit - v_2;
+ // do, line 189
+ v_3 = this.limit - this.cursor;
+ var lab2 = true;
+ lab2: while (lab2 == true)
+ {
+ lab2 = false;
+ // call possessive, line 189
+ if (!this.r_possessive())
+ {
+ break lab2;
+ }
+ }
+ this.cursor = this.limit - v_3;
+ // do, line 190
+ v_4 = this.limit - this.cursor;
+ var lab3 = true;
+ lab3: while (lab3 == true)
+ {
+ lab3 = false;
+ // call case_ending, line 190
+ if (!this.r_case_ending())
+ {
+ break lab3;
+ }
+ }
+ this.cursor = this.limit - v_4;
+ // do, line 191
+ v_5 = this.limit - this.cursor;
+ var lab4 = true;
+ lab4: while (lab4 == true)
+ {
+ lab4 = false;
+ // call other_endings, line 191
+ if (!this.r_other_endings())
+ {
+ break lab4;
+ }
+ }
+ this.cursor = this.limit - v_5;
+ // or, line 192
+ var lab5 = true;
+ lab5: while (lab5 == true)
+ {
+ lab5 = false;
+ v_6 = this.limit - this.cursor;
+ var lab6 = true;
+ lab6: while (lab6 == true)
+ {
+ lab6 = false;
+ // (, line 192
+ // Boolean test ending_removed, line 192
+ if (!(this.B_ending_removed))
+ {
+ break lab6;
+ }
+ // do, line 192
+ v_7 = this.limit - this.cursor;
+ var lab7 = true;
+ lab7: while (lab7 == true)
+ {
+ lab7 = false;
+ // call i_plural, line 192
+ if (!this.r_i_plural())
+ {
+ break lab7;
+ }
+ }
+ this.cursor = this.limit - v_7;
+ break lab5;
+ }
+ this.cursor = this.limit - v_6;
+ // do, line 192
+ v_8 = this.limit - this.cursor;
+ var lab8 = true;
+ lab8: while (lab8 == true)
+ {
+ lab8 = false;
+ // call t_plural, line 192
+ if (!this.r_t_plural())
+ {
+ break lab8;
+ }
+ }
+ this.cursor = this.limit - v_8;
+ }
+ // do, line 193
+ v_9 = this.limit - this.cursor;
+ var lab9 = true;
+ lab9: while (lab9 == true)
+ {
+ lab9 = false;
+ // call tidy, line 193
+ if (!this.r_tidy())
+ {
+ break lab9;
+ }
+ }
+ this.cursor = this.limit - v_9;
+ this.cursor = this.limit_backward; return true;
+ }
+
+ function equals (o : variant) : boolean {
+ return o instanceof FinnishStemmer;
+ }
+
+ function hashCode() : int
+ {
+ //http://stackoverflow.com/questions/194846/is-there-any-kind-of-hashcode-function-in-javascript
+ var classname = "FinnishStemmer";
+ var hash = 0;
+ if (classname.length == 0) return hash;
+ for (var i = 0; i < classname.length; i++) {
+ var char = classname.charCodeAt(i);
+ hash = ((hash << 5) - hash) + char;
+ hash = hash & hash; // Convert to 32bit integer
+ }
+ return hash;
+ }
+
+}
+
diff --git a/web/server/h2o/libh2o/misc/oktavia/src/stemmer/french-stemmer.jsx b/web/server/h2o/libh2o/misc/oktavia/src/stemmer/french-stemmer.jsx
new file mode 100644
index 00000000..3d937818
--- /dev/null
+++ b/web/server/h2o/libh2o/misc/oktavia/src/stemmer/french-stemmer.jsx
@@ -0,0 +1,1867 @@
+// This file was generated automatically by the Snowball to JSX compiler
+
+import "base-stemmer.jsx";
+import "among.jsx";
+
+ /**
+ * This class was automatically generated by a Snowball to JSX compiler
+ * It implements the stemming algorithm defined by a snowball script.
+ */
+
+class FrenchStemmer extends BaseStemmer
+{
+ static const serialVersionUID = 1;
+ static const methodObject = new FrenchStemmer();
+
+ static const a_0 = [
+ new Among("col", -1, -1),
+ new Among("par", -1, -1),
+ new Among("tap", -1, -1)
+ ];
+
+ static const a_1 = [
+ new Among("", -1, 4),
+ new Among("I", 0, 1),
+ new Among("U", 0, 2),
+ new Among("Y", 0, 3)
+ ];
+
+ static const a_2 = [
+ new Among("iqU", -1, 3),
+ new Among("abl", -1, 3),
+ new Among("I\u00E8r", -1, 4),
+ new Among("i\u00E8r", -1, 4),
+ new Among("eus", -1, 2),
+ new Among("iv", -1, 1)
+ ];
+
+ static const a_3 = [
+ new Among("ic", -1, 2),
+ new Among("abil", -1, 1),
+ new Among("iv", -1, 3)
+ ];
+
+ static const a_4 = [
+ new Among("iqUe", -1, 1),
+ new Among("atrice", -1, 2),
+ new Among("ance", -1, 1),
+ new Among("ence", -1, 5),
+ new Among("logie", -1, 3),
+ new Among("able", -1, 1),
+ new Among("isme", -1, 1),
+ new Among("euse", -1, 11),
+ new Among("iste", -1, 1),
+ new Among("ive", -1, 8),
+ new Among("if", -1, 8),
+ new Among("usion", -1, 4),
+ new Among("ation", -1, 2),
+ new Among("ution", -1, 4),
+ new Among("ateur", -1, 2),
+ new Among("iqUes", -1, 1),
+ new Among("atrices", -1, 2),
+ new Among("ances", -1, 1),
+ new Among("ences", -1, 5),
+ new Among("logies", -1, 3),
+ new Among("ables", -1, 1),
+ new Among("ismes", -1, 1),
+ new Among("euses", -1, 11),
+ new Among("istes", -1, 1),
+ new Among("ives", -1, 8),
+ new Among("ifs", -1, 8),
+ new Among("usions", -1, 4),
+ new Among("ations", -1, 2),
+ new Among("utions", -1, 4),
+ new Among("ateurs", -1, 2),
+ new Among("ments", -1, 15),
+ new Among("ements", 30, 6),
+ new Among("issements", 31, 12),
+ new Among("it\u00E9s", -1, 7),
+ new Among("ment", -1, 15),
+ new Among("ement", 34, 6),
+ new Among("issement", 35, 12),
+ new Among("amment", 34, 13),
+ new Among("emment", 34, 14),
+ new Among("aux", -1, 10),
+ new Among("eaux", 39, 9),
+ new Among("eux", -1, 1),
+ new Among("it\u00E9", -1, 7)
+ ];
+
+ static const a_5 = [
+ new Among("ira", -1, 1),
+ new Among("ie", -1, 1),
+ new Among("isse", -1, 1),
+ new Among("issante", -1, 1),
+ new Among("i", -1, 1),
+ new Among("irai", 4, 1),
+ new Among("ir", -1, 1),
+ new Among("iras", -1, 1),
+ new Among("ies", -1, 1),
+ new Among("\u00EEmes", -1, 1),
+ new Among("isses", -1, 1),
+ new Among("issantes", -1, 1),
+ new Among("\u00EEtes", -1, 1),
+ new Among("is", -1, 1),
+ new Among("irais", 13, 1),
+ new Among("issais", 13, 1),
+ new Among("irions", -1, 1),
+ new Among("issions", -1, 1),
+ new Among("irons", -1, 1),
+ new Among("issons", -1, 1),
+ new Among("issants", -1, 1),
+ new Among("it", -1, 1),
+ new Among("irait", 21, 1),
+ new Among("issait", 21, 1),
+ new Among("issant", -1, 1),
+ new Among("iraIent", -1, 1),
+ new Among("issaIent", -1, 1),
+ new Among("irent", -1, 1),
+ new Among("issent", -1, 1),
+ new Among("iront", -1, 1),
+ new Among("\u00EEt", -1, 1),
+ new Among("iriez", -1, 1),
+ new Among("issiez", -1, 1),
+ new Among("irez", -1, 1),
+ new Among("issez", -1, 1)
+ ];
+
+ static const a_6 = [
+ new Among("a", -1, 3),
+ new Among("era", 0, 2),
+ new Among("asse", -1, 3),
+ new Among("ante", -1, 3),
+ new Among("\u00E9e", -1, 2),
+ new Among("ai", -1, 3),
+ new Among("erai", 5, 2),
+ new Among("er", -1, 2),
+ new Among("as", -1, 3),
+ new Among("eras", 8, 2),
+ new Among("\u00E2mes", -1, 3),
+ new Among("asses", -1, 3),
+ new Among("antes", -1, 3),
+ new Among("\u00E2tes", -1, 3),
+ new Among("\u00E9es", -1, 2),
+ new Among("ais", -1, 3),
+ new Among("erais", 15, 2),
+ new Among("ions", -1, 1),
+ new Among("erions", 17, 2),
+ new Among("assions", 17, 3),
+ new Among("erons", -1, 2),
+ new Among("ants", -1, 3),
+ new Among("\u00E9s", -1, 2),
+ new Among("ait", -1, 3),
+ new Among("erait", 23, 2),
+ new Among("ant", -1, 3),
+ new Among("aIent", -1, 3),
+ new Among("eraIent", 26, 2),
+ new Among("\u00E8rent", -1, 2),
+ new Among("assent", -1, 3),
+ new Among("eront", -1, 2),
+ new Among("\u00E2t", -1, 3),
+ new Among("ez", -1, 2),
+ new Among("iez", 32, 2),
+ new Among("eriez", 33, 2),
+ new Among("assiez", 33, 3),
+ new Among("erez", 32, 2),
+ new Among("\u00E9", -1, 2)
+ ];
+
+ static const a_7 = [
+ new Among("e", -1, 3),
+ new Among("I\u00E8re", 0, 2),
+ new Among("i\u00E8re", 0, 2),
+ new Among("ion", -1, 1),
+ new Among("Ier", -1, 2),
+ new Among("ier", -1, 2),
+ new Among("\u00EB", -1, 4)
+ ];
+
+ static const a_8 = [
+ new Among("ell", -1, -1),
+ new Among("eill", -1, -1),
+ new Among("enn", -1, -1),
+ new Among("onn", -1, -1),
+ new Among("ett", -1, -1)
+ ];
+
+ static const g_v = [17, 65, 16, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128, 130, 103, 8, 5] : int[];
+
+ static const g_keep_with_s = [1, 65, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128] : int[];
+
+ var I_p2 : int = 0;
+ var I_p1 : int = 0;
+ var I_pV : int = 0;
+
+ function copy_from (other : FrenchStemmer) : void
+ {
+ this.I_p2 = other.I_p2;
+ this.I_p1 = other.I_p1;
+ this.I_pV = other.I_pV;
+ super.copy_from(other);
+ }
+
+ function r_prelude () : boolean
+ {
+ var v_1 : int;
+ var v_2 : int;
+ var v_3 : int;
+ var v_4 : int;
+ // repeat, line 38
+ replab0: while(true)
+ {
+ v_1 = this.cursor;
+ var lab1 = true;
+ lab1: while (lab1 == true)
+ {
+ lab1 = false;
+ // goto, line 38
+ golab2: while(true)
+ {
+ v_2 = this.cursor;
+ var lab3 = true;
+ lab3: while (lab3 == true)
+ {
+ lab3 = false;
+ // (, line 38
+ // or, line 44
+ var lab4 = true;
+ lab4: while (lab4 == true)
+ {
+ lab4 = false;
+ v_3 = this.cursor;
+ var lab5 = true;
+ lab5: while (lab5 == true)
+ {
+ lab5 = false;
+ // (, line 40
+ if (!(this.in_grouping(FrenchStemmer.g_v, 97, 251)))
+ {
+ break lab5;
+ }
+ // [, line 40
+ this.bra = this.cursor;
+ // or, line 40
+ var lab6 = true;
+ lab6: while (lab6 == true)
+ {
+ lab6 = false;
+ v_4 = this.cursor;
+ var lab7 = true;
+ lab7: while (lab7 == true)
+ {
+ lab7 = false;
+ // (, line 40
+ // literal, line 40
+ if (!(this.eq_s(1, "u")))
+ {
+ break lab7;
+ }
+ // ], line 40
+ this.ket = this.cursor;
+ if (!(this.in_grouping(FrenchStemmer.g_v, 97, 251)))
+ {
+ break lab7;
+ }
+ // <-, line 40
+ if (!this.slice_from("U"))
+ {
+ return false;
+ }
+ break lab6;
+ }
+ this.cursor = v_4;
+ var lab8 = true;
+ lab8: while (lab8 == true)
+ {
+ lab8 = false;
+ // (, line 41
+ // literal, line 41
+ if (!(this.eq_s(1, "i")))
+ {
+ break lab8;
+ }
+ // ], line 41
+ this.ket = this.cursor;
+ if (!(this.in_grouping(FrenchStemmer.g_v, 97, 251)))
+ {
+ break lab8;
+ }
+ // <-, line 41
+ if (!this.slice_from("I"))
+ {
+ return false;
+ }
+ break lab6;
+ }
+ this.cursor = v_4;
+ // (, line 42
+ // literal, line 42
+ if (!(this.eq_s(1, "y")))
+ {
+ break lab5;
+ }
+ // ], line 42
+ this.ket = this.cursor;
+ // <-, line 42
+ if (!this.slice_from("Y"))
+ {
+ return false;
+ }
+ }
+ break lab4;
+ }
+ this.cursor = v_3;
+ var lab9 = true;
+ lab9: while (lab9 == true)
+ {
+ lab9 = false;
+ // (, line 45
+ // [, line 45
+ this.bra = this.cursor;
+ // literal, line 45
+ if (!(this.eq_s(1, "y")))
+ {
+ break lab9;
+ }
+ // ], line 45
+ this.ket = this.cursor;
+ if (!(this.in_grouping(FrenchStemmer.g_v, 97, 251)))
+ {
+ break lab9;
+ }
+ // <-, line 45
+ if (!this.slice_from("Y"))
+ {
+ return false;
+ }
+ break lab4;
+ }
+ this.cursor = v_3;
+ // (, line 47
+ // literal, line 47
+ if (!(this.eq_s(1, "q")))
+ {
+ break lab3;
+ }
+ // [, line 47
+ this.bra = this.cursor;
+ // literal, line 47
+ if (!(this.eq_s(1, "u")))
+ {
+ break lab3;
+ }
+ // ], line 47
+ this.ket = this.cursor;
+ // <-, line 47
+ if (!this.slice_from("U"))
+ {
+ return false;
+ }
+ }
+ this.cursor = v_2;
+ break golab2;
+ }
+ this.cursor = v_2;
+ if (this.cursor >= this.limit)
+ {
+ break lab1;
+ }
+ this.cursor++;
+ }
+ continue replab0;
+ }
+ this.cursor = v_1;
+ break replab0;
+ }
+ return true;
+ }
+
+ function r_mark_regions () : boolean
+ {
+ var v_1 : int;
+ var v_2 : int;
+ var v_4 : int;
+ // (, line 50
+ this.I_pV = this.limit;
+ this.I_p1 = this.limit;
+ this.I_p2 = this.limit;
+ // do, line 56
+ v_1 = this.cursor;
+ var lab0 = true;
+ lab0: while (lab0 == true)
+ {
+ lab0 = false;
+ // (, line 56
+ // or, line 58
+ var lab1 = true;
+ lab1: while (lab1 == true)
+ {
+ lab1 = false;
+ v_2 = this.cursor;
+ var lab2 = true;
+ lab2: while (lab2 == true)
+ {
+ lab2 = false;
+ // (, line 57
+ if (!(this.in_grouping(FrenchStemmer.g_v, 97, 251)))
+ {
+ break lab2;
+ }
+ if (!(this.in_grouping(FrenchStemmer.g_v, 97, 251)))
+ {
+ break lab2;
+ }
+ // next, line 57
+ if (this.cursor >= this.limit)
+ {
+ break lab2;
+ }
+ this.cursor++;
+ break lab1;
+ }
+ this.cursor = v_2;
+ var lab3 = true;
+ lab3: while (lab3 == true)
+ {
+ lab3 = false;
+ // among, line 59
+ if (this.find_among(FrenchStemmer.a_0, 3) == 0)
+ {
+ break lab3;
+ }
+ break lab1;
+ }
+ this.cursor = v_2;
+ // (, line 66
+ // next, line 66
+ if (this.cursor >= this.limit)
+ {
+ break lab0;
+ }
+ this.cursor++;
+ // gopast, line 66
+ golab4: while(true)
+ {
+ var lab5 = true;
+ lab5: while (lab5 == true)
+ {
+ lab5 = false;
+ if (!(this.in_grouping(FrenchStemmer.g_v, 97, 251)))
+ {
+ break lab5;
+ }
+ break golab4;
+ }
+ if (this.cursor >= this.limit)
+ {
+ break lab0;
+ }
+ this.cursor++;
+ }
+ }
+ // setmark pV, line 67
+ this.I_pV = this.cursor;
+ }
+ this.cursor = v_1;
+ // do, line 69
+ v_4 = this.cursor;
+ var lab6 = true;
+ lab6: while (lab6 == true)
+ {
+ lab6 = false;
+ // (, line 69
+ // gopast, line 70
+ golab7: while(true)
+ {
+ var lab8 = true;
+ lab8: while (lab8 == true)
+ {
+ lab8 = false;
+ if (!(this.in_grouping(FrenchStemmer.g_v, 97, 251)))
+ {
+ break lab8;
+ }
+ break golab7;
+ }
+ if (this.cursor >= this.limit)
+ {
+ break lab6;
+ }
+ this.cursor++;
+ }
+ // gopast, line 70
+ golab9: while(true)
+ {
+ var lab10 = true;
+ lab10: while (lab10 == true)
+ {
+ lab10 = false;
+ if (!(this.out_grouping(FrenchStemmer.g_v, 97, 251)))
+ {
+ break lab10;
+ }
+ break golab9;
+ }
+ if (this.cursor >= this.limit)
+ {
+ break lab6;
+ }
+ this.cursor++;
+ }
+ // setmark p1, line 70
+ this.I_p1 = this.cursor;
+ // gopast, line 71
+ golab11: while(true)
+ {
+ var lab12 = true;
+ lab12: while (lab12 == true)
+ {
+ lab12 = false;
+ if (!(this.in_grouping(FrenchStemmer.g_v, 97, 251)))
+ {
+ break lab12;
+ }
+ break golab11;
+ }
+ if (this.cursor >= this.limit)
+ {
+ break lab6;
+ }
+ this.cursor++;
+ }
+ // gopast, line 71
+ golab13: while(true)
+ {
+ var lab14 = true;
+ lab14: while (lab14 == true)
+ {
+ lab14 = false;
+ if (!(this.out_grouping(FrenchStemmer.g_v, 97, 251)))
+ {
+ break lab14;
+ }
+ break golab13;
+ }
+ if (this.cursor >= this.limit)
+ {
+ break lab6;
+ }
+ this.cursor++;
+ }
+ // setmark p2, line 71
+ this.I_p2 = this.cursor;
+ }
+ this.cursor = v_4;
+ return true;
+ }
+
+ function r_postlude () : boolean
+ {
+ var among_var : int;
+ var v_1 : int;
+ // repeat, line 75
+ replab0: while(true)
+ {
+ v_1 = this.cursor;
+ var lab1 = true;
+ lab1: while (lab1 == true)
+ {
+ lab1 = false;
+ // (, line 75
+ // [, line 77
+ this.bra = this.cursor;
+ // substring, line 77
+ among_var = this.find_among(FrenchStemmer.a_1, 4);
+ if (among_var == 0)
+ {
+ break lab1;
+ }
+ // ], line 77
+ this.ket = this.cursor;
+ switch (among_var) {
+ case 0:
+ break lab1;
+ case 1:
+ // (, line 78
+ // <-, line 78
+ if (!this.slice_from("i"))
+ {
+ return false;
+ }
+ break;
+ case 2:
+ // (, line 79
+ // <-, line 79
+ if (!this.slice_from("u"))
+ {
+ return false;
+ }
+ break;
+ case 3:
+ // (, line 80
+ // <-, line 80
+ if (!this.slice_from("y"))
+ {
+ return false;
+ }
+ break;
+ case 4:
+ // (, line 81
+ // next, line 81
+ if (this.cursor >= this.limit)
+ {
+ break lab1;
+ }
+ this.cursor++;
+ break;
+ }
+ continue replab0;
+ }
+ this.cursor = v_1;
+ break replab0;
+ }
+ return true;
+ }
+
+ function r_RV () : boolean
+ {
+ if (!(this.I_pV <= this.cursor))
+ {
+ return false;
+ }
+ return true;
+ }
+
+ function r_R1 () : boolean
+ {
+ if (!(this.I_p1 <= this.cursor))
+ {
+ return false;
+ }
+ return true;
+ }
+
+ function r_R2 () : boolean
+ {
+ if (!(this.I_p2 <= this.cursor))
+ {
+ return false;
+ }
+ return true;
+ }
+
+ function r_standard_suffix () : boolean
+ {
+ var among_var : int;
+ var v_1 : int;
+ var v_2 : int;
+ var v_3 : int;
+ var v_4 : int;
+ var v_5 : int;
+ var v_6 : int;
+ var v_7 : int;
+ var v_8 : int;
+ var v_9 : int;
+ var v_10 : int;
+ var v_11 : int;
+ // (, line 91
+ // [, line 92
+ this.ket = this.cursor;
+ // substring, line 92
+ among_var = this.find_among_b(FrenchStemmer.a_4, 43);
+ if (among_var == 0)
+ {
+ return false;
+ }
+ // ], line 92
+ this.bra = this.cursor;
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ // (, line 96
+ // call R2, line 96
+ if (!this.r_R2())
+ {
+ return false;
+ }
+ // delete, line 96
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ break;
+ case 2:
+ // (, line 99
+ // call R2, line 99
+ if (!this.r_R2())
+ {
+ return false;
+ }
+ // delete, line 99
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ // try, line 100
+ v_1 = this.limit - this.cursor;
+ var lab0 = true;
+ lab0: while (lab0 == true)
+ {
+ lab0 = false;
+ // (, line 100
+ // [, line 100
+ this.ket = this.cursor;
+ // literal, line 100
+ if (!(this.eq_s_b(2, "ic")))
+ {
+ this.cursor = this.limit - v_1;
+ break lab0;
+ }
+ // ], line 100
+ this.bra = this.cursor;
+ // or, line 100
+ var lab1 = true;
+ lab1: while (lab1 == true)
+ {
+ lab1 = false;
+ v_2 = this.limit - this.cursor;
+ var lab2 = true;
+ lab2: while (lab2 == true)
+ {
+ lab2 = false;
+ // (, line 100
+ // call R2, line 100
+ if (!this.r_R2())
+ {
+ break lab2;
+ }
+ // delete, line 100
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ break lab1;
+ }
+ this.cursor = this.limit - v_2;
+ // <-, line 100
+ if (!this.slice_from("iqU"))
+ {
+ return false;
+ }
+ }
+ }
+ break;
+ case 3:
+ // (, line 104
+ // call R2, line 104
+ if (!this.r_R2())
+ {
+ return false;
+ }
+ // <-, line 104
+ if (!this.slice_from("log"))
+ {
+ return false;
+ }
+ break;
+ case 4:
+ // (, line 107
+ // call R2, line 107
+ if (!this.r_R2())
+ {
+ return false;
+ }
+ // <-, line 107
+ if (!this.slice_from("u"))
+ {
+ return false;
+ }
+ break;
+ case 5:
+ // (, line 110
+ // call R2, line 110
+ if (!this.r_R2())
+ {
+ return false;
+ }
+ // <-, line 110
+ if (!this.slice_from("ent"))
+ {
+ return false;
+ }
+ break;
+ case 6:
+ // (, line 113
+ // call RV, line 114
+ if (!this.r_RV())
+ {
+ return false;
+ }
+ // delete, line 114
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ // try, line 115
+ v_3 = this.limit - this.cursor;
+ var lab3 = true;
+ lab3: while (lab3 == true)
+ {
+ lab3 = false;
+ // (, line 115
+ // [, line 116
+ this.ket = this.cursor;
+ // substring, line 116
+ among_var = this.find_among_b(FrenchStemmer.a_2, 6);
+ if (among_var == 0)
+ {
+ this.cursor = this.limit - v_3;
+ break lab3;
+ }
+ // ], line 116
+ this.bra = this.cursor;
+ switch (among_var) {
+ case 0:
+ this.cursor = this.limit - v_3;
+ break lab3;
+ case 1:
+ // (, line 117
+ // call R2, line 117
+ if (!this.r_R2())
+ {
+ this.cursor = this.limit - v_3;
+ break lab3;
+ }
+ // delete, line 117
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ // [, line 117
+ this.ket = this.cursor;
+ // literal, line 117
+ if (!(this.eq_s_b(2, "at")))
+ {
+ this.cursor = this.limit - v_3;
+ break lab3;
+ }
+ // ], line 117
+ this.bra = this.cursor;
+ // call R2, line 117
+ if (!this.r_R2())
+ {
+ this.cursor = this.limit - v_3;
+ break lab3;
+ }
+ // delete, line 117
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ break;
+ case 2:
+ // (, line 118
+ // or, line 118
+ var lab4 = true;
+ lab4: while (lab4 == true)
+ {
+ lab4 = false;
+ v_4 = this.limit - this.cursor;
+ var lab5 = true;
+ lab5: while (lab5 == true)
+ {
+ lab5 = false;
+ // (, line 118
+ // call R2, line 118
+ if (!this.r_R2())
+ {
+ break lab5;
+ }
+ // delete, line 118
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ break lab4;
+ }
+ this.cursor = this.limit - v_4;
+ // (, line 118
+ // call R1, line 118
+ if (!this.r_R1())
+ {
+ this.cursor = this.limit - v_3;
+ break lab3;
+ }
+ // <-, line 118
+ if (!this.slice_from("eux"))
+ {
+ return false;
+ }
+ }
+ break;
+ case 3:
+ // (, line 120
+ // call R2, line 120
+ if (!this.r_R2())
+ {
+ this.cursor = this.limit - v_3;
+ break lab3;
+ }
+ // delete, line 120
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ break;
+ case 4:
+ // (, line 122
+ // call RV, line 122
+ if (!this.r_RV())
+ {
+ this.cursor = this.limit - v_3;
+ break lab3;
+ }
+ // <-, line 122
+ if (!this.slice_from("i"))
+ {
+ return false;
+ }
+ break;
+ }
+ }
+ break;
+ case 7:
+ // (, line 128
+ // call R2, line 129
+ if (!this.r_R2())
+ {
+ return false;
+ }
+ // delete, line 129
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ // try, line 130
+ v_5 = this.limit - this.cursor;
+ var lab6 = true;
+ lab6: while (lab6 == true)
+ {
+ lab6 = false;
+ // (, line 130
+ // [, line 131
+ this.ket = this.cursor;
+ // substring, line 131
+ among_var = this.find_among_b(FrenchStemmer.a_3, 3);
+ if (among_var == 0)
+ {
+ this.cursor = this.limit - v_5;
+ break lab6;
+ }
+ // ], line 131
+ this.bra = this.cursor;
+ switch (among_var) {
+ case 0:
+ this.cursor = this.limit - v_5;
+ break lab6;
+ case 1:
+ // (, line 132
+ // or, line 132
+ var lab7 = true;
+ lab7: while (lab7 == true)
+ {
+ lab7 = false;
+ v_6 = this.limit - this.cursor;
+ var lab8 = true;
+ lab8: while (lab8 == true)
+ {
+ lab8 = false;
+ // (, line 132
+ // call R2, line 132
+ if (!this.r_R2())
+ {
+ break lab8;
+ }
+ // delete, line 132
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ break lab7;
+ }
+ this.cursor = this.limit - v_6;
+ // <-, line 132
+ if (!this.slice_from("abl"))
+ {
+ return false;
+ }
+ }
+ break;
+ case 2:
+ // (, line 133
+ // or, line 133
+ var lab9 = true;
+ lab9: while (lab9 == true)
+ {
+ lab9 = false;
+ v_7 = this.limit - this.cursor;
+ var lab10 = true;
+ lab10: while (lab10 == true)
+ {
+ lab10 = false;
+ // (, line 133
+ // call R2, line 133
+ if (!this.r_R2())
+ {
+ break lab10;
+ }
+ // delete, line 133
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ break lab9;
+ }
+ this.cursor = this.limit - v_7;
+ // <-, line 133
+ if (!this.slice_from("iqU"))
+ {
+ return false;
+ }
+ }
+ break;
+ case 3:
+ // (, line 134
+ // call R2, line 134
+ if (!this.r_R2())
+ {
+ this.cursor = this.limit - v_5;
+ break lab6;
+ }
+ // delete, line 134
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ break;
+ }
+ }
+ break;
+ case 8:
+ // (, line 140
+ // call R2, line 141
+ if (!this.r_R2())
+ {
+ return false;
+ }
+ // delete, line 141
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ // try, line 142
+ v_8 = this.limit - this.cursor;
+ var lab11 = true;
+ lab11: while (lab11 == true)
+ {
+ lab11 = false;
+ // (, line 142
+ // [, line 142
+ this.ket = this.cursor;
+ // literal, line 142
+ if (!(this.eq_s_b(2, "at")))
+ {
+ this.cursor = this.limit - v_8;
+ break lab11;
+ }
+ // ], line 142
+ this.bra = this.cursor;
+ // call R2, line 142
+ if (!this.r_R2())
+ {
+ this.cursor = this.limit - v_8;
+ break lab11;
+ }
+ // delete, line 142
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ // [, line 142
+ this.ket = this.cursor;
+ // literal, line 142
+ if (!(this.eq_s_b(2, "ic")))
+ {
+ this.cursor = this.limit - v_8;
+ break lab11;
+ }
+ // ], line 142
+ this.bra = this.cursor;
+ // or, line 142
+ var lab12 = true;
+ lab12: while (lab12 == true)
+ {
+ lab12 = false;
+ v_9 = this.limit - this.cursor;
+ var lab13 = true;
+ lab13: while (lab13 == true)
+ {
+ lab13 = false;
+ // (, line 142
+ // call R2, line 142
+ if (!this.r_R2())
+ {
+ break lab13;
+ }
+ // delete, line 142
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ break lab12;
+ }
+ this.cursor = this.limit - v_9;
+ // <-, line 142
+ if (!this.slice_from("iqU"))
+ {
+ return false;
+ }
+ }
+ }
+ break;
+ case 9:
+ // (, line 144
+ // <-, line 144
+ if (!this.slice_from("eau"))
+ {
+ return false;
+ }
+ break;
+ case 10:
+ // (, line 145
+ // call R1, line 145
+ if (!this.r_R1())
+ {
+ return false;
+ }
+ // <-, line 145
+ if (!this.slice_from("al"))
+ {
+ return false;
+ }
+ break;
+ case 11:
+ // (, line 147
+ // or, line 147
+ var lab14 = true;
+ lab14: while (lab14 == true)
+ {
+ lab14 = false;
+ v_10 = this.limit - this.cursor;
+ var lab15 = true;
+ lab15: while (lab15 == true)
+ {
+ lab15 = false;
+ // (, line 147
+ // call R2, line 147
+ if (!this.r_R2())
+ {
+ break lab15;
+ }
+ // delete, line 147
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ break lab14;
+ }
+ this.cursor = this.limit - v_10;
+ // (, line 147
+ // call R1, line 147
+ if (!this.r_R1())
+ {
+ return false;
+ }
+ // <-, line 147
+ if (!this.slice_from("eux"))
+ {
+ return false;
+ }
+ }
+ break;
+ case 12:
+ // (, line 150
+ // call R1, line 150
+ if (!this.r_R1())
+ {
+ return false;
+ }
+ if (!(this.out_grouping_b(FrenchStemmer.g_v, 97, 251)))
+ {
+ return false;
+ }
+ // delete, line 150
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ break;
+ case 13:
+ // (, line 155
+ // call RV, line 155
+ if (!this.r_RV())
+ {
+ return false;
+ }
+ // fail, line 155
+ // (, line 155
+ // <-, line 155
+ if (!this.slice_from("ant"))
+ {
+ return false;
+ }
+ return false;
+ case 14:
+ // (, line 156
+ // call RV, line 156
+ if (!this.r_RV())
+ {
+ return false;
+ }
+ // fail, line 156
+ // (, line 156
+ // <-, line 156
+ if (!this.slice_from("ent"))
+ {
+ return false;
+ }
+ return false;
+ case 15:
+ // (, line 158
+ // test, line 158
+ v_11 = this.limit - this.cursor;
+ // (, line 158
+ if (!(this.in_grouping_b(FrenchStemmer.g_v, 97, 251)))
+ {
+ return false;
+ }
+ // call RV, line 158
+ if (!this.r_RV())
+ {
+ return false;
+ }
+ this.cursor = this.limit - v_11;
+ // fail, line 158
+ // (, line 158
+ // delete, line 158
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ return false;
+ }
+ return true;
+ }
+
+ function r_i_verb_suffix () : boolean
+ {
+ var among_var : int;
+ var v_1 : int;
+ var v_2 : int;
+ // setlimit, line 163
+ v_1 = this.limit - this.cursor;
+ // tomark, line 163
+ if (this.cursor < this.I_pV)
+ {
+ return false;
+ }
+ this.cursor = this.I_pV;
+ v_2 = this.limit_backward;
+ this.limit_backward = this.cursor;
+ this.cursor = this.limit - v_1;
+ // (, line 163
+ // [, line 164
+ this.ket = this.cursor;
+ // substring, line 164
+ among_var = this.find_among_b(FrenchStemmer.a_5, 35);
+ if (among_var == 0)
+ {
+ this.limit_backward = v_2;
+ return false;
+ }
+ // ], line 164
+ this.bra = this.cursor;
+ switch (among_var) {
+ case 0:
+ this.limit_backward = v_2;
+ return false;
+ case 1:
+ // (, line 170
+ if (!(this.out_grouping_b(FrenchStemmer.g_v, 97, 251)))
+ {
+ this.limit_backward = v_2;
+ return false;
+ }
+ // delete, line 170
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ break;
+ }
+ this.limit_backward = v_2;
+ return true;
+ }
+
+ function r_verb_suffix () : boolean
+ {
+ var among_var : int;
+ var v_1 : int;
+ var v_2 : int;
+ var v_3 : int;
+ // setlimit, line 174
+ v_1 = this.limit - this.cursor;
+ // tomark, line 174
+ if (this.cursor < this.I_pV)
+ {
+ return false;
+ }
+ this.cursor = this.I_pV;
+ v_2 = this.limit_backward;
+ this.limit_backward = this.cursor;
+ this.cursor = this.limit - v_1;
+ // (, line 174
+ // [, line 175
+ this.ket = this.cursor;
+ // substring, line 175
+ among_var = this.find_among_b(FrenchStemmer.a_6, 38);
+ if (among_var == 0)
+ {
+ this.limit_backward = v_2;
+ return false;
+ }
+ // ], line 175
+ this.bra = this.cursor;
+ switch (among_var) {
+ case 0:
+ this.limit_backward = v_2;
+ return false;
+ case 1:
+ // (, line 177
+ // call R2, line 177
+ if (!this.r_R2())
+ {
+ this.limit_backward = v_2;
+ return false;
+ }
+ // delete, line 177
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ break;
+ case 2:
+ // (, line 185
+ // delete, line 185
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ break;
+ case 3:
+ // (, line 190
+ // delete, line 190
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ // try, line 191
+ v_3 = this.limit - this.cursor;
+ var lab0 = true;
+ lab0: while (lab0 == true)
+ {
+ lab0 = false;
+ // (, line 191
+ // [, line 191
+ this.ket = this.cursor;
+ // literal, line 191
+ if (!(this.eq_s_b(1, "e")))
+ {
+ this.cursor = this.limit - v_3;
+ break lab0;
+ }
+ // ], line 191
+ this.bra = this.cursor;
+ // delete, line 191
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ }
+ break;
+ }
+ this.limit_backward = v_2;
+ return true;
+ }
+
+ function r_residual_suffix () : boolean
+ {
+ var among_var : int;
+ var v_1 : int;
+ var v_2 : int;
+ var v_3 : int;
+ var v_4 : int;
+ var v_5 : int;
+ // (, line 198
+ // try, line 199
+ v_1 = this.limit - this.cursor;
+ var lab0 = true;
+ lab0: while (lab0 == true)
+ {
+ lab0 = false;
+ // (, line 199
+ // [, line 199
+ this.ket = this.cursor;
+ // literal, line 199
+ if (!(this.eq_s_b(1, "s")))
+ {
+ this.cursor = this.limit - v_1;
+ break lab0;
+ }
+ // ], line 199
+ this.bra = this.cursor;
+ // test, line 199
+ v_2 = this.limit - this.cursor;
+ if (!(this.out_grouping_b(FrenchStemmer.g_keep_with_s, 97, 232)))
+ {
+ this.cursor = this.limit - v_1;
+ break lab0;
+ }
+ this.cursor = this.limit - v_2;
+ // delete, line 199
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ }
+ // setlimit, line 200
+ v_3 = this.limit - this.cursor;
+ // tomark, line 200
+ if (this.cursor < this.I_pV)
+ {
+ return false;
+ }
+ this.cursor = this.I_pV;
+ v_4 = this.limit_backward;
+ this.limit_backward = this.cursor;
+ this.cursor = this.limit - v_3;
+ // (, line 200
+ // [, line 201
+ this.ket = this.cursor;
+ // substring, line 201
+ among_var = this.find_among_b(FrenchStemmer.a_7, 7);
+ if (among_var == 0)
+ {
+ this.limit_backward = v_4;
+ return false;
+ }
+ // ], line 201
+ this.bra = this.cursor;
+ switch (among_var) {
+ case 0:
+ this.limit_backward = v_4;
+ return false;
+ case 1:
+ // (, line 202
+ // call R2, line 202
+ if (!this.r_R2())
+ {
+ this.limit_backward = v_4;
+ return false;
+ }
+ // or, line 202
+ var lab1 = true;
+ lab1: while (lab1 == true)
+ {
+ lab1 = false;
+ v_5 = this.limit - this.cursor;
+ var lab2 = true;
+ lab2: while (lab2 == true)
+ {
+ lab2 = false;
+ // literal, line 202
+ if (!(this.eq_s_b(1, "s")))
+ {
+ break lab2;
+ }
+ break lab1;
+ }
+ this.cursor = this.limit - v_5;
+ // literal, line 202
+ if (!(this.eq_s_b(1, "t")))
+ {
+ this.limit_backward = v_4;
+ return false;
+ }
+ }
+ // delete, line 202
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ break;
+ case 2:
+ // (, line 204
+ // <-, line 204
+ if (!this.slice_from("i"))
+ {
+ return false;
+ }
+ break;
+ case 3:
+ // (, line 205
+ // delete, line 205
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ break;
+ case 4:
+ // (, line 206
+ // literal, line 206
+ if (!(this.eq_s_b(2, "gu")))
+ {
+ this.limit_backward = v_4;
+ return false;
+ }
+ // delete, line 206
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ break;
+ }
+ this.limit_backward = v_4;
+ return true;
+ }
+
+ function r_un_double () : boolean
+ {
+ var v_1 : int;
+ // (, line 211
+ // test, line 212
+ v_1 = this.limit - this.cursor;
+ // among, line 212
+ if (this.find_among_b(FrenchStemmer.a_8, 5) == 0)
+ {
+ return false;
+ }
+ this.cursor = this.limit - v_1;
+ // [, line 212
+ this.ket = this.cursor;
+ // next, line 212
+ if (this.cursor <= this.limit_backward)
+ {
+ return false;
+ }
+ this.cursor--;
+ // ], line 212
+ this.bra = this.cursor;
+ // delete, line 212
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ return true;
+ }
+
+ function r_un_accent () : boolean
+ {
+ var v_3 : int;
+ // (, line 215
+ // atleast, line 216
+ {
+ var v_1 = 1;
+ // atleast, line 216
+ replab0: while(true)
+ {
+ var lab1 = true;
+ lab1: while (lab1 == true)
+ {
+ lab1 = false;
+ if (!(this.out_grouping_b(FrenchStemmer.g_v, 97, 251)))
+ {
+ break lab1;
+ }
+ v_1--;
+ continue replab0;
+ }
+ break replab0;
+ }
+ if (v_1 > 0)
+ {
+ return false;
+ }
+ }
+ // [, line 217
+ this.ket = this.cursor;
+ // or, line 217
+ var lab2 = true;
+ lab2: while (lab2 == true)
+ {
+ lab2 = false;
+ v_3 = this.limit - this.cursor;
+ var lab3 = true;
+ lab3: while (lab3 == true)
+ {
+ lab3 = false;
+ // literal, line 217
+ if (!(this.eq_s_b(1, "\u00E9")))
+ {
+ break lab3;
+ }
+ break lab2;
+ }
+ this.cursor = this.limit - v_3;
+ // literal, line 217
+ if (!(this.eq_s_b(1, "\u00E8")))
+ {
+ return false;
+ }
+ }
+ // ], line 217
+ this.bra = this.cursor;
+ // <-, line 217
+ if (!this.slice_from("e"))
+ {
+ return false;
+ }
+ return true;
+ }
+
+ override function stem () : boolean
+ {
+ var v_1 : int;
+ var v_2 : int;
+ var v_3 : int;
+ var v_4 : int;
+ var v_5 : int;
+ var v_6 : int;
+ var v_7 : int;
+ var v_8 : int;
+ var v_9 : int;
+ var v_10 : int;
+ var v_11 : int;
+ // (, line 221
+ // do, line 223
+ v_1 = this.cursor;
+ var lab0 = true;
+ lab0: while (lab0 == true)
+ {
+ lab0 = false;
+ // call prelude, line 223
+ if (!this.r_prelude())
+ {
+ break lab0;
+ }
+ }
+ this.cursor = v_1;
+ // do, line 224
+ v_2 = this.cursor;
+ var lab1 = true;
+ lab1: while (lab1 == true)
+ {
+ lab1 = false;
+ // call mark_regions, line 224
+ if (!this.r_mark_regions())
+ {
+ break lab1;
+ }
+ }
+ this.cursor = v_2;
+ // backwards, line 225
+ this.limit_backward = this.cursor; this.cursor = this.limit;
+ // (, line 225
+ // do, line 227
+ v_3 = this.limit - this.cursor;
+ var lab2 = true;
+ lab2: while (lab2 == true)
+ {
+ lab2 = false;
+ // (, line 227
+ // or, line 237
+ var lab3 = true;
+ lab3: while (lab3 == true)
+ {
+ lab3 = false;
+ v_4 = this.limit - this.cursor;
+ var lab4 = true;
+ lab4: while (lab4 == true)
+ {
+ lab4 = false;
+ // (, line 228
+ // and, line 233
+ v_5 = this.limit - this.cursor;
+ // (, line 229
+ // or, line 229
+ var lab5 = true;
+ lab5: while (lab5 == true)
+ {
+ lab5 = false;
+ v_6 = this.limit - this.cursor;
+ var lab6 = true;
+ lab6: while (lab6 == true)
+ {
+ lab6 = false;
+ // call standard_suffix, line 229
+ if (!this.r_standard_suffix())
+ {
+ break lab6;
+ }
+ break lab5;
+ }
+ this.cursor = this.limit - v_6;
+ var lab7 = true;
+ lab7: while (lab7 == true)
+ {
+ lab7 = false;
+ // call i_verb_suffix, line 230
+ if (!this.r_i_verb_suffix())
+ {
+ break lab7;
+ }
+ break lab5;
+ }
+ this.cursor = this.limit - v_6;
+ // call verb_suffix, line 231
+ if (!this.r_verb_suffix())
+ {
+ break lab4;
+ }
+ }
+ this.cursor = this.limit - v_5;
+ // try, line 234
+ v_7 = this.limit - this.cursor;
+ var lab8 = true;
+ lab8: while (lab8 == true)
+ {
+ lab8 = false;
+ // (, line 234
+ // [, line 234
+ this.ket = this.cursor;
+ // or, line 234
+ var lab9 = true;
+ lab9: while (lab9 == true)
+ {
+ lab9 = false;
+ v_8 = this.limit - this.cursor;
+ var lab10 = true;
+ lab10: while (lab10 == true)
+ {
+ lab10 = false;
+ // (, line 234
+ // literal, line 234
+ if (!(this.eq_s_b(1, "Y")))
+ {
+ break lab10;
+ }
+ // ], line 234
+ this.bra = this.cursor;
+ // <-, line 234
+ if (!this.slice_from("i"))
+ {
+ return false;
+ }
+ break lab9;
+ }
+ this.cursor = this.limit - v_8;
+ // (, line 235
+ // literal, line 235
+ if (!(this.eq_s_b(1, "\u00E7")))
+ {
+ this.cursor = this.limit - v_7;
+ break lab8;
+ }
+ // ], line 235
+ this.bra = this.cursor;
+ // <-, line 235
+ if (!this.slice_from("c"))
+ {
+ return false;
+ }
+ }
+ }
+ break lab3;
+ }
+ this.cursor = this.limit - v_4;
+ // call residual_suffix, line 238
+ if (!this.r_residual_suffix())
+ {
+ break lab2;
+ }
+ }
+ }
+ this.cursor = this.limit - v_3;
+ // do, line 243
+ v_9 = this.limit - this.cursor;
+ var lab11 = true;
+ lab11: while (lab11 == true)
+ {
+ lab11 = false;
+ // call un_double, line 243
+ if (!this.r_un_double())
+ {
+ break lab11;
+ }
+ }
+ this.cursor = this.limit - v_9;
+ // do, line 244
+ v_10 = this.limit - this.cursor;
+ var lab12 = true;
+ lab12: while (lab12 == true)
+ {
+ lab12 = false;
+ // call un_accent, line 244
+ if (!this.r_un_accent())
+ {
+ break lab12;
+ }
+ }
+ this.cursor = this.limit - v_10;
+ this.cursor = this.limit_backward; // do, line 246
+ v_11 = this.cursor;
+ var lab13 = true;
+ lab13: while (lab13 == true)
+ {
+ lab13 = false;
+ // call postlude, line 246
+ if (!this.r_postlude())
+ {
+ break lab13;
+ }
+ }
+ this.cursor = v_11;
+ return true;
+ }
+
+ function equals (o : variant) : boolean {
+ return o instanceof FrenchStemmer;
+ }
+
+ function hashCode() : int
+ {
+ //http://stackoverflow.com/questions/194846/is-there-any-kind-of-hashcode-function-in-javascript
+ var classname = "FrenchStemmer";
+ var hash = 0;
+ if (classname.length == 0) return hash;
+ for (var i = 0; i < classname.length; i++) {
+ var char = classname.charCodeAt(i);
+ hash = ((hash << 5) - hash) + char;
+ hash = hash & hash; // Convert to 32bit integer
+ }
+ return hash;
+ }
+
+}
+
diff --git a/web/server/h2o/libh2o/misc/oktavia/src/stemmer/german-stemmer.jsx b/web/server/h2o/libh2o/misc/oktavia/src/stemmer/german-stemmer.jsx
new file mode 100644
index 00000000..7659b3a7
--- /dev/null
+++ b/web/server/h2o/libh2o/misc/oktavia/src/stemmer/german-stemmer.jsx
@@ -0,0 +1,894 @@
+// This file was generated automatically by the Snowball to JSX compiler
+
+import "base-stemmer.jsx";
+import "among.jsx";
+
+ /**
+ * This class was automatically generated by a Snowball to JSX compiler
+ * It implements the stemming algorithm defined by a snowball script.
+ */
+
+class GermanStemmer extends BaseStemmer
+{
+ static const serialVersionUID = 1;
+ static const methodObject = new GermanStemmer();
+
+ static const a_0 = [
+ new Among("", -1, 6),
+ new Among("U", 0, 2),
+ new Among("Y", 0, 1),
+ new Among("\u00E4", 0, 3),
+ new Among("\u00F6", 0, 4),
+ new Among("\u00FC", 0, 5)
+ ];
+
+ static const a_1 = [
+ new Among("e", -1, 2),
+ new Among("em", -1, 1),
+ new Among("en", -1, 2),
+ new Among("ern", -1, 1),
+ new Among("er", -1, 1),
+ new Among("s", -1, 3),
+ new Among("es", 5, 2)
+ ];
+
+ static const a_2 = [
+ new Among("en", -1, 1),
+ new Among("er", -1, 1),
+ new Among("st", -1, 2),
+ new Among("est", 2, 1)
+ ];
+
+ static const a_3 = [
+ new Among("ig", -1, 1),
+ new Among("lich", -1, 1)
+ ];
+
+ static const a_4 = [
+ new Among("end", -1, 1),
+ new Among("ig", -1, 2),
+ new Among("ung", -1, 1),
+ new Among("lich", -1, 3),
+ new Among("isch", -1, 2),
+ new Among("ik", -1, 2),
+ new Among("heit", -1, 3),
+ new Among("keit", -1, 4)
+ ];
+
+ static const g_v = [17, 65, 16, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 32, 8] : int[];
+
+ static const g_s_ending = [117, 30, 5] : int[];
+
+ static const g_st_ending = [117, 30, 4] : int[];
+
+ var I_x : int = 0;
+ var I_p2 : int = 0;
+ var I_p1 : int = 0;
+
+ function copy_from (other : GermanStemmer) : void
+ {
+ this.I_x = other.I_x;
+ this.I_p2 = other.I_p2;
+ this.I_p1 = other.I_p1;
+ super.copy_from(other);
+ }
+
+ function r_prelude () : boolean
+ {
+ var v_1 : int;
+ var v_2 : int;
+ var v_3 : int;
+ var v_4 : int;
+ var v_5 : int;
+ var v_6 : int;
+ // (, line 33
+ // test, line 35
+ v_1 = this.cursor;
+ // repeat, line 35
+ replab0: while(true)
+ {
+ v_2 = this.cursor;
+ var lab1 = true;
+ lab1: while (lab1 == true)
+ {
+ lab1 = false;
+ // (, line 35
+ // or, line 38
+ var lab2 = true;
+ lab2: while (lab2 == true)
+ {
+ lab2 = false;
+ v_3 = this.cursor;
+ var lab3 = true;
+ lab3: while (lab3 == true)
+ {
+ lab3 = false;
+ // (, line 36
+ // [, line 37
+ this.bra = this.cursor;
+ // literal, line 37
+ if (!(this.eq_s(1, "\u00DF")))
+ {
+ break lab3;
+ }
+ // ], line 37
+ this.ket = this.cursor;
+ // <-, line 37
+ if (!this.slice_from("ss"))
+ {
+ return false;
+ }
+ break lab2;
+ }
+ this.cursor = v_3;
+ // next, line 38
+ if (this.cursor >= this.limit)
+ {
+ break lab1;
+ }
+ this.cursor++;
+ }
+ continue replab0;
+ }
+ this.cursor = v_2;
+ break replab0;
+ }
+ this.cursor = v_1;
+ // repeat, line 41
+ replab4: while(true)
+ {
+ v_4 = this.cursor;
+ var lab5 = true;
+ lab5: while (lab5 == true)
+ {
+ lab5 = false;
+ // goto, line 41
+ golab6: while(true)
+ {
+ v_5 = this.cursor;
+ var lab7 = true;
+ lab7: while (lab7 == true)
+ {
+ lab7 = false;
+ // (, line 41
+ if (!(this.in_grouping(GermanStemmer.g_v, 97, 252)))
+ {
+ break lab7;
+ }
+ // [, line 42
+ this.bra = this.cursor;
+ // or, line 42
+ var lab8 = true;
+ lab8: while (lab8 == true)
+ {
+ lab8 = false;
+ v_6 = this.cursor;
+ var lab9 = true;
+ lab9: while (lab9 == true)
+ {
+ lab9 = false;
+ // (, line 42
+ // literal, line 42
+ if (!(this.eq_s(1, "u")))
+ {
+ break lab9;
+ }
+ // ], line 42
+ this.ket = this.cursor;
+ if (!(this.in_grouping(GermanStemmer.g_v, 97, 252)))
+ {
+ break lab9;
+ }
+ // <-, line 42
+ if (!this.slice_from("U"))
+ {
+ return false;
+ }
+ break lab8;
+ }
+ this.cursor = v_6;
+ // (, line 43
+ // literal, line 43
+ if (!(this.eq_s(1, "y")))
+ {
+ break lab7;
+ }
+ // ], line 43
+ this.ket = this.cursor;
+ if (!(this.in_grouping(GermanStemmer.g_v, 97, 252)))
+ {
+ break lab7;
+ }
+ // <-, line 43
+ if (!this.slice_from("Y"))
+ {
+ return false;
+ }
+ }
+ this.cursor = v_5;
+ break golab6;
+ }
+ this.cursor = v_5;
+ if (this.cursor >= this.limit)
+ {
+ break lab5;
+ }
+ this.cursor++;
+ }
+ continue replab4;
+ }
+ this.cursor = v_4;
+ break replab4;
+ }
+ return true;
+ }
+
+ function r_mark_regions () : boolean
+ {
+ var v_1 : int;
+ // (, line 47
+ this.I_p1 = this.limit;
+ this.I_p2 = this.limit;
+ // test, line 52
+ v_1 = this.cursor;
+ // (, line 52
+ // hop, line 52
+ {
+ var c : int = this.cursor + 3;
+ if (0 > c || c > this.limit)
+ {
+ return false;
+ }
+ this.cursor = c;
+ }
+ // setmark x, line 52
+ this.I_x = this.cursor;
+ this.cursor = v_1;
+ // gopast, line 54
+ golab0: while(true)
+ {
+ var lab1 = true;
+ lab1: while (lab1 == true)
+ {
+ lab1 = false;
+ if (!(this.in_grouping(GermanStemmer.g_v, 97, 252)))
+ {
+ break lab1;
+ }
+ break golab0;
+ }
+ if (this.cursor >= this.limit)
+ {
+ return false;
+ }
+ this.cursor++;
+ }
+ // gopast, line 54
+ golab2: while(true)
+ {
+ var lab3 = true;
+ lab3: while (lab3 == true)
+ {
+ lab3 = false;
+ if (!(this.out_grouping(GermanStemmer.g_v, 97, 252)))
+ {
+ break lab3;
+ }
+ break golab2;
+ }
+ if (this.cursor >= this.limit)
+ {
+ return false;
+ }
+ this.cursor++;
+ }
+ // setmark p1, line 54
+ this.I_p1 = this.cursor;
+ // try, line 55
+ var lab4 = true;
+ lab4: while (lab4 == true)
+ {
+ lab4 = false;
+ // (, line 55
+ if (!(this.I_p1 < this.I_x))
+ {
+ break lab4;
+ }
+ this.I_p1 = this.I_x;
+ }
+ // gopast, line 56
+ golab5: while(true)
+ {
+ var lab6 = true;
+ lab6: while (lab6 == true)
+ {
+ lab6 = false;
+ if (!(this.in_grouping(GermanStemmer.g_v, 97, 252)))
+ {
+ break lab6;
+ }
+ break golab5;
+ }
+ if (this.cursor >= this.limit)
+ {
+ return false;
+ }
+ this.cursor++;
+ }
+ // gopast, line 56
+ golab7: while(true)
+ {
+ var lab8 = true;
+ lab8: while (lab8 == true)
+ {
+ lab8 = false;
+ if (!(this.out_grouping(GermanStemmer.g_v, 97, 252)))
+ {
+ break lab8;
+ }
+ break golab7;
+ }
+ if (this.cursor >= this.limit)
+ {
+ return false;
+ }
+ this.cursor++;
+ }
+ // setmark p2, line 56
+ this.I_p2 = this.cursor;
+ return true;
+ }
+
+ function r_postlude () : boolean
+ {
+ var among_var : int;
+ var v_1 : int;
+ // repeat, line 60
+ replab0: while(true)
+ {
+ v_1 = this.cursor;
+ var lab1 = true;
+ lab1: while (lab1 == true)
+ {
+ lab1 = false;
+ // (, line 60
+ // [, line 62
+ this.bra = this.cursor;
+ // substring, line 62
+ among_var = this.find_among(GermanStemmer.a_0, 6);
+ if (among_var == 0)
+ {
+ break lab1;
+ }
+ // ], line 62
+ this.ket = this.cursor;
+ switch (among_var) {
+ case 0:
+ break lab1;
+ case 1:
+ // (, line 63
+ // <-, line 63
+ if (!this.slice_from("y"))
+ {
+ return false;
+ }
+ break;
+ case 2:
+ // (, line 64
+ // <-, line 64
+ if (!this.slice_from("u"))
+ {
+ return false;
+ }
+ break;
+ case 3:
+ // (, line 65
+ // <-, line 65
+ if (!this.slice_from("a"))
+ {
+ return false;
+ }
+ break;
+ case 4:
+ // (, line 66
+ // <-, line 66
+ if (!this.slice_from("o"))
+ {
+ return false;
+ }
+ break;
+ case 5:
+ // (, line 67
+ // <-, line 67
+ if (!this.slice_from("u"))
+ {
+ return false;
+ }
+ break;
+ case 6:
+ // (, line 68
+ // next, line 68
+ if (this.cursor >= this.limit)
+ {
+ break lab1;
+ }
+ this.cursor++;
+ break;
+ }
+ continue replab0;
+ }
+ this.cursor = v_1;
+ break replab0;
+ }
+ return true;
+ }
+
+ function r_R1 () : boolean
+ {
+ if (!(this.I_p1 <= this.cursor))
+ {
+ return false;
+ }
+ return true;
+ }
+
+ function r_R2 () : boolean
+ {
+ if (!(this.I_p2 <= this.cursor))
+ {
+ return false;
+ }
+ return true;
+ }
+
+ function r_standard_suffix () : boolean
+ {
+ var among_var : int;
+ var v_1 : int;
+ var v_2 : int;
+ var v_3 : int;
+ var v_4 : int;
+ var v_5 : int;
+ var v_6 : int;
+ var v_7 : int;
+ var v_8 : int;
+ var v_9 : int;
+ var v_10 : int;
+ // (, line 78
+ // do, line 79
+ v_1 = this.limit - this.cursor;
+ var lab0 = true;
+ lab0: while (lab0 == true)
+ {
+ lab0 = false;
+ // (, line 79
+ // [, line 80
+ this.ket = this.cursor;
+ // substring, line 80
+ among_var = this.find_among_b(GermanStemmer.a_1, 7);
+ if (among_var == 0)
+ {
+ break lab0;
+ }
+ // ], line 80
+ this.bra = this.cursor;
+ // call R1, line 80
+ if (!this.r_R1())
+ {
+ break lab0;
+ }
+ switch (among_var) {
+ case 0:
+ break lab0;
+ case 1:
+ // (, line 82
+ // delete, line 82
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ break;
+ case 2:
+ // (, line 85
+ // delete, line 85
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ // try, line 86
+ v_2 = this.limit - this.cursor;
+ var lab1 = true;
+ lab1: while (lab1 == true)
+ {
+ lab1 = false;
+ // (, line 86
+ // [, line 86
+ this.ket = this.cursor;
+ // literal, line 86
+ if (!(this.eq_s_b(1, "s")))
+ {
+ this.cursor = this.limit - v_2;
+ break lab1;
+ }
+ // ], line 86
+ this.bra = this.cursor;
+ // literal, line 86
+ if (!(this.eq_s_b(3, "nis")))
+ {
+ this.cursor = this.limit - v_2;
+ break lab1;
+ }
+ // delete, line 86
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ }
+ break;
+ case 3:
+ // (, line 89
+ if (!(this.in_grouping_b(GermanStemmer.g_s_ending, 98, 116)))
+ {
+ break lab0;
+ }
+ // delete, line 89
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ break;
+ }
+ }
+ this.cursor = this.limit - v_1;
+ // do, line 93
+ v_3 = this.limit - this.cursor;
+ var lab2 = true;
+ lab2: while (lab2 == true)
+ {
+ lab2 = false;
+ // (, line 93
+ // [, line 94
+ this.ket = this.cursor;
+ // substring, line 94
+ among_var = this.find_among_b(GermanStemmer.a_2, 4);
+ if (among_var == 0)
+ {
+ break lab2;
+ }
+ // ], line 94
+ this.bra = this.cursor;
+ // call R1, line 94
+ if (!this.r_R1())
+ {
+ break lab2;
+ }
+ switch (among_var) {
+ case 0:
+ break lab2;
+ case 1:
+ // (, line 96
+ // delete, line 96
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ break;
+ case 2:
+ // (, line 99
+ if (!(this.in_grouping_b(GermanStemmer.g_st_ending, 98, 116)))
+ {
+ break lab2;
+ }
+ // hop, line 99
+ {
+ var c : int = this.cursor - 3;
+ if (this.limit_backward > c || c > this.limit)
+ {
+ break lab2;
+ }
+ this.cursor = c;
+ }
+ // delete, line 99
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ break;
+ }
+ }
+ this.cursor = this.limit - v_3;
+ // do, line 103
+ v_4 = this.limit - this.cursor;
+ var lab3 = true;
+ lab3: while (lab3 == true)
+ {
+ lab3 = false;
+ // (, line 103
+ // [, line 104
+ this.ket = this.cursor;
+ // substring, line 104
+ among_var = this.find_among_b(GermanStemmer.a_4, 8);
+ if (among_var == 0)
+ {
+ break lab3;
+ }
+ // ], line 104
+ this.bra = this.cursor;
+ // call R2, line 104
+ if (!this.r_R2())
+ {
+ break lab3;
+ }
+ switch (among_var) {
+ case 0:
+ break lab3;
+ case 1:
+ // (, line 106
+ // delete, line 106
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ // try, line 107
+ v_5 = this.limit - this.cursor;
+ var lab4 = true;
+ lab4: while (lab4 == true)
+ {
+ lab4 = false;
+ // (, line 107
+ // [, line 107
+ this.ket = this.cursor;
+ // literal, line 107
+ if (!(this.eq_s_b(2, "ig")))
+ {
+ this.cursor = this.limit - v_5;
+ break lab4;
+ }
+ // ], line 107
+ this.bra = this.cursor;
+ // not, line 107
+ {
+ v_6 = this.limit - this.cursor;
+ var lab5 = true;
+ lab5: while (lab5 == true)
+ {
+ lab5 = false;
+ // literal, line 107
+ if (!(this.eq_s_b(1, "e")))
+ {
+ break lab5;
+ }
+ this.cursor = this.limit - v_5;
+ break lab4;
+ }
+ this.cursor = this.limit - v_6;
+ }
+ // call R2, line 107
+ if (!this.r_R2())
+ {
+ this.cursor = this.limit - v_5;
+ break lab4;
+ }
+ // delete, line 107
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ }
+ break;
+ case 2:
+ // (, line 110
+ // not, line 110
+ {
+ v_7 = this.limit - this.cursor;
+ var lab6 = true;
+ lab6: while (lab6 == true)
+ {
+ lab6 = false;
+ // literal, line 110
+ if (!(this.eq_s_b(1, "e")))
+ {
+ break lab6;
+ }
+ break lab3;
+ }
+ this.cursor = this.limit - v_7;
+ }
+ // delete, line 110
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ break;
+ case 3:
+ // (, line 113
+ // delete, line 113
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ // try, line 114
+ v_8 = this.limit - this.cursor;
+ var lab7 = true;
+ lab7: while (lab7 == true)
+ {
+ lab7 = false;
+ // (, line 114
+ // [, line 115
+ this.ket = this.cursor;
+ // or, line 115
+ var lab8 = true;
+ lab8: while (lab8 == true)
+ {
+ lab8 = false;
+ v_9 = this.limit - this.cursor;
+ var lab9 = true;
+ lab9: while (lab9 == true)
+ {
+ lab9 = false;
+ // literal, line 115
+ if (!(this.eq_s_b(2, "er")))
+ {
+ break lab9;
+ }
+ break lab8;
+ }
+ this.cursor = this.limit - v_9;
+ // literal, line 115
+ if (!(this.eq_s_b(2, "en")))
+ {
+ this.cursor = this.limit - v_8;
+ break lab7;
+ }
+ }
+ // ], line 115
+ this.bra = this.cursor;
+ // call R1, line 115
+ if (!this.r_R1())
+ {
+ this.cursor = this.limit - v_8;
+ break lab7;
+ }
+ // delete, line 115
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ }
+ break;
+ case 4:
+ // (, line 119
+ // delete, line 119
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ // try, line 120
+ v_10 = this.limit - this.cursor;
+ var lab10 = true;
+ lab10: while (lab10 == true)
+ {
+ lab10 = false;
+ // (, line 120
+ // [, line 121
+ this.ket = this.cursor;
+ // substring, line 121
+ among_var = this.find_among_b(GermanStemmer.a_3, 2);
+ if (among_var == 0)
+ {
+ this.cursor = this.limit - v_10;
+ break lab10;
+ }
+ // ], line 121
+ this.bra = this.cursor;
+ // call R2, line 121
+ if (!this.r_R2())
+ {
+ this.cursor = this.limit - v_10;
+ break lab10;
+ }
+ switch (among_var) {
+ case 0:
+ this.cursor = this.limit - v_10;
+ break lab10;
+ case 1:
+ // (, line 123
+ // delete, line 123
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ break;
+ }
+ }
+ break;
+ }
+ }
+ this.cursor = this.limit - v_4;
+ return true;
+ }
+
+ override function stem () : boolean
+ {
+ var v_1 : int;
+ var v_2 : int;
+ var v_3 : int;
+ var v_4 : int;
+ // (, line 133
+ // do, line 134
+ v_1 = this.cursor;
+ var lab0 = true;
+ lab0: while (lab0 == true)
+ {
+ lab0 = false;
+ // call prelude, line 134
+ if (!this.r_prelude())
+ {
+ break lab0;
+ }
+ }
+ this.cursor = v_1;
+ // do, line 135
+ v_2 = this.cursor;
+ var lab1 = true;
+ lab1: while (lab1 == true)
+ {
+ lab1 = false;
+ // call mark_regions, line 135
+ if (!this.r_mark_regions())
+ {
+ break lab1;
+ }
+ }
+ this.cursor = v_2;
+ // backwards, line 136
+ this.limit_backward = this.cursor; this.cursor = this.limit;
+ // do, line 137
+ v_3 = this.limit - this.cursor;
+ var lab2 = true;
+ lab2: while (lab2 == true)
+ {
+ lab2 = false;
+ // call standard_suffix, line 137
+ if (!this.r_standard_suffix())
+ {
+ break lab2;
+ }
+ }
+ this.cursor = this.limit - v_3;
+ this.cursor = this.limit_backward; // do, line 138
+ v_4 = this.cursor;
+ var lab3 = true;
+ lab3: while (lab3 == true)
+ {
+ lab3 = false;
+ // call postlude, line 138
+ if (!this.r_postlude())
+ {
+ break lab3;
+ }
+ }
+ this.cursor = v_4;
+ return true;
+ }
+
+ function equals (o : variant) : boolean {
+ return o instanceof GermanStemmer;
+ }
+
+ function hashCode() : int
+ {
+ //http://stackoverflow.com/questions/194846/is-there-any-kind-of-hashcode-function-in-javascript
+ var classname = "GermanStemmer";
+ var hash = 0;
+ if (classname.length == 0) return hash;
+ for (var i = 0; i < classname.length; i++) {
+ var char = classname.charCodeAt(i);
+ hash = ((hash << 5) - hash) + char;
+ hash = hash & hash; // Convert to 32bit integer
+ }
+ return hash;
+ }
+
+}
+
diff --git a/web/server/h2o/libh2o/misc/oktavia/src/stemmer/hungarian-stemmer.jsx b/web/server/h2o/libh2o/misc/oktavia/src/stemmer/hungarian-stemmer.jsx
new file mode 100644
index 00000000..9d67dba4
--- /dev/null
+++ b/web/server/h2o/libh2o/misc/oktavia/src/stemmer/hungarian-stemmer.jsx
@@ -0,0 +1,1478 @@
+// This file was generated automatically by the Snowball to JSX compiler
+
+import "base-stemmer.jsx";
+import "among.jsx";
+
+ /**
+ * This class was automatically generated by a Snowball to JSX compiler
+ * It implements the stemming algorithm defined by a snowball script.
+ */
+
+class HungarianStemmer extends BaseStemmer
+{
+ static const serialVersionUID = 1;
+ static const methodObject = new HungarianStemmer();
+
+ static const a_0 = [
+ new Among("cs", -1, -1),
+ new Among("dzs", -1, -1),
+ new Among("gy", -1, -1),
+ new Among("ly", -1, -1),
+ new Among("ny", -1, -1),
+ new Among("sz", -1, -1),
+ new Among("ty", -1, -1),
+ new Among("zs", -1, -1)
+ ];
+
+ static const a_1 = [
+ new Among("\u00E1", -1, 1),
+ new Among("\u00E9", -1, 2)
+ ];
+
+ static const a_2 = [
+ new Among("bb", -1, -1),
+ new Among("cc", -1, -1),
+ new Among("dd", -1, -1),
+ new Among("ff", -1, -1),
+ new Among("gg", -1, -1),
+ new Among("jj", -1, -1),
+ new Among("kk", -1, -1),
+ new Among("ll", -1, -1),
+ new Among("mm", -1, -1),
+ new Among("nn", -1, -1),
+ new Among("pp", -1, -1),
+ new Among("rr", -1, -1),
+ new Among("ccs", -1, -1),
+ new Among("ss", -1, -1),
+ new Among("zzs", -1, -1),
+ new Among("tt", -1, -1),
+ new Among("vv", -1, -1),
+ new Among("ggy", -1, -1),
+ new Among("lly", -1, -1),
+ new Among("nny", -1, -1),
+ new Among("tty", -1, -1),
+ new Among("ssz", -1, -1),
+ new Among("zz", -1, -1)
+ ];
+
+ static const a_3 = [
+ new Among("al", -1, 1),
+ new Among("el", -1, 2)
+ ];
+
+ static const a_4 = [
+ new Among("ba", -1, -1),
+ new Among("ra", -1, -1),
+ new Among("be", -1, -1),
+ new Among("re", -1, -1),
+ new Among("ig", -1, -1),
+ new Among("nak", -1, -1),
+ new Among("nek", -1, -1),
+ new Among("val", -1, -1),
+ new Among("vel", -1, -1),
+ new Among("ul", -1, -1),
+ new Among("n\u00E1l", -1, -1),
+ new Among("n\u00E9l", -1, -1),
+ new Among("b\u00F3l", -1, -1),
+ new Among("r\u00F3l", -1, -1),
+ new Among("t\u00F3l", -1, -1),
+ new Among("b\u00F5l", -1, -1),
+ new Among("r\u00F5l", -1, -1),
+ new Among("t\u00F5l", -1, -1),
+ new Among("\u00FCl", -1, -1),
+ new Among("n", -1, -1),
+ new Among("an", 19, -1),
+ new Among("ban", 20, -1),
+ new Among("en", 19, -1),
+ new Among("ben", 22, -1),
+ new Among("k\u00E9ppen", 22, -1),
+ new Among("on", 19, -1),
+ new Among("\u00F6n", 19, -1),
+ new Among("k\u00E9pp", -1, -1),
+ new Among("kor", -1, -1),
+ new Among("t", -1, -1),
+ new Among("at", 29, -1),
+ new Among("et", 29, -1),
+ new Among("k\u00E9nt", 29, -1),
+ new Among("ank\u00E9nt", 32, -1),
+ new Among("enk\u00E9nt", 32, -1),
+ new Among("onk\u00E9nt", 32, -1),
+ new Among("ot", 29, -1),
+ new Among("\u00E9rt", 29, -1),
+ new Among("\u00F6t", 29, -1),
+ new Among("hez", -1, -1),
+ new Among("hoz", -1, -1),
+ new Among("h\u00F6z", -1, -1),
+ new Among("v\u00E1", -1, -1),
+ new Among("v\u00E9", -1, -1)
+ ];
+
+ static const a_5 = [
+ new Among("\u00E1n", -1, 2),
+ new Among("\u00E9n", -1, 1),
+ new Among("\u00E1nk\u00E9nt", -1, 3)
+ ];
+
+ static const a_6 = [
+ new Among("stul", -1, 2),
+ new Among("astul", 0, 1),
+ new Among("\u00E1stul", 0, 3),
+ new Among("st\u00FCl", -1, 2),
+ new Among("est\u00FCl", 3, 1),
+ new Among("\u00E9st\u00FCl", 3, 4)
+ ];
+
+ static const a_7 = [
+ new Among("\u00E1", -1, 1),
+ new Among("\u00E9", -1, 2)
+ ];
+
+ static const a_8 = [
+ new Among("k", -1, 7),
+ new Among("ak", 0, 4),
+ new Among("ek", 0, 6),
+ new Among("ok", 0, 5),
+ new Among("\u00E1k", 0, 1),
+ new Among("\u00E9k", 0, 2),
+ new Among("\u00F6k", 0, 3)
+ ];
+
+ static const a_9 = [
+ new Among("\u00E9i", -1, 7),
+ new Among("\u00E1\u00E9i", 0, 6),
+ new Among("\u00E9\u00E9i", 0, 5),
+ new Among("\u00E9", -1, 9),
+ new Among("k\u00E9", 3, 4),
+ new Among("ak\u00E9", 4, 1),
+ new Among("ek\u00E9", 4, 1),
+ new Among("ok\u00E9", 4, 1),
+ new Among("\u00E1k\u00E9", 4, 3),
+ new Among("\u00E9k\u00E9", 4, 2),
+ new Among("\u00F6k\u00E9", 4, 1),
+ new Among("\u00E9\u00E9", 3, 8)
+ ];
+
+ static const a_10 = [
+ new Among("a", -1, 18),
+ new Among("ja", 0, 17),
+ new Among("d", -1, 16),
+ new Among("ad", 2, 13),
+ new Among("ed", 2, 13),
+ new Among("od", 2, 13),
+ new Among("\u00E1d", 2, 14),
+ new Among("\u00E9d", 2, 15),
+ new Among("\u00F6d", 2, 13),
+ new Among("e", -1, 18),
+ new Among("je", 9, 17),
+ new Among("nk", -1, 4),
+ new Among("unk", 11, 1),
+ new Among("\u00E1nk", 11, 2),
+ new Among("\u00E9nk", 11, 3),
+ new Among("\u00FCnk", 11, 1),
+ new Among("uk", -1, 8),
+ new Among("juk", 16, 7),
+ new Among("\u00E1juk", 17, 5),
+ new Among("\u00FCk", -1, 8),
+ new Among("j\u00FCk", 19, 7),
+ new Among("\u00E9j\u00FCk", 20, 6),
+ new Among("m", -1, 12),
+ new Among("am", 22, 9),
+ new Among("em", 22, 9),
+ new Among("om", 22, 9),
+ new Among("\u00E1m", 22, 10),
+ new Among("\u00E9m", 22, 11),
+ new Among("o", -1, 18),
+ new Among("\u00E1", -1, 19),
+ new Among("\u00E9", -1, 20)
+ ];
+
+ static const a_11 = [
+ new Among("id", -1, 10),
+ new Among("aid", 0, 9),
+ new Among("jaid", 1, 6),
+ new Among("eid", 0, 9),
+ new Among("jeid", 3, 6),
+ new Among("\u00E1id", 0, 7),
+ new Among("\u00E9id", 0, 8),
+ new Among("i", -1, 15),
+ new Among("ai", 7, 14),
+ new Among("jai", 8, 11),
+ new Among("ei", 7, 14),
+ new Among("jei", 10, 11),
+ new Among("\u00E1i", 7, 12),
+ new Among("\u00E9i", 7, 13),
+ new Among("itek", -1, 24),
+ new Among("eitek", 14, 21),
+ new Among("jeitek", 15, 20),
+ new Among("\u00E9itek", 14, 23),
+ new Among("ik", -1, 29),
+ new Among("aik", 18, 26),
+ new Among("jaik", 19, 25),
+ new Among("eik", 18, 26),
+ new Among("jeik", 21, 25),
+ new Among("\u00E1ik", 18, 27),
+ new Among("\u00E9ik", 18, 28),
+ new Among("ink", -1, 20),
+ new Among("aink", 25, 17),
+ new Among("jaink", 26, 16),
+ new Among("eink", 25, 17),
+ new Among("jeink", 28, 16),
+ new Among("\u00E1ink", 25, 18),
+ new Among("\u00E9ink", 25, 19),
+ new Among("aitok", -1, 21),
+ new Among("jaitok", 32, 20),
+ new Among("\u00E1itok", -1, 22),
+ new Among("im", -1, 5),
+ new Among("aim", 35, 4),
+ new Among("jaim", 36, 1),
+ new Among("eim", 35, 4),
+ new Among("jeim", 38, 1),
+ new Among("\u00E1im", 35, 2),
+ new Among("\u00E9im", 35, 3)
+ ];
+
+ static const g_v = [17, 65, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 17, 52, 14] : int[];
+
+ var I_p1 : int = 0;
+
+ function copy_from (other : HungarianStemmer) : void
+ {
+ this.I_p1 = other.I_p1;
+ super.copy_from(other);
+ }
+
+ function r_mark_regions () : boolean
+ {
+ var v_1 : int;
+ var v_2 : int;
+ var v_3 : int;
+ // (, line 44
+ this.I_p1 = this.limit;
+ // or, line 51
+ var lab0 = true;
+ lab0: while (lab0 == true)
+ {
+ lab0 = false;
+ v_1 = this.cursor;
+ var lab1 = true;
+ lab1: while (lab1 == true)
+ {
+ lab1 = false;
+ // (, line 48
+ if (!(this.in_grouping(HungarianStemmer.g_v, 97, 252)))
+ {
+ break lab1;
+ }
+ // goto, line 48
+ golab2: while(true)
+ {
+ v_2 = this.cursor;
+ var lab3 = true;
+ lab3: while (lab3 == true)
+ {
+ lab3 = false;
+ if (!(this.out_grouping(HungarianStemmer.g_v, 97, 252)))
+ {
+ break lab3;
+ }
+ this.cursor = v_2;
+ break golab2;
+ }
+ this.cursor = v_2;
+ if (this.cursor >= this.limit)
+ {
+ break lab1;
+ }
+ this.cursor++;
+ }
+ // or, line 49
+ var lab4 = true;
+ lab4: while (lab4 == true)
+ {
+ lab4 = false;
+ v_3 = this.cursor;
+ var lab5 = true;
+ lab5: while (lab5 == true)
+ {
+ lab5 = false;
+ // among, line 49
+ if (this.find_among(HungarianStemmer.a_0, 8) == 0)
+ {
+ break lab5;
+ }
+ break lab4;
+ }
+ this.cursor = v_3;
+ // next, line 49
+ if (this.cursor >= this.limit)
+ {
+ break lab1;
+ }
+ this.cursor++;
+ }
+ // setmark p1, line 50
+ this.I_p1 = this.cursor;
+ break lab0;
+ }
+ this.cursor = v_1;
+ // (, line 53
+ if (!(this.out_grouping(HungarianStemmer.g_v, 97, 252)))
+ {
+ return false;
+ }
+ // gopast, line 53
+ golab6: while(true)
+ {
+ var lab7 = true;
+ lab7: while (lab7 == true)
+ {
+ lab7 = false;
+ if (!(this.in_grouping(HungarianStemmer.g_v, 97, 252)))
+ {
+ break lab7;
+ }
+ break golab6;
+ }
+ if (this.cursor >= this.limit)
+ {
+ return false;
+ }
+ this.cursor++;
+ }
+ // setmark p1, line 53
+ this.I_p1 = this.cursor;
+ }
+ return true;
+ }
+
+ function r_R1 () : boolean
+ {
+ if (!(this.I_p1 <= this.cursor))
+ {
+ return false;
+ }
+ return true;
+ }
+
+ function r_v_ending () : boolean
+ {
+ var among_var : int;
+ // (, line 60
+ // [, line 61
+ this.ket = this.cursor;
+ // substring, line 61
+ among_var = this.find_among_b(HungarianStemmer.a_1, 2);
+ if (among_var == 0)
+ {
+ return false;
+ }
+ // ], line 61
+ this.bra = this.cursor;
+ // call R1, line 61
+ if (!this.r_R1())
+ {
+ return false;
+ }
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ // (, line 62
+ // <-, line 62
+ if (!this.slice_from("a"))
+ {
+ return false;
+ }
+ break;
+ case 2:
+ // (, line 63
+ // <-, line 63
+ if (!this.slice_from("e"))
+ {
+ return false;
+ }
+ break;
+ }
+ return true;
+ }
+
+ function r_double () : boolean
+ {
+ var v_1 : int;
+ // (, line 67
+ // test, line 68
+ v_1 = this.limit - this.cursor;
+ // among, line 68
+ if (this.find_among_b(HungarianStemmer.a_2, 23) == 0)
+ {
+ return false;
+ }
+ this.cursor = this.limit - v_1;
+ return true;
+ }
+
+ function r_undouble () : boolean
+ {
+ // (, line 72
+ // next, line 73
+ if (this.cursor <= this.limit_backward)
+ {
+ return false;
+ }
+ this.cursor--;
+ // [, line 73
+ this.ket = this.cursor;
+ // hop, line 73
+ {
+ var c : int = this.cursor - 1;
+ if (this.limit_backward > c || c > this.limit)
+ {
+ return false;
+ }
+ this.cursor = c;
+ }
+ // ], line 73
+ this.bra = this.cursor;
+ // delete, line 73
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ return true;
+ }
+
+ function r_instrum () : boolean
+ {
+ var among_var : int;
+ // (, line 76
+ // [, line 77
+ this.ket = this.cursor;
+ // substring, line 77
+ among_var = this.find_among_b(HungarianStemmer.a_3, 2);
+ if (among_var == 0)
+ {
+ return false;
+ }
+ // ], line 77
+ this.bra = this.cursor;
+ // call R1, line 77
+ if (!this.r_R1())
+ {
+ return false;
+ }
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ // (, line 78
+ // call double, line 78
+ if (!this.r_double())
+ {
+ return false;
+ }
+ break;
+ case 2:
+ // (, line 79
+ // call double, line 79
+ if (!this.r_double())
+ {
+ return false;
+ }
+ break;
+ }
+ // delete, line 81
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ // call undouble, line 82
+ if (!this.r_undouble())
+ {
+ return false;
+ }
+ return true;
+ }
+
+ function r_case () : boolean
+ {
+ // (, line 86
+ // [, line 87
+ this.ket = this.cursor;
+ // substring, line 87
+ if (this.find_among_b(HungarianStemmer.a_4, 44) == 0)
+ {
+ return false;
+ }
+ // ], line 87
+ this.bra = this.cursor;
+ // call R1, line 87
+ if (!this.r_R1())
+ {
+ return false;
+ }
+ // delete, line 111
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ // call v_ending, line 112
+ if (!this.r_v_ending())
+ {
+ return false;
+ }
+ return true;
+ }
+
+ function r_case_special () : boolean
+ {
+ var among_var : int;
+ // (, line 115
+ // [, line 116
+ this.ket = this.cursor;
+ // substring, line 116
+ among_var = this.find_among_b(HungarianStemmer.a_5, 3);
+ if (among_var == 0)
+ {
+ return false;
+ }
+ // ], line 116
+ this.bra = this.cursor;
+ // call R1, line 116
+ if (!this.r_R1())
+ {
+ return false;
+ }
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ // (, line 117
+ // <-, line 117
+ if (!this.slice_from("e"))
+ {
+ return false;
+ }
+ break;
+ case 2:
+ // (, line 118
+ // <-, line 118
+ if (!this.slice_from("a"))
+ {
+ return false;
+ }
+ break;
+ case 3:
+ // (, line 119
+ // <-, line 119
+ if (!this.slice_from("a"))
+ {
+ return false;
+ }
+ break;
+ }
+ return true;
+ }
+
+ function r_case_other () : boolean
+ {
+ var among_var : int;
+ // (, line 123
+ // [, line 124
+ this.ket = this.cursor;
+ // substring, line 124
+ among_var = this.find_among_b(HungarianStemmer.a_6, 6);
+ if (among_var == 0)
+ {
+ return false;
+ }
+ // ], line 124
+ this.bra = this.cursor;
+ // call R1, line 124
+ if (!this.r_R1())
+ {
+ return false;
+ }
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ // (, line 125
+ // delete, line 125
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ break;
+ case 2:
+ // (, line 126
+ // delete, line 126
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ break;
+ case 3:
+ // (, line 127
+ // <-, line 127
+ if (!this.slice_from("a"))
+ {
+ return false;
+ }
+ break;
+ case 4:
+ // (, line 128
+ // <-, line 128
+ if (!this.slice_from("e"))
+ {
+ return false;
+ }
+ break;
+ }
+ return true;
+ }
+
+ function r_factive () : boolean
+ {
+ var among_var : int;
+ // (, line 132
+ // [, line 133
+ this.ket = this.cursor;
+ // substring, line 133
+ among_var = this.find_among_b(HungarianStemmer.a_7, 2);
+ if (among_var == 0)
+ {
+ return false;
+ }
+ // ], line 133
+ this.bra = this.cursor;
+ // call R1, line 133
+ if (!this.r_R1())
+ {
+ return false;
+ }
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ // (, line 134
+ // call double, line 134
+ if (!this.r_double())
+ {
+ return false;
+ }
+ break;
+ case 2:
+ // (, line 135
+ // call double, line 135
+ if (!this.r_double())
+ {
+ return false;
+ }
+ break;
+ }
+ // delete, line 137
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ // call undouble, line 138
+ if (!this.r_undouble())
+ {
+ return false;
+ }
+ return true;
+ }
+
+ function r_plural () : boolean
+ {
+ var among_var : int;
+ // (, line 141
+ // [, line 142
+ this.ket = this.cursor;
+ // substring, line 142
+ among_var = this.find_among_b(HungarianStemmer.a_8, 7);
+ if (among_var == 0)
+ {
+ return false;
+ }
+ // ], line 142
+ this.bra = this.cursor;
+ // call R1, line 142
+ if (!this.r_R1())
+ {
+ return false;
+ }
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ // (, line 143
+ // <-, line 143
+ if (!this.slice_from("a"))
+ {
+ return false;
+ }
+ break;
+ case 2:
+ // (, line 144
+ // <-, line 144
+ if (!this.slice_from("e"))
+ {
+ return false;
+ }
+ break;
+ case 3:
+ // (, line 145
+ // delete, line 145
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ break;
+ case 4:
+ // (, line 146
+ // delete, line 146
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ break;
+ case 5:
+ // (, line 147
+ // delete, line 147
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ break;
+ case 6:
+ // (, line 148
+ // delete, line 148
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ break;
+ case 7:
+ // (, line 149
+ // delete, line 149
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ break;
+ }
+ return true;
+ }
+
+ function r_owned () : boolean
+ {
+ var among_var : int;
+ // (, line 153
+ // [, line 154
+ this.ket = this.cursor;
+ // substring, line 154
+ among_var = this.find_among_b(HungarianStemmer.a_9, 12);
+ if (among_var == 0)
+ {
+ return false;
+ }
+ // ], line 154
+ this.bra = this.cursor;
+ // call R1, line 154
+ if (!this.r_R1())
+ {
+ return false;
+ }
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ // (, line 155
+ // delete, line 155
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ break;
+ case 2:
+ // (, line 156
+ // <-, line 156
+ if (!this.slice_from("e"))
+ {
+ return false;
+ }
+ break;
+ case 3:
+ // (, line 157
+ // <-, line 157
+ if (!this.slice_from("a"))
+ {
+ return false;
+ }
+ break;
+ case 4:
+ // (, line 158
+ // delete, line 158
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ break;
+ case 5:
+ // (, line 159
+ // <-, line 159
+ if (!this.slice_from("e"))
+ {
+ return false;
+ }
+ break;
+ case 6:
+ // (, line 160
+ // <-, line 160
+ if (!this.slice_from("a"))
+ {
+ return false;
+ }
+ break;
+ case 7:
+ // (, line 161
+ // delete, line 161
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ break;
+ case 8:
+ // (, line 162
+ // <-, line 162
+ if (!this.slice_from("e"))
+ {
+ return false;
+ }
+ break;
+ case 9:
+ // (, line 163
+ // delete, line 163
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ break;
+ }
+ return true;
+ }
+
+ function r_sing_owner () : boolean
+ {
+ var among_var : int;
+ // (, line 167
+ // [, line 168
+ this.ket = this.cursor;
+ // substring, line 168
+ among_var = this.find_among_b(HungarianStemmer.a_10, 31);
+ if (among_var == 0)
+ {
+ return false;
+ }
+ // ], line 168
+ this.bra = this.cursor;
+ // call R1, line 168
+ if (!this.r_R1())
+ {
+ return false;
+ }
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ // (, line 169
+ // delete, line 169
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ break;
+ case 2:
+ // (, line 170
+ // <-, line 170
+ if (!this.slice_from("a"))
+ {
+ return false;
+ }
+ break;
+ case 3:
+ // (, line 171
+ // <-, line 171
+ if (!this.slice_from("e"))
+ {
+ return false;
+ }
+ break;
+ case 4:
+ // (, line 172
+ // delete, line 172
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ break;
+ case 5:
+ // (, line 173
+ // <-, line 173
+ if (!this.slice_from("a"))
+ {
+ return false;
+ }
+ break;
+ case 6:
+ // (, line 174
+ // <-, line 174
+ if (!this.slice_from("e"))
+ {
+ return false;
+ }
+ break;
+ case 7:
+ // (, line 175
+ // delete, line 175
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ break;
+ case 8:
+ // (, line 176
+ // delete, line 176
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ break;
+ case 9:
+ // (, line 177
+ // delete, line 177
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ break;
+ case 10:
+ // (, line 178
+ // <-, line 178
+ if (!this.slice_from("a"))
+ {
+ return false;
+ }
+ break;
+ case 11:
+ // (, line 179
+ // <-, line 179
+ if (!this.slice_from("e"))
+ {
+ return false;
+ }
+ break;
+ case 12:
+ // (, line 180
+ // delete, line 180
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ break;
+ case 13:
+ // (, line 181
+ // delete, line 181
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ break;
+ case 14:
+ // (, line 182
+ // <-, line 182
+ if (!this.slice_from("a"))
+ {
+ return false;
+ }
+ break;
+ case 15:
+ // (, line 183
+ // <-, line 183
+ if (!this.slice_from("e"))
+ {
+ return false;
+ }
+ break;
+ case 16:
+ // (, line 184
+ // delete, line 184
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ break;
+ case 17:
+ // (, line 185
+ // delete, line 185
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ break;
+ case 18:
+ // (, line 186
+ // delete, line 186
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ break;
+ case 19:
+ // (, line 187
+ // <-, line 187
+ if (!this.slice_from("a"))
+ {
+ return false;
+ }
+ break;
+ case 20:
+ // (, line 188
+ // <-, line 188
+ if (!this.slice_from("e"))
+ {
+ return false;
+ }
+ break;
+ }
+ return true;
+ }
+
+ function r_plur_owner () : boolean
+ {
+ var among_var : int;
+ // (, line 192
+ // [, line 193
+ this.ket = this.cursor;
+ // substring, line 193
+ among_var = this.find_among_b(HungarianStemmer.a_11, 42);
+ if (among_var == 0)
+ {
+ return false;
+ }
+ // ], line 193
+ this.bra = this.cursor;
+ // call R1, line 193
+ if (!this.r_R1())
+ {
+ return false;
+ }
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ // (, line 194
+ // delete, line 194
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ break;
+ case 2:
+ // (, line 195
+ // <-, line 195
+ if (!this.slice_from("a"))
+ {
+ return false;
+ }
+ break;
+ case 3:
+ // (, line 196
+ // <-, line 196
+ if (!this.slice_from("e"))
+ {
+ return false;
+ }
+ break;
+ case 4:
+ // (, line 197
+ // delete, line 197
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ break;
+ case 5:
+ // (, line 198
+ // delete, line 198
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ break;
+ case 6:
+ // (, line 199
+ // delete, line 199
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ break;
+ case 7:
+ // (, line 200
+ // <-, line 200
+ if (!this.slice_from("a"))
+ {
+ return false;
+ }
+ break;
+ case 8:
+ // (, line 201
+ // <-, line 201
+ if (!this.slice_from("e"))
+ {
+ return false;
+ }
+ break;
+ case 9:
+ // (, line 202
+ // delete, line 202
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ break;
+ case 10:
+ // (, line 203
+ // delete, line 203
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ break;
+ case 11:
+ // (, line 204
+ // delete, line 204
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ break;
+ case 12:
+ // (, line 205
+ // <-, line 205
+ if (!this.slice_from("a"))
+ {
+ return false;
+ }
+ break;
+ case 13:
+ // (, line 206
+ // <-, line 206
+ if (!this.slice_from("e"))
+ {
+ return false;
+ }
+ break;
+ case 14:
+ // (, line 207
+ // delete, line 207
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ break;
+ case 15:
+ // (, line 208
+ // delete, line 208
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ break;
+ case 16:
+ // (, line 209
+ // delete, line 209
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ break;
+ case 17:
+ // (, line 210
+ // delete, line 210
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ break;
+ case 18:
+ // (, line 211
+ // <-, line 211
+ if (!this.slice_from("a"))
+ {
+ return false;
+ }
+ break;
+ case 19:
+ // (, line 212
+ // <-, line 212
+ if (!this.slice_from("e"))
+ {
+ return false;
+ }
+ break;
+ case 20:
+ // (, line 214
+ // delete, line 214
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ break;
+ case 21:
+ // (, line 215
+ // delete, line 215
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ break;
+ case 22:
+ // (, line 216
+ // <-, line 216
+ if (!this.slice_from("a"))
+ {
+ return false;
+ }
+ break;
+ case 23:
+ // (, line 217
+ // <-, line 217
+ if (!this.slice_from("e"))
+ {
+ return false;
+ }
+ break;
+ case 24:
+ // (, line 218
+ // delete, line 218
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ break;
+ case 25:
+ // (, line 219
+ // delete, line 219
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ break;
+ case 26:
+ // (, line 220
+ // delete, line 220
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ break;
+ case 27:
+ // (, line 221
+ // <-, line 221
+ if (!this.slice_from("a"))
+ {
+ return false;
+ }
+ break;
+ case 28:
+ // (, line 222
+ // <-, line 222
+ if (!this.slice_from("e"))
+ {
+ return false;
+ }
+ break;
+ case 29:
+ // (, line 223
+ // delete, line 223
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ break;
+ }
+ return true;
+ }
+
+ override function stem () : boolean
+ {
+ var v_1 : int;
+ var v_2 : int;
+ var v_3 : int;
+ var v_4 : int;
+ var v_5 : int;
+ var v_6 : int;
+ var v_7 : int;
+ var v_8 : int;
+ var v_9 : int;
+ var v_10 : int;
+ // (, line 228
+ // do, line 229
+ v_1 = this.cursor;
+ var lab0 = true;
+ lab0: while (lab0 == true)
+ {
+ lab0 = false;
+ // call mark_regions, line 229
+ if (!this.r_mark_regions())
+ {
+ break lab0;
+ }
+ }
+ this.cursor = v_1;
+ // backwards, line 230
+ this.limit_backward = this.cursor; this.cursor = this.limit;
+ // (, line 230
+ // do, line 231
+ v_2 = this.limit - this.cursor;
+ var lab1 = true;
+ lab1: while (lab1 == true)
+ {
+ lab1 = false;
+ // call instrum, line 231
+ if (!this.r_instrum())
+ {
+ break lab1;
+ }
+ }
+ this.cursor = this.limit - v_2;
+ // do, line 232
+ v_3 = this.limit - this.cursor;
+ var lab2 = true;
+ lab2: while (lab2 == true)
+ {
+ lab2 = false;
+ // call case, line 232
+ if (!this.r_case())
+ {
+ break lab2;
+ }
+ }
+ this.cursor = this.limit - v_3;
+ // do, line 233
+ v_4 = this.limit - this.cursor;
+ var lab3 = true;
+ lab3: while (lab3 == true)
+ {
+ lab3 = false;
+ // call case_special, line 233
+ if (!this.r_case_special())
+ {
+ break lab3;
+ }
+ }
+ this.cursor = this.limit - v_4;
+ // do, line 234
+ v_5 = this.limit - this.cursor;
+ var lab4 = true;
+ lab4: while (lab4 == true)
+ {
+ lab4 = false;
+ // call case_other, line 234
+ if (!this.r_case_other())
+ {
+ break lab4;
+ }
+ }
+ this.cursor = this.limit - v_5;
+ // do, line 235
+ v_6 = this.limit - this.cursor;
+ var lab5 = true;
+ lab5: while (lab5 == true)
+ {
+ lab5 = false;
+ // call factive, line 235
+ if (!this.r_factive())
+ {
+ break lab5;
+ }
+ }
+ this.cursor = this.limit - v_6;
+ // do, line 236
+ v_7 = this.limit - this.cursor;
+ var lab6 = true;
+ lab6: while (lab6 == true)
+ {
+ lab6 = false;
+ // call owned, line 236
+ if (!this.r_owned())
+ {
+ break lab6;
+ }
+ }
+ this.cursor = this.limit - v_7;
+ // do, line 237
+ v_8 = this.limit - this.cursor;
+ var lab7 = true;
+ lab7: while (lab7 == true)
+ {
+ lab7 = false;
+ // call sing_owner, line 237
+ if (!this.r_sing_owner())
+ {
+ break lab7;
+ }
+ }
+ this.cursor = this.limit - v_8;
+ // do, line 238
+ v_9 = this.limit - this.cursor;
+ var lab8 = true;
+ lab8: while (lab8 == true)
+ {
+ lab8 = false;
+ // call plur_owner, line 238
+ if (!this.r_plur_owner())
+ {
+ break lab8;
+ }
+ }
+ this.cursor = this.limit - v_9;
+ // do, line 239
+ v_10 = this.limit - this.cursor;
+ var lab9 = true;
+ lab9: while (lab9 == true)
+ {
+ lab9 = false;
+ // call plural, line 239
+ if (!this.r_plural())
+ {
+ break lab9;
+ }
+ }
+ this.cursor = this.limit - v_10;
+ this.cursor = this.limit_backward; return true;
+ }
+
+ function equals (o : variant) : boolean {
+ return o instanceof HungarianStemmer;
+ }
+
+ function hashCode() : int
+ {
+ //http://stackoverflow.com/questions/194846/is-there-any-kind-of-hashcode-function-in-javascript
+ var classname = "HungarianStemmer";
+ var hash = 0;
+ if (classname.length == 0) return hash;
+ for (var i = 0; i < classname.length; i++) {
+ var char = classname.charCodeAt(i);
+ hash = ((hash << 5) - hash) + char;
+ hash = hash & hash; // Convert to 32bit integer
+ }
+ return hash;
+ }
+
+}
+
diff --git a/web/server/h2o/libh2o/misc/oktavia/src/stemmer/italian-stemmer.jsx b/web/server/h2o/libh2o/misc/oktavia/src/stemmer/italian-stemmer.jsx
new file mode 100644
index 00000000..2072deb9
--- /dev/null
+++ b/web/server/h2o/libh2o/misc/oktavia/src/stemmer/italian-stemmer.jsx
@@ -0,0 +1,1412 @@
+// This file was generated automatically by the Snowball to JSX compiler
+
+import "base-stemmer.jsx";
+import "among.jsx";
+
+ /**
+ * This class was automatically generated by a Snowball to JSX compiler
+ * It implements the stemming algorithm defined by a snowball script.
+ */
+
+class ItalianStemmer extends BaseStemmer
+{
+ static const serialVersionUID = 1;
+ static const methodObject = new ItalianStemmer();
+
+ static const a_0 = [
+ new Among("", -1, 7),
+ new Among("qu", 0, 6),
+ new Among("\u00E1", 0, 1),
+ new Among("\u00E9", 0, 2),
+ new Among("\u00ED", 0, 3),
+ new Among("\u00F3", 0, 4),
+ new Among("\u00FA", 0, 5)
+ ];
+
+ static const a_1 = [
+ new Among("", -1, 3),
+ new Among("I", 0, 1),
+ new Among("U", 0, 2)
+ ];
+
+ static const a_2 = [
+ new Among("la", -1, -1),
+ new Among("cela", 0, -1),
+ new Among("gliela", 0, -1),
+ new Among("mela", 0, -1),
+ new Among("tela", 0, -1),
+ new Among("vela", 0, -1),
+ new Among("le", -1, -1),
+ new Among("cele", 6, -1),
+ new Among("gliele", 6, -1),
+ new Among("mele", 6, -1),
+ new Among("tele", 6, -1),
+ new Among("vele", 6, -1),
+ new Among("ne", -1, -1),
+ new Among("cene", 12, -1),
+ new Among("gliene", 12, -1),
+ new Among("mene", 12, -1),
+ new Among("sene", 12, -1),
+ new Among("tene", 12, -1),
+ new Among("vene", 12, -1),
+ new Among("ci", -1, -1),
+ new Among("li", -1, -1),
+ new Among("celi", 20, -1),
+ new Among("glieli", 20, -1),
+ new Among("meli", 20, -1),
+ new Among("teli", 20, -1),
+ new Among("veli", 20, -1),
+ new Among("gli", 20, -1),
+ new Among("mi", -1, -1),
+ new Among("si", -1, -1),
+ new Among("ti", -1, -1),
+ new Among("vi", -1, -1),
+ new Among("lo", -1, -1),
+ new Among("celo", 31, -1),
+ new Among("glielo", 31, -1),
+ new Among("melo", 31, -1),
+ new Among("telo", 31, -1),
+ new Among("velo", 31, -1)
+ ];
+
+ static const a_3 = [
+ new Among("ando", -1, 1),
+ new Among("endo", -1, 1),
+ new Among("ar", -1, 2),
+ new Among("er", -1, 2),
+ new Among("ir", -1, 2)
+ ];
+
+ static const a_4 = [
+ new Among("ic", -1, -1),
+ new Among("abil", -1, -1),
+ new Among("os", -1, -1),
+ new Among("iv", -1, 1)
+ ];
+
+ static const a_5 = [
+ new Among("ic", -1, 1),
+ new Among("abil", -1, 1),
+ new Among("iv", -1, 1)
+ ];
+
+ static const a_6 = [
+ new Among("ica", -1, 1),
+ new Among("logia", -1, 3),
+ new Among("osa", -1, 1),
+ new Among("ista", -1, 1),
+ new Among("iva", -1, 9),
+ new Among("anza", -1, 1),
+ new Among("enza", -1, 5),
+ new Among("ice", -1, 1),
+ new Among("atrice", 7, 1),
+ new Among("iche", -1, 1),
+ new Among("logie", -1, 3),
+ new Among("abile", -1, 1),
+ new Among("ibile", -1, 1),
+ new Among("usione", -1, 4),
+ new Among("azione", -1, 2),
+ new Among("uzione", -1, 4),
+ new Among("atore", -1, 2),
+ new Among("ose", -1, 1),
+ new Among("ante", -1, 1),
+ new Among("mente", -1, 1),
+ new Among("amente", 19, 7),
+ new Among("iste", -1, 1),
+ new Among("ive", -1, 9),
+ new Among("anze", -1, 1),
+ new Among("enze", -1, 5),
+ new Among("ici", -1, 1),
+ new Among("atrici", 25, 1),
+ new Among("ichi", -1, 1),
+ new Among("abili", -1, 1),
+ new Among("ibili", -1, 1),
+ new Among("ismi", -1, 1),
+ new Among("usioni", -1, 4),
+ new Among("azioni", -1, 2),
+ new Among("uzioni", -1, 4),
+ new Among("atori", -1, 2),
+ new Among("osi", -1, 1),
+ new Among("anti", -1, 1),
+ new Among("amenti", -1, 6),
+ new Among("imenti", -1, 6),
+ new Among("isti", -1, 1),
+ new Among("ivi", -1, 9),
+ new Among("ico", -1, 1),
+ new Among("ismo", -1, 1),
+ new Among("oso", -1, 1),
+ new Among("amento", -1, 6),
+ new Among("imento", -1, 6),
+ new Among("ivo", -1, 9),
+ new Among("it\u00E0", -1, 8),
+ new Among("ist\u00E0", -1, 1),
+ new Among("ist\u00E8", -1, 1),
+ new Among("ist\u00EC", -1, 1)
+ ];
+
+ static const a_7 = [
+ new Among("isca", -1, 1),
+ new Among("enda", -1, 1),
+ new Among("ata", -1, 1),
+ new Among("ita", -1, 1),
+ new Among("uta", -1, 1),
+ new Among("ava", -1, 1),
+ new Among("eva", -1, 1),
+ new Among("iva", -1, 1),
+ new Among("erebbe", -1, 1),
+ new Among("irebbe", -1, 1),
+ new Among("isce", -1, 1),
+ new Among("ende", -1, 1),
+ new Among("are", -1, 1),
+ new Among("ere", -1, 1),
+ new Among("ire", -1, 1),
+ new Among("asse", -1, 1),
+ new Among("ate", -1, 1),
+ new Among("avate", 16, 1),
+ new Among("evate", 16, 1),
+ new Among("ivate", 16, 1),
+ new Among("ete", -1, 1),
+ new Among("erete", 20, 1),
+ new Among("irete", 20, 1),
+ new Among("ite", -1, 1),
+ new Among("ereste", -1, 1),
+ new Among("ireste", -1, 1),
+ new Among("ute", -1, 1),
+ new Among("erai", -1, 1),
+ new Among("irai", -1, 1),
+ new Among("isci", -1, 1),
+ new Among("endi", -1, 1),
+ new Among("erei", -1, 1),
+ new Among("irei", -1, 1),
+ new Among("assi", -1, 1),
+ new Among("ati", -1, 1),
+ new Among("iti", -1, 1),
+ new Among("eresti", -1, 1),
+ new Among("iresti", -1, 1),
+ new Among("uti", -1, 1),
+ new Among("avi", -1, 1),
+ new Among("evi", -1, 1),
+ new Among("ivi", -1, 1),
+ new Among("isco", -1, 1),
+ new Among("ando", -1, 1),
+ new Among("endo", -1, 1),
+ new Among("Yamo", -1, 1),
+ new Among("iamo", -1, 1),
+ new Among("avamo", -1, 1),
+ new Among("evamo", -1, 1),
+ new Among("ivamo", -1, 1),
+ new Among("eremo", -1, 1),
+ new Among("iremo", -1, 1),
+ new Among("assimo", -1, 1),
+ new Among("ammo", -1, 1),
+ new Among("emmo", -1, 1),
+ new Among("eremmo", 54, 1),
+ new Among("iremmo", 54, 1),
+ new Among("immo", -1, 1),
+ new Among("ano", -1, 1),
+ new Among("iscano", 58, 1),
+ new Among("avano", 58, 1),
+ new Among("evano", 58, 1),
+ new Among("ivano", 58, 1),
+ new Among("eranno", -1, 1),
+ new Among("iranno", -1, 1),
+ new Among("ono", -1, 1),
+ new Among("iscono", 65, 1),
+ new Among("arono", 65, 1),
+ new Among("erono", 65, 1),
+ new Among("irono", 65, 1),
+ new Among("erebbero", -1, 1),
+ new Among("irebbero", -1, 1),
+ new Among("assero", -1, 1),
+ new Among("essero", -1, 1),
+ new Among("issero", -1, 1),
+ new Among("ato", -1, 1),
+ new Among("ito", -1, 1),
+ new Among("uto", -1, 1),
+ new Among("avo", -1, 1),
+ new Among("evo", -1, 1),
+ new Among("ivo", -1, 1),
+ new Among("ar", -1, 1),
+ new Among("ir", -1, 1),
+ new Among("er\u00E0", -1, 1),
+ new Among("ir\u00E0", -1, 1),
+ new Among("er\u00F2", -1, 1),
+ new Among("ir\u00F2", -1, 1)
+ ];
+
+ static const g_v = [17, 65, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128, 128, 8, 2, 1] : int[];
+
+ static const g_AEIO = [17, 65, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128, 128, 8, 2] : int[];
+
+ static const g_CG = [17] : int[];
+
+ var I_p2 : int = 0;
+ var I_p1 : int = 0;
+ var I_pV : int = 0;
+
+ function copy_from (other : ItalianStemmer) : void
+ {
+ this.I_p2 = other.I_p2;
+ this.I_p1 = other.I_p1;
+ this.I_pV = other.I_pV;
+ super.copy_from(other);
+ }
+
+ function r_prelude () : boolean
+ {
+ var among_var : int;
+ var v_1 : int;
+ var v_2 : int;
+ var v_3 : int;
+ var v_4 : int;
+ var v_5 : int;
+ // (, line 34
+ // test, line 35
+ v_1 = this.cursor;
+ // repeat, line 35
+ replab0: while(true)
+ {
+ v_2 = this.cursor;
+ var lab1 = true;
+ lab1: while (lab1 == true)
+ {
+ lab1 = false;
+ // (, line 35
+ // [, line 36
+ this.bra = this.cursor;
+ // substring, line 36
+ among_var = this.find_among(ItalianStemmer.a_0, 7);
+ if (among_var == 0)
+ {
+ break lab1;
+ }
+ // ], line 36
+ this.ket = this.cursor;
+ switch (among_var) {
+ case 0:
+ break lab1;
+ case 1:
+ // (, line 37
+ // <-, line 37
+ if (!this.slice_from("\u00E0"))
+ {
+ return false;
+ }
+ break;
+ case 2:
+ // (, line 38
+ // <-, line 38
+ if (!this.slice_from("\u00E8"))
+ {
+ return false;
+ }
+ break;
+ case 3:
+ // (, line 39
+ // <-, line 39
+ if (!this.slice_from("\u00EC"))
+ {
+ return false;
+ }
+ break;
+ case 4:
+ // (, line 40
+ // <-, line 40
+ if (!this.slice_from("\u00F2"))
+ {
+ return false;
+ }
+ break;
+ case 5:
+ // (, line 41
+ // <-, line 41
+ if (!this.slice_from("\u00F9"))
+ {
+ return false;
+ }
+ break;
+ case 6:
+ // (, line 42
+ // <-, line 42
+ if (!this.slice_from("qU"))
+ {
+ return false;
+ }
+ break;
+ case 7:
+ // (, line 43
+ // next, line 43
+ if (this.cursor >= this.limit)
+ {
+ break lab1;
+ }
+ this.cursor++;
+ break;
+ }
+ continue replab0;
+ }
+ this.cursor = v_2;
+ break replab0;
+ }
+ this.cursor = v_1;
+ // repeat, line 46
+ replab2: while(true)
+ {
+ v_3 = this.cursor;
+ var lab3 = true;
+ lab3: while (lab3 == true)
+ {
+ lab3 = false;
+ // goto, line 46
+ golab4: while(true)
+ {
+ v_4 = this.cursor;
+ var lab5 = true;
+ lab5: while (lab5 == true)
+ {
+ lab5 = false;
+ // (, line 46
+ if (!(this.in_grouping(ItalianStemmer.g_v, 97, 249)))
+ {
+ break lab5;
+ }
+ // [, line 47
+ this.bra = this.cursor;
+ // or, line 47
+ var lab6 = true;
+ lab6: while (lab6 == true)
+ {
+ lab6 = false;
+ v_5 = this.cursor;
+ var lab7 = true;
+ lab7: while (lab7 == true)
+ {
+ lab7 = false;
+ // (, line 47
+ // literal, line 47
+ if (!(this.eq_s(1, "u")))
+ {
+ break lab7;
+ }
+ // ], line 47
+ this.ket = this.cursor;
+ if (!(this.in_grouping(ItalianStemmer.g_v, 97, 249)))
+ {
+ break lab7;
+ }
+ // <-, line 47
+ if (!this.slice_from("U"))
+ {
+ return false;
+ }
+ break lab6;
+ }
+ this.cursor = v_5;
+ // (, line 48
+ // literal, line 48
+ if (!(this.eq_s(1, "i")))
+ {
+ break lab5;
+ }
+ // ], line 48
+ this.ket = this.cursor;
+ if (!(this.in_grouping(ItalianStemmer.g_v, 97, 249)))
+ {
+ break lab5;
+ }
+ // <-, line 48
+ if (!this.slice_from("I"))
+ {
+ return false;
+ }
+ }
+ this.cursor = v_4;
+ break golab4;
+ }
+ this.cursor = v_4;
+ if (this.cursor >= this.limit)
+ {
+ break lab3;
+ }
+ this.cursor++;
+ }
+ continue replab2;
+ }
+ this.cursor = v_3;
+ break replab2;
+ }
+ return true;
+ }
+
+ function r_mark_regions () : boolean
+ {
+ var v_1 : int;
+ var v_2 : int;
+ var v_3 : int;
+ var v_6 : int;
+ var v_8 : int;
+ // (, line 52
+ this.I_pV = this.limit;
+ this.I_p1 = this.limit;
+ this.I_p2 = this.limit;
+ // do, line 58
+ v_1 = this.cursor;
+ var lab0 = true;
+ lab0: while (lab0 == true)
+ {
+ lab0 = false;
+ // (, line 58
+ // or, line 60
+ var lab1 = true;
+ lab1: while (lab1 == true)
+ {
+ lab1 = false;
+ v_2 = this.cursor;
+ var lab2 = true;
+ lab2: while (lab2 == true)
+ {
+ lab2 = false;
+ // (, line 59
+ if (!(this.in_grouping(ItalianStemmer.g_v, 97, 249)))
+ {
+ break lab2;
+ }
+ // or, line 59
+ var lab3 = true;
+ lab3: while (lab3 == true)
+ {
+ lab3 = false;
+ v_3 = this.cursor;
+ var lab4 = true;
+ lab4: while (lab4 == true)
+ {
+ lab4 = false;
+ // (, line 59
+ if (!(this.out_grouping(ItalianStemmer.g_v, 97, 249)))
+ {
+ break lab4;
+ }
+ // gopast, line 59
+ golab5: while(true)
+ {
+ var lab6 = true;
+ lab6: while (lab6 == true)
+ {
+ lab6 = false;
+ if (!(this.in_grouping(ItalianStemmer.g_v, 97, 249)))
+ {
+ break lab6;
+ }
+ break golab5;
+ }
+ if (this.cursor >= this.limit)
+ {
+ break lab4;
+ }
+ this.cursor++;
+ }
+ break lab3;
+ }
+ this.cursor = v_3;
+ // (, line 59
+ if (!(this.in_grouping(ItalianStemmer.g_v, 97, 249)))
+ {
+ break lab2;
+ }
+ // gopast, line 59
+ golab7: while(true)
+ {
+ var lab8 = true;
+ lab8: while (lab8 == true)
+ {
+ lab8 = false;
+ if (!(this.out_grouping(ItalianStemmer.g_v, 97, 249)))
+ {
+ break lab8;
+ }
+ break golab7;
+ }
+ if (this.cursor >= this.limit)
+ {
+ break lab2;
+ }
+ this.cursor++;
+ }
+ }
+ break lab1;
+ }
+ this.cursor = v_2;
+ // (, line 61
+ if (!(this.out_grouping(ItalianStemmer.g_v, 97, 249)))
+ {
+ break lab0;
+ }
+ // or, line 61
+ var lab9 = true;
+ lab9: while (lab9 == true)
+ {
+ lab9 = false;
+ v_6 = this.cursor;
+ var lab10 = true;
+ lab10: while (lab10 == true)
+ {
+ lab10 = false;
+ // (, line 61
+ if (!(this.out_grouping(ItalianStemmer.g_v, 97, 249)))
+ {
+ break lab10;
+ }
+ // gopast, line 61
+ golab11: while(true)
+ {
+ var lab12 = true;
+ lab12: while (lab12 == true)
+ {
+ lab12 = false;
+ if (!(this.in_grouping(ItalianStemmer.g_v, 97, 249)))
+ {
+ break lab12;
+ }
+ break golab11;
+ }
+ if (this.cursor >= this.limit)
+ {
+ break lab10;
+ }
+ this.cursor++;
+ }
+ break lab9;
+ }
+ this.cursor = v_6;
+ // (, line 61
+ if (!(this.in_grouping(ItalianStemmer.g_v, 97, 249)))
+ {
+ break lab0;
+ }
+ // next, line 61
+ if (this.cursor >= this.limit)
+ {
+ break lab0;
+ }
+ this.cursor++;
+ }
+ }
+ // setmark pV, line 62
+ this.I_pV = this.cursor;
+ }
+ this.cursor = v_1;
+ // do, line 64
+ v_8 = this.cursor;
+ var lab13 = true;
+ lab13: while (lab13 == true)
+ {
+ lab13 = false;
+ // (, line 64
+ // gopast, line 65
+ golab14: while(true)
+ {
+ var lab15 = true;
+ lab15: while (lab15 == true)
+ {
+ lab15 = false;
+ if (!(this.in_grouping(ItalianStemmer.g_v, 97, 249)))
+ {
+ break lab15;
+ }
+ break golab14;
+ }
+ if (this.cursor >= this.limit)
+ {
+ break lab13;
+ }
+ this.cursor++;
+ }
+ // gopast, line 65
+ golab16: while(true)
+ {
+ var lab17 = true;
+ lab17: while (lab17 == true)
+ {
+ lab17 = false;
+ if (!(this.out_grouping(ItalianStemmer.g_v, 97, 249)))
+ {
+ break lab17;
+ }
+ break golab16;
+ }
+ if (this.cursor >= this.limit)
+ {
+ break lab13;
+ }
+ this.cursor++;
+ }
+ // setmark p1, line 65
+ this.I_p1 = this.cursor;
+ // gopast, line 66
+ golab18: while(true)
+ {
+ var lab19 = true;
+ lab19: while (lab19 == true)
+ {
+ lab19 = false;
+ if (!(this.in_grouping(ItalianStemmer.g_v, 97, 249)))
+ {
+ break lab19;
+ }
+ break golab18;
+ }
+ if (this.cursor >= this.limit)
+ {
+ break lab13;
+ }
+ this.cursor++;
+ }
+ // gopast, line 66
+ golab20: while(true)
+ {
+ var lab21 = true;
+ lab21: while (lab21 == true)
+ {
+ lab21 = false;
+ if (!(this.out_grouping(ItalianStemmer.g_v, 97, 249)))
+ {
+ break lab21;
+ }
+ break golab20;
+ }
+ if (this.cursor >= this.limit)
+ {
+ break lab13;
+ }
+ this.cursor++;
+ }
+ // setmark p2, line 66
+ this.I_p2 = this.cursor;
+ }
+ this.cursor = v_8;
+ return true;
+ }
+
+ function r_postlude () : boolean
+ {
+ var among_var : int;
+ var v_1 : int;
+ // repeat, line 70
+ replab0: while(true)
+ {
+ v_1 = this.cursor;
+ var lab1 = true;
+ lab1: while (lab1 == true)
+ {
+ lab1 = false;
+ // (, line 70
+ // [, line 72
+ this.bra = this.cursor;
+ // substring, line 72
+ among_var = this.find_among(ItalianStemmer.a_1, 3);
+ if (among_var == 0)
+ {
+ break lab1;
+ }
+ // ], line 72
+ this.ket = this.cursor;
+ switch (among_var) {
+ case 0:
+ break lab1;
+ case 1:
+ // (, line 73
+ // <-, line 73
+ if (!this.slice_from("i"))
+ {
+ return false;
+ }
+ break;
+ case 2:
+ // (, line 74
+ // <-, line 74
+ if (!this.slice_from("u"))
+ {
+ return false;
+ }
+ break;
+ case 3:
+ // (, line 75
+ // next, line 75
+ if (this.cursor >= this.limit)
+ {
+ break lab1;
+ }
+ this.cursor++;
+ break;
+ }
+ continue replab0;
+ }
+ this.cursor = v_1;
+ break replab0;
+ }
+ return true;
+ }
+
+ function r_RV () : boolean
+ {
+ if (!(this.I_pV <= this.cursor))
+ {
+ return false;
+ }
+ return true;
+ }
+
+ function r_R1 () : boolean
+ {
+ if (!(this.I_p1 <= this.cursor))
+ {
+ return false;
+ }
+ return true;
+ }
+
+ function r_R2 () : boolean
+ {
+ if (!(this.I_p2 <= this.cursor))
+ {
+ return false;
+ }
+ return true;
+ }
+
+ function r_attached_pronoun () : boolean
+ {
+ var among_var : int;
+ // (, line 86
+ // [, line 87
+ this.ket = this.cursor;
+ // substring, line 87
+ if (this.find_among_b(ItalianStemmer.a_2, 37) == 0)
+ {
+ return false;
+ }
+ // ], line 87
+ this.bra = this.cursor;
+ // among, line 97
+ among_var = this.find_among_b(ItalianStemmer.a_3, 5);
+ if (among_var == 0)
+ {
+ return false;
+ }
+ // (, line 97
+ // call RV, line 97
+ if (!this.r_RV())
+ {
+ return false;
+ }
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ // (, line 98
+ // delete, line 98
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ break;
+ case 2:
+ // (, line 99
+ // <-, line 99
+ if (!this.slice_from("e"))
+ {
+ return false;
+ }
+ break;
+ }
+ return true;
+ }
+
+ function r_standard_suffix () : boolean
+ {
+ var among_var : int;
+ var v_1 : int;
+ var v_2 : int;
+ var v_3 : int;
+ var v_4 : int;
+ // (, line 103
+ // [, line 104
+ this.ket = this.cursor;
+ // substring, line 104
+ among_var = this.find_among_b(ItalianStemmer.a_6, 51);
+ if (among_var == 0)
+ {
+ return false;
+ }
+ // ], line 104
+ this.bra = this.cursor;
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ // (, line 111
+ // call R2, line 111
+ if (!this.r_R2())
+ {
+ return false;
+ }
+ // delete, line 111
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ break;
+ case 2:
+ // (, line 113
+ // call R2, line 113
+ if (!this.r_R2())
+ {
+ return false;
+ }
+ // delete, line 113
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ // try, line 114
+ v_1 = this.limit - this.cursor;
+ var lab0 = true;
+ lab0: while (lab0 == true)
+ {
+ lab0 = false;
+ // (, line 114
+ // [, line 114
+ this.ket = this.cursor;
+ // literal, line 114
+ if (!(this.eq_s_b(2, "ic")))
+ {
+ this.cursor = this.limit - v_1;
+ break lab0;
+ }
+ // ], line 114
+ this.bra = this.cursor;
+ // call R2, line 114
+ if (!this.r_R2())
+ {
+ this.cursor = this.limit - v_1;
+ break lab0;
+ }
+ // delete, line 114
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ }
+ break;
+ case 3:
+ // (, line 117
+ // call R2, line 117
+ if (!this.r_R2())
+ {
+ return false;
+ }
+ // <-, line 117
+ if (!this.slice_from("log"))
+ {
+ return false;
+ }
+ break;
+ case 4:
+ // (, line 119
+ // call R2, line 119
+ if (!this.r_R2())
+ {
+ return false;
+ }
+ // <-, line 119
+ if (!this.slice_from("u"))
+ {
+ return false;
+ }
+ break;
+ case 5:
+ // (, line 121
+ // call R2, line 121
+ if (!this.r_R2())
+ {
+ return false;
+ }
+ // <-, line 121
+ if (!this.slice_from("ente"))
+ {
+ return false;
+ }
+ break;
+ case 6:
+ // (, line 123
+ // call RV, line 123
+ if (!this.r_RV())
+ {
+ return false;
+ }
+ // delete, line 123
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ break;
+ case 7:
+ // (, line 124
+ // call R1, line 125
+ if (!this.r_R1())
+ {
+ return false;
+ }
+ // delete, line 125
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ // try, line 126
+ v_2 = this.limit - this.cursor;
+ var lab1 = true;
+ lab1: while (lab1 == true)
+ {
+ lab1 = false;
+ // (, line 126
+ // [, line 127
+ this.ket = this.cursor;
+ // substring, line 127
+ among_var = this.find_among_b(ItalianStemmer.a_4, 4);
+ if (among_var == 0)
+ {
+ this.cursor = this.limit - v_2;
+ break lab1;
+ }
+ // ], line 127
+ this.bra = this.cursor;
+ // call R2, line 127
+ if (!this.r_R2())
+ {
+ this.cursor = this.limit - v_2;
+ break lab1;
+ }
+ // delete, line 127
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ switch (among_var) {
+ case 0:
+ this.cursor = this.limit - v_2;
+ break lab1;
+ case 1:
+ // (, line 128
+ // [, line 128
+ this.ket = this.cursor;
+ // literal, line 128
+ if (!(this.eq_s_b(2, "at")))
+ {
+ this.cursor = this.limit - v_2;
+ break lab1;
+ }
+ // ], line 128
+ this.bra = this.cursor;
+ // call R2, line 128
+ if (!this.r_R2())
+ {
+ this.cursor = this.limit - v_2;
+ break lab1;
+ }
+ // delete, line 128
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ break;
+ }
+ }
+ break;
+ case 8:
+ // (, line 133
+ // call R2, line 134
+ if (!this.r_R2())
+ {
+ return false;
+ }
+ // delete, line 134
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ // try, line 135
+ v_3 = this.limit - this.cursor;
+ var lab2 = true;
+ lab2: while (lab2 == true)
+ {
+ lab2 = false;
+ // (, line 135
+ // [, line 136
+ this.ket = this.cursor;
+ // substring, line 136
+ among_var = this.find_among_b(ItalianStemmer.a_5, 3);
+ if (among_var == 0)
+ {
+ this.cursor = this.limit - v_3;
+ break lab2;
+ }
+ // ], line 136
+ this.bra = this.cursor;
+ switch (among_var) {
+ case 0:
+ this.cursor = this.limit - v_3;
+ break lab2;
+ case 1:
+ // (, line 137
+ // call R2, line 137
+ if (!this.r_R2())
+ {
+ this.cursor = this.limit - v_3;
+ break lab2;
+ }
+ // delete, line 137
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ break;
+ }
+ }
+ break;
+ case 9:
+ // (, line 141
+ // call R2, line 142
+ if (!this.r_R2())
+ {
+ return false;
+ }
+ // delete, line 142
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ // try, line 143
+ v_4 = this.limit - this.cursor;
+ var lab3 = true;
+ lab3: while (lab3 == true)
+ {
+ lab3 = false;
+ // (, line 143
+ // [, line 143
+ this.ket = this.cursor;
+ // literal, line 143
+ if (!(this.eq_s_b(2, "at")))
+ {
+ this.cursor = this.limit - v_4;
+ break lab3;
+ }
+ // ], line 143
+ this.bra = this.cursor;
+ // call R2, line 143
+ if (!this.r_R2())
+ {
+ this.cursor = this.limit - v_4;
+ break lab3;
+ }
+ // delete, line 143
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ // [, line 143
+ this.ket = this.cursor;
+ // literal, line 143
+ if (!(this.eq_s_b(2, "ic")))
+ {
+ this.cursor = this.limit - v_4;
+ break lab3;
+ }
+ // ], line 143
+ this.bra = this.cursor;
+ // call R2, line 143
+ if (!this.r_R2())
+ {
+ this.cursor = this.limit - v_4;
+ break lab3;
+ }
+ // delete, line 143
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ }
+ break;
+ }
+ return true;
+ }
+
+ function r_verb_suffix () : boolean
+ {
+ var among_var : int;
+ var v_1 : int;
+ var v_2 : int;
+ // setlimit, line 148
+ v_1 = this.limit - this.cursor;
+ // tomark, line 148
+ if (this.cursor < this.I_pV)
+ {
+ return false;
+ }
+ this.cursor = this.I_pV;
+ v_2 = this.limit_backward;
+ this.limit_backward = this.cursor;
+ this.cursor = this.limit - v_1;
+ // (, line 148
+ // [, line 149
+ this.ket = this.cursor;
+ // substring, line 149
+ among_var = this.find_among_b(ItalianStemmer.a_7, 87);
+ if (among_var == 0)
+ {
+ this.limit_backward = v_2;
+ return false;
+ }
+ // ], line 149
+ this.bra = this.cursor;
+ switch (among_var) {
+ case 0:
+ this.limit_backward = v_2;
+ return false;
+ case 1:
+ // (, line 163
+ // delete, line 163
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ break;
+ }
+ this.limit_backward = v_2;
+ return true;
+ }
+
+ function r_vowel_suffix () : boolean
+ {
+ var v_1 : int;
+ var v_2 : int;
+ // (, line 170
+ // try, line 171
+ v_1 = this.limit - this.cursor;
+ var lab0 = true;
+ lab0: while (lab0 == true)
+ {
+ lab0 = false;
+ // (, line 171
+ // [, line 172
+ this.ket = this.cursor;
+ if (!(this.in_grouping_b(ItalianStemmer.g_AEIO, 97, 242)))
+ {
+ this.cursor = this.limit - v_1;
+ break lab0;
+ }
+ // ], line 172
+ this.bra = this.cursor;
+ // call RV, line 172
+ if (!this.r_RV())
+ {
+ this.cursor = this.limit - v_1;
+ break lab0;
+ }
+ // delete, line 172
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ // [, line 173
+ this.ket = this.cursor;
+ // literal, line 173
+ if (!(this.eq_s_b(1, "i")))
+ {
+ this.cursor = this.limit - v_1;
+ break lab0;
+ }
+ // ], line 173
+ this.bra = this.cursor;
+ // call RV, line 173
+ if (!this.r_RV())
+ {
+ this.cursor = this.limit - v_1;
+ break lab0;
+ }
+ // delete, line 173
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ }
+ // try, line 175
+ v_2 = this.limit - this.cursor;
+ var lab1 = true;
+ lab1: while (lab1 == true)
+ {
+ lab1 = false;
+ // (, line 175
+ // [, line 176
+ this.ket = this.cursor;
+ // literal, line 176
+ if (!(this.eq_s_b(1, "h")))
+ {
+ this.cursor = this.limit - v_2;
+ break lab1;
+ }
+ // ], line 176
+ this.bra = this.cursor;
+ if (!(this.in_grouping_b(ItalianStemmer.g_CG, 99, 103)))
+ {
+ this.cursor = this.limit - v_2;
+ break lab1;
+ }
+ // call RV, line 176
+ if (!this.r_RV())
+ {
+ this.cursor = this.limit - v_2;
+ break lab1;
+ }
+ // delete, line 176
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ }
+ return true;
+ }
+
+ override function stem () : boolean
+ {
+ var v_1 : int;
+ var v_2 : int;
+ var v_3 : int;
+ var v_4 : int;
+ var v_5 : int;
+ var v_6 : int;
+ var v_7 : int;
+ // (, line 181
+ // do, line 182
+ v_1 = this.cursor;
+ var lab0 = true;
+ lab0: while (lab0 == true)
+ {
+ lab0 = false;
+ // call prelude, line 182
+ if (!this.r_prelude())
+ {
+ break lab0;
+ }
+ }
+ this.cursor = v_1;
+ // do, line 183
+ v_2 = this.cursor;
+ var lab1 = true;
+ lab1: while (lab1 == true)
+ {
+ lab1 = false;
+ // call mark_regions, line 183
+ if (!this.r_mark_regions())
+ {
+ break lab1;
+ }
+ }
+ this.cursor = v_2;
+ // backwards, line 184
+ this.limit_backward = this.cursor; this.cursor = this.limit;
+ // (, line 184
+ // do, line 185
+ v_3 = this.limit - this.cursor;
+ var lab2 = true;
+ lab2: while (lab2 == true)
+ {
+ lab2 = false;
+ // call attached_pronoun, line 185
+ if (!this.r_attached_pronoun())
+ {
+ break lab2;
+ }
+ }
+ this.cursor = this.limit - v_3;
+ // do, line 186
+ v_4 = this.limit - this.cursor;
+ var lab3 = true;
+ lab3: while (lab3 == true)
+ {
+ lab3 = false;
+ // (, line 186
+ // or, line 186
+ var lab4 = true;
+ lab4: while (lab4 == true)
+ {
+ lab4 = false;
+ v_5 = this.limit - this.cursor;
+ var lab5 = true;
+ lab5: while (lab5 == true)
+ {
+ lab5 = false;
+ // call standard_suffix, line 186
+ if (!this.r_standard_suffix())
+ {
+ break lab5;
+ }
+ break lab4;
+ }
+ this.cursor = this.limit - v_5;
+ // call verb_suffix, line 186
+ if (!this.r_verb_suffix())
+ {
+ break lab3;
+ }
+ }
+ }
+ this.cursor = this.limit - v_4;
+ // do, line 187
+ v_6 = this.limit - this.cursor;
+ var lab6 = true;
+ lab6: while (lab6 == true)
+ {
+ lab6 = false;
+ // call vowel_suffix, line 187
+ if (!this.r_vowel_suffix())
+ {
+ break lab6;
+ }
+ }
+ this.cursor = this.limit - v_6;
+ this.cursor = this.limit_backward; // do, line 189
+ v_7 = this.cursor;
+ var lab7 = true;
+ lab7: while (lab7 == true)
+ {
+ lab7 = false;
+ // call postlude, line 189
+ if (!this.r_postlude())
+ {
+ break lab7;
+ }
+ }
+ this.cursor = v_7;
+ return true;
+ }
+
+ function equals (o : variant) : boolean {
+ return o instanceof ItalianStemmer;
+ }
+
+ function hashCode() : int
+ {
+ //http://stackoverflow.com/questions/194846/is-there-any-kind-of-hashcode-function-in-javascript
+ var classname = "ItalianStemmer";
+ var hash = 0;
+ if (classname.length == 0) return hash;
+ for (var i = 0; i < classname.length; i++) {
+ var char = classname.charCodeAt(i);
+ hash = ((hash << 5) - hash) + char;
+ hash = hash & hash; // Convert to 32bit integer
+ }
+ return hash;
+ }
+
+}
+
diff --git a/web/server/h2o/libh2o/misc/oktavia/src/stemmer/norwegian-stemmer.jsx b/web/server/h2o/libh2o/misc/oktavia/src/stemmer/norwegian-stemmer.jsx
new file mode 100644
index 00000000..29640bf1
--- /dev/null
+++ b/web/server/h2o/libh2o/misc/oktavia/src/stemmer/norwegian-stemmer.jsx
@@ -0,0 +1,428 @@
+// This file was generated automatically by the Snowball to JSX compiler
+
+import "base-stemmer.jsx";
+import "among.jsx";
+
+ /**
+ * This class was automatically generated by a Snowball to JSX compiler
+ * It implements the stemming algorithm defined by a snowball script.
+ */
+
+class NorwegianStemmer extends BaseStemmer
+{
+ static const serialVersionUID = 1;
+ static const methodObject = new NorwegianStemmer();
+
+ static const a_0 = [
+ new Among("a", -1, 1),
+ new Among("e", -1, 1),
+ new Among("ede", 1, 1),
+ new Among("ande", 1, 1),
+ new Among("ende", 1, 1),
+ new Among("ane", 1, 1),
+ new Among("ene", 1, 1),
+ new Among("hetene", 6, 1),
+ new Among("erte", 1, 3),
+ new Among("en", -1, 1),
+ new Among("heten", 9, 1),
+ new Among("ar", -1, 1),
+ new Among("er", -1, 1),
+ new Among("heter", 12, 1),
+ new Among("s", -1, 2),
+ new Among("as", 14, 1),
+ new Among("es", 14, 1),
+ new Among("edes", 16, 1),
+ new Among("endes", 16, 1),
+ new Among("enes", 16, 1),
+ new Among("hetenes", 19, 1),
+ new Among("ens", 14, 1),
+ new Among("hetens", 21, 1),
+ new Among("ers", 14, 1),
+ new Among("ets", 14, 1),
+ new Among("et", -1, 1),
+ new Among("het", 25, 1),
+ new Among("ert", -1, 3),
+ new Among("ast", -1, 1)
+ ];
+
+ static const a_1 = [
+ new Among("dt", -1, -1),
+ new Among("vt", -1, -1)
+ ];
+
+ static const a_2 = [
+ new Among("leg", -1, 1),
+ new Among("eleg", 0, 1),
+ new Among("ig", -1, 1),
+ new Among("eig", 2, 1),
+ new Among("lig", 2, 1),
+ new Among("elig", 4, 1),
+ new Among("els", -1, 1),
+ new Among("lov", -1, 1),
+ new Among("elov", 7, 1),
+ new Among("slov", 7, 1),
+ new Among("hetslov", 9, 1)
+ ];
+
+ static const g_v = [17, 65, 16, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 48, 0, 128] : int[];
+
+ static const g_s_ending = [119, 125, 149, 1] : int[];
+
+ var I_x : int = 0;
+ var I_p1 : int = 0;
+
+ function copy_from (other : NorwegianStemmer) : void
+ {
+ this.I_x = other.I_x;
+ this.I_p1 = other.I_p1;
+ super.copy_from(other);
+ }
+
+ function r_mark_regions () : boolean
+ {
+ var v_1 : int;
+ var v_2 : int;
+ // (, line 26
+ this.I_p1 = this.limit;
+ // test, line 30
+ v_1 = this.cursor;
+ // (, line 30
+ // hop, line 30
+ {
+ var c : int = this.cursor + 3;
+ if (0 > c || c > this.limit)
+ {
+ return false;
+ }
+ this.cursor = c;
+ }
+ // setmark x, line 30
+ this.I_x = this.cursor;
+ this.cursor = v_1;
+ // goto, line 31
+ golab0: while(true)
+ {
+ v_2 = this.cursor;
+ var lab1 = true;
+ lab1: while (lab1 == true)
+ {
+ lab1 = false;
+ if (!(this.in_grouping(NorwegianStemmer.g_v, 97, 248)))
+ {
+ break lab1;
+ }
+ this.cursor = v_2;
+ break golab0;
+ }
+ this.cursor = v_2;
+ if (this.cursor >= this.limit)
+ {
+ return false;
+ }
+ this.cursor++;
+ }
+ // gopast, line 31
+ golab2: while(true)
+ {
+ var lab3 = true;
+ lab3: while (lab3 == true)
+ {
+ lab3 = false;
+ if (!(this.out_grouping(NorwegianStemmer.g_v, 97, 248)))
+ {
+ break lab3;
+ }
+ break golab2;
+ }
+ if (this.cursor >= this.limit)
+ {
+ return false;
+ }
+ this.cursor++;
+ }
+ // setmark p1, line 31
+ this.I_p1 = this.cursor;
+ // try, line 32
+ var lab4 = true;
+ lab4: while (lab4 == true)
+ {
+ lab4 = false;
+ // (, line 32
+ if (!(this.I_p1 < this.I_x))
+ {
+ break lab4;
+ }
+ this.I_p1 = this.I_x;
+ }
+ return true;
+ }
+
+ function r_main_suffix () : boolean
+ {
+ var among_var : int;
+ var v_1 : int;
+ var v_2 : int;
+ var v_3 : int;
+ // (, line 37
+ // setlimit, line 38
+ v_1 = this.limit - this.cursor;
+ // tomark, line 38
+ if (this.cursor < this.I_p1)
+ {
+ return false;
+ }
+ this.cursor = this.I_p1;
+ v_2 = this.limit_backward;
+ this.limit_backward = this.cursor;
+ this.cursor = this.limit - v_1;
+ // (, line 38
+ // [, line 38
+ this.ket = this.cursor;
+ // substring, line 38
+ among_var = this.find_among_b(NorwegianStemmer.a_0, 29);
+ if (among_var == 0)
+ {
+ this.limit_backward = v_2;
+ return false;
+ }
+ // ], line 38
+ this.bra = this.cursor;
+ this.limit_backward = v_2;
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ // (, line 44
+ // delete, line 44
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ break;
+ case 2:
+ // (, line 46
+ // or, line 46
+ var lab0 = true;
+ lab0: while (lab0 == true)
+ {
+ lab0 = false;
+ v_3 = this.limit - this.cursor;
+ var lab1 = true;
+ lab1: while (lab1 == true)
+ {
+ lab1 = false;
+ if (!(this.in_grouping_b(NorwegianStemmer.g_s_ending, 98, 122)))
+ {
+ break lab1;
+ }
+ break lab0;
+ }
+ this.cursor = this.limit - v_3;
+ // (, line 46
+ // literal, line 46
+ if (!(this.eq_s_b(1, "k")))
+ {
+ return false;
+ }
+ if (!(this.out_grouping_b(NorwegianStemmer.g_v, 97, 248)))
+ {
+ return false;
+ }
+ }
+ // delete, line 46
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ break;
+ case 3:
+ // (, line 48
+ // <-, line 48
+ if (!this.slice_from("er"))
+ {
+ return false;
+ }
+ break;
+ }
+ return true;
+ }
+
+ function r_consonant_pair () : boolean
+ {
+ var v_1 : int;
+ var v_2 : int;
+ var v_3 : int;
+ // (, line 52
+ // test, line 53
+ v_1 = this.limit - this.cursor;
+ // (, line 53
+ // setlimit, line 54
+ v_2 = this.limit - this.cursor;
+ // tomark, line 54
+ if (this.cursor < this.I_p1)
+ {
+ return false;
+ }
+ this.cursor = this.I_p1;
+ v_3 = this.limit_backward;
+ this.limit_backward = this.cursor;
+ this.cursor = this.limit - v_2;
+ // (, line 54
+ // [, line 54
+ this.ket = this.cursor;
+ // substring, line 54
+ if (this.find_among_b(NorwegianStemmer.a_1, 2) == 0)
+ {
+ this.limit_backward = v_3;
+ return false;
+ }
+ // ], line 54
+ this.bra = this.cursor;
+ this.limit_backward = v_3;
+ this.cursor = this.limit - v_1;
+ // next, line 59
+ if (this.cursor <= this.limit_backward)
+ {
+ return false;
+ }
+ this.cursor--;
+ // ], line 59
+ this.bra = this.cursor;
+ // delete, line 59
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ return true;
+ }
+
+ function r_other_suffix () : boolean
+ {
+ var among_var : int;
+ var v_1 : int;
+ var v_2 : int;
+ // (, line 62
+ // setlimit, line 63
+ v_1 = this.limit - this.cursor;
+ // tomark, line 63
+ if (this.cursor < this.I_p1)
+ {
+ return false;
+ }
+ this.cursor = this.I_p1;
+ v_2 = this.limit_backward;
+ this.limit_backward = this.cursor;
+ this.cursor = this.limit - v_1;
+ // (, line 63
+ // [, line 63
+ this.ket = this.cursor;
+ // substring, line 63
+ among_var = this.find_among_b(NorwegianStemmer.a_2, 11);
+ if (among_var == 0)
+ {
+ this.limit_backward = v_2;
+ return false;
+ }
+ // ], line 63
+ this.bra = this.cursor;
+ this.limit_backward = v_2;
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ // (, line 67
+ // delete, line 67
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ break;
+ }
+ return true;
+ }
+
+ override function stem () : boolean
+ {
+ var v_1 : int;
+ var v_2 : int;
+ var v_3 : int;
+ var v_4 : int;
+ // (, line 72
+ // do, line 74
+ v_1 = this.cursor;
+ var lab0 = true;
+ lab0: while (lab0 == true)
+ {
+ lab0 = false;
+ // call mark_regions, line 74
+ if (!this.r_mark_regions())
+ {
+ break lab0;
+ }
+ }
+ this.cursor = v_1;
+ // backwards, line 75
+ this.limit_backward = this.cursor; this.cursor = this.limit;
+ // (, line 75
+ // do, line 76
+ v_2 = this.limit - this.cursor;
+ var lab1 = true;
+ lab1: while (lab1 == true)
+ {
+ lab1 = false;
+ // call main_suffix, line 76
+ if (!this.r_main_suffix())
+ {
+ break lab1;
+ }
+ }
+ this.cursor = this.limit - v_2;
+ // do, line 77
+ v_3 = this.limit - this.cursor;
+ var lab2 = true;
+ lab2: while (lab2 == true)
+ {
+ lab2 = false;
+ // call consonant_pair, line 77
+ if (!this.r_consonant_pair())
+ {
+ break lab2;
+ }
+ }
+ this.cursor = this.limit - v_3;
+ // do, line 78
+ v_4 = this.limit - this.cursor;
+ var lab3 = true;
+ lab3: while (lab3 == true)
+ {
+ lab3 = false;
+ // call other_suffix, line 78
+ if (!this.r_other_suffix())
+ {
+ break lab3;
+ }
+ }
+ this.cursor = this.limit - v_4;
+ this.cursor = this.limit_backward; return true;
+ }
+
+ function equals (o : variant) : boolean {
+ return o instanceof NorwegianStemmer;
+ }
+
+ function hashCode() : int
+ {
+ //http://stackoverflow.com/questions/194846/is-there-any-kind-of-hashcode-function-in-javascript
+ var classname = "NorwegianStemmer";
+ var hash = 0;
+ if (classname.length == 0) return hash;
+ for (var i = 0; i < classname.length; i++) {
+ var char = classname.charCodeAt(i);
+ hash = ((hash << 5) - hash) + char;
+ hash = hash & hash; // Convert to 32bit integer
+ }
+ return hash;
+ }
+
+}
+
diff --git a/web/server/h2o/libh2o/misc/oktavia/src/stemmer/porter-stemmer.jsx b/web/server/h2o/libh2o/misc/oktavia/src/stemmer/porter-stemmer.jsx
new file mode 100644
index 00000000..f8570501
--- /dev/null
+++ b/web/server/h2o/libh2o/misc/oktavia/src/stemmer/porter-stemmer.jsx
@@ -0,0 +1,1121 @@
+// This file was generated automatically by the Snowball to JSX compiler
+
+import "base-stemmer.jsx";
+import "among.jsx";
+
+ /**
+ * This class was automatically generated by a Snowball to JSX compiler
+ * It implements the stemming algorithm defined by a snowball script.
+ */
+
+class PorterStemmer extends BaseStemmer
+{
+ static const serialVersionUID = 1;
+ static const methodObject = new PorterStemmer();
+
+ static const a_0 = [
+ new Among("s", -1, 3),
+ new Among("ies", 0, 2),
+ new Among("sses", 0, 1),
+ new Among("ss", 0, -1)
+ ];
+
+ static const a_1 = [
+ new Among("", -1, 3),
+ new Among("bb", 0, 2),
+ new Among("dd", 0, 2),
+ new Among("ff", 0, 2),
+ new Among("gg", 0, 2),
+ new Among("bl", 0, 1),
+ new Among("mm", 0, 2),
+ new Among("nn", 0, 2),
+ new Among("pp", 0, 2),
+ new Among("rr", 0, 2),
+ new Among("at", 0, 1),
+ new Among("tt", 0, 2),
+ new Among("iz", 0, 1)
+ ];
+
+ static const a_2 = [
+ new Among("ed", -1, 2),
+ new Among("eed", 0, 1),
+ new Among("ing", -1, 2)
+ ];
+
+ static const a_3 = [
+ new Among("anci", -1, 3),
+ new Among("enci", -1, 2),
+ new Among("abli", -1, 4),
+ new Among("eli", -1, 6),
+ new Among("alli", -1, 9),
+ new Among("ousli", -1, 12),
+ new Among("entli", -1, 5),
+ new Among("aliti", -1, 10),
+ new Among("biliti", -1, 14),
+ new Among("iviti", -1, 13),
+ new Among("tional", -1, 1),
+ new Among("ational", 10, 8),
+ new Among("alism", -1, 10),
+ new Among("ation", -1, 8),
+ new Among("ization", 13, 7),
+ new Among("izer", -1, 7),
+ new Among("ator", -1, 8),
+ new Among("iveness", -1, 13),
+ new Among("fulness", -1, 11),
+ new Among("ousness", -1, 12)
+ ];
+
+ static const a_4 = [
+ new Among("icate", -1, 2),
+ new Among("ative", -1, 3),
+ new Among("alize", -1, 1),
+ new Among("iciti", -1, 2),
+ new Among("ical", -1, 2),
+ new Among("ful", -1, 3),
+ new Among("ness", -1, 3)
+ ];
+
+ static const a_5 = [
+ new Among("ic", -1, 1),
+ new Among("ance", -1, 1),
+ new Among("ence", -1, 1),
+ new Among("able", -1, 1),
+ new Among("ible", -1, 1),
+ new Among("ate", -1, 1),
+ new Among("ive", -1, 1),
+ new Among("ize", -1, 1),
+ new Among("iti", -1, 1),
+ new Among("al", -1, 1),
+ new Among("ism", -1, 1),
+ new Among("ion", -1, 2),
+ new Among("er", -1, 1),
+ new Among("ous", -1, 1),
+ new Among("ant", -1, 1),
+ new Among("ent", -1, 1),
+ new Among("ment", 15, 1),
+ new Among("ement", 16, 1),
+ new Among("ou", -1, 1)
+ ];
+
+ static const g_v = [17, 65, 16, 1] : int[];
+
+ static const g_v_WXY = [1, 17, 65, 208, 1] : int[];
+
+ var B_Y_found : boolean = false;
+ var I_p2 : int = 0;
+ var I_p1 : int = 0;
+
+ function copy_from (other : PorterStemmer) : void
+ {
+ this.B_Y_found = other.B_Y_found;
+ this.I_p2 = other.I_p2;
+ this.I_p1 = other.I_p1;
+ super.copy_from(other);
+ }
+
+ function r_shortv () : boolean
+ {
+ // (, line 19
+ if (!(this.out_grouping_b(PorterStemmer.g_v_WXY, 89, 121)))
+ {
+ return false;
+ }
+ if (!(this.in_grouping_b(PorterStemmer.g_v, 97, 121)))
+ {
+ return false;
+ }
+ if (!(this.out_grouping_b(PorterStemmer.g_v, 97, 121)))
+ {
+ return false;
+ }
+ return true;
+ }
+
+ function r_R1 () : boolean
+ {
+ if (!(this.I_p1 <= this.cursor))
+ {
+ return false;
+ }
+ return true;
+ }
+
+ function r_R2 () : boolean
+ {
+ if (!(this.I_p2 <= this.cursor))
+ {
+ return false;
+ }
+ return true;
+ }
+
+ function r_Step_1a () : boolean
+ {
+ var among_var : int;
+ // (, line 24
+ // [, line 25
+ this.ket = this.cursor;
+ // substring, line 25
+ among_var = this.find_among_b(PorterStemmer.a_0, 4);
+ if (among_var == 0)
+ {
+ return false;
+ }
+ // ], line 25
+ this.bra = this.cursor;
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ // (, line 26
+ // <-, line 26
+ if (!this.slice_from("ss"))
+ {
+ return false;
+ }
+ break;
+ case 2:
+ // (, line 27
+ // <-, line 27
+ if (!this.slice_from("i"))
+ {
+ return false;
+ }
+ break;
+ case 3:
+ // (, line 29
+ // delete, line 29
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ break;
+ }
+ return true;
+ }
+
+ function r_Step_1b () : boolean
+ {
+ var among_var : int;
+ var v_1 : int;
+ var v_3 : int;
+ var v_4 : int;
+ // (, line 33
+ // [, line 34
+ this.ket = this.cursor;
+ // substring, line 34
+ among_var = this.find_among_b(PorterStemmer.a_2, 3);
+ if (among_var == 0)
+ {
+ return false;
+ }
+ // ], line 34
+ this.bra = this.cursor;
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ // (, line 35
+ // call R1, line 35
+ if (!this.r_R1())
+ {
+ return false;
+ }
+ // <-, line 35
+ if (!this.slice_from("ee"))
+ {
+ return false;
+ }
+ break;
+ case 2:
+ // (, line 37
+ // test, line 38
+ v_1 = this.limit - this.cursor;
+ // gopast, line 38
+ golab0: while(true)
+ {
+ var lab1 = true;
+ lab1: while (lab1 == true)
+ {
+ lab1 = false;
+ if (!(this.in_grouping_b(PorterStemmer.g_v, 97, 121)))
+ {
+ break lab1;
+ }
+ break golab0;
+ }
+ if (this.cursor <= this.limit_backward)
+ {
+ return false;
+ }
+ this.cursor--;
+ }
+ this.cursor = this.limit - v_1;
+ // delete, line 38
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ // test, line 39
+ v_3 = this.limit - this.cursor;
+ // substring, line 39
+ among_var = this.find_among_b(PorterStemmer.a_1, 13);
+ if (among_var == 0)
+ {
+ return false;
+ }
+ this.cursor = this.limit - v_3;
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ // (, line 41
+ // <+, line 41
+ {
+ var c : int = this.cursor;
+ this.insert(this.cursor, this.cursor, "e");
+ this.cursor = c;
+ }
+ break;
+ case 2:
+ // (, line 44
+ // [, line 44
+ this.ket = this.cursor;
+ // next, line 44
+ if (this.cursor <= this.limit_backward)
+ {
+ return false;
+ }
+ this.cursor--;
+ // ], line 44
+ this.bra = this.cursor;
+ // delete, line 44
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ break;
+ case 3:
+ // (, line 45
+ // atmark, line 45
+ if (this.cursor != this.I_p1)
+ {
+ return false;
+ }
+ // test, line 45
+ v_4 = this.limit - this.cursor;
+ // call shortv, line 45
+ if (!this.r_shortv())
+ {
+ return false;
+ }
+ this.cursor = this.limit - v_4;
+ // <+, line 45
+ {
+ var c : int = this.cursor;
+ this.insert(this.cursor, this.cursor, "e");
+ this.cursor = c;
+ }
+ break;
+ }
+ break;
+ }
+ return true;
+ }
+
+ function r_Step_1c () : boolean
+ {
+ var v_1 : int;
+ // (, line 51
+ // [, line 52
+ this.ket = this.cursor;
+ // or, line 52
+ var lab0 = true;
+ lab0: while (lab0 == true)
+ {
+ lab0 = false;
+ v_1 = this.limit - this.cursor;
+ var lab1 = true;
+ lab1: while (lab1 == true)
+ {
+ lab1 = false;
+ // literal, line 52
+ if (!(this.eq_s_b(1, "y")))
+ {
+ break lab1;
+ }
+ break lab0;
+ }
+ this.cursor = this.limit - v_1;
+ // literal, line 52
+ if (!(this.eq_s_b(1, "Y")))
+ {
+ return false;
+ }
+ }
+ // ], line 52
+ this.bra = this.cursor;
+ // gopast, line 53
+ golab2: while(true)
+ {
+ var lab3 = true;
+ lab3: while (lab3 == true)
+ {
+ lab3 = false;
+ if (!(this.in_grouping_b(PorterStemmer.g_v, 97, 121)))
+ {
+ break lab3;
+ }
+ break golab2;
+ }
+ if (this.cursor <= this.limit_backward)
+ {
+ return false;
+ }
+ this.cursor--;
+ }
+ // <-, line 54
+ if (!this.slice_from("i"))
+ {
+ return false;
+ }
+ return true;
+ }
+
+ function r_Step_2 () : boolean
+ {
+ var among_var : int;
+ // (, line 57
+ // [, line 58
+ this.ket = this.cursor;
+ // substring, line 58
+ among_var = this.find_among_b(PorterStemmer.a_3, 20);
+ if (among_var == 0)
+ {
+ return false;
+ }
+ // ], line 58
+ this.bra = this.cursor;
+ // call R1, line 58
+ if (!this.r_R1())
+ {
+ return false;
+ }
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ // (, line 59
+ // <-, line 59
+ if (!this.slice_from("tion"))
+ {
+ return false;
+ }
+ break;
+ case 2:
+ // (, line 60
+ // <-, line 60
+ if (!this.slice_from("ence"))
+ {
+ return false;
+ }
+ break;
+ case 3:
+ // (, line 61
+ // <-, line 61
+ if (!this.slice_from("ance"))
+ {
+ return false;
+ }
+ break;
+ case 4:
+ // (, line 62
+ // <-, line 62
+ if (!this.slice_from("able"))
+ {
+ return false;
+ }
+ break;
+ case 5:
+ // (, line 63
+ // <-, line 63
+ if (!this.slice_from("ent"))
+ {
+ return false;
+ }
+ break;
+ case 6:
+ // (, line 64
+ // <-, line 64
+ if (!this.slice_from("e"))
+ {
+ return false;
+ }
+ break;
+ case 7:
+ // (, line 66
+ // <-, line 66
+ if (!this.slice_from("ize"))
+ {
+ return false;
+ }
+ break;
+ case 8:
+ // (, line 68
+ // <-, line 68
+ if (!this.slice_from("ate"))
+ {
+ return false;
+ }
+ break;
+ case 9:
+ // (, line 69
+ // <-, line 69
+ if (!this.slice_from("al"))
+ {
+ return false;
+ }
+ break;
+ case 10:
+ // (, line 71
+ // <-, line 71
+ if (!this.slice_from("al"))
+ {
+ return false;
+ }
+ break;
+ case 11:
+ // (, line 72
+ // <-, line 72
+ if (!this.slice_from("ful"))
+ {
+ return false;
+ }
+ break;
+ case 12:
+ // (, line 74
+ // <-, line 74
+ if (!this.slice_from("ous"))
+ {
+ return false;
+ }
+ break;
+ case 13:
+ // (, line 76
+ // <-, line 76
+ if (!this.slice_from("ive"))
+ {
+ return false;
+ }
+ break;
+ case 14:
+ // (, line 77
+ // <-, line 77
+ if (!this.slice_from("ble"))
+ {
+ return false;
+ }
+ break;
+ }
+ return true;
+ }
+
+ function r_Step_3 () : boolean
+ {
+ var among_var : int;
+ // (, line 81
+ // [, line 82
+ this.ket = this.cursor;
+ // substring, line 82
+ among_var = this.find_among_b(PorterStemmer.a_4, 7);
+ if (among_var == 0)
+ {
+ return false;
+ }
+ // ], line 82
+ this.bra = this.cursor;
+ // call R1, line 82
+ if (!this.r_R1())
+ {
+ return false;
+ }
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ // (, line 83
+ // <-, line 83
+ if (!this.slice_from("al"))
+ {
+ return false;
+ }
+ break;
+ case 2:
+ // (, line 85
+ // <-, line 85
+ if (!this.slice_from("ic"))
+ {
+ return false;
+ }
+ break;
+ case 3:
+ // (, line 87
+ // delete, line 87
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ break;
+ }
+ return true;
+ }
+
+ function r_Step_4 () : boolean
+ {
+ var among_var : int;
+ var v_1 : int;
+ // (, line 91
+ // [, line 92
+ this.ket = this.cursor;
+ // substring, line 92
+ among_var = this.find_among_b(PorterStemmer.a_5, 19);
+ if (among_var == 0)
+ {
+ return false;
+ }
+ // ], line 92
+ this.bra = this.cursor;
+ // call R2, line 92
+ if (!this.r_R2())
+ {
+ return false;
+ }
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ // (, line 95
+ // delete, line 95
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ break;
+ case 2:
+ // (, line 96
+ // or, line 96
+ var lab0 = true;
+ lab0: while (lab0 == true)
+ {
+ lab0 = false;
+ v_1 = this.limit - this.cursor;
+ var lab1 = true;
+ lab1: while (lab1 == true)
+ {
+ lab1 = false;
+ // literal, line 96
+ if (!(this.eq_s_b(1, "s")))
+ {
+ break lab1;
+ }
+ break lab0;
+ }
+ this.cursor = this.limit - v_1;
+ // literal, line 96
+ if (!(this.eq_s_b(1, "t")))
+ {
+ return false;
+ }
+ }
+ // delete, line 96
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ break;
+ }
+ return true;
+ }
+
+ function r_Step_5a () : boolean
+ {
+ var v_1 : int;
+ var v_2 : int;
+ // (, line 100
+ // [, line 101
+ this.ket = this.cursor;
+ // literal, line 101
+ if (!(this.eq_s_b(1, "e")))
+ {
+ return false;
+ }
+ // ], line 101
+ this.bra = this.cursor;
+ // or, line 102
+ var lab0 = true;
+ lab0: while (lab0 == true)
+ {
+ lab0 = false;
+ v_1 = this.limit - this.cursor;
+ var lab1 = true;
+ lab1: while (lab1 == true)
+ {
+ lab1 = false;
+ // call R2, line 102
+ if (!this.r_R2())
+ {
+ break lab1;
+ }
+ break lab0;
+ }
+ this.cursor = this.limit - v_1;
+ // (, line 102
+ // call R1, line 102
+ if (!this.r_R1())
+ {
+ return false;
+ }
+ // not, line 102
+ {
+ v_2 = this.limit - this.cursor;
+ var lab2 = true;
+ lab2: while (lab2 == true)
+ {
+ lab2 = false;
+ // call shortv, line 102
+ if (!this.r_shortv())
+ {
+ break lab2;
+ }
+ return false;
+ }
+ this.cursor = this.limit - v_2;
+ }
+ }
+ // delete, line 103
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ return true;
+ }
+
+ function r_Step_5b () : boolean
+ {
+ // (, line 106
+ // [, line 107
+ this.ket = this.cursor;
+ // literal, line 107
+ if (!(this.eq_s_b(1, "l")))
+ {
+ return false;
+ }
+ // ], line 107
+ this.bra = this.cursor;
+ // call R2, line 108
+ if (!this.r_R2())
+ {
+ return false;
+ }
+ // literal, line 108
+ if (!(this.eq_s_b(1, "l")))
+ {
+ return false;
+ }
+ // delete, line 109
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ return true;
+ }
+
+ override function stem () : boolean
+ {
+ var v_1 : int;
+ var v_2 : int;
+ var v_3 : int;
+ var v_4 : int;
+ var v_5 : int;
+ var v_10 : int;
+ var v_11 : int;
+ var v_12 : int;
+ var v_13 : int;
+ var v_14 : int;
+ var v_15 : int;
+ var v_16 : int;
+ var v_17 : int;
+ var v_18 : int;
+ var v_19 : int;
+ var v_20 : int;
+ // (, line 113
+ // unset Y_found, line 115
+ this.B_Y_found = false;
+ // do, line 116
+ v_1 = this.cursor;
+ var lab0 = true;
+ lab0: while (lab0 == true)
+ {
+ lab0 = false;
+ // (, line 116
+ // [, line 116
+ this.bra = this.cursor;
+ // literal, line 116
+ if (!(this.eq_s(1, "y")))
+ {
+ break lab0;
+ }
+ // ], line 116
+ this.ket = this.cursor;
+ // <-, line 116
+ if (!this.slice_from("Y"))
+ {
+ return false;
+ }
+ // set Y_found, line 116
+ this.B_Y_found = true;
+ }
+ this.cursor = v_1;
+ // do, line 117
+ v_2 = this.cursor;
+ var lab1 = true;
+ lab1: while (lab1 == true)
+ {
+ lab1 = false;
+ // repeat, line 117
+ replab2: while(true)
+ {
+ v_3 = this.cursor;
+ var lab3 = true;
+ lab3: while (lab3 == true)
+ {
+ lab3 = false;
+ // (, line 117
+ // goto, line 117
+ golab4: while(true)
+ {
+ v_4 = this.cursor;
+ var lab5 = true;
+ lab5: while (lab5 == true)
+ {
+ lab5 = false;
+ // (, line 117
+ if (!(this.in_grouping(PorterStemmer.g_v, 97, 121)))
+ {
+ break lab5;
+ }
+ // [, line 117
+ this.bra = this.cursor;
+ // literal, line 117
+ if (!(this.eq_s(1, "y")))
+ {
+ break lab5;
+ }
+ // ], line 117
+ this.ket = this.cursor;
+ this.cursor = v_4;
+ break golab4;
+ }
+ this.cursor = v_4;
+ if (this.cursor >= this.limit)
+ {
+ break lab3;
+ }
+ this.cursor++;
+ }
+ // <-, line 117
+ if (!this.slice_from("Y"))
+ {
+ return false;
+ }
+ // set Y_found, line 117
+ this.B_Y_found = true;
+ continue replab2;
+ }
+ this.cursor = v_3;
+ break replab2;
+ }
+ }
+ this.cursor = v_2;
+ this.I_p1 = this.limit;
+ this.I_p2 = this.limit;
+ // do, line 121
+ v_5 = this.cursor;
+ var lab6 = true;
+ lab6: while (lab6 == true)
+ {
+ lab6 = false;
+ // (, line 121
+ // gopast, line 122
+ golab7: while(true)
+ {
+ var lab8 = true;
+ lab8: while (lab8 == true)
+ {
+ lab8 = false;
+ if (!(this.in_grouping(PorterStemmer.g_v, 97, 121)))
+ {
+ break lab8;
+ }
+ break golab7;
+ }
+ if (this.cursor >= this.limit)
+ {
+ break lab6;
+ }
+ this.cursor++;
+ }
+ // gopast, line 122
+ golab9: while(true)
+ {
+ var lab10 = true;
+ lab10: while (lab10 == true)
+ {
+ lab10 = false;
+ if (!(this.out_grouping(PorterStemmer.g_v, 97, 121)))
+ {
+ break lab10;
+ }
+ break golab9;
+ }
+ if (this.cursor >= this.limit)
+ {
+ break lab6;
+ }
+ this.cursor++;
+ }
+ // setmark p1, line 122
+ this.I_p1 = this.cursor;
+ // gopast, line 123
+ golab11: while(true)
+ {
+ var lab12 = true;
+ lab12: while (lab12 == true)
+ {
+ lab12 = false;
+ if (!(this.in_grouping(PorterStemmer.g_v, 97, 121)))
+ {
+ break lab12;
+ }
+ break golab11;
+ }
+ if (this.cursor >= this.limit)
+ {
+ break lab6;
+ }
+ this.cursor++;
+ }
+ // gopast, line 123
+ golab13: while(true)
+ {
+ var lab14 = true;
+ lab14: while (lab14 == true)
+ {
+ lab14 = false;
+ if (!(this.out_grouping(PorterStemmer.g_v, 97, 121)))
+ {
+ break lab14;
+ }
+ break golab13;
+ }
+ if (this.cursor >= this.limit)
+ {
+ break lab6;
+ }
+ this.cursor++;
+ }
+ // setmark p2, line 123
+ this.I_p2 = this.cursor;
+ }
+ this.cursor = v_5;
+ // backwards, line 126
+ this.limit_backward = this.cursor; this.cursor = this.limit;
+ // (, line 126
+ // do, line 127
+ v_10 = this.limit - this.cursor;
+ var lab15 = true;
+ lab15: while (lab15 == true)
+ {
+ lab15 = false;
+ // call Step_1a, line 127
+ if (!this.r_Step_1a())
+ {
+ break lab15;
+ }
+ }
+ this.cursor = this.limit - v_10;
+ // do, line 128
+ v_11 = this.limit - this.cursor;
+ var lab16 = true;
+ lab16: while (lab16 == true)
+ {
+ lab16 = false;
+ // call Step_1b, line 128
+ if (!this.r_Step_1b())
+ {
+ break lab16;
+ }
+ }
+ this.cursor = this.limit - v_11;
+ // do, line 129
+ v_12 = this.limit - this.cursor;
+ var lab17 = true;
+ lab17: while (lab17 == true)
+ {
+ lab17 = false;
+ // call Step_1c, line 129
+ if (!this.r_Step_1c())
+ {
+ break lab17;
+ }
+ }
+ this.cursor = this.limit - v_12;
+ // do, line 130
+ v_13 = this.limit - this.cursor;
+ var lab18 = true;
+ lab18: while (lab18 == true)
+ {
+ lab18 = false;
+ // call Step_2, line 130
+ if (!this.r_Step_2())
+ {
+ break lab18;
+ }
+ }
+ this.cursor = this.limit - v_13;
+ // do, line 131
+ v_14 = this.limit - this.cursor;
+ var lab19 = true;
+ lab19: while (lab19 == true)
+ {
+ lab19 = false;
+ // call Step_3, line 131
+ if (!this.r_Step_3())
+ {
+ break lab19;
+ }
+ }
+ this.cursor = this.limit - v_14;
+ // do, line 132
+ v_15 = this.limit - this.cursor;
+ var lab20 = true;
+ lab20: while (lab20 == true)
+ {
+ lab20 = false;
+ // call Step_4, line 132
+ if (!this.r_Step_4())
+ {
+ break lab20;
+ }
+ }
+ this.cursor = this.limit - v_15;
+ // do, line 133
+ v_16 = this.limit - this.cursor;
+ var lab21 = true;
+ lab21: while (lab21 == true)
+ {
+ lab21 = false;
+ // call Step_5a, line 133
+ if (!this.r_Step_5a())
+ {
+ break lab21;
+ }
+ }
+ this.cursor = this.limit - v_16;
+ // do, line 134
+ v_17 = this.limit - this.cursor;
+ var lab22 = true;
+ lab22: while (lab22 == true)
+ {
+ lab22 = false;
+ // call Step_5b, line 134
+ if (!this.r_Step_5b())
+ {
+ break lab22;
+ }
+ }
+ this.cursor = this.limit - v_17;
+ this.cursor = this.limit_backward; // do, line 137
+ v_18 = this.cursor;
+ var lab23 = true;
+ lab23: while (lab23 == true)
+ {
+ lab23 = false;
+ // (, line 137
+ // Boolean test Y_found, line 137
+ if (!(this.B_Y_found))
+ {
+ break lab23;
+ }
+ // repeat, line 137
+ replab24: while(true)
+ {
+ v_19 = this.cursor;
+ var lab25 = true;
+ lab25: while (lab25 == true)
+ {
+ lab25 = false;
+ // (, line 137
+ // goto, line 137
+ golab26: while(true)
+ {
+ v_20 = this.cursor;
+ var lab27 = true;
+ lab27: while (lab27 == true)
+ {
+ lab27 = false;
+ // (, line 137
+ // [, line 137
+ this.bra = this.cursor;
+ // literal, line 137
+ if (!(this.eq_s(1, "Y")))
+ {
+ break lab27;
+ }
+ // ], line 137
+ this.ket = this.cursor;
+ this.cursor = v_20;
+ break golab26;
+ }
+ this.cursor = v_20;
+ if (this.cursor >= this.limit)
+ {
+ break lab25;
+ }
+ this.cursor++;
+ }
+ // <-, line 137
+ if (!this.slice_from("y"))
+ {
+ return false;
+ }
+ continue replab24;
+ }
+ this.cursor = v_19;
+ break replab24;
+ }
+ }
+ this.cursor = v_18;
+ return true;
+ }
+
+ function equals (o : variant) : boolean {
+ return o instanceof PorterStemmer;
+ }
+
+ function hashCode() : int
+ {
+ //http://stackoverflow.com/questions/194846/is-there-any-kind-of-hashcode-function-in-javascript
+ var classname = "PorterStemmer";
+ var hash = 0;
+ if (classname.length == 0) return hash;
+ for (var i = 0; i < classname.length; i++) {
+ var char = classname.charCodeAt(i);
+ hash = ((hash << 5) - hash) + char;
+ hash = hash & hash; // Convert to 32bit integer
+ }
+ return hash;
+ }
+
+}
+
diff --git a/web/server/h2o/libh2o/misc/oktavia/src/stemmer/portuguese-stemmer.jsx b/web/server/h2o/libh2o/misc/oktavia/src/stemmer/portuguese-stemmer.jsx
new file mode 100644
index 00000000..317837d9
--- /dev/null
+++ b/web/server/h2o/libh2o/misc/oktavia/src/stemmer/portuguese-stemmer.jsx
@@ -0,0 +1,1321 @@
+// This file was generated automatically by the Snowball to JSX compiler
+
+import "base-stemmer.jsx";
+import "among.jsx";
+
+ /**
+ * This class was automatically generated by a Snowball to JSX compiler
+ * It implements the stemming algorithm defined by a snowball script.
+ */
+
+class PortugueseStemmer extends BaseStemmer
+{
+ static const serialVersionUID = 1;
+ static const methodObject = new PortugueseStemmer();
+
+ static const a_0 = [
+ new Among("", -1, 3),
+ new Among("\u00E3", 0, 1),
+ new Among("\u00F5", 0, 2)
+ ];
+
+ static const a_1 = [
+ new Among("", -1, 3),
+ new Among("a~", 0, 1),
+ new Among("o~", 0, 2)
+ ];
+
+ static const a_2 = [
+ new Among("ic", -1, -1),
+ new Among("ad", -1, -1),
+ new Among("os", -1, -1),
+ new Among("iv", -1, 1)
+ ];
+
+ static const a_3 = [
+ new Among("ante", -1, 1),
+ new Among("avel", -1, 1),
+ new Among("\u00EDvel", -1, 1)
+ ];
+
+ static const a_4 = [
+ new Among("ic", -1, 1),
+ new Among("abil", -1, 1),
+ new Among("iv", -1, 1)
+ ];
+
+ static const a_5 = [
+ new Among("ica", -1, 1),
+ new Among("\u00E2ncia", -1, 1),
+ new Among("\u00EAncia", -1, 4),
+ new Among("ira", -1, 9),
+ new Among("adora", -1, 1),
+ new Among("osa", -1, 1),
+ new Among("ista", -1, 1),
+ new Among("iva", -1, 8),
+ new Among("eza", -1, 1),
+ new Among("log\u00EDa", -1, 2),
+ new Among("idade", -1, 7),
+ new Among("ante", -1, 1),
+ new Among("mente", -1, 6),
+ new Among("amente", 12, 5),
+ new Among("\u00E1vel", -1, 1),
+ new Among("\u00EDvel", -1, 1),
+ new Among("uci\u00F3n", -1, 3),
+ new Among("ico", -1, 1),
+ new Among("ismo", -1, 1),
+ new Among("oso", -1, 1),
+ new Among("amento", -1, 1),
+ new Among("imento", -1, 1),
+ new Among("ivo", -1, 8),
+ new Among("a\u00E7a~o", -1, 1),
+ new Among("ador", -1, 1),
+ new Among("icas", -1, 1),
+ new Among("\u00EAncias", -1, 4),
+ new Among("iras", -1, 9),
+ new Among("adoras", -1, 1),
+ new Among("osas", -1, 1),
+ new Among("istas", -1, 1),
+ new Among("ivas", -1, 8),
+ new Among("ezas", -1, 1),
+ new Among("log\u00EDas", -1, 2),
+ new Among("idades", -1, 7),
+ new Among("uciones", -1, 3),
+ new Among("adores", -1, 1),
+ new Among("antes", -1, 1),
+ new Among("a\u00E7o~es", -1, 1),
+ new Among("icos", -1, 1),
+ new Among("ismos", -1, 1),
+ new Among("osos", -1, 1),
+ new Among("amentos", -1, 1),
+ new Among("imentos", -1, 1),
+ new Among("ivos", -1, 8)
+ ];
+
+ static const a_6 = [
+ new Among("ada", -1, 1),
+ new Among("ida", -1, 1),
+ new Among("ia", -1, 1),
+ new Among("aria", 2, 1),
+ new Among("eria", 2, 1),
+ new Among("iria", 2, 1),
+ new Among("ara", -1, 1),
+ new Among("era", -1, 1),
+ new Among("ira", -1, 1),
+ new Among("ava", -1, 1),
+ new Among("asse", -1, 1),
+ new Among("esse", -1, 1),
+ new Among("isse", -1, 1),
+ new Among("aste", -1, 1),
+ new Among("este", -1, 1),
+ new Among("iste", -1, 1),
+ new Among("ei", -1, 1),
+ new Among("arei", 16, 1),
+ new Among("erei", 16, 1),
+ new Among("irei", 16, 1),
+ new Among("am", -1, 1),
+ new Among("iam", 20, 1),
+ new Among("ariam", 21, 1),
+ new Among("eriam", 21, 1),
+ new Among("iriam", 21, 1),
+ new Among("aram", 20, 1),
+ new Among("eram", 20, 1),
+ new Among("iram", 20, 1),
+ new Among("avam", 20, 1),
+ new Among("em", -1, 1),
+ new Among("arem", 29, 1),
+ new Among("erem", 29, 1),
+ new Among("irem", 29, 1),
+ new Among("assem", 29, 1),
+ new Among("essem", 29, 1),
+ new Among("issem", 29, 1),
+ new Among("ado", -1, 1),
+ new Among("ido", -1, 1),
+ new Among("ando", -1, 1),
+ new Among("endo", -1, 1),
+ new Among("indo", -1, 1),
+ new Among("ara~o", -1, 1),
+ new Among("era~o", -1, 1),
+ new Among("ira~o", -1, 1),
+ new Among("ar", -1, 1),
+ new Among("er", -1, 1),
+ new Among("ir", -1, 1),
+ new Among("as", -1, 1),
+ new Among("adas", 47, 1),
+ new Among("idas", 47, 1),
+ new Among("ias", 47, 1),
+ new Among("arias", 50, 1),
+ new Among("erias", 50, 1),
+ new Among("irias", 50, 1),
+ new Among("aras", 47, 1),
+ new Among("eras", 47, 1),
+ new Among("iras", 47, 1),
+ new Among("avas", 47, 1),
+ new Among("es", -1, 1),
+ new Among("ardes", 58, 1),
+ new Among("erdes", 58, 1),
+ new Among("irdes", 58, 1),
+ new Among("ares", 58, 1),
+ new Among("eres", 58, 1),
+ new Among("ires", 58, 1),
+ new Among("asses", 58, 1),
+ new Among("esses", 58, 1),
+ new Among("isses", 58, 1),
+ new Among("astes", 58, 1),
+ new Among("estes", 58, 1),
+ new Among("istes", 58, 1),
+ new Among("is", -1, 1),
+ new Among("ais", 71, 1),
+ new Among("eis", 71, 1),
+ new Among("areis", 73, 1),
+ new Among("ereis", 73, 1),
+ new Among("ireis", 73, 1),
+ new Among("\u00E1reis", 73, 1),
+ new Among("\u00E9reis", 73, 1),
+ new Among("\u00EDreis", 73, 1),
+ new Among("\u00E1sseis", 73, 1),
+ new Among("\u00E9sseis", 73, 1),
+ new Among("\u00EDsseis", 73, 1),
+ new Among("\u00E1veis", 73, 1),
+ new Among("\u00EDeis", 73, 1),
+ new Among("ar\u00EDeis", 84, 1),
+ new Among("er\u00EDeis", 84, 1),
+ new Among("ir\u00EDeis", 84, 1),
+ new Among("ados", -1, 1),
+ new Among("idos", -1, 1),
+ new Among("amos", -1, 1),
+ new Among("\u00E1ramos", 90, 1),
+ new Among("\u00E9ramos", 90, 1),
+ new Among("\u00EDramos", 90, 1),
+ new Among("\u00E1vamos", 90, 1),
+ new Among("\u00EDamos", 90, 1),
+ new Among("ar\u00EDamos", 95, 1),
+ new Among("er\u00EDamos", 95, 1),
+ new Among("ir\u00EDamos", 95, 1),
+ new Among("emos", -1, 1),
+ new Among("aremos", 99, 1),
+ new Among("eremos", 99, 1),
+ new Among("iremos", 99, 1),
+ new Among("\u00E1ssemos", 99, 1),
+ new Among("\u00EAssemos", 99, 1),
+ new Among("\u00EDssemos", 99, 1),
+ new Among("imos", -1, 1),
+ new Among("armos", -1, 1),
+ new Among("ermos", -1, 1),
+ new Among("irmos", -1, 1),
+ new Among("\u00E1mos", -1, 1),
+ new Among("ar\u00E1s", -1, 1),
+ new Among("er\u00E1s", -1, 1),
+ new Among("ir\u00E1s", -1, 1),
+ new Among("eu", -1, 1),
+ new Among("iu", -1, 1),
+ new Among("ou", -1, 1),
+ new Among("ar\u00E1", -1, 1),
+ new Among("er\u00E1", -1, 1),
+ new Among("ir\u00E1", -1, 1)
+ ];
+
+ static const a_7 = [
+ new Among("a", -1, 1),
+ new Among("i", -1, 1),
+ new Among("o", -1, 1),
+ new Among("os", -1, 1),
+ new Among("\u00E1", -1, 1),
+ new Among("\u00ED", -1, 1),
+ new Among("\u00F3", -1, 1)
+ ];
+
+ static const a_8 = [
+ new Among("e", -1, 1),
+ new Among("\u00E7", -1, 2),
+ new Among("\u00E9", -1, 1),
+ new Among("\u00EA", -1, 1)
+ ];
+
+ static const g_v = [17, 65, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 19, 12, 2] : int[];
+
+ var I_p2 : int = 0;
+ var I_p1 : int = 0;
+ var I_pV : int = 0;
+
+ function copy_from (other : PortugueseStemmer) : void
+ {
+ this.I_p2 = other.I_p2;
+ this.I_p1 = other.I_p1;
+ this.I_pV = other.I_pV;
+ super.copy_from(other);
+ }
+
+ function r_prelude () : boolean
+ {
+ var among_var : int;
+ var v_1 : int;
+ // repeat, line 36
+ replab0: while(true)
+ {
+ v_1 = this.cursor;
+ var lab1 = true;
+ lab1: while (lab1 == true)
+ {
+ lab1 = false;
+ // (, line 36
+ // [, line 37
+ this.bra = this.cursor;
+ // substring, line 37
+ among_var = this.find_among(PortugueseStemmer.a_0, 3);
+ if (among_var == 0)
+ {
+ break lab1;
+ }
+ // ], line 37
+ this.ket = this.cursor;
+ switch (among_var) {
+ case 0:
+ break lab1;
+ case 1:
+ // (, line 38
+ // <-, line 38
+ if (!this.slice_from("a~"))
+ {
+ return false;
+ }
+ break;
+ case 2:
+ // (, line 39
+ // <-, line 39
+ if (!this.slice_from("o~"))
+ {
+ return false;
+ }
+ break;
+ case 3:
+ // (, line 40
+ // next, line 40
+ if (this.cursor >= this.limit)
+ {
+ break lab1;
+ }
+ this.cursor++;
+ break;
+ }
+ continue replab0;
+ }
+ this.cursor = v_1;
+ break replab0;
+ }
+ return true;
+ }
+
+ function r_mark_regions () : boolean
+ {
+ var v_1 : int;
+ var v_2 : int;
+ var v_3 : int;
+ var v_6 : int;
+ var v_8 : int;
+ // (, line 44
+ this.I_pV = this.limit;
+ this.I_p1 = this.limit;
+ this.I_p2 = this.limit;
+ // do, line 50
+ v_1 = this.cursor;
+ var lab0 = true;
+ lab0: while (lab0 == true)
+ {
+ lab0 = false;
+ // (, line 50
+ // or, line 52
+ var lab1 = true;
+ lab1: while (lab1 == true)
+ {
+ lab1 = false;
+ v_2 = this.cursor;
+ var lab2 = true;
+ lab2: while (lab2 == true)
+ {
+ lab2 = false;
+ // (, line 51
+ if (!(this.in_grouping(PortugueseStemmer.g_v, 97, 250)))
+ {
+ break lab2;
+ }
+ // or, line 51
+ var lab3 = true;
+ lab3: while (lab3 == true)
+ {
+ lab3 = false;
+ v_3 = this.cursor;
+ var lab4 = true;
+ lab4: while (lab4 == true)
+ {
+ lab4 = false;
+ // (, line 51
+ if (!(this.out_grouping(PortugueseStemmer.g_v, 97, 250)))
+ {
+ break lab4;
+ }
+ // gopast, line 51
+ golab5: while(true)
+ {
+ var lab6 = true;
+ lab6: while (lab6 == true)
+ {
+ lab6 = false;
+ if (!(this.in_grouping(PortugueseStemmer.g_v, 97, 250)))
+ {
+ break lab6;
+ }
+ break golab5;
+ }
+ if (this.cursor >= this.limit)
+ {
+ break lab4;
+ }
+ this.cursor++;
+ }
+ break lab3;
+ }
+ this.cursor = v_3;
+ // (, line 51
+ if (!(this.in_grouping(PortugueseStemmer.g_v, 97, 250)))
+ {
+ break lab2;
+ }
+ // gopast, line 51
+ golab7: while(true)
+ {
+ var lab8 = true;
+ lab8: while (lab8 == true)
+ {
+ lab8 = false;
+ if (!(this.out_grouping(PortugueseStemmer.g_v, 97, 250)))
+ {
+ break lab8;
+ }
+ break golab7;
+ }
+ if (this.cursor >= this.limit)
+ {
+ break lab2;
+ }
+ this.cursor++;
+ }
+ }
+ break lab1;
+ }
+ this.cursor = v_2;
+ // (, line 53
+ if (!(this.out_grouping(PortugueseStemmer.g_v, 97, 250)))
+ {
+ break lab0;
+ }
+ // or, line 53
+ var lab9 = true;
+ lab9: while (lab9 == true)
+ {
+ lab9 = false;
+ v_6 = this.cursor;
+ var lab10 = true;
+ lab10: while (lab10 == true)
+ {
+ lab10 = false;
+ // (, line 53
+ if (!(this.out_grouping(PortugueseStemmer.g_v, 97, 250)))
+ {
+ break lab10;
+ }
+ // gopast, line 53
+ golab11: while(true)
+ {
+ var lab12 = true;
+ lab12: while (lab12 == true)
+ {
+ lab12 = false;
+ if (!(this.in_grouping(PortugueseStemmer.g_v, 97, 250)))
+ {
+ break lab12;
+ }
+ break golab11;
+ }
+ if (this.cursor >= this.limit)
+ {
+ break lab10;
+ }
+ this.cursor++;
+ }
+ break lab9;
+ }
+ this.cursor = v_6;
+ // (, line 53
+ if (!(this.in_grouping(PortugueseStemmer.g_v, 97, 250)))
+ {
+ break lab0;
+ }
+ // next, line 53
+ if (this.cursor >= this.limit)
+ {
+ break lab0;
+ }
+ this.cursor++;
+ }
+ }
+ // setmark pV, line 54
+ this.I_pV = this.cursor;
+ }
+ this.cursor = v_1;
+ // do, line 56
+ v_8 = this.cursor;
+ var lab13 = true;
+ lab13: while (lab13 == true)
+ {
+ lab13 = false;
+ // (, line 56
+ // gopast, line 57
+ golab14: while(true)
+ {
+ var lab15 = true;
+ lab15: while (lab15 == true)
+ {
+ lab15 = false;
+ if (!(this.in_grouping(PortugueseStemmer.g_v, 97, 250)))
+ {
+ break lab15;
+ }
+ break golab14;
+ }
+ if (this.cursor >= this.limit)
+ {
+ break lab13;
+ }
+ this.cursor++;
+ }
+ // gopast, line 57
+ golab16: while(true)
+ {
+ var lab17 = true;
+ lab17: while (lab17 == true)
+ {
+ lab17 = false;
+ if (!(this.out_grouping(PortugueseStemmer.g_v, 97, 250)))
+ {
+ break lab17;
+ }
+ break golab16;
+ }
+ if (this.cursor >= this.limit)
+ {
+ break lab13;
+ }
+ this.cursor++;
+ }
+ // setmark p1, line 57
+ this.I_p1 = this.cursor;
+ // gopast, line 58
+ golab18: while(true)
+ {
+ var lab19 = true;
+ lab19: while (lab19 == true)
+ {
+ lab19 = false;
+ if (!(this.in_grouping(PortugueseStemmer.g_v, 97, 250)))
+ {
+ break lab19;
+ }
+ break golab18;
+ }
+ if (this.cursor >= this.limit)
+ {
+ break lab13;
+ }
+ this.cursor++;
+ }
+ // gopast, line 58
+ golab20: while(true)
+ {
+ var lab21 = true;
+ lab21: while (lab21 == true)
+ {
+ lab21 = false;
+ if (!(this.out_grouping(PortugueseStemmer.g_v, 97, 250)))
+ {
+ break lab21;
+ }
+ break golab20;
+ }
+ if (this.cursor >= this.limit)
+ {
+ break lab13;
+ }
+ this.cursor++;
+ }
+ // setmark p2, line 58
+ this.I_p2 = this.cursor;
+ }
+ this.cursor = v_8;
+ return true;
+ }
+
+ function r_postlude () : boolean
+ {
+ var among_var : int;
+ var v_1 : int;
+ // repeat, line 62
+ replab0: while(true)
+ {
+ v_1 = this.cursor;
+ var lab1 = true;
+ lab1: while (lab1 == true)
+ {
+ lab1 = false;
+ // (, line 62
+ // [, line 63
+ this.bra = this.cursor;
+ // substring, line 63
+ among_var = this.find_among(PortugueseStemmer.a_1, 3);
+ if (among_var == 0)
+ {
+ break lab1;
+ }
+ // ], line 63
+ this.ket = this.cursor;
+ switch (among_var) {
+ case 0:
+ break lab1;
+ case 1:
+ // (, line 64
+ // <-, line 64
+ if (!this.slice_from("\u00E3"))
+ {
+ return false;
+ }
+ break;
+ case 2:
+ // (, line 65
+ // <-, line 65
+ if (!this.slice_from("\u00F5"))
+ {
+ return false;
+ }
+ break;
+ case 3:
+ // (, line 66
+ // next, line 66
+ if (this.cursor >= this.limit)
+ {
+ break lab1;
+ }
+ this.cursor++;
+ break;
+ }
+ continue replab0;
+ }
+ this.cursor = v_1;
+ break replab0;
+ }
+ return true;
+ }
+
+ function r_RV () : boolean
+ {
+ if (!(this.I_pV <= this.cursor))
+ {
+ return false;
+ }
+ return true;
+ }
+
+ function r_R1 () : boolean
+ {
+ if (!(this.I_p1 <= this.cursor))
+ {
+ return false;
+ }
+ return true;
+ }
+
+ function r_R2 () : boolean
+ {
+ if (!(this.I_p2 <= this.cursor))
+ {
+ return false;
+ }
+ return true;
+ }
+
+ function r_standard_suffix () : boolean
+ {
+ var among_var : int;
+ var v_1 : int;
+ var v_2 : int;
+ var v_3 : int;
+ var v_4 : int;
+ // (, line 76
+ // [, line 77
+ this.ket = this.cursor;
+ // substring, line 77
+ among_var = this.find_among_b(PortugueseStemmer.a_5, 45);
+ if (among_var == 0)
+ {
+ return false;
+ }
+ // ], line 77
+ this.bra = this.cursor;
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ // (, line 92
+ // call R2, line 93
+ if (!this.r_R2())
+ {
+ return false;
+ }
+ // delete, line 93
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ break;
+ case 2:
+ // (, line 97
+ // call R2, line 98
+ if (!this.r_R2())
+ {
+ return false;
+ }
+ // <-, line 98
+ if (!this.slice_from("log"))
+ {
+ return false;
+ }
+ break;
+ case 3:
+ // (, line 101
+ // call R2, line 102
+ if (!this.r_R2())
+ {
+ return false;
+ }
+ // <-, line 102
+ if (!this.slice_from("u"))
+ {
+ return false;
+ }
+ break;
+ case 4:
+ // (, line 105
+ // call R2, line 106
+ if (!this.r_R2())
+ {
+ return false;
+ }
+ // <-, line 106
+ if (!this.slice_from("ente"))
+ {
+ return false;
+ }
+ break;
+ case 5:
+ // (, line 109
+ // call R1, line 110
+ if (!this.r_R1())
+ {
+ return false;
+ }
+ // delete, line 110
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ // try, line 111
+ v_1 = this.limit - this.cursor;
+ var lab0 = true;
+ lab0: while (lab0 == true)
+ {
+ lab0 = false;
+ // (, line 111
+ // [, line 112
+ this.ket = this.cursor;
+ // substring, line 112
+ among_var = this.find_among_b(PortugueseStemmer.a_2, 4);
+ if (among_var == 0)
+ {
+ this.cursor = this.limit - v_1;
+ break lab0;
+ }
+ // ], line 112
+ this.bra = this.cursor;
+ // call R2, line 112
+ if (!this.r_R2())
+ {
+ this.cursor = this.limit - v_1;
+ break lab0;
+ }
+ // delete, line 112
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ switch (among_var) {
+ case 0:
+ this.cursor = this.limit - v_1;
+ break lab0;
+ case 1:
+ // (, line 113
+ // [, line 113
+ this.ket = this.cursor;
+ // literal, line 113
+ if (!(this.eq_s_b(2, "at")))
+ {
+ this.cursor = this.limit - v_1;
+ break lab0;
+ }
+ // ], line 113
+ this.bra = this.cursor;
+ // call R2, line 113
+ if (!this.r_R2())
+ {
+ this.cursor = this.limit - v_1;
+ break lab0;
+ }
+ // delete, line 113
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ break;
+ }
+ }
+ break;
+ case 6:
+ // (, line 121
+ // call R2, line 122
+ if (!this.r_R2())
+ {
+ return false;
+ }
+ // delete, line 122
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ // try, line 123
+ v_2 = this.limit - this.cursor;
+ var lab1 = true;
+ lab1: while (lab1 == true)
+ {
+ lab1 = false;
+ // (, line 123
+ // [, line 124
+ this.ket = this.cursor;
+ // substring, line 124
+ among_var = this.find_among_b(PortugueseStemmer.a_3, 3);
+ if (among_var == 0)
+ {
+ this.cursor = this.limit - v_2;
+ break lab1;
+ }
+ // ], line 124
+ this.bra = this.cursor;
+ switch (among_var) {
+ case 0:
+ this.cursor = this.limit - v_2;
+ break lab1;
+ case 1:
+ // (, line 127
+ // call R2, line 127
+ if (!this.r_R2())
+ {
+ this.cursor = this.limit - v_2;
+ break lab1;
+ }
+ // delete, line 127
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ break;
+ }
+ }
+ break;
+ case 7:
+ // (, line 133
+ // call R2, line 134
+ if (!this.r_R2())
+ {
+ return false;
+ }
+ // delete, line 134
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ // try, line 135
+ v_3 = this.limit - this.cursor;
+ var lab2 = true;
+ lab2: while (lab2 == true)
+ {
+ lab2 = false;
+ // (, line 135
+ // [, line 136
+ this.ket = this.cursor;
+ // substring, line 136
+ among_var = this.find_among_b(PortugueseStemmer.a_4, 3);
+ if (among_var == 0)
+ {
+ this.cursor = this.limit - v_3;
+ break lab2;
+ }
+ // ], line 136
+ this.bra = this.cursor;
+ switch (among_var) {
+ case 0:
+ this.cursor = this.limit - v_3;
+ break lab2;
+ case 1:
+ // (, line 139
+ // call R2, line 139
+ if (!this.r_R2())
+ {
+ this.cursor = this.limit - v_3;
+ break lab2;
+ }
+ // delete, line 139
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ break;
+ }
+ }
+ break;
+ case 8:
+ // (, line 145
+ // call R2, line 146
+ if (!this.r_R2())
+ {
+ return false;
+ }
+ // delete, line 146
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ // try, line 147
+ v_4 = this.limit - this.cursor;
+ var lab3 = true;
+ lab3: while (lab3 == true)
+ {
+ lab3 = false;
+ // (, line 147
+ // [, line 148
+ this.ket = this.cursor;
+ // literal, line 148
+ if (!(this.eq_s_b(2, "at")))
+ {
+ this.cursor = this.limit - v_4;
+ break lab3;
+ }
+ // ], line 148
+ this.bra = this.cursor;
+ // call R2, line 148
+ if (!this.r_R2())
+ {
+ this.cursor = this.limit - v_4;
+ break lab3;
+ }
+ // delete, line 148
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ }
+ break;
+ case 9:
+ // (, line 152
+ // call RV, line 153
+ if (!this.r_RV())
+ {
+ return false;
+ }
+ // literal, line 153
+ if (!(this.eq_s_b(1, "e")))
+ {
+ return false;
+ }
+ // <-, line 154
+ if (!this.slice_from("ir"))
+ {
+ return false;
+ }
+ break;
+ }
+ return true;
+ }
+
+ function r_verb_suffix () : boolean
+ {
+ var among_var : int;
+ var v_1 : int;
+ var v_2 : int;
+ // setlimit, line 159
+ v_1 = this.limit - this.cursor;
+ // tomark, line 159
+ if (this.cursor < this.I_pV)
+ {
+ return false;
+ }
+ this.cursor = this.I_pV;
+ v_2 = this.limit_backward;
+ this.limit_backward = this.cursor;
+ this.cursor = this.limit - v_1;
+ // (, line 159
+ // [, line 160
+ this.ket = this.cursor;
+ // substring, line 160
+ among_var = this.find_among_b(PortugueseStemmer.a_6, 120);
+ if (among_var == 0)
+ {
+ this.limit_backward = v_2;
+ return false;
+ }
+ // ], line 160
+ this.bra = this.cursor;
+ switch (among_var) {
+ case 0:
+ this.limit_backward = v_2;
+ return false;
+ case 1:
+ // (, line 179
+ // delete, line 179
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ break;
+ }
+ this.limit_backward = v_2;
+ return true;
+ }
+
+ function r_residual_suffix () : boolean
+ {
+ var among_var : int;
+ // (, line 183
+ // [, line 184
+ this.ket = this.cursor;
+ // substring, line 184
+ among_var = this.find_among_b(PortugueseStemmer.a_7, 7);
+ if (among_var == 0)
+ {
+ return false;
+ }
+ // ], line 184
+ this.bra = this.cursor;
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ // (, line 187
+ // call RV, line 187
+ if (!this.r_RV())
+ {
+ return false;
+ }
+ // delete, line 187
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ break;
+ }
+ return true;
+ }
+
+ function r_residual_form () : boolean
+ {
+ var among_var : int;
+ var v_1 : int;
+ var v_2 : int;
+ var v_3 : int;
+ // (, line 191
+ // [, line 192
+ this.ket = this.cursor;
+ // substring, line 192
+ among_var = this.find_among_b(PortugueseStemmer.a_8, 4);
+ if (among_var == 0)
+ {
+ return false;
+ }
+ // ], line 192
+ this.bra = this.cursor;
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ // (, line 194
+ // call RV, line 194
+ if (!this.r_RV())
+ {
+ return false;
+ }
+ // delete, line 194
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ // [, line 194
+ this.ket = this.cursor;
+ // or, line 194
+ var lab0 = true;
+ lab0: while (lab0 == true)
+ {
+ lab0 = false;
+ v_1 = this.limit - this.cursor;
+ var lab1 = true;
+ lab1: while (lab1 == true)
+ {
+ lab1 = false;
+ // (, line 194
+ // literal, line 194
+ if (!(this.eq_s_b(1, "u")))
+ {
+ break lab1;
+ }
+ // ], line 194
+ this.bra = this.cursor;
+ // test, line 194
+ v_2 = this.limit - this.cursor;
+ // literal, line 194
+ if (!(this.eq_s_b(1, "g")))
+ {
+ break lab1;
+ }
+ this.cursor = this.limit - v_2;
+ break lab0;
+ }
+ this.cursor = this.limit - v_1;
+ // (, line 195
+ // literal, line 195
+ if (!(this.eq_s_b(1, "i")))
+ {
+ return false;
+ }
+ // ], line 195
+ this.bra = this.cursor;
+ // test, line 195
+ v_3 = this.limit - this.cursor;
+ // literal, line 195
+ if (!(this.eq_s_b(1, "c")))
+ {
+ return false;
+ }
+ this.cursor = this.limit - v_3;
+ }
+ // call RV, line 195
+ if (!this.r_RV())
+ {
+ return false;
+ }
+ // delete, line 195
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ break;
+ case 2:
+ // (, line 196
+ // <-, line 196
+ if (!this.slice_from("c"))
+ {
+ return false;
+ }
+ break;
+ }
+ return true;
+ }
+
+ override function stem () : boolean
+ {
+ var v_1 : int;
+ var v_2 : int;
+ var v_3 : int;
+ var v_4 : int;
+ var v_5 : int;
+ var v_6 : int;
+ var v_7 : int;
+ var v_8 : int;
+ var v_9 : int;
+ var v_10 : int;
+ // (, line 201
+ // do, line 202
+ v_1 = this.cursor;
+ var lab0 = true;
+ lab0: while (lab0 == true)
+ {
+ lab0 = false;
+ // call prelude, line 202
+ if (!this.r_prelude())
+ {
+ break lab0;
+ }
+ }
+ this.cursor = v_1;
+ // do, line 203
+ v_2 = this.cursor;
+ var lab1 = true;
+ lab1: while (lab1 == true)
+ {
+ lab1 = false;
+ // call mark_regions, line 203
+ if (!this.r_mark_regions())
+ {
+ break lab1;
+ }
+ }
+ this.cursor = v_2;
+ // backwards, line 204
+ this.limit_backward = this.cursor; this.cursor = this.limit;
+ // (, line 204
+ // do, line 205
+ v_3 = this.limit - this.cursor;
+ var lab2 = true;
+ lab2: while (lab2 == true)
+ {
+ lab2 = false;
+ // (, line 205
+ // or, line 209
+ var lab3 = true;
+ lab3: while (lab3 == true)
+ {
+ lab3 = false;
+ v_4 = this.limit - this.cursor;
+ var lab4 = true;
+ lab4: while (lab4 == true)
+ {
+ lab4 = false;
+ // (, line 206
+ // and, line 207
+ v_5 = this.limit - this.cursor;
+ // (, line 206
+ // or, line 206
+ var lab5 = true;
+ lab5: while (lab5 == true)
+ {
+ lab5 = false;
+ v_6 = this.limit - this.cursor;
+ var lab6 = true;
+ lab6: while (lab6 == true)
+ {
+ lab6 = false;
+ // call standard_suffix, line 206
+ if (!this.r_standard_suffix())
+ {
+ break lab6;
+ }
+ break lab5;
+ }
+ this.cursor = this.limit - v_6;
+ // call verb_suffix, line 206
+ if (!this.r_verb_suffix())
+ {
+ break lab4;
+ }
+ }
+ this.cursor = this.limit - v_5;
+ // do, line 207
+ v_7 = this.limit - this.cursor;
+ var lab7 = true;
+ lab7: while (lab7 == true)
+ {
+ lab7 = false;
+ // (, line 207
+ // [, line 207
+ this.ket = this.cursor;
+ // literal, line 207
+ if (!(this.eq_s_b(1, "i")))
+ {
+ break lab7;
+ }
+ // ], line 207
+ this.bra = this.cursor;
+ // test, line 207
+ v_8 = this.limit - this.cursor;
+ // literal, line 207
+ if (!(this.eq_s_b(1, "c")))
+ {
+ break lab7;
+ }
+ this.cursor = this.limit - v_8;
+ // call RV, line 207
+ if (!this.r_RV())
+ {
+ break lab7;
+ }
+ // delete, line 207
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ }
+ this.cursor = this.limit - v_7;
+ break lab3;
+ }
+ this.cursor = this.limit - v_4;
+ // call residual_suffix, line 209
+ if (!this.r_residual_suffix())
+ {
+ break lab2;
+ }
+ }
+ }
+ this.cursor = this.limit - v_3;
+ // do, line 211
+ v_9 = this.limit - this.cursor;
+ var lab8 = true;
+ lab8: while (lab8 == true)
+ {
+ lab8 = false;
+ // call residual_form, line 211
+ if (!this.r_residual_form())
+ {
+ break lab8;
+ }
+ }
+ this.cursor = this.limit - v_9;
+ this.cursor = this.limit_backward; // do, line 213
+ v_10 = this.cursor;
+ var lab9 = true;
+ lab9: while (lab9 == true)
+ {
+ lab9 = false;
+ // call postlude, line 213
+ if (!this.r_postlude())
+ {
+ break lab9;
+ }
+ }
+ this.cursor = v_10;
+ return true;
+ }
+
+ function equals (o : variant) : boolean {
+ return o instanceof PortugueseStemmer;
+ }
+
+ function hashCode() : int
+ {
+ //http://stackoverflow.com/questions/194846/is-there-any-kind-of-hashcode-function-in-javascript
+ var classname = "PortugueseStemmer";
+ var hash = 0;
+ if (classname.length == 0) return hash;
+ for (var i = 0; i < classname.length; i++) {
+ var char = classname.charCodeAt(i);
+ hash = ((hash << 5) - hash) + char;
+ hash = hash & hash; // Convert to 32bit integer
+ }
+ return hash;
+ }
+
+}
+
diff --git a/web/server/h2o/libh2o/misc/oktavia/src/stemmer/romanian-stemmer.jsx b/web/server/h2o/libh2o/misc/oktavia/src/stemmer/romanian-stemmer.jsx
new file mode 100644
index 00000000..1eb9f3d8
--- /dev/null
+++ b/web/server/h2o/libh2o/misc/oktavia/src/stemmer/romanian-stemmer.jsx
@@ -0,0 +1,1227 @@
+// This file was generated automatically by the Snowball to JSX compiler
+
+import "base-stemmer.jsx";
+import "among.jsx";
+
+ /**
+ * This class was automatically generated by a Snowball to JSX compiler
+ * It implements the stemming algorithm defined by a snowball script.
+ */
+
+class RomanianStemmer extends BaseStemmer
+{
+ static const serialVersionUID = 1;
+ static const methodObject = new RomanianStemmer();
+
+ static const a_0 = [
+ new Among("", -1, 3),
+ new Among("I", 0, 1),
+ new Among("U", 0, 2)
+ ];
+
+ static const a_1 = [
+ new Among("ea", -1, 3),
+ new Among("a\u0163ia", -1, 7),
+ new Among("aua", -1, 2),
+ new Among("iua", -1, 4),
+ new Among("a\u0163ie", -1, 7),
+ new Among("ele", -1, 3),
+ new Among("ile", -1, 5),
+ new Among("iile", 6, 4),
+ new Among("iei", -1, 4),
+ new Among("atei", -1, 6),
+ new Among("ii", -1, 4),
+ new Among("ului", -1, 1),
+ new Among("ul", -1, 1),
+ new Among("elor", -1, 3),
+ new Among("ilor", -1, 4),
+ new Among("iilor", 14, 4)
+ ];
+
+ static const a_2 = [
+ new Among("icala", -1, 4),
+ new Among("iciva", -1, 4),
+ new Among("ativa", -1, 5),
+ new Among("itiva", -1, 6),
+ new Among("icale", -1, 4),
+ new Among("a\u0163iune", -1, 5),
+ new Among("i\u0163iune", -1, 6),
+ new Among("atoare", -1, 5),
+ new Among("itoare", -1, 6),
+ new Among("\u0103toare", -1, 5),
+ new Among("icitate", -1, 4),
+ new Among("abilitate", -1, 1),
+ new Among("ibilitate", -1, 2),
+ new Among("ivitate", -1, 3),
+ new Among("icive", -1, 4),
+ new Among("ative", -1, 5),
+ new Among("itive", -1, 6),
+ new Among("icali", -1, 4),
+ new Among("atori", -1, 5),
+ new Among("icatori", 18, 4),
+ new Among("itori", -1, 6),
+ new Among("\u0103tori", -1, 5),
+ new Among("icitati", -1, 4),
+ new Among("abilitati", -1, 1),
+ new Among("ivitati", -1, 3),
+ new Among("icivi", -1, 4),
+ new Among("ativi", -1, 5),
+ new Among("itivi", -1, 6),
+ new Among("icit\u0103i", -1, 4),
+ new Among("abilit\u0103i", -1, 1),
+ new Among("ivit\u0103i", -1, 3),
+ new Among("icit\u0103\u0163i", -1, 4),
+ new Among("abilit\u0103\u0163i", -1, 1),
+ new Among("ivit\u0103\u0163i", -1, 3),
+ new Among("ical", -1, 4),
+ new Among("ator", -1, 5),
+ new Among("icator", 35, 4),
+ new Among("itor", -1, 6),
+ new Among("\u0103tor", -1, 5),
+ new Among("iciv", -1, 4),
+ new Among("ativ", -1, 5),
+ new Among("itiv", -1, 6),
+ new Among("ical\u0103", -1, 4),
+ new Among("iciv\u0103", -1, 4),
+ new Among("ativ\u0103", -1, 5),
+ new Among("itiv\u0103", -1, 6)
+ ];
+
+ static const a_3 = [
+ new Among("ica", -1, 1),
+ new Among("abila", -1, 1),
+ new Among("ibila", -1, 1),
+ new Among("oasa", -1, 1),
+ new Among("ata", -1, 1),
+ new Among("ita", -1, 1),
+ new Among("anta", -1, 1),
+ new Among("ista", -1, 3),
+ new Among("uta", -1, 1),
+ new Among("iva", -1, 1),
+ new Among("ic", -1, 1),
+ new Among("ice", -1, 1),
+ new Among("abile", -1, 1),
+ new Among("ibile", -1, 1),
+ new Among("isme", -1, 3),
+ new Among("iune", -1, 2),
+ new Among("oase", -1, 1),
+ new Among("ate", -1, 1),
+ new Among("itate", 17, 1),
+ new Among("ite", -1, 1),
+ new Among("ante", -1, 1),
+ new Among("iste", -1, 3),
+ new Among("ute", -1, 1),
+ new Among("ive", -1, 1),
+ new Among("ici", -1, 1),
+ new Among("abili", -1, 1),
+ new Among("ibili", -1, 1),
+ new Among("iuni", -1, 2),
+ new Among("atori", -1, 1),
+ new Among("osi", -1, 1),
+ new Among("ati", -1, 1),
+ new Among("itati", 30, 1),
+ new Among("iti", -1, 1),
+ new Among("anti", -1, 1),
+ new Among("isti", -1, 3),
+ new Among("uti", -1, 1),
+ new Among("i\u015Fti", -1, 3),
+ new Among("ivi", -1, 1),
+ new Among("it\u0103i", -1, 1),
+ new Among("o\u015Fi", -1, 1),
+ new Among("it\u0103\u0163i", -1, 1),
+ new Among("abil", -1, 1),
+ new Among("ibil", -1, 1),
+ new Among("ism", -1, 3),
+ new Among("ator", -1, 1),
+ new Among("os", -1, 1),
+ new Among("at", -1, 1),
+ new Among("it", -1, 1),
+ new Among("ant", -1, 1),
+ new Among("ist", -1, 3),
+ new Among("ut", -1, 1),
+ new Among("iv", -1, 1),
+ new Among("ic\u0103", -1, 1),
+ new Among("abil\u0103", -1, 1),
+ new Among("ibil\u0103", -1, 1),
+ new Among("oas\u0103", -1, 1),
+ new Among("at\u0103", -1, 1),
+ new Among("it\u0103", -1, 1),
+ new Among("ant\u0103", -1, 1),
+ new Among("ist\u0103", -1, 3),
+ new Among("ut\u0103", -1, 1),
+ new Among("iv\u0103", -1, 1)
+ ];
+
+ static const a_4 = [
+ new Among("ea", -1, 1),
+ new Among("ia", -1, 1),
+ new Among("esc", -1, 1),
+ new Among("\u0103sc", -1, 1),
+ new Among("ind", -1, 1),
+ new Among("\u00E2nd", -1, 1),
+ new Among("are", -1, 1),
+ new Among("ere", -1, 1),
+ new Among("ire", -1, 1),
+ new Among("\u00E2re", -1, 1),
+ new Among("se", -1, 2),
+ new Among("ase", 10, 1),
+ new Among("sese", 10, 2),
+ new Among("ise", 10, 1),
+ new Among("use", 10, 1),
+ new Among("\u00E2se", 10, 1),
+ new Among("e\u015Fte", -1, 1),
+ new Among("\u0103\u015Fte", -1, 1),
+ new Among("eze", -1, 1),
+ new Among("ai", -1, 1),
+ new Among("eai", 19, 1),
+ new Among("iai", 19, 1),
+ new Among("sei", -1, 2),
+ new Among("e\u015Fti", -1, 1),
+ new Among("\u0103\u015Fti", -1, 1),
+ new Among("ui", -1, 1),
+ new Among("ezi", -1, 1),
+ new Among("\u00E2i", -1, 1),
+ new Among("a\u015Fi", -1, 1),
+ new Among("se\u015Fi", -1, 2),
+ new Among("ase\u015Fi", 29, 1),
+ new Among("sese\u015Fi", 29, 2),
+ new Among("ise\u015Fi", 29, 1),
+ new Among("use\u015Fi", 29, 1),
+ new Among("\u00E2se\u015Fi", 29, 1),
+ new Among("i\u015Fi", -1, 1),
+ new Among("u\u015Fi", -1, 1),
+ new Among("\u00E2\u015Fi", -1, 1),
+ new Among("a\u0163i", -1, 2),
+ new Among("ea\u0163i", 38, 1),
+ new Among("ia\u0163i", 38, 1),
+ new Among("e\u0163i", -1, 2),
+ new Among("i\u0163i", -1, 2),
+ new Among("\u00E2\u0163i", -1, 2),
+ new Among("ar\u0103\u0163i", -1, 1),
+ new Among("ser\u0103\u0163i", -1, 2),
+ new Among("aser\u0103\u0163i", 45, 1),
+ new Among("seser\u0103\u0163i", 45, 2),
+ new Among("iser\u0103\u0163i", 45, 1),
+ new Among("user\u0103\u0163i", 45, 1),
+ new Among("\u00E2ser\u0103\u0163i", 45, 1),
+ new Among("ir\u0103\u0163i", -1, 1),
+ new Among("ur\u0103\u0163i", -1, 1),
+ new Among("\u00E2r\u0103\u0163i", -1, 1),
+ new Among("am", -1, 1),
+ new Among("eam", 54, 1),
+ new Among("iam", 54, 1),
+ new Among("em", -1, 2),
+ new Among("asem", 57, 1),
+ new Among("sesem", 57, 2),
+ new Among("isem", 57, 1),
+ new Among("usem", 57, 1),
+ new Among("\u00E2sem", 57, 1),
+ new Among("im", -1, 2),
+ new Among("\u00E2m", -1, 2),
+ new Among("\u0103m", -1, 2),
+ new Among("ar\u0103m", 65, 1),
+ new Among("ser\u0103m", 65, 2),
+ new Among("aser\u0103m", 67, 1),
+ new Among("seser\u0103m", 67, 2),
+ new Among("iser\u0103m", 67, 1),
+ new Among("user\u0103m", 67, 1),
+ new Among("\u00E2ser\u0103m", 67, 1),
+ new Among("ir\u0103m", 65, 1),
+ new Among("ur\u0103m", 65, 1),
+ new Among("\u00E2r\u0103m", 65, 1),
+ new Among("au", -1, 1),
+ new Among("eau", 76, 1),
+ new Among("iau", 76, 1),
+ new Among("indu", -1, 1),
+ new Among("\u00E2ndu", -1, 1),
+ new Among("ez", -1, 1),
+ new Among("easc\u0103", -1, 1),
+ new Among("ar\u0103", -1, 1),
+ new Among("ser\u0103", -1, 2),
+ new Among("aser\u0103", 84, 1),
+ new Among("seser\u0103", 84, 2),
+ new Among("iser\u0103", 84, 1),
+ new Among("user\u0103", 84, 1),
+ new Among("\u00E2ser\u0103", 84, 1),
+ new Among("ir\u0103", -1, 1),
+ new Among("ur\u0103", -1, 1),
+ new Among("\u00E2r\u0103", -1, 1),
+ new Among("eaz\u0103", -1, 1)
+ ];
+
+ static const a_5 = [
+ new Among("a", -1, 1),
+ new Among("e", -1, 1),
+ new Among("ie", 1, 1),
+ new Among("i", -1, 1),
+ new Among("\u0103", -1, 1)
+ ];
+
+ static const g_v = [17, 65, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 32, 0, 0, 4] : int[];
+
+ var B_standard_suffix_removed : boolean = false;
+ var I_p2 : int = 0;
+ var I_p1 : int = 0;
+ var I_pV : int = 0;
+
+ function copy_from (other : RomanianStemmer) : void
+ {
+ this.B_standard_suffix_removed = other.B_standard_suffix_removed;
+ this.I_p2 = other.I_p2;
+ this.I_p1 = other.I_p1;
+ this.I_pV = other.I_pV;
+ super.copy_from(other);
+ }
+
+ function r_prelude () : boolean
+ {
+ var v_1 : int;
+ var v_2 : int;
+ var v_3 : int;
+ // (, line 31
+ // repeat, line 32
+ replab0: while(true)
+ {
+ v_1 = this.cursor;
+ var lab1 = true;
+ lab1: while (lab1 == true)
+ {
+ lab1 = false;
+ // goto, line 32
+ golab2: while(true)
+ {
+ v_2 = this.cursor;
+ var lab3 = true;
+ lab3: while (lab3 == true)
+ {
+ lab3 = false;
+ // (, line 32
+ if (!(this.in_grouping(RomanianStemmer.g_v, 97, 259)))
+ {
+ break lab3;
+ }
+ // [, line 33
+ this.bra = this.cursor;
+ // or, line 33
+ var lab4 = true;
+ lab4: while (lab4 == true)
+ {
+ lab4 = false;
+ v_3 = this.cursor;
+ var lab5 = true;
+ lab5: while (lab5 == true)
+ {
+ lab5 = false;
+ // (, line 33
+ // literal, line 33
+ if (!(this.eq_s(1, "u")))
+ {
+ break lab5;
+ }
+ // ], line 33
+ this.ket = this.cursor;
+ if (!(this.in_grouping(RomanianStemmer.g_v, 97, 259)))
+ {
+ break lab5;
+ }
+ // <-, line 33
+ if (!this.slice_from("U"))
+ {
+ return false;
+ }
+ break lab4;
+ }
+ this.cursor = v_3;
+ // (, line 34
+ // literal, line 34
+ if (!(this.eq_s(1, "i")))
+ {
+ break lab3;
+ }
+ // ], line 34
+ this.ket = this.cursor;
+ if (!(this.in_grouping(RomanianStemmer.g_v, 97, 259)))
+ {
+ break lab3;
+ }
+ // <-, line 34
+ if (!this.slice_from("I"))
+ {
+ return false;
+ }
+ }
+ this.cursor = v_2;
+ break golab2;
+ }
+ this.cursor = v_2;
+ if (this.cursor >= this.limit)
+ {
+ break lab1;
+ }
+ this.cursor++;
+ }
+ continue replab0;
+ }
+ this.cursor = v_1;
+ break replab0;
+ }
+ return true;
+ }
+
+ function r_mark_regions () : boolean
+ {
+ var v_1 : int;
+ var v_2 : int;
+ var v_3 : int;
+ var v_6 : int;
+ var v_8 : int;
+ // (, line 38
+ this.I_pV = this.limit;
+ this.I_p1 = this.limit;
+ this.I_p2 = this.limit;
+ // do, line 44
+ v_1 = this.cursor;
+ var lab0 = true;
+ lab0: while (lab0 == true)
+ {
+ lab0 = false;
+ // (, line 44
+ // or, line 46
+ var lab1 = true;
+ lab1: while (lab1 == true)
+ {
+ lab1 = false;
+ v_2 = this.cursor;
+ var lab2 = true;
+ lab2: while (lab2 == true)
+ {
+ lab2 = false;
+ // (, line 45
+ if (!(this.in_grouping(RomanianStemmer.g_v, 97, 259)))
+ {
+ break lab2;
+ }
+ // or, line 45
+ var lab3 = true;
+ lab3: while (lab3 == true)
+ {
+ lab3 = false;
+ v_3 = this.cursor;
+ var lab4 = true;
+ lab4: while (lab4 == true)
+ {
+ lab4 = false;
+ // (, line 45
+ if (!(this.out_grouping(RomanianStemmer.g_v, 97, 259)))
+ {
+ break lab4;
+ }
+ // gopast, line 45
+ golab5: while(true)
+ {
+ var lab6 = true;
+ lab6: while (lab6 == true)
+ {
+ lab6 = false;
+ if (!(this.in_grouping(RomanianStemmer.g_v, 97, 259)))
+ {
+ break lab6;
+ }
+ break golab5;
+ }
+ if (this.cursor >= this.limit)
+ {
+ break lab4;
+ }
+ this.cursor++;
+ }
+ break lab3;
+ }
+ this.cursor = v_3;
+ // (, line 45
+ if (!(this.in_grouping(RomanianStemmer.g_v, 97, 259)))
+ {
+ break lab2;
+ }
+ // gopast, line 45
+ golab7: while(true)
+ {
+ var lab8 = true;
+ lab8: while (lab8 == true)
+ {
+ lab8 = false;
+ if (!(this.out_grouping(RomanianStemmer.g_v, 97, 259)))
+ {
+ break lab8;
+ }
+ break golab7;
+ }
+ if (this.cursor >= this.limit)
+ {
+ break lab2;
+ }
+ this.cursor++;
+ }
+ }
+ break lab1;
+ }
+ this.cursor = v_2;
+ // (, line 47
+ if (!(this.out_grouping(RomanianStemmer.g_v, 97, 259)))
+ {
+ break lab0;
+ }
+ // or, line 47
+ var lab9 = true;
+ lab9: while (lab9 == true)
+ {
+ lab9 = false;
+ v_6 = this.cursor;
+ var lab10 = true;
+ lab10: while (lab10 == true)
+ {
+ lab10 = false;
+ // (, line 47
+ if (!(this.out_grouping(RomanianStemmer.g_v, 97, 259)))
+ {
+ break lab10;
+ }
+ // gopast, line 47
+ golab11: while(true)
+ {
+ var lab12 = true;
+ lab12: while (lab12 == true)
+ {
+ lab12 = false;
+ if (!(this.in_grouping(RomanianStemmer.g_v, 97, 259)))
+ {
+ break lab12;
+ }
+ break golab11;
+ }
+ if (this.cursor >= this.limit)
+ {
+ break lab10;
+ }
+ this.cursor++;
+ }
+ break lab9;
+ }
+ this.cursor = v_6;
+ // (, line 47
+ if (!(this.in_grouping(RomanianStemmer.g_v, 97, 259)))
+ {
+ break lab0;
+ }
+ // next, line 47
+ if (this.cursor >= this.limit)
+ {
+ break lab0;
+ }
+ this.cursor++;
+ }
+ }
+ // setmark pV, line 48
+ this.I_pV = this.cursor;
+ }
+ this.cursor = v_1;
+ // do, line 50
+ v_8 = this.cursor;
+ var lab13 = true;
+ lab13: while (lab13 == true)
+ {
+ lab13 = false;
+ // (, line 50
+ // gopast, line 51
+ golab14: while(true)
+ {
+ var lab15 = true;
+ lab15: while (lab15 == true)
+ {
+ lab15 = false;
+ if (!(this.in_grouping(RomanianStemmer.g_v, 97, 259)))
+ {
+ break lab15;
+ }
+ break golab14;
+ }
+ if (this.cursor >= this.limit)
+ {
+ break lab13;
+ }
+ this.cursor++;
+ }
+ // gopast, line 51
+ golab16: while(true)
+ {
+ var lab17 = true;
+ lab17: while (lab17 == true)
+ {
+ lab17 = false;
+ if (!(this.out_grouping(RomanianStemmer.g_v, 97, 259)))
+ {
+ break lab17;
+ }
+ break golab16;
+ }
+ if (this.cursor >= this.limit)
+ {
+ break lab13;
+ }
+ this.cursor++;
+ }
+ // setmark p1, line 51
+ this.I_p1 = this.cursor;
+ // gopast, line 52
+ golab18: while(true)
+ {
+ var lab19 = true;
+ lab19: while (lab19 == true)
+ {
+ lab19 = false;
+ if (!(this.in_grouping(RomanianStemmer.g_v, 97, 259)))
+ {
+ break lab19;
+ }
+ break golab18;
+ }
+ if (this.cursor >= this.limit)
+ {
+ break lab13;
+ }
+ this.cursor++;
+ }
+ // gopast, line 52
+ golab20: while(true)
+ {
+ var lab21 = true;
+ lab21: while (lab21 == true)
+ {
+ lab21 = false;
+ if (!(this.out_grouping(RomanianStemmer.g_v, 97, 259)))
+ {
+ break lab21;
+ }
+ break golab20;
+ }
+ if (this.cursor >= this.limit)
+ {
+ break lab13;
+ }
+ this.cursor++;
+ }
+ // setmark p2, line 52
+ this.I_p2 = this.cursor;
+ }
+ this.cursor = v_8;
+ return true;
+ }
+
+ function r_postlude () : boolean
+ {
+ var among_var : int;
+ var v_1 : int;
+ // repeat, line 56
+ replab0: while(true)
+ {
+ v_1 = this.cursor;
+ var lab1 = true;
+ lab1: while (lab1 == true)
+ {
+ lab1 = false;
+ // (, line 56
+ // [, line 58
+ this.bra = this.cursor;
+ // substring, line 58
+ among_var = this.find_among(RomanianStemmer.a_0, 3);
+ if (among_var == 0)
+ {
+ break lab1;
+ }
+ // ], line 58
+ this.ket = this.cursor;
+ switch (among_var) {
+ case 0:
+ break lab1;
+ case 1:
+ // (, line 59
+ // <-, line 59
+ if (!this.slice_from("i"))
+ {
+ return false;
+ }
+ break;
+ case 2:
+ // (, line 60
+ // <-, line 60
+ if (!this.slice_from("u"))
+ {
+ return false;
+ }
+ break;
+ case 3:
+ // (, line 61
+ // next, line 61
+ if (this.cursor >= this.limit)
+ {
+ break lab1;
+ }
+ this.cursor++;
+ break;
+ }
+ continue replab0;
+ }
+ this.cursor = v_1;
+ break replab0;
+ }
+ return true;
+ }
+
+ function r_RV () : boolean
+ {
+ if (!(this.I_pV <= this.cursor))
+ {
+ return false;
+ }
+ return true;
+ }
+
+ function r_R1 () : boolean
+ {
+ if (!(this.I_p1 <= this.cursor))
+ {
+ return false;
+ }
+ return true;
+ }
+
+ function r_R2 () : boolean
+ {
+ if (!(this.I_p2 <= this.cursor))
+ {
+ return false;
+ }
+ return true;
+ }
+
+ function r_step_0 () : boolean
+ {
+ var among_var : int;
+ var v_1 : int;
+ // (, line 72
+ // [, line 73
+ this.ket = this.cursor;
+ // substring, line 73
+ among_var = this.find_among_b(RomanianStemmer.a_1, 16);
+ if (among_var == 0)
+ {
+ return false;
+ }
+ // ], line 73
+ this.bra = this.cursor;
+ // call R1, line 73
+ if (!this.r_R1())
+ {
+ return false;
+ }
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ // (, line 75
+ // delete, line 75
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ break;
+ case 2:
+ // (, line 77
+ // <-, line 77
+ if (!this.slice_from("a"))
+ {
+ return false;
+ }
+ break;
+ case 3:
+ // (, line 79
+ // <-, line 79
+ if (!this.slice_from("e"))
+ {
+ return false;
+ }
+ break;
+ case 4:
+ // (, line 81
+ // <-, line 81
+ if (!this.slice_from("i"))
+ {
+ return false;
+ }
+ break;
+ case 5:
+ // (, line 83
+ // not, line 83
+ {
+ v_1 = this.limit - this.cursor;
+ var lab0 = true;
+ lab0: while (lab0 == true)
+ {
+ lab0 = false;
+ // literal, line 83
+ if (!(this.eq_s_b(2, "ab")))
+ {
+ break lab0;
+ }
+ return false;
+ }
+ this.cursor = this.limit - v_1;
+ }
+ // <-, line 83
+ if (!this.slice_from("i"))
+ {
+ return false;
+ }
+ break;
+ case 6:
+ // (, line 85
+ // <-, line 85
+ if (!this.slice_from("at"))
+ {
+ return false;
+ }
+ break;
+ case 7:
+ // (, line 87
+ // <-, line 87
+ if (!this.slice_from("a\u0163i"))
+ {
+ return false;
+ }
+ break;
+ }
+ return true;
+ }
+
+ function r_combo_suffix () : boolean
+ {
+ var among_var : int;
+ var v_1 : int;
+ // test, line 91
+ v_1 = this.limit - this.cursor;
+ // (, line 91
+ // [, line 92
+ this.ket = this.cursor;
+ // substring, line 92
+ among_var = this.find_among_b(RomanianStemmer.a_2, 46);
+ if (among_var == 0)
+ {
+ return false;
+ }
+ // ], line 92
+ this.bra = this.cursor;
+ // call R1, line 92
+ if (!this.r_R1())
+ {
+ return false;
+ }
+ // (, line 92
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ // (, line 100
+ // <-, line 101
+ if (!this.slice_from("abil"))
+ {
+ return false;
+ }
+ break;
+ case 2:
+ // (, line 103
+ // <-, line 104
+ if (!this.slice_from("ibil"))
+ {
+ return false;
+ }
+ break;
+ case 3:
+ // (, line 106
+ // <-, line 107
+ if (!this.slice_from("iv"))
+ {
+ return false;
+ }
+ break;
+ case 4:
+ // (, line 112
+ // <-, line 113
+ if (!this.slice_from("ic"))
+ {
+ return false;
+ }
+ break;
+ case 5:
+ // (, line 117
+ // <-, line 118
+ if (!this.slice_from("at"))
+ {
+ return false;
+ }
+ break;
+ case 6:
+ // (, line 121
+ // <-, line 122
+ if (!this.slice_from("it"))
+ {
+ return false;
+ }
+ break;
+ }
+ // set standard_suffix_removed, line 125
+ this.B_standard_suffix_removed = true;
+ this.cursor = this.limit - v_1;
+ return true;
+ }
+
+ function r_standard_suffix () : boolean
+ {
+ var among_var : int;
+ var v_1 : int;
+ // (, line 129
+ // unset standard_suffix_removed, line 130
+ this.B_standard_suffix_removed = false;
+ // repeat, line 131
+ replab0: while(true)
+ {
+ v_1 = this.limit - this.cursor;
+ var lab1 = true;
+ lab1: while (lab1 == true)
+ {
+ lab1 = false;
+ // call combo_suffix, line 131
+ if (!this.r_combo_suffix())
+ {
+ break lab1;
+ }
+ continue replab0;
+ }
+ this.cursor = this.limit - v_1;
+ break replab0;
+ }
+ // [, line 132
+ this.ket = this.cursor;
+ // substring, line 132
+ among_var = this.find_among_b(RomanianStemmer.a_3, 62);
+ if (among_var == 0)
+ {
+ return false;
+ }
+ // ], line 132
+ this.bra = this.cursor;
+ // call R2, line 132
+ if (!this.r_R2())
+ {
+ return false;
+ }
+ // (, line 132
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ // (, line 148
+ // delete, line 149
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ break;
+ case 2:
+ // (, line 151
+ // literal, line 152
+ if (!(this.eq_s_b(1, "\u0163")))
+ {
+ return false;
+ }
+ // ], line 152
+ this.bra = this.cursor;
+ // <-, line 152
+ if (!this.slice_from("t"))
+ {
+ return false;
+ }
+ break;
+ case 3:
+ // (, line 155
+ // <-, line 156
+ if (!this.slice_from("ist"))
+ {
+ return false;
+ }
+ break;
+ }
+ // set standard_suffix_removed, line 160
+ this.B_standard_suffix_removed = true;
+ return true;
+ }
+
+ function r_verb_suffix () : boolean
+ {
+ var among_var : int;
+ var v_1 : int;
+ var v_2 : int;
+ var v_3 : int;
+ // setlimit, line 164
+ v_1 = this.limit - this.cursor;
+ // tomark, line 164
+ if (this.cursor < this.I_pV)
+ {
+ return false;
+ }
+ this.cursor = this.I_pV;
+ v_2 = this.limit_backward;
+ this.limit_backward = this.cursor;
+ this.cursor = this.limit - v_1;
+ // (, line 164
+ // [, line 165
+ this.ket = this.cursor;
+ // substring, line 165
+ among_var = this.find_among_b(RomanianStemmer.a_4, 94);
+ if (among_var == 0)
+ {
+ this.limit_backward = v_2;
+ return false;
+ }
+ // ], line 165
+ this.bra = this.cursor;
+ switch (among_var) {
+ case 0:
+ this.limit_backward = v_2;
+ return false;
+ case 1:
+ // (, line 200
+ // or, line 200
+ var lab0 = true;
+ lab0: while (lab0 == true)
+ {
+ lab0 = false;
+ v_3 = this.limit - this.cursor;
+ var lab1 = true;
+ lab1: while (lab1 == true)
+ {
+ lab1 = false;
+ if (!(this.out_grouping_b(RomanianStemmer.g_v, 97, 259)))
+ {
+ break lab1;
+ }
+ break lab0;
+ }
+ this.cursor = this.limit - v_3;
+ // literal, line 200
+ if (!(this.eq_s_b(1, "u")))
+ {
+ this.limit_backward = v_2;
+ return false;
+ }
+ }
+ // delete, line 200
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ break;
+ case 2:
+ // (, line 214
+ // delete, line 214
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ break;
+ }
+ this.limit_backward = v_2;
+ return true;
+ }
+
+ function r_vowel_suffix () : boolean
+ {
+ var among_var : int;
+ // (, line 218
+ // [, line 219
+ this.ket = this.cursor;
+ // substring, line 219
+ among_var = this.find_among_b(RomanianStemmer.a_5, 5);
+ if (among_var == 0)
+ {
+ return false;
+ }
+ // ], line 219
+ this.bra = this.cursor;
+ // call RV, line 219
+ if (!this.r_RV())
+ {
+ return false;
+ }
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ // (, line 220
+ // delete, line 220
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ break;
+ }
+ return true;
+ }
+
+ override function stem () : boolean
+ {
+ var v_1 : int;
+ var v_2 : int;
+ var v_3 : int;
+ var v_4 : int;
+ var v_5 : int;
+ var v_6 : int;
+ var v_7 : int;
+ var v_8 : int;
+ // (, line 225
+ // do, line 226
+ v_1 = this.cursor;
+ var lab0 = true;
+ lab0: while (lab0 == true)
+ {
+ lab0 = false;
+ // call prelude, line 226
+ if (!this.r_prelude())
+ {
+ break lab0;
+ }
+ }
+ this.cursor = v_1;
+ // do, line 227
+ v_2 = this.cursor;
+ var lab1 = true;
+ lab1: while (lab1 == true)
+ {
+ lab1 = false;
+ // call mark_regions, line 227
+ if (!this.r_mark_regions())
+ {
+ break lab1;
+ }
+ }
+ this.cursor = v_2;
+ // backwards, line 228
+ this.limit_backward = this.cursor; this.cursor = this.limit;
+ // (, line 228
+ // do, line 229
+ v_3 = this.limit - this.cursor;
+ var lab2 = true;
+ lab2: while (lab2 == true)
+ {
+ lab2 = false;
+ // call step_0, line 229
+ if (!this.r_step_0())
+ {
+ break lab2;
+ }
+ }
+ this.cursor = this.limit - v_3;
+ // do, line 230
+ v_4 = this.limit - this.cursor;
+ var lab3 = true;
+ lab3: while (lab3 == true)
+ {
+ lab3 = false;
+ // call standard_suffix, line 230
+ if (!this.r_standard_suffix())
+ {
+ break lab3;
+ }
+ }
+ this.cursor = this.limit - v_4;
+ // do, line 231
+ v_5 = this.limit - this.cursor;
+ var lab4 = true;
+ lab4: while (lab4 == true)
+ {
+ lab4 = false;
+ // (, line 231
+ // or, line 231
+ var lab5 = true;
+ lab5: while (lab5 == true)
+ {
+ lab5 = false;
+ v_6 = this.limit - this.cursor;
+ var lab6 = true;
+ lab6: while (lab6 == true)
+ {
+ lab6 = false;
+ // Boolean test standard_suffix_removed, line 231
+ if (!(this.B_standard_suffix_removed))
+ {
+ break lab6;
+ }
+ break lab5;
+ }
+ this.cursor = this.limit - v_6;
+ // call verb_suffix, line 231
+ if (!this.r_verb_suffix())
+ {
+ break lab4;
+ }
+ }
+ }
+ this.cursor = this.limit - v_5;
+ // do, line 232
+ v_7 = this.limit - this.cursor;
+ var lab7 = true;
+ lab7: while (lab7 == true)
+ {
+ lab7 = false;
+ // call vowel_suffix, line 232
+ if (!this.r_vowel_suffix())
+ {
+ break lab7;
+ }
+ }
+ this.cursor = this.limit - v_7;
+ this.cursor = this.limit_backward; // do, line 234
+ v_8 = this.cursor;
+ var lab8 = true;
+ lab8: while (lab8 == true)
+ {
+ lab8 = false;
+ // call postlude, line 234
+ if (!this.r_postlude())
+ {
+ break lab8;
+ }
+ }
+ this.cursor = v_8;
+ return true;
+ }
+
+ function equals (o : variant) : boolean {
+ return o instanceof RomanianStemmer;
+ }
+
+ function hashCode() : int
+ {
+ //http://stackoverflow.com/questions/194846/is-there-any-kind-of-hashcode-function-in-javascript
+ var classname = "RomanianStemmer";
+ var hash = 0;
+ if (classname.length == 0) return hash;
+ for (var i = 0; i < classname.length; i++) {
+ var char = classname.charCodeAt(i);
+ hash = ((hash << 5) - hash) + char;
+ hash = hash & hash; // Convert to 32bit integer
+ }
+ return hash;
+ }
+
+}
+
diff --git a/web/server/h2o/libh2o/misc/oktavia/src/stemmer/russian-stemmer.jsx b/web/server/h2o/libh2o/misc/oktavia/src/stemmer/russian-stemmer.jsx
new file mode 100644
index 00000000..2b7d30a9
--- /dev/null
+++ b/web/server/h2o/libh2o/misc/oktavia/src/stemmer/russian-stemmer.jsx
@@ -0,0 +1,875 @@
+// This file was generated automatically by the Snowball to JSX compiler
+
+import "base-stemmer.jsx";
+import "among.jsx";
+
+ /**
+ * This class was automatically generated by a Snowball to JSX compiler
+ * It implements the stemming algorithm defined by a snowball script.
+ */
+
+class RussianStemmer extends BaseStemmer
+{
+ static const serialVersionUID = 1;
+ static const methodObject = new RussianStemmer();
+
+ static const a_0 = [
+ new Among("\u0432", -1, 1),
+ new Among("\u0438\u0432", 0, 2),
+ new Among("\u044B\u0432", 0, 2),
+ new Among("\u0432\u0448\u0438", -1, 1),
+ new Among("\u0438\u0432\u0448\u0438", 3, 2),
+ new Among("\u044B\u0432\u0448\u0438", 3, 2),
+ new Among("\u0432\u0448\u0438\u0441\u044C", -1, 1),
+ new Among("\u0438\u0432\u0448\u0438\u0441\u044C", 6, 2),
+ new Among("\u044B\u0432\u0448\u0438\u0441\u044C", 6, 2)
+ ];
+
+ static const a_1 = [
+ new Among("\u0435\u0435", -1, 1),
+ new Among("\u0438\u0435", -1, 1),
+ new Among("\u043E\u0435", -1, 1),
+ new Among("\u044B\u0435", -1, 1),
+ new Among("\u0438\u043C\u0438", -1, 1),
+ new Among("\u044B\u043C\u0438", -1, 1),
+ new Among("\u0435\u0439", -1, 1),
+ new Among("\u0438\u0439", -1, 1),
+ new Among("\u043E\u0439", -1, 1),
+ new Among("\u044B\u0439", -1, 1),
+ new Among("\u0435\u043C", -1, 1),
+ new Among("\u0438\u043C", -1, 1),
+ new Among("\u043E\u043C", -1, 1),
+ new Among("\u044B\u043C", -1, 1),
+ new Among("\u0435\u0433\u043E", -1, 1),
+ new Among("\u043E\u0433\u043E", -1, 1),
+ new Among("\u0435\u043C\u0443", -1, 1),
+ new Among("\u043E\u043C\u0443", -1, 1),
+ new Among("\u0438\u0445", -1, 1),
+ new Among("\u044B\u0445", -1, 1),
+ new Among("\u0435\u044E", -1, 1),
+ new Among("\u043E\u044E", -1, 1),
+ new Among("\u0443\u044E", -1, 1),
+ new Among("\u044E\u044E", -1, 1),
+ new Among("\u0430\u044F", -1, 1),
+ new Among("\u044F\u044F", -1, 1)
+ ];
+
+ static const a_2 = [
+ new Among("\u0435\u043C", -1, 1),
+ new Among("\u043D\u043D", -1, 1),
+ new Among("\u0432\u0448", -1, 1),
+ new Among("\u0438\u0432\u0448", 2, 2),
+ new Among("\u044B\u0432\u0448", 2, 2),
+ new Among("\u0449", -1, 1),
+ new Among("\u044E\u0449", 5, 1),
+ new Among("\u0443\u044E\u0449", 6, 2)
+ ];
+
+ static const a_3 = [
+ new Among("\u0441\u044C", -1, 1),
+ new Among("\u0441\u044F", -1, 1)
+ ];
+
+ static const a_4 = [
+ new Among("\u043B\u0430", -1, 1),
+ new Among("\u0438\u043B\u0430", 0, 2),
+ new Among("\u044B\u043B\u0430", 0, 2),
+ new Among("\u043D\u0430", -1, 1),
+ new Among("\u0435\u043D\u0430", 3, 2),
+ new Among("\u0435\u0442\u0435", -1, 1),
+ new Among("\u0438\u0442\u0435", -1, 2),
+ new Among("\u0439\u0442\u0435", -1, 1),
+ new Among("\u0435\u0439\u0442\u0435", 7, 2),
+ new Among("\u0443\u0439\u0442\u0435", 7, 2),
+ new Among("\u043B\u0438", -1, 1),
+ new Among("\u0438\u043B\u0438", 10, 2),
+ new Among("\u044B\u043B\u0438", 10, 2),
+ new Among("\u0439", -1, 1),
+ new Among("\u0435\u0439", 13, 2),
+ new Among("\u0443\u0439", 13, 2),
+ new Among("\u043B", -1, 1),
+ new Among("\u0438\u043B", 16, 2),
+ new Among("\u044B\u043B", 16, 2),
+ new Among("\u0435\u043C", -1, 1),
+ new Among("\u0438\u043C", -1, 2),
+ new Among("\u044B\u043C", -1, 2),
+ new Among("\u043D", -1, 1),
+ new Among("\u0435\u043D", 22, 2),
+ new Among("\u043B\u043E", -1, 1),
+ new Among("\u0438\u043B\u043E", 24, 2),
+ new Among("\u044B\u043B\u043E", 24, 2),
+ new Among("\u043D\u043E", -1, 1),
+ new Among("\u0435\u043D\u043E", 27, 2),
+ new Among("\u043D\u043D\u043E", 27, 1),
+ new Among("\u0435\u0442", -1, 1),
+ new Among("\u0443\u0435\u0442", 30, 2),
+ new Among("\u0438\u0442", -1, 2),
+ new Among("\u044B\u0442", -1, 2),
+ new Among("\u044E\u0442", -1, 1),
+ new Among("\u0443\u044E\u0442", 34, 2),
+ new Among("\u044F\u0442", -1, 2),
+ new Among("\u043D\u044B", -1, 1),
+ new Among("\u0435\u043D\u044B", 37, 2),
+ new Among("\u0442\u044C", -1, 1),
+ new Among("\u0438\u0442\u044C", 39, 2),
+ new Among("\u044B\u0442\u044C", 39, 2),
+ new Among("\u0435\u0448\u044C", -1, 1),
+ new Among("\u0438\u0448\u044C", -1, 2),
+ new Among("\u044E", -1, 2),
+ new Among("\u0443\u044E", 44, 2)
+ ];
+
+ static const a_5 = [
+ new Among("\u0430", -1, 1),
+ new Among("\u0435\u0432", -1, 1),
+ new Among("\u043E\u0432", -1, 1),
+ new Among("\u0435", -1, 1),
+ new Among("\u0438\u0435", 3, 1),
+ new Among("\u044C\u0435", 3, 1),
+ new Among("\u0438", -1, 1),
+ new Among("\u0435\u0438", 6, 1),
+ new Among("\u0438\u0438", 6, 1),
+ new Among("\u0430\u043C\u0438", 6, 1),
+ new Among("\u044F\u043C\u0438", 6, 1),
+ new Among("\u0438\u044F\u043C\u0438", 10, 1),
+ new Among("\u0439", -1, 1),
+ new Among("\u0435\u0439", 12, 1),
+ new Among("\u0438\u0435\u0439", 13, 1),
+ new Among("\u0438\u0439", 12, 1),
+ new Among("\u043E\u0439", 12, 1),
+ new Among("\u0430\u043C", -1, 1),
+ new Among("\u0435\u043C", -1, 1),
+ new Among("\u0438\u0435\u043C", 18, 1),
+ new Among("\u043E\u043C", -1, 1),
+ new Among("\u044F\u043C", -1, 1),
+ new Among("\u0438\u044F\u043C", 21, 1),
+ new Among("\u043E", -1, 1),
+ new Among("\u0443", -1, 1),
+ new Among("\u0430\u0445", -1, 1),
+ new Among("\u044F\u0445", -1, 1),
+ new Among("\u0438\u044F\u0445", 26, 1),
+ new Among("\u044B", -1, 1),
+ new Among("\u044C", -1, 1),
+ new Among("\u044E", -1, 1),
+ new Among("\u0438\u044E", 30, 1),
+ new Among("\u044C\u044E", 30, 1),
+ new Among("\u044F", -1, 1),
+ new Among("\u0438\u044F", 33, 1),
+ new Among("\u044C\u044F", 33, 1)
+ ];
+
+ static const a_6 = [
+ new Among("\u043E\u0441\u0442", -1, 1),
+ new Among("\u043E\u0441\u0442\u044C", -1, 1)
+ ];
+
+ static const a_7 = [
+ new Among("\u0435\u0439\u0448\u0435", -1, 1),
+ new Among("\u043D", -1, 2),
+ new Among("\u0435\u0439\u0448", -1, 1),
+ new Among("\u044C", -1, 3)
+ ];
+
+ static const g_v = [33, 65, 8, 232] : int[];
+
+ var I_p2 : int = 0;
+ var I_pV : int = 0;
+
+ function copy_from (other : RussianStemmer) : void
+ {
+ this.I_p2 = other.I_p2;
+ this.I_pV = other.I_pV;
+ super.copy_from(other);
+ }
+
+ function r_mark_regions () : boolean
+ {
+ var v_1 : int;
+ // (, line 57
+ this.I_pV = this.limit;
+ this.I_p2 = this.limit;
+ // do, line 61
+ v_1 = this.cursor;
+ var lab0 = true;
+ lab0: while (lab0 == true)
+ {
+ lab0 = false;
+ // (, line 61
+ // gopast, line 62
+ golab1: while(true)
+ {
+ var lab2 = true;
+ lab2: while (lab2 == true)
+ {
+ lab2 = false;
+ if (!(this.in_grouping(RussianStemmer.g_v, 1072, 1103)))
+ {
+ break lab2;
+ }
+ break golab1;
+ }
+ if (this.cursor >= this.limit)
+ {
+ break lab0;
+ }
+ this.cursor++;
+ }
+ // setmark pV, line 62
+ this.I_pV = this.cursor;
+ // gopast, line 62
+ golab3: while(true)
+ {
+ var lab4 = true;
+ lab4: while (lab4 == true)
+ {
+ lab4 = false;
+ if (!(this.out_grouping(RussianStemmer.g_v, 1072, 1103)))
+ {
+ break lab4;
+ }
+ break golab3;
+ }
+ if (this.cursor >= this.limit)
+ {
+ break lab0;
+ }
+ this.cursor++;
+ }
+ // gopast, line 63
+ golab5: while(true)
+ {
+ var lab6 = true;
+ lab6: while (lab6 == true)
+ {
+ lab6 = false;
+ if (!(this.in_grouping(RussianStemmer.g_v, 1072, 1103)))
+ {
+ break lab6;
+ }
+ break golab5;
+ }
+ if (this.cursor >= this.limit)
+ {
+ break lab0;
+ }
+ this.cursor++;
+ }
+ // gopast, line 63
+ golab7: while(true)
+ {
+ var lab8 = true;
+ lab8: while (lab8 == true)
+ {
+ lab8 = false;
+ if (!(this.out_grouping(RussianStemmer.g_v, 1072, 1103)))
+ {
+ break lab8;
+ }
+ break golab7;
+ }
+ if (this.cursor >= this.limit)
+ {
+ break lab0;
+ }
+ this.cursor++;
+ }
+ // setmark p2, line 63
+ this.I_p2 = this.cursor;
+ }
+ this.cursor = v_1;
+ return true;
+ }
+
+ function r_R2 () : boolean
+ {
+ if (!(this.I_p2 <= this.cursor))
+ {
+ return false;
+ }
+ return true;
+ }
+
+ function r_perfective_gerund () : boolean
+ {
+ var among_var : int;
+ var v_1 : int;
+ // (, line 71
+ // [, line 72
+ this.ket = this.cursor;
+ // substring, line 72
+ among_var = this.find_among_b(RussianStemmer.a_0, 9);
+ if (among_var == 0)
+ {
+ return false;
+ }
+ // ], line 72
+ this.bra = this.cursor;
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ // (, line 76
+ // or, line 76
+ var lab0 = true;
+ lab0: while (lab0 == true)
+ {
+ lab0 = false;
+ v_1 = this.limit - this.cursor;
+ var lab1 = true;
+ lab1: while (lab1 == true)
+ {
+ lab1 = false;
+ // literal, line 76
+ if (!(this.eq_s_b(1, "\u0430")))
+ {
+ break lab1;
+ }
+ break lab0;
+ }
+ this.cursor = this.limit - v_1;
+ // literal, line 76
+ if (!(this.eq_s_b(1, "\u044F")))
+ {
+ return false;
+ }
+ }
+ // delete, line 76
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ break;
+ case 2:
+ // (, line 83
+ // delete, line 83
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ break;
+ }
+ return true;
+ }
+
+ function r_adjective () : boolean
+ {
+ var among_var : int;
+ // (, line 87
+ // [, line 88
+ this.ket = this.cursor;
+ // substring, line 88
+ among_var = this.find_among_b(RussianStemmer.a_1, 26);
+ if (among_var == 0)
+ {
+ return false;
+ }
+ // ], line 88
+ this.bra = this.cursor;
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ // (, line 97
+ // delete, line 97
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ break;
+ }
+ return true;
+ }
+
+ function r_adjectival () : boolean
+ {
+ var among_var : int;
+ var v_1 : int;
+ var v_2 : int;
+ // (, line 101
+ // call adjective, line 102
+ if (!this.r_adjective())
+ {
+ return false;
+ }
+ // try, line 109
+ v_1 = this.limit - this.cursor;
+ var lab0 = true;
+ lab0: while (lab0 == true)
+ {
+ lab0 = false;
+ // (, line 109
+ // [, line 110
+ this.ket = this.cursor;
+ // substring, line 110
+ among_var = this.find_among_b(RussianStemmer.a_2, 8);
+ if (among_var == 0)
+ {
+ this.cursor = this.limit - v_1;
+ break lab0;
+ }
+ // ], line 110
+ this.bra = this.cursor;
+ switch (among_var) {
+ case 0:
+ this.cursor = this.limit - v_1;
+ break lab0;
+ case 1:
+ // (, line 115
+ // or, line 115
+ var lab1 = true;
+ lab1: while (lab1 == true)
+ {
+ lab1 = false;
+ v_2 = this.limit - this.cursor;
+ var lab2 = true;
+ lab2: while (lab2 == true)
+ {
+ lab2 = false;
+ // literal, line 115
+ if (!(this.eq_s_b(1, "\u0430")))
+ {
+ break lab2;
+ }
+ break lab1;
+ }
+ this.cursor = this.limit - v_2;
+ // literal, line 115
+ if (!(this.eq_s_b(1, "\u044F")))
+ {
+ this.cursor = this.limit - v_1;
+ break lab0;
+ }
+ }
+ // delete, line 115
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ break;
+ case 2:
+ // (, line 122
+ // delete, line 122
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ break;
+ }
+ }
+ return true;
+ }
+
+ function r_reflexive () : boolean
+ {
+ var among_var : int;
+ // (, line 128
+ // [, line 129
+ this.ket = this.cursor;
+ // substring, line 129
+ among_var = this.find_among_b(RussianStemmer.a_3, 2);
+ if (among_var == 0)
+ {
+ return false;
+ }
+ // ], line 129
+ this.bra = this.cursor;
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ // (, line 132
+ // delete, line 132
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ break;
+ }
+ return true;
+ }
+
+ function r_verb () : boolean
+ {
+ var among_var : int;
+ var v_1 : int;
+ // (, line 136
+ // [, line 137
+ this.ket = this.cursor;
+ // substring, line 137
+ among_var = this.find_among_b(RussianStemmer.a_4, 46);
+ if (among_var == 0)
+ {
+ return false;
+ }
+ // ], line 137
+ this.bra = this.cursor;
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ // (, line 143
+ // or, line 143
+ var lab0 = true;
+ lab0: while (lab0 == true)
+ {
+ lab0 = false;
+ v_1 = this.limit - this.cursor;
+ var lab1 = true;
+ lab1: while (lab1 == true)
+ {
+ lab1 = false;
+ // literal, line 143
+ if (!(this.eq_s_b(1, "\u0430")))
+ {
+ break lab1;
+ }
+ break lab0;
+ }
+ this.cursor = this.limit - v_1;
+ // literal, line 143
+ if (!(this.eq_s_b(1, "\u044F")))
+ {
+ return false;
+ }
+ }
+ // delete, line 143
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ break;
+ case 2:
+ // (, line 151
+ // delete, line 151
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ break;
+ }
+ return true;
+ }
+
+ function r_noun () : boolean
+ {
+ var among_var : int;
+ // (, line 159
+ // [, line 160
+ this.ket = this.cursor;
+ // substring, line 160
+ among_var = this.find_among_b(RussianStemmer.a_5, 36);
+ if (among_var == 0)
+ {
+ return false;
+ }
+ // ], line 160
+ this.bra = this.cursor;
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ // (, line 167
+ // delete, line 167
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ break;
+ }
+ return true;
+ }
+
+ function r_derivational () : boolean
+ {
+ var among_var : int;
+ // (, line 175
+ // [, line 176
+ this.ket = this.cursor;
+ // substring, line 176
+ among_var = this.find_among_b(RussianStemmer.a_6, 2);
+ if (among_var == 0)
+ {
+ return false;
+ }
+ // ], line 176
+ this.bra = this.cursor;
+ // call R2, line 176
+ if (!this.r_R2())
+ {
+ return false;
+ }
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ // (, line 179
+ // delete, line 179
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ break;
+ }
+ return true;
+ }
+
+ function r_tidy_up () : boolean
+ {
+ var among_var : int;
+ // (, line 183
+ // [, line 184
+ this.ket = this.cursor;
+ // substring, line 184
+ among_var = this.find_among_b(RussianStemmer.a_7, 4);
+ if (among_var == 0)
+ {
+ return false;
+ }
+ // ], line 184
+ this.bra = this.cursor;
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ // (, line 188
+ // delete, line 188
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ // [, line 189
+ this.ket = this.cursor;
+ // literal, line 189
+ if (!(this.eq_s_b(1, "\u043D")))
+ {
+ return false;
+ }
+ // ], line 189
+ this.bra = this.cursor;
+ // literal, line 189
+ if (!(this.eq_s_b(1, "\u043D")))
+ {
+ return false;
+ }
+ // delete, line 189
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ break;
+ case 2:
+ // (, line 192
+ // literal, line 192
+ if (!(this.eq_s_b(1, "\u043D")))
+ {
+ return false;
+ }
+ // delete, line 192
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ break;
+ case 3:
+ // (, line 194
+ // delete, line 194
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ break;
+ }
+ return true;
+ }
+
+ override function stem () : boolean
+ {
+ var v_1 : int;
+ var v_2 : int;
+ var v_3 : int;
+ var v_4 : int;
+ var v_5 : int;
+ var v_6 : int;
+ var v_7 : int;
+ var v_8 : int;
+ var v_9 : int;
+ var v_10 : int;
+ // (, line 199
+ // do, line 201
+ v_1 = this.cursor;
+ var lab0 = true;
+ lab0: while (lab0 == true)
+ {
+ lab0 = false;
+ // call mark_regions, line 201
+ if (!this.r_mark_regions())
+ {
+ break lab0;
+ }
+ }
+ this.cursor = v_1;
+ // backwards, line 202
+ this.limit_backward = this.cursor; this.cursor = this.limit;
+ // setlimit, line 202
+ v_2 = this.limit - this.cursor;
+ // tomark, line 202
+ if (this.cursor < this.I_pV)
+ {
+ return false;
+ }
+ this.cursor = this.I_pV;
+ v_3 = this.limit_backward;
+ this.limit_backward = this.cursor;
+ this.cursor = this.limit - v_2;
+ // (, line 202
+ // do, line 203
+ v_4 = this.limit - this.cursor;
+ var lab1 = true;
+ lab1: while (lab1 == true)
+ {
+ lab1 = false;
+ // (, line 203
+ // or, line 204
+ var lab2 = true;
+ lab2: while (lab2 == true)
+ {
+ lab2 = false;
+ v_5 = this.limit - this.cursor;
+ var lab3 = true;
+ lab3: while (lab3 == true)
+ {
+ lab3 = false;
+ // call perfective_gerund, line 204
+ if (!this.r_perfective_gerund())
+ {
+ break lab3;
+ }
+ break lab2;
+ }
+ this.cursor = this.limit - v_5;
+ // (, line 205
+ // try, line 205
+ v_6 = this.limit - this.cursor;
+ var lab4 = true;
+ lab4: while (lab4 == true)
+ {
+ lab4 = false;
+ // call reflexive, line 205
+ if (!this.r_reflexive())
+ {
+ this.cursor = this.limit - v_6;
+ break lab4;
+ }
+ }
+ // or, line 206
+ var lab5 = true;
+ lab5: while (lab5 == true)
+ {
+ lab5 = false;
+ v_7 = this.limit - this.cursor;
+ var lab6 = true;
+ lab6: while (lab6 == true)
+ {
+ lab6 = false;
+ // call adjectival, line 206
+ if (!this.r_adjectival())
+ {
+ break lab6;
+ }
+ break lab5;
+ }
+ this.cursor = this.limit - v_7;
+ var lab7 = true;
+ lab7: while (lab7 == true)
+ {
+ lab7 = false;
+ // call verb, line 206
+ if (!this.r_verb())
+ {
+ break lab7;
+ }
+ break lab5;
+ }
+ this.cursor = this.limit - v_7;
+ // call noun, line 206
+ if (!this.r_noun())
+ {
+ break lab1;
+ }
+ }
+ }
+ }
+ this.cursor = this.limit - v_4;
+ // try, line 209
+ v_8 = this.limit - this.cursor;
+ var lab8 = true;
+ lab8: while (lab8 == true)
+ {
+ lab8 = false;
+ // (, line 209
+ // [, line 209
+ this.ket = this.cursor;
+ // literal, line 209
+ if (!(this.eq_s_b(1, "\u0438")))
+ {
+ this.cursor = this.limit - v_8;
+ break lab8;
+ }
+ // ], line 209
+ this.bra = this.cursor;
+ // delete, line 209
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ }
+ // do, line 212
+ v_9 = this.limit - this.cursor;
+ var lab9 = true;
+ lab9: while (lab9 == true)
+ {
+ lab9 = false;
+ // call derivational, line 212
+ if (!this.r_derivational())
+ {
+ break lab9;
+ }
+ }
+ this.cursor = this.limit - v_9;
+ // do, line 213
+ v_10 = this.limit - this.cursor;
+ var lab10 = true;
+ lab10: while (lab10 == true)
+ {
+ lab10 = false;
+ // call tidy_up, line 213
+ if (!this.r_tidy_up())
+ {
+ break lab10;
+ }
+ }
+ this.cursor = this.limit - v_10;
+ this.limit_backward = v_3;
+ this.cursor = this.limit_backward; return true;
+ }
+
+ function equals (o : variant) : boolean {
+ return o instanceof RussianStemmer;
+ }
+
+ function hashCode() : int
+ {
+ //http://stackoverflow.com/questions/194846/is-there-any-kind-of-hashcode-function-in-javascript
+ var classname = "RussianStemmer";
+ var hash = 0;
+ if (classname.length == 0) return hash;
+ for (var i = 0; i < classname.length; i++) {
+ var char = classname.charCodeAt(i);
+ hash = ((hash << 5) - hash) + char;
+ hash = hash & hash; // Convert to 32bit integer
+ }
+ return hash;
+ }
+
+}
+
diff --git a/web/server/h2o/libh2o/misc/oktavia/src/stemmer/spanish-stemmer.jsx b/web/server/h2o/libh2o/misc/oktavia/src/stemmer/spanish-stemmer.jsx
new file mode 100644
index 00000000..e9bee696
--- /dev/null
+++ b/web/server/h2o/libh2o/misc/oktavia/src/stemmer/spanish-stemmer.jsx
@@ -0,0 +1,1408 @@
+// This file was generated automatically by the Snowball to JSX compiler
+
+import "base-stemmer.jsx";
+import "among.jsx";
+
+ /**
+ * This class was automatically generated by a Snowball to JSX compiler
+ * It implements the stemming algorithm defined by a snowball script.
+ */
+
+class SpanishStemmer extends BaseStemmer
+{
+ static const serialVersionUID = 1;
+ static const methodObject = new SpanishStemmer();
+
+ static const a_0 = [
+ new Among("", -1, 6),
+ new Among("\u00E1", 0, 1),
+ new Among("\u00E9", 0, 2),
+ new Among("\u00ED", 0, 3),
+ new Among("\u00F3", 0, 4),
+ new Among("\u00FA", 0, 5)
+ ];
+
+ static const a_1 = [
+ new Among("la", -1, -1),
+ new Among("sela", 0, -1),
+ new Among("le", -1, -1),
+ new Among("me", -1, -1),
+ new Among("se", -1, -1),
+ new Among("lo", -1, -1),
+ new Among("selo", 5, -1),
+ new Among("las", -1, -1),
+ new Among("selas", 7, -1),
+ new Among("les", -1, -1),
+ new Among("los", -1, -1),
+ new Among("selos", 10, -1),
+ new Among("nos", -1, -1)
+ ];
+
+ static const a_2 = [
+ new Among("ando", -1, 6),
+ new Among("iendo", -1, 6),
+ new Among("yendo", -1, 7),
+ new Among("\u00E1ndo", -1, 2),
+ new Among("i\u00E9ndo", -1, 1),
+ new Among("ar", -1, 6),
+ new Among("er", -1, 6),
+ new Among("ir", -1, 6),
+ new Among("\u00E1r", -1, 3),
+ new Among("\u00E9r", -1, 4),
+ new Among("\u00EDr", -1, 5)
+ ];
+
+ static const a_3 = [
+ new Among("ic", -1, -1),
+ new Among("ad", -1, -1),
+ new Among("os", -1, -1),
+ new Among("iv", -1, 1)
+ ];
+
+ static const a_4 = [
+ new Among("able", -1, 1),
+ new Among("ible", -1, 1),
+ new Among("ante", -1, 1)
+ ];
+
+ static const a_5 = [
+ new Among("ic", -1, 1),
+ new Among("abil", -1, 1),
+ new Among("iv", -1, 1)
+ ];
+
+ static const a_6 = [
+ new Among("ica", -1, 1),
+ new Among("ancia", -1, 2),
+ new Among("encia", -1, 5),
+ new Among("adora", -1, 2),
+ new Among("osa", -1, 1),
+ new Among("ista", -1, 1),
+ new Among("iva", -1, 9),
+ new Among("anza", -1, 1),
+ new Among("log\u00EDa", -1, 3),
+ new Among("idad", -1, 8),
+ new Among("able", -1, 1),
+ new Among("ible", -1, 1),
+ new Among("ante", -1, 2),
+ new Among("mente", -1, 7),
+ new Among("amente", 13, 6),
+ new Among("aci\u00F3n", -1, 2),
+ new Among("uci\u00F3n", -1, 4),
+ new Among("ico", -1, 1),
+ new Among("ismo", -1, 1),
+ new Among("oso", -1, 1),
+ new Among("amiento", -1, 1),
+ new Among("imiento", -1, 1),
+ new Among("ivo", -1, 9),
+ new Among("ador", -1, 2),
+ new Among("icas", -1, 1),
+ new Among("ancias", -1, 2),
+ new Among("encias", -1, 5),
+ new Among("adoras", -1, 2),
+ new Among("osas", -1, 1),
+ new Among("istas", -1, 1),
+ new Among("ivas", -1, 9),
+ new Among("anzas", -1, 1),
+ new Among("log\u00EDas", -1, 3),
+ new Among("idades", -1, 8),
+ new Among("ables", -1, 1),
+ new Among("ibles", -1, 1),
+ new Among("aciones", -1, 2),
+ new Among("uciones", -1, 4),
+ new Among("adores", -1, 2),
+ new Among("antes", -1, 2),
+ new Among("icos", -1, 1),
+ new Among("ismos", -1, 1),
+ new Among("osos", -1, 1),
+ new Among("amientos", -1, 1),
+ new Among("imientos", -1, 1),
+ new Among("ivos", -1, 9)
+ ];
+
+ static const a_7 = [
+ new Among("ya", -1, 1),
+ new Among("ye", -1, 1),
+ new Among("yan", -1, 1),
+ new Among("yen", -1, 1),
+ new Among("yeron", -1, 1),
+ new Among("yendo", -1, 1),
+ new Among("yo", -1, 1),
+ new Among("yas", -1, 1),
+ new Among("yes", -1, 1),
+ new Among("yais", -1, 1),
+ new Among("yamos", -1, 1),
+ new Among("y\u00F3", -1, 1)
+ ];
+
+ static const a_8 = [
+ new Among("aba", -1, 2),
+ new Among("ada", -1, 2),
+ new Among("ida", -1, 2),
+ new Among("ara", -1, 2),
+ new Among("iera", -1, 2),
+ new Among("\u00EDa", -1, 2),
+ new Among("ar\u00EDa", 5, 2),
+ new Among("er\u00EDa", 5, 2),
+ new Among("ir\u00EDa", 5, 2),
+ new Among("ad", -1, 2),
+ new Among("ed", -1, 2),
+ new Among("id", -1, 2),
+ new Among("ase", -1, 2),
+ new Among("iese", -1, 2),
+ new Among("aste", -1, 2),
+ new Among("iste", -1, 2),
+ new Among("an", -1, 2),
+ new Among("aban", 16, 2),
+ new Among("aran", 16, 2),
+ new Among("ieran", 16, 2),
+ new Among("\u00EDan", 16, 2),
+ new Among("ar\u00EDan", 20, 2),
+ new Among("er\u00EDan", 20, 2),
+ new Among("ir\u00EDan", 20, 2),
+ new Among("en", -1, 1),
+ new Among("asen", 24, 2),
+ new Among("iesen", 24, 2),
+ new Among("aron", -1, 2),
+ new Among("ieron", -1, 2),
+ new Among("ar\u00E1n", -1, 2),
+ new Among("er\u00E1n", -1, 2),
+ new Among("ir\u00E1n", -1, 2),
+ new Among("ado", -1, 2),
+ new Among("ido", -1, 2),
+ new Among("ando", -1, 2),
+ new Among("iendo", -1, 2),
+ new Among("ar", -1, 2),
+ new Among("er", -1, 2),
+ new Among("ir", -1, 2),
+ new Among("as", -1, 2),
+ new Among("abas", 39, 2),
+ new Among("adas", 39, 2),
+ new Among("idas", 39, 2),
+ new Among("aras", 39, 2),
+ new Among("ieras", 39, 2),
+ new Among("\u00EDas", 39, 2),
+ new Among("ar\u00EDas", 45, 2),
+ new Among("er\u00EDas", 45, 2),
+ new Among("ir\u00EDas", 45, 2),
+ new Among("es", -1, 1),
+ new Among("ases", 49, 2),
+ new Among("ieses", 49, 2),
+ new Among("abais", -1, 2),
+ new Among("arais", -1, 2),
+ new Among("ierais", -1, 2),
+ new Among("\u00EDais", -1, 2),
+ new Among("ar\u00EDais", 55, 2),
+ new Among("er\u00EDais", 55, 2),
+ new Among("ir\u00EDais", 55, 2),
+ new Among("aseis", -1, 2),
+ new Among("ieseis", -1, 2),
+ new Among("asteis", -1, 2),
+ new Among("isteis", -1, 2),
+ new Among("\u00E1is", -1, 2),
+ new Among("\u00E9is", -1, 1),
+ new Among("ar\u00E9is", 64, 2),
+ new Among("er\u00E9is", 64, 2),
+ new Among("ir\u00E9is", 64, 2),
+ new Among("ados", -1, 2),
+ new Among("idos", -1, 2),
+ new Among("amos", -1, 2),
+ new Among("\u00E1bamos", 70, 2),
+ new Among("\u00E1ramos", 70, 2),
+ new Among("i\u00E9ramos", 70, 2),
+ new Among("\u00EDamos", 70, 2),
+ new Among("ar\u00EDamos", 74, 2),
+ new Among("er\u00EDamos", 74, 2),
+ new Among("ir\u00EDamos", 74, 2),
+ new Among("emos", -1, 1),
+ new Among("aremos", 78, 2),
+ new Among("eremos", 78, 2),
+ new Among("iremos", 78, 2),
+ new Among("\u00E1semos", 78, 2),
+ new Among("i\u00E9semos", 78, 2),
+ new Among("imos", -1, 2),
+ new Among("ar\u00E1s", -1, 2),
+ new Among("er\u00E1s", -1, 2),
+ new Among("ir\u00E1s", -1, 2),
+ new Among("\u00EDs", -1, 2),
+ new Among("ar\u00E1", -1, 2),
+ new Among("er\u00E1", -1, 2),
+ new Among("ir\u00E1", -1, 2),
+ new Among("ar\u00E9", -1, 2),
+ new Among("er\u00E9", -1, 2),
+ new Among("ir\u00E9", -1, 2),
+ new Among("i\u00F3", -1, 2)
+ ];
+
+ static const a_9 = [
+ new Among("a", -1, 1),
+ new Among("e", -1, 2),
+ new Among("o", -1, 1),
+ new Among("os", -1, 1),
+ new Among("\u00E1", -1, 1),
+ new Among("\u00E9", -1, 2),
+ new Among("\u00ED", -1, 1),
+ new Among("\u00F3", -1, 1)
+ ];
+
+ static const g_v = [17, 65, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 17, 4, 10] : int[];
+
+ var I_p2 : int = 0;
+ var I_p1 : int = 0;
+ var I_pV : int = 0;
+
+ function copy_from (other : SpanishStemmer) : void
+ {
+ this.I_p2 = other.I_p2;
+ this.I_p1 = other.I_p1;
+ this.I_pV = other.I_pV;
+ super.copy_from(other);
+ }
+
+ function r_mark_regions () : boolean
+ {
+ var v_1 : int;
+ var v_2 : int;
+ var v_3 : int;
+ var v_6 : int;
+ var v_8 : int;
+ // (, line 31
+ this.I_pV = this.limit;
+ this.I_p1 = this.limit;
+ this.I_p2 = this.limit;
+ // do, line 37
+ v_1 = this.cursor;
+ var lab0 = true;
+ lab0: while (lab0 == true)
+ {
+ lab0 = false;
+ // (, line 37
+ // or, line 39
+ var lab1 = true;
+ lab1: while (lab1 == true)
+ {
+ lab1 = false;
+ v_2 = this.cursor;
+ var lab2 = true;
+ lab2: while (lab2 == true)
+ {
+ lab2 = false;
+ // (, line 38
+ if (!(this.in_grouping(SpanishStemmer.g_v, 97, 252)))
+ {
+ break lab2;
+ }
+ // or, line 38
+ var lab3 = true;
+ lab3: while (lab3 == true)
+ {
+ lab3 = false;
+ v_3 = this.cursor;
+ var lab4 = true;
+ lab4: while (lab4 == true)
+ {
+ lab4 = false;
+ // (, line 38
+ if (!(this.out_grouping(SpanishStemmer.g_v, 97, 252)))
+ {
+ break lab4;
+ }
+ // gopast, line 38
+ golab5: while(true)
+ {
+ var lab6 = true;
+ lab6: while (lab6 == true)
+ {
+ lab6 = false;
+ if (!(this.in_grouping(SpanishStemmer.g_v, 97, 252)))
+ {
+ break lab6;
+ }
+ break golab5;
+ }
+ if (this.cursor >= this.limit)
+ {
+ break lab4;
+ }
+ this.cursor++;
+ }
+ break lab3;
+ }
+ this.cursor = v_3;
+ // (, line 38
+ if (!(this.in_grouping(SpanishStemmer.g_v, 97, 252)))
+ {
+ break lab2;
+ }
+ // gopast, line 38
+ golab7: while(true)
+ {
+ var lab8 = true;
+ lab8: while (lab8 == true)
+ {
+ lab8 = false;
+ if (!(this.out_grouping(SpanishStemmer.g_v, 97, 252)))
+ {
+ break lab8;
+ }
+ break golab7;
+ }
+ if (this.cursor >= this.limit)
+ {
+ break lab2;
+ }
+ this.cursor++;
+ }
+ }
+ break lab1;
+ }
+ this.cursor = v_2;
+ // (, line 40
+ if (!(this.out_grouping(SpanishStemmer.g_v, 97, 252)))
+ {
+ break lab0;
+ }
+ // or, line 40
+ var lab9 = true;
+ lab9: while (lab9 == true)
+ {
+ lab9 = false;
+ v_6 = this.cursor;
+ var lab10 = true;
+ lab10: while (lab10 == true)
+ {
+ lab10 = false;
+ // (, line 40
+ if (!(this.out_grouping(SpanishStemmer.g_v, 97, 252)))
+ {
+ break lab10;
+ }
+ // gopast, line 40
+ golab11: while(true)
+ {
+ var lab12 = true;
+ lab12: while (lab12 == true)
+ {
+ lab12 = false;
+ if (!(this.in_grouping(SpanishStemmer.g_v, 97, 252)))
+ {
+ break lab12;
+ }
+ break golab11;
+ }
+ if (this.cursor >= this.limit)
+ {
+ break lab10;
+ }
+ this.cursor++;
+ }
+ break lab9;
+ }
+ this.cursor = v_6;
+ // (, line 40
+ if (!(this.in_grouping(SpanishStemmer.g_v, 97, 252)))
+ {
+ break lab0;
+ }
+ // next, line 40
+ if (this.cursor >= this.limit)
+ {
+ break lab0;
+ }
+ this.cursor++;
+ }
+ }
+ // setmark pV, line 41
+ this.I_pV = this.cursor;
+ }
+ this.cursor = v_1;
+ // do, line 43
+ v_8 = this.cursor;
+ var lab13 = true;
+ lab13: while (lab13 == true)
+ {
+ lab13 = false;
+ // (, line 43
+ // gopast, line 44
+ golab14: while(true)
+ {
+ var lab15 = true;
+ lab15: while (lab15 == true)
+ {
+ lab15 = false;
+ if (!(this.in_grouping(SpanishStemmer.g_v, 97, 252)))
+ {
+ break lab15;
+ }
+ break golab14;
+ }
+ if (this.cursor >= this.limit)
+ {
+ break lab13;
+ }
+ this.cursor++;
+ }
+ // gopast, line 44
+ golab16: while(true)
+ {
+ var lab17 = true;
+ lab17: while (lab17 == true)
+ {
+ lab17 = false;
+ if (!(this.out_grouping(SpanishStemmer.g_v, 97, 252)))
+ {
+ break lab17;
+ }
+ break golab16;
+ }
+ if (this.cursor >= this.limit)
+ {
+ break lab13;
+ }
+ this.cursor++;
+ }
+ // setmark p1, line 44
+ this.I_p1 = this.cursor;
+ // gopast, line 45
+ golab18: while(true)
+ {
+ var lab19 = true;
+ lab19: while (lab19 == true)
+ {
+ lab19 = false;
+ if (!(this.in_grouping(SpanishStemmer.g_v, 97, 252)))
+ {
+ break lab19;
+ }
+ break golab18;
+ }
+ if (this.cursor >= this.limit)
+ {
+ break lab13;
+ }
+ this.cursor++;
+ }
+ // gopast, line 45
+ golab20: while(true)
+ {
+ var lab21 = true;
+ lab21: while (lab21 == true)
+ {
+ lab21 = false;
+ if (!(this.out_grouping(SpanishStemmer.g_v, 97, 252)))
+ {
+ break lab21;
+ }
+ break golab20;
+ }
+ if (this.cursor >= this.limit)
+ {
+ break lab13;
+ }
+ this.cursor++;
+ }
+ // setmark p2, line 45
+ this.I_p2 = this.cursor;
+ }
+ this.cursor = v_8;
+ return true;
+ }
+
+ function r_postlude () : boolean
+ {
+ var among_var : int;
+ var v_1 : int;
+ // repeat, line 49
+ replab0: while(true)
+ {
+ v_1 = this.cursor;
+ var lab1 = true;
+ lab1: while (lab1 == true)
+ {
+ lab1 = false;
+ // (, line 49
+ // [, line 50
+ this.bra = this.cursor;
+ // substring, line 50
+ among_var = this.find_among(SpanishStemmer.a_0, 6);
+ if (among_var == 0)
+ {
+ break lab1;
+ }
+ // ], line 50
+ this.ket = this.cursor;
+ switch (among_var) {
+ case 0:
+ break lab1;
+ case 1:
+ // (, line 51
+ // <-, line 51
+ if (!this.slice_from("a"))
+ {
+ return false;
+ }
+ break;
+ case 2:
+ // (, line 52
+ // <-, line 52
+ if (!this.slice_from("e"))
+ {
+ return false;
+ }
+ break;
+ case 3:
+ // (, line 53
+ // <-, line 53
+ if (!this.slice_from("i"))
+ {
+ return false;
+ }
+ break;
+ case 4:
+ // (, line 54
+ // <-, line 54
+ if (!this.slice_from("o"))
+ {
+ return false;
+ }
+ break;
+ case 5:
+ // (, line 55
+ // <-, line 55
+ if (!this.slice_from("u"))
+ {
+ return false;
+ }
+ break;
+ case 6:
+ // (, line 57
+ // next, line 57
+ if (this.cursor >= this.limit)
+ {
+ break lab1;
+ }
+ this.cursor++;
+ break;
+ }
+ continue replab0;
+ }
+ this.cursor = v_1;
+ break replab0;
+ }
+ return true;
+ }
+
+ function r_RV () : boolean
+ {
+ if (!(this.I_pV <= this.cursor))
+ {
+ return false;
+ }
+ return true;
+ }
+
+ function r_R1 () : boolean
+ {
+ if (!(this.I_p1 <= this.cursor))
+ {
+ return false;
+ }
+ return true;
+ }
+
+ function r_R2 () : boolean
+ {
+ if (!(this.I_p2 <= this.cursor))
+ {
+ return false;
+ }
+ return true;
+ }
+
+ function r_attached_pronoun () : boolean
+ {
+ var among_var : int;
+ // (, line 67
+ // [, line 68
+ this.ket = this.cursor;
+ // substring, line 68
+ if (this.find_among_b(SpanishStemmer.a_1, 13) == 0)
+ {
+ return false;
+ }
+ // ], line 68
+ this.bra = this.cursor;
+ // substring, line 72
+ among_var = this.find_among_b(SpanishStemmer.a_2, 11);
+ if (among_var == 0)
+ {
+ return false;
+ }
+ // call RV, line 72
+ if (!this.r_RV())
+ {
+ return false;
+ }
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ // (, line 73
+ // ], line 73
+ this.bra = this.cursor;
+ // <-, line 73
+ if (!this.slice_from("iendo"))
+ {
+ return false;
+ }
+ break;
+ case 2:
+ // (, line 74
+ // ], line 74
+ this.bra = this.cursor;
+ // <-, line 74
+ if (!this.slice_from("ando"))
+ {
+ return false;
+ }
+ break;
+ case 3:
+ // (, line 75
+ // ], line 75
+ this.bra = this.cursor;
+ // <-, line 75
+ if (!this.slice_from("ar"))
+ {
+ return false;
+ }
+ break;
+ case 4:
+ // (, line 76
+ // ], line 76
+ this.bra = this.cursor;
+ // <-, line 76
+ if (!this.slice_from("er"))
+ {
+ return false;
+ }
+ break;
+ case 5:
+ // (, line 77
+ // ], line 77
+ this.bra = this.cursor;
+ // <-, line 77
+ if (!this.slice_from("ir"))
+ {
+ return false;
+ }
+ break;
+ case 6:
+ // (, line 81
+ // delete, line 81
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ break;
+ case 7:
+ // (, line 82
+ // literal, line 82
+ if (!(this.eq_s_b(1, "u")))
+ {
+ return false;
+ }
+ // delete, line 82
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ break;
+ }
+ return true;
+ }
+
+ function r_standard_suffix () : boolean
+ {
+ var among_var : int;
+ var v_1 : int;
+ var v_2 : int;
+ var v_3 : int;
+ var v_4 : int;
+ var v_5 : int;
+ // (, line 86
+ // [, line 87
+ this.ket = this.cursor;
+ // substring, line 87
+ among_var = this.find_among_b(SpanishStemmer.a_6, 46);
+ if (among_var == 0)
+ {
+ return false;
+ }
+ // ], line 87
+ this.bra = this.cursor;
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ // (, line 98
+ // call R2, line 99
+ if (!this.r_R2())
+ {
+ return false;
+ }
+ // delete, line 99
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ break;
+ case 2:
+ // (, line 104
+ // call R2, line 105
+ if (!this.r_R2())
+ {
+ return false;
+ }
+ // delete, line 105
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ // try, line 106
+ v_1 = this.limit - this.cursor;
+ var lab0 = true;
+ lab0: while (lab0 == true)
+ {
+ lab0 = false;
+ // (, line 106
+ // [, line 106
+ this.ket = this.cursor;
+ // literal, line 106
+ if (!(this.eq_s_b(2, "ic")))
+ {
+ this.cursor = this.limit - v_1;
+ break lab0;
+ }
+ // ], line 106
+ this.bra = this.cursor;
+ // call R2, line 106
+ if (!this.r_R2())
+ {
+ this.cursor = this.limit - v_1;
+ break lab0;
+ }
+ // delete, line 106
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ }
+ break;
+ case 3:
+ // (, line 110
+ // call R2, line 111
+ if (!this.r_R2())
+ {
+ return false;
+ }
+ // <-, line 111
+ if (!this.slice_from("log"))
+ {
+ return false;
+ }
+ break;
+ case 4:
+ // (, line 114
+ // call R2, line 115
+ if (!this.r_R2())
+ {
+ return false;
+ }
+ // <-, line 115
+ if (!this.slice_from("u"))
+ {
+ return false;
+ }
+ break;
+ case 5:
+ // (, line 118
+ // call R2, line 119
+ if (!this.r_R2())
+ {
+ return false;
+ }
+ // <-, line 119
+ if (!this.slice_from("ente"))
+ {
+ return false;
+ }
+ break;
+ case 6:
+ // (, line 122
+ // call R1, line 123
+ if (!this.r_R1())
+ {
+ return false;
+ }
+ // delete, line 123
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ // try, line 124
+ v_2 = this.limit - this.cursor;
+ var lab1 = true;
+ lab1: while (lab1 == true)
+ {
+ lab1 = false;
+ // (, line 124
+ // [, line 125
+ this.ket = this.cursor;
+ // substring, line 125
+ among_var = this.find_among_b(SpanishStemmer.a_3, 4);
+ if (among_var == 0)
+ {
+ this.cursor = this.limit - v_2;
+ break lab1;
+ }
+ // ], line 125
+ this.bra = this.cursor;
+ // call R2, line 125
+ if (!this.r_R2())
+ {
+ this.cursor = this.limit - v_2;
+ break lab1;
+ }
+ // delete, line 125
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ switch (among_var) {
+ case 0:
+ this.cursor = this.limit - v_2;
+ break lab1;
+ case 1:
+ // (, line 126
+ // [, line 126
+ this.ket = this.cursor;
+ // literal, line 126
+ if (!(this.eq_s_b(2, "at")))
+ {
+ this.cursor = this.limit - v_2;
+ break lab1;
+ }
+ // ], line 126
+ this.bra = this.cursor;
+ // call R2, line 126
+ if (!this.r_R2())
+ {
+ this.cursor = this.limit - v_2;
+ break lab1;
+ }
+ // delete, line 126
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ break;
+ }
+ }
+ break;
+ case 7:
+ // (, line 134
+ // call R2, line 135
+ if (!this.r_R2())
+ {
+ return false;
+ }
+ // delete, line 135
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ // try, line 136
+ v_3 = this.limit - this.cursor;
+ var lab2 = true;
+ lab2: while (lab2 == true)
+ {
+ lab2 = false;
+ // (, line 136
+ // [, line 137
+ this.ket = this.cursor;
+ // substring, line 137
+ among_var = this.find_among_b(SpanishStemmer.a_4, 3);
+ if (among_var == 0)
+ {
+ this.cursor = this.limit - v_3;
+ break lab2;
+ }
+ // ], line 137
+ this.bra = this.cursor;
+ switch (among_var) {
+ case 0:
+ this.cursor = this.limit - v_3;
+ break lab2;
+ case 1:
+ // (, line 140
+ // call R2, line 140
+ if (!this.r_R2())
+ {
+ this.cursor = this.limit - v_3;
+ break lab2;
+ }
+ // delete, line 140
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ break;
+ }
+ }
+ break;
+ case 8:
+ // (, line 146
+ // call R2, line 147
+ if (!this.r_R2())
+ {
+ return false;
+ }
+ // delete, line 147
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ // try, line 148
+ v_4 = this.limit - this.cursor;
+ var lab3 = true;
+ lab3: while (lab3 == true)
+ {
+ lab3 = false;
+ // (, line 148
+ // [, line 149
+ this.ket = this.cursor;
+ // substring, line 149
+ among_var = this.find_among_b(SpanishStemmer.a_5, 3);
+ if (among_var == 0)
+ {
+ this.cursor = this.limit - v_4;
+ break lab3;
+ }
+ // ], line 149
+ this.bra = this.cursor;
+ switch (among_var) {
+ case 0:
+ this.cursor = this.limit - v_4;
+ break lab3;
+ case 1:
+ // (, line 152
+ // call R2, line 152
+ if (!this.r_R2())
+ {
+ this.cursor = this.limit - v_4;
+ break lab3;
+ }
+ // delete, line 152
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ break;
+ }
+ }
+ break;
+ case 9:
+ // (, line 158
+ // call R2, line 159
+ if (!this.r_R2())
+ {
+ return false;
+ }
+ // delete, line 159
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ // try, line 160
+ v_5 = this.limit - this.cursor;
+ var lab4 = true;
+ lab4: while (lab4 == true)
+ {
+ lab4 = false;
+ // (, line 160
+ // [, line 161
+ this.ket = this.cursor;
+ // literal, line 161
+ if (!(this.eq_s_b(2, "at")))
+ {
+ this.cursor = this.limit - v_5;
+ break lab4;
+ }
+ // ], line 161
+ this.bra = this.cursor;
+ // call R2, line 161
+ if (!this.r_R2())
+ {
+ this.cursor = this.limit - v_5;
+ break lab4;
+ }
+ // delete, line 161
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ }
+ break;
+ }
+ return true;
+ }
+
+ function r_y_verb_suffix () : boolean
+ {
+ var among_var : int;
+ var v_1 : int;
+ var v_2 : int;
+ // (, line 167
+ // setlimit, line 168
+ v_1 = this.limit - this.cursor;
+ // tomark, line 168
+ if (this.cursor < this.I_pV)
+ {
+ return false;
+ }
+ this.cursor = this.I_pV;
+ v_2 = this.limit_backward;
+ this.limit_backward = this.cursor;
+ this.cursor = this.limit - v_1;
+ // (, line 168
+ // [, line 168
+ this.ket = this.cursor;
+ // substring, line 168
+ among_var = this.find_among_b(SpanishStemmer.a_7, 12);
+ if (among_var == 0)
+ {
+ this.limit_backward = v_2;
+ return false;
+ }
+ // ], line 168
+ this.bra = this.cursor;
+ this.limit_backward = v_2;
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ // (, line 171
+ // literal, line 171
+ if (!(this.eq_s_b(1, "u")))
+ {
+ return false;
+ }
+ // delete, line 171
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ break;
+ }
+ return true;
+ }
+
+ function r_verb_suffix () : boolean
+ {
+ var among_var : int;
+ var v_1 : int;
+ var v_2 : int;
+ var v_3 : int;
+ var v_4 : int;
+ // (, line 175
+ // setlimit, line 176
+ v_1 = this.limit - this.cursor;
+ // tomark, line 176
+ if (this.cursor < this.I_pV)
+ {
+ return false;
+ }
+ this.cursor = this.I_pV;
+ v_2 = this.limit_backward;
+ this.limit_backward = this.cursor;
+ this.cursor = this.limit - v_1;
+ // (, line 176
+ // [, line 176
+ this.ket = this.cursor;
+ // substring, line 176
+ among_var = this.find_among_b(SpanishStemmer.a_8, 96);
+ if (among_var == 0)
+ {
+ this.limit_backward = v_2;
+ return false;
+ }
+ // ], line 176
+ this.bra = this.cursor;
+ this.limit_backward = v_2;
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ // (, line 179
+ // try, line 179
+ v_3 = this.limit - this.cursor;
+ var lab0 = true;
+ lab0: while (lab0 == true)
+ {
+ lab0 = false;
+ // (, line 179
+ // literal, line 179
+ if (!(this.eq_s_b(1, "u")))
+ {
+ this.cursor = this.limit - v_3;
+ break lab0;
+ }
+ // test, line 179
+ v_4 = this.limit - this.cursor;
+ // literal, line 179
+ if (!(this.eq_s_b(1, "g")))
+ {
+ this.cursor = this.limit - v_3;
+ break lab0;
+ }
+ this.cursor = this.limit - v_4;
+ }
+ // ], line 179
+ this.bra = this.cursor;
+ // delete, line 179
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ break;
+ case 2:
+ // (, line 200
+ // delete, line 200
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ break;
+ }
+ return true;
+ }
+
+ function r_residual_suffix () : boolean
+ {
+ var among_var : int;
+ var v_1 : int;
+ var v_2 : int;
+ // (, line 204
+ // [, line 205
+ this.ket = this.cursor;
+ // substring, line 205
+ among_var = this.find_among_b(SpanishStemmer.a_9, 8);
+ if (among_var == 0)
+ {
+ return false;
+ }
+ // ], line 205
+ this.bra = this.cursor;
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ // (, line 208
+ // call RV, line 208
+ if (!this.r_RV())
+ {
+ return false;
+ }
+ // delete, line 208
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ break;
+ case 2:
+ // (, line 210
+ // call RV, line 210
+ if (!this.r_RV())
+ {
+ return false;
+ }
+ // delete, line 210
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ // try, line 210
+ v_1 = this.limit - this.cursor;
+ var lab0 = true;
+ lab0: while (lab0 == true)
+ {
+ lab0 = false;
+ // (, line 210
+ // [, line 210
+ this.ket = this.cursor;
+ // literal, line 210
+ if (!(this.eq_s_b(1, "u")))
+ {
+ this.cursor = this.limit - v_1;
+ break lab0;
+ }
+ // ], line 210
+ this.bra = this.cursor;
+ // test, line 210
+ v_2 = this.limit - this.cursor;
+ // literal, line 210
+ if (!(this.eq_s_b(1, "g")))
+ {
+ this.cursor = this.limit - v_1;
+ break lab0;
+ }
+ this.cursor = this.limit - v_2;
+ // call RV, line 210
+ if (!this.r_RV())
+ {
+ this.cursor = this.limit - v_1;
+ break lab0;
+ }
+ // delete, line 210
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ }
+ break;
+ }
+ return true;
+ }
+
+ override function stem () : boolean
+ {
+ var v_1 : int;
+ var v_2 : int;
+ var v_3 : int;
+ var v_4 : int;
+ var v_5 : int;
+ var v_6 : int;
+ // (, line 215
+ // do, line 216
+ v_1 = this.cursor;
+ var lab0 = true;
+ lab0: while (lab0 == true)
+ {
+ lab0 = false;
+ // call mark_regions, line 216
+ if (!this.r_mark_regions())
+ {
+ break lab0;
+ }
+ }
+ this.cursor = v_1;
+ // backwards, line 217
+ this.limit_backward = this.cursor; this.cursor = this.limit;
+ // (, line 217
+ // do, line 218
+ v_2 = this.limit - this.cursor;
+ var lab1 = true;
+ lab1: while (lab1 == true)
+ {
+ lab1 = false;
+ // call attached_pronoun, line 218
+ if (!this.r_attached_pronoun())
+ {
+ break lab1;
+ }
+ }
+ this.cursor = this.limit - v_2;
+ // do, line 219
+ v_3 = this.limit - this.cursor;
+ var lab2 = true;
+ lab2: while (lab2 == true)
+ {
+ lab2 = false;
+ // (, line 219
+ // or, line 219
+ var lab3 = true;
+ lab3: while (lab3 == true)
+ {
+ lab3 = false;
+ v_4 = this.limit - this.cursor;
+ var lab4 = true;
+ lab4: while (lab4 == true)
+ {
+ lab4 = false;
+ // call standard_suffix, line 219
+ if (!this.r_standard_suffix())
+ {
+ break lab4;
+ }
+ break lab3;
+ }
+ this.cursor = this.limit - v_4;
+ var lab5 = true;
+ lab5: while (lab5 == true)
+ {
+ lab5 = false;
+ // call y_verb_suffix, line 220
+ if (!this.r_y_verb_suffix())
+ {
+ break lab5;
+ }
+ break lab3;
+ }
+ this.cursor = this.limit - v_4;
+ // call verb_suffix, line 221
+ if (!this.r_verb_suffix())
+ {
+ break lab2;
+ }
+ }
+ }
+ this.cursor = this.limit - v_3;
+ // do, line 223
+ v_5 = this.limit - this.cursor;
+ var lab6 = true;
+ lab6: while (lab6 == true)
+ {
+ lab6 = false;
+ // call residual_suffix, line 223
+ if (!this.r_residual_suffix())
+ {
+ break lab6;
+ }
+ }
+ this.cursor = this.limit - v_5;
+ this.cursor = this.limit_backward; // do, line 225
+ v_6 = this.cursor;
+ var lab7 = true;
+ lab7: while (lab7 == true)
+ {
+ lab7 = false;
+ // call postlude, line 225
+ if (!this.r_postlude())
+ {
+ break lab7;
+ }
+ }
+ this.cursor = v_6;
+ return true;
+ }
+
+ function equals (o : variant) : boolean {
+ return o instanceof SpanishStemmer;
+ }
+
+ function hashCode() : int
+ {
+ //http://stackoverflow.com/questions/194846/is-there-any-kind-of-hashcode-function-in-javascript
+ var classname = "SpanishStemmer";
+ var hash = 0;
+ if (classname.length == 0) return hash;
+ for (var i = 0; i < classname.length; i++) {
+ var char = classname.charCodeAt(i);
+ hash = ((hash << 5) - hash) + char;
+ hash = hash & hash; // Convert to 32bit integer
+ }
+ return hash;
+ }
+
+}
+
diff --git a/web/server/h2o/libh2o/misc/oktavia/src/stemmer/stemmer.jsx b/web/server/h2o/libh2o/misc/oktavia/src/stemmer/stemmer.jsx
new file mode 100644
index 00000000..43bd75fa
--- /dev/null
+++ b/web/server/h2o/libh2o/misc/oktavia/src/stemmer/stemmer.jsx
@@ -0,0 +1,5 @@
+interface Stemmer
+{
+ function stemWord (word : string) : string;
+ function stemWords (words : string[]) : string[];
+}
diff --git a/web/server/h2o/libh2o/misc/oktavia/src/stemmer/swedish-stemmer.jsx b/web/server/h2o/libh2o/misc/oktavia/src/stemmer/swedish-stemmer.jsx
new file mode 100644
index 00000000..536094ae
--- /dev/null
+++ b/web/server/h2o/libh2o/misc/oktavia/src/stemmer/swedish-stemmer.jsx
@@ -0,0 +1,416 @@
+// This file was generated automatically by the Snowball to JSX compiler
+
+import "base-stemmer.jsx";
+import "among.jsx";
+
+ /**
+ * This class was automatically generated by a Snowball to JSX compiler
+ * It implements the stemming algorithm defined by a snowball script.
+ */
+
+class SwedishStemmer extends BaseStemmer
+{
+ static const serialVersionUID = 1;
+ static const methodObject = new SwedishStemmer();
+
+ static const a_0 = [
+ new Among("a", -1, 1),
+ new Among("arna", 0, 1),
+ new Among("erna", 0, 1),
+ new Among("heterna", 2, 1),
+ new Among("orna", 0, 1),
+ new Among("ad", -1, 1),
+ new Among("e", -1, 1),
+ new Among("ade", 6, 1),
+ new Among("ande", 6, 1),
+ new Among("arne", 6, 1),
+ new Among("are", 6, 1),
+ new Among("aste", 6, 1),
+ new Among("en", -1, 1),
+ new Among("anden", 12, 1),
+ new Among("aren", 12, 1),
+ new Among("heten", 12, 1),
+ new Among("ern", -1, 1),
+ new Among("ar", -1, 1),
+ new Among("er", -1, 1),
+ new Among("heter", 18, 1),
+ new Among("or", -1, 1),
+ new Among("s", -1, 2),
+ new Among("as", 21, 1),
+ new Among("arnas", 22, 1),
+ new Among("ernas", 22, 1),
+ new Among("ornas", 22, 1),
+ new Among("es", 21, 1),
+ new Among("ades", 26, 1),
+ new Among("andes", 26, 1),
+ new Among("ens", 21, 1),
+ new Among("arens", 29, 1),
+ new Among("hetens", 29, 1),
+ new Among("erns", 21, 1),
+ new Among("at", -1, 1),
+ new Among("andet", -1, 1),
+ new Among("het", -1, 1),
+ new Among("ast", -1, 1)
+ ];
+
+ static const a_1 = [
+ new Among("dd", -1, -1),
+ new Among("gd", -1, -1),
+ new Among("nn", -1, -1),
+ new Among("dt", -1, -1),
+ new Among("gt", -1, -1),
+ new Among("kt", -1, -1),
+ new Among("tt", -1, -1)
+ ];
+
+ static const a_2 = [
+ new Among("ig", -1, 1),
+ new Among("lig", 0, 1),
+ new Among("els", -1, 1),
+ new Among("fullt", -1, 3),
+ new Among("l\u00F6st", -1, 2)
+ ];
+
+ static const g_v = [17, 65, 16, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 24, 0, 32] : int[];
+
+ static const g_s_ending = [119, 127, 149] : int[];
+
+ var I_x : int = 0;
+ var I_p1 : int = 0;
+
+ function copy_from (other : SwedishStemmer) : void
+ {
+ this.I_x = other.I_x;
+ this.I_p1 = other.I_p1;
+ super.copy_from(other);
+ }
+
+ function r_mark_regions () : boolean
+ {
+ var v_1 : int;
+ var v_2 : int;
+ // (, line 26
+ this.I_p1 = this.limit;
+ // test, line 29
+ v_1 = this.cursor;
+ // (, line 29
+ // hop, line 29
+ {
+ var c : int = this.cursor + 3;
+ if (0 > c || c > this.limit)
+ {
+ return false;
+ }
+ this.cursor = c;
+ }
+ // setmark x, line 29
+ this.I_x = this.cursor;
+ this.cursor = v_1;
+ // goto, line 30
+ golab0: while(true)
+ {
+ v_2 = this.cursor;
+ var lab1 = true;
+ lab1: while (lab1 == true)
+ {
+ lab1 = false;
+ if (!(this.in_grouping(SwedishStemmer.g_v, 97, 246)))
+ {
+ break lab1;
+ }
+ this.cursor = v_2;
+ break golab0;
+ }
+ this.cursor = v_2;
+ if (this.cursor >= this.limit)
+ {
+ return false;
+ }
+ this.cursor++;
+ }
+ // gopast, line 30
+ golab2: while(true)
+ {
+ var lab3 = true;
+ lab3: while (lab3 == true)
+ {
+ lab3 = false;
+ if (!(this.out_grouping(SwedishStemmer.g_v, 97, 246)))
+ {
+ break lab3;
+ }
+ break golab2;
+ }
+ if (this.cursor >= this.limit)
+ {
+ return false;
+ }
+ this.cursor++;
+ }
+ // setmark p1, line 30
+ this.I_p1 = this.cursor;
+ // try, line 31
+ var lab4 = true;
+ lab4: while (lab4 == true)
+ {
+ lab4 = false;
+ // (, line 31
+ if (!(this.I_p1 < this.I_x))
+ {
+ break lab4;
+ }
+ this.I_p1 = this.I_x;
+ }
+ return true;
+ }
+
+ function r_main_suffix () : boolean
+ {
+ var among_var : int;
+ var v_1 : int;
+ var v_2 : int;
+ // (, line 36
+ // setlimit, line 37
+ v_1 = this.limit - this.cursor;
+ // tomark, line 37
+ if (this.cursor < this.I_p1)
+ {
+ return false;
+ }
+ this.cursor = this.I_p1;
+ v_2 = this.limit_backward;
+ this.limit_backward = this.cursor;
+ this.cursor = this.limit - v_1;
+ // (, line 37
+ // [, line 37
+ this.ket = this.cursor;
+ // substring, line 37
+ among_var = this.find_among_b(SwedishStemmer.a_0, 37);
+ if (among_var == 0)
+ {
+ this.limit_backward = v_2;
+ return false;
+ }
+ // ], line 37
+ this.bra = this.cursor;
+ this.limit_backward = v_2;
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ // (, line 44
+ // delete, line 44
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ break;
+ case 2:
+ // (, line 46
+ if (!(this.in_grouping_b(SwedishStemmer.g_s_ending, 98, 121)))
+ {
+ return false;
+ }
+ // delete, line 46
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ break;
+ }
+ return true;
+ }
+
+ function r_consonant_pair () : boolean
+ {
+ var v_1 : int;
+ var v_2 : int;
+ var v_3 : int;
+ // setlimit, line 50
+ v_1 = this.limit - this.cursor;
+ // tomark, line 50
+ if (this.cursor < this.I_p1)
+ {
+ return false;
+ }
+ this.cursor = this.I_p1;
+ v_2 = this.limit_backward;
+ this.limit_backward = this.cursor;
+ this.cursor = this.limit - v_1;
+ // (, line 50
+ // and, line 52
+ v_3 = this.limit - this.cursor;
+ // among, line 51
+ if (this.find_among_b(SwedishStemmer.a_1, 7) == 0)
+ {
+ this.limit_backward = v_2;
+ return false;
+ }
+ this.cursor = this.limit - v_3;
+ // (, line 52
+ // [, line 52
+ this.ket = this.cursor;
+ // next, line 52
+ if (this.cursor <= this.limit_backward)
+ {
+ this.limit_backward = v_2;
+ return false;
+ }
+ this.cursor--;
+ // ], line 52
+ this.bra = this.cursor;
+ // delete, line 52
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ this.limit_backward = v_2;
+ return true;
+ }
+
+ function r_other_suffix () : boolean
+ {
+ var among_var : int;
+ var v_1 : int;
+ var v_2 : int;
+ // setlimit, line 55
+ v_1 = this.limit - this.cursor;
+ // tomark, line 55
+ if (this.cursor < this.I_p1)
+ {
+ return false;
+ }
+ this.cursor = this.I_p1;
+ v_2 = this.limit_backward;
+ this.limit_backward = this.cursor;
+ this.cursor = this.limit - v_1;
+ // (, line 55
+ // [, line 56
+ this.ket = this.cursor;
+ // substring, line 56
+ among_var = this.find_among_b(SwedishStemmer.a_2, 5);
+ if (among_var == 0)
+ {
+ this.limit_backward = v_2;
+ return false;
+ }
+ // ], line 56
+ this.bra = this.cursor;
+ switch (among_var) {
+ case 0:
+ this.limit_backward = v_2;
+ return false;
+ case 1:
+ // (, line 57
+ // delete, line 57
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ break;
+ case 2:
+ // (, line 58
+ // <-, line 58
+ if (!this.slice_from("l\u00F6s"))
+ {
+ return false;
+ }
+ break;
+ case 3:
+ // (, line 59
+ // <-, line 59
+ if (!this.slice_from("full"))
+ {
+ return false;
+ }
+ break;
+ }
+ this.limit_backward = v_2;
+ return true;
+ }
+
+ override function stem () : boolean
+ {
+ var v_1 : int;
+ var v_2 : int;
+ var v_3 : int;
+ var v_4 : int;
+ // (, line 64
+ // do, line 66
+ v_1 = this.cursor;
+ var lab0 = true;
+ lab0: while (lab0 == true)
+ {
+ lab0 = false;
+ // call mark_regions, line 66
+ if (!this.r_mark_regions())
+ {
+ break lab0;
+ }
+ }
+ this.cursor = v_1;
+ // backwards, line 67
+ this.limit_backward = this.cursor; this.cursor = this.limit;
+ // (, line 67
+ // do, line 68
+ v_2 = this.limit - this.cursor;
+ var lab1 = true;
+ lab1: while (lab1 == true)
+ {
+ lab1 = false;
+ // call main_suffix, line 68
+ if (!this.r_main_suffix())
+ {
+ break lab1;
+ }
+ }
+ this.cursor = this.limit - v_2;
+ // do, line 69
+ v_3 = this.limit - this.cursor;
+ var lab2 = true;
+ lab2: while (lab2 == true)
+ {
+ lab2 = false;
+ // call consonant_pair, line 69
+ if (!this.r_consonant_pair())
+ {
+ break lab2;
+ }
+ }
+ this.cursor = this.limit - v_3;
+ // do, line 70
+ v_4 = this.limit - this.cursor;
+ var lab3 = true;
+ lab3: while (lab3 == true)
+ {
+ lab3 = false;
+ // call other_suffix, line 70
+ if (!this.r_other_suffix())
+ {
+ break lab3;
+ }
+ }
+ this.cursor = this.limit - v_4;
+ this.cursor = this.limit_backward; return true;
+ }
+
+ function equals (o : variant) : boolean {
+ return o instanceof SwedishStemmer;
+ }
+
+ function hashCode() : int
+ {
+ //http://stackoverflow.com/questions/194846/is-there-any-kind-of-hashcode-function-in-javascript
+ var classname = "SwedishStemmer";
+ var hash = 0;
+ if (classname.length == 0) return hash;
+ for (var i = 0; i < classname.length; i++) {
+ var char = classname.charCodeAt(i);
+ hash = ((hash << 5) - hash) + char;
+ hash = hash & hash; // Convert to 32bit integer
+ }
+ return hash;
+ }
+
+}
+
diff --git a/web/server/h2o/libh2o/misc/oktavia/src/stemmer/turkish-stemmer.jsx b/web/server/h2o/libh2o/misc/oktavia/src/stemmer/turkish-stemmer.jsx
new file mode 100644
index 00000000..d26ed8ba
--- /dev/null
+++ b/web/server/h2o/libh2o/misc/oktavia/src/stemmer/turkish-stemmer.jsx
@@ -0,0 +1,3824 @@
+// This file was generated automatically by the Snowball to JSX compiler
+
+import "base-stemmer.jsx";
+import "among.jsx";
+
+ /**
+ * This class was automatically generated by a Snowball to JSX compiler
+ * It implements the stemming algorithm defined by a snowball script.
+ */
+
+class TurkishStemmer extends BaseStemmer
+{
+ static const serialVersionUID = 1;
+ static const methodObject = new TurkishStemmer();
+
+ static const a_0 = [
+ new Among("m", -1, -1),
+ new Among("n", -1, -1),
+ new Among("miz", -1, -1),
+ new Among("niz", -1, -1),
+ new Among("muz", -1, -1),
+ new Among("nuz", -1, -1),
+ new Among("m\u00FCz", -1, -1),
+ new Among("n\u00FCz", -1, -1),
+ new Among("m\u0131z", -1, -1),
+ new Among("n\u0131z", -1, -1)
+ ];
+
+ static const a_1 = [
+ new Among("leri", -1, -1),
+ new Among("lar\u0131", -1, -1)
+ ];
+
+ static const a_2 = [
+ new Among("ni", -1, -1),
+ new Among("nu", -1, -1),
+ new Among("n\u00FC", -1, -1),
+ new Among("n\u0131", -1, -1)
+ ];
+
+ static const a_3 = [
+ new Among("in", -1, -1),
+ new Among("un", -1, -1),
+ new Among("\u00FCn", -1, -1),
+ new Among("\u0131n", -1, -1)
+ ];
+
+ static const a_4 = [
+ new Among("a", -1, -1),
+ new Among("e", -1, -1)
+ ];
+
+ static const a_5 = [
+ new Among("na", -1, -1),
+ new Among("ne", -1, -1)
+ ];
+
+ static const a_6 = [
+ new Among("da", -1, -1),
+ new Among("ta", -1, -1),
+ new Among("de", -1, -1),
+ new Among("te", -1, -1)
+ ];
+
+ static const a_7 = [
+ new Among("nda", -1, -1),
+ new Among("nde", -1, -1)
+ ];
+
+ static const a_8 = [
+ new Among("dan", -1, -1),
+ new Among("tan", -1, -1),
+ new Among("den", -1, -1),
+ new Among("ten", -1, -1)
+ ];
+
+ static const a_9 = [
+ new Among("ndan", -1, -1),
+ new Among("nden", -1, -1)
+ ];
+
+ static const a_10 = [
+ new Among("la", -1, -1),
+ new Among("le", -1, -1)
+ ];
+
+ static const a_11 = [
+ new Among("ca", -1, -1),
+ new Among("ce", -1, -1)
+ ];
+
+ static const a_12 = [
+ new Among("im", -1, -1),
+ new Among("um", -1, -1),
+ new Among("\u00FCm", -1, -1),
+ new Among("\u0131m", -1, -1)
+ ];
+
+ static const a_13 = [
+ new Among("sin", -1, -1),
+ new Among("sun", -1, -1),
+ new Among("s\u00FCn", -1, -1),
+ new Among("s\u0131n", -1, -1)
+ ];
+
+ static const a_14 = [
+ new Among("iz", -1, -1),
+ new Among("uz", -1, -1),
+ new Among("\u00FCz", -1, -1),
+ new Among("\u0131z", -1, -1)
+ ];
+
+ static const a_15 = [
+ new Among("siniz", -1, -1),
+ new Among("sunuz", -1, -1),
+ new Among("s\u00FCn\u00FCz", -1, -1),
+ new Among("s\u0131n\u0131z", -1, -1)
+ ];
+
+ static const a_16 = [
+ new Among("lar", -1, -1),
+ new Among("ler", -1, -1)
+ ];
+
+ static const a_17 = [
+ new Among("niz", -1, -1),
+ new Among("nuz", -1, -1),
+ new Among("n\u00FCz", -1, -1),
+ new Among("n\u0131z", -1, -1)
+ ];
+
+ static const a_18 = [
+ new Among("dir", -1, -1),
+ new Among("tir", -1, -1),
+ new Among("dur", -1, -1),
+ new Among("tur", -1, -1),
+ new Among("d\u00FCr", -1, -1),
+ new Among("t\u00FCr", -1, -1),
+ new Among("d\u0131r", -1, -1),
+ new Among("t\u0131r", -1, -1)
+ ];
+
+ static const a_19 = [
+ new Among("cas\u0131na", -1, -1),
+ new Among("cesine", -1, -1)
+ ];
+
+ static const a_20 = [
+ new Among("di", -1, -1),
+ new Among("ti", -1, -1),
+ new Among("dik", -1, -1),
+ new Among("tik", -1, -1),
+ new Among("duk", -1, -1),
+ new Among("tuk", -1, -1),
+ new Among("d\u00FCk", -1, -1),
+ new Among("t\u00FCk", -1, -1),
+ new Among("d\u0131k", -1, -1),
+ new Among("t\u0131k", -1, -1),
+ new Among("dim", -1, -1),
+ new Among("tim", -1, -1),
+ new Among("dum", -1, -1),
+ new Among("tum", -1, -1),
+ new Among("d\u00FCm", -1, -1),
+ new Among("t\u00FCm", -1, -1),
+ new Among("d\u0131m", -1, -1),
+ new Among("t\u0131m", -1, -1),
+ new Among("din", -1, -1),
+ new Among("tin", -1, -1),
+ new Among("dun", -1, -1),
+ new Among("tun", -1, -1),
+ new Among("d\u00FCn", -1, -1),
+ new Among("t\u00FCn", -1, -1),
+ new Among("d\u0131n", -1, -1),
+ new Among("t\u0131n", -1, -1),
+ new Among("du", -1, -1),
+ new Among("tu", -1, -1),
+ new Among("d\u00FC", -1, -1),
+ new Among("t\u00FC", -1, -1),
+ new Among("d\u0131", -1, -1),
+ new Among("t\u0131", -1, -1)
+ ];
+
+ static const a_21 = [
+ new Among("sa", -1, -1),
+ new Among("se", -1, -1),
+ new Among("sak", -1, -1),
+ new Among("sek", -1, -1),
+ new Among("sam", -1, -1),
+ new Among("sem", -1, -1),
+ new Among("san", -1, -1),
+ new Among("sen", -1, -1)
+ ];
+
+ static const a_22 = [
+ new Among("mi\u015F", -1, -1),
+ new Among("mu\u015F", -1, -1),
+ new Among("m\u00FC\u015F", -1, -1),
+ new Among("m\u0131\u015F", -1, -1)
+ ];
+
+ static const a_23 = [
+ new Among("b", -1, 1),
+ new Among("c", -1, 2),
+ new Among("d", -1, 3),
+ new Among("\u011F", -1, 4)
+ ];
+
+ static const g_vowel = [17, 65, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 8, 0, 0, 0, 0, 0, 0, 1] : int[];
+
+ static const g_U = [1, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 1] : int[];
+
+ static const g_vowel1 = [1, 64, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1] : int[];
+
+ static const g_vowel2 = [17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 130] : int[];
+
+ static const g_vowel3 = [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1] : int[];
+
+ static const g_vowel4 = [17] : int[];
+
+ static const g_vowel5 = [65] : int[];
+
+ static const g_vowel6 = [65] : int[];
+
+ var B_continue_stemming_noun_suffixes : boolean = false;
+ var I_strlen : int = 0;
+
+ function copy_from (other : TurkishStemmer) : void
+ {
+ this.B_continue_stemming_noun_suffixes = other.B_continue_stemming_noun_suffixes;
+ this.I_strlen = other.I_strlen;
+ super.copy_from(other);
+ }
+
+ function r_check_vowel_harmony () : boolean
+ {
+ var v_1 : int;
+ var v_2 : int;
+ var v_3 : int;
+ var v_4 : int;
+ var v_5 : int;
+ var v_6 : int;
+ var v_7 : int;
+ var v_8 : int;
+ var v_9 : int;
+ var v_10 : int;
+ var v_11 : int;
+ // (, line 111
+ // test, line 112
+ v_1 = this.limit - this.cursor;
+ // (, line 113
+ // (, line 114
+ // goto, line 114
+ golab0: while(true)
+ {
+ v_2 = this.limit - this.cursor;
+ var lab1 = true;
+ lab1: while (lab1 == true)
+ {
+ lab1 = false;
+ if (!(this.in_grouping_b(TurkishStemmer.g_vowel, 97, 305)))
+ {
+ break lab1;
+ }
+ this.cursor = this.limit - v_2;
+ break golab0;
+ }
+ this.cursor = this.limit - v_2;
+ if (this.cursor <= this.limit_backward)
+ {
+ return false;
+ }
+ this.cursor--;
+ }
+ // (, line 115
+ // or, line 116
+ var lab2 = true;
+ lab2: while (lab2 == true)
+ {
+ lab2 = false;
+ v_3 = this.limit - this.cursor;
+ var lab3 = true;
+ lab3: while (lab3 == true)
+ {
+ lab3 = false;
+ // (, line 116
+ // literal, line 116
+ if (!(this.eq_s_b(1, "a")))
+ {
+ break lab3;
+ }
+ // goto, line 116
+ golab4: while(true)
+ {
+ v_4 = this.limit - this.cursor;
+ var lab5 = true;
+ lab5: while (lab5 == true)
+ {
+ lab5 = false;
+ if (!(this.in_grouping_b(TurkishStemmer.g_vowel1, 97, 305)))
+ {
+ break lab5;
+ }
+ this.cursor = this.limit - v_4;
+ break golab4;
+ }
+ this.cursor = this.limit - v_4;
+ if (this.cursor <= this.limit_backward)
+ {
+ break lab3;
+ }
+ this.cursor--;
+ }
+ break lab2;
+ }
+ this.cursor = this.limit - v_3;
+ var lab6 = true;
+ lab6: while (lab6 == true)
+ {
+ lab6 = false;
+ // (, line 117
+ // literal, line 117
+ if (!(this.eq_s_b(1, "e")))
+ {
+ break lab6;
+ }
+ // goto, line 117
+ golab7: while(true)
+ {
+ v_5 = this.limit - this.cursor;
+ var lab8 = true;
+ lab8: while (lab8 == true)
+ {
+ lab8 = false;
+ if (!(this.in_grouping_b(TurkishStemmer.g_vowel2, 101, 252)))
+ {
+ break lab8;
+ }
+ this.cursor = this.limit - v_5;
+ break golab7;
+ }
+ this.cursor = this.limit - v_5;
+ if (this.cursor <= this.limit_backward)
+ {
+ break lab6;
+ }
+ this.cursor--;
+ }
+ break lab2;
+ }
+ this.cursor = this.limit - v_3;
+ var lab9 = true;
+ lab9: while (lab9 == true)
+ {
+ lab9 = false;
+ // (, line 118
+ // literal, line 118
+ if (!(this.eq_s_b(1, "\u0131")))
+ {
+ break lab9;
+ }
+ // goto, line 118
+ golab10: while(true)
+ {
+ v_6 = this.limit - this.cursor;
+ var lab11 = true;
+ lab11: while (lab11 == true)
+ {
+ lab11 = false;
+ if (!(this.in_grouping_b(TurkishStemmer.g_vowel3, 97, 305)))
+ {
+ break lab11;
+ }
+ this.cursor = this.limit - v_6;
+ break golab10;
+ }
+ this.cursor = this.limit - v_6;
+ if (this.cursor <= this.limit_backward)
+ {
+ break lab9;
+ }
+ this.cursor--;
+ }
+ break lab2;
+ }
+ this.cursor = this.limit - v_3;
+ var lab12 = true;
+ lab12: while (lab12 == true)
+ {
+ lab12 = false;
+ // (, line 119
+ // literal, line 119
+ if (!(this.eq_s_b(1, "i")))
+ {
+ break lab12;
+ }
+ // goto, line 119
+ golab13: while(true)
+ {
+ v_7 = this.limit - this.cursor;
+ var lab14 = true;
+ lab14: while (lab14 == true)
+ {
+ lab14 = false;
+ if (!(this.in_grouping_b(TurkishStemmer.g_vowel4, 101, 105)))
+ {
+ break lab14;
+ }
+ this.cursor = this.limit - v_7;
+ break golab13;
+ }
+ this.cursor = this.limit - v_7;
+ if (this.cursor <= this.limit_backward)
+ {
+ break lab12;
+ }
+ this.cursor--;
+ }
+ break lab2;
+ }
+ this.cursor = this.limit - v_3;
+ var lab15 = true;
+ lab15: while (lab15 == true)
+ {
+ lab15 = false;
+ // (, line 120
+ // literal, line 120
+ if (!(this.eq_s_b(1, "o")))
+ {
+ break lab15;
+ }
+ // goto, line 120
+ golab16: while(true)
+ {
+ v_8 = this.limit - this.cursor;
+ var lab17 = true;
+ lab17: while (lab17 == true)
+ {
+ lab17 = false;
+ if (!(this.in_grouping_b(TurkishStemmer.g_vowel5, 111, 117)))
+ {
+ break lab17;
+ }
+ this.cursor = this.limit - v_8;
+ break golab16;
+ }
+ this.cursor = this.limit - v_8;
+ if (this.cursor <= this.limit_backward)
+ {
+ break lab15;
+ }
+ this.cursor--;
+ }
+ break lab2;
+ }
+ this.cursor = this.limit - v_3;
+ var lab18 = true;
+ lab18: while (lab18 == true)
+ {
+ lab18 = false;
+ // (, line 121
+ // literal, line 121
+ if (!(this.eq_s_b(1, "\u00F6")))
+ {
+ break lab18;
+ }
+ // goto, line 121
+ golab19: while(true)
+ {
+ v_9 = this.limit - this.cursor;
+ var lab20 = true;
+ lab20: while (lab20 == true)
+ {
+ lab20 = false;
+ if (!(this.in_grouping_b(TurkishStemmer.g_vowel6, 246, 252)))
+ {
+ break lab20;
+ }
+ this.cursor = this.limit - v_9;
+ break golab19;
+ }
+ this.cursor = this.limit - v_9;
+ if (this.cursor <= this.limit_backward)
+ {
+ break lab18;
+ }
+ this.cursor--;
+ }
+ break lab2;
+ }
+ this.cursor = this.limit - v_3;
+ var lab21 = true;
+ lab21: while (lab21 == true)
+ {
+ lab21 = false;
+ // (, line 122
+ // literal, line 122
+ if (!(this.eq_s_b(1, "u")))
+ {
+ break lab21;
+ }
+ // goto, line 122
+ golab22: while(true)
+ {
+ v_10 = this.limit - this.cursor;
+ var lab23 = true;
+ lab23: while (lab23 == true)
+ {
+ lab23 = false;
+ if (!(this.in_grouping_b(TurkishStemmer.g_vowel5, 111, 117)))
+ {
+ break lab23;
+ }
+ this.cursor = this.limit - v_10;
+ break golab22;
+ }
+ this.cursor = this.limit - v_10;
+ if (this.cursor <= this.limit_backward)
+ {
+ break lab21;
+ }
+ this.cursor--;
+ }
+ break lab2;
+ }
+ this.cursor = this.limit - v_3;
+ // (, line 123
+ // literal, line 123
+ if (!(this.eq_s_b(1, "\u00FC")))
+ {
+ return false;
+ }
+ // goto, line 123
+ golab24: while(true)
+ {
+ v_11 = this.limit - this.cursor;
+ var lab25 = true;
+ lab25: while (lab25 == true)
+ {
+ lab25 = false;
+ if (!(this.in_grouping_b(TurkishStemmer.g_vowel6, 246, 252)))
+ {
+ break lab25;
+ }
+ this.cursor = this.limit - v_11;
+ break golab24;
+ }
+ this.cursor = this.limit - v_11;
+ if (this.cursor <= this.limit_backward)
+ {
+ return false;
+ }
+ this.cursor--;
+ }
+ }
+ this.cursor = this.limit - v_1;
+ return true;
+ }
+
+ function r_mark_suffix_with_optional_n_consonant () : boolean
+ {
+ var v_1 : int;
+ var v_2 : int;
+ var v_3 : int;
+ var v_4 : int;
+ var v_5 : int;
+ var v_6 : int;
+ var v_7 : int;
+ // (, line 132
+ // or, line 134
+ var lab0 = true;
+ lab0: while (lab0 == true)
+ {
+ lab0 = false;
+ v_1 = this.limit - this.cursor;
+ var lab1 = true;
+ lab1: while (lab1 == true)
+ {
+ lab1 = false;
+ // (, line 133
+ // (, line 133
+ // test, line 133
+ v_2 = this.limit - this.cursor;
+ // literal, line 133
+ if (!(this.eq_s_b(1, "n")))
+ {
+ break lab1;
+ }
+ this.cursor = this.limit - v_2;
+ // next, line 133
+ if (this.cursor <= this.limit_backward)
+ {
+ break lab1;
+ }
+ this.cursor--;
+ // (, line 133
+ // test, line 133
+ v_3 = this.limit - this.cursor;
+ if (!(this.in_grouping_b(TurkishStemmer.g_vowel, 97, 305)))
+ {
+ break lab1;
+ }
+ this.cursor = this.limit - v_3;
+ break lab0;
+ }
+ this.cursor = this.limit - v_1;
+ // (, line 135
+ // (, line 135
+ // not, line 135
+ {
+ v_4 = this.limit - this.cursor;
+ var lab2 = true;
+ lab2: while (lab2 == true)
+ {
+ lab2 = false;
+ // (, line 135
+ // test, line 135
+ v_5 = this.limit - this.cursor;
+ // literal, line 135
+ if (!(this.eq_s_b(1, "n")))
+ {
+ break lab2;
+ }
+ this.cursor = this.limit - v_5;
+ return false;
+ }
+ this.cursor = this.limit - v_4;
+ }
+ // test, line 135
+ v_6 = this.limit - this.cursor;
+ // (, line 135
+ // next, line 135
+ if (this.cursor <= this.limit_backward)
+ {
+ return false;
+ }
+ this.cursor--;
+ // (, line 135
+ // test, line 135
+ v_7 = this.limit - this.cursor;
+ if (!(this.in_grouping_b(TurkishStemmer.g_vowel, 97, 305)))
+ {
+ return false;
+ }
+ this.cursor = this.limit - v_7;
+ this.cursor = this.limit - v_6;
+ }
+ return true;
+ }
+
+ function r_mark_suffix_with_optional_s_consonant () : boolean
+ {
+ var v_1 : int;
+ var v_2 : int;
+ var v_3 : int;
+ var v_4 : int;
+ var v_5 : int;
+ var v_6 : int;
+ var v_7 : int;
+ // (, line 143
+ // or, line 145
+ var lab0 = true;
+ lab0: while (lab0 == true)
+ {
+ lab0 = false;
+ v_1 = this.limit - this.cursor;
+ var lab1 = true;
+ lab1: while (lab1 == true)
+ {
+ lab1 = false;
+ // (, line 144
+ // (, line 144
+ // test, line 144
+ v_2 = this.limit - this.cursor;
+ // literal, line 144
+ if (!(this.eq_s_b(1, "s")))
+ {
+ break lab1;
+ }
+ this.cursor = this.limit - v_2;
+ // next, line 144
+ if (this.cursor <= this.limit_backward)
+ {
+ break lab1;
+ }
+ this.cursor--;
+ // (, line 144
+ // test, line 144
+ v_3 = this.limit - this.cursor;
+ if (!(this.in_grouping_b(TurkishStemmer.g_vowel, 97, 305)))
+ {
+ break lab1;
+ }
+ this.cursor = this.limit - v_3;
+ break lab0;
+ }
+ this.cursor = this.limit - v_1;
+ // (, line 146
+ // (, line 146
+ // not, line 146
+ {
+ v_4 = this.limit - this.cursor;
+ var lab2 = true;
+ lab2: while (lab2 == true)
+ {
+ lab2 = false;
+ // (, line 146
+ // test, line 146
+ v_5 = this.limit - this.cursor;
+ // literal, line 146
+ if (!(this.eq_s_b(1, "s")))
+ {
+ break lab2;
+ }
+ this.cursor = this.limit - v_5;
+ return false;
+ }
+ this.cursor = this.limit - v_4;
+ }
+ // test, line 146
+ v_6 = this.limit - this.cursor;
+ // (, line 146
+ // next, line 146
+ if (this.cursor <= this.limit_backward)
+ {
+ return false;
+ }
+ this.cursor--;
+ // (, line 146
+ // test, line 146
+ v_7 = this.limit - this.cursor;
+ if (!(this.in_grouping_b(TurkishStemmer.g_vowel, 97, 305)))
+ {
+ return false;
+ }
+ this.cursor = this.limit - v_7;
+ this.cursor = this.limit - v_6;
+ }
+ return true;
+ }
+
+ function r_mark_suffix_with_optional_y_consonant () : boolean
+ {
+ var v_1 : int;
+ var v_2 : int;
+ var v_3 : int;
+ var v_4 : int;
+ var v_5 : int;
+ var v_6 : int;
+ var v_7 : int;
+ // (, line 153
+ // or, line 155
+ var lab0 = true;
+ lab0: while (lab0 == true)
+ {
+ lab0 = false;
+ v_1 = this.limit - this.cursor;
+ var lab1 = true;
+ lab1: while (lab1 == true)
+ {
+ lab1 = false;
+ // (, line 154
+ // (, line 154
+ // test, line 154
+ v_2 = this.limit - this.cursor;
+ // literal, line 154
+ if (!(this.eq_s_b(1, "y")))
+ {
+ break lab1;
+ }
+ this.cursor = this.limit - v_2;
+ // next, line 154
+ if (this.cursor <= this.limit_backward)
+ {
+ break lab1;
+ }
+ this.cursor--;
+ // (, line 154
+ // test, line 154
+ v_3 = this.limit - this.cursor;
+ if (!(this.in_grouping_b(TurkishStemmer.g_vowel, 97, 305)))
+ {
+ break lab1;
+ }
+ this.cursor = this.limit - v_3;
+ break lab0;
+ }
+ this.cursor = this.limit - v_1;
+ // (, line 156
+ // (, line 156
+ // not, line 156
+ {
+ v_4 = this.limit - this.cursor;
+ var lab2 = true;
+ lab2: while (lab2 == true)
+ {
+ lab2 = false;
+ // (, line 156
+ // test, line 156
+ v_5 = this.limit - this.cursor;
+ // literal, line 156
+ if (!(this.eq_s_b(1, "y")))
+ {
+ break lab2;
+ }
+ this.cursor = this.limit - v_5;
+ return false;
+ }
+ this.cursor = this.limit - v_4;
+ }
+ // test, line 156
+ v_6 = this.limit - this.cursor;
+ // (, line 156
+ // next, line 156
+ if (this.cursor <= this.limit_backward)
+ {
+ return false;
+ }
+ this.cursor--;
+ // (, line 156
+ // test, line 156
+ v_7 = this.limit - this.cursor;
+ if (!(this.in_grouping_b(TurkishStemmer.g_vowel, 97, 305)))
+ {
+ return false;
+ }
+ this.cursor = this.limit - v_7;
+ this.cursor = this.limit - v_6;
+ }
+ return true;
+ }
+
+ function r_mark_suffix_with_optional_U_vowel () : boolean
+ {
+ var v_1 : int;
+ var v_2 : int;
+ var v_3 : int;
+ var v_4 : int;
+ var v_5 : int;
+ var v_6 : int;
+ var v_7 : int;
+ // (, line 159
+ // or, line 161
+ var lab0 = true;
+ lab0: while (lab0 == true)
+ {
+ lab0 = false;
+ v_1 = this.limit - this.cursor;
+ var lab1 = true;
+ lab1: while (lab1 == true)
+ {
+ lab1 = false;
+ // (, line 160
+ // (, line 160
+ // test, line 160
+ v_2 = this.limit - this.cursor;
+ if (!(this.in_grouping_b(TurkishStemmer.g_U, 105, 305)))
+ {
+ break lab1;
+ }
+ this.cursor = this.limit - v_2;
+ // next, line 160
+ if (this.cursor <= this.limit_backward)
+ {
+ break lab1;
+ }
+ this.cursor--;
+ // (, line 160
+ // test, line 160
+ v_3 = this.limit - this.cursor;
+ if (!(this.out_grouping_b(TurkishStemmer.g_vowel, 97, 305)))
+ {
+ break lab1;
+ }
+ this.cursor = this.limit - v_3;
+ break lab0;
+ }
+ this.cursor = this.limit - v_1;
+ // (, line 162
+ // (, line 162
+ // not, line 162
+ {
+ v_4 = this.limit - this.cursor;
+ var lab2 = true;
+ lab2: while (lab2 == true)
+ {
+ lab2 = false;
+ // (, line 162
+ // test, line 162
+ v_5 = this.limit - this.cursor;
+ if (!(this.in_grouping_b(TurkishStemmer.g_U, 105, 305)))
+ {
+ break lab2;
+ }
+ this.cursor = this.limit - v_5;
+ return false;
+ }
+ this.cursor = this.limit - v_4;
+ }
+ // test, line 162
+ v_6 = this.limit - this.cursor;
+ // (, line 162
+ // next, line 162
+ if (this.cursor <= this.limit_backward)
+ {
+ return false;
+ }
+ this.cursor--;
+ // (, line 162
+ // test, line 162
+ v_7 = this.limit - this.cursor;
+ if (!(this.out_grouping_b(TurkishStemmer.g_vowel, 97, 305)))
+ {
+ return false;
+ }
+ this.cursor = this.limit - v_7;
+ this.cursor = this.limit - v_6;
+ }
+ return true;
+ }
+
+ function r_mark_possessives () : boolean
+ {
+ // (, line 166
+ // among, line 167
+ if (this.find_among_b(TurkishStemmer.a_0, 10) == 0)
+ {
+ return false;
+ }
+ // (, line 169
+ // call mark_suffix_with_optional_U_vowel, line 169
+ if (!this.r_mark_suffix_with_optional_U_vowel())
+ {
+ return false;
+ }
+ return true;
+ }
+
+ function r_mark_sU () : boolean
+ {
+ // (, line 172
+ // call check_vowel_harmony, line 173
+ if (!this.r_check_vowel_harmony())
+ {
+ return false;
+ }
+ if (!(this.in_grouping_b(TurkishStemmer.g_U, 105, 305)))
+ {
+ return false;
+ }
+ // (, line 175
+ // call mark_suffix_with_optional_s_consonant, line 175
+ if (!this.r_mark_suffix_with_optional_s_consonant())
+ {
+ return false;
+ }
+ return true;
+ }
+
+ function r_mark_lArI () : boolean
+ {
+ // (, line 178
+ // among, line 179
+ if (this.find_among_b(TurkishStemmer.a_1, 2) == 0)
+ {
+ return false;
+ }
+ return true;
+ }
+
+ function r_mark_yU () : boolean
+ {
+ // (, line 182
+ // call check_vowel_harmony, line 183
+ if (!this.r_check_vowel_harmony())
+ {
+ return false;
+ }
+ if (!(this.in_grouping_b(TurkishStemmer.g_U, 105, 305)))
+ {
+ return false;
+ }
+ // (, line 185
+ // call mark_suffix_with_optional_y_consonant, line 185
+ if (!this.r_mark_suffix_with_optional_y_consonant())
+ {
+ return false;
+ }
+ return true;
+ }
+
+ function r_mark_nU () : boolean
+ {
+ // (, line 188
+ // call check_vowel_harmony, line 189
+ if (!this.r_check_vowel_harmony())
+ {
+ return false;
+ }
+ // among, line 190
+ if (this.find_among_b(TurkishStemmer.a_2, 4) == 0)
+ {
+ return false;
+ }
+ return true;
+ }
+
+ function r_mark_nUn () : boolean
+ {
+ // (, line 193
+ // call check_vowel_harmony, line 194
+ if (!this.r_check_vowel_harmony())
+ {
+ return false;
+ }
+ // among, line 195
+ if (this.find_among_b(TurkishStemmer.a_3, 4) == 0)
+ {
+ return false;
+ }
+ // (, line 196
+ // call mark_suffix_with_optional_n_consonant, line 196
+ if (!this.r_mark_suffix_with_optional_n_consonant())
+ {
+ return false;
+ }
+ return true;
+ }
+
+ function r_mark_yA () : boolean
+ {
+ // (, line 199
+ // call check_vowel_harmony, line 200
+ if (!this.r_check_vowel_harmony())
+ {
+ return false;
+ }
+ // among, line 201
+ if (this.find_among_b(TurkishStemmer.a_4, 2) == 0)
+ {
+ return false;
+ }
+ // (, line 202
+ // call mark_suffix_with_optional_y_consonant, line 202
+ if (!this.r_mark_suffix_with_optional_y_consonant())
+ {
+ return false;
+ }
+ return true;
+ }
+
+ function r_mark_nA () : boolean
+ {
+ // (, line 205
+ // call check_vowel_harmony, line 206
+ if (!this.r_check_vowel_harmony())
+ {
+ return false;
+ }
+ // among, line 207
+ if (this.find_among_b(TurkishStemmer.a_5, 2) == 0)
+ {
+ return false;
+ }
+ return true;
+ }
+
+ function r_mark_DA () : boolean
+ {
+ // (, line 210
+ // call check_vowel_harmony, line 211
+ if (!this.r_check_vowel_harmony())
+ {
+ return false;
+ }
+ // among, line 212
+ if (this.find_among_b(TurkishStemmer.a_6, 4) == 0)
+ {
+ return false;
+ }
+ return true;
+ }
+
+ function r_mark_ndA () : boolean
+ {
+ // (, line 215
+ // call check_vowel_harmony, line 216
+ if (!this.r_check_vowel_harmony())
+ {
+ return false;
+ }
+ // among, line 217
+ if (this.find_among_b(TurkishStemmer.a_7, 2) == 0)
+ {
+ return false;
+ }
+ return true;
+ }
+
+ function r_mark_DAn () : boolean
+ {
+ // (, line 220
+ // call check_vowel_harmony, line 221
+ if (!this.r_check_vowel_harmony())
+ {
+ return false;
+ }
+ // among, line 222
+ if (this.find_among_b(TurkishStemmer.a_8, 4) == 0)
+ {
+ return false;
+ }
+ return true;
+ }
+
+ function r_mark_ndAn () : boolean
+ {
+ // (, line 225
+ // call check_vowel_harmony, line 226
+ if (!this.r_check_vowel_harmony())
+ {
+ return false;
+ }
+ // among, line 227
+ if (this.find_among_b(TurkishStemmer.a_9, 2) == 0)
+ {
+ return false;
+ }
+ return true;
+ }
+
+ function r_mark_ylA () : boolean
+ {
+ // (, line 230
+ // call check_vowel_harmony, line 231
+ if (!this.r_check_vowel_harmony())
+ {
+ return false;
+ }
+ // among, line 232
+ if (this.find_among_b(TurkishStemmer.a_10, 2) == 0)
+ {
+ return false;
+ }
+ // (, line 233
+ // call mark_suffix_with_optional_y_consonant, line 233
+ if (!this.r_mark_suffix_with_optional_y_consonant())
+ {
+ return false;
+ }
+ return true;
+ }
+
+ function r_mark_ki () : boolean
+ {
+ // (, line 236
+ // literal, line 237
+ if (!(this.eq_s_b(2, "ki")))
+ {
+ return false;
+ }
+ return true;
+ }
+
+ function r_mark_ncA () : boolean
+ {
+ // (, line 240
+ // call check_vowel_harmony, line 241
+ if (!this.r_check_vowel_harmony())
+ {
+ return false;
+ }
+ // among, line 242
+ if (this.find_among_b(TurkishStemmer.a_11, 2) == 0)
+ {
+ return false;
+ }
+ // (, line 243
+ // call mark_suffix_with_optional_n_consonant, line 243
+ if (!this.r_mark_suffix_with_optional_n_consonant())
+ {
+ return false;
+ }
+ return true;
+ }
+
+ function r_mark_yUm () : boolean
+ {
+ // (, line 246
+ // call check_vowel_harmony, line 247
+ if (!this.r_check_vowel_harmony())
+ {
+ return false;
+ }
+ // among, line 248
+ if (this.find_among_b(TurkishStemmer.a_12, 4) == 0)
+ {
+ return false;
+ }
+ // (, line 249
+ // call mark_suffix_with_optional_y_consonant, line 249
+ if (!this.r_mark_suffix_with_optional_y_consonant())
+ {
+ return false;
+ }
+ return true;
+ }
+
+ function r_mark_sUn () : boolean
+ {
+ // (, line 252
+ // call check_vowel_harmony, line 253
+ if (!this.r_check_vowel_harmony())
+ {
+ return false;
+ }
+ // among, line 254
+ if (this.find_among_b(TurkishStemmer.a_13, 4) == 0)
+ {
+ return false;
+ }
+ return true;
+ }
+
+ function r_mark_yUz () : boolean
+ {
+ // (, line 257
+ // call check_vowel_harmony, line 258
+ if (!this.r_check_vowel_harmony())
+ {
+ return false;
+ }
+ // among, line 259
+ if (this.find_among_b(TurkishStemmer.a_14, 4) == 0)
+ {
+ return false;
+ }
+ // (, line 260
+ // call mark_suffix_with_optional_y_consonant, line 260
+ if (!this.r_mark_suffix_with_optional_y_consonant())
+ {
+ return false;
+ }
+ return true;
+ }
+
+ function r_mark_sUnUz () : boolean
+ {
+ // (, line 263
+ // among, line 264
+ if (this.find_among_b(TurkishStemmer.a_15, 4) == 0)
+ {
+ return false;
+ }
+ return true;
+ }
+
+ function r_mark_lAr () : boolean
+ {
+ // (, line 267
+ // call check_vowel_harmony, line 268
+ if (!this.r_check_vowel_harmony())
+ {
+ return false;
+ }
+ // among, line 269
+ if (this.find_among_b(TurkishStemmer.a_16, 2) == 0)
+ {
+ return false;
+ }
+ return true;
+ }
+
+ function r_mark_nUz () : boolean
+ {
+ // (, line 272
+ // call check_vowel_harmony, line 273
+ if (!this.r_check_vowel_harmony())
+ {
+ return false;
+ }
+ // among, line 274
+ if (this.find_among_b(TurkishStemmer.a_17, 4) == 0)
+ {
+ return false;
+ }
+ return true;
+ }
+
+ function r_mark_DUr () : boolean
+ {
+ // (, line 277
+ // call check_vowel_harmony, line 278
+ if (!this.r_check_vowel_harmony())
+ {
+ return false;
+ }
+ // among, line 279
+ if (this.find_among_b(TurkishStemmer.a_18, 8) == 0)
+ {
+ return false;
+ }
+ return true;
+ }
+
+ function r_mark_cAsInA () : boolean
+ {
+ // (, line 282
+ // among, line 283
+ if (this.find_among_b(TurkishStemmer.a_19, 2) == 0)
+ {
+ return false;
+ }
+ return true;
+ }
+
+ function r_mark_yDU () : boolean
+ {
+ // (, line 286
+ // call check_vowel_harmony, line 287
+ if (!this.r_check_vowel_harmony())
+ {
+ return false;
+ }
+ // among, line 288
+ if (this.find_among_b(TurkishStemmer.a_20, 32) == 0)
+ {
+ return false;
+ }
+ // (, line 292
+ // call mark_suffix_with_optional_y_consonant, line 292
+ if (!this.r_mark_suffix_with_optional_y_consonant())
+ {
+ return false;
+ }
+ return true;
+ }
+
+ function r_mark_ysA () : boolean
+ {
+ // (, line 296
+ // among, line 297
+ if (this.find_among_b(TurkishStemmer.a_21, 8) == 0)
+ {
+ return false;
+ }
+ // (, line 298
+ // call mark_suffix_with_optional_y_consonant, line 298
+ if (!this.r_mark_suffix_with_optional_y_consonant())
+ {
+ return false;
+ }
+ return true;
+ }
+
+ function r_mark_ymUs_ () : boolean
+ {
+ // (, line 301
+ // call check_vowel_harmony, line 302
+ if (!this.r_check_vowel_harmony())
+ {
+ return false;
+ }
+ // among, line 303
+ if (this.find_among_b(TurkishStemmer.a_22, 4) == 0)
+ {
+ return false;
+ }
+ // (, line 304
+ // call mark_suffix_with_optional_y_consonant, line 304
+ if (!this.r_mark_suffix_with_optional_y_consonant())
+ {
+ return false;
+ }
+ return true;
+ }
+
+ function r_mark_yken () : boolean
+ {
+ // (, line 307
+ // literal, line 308
+ if (!(this.eq_s_b(3, "ken")))
+ {
+ return false;
+ }
+ // (, line 308
+ // call mark_suffix_with_optional_y_consonant, line 308
+ if (!this.r_mark_suffix_with_optional_y_consonant())
+ {
+ return false;
+ }
+ return true;
+ }
+
+ function r_stem_nominal_verb_suffixes () : boolean
+ {
+ var v_1 : int;
+ var v_2 : int;
+ var v_3 : int;
+ var v_4 : int;
+ var v_5 : int;
+ var v_6 : int;
+ var v_7 : int;
+ var v_8 : int;
+ var v_9 : int;
+ var v_10 : int;
+ // (, line 311
+ // [, line 312
+ this.ket = this.cursor;
+ // set continue_stemming_noun_suffixes, line 313
+ this.B_continue_stemming_noun_suffixes = true;
+ // or, line 315
+ var lab0 = true;
+ lab0: while (lab0 == true)
+ {
+ lab0 = false;
+ v_1 = this.limit - this.cursor;
+ var lab1 = true;
+ lab1: while (lab1 == true)
+ {
+ lab1 = false;
+ // (, line 314
+ // or, line 314
+ var lab2 = true;
+ lab2: while (lab2 == true)
+ {
+ lab2 = false;
+ v_2 = this.limit - this.cursor;
+ var lab3 = true;
+ lab3: while (lab3 == true)
+ {
+ lab3 = false;
+ // call mark_ymUs_, line 314
+ if (!this.r_mark_ymUs_())
+ {
+ break lab3;
+ }
+ break lab2;
+ }
+ this.cursor = this.limit - v_2;
+ var lab4 = true;
+ lab4: while (lab4 == true)
+ {
+ lab4 = false;
+ // call mark_yDU, line 314
+ if (!this.r_mark_yDU())
+ {
+ break lab4;
+ }
+ break lab2;
+ }
+ this.cursor = this.limit - v_2;
+ var lab5 = true;
+ lab5: while (lab5 == true)
+ {
+ lab5 = false;
+ // call mark_ysA, line 314
+ if (!this.r_mark_ysA())
+ {
+ break lab5;
+ }
+ break lab2;
+ }
+ this.cursor = this.limit - v_2;
+ // call mark_yken, line 314
+ if (!this.r_mark_yken())
+ {
+ break lab1;
+ }
+ }
+ break lab0;
+ }
+ this.cursor = this.limit - v_1;
+ var lab6 = true;
+ lab6: while (lab6 == true)
+ {
+ lab6 = false;
+ // (, line 316
+ // call mark_cAsInA, line 316
+ if (!this.r_mark_cAsInA())
+ {
+ break lab6;
+ }
+ // (, line 316
+ // or, line 316
+ var lab7 = true;
+ lab7: while (lab7 == true)
+ {
+ lab7 = false;
+ v_3 = this.limit - this.cursor;
+ var lab8 = true;
+ lab8: while (lab8 == true)
+ {
+ lab8 = false;
+ // call mark_sUnUz, line 316
+ if (!this.r_mark_sUnUz())
+ {
+ break lab8;
+ }
+ break lab7;
+ }
+ this.cursor = this.limit - v_3;
+ var lab9 = true;
+ lab9: while (lab9 == true)
+ {
+ lab9 = false;
+ // call mark_lAr, line 316
+ if (!this.r_mark_lAr())
+ {
+ break lab9;
+ }
+ break lab7;
+ }
+ this.cursor = this.limit - v_3;
+ var lab10 = true;
+ lab10: while (lab10 == true)
+ {
+ lab10 = false;
+ // call mark_yUm, line 316
+ if (!this.r_mark_yUm())
+ {
+ break lab10;
+ }
+ break lab7;
+ }
+ this.cursor = this.limit - v_3;
+ var lab11 = true;
+ lab11: while (lab11 == true)
+ {
+ lab11 = false;
+ // call mark_sUn, line 316
+ if (!this.r_mark_sUn())
+ {
+ break lab11;
+ }
+ break lab7;
+ }
+ this.cursor = this.limit - v_3;
+ var lab12 = true;
+ lab12: while (lab12 == true)
+ {
+ lab12 = false;
+ // call mark_yUz, line 316
+ if (!this.r_mark_yUz())
+ {
+ break lab12;
+ }
+ break lab7;
+ }
+ this.cursor = this.limit - v_3;
+ }
+ // call mark_ymUs_, line 316
+ if (!this.r_mark_ymUs_())
+ {
+ break lab6;
+ }
+ break lab0;
+ }
+ this.cursor = this.limit - v_1;
+ var lab13 = true;
+ lab13: while (lab13 == true)
+ {
+ lab13 = false;
+ // (, line 318
+ // call mark_lAr, line 319
+ if (!this.r_mark_lAr())
+ {
+ break lab13;
+ }
+ // ], line 319
+ this.bra = this.cursor;
+ // delete, line 319
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ // try, line 319
+ v_4 = this.limit - this.cursor;
+ var lab14 = true;
+ lab14: while (lab14 == true)
+ {
+ lab14 = false;
+ // (, line 319
+ // [, line 319
+ this.ket = this.cursor;
+ // (, line 319
+ // or, line 319
+ var lab15 = true;
+ lab15: while (lab15 == true)
+ {
+ lab15 = false;
+ v_5 = this.limit - this.cursor;
+ var lab16 = true;
+ lab16: while (lab16 == true)
+ {
+ lab16 = false;
+ // call mark_DUr, line 319
+ if (!this.r_mark_DUr())
+ {
+ break lab16;
+ }
+ break lab15;
+ }
+ this.cursor = this.limit - v_5;
+ var lab17 = true;
+ lab17: while (lab17 == true)
+ {
+ lab17 = false;
+ // call mark_yDU, line 319
+ if (!this.r_mark_yDU())
+ {
+ break lab17;
+ }
+ break lab15;
+ }
+ this.cursor = this.limit - v_5;
+ var lab18 = true;
+ lab18: while (lab18 == true)
+ {
+ lab18 = false;
+ // call mark_ysA, line 319
+ if (!this.r_mark_ysA())
+ {
+ break lab18;
+ }
+ break lab15;
+ }
+ this.cursor = this.limit - v_5;
+ // call mark_ymUs_, line 319
+ if (!this.r_mark_ymUs_())
+ {
+ this.cursor = this.limit - v_4;
+ break lab14;
+ }
+ }
+ }
+ // unset continue_stemming_noun_suffixes, line 320
+ this.B_continue_stemming_noun_suffixes = false;
+ break lab0;
+ }
+ this.cursor = this.limit - v_1;
+ var lab19 = true;
+ lab19: while (lab19 == true)
+ {
+ lab19 = false;
+ // (, line 323
+ // call mark_nUz, line 323
+ if (!this.r_mark_nUz())
+ {
+ break lab19;
+ }
+ // (, line 323
+ // or, line 323
+ var lab20 = true;
+ lab20: while (lab20 == true)
+ {
+ lab20 = false;
+ v_6 = this.limit - this.cursor;
+ var lab21 = true;
+ lab21: while (lab21 == true)
+ {
+ lab21 = false;
+ // call mark_yDU, line 323
+ if (!this.r_mark_yDU())
+ {
+ break lab21;
+ }
+ break lab20;
+ }
+ this.cursor = this.limit - v_6;
+ // call mark_ysA, line 323
+ if (!this.r_mark_ysA())
+ {
+ break lab19;
+ }
+ }
+ break lab0;
+ }
+ this.cursor = this.limit - v_1;
+ var lab22 = true;
+ lab22: while (lab22 == true)
+ {
+ lab22 = false;
+ // (, line 325
+ // (, line 325
+ // or, line 325
+ var lab23 = true;
+ lab23: while (lab23 == true)
+ {
+ lab23 = false;
+ v_7 = this.limit - this.cursor;
+ var lab24 = true;
+ lab24: while (lab24 == true)
+ {
+ lab24 = false;
+ // call mark_sUnUz, line 325
+ if (!this.r_mark_sUnUz())
+ {
+ break lab24;
+ }
+ break lab23;
+ }
+ this.cursor = this.limit - v_7;
+ var lab25 = true;
+ lab25: while (lab25 == true)
+ {
+ lab25 = false;
+ // call mark_yUz, line 325
+ if (!this.r_mark_yUz())
+ {
+ break lab25;
+ }
+ break lab23;
+ }
+ this.cursor = this.limit - v_7;
+ var lab26 = true;
+ lab26: while (lab26 == true)
+ {
+ lab26 = false;
+ // call mark_sUn, line 325
+ if (!this.r_mark_sUn())
+ {
+ break lab26;
+ }
+ break lab23;
+ }
+ this.cursor = this.limit - v_7;
+ // call mark_yUm, line 325
+ if (!this.r_mark_yUm())
+ {
+ break lab22;
+ }
+ }
+ // ], line 325
+ this.bra = this.cursor;
+ // delete, line 325
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ // try, line 325
+ v_8 = this.limit - this.cursor;
+ var lab27 = true;
+ lab27: while (lab27 == true)
+ {
+ lab27 = false;
+ // (, line 325
+ // [, line 325
+ this.ket = this.cursor;
+ // call mark_ymUs_, line 325
+ if (!this.r_mark_ymUs_())
+ {
+ this.cursor = this.limit - v_8;
+ break lab27;
+ }
+ }
+ break lab0;
+ }
+ this.cursor = this.limit - v_1;
+ // (, line 327
+ // call mark_DUr, line 327
+ if (!this.r_mark_DUr())
+ {
+ return false;
+ }
+ // ], line 327
+ this.bra = this.cursor;
+ // delete, line 327
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ // try, line 327
+ v_9 = this.limit - this.cursor;
+ var lab28 = true;
+ lab28: while (lab28 == true)
+ {
+ lab28 = false;
+ // (, line 327
+ // [, line 327
+ this.ket = this.cursor;
+ // (, line 327
+ // or, line 327
+ var lab29 = true;
+ lab29: while (lab29 == true)
+ {
+ lab29 = false;
+ v_10 = this.limit - this.cursor;
+ var lab30 = true;
+ lab30: while (lab30 == true)
+ {
+ lab30 = false;
+ // call mark_sUnUz, line 327
+ if (!this.r_mark_sUnUz())
+ {
+ break lab30;
+ }
+ break lab29;
+ }
+ this.cursor = this.limit - v_10;
+ var lab31 = true;
+ lab31: while (lab31 == true)
+ {
+ lab31 = false;
+ // call mark_lAr, line 327
+ if (!this.r_mark_lAr())
+ {
+ break lab31;
+ }
+ break lab29;
+ }
+ this.cursor = this.limit - v_10;
+ var lab32 = true;
+ lab32: while (lab32 == true)
+ {
+ lab32 = false;
+ // call mark_yUm, line 327
+ if (!this.r_mark_yUm())
+ {
+ break lab32;
+ }
+ break lab29;
+ }
+ this.cursor = this.limit - v_10;
+ var lab33 = true;
+ lab33: while (lab33 == true)
+ {
+ lab33 = false;
+ // call mark_sUn, line 327
+ if (!this.r_mark_sUn())
+ {
+ break lab33;
+ }
+ break lab29;
+ }
+ this.cursor = this.limit - v_10;
+ var lab34 = true;
+ lab34: while (lab34 == true)
+ {
+ lab34 = false;
+ // call mark_yUz, line 327
+ if (!this.r_mark_yUz())
+ {
+ break lab34;
+ }
+ break lab29;
+ }
+ this.cursor = this.limit - v_10;
+ }
+ // call mark_ymUs_, line 327
+ if (!this.r_mark_ymUs_())
+ {
+ this.cursor = this.limit - v_9;
+ break lab28;
+ }
+ }
+ }
+ // ], line 328
+ this.bra = this.cursor;
+ // delete, line 328
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ return true;
+ }
+
+ function r_stem_suffix_chain_before_ki () : boolean
+ {
+ var v_1 : int;
+ var v_2 : int;
+ var v_3 : int;
+ var v_4 : int;
+ var v_5 : int;
+ var v_6 : int;
+ var v_7 : int;
+ var v_8 : int;
+ var v_9 : int;
+ var v_10 : int;
+ var v_11 : int;
+ // (, line 332
+ // [, line 333
+ this.ket = this.cursor;
+ // call mark_ki, line 334
+ if (!this.r_mark_ki())
+ {
+ return false;
+ }
+ // (, line 335
+ // or, line 342
+ var lab0 = true;
+ lab0: while (lab0 == true)
+ {
+ lab0 = false;
+ v_1 = this.limit - this.cursor;
+ var lab1 = true;
+ lab1: while (lab1 == true)
+ {
+ lab1 = false;
+ // (, line 336
+ // call mark_DA, line 336
+ if (!this.r_mark_DA())
+ {
+ break lab1;
+ }
+ // ], line 336
+ this.bra = this.cursor;
+ // delete, line 336
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ // try, line 336
+ v_2 = this.limit - this.cursor;
+ var lab2 = true;
+ lab2: while (lab2 == true)
+ {
+ lab2 = false;
+ // (, line 336
+ // [, line 336
+ this.ket = this.cursor;
+ // or, line 338
+ var lab3 = true;
+ lab3: while (lab3 == true)
+ {
+ lab3 = false;
+ v_3 = this.limit - this.cursor;
+ var lab4 = true;
+ lab4: while (lab4 == true)
+ {
+ lab4 = false;
+ // (, line 337
+ // call mark_lAr, line 337
+ if (!this.r_mark_lAr())
+ {
+ break lab4;
+ }
+ // ], line 337
+ this.bra = this.cursor;
+ // delete, line 337
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ // try, line 337
+ v_4 = this.limit - this.cursor;
+ var lab5 = true;
+ lab5: while (lab5 == true)
+ {
+ lab5 = false;
+ // (, line 337
+ // call stem_suffix_chain_before_ki, line 337
+ if (!this.r_stem_suffix_chain_before_ki())
+ {
+ this.cursor = this.limit - v_4;
+ break lab5;
+ }
+ }
+ break lab3;
+ }
+ this.cursor = this.limit - v_3;
+ // (, line 339
+ // call mark_possessives, line 339
+ if (!this.r_mark_possessives())
+ {
+ this.cursor = this.limit - v_2;
+ break lab2;
+ }
+ // ], line 339
+ this.bra = this.cursor;
+ // delete, line 339
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ // try, line 339
+ v_5 = this.limit - this.cursor;
+ var lab6 = true;
+ lab6: while (lab6 == true)
+ {
+ lab6 = false;
+ // (, line 339
+ // [, line 339
+ this.ket = this.cursor;
+ // call mark_lAr, line 339
+ if (!this.r_mark_lAr())
+ {
+ this.cursor = this.limit - v_5;
+ break lab6;
+ }
+ // ], line 339
+ this.bra = this.cursor;
+ // delete, line 339
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ // call stem_suffix_chain_before_ki, line 339
+ if (!this.r_stem_suffix_chain_before_ki())
+ {
+ this.cursor = this.limit - v_5;
+ break lab6;
+ }
+ }
+ }
+ }
+ break lab0;
+ }
+ this.cursor = this.limit - v_1;
+ var lab7 = true;
+ lab7: while (lab7 == true)
+ {
+ lab7 = false;
+ // (, line 343
+ // call mark_nUn, line 343
+ if (!this.r_mark_nUn())
+ {
+ break lab7;
+ }
+ // ], line 343
+ this.bra = this.cursor;
+ // delete, line 343
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ // try, line 343
+ v_6 = this.limit - this.cursor;
+ var lab8 = true;
+ lab8: while (lab8 == true)
+ {
+ lab8 = false;
+ // (, line 343
+ // [, line 343
+ this.ket = this.cursor;
+ // or, line 345
+ var lab9 = true;
+ lab9: while (lab9 == true)
+ {
+ lab9 = false;
+ v_7 = this.limit - this.cursor;
+ var lab10 = true;
+ lab10: while (lab10 == true)
+ {
+ lab10 = false;
+ // (, line 344
+ // call mark_lArI, line 344
+ if (!this.r_mark_lArI())
+ {
+ break lab10;
+ }
+ // ], line 344
+ this.bra = this.cursor;
+ // delete, line 344
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ break lab9;
+ }
+ this.cursor = this.limit - v_7;
+ var lab11 = true;
+ lab11: while (lab11 == true)
+ {
+ lab11 = false;
+ // (, line 346
+ // [, line 346
+ this.ket = this.cursor;
+ // or, line 346
+ var lab12 = true;
+ lab12: while (lab12 == true)
+ {
+ lab12 = false;
+ v_8 = this.limit - this.cursor;
+ var lab13 = true;
+ lab13: while (lab13 == true)
+ {
+ lab13 = false;
+ // call mark_possessives, line 346
+ if (!this.r_mark_possessives())
+ {
+ break lab13;
+ }
+ break lab12;
+ }
+ this.cursor = this.limit - v_8;
+ // call mark_sU, line 346
+ if (!this.r_mark_sU())
+ {
+ break lab11;
+ }
+ }
+ // ], line 346
+ this.bra = this.cursor;
+ // delete, line 346
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ // try, line 346
+ v_9 = this.limit - this.cursor;
+ var lab14 = true;
+ lab14: while (lab14 == true)
+ {
+ lab14 = false;
+ // (, line 346
+ // [, line 346
+ this.ket = this.cursor;
+ // call mark_lAr, line 346
+ if (!this.r_mark_lAr())
+ {
+ this.cursor = this.limit - v_9;
+ break lab14;
+ }
+ // ], line 346
+ this.bra = this.cursor;
+ // delete, line 346
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ // call stem_suffix_chain_before_ki, line 346
+ if (!this.r_stem_suffix_chain_before_ki())
+ {
+ this.cursor = this.limit - v_9;
+ break lab14;
+ }
+ }
+ break lab9;
+ }
+ this.cursor = this.limit - v_7;
+ // (, line 348
+ // call stem_suffix_chain_before_ki, line 348
+ if (!this.r_stem_suffix_chain_before_ki())
+ {
+ this.cursor = this.limit - v_6;
+ break lab8;
+ }
+ }
+ }
+ break lab0;
+ }
+ this.cursor = this.limit - v_1;
+ // (, line 351
+ // call mark_ndA, line 351
+ if (!this.r_mark_ndA())
+ {
+ return false;
+ }
+ // (, line 351
+ // or, line 353
+ var lab15 = true;
+ lab15: while (lab15 == true)
+ {
+ lab15 = false;
+ v_10 = this.limit - this.cursor;
+ var lab16 = true;
+ lab16: while (lab16 == true)
+ {
+ lab16 = false;
+ // (, line 352
+ // call mark_lArI, line 352
+ if (!this.r_mark_lArI())
+ {
+ break lab16;
+ }
+ // ], line 352
+ this.bra = this.cursor;
+ // delete, line 352
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ break lab15;
+ }
+ this.cursor = this.limit - v_10;
+ var lab17 = true;
+ lab17: while (lab17 == true)
+ {
+ lab17 = false;
+ // (, line 354
+ // (, line 354
+ // call mark_sU, line 354
+ if (!this.r_mark_sU())
+ {
+ break lab17;
+ }
+ // ], line 354
+ this.bra = this.cursor;
+ // delete, line 354
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ // try, line 354
+ v_11 = this.limit - this.cursor;
+ var lab18 = true;
+ lab18: while (lab18 == true)
+ {
+ lab18 = false;
+ // (, line 354
+ // [, line 354
+ this.ket = this.cursor;
+ // call mark_lAr, line 354
+ if (!this.r_mark_lAr())
+ {
+ this.cursor = this.limit - v_11;
+ break lab18;
+ }
+ // ], line 354
+ this.bra = this.cursor;
+ // delete, line 354
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ // call stem_suffix_chain_before_ki, line 354
+ if (!this.r_stem_suffix_chain_before_ki())
+ {
+ this.cursor = this.limit - v_11;
+ break lab18;
+ }
+ }
+ break lab15;
+ }
+ this.cursor = this.limit - v_10;
+ // (, line 356
+ // call stem_suffix_chain_before_ki, line 356
+ if (!this.r_stem_suffix_chain_before_ki())
+ {
+ return false;
+ }
+ }
+ }
+ return true;
+ }
+
+ function r_stem_noun_suffixes () : boolean
+ {
+ var v_1 : int;
+ var v_2 : int;
+ var v_3 : int;
+ var v_4 : int;
+ var v_5 : int;
+ var v_6 : int;
+ var v_7 : int;
+ var v_8 : int;
+ var v_9 : int;
+ var v_10 : int;
+ var v_11 : int;
+ var v_12 : int;
+ var v_13 : int;
+ var v_14 : int;
+ var v_15 : int;
+ var v_16 : int;
+ var v_17 : int;
+ var v_18 : int;
+ var v_19 : int;
+ var v_20 : int;
+ var v_21 : int;
+ var v_22 : int;
+ var v_23 : int;
+ var v_24 : int;
+ var v_25 : int;
+ var v_26 : int;
+ var v_27 : int;
+ // (, line 361
+ // or, line 363
+ var lab0 = true;
+ lab0: while (lab0 == true)
+ {
+ lab0 = false;
+ v_1 = this.limit - this.cursor;
+ var lab1 = true;
+ lab1: while (lab1 == true)
+ {
+ lab1 = false;
+ // (, line 362
+ // [, line 362
+ this.ket = this.cursor;
+ // call mark_lAr, line 362
+ if (!this.r_mark_lAr())
+ {
+ break lab1;
+ }
+ // ], line 362
+ this.bra = this.cursor;
+ // delete, line 362
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ // try, line 362
+ v_2 = this.limit - this.cursor;
+ var lab2 = true;
+ lab2: while (lab2 == true)
+ {
+ lab2 = false;
+ // (, line 362
+ // call stem_suffix_chain_before_ki, line 362
+ if (!this.r_stem_suffix_chain_before_ki())
+ {
+ this.cursor = this.limit - v_2;
+ break lab2;
+ }
+ }
+ break lab0;
+ }
+ this.cursor = this.limit - v_1;
+ var lab3 = true;
+ lab3: while (lab3 == true)
+ {
+ lab3 = false;
+ // (, line 364
+ // [, line 364
+ this.ket = this.cursor;
+ // call mark_ncA, line 364
+ if (!this.r_mark_ncA())
+ {
+ break lab3;
+ }
+ // ], line 364
+ this.bra = this.cursor;
+ // delete, line 364
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ // try, line 365
+ v_3 = this.limit - this.cursor;
+ var lab4 = true;
+ lab4: while (lab4 == true)
+ {
+ lab4 = false;
+ // (, line 365
+ // or, line 367
+ var lab5 = true;
+ lab5: while (lab5 == true)
+ {
+ lab5 = false;
+ v_4 = this.limit - this.cursor;
+ var lab6 = true;
+ lab6: while (lab6 == true)
+ {
+ lab6 = false;
+ // (, line 366
+ // [, line 366
+ this.ket = this.cursor;
+ // call mark_lArI, line 366
+ if (!this.r_mark_lArI())
+ {
+ break lab6;
+ }
+ // ], line 366
+ this.bra = this.cursor;
+ // delete, line 366
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ break lab5;
+ }
+ this.cursor = this.limit - v_4;
+ var lab7 = true;
+ lab7: while (lab7 == true)
+ {
+ lab7 = false;
+ // (, line 368
+ // [, line 368
+ this.ket = this.cursor;
+ // or, line 368
+ var lab8 = true;
+ lab8: while (lab8 == true)
+ {
+ lab8 = false;
+ v_5 = this.limit - this.cursor;
+ var lab9 = true;
+ lab9: while (lab9 == true)
+ {
+ lab9 = false;
+ // call mark_possessives, line 368
+ if (!this.r_mark_possessives())
+ {
+ break lab9;
+ }
+ break lab8;
+ }
+ this.cursor = this.limit - v_5;
+ // call mark_sU, line 368
+ if (!this.r_mark_sU())
+ {
+ break lab7;
+ }
+ }
+ // ], line 368
+ this.bra = this.cursor;
+ // delete, line 368
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ // try, line 368
+ v_6 = this.limit - this.cursor;
+ var lab10 = true;
+ lab10: while (lab10 == true)
+ {
+ lab10 = false;
+ // (, line 368
+ // [, line 368
+ this.ket = this.cursor;
+ // call mark_lAr, line 368
+ if (!this.r_mark_lAr())
+ {
+ this.cursor = this.limit - v_6;
+ break lab10;
+ }
+ // ], line 368
+ this.bra = this.cursor;
+ // delete, line 368
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ // call stem_suffix_chain_before_ki, line 368
+ if (!this.r_stem_suffix_chain_before_ki())
+ {
+ this.cursor = this.limit - v_6;
+ break lab10;
+ }
+ }
+ break lab5;
+ }
+ this.cursor = this.limit - v_4;
+ // (, line 370
+ // [, line 370
+ this.ket = this.cursor;
+ // call mark_lAr, line 370
+ if (!this.r_mark_lAr())
+ {
+ this.cursor = this.limit - v_3;
+ break lab4;
+ }
+ // ], line 370
+ this.bra = this.cursor;
+ // delete, line 370
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ // call stem_suffix_chain_before_ki, line 370
+ if (!this.r_stem_suffix_chain_before_ki())
+ {
+ this.cursor = this.limit - v_3;
+ break lab4;
+ }
+ }
+ }
+ break lab0;
+ }
+ this.cursor = this.limit - v_1;
+ var lab11 = true;
+ lab11: while (lab11 == true)
+ {
+ lab11 = false;
+ // (, line 374
+ // [, line 374
+ this.ket = this.cursor;
+ // (, line 374
+ // or, line 374
+ var lab12 = true;
+ lab12: while (lab12 == true)
+ {
+ lab12 = false;
+ v_7 = this.limit - this.cursor;
+ var lab13 = true;
+ lab13: while (lab13 == true)
+ {
+ lab13 = false;
+ // call mark_ndA, line 374
+ if (!this.r_mark_ndA())
+ {
+ break lab13;
+ }
+ break lab12;
+ }
+ this.cursor = this.limit - v_7;
+ // call mark_nA, line 374
+ if (!this.r_mark_nA())
+ {
+ break lab11;
+ }
+ }
+ // (, line 375
+ // or, line 377
+ var lab14 = true;
+ lab14: while (lab14 == true)
+ {
+ lab14 = false;
+ v_8 = this.limit - this.cursor;
+ var lab15 = true;
+ lab15: while (lab15 == true)
+ {
+ lab15 = false;
+ // (, line 376
+ // call mark_lArI, line 376
+ if (!this.r_mark_lArI())
+ {
+ break lab15;
+ }
+ // ], line 376
+ this.bra = this.cursor;
+ // delete, line 376
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ break lab14;
+ }
+ this.cursor = this.limit - v_8;
+ var lab16 = true;
+ lab16: while (lab16 == true)
+ {
+ lab16 = false;
+ // (, line 378
+ // call mark_sU, line 378
+ if (!this.r_mark_sU())
+ {
+ break lab16;
+ }
+ // ], line 378
+ this.bra = this.cursor;
+ // delete, line 378
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ // try, line 378
+ v_9 = this.limit - this.cursor;
+ var lab17 = true;
+ lab17: while (lab17 == true)
+ {
+ lab17 = false;
+ // (, line 378
+ // [, line 378
+ this.ket = this.cursor;
+ // call mark_lAr, line 378
+ if (!this.r_mark_lAr())
+ {
+ this.cursor = this.limit - v_9;
+ break lab17;
+ }
+ // ], line 378
+ this.bra = this.cursor;
+ // delete, line 378
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ // call stem_suffix_chain_before_ki, line 378
+ if (!this.r_stem_suffix_chain_before_ki())
+ {
+ this.cursor = this.limit - v_9;
+ break lab17;
+ }
+ }
+ break lab14;
+ }
+ this.cursor = this.limit - v_8;
+ // (, line 380
+ // call stem_suffix_chain_before_ki, line 380
+ if (!this.r_stem_suffix_chain_before_ki())
+ {
+ break lab11;
+ }
+ }
+ break lab0;
+ }
+ this.cursor = this.limit - v_1;
+ var lab18 = true;
+ lab18: while (lab18 == true)
+ {
+ lab18 = false;
+ // (, line 384
+ // [, line 384
+ this.ket = this.cursor;
+ // (, line 384
+ // or, line 384
+ var lab19 = true;
+ lab19: while (lab19 == true)
+ {
+ lab19 = false;
+ v_10 = this.limit - this.cursor;
+ var lab20 = true;
+ lab20: while (lab20 == true)
+ {
+ lab20 = false;
+ // call mark_ndAn, line 384
+ if (!this.r_mark_ndAn())
+ {
+ break lab20;
+ }
+ break lab19;
+ }
+ this.cursor = this.limit - v_10;
+ // call mark_nU, line 384
+ if (!this.r_mark_nU())
+ {
+ break lab18;
+ }
+ }
+ // (, line 384
+ // or, line 384
+ var lab21 = true;
+ lab21: while (lab21 == true)
+ {
+ lab21 = false;
+ v_11 = this.limit - this.cursor;
+ var lab22 = true;
+ lab22: while (lab22 == true)
+ {
+ lab22 = false;
+ // (, line 384
+ // call mark_sU, line 384
+ if (!this.r_mark_sU())
+ {
+ break lab22;
+ }
+ // ], line 384
+ this.bra = this.cursor;
+ // delete, line 384
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ // try, line 384
+ v_12 = this.limit - this.cursor;
+ var lab23 = true;
+ lab23: while (lab23 == true)
+ {
+ lab23 = false;
+ // (, line 384
+ // [, line 384
+ this.ket = this.cursor;
+ // call mark_lAr, line 384
+ if (!this.r_mark_lAr())
+ {
+ this.cursor = this.limit - v_12;
+ break lab23;
+ }
+ // ], line 384
+ this.bra = this.cursor;
+ // delete, line 384
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ // call stem_suffix_chain_before_ki, line 384
+ if (!this.r_stem_suffix_chain_before_ki())
+ {
+ this.cursor = this.limit - v_12;
+ break lab23;
+ }
+ }
+ break lab21;
+ }
+ this.cursor = this.limit - v_11;
+ // (, line 384
+ // call mark_lArI, line 384
+ if (!this.r_mark_lArI())
+ {
+ break lab18;
+ }
+ }
+ break lab0;
+ }
+ this.cursor = this.limit - v_1;
+ var lab24 = true;
+ lab24: while (lab24 == true)
+ {
+ lab24 = false;
+ // (, line 386
+ // [, line 386
+ this.ket = this.cursor;
+ // call mark_DAn, line 386
+ if (!this.r_mark_DAn())
+ {
+ break lab24;
+ }
+ // ], line 386
+ this.bra = this.cursor;
+ // delete, line 386
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ // try, line 386
+ v_13 = this.limit - this.cursor;
+ var lab25 = true;
+ lab25: while (lab25 == true)
+ {
+ lab25 = false;
+ // (, line 386
+ // [, line 386
+ this.ket = this.cursor;
+ // (, line 387
+ // or, line 389
+ var lab26 = true;
+ lab26: while (lab26 == true)
+ {
+ lab26 = false;
+ v_14 = this.limit - this.cursor;
+ var lab27 = true;
+ lab27: while (lab27 == true)
+ {
+ lab27 = false;
+ // (, line 388
+ // call mark_possessives, line 388
+ if (!this.r_mark_possessives())
+ {
+ break lab27;
+ }
+ // ], line 388
+ this.bra = this.cursor;
+ // delete, line 388
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ // try, line 388
+ v_15 = this.limit - this.cursor;
+ var lab28 = true;
+ lab28: while (lab28 == true)
+ {
+ lab28 = false;
+ // (, line 388
+ // [, line 388
+ this.ket = this.cursor;
+ // call mark_lAr, line 388
+ if (!this.r_mark_lAr())
+ {
+ this.cursor = this.limit - v_15;
+ break lab28;
+ }
+ // ], line 388
+ this.bra = this.cursor;
+ // delete, line 388
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ // call stem_suffix_chain_before_ki, line 388
+ if (!this.r_stem_suffix_chain_before_ki())
+ {
+ this.cursor = this.limit - v_15;
+ break lab28;
+ }
+ }
+ break lab26;
+ }
+ this.cursor = this.limit - v_14;
+ var lab29 = true;
+ lab29: while (lab29 == true)
+ {
+ lab29 = false;
+ // (, line 390
+ // call mark_lAr, line 390
+ if (!this.r_mark_lAr())
+ {
+ break lab29;
+ }
+ // ], line 390
+ this.bra = this.cursor;
+ // delete, line 390
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ // try, line 390
+ v_16 = this.limit - this.cursor;
+ var lab30 = true;
+ lab30: while (lab30 == true)
+ {
+ lab30 = false;
+ // (, line 390
+ // call stem_suffix_chain_before_ki, line 390
+ if (!this.r_stem_suffix_chain_before_ki())
+ {
+ this.cursor = this.limit - v_16;
+ break lab30;
+ }
+ }
+ break lab26;
+ }
+ this.cursor = this.limit - v_14;
+ // (, line 392
+ // call stem_suffix_chain_before_ki, line 392
+ if (!this.r_stem_suffix_chain_before_ki())
+ {
+ this.cursor = this.limit - v_13;
+ break lab25;
+ }
+ }
+ }
+ break lab0;
+ }
+ this.cursor = this.limit - v_1;
+ var lab31 = true;
+ lab31: while (lab31 == true)
+ {
+ lab31 = false;
+ // (, line 396
+ // [, line 396
+ this.ket = this.cursor;
+ // or, line 396
+ var lab32 = true;
+ lab32: while (lab32 == true)
+ {
+ lab32 = false;
+ v_17 = this.limit - this.cursor;
+ var lab33 = true;
+ lab33: while (lab33 == true)
+ {
+ lab33 = false;
+ // call mark_nUn, line 396
+ if (!this.r_mark_nUn())
+ {
+ break lab33;
+ }
+ break lab32;
+ }
+ this.cursor = this.limit - v_17;
+ // call mark_ylA, line 396
+ if (!this.r_mark_ylA())
+ {
+ break lab31;
+ }
+ }
+ // ], line 396
+ this.bra = this.cursor;
+ // delete, line 396
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ // try, line 397
+ v_18 = this.limit - this.cursor;
+ var lab34 = true;
+ lab34: while (lab34 == true)
+ {
+ lab34 = false;
+ // (, line 397
+ // or, line 399
+ var lab35 = true;
+ lab35: while (lab35 == true)
+ {
+ lab35 = false;
+ v_19 = this.limit - this.cursor;
+ var lab36 = true;
+ lab36: while (lab36 == true)
+ {
+ lab36 = false;
+ // (, line 398
+ // [, line 398
+ this.ket = this.cursor;
+ // call mark_lAr, line 398
+ if (!this.r_mark_lAr())
+ {
+ break lab36;
+ }
+ // ], line 398
+ this.bra = this.cursor;
+ // delete, line 398
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ // call stem_suffix_chain_before_ki, line 398
+ if (!this.r_stem_suffix_chain_before_ki())
+ {
+ break lab36;
+ }
+ break lab35;
+ }
+ this.cursor = this.limit - v_19;
+ var lab37 = true;
+ lab37: while (lab37 == true)
+ {
+ lab37 = false;
+ // (, line 400
+ // [, line 400
+ this.ket = this.cursor;
+ // or, line 400
+ var lab38 = true;
+ lab38: while (lab38 == true)
+ {
+ lab38 = false;
+ v_20 = this.limit - this.cursor;
+ var lab39 = true;
+ lab39: while (lab39 == true)
+ {
+ lab39 = false;
+ // call mark_possessives, line 400
+ if (!this.r_mark_possessives())
+ {
+ break lab39;
+ }
+ break lab38;
+ }
+ this.cursor = this.limit - v_20;
+ // call mark_sU, line 400
+ if (!this.r_mark_sU())
+ {
+ break lab37;
+ }
+ }
+ // ], line 400
+ this.bra = this.cursor;
+ // delete, line 400
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ // try, line 400
+ v_21 = this.limit - this.cursor;
+ var lab40 = true;
+ lab40: while (lab40 == true)
+ {
+ lab40 = false;
+ // (, line 400
+ // [, line 400
+ this.ket = this.cursor;
+ // call mark_lAr, line 400
+ if (!this.r_mark_lAr())
+ {
+ this.cursor = this.limit - v_21;
+ break lab40;
+ }
+ // ], line 400
+ this.bra = this.cursor;
+ // delete, line 400
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ // call stem_suffix_chain_before_ki, line 400
+ if (!this.r_stem_suffix_chain_before_ki())
+ {
+ this.cursor = this.limit - v_21;
+ break lab40;
+ }
+ }
+ break lab35;
+ }
+ this.cursor = this.limit - v_19;
+ // call stem_suffix_chain_before_ki, line 402
+ if (!this.r_stem_suffix_chain_before_ki())
+ {
+ this.cursor = this.limit - v_18;
+ break lab34;
+ }
+ }
+ }
+ break lab0;
+ }
+ this.cursor = this.limit - v_1;
+ var lab41 = true;
+ lab41: while (lab41 == true)
+ {
+ lab41 = false;
+ // (, line 406
+ // [, line 406
+ this.ket = this.cursor;
+ // call mark_lArI, line 406
+ if (!this.r_mark_lArI())
+ {
+ break lab41;
+ }
+ // ], line 406
+ this.bra = this.cursor;
+ // delete, line 406
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ break lab0;
+ }
+ this.cursor = this.limit - v_1;
+ var lab42 = true;
+ lab42: while (lab42 == true)
+ {
+ lab42 = false;
+ // (, line 408
+ // call stem_suffix_chain_before_ki, line 408
+ if (!this.r_stem_suffix_chain_before_ki())
+ {
+ break lab42;
+ }
+ break lab0;
+ }
+ this.cursor = this.limit - v_1;
+ var lab43 = true;
+ lab43: while (lab43 == true)
+ {
+ lab43 = false;
+ // (, line 410
+ // [, line 410
+ this.ket = this.cursor;
+ // or, line 410
+ var lab44 = true;
+ lab44: while (lab44 == true)
+ {
+ lab44 = false;
+ v_22 = this.limit - this.cursor;
+ var lab45 = true;
+ lab45: while (lab45 == true)
+ {
+ lab45 = false;
+ // call mark_DA, line 410
+ if (!this.r_mark_DA())
+ {
+ break lab45;
+ }
+ break lab44;
+ }
+ this.cursor = this.limit - v_22;
+ var lab46 = true;
+ lab46: while (lab46 == true)
+ {
+ lab46 = false;
+ // call mark_yU, line 410
+ if (!this.r_mark_yU())
+ {
+ break lab46;
+ }
+ break lab44;
+ }
+ this.cursor = this.limit - v_22;
+ // call mark_yA, line 410
+ if (!this.r_mark_yA())
+ {
+ break lab43;
+ }
+ }
+ // ], line 410
+ this.bra = this.cursor;
+ // delete, line 410
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ // try, line 410
+ v_23 = this.limit - this.cursor;
+ var lab47 = true;
+ lab47: while (lab47 == true)
+ {
+ lab47 = false;
+ // (, line 410
+ // [, line 410
+ this.ket = this.cursor;
+ // (, line 410
+ // or, line 410
+ var lab48 = true;
+ lab48: while (lab48 == true)
+ {
+ lab48 = false;
+ v_24 = this.limit - this.cursor;
+ var lab49 = true;
+ lab49: while (lab49 == true)
+ {
+ lab49 = false;
+ // (, line 410
+ // call mark_possessives, line 410
+ if (!this.r_mark_possessives())
+ {
+ break lab49;
+ }
+ // ], line 410
+ this.bra = this.cursor;
+ // delete, line 410
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ // try, line 410
+ v_25 = this.limit - this.cursor;
+ var lab50 = true;
+ lab50: while (lab50 == true)
+ {
+ lab50 = false;
+ // (, line 410
+ // [, line 410
+ this.ket = this.cursor;
+ // call mark_lAr, line 410
+ if (!this.r_mark_lAr())
+ {
+ this.cursor = this.limit - v_25;
+ break lab50;
+ }
+ }
+ break lab48;
+ }
+ this.cursor = this.limit - v_24;
+ // call mark_lAr, line 410
+ if (!this.r_mark_lAr())
+ {
+ this.cursor = this.limit - v_23;
+ break lab47;
+ }
+ }
+ // ], line 410
+ this.bra = this.cursor;
+ // delete, line 410
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ // [, line 410
+ this.ket = this.cursor;
+ // call stem_suffix_chain_before_ki, line 410
+ if (!this.r_stem_suffix_chain_before_ki())
+ {
+ this.cursor = this.limit - v_23;
+ break lab47;
+ }
+ }
+ break lab0;
+ }
+ this.cursor = this.limit - v_1;
+ // (, line 412
+ // [, line 412
+ this.ket = this.cursor;
+ // or, line 412
+ var lab51 = true;
+ lab51: while (lab51 == true)
+ {
+ lab51 = false;
+ v_26 = this.limit - this.cursor;
+ var lab52 = true;
+ lab52: while (lab52 == true)
+ {
+ lab52 = false;
+ // call mark_possessives, line 412
+ if (!this.r_mark_possessives())
+ {
+ break lab52;
+ }
+ break lab51;
+ }
+ this.cursor = this.limit - v_26;
+ // call mark_sU, line 412
+ if (!this.r_mark_sU())
+ {
+ return false;
+ }
+ }
+ // ], line 412
+ this.bra = this.cursor;
+ // delete, line 412
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ // try, line 412
+ v_27 = this.limit - this.cursor;
+ var lab53 = true;
+ lab53: while (lab53 == true)
+ {
+ lab53 = false;
+ // (, line 412
+ // [, line 412
+ this.ket = this.cursor;
+ // call mark_lAr, line 412
+ if (!this.r_mark_lAr())
+ {
+ this.cursor = this.limit - v_27;
+ break lab53;
+ }
+ // ], line 412
+ this.bra = this.cursor;
+ // delete, line 412
+ if (!this.slice_del())
+ {
+ return false;
+ }
+ // call stem_suffix_chain_before_ki, line 412
+ if (!this.r_stem_suffix_chain_before_ki())
+ {
+ this.cursor = this.limit - v_27;
+ break lab53;
+ }
+ }
+ }
+ return true;
+ }
+
+ function r_post_process_last_consonants () : boolean
+ {
+ var among_var : int;
+ // (, line 415
+ // [, line 416
+ this.ket = this.cursor;
+ // substring, line 416
+ among_var = this.find_among_b(TurkishStemmer.a_23, 4);
+ if (among_var == 0)
+ {
+ return false;
+ }
+ // ], line 416
+ this.bra = this.cursor;
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ // (, line 417
+ // <-, line 417
+ if (!this.slice_from("p"))
+ {
+ return false;
+ }
+ break;
+ case 2:
+ // (, line 418
+ // <-, line 418
+ if (!this.slice_from("\u00E7"))
+ {
+ return false;
+ }
+ break;
+ case 3:
+ // (, line 419
+ // <-, line 419
+ if (!this.slice_from("t"))
+ {
+ return false;
+ }
+ break;
+ case 4:
+ // (, line 420
+ // <-, line 420
+ if (!this.slice_from("k"))
+ {
+ return false;
+ }
+ break;
+ }
+ return true;
+ }
+
+ function r_append_U_to_stems_ending_with_d_or_g () : boolean
+ {
+ var v_1 : int;
+ var v_2 : int;
+ var v_3 : int;
+ var v_4 : int;
+ var v_5 : int;
+ var v_6 : int;
+ var v_7 : int;
+ var v_8 : int;
+ var v_9 : int;
+ var v_10 : int;
+ var v_11 : int;
+ var v_12 : int;
+ var v_13 : int;
+ var v_14 : int;
+ var v_15 : int;
+ // (, line 430
+ // test, line 431
+ v_1 = this.limit - this.cursor;
+ // (, line 431
+ // or, line 431
+ var lab0 = true;
+ lab0: while (lab0 == true)
+ {
+ lab0 = false;
+ v_2 = this.limit - this.cursor;
+ var lab1 = true;
+ lab1: while (lab1 == true)
+ {
+ lab1 = false;
+ // literal, line 431
+ if (!(this.eq_s_b(1, "d")))
+ {
+ break lab1;
+ }
+ break lab0;
+ }
+ this.cursor = this.limit - v_2;
+ // literal, line 431
+ if (!(this.eq_s_b(1, "g")))
+ {
+ return false;
+ }
+ }
+ this.cursor = this.limit - v_1;
+ // or, line 433
+ var lab2 = true;
+ lab2: while (lab2 == true)
+ {
+ lab2 = false;
+ v_3 = this.limit - this.cursor;
+ var lab3 = true;
+ lab3: while (lab3 == true)
+ {
+ lab3 = false;
+ // (, line 432
+ // test, line 432
+ v_4 = this.limit - this.cursor;
+ // (, line 432
+ // (, line 432
+ // goto, line 432
+ golab4: while(true)
+ {
+ v_5 = this.limit - this.cursor;
+ var lab5 = true;
+ lab5: while (lab5 == true)
+ {
+ lab5 = false;
+ if (!(this.in_grouping_b(TurkishStemmer.g_vowel, 97, 305)))
+ {
+ break lab5;
+ }
+ this.cursor = this.limit - v_5;
+ break golab4;
+ }
+ this.cursor = this.limit - v_5;
+ if (this.cursor <= this.limit_backward)
+ {
+ break lab3;
+ }
+ this.cursor--;
+ }
+ // or, line 432
+ var lab6 = true;
+ lab6: while (lab6 == true)
+ {
+ lab6 = false;
+ v_6 = this.limit - this.cursor;
+ var lab7 = true;
+ lab7: while (lab7 == true)
+ {
+ lab7 = false;
+ // literal, line 432
+ if (!(this.eq_s_b(1, "a")))
+ {
+ break lab7;
+ }
+ break lab6;
+ }
+ this.cursor = this.limit - v_6;
+ // literal, line 432
+ if (!(this.eq_s_b(1, "\u0131")))
+ {
+ break lab3;
+ }
+ }
+ this.cursor = this.limit - v_4;
+ // <+, line 432
+ {
+ var c : int = this.cursor;
+ this.insert(this.cursor, this.cursor, "\u0131");
+ this.cursor = c;
+ }
+ break lab2;
+ }
+ this.cursor = this.limit - v_3;
+ var lab8 = true;
+ lab8: while (lab8 == true)
+ {
+ lab8 = false;
+ // (, line 434
+ // test, line 434
+ v_7 = this.limit - this.cursor;
+ // (, line 434
+ // (, line 434
+ // goto, line 434
+ golab9: while(true)
+ {
+ v_8 = this.limit - this.cursor;
+ var lab10 = true;
+ lab10: while (lab10 == true)
+ {
+ lab10 = false;
+ if (!(this.in_grouping_b(TurkishStemmer.g_vowel, 97, 305)))
+ {
+ break lab10;
+ }
+ this.cursor = this.limit - v_8;
+ break golab9;
+ }
+ this.cursor = this.limit - v_8;
+ if (this.cursor <= this.limit_backward)
+ {
+ break lab8;
+ }
+ this.cursor--;
+ }
+ // or, line 434
+ var lab11 = true;
+ lab11: while (lab11 == true)
+ {
+ lab11 = false;
+ v_9 = this.limit - this.cursor;
+ var lab12 = true;
+ lab12: while (lab12 == true)
+ {
+ lab12 = false;
+ // literal, line 434
+ if (!(this.eq_s_b(1, "e")))
+ {
+ break lab12;
+ }
+ break lab11;
+ }
+ this.cursor = this.limit - v_9;
+ // literal, line 434
+ if (!(this.eq_s_b(1, "i")))
+ {
+ break lab8;
+ }
+ }
+ this.cursor = this.limit - v_7;
+ // <+, line 434
+ {
+ var c : int = this.cursor;
+ this.insert(this.cursor, this.cursor, "i");
+ this.cursor = c;
+ }
+ break lab2;
+ }
+ this.cursor = this.limit - v_3;
+ var lab13 = true;
+ lab13: while (lab13 == true)
+ {
+ lab13 = false;
+ // (, line 436
+ // test, line 436
+ v_10 = this.limit - this.cursor;
+ // (, line 436
+ // (, line 436
+ // goto, line 436
+ golab14: while(true)
+ {
+ v_11 = this.limit - this.cursor;
+ var lab15 = true;
+ lab15: while (lab15 == true)
+ {
+ lab15 = false;
+ if (!(this.in_grouping_b(TurkishStemmer.g_vowel, 97, 305)))
+ {
+ break lab15;
+ }
+ this.cursor = this.limit - v_11;
+ break golab14;
+ }
+ this.cursor = this.limit - v_11;
+ if (this.cursor <= this.limit_backward)
+ {
+ break lab13;
+ }
+ this.cursor--;
+ }
+ // or, line 436
+ var lab16 = true;
+ lab16: while (lab16 == true)
+ {
+ lab16 = false;
+ v_12 = this.limit - this.cursor;
+ var lab17 = true;
+ lab17: while (lab17 == true)
+ {
+ lab17 = false;
+ // literal, line 436
+ if (!(this.eq_s_b(1, "o")))
+ {
+ break lab17;
+ }
+ break lab16;
+ }
+ this.cursor = this.limit - v_12;
+ // literal, line 436
+ if (!(this.eq_s_b(1, "u")))
+ {
+ break lab13;
+ }
+ }
+ this.cursor = this.limit - v_10;
+ // <+, line 436
+ {
+ var c : int = this.cursor;
+ this.insert(this.cursor, this.cursor, "u");
+ this.cursor = c;
+ }
+ break lab2;
+ }
+ this.cursor = this.limit - v_3;
+ // (, line 438
+ // test, line 438
+ v_13 = this.limit - this.cursor;
+ // (, line 438
+ // (, line 438
+ // goto, line 438
+ golab18: while(true)
+ {
+ v_14 = this.limit - this.cursor;
+ var lab19 = true;
+ lab19: while (lab19 == true)
+ {
+ lab19 = false;
+ if (!(this.in_grouping_b(TurkishStemmer.g_vowel, 97, 305)))
+ {
+ break lab19;
+ }
+ this.cursor = this.limit - v_14;
+ break golab18;
+ }
+ this.cursor = this.limit - v_14;
+ if (this.cursor <= this.limit_backward)
+ {
+ return false;
+ }
+ this.cursor--;
+ }
+ // or, line 438
+ var lab20 = true;
+ lab20: while (lab20 == true)
+ {
+ lab20 = false;
+ v_15 = this.limit - this.cursor;
+ var lab21 = true;
+ lab21: while (lab21 == true)
+ {
+ lab21 = false;
+ // literal, line 438
+ if (!(this.eq_s_b(1, "\u00F6")))
+ {
+ break lab21;
+ }
+ break lab20;
+ }
+ this.cursor = this.limit - v_15;
+ // literal, line 438
+ if (!(this.eq_s_b(1, "\u00FC")))
+ {
+ return false;
+ }
+ }
+ this.cursor = this.limit - v_13;
+ // <+, line 438
+ {
+ var c : int = this.cursor;
+ this.insert(this.cursor, this.cursor, "\u00FC");
+ this.cursor = c;
+ }
+ }
+ return true;
+ }
+
+ function r_more_than_one_syllable_word () : boolean
+ {
+ var v_1 : int;
+ var v_3 : int;
+ // (, line 445
+ // test, line 446
+ v_1 = this.cursor;
+ // (, line 446
+ // atleast, line 446
+ {
+ var v_2 = 2;
+ // atleast, line 446
+ replab0: while(true)
+ {
+ v_3 = this.cursor;
+ var lab1 = true;
+ lab1: while (lab1 == true)
+ {
+ lab1 = false;
+ // (, line 446
+ // gopast, line 446
+ golab2: while(true)
+ {
+ var lab3 = true;
+ lab3: while (lab3 == true)
+ {
+ lab3 = false;
+ if (!(this.in_grouping(TurkishStemmer.g_vowel, 97, 305)))
+ {
+ break lab3;
+ }
+ break golab2;
+ }
+ if (this.cursor >= this.limit)
+ {
+ break lab1;
+ }
+ this.cursor++;
+ }
+ v_2--;
+ continue replab0;
+ }
+ this.cursor = v_3;
+ break replab0;
+ }
+ if (v_2 > 0)
+ {
+ return false;
+ }
+ }
+ this.cursor = v_1;
+ return true;
+ }
+
+ function r_is_reserved_word () : boolean
+ {
+ var v_1 : int;
+ var v_2 : int;
+ var v_4 : int;
+ // (, line 449
+ // or, line 451
+ var lab0 = true;
+ lab0: while (lab0 == true)
+ {
+ lab0 = false;
+ v_1 = this.cursor;
+ var lab1 = true;
+ lab1: while (lab1 == true)
+ {
+ lab1 = false;
+ // test, line 450
+ v_2 = this.cursor;
+ // (, line 450
+ // gopast, line 450
+ golab2: while(true)
+ {
+ var lab3 = true;
+ lab3: while (lab3 == true)
+ {
+ lab3 = false;
+ // literal, line 450
+ if (!(this.eq_s(2, "ad")))
+ {
+ break lab3;
+ }
+ break golab2;
+ }
+ if (this.cursor >= this.limit)
+ {
+ break lab1;
+ }
+ this.cursor++;
+ }
+ // (, line 450
+ this.I_strlen = 2;
+ // (, line 450
+ if (!(this.I_strlen == this.limit))
+ {
+ break lab1;
+ }
+ this.cursor = v_2;
+ break lab0;
+ }
+ this.cursor = v_1;
+ // test, line 452
+ v_4 = this.cursor;
+ // (, line 452
+ // gopast, line 452
+ golab4: while(true)
+ {
+ var lab5 = true;
+ lab5: while (lab5 == true)
+ {
+ lab5 = false;
+ // literal, line 452
+ if (!(this.eq_s(5, "soyad")))
+ {
+ break lab5;
+ }
+ break golab4;
+ }
+ if (this.cursor >= this.limit)
+ {
+ return false;
+ }
+ this.cursor++;
+ }
+ // (, line 452
+ this.I_strlen = 5;
+ // (, line 452
+ if (!(this.I_strlen == this.limit))
+ {
+ return false;
+ }
+ this.cursor = v_4;
+ }
+ return true;
+ }
+
+ function r_postlude () : boolean
+ {
+ var v_1 : int;
+ var v_2 : int;
+ var v_3 : int;
+ // (, line 455
+ // not, line 456
+ {
+ v_1 = this.cursor;
+ var lab0 = true;
+ lab0: while (lab0 == true)
+ {
+ lab0 = false;
+ // (, line 456
+ // call is_reserved_word, line 456
+ if (!this.r_is_reserved_word())
+ {
+ break lab0;
+ }
+ return false;
+ }
+ this.cursor = v_1;
+ }
+ // backwards, line 457
+ this.limit_backward = this.cursor; this.cursor = this.limit;
+ // (, line 457
+ // do, line 458
+ v_2 = this.limit - this.cursor;
+ var lab1 = true;
+ lab1: while (lab1 == true)
+ {
+ lab1 = false;
+ // call append_U_to_stems_ending_with_d_or_g, line 458
+ if (!this.r_append_U_to_stems_ending_with_d_or_g())
+ {
+ break lab1;
+ }
+ }
+ this.cursor = this.limit - v_2;
+ // do, line 459
+ v_3 = this.limit - this.cursor;
+ var lab2 = true;
+ lab2: while (lab2 == true)
+ {
+ lab2 = false;
+ // call post_process_last_consonants, line 459
+ if (!this.r_post_process_last_consonants())
+ {
+ break lab2;
+ }
+ }
+ this.cursor = this.limit - v_3;
+ this.cursor = this.limit_backward; return true;
+ }
+
+ override function stem () : boolean
+ {
+ var v_1 : int;
+ var v_2 : int;
+ // (, line 464
+ // (, line 465
+ // call more_than_one_syllable_word, line 465
+ if (!this.r_more_than_one_syllable_word())
+ {
+ return false;
+ }
+ // (, line 466
+ // backwards, line 467
+ this.limit_backward = this.cursor; this.cursor = this.limit;
+ // (, line 467
+ // do, line 468
+ v_1 = this.limit - this.cursor;
+ var lab0 = true;
+ lab0: while (lab0 == true)
+ {
+ lab0 = false;
+ // call stem_nominal_verb_suffixes, line 468
+ if (!this.r_stem_nominal_verb_suffixes())
+ {
+ break lab0;
+ }
+ }
+ this.cursor = this.limit - v_1;
+ // Boolean test continue_stemming_noun_suffixes, line 469
+ if (!(this.B_continue_stemming_noun_suffixes))
+ {
+ return false;
+ }
+ // do, line 470
+ v_2 = this.limit - this.cursor;
+ var lab1 = true;
+ lab1: while (lab1 == true)
+ {
+ lab1 = false;
+ // call stem_noun_suffixes, line 470
+ if (!this.r_stem_noun_suffixes())
+ {
+ break lab1;
+ }
+ }
+ this.cursor = this.limit - v_2;
+ this.cursor = this.limit_backward; // call postlude, line 473
+ if (!this.r_postlude())
+ {
+ return false;
+ }
+ return true;
+ }
+
+ function equals (o : variant) : boolean {
+ return o instanceof TurkishStemmer;
+ }
+
+ function hashCode() : int
+ {
+ //http://stackoverflow.com/questions/194846/is-there-any-kind-of-hashcode-function-in-javascript
+ var classname = "TurkishStemmer";
+ var hash = 0;
+ if (classname.length == 0) return hash;
+ for (var i = 0; i < classname.length; i++) {
+ var char = classname.charCodeAt(i);
+ hash = ((hash << 5) - hash) + char;
+ hash = hash & hash; // Convert to 32bit integer
+ }
+ return hash;
+ }
+
+}
+
diff --git a/web/server/h2o/libh2o/misc/oktavia/src/style.jsx b/web/server/h2o/libh2o/misc/oktavia/src/style.jsx
new file mode 100644
index 00000000..3886dc45
--- /dev/null
+++ b/web/server/h2o/libh2o/misc/oktavia/src/style.jsx
@@ -0,0 +1,105 @@
+import "sax.jsx";
+
+class _HTMLHandler extends SAXHandler
+{
+ var text : string[];
+ var styles : Map.<string[]>;
+ var escape : boolean;
+
+ static function escapeHTML (str : string) : string
+ {
+ return str.replace(/\n/g, "<br/>").replace(/&/g, "&amp;").replace(/"/g, "&quot;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
+ }
+
+ function constructor (styles : Map.<string[]>, escape : boolean)
+ {
+ this.text = [] : string[];
+ this.escape = escape;
+ this.styles = styles;
+ }
+
+ override function onopentag (tagname : string, attributes : Map.<string>) : void
+ {
+ this.text.push(this.styles[tagname][0]);
+ }
+
+ override function onclosetag (tagname : string) : void
+ {
+ this.text.push(this.styles[tagname][1]);
+ }
+
+ override function ontext (text : string) : void
+ {
+ if (this.escape)
+ {
+ this.text.push(_HTMLHandler.escapeHTML(text));
+ }
+ else
+ {
+ this.text.push(text);
+ }
+ }
+
+ function result () : string
+ {
+ return this.text.join('');
+ }
+}
+
+class Style
+{
+ var styles : Map.<string[]>;
+ var escapeHTML : boolean;
+
+ static const console = {
+ 'title' : ['\x1B[32m\x1b[4m', '\x1B[39m\x1b[0m'],
+ 'url' : ['\x1B[34m', '\x1B[39m'],
+ 'hit' : ['\x1B[4m', '\x1B[0m'],
+ 'del' : ['\x1B[9m', '\x1B[0m'],
+ 'summary' : ['\x1B[90m', '\x1B[39m']
+ };
+
+ static const html = {
+ 'title' : ['<span class="title">', '</span>'],
+ 'url' : ['<span class="url">', '</span>'],
+ 'hit' : ['<span class="hit">', '</span>'],
+ 'del' : ['<del>', '</del>'],
+ 'summary' : ['<span class="reuslt">', '</span>']
+ };
+
+ static const ignore = {
+ 'tilte' : ['', ''],
+ 'url' : ['', ''],
+ 'hit' : ['', ''],
+ 'del' : ['', ''],
+ 'summary' : ['', '']
+ };
+
+ function constructor (mode : string)
+ {
+ switch (mode)
+ {
+ case 'console':
+ this.styles = Style.console;
+ break;
+ case 'html':
+ this.styles = Style.html;
+ break;
+ case 'ignore':
+ this.styles = Style.ignore;
+ break;
+ default:
+ this.styles = Style.ignore;
+ break;
+ }
+ this.escapeHTML = (mode == 'html');
+ }
+
+ function convert (source : string) : string
+ {
+ var handler = new _HTMLHandler(this.styles, this.escapeHTML);
+ var parser = new SAXParser(handler);
+ parser.parse(source);
+ return handler.result();
+ }
+}
diff --git a/web/server/h2o/libh2o/misc/oktavia/src/textparser.jsx b/web/server/h2o/libh2o/misc/oktavia/src/textparser.jsx
new file mode 100644
index 00000000..6cb4676a
--- /dev/null
+++ b/web/server/h2o/libh2o/misc/oktavia/src/textparser.jsx
@@ -0,0 +1,25 @@
+import "js/nodejs.jsx";
+import "oktavia.jsx";
+import "stemmer/stemmer.jsx";
+
+
+class TextParser
+{
+ var oktavia : Oktavia;
+ var unit : string;
+ var root : string;
+ var stemmer : Nullable.<Stemmer>;
+
+ function constructor (unit : string, root : string, stemmer : Stemmer)
+ {
+ this.oktavia = new Oktavia();
+ this.unit = unit;
+ this.root = root;
+ this.stemmer = stemmer;
+ }
+
+ function parse (filepath : string) : void
+ {
+ var lines = node.fs.readFileSync(filepath, 'utf8');
+ }
+}
diff --git a/web/server/h2o/libh2o/misc/oktavia/src/tiny-segmenter.jsx b/web/server/h2o/libh2o/misc/oktavia/src/tiny-segmenter.jsx
new file mode 100644
index 00000000..b69796c2
--- /dev/null
+++ b/web/server/h2o/libh2o/misc/oktavia/src/tiny-segmenter.jsx
@@ -0,0 +1,350 @@
+// JSX version of TinySegmenter. -- Super compact Japanese tokenizer in Javascript
+// Ported by Yoshiki Shibukawa
+//
+// Original Code Copyright
+// TinySegmenter 0.2 -- Super compact Japanese tokenizer in Javascript
+// (c) 2008 Taku Kudo <taku@chasen.org>
+// TinySegmenter is freely distributable under the terms of a new BSD licence.
+// For details, see http://chasen.org/~taku/software/TinySegmenter/LICENCE.txt
+
+class CharType
+{
+ var re : RegExp;
+ var type : string;
+ function constructor (pattern : RegExp, type : string)
+ {
+ this.re = pattern;
+ this.type = type;
+ }
+}
+
+class TinySegmenter
+{
+ static const _chartype = [
+ new CharType(/[一二三四五六七八ä¹å百åƒä¸‡å„„å…†]/ ,"M"),
+ new CharType(/[一-龠々〆ヵヶ]/, "H"),
+ new CharType(/[ã-ã‚“]/, "I"),
+ new CharType(/[ã‚¡-ヴーア-ï¾ï¾žï½°]/, "K"),
+ new CharType(/[a-zA-Zï½-zA-Z]/, "A"),
+ new CharType(/[0-9ï¼-ï¼™]/, "N")
+ ];
+
+ static const _BIAS = -332;
+ static const _BC1 = {"HH":6,"II":2461,"KH":406,"OH":-1378};
+ static const _BC2 = {"AA":-3267,"AI":2744,"AN":-878,"HH":-4070,"HM":-1711,"HN":4012,"HO":3761,
+ "IA":1327,"IH":-1184,"II":-1332,"IK":1721,"IO":5492,"KI":3831,"KK":-8741,"MH":-3132,"MK":3334,
+ "OO":-2920};
+ static const _BC3 = {"HH":996,"HI":626,"HK":-721,"HN":-1307,"HO":-836,"IH":-301,"KK":2762,"MK":1079,
+ "MM":4034,"OA":-1652,"OH":266};
+ static const _BP1 = {"BB":295,"OB":304,"OO":-125,"UB":352};
+ static const _BP2 = {"BO":60,"OO":-1762};
+ static const _BQ1 = {"BHH":1150,"BHM":1521,"BII":-1158,"BIM":886,"BMH":1208,"BNH":449,"BOH":-91,
+ "BOO":-2597,"OHI":451,"OIH":-296,"OKA":1851,"OKH":-1020,"OKK":904,"OOO":2965};
+ static const _BQ2 = {"BHH":118,"BHI":-1159,"BHM":466,"BIH":-919,"BKK":-1720,"BKO":864,"OHH":-1139,
+ "OHM":-181,"OIH":153,"UHI":-1146};
+ static const _BQ3 = {"BHH":-792,"BHI":2664,"BII":-299,"BKI":419,"BMH":937,"BMM":8335,"BNN":998,
+ "BOH":775,"OHH":2174,"OHM":439,"OII":280,"OKH":1798,"OKI":-793,"OKO":-2242,"OMH":-2402,
+ "OOO":11699};
+ static const _BQ4 = {"BHH":-3895,"BIH":3761,"BII":-4654,"BIK":1348,"BKK":-1806,"BMI":-3385,
+ "BOO":-12396,"OAH":926,"OHH":266,"OHK":-2036,"ONN":-973};
+ static const _BW1 = {",ã¨":660,",åŒ":727,"B1ã‚":1404,"B1åŒ":542,"ã€ã¨":660,"ã€åŒ":727,"ã€ã¨":1682,
+ "ã‚ã£":1505,"ã„ã†":1743,"ã„ã£":-2055,"ã„ã‚‹":672,"ã†ã—":-4817,"ã†ã‚“":665,"ã‹ã‚‰":3472,"ãŒã‚‰":600,
+ "ã“ã†":-790,"ã“ã¨":2083,"ã“ã‚“":-1262,"ã•ã‚‰":-4143,"ã•ã‚“":4573,"ã—ãŸ":2641,"ã—ã¦":1104,
+ "ã™ã§":-3399,"ãã“":1977,"ãã‚Œ":-871,"ãŸã¡":1122,"ãŸã‚":601,"ã£ãŸ":3463,"ã¤ã„":-802,"ã¦ã„":805,
+ "ã¦ã":1249,"ã§ã":1127,"ã§ã™":3445,"ã§ã¯":844,"ã¨ã„":-4915,"ã¨ã¿":1922,"ã©ã“":3887,"ãªã„":5713,
+ "ãªã£":3015,"ãªã©":7379,"ãªã‚“":-1113,"ã«ã—":2468,"ã«ã¯":1498,"ã«ã‚‚":1671,"ã«å¯¾":-912,"ã®ä¸€":-501,
+ "ã®ä¸­":741,"ã¾ã›":2448,"ã¾ã§":1711,"ã¾ã¾":2600,"ã¾ã‚‹":-2155,"ã‚„ã‚€":-1947,"よã£":-2565,"ã‚ŒãŸ":2369,
+ "ã‚Œã§":-913,"ã‚’ã—":1860,"を見":731,"亡ã":-1886,"京都":2558,"å–ã‚Š":-2784,"大ã":-2604,"大阪":1497,
+ "平方":-2314,"引ã":-1336,"日本":-195,"本当":-2423,"毎日":-2113,"目指":-724,"B1ã‚":1404,
+ "B1åŒ":542,"ï½£ã¨":1682};
+ static const _BW2 = {"..":-11822,"11":-669,"――":-5730,"−−":-13175,"ã„ã†":-1609,"ã†ã‹":2490,
+ "ã‹ã—":-1350,"ã‹ã‚‚":-602,"ã‹ã‚‰":-7194,"ã‹ã‚Œ":4612,"ãŒã„":853,"ãŒã‚‰":-3198,"ããŸ":1941,
+ "ããª":-1597,"ã“ã¨":-8392,"ã“ã®":-4193,"ã•ã›":4533,"ã•ã‚Œ":13168,"ã•ã‚“":-3977,"ã—ã„":-1819,
+ "ã—ã‹":-545,"ã—ãŸ":5078,"ã—ã¦":972,"ã—ãª":939,"ãã®":-3744,"ãŸã„":-1253,"ãŸãŸ":-662,"ãŸã ":-3857,
+ "ãŸã¡":-786,"ãŸã¨":1224,"ãŸã¯":-939,"ã£ãŸ":4589,"ã£ã¦":1647,"ã£ã¨":-2094,"ã¦ã„":6144,
+ "ã¦ã":3640,"ã¦ã":2551,"ã¦ã¯":-3110,"ã¦ã‚‚":-3065,"ã§ã„":2666,"ã§ã":-1528,"ã§ã—":-3828,
+ "ã§ã™":-4761,"ã§ã‚‚":-4203,"ã¨ã„":1890,"ã¨ã“":-1746,"ã¨ã¨":-2279,"ã¨ã®":720,"ã¨ã¿":5168,
+ "ã¨ã‚‚":-3941,"ãªã„":-2488,"ãªãŒ":-1313,"ãªã©":-6509,"ãªã®":2614,"ãªã‚“":3099,"ã«ãŠ":-1615,
+ "ã«ã—":2748,"ã«ãª":2454,"ã«ã‚ˆ":-7236,"ã«å¯¾":-14943,"ã«å¾“":-4688,"ã«é–¢":-11388,"ã®ã‹":2093,
+ "ã®ã§":-7059,"ã®ã«":-6041,"ã®ã®":-6125,"ã¯ã„":1073,"ã¯ãŒ":-1033,"ã¯ãš":-2532,"ã°ã‚Œ":1813,
+ "ã¾ã—":-1316,"ã¾ã§":-6621,"ã¾ã‚Œ":5409,"ã‚ã¦":-3153,"ã‚‚ã„":2230,"ã‚‚ã®":-10713,"らã‹":-944,
+ "らã—":-1611,"らã«":-1897,"ã‚Šã—":651,"ã‚Šã¾":1620,"ã‚ŒãŸ":4270,"ã‚Œã¦":849,"ã‚Œã°":4114,
+ "ã‚ã†":6067,"ã‚ã‚Œ":7901,"を通":-11877,"ã‚“ã ":728,"ã‚“ãª":-4115,"一人":602,"一方":-1375,
+ "一日":970,"一部":-1051,"上ãŒ":-4479,"会社":-1116,"出ã¦":2163,"分ã®":-7758,"åŒå…š":970,
+ "åŒæ—¥":-913,"大阪":-2471,"委員":-1250,"å°‘ãª":-1050,"年度":-8669,"å¹´é–“":-1626,"府県":-2363,
+ "手権":-1982,"æ–°èž":-4066,"日新":-722,"日本":-7068,"日米":3372,"曜日":-601,"æœé®®":-2355,
+ "本人":-2697,"æ±äº¬":-1543,"然ã¨":-1384,"社会":-1276,"ç«‹ã¦":-990,"第ã«":-1612,"米国":-4268,
+ "11":-669};
+ static const _BW3 = {"ã‚ãŸ":-2194,"ã‚ã‚Š":719,"ã‚ã‚‹":3846,"ã„.":-1185,"ã„。":-1185,"ã„ã„":5308,
+ "ã„ãˆ":2079,"ã„ã":3029,"ã„ãŸ":2056,"ã„ã£":1883,"ã„ã‚‹":5600,"ã„ã‚":1527,"ã†ã¡":1117,"ã†ã¨":4798,
+ "ãˆã¨":1454,"ã‹.":2857,"ã‹ã€‚":2857,"ã‹ã‘":-743,"ã‹ã£":-4098,"ã‹ã«":-669,"ã‹ã‚‰":6520,"ã‹ã‚Š":-2670,
+ "ãŒ,":1816,"ãŒã€":1816,"ãŒã":-4855,"ãŒã‘":-1127,"ãŒã£":-913,"ãŒã‚‰":-4977,"ãŒã‚Š":-2064,
+ "ããŸ":1645,"ã‘ã©":1374,"ã“ã¨":7397,"ã“ã®":1542,"ã“ã‚":-2757,"ã•ã„":-714,"ã•ã‚’":976,"ã—,":1557,
+ "ã—ã€":1557,"ã—ã„":-3714,"ã—ãŸ":3562,"ã—ã¦":1449,"ã—ãª":2608,"ã—ã¾":1200,"ã™.":-1310,
+ "ã™ã€‚":-1310,"ã™ã‚‹":6521,"ãš,":3426,"ãšã€":3426,"ãšã«":841,"ãã†":428,"ãŸ.":8875,"ãŸã€‚":8875,
+ "ãŸã„":-594,"ãŸã®":812,"ãŸã‚Š":-1183,"ãŸã‚‹":-853,"ã .":4098,"ã ã€‚":4098,"ã ã£":1004,"ã£ãŸ":-4748,
+ "ã£ã¦":300,"ã¦ã„":6240,"ã¦ãŠ":855,"ã¦ã‚‚":302,"ã§ã™":1437,"ã§ã«":-1482,"ã§ã¯":2295,"ã¨ã†":-1387,
+ "ã¨ã—":2266,"ã¨ã®":541,"ã¨ã‚‚":-3543,"ã©ã†":4664,"ãªã„":1796,"ãªã":-903,"ãªã©":2135,"ã«,":-1021,
+ "ã«ã€":-1021,"ã«ã—":1771,"ã«ãª":1906,"ã«ã¯":2644,"ã®,":-724,"ã®ã€":-724,"ã®å­":-1000,"ã¯,":1337,
+ "ã¯ã€":1337,"ã¹ã":2181,"ã¾ã—":1113,"ã¾ã™":6943,"ã¾ã£":-1549,"ã¾ã§":6154,"ã¾ã‚Œ":-793,"らã—":1479,
+ "られ":6820,"ã‚‹ã‚‹":3818,"ã‚Œ,":854,"ã‚Œã€":854,"ã‚ŒãŸ":1850,"ã‚Œã¦":1375,"ã‚Œã°":-3246,"れる":1091,
+ "ã‚ã‚Œ":-605,"ã‚“ã ":606,"ã‚“ã§":798,"カ月":990,"会議":860,"入り":1232,"大会":2217,"始ã‚":1681,
+ "市":965,"æ–°èž":-5055,"æ—¥,":974,"æ—¥ã€":974,"社会":2024,"カ月":990};
+ static const _TC1 = {"AAA":1093,"HHH":1029,"HHM":580,"HII":998,"HOH":-390,"HOM":-331,"IHI":1169,
+ "IOH":-142,"IOI":-1015,"IOM":467,"MMH":187,"OOI":-1832};
+ static const _TC2 = {"HHO":2088,"HII":-1023,"HMM":-1154,"IHI":-1965,"KKH":703,"OII":-2649};
+ static const _TC3 = {"AAA":-294,"HHH":346,"HHI":-341,"HII":-1088,"HIK":731,"HOH":-1486,
+ "IHH":128,"IHI":-3041,"IHO":-1935,"IIH":-825,"IIM":-1035,"IOI":-542,"KHH":-1216,
+ "KKA":491,"KKH":-1217,"KOK":-1009,"MHH":-2694,"MHM":-457,"MHO":123,"MMH":-471,
+ "NNH":-1689,"NNO":662,"OHO":-3393};
+ static const _TC4 = {"HHH":-203,"HHI":1344,"HHK":365,"HHM":-122,"HHN":182,"HHO":669,"HIH":804,
+ "HII":679,"HOH":446,"IHH":695,"IHO":-2324,"IIH":321,"III":1497,"IIO":656,"IOO":54,
+ "KAK":4845,"KKA":3386,"KKK":3065,"MHH":-405,"MHI":201,"MMH":-241,"MMM":661,"MOM":841};
+ static const _TQ1 = {"BHHH":-227,"BHHI":316,"BHIH":-132,"BIHH":60,"BIII":1595,"BNHH":-744,
+ "BOHH":225,"BOOO":-908,"OAKK":482,"OHHH":281,"OHIH":249,"OIHI":200,"OIIH":-68};
+ static const _TQ2 = {"BIHH":-1401,"BIII":-1033,"BKAK":-543,"BOOO":-5591};
+ static const _TQ3 = {"BHHH":478,"BHHM":-1073,"BHIH":222,"BHII":-504,"BIIH":-116,"BIII":-105,
+ "BMHI":-863,"BMHM":-464,"BOMH":620,"OHHH":346,"OHHI":1729,"OHII":997,"OHMH":481,"OIHH":623,
+ "OIIH":1344,"OKAK":2792,"OKHH":587,"OKKA":679,"OOHH":110,"OOII":-685};
+ static const _TQ4 = {"BHHH":-721,"BHHM":-3604,"BHII":-966,"BIIH":-607,"BIII":-2181,"OAAA":-2763,
+ "OAKK":180,"OHHH":-294,"OHHI":2446,"OHHO":480,"OHIH":-1573,"OIHH":1935,"OIHI":-493,"OIIH":626,
+ "OIII":-4007,"OKAK":-8156};
+ static const _TW1 = {"ã«ã¤ã„":-4681,"æ±äº¬éƒ½":2026};
+ static const _TW2 = {"ã‚る程":-2049,"ã„ã£ãŸ":-1256,"ã“ã‚ãŒ":-2434,"ã—ょã†":3873,"ãã®å¾Œ":-4430,
+ "ã ã£ã¦":-1049,"ã¦ã„ãŸ":1833,"ã¨ã—ã¦":-4657,"ã¨ã‚‚ã«":-4517,"ã‚‚ã®ã§":1882,"一気ã«":-792,
+ "åˆã‚ã¦":-1512,"åŒæ™‚ã«":-8097,"大ããª":-1255,"対ã—ã¦":-2721,"社会党":-3216};
+ static const _TW3 = {"ã„ãŸã ":-1734,"ã—ã¦ã„":1314,"ã¨ã—ã¦":-4314,"ã«ã¤ã„":-5483,"ã«ã¨ã£":-5989,
+ "ã«å½“ãŸ":-6247,"ã®ã§,":-727,"ã®ã§ã€":-727,"ã®ã‚‚ã®":-600,"ã‚Œã‹ã‚‰":-3752,"å二月":-2287};
+ static const _TW4 = {"ã„ã†.":8576,"ã„ã†ã€‚":8576,"ã‹ã‚‰ãª":-2348,"ã—ã¦ã„":2958,"ãŸãŒ,":1516,
+ "ãŸãŒã€":1516,"ã¦ã„ã‚‹":1538,"ã¨ã„ã†":1349,"ã¾ã—ãŸ":5543,"ã¾ã›ã‚“":1097,"よã†ã¨":-4258,
+ "よるã¨":5865};
+ static const _UC1 = {"A":484,"K":93,"M":645,"O":-505};
+ static const _UC2 = {"A":819,"H":1059,"I":409,"M":3987,"N":5775,"O":646};
+ static const _UC3 = {"A":-1370,"I":2311};
+ static const _UC4 = {"A":-2643,"H":1809,"I":-1032,"K":-3450,"M":3565,"N":3876,"O":6646};
+ static const _UC5 = {"H":313,"I":-1238,"K":-799,"M":539,"O":-831};
+ static const _UC6 = {"H":-506,"I":-253,"K":87,"M":247,"O":-387};
+ static const _UP1 = {"O":-214};
+ static const _UP2 = {"B":69,"O":935};
+ static const _UP3 = {"B":189};
+ static const _UQ1 = {"BH":21,"BI":-12,"BK":-99,"BN":142,"BO":-56,"OH":-95,"OI":477,"OK":410,"OO":-2422};
+ static const _UQ2 = {"BH":216,"BI":113,"OK":1759};
+ static const _UQ3 = {"BA":-479,"BH":42,"BI":1913,"BK":-7198,"BM":3160,"BN":6427,"BO":14761,
+ "OI":-827,"ON":-3212};
+ static const _UW1 = {",":156,"ã€":156,"「":-463,"ã‚":-941,"ã†":-127,"ãŒ":-553,"ã":121,"ã“":505,
+ "ã§":-201,"ã¨":-547,"ã©":-123,"ã«":-789,"ã®":-185,"ã¯":-847,"ã‚‚":-466,"ã‚„":-470,"よ":182,
+ "ら":-292,"り":208,"れ":169,"を":-446,"ん":-137,"・":-135,"主":-402,"京":-268,"区":-912,
+ "åˆ":871,"国":-460,"大":561,"委":729,"市":-411,"æ—¥":-141,"ç†":361,"生":-408,"県":-386,
+ "都":-718,"「":-463,"・":-135};
+ static const _UW2 = {",":-829,"ã€":-829,"〇":892,"「":-645,"ã€":3145,"ã‚":-538,"ã„":505,"ã†":134,
+ "ãŠ":-502,"ã‹":1454,"ãŒ":-856,"ã":-412,"ã“":1141,"ã•":878,"ã–":540,"ã—":1529,"ã™":-675,
+ "ã›":300,"ã":-1011,"ãŸ":188,"ã ":1837,"ã¤":-949,"ã¦":-291,"ã§":-268,"ã¨":-981,"ã©":1273,
+ "ãª":1063,"ã«":-1764,"ã®":130,"ã¯":-409,"ã²":-1273,"ã¹":1261,"ã¾":600,"ã‚‚":-1263,"ã‚„":-402,
+ "よ":1639,"り":-579,"る":-694,"れ":571,"を":-2516,"ん":2095,"ア":-587,"カ":306,"キ":568,
+ "ッ":831,"三":-758,"ä¸":-2150,"世":-302,"中":-968,"主":-861,"事":492,"人":-123,"会":978,
+ "ä¿":362,"å…¥":548,"åˆ":-3025,"副":-1566,"北":-3414,"区":-422,"大":-1769,"天":-865,"太":-483,
+ "å­":-1519,"å­¦":760,"実":1023,"å°":-2009,"市":-813,"å¹´":-1060,"å¼·":1067,"手":-1519,"æº":-1033,
+ "政":1522,"æ–‡":-1355,"æ–°":-1682,"æ—¥":-1815,"明":-1462,"最":-630,"æœ":-1843,"本":-1650,
+ "æ±":-931,"æžœ":-665,"次":-2378,"æ°‘":-180,"æ°—":-1740,"ç†":752,"発":529,"ç›®":-1584,"相":-242,
+ "県":-1165,"立":-763,"第":810,"米":509,"自":-1353,"行":838,"西":-744,"見":-3874,"調":1010,
+ "議":1198,"込":3041,"開":1758,"間":-1257,"「":-645,"」":3145,"ッ":831,"ア":-587,"カ":306,"キ":568};
+ static const _UW3 = {",":4889,"1":-800,"−":-1723,"ã€":4889,"々":-2311,"〇":5827,"ã€":2670,
+ "〓":-3573,"ã‚":-2696,"ã„":1006,"ã†":2342,"ãˆ":1983,"ãŠ":-4864,"ã‹":-1163,"ãŒ":3271,"ã":1004,
+ "ã‘":388,"ã’":401,"ã“":-3552,"ã”":-3116,"ã•":-1058,"ã—":-395,"ã™":584,"ã›":3685,"ã":-5228,
+ "ãŸ":842,"ã¡":-521,"ã£":-1444,"ã¤":-1081,"ã¦":6167,"ã§":2318,"ã¨":1691,"ã©":-899,"ãª":-2788,
+ "ã«":2745,"ã®":4056,"ã¯":4555,"ã²":-2171,"ãµ":-1798,"ã¸":1199,"ã»":-5516,"ã¾":-4384,"ã¿":-120,
+ "ã‚":1205,"ã‚‚":2323,"ã‚„":-788,"よ":-202,"ら":727,"ã‚Š":649,"ã‚‹":5905,"ã‚Œ":2773,"ã‚":-1207,
+ "を":6620,"ん":-518,"ア":551,"グ":1319,"ス":874,"ッ":-1350,"ト":521,"ム":1109,"ル":1591,
+ "ロ":2201,"ン":278,"・":-3794,"一":-1619,"下":-1759,"世":-2087,"両":3815,"中":653,"主":-758,
+ "予":-1193,"二":974,"人":2742,"今":792,"他":1889,"以":-1368,"低":811,"何":4265,"作":-361,
+ "ä¿":-2439,"å…ƒ":4858,"å…š":3593,"å…¨":1574,"å…¬":-3030,"å…­":755,"å…±":-1880,"円":5807,"å†":3095,
+ "分":457,"åˆ":2475,"別":1129,"å‰":2286,"副":4437,"力":365,"å‹•":-949,"å‹™":-1872,"化":1327,
+ "北":-1038,"区":4646,"åƒ":-2309,"åˆ":-783,"å”":-1006,"å£":483,"å³":1233,"å„":3588,"åˆ":-241,
+ "åŒ":3906,"å’Œ":-837,"å“¡":4513,"国":642,"åž‹":1389,"å ´":1219,"外":-241,"妻":2016,"å­¦":-1356,
+ "安":-423,"実":-1008,"家":1078,"å°":-513,"å°‘":-3102,"å·ž":1155,"市":3197,"å¹³":-1804,"å¹´":2416,
+ "広":-1030,"府":1605,"度":1452,"建":-2352,"当":-3885,"å¾—":1905,"æ€":-1291,"性":1822,"戸":-488,
+ "指":-3973,"政":-2013,"教":-1479,"数":3222,"文":-1489,"新":1764,"日":2099,"旧":5792,"昨":-661,
+ "時":-1248,"曜":-951,"最":-937,"月":4125,"期":360,"æŽ":3094,"æ‘":364,"æ±":-805,"æ ¸":5156,
+ "森":2438,"業":484,"æ°":2613,"æ°‘":-1694,"決":-1073,"法":1868,"æµ·":-495,"ç„¡":979,"物":461,
+ "特":-3850,"生":-273,"用":914,"町":1215,"çš„":7313,"ç›´":-1835,"çœ":792,"県":6293,"知":-1528,
+ "ç§":4231,"税":401,"ç«‹":-960,"第":1201,"ç±³":7767,"ç³»":3066,"ç´„":3663,"ç´š":1384,"çµ±":-4229,
+ "ç·":1163,"ç·š":1255,"者":6457,"能":725,"自":-2869,"英":785,"見":1044,"調":-562,"財":-733,
+ "è²»":1777,"車":1835,"è»":1375,"è¾¼":-1504,"通":-1136,"é¸":-681,"郎":1026,"郡":4404,"部":1200,
+ "金":2163,"é•·":421,"é–‹":-1432,"é–“":1302,"é–¢":-1282,"雨":2009,"é›»":-1045,"éž":2066,"駅":1620,
+ "1":-800,"」":2670,"・":-3794,"ッ":-1350,"ア":551,"グ":1319,"ス":874,"ト":521,"ム":1109,"ル":1591,
+ "ï¾›":2201,"ï¾":278};
+ static const _UW4 = {",":3930,".":3508,"―":-4841,"ã€":3930,"。":3508,"〇":4999,"「":1895,"ã€":3798,
+ "〓":-5156,"ã‚":4752,"ã„":-3435,"ã†":-640,"ãˆ":-2514,"ãŠ":2405,"ã‹":530,"ãŒ":6006,"ã":-4482,
+ "ãŽ":-3821,"ã":-3788,"ã‘":-4376,"ã’":-4734,"ã“":2255,"ã”":1979,"ã•":2864,"ã—":-843,"ã˜":-2506,
+ "ã™":-731,"ãš":1251,"ã›":181,"ã":4091,"ãŸ":5034,"ã ":5408,"ã¡":-3654,"ã£":-5882,"ã¤":-1659,
+ "ã¦":3994,"ã§":7410,"ã¨":4547,"ãª":5433,"ã«":6499,"ã¬":1853,"ã­":1413,"ã®":7396,"ã¯":8578,
+ "ã°":1940,"ã²":4249,"ã³":-4134,"ãµ":1345,"ã¸":6665,"ã¹":-744,"ã»":1464,"ã¾":1051,"ã¿":-2082,
+ "ã‚€":-882,"ã‚":-5046,"ã‚‚":4169,"ゃ":-2666,"ã‚„":2795,"ょ":-1544,"よ":3351,"ら":-2922,"ã‚Š":-9726,
+ "ã‚‹":-14896,"ã‚Œ":-2613,"ã‚":-4570,"ã‚":-1783,"ã‚’":13150,"ã‚“":-2352,"ã‚«":2145,"コ":1789,
+ "セ":1287,"ッ":-724,"ト":-403,"メ":-1635,"ラ":-881,"リ":-541,"ル":-856,"ン":-3637,"・":-4371,
+ "ー":-11870,"一":-2069,"中":2210,"予":782,"事":-190,"井":-1768,"人":1036,"以":544,"会":950,
+ "体":-1286,"作":530,"å´":4292,"å…ˆ":601,"å…š":-2006,"å…±":-1212,"内":584,"円":788,"åˆ":1347,
+ "å‰":1623,"副":3879,"力":-302,"å‹•":-740,"å‹™":-2715,"化":776,"区":4517,"å”":1013,"å‚":1555,
+ "åˆ":-1834,"å’Œ":-681,"å“¡":-910,"器":-851,"回":1500,"国":-619,"園":-1200,"地":866,"å ´":-1410,
+ "å¡":-2094,"士":-1413,"多":1067,"大":571,"å­":-4802,"å­¦":-1397,"定":-1057,"寺":-809,
+ "å°":1910,"屋":-1328,"å±±":-1500,"島":-2056,"å·":-2667,"市":2771,"å¹´":374,"åº":-4556,"後":456,
+ "性":553,"感":916,"所":-1566,"支":856,"改":787,"政":2182,"教":704,"文":522,"方":-856,"日":1798,
+ "時":1829,"最":845,"月":-9066,"木":-485,"æ¥":-442,"æ ¡":-360,"業":-1043,"æ°":5388,"æ°‘":-2716,
+ "æ°—":-910,"æ²¢":-939,"済":-543,"物":-735,"率":672,"çƒ":-1267,"生":-1286,"産":-1101,"ç”°":-2900,
+ "町":1826,"çš„":2586,"ç›®":922,"çœ":-3485,"県":2997,"空":-867,"ç«‹":-2112,"第":788,"ç±³":2937,
+ "ç³»":786,"ç´„":2171,"経":1146,"çµ±":-1169,"ç·":940,"ç·š":-994,"ç½²":749,"者":2145,"能":-730,
+ "般":-852,"è¡Œ":-792,"è¦":792,"è­¦":-1184,"è­°":-244,"è°·":-1000,"賞":730,"車":-1481,"è»":1158,
+ "輪":-1433,"è¾¼":-3370,"è¿‘":929,"é“":-1291,"é¸":2596,"郎":-4866,"都":1192,"野":-1100,"銀":-2213,
+ "長":357,"間":-2344,"院":-2297,"際":-2604,"電":-878,"領":-1659,"題":-792,"館":-1984,"首":1749,
+ "高":2120,"「":1895,"」":3798,"・":-4371,"ッ":-724,"ー":-11870,"カ":2145,"コ":1789,"セ":1287,
+ "ト":-403,"ï¾’":-1635,"ï¾—":-881,"リ":-541,"ï¾™":-856,"ï¾":-3637};
+ static const _UW5 = {",":465,".":-299,"1":-514,"E2":-32768,"]":-2762,"ã€":465,"。":-299,
+ "「":363,"ã‚":1655,"ã„":331,"ã†":-503,"ãˆ":1199,"ãŠ":527,"ã‹":647,"ãŒ":-421,"ã":1624,"ãŽ":1971,
+ "ã":312,"ã’":-983,"ã•":-1537,"ã—":-1371,"ã™":-852,"ã ":-1186,"ã¡":1093,"ã£":52,"ã¤":921,
+ "ã¦":-18,"ã§":-850,"ã¨":-127,"ã©":1682,"ãª":-787,"ã«":-1224,"ã®":-635,"ã¯":-578,"ã¹":1001,
+ "ã¿":502,"ã‚":865,"ゃ":3350,"ょ":854,"ã‚Š":-208,"ã‚‹":429,"ã‚Œ":504,"ã‚":419,"ã‚’":-1264,"ã‚“":327,
+ "イ":241,"ル":451,"ン":-343,"中":-871,"京":722,"会":-1153,"党":-654,"務":3519,"区":-901,
+ "å‘Š":848,"å“¡":2104,"大":-1296,"å­¦":-548,"定":1785,"åµ":-1304,"市":-2991,"席":921,"å¹´":1763,
+ "æ€":872,"所":-814,"挙":1618,"æ–°":-1682,"æ—¥":218,"月":-4353,"査":932,"æ ¼":1356,"æ©Ÿ":-1508,
+ "æ°":-1347,"ç”°":240,"町":-3912,"çš„":-3149,"相":1319,"çœ":-1052,"県":-4003,"ç ”":-997,"社":-278,
+ "空":-813,"çµ±":1955,"者":-2233,"表":663,"語":-1073,"è­°":1219,"é¸":-1018,"郎":-368,"é•·":786,
+ "é–“":1191,"é¡Œ":2368,"館":-689,"1":-514,"E2":-32768,"ï½¢":363,"ï½²":241,"ï¾™":451,"ï¾":-343};
+ static const _UW6 = {",":227,".":808,"1":-270,"E1":306,"ã€":227,"。":808,"ã‚":-307,"ã†":189,
+ "ã‹":241,"ãŒ":-73,"ã":-121,"ã“":-200,"ã˜":1782,"ã™":383,"ãŸ":-428,"ã£":573,"ã¦":-1014,"ã§":101,
+ "ã¨":-105,"ãª":-253,"ã«":-149,"ã®":-417,"ã¯":-236,"ã‚‚":-206,"ã‚Š":187,"ã‚‹":-135,"ã‚’":195,
+ "ル":-673,"ン":-496,"一":-277,"中":201,"件":-800,"会":624,"å‰":302,"区":1792,"å“¡":-1212,
+ "委":798,"å­¦":-960,"市":887,"広":-695,"後":535,"業":-697,"相":753,"社":-507,"ç¦":974,
+ "空":-822,"者":1811,"連":463,"郎":1082,"1":-270,"E1":306,"ï¾™":-673,"ï¾":-496};
+
+ static function _ctype (str : string) : string
+ {
+ for (var i = 0; i < TinySegmenter._chartype.length; i++)
+ {
+ if (str.match(TinySegmenter._chartype[i].re))
+ {
+ return TinySegmenter._chartype[i].type;
+ }
+ }
+ return "O";
+ }
+
+ static function _ts (v : Nullable.<int>) : int
+ {
+ if (v == null)
+ {
+ return 0;
+ }
+ return v;
+ }
+
+ static function segment (input : string) : string []
+ {
+ if (input == "")
+ {
+ return [] : string[];
+ }
+ var result = [] : string[];
+ var seg = ["B3","B2","B1"];
+ var ctype = ["O","O","O"];
+ var o = input.split("");
+ for (var i = 0; i < o.length; ++i)
+ {
+ seg.push(o[i]);
+ ctype.push(TinySegmenter._ctype(o[i]));
+ }
+ seg.push("E1");
+ seg.push("E2");
+ seg.push("E3");
+ ctype.push("O");
+ ctype.push("O");
+ ctype.push("O");
+ var word = seg[3];
+ var p1 = "U";
+ var p2 = "U";
+ var p3 = "U";
+ for (var i = 4; i < seg.length - 3; ++i)
+ {
+ var score = TinySegmenter._BIAS;
+ var w1 = seg[i-3];
+ var w2 = seg[i-2];
+ var w3 = seg[i-1];
+ var w4 = seg[i];
+ var w5 = seg[i+1];
+ var w6 = seg[i+2];
+ var c1 = ctype[i-3];
+ var c2 = ctype[i-2];
+ var c3 = ctype[i-1];
+ var c4 = ctype[i];
+ var c5 = ctype[i+1];
+ var c6 = ctype[i+2];
+ score += TinySegmenter._ts(TinySegmenter._UP1[p1]);
+ score += TinySegmenter._ts(TinySegmenter._UP2[p2]);
+ score += TinySegmenter._ts(TinySegmenter._UP3[p3]);
+ score += TinySegmenter._ts(TinySegmenter._BP1[p1 + p2]);
+ score += TinySegmenter._ts(TinySegmenter._BP2[p2 + p3]);
+ score += TinySegmenter._ts(TinySegmenter._UW1[w1]);
+ score += TinySegmenter._ts(TinySegmenter._UW2[w2]);
+ score += TinySegmenter._ts(TinySegmenter._UW3[w3]);
+ score += TinySegmenter._ts(TinySegmenter._UW4[w4]);
+ score += TinySegmenter._ts(TinySegmenter._UW5[w5]);
+ score += TinySegmenter._ts(TinySegmenter._UW6[w6]);
+ score += TinySegmenter._ts(TinySegmenter._BW1[w2 + w3]);
+ score += TinySegmenter._ts(TinySegmenter._BW2[w3 + w4]);
+ score += TinySegmenter._ts(TinySegmenter._BW3[w4 + w5]);
+ score += TinySegmenter._ts(TinySegmenter._TW1[w1 + w2 + w3]);
+ score += TinySegmenter._ts(TinySegmenter._TW2[w2 + w3 + w4]);
+ score += TinySegmenter._ts(TinySegmenter._TW3[w3 + w4 + w5]);
+ score += TinySegmenter._ts(TinySegmenter._TW4[w4 + w5 + w6]);
+ score += TinySegmenter._ts(TinySegmenter._UC1[c1]);
+ score += TinySegmenter._ts(TinySegmenter._UC2[c2]);
+ score += TinySegmenter._ts(TinySegmenter._UC3[c3]);
+ score += TinySegmenter._ts(TinySegmenter._UC4[c4]);
+ score += TinySegmenter._ts(TinySegmenter._UC5[c5]);
+ score += TinySegmenter._ts(TinySegmenter._UC6[c6]);
+ score += TinySegmenter._ts(TinySegmenter._BC1[c2 + c3]);
+ score += TinySegmenter._ts(TinySegmenter._BC2[c3 + c4]);
+ score += TinySegmenter._ts(TinySegmenter._BC3[c4 + c5]);
+ score += TinySegmenter._ts(TinySegmenter._TC1[c1 + c2 + c3]);
+ score += TinySegmenter._ts(TinySegmenter._TC2[c2 + c3 + c4]);
+ score += TinySegmenter._ts(TinySegmenter._TC3[c3 + c4 + c5]);
+ score += TinySegmenter._ts(TinySegmenter._TC4[c4 + c5 + c6]);
+ // score += TinySegmenter._ts(TinySegmenter._TC5[c4 + c5 + c6]);
+ score += TinySegmenter._ts(TinySegmenter._UQ1[p1 + c1]);
+ score += TinySegmenter._ts(TinySegmenter._UQ2[p2 + c2]);
+ score += TinySegmenter._ts(TinySegmenter._UQ3[p3 + c3]);
+ score += TinySegmenter._ts(TinySegmenter._BQ1[p2 + c2 + c3]);
+ score += TinySegmenter._ts(TinySegmenter._BQ2[p2 + c3 + c4]);
+ score += TinySegmenter._ts(TinySegmenter._BQ3[p3 + c2 + c3]);
+ score += TinySegmenter._ts(TinySegmenter._BQ4[p3 + c3 + c4]);
+ score += TinySegmenter._ts(TinySegmenter._TQ1[p2 + c1 + c2 + c3]);
+ score += TinySegmenter._ts(TinySegmenter._TQ2[p2 + c2 + c3 + c4]);
+ score += TinySegmenter._ts(TinySegmenter._TQ3[p3 + c1 + c2 + c3]);
+ score += TinySegmenter._ts(TinySegmenter._TQ4[p3 + c2 + c3 + c4]);
+ var p = "O";
+ if (score > 0)
+ {
+ result.push(word);
+ word = "";
+ p = "B";
+ }
+ p1 = p2;
+ p2 = p3;
+ p3 = p;
+ word += seg[i];
+ }
+ result.push(word);
+ return result;
+ }
+}
+
+class _Main
+{
+ static function main(args : string[]) : void
+ {
+ // test data from http://www.ai-gakkai.or.jp/jsai/journal/mybookmark/26-6.html
+ var test = "è¿‘å¹´ã€Web技術や計測技術ã®ç™ºå±•ã«ã‚ˆã‚Šè¨€èªžã‚„ゲノムデータã¯å¤§è¦æ¨¡åŒ–ã—ã¦ã„ã¾ã™ã€‚従æ¥ã®ãƒ‡ãƒ¼ã‚¿æ§‹é€ ã¯å¤§è¦æ¨¡ãƒ‡ãƒ¼ã‚¿ã‚’扱ã†ã«ã¯ã‚µã‚¤ã‚ºãŒå¤§ããメモリã«è¼‰ã‚‰ãªã„ã€ã—ã‹ã—ã€åœ§ç¸®ã™ã‚‹ã¨ãƒ©ãƒ³ãƒ€ãƒ ã‚¢ã‚¯ã‚»ã‚¹ã‚’ã™ã‚‹ã“ã¨ãŒã§ããªã„ã¨ã„ã†æ¬ ç‚¹ãŒã‚ã‚Šã¾ã™ã€‚";
+
+ log TinySegmenter.segment(test);
+ }
+}
+
diff --git a/web/server/h2o/libh2o/misc/oktavia/src/wavelet-matrix.jsx b/web/server/h2o/libh2o/misc/oktavia/src/wavelet-matrix.jsx
new file mode 100644
index 00000000..2a07b015
--- /dev/null
+++ b/web/server/h2o/libh2o/misc/oktavia/src/wavelet-matrix.jsx
@@ -0,0 +1,321 @@
+/**
+ * This is a JSX version of shellinford library:
+ * https://code.google.com/p/shellinford/
+ *
+ * License: http://shibu.mit-license.org/
+ */
+
+import "bit-vector.jsx";
+import "binary-util.jsx";
+import "console.jsx";
+
+
+class WaveletMatrix
+{
+ var _bv : BitVector[];
+ var _seps : int[];
+ var _range : Map.<int>;
+ var _bitsize : int;
+ var _size : int;
+
+ function constructor ()
+ {
+ this._range = {} : Map.<int>;
+ this._bv = [] : BitVector[];
+ this._seps = [] : int[];
+ this._bitsize = 16;
+ this.clear();
+ }
+
+ function bitsize () : int
+ {
+ return this._bitsize;
+ }
+
+ function setMaxCharCode (charCode : int) : void
+ {
+ this._bitsize = Math.ceil(Math.log(charCode) / Math.LN2);
+ }
+
+ function clear () : void
+ {
+ this._bv.length = 0;
+ this._seps.length = 0;
+ this._size = 0;
+ }
+
+ function build (v : string) : void
+ {
+ this.clear();
+ var size = v.length;
+ var bitsize = this.bitsize();
+ for (var i = 0; i < bitsize; i++)
+ {
+ this._bv.push(new BitVector);
+ this._seps.push(0);
+ }
+ this._size = size;
+ for (var i = 0; i < size; i++)
+ {
+ this._bv[0].set(i, this._uint2bit(v.charCodeAt(i), 0));
+ }
+ this._bv[0].build();
+ this._seps[0] = this._bv[0].size(false);
+ this._range[0 as string] = 0;
+ this._range[1 as string] = this._seps[0];
+
+ var depth : int = 1;
+ while (depth < bitsize)
+ {
+ var range_tmp = WaveletMatrix._shallow_copy(this._range); // copy
+ for (var i = 0; i < size; i++)
+ {
+ var code = v.charCodeAt(i);
+ var bit = this._uint2bit(code, depth);
+ var key = code >>> (bitsize - depth);
+ this._bv[depth].set(range_tmp[key as string], bit);
+ range_tmp[key as string]++;
+ }
+ this._bv[depth].build();
+ this._seps[depth] = this._bv[depth].size(false);
+
+ var range_rev = {} : Map.<int>;
+ for (var range_key in this._range)
+ {
+ var value : int = this._range[range_key];
+ if (value != range_tmp[range_key])
+ {
+ range_rev[value as string] = range_key as int;
+ }
+ }
+ this._range = {} : Map.<int>;
+ var pos0 = 0;
+ var pos1 = this._seps[depth];
+ for (var range_rev_key in range_rev)
+ {
+ var begin = range_rev_key as int;
+ var value = range_rev[range_rev_key];
+ var end = range_tmp[value as string];
+ var num0 = this._bv[depth].rank(end , false) -
+ this._bv[depth].rank(begin, false);
+ var num1 = end - begin - num0;
+ if (num0 > 0)
+ {
+ this._range[(value << 1) as string] = pos0;
+ pos0 += num0;
+ }
+ if (num1 > 0)
+ {
+ this._range[((value << 1) + 1) as string] = pos1;
+ pos1 += num1;
+ }
+ }
+ depth++;
+ }
+ }
+
+ function size () : int
+ {
+ return this._size;
+ }
+
+ function size (c : int) : int
+ {
+ return this.rank(this.size(), c);
+ }
+
+ function get (i : int) : int
+ {
+ if (i >= this.size())
+ {
+ throw new Error("WaveletMatrix.get() : range error");
+ }
+ var value = 0;
+ var depth = 0;
+ while (depth < this.bitsize())
+ {
+ var bit = this._bv[depth].get(i);
+ i = this._bv[depth].rank(i, bit);
+ value <<= 1;
+ if (bit)
+ {
+ i += this._seps[depth];
+ value += 1;
+ }
+ depth++;
+ }
+ return value;
+ }
+
+ function rank (i : int, c : int) : int
+ {
+ if (i > this.size())
+ {
+ throw new Error("WaveletMatrix.rank(): range error");
+ }
+ if (i == 0)
+ {
+ return 0;
+ }
+
+ var begin = this._range[c as string];
+ if (begin == null)
+ {
+ return 0;
+ }
+ var end = i;
+ var depth = 0;
+ while (depth < this.bitsize())
+ {
+ var bit = this._uint2bit(c, depth);
+ end = this._bv[depth].rank(end, bit);
+ if (bit)
+ {
+ end += this._seps[depth];
+ }
+ depth++;
+ }
+ return end - begin;
+ }
+
+ function rank_less_than (i : int, c : int) : int
+ {
+ if (i > this.size())
+ {
+ throw new Error("WaveletMatrix.rank_less_than(): range error");
+ }
+ if (i == 0)
+ {
+ return 0;
+ }
+
+ var begin = 0;
+ var end = i;
+ var depth = 0;
+ var rlt = 0;
+ while (depth < this.bitsize())
+ {
+ var rank0_begin = this._bv[depth].rank(begin, false);
+ var rank0_end = this._bv[depth].rank(end , false);
+ if (this._uint2bit(c, depth))
+ {
+ rlt += (rank0_end - rank0_begin);
+ begin += (this._seps[depth] - rank0_begin);
+ end += (this._seps[depth] - rank0_end);
+ }
+ else
+ {
+ begin = rank0_begin;
+ end = rank0_end;
+ }
+ depth++;
+ }
+ return rlt;
+ }
+
+ function dump () : string
+ {
+ var contents = [
+ Binary.dump16bitNumber(this._bitsize),
+ Binary.dump32bitNumber(this._size)
+ ];
+ for (var i = 0; i < this.bitsize(); i++)
+ {
+ contents.push(this._bv[i].dump());
+ }
+ for (var i = 0; i < this.bitsize(); i++)
+ {
+ contents.push(Binary.dump32bitNumber(this._seps[i]));
+ }
+ var range_contents = [] : string[];
+ var counter = 0;
+ for (var key in this._range)
+ {
+ range_contents.push(Binary.dump32bitNumber(key as int));
+ range_contents.push(Binary.dump32bitNumber(this._range[key]));
+ counter++;
+ }
+ contents.push(Binary.dump32bitNumber(counter));
+ return contents.join('') + range_contents.join('');
+ }
+
+ function dump (report : CompressionReport) : string
+ {
+ var contents = [
+ Binary.dump16bitNumber(this._bitsize),
+ Binary.dump32bitNumber(this._size)
+ ];
+ report.add(3, 3);
+ for (var i = 0; i < this.bitsize(); i++)
+ {
+ contents.push(this._bv[i].dump(report));
+ }
+ for (var i = 0; i < this.bitsize(); i++)
+ {
+ contents.push(Binary.dump32bitNumber(this._seps[i]));
+ report.add(2, 2);
+ }
+ var range_contents = [] : string[];
+ var counter = 0;
+ for (var key in this._range)
+ {
+ range_contents.push(Binary.dump32bitNumber(key as int));
+ range_contents.push(Binary.dump32bitNumber(this._range[key]));
+ report.add(4, 4);
+ counter++;
+ }
+ report.add(2, 2);
+ contents.push(Binary.dump32bitNumber(counter));
+ return contents.join('') + range_contents.join('');
+ }
+
+ function load (data : string) : int
+ {
+ return this.load(data, 0);
+ }
+
+ function load (data : string, offset : int) : int
+ {
+ this.clear();
+ this._bitsize = Binary.load16bitNumber(data, offset++);
+ this._size = Binary.load32bitNumber(data, offset);
+ offset += 2;
+ for (var i = 0; i < this.bitsize(); i++)
+ {
+ var bit_vector = new BitVector();
+ offset = bit_vector.load(data, offset);
+ this._bv.push(bit_vector);
+ }
+ var sep = 0;
+ for (var i = 0; i < this.bitsize(); i++, offset += 2)
+ {
+ this._seps.push(Binary.load32bitNumber(data, offset));
+ }
+
+ var range_size = Binary.load32bitNumber(data, offset);
+ offset += 2;
+ for (var i = 0; i < range_size; i++, offset += 4)
+ {
+ var key = Binary.load32bitNumber(data, offset);
+ var value = Binary.load32bitNumber(data, offset + 2);
+ this._range[key as string] = value;
+ }
+ return offset;
+ }
+
+ static function _shallow_copy (input : Map.<int>) : Map.<int>
+ {
+ var result = {} : Map.<int>;
+ for (var key in input)
+ {
+ result[key] = input[key];
+ }
+ return result;
+ }
+
+ function _uint2bit (c : int, i : int) : boolean
+ {
+ return ((c >>> (this._bitsize - 1 - i)) & 0x1) == 0x1;
+ }
+}
+
diff --git a/web/server/h2o/libh2o/misc/oktavia/templates/jsdoc3/README.md b/web/server/h2o/libh2o/misc/oktavia/templates/jsdoc3/README.md
new file mode 100644
index 00000000..a7bd96bf
--- /dev/null
+++ b/web/server/h2o/libh2o/misc/oktavia/templates/jsdoc3/README.md
@@ -0,0 +1 @@
+The default template for JSDoc 3 uses: [the Taffy Database library](http://taffydb.com/) and the [Underscore Template library](http://documentcloud.github.com/underscore/#template).
diff --git a/web/server/h2o/libh2o/misc/oktavia/templates/jsdoc3/publish.js b/web/server/h2o/libh2o/misc/oktavia/templates/jsdoc3/publish.js
new file mode 100644
index 00000000..36211462
--- /dev/null
+++ b/web/server/h2o/libh2o/misc/oktavia/templates/jsdoc3/publish.js
@@ -0,0 +1,508 @@
+/*global env: true */
+var template = require('jsdoc/template'),
+ fs = require('jsdoc/fs'),
+ path = require('jsdoc/path'),
+ taffy = require('taffydb').taffy,
+ handle = require('jsdoc/util/error').handle,
+ helper = require('jsdoc/util/templateHelper'),
+ htmlsafe = helper.htmlsafe,
+ linkto = helper.linkto,
+ resolveAuthorLinks = helper.resolveAuthorLinks,
+ scopeToPunc = helper.scopeToPunc,
+ hasOwnProp = Object.prototype.hasOwnProperty,
+ data,
+ view,
+ outdir = env.opts.destination;
+
+
+function find(spec) {
+ return helper.find(data, spec);
+}
+
+function tutoriallink(tutorial) {
+ return helper.toTutorial(tutorial, null, { tag: 'em', classname: 'disabled', prefix: 'Tutorial: ' });
+}
+
+function getAncestorLinks(doclet) {
+ return helper.getAncestorLinks(data, doclet);
+}
+
+function hashToLink(doclet, hash) {
+ if ( !/^(#.+)/.test(hash) ) { return hash; }
+
+ var url = helper.createLink(doclet);
+
+ url = url.replace(/(#.+|$)/, hash);
+ return '<a href="' + url + '">' + hash + '</a>';
+}
+
+function needsSignature(doclet) {
+ var needsSig = false;
+
+ // function and class definitions always get a signature
+ if (doclet.kind === 'function' || doclet.kind === 'class') {
+ needsSig = true;
+ }
+ // typedefs that contain functions get a signature, too
+ else if (doclet.kind === 'typedef' && doclet.type && doclet.type.names &&
+ doclet.type.names.length) {
+ for (var i = 0, l = doclet.type.names.length; i < l; i++) {
+ if (doclet.type.names[i].toLowerCase() === 'function') {
+ needsSig = true;
+ break;
+ }
+ }
+ }
+
+ return needsSig;
+}
+
+function addSignatureParams(f) {
+ var params = helper.getSignatureParams(f, 'optional');
+
+ f.signature = (f.signature || '') + '('+params.join(', ')+')';
+}
+
+function addSignatureReturns(f) {
+ var returnTypes = helper.getSignatureReturns(f);
+
+ f.signature = '<span class="signature">'+(f.signature || '') + '</span>' + '<span class="type-signature">'+(returnTypes.length? ' &rarr; {'+returnTypes.join('|')+'}' : '')+'</span>';
+}
+
+function addSignatureTypes(f) {
+ var types = helper.getSignatureTypes(f);
+
+ f.signature = (f.signature || '') + '<span class="type-signature">'+(types.length? ' :'+types.join('|') : '')+'</span>';
+}
+
+function addAttribs(f) {
+ var attribs = helper.getAttribs(f);
+
+ f.attribs = '<span class="type-signature">'+htmlsafe(attribs.length? '<'+attribs.join(', ')+'> ' : '')+'</span>';
+}
+
+function shortenPaths(files, commonPrefix) {
+ // always use forward slashes
+ var regexp = new RegExp('\\\\', 'g');
+
+ Object.keys(files).forEach(function(file) {
+ files[file].shortened = files[file].resolved.replace(commonPrefix, '')
+ .replace(regexp, '/');
+ });
+
+ return files;
+}
+
+function resolveSourcePath(filepath) {
+ return path.resolve(process.cwd(), filepath);
+}
+
+function getPathFromDoclet(doclet) {
+ if (!doclet.meta) {
+ return;
+ }
+
+ var filepath = doclet.meta.path && doclet.meta.path !== 'null' ?
+ doclet.meta.path + '/' + doclet.meta.filename :
+ doclet.meta.filename;
+
+ return filepath;
+}
+
+function generate(title, docs, filename, resolveLinks) {
+ resolveLinks = resolveLinks === false ? false : true;
+
+ var docData = {
+ title: title,
+ docs: docs
+ };
+
+ var outpath = path.join(outdir, filename),
+ html = view.render('container.tmpl', docData);
+
+ if (resolveLinks) {
+ html = helper.resolveLinks(html); // turn {@link foo} into <a href="foodoc.html">foo</a>
+ }
+
+ fs.writeFileSync(outpath, html, 'utf8');
+}
+
+function generateSourceFiles(sourceFiles) {
+ Object.keys(sourceFiles).forEach(function(file) {
+ var source;
+ // links are keyed to the shortened path in each doclet's `meta.filename` property
+ var sourceOutfile = helper.getUniqueFilename(sourceFiles[file].shortened);
+ helper.registerLink(sourceFiles[file].shortened, sourceOutfile);
+
+ try {
+ source = {
+ kind: 'source',
+ code: helper.htmlsafe( fs.readFileSync(sourceFiles[file].resolved, 'utf8') )
+ };
+ }
+ catch(e) {
+ handle(e);
+ }
+
+ generate('Source: ' + sourceFiles[file].shortened, [source], sourceOutfile,
+ false);
+ });
+}
+
+/**
+ * Create the navigation sidebar.
+ * @param {object} members The members that will be used to create the sidebar.
+ * @param {array<object>} members.classes
+ * @param {array<object>} members.externals
+ * @param {array<object>} members.globals
+ * @param {array<object>} members.mixins
+ * @param {array<object>} members.modules
+ * @param {array<object>} members.namespaces
+ * @param {array<object>} members.tutorials
+ * @param {array<object>} members.events
+ * @return {string} The HTML for the navigation sidebar.
+ */
+function buildNav(members) {
+ var nav = '<h2><a href="index.html">Index</a></h2>',
+ seen = {};
+
+ if (members.modules.length) {
+ nav += '<h3>Modules</h3><ul>';
+ members.modules.forEach(function(m) {
+ if ( !hasOwnProp.call(seen, m.longname) ) {
+ nav += '<li>'+linkto(m.longname, m.name)+'</li>';
+ }
+ seen[m.longname] = true;
+ });
+
+ nav += '</ul>';
+ }
+
+ if (members.externals.length) {
+ nav += '<h3>Externals</h3><ul>';
+ members.externals.forEach(function(e) {
+ if ( !hasOwnProp.call(seen, e.longname) ) {
+ nav += '<li>'+linkto( e.longname, e.name.replace(/(^"|"$)/g, '') )+'</li>';
+ }
+ seen[e.longname] = true;
+ });
+
+ nav += '</ul>';
+ }
+
+ if (members.classes.length) {
+ var moduleClasses = 0;
+ members.classes.forEach(function(c) {
+ var moduleSameName = find({kind: 'module', longname: c.longname});
+ if (moduleSameName.length) {
+ c.name = c.name.replace('module:', 'require("')+'")';
+ moduleClasses++;
+ moduleSameName[0].module = c;
+ }
+ if (moduleClasses !== -1 && moduleClasses < members.classes.length) {
+ nav += '<h3>Classes</h3><ul>';
+ moduleClasses = -1;
+ }
+ if ( !hasOwnProp.call(seen, c.longname) ) {
+ nav += '<li>'+linkto(c.longname, c.name)+'</li>';
+ }
+ seen[c.longname] = true;
+ });
+
+ nav += '</ul>';
+ }
+
+ if (members.events.length) {
+ nav += '<h3>Events</h3><ul>';
+ members.events.forEach(function(e) {
+ if ( !hasOwnProp.call(seen, e.longname) ) {
+ nav += '<li>'+linkto(e.longname, e.name)+'</li>';
+ }
+ seen[e.longname] = true;
+ });
+
+ nav += '</ul>';
+ }
+
+ if (members.namespaces.length) {
+ nav += '<h3>Namespaces</h3><ul>';
+ members.namespaces.forEach(function(n) {
+ if ( !hasOwnProp.call(seen, n.longname) ) {
+ nav += '<li>'+linkto(n.longname, n.name)+'</li>';
+ }
+ seen[n.longname] = true;
+ });
+
+ nav += '</ul>';
+ }
+
+ if (members.mixins.length) {
+ nav += '<h3>Mixins</h3><ul>';
+ members.mixins.forEach(function(m) {
+ if ( !hasOwnProp.call(seen, m.longname) ) {
+ nav += '<li>'+linkto(m.longname, m.name)+'</li>';
+ }
+ seen[m.longname] = true;
+ });
+
+ nav += '</ul>';
+ }
+
+ if (members.tutorials.length) {
+ nav += '<h3>Tutorials</h3><ul>';
+ members.tutorials.forEach(function(t) {
+ nav += '<li>'+tutoriallink(t.name)+'</li>';
+ });
+
+ nav += '</ul>';
+ }
+
+ if (members.globals.length) {
+ nav += '<h3>Global</h3><ul>';
+ members.globals.forEach(function(g) {
+ if ( g.kind !== 'typedef' && !hasOwnProp.call(seen, g.longname) ) {
+ nav += '<li>'+linkto(g.longname, g.name)+'</li>';
+ }
+ seen[g.longname] = true;
+ });
+
+ nav += '</ul>';
+ }
+
+ return nav;
+}
+
+
+/**
+ @param {TAFFY} taffyData See <http://taffydb.com/>.
+ @param {object} opts
+ @param {Tutorial} tutorials
+ */
+exports.publish = function(taffyData, opts, tutorials) {
+ data = taffyData;
+
+ var conf = env.conf.templates || {};
+ conf['default'] = conf['default'] || {};
+
+ var templatePath = opts.template;
+ view = new template.Template(templatePath + '/tmpl');
+
+ // claim some special filenames in advance, so the All-Powerful Overseer of Filename Uniqueness
+ // doesn't try to hand them out later
+ var indexUrl = helper.getUniqueFilename('index');
+ // don't call registerLink() on this one! 'index' is also a valid longname
+
+ var globalUrl = helper.getUniqueFilename('global');
+ helper.registerLink('global', globalUrl);
+
+ // set up templating
+ view.layout = 'layout.tmpl';
+
+ // set up tutorials for helper
+ helper.setTutorials(tutorials);
+
+ data = helper.prune(data);
+ data.sort('longname, version, since');
+
+ var sourceFiles = {};
+ var sourceFilePaths = [];
+ data().each(function(doclet) {
+ doclet.attribs = '';
+
+ if (doclet.examples) {
+ doclet.examples = doclet.examples.map(function(example) {
+ var caption, code;
+
+ if (example.match(/^\s*<caption>([\s\S]+?)<\/caption>(\s*[\n\r])([\s\S]+)$/i)) {
+ caption = RegExp.$1;
+ code = RegExp.$3;
+ }
+
+ return {
+ caption: caption || '',
+ code: code || example
+ };
+ });
+ }
+ if (doclet.see) {
+ doclet.see.forEach(function(seeItem, i) {
+ doclet.see[i] = hashToLink(doclet, seeItem);
+ });
+ }
+
+ // build a list of source files
+ var sourcePath;
+ var resolvedSourcePath;
+ if (doclet.meta) {
+ sourcePath = getPathFromDoclet(doclet);
+ resolvedSourcePath = resolveSourcePath(sourcePath);
+ sourceFiles[sourcePath] = {
+ resolved: resolvedSourcePath,
+ shortened: null
+ };
+ sourceFilePaths.push(resolvedSourcePath);
+ }
+ });
+
+ // update outdir if necessary, then create outdir
+ var packageInfo = ( find({kind: 'package'}) || [] ) [0];
+ if (packageInfo && packageInfo.name) {
+ outdir = path.join(outdir, packageInfo.name, packageInfo.version);
+ }
+ fs.mkPath(outdir);
+
+ // copy static files to outdir
+ var fromDir = path.join(templatePath, 'static'),
+ staticFiles = fs.ls(fromDir, 3);
+
+ staticFiles.forEach(function(fileName) {
+ var toDir = fs.toDir( fileName.replace(fromDir, outdir) );
+ fs.mkPath(toDir);
+ fs.copyFileSync(fileName, toDir);
+ });
+
+ if (sourceFilePaths.length) {
+ sourceFiles = shortenPaths( sourceFiles, path.commonPrefix(sourceFilePaths) );
+ }
+ data().each(function(doclet) {
+ var url = helper.createLink(doclet);
+ helper.registerLink(doclet.longname, url);
+
+ // replace the filename with a shortened version of the full path
+ var docletPath;
+ if (doclet.meta) {
+ docletPath = getPathFromDoclet(doclet);
+ docletPath = sourceFiles[docletPath].shortened;
+ if (docletPath) {
+ doclet.meta.filename = docletPath;
+ }
+ }
+ });
+
+ data().each(function(doclet) {
+ var url = helper.longnameToUrl[doclet.longname];
+
+ if (url.indexOf('#') > -1) {
+ doclet.id = helper.longnameToUrl[doclet.longname].split(/#/).pop();
+ }
+ else {
+ doclet.id = doclet.name;
+ }
+
+ if ( needsSignature(doclet) ) {
+ addSignatureParams(doclet);
+ addSignatureReturns(doclet);
+ addAttribs(doclet);
+ }
+ });
+
+ // do this after the urls have all been generated
+ data().each(function(doclet) {
+ doclet.ancestors = getAncestorLinks(doclet);
+
+ if (doclet.kind === 'member') {
+ addSignatureTypes(doclet);
+ addAttribs(doclet);
+ }
+
+ if (doclet.kind === 'constant') {
+ addSignatureTypes(doclet);
+ addAttribs(doclet);
+ doclet.kind = 'member';
+ }
+ });
+
+ var members = helper.getMembers(data);
+ members.tutorials = tutorials.children;
+
+ // add template helpers
+ view.find = find;
+ view.linkto = linkto;
+ view.resolveAuthorLinks = resolveAuthorLinks;
+ view.tutoriallink = tutoriallink;
+ view.htmlsafe = htmlsafe;
+
+ // once for all
+ view.nav = buildNav(members);
+
+ // only output pretty-printed source files if requested; do this before generating any other
+ // pages, so the other pages can link to the source files
+ if (conf['default'].outputSourceFiles) {
+ generateSourceFiles(sourceFiles);
+ }
+
+ if (members.globals.length) { generate('Global', [{kind: 'globalobj'}], globalUrl); }
+
+ // index page displays information from package.json and lists files
+ var files = find({kind: 'file'}),
+ packages = find({kind: 'package'});
+
+ generate('Index',
+ packages.concat(
+ [{kind: 'mainpage', readme: opts.readme, longname: (opts.mainpagetitle) ? opts.mainpagetitle : 'Main Page'}]
+ ).concat(files),
+ indexUrl);
+
+ // set up the lists that we'll use to generate pages
+ var classes = taffy(members.classes);
+ var modules = taffy(members.modules);
+ var namespaces = taffy(members.namespaces);
+ var mixins = taffy(members.mixins);
+ var externals = taffy(members.externals);
+
+ for (var longname in helper.longnameToUrl) {
+ if ( hasOwnProp.call(helper.longnameToUrl, longname) ) {
+ var myClasses = helper.find(classes, {longname: longname});
+ if (myClasses.length) {
+ generate('Class: ' + myClasses[0].name, myClasses, helper.longnameToUrl[longname]);
+ }
+
+ var myModules = helper.find(modules, {longname: longname});
+ if (myModules.length) {
+ generate('Module: ' + myModules[0].name, myModules, helper.longnameToUrl[longname]);
+ }
+
+ var myNamespaces = helper.find(namespaces, {longname: longname});
+ if (myNamespaces.length) {
+ generate('Namespace: ' + myNamespaces[0].name, myNamespaces, helper.longnameToUrl[longname]);
+ }
+
+ var myMixins = helper.find(mixins, {longname: longname});
+ if (myMixins.length) {
+ generate('Mixin: ' + myMixins[0].name, myMixins, helper.longnameToUrl[longname]);
+ }
+
+ var myExternals = helper.find(externals, {longname: longname});
+ if (myExternals.length) {
+ generate('External: ' + myExternals[0].name, myExternals, helper.longnameToUrl[longname]);
+ }
+ }
+ }
+
+ // TODO: move the tutorial functions to templateHelper.js
+ function generateTutorial(title, tutorial, filename) {
+ var tutorialData = {
+ title: title,
+ header: tutorial.title,
+ content: tutorial.parse(),
+ children: tutorial.children
+ };
+
+ var tutorialPath = path.join(outdir, filename),
+ html = view.render('tutorial.tmpl', tutorialData);
+
+ // yes, you can use {@link} in tutorials too!
+ html = helper.resolveLinks(html); // turn {@link foo} into <a href="foodoc.html">foo</a>
+
+ fs.writeFileSync(tutorialPath, html, 'utf8');
+ }
+
+ // tutorials can have only one parent so there is no risk for loops
+ function saveChildren(node) {
+ node.children.forEach(function(child) {
+ generateTutorial('Tutorial: ' + child.title, child, helper.tutorialToUrl(child.name));
+ saveChildren(child);
+ });
+ }
+ saveChildren(tutorials);
+};
diff --git a/web/server/h2o/libh2o/misc/oktavia/templates/jsdoc3/static/scripts/jquery-1.9.1.min.js b/web/server/h2o/libh2o/misc/oktavia/templates/jsdoc3/static/scripts/jquery-1.9.1.min.js
new file mode 100644
index 00000000..006e9531
--- /dev/null
+++ b/web/server/h2o/libh2o/misc/oktavia/templates/jsdoc3/static/scripts/jquery-1.9.1.min.js
@@ -0,0 +1,5 @@
+/*! jQuery v1.9.1 | (c) 2005, 2012 jQuery Foundation, Inc. | jquery.org/license
+//@ sourceMappingURL=jquery.min.map
+*/(function(e,t){var n,r,i=typeof t,o=e.document,a=e.location,s=e.jQuery,u=e.$,l={},c=[],p="1.9.1",f=c.concat,d=c.push,h=c.slice,g=c.indexOf,m=l.toString,y=l.hasOwnProperty,v=p.trim,b=function(e,t){return new b.fn.init(e,t,r)},x=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,w=/\S+/g,T=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,N=/^(?:(<[\w\W]+>)[^>]*|#([\w-]*))$/,C=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,k=/^[\],:{}\s]*$/,E=/(?:^|:|,)(?:\s*\[)+/g,S=/\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,A=/"[^"\\\r\n]*"|true|false|null|-?(?:\d+\.|)\d+(?:[eE][+-]?\d+|)/g,j=/^-ms-/,D=/-([\da-z])/gi,L=function(e,t){return t.toUpperCase()},H=function(e){(o.addEventListener||"load"===e.type||"complete"===o.readyState)&&(q(),b.ready())},q=function(){o.addEventListener?(o.removeEventListener("DOMContentLoaded",H,!1),e.removeEventListener("load",H,!1)):(o.detachEvent("onreadystatechange",H),e.detachEvent("onload",H))};b.fn=b.prototype={jquery:p,constructor:b,init:function(e,n,r){var i,a;if(!e)return this;if("string"==typeof e){if(i="<"===e.charAt(0)&&">"===e.charAt(e.length-1)&&e.length>=3?[null,e,null]:N.exec(e),!i||!i[1]&&n)return!n||n.jquery?(n||r).find(e):this.constructor(n).find(e);if(i[1]){if(n=n instanceof b?n[0]:n,b.merge(this,b.parseHTML(i[1],n&&n.nodeType?n.ownerDocument||n:o,!0)),C.test(i[1])&&b.isPlainObject(n))for(i in n)b.isFunction(this[i])?this[i](n[i]):this.attr(i,n[i]);return this}if(a=o.getElementById(i[2]),a&&a.parentNode){if(a.id!==i[2])return r.find(e);this.length=1,this[0]=a}return this.context=o,this.selector=e,this}return e.nodeType?(this.context=this[0]=e,this.length=1,this):b.isFunction(e)?r.ready(e):(e.selector!==t&&(this.selector=e.selector,this.context=e.context),b.makeArray(e,this))},selector:"",length:0,size:function(){return this.length},toArray:function(){return h.call(this)},get:function(e){return null==e?this.toArray():0>e?this[this.length+e]:this[e]},pushStack:function(e){var t=b.merge(this.constructor(),e);return t.prevObject=this,t.context=this.context,t},each:function(e,t){return b.each(this,e,t)},ready:function(e){return b.ready.promise().done(e),this},slice:function(){return this.pushStack(h.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(e){var t=this.length,n=+e+(0>e?t:0);return this.pushStack(n>=0&&t>n?[this[n]]:[])},map:function(e){return this.pushStack(b.map(this,function(t,n){return e.call(t,n,t)}))},end:function(){return this.prevObject||this.constructor(null)},push:d,sort:[].sort,splice:[].splice},b.fn.init.prototype=b.fn,b.extend=b.fn.extend=function(){var e,n,r,i,o,a,s=arguments[0]||{},u=1,l=arguments.length,c=!1;for("boolean"==typeof s&&(c=s,s=arguments[1]||{},u=2),"object"==typeof s||b.isFunction(s)||(s={}),l===u&&(s=this,--u);l>u;u++)if(null!=(o=arguments[u]))for(i in o)e=s[i],r=o[i],s!==r&&(c&&r&&(b.isPlainObject(r)||(n=b.isArray(r)))?(n?(n=!1,a=e&&b.isArray(e)?e:[]):a=e&&b.isPlainObject(e)?e:{},s[i]=b.extend(c,a,r)):r!==t&&(s[i]=r));return s},b.extend({noConflict:function(t){return e.$===b&&(e.$=u),t&&e.jQuery===b&&(e.jQuery=s),b},isReady:!1,readyWait:1,holdReady:function(e){e?b.readyWait++:b.ready(!0)},ready:function(e){if(e===!0?!--b.readyWait:!b.isReady){if(!o.body)return setTimeout(b.ready);b.isReady=!0,e!==!0&&--b.readyWait>0||(n.resolveWith(o,[b]),b.fn.trigger&&b(o).trigger("ready").off("ready"))}},isFunction:function(e){return"function"===b.type(e)},isArray:Array.isArray||function(e){return"array"===b.type(e)},isWindow:function(e){return null!=e&&e==e.window},isNumeric:function(e){return!isNaN(parseFloat(e))&&isFinite(e)},type:function(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?l[m.call(e)]||"object":typeof e},isPlainObject:function(e){if(!e||"object"!==b.type(e)||e.nodeType||b.isWindow(e))return!1;try{if(e.constructor&&!y.call(e,"constructor")&&!y.call(e.constructor.prototype,"isPrototypeOf"))return!1}catch(n){return!1}var r;for(r in e);return r===t||y.call(e,r)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},error:function(e){throw Error(e)},parseHTML:function(e,t,n){if(!e||"string"!=typeof e)return null;"boolean"==typeof t&&(n=t,t=!1),t=t||o;var r=C.exec(e),i=!n&&[];return r?[t.createElement(r[1])]:(r=b.buildFragment([e],t,i),i&&b(i).remove(),b.merge([],r.childNodes))},parseJSON:function(n){return e.JSON&&e.JSON.parse?e.JSON.parse(n):null===n?n:"string"==typeof n&&(n=b.trim(n),n&&k.test(n.replace(S,"@").replace(A,"]").replace(E,"")))?Function("return "+n)():(b.error("Invalid JSON: "+n),t)},parseXML:function(n){var r,i;if(!n||"string"!=typeof n)return null;try{e.DOMParser?(i=new DOMParser,r=i.parseFromString(n,"text/xml")):(r=new ActiveXObject("Microsoft.XMLDOM"),r.async="false",r.loadXML(n))}catch(o){r=t}return r&&r.documentElement&&!r.getElementsByTagName("parsererror").length||b.error("Invalid XML: "+n),r},noop:function(){},globalEval:function(t){t&&b.trim(t)&&(e.execScript||function(t){e.eval.call(e,t)})(t)},camelCase:function(e){return e.replace(j,"ms-").replace(D,L)},nodeName:function(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()},each:function(e,t,n){var r,i=0,o=e.length,a=M(e);if(n){if(a){for(;o>i;i++)if(r=t.apply(e[i],n),r===!1)break}else for(i in e)if(r=t.apply(e[i],n),r===!1)break}else if(a){for(;o>i;i++)if(r=t.call(e[i],i,e[i]),r===!1)break}else for(i in e)if(r=t.call(e[i],i,e[i]),r===!1)break;return e},trim:v&&!v.call("\ufeff\u00a0")?function(e){return null==e?"":v.call(e)}:function(e){return null==e?"":(e+"").replace(T,"")},makeArray:function(e,t){var n=t||[];return null!=e&&(M(Object(e))?b.merge(n,"string"==typeof e?[e]:e):d.call(n,e)),n},inArray:function(e,t,n){var r;if(t){if(g)return g.call(t,e,n);for(r=t.length,n=n?0>n?Math.max(0,r+n):n:0;r>n;n++)if(n in t&&t[n]===e)return n}return-1},merge:function(e,n){var r=n.length,i=e.length,o=0;if("number"==typeof r)for(;r>o;o++)e[i++]=n[o];else while(n[o]!==t)e[i++]=n[o++];return e.length=i,e},grep:function(e,t,n){var r,i=[],o=0,a=e.length;for(n=!!n;a>o;o++)r=!!t(e[o],o),n!==r&&i.push(e[o]);return i},map:function(e,t,n){var r,i=0,o=e.length,a=M(e),s=[];if(a)for(;o>i;i++)r=t(e[i],i,n),null!=r&&(s[s.length]=r);else for(i in e)r=t(e[i],i,n),null!=r&&(s[s.length]=r);return f.apply([],s)},guid:1,proxy:function(e,n){var r,i,o;return"string"==typeof n&&(o=e[n],n=e,e=o),b.isFunction(e)?(r=h.call(arguments,2),i=function(){return e.apply(n||this,r.concat(h.call(arguments)))},i.guid=e.guid=e.guid||b.guid++,i):t},access:function(e,n,r,i,o,a,s){var u=0,l=e.length,c=null==r;if("object"===b.type(r)){o=!0;for(u in r)b.access(e,n,u,r[u],!0,a,s)}else if(i!==t&&(o=!0,b.isFunction(i)||(s=!0),c&&(s?(n.call(e,i),n=null):(c=n,n=function(e,t,n){return c.call(b(e),n)})),n))for(;l>u;u++)n(e[u],r,s?i:i.call(e[u],u,n(e[u],r)));return o?e:c?n.call(e):l?n(e[0],r):a},now:function(){return(new Date).getTime()}}),b.ready.promise=function(t){if(!n)if(n=b.Deferred(),"complete"===o.readyState)setTimeout(b.ready);else if(o.addEventListener)o.addEventListener("DOMContentLoaded",H,!1),e.addEventListener("load",H,!1);else{o.attachEvent("onreadystatechange",H),e.attachEvent("onload",H);var r=!1;try{r=null==e.frameElement&&o.documentElement}catch(i){}r&&r.doScroll&&function a(){if(!b.isReady){try{r.doScroll("left")}catch(e){return setTimeout(a,50)}q(),b.ready()}}()}return n.promise(t)},b.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(e,t){l["[object "+t+"]"]=t.toLowerCase()});function M(e){var t=e.length,n=b.type(e);return b.isWindow(e)?!1:1===e.nodeType&&t?!0:"array"===n||"function"!==n&&(0===t||"number"==typeof t&&t>0&&t-1 in e)}r=b(o);var _={};function F(e){var t=_[e]={};return b.each(e.match(w)||[],function(e,n){t[n]=!0}),t}b.Callbacks=function(e){e="string"==typeof e?_[e]||F(e):b.extend({},e);var n,r,i,o,a,s,u=[],l=!e.once&&[],c=function(t){for(r=e.memory&&t,i=!0,a=s||0,s=0,o=u.length,n=!0;u&&o>a;a++)if(u[a].apply(t[0],t[1])===!1&&e.stopOnFalse){r=!1;break}n=!1,u&&(l?l.length&&c(l.shift()):r?u=[]:p.disable())},p={add:function(){if(u){var t=u.length;(function i(t){b.each(t,function(t,n){var r=b.type(n);"function"===r?e.unique&&p.has(n)||u.push(n):n&&n.length&&"string"!==r&&i(n)})})(arguments),n?o=u.length:r&&(s=t,c(r))}return this},remove:function(){return u&&b.each(arguments,function(e,t){var r;while((r=b.inArray(t,u,r))>-1)u.splice(r,1),n&&(o>=r&&o--,a>=r&&a--)}),this},has:function(e){return e?b.inArray(e,u)>-1:!(!u||!u.length)},empty:function(){return u=[],this},disable:function(){return u=l=r=t,this},disabled:function(){return!u},lock:function(){return l=t,r||p.disable(),this},locked:function(){return!l},fireWith:function(e,t){return t=t||[],t=[e,t.slice?t.slice():t],!u||i&&!l||(n?l.push(t):c(t)),this},fire:function(){return p.fireWith(this,arguments),this},fired:function(){return!!i}};return p},b.extend({Deferred:function(e){var t=[["resolve","done",b.Callbacks("once memory"),"resolved"],["reject","fail",b.Callbacks("once memory"),"rejected"],["notify","progress",b.Callbacks("memory")]],n="pending",r={state:function(){return n},always:function(){return i.done(arguments).fail(arguments),this},then:function(){var e=arguments;return b.Deferred(function(n){b.each(t,function(t,o){var a=o[0],s=b.isFunction(e[t])&&e[t];i[o[1]](function(){var e=s&&s.apply(this,arguments);e&&b.isFunction(e.promise)?e.promise().done(n.resolve).fail(n.reject).progress(n.notify):n[a+"With"](this===r?n.promise():this,s?[e]:arguments)})}),e=null}).promise()},promise:function(e){return null!=e?b.extend(e,r):r}},i={};return r.pipe=r.then,b.each(t,function(e,o){var a=o[2],s=o[3];r[o[1]]=a.add,s&&a.add(function(){n=s},t[1^e][2].disable,t[2][2].lock),i[o[0]]=function(){return i[o[0]+"With"](this===i?r:this,arguments),this},i[o[0]+"With"]=a.fireWith}),r.promise(i),e&&e.call(i,i),i},when:function(e){var t=0,n=h.call(arguments),r=n.length,i=1!==r||e&&b.isFunction(e.promise)?r:0,o=1===i?e:b.Deferred(),a=function(e,t,n){return function(r){t[e]=this,n[e]=arguments.length>1?h.call(arguments):r,n===s?o.notifyWith(t,n):--i||o.resolveWith(t,n)}},s,u,l;if(r>1)for(s=Array(r),u=Array(r),l=Array(r);r>t;t++)n[t]&&b.isFunction(n[t].promise)?n[t].promise().done(a(t,l,n)).fail(o.reject).progress(a(t,u,s)):--i;return i||o.resolveWith(l,n),o.promise()}}),b.support=function(){var t,n,r,a,s,u,l,c,p,f,d=o.createElement("div");if(d.setAttribute("className","t"),d.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",n=d.getElementsByTagName("*"),r=d.getElementsByTagName("a")[0],!n||!r||!n.length)return{};s=o.createElement("select"),l=s.appendChild(o.createElement("option")),a=d.getElementsByTagName("input")[0],r.style.cssText="top:1px;float:left;opacity:.5",t={getSetAttribute:"t"!==d.className,leadingWhitespace:3===d.firstChild.nodeType,tbody:!d.getElementsByTagName("tbody").length,htmlSerialize:!!d.getElementsByTagName("link").length,style:/top/.test(r.getAttribute("style")),hrefNormalized:"/a"===r.getAttribute("href"),opacity:/^0.5/.test(r.style.opacity),cssFloat:!!r.style.cssFloat,checkOn:!!a.value,optSelected:l.selected,enctype:!!o.createElement("form").enctype,html5Clone:"<:nav></:nav>"!==o.createElement("nav").cloneNode(!0).outerHTML,boxModel:"CSS1Compat"===o.compatMode,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0,boxSizingReliable:!0,pixelPosition:!1},a.checked=!0,t.noCloneChecked=a.cloneNode(!0).checked,s.disabled=!0,t.optDisabled=!l.disabled;try{delete d.test}catch(h){t.deleteExpando=!1}a=o.createElement("input"),a.setAttribute("value",""),t.input=""===a.getAttribute("value"),a.value="t",a.setAttribute("type","radio"),t.radioValue="t"===a.value,a.setAttribute("checked","t"),a.setAttribute("name","t"),u=o.createDocumentFragment(),u.appendChild(a),t.appendChecked=a.checked,t.checkClone=u.cloneNode(!0).cloneNode(!0).lastChild.checked,d.attachEvent&&(d.attachEvent("onclick",function(){t.noCloneEvent=!1}),d.cloneNode(!0).click());for(f in{submit:!0,change:!0,focusin:!0})d.setAttribute(c="on"+f,"t"),t[f+"Bubbles"]=c in e||d.attributes[c].expando===!1;return d.style.backgroundClip="content-box",d.cloneNode(!0).style.backgroundClip="",t.clearCloneStyle="content-box"===d.style.backgroundClip,b(function(){var n,r,a,s="padding:0;margin:0;border:0;display:block;box-sizing:content-box;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;",u=o.getElementsByTagName("body")[0];u&&(n=o.createElement("div"),n.style.cssText="border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px",u.appendChild(n).appendChild(d),d.innerHTML="<table><tr><td></td><td>t</td></tr></table>",a=d.getElementsByTagName("td"),a[0].style.cssText="padding:0;margin:0;border:0;display:none",p=0===a[0].offsetHeight,a[0].style.display="",a[1].style.display="none",t.reliableHiddenOffsets=p&&0===a[0].offsetHeight,d.innerHTML="",d.style.cssText="box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;",t.boxSizing=4===d.offsetWidth,t.doesNotIncludeMarginInBodyOffset=1!==u.offsetTop,e.getComputedStyle&&(t.pixelPosition="1%"!==(e.getComputedStyle(d,null)||{}).top,t.boxSizingReliable="4px"===(e.getComputedStyle(d,null)||{width:"4px"}).width,r=d.appendChild(o.createElement("div")),r.style.cssText=d.style.cssText=s,r.style.marginRight=r.style.width="0",d.style.width="1px",t.reliableMarginRight=!parseFloat((e.getComputedStyle(r,null)||{}).marginRight)),typeof d.style.zoom!==i&&(d.innerHTML="",d.style.cssText=s+"width:1px;padding:1px;display:inline;zoom:1",t.inlineBlockNeedsLayout=3===d.offsetWidth,d.style.display="block",d.innerHTML="<div></div>",d.firstChild.style.width="5px",t.shrinkWrapBlocks=3!==d.offsetWidth,t.inlineBlockNeedsLayout&&(u.style.zoom=1)),u.removeChild(n),n=d=a=r=null)}),n=s=u=l=r=a=null,t}();var O=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/,B=/([A-Z])/g;function P(e,n,r,i){if(b.acceptData(e)){var o,a,s=b.expando,u="string"==typeof n,l=e.nodeType,p=l?b.cache:e,f=l?e[s]:e[s]&&s;if(f&&p[f]&&(i||p[f].data)||!u||r!==t)return f||(l?e[s]=f=c.pop()||b.guid++:f=s),p[f]||(p[f]={},l||(p[f].toJSON=b.noop)),("object"==typeof n||"function"==typeof n)&&(i?p[f]=b.extend(p[f],n):p[f].data=b.extend(p[f].data,n)),o=p[f],i||(o.data||(o.data={}),o=o.data),r!==t&&(o[b.camelCase(n)]=r),u?(a=o[n],null==a&&(a=o[b.camelCase(n)])):a=o,a}}function R(e,t,n){if(b.acceptData(e)){var r,i,o,a=e.nodeType,s=a?b.cache:e,u=a?e[b.expando]:b.expando;if(s[u]){if(t&&(o=n?s[u]:s[u].data)){b.isArray(t)?t=t.concat(b.map(t,b.camelCase)):t in o?t=[t]:(t=b.camelCase(t),t=t in o?[t]:t.split(" "));for(r=0,i=t.length;i>r;r++)delete o[t[r]];if(!(n?$:b.isEmptyObject)(o))return}(n||(delete s[u].data,$(s[u])))&&(a?b.cleanData([e],!0):b.support.deleteExpando||s!=s.window?delete s[u]:s[u]=null)}}}b.extend({cache:{},expando:"jQuery"+(p+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(e){return e=e.nodeType?b.cache[e[b.expando]]:e[b.expando],!!e&&!$(e)},data:function(e,t,n){return P(e,t,n)},removeData:function(e,t){return R(e,t)},_data:function(e,t,n){return P(e,t,n,!0)},_removeData:function(e,t){return R(e,t,!0)},acceptData:function(e){if(e.nodeType&&1!==e.nodeType&&9!==e.nodeType)return!1;var t=e.nodeName&&b.noData[e.nodeName.toLowerCase()];return!t||t!==!0&&e.getAttribute("classid")===t}}),b.fn.extend({data:function(e,n){var r,i,o=this[0],a=0,s=null;if(e===t){if(this.length&&(s=b.data(o),1===o.nodeType&&!b._data(o,"parsedAttrs"))){for(r=o.attributes;r.length>a;a++)i=r[a].name,i.indexOf("data-")||(i=b.camelCase(i.slice(5)),W(o,i,s[i]));b._data(o,"parsedAttrs",!0)}return s}return"object"==typeof e?this.each(function(){b.data(this,e)}):b.access(this,function(n){return n===t?o?W(o,e,b.data(o,e)):null:(this.each(function(){b.data(this,e,n)}),t)},null,n,arguments.length>1,null,!0)},removeData:function(e){return this.each(function(){b.removeData(this,e)})}});function W(e,n,r){if(r===t&&1===e.nodeType){var i="data-"+n.replace(B,"-$1").toLowerCase();if(r=e.getAttribute(i),"string"==typeof r){try{r="true"===r?!0:"false"===r?!1:"null"===r?null:+r+""===r?+r:O.test(r)?b.parseJSON(r):r}catch(o){}b.data(e,n,r)}else r=t}return r}function $(e){var t;for(t in e)if(("data"!==t||!b.isEmptyObject(e[t]))&&"toJSON"!==t)return!1;return!0}b.extend({queue:function(e,n,r){var i;return e?(n=(n||"fx")+"queue",i=b._data(e,n),r&&(!i||b.isArray(r)?i=b._data(e,n,b.makeArray(r)):i.push(r)),i||[]):t},dequeue:function(e,t){t=t||"fx";var n=b.queue(e,t),r=n.length,i=n.shift(),o=b._queueHooks(e,t),a=function(){b.dequeue(e,t)};"inprogress"===i&&(i=n.shift(),r--),o.cur=i,i&&("fx"===t&&n.unshift("inprogress"),delete o.stop,i.call(e,a,o)),!r&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return b._data(e,n)||b._data(e,n,{empty:b.Callbacks("once memory").add(function(){b._removeData(e,t+"queue"),b._removeData(e,n)})})}}),b.fn.extend({queue:function(e,n){var r=2;return"string"!=typeof e&&(n=e,e="fx",r--),r>arguments.length?b.queue(this[0],e):n===t?this:this.each(function(){var t=b.queue(this,e,n);b._queueHooks(this,e),"fx"===e&&"inprogress"!==t[0]&&b.dequeue(this,e)})},dequeue:function(e){return this.each(function(){b.dequeue(this,e)})},delay:function(e,t){return e=b.fx?b.fx.speeds[e]||e:e,t=t||"fx",this.queue(t,function(t,n){var r=setTimeout(t,e);n.stop=function(){clearTimeout(r)}})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,n){var r,i=1,o=b.Deferred(),a=this,s=this.length,u=function(){--i||o.resolveWith(a,[a])};"string"!=typeof e&&(n=e,e=t),e=e||"fx";while(s--)r=b._data(a[s],e+"queueHooks"),r&&r.empty&&(i++,r.empty.add(u));return u(),o.promise(n)}});var I,z,X=/[\t\r\n]/g,U=/\r/g,V=/^(?:input|select|textarea|button|object)$/i,Y=/^(?:a|area)$/i,J=/^(?:checked|selected|autofocus|autoplay|async|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped)$/i,G=/^(?:checked|selected)$/i,Q=b.support.getSetAttribute,K=b.support.input;b.fn.extend({attr:function(e,t){return b.access(this,b.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each(function(){b.removeAttr(this,e)})},prop:function(e,t){return b.access(this,b.prop,e,t,arguments.length>1)},removeProp:function(e){return e=b.propFix[e]||e,this.each(function(){try{this[e]=t,delete this[e]}catch(n){}})},addClass:function(e){var t,n,r,i,o,a=0,s=this.length,u="string"==typeof e&&e;if(b.isFunction(e))return this.each(function(t){b(this).addClass(e.call(this,t,this.className))});if(u)for(t=(e||"").match(w)||[];s>a;a++)if(n=this[a],r=1===n.nodeType&&(n.className?(" "+n.className+" ").replace(X," "):" ")){o=0;while(i=t[o++])0>r.indexOf(" "+i+" ")&&(r+=i+" ");n.className=b.trim(r)}return this},removeClass:function(e){var t,n,r,i,o,a=0,s=this.length,u=0===arguments.length||"string"==typeof e&&e;if(b.isFunction(e))return this.each(function(t){b(this).removeClass(e.call(this,t,this.className))});if(u)for(t=(e||"").match(w)||[];s>a;a++)if(n=this[a],r=1===n.nodeType&&(n.className?(" "+n.className+" ").replace(X," "):"")){o=0;while(i=t[o++])while(r.indexOf(" "+i+" ")>=0)r=r.replace(" "+i+" "," ");n.className=e?b.trim(r):""}return this},toggleClass:function(e,t){var n=typeof e,r="boolean"==typeof t;return b.isFunction(e)?this.each(function(n){b(this).toggleClass(e.call(this,n,this.className,t),t)}):this.each(function(){if("string"===n){var o,a=0,s=b(this),u=t,l=e.match(w)||[];while(o=l[a++])u=r?u:!s.hasClass(o),s[u?"addClass":"removeClass"](o)}else(n===i||"boolean"===n)&&(this.className&&b._data(this,"__className__",this.className),this.className=this.className||e===!1?"":b._data(this,"__className__")||"")})},hasClass:function(e){var t=" "+e+" ",n=0,r=this.length;for(;r>n;n++)if(1===this[n].nodeType&&(" "+this[n].className+" ").replace(X," ").indexOf(t)>=0)return!0;return!1},val:function(e){var n,r,i,o=this[0];{if(arguments.length)return i=b.isFunction(e),this.each(function(n){var o,a=b(this);1===this.nodeType&&(o=i?e.call(this,n,a.val()):e,null==o?o="":"number"==typeof o?o+="":b.isArray(o)&&(o=b.map(o,function(e){return null==e?"":e+""})),r=b.valHooks[this.type]||b.valHooks[this.nodeName.toLowerCase()],r&&"set"in r&&r.set(this,o,"value")!==t||(this.value=o))});if(o)return r=b.valHooks[o.type]||b.valHooks[o.nodeName.toLowerCase()],r&&"get"in r&&(n=r.get(o,"value"))!==t?n:(n=o.value,"string"==typeof n?n.replace(U,""):null==n?"":n)}}}),b.extend({valHooks:{option:{get:function(e){var t=e.attributes.value;return!t||t.specified?e.value:e.text}},select:{get:function(e){var t,n,r=e.options,i=e.selectedIndex,o="select-one"===e.type||0>i,a=o?null:[],s=o?i+1:r.length,u=0>i?s:o?i:0;for(;s>u;u++)if(n=r[u],!(!n.selected&&u!==i||(b.support.optDisabled?n.disabled:null!==n.getAttribute("disabled"))||n.parentNode.disabled&&b.nodeName(n.parentNode,"optgroup"))){if(t=b(n).val(),o)return t;a.push(t)}return a},set:function(e,t){var n=b.makeArray(t);return b(e).find("option").each(function(){this.selected=b.inArray(b(this).val(),n)>=0}),n.length||(e.selectedIndex=-1),n}}},attr:function(e,n,r){var o,a,s,u=e.nodeType;if(e&&3!==u&&8!==u&&2!==u)return typeof e.getAttribute===i?b.prop(e,n,r):(a=1!==u||!b.isXMLDoc(e),a&&(n=n.toLowerCase(),o=b.attrHooks[n]||(J.test(n)?z:I)),r===t?o&&a&&"get"in o&&null!==(s=o.get(e,n))?s:(typeof e.getAttribute!==i&&(s=e.getAttribute(n)),null==s?t:s):null!==r?o&&a&&"set"in o&&(s=o.set(e,r,n))!==t?s:(e.setAttribute(n,r+""),r):(b.removeAttr(e,n),t))},removeAttr:function(e,t){var n,r,i=0,o=t&&t.match(w);if(o&&1===e.nodeType)while(n=o[i++])r=b.propFix[n]||n,J.test(n)?!Q&&G.test(n)?e[b.camelCase("default-"+n)]=e[r]=!1:e[r]=!1:b.attr(e,n,""),e.removeAttribute(Q?n:r)},attrHooks:{type:{set:function(e,t){if(!b.support.radioValue&&"radio"===t&&b.nodeName(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},propFix:{tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},prop:function(e,n,r){var i,o,a,s=e.nodeType;if(e&&3!==s&&8!==s&&2!==s)return a=1!==s||!b.isXMLDoc(e),a&&(n=b.propFix[n]||n,o=b.propHooks[n]),r!==t?o&&"set"in o&&(i=o.set(e,r,n))!==t?i:e[n]=r:o&&"get"in o&&null!==(i=o.get(e,n))?i:e[n]},propHooks:{tabIndex:{get:function(e){var n=e.getAttributeNode("tabindex");return n&&n.specified?parseInt(n.value,10):V.test(e.nodeName)||Y.test(e.nodeName)&&e.href?0:t}}}}),z={get:function(e,n){var r=b.prop(e,n),i="boolean"==typeof r&&e.getAttribute(n),o="boolean"==typeof r?K&&Q?null!=i:G.test(n)?e[b.camelCase("default-"+n)]:!!i:e.getAttributeNode(n);return o&&o.value!==!1?n.toLowerCase():t},set:function(e,t,n){return t===!1?b.removeAttr(e,n):K&&Q||!G.test(n)?e.setAttribute(!Q&&b.propFix[n]||n,n):e[b.camelCase("default-"+n)]=e[n]=!0,n}},K&&Q||(b.attrHooks.value={get:function(e,n){var r=e.getAttributeNode(n);return b.nodeName(e,"input")?e.defaultValue:r&&r.specified?r.value:t},set:function(e,n,r){return b.nodeName(e,"input")?(e.defaultValue=n,t):I&&I.set(e,n,r)}}),Q||(I=b.valHooks.button={get:function(e,n){var r=e.getAttributeNode(n);return r&&("id"===n||"name"===n||"coords"===n?""!==r.value:r.specified)?r.value:t},set:function(e,n,r){var i=e.getAttributeNode(r);return i||e.setAttributeNode(i=e.ownerDocument.createAttribute(r)),i.value=n+="","value"===r||n===e.getAttribute(r)?n:t}},b.attrHooks.contenteditable={get:I.get,set:function(e,t,n){I.set(e,""===t?!1:t,n)}},b.each(["width","height"],function(e,n){b.attrHooks[n]=b.extend(b.attrHooks[n],{set:function(e,r){return""===r?(e.setAttribute(n,"auto"),r):t}})})),b.support.hrefNormalized||(b.each(["href","src","width","height"],function(e,n){b.attrHooks[n]=b.extend(b.attrHooks[n],{get:function(e){var r=e.getAttribute(n,2);return null==r?t:r}})}),b.each(["href","src"],function(e,t){b.propHooks[t]={get:function(e){return e.getAttribute(t,4)}}})),b.support.style||(b.attrHooks.style={get:function(e){return e.style.cssText||t},set:function(e,t){return e.style.cssText=t+""}}),b.support.optSelected||(b.propHooks.selected=b.extend(b.propHooks.selected,{get:function(e){var t=e.parentNode;return t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex),null}})),b.support.enctype||(b.propFix.enctype="encoding"),b.support.checkOn||b.each(["radio","checkbox"],function(){b.valHooks[this]={get:function(e){return null===e.getAttribute("value")?"on":e.value}}}),b.each(["radio","checkbox"],function(){b.valHooks[this]=b.extend(b.valHooks[this],{set:function(e,n){return b.isArray(n)?e.checked=b.inArray(b(e).val(),n)>=0:t}})});var Z=/^(?:input|select|textarea)$/i,et=/^key/,tt=/^(?:mouse|contextmenu)|click/,nt=/^(?:focusinfocus|focusoutblur)$/,rt=/^([^.]*)(?:\.(.+)|)$/;function it(){return!0}function ot(){return!1}b.event={global:{},add:function(e,n,r,o,a){var s,u,l,c,p,f,d,h,g,m,y,v=b._data(e);if(v){r.handler&&(c=r,r=c.handler,a=c.selector),r.guid||(r.guid=b.guid++),(u=v.events)||(u=v.events={}),(f=v.handle)||(f=v.handle=function(e){return typeof b===i||e&&b.event.triggered===e.type?t:b.event.dispatch.apply(f.elem,arguments)},f.elem=e),n=(n||"").match(w)||[""],l=n.length;while(l--)s=rt.exec(n[l])||[],g=y=s[1],m=(s[2]||"").split(".").sort(),p=b.event.special[g]||{},g=(a?p.delegateType:p.bindType)||g,p=b.event.special[g]||{},d=b.extend({type:g,origType:y,data:o,handler:r,guid:r.guid,selector:a,needsContext:a&&b.expr.match.needsContext.test(a),namespace:m.join(".")},c),(h=u[g])||(h=u[g]=[],h.delegateCount=0,p.setup&&p.setup.call(e,o,m,f)!==!1||(e.addEventListener?e.addEventListener(g,f,!1):e.attachEvent&&e.attachEvent("on"+g,f))),p.add&&(p.add.call(e,d),d.handler.guid||(d.handler.guid=r.guid)),a?h.splice(h.delegateCount++,0,d):h.push(d),b.event.global[g]=!0;e=null}},remove:function(e,t,n,r,i){var o,a,s,u,l,c,p,f,d,h,g,m=b.hasData(e)&&b._data(e);if(m&&(c=m.events)){t=(t||"").match(w)||[""],l=t.length;while(l--)if(s=rt.exec(t[l])||[],d=g=s[1],h=(s[2]||"").split(".").sort(),d){p=b.event.special[d]||{},d=(r?p.delegateType:p.bindType)||d,f=c[d]||[],s=s[2]&&RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"),u=o=f.length;while(o--)a=f[o],!i&&g!==a.origType||n&&n.guid!==a.guid||s&&!s.test(a.namespace)||r&&r!==a.selector&&("**"!==r||!a.selector)||(f.splice(o,1),a.selector&&f.delegateCount--,p.remove&&p.remove.call(e,a));u&&!f.length&&(p.teardown&&p.teardown.call(e,h,m.handle)!==!1||b.removeEvent(e,d,m.handle),delete c[d])}else for(d in c)b.event.remove(e,d+t[l],n,r,!0);b.isEmptyObject(c)&&(delete m.handle,b._removeData(e,"events"))}},trigger:function(n,r,i,a){var s,u,l,c,p,f,d,h=[i||o],g=y.call(n,"type")?n.type:n,m=y.call(n,"namespace")?n.namespace.split("."):[];if(l=f=i=i||o,3!==i.nodeType&&8!==i.nodeType&&!nt.test(g+b.event.triggered)&&(g.indexOf(".")>=0&&(m=g.split("."),g=m.shift(),m.sort()),u=0>g.indexOf(":")&&"on"+g,n=n[b.expando]?n:new b.Event(g,"object"==typeof n&&n),n.isTrigger=!0,n.namespace=m.join("."),n.namespace_re=n.namespace?RegExp("(^|\\.)"+m.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,n.result=t,n.target||(n.target=i),r=null==r?[n]:b.makeArray(r,[n]),p=b.event.special[g]||{},a||!p.trigger||p.trigger.apply(i,r)!==!1)){if(!a&&!p.noBubble&&!b.isWindow(i)){for(c=p.delegateType||g,nt.test(c+g)||(l=l.parentNode);l;l=l.parentNode)h.push(l),f=l;f===(i.ownerDocument||o)&&h.push(f.defaultView||f.parentWindow||e)}d=0;while((l=h[d++])&&!n.isPropagationStopped())n.type=d>1?c:p.bindType||g,s=(b._data(l,"events")||{})[n.type]&&b._data(l,"handle"),s&&s.apply(l,r),s=u&&l[u],s&&b.acceptData(l)&&s.apply&&s.apply(l,r)===!1&&n.preventDefault();if(n.type=g,!(a||n.isDefaultPrevented()||p._default&&p._default.apply(i.ownerDocument,r)!==!1||"click"===g&&b.nodeName(i,"a")||!b.acceptData(i)||!u||!i[g]||b.isWindow(i))){f=i[u],f&&(i[u]=null),b.event.triggered=g;try{i[g]()}catch(v){}b.event.triggered=t,f&&(i[u]=f)}return n.result}},dispatch:function(e){e=b.event.fix(e);var n,r,i,o,a,s=[],u=h.call(arguments),l=(b._data(this,"events")||{})[e.type]||[],c=b.event.special[e.type]||{};if(u[0]=e,e.delegateTarget=this,!c.preDispatch||c.preDispatch.call(this,e)!==!1){s=b.event.handlers.call(this,e,l),n=0;while((o=s[n++])&&!e.isPropagationStopped()){e.currentTarget=o.elem,a=0;while((i=o.handlers[a++])&&!e.isImmediatePropagationStopped())(!e.namespace_re||e.namespace_re.test(i.namespace))&&(e.handleObj=i,e.data=i.data,r=((b.event.special[i.origType]||{}).handle||i.handler).apply(o.elem,u),r!==t&&(e.result=r)===!1&&(e.preventDefault(),e.stopPropagation()))}return c.postDispatch&&c.postDispatch.call(this,e),e.result}},handlers:function(e,n){var r,i,o,a,s=[],u=n.delegateCount,l=e.target;if(u&&l.nodeType&&(!e.button||"click"!==e.type))for(;l!=this;l=l.parentNode||this)if(1===l.nodeType&&(l.disabled!==!0||"click"!==e.type)){for(o=[],a=0;u>a;a++)i=n[a],r=i.selector+" ",o[r]===t&&(o[r]=i.needsContext?b(r,this).index(l)>=0:b.find(r,this,null,[l]).length),o[r]&&o.push(i);o.length&&s.push({elem:l,handlers:o})}return n.length>u&&s.push({elem:this,handlers:n.slice(u)}),s},fix:function(e){if(e[b.expando])return e;var t,n,r,i=e.type,a=e,s=this.fixHooks[i];s||(this.fixHooks[i]=s=tt.test(i)?this.mouseHooks:et.test(i)?this.keyHooks:{}),r=s.props?this.props.concat(s.props):this.props,e=new b.Event(a),t=r.length;while(t--)n=r[t],e[n]=a[n];return e.target||(e.target=a.srcElement||o),3===e.target.nodeType&&(e.target=e.target.parentNode),e.metaKey=!!e.metaKey,s.filter?s.filter(e,a):e},props:"altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(e,t){return null==e.which&&(e.which=null!=t.charCode?t.charCode:t.keyCode),e}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(e,n){var r,i,a,s=n.button,u=n.fromElement;return null==e.pageX&&null!=n.clientX&&(i=e.target.ownerDocument||o,a=i.documentElement,r=i.body,e.pageX=n.clientX+(a&&a.scrollLeft||r&&r.scrollLeft||0)-(a&&a.clientLeft||r&&r.clientLeft||0),e.pageY=n.clientY+(a&&a.scrollTop||r&&r.scrollTop||0)-(a&&a.clientTop||r&&r.clientTop||0)),!e.relatedTarget&&u&&(e.relatedTarget=u===e.target?n.toElement:u),e.which||s===t||(e.which=1&s?1:2&s?3:4&s?2:0),e}},special:{load:{noBubble:!0},click:{trigger:function(){return b.nodeName(this,"input")&&"checkbox"===this.type&&this.click?(this.click(),!1):t}},focus:{trigger:function(){if(this!==o.activeElement&&this.focus)try{return this.focus(),!1}catch(e){}},delegateType:"focusin"},blur:{trigger:function(){return this===o.activeElement&&this.blur?(this.blur(),!1):t},delegateType:"focusout"},beforeunload:{postDispatch:function(e){e.result!==t&&(e.originalEvent.returnValue=e.result)}}},simulate:function(e,t,n,r){var i=b.extend(new b.Event,n,{type:e,isSimulated:!0,originalEvent:{}});r?b.event.trigger(i,null,t):b.event.dispatch.call(t,i),i.isDefaultPrevented()&&n.preventDefault()}},b.removeEvent=o.removeEventListener?function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n,!1)}:function(e,t,n){var r="on"+t;e.detachEvent&&(typeof e[r]===i&&(e[r]=null),e.detachEvent(r,n))},b.Event=function(e,n){return this instanceof b.Event?(e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||e.returnValue===!1||e.getPreventDefault&&e.getPreventDefault()?it:ot):this.type=e,n&&b.extend(this,n),this.timeStamp=e&&e.timeStamp||b.now(),this[b.expando]=!0,t):new b.Event(e,n)},b.Event.prototype={isDefaultPrevented:ot,isPropagationStopped:ot,isImmediatePropagationStopped:ot,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=it,e&&(e.preventDefault?e.preventDefault():e.returnValue=!1)},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=it,e&&(e.stopPropagation&&e.stopPropagation(),e.cancelBubble=!0)},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=it,this.stopPropagation()}},b.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(e,t){b.event.special[e]={delegateType:t,bindType:t,handle:function(e){var n,r=this,i=e.relatedTarget,o=e.handleObj;
+return(!i||i!==r&&!b.contains(r,i))&&(e.type=o.origType,n=o.handler.apply(this,arguments),e.type=t),n}}}),b.support.submitBubbles||(b.event.special.submit={setup:function(){return b.nodeName(this,"form")?!1:(b.event.add(this,"click._submit keypress._submit",function(e){var n=e.target,r=b.nodeName(n,"input")||b.nodeName(n,"button")?n.form:t;r&&!b._data(r,"submitBubbles")&&(b.event.add(r,"submit._submit",function(e){e._submit_bubble=!0}),b._data(r,"submitBubbles",!0))}),t)},postDispatch:function(e){e._submit_bubble&&(delete e._submit_bubble,this.parentNode&&!e.isTrigger&&b.event.simulate("submit",this.parentNode,e,!0))},teardown:function(){return b.nodeName(this,"form")?!1:(b.event.remove(this,"._submit"),t)}}),b.support.changeBubbles||(b.event.special.change={setup:function(){return Z.test(this.nodeName)?(("checkbox"===this.type||"radio"===this.type)&&(b.event.add(this,"propertychange._change",function(e){"checked"===e.originalEvent.propertyName&&(this._just_changed=!0)}),b.event.add(this,"click._change",function(e){this._just_changed&&!e.isTrigger&&(this._just_changed=!1),b.event.simulate("change",this,e,!0)})),!1):(b.event.add(this,"beforeactivate._change",function(e){var t=e.target;Z.test(t.nodeName)&&!b._data(t,"changeBubbles")&&(b.event.add(t,"change._change",function(e){!this.parentNode||e.isSimulated||e.isTrigger||b.event.simulate("change",this.parentNode,e,!0)}),b._data(t,"changeBubbles",!0))}),t)},handle:function(e){var n=e.target;return this!==n||e.isSimulated||e.isTrigger||"radio"!==n.type&&"checkbox"!==n.type?e.handleObj.handler.apply(this,arguments):t},teardown:function(){return b.event.remove(this,"._change"),!Z.test(this.nodeName)}}),b.support.focusinBubbles||b.each({focus:"focusin",blur:"focusout"},function(e,t){var n=0,r=function(e){b.event.simulate(t,e.target,b.event.fix(e),!0)};b.event.special[t]={setup:function(){0===n++&&o.addEventListener(e,r,!0)},teardown:function(){0===--n&&o.removeEventListener(e,r,!0)}}}),b.fn.extend({on:function(e,n,r,i,o){var a,s;if("object"==typeof e){"string"!=typeof n&&(r=r||n,n=t);for(a in e)this.on(a,n,r,e[a],o);return this}if(null==r&&null==i?(i=n,r=n=t):null==i&&("string"==typeof n?(i=r,r=t):(i=r,r=n,n=t)),i===!1)i=ot;else if(!i)return this;return 1===o&&(s=i,i=function(e){return b().off(e),s.apply(this,arguments)},i.guid=s.guid||(s.guid=b.guid++)),this.each(function(){b.event.add(this,e,i,r,n)})},one:function(e,t,n,r){return this.on(e,t,n,r,1)},off:function(e,n,r){var i,o;if(e&&e.preventDefault&&e.handleObj)return i=e.handleObj,b(e.delegateTarget).off(i.namespace?i.origType+"."+i.namespace:i.origType,i.selector,i.handler),this;if("object"==typeof e){for(o in e)this.off(o,n,e[o]);return this}return(n===!1||"function"==typeof n)&&(r=n,n=t),r===!1&&(r=ot),this.each(function(){b.event.remove(this,e,r,n)})},bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)},trigger:function(e,t){return this.each(function(){b.event.trigger(e,t,this)})},triggerHandler:function(e,n){var r=this[0];return r?b.event.trigger(e,n,r,!0):t}}),function(e,t){var n,r,i,o,a,s,u,l,c,p,f,d,h,g,m,y,v,x="sizzle"+-new Date,w=e.document,T={},N=0,C=0,k=it(),E=it(),S=it(),A=typeof t,j=1<<31,D=[],L=D.pop,H=D.push,q=D.slice,M=D.indexOf||function(e){var t=0,n=this.length;for(;n>t;t++)if(this[t]===e)return t;return-1},_="[\\x20\\t\\r\\n\\f]",F="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",O=F.replace("w","w#"),B="([*^$|!~]?=)",P="\\["+_+"*("+F+")"+_+"*(?:"+B+_+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+O+")|)|)"+_+"*\\]",R=":("+F+")(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|"+P.replace(3,8)+")*)|.*)\\)|)",W=RegExp("^"+_+"+|((?:^|[^\\\\])(?:\\\\.)*)"+_+"+$","g"),$=RegExp("^"+_+"*,"+_+"*"),I=RegExp("^"+_+"*([\\x20\\t\\r\\n\\f>+~])"+_+"*"),z=RegExp(R),X=RegExp("^"+O+"$"),U={ID:RegExp("^#("+F+")"),CLASS:RegExp("^\\.("+F+")"),NAME:RegExp("^\\[name=['\"]?("+F+")['\"]?\\]"),TAG:RegExp("^("+F.replace("w","w*")+")"),ATTR:RegExp("^"+P),PSEUDO:RegExp("^"+R),CHILD:RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+_+"*(even|odd|(([+-]|)(\\d*)n|)"+_+"*(?:([+-]|)"+_+"*(\\d+)|))"+_+"*\\)|)","i"),needsContext:RegExp("^"+_+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+_+"*((?:-\\d)?\\d*)"+_+"*\\)|)(?=[^-]|$)","i")},V=/[\x20\t\r\n\f]*[+~]/,Y=/^[^{]+\{\s*\[native code/,J=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,G=/^(?:input|select|textarea|button)$/i,Q=/^h\d$/i,K=/'|\\/g,Z=/\=[\x20\t\r\n\f]*([^'"\]]*)[\x20\t\r\n\f]*\]/g,et=/\\([\da-fA-F]{1,6}[\x20\t\r\n\f]?|.)/g,tt=function(e,t){var n="0x"+t-65536;return n!==n?t:0>n?String.fromCharCode(n+65536):String.fromCharCode(55296|n>>10,56320|1023&n)};try{q.call(w.documentElement.childNodes,0)[0].nodeType}catch(nt){q=function(e){var t,n=[];while(t=this[e++])n.push(t);return n}}function rt(e){return Y.test(e+"")}function it(){var e,t=[];return e=function(n,r){return t.push(n+=" ")>i.cacheLength&&delete e[t.shift()],e[n]=r}}function ot(e){return e[x]=!0,e}function at(e){var t=p.createElement("div");try{return e(t)}catch(n){return!1}finally{t=null}}function st(e,t,n,r){var i,o,a,s,u,l,f,g,m,v;if((t?t.ownerDocument||t:w)!==p&&c(t),t=t||p,n=n||[],!e||"string"!=typeof e)return n;if(1!==(s=t.nodeType)&&9!==s)return[];if(!d&&!r){if(i=J.exec(e))if(a=i[1]){if(9===s){if(o=t.getElementById(a),!o||!o.parentNode)return n;if(o.id===a)return n.push(o),n}else if(t.ownerDocument&&(o=t.ownerDocument.getElementById(a))&&y(t,o)&&o.id===a)return n.push(o),n}else{if(i[2])return H.apply(n,q.call(t.getElementsByTagName(e),0)),n;if((a=i[3])&&T.getByClassName&&t.getElementsByClassName)return H.apply(n,q.call(t.getElementsByClassName(a),0)),n}if(T.qsa&&!h.test(e)){if(f=!0,g=x,m=t,v=9===s&&e,1===s&&"object"!==t.nodeName.toLowerCase()){l=ft(e),(f=t.getAttribute("id"))?g=f.replace(K,"\\$&"):t.setAttribute("id",g),g="[id='"+g+"'] ",u=l.length;while(u--)l[u]=g+dt(l[u]);m=V.test(e)&&t.parentNode||t,v=l.join(",")}if(v)try{return H.apply(n,q.call(m.querySelectorAll(v),0)),n}catch(b){}finally{f||t.removeAttribute("id")}}}return wt(e.replace(W,"$1"),t,n,r)}a=st.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return t?"HTML"!==t.nodeName:!1},c=st.setDocument=function(e){var n=e?e.ownerDocument||e:w;return n!==p&&9===n.nodeType&&n.documentElement?(p=n,f=n.documentElement,d=a(n),T.tagNameNoComments=at(function(e){return e.appendChild(n.createComment("")),!e.getElementsByTagName("*").length}),T.attributes=at(function(e){e.innerHTML="<select></select>";var t=typeof e.lastChild.getAttribute("multiple");return"boolean"!==t&&"string"!==t}),T.getByClassName=at(function(e){return e.innerHTML="<div class='hidden e'></div><div class='hidden'></div>",e.getElementsByClassName&&e.getElementsByClassName("e").length?(e.lastChild.className="e",2===e.getElementsByClassName("e").length):!1}),T.getByName=at(function(e){e.id=x+0,e.innerHTML="<a name='"+x+"'></a><div name='"+x+"'></div>",f.insertBefore(e,f.firstChild);var t=n.getElementsByName&&n.getElementsByName(x).length===2+n.getElementsByName(x+0).length;return T.getIdNotName=!n.getElementById(x),f.removeChild(e),t}),i.attrHandle=at(function(e){return e.innerHTML="<a href='#'></a>",e.firstChild&&typeof e.firstChild.getAttribute!==A&&"#"===e.firstChild.getAttribute("href")})?{}:{href:function(e){return e.getAttribute("href",2)},type:function(e){return e.getAttribute("type")}},T.getIdNotName?(i.find.ID=function(e,t){if(typeof t.getElementById!==A&&!d){var n=t.getElementById(e);return n&&n.parentNode?[n]:[]}},i.filter.ID=function(e){var t=e.replace(et,tt);return function(e){return e.getAttribute("id")===t}}):(i.find.ID=function(e,n){if(typeof n.getElementById!==A&&!d){var r=n.getElementById(e);return r?r.id===e||typeof r.getAttributeNode!==A&&r.getAttributeNode("id").value===e?[r]:t:[]}},i.filter.ID=function(e){var t=e.replace(et,tt);return function(e){var n=typeof e.getAttributeNode!==A&&e.getAttributeNode("id");return n&&n.value===t}}),i.find.TAG=T.tagNameNoComments?function(e,n){return typeof n.getElementsByTagName!==A?n.getElementsByTagName(e):t}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){while(n=o[i++])1===n.nodeType&&r.push(n);return r}return o},i.find.NAME=T.getByName&&function(e,n){return typeof n.getElementsByName!==A?n.getElementsByName(name):t},i.find.CLASS=T.getByClassName&&function(e,n){return typeof n.getElementsByClassName===A||d?t:n.getElementsByClassName(e)},g=[],h=[":focus"],(T.qsa=rt(n.querySelectorAll))&&(at(function(e){e.innerHTML="<select><option selected=''></option></select>",e.querySelectorAll("[selected]").length||h.push("\\["+_+"*(?:checked|disabled|ismap|multiple|readonly|selected|value)"),e.querySelectorAll(":checked").length||h.push(":checked")}),at(function(e){e.innerHTML="<input type='hidden' i=''/>",e.querySelectorAll("[i^='']").length&&h.push("[*^$]="+_+"*(?:\"\"|'')"),e.querySelectorAll(":enabled").length||h.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),h.push(",.*:")})),(T.matchesSelector=rt(m=f.matchesSelector||f.mozMatchesSelector||f.webkitMatchesSelector||f.oMatchesSelector||f.msMatchesSelector))&&at(function(e){T.disconnectedMatch=m.call(e,"div"),m.call(e,"[s!='']:x"),g.push("!=",R)}),h=RegExp(h.join("|")),g=RegExp(g.join("|")),y=rt(f.contains)||f.compareDocumentPosition?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return!0;return!1},v=f.compareDocumentPosition?function(e,t){var r;return e===t?(u=!0,0):(r=t.compareDocumentPosition&&e.compareDocumentPosition&&e.compareDocumentPosition(t))?1&r||e.parentNode&&11===e.parentNode.nodeType?e===n||y(w,e)?-1:t===n||y(w,t)?1:0:4&r?-1:1:e.compareDocumentPosition?-1:1}:function(e,t){var r,i=0,o=e.parentNode,a=t.parentNode,s=[e],l=[t];if(e===t)return u=!0,0;if(!o||!a)return e===n?-1:t===n?1:o?-1:a?1:0;if(o===a)return ut(e,t);r=e;while(r=r.parentNode)s.unshift(r);r=t;while(r=r.parentNode)l.unshift(r);while(s[i]===l[i])i++;return i?ut(s[i],l[i]):s[i]===w?-1:l[i]===w?1:0},u=!1,[0,0].sort(v),T.detectDuplicates=u,p):p},st.matches=function(e,t){return st(e,null,null,t)},st.matchesSelector=function(e,t){if((e.ownerDocument||e)!==p&&c(e),t=t.replace(Z,"='$1']"),!(!T.matchesSelector||d||g&&g.test(t)||h.test(t)))try{var n=m.call(e,t);if(n||T.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(r){}return st(t,p,null,[e]).length>0},st.contains=function(e,t){return(e.ownerDocument||e)!==p&&c(e),y(e,t)},st.attr=function(e,t){var n;return(e.ownerDocument||e)!==p&&c(e),d||(t=t.toLowerCase()),(n=i.attrHandle[t])?n(e):d||T.attributes?e.getAttribute(t):((n=e.getAttributeNode(t))||e.getAttribute(t))&&e[t]===!0?t:n&&n.specified?n.value:null},st.error=function(e){throw Error("Syntax error, unrecognized expression: "+e)},st.uniqueSort=function(e){var t,n=[],r=1,i=0;if(u=!T.detectDuplicates,e.sort(v),u){for(;t=e[r];r++)t===e[r-1]&&(i=n.push(r));while(i--)e.splice(n[i],1)}return e};function ut(e,t){var n=t&&e,r=n&&(~t.sourceIndex||j)-(~e.sourceIndex||j);if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function lt(e){return function(t){var n=t.nodeName.toLowerCase();return"input"===n&&t.type===e}}function ct(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function pt(e){return ot(function(t){return t=+t,ot(function(n,r){var i,o=e([],n.length,t),a=o.length;while(a--)n[i=o[a]]&&(n[i]=!(r[i]=n[i]))})})}o=st.getText=function(e){var t,n="",r=0,i=e.nodeType;if(i){if(1===i||9===i||11===i){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=o(e)}else if(3===i||4===i)return e.nodeValue}else for(;t=e[r];r++)n+=o(t);return n},i=st.selectors={cacheLength:50,createPseudo:ot,match:U,find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(et,tt),e[3]=(e[4]||e[5]||"").replace(et,tt),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||st.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&st.error(e[0]),e},PSEUDO:function(e){var t,n=!e[5]&&e[2];return U.CHILD.test(e[0])?null:(e[4]?e[2]=e[4]:n&&z.test(n)&&(t=ft(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){return"*"===e?function(){return!0}:(e=e.replace(et,tt).toLowerCase(),function(t){return t.nodeName&&t.nodeName.toLowerCase()===e})},CLASS:function(e){var t=k[e+" "];return t||(t=RegExp("(^|"+_+")"+e+"("+_+"|$)"))&&k(e,function(e){return t.test(e.className||typeof e.getAttribute!==A&&e.getAttribute("class")||"")})},ATTR:function(e,t,n){return function(r){var i=st.attr(r,e);return null==i?"!="===t:t?(i+="","="===t?i===n:"!="===t?i!==n:"^="===t?n&&0===i.indexOf(n):"*="===t?n&&i.indexOf(n)>-1:"$="===t?n&&i.slice(-n.length)===n:"~="===t?(" "+i+" ").indexOf(n)>-1:"|="===t?i===n||i.slice(0,n.length+1)===n+"-":!1):!0}},CHILD:function(e,t,n,r,i){var o="nth"!==e.slice(0,3),a="last"!==e.slice(-4),s="of-type"===t;return 1===r&&0===i?function(e){return!!e.parentNode}:function(t,n,u){var l,c,p,f,d,h,g=o!==a?"nextSibling":"previousSibling",m=t.parentNode,y=s&&t.nodeName.toLowerCase(),v=!u&&!s;if(m){if(o){while(g){p=t;while(p=p[g])if(s?p.nodeName.toLowerCase()===y:1===p.nodeType)return!1;h=g="only"===e&&!h&&"nextSibling"}return!0}if(h=[a?m.firstChild:m.lastChild],a&&v){c=m[x]||(m[x]={}),l=c[e]||[],d=l[0]===N&&l[1],f=l[0]===N&&l[2],p=d&&m.childNodes[d];while(p=++d&&p&&p[g]||(f=d=0)||h.pop())if(1===p.nodeType&&++f&&p===t){c[e]=[N,d,f];break}}else if(v&&(l=(t[x]||(t[x]={}))[e])&&l[0]===N)f=l[1];else while(p=++d&&p&&p[g]||(f=d=0)||h.pop())if((s?p.nodeName.toLowerCase()===y:1===p.nodeType)&&++f&&(v&&((p[x]||(p[x]={}))[e]=[N,f]),p===t))break;return f-=i,f===r||0===f%r&&f/r>=0}}},PSEUDO:function(e,t){var n,r=i.pseudos[e]||i.setFilters[e.toLowerCase()]||st.error("unsupported pseudo: "+e);return r[x]?r(t):r.length>1?(n=[e,e,"",t],i.setFilters.hasOwnProperty(e.toLowerCase())?ot(function(e,n){var i,o=r(e,t),a=o.length;while(a--)i=M.call(e,o[a]),e[i]=!(n[i]=o[a])}):function(e){return r(e,0,n)}):r}},pseudos:{not:ot(function(e){var t=[],n=[],r=s(e.replace(W,"$1"));return r[x]?ot(function(e,t,n,i){var o,a=r(e,null,i,[]),s=e.length;while(s--)(o=a[s])&&(e[s]=!(t[s]=o))}):function(e,i,o){return t[0]=e,r(t,null,o,n),!n.pop()}}),has:ot(function(e){return function(t){return st(e,t).length>0}}),contains:ot(function(e){return function(t){return(t.textContent||t.innerText||o(t)).indexOf(e)>-1}}),lang:ot(function(e){return X.test(e||"")||st.error("unsupported lang: "+e),e=e.replace(et,tt).toLowerCase(),function(t){var n;do if(n=d?t.getAttribute("xml:lang")||t.getAttribute("lang"):t.lang)return n=n.toLowerCase(),n===e||0===n.indexOf(e+"-");while((t=t.parentNode)&&1===t.nodeType);return!1}}),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===f},focus:function(e){return e===p.activeElement&&(!p.hasFocus||p.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:function(e){return e.disabled===!1},disabled:function(e){return e.disabled===!0},checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,e.selected===!0},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeName>"@"||3===e.nodeType||4===e.nodeType)return!1;return!0},parent:function(e){return!i.pseudos.empty(e)},header:function(e){return Q.test(e.nodeName)},input:function(e){return G.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||t.toLowerCase()===e.type)},first:pt(function(){return[0]}),last:pt(function(e,t){return[t-1]}),eq:pt(function(e,t,n){return[0>n?n+t:n]}),even:pt(function(e,t){var n=0;for(;t>n;n+=2)e.push(n);return e}),odd:pt(function(e,t){var n=1;for(;t>n;n+=2)e.push(n);return e}),lt:pt(function(e,t,n){var r=0>n?n+t:n;for(;--r>=0;)e.push(r);return e}),gt:pt(function(e,t,n){var r=0>n?n+t:n;for(;t>++r;)e.push(r);return e})}};for(n in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})i.pseudos[n]=lt(n);for(n in{submit:!0,reset:!0})i.pseudos[n]=ct(n);function ft(e,t){var n,r,o,a,s,u,l,c=E[e+" "];if(c)return t?0:c.slice(0);s=e,u=[],l=i.preFilter;while(s){(!n||(r=$.exec(s)))&&(r&&(s=s.slice(r[0].length)||s),u.push(o=[])),n=!1,(r=I.exec(s))&&(n=r.shift(),o.push({value:n,type:r[0].replace(W," ")}),s=s.slice(n.length));for(a in i.filter)!(r=U[a].exec(s))||l[a]&&!(r=l[a](r))||(n=r.shift(),o.push({value:n,type:a,matches:r}),s=s.slice(n.length));if(!n)break}return t?s.length:s?st.error(e):E(e,u).slice(0)}function dt(e){var t=0,n=e.length,r="";for(;n>t;t++)r+=e[t].value;return r}function ht(e,t,n){var i=t.dir,o=n&&"parentNode"===i,a=C++;return t.first?function(t,n,r){while(t=t[i])if(1===t.nodeType||o)return e(t,n,r)}:function(t,n,s){var u,l,c,p=N+" "+a;if(s){while(t=t[i])if((1===t.nodeType||o)&&e(t,n,s))return!0}else while(t=t[i])if(1===t.nodeType||o)if(c=t[x]||(t[x]={}),(l=c[i])&&l[0]===p){if((u=l[1])===!0||u===r)return u===!0}else if(l=c[i]=[p],l[1]=e(t,n,s)||r,l[1]===!0)return!0}}function gt(e){return e.length>1?function(t,n,r){var i=e.length;while(i--)if(!e[i](t,n,r))return!1;return!0}:e[0]}function mt(e,t,n,r,i){var o,a=[],s=0,u=e.length,l=null!=t;for(;u>s;s++)(o=e[s])&&(!n||n(o,r,i))&&(a.push(o),l&&t.push(s));return a}function yt(e,t,n,r,i,o){return r&&!r[x]&&(r=yt(r)),i&&!i[x]&&(i=yt(i,o)),ot(function(o,a,s,u){var l,c,p,f=[],d=[],h=a.length,g=o||xt(t||"*",s.nodeType?[s]:s,[]),m=!e||!o&&t?g:mt(g,f,e,s,u),y=n?i||(o?e:h||r)?[]:a:m;if(n&&n(m,y,s,u),r){l=mt(y,d),r(l,[],s,u),c=l.length;while(c--)(p=l[c])&&(y[d[c]]=!(m[d[c]]=p))}if(o){if(i||e){if(i){l=[],c=y.length;while(c--)(p=y[c])&&l.push(m[c]=p);i(null,y=[],l,u)}c=y.length;while(c--)(p=y[c])&&(l=i?M.call(o,p):f[c])>-1&&(o[l]=!(a[l]=p))}}else y=mt(y===a?y.splice(h,y.length):y),i?i(null,a,y,u):H.apply(a,y)})}function vt(e){var t,n,r,o=e.length,a=i.relative[e[0].type],s=a||i.relative[" "],u=a?1:0,c=ht(function(e){return e===t},s,!0),p=ht(function(e){return M.call(t,e)>-1},s,!0),f=[function(e,n,r){return!a&&(r||n!==l)||((t=n).nodeType?c(e,n,r):p(e,n,r))}];for(;o>u;u++)if(n=i.relative[e[u].type])f=[ht(gt(f),n)];else{if(n=i.filter[e[u].type].apply(null,e[u].matches),n[x]){for(r=++u;o>r;r++)if(i.relative[e[r].type])break;return yt(u>1&&gt(f),u>1&&dt(e.slice(0,u-1)).replace(W,"$1"),n,r>u&&vt(e.slice(u,r)),o>r&&vt(e=e.slice(r)),o>r&&dt(e))}f.push(n)}return gt(f)}function bt(e,t){var n=0,o=t.length>0,a=e.length>0,s=function(s,u,c,f,d){var h,g,m,y=[],v=0,b="0",x=s&&[],w=null!=d,T=l,C=s||a&&i.find.TAG("*",d&&u.parentNode||u),k=N+=null==T?1:Math.random()||.1;for(w&&(l=u!==p&&u,r=n);null!=(h=C[b]);b++){if(a&&h){g=0;while(m=e[g++])if(m(h,u,c)){f.push(h);break}w&&(N=k,r=++n)}o&&((h=!m&&h)&&v--,s&&x.push(h))}if(v+=b,o&&b!==v){g=0;while(m=t[g++])m(x,y,u,c);if(s){if(v>0)while(b--)x[b]||y[b]||(y[b]=L.call(f));y=mt(y)}H.apply(f,y),w&&!s&&y.length>0&&v+t.length>1&&st.uniqueSort(f)}return w&&(N=k,l=T),x};return o?ot(s):s}s=st.compile=function(e,t){var n,r=[],i=[],o=S[e+" "];if(!o){t||(t=ft(e)),n=t.length;while(n--)o=vt(t[n]),o[x]?r.push(o):i.push(o);o=S(e,bt(i,r))}return o};function xt(e,t,n){var r=0,i=t.length;for(;i>r;r++)st(e,t[r],n);return n}function wt(e,t,n,r){var o,a,u,l,c,p=ft(e);if(!r&&1===p.length){if(a=p[0]=p[0].slice(0),a.length>2&&"ID"===(u=a[0]).type&&9===t.nodeType&&!d&&i.relative[a[1].type]){if(t=i.find.ID(u.matches[0].replace(et,tt),t)[0],!t)return n;e=e.slice(a.shift().value.length)}o=U.needsContext.test(e)?0:a.length;while(o--){if(u=a[o],i.relative[l=u.type])break;if((c=i.find[l])&&(r=c(u.matches[0].replace(et,tt),V.test(a[0].type)&&t.parentNode||t))){if(a.splice(o,1),e=r.length&&dt(a),!e)return H.apply(n,q.call(r,0)),n;break}}}return s(e,p)(r,t,d,n,V.test(e)),n}i.pseudos.nth=i.pseudos.eq;function Tt(){}i.filters=Tt.prototype=i.pseudos,i.setFilters=new Tt,c(),st.attr=b.attr,b.find=st,b.expr=st.selectors,b.expr[":"]=b.expr.pseudos,b.unique=st.uniqueSort,b.text=st.getText,b.isXMLDoc=st.isXML,b.contains=st.contains}(e);var at=/Until$/,st=/^(?:parents|prev(?:Until|All))/,ut=/^.[^:#\[\.,]*$/,lt=b.expr.match.needsContext,ct={children:!0,contents:!0,next:!0,prev:!0};b.fn.extend({find:function(e){var t,n,r,i=this.length;if("string"!=typeof e)return r=this,this.pushStack(b(e).filter(function(){for(t=0;i>t;t++)if(b.contains(r[t],this))return!0}));for(n=[],t=0;i>t;t++)b.find(e,this[t],n);return n=this.pushStack(i>1?b.unique(n):n),n.selector=(this.selector?this.selector+" ":"")+e,n},has:function(e){var t,n=b(e,this),r=n.length;return this.filter(function(){for(t=0;r>t;t++)if(b.contains(this,n[t]))return!0})},not:function(e){return this.pushStack(ft(this,e,!1))},filter:function(e){return this.pushStack(ft(this,e,!0))},is:function(e){return!!e&&("string"==typeof e?lt.test(e)?b(e,this.context).index(this[0])>=0:b.filter(e,this).length>0:this.filter(e).length>0)},closest:function(e,t){var n,r=0,i=this.length,o=[],a=lt.test(e)||"string"!=typeof e?b(e,t||this.context):0;for(;i>r;r++){n=this[r];while(n&&n.ownerDocument&&n!==t&&11!==n.nodeType){if(a?a.index(n)>-1:b.find.matchesSelector(n,e)){o.push(n);break}n=n.parentNode}}return this.pushStack(o.length>1?b.unique(o):o)},index:function(e){return e?"string"==typeof e?b.inArray(this[0],b(e)):b.inArray(e.jquery?e[0]:e,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){var n="string"==typeof e?b(e,t):b.makeArray(e&&e.nodeType?[e]:e),r=b.merge(this.get(),n);return this.pushStack(b.unique(r))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),b.fn.andSelf=b.fn.addBack;function pt(e,t){do e=e[t];while(e&&1!==e.nodeType);return e}b.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return b.dir(e,"parentNode")},parentsUntil:function(e,t,n){return b.dir(e,"parentNode",n)},next:function(e){return pt(e,"nextSibling")},prev:function(e){return pt(e,"previousSibling")},nextAll:function(e){return b.dir(e,"nextSibling")},prevAll:function(e){return b.dir(e,"previousSibling")},nextUntil:function(e,t,n){return b.dir(e,"nextSibling",n)},prevUntil:function(e,t,n){return b.dir(e,"previousSibling",n)},siblings:function(e){return b.sibling((e.parentNode||{}).firstChild,e)},children:function(e){return b.sibling(e.firstChild)},contents:function(e){return b.nodeName(e,"iframe")?e.contentDocument||e.contentWindow.document:b.merge([],e.childNodes)}},function(e,t){b.fn[e]=function(n,r){var i=b.map(this,t,n);return at.test(e)||(r=n),r&&"string"==typeof r&&(i=b.filter(r,i)),i=this.length>1&&!ct[e]?b.unique(i):i,this.length>1&&st.test(e)&&(i=i.reverse()),this.pushStack(i)}}),b.extend({filter:function(e,t,n){return n&&(e=":not("+e+")"),1===t.length?b.find.matchesSelector(t[0],e)?[t[0]]:[]:b.find.matches(e,t)},dir:function(e,n,r){var i=[],o=e[n];while(o&&9!==o.nodeType&&(r===t||1!==o.nodeType||!b(o).is(r)))1===o.nodeType&&i.push(o),o=o[n];return i},sibling:function(e,t){var n=[];for(;e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n}});function ft(e,t,n){if(t=t||0,b.isFunction(t))return b.grep(e,function(e,r){var i=!!t.call(e,r,e);return i===n});if(t.nodeType)return b.grep(e,function(e){return e===t===n});if("string"==typeof t){var r=b.grep(e,function(e){return 1===e.nodeType});if(ut.test(t))return b.filter(t,r,!n);t=b.filter(t,r)}return b.grep(e,function(e){return b.inArray(e,t)>=0===n})}function dt(e){var t=ht.split("|"),n=e.createDocumentFragment();if(n.createElement)while(t.length)n.createElement(t.pop());return n}var ht="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",gt=/ jQuery\d+="(?:null|\d+)"/g,mt=RegExp("<(?:"+ht+")[\\s/>]","i"),yt=/^\s+/,vt=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,bt=/<([\w:]+)/,xt=/<tbody/i,wt=/<|&#?\w+;/,Tt=/<(?:script|style|link)/i,Nt=/^(?:checkbox|radio)$/i,Ct=/checked\s*(?:[^=]|=\s*.checked.)/i,kt=/^$|\/(?:java|ecma)script/i,Et=/^true\/(.*)/,St=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,At={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],area:[1,"<map>","</map>"],param:[1,"<object>","</object>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:b.support.htmlSerialize?[0,"",""]:[1,"X<div>","</div>"]},jt=dt(o),Dt=jt.appendChild(o.createElement("div"));At.optgroup=At.option,At.tbody=At.tfoot=At.colgroup=At.caption=At.thead,At.th=At.td,b.fn.extend({text:function(e){return b.access(this,function(e){return e===t?b.text(this):this.empty().append((this[0]&&this[0].ownerDocument||o).createTextNode(e))},null,e,arguments.length)},wrapAll:function(e){if(b.isFunction(e))return this.each(function(t){b(this).wrapAll(e.call(this,t))});if(this[0]){var t=b(e,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){var e=this;while(e.firstChild&&1===e.firstChild.nodeType)e=e.firstChild;return e}).append(this)}return this},wrapInner:function(e){return b.isFunction(e)?this.each(function(t){b(this).wrapInner(e.call(this,t))}):this.each(function(){var t=b(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=b.isFunction(e);return this.each(function(n){b(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(){return this.parent().each(function(){b.nodeName(this,"body")||b(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(e){(1===this.nodeType||11===this.nodeType||9===this.nodeType)&&this.appendChild(e)})},prepend:function(){return this.domManip(arguments,!0,function(e){(1===this.nodeType||11===this.nodeType||9===this.nodeType)&&this.insertBefore(e,this.firstChild)})},before:function(){return this.domManip(arguments,!1,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return this.domManip(arguments,!1,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},remove:function(e,t){var n,r=0;for(;null!=(n=this[r]);r++)(!e||b.filter(e,[n]).length>0)&&(t||1!==n.nodeType||b.cleanData(Ot(n)),n.parentNode&&(t&&b.contains(n.ownerDocument,n)&&Mt(Ot(n,"script")),n.parentNode.removeChild(n)));return this},empty:function(){var e,t=0;for(;null!=(e=this[t]);t++){1===e.nodeType&&b.cleanData(Ot(e,!1));while(e.firstChild)e.removeChild(e.firstChild);e.options&&b.nodeName(e,"select")&&(e.options.length=0)}return this},clone:function(e,t){return e=null==e?!1:e,t=null==t?e:t,this.map(function(){return b.clone(this,e,t)})},html:function(e){return b.access(this,function(e){var n=this[0]||{},r=0,i=this.length;if(e===t)return 1===n.nodeType?n.innerHTML.replace(gt,""):t;if(!("string"!=typeof e||Tt.test(e)||!b.support.htmlSerialize&&mt.test(e)||!b.support.leadingWhitespace&&yt.test(e)||At[(bt.exec(e)||["",""])[1].toLowerCase()])){e=e.replace(vt,"<$1></$2>");try{for(;i>r;r++)n=this[r]||{},1===n.nodeType&&(b.cleanData(Ot(n,!1)),n.innerHTML=e);n=0}catch(o){}}n&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(e){var t=b.isFunction(e);return t||"string"==typeof e||(e=b(e).not(this).detach()),this.domManip([e],!0,function(e){var t=this.nextSibling,n=this.parentNode;n&&(b(this).remove(),n.insertBefore(e,t))})},detach:function(e){return this.remove(e,!0)},domManip:function(e,n,r){e=f.apply([],e);var i,o,a,s,u,l,c=0,p=this.length,d=this,h=p-1,g=e[0],m=b.isFunction(g);if(m||!(1>=p||"string"!=typeof g||b.support.checkClone)&&Ct.test(g))return this.each(function(i){var o=d.eq(i);m&&(e[0]=g.call(this,i,n?o.html():t)),o.domManip(e,n,r)});if(p&&(l=b.buildFragment(e,this[0].ownerDocument,!1,this),i=l.firstChild,1===l.childNodes.length&&(l=i),i)){for(n=n&&b.nodeName(i,"tr"),s=b.map(Ot(l,"script"),Ht),a=s.length;p>c;c++)o=l,c!==h&&(o=b.clone(o,!0,!0),a&&b.merge(s,Ot(o,"script"))),r.call(n&&b.nodeName(this[c],"table")?Lt(this[c],"tbody"):this[c],o,c);if(a)for(u=s[s.length-1].ownerDocument,b.map(s,qt),c=0;a>c;c++)o=s[c],kt.test(o.type||"")&&!b._data(o,"globalEval")&&b.contains(u,o)&&(o.src?b.ajax({url:o.src,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0}):b.globalEval((o.text||o.textContent||o.innerHTML||"").replace(St,"")));l=i=null}return this}});function Lt(e,t){return e.getElementsByTagName(t)[0]||e.appendChild(e.ownerDocument.createElement(t))}function Ht(e){var t=e.getAttributeNode("type");return e.type=(t&&t.specified)+"/"+e.type,e}function qt(e){var t=Et.exec(e.type);return t?e.type=t[1]:e.removeAttribute("type"),e}function Mt(e,t){var n,r=0;for(;null!=(n=e[r]);r++)b._data(n,"globalEval",!t||b._data(t[r],"globalEval"))}function _t(e,t){if(1===t.nodeType&&b.hasData(e)){var n,r,i,o=b._data(e),a=b._data(t,o),s=o.events;if(s){delete a.handle,a.events={};for(n in s)for(r=0,i=s[n].length;i>r;r++)b.event.add(t,n,s[n][r])}a.data&&(a.data=b.extend({},a.data))}}function Ft(e,t){var n,r,i;if(1===t.nodeType){if(n=t.nodeName.toLowerCase(),!b.support.noCloneEvent&&t[b.expando]){i=b._data(t);for(r in i.events)b.removeEvent(t,r,i.handle);t.removeAttribute(b.expando)}"script"===n&&t.text!==e.text?(Ht(t).text=e.text,qt(t)):"object"===n?(t.parentNode&&(t.outerHTML=e.outerHTML),b.support.html5Clone&&e.innerHTML&&!b.trim(t.innerHTML)&&(t.innerHTML=e.innerHTML)):"input"===n&&Nt.test(e.type)?(t.defaultChecked=t.checked=e.checked,t.value!==e.value&&(t.value=e.value)):"option"===n?t.defaultSelected=t.selected=e.defaultSelected:("input"===n||"textarea"===n)&&(t.defaultValue=e.defaultValue)}}b.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,t){b.fn[e]=function(e){var n,r=0,i=[],o=b(e),a=o.length-1;for(;a>=r;r++)n=r===a?this:this.clone(!0),b(o[r])[t](n),d.apply(i,n.get());return this.pushStack(i)}});function Ot(e,n){var r,o,a=0,s=typeof e.getElementsByTagName!==i?e.getElementsByTagName(n||"*"):typeof e.querySelectorAll!==i?e.querySelectorAll(n||"*"):t;if(!s)for(s=[],r=e.childNodes||e;null!=(o=r[a]);a++)!n||b.nodeName(o,n)?s.push(o):b.merge(s,Ot(o,n));return n===t||n&&b.nodeName(e,n)?b.merge([e],s):s}function Bt(e){Nt.test(e.type)&&(e.defaultChecked=e.checked)}b.extend({clone:function(e,t,n){var r,i,o,a,s,u=b.contains(e.ownerDocument,e);if(b.support.html5Clone||b.isXMLDoc(e)||!mt.test("<"+e.nodeName+">")?o=e.cloneNode(!0):(Dt.innerHTML=e.outerHTML,Dt.removeChild(o=Dt.firstChild)),!(b.support.noCloneEvent&&b.support.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||b.isXMLDoc(e)))for(r=Ot(o),s=Ot(e),a=0;null!=(i=s[a]);++a)r[a]&&Ft(i,r[a]);if(t)if(n)for(s=s||Ot(e),r=r||Ot(o),a=0;null!=(i=s[a]);a++)_t(i,r[a]);else _t(e,o);return r=Ot(o,"script"),r.length>0&&Mt(r,!u&&Ot(e,"script")),r=s=i=null,o},buildFragment:function(e,t,n,r){var i,o,a,s,u,l,c,p=e.length,f=dt(t),d=[],h=0;for(;p>h;h++)if(o=e[h],o||0===o)if("object"===b.type(o))b.merge(d,o.nodeType?[o]:o);else if(wt.test(o)){s=s||f.appendChild(t.createElement("div")),u=(bt.exec(o)||["",""])[1].toLowerCase(),c=At[u]||At._default,s.innerHTML=c[1]+o.replace(vt,"<$1></$2>")+c[2],i=c[0];while(i--)s=s.lastChild;if(!b.support.leadingWhitespace&&yt.test(o)&&d.push(t.createTextNode(yt.exec(o)[0])),!b.support.tbody){o="table"!==u||xt.test(o)?"<table>"!==c[1]||xt.test(o)?0:s:s.firstChild,i=o&&o.childNodes.length;while(i--)b.nodeName(l=o.childNodes[i],"tbody")&&!l.childNodes.length&&o.removeChild(l)
+}b.merge(d,s.childNodes),s.textContent="";while(s.firstChild)s.removeChild(s.firstChild);s=f.lastChild}else d.push(t.createTextNode(o));s&&f.removeChild(s),b.support.appendChecked||b.grep(Ot(d,"input"),Bt),h=0;while(o=d[h++])if((!r||-1===b.inArray(o,r))&&(a=b.contains(o.ownerDocument,o),s=Ot(f.appendChild(o),"script"),a&&Mt(s),n)){i=0;while(o=s[i++])kt.test(o.type||"")&&n.push(o)}return s=null,f},cleanData:function(e,t){var n,r,o,a,s=0,u=b.expando,l=b.cache,p=b.support.deleteExpando,f=b.event.special;for(;null!=(n=e[s]);s++)if((t||b.acceptData(n))&&(o=n[u],a=o&&l[o])){if(a.events)for(r in a.events)f[r]?b.event.remove(n,r):b.removeEvent(n,r,a.handle);l[o]&&(delete l[o],p?delete n[u]:typeof n.removeAttribute!==i?n.removeAttribute(u):n[u]=null,c.push(o))}}});var Pt,Rt,Wt,$t=/alpha\([^)]*\)/i,It=/opacity\s*=\s*([^)]*)/,zt=/^(top|right|bottom|left)$/,Xt=/^(none|table(?!-c[ea]).+)/,Ut=/^margin/,Vt=RegExp("^("+x+")(.*)$","i"),Yt=RegExp("^("+x+")(?!px)[a-z%]+$","i"),Jt=RegExp("^([+-])=("+x+")","i"),Gt={BODY:"block"},Qt={position:"absolute",visibility:"hidden",display:"block"},Kt={letterSpacing:0,fontWeight:400},Zt=["Top","Right","Bottom","Left"],en=["Webkit","O","Moz","ms"];function tn(e,t){if(t in e)return t;var n=t.charAt(0).toUpperCase()+t.slice(1),r=t,i=en.length;while(i--)if(t=en[i]+n,t in e)return t;return r}function nn(e,t){return e=t||e,"none"===b.css(e,"display")||!b.contains(e.ownerDocument,e)}function rn(e,t){var n,r,i,o=[],a=0,s=e.length;for(;s>a;a++)r=e[a],r.style&&(o[a]=b._data(r,"olddisplay"),n=r.style.display,t?(o[a]||"none"!==n||(r.style.display=""),""===r.style.display&&nn(r)&&(o[a]=b._data(r,"olddisplay",un(r.nodeName)))):o[a]||(i=nn(r),(n&&"none"!==n||!i)&&b._data(r,"olddisplay",i?n:b.css(r,"display"))));for(a=0;s>a;a++)r=e[a],r.style&&(t&&"none"!==r.style.display&&""!==r.style.display||(r.style.display=t?o[a]||"":"none"));return e}b.fn.extend({css:function(e,n){return b.access(this,function(e,n,r){var i,o,a={},s=0;if(b.isArray(n)){for(o=Rt(e),i=n.length;i>s;s++)a[n[s]]=b.css(e,n[s],!1,o);return a}return r!==t?b.style(e,n,r):b.css(e,n)},e,n,arguments.length>1)},show:function(){return rn(this,!0)},hide:function(){return rn(this)},toggle:function(e){var t="boolean"==typeof e;return this.each(function(){(t?e:nn(this))?b(this).show():b(this).hide()})}}),b.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=Wt(e,"opacity");return""===n?"1":n}}}},cssNumber:{columnCount:!0,fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":b.support.cssFloat?"cssFloat":"styleFloat"},style:function(e,n,r,i){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var o,a,s,u=b.camelCase(n),l=e.style;if(n=b.cssProps[u]||(b.cssProps[u]=tn(l,u)),s=b.cssHooks[n]||b.cssHooks[u],r===t)return s&&"get"in s&&(o=s.get(e,!1,i))!==t?o:l[n];if(a=typeof r,"string"===a&&(o=Jt.exec(r))&&(r=(o[1]+1)*o[2]+parseFloat(b.css(e,n)),a="number"),!(null==r||"number"===a&&isNaN(r)||("number"!==a||b.cssNumber[u]||(r+="px"),b.support.clearCloneStyle||""!==r||0!==n.indexOf("background")||(l[n]="inherit"),s&&"set"in s&&(r=s.set(e,r,i))===t)))try{l[n]=r}catch(c){}}},css:function(e,n,r,i){var o,a,s,u=b.camelCase(n);return n=b.cssProps[u]||(b.cssProps[u]=tn(e.style,u)),s=b.cssHooks[n]||b.cssHooks[u],s&&"get"in s&&(a=s.get(e,!0,r)),a===t&&(a=Wt(e,n,i)),"normal"===a&&n in Kt&&(a=Kt[n]),""===r||r?(o=parseFloat(a),r===!0||b.isNumeric(o)?o||0:a):a},swap:function(e,t,n,r){var i,o,a={};for(o in t)a[o]=e.style[o],e.style[o]=t[o];i=n.apply(e,r||[]);for(o in t)e.style[o]=a[o];return i}}),e.getComputedStyle?(Rt=function(t){return e.getComputedStyle(t,null)},Wt=function(e,n,r){var i,o,a,s=r||Rt(e),u=s?s.getPropertyValue(n)||s[n]:t,l=e.style;return s&&(""!==u||b.contains(e.ownerDocument,e)||(u=b.style(e,n)),Yt.test(u)&&Ut.test(n)&&(i=l.width,o=l.minWidth,a=l.maxWidth,l.minWidth=l.maxWidth=l.width=u,u=s.width,l.width=i,l.minWidth=o,l.maxWidth=a)),u}):o.documentElement.currentStyle&&(Rt=function(e){return e.currentStyle},Wt=function(e,n,r){var i,o,a,s=r||Rt(e),u=s?s[n]:t,l=e.style;return null==u&&l&&l[n]&&(u=l[n]),Yt.test(u)&&!zt.test(n)&&(i=l.left,o=e.runtimeStyle,a=o&&o.left,a&&(o.left=e.currentStyle.left),l.left="fontSize"===n?"1em":u,u=l.pixelLeft+"px",l.left=i,a&&(o.left=a)),""===u?"auto":u});function on(e,t,n){var r=Vt.exec(t);return r?Math.max(0,r[1]-(n||0))+(r[2]||"px"):t}function an(e,t,n,r,i){var o=n===(r?"border":"content")?4:"width"===t?1:0,a=0;for(;4>o;o+=2)"margin"===n&&(a+=b.css(e,n+Zt[o],!0,i)),r?("content"===n&&(a-=b.css(e,"padding"+Zt[o],!0,i)),"margin"!==n&&(a-=b.css(e,"border"+Zt[o]+"Width",!0,i))):(a+=b.css(e,"padding"+Zt[o],!0,i),"padding"!==n&&(a+=b.css(e,"border"+Zt[o]+"Width",!0,i)));return a}function sn(e,t,n){var r=!0,i="width"===t?e.offsetWidth:e.offsetHeight,o=Rt(e),a=b.support.boxSizing&&"border-box"===b.css(e,"boxSizing",!1,o);if(0>=i||null==i){if(i=Wt(e,t,o),(0>i||null==i)&&(i=e.style[t]),Yt.test(i))return i;r=a&&(b.support.boxSizingReliable||i===e.style[t]),i=parseFloat(i)||0}return i+an(e,t,n||(a?"border":"content"),r,o)+"px"}function un(e){var t=o,n=Gt[e];return n||(n=ln(e,t),"none"!==n&&n||(Pt=(Pt||b("<iframe frameborder='0' width='0' height='0'/>").css("cssText","display:block !important")).appendTo(t.documentElement),t=(Pt[0].contentWindow||Pt[0].contentDocument).document,t.write("<!doctype html><html><body>"),t.close(),n=ln(e,t),Pt.detach()),Gt[e]=n),n}function ln(e,t){var n=b(t.createElement(e)).appendTo(t.body),r=b.css(n[0],"display");return n.remove(),r}b.each(["height","width"],function(e,n){b.cssHooks[n]={get:function(e,r,i){return r?0===e.offsetWidth&&Xt.test(b.css(e,"display"))?b.swap(e,Qt,function(){return sn(e,n,i)}):sn(e,n,i):t},set:function(e,t,r){var i=r&&Rt(e);return on(e,t,r?an(e,n,r,b.support.boxSizing&&"border-box"===b.css(e,"boxSizing",!1,i),i):0)}}}),b.support.opacity||(b.cssHooks.opacity={get:function(e,t){return It.test((t&&e.currentStyle?e.currentStyle.filter:e.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":t?"1":""},set:function(e,t){var n=e.style,r=e.currentStyle,i=b.isNumeric(t)?"alpha(opacity="+100*t+")":"",o=r&&r.filter||n.filter||"";n.zoom=1,(t>=1||""===t)&&""===b.trim(o.replace($t,""))&&n.removeAttribute&&(n.removeAttribute("filter"),""===t||r&&!r.filter)||(n.filter=$t.test(o)?o.replace($t,i):o+" "+i)}}),b(function(){b.support.reliableMarginRight||(b.cssHooks.marginRight={get:function(e,n){return n?b.swap(e,{display:"inline-block"},Wt,[e,"marginRight"]):t}}),!b.support.pixelPosition&&b.fn.position&&b.each(["top","left"],function(e,n){b.cssHooks[n]={get:function(e,r){return r?(r=Wt(e,n),Yt.test(r)?b(e).position()[n]+"px":r):t}}})}),b.expr&&b.expr.filters&&(b.expr.filters.hidden=function(e){return 0>=e.offsetWidth&&0>=e.offsetHeight||!b.support.reliableHiddenOffsets&&"none"===(e.style&&e.style.display||b.css(e,"display"))},b.expr.filters.visible=function(e){return!b.expr.filters.hidden(e)}),b.each({margin:"",padding:"",border:"Width"},function(e,t){b.cssHooks[e+t]={expand:function(n){var r=0,i={},o="string"==typeof n?n.split(" "):[n];for(;4>r;r++)i[e+Zt[r]+t]=o[r]||o[r-2]||o[0];return i}},Ut.test(e)||(b.cssHooks[e+t].set=on)});var cn=/%20/g,pn=/\[\]$/,fn=/\r?\n/g,dn=/^(?:submit|button|image|reset|file)$/i,hn=/^(?:input|select|textarea|keygen)/i;b.fn.extend({serialize:function(){return b.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=b.prop(this,"elements");return e?b.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!b(this).is(":disabled")&&hn.test(this.nodeName)&&!dn.test(e)&&(this.checked||!Nt.test(e))}).map(function(e,t){var n=b(this).val();return null==n?null:b.isArray(n)?b.map(n,function(e){return{name:t.name,value:e.replace(fn,"\r\n")}}):{name:t.name,value:n.replace(fn,"\r\n")}}).get()}}),b.param=function(e,n){var r,i=[],o=function(e,t){t=b.isFunction(t)?t():null==t?"":t,i[i.length]=encodeURIComponent(e)+"="+encodeURIComponent(t)};if(n===t&&(n=b.ajaxSettings&&b.ajaxSettings.traditional),b.isArray(e)||e.jquery&&!b.isPlainObject(e))b.each(e,function(){o(this.name,this.value)});else for(r in e)gn(r,e[r],n,o);return i.join("&").replace(cn,"+")};function gn(e,t,n,r){var i;if(b.isArray(t))b.each(t,function(t,i){n||pn.test(e)?r(e,i):gn(e+"["+("object"==typeof i?t:"")+"]",i,n,r)});else if(n||"object"!==b.type(t))r(e,t);else for(i in t)gn(e+"["+i+"]",t[i],n,r)}b.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(e,t){b.fn[t]=function(e,n){return arguments.length>0?this.on(t,null,e,n):this.trigger(t)}}),b.fn.hover=function(e,t){return this.mouseenter(e).mouseleave(t||e)};var mn,yn,vn=b.now(),bn=/\?/,xn=/#.*$/,wn=/([?&])_=[^&]*/,Tn=/^(.*?):[ \t]*([^\r\n]*)\r?$/gm,Nn=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Cn=/^(?:GET|HEAD)$/,kn=/^\/\//,En=/^([\w.+-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,Sn=b.fn.load,An={},jn={},Dn="*/".concat("*");try{yn=a.href}catch(Ln){yn=o.createElement("a"),yn.href="",yn=yn.href}mn=En.exec(yn.toLowerCase())||[];function Hn(e){return function(t,n){"string"!=typeof t&&(n=t,t="*");var r,i=0,o=t.toLowerCase().match(w)||[];if(b.isFunction(n))while(r=o[i++])"+"===r[0]?(r=r.slice(1)||"*",(e[r]=e[r]||[]).unshift(n)):(e[r]=e[r]||[]).push(n)}}function qn(e,n,r,i){var o={},a=e===jn;function s(u){var l;return o[u]=!0,b.each(e[u]||[],function(e,u){var c=u(n,r,i);return"string"!=typeof c||a||o[c]?a?!(l=c):t:(n.dataTypes.unshift(c),s(c),!1)}),l}return s(n.dataTypes[0])||!o["*"]&&s("*")}function Mn(e,n){var r,i,o=b.ajaxSettings.flatOptions||{};for(i in n)n[i]!==t&&((o[i]?e:r||(r={}))[i]=n[i]);return r&&b.extend(!0,e,r),e}b.fn.load=function(e,n,r){if("string"!=typeof e&&Sn)return Sn.apply(this,arguments);var i,o,a,s=this,u=e.indexOf(" ");return u>=0&&(i=e.slice(u,e.length),e=e.slice(0,u)),b.isFunction(n)?(r=n,n=t):n&&"object"==typeof n&&(a="POST"),s.length>0&&b.ajax({url:e,type:a,dataType:"html",data:n}).done(function(e){o=arguments,s.html(i?b("<div>").append(b.parseHTML(e)).find(i):e)}).complete(r&&function(e,t){s.each(r,o||[e.responseText,t,e])}),this},b.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){b.fn[t]=function(e){return this.on(t,e)}}),b.each(["get","post"],function(e,n){b[n]=function(e,r,i,o){return b.isFunction(r)&&(o=o||i,i=r,r=t),b.ajax({url:e,type:n,dataType:o,data:r,success:i})}}),b.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:yn,type:"GET",isLocal:Nn.test(mn[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Dn,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":e.String,"text html":!0,"text json":b.parseJSON,"text xml":b.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?Mn(Mn(e,b.ajaxSettings),t):Mn(b.ajaxSettings,e)},ajaxPrefilter:Hn(An),ajaxTransport:Hn(jn),ajax:function(e,n){"object"==typeof e&&(n=e,e=t),n=n||{};var r,i,o,a,s,u,l,c,p=b.ajaxSetup({},n),f=p.context||p,d=p.context&&(f.nodeType||f.jquery)?b(f):b.event,h=b.Deferred(),g=b.Callbacks("once memory"),m=p.statusCode||{},y={},v={},x=0,T="canceled",N={readyState:0,getResponseHeader:function(e){var t;if(2===x){if(!c){c={};while(t=Tn.exec(a))c[t[1].toLowerCase()]=t[2]}t=c[e.toLowerCase()]}return null==t?null:t},getAllResponseHeaders:function(){return 2===x?a:null},setRequestHeader:function(e,t){var n=e.toLowerCase();return x||(e=v[n]=v[n]||e,y[e]=t),this},overrideMimeType:function(e){return x||(p.mimeType=e),this},statusCode:function(e){var t;if(e)if(2>x)for(t in e)m[t]=[m[t],e[t]];else N.always(e[N.status]);return this},abort:function(e){var t=e||T;return l&&l.abort(t),k(0,t),this}};if(h.promise(N).complete=g.add,N.success=N.done,N.error=N.fail,p.url=((e||p.url||yn)+"").replace(xn,"").replace(kn,mn[1]+"//"),p.type=n.method||n.type||p.method||p.type,p.dataTypes=b.trim(p.dataType||"*").toLowerCase().match(w)||[""],null==p.crossDomain&&(r=En.exec(p.url.toLowerCase()),p.crossDomain=!(!r||r[1]===mn[1]&&r[2]===mn[2]&&(r[3]||("http:"===r[1]?80:443))==(mn[3]||("http:"===mn[1]?80:443)))),p.data&&p.processData&&"string"!=typeof p.data&&(p.data=b.param(p.data,p.traditional)),qn(An,p,n,N),2===x)return N;u=p.global,u&&0===b.active++&&b.event.trigger("ajaxStart"),p.type=p.type.toUpperCase(),p.hasContent=!Cn.test(p.type),o=p.url,p.hasContent||(p.data&&(o=p.url+=(bn.test(o)?"&":"?")+p.data,delete p.data),p.cache===!1&&(p.url=wn.test(o)?o.replace(wn,"$1_="+vn++):o+(bn.test(o)?"&":"?")+"_="+vn++)),p.ifModified&&(b.lastModified[o]&&N.setRequestHeader("If-Modified-Since",b.lastModified[o]),b.etag[o]&&N.setRequestHeader("If-None-Match",b.etag[o])),(p.data&&p.hasContent&&p.contentType!==!1||n.contentType)&&N.setRequestHeader("Content-Type",p.contentType),N.setRequestHeader("Accept",p.dataTypes[0]&&p.accepts[p.dataTypes[0]]?p.accepts[p.dataTypes[0]]+("*"!==p.dataTypes[0]?", "+Dn+"; q=0.01":""):p.accepts["*"]);for(i in p.headers)N.setRequestHeader(i,p.headers[i]);if(p.beforeSend&&(p.beforeSend.call(f,N,p)===!1||2===x))return N.abort();T="abort";for(i in{success:1,error:1,complete:1})N[i](p[i]);if(l=qn(jn,p,n,N)){N.readyState=1,u&&d.trigger("ajaxSend",[N,p]),p.async&&p.timeout>0&&(s=setTimeout(function(){N.abort("timeout")},p.timeout));try{x=1,l.send(y,k)}catch(C){if(!(2>x))throw C;k(-1,C)}}else k(-1,"No Transport");function k(e,n,r,i){var c,y,v,w,T,C=n;2!==x&&(x=2,s&&clearTimeout(s),l=t,a=i||"",N.readyState=e>0?4:0,r&&(w=_n(p,N,r)),e>=200&&300>e||304===e?(p.ifModified&&(T=N.getResponseHeader("Last-Modified"),T&&(b.lastModified[o]=T),T=N.getResponseHeader("etag"),T&&(b.etag[o]=T)),204===e?(c=!0,C="nocontent"):304===e?(c=!0,C="notmodified"):(c=Fn(p,w),C=c.state,y=c.data,v=c.error,c=!v)):(v=C,(e||!C)&&(C="error",0>e&&(e=0))),N.status=e,N.statusText=(n||C)+"",c?h.resolveWith(f,[y,C,N]):h.rejectWith(f,[N,C,v]),N.statusCode(m),m=t,u&&d.trigger(c?"ajaxSuccess":"ajaxError",[N,p,c?y:v]),g.fireWith(f,[N,C]),u&&(d.trigger("ajaxComplete",[N,p]),--b.active||b.event.trigger("ajaxStop")))}return N},getScript:function(e,n){return b.get(e,t,n,"script")},getJSON:function(e,t,n){return b.get(e,t,n,"json")}});function _n(e,n,r){var i,o,a,s,u=e.contents,l=e.dataTypes,c=e.responseFields;for(s in c)s in r&&(n[c[s]]=r[s]);while("*"===l[0])l.shift(),o===t&&(o=e.mimeType||n.getResponseHeader("Content-Type"));if(o)for(s in u)if(u[s]&&u[s].test(o)){l.unshift(s);break}if(l[0]in r)a=l[0];else{for(s in r){if(!l[0]||e.converters[s+" "+l[0]]){a=s;break}i||(i=s)}a=a||i}return a?(a!==l[0]&&l.unshift(a),r[a]):t}function Fn(e,t){var n,r,i,o,a={},s=0,u=e.dataTypes.slice(),l=u[0];if(e.dataFilter&&(t=e.dataFilter(t,e.dataType)),u[1])for(i in e.converters)a[i.toLowerCase()]=e.converters[i];for(;r=u[++s];)if("*"!==r){if("*"!==l&&l!==r){if(i=a[l+" "+r]||a["* "+r],!i)for(n in a)if(o=n.split(" "),o[1]===r&&(i=a[l+" "+o[0]]||a["* "+o[0]])){i===!0?i=a[n]:a[n]!==!0&&(r=o[0],u.splice(s--,0,r));break}if(i!==!0)if(i&&e["throws"])t=i(t);else try{t=i(t)}catch(c){return{state:"parsererror",error:i?c:"No conversion from "+l+" to "+r}}}l=r}return{state:"success",data:t}}b.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function(e){return b.globalEval(e),e}}}),b.ajaxPrefilter("script",function(e){e.cache===t&&(e.cache=!1),e.crossDomain&&(e.type="GET",e.global=!1)}),b.ajaxTransport("script",function(e){if(e.crossDomain){var n,r=o.head||b("head")[0]||o.documentElement;return{send:function(t,i){n=o.createElement("script"),n.async=!0,e.scriptCharset&&(n.charset=e.scriptCharset),n.src=e.url,n.onload=n.onreadystatechange=function(e,t){(t||!n.readyState||/loaded|complete/.test(n.readyState))&&(n.onload=n.onreadystatechange=null,n.parentNode&&n.parentNode.removeChild(n),n=null,t||i(200,"success"))},r.insertBefore(n,r.firstChild)},abort:function(){n&&n.onload(t,!0)}}}});var On=[],Bn=/(=)\?(?=&|$)|\?\?/;b.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=On.pop()||b.expando+"_"+vn++;return this[e]=!0,e}}),b.ajaxPrefilter("json jsonp",function(n,r,i){var o,a,s,u=n.jsonp!==!1&&(Bn.test(n.url)?"url":"string"==typeof n.data&&!(n.contentType||"").indexOf("application/x-www-form-urlencoded")&&Bn.test(n.data)&&"data");return u||"jsonp"===n.dataTypes[0]?(o=n.jsonpCallback=b.isFunction(n.jsonpCallback)?n.jsonpCallback():n.jsonpCallback,u?n[u]=n[u].replace(Bn,"$1"+o):n.jsonp!==!1&&(n.url+=(bn.test(n.url)?"&":"?")+n.jsonp+"="+o),n.converters["script json"]=function(){return s||b.error(o+" was not called"),s[0]},n.dataTypes[0]="json",a=e[o],e[o]=function(){s=arguments},i.always(function(){e[o]=a,n[o]&&(n.jsonpCallback=r.jsonpCallback,On.push(o)),s&&b.isFunction(a)&&a(s[0]),s=a=t}),"script"):t});var Pn,Rn,Wn=0,$n=e.ActiveXObject&&function(){var e;for(e in Pn)Pn[e](t,!0)};function In(){try{return new e.XMLHttpRequest}catch(t){}}function zn(){try{return new e.ActiveXObject("Microsoft.XMLHTTP")}catch(t){}}b.ajaxSettings.xhr=e.ActiveXObject?function(){return!this.isLocal&&In()||zn()}:In,Rn=b.ajaxSettings.xhr(),b.support.cors=!!Rn&&"withCredentials"in Rn,Rn=b.support.ajax=!!Rn,Rn&&b.ajaxTransport(function(n){if(!n.crossDomain||b.support.cors){var r;return{send:function(i,o){var a,s,u=n.xhr();if(n.username?u.open(n.type,n.url,n.async,n.username,n.password):u.open(n.type,n.url,n.async),n.xhrFields)for(s in n.xhrFields)u[s]=n.xhrFields[s];n.mimeType&&u.overrideMimeType&&u.overrideMimeType(n.mimeType),n.crossDomain||i["X-Requested-With"]||(i["X-Requested-With"]="XMLHttpRequest");try{for(s in i)u.setRequestHeader(s,i[s])}catch(l){}u.send(n.hasContent&&n.data||null),r=function(e,i){var s,l,c,p;try{if(r&&(i||4===u.readyState))if(r=t,a&&(u.onreadystatechange=b.noop,$n&&delete Pn[a]),i)4!==u.readyState&&u.abort();else{p={},s=u.status,l=u.getAllResponseHeaders(),"string"==typeof u.responseText&&(p.text=u.responseText);try{c=u.statusText}catch(f){c=""}s||!n.isLocal||n.crossDomain?1223===s&&(s=204):s=p.text?200:404}}catch(d){i||o(-1,d)}p&&o(s,c,p,l)},n.async?4===u.readyState?setTimeout(r):(a=++Wn,$n&&(Pn||(Pn={},b(e).unload($n)),Pn[a]=r),u.onreadystatechange=r):r()},abort:function(){r&&r(t,!0)}}}});var Xn,Un,Vn=/^(?:toggle|show|hide)$/,Yn=RegExp("^(?:([+-])=|)("+x+")([a-z%]*)$","i"),Jn=/queueHooks$/,Gn=[nr],Qn={"*":[function(e,t){var n,r,i=this.createTween(e,t),o=Yn.exec(t),a=i.cur(),s=+a||0,u=1,l=20;if(o){if(n=+o[2],r=o[3]||(b.cssNumber[e]?"":"px"),"px"!==r&&s){s=b.css(i.elem,e,!0)||n||1;do u=u||".5",s/=u,b.style(i.elem,e,s+r);while(u!==(u=i.cur()/a)&&1!==u&&--l)}i.unit=r,i.start=s,i.end=o[1]?s+(o[1]+1)*n:n}return i}]};function Kn(){return setTimeout(function(){Xn=t}),Xn=b.now()}function Zn(e,t){b.each(t,function(t,n){var r=(Qn[t]||[]).concat(Qn["*"]),i=0,o=r.length;for(;o>i;i++)if(r[i].call(e,t,n))return})}function er(e,t,n){var r,i,o=0,a=Gn.length,s=b.Deferred().always(function(){delete u.elem}),u=function(){if(i)return!1;var t=Xn||Kn(),n=Math.max(0,l.startTime+l.duration-t),r=n/l.duration||0,o=1-r,a=0,u=l.tweens.length;for(;u>a;a++)l.tweens[a].run(o);return s.notifyWith(e,[l,o,n]),1>o&&u?n:(s.resolveWith(e,[l]),!1)},l=s.promise({elem:e,props:b.extend({},t),opts:b.extend(!0,{specialEasing:{}},n),originalProperties:t,originalOptions:n,startTime:Xn||Kn(),duration:n.duration,tweens:[],createTween:function(t,n){var r=b.Tween(e,l.opts,t,n,l.opts.specialEasing[t]||l.opts.easing);return l.tweens.push(r),r},stop:function(t){var n=0,r=t?l.tweens.length:0;if(i)return this;for(i=!0;r>n;n++)l.tweens[n].run(1);return t?s.resolveWith(e,[l,t]):s.rejectWith(e,[l,t]),this}}),c=l.props;for(tr(c,l.opts.specialEasing);a>o;o++)if(r=Gn[o].call(l,e,c,l.opts))return r;return Zn(l,c),b.isFunction(l.opts.start)&&l.opts.start.call(e,l),b.fx.timer(b.extend(u,{elem:e,anim:l,queue:l.opts.queue})),l.progress(l.opts.progress).done(l.opts.done,l.opts.complete).fail(l.opts.fail).always(l.opts.always)}function tr(e,t){var n,r,i,o,a;for(i in e)if(r=b.camelCase(i),o=t[r],n=e[i],b.isArray(n)&&(o=n[1],n=e[i]=n[0]),i!==r&&(e[r]=n,delete e[i]),a=b.cssHooks[r],a&&"expand"in a){n=a.expand(n),delete e[r];for(i in n)i in e||(e[i]=n[i],t[i]=o)}else t[r]=o}b.Animation=b.extend(er,{tweener:function(e,t){b.isFunction(e)?(t=e,e=["*"]):e=e.split(" ");var n,r=0,i=e.length;for(;i>r;r++)n=e[r],Qn[n]=Qn[n]||[],Qn[n].unshift(t)},prefilter:function(e,t){t?Gn.unshift(e):Gn.push(e)}});function nr(e,t,n){var r,i,o,a,s,u,l,c,p,f=this,d=e.style,h={},g=[],m=e.nodeType&&nn(e);n.queue||(c=b._queueHooks(e,"fx"),null==c.unqueued&&(c.unqueued=0,p=c.empty.fire,c.empty.fire=function(){c.unqueued||p()}),c.unqueued++,f.always(function(){f.always(function(){c.unqueued--,b.queue(e,"fx").length||c.empty.fire()})})),1===e.nodeType&&("height"in t||"width"in t)&&(n.overflow=[d.overflow,d.overflowX,d.overflowY],"inline"===b.css(e,"display")&&"none"===b.css(e,"float")&&(b.support.inlineBlockNeedsLayout&&"inline"!==un(e.nodeName)?d.zoom=1:d.display="inline-block")),n.overflow&&(d.overflow="hidden",b.support.shrinkWrapBlocks||f.always(function(){d.overflow=n.overflow[0],d.overflowX=n.overflow[1],d.overflowY=n.overflow[2]}));for(i in t)if(a=t[i],Vn.exec(a)){if(delete t[i],u=u||"toggle"===a,a===(m?"hide":"show"))continue;g.push(i)}if(o=g.length){s=b._data(e,"fxshow")||b._data(e,"fxshow",{}),"hidden"in s&&(m=s.hidden),u&&(s.hidden=!m),m?b(e).show():f.done(function(){b(e).hide()}),f.done(function(){var t;b._removeData(e,"fxshow");for(t in h)b.style(e,t,h[t])});for(i=0;o>i;i++)r=g[i],l=f.createTween(r,m?s[r]:0),h[r]=s[r]||b.style(e,r),r in s||(s[r]=l.start,m&&(l.end=l.start,l.start="width"===r||"height"===r?1:0))}}function rr(e,t,n,r,i){return new rr.prototype.init(e,t,n,r,i)}b.Tween=rr,rr.prototype={constructor:rr,init:function(e,t,n,r,i,o){this.elem=e,this.prop=n,this.easing=i||"swing",this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=o||(b.cssNumber[n]?"":"px")},cur:function(){var e=rr.propHooks[this.prop];return e&&e.get?e.get(this):rr.propHooks._default.get(this)},run:function(e){var t,n=rr.propHooks[this.prop];return this.pos=t=this.options.duration?b.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):rr.propHooks._default.set(this),this}},rr.prototype.init.prototype=rr.prototype,rr.propHooks={_default:{get:function(e){var t;return null==e.elem[e.prop]||e.elem.style&&null!=e.elem.style[e.prop]?(t=b.css(e.elem,e.prop,""),t&&"auto"!==t?t:0):e.elem[e.prop]},set:function(e){b.fx.step[e.prop]?b.fx.step[e.prop](e):e.elem.style&&(null!=e.elem.style[b.cssProps[e.prop]]||b.cssHooks[e.prop])?b.style(e.elem,e.prop,e.now+e.unit):e.elem[e.prop]=e.now}}},rr.propHooks.scrollTop=rr.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},b.each(["toggle","show","hide"],function(e,t){var n=b.fn[t];b.fn[t]=function(e,r,i){return null==e||"boolean"==typeof e?n.apply(this,arguments):this.animate(ir(t,!0),e,r,i)}}),b.fn.extend({fadeTo:function(e,t,n,r){return this.filter(nn).css("opacity",0).show().end().animate({opacity:t},e,n,r)},animate:function(e,t,n,r){var i=b.isEmptyObject(e),o=b.speed(t,n,r),a=function(){var t=er(this,b.extend({},e),o);a.finish=function(){t.stop(!0)},(i||b._data(this,"finish"))&&t.stop(!0)};return a.finish=a,i||o.queue===!1?this.each(a):this.queue(o.queue,a)},stop:function(e,n,r){var i=function(e){var t=e.stop;delete e.stop,t(r)};return"string"!=typeof e&&(r=n,n=e,e=t),n&&e!==!1&&this.queue(e||"fx",[]),this.each(function(){var t=!0,n=null!=e&&e+"queueHooks",o=b.timers,a=b._data(this);if(n)a[n]&&a[n].stop&&i(a[n]);else for(n in a)a[n]&&a[n].stop&&Jn.test(n)&&i(a[n]);for(n=o.length;n--;)o[n].elem!==this||null!=e&&o[n].queue!==e||(o[n].anim.stop(r),t=!1,o.splice(n,1));(t||!r)&&b.dequeue(this,e)})},finish:function(e){return e!==!1&&(e=e||"fx"),this.each(function(){var t,n=b._data(this),r=n[e+"queue"],i=n[e+"queueHooks"],o=b.timers,a=r?r.length:0;for(n.finish=!0,b.queue(this,e,[]),i&&i.cur&&i.cur.finish&&i.cur.finish.call(this),t=o.length;t--;)o[t].elem===this&&o[t].queue===e&&(o[t].anim.stop(!0),o.splice(t,1));for(t=0;a>t;t++)r[t]&&r[t].finish&&r[t].finish.call(this);delete n.finish})}});function ir(e,t){var n,r={height:e},i=0;for(t=t?1:0;4>i;i+=2-t)n=Zt[i],r["margin"+n]=r["padding"+n]=e;return t&&(r.opacity=r.width=e),r}b.each({slideDown:ir("show"),slideUp:ir("hide"),slideToggle:ir("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,t){b.fn[e]=function(e,n,r){return this.animate(t,e,n,r)}}),b.speed=function(e,t,n){var r=e&&"object"==typeof e?b.extend({},e):{complete:n||!n&&t||b.isFunction(e)&&e,duration:e,easing:n&&t||t&&!b.isFunction(t)&&t};return r.duration=b.fx.off?0:"number"==typeof r.duration?r.duration:r.duration in b.fx.speeds?b.fx.speeds[r.duration]:b.fx.speeds._default,(null==r.queue||r.queue===!0)&&(r.queue="fx"),r.old=r.complete,r.complete=function(){b.isFunction(r.old)&&r.old.call(this),r.queue&&b.dequeue(this,r.queue)},r},b.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2}},b.timers=[],b.fx=rr.prototype.init,b.fx.tick=function(){var e,n=b.timers,r=0;for(Xn=b.now();n.length>r;r++)e=n[r],e()||n[r]!==e||n.splice(r--,1);n.length||b.fx.stop(),Xn=t},b.fx.timer=function(e){e()&&b.timers.push(e)&&b.fx.start()},b.fx.interval=13,b.fx.start=function(){Un||(Un=setInterval(b.fx.tick,b.fx.interval))},b.fx.stop=function(){clearInterval(Un),Un=null},b.fx.speeds={slow:600,fast:200,_default:400},b.fx.step={},b.expr&&b.expr.filters&&(b.expr.filters.animated=function(e){return b.grep(b.timers,function(t){return e===t.elem}).length}),b.fn.offset=function(e){if(arguments.length)return e===t?this:this.each(function(t){b.offset.setOffset(this,e,t)});var n,r,o={top:0,left:0},a=this[0],s=a&&a.ownerDocument;if(s)return n=s.documentElement,b.contains(n,a)?(typeof a.getBoundingClientRect!==i&&(o=a.getBoundingClientRect()),r=or(s),{top:o.top+(r.pageYOffset||n.scrollTop)-(n.clientTop||0),left:o.left+(r.pageXOffset||n.scrollLeft)-(n.clientLeft||0)}):o},b.offset={setOffset:function(e,t,n){var r=b.css(e,"position");"static"===r&&(e.style.position="relative");var i=b(e),o=i.offset(),a=b.css(e,"top"),s=b.css(e,"left"),u=("absolute"===r||"fixed"===r)&&b.inArray("auto",[a,s])>-1,l={},c={},p,f;u?(c=i.position(),p=c.top,f=c.left):(p=parseFloat(a)||0,f=parseFloat(s)||0),b.isFunction(t)&&(t=t.call(e,n,o)),null!=t.top&&(l.top=t.top-o.top+p),null!=t.left&&(l.left=t.left-o.left+f),"using"in t?t.using.call(e,l):i.css(l)}},b.fn.extend({position:function(){if(this[0]){var e,t,n={top:0,left:0},r=this[0];return"fixed"===b.css(r,"position")?t=r.getBoundingClientRect():(e=this.offsetParent(),t=this.offset(),b.nodeName(e[0],"html")||(n=e.offset()),n.top+=b.css(e[0],"borderTopWidth",!0),n.left+=b.css(e[0],"borderLeftWidth",!0)),{top:t.top-n.top-b.css(r,"marginTop",!0),left:t.left-n.left-b.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var e=this.offsetParent||o.documentElement;while(e&&!b.nodeName(e,"html")&&"static"===b.css(e,"position"))e=e.offsetParent;return e||o.documentElement})}}),b.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,n){var r=/Y/.test(n);b.fn[e]=function(i){return b.access(this,function(e,i,o){var a=or(e);return o===t?a?n in a?a[n]:a.document.documentElement[i]:e[i]:(a?a.scrollTo(r?b(a).scrollLeft():o,r?o:b(a).scrollTop()):e[i]=o,t)},e,i,arguments.length,null)}});function or(e){return b.isWindow(e)?e:9===e.nodeType?e.defaultView||e.parentWindow:!1}b.each({Height:"height",Width:"width"},function(e,n){b.each({padding:"inner"+e,content:n,"":"outer"+e},function(r,i){b.fn[i]=function(i,o){var a=arguments.length&&(r||"boolean"!=typeof i),s=r||(i===!0||o===!0?"margin":"border");return b.access(this,function(n,r,i){var o;return b.isWindow(n)?n.document.documentElement["client"+e]:9===n.nodeType?(o=n.documentElement,Math.max(n.body["scroll"+e],o["scroll"+e],n.body["offset"+e],o["offset"+e],o["client"+e])):i===t?b.css(n,r,s):b.style(n,r,i,s)},n,a?i:t,a,null)}})}),e.jQuery=e.$=b,"function"==typeof define&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return b})})(window); \ No newline at end of file
diff --git a/web/server/h2o/libh2o/misc/oktavia/templates/jsdoc3/static/scripts/oktavia-english-search.js b/web/server/h2o/libh2o/misc/oktavia/templates/jsdoc3/static/scripts/oktavia-english-search.js
new file mode 100644
index 00000000..cf5c38f3
--- /dev/null
+++ b/web/server/h2o/libh2o/misc/oktavia/templates/jsdoc3/static/scripts/oktavia-english-search.js
@@ -0,0 +1,8922 @@
+// generatedy by JSX compiler 0.9.24 (2013-04-05 13:45:00 +0900; 1b229cc6a411f674f0f7cf7a79b7a8b3f8eb7414)
+var JSX = {};
+(function (JSX) {
+/**
+ * copies the implementations from source interface to target
+ */
+function $__jsx_merge_interface(target, source) {
+ for (var k in source.prototype)
+ if (source.prototype.hasOwnProperty(k))
+ target.prototype[k] = source.prototype[k];
+}
+
+/**
+ * defers the initialization of the property
+ */
+function $__jsx_lazy_init(obj, prop, func) {
+ function reset(obj, prop, value) {
+ delete obj[prop];
+ obj[prop] = value;
+ return value;
+ }
+
+ Object.defineProperty(obj, prop, {
+ get: function () {
+ return reset(obj, prop, func());
+ },
+ set: function (v) {
+ reset(obj, prop, v);
+ },
+ enumerable: true,
+ configurable: true
+ });
+}
+
+/**
+ * sideeffect().a /= b
+ */
+function $__jsx_div_assign(obj, prop, divisor) {
+ return obj[prop] = (obj[prop] / divisor) | 0;
+}
+
+/*
+ * global functions, renamed to avoid conflict with local variable names
+ */
+var $__jsx_parseInt = parseInt;
+var $__jsx_parseFloat = parseFloat;
+var $__jsx_isNaN = isNaN;
+var $__jsx_isFinite = isFinite;
+
+var $__jsx_encodeURIComponent = encodeURIComponent;
+var $__jsx_decodeURIComponent = decodeURIComponent;
+var $__jsx_encodeURI = encodeURI;
+var $__jsx_decodeURI = decodeURI;
+
+var $__jsx_ObjectToString = Object.prototype.toString;
+var $__jsx_ObjectHasOwnProperty = Object.prototype.hasOwnProperty;
+
+/*
+ * profiler object, initialized afterwards
+ */
+function $__jsx_profiler() {
+}
+
+/*
+ * public interface to JSX code
+ */
+JSX.require = function (path) {
+ var m = $__jsx_classMap[path];
+ return m !== undefined ? m : null;
+};
+
+JSX.profilerIsRunning = function () {
+ return $__jsx_profiler.getResults != null;
+};
+
+JSX.getProfileResults = function () {
+ return ($__jsx_profiler.getResults || function () { return {}; })();
+};
+
+JSX.postProfileResults = function (url, cb) {
+ if ($__jsx_profiler.postResults == null)
+ throw new Error("profiler has not been turned on");
+ return $__jsx_profiler.postResults(url, cb);
+};
+
+JSX.resetProfileResults = function () {
+ if ($__jsx_profiler.resetResults == null)
+ throw new Error("profiler has not been turned on");
+ return $__jsx_profiler.resetResults();
+};
+JSX.DEBUG = false;
+/**
+ * class _Main extends Object
+ * @constructor
+ */
+function _Main() {
+}
+
+/**
+ * @constructor
+ */
+function _Main$() {
+};
+
+_Main$.prototype = new _Main;
+
+/**
+ * @param {Array.<undefined|!string>} args
+ */
+_Main.main$AS = function (args) {
+ OktaviaSearch$setStemmer$LStemmer$(new EnglishStemmer$());
+};
+
+var _Main$main$AS = _Main.main$AS;
+
+/**
+ * class _Result extends Object
+ * @constructor
+ */
+function _Result() {
+}
+
+/**
+ * @constructor
+ * @param {!string} title
+ * @param {!string} url
+ * @param {!string} content
+ * @param {!number} score
+ */
+function _Result$SSSI(title, url, content, score) {
+ this.title = title;
+ this.url = url;
+ this.content = content;
+ this.score = score;
+};
+
+_Result$SSSI.prototype = new _Result;
+
+/**
+ * class _Proposal extends Object
+ * @constructor
+ */
+function _Proposal() {
+}
+
+/**
+ * @constructor
+ * @param {!string} options
+ * @param {!string} label
+ * @param {!number} count
+ */
+function _Proposal$SSI(options, label, count) {
+ this.options = options;
+ this.label = label;
+ this.count = count;
+};
+
+_Proposal$SSI.prototype = new _Proposal;
+
+/**
+ * class OktaviaSearch extends Object
+ * @constructor
+ */
+function OktaviaSearch() {
+}
+
+/**
+ * @constructor
+ * @param {!number} entriesPerPage
+ */
+function OktaviaSearch$I(entriesPerPage) {
+ this._queries = null;
+ this._highlight = "";
+ this._result = null;
+ this._proposals = null;
+ this._currentFolderDepth = 0;
+ this._oktavia = new Oktavia$();
+ this._entriesPerPage = entriesPerPage;
+ this._currentPage = 1;
+ this._queryString = null;
+ this._callback = null;
+ OktaviaSearch._instance = this;
+};
+
+OktaviaSearch$I.prototype = new OktaviaSearch;
+
+/**
+ * @param {Stemmer} stemmer
+ */
+OktaviaSearch.setStemmer$LStemmer$ = function (stemmer) {
+ /** @type {Oktavia} */
+ var this$0;
+ if (OktaviaSearch._instance) {
+ this$0 = OktaviaSearch._instance._oktavia;
+ this$0._stemmer = stemmer;
+ } else {
+ OktaviaSearch._stemmer = stemmer;
+ }
+};
+
+var OktaviaSearch$setStemmer$LStemmer$ = OktaviaSearch.setStemmer$LStemmer$;
+
+/**
+ * @param {!string} index
+ */
+OktaviaSearch.prototype.loadIndex$S = function (index) {
+ /** @type {Oktavia} */
+ var this$0;
+ /** @type {Stemmer} */
+ var stemmer$0;
+ if (OktaviaSearch._stemmer) {
+ this$0 = this._oktavia;
+ stemmer$0 = OktaviaSearch._stemmer;
+ this$0._stemmer = stemmer$0;
+ }
+ this._oktavia.load$S(Binary$base64decode$S(index));
+ if (this._queryString) {
+ this.search$SF$IIV$(this._queryString, this._callback);
+ this._queryString = null;
+ this._callback = null;
+ }
+};
+
+/**
+ * @param {!string} queryString
+ * @param {*} callback
+ */
+OktaviaSearch.prototype.search$SF$IIV$ = function (queryString, callback) {
+ /** @type {QueryStringParser} */
+ var queryParser;
+ /** @type {SearchSummary} */
+ var summary;
+ /** @type {Array.<undefined|SearchUnit>} */
+ var _result$0;
+ if (this._oktavia) {
+ queryParser = ({queries: [ ]});
+ this._queries = QueryStringParser$parse$LQueryStringParser$S(queryParser, queryString);
+ this._highlight = QueryStringParser$highlight$LQueryStringParser$(queryParser);
+ summary = this._oktavia.search$ALQuery$(this._queries);
+ if (SearchSummary$size$LSearchSummary$(summary) > 0) {
+ this._result = this._sortResult$LSearchSummary$(summary);
+ this._proposals = [ ];
+ this._currentPage = 1;
+ } else {
+ this._result = [ ];
+ if (this._queries.length > 1) {
+ this._proposals = SearchSummary$getProposal$LSearchSummary$(summary);
+ } else {
+ this._proposals = [ ];
+ }
+ this._currentPage = 1;
+ }
+ callback((_result$0 = this._result).length, Math.ceil(_result$0.length / this._entriesPerPage));
+ } else {
+ this._queryString = queryString;
+ this._callback = callback;
+ }
+};
+
+/**
+ * @return {!number}
+ */
+OktaviaSearch.prototype.resultSize$ = function () {
+ return (this._result.length | 0);
+};
+
+/**
+ * @return {!number}
+ */
+OktaviaSearch.prototype.totalPages$ = function () {
+ return (Math.ceil(this._result.length / this._entriesPerPage) | 0);
+};
+
+/**
+ * @return {!number}
+ */
+OktaviaSearch.prototype.currentPage$ = function () {
+ return this._currentPage;
+};
+
+/**
+ * @param {!number} page
+ */
+OktaviaSearch.prototype.setCurrentPage$I = function (page) {
+ this._currentPage = page;
+};
+
+/**
+ * @return {!boolean}
+ */
+OktaviaSearch.prototype.hasPrevPage$ = function () {
+ return this._currentPage !== 1;
+};
+
+/**
+ * @return {!boolean}
+ */
+OktaviaSearch.prototype.hasNextPage$ = function () {
+ return this._currentPage !== Math.ceil(this._result.length / this._entriesPerPage);
+};
+
+/**
+ * @return {Array.<undefined|!string>}
+ */
+OktaviaSearch.prototype.pageIndexes$ = function () {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var total;
+ /** @type {!number} */
+ var i;
+ result = [ ];
+ total = Math.ceil(this._result.length / this._entriesPerPage);
+ if (total < 10) {
+ for (i = 1; i <= total; i++) {
+ result.push(i + "");
+ }
+ } else {
+ if (this._currentPage <= 5) {
+ for (i = 1; i <= 7; i++) {
+ result.push(i + "");
+ }
+ result.push('...', total + "");
+ } else {
+ if (total - 5 <= this._currentPage) {
+ result.push('1', '...');
+ for (i = total - 8; i <= total; i++) {
+ result.push(i + "");
+ }
+ } else {
+ result.push('1', '...');
+ for (i = this._currentPage - 3; i <= this._currentPage + 3; i++) {
+ result.push(i + "");
+ }
+ result.push('...', total + "");
+ }
+ }
+ }
+ return result;
+};
+
+/**
+ * @return {Array.<undefined|_Result>}
+ */
+OktaviaSearch.prototype.getResult$ = function () {
+ /** @type {Style} */
+ var style;
+ /** @type {!number} */
+ var start;
+ /** @type {!number} */
+ var last;
+ /** @type {Metadata} */
+ var metadata;
+ /** @type {!number} */
+ var num;
+ /** @type {Array.<undefined|_Result>} */
+ var results;
+ /** @type {!number} */
+ var i;
+ /** @type {SearchUnit} */
+ var unit;
+ /** @type {Array.<undefined|!string>} */
+ var info;
+ /** @type {!string} */
+ var content;
+ /** @type {Array.<undefined|Position>} */
+ var positions;
+ /** @type {!number} */
+ var end;
+ /** @type {!boolean} */
+ var split;
+ /** @type {!number} */
+ var j;
+ /** @type {Position} */
+ var pos;
+ /** @type {!string} */
+ var text;
+ /** @type {Oktavia} */
+ var this$0;
+ /** @type {!number} */
+ var position$0;
+ /** @type {!number} */
+ var _currentPage$0;
+ /** @type {!number} */
+ var _entriesPerPage$0;
+ style = new Style$S('html');
+ start = ((_currentPage$0 = this._currentPage) - 1) * (_entriesPerPage$0 = this._entriesPerPage);
+ last = Math.min(_currentPage$0 * _entriesPerPage$0, this._result.length);
+ this$0 = this._oktavia;
+ metadata = this$0._metadatas[this$0._metadataLabels[0]];
+ num = 250;
+ results = [ ];
+ for (i = start; i < last; i++) {
+ unit = this._result[i];
+ info = metadata.getInformation$I(unit.id).split(Oktavia.eob);
+ content = metadata.getContent$I(unit.id);
+ start = 0;
+ positions = SearchUnit$getPositions$LSearchUnit$(unit);
+ if (content.indexOf(info[0]) === 1) {
+ content = content.slice(info[0].length + 2, content.length);
+ start += info[0].length + 2;
+ }
+ end = start + num;
+ split = false;
+ if (positions[0].position > end - positions[0].word.length) {
+ end = positions[0].position + Math.floor(num / 2);
+ split = true;
+ }
+ for (j = positions.length - 1; j > -1; j--) {
+ pos = positions[j];
+ if (pos.position + pos.word.length < end) {
+ content = [ content.slice(0, pos.position - start), style.convert$S('<hit>*</hit>').replace('*', content.slice((position$0 = pos.position) - start, position$0 + pos.word.length - start)), content.slice(pos.position + pos.word.length - start, content.length) ].join('');
+ }
+ }
+ if (split) {
+ text = [ content.slice(0, Math.floor(num / 2)) + ' ...', content.slice(- Math.floor(num / 2), end - start) ].join('<br/>');
+ } else {
+ text = content.slice(0, end - start) + ' ...<br/>';
+ }
+ text = text.replace(Oktavia.eob, ' ').replace(/(<br\/>)(<br\/>)+/, '<br/><br/>');
+ results.push(({title: info[0], url: info[1], content: text, score: unit.score}));
+ }
+ return results;
+};
+
+/**
+ * @return {!string}
+ */
+OktaviaSearch.prototype.getHighlight$ = function () {
+ return this._highlight;
+};
+
+/**
+ * @return {Array.<undefined|_Proposal>}
+ */
+OktaviaSearch.prototype.getProposals$ = function () {
+ /** @type {Style} */
+ var style;
+ /** @type {Array.<undefined|_Proposal>} */
+ var results;
+ /** @type {!number} */
+ var i;
+ /** @type {Proposal} */
+ var proposal;
+ /** @type {Array.<undefined|!string>} */
+ var label;
+ /** @type {Array.<undefined|!string>} */
+ var option;
+ /** @type {!number} */
+ var j;
+ style = new Style$S('html');
+ results = [ ];
+ if (this._queries.length > 1) {
+ for (i = 0; i < this._proposals.length; i++) {
+ proposal = this._proposals[i];
+ if (proposal.expect > 0) {
+ label = [ ];
+ option = [ ];
+ for (j = 0; j < this._queries.length; j++) {
+ if (j !== proposal.omit) {
+ label.push(style.convert$S('<hit>' + this._queries[j].toString() + '</hit>'));
+ option.push(this._queries[j].toString());
+ } else {
+ label.push(style.convert$S('<del>' + this._queries[j].toString() + '</del>'));
+ }
+ }
+ results.push(({options: option.join(' '), label: label.join('&nbsp;'), count: proposal.expect}));
+ }
+ }
+ }
+ return results;
+};
+
+/**
+ * @param {SearchSummary} summary
+ * @return {Array.<undefined|SearchUnit>}
+ */
+OktaviaSearch.prototype._sortResult$LSearchSummary$ = function (summary) {
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var score;
+ /** @type {SearchUnit} */
+ var unit;
+ /** @type {!string} */
+ var pos;
+ /** @type {Position} */
+ var position;
+ for (i = 0; i < summary.result.units.length; i++) {
+ score = 0;
+ unit = summary.result.units[i];
+ for (pos in unit.positions) {
+ position = unit.positions[pos];
+ if (this._oktavia.wordPositionType$I(position.position)) {
+ score += 10;
+ } else {
+ score += 1;
+ }
+ if (! position.stemmed) {
+ score += 2;
+ }
+ }
+ unit.score = (score | 0);
+ }
+ return SearchSummary$getSortedResult$LSearchSummary$(summary);
+};
+
+/**
+ * class _Main$0 extends Object
+ * @constructor
+ */
+function _Main$0() {
+}
+
+/**
+ * @constructor
+ */
+function _Main$0$() {
+};
+
+_Main$0$.prototype = new _Main$0;
+
+/**
+ * @param {Array.<undefined|!string>} args
+ */
+_Main$0.main$AS = function (args) {
+};
+
+var _Main$0$main$AS = _Main$0.main$AS;
+
+/**
+ * class Oktavia extends Object
+ * @constructor
+ */
+function Oktavia() {
+}
+
+/**
+ * @constructor
+ */
+function Oktavia$() {
+ /** @type {Array.<undefined|!string>} */
+ var _utf162compressCode$0;
+ this._compressCode2utf16 = null;
+ this._fmindex = new FMIndex$();
+ this._metadatas = ({ });
+ this._metadataLabels = [ ];
+ this._stemmer = null;
+ this._stemmingResult = ({ });
+ _utf162compressCode$0 = this._utf162compressCode = [ Oktavia.eof, Oktavia.eob, Oktavia.unknown ];
+ _utf162compressCode$0.length = 65536;
+ this._compressCode2utf16 = [ Oktavia.eof, Oktavia.eob, Oktavia.unknown ];
+};
+
+Oktavia$.prototype = new Oktavia;
+
+/**
+ * @param {Stemmer} stemmer
+ */
+Oktavia.prototype.setStemmer$LStemmer$ = function (stemmer) {
+ this._stemmer = stemmer;
+};
+
+/**
+ * @return {Metadata}
+ */
+Oktavia.prototype.getPrimaryMetadata$ = function () {
+ return this._metadatas[this._metadataLabels[0]];
+};
+
+/**
+ * @param {!string} key
+ * @return {Section}
+ */
+Oktavia.prototype.addSection$S = function (key) {
+ /** @type {Section} */
+ var section;
+ if (this._metadataLabels.indexOf(key) !== -1) {
+ throw new Error('Metadata name ' + key + ' is already exists');
+ }
+ this._metadataLabels.push(key);
+ section = new Section$LOktavia$(this);
+ this._metadatas[key] = section;
+ return section;
+};
+
+/**
+ * @param {!string} key
+ * @return {Section}
+ */
+Oktavia.prototype.getSection$S = function (key) {
+ if (this._metadataLabels.indexOf(key) === -1) {
+ throw new Error('Metadata name ' + key + " does't exists");
+ }
+ return this._metadatas[key];
+};
+
+/**
+ * @param {!string} key
+ * @return {Splitter}
+ */
+Oktavia.prototype.addSplitter$S = function (key) {
+ /** @type {Splitter} */
+ var splitter;
+ if (this._metadataLabels.indexOf(key) !== -1) {
+ throw new Error('Metadata name ' + key + ' is already exists');
+ }
+ this._metadataLabels.push(key);
+ splitter = new Splitter$LOktavia$(this);
+ this._metadatas[key] = splitter;
+ return splitter;
+};
+
+/**
+ * @param {!string} key
+ * @return {Splitter}
+ */
+Oktavia.prototype.getSplitter$S = function (key) {
+ if (this._metadataLabels.indexOf(key) === -1) {
+ throw new Error('Metadata name ' + key + " does't exists");
+ }
+ return this._metadatas[key];
+};
+
+/**
+ * @param {!string} key
+ * @param {Array.<undefined|!string>} headers
+ * @return {Table}
+ */
+Oktavia.prototype.addTable$SAS = function (key, headers) {
+ /** @type {Table} */
+ var table;
+ if (this._metadataLabels.indexOf(key) !== -1) {
+ throw new Error('Metadata name ' + key + ' is already exists');
+ }
+ this._metadataLabels.push(key);
+ table = new Table$LOktavia$AS(this, headers);
+ this._metadatas[key] = table;
+ return table;
+};
+
+/**
+ * @param {!string} key
+ * @return {Table}
+ */
+Oktavia.prototype.getTable$S = function (key) {
+ if (this._metadataLabels.indexOf(key) === -1) {
+ throw new Error('Metadata name ' + key + " does't exists");
+ }
+ return this._metadatas[key];
+};
+
+/**
+ * @param {!string} key
+ * @return {Block}
+ */
+Oktavia.prototype.addBlock$S = function (key) {
+ /** @type {Block} */
+ var block;
+ if (this._metadataLabels.indexOf(key) !== -1) {
+ throw new Error('Metadata name ' + key + ' is already exists');
+ }
+ this._metadataLabels.push(key);
+ block = new Block$LOktavia$(this);
+ this._metadatas[key] = block;
+ return block;
+};
+
+/**
+ * @param {!string} key
+ * @return {Block}
+ */
+Oktavia.prototype.getBlock$S = function (key) {
+ if (this._metadataLabels.indexOf(key) === -1) {
+ throw new Error('Metadata name ' + key + " does't exists");
+ }
+ return this._metadatas[key];
+};
+
+/**
+ */
+Oktavia.prototype.addEndOfBlock$ = function () {
+ this._fmindex.push$S(Oktavia.eob);
+};
+
+/**
+ * @param {!string} words
+ */
+Oktavia.prototype.addWord$S = function (words) {
+ /** @type {Array.<undefined|!string>} */
+ var str;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var charCode;
+ /** @type {undefined|!string} */
+ var newCharCode;
+ str = [ ];
+ str.length = words.length;
+ for (i = 0; i < words.length; i++) {
+ charCode = words.charCodeAt(i);
+ newCharCode = this._utf162compressCode[charCode];
+ if (newCharCode == null) {
+ newCharCode = String.fromCharCode(this._compressCode2utf16.length);
+ this._utf162compressCode[charCode] = newCharCode;
+ this._compressCode2utf16.push(String.fromCharCode(charCode));
+ }
+ str.push(newCharCode);
+ }
+ this._fmindex.push$S(str.join(''));
+};
+
+/**
+ * @param {!string} words
+ * @param {!boolean} stemming
+ */
+Oktavia.prototype.addWord$SB = function (words, stemming) {
+ /** @type {Array.<undefined|!string>} */
+ var wordList;
+ /** @type {!number} */
+ var i;
+ /** @type {undefined|!string} */
+ var originalWord;
+ /** @type {!string} */
+ var smallWord;
+ /** @type {undefined|!string} */
+ var registerWord;
+ /** @type {!string} */
+ var baseWord;
+ /** @type {!string} */
+ var compressedCodeWord;
+ /** @type {Array.<undefined|!string>} */
+ var stemmedList;
+ this.addWord$S(words);
+ wordList = words.split(/\s+/);
+ for (i = 0; i < wordList.length; i++) {
+ originalWord = wordList[i];
+ smallWord = originalWord.slice(0, 1).toLowerCase() + originalWord.slice(1);
+ registerWord = null;
+ if (stemming && this._stemmer) {
+ baseWord = this._stemmer.stemWord$S(originalWord.toLowerCase());
+ if (originalWord.indexOf(baseWord) === -1) {
+ registerWord = baseWord;
+ }
+ } else {
+ if (originalWord != smallWord) {
+ registerWord = smallWord;
+ }
+ }
+ if (registerWord) {
+ compressedCodeWord = this._convertToCompressionCode$S(originalWord);
+ stemmedList = this._stemmingResult[registerWord];
+ if (! stemmedList) {
+ stemmedList = [ compressedCodeWord ];
+ this._stemmingResult[registerWord] = stemmedList;
+ } else {
+ if (stemmedList.indexOf(compressedCodeWord) === -1) {
+ stemmedList.push(compressedCodeWord);
+ }
+ }
+ }
+ }
+};
+
+/**
+ * @param {!string} keyword
+ * @return {!string}
+ */
+Oktavia.prototype._convertToCompressionCode$S = function (keyword) {
+ /** @type {Array.<undefined|!string>} */
+ var resultChars;
+ /** @type {!number} */
+ var i;
+ /** @type {undefined|!string} */
+ var chr;
+ resultChars = [ ];
+ for (i = 0; i < keyword.length; i++) {
+ chr = this._utf162compressCode[keyword.charCodeAt(i)];
+ if (chr == null) {
+ resultChars.push(Oktavia.unknown);
+ } else {
+ resultChars.push(chr);
+ }
+ }
+ return resultChars.join('');
+};
+
+/**
+ * @param {!string} keyword
+ * @param {!boolean} stemming
+ * @return {Array.<undefined|!number>}
+ */
+Oktavia.prototype.rawSearch$SB = function (keyword, stemming) {
+ /** @type {Array.<undefined|!number>} */
+ var result;
+ /** @type {!string} */
+ var baseWord;
+ /** @type {Array.<undefined|!string>} */
+ var stemmedList;
+ /** @type {!number} */
+ var i;
+ /** @type {undefined|!string} */
+ var word;
+ if (stemming) {
+ result = [ ];
+ if (this._stemmer) {
+ baseWord = this._stemmer.stemWord$S(keyword.toLowerCase());
+ stemmedList = this._stemmingResult[baseWord];
+ if (stemmedList) {
+ for (i = 0; i < stemmedList.length; i++) {
+ word = stemmedList[i];
+ result = result.concat(this._fmindex.search$S(word));
+ }
+ }
+ }
+ } else {
+ result = this._fmindex.search$S(this._convertToCompressionCode$S(keyword));
+ }
+ return result;
+};
+
+/**
+ * @param {Array.<undefined|Query>} queries
+ * @return {SearchSummary}
+ */
+Oktavia.prototype.search$ALQuery$ = function (queries) {
+ /** @type {SearchSummary} */
+ var summary;
+ /** @type {!number} */
+ var i;
+ /** @type {SingleResult} */
+ var result$0;
+ summary = ({sourceResults: [ ], result: null, oktavia: this});
+ for (i = 0; i < queries.length; i++) {
+ result$0 = this._searchQuery$LQuery$(queries[i]);
+ summary.sourceResults.push(result$0);
+ }
+ summary.result = SearchSummary$mergeResult$LSearchSummary$ALSingleResult$(summary, summary.sourceResults);
+ return summary;
+};
+
+/**
+ * @param {Query} query
+ * @return {SingleResult}
+ */
+Oktavia.prototype._searchQuery$LQuery$ = function (query) {
+ /** @type {SingleResult} */
+ var result;
+ /** @type {Array.<undefined|!number>} */
+ var positions;
+ result = new SingleResult$SBB(query.word, query.or, query.not);
+ if (query.raw) {
+ positions = this.rawSearch$SB(query.word, false);
+ } else {
+ positions = this.rawSearch$SB(query.word, false).concat(this.rawSearch$SB(query.word, true));
+ }
+ this._metadatas[this._metadataLabels[0]].grouping$LSingleResult$AISB(result, positions, query.word, ! query.raw);
+ return result;
+};
+
+/**
+ */
+Oktavia.prototype.build$ = function () {
+ this.build$IB(5, false);
+};
+
+/**
+ * @param {!number} cacheDensity
+ * @param {!boolean} verbose
+ */
+Oktavia.prototype.build$IB = function (cacheDensity, verbose) {
+ /** @type {!string} */
+ var key;
+ /** @type {!number} */
+ var cacheRange;
+ /** @type {!number} */
+ var maxChar;
+ for (key in this._metadatas) {
+ this._metadatas[key]._build$();
+ }
+ cacheRange = Math.round(Math.max(1, 100 / Math.min(100, Math.max(0.01, cacheDensity))));
+ maxChar = this._compressCode2utf16.length;
+ this._fmindex.build$SIIB(Oktavia.eof, maxChar, cacheRange, verbose);
+};
+
+/**
+ * @return {!string}
+ */
+Oktavia.prototype.dump$ = function () {
+ return this.dump$B(false);
+};
+
+/**
+ * @param {!boolean} verbose
+ * @return {!string}
+ */
+Oktavia.prototype.dump$B = function (verbose) {
+ /** @type {!string} */
+ var header;
+ /** @type {!string} */
+ var fmdata;
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var i;
+ /** @type {CompressionReport} */
+ var report;
+ /** @type {undefined|!string} */
+ var name;
+ /** @type {!string} */
+ var data;
+ header = Binary$dumpString$SLCompressionReport$("oktavia-01", null).slice(1);
+ if (verbose) {
+ console.log("Source text size: " + (this._fmindex.size$() * 2 + "") + ' bytes');
+ }
+ fmdata = this._fmindex.dump$B(verbose);
+ result = [ header, fmdata ];
+ result.push(Binary$dump16bitNumber$I(this._compressCode2utf16.length));
+ for (i = 3; i < this._compressCode2utf16.length; i++) {
+ result.push(this._compressCode2utf16[i]);
+ }
+ if (verbose) {
+ console.log('Char Code Map: ' + (this._compressCode2utf16.length * 2 - 2 + "") + ' bytes');
+ }
+ report = ({source: 0, result: 0});
+ result.push(Binary$dumpStringListMap$HASLCompressionReport$(this._stemmingResult, report));
+ if (verbose) {
+ console.log('Stemmed Word Table: ' + (result[result.length - 1].length + "") + ' bytes (' + (Math.round(report.result * 100.0 / report.source) + "") + '%)');
+ }
+ result.push(Binary$dump16bitNumber$I(this._metadataLabels.length));
+ for (i = 0; i < this._metadataLabels.length; i++) {
+ report = ({source: 0, result: 0});
+ name = this._metadataLabels[i];
+ data = this._metadatas[name]._dump$LCompressionReport$(report);
+ result.push(Binary$dumpString$SLCompressionReport$(name, report), data);
+ if (verbose) {
+ console.log('Meta Data ' + name + ': ' + (data.length * 2 + "") + ' bytes (' + (Math.round(report.result * 100.0 / report.source) + "") + '%)');
+ }
+ }
+ return result.join('');
+};
+
+/**
+ * @param {!string} data
+ */
+Oktavia.prototype.load$S = function (data) {
+ /** @type {!string} */
+ var header;
+ /** @type {!number} */
+ var offset;
+ /** @type {!number} */
+ var charCodeCount;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var charCode;
+ /** @type {LoadedStringListMapResult} */
+ var stemmedWords;
+ /** @type {!number} */
+ var metadataCount;
+ /** @type {LoadedStringResult} */
+ var nameResult;
+ /** @type {!string} */
+ var name;
+ /** @type {!number} */
+ var type;
+ header = Binary$dumpString$SLCompressionReport$("oktavia-01", null).slice(1);
+ if (data.slice(0, 5) !== header) {
+ throw new Error('Invalid data file');
+ }
+ this._metadatas = ({ });
+ this._metadataLabels = [ ];
+ offset = 5;
+ offset = this._fmindex.load$SI(data, offset);
+ charCodeCount = Binary$load16bitNumber$SI(data, offset++);
+ this._compressCode2utf16 = [ Oktavia.eof, Oktavia.eob, Oktavia.unknown ];
+ this._utf162compressCode = [ Oktavia.eof, Oktavia.eob, Oktavia.unknown ];
+ for (i = 3; i < charCodeCount; i++) {
+ charCode = Binary$load16bitNumber$SI(data, offset++);
+ this._compressCode2utf16.push(String.fromCharCode(charCode));
+ this._utf162compressCode[charCode] = String.fromCharCode(i);
+ }
+ stemmedWords = Binary$loadStringListMap$SI(data, offset);
+ this._stemmingResult = stemmedWords.result;
+ offset = stemmedWords.offset;
+ metadataCount = Binary$load16bitNumber$SI(data, offset++);
+ for (i = 0; i < metadataCount; i++) {
+ nameResult = Binary$loadString$SI(data, offset);
+ name = nameResult.result;
+ offset = nameResult.offset;
+ type = Binary$load16bitNumber$SI(data, offset++);
+ switch (type) {
+ case 0:
+ offset = Section$_load$LOktavia$SSI(this, name, data, offset);
+ break;
+ case 1:
+ offset = Splitter$_load$LOktavia$SSI(this, name, data, offset);
+ break;
+ case 2:
+ offset = Table$_load$LOktavia$SSI(this, name, data, offset);
+ break;
+ case 3:
+ offset = Block$_load$LOktavia$SSI(this, name, data, offset);
+ break;
+ }
+ }
+};
+
+/**
+ * @return {!number}
+ */
+Oktavia.prototype.contentSize$ = function () {
+ /** @type {FMIndex} */
+ var this$0;
+ this$0 = this._fmindex;
+ return this$0._substr.length;
+};
+
+/**
+ * @param {!number} position
+ * @return {!number}
+ */
+Oktavia.prototype.wordPositionType$I = function (position) {
+ /** @type {!number} */
+ var result;
+ /** @type {!string} */
+ var ahead;
+ result = 0;
+ if (position === 0) {
+ result = 4;
+ } else {
+ ahead = this._fmindex.getSubstring$II(position - 1, 1);
+ if (/\s/.test(ahead)) {
+ result = 2;
+ } else {
+ if (/\W/.test(ahead)) {
+ result = 1;
+ } else {
+ if (Oktavia.eob === ahead) {
+ result = 3;
+ }
+ }
+ }
+ }
+ return (result | 0);
+};
+
+/**
+ * @param {!number} position
+ * @param {!number} length
+ * @return {!string}
+ */
+Oktavia.prototype._getSubstring$II = function (position, length) {
+ /** @type {!string} */
+ var result;
+ /** @type {Array.<undefined|!string>} */
+ var str;
+ /** @type {!number} */
+ var i;
+ result = this._fmindex.getSubstring$II(position, length);
+ str = [ ];
+ for (i = 0; i < result.length; i++) {
+ str.push(this._compressCode2utf16[result.charCodeAt(i)]);
+ }
+ return str.join('');
+};
+
+/**
+ * class Binary extends Object
+ * @constructor
+ */
+function Binary() {
+}
+
+/**
+ * @constructor
+ */
+function Binary$() {
+};
+
+Binary$.prototype = new Binary;
+
+/**
+ * @param {!number} num
+ * @return {!string}
+ */
+Binary.dump32bitNumber$N = function (num) {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ result = [ String.fromCharCode(Math.floor(num / 65536)) ];
+ result.push(String.fromCharCode(num % 65536));
+ return result.join("");
+};
+
+var Binary$dump32bitNumber$N = Binary.dump32bitNumber$N;
+
+/**
+ * @param {!string} buffer
+ * @param {!number} offset
+ * @return {!number}
+ */
+Binary.load32bitNumber$SI = function (buffer, offset) {
+ /** @type {!number} */
+ var result;
+ result = buffer.charCodeAt(offset) * 65536 + buffer.charCodeAt(offset + 1);
+ return result;
+};
+
+var Binary$load32bitNumber$SI = Binary.load32bitNumber$SI;
+
+/**
+ * @param {!number} num
+ * @return {!string}
+ */
+Binary.dump16bitNumber$I = function (num) {
+ return String.fromCharCode(num % 65536);
+};
+
+var Binary$dump16bitNumber$I = Binary.dump16bitNumber$I;
+
+/**
+ * @param {!string} buffer
+ * @param {!number} offset
+ * @return {!number}
+ */
+Binary.load16bitNumber$SI = function (buffer, offset) {
+ return (buffer.charCodeAt(offset) | 0);
+};
+
+var Binary$load16bitNumber$SI = Binary.load16bitNumber$SI;
+
+/**
+ * @param {!string} str
+ * @return {!string}
+ */
+Binary.dumpString$S = function (str) {
+ return Binary$dumpString$SLCompressionReport$(str, null);
+};
+
+var Binary$dumpString$S = Binary.dumpString$S;
+
+/**
+ * @param {!string} str
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+Binary.dumpString$SLCompressionReport$ = function (str, report) {
+ /** @type {!number} */
+ var length;
+ /** @type {!boolean} */
+ var compress;
+ /** @type {Array.<undefined|!number>} */
+ var charCodes;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var charCode;
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {undefined|!number} */
+ var bytes;
+ if (str.length > 32768) {
+ str = str.slice(0, 32768);
+ }
+ length = str.length;
+ compress = true;
+ charCodes = [ ];
+ for (i = 0; i < length; i++) {
+ charCode = str.charCodeAt(i);
+ if (charCode > 255) {
+ compress = false;
+ break;
+ }
+ charCodes.push(charCode);
+ }
+ if (compress) {
+ result = [ Binary$dump16bitNumber$I(length + 32768) ];
+ for (i = 0; i < length; i += 2) {
+ bytes = charCodes[i];
+ if (i !== length - 1) {
+ bytes += charCodes[i + 1] << 8;
+ }
+ result.push(String.fromCharCode(bytes % 65536));
+ }
+ if (report) {
+ CompressionReport$add$LCompressionReport$II(report, length, Math.ceil(length / 2));
+ }
+ } else {
+ result = [ Binary$dump16bitNumber$I(length), str ];
+ if (report) {
+ CompressionReport$add$LCompressionReport$II(report, length, length);
+ }
+ }
+ return result.join('');
+};
+
+var Binary$dumpString$SLCompressionReport$ = Binary.dumpString$SLCompressionReport$;
+
+/**
+ * @param {!string} buffer
+ * @param {!number} offset
+ * @return {LoadedStringResult}
+ */
+Binary.loadString$SI = function (buffer, offset) {
+ return new LoadedStringResult$SI(buffer, offset);
+};
+
+var Binary$loadString$SI = Binary.loadString$SI;
+
+/**
+ * @param {Array.<undefined|!string>} strList
+ * @return {!string}
+ */
+Binary.dumpStringList$AS = function (strList) {
+ return Binary$dumpStringList$ASLCompressionReport$(strList, null);
+};
+
+var Binary$dumpStringList$AS = Binary.dumpStringList$AS;
+
+/**
+ * @param {Array.<undefined|!string>} strList
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+Binary.dumpStringList$ASLCompressionReport$ = function (strList, report) {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var i;
+ result = [ Binary$dump32bitNumber$N(strList.length) ];
+ for (i = 0; i < strList.length; i++) {
+ result.push(Binary$dumpString$SLCompressionReport$(strList[i], report));
+ }
+ return result.join('');
+};
+
+var Binary$dumpStringList$ASLCompressionReport$ = Binary.dumpStringList$ASLCompressionReport$;
+
+/**
+ * @param {!string} buffer
+ * @param {!number} offset
+ * @return {LoadedStringListResult}
+ */
+Binary.loadStringList$SI = function (buffer, offset) {
+ return new LoadedStringListResult$SI(buffer, offset);
+};
+
+var Binary$loadStringList$SI = Binary.loadStringList$SI;
+
+/**
+ * @param {Object.<string, undefined|Array.<undefined|!string>>} strMap
+ * @return {!string}
+ */
+Binary.dumpStringListMap$HAS = function (strMap) {
+ return Binary$dumpStringListMap$HASLCompressionReport$(strMap, null);
+};
+
+var Binary$dumpStringListMap$HAS = Binary.dumpStringListMap$HAS;
+
+/**
+ * @param {Object.<string, undefined|Array.<undefined|!string>>} strMap
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+Binary.dumpStringListMap$HASLCompressionReport$ = function (strMap, report) {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var counter;
+ /** @type {!string} */
+ var key;
+ result = [ ];
+ counter = 0;
+ for (key in strMap) {
+ result.push(Binary$dumpString$SLCompressionReport$(key, report));
+ result.push(Binary$dumpStringList$ASLCompressionReport$(strMap[key], report));
+ counter++;
+ }
+ return Binary$dump32bitNumber$N(counter) + result.join('');
+};
+
+var Binary$dumpStringListMap$HASLCompressionReport$ = Binary.dumpStringListMap$HASLCompressionReport$;
+
+/**
+ * @param {!string} buffer
+ * @param {!number} offset
+ * @return {LoadedStringListMapResult}
+ */
+Binary.loadStringListMap$SI = function (buffer, offset) {
+ return new LoadedStringListMapResult$SI(buffer, offset);
+};
+
+var Binary$loadStringListMap$SI = Binary.loadStringListMap$SI;
+
+/**
+ * @param {Array.<undefined|!number>} array
+ * @return {!string}
+ */
+Binary.dump32bitNumberList$AN = function (array) {
+ return Binary$dump32bitNumberList$ANLCompressionReport$(array, null);
+};
+
+var Binary$dump32bitNumberList$AN = Binary.dump32bitNumberList$AN;
+
+/**
+ * @param {Array.<undefined|!number>} array
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+Binary.dump32bitNumberList$ANLCompressionReport$ = function (array, report) {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var index;
+ /** @type {!number} */
+ var inputLength;
+ /** @type {!number} */
+ var length;
+ /** @type {!string} */
+ var resultString;
+ /** @type {!number} */
+ var value1$0;
+ /** @type {!number} */
+ var value2$0;
+ result = [ Binary$dump32bitNumber$N(array.length) ];
+ index = 0;
+ inputLength = array.length;
+ while (index < inputLength) {
+ if (array[index] == 0) {
+ length = Binary$_countZero$ANI(array, index);
+ result.push(Binary$_zeroBlock$I(length));
+ index += length;
+ } else {
+ if (Binary$_shouldZebraCode$ANI(array, index)) {
+ result.push(Binary$_createZebraCode$ANI(array, index));
+ value1$0 = array.length;
+ value2$0 = index + 15;
+ index = (value1$0 <= value2$0 ? value1$0 : value2$0);
+ } else {
+ length = Binary$_searchDoubleZero$ANI(array, index);
+ result.push(Binary$_nonZeroBlock$ANII(array, index, length));
+ if (length === 0) {
+ throw new Error('');
+ }
+ index += length;
+ }
+ }
+ }
+ resultString = result.join('');
+ if (report) {
+ CompressionReport$add$LCompressionReport$II(report, array.length * 2 + 2, resultString.length);
+ }
+ return resultString;
+};
+
+var Binary$dump32bitNumberList$ANLCompressionReport$ = Binary.dump32bitNumberList$ANLCompressionReport$;
+
+/**
+ * @param {!string} buffer
+ * @param {!number} offset
+ * @return {LoadedNumberListResult}
+ */
+Binary.load32bitNumberList$SI = function (buffer, offset) {
+ return new LoadedNumberListResult$SI(buffer, offset);
+};
+
+var Binary$load32bitNumberList$SI = Binary.load32bitNumberList$SI;
+
+/**
+ * @param {Array.<undefined|!number>} array
+ * @param {!number} offset
+ * @return {!number}
+ */
+Binary._countZero$ANI = function (array, offset) {
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var array$len$0;
+ for ((i = offset, array$len$0 = array.length); i < array$len$0; i++) {
+ if (array[i] != 0) {
+ return (i - offset | 0);
+ }
+ }
+ return (array.length - offset | 0);
+};
+
+var Binary$_countZero$ANI = Binary._countZero$ANI;
+
+/**
+ * @param {!number} length
+ * @return {!string}
+ */
+Binary._zeroBlock$I = function (length) {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ result = [ ];
+ while (length > 0) {
+ if (length > 16384) {
+ result.push(Binary$dump16bitNumber$I(16383));
+ length -= 16384;
+ } else {
+ result.push(Binary$dump16bitNumber$I(length - 1));
+ length = 0;
+ }
+ }
+ return result.join('');
+};
+
+var Binary$_zeroBlock$I = Binary._zeroBlock$I;
+
+/**
+ * @param {Array.<undefined|!number>} array
+ * @param {!number} offset
+ * @return {!boolean}
+ */
+Binary._shouldZebraCode$ANI = function (array, offset) {
+ /** @type {!number} */
+ var change;
+ /** @type {!boolean} */
+ var isLastZero;
+ /** @type {!number} */
+ var i;
+ if (array.length - offset < 16) {
+ return true;
+ }
+ change = 0;
+ isLastZero = false;
+ for (i = offset; i < offset + 15; i++) {
+ if (array[i] == 0) {
+ if (! isLastZero) {
+ isLastZero = true;
+ change++;
+ }
+ } else {
+ if (isLastZero) {
+ isLastZero = false;
+ change++;
+ }
+ }
+ }
+ return change > 2;
+};
+
+var Binary$_shouldZebraCode$ANI = Binary._shouldZebraCode$ANI;
+
+/**
+ * @param {Array.<undefined|!number>} array
+ * @param {!number} offset
+ * @return {!number}
+ */
+Binary._searchDoubleZero$ANI = function (array, offset) {
+ /** @type {!boolean} */
+ var isLastZero;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var array$len$0;
+ isLastZero = false;
+ for ((i = offset, array$len$0 = array.length); i < array$len$0; i++) {
+ if (array[i] == 0) {
+ if (isLastZero) {
+ return (i - offset - 1 | 0);
+ }
+ isLastZero = true;
+ } else {
+ isLastZero = false;
+ }
+ }
+ return (array.length - offset | 0);
+};
+
+var Binary$_searchDoubleZero$ANI = Binary._searchDoubleZero$ANI;
+
+/**
+ * @param {Array.<undefined|!number>} array
+ * @param {!number} offset
+ * @param {!number} length
+ * @return {!string}
+ */
+Binary._nonZeroBlock$ANII = function (array, offset, length) {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var blockLength;
+ /** @type {!number} */
+ var i;
+ result = [ ];
+ while (length > 0) {
+ if (length > 16384) {
+ blockLength = 16384;
+ length -= 16384;
+ } else {
+ blockLength = length;
+ length = 0;
+ }
+ result.push(Binary$dump16bitNumber$I(blockLength - 1 + 0x4000));
+ for (i = offset; i < offset + blockLength; i++) {
+ result.push(Binary$dump32bitNumber$N(array[i]));
+ }
+ offset += blockLength;
+ }
+ return result.join('');
+};
+
+var Binary$_nonZeroBlock$ANII = Binary._nonZeroBlock$ANII;
+
+/**
+ * @param {Array.<undefined|!number>} array
+ * @param {!number} offset
+ * @return {!string}
+ */
+Binary._createZebraCode$ANI = function (array, offset) {
+ /** @type {!number} */
+ var last;
+ /** @type {!number} */
+ var code;
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var value1$0;
+ /** @type {!number} */
+ var value2$0;
+ value1$0 = offset + 15;
+ value2$0 = array.length;
+ last = (value1$0 <= value2$0 ? value1$0 : value2$0);
+ code = 0x8000;
+ result = [ ];
+ for (i = offset; i < last; i++) {
+ if (array[i] != 0) {
+ result.push(Binary$dump32bitNumber$N(array[i]));
+ code = code + (0x1 << i - offset);
+ }
+ }
+ return String.fromCharCode(code) + result.join('');
+};
+
+var Binary$_createZebraCode$ANI = Binary._createZebraCode$ANI;
+
+/**
+ * @param {!string} str
+ * @return {!string}
+ */
+Binary.base64encode$S = function (str) {
+ /** @type {Array.<undefined|!string>} */
+ var out;
+ /** @type {Array.<undefined|!number>} */
+ var source;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var code;
+ /** @type {!number} */
+ var len;
+ /** @type {!number} */
+ var c1;
+ /** @type {undefined|!number} */
+ var c2;
+ /** @type {undefined|!number} */
+ var c3;
+ out = [ ];
+ source = [ ];
+ for (i = 0; i < str.length; i++) {
+ code = str.charCodeAt(i);
+ source.push(code & 0x00ff, code >>> 8);
+ }
+ len = str.length * 2;
+ i = 0;
+ while (i < len) {
+ c1 = source[i++] & 0xff;
+ if (i === len) {
+ out.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(c1 >> 2));
+ out.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((c1 & 0x3) << 4));
+ out.push("==");
+ break;
+ }
+ c2 = source[i++];
+ if (i === len) {
+ out.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(c1 >> 2));
+ out.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((c1 & 0x3) << 4 | (c2 & 0xF0) >> 4));
+ out.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((c2 & 0xF) << 2));
+ out.push("=");
+ break;
+ }
+ c3 = source[i++];
+ out.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(c1 >> 2));
+ out.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((c1 & 0x3) << 4 | (c2 & 0xF0) >> 4));
+ out.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((c2 & 0xF) << 2 | (c3 & 0xC0) >> 6));
+ out.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(c3 & 0x3F));
+ }
+ return out.join('');
+};
+
+var Binary$base64encode$S = Binary.base64encode$S;
+
+/**
+ * @param {Array.<undefined|!number>} source
+ * @return {!string}
+ */
+Binary._mergeCharCode$AI = function (source) {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var i;
+ result = [ ];
+ for (i = 0; i < source.length; i += 2) {
+ result.push(String.fromCharCode(source[i] + (source[i + 1] << 8)));
+ }
+ return result.join('');
+};
+
+var Binary$_mergeCharCode$AI = Binary._mergeCharCode$AI;
+
+/**
+ * @param {!string} str
+ * @return {!string}
+ */
+Binary.base64decode$S = function (str) {
+ /** @type {!number} */
+ var len;
+ /** @type {!number} */
+ var i;
+ /** @type {Array.<undefined|!number>} */
+ var out;
+ /** @type {undefined|!number} */
+ var c1;
+ /** @type {undefined|!number} */
+ var c2;
+ /** @type {!number} */
+ var c3;
+ /** @type {!number} */
+ var c4;
+ len = str.length;
+ i = 0;
+ out = [ ];
+ while (i < len) {
+ do {
+ c1 = Binary._base64DecodeChars[str.charCodeAt(i++) & 0xff];
+ } while (i < len && c1 == -1);
+ if (c1 == -1) {
+ break;
+ }
+ do {
+ c2 = Binary._base64DecodeChars[str.charCodeAt(i++) & 0xff];
+ } while (i < len && c2 == -1);
+ if (c2 == -1) {
+ break;
+ }
+ out.push(c1 << 2 | (c2 & 0x30) >> 4);
+ do {
+ c3 = str.charCodeAt(i++) & 0xff;
+ if (c3 === 61) {
+ return Binary$_mergeCharCode$AI(out);
+ }
+ c3 = Binary._base64DecodeChars[c3];
+ } while (i < len && c3 === -1);
+ if (c3 === -1) {
+ break;
+ }
+ out.push((c2 & 0XF) << 4 | (c3 & 0x3C) >> 2);
+ do {
+ c4 = str.charCodeAt(i++) & 0xff;
+ if (c4 === 61) {
+ return Binary$_mergeCharCode$AI(out);
+ }
+ c4 = (Binary._base64DecodeChars[c4] | 0);
+ } while (i < len && c4 === -1);
+ if (c4 === -1) {
+ break;
+ }
+ out.push((c3 & 0x03) << 6 | c4);
+ }
+ return Binary$_mergeCharCode$AI(out);
+};
+
+var Binary$base64decode$S = Binary.base64decode$S;
+
+/**
+ * class LoadedStringResult extends Object
+ * @constructor
+ */
+function LoadedStringResult() {
+}
+
+/**
+ * @constructor
+ * @param {!string} data
+ * @param {!number} offset
+ */
+function LoadedStringResult$SI(data, offset) {
+ /** @type {!number} */
+ var strLength;
+ /** @type {Array.<undefined|!string>} */
+ var bytes;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var code;
+ /** @type {!number} */
+ var offset$0;
+ this.result = "";
+ this.offset = 0;
+ offset$0 = offset++;
+ strLength = data.charCodeAt(offset$0);
+ if (strLength > 32767) {
+ strLength = strLength - 32768;
+ bytes = [ ];
+ for (i = 0; i < strLength; i += 2) {
+ code = data.charCodeAt(offset);
+ bytes.push(String.fromCharCode(code & 0x00ff));
+ if (i !== strLength - 1) {
+ bytes.push(String.fromCharCode(code >>> 8));
+ }
+ offset++;
+ }
+ this.result = bytes.join('');
+ this.offset = offset;
+ } else {
+ this.result = data.slice(offset, offset + strLength);
+ this.offset = (offset + strLength | 0);
+ }
+};
+
+LoadedStringResult$SI.prototype = new LoadedStringResult;
+
+/**
+ * class LoadedStringListResult extends Object
+ * @constructor
+ */
+function LoadedStringListResult() {
+}
+
+/**
+ * @constructor
+ * @param {!string} data
+ * @param {!number} offset
+ */
+function LoadedStringListResult$SI(data, offset) {
+ /** @type {!number} */
+ var length;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var strLength;
+ /** @type {!string} */
+ var resultStr;
+ /** @type {Array.<undefined|!string>} */
+ var bytes;
+ /** @type {!number} */
+ var j;
+ /** @type {!number} */
+ var code;
+ /** @type {!number} */
+ var result$0;
+ /** @type {!number} */
+ var offset$0;
+ this.offset = 0;
+ this.result = [ ];
+ result$0 = data.charCodeAt(offset) * 65536 + data.charCodeAt(offset + 1);
+ length = result$0;
+ offset += 2;
+ for (i = 0; i < length; i++) {
+ offset$0 = offset++;
+ strLength = data.charCodeAt(offset$0);
+ if (strLength > 32767) {
+ strLength = strLength - 32768;
+ bytes = [ ];
+ for (j = 0; j < strLength; j += 2) {
+ code = data.charCodeAt(offset);
+ bytes.push(String.fromCharCode(code & 0x00ff));
+ if (j !== strLength - 1) {
+ bytes.push(String.fromCharCode(code >>> 8));
+ }
+ offset++;
+ }
+ resultStr = bytes.join('');
+ } else {
+ resultStr = data.slice(offset, offset + strLength);
+ offset = (offset + strLength | 0);
+ }
+ this.result.push(resultStr);
+ }
+ this.offset = offset;
+};
+
+LoadedStringListResult$SI.prototype = new LoadedStringListResult;
+
+/**
+ * class LoadedStringListMapResult extends Object
+ * @constructor
+ */
+function LoadedStringListMapResult() {
+}
+
+/**
+ * @constructor
+ * @param {!string} data
+ * @param {!number} offset
+ */
+function LoadedStringListMapResult$SI(data, offset) {
+ /** @type {!number} */
+ var length;
+ /** @type {!number} */
+ var i;
+ /** @type {LoadedStringResult} */
+ var keyResult;
+ /** @type {LoadedStringListResult} */
+ var valueResult;
+ /** @type {!number} */
+ var result$0;
+ /** @type {!number} */
+ var offset$0;
+ this.offset = 0;
+ this.result = ({ });
+ result$0 = data.charCodeAt(offset) * 65536 + data.charCodeAt(offset + 1);
+ length = result$0;
+ offset += 2;
+ for (i = 0; i < length; i++) {
+ keyResult = new LoadedStringResult$SI(data, offset);
+ offset$0 = keyResult.offset;
+ valueResult = new LoadedStringListResult$SI(data, offset$0);
+ this.result[keyResult.result] = valueResult.result;
+ offset = valueResult.offset;
+ }
+ this.offset = offset;
+};
+
+LoadedStringListMapResult$SI.prototype = new LoadedStringListMapResult;
+
+/**
+ * class LoadedNumberListResult extends Object
+ * @constructor
+ */
+function LoadedNumberListResult() {
+}
+
+/**
+ * @constructor
+ * @param {!string} data
+ * @param {!number} offset
+ */
+function LoadedNumberListResult$SI(data, offset) {
+ /** @type {!number} */
+ var resultLength;
+ /** @type {!number} */
+ var originalOffset;
+ /** @type {Array.<undefined|!number>} */
+ var result;
+ /** @type {!number} */
+ var tag;
+ /** @type {!number} */
+ var length;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var result$0;
+ /** @type {!number} */
+ var value1$0;
+ this.result = null;
+ this.offset = 0;
+ result$0 = data.charCodeAt(offset) * 65536 + data.charCodeAt(offset + 1);
+ resultLength = result$0;
+ originalOffset = offset;
+ offset += 2;
+ result = [ ];
+ while (result.length < resultLength) {
+ tag = data.charCodeAt(offset++);
+ if (tag >>> 15 === 1) {
+ value1$0 = resultLength - result.length;
+ length = (value1$0 <= 15 ? value1$0 : 15);
+ for (i = 0; i < length; i++) {
+ if (tag >>> i & 0x1) {
+ result.push(Binary$load32bitNumber$SI(data, offset));
+ offset += 2;
+ } else {
+ result.push(0);
+ }
+ }
+ } else {
+ if (tag >>> 14 === 1) {
+ length = tag - 0x4000 + 1;
+ for (i = 0; i < length; i++) {
+ result.push(Binary$load32bitNumber$SI(data, offset));
+ offset += 2;
+ }
+ } else {
+ length = tag + 1;
+ for (i = 0; i < length; i++) {
+ result.push(0);
+ }
+ }
+ }
+ }
+ this.result = result;
+ this.offset = offset;
+};
+
+LoadedNumberListResult$SI.prototype = new LoadedNumberListResult;
+
+/**
+ * class CompressionReport extends Object
+ * @constructor
+ */
+function CompressionReport() {
+}
+
+/**
+ * @constructor
+ */
+function CompressionReport$() {
+ this.source = 0;
+ this.result = 0;
+};
+
+CompressionReport$.prototype = new CompressionReport;
+
+/**
+ * @param {CompressionReport} $this
+ * @param {!number} source
+ * @param {!number} result
+ */
+CompressionReport.add$LCompressionReport$II = function ($this, source, result) {
+ $this.source += source;
+ $this.result += result;
+};
+
+var CompressionReport$add$LCompressionReport$II = CompressionReport.add$LCompressionReport$II;
+
+/**
+ * @param {CompressionReport} $this
+ * @return {!number}
+ */
+CompressionReport.rate$LCompressionReport$ = function ($this) {
+ return (Math.round($this.result * 100.0 / $this.source) | 0);
+};
+
+var CompressionReport$rate$LCompressionReport$ = CompressionReport.rate$LCompressionReport$;
+
+/**
+ * class Query extends Object
+ * @constructor
+ */
+function Query() {
+}
+
+/**
+ * @constructor
+ */
+function Query$() {
+ this.word = '';
+ this.or = false;
+ this.not = false;
+ this.raw = false;
+};
+
+Query$.prototype = new Query;
+
+/**
+ * @return {!string}
+ */
+Query.prototype.toString = function () {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ result = [ ];
+ if (this.or) {
+ result.push("OR ");
+ }
+ if (this.not) {
+ result.push("-");
+ }
+ if (this.raw) {
+ result.push('"', this.word, '"');
+ } else {
+ result.push(this.word);
+ }
+ return result.join('');
+};
+
+/**
+ * class QueryStringParser extends Object
+ * @constructor
+ */
+function QueryStringParser() {
+}
+
+/**
+ * @constructor
+ */
+function QueryStringParser$() {
+ this.queries = [ ];
+};
+
+QueryStringParser$.prototype = new QueryStringParser;
+
+/**
+ * @param {QueryStringParser} $this
+ * @param {!string} queryString
+ * @return {Array.<undefined|Query>}
+ */
+QueryStringParser.parse$LQueryStringParser$S = function ($this, queryString) {
+ /** @type {!boolean} */
+ var nextOr;
+ /** @type {!boolean} */
+ var nextNot;
+ /** @type {!number} */
+ var currentWordStart;
+ /** @type {!number} */
+ var status;
+ /** @type {RegExp} */
+ var isSpace;
+ /** @type {!number} */
+ var i;
+ /** @type {!string} */
+ var ch;
+ /** @type {!string} */
+ var word;
+ /** @type {Query} */
+ var query;
+ nextOr = false;
+ nextNot = false;
+ currentWordStart = 0;
+ status = 0;
+ isSpace = /[\s\u3000]/;
+ for (i = 0; i < queryString.length; i++) {
+ ch = queryString.charAt(i);
+ switch (status) {
+ case 0:
+ if (! isSpace.test(ch)) {
+ if (ch === '-') {
+ nextNot = true;
+ } else {
+ if (ch === '"') {
+ currentWordStart = i + 1;
+ status = 2;
+ } else {
+ currentWordStart = i;
+ status = 1;
+ }
+ }
+ } else {
+ nextNot = false;
+ }
+ break;
+ case 1:
+ if (isSpace.test(ch)) {
+ word = queryString.slice(currentWordStart, i);
+ if (word === 'OR') {
+ nextOr = true;
+ } else {
+ query = new Query$();
+ query.word = word;
+ query.or = nextOr;
+ query.not = nextNot;
+ $this.queries.push(query);
+ nextOr = false;
+ nextNot = false;
+ }
+ status = 0;
+ }
+ break;
+ case 2:
+ if (ch === '"') {
+ word = queryString.slice(currentWordStart, i);
+ query = new Query$();
+ query.word = word;
+ query.or = nextOr;
+ query.not = nextNot;
+ query.raw = true;
+ $this.queries.push(query);
+ nextOr = false;
+ nextNot = false;
+ status = 0;
+ }
+ break;
+ }
+ }
+ switch (status) {
+ case 0:
+ break;
+ case 1:
+ query = new Query$();
+ word = queryString.slice(currentWordStart, queryString.length);
+ if (word !== 'OR') {
+ query.word = word;
+ query.or = nextOr;
+ query.not = nextNot;
+ $this.queries.push(query);
+ }
+ break;
+ case 2:
+ query = new Query$();
+ query.word = queryString.slice(currentWordStart, queryString.length);
+ query.or = nextOr;
+ query.not = nextNot;
+ query.raw = true;
+ $this.queries.push(query);
+ break;
+ }
+ return $this.queries;
+};
+
+var QueryStringParser$parse$LQueryStringParser$S = QueryStringParser.parse$LQueryStringParser$S;
+
+/**
+ * @param {QueryStringParser} $this
+ * @return {!string}
+ */
+QueryStringParser.highlight$LQueryStringParser$ = function ($this) {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var i;
+ /** @type {Query} */
+ var query;
+ result = [ ];
+ for (i = 0; i < $this.queries.length; i++) {
+ query = $this.queries[i];
+ if (! query.not) {
+ result.push("highlight=" + $__jsx_encodeURIComponent(query.word));
+ }
+ }
+ return '?' + result.join('&');
+};
+
+var QueryStringParser$highlight$LQueryStringParser$ = QueryStringParser.highlight$LQueryStringParser$;
+
+/**
+ * class Proposal extends Object
+ * @constructor
+ */
+function Proposal() {
+}
+
+/**
+ * @constructor
+ * @param {!number} omit
+ * @param {!number} expect
+ */
+function Proposal$II(omit, expect) {
+ this.omit = omit;
+ this.expect = expect;
+};
+
+Proposal$II.prototype = new Proposal;
+
+/**
+ * class Position extends Object
+ * @constructor
+ */
+function Position() {
+}
+
+/**
+ * @constructor
+ * @param {!string} word
+ * @param {!number} position
+ * @param {!boolean} stemmed
+ */
+function Position$SIB(word, position, stemmed) {
+ this.word = word;
+ this.position = position;
+ this.stemmed = stemmed;
+};
+
+Position$SIB.prototype = new Position;
+
+/**
+ * class SearchUnit extends Object
+ * @constructor
+ */
+function SearchUnit() {
+}
+
+/**
+ * @constructor
+ * @param {!number} id
+ */
+function SearchUnit$I(id) {
+ this.positions = ({ });
+ this.id = id;
+ this._size = 0;
+ this.score = 0;
+ this.startPosition = -1;
+};
+
+SearchUnit$I.prototype = new SearchUnit;
+
+/**
+ * @param {SearchUnit} $this
+ * @param {!string} word
+ * @param {!number} position
+ * @param {!boolean} stemmed
+ */
+SearchUnit.addPosition$LSearchUnit$SIB = function ($this, word, position, stemmed) {
+ /** @type {Position} */
+ var positionObj;
+ positionObj = $this.positions[position + ""];
+ if (! positionObj) {
+ $this._size++;
+ $this.positions[position + ""] = ({word: word, position: position, stemmed: stemmed});
+ } else {
+ if (positionObj.word.length < word.length) {
+ positionObj.word = word;
+ }
+ positionObj.stemmed = positionObj.stemmed && stemmed;
+ }
+};
+
+var SearchUnit$addPosition$LSearchUnit$SIB = SearchUnit.addPosition$LSearchUnit$SIB;
+
+/**
+ * @param {SearchUnit} $this
+ * @param {!number} position
+ * @return {Position}
+ */
+SearchUnit.get$LSearchUnit$I = function ($this, position) {
+ return $this.positions[position + ""];
+};
+
+var SearchUnit$get$LSearchUnit$I = SearchUnit.get$LSearchUnit$I;
+
+/**
+ * @param {SearchUnit} $this
+ * @return {!number}
+ */
+SearchUnit.size$LSearchUnit$ = function ($this) {
+ return $this._size;
+};
+
+var SearchUnit$size$LSearchUnit$ = SearchUnit.size$LSearchUnit$;
+
+/**
+ * @param {SearchUnit} $this
+ * @param {SearchUnit} rhs
+ */
+SearchUnit.merge$LSearchUnit$LSearchUnit$ = function ($this, rhs) {
+ /** @type {!string} */
+ var position;
+ /** @type {Position} */
+ var pos;
+ for (position in rhs.positions) {
+ pos = rhs.positions[position];
+ SearchUnit$addPosition$LSearchUnit$SIB($this, pos.word, pos.position, pos.stemmed);
+ }
+};
+
+var SearchUnit$merge$LSearchUnit$LSearchUnit$ = SearchUnit.merge$LSearchUnit$LSearchUnit$;
+
+/**
+ * @param {SearchUnit} $this
+ * @return {Array.<undefined|Position>}
+ */
+SearchUnit.getPositions$LSearchUnit$ = function ($this) {
+ /** @type {Array.<undefined|Position>} */
+ var result;
+ /** @type {!string} */
+ var pos;
+ result = [ ];
+ for (pos in $this.positions) {
+ result.push($this.positions[pos]);
+ }
+ result.sort((function (a, b) {
+ return a.position - b.position;
+ }));
+ return result;
+};
+
+var SearchUnit$getPositions$LSearchUnit$ = SearchUnit.getPositions$LSearchUnit$;
+
+/**
+ * class SingleResult extends Object
+ * @constructor
+ */
+function SingleResult() {
+}
+
+/**
+ * @constructor
+ */
+function SingleResult$() {
+ this.units = [ ];
+ this.unitIds = [ ];
+ this.or = false;
+ this.not = false;
+ this.searchWord = '';
+};
+
+SingleResult$.prototype = new SingleResult;
+
+/**
+ * @constructor
+ * @param {!string} searchWord
+ * @param {!boolean} or
+ * @param {!boolean} not
+ */
+function SingleResult$SBB(searchWord, or, not) {
+ this.units = [ ];
+ this.unitIds = [ ];
+ this.or = or;
+ this.not = not;
+ this.searchWord = searchWord;
+};
+
+SingleResult$SBB.prototype = new SingleResult;
+
+/**
+ * @param {SingleResult} $this
+ * @param {!number} unitId
+ * @return {SearchUnit}
+ */
+SingleResult.getSearchUnit$LSingleResult$I = function ($this, unitId) {
+ /** @type {!number} */
+ var existing;
+ /** @type {SearchUnit} */
+ var result;
+ existing = $this.unitIds.indexOf(unitId);
+ if (existing === -1) {
+ result = ({positions: ({ }), id: unitId, _size: 0, score: 0, startPosition: -1});
+ $this.units.push(result);
+ $this.unitIds.push(unitId);
+ } else {
+ result = $this.units[existing];
+ }
+ return result;
+};
+
+var SingleResult$getSearchUnit$LSingleResult$I = SingleResult.getSearchUnit$LSingleResult$I;
+
+/**
+ * @param {SingleResult} $this
+ * @param {SingleResult} rhs
+ * @return {SingleResult}
+ */
+SingleResult.merge$LSingleResult$LSingleResult$ = function ($this, rhs) {
+ /** @type {SingleResult} */
+ var result;
+ result = ({units: [ ], unitIds: [ ], or: false, not: false, searchWord: ''});
+ if (rhs.or) {
+ SingleResult$_orMerge$LSingleResult$LSingleResult$LSingleResult$($this, result, rhs);
+ } else {
+ if (rhs.not) {
+ SingleResult$_notMerge$LSingleResult$LSingleResult$LSingleResult$($this, result, rhs);
+ } else {
+ SingleResult$_andMerge$LSingleResult$LSingleResult$LSingleResult$($this, result, rhs);
+ }
+ }
+ return result;
+};
+
+var SingleResult$merge$LSingleResult$LSingleResult$ = SingleResult.merge$LSingleResult$LSingleResult$;
+
+/**
+ * @param {SingleResult} $this
+ * @return {!number}
+ */
+SingleResult.size$LSingleResult$ = function ($this) {
+ return ($this.units.length | 0);
+};
+
+var SingleResult$size$LSingleResult$ = SingleResult.size$LSingleResult$;
+
+/**
+ * @param {SingleResult} $this
+ * @param {SingleResult} result
+ * @param {SingleResult} rhs
+ */
+SingleResult._andMerge$LSingleResult$LSingleResult$LSingleResult$ = function ($this, result, rhs) {
+ /** @type {!number} */
+ var i;
+ /** @type {undefined|!number} */
+ var id;
+ /** @type {SearchUnit} */
+ var lhsSection;
+ for (i = 0; i < $this.unitIds.length; i++) {
+ id = $this.unitIds[i];
+ if (rhs.unitIds.indexOf(id) !== -1) {
+ lhsSection = $this.units[i];
+ result.unitIds.push(id);
+ result.units.push(lhsSection);
+ }
+ }
+};
+
+var SingleResult$_andMerge$LSingleResult$LSingleResult$LSingleResult$ = SingleResult._andMerge$LSingleResult$LSingleResult$LSingleResult$;
+
+/**
+ * @param {SingleResult} $this
+ * @param {SingleResult} result
+ * @param {SingleResult} rhs
+ */
+SingleResult._orMerge$LSingleResult$LSingleResult$LSingleResult$ = function ($this, result, rhs) {
+ /** @type {!number} */
+ var i;
+ /** @type {undefined|!number} */
+ var id;
+ /** @type {SearchUnit} */
+ var rhsSection;
+ /** @type {SearchUnit} */
+ var lhsSection;
+ /** @type {Array.<undefined|!number>} */
+ var unitIds$0;
+ /** @type {Array.<undefined|SearchUnit>} */
+ var units$0;
+ result.unitIds = (unitIds$0 = $this.unitIds).slice(0, unitIds$0.length);
+ result.units = (units$0 = $this.units).slice(0, units$0.length);
+ for (i = 0; i < rhs.unitIds.length; i++) {
+ id = rhs.unitIds[i];
+ rhsSection = rhs.units[i];
+ if (result.unitIds.indexOf(id) !== -1) {
+ lhsSection = result.units[result.unitIds.indexOf(id)];
+ SearchUnit$merge$LSearchUnit$LSearchUnit$(lhsSection, rhsSection);
+ } else {
+ result.unitIds.push(id);
+ result.units.push(rhsSection);
+ }
+ }
+};
+
+var SingleResult$_orMerge$LSingleResult$LSingleResult$LSingleResult$ = SingleResult._orMerge$LSingleResult$LSingleResult$LSingleResult$;
+
+/**
+ * @param {SingleResult} $this
+ * @param {SingleResult} result
+ * @param {SingleResult} rhs
+ */
+SingleResult._notMerge$LSingleResult$LSingleResult$LSingleResult$ = function ($this, result, rhs) {
+ /** @type {!number} */
+ var i;
+ /** @type {undefined|!number} */
+ var id;
+ /** @type {SearchUnit} */
+ var lhsSection;
+ for (i = 0; i < $this.unitIds.length; i++) {
+ id = $this.unitIds[i];
+ if (rhs.unitIds.indexOf(id) === -1) {
+ lhsSection = $this.units[i];
+ result.unitIds.push(id);
+ result.units.push(lhsSection);
+ }
+ }
+};
+
+var SingleResult$_notMerge$LSingleResult$LSingleResult$LSingleResult$ = SingleResult._notMerge$LSingleResult$LSingleResult$LSingleResult$;
+
+/**
+ * class SearchSummary extends Object
+ * @constructor
+ */
+function SearchSummary() {
+}
+
+/**
+ * @constructor
+ */
+function SearchSummary$() {
+ this.sourceResults = [ ];
+ this.result = null;
+ this.oktavia = null;
+};
+
+SearchSummary$.prototype = new SearchSummary;
+
+/**
+ * @constructor
+ * @param {Oktavia} oktavia
+ */
+function SearchSummary$LOktavia$(oktavia) {
+ this.sourceResults = [ ];
+ this.result = null;
+ this.oktavia = oktavia;
+};
+
+SearchSummary$LOktavia$.prototype = new SearchSummary;
+
+/**
+ * @param {SearchSummary} $this
+ * @param {SingleResult} result
+ */
+SearchSummary.addQuery$LSearchSummary$LSingleResult$ = function ($this, result) {
+ $this.sourceResults.push(result);
+};
+
+var SearchSummary$addQuery$LSearchSummary$LSingleResult$ = SearchSummary.addQuery$LSearchSummary$LSingleResult$;
+
+/**
+ * @param {SearchSummary} $this
+ */
+SearchSummary.mergeResult$LSearchSummary$ = function ($this) {
+ $this.result = SearchSummary$mergeResult$LSearchSummary$ALSingleResult$($this, $this.sourceResults);
+};
+
+var SearchSummary$mergeResult$LSearchSummary$ = SearchSummary.mergeResult$LSearchSummary$;
+
+/**
+ * @param {SearchSummary} $this
+ * @param {Array.<undefined|SingleResult>} results
+ * @return {SingleResult}
+ */
+SearchSummary.mergeResult$LSearchSummary$ALSingleResult$ = function ($this, results) {
+ /** @type {SingleResult} */
+ var rhs;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var results$len$0;
+ rhs = results[0];
+ for ((i = 1, results$len$0 = results.length); i < results$len$0; i++) {
+ rhs = SingleResult$merge$LSingleResult$LSingleResult$(rhs, results[i]);
+ }
+ return rhs;
+};
+
+var SearchSummary$mergeResult$LSearchSummary$ALSingleResult$ = SearchSummary.mergeResult$LSearchSummary$ALSingleResult$;
+
+/**
+ * @param {SearchSummary} $this
+ * @return {Array.<undefined|Proposal>}
+ */
+SearchSummary.getProposal$LSearchSummary$ = function ($this) {
+ /** @type {Array.<undefined|Proposal>} */
+ var proposals;
+ /** @type {!number} */
+ var i;
+ /** @type {Array.<undefined|SingleResult>} */
+ var tmpSource;
+ /** @type {!number} */
+ var j;
+ /** @type {SingleResult} */
+ var result;
+ proposals = [ ];
+ for (i = 0; i < $this.sourceResults.length; i++) {
+ tmpSource = [ ];
+ for (j = 0; j < $this.sourceResults.length; j++) {
+ if (i !== j) {
+ tmpSource.push($this.sourceResults[j]);
+ }
+ }
+ result = SearchSummary$mergeResult$LSearchSummary$ALSingleResult$($this, tmpSource);
+ proposals.push(({omit: i, expect: result.units.length}));
+ }
+ proposals.sort((function (a, b) {
+ return b.expect - a.expect;
+ }));
+ return proposals;
+};
+
+var SearchSummary$getProposal$LSearchSummary$ = SearchSummary.getProposal$LSearchSummary$;
+
+/**
+ * @param {SearchSummary} $this
+ * @return {Array.<undefined|SearchUnit>}
+ */
+SearchSummary.getSortedResult$LSearchSummary$ = function ($this) {
+ /** @type {Array.<undefined|SearchUnit>} */
+ var result;
+ /** @type {Array.<undefined|SearchUnit>} */
+ var units$0;
+ result = (units$0 = $this.result.units).slice(0, units$0.length);
+ result.sort((function (a, b) {
+ return b.score - a.score;
+ }));
+ return result;
+};
+
+var SearchSummary$getSortedResult$LSearchSummary$ = SearchSummary.getSortedResult$LSearchSummary$;
+
+/**
+ * @param {SearchSummary} $this
+ * @return {!number}
+ */
+SearchSummary.size$LSearchSummary$ = function ($this) {
+ /** @type {SingleResult} */
+ var this$0;
+ this$0 = $this.result;
+ return (this$0.units.length | 0);
+};
+
+var SearchSummary$size$LSearchSummary$ = SearchSummary.size$LSearchSummary$;
+
+/**
+ * @param {SearchSummary} $this
+ * @param {SingleResult} result
+ */
+SearchSummary.add$LSearchSummary$LSingleResult$ = function ($this, result) {
+ $this.sourceResults.push(result);
+};
+
+var SearchSummary$add$LSearchSummary$LSingleResult$ = SearchSummary.add$LSearchSummary$LSingleResult$;
+
+/**
+ * class Style extends Object
+ * @constructor
+ */
+function Style() {
+}
+
+/**
+ * @constructor
+ * @param {!string} mode
+ */
+function Style$S(mode) {
+ this.styles = null;
+ this.escapeHTML = false;
+ switch (mode) {
+ case 'console':
+ this.styles = Style.console;
+ break;
+ case 'html':
+ this.styles = Style.html;
+ break;
+ case 'ignore':
+ this.styles = Style.ignore;
+ break;
+ default:
+ this.styles = Style.ignore;
+ break;
+ }
+ this.escapeHTML = mode === 'html';
+};
+
+Style$S.prototype = new Style;
+
+/**
+ * @param {!string} source
+ * @return {!string}
+ */
+Style.prototype.convert$S = function (source) {
+ /** @type {_HTMLHandler} */
+ var handler;
+ /** @type {SAXParser} */
+ var parser;
+ handler = new _HTMLHandler$HASB(this.styles, this.escapeHTML);
+ parser = new SAXParser$LSAXHandler$(handler);
+ parser.parse$S(source);
+ return handler.text.join('');
+};
+
+/**
+ * class Stemmer
+ * @constructor
+ */
+function Stemmer() {
+}
+
+Stemmer.prototype.$__jsx_implements_Stemmer = true;
+
+/**
+ * @constructor
+ */
+function Stemmer$() {
+};
+
+Stemmer$.prototype = new Stemmer;
+
+/**
+ * class BaseStemmer extends Object
+ * @constructor
+ */
+function BaseStemmer() {
+}
+
+$__jsx_merge_interface(BaseStemmer, Stemmer);
+
+/**
+ * @constructor
+ */
+function BaseStemmer$() {
+ /** @type {!string} */
+ var current$0;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var limit$0;
+ this.cache = ({ });
+ current$0 = this.current = "";
+ cursor$0 = this.cursor = 0;
+ limit$0 = this.limit = current$0.length;
+ this.limit_backward = 0;
+ this.bra = cursor$0;
+ this.ket = limit$0;
+};
+
+BaseStemmer$.prototype = new BaseStemmer;
+
+/**
+ * @param {!string} value
+ */
+BaseStemmer.prototype.setCurrent$S = function (value) {
+ /** @type {!string} */
+ var current$0;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var limit$0;
+ current$0 = this.current = value;
+ cursor$0 = this.cursor = 0;
+ limit$0 = this.limit = current$0.length;
+ this.limit_backward = 0;
+ this.bra = cursor$0;
+ this.ket = limit$0;
+};
+
+/**
+ * @return {!string}
+ */
+BaseStemmer.prototype.getCurrent$ = function () {
+ return this.current;
+};
+
+/**
+ * @param {BaseStemmer} other
+ */
+BaseStemmer.prototype.copy_from$LBaseStemmer$ = function (other) {
+ this.current = other.current;
+ this.cursor = other.cursor;
+ this.limit = other.limit;
+ this.limit_backward = other.limit_backward;
+ this.bra = other.bra;
+ this.ket = other.ket;
+};
+
+/**
+ * @param {Array.<undefined|!number>} s
+ * @param {!number} min
+ * @param {!number} max
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.in_grouping$AIII = function (s, min, max) {
+ /** @type {!number} */
+ var ch;
+ if (this.cursor >= this.limit) {
+ return false;
+ }
+ ch = this.current.charCodeAt(this.cursor);
+ if (ch > max || ch < min) {
+ return false;
+ }
+ ch -= min;
+ if ((s[ch >>> 3] & 0x1 << (ch & 0x7)) === 0) {
+ return false;
+ }
+ this.cursor++;
+ return true;
+};
+
+/**
+ * @param {Array.<undefined|!number>} s
+ * @param {!number} min
+ * @param {!number} max
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.in_grouping_b$AIII = function (s, min, max) {
+ /** @type {!number} */
+ var ch;
+ if (this.cursor <= this.limit_backward) {
+ return false;
+ }
+ ch = this.current.charCodeAt(this.cursor - 1);
+ if (ch > max || ch < min) {
+ return false;
+ }
+ ch -= min;
+ if ((s[ch >>> 3] & 0x1 << (ch & 0x7)) === 0) {
+ return false;
+ }
+ this.cursor--;
+ return true;
+};
+
+/**
+ * @param {Array.<undefined|!number>} s
+ * @param {!number} min
+ * @param {!number} max
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.out_grouping$AIII = function (s, min, max) {
+ /** @type {!number} */
+ var ch;
+ if (this.cursor >= this.limit) {
+ return false;
+ }
+ ch = this.current.charCodeAt(this.cursor);
+ if (ch > max || ch < min) {
+ this.cursor++;
+ return true;
+ }
+ ch -= min;
+ if ((s[ch >>> 3] & 0X1 << (ch & 0x7)) === 0) {
+ this.cursor++;
+ return true;
+ }
+ return false;
+};
+
+/**
+ * @param {Array.<undefined|!number>} s
+ * @param {!number} min
+ * @param {!number} max
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.out_grouping_b$AIII = function (s, min, max) {
+ /** @type {!number} */
+ var ch;
+ if (this.cursor <= this.limit_backward) {
+ return false;
+ }
+ ch = this.current.charCodeAt(this.cursor - 1);
+ if (ch > max || ch < min) {
+ this.cursor--;
+ return true;
+ }
+ ch -= min;
+ if ((s[ch >>> 3] & 0x1 << (ch & 0x7)) === 0) {
+ this.cursor--;
+ return true;
+ }
+ return false;
+};
+
+/**
+ * @param {!number} min
+ * @param {!number} max
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.in_range$II = function (min, max) {
+ /** @type {!number} */
+ var ch;
+ if (this.cursor >= this.limit) {
+ return false;
+ }
+ ch = this.current.charCodeAt(this.cursor);
+ if (ch > max || ch < min) {
+ return false;
+ }
+ this.cursor++;
+ return true;
+};
+
+/**
+ * @param {!number} min
+ * @param {!number} max
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.in_range_b$II = function (min, max) {
+ /** @type {!number} */
+ var ch;
+ if (this.cursor <= this.limit_backward) {
+ return false;
+ }
+ ch = this.current.charCodeAt(this.cursor - 1);
+ if (ch > max || ch < min) {
+ return false;
+ }
+ this.cursor--;
+ return true;
+};
+
+/**
+ * @param {!number} min
+ * @param {!number} max
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.out_range$II = function (min, max) {
+ /** @type {!number} */
+ var ch;
+ if (this.cursor >= this.limit) {
+ return false;
+ }
+ ch = this.current.charCodeAt(this.cursor);
+ if (! (ch > max || ch < min)) {
+ return false;
+ }
+ this.cursor++;
+ return true;
+};
+
+/**
+ * @param {!number} min
+ * @param {!number} max
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.out_range_b$II = function (min, max) {
+ /** @type {!number} */
+ var ch;
+ if (this.cursor <= this.limit_backward) {
+ return false;
+ }
+ ch = this.current.charCodeAt(this.cursor - 1);
+ if (! (ch > max || ch < min)) {
+ return false;
+ }
+ this.cursor--;
+ return true;
+};
+
+/**
+ * @param {!number} s_size
+ * @param {!string} s
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.eq_s$IS = function (s_size, s) {
+ /** @type {!number} */
+ var cursor$0;
+ if (this.limit - this.cursor < s_size) {
+ return false;
+ }
+ if (this.current.slice(cursor$0 = this.cursor, cursor$0 + s_size) !== s) {
+ return false;
+ }
+ this.cursor += s_size;
+ return true;
+};
+
+/**
+ * @param {!number} s_size
+ * @param {!string} s
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.eq_s_b$IS = function (s_size, s) {
+ /** @type {!number} */
+ var cursor$0;
+ if (this.cursor - this.limit_backward < s_size) {
+ return false;
+ }
+ if (this.current.slice((cursor$0 = this.cursor) - s_size, cursor$0) !== s) {
+ return false;
+ }
+ this.cursor -= s_size;
+ return true;
+};
+
+/**
+ * @param {!string} s
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.eq_v$S = function (s) {
+ return this.eq_s$IS(s.length, s);
+};
+
+/**
+ * @param {!string} s
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.eq_v_b$S = function (s) {
+ return this.eq_s_b$IS(s.length, s);
+};
+
+/**
+ * @param {Array.<undefined|Among>} v
+ * @param {!number} v_size
+ * @return {!number}
+ */
+BaseStemmer.prototype.find_among$ALAmong$I = function (v, v_size) {
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var j;
+ /** @type {!number} */
+ var c;
+ /** @type {!number} */
+ var l;
+ /** @type {!number} */
+ var common_i;
+ /** @type {!number} */
+ var common_j;
+ /** @type {!boolean} */
+ var first_key_inspected;
+ /** @type {!number} */
+ var k;
+ /** @type {!number} */
+ var diff;
+ /** @type {!number} */
+ var common;
+ /** @type {Among} */
+ var w;
+ /** @type {!number} */
+ var i2;
+ /** @type {!boolean} */
+ var res;
+ i = 0;
+ j = v_size;
+ c = this.cursor;
+ l = this.limit;
+ common_i = 0;
+ common_j = 0;
+ first_key_inspected = false;
+ while (true) {
+ k = i + (j - i >>> 1);
+ diff = 0;
+ common = (common_i < common_j ? common_i : common_j);
+ w = v[k];
+ for (i2 = common; i2 < w.s_size; i2++) {
+ if (c + common === l) {
+ diff = -1;
+ break;
+ }
+ diff = this.current.charCodeAt(c + common) - w.s.charCodeAt(i2);
+ if (diff !== 0) {
+ break;
+ }
+ common++;
+ }
+ if (diff < 0) {
+ j = k;
+ common_j = common;
+ } else {
+ i = k;
+ common_i = common;
+ }
+ if (j - i <= 1) {
+ if (i > 0) {
+ break;
+ }
+ if (j === i) {
+ break;
+ }
+ if (first_key_inspected) {
+ break;
+ }
+ first_key_inspected = true;
+ }
+ }
+ while (true) {
+ w = v[i];
+ if (common_i >= w.s_size) {
+ this.cursor = (c + w.s_size | 0);
+ if (w.method == null) {
+ return w.result;
+ }
+ res = w.method(w.instance);
+ this.cursor = (c + w.s_size | 0);
+ if (res) {
+ return w.result;
+ }
+ }
+ i = w.substring_i;
+ if (i < 0) {
+ return 0;
+ }
+ }
+ return -1;
+};
+
+/**
+ * @param {Array.<undefined|Among>} v
+ * @param {!number} v_size
+ * @return {!number}
+ */
+BaseStemmer.prototype.find_among_b$ALAmong$I = function (v, v_size) {
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var j;
+ /** @type {!number} */
+ var c;
+ /** @type {!number} */
+ var lb;
+ /** @type {!number} */
+ var common_i;
+ /** @type {!number} */
+ var common_j;
+ /** @type {!boolean} */
+ var first_key_inspected;
+ /** @type {!number} */
+ var k;
+ /** @type {!number} */
+ var diff;
+ /** @type {!number} */
+ var common;
+ /** @type {Among} */
+ var w;
+ /** @type {!number} */
+ var i2;
+ /** @type {!boolean} */
+ var res;
+ i = 0;
+ j = v_size;
+ c = this.cursor;
+ lb = this.limit_backward;
+ common_i = 0;
+ common_j = 0;
+ first_key_inspected = false;
+ while (true) {
+ k = i + (j - i >> 1);
+ diff = 0;
+ common = (common_i < common_j ? common_i : common_j);
+ w = v[k];
+ for (i2 = w.s_size - 1 - common; i2 >= 0; i2--) {
+ if (c - common === lb) {
+ diff = -1;
+ break;
+ }
+ diff = this.current.charCodeAt(c - 1 - common) - w.s.charCodeAt(i2);
+ if (diff !== 0) {
+ break;
+ }
+ common++;
+ }
+ if (diff < 0) {
+ j = k;
+ common_j = common;
+ } else {
+ i = k;
+ common_i = common;
+ }
+ if (j - i <= 1) {
+ if (i > 0) {
+ break;
+ }
+ if (j === i) {
+ break;
+ }
+ if (first_key_inspected) {
+ break;
+ }
+ first_key_inspected = true;
+ }
+ }
+ while (true) {
+ w = v[i];
+ if (common_i >= w.s_size) {
+ this.cursor = (c - w.s_size | 0);
+ if (w.method == null) {
+ return w.result;
+ }
+ res = w.method(this);
+ this.cursor = (c - w.s_size | 0);
+ if (res) {
+ return w.result;
+ }
+ }
+ i = w.substring_i;
+ if (i < 0) {
+ return 0;
+ }
+ }
+ return -1;
+};
+
+/**
+ * @param {!number} c_bra
+ * @param {!number} c_ket
+ * @param {!string} s
+ * @return {!number}
+ */
+BaseStemmer.prototype.replace_s$IIS = function (c_bra, c_ket, s) {
+ /** @type {!number} */
+ var adjustment;
+ adjustment = s.length - (c_ket - c_bra);
+ this.current = this.current.slice(0, c_bra) + s + this.current.slice(c_ket);
+ this.limit += (adjustment | 0);
+ if (this.cursor >= c_ket) {
+ this.cursor += (adjustment | 0);
+ } else {
+ if (this.cursor > c_bra) {
+ this.cursor = c_bra;
+ }
+ }
+ return (adjustment | 0);
+};
+
+/**
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.slice_check$ = function () {
+ /** @type {!number} */
+ var bra$0;
+ /** @type {!number} */
+ var ket$0;
+ /** @type {!number} */
+ var limit$0;
+ return ((bra$0 = this.bra) < 0 || bra$0 > (ket$0 = this.ket) || ket$0 > (limit$0 = this.limit) || limit$0 > this.current.length ? false : true);
+};
+
+/**
+ * @param {!string} s
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.slice_from$S = function (s) {
+ /** @type {!boolean} */
+ var result;
+ /** @type {!number} */
+ var bra$0;
+ /** @type {!number} */
+ var ket$0;
+ /** @type {!number} */
+ var limit$0;
+ result = false;
+ if ((bra$0 = this.bra) < 0 || bra$0 > (ket$0 = this.ket) || ket$0 > (limit$0 = this.limit) || limit$0 > this.current.length ? false : true) {
+ this.replace_s$IIS(this.bra, this.ket, s);
+ result = true;
+ }
+ return result;
+};
+
+/**
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.slice_del$ = function () {
+ return this.slice_from$S("");
+};
+
+/**
+ * @param {!number} c_bra
+ * @param {!number} c_ket
+ * @param {!string} s
+ */
+BaseStemmer.prototype.insert$IIS = function (c_bra, c_ket, s) {
+ /** @type {!number} */
+ var adjustment;
+ adjustment = this.replace_s$IIS(c_bra, c_ket, s);
+ if (c_bra <= this.bra) {
+ this.bra += (adjustment | 0);
+ }
+ if (c_bra <= this.ket) {
+ this.ket += (adjustment | 0);
+ }
+};
+
+/**
+ * @param {!string} s
+ * @return {!string}
+ */
+BaseStemmer.prototype.slice_to$S = function (s) {
+ /** @type {!string} */
+ var result;
+ /** @type {!number} */
+ var bra$0;
+ /** @type {!number} */
+ var ket$0;
+ /** @type {!number} */
+ var limit$0;
+ result = '';
+ if ((bra$0 = this.bra) < 0 || bra$0 > (ket$0 = this.ket) || ket$0 > (limit$0 = this.limit) || limit$0 > this.current.length ? false : true) {
+ result = this.current.slice(this.bra, this.ket);
+ }
+ return result;
+};
+
+/**
+ * @param {!string} s
+ * @return {!string}
+ */
+BaseStemmer.prototype.assign_to$S = function (s) {
+ return this.current.slice(0, this.limit);
+};
+
+/**
+ * @return {!boolean}
+ */
+BaseStemmer.prototype.stem$ = function () {
+ return false;
+};
+
+/**
+ * @param {!string} word
+ * @return {!string}
+ */
+BaseStemmer.prototype.stemWord$S = function (word) {
+ /** @type {undefined|!string} */
+ var result;
+ /** @type {!string} */
+ var current$0;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var limit$0;
+ result = this.cache['.' + word];
+ if (result == null) {
+ current$0 = this.current = word;
+ cursor$0 = this.cursor = 0;
+ limit$0 = this.limit = current$0.length;
+ this.limit_backward = 0;
+ this.bra = cursor$0;
+ this.ket = limit$0;
+ this.stem$();
+ result = this.current;
+ this.cache['.' + word] = result;
+ }
+ return result;
+};
+
+/**
+ * @param {Array.<undefined|!string>} words
+ * @return {Array.<undefined|!string>}
+ */
+BaseStemmer.prototype.stemWords$AS = function (words) {
+ /** @type {Array.<undefined|!string>} */
+ var results;
+ /** @type {!number} */
+ var i;
+ /** @type {undefined|!string} */
+ var word;
+ /** @type {undefined|!string} */
+ var result;
+ /** @type {!string} */
+ var current$0;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var limit$0;
+ results = [ ];
+ for (i = 0; i < words.length; i++) {
+ word = words[i];
+ result = this.cache['.' + word];
+ if (result == null) {
+ current$0 = this.current = word;
+ cursor$0 = this.cursor = 0;
+ limit$0 = this.limit = current$0.length;
+ this.limit_backward = 0;
+ this.bra = cursor$0;
+ this.ket = limit$0;
+ this.stem$();
+ result = this.current;
+ this.cache['.' + word] = result;
+ }
+ results.push(result);
+ }
+ return results;
+};
+
+/**
+ * class EnglishStemmer extends BaseStemmer
+ * @constructor
+ */
+function EnglishStemmer() {
+}
+
+EnglishStemmer.prototype = new BaseStemmer;
+/**
+ * @constructor
+ */
+function EnglishStemmer$() {
+ BaseStemmer$.call(this);
+ this.B_Y_found = false;
+ this.I_p2 = 0;
+ this.I_p1 = 0;
+};
+
+EnglishStemmer$.prototype = new EnglishStemmer;
+
+/**
+ * @param {EnglishStemmer} other
+ */
+EnglishStemmer.prototype.copy_from$LEnglishStemmer$ = function (other) {
+ this.B_Y_found = other.B_Y_found;
+ this.I_p2 = other.I_p2;
+ this.I_p1 = other.I_p1;
+ BaseStemmer.prototype.copy_from$LBaseStemmer$.call(this, other);
+};
+
+/**
+ * @return {!boolean}
+ */
+EnglishStemmer.prototype.r_prelude$ = function () {
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var v_3;
+ /** @type {!number} */
+ var v_4;
+ /** @type {!number} */
+ var v_5;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!boolean} */
+ var lab2;
+ /** @type {!boolean} */
+ var lab4;
+ /** @type {!boolean} */
+ var lab6;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var cursor$1;
+ /** @type {!number} */
+ var cursor$2;
+ this.B_Y_found = false;
+ v_1 = this.cursor;
+ lab0 = true;
+lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ this.bra = this.cursor;
+ if (! this.eq_s$IS(1, "'")) {
+ break lab0;
+ }
+ this.ket = this.cursor;
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ }
+ cursor$0 = this.cursor = v_1;
+ v_2 = cursor$0;
+ lab1 = true;
+lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ this.bra = this.cursor;
+ if (! this.eq_s$IS(1, "y")) {
+ break lab1;
+ }
+ this.ket = this.cursor;
+ if (! this.slice_from$S("Y")) {
+ return false;
+ }
+ this.B_Y_found = true;
+ }
+ cursor$2 = this.cursor = v_2;
+ v_3 = cursor$2;
+ lab2 = true;
+lab2:
+ while (lab2 === true) {
+ lab2 = false;
+ replab3:
+ while (true) {
+ v_4 = this.cursor;
+ lab4 = true;
+ lab4:
+ while (lab4 === true) {
+ lab4 = false;
+ golab5:
+ while (true) {
+ v_5 = this.cursor;
+ lab6 = true;
+ lab6:
+ while (lab6 === true) {
+ lab6 = false;
+ if (! this.in_grouping$AIII(EnglishStemmer.g_v, 97, 121)) {
+ break lab6;
+ }
+ this.bra = this.cursor;
+ if (! this.eq_s$IS(1, "y")) {
+ break lab6;
+ }
+ this.ket = this.cursor;
+ this.cursor = v_5;
+ break golab5;
+ }
+ cursor$1 = this.cursor = v_5;
+ if (cursor$1 >= this.limit) {
+ break lab4;
+ }
+ this.cursor++;
+ }
+ if (! this.slice_from$S("Y")) {
+ return false;
+ }
+ this.B_Y_found = true;
+ continue replab3;
+ }
+ this.cursor = v_4;
+ break replab3;
+ }
+ }
+ this.cursor = v_3;
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+EnglishStemmer.prototype.r_mark_regions$ = function () {
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!boolean} */
+ var lab2;
+ /** @type {!boolean} */
+ var lab4;
+ /** @type {!boolean} */
+ var lab6;
+ /** @type {!boolean} */
+ var lab8;
+ /** @type {!boolean} */
+ var lab10;
+ /** @type {!number} */
+ var limit$0;
+ this.I_p1 = limit$0 = this.limit;
+ this.I_p2 = limit$0;
+ v_1 = this.cursor;
+ lab0 = true;
+lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ v_2 = this.cursor;
+ lab2 = true;
+ lab2:
+ while (lab2 === true) {
+ lab2 = false;
+ if (this.find_among$ALAmong$I(EnglishStemmer.a_0, 3) === 0) {
+ break lab2;
+ }
+ break lab1;
+ }
+ this.cursor = v_2;
+ golab3:
+ while (true) {
+ lab4 = true;
+ lab4:
+ while (lab4 === true) {
+ lab4 = false;
+ if (! this.in_grouping$AIII(EnglishStemmer.g_v, 97, 121)) {
+ break lab4;
+ }
+ break golab3;
+ }
+ if (this.cursor >= this.limit) {
+ break lab0;
+ }
+ this.cursor++;
+ }
+ golab5:
+ while (true) {
+ lab6 = true;
+ lab6:
+ while (lab6 === true) {
+ lab6 = false;
+ if (! this.out_grouping$AIII(EnglishStemmer.g_v, 97, 121)) {
+ break lab6;
+ }
+ break golab5;
+ }
+ if (this.cursor >= this.limit) {
+ break lab0;
+ }
+ this.cursor++;
+ }
+ }
+ this.I_p1 = this.cursor;
+ golab7:
+ while (true) {
+ lab8 = true;
+ lab8:
+ while (lab8 === true) {
+ lab8 = false;
+ if (! this.in_grouping$AIII(EnglishStemmer.g_v, 97, 121)) {
+ break lab8;
+ }
+ break golab7;
+ }
+ if (this.cursor >= this.limit) {
+ break lab0;
+ }
+ this.cursor++;
+ }
+ golab9:
+ while (true) {
+ lab10 = true;
+ lab10:
+ while (lab10 === true) {
+ lab10 = false;
+ if (! this.out_grouping$AIII(EnglishStemmer.g_v, 97, 121)) {
+ break lab10;
+ }
+ break golab9;
+ }
+ if (this.cursor >= this.limit) {
+ break lab0;
+ }
+ this.cursor++;
+ }
+ this.I_p2 = this.cursor;
+ }
+ this.cursor = v_1;
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+EnglishStemmer.prototype.r_shortv$ = function () {
+ /** @type {!number} */
+ var v_1;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!boolean} */
+ var lab1;
+ lab0 = true;
+lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ v_1 = this.limit - this.cursor;
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ if (! this.out_grouping_b$AIII(EnglishStemmer.g_v_WXY, 89, 121)) {
+ break lab1;
+ }
+ if (! this.in_grouping_b$AIII(EnglishStemmer.g_v, 97, 121)) {
+ break lab1;
+ }
+ if (! this.out_grouping_b$AIII(EnglishStemmer.g_v, 97, 121)) {
+ break lab1;
+ }
+ break lab0;
+ }
+ this.cursor = this.limit - v_1;
+ if (! this.out_grouping_b$AIII(EnglishStemmer.g_v, 97, 121)) {
+ return false;
+ }
+ if (! this.in_grouping_b$AIII(EnglishStemmer.g_v, 97, 121)) {
+ return false;
+ }
+ if (this.cursor > this.limit_backward) {
+ return false;
+ }
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+EnglishStemmer.prototype.r_R1$ = function () {
+ return (! (this.I_p1 <= this.cursor) ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+EnglishStemmer.prototype.r_R2$ = function () {
+ return (! (this.I_p2 <= this.cursor) ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+EnglishStemmer.prototype.r_Step_1a$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!boolean} */
+ var lab2;
+ /** @type {!number} */
+ var c;
+ /** @type {!boolean} */
+ var lab4;
+ v_1 = this.limit - this.cursor;
+ lab0 = true;
+lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ this.ket = this.cursor;
+ among_var = this.find_among_b$ALAmong$I(EnglishStemmer.a_1, 3);
+ if (among_var === 0) {
+ this.cursor = this.limit - v_1;
+ break lab0;
+ }
+ this.bra = this.cursor;
+ switch (among_var) {
+ case 0:
+ this.cursor = this.limit - v_1;
+ break lab0;
+ case 1:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ }
+ }
+ this.ket = this.cursor;
+ among_var = this.find_among_b$ALAmong$I(EnglishStemmer.a_2, 6);
+ if (among_var === 0) {
+ return false;
+ }
+ this.bra = this.cursor;
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ if (! this.slice_from$S("ss")) {
+ return false;
+ }
+ break;
+ case 2:
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ v_2 = this.limit - this.cursor;
+ lab2 = true;
+ lab2:
+ while (lab2 === true) {
+ lab2 = false;
+ c = (this.cursor - 2 | 0);
+ if (this.limit_backward > c || c > this.limit) {
+ break lab2;
+ }
+ this.cursor = c;
+ if (! this.slice_from$S("i")) {
+ return false;
+ }
+ break lab1;
+ }
+ this.cursor = this.limit - v_2;
+ if (! this.slice_from$S("ie")) {
+ return false;
+ }
+ }
+ break;
+ case 3:
+ if (this.cursor <= this.limit_backward) {
+ return false;
+ }
+ this.cursor--;
+ golab3:
+ while (true) {
+ lab4 = true;
+ lab4:
+ while (lab4 === true) {
+ lab4 = false;
+ if (! this.in_grouping_b$AIII(EnglishStemmer.g_v, 97, 121)) {
+ break lab4;
+ }
+ break golab3;
+ }
+ if (this.cursor <= this.limit_backward) {
+ return false;
+ }
+ this.cursor--;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+EnglishStemmer.prototype.r_Step_1b$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_3;
+ /** @type {!number} */
+ var v_4;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!number} */
+ var c;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var cursor$1;
+ /** @type {!number} */
+ var cursor$2;
+ this.ket = this.cursor;
+ among_var = this.find_among_b$ALAmong$I(EnglishStemmer.a_4, 6);
+ if (among_var === 0) {
+ return false;
+ }
+ this.bra = this.cursor;
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ if (! (! (this.I_p1 <= this.cursor) ? false : true)) {
+ return false;
+ }
+ if (! this.slice_from$S("ee")) {
+ return false;
+ }
+ break;
+ case 2:
+ v_1 = this.limit - this.cursor;
+ golab0:
+ while (true) {
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ if (! this.in_grouping_b$AIII(EnglishStemmer.g_v, 97, 121)) {
+ break lab1;
+ }
+ break golab0;
+ }
+ if (this.cursor <= this.limit_backward) {
+ return false;
+ }
+ this.cursor--;
+ }
+ this.cursor = this.limit - v_1;
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ v_3 = this.limit - this.cursor;
+ among_var = this.find_among_b$ALAmong$I(EnglishStemmer.a_3, 13);
+ if (among_var === 0) {
+ return false;
+ }
+ this.cursor = this.limit - v_3;
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ c = cursor$0 = this.cursor;
+ this.insert$IIS(cursor$0, cursor$0, "e");
+ this.cursor = c;
+ break;
+ case 2:
+ this.ket = cursor$1 = this.cursor;
+ if (cursor$1 <= this.limit_backward) {
+ return false;
+ }
+ this.cursor--;
+ this.bra = this.cursor;
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 3:
+ if (this.cursor !== this.I_p1) {
+ return false;
+ }
+ v_4 = this.limit - this.cursor;
+ if (! this.r_shortv$()) {
+ return false;
+ }
+ cursor$2 = this.cursor = this.limit - v_4;
+ c = cursor$2;
+ this.insert$IIS(cursor$2, cursor$2, "e");
+ this.cursor = cursor$2;
+ break;
+ }
+ break;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+EnglishStemmer.prototype.r_Step_1c$ = function () {
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!boolean} */
+ var lab2;
+ this.ket = this.cursor;
+ lab0 = true;
+lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ v_1 = this.limit - this.cursor;
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ if (! this.eq_s_b$IS(1, "y")) {
+ break lab1;
+ }
+ break lab0;
+ }
+ this.cursor = this.limit - v_1;
+ if (! this.eq_s_b$IS(1, "Y")) {
+ return false;
+ }
+ }
+ this.bra = this.cursor;
+ if (! this.out_grouping_b$AIII(EnglishStemmer.g_v, 97, 121)) {
+ return false;
+ }
+ v_2 = this.limit - this.cursor;
+ lab2 = true;
+lab2:
+ while (lab2 === true) {
+ lab2 = false;
+ if (this.cursor > this.limit_backward) {
+ break lab2;
+ }
+ return false;
+ }
+ this.cursor = this.limit - v_2;
+ return (! this.slice_from$S("i") ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+EnglishStemmer.prototype.r_Step_2$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var cursor$0;
+ this.ket = this.cursor;
+ among_var = this.find_among_b$ALAmong$I(EnglishStemmer.a_5, 24);
+ if (among_var === 0) {
+ return false;
+ }
+ this.bra = cursor$0 = this.cursor;
+ if (! (! (this.I_p1 <= cursor$0) ? false : true)) {
+ return false;
+ }
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ if (! this.slice_from$S("tion")) {
+ return false;
+ }
+ break;
+ case 2:
+ if (! this.slice_from$S("ence")) {
+ return false;
+ }
+ break;
+ case 3:
+ if (! this.slice_from$S("ance")) {
+ return false;
+ }
+ break;
+ case 4:
+ if (! this.slice_from$S("able")) {
+ return false;
+ }
+ break;
+ case 5:
+ if (! this.slice_from$S("ent")) {
+ return false;
+ }
+ break;
+ case 6:
+ if (! this.slice_from$S("ize")) {
+ return false;
+ }
+ break;
+ case 7:
+ if (! this.slice_from$S("ate")) {
+ return false;
+ }
+ break;
+ case 8:
+ if (! this.slice_from$S("al")) {
+ return false;
+ }
+ break;
+ case 9:
+ if (! this.slice_from$S("ful")) {
+ return false;
+ }
+ break;
+ case 10:
+ if (! this.slice_from$S("ous")) {
+ return false;
+ }
+ break;
+ case 11:
+ if (! this.slice_from$S("ive")) {
+ return false;
+ }
+ break;
+ case 12:
+ if (! this.slice_from$S("ble")) {
+ return false;
+ }
+ break;
+ case 13:
+ if (! this.eq_s_b$IS(1, "l")) {
+ return false;
+ }
+ if (! this.slice_from$S("og")) {
+ return false;
+ }
+ break;
+ case 14:
+ if (! this.slice_from$S("ful")) {
+ return false;
+ }
+ break;
+ case 15:
+ if (! this.slice_from$S("less")) {
+ return false;
+ }
+ break;
+ case 16:
+ if (! this.in_grouping_b$AIII(EnglishStemmer.g_valid_LI, 99, 116)) {
+ return false;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+EnglishStemmer.prototype.r_Step_3$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var cursor$0;
+ this.ket = this.cursor;
+ among_var = this.find_among_b$ALAmong$I(EnglishStemmer.a_6, 9);
+ if (among_var === 0) {
+ return false;
+ }
+ this.bra = cursor$0 = this.cursor;
+ if (! (! (this.I_p1 <= cursor$0) ? false : true)) {
+ return false;
+ }
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ if (! this.slice_from$S("tion")) {
+ return false;
+ }
+ break;
+ case 2:
+ if (! this.slice_from$S("ate")) {
+ return false;
+ }
+ break;
+ case 3:
+ if (! this.slice_from$S("al")) {
+ return false;
+ }
+ break;
+ case 4:
+ if (! this.slice_from$S("ic")) {
+ return false;
+ }
+ break;
+ case 5:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 6:
+ if (! (! (this.I_p2 <= this.cursor) ? false : true)) {
+ return false;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+EnglishStemmer.prototype.r_Step_4$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var v_1;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!number} */
+ var cursor$0;
+ this.ket = this.cursor;
+ among_var = this.find_among_b$ALAmong$I(EnglishStemmer.a_7, 18);
+ if (among_var === 0) {
+ return false;
+ }
+ this.bra = cursor$0 = this.cursor;
+ if (! (! (this.I_p2 <= cursor$0) ? false : true)) {
+ return false;
+ }
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 2:
+ lab0 = true;
+ lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ v_1 = this.limit - this.cursor;
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ if (! this.eq_s_b$IS(1, "s")) {
+ break lab1;
+ }
+ break lab0;
+ }
+ this.cursor = this.limit - v_1;
+ if (! this.eq_s_b$IS(1, "t")) {
+ return false;
+ }
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+EnglishStemmer.prototype.r_Step_5$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!boolean} */
+ var lab2;
+ /** @type {!number} */
+ var cursor$0;
+ this.ket = this.cursor;
+ among_var = this.find_among_b$ALAmong$I(EnglishStemmer.a_8, 2);
+ if (among_var === 0) {
+ return false;
+ }
+ this.bra = this.cursor;
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ lab0 = true;
+ lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ v_1 = this.limit - this.cursor;
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ if (! (! (this.I_p2 <= this.cursor) ? false : true)) {
+ break lab1;
+ }
+ break lab0;
+ }
+ cursor$0 = this.cursor = this.limit - v_1;
+ if (! (! (this.I_p1 <= cursor$0) ? false : true)) {
+ return false;
+ }
+ v_2 = this.limit - this.cursor;
+ lab2 = true;
+ lab2:
+ while (lab2 === true) {
+ lab2 = false;
+ if (! this.r_shortv$()) {
+ break lab2;
+ }
+ return false;
+ }
+ this.cursor = this.limit - v_2;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ case 2:
+ if (! (! (this.I_p2 <= this.cursor) ? false : true)) {
+ return false;
+ }
+ if (! this.eq_s_b$IS(1, "l")) {
+ return false;
+ }
+ if (! this.slice_from$S("")) {
+ return false;
+ }
+ break;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+EnglishStemmer.prototype.r_exception2$ = function () {
+ /** @type {!number} */
+ var cursor$0;
+ this.ket = this.cursor;
+ if (this.find_among_b$ALAmong$I(EnglishStemmer.a_9, 8) === 0) {
+ return false;
+ }
+ this.bra = cursor$0 = this.cursor;
+ return (cursor$0 > this.limit_backward ? false : true);
+};
+
+/**
+ * @return {!boolean}
+ */
+EnglishStemmer.prototype.r_exception1$ = function () {
+ /** @type {!number} */
+ var among_var;
+ /** @type {!number} */
+ var cursor$0;
+ this.bra = this.cursor;
+ among_var = this.find_among$ALAmong$I(EnglishStemmer.a_10, 18);
+ if (among_var === 0) {
+ return false;
+ }
+ this.ket = cursor$0 = this.cursor;
+ if (cursor$0 < this.limit) {
+ return false;
+ }
+ switch (among_var) {
+ case 0:
+ return false;
+ case 1:
+ if (! this.slice_from$S("ski")) {
+ return false;
+ }
+ break;
+ case 2:
+ if (! this.slice_from$S("sky")) {
+ return false;
+ }
+ break;
+ case 3:
+ if (! this.slice_from$S("die")) {
+ return false;
+ }
+ break;
+ case 4:
+ if (! this.slice_from$S("lie")) {
+ return false;
+ }
+ break;
+ case 5:
+ if (! this.slice_from$S("tie")) {
+ return false;
+ }
+ break;
+ case 6:
+ if (! this.slice_from$S("idl")) {
+ return false;
+ }
+ break;
+ case 7:
+ if (! this.slice_from$S("gentl")) {
+ return false;
+ }
+ break;
+ case 8:
+ if (! this.slice_from$S("ugli")) {
+ return false;
+ }
+ break;
+ case 9:
+ if (! this.slice_from$S("earli")) {
+ return false;
+ }
+ break;
+ case 10:
+ if (! this.slice_from$S("onli")) {
+ return false;
+ }
+ break;
+ case 11:
+ if (! this.slice_from$S("singl")) {
+ return false;
+ }
+ break;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+EnglishStemmer.prototype.r_postlude$ = function () {
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!boolean} */
+ var lab3;
+ /** @type {!number} */
+ var cursor$0;
+ if (! this.B_Y_found) {
+ return false;
+ }
+replab0:
+ while (true) {
+ v_1 = this.cursor;
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ golab2:
+ while (true) {
+ v_2 = this.cursor;
+ lab3 = true;
+ lab3:
+ while (lab3 === true) {
+ lab3 = false;
+ this.bra = this.cursor;
+ if (! this.eq_s$IS(1, "Y")) {
+ break lab3;
+ }
+ this.ket = this.cursor;
+ this.cursor = v_2;
+ break golab2;
+ }
+ cursor$0 = this.cursor = v_2;
+ if (cursor$0 >= this.limit) {
+ break lab1;
+ }
+ this.cursor++;
+ }
+ if (! this.slice_from$S("y")) {
+ return false;
+ }
+ continue replab0;
+ }
+ this.cursor = v_1;
+ break replab0;
+ }
+ return true;
+};
+
+/**
+ * @return {!boolean}
+ */
+EnglishStemmer.prototype.stem$ = function () {
+ /** @type {!number} */
+ var v_1;
+ /** @type {!number} */
+ var v_2;
+ /** @type {!number} */
+ var v_3;
+ /** @type {!number} */
+ var v_4;
+ /** @type {!number} */
+ var v_5;
+ /** @type {!number} */
+ var v_6;
+ /** @type {!number} */
+ var v_7;
+ /** @type {!number} */
+ var v_8;
+ /** @type {!number} */
+ var v_9;
+ /** @type {!number} */
+ var v_10;
+ /** @type {!number} */
+ var v_11;
+ /** @type {!number} */
+ var v_12;
+ /** @type {!number} */
+ var v_13;
+ /** @type {!boolean} */
+ var lab0;
+ /** @type {!boolean} */
+ var lab1;
+ /** @type {!boolean} */
+ var lab2;
+ /** @type {!boolean} */
+ var lab3;
+ /** @type {!number} */
+ var c;
+ /** @type {!boolean} */
+ var lab4;
+ /** @type {!boolean} */
+ var lab5;
+ /** @type {!boolean} */
+ var lab6;
+ /** @type {!boolean} */
+ var lab7;
+ /** @type {!boolean} */
+ var lab8;
+ /** @type {!boolean} */
+ var lab9;
+ /** @type {!boolean} */
+ var lab10;
+ /** @type {!boolean} */
+ var lab11;
+ /** @type {!boolean} */
+ var lab12;
+ /** @type {!boolean} */
+ var lab13;
+ /** @type {!boolean} */
+ var lab14;
+ /** @type {!boolean} */
+ var lab15;
+ /** @type {!number} */
+ var cursor$0;
+ /** @type {!number} */
+ var cursor$1;
+ /** @type {!number} */
+ var cursor$2;
+ /** @type {!number} */
+ var limit$0;
+ /** @type {!number} */
+ var cursor$3;
+ /** @type {!number} */
+ var limit$1;
+ /** @type {!number} */
+ var cursor$4;
+ /** @type {!number} */
+ var limit$2;
+ /** @type {!number} */
+ var cursor$5;
+ /** @type {!number} */
+ var limit$3;
+ /** @type {!number} */
+ var cursor$6;
+ /** @type {!number} */
+ var limit$4;
+ /** @type {!number} */
+ var cursor$7;
+ /** @type {!number} */
+ var limit$5;
+ /** @type {!number} */
+ var cursor$8;
+ /** @type {!number} */
+ var limit$6;
+ /** @type {!number} */
+ var cursor$9;
+ /** @type {!number} */
+ var cursor$10;
+ lab0 = true;
+lab0:
+ while (lab0 === true) {
+ lab0 = false;
+ v_1 = this.cursor;
+ lab1 = true;
+ lab1:
+ while (lab1 === true) {
+ lab1 = false;
+ if (! this.r_exception1$()) {
+ break lab1;
+ }
+ break lab0;
+ }
+ this.cursor = v_1;
+ lab2 = true;
+ lab2:
+ while (lab2 === true) {
+ lab2 = false;
+ v_2 = this.cursor;
+ lab3 = true;
+ lab3:
+ while (lab3 === true) {
+ lab3 = false;
+ c = (this.cursor + 3 | 0);
+ if (0 > c || c > this.limit) {
+ break lab3;
+ }
+ this.cursor = c;
+ break lab2;
+ }
+ this.cursor = v_2;
+ break lab0;
+ }
+ cursor$0 = this.cursor = v_1;
+ v_3 = cursor$0;
+ lab4 = true;
+ lab4:
+ while (lab4 === true) {
+ lab4 = false;
+ if (! this.r_prelude$()) {
+ break lab4;
+ }
+ }
+ cursor$1 = this.cursor = v_3;
+ v_4 = cursor$1;
+ lab5 = true;
+ lab5:
+ while (lab5 === true) {
+ lab5 = false;
+ if (! this.r_mark_regions$()) {
+ break lab5;
+ }
+ }
+ cursor$2 = this.cursor = v_4;
+ this.limit_backward = cursor$2;
+ cursor$3 = this.cursor = limit$0 = this.limit;
+ v_5 = limit$0 - cursor$3;
+ lab6 = true;
+ lab6:
+ while (lab6 === true) {
+ lab6 = false;
+ if (! this.r_Step_1a$()) {
+ break lab6;
+ }
+ }
+ this.cursor = this.limit - v_5;
+ lab7 = true;
+ lab7:
+ while (lab7 === true) {
+ lab7 = false;
+ v_6 = this.limit - this.cursor;
+ lab8 = true;
+ lab8:
+ while (lab8 === true) {
+ lab8 = false;
+ if (! this.r_exception2$()) {
+ break lab8;
+ }
+ break lab7;
+ }
+ cursor$4 = this.cursor = (limit$1 = this.limit) - v_6;
+ v_7 = limit$1 - cursor$4;
+ lab9 = true;
+ lab9:
+ while (lab9 === true) {
+ lab9 = false;
+ if (! this.r_Step_1b$()) {
+ break lab9;
+ }
+ }
+ cursor$5 = this.cursor = (limit$2 = this.limit) - v_7;
+ v_8 = limit$2 - cursor$5;
+ lab10 = true;
+ lab10:
+ while (lab10 === true) {
+ lab10 = false;
+ if (! this.r_Step_1c$()) {
+ break lab10;
+ }
+ }
+ cursor$6 = this.cursor = (limit$3 = this.limit) - v_8;
+ v_9 = limit$3 - cursor$6;
+ lab11 = true;
+ lab11:
+ while (lab11 === true) {
+ lab11 = false;
+ if (! this.r_Step_2$()) {
+ break lab11;
+ }
+ }
+ cursor$7 = this.cursor = (limit$4 = this.limit) - v_9;
+ v_10 = limit$4 - cursor$7;
+ lab12 = true;
+ lab12:
+ while (lab12 === true) {
+ lab12 = false;
+ if (! this.r_Step_3$()) {
+ break lab12;
+ }
+ }
+ cursor$8 = this.cursor = (limit$5 = this.limit) - v_10;
+ v_11 = limit$5 - cursor$8;
+ lab13 = true;
+ lab13:
+ while (lab13 === true) {
+ lab13 = false;
+ if (! this.r_Step_4$()) {
+ break lab13;
+ }
+ }
+ cursor$9 = this.cursor = (limit$6 = this.limit) - v_11;
+ v_12 = limit$6 - cursor$9;
+ lab14 = true;
+ lab14:
+ while (lab14 === true) {
+ lab14 = false;
+ if (! this.r_Step_5$()) {
+ break lab14;
+ }
+ }
+ this.cursor = this.limit - v_12;
+ }
+ cursor$10 = this.cursor = this.limit_backward;
+ v_13 = cursor$10;
+ lab15 = true;
+ lab15:
+ while (lab15 === true) {
+ lab15 = false;
+ if (! this.r_postlude$()) {
+ break lab15;
+ }
+ }
+ this.cursor = v_13;
+ }
+ return true;
+};
+
+/**
+ * @param {*} o
+ * @return {!boolean}
+ */
+EnglishStemmer.prototype.equals$X = function (o) {
+ return o instanceof EnglishStemmer;
+};
+
+/**
+ * @return {!number}
+ */
+EnglishStemmer.prototype.hashCode$ = function () {
+ /** @type {!string} */
+ var classname;
+ /** @type {!number} */
+ var hash;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var char;
+ classname = "EnglishStemmer";
+ hash = 0;
+ if ("EnglishStemmer".length === 0) {
+ return (hash | 0);
+ }
+ for (i = 0; i < classname.length; i++) {
+ char = classname.charCodeAt(i);
+ hash = (hash << 5) - hash + char;
+ hash = hash & hash;
+ }
+ return (hash | 0);
+};
+
+/**
+ * class Among extends Object
+ * @constructor
+ */
+function Among() {
+}
+
+/**
+ * @constructor
+ * @param {!string} s
+ * @param {!number} substring_i
+ * @param {!number} result
+ */
+function Among$SII(s, substring_i, result) {
+ this.s_size = s.length;
+ this.s = s;
+ this.substring_i = substring_i;
+ this.result = result;
+ this.method = null;
+ this.instance = null;
+};
+
+Among$SII.prototype = new Among;
+
+/**
+ * @constructor
+ * @param {!string} s
+ * @param {!number} substring_i
+ * @param {!number} result
+ * @param {*} method
+ * @param {BaseStemmer} instance
+ */
+function Among$SIIF$LBaseStemmer$B$LBaseStemmer$(s, substring_i, result, method, instance) {
+ this.s_size = s.length;
+ this.s = s;
+ this.substring_i = substring_i;
+ this.result = result;
+ this.method = method;
+ this.instance = instance;
+};
+
+Among$SIIF$LBaseStemmer$B$LBaseStemmer$.prototype = new Among;
+
+/**
+ * class Metadata extends Object
+ * @constructor
+ */
+function Metadata() {
+}
+
+/**
+ * @constructor
+ * @param {Oktavia} parent
+ */
+function Metadata$LOktavia$(parent) {
+ this._parent = parent;
+ this._bitVector = new BitVector$();
+};
+
+Metadata$LOktavia$.prototype = new Metadata;
+
+/**
+ * @return {!number}
+ */
+Metadata.prototype._size$ = function () {
+ /** @type {BitVector} */
+ var this$0;
+ /** @type {!number} */
+ var i$0;
+ /** @type {BitVector} */
+ var _bitVector$0;
+ this$0 = _bitVector$0 = this._bitVector;
+ i$0 = _bitVector$0._size;
+ return this$0.rank$IB(i$0, true);
+};
+
+/**
+ * @param {!number} index
+ * @return {!string}
+ */
+Metadata.prototype.getContent$I = function (index) {
+ /** @type {!number} */
+ var startPosition;
+ /** @type {!number} */
+ var length;
+ if (index < 0 || this._size$() <= index) {
+ throw new Error("Section.getContent() : range error " + (index + ""));
+ }
+ startPosition = 0;
+ if (index > 0) {
+ startPosition = this._bitVector.select$I(index - 1) + 1;
+ }
+ length = this._bitVector.select$I(index) - startPosition + 1;
+ return this._parent._getSubstring$II(startPosition, length);
+};
+
+/**
+ * @param {!number} index
+ * @return {!number}
+ */
+Metadata.prototype.getStartPosition$I = function (index) {
+ /** @type {!number} */
+ var startPosition;
+ if (index < 0 || this._size$() <= index) {
+ throw new Error("Section.getContent() : range error " + (index + ""));
+ }
+ startPosition = 0;
+ if (index > 0) {
+ startPosition = this._bitVector.select$I(index - 1) + 1;
+ }
+ return (startPosition | 0);
+};
+
+/**
+ * @param {SingleResult} result
+ * @param {Array.<undefined|!number>} positions
+ * @param {!string} word
+ * @param {!boolean} stemmed
+ */
+Metadata.prototype.grouping$LSingleResult$AISB = function (result, positions, word, stemmed) {
+};
+
+/**
+ * @param {!number} index
+ * @return {!string}
+ */
+Metadata.prototype.getInformation$I = function (index) {
+ return '';
+};
+
+/**
+ */
+Metadata.prototype._build$ = function () {
+ this._bitVector.build$();
+};
+
+/**
+ * @param {!string} name
+ * @param {!string} data
+ * @param {!number} offset
+ * @return {!number}
+ */
+Metadata.prototype._load$SSI = function (name, data, offset) {
+ offset = this._bitVector.load$SI(data, offset);
+ this._parent._metadataLabels.push(name);
+ this._parent._metadatas[name] = this;
+ return offset;
+};
+
+/**
+ * @return {!string}
+ */
+Metadata.prototype._dump$ = function () {
+ /** @type {BitVector} */
+ var this$0;
+ /** @type {Array.<undefined|!string>} */
+ var contents$0;
+ this$0 = this._bitVector;
+ contents$0 = [ ];
+ contents$0.push(Binary$dump32bitNumber$N(this$0._size));
+ contents$0.push(Binary$dump32bitNumberList$AN(this$0._v));
+ return contents$0.join('');
+};
+
+/**
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+Metadata.prototype._dump$LCompressionReport$ = function (report) {
+ /** @type {BitVector} */
+ var this$0;
+ /** @type {Array.<undefined|!string>} */
+ var contents$0;
+ this$0 = this._bitVector;
+ contents$0 = [ ];
+ contents$0.push(Binary$dump32bitNumber$N(this$0._size));
+ CompressionReport$add$LCompressionReport$II(report, 2, 2);
+ contents$0.push(Binary$dump32bitNumberList$ANLCompressionReport$(this$0._v, report));
+ return contents$0.join('');
+};
+
+/**
+ * class Section extends Metadata
+ * @constructor
+ */
+function Section() {
+}
+
+Section.prototype = new Metadata;
+/**
+ * @constructor
+ * @param {Oktavia} parent
+ */
+function Section$LOktavia$(parent) {
+ this._parent = parent;
+ this._bitVector = new BitVector$();
+ this._names = [ ];
+};
+
+Section$LOktavia$.prototype = new Section;
+
+/**
+ * @param {!string} name
+ */
+Section.prototype.setTail$S = function (name) {
+ /** @type {!number} */
+ var index$0;
+ /** @type {Oktavia} */
+ var this$0;
+ /** @type {FMIndex} */
+ var this$0$0;
+ this$0 = this._parent;
+ this$0$0 = this$0._fmindex;
+ index$0 = this$0$0._substr.length;
+ this._names.push(name);
+ this._bitVector.set$I(index$0 - 1);
+};
+
+/**
+ * @param {!string} name
+ * @param {!number} index
+ */
+Section.prototype.setTail$SI = function (name, index) {
+ this._names.push(name);
+ this._bitVector.set$I(index - 1);
+};
+
+/**
+ * @return {!number}
+ */
+Section.prototype.size$ = function () {
+ return (this._names.length | 0);
+};
+
+/**
+ * @param {!number} position
+ * @return {!number}
+ */
+Section.prototype.getSectionIndex$I = function (position) {
+ /** @type {BitVector} */
+ var this$0;
+ if (position < 0 || this._bitVector.size$() <= position) {
+ throw new Error("Section.getSectionIndex() : range error " + (position + ""));
+ }
+ this$0 = this._bitVector;
+ return this$0.rank$IB(position, true);
+};
+
+/**
+ * @param {!number} index
+ * @return {!string}
+ */
+Section.prototype.getName$I = function (index) {
+ if (index < 0 || this._names.length <= index) {
+ throw new Error("Section.getName() : range error");
+ }
+ return this._names[index];
+};
+
+/**
+ * @param {SingleResult} result
+ * @param {Array.<undefined|!number>} positions
+ * @param {!string} word
+ * @param {!boolean} stemmed
+ */
+Section.prototype.grouping$LSingleResult$AISB = function (result, positions, word, stemmed) {
+ /** @type {!number} */
+ var i;
+ /** @type {undefined|!number} */
+ var position;
+ /** @type {!number} */
+ var index;
+ /** @type {SearchUnit} */
+ var unit;
+ for (i = 0; i < positions.length; i++) {
+ position = positions[i];
+ index = this.getSectionIndex$I(position);
+ unit = SingleResult$getSearchUnit$LSingleResult$I(result, index);
+ if (unit.startPosition < 0) {
+ unit.startPosition = this.getStartPosition$I(index);
+ }
+ SearchUnit$addPosition$LSearchUnit$SIB(unit, word, position - unit.startPosition, stemmed);
+ }
+};
+
+/**
+ * @param {!number} index
+ * @return {!string}
+ */
+Section.prototype.getInformation$I = function (index) {
+ return this.getName$I(index);
+};
+
+/**
+ * @param {Oktavia} parent
+ * @param {!string} name
+ * @param {!string} data
+ * @param {!number} offset
+ * @return {!number}
+ */
+Section._load$LOktavia$SSI = function (parent, name, data, offset) {
+ /** @type {LoadedStringListResult} */
+ var strs;
+ /** @type {Section} */
+ var section;
+ /** @type {!number} */
+ var offset$0;
+ strs = new LoadedStringListResult$SI(data, offset);
+ section = new Section$LOktavia$(parent);
+ section._names = strs.result;
+ offset$0 = strs.offset;
+ offset$0 = section._bitVector.load$SI(data, offset$0);
+ section._parent._metadataLabels.push(name);
+ section._parent._metadatas[name] = section;
+ return offset$0;
+};
+
+var Section$_load$LOktavia$SSI = Section._load$LOktavia$SSI;
+
+/**
+ * @return {!string}
+ */
+Section.prototype._dump$ = function () {
+ return [ Binary$dump16bitNumber$I(0), Binary$dumpStringList$AS(this._names), Metadata.prototype._dump$.call(this) ].join('');
+};
+
+/**
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+Section.prototype._dump$LCompressionReport$ = function (report) {
+ CompressionReport$add$LCompressionReport$II(report, 1, 1);
+ return [ Binary$dump16bitNumber$I(0), Binary$dumpStringList$ASLCompressionReport$(this._names, report), Metadata.prototype._dump$LCompressionReport$.call(this, report) ].join('');
+};
+
+/**
+ * class Splitter extends Metadata
+ * @constructor
+ */
+function Splitter() {
+}
+
+Splitter.prototype = new Metadata;
+/**
+ * @constructor
+ * @param {Oktavia} parent
+ */
+function Splitter$LOktavia$(parent) {
+ this._parent = parent;
+ this._bitVector = new BitVector$();
+ this.name = null;
+};
+
+Splitter$LOktavia$.prototype = new Splitter;
+
+/**
+ * @constructor
+ * @param {Oktavia} parent
+ * @param {!string} name
+ */
+function Splitter$LOktavia$S(parent, name) {
+ this._parent = parent;
+ this._bitVector = new BitVector$();
+ this.name = name;
+};
+
+Splitter$LOktavia$S.prototype = new Splitter;
+
+/**
+ * @return {!number}
+ */
+Splitter.prototype.size$ = function () {
+ /** @type {BitVector} */
+ var this$0$0;
+ /** @type {!number} */
+ var i$0$0;
+ /** @type {BitVector} */
+ var _bitVector$0;
+ this$0$0 = _bitVector$0 = this._bitVector;
+ i$0$0 = _bitVector$0._size;
+ return this$0$0.rank$IB(i$0$0, true);
+};
+
+/**
+ */
+Splitter.prototype.split$ = function () {
+ /** @type {!number} */
+ var index$0;
+ /** @type {Oktavia} */
+ var this$0;
+ /** @type {FMIndex} */
+ var this$0$0;
+ this$0 = this._parent;
+ this$0$0 = this$0._fmindex;
+ index$0 = this$0$0._substr.length;
+ this._bitVector.set$I(index$0 - 1);
+};
+
+/**
+ * @param {!number} index
+ */
+Splitter.prototype.split$I = function (index) {
+ this._bitVector.set$I(index - 1);
+};
+
+/**
+ * @param {!number} position
+ * @return {!number}
+ */
+Splitter.prototype.getIndex$I = function (position) {
+ /** @type {BitVector} */
+ var this$0;
+ if (position < 0 || this._bitVector.size$() <= position) {
+ throw new Error("Section.getSectionIndex() : range error");
+ }
+ this$0 = this._bitVector;
+ return this$0.rank$IB(position, true);
+};
+
+/**
+ * @param {SingleResult} result
+ * @param {Array.<undefined|!number>} positions
+ * @param {!string} word
+ * @param {!boolean} stemmed
+ */
+Splitter.prototype.grouping$LSingleResult$AISB = function (result, positions, word, stemmed) {
+ /** @type {!number} */
+ var i;
+ /** @type {undefined|!number} */
+ var position;
+ /** @type {!number} */
+ var index;
+ /** @type {SearchUnit} */
+ var unit;
+ for (i = 0; i < positions.length; i++) {
+ position = positions[i];
+ index = this.getIndex$I(position);
+ unit = SingleResult$getSearchUnit$LSingleResult$I(result, index);
+ if (unit.startPosition < 0) {
+ unit.startPosition = this.getStartPosition$I(index);
+ }
+ SearchUnit$addPosition$LSearchUnit$SIB(unit, word, position - unit.startPosition, stemmed);
+ }
+};
+
+/**
+ * @param {!number} index
+ * @return {!string}
+ */
+Splitter.prototype.getInformation$I = function (index) {
+ return (this.name != null ? this.name + (index + 1 + "") : '');
+};
+
+/**
+ * @param {Oktavia} parent
+ * @param {!string} name
+ * @param {!string} data
+ * @param {!number} offset
+ * @return {!number}
+ */
+Splitter._load$LOktavia$SSI = function (parent, name, data, offset) {
+ /** @type {Splitter} */
+ var section;
+ section = new Splitter$LOktavia$(parent);
+ offset = section._bitVector.load$SI(data, offset);
+ section._parent._metadataLabels.push(name);
+ section._parent._metadatas[name] = section;
+ return offset;
+};
+
+var Splitter$_load$LOktavia$SSI = Splitter._load$LOktavia$SSI;
+
+/**
+ * @return {!string}
+ */
+Splitter.prototype._dump$ = function () {
+ return [ Binary$dump16bitNumber$I(1), Metadata.prototype._dump$.call(this) ].join('');
+};
+
+/**
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+Splitter.prototype._dump$LCompressionReport$ = function (report) {
+ CompressionReport$add$LCompressionReport$II(report, 1, 1);
+ return [ Binary$dump16bitNumber$I(1), Metadata.prototype._dump$LCompressionReport$.call(this, report) ].join('');
+};
+
+/**
+ * class Table extends Metadata
+ * @constructor
+ */
+function Table() {
+}
+
+Table.prototype = new Metadata;
+/**
+ * @constructor
+ * @param {Oktavia} parent
+ * @param {Array.<undefined|!string>} headers
+ */
+function Table$LOktavia$AS(parent, headers) {
+ this._parent = parent;
+ this._bitVector = new BitVector$();
+ this._headers = headers;
+ this._columnTails = new BitVector$();
+};
+
+Table$LOktavia$AS.prototype = new Table;
+
+/**
+ * @return {!number}
+ */
+Table.prototype.rowSize$ = function () {
+ /** @type {BitVector} */
+ var this$0$0;
+ /** @type {!number} */
+ var i$0$0;
+ /** @type {BitVector} */
+ var _bitVector$0;
+ this$0$0 = _bitVector$0 = this._bitVector;
+ i$0$0 = _bitVector$0._size;
+ return this$0$0.rank$IB(i$0$0, true);
+};
+
+/**
+ * @return {!number}
+ */
+Table.prototype.columnSize$ = function () {
+ return (this._headers.length | 0);
+};
+
+/**
+ */
+Table.prototype.setColumnTail$ = function () {
+ /** @type {!number} */
+ var index;
+ /** @type {Oktavia} */
+ var this$0;
+ /** @type {FMIndex} */
+ var this$0$0;
+ /** @type {Oktavia} */
+ var _parent$0;
+ this$0 = _parent$0 = this._parent;
+ this$0$0 = this$0._fmindex;
+ index = this$0$0._substr.length;
+ _parent$0._fmindex.push$S(Oktavia.eob);
+ this._columnTails.set$I(index - 1);
+};
+
+/**
+ */
+Table.prototype.setRowTail$ = function () {
+ /** @type {!number} */
+ var index;
+ /** @type {Oktavia} */
+ var this$0;
+ /** @type {FMIndex} */
+ var this$0$0;
+ this$0 = this._parent;
+ this$0$0 = this$0._fmindex;
+ index = this$0$0._substr.length;
+ this._bitVector.set$I(index - 1);
+};
+
+/**
+ * @param {!number} position
+ * @return {Array.<undefined|!number>}
+ */
+Table.prototype.getCell$I = function (position) {
+ /** @type {!number} */
+ var row;
+ /** @type {!number} */
+ var currentColumn;
+ /** @type {!number} */
+ var lastRowColumn;
+ /** @type {!number} */
+ var startPosition;
+ /** @type {Array.<undefined|!number>} */
+ var result;
+ /** @type {BitVector} */
+ var this$0;
+ /** @type {BitVector} */
+ var this$1;
+ if (position < 0 || this._bitVector.size$() <= position) {
+ throw new Error("Section.getSectionIndex() : range error " + (position + ""));
+ }
+ this$0 = this._bitVector;
+ row = this$0.rank$IB(position, true);
+ this$1 = this._columnTails;
+ currentColumn = this$1.rank$IB(position, true);
+ lastRowColumn = 0;
+ if (row > 0) {
+ startPosition = this._bitVector.select$I(row - 1) + 1;
+ lastRowColumn = this._columnTails.rank$I(startPosition);
+ }
+ result = [ row, currentColumn - lastRowColumn ];
+ return result;
+};
+
+/**
+ * @param {!number} rowIndex
+ * @return {Object.<string, undefined|!string>}
+ */
+Table.prototype.getRowContent$I = function (rowIndex) {
+ /** @type {!string} */
+ var content;
+ /** @type {Array.<undefined|!string>} */
+ var values;
+ /** @type {Object.<string, undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var i;
+ content = this.getContent$I(rowIndex);
+ values = content.split(Oktavia.eob, this._headers.length);
+ result = ({ });
+ for (i in this._headers) {
+ if (i < values.length) {
+ result[this._headers[i]] = values[i];
+ } else {
+ result[this._headers[i]] = '';
+ }
+ }
+ return result;
+};
+
+/**
+ * @param {SingleResult} result
+ * @param {Array.<undefined|!number>} positions
+ * @param {!string} word
+ * @param {!boolean} stemmed
+ */
+Table.prototype.grouping$LSingleResult$AISB = function (result, positions, word, stemmed) {
+};
+
+/**
+ * @param {!number} index
+ * @return {!string}
+ */
+Table.prototype.getInformation$I = function (index) {
+ return '';
+};
+
+/**
+ */
+Table.prototype._build$ = function () {
+ this._bitVector.build$();
+ this._columnTails.build$();
+};
+
+/**
+ * @param {Oktavia} parent
+ * @param {!string} name
+ * @param {!string} data
+ * @param {!number} offset
+ * @return {!number}
+ */
+Table._load$LOktavia$SSI = function (parent, name, data, offset) {
+ /** @type {LoadedStringListResult} */
+ var strs;
+ /** @type {Table} */
+ var table;
+ /** @type {!number} */
+ var offset$0;
+ strs = new LoadedStringListResult$SI(data, offset);
+ table = new Table$LOktavia$AS(parent, strs.result);
+ offset$0 = strs.offset;
+ offset$0 = table._bitVector.load$SI(data, offset$0);
+ table._parent._metadataLabels.push(name);
+ table._parent._metadatas[name] = table;
+ offset = offset$0;
+ return table._columnTails.load$SI(data, offset$0);
+};
+
+var Table$_load$LOktavia$SSI = Table._load$LOktavia$SSI;
+
+/**
+ * @return {!string}
+ */
+Table.prototype._dump$ = function () {
+ return [ Binary$dump16bitNumber$I(2), Binary$dumpStringList$AS(this._headers), Metadata.prototype._dump$.call(this), this._columnTails.dump$() ].join('');
+};
+
+/**
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+Table.prototype._dump$LCompressionReport$ = function (report) {
+ CompressionReport$add$LCompressionReport$II(report, 1, 1);
+ return [ Binary$dump16bitNumber$I(2), Binary$dumpStringList$ASLCompressionReport$(this._headers, report), Metadata.prototype._dump$LCompressionReport$.call(this, report), this._columnTails.dump$LCompressionReport$(report) ].join('');
+};
+
+/**
+ * class Block extends Metadata
+ * @constructor
+ */
+function Block() {
+}
+
+Block.prototype = new Metadata;
+/**
+ * @constructor
+ * @param {Oktavia} parent
+ */
+function Block$LOktavia$(parent) {
+ this._parent = parent;
+ this._bitVector = new BitVector$();
+ this._names = [ ];
+ this._start = false;
+};
+
+Block$LOktavia$.prototype = new Block;
+
+/**
+ * @param {!string} blockName
+ */
+Block.prototype.startBlock$S = function (blockName) {
+ this.startBlock$SI(blockName, this._parent.contentSize$());
+};
+
+/**
+ * @param {!string} blockName
+ * @param {!number} index
+ */
+Block.prototype.startBlock$SI = function (blockName, index) {
+ if (this._start) {
+ throw new Error('Splitter `' + this._names[this._names.length - 1] + '` is not closed');
+ }
+ this._start = true;
+ this._names.push(blockName);
+ this._bitVector.set$I(index - 1);
+};
+
+/**
+ */
+Block.prototype.endBlock$ = function () {
+ this.endBlock$I(this._parent.contentSize$());
+};
+
+/**
+ * @param {!number} index
+ */
+Block.prototype.endBlock$I = function (index) {
+ if (! this._start) {
+ throw new Error('Splitter is not started');
+ }
+ this._start = false;
+ this._bitVector.set$I(index - 1);
+};
+
+/**
+ * @return {!number}
+ */
+Block.prototype.size$ = function () {
+ return (this._names.length | 0);
+};
+
+/**
+ * @param {!number} position
+ * @return {!number}
+ */
+Block.prototype.blockIndex$I = function (position) {
+ /** @type {!number} */
+ var result;
+ /** @type {BitVector} */
+ var this$0;
+ if (position < 0 || this._parent._fmindex.size$() - 1 <= position) {
+ throw new Error("Block.blockIndex() : range error " + (position + ""));
+ }
+ if (position >= this._bitVector.size$()) {
+ position = (this._bitVector.size$() - 1 | 0);
+ result = (this._bitVector.rank$I(position) + 1 | 0);
+ } else {
+ this$0 = this._bitVector;
+ result = this$0.rank$IB(position, true);
+ }
+ return result;
+};
+
+/**
+ * @param {!number} position
+ * @return {!boolean}
+ */
+Block.prototype.inBlock$I = function (position) {
+ /** @type {!number} */
+ var blockIndex;
+ blockIndex = this.blockIndex$I(position);
+ return blockIndex % 2 !== 0;
+};
+
+/**
+ * @param {!number} position
+ * @return {!string}
+ */
+Block.prototype.getBlockContent$I = function (position) {
+ /** @type {!number} */
+ var blockIndex;
+ /** @type {!string} */
+ var result;
+ blockIndex = this.blockIndex$I(position);
+ if (blockIndex % 2 !== 0) {
+ result = this.getContent$I(blockIndex);
+ } else {
+ result = '';
+ }
+ return result;
+};
+
+/**
+ * @param {!number} position
+ * @return {!string}
+ */
+Block.prototype.getBlockName$I = function (position) {
+ /** @type {!number} */
+ var blockIndex;
+ /** @type {!string} */
+ var result;
+ blockIndex = this.blockIndex$I(position);
+ if (blockIndex % 2 !== 0) {
+ result = this._names[blockIndex >>> 1];
+ } else {
+ result = '';
+ }
+ return result;
+};
+
+/**
+ * @param {SingleResult} result
+ * @param {Array.<undefined|!number>} positions
+ * @param {!string} word
+ * @param {!boolean} stemmed
+ */
+Block.prototype.grouping$LSingleResult$AISB = function (result, positions, word, stemmed) {
+};
+
+/**
+ * @param {!number} index
+ * @return {!string}
+ */
+Block.prototype.getInformation$I = function (index) {
+ return '';
+};
+
+/**
+ * @param {Oktavia} parent
+ * @param {!string} name
+ * @param {!string} data
+ * @param {!number} offset
+ * @return {!number}
+ */
+Block._load$LOktavia$SSI = function (parent, name, data, offset) {
+ /** @type {LoadedStringListResult} */
+ var strs;
+ /** @type {Block} */
+ var block;
+ /** @type {!number} */
+ var offset$0;
+ strs = new LoadedStringListResult$SI(data, offset);
+ block = new Block$LOktavia$(parent);
+ block._names = strs.result;
+ offset$0 = strs.offset;
+ offset$0 = block._bitVector.load$SI(data, offset$0);
+ block._parent._metadataLabels.push(name);
+ block._parent._metadatas[name] = block;
+ return offset$0;
+};
+
+var Block$_load$LOktavia$SSI = Block._load$LOktavia$SSI;
+
+/**
+ * @return {!string}
+ */
+Block.prototype._dump$ = function () {
+ return [ Binary$dump16bitNumber$I(3), Binary$dumpStringList$AS(this._names), Metadata.prototype._dump$.call(this) ].join('');
+};
+
+/**
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+Block.prototype._dump$LCompressionReport$ = function (report) {
+ CompressionReport$add$LCompressionReport$II(report, 1, 1);
+ return [ Binary$dump16bitNumber$I(3), Binary$dumpStringList$ASLCompressionReport$(this._names, report), Metadata.prototype._dump$LCompressionReport$.call(this, report) ].join('');
+};
+
+/**
+ * class FMIndex extends Object
+ * @constructor
+ */
+function FMIndex() {
+}
+
+/**
+ * @constructor
+ */
+function FMIndex$() {
+ /** @type {Array.<undefined|!number>} */
+ var _rlt$0;
+ this._ssize = 0;
+ (this._ddic = 0, this._head = 0);
+ this._substr = "";
+ this._sv = new WaveletMatrix$();
+ this._posdic = [ ];
+ this._idic = [ ];
+ _rlt$0 = this._rlt = [ ];
+ _rlt$0.length = 65536;
+};
+
+FMIndex$.prototype = new FMIndex;
+
+/**
+ */
+FMIndex.prototype.clear$ = function () {
+ /** @type {WaveletMatrix} */
+ var this$0;
+ this$0 = this._sv;
+ this$0._bv.length = 0;
+ this$0._seps.length = 0;
+ this$0._size = 0;
+ this._posdic.length = 0;
+ this._idic.length = 0;
+ this._ddic = 0;
+ this._head = 0;
+ this._substr = "";
+};
+
+/**
+ * @return {!number}
+ */
+FMIndex.prototype.size$ = function () {
+ /** @type {WaveletMatrix} */
+ var this$0;
+ this$0 = this._sv;
+ return this$0._size;
+};
+
+/**
+ * @return {!number}
+ */
+FMIndex.prototype.contentSize$ = function () {
+ return this._substr.length;
+};
+
+/**
+ * @param {!string} key
+ * @return {!number}
+ */
+FMIndex.prototype.getRows$S = function (key) {
+ /** @type {Array.<undefined|!number>} */
+ var pos;
+ pos = [ ];
+ return this.getRows$SAI(key, pos);
+};
+
+/**
+ * @param {!string} key
+ * @param {Array.<undefined|!number>} pos
+ * @return {!number}
+ */
+FMIndex.prototype.getRows$SAI = function (key, pos) {
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var code;
+ /** @type {!number} */
+ var first;
+ /** @type {undefined|!number} */
+ var last;
+ /** @type {!number} */
+ var c;
+ /** @type {Array.<undefined|!number>} */
+ var _rlt$0;
+ i = key.length - 1;
+ code = key.charCodeAt(i);
+ first = (_rlt$0 = this._rlt)[code] + 1;
+ last = _rlt$0[code + 1];
+ while (first <= last) {
+ if (i === 0) {
+ pos[0] = (-- first | 0);
+ pos[1] = -- last;
+ return (last - first + 1 | 0);
+ }
+ i--;
+ c = key.charCodeAt(i);
+ first = this._rlt[c] + this._sv.rank$II(first - 1, c) + 1;
+ last = this._rlt[c] + this._sv.rank$II(last, c);
+ }
+ return 0;
+};
+
+/**
+ * @param {!number} i
+ * @return {!number}
+ */
+FMIndex.prototype.getPosition$I = function (i) {
+ /** @type {!number} */
+ var pos;
+ /** @type {!number} */
+ var c;
+ if (i >= this.size$()) {
+ throw new Error("FMIndex.getPosition() : range error");
+ }
+ pos = 0;
+ while (i !== this._head) {
+ if (i % this._ddic === 0) {
+ pos += this._posdic[i / this._ddic] + 1;
+ break;
+ }
+ c = this._sv.get$I(i);
+ i = this._rlt[c] + this._sv.rank$II(i, c);
+ pos++;
+ }
+ return (pos % this.size$() | 0);
+};
+
+/**
+ * @param {!number} pos
+ * @param {!number} len
+ * @return {!string}
+ */
+FMIndex.prototype.getSubstring$II = function (pos, len) {
+ /** @type {!number} */
+ var pos_end;
+ /** @type {!number} */
+ var pos_tmp;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var pos_idic;
+ /** @type {!string} */
+ var substr;
+ /** @type {!number} */
+ var c;
+ /** @type {!number} */
+ var _ddic$0;
+ if (pos >= this.size$()) {
+ throw new Error("FMIndex.getSubstring() : range error");
+ }
+ pos_end = Math.min(pos + len, this.size$());
+ pos_tmp = this.size$() - 1;
+ i = this._head;
+ pos_idic = Math.floor((pos_end + (_ddic$0 = this._ddic) - 2) / _ddic$0);
+ if (pos_idic < this._idic.length) {
+ pos_tmp = pos_idic * this._ddic;
+ i = this._idic[pos_idic];
+ }
+ substr = "";
+ while (pos_tmp >= pos) {
+ c = this._sv.get$I(i);
+ i = this._rlt[c] + this._sv.rank$II(i, c);
+ if (pos_tmp < pos_end) {
+ substr = String.fromCharCode(c) + substr;
+ }
+ if (pos_tmp === 0) {
+ break;
+ }
+ pos_tmp--;
+ }
+ return substr;
+};
+
+/**
+ */
+FMIndex.prototype.build$ = function () {
+ this.build$SIIB(String.fromCharCode(0), 65535, 20, false);
+};
+
+/**
+ * @param {!string} end_marker
+ * @param {!number} ddic
+ * @param {!boolean} verbose
+ */
+FMIndex.prototype.build$SIB = function (end_marker, ddic, verbose) {
+ this.build$SIIB(end_marker, 65535, ddic, verbose);
+};
+
+/**
+ * @param {!string} end_marker
+ * @param {!number} maxChar
+ * @param {!number} ddic
+ * @param {!boolean} verbose
+ */
+FMIndex.prototype.build$SIIB = function (end_marker, maxChar, ddic, verbose) {
+ /** @type {BurrowsWheelerTransform} */
+ var b;
+ /** @type {!string} */
+ var s;
+ /** @type {!number} */
+ var c;
+ /** @type {!string} */
+ var str$0;
+ /** @type {WaveletMatrix} */
+ var this$0;
+ /** @type {!string} */
+ var _str$0;
+ /** @type {Array.<undefined|!number>} */
+ var _suffixarray$0;
+ if (verbose) {
+ console.time("building burrows-wheeler transform");
+ }
+ this._substr += end_marker;
+ b = ({_str: "", _size: 0, _head: 0, _suffixarray: [ ]});
+ str$0 = this._substr;
+ _str$0 = b._str = str$0;
+ b._size = _str$0.length;
+ _suffixarray$0 = b._suffixarray = SAIS$make$S(str$0);
+ b._head = (_suffixarray$0.indexOf(0) | 0);
+ s = BurrowsWheelerTransform$get$LBurrowsWheelerTransform$(b);
+ this._ssize = s.length;
+ this._head = b._head;
+ b._str = "";
+ b._size = 0;
+ b._head = 0;
+ b._suffixarray.length = 0;
+ this._substr = "";
+ if (verbose) {
+ console.timeEnd("building burrows-wheeler transform");
+ }
+ if (verbose) {
+ console.time("building wavelet matrix");
+ }
+ this$0 = this._sv;
+ this$0._bitsize = (Math.ceil(Math.log(maxChar) / 0.6931471805599453) | 0);
+ if (verbose) {
+ console.log(" maxCharCode: ", maxChar);
+ console.log(" bitSize: ", this._sv.bitsize$());
+ }
+ this._sv.build$S(s);
+ if (verbose) {
+ console.timeEnd("building wavelet matrix");
+ }
+ if (verbose) {
+ console.time("caching rank less than");
+ }
+ for (c = 0; c < maxChar; c++) {
+ this._rlt[c] = this._sv.rank_less_than$II(this._sv.size$(), c);
+ }
+ if (verbose) {
+ console.timeEnd("caching rank less than");
+ }
+ this._ddic = ddic;
+ if (verbose) {
+ console.time("building dictionaries");
+ }
+ this._buildDictionaries$();
+ if (verbose) {
+ console.timeEnd("building dictionaries");
+ console.log('');
+ }
+};
+
+/**
+ */
+FMIndex.prototype._buildDictionaries$ = function () {
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var pos;
+ /** @type {!number} */
+ var c;
+ for (i = 0; i < this._ssize / this._ddic + 1; i++) {
+ this._posdic.push(0);
+ this._idic.push(0);
+ }
+ i = this._head;
+ pos = this.size$() - 1;
+ do {
+ if (i % this._ddic === 0) {
+ this._posdic[Math.floor(i / this._ddic)] = (pos | 0);
+ }
+ if (pos % this._ddic === 0) {
+ this._idic[Math.floor(pos / this._ddic)] = (i | 0);
+ }
+ c = this._sv.get$I(i);
+ i = this._rlt[c] + this._sv.rank$II(i, c);
+ pos--;
+ } while (i !== this._head);
+};
+
+/**
+ * @param {!string} doc
+ */
+FMIndex.prototype.push$S = function (doc) {
+ if (doc.length <= 0) {
+ throw new Error("FMIndex::push(): empty string");
+ }
+ this._substr += doc;
+};
+
+/**
+ * @param {!string} keyword
+ * @return {Array.<undefined|!number>}
+ */
+FMIndex.prototype.search$S = function (keyword) {
+ /** @type {Array.<undefined|!number>} */
+ var result;
+ /** @type {Array.<undefined|!number>} */
+ var position;
+ /** @type {!number} */
+ var rows;
+ /** @type {undefined|!number} */
+ var first;
+ /** @type {undefined|!number} */
+ var last;
+ /** @type {undefined|!number} */
+ var i;
+ result = [ ];
+ position = [ ];
+ rows = this.getRows$SAI(keyword, position);
+ if (rows > 0) {
+ first = position[0];
+ last = position[1];
+ for (i = first; i <= last; i++) {
+ result.push(this.getPosition$I(i));
+ }
+ }
+ return result;
+};
+
+/**
+ * @return {!string}
+ */
+FMIndex.prototype.dump$ = function () {
+ return this.dump$B(false);
+};
+
+/**
+ * @param {!boolean} verbose
+ * @return {!string}
+ */
+FMIndex.prototype.dump$B = function (verbose) {
+ /** @type {Array.<undefined|!string>} */
+ var contents;
+ /** @type {CompressionReport} */
+ var report;
+ /** @type {!number} */
+ var i;
+ contents = [ ];
+ report = ({source: 0, result: 0});
+ contents.push(Binary$dump32bitNumber$N(this._ddic));
+ contents.push(Binary$dump32bitNumber$N(this._ssize));
+ contents.push(Binary$dump32bitNumber$N(this._head));
+ CompressionReport$add$LCompressionReport$II(report, 6, 6);
+ contents.push(this._sv.dump$LCompressionReport$(report));
+ if (verbose) {
+ console.log("Serializing FM-index");
+ console.log(' Wavelet Matrix: ' + (contents[3].length * 2 + "") + ' bytes (' + (Math.round(report.result * 100.0 / report.source) + "") + '%)');
+ }
+ contents.push(Binary$dump32bitNumber$N(this._posdic.length));
+ for (i in this._posdic) {
+ contents.push(Binary$dump32bitNumber$N(this._posdic[i]));
+ }
+ for (i in this._idic) {
+ contents.push(Binary$dump32bitNumber$N(this._idic[i]));
+ }
+ if (verbose) {
+ console.log(' Dictionary Cache: ' + (this._idic.length * 16 + "") + ' bytes');
+ }
+ return contents.join("");
+};
+
+/**
+ * @param {!string} data
+ * @return {!number}
+ */
+FMIndex.prototype.load$S = function (data) {
+ return this.load$SI(data, 0);
+};
+
+/**
+ * @param {!string} data
+ * @param {!number} offset
+ * @return {!number}
+ */
+FMIndex.prototype.load$SI = function (data, offset) {
+ /** @type {!number} */
+ var maxChar;
+ /** @type {!number} */
+ var c;
+ /** @type {!number} */
+ var size;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var result$0;
+ /** @type {!number} */
+ var result$1;
+ result$0 = data.charCodeAt(offset) * 65536 + data.charCodeAt(offset + 1);
+ this._ddic = (result$0 | 0);
+ this._ssize = (Binary$load32bitNumber$SI(data, offset + 2) | 0);
+ this._head = (Binary$load32bitNumber$SI(data, offset + 4) | 0);
+ offset = this._sv.load$SI(data, offset + 6);
+ maxChar = Math.pow(2, this._sv.bitsize$());
+ for (c = 0; c < maxChar; c++) {
+ this._rlt[c] = this._sv.rank_less_than$II(this._sv.size$(), c);
+ }
+ result$1 = data.charCodeAt(offset) * 65536 + data.charCodeAt(offset + 1);
+ size = result$1;
+ offset += 2;
+ for (i = 0; i < size; (i++, offset += 2)) {
+ this._posdic.push(Binary$load32bitNumber$SI(data, offset));
+ }
+ for (i = 0; i < size; (i++, offset += 2)) {
+ this._idic.push(Binary$load32bitNumber$SI(data, offset));
+ }
+ return offset;
+};
+
+/**
+ * class Tag extends Object
+ * @constructor
+ */
+function Tag() {
+}
+
+/**
+ * @constructor
+ * @param {!string} name
+ */
+function Tag$S(name) {
+ this.name = name;
+ this.attributes = ({ });
+ this.isSelfClosing = false;
+};
+
+Tag$S.prototype = new Tag;
+
+/**
+ * class _Common extends Object
+ * @constructor
+ */
+function _Common() {
+}
+
+/**
+ * @constructor
+ */
+function _Common$() {
+};
+
+_Common$.prototype = new _Common;
+
+/**
+ * class _State extends Object
+ * @constructor
+ */
+function _State() {
+}
+
+/**
+ * @constructor
+ */
+function _State$() {
+};
+
+_State$.prototype = new _State;
+
+/**
+ * class SAXHandler extends Object
+ * @constructor
+ */
+function SAXHandler() {
+}
+
+/**
+ * @constructor
+ */
+function SAXHandler$() {
+ this.position = 0;
+ this.column = 0;
+ this.line = 0;
+};
+
+SAXHandler$.prototype = new SAXHandler;
+
+/**
+ * @param {Error} error
+ */
+SAXHandler.prototype.onerror$LError$ = function (error) {
+};
+
+/**
+ * @param {!string} text
+ */
+SAXHandler.prototype.ontext$S = function (text) {
+};
+
+/**
+ * @param {!string} doctype
+ */
+SAXHandler.prototype.ondoctype$S = function (doctype) {
+};
+
+/**
+ * @param {!string} name
+ * @param {!string} body
+ */
+SAXHandler.prototype.onprocessinginstruction$SS = function (name, body) {
+};
+
+/**
+ * @param {!string} sgmlDecl
+ */
+SAXHandler.prototype.onsgmldeclaration$S = function (sgmlDecl) {
+};
+
+/**
+ * @param {!string} tagname
+ * @param {Object.<string, undefined|!string>} attributes
+ */
+SAXHandler.prototype.onopentag$SHS = function (tagname, attributes) {
+};
+
+/**
+ * @param {!string} tagname
+ */
+SAXHandler.prototype.onclosetag$S = function (tagname) {
+};
+
+/**
+ * @param {!string} name
+ * @param {!string} value
+ */
+SAXHandler.prototype.onattribute$SS = function (name, value) {
+};
+
+/**
+ * @param {!string} comment
+ */
+SAXHandler.prototype.oncomment$S = function (comment) {
+};
+
+/**
+ */
+SAXHandler.prototype.onopencdata$ = function () {
+};
+
+/**
+ * @param {!string} cdata
+ */
+SAXHandler.prototype.oncdata$S = function (cdata) {
+};
+
+/**
+ */
+SAXHandler.prototype.onclosecdata$ = function () {
+};
+
+/**
+ */
+SAXHandler.prototype.onend$ = function () {
+};
+
+/**
+ */
+SAXHandler.prototype.onready$ = function () {
+};
+
+/**
+ * @param {!string} script
+ */
+SAXHandler.prototype.onscript$S = function (script) {
+};
+
+/**
+ * class _HTMLHandler extends SAXHandler
+ * @constructor
+ */
+function _HTMLHandler() {
+}
+
+_HTMLHandler.prototype = new SAXHandler;
+/**
+ * @constructor
+ * @param {Object.<string, undefined|Array.<undefined|!string>>} styles
+ * @param {!boolean} escape
+ */
+function _HTMLHandler$HASB(styles, escape) {
+ this.position = 0;
+ this.column = 0;
+ this.line = 0;
+ this.text = [ ];
+ this.escape = escape;
+ this.styles = styles;
+};
+
+_HTMLHandler$HASB.prototype = new _HTMLHandler;
+
+/**
+ * @param {!string} str
+ * @return {!string}
+ */
+_HTMLHandler.escapeHTML$S = function (str) {
+ return str.replace(/\n/g, "<br/>").replace(/&/g, "&amp;").replace(/"/g, "&quot;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
+};
+
+var _HTMLHandler$escapeHTML$S = _HTMLHandler.escapeHTML$S;
+
+/**
+ * @param {!string} tagname
+ * @param {Object.<string, undefined|!string>} attributes
+ */
+_HTMLHandler.prototype.onopentag$SHS = function (tagname, attributes) {
+ this.text.push(this.styles[tagname][0]);
+};
+
+/**
+ * @param {!string} tagname
+ */
+_HTMLHandler.prototype.onclosetag$S = function (tagname) {
+ this.text.push(this.styles[tagname][1]);
+};
+
+/**
+ * @param {!string} text
+ */
+_HTMLHandler.prototype.ontext$S = function (text) {
+ if (this.escape) {
+ this.text.push(text.replace(/\n/g, "<br/>").replace(/&/g, "&amp;").replace(/"/g, "&quot;").replace(/</g, "&lt;").replace(/>/g, "&gt;"));
+ } else {
+ this.text.push(text);
+ }
+};
+
+/**
+ * @return {!string}
+ */
+_HTMLHandler.prototype.result$ = function () {
+ return this.text.join('');
+};
+
+/**
+ * class SAXParser extends Object
+ * @constructor
+ */
+function SAXParser() {
+}
+
+/**
+ * @constructor
+ * @param {SAXHandler} handler
+ */
+function SAXParser$LSAXHandler$(handler) {
+ this.q = "";
+ this.c = "";
+ this.bufferCheckPosition = 0;
+ this.looseCase = "";
+ this.tags = [ ];
+ this.closed = false;
+ this.closedRoot = false;
+ this.sawRoot = false;
+ this.tag = null;
+ this.error = null;
+ this.handler = null;
+ this.ENTITIES = null;
+ this.strict = false;
+ this.tagName = "";
+ this.state = 0;
+ this.line = 0;
+ this.column = 0;
+ this.position = 0;
+ this.startTagPosition = 0;
+ this.attribName = "";
+ this.attribValue = "";
+ this.script = "";
+ this.textNode = "";
+ this.attribList = null;
+ this.noscript = false;
+ this.cdata = "";
+ this.procInstBody = "";
+ this.procInstName = "";
+ this.doctype = "";
+ this.entity = "";
+ this.sgmlDecl = "";
+ this.comment = "";
+ this.preTags = 0;
+ this._init$LSAXHandler$B(handler, false);
+};
+
+SAXParser$LSAXHandler$.prototype = new SAXParser;
+
+/**
+ * @constructor
+ * @param {SAXHandler} handler
+ * @param {!boolean} strict
+ */
+function SAXParser$LSAXHandler$B(handler, strict) {
+ this.q = "";
+ this.c = "";
+ this.bufferCheckPosition = 0;
+ this.looseCase = "";
+ this.tags = [ ];
+ this.closed = false;
+ this.closedRoot = false;
+ this.sawRoot = false;
+ this.tag = null;
+ this.error = null;
+ this.handler = null;
+ this.ENTITIES = null;
+ this.strict = false;
+ this.tagName = "";
+ this.state = 0;
+ this.line = 0;
+ this.column = 0;
+ this.position = 0;
+ this.startTagPosition = 0;
+ this.attribName = "";
+ this.attribValue = "";
+ this.script = "";
+ this.textNode = "";
+ this.attribList = null;
+ this.noscript = false;
+ this.cdata = "";
+ this.procInstBody = "";
+ this.procInstName = "";
+ this.doctype = "";
+ this.entity = "";
+ this.sgmlDecl = "";
+ this.comment = "";
+ this.preTags = 0;
+ this._init$LSAXHandler$B(handler, strict);
+};
+
+SAXParser$LSAXHandler$B.prototype = new SAXParser;
+
+/**
+ * @param {SAXHandler} handler
+ * @param {!boolean} strict
+ */
+SAXParser.prototype._init$LSAXHandler$B = function (handler, strict) {
+ this.handler = handler;
+ this.clearBuffers$();
+ this.q = "";
+ this.bufferCheckPosition = 65536;
+ this.looseCase = 'toLowerCase';
+ this.tags = [ ];
+ this.closed = this.closedRoot = this.sawRoot = false;
+ this.tag = null;
+ this.error = null;
+ this.strict = strict;
+ this.noscript = strict;
+ this.state = 1;
+ this.ENTITIES = _Entities$entity_list$();
+ this.attribList = [ ];
+ this.noscript = false;
+ this.preTags = 0;
+};
+
+/**
+ * @param {!boolean} flag
+ */
+SAXParser.prototype.set_noscript$B = function (flag) {
+ this.noscript = flag;
+};
+
+/**
+ * @return {SAXParser}
+ */
+SAXParser.prototype.resume$ = function () {
+ this.error = null;
+ return this;
+};
+
+/**
+ * @return {SAXParser}
+ */
+SAXParser.prototype.close$ = function () {
+ return this.parse$S('');
+};
+
+/**
+ * @param {!string} chunk
+ * @return {SAXParser}
+ */
+SAXParser.prototype.parse$S = function (chunk) {
+ /** @type {Char} */
+ var _;
+ /** @type {!number} */
+ var i;
+ /** @type {!string} */
+ var c;
+ /** @type {!number} */
+ var starti;
+ /** @type {!number} */
+ var pad;
+ /** @type {!number} */
+ var returnState;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$0;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$1;
+ /** @type {RegExp} */
+ var charclass$2;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$3;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$4;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$5;
+ /** @type {!string} */
+ var text$0;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$6;
+ /** @type {RegExp} */
+ var charclass$7;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$8;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$9;
+ /** @type {RegExp} */
+ var charclass$10;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$11;
+ /** @type {RegExp} */
+ var charclass$12;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$13;
+ /** @type {RegExp} */
+ var charclass$14;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$15;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$16;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$17;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$18;
+ /** @type {RegExp} */
+ var charclass$19;
+ /** @type {RegExp} */
+ var charclass$20;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$21;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$22;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$23;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$24;
+ /** @type {!string} */
+ var comment$0;
+ _ = new Char$();
+ if (this.error) {
+ throw this.error;
+ }
+ if (this.closed) {
+ return this.emiterror$S("Cannot write after close. Assign an onready handler.");
+ }
+ (i = 0, c = "");
+ while (this.c = c = chunk.charAt(i++)) {
+ this.position++;
+ if (c === "\n") {
+ this.handler.line++;
+ this.handler.column = 0;
+ } else {
+ this.handler.column++;
+ }
+ switch (this.state) {
+ case 1:
+ if (c === "<") {
+ this.state = 4;
+ this.startTagPosition = this.position;
+ } else {
+ charclass$0 = _.whitespace;
+ if (! $__jsx_ObjectHasOwnProperty.call(charclass$0, c)) {
+ this.strictFail$S("Non-whitespace before first tag.");
+ this.textNode = c;
+ this.state = 2;
+ }
+ }
+ continue;
+ case 2:
+ if (this.sawRoot && ! this.closedRoot) {
+ starti = i - 1;
+ while (c && c !== "<" && c !== "&") {
+ c = chunk.charAt(i++);
+ if (c) {
+ this.position++;
+ if (c === "\n") {
+ this.handler.line++;
+ this.handler.column = 0;
+ } else {
+ this.handler.column++;
+ }
+ }
+ }
+ this.textNode += chunk.substring(starti, i - 1);
+ }
+ if (c === "<") {
+ this.state = 4;
+ this.startTagPosition = this.position;
+ } else {
+ if (_.not$HBS(_.whitespace, c) && (! this.sawRoot || this.closedRoot)) {
+ this.strictFail$S("Text data outside of root node.");
+ }
+ if (c === "&") {
+ this.state = 3;
+ } else {
+ this.textNode += c;
+ }
+ }
+ continue;
+ case 33:
+ if (c === "<") {
+ this.state = 34;
+ } else {
+ this.script += c;
+ }
+ continue;
+ case 34:
+ if (c === "/") {
+ this.state = 31;
+ } else {
+ this.script += "<" + c;
+ this.state = 33;
+ }
+ continue;
+ case 4:
+ if (c === "!") {
+ this.state = 5;
+ this.sgmlDecl = "";
+ } else {
+ charclass$1 = _.whitespace;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$1, c)) {
+ } else {
+ charclass$2 = _.nameStart;
+ if (charclass$2.test(c)) {
+ this.state = 21;
+ this.tagName = c;
+ } else {
+ if (c === "/") {
+ this.state = 31;
+ this.tagName = "";
+ } else {
+ if (c === "?") {
+ this.state = 18;
+ this.procInstName = this.procInstBody = "";
+ } else {
+ this.strictFail$S("Unencoded <");
+ if (this.startTagPosition + 1 < this.position) {
+ pad = this.position - this.startTagPosition;
+ for (i = 0; i < pad; i++) {
+ c = " " + c;
+ }
+ }
+ this.textNode += "<" + c;
+ this.state = 2;
+ }
+ }
+ }
+ }
+ }
+ continue;
+ case 5:
+ if ((this.sgmlDecl + c).toUpperCase() === _.CDATA) {
+ this.closetext_if_exist$();
+ this.state = 15;
+ this.sgmlDecl = "";
+ this.cdata = "";
+ } else {
+ if (this.sgmlDecl + c === "--") {
+ this.state = 12;
+ this.comment = "";
+ this.sgmlDecl = "";
+ } else {
+ if ((this.sgmlDecl + c).toUpperCase() === _.DOCTYPE) {
+ this.state = 7;
+ if (this.doctype || this.sawRoot) {
+ this.strictFail$S("Inappropriately located doctype declaration");
+ }
+ this.doctype = "";
+ this.sgmlDecl = "";
+ } else {
+ if (c === ">") {
+ this.closetext_if_exist$();
+ this.sgmlDecl = "";
+ this.state = 2;
+ } else {
+ charclass$3 = _.quote;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$3, c)) {
+ this.state = 6;
+ this.sgmlDecl += c;
+ } else {
+ this.sgmlDecl += c;
+ }
+ }
+ }
+ }
+ }
+ continue;
+ case 6:
+ if (c === this.q) {
+ this.state = 5;
+ this.q = "";
+ }
+ this.sgmlDecl += c;
+ continue;
+ case 7:
+ if (c === ">") {
+ this.state = 2;
+ this.closetext_if_exist$();
+ this.doctype.trim();
+ } else {
+ this.doctype += c;
+ if (c === "[") {
+ this.state = 9;
+ } else {
+ charclass$4 = _.quote;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$4, c)) {
+ this.state = 8;
+ this.q = c;
+ }
+ }
+ }
+ continue;
+ case 8:
+ this.doctype += c;
+ if (c === this.q) {
+ this.q = "";
+ this.state = 7;
+ }
+ continue;
+ case 9:
+ this.doctype += c;
+ if (c === "]") {
+ this.state = 7;
+ } else {
+ charclass$5 = _.quote;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$5, c)) {
+ this.state = 10;
+ this.q = c;
+ }
+ }
+ continue;
+ case 10:
+ this.doctype += c;
+ if (c === this.q) {
+ this.state = 9;
+ this.q = "";
+ }
+ continue;
+ case 12:
+ if (c === "-") {
+ this.state = 13;
+ } else {
+ this.comment += c;
+ }
+ continue;
+ case 13:
+ if (c === "-") {
+ this.state = 14;
+ text$0 = this.comment;
+ text$0 = text$0.replace(/[\n\t]/g, ' ');
+ text$0 = text$0.replace(/\s\s+/g, " ");
+ comment$0 = this.comment = text$0;
+ if (comment$0) {
+ this.closetext_if_exist$();
+ this.comment.trim();
+ }
+ this.comment = "";
+ } else {
+ this.comment += "-" + c;
+ this.state = 12;
+ }
+ continue;
+ case 14:
+ if (c !== ">") {
+ this.strictFail$S("Malformed comment");
+ this.comment += "--" + c;
+ this.state = 12;
+ } else {
+ this.state = 2;
+ }
+ continue;
+ case 15:
+ if (c === "]") {
+ this.state = 16;
+ } else {
+ this.cdata += c;
+ }
+ continue;
+ case 16:
+ if (c === "]") {
+ this.state = 17;
+ } else {
+ this.cdata += "]" + c;
+ this.state = 15;
+ }
+ continue;
+ case 17:
+ if (c === ">") {
+ if (this.cdata) {
+ this.closetext_if_exist$();
+ }
+ this.cdata = "";
+ this.state = 2;
+ } else {
+ if (c === "]") {
+ this.cdata += "]";
+ } else {
+ this.cdata += "]]" + c;
+ this.state = 15;
+ }
+ }
+ continue;
+ case 18:
+ if (c === "?") {
+ this.state = 20;
+ } else {
+ charclass$6 = _.whitespace;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$6, c)) {
+ this.state = 19;
+ } else {
+ this.procInstName += c;
+ }
+ }
+ continue;
+ case 19:
+ if (! this.procInstBody && _.is$HBS(_.whitespace, c)) {
+ continue;
+ } else {
+ if (c === "?") {
+ this.state = 20;
+ } else {
+ this.procInstBody += c;
+ }
+ }
+ continue;
+ case 20:
+ if (c === ">") {
+ this.closetext_if_exist$();
+ this.procInstName = this.procInstBody = "";
+ this.state = 2;
+ } else {
+ this.procInstBody += "?" + c;
+ this.state = 19;
+ }
+ continue;
+ case 21:
+ charclass$7 = _.nameBody;
+ if (charclass$7.test(c)) {
+ this.tagName += c;
+ } else {
+ this.newTag$();
+ if (c === ">") {
+ this.openTag$B(false);
+ } else {
+ if (c === "/") {
+ this.state = 22;
+ } else {
+ charclass$8 = _.whitespace;
+ if (! $__jsx_ObjectHasOwnProperty.call(charclass$8, c)) {
+ this.strictFail$S("Invalid character in tag name");
+ }
+ this.state = 23;
+ }
+ }
+ }
+ continue;
+ case 22:
+ if (c === ">") {
+ this.openTag$B(true);
+ this.closeTag$();
+ } else {
+ this.strictFail$S("Forward-slash in opening tag not followed by >");
+ this.state = 23;
+ }
+ continue;
+ case 23:
+ charclass$9 = _.whitespace;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$9, c)) {
+ continue;
+ } else {
+ if (c === ">") {
+ this.openTag$B(false);
+ } else {
+ if (c === "/") {
+ this.state = 22;
+ } else {
+ charclass$10 = _.nameStart;
+ if (charclass$10.test(c)) {
+ this.attribName = c;
+ this.attribValue = "";
+ this.state = 24;
+ } else {
+ this.strictFail$S("Invalid attribute name");
+ }
+ }
+ }
+ }
+ continue;
+ case 24:
+ if (c === "=") {
+ this.state = 26;
+ } else {
+ if (c === ">") {
+ this.strictFail$S("Attribute without value");
+ this.attribValue = this.attribName;
+ this.attrib$();
+ this.openTag$B(false);
+ } else {
+ charclass$11 = _.whitespace;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$11, c)) {
+ this.state = 25;
+ } else {
+ charclass$12 = _.nameBody;
+ if (charclass$12.test(c)) {
+ this.attribName += c;
+ } else {
+ this.strictFail$S("Invalid attribute name");
+ }
+ }
+ }
+ }
+ continue;
+ case 25:
+ if (c === "=") {
+ this.state = 26;
+ } else {
+ charclass$13 = _.whitespace;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$13, c)) {
+ continue;
+ } else {
+ this.strictFail$S("Attribute without value");
+ this.tag.attributes[this.attribName] = "";
+ this.attribValue = "";
+ this.closetext_if_exist$();
+ this.attribName = "";
+ if (c === ">") {
+ this.openTag$B(false);
+ } else {
+ charclass$14 = _.nameStart;
+ if (charclass$14.test(c)) {
+ this.attribName = c;
+ this.state = 24;
+ } else {
+ this.strictFail$S("Invalid attribute name");
+ this.state = 23;
+ }
+ }
+ }
+ }
+ continue;
+ case 26:
+ charclass$15 = _.whitespace;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$15, c)) {
+ continue;
+ } else {
+ charclass$16 = _.quote;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$16, c)) {
+ this.q = c;
+ this.state = 27;
+ } else {
+ this.strictFail$S("Unquoted attribute value");
+ this.state = 28;
+ this.attribValue = c;
+ }
+ }
+ continue;
+ case 27:
+ if (c !== this.q) {
+ if (c === "&") {
+ this.state = 29;
+ } else {
+ this.attribValue += c;
+ }
+ continue;
+ }
+ this.attrib$();
+ this.q = "";
+ this.state = 23;
+ continue;
+ case 28:
+ charclass$17 = _.attribEnd;
+ if (! $__jsx_ObjectHasOwnProperty.call(charclass$17, c)) {
+ if (c === "&") {
+ this.state = 30;
+ } else {
+ this.attribValue += c;
+ }
+ continue;
+ }
+ this.attrib$();
+ if (c === ">") {
+ this.openTag$B(false);
+ } else {
+ this.state = 23;
+ }
+ continue;
+ case 31:
+ if (! this.tagName) {
+ charclass$18 = _.whitespace;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$18, c)) {
+ continue;
+ } else {
+ charclass$19 = _.nameStart;
+ if (! charclass$19.test(c)) {
+ if (this.script) {
+ this.script += "</" + c;
+ this.state = 33;
+ } else {
+ this.strictFail$S("Invalid tagname in closing tag.");
+ }
+ } else {
+ this.tagName = c;
+ }
+ }
+ } else {
+ if (c === ">") {
+ this.closeTag$();
+ } else {
+ charclass$20 = _.nameBody;
+ if (charclass$20.test(c)) {
+ this.tagName += c;
+ } else {
+ if (this.script) {
+ this.script += "</" + this.tagName;
+ this.tagName = "";
+ this.state = 33;
+ } else {
+ charclass$21 = _.whitespace;
+ if (! $__jsx_ObjectHasOwnProperty.call(charclass$21, c)) {
+ this.strictFail$S("Invalid tagname in closing tag");
+ }
+ this.state = 32;
+ }
+ }
+ }
+ }
+ continue;
+ case 32:
+ charclass$22 = _.whitespace;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$22, c)) {
+ continue;
+ }
+ if (c === ">") {
+ this.closeTag$();
+ } else {
+ this.strictFail$S("Invalid characters in closing tag");
+ }
+ continue;
+ case 3:
+ if (c === ";") {
+ this.textNode += this.parseEntity$();
+ this.entity = "";
+ this.state = 2;
+ } else {
+ charclass$23 = _.entity;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$23, c)) {
+ this.entity += c;
+ } else {
+ this.strictFail$S("Invalid character entity");
+ this.textNode += "&" + this.entity + c;
+ this.entity = "";
+ this.state = 2;
+ }
+ }
+ continue;
+ case 29:
+ case 30:
+ if (this.state === 29) {
+ returnState = 27;
+ } else {
+ returnState = 28;
+ }
+ if (c === ";") {
+ this.attribValue += this.parseEntity$();
+ this.entity = "";
+ this.state = (returnState | 0);
+ } else {
+ charclass$24 = _.entity;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$24, c)) {
+ this.entity += c;
+ } else {
+ this.strictFail$S("Invalid character entity");
+ this.attribValue += "&" + this.entity + c;
+ this.entity = "";
+ this.state = (returnState | 0);
+ }
+ }
+ continue;
+ default:
+ throw new Error("Unknown state: " + (this.state + ""));
+ }
+ }
+ this.end$();
+ return this;
+};
+
+/**
+ */
+SAXParser.prototype.clearBuffers$ = function () {
+ this.comment = '';
+ this.sgmlDecl = '';
+ this.textNode = '';
+ this.tagName = '';
+ this.doctype = '';
+ this.procInstName = '';
+ this.procInstBody = '';
+ this.entity = '';
+ this.attribName = '';
+ this.attribValue = '';
+ this.cdata = '';
+ this.script = '';
+};
+
+/**
+ */
+SAXParser.prototype.closetext_if_exist$ = function () {
+ if (this.textNode !== '') {
+ this.closetext$();
+ }
+};
+
+/**
+ */
+SAXParser.prototype.closetext$ = function () {
+ /** @type {!string} */
+ var text;
+ /** @type {!string} */
+ var text$0;
+ if (this.preTags === 0) {
+ text$0 = this.textNode;
+ text$0 = text$0.replace(/[\n\t]/g, ' ');
+ text$0 = text$0.replace(/\s\s+/g, " ");
+ text = text$0;
+ if (text$0) {
+ this.handler.ontext$S(text);
+ }
+ } else {
+ if (this.textNode) {
+ this.handler.ontext$S(this.textNode);
+ }
+ }
+ this.textNode = "";
+};
+
+/**
+ * @param {!string} text
+ * @return {!string}
+ */
+SAXParser.prototype.textopts$S = function (text) {
+ text = text.replace(/[\n\t]/g, ' ');
+ text = text.replace(/\s\s+/g, " ");
+ return text;
+};
+
+/**
+ * @param {!string} er
+ * @return {SAXParser}
+ */
+SAXParser.prototype.emiterror$S = function (er) {
+ /** @type {Error} */
+ var error;
+ this.closetext$();
+ er += "\nLine: " + (this.line + "") + "\nColumn: " + (this.column + "") + "\nChar: " + this.c;
+ error = new Error(er);
+ this.error = error;
+ return this;
+};
+
+/**
+ */
+SAXParser.prototype.end$ = function () {
+ if (! this.closedRoot) {
+ this.strictFail$S("Unclosed root tag");
+ }
+ if (this.state !== 2) {
+ this.emiterror$S("Unexpected end");
+ }
+ this.closetext$();
+ this.c = "";
+ this.closed = true;
+};
+
+/**
+ * @param {!string} message
+ */
+SAXParser.prototype.strictFail$S = function (message) {
+ if (this.strict) {
+ this.emiterror$S(message);
+ }
+};
+
+/**
+ */
+SAXParser.prototype.newTag$ = function () {
+ if (! this.strict) {
+ this.tagName = this.tagName.toLowerCase();
+ }
+ this.tag = ({name: this.tagName, attributes: ({ }), isSelfClosing: false});
+ this.attribList.length = 0;
+};
+
+/**
+ */
+SAXParser.prototype.attrib$ = function () {
+ if (! this.strict) {
+ this.attribName = this.attribName.toLowerCase();
+ }
+ if ($__jsx_ObjectHasOwnProperty.call(this.tag.attributes, this.attribName)) {
+ this.attribName = this.attribValue = "";
+ return;
+ }
+ this.tag.attributes[this.attribName] = this.attribValue;
+ this.closetext_if_exist$();
+ this.attribName = this.attribValue = "";
+};
+
+/**
+ */
+SAXParser.prototype.openTag$ = function () {
+ this.openTag$B(false);
+};
+
+/**
+ * @param {!boolean} selfClosing
+ */
+SAXParser.prototype.openTag$B = function (selfClosing) {
+ /** @type {Tag} */
+ var tag$0;
+ /** @type {Tag} */
+ var tag$1;
+ (tag$0 = this.tag).isSelfClosing = selfClosing;
+ this.sawRoot = true;
+ this.tags.push(tag$0);
+ this.closetext_if_exist$();
+ this.handler.onopentag$SHS((tag$1 = this.tag).name, tag$1.attributes);
+ if (this.tag.name === 'pre') {
+ this.preTags++;
+ }
+ if (! selfClosing) {
+ if (! this.noscript && this.tagName.toLowerCase() === "script") {
+ this.state = 33;
+ } else {
+ this.state = 2;
+ }
+ this.tag = null;
+ this.tagName = "";
+ }
+ this.attribName = this.attribValue = "";
+ this.attribList.length = 0;
+};
+
+/**
+ */
+SAXParser.prototype.closeTag$ = function () {
+ /** @type {!number} */
+ var t;
+ /** @type {!string} */
+ var tagName;
+ /** @type {!string} */
+ var closeTo;
+ /** @type {Tag} */
+ var close;
+ /** @type {!number} */
+ var s;
+ /** @type {Tag} */
+ var tag$0;
+ if (! this.tagName) {
+ this.strictFail$S("Weird empty close tag.");
+ this.textNode += "</>";
+ this.state = 2;
+ return;
+ }
+ if (this.script) {
+ if (this.tagName !== "script") {
+ this.script += "</" + this.tagName + ">";
+ this.tagName = "";
+ this.state = 33;
+ return;
+ }
+ this.closetext_if_exist$();
+ this.script = "";
+ }
+ t = this.tags.length;
+ tagName = this.tagName;
+ if (! this.strict) {
+ tagName = tagName.toLowerCase();
+ }
+ closeTo = tagName;
+ while (t--) {
+ close = this.tags[t];
+ if (close.name !== closeTo) {
+ this.strictFail$S("Unexpected close tag");
+ } else {
+ break;
+ }
+ }
+ if (t < 0) {
+ this.strictFail$S("Unmatched closing tag: " + this.tagName);
+ this.textNode += "</" + this.tagName + ">";
+ this.state = 2;
+ return;
+ }
+ this.tagName = tagName;
+ s = this.tags.length;
+ while (s-- > t) {
+ tag$0 = this.tag = this.tags.pop();
+ this.tagName = tag$0.name;
+ this.closetext_if_exist$();
+ this.handler.onclosetag$S(this.tagName);
+ if (this.tagName === 'pre') {
+ this.preTags--;
+ }
+ }
+ if (t === 0) {
+ this.closedRoot = true;
+ }
+ this.tagName = this.attribValue = this.attribName = "";
+ this.attribList.length = 0;
+ this.state = 2;
+};
+
+/**
+ * @return {!string}
+ */
+SAXParser.prototype.parseEntity$ = function () {
+ /** @type {!string} */
+ var entity;
+ /** @type {!string} */
+ var entityLC;
+ /** @type {!number} */
+ var num;
+ /** @type {!string} */
+ var numStr;
+ entity = this.entity;
+ entityLC = entity.toLowerCase();
+ num = 0;
+ numStr = "";
+ if (this.ENTITIES[entity]) {
+ return this.ENTITIES[entity];
+ }
+ if (this.ENTITIES[entityLC]) {
+ return this.ENTITIES[entityLC];
+ }
+ entity = entityLC;
+ if (entityLC.charAt(0) === "#") {
+ if (entity.charAt(1) === "x") {
+ entity = entity.slice(2);
+ num = $__jsx_parseInt(entity, 16);
+ numStr = num.toString(16);
+ } else {
+ entity = entity.slice(1);
+ num = $__jsx_parseInt(entity, 10);
+ numStr = num.toString(10);
+ }
+ }
+ entity = entity.replace(/^0+/, "");
+ if (numStr.toLowerCase() !== entity) {
+ this.strictFail$S("Invalid character entity");
+ return "&" + this.entity + ";";
+ }
+ return String.fromCharCode(num);
+};
+
+/**
+ * class Char extends Object
+ * @constructor
+ */
+function Char() {
+}
+
+/**
+ * @constructor
+ */
+function Char$() {
+ this.CDATA = "[CDATA[";
+ this.DOCTYPE = "DOCTYPE";
+ this.XML_NAMESPACE = "http://www.w3.org/XML/1998/namespace";
+ this.whitespace = this._charClass$S("\r\n\t ");
+ this.number = this._charClass$S("0124356789");
+ this.letter = this._charClass$S("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ");
+ this.quote = this._charClass$S("'\"");
+ this.entity = this._charClass$S("0124356789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ#");
+ this.attribEnd = this._charClass$S("\r\n\t >");
+ this.nameStart = /[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/;
+ this.nameBody = /[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040\.\d-]/;
+};
+
+Char$.prototype = new Char;
+
+/**
+ * @param {!string} str
+ * @return {Object.<string, undefined|!boolean>}
+ */
+Char.prototype._charClass$S = function (str) {
+ /** @type {Object.<string, undefined|!boolean>} */
+ var result;
+ /** @type {!number} */
+ var i;
+ result = ({ });
+ for (i = 0; i < str.length; i++) {
+ result[str.slice(i, i + 1)] = true;
+ }
+ return result;
+};
+
+/**
+ * @param {RegExp} charclass
+ * @param {!string} c
+ * @return {!boolean}
+ */
+Char.prototype.is$LRegExp$S = function (charclass, c) {
+ return charclass.test(c);
+};
+
+/**
+ * @param {Object.<string, undefined|!boolean>} charclass
+ * @param {!string} c
+ * @return {!boolean}
+ */
+Char.prototype.is$HBS = function (charclass, c) {
+ return $__jsx_ObjectHasOwnProperty.call(charclass, c);
+};
+
+/**
+ * @param {RegExp} charclass
+ * @param {!string} c
+ * @return {!boolean}
+ */
+Char.prototype.not$LRegExp$S = function (charclass, c) {
+ return ! charclass.test(c);
+};
+
+/**
+ * @param {Object.<string, undefined|!boolean>} charclass
+ * @param {!string} c
+ * @return {!boolean}
+ */
+Char.prototype.not$HBS = function (charclass, c) {
+ return ! $__jsx_ObjectHasOwnProperty.call(charclass, c);
+};
+
+/**
+ * class _Entities extends Object
+ * @constructor
+ */
+function _Entities() {
+}
+
+/**
+ * @constructor
+ */
+function _Entities$() {
+};
+
+_Entities$.prototype = new _Entities;
+
+/**
+ * @return {Object.<string, undefined|!string>}
+ */
+_Entities.entity_list$ = function () {
+ /** @type {Object.<string, undefined|!string>} */
+ var result;
+ /** @type {!string} */
+ var key;
+ /** @type {*} */
+ var value;
+ result = ({ });
+ for (key in _Entities._entities) {
+ value = _Entities._entities[key];
+ if (typeof value === 'string') {
+ result[key] = value + "";
+ } else {
+ if (typeof value === 'number') {
+ result[key] = String.fromCharCode(value | 0);
+ }
+ }
+ }
+ return result;
+};
+
+var _Entities$entity_list$ = _Entities.entity_list$;
+
+/**
+ * class BitVector extends Object
+ * @constructor
+ */
+function BitVector() {
+}
+
+/**
+ * @constructor
+ */
+function BitVector$() {
+ /** @type {Array.<undefined|!number>} */
+ var _v$0;
+ /** @type {Array.<undefined|!number>} */
+ var _r$0;
+ _r$0 = this._r = [ ];
+ _v$0 = this._v = [ ];
+ _v$0.length = 0;
+ _r$0.length = 0;
+ this._size = 0;
+ this._size1 = 0;
+};
+
+BitVector$.prototype = new BitVector;
+
+/**
+ */
+BitVector.prototype.build$ = function () {
+ /** @type {!number} */
+ var i;
+ this._size1 = 0;
+ for (i = 0; i < this._v.length; i++) {
+ if (i % 8 === 0) {
+ this._r.push(true ? this._size1 : this._size - this._size1);
+ }
+ this._size1 += this._rank32$IIB(this._v[i], 32, true);
+ }
+};
+
+/**
+ */
+BitVector.prototype.clear$ = function () {
+ this._v.length = 0;
+ this._r.length = 0;
+ this._size = 0;
+ this._size1 = 0;
+};
+
+/**
+ * @return {!number}
+ */
+BitVector.prototype.size$ = function () {
+ return this._size;
+};
+
+/**
+ * @param {!boolean} b
+ * @return {!number}
+ */
+BitVector.prototype.size$B = function (b) {
+ return (b ? this._size1 : this._size - this._size1);
+};
+
+/**
+ * @param {!number} value
+ */
+BitVector.prototype.set$I = function (value) {
+ this.set$IB(value, true);
+};
+
+/**
+ * @param {!number} value
+ * @param {!boolean} flag
+ */
+BitVector.prototype.set$IB = function (value, flag) {
+ /** @type {!number} */
+ var q;
+ /** @type {!number} */
+ var r;
+ /** @type {!number} */
+ var m;
+ if (value >= this._size) {
+ this._size = (value + 1 | 0);
+ }
+ q = (value / 32 | 0);
+ r = (value % 32 | 0);
+ while (q >= this._v.length) {
+ this._v.push(0);
+ }
+ m = 0x1 << r;
+ if (flag) {
+ this._v[q] |= m;
+ } else {
+ this._v[q] &= ~ m;
+ }
+};
+
+/**
+ * @param {!number} value
+ * @return {!boolean}
+ */
+BitVector.prototype.get$I = function (value) {
+ /** @type {!number} */
+ var q;
+ /** @type {!number} */
+ var r;
+ /** @type {!number} */
+ var m;
+ if (value >= this._size) {
+ throw new Error("BitVector.get() : range error");
+ }
+ q = (value / 32 | 0);
+ r = (value % 32 | 0);
+ m = 0x1 << r;
+ return !! (this._v[q] & m);
+};
+
+/**
+ * @param {!number} i
+ * @return {!number}
+ */
+BitVector.prototype.rank$I = function (i) {
+ return this.rank$IB(i, true);
+};
+
+/**
+ * @param {!number} i
+ * @param {!boolean} b
+ * @return {!number}
+ */
+BitVector.prototype.rank$IB = function (i, b) {
+ /** @type {!number} */
+ var q_large;
+ /** @type {!number} */
+ var q_small;
+ /** @type {!number} */
+ var r;
+ /** @type {!number} */
+ var rank;
+ /** @type {!number} */
+ var begin;
+ /** @type {!number} */
+ var j;
+ if (i > this._size) {
+ throw new Error("BitVector.rank() : range error");
+ }
+ if (i === 0) {
+ return 0;
+ }
+ i--;
+ q_large = (Math.floor(i / 256) | 0);
+ q_small = (Math.floor(i / 32) | 0);
+ r = (Math.floor(i % 32) | 0);
+ rank = (this._r[q_large] | 0);
+ if (! b) {
+ rank = q_large * 256 - rank;
+ }
+ begin = q_large * 8;
+ for (j = begin; j < q_small; j++) {
+ rank += this._rank32$IIB(this._v[j], 32, b);
+ }
+ rank += this._rank32$IIB(this._v[q_small], r + 1, b);
+ return rank;
+};
+
+/**
+ * @param {!number} i
+ * @return {!number}
+ */
+BitVector.prototype.select$I = function (i) {
+ return this.select$IB(i, true);
+};
+
+/**
+ * @param {!number} i
+ * @param {!boolean} b
+ * @return {!number}
+ */
+BitVector.prototype.select$IB = function (i, b) {
+ /** @type {!number} */
+ var left;
+ /** @type {!number} */
+ var right;
+ /** @type {!number} */
+ var pivot;
+ /** @type {undefined|!number} */
+ var rank;
+ /** @type {!number} */
+ var j;
+ if (i >= (b ? this._size1 : this._size - this._size1)) {
+ throw new Error("BitVector.select() : range error");
+ }
+ left = 0;
+ right = this._r.length;
+ while (left < right) {
+ pivot = Math.floor((left + right) / 2);
+ rank = this._r[pivot];
+ if (! b) {
+ rank = pivot * 256 - rank;
+ }
+ if (i < rank) {
+ right = pivot;
+ } else {
+ left = pivot + 1;
+ }
+ }
+ right--;
+ if (b) {
+ i -= (this._r[right] | 0);
+ } else {
+ i -= (right * 256 - this._r[right] | 0);
+ }
+ j = right * 8;
+ while (1) {
+ rank = this._rank32$IIB(this._v[j], 32, b);
+ if (i < rank) {
+ break;
+ }
+ j++;
+ i -= (rank | 0);
+ }
+ return (j * 32 + this._select32$IIB(this._v[j], i, b) | 0);
+};
+
+/**
+ * @param {!number} x
+ * @param {!number} i
+ * @param {!boolean} b
+ * @return {!number}
+ */
+BitVector.prototype._rank32$IIB = function (x, i, b) {
+ if (! b) {
+ x = ~ x;
+ }
+ x <<= 32 - i;
+ x = ((x & 0xaaaaaaaa) >>> 1) + (x & 0x55555555);
+ x = ((x & 0xcccccccc) >>> 2) + (x & 0x33333333);
+ x = ((x & 0xf0f0f0f0) >>> 4) + (x & 0x0f0f0f0f);
+ x = ((x & 0xff00ff00) >>> 8) + (x & 0x00ff00ff);
+ x = ((x & 0xffff0000) >>> 16) + (x & 0x0000ffff);
+ return x;
+};
+
+/**
+ * @param {!number} x
+ * @param {!number} i
+ * @param {!boolean} b
+ * @return {!number}
+ */
+BitVector.prototype._select32$IIB = function (x, i, b) {
+ /** @type {!number} */
+ var x1;
+ /** @type {!number} */
+ var x2;
+ /** @type {!number} */
+ var x3;
+ /** @type {!number} */
+ var x4;
+ /** @type {!number} */
+ var x5;
+ /** @type {!number} */
+ var pos;
+ /** @type {!number} */
+ var v5;
+ /** @type {!number} */
+ var v4;
+ /** @type {!number} */
+ var v3;
+ /** @type {!number} */
+ var v2;
+ /** @type {!number} */
+ var v1;
+ /** @type {!number} */
+ var v0;
+ if (! b) {
+ x = ~ x;
+ }
+ x1 = ((x & 0xaaaaaaaa) >>> 1) + (x & 0x55555555);
+ x2 = ((x1 & 0xcccccccc) >>> 2) + (x1 & 0x33333333);
+ x3 = ((x2 & 0xf0f0f0f0) >>> 4) + (x2 & 0x0f0f0f0f);
+ x4 = ((x3 & 0xff00ff00) >>> 8) + (x3 & 0x00ff00ff);
+ x5 = ((x4 & 0xffff0000) >>> 16) + (x4 & 0x0000ffff);
+ i++;
+ pos = 0;
+ v5 = x5 & 0xffffffff;
+ if (i > v5) {
+ i -= (v5 | 0);
+ pos += 32;
+ }
+ v4 = x4 >>> pos & 0x0000ffff;
+ if (i > v4) {
+ i -= (v4 | 0);
+ pos += 16;
+ }
+ v3 = x3 >>> pos & 0x000000ff;
+ if (i > v3) {
+ i -= (v3 | 0);
+ pos += 8;
+ }
+ v2 = x2 >>> pos & 0x0000000f;
+ if (i > v2) {
+ i -= (v2 | 0);
+ pos += 4;
+ }
+ v1 = x1 >>> pos & 0x00000003;
+ if (i > v1) {
+ i -= (v1 | 0);
+ pos += 2;
+ }
+ v0 = x >>> pos & 0x00000001;
+ if (i > v0) {
+ i -= (v0 | 0);
+ pos += 1;
+ }
+ return (pos | 0);
+};
+
+/**
+ * @return {!string}
+ */
+BitVector.prototype.dump$ = function () {
+ /** @type {Array.<undefined|!string>} */
+ var contents;
+ contents = [ ];
+ contents.push(Binary$dump32bitNumber$N(this._size));
+ contents.push(Binary$dump32bitNumberList$AN(this._v));
+ return contents.join('');
+};
+
+/**
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+BitVector.prototype.dump$LCompressionReport$ = function (report) {
+ /** @type {Array.<undefined|!string>} */
+ var contents;
+ contents = [ ];
+ contents.push(Binary$dump32bitNumber$N(this._size));
+ CompressionReport$add$LCompressionReport$II(report, 2, 2);
+ contents.push(Binary$dump32bitNumberList$ANLCompressionReport$(this._v, report));
+ return contents.join('');
+};
+
+/**
+ * @param {!string} data
+ * @return {!number}
+ */
+BitVector.prototype.load$S = function (data) {
+ return this.load$SI(data, 0);
+};
+
+/**
+ * @param {!string} data
+ * @param {!number} offset
+ * @return {!number}
+ */
+BitVector.prototype.load$SI = function (data, offset) {
+ /** @type {LoadedNumberListResult} */
+ var result;
+ /** @type {!number} */
+ var result$0;
+ this._v.length = 0;
+ this._r.length = 0;
+ this._size = 0;
+ this._size1 = 0;
+ result$0 = data.charCodeAt(offset) * 65536 + data.charCodeAt(offset + 1);
+ this._size = (result$0 | 0);
+ result = Binary$load32bitNumberList$SI(data, offset + 2);
+ this._v = result.result;
+ this.build$();
+ return result.offset;
+};
+
+/**
+ * class WaveletMatrix extends Object
+ * @constructor
+ */
+function WaveletMatrix() {
+}
+
+/**
+ * @constructor
+ */
+function WaveletMatrix$() {
+ /** @type {Array.<undefined|BitVector>} */
+ var _bv$0;
+ /** @type {Array.<undefined|!number>} */
+ var _seps$0;
+ this._range = ({ });
+ _bv$0 = this._bv = [ ];
+ _seps$0 = this._seps = [ ];
+ this._bitsize = 16;
+ _bv$0.length = 0;
+ _seps$0.length = 0;
+ this._size = 0;
+};
+
+WaveletMatrix$.prototype = new WaveletMatrix;
+
+/**
+ * @return {!number}
+ */
+WaveletMatrix.prototype.bitsize$ = function () {
+ return this._bitsize;
+};
+
+/**
+ * @param {!number} charCode
+ */
+WaveletMatrix.prototype.setMaxCharCode$I = function (charCode) {
+ this._bitsize = (Math.ceil(Math.log(charCode) / 0.6931471805599453) | 0);
+};
+
+/**
+ */
+WaveletMatrix.prototype.clear$ = function () {
+ this._bv.length = 0;
+ this._seps.length = 0;
+ this._size = 0;
+};
+
+/**
+ * @param {!string} v
+ */
+WaveletMatrix.prototype.build$S = function (v) {
+ /** @type {!number} */
+ var size;
+ /** @type {!number} */
+ var bitsize;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var depth;
+ /** @type {Object.<string, undefined|!number>} */
+ var range_tmp;
+ /** @type {!number} */
+ var code;
+ /** @type {!boolean} */
+ var bit;
+ /** @type {!number} */
+ var key;
+ /** @type {Object.<string, undefined|!number>} */
+ var range_rev;
+ /** @type {!string} */
+ var range_key;
+ /** @type {!number} */
+ var value;
+ /** @type {!number} */
+ var pos0;
+ /** @type {undefined|!number} */
+ var pos1;
+ /** @type {!string} */
+ var range_rev_key;
+ /** @type {!number} */
+ var begin;
+ /** @type {undefined|!number} */
+ var end;
+ /** @type {!number} */
+ var num0;
+ /** @type {!number} */
+ var num1;
+ this._bv.length = 0;
+ this._seps.length = 0;
+ this._size = 0;
+ size = v.length;
+ bitsize = this._bitsize;
+ for (i = 0; i < bitsize; i++) {
+ this._bv.push(new BitVector$());
+ this._seps.push(0);
+ }
+ this._size = (size | 0);
+ for (i = 0; i < size; i++) {
+ this._bv[0].set$IB(i, this._uint2bit$II(v.charCodeAt(i), 0));
+ }
+ this._bv[0].build$();
+ this._seps[0] = this._bv[0].size$B(false);
+ this._range["0"] = 0;
+ this._range["1"] = this._seps[0];
+ depth = 1;
+ while (depth < bitsize) {
+ range_tmp = WaveletMatrix$_shallow_copy$HI(this._range);
+ for (i = 0; i < size; i++) {
+ code = v.charCodeAt(i);
+ bit = this._uint2bit$II(code, depth);
+ key = code >>> bitsize - depth;
+ this._bv[depth].set$IB(range_tmp[key + ""], bit);
+ range_tmp[key + ""]++;
+ }
+ this._bv[depth].build$();
+ this._seps[depth] = this._bv[depth].size$B(false);
+ range_rev = ({ });
+ for (range_key in this._range) {
+ value = this._range[range_key];
+ if (value != range_tmp[range_key]) {
+ range_rev[value + ""] = range_key | 0;
+ }
+ }
+ this._range = ({ });
+ pos0 = 0;
+ pos1 = this._seps[depth];
+ for (range_rev_key in range_rev) {
+ begin = range_rev_key | 0;
+ value = range_rev[range_rev_key];
+ end = range_tmp[value + ""];
+ num0 = this._bv[depth].rank$IB(end, false) - this._bv[depth].rank$IB(begin, false);
+ num1 = end - begin - num0;
+ if (num0 > 0) {
+ this._range[(value << 1) + ""] = (pos0 | 0);
+ pos0 += num0;
+ }
+ if (num1 > 0) {
+ this._range[(value << 1) + 1 + ""] = pos1;
+ pos1 += (num1 | 0);
+ }
+ }
+ depth++;
+ }
+};
+
+/**
+ * @return {!number}
+ */
+WaveletMatrix.prototype.size$ = function () {
+ return this._size;
+};
+
+/**
+ * @param {!number} c
+ * @return {!number}
+ */
+WaveletMatrix.prototype.size$I = function (c) {
+ return this.rank$II(this._size, c);
+};
+
+/**
+ * @param {!number} i
+ * @return {!number}
+ */
+WaveletMatrix.prototype.get$I = function (i) {
+ /** @type {!number} */
+ var value;
+ /** @type {!number} */
+ var depth;
+ /** @type {!boolean} */
+ var bit;
+ if (i >= this._size) {
+ throw new Error("WaveletMatrix.get() : range error");
+ }
+ value = 0;
+ depth = 0;
+ while (depth < this._bitsize) {
+ bit = this._bv[depth].get$I(i);
+ i = this._bv[depth].rank$IB(i, bit);
+ value <<= 1;
+ if (bit) {
+ i += this._seps[depth];
+ value += 1;
+ }
+ depth++;
+ }
+ return (value | 0);
+};
+
+/**
+ * @param {!number} i
+ * @param {!number} c
+ * @return {!number}
+ */
+WaveletMatrix.prototype.rank$II = function (i, c) {
+ /** @type {undefined|!number} */
+ var begin;
+ /** @type {!number} */
+ var end;
+ /** @type {!number} */
+ var depth;
+ /** @type {!boolean} */
+ var bit;
+ if (i > this._size) {
+ throw new Error("WaveletMatrix.rank(): range error");
+ }
+ if (i === 0) {
+ return 0;
+ }
+ begin = this._range[c + ""];
+ if (begin == null) {
+ return 0;
+ }
+ end = i;
+ depth = 0;
+ while (depth < this._bitsize) {
+ bit = this._uint2bit$II(c, depth);
+ end = this._bv[depth].rank$IB(end, bit);
+ if (bit) {
+ end += this._seps[depth];
+ }
+ depth++;
+ }
+ return (end - begin | 0);
+};
+
+/**
+ * @param {!number} i
+ * @param {!number} c
+ * @return {!number}
+ */
+WaveletMatrix.prototype.rank_less_than$II = function (i, c) {
+ /** @type {!number} */
+ var begin;
+ /** @type {!number} */
+ var end;
+ /** @type {!number} */
+ var depth;
+ /** @type {!number} */
+ var rlt;
+ /** @type {!number} */
+ var rank0_begin;
+ /** @type {!number} */
+ var rank0_end;
+ /** @type {Array.<undefined|!number>} */
+ var _seps$0;
+ if (i > this._size) {
+ throw new Error("WaveletMatrix.rank_less_than(): range error");
+ }
+ if (i === 0) {
+ return 0;
+ }
+ begin = 0;
+ end = i;
+ depth = 0;
+ rlt = 0;
+ while (depth < this._bitsize) {
+ rank0_begin = this._bv[depth].rank$IB(begin, false);
+ rank0_end = this._bv[depth].rank$IB(end, false);
+ if (this._uint2bit$II(c, depth)) {
+ rlt += rank0_end - rank0_begin;
+ begin += (_seps$0 = this._seps)[depth] - rank0_begin;
+ end += _seps$0[depth] - rank0_end;
+ } else {
+ begin = rank0_begin;
+ end = rank0_end;
+ }
+ depth++;
+ }
+ return (rlt | 0);
+};
+
+/**
+ * @return {!string}
+ */
+WaveletMatrix.prototype.dump$ = function () {
+ /** @type {Array.<undefined|!string>} */
+ var contents;
+ /** @type {!number} */
+ var i;
+ /** @type {Array.<undefined|!string>} */
+ var range_contents;
+ /** @type {!number} */
+ var counter;
+ /** @type {!string} */
+ var key;
+ contents = [ Binary$dump16bitNumber$I(this._bitsize), Binary$dump32bitNumber$N(this._size) ];
+ for (i = 0; i < this._bitsize; i++) {
+ contents.push(this._bv[i].dump$());
+ }
+ for (i = 0; i < this._bitsize; i++) {
+ contents.push(Binary$dump32bitNumber$N(this._seps[i]));
+ }
+ range_contents = [ ];
+ counter = 0;
+ for (key in this._range) {
+ range_contents.push(Binary$dump32bitNumber$N(key | 0));
+ range_contents.push(Binary$dump32bitNumber$N(this._range[key]));
+ counter++;
+ }
+ contents.push(Binary$dump32bitNumber$N(counter));
+ return contents.join('') + range_contents.join('');
+};
+
+/**
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+WaveletMatrix.prototype.dump$LCompressionReport$ = function (report) {
+ /** @type {Array.<undefined|!string>} */
+ var contents;
+ /** @type {!number} */
+ var i;
+ /** @type {Array.<undefined|!string>} */
+ var range_contents;
+ /** @type {!number} */
+ var counter;
+ /** @type {!string} */
+ var key;
+ contents = [ Binary$dump16bitNumber$I(this._bitsize), Binary$dump32bitNumber$N(this._size) ];
+ CompressionReport$add$LCompressionReport$II(report, 3, 3);
+ for (i = 0; i < this._bitsize; i++) {
+ contents.push(this._bv[i].dump$LCompressionReport$(report));
+ }
+ for (i = 0; i < this._bitsize; i++) {
+ contents.push(Binary$dump32bitNumber$N(this._seps[i]));
+ CompressionReport$add$LCompressionReport$II(report, 2, 2);
+ }
+ range_contents = [ ];
+ counter = 0;
+ for (key in this._range) {
+ range_contents.push(Binary$dump32bitNumber$N(key | 0));
+ range_contents.push(Binary$dump32bitNumber$N(this._range[key]));
+ CompressionReport$add$LCompressionReport$II(report, 4, 4);
+ counter++;
+ }
+ CompressionReport$add$LCompressionReport$II(report, 2, 2);
+ contents.push(Binary$dump32bitNumber$N(counter));
+ return contents.join('') + range_contents.join('');
+};
+
+/**
+ * @param {!string} data
+ * @return {!number}
+ */
+WaveletMatrix.prototype.load$S = function (data) {
+ return this.load$SI(data, 0);
+};
+
+/**
+ * @param {!string} data
+ * @param {!number} offset
+ * @return {!number}
+ */
+WaveletMatrix.prototype.load$SI = function (data, offset) {
+ /** @type {!number} */
+ var i;
+ /** @type {BitVector} */
+ var bit_vector;
+ /** @type {!number} */
+ var range_size;
+ /** @type {!number} */
+ var value;
+ /** @type {!number} */
+ var offset$0;
+ /** @type {!number} */
+ var result$0;
+ /** @type {!number} */
+ var result$1;
+ /** @type {!number} */
+ var result$2;
+ this._bv.length = 0;
+ this._seps.length = 0;
+ this._size = 0;
+ offset$0 = offset++;
+ this._bitsize = (data.charCodeAt(offset$0) | 0);
+ result$0 = data.charCodeAt(offset) * 65536 + data.charCodeAt(offset + 1);
+ this._size = (result$0 | 0);
+ offset += 2;
+ for (i = 0; i < this._bitsize; i++) {
+ bit_vector = new BitVector$();
+ offset = bit_vector.load$SI(data, offset);
+ this._bv.push(bit_vector);
+ }
+ for (i = 0; i < this._bitsize; (i++, offset += 2)) {
+ this._seps.push(Binary$load32bitNumber$SI(data, offset));
+ }
+ result$1 = data.charCodeAt(offset) * 65536 + data.charCodeAt(offset + 1);
+ range_size = result$1;
+ offset += 2;
+ for (i = 0; i < range_size; (i++, offset += 4)) {
+ result$2 = data.charCodeAt(offset) * 65536 + data.charCodeAt(offset + 1);
+ value = Binary$load32bitNumber$SI(data, offset + 2);
+ this._range[result$2 + ""] = (value | 0);
+ }
+ return offset;
+};
+
+/**
+ * @param {Object.<string, undefined|!number>} input
+ * @return {Object.<string, undefined|!number>}
+ */
+WaveletMatrix._shallow_copy$HI = function (input) {
+ /** @type {Object.<string, undefined|!number>} */
+ var result;
+ /** @type {!string} */
+ var key;
+ result = ({ });
+ for (key in input) {
+ result[key] = input[key];
+ }
+ return result;
+};
+
+var WaveletMatrix$_shallow_copy$HI = WaveletMatrix._shallow_copy$HI;
+
+/**
+ * @param {!number} c
+ * @param {!number} i
+ * @return {!boolean}
+ */
+WaveletMatrix.prototype._uint2bit$II = function (c, i) {
+ return (c >>> this._bitsize - 1 - i & 0x1) === 0x1;
+};
+
+/**
+ * class BurrowsWheelerTransform extends Object
+ * @constructor
+ */
+function BurrowsWheelerTransform() {
+}
+
+/**
+ * @constructor
+ */
+function BurrowsWheelerTransform$() {
+ this._str = "";
+ this._size = 0;
+ this._head = 0;
+ this._suffixarray = [ ];
+};
+
+BurrowsWheelerTransform$.prototype = new BurrowsWheelerTransform;
+
+/**
+ * @param {BurrowsWheelerTransform} $this
+ * @return {!number}
+ */
+BurrowsWheelerTransform.size$LBurrowsWheelerTransform$ = function ($this) {
+ return $this._size;
+};
+
+var BurrowsWheelerTransform$size$LBurrowsWheelerTransform$ = BurrowsWheelerTransform.size$LBurrowsWheelerTransform$;
+
+/**
+ * @param {BurrowsWheelerTransform} $this
+ * @return {!number}
+ */
+BurrowsWheelerTransform.head$LBurrowsWheelerTransform$ = function ($this) {
+ return $this._head;
+};
+
+var BurrowsWheelerTransform$head$LBurrowsWheelerTransform$ = BurrowsWheelerTransform.head$LBurrowsWheelerTransform$;
+
+/**
+ * @param {BurrowsWheelerTransform} $this
+ */
+BurrowsWheelerTransform.clear$LBurrowsWheelerTransform$ = function ($this) {
+ $this._str = "";
+ $this._size = 0;
+ $this._head = 0;
+ $this._suffixarray.length = 0;
+};
+
+var BurrowsWheelerTransform$clear$LBurrowsWheelerTransform$ = BurrowsWheelerTransform.clear$LBurrowsWheelerTransform$;
+
+/**
+ * @param {BurrowsWheelerTransform} $this
+ * @param {!string} str
+ */
+BurrowsWheelerTransform.build$LBurrowsWheelerTransform$S = function ($this, str) {
+ /** @type {!string} */
+ var _str$0;
+ /** @type {Array.<undefined|!number>} */
+ var _suffixarray$0;
+ _str$0 = $this._str = str;
+ $this._size = _str$0.length;
+ _suffixarray$0 = $this._suffixarray = SAIS$make$S(str);
+ $this._head = (_suffixarray$0.indexOf(0) | 0);
+};
+
+var BurrowsWheelerTransform$build$LBurrowsWheelerTransform$S = BurrowsWheelerTransform.build$LBurrowsWheelerTransform$S;
+
+/**
+ * @param {BurrowsWheelerTransform} $this
+ * @param {!number} i
+ * @return {!string}
+ */
+BurrowsWheelerTransform.get$LBurrowsWheelerTransform$I = function ($this, i) {
+ /** @type {!number} */
+ var size;
+ /** @type {!number} */
+ var index;
+ size = $this._size;
+ if (i >= size) {
+ throw new Error("BurrowsWheelerTransform.get() : range error");
+ }
+ index = ($this._suffixarray[i] + size - 1) % size;
+ return $this._str.charAt(index);
+};
+
+var BurrowsWheelerTransform$get$LBurrowsWheelerTransform$I = BurrowsWheelerTransform.get$LBurrowsWheelerTransform$I;
+
+/**
+ * @param {BurrowsWheelerTransform} $this
+ * @return {!string}
+ */
+BurrowsWheelerTransform.get$LBurrowsWheelerTransform$ = function ($this) {
+ /** @type {Array.<undefined|!string>} */
+ var str;
+ /** @type {!number} */
+ var size;
+ /** @type {!number} */
+ var i;
+ str = [ ];
+ size = $this._size;
+ for (i = 0; i < size; i++) {
+ str.push(BurrowsWheelerTransform$get$LBurrowsWheelerTransform$I($this, i));
+ }
+ return str.join("");
+};
+
+var BurrowsWheelerTransform$get$LBurrowsWheelerTransform$ = BurrowsWheelerTransform.get$LBurrowsWheelerTransform$;
+
+/**
+ * @param {BurrowsWheelerTransform} $this
+ * @param {!string} replace
+ * @return {!string}
+ */
+BurrowsWheelerTransform.get$LBurrowsWheelerTransform$S = function ($this, replace) {
+ /** @type {!string} */
+ var result;
+ result = BurrowsWheelerTransform$get$LBurrowsWheelerTransform$($this);
+ return result.replace(BurrowsWheelerTransform.END_MARKER, replace);
+};
+
+var BurrowsWheelerTransform$get$LBurrowsWheelerTransform$S = BurrowsWheelerTransform.get$LBurrowsWheelerTransform$S;
+
+/**
+ * class OArray extends Object
+ * @constructor
+ */
+function OArray() {
+}
+
+/**
+ * @constructor
+ * @param {Array.<undefined|!number>} array
+ */
+function OArray$AI(array) {
+ this.array = array;
+ this.offset = 0;
+};
+
+OArray$AI.prototype = new OArray;
+
+/**
+ * @constructor
+ * @param {Array.<undefined|!number>} array
+ * @param {!number} offset
+ */
+function OArray$AII(array, offset) {
+ this.array = array;
+ this.offset = offset;
+};
+
+OArray$AII.prototype = new OArray;
+
+/**
+ * @param {OArray} $this
+ * @param {!number} index
+ * @return {!number}
+ */
+OArray.get$LOArray$I = function ($this, index) {
+ return $this.array[index + $this.offset];
+};
+
+var OArray$get$LOArray$I = OArray.get$LOArray$I;
+
+/**
+ * @param {OArray} $this
+ * @param {!number} index
+ * @param {!number} value
+ */
+OArray.set$LOArray$II = function ($this, index, value) {
+ $this.array[index + $this.offset] = value;
+};
+
+var OArray$set$LOArray$II = OArray.set$LOArray$II;
+
+/**
+ * @param {OArray} $this
+ * @param {!number} index
+ * @return {!boolean}
+ */
+OArray.isS$LOArray$I = function ($this, index) {
+ /** @type {Array.<undefined|!number>} */
+ var array$0;
+ /** @type {!number} */
+ var offset$0;
+ return (array$0 = $this.array)[index + (offset$0 = $this.offset)] < array$0[index + offset$0 + 1];
+};
+
+var OArray$isS$LOArray$I = OArray.isS$LOArray$I;
+
+/**
+ * @param {OArray} $this
+ * @param {!number} index1
+ * @param {!number} index2
+ * @return {!boolean}
+ */
+OArray.compare$LOArray$II = function ($this, index1, index2) {
+ /** @type {Array.<undefined|!number>} */
+ var array$0;
+ /** @type {!number} */
+ var offset$0;
+ return (array$0 = $this.array)[index1 + (offset$0 = $this.offset)] == array$0[index2 + offset$0];
+};
+
+var OArray$compare$LOArray$II = OArray.compare$LOArray$II;
+
+/**
+ * class SAIS extends Object
+ * @constructor
+ */
+function SAIS() {
+}
+
+/**
+ * @constructor
+ */
+function SAIS$() {
+};
+
+SAIS$.prototype = new SAIS;
+
+/**
+ * @param {BitVector} t
+ * @param {!number} i
+ * @return {!boolean}
+ */
+SAIS._isLMS$LBitVector$I = function (t, i) {
+ return i > 0 && t.get$I(i) && ! t.get$I(i - 1);
+};
+
+var SAIS$_isLMS$LBitVector$I = SAIS._isLMS$LBitVector$I;
+
+/**
+ * @param {OArray} s
+ * @param {Array.<undefined|!number>} bkt
+ * @param {!number} n
+ * @param {!number} K
+ * @param {!boolean} end
+ */
+SAIS._getBuckets$LOArray$AIIIB = function (s, bkt, n, K, end) {
+ /** @type {!number} */
+ var sum;
+ /** @type {!number} */
+ var i;
+ sum = 0;
+ for (i = 0; i <= K; i++) {
+ bkt[i] = 0;
+ }
+ for (i = 0; i < n; i++) {
+ bkt[OArray$get$LOArray$I(s, i)]++;
+ }
+ for (i = 0; i <= K; i++) {
+ sum += bkt[i];
+ bkt[i] = ((end ? sum : sum - bkt[i]) | 0);
+ }
+};
+
+var SAIS$_getBuckets$LOArray$AIIIB = SAIS._getBuckets$LOArray$AIIIB;
+
+/**
+ * @param {BitVector} t
+ * @param {Array.<undefined|!number>} SA
+ * @param {OArray} s
+ * @param {Array.<undefined|!number>} bkt
+ * @param {!number} n
+ * @param {!number} K
+ * @param {!boolean} end
+ */
+SAIS._induceSAl$LBitVector$AILOArray$AIIIB = function (t, SA, s, bkt, n, K, end) {
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var j;
+ SAIS$_getBuckets$LOArray$AIIIB(s, bkt, n, K, end);
+ for (i = 0; i < n; i++) {
+ j = SA[i] - 1;
+ if (j >= 0 && ! t.get$I(j)) {
+ SA[bkt[OArray$get$LOArray$I(s, j)]++] = (j | 0);
+ }
+ }
+};
+
+var SAIS$_induceSAl$LBitVector$AILOArray$AIIIB = SAIS._induceSAl$LBitVector$AILOArray$AIIIB;
+
+/**
+ * @param {BitVector} t
+ * @param {Array.<undefined|!number>} SA
+ * @param {OArray} s
+ * @param {Array.<undefined|!number>} bkt
+ * @param {!number} n
+ * @param {!number} K
+ * @param {!boolean} end
+ */
+SAIS._induceSAs$LBitVector$AILOArray$AIIIB = function (t, SA, s, bkt, n, K, end) {
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var j;
+ SAIS$_getBuckets$LOArray$AIIIB(s, bkt, n, K, end);
+ for (i = n - 1; i >= 0; i--) {
+ j = SA[i] - 1;
+ if (j >= 0 && t.get$I(j)) {
+ SA[-- bkt[OArray$get$LOArray$I(s, j)]] = (j | 0);
+ }
+ }
+};
+
+var SAIS$_induceSAs$LBitVector$AILOArray$AIIIB = SAIS._induceSAs$LBitVector$AILOArray$AIIIB;
+
+/**
+ * @param {!string} source
+ * @return {Array.<undefined|!number>}
+ */
+SAIS.make$S = function (source) {
+ /** @type {Array.<undefined|!number>} */
+ var charCodes;
+ /** @type {!number} */
+ var maxCode;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var code;
+ /** @type {Array.<undefined|!number>} */
+ var SA;
+ /** @type {OArray} */
+ var s;
+ charCodes = [ ];
+ charCodes.length = source.length;
+ maxCode = 0;
+ for (i = 0; i < source.length; i++) {
+ code = source.charCodeAt(i);
+ charCodes[i] = (code | 0);
+ maxCode = (code > maxCode ? code : maxCode);
+ }
+ SA = [ ];
+ SA.length = source.length;
+ s = ({offset: 0, array: charCodes});
+ SAIS$_make$LOArray$AIII(s, SA, source.length, maxCode);
+ return SA;
+};
+
+var SAIS$make$S = SAIS.make$S;
+
+/**
+ * @param {OArray} s
+ * @param {Array.<undefined|!number>} SA
+ * @param {!number} n
+ * @param {!number} K
+ */
+SAIS._make$LOArray$AIII = function (s, SA, n, K) {
+ /** @type {BitVector} */
+ var t;
+ /** @type {!number} */
+ var i;
+ /** @type {Array.<undefined|!number>} */
+ var bkt;
+ /** @type {!number} */
+ var n1;
+ /** @type {!number} */
+ var name;
+ /** @type {!number} */
+ var prev;
+ /** @type {undefined|!number} */
+ var pos;
+ /** @type {!boolean} */
+ var diff;
+ /** @type {!number} */
+ var d;
+ /** @type {!number} */
+ var j;
+ /** @type {Array.<undefined|!number>} */
+ var SA1;
+ /** @type {OArray} */
+ var s1;
+ /** @type {!number} */
+ var i$0;
+ /** @type {!number} */
+ var index$0;
+ t = new BitVector$();
+ t.set$IB(n - 2, false);
+ t.set$IB(n - 1, true);
+ for (i = n - 3; i >= 0; i--) {
+ t.set$IB(i, OArray$isS$LOArray$I(s, i) || OArray$compare$LOArray$II(s, i, i + 1) && t.get$I(i + 1));
+ }
+ bkt = [ ];
+ bkt.length = K + 1;
+ SAIS$_getBuckets$LOArray$AIIIB(s, bkt, n, K, true);
+ for (i = 0; i < n; i++) {
+ SA[i] = -1;
+ }
+ for (i = 1; i < n; i++) {
+ if (SAIS$_isLMS$LBitVector$I(t, i)) {
+ SA[-- bkt[OArray$get$LOArray$I(s, i)]] = (i | 0);
+ }
+ }
+ SAIS$_induceSAl$LBitVector$AILOArray$AIIIB(t, SA, s, bkt, n, K, false);
+ SAIS$_induceSAs$LBitVector$AILOArray$AIIIB(t, SA, s, bkt, n, K, true);
+ n1 = 0;
+ for (i = 0; i < n; i++) {
+ i$0 = SA[i];
+ if (i$0 > 0 && t.get$I(i$0) && ! t.get$I(i$0 - 1)) {
+ SA[n1++] = SA[i];
+ }
+ }
+ for (i = n1; i < n; i++) {
+ SA[i] = -1;
+ }
+ name = 0;
+ prev = -1;
+ for (i = 0; i < n1; i++) {
+ pos = SA[i];
+ diff = false;
+ for (d = 0; d < n; d++) {
+ if (prev === -1 || ! OArray$compare$LOArray$II(s, pos + d, prev + d) || t.get$I(pos + d) !== t.get$I(prev + d)) {
+ diff = true;
+ break;
+ } else {
+ if (d > 0 && (SAIS$_isLMS$LBitVector$I(t, pos + d) || SAIS$_isLMS$LBitVector$I(t, prev + d))) {
+ break;
+ }
+ }
+ }
+ if (diff) {
+ name++;
+ prev = pos;
+ }
+ pos = ((pos % 2 === 0 ? pos / 2 : (pos - 1) / 2) | 0);
+ SA[n1 + pos] = (name - 1 | 0);
+ }
+ for ((i = n - 1, j = n - 1); i >= n1; i--) {
+ if (SA[i] >= 0) {
+ SA[j--] = SA[i];
+ }
+ }
+ SA1 = SA;
+ s1 = ({offset: n - n1, array: SA});
+ if (name < n1) {
+ SAIS$_make$LOArray$AIII(s1, SA1, n1, name - 1);
+ } else {
+ for (i = 0; i < n1; i++) {
+ SA1[OArray$get$LOArray$I(s1, i)] = (i | 0);
+ }
+ }
+ bkt = [ ];
+ bkt.length = K + 1;
+ SAIS$_getBuckets$LOArray$AIIIB(s, bkt, n, K, true);
+ for ((i = 1, j = 0); i < n; i++) {
+ if (SAIS$_isLMS$LBitVector$I(t, i)) {
+ OArray$set$LOArray$II(s1, j++, i);
+ }
+ }
+ for (i = 0; i < n1; i++) {
+ index$0 = SA1[i];
+ SA1[i] = s1.array[index$0 + s1.offset];
+ }
+ for (i = n1; i < n; i++) {
+ SA[i] = -1;
+ }
+ for (i = n1 - 1; i >= 0; i--) {
+ j = SA[i];
+ SA[i] = -1;
+ SA[-- bkt[OArray$get$LOArray$I(s, j)]] = (j | 0);
+ }
+ SAIS$_induceSAl$LBitVector$AILOArray$AIIIB(t, SA, s, bkt, n, K, false);
+ SAIS$_induceSAs$LBitVector$AILOArray$AIIIB(t, SA, s, bkt, n, K, true);
+};
+
+var SAIS$_make$LOArray$AIII = SAIS._make$LOArray$AIII;
+
+OktaviaSearch._stemmer = null;
+OktaviaSearch._instance = null;
+$__jsx_lazy_init(Oktavia, "eof", function () {
+ return String.fromCharCode(0);
+});
+$__jsx_lazy_init(Oktavia, "eob", function () {
+ return String.fromCharCode(1);
+});
+$__jsx_lazy_init(Oktavia, "unknown", function () {
+ return String.fromCharCode(3);
+});
+Binary._base64EncodeChars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
+$__jsx_lazy_init(Binary, "_base64DecodeChars", function () {
+ return [ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 62, -1, -1, -1, 63, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, -1, -1, -1, -1, -1, -1, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -1, -1, -1, -1, -1, -1, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, -1, -1, -1, -1 ];
+});
+$__jsx_lazy_init(Style, "console", function () {
+ return ({ 'title': [ '\x1B[32m\x1b[4m', '\x1B[39m\x1b[0m' ], 'url': [ '\x1B[34m', '\x1B[39m' ], 'hit': [ '\x1B[4m', '\x1B[0m' ], 'del': [ '\x1B[9m', '\x1B[0m' ], 'summary': [ '\x1B[90m', '\x1B[39m' ] });
+});
+$__jsx_lazy_init(Style, "html", function () {
+ return ({ 'title': [ '<span class="title">', '</span>' ], 'url': [ '<span class="url">', '</span>' ], 'hit': [ '<span class="hit">', '</span>' ], 'del': [ '<del>', '</del>' ], 'summary': [ '<span class="reuslt">', '</span>' ] });
+});
+$__jsx_lazy_init(Style, "ignore", function () {
+ return ({ 'tilte': [ '', '' ], 'url': [ '', '' ], 'hit': [ '', '' ], 'del': [ '', '' ], 'summary': [ '', '' ] });
+});
+EnglishStemmer.serialVersionUID = 1;
+$__jsx_lazy_init(EnglishStemmer, "methodObject", function () {
+ return new EnglishStemmer$();
+});
+$__jsx_lazy_init(EnglishStemmer, "a_0", function () {
+ return [ new Among$SII("arsen", -1, -1), new Among$SII("commun", -1, -1), new Among$SII("gener", -1, -1) ];
+});
+$__jsx_lazy_init(EnglishStemmer, "a_1", function () {
+ return [ new Among$SII("'", -1, 1), new Among$SII("'s'", 0, 1), new Among$SII("'s", -1, 1) ];
+});
+$__jsx_lazy_init(EnglishStemmer, "a_2", function () {
+ return [ new Among$SII("ied", -1, 2), new Among$SII("s", -1, 3), new Among$SII("ies", 1, 2), new Among$SII("sses", 1, 1), new Among$SII("ss", 1, -1), new Among$SII("us", 1, -1) ];
+});
+$__jsx_lazy_init(EnglishStemmer, "a_3", function () {
+ return [ new Among$SII("", -1, 3), new Among$SII("bb", 0, 2), new Among$SII("dd", 0, 2), new Among$SII("ff", 0, 2), new Among$SII("gg", 0, 2), new Among$SII("bl", 0, 1), new Among$SII("mm", 0, 2), new Among$SII("nn", 0, 2), new Among$SII("pp", 0, 2), new Among$SII("rr", 0, 2), new Among$SII("at", 0, 1), new Among$SII("tt", 0, 2), new Among$SII("iz", 0, 1) ];
+});
+$__jsx_lazy_init(EnglishStemmer, "a_4", function () {
+ return [ new Among$SII("ed", -1, 2), new Among$SII("eed", 0, 1), new Among$SII("ing", -1, 2), new Among$SII("edly", -1, 2), new Among$SII("eedly", 3, 1), new Among$SII("ingly", -1, 2) ];
+});
+$__jsx_lazy_init(EnglishStemmer, "a_5", function () {
+ return [ new Among$SII("anci", -1, 3), new Among$SII("enci", -1, 2), new Among$SII("ogi", -1, 13), new Among$SII("li", -1, 16), new Among$SII("bli", 3, 12), new Among$SII("abli", 4, 4), new Among$SII("alli", 3, 8), new Among$SII("fulli", 3, 14), new Among$SII("lessli", 3, 15), new Among$SII("ousli", 3, 10), new Among$SII("entli", 3, 5), new Among$SII("aliti", -1, 8), new Among$SII("biliti", -1, 12), new Among$SII("iviti", -1, 11), new Among$SII("tional", -1, 1), new Among$SII("ational", 14, 7), new Among$SII("alism", -1, 8), new Among$SII("ation", -1, 7), new Among$SII("ization", 17, 6), new Among$SII("izer", -1, 6), new Among$SII("ator", -1, 7), new Among$SII("iveness", -1, 11), new Among$SII("fulness", -1, 9), new Among$SII("ousness", -1, 10) ];
+});
+$__jsx_lazy_init(EnglishStemmer, "a_6", function () {
+ return [ new Among$SII("icate", -1, 4), new Among$SII("ative", -1, 6), new Among$SII("alize", -1, 3), new Among$SII("iciti", -1, 4), new Among$SII("ical", -1, 4), new Among$SII("tional", -1, 1), new Among$SII("ational", 5, 2), new Among$SII("ful", -1, 5), new Among$SII("ness", -1, 5) ];
+});
+$__jsx_lazy_init(EnglishStemmer, "a_7", function () {
+ return [ new Among$SII("ic", -1, 1), new Among$SII("ance", -1, 1), new Among$SII("ence", -1, 1), new Among$SII("able", -1, 1), new Among$SII("ible", -1, 1), new Among$SII("ate", -1, 1), new Among$SII("ive", -1, 1), new Among$SII("ize", -1, 1), new Among$SII("iti", -1, 1), new Among$SII("al", -1, 1), new Among$SII("ism", -1, 1), new Among$SII("ion", -1, 2), new Among$SII("er", -1, 1), new Among$SII("ous", -1, 1), new Among$SII("ant", -1, 1), new Among$SII("ent", -1, 1), new Among$SII("ment", 15, 1), new Among$SII("ement", 16, 1) ];
+});
+$__jsx_lazy_init(EnglishStemmer, "a_8", function () {
+ return [ new Among$SII("e", -1, 1), new Among$SII("l", -1, 2) ];
+});
+$__jsx_lazy_init(EnglishStemmer, "a_9", function () {
+ return [ new Among$SII("succeed", -1, -1), new Among$SII("proceed", -1, -1), new Among$SII("exceed", -1, -1), new Among$SII("canning", -1, -1), new Among$SII("inning", -1, -1), new Among$SII("earring", -1, -1), new Among$SII("herring", -1, -1), new Among$SII("outing", -1, -1) ];
+});
+$__jsx_lazy_init(EnglishStemmer, "a_10", function () {
+ return [ new Among$SII("andes", -1, -1), new Among$SII("atlas", -1, -1), new Among$SII("bias", -1, -1), new Among$SII("cosmos", -1, -1), new Among$SII("dying", -1, 3), new Among$SII("early", -1, 9), new Among$SII("gently", -1, 7), new Among$SII("howe", -1, -1), new Among$SII("idly", -1, 6), new Among$SII("lying", -1, 4), new Among$SII("news", -1, -1), new Among$SII("only", -1, 10), new Among$SII("singly", -1, 11), new Among$SII("skies", -1, 2), new Among$SII("skis", -1, 1), new Among$SII("sky", -1, -1), new Among$SII("tying", -1, 5), new Among$SII("ugly", -1, 8) ];
+});
+$__jsx_lazy_init(EnglishStemmer, "g_v", function () {
+ return [ 17, 65, 16, 1 ];
+});
+$__jsx_lazy_init(EnglishStemmer, "g_v_WXY", function () {
+ return [ 1, 17, 65, 208, 1 ];
+});
+$__jsx_lazy_init(EnglishStemmer, "g_valid_LI", function () {
+ return [ 55, 141, 2 ];
+});
+$__jsx_lazy_init(_Common, "buffers", function () {
+ return [ "comment", "sgmlDecl", "textNode", "tagName", "doctype", "procInstName", "procInstBody", "entity", "attribName", "attribValue", "cdata", "script" ];
+});
+$__jsx_lazy_init(_Common, "EVENTS", function () {
+ return [ "text", "processinginstruction", "sgmldeclaration", "doctype", "comment", "attribute", "opentag", "closetag", "opencdata", "cdata", "clo_State.CDATA", "error", "end", "ready", "script", "opennamespace", "closenamespace" ];
+});
+_Common.MAX_BUFFER_LENGTH = 65536;
+_State.BEGIN = 1;
+_State.TEXT = 2;
+_State.TEXT_ENTITY = 3;
+_State.OPEN_WAKA = 4;
+_State.SGML_DECL = 5;
+_State.SGML_DECL_QUOTED = 6;
+_State.DOCTYPE = 7;
+_State.DOCTYPE_QUOTED = 8;
+_State.DOCTYPE_DTD = 9;
+_State.DOCTYPE_DTD_QUOTED = 10;
+_State.COMMENT_STARTING = 11;
+_State.COMMENT = 12;
+_State.COMMENT_ENDING = 13;
+_State.COMMENT_ENDED = 14;
+_State.CDATA = 15;
+_State.CDATA_ENDING = 16;
+_State.CDATA_ENDING_2 = 17;
+_State.PROC_INST = 18;
+_State.PROC_INST_BODY = 19;
+_State.PROC_INST_ENDING = 20;
+_State.OPEN_TAG = 21;
+_State.OPEN_TAG_SLASH = 22;
+_State.ATTRIB = 23;
+_State.ATTRIB_NAME = 24;
+_State.ATTRIB_NAME_SAW_WHITE = 25;
+_State.ATTRIB_VALUE = 26;
+_State.ATTRIB_VALUE_QUOTED = 27;
+_State.ATTRIB_VALUE_UNQUOTED = 28;
+_State.ATTRIB_VALUE_ENTITY_Q = 29;
+_State.ATTRIB_VALUE_ENTITY_U = 30;
+_State.CLOSE_TAG = 31;
+_State.CLOSE_TAG_SAW_WHITE = 32;
+_State.SCRIPT = 33;
+_State.SCRIPT_ENDING = 34;
+$__jsx_lazy_init(_Entities, "_entities", function () {
+ return ({ "amp": "&", "gt": ">", "lt": "<", "quot": "\"", "apos": "'", "AElig": 198, "Aacute": 193, "Acirc": 194, "Agrave": 192, "Aring": 197, "Atilde": 195, "Auml": 196, "Ccedil": 199, "ETH": 208, "Eacute": 201, "Ecirc": 202, "Egrave": 200, "Euml": 203, "Iacute": 205, "Icirc": 206, "Igrave": 204, "Iuml": 207, "Ntilde": 209, "Oacute": 211, "Ocirc": 212, "Ograve": 210, "Oslash": 216, "Otilde": 213, "Ouml": 214, "THORN": 222, "Uacute": 218, "Ucirc": 219, "Ugrave": 217, "Uuml": 220, "Yacute": 221, "aacute": 225, "acirc": 226, "aelig": 230, "agrave": 224, "aring": 229, "atilde": 227, "auml": 228, "ccedil": 231, "eacute": 233, "ecirc": 234, "egrave": 232, "eth": 240, "euml": 235, "iacute": 237, "icirc": 238, "igrave": 236, "iuml": 239, "ntilde": 241, "oacute": 243, "ocirc": 244, "ograve": 242, "oslash": 248, "otilde": 245, "ouml": 246, "szlig": 223, "thorn": 254, "uacute": 250, "ucirc": 251, "ugrave": 249, "uuml": 252, "yacute": 253, "yuml": 255, "copy": 169, "reg": 174, "nbsp": 160, "iexcl": 161, "cent": 162, "pound": 163, "curren": 164, "yen": 165, "brvbar": 166, "sect": 167, "uml": 168, "ordf": 170, "laquo": 171, "not": 172, "shy": 173, "macr": 175, "deg": 176, "plusmn": 177, "sup1": 185, "sup2": 178, "sup3": 179, "acute": 180, "micro": 181, "para": 182, "middot": 183, "cedil": 184, "ordm": 186, "raquo": 187, "frac14": 188, "frac12": 189, "frac34": 190, "iquest": 191, "times": 215, "divide": 247, "OElig": 338, "oelig": 339, "Scaron": 352, "scaron": 353, "Yuml": 376, "fnof": 402, "circ": 710, "tilde": 732, "Alpha": 913, "Beta": 914, "Gamma": 915, "Delta": 916, "Epsilon": 917, "Zeta": 918, "Eta": 919, "Theta": 920, "Iota": 921, "Kappa": 922, "Lambda": 923, "Mu": 924, "Nu": 925, "Xi": 926, "Omicron": 927, "Pi": 928, "Rho": 929, "Sigma": 931, "Tau": 932, "Upsilon": 933, "Phi": 934, "Chi": 935, "Psi": 936, "Omega": 937, "alpha": 945, "beta": 946, "gamma": 947, "delta": 948, "epsilon": 949, "zeta": 950, "eta": 951, "theta": 952, "iota": 953, "kappa": 954, "lambda": 955, "mu": 956, "nu": 957, "xi": 958, "omicron": 959, "pi": 960, "rho": 961, "sigmaf": 962, "sigma": 963, "tau": 964, "upsilon": 965, "phi": 966, "chi": 967, "psi": 968, "omega": 969, "thetasym": 977, "upsih": 978, "piv": 982, "ensp": 8194, "emsp": 8195, "thinsp": 8201, "zwnj": 8204, "zwj": 8205, "lrm": 8206, "rlm": 8207, "ndash": 8211, "mdash": 8212, "lsquo": 8216, "rsquo": 8217, "sbquo": 8218, "ldquo": 8220, "rdquo": 8221, "bdquo": 8222, "dagger": 8224, "Dagger": 8225, "bull": 8226, "hellip": 8230, "permil": 8240, "prime": 8242, "Prime": 8243, "lsaquo": 8249, "rsaquo": 8250, "oline": 8254, "frasl": 8260, "euro": 8364, "image": 8465, "weierp": 8472, "real": 8476, "trade": 8482, "alefsym": 8501, "larr": 8592, "uarr": 8593, "rarr": 8594, "darr": 8595, "harr": 8596, "crarr": 8629, "lArr": 8656, "uArr": 8657, "rArr": 8658, "dArr": 8659, "hArr": 8660, "forall": 8704, "part": 8706, "exist": 8707, "empty": 8709, "nabla": 8711, "isin": 8712, "notin": 8713, "ni": 8715, "prod": 8719, "sum": 8721, "minus": 8722, "lowast": 8727, "radic": 8730, "prop": 8733, "infin": 8734, "ang": 8736, "and": 8743, "or": 8744, "cap": 8745, "cup": 8746, "int": 8747, "there4": 8756, "sim": 8764, "cong": 8773, "asymp": 8776, "ne": 8800, "equiv": 8801, "le": 8804, "ge": 8805, "sub": 8834, "sup": 8835, "nsub": 8836, "sube": 8838, "supe": 8839, "oplus": 8853, "otimes": 8855, "perp": 8869, "sdot": 8901, "lceil": 8968, "rceil": 8969, "lfloor": 8970, "rfloor": 8971, "lang": 9001, "rang": 9002, "loz": 9674, "spades": 9824, "clubs": 9827, "hearts": 9829, "diams": 9830 });
+});
+BitVector.SMALL_BLOCK_SIZE = 32;
+BitVector.LARGE_BLOCK_SIZE = 256;
+BitVector.BLOCK_RATE = 8;
+$__jsx_lazy_init(BurrowsWheelerTransform, "END_MARKER", function () {
+ return String.fromCharCode(0);
+});
+var $__jsx_classMap = {
+ "tool/web/oktavia-english-search.jsx": {
+ _Main: _Main,
+ _Main$: _Main$
+ },
+ "tool/web/oktavia-search.jsx": {
+ _Result: _Result,
+ _Result$SSSI: _Result$SSSI,
+ _Proposal: _Proposal,
+ _Proposal$SSI: _Proposal$SSI,
+ OktaviaSearch: OktaviaSearch,
+ OktaviaSearch$I: OktaviaSearch$I,
+ _Main: _Main$0,
+ _Main$: _Main$0$
+ },
+ "src/oktavia.jsx": {
+ Oktavia: Oktavia,
+ Oktavia$: Oktavia$
+ },
+ "src/binary-util.jsx": {
+ Binary: Binary,
+ Binary$: Binary$,
+ LoadedStringResult: LoadedStringResult,
+ LoadedStringResult$SI: LoadedStringResult$SI,
+ LoadedStringListResult: LoadedStringListResult,
+ LoadedStringListResult$SI: LoadedStringListResult$SI,
+ LoadedStringListMapResult: LoadedStringListMapResult,
+ LoadedStringListMapResult$SI: LoadedStringListMapResult$SI,
+ LoadedNumberListResult: LoadedNumberListResult,
+ LoadedNumberListResult$SI: LoadedNumberListResult$SI,
+ CompressionReport: CompressionReport,
+ CompressionReport$: CompressionReport$
+ },
+ "src/query.jsx": {
+ Query: Query,
+ Query$: Query$
+ },
+ "src/query-string-parser.jsx": {
+ QueryStringParser: QueryStringParser,
+ QueryStringParser$: QueryStringParser$
+ },
+ "src/search-result.jsx": {
+ Proposal: Proposal,
+ Proposal$II: Proposal$II,
+ Position: Position,
+ Position$SIB: Position$SIB,
+ SearchUnit: SearchUnit,
+ SearchUnit$I: SearchUnit$I,
+ SingleResult: SingleResult,
+ SingleResult$: SingleResult$,
+ SingleResult$SBB: SingleResult$SBB,
+ SearchSummary: SearchSummary,
+ SearchSummary$: SearchSummary$,
+ SearchSummary$LOktavia$: SearchSummary$LOktavia$
+ },
+ "src/style.jsx": {
+ Style: Style,
+ Style$S: Style$S,
+ _HTMLHandler: _HTMLHandler,
+ _HTMLHandler$HASB: _HTMLHandler$HASB
+ },
+ "src/stemmer/stemmer.jsx": {
+ Stemmer: Stemmer,
+ Stemmer$: Stemmer$
+ },
+ "src/stemmer/base-stemmer.jsx": {
+ BaseStemmer: BaseStemmer,
+ BaseStemmer$: BaseStemmer$
+ },
+ "src/stemmer/english-stemmer.jsx": {
+ EnglishStemmer: EnglishStemmer,
+ EnglishStemmer$: EnglishStemmer$
+ },
+ "src/stemmer/among.jsx": {
+ Among: Among,
+ Among$SII: Among$SII,
+ Among$SIIF$LBaseStemmer$B$LBaseStemmer$: Among$SIIF$LBaseStemmer$B$LBaseStemmer$
+ },
+ "src/metadata.jsx": {
+ Metadata: Metadata,
+ Metadata$LOktavia$: Metadata$LOktavia$,
+ Section: Section,
+ Section$LOktavia$: Section$LOktavia$,
+ Splitter: Splitter,
+ Splitter$LOktavia$: Splitter$LOktavia$,
+ Splitter$LOktavia$S: Splitter$LOktavia$S,
+ Table: Table,
+ Table$LOktavia$AS: Table$LOktavia$AS,
+ Block: Block,
+ Block$LOktavia$: Block$LOktavia$
+ },
+ "src/fm-index.jsx": {
+ FMIndex: FMIndex,
+ FMIndex$: FMIndex$
+ },
+ "src/sax.jsx": {
+ Tag: Tag,
+ Tag$S: Tag$S,
+ _Common: _Common,
+ _Common$: _Common$,
+ _State: _State,
+ _State$: _State$,
+ SAXHandler: SAXHandler,
+ SAXHandler$: SAXHandler$,
+ SAXParser: SAXParser,
+ SAXParser$LSAXHandler$: SAXParser$LSAXHandler$,
+ SAXParser$LSAXHandler$B: SAXParser$LSAXHandler$B,
+ Char: Char,
+ Char$: Char$,
+ _Entities: _Entities,
+ _Entities$: _Entities$
+ },
+ "src/bit-vector.jsx": {
+ BitVector: BitVector,
+ BitVector$: BitVector$
+ },
+ "src/wavelet-matrix.jsx": {
+ WaveletMatrix: WaveletMatrix,
+ WaveletMatrix$: WaveletMatrix$
+ },
+ "src/burrows-wheeler-transform.jsx": {
+ BurrowsWheelerTransform: BurrowsWheelerTransform,
+ BurrowsWheelerTransform$: BurrowsWheelerTransform$
+ },
+ "src/sais.jsx": {
+ OArray: OArray,
+ OArray$AI: OArray$AI,
+ OArray$AII: OArray$AII,
+ SAIS: SAIS,
+ SAIS$: SAIS$
+ }
+};
+
+
+/**
+ * launches _Main.main(:string[]):void invoked by jsx --run|--executable
+ */
+JSX.runMain = function (sourceFile, args) {
+ var module = JSX.require(sourceFile);
+ if (! module) {
+ throw new ReferenceError("entry point module not found in " + sourceFile);
+ }
+ if (! module._Main) {
+ throw new ReferenceError("entry point _Main not found in " + sourceFile);
+ }
+ if (! module._Main.main$AS) {
+ throw new ReferenceError("entry point _Main.main(:string[]):void not found in " + sourceFile);
+ }
+ module._Main.main$AS(args);
+};
+
+/**
+ * launches _Test#test*():void invoked by jsx --test
+ */
+JSX.runTests = function (sourceFile, tests) {
+ var module = JSX.require(sourceFile);
+ var testClass = module._Test$;
+
+ if (!testClass) return; // skip if there's no test class
+
+ if(tests.length === 0) {
+ var p = testClass.prototype;
+ for (var m in p) {
+ if (p[m] instanceof Function
+ && /^test.*[$]$/.test(m)) {
+ tests.push(m);
+ }
+ }
+ }
+ else { // set as process arguments
+ tests = tests.map(function (name) {
+ return name + "$"; // mangle for function test*():void
+ });
+ }
+
+ var testCase = new testClass();
+
+ if (testCase.beforeClass$AS != null)
+ testCase.beforeClass$AS(tests);
+
+ for (var i = 0; i < tests.length; ++i) {
+ (function (method) {
+ if (method in testCase) {
+ testCase.run$SF$V$(method, function() { testCase[method](); });
+ }
+ else {
+ throw new ReferenceError("No such test method: " + method);
+ }
+ }(tests[i]));
+ }
+
+ if (testCase.afterClass$ != null)
+ testCase.afterClass$();
+};
+/**
+ * call a function on load/DOMContentLoaded
+ */
+function $__jsx_onload (event) {
+ window.removeEventListener("load", $__jsx_onload);
+ document.removeEventListener("DOMContentLoaded", $__jsx_onload);
+ JSX.runMain("tool/web/oktavia-english-search.jsx", [])
+}
+
+window.addEventListener("load", $__jsx_onload);
+document.addEventListener("DOMContentLoaded", $__jsx_onload);
+
+})(JSX);
diff --git a/web/server/h2o/libh2o/misc/oktavia/templates/jsdoc3/static/scripts/oktavia-jquery-highlight.js b/web/server/h2o/libh2o/misc/oktavia/templates/jsdoc3/static/scripts/oktavia-jquery-highlight.js
new file mode 100644
index 00000000..519e8876
--- /dev/null
+++ b/web/server/h2o/libh2o/misc/oktavia/templates/jsdoc3/static/scripts/oktavia-jquery-highlight.js
@@ -0,0 +1,105 @@
+/**
+ * @fileOverview
+ * A UI script helper that provides search word highlight.
+ * Almost all code came from Sphinx
+ * @author Yoshiki Shibukawa, yoshiki@shibu.jp
+ */
+
+(function ($)
+{
+ /**
+ * small helper function to urldecode strings
+ */
+ function urldecode(x)
+ {
+ return decodeURIComponent(x).replace(/\+/g, ' ');
+ }
+
+ /**
+ * This function returns the parsed url parameters of the
+ * current request. Multiple values per key are supported,
+ * it will always return arrays of strings for the value parts.
+ */
+ function getQueryParameters(s)
+ {
+ if (typeof s == 'undefined')
+ s = document.location.search;
+ var parts = s.substr(s.indexOf('?') + 1).split('&');
+ var result = {};
+ for (var i = 0; i < parts.length; i++)
+ {
+ var tmp = parts[i].split('=', 2);
+ var key = urldecode(tmp[0]);
+ var value = urldecode(tmp[1]);
+ if (key in result)
+ {
+ result[key].push(value);
+ }
+ else
+ {
+ result[key] = [value];
+ }
+ }
+ return result;
+ }
+
+ /**
+ * highlight a given string on a jquery object by wrapping it in
+ * span elements with the given class name.
+ */
+ jQuery.fn.highlightText = function(text, className)
+ {
+ function highlight(node)
+ {
+ if (node.nodeType == 3)
+ {
+ var val = node.nodeValue;
+ var pos = val.toLowerCase().indexOf(text);
+ if (pos >= 0 && !jQuery(node.parentNode).hasClass(className))
+ {
+ var span = document.createElement("span");
+ span.className = className;
+ span.appendChild(document.createTextNode(val.substr(pos, text.length)));
+ node.parentNode.insertBefore(span, node.parentNode.insertBefore(
+ document.createTextNode(val.substr(pos + text.length)),
+ node.nextSibling));
+ node.nodeValue = val.substr(0, pos);
+ }
+ }
+ else if (!jQuery(node).is("button, select, textarea"))
+ {
+ jQuery.each(node.childNodes, function() {
+ highlight(this);
+ });
+ }
+ }
+ return this.each(function() {
+ highlight(this);
+ });
+ };
+
+ /**
+ * highlight the search words provided in the url in the text
+ */
+ function highlightSearchWords(selector)
+ {
+ var params = getQueryParameters();
+ var terms = (params.highlight) ? params.highlight[0].split(/\s+/) : [];
+ if (terms.length)
+ {
+ var body = $(selector);
+ window.setTimeout(function()
+ {
+ $.each(terms, function()
+ {
+ body.highlightText(this.toLowerCase(), 'highlighted');
+ });
+ }, 10);
+ }
+ }
+
+ jQuery(document).ready(function () {
+ highlightSearchWords('body');
+ });
+})(jQuery);
+
diff --git a/web/server/h2o/libh2o/misc/oktavia/templates/jsdoc3/static/scripts/oktavia-jquery-ui.js b/web/server/h2o/libh2o/misc/oktavia/templates/jsdoc3/static/scripts/oktavia-jquery-ui.js
new file mode 100644
index 00000000..bd1efb8c
--- /dev/null
+++ b/web/server/h2o/libh2o/misc/oktavia/templates/jsdoc3/static/scripts/oktavia-jquery-ui.js
@@ -0,0 +1,521 @@
+/**
+ * @fileOverview
+ * A UI script that creates search form, loads an index files and show search results.
+ * It needs jQuery and <tt>oktavia-search.js</tt> or <tt>oktavia-*-search.js</tt>
+ * (stemming library supported versions).
+ * @author Yoshiki Shibukawa, yoshiki@shibu.jp
+ */
+
+(function ($)
+{
+ var logosrc;
+ /**
+ * @name SearchView
+ * @class
+ * Provides searching feature to your website.
+ * @constructor
+ * @param {jQeury} node Target node it has a search form and a search result window.
+ * @param {string} documentRoot Document root folder like '.', '../', '/'
+ * @param {string} index Index file path.
+ */
+ function SearchView(node, documentRoot, index)
+ {
+ var OktaviaSearch = JSX.require("tool/web/oktavia-search.jsx").OktaviaSearch$I;
+
+ /**
+ * Target node it contains a search form and a search result window.
+ * @type jQuery
+ */
+ this.node = node;
+ /**
+ * Search engine core
+ * @type OktaviaSearch
+ */
+ this.engine = new OktaviaSearch(5);
+ if (documentRoot === '')
+ {
+ /**
+ * Document root path
+ * @type string[]
+ */
+ this.documentRoot = [];
+ }
+ else if (documentRoot.slice(-1) === '/')
+ {
+ this.documentRoot = documentRoot.slice(0, -1).split(/\//g);
+ }
+ else
+ {
+ this.documentRoot = documentRoot.split(/\//g);
+ }
+
+ /**
+ * It is true if an index file is loaded.
+ * @type boolean
+ */
+ this.initialized = false;
+ /**
+ * It is true if an user search before loading an index.
+ * @type boolean
+ */
+ this.reserveSearch = false;
+
+ var indexURL;
+ switch (index.charAt(0))
+ {
+ case '.':
+ case '/':
+ indexURL = index;
+ break;
+ default:
+ indexURL = this.getDocumentPath(index);
+ break;
+ }
+ var self = this;
+ function loadIndex()
+ {
+ self.engine.loadIndex$S(window.searchIndex);
+ self.initialized = true;
+ window.searchIndex = null;
+ if (self.reserveSearch)
+ {
+ self.search();
+ }
+ self.reserveSearch = false;
+ }
+ if (window.searchIndex)
+ {
+ loadIndex()
+ }
+ else
+ {
+ this.loadJavaScript(indexURL, loadIndex);
+ }
+ }
+
+ /**
+ * Changes result page.
+ * @param {integer} page Page number
+ * @memberOf SearchView.prototype
+ * @method
+ */
+ SearchView.prototype.changePage = function (page)
+ {
+ this.engine.setCurrentPage$I(page);
+ this.updateResult();
+ };
+
+ /**
+ * Clears a search form and a reult window.
+ * @memberOf SearchView.prototype
+ * @method
+ */
+ SearchView.prototype.clearResult = function ()
+ {
+ $('.oktavia_search', this.node).val('');
+ $('.oktavia_searchresult_box', this.node).hide();
+ };
+
+ /**
+ * Loads an external JavaScript file.
+ *
+ * This code is based on: http://os0x.hatenablog.com/entry/20080827/1219815828
+ * @param {string} src A JavaScript source file path
+ * @param {function} callback It is called when the target JavaScript file is loaded
+ * @memberOf SearchView.prototype
+ * @method
+ */
+ SearchView.prototype.loadJavaScript = function (src, callback)
+ {
+ var sc = document.createElement('script');
+ sc.type = 'text/javascript';
+ if (window.ActiveXObject)
+ {
+ sc.onreadystatechange = function ()
+ {
+ if (sc.readyState === 'complete' || sc.readyState === 'loaded')
+ {
+ callback(sc.readyState);
+ }
+ };
+ }
+ else
+ {
+ sc.onload = function ()
+ {
+ callback('onload');
+ };
+ }
+ sc.src = src;
+ document.body.appendChild(sc);
+ };
+
+ /**
+ * Updates page navigation list.
+ * @memberOf SearchView.prototype
+ * @method
+ */
+ SearchView.prototype.updatePageList = function ()
+ {
+ var self = this;
+ function createCallback(i)
+ {
+ return function () {
+ self.changePage(i);
+ };
+ }
+
+ var currentPage = String(this.engine.currentPage$());
+ var nav = $('.oktavia_searchresult_nav', this.node);
+ nav.empty();
+ var pages = this.engine.pageIndexes$();
+ for (var i = 0; i < pages.length; i++)
+ {
+ var pageItem = $('<span/>').text(pages[i]);
+ if (pages[i] === '...')
+ {
+ pageItem.addClass('leader');
+ }
+ else
+ {
+ pageItem.addClass('page');
+ if (pages[i] !== currentPage)
+ {
+ pageItem.bind('click', createCallback(Number(pages[i])));
+ }
+ else
+ {
+ pageItem.addClass('selected');
+ }
+ }
+ nav.append(pageItem);
+ }
+ };
+
+ /**
+ * Updates result list in a result window.
+ * @memberOf SearchView.prototype
+ * @method
+ */
+ SearchView.prototype.updateResult = function ()
+ {
+ var totalPages = this.engine.totalPages$();
+ var resultslot = $('.oktavia_searchresult', this.node);
+ resultslot.empty();
+ var self = this;
+ function clearCallback()
+ {
+ self.clearResult();
+ }
+ var results = this.engine.getResult$();
+ var searchInput = $('.oktavia_search', this.node);
+ var queryWord = searchInput.val()
+ for (var i = 0; i < results.length; i++)
+ {
+ var result = results[i];
+ var url = this.getDocumentPath(result.url.slice(1))
+ var entry = $('<div/>', { "class": "entry" });
+ var link = $('<a/>', { "href": url + this.engine.getHighlight$() }).text(result.title);
+ link.bind('click', clearCallback);
+ entry.append($('<div/>', { "class": "title" }).append(link));
+ entry.append($('<div/>', { "class": "url" }).text(url));
+ entry.append($('<div/>', { "class": "resultcontent" }).html(result.content));
+ resultslot.append(entry);
+ }
+ this.updatePageList();
+ };
+
+ /**
+ * Searchs again by using proposal search words.
+ * @param {string} option Proposal search words
+ * @memberOf SearchView.prototype
+ * @method
+ */
+ SearchView.prototype.searchProposal = function (option)
+ {
+ $('.oktavia_search', this.node).val(option);
+ this.search();
+ };
+
+ /**
+ * Shows proposals when no result.
+ * @memberOf SearchView.prototype
+ * @method
+ */
+ SearchView.prototype.updateProposal = function ()
+ {
+ var nav = $('.oktavia_searchresult_nav', this.node);
+ var resultslot = $('.oktavia_searchresult', this.node);
+ nav.empty();
+ resultslot.empty();
+ var proposals = this.engine.getProposals$();
+ var self = this;
+ function createCallback(option)
+ {
+ return function ()
+ {
+ self.searchProposal(option);
+ };
+ }
+ for (var i = 0; i < proposals.length; i++)
+ {
+ var proposal = proposals[i];
+ var listitem = $('<div/>', {"class": "proposal"});
+ listitem.append('<span>Search with:&nbsp;</span>');
+ var option = $('<span/>', {"class": "option"});
+ option.html(proposal.label);
+ option.bind('click', createCallback(proposal.options));
+ listitem.append(option);
+ listitem.append('<span>&nbsp;&#x2192;&nbsp;' + proposal.count + ' results.</span>');
+ resultslot.append(listitem);
+ }
+ };
+
+ /**
+ * Performs search and shows results.
+ * @memberOf SearchView.prototype
+ * @method
+ */
+ SearchView.prototype.search = function ()
+ {
+ if (!this.initialized)
+ {
+ this.reserveSearch = true;
+ return;
+ }
+ var searchInput = $('.oktavia_search', this.node);
+ var queryWord = searchInput.val();
+ searchInput.blur();
+ var self = this;
+ this.engine.search$SF$IIV$(queryWord, function (total, pages)
+ {
+ $('.oktavia_searchresult_box', self.node).fadeIn();
+ var summaryNode = $('.oktavia_searchresult_summary', self.node);
+ if (total === 0)
+ {
+ summaryNode.text("No result.");
+ self.updateProposal();
+ }
+ else
+ {
+ summaryNode.text(total + ' results.');
+ self.updateResult();
+ }
+ });
+ };
+
+ /**
+ * Converts file path in index.
+ * @param {string} filePath Source filepath
+ * @returns {string} Result filepath
+ * @memberOf SearchView.prototype
+ * @method
+ */
+ SearchView.prototype.getDocumentPath = function (filePath)
+ {
+ var resultFilePath;
+ if (filePath.charAt(0) === '/')
+ {
+ resultFilePath = filePath;
+ }
+ else
+ {
+ var elements = filePath.split(/\//g);
+ var result = this.documentRoot.slice();
+ for (var i = 0; i < elements.length; i++)
+ {
+ var element = elements[i];
+ switch (element)
+ {
+ case '.':
+ break;
+ case '..':
+ result = result.slice(0, -1);
+ break;
+ default:
+ result.push(element);
+ break;
+ }
+ }
+ resultFilePath = result.join('/');
+ }
+ return resultFilePath;
+ };
+
+ /**
+ * Hides all result windows.
+ * @function
+ */
+ function eraseResultWindow()
+ {
+ $('.oktavia_searchresult_box:visible').hide();
+ }
+
+ /**
+ * jQuery plug-in to create search form and window.
+ * It can receive options from data attributes or an <tt>option</tt> parameter.
+ * @param {object} [option] Option
+ * @param {string} [option.index='search/searchindex.js'] Index file path.
+ * @param {string} [option.documentRoot='.'] Document root folder.
+ * @param {string} [option.logo='true'] Show logo in result windows. <tt>'false'</tt> or <tt>'disable'</tt> or falsy value disable logo.
+ * @name oktaviaSearch
+ * @function
+ */
+ jQuery.fn.oktaviaSearch = function (option)
+ {
+ var data = {
+ 'index': 'search/searchindex.js',
+ 'documentRoot': '.',
+ 'logo': 'true'
+ };
+ if (window.DOCUMENTATION_OPTIONS) // Sphinx
+ {
+ if (window.DOCUMENTATION_OPTIONS.URL_ROOT === '#')
+ {
+ data.documentRoot = '';
+ }
+ else
+ {
+ data.documentRoot = window.DOCUMENTATION_OPTIONS.URL_ROOT;
+ }
+ }
+ var userData = this.data();
+ var key;
+ for (key in userData)
+ {
+ if (userData.hasOwnProperty(key))
+ {
+ data[key] = userData[key];
+ }
+ }
+ for (key in option)
+ {
+ if (option.hasOwnProperty(key))
+ {
+ data[key] = option[key];
+ }
+ }
+ if (data.logo === 'false' || data.logo === 'disable' || !data.logo)
+ {
+ data.logo = false;
+ }
+ else
+ {
+ data.logo = true;
+ }
+ var view = new SearchView(this, data.documentRoot, data.index);
+
+ var form = $('<form class="oktavia_form"><input class="oktavia_search" result="10" type="search" name="search" value="" placeholder="Search" /></form>');
+ form.submit(function (event) {
+ event.stopPropagation();
+ setTimeout(function () {
+ view.search();
+ }, 10);
+ return false;
+ });
+ this.append(form);
+ var resultForm = $([
+ '<div class="oktavia_searchresult_box">',
+ '<div class="oktavia_close_search_box">&times;</div>',
+ '<div class="oktavia_searchresult_summary"></div>',
+ '<div class="oktavia_searchresult"></div>',
+ '<div class="oktavia_searchresult_nav"></div>',
+ '</div>'
+ ].join(''));
+ if (data.logo)
+ {
+ resultForm.append($('<span class="pr">Powered by <a href="http://oktavia.info"><img src="' + logosrc + '" width="86px" height="25px" alt="Oktavia"></img></a></span>'));
+ }
+ this.append(resultForm);
+ $('.oktavia_close_search_box', this.node).bind('click', function (event) {
+ view.clearResult();
+ });
+
+ // Click outside of the result window, close it
+ resultForm.bind('click', function (event) {
+ event.stopPropagation();
+ });
+ };
+
+ /**
+ * Global initailization.
+ * It add some event handlers.
+ * @name initialize
+ * @function
+ */
+ function initialize()
+ {
+
+ function onClick() {
+ eraseResultWindow();
+ return true;
+ }
+ function onKeyDown(event)
+ {
+ switch (event.keyCode)
+ {
+ case 191: // / : focus form
+ eraseResultWindow();
+ var form = $('form.oktavia_form:first input.search');
+ if ($(':focus', form).size() === 0)
+ {
+ form.focus();
+ }
+ break;
+ case 74: // j : down
+ case 75: // k : up
+ case 72: // h : before page
+ case 76: // l : next page
+ case 13: // enter : select
+ var result = $('.oktavia_searchresult_box:visible:first');
+ if (result.size() === 1)
+ {
+ switch (event.keyCode)
+ {
+ case 74: // j : down
+ console.log('down');
+ break;
+ case 75: // k : up
+ console.log('up');
+ break;
+ case 72: // h : before page
+ console.log('before');
+ break;
+ case 76: // l : next page
+ console.log('next');
+ break;
+ case 13: // enter : select
+ console.log('select');
+ break;
+ }
+ }
+ break;
+ }
+ return true;
+ }
+ var version = $.fn.jquery.split(/\./g);
+ var major = Number(version[0]);
+ var minor = Number(version[1]);
+ if (major === 1 && minor < 7)
+ {
+ $(document).live('click', onClick);
+ $(document).live('keydown', onKeyDown);
+ }
+ else
+ {
+ $(document).on('click', onClick);
+ $(document).on('keydown', onKeyDown);
+ }
+ }
+
+ var logosrc = "data:image/jpeg;base64, /9j/4AAQSkZJRgABAQEASABIAAD/4ge4SUNDX1BST0ZJTEUAAQEAAAeoYXBwbAIgAABtbnRyUkdCIFhZWiAH2QACABkACwAaAAthY3NwQVBQTAAAAABhcHBsAAAAAAAAAAAAAAAAAAAAAAAA9tYAAQAAAADTLWFwcGwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAtkZXNjAAABCAAAAG9kc2NtAAABeAAABWxjcHJ0AAAG5AAAADh3dHB0AAAHHAAAABRyWFlaAAAHMAAAABRnWFlaAAAHRAAAABRiWFlaAAAHWAAAABRyVFJDAAAHbAAAAA5jaGFkAAAHfAAAACxiVFJDAAAHbAAAAA5nVFJDAAAHbAAAAA5kZXNjAAAAAAAAABRHZW5lcmljIFJHQiBQcm9maWxlAAAAAAAAAAAAAAAUR2VuZXJpYyBSR0IgUHJvZmlsZQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAbWx1YwAAAAAAAAAeAAAADHNrU0sAAAAoAAABeGhySFIAAAAoAAABoGNhRVMAAAAkAAAByHB0QlIAAAAmAAAB7HVrVUEAAAAqAAACEmZyRlUAAAAoAAACPHpoVFcAAAAWAAACZGl0SVQAAAAoAAACem5iTk8AAAAmAAAComtvS1IAAAAWAAACyGNzQ1oAAAAiAAAC3mhlSUwAAAAeAAADAGRlREUAAAAsAAADHmh1SFUAAAAoAAADSnN2U0UAAAAmAAAConpoQ04AAAAWAAADcmphSlAAAAAaAAADiHJvUk8AAAAkAAADomVsR1IAAAAiAAADxnB0UE8AAAAmAAAD6G5sTkwAAAAoAAAEDmVzRVMAAAAmAAAD6HRoVEgAAAAkAAAENnRyVFIAAAAiAAAEWmZpRkkAAAAoAAAEfHBsUEwAAAAsAAAEpHJ1UlUAAAAiAAAE0GFyRUcAAAAmAAAE8mVuVVMAAAAmAAAFGGRhREsAAAAuAAAFPgBWAWEAZQBvAGIAZQBjAG4A/QAgAFIARwBCACAAcAByAG8AZgBpAGwARwBlAG4AZQByAGkBDQBrAGkAIABSAEcAQgAgAHAAcgBvAGYAaQBsAFAAZQByAGYAaQBsACAAUgBHAEIAIABnAGUAbgDoAHIAaQBjAFAAZQByAGYAaQBsACAAUgBHAEIAIABHAGUAbgDpAHIAaQBjAG8EFwQwBDMEMAQ7BEwEPQQ4BDkAIAQ/BEAEPgREBDAEOQQ7ACAAUgBHAEIAUAByAG8AZgBpAGwAIABnAOkAbgDpAHIAaQBxAHUAZQAgAFIAVgBCkBp1KAAgAFIARwBCACCCcl9pY8+P8ABQAHIAbwBmAGkAbABvACAAUgBHAEIAIABnAGUAbgBlAHIAaQBjAG8ARwBlAG4AZQByAGkAcwBrACAAUgBHAEIALQBwAHIAbwBmAGkAbMd8vBgAIABSAEcAQgAg1QS4XNMMx3wATwBiAGUAYwBuAP0AIABSAEcAQgAgAHAAcgBvAGYAaQBsBeQF6AXVBeQF2QXcACAAUgBHAEIAIAXbBdwF3AXZAEEAbABsAGcAZQBtAGUAaQBuAGUAcwAgAFIARwBCAC0AUAByAG8AZgBpAGwAwQBsAHQAYQBsAOEAbgBvAHMAIABSAEcAQgAgAHAAcgBvAGYAaQBsZm6QGgAgAFIARwBCACBjz4/wZYdO9k4AgiwAIABSAEcAQgAgMNcw7TDVMKEwpDDrAFAAcgBvAGYAaQBsACAAUgBHAEIAIABnAGUAbgBlAHIAaQBjA5MDtQO9A7kDugPMACADwAPBA78DxgOvA7sAIABSAEcAQgBQAGUAcgBmAGkAbAAgAFIARwBCACAAZwBlAG4A6QByAGkAYwBvAEEAbABnAGUAbQBlAGUAbgAgAFIARwBCAC0AcAByAG8AZgBpAGUAbA5CDhsOIw5EDh8OJQ5MACAAUgBHAEIAIA4XDjEOSA4nDkQOGwBHAGUAbgBlAGwAIABSAEcAQgAgAFAAcgBvAGYAaQBsAGkAWQBsAGUAaQBuAGUAbgAgAFIARwBCAC0AcAByAG8AZgBpAGkAbABpAFUAbgBpAHcAZQByAHMAYQBsAG4AeQAgAHAAcgBvAGYAaQBsACAAUgBHAEIEHgQxBEkEOAQ5ACAEPwRABD4ERAQ4BDsETAAgAFIARwBCBkUGRAZBACAGKgY5BjEGSgZBACAAUgBHAEIAIAYnBkQGOQYnBkUARwBlAG4AZQByAGkAYwAgAFIARwBCACAAUAByAG8AZgBpAGwAZQBHAGUAbgBlAHIAZQBsACAAUgBHAEIALQBiAGUAcwBrAHIAaQB2AGUAbABzAGV0ZXh0AAAAAENvcHlyaWdodCAyMDA3IEFwcGxlIEluYy4sIGFsbCByaWdodHMgcmVzZXJ2ZWQuAFhZWiAAAAAAAADzUgABAAAAARbPWFlaIAAAAAAAAHRNAAA97gAAA9BYWVogAAAAAAAAWnUAAKxzAAAXNFhZWiAAAAAAAAAoGgAAFZ8AALg2Y3VydgAAAAAAAAABAc0AAHNmMzIAAAAAAAEMQgAABd7///MmAAAHkgAA/ZH///ui///9owAAA9wAAMBs/+EAgEV4aWYAAE1NACoAAAAIAAUBEgADAAAAAQABAAABGgAFAAAAAQAAAEoBGwAFAAAAAQAAAFIBKAADAAAAAQACAACHaQAEAAAAAQAAAFoAAAAAAAAASAAAAAEAAABIAAAAAQACoAIABAAAAAEAAABWoAMABAAAAAEAAAAYAAAAAP/bAEMAAgICAgIBAgICAgICAgMDBgQDAwMDBwUFBAYIBwgICAcICAkKDQsJCQwKCAgLDwsMDQ4ODg4JCxARDw4RDQ4ODv/bAEMBAgICAwMDBgQEBg4JCAkODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODv/AABEIABgAVgMBIgACEQEDEQH/xAAfAAABBQEBAQEBAQAAAAAAAAAAAQIDBAUGBwgJCgv/xAC1EAACAQMDAgQDBQUEBAAAAX0BAgMABBEFEiExQQYTUWEHInEUMoGRoQgjQrHBFVLR8CQzYnKCCQoWFxgZGiUmJygpKjQ1Njc4OTpDREVGR0hJSlNUVVZXWFlaY2RlZmdoaWpzdHV2d3h5eoOEhYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3uLm6wsPExcbHyMnK0tPU1dbX2Nna4eLj5OXm5+jp6vHy8/T19vf4+fr/xAAfAQADAQEBAQEBAQEBAAAAAAAAAQIDBAUGBwgJCgv/xAC1EQACAQIEBAMEBwUEBAABAncAAQIDEQQFITEGEkFRB2FxEyIygQgUQpGhscEJIzNS8BVictEKFiQ04SXxFxgZGiYnKCkqNTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqCg4SFhoeIiYqSk5SVlpeYmZqio6Slpqeoqaqys7S1tre4ubrCw8TFxsfIycrS09TV1tfY2dri4+Tl5ufo6ery8/T19vf4+fr/2gAMAwEAAhEDEQA/AP3571+dfjn4ofEz4+/tjeJPg38JPE+peAfh/wCE9Q/szxJ4g0namo6xqCoss9tBM6sLe2gRlEkqqXLNtXnFfooa/Lj9jvU7PwH+3T+0D8J/E00Vt4usvHOs3MfmsAbqDUbmO+tp1J6qyN5ZPZkCnqBTQG7pnwW1VP2lde8FfB74qfF3R/E3hrT459f8Val4xutRsIryVd8Nq1ncGRZlYD5zlSoPHTBufD39oH4y+F9H8Xaj8Ur2w8SxeCvES6P4+0tLBIbzSklI8m/t5IwFmt2BBwVB/PI9Z+DOtWfhn/goR+0p8P8AxDcw6f4j1XV7bxLo0dw4U3+nyWwQvHk/MI3RlbH3a+SvG/jnRdbi/bY+JOkyJc+HvF0mm+BvBoiGf+Eh1OGPy3a2H/LUBnHzLkYXNfa0KNGnmlDCxpKVOpGmndXb5knKSb1i7t2cbWtrfW/w+IjiK2WVsRKu41ISm42dlGzajFpWUlZK6le921bS36G+GPHWq61+2r4+8I/2jFdeGdO8N6Xf6fEkKja1wZdz7wNzBgq8E4Fcr8T/ANpDwX4U0bw63hzxb4P1S5vPE8Gm3zveCRLW2WULdzDacHyhwxzhSwJz0Pxp430f4ww/H74qeEvABimudH+FHhxvFdvFcvDqGoW8KSCSztJFB2STBZlL9QFwOWr2L4k+IPh1r/7Fn7MuufDG00638E3XxJ8Pw6dbQQqPsymdlkgcdQ6uCrg8lgc5r1P7EwEcVhqk1zRlyK0bJL92neWm8nqu9m7nl1MzzN4PE0oS5Jpzd5Xb1ntHXaK0v00SXU+s9e+M/wAKfDGg6NqevfEDwrpljq9st1pckt8v+lwtyssYGSyH+8Bj3rQ0v4o/DrW7Hw/daR408OajBrl09ppElveowu50Xc0SY6yBeSvXHavmb/hIr7Uv22vivD8EvhJoXirxTpP2LTPFfibxX4ke0s7aRYQ8VpawiKVgqo4ZtiopJzyea+e7PQfFGteEv2tLyxh8Op8QPAXjrTfE+nW3htX+xLfWtos00UO7DfPGJImJAJYtx2rzcNw5g6tP35ODtF6uL+NpK8VrFJyTu3qleyvp6tfPsxp1PdhGSvJaKS+FNu0no20mrJWTduZ21/Rf4l6/d6N8PWtNC8UeF/C/jLU3Nv4cfXojLb3NyqmTyjGrKzAqrZKnKj5sHGD5j4L8W6fZfC6y+M3xg+IHguN9UQjSxY6iP7G0qFiR5Fs7HNxM2DvmILNgqoVBg+X6B4vsPj9+14vjbQ5xdeB/AXgBbq0kVt0b6tq1uZCPTfDbAA9wZe1eNfCXxXp9x8Ev2UdE8N/DhfiX8Xl8F3uq6PFqet/YdL0qzM5iluZiVcNIWwi7Y2Yc4IzzyUuFaLSlVlLnjbmjdJK8aklrKyWkY3b25no2kj13xhjIUKlCjThySb5Z8rcnZwi0mtWm3L3Vvy7pSlf9C/BnxO+H3xE+2f8ACEeMNB8TPaAG6isboPJCD0LJ94A+uMUV8JaxqPjex/4KWaZ/wmlh4A8NeJrr4bXUslp4Su5pdsI1C1VPtErpGXcndtwgAAPWisswyGlTlB0p6SSfR2+asntvZHDg+Iq/LKNan7ybV1dX+Tu16XZyPjX4k/tYftcfF/xR8Kvgh4b1/wDZ7+EOkanc6R4p8f8AiK2e31O6khkMcsVqqsGUHBwIW3FWy00BG1vWrX/gnT8EtJ+DfhvS/Dmq+NfDPxL0dnmT4m6dfKuvXs8mDI10zKY54jhQIXUqiqoXGM0UV8wfXC6h+xb418baxpK/Fv8Aad+IHjrRtOt5LSOKy8PadpV9PbyAeZDJexRmYI+BuCFc4x0yD6x8Lv2Pfgl8J/GOleINE0rX9e1jSQ40WfxHrM2oJpW8kubWJz5ULMScuqBj60UV00sdiKUXGE2k1Z2fTt6eRhPC0Zu8op9fn39dD2fTfhx4Y0r9oPxP8TrOG9XxXr+mWmnajK92zRNDamQwhYz8qkGR8kcnPPQV5ZqX7Kvwh1L4deMfCbWHiGx0HxF4lTxJLaWOuTwLp+pK277TZ7WH2Zi3JVMKTnjk0UVdLMsXTlzQqNPTq/s/D93TsKeEozVpRT3/AB3+8zT+yX8OIfEY1nSPEvxc8N6xPpdvp+sX2keOL22n1tIF2JJeOrZmn28GbIkOBluK9C+G/wADPhv8Jtc8WXngTR7nR4vEa2/9qWbX0s9vI0KMgkCSFsSOGYyPnMjEsxJ5ooq62bY2rBwnVk09GrvW21/Syt2M45fhozU1BXXWxL8MPgl8Pfg98LtY8H+A9KuNM0TU7+e9vElu3mkaSZQrYdiSFVQqqvRQABXAT/snfCj/AIQX4daNpD+NfC134GspLHw5rmh+JLi01O3tpGLPA86nMsbE5KuGFFFEc1xiqSqKrLmk7t3ers1r30bXo2U8Fh3BQ5FZdLfMS3/ZL+Elp4qtvEUA8aHxWtrPbXmvz+JrqfUNRSWSJ2+0zSMxlwYUCZ4RQVUKCRRRRTnm+Nl8VVv1ZCy3CramvuP/2Q==";
+ initialize();
+})(jQuery);
+
+jQuery(document).ready(function () {
+ var form = jQuery('#oktavia_search_form');
+ if (form.size() > 0)
+ {
+ form.oktaviaSearch();
+ }
+});
diff --git a/web/server/h2o/libh2o/misc/oktavia/templates/jsdoc3/static/scripts/prettify/Apache-License-2.0.txt b/web/server/h2o/libh2o/misc/oktavia/templates/jsdoc3/static/scripts/prettify/Apache-License-2.0.txt
new file mode 100644
index 00000000..d6456956
--- /dev/null
+++ b/web/server/h2o/libh2o/misc/oktavia/templates/jsdoc3/static/scripts/prettify/Apache-License-2.0.txt
@@ -0,0 +1,202 @@
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
diff --git a/web/server/h2o/libh2o/misc/oktavia/templates/jsdoc3/static/scripts/prettify/lang-css.js b/web/server/h2o/libh2o/misc/oktavia/templates/jsdoc3/static/scripts/prettify/lang-css.js
new file mode 100644
index 00000000..041e1f59
--- /dev/null
+++ b/web/server/h2o/libh2o/misc/oktavia/templates/jsdoc3/static/scripts/prettify/lang-css.js
@@ -0,0 +1,2 @@
+PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\f\r ]+/,null," \t\r\n "]],[["str",/^"(?:[^\n\f\r"\\]|\\(?:\r\n?|\n|\f)|\\[\S\s])*"/,null],["str",/^'(?:[^\n\f\r'\\]|\\(?:\r\n?|\n|\f)|\\[\S\s])*'/,null],["lang-css-str",/^url\(([^"')]*)\)/i],["kwd",/^(?:url|rgb|!important|@import|@page|@media|@charset|inherit)(?=[^\w-]|$)/i,null],["lang-css-kw",/^(-?(?:[_a-z]|\\[\da-f]+ ?)(?:[\w-]|\\\\[\da-f]+ ?)*)\s*:/i],["com",/^\/\*[^*]*\*+(?:[^*/][^*]*\*+)*\//],["com",
+/^(?:<\!--|--\>)/],["lit",/^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i],["lit",/^#[\da-f]{3,6}/i],["pln",/^-?(?:[_a-z]|\\[\da-f]+ ?)(?:[\w-]|\\\\[\da-f]+ ?)*/i],["pun",/^[^\s\w"']+/]]),["css"]);PR.registerLangHandler(PR.createSimpleLexer([],[["kwd",/^-?(?:[_a-z]|\\[\da-f]+ ?)(?:[\w-]|\\\\[\da-f]+ ?)*/i]]),["css-kw"]);PR.registerLangHandler(PR.createSimpleLexer([],[["str",/^[^"')]+/]]),["css-str"]);
diff --git a/web/server/h2o/libh2o/misc/oktavia/templates/jsdoc3/static/scripts/prettify/prettify.js b/web/server/h2o/libh2o/misc/oktavia/templates/jsdoc3/static/scripts/prettify/prettify.js
new file mode 100644
index 00000000..eef5ad7e
--- /dev/null
+++ b/web/server/h2o/libh2o/misc/oktavia/templates/jsdoc3/static/scripts/prettify/prettify.js
@@ -0,0 +1,28 @@
+var q=null;window.PR_SHOULD_USE_CONTINUATION=!0;
+(function(){function L(a){function m(a){var f=a.charCodeAt(0);if(f!==92)return f;var b=a.charAt(1);return(f=r[b])?f:"0"<=b&&b<="7"?parseInt(a.substring(1),8):b==="u"||b==="x"?parseInt(a.substring(2),16):a.charCodeAt(1)}function e(a){if(a<32)return(a<16?"\\x0":"\\x")+a.toString(16);a=String.fromCharCode(a);if(a==="\\"||a==="-"||a==="["||a==="]")a="\\"+a;return a}function h(a){for(var f=a.substring(1,a.length-1).match(/\\u[\dA-Fa-f]{4}|\\x[\dA-Fa-f]{2}|\\[0-3][0-7]{0,2}|\\[0-7]{1,2}|\\[\S\s]|[^\\]/g),a=
+[],b=[],o=f[0]==="^",c=o?1:0,i=f.length;c<i;++c){var j=f[c];if(/\\[bdsw]/i.test(j))a.push(j);else{var j=m(j),d;c+2<i&&"-"===f[c+1]?(d=m(f[c+2]),c+=2):d=j;b.push([j,d]);d<65||j>122||(d<65||j>90||b.push([Math.max(65,j)|32,Math.min(d,90)|32]),d<97||j>122||b.push([Math.max(97,j)&-33,Math.min(d,122)&-33]))}}b.sort(function(a,f){return a[0]-f[0]||f[1]-a[1]});f=[];j=[NaN,NaN];for(c=0;c<b.length;++c)i=b[c],i[0]<=j[1]+1?j[1]=Math.max(j[1],i[1]):f.push(j=i);b=["["];o&&b.push("^");b.push.apply(b,a);for(c=0;c<
+f.length;++c)i=f[c],b.push(e(i[0])),i[1]>i[0]&&(i[1]+1>i[0]&&b.push("-"),b.push(e(i[1])));b.push("]");return b.join("")}function y(a){for(var f=a.source.match(/\[(?:[^\\\]]|\\[\S\s])*]|\\u[\dA-Fa-f]{4}|\\x[\dA-Fa-f]{2}|\\\d+|\\[^\dux]|\(\?[!:=]|[()^]|[^()[\\^]+/g),b=f.length,d=[],c=0,i=0;c<b;++c){var j=f[c];j==="("?++i:"\\"===j.charAt(0)&&(j=+j.substring(1))&&j<=i&&(d[j]=-1)}for(c=1;c<d.length;++c)-1===d[c]&&(d[c]=++t);for(i=c=0;c<b;++c)j=f[c],j==="("?(++i,d[i]===void 0&&(f[c]="(?:")):"\\"===j.charAt(0)&&
+(j=+j.substring(1))&&j<=i&&(f[c]="\\"+d[i]);for(i=c=0;c<b;++c)"^"===f[c]&&"^"!==f[c+1]&&(f[c]="");if(a.ignoreCase&&s)for(c=0;c<b;++c)j=f[c],a=j.charAt(0),j.length>=2&&a==="["?f[c]=h(j):a!=="\\"&&(f[c]=j.replace(/[A-Za-z]/g,function(a){a=a.charCodeAt(0);return"["+String.fromCharCode(a&-33,a|32)+"]"}));return f.join("")}for(var t=0,s=!1,l=!1,p=0,d=a.length;p<d;++p){var g=a[p];if(g.ignoreCase)l=!0;else if(/[a-z]/i.test(g.source.replace(/\\u[\da-f]{4}|\\x[\da-f]{2}|\\[^UXux]/gi,""))){s=!0;l=!1;break}}for(var r=
+{b:8,t:9,n:10,v:11,f:12,r:13},n=[],p=0,d=a.length;p<d;++p){g=a[p];if(g.global||g.multiline)throw Error(""+g);n.push("(?:"+y(g)+")")}return RegExp(n.join("|"),l?"gi":"g")}function M(a){function m(a){switch(a.nodeType){case 1:if(e.test(a.className))break;for(var g=a.firstChild;g;g=g.nextSibling)m(g);g=a.nodeName;if("BR"===g||"LI"===g)h[s]="\n",t[s<<1]=y++,t[s++<<1|1]=a;break;case 3:case 4:g=a.nodeValue,g.length&&(g=p?g.replace(/\r\n?/g,"\n"):g.replace(/[\t\n\r ]+/g," "),h[s]=g,t[s<<1]=y,y+=g.length,
+t[s++<<1|1]=a)}}var e=/(?:^|\s)nocode(?:\s|$)/,h=[],y=0,t=[],s=0,l;a.currentStyle?l=a.currentStyle.whiteSpace:window.getComputedStyle&&(l=document.defaultView.getComputedStyle(a,q).getPropertyValue("white-space"));var p=l&&"pre"===l.substring(0,3);m(a);return{a:h.join("").replace(/\n$/,""),c:t}}function B(a,m,e,h){m&&(a={a:m,d:a},e(a),h.push.apply(h,a.e))}function x(a,m){function e(a){for(var l=a.d,p=[l,"pln"],d=0,g=a.a.match(y)||[],r={},n=0,z=g.length;n<z;++n){var f=g[n],b=r[f],o=void 0,c;if(typeof b===
+"string")c=!1;else{var i=h[f.charAt(0)];if(i)o=f.match(i[1]),b=i[0];else{for(c=0;c<t;++c)if(i=m[c],o=f.match(i[1])){b=i[0];break}o||(b="pln")}if((c=b.length>=5&&"lang-"===b.substring(0,5))&&!(o&&typeof o[1]==="string"))c=!1,b="src";c||(r[f]=b)}i=d;d+=f.length;if(c){c=o[1];var j=f.indexOf(c),k=j+c.length;o[2]&&(k=f.length-o[2].length,j=k-c.length);b=b.substring(5);B(l+i,f.substring(0,j),e,p);B(l+i+j,c,C(b,c),p);B(l+i+k,f.substring(k),e,p)}else p.push(l+i,b)}a.e=p}var h={},y;(function(){for(var e=a.concat(m),
+l=[],p={},d=0,g=e.length;d<g;++d){var r=e[d],n=r[3];if(n)for(var k=n.length;--k>=0;)h[n.charAt(k)]=r;r=r[1];n=""+r;p.hasOwnProperty(n)||(l.push(r),p[n]=q)}l.push(/[\S\s]/);y=L(l)})();var t=m.length;return e}function u(a){var m=[],e=[];a.tripleQuotedStrings?m.push(["str",/^(?:'''(?:[^'\\]|\\[\S\s]|''?(?=[^']))*(?:'''|$)|"""(?:[^"\\]|\\[\S\s]|""?(?=[^"]))*(?:"""|$)|'(?:[^'\\]|\\[\S\s])*(?:'|$)|"(?:[^"\\]|\\[\S\s])*(?:"|$))/,q,"'\""]):a.multiLineStrings?m.push(["str",/^(?:'(?:[^'\\]|\\[\S\s])*(?:'|$)|"(?:[^"\\]|\\[\S\s])*(?:"|$)|`(?:[^\\`]|\\[\S\s])*(?:`|$))/,
+q,"'\"`"]):m.push(["str",/^(?:'(?:[^\n\r'\\]|\\.)*(?:'|$)|"(?:[^\n\r"\\]|\\.)*(?:"|$))/,q,"\"'"]);a.verbatimStrings&&e.push(["str",/^@"(?:[^"]|"")*(?:"|$)/,q]);var h=a.hashComments;h&&(a.cStyleComments?(h>1?m.push(["com",/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,q,"#"]):m.push(["com",/^#(?:(?:define|elif|else|endif|error|ifdef|include|ifndef|line|pragma|undef|warning)\b|[^\n\r]*)/,q,"#"]),e.push(["str",/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h|[a-z]\w*)>/,q])):m.push(["com",/^#[^\n\r]*/,
+q,"#"]));a.cStyleComments&&(e.push(["com",/^\/\/[^\n\r]*/,q]),e.push(["com",/^\/\*[\S\s]*?(?:\*\/|$)/,q]));a.regexLiterals&&e.push(["lang-regex",/^(?:^^\.?|[!+-]|!=|!==|#|%|%=|&|&&|&&=|&=|\(|\*|\*=|\+=|,|-=|->|\/|\/=|:|::|;|<|<<|<<=|<=|=|==|===|>|>=|>>|>>=|>>>|>>>=|[?@[^]|\^=|\^\^|\^\^=|{|\||\|=|\|\||\|\|=|~|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\s*(\/(?=[^*/])(?:[^/[\\]|\\[\S\s]|\[(?:[^\\\]]|\\[\S\s])*(?:]|$))+\/)/]);(h=a.types)&&e.push(["typ",h]);a=(""+a.keywords).replace(/^ | $/g,
+"");a.length&&e.push(["kwd",RegExp("^(?:"+a.replace(/[\s,]+/g,"|")+")\\b"),q]);m.push(["pln",/^\s+/,q," \r\n\t\xa0"]);e.push(["lit",/^@[$_a-z][\w$@]*/i,q],["typ",/^(?:[@_]?[A-Z]+[a-z][\w$@]*|\w+_t\b)/,q],["pln",/^[$_a-z][\w$@]*/i,q],["lit",/^(?:0x[\da-f]+|(?:\d(?:_\d+)*\d*(?:\.\d*)?|\.\d\+)(?:e[+-]?\d+)?)[a-z]*/i,q,"0123456789"],["pln",/^\\[\S\s]?/,q],["pun",/^.[^\s\w"-$'./@\\`]*/,q]);return x(m,e)}function D(a,m){function e(a){switch(a.nodeType){case 1:if(k.test(a.className))break;if("BR"===a.nodeName)h(a),
+a.parentNode&&a.parentNode.removeChild(a);else for(a=a.firstChild;a;a=a.nextSibling)e(a);break;case 3:case 4:if(p){var b=a.nodeValue,d=b.match(t);if(d){var c=b.substring(0,d.index);a.nodeValue=c;(b=b.substring(d.index+d[0].length))&&a.parentNode.insertBefore(s.createTextNode(b),a.nextSibling);h(a);c||a.parentNode.removeChild(a)}}}}function h(a){function b(a,d){var e=d?a.cloneNode(!1):a,f=a.parentNode;if(f){var f=b(f,1),g=a.nextSibling;f.appendChild(e);for(var h=g;h;h=g)g=h.nextSibling,f.appendChild(h)}return e}
+for(;!a.nextSibling;)if(a=a.parentNode,!a)return;for(var a=b(a.nextSibling,0),e;(e=a.parentNode)&&e.nodeType===1;)a=e;d.push(a)}var k=/(?:^|\s)nocode(?:\s|$)/,t=/\r\n?|\n/,s=a.ownerDocument,l;a.currentStyle?l=a.currentStyle.whiteSpace:window.getComputedStyle&&(l=s.defaultView.getComputedStyle(a,q).getPropertyValue("white-space"));var p=l&&"pre"===l.substring(0,3);for(l=s.createElement("LI");a.firstChild;)l.appendChild(a.firstChild);for(var d=[l],g=0;g<d.length;++g)e(d[g]);m===(m|0)&&d[0].setAttribute("value",
+m);var r=s.createElement("OL");r.className="linenums";for(var n=Math.max(0,m-1|0)||0,g=0,z=d.length;g<z;++g)l=d[g],l.className="L"+(g+n)%10,l.firstChild||l.appendChild(s.createTextNode("\xa0")),r.appendChild(l);a.appendChild(r)}function k(a,m){for(var e=m.length;--e>=0;){var h=m[e];A.hasOwnProperty(h)?window.console&&console.warn("cannot override language handler %s",h):A[h]=a}}function C(a,m){if(!a||!A.hasOwnProperty(a))a=/^\s*</.test(m)?"default-markup":"default-code";return A[a]}function E(a){var m=
+a.g;try{var e=M(a.h),h=e.a;a.a=h;a.c=e.c;a.d=0;C(m,h)(a);var k=/\bMSIE\b/.test(navigator.userAgent),m=/\n/g,t=a.a,s=t.length,e=0,l=a.c,p=l.length,h=0,d=a.e,g=d.length,a=0;d[g]=s;var r,n;for(n=r=0;n<g;)d[n]!==d[n+2]?(d[r++]=d[n++],d[r++]=d[n++]):n+=2;g=r;for(n=r=0;n<g;){for(var z=d[n],f=d[n+1],b=n+2;b+2<=g&&d[b+1]===f;)b+=2;d[r++]=z;d[r++]=f;n=b}for(d.length=r;h<p;){var o=l[h+2]||s,c=d[a+2]||s,b=Math.min(o,c),i=l[h+1],j;if(i.nodeType!==1&&(j=t.substring(e,b))){k&&(j=j.replace(m,"\r"));i.nodeValue=
+j;var u=i.ownerDocument,v=u.createElement("SPAN");v.className=d[a+1];var x=i.parentNode;x.replaceChild(v,i);v.appendChild(i);e<o&&(l[h+1]=i=u.createTextNode(t.substring(b,o)),x.insertBefore(i,v.nextSibling))}e=b;e>=o&&(h+=2);e>=c&&(a+=2)}}catch(w){"console"in window&&console.log(w&&w.stack?w.stack:w)}}var v=["break,continue,do,else,for,if,return,while"],w=[[v,"auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"],
+"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],F=[w,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"],G=[w,"abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"],
+H=[G,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var"],w=[w,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"],I=[v,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"],
+J=[v,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"],v=[v,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],K=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)/,N=/\S/,O=u({keywords:[F,H,w,"caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END"+
+I,J,v],hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0}),A={};k(O,["default-code"]);k(x([],[["pln",/^[^<?]+/],["dec",/^<!\w[^>]*(?:>|$)/],["com",/^<\!--[\S\s]*?(?:--\>|$)/],["lang-",/^<\?([\S\s]+?)(?:\?>|$)/],["lang-",/^<%([\S\s]+?)(?:%>|$)/],["pun",/^(?:<[%?]|[%?]>)/],["lang-",/^<xmp\b[^>]*>([\S\s]+?)<\/xmp\b[^>]*>/i],["lang-js",/^<script\b[^>]*>([\S\s]*?)(<\/script\b[^>]*>)/i],["lang-css",/^<style\b[^>]*>([\S\s]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),
+["default-markup","htm","html","mxml","xhtml","xml","xsl"]);k(x([["pln",/^\s+/,q," \t\r\n"],["atv",/^(?:"[^"]*"?|'[^']*'?)/,q,"\"'"]],[["tag",/^^<\/?[a-z](?:[\w-.:]*\w)?|\/?>$/i],["atn",/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^\s"'>]*(?:[^\s"'/>]|\/(?=\s)))/],["pun",/^[/<->]+/],["lang-js",/^on\w+\s*=\s*"([^"]+)"/i],["lang-js",/^on\w+\s*=\s*'([^']+)'/i],["lang-js",/^on\w+\s*=\s*([^\s"'>]+)/i],["lang-css",/^style\s*=\s*"([^"]+)"/i],["lang-css",/^style\s*=\s*'([^']+)'/i],["lang-css",
+/^style\s*=\s*([^\s"'>]+)/i]]),["in.tag"]);k(x([],[["atv",/^[\S\s]+/]]),["uq.val"]);k(u({keywords:F,hashComments:!0,cStyleComments:!0,types:K}),["c","cc","cpp","cxx","cyc","m"]);k(u({keywords:"null,true,false"}),["json"]);k(u({keywords:H,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:K}),["cs"]);k(u({keywords:G,cStyleComments:!0}),["java"]);k(u({keywords:v,hashComments:!0,multiLineStrings:!0}),["bsh","csh","sh"]);k(u({keywords:I,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),
+["cv","py"]);k(u({keywords:"caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END",hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["perl","pl","pm"]);k(u({keywords:J,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb"]);k(u({keywords:w,cStyleComments:!0,regexLiterals:!0}),["js"]);k(u({keywords:"all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,true,try,unless,until,when,while,yes",
+hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]);k(x([],[["str",/^[\S\s]+/]]),["regex"]);window.prettyPrintOne=function(a,m,e){var h=document.createElement("PRE");h.innerHTML=a;e&&D(h,e);E({g:m,i:e,h:h});return h.innerHTML};window.prettyPrint=function(a){function m(){for(var e=window.PR_SHOULD_USE_CONTINUATION?l.now()+250:Infinity;p<h.length&&l.now()<e;p++){var n=h[p],k=n.className;if(k.indexOf("prettyprint")>=0){var k=k.match(g),f,b;if(b=
+!k){b=n;for(var o=void 0,c=b.firstChild;c;c=c.nextSibling)var i=c.nodeType,o=i===1?o?b:c:i===3?N.test(c.nodeValue)?b:o:o;b=(f=o===b?void 0:o)&&"CODE"===f.tagName}b&&(k=f.className.match(g));k&&(k=k[1]);b=!1;for(o=n.parentNode;o;o=o.parentNode)if((o.tagName==="pre"||o.tagName==="code"||o.tagName==="xmp")&&o.className&&o.className.indexOf("prettyprint")>=0){b=!0;break}b||((b=(b=n.className.match(/\blinenums\b(?::(\d+))?/))?b[1]&&b[1].length?+b[1]:!0:!1)&&D(n,b),d={g:k,h:n,i:b},E(d))}}p<h.length?setTimeout(m,
+250):a&&a()}for(var e=[document.getElementsByTagName("pre"),document.getElementsByTagName("code"),document.getElementsByTagName("xmp")],h=[],k=0;k<e.length;++k)for(var t=0,s=e[k].length;t<s;++t)h.push(e[k][t]);var e=q,l=Date;l.now||(l={now:function(){return+new Date}});var p=0,d,g=/\blang(?:uage)?-([\w.]+)(?!\S)/;m()};window.PR={createSimpleLexer:x,registerLangHandler:k,sourceDecorator:u,PR_ATTRIB_NAME:"atn",PR_ATTRIB_VALUE:"atv",PR_COMMENT:"com",PR_DECLARATION:"dec",PR_KEYWORD:"kwd",PR_LITERAL:"lit",
+PR_NOCODE:"nocode",PR_PLAIN:"pln",PR_PUNCTUATION:"pun",PR_SOURCE:"src",PR_STRING:"str",PR_TAG:"tag",PR_TYPE:"typ"}})();
diff --git a/web/server/h2o/libh2o/misc/oktavia/templates/jsdoc3/static/styles/jsdoc-default.css b/web/server/h2o/libh2o/misc/oktavia/templates/jsdoc3/static/styles/jsdoc-default.css
new file mode 100644
index 00000000..ea49f607
--- /dev/null
+++ b/web/server/h2o/libh2o/misc/oktavia/templates/jsdoc3/static/styles/jsdoc-default.css
@@ -0,0 +1,283 @@
+html
+{
+ overflow: auto;
+ background-color: #fff;
+}
+
+body
+{
+ font: 14px "DejaVu Sans Condensed", "Liberation Sans", "Nimbus Sans L", Tahoma, Geneva, "Helvetica Neue", Helvetica, Arial, sans serif;
+ line-height: 130%;
+ color: #000;
+ background-color: #fff;
+}
+
+a {
+ color: #444;
+}
+
+a:visited {
+ color: #444;
+}
+
+a:active {
+ color: #444;
+}
+
+header
+{
+ display: block;
+ padding: 6px 4px;
+}
+
+.class-description {
+ font-style: italic;
+ font-family: Palatino, 'Palatino Linotype', serif;
+ font-size: 130%;
+ line-height: 140%;
+ margin-bottom: 1em;
+ margin-top: 1em;
+}
+
+#main {
+ float: left;
+ width: 100%;
+}
+
+section
+{
+ display: block;
+
+ background-color: #fff;
+ padding: 12px 24px;
+ border-bottom: 1px solid #ccc;
+ margin-right: 240px;
+}
+
+.variation {
+ display: none;
+}
+
+.optional:after {
+ content: "opt";
+ font-size: 60%;
+ color: #aaa;
+ font-style: italic;
+ font-weight: lighter;
+}
+
+nav
+{
+ display: block;
+ float: left;
+ margin-left: -230px;
+ margin-top: 28px;
+ width: 220px;
+ border-left: 1px solid #ccc;
+ padding-left: 9px;
+}
+
+nav ul {
+ font-family: 'Lucida Grande', 'Lucida Sans Unicode', arial, sans-serif;
+ font-size: 100%;
+ line-height: 17px;
+ padding:0;
+ margin:0;
+ list-style-type:none;
+}
+
+nav h2 a, nav h2 a:visited {
+ color: #A35A00;
+ text-decoration: none;
+}
+
+nav h3 {
+ margin-top: 12px;
+}
+
+nav li {
+ margin-top: 6px;
+}
+
+nav a {
+ color: #5C5954;
+}
+
+nav a:visited {
+ color: #5C5954;
+}
+
+nav a:active {
+ color: #5C5954;
+}
+
+footer {
+ display: block;
+ padding: 6px;
+ margin-top: 12px;
+ font-style: italic;
+ font-size: 90%;
+}
+
+h1
+{
+ font-size: 200%;
+ font-weight: bold;
+ letter-spacing: -0.01em;
+ margin: 6px 0 9px 0;
+}
+
+h2
+{
+ font-size: 170%;
+ font-weight: bold;
+ letter-spacing: -0.01em;
+ margin: 6px 0 3px 0;
+}
+
+h3
+{
+ font-size: 150%;
+ font-weight: bold;
+ letter-spacing: -0.01em;
+ margin-top: 16px;
+ margin: 6px 0 3px 0;
+}
+
+h4
+{
+ font-size: 130%;
+ font-weight: bold;
+ letter-spacing: -0.01em;
+ margin-top: 16px;
+ margin: 18px 0 3px 0;
+ color: #A35A00;
+}
+
+h5, .container-overview .subsection-title
+{
+ font-size: 120%;
+ font-weight: bold;
+ letter-spacing: -0.01em;
+ margin: 8px 0 3px -16px;
+}
+
+h6
+{
+ font-size: 100%;
+ letter-spacing: -0.01em;
+ margin: 6px 0 3px 0;
+ font-style: italic;
+}
+
+.ancestors { color: #999; }
+.ancestors a
+{
+ color: #999 !important;
+ text-decoration: none;
+}
+
+.important
+{
+ font-weight: bold;
+ color: #950B02;
+}
+
+.yes-def {
+ text-indent: -1000px;
+}
+
+.type-signature {
+ color: #aaa;
+}
+
+.name, .signature {
+ font-family: Consolas, "Lucida Console", Monaco, monospace;
+}
+
+.details { margin-top: 14px; }
+.details dt { width:100px; float:left; border-left: 2px solid #DDD; padding-left: 10px; padding-top: 6px; }
+.details dd { margin-left: 50px; }
+.details ul { margin: 0; }
+.details ul { list-style-type: none; }
+.details li { margin-left: 30px; padding-top: 6px; }
+
+.description {
+ margin-bottom: 1em;
+ margin-left: -16px;
+ margin-top: 1em;
+}
+
+.code-caption
+{
+ font-style: italic;
+ font-family: Palatino, 'Palatino Linotype', serif;
+ font-size: 107%;
+ margin: 0;
+}
+
+.prettyprint
+{
+ border: 1px solid #ddd;
+ width: 80%;
+ overflow: auto;
+}
+
+.prettyprint.source {
+ width: inherit;
+}
+
+.prettyprint code
+{
+ font-family: Consolas, 'Lucida Console', Monaco, monospace;
+ font-size: 100%;
+ line-height: 18px;
+ display: block;
+ padding: 4px 12px;
+ margin: 0;
+ background-color: #fff;
+ color: #000;
+ border-left: 3px #ddd solid;
+}
+
+.params, .props
+{
+ border-spacing: 0;
+ border: 0;
+ border-collapse: collapse;
+}
+
+.params .name, .props .name, .name code {
+ color: #A35A00;
+ font-family: Consolas, 'Lucida Console', Monaco, monospace;
+ font-size: 100%;
+}
+
+.params td, .params th, .props td, .props th
+{
+ border: 1px solid #ddd;
+ margin: 0px;
+ text-align: left;
+ vertical-align: top;
+ padding: 4px 6px;
+ display: table-cell;
+}
+
+.params thead tr, .props thead tr
+{
+ background-color: #ddd;
+ font-weight: bold;
+}
+
+.params .params thead tr, .props .props thead tr
+{
+ background-color: #fff;
+ font-weight: bold;
+}
+
+.params th, .props th { border-right: 1px solid #aaa; }
+.params thead .last, .props thead .last { border-right: 1px solid #ddd; }
+
+.disabled {
+ color: #454545;
+}
diff --git a/web/server/h2o/libh2o/misc/oktavia/templates/jsdoc3/static/styles/prettify-jsdoc.css b/web/server/h2o/libh2o/misc/oktavia/templates/jsdoc3/static/styles/prettify-jsdoc.css
new file mode 100644
index 00000000..5a2526e3
--- /dev/null
+++ b/web/server/h2o/libh2o/misc/oktavia/templates/jsdoc3/static/styles/prettify-jsdoc.css
@@ -0,0 +1,111 @@
+/* JSDoc prettify.js theme */
+
+/* plain text */
+.pln {
+ color: #000000;
+ font-weight: normal;
+ font-style: normal;
+}
+
+/* string content */
+.str {
+ color: #006400;
+ font-weight: normal;
+ font-style: normal;
+}
+
+/* a keyword */
+.kwd {
+ color: #000000;
+ font-weight: bold;
+ font-style: normal;
+}
+
+/* a comment */
+.com {
+ font-weight: normal;
+ font-style: italic;
+}
+
+/* a type name */
+.typ {
+ color: #000000;
+ font-weight: normal;
+ font-style: normal;
+}
+
+/* a literal value */
+.lit {
+ color: #006400;
+ font-weight: normal;
+ font-style: normal;
+}
+
+/* punctuation */
+.pun {
+ color: #000000;
+ font-weight: bold;
+ font-style: normal;
+}
+
+/* lisp open bracket */
+.opn {
+ color: #000000;
+ font-weight: bold;
+ font-style: normal;
+}
+
+/* lisp close bracket */
+.clo {
+ color: #000000;
+ font-weight: bold;
+ font-style: normal;
+}
+
+/* a markup tag name */
+.tag {
+ color: #006400;
+ font-weight: normal;
+ font-style: normal;
+}
+
+/* a markup attribute name */
+.atn {
+ color: #006400;
+ font-weight: normal;
+ font-style: normal;
+}
+
+/* a markup attribute value */
+.atv {
+ color: #006400;
+ font-weight: normal;
+ font-style: normal;
+}
+
+/* a declaration */
+.dec {
+ color: #000000;
+ font-weight: bold;
+ font-style: normal;
+}
+
+/* a variable name */
+.var {
+ color: #000000;
+ font-weight: normal;
+ font-style: normal;
+}
+
+/* a function name */
+.fun {
+ color: #000000;
+ font-weight: bold;
+ font-style: normal;
+}
+
+/* Specify class=linenums on a pre to get line numbering */
+ol.linenums {
+ margin-top: 0;
+ margin-bottom: 0;
+}
diff --git a/web/server/h2o/libh2o/misc/oktavia/templates/jsdoc3/static/styles/prettify-tomorrow.css b/web/server/h2o/libh2o/misc/oktavia/templates/jsdoc3/static/styles/prettify-tomorrow.css
new file mode 100644
index 00000000..aa2908c2
--- /dev/null
+++ b/web/server/h2o/libh2o/misc/oktavia/templates/jsdoc3/static/styles/prettify-tomorrow.css
@@ -0,0 +1,132 @@
+/* Tomorrow Theme */
+/* Original theme - https://github.com/chriskempson/tomorrow-theme */
+/* Pretty printing styles. Used with prettify.js. */
+/* SPAN elements with the classes below are added by prettyprint. */
+/* plain text */
+.pln {
+ color: #4d4d4c; }
+
+@media screen {
+ /* string content */
+ .str {
+ color: #718c00; }
+
+ /* a keyword */
+ .kwd {
+ color: #8959a8; }
+
+ /* a comment */
+ .com {
+ color: #8e908c; }
+
+ /* a type name */
+ .typ {
+ color: #4271ae; }
+
+ /* a literal value */
+ .lit {
+ color: #f5871f; }
+
+ /* punctuation */
+ .pun {
+ color: #4d4d4c; }
+
+ /* lisp open bracket */
+ .opn {
+ color: #4d4d4c; }
+
+ /* lisp close bracket */
+ .clo {
+ color: #4d4d4c; }
+
+ /* a markup tag name */
+ .tag {
+ color: #c82829; }
+
+ /* a markup attribute name */
+ .atn {
+ color: #f5871f; }
+
+ /* a markup attribute value */
+ .atv {
+ color: #3e999f; }
+
+ /* a declaration */
+ .dec {
+ color: #f5871f; }
+
+ /* a variable name */
+ .var {
+ color: #c82829; }
+
+ /* a function name */
+ .fun {
+ color: #4271ae; } }
+/* Use higher contrast and text-weight for printable form. */
+@media print, projection {
+ .str {
+ color: #060; }
+
+ .kwd {
+ color: #006;
+ font-weight: bold; }
+
+ .com {
+ color: #600;
+ font-style: italic; }
+
+ .typ {
+ color: #404;
+ font-weight: bold; }
+
+ .lit {
+ color: #044; }
+
+ .pun, .opn, .clo {
+ color: #440; }
+
+ .tag {
+ color: #006;
+ font-weight: bold; }
+
+ .atn {
+ color: #404; }
+
+ .atv {
+ color: #060; } }
+/* Style */
+/*
+pre.prettyprint {
+ background: white;
+ font-family: Menlo, Monaco, Consolas, monospace;
+ font-size: 12px;
+ line-height: 1.5;
+ border: 1px solid #ccc;
+ padding: 10px; }
+*/
+
+/* Specify class=linenums on a pre to get line numbering */
+ol.linenums {
+ margin-top: 0;
+ margin-bottom: 0; }
+
+/* IE indents via margin-left */
+li.L0,
+li.L1,
+li.L2,
+li.L3,
+li.L4,
+li.L5,
+li.L6,
+li.L7,
+li.L8,
+li.L9 {
+ /* */ }
+
+/* Alternate shading for lines */
+li.L1,
+li.L3,
+li.L5,
+li.L7,
+li.L9 {
+ /* */ }
diff --git a/web/server/h2o/libh2o/misc/oktavia/templates/jsdoc3/static/styles/searchstyle.css b/web/server/h2o/libh2o/misc/oktavia/templates/jsdoc3/static/styles/searchstyle.css
new file mode 100644
index 00000000..a3d51d43
--- /dev/null
+++ b/web/server/h2o/libh2o/misc/oktavia/templates/jsdoc3/static/styles/searchstyle.css
@@ -0,0 +1,174 @@
+form.oktavia_form {
+ position: relative;
+ display: block;
+ width: 240px;
+ height: 25px;
+}
+
+input.oktavia_search {
+ -webkit-appearance: searchfield;
+ -webkit-user-select: text;
+ cursor: auto;
+ background-color: white;
+ color: black;
+ line-height: normal;
+ display: inline-block;
+ padding: 1px;
+ text-align: start;
+ margin: 2px 0px 2px 0px;
+ padding: 1px;
+}
+
+div.oktavia_searchresult_box {
+ display: none;
+ position: absolute;
+ width: 500px;
+ padding: 10px;
+ right: 10px;
+ background-color: #ffffff;
+ -moz-border-radius: 8px;
+ border-radius: 8px;
+ -moz-box-shadow: 3px 3px 5px 5px #b5b2b2;
+ box-shadow: 3px 3px 5px 5px #b5b2b2;
+ opacity: 0.95;
+ z-index: 100000;
+}
+
+div.oktavia_close_search_box {
+ position: absolute;
+ top: 10px;
+ right: 10px;
+ width: 20px;
+ height: 20px;
+ text-align: center;
+ vertical-align: middle;
+ color: #666;
+}
+
+div.oktavia_close_search_box:hover {
+ background-color: #d1e8ff;
+ border: 1px solid gray;
+}
+
+div.oktavia_close_search_box:active {
+ background-color: #b4c8db;
+ border: 1px solid gray;
+}
+
+
+div.oktavia_searchresult_summary {
+ color: #444;
+}
+
+div.oktavia_searchresult .entry {
+ margin: 10px 10px 10px 10px;
+ color: black;
+}
+
+div.oktavia_searchresult .entry .title {
+ font-size: normal;
+}
+
+div.oktavia_searchresult .entry .title a:link {
+ color: #0000EE;
+ text-decoration: underline;
+}
+
+div.oktavia_searchresult .entry .title a:visited {
+ color: #551A8B;
+ text-decoration: underline;
+}
+
+div.oktavia_searchresult .entry .title a:hover {
+}
+
+div.oktavia_searchresult .entry .title a:active {
+ color: #FF0000;
+ text-decoration: underline;
+}
+
+div.oktavia_searchresult .entry .url {
+ font-size: 14px!important;
+ color: #093;
+ font-style: normal;
+ font-family: arial,sans-serif;
+}
+
+div.oktavia_searchresult .entry .resultcontent {
+ font-size: small;
+ font-family: arial,sans-serif;
+ color: #222;
+}
+
+div.oktavia_searchresult .entry .resultcontent .hit {
+ font-weight: bolder;
+ text-decoration: underline;
+}
+
+div.oktavia_searchresult .proposal {
+ margin: 10px 10px 10px 10px;
+ color: #222;
+ font-size: small;
+ font-family: arial,sans-serif;
+}
+
+div.oktavia_searchresult .proposal .option {
+ background-color: #e8f4ff;
+ border-bottom: 1px solid blue;
+}
+
+div.oktavia_searchresult .proposal .option:hover {
+ background-color: #d1e8ff;
+}
+
+div.oktavia_searchresult .proposal .option:active {
+ background-color: #b4c8db;
+}
+
+div.oktavia_searchresult_nav span.leader {
+ color: #228;
+}
+
+div.oktavia_searchresult_nav span.page {
+ background-color: #ffffff;
+ border: 1px solid #888888;
+ padding: 5px;
+ margin: 5px;
+ color: #222;
+}
+
+div.oktavia_searchresult_nav span.page:hover {
+ background-color: #d1e8ff;
+ border: 1px solid #7d98ff;
+}
+
+div.oktavia_searchresult_nav span.page:active {
+ background-color: #b4c8db;
+ border: 1px solid #6c83db;
+}
+
+div.oktavia_searchresult_nav span.selected {
+ background-color: #b4c8db;
+ border: 1px solid #6c83db;
+}
+
+div.oktavia_searchresult_nav span.selected:hover {
+ background-color: #b4c8db;
+ border: 1px solid #6c83db;
+}
+
+div.oktavia_searchresult_nav span.selected:active {
+ background-color: #b4c8db;
+ border: 1px solid #6c83db;
+}
+
+div.oktavia_searchresult_box span.pr {
+ position: absolute;
+ right: 10px;
+ bottom: 10px;
+ color: #555;
+}
+
+.highlighted {
+ background-color: #fbe54e;
+}
diff --git a/web/server/h2o/libh2o/misc/oktavia/templates/jsdoc3/tmpl/container.tmpl b/web/server/h2o/libh2o/misc/oktavia/templates/jsdoc3/tmpl/container.tmpl
new file mode 100644
index 00000000..cd3e5a65
--- /dev/null
+++ b/web/server/h2o/libh2o/misc/oktavia/templates/jsdoc3/tmpl/container.tmpl
@@ -0,0 +1,154 @@
+<?js
+ var self = this;
+ docs.forEach(function(doc, i) {
+?>
+
+<?js if (doc.kind === 'mainpage' || (doc.kind === 'package')) { ?>
+ <?js= self.partial('mainpage.tmpl', doc) ?>
+<?js } else if (doc.kind === 'source') { ?>
+ <?js= self.partial('source.tmpl', doc) ?>
+<?js } else { ?>
+
+<section>
+
+<header>
+ <h2><?js if (doc.ancestors && doc.ancestors.length) { ?>
+ <span class="ancestors"><?js= doc.ancestors.join('') ?></span>
+ <?js } ?>
+ <?js= doc.name ?>
+ <?js if (doc.variation) { ?>
+ <sup class="variation"><?js= doc.variation ?></sup>
+ <?js } ?></h2>
+ <?js if (doc.classdesc) { ?>
+ <div class="class-description"><?js= doc.classdesc ?></div>
+ <?js } ?>
+</header>
+
+<article>
+ <div class="container-overview">
+ <?js if (doc.kind === 'module' && doc.module) { ?>
+ <?js= self.partial('method.tmpl', doc.module) ?>
+ <?js } ?>
+
+ <?js if (doc.kind === 'class') { ?>
+ <?js= self.partial('method.tmpl', doc) ?>
+ <?js } else { ?>
+ <?js if (doc.description) { ?>
+ <div class="description"><?js= doc.description ?></div>
+ <?js } ?>
+
+ <?js= self.partial('details.tmpl', doc) ?>
+
+ <?js if (doc.examples && doc.examples.length) { ?>
+ <h3>Example<?js= doc.examples.length > 1? 's':'' ?></h3>
+ <?js= self.partial('examples.tmpl', doc.examples) ?>
+ <?js } ?>
+ <?js } ?>
+ </div>
+
+ <?js if (doc.augments && doc.augments.length) { ?>
+ <h3 class="subsection-title">Extends</h3>
+
+ <ul><?js doc.augments.forEach(function(a) { ?>
+ <li><?js= self.linkto(a, a) ?></li>
+ <?js }); ?></ul>
+ <?js } ?>
+
+ <?js if (doc.mixes && doc.mixes.length) { ?>
+ <h3 class="subsection-title">Mixes In</h3>
+
+ <ul><?js doc.mixes.forEach(function(a) { ?>
+ <li><?js= self.linkto(a, a) ?></li>
+ <?js }); ?></ul>
+ <?js } ?>
+
+ <?js if (doc.requires && doc.requires.length) { ?>
+ <h3 class="subsection-title">Requires</h3>
+
+ <ul><?js doc.requires.forEach(function(r) { ?>
+ <li><?js= self.linkto(r, r) ?></li>
+ <?js }); ?></ul>
+ <?js } ?>
+
+ <?js
+ var classes = self.find({kind: 'class', memberof: doc.longname});
+ if (doc.kind !== 'globalobj' && classes && classes.length) {
+ ?>
+ <h3 class="subsection-title">Classes</h3>
+
+ <dl><?js classes.forEach(function(c) { ?>
+ <dt><?js= self.linkto(c.longname, c.name) ?></dt>
+ <dd><?js if (c.summary) { ?><?js= c.summary ?><?js } ?></dd>
+ <?js }); ?></dl>
+ <?js } ?>
+
+ <?js
+ var namespaces = self.find({kind: 'namespace', memberof: doc.longname});
+ if (doc.kind !== 'globalobj' && namespaces && namespaces.length) {
+ ?>
+ <h3 class="subsection-title">Namespaces</h3>
+
+ <dl><?js namespaces.forEach(function(n) { ?>
+ <dt><a href="namespaces.html#<?js= n.longname ?>"><?js= self.linkto(n.longname, n.name) ?></a></dt>
+ <dd><?js if (n.summary) { ?><?js= n.summary ?><?js } ?></dd>
+ <?js }); ?></dl>
+ <?js } ?>
+
+ <?js
+ var members = self.find({kind: 'member', memberof: title === 'Global' ? {isUndefined: true} : doc.longname});
+ if (members && members.length && members.forEach) {
+ ?>
+ <h3 class="subsection-title">Members</h3>
+
+ <dl><?js members.forEach(function(p) { ?>
+ <?js= self.partial('members.tmpl', p) ?>
+ <?js }); ?></dl>
+ <?js } ?>
+
+ <?js
+ var methods = self.find({kind: 'function', memberof: title === 'Global' ? {isUndefined: true} : doc.longname});
+ if (methods && methods.length && methods.forEach) {
+ ?>
+ <h3 class="subsection-title">Methods</h3>
+
+ <dl><?js methods.forEach(function(m) { ?>
+ <?js= self.partial('method.tmpl', m) ?>
+ <?js }); ?></dl>
+ <?js } ?>
+
+ <?js
+ var typedefs = self.find({kind: 'typedef', memberof: title === 'Global' ? {isUndefined: true} : doc.longname});
+ if (typedefs && typedefs.length && typedefs.forEach) {
+ ?>
+ <h3 class="subsection-title">Type Definitions</h3>
+
+ <dl><?js typedefs.forEach(function(e) {
+ if (e.signature) {
+ ?>
+ <?js= self.partial('method.tmpl', e) ?>
+ <?js
+ }
+ else {
+ ?>
+ <?js= self.partial('members.tmpl', e) ?>
+ <?js
+ }
+ }); ?></dl>
+ <?js } ?>
+
+ <?js
+ var events = self.find({kind: 'event', memberof: title === 'Global' ? {isUndefined: true} : doc.longname});
+ if (events && events.length && events.forEach) {
+ ?>
+ <h3 class="subsection-title">Events</h3>
+
+ <dl><?js events.forEach(function(e) { ?>
+ <?js= self.partial('method.tmpl', e) ?>
+ <?js }); ?></dl>
+ <?js } ?>
+</article>
+
+</section>
+<?js } ?>
+
+<?js }); ?>
diff --git a/web/server/h2o/libh2o/misc/oktavia/templates/jsdoc3/tmpl/details.tmpl b/web/server/h2o/libh2o/misc/oktavia/templates/jsdoc3/tmpl/details.tmpl
new file mode 100644
index 00000000..941a03de
--- /dev/null
+++ b/web/server/h2o/libh2o/misc/oktavia/templates/jsdoc3/tmpl/details.tmpl
@@ -0,0 +1,98 @@
+<?js
+var data = obj;
+var self = this;
+?>
+<dl class="details">
+ <?js
+ var properties = data.properties;
+ if (properties && properties.length && properties.forEach) {
+ ?>
+
+ <h5 class="subsection-title">Properties:</h5>
+
+ <dl><?js= this.partial('properties.tmpl', properties) ?></dl>
+
+ <?js } ?>
+
+ <?js if (data.version) {?>
+ <dt class="tag-version">Version:</dt>
+ <dd class="tag-version"><ul class="dummy"><li><?js= version ?></li></ul></dd>
+ <?js } ?>
+
+ <?js if (data.since) {?>
+ <dt class="tag-since">Since:</dt>
+ <dd class="tag-since"><ul class="dummy"><li><?js= since ?></dd>
+ <?js } ?>
+
+ <?js if (data.inherited && data.inherits) { ?>
+ <dt class="inherited-from">Inherited From:</dt>
+ <dd class="inherited-from"><ul class="dummy"><li>
+ <?js= this.linkto(data.inherits, this.htmlsafe(data.inherits)) ?>
+ </li></dd>
+ <?js } ?>
+
+ <?js if (data.deprecated) { ?>
+ <dt class="important tag-deprecated">Deprecated:</dt><?js
+ if (data.deprecated === true) { ?><dd class="yes-def tag-deprecated"><ul class="dummy"><li>Yes</li></ul></dd><?js }
+ else { ?><dd><ul class="dummy"><li><?js= data.deprecated ?></li><ul></dd><?js }
+ ?>
+ <?js } ?>
+
+ <?js if (data.author && author.length) {?>
+ <dt class="tag-author">Author:</dt>
+ <dd class="tag-author">
+ <ul><?js author.forEach(function(a) { ?>
+ <li><?js= self.resolveAuthorLinks(a) ?></li>
+ <?js }); ?></ul>
+ </dd>
+ <?js } ?>
+
+ <?js if (data.copyright) {?>
+ <dt class="tag-copyright">Copyright:</dt>
+ <dd class="tag-copyright"><ul class="dummy"><li><?js= copyright ?></li></ul></dd>
+ <?js } ?>
+
+ <?js if (data.license) {?>
+ <dt class="tag-license">License:</dt>
+ <dd class="tag-license"><ul class="dummy"><li><?js= license ?></li></ul></dd>
+ <?js } ?>
+
+ <?js if (data.defaultvalue) {?>
+ <dt class="tag-default">Default Value:</dt>
+ <dd class="tag-default"><ul class="dummy"><li><?js= data.defaultvalue ?></li></ul></dd>
+ <?js } ?>
+
+ <?js if (data.meta) {?>
+ <dt class="tag-source">Source:</dt>
+ <dd class="tag-source"><ul class="dummy"><li>
+ <?js= self.linkto(meta.filename) ?>, line <?js= meta.lineno ?>
+ </li></ul></dd>
+ <?js } ?>
+
+ <?js if (data.tutorials && tutorials.length) {?>
+ <dt class="tag-tutorial">Tutorials:</dt>
+ <dd class="tag-tutorial">
+ <ul><?js tutorials.forEach(function(t) { ?>
+ <li><?js= self.tutoriallink(t) ?></li>
+ <?js }); ?></ul>
+ </dd>
+ <?js } ?>
+
+ <?js if (data.see && see.length) {?>
+ <dt class="tag-see">See:</dt>
+ <dd class="tag-see">
+ <ul><?js see.forEach(function(s) { ?>
+ <li><?js= self.linkto(s) ?></li>
+ <?js }); ?></ul>
+ </dd>
+ <?js } ?>
+
+ <?js if (data.todo && todo.length) {?>
+ <dt class="tag-todo">To Do:</dt>
+ <dd class="tag-todo">
+ <ul><?js todo.forEach(function(t) { ?>
+ <li><?js= t ?></li>
+ <?js }); ?></ul>
+ </dd>
+ <?js } ?>
+</dl>
diff --git a/web/server/h2o/libh2o/misc/oktavia/templates/jsdoc3/tmpl/example.tmpl b/web/server/h2o/libh2o/misc/oktavia/templates/jsdoc3/tmpl/example.tmpl
new file mode 100644
index 00000000..e87caa5b
--- /dev/null
+++ b/web/server/h2o/libh2o/misc/oktavia/templates/jsdoc3/tmpl/example.tmpl
@@ -0,0 +1,2 @@
+<?js var data = obj; ?>
+<pre><code><?js= data ?></code></pre>
diff --git a/web/server/h2o/libh2o/misc/oktavia/templates/jsdoc3/tmpl/examples.tmpl b/web/server/h2o/libh2o/misc/oktavia/templates/jsdoc3/tmpl/examples.tmpl
new file mode 100644
index 00000000..23384c9d
--- /dev/null
+++ b/web/server/h2o/libh2o/misc/oktavia/templates/jsdoc3/tmpl/examples.tmpl
@@ -0,0 +1,11 @@
+<?js
+ var data = obj;
+ data.forEach(function(example) {
+ if (example.caption) {
+ ?>
+ <p class="code-caption"><?js= example.caption ?></p>
+ <?js } ?>
+ <pre class="prettyprint"><code><?js= example.code ?></code></pre>
+<?js
+ });
+?> \ No newline at end of file
diff --git a/web/server/h2o/libh2o/misc/oktavia/templates/jsdoc3/tmpl/exceptions.tmpl b/web/server/h2o/libh2o/misc/oktavia/templates/jsdoc3/tmpl/exceptions.tmpl
new file mode 100644
index 00000000..660afa21
--- /dev/null
+++ b/web/server/h2o/libh2o/misc/oktavia/templates/jsdoc3/tmpl/exceptions.tmpl
@@ -0,0 +1,19 @@
+<?js
+ var data = obj;
+ if (data.description) {
+?>
+<div class="param-desc">
+ <?js= description ?>
+</div>
+<?js } ?>
+
+<?js if (data.type && data.type.names) {?>
+<dl>
+ <dt>
+ Type
+ </dt>
+ <dd>
+ <?js= this.partial('type.tmpl', data.type.names) ?>
+ </dd>
+</dl>
+<?js } ?> \ No newline at end of file
diff --git a/web/server/h2o/libh2o/misc/oktavia/templates/jsdoc3/tmpl/fires.tmpl b/web/server/h2o/libh2o/misc/oktavia/templates/jsdoc3/tmpl/fires.tmpl
new file mode 100644
index 00000000..21cfd229
--- /dev/null
+++ b/web/server/h2o/libh2o/misc/oktavia/templates/jsdoc3/tmpl/fires.tmpl
@@ -0,0 +1,4 @@
+<?js var data = obj; ?>
+<li>
+ <?js= data ?>
+</li> \ No newline at end of file
diff --git a/web/server/h2o/libh2o/misc/oktavia/templates/jsdoc3/tmpl/layout.tmpl b/web/server/h2o/libh2o/misc/oktavia/templates/jsdoc3/tmpl/layout.tmpl
new file mode 100644
index 00000000..ec112458
--- /dev/null
+++ b/web/server/h2o/libh2o/misc/oktavia/templates/jsdoc3/tmpl/layout.tmpl
@@ -0,0 +1,45 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta charset="utf-8">
+ <title>JSDoc: <?js= title ?></title>
+
+ <script src="scripts/prettify/prettify.js"> </script>
+ <script src="scripts/prettify/lang-css.js"> </script>
+ <script src="scripts/jquery-1.9.1.min.js"> </script>
+ <script src="scripts/oktavia-english-search.js"> </script>
+ <script src="scripts/oktavia-jquery-ui.js"> </script>
+ <script src="scripts/oktavia-jquery-highlight.js"> </script>
+ <script src="scripts/prettify/lang-css.js"> </script>
+ <!--[if lt IE 9]>
+ <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
+ <![endif]-->
+ <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
+ <link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
+ <link type="text/css" rel="stylesheet" href="styles/searchstyle.css">
+</head>
+
+<body>
+
+<div id="main">
+
+ <h1 class="page-title"><?js= title ?></h1>
+
+ <?js= content ?>
+</div>
+
+<nav>
+ <?js= this.nav ?>
+ <h2>Search</h2>
+ <div id="oktavia_search_form" data-document-root="." data-index="./scripts/searchindex.js" style="position: relative;"/>
+</nav>
+
+<br clear="both">
+
+<footer>
+ Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc <?js= env.version.number ?></a> on <?js= (new Date()) ?>
+</footer>
+
+<script> prettyPrint(); </script>
+</body>
+</html>
diff --git a/web/server/h2o/libh2o/misc/oktavia/templates/jsdoc3/tmpl/mainpage.tmpl b/web/server/h2o/libh2o/misc/oktavia/templates/jsdoc3/tmpl/mainpage.tmpl
new file mode 100644
index 00000000..64e9e594
--- /dev/null
+++ b/web/server/h2o/libh2o/misc/oktavia/templates/jsdoc3/tmpl/mainpage.tmpl
@@ -0,0 +1,14 @@
+<?js
+var data = obj;
+var self = this;
+?>
+
+<?js if (data.kind === 'package') { ?>
+ <h3><?js= data.name ?> <?js= data.version ?></h3>
+<?js } ?>
+
+<?js if (data.readme) { ?>
+ <section>
+ <article><?js= data.readme ?></article>
+ </section>
+<?js } ?>
diff --git a/web/server/h2o/libh2o/misc/oktavia/templates/jsdoc3/tmpl/members.tmpl b/web/server/h2o/libh2o/misc/oktavia/templates/jsdoc3/tmpl/members.tmpl
new file mode 100644
index 00000000..c76f772c
--- /dev/null
+++ b/web/server/h2o/libh2o/misc/oktavia/templates/jsdoc3/tmpl/members.tmpl
@@ -0,0 +1,22 @@
+<?js var data = obj; ?>
+<dt>
+ <h4 class="name" id="<?js= id ?>"><?js= data.attribs + name + (data.signature ? data.signature : '') ?></h4>
+
+ <?js if (data.summary) { ?>
+ <p class="summary"><?js= summary ?></p>
+ <?js } ?>
+</dt>
+<dd>
+ <?js if (data.description) { ?>
+ <div class="description">
+ <?js= data.description ?>
+ </div>
+ <?js } ?>
+
+ <?js= this.partial('details.tmpl', data) ?>
+
+ <?js if (data.examples && examples.length) { ?>
+ <h5>Example<?js= examples.length > 1? 's':'' ?></h5>
+ <?js= this.partial('examples.tmpl', examples) ?>
+ <?js } ?>
+</dd>
diff --git a/web/server/h2o/libh2o/misc/oktavia/templates/jsdoc3/tmpl/method.tmpl b/web/server/h2o/libh2o/misc/oktavia/templates/jsdoc3/tmpl/method.tmpl
new file mode 100644
index 00000000..1eb9032d
--- /dev/null
+++ b/web/server/h2o/libh2o/misc/oktavia/templates/jsdoc3/tmpl/method.tmpl
@@ -0,0 +1,76 @@
+<?js
+var data = obj;
+var self = this;
+?>
+<dt>
+ <h4 class="name" id="<?js= id ?>"><?js= data.attribs + (kind === 'class' ? 'new ' : '') + name + (kind !== 'event' ? data.signature : '') ?></h4>
+
+ <?js if (data.summary) { ?>
+ <p class="summary"><?js= summary ?></p>
+ <?js } ?>
+</dt>
+<dd>
+
+ <?js if (data.description) { ?>
+ <div class="description">
+ <?js= data.description ?>
+ </div>
+ <?js } ?>
+
+ <?js if (kind === 'event' && data.type && data.type.names) {?>
+ <h5>Type:</h5>
+ <ul>
+ <li>
+ <?js= self.partial('type.tmpl', data.type.names) ?>
+ </li>
+ </ul>
+ <?js } ?>
+
+ <?js if (data['this']) { ?>
+ <h5>This:</h5>
+ <ul><li><?js= this.linkto(data['this'], data['this']) ?></li></ul>
+ <?js } ?>
+
+ <?js if (data.params && params.length) { ?>
+ <h5>Parameters:</h5>
+ <?js= this.partial('params.tmpl', params) ?>
+ <?js } ?>
+
+ <?js= this.partial('details.tmpl', data) ?>
+
+ <?js if (data.fires && fires.length) { ?>
+ <h5>Fires:</h5>
+ <ul><?js fires.forEach(function(f) { ?>
+ <?js= self.partial('fires.tmpl', self.linkto(f) ) ?>
+ <?js }); ?></ul>
+ <?js } ?>
+
+ <?js if (data.exceptions && exceptions.length) { ?>
+ <h5>Throws:</h5>
+ <?js if (exceptions.length > 1) { ?><ul><?js
+ exceptions.forEach(function(r) { ?>
+ <li><?js= self.partial('exceptions.tmpl', r) ?></li>
+ <?js });
+ ?></ul><?js } else {
+ exceptions.forEach(function(r) { ?>
+ <?js= self.partial('exceptions.tmpl', r) ?>
+ <?js });
+ } } ?>
+
+ <?js if (data.returns && returns.length) { ?>
+ <h5>Returns:</h5>
+ <?js if (returns.length > 1) { ?><ul><?js
+ returns.forEach(function(r) { ?>
+ <li><?js= self.partial('returns.tmpl', r) ?></li>
+ <?js });
+ ?></ul><?js } else {
+ returns.forEach(function(r) { ?>
+ <?js= self.partial('returns.tmpl', r) ?>
+ <?js });
+ } } ?>
+
+ <?js if (data.examples && examples.length) { ?>
+ <h5>Example<?js= examples.length > 1? 's':'' ?></h5>
+ <?js= this.partial('examples.tmpl', examples) ?>
+ <?js } ?>
+</dd>
diff --git a/web/server/h2o/libh2o/misc/oktavia/templates/jsdoc3/tmpl/params.tmpl b/web/server/h2o/libh2o/misc/oktavia/templates/jsdoc3/tmpl/params.tmpl
new file mode 100644
index 00000000..ca81f8f8
--- /dev/null
+++ b/web/server/h2o/libh2o/misc/oktavia/templates/jsdoc3/tmpl/params.tmpl
@@ -0,0 +1,108 @@
+<?js
+ var params = obj;
+
+ /* sort subparams under their parent params (like opts.classname) */
+ var parentParam = null;
+ params.forEach(function(param, i) {
+ if (!param) { return; }
+ if ( parentParam && param.name && param.name.indexOf(parentParam.name + '.') === 0 ) {
+ param.name = param.name.substr(parentParam.name.length+1);
+ parentParam.subparams = parentParam.subparams || [];
+ parentParam.subparams.push(param);
+ params[i] = null;
+ }
+ else {
+ parentParam = param;
+ }
+ });
+
+ /* determine if we need extra columns, "attributes" and "default" */
+ params.hasAttributes = false;
+ params.hasDefault = false;
+ params.hasName = false;
+
+ params.forEach(function(param) {
+ if (!param) { return; }
+
+ if (param.optional || param.nullable) {
+ params.hasAttributes = true;
+ }
+
+ if (param.name) {
+ params.hasName = true;
+ }
+
+ if (typeof param.defaultvalue !== 'undefined') {
+ params.hasDefault = true;
+ }
+ });
+?>
+
+<table class="params">
+ <thead>
+ <tr>
+ <?js if (params.hasName) {?>
+ <th>Name</th>
+ <?js } ?>
+
+ <th>Type</th>
+
+ <?js if (params.hasAttributes) {?>
+ <th>Argument</th>
+ <?js } ?>
+
+ <?js if (params.hasDefault) {?>
+ <th>Default</th>
+ <?js } ?>
+
+ <th class="last">Description</th>
+ </tr>
+ </thead>
+
+ <tbody>
+ <?js
+ var self = this;
+ params.forEach(function(param) {
+ if (!param) { return; }
+ ?>
+
+ <tr>
+ <?js if (params.hasName) {?>
+ <td class="name"><code><?js= param.name ?></code></td>
+ <?js } ?>
+
+ <td class="type">
+ <?js if (param.type && param.type.names) {?>
+ <?js= self.partial('type.tmpl', param.type.names) ?>
+ <?js } ?>
+ </td>
+
+ <?js if (params.hasAttributes) {?>
+ <td class="attributes">
+ <?js if (param.optional) { ?>
+ &lt;optional><br>
+ <?js } ?>
+
+ <?js if (param.nullable) { ?>
+ &lt;nullable><br>
+ <?js } ?>
+ </td>
+ <?js } ?>
+
+ <?js if (params.hasDefault) {?>
+ <td class="default">
+ <?js if (typeof param.defaultvalue !== 'undefined') { ?>
+ <?js= self.htmlsafe(param.defaultvalue) ?>
+ <?js } ?>
+ </td>
+ <?js } ?>
+
+ <td class="description last"><?js= param.description ?><?js if (param.subparams) { ?>
+ <h6>Properties</h6>
+ <?js= self.partial('params.tmpl', param.subparams) ?>
+ <?js } ?></td>
+ </tr>
+
+ <?js }); ?>
+ </tbody>
+</table> \ No newline at end of file
diff --git a/web/server/h2o/libh2o/misc/oktavia/templates/jsdoc3/tmpl/properties.tmpl b/web/server/h2o/libh2o/misc/oktavia/templates/jsdoc3/tmpl/properties.tmpl
new file mode 100644
index 00000000..dfa6ee0e
--- /dev/null
+++ b/web/server/h2o/libh2o/misc/oktavia/templates/jsdoc3/tmpl/properties.tmpl
@@ -0,0 +1,107 @@
+<?js
+ var props = obj;
+
+ /* sort subprops under their parent props (like opts.classname) */
+ var parentProp = null;
+ props.forEach(function(prop, i) {
+ if (!prop) { return; }
+ if ( parentProp && prop.name.indexOf(parentProp.name + '.') === 0 ) {
+ prop.name = prop.name.substr(parentProp.name.length+1);
+ parentProp.subprops = parentProp.subprops || [];
+ parentProp.subprops.push(prop);
+ props[i] = null;
+ }
+ else {
+ parentProp = prop;
+ }
+ });
+
+ /* determine if we need extra columns, "attributes" and "default" */
+ props.hasAttributes = false;
+ props.hasDefault = false;
+ props.hasName = false;
+
+ props.forEach(function(prop) {
+ if (!prop) { return; }
+
+ if (prop.optional || prop.nullable) {
+ props.hasAttributes = true;
+ }
+
+ if (prop.name) {
+ props.hasName = true;
+ }
+
+ if (typeof prop.defaultvalue !== 'undefined') {
+ props.hasDefault = true;
+ }
+ });
+?>
+
+<table class="props">
+ <thead>
+ <tr>
+ <?js if (props.hasName) {?>
+ <th>Name</th>
+ <?js } ?>
+
+ <th>Type</th>
+
+ <?js if (props.hasAttributes) {?>
+ <th>Argument</th>
+ <?js } ?>
+
+ <?js if (props.hasDefault) {?>
+ <th>Default</th>
+ <?js } ?>
+
+ <th class="last">Description</th>
+ </tr>
+ </thead>
+
+ <tbody>
+ <?js
+ var self = this;
+ props.forEach(function(prop) {
+ if (!prop) { return; }
+ ?>
+
+ <tr>
+ <?js if (props.hasName) {?>
+ <td class="name"><code><?js= prop.name ?></code></td>
+ <?js } ?>
+
+ <td class="type">
+ <?js if (prop.type && prop.type.names) {?>
+ <?js= self.partial('type.tmpl', prop.type.names) ?>
+ <?js } ?>
+ </td>
+
+ <?js if (props.hasAttributes) {?>
+ <td class="attributes">
+ <?js if (prop.optional) { ?>
+ &lt;optional><br>
+ <?js } ?>
+
+ <?js if (prop.nullable) { ?>
+ &lt;nullable><br>
+ <?js } ?>
+ </td>
+ <?js } ?>
+
+ <?js if (props.hasDefault) {?>
+ <td class="default">
+ <?js if (typeof prop.defaultvalue !== 'undefined') { ?>
+ <?js= self.htmlsafe(prop.defaultvalue) ?>
+ <?js } ?>
+ </td>
+ <?js } ?>
+
+ <td class="description last"><?js= prop.description ?><?js if (prop.subprops) { ?>
+ <h6>Properties</h6><?js= self.partial('properties.tmpl', prop.subprops) ?>
+ <?js } ?></td>
+ </tr>
+
+ <?js }); ?>
+ </tbody>
+</table> \ No newline at end of file
diff --git a/web/server/h2o/libh2o/misc/oktavia/templates/jsdoc3/tmpl/returns.tmpl b/web/server/h2o/libh2o/misc/oktavia/templates/jsdoc3/tmpl/returns.tmpl
new file mode 100644
index 00000000..32e059ed
--- /dev/null
+++ b/web/server/h2o/libh2o/misc/oktavia/templates/jsdoc3/tmpl/returns.tmpl
@@ -0,0 +1,19 @@
+<?js
+var data = obj;
+if (data.description) {
+?>
+<div class="param-desc">
+ <?js= description ?>
+</div>
+<?js } ?>
+
+<?js if (data.type && data.type.names) {?>
+<dl>
+ <dt>
+ Type
+ </dt>
+ <dd>
+ <?js= this.partial('type.tmpl', data.type.names) ?>
+ </dd>
+</dl>
+<?js } ?> \ No newline at end of file
diff --git a/web/server/h2o/libh2o/misc/oktavia/templates/jsdoc3/tmpl/source.tmpl b/web/server/h2o/libh2o/misc/oktavia/templates/jsdoc3/tmpl/source.tmpl
new file mode 100644
index 00000000..e1092ef2
--- /dev/null
+++ b/web/server/h2o/libh2o/misc/oktavia/templates/jsdoc3/tmpl/source.tmpl
@@ -0,0 +1,8 @@
+<?js
+ var data = obj;
+?>
+ <section>
+ <article>
+ <pre class="prettyprint source"><code><?js= data.code ?></code></pre>
+ </article>
+ </section> \ No newline at end of file
diff --git a/web/server/h2o/libh2o/misc/oktavia/templates/jsdoc3/tmpl/tutorial.tmpl b/web/server/h2o/libh2o/misc/oktavia/templates/jsdoc3/tmpl/tutorial.tmpl
new file mode 100644
index 00000000..b0c79c1d
--- /dev/null
+++ b/web/server/h2o/libh2o/misc/oktavia/templates/jsdoc3/tmpl/tutorial.tmpl
@@ -0,0 +1,19 @@
+<section>
+
+<header>
+ <?js if (children.length > 0) { ?>
+ <ul><?js
+ var self = this;
+ children.forEach(function(t) { ?>
+ <li><?js= self.tutoriallink(t.name) ?></li>
+ <?js }); ?></ul>
+ <?js } ?>
+
+ <h2><?js= header ?></h2>
+</header>
+
+<article>
+ <?js= content ?>
+</article>
+
+</section>
diff --git a/web/server/h2o/libh2o/misc/oktavia/templates/jsdoc3/tmpl/type.tmpl b/web/server/h2o/libh2o/misc/oktavia/templates/jsdoc3/tmpl/type.tmpl
new file mode 100644
index 00000000..db8194d6
--- /dev/null
+++ b/web/server/h2o/libh2o/misc/oktavia/templates/jsdoc3/tmpl/type.tmpl
@@ -0,0 +1,7 @@
+<?js
+ var data = obj;
+ var self = this;
+ data.forEach(function(name, i) { ?>
+<span class="param-type"><?js= self.linkto(name, self.htmlsafe(name)) ?></span>
+<?js if (i < data.length-1) { ?>|<?js } ?>
+<?js }); ?> \ No newline at end of file
diff --git a/web/server/h2o/libh2o/misc/oktavia/templates/sphinx/_static/oktavia-jquery-ui.js b/web/server/h2o/libh2o/misc/oktavia/templates/sphinx/_static/oktavia-jquery-ui.js
new file mode 100644
index 00000000..bd1efb8c
--- /dev/null
+++ b/web/server/h2o/libh2o/misc/oktavia/templates/sphinx/_static/oktavia-jquery-ui.js
@@ -0,0 +1,521 @@
+/**
+ * @fileOverview
+ * A UI script that creates search form, loads an index files and show search results.
+ * It needs jQuery and <tt>oktavia-search.js</tt> or <tt>oktavia-*-search.js</tt>
+ * (stemming library supported versions).
+ * @author Yoshiki Shibukawa, yoshiki@shibu.jp
+ */
+
+(function ($)
+{
+ var logosrc;
+ /**
+ * @name SearchView
+ * @class
+ * Provides searching feature to your website.
+ * @constructor
+ * @param {jQeury} node Target node it has a search form and a search result window.
+ * @param {string} documentRoot Document root folder like '.', '../', '/'
+ * @param {string} index Index file path.
+ */
+ function SearchView(node, documentRoot, index)
+ {
+ var OktaviaSearch = JSX.require("tool/web/oktavia-search.jsx").OktaviaSearch$I;
+
+ /**
+ * Target node it contains a search form and a search result window.
+ * @type jQuery
+ */
+ this.node = node;
+ /**
+ * Search engine core
+ * @type OktaviaSearch
+ */
+ this.engine = new OktaviaSearch(5);
+ if (documentRoot === '')
+ {
+ /**
+ * Document root path
+ * @type string[]
+ */
+ this.documentRoot = [];
+ }
+ else if (documentRoot.slice(-1) === '/')
+ {
+ this.documentRoot = documentRoot.slice(0, -1).split(/\//g);
+ }
+ else
+ {
+ this.documentRoot = documentRoot.split(/\//g);
+ }
+
+ /**
+ * It is true if an index file is loaded.
+ * @type boolean
+ */
+ this.initialized = false;
+ /**
+ * It is true if an user search before loading an index.
+ * @type boolean
+ */
+ this.reserveSearch = false;
+
+ var indexURL;
+ switch (index.charAt(0))
+ {
+ case '.':
+ case '/':
+ indexURL = index;
+ break;
+ default:
+ indexURL = this.getDocumentPath(index);
+ break;
+ }
+ var self = this;
+ function loadIndex()
+ {
+ self.engine.loadIndex$S(window.searchIndex);
+ self.initialized = true;
+ window.searchIndex = null;
+ if (self.reserveSearch)
+ {
+ self.search();
+ }
+ self.reserveSearch = false;
+ }
+ if (window.searchIndex)
+ {
+ loadIndex()
+ }
+ else
+ {
+ this.loadJavaScript(indexURL, loadIndex);
+ }
+ }
+
+ /**
+ * Changes result page.
+ * @param {integer} page Page number
+ * @memberOf SearchView.prototype
+ * @method
+ */
+ SearchView.prototype.changePage = function (page)
+ {
+ this.engine.setCurrentPage$I(page);
+ this.updateResult();
+ };
+
+ /**
+ * Clears a search form and a reult window.
+ * @memberOf SearchView.prototype
+ * @method
+ */
+ SearchView.prototype.clearResult = function ()
+ {
+ $('.oktavia_search', this.node).val('');
+ $('.oktavia_searchresult_box', this.node).hide();
+ };
+
+ /**
+ * Loads an external JavaScript file.
+ *
+ * This code is based on: http://os0x.hatenablog.com/entry/20080827/1219815828
+ * @param {string} src A JavaScript source file path
+ * @param {function} callback It is called when the target JavaScript file is loaded
+ * @memberOf SearchView.prototype
+ * @method
+ */
+ SearchView.prototype.loadJavaScript = function (src, callback)
+ {
+ var sc = document.createElement('script');
+ sc.type = 'text/javascript';
+ if (window.ActiveXObject)
+ {
+ sc.onreadystatechange = function ()
+ {
+ if (sc.readyState === 'complete' || sc.readyState === 'loaded')
+ {
+ callback(sc.readyState);
+ }
+ };
+ }
+ else
+ {
+ sc.onload = function ()
+ {
+ callback('onload');
+ };
+ }
+ sc.src = src;
+ document.body.appendChild(sc);
+ };
+
+ /**
+ * Updates page navigation list.
+ * @memberOf SearchView.prototype
+ * @method
+ */
+ SearchView.prototype.updatePageList = function ()
+ {
+ var self = this;
+ function createCallback(i)
+ {
+ return function () {
+ self.changePage(i);
+ };
+ }
+
+ var currentPage = String(this.engine.currentPage$());
+ var nav = $('.oktavia_searchresult_nav', this.node);
+ nav.empty();
+ var pages = this.engine.pageIndexes$();
+ for (var i = 0; i < pages.length; i++)
+ {
+ var pageItem = $('<span/>').text(pages[i]);
+ if (pages[i] === '...')
+ {
+ pageItem.addClass('leader');
+ }
+ else
+ {
+ pageItem.addClass('page');
+ if (pages[i] !== currentPage)
+ {
+ pageItem.bind('click', createCallback(Number(pages[i])));
+ }
+ else
+ {
+ pageItem.addClass('selected');
+ }
+ }
+ nav.append(pageItem);
+ }
+ };
+
+ /**
+ * Updates result list in a result window.
+ * @memberOf SearchView.prototype
+ * @method
+ */
+ SearchView.prototype.updateResult = function ()
+ {
+ var totalPages = this.engine.totalPages$();
+ var resultslot = $('.oktavia_searchresult', this.node);
+ resultslot.empty();
+ var self = this;
+ function clearCallback()
+ {
+ self.clearResult();
+ }
+ var results = this.engine.getResult$();
+ var searchInput = $('.oktavia_search', this.node);
+ var queryWord = searchInput.val()
+ for (var i = 0; i < results.length; i++)
+ {
+ var result = results[i];
+ var url = this.getDocumentPath(result.url.slice(1))
+ var entry = $('<div/>', { "class": "entry" });
+ var link = $('<a/>', { "href": url + this.engine.getHighlight$() }).text(result.title);
+ link.bind('click', clearCallback);
+ entry.append($('<div/>', { "class": "title" }).append(link));
+ entry.append($('<div/>', { "class": "url" }).text(url));
+ entry.append($('<div/>', { "class": "resultcontent" }).html(result.content));
+ resultslot.append(entry);
+ }
+ this.updatePageList();
+ };
+
+ /**
+ * Searchs again by using proposal search words.
+ * @param {string} option Proposal search words
+ * @memberOf SearchView.prototype
+ * @method
+ */
+ SearchView.prototype.searchProposal = function (option)
+ {
+ $('.oktavia_search', this.node).val(option);
+ this.search();
+ };
+
+ /**
+ * Shows proposals when no result.
+ * @memberOf SearchView.prototype
+ * @method
+ */
+ SearchView.prototype.updateProposal = function ()
+ {
+ var nav = $('.oktavia_searchresult_nav', this.node);
+ var resultslot = $('.oktavia_searchresult', this.node);
+ nav.empty();
+ resultslot.empty();
+ var proposals = this.engine.getProposals$();
+ var self = this;
+ function createCallback(option)
+ {
+ return function ()
+ {
+ self.searchProposal(option);
+ };
+ }
+ for (var i = 0; i < proposals.length; i++)
+ {
+ var proposal = proposals[i];
+ var listitem = $('<div/>', {"class": "proposal"});
+ listitem.append('<span>Search with:&nbsp;</span>');
+ var option = $('<span/>', {"class": "option"});
+ option.html(proposal.label);
+ option.bind('click', createCallback(proposal.options));
+ listitem.append(option);
+ listitem.append('<span>&nbsp;&#x2192;&nbsp;' + proposal.count + ' results.</span>');
+ resultslot.append(listitem);
+ }
+ };
+
+ /**
+ * Performs search and shows results.
+ * @memberOf SearchView.prototype
+ * @method
+ */
+ SearchView.prototype.search = function ()
+ {
+ if (!this.initialized)
+ {
+ this.reserveSearch = true;
+ return;
+ }
+ var searchInput = $('.oktavia_search', this.node);
+ var queryWord = searchInput.val();
+ searchInput.blur();
+ var self = this;
+ this.engine.search$SF$IIV$(queryWord, function (total, pages)
+ {
+ $('.oktavia_searchresult_box', self.node).fadeIn();
+ var summaryNode = $('.oktavia_searchresult_summary', self.node);
+ if (total === 0)
+ {
+ summaryNode.text("No result.");
+ self.updateProposal();
+ }
+ else
+ {
+ summaryNode.text(total + ' results.');
+ self.updateResult();
+ }
+ });
+ };
+
+ /**
+ * Converts file path in index.
+ * @param {string} filePath Source filepath
+ * @returns {string} Result filepath
+ * @memberOf SearchView.prototype
+ * @method
+ */
+ SearchView.prototype.getDocumentPath = function (filePath)
+ {
+ var resultFilePath;
+ if (filePath.charAt(0) === '/')
+ {
+ resultFilePath = filePath;
+ }
+ else
+ {
+ var elements = filePath.split(/\//g);
+ var result = this.documentRoot.slice();
+ for (var i = 0; i < elements.length; i++)
+ {
+ var element = elements[i];
+ switch (element)
+ {
+ case '.':
+ break;
+ case '..':
+ result = result.slice(0, -1);
+ break;
+ default:
+ result.push(element);
+ break;
+ }
+ }
+ resultFilePath = result.join('/');
+ }
+ return resultFilePath;
+ };
+
+ /**
+ * Hides all result windows.
+ * @function
+ */
+ function eraseResultWindow()
+ {
+ $('.oktavia_searchresult_box:visible').hide();
+ }
+
+ /**
+ * jQuery plug-in to create search form and window.
+ * It can receive options from data attributes or an <tt>option</tt> parameter.
+ * @param {object} [option] Option
+ * @param {string} [option.index='search/searchindex.js'] Index file path.
+ * @param {string} [option.documentRoot='.'] Document root folder.
+ * @param {string} [option.logo='true'] Show logo in result windows. <tt>'false'</tt> or <tt>'disable'</tt> or falsy value disable logo.
+ * @name oktaviaSearch
+ * @function
+ */
+ jQuery.fn.oktaviaSearch = function (option)
+ {
+ var data = {
+ 'index': 'search/searchindex.js',
+ 'documentRoot': '.',
+ 'logo': 'true'
+ };
+ if (window.DOCUMENTATION_OPTIONS) // Sphinx
+ {
+ if (window.DOCUMENTATION_OPTIONS.URL_ROOT === '#')
+ {
+ data.documentRoot = '';
+ }
+ else
+ {
+ data.documentRoot = window.DOCUMENTATION_OPTIONS.URL_ROOT;
+ }
+ }
+ var userData = this.data();
+ var key;
+ for (key in userData)
+ {
+ if (userData.hasOwnProperty(key))
+ {
+ data[key] = userData[key];
+ }
+ }
+ for (key in option)
+ {
+ if (option.hasOwnProperty(key))
+ {
+ data[key] = option[key];
+ }
+ }
+ if (data.logo === 'false' || data.logo === 'disable' || !data.logo)
+ {
+ data.logo = false;
+ }
+ else
+ {
+ data.logo = true;
+ }
+ var view = new SearchView(this, data.documentRoot, data.index);
+
+ var form = $('<form class="oktavia_form"><input class="oktavia_search" result="10" type="search" name="search" value="" placeholder="Search" /></form>');
+ form.submit(function (event) {
+ event.stopPropagation();
+ setTimeout(function () {
+ view.search();
+ }, 10);
+ return false;
+ });
+ this.append(form);
+ var resultForm = $([
+ '<div class="oktavia_searchresult_box">',
+ '<div class="oktavia_close_search_box">&times;</div>',
+ '<div class="oktavia_searchresult_summary"></div>',
+ '<div class="oktavia_searchresult"></div>',
+ '<div class="oktavia_searchresult_nav"></div>',
+ '</div>'
+ ].join(''));
+ if (data.logo)
+ {
+ resultForm.append($('<span class="pr">Powered by <a href="http://oktavia.info"><img src="' + logosrc + '" width="86px" height="25px" alt="Oktavia"></img></a></span>'));
+ }
+ this.append(resultForm);
+ $('.oktavia_close_search_box', this.node).bind('click', function (event) {
+ view.clearResult();
+ });
+
+ // Click outside of the result window, close it
+ resultForm.bind('click', function (event) {
+ event.stopPropagation();
+ });
+ };
+
+ /**
+ * Global initailization.
+ * It add some event handlers.
+ * @name initialize
+ * @function
+ */
+ function initialize()
+ {
+
+ function onClick() {
+ eraseResultWindow();
+ return true;
+ }
+ function onKeyDown(event)
+ {
+ switch (event.keyCode)
+ {
+ case 191: // / : focus form
+ eraseResultWindow();
+ var form = $('form.oktavia_form:first input.search');
+ if ($(':focus', form).size() === 0)
+ {
+ form.focus();
+ }
+ break;
+ case 74: // j : down
+ case 75: // k : up
+ case 72: // h : before page
+ case 76: // l : next page
+ case 13: // enter : select
+ var result = $('.oktavia_searchresult_box:visible:first');
+ if (result.size() === 1)
+ {
+ switch (event.keyCode)
+ {
+ case 74: // j : down
+ console.log('down');
+ break;
+ case 75: // k : up
+ console.log('up');
+ break;
+ case 72: // h : before page
+ console.log('before');
+ break;
+ case 76: // l : next page
+ console.log('next');
+ break;
+ case 13: // enter : select
+ console.log('select');
+ break;
+ }
+ }
+ break;
+ }
+ return true;
+ }
+ var version = $.fn.jquery.split(/\./g);
+ var major = Number(version[0]);
+ var minor = Number(version[1]);
+ if (major === 1 && minor < 7)
+ {
+ $(document).live('click', onClick);
+ $(document).live('keydown', onKeyDown);
+ }
+ else
+ {
+ $(document).on('click', onClick);
+ $(document).on('keydown', onKeyDown);
+ }
+ }
+
+ var logosrc = "data:image/jpeg;base64, /9j/4AAQSkZJRgABAQEASABIAAD/4ge4SUNDX1BST0ZJTEUAAQEAAAeoYXBwbAIgAABtbnRyUkdCIFhZWiAH2QACABkACwAaAAthY3NwQVBQTAAAAABhcHBsAAAAAAAAAAAAAAAAAAAAAAAA9tYAAQAAAADTLWFwcGwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAtkZXNjAAABCAAAAG9kc2NtAAABeAAABWxjcHJ0AAAG5AAAADh3dHB0AAAHHAAAABRyWFlaAAAHMAAAABRnWFlaAAAHRAAAABRiWFlaAAAHWAAAABRyVFJDAAAHbAAAAA5jaGFkAAAHfAAAACxiVFJDAAAHbAAAAA5nVFJDAAAHbAAAAA5kZXNjAAAAAAAAABRHZW5lcmljIFJHQiBQcm9maWxlAAAAAAAAAAAAAAAUR2VuZXJpYyBSR0IgUHJvZmlsZQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAbWx1YwAAAAAAAAAeAAAADHNrU0sAAAAoAAABeGhySFIAAAAoAAABoGNhRVMAAAAkAAAByHB0QlIAAAAmAAAB7HVrVUEAAAAqAAACEmZyRlUAAAAoAAACPHpoVFcAAAAWAAACZGl0SVQAAAAoAAACem5iTk8AAAAmAAAComtvS1IAAAAWAAACyGNzQ1oAAAAiAAAC3mhlSUwAAAAeAAADAGRlREUAAAAsAAADHmh1SFUAAAAoAAADSnN2U0UAAAAmAAAConpoQ04AAAAWAAADcmphSlAAAAAaAAADiHJvUk8AAAAkAAADomVsR1IAAAAiAAADxnB0UE8AAAAmAAAD6G5sTkwAAAAoAAAEDmVzRVMAAAAmAAAD6HRoVEgAAAAkAAAENnRyVFIAAAAiAAAEWmZpRkkAAAAoAAAEfHBsUEwAAAAsAAAEpHJ1UlUAAAAiAAAE0GFyRUcAAAAmAAAE8mVuVVMAAAAmAAAFGGRhREsAAAAuAAAFPgBWAWEAZQBvAGIAZQBjAG4A/QAgAFIARwBCACAAcAByAG8AZgBpAGwARwBlAG4AZQByAGkBDQBrAGkAIABSAEcAQgAgAHAAcgBvAGYAaQBsAFAAZQByAGYAaQBsACAAUgBHAEIAIABnAGUAbgDoAHIAaQBjAFAAZQByAGYAaQBsACAAUgBHAEIAIABHAGUAbgDpAHIAaQBjAG8EFwQwBDMEMAQ7BEwEPQQ4BDkAIAQ/BEAEPgREBDAEOQQ7ACAAUgBHAEIAUAByAG8AZgBpAGwAIABnAOkAbgDpAHIAaQBxAHUAZQAgAFIAVgBCkBp1KAAgAFIARwBCACCCcl9pY8+P8ABQAHIAbwBmAGkAbABvACAAUgBHAEIAIABnAGUAbgBlAHIAaQBjAG8ARwBlAG4AZQByAGkAcwBrACAAUgBHAEIALQBwAHIAbwBmAGkAbMd8vBgAIABSAEcAQgAg1QS4XNMMx3wATwBiAGUAYwBuAP0AIABSAEcAQgAgAHAAcgBvAGYAaQBsBeQF6AXVBeQF2QXcACAAUgBHAEIAIAXbBdwF3AXZAEEAbABsAGcAZQBtAGUAaQBuAGUAcwAgAFIARwBCAC0AUAByAG8AZgBpAGwAwQBsAHQAYQBsAOEAbgBvAHMAIABSAEcAQgAgAHAAcgBvAGYAaQBsZm6QGgAgAFIARwBCACBjz4/wZYdO9k4AgiwAIABSAEcAQgAgMNcw7TDVMKEwpDDrAFAAcgBvAGYAaQBsACAAUgBHAEIAIABnAGUAbgBlAHIAaQBjA5MDtQO9A7kDugPMACADwAPBA78DxgOvA7sAIABSAEcAQgBQAGUAcgBmAGkAbAAgAFIARwBCACAAZwBlAG4A6QByAGkAYwBvAEEAbABnAGUAbQBlAGUAbgAgAFIARwBCAC0AcAByAG8AZgBpAGUAbA5CDhsOIw5EDh8OJQ5MACAAUgBHAEIAIA4XDjEOSA4nDkQOGwBHAGUAbgBlAGwAIABSAEcAQgAgAFAAcgBvAGYAaQBsAGkAWQBsAGUAaQBuAGUAbgAgAFIARwBCAC0AcAByAG8AZgBpAGkAbABpAFUAbgBpAHcAZQByAHMAYQBsAG4AeQAgAHAAcgBvAGYAaQBsACAAUgBHAEIEHgQxBEkEOAQ5ACAEPwRABD4ERAQ4BDsETAAgAFIARwBCBkUGRAZBACAGKgY5BjEGSgZBACAAUgBHAEIAIAYnBkQGOQYnBkUARwBlAG4AZQByAGkAYwAgAFIARwBCACAAUAByAG8AZgBpAGwAZQBHAGUAbgBlAHIAZQBsACAAUgBHAEIALQBiAGUAcwBrAHIAaQB2AGUAbABzAGV0ZXh0AAAAAENvcHlyaWdodCAyMDA3IEFwcGxlIEluYy4sIGFsbCByaWdodHMgcmVzZXJ2ZWQuAFhZWiAAAAAAAADzUgABAAAAARbPWFlaIAAAAAAAAHRNAAA97gAAA9BYWVogAAAAAAAAWnUAAKxzAAAXNFhZWiAAAAAAAAAoGgAAFZ8AALg2Y3VydgAAAAAAAAABAc0AAHNmMzIAAAAAAAEMQgAABd7///MmAAAHkgAA/ZH///ui///9owAAA9wAAMBs/+EAgEV4aWYAAE1NACoAAAAIAAUBEgADAAAAAQABAAABGgAFAAAAAQAAAEoBGwAFAAAAAQAAAFIBKAADAAAAAQACAACHaQAEAAAAAQAAAFoAAAAAAAAASAAAAAEAAABIAAAAAQACoAIABAAAAAEAAABWoAMABAAAAAEAAAAYAAAAAP/bAEMAAgICAgIBAgICAgICAgMDBgQDAwMDBwUFBAYIBwgICAcICAkKDQsJCQwKCAgLDwsMDQ4ODg4JCxARDw4RDQ4ODv/bAEMBAgICAwMDBgQEBg4JCAkODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODv/AABEIABgAVgMBIgACEQEDEQH/xAAfAAABBQEBAQEBAQAAAAAAAAAAAQIDBAUGBwgJCgv/xAC1EAACAQMDAgQDBQUEBAAAAX0BAgMABBEFEiExQQYTUWEHInEUMoGRoQgjQrHBFVLR8CQzYnKCCQoWFxgZGiUmJygpKjQ1Njc4OTpDREVGR0hJSlNUVVZXWFlaY2RlZmdoaWpzdHV2d3h5eoOEhYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3uLm6wsPExcbHyMnK0tPU1dbX2Nna4eLj5OXm5+jp6vHy8/T19vf4+fr/xAAfAQADAQEBAQEBAQEBAAAAAAAAAQIDBAUGBwgJCgv/xAC1EQACAQIEBAMEBwUEBAABAncAAQIDEQQFITEGEkFRB2FxEyIygQgUQpGhscEJIzNS8BVictEKFiQ04SXxFxgZGiYnKCkqNTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqCg4SFhoeIiYqSk5SVlpeYmZqio6Slpqeoqaqys7S1tre4ubrCw8TFxsfIycrS09TV1tfY2dri4+Tl5ufo6ery8/T19vf4+fr/2gAMAwEAAhEDEQA/AP3571+dfjn4ofEz4+/tjeJPg38JPE+peAfh/wCE9Q/szxJ4g0namo6xqCoss9tBM6sLe2gRlEkqqXLNtXnFfooa/Lj9jvU7PwH+3T+0D8J/E00Vt4usvHOs3MfmsAbqDUbmO+tp1J6qyN5ZPZkCnqBTQG7pnwW1VP2lde8FfB74qfF3R/E3hrT459f8Val4xutRsIryVd8Nq1ncGRZlYD5zlSoPHTBufD39oH4y+F9H8Xaj8Ur2w8SxeCvES6P4+0tLBIbzSklI8m/t5IwFmt2BBwVB/PI9Z+DOtWfhn/goR+0p8P8AxDcw6f4j1XV7bxLo0dw4U3+nyWwQvHk/MI3RlbH3a+SvG/jnRdbi/bY+JOkyJc+HvF0mm+BvBoiGf+Eh1OGPy3a2H/LUBnHzLkYXNfa0KNGnmlDCxpKVOpGmndXb5knKSb1i7t2cbWtrfW/w+IjiK2WVsRKu41ISm42dlGzajFpWUlZK6le921bS36G+GPHWq61+2r4+8I/2jFdeGdO8N6Xf6fEkKja1wZdz7wNzBgq8E4Fcr8T/ANpDwX4U0bw63hzxb4P1S5vPE8Gm3zveCRLW2WULdzDacHyhwxzhSwJz0Pxp430f4ww/H74qeEvABimudH+FHhxvFdvFcvDqGoW8KSCSztJFB2STBZlL9QFwOWr2L4k+IPh1r/7Fn7MuufDG00638E3XxJ8Pw6dbQQqPsymdlkgcdQ6uCrg8lgc5r1P7EwEcVhqk1zRlyK0bJL92neWm8nqu9m7nl1MzzN4PE0oS5Jpzd5Xb1ntHXaK0v00SXU+s9e+M/wAKfDGg6NqevfEDwrpljq9st1pckt8v+lwtyssYGSyH+8Bj3rQ0v4o/DrW7Hw/daR408OajBrl09ppElveowu50Xc0SY6yBeSvXHavmb/hIr7Uv22vivD8EvhJoXirxTpP2LTPFfibxX4ke0s7aRYQ8VpawiKVgqo4ZtiopJzyea+e7PQfFGteEv2tLyxh8Op8QPAXjrTfE+nW3htX+xLfWtos00UO7DfPGJImJAJYtx2rzcNw5g6tP35ODtF6uL+NpK8VrFJyTu3qleyvp6tfPsxp1PdhGSvJaKS+FNu0no20mrJWTduZ21/Rf4l6/d6N8PWtNC8UeF/C/jLU3Nv4cfXojLb3NyqmTyjGrKzAqrZKnKj5sHGD5j4L8W6fZfC6y+M3xg+IHguN9UQjSxY6iP7G0qFiR5Fs7HNxM2DvmILNgqoVBg+X6B4vsPj9+14vjbQ5xdeB/AXgBbq0kVt0b6tq1uZCPTfDbAA9wZe1eNfCXxXp9x8Ev2UdE8N/DhfiX8Xl8F3uq6PFqet/YdL0qzM5iluZiVcNIWwi7Y2Yc4IzzyUuFaLSlVlLnjbmjdJK8aklrKyWkY3b25no2kj13xhjIUKlCjThySb5Z8rcnZwi0mtWm3L3Vvy7pSlf9C/BnxO+H3xE+2f8ACEeMNB8TPaAG6isboPJCD0LJ94A+uMUV8JaxqPjex/4KWaZ/wmlh4A8NeJrr4bXUslp4Su5pdsI1C1VPtErpGXcndtwgAAPWisswyGlTlB0p6SSfR2+asntvZHDg+Iq/LKNan7ybV1dX+Tu16XZyPjX4k/tYftcfF/xR8Kvgh4b1/wDZ7+EOkanc6R4p8f8AiK2e31O6khkMcsVqqsGUHBwIW3FWy00BG1vWrX/gnT8EtJ+DfhvS/Dmq+NfDPxL0dnmT4m6dfKuvXs8mDI10zKY54jhQIXUqiqoXGM0UV8wfXC6h+xb418baxpK/Fv8Aad+IHjrRtOt5LSOKy8PadpV9PbyAeZDJexRmYI+BuCFc4x0yD6x8Lv2Pfgl8J/GOleINE0rX9e1jSQ40WfxHrM2oJpW8kubWJz5ULMScuqBj60UV00sdiKUXGE2k1Z2fTt6eRhPC0Zu8op9fn39dD2fTfhx4Y0r9oPxP8TrOG9XxXr+mWmnajK92zRNDamQwhYz8qkGR8kcnPPQV5ZqX7Kvwh1L4deMfCbWHiGx0HxF4lTxJLaWOuTwLp+pK277TZ7WH2Zi3JVMKTnjk0UVdLMsXTlzQqNPTq/s/D93TsKeEozVpRT3/AB3+8zT+yX8OIfEY1nSPEvxc8N6xPpdvp+sX2keOL22n1tIF2JJeOrZmn28GbIkOBluK9C+G/wADPhv8Jtc8WXngTR7nR4vEa2/9qWbX0s9vI0KMgkCSFsSOGYyPnMjEsxJ5ooq62bY2rBwnVk09GrvW21/Syt2M45fhozU1BXXWxL8MPgl8Pfg98LtY8H+A9KuNM0TU7+e9vElu3mkaSZQrYdiSFVQqqvRQABXAT/snfCj/AIQX4daNpD+NfC134GspLHw5rmh+JLi01O3tpGLPA86nMsbE5KuGFFFEc1xiqSqKrLmk7t3ers1r30bXo2U8Fh3BQ5FZdLfMS3/ZL+Elp4qtvEUA8aHxWtrPbXmvz+JrqfUNRSWSJ2+0zSMxlwYUCZ4RQVUKCRRRRTnm+Nl8VVv1ZCy3CramvuP/2Q==";
+ initialize();
+})(jQuery);
+
+jQuery(document).ready(function () {
+ var form = jQuery('#oktavia_search_form');
+ if (form.size() > 0)
+ {
+ form.oktaviaSearch();
+ }
+});
diff --git a/web/server/h2o/libh2o/misc/oktavia/templates/sphinx/_static/oktavia-search.js b/web/server/h2o/libh2o/misc/oktavia/templates/sphinx/_static/oktavia-search.js
new file mode 100644
index 00000000..fce9732a
--- /dev/null
+++ b/web/server/h2o/libh2o/misc/oktavia/templates/sphinx/_static/oktavia-search.js
@@ -0,0 +1,6795 @@
+// generatedy by JSX compiler 0.9.24 (2013-04-05 13:45:00 +0900; 1b229cc6a411f674f0f7cf7a79b7a8b3f8eb7414)
+var JSX = {};
+(function (JSX) {
+/**
+ * copies the implementations from source interface to target
+ */
+function $__jsx_merge_interface(target, source) {
+ for (var k in source.prototype)
+ if (source.prototype.hasOwnProperty(k))
+ target.prototype[k] = source.prototype[k];
+}
+
+/**
+ * defers the initialization of the property
+ */
+function $__jsx_lazy_init(obj, prop, func) {
+ function reset(obj, prop, value) {
+ delete obj[prop];
+ obj[prop] = value;
+ return value;
+ }
+
+ Object.defineProperty(obj, prop, {
+ get: function () {
+ return reset(obj, prop, func());
+ },
+ set: function (v) {
+ reset(obj, prop, v);
+ },
+ enumerable: true,
+ configurable: true
+ });
+}
+
+/**
+ * sideeffect().a /= b
+ */
+function $__jsx_div_assign(obj, prop, divisor) {
+ return obj[prop] = (obj[prop] / divisor) | 0;
+}
+
+/*
+ * global functions, renamed to avoid conflict with local variable names
+ */
+var $__jsx_parseInt = parseInt;
+var $__jsx_parseFloat = parseFloat;
+var $__jsx_isNaN = isNaN;
+var $__jsx_isFinite = isFinite;
+
+var $__jsx_encodeURIComponent = encodeURIComponent;
+var $__jsx_decodeURIComponent = decodeURIComponent;
+var $__jsx_encodeURI = encodeURI;
+var $__jsx_decodeURI = decodeURI;
+
+var $__jsx_ObjectToString = Object.prototype.toString;
+var $__jsx_ObjectHasOwnProperty = Object.prototype.hasOwnProperty;
+
+/*
+ * profiler object, initialized afterwards
+ */
+function $__jsx_profiler() {
+}
+
+/*
+ * public interface to JSX code
+ */
+JSX.require = function (path) {
+ var m = $__jsx_classMap[path];
+ return m !== undefined ? m : null;
+};
+
+JSX.profilerIsRunning = function () {
+ return $__jsx_profiler.getResults != null;
+};
+
+JSX.getProfileResults = function () {
+ return ($__jsx_profiler.getResults || function () { return {}; })();
+};
+
+JSX.postProfileResults = function (url, cb) {
+ if ($__jsx_profiler.postResults == null)
+ throw new Error("profiler has not been turned on");
+ return $__jsx_profiler.postResults(url, cb);
+};
+
+JSX.resetProfileResults = function () {
+ if ($__jsx_profiler.resetResults == null)
+ throw new Error("profiler has not been turned on");
+ return $__jsx_profiler.resetResults();
+};
+JSX.DEBUG = false;
+/**
+ * class _Result extends Object
+ * @constructor
+ */
+function _Result() {
+}
+
+/**
+ * @constructor
+ * @param {!string} title
+ * @param {!string} url
+ * @param {!string} content
+ * @param {!number} score
+ */
+function _Result$SSSI(title, url, content, score) {
+ this.title = title;
+ this.url = url;
+ this.content = content;
+ this.score = score;
+};
+
+_Result$SSSI.prototype = new _Result;
+
+/**
+ * class _Proposal extends Object
+ * @constructor
+ */
+function _Proposal() {
+}
+
+/**
+ * @constructor
+ * @param {!string} options
+ * @param {!string} label
+ * @param {!number} count
+ */
+function _Proposal$SSI(options, label, count) {
+ this.options = options;
+ this.label = label;
+ this.count = count;
+};
+
+_Proposal$SSI.prototype = new _Proposal;
+
+/**
+ * class OktaviaSearch extends Object
+ * @constructor
+ */
+function OktaviaSearch() {
+}
+
+/**
+ * @constructor
+ * @param {!number} entriesPerPage
+ */
+function OktaviaSearch$I(entriesPerPage) {
+ this._queries = null;
+ this._highlight = "";
+ this._result = null;
+ this._proposals = null;
+ this._currentFolderDepth = 0;
+ this._oktavia = new Oktavia$();
+ this._entriesPerPage = entriesPerPage;
+ this._currentPage = 1;
+ this._queryString = null;
+ this._callback = null;
+ OktaviaSearch._instance = this;
+};
+
+OktaviaSearch$I.prototype = new OktaviaSearch;
+
+/**
+ * @param {Stemmer} stemmer
+ */
+OktaviaSearch.setStemmer$LStemmer$ = function (stemmer) {
+ /** @type {Oktavia} */
+ var this$0;
+ if (OktaviaSearch._instance) {
+ this$0 = OktaviaSearch._instance._oktavia;
+ this$0._stemmer = stemmer;
+ } else {
+ OktaviaSearch._stemmer = stemmer;
+ }
+};
+
+var OktaviaSearch$setStemmer$LStemmer$ = OktaviaSearch.setStemmer$LStemmer$;
+
+/**
+ * @param {!string} index
+ */
+OktaviaSearch.prototype.loadIndex$S = function (index) {
+ /** @type {Oktavia} */
+ var this$0;
+ /** @type {Stemmer} */
+ var stemmer$0;
+ if (OktaviaSearch._stemmer) {
+ this$0 = this._oktavia;
+ stemmer$0 = OktaviaSearch._stemmer;
+ this$0._stemmer = stemmer$0;
+ }
+ this._oktavia.load$S(Binary$base64decode$S(index));
+ if (this._queryString) {
+ this.search$SF$IIV$(this._queryString, this._callback);
+ this._queryString = null;
+ this._callback = null;
+ }
+};
+
+/**
+ * @param {!string} queryString
+ * @param {*} callback
+ */
+OktaviaSearch.prototype.search$SF$IIV$ = function (queryString, callback) {
+ /** @type {QueryStringParser} */
+ var queryParser;
+ /** @type {SearchSummary} */
+ var summary;
+ /** @type {Array.<undefined|SearchUnit>} */
+ var _result$0;
+ if (this._oktavia) {
+ queryParser = ({queries: [ ]});
+ this._queries = QueryStringParser$parse$LQueryStringParser$S(queryParser, queryString);
+ this._highlight = QueryStringParser$highlight$LQueryStringParser$(queryParser);
+ summary = this._oktavia.search$ALQuery$(this._queries);
+ if (SearchSummary$size$LSearchSummary$(summary) > 0) {
+ this._result = this._sortResult$LSearchSummary$(summary);
+ this._proposals = [ ];
+ this._currentPage = 1;
+ } else {
+ this._result = [ ];
+ if (this._queries.length > 1) {
+ this._proposals = SearchSummary$getProposal$LSearchSummary$(summary);
+ } else {
+ this._proposals = [ ];
+ }
+ this._currentPage = 1;
+ }
+ callback((_result$0 = this._result).length, Math.ceil(_result$0.length / this._entriesPerPage));
+ } else {
+ this._queryString = queryString;
+ this._callback = callback;
+ }
+};
+
+/**
+ * @return {!number}
+ */
+OktaviaSearch.prototype.resultSize$ = function () {
+ return (this._result.length | 0);
+};
+
+/**
+ * @return {!number}
+ */
+OktaviaSearch.prototype.totalPages$ = function () {
+ return (Math.ceil(this._result.length / this._entriesPerPage) | 0);
+};
+
+/**
+ * @return {!number}
+ */
+OktaviaSearch.prototype.currentPage$ = function () {
+ return this._currentPage;
+};
+
+/**
+ * @param {!number} page
+ */
+OktaviaSearch.prototype.setCurrentPage$I = function (page) {
+ this._currentPage = page;
+};
+
+/**
+ * @return {!boolean}
+ */
+OktaviaSearch.prototype.hasPrevPage$ = function () {
+ return this._currentPage !== 1;
+};
+
+/**
+ * @return {!boolean}
+ */
+OktaviaSearch.prototype.hasNextPage$ = function () {
+ return this._currentPage !== Math.ceil(this._result.length / this._entriesPerPage);
+};
+
+/**
+ * @return {Array.<undefined|!string>}
+ */
+OktaviaSearch.prototype.pageIndexes$ = function () {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var total;
+ /** @type {!number} */
+ var i;
+ result = [ ];
+ total = Math.ceil(this._result.length / this._entriesPerPage);
+ if (total < 10) {
+ for (i = 1; i <= total; i++) {
+ result.push(i + "");
+ }
+ } else {
+ if (this._currentPage <= 5) {
+ for (i = 1; i <= 7; i++) {
+ result.push(i + "");
+ }
+ result.push('...', total + "");
+ } else {
+ if (total - 5 <= this._currentPage) {
+ result.push('1', '...');
+ for (i = total - 8; i <= total; i++) {
+ result.push(i + "");
+ }
+ } else {
+ result.push('1', '...');
+ for (i = this._currentPage - 3; i <= this._currentPage + 3; i++) {
+ result.push(i + "");
+ }
+ result.push('...', total + "");
+ }
+ }
+ }
+ return result;
+};
+
+/**
+ * @return {Array.<undefined|_Result>}
+ */
+OktaviaSearch.prototype.getResult$ = function () {
+ /** @type {Style} */
+ var style;
+ /** @type {!number} */
+ var start;
+ /** @type {!number} */
+ var last;
+ /** @type {Metadata} */
+ var metadata;
+ /** @type {!number} */
+ var num;
+ /** @type {Array.<undefined|_Result>} */
+ var results;
+ /** @type {!number} */
+ var i;
+ /** @type {SearchUnit} */
+ var unit;
+ /** @type {Array.<undefined|!string>} */
+ var info;
+ /** @type {!string} */
+ var content;
+ /** @type {Array.<undefined|Position>} */
+ var positions;
+ /** @type {!number} */
+ var end;
+ /** @type {!boolean} */
+ var split;
+ /** @type {!number} */
+ var j;
+ /** @type {Position} */
+ var pos;
+ /** @type {!string} */
+ var text;
+ /** @type {Oktavia} */
+ var this$0;
+ /** @type {!number} */
+ var position$0;
+ /** @type {!number} */
+ var _currentPage$0;
+ /** @type {!number} */
+ var _entriesPerPage$0;
+ style = new Style$S('html');
+ start = ((_currentPage$0 = this._currentPage) - 1) * (_entriesPerPage$0 = this._entriesPerPage);
+ last = Math.min(_currentPage$0 * _entriesPerPage$0, this._result.length);
+ this$0 = this._oktavia;
+ metadata = this$0._metadatas[this$0._metadataLabels[0]];
+ num = 250;
+ results = [ ];
+ for (i = start; i < last; i++) {
+ unit = this._result[i];
+ info = metadata.getInformation$I(unit.id).split(Oktavia.eob);
+ content = metadata.getContent$I(unit.id);
+ start = 0;
+ positions = SearchUnit$getPositions$LSearchUnit$(unit);
+ if (content.indexOf(info[0]) === 1) {
+ content = content.slice(info[0].length + 2, content.length);
+ start += info[0].length + 2;
+ }
+ end = start + num;
+ split = false;
+ if (positions[0].position > end - positions[0].word.length) {
+ end = positions[0].position + Math.floor(num / 2);
+ split = true;
+ }
+ for (j = positions.length - 1; j > -1; j--) {
+ pos = positions[j];
+ if (pos.position + pos.word.length < end) {
+ content = [ content.slice(0, pos.position - start), style.convert$S('<hit>*</hit>').replace('*', content.slice((position$0 = pos.position) - start, position$0 + pos.word.length - start)), content.slice(pos.position + pos.word.length - start, content.length) ].join('');
+ }
+ }
+ if (split) {
+ text = [ content.slice(0, Math.floor(num / 2)) + ' ...', content.slice(- Math.floor(num / 2), end - start) ].join('<br/>');
+ } else {
+ text = content.slice(0, end - start) + ' ...<br/>';
+ }
+ text = text.replace(Oktavia.eob, ' ').replace(/(<br\/>)(<br\/>)+/, '<br/><br/>');
+ results.push(({title: info[0], url: info[1], content: text, score: unit.score}));
+ }
+ return results;
+};
+
+/**
+ * @return {!string}
+ */
+OktaviaSearch.prototype.getHighlight$ = function () {
+ return this._highlight;
+};
+
+/**
+ * @return {Array.<undefined|_Proposal>}
+ */
+OktaviaSearch.prototype.getProposals$ = function () {
+ /** @type {Style} */
+ var style;
+ /** @type {Array.<undefined|_Proposal>} */
+ var results;
+ /** @type {!number} */
+ var i;
+ /** @type {Proposal} */
+ var proposal;
+ /** @type {Array.<undefined|!string>} */
+ var label;
+ /** @type {Array.<undefined|!string>} */
+ var option;
+ /** @type {!number} */
+ var j;
+ style = new Style$S('html');
+ results = [ ];
+ if (this._queries.length > 1) {
+ for (i = 0; i < this._proposals.length; i++) {
+ proposal = this._proposals[i];
+ if (proposal.expect > 0) {
+ label = [ ];
+ option = [ ];
+ for (j = 0; j < this._queries.length; j++) {
+ if (j !== proposal.omit) {
+ label.push(style.convert$S('<hit>' + this._queries[j].toString() + '</hit>'));
+ option.push(this._queries[j].toString());
+ } else {
+ label.push(style.convert$S('<del>' + this._queries[j].toString() + '</del>'));
+ }
+ }
+ results.push(({options: option.join(' '), label: label.join('&nbsp;'), count: proposal.expect}));
+ }
+ }
+ }
+ return results;
+};
+
+/**
+ * @param {SearchSummary} summary
+ * @return {Array.<undefined|SearchUnit>}
+ */
+OktaviaSearch.prototype._sortResult$LSearchSummary$ = function (summary) {
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var score;
+ /** @type {SearchUnit} */
+ var unit;
+ /** @type {!string} */
+ var pos;
+ /** @type {Position} */
+ var position;
+ for (i = 0; i < summary.result.units.length; i++) {
+ score = 0;
+ unit = summary.result.units[i];
+ for (pos in unit.positions) {
+ position = unit.positions[pos];
+ if (this._oktavia.wordPositionType$I(position.position)) {
+ score += 10;
+ } else {
+ score += 1;
+ }
+ if (! position.stemmed) {
+ score += 2;
+ }
+ }
+ unit.score = (score | 0);
+ }
+ return SearchSummary$getSortedResult$LSearchSummary$(summary);
+};
+
+/**
+ * class _Main extends Object
+ * @constructor
+ */
+function _Main() {
+}
+
+/**
+ * @constructor
+ */
+function _Main$() {
+};
+
+_Main$.prototype = new _Main;
+
+/**
+ * @param {Array.<undefined|!string>} args
+ */
+_Main.main$AS = function (args) {
+};
+
+var _Main$main$AS = _Main.main$AS;
+
+/**
+ * class Oktavia extends Object
+ * @constructor
+ */
+function Oktavia() {
+}
+
+/**
+ * @constructor
+ */
+function Oktavia$() {
+ /** @type {Array.<undefined|!string>} */
+ var _utf162compressCode$0;
+ this._compressCode2utf16 = null;
+ this._fmindex = new FMIndex$();
+ this._metadatas = ({ });
+ this._metadataLabels = [ ];
+ this._stemmer = null;
+ this._stemmingResult = ({ });
+ _utf162compressCode$0 = this._utf162compressCode = [ Oktavia.eof, Oktavia.eob, Oktavia.unknown ];
+ _utf162compressCode$0.length = 65536;
+ this._compressCode2utf16 = [ Oktavia.eof, Oktavia.eob, Oktavia.unknown ];
+};
+
+Oktavia$.prototype = new Oktavia;
+
+/**
+ * @param {Stemmer} stemmer
+ */
+Oktavia.prototype.setStemmer$LStemmer$ = function (stemmer) {
+ this._stemmer = stemmer;
+};
+
+/**
+ * @return {Metadata}
+ */
+Oktavia.prototype.getPrimaryMetadata$ = function () {
+ return this._metadatas[this._metadataLabels[0]];
+};
+
+/**
+ * @param {!string} key
+ * @return {Section}
+ */
+Oktavia.prototype.addSection$S = function (key) {
+ /** @type {Section} */
+ var section;
+ if (this._metadataLabels.indexOf(key) !== -1) {
+ throw new Error('Metadata name ' + key + ' is already exists');
+ }
+ this._metadataLabels.push(key);
+ section = new Section$LOktavia$(this);
+ this._metadatas[key] = section;
+ return section;
+};
+
+/**
+ * @param {!string} key
+ * @return {Section}
+ */
+Oktavia.prototype.getSection$S = function (key) {
+ if (this._metadataLabels.indexOf(key) === -1) {
+ throw new Error('Metadata name ' + key + " does't exists");
+ }
+ return this._metadatas[key];
+};
+
+/**
+ * @param {!string} key
+ * @return {Splitter}
+ */
+Oktavia.prototype.addSplitter$S = function (key) {
+ /** @type {Splitter} */
+ var splitter;
+ if (this._metadataLabels.indexOf(key) !== -1) {
+ throw new Error('Metadata name ' + key + ' is already exists');
+ }
+ this._metadataLabels.push(key);
+ splitter = new Splitter$LOktavia$(this);
+ this._metadatas[key] = splitter;
+ return splitter;
+};
+
+/**
+ * @param {!string} key
+ * @return {Splitter}
+ */
+Oktavia.prototype.getSplitter$S = function (key) {
+ if (this._metadataLabels.indexOf(key) === -1) {
+ throw new Error('Metadata name ' + key + " does't exists");
+ }
+ return this._metadatas[key];
+};
+
+/**
+ * @param {!string} key
+ * @param {Array.<undefined|!string>} headers
+ * @return {Table}
+ */
+Oktavia.prototype.addTable$SAS = function (key, headers) {
+ /** @type {Table} */
+ var table;
+ if (this._metadataLabels.indexOf(key) !== -1) {
+ throw new Error('Metadata name ' + key + ' is already exists');
+ }
+ this._metadataLabels.push(key);
+ table = new Table$LOktavia$AS(this, headers);
+ this._metadatas[key] = table;
+ return table;
+};
+
+/**
+ * @param {!string} key
+ * @return {Table}
+ */
+Oktavia.prototype.getTable$S = function (key) {
+ if (this._metadataLabels.indexOf(key) === -1) {
+ throw new Error('Metadata name ' + key + " does't exists");
+ }
+ return this._metadatas[key];
+};
+
+/**
+ * @param {!string} key
+ * @return {Block}
+ */
+Oktavia.prototype.addBlock$S = function (key) {
+ /** @type {Block} */
+ var block;
+ if (this._metadataLabels.indexOf(key) !== -1) {
+ throw new Error('Metadata name ' + key + ' is already exists');
+ }
+ this._metadataLabels.push(key);
+ block = new Block$LOktavia$(this);
+ this._metadatas[key] = block;
+ return block;
+};
+
+/**
+ * @param {!string} key
+ * @return {Block}
+ */
+Oktavia.prototype.getBlock$S = function (key) {
+ if (this._metadataLabels.indexOf(key) === -1) {
+ throw new Error('Metadata name ' + key + " does't exists");
+ }
+ return this._metadatas[key];
+};
+
+/**
+ */
+Oktavia.prototype.addEndOfBlock$ = function () {
+ this._fmindex.push$S(Oktavia.eob);
+};
+
+/**
+ * @param {!string} words
+ */
+Oktavia.prototype.addWord$S = function (words) {
+ /** @type {Array.<undefined|!string>} */
+ var str;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var charCode;
+ /** @type {undefined|!string} */
+ var newCharCode;
+ str = [ ];
+ str.length = words.length;
+ for (i = 0; i < words.length; i++) {
+ charCode = words.charCodeAt(i);
+ newCharCode = this._utf162compressCode[charCode];
+ if (newCharCode == null) {
+ newCharCode = String.fromCharCode(this._compressCode2utf16.length);
+ this._utf162compressCode[charCode] = newCharCode;
+ this._compressCode2utf16.push(String.fromCharCode(charCode));
+ }
+ str.push(newCharCode);
+ }
+ this._fmindex.push$S(str.join(''));
+};
+
+/**
+ * @param {!string} words
+ * @param {!boolean} stemming
+ */
+Oktavia.prototype.addWord$SB = function (words, stemming) {
+ /** @type {Array.<undefined|!string>} */
+ var wordList;
+ /** @type {!number} */
+ var i;
+ /** @type {undefined|!string} */
+ var originalWord;
+ /** @type {!string} */
+ var smallWord;
+ /** @type {undefined|!string} */
+ var registerWord;
+ /** @type {!string} */
+ var baseWord;
+ /** @type {!string} */
+ var compressedCodeWord;
+ /** @type {Array.<undefined|!string>} */
+ var stemmedList;
+ this.addWord$S(words);
+ wordList = words.split(/\s+/);
+ for (i = 0; i < wordList.length; i++) {
+ originalWord = wordList[i];
+ smallWord = originalWord.slice(0, 1).toLowerCase() + originalWord.slice(1);
+ registerWord = null;
+ if (stemming && this._stemmer) {
+ baseWord = this._stemmer.stemWord$S(originalWord.toLowerCase());
+ if (originalWord.indexOf(baseWord) === -1) {
+ registerWord = baseWord;
+ }
+ } else {
+ if (originalWord != smallWord) {
+ registerWord = smallWord;
+ }
+ }
+ if (registerWord) {
+ compressedCodeWord = this._convertToCompressionCode$S(originalWord);
+ stemmedList = this._stemmingResult[registerWord];
+ if (! stemmedList) {
+ stemmedList = [ compressedCodeWord ];
+ this._stemmingResult[registerWord] = stemmedList;
+ } else {
+ if (stemmedList.indexOf(compressedCodeWord) === -1) {
+ stemmedList.push(compressedCodeWord);
+ }
+ }
+ }
+ }
+};
+
+/**
+ * @param {!string} keyword
+ * @return {!string}
+ */
+Oktavia.prototype._convertToCompressionCode$S = function (keyword) {
+ /** @type {Array.<undefined|!string>} */
+ var resultChars;
+ /** @type {!number} */
+ var i;
+ /** @type {undefined|!string} */
+ var chr;
+ resultChars = [ ];
+ for (i = 0; i < keyword.length; i++) {
+ chr = this._utf162compressCode[keyword.charCodeAt(i)];
+ if (chr == null) {
+ resultChars.push(Oktavia.unknown);
+ } else {
+ resultChars.push(chr);
+ }
+ }
+ return resultChars.join('');
+};
+
+/**
+ * @param {!string} keyword
+ * @param {!boolean} stemming
+ * @return {Array.<undefined|!number>}
+ */
+Oktavia.prototype.rawSearch$SB = function (keyword, stemming) {
+ /** @type {Array.<undefined|!number>} */
+ var result;
+ /** @type {!string} */
+ var baseWord;
+ /** @type {Array.<undefined|!string>} */
+ var stemmedList;
+ /** @type {!number} */
+ var i;
+ /** @type {undefined|!string} */
+ var word;
+ if (stemming) {
+ result = [ ];
+ if (this._stemmer) {
+ baseWord = this._stemmer.stemWord$S(keyword.toLowerCase());
+ stemmedList = this._stemmingResult[baseWord];
+ if (stemmedList) {
+ for (i = 0; i < stemmedList.length; i++) {
+ word = stemmedList[i];
+ result = result.concat(this._fmindex.search$S(word));
+ }
+ }
+ }
+ } else {
+ result = this._fmindex.search$S(this._convertToCompressionCode$S(keyword));
+ }
+ return result;
+};
+
+/**
+ * @param {Array.<undefined|Query>} queries
+ * @return {SearchSummary}
+ */
+Oktavia.prototype.search$ALQuery$ = function (queries) {
+ /** @type {SearchSummary} */
+ var summary;
+ /** @type {!number} */
+ var i;
+ /** @type {SingleResult} */
+ var result$0;
+ summary = ({sourceResults: [ ], result: null, oktavia: this});
+ for (i = 0; i < queries.length; i++) {
+ result$0 = this._searchQuery$LQuery$(queries[i]);
+ summary.sourceResults.push(result$0);
+ }
+ summary.result = SearchSummary$mergeResult$LSearchSummary$ALSingleResult$(summary, summary.sourceResults);
+ return summary;
+};
+
+/**
+ * @param {Query} query
+ * @return {SingleResult}
+ */
+Oktavia.prototype._searchQuery$LQuery$ = function (query) {
+ /** @type {SingleResult} */
+ var result;
+ /** @type {Array.<undefined|!number>} */
+ var positions;
+ result = new SingleResult$SBB(query.word, query.or, query.not);
+ if (query.raw) {
+ positions = this.rawSearch$SB(query.word, false);
+ } else {
+ positions = this.rawSearch$SB(query.word, false).concat(this.rawSearch$SB(query.word, true));
+ }
+ this._metadatas[this._metadataLabels[0]].grouping$LSingleResult$AISB(result, positions, query.word, ! query.raw);
+ return result;
+};
+
+/**
+ */
+Oktavia.prototype.build$ = function () {
+ this.build$IB(5, false);
+};
+
+/**
+ * @param {!number} cacheDensity
+ * @param {!boolean} verbose
+ */
+Oktavia.prototype.build$IB = function (cacheDensity, verbose) {
+ /** @type {!string} */
+ var key;
+ /** @type {!number} */
+ var cacheRange;
+ /** @type {!number} */
+ var maxChar;
+ for (key in this._metadatas) {
+ this._metadatas[key]._build$();
+ }
+ cacheRange = Math.round(Math.max(1, 100 / Math.min(100, Math.max(0.01, cacheDensity))));
+ maxChar = this._compressCode2utf16.length;
+ this._fmindex.build$SIIB(Oktavia.eof, maxChar, cacheRange, verbose);
+};
+
+/**
+ * @return {!string}
+ */
+Oktavia.prototype.dump$ = function () {
+ return this.dump$B(false);
+};
+
+/**
+ * @param {!boolean} verbose
+ * @return {!string}
+ */
+Oktavia.prototype.dump$B = function (verbose) {
+ /** @type {!string} */
+ var header;
+ /** @type {!string} */
+ var fmdata;
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var i;
+ /** @type {CompressionReport} */
+ var report;
+ /** @type {undefined|!string} */
+ var name;
+ /** @type {!string} */
+ var data;
+ header = Binary$dumpString$SLCompressionReport$("oktavia-01", null).slice(1);
+ if (verbose) {
+ console.log("Source text size: " + (this._fmindex.size$() * 2 + "") + ' bytes');
+ }
+ fmdata = this._fmindex.dump$B(verbose);
+ result = [ header, fmdata ];
+ result.push(Binary$dump16bitNumber$I(this._compressCode2utf16.length));
+ for (i = 3; i < this._compressCode2utf16.length; i++) {
+ result.push(this._compressCode2utf16[i]);
+ }
+ if (verbose) {
+ console.log('Char Code Map: ' + (this._compressCode2utf16.length * 2 - 2 + "") + ' bytes');
+ }
+ report = ({source: 0, result: 0});
+ result.push(Binary$dumpStringListMap$HASLCompressionReport$(this._stemmingResult, report));
+ if (verbose) {
+ console.log('Stemmed Word Table: ' + (result[result.length - 1].length + "") + ' bytes (' + (Math.round(report.result * 100.0 / report.source) + "") + '%)');
+ }
+ result.push(Binary$dump16bitNumber$I(this._metadataLabels.length));
+ for (i = 0; i < this._metadataLabels.length; i++) {
+ report = ({source: 0, result: 0});
+ name = this._metadataLabels[i];
+ data = this._metadatas[name]._dump$LCompressionReport$(report);
+ result.push(Binary$dumpString$SLCompressionReport$(name, report), data);
+ if (verbose) {
+ console.log('Meta Data ' + name + ': ' + (data.length * 2 + "") + ' bytes (' + (Math.round(report.result * 100.0 / report.source) + "") + '%)');
+ }
+ }
+ return result.join('');
+};
+
+/**
+ * @param {!string} data
+ */
+Oktavia.prototype.load$S = function (data) {
+ /** @type {!string} */
+ var header;
+ /** @type {!number} */
+ var offset;
+ /** @type {!number} */
+ var charCodeCount;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var charCode;
+ /** @type {LoadedStringListMapResult} */
+ var stemmedWords;
+ /** @type {!number} */
+ var metadataCount;
+ /** @type {LoadedStringResult} */
+ var nameResult;
+ /** @type {!string} */
+ var name;
+ /** @type {!number} */
+ var type;
+ header = Binary$dumpString$SLCompressionReport$("oktavia-01", null).slice(1);
+ if (data.slice(0, 5) !== header) {
+ throw new Error('Invalid data file');
+ }
+ this._metadatas = ({ });
+ this._metadataLabels = [ ];
+ offset = 5;
+ offset = this._fmindex.load$SI(data, offset);
+ charCodeCount = Binary$load16bitNumber$SI(data, offset++);
+ this._compressCode2utf16 = [ Oktavia.eof, Oktavia.eob, Oktavia.unknown ];
+ this._utf162compressCode = [ Oktavia.eof, Oktavia.eob, Oktavia.unknown ];
+ for (i = 3; i < charCodeCount; i++) {
+ charCode = Binary$load16bitNumber$SI(data, offset++);
+ this._compressCode2utf16.push(String.fromCharCode(charCode));
+ this._utf162compressCode[charCode] = String.fromCharCode(i);
+ }
+ stemmedWords = Binary$loadStringListMap$SI(data, offset);
+ this._stemmingResult = stemmedWords.result;
+ offset = stemmedWords.offset;
+ metadataCount = Binary$load16bitNumber$SI(data, offset++);
+ for (i = 0; i < metadataCount; i++) {
+ nameResult = Binary$loadString$SI(data, offset);
+ name = nameResult.result;
+ offset = nameResult.offset;
+ type = Binary$load16bitNumber$SI(data, offset++);
+ switch (type) {
+ case 0:
+ offset = Section$_load$LOktavia$SSI(this, name, data, offset);
+ break;
+ case 1:
+ offset = Splitter$_load$LOktavia$SSI(this, name, data, offset);
+ break;
+ case 2:
+ offset = Table$_load$LOktavia$SSI(this, name, data, offset);
+ break;
+ case 3:
+ offset = Block$_load$LOktavia$SSI(this, name, data, offset);
+ break;
+ }
+ }
+};
+
+/**
+ * @return {!number}
+ */
+Oktavia.prototype.contentSize$ = function () {
+ /** @type {FMIndex} */
+ var this$0;
+ this$0 = this._fmindex;
+ return this$0._substr.length;
+};
+
+/**
+ * @param {!number} position
+ * @return {!number}
+ */
+Oktavia.prototype.wordPositionType$I = function (position) {
+ /** @type {!number} */
+ var result;
+ /** @type {!string} */
+ var ahead;
+ result = 0;
+ if (position === 0) {
+ result = 4;
+ } else {
+ ahead = this._fmindex.getSubstring$II(position - 1, 1);
+ if (/\s/.test(ahead)) {
+ result = 2;
+ } else {
+ if (/\W/.test(ahead)) {
+ result = 1;
+ } else {
+ if (Oktavia.eob === ahead) {
+ result = 3;
+ }
+ }
+ }
+ }
+ return (result | 0);
+};
+
+/**
+ * @param {!number} position
+ * @param {!number} length
+ * @return {!string}
+ */
+Oktavia.prototype._getSubstring$II = function (position, length) {
+ /** @type {!string} */
+ var result;
+ /** @type {Array.<undefined|!string>} */
+ var str;
+ /** @type {!number} */
+ var i;
+ result = this._fmindex.getSubstring$II(position, length);
+ str = [ ];
+ for (i = 0; i < result.length; i++) {
+ str.push(this._compressCode2utf16[result.charCodeAt(i)]);
+ }
+ return str.join('');
+};
+
+/**
+ * class Binary extends Object
+ * @constructor
+ */
+function Binary() {
+}
+
+/**
+ * @constructor
+ */
+function Binary$() {
+};
+
+Binary$.prototype = new Binary;
+
+/**
+ * @param {!number} num
+ * @return {!string}
+ */
+Binary.dump32bitNumber$N = function (num) {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ result = [ String.fromCharCode(Math.floor(num / 65536)) ];
+ result.push(String.fromCharCode(num % 65536));
+ return result.join("");
+};
+
+var Binary$dump32bitNumber$N = Binary.dump32bitNumber$N;
+
+/**
+ * @param {!string} buffer
+ * @param {!number} offset
+ * @return {!number}
+ */
+Binary.load32bitNumber$SI = function (buffer, offset) {
+ /** @type {!number} */
+ var result;
+ result = buffer.charCodeAt(offset) * 65536 + buffer.charCodeAt(offset + 1);
+ return result;
+};
+
+var Binary$load32bitNumber$SI = Binary.load32bitNumber$SI;
+
+/**
+ * @param {!number} num
+ * @return {!string}
+ */
+Binary.dump16bitNumber$I = function (num) {
+ return String.fromCharCode(num % 65536);
+};
+
+var Binary$dump16bitNumber$I = Binary.dump16bitNumber$I;
+
+/**
+ * @param {!string} buffer
+ * @param {!number} offset
+ * @return {!number}
+ */
+Binary.load16bitNumber$SI = function (buffer, offset) {
+ return (buffer.charCodeAt(offset) | 0);
+};
+
+var Binary$load16bitNumber$SI = Binary.load16bitNumber$SI;
+
+/**
+ * @param {!string} str
+ * @return {!string}
+ */
+Binary.dumpString$S = function (str) {
+ return Binary$dumpString$SLCompressionReport$(str, null);
+};
+
+var Binary$dumpString$S = Binary.dumpString$S;
+
+/**
+ * @param {!string} str
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+Binary.dumpString$SLCompressionReport$ = function (str, report) {
+ /** @type {!number} */
+ var length;
+ /** @type {!boolean} */
+ var compress;
+ /** @type {Array.<undefined|!number>} */
+ var charCodes;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var charCode;
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {undefined|!number} */
+ var bytes;
+ if (str.length > 32768) {
+ str = str.slice(0, 32768);
+ }
+ length = str.length;
+ compress = true;
+ charCodes = [ ];
+ for (i = 0; i < length; i++) {
+ charCode = str.charCodeAt(i);
+ if (charCode > 255) {
+ compress = false;
+ break;
+ }
+ charCodes.push(charCode);
+ }
+ if (compress) {
+ result = [ Binary$dump16bitNumber$I(length + 32768) ];
+ for (i = 0; i < length; i += 2) {
+ bytes = charCodes[i];
+ if (i !== length - 1) {
+ bytes += charCodes[i + 1] << 8;
+ }
+ result.push(String.fromCharCode(bytes % 65536));
+ }
+ if (report) {
+ CompressionReport$add$LCompressionReport$II(report, length, Math.ceil(length / 2));
+ }
+ } else {
+ result = [ Binary$dump16bitNumber$I(length), str ];
+ if (report) {
+ CompressionReport$add$LCompressionReport$II(report, length, length);
+ }
+ }
+ return result.join('');
+};
+
+var Binary$dumpString$SLCompressionReport$ = Binary.dumpString$SLCompressionReport$;
+
+/**
+ * @param {!string} buffer
+ * @param {!number} offset
+ * @return {LoadedStringResult}
+ */
+Binary.loadString$SI = function (buffer, offset) {
+ return new LoadedStringResult$SI(buffer, offset);
+};
+
+var Binary$loadString$SI = Binary.loadString$SI;
+
+/**
+ * @param {Array.<undefined|!string>} strList
+ * @return {!string}
+ */
+Binary.dumpStringList$AS = function (strList) {
+ return Binary$dumpStringList$ASLCompressionReport$(strList, null);
+};
+
+var Binary$dumpStringList$AS = Binary.dumpStringList$AS;
+
+/**
+ * @param {Array.<undefined|!string>} strList
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+Binary.dumpStringList$ASLCompressionReport$ = function (strList, report) {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var i;
+ result = [ Binary$dump32bitNumber$N(strList.length) ];
+ for (i = 0; i < strList.length; i++) {
+ result.push(Binary$dumpString$SLCompressionReport$(strList[i], report));
+ }
+ return result.join('');
+};
+
+var Binary$dumpStringList$ASLCompressionReport$ = Binary.dumpStringList$ASLCompressionReport$;
+
+/**
+ * @param {!string} buffer
+ * @param {!number} offset
+ * @return {LoadedStringListResult}
+ */
+Binary.loadStringList$SI = function (buffer, offset) {
+ return new LoadedStringListResult$SI(buffer, offset);
+};
+
+var Binary$loadStringList$SI = Binary.loadStringList$SI;
+
+/**
+ * @param {Object.<string, undefined|Array.<undefined|!string>>} strMap
+ * @return {!string}
+ */
+Binary.dumpStringListMap$HAS = function (strMap) {
+ return Binary$dumpStringListMap$HASLCompressionReport$(strMap, null);
+};
+
+var Binary$dumpStringListMap$HAS = Binary.dumpStringListMap$HAS;
+
+/**
+ * @param {Object.<string, undefined|Array.<undefined|!string>>} strMap
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+Binary.dumpStringListMap$HASLCompressionReport$ = function (strMap, report) {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var counter;
+ /** @type {!string} */
+ var key;
+ result = [ ];
+ counter = 0;
+ for (key in strMap) {
+ result.push(Binary$dumpString$SLCompressionReport$(key, report));
+ result.push(Binary$dumpStringList$ASLCompressionReport$(strMap[key], report));
+ counter++;
+ }
+ return Binary$dump32bitNumber$N(counter) + result.join('');
+};
+
+var Binary$dumpStringListMap$HASLCompressionReport$ = Binary.dumpStringListMap$HASLCompressionReport$;
+
+/**
+ * @param {!string} buffer
+ * @param {!number} offset
+ * @return {LoadedStringListMapResult}
+ */
+Binary.loadStringListMap$SI = function (buffer, offset) {
+ return new LoadedStringListMapResult$SI(buffer, offset);
+};
+
+var Binary$loadStringListMap$SI = Binary.loadStringListMap$SI;
+
+/**
+ * @param {Array.<undefined|!number>} array
+ * @return {!string}
+ */
+Binary.dump32bitNumberList$AN = function (array) {
+ return Binary$dump32bitNumberList$ANLCompressionReport$(array, null);
+};
+
+var Binary$dump32bitNumberList$AN = Binary.dump32bitNumberList$AN;
+
+/**
+ * @param {Array.<undefined|!number>} array
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+Binary.dump32bitNumberList$ANLCompressionReport$ = function (array, report) {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var index;
+ /** @type {!number} */
+ var inputLength;
+ /** @type {!number} */
+ var length;
+ /** @type {!string} */
+ var resultString;
+ /** @type {!number} */
+ var value1$0;
+ /** @type {!number} */
+ var value2$0;
+ result = [ Binary$dump32bitNumber$N(array.length) ];
+ index = 0;
+ inputLength = array.length;
+ while (index < inputLength) {
+ if (array[index] == 0) {
+ length = Binary$_countZero$ANI(array, index);
+ result.push(Binary$_zeroBlock$I(length));
+ index += length;
+ } else {
+ if (Binary$_shouldZebraCode$ANI(array, index)) {
+ result.push(Binary$_createZebraCode$ANI(array, index));
+ value1$0 = array.length;
+ value2$0 = index + 15;
+ index = (value1$0 <= value2$0 ? value1$0 : value2$0);
+ } else {
+ length = Binary$_searchDoubleZero$ANI(array, index);
+ result.push(Binary$_nonZeroBlock$ANII(array, index, length));
+ if (length === 0) {
+ throw new Error('');
+ }
+ index += length;
+ }
+ }
+ }
+ resultString = result.join('');
+ if (report) {
+ CompressionReport$add$LCompressionReport$II(report, array.length * 2 + 2, resultString.length);
+ }
+ return resultString;
+};
+
+var Binary$dump32bitNumberList$ANLCompressionReport$ = Binary.dump32bitNumberList$ANLCompressionReport$;
+
+/**
+ * @param {!string} buffer
+ * @param {!number} offset
+ * @return {LoadedNumberListResult}
+ */
+Binary.load32bitNumberList$SI = function (buffer, offset) {
+ return new LoadedNumberListResult$SI(buffer, offset);
+};
+
+var Binary$load32bitNumberList$SI = Binary.load32bitNumberList$SI;
+
+/**
+ * @param {Array.<undefined|!number>} array
+ * @param {!number} offset
+ * @return {!number}
+ */
+Binary._countZero$ANI = function (array, offset) {
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var array$len$0;
+ for ((i = offset, array$len$0 = array.length); i < array$len$0; i++) {
+ if (array[i] != 0) {
+ return (i - offset | 0);
+ }
+ }
+ return (array.length - offset | 0);
+};
+
+var Binary$_countZero$ANI = Binary._countZero$ANI;
+
+/**
+ * @param {!number} length
+ * @return {!string}
+ */
+Binary._zeroBlock$I = function (length) {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ result = [ ];
+ while (length > 0) {
+ if (length > 16384) {
+ result.push(Binary$dump16bitNumber$I(16383));
+ length -= 16384;
+ } else {
+ result.push(Binary$dump16bitNumber$I(length - 1));
+ length = 0;
+ }
+ }
+ return result.join('');
+};
+
+var Binary$_zeroBlock$I = Binary._zeroBlock$I;
+
+/**
+ * @param {Array.<undefined|!number>} array
+ * @param {!number} offset
+ * @return {!boolean}
+ */
+Binary._shouldZebraCode$ANI = function (array, offset) {
+ /** @type {!number} */
+ var change;
+ /** @type {!boolean} */
+ var isLastZero;
+ /** @type {!number} */
+ var i;
+ if (array.length - offset < 16) {
+ return true;
+ }
+ change = 0;
+ isLastZero = false;
+ for (i = offset; i < offset + 15; i++) {
+ if (array[i] == 0) {
+ if (! isLastZero) {
+ isLastZero = true;
+ change++;
+ }
+ } else {
+ if (isLastZero) {
+ isLastZero = false;
+ change++;
+ }
+ }
+ }
+ return change > 2;
+};
+
+var Binary$_shouldZebraCode$ANI = Binary._shouldZebraCode$ANI;
+
+/**
+ * @param {Array.<undefined|!number>} array
+ * @param {!number} offset
+ * @return {!number}
+ */
+Binary._searchDoubleZero$ANI = function (array, offset) {
+ /** @type {!boolean} */
+ var isLastZero;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var array$len$0;
+ isLastZero = false;
+ for ((i = offset, array$len$0 = array.length); i < array$len$0; i++) {
+ if (array[i] == 0) {
+ if (isLastZero) {
+ return (i - offset - 1 | 0);
+ }
+ isLastZero = true;
+ } else {
+ isLastZero = false;
+ }
+ }
+ return (array.length - offset | 0);
+};
+
+var Binary$_searchDoubleZero$ANI = Binary._searchDoubleZero$ANI;
+
+/**
+ * @param {Array.<undefined|!number>} array
+ * @param {!number} offset
+ * @param {!number} length
+ * @return {!string}
+ */
+Binary._nonZeroBlock$ANII = function (array, offset, length) {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var blockLength;
+ /** @type {!number} */
+ var i;
+ result = [ ];
+ while (length > 0) {
+ if (length > 16384) {
+ blockLength = 16384;
+ length -= 16384;
+ } else {
+ blockLength = length;
+ length = 0;
+ }
+ result.push(Binary$dump16bitNumber$I(blockLength - 1 + 0x4000));
+ for (i = offset; i < offset + blockLength; i++) {
+ result.push(Binary$dump32bitNumber$N(array[i]));
+ }
+ offset += blockLength;
+ }
+ return result.join('');
+};
+
+var Binary$_nonZeroBlock$ANII = Binary._nonZeroBlock$ANII;
+
+/**
+ * @param {Array.<undefined|!number>} array
+ * @param {!number} offset
+ * @return {!string}
+ */
+Binary._createZebraCode$ANI = function (array, offset) {
+ /** @type {!number} */
+ var last;
+ /** @type {!number} */
+ var code;
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var value1$0;
+ /** @type {!number} */
+ var value2$0;
+ value1$0 = offset + 15;
+ value2$0 = array.length;
+ last = (value1$0 <= value2$0 ? value1$0 : value2$0);
+ code = 0x8000;
+ result = [ ];
+ for (i = offset; i < last; i++) {
+ if (array[i] != 0) {
+ result.push(Binary$dump32bitNumber$N(array[i]));
+ code = code + (0x1 << i - offset);
+ }
+ }
+ return String.fromCharCode(code) + result.join('');
+};
+
+var Binary$_createZebraCode$ANI = Binary._createZebraCode$ANI;
+
+/**
+ * @param {!string} str
+ * @return {!string}
+ */
+Binary.base64encode$S = function (str) {
+ /** @type {Array.<undefined|!string>} */
+ var out;
+ /** @type {Array.<undefined|!number>} */
+ var source;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var code;
+ /** @type {!number} */
+ var len;
+ /** @type {!number} */
+ var c1;
+ /** @type {undefined|!number} */
+ var c2;
+ /** @type {undefined|!number} */
+ var c3;
+ out = [ ];
+ source = [ ];
+ for (i = 0; i < str.length; i++) {
+ code = str.charCodeAt(i);
+ source.push(code & 0x00ff, code >>> 8);
+ }
+ len = str.length * 2;
+ i = 0;
+ while (i < len) {
+ c1 = source[i++] & 0xff;
+ if (i === len) {
+ out.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(c1 >> 2));
+ out.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((c1 & 0x3) << 4));
+ out.push("==");
+ break;
+ }
+ c2 = source[i++];
+ if (i === len) {
+ out.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(c1 >> 2));
+ out.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((c1 & 0x3) << 4 | (c2 & 0xF0) >> 4));
+ out.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((c2 & 0xF) << 2));
+ out.push("=");
+ break;
+ }
+ c3 = source[i++];
+ out.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(c1 >> 2));
+ out.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((c1 & 0x3) << 4 | (c2 & 0xF0) >> 4));
+ out.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((c2 & 0xF) << 2 | (c3 & 0xC0) >> 6));
+ out.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(c3 & 0x3F));
+ }
+ return out.join('');
+};
+
+var Binary$base64encode$S = Binary.base64encode$S;
+
+/**
+ * @param {Array.<undefined|!number>} source
+ * @return {!string}
+ */
+Binary._mergeCharCode$AI = function (source) {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var i;
+ result = [ ];
+ for (i = 0; i < source.length; i += 2) {
+ result.push(String.fromCharCode(source[i] + (source[i + 1] << 8)));
+ }
+ return result.join('');
+};
+
+var Binary$_mergeCharCode$AI = Binary._mergeCharCode$AI;
+
+/**
+ * @param {!string} str
+ * @return {!string}
+ */
+Binary.base64decode$S = function (str) {
+ /** @type {!number} */
+ var len;
+ /** @type {!number} */
+ var i;
+ /** @type {Array.<undefined|!number>} */
+ var out;
+ /** @type {undefined|!number} */
+ var c1;
+ /** @type {undefined|!number} */
+ var c2;
+ /** @type {!number} */
+ var c3;
+ /** @type {!number} */
+ var c4;
+ len = str.length;
+ i = 0;
+ out = [ ];
+ while (i < len) {
+ do {
+ c1 = Binary._base64DecodeChars[str.charCodeAt(i++) & 0xff];
+ } while (i < len && c1 == -1);
+ if (c1 == -1) {
+ break;
+ }
+ do {
+ c2 = Binary._base64DecodeChars[str.charCodeAt(i++) & 0xff];
+ } while (i < len && c2 == -1);
+ if (c2 == -1) {
+ break;
+ }
+ out.push(c1 << 2 | (c2 & 0x30) >> 4);
+ do {
+ c3 = str.charCodeAt(i++) & 0xff;
+ if (c3 === 61) {
+ return Binary$_mergeCharCode$AI(out);
+ }
+ c3 = Binary._base64DecodeChars[c3];
+ } while (i < len && c3 === -1);
+ if (c3 === -1) {
+ break;
+ }
+ out.push((c2 & 0XF) << 4 | (c3 & 0x3C) >> 2);
+ do {
+ c4 = str.charCodeAt(i++) & 0xff;
+ if (c4 === 61) {
+ return Binary$_mergeCharCode$AI(out);
+ }
+ c4 = (Binary._base64DecodeChars[c4] | 0);
+ } while (i < len && c4 === -1);
+ if (c4 === -1) {
+ break;
+ }
+ out.push((c3 & 0x03) << 6 | c4);
+ }
+ return Binary$_mergeCharCode$AI(out);
+};
+
+var Binary$base64decode$S = Binary.base64decode$S;
+
+/**
+ * class LoadedStringResult extends Object
+ * @constructor
+ */
+function LoadedStringResult() {
+}
+
+/**
+ * @constructor
+ * @param {!string} data
+ * @param {!number} offset
+ */
+function LoadedStringResult$SI(data, offset) {
+ /** @type {!number} */
+ var strLength;
+ /** @type {Array.<undefined|!string>} */
+ var bytes;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var code;
+ /** @type {!number} */
+ var offset$0;
+ this.result = "";
+ this.offset = 0;
+ offset$0 = offset++;
+ strLength = data.charCodeAt(offset$0);
+ if (strLength > 32767) {
+ strLength = strLength - 32768;
+ bytes = [ ];
+ for (i = 0; i < strLength; i += 2) {
+ code = data.charCodeAt(offset);
+ bytes.push(String.fromCharCode(code & 0x00ff));
+ if (i !== strLength - 1) {
+ bytes.push(String.fromCharCode(code >>> 8));
+ }
+ offset++;
+ }
+ this.result = bytes.join('');
+ this.offset = offset;
+ } else {
+ this.result = data.slice(offset, offset + strLength);
+ this.offset = (offset + strLength | 0);
+ }
+};
+
+LoadedStringResult$SI.prototype = new LoadedStringResult;
+
+/**
+ * class LoadedStringListResult extends Object
+ * @constructor
+ */
+function LoadedStringListResult() {
+}
+
+/**
+ * @constructor
+ * @param {!string} data
+ * @param {!number} offset
+ */
+function LoadedStringListResult$SI(data, offset) {
+ /** @type {!number} */
+ var length;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var strLength;
+ /** @type {!string} */
+ var resultStr;
+ /** @type {Array.<undefined|!string>} */
+ var bytes;
+ /** @type {!number} */
+ var j;
+ /** @type {!number} */
+ var code;
+ /** @type {!number} */
+ var result$0;
+ /** @type {!number} */
+ var offset$0;
+ this.offset = 0;
+ this.result = [ ];
+ result$0 = data.charCodeAt(offset) * 65536 + data.charCodeAt(offset + 1);
+ length = result$0;
+ offset += 2;
+ for (i = 0; i < length; i++) {
+ offset$0 = offset++;
+ strLength = data.charCodeAt(offset$0);
+ if (strLength > 32767) {
+ strLength = strLength - 32768;
+ bytes = [ ];
+ for (j = 0; j < strLength; j += 2) {
+ code = data.charCodeAt(offset);
+ bytes.push(String.fromCharCode(code & 0x00ff));
+ if (j !== strLength - 1) {
+ bytes.push(String.fromCharCode(code >>> 8));
+ }
+ offset++;
+ }
+ resultStr = bytes.join('');
+ } else {
+ resultStr = data.slice(offset, offset + strLength);
+ offset = (offset + strLength | 0);
+ }
+ this.result.push(resultStr);
+ }
+ this.offset = offset;
+};
+
+LoadedStringListResult$SI.prototype = new LoadedStringListResult;
+
+/**
+ * class LoadedStringListMapResult extends Object
+ * @constructor
+ */
+function LoadedStringListMapResult() {
+}
+
+/**
+ * @constructor
+ * @param {!string} data
+ * @param {!number} offset
+ */
+function LoadedStringListMapResult$SI(data, offset) {
+ /** @type {!number} */
+ var length;
+ /** @type {!number} */
+ var i;
+ /** @type {LoadedStringResult} */
+ var keyResult;
+ /** @type {LoadedStringListResult} */
+ var valueResult;
+ /** @type {!number} */
+ var result$0;
+ /** @type {!number} */
+ var offset$0;
+ this.offset = 0;
+ this.result = ({ });
+ result$0 = data.charCodeAt(offset) * 65536 + data.charCodeAt(offset + 1);
+ length = result$0;
+ offset += 2;
+ for (i = 0; i < length; i++) {
+ keyResult = new LoadedStringResult$SI(data, offset);
+ offset$0 = keyResult.offset;
+ valueResult = new LoadedStringListResult$SI(data, offset$0);
+ this.result[keyResult.result] = valueResult.result;
+ offset = valueResult.offset;
+ }
+ this.offset = offset;
+};
+
+LoadedStringListMapResult$SI.prototype = new LoadedStringListMapResult;
+
+/**
+ * class LoadedNumberListResult extends Object
+ * @constructor
+ */
+function LoadedNumberListResult() {
+}
+
+/**
+ * @constructor
+ * @param {!string} data
+ * @param {!number} offset
+ */
+function LoadedNumberListResult$SI(data, offset) {
+ /** @type {!number} */
+ var resultLength;
+ /** @type {!number} */
+ var originalOffset;
+ /** @type {Array.<undefined|!number>} */
+ var result;
+ /** @type {!number} */
+ var tag;
+ /** @type {!number} */
+ var length;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var result$0;
+ /** @type {!number} */
+ var value1$0;
+ this.result = null;
+ this.offset = 0;
+ result$0 = data.charCodeAt(offset) * 65536 + data.charCodeAt(offset + 1);
+ resultLength = result$0;
+ originalOffset = offset;
+ offset += 2;
+ result = [ ];
+ while (result.length < resultLength) {
+ tag = data.charCodeAt(offset++);
+ if (tag >>> 15 === 1) {
+ value1$0 = resultLength - result.length;
+ length = (value1$0 <= 15 ? value1$0 : 15);
+ for (i = 0; i < length; i++) {
+ if (tag >>> i & 0x1) {
+ result.push(Binary$load32bitNumber$SI(data, offset));
+ offset += 2;
+ } else {
+ result.push(0);
+ }
+ }
+ } else {
+ if (tag >>> 14 === 1) {
+ length = tag - 0x4000 + 1;
+ for (i = 0; i < length; i++) {
+ result.push(Binary$load32bitNumber$SI(data, offset));
+ offset += 2;
+ }
+ } else {
+ length = tag + 1;
+ for (i = 0; i < length; i++) {
+ result.push(0);
+ }
+ }
+ }
+ }
+ this.result = result;
+ this.offset = offset;
+};
+
+LoadedNumberListResult$SI.prototype = new LoadedNumberListResult;
+
+/**
+ * class CompressionReport extends Object
+ * @constructor
+ */
+function CompressionReport() {
+}
+
+/**
+ * @constructor
+ */
+function CompressionReport$() {
+ this.source = 0;
+ this.result = 0;
+};
+
+CompressionReport$.prototype = new CompressionReport;
+
+/**
+ * @param {CompressionReport} $this
+ * @param {!number} source
+ * @param {!number} result
+ */
+CompressionReport.add$LCompressionReport$II = function ($this, source, result) {
+ $this.source += source;
+ $this.result += result;
+};
+
+var CompressionReport$add$LCompressionReport$II = CompressionReport.add$LCompressionReport$II;
+
+/**
+ * @param {CompressionReport} $this
+ * @return {!number}
+ */
+CompressionReport.rate$LCompressionReport$ = function ($this) {
+ return (Math.round($this.result * 100.0 / $this.source) | 0);
+};
+
+var CompressionReport$rate$LCompressionReport$ = CompressionReport.rate$LCompressionReport$;
+
+/**
+ * class Query extends Object
+ * @constructor
+ */
+function Query() {
+}
+
+/**
+ * @constructor
+ */
+function Query$() {
+ this.word = '';
+ this.or = false;
+ this.not = false;
+ this.raw = false;
+};
+
+Query$.prototype = new Query;
+
+/**
+ * @return {!string}
+ */
+Query.prototype.toString = function () {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ result = [ ];
+ if (this.or) {
+ result.push("OR ");
+ }
+ if (this.not) {
+ result.push("-");
+ }
+ if (this.raw) {
+ result.push('"', this.word, '"');
+ } else {
+ result.push(this.word);
+ }
+ return result.join('');
+};
+
+/**
+ * class QueryStringParser extends Object
+ * @constructor
+ */
+function QueryStringParser() {
+}
+
+/**
+ * @constructor
+ */
+function QueryStringParser$() {
+ this.queries = [ ];
+};
+
+QueryStringParser$.prototype = new QueryStringParser;
+
+/**
+ * @param {QueryStringParser} $this
+ * @param {!string} queryString
+ * @return {Array.<undefined|Query>}
+ */
+QueryStringParser.parse$LQueryStringParser$S = function ($this, queryString) {
+ /** @type {!boolean} */
+ var nextOr;
+ /** @type {!boolean} */
+ var nextNot;
+ /** @type {!number} */
+ var currentWordStart;
+ /** @type {!number} */
+ var status;
+ /** @type {RegExp} */
+ var isSpace;
+ /** @type {!number} */
+ var i;
+ /** @type {!string} */
+ var ch;
+ /** @type {!string} */
+ var word;
+ /** @type {Query} */
+ var query;
+ nextOr = false;
+ nextNot = false;
+ currentWordStart = 0;
+ status = 0;
+ isSpace = /[\s\u3000]/;
+ for (i = 0; i < queryString.length; i++) {
+ ch = queryString.charAt(i);
+ switch (status) {
+ case 0:
+ if (! isSpace.test(ch)) {
+ if (ch === '-') {
+ nextNot = true;
+ } else {
+ if (ch === '"') {
+ currentWordStart = i + 1;
+ status = 2;
+ } else {
+ currentWordStart = i;
+ status = 1;
+ }
+ }
+ } else {
+ nextNot = false;
+ }
+ break;
+ case 1:
+ if (isSpace.test(ch)) {
+ word = queryString.slice(currentWordStart, i);
+ if (word === 'OR') {
+ nextOr = true;
+ } else {
+ query = new Query$();
+ query.word = word;
+ query.or = nextOr;
+ query.not = nextNot;
+ $this.queries.push(query);
+ nextOr = false;
+ nextNot = false;
+ }
+ status = 0;
+ }
+ break;
+ case 2:
+ if (ch === '"') {
+ word = queryString.slice(currentWordStart, i);
+ query = new Query$();
+ query.word = word;
+ query.or = nextOr;
+ query.not = nextNot;
+ query.raw = true;
+ $this.queries.push(query);
+ nextOr = false;
+ nextNot = false;
+ status = 0;
+ }
+ break;
+ }
+ }
+ switch (status) {
+ case 0:
+ break;
+ case 1:
+ query = new Query$();
+ word = queryString.slice(currentWordStart, queryString.length);
+ if (word !== 'OR') {
+ query.word = word;
+ query.or = nextOr;
+ query.not = nextNot;
+ $this.queries.push(query);
+ }
+ break;
+ case 2:
+ query = new Query$();
+ query.word = queryString.slice(currentWordStart, queryString.length);
+ query.or = nextOr;
+ query.not = nextNot;
+ query.raw = true;
+ $this.queries.push(query);
+ break;
+ }
+ return $this.queries;
+};
+
+var QueryStringParser$parse$LQueryStringParser$S = QueryStringParser.parse$LQueryStringParser$S;
+
+/**
+ * @param {QueryStringParser} $this
+ * @return {!string}
+ */
+QueryStringParser.highlight$LQueryStringParser$ = function ($this) {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var i;
+ /** @type {Query} */
+ var query;
+ result = [ ];
+ for (i = 0; i < $this.queries.length; i++) {
+ query = $this.queries[i];
+ if (! query.not) {
+ result.push("highlight=" + $__jsx_encodeURIComponent(query.word));
+ }
+ }
+ return '?' + result.join('&');
+};
+
+var QueryStringParser$highlight$LQueryStringParser$ = QueryStringParser.highlight$LQueryStringParser$;
+
+/**
+ * class Proposal extends Object
+ * @constructor
+ */
+function Proposal() {
+}
+
+/**
+ * @constructor
+ * @param {!number} omit
+ * @param {!number} expect
+ */
+function Proposal$II(omit, expect) {
+ this.omit = omit;
+ this.expect = expect;
+};
+
+Proposal$II.prototype = new Proposal;
+
+/**
+ * class Position extends Object
+ * @constructor
+ */
+function Position() {
+}
+
+/**
+ * @constructor
+ * @param {!string} word
+ * @param {!number} position
+ * @param {!boolean} stemmed
+ */
+function Position$SIB(word, position, stemmed) {
+ this.word = word;
+ this.position = position;
+ this.stemmed = stemmed;
+};
+
+Position$SIB.prototype = new Position;
+
+/**
+ * class SearchUnit extends Object
+ * @constructor
+ */
+function SearchUnit() {
+}
+
+/**
+ * @constructor
+ * @param {!number} id
+ */
+function SearchUnit$I(id) {
+ this.positions = ({ });
+ this.id = id;
+ this._size = 0;
+ this.score = 0;
+ this.startPosition = -1;
+};
+
+SearchUnit$I.prototype = new SearchUnit;
+
+/**
+ * @param {SearchUnit} $this
+ * @param {!string} word
+ * @param {!number} position
+ * @param {!boolean} stemmed
+ */
+SearchUnit.addPosition$LSearchUnit$SIB = function ($this, word, position, stemmed) {
+ /** @type {Position} */
+ var positionObj;
+ positionObj = $this.positions[position + ""];
+ if (! positionObj) {
+ $this._size++;
+ $this.positions[position + ""] = ({word: word, position: position, stemmed: stemmed});
+ } else {
+ if (positionObj.word.length < word.length) {
+ positionObj.word = word;
+ }
+ positionObj.stemmed = positionObj.stemmed && stemmed;
+ }
+};
+
+var SearchUnit$addPosition$LSearchUnit$SIB = SearchUnit.addPosition$LSearchUnit$SIB;
+
+/**
+ * @param {SearchUnit} $this
+ * @param {!number} position
+ * @return {Position}
+ */
+SearchUnit.get$LSearchUnit$I = function ($this, position) {
+ return $this.positions[position + ""];
+};
+
+var SearchUnit$get$LSearchUnit$I = SearchUnit.get$LSearchUnit$I;
+
+/**
+ * @param {SearchUnit} $this
+ * @return {!number}
+ */
+SearchUnit.size$LSearchUnit$ = function ($this) {
+ return $this._size;
+};
+
+var SearchUnit$size$LSearchUnit$ = SearchUnit.size$LSearchUnit$;
+
+/**
+ * @param {SearchUnit} $this
+ * @param {SearchUnit} rhs
+ */
+SearchUnit.merge$LSearchUnit$LSearchUnit$ = function ($this, rhs) {
+ /** @type {!string} */
+ var position;
+ /** @type {Position} */
+ var pos;
+ for (position in rhs.positions) {
+ pos = rhs.positions[position];
+ SearchUnit$addPosition$LSearchUnit$SIB($this, pos.word, pos.position, pos.stemmed);
+ }
+};
+
+var SearchUnit$merge$LSearchUnit$LSearchUnit$ = SearchUnit.merge$LSearchUnit$LSearchUnit$;
+
+/**
+ * @param {SearchUnit} $this
+ * @return {Array.<undefined|Position>}
+ */
+SearchUnit.getPositions$LSearchUnit$ = function ($this) {
+ /** @type {Array.<undefined|Position>} */
+ var result;
+ /** @type {!string} */
+ var pos;
+ result = [ ];
+ for (pos in $this.positions) {
+ result.push($this.positions[pos]);
+ }
+ result.sort((function (a, b) {
+ return a.position - b.position;
+ }));
+ return result;
+};
+
+var SearchUnit$getPositions$LSearchUnit$ = SearchUnit.getPositions$LSearchUnit$;
+
+/**
+ * class SingleResult extends Object
+ * @constructor
+ */
+function SingleResult() {
+}
+
+/**
+ * @constructor
+ */
+function SingleResult$() {
+ this.units = [ ];
+ this.unitIds = [ ];
+ this.or = false;
+ this.not = false;
+ this.searchWord = '';
+};
+
+SingleResult$.prototype = new SingleResult;
+
+/**
+ * @constructor
+ * @param {!string} searchWord
+ * @param {!boolean} or
+ * @param {!boolean} not
+ */
+function SingleResult$SBB(searchWord, or, not) {
+ this.units = [ ];
+ this.unitIds = [ ];
+ this.or = or;
+ this.not = not;
+ this.searchWord = searchWord;
+};
+
+SingleResult$SBB.prototype = new SingleResult;
+
+/**
+ * @param {SingleResult} $this
+ * @param {!number} unitId
+ * @return {SearchUnit}
+ */
+SingleResult.getSearchUnit$LSingleResult$I = function ($this, unitId) {
+ /** @type {!number} */
+ var existing;
+ /** @type {SearchUnit} */
+ var result;
+ existing = $this.unitIds.indexOf(unitId);
+ if (existing === -1) {
+ result = ({positions: ({ }), id: unitId, _size: 0, score: 0, startPosition: -1});
+ $this.units.push(result);
+ $this.unitIds.push(unitId);
+ } else {
+ result = $this.units[existing];
+ }
+ return result;
+};
+
+var SingleResult$getSearchUnit$LSingleResult$I = SingleResult.getSearchUnit$LSingleResult$I;
+
+/**
+ * @param {SingleResult} $this
+ * @param {SingleResult} rhs
+ * @return {SingleResult}
+ */
+SingleResult.merge$LSingleResult$LSingleResult$ = function ($this, rhs) {
+ /** @type {SingleResult} */
+ var result;
+ result = ({units: [ ], unitIds: [ ], or: false, not: false, searchWord: ''});
+ if (rhs.or) {
+ SingleResult$_orMerge$LSingleResult$LSingleResult$LSingleResult$($this, result, rhs);
+ } else {
+ if (rhs.not) {
+ SingleResult$_notMerge$LSingleResult$LSingleResult$LSingleResult$($this, result, rhs);
+ } else {
+ SingleResult$_andMerge$LSingleResult$LSingleResult$LSingleResult$($this, result, rhs);
+ }
+ }
+ return result;
+};
+
+var SingleResult$merge$LSingleResult$LSingleResult$ = SingleResult.merge$LSingleResult$LSingleResult$;
+
+/**
+ * @param {SingleResult} $this
+ * @return {!number}
+ */
+SingleResult.size$LSingleResult$ = function ($this) {
+ return ($this.units.length | 0);
+};
+
+var SingleResult$size$LSingleResult$ = SingleResult.size$LSingleResult$;
+
+/**
+ * @param {SingleResult} $this
+ * @param {SingleResult} result
+ * @param {SingleResult} rhs
+ */
+SingleResult._andMerge$LSingleResult$LSingleResult$LSingleResult$ = function ($this, result, rhs) {
+ /** @type {!number} */
+ var i;
+ /** @type {undefined|!number} */
+ var id;
+ /** @type {SearchUnit} */
+ var lhsSection;
+ for (i = 0; i < $this.unitIds.length; i++) {
+ id = $this.unitIds[i];
+ if (rhs.unitIds.indexOf(id) !== -1) {
+ lhsSection = $this.units[i];
+ result.unitIds.push(id);
+ result.units.push(lhsSection);
+ }
+ }
+};
+
+var SingleResult$_andMerge$LSingleResult$LSingleResult$LSingleResult$ = SingleResult._andMerge$LSingleResult$LSingleResult$LSingleResult$;
+
+/**
+ * @param {SingleResult} $this
+ * @param {SingleResult} result
+ * @param {SingleResult} rhs
+ */
+SingleResult._orMerge$LSingleResult$LSingleResult$LSingleResult$ = function ($this, result, rhs) {
+ /** @type {!number} */
+ var i;
+ /** @type {undefined|!number} */
+ var id;
+ /** @type {SearchUnit} */
+ var rhsSection;
+ /** @type {SearchUnit} */
+ var lhsSection;
+ /** @type {Array.<undefined|!number>} */
+ var unitIds$0;
+ /** @type {Array.<undefined|SearchUnit>} */
+ var units$0;
+ result.unitIds = (unitIds$0 = $this.unitIds).slice(0, unitIds$0.length);
+ result.units = (units$0 = $this.units).slice(0, units$0.length);
+ for (i = 0; i < rhs.unitIds.length; i++) {
+ id = rhs.unitIds[i];
+ rhsSection = rhs.units[i];
+ if (result.unitIds.indexOf(id) !== -1) {
+ lhsSection = result.units[result.unitIds.indexOf(id)];
+ SearchUnit$merge$LSearchUnit$LSearchUnit$(lhsSection, rhsSection);
+ } else {
+ result.unitIds.push(id);
+ result.units.push(rhsSection);
+ }
+ }
+};
+
+var SingleResult$_orMerge$LSingleResult$LSingleResult$LSingleResult$ = SingleResult._orMerge$LSingleResult$LSingleResult$LSingleResult$;
+
+/**
+ * @param {SingleResult} $this
+ * @param {SingleResult} result
+ * @param {SingleResult} rhs
+ */
+SingleResult._notMerge$LSingleResult$LSingleResult$LSingleResult$ = function ($this, result, rhs) {
+ /** @type {!number} */
+ var i;
+ /** @type {undefined|!number} */
+ var id;
+ /** @type {SearchUnit} */
+ var lhsSection;
+ for (i = 0; i < $this.unitIds.length; i++) {
+ id = $this.unitIds[i];
+ if (rhs.unitIds.indexOf(id) === -1) {
+ lhsSection = $this.units[i];
+ result.unitIds.push(id);
+ result.units.push(lhsSection);
+ }
+ }
+};
+
+var SingleResult$_notMerge$LSingleResult$LSingleResult$LSingleResult$ = SingleResult._notMerge$LSingleResult$LSingleResult$LSingleResult$;
+
+/**
+ * class SearchSummary extends Object
+ * @constructor
+ */
+function SearchSummary() {
+}
+
+/**
+ * @constructor
+ */
+function SearchSummary$() {
+ this.sourceResults = [ ];
+ this.result = null;
+ this.oktavia = null;
+};
+
+SearchSummary$.prototype = new SearchSummary;
+
+/**
+ * @constructor
+ * @param {Oktavia} oktavia
+ */
+function SearchSummary$LOktavia$(oktavia) {
+ this.sourceResults = [ ];
+ this.result = null;
+ this.oktavia = oktavia;
+};
+
+SearchSummary$LOktavia$.prototype = new SearchSummary;
+
+/**
+ * @param {SearchSummary} $this
+ * @param {SingleResult} result
+ */
+SearchSummary.addQuery$LSearchSummary$LSingleResult$ = function ($this, result) {
+ $this.sourceResults.push(result);
+};
+
+var SearchSummary$addQuery$LSearchSummary$LSingleResult$ = SearchSummary.addQuery$LSearchSummary$LSingleResult$;
+
+/**
+ * @param {SearchSummary} $this
+ */
+SearchSummary.mergeResult$LSearchSummary$ = function ($this) {
+ $this.result = SearchSummary$mergeResult$LSearchSummary$ALSingleResult$($this, $this.sourceResults);
+};
+
+var SearchSummary$mergeResult$LSearchSummary$ = SearchSummary.mergeResult$LSearchSummary$;
+
+/**
+ * @param {SearchSummary} $this
+ * @param {Array.<undefined|SingleResult>} results
+ * @return {SingleResult}
+ */
+SearchSummary.mergeResult$LSearchSummary$ALSingleResult$ = function ($this, results) {
+ /** @type {SingleResult} */
+ var rhs;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var results$len$0;
+ rhs = results[0];
+ for ((i = 1, results$len$0 = results.length); i < results$len$0; i++) {
+ rhs = SingleResult$merge$LSingleResult$LSingleResult$(rhs, results[i]);
+ }
+ return rhs;
+};
+
+var SearchSummary$mergeResult$LSearchSummary$ALSingleResult$ = SearchSummary.mergeResult$LSearchSummary$ALSingleResult$;
+
+/**
+ * @param {SearchSummary} $this
+ * @return {Array.<undefined|Proposal>}
+ */
+SearchSummary.getProposal$LSearchSummary$ = function ($this) {
+ /** @type {Array.<undefined|Proposal>} */
+ var proposals;
+ /** @type {!number} */
+ var i;
+ /** @type {Array.<undefined|SingleResult>} */
+ var tmpSource;
+ /** @type {!number} */
+ var j;
+ /** @type {SingleResult} */
+ var result;
+ proposals = [ ];
+ for (i = 0; i < $this.sourceResults.length; i++) {
+ tmpSource = [ ];
+ for (j = 0; j < $this.sourceResults.length; j++) {
+ if (i !== j) {
+ tmpSource.push($this.sourceResults[j]);
+ }
+ }
+ result = SearchSummary$mergeResult$LSearchSummary$ALSingleResult$($this, tmpSource);
+ proposals.push(({omit: i, expect: result.units.length}));
+ }
+ proposals.sort((function (a, b) {
+ return b.expect - a.expect;
+ }));
+ return proposals;
+};
+
+var SearchSummary$getProposal$LSearchSummary$ = SearchSummary.getProposal$LSearchSummary$;
+
+/**
+ * @param {SearchSummary} $this
+ * @return {Array.<undefined|SearchUnit>}
+ */
+SearchSummary.getSortedResult$LSearchSummary$ = function ($this) {
+ /** @type {Array.<undefined|SearchUnit>} */
+ var result;
+ /** @type {Array.<undefined|SearchUnit>} */
+ var units$0;
+ result = (units$0 = $this.result.units).slice(0, units$0.length);
+ result.sort((function (a, b) {
+ return b.score - a.score;
+ }));
+ return result;
+};
+
+var SearchSummary$getSortedResult$LSearchSummary$ = SearchSummary.getSortedResult$LSearchSummary$;
+
+/**
+ * @param {SearchSummary} $this
+ * @return {!number}
+ */
+SearchSummary.size$LSearchSummary$ = function ($this) {
+ /** @type {SingleResult} */
+ var this$0;
+ this$0 = $this.result;
+ return (this$0.units.length | 0);
+};
+
+var SearchSummary$size$LSearchSummary$ = SearchSummary.size$LSearchSummary$;
+
+/**
+ * @param {SearchSummary} $this
+ * @param {SingleResult} result
+ */
+SearchSummary.add$LSearchSummary$LSingleResult$ = function ($this, result) {
+ $this.sourceResults.push(result);
+};
+
+var SearchSummary$add$LSearchSummary$LSingleResult$ = SearchSummary.add$LSearchSummary$LSingleResult$;
+
+/**
+ * class Style extends Object
+ * @constructor
+ */
+function Style() {
+}
+
+/**
+ * @constructor
+ * @param {!string} mode
+ */
+function Style$S(mode) {
+ this.styles = null;
+ this.escapeHTML = false;
+ switch (mode) {
+ case 'console':
+ this.styles = Style.console;
+ break;
+ case 'html':
+ this.styles = Style.html;
+ break;
+ case 'ignore':
+ this.styles = Style.ignore;
+ break;
+ default:
+ this.styles = Style.ignore;
+ break;
+ }
+ this.escapeHTML = mode === 'html';
+};
+
+Style$S.prototype = new Style;
+
+/**
+ * @param {!string} source
+ * @return {!string}
+ */
+Style.prototype.convert$S = function (source) {
+ /** @type {_HTMLHandler} */
+ var handler;
+ /** @type {SAXParser} */
+ var parser;
+ handler = new _HTMLHandler$HASB(this.styles, this.escapeHTML);
+ parser = new SAXParser$LSAXHandler$(handler);
+ parser.parse$S(source);
+ return handler.text.join('');
+};
+
+/**
+ * class Stemmer
+ * @constructor
+ */
+function Stemmer() {
+}
+
+Stemmer.prototype.$__jsx_implements_Stemmer = true;
+
+/**
+ * @constructor
+ */
+function Stemmer$() {
+};
+
+Stemmer$.prototype = new Stemmer;
+
+/**
+ * class Metadata extends Object
+ * @constructor
+ */
+function Metadata() {
+}
+
+/**
+ * @constructor
+ * @param {Oktavia} parent
+ */
+function Metadata$LOktavia$(parent) {
+ this._parent = parent;
+ this._bitVector = new BitVector$();
+};
+
+Metadata$LOktavia$.prototype = new Metadata;
+
+/**
+ * @return {!number}
+ */
+Metadata.prototype._size$ = function () {
+ /** @type {BitVector} */
+ var this$0;
+ /** @type {!number} */
+ var i$0;
+ /** @type {BitVector} */
+ var _bitVector$0;
+ this$0 = _bitVector$0 = this._bitVector;
+ i$0 = _bitVector$0._size;
+ return this$0.rank$IB(i$0, true);
+};
+
+/**
+ * @param {!number} index
+ * @return {!string}
+ */
+Metadata.prototype.getContent$I = function (index) {
+ /** @type {!number} */
+ var startPosition;
+ /** @type {!number} */
+ var length;
+ if (index < 0 || this._size$() <= index) {
+ throw new Error("Section.getContent() : range error " + (index + ""));
+ }
+ startPosition = 0;
+ if (index > 0) {
+ startPosition = this._bitVector.select$I(index - 1) + 1;
+ }
+ length = this._bitVector.select$I(index) - startPosition + 1;
+ return this._parent._getSubstring$II(startPosition, length);
+};
+
+/**
+ * @param {!number} index
+ * @return {!number}
+ */
+Metadata.prototype.getStartPosition$I = function (index) {
+ /** @type {!number} */
+ var startPosition;
+ if (index < 0 || this._size$() <= index) {
+ throw new Error("Section.getContent() : range error " + (index + ""));
+ }
+ startPosition = 0;
+ if (index > 0) {
+ startPosition = this._bitVector.select$I(index - 1) + 1;
+ }
+ return (startPosition | 0);
+};
+
+/**
+ * @param {SingleResult} result
+ * @param {Array.<undefined|!number>} positions
+ * @param {!string} word
+ * @param {!boolean} stemmed
+ */
+Metadata.prototype.grouping$LSingleResult$AISB = function (result, positions, word, stemmed) {
+};
+
+/**
+ * @param {!number} index
+ * @return {!string}
+ */
+Metadata.prototype.getInformation$I = function (index) {
+ return '';
+};
+
+/**
+ */
+Metadata.prototype._build$ = function () {
+ this._bitVector.build$();
+};
+
+/**
+ * @param {!string} name
+ * @param {!string} data
+ * @param {!number} offset
+ * @return {!number}
+ */
+Metadata.prototype._load$SSI = function (name, data, offset) {
+ offset = this._bitVector.load$SI(data, offset);
+ this._parent._metadataLabels.push(name);
+ this._parent._metadatas[name] = this;
+ return offset;
+};
+
+/**
+ * @return {!string}
+ */
+Metadata.prototype._dump$ = function () {
+ /** @type {BitVector} */
+ var this$0;
+ /** @type {Array.<undefined|!string>} */
+ var contents$0;
+ this$0 = this._bitVector;
+ contents$0 = [ ];
+ contents$0.push(Binary$dump32bitNumber$N(this$0._size));
+ contents$0.push(Binary$dump32bitNumberList$AN(this$0._v));
+ return contents$0.join('');
+};
+
+/**
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+Metadata.prototype._dump$LCompressionReport$ = function (report) {
+ /** @type {BitVector} */
+ var this$0;
+ /** @type {Array.<undefined|!string>} */
+ var contents$0;
+ this$0 = this._bitVector;
+ contents$0 = [ ];
+ contents$0.push(Binary$dump32bitNumber$N(this$0._size));
+ CompressionReport$add$LCompressionReport$II(report, 2, 2);
+ contents$0.push(Binary$dump32bitNumberList$ANLCompressionReport$(this$0._v, report));
+ return contents$0.join('');
+};
+
+/**
+ * class Section extends Metadata
+ * @constructor
+ */
+function Section() {
+}
+
+Section.prototype = new Metadata;
+/**
+ * @constructor
+ * @param {Oktavia} parent
+ */
+function Section$LOktavia$(parent) {
+ this._parent = parent;
+ this._bitVector = new BitVector$();
+ this._names = [ ];
+};
+
+Section$LOktavia$.prototype = new Section;
+
+/**
+ * @param {!string} name
+ */
+Section.prototype.setTail$S = function (name) {
+ /** @type {!number} */
+ var index$0;
+ /** @type {Oktavia} */
+ var this$0;
+ /** @type {FMIndex} */
+ var this$0$0;
+ this$0 = this._parent;
+ this$0$0 = this$0._fmindex;
+ index$0 = this$0$0._substr.length;
+ this._names.push(name);
+ this._bitVector.set$I(index$0 - 1);
+};
+
+/**
+ * @param {!string} name
+ * @param {!number} index
+ */
+Section.prototype.setTail$SI = function (name, index) {
+ this._names.push(name);
+ this._bitVector.set$I(index - 1);
+};
+
+/**
+ * @return {!number}
+ */
+Section.prototype.size$ = function () {
+ return (this._names.length | 0);
+};
+
+/**
+ * @param {!number} position
+ * @return {!number}
+ */
+Section.prototype.getSectionIndex$I = function (position) {
+ /** @type {BitVector} */
+ var this$0;
+ if (position < 0 || this._bitVector.size$() <= position) {
+ throw new Error("Section.getSectionIndex() : range error " + (position + ""));
+ }
+ this$0 = this._bitVector;
+ return this$0.rank$IB(position, true);
+};
+
+/**
+ * @param {!number} index
+ * @return {!string}
+ */
+Section.prototype.getName$I = function (index) {
+ if (index < 0 || this._names.length <= index) {
+ throw new Error("Section.getName() : range error");
+ }
+ return this._names[index];
+};
+
+/**
+ * @param {SingleResult} result
+ * @param {Array.<undefined|!number>} positions
+ * @param {!string} word
+ * @param {!boolean} stemmed
+ */
+Section.prototype.grouping$LSingleResult$AISB = function (result, positions, word, stemmed) {
+ /** @type {!number} */
+ var i;
+ /** @type {undefined|!number} */
+ var position;
+ /** @type {!number} */
+ var index;
+ /** @type {SearchUnit} */
+ var unit;
+ for (i = 0; i < positions.length; i++) {
+ position = positions[i];
+ index = this.getSectionIndex$I(position);
+ unit = SingleResult$getSearchUnit$LSingleResult$I(result, index);
+ if (unit.startPosition < 0) {
+ unit.startPosition = this.getStartPosition$I(index);
+ }
+ SearchUnit$addPosition$LSearchUnit$SIB(unit, word, position - unit.startPosition, stemmed);
+ }
+};
+
+/**
+ * @param {!number} index
+ * @return {!string}
+ */
+Section.prototype.getInformation$I = function (index) {
+ return this.getName$I(index);
+};
+
+/**
+ * @param {Oktavia} parent
+ * @param {!string} name
+ * @param {!string} data
+ * @param {!number} offset
+ * @return {!number}
+ */
+Section._load$LOktavia$SSI = function (parent, name, data, offset) {
+ /** @type {LoadedStringListResult} */
+ var strs;
+ /** @type {Section} */
+ var section;
+ /** @type {!number} */
+ var offset$0;
+ strs = new LoadedStringListResult$SI(data, offset);
+ section = new Section$LOktavia$(parent);
+ section._names = strs.result;
+ offset$0 = strs.offset;
+ offset$0 = section._bitVector.load$SI(data, offset$0);
+ section._parent._metadataLabels.push(name);
+ section._parent._metadatas[name] = section;
+ return offset$0;
+};
+
+var Section$_load$LOktavia$SSI = Section._load$LOktavia$SSI;
+
+/**
+ * @return {!string}
+ */
+Section.prototype._dump$ = function () {
+ return [ Binary$dump16bitNumber$I(0), Binary$dumpStringList$AS(this._names), Metadata.prototype._dump$.call(this) ].join('');
+};
+
+/**
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+Section.prototype._dump$LCompressionReport$ = function (report) {
+ CompressionReport$add$LCompressionReport$II(report, 1, 1);
+ return [ Binary$dump16bitNumber$I(0), Binary$dumpStringList$ASLCompressionReport$(this._names, report), Metadata.prototype._dump$LCompressionReport$.call(this, report) ].join('');
+};
+
+/**
+ * class Splitter extends Metadata
+ * @constructor
+ */
+function Splitter() {
+}
+
+Splitter.prototype = new Metadata;
+/**
+ * @constructor
+ * @param {Oktavia} parent
+ */
+function Splitter$LOktavia$(parent) {
+ this._parent = parent;
+ this._bitVector = new BitVector$();
+ this.name = null;
+};
+
+Splitter$LOktavia$.prototype = new Splitter;
+
+/**
+ * @constructor
+ * @param {Oktavia} parent
+ * @param {!string} name
+ */
+function Splitter$LOktavia$S(parent, name) {
+ this._parent = parent;
+ this._bitVector = new BitVector$();
+ this.name = name;
+};
+
+Splitter$LOktavia$S.prototype = new Splitter;
+
+/**
+ * @return {!number}
+ */
+Splitter.prototype.size$ = function () {
+ /** @type {BitVector} */
+ var this$0$0;
+ /** @type {!number} */
+ var i$0$0;
+ /** @type {BitVector} */
+ var _bitVector$0;
+ this$0$0 = _bitVector$0 = this._bitVector;
+ i$0$0 = _bitVector$0._size;
+ return this$0$0.rank$IB(i$0$0, true);
+};
+
+/**
+ */
+Splitter.prototype.split$ = function () {
+ /** @type {!number} */
+ var index$0;
+ /** @type {Oktavia} */
+ var this$0;
+ /** @type {FMIndex} */
+ var this$0$0;
+ this$0 = this._parent;
+ this$0$0 = this$0._fmindex;
+ index$0 = this$0$0._substr.length;
+ this._bitVector.set$I(index$0 - 1);
+};
+
+/**
+ * @param {!number} index
+ */
+Splitter.prototype.split$I = function (index) {
+ this._bitVector.set$I(index - 1);
+};
+
+/**
+ * @param {!number} position
+ * @return {!number}
+ */
+Splitter.prototype.getIndex$I = function (position) {
+ /** @type {BitVector} */
+ var this$0;
+ if (position < 0 || this._bitVector.size$() <= position) {
+ throw new Error("Section.getSectionIndex() : range error");
+ }
+ this$0 = this._bitVector;
+ return this$0.rank$IB(position, true);
+};
+
+/**
+ * @param {SingleResult} result
+ * @param {Array.<undefined|!number>} positions
+ * @param {!string} word
+ * @param {!boolean} stemmed
+ */
+Splitter.prototype.grouping$LSingleResult$AISB = function (result, positions, word, stemmed) {
+ /** @type {!number} */
+ var i;
+ /** @type {undefined|!number} */
+ var position;
+ /** @type {!number} */
+ var index;
+ /** @type {SearchUnit} */
+ var unit;
+ for (i = 0; i < positions.length; i++) {
+ position = positions[i];
+ index = this.getIndex$I(position);
+ unit = SingleResult$getSearchUnit$LSingleResult$I(result, index);
+ if (unit.startPosition < 0) {
+ unit.startPosition = this.getStartPosition$I(index);
+ }
+ SearchUnit$addPosition$LSearchUnit$SIB(unit, word, position - unit.startPosition, stemmed);
+ }
+};
+
+/**
+ * @param {!number} index
+ * @return {!string}
+ */
+Splitter.prototype.getInformation$I = function (index) {
+ return (this.name != null ? this.name + (index + 1 + "") : '');
+};
+
+/**
+ * @param {Oktavia} parent
+ * @param {!string} name
+ * @param {!string} data
+ * @param {!number} offset
+ * @return {!number}
+ */
+Splitter._load$LOktavia$SSI = function (parent, name, data, offset) {
+ /** @type {Splitter} */
+ var section;
+ section = new Splitter$LOktavia$(parent);
+ offset = section._bitVector.load$SI(data, offset);
+ section._parent._metadataLabels.push(name);
+ section._parent._metadatas[name] = section;
+ return offset;
+};
+
+var Splitter$_load$LOktavia$SSI = Splitter._load$LOktavia$SSI;
+
+/**
+ * @return {!string}
+ */
+Splitter.prototype._dump$ = function () {
+ return [ Binary$dump16bitNumber$I(1), Metadata.prototype._dump$.call(this) ].join('');
+};
+
+/**
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+Splitter.prototype._dump$LCompressionReport$ = function (report) {
+ CompressionReport$add$LCompressionReport$II(report, 1, 1);
+ return [ Binary$dump16bitNumber$I(1), Metadata.prototype._dump$LCompressionReport$.call(this, report) ].join('');
+};
+
+/**
+ * class Table extends Metadata
+ * @constructor
+ */
+function Table() {
+}
+
+Table.prototype = new Metadata;
+/**
+ * @constructor
+ * @param {Oktavia} parent
+ * @param {Array.<undefined|!string>} headers
+ */
+function Table$LOktavia$AS(parent, headers) {
+ this._parent = parent;
+ this._bitVector = new BitVector$();
+ this._headers = headers;
+ this._columnTails = new BitVector$();
+};
+
+Table$LOktavia$AS.prototype = new Table;
+
+/**
+ * @return {!number}
+ */
+Table.prototype.rowSize$ = function () {
+ /** @type {BitVector} */
+ var this$0$0;
+ /** @type {!number} */
+ var i$0$0;
+ /** @type {BitVector} */
+ var _bitVector$0;
+ this$0$0 = _bitVector$0 = this._bitVector;
+ i$0$0 = _bitVector$0._size;
+ return this$0$0.rank$IB(i$0$0, true);
+};
+
+/**
+ * @return {!number}
+ */
+Table.prototype.columnSize$ = function () {
+ return (this._headers.length | 0);
+};
+
+/**
+ */
+Table.prototype.setColumnTail$ = function () {
+ /** @type {!number} */
+ var index;
+ /** @type {Oktavia} */
+ var this$0;
+ /** @type {FMIndex} */
+ var this$0$0;
+ /** @type {Oktavia} */
+ var _parent$0;
+ this$0 = _parent$0 = this._parent;
+ this$0$0 = this$0._fmindex;
+ index = this$0$0._substr.length;
+ _parent$0._fmindex.push$S(Oktavia.eob);
+ this._columnTails.set$I(index - 1);
+};
+
+/**
+ */
+Table.prototype.setRowTail$ = function () {
+ /** @type {!number} */
+ var index;
+ /** @type {Oktavia} */
+ var this$0;
+ /** @type {FMIndex} */
+ var this$0$0;
+ this$0 = this._parent;
+ this$0$0 = this$0._fmindex;
+ index = this$0$0._substr.length;
+ this._bitVector.set$I(index - 1);
+};
+
+/**
+ * @param {!number} position
+ * @return {Array.<undefined|!number>}
+ */
+Table.prototype.getCell$I = function (position) {
+ /** @type {!number} */
+ var row;
+ /** @type {!number} */
+ var currentColumn;
+ /** @type {!number} */
+ var lastRowColumn;
+ /** @type {!number} */
+ var startPosition;
+ /** @type {Array.<undefined|!number>} */
+ var result;
+ /** @type {BitVector} */
+ var this$0;
+ /** @type {BitVector} */
+ var this$1;
+ if (position < 0 || this._bitVector.size$() <= position) {
+ throw new Error("Section.getSectionIndex() : range error " + (position + ""));
+ }
+ this$0 = this._bitVector;
+ row = this$0.rank$IB(position, true);
+ this$1 = this._columnTails;
+ currentColumn = this$1.rank$IB(position, true);
+ lastRowColumn = 0;
+ if (row > 0) {
+ startPosition = this._bitVector.select$I(row - 1) + 1;
+ lastRowColumn = this._columnTails.rank$I(startPosition);
+ }
+ result = [ row, currentColumn - lastRowColumn ];
+ return result;
+};
+
+/**
+ * @param {!number} rowIndex
+ * @return {Object.<string, undefined|!string>}
+ */
+Table.prototype.getRowContent$I = function (rowIndex) {
+ /** @type {!string} */
+ var content;
+ /** @type {Array.<undefined|!string>} */
+ var values;
+ /** @type {Object.<string, undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var i;
+ content = this.getContent$I(rowIndex);
+ values = content.split(Oktavia.eob, this._headers.length);
+ result = ({ });
+ for (i in this._headers) {
+ if (i < values.length) {
+ result[this._headers[i]] = values[i];
+ } else {
+ result[this._headers[i]] = '';
+ }
+ }
+ return result;
+};
+
+/**
+ * @param {SingleResult} result
+ * @param {Array.<undefined|!number>} positions
+ * @param {!string} word
+ * @param {!boolean} stemmed
+ */
+Table.prototype.grouping$LSingleResult$AISB = function (result, positions, word, stemmed) {
+};
+
+/**
+ * @param {!number} index
+ * @return {!string}
+ */
+Table.prototype.getInformation$I = function (index) {
+ return '';
+};
+
+/**
+ */
+Table.prototype._build$ = function () {
+ this._bitVector.build$();
+ this._columnTails.build$();
+};
+
+/**
+ * @param {Oktavia} parent
+ * @param {!string} name
+ * @param {!string} data
+ * @param {!number} offset
+ * @return {!number}
+ */
+Table._load$LOktavia$SSI = function (parent, name, data, offset) {
+ /** @type {LoadedStringListResult} */
+ var strs;
+ /** @type {Table} */
+ var table;
+ /** @type {!number} */
+ var offset$0;
+ strs = new LoadedStringListResult$SI(data, offset);
+ table = new Table$LOktavia$AS(parent, strs.result);
+ offset$0 = strs.offset;
+ offset$0 = table._bitVector.load$SI(data, offset$0);
+ table._parent._metadataLabels.push(name);
+ table._parent._metadatas[name] = table;
+ offset = offset$0;
+ return table._columnTails.load$SI(data, offset$0);
+};
+
+var Table$_load$LOktavia$SSI = Table._load$LOktavia$SSI;
+
+/**
+ * @return {!string}
+ */
+Table.prototype._dump$ = function () {
+ return [ Binary$dump16bitNumber$I(2), Binary$dumpStringList$AS(this._headers), Metadata.prototype._dump$.call(this), this._columnTails.dump$() ].join('');
+};
+
+/**
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+Table.prototype._dump$LCompressionReport$ = function (report) {
+ CompressionReport$add$LCompressionReport$II(report, 1, 1);
+ return [ Binary$dump16bitNumber$I(2), Binary$dumpStringList$ASLCompressionReport$(this._headers, report), Metadata.prototype._dump$LCompressionReport$.call(this, report), this._columnTails.dump$LCompressionReport$(report) ].join('');
+};
+
+/**
+ * class Block extends Metadata
+ * @constructor
+ */
+function Block() {
+}
+
+Block.prototype = new Metadata;
+/**
+ * @constructor
+ * @param {Oktavia} parent
+ */
+function Block$LOktavia$(parent) {
+ this._parent = parent;
+ this._bitVector = new BitVector$();
+ this._names = [ ];
+ this._start = false;
+};
+
+Block$LOktavia$.prototype = new Block;
+
+/**
+ * @param {!string} blockName
+ */
+Block.prototype.startBlock$S = function (blockName) {
+ this.startBlock$SI(blockName, this._parent.contentSize$());
+};
+
+/**
+ * @param {!string} blockName
+ * @param {!number} index
+ */
+Block.prototype.startBlock$SI = function (blockName, index) {
+ if (this._start) {
+ throw new Error('Splitter `' + this._names[this._names.length - 1] + '` is not closed');
+ }
+ this._start = true;
+ this._names.push(blockName);
+ this._bitVector.set$I(index - 1);
+};
+
+/**
+ */
+Block.prototype.endBlock$ = function () {
+ this.endBlock$I(this._parent.contentSize$());
+};
+
+/**
+ * @param {!number} index
+ */
+Block.prototype.endBlock$I = function (index) {
+ if (! this._start) {
+ throw new Error('Splitter is not started');
+ }
+ this._start = false;
+ this._bitVector.set$I(index - 1);
+};
+
+/**
+ * @return {!number}
+ */
+Block.prototype.size$ = function () {
+ return (this._names.length | 0);
+};
+
+/**
+ * @param {!number} position
+ * @return {!number}
+ */
+Block.prototype.blockIndex$I = function (position) {
+ /** @type {!number} */
+ var result;
+ /** @type {BitVector} */
+ var this$0;
+ if (position < 0 || this._parent._fmindex.size$() - 1 <= position) {
+ throw new Error("Block.blockIndex() : range error " + (position + ""));
+ }
+ if (position >= this._bitVector.size$()) {
+ position = (this._bitVector.size$() - 1 | 0);
+ result = (this._bitVector.rank$I(position) + 1 | 0);
+ } else {
+ this$0 = this._bitVector;
+ result = this$0.rank$IB(position, true);
+ }
+ return result;
+};
+
+/**
+ * @param {!number} position
+ * @return {!boolean}
+ */
+Block.prototype.inBlock$I = function (position) {
+ /** @type {!number} */
+ var blockIndex;
+ blockIndex = this.blockIndex$I(position);
+ return blockIndex % 2 !== 0;
+};
+
+/**
+ * @param {!number} position
+ * @return {!string}
+ */
+Block.prototype.getBlockContent$I = function (position) {
+ /** @type {!number} */
+ var blockIndex;
+ /** @type {!string} */
+ var result;
+ blockIndex = this.blockIndex$I(position);
+ if (blockIndex % 2 !== 0) {
+ result = this.getContent$I(blockIndex);
+ } else {
+ result = '';
+ }
+ return result;
+};
+
+/**
+ * @param {!number} position
+ * @return {!string}
+ */
+Block.prototype.getBlockName$I = function (position) {
+ /** @type {!number} */
+ var blockIndex;
+ /** @type {!string} */
+ var result;
+ blockIndex = this.blockIndex$I(position);
+ if (blockIndex % 2 !== 0) {
+ result = this._names[blockIndex >>> 1];
+ } else {
+ result = '';
+ }
+ return result;
+};
+
+/**
+ * @param {SingleResult} result
+ * @param {Array.<undefined|!number>} positions
+ * @param {!string} word
+ * @param {!boolean} stemmed
+ */
+Block.prototype.grouping$LSingleResult$AISB = function (result, positions, word, stemmed) {
+};
+
+/**
+ * @param {!number} index
+ * @return {!string}
+ */
+Block.prototype.getInformation$I = function (index) {
+ return '';
+};
+
+/**
+ * @param {Oktavia} parent
+ * @param {!string} name
+ * @param {!string} data
+ * @param {!number} offset
+ * @return {!number}
+ */
+Block._load$LOktavia$SSI = function (parent, name, data, offset) {
+ /** @type {LoadedStringListResult} */
+ var strs;
+ /** @type {Block} */
+ var block;
+ /** @type {!number} */
+ var offset$0;
+ strs = new LoadedStringListResult$SI(data, offset);
+ block = new Block$LOktavia$(parent);
+ block._names = strs.result;
+ offset$0 = strs.offset;
+ offset$0 = block._bitVector.load$SI(data, offset$0);
+ block._parent._metadataLabels.push(name);
+ block._parent._metadatas[name] = block;
+ return offset$0;
+};
+
+var Block$_load$LOktavia$SSI = Block._load$LOktavia$SSI;
+
+/**
+ * @return {!string}
+ */
+Block.prototype._dump$ = function () {
+ return [ Binary$dump16bitNumber$I(3), Binary$dumpStringList$AS(this._names), Metadata.prototype._dump$.call(this) ].join('');
+};
+
+/**
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+Block.prototype._dump$LCompressionReport$ = function (report) {
+ CompressionReport$add$LCompressionReport$II(report, 1, 1);
+ return [ Binary$dump16bitNumber$I(3), Binary$dumpStringList$ASLCompressionReport$(this._names, report), Metadata.prototype._dump$LCompressionReport$.call(this, report) ].join('');
+};
+
+/**
+ * class FMIndex extends Object
+ * @constructor
+ */
+function FMIndex() {
+}
+
+/**
+ * @constructor
+ */
+function FMIndex$() {
+ /** @type {Array.<undefined|!number>} */
+ var _rlt$0;
+ this._ssize = 0;
+ (this._ddic = 0, this._head = 0);
+ this._substr = "";
+ this._sv = new WaveletMatrix$();
+ this._posdic = [ ];
+ this._idic = [ ];
+ _rlt$0 = this._rlt = [ ];
+ _rlt$0.length = 65536;
+};
+
+FMIndex$.prototype = new FMIndex;
+
+/**
+ */
+FMIndex.prototype.clear$ = function () {
+ /** @type {WaveletMatrix} */
+ var this$0;
+ this$0 = this._sv;
+ this$0._bv.length = 0;
+ this$0._seps.length = 0;
+ this$0._size = 0;
+ this._posdic.length = 0;
+ this._idic.length = 0;
+ this._ddic = 0;
+ this._head = 0;
+ this._substr = "";
+};
+
+/**
+ * @return {!number}
+ */
+FMIndex.prototype.size$ = function () {
+ /** @type {WaveletMatrix} */
+ var this$0;
+ this$0 = this._sv;
+ return this$0._size;
+};
+
+/**
+ * @return {!number}
+ */
+FMIndex.prototype.contentSize$ = function () {
+ return this._substr.length;
+};
+
+/**
+ * @param {!string} key
+ * @return {!number}
+ */
+FMIndex.prototype.getRows$S = function (key) {
+ /** @type {Array.<undefined|!number>} */
+ var pos;
+ pos = [ ];
+ return this.getRows$SAI(key, pos);
+};
+
+/**
+ * @param {!string} key
+ * @param {Array.<undefined|!number>} pos
+ * @return {!number}
+ */
+FMIndex.prototype.getRows$SAI = function (key, pos) {
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var code;
+ /** @type {!number} */
+ var first;
+ /** @type {undefined|!number} */
+ var last;
+ /** @type {!number} */
+ var c;
+ /** @type {Array.<undefined|!number>} */
+ var _rlt$0;
+ i = key.length - 1;
+ code = key.charCodeAt(i);
+ first = (_rlt$0 = this._rlt)[code] + 1;
+ last = _rlt$0[code + 1];
+ while (first <= last) {
+ if (i === 0) {
+ pos[0] = (-- first | 0);
+ pos[1] = -- last;
+ return (last - first + 1 | 0);
+ }
+ i--;
+ c = key.charCodeAt(i);
+ first = this._rlt[c] + this._sv.rank$II(first - 1, c) + 1;
+ last = this._rlt[c] + this._sv.rank$II(last, c);
+ }
+ return 0;
+};
+
+/**
+ * @param {!number} i
+ * @return {!number}
+ */
+FMIndex.prototype.getPosition$I = function (i) {
+ /** @type {!number} */
+ var pos;
+ /** @type {!number} */
+ var c;
+ if (i >= this.size$()) {
+ throw new Error("FMIndex.getPosition() : range error");
+ }
+ pos = 0;
+ while (i !== this._head) {
+ if (i % this._ddic === 0) {
+ pos += this._posdic[i / this._ddic] + 1;
+ break;
+ }
+ c = this._sv.get$I(i);
+ i = this._rlt[c] + this._sv.rank$II(i, c);
+ pos++;
+ }
+ return (pos % this.size$() | 0);
+};
+
+/**
+ * @param {!number} pos
+ * @param {!number} len
+ * @return {!string}
+ */
+FMIndex.prototype.getSubstring$II = function (pos, len) {
+ /** @type {!number} */
+ var pos_end;
+ /** @type {!number} */
+ var pos_tmp;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var pos_idic;
+ /** @type {!string} */
+ var substr;
+ /** @type {!number} */
+ var c;
+ /** @type {!number} */
+ var _ddic$0;
+ if (pos >= this.size$()) {
+ throw new Error("FMIndex.getSubstring() : range error");
+ }
+ pos_end = Math.min(pos + len, this.size$());
+ pos_tmp = this.size$() - 1;
+ i = this._head;
+ pos_idic = Math.floor((pos_end + (_ddic$0 = this._ddic) - 2) / _ddic$0);
+ if (pos_idic < this._idic.length) {
+ pos_tmp = pos_idic * this._ddic;
+ i = this._idic[pos_idic];
+ }
+ substr = "";
+ while (pos_tmp >= pos) {
+ c = this._sv.get$I(i);
+ i = this._rlt[c] + this._sv.rank$II(i, c);
+ if (pos_tmp < pos_end) {
+ substr = String.fromCharCode(c) + substr;
+ }
+ if (pos_tmp === 0) {
+ break;
+ }
+ pos_tmp--;
+ }
+ return substr;
+};
+
+/**
+ */
+FMIndex.prototype.build$ = function () {
+ this.build$SIIB(String.fromCharCode(0), 65535, 20, false);
+};
+
+/**
+ * @param {!string} end_marker
+ * @param {!number} ddic
+ * @param {!boolean} verbose
+ */
+FMIndex.prototype.build$SIB = function (end_marker, ddic, verbose) {
+ this.build$SIIB(end_marker, 65535, ddic, verbose);
+};
+
+/**
+ * @param {!string} end_marker
+ * @param {!number} maxChar
+ * @param {!number} ddic
+ * @param {!boolean} verbose
+ */
+FMIndex.prototype.build$SIIB = function (end_marker, maxChar, ddic, verbose) {
+ /** @type {BurrowsWheelerTransform} */
+ var b;
+ /** @type {!string} */
+ var s;
+ /** @type {!number} */
+ var c;
+ /** @type {!string} */
+ var str$0;
+ /** @type {WaveletMatrix} */
+ var this$0;
+ /** @type {!string} */
+ var _str$0;
+ /** @type {Array.<undefined|!number>} */
+ var _suffixarray$0;
+ if (verbose) {
+ console.time("building burrows-wheeler transform");
+ }
+ this._substr += end_marker;
+ b = ({_str: "", _size: 0, _head: 0, _suffixarray: [ ]});
+ str$0 = this._substr;
+ _str$0 = b._str = str$0;
+ b._size = _str$0.length;
+ _suffixarray$0 = b._suffixarray = SAIS$make$S(str$0);
+ b._head = (_suffixarray$0.indexOf(0) | 0);
+ s = BurrowsWheelerTransform$get$LBurrowsWheelerTransform$(b);
+ this._ssize = s.length;
+ this._head = b._head;
+ b._str = "";
+ b._size = 0;
+ b._head = 0;
+ b._suffixarray.length = 0;
+ this._substr = "";
+ if (verbose) {
+ console.timeEnd("building burrows-wheeler transform");
+ }
+ if (verbose) {
+ console.time("building wavelet matrix");
+ }
+ this$0 = this._sv;
+ this$0._bitsize = (Math.ceil(Math.log(maxChar) / 0.6931471805599453) | 0);
+ if (verbose) {
+ console.log(" maxCharCode: ", maxChar);
+ console.log(" bitSize: ", this._sv.bitsize$());
+ }
+ this._sv.build$S(s);
+ if (verbose) {
+ console.timeEnd("building wavelet matrix");
+ }
+ if (verbose) {
+ console.time("caching rank less than");
+ }
+ for (c = 0; c < maxChar; c++) {
+ this._rlt[c] = this._sv.rank_less_than$II(this._sv.size$(), c);
+ }
+ if (verbose) {
+ console.timeEnd("caching rank less than");
+ }
+ this._ddic = ddic;
+ if (verbose) {
+ console.time("building dictionaries");
+ }
+ this._buildDictionaries$();
+ if (verbose) {
+ console.timeEnd("building dictionaries");
+ console.log('');
+ }
+};
+
+/**
+ */
+FMIndex.prototype._buildDictionaries$ = function () {
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var pos;
+ /** @type {!number} */
+ var c;
+ for (i = 0; i < this._ssize / this._ddic + 1; i++) {
+ this._posdic.push(0);
+ this._idic.push(0);
+ }
+ i = this._head;
+ pos = this.size$() - 1;
+ do {
+ if (i % this._ddic === 0) {
+ this._posdic[Math.floor(i / this._ddic)] = (pos | 0);
+ }
+ if (pos % this._ddic === 0) {
+ this._idic[Math.floor(pos / this._ddic)] = (i | 0);
+ }
+ c = this._sv.get$I(i);
+ i = this._rlt[c] + this._sv.rank$II(i, c);
+ pos--;
+ } while (i !== this._head);
+};
+
+/**
+ * @param {!string} doc
+ */
+FMIndex.prototype.push$S = function (doc) {
+ if (doc.length <= 0) {
+ throw new Error("FMIndex::push(): empty string");
+ }
+ this._substr += doc;
+};
+
+/**
+ * @param {!string} keyword
+ * @return {Array.<undefined|!number>}
+ */
+FMIndex.prototype.search$S = function (keyword) {
+ /** @type {Array.<undefined|!number>} */
+ var result;
+ /** @type {Array.<undefined|!number>} */
+ var position;
+ /** @type {!number} */
+ var rows;
+ /** @type {undefined|!number} */
+ var first;
+ /** @type {undefined|!number} */
+ var last;
+ /** @type {undefined|!number} */
+ var i;
+ result = [ ];
+ position = [ ];
+ rows = this.getRows$SAI(keyword, position);
+ if (rows > 0) {
+ first = position[0];
+ last = position[1];
+ for (i = first; i <= last; i++) {
+ result.push(this.getPosition$I(i));
+ }
+ }
+ return result;
+};
+
+/**
+ * @return {!string}
+ */
+FMIndex.prototype.dump$ = function () {
+ return this.dump$B(false);
+};
+
+/**
+ * @param {!boolean} verbose
+ * @return {!string}
+ */
+FMIndex.prototype.dump$B = function (verbose) {
+ /** @type {Array.<undefined|!string>} */
+ var contents;
+ /** @type {CompressionReport} */
+ var report;
+ /** @type {!number} */
+ var i;
+ contents = [ ];
+ report = ({source: 0, result: 0});
+ contents.push(Binary$dump32bitNumber$N(this._ddic));
+ contents.push(Binary$dump32bitNumber$N(this._ssize));
+ contents.push(Binary$dump32bitNumber$N(this._head));
+ CompressionReport$add$LCompressionReport$II(report, 6, 6);
+ contents.push(this._sv.dump$LCompressionReport$(report));
+ if (verbose) {
+ console.log("Serializing FM-index");
+ console.log(' Wavelet Matrix: ' + (contents[3].length * 2 + "") + ' bytes (' + (Math.round(report.result * 100.0 / report.source) + "") + '%)');
+ }
+ contents.push(Binary$dump32bitNumber$N(this._posdic.length));
+ for (i in this._posdic) {
+ contents.push(Binary$dump32bitNumber$N(this._posdic[i]));
+ }
+ for (i in this._idic) {
+ contents.push(Binary$dump32bitNumber$N(this._idic[i]));
+ }
+ if (verbose) {
+ console.log(' Dictionary Cache: ' + (this._idic.length * 16 + "") + ' bytes');
+ }
+ return contents.join("");
+};
+
+/**
+ * @param {!string} data
+ * @return {!number}
+ */
+FMIndex.prototype.load$S = function (data) {
+ return this.load$SI(data, 0);
+};
+
+/**
+ * @param {!string} data
+ * @param {!number} offset
+ * @return {!number}
+ */
+FMIndex.prototype.load$SI = function (data, offset) {
+ /** @type {!number} */
+ var maxChar;
+ /** @type {!number} */
+ var c;
+ /** @type {!number} */
+ var size;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var result$0;
+ /** @type {!number} */
+ var result$1;
+ result$0 = data.charCodeAt(offset) * 65536 + data.charCodeAt(offset + 1);
+ this._ddic = (result$0 | 0);
+ this._ssize = (Binary$load32bitNumber$SI(data, offset + 2) | 0);
+ this._head = (Binary$load32bitNumber$SI(data, offset + 4) | 0);
+ offset = this._sv.load$SI(data, offset + 6);
+ maxChar = Math.pow(2, this._sv.bitsize$());
+ for (c = 0; c < maxChar; c++) {
+ this._rlt[c] = this._sv.rank_less_than$II(this._sv.size$(), c);
+ }
+ result$1 = data.charCodeAt(offset) * 65536 + data.charCodeAt(offset + 1);
+ size = result$1;
+ offset += 2;
+ for (i = 0; i < size; (i++, offset += 2)) {
+ this._posdic.push(Binary$load32bitNumber$SI(data, offset));
+ }
+ for (i = 0; i < size; (i++, offset += 2)) {
+ this._idic.push(Binary$load32bitNumber$SI(data, offset));
+ }
+ return offset;
+};
+
+/**
+ * class Tag extends Object
+ * @constructor
+ */
+function Tag() {
+}
+
+/**
+ * @constructor
+ * @param {!string} name
+ */
+function Tag$S(name) {
+ this.name = name;
+ this.attributes = ({ });
+ this.isSelfClosing = false;
+};
+
+Tag$S.prototype = new Tag;
+
+/**
+ * class _Common extends Object
+ * @constructor
+ */
+function _Common() {
+}
+
+/**
+ * @constructor
+ */
+function _Common$() {
+};
+
+_Common$.prototype = new _Common;
+
+/**
+ * class _State extends Object
+ * @constructor
+ */
+function _State() {
+}
+
+/**
+ * @constructor
+ */
+function _State$() {
+};
+
+_State$.prototype = new _State;
+
+/**
+ * class SAXHandler extends Object
+ * @constructor
+ */
+function SAXHandler() {
+}
+
+/**
+ * @constructor
+ */
+function SAXHandler$() {
+ this.position = 0;
+ this.column = 0;
+ this.line = 0;
+};
+
+SAXHandler$.prototype = new SAXHandler;
+
+/**
+ * @param {Error} error
+ */
+SAXHandler.prototype.onerror$LError$ = function (error) {
+};
+
+/**
+ * @param {!string} text
+ */
+SAXHandler.prototype.ontext$S = function (text) {
+};
+
+/**
+ * @param {!string} doctype
+ */
+SAXHandler.prototype.ondoctype$S = function (doctype) {
+};
+
+/**
+ * @param {!string} name
+ * @param {!string} body
+ */
+SAXHandler.prototype.onprocessinginstruction$SS = function (name, body) {
+};
+
+/**
+ * @param {!string} sgmlDecl
+ */
+SAXHandler.prototype.onsgmldeclaration$S = function (sgmlDecl) {
+};
+
+/**
+ * @param {!string} tagname
+ * @param {Object.<string, undefined|!string>} attributes
+ */
+SAXHandler.prototype.onopentag$SHS = function (tagname, attributes) {
+};
+
+/**
+ * @param {!string} tagname
+ */
+SAXHandler.prototype.onclosetag$S = function (tagname) {
+};
+
+/**
+ * @param {!string} name
+ * @param {!string} value
+ */
+SAXHandler.prototype.onattribute$SS = function (name, value) {
+};
+
+/**
+ * @param {!string} comment
+ */
+SAXHandler.prototype.oncomment$S = function (comment) {
+};
+
+/**
+ */
+SAXHandler.prototype.onopencdata$ = function () {
+};
+
+/**
+ * @param {!string} cdata
+ */
+SAXHandler.prototype.oncdata$S = function (cdata) {
+};
+
+/**
+ */
+SAXHandler.prototype.onclosecdata$ = function () {
+};
+
+/**
+ */
+SAXHandler.prototype.onend$ = function () {
+};
+
+/**
+ */
+SAXHandler.prototype.onready$ = function () {
+};
+
+/**
+ * @param {!string} script
+ */
+SAXHandler.prototype.onscript$S = function (script) {
+};
+
+/**
+ * class _HTMLHandler extends SAXHandler
+ * @constructor
+ */
+function _HTMLHandler() {
+}
+
+_HTMLHandler.prototype = new SAXHandler;
+/**
+ * @constructor
+ * @param {Object.<string, undefined|Array.<undefined|!string>>} styles
+ * @param {!boolean} escape
+ */
+function _HTMLHandler$HASB(styles, escape) {
+ this.position = 0;
+ this.column = 0;
+ this.line = 0;
+ this.text = [ ];
+ this.escape = escape;
+ this.styles = styles;
+};
+
+_HTMLHandler$HASB.prototype = new _HTMLHandler;
+
+/**
+ * @param {!string} str
+ * @return {!string}
+ */
+_HTMLHandler.escapeHTML$S = function (str) {
+ return str.replace(/\n/g, "<br/>").replace(/&/g, "&amp;").replace(/"/g, "&quot;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
+};
+
+var _HTMLHandler$escapeHTML$S = _HTMLHandler.escapeHTML$S;
+
+/**
+ * @param {!string} tagname
+ * @param {Object.<string, undefined|!string>} attributes
+ */
+_HTMLHandler.prototype.onopentag$SHS = function (tagname, attributes) {
+ this.text.push(this.styles[tagname][0]);
+};
+
+/**
+ * @param {!string} tagname
+ */
+_HTMLHandler.prototype.onclosetag$S = function (tagname) {
+ this.text.push(this.styles[tagname][1]);
+};
+
+/**
+ * @param {!string} text
+ */
+_HTMLHandler.prototype.ontext$S = function (text) {
+ if (this.escape) {
+ this.text.push(text.replace(/\n/g, "<br/>").replace(/&/g, "&amp;").replace(/"/g, "&quot;").replace(/</g, "&lt;").replace(/>/g, "&gt;"));
+ } else {
+ this.text.push(text);
+ }
+};
+
+/**
+ * @return {!string}
+ */
+_HTMLHandler.prototype.result$ = function () {
+ return this.text.join('');
+};
+
+/**
+ * class SAXParser extends Object
+ * @constructor
+ */
+function SAXParser() {
+}
+
+/**
+ * @constructor
+ * @param {SAXHandler} handler
+ */
+function SAXParser$LSAXHandler$(handler) {
+ this.q = "";
+ this.c = "";
+ this.bufferCheckPosition = 0;
+ this.looseCase = "";
+ this.tags = [ ];
+ this.closed = false;
+ this.closedRoot = false;
+ this.sawRoot = false;
+ this.tag = null;
+ this.error = null;
+ this.handler = null;
+ this.ENTITIES = null;
+ this.strict = false;
+ this.tagName = "";
+ this.state = 0;
+ this.line = 0;
+ this.column = 0;
+ this.position = 0;
+ this.startTagPosition = 0;
+ this.attribName = "";
+ this.attribValue = "";
+ this.script = "";
+ this.textNode = "";
+ this.attribList = null;
+ this.noscript = false;
+ this.cdata = "";
+ this.procInstBody = "";
+ this.procInstName = "";
+ this.doctype = "";
+ this.entity = "";
+ this.sgmlDecl = "";
+ this.comment = "";
+ this.preTags = 0;
+ this._init$LSAXHandler$B(handler, false);
+};
+
+SAXParser$LSAXHandler$.prototype = new SAXParser;
+
+/**
+ * @constructor
+ * @param {SAXHandler} handler
+ * @param {!boolean} strict
+ */
+function SAXParser$LSAXHandler$B(handler, strict) {
+ this.q = "";
+ this.c = "";
+ this.bufferCheckPosition = 0;
+ this.looseCase = "";
+ this.tags = [ ];
+ this.closed = false;
+ this.closedRoot = false;
+ this.sawRoot = false;
+ this.tag = null;
+ this.error = null;
+ this.handler = null;
+ this.ENTITIES = null;
+ this.strict = false;
+ this.tagName = "";
+ this.state = 0;
+ this.line = 0;
+ this.column = 0;
+ this.position = 0;
+ this.startTagPosition = 0;
+ this.attribName = "";
+ this.attribValue = "";
+ this.script = "";
+ this.textNode = "";
+ this.attribList = null;
+ this.noscript = false;
+ this.cdata = "";
+ this.procInstBody = "";
+ this.procInstName = "";
+ this.doctype = "";
+ this.entity = "";
+ this.sgmlDecl = "";
+ this.comment = "";
+ this.preTags = 0;
+ this._init$LSAXHandler$B(handler, strict);
+};
+
+SAXParser$LSAXHandler$B.prototype = new SAXParser;
+
+/**
+ * @param {SAXHandler} handler
+ * @param {!boolean} strict
+ */
+SAXParser.prototype._init$LSAXHandler$B = function (handler, strict) {
+ this.handler = handler;
+ this.clearBuffers$();
+ this.q = "";
+ this.bufferCheckPosition = 65536;
+ this.looseCase = 'toLowerCase';
+ this.tags = [ ];
+ this.closed = this.closedRoot = this.sawRoot = false;
+ this.tag = null;
+ this.error = null;
+ this.strict = strict;
+ this.noscript = strict;
+ this.state = 1;
+ this.ENTITIES = _Entities$entity_list$();
+ this.attribList = [ ];
+ this.noscript = false;
+ this.preTags = 0;
+};
+
+/**
+ * @param {!boolean} flag
+ */
+SAXParser.prototype.set_noscript$B = function (flag) {
+ this.noscript = flag;
+};
+
+/**
+ * @return {SAXParser}
+ */
+SAXParser.prototype.resume$ = function () {
+ this.error = null;
+ return this;
+};
+
+/**
+ * @return {SAXParser}
+ */
+SAXParser.prototype.close$ = function () {
+ return this.parse$S('');
+};
+
+/**
+ * @param {!string} chunk
+ * @return {SAXParser}
+ */
+SAXParser.prototype.parse$S = function (chunk) {
+ /** @type {Char} */
+ var _;
+ /** @type {!number} */
+ var i;
+ /** @type {!string} */
+ var c;
+ /** @type {!number} */
+ var starti;
+ /** @type {!number} */
+ var pad;
+ /** @type {!number} */
+ var returnState;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$0;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$1;
+ /** @type {RegExp} */
+ var charclass$2;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$3;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$4;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$5;
+ /** @type {!string} */
+ var text$0;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$6;
+ /** @type {RegExp} */
+ var charclass$7;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$8;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$9;
+ /** @type {RegExp} */
+ var charclass$10;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$11;
+ /** @type {RegExp} */
+ var charclass$12;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$13;
+ /** @type {RegExp} */
+ var charclass$14;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$15;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$16;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$17;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$18;
+ /** @type {RegExp} */
+ var charclass$19;
+ /** @type {RegExp} */
+ var charclass$20;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$21;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$22;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$23;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$24;
+ /** @type {!string} */
+ var comment$0;
+ _ = new Char$();
+ if (this.error) {
+ throw this.error;
+ }
+ if (this.closed) {
+ return this.emiterror$S("Cannot write after close. Assign an onready handler.");
+ }
+ (i = 0, c = "");
+ while (this.c = c = chunk.charAt(i++)) {
+ this.position++;
+ if (c === "\n") {
+ this.handler.line++;
+ this.handler.column = 0;
+ } else {
+ this.handler.column++;
+ }
+ switch (this.state) {
+ case 1:
+ if (c === "<") {
+ this.state = 4;
+ this.startTagPosition = this.position;
+ } else {
+ charclass$0 = _.whitespace;
+ if (! $__jsx_ObjectHasOwnProperty.call(charclass$0, c)) {
+ this.strictFail$S("Non-whitespace before first tag.");
+ this.textNode = c;
+ this.state = 2;
+ }
+ }
+ continue;
+ case 2:
+ if (this.sawRoot && ! this.closedRoot) {
+ starti = i - 1;
+ while (c && c !== "<" && c !== "&") {
+ c = chunk.charAt(i++);
+ if (c) {
+ this.position++;
+ if (c === "\n") {
+ this.handler.line++;
+ this.handler.column = 0;
+ } else {
+ this.handler.column++;
+ }
+ }
+ }
+ this.textNode += chunk.substring(starti, i - 1);
+ }
+ if (c === "<") {
+ this.state = 4;
+ this.startTagPosition = this.position;
+ } else {
+ if (_.not$HBS(_.whitespace, c) && (! this.sawRoot || this.closedRoot)) {
+ this.strictFail$S("Text data outside of root node.");
+ }
+ if (c === "&") {
+ this.state = 3;
+ } else {
+ this.textNode += c;
+ }
+ }
+ continue;
+ case 33:
+ if (c === "<") {
+ this.state = 34;
+ } else {
+ this.script += c;
+ }
+ continue;
+ case 34:
+ if (c === "/") {
+ this.state = 31;
+ } else {
+ this.script += "<" + c;
+ this.state = 33;
+ }
+ continue;
+ case 4:
+ if (c === "!") {
+ this.state = 5;
+ this.sgmlDecl = "";
+ } else {
+ charclass$1 = _.whitespace;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$1, c)) {
+ } else {
+ charclass$2 = _.nameStart;
+ if (charclass$2.test(c)) {
+ this.state = 21;
+ this.tagName = c;
+ } else {
+ if (c === "/") {
+ this.state = 31;
+ this.tagName = "";
+ } else {
+ if (c === "?") {
+ this.state = 18;
+ this.procInstName = this.procInstBody = "";
+ } else {
+ this.strictFail$S("Unencoded <");
+ if (this.startTagPosition + 1 < this.position) {
+ pad = this.position - this.startTagPosition;
+ for (i = 0; i < pad; i++) {
+ c = " " + c;
+ }
+ }
+ this.textNode += "<" + c;
+ this.state = 2;
+ }
+ }
+ }
+ }
+ }
+ continue;
+ case 5:
+ if ((this.sgmlDecl + c).toUpperCase() === _.CDATA) {
+ this.closetext_if_exist$();
+ this.state = 15;
+ this.sgmlDecl = "";
+ this.cdata = "";
+ } else {
+ if (this.sgmlDecl + c === "--") {
+ this.state = 12;
+ this.comment = "";
+ this.sgmlDecl = "";
+ } else {
+ if ((this.sgmlDecl + c).toUpperCase() === _.DOCTYPE) {
+ this.state = 7;
+ if (this.doctype || this.sawRoot) {
+ this.strictFail$S("Inappropriately located doctype declaration");
+ }
+ this.doctype = "";
+ this.sgmlDecl = "";
+ } else {
+ if (c === ">") {
+ this.closetext_if_exist$();
+ this.sgmlDecl = "";
+ this.state = 2;
+ } else {
+ charclass$3 = _.quote;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$3, c)) {
+ this.state = 6;
+ this.sgmlDecl += c;
+ } else {
+ this.sgmlDecl += c;
+ }
+ }
+ }
+ }
+ }
+ continue;
+ case 6:
+ if (c === this.q) {
+ this.state = 5;
+ this.q = "";
+ }
+ this.sgmlDecl += c;
+ continue;
+ case 7:
+ if (c === ">") {
+ this.state = 2;
+ this.closetext_if_exist$();
+ this.doctype.trim();
+ } else {
+ this.doctype += c;
+ if (c === "[") {
+ this.state = 9;
+ } else {
+ charclass$4 = _.quote;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$4, c)) {
+ this.state = 8;
+ this.q = c;
+ }
+ }
+ }
+ continue;
+ case 8:
+ this.doctype += c;
+ if (c === this.q) {
+ this.q = "";
+ this.state = 7;
+ }
+ continue;
+ case 9:
+ this.doctype += c;
+ if (c === "]") {
+ this.state = 7;
+ } else {
+ charclass$5 = _.quote;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$5, c)) {
+ this.state = 10;
+ this.q = c;
+ }
+ }
+ continue;
+ case 10:
+ this.doctype += c;
+ if (c === this.q) {
+ this.state = 9;
+ this.q = "";
+ }
+ continue;
+ case 12:
+ if (c === "-") {
+ this.state = 13;
+ } else {
+ this.comment += c;
+ }
+ continue;
+ case 13:
+ if (c === "-") {
+ this.state = 14;
+ text$0 = this.comment;
+ text$0 = text$0.replace(/[\n\t]/g, ' ');
+ text$0 = text$0.replace(/\s\s+/g, " ");
+ comment$0 = this.comment = text$0;
+ if (comment$0) {
+ this.closetext_if_exist$();
+ this.comment.trim();
+ }
+ this.comment = "";
+ } else {
+ this.comment += "-" + c;
+ this.state = 12;
+ }
+ continue;
+ case 14:
+ if (c !== ">") {
+ this.strictFail$S("Malformed comment");
+ this.comment += "--" + c;
+ this.state = 12;
+ } else {
+ this.state = 2;
+ }
+ continue;
+ case 15:
+ if (c === "]") {
+ this.state = 16;
+ } else {
+ this.cdata += c;
+ }
+ continue;
+ case 16:
+ if (c === "]") {
+ this.state = 17;
+ } else {
+ this.cdata += "]" + c;
+ this.state = 15;
+ }
+ continue;
+ case 17:
+ if (c === ">") {
+ if (this.cdata) {
+ this.closetext_if_exist$();
+ }
+ this.cdata = "";
+ this.state = 2;
+ } else {
+ if (c === "]") {
+ this.cdata += "]";
+ } else {
+ this.cdata += "]]" + c;
+ this.state = 15;
+ }
+ }
+ continue;
+ case 18:
+ if (c === "?") {
+ this.state = 20;
+ } else {
+ charclass$6 = _.whitespace;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$6, c)) {
+ this.state = 19;
+ } else {
+ this.procInstName += c;
+ }
+ }
+ continue;
+ case 19:
+ if (! this.procInstBody && _.is$HBS(_.whitespace, c)) {
+ continue;
+ } else {
+ if (c === "?") {
+ this.state = 20;
+ } else {
+ this.procInstBody += c;
+ }
+ }
+ continue;
+ case 20:
+ if (c === ">") {
+ this.closetext_if_exist$();
+ this.procInstName = this.procInstBody = "";
+ this.state = 2;
+ } else {
+ this.procInstBody += "?" + c;
+ this.state = 19;
+ }
+ continue;
+ case 21:
+ charclass$7 = _.nameBody;
+ if (charclass$7.test(c)) {
+ this.tagName += c;
+ } else {
+ this.newTag$();
+ if (c === ">") {
+ this.openTag$B(false);
+ } else {
+ if (c === "/") {
+ this.state = 22;
+ } else {
+ charclass$8 = _.whitespace;
+ if (! $__jsx_ObjectHasOwnProperty.call(charclass$8, c)) {
+ this.strictFail$S("Invalid character in tag name");
+ }
+ this.state = 23;
+ }
+ }
+ }
+ continue;
+ case 22:
+ if (c === ">") {
+ this.openTag$B(true);
+ this.closeTag$();
+ } else {
+ this.strictFail$S("Forward-slash in opening tag not followed by >");
+ this.state = 23;
+ }
+ continue;
+ case 23:
+ charclass$9 = _.whitespace;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$9, c)) {
+ continue;
+ } else {
+ if (c === ">") {
+ this.openTag$B(false);
+ } else {
+ if (c === "/") {
+ this.state = 22;
+ } else {
+ charclass$10 = _.nameStart;
+ if (charclass$10.test(c)) {
+ this.attribName = c;
+ this.attribValue = "";
+ this.state = 24;
+ } else {
+ this.strictFail$S("Invalid attribute name");
+ }
+ }
+ }
+ }
+ continue;
+ case 24:
+ if (c === "=") {
+ this.state = 26;
+ } else {
+ if (c === ">") {
+ this.strictFail$S("Attribute without value");
+ this.attribValue = this.attribName;
+ this.attrib$();
+ this.openTag$B(false);
+ } else {
+ charclass$11 = _.whitespace;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$11, c)) {
+ this.state = 25;
+ } else {
+ charclass$12 = _.nameBody;
+ if (charclass$12.test(c)) {
+ this.attribName += c;
+ } else {
+ this.strictFail$S("Invalid attribute name");
+ }
+ }
+ }
+ }
+ continue;
+ case 25:
+ if (c === "=") {
+ this.state = 26;
+ } else {
+ charclass$13 = _.whitespace;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$13, c)) {
+ continue;
+ } else {
+ this.strictFail$S("Attribute without value");
+ this.tag.attributes[this.attribName] = "";
+ this.attribValue = "";
+ this.closetext_if_exist$();
+ this.attribName = "";
+ if (c === ">") {
+ this.openTag$B(false);
+ } else {
+ charclass$14 = _.nameStart;
+ if (charclass$14.test(c)) {
+ this.attribName = c;
+ this.state = 24;
+ } else {
+ this.strictFail$S("Invalid attribute name");
+ this.state = 23;
+ }
+ }
+ }
+ }
+ continue;
+ case 26:
+ charclass$15 = _.whitespace;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$15, c)) {
+ continue;
+ } else {
+ charclass$16 = _.quote;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$16, c)) {
+ this.q = c;
+ this.state = 27;
+ } else {
+ this.strictFail$S("Unquoted attribute value");
+ this.state = 28;
+ this.attribValue = c;
+ }
+ }
+ continue;
+ case 27:
+ if (c !== this.q) {
+ if (c === "&") {
+ this.state = 29;
+ } else {
+ this.attribValue += c;
+ }
+ continue;
+ }
+ this.attrib$();
+ this.q = "";
+ this.state = 23;
+ continue;
+ case 28:
+ charclass$17 = _.attribEnd;
+ if (! $__jsx_ObjectHasOwnProperty.call(charclass$17, c)) {
+ if (c === "&") {
+ this.state = 30;
+ } else {
+ this.attribValue += c;
+ }
+ continue;
+ }
+ this.attrib$();
+ if (c === ">") {
+ this.openTag$B(false);
+ } else {
+ this.state = 23;
+ }
+ continue;
+ case 31:
+ if (! this.tagName) {
+ charclass$18 = _.whitespace;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$18, c)) {
+ continue;
+ } else {
+ charclass$19 = _.nameStart;
+ if (! charclass$19.test(c)) {
+ if (this.script) {
+ this.script += "</" + c;
+ this.state = 33;
+ } else {
+ this.strictFail$S("Invalid tagname in closing tag.");
+ }
+ } else {
+ this.tagName = c;
+ }
+ }
+ } else {
+ if (c === ">") {
+ this.closeTag$();
+ } else {
+ charclass$20 = _.nameBody;
+ if (charclass$20.test(c)) {
+ this.tagName += c;
+ } else {
+ if (this.script) {
+ this.script += "</" + this.tagName;
+ this.tagName = "";
+ this.state = 33;
+ } else {
+ charclass$21 = _.whitespace;
+ if (! $__jsx_ObjectHasOwnProperty.call(charclass$21, c)) {
+ this.strictFail$S("Invalid tagname in closing tag");
+ }
+ this.state = 32;
+ }
+ }
+ }
+ }
+ continue;
+ case 32:
+ charclass$22 = _.whitespace;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$22, c)) {
+ continue;
+ }
+ if (c === ">") {
+ this.closeTag$();
+ } else {
+ this.strictFail$S("Invalid characters in closing tag");
+ }
+ continue;
+ case 3:
+ if (c === ";") {
+ this.textNode += this.parseEntity$();
+ this.entity = "";
+ this.state = 2;
+ } else {
+ charclass$23 = _.entity;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$23, c)) {
+ this.entity += c;
+ } else {
+ this.strictFail$S("Invalid character entity");
+ this.textNode += "&" + this.entity + c;
+ this.entity = "";
+ this.state = 2;
+ }
+ }
+ continue;
+ case 29:
+ case 30:
+ if (this.state === 29) {
+ returnState = 27;
+ } else {
+ returnState = 28;
+ }
+ if (c === ";") {
+ this.attribValue += this.parseEntity$();
+ this.entity = "";
+ this.state = (returnState | 0);
+ } else {
+ charclass$24 = _.entity;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$24, c)) {
+ this.entity += c;
+ } else {
+ this.strictFail$S("Invalid character entity");
+ this.attribValue += "&" + this.entity + c;
+ this.entity = "";
+ this.state = (returnState | 0);
+ }
+ }
+ continue;
+ default:
+ throw new Error("Unknown state: " + (this.state + ""));
+ }
+ }
+ this.end$();
+ return this;
+};
+
+/**
+ */
+SAXParser.prototype.clearBuffers$ = function () {
+ this.comment = '';
+ this.sgmlDecl = '';
+ this.textNode = '';
+ this.tagName = '';
+ this.doctype = '';
+ this.procInstName = '';
+ this.procInstBody = '';
+ this.entity = '';
+ this.attribName = '';
+ this.attribValue = '';
+ this.cdata = '';
+ this.script = '';
+};
+
+/**
+ */
+SAXParser.prototype.closetext_if_exist$ = function () {
+ if (this.textNode !== '') {
+ this.closetext$();
+ }
+};
+
+/**
+ */
+SAXParser.prototype.closetext$ = function () {
+ /** @type {!string} */
+ var text;
+ /** @type {!string} */
+ var text$0;
+ if (this.preTags === 0) {
+ text$0 = this.textNode;
+ text$0 = text$0.replace(/[\n\t]/g, ' ');
+ text$0 = text$0.replace(/\s\s+/g, " ");
+ text = text$0;
+ if (text$0) {
+ this.handler.ontext$S(text);
+ }
+ } else {
+ if (this.textNode) {
+ this.handler.ontext$S(this.textNode);
+ }
+ }
+ this.textNode = "";
+};
+
+/**
+ * @param {!string} text
+ * @return {!string}
+ */
+SAXParser.prototype.textopts$S = function (text) {
+ text = text.replace(/[\n\t]/g, ' ');
+ text = text.replace(/\s\s+/g, " ");
+ return text;
+};
+
+/**
+ * @param {!string} er
+ * @return {SAXParser}
+ */
+SAXParser.prototype.emiterror$S = function (er) {
+ /** @type {Error} */
+ var error;
+ this.closetext$();
+ er += "\nLine: " + (this.line + "") + "\nColumn: " + (this.column + "") + "\nChar: " + this.c;
+ error = new Error(er);
+ this.error = error;
+ return this;
+};
+
+/**
+ */
+SAXParser.prototype.end$ = function () {
+ if (! this.closedRoot) {
+ this.strictFail$S("Unclosed root tag");
+ }
+ if (this.state !== 2) {
+ this.emiterror$S("Unexpected end");
+ }
+ this.closetext$();
+ this.c = "";
+ this.closed = true;
+};
+
+/**
+ * @param {!string} message
+ */
+SAXParser.prototype.strictFail$S = function (message) {
+ if (this.strict) {
+ this.emiterror$S(message);
+ }
+};
+
+/**
+ */
+SAXParser.prototype.newTag$ = function () {
+ if (! this.strict) {
+ this.tagName = this.tagName.toLowerCase();
+ }
+ this.tag = ({name: this.tagName, attributes: ({ }), isSelfClosing: false});
+ this.attribList.length = 0;
+};
+
+/**
+ */
+SAXParser.prototype.attrib$ = function () {
+ if (! this.strict) {
+ this.attribName = this.attribName.toLowerCase();
+ }
+ if ($__jsx_ObjectHasOwnProperty.call(this.tag.attributes, this.attribName)) {
+ this.attribName = this.attribValue = "";
+ return;
+ }
+ this.tag.attributes[this.attribName] = this.attribValue;
+ this.closetext_if_exist$();
+ this.attribName = this.attribValue = "";
+};
+
+/**
+ */
+SAXParser.prototype.openTag$ = function () {
+ this.openTag$B(false);
+};
+
+/**
+ * @param {!boolean} selfClosing
+ */
+SAXParser.prototype.openTag$B = function (selfClosing) {
+ /** @type {Tag} */
+ var tag$0;
+ /** @type {Tag} */
+ var tag$1;
+ (tag$0 = this.tag).isSelfClosing = selfClosing;
+ this.sawRoot = true;
+ this.tags.push(tag$0);
+ this.closetext_if_exist$();
+ this.handler.onopentag$SHS((tag$1 = this.tag).name, tag$1.attributes);
+ if (this.tag.name === 'pre') {
+ this.preTags++;
+ }
+ if (! selfClosing) {
+ if (! this.noscript && this.tagName.toLowerCase() === "script") {
+ this.state = 33;
+ } else {
+ this.state = 2;
+ }
+ this.tag = null;
+ this.tagName = "";
+ }
+ this.attribName = this.attribValue = "";
+ this.attribList.length = 0;
+};
+
+/**
+ */
+SAXParser.prototype.closeTag$ = function () {
+ /** @type {!number} */
+ var t;
+ /** @type {!string} */
+ var tagName;
+ /** @type {!string} */
+ var closeTo;
+ /** @type {Tag} */
+ var close;
+ /** @type {!number} */
+ var s;
+ /** @type {Tag} */
+ var tag$0;
+ if (! this.tagName) {
+ this.strictFail$S("Weird empty close tag.");
+ this.textNode += "</>";
+ this.state = 2;
+ return;
+ }
+ if (this.script) {
+ if (this.tagName !== "script") {
+ this.script += "</" + this.tagName + ">";
+ this.tagName = "";
+ this.state = 33;
+ return;
+ }
+ this.closetext_if_exist$();
+ this.script = "";
+ }
+ t = this.tags.length;
+ tagName = this.tagName;
+ if (! this.strict) {
+ tagName = tagName.toLowerCase();
+ }
+ closeTo = tagName;
+ while (t--) {
+ close = this.tags[t];
+ if (close.name !== closeTo) {
+ this.strictFail$S("Unexpected close tag");
+ } else {
+ break;
+ }
+ }
+ if (t < 0) {
+ this.strictFail$S("Unmatched closing tag: " + this.tagName);
+ this.textNode += "</" + this.tagName + ">";
+ this.state = 2;
+ return;
+ }
+ this.tagName = tagName;
+ s = this.tags.length;
+ while (s-- > t) {
+ tag$0 = this.tag = this.tags.pop();
+ this.tagName = tag$0.name;
+ this.closetext_if_exist$();
+ this.handler.onclosetag$S(this.tagName);
+ if (this.tagName === 'pre') {
+ this.preTags--;
+ }
+ }
+ if (t === 0) {
+ this.closedRoot = true;
+ }
+ this.tagName = this.attribValue = this.attribName = "";
+ this.attribList.length = 0;
+ this.state = 2;
+};
+
+/**
+ * @return {!string}
+ */
+SAXParser.prototype.parseEntity$ = function () {
+ /** @type {!string} */
+ var entity;
+ /** @type {!string} */
+ var entityLC;
+ /** @type {!number} */
+ var num;
+ /** @type {!string} */
+ var numStr;
+ entity = this.entity;
+ entityLC = entity.toLowerCase();
+ num = 0;
+ numStr = "";
+ if (this.ENTITIES[entity]) {
+ return this.ENTITIES[entity];
+ }
+ if (this.ENTITIES[entityLC]) {
+ return this.ENTITIES[entityLC];
+ }
+ entity = entityLC;
+ if (entityLC.charAt(0) === "#") {
+ if (entity.charAt(1) === "x") {
+ entity = entity.slice(2);
+ num = $__jsx_parseInt(entity, 16);
+ numStr = num.toString(16);
+ } else {
+ entity = entity.slice(1);
+ num = $__jsx_parseInt(entity, 10);
+ numStr = num.toString(10);
+ }
+ }
+ entity = entity.replace(/^0+/, "");
+ if (numStr.toLowerCase() !== entity) {
+ this.strictFail$S("Invalid character entity");
+ return "&" + this.entity + ";";
+ }
+ return String.fromCharCode(num);
+};
+
+/**
+ * class Char extends Object
+ * @constructor
+ */
+function Char() {
+}
+
+/**
+ * @constructor
+ */
+function Char$() {
+ this.CDATA = "[CDATA[";
+ this.DOCTYPE = "DOCTYPE";
+ this.XML_NAMESPACE = "http://www.w3.org/XML/1998/namespace";
+ this.whitespace = this._charClass$S("\r\n\t ");
+ this.number = this._charClass$S("0124356789");
+ this.letter = this._charClass$S("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ");
+ this.quote = this._charClass$S("'\"");
+ this.entity = this._charClass$S("0124356789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ#");
+ this.attribEnd = this._charClass$S("\r\n\t >");
+ this.nameStart = /[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/;
+ this.nameBody = /[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040\.\d-]/;
+};
+
+Char$.prototype = new Char;
+
+/**
+ * @param {!string} str
+ * @return {Object.<string, undefined|!boolean>}
+ */
+Char.prototype._charClass$S = function (str) {
+ /** @type {Object.<string, undefined|!boolean>} */
+ var result;
+ /** @type {!number} */
+ var i;
+ result = ({ });
+ for (i = 0; i < str.length; i++) {
+ result[str.slice(i, i + 1)] = true;
+ }
+ return result;
+};
+
+/**
+ * @param {RegExp} charclass
+ * @param {!string} c
+ * @return {!boolean}
+ */
+Char.prototype.is$LRegExp$S = function (charclass, c) {
+ return charclass.test(c);
+};
+
+/**
+ * @param {Object.<string, undefined|!boolean>} charclass
+ * @param {!string} c
+ * @return {!boolean}
+ */
+Char.prototype.is$HBS = function (charclass, c) {
+ return $__jsx_ObjectHasOwnProperty.call(charclass, c);
+};
+
+/**
+ * @param {RegExp} charclass
+ * @param {!string} c
+ * @return {!boolean}
+ */
+Char.prototype.not$LRegExp$S = function (charclass, c) {
+ return ! charclass.test(c);
+};
+
+/**
+ * @param {Object.<string, undefined|!boolean>} charclass
+ * @param {!string} c
+ * @return {!boolean}
+ */
+Char.prototype.not$HBS = function (charclass, c) {
+ return ! $__jsx_ObjectHasOwnProperty.call(charclass, c);
+};
+
+/**
+ * class _Entities extends Object
+ * @constructor
+ */
+function _Entities() {
+}
+
+/**
+ * @constructor
+ */
+function _Entities$() {
+};
+
+_Entities$.prototype = new _Entities;
+
+/**
+ * @return {Object.<string, undefined|!string>}
+ */
+_Entities.entity_list$ = function () {
+ /** @type {Object.<string, undefined|!string>} */
+ var result;
+ /** @type {!string} */
+ var key;
+ /** @type {*} */
+ var value;
+ result = ({ });
+ for (key in _Entities._entities) {
+ value = _Entities._entities[key];
+ if (typeof value === 'string') {
+ result[key] = value + "";
+ } else {
+ if (typeof value === 'number') {
+ result[key] = String.fromCharCode(value | 0);
+ }
+ }
+ }
+ return result;
+};
+
+var _Entities$entity_list$ = _Entities.entity_list$;
+
+/**
+ * class BitVector extends Object
+ * @constructor
+ */
+function BitVector() {
+}
+
+/**
+ * @constructor
+ */
+function BitVector$() {
+ /** @type {Array.<undefined|!number>} */
+ var _v$0;
+ /** @type {Array.<undefined|!number>} */
+ var _r$0;
+ _r$0 = this._r = [ ];
+ _v$0 = this._v = [ ];
+ _v$0.length = 0;
+ _r$0.length = 0;
+ this._size = 0;
+ this._size1 = 0;
+};
+
+BitVector$.prototype = new BitVector;
+
+/**
+ */
+BitVector.prototype.build$ = function () {
+ /** @type {!number} */
+ var i;
+ this._size1 = 0;
+ for (i = 0; i < this._v.length; i++) {
+ if (i % 8 === 0) {
+ this._r.push(true ? this._size1 : this._size - this._size1);
+ }
+ this._size1 += this._rank32$IIB(this._v[i], 32, true);
+ }
+};
+
+/**
+ */
+BitVector.prototype.clear$ = function () {
+ this._v.length = 0;
+ this._r.length = 0;
+ this._size = 0;
+ this._size1 = 0;
+};
+
+/**
+ * @return {!number}
+ */
+BitVector.prototype.size$ = function () {
+ return this._size;
+};
+
+/**
+ * @param {!boolean} b
+ * @return {!number}
+ */
+BitVector.prototype.size$B = function (b) {
+ return (b ? this._size1 : this._size - this._size1);
+};
+
+/**
+ * @param {!number} value
+ */
+BitVector.prototype.set$I = function (value) {
+ this.set$IB(value, true);
+};
+
+/**
+ * @param {!number} value
+ * @param {!boolean} flag
+ */
+BitVector.prototype.set$IB = function (value, flag) {
+ /** @type {!number} */
+ var q;
+ /** @type {!number} */
+ var r;
+ /** @type {!number} */
+ var m;
+ if (value >= this._size) {
+ this._size = (value + 1 | 0);
+ }
+ q = (value / 32 | 0);
+ r = (value % 32 | 0);
+ while (q >= this._v.length) {
+ this._v.push(0);
+ }
+ m = 0x1 << r;
+ if (flag) {
+ this._v[q] |= m;
+ } else {
+ this._v[q] &= ~ m;
+ }
+};
+
+/**
+ * @param {!number} value
+ * @return {!boolean}
+ */
+BitVector.prototype.get$I = function (value) {
+ /** @type {!number} */
+ var q;
+ /** @type {!number} */
+ var r;
+ /** @type {!number} */
+ var m;
+ if (value >= this._size) {
+ throw new Error("BitVector.get() : range error");
+ }
+ q = (value / 32 | 0);
+ r = (value % 32 | 0);
+ m = 0x1 << r;
+ return !! (this._v[q] & m);
+};
+
+/**
+ * @param {!number} i
+ * @return {!number}
+ */
+BitVector.prototype.rank$I = function (i) {
+ return this.rank$IB(i, true);
+};
+
+/**
+ * @param {!number} i
+ * @param {!boolean} b
+ * @return {!number}
+ */
+BitVector.prototype.rank$IB = function (i, b) {
+ /** @type {!number} */
+ var q_large;
+ /** @type {!number} */
+ var q_small;
+ /** @type {!number} */
+ var r;
+ /** @type {!number} */
+ var rank;
+ /** @type {!number} */
+ var begin;
+ /** @type {!number} */
+ var j;
+ if (i > this._size) {
+ throw new Error("BitVector.rank() : range error");
+ }
+ if (i === 0) {
+ return 0;
+ }
+ i--;
+ q_large = (Math.floor(i / 256) | 0);
+ q_small = (Math.floor(i / 32) | 0);
+ r = (Math.floor(i % 32) | 0);
+ rank = (this._r[q_large] | 0);
+ if (! b) {
+ rank = q_large * 256 - rank;
+ }
+ begin = q_large * 8;
+ for (j = begin; j < q_small; j++) {
+ rank += this._rank32$IIB(this._v[j], 32, b);
+ }
+ rank += this._rank32$IIB(this._v[q_small], r + 1, b);
+ return rank;
+};
+
+/**
+ * @param {!number} i
+ * @return {!number}
+ */
+BitVector.prototype.select$I = function (i) {
+ return this.select$IB(i, true);
+};
+
+/**
+ * @param {!number} i
+ * @param {!boolean} b
+ * @return {!number}
+ */
+BitVector.prototype.select$IB = function (i, b) {
+ /** @type {!number} */
+ var left;
+ /** @type {!number} */
+ var right;
+ /** @type {!number} */
+ var pivot;
+ /** @type {undefined|!number} */
+ var rank;
+ /** @type {!number} */
+ var j;
+ if (i >= (b ? this._size1 : this._size - this._size1)) {
+ throw new Error("BitVector.select() : range error");
+ }
+ left = 0;
+ right = this._r.length;
+ while (left < right) {
+ pivot = Math.floor((left + right) / 2);
+ rank = this._r[pivot];
+ if (! b) {
+ rank = pivot * 256 - rank;
+ }
+ if (i < rank) {
+ right = pivot;
+ } else {
+ left = pivot + 1;
+ }
+ }
+ right--;
+ if (b) {
+ i -= (this._r[right] | 0);
+ } else {
+ i -= (right * 256 - this._r[right] | 0);
+ }
+ j = right * 8;
+ while (1) {
+ rank = this._rank32$IIB(this._v[j], 32, b);
+ if (i < rank) {
+ break;
+ }
+ j++;
+ i -= (rank | 0);
+ }
+ return (j * 32 + this._select32$IIB(this._v[j], i, b) | 0);
+};
+
+/**
+ * @param {!number} x
+ * @param {!number} i
+ * @param {!boolean} b
+ * @return {!number}
+ */
+BitVector.prototype._rank32$IIB = function (x, i, b) {
+ if (! b) {
+ x = ~ x;
+ }
+ x <<= 32 - i;
+ x = ((x & 0xaaaaaaaa) >>> 1) + (x & 0x55555555);
+ x = ((x & 0xcccccccc) >>> 2) + (x & 0x33333333);
+ x = ((x & 0xf0f0f0f0) >>> 4) + (x & 0x0f0f0f0f);
+ x = ((x & 0xff00ff00) >>> 8) + (x & 0x00ff00ff);
+ x = ((x & 0xffff0000) >>> 16) + (x & 0x0000ffff);
+ return x;
+};
+
+/**
+ * @param {!number} x
+ * @param {!number} i
+ * @param {!boolean} b
+ * @return {!number}
+ */
+BitVector.prototype._select32$IIB = function (x, i, b) {
+ /** @type {!number} */
+ var x1;
+ /** @type {!number} */
+ var x2;
+ /** @type {!number} */
+ var x3;
+ /** @type {!number} */
+ var x4;
+ /** @type {!number} */
+ var x5;
+ /** @type {!number} */
+ var pos;
+ /** @type {!number} */
+ var v5;
+ /** @type {!number} */
+ var v4;
+ /** @type {!number} */
+ var v3;
+ /** @type {!number} */
+ var v2;
+ /** @type {!number} */
+ var v1;
+ /** @type {!number} */
+ var v0;
+ if (! b) {
+ x = ~ x;
+ }
+ x1 = ((x & 0xaaaaaaaa) >>> 1) + (x & 0x55555555);
+ x2 = ((x1 & 0xcccccccc) >>> 2) + (x1 & 0x33333333);
+ x3 = ((x2 & 0xf0f0f0f0) >>> 4) + (x2 & 0x0f0f0f0f);
+ x4 = ((x3 & 0xff00ff00) >>> 8) + (x3 & 0x00ff00ff);
+ x5 = ((x4 & 0xffff0000) >>> 16) + (x4 & 0x0000ffff);
+ i++;
+ pos = 0;
+ v5 = x5 & 0xffffffff;
+ if (i > v5) {
+ i -= (v5 | 0);
+ pos += 32;
+ }
+ v4 = x4 >>> pos & 0x0000ffff;
+ if (i > v4) {
+ i -= (v4 | 0);
+ pos += 16;
+ }
+ v3 = x3 >>> pos & 0x000000ff;
+ if (i > v3) {
+ i -= (v3 | 0);
+ pos += 8;
+ }
+ v2 = x2 >>> pos & 0x0000000f;
+ if (i > v2) {
+ i -= (v2 | 0);
+ pos += 4;
+ }
+ v1 = x1 >>> pos & 0x00000003;
+ if (i > v1) {
+ i -= (v1 | 0);
+ pos += 2;
+ }
+ v0 = x >>> pos & 0x00000001;
+ if (i > v0) {
+ i -= (v0 | 0);
+ pos += 1;
+ }
+ return (pos | 0);
+};
+
+/**
+ * @return {!string}
+ */
+BitVector.prototype.dump$ = function () {
+ /** @type {Array.<undefined|!string>} */
+ var contents;
+ contents = [ ];
+ contents.push(Binary$dump32bitNumber$N(this._size));
+ contents.push(Binary$dump32bitNumberList$AN(this._v));
+ return contents.join('');
+};
+
+/**
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+BitVector.prototype.dump$LCompressionReport$ = function (report) {
+ /** @type {Array.<undefined|!string>} */
+ var contents;
+ contents = [ ];
+ contents.push(Binary$dump32bitNumber$N(this._size));
+ CompressionReport$add$LCompressionReport$II(report, 2, 2);
+ contents.push(Binary$dump32bitNumberList$ANLCompressionReport$(this._v, report));
+ return contents.join('');
+};
+
+/**
+ * @param {!string} data
+ * @return {!number}
+ */
+BitVector.prototype.load$S = function (data) {
+ return this.load$SI(data, 0);
+};
+
+/**
+ * @param {!string} data
+ * @param {!number} offset
+ * @return {!number}
+ */
+BitVector.prototype.load$SI = function (data, offset) {
+ /** @type {LoadedNumberListResult} */
+ var result;
+ /** @type {!number} */
+ var result$0;
+ this._v.length = 0;
+ this._r.length = 0;
+ this._size = 0;
+ this._size1 = 0;
+ result$0 = data.charCodeAt(offset) * 65536 + data.charCodeAt(offset + 1);
+ this._size = (result$0 | 0);
+ result = Binary$load32bitNumberList$SI(data, offset + 2);
+ this._v = result.result;
+ this.build$();
+ return result.offset;
+};
+
+/**
+ * class WaveletMatrix extends Object
+ * @constructor
+ */
+function WaveletMatrix() {
+}
+
+/**
+ * @constructor
+ */
+function WaveletMatrix$() {
+ /** @type {Array.<undefined|BitVector>} */
+ var _bv$0;
+ /** @type {Array.<undefined|!number>} */
+ var _seps$0;
+ this._range = ({ });
+ _bv$0 = this._bv = [ ];
+ _seps$0 = this._seps = [ ];
+ this._bitsize = 16;
+ _bv$0.length = 0;
+ _seps$0.length = 0;
+ this._size = 0;
+};
+
+WaveletMatrix$.prototype = new WaveletMatrix;
+
+/**
+ * @return {!number}
+ */
+WaveletMatrix.prototype.bitsize$ = function () {
+ return this._bitsize;
+};
+
+/**
+ * @param {!number} charCode
+ */
+WaveletMatrix.prototype.setMaxCharCode$I = function (charCode) {
+ this._bitsize = (Math.ceil(Math.log(charCode) / 0.6931471805599453) | 0);
+};
+
+/**
+ */
+WaveletMatrix.prototype.clear$ = function () {
+ this._bv.length = 0;
+ this._seps.length = 0;
+ this._size = 0;
+};
+
+/**
+ * @param {!string} v
+ */
+WaveletMatrix.prototype.build$S = function (v) {
+ /** @type {!number} */
+ var size;
+ /** @type {!number} */
+ var bitsize;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var depth;
+ /** @type {Object.<string, undefined|!number>} */
+ var range_tmp;
+ /** @type {!number} */
+ var code;
+ /** @type {!boolean} */
+ var bit;
+ /** @type {!number} */
+ var key;
+ /** @type {Object.<string, undefined|!number>} */
+ var range_rev;
+ /** @type {!string} */
+ var range_key;
+ /** @type {!number} */
+ var value;
+ /** @type {!number} */
+ var pos0;
+ /** @type {undefined|!number} */
+ var pos1;
+ /** @type {!string} */
+ var range_rev_key;
+ /** @type {!number} */
+ var begin;
+ /** @type {undefined|!number} */
+ var end;
+ /** @type {!number} */
+ var num0;
+ /** @type {!number} */
+ var num1;
+ this._bv.length = 0;
+ this._seps.length = 0;
+ this._size = 0;
+ size = v.length;
+ bitsize = this._bitsize;
+ for (i = 0; i < bitsize; i++) {
+ this._bv.push(new BitVector$());
+ this._seps.push(0);
+ }
+ this._size = (size | 0);
+ for (i = 0; i < size; i++) {
+ this._bv[0].set$IB(i, this._uint2bit$II(v.charCodeAt(i), 0));
+ }
+ this._bv[0].build$();
+ this._seps[0] = this._bv[0].size$B(false);
+ this._range["0"] = 0;
+ this._range["1"] = this._seps[0];
+ depth = 1;
+ while (depth < bitsize) {
+ range_tmp = WaveletMatrix$_shallow_copy$HI(this._range);
+ for (i = 0; i < size; i++) {
+ code = v.charCodeAt(i);
+ bit = this._uint2bit$II(code, depth);
+ key = code >>> bitsize - depth;
+ this._bv[depth].set$IB(range_tmp[key + ""], bit);
+ range_tmp[key + ""]++;
+ }
+ this._bv[depth].build$();
+ this._seps[depth] = this._bv[depth].size$B(false);
+ range_rev = ({ });
+ for (range_key in this._range) {
+ value = this._range[range_key];
+ if (value != range_tmp[range_key]) {
+ range_rev[value + ""] = range_key | 0;
+ }
+ }
+ this._range = ({ });
+ pos0 = 0;
+ pos1 = this._seps[depth];
+ for (range_rev_key in range_rev) {
+ begin = range_rev_key | 0;
+ value = range_rev[range_rev_key];
+ end = range_tmp[value + ""];
+ num0 = this._bv[depth].rank$IB(end, false) - this._bv[depth].rank$IB(begin, false);
+ num1 = end - begin - num0;
+ if (num0 > 0) {
+ this._range[(value << 1) + ""] = (pos0 | 0);
+ pos0 += num0;
+ }
+ if (num1 > 0) {
+ this._range[(value << 1) + 1 + ""] = pos1;
+ pos1 += (num1 | 0);
+ }
+ }
+ depth++;
+ }
+};
+
+/**
+ * @return {!number}
+ */
+WaveletMatrix.prototype.size$ = function () {
+ return this._size;
+};
+
+/**
+ * @param {!number} c
+ * @return {!number}
+ */
+WaveletMatrix.prototype.size$I = function (c) {
+ return this.rank$II(this._size, c);
+};
+
+/**
+ * @param {!number} i
+ * @return {!number}
+ */
+WaveletMatrix.prototype.get$I = function (i) {
+ /** @type {!number} */
+ var value;
+ /** @type {!number} */
+ var depth;
+ /** @type {!boolean} */
+ var bit;
+ if (i >= this._size) {
+ throw new Error("WaveletMatrix.get() : range error");
+ }
+ value = 0;
+ depth = 0;
+ while (depth < this._bitsize) {
+ bit = this._bv[depth].get$I(i);
+ i = this._bv[depth].rank$IB(i, bit);
+ value <<= 1;
+ if (bit) {
+ i += this._seps[depth];
+ value += 1;
+ }
+ depth++;
+ }
+ return (value | 0);
+};
+
+/**
+ * @param {!number} i
+ * @param {!number} c
+ * @return {!number}
+ */
+WaveletMatrix.prototype.rank$II = function (i, c) {
+ /** @type {undefined|!number} */
+ var begin;
+ /** @type {!number} */
+ var end;
+ /** @type {!number} */
+ var depth;
+ /** @type {!boolean} */
+ var bit;
+ if (i > this._size) {
+ throw new Error("WaveletMatrix.rank(): range error");
+ }
+ if (i === 0) {
+ return 0;
+ }
+ begin = this._range[c + ""];
+ if (begin == null) {
+ return 0;
+ }
+ end = i;
+ depth = 0;
+ while (depth < this._bitsize) {
+ bit = this._uint2bit$II(c, depth);
+ end = this._bv[depth].rank$IB(end, bit);
+ if (bit) {
+ end += this._seps[depth];
+ }
+ depth++;
+ }
+ return (end - begin | 0);
+};
+
+/**
+ * @param {!number} i
+ * @param {!number} c
+ * @return {!number}
+ */
+WaveletMatrix.prototype.rank_less_than$II = function (i, c) {
+ /** @type {!number} */
+ var begin;
+ /** @type {!number} */
+ var end;
+ /** @type {!number} */
+ var depth;
+ /** @type {!number} */
+ var rlt;
+ /** @type {!number} */
+ var rank0_begin;
+ /** @type {!number} */
+ var rank0_end;
+ /** @type {Array.<undefined|!number>} */
+ var _seps$0;
+ if (i > this._size) {
+ throw new Error("WaveletMatrix.rank_less_than(): range error");
+ }
+ if (i === 0) {
+ return 0;
+ }
+ begin = 0;
+ end = i;
+ depth = 0;
+ rlt = 0;
+ while (depth < this._bitsize) {
+ rank0_begin = this._bv[depth].rank$IB(begin, false);
+ rank0_end = this._bv[depth].rank$IB(end, false);
+ if (this._uint2bit$II(c, depth)) {
+ rlt += rank0_end - rank0_begin;
+ begin += (_seps$0 = this._seps)[depth] - rank0_begin;
+ end += _seps$0[depth] - rank0_end;
+ } else {
+ begin = rank0_begin;
+ end = rank0_end;
+ }
+ depth++;
+ }
+ return (rlt | 0);
+};
+
+/**
+ * @return {!string}
+ */
+WaveletMatrix.prototype.dump$ = function () {
+ /** @type {Array.<undefined|!string>} */
+ var contents;
+ /** @type {!number} */
+ var i;
+ /** @type {Array.<undefined|!string>} */
+ var range_contents;
+ /** @type {!number} */
+ var counter;
+ /** @type {!string} */
+ var key;
+ contents = [ Binary$dump16bitNumber$I(this._bitsize), Binary$dump32bitNumber$N(this._size) ];
+ for (i = 0; i < this._bitsize; i++) {
+ contents.push(this._bv[i].dump$());
+ }
+ for (i = 0; i < this._bitsize; i++) {
+ contents.push(Binary$dump32bitNumber$N(this._seps[i]));
+ }
+ range_contents = [ ];
+ counter = 0;
+ for (key in this._range) {
+ range_contents.push(Binary$dump32bitNumber$N(key | 0));
+ range_contents.push(Binary$dump32bitNumber$N(this._range[key]));
+ counter++;
+ }
+ contents.push(Binary$dump32bitNumber$N(counter));
+ return contents.join('') + range_contents.join('');
+};
+
+/**
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+WaveletMatrix.prototype.dump$LCompressionReport$ = function (report) {
+ /** @type {Array.<undefined|!string>} */
+ var contents;
+ /** @type {!number} */
+ var i;
+ /** @type {Array.<undefined|!string>} */
+ var range_contents;
+ /** @type {!number} */
+ var counter;
+ /** @type {!string} */
+ var key;
+ contents = [ Binary$dump16bitNumber$I(this._bitsize), Binary$dump32bitNumber$N(this._size) ];
+ CompressionReport$add$LCompressionReport$II(report, 3, 3);
+ for (i = 0; i < this._bitsize; i++) {
+ contents.push(this._bv[i].dump$LCompressionReport$(report));
+ }
+ for (i = 0; i < this._bitsize; i++) {
+ contents.push(Binary$dump32bitNumber$N(this._seps[i]));
+ CompressionReport$add$LCompressionReport$II(report, 2, 2);
+ }
+ range_contents = [ ];
+ counter = 0;
+ for (key in this._range) {
+ range_contents.push(Binary$dump32bitNumber$N(key | 0));
+ range_contents.push(Binary$dump32bitNumber$N(this._range[key]));
+ CompressionReport$add$LCompressionReport$II(report, 4, 4);
+ counter++;
+ }
+ CompressionReport$add$LCompressionReport$II(report, 2, 2);
+ contents.push(Binary$dump32bitNumber$N(counter));
+ return contents.join('') + range_contents.join('');
+};
+
+/**
+ * @param {!string} data
+ * @return {!number}
+ */
+WaveletMatrix.prototype.load$S = function (data) {
+ return this.load$SI(data, 0);
+};
+
+/**
+ * @param {!string} data
+ * @param {!number} offset
+ * @return {!number}
+ */
+WaveletMatrix.prototype.load$SI = function (data, offset) {
+ /** @type {!number} */
+ var i;
+ /** @type {BitVector} */
+ var bit_vector;
+ /** @type {!number} */
+ var range_size;
+ /** @type {!number} */
+ var value;
+ /** @type {!number} */
+ var offset$0;
+ /** @type {!number} */
+ var result$0;
+ /** @type {!number} */
+ var result$1;
+ /** @type {!number} */
+ var result$2;
+ this._bv.length = 0;
+ this._seps.length = 0;
+ this._size = 0;
+ offset$0 = offset++;
+ this._bitsize = (data.charCodeAt(offset$0) | 0);
+ result$0 = data.charCodeAt(offset) * 65536 + data.charCodeAt(offset + 1);
+ this._size = (result$0 | 0);
+ offset += 2;
+ for (i = 0; i < this._bitsize; i++) {
+ bit_vector = new BitVector$();
+ offset = bit_vector.load$SI(data, offset);
+ this._bv.push(bit_vector);
+ }
+ for (i = 0; i < this._bitsize; (i++, offset += 2)) {
+ this._seps.push(Binary$load32bitNumber$SI(data, offset));
+ }
+ result$1 = data.charCodeAt(offset) * 65536 + data.charCodeAt(offset + 1);
+ range_size = result$1;
+ offset += 2;
+ for (i = 0; i < range_size; (i++, offset += 4)) {
+ result$2 = data.charCodeAt(offset) * 65536 + data.charCodeAt(offset + 1);
+ value = Binary$load32bitNumber$SI(data, offset + 2);
+ this._range[result$2 + ""] = (value | 0);
+ }
+ return offset;
+};
+
+/**
+ * @param {Object.<string, undefined|!number>} input
+ * @return {Object.<string, undefined|!number>}
+ */
+WaveletMatrix._shallow_copy$HI = function (input) {
+ /** @type {Object.<string, undefined|!number>} */
+ var result;
+ /** @type {!string} */
+ var key;
+ result = ({ });
+ for (key in input) {
+ result[key] = input[key];
+ }
+ return result;
+};
+
+var WaveletMatrix$_shallow_copy$HI = WaveletMatrix._shallow_copy$HI;
+
+/**
+ * @param {!number} c
+ * @param {!number} i
+ * @return {!boolean}
+ */
+WaveletMatrix.prototype._uint2bit$II = function (c, i) {
+ return (c >>> this._bitsize - 1 - i & 0x1) === 0x1;
+};
+
+/**
+ * class BurrowsWheelerTransform extends Object
+ * @constructor
+ */
+function BurrowsWheelerTransform() {
+}
+
+/**
+ * @constructor
+ */
+function BurrowsWheelerTransform$() {
+ this._str = "";
+ this._size = 0;
+ this._head = 0;
+ this._suffixarray = [ ];
+};
+
+BurrowsWheelerTransform$.prototype = new BurrowsWheelerTransform;
+
+/**
+ * @param {BurrowsWheelerTransform} $this
+ * @return {!number}
+ */
+BurrowsWheelerTransform.size$LBurrowsWheelerTransform$ = function ($this) {
+ return $this._size;
+};
+
+var BurrowsWheelerTransform$size$LBurrowsWheelerTransform$ = BurrowsWheelerTransform.size$LBurrowsWheelerTransform$;
+
+/**
+ * @param {BurrowsWheelerTransform} $this
+ * @return {!number}
+ */
+BurrowsWheelerTransform.head$LBurrowsWheelerTransform$ = function ($this) {
+ return $this._head;
+};
+
+var BurrowsWheelerTransform$head$LBurrowsWheelerTransform$ = BurrowsWheelerTransform.head$LBurrowsWheelerTransform$;
+
+/**
+ * @param {BurrowsWheelerTransform} $this
+ */
+BurrowsWheelerTransform.clear$LBurrowsWheelerTransform$ = function ($this) {
+ $this._str = "";
+ $this._size = 0;
+ $this._head = 0;
+ $this._suffixarray.length = 0;
+};
+
+var BurrowsWheelerTransform$clear$LBurrowsWheelerTransform$ = BurrowsWheelerTransform.clear$LBurrowsWheelerTransform$;
+
+/**
+ * @param {BurrowsWheelerTransform} $this
+ * @param {!string} str
+ */
+BurrowsWheelerTransform.build$LBurrowsWheelerTransform$S = function ($this, str) {
+ /** @type {!string} */
+ var _str$0;
+ /** @type {Array.<undefined|!number>} */
+ var _suffixarray$0;
+ _str$0 = $this._str = str;
+ $this._size = _str$0.length;
+ _suffixarray$0 = $this._suffixarray = SAIS$make$S(str);
+ $this._head = (_suffixarray$0.indexOf(0) | 0);
+};
+
+var BurrowsWheelerTransform$build$LBurrowsWheelerTransform$S = BurrowsWheelerTransform.build$LBurrowsWheelerTransform$S;
+
+/**
+ * @param {BurrowsWheelerTransform} $this
+ * @param {!number} i
+ * @return {!string}
+ */
+BurrowsWheelerTransform.get$LBurrowsWheelerTransform$I = function ($this, i) {
+ /** @type {!number} */
+ var size;
+ /** @type {!number} */
+ var index;
+ size = $this._size;
+ if (i >= size) {
+ throw new Error("BurrowsWheelerTransform.get() : range error");
+ }
+ index = ($this._suffixarray[i] + size - 1) % size;
+ return $this._str.charAt(index);
+};
+
+var BurrowsWheelerTransform$get$LBurrowsWheelerTransform$I = BurrowsWheelerTransform.get$LBurrowsWheelerTransform$I;
+
+/**
+ * @param {BurrowsWheelerTransform} $this
+ * @return {!string}
+ */
+BurrowsWheelerTransform.get$LBurrowsWheelerTransform$ = function ($this) {
+ /** @type {Array.<undefined|!string>} */
+ var str;
+ /** @type {!number} */
+ var size;
+ /** @type {!number} */
+ var i;
+ str = [ ];
+ size = $this._size;
+ for (i = 0; i < size; i++) {
+ str.push(BurrowsWheelerTransform$get$LBurrowsWheelerTransform$I($this, i));
+ }
+ return str.join("");
+};
+
+var BurrowsWheelerTransform$get$LBurrowsWheelerTransform$ = BurrowsWheelerTransform.get$LBurrowsWheelerTransform$;
+
+/**
+ * @param {BurrowsWheelerTransform} $this
+ * @param {!string} replace
+ * @return {!string}
+ */
+BurrowsWheelerTransform.get$LBurrowsWheelerTransform$S = function ($this, replace) {
+ /** @type {!string} */
+ var result;
+ result = BurrowsWheelerTransform$get$LBurrowsWheelerTransform$($this);
+ return result.replace(BurrowsWheelerTransform.END_MARKER, replace);
+};
+
+var BurrowsWheelerTransform$get$LBurrowsWheelerTransform$S = BurrowsWheelerTransform.get$LBurrowsWheelerTransform$S;
+
+/**
+ * class OArray extends Object
+ * @constructor
+ */
+function OArray() {
+}
+
+/**
+ * @constructor
+ * @param {Array.<undefined|!number>} array
+ */
+function OArray$AI(array) {
+ this.array = array;
+ this.offset = 0;
+};
+
+OArray$AI.prototype = new OArray;
+
+/**
+ * @constructor
+ * @param {Array.<undefined|!number>} array
+ * @param {!number} offset
+ */
+function OArray$AII(array, offset) {
+ this.array = array;
+ this.offset = offset;
+};
+
+OArray$AII.prototype = new OArray;
+
+/**
+ * @param {OArray} $this
+ * @param {!number} index
+ * @return {!number}
+ */
+OArray.get$LOArray$I = function ($this, index) {
+ return $this.array[index + $this.offset];
+};
+
+var OArray$get$LOArray$I = OArray.get$LOArray$I;
+
+/**
+ * @param {OArray} $this
+ * @param {!number} index
+ * @param {!number} value
+ */
+OArray.set$LOArray$II = function ($this, index, value) {
+ $this.array[index + $this.offset] = value;
+};
+
+var OArray$set$LOArray$II = OArray.set$LOArray$II;
+
+/**
+ * @param {OArray} $this
+ * @param {!number} index
+ * @return {!boolean}
+ */
+OArray.isS$LOArray$I = function ($this, index) {
+ /** @type {Array.<undefined|!number>} */
+ var array$0;
+ /** @type {!number} */
+ var offset$0;
+ return (array$0 = $this.array)[index + (offset$0 = $this.offset)] < array$0[index + offset$0 + 1];
+};
+
+var OArray$isS$LOArray$I = OArray.isS$LOArray$I;
+
+/**
+ * @param {OArray} $this
+ * @param {!number} index1
+ * @param {!number} index2
+ * @return {!boolean}
+ */
+OArray.compare$LOArray$II = function ($this, index1, index2) {
+ /** @type {Array.<undefined|!number>} */
+ var array$0;
+ /** @type {!number} */
+ var offset$0;
+ return (array$0 = $this.array)[index1 + (offset$0 = $this.offset)] == array$0[index2 + offset$0];
+};
+
+var OArray$compare$LOArray$II = OArray.compare$LOArray$II;
+
+/**
+ * class SAIS extends Object
+ * @constructor
+ */
+function SAIS() {
+}
+
+/**
+ * @constructor
+ */
+function SAIS$() {
+};
+
+SAIS$.prototype = new SAIS;
+
+/**
+ * @param {BitVector} t
+ * @param {!number} i
+ * @return {!boolean}
+ */
+SAIS._isLMS$LBitVector$I = function (t, i) {
+ return i > 0 && t.get$I(i) && ! t.get$I(i - 1);
+};
+
+var SAIS$_isLMS$LBitVector$I = SAIS._isLMS$LBitVector$I;
+
+/**
+ * @param {OArray} s
+ * @param {Array.<undefined|!number>} bkt
+ * @param {!number} n
+ * @param {!number} K
+ * @param {!boolean} end
+ */
+SAIS._getBuckets$LOArray$AIIIB = function (s, bkt, n, K, end) {
+ /** @type {!number} */
+ var sum;
+ /** @type {!number} */
+ var i;
+ sum = 0;
+ for (i = 0; i <= K; i++) {
+ bkt[i] = 0;
+ }
+ for (i = 0; i < n; i++) {
+ bkt[OArray$get$LOArray$I(s, i)]++;
+ }
+ for (i = 0; i <= K; i++) {
+ sum += bkt[i];
+ bkt[i] = ((end ? sum : sum - bkt[i]) | 0);
+ }
+};
+
+var SAIS$_getBuckets$LOArray$AIIIB = SAIS._getBuckets$LOArray$AIIIB;
+
+/**
+ * @param {BitVector} t
+ * @param {Array.<undefined|!number>} SA
+ * @param {OArray} s
+ * @param {Array.<undefined|!number>} bkt
+ * @param {!number} n
+ * @param {!number} K
+ * @param {!boolean} end
+ */
+SAIS._induceSAl$LBitVector$AILOArray$AIIIB = function (t, SA, s, bkt, n, K, end) {
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var j;
+ SAIS$_getBuckets$LOArray$AIIIB(s, bkt, n, K, end);
+ for (i = 0; i < n; i++) {
+ j = SA[i] - 1;
+ if (j >= 0 && ! t.get$I(j)) {
+ SA[bkt[OArray$get$LOArray$I(s, j)]++] = (j | 0);
+ }
+ }
+};
+
+var SAIS$_induceSAl$LBitVector$AILOArray$AIIIB = SAIS._induceSAl$LBitVector$AILOArray$AIIIB;
+
+/**
+ * @param {BitVector} t
+ * @param {Array.<undefined|!number>} SA
+ * @param {OArray} s
+ * @param {Array.<undefined|!number>} bkt
+ * @param {!number} n
+ * @param {!number} K
+ * @param {!boolean} end
+ */
+SAIS._induceSAs$LBitVector$AILOArray$AIIIB = function (t, SA, s, bkt, n, K, end) {
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var j;
+ SAIS$_getBuckets$LOArray$AIIIB(s, bkt, n, K, end);
+ for (i = n - 1; i >= 0; i--) {
+ j = SA[i] - 1;
+ if (j >= 0 && t.get$I(j)) {
+ SA[-- bkt[OArray$get$LOArray$I(s, j)]] = (j | 0);
+ }
+ }
+};
+
+var SAIS$_induceSAs$LBitVector$AILOArray$AIIIB = SAIS._induceSAs$LBitVector$AILOArray$AIIIB;
+
+/**
+ * @param {!string} source
+ * @return {Array.<undefined|!number>}
+ */
+SAIS.make$S = function (source) {
+ /** @type {Array.<undefined|!number>} */
+ var charCodes;
+ /** @type {!number} */
+ var maxCode;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var code;
+ /** @type {Array.<undefined|!number>} */
+ var SA;
+ /** @type {OArray} */
+ var s;
+ charCodes = [ ];
+ charCodes.length = source.length;
+ maxCode = 0;
+ for (i = 0; i < source.length; i++) {
+ code = source.charCodeAt(i);
+ charCodes[i] = (code | 0);
+ maxCode = (code > maxCode ? code : maxCode);
+ }
+ SA = [ ];
+ SA.length = source.length;
+ s = ({offset: 0, array: charCodes});
+ SAIS$_make$LOArray$AIII(s, SA, source.length, maxCode);
+ return SA;
+};
+
+var SAIS$make$S = SAIS.make$S;
+
+/**
+ * @param {OArray} s
+ * @param {Array.<undefined|!number>} SA
+ * @param {!number} n
+ * @param {!number} K
+ */
+SAIS._make$LOArray$AIII = function (s, SA, n, K) {
+ /** @type {BitVector} */
+ var t;
+ /** @type {!number} */
+ var i;
+ /** @type {Array.<undefined|!number>} */
+ var bkt;
+ /** @type {!number} */
+ var n1;
+ /** @type {!number} */
+ var name;
+ /** @type {!number} */
+ var prev;
+ /** @type {undefined|!number} */
+ var pos;
+ /** @type {!boolean} */
+ var diff;
+ /** @type {!number} */
+ var d;
+ /** @type {!number} */
+ var j;
+ /** @type {Array.<undefined|!number>} */
+ var SA1;
+ /** @type {OArray} */
+ var s1;
+ /** @type {!number} */
+ var i$0;
+ /** @type {!number} */
+ var index$0;
+ t = new BitVector$();
+ t.set$IB(n - 2, false);
+ t.set$IB(n - 1, true);
+ for (i = n - 3; i >= 0; i--) {
+ t.set$IB(i, OArray$isS$LOArray$I(s, i) || OArray$compare$LOArray$II(s, i, i + 1) && t.get$I(i + 1));
+ }
+ bkt = [ ];
+ bkt.length = K + 1;
+ SAIS$_getBuckets$LOArray$AIIIB(s, bkt, n, K, true);
+ for (i = 0; i < n; i++) {
+ SA[i] = -1;
+ }
+ for (i = 1; i < n; i++) {
+ if (SAIS$_isLMS$LBitVector$I(t, i)) {
+ SA[-- bkt[OArray$get$LOArray$I(s, i)]] = (i | 0);
+ }
+ }
+ SAIS$_induceSAl$LBitVector$AILOArray$AIIIB(t, SA, s, bkt, n, K, false);
+ SAIS$_induceSAs$LBitVector$AILOArray$AIIIB(t, SA, s, bkt, n, K, true);
+ n1 = 0;
+ for (i = 0; i < n; i++) {
+ i$0 = SA[i];
+ if (i$0 > 0 && t.get$I(i$0) && ! t.get$I(i$0 - 1)) {
+ SA[n1++] = SA[i];
+ }
+ }
+ for (i = n1; i < n; i++) {
+ SA[i] = -1;
+ }
+ name = 0;
+ prev = -1;
+ for (i = 0; i < n1; i++) {
+ pos = SA[i];
+ diff = false;
+ for (d = 0; d < n; d++) {
+ if (prev === -1 || ! OArray$compare$LOArray$II(s, pos + d, prev + d) || t.get$I(pos + d) !== t.get$I(prev + d)) {
+ diff = true;
+ break;
+ } else {
+ if (d > 0 && (SAIS$_isLMS$LBitVector$I(t, pos + d) || SAIS$_isLMS$LBitVector$I(t, prev + d))) {
+ break;
+ }
+ }
+ }
+ if (diff) {
+ name++;
+ prev = pos;
+ }
+ pos = ((pos % 2 === 0 ? pos / 2 : (pos - 1) / 2) | 0);
+ SA[n1 + pos] = (name - 1 | 0);
+ }
+ for ((i = n - 1, j = n - 1); i >= n1; i--) {
+ if (SA[i] >= 0) {
+ SA[j--] = SA[i];
+ }
+ }
+ SA1 = SA;
+ s1 = ({offset: n - n1, array: SA});
+ if (name < n1) {
+ SAIS$_make$LOArray$AIII(s1, SA1, n1, name - 1);
+ } else {
+ for (i = 0; i < n1; i++) {
+ SA1[OArray$get$LOArray$I(s1, i)] = (i | 0);
+ }
+ }
+ bkt = [ ];
+ bkt.length = K + 1;
+ SAIS$_getBuckets$LOArray$AIIIB(s, bkt, n, K, true);
+ for ((i = 1, j = 0); i < n; i++) {
+ if (SAIS$_isLMS$LBitVector$I(t, i)) {
+ OArray$set$LOArray$II(s1, j++, i);
+ }
+ }
+ for (i = 0; i < n1; i++) {
+ index$0 = SA1[i];
+ SA1[i] = s1.array[index$0 + s1.offset];
+ }
+ for (i = n1; i < n; i++) {
+ SA[i] = -1;
+ }
+ for (i = n1 - 1; i >= 0; i--) {
+ j = SA[i];
+ SA[i] = -1;
+ SA[-- bkt[OArray$get$LOArray$I(s, j)]] = (j | 0);
+ }
+ SAIS$_induceSAl$LBitVector$AILOArray$AIIIB(t, SA, s, bkt, n, K, false);
+ SAIS$_induceSAs$LBitVector$AILOArray$AIIIB(t, SA, s, bkt, n, K, true);
+};
+
+var SAIS$_make$LOArray$AIII = SAIS._make$LOArray$AIII;
+
+OktaviaSearch._stemmer = null;
+OktaviaSearch._instance = null;
+$__jsx_lazy_init(Oktavia, "eof", function () {
+ return String.fromCharCode(0);
+});
+$__jsx_lazy_init(Oktavia, "eob", function () {
+ return String.fromCharCode(1);
+});
+$__jsx_lazy_init(Oktavia, "unknown", function () {
+ return String.fromCharCode(3);
+});
+Binary._base64EncodeChars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
+$__jsx_lazy_init(Binary, "_base64DecodeChars", function () {
+ return [ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 62, -1, -1, -1, 63, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, -1, -1, -1, -1, -1, -1, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -1, -1, -1, -1, -1, -1, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, -1, -1, -1, -1 ];
+});
+$__jsx_lazy_init(Style, "console", function () {
+ return ({ 'title': [ '\x1B[32m\x1b[4m', '\x1B[39m\x1b[0m' ], 'url': [ '\x1B[34m', '\x1B[39m' ], 'hit': [ '\x1B[4m', '\x1B[0m' ], 'del': [ '\x1B[9m', '\x1B[0m' ], 'summary': [ '\x1B[90m', '\x1B[39m' ] });
+});
+$__jsx_lazy_init(Style, "html", function () {
+ return ({ 'title': [ '<span class="title">', '</span>' ], 'url': [ '<span class="url">', '</span>' ], 'hit': [ '<span class="hit">', '</span>' ], 'del': [ '<del>', '</del>' ], 'summary': [ '<span class="reuslt">', '</span>' ] });
+});
+$__jsx_lazy_init(Style, "ignore", function () {
+ return ({ 'tilte': [ '', '' ], 'url': [ '', '' ], 'hit': [ '', '' ], 'del': [ '', '' ], 'summary': [ '', '' ] });
+});
+$__jsx_lazy_init(_Common, "buffers", function () {
+ return [ "comment", "sgmlDecl", "textNode", "tagName", "doctype", "procInstName", "procInstBody", "entity", "attribName", "attribValue", "cdata", "script" ];
+});
+$__jsx_lazy_init(_Common, "EVENTS", function () {
+ return [ "text", "processinginstruction", "sgmldeclaration", "doctype", "comment", "attribute", "opentag", "closetag", "opencdata", "cdata", "clo_State.CDATA", "error", "end", "ready", "script", "opennamespace", "closenamespace" ];
+});
+_Common.MAX_BUFFER_LENGTH = 65536;
+_State.BEGIN = 1;
+_State.TEXT = 2;
+_State.TEXT_ENTITY = 3;
+_State.OPEN_WAKA = 4;
+_State.SGML_DECL = 5;
+_State.SGML_DECL_QUOTED = 6;
+_State.DOCTYPE = 7;
+_State.DOCTYPE_QUOTED = 8;
+_State.DOCTYPE_DTD = 9;
+_State.DOCTYPE_DTD_QUOTED = 10;
+_State.COMMENT_STARTING = 11;
+_State.COMMENT = 12;
+_State.COMMENT_ENDING = 13;
+_State.COMMENT_ENDED = 14;
+_State.CDATA = 15;
+_State.CDATA_ENDING = 16;
+_State.CDATA_ENDING_2 = 17;
+_State.PROC_INST = 18;
+_State.PROC_INST_BODY = 19;
+_State.PROC_INST_ENDING = 20;
+_State.OPEN_TAG = 21;
+_State.OPEN_TAG_SLASH = 22;
+_State.ATTRIB = 23;
+_State.ATTRIB_NAME = 24;
+_State.ATTRIB_NAME_SAW_WHITE = 25;
+_State.ATTRIB_VALUE = 26;
+_State.ATTRIB_VALUE_QUOTED = 27;
+_State.ATTRIB_VALUE_UNQUOTED = 28;
+_State.ATTRIB_VALUE_ENTITY_Q = 29;
+_State.ATTRIB_VALUE_ENTITY_U = 30;
+_State.CLOSE_TAG = 31;
+_State.CLOSE_TAG_SAW_WHITE = 32;
+_State.SCRIPT = 33;
+_State.SCRIPT_ENDING = 34;
+$__jsx_lazy_init(_Entities, "_entities", function () {
+ return ({ "amp": "&", "gt": ">", "lt": "<", "quot": "\"", "apos": "'", "AElig": 198, "Aacute": 193, "Acirc": 194, "Agrave": 192, "Aring": 197, "Atilde": 195, "Auml": 196, "Ccedil": 199, "ETH": 208, "Eacute": 201, "Ecirc": 202, "Egrave": 200, "Euml": 203, "Iacute": 205, "Icirc": 206, "Igrave": 204, "Iuml": 207, "Ntilde": 209, "Oacute": 211, "Ocirc": 212, "Ograve": 210, "Oslash": 216, "Otilde": 213, "Ouml": 214, "THORN": 222, "Uacute": 218, "Ucirc": 219, "Ugrave": 217, "Uuml": 220, "Yacute": 221, "aacute": 225, "acirc": 226, "aelig": 230, "agrave": 224, "aring": 229, "atilde": 227, "auml": 228, "ccedil": 231, "eacute": 233, "ecirc": 234, "egrave": 232, "eth": 240, "euml": 235, "iacute": 237, "icirc": 238, "igrave": 236, "iuml": 239, "ntilde": 241, "oacute": 243, "ocirc": 244, "ograve": 242, "oslash": 248, "otilde": 245, "ouml": 246, "szlig": 223, "thorn": 254, "uacute": 250, "ucirc": 251, "ugrave": 249, "uuml": 252, "yacute": 253, "yuml": 255, "copy": 169, "reg": 174, "nbsp": 160, "iexcl": 161, "cent": 162, "pound": 163, "curren": 164, "yen": 165, "brvbar": 166, "sect": 167, "uml": 168, "ordf": 170, "laquo": 171, "not": 172, "shy": 173, "macr": 175, "deg": 176, "plusmn": 177, "sup1": 185, "sup2": 178, "sup3": 179, "acute": 180, "micro": 181, "para": 182, "middot": 183, "cedil": 184, "ordm": 186, "raquo": 187, "frac14": 188, "frac12": 189, "frac34": 190, "iquest": 191, "times": 215, "divide": 247, "OElig": 338, "oelig": 339, "Scaron": 352, "scaron": 353, "Yuml": 376, "fnof": 402, "circ": 710, "tilde": 732, "Alpha": 913, "Beta": 914, "Gamma": 915, "Delta": 916, "Epsilon": 917, "Zeta": 918, "Eta": 919, "Theta": 920, "Iota": 921, "Kappa": 922, "Lambda": 923, "Mu": 924, "Nu": 925, "Xi": 926, "Omicron": 927, "Pi": 928, "Rho": 929, "Sigma": 931, "Tau": 932, "Upsilon": 933, "Phi": 934, "Chi": 935, "Psi": 936, "Omega": 937, "alpha": 945, "beta": 946, "gamma": 947, "delta": 948, "epsilon": 949, "zeta": 950, "eta": 951, "theta": 952, "iota": 953, "kappa": 954, "lambda": 955, "mu": 956, "nu": 957, "xi": 958, "omicron": 959, "pi": 960, "rho": 961, "sigmaf": 962, "sigma": 963, "tau": 964, "upsilon": 965, "phi": 966, "chi": 967, "psi": 968, "omega": 969, "thetasym": 977, "upsih": 978, "piv": 982, "ensp": 8194, "emsp": 8195, "thinsp": 8201, "zwnj": 8204, "zwj": 8205, "lrm": 8206, "rlm": 8207, "ndash": 8211, "mdash": 8212, "lsquo": 8216, "rsquo": 8217, "sbquo": 8218, "ldquo": 8220, "rdquo": 8221, "bdquo": 8222, "dagger": 8224, "Dagger": 8225, "bull": 8226, "hellip": 8230, "permil": 8240, "prime": 8242, "Prime": 8243, "lsaquo": 8249, "rsaquo": 8250, "oline": 8254, "frasl": 8260, "euro": 8364, "image": 8465, "weierp": 8472, "real": 8476, "trade": 8482, "alefsym": 8501, "larr": 8592, "uarr": 8593, "rarr": 8594, "darr": 8595, "harr": 8596, "crarr": 8629, "lArr": 8656, "uArr": 8657, "rArr": 8658, "dArr": 8659, "hArr": 8660, "forall": 8704, "part": 8706, "exist": 8707, "empty": 8709, "nabla": 8711, "isin": 8712, "notin": 8713, "ni": 8715, "prod": 8719, "sum": 8721, "minus": 8722, "lowast": 8727, "radic": 8730, "prop": 8733, "infin": 8734, "ang": 8736, "and": 8743, "or": 8744, "cap": 8745, "cup": 8746, "int": 8747, "there4": 8756, "sim": 8764, "cong": 8773, "asymp": 8776, "ne": 8800, "equiv": 8801, "le": 8804, "ge": 8805, "sub": 8834, "sup": 8835, "nsub": 8836, "sube": 8838, "supe": 8839, "oplus": 8853, "otimes": 8855, "perp": 8869, "sdot": 8901, "lceil": 8968, "rceil": 8969, "lfloor": 8970, "rfloor": 8971, "lang": 9001, "rang": 9002, "loz": 9674, "spades": 9824, "clubs": 9827, "hearts": 9829, "diams": 9830 });
+});
+BitVector.SMALL_BLOCK_SIZE = 32;
+BitVector.LARGE_BLOCK_SIZE = 256;
+BitVector.BLOCK_RATE = 8;
+$__jsx_lazy_init(BurrowsWheelerTransform, "END_MARKER", function () {
+ return String.fromCharCode(0);
+});
+var $__jsx_classMap = {
+ "tool/web/oktavia-search.jsx": {
+ _Result: _Result,
+ _Result$SSSI: _Result$SSSI,
+ _Proposal: _Proposal,
+ _Proposal$SSI: _Proposal$SSI,
+ OktaviaSearch: OktaviaSearch,
+ OktaviaSearch$I: OktaviaSearch$I,
+ _Main: _Main,
+ _Main$: _Main$
+ },
+ "src/oktavia.jsx": {
+ Oktavia: Oktavia,
+ Oktavia$: Oktavia$
+ },
+ "src/binary-util.jsx": {
+ Binary: Binary,
+ Binary$: Binary$,
+ LoadedStringResult: LoadedStringResult,
+ LoadedStringResult$SI: LoadedStringResult$SI,
+ LoadedStringListResult: LoadedStringListResult,
+ LoadedStringListResult$SI: LoadedStringListResult$SI,
+ LoadedStringListMapResult: LoadedStringListMapResult,
+ LoadedStringListMapResult$SI: LoadedStringListMapResult$SI,
+ LoadedNumberListResult: LoadedNumberListResult,
+ LoadedNumberListResult$SI: LoadedNumberListResult$SI,
+ CompressionReport: CompressionReport,
+ CompressionReport$: CompressionReport$
+ },
+ "src/query.jsx": {
+ Query: Query,
+ Query$: Query$
+ },
+ "src/query-string-parser.jsx": {
+ QueryStringParser: QueryStringParser,
+ QueryStringParser$: QueryStringParser$
+ },
+ "src/search-result.jsx": {
+ Proposal: Proposal,
+ Proposal$II: Proposal$II,
+ Position: Position,
+ Position$SIB: Position$SIB,
+ SearchUnit: SearchUnit,
+ SearchUnit$I: SearchUnit$I,
+ SingleResult: SingleResult,
+ SingleResult$: SingleResult$,
+ SingleResult$SBB: SingleResult$SBB,
+ SearchSummary: SearchSummary,
+ SearchSummary$: SearchSummary$,
+ SearchSummary$LOktavia$: SearchSummary$LOktavia$
+ },
+ "src/style.jsx": {
+ Style: Style,
+ Style$S: Style$S,
+ _HTMLHandler: _HTMLHandler,
+ _HTMLHandler$HASB: _HTMLHandler$HASB
+ },
+ "src/stemmer/stemmer.jsx": {
+ Stemmer: Stemmer,
+ Stemmer$: Stemmer$
+ },
+ "src/metadata.jsx": {
+ Metadata: Metadata,
+ Metadata$LOktavia$: Metadata$LOktavia$,
+ Section: Section,
+ Section$LOktavia$: Section$LOktavia$,
+ Splitter: Splitter,
+ Splitter$LOktavia$: Splitter$LOktavia$,
+ Splitter$LOktavia$S: Splitter$LOktavia$S,
+ Table: Table,
+ Table$LOktavia$AS: Table$LOktavia$AS,
+ Block: Block,
+ Block$LOktavia$: Block$LOktavia$
+ },
+ "src/fm-index.jsx": {
+ FMIndex: FMIndex,
+ FMIndex$: FMIndex$
+ },
+ "src/sax.jsx": {
+ Tag: Tag,
+ Tag$S: Tag$S,
+ _Common: _Common,
+ _Common$: _Common$,
+ _State: _State,
+ _State$: _State$,
+ SAXHandler: SAXHandler,
+ SAXHandler$: SAXHandler$,
+ SAXParser: SAXParser,
+ SAXParser$LSAXHandler$: SAXParser$LSAXHandler$,
+ SAXParser$LSAXHandler$B: SAXParser$LSAXHandler$B,
+ Char: Char,
+ Char$: Char$,
+ _Entities: _Entities,
+ _Entities$: _Entities$
+ },
+ "src/bit-vector.jsx": {
+ BitVector: BitVector,
+ BitVector$: BitVector$
+ },
+ "src/wavelet-matrix.jsx": {
+ WaveletMatrix: WaveletMatrix,
+ WaveletMatrix$: WaveletMatrix$
+ },
+ "src/burrows-wheeler-transform.jsx": {
+ BurrowsWheelerTransform: BurrowsWheelerTransform,
+ BurrowsWheelerTransform$: BurrowsWheelerTransform$
+ },
+ "src/sais.jsx": {
+ OArray: OArray,
+ OArray$AI: OArray$AI,
+ OArray$AII: OArray$AII,
+ SAIS: SAIS,
+ SAIS$: SAIS$
+ }
+};
+
+
+/**
+ * launches _Main.main(:string[]):void invoked by jsx --run|--executable
+ */
+JSX.runMain = function (sourceFile, args) {
+ var module = JSX.require(sourceFile);
+ if (! module) {
+ throw new ReferenceError("entry point module not found in " + sourceFile);
+ }
+ if (! module._Main) {
+ throw new ReferenceError("entry point _Main not found in " + sourceFile);
+ }
+ if (! module._Main.main$AS) {
+ throw new ReferenceError("entry point _Main.main(:string[]):void not found in " + sourceFile);
+ }
+ module._Main.main$AS(args);
+};
+
+/**
+ * launches _Test#test*():void invoked by jsx --test
+ */
+JSX.runTests = function (sourceFile, tests) {
+ var module = JSX.require(sourceFile);
+ var testClass = module._Test$;
+
+ if (!testClass) return; // skip if there's no test class
+
+ if(tests.length === 0) {
+ var p = testClass.prototype;
+ for (var m in p) {
+ if (p[m] instanceof Function
+ && /^test.*[$]$/.test(m)) {
+ tests.push(m);
+ }
+ }
+ }
+ else { // set as process arguments
+ tests = tests.map(function (name) {
+ return name + "$"; // mangle for function test*():void
+ });
+ }
+
+ var testCase = new testClass();
+
+ if (testCase.beforeClass$AS != null)
+ testCase.beforeClass$AS(tests);
+
+ for (var i = 0; i < tests.length; ++i) {
+ (function (method) {
+ if (method in testCase) {
+ testCase.run$SF$V$(method, function() { testCase[method](); });
+ }
+ else {
+ throw new ReferenceError("No such test method: " + method);
+ }
+ }(tests[i]));
+ }
+
+ if (testCase.afterClass$ != null)
+ testCase.afterClass$();
+};
+/**
+ * call a function on load/DOMContentLoaded
+ */
+function $__jsx_onload (event) {
+ window.removeEventListener("load", $__jsx_onload);
+ document.removeEventListener("DOMContentLoaded", $__jsx_onload);
+ JSX.runMain("tool/web/oktavia-search.jsx", [])
+}
+
+window.addEventListener("load", $__jsx_onload);
+document.addEventListener("DOMContentLoaded", $__jsx_onload);
+
+})(JSX);
diff --git a/web/server/h2o/libh2o/misc/oktavia/templates/sphinx/_static/searchstyle.css b/web/server/h2o/libh2o/misc/oktavia/templates/sphinx/_static/searchstyle.css
new file mode 100644
index 00000000..a3d51d43
--- /dev/null
+++ b/web/server/h2o/libh2o/misc/oktavia/templates/sphinx/_static/searchstyle.css
@@ -0,0 +1,174 @@
+form.oktavia_form {
+ position: relative;
+ display: block;
+ width: 240px;
+ height: 25px;
+}
+
+input.oktavia_search {
+ -webkit-appearance: searchfield;
+ -webkit-user-select: text;
+ cursor: auto;
+ background-color: white;
+ color: black;
+ line-height: normal;
+ display: inline-block;
+ padding: 1px;
+ text-align: start;
+ margin: 2px 0px 2px 0px;
+ padding: 1px;
+}
+
+div.oktavia_searchresult_box {
+ display: none;
+ position: absolute;
+ width: 500px;
+ padding: 10px;
+ right: 10px;
+ background-color: #ffffff;
+ -moz-border-radius: 8px;
+ border-radius: 8px;
+ -moz-box-shadow: 3px 3px 5px 5px #b5b2b2;
+ box-shadow: 3px 3px 5px 5px #b5b2b2;
+ opacity: 0.95;
+ z-index: 100000;
+}
+
+div.oktavia_close_search_box {
+ position: absolute;
+ top: 10px;
+ right: 10px;
+ width: 20px;
+ height: 20px;
+ text-align: center;
+ vertical-align: middle;
+ color: #666;
+}
+
+div.oktavia_close_search_box:hover {
+ background-color: #d1e8ff;
+ border: 1px solid gray;
+}
+
+div.oktavia_close_search_box:active {
+ background-color: #b4c8db;
+ border: 1px solid gray;
+}
+
+
+div.oktavia_searchresult_summary {
+ color: #444;
+}
+
+div.oktavia_searchresult .entry {
+ margin: 10px 10px 10px 10px;
+ color: black;
+}
+
+div.oktavia_searchresult .entry .title {
+ font-size: normal;
+}
+
+div.oktavia_searchresult .entry .title a:link {
+ color: #0000EE;
+ text-decoration: underline;
+}
+
+div.oktavia_searchresult .entry .title a:visited {
+ color: #551A8B;
+ text-decoration: underline;
+}
+
+div.oktavia_searchresult .entry .title a:hover {
+}
+
+div.oktavia_searchresult .entry .title a:active {
+ color: #FF0000;
+ text-decoration: underline;
+}
+
+div.oktavia_searchresult .entry .url {
+ font-size: 14px!important;
+ color: #093;
+ font-style: normal;
+ font-family: arial,sans-serif;
+}
+
+div.oktavia_searchresult .entry .resultcontent {
+ font-size: small;
+ font-family: arial,sans-serif;
+ color: #222;
+}
+
+div.oktavia_searchresult .entry .resultcontent .hit {
+ font-weight: bolder;
+ text-decoration: underline;
+}
+
+div.oktavia_searchresult .proposal {
+ margin: 10px 10px 10px 10px;
+ color: #222;
+ font-size: small;
+ font-family: arial,sans-serif;
+}
+
+div.oktavia_searchresult .proposal .option {
+ background-color: #e8f4ff;
+ border-bottom: 1px solid blue;
+}
+
+div.oktavia_searchresult .proposal .option:hover {
+ background-color: #d1e8ff;
+}
+
+div.oktavia_searchresult .proposal .option:active {
+ background-color: #b4c8db;
+}
+
+div.oktavia_searchresult_nav span.leader {
+ color: #228;
+}
+
+div.oktavia_searchresult_nav span.page {
+ background-color: #ffffff;
+ border: 1px solid #888888;
+ padding: 5px;
+ margin: 5px;
+ color: #222;
+}
+
+div.oktavia_searchresult_nav span.page:hover {
+ background-color: #d1e8ff;
+ border: 1px solid #7d98ff;
+}
+
+div.oktavia_searchresult_nav span.page:active {
+ background-color: #b4c8db;
+ border: 1px solid #6c83db;
+}
+
+div.oktavia_searchresult_nav span.selected {
+ background-color: #b4c8db;
+ border: 1px solid #6c83db;
+}
+
+div.oktavia_searchresult_nav span.selected:hover {
+ background-color: #b4c8db;
+ border: 1px solid #6c83db;
+}
+
+div.oktavia_searchresult_nav span.selected:active {
+ background-color: #b4c8db;
+ border: 1px solid #6c83db;
+}
+
+div.oktavia_searchresult_box span.pr {
+ position: absolute;
+ right: 10px;
+ bottom: 10px;
+ color: #555;
+}
+
+.highlighted {
+ background-color: #fbe54e;
+}
diff --git a/web/server/h2o/libh2o/misc/oktavia/templates/sphinx/_templates/layout.html b/web/server/h2o/libh2o/misc/oktavia/templates/sphinx/_templates/layout.html
new file mode 100644
index 00000000..bb36ee1f
--- /dev/null
+++ b/web/server/h2o/libh2o/misc/oktavia/templates/sphinx/_templates/layout.html
@@ -0,0 +1,12 @@
+{% extends "!layout.html" %}
+
+{% block sidebarlogo %}
+{{ super() }}
+<div class="sidebarRow">
+ <script type="text/javascript" src="{{ pathto("_static/oktavia-search.js", 1) }}"></script>
+ <script type="text/javascript" src="{{ pathto("_static/oktavia-jquery-ui.js", 1) }}"></script>
+ <link rel="stylesheet" href="{{ pathto("_static/searchstyle.css", 1) }}" type="text/css" />
+ <h3>Search by Oktavia</h3>
+ <div id="oktavia_search_form" data-index="search/searchindex.js"></div>
+</div>
+{% endblock %}
diff --git a/web/server/h2o/libh2o/misc/oktavia/templates/sphinx/_templates/searchbox.html b/web/server/h2o/libh2o/misc/oktavia/templates/sphinx/_templates/searchbox.html
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/web/server/h2o/libh2o/misc/oktavia/templates/sphinx/_templates/searchbox.html
diff --git a/web/server/h2o/libh2o/misc/oktavia/templates/tinkerer/_static/oktavia-jquery-ui.js b/web/server/h2o/libh2o/misc/oktavia/templates/tinkerer/_static/oktavia-jquery-ui.js
new file mode 100644
index 00000000..bd1efb8c
--- /dev/null
+++ b/web/server/h2o/libh2o/misc/oktavia/templates/tinkerer/_static/oktavia-jquery-ui.js
@@ -0,0 +1,521 @@
+/**
+ * @fileOverview
+ * A UI script that creates search form, loads an index files and show search results.
+ * It needs jQuery and <tt>oktavia-search.js</tt> or <tt>oktavia-*-search.js</tt>
+ * (stemming library supported versions).
+ * @author Yoshiki Shibukawa, yoshiki@shibu.jp
+ */
+
+(function ($)
+{
+ var logosrc;
+ /**
+ * @name SearchView
+ * @class
+ * Provides searching feature to your website.
+ * @constructor
+ * @param {jQeury} node Target node it has a search form and a search result window.
+ * @param {string} documentRoot Document root folder like '.', '../', '/'
+ * @param {string} index Index file path.
+ */
+ function SearchView(node, documentRoot, index)
+ {
+ var OktaviaSearch = JSX.require("tool/web/oktavia-search.jsx").OktaviaSearch$I;
+
+ /**
+ * Target node it contains a search form and a search result window.
+ * @type jQuery
+ */
+ this.node = node;
+ /**
+ * Search engine core
+ * @type OktaviaSearch
+ */
+ this.engine = new OktaviaSearch(5);
+ if (documentRoot === '')
+ {
+ /**
+ * Document root path
+ * @type string[]
+ */
+ this.documentRoot = [];
+ }
+ else if (documentRoot.slice(-1) === '/')
+ {
+ this.documentRoot = documentRoot.slice(0, -1).split(/\//g);
+ }
+ else
+ {
+ this.documentRoot = documentRoot.split(/\//g);
+ }
+
+ /**
+ * It is true if an index file is loaded.
+ * @type boolean
+ */
+ this.initialized = false;
+ /**
+ * It is true if an user search before loading an index.
+ * @type boolean
+ */
+ this.reserveSearch = false;
+
+ var indexURL;
+ switch (index.charAt(0))
+ {
+ case '.':
+ case '/':
+ indexURL = index;
+ break;
+ default:
+ indexURL = this.getDocumentPath(index);
+ break;
+ }
+ var self = this;
+ function loadIndex()
+ {
+ self.engine.loadIndex$S(window.searchIndex);
+ self.initialized = true;
+ window.searchIndex = null;
+ if (self.reserveSearch)
+ {
+ self.search();
+ }
+ self.reserveSearch = false;
+ }
+ if (window.searchIndex)
+ {
+ loadIndex()
+ }
+ else
+ {
+ this.loadJavaScript(indexURL, loadIndex);
+ }
+ }
+
+ /**
+ * Changes result page.
+ * @param {integer} page Page number
+ * @memberOf SearchView.prototype
+ * @method
+ */
+ SearchView.prototype.changePage = function (page)
+ {
+ this.engine.setCurrentPage$I(page);
+ this.updateResult();
+ };
+
+ /**
+ * Clears a search form and a reult window.
+ * @memberOf SearchView.prototype
+ * @method
+ */
+ SearchView.prototype.clearResult = function ()
+ {
+ $('.oktavia_search', this.node).val('');
+ $('.oktavia_searchresult_box', this.node).hide();
+ };
+
+ /**
+ * Loads an external JavaScript file.
+ *
+ * This code is based on: http://os0x.hatenablog.com/entry/20080827/1219815828
+ * @param {string} src A JavaScript source file path
+ * @param {function} callback It is called when the target JavaScript file is loaded
+ * @memberOf SearchView.prototype
+ * @method
+ */
+ SearchView.prototype.loadJavaScript = function (src, callback)
+ {
+ var sc = document.createElement('script');
+ sc.type = 'text/javascript';
+ if (window.ActiveXObject)
+ {
+ sc.onreadystatechange = function ()
+ {
+ if (sc.readyState === 'complete' || sc.readyState === 'loaded')
+ {
+ callback(sc.readyState);
+ }
+ };
+ }
+ else
+ {
+ sc.onload = function ()
+ {
+ callback('onload');
+ };
+ }
+ sc.src = src;
+ document.body.appendChild(sc);
+ };
+
+ /**
+ * Updates page navigation list.
+ * @memberOf SearchView.prototype
+ * @method
+ */
+ SearchView.prototype.updatePageList = function ()
+ {
+ var self = this;
+ function createCallback(i)
+ {
+ return function () {
+ self.changePage(i);
+ };
+ }
+
+ var currentPage = String(this.engine.currentPage$());
+ var nav = $('.oktavia_searchresult_nav', this.node);
+ nav.empty();
+ var pages = this.engine.pageIndexes$();
+ for (var i = 0; i < pages.length; i++)
+ {
+ var pageItem = $('<span/>').text(pages[i]);
+ if (pages[i] === '...')
+ {
+ pageItem.addClass('leader');
+ }
+ else
+ {
+ pageItem.addClass('page');
+ if (pages[i] !== currentPage)
+ {
+ pageItem.bind('click', createCallback(Number(pages[i])));
+ }
+ else
+ {
+ pageItem.addClass('selected');
+ }
+ }
+ nav.append(pageItem);
+ }
+ };
+
+ /**
+ * Updates result list in a result window.
+ * @memberOf SearchView.prototype
+ * @method
+ */
+ SearchView.prototype.updateResult = function ()
+ {
+ var totalPages = this.engine.totalPages$();
+ var resultslot = $('.oktavia_searchresult', this.node);
+ resultslot.empty();
+ var self = this;
+ function clearCallback()
+ {
+ self.clearResult();
+ }
+ var results = this.engine.getResult$();
+ var searchInput = $('.oktavia_search', this.node);
+ var queryWord = searchInput.val()
+ for (var i = 0; i < results.length; i++)
+ {
+ var result = results[i];
+ var url = this.getDocumentPath(result.url.slice(1))
+ var entry = $('<div/>', { "class": "entry" });
+ var link = $('<a/>', { "href": url + this.engine.getHighlight$() }).text(result.title);
+ link.bind('click', clearCallback);
+ entry.append($('<div/>', { "class": "title" }).append(link));
+ entry.append($('<div/>', { "class": "url" }).text(url));
+ entry.append($('<div/>', { "class": "resultcontent" }).html(result.content));
+ resultslot.append(entry);
+ }
+ this.updatePageList();
+ };
+
+ /**
+ * Searchs again by using proposal search words.
+ * @param {string} option Proposal search words
+ * @memberOf SearchView.prototype
+ * @method
+ */
+ SearchView.prototype.searchProposal = function (option)
+ {
+ $('.oktavia_search', this.node).val(option);
+ this.search();
+ };
+
+ /**
+ * Shows proposals when no result.
+ * @memberOf SearchView.prototype
+ * @method
+ */
+ SearchView.prototype.updateProposal = function ()
+ {
+ var nav = $('.oktavia_searchresult_nav', this.node);
+ var resultslot = $('.oktavia_searchresult', this.node);
+ nav.empty();
+ resultslot.empty();
+ var proposals = this.engine.getProposals$();
+ var self = this;
+ function createCallback(option)
+ {
+ return function ()
+ {
+ self.searchProposal(option);
+ };
+ }
+ for (var i = 0; i < proposals.length; i++)
+ {
+ var proposal = proposals[i];
+ var listitem = $('<div/>', {"class": "proposal"});
+ listitem.append('<span>Search with:&nbsp;</span>');
+ var option = $('<span/>', {"class": "option"});
+ option.html(proposal.label);
+ option.bind('click', createCallback(proposal.options));
+ listitem.append(option);
+ listitem.append('<span>&nbsp;&#x2192;&nbsp;' + proposal.count + ' results.</span>');
+ resultslot.append(listitem);
+ }
+ };
+
+ /**
+ * Performs search and shows results.
+ * @memberOf SearchView.prototype
+ * @method
+ */
+ SearchView.prototype.search = function ()
+ {
+ if (!this.initialized)
+ {
+ this.reserveSearch = true;
+ return;
+ }
+ var searchInput = $('.oktavia_search', this.node);
+ var queryWord = searchInput.val();
+ searchInput.blur();
+ var self = this;
+ this.engine.search$SF$IIV$(queryWord, function (total, pages)
+ {
+ $('.oktavia_searchresult_box', self.node).fadeIn();
+ var summaryNode = $('.oktavia_searchresult_summary', self.node);
+ if (total === 0)
+ {
+ summaryNode.text("No result.");
+ self.updateProposal();
+ }
+ else
+ {
+ summaryNode.text(total + ' results.');
+ self.updateResult();
+ }
+ });
+ };
+
+ /**
+ * Converts file path in index.
+ * @param {string} filePath Source filepath
+ * @returns {string} Result filepath
+ * @memberOf SearchView.prototype
+ * @method
+ */
+ SearchView.prototype.getDocumentPath = function (filePath)
+ {
+ var resultFilePath;
+ if (filePath.charAt(0) === '/')
+ {
+ resultFilePath = filePath;
+ }
+ else
+ {
+ var elements = filePath.split(/\//g);
+ var result = this.documentRoot.slice();
+ for (var i = 0; i < elements.length; i++)
+ {
+ var element = elements[i];
+ switch (element)
+ {
+ case '.':
+ break;
+ case '..':
+ result = result.slice(0, -1);
+ break;
+ default:
+ result.push(element);
+ break;
+ }
+ }
+ resultFilePath = result.join('/');
+ }
+ return resultFilePath;
+ };
+
+ /**
+ * Hides all result windows.
+ * @function
+ */
+ function eraseResultWindow()
+ {
+ $('.oktavia_searchresult_box:visible').hide();
+ }
+
+ /**
+ * jQuery plug-in to create search form and window.
+ * It can receive options from data attributes or an <tt>option</tt> parameter.
+ * @param {object} [option] Option
+ * @param {string} [option.index='search/searchindex.js'] Index file path.
+ * @param {string} [option.documentRoot='.'] Document root folder.
+ * @param {string} [option.logo='true'] Show logo in result windows. <tt>'false'</tt> or <tt>'disable'</tt> or falsy value disable logo.
+ * @name oktaviaSearch
+ * @function
+ */
+ jQuery.fn.oktaviaSearch = function (option)
+ {
+ var data = {
+ 'index': 'search/searchindex.js',
+ 'documentRoot': '.',
+ 'logo': 'true'
+ };
+ if (window.DOCUMENTATION_OPTIONS) // Sphinx
+ {
+ if (window.DOCUMENTATION_OPTIONS.URL_ROOT === '#')
+ {
+ data.documentRoot = '';
+ }
+ else
+ {
+ data.documentRoot = window.DOCUMENTATION_OPTIONS.URL_ROOT;
+ }
+ }
+ var userData = this.data();
+ var key;
+ for (key in userData)
+ {
+ if (userData.hasOwnProperty(key))
+ {
+ data[key] = userData[key];
+ }
+ }
+ for (key in option)
+ {
+ if (option.hasOwnProperty(key))
+ {
+ data[key] = option[key];
+ }
+ }
+ if (data.logo === 'false' || data.logo === 'disable' || !data.logo)
+ {
+ data.logo = false;
+ }
+ else
+ {
+ data.logo = true;
+ }
+ var view = new SearchView(this, data.documentRoot, data.index);
+
+ var form = $('<form class="oktavia_form"><input class="oktavia_search" result="10" type="search" name="search" value="" placeholder="Search" /></form>');
+ form.submit(function (event) {
+ event.stopPropagation();
+ setTimeout(function () {
+ view.search();
+ }, 10);
+ return false;
+ });
+ this.append(form);
+ var resultForm = $([
+ '<div class="oktavia_searchresult_box">',
+ '<div class="oktavia_close_search_box">&times;</div>',
+ '<div class="oktavia_searchresult_summary"></div>',
+ '<div class="oktavia_searchresult"></div>',
+ '<div class="oktavia_searchresult_nav"></div>',
+ '</div>'
+ ].join(''));
+ if (data.logo)
+ {
+ resultForm.append($('<span class="pr">Powered by <a href="http://oktavia.info"><img src="' + logosrc + '" width="86px" height="25px" alt="Oktavia"></img></a></span>'));
+ }
+ this.append(resultForm);
+ $('.oktavia_close_search_box', this.node).bind('click', function (event) {
+ view.clearResult();
+ });
+
+ // Click outside of the result window, close it
+ resultForm.bind('click', function (event) {
+ event.stopPropagation();
+ });
+ };
+
+ /**
+ * Global initailization.
+ * It add some event handlers.
+ * @name initialize
+ * @function
+ */
+ function initialize()
+ {
+
+ function onClick() {
+ eraseResultWindow();
+ return true;
+ }
+ function onKeyDown(event)
+ {
+ switch (event.keyCode)
+ {
+ case 191: // / : focus form
+ eraseResultWindow();
+ var form = $('form.oktavia_form:first input.search');
+ if ($(':focus', form).size() === 0)
+ {
+ form.focus();
+ }
+ break;
+ case 74: // j : down
+ case 75: // k : up
+ case 72: // h : before page
+ case 76: // l : next page
+ case 13: // enter : select
+ var result = $('.oktavia_searchresult_box:visible:first');
+ if (result.size() === 1)
+ {
+ switch (event.keyCode)
+ {
+ case 74: // j : down
+ console.log('down');
+ break;
+ case 75: // k : up
+ console.log('up');
+ break;
+ case 72: // h : before page
+ console.log('before');
+ break;
+ case 76: // l : next page
+ console.log('next');
+ break;
+ case 13: // enter : select
+ console.log('select');
+ break;
+ }
+ }
+ break;
+ }
+ return true;
+ }
+ var version = $.fn.jquery.split(/\./g);
+ var major = Number(version[0]);
+ var minor = Number(version[1]);
+ if (major === 1 && minor < 7)
+ {
+ $(document).live('click', onClick);
+ $(document).live('keydown', onKeyDown);
+ }
+ else
+ {
+ $(document).on('click', onClick);
+ $(document).on('keydown', onKeyDown);
+ }
+ }
+
+ var logosrc = "data:image/jpeg;base64, /9j/4AAQSkZJRgABAQEASABIAAD/4ge4SUNDX1BST0ZJTEUAAQEAAAeoYXBwbAIgAABtbnRyUkdCIFhZWiAH2QACABkACwAaAAthY3NwQVBQTAAAAABhcHBsAAAAAAAAAAAAAAAAAAAAAAAA9tYAAQAAAADTLWFwcGwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAtkZXNjAAABCAAAAG9kc2NtAAABeAAABWxjcHJ0AAAG5AAAADh3dHB0AAAHHAAAABRyWFlaAAAHMAAAABRnWFlaAAAHRAAAABRiWFlaAAAHWAAAABRyVFJDAAAHbAAAAA5jaGFkAAAHfAAAACxiVFJDAAAHbAAAAA5nVFJDAAAHbAAAAA5kZXNjAAAAAAAAABRHZW5lcmljIFJHQiBQcm9maWxlAAAAAAAAAAAAAAAUR2VuZXJpYyBSR0IgUHJvZmlsZQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAbWx1YwAAAAAAAAAeAAAADHNrU0sAAAAoAAABeGhySFIAAAAoAAABoGNhRVMAAAAkAAAByHB0QlIAAAAmAAAB7HVrVUEAAAAqAAACEmZyRlUAAAAoAAACPHpoVFcAAAAWAAACZGl0SVQAAAAoAAACem5iTk8AAAAmAAAComtvS1IAAAAWAAACyGNzQ1oAAAAiAAAC3mhlSUwAAAAeAAADAGRlREUAAAAsAAADHmh1SFUAAAAoAAADSnN2U0UAAAAmAAAConpoQ04AAAAWAAADcmphSlAAAAAaAAADiHJvUk8AAAAkAAADomVsR1IAAAAiAAADxnB0UE8AAAAmAAAD6G5sTkwAAAAoAAAEDmVzRVMAAAAmAAAD6HRoVEgAAAAkAAAENnRyVFIAAAAiAAAEWmZpRkkAAAAoAAAEfHBsUEwAAAAsAAAEpHJ1UlUAAAAiAAAE0GFyRUcAAAAmAAAE8mVuVVMAAAAmAAAFGGRhREsAAAAuAAAFPgBWAWEAZQBvAGIAZQBjAG4A/QAgAFIARwBCACAAcAByAG8AZgBpAGwARwBlAG4AZQByAGkBDQBrAGkAIABSAEcAQgAgAHAAcgBvAGYAaQBsAFAAZQByAGYAaQBsACAAUgBHAEIAIABnAGUAbgDoAHIAaQBjAFAAZQByAGYAaQBsACAAUgBHAEIAIABHAGUAbgDpAHIAaQBjAG8EFwQwBDMEMAQ7BEwEPQQ4BDkAIAQ/BEAEPgREBDAEOQQ7ACAAUgBHAEIAUAByAG8AZgBpAGwAIABnAOkAbgDpAHIAaQBxAHUAZQAgAFIAVgBCkBp1KAAgAFIARwBCACCCcl9pY8+P8ABQAHIAbwBmAGkAbABvACAAUgBHAEIAIABnAGUAbgBlAHIAaQBjAG8ARwBlAG4AZQByAGkAcwBrACAAUgBHAEIALQBwAHIAbwBmAGkAbMd8vBgAIABSAEcAQgAg1QS4XNMMx3wATwBiAGUAYwBuAP0AIABSAEcAQgAgAHAAcgBvAGYAaQBsBeQF6AXVBeQF2QXcACAAUgBHAEIAIAXbBdwF3AXZAEEAbABsAGcAZQBtAGUAaQBuAGUAcwAgAFIARwBCAC0AUAByAG8AZgBpAGwAwQBsAHQAYQBsAOEAbgBvAHMAIABSAEcAQgAgAHAAcgBvAGYAaQBsZm6QGgAgAFIARwBCACBjz4/wZYdO9k4AgiwAIABSAEcAQgAgMNcw7TDVMKEwpDDrAFAAcgBvAGYAaQBsACAAUgBHAEIAIABnAGUAbgBlAHIAaQBjA5MDtQO9A7kDugPMACADwAPBA78DxgOvA7sAIABSAEcAQgBQAGUAcgBmAGkAbAAgAFIARwBCACAAZwBlAG4A6QByAGkAYwBvAEEAbABnAGUAbQBlAGUAbgAgAFIARwBCAC0AcAByAG8AZgBpAGUAbA5CDhsOIw5EDh8OJQ5MACAAUgBHAEIAIA4XDjEOSA4nDkQOGwBHAGUAbgBlAGwAIABSAEcAQgAgAFAAcgBvAGYAaQBsAGkAWQBsAGUAaQBuAGUAbgAgAFIARwBCAC0AcAByAG8AZgBpAGkAbABpAFUAbgBpAHcAZQByAHMAYQBsAG4AeQAgAHAAcgBvAGYAaQBsACAAUgBHAEIEHgQxBEkEOAQ5ACAEPwRABD4ERAQ4BDsETAAgAFIARwBCBkUGRAZBACAGKgY5BjEGSgZBACAAUgBHAEIAIAYnBkQGOQYnBkUARwBlAG4AZQByAGkAYwAgAFIARwBCACAAUAByAG8AZgBpAGwAZQBHAGUAbgBlAHIAZQBsACAAUgBHAEIALQBiAGUAcwBrAHIAaQB2AGUAbABzAGV0ZXh0AAAAAENvcHlyaWdodCAyMDA3IEFwcGxlIEluYy4sIGFsbCByaWdodHMgcmVzZXJ2ZWQuAFhZWiAAAAAAAADzUgABAAAAARbPWFlaIAAAAAAAAHRNAAA97gAAA9BYWVogAAAAAAAAWnUAAKxzAAAXNFhZWiAAAAAAAAAoGgAAFZ8AALg2Y3VydgAAAAAAAAABAc0AAHNmMzIAAAAAAAEMQgAABd7///MmAAAHkgAA/ZH///ui///9owAAA9wAAMBs/+EAgEV4aWYAAE1NACoAAAAIAAUBEgADAAAAAQABAAABGgAFAAAAAQAAAEoBGwAFAAAAAQAAAFIBKAADAAAAAQACAACHaQAEAAAAAQAAAFoAAAAAAAAASAAAAAEAAABIAAAAAQACoAIABAAAAAEAAABWoAMABAAAAAEAAAAYAAAAAP/bAEMAAgICAgIBAgICAgICAgMDBgQDAwMDBwUFBAYIBwgICAcICAkKDQsJCQwKCAgLDwsMDQ4ODg4JCxARDw4RDQ4ODv/bAEMBAgICAwMDBgQEBg4JCAkODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODv/AABEIABgAVgMBIgACEQEDEQH/xAAfAAABBQEBAQEBAQAAAAAAAAAAAQIDBAUGBwgJCgv/xAC1EAACAQMDAgQDBQUEBAAAAX0BAgMABBEFEiExQQYTUWEHInEUMoGRoQgjQrHBFVLR8CQzYnKCCQoWFxgZGiUmJygpKjQ1Njc4OTpDREVGR0hJSlNUVVZXWFlaY2RlZmdoaWpzdHV2d3h5eoOEhYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3uLm6wsPExcbHyMnK0tPU1dbX2Nna4eLj5OXm5+jp6vHy8/T19vf4+fr/xAAfAQADAQEBAQEBAQEBAAAAAAAAAQIDBAUGBwgJCgv/xAC1EQACAQIEBAMEBwUEBAABAncAAQIDEQQFITEGEkFRB2FxEyIygQgUQpGhscEJIzNS8BVictEKFiQ04SXxFxgZGiYnKCkqNTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqCg4SFhoeIiYqSk5SVlpeYmZqio6Slpqeoqaqys7S1tre4ubrCw8TFxsfIycrS09TV1tfY2dri4+Tl5ufo6ery8/T19vf4+fr/2gAMAwEAAhEDEQA/AP3571+dfjn4ofEz4+/tjeJPg38JPE+peAfh/wCE9Q/szxJ4g0namo6xqCoss9tBM6sLe2gRlEkqqXLNtXnFfooa/Lj9jvU7PwH+3T+0D8J/E00Vt4usvHOs3MfmsAbqDUbmO+tp1J6qyN5ZPZkCnqBTQG7pnwW1VP2lde8FfB74qfF3R/E3hrT459f8Val4xutRsIryVd8Nq1ncGRZlYD5zlSoPHTBufD39oH4y+F9H8Xaj8Ur2w8SxeCvES6P4+0tLBIbzSklI8m/t5IwFmt2BBwVB/PI9Z+DOtWfhn/goR+0p8P8AxDcw6f4j1XV7bxLo0dw4U3+nyWwQvHk/MI3RlbH3a+SvG/jnRdbi/bY+JOkyJc+HvF0mm+BvBoiGf+Eh1OGPy3a2H/LUBnHzLkYXNfa0KNGnmlDCxpKVOpGmndXb5knKSb1i7t2cbWtrfW/w+IjiK2WVsRKu41ISm42dlGzajFpWUlZK6le921bS36G+GPHWq61+2r4+8I/2jFdeGdO8N6Xf6fEkKja1wZdz7wNzBgq8E4Fcr8T/ANpDwX4U0bw63hzxb4P1S5vPE8Gm3zveCRLW2WULdzDacHyhwxzhSwJz0Pxp430f4ww/H74qeEvABimudH+FHhxvFdvFcvDqGoW8KSCSztJFB2STBZlL9QFwOWr2L4k+IPh1r/7Fn7MuufDG00638E3XxJ8Pw6dbQQqPsymdlkgcdQ6uCrg8lgc5r1P7EwEcVhqk1zRlyK0bJL92neWm8nqu9m7nl1MzzN4PE0oS5Jpzd5Xb1ntHXaK0v00SXU+s9e+M/wAKfDGg6NqevfEDwrpljq9st1pckt8v+lwtyssYGSyH+8Bj3rQ0v4o/DrW7Hw/daR408OajBrl09ppElveowu50Xc0SY6yBeSvXHavmb/hIr7Uv22vivD8EvhJoXirxTpP2LTPFfibxX4ke0s7aRYQ8VpawiKVgqo4ZtiopJzyea+e7PQfFGteEv2tLyxh8Op8QPAXjrTfE+nW3htX+xLfWtos00UO7DfPGJImJAJYtx2rzcNw5g6tP35ODtF6uL+NpK8VrFJyTu3qleyvp6tfPsxp1PdhGSvJaKS+FNu0no20mrJWTduZ21/Rf4l6/d6N8PWtNC8UeF/C/jLU3Nv4cfXojLb3NyqmTyjGrKzAqrZKnKj5sHGD5j4L8W6fZfC6y+M3xg+IHguN9UQjSxY6iP7G0qFiR5Fs7HNxM2DvmILNgqoVBg+X6B4vsPj9+14vjbQ5xdeB/AXgBbq0kVt0b6tq1uZCPTfDbAA9wZe1eNfCXxXp9x8Ev2UdE8N/DhfiX8Xl8F3uq6PFqet/YdL0qzM5iluZiVcNIWwi7Y2Yc4IzzyUuFaLSlVlLnjbmjdJK8aklrKyWkY3b25no2kj13xhjIUKlCjThySb5Z8rcnZwi0mtWm3L3Vvy7pSlf9C/BnxO+H3xE+2f8ACEeMNB8TPaAG6isboPJCD0LJ94A+uMUV8JaxqPjex/4KWaZ/wmlh4A8NeJrr4bXUslp4Su5pdsI1C1VPtErpGXcndtwgAAPWisswyGlTlB0p6SSfR2+asntvZHDg+Iq/LKNan7ybV1dX+Tu16XZyPjX4k/tYftcfF/xR8Kvgh4b1/wDZ7+EOkanc6R4p8f8AiK2e31O6khkMcsVqqsGUHBwIW3FWy00BG1vWrX/gnT8EtJ+DfhvS/Dmq+NfDPxL0dnmT4m6dfKuvXs8mDI10zKY54jhQIXUqiqoXGM0UV8wfXC6h+xb418baxpK/Fv8Aad+IHjrRtOt5LSOKy8PadpV9PbyAeZDJexRmYI+BuCFc4x0yD6x8Lv2Pfgl8J/GOleINE0rX9e1jSQ40WfxHrM2oJpW8kubWJz5ULMScuqBj60UV00sdiKUXGE2k1Z2fTt6eRhPC0Zu8op9fn39dD2fTfhx4Y0r9oPxP8TrOG9XxXr+mWmnajK92zRNDamQwhYz8qkGR8kcnPPQV5ZqX7Kvwh1L4deMfCbWHiGx0HxF4lTxJLaWOuTwLp+pK277TZ7WH2Zi3JVMKTnjk0UVdLMsXTlzQqNPTq/s/D93TsKeEozVpRT3/AB3+8zT+yX8OIfEY1nSPEvxc8N6xPpdvp+sX2keOL22n1tIF2JJeOrZmn28GbIkOBluK9C+G/wADPhv8Jtc8WXngTR7nR4vEa2/9qWbX0s9vI0KMgkCSFsSOGYyPnMjEsxJ5ooq62bY2rBwnVk09GrvW21/Syt2M45fhozU1BXXWxL8MPgl8Pfg98LtY8H+A9KuNM0TU7+e9vElu3mkaSZQrYdiSFVQqqvRQABXAT/snfCj/AIQX4daNpD+NfC134GspLHw5rmh+JLi01O3tpGLPA86nMsbE5KuGFFFEc1xiqSqKrLmk7t3ers1r30bXo2U8Fh3BQ5FZdLfMS3/ZL+Elp4qtvEUA8aHxWtrPbXmvz+JrqfUNRSWSJ2+0zSMxlwYUCZ4RQVUKCRRRRTnm+Nl8VVv1ZCy3CramvuP/2Q==";
+ initialize();
+})(jQuery);
+
+jQuery(document).ready(function () {
+ var form = jQuery('#oktavia_search_form');
+ if (form.size() > 0)
+ {
+ form.oktaviaSearch();
+ }
+});
diff --git a/web/server/h2o/libh2o/misc/oktavia/templates/tinkerer/_static/oktavia-search.js b/web/server/h2o/libh2o/misc/oktavia/templates/tinkerer/_static/oktavia-search.js
new file mode 100644
index 00000000..fce9732a
--- /dev/null
+++ b/web/server/h2o/libh2o/misc/oktavia/templates/tinkerer/_static/oktavia-search.js
@@ -0,0 +1,6795 @@
+// generatedy by JSX compiler 0.9.24 (2013-04-05 13:45:00 +0900; 1b229cc6a411f674f0f7cf7a79b7a8b3f8eb7414)
+var JSX = {};
+(function (JSX) {
+/**
+ * copies the implementations from source interface to target
+ */
+function $__jsx_merge_interface(target, source) {
+ for (var k in source.prototype)
+ if (source.prototype.hasOwnProperty(k))
+ target.prototype[k] = source.prototype[k];
+}
+
+/**
+ * defers the initialization of the property
+ */
+function $__jsx_lazy_init(obj, prop, func) {
+ function reset(obj, prop, value) {
+ delete obj[prop];
+ obj[prop] = value;
+ return value;
+ }
+
+ Object.defineProperty(obj, prop, {
+ get: function () {
+ return reset(obj, prop, func());
+ },
+ set: function (v) {
+ reset(obj, prop, v);
+ },
+ enumerable: true,
+ configurable: true
+ });
+}
+
+/**
+ * sideeffect().a /= b
+ */
+function $__jsx_div_assign(obj, prop, divisor) {
+ return obj[prop] = (obj[prop] / divisor) | 0;
+}
+
+/*
+ * global functions, renamed to avoid conflict with local variable names
+ */
+var $__jsx_parseInt = parseInt;
+var $__jsx_parseFloat = parseFloat;
+var $__jsx_isNaN = isNaN;
+var $__jsx_isFinite = isFinite;
+
+var $__jsx_encodeURIComponent = encodeURIComponent;
+var $__jsx_decodeURIComponent = decodeURIComponent;
+var $__jsx_encodeURI = encodeURI;
+var $__jsx_decodeURI = decodeURI;
+
+var $__jsx_ObjectToString = Object.prototype.toString;
+var $__jsx_ObjectHasOwnProperty = Object.prototype.hasOwnProperty;
+
+/*
+ * profiler object, initialized afterwards
+ */
+function $__jsx_profiler() {
+}
+
+/*
+ * public interface to JSX code
+ */
+JSX.require = function (path) {
+ var m = $__jsx_classMap[path];
+ return m !== undefined ? m : null;
+};
+
+JSX.profilerIsRunning = function () {
+ return $__jsx_profiler.getResults != null;
+};
+
+JSX.getProfileResults = function () {
+ return ($__jsx_profiler.getResults || function () { return {}; })();
+};
+
+JSX.postProfileResults = function (url, cb) {
+ if ($__jsx_profiler.postResults == null)
+ throw new Error("profiler has not been turned on");
+ return $__jsx_profiler.postResults(url, cb);
+};
+
+JSX.resetProfileResults = function () {
+ if ($__jsx_profiler.resetResults == null)
+ throw new Error("profiler has not been turned on");
+ return $__jsx_profiler.resetResults();
+};
+JSX.DEBUG = false;
+/**
+ * class _Result extends Object
+ * @constructor
+ */
+function _Result() {
+}
+
+/**
+ * @constructor
+ * @param {!string} title
+ * @param {!string} url
+ * @param {!string} content
+ * @param {!number} score
+ */
+function _Result$SSSI(title, url, content, score) {
+ this.title = title;
+ this.url = url;
+ this.content = content;
+ this.score = score;
+};
+
+_Result$SSSI.prototype = new _Result;
+
+/**
+ * class _Proposal extends Object
+ * @constructor
+ */
+function _Proposal() {
+}
+
+/**
+ * @constructor
+ * @param {!string} options
+ * @param {!string} label
+ * @param {!number} count
+ */
+function _Proposal$SSI(options, label, count) {
+ this.options = options;
+ this.label = label;
+ this.count = count;
+};
+
+_Proposal$SSI.prototype = new _Proposal;
+
+/**
+ * class OktaviaSearch extends Object
+ * @constructor
+ */
+function OktaviaSearch() {
+}
+
+/**
+ * @constructor
+ * @param {!number} entriesPerPage
+ */
+function OktaviaSearch$I(entriesPerPage) {
+ this._queries = null;
+ this._highlight = "";
+ this._result = null;
+ this._proposals = null;
+ this._currentFolderDepth = 0;
+ this._oktavia = new Oktavia$();
+ this._entriesPerPage = entriesPerPage;
+ this._currentPage = 1;
+ this._queryString = null;
+ this._callback = null;
+ OktaviaSearch._instance = this;
+};
+
+OktaviaSearch$I.prototype = new OktaviaSearch;
+
+/**
+ * @param {Stemmer} stemmer
+ */
+OktaviaSearch.setStemmer$LStemmer$ = function (stemmer) {
+ /** @type {Oktavia} */
+ var this$0;
+ if (OktaviaSearch._instance) {
+ this$0 = OktaviaSearch._instance._oktavia;
+ this$0._stemmer = stemmer;
+ } else {
+ OktaviaSearch._stemmer = stemmer;
+ }
+};
+
+var OktaviaSearch$setStemmer$LStemmer$ = OktaviaSearch.setStemmer$LStemmer$;
+
+/**
+ * @param {!string} index
+ */
+OktaviaSearch.prototype.loadIndex$S = function (index) {
+ /** @type {Oktavia} */
+ var this$0;
+ /** @type {Stemmer} */
+ var stemmer$0;
+ if (OktaviaSearch._stemmer) {
+ this$0 = this._oktavia;
+ stemmer$0 = OktaviaSearch._stemmer;
+ this$0._stemmer = stemmer$0;
+ }
+ this._oktavia.load$S(Binary$base64decode$S(index));
+ if (this._queryString) {
+ this.search$SF$IIV$(this._queryString, this._callback);
+ this._queryString = null;
+ this._callback = null;
+ }
+};
+
+/**
+ * @param {!string} queryString
+ * @param {*} callback
+ */
+OktaviaSearch.prototype.search$SF$IIV$ = function (queryString, callback) {
+ /** @type {QueryStringParser} */
+ var queryParser;
+ /** @type {SearchSummary} */
+ var summary;
+ /** @type {Array.<undefined|SearchUnit>} */
+ var _result$0;
+ if (this._oktavia) {
+ queryParser = ({queries: [ ]});
+ this._queries = QueryStringParser$parse$LQueryStringParser$S(queryParser, queryString);
+ this._highlight = QueryStringParser$highlight$LQueryStringParser$(queryParser);
+ summary = this._oktavia.search$ALQuery$(this._queries);
+ if (SearchSummary$size$LSearchSummary$(summary) > 0) {
+ this._result = this._sortResult$LSearchSummary$(summary);
+ this._proposals = [ ];
+ this._currentPage = 1;
+ } else {
+ this._result = [ ];
+ if (this._queries.length > 1) {
+ this._proposals = SearchSummary$getProposal$LSearchSummary$(summary);
+ } else {
+ this._proposals = [ ];
+ }
+ this._currentPage = 1;
+ }
+ callback((_result$0 = this._result).length, Math.ceil(_result$0.length / this._entriesPerPage));
+ } else {
+ this._queryString = queryString;
+ this._callback = callback;
+ }
+};
+
+/**
+ * @return {!number}
+ */
+OktaviaSearch.prototype.resultSize$ = function () {
+ return (this._result.length | 0);
+};
+
+/**
+ * @return {!number}
+ */
+OktaviaSearch.prototype.totalPages$ = function () {
+ return (Math.ceil(this._result.length / this._entriesPerPage) | 0);
+};
+
+/**
+ * @return {!number}
+ */
+OktaviaSearch.prototype.currentPage$ = function () {
+ return this._currentPage;
+};
+
+/**
+ * @param {!number} page
+ */
+OktaviaSearch.prototype.setCurrentPage$I = function (page) {
+ this._currentPage = page;
+};
+
+/**
+ * @return {!boolean}
+ */
+OktaviaSearch.prototype.hasPrevPage$ = function () {
+ return this._currentPage !== 1;
+};
+
+/**
+ * @return {!boolean}
+ */
+OktaviaSearch.prototype.hasNextPage$ = function () {
+ return this._currentPage !== Math.ceil(this._result.length / this._entriesPerPage);
+};
+
+/**
+ * @return {Array.<undefined|!string>}
+ */
+OktaviaSearch.prototype.pageIndexes$ = function () {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var total;
+ /** @type {!number} */
+ var i;
+ result = [ ];
+ total = Math.ceil(this._result.length / this._entriesPerPage);
+ if (total < 10) {
+ for (i = 1; i <= total; i++) {
+ result.push(i + "");
+ }
+ } else {
+ if (this._currentPage <= 5) {
+ for (i = 1; i <= 7; i++) {
+ result.push(i + "");
+ }
+ result.push('...', total + "");
+ } else {
+ if (total - 5 <= this._currentPage) {
+ result.push('1', '...');
+ for (i = total - 8; i <= total; i++) {
+ result.push(i + "");
+ }
+ } else {
+ result.push('1', '...');
+ for (i = this._currentPage - 3; i <= this._currentPage + 3; i++) {
+ result.push(i + "");
+ }
+ result.push('...', total + "");
+ }
+ }
+ }
+ return result;
+};
+
+/**
+ * @return {Array.<undefined|_Result>}
+ */
+OktaviaSearch.prototype.getResult$ = function () {
+ /** @type {Style} */
+ var style;
+ /** @type {!number} */
+ var start;
+ /** @type {!number} */
+ var last;
+ /** @type {Metadata} */
+ var metadata;
+ /** @type {!number} */
+ var num;
+ /** @type {Array.<undefined|_Result>} */
+ var results;
+ /** @type {!number} */
+ var i;
+ /** @type {SearchUnit} */
+ var unit;
+ /** @type {Array.<undefined|!string>} */
+ var info;
+ /** @type {!string} */
+ var content;
+ /** @type {Array.<undefined|Position>} */
+ var positions;
+ /** @type {!number} */
+ var end;
+ /** @type {!boolean} */
+ var split;
+ /** @type {!number} */
+ var j;
+ /** @type {Position} */
+ var pos;
+ /** @type {!string} */
+ var text;
+ /** @type {Oktavia} */
+ var this$0;
+ /** @type {!number} */
+ var position$0;
+ /** @type {!number} */
+ var _currentPage$0;
+ /** @type {!number} */
+ var _entriesPerPage$0;
+ style = new Style$S('html');
+ start = ((_currentPage$0 = this._currentPage) - 1) * (_entriesPerPage$0 = this._entriesPerPage);
+ last = Math.min(_currentPage$0 * _entriesPerPage$0, this._result.length);
+ this$0 = this._oktavia;
+ metadata = this$0._metadatas[this$0._metadataLabels[0]];
+ num = 250;
+ results = [ ];
+ for (i = start; i < last; i++) {
+ unit = this._result[i];
+ info = metadata.getInformation$I(unit.id).split(Oktavia.eob);
+ content = metadata.getContent$I(unit.id);
+ start = 0;
+ positions = SearchUnit$getPositions$LSearchUnit$(unit);
+ if (content.indexOf(info[0]) === 1) {
+ content = content.slice(info[0].length + 2, content.length);
+ start += info[0].length + 2;
+ }
+ end = start + num;
+ split = false;
+ if (positions[0].position > end - positions[0].word.length) {
+ end = positions[0].position + Math.floor(num / 2);
+ split = true;
+ }
+ for (j = positions.length - 1; j > -1; j--) {
+ pos = positions[j];
+ if (pos.position + pos.word.length < end) {
+ content = [ content.slice(0, pos.position - start), style.convert$S('<hit>*</hit>').replace('*', content.slice((position$0 = pos.position) - start, position$0 + pos.word.length - start)), content.slice(pos.position + pos.word.length - start, content.length) ].join('');
+ }
+ }
+ if (split) {
+ text = [ content.slice(0, Math.floor(num / 2)) + ' ...', content.slice(- Math.floor(num / 2), end - start) ].join('<br/>');
+ } else {
+ text = content.slice(0, end - start) + ' ...<br/>';
+ }
+ text = text.replace(Oktavia.eob, ' ').replace(/(<br\/>)(<br\/>)+/, '<br/><br/>');
+ results.push(({title: info[0], url: info[1], content: text, score: unit.score}));
+ }
+ return results;
+};
+
+/**
+ * @return {!string}
+ */
+OktaviaSearch.prototype.getHighlight$ = function () {
+ return this._highlight;
+};
+
+/**
+ * @return {Array.<undefined|_Proposal>}
+ */
+OktaviaSearch.prototype.getProposals$ = function () {
+ /** @type {Style} */
+ var style;
+ /** @type {Array.<undefined|_Proposal>} */
+ var results;
+ /** @type {!number} */
+ var i;
+ /** @type {Proposal} */
+ var proposal;
+ /** @type {Array.<undefined|!string>} */
+ var label;
+ /** @type {Array.<undefined|!string>} */
+ var option;
+ /** @type {!number} */
+ var j;
+ style = new Style$S('html');
+ results = [ ];
+ if (this._queries.length > 1) {
+ for (i = 0; i < this._proposals.length; i++) {
+ proposal = this._proposals[i];
+ if (proposal.expect > 0) {
+ label = [ ];
+ option = [ ];
+ for (j = 0; j < this._queries.length; j++) {
+ if (j !== proposal.omit) {
+ label.push(style.convert$S('<hit>' + this._queries[j].toString() + '</hit>'));
+ option.push(this._queries[j].toString());
+ } else {
+ label.push(style.convert$S('<del>' + this._queries[j].toString() + '</del>'));
+ }
+ }
+ results.push(({options: option.join(' '), label: label.join('&nbsp;'), count: proposal.expect}));
+ }
+ }
+ }
+ return results;
+};
+
+/**
+ * @param {SearchSummary} summary
+ * @return {Array.<undefined|SearchUnit>}
+ */
+OktaviaSearch.prototype._sortResult$LSearchSummary$ = function (summary) {
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var score;
+ /** @type {SearchUnit} */
+ var unit;
+ /** @type {!string} */
+ var pos;
+ /** @type {Position} */
+ var position;
+ for (i = 0; i < summary.result.units.length; i++) {
+ score = 0;
+ unit = summary.result.units[i];
+ for (pos in unit.positions) {
+ position = unit.positions[pos];
+ if (this._oktavia.wordPositionType$I(position.position)) {
+ score += 10;
+ } else {
+ score += 1;
+ }
+ if (! position.stemmed) {
+ score += 2;
+ }
+ }
+ unit.score = (score | 0);
+ }
+ return SearchSummary$getSortedResult$LSearchSummary$(summary);
+};
+
+/**
+ * class _Main extends Object
+ * @constructor
+ */
+function _Main() {
+}
+
+/**
+ * @constructor
+ */
+function _Main$() {
+};
+
+_Main$.prototype = new _Main;
+
+/**
+ * @param {Array.<undefined|!string>} args
+ */
+_Main.main$AS = function (args) {
+};
+
+var _Main$main$AS = _Main.main$AS;
+
+/**
+ * class Oktavia extends Object
+ * @constructor
+ */
+function Oktavia() {
+}
+
+/**
+ * @constructor
+ */
+function Oktavia$() {
+ /** @type {Array.<undefined|!string>} */
+ var _utf162compressCode$0;
+ this._compressCode2utf16 = null;
+ this._fmindex = new FMIndex$();
+ this._metadatas = ({ });
+ this._metadataLabels = [ ];
+ this._stemmer = null;
+ this._stemmingResult = ({ });
+ _utf162compressCode$0 = this._utf162compressCode = [ Oktavia.eof, Oktavia.eob, Oktavia.unknown ];
+ _utf162compressCode$0.length = 65536;
+ this._compressCode2utf16 = [ Oktavia.eof, Oktavia.eob, Oktavia.unknown ];
+};
+
+Oktavia$.prototype = new Oktavia;
+
+/**
+ * @param {Stemmer} stemmer
+ */
+Oktavia.prototype.setStemmer$LStemmer$ = function (stemmer) {
+ this._stemmer = stemmer;
+};
+
+/**
+ * @return {Metadata}
+ */
+Oktavia.prototype.getPrimaryMetadata$ = function () {
+ return this._metadatas[this._metadataLabels[0]];
+};
+
+/**
+ * @param {!string} key
+ * @return {Section}
+ */
+Oktavia.prototype.addSection$S = function (key) {
+ /** @type {Section} */
+ var section;
+ if (this._metadataLabels.indexOf(key) !== -1) {
+ throw new Error('Metadata name ' + key + ' is already exists');
+ }
+ this._metadataLabels.push(key);
+ section = new Section$LOktavia$(this);
+ this._metadatas[key] = section;
+ return section;
+};
+
+/**
+ * @param {!string} key
+ * @return {Section}
+ */
+Oktavia.prototype.getSection$S = function (key) {
+ if (this._metadataLabels.indexOf(key) === -1) {
+ throw new Error('Metadata name ' + key + " does't exists");
+ }
+ return this._metadatas[key];
+};
+
+/**
+ * @param {!string} key
+ * @return {Splitter}
+ */
+Oktavia.prototype.addSplitter$S = function (key) {
+ /** @type {Splitter} */
+ var splitter;
+ if (this._metadataLabels.indexOf(key) !== -1) {
+ throw new Error('Metadata name ' + key + ' is already exists');
+ }
+ this._metadataLabels.push(key);
+ splitter = new Splitter$LOktavia$(this);
+ this._metadatas[key] = splitter;
+ return splitter;
+};
+
+/**
+ * @param {!string} key
+ * @return {Splitter}
+ */
+Oktavia.prototype.getSplitter$S = function (key) {
+ if (this._metadataLabels.indexOf(key) === -1) {
+ throw new Error('Metadata name ' + key + " does't exists");
+ }
+ return this._metadatas[key];
+};
+
+/**
+ * @param {!string} key
+ * @param {Array.<undefined|!string>} headers
+ * @return {Table}
+ */
+Oktavia.prototype.addTable$SAS = function (key, headers) {
+ /** @type {Table} */
+ var table;
+ if (this._metadataLabels.indexOf(key) !== -1) {
+ throw new Error('Metadata name ' + key + ' is already exists');
+ }
+ this._metadataLabels.push(key);
+ table = new Table$LOktavia$AS(this, headers);
+ this._metadatas[key] = table;
+ return table;
+};
+
+/**
+ * @param {!string} key
+ * @return {Table}
+ */
+Oktavia.prototype.getTable$S = function (key) {
+ if (this._metadataLabels.indexOf(key) === -1) {
+ throw new Error('Metadata name ' + key + " does't exists");
+ }
+ return this._metadatas[key];
+};
+
+/**
+ * @param {!string} key
+ * @return {Block}
+ */
+Oktavia.prototype.addBlock$S = function (key) {
+ /** @type {Block} */
+ var block;
+ if (this._metadataLabels.indexOf(key) !== -1) {
+ throw new Error('Metadata name ' + key + ' is already exists');
+ }
+ this._metadataLabels.push(key);
+ block = new Block$LOktavia$(this);
+ this._metadatas[key] = block;
+ return block;
+};
+
+/**
+ * @param {!string} key
+ * @return {Block}
+ */
+Oktavia.prototype.getBlock$S = function (key) {
+ if (this._metadataLabels.indexOf(key) === -1) {
+ throw new Error('Metadata name ' + key + " does't exists");
+ }
+ return this._metadatas[key];
+};
+
+/**
+ */
+Oktavia.prototype.addEndOfBlock$ = function () {
+ this._fmindex.push$S(Oktavia.eob);
+};
+
+/**
+ * @param {!string} words
+ */
+Oktavia.prototype.addWord$S = function (words) {
+ /** @type {Array.<undefined|!string>} */
+ var str;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var charCode;
+ /** @type {undefined|!string} */
+ var newCharCode;
+ str = [ ];
+ str.length = words.length;
+ for (i = 0; i < words.length; i++) {
+ charCode = words.charCodeAt(i);
+ newCharCode = this._utf162compressCode[charCode];
+ if (newCharCode == null) {
+ newCharCode = String.fromCharCode(this._compressCode2utf16.length);
+ this._utf162compressCode[charCode] = newCharCode;
+ this._compressCode2utf16.push(String.fromCharCode(charCode));
+ }
+ str.push(newCharCode);
+ }
+ this._fmindex.push$S(str.join(''));
+};
+
+/**
+ * @param {!string} words
+ * @param {!boolean} stemming
+ */
+Oktavia.prototype.addWord$SB = function (words, stemming) {
+ /** @type {Array.<undefined|!string>} */
+ var wordList;
+ /** @type {!number} */
+ var i;
+ /** @type {undefined|!string} */
+ var originalWord;
+ /** @type {!string} */
+ var smallWord;
+ /** @type {undefined|!string} */
+ var registerWord;
+ /** @type {!string} */
+ var baseWord;
+ /** @type {!string} */
+ var compressedCodeWord;
+ /** @type {Array.<undefined|!string>} */
+ var stemmedList;
+ this.addWord$S(words);
+ wordList = words.split(/\s+/);
+ for (i = 0; i < wordList.length; i++) {
+ originalWord = wordList[i];
+ smallWord = originalWord.slice(0, 1).toLowerCase() + originalWord.slice(1);
+ registerWord = null;
+ if (stemming && this._stemmer) {
+ baseWord = this._stemmer.stemWord$S(originalWord.toLowerCase());
+ if (originalWord.indexOf(baseWord) === -1) {
+ registerWord = baseWord;
+ }
+ } else {
+ if (originalWord != smallWord) {
+ registerWord = smallWord;
+ }
+ }
+ if (registerWord) {
+ compressedCodeWord = this._convertToCompressionCode$S(originalWord);
+ stemmedList = this._stemmingResult[registerWord];
+ if (! stemmedList) {
+ stemmedList = [ compressedCodeWord ];
+ this._stemmingResult[registerWord] = stemmedList;
+ } else {
+ if (stemmedList.indexOf(compressedCodeWord) === -1) {
+ stemmedList.push(compressedCodeWord);
+ }
+ }
+ }
+ }
+};
+
+/**
+ * @param {!string} keyword
+ * @return {!string}
+ */
+Oktavia.prototype._convertToCompressionCode$S = function (keyword) {
+ /** @type {Array.<undefined|!string>} */
+ var resultChars;
+ /** @type {!number} */
+ var i;
+ /** @type {undefined|!string} */
+ var chr;
+ resultChars = [ ];
+ for (i = 0; i < keyword.length; i++) {
+ chr = this._utf162compressCode[keyword.charCodeAt(i)];
+ if (chr == null) {
+ resultChars.push(Oktavia.unknown);
+ } else {
+ resultChars.push(chr);
+ }
+ }
+ return resultChars.join('');
+};
+
+/**
+ * @param {!string} keyword
+ * @param {!boolean} stemming
+ * @return {Array.<undefined|!number>}
+ */
+Oktavia.prototype.rawSearch$SB = function (keyword, stemming) {
+ /** @type {Array.<undefined|!number>} */
+ var result;
+ /** @type {!string} */
+ var baseWord;
+ /** @type {Array.<undefined|!string>} */
+ var stemmedList;
+ /** @type {!number} */
+ var i;
+ /** @type {undefined|!string} */
+ var word;
+ if (stemming) {
+ result = [ ];
+ if (this._stemmer) {
+ baseWord = this._stemmer.stemWord$S(keyword.toLowerCase());
+ stemmedList = this._stemmingResult[baseWord];
+ if (stemmedList) {
+ for (i = 0; i < stemmedList.length; i++) {
+ word = stemmedList[i];
+ result = result.concat(this._fmindex.search$S(word));
+ }
+ }
+ }
+ } else {
+ result = this._fmindex.search$S(this._convertToCompressionCode$S(keyword));
+ }
+ return result;
+};
+
+/**
+ * @param {Array.<undefined|Query>} queries
+ * @return {SearchSummary}
+ */
+Oktavia.prototype.search$ALQuery$ = function (queries) {
+ /** @type {SearchSummary} */
+ var summary;
+ /** @type {!number} */
+ var i;
+ /** @type {SingleResult} */
+ var result$0;
+ summary = ({sourceResults: [ ], result: null, oktavia: this});
+ for (i = 0; i < queries.length; i++) {
+ result$0 = this._searchQuery$LQuery$(queries[i]);
+ summary.sourceResults.push(result$0);
+ }
+ summary.result = SearchSummary$mergeResult$LSearchSummary$ALSingleResult$(summary, summary.sourceResults);
+ return summary;
+};
+
+/**
+ * @param {Query} query
+ * @return {SingleResult}
+ */
+Oktavia.prototype._searchQuery$LQuery$ = function (query) {
+ /** @type {SingleResult} */
+ var result;
+ /** @type {Array.<undefined|!number>} */
+ var positions;
+ result = new SingleResult$SBB(query.word, query.or, query.not);
+ if (query.raw) {
+ positions = this.rawSearch$SB(query.word, false);
+ } else {
+ positions = this.rawSearch$SB(query.word, false).concat(this.rawSearch$SB(query.word, true));
+ }
+ this._metadatas[this._metadataLabels[0]].grouping$LSingleResult$AISB(result, positions, query.word, ! query.raw);
+ return result;
+};
+
+/**
+ */
+Oktavia.prototype.build$ = function () {
+ this.build$IB(5, false);
+};
+
+/**
+ * @param {!number} cacheDensity
+ * @param {!boolean} verbose
+ */
+Oktavia.prototype.build$IB = function (cacheDensity, verbose) {
+ /** @type {!string} */
+ var key;
+ /** @type {!number} */
+ var cacheRange;
+ /** @type {!number} */
+ var maxChar;
+ for (key in this._metadatas) {
+ this._metadatas[key]._build$();
+ }
+ cacheRange = Math.round(Math.max(1, 100 / Math.min(100, Math.max(0.01, cacheDensity))));
+ maxChar = this._compressCode2utf16.length;
+ this._fmindex.build$SIIB(Oktavia.eof, maxChar, cacheRange, verbose);
+};
+
+/**
+ * @return {!string}
+ */
+Oktavia.prototype.dump$ = function () {
+ return this.dump$B(false);
+};
+
+/**
+ * @param {!boolean} verbose
+ * @return {!string}
+ */
+Oktavia.prototype.dump$B = function (verbose) {
+ /** @type {!string} */
+ var header;
+ /** @type {!string} */
+ var fmdata;
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var i;
+ /** @type {CompressionReport} */
+ var report;
+ /** @type {undefined|!string} */
+ var name;
+ /** @type {!string} */
+ var data;
+ header = Binary$dumpString$SLCompressionReport$("oktavia-01", null).slice(1);
+ if (verbose) {
+ console.log("Source text size: " + (this._fmindex.size$() * 2 + "") + ' bytes');
+ }
+ fmdata = this._fmindex.dump$B(verbose);
+ result = [ header, fmdata ];
+ result.push(Binary$dump16bitNumber$I(this._compressCode2utf16.length));
+ for (i = 3; i < this._compressCode2utf16.length; i++) {
+ result.push(this._compressCode2utf16[i]);
+ }
+ if (verbose) {
+ console.log('Char Code Map: ' + (this._compressCode2utf16.length * 2 - 2 + "") + ' bytes');
+ }
+ report = ({source: 0, result: 0});
+ result.push(Binary$dumpStringListMap$HASLCompressionReport$(this._stemmingResult, report));
+ if (verbose) {
+ console.log('Stemmed Word Table: ' + (result[result.length - 1].length + "") + ' bytes (' + (Math.round(report.result * 100.0 / report.source) + "") + '%)');
+ }
+ result.push(Binary$dump16bitNumber$I(this._metadataLabels.length));
+ for (i = 0; i < this._metadataLabels.length; i++) {
+ report = ({source: 0, result: 0});
+ name = this._metadataLabels[i];
+ data = this._metadatas[name]._dump$LCompressionReport$(report);
+ result.push(Binary$dumpString$SLCompressionReport$(name, report), data);
+ if (verbose) {
+ console.log('Meta Data ' + name + ': ' + (data.length * 2 + "") + ' bytes (' + (Math.round(report.result * 100.0 / report.source) + "") + '%)');
+ }
+ }
+ return result.join('');
+};
+
+/**
+ * @param {!string} data
+ */
+Oktavia.prototype.load$S = function (data) {
+ /** @type {!string} */
+ var header;
+ /** @type {!number} */
+ var offset;
+ /** @type {!number} */
+ var charCodeCount;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var charCode;
+ /** @type {LoadedStringListMapResult} */
+ var stemmedWords;
+ /** @type {!number} */
+ var metadataCount;
+ /** @type {LoadedStringResult} */
+ var nameResult;
+ /** @type {!string} */
+ var name;
+ /** @type {!number} */
+ var type;
+ header = Binary$dumpString$SLCompressionReport$("oktavia-01", null).slice(1);
+ if (data.slice(0, 5) !== header) {
+ throw new Error('Invalid data file');
+ }
+ this._metadatas = ({ });
+ this._metadataLabels = [ ];
+ offset = 5;
+ offset = this._fmindex.load$SI(data, offset);
+ charCodeCount = Binary$load16bitNumber$SI(data, offset++);
+ this._compressCode2utf16 = [ Oktavia.eof, Oktavia.eob, Oktavia.unknown ];
+ this._utf162compressCode = [ Oktavia.eof, Oktavia.eob, Oktavia.unknown ];
+ for (i = 3; i < charCodeCount; i++) {
+ charCode = Binary$load16bitNumber$SI(data, offset++);
+ this._compressCode2utf16.push(String.fromCharCode(charCode));
+ this._utf162compressCode[charCode] = String.fromCharCode(i);
+ }
+ stemmedWords = Binary$loadStringListMap$SI(data, offset);
+ this._stemmingResult = stemmedWords.result;
+ offset = stemmedWords.offset;
+ metadataCount = Binary$load16bitNumber$SI(data, offset++);
+ for (i = 0; i < metadataCount; i++) {
+ nameResult = Binary$loadString$SI(data, offset);
+ name = nameResult.result;
+ offset = nameResult.offset;
+ type = Binary$load16bitNumber$SI(data, offset++);
+ switch (type) {
+ case 0:
+ offset = Section$_load$LOktavia$SSI(this, name, data, offset);
+ break;
+ case 1:
+ offset = Splitter$_load$LOktavia$SSI(this, name, data, offset);
+ break;
+ case 2:
+ offset = Table$_load$LOktavia$SSI(this, name, data, offset);
+ break;
+ case 3:
+ offset = Block$_load$LOktavia$SSI(this, name, data, offset);
+ break;
+ }
+ }
+};
+
+/**
+ * @return {!number}
+ */
+Oktavia.prototype.contentSize$ = function () {
+ /** @type {FMIndex} */
+ var this$0;
+ this$0 = this._fmindex;
+ return this$0._substr.length;
+};
+
+/**
+ * @param {!number} position
+ * @return {!number}
+ */
+Oktavia.prototype.wordPositionType$I = function (position) {
+ /** @type {!number} */
+ var result;
+ /** @type {!string} */
+ var ahead;
+ result = 0;
+ if (position === 0) {
+ result = 4;
+ } else {
+ ahead = this._fmindex.getSubstring$II(position - 1, 1);
+ if (/\s/.test(ahead)) {
+ result = 2;
+ } else {
+ if (/\W/.test(ahead)) {
+ result = 1;
+ } else {
+ if (Oktavia.eob === ahead) {
+ result = 3;
+ }
+ }
+ }
+ }
+ return (result | 0);
+};
+
+/**
+ * @param {!number} position
+ * @param {!number} length
+ * @return {!string}
+ */
+Oktavia.prototype._getSubstring$II = function (position, length) {
+ /** @type {!string} */
+ var result;
+ /** @type {Array.<undefined|!string>} */
+ var str;
+ /** @type {!number} */
+ var i;
+ result = this._fmindex.getSubstring$II(position, length);
+ str = [ ];
+ for (i = 0; i < result.length; i++) {
+ str.push(this._compressCode2utf16[result.charCodeAt(i)]);
+ }
+ return str.join('');
+};
+
+/**
+ * class Binary extends Object
+ * @constructor
+ */
+function Binary() {
+}
+
+/**
+ * @constructor
+ */
+function Binary$() {
+};
+
+Binary$.prototype = new Binary;
+
+/**
+ * @param {!number} num
+ * @return {!string}
+ */
+Binary.dump32bitNumber$N = function (num) {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ result = [ String.fromCharCode(Math.floor(num / 65536)) ];
+ result.push(String.fromCharCode(num % 65536));
+ return result.join("");
+};
+
+var Binary$dump32bitNumber$N = Binary.dump32bitNumber$N;
+
+/**
+ * @param {!string} buffer
+ * @param {!number} offset
+ * @return {!number}
+ */
+Binary.load32bitNumber$SI = function (buffer, offset) {
+ /** @type {!number} */
+ var result;
+ result = buffer.charCodeAt(offset) * 65536 + buffer.charCodeAt(offset + 1);
+ return result;
+};
+
+var Binary$load32bitNumber$SI = Binary.load32bitNumber$SI;
+
+/**
+ * @param {!number} num
+ * @return {!string}
+ */
+Binary.dump16bitNumber$I = function (num) {
+ return String.fromCharCode(num % 65536);
+};
+
+var Binary$dump16bitNumber$I = Binary.dump16bitNumber$I;
+
+/**
+ * @param {!string} buffer
+ * @param {!number} offset
+ * @return {!number}
+ */
+Binary.load16bitNumber$SI = function (buffer, offset) {
+ return (buffer.charCodeAt(offset) | 0);
+};
+
+var Binary$load16bitNumber$SI = Binary.load16bitNumber$SI;
+
+/**
+ * @param {!string} str
+ * @return {!string}
+ */
+Binary.dumpString$S = function (str) {
+ return Binary$dumpString$SLCompressionReport$(str, null);
+};
+
+var Binary$dumpString$S = Binary.dumpString$S;
+
+/**
+ * @param {!string} str
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+Binary.dumpString$SLCompressionReport$ = function (str, report) {
+ /** @type {!number} */
+ var length;
+ /** @type {!boolean} */
+ var compress;
+ /** @type {Array.<undefined|!number>} */
+ var charCodes;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var charCode;
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {undefined|!number} */
+ var bytes;
+ if (str.length > 32768) {
+ str = str.slice(0, 32768);
+ }
+ length = str.length;
+ compress = true;
+ charCodes = [ ];
+ for (i = 0; i < length; i++) {
+ charCode = str.charCodeAt(i);
+ if (charCode > 255) {
+ compress = false;
+ break;
+ }
+ charCodes.push(charCode);
+ }
+ if (compress) {
+ result = [ Binary$dump16bitNumber$I(length + 32768) ];
+ for (i = 0; i < length; i += 2) {
+ bytes = charCodes[i];
+ if (i !== length - 1) {
+ bytes += charCodes[i + 1] << 8;
+ }
+ result.push(String.fromCharCode(bytes % 65536));
+ }
+ if (report) {
+ CompressionReport$add$LCompressionReport$II(report, length, Math.ceil(length / 2));
+ }
+ } else {
+ result = [ Binary$dump16bitNumber$I(length), str ];
+ if (report) {
+ CompressionReport$add$LCompressionReport$II(report, length, length);
+ }
+ }
+ return result.join('');
+};
+
+var Binary$dumpString$SLCompressionReport$ = Binary.dumpString$SLCompressionReport$;
+
+/**
+ * @param {!string} buffer
+ * @param {!number} offset
+ * @return {LoadedStringResult}
+ */
+Binary.loadString$SI = function (buffer, offset) {
+ return new LoadedStringResult$SI(buffer, offset);
+};
+
+var Binary$loadString$SI = Binary.loadString$SI;
+
+/**
+ * @param {Array.<undefined|!string>} strList
+ * @return {!string}
+ */
+Binary.dumpStringList$AS = function (strList) {
+ return Binary$dumpStringList$ASLCompressionReport$(strList, null);
+};
+
+var Binary$dumpStringList$AS = Binary.dumpStringList$AS;
+
+/**
+ * @param {Array.<undefined|!string>} strList
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+Binary.dumpStringList$ASLCompressionReport$ = function (strList, report) {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var i;
+ result = [ Binary$dump32bitNumber$N(strList.length) ];
+ for (i = 0; i < strList.length; i++) {
+ result.push(Binary$dumpString$SLCompressionReport$(strList[i], report));
+ }
+ return result.join('');
+};
+
+var Binary$dumpStringList$ASLCompressionReport$ = Binary.dumpStringList$ASLCompressionReport$;
+
+/**
+ * @param {!string} buffer
+ * @param {!number} offset
+ * @return {LoadedStringListResult}
+ */
+Binary.loadStringList$SI = function (buffer, offset) {
+ return new LoadedStringListResult$SI(buffer, offset);
+};
+
+var Binary$loadStringList$SI = Binary.loadStringList$SI;
+
+/**
+ * @param {Object.<string, undefined|Array.<undefined|!string>>} strMap
+ * @return {!string}
+ */
+Binary.dumpStringListMap$HAS = function (strMap) {
+ return Binary$dumpStringListMap$HASLCompressionReport$(strMap, null);
+};
+
+var Binary$dumpStringListMap$HAS = Binary.dumpStringListMap$HAS;
+
+/**
+ * @param {Object.<string, undefined|Array.<undefined|!string>>} strMap
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+Binary.dumpStringListMap$HASLCompressionReport$ = function (strMap, report) {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var counter;
+ /** @type {!string} */
+ var key;
+ result = [ ];
+ counter = 0;
+ for (key in strMap) {
+ result.push(Binary$dumpString$SLCompressionReport$(key, report));
+ result.push(Binary$dumpStringList$ASLCompressionReport$(strMap[key], report));
+ counter++;
+ }
+ return Binary$dump32bitNumber$N(counter) + result.join('');
+};
+
+var Binary$dumpStringListMap$HASLCompressionReport$ = Binary.dumpStringListMap$HASLCompressionReport$;
+
+/**
+ * @param {!string} buffer
+ * @param {!number} offset
+ * @return {LoadedStringListMapResult}
+ */
+Binary.loadStringListMap$SI = function (buffer, offset) {
+ return new LoadedStringListMapResult$SI(buffer, offset);
+};
+
+var Binary$loadStringListMap$SI = Binary.loadStringListMap$SI;
+
+/**
+ * @param {Array.<undefined|!number>} array
+ * @return {!string}
+ */
+Binary.dump32bitNumberList$AN = function (array) {
+ return Binary$dump32bitNumberList$ANLCompressionReport$(array, null);
+};
+
+var Binary$dump32bitNumberList$AN = Binary.dump32bitNumberList$AN;
+
+/**
+ * @param {Array.<undefined|!number>} array
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+Binary.dump32bitNumberList$ANLCompressionReport$ = function (array, report) {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var index;
+ /** @type {!number} */
+ var inputLength;
+ /** @type {!number} */
+ var length;
+ /** @type {!string} */
+ var resultString;
+ /** @type {!number} */
+ var value1$0;
+ /** @type {!number} */
+ var value2$0;
+ result = [ Binary$dump32bitNumber$N(array.length) ];
+ index = 0;
+ inputLength = array.length;
+ while (index < inputLength) {
+ if (array[index] == 0) {
+ length = Binary$_countZero$ANI(array, index);
+ result.push(Binary$_zeroBlock$I(length));
+ index += length;
+ } else {
+ if (Binary$_shouldZebraCode$ANI(array, index)) {
+ result.push(Binary$_createZebraCode$ANI(array, index));
+ value1$0 = array.length;
+ value2$0 = index + 15;
+ index = (value1$0 <= value2$0 ? value1$0 : value2$0);
+ } else {
+ length = Binary$_searchDoubleZero$ANI(array, index);
+ result.push(Binary$_nonZeroBlock$ANII(array, index, length));
+ if (length === 0) {
+ throw new Error('');
+ }
+ index += length;
+ }
+ }
+ }
+ resultString = result.join('');
+ if (report) {
+ CompressionReport$add$LCompressionReport$II(report, array.length * 2 + 2, resultString.length);
+ }
+ return resultString;
+};
+
+var Binary$dump32bitNumberList$ANLCompressionReport$ = Binary.dump32bitNumberList$ANLCompressionReport$;
+
+/**
+ * @param {!string} buffer
+ * @param {!number} offset
+ * @return {LoadedNumberListResult}
+ */
+Binary.load32bitNumberList$SI = function (buffer, offset) {
+ return new LoadedNumberListResult$SI(buffer, offset);
+};
+
+var Binary$load32bitNumberList$SI = Binary.load32bitNumberList$SI;
+
+/**
+ * @param {Array.<undefined|!number>} array
+ * @param {!number} offset
+ * @return {!number}
+ */
+Binary._countZero$ANI = function (array, offset) {
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var array$len$0;
+ for ((i = offset, array$len$0 = array.length); i < array$len$0; i++) {
+ if (array[i] != 0) {
+ return (i - offset | 0);
+ }
+ }
+ return (array.length - offset | 0);
+};
+
+var Binary$_countZero$ANI = Binary._countZero$ANI;
+
+/**
+ * @param {!number} length
+ * @return {!string}
+ */
+Binary._zeroBlock$I = function (length) {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ result = [ ];
+ while (length > 0) {
+ if (length > 16384) {
+ result.push(Binary$dump16bitNumber$I(16383));
+ length -= 16384;
+ } else {
+ result.push(Binary$dump16bitNumber$I(length - 1));
+ length = 0;
+ }
+ }
+ return result.join('');
+};
+
+var Binary$_zeroBlock$I = Binary._zeroBlock$I;
+
+/**
+ * @param {Array.<undefined|!number>} array
+ * @param {!number} offset
+ * @return {!boolean}
+ */
+Binary._shouldZebraCode$ANI = function (array, offset) {
+ /** @type {!number} */
+ var change;
+ /** @type {!boolean} */
+ var isLastZero;
+ /** @type {!number} */
+ var i;
+ if (array.length - offset < 16) {
+ return true;
+ }
+ change = 0;
+ isLastZero = false;
+ for (i = offset; i < offset + 15; i++) {
+ if (array[i] == 0) {
+ if (! isLastZero) {
+ isLastZero = true;
+ change++;
+ }
+ } else {
+ if (isLastZero) {
+ isLastZero = false;
+ change++;
+ }
+ }
+ }
+ return change > 2;
+};
+
+var Binary$_shouldZebraCode$ANI = Binary._shouldZebraCode$ANI;
+
+/**
+ * @param {Array.<undefined|!number>} array
+ * @param {!number} offset
+ * @return {!number}
+ */
+Binary._searchDoubleZero$ANI = function (array, offset) {
+ /** @type {!boolean} */
+ var isLastZero;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var array$len$0;
+ isLastZero = false;
+ for ((i = offset, array$len$0 = array.length); i < array$len$0; i++) {
+ if (array[i] == 0) {
+ if (isLastZero) {
+ return (i - offset - 1 | 0);
+ }
+ isLastZero = true;
+ } else {
+ isLastZero = false;
+ }
+ }
+ return (array.length - offset | 0);
+};
+
+var Binary$_searchDoubleZero$ANI = Binary._searchDoubleZero$ANI;
+
+/**
+ * @param {Array.<undefined|!number>} array
+ * @param {!number} offset
+ * @param {!number} length
+ * @return {!string}
+ */
+Binary._nonZeroBlock$ANII = function (array, offset, length) {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var blockLength;
+ /** @type {!number} */
+ var i;
+ result = [ ];
+ while (length > 0) {
+ if (length > 16384) {
+ blockLength = 16384;
+ length -= 16384;
+ } else {
+ blockLength = length;
+ length = 0;
+ }
+ result.push(Binary$dump16bitNumber$I(blockLength - 1 + 0x4000));
+ for (i = offset; i < offset + blockLength; i++) {
+ result.push(Binary$dump32bitNumber$N(array[i]));
+ }
+ offset += blockLength;
+ }
+ return result.join('');
+};
+
+var Binary$_nonZeroBlock$ANII = Binary._nonZeroBlock$ANII;
+
+/**
+ * @param {Array.<undefined|!number>} array
+ * @param {!number} offset
+ * @return {!string}
+ */
+Binary._createZebraCode$ANI = function (array, offset) {
+ /** @type {!number} */
+ var last;
+ /** @type {!number} */
+ var code;
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var value1$0;
+ /** @type {!number} */
+ var value2$0;
+ value1$0 = offset + 15;
+ value2$0 = array.length;
+ last = (value1$0 <= value2$0 ? value1$0 : value2$0);
+ code = 0x8000;
+ result = [ ];
+ for (i = offset; i < last; i++) {
+ if (array[i] != 0) {
+ result.push(Binary$dump32bitNumber$N(array[i]));
+ code = code + (0x1 << i - offset);
+ }
+ }
+ return String.fromCharCode(code) + result.join('');
+};
+
+var Binary$_createZebraCode$ANI = Binary._createZebraCode$ANI;
+
+/**
+ * @param {!string} str
+ * @return {!string}
+ */
+Binary.base64encode$S = function (str) {
+ /** @type {Array.<undefined|!string>} */
+ var out;
+ /** @type {Array.<undefined|!number>} */
+ var source;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var code;
+ /** @type {!number} */
+ var len;
+ /** @type {!number} */
+ var c1;
+ /** @type {undefined|!number} */
+ var c2;
+ /** @type {undefined|!number} */
+ var c3;
+ out = [ ];
+ source = [ ];
+ for (i = 0; i < str.length; i++) {
+ code = str.charCodeAt(i);
+ source.push(code & 0x00ff, code >>> 8);
+ }
+ len = str.length * 2;
+ i = 0;
+ while (i < len) {
+ c1 = source[i++] & 0xff;
+ if (i === len) {
+ out.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(c1 >> 2));
+ out.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((c1 & 0x3) << 4));
+ out.push("==");
+ break;
+ }
+ c2 = source[i++];
+ if (i === len) {
+ out.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(c1 >> 2));
+ out.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((c1 & 0x3) << 4 | (c2 & 0xF0) >> 4));
+ out.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((c2 & 0xF) << 2));
+ out.push("=");
+ break;
+ }
+ c3 = source[i++];
+ out.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(c1 >> 2));
+ out.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((c1 & 0x3) << 4 | (c2 & 0xF0) >> 4));
+ out.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((c2 & 0xF) << 2 | (c3 & 0xC0) >> 6));
+ out.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(c3 & 0x3F));
+ }
+ return out.join('');
+};
+
+var Binary$base64encode$S = Binary.base64encode$S;
+
+/**
+ * @param {Array.<undefined|!number>} source
+ * @return {!string}
+ */
+Binary._mergeCharCode$AI = function (source) {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var i;
+ result = [ ];
+ for (i = 0; i < source.length; i += 2) {
+ result.push(String.fromCharCode(source[i] + (source[i + 1] << 8)));
+ }
+ return result.join('');
+};
+
+var Binary$_mergeCharCode$AI = Binary._mergeCharCode$AI;
+
+/**
+ * @param {!string} str
+ * @return {!string}
+ */
+Binary.base64decode$S = function (str) {
+ /** @type {!number} */
+ var len;
+ /** @type {!number} */
+ var i;
+ /** @type {Array.<undefined|!number>} */
+ var out;
+ /** @type {undefined|!number} */
+ var c1;
+ /** @type {undefined|!number} */
+ var c2;
+ /** @type {!number} */
+ var c3;
+ /** @type {!number} */
+ var c4;
+ len = str.length;
+ i = 0;
+ out = [ ];
+ while (i < len) {
+ do {
+ c1 = Binary._base64DecodeChars[str.charCodeAt(i++) & 0xff];
+ } while (i < len && c1 == -1);
+ if (c1 == -1) {
+ break;
+ }
+ do {
+ c2 = Binary._base64DecodeChars[str.charCodeAt(i++) & 0xff];
+ } while (i < len && c2 == -1);
+ if (c2 == -1) {
+ break;
+ }
+ out.push(c1 << 2 | (c2 & 0x30) >> 4);
+ do {
+ c3 = str.charCodeAt(i++) & 0xff;
+ if (c3 === 61) {
+ return Binary$_mergeCharCode$AI(out);
+ }
+ c3 = Binary._base64DecodeChars[c3];
+ } while (i < len && c3 === -1);
+ if (c3 === -1) {
+ break;
+ }
+ out.push((c2 & 0XF) << 4 | (c3 & 0x3C) >> 2);
+ do {
+ c4 = str.charCodeAt(i++) & 0xff;
+ if (c4 === 61) {
+ return Binary$_mergeCharCode$AI(out);
+ }
+ c4 = (Binary._base64DecodeChars[c4] | 0);
+ } while (i < len && c4 === -1);
+ if (c4 === -1) {
+ break;
+ }
+ out.push((c3 & 0x03) << 6 | c4);
+ }
+ return Binary$_mergeCharCode$AI(out);
+};
+
+var Binary$base64decode$S = Binary.base64decode$S;
+
+/**
+ * class LoadedStringResult extends Object
+ * @constructor
+ */
+function LoadedStringResult() {
+}
+
+/**
+ * @constructor
+ * @param {!string} data
+ * @param {!number} offset
+ */
+function LoadedStringResult$SI(data, offset) {
+ /** @type {!number} */
+ var strLength;
+ /** @type {Array.<undefined|!string>} */
+ var bytes;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var code;
+ /** @type {!number} */
+ var offset$0;
+ this.result = "";
+ this.offset = 0;
+ offset$0 = offset++;
+ strLength = data.charCodeAt(offset$0);
+ if (strLength > 32767) {
+ strLength = strLength - 32768;
+ bytes = [ ];
+ for (i = 0; i < strLength; i += 2) {
+ code = data.charCodeAt(offset);
+ bytes.push(String.fromCharCode(code & 0x00ff));
+ if (i !== strLength - 1) {
+ bytes.push(String.fromCharCode(code >>> 8));
+ }
+ offset++;
+ }
+ this.result = bytes.join('');
+ this.offset = offset;
+ } else {
+ this.result = data.slice(offset, offset + strLength);
+ this.offset = (offset + strLength | 0);
+ }
+};
+
+LoadedStringResult$SI.prototype = new LoadedStringResult;
+
+/**
+ * class LoadedStringListResult extends Object
+ * @constructor
+ */
+function LoadedStringListResult() {
+}
+
+/**
+ * @constructor
+ * @param {!string} data
+ * @param {!number} offset
+ */
+function LoadedStringListResult$SI(data, offset) {
+ /** @type {!number} */
+ var length;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var strLength;
+ /** @type {!string} */
+ var resultStr;
+ /** @type {Array.<undefined|!string>} */
+ var bytes;
+ /** @type {!number} */
+ var j;
+ /** @type {!number} */
+ var code;
+ /** @type {!number} */
+ var result$0;
+ /** @type {!number} */
+ var offset$0;
+ this.offset = 0;
+ this.result = [ ];
+ result$0 = data.charCodeAt(offset) * 65536 + data.charCodeAt(offset + 1);
+ length = result$0;
+ offset += 2;
+ for (i = 0; i < length; i++) {
+ offset$0 = offset++;
+ strLength = data.charCodeAt(offset$0);
+ if (strLength > 32767) {
+ strLength = strLength - 32768;
+ bytes = [ ];
+ for (j = 0; j < strLength; j += 2) {
+ code = data.charCodeAt(offset);
+ bytes.push(String.fromCharCode(code & 0x00ff));
+ if (j !== strLength - 1) {
+ bytes.push(String.fromCharCode(code >>> 8));
+ }
+ offset++;
+ }
+ resultStr = bytes.join('');
+ } else {
+ resultStr = data.slice(offset, offset + strLength);
+ offset = (offset + strLength | 0);
+ }
+ this.result.push(resultStr);
+ }
+ this.offset = offset;
+};
+
+LoadedStringListResult$SI.prototype = new LoadedStringListResult;
+
+/**
+ * class LoadedStringListMapResult extends Object
+ * @constructor
+ */
+function LoadedStringListMapResult() {
+}
+
+/**
+ * @constructor
+ * @param {!string} data
+ * @param {!number} offset
+ */
+function LoadedStringListMapResult$SI(data, offset) {
+ /** @type {!number} */
+ var length;
+ /** @type {!number} */
+ var i;
+ /** @type {LoadedStringResult} */
+ var keyResult;
+ /** @type {LoadedStringListResult} */
+ var valueResult;
+ /** @type {!number} */
+ var result$0;
+ /** @type {!number} */
+ var offset$0;
+ this.offset = 0;
+ this.result = ({ });
+ result$0 = data.charCodeAt(offset) * 65536 + data.charCodeAt(offset + 1);
+ length = result$0;
+ offset += 2;
+ for (i = 0; i < length; i++) {
+ keyResult = new LoadedStringResult$SI(data, offset);
+ offset$0 = keyResult.offset;
+ valueResult = new LoadedStringListResult$SI(data, offset$0);
+ this.result[keyResult.result] = valueResult.result;
+ offset = valueResult.offset;
+ }
+ this.offset = offset;
+};
+
+LoadedStringListMapResult$SI.prototype = new LoadedStringListMapResult;
+
+/**
+ * class LoadedNumberListResult extends Object
+ * @constructor
+ */
+function LoadedNumberListResult() {
+}
+
+/**
+ * @constructor
+ * @param {!string} data
+ * @param {!number} offset
+ */
+function LoadedNumberListResult$SI(data, offset) {
+ /** @type {!number} */
+ var resultLength;
+ /** @type {!number} */
+ var originalOffset;
+ /** @type {Array.<undefined|!number>} */
+ var result;
+ /** @type {!number} */
+ var tag;
+ /** @type {!number} */
+ var length;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var result$0;
+ /** @type {!number} */
+ var value1$0;
+ this.result = null;
+ this.offset = 0;
+ result$0 = data.charCodeAt(offset) * 65536 + data.charCodeAt(offset + 1);
+ resultLength = result$0;
+ originalOffset = offset;
+ offset += 2;
+ result = [ ];
+ while (result.length < resultLength) {
+ tag = data.charCodeAt(offset++);
+ if (tag >>> 15 === 1) {
+ value1$0 = resultLength - result.length;
+ length = (value1$0 <= 15 ? value1$0 : 15);
+ for (i = 0; i < length; i++) {
+ if (tag >>> i & 0x1) {
+ result.push(Binary$load32bitNumber$SI(data, offset));
+ offset += 2;
+ } else {
+ result.push(0);
+ }
+ }
+ } else {
+ if (tag >>> 14 === 1) {
+ length = tag - 0x4000 + 1;
+ for (i = 0; i < length; i++) {
+ result.push(Binary$load32bitNumber$SI(data, offset));
+ offset += 2;
+ }
+ } else {
+ length = tag + 1;
+ for (i = 0; i < length; i++) {
+ result.push(0);
+ }
+ }
+ }
+ }
+ this.result = result;
+ this.offset = offset;
+};
+
+LoadedNumberListResult$SI.prototype = new LoadedNumberListResult;
+
+/**
+ * class CompressionReport extends Object
+ * @constructor
+ */
+function CompressionReport() {
+}
+
+/**
+ * @constructor
+ */
+function CompressionReport$() {
+ this.source = 0;
+ this.result = 0;
+};
+
+CompressionReport$.prototype = new CompressionReport;
+
+/**
+ * @param {CompressionReport} $this
+ * @param {!number} source
+ * @param {!number} result
+ */
+CompressionReport.add$LCompressionReport$II = function ($this, source, result) {
+ $this.source += source;
+ $this.result += result;
+};
+
+var CompressionReport$add$LCompressionReport$II = CompressionReport.add$LCompressionReport$II;
+
+/**
+ * @param {CompressionReport} $this
+ * @return {!number}
+ */
+CompressionReport.rate$LCompressionReport$ = function ($this) {
+ return (Math.round($this.result * 100.0 / $this.source) | 0);
+};
+
+var CompressionReport$rate$LCompressionReport$ = CompressionReport.rate$LCompressionReport$;
+
+/**
+ * class Query extends Object
+ * @constructor
+ */
+function Query() {
+}
+
+/**
+ * @constructor
+ */
+function Query$() {
+ this.word = '';
+ this.or = false;
+ this.not = false;
+ this.raw = false;
+};
+
+Query$.prototype = new Query;
+
+/**
+ * @return {!string}
+ */
+Query.prototype.toString = function () {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ result = [ ];
+ if (this.or) {
+ result.push("OR ");
+ }
+ if (this.not) {
+ result.push("-");
+ }
+ if (this.raw) {
+ result.push('"', this.word, '"');
+ } else {
+ result.push(this.word);
+ }
+ return result.join('');
+};
+
+/**
+ * class QueryStringParser extends Object
+ * @constructor
+ */
+function QueryStringParser() {
+}
+
+/**
+ * @constructor
+ */
+function QueryStringParser$() {
+ this.queries = [ ];
+};
+
+QueryStringParser$.prototype = new QueryStringParser;
+
+/**
+ * @param {QueryStringParser} $this
+ * @param {!string} queryString
+ * @return {Array.<undefined|Query>}
+ */
+QueryStringParser.parse$LQueryStringParser$S = function ($this, queryString) {
+ /** @type {!boolean} */
+ var nextOr;
+ /** @type {!boolean} */
+ var nextNot;
+ /** @type {!number} */
+ var currentWordStart;
+ /** @type {!number} */
+ var status;
+ /** @type {RegExp} */
+ var isSpace;
+ /** @type {!number} */
+ var i;
+ /** @type {!string} */
+ var ch;
+ /** @type {!string} */
+ var word;
+ /** @type {Query} */
+ var query;
+ nextOr = false;
+ nextNot = false;
+ currentWordStart = 0;
+ status = 0;
+ isSpace = /[\s\u3000]/;
+ for (i = 0; i < queryString.length; i++) {
+ ch = queryString.charAt(i);
+ switch (status) {
+ case 0:
+ if (! isSpace.test(ch)) {
+ if (ch === '-') {
+ nextNot = true;
+ } else {
+ if (ch === '"') {
+ currentWordStart = i + 1;
+ status = 2;
+ } else {
+ currentWordStart = i;
+ status = 1;
+ }
+ }
+ } else {
+ nextNot = false;
+ }
+ break;
+ case 1:
+ if (isSpace.test(ch)) {
+ word = queryString.slice(currentWordStart, i);
+ if (word === 'OR') {
+ nextOr = true;
+ } else {
+ query = new Query$();
+ query.word = word;
+ query.or = nextOr;
+ query.not = nextNot;
+ $this.queries.push(query);
+ nextOr = false;
+ nextNot = false;
+ }
+ status = 0;
+ }
+ break;
+ case 2:
+ if (ch === '"') {
+ word = queryString.slice(currentWordStart, i);
+ query = new Query$();
+ query.word = word;
+ query.or = nextOr;
+ query.not = nextNot;
+ query.raw = true;
+ $this.queries.push(query);
+ nextOr = false;
+ nextNot = false;
+ status = 0;
+ }
+ break;
+ }
+ }
+ switch (status) {
+ case 0:
+ break;
+ case 1:
+ query = new Query$();
+ word = queryString.slice(currentWordStart, queryString.length);
+ if (word !== 'OR') {
+ query.word = word;
+ query.or = nextOr;
+ query.not = nextNot;
+ $this.queries.push(query);
+ }
+ break;
+ case 2:
+ query = new Query$();
+ query.word = queryString.slice(currentWordStart, queryString.length);
+ query.or = nextOr;
+ query.not = nextNot;
+ query.raw = true;
+ $this.queries.push(query);
+ break;
+ }
+ return $this.queries;
+};
+
+var QueryStringParser$parse$LQueryStringParser$S = QueryStringParser.parse$LQueryStringParser$S;
+
+/**
+ * @param {QueryStringParser} $this
+ * @return {!string}
+ */
+QueryStringParser.highlight$LQueryStringParser$ = function ($this) {
+ /** @type {Array.<undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var i;
+ /** @type {Query} */
+ var query;
+ result = [ ];
+ for (i = 0; i < $this.queries.length; i++) {
+ query = $this.queries[i];
+ if (! query.not) {
+ result.push("highlight=" + $__jsx_encodeURIComponent(query.word));
+ }
+ }
+ return '?' + result.join('&');
+};
+
+var QueryStringParser$highlight$LQueryStringParser$ = QueryStringParser.highlight$LQueryStringParser$;
+
+/**
+ * class Proposal extends Object
+ * @constructor
+ */
+function Proposal() {
+}
+
+/**
+ * @constructor
+ * @param {!number} omit
+ * @param {!number} expect
+ */
+function Proposal$II(omit, expect) {
+ this.omit = omit;
+ this.expect = expect;
+};
+
+Proposal$II.prototype = new Proposal;
+
+/**
+ * class Position extends Object
+ * @constructor
+ */
+function Position() {
+}
+
+/**
+ * @constructor
+ * @param {!string} word
+ * @param {!number} position
+ * @param {!boolean} stemmed
+ */
+function Position$SIB(word, position, stemmed) {
+ this.word = word;
+ this.position = position;
+ this.stemmed = stemmed;
+};
+
+Position$SIB.prototype = new Position;
+
+/**
+ * class SearchUnit extends Object
+ * @constructor
+ */
+function SearchUnit() {
+}
+
+/**
+ * @constructor
+ * @param {!number} id
+ */
+function SearchUnit$I(id) {
+ this.positions = ({ });
+ this.id = id;
+ this._size = 0;
+ this.score = 0;
+ this.startPosition = -1;
+};
+
+SearchUnit$I.prototype = new SearchUnit;
+
+/**
+ * @param {SearchUnit} $this
+ * @param {!string} word
+ * @param {!number} position
+ * @param {!boolean} stemmed
+ */
+SearchUnit.addPosition$LSearchUnit$SIB = function ($this, word, position, stemmed) {
+ /** @type {Position} */
+ var positionObj;
+ positionObj = $this.positions[position + ""];
+ if (! positionObj) {
+ $this._size++;
+ $this.positions[position + ""] = ({word: word, position: position, stemmed: stemmed});
+ } else {
+ if (positionObj.word.length < word.length) {
+ positionObj.word = word;
+ }
+ positionObj.stemmed = positionObj.stemmed && stemmed;
+ }
+};
+
+var SearchUnit$addPosition$LSearchUnit$SIB = SearchUnit.addPosition$LSearchUnit$SIB;
+
+/**
+ * @param {SearchUnit} $this
+ * @param {!number} position
+ * @return {Position}
+ */
+SearchUnit.get$LSearchUnit$I = function ($this, position) {
+ return $this.positions[position + ""];
+};
+
+var SearchUnit$get$LSearchUnit$I = SearchUnit.get$LSearchUnit$I;
+
+/**
+ * @param {SearchUnit} $this
+ * @return {!number}
+ */
+SearchUnit.size$LSearchUnit$ = function ($this) {
+ return $this._size;
+};
+
+var SearchUnit$size$LSearchUnit$ = SearchUnit.size$LSearchUnit$;
+
+/**
+ * @param {SearchUnit} $this
+ * @param {SearchUnit} rhs
+ */
+SearchUnit.merge$LSearchUnit$LSearchUnit$ = function ($this, rhs) {
+ /** @type {!string} */
+ var position;
+ /** @type {Position} */
+ var pos;
+ for (position in rhs.positions) {
+ pos = rhs.positions[position];
+ SearchUnit$addPosition$LSearchUnit$SIB($this, pos.word, pos.position, pos.stemmed);
+ }
+};
+
+var SearchUnit$merge$LSearchUnit$LSearchUnit$ = SearchUnit.merge$LSearchUnit$LSearchUnit$;
+
+/**
+ * @param {SearchUnit} $this
+ * @return {Array.<undefined|Position>}
+ */
+SearchUnit.getPositions$LSearchUnit$ = function ($this) {
+ /** @type {Array.<undefined|Position>} */
+ var result;
+ /** @type {!string} */
+ var pos;
+ result = [ ];
+ for (pos in $this.positions) {
+ result.push($this.positions[pos]);
+ }
+ result.sort((function (a, b) {
+ return a.position - b.position;
+ }));
+ return result;
+};
+
+var SearchUnit$getPositions$LSearchUnit$ = SearchUnit.getPositions$LSearchUnit$;
+
+/**
+ * class SingleResult extends Object
+ * @constructor
+ */
+function SingleResult() {
+}
+
+/**
+ * @constructor
+ */
+function SingleResult$() {
+ this.units = [ ];
+ this.unitIds = [ ];
+ this.or = false;
+ this.not = false;
+ this.searchWord = '';
+};
+
+SingleResult$.prototype = new SingleResult;
+
+/**
+ * @constructor
+ * @param {!string} searchWord
+ * @param {!boolean} or
+ * @param {!boolean} not
+ */
+function SingleResult$SBB(searchWord, or, not) {
+ this.units = [ ];
+ this.unitIds = [ ];
+ this.or = or;
+ this.not = not;
+ this.searchWord = searchWord;
+};
+
+SingleResult$SBB.prototype = new SingleResult;
+
+/**
+ * @param {SingleResult} $this
+ * @param {!number} unitId
+ * @return {SearchUnit}
+ */
+SingleResult.getSearchUnit$LSingleResult$I = function ($this, unitId) {
+ /** @type {!number} */
+ var existing;
+ /** @type {SearchUnit} */
+ var result;
+ existing = $this.unitIds.indexOf(unitId);
+ if (existing === -1) {
+ result = ({positions: ({ }), id: unitId, _size: 0, score: 0, startPosition: -1});
+ $this.units.push(result);
+ $this.unitIds.push(unitId);
+ } else {
+ result = $this.units[existing];
+ }
+ return result;
+};
+
+var SingleResult$getSearchUnit$LSingleResult$I = SingleResult.getSearchUnit$LSingleResult$I;
+
+/**
+ * @param {SingleResult} $this
+ * @param {SingleResult} rhs
+ * @return {SingleResult}
+ */
+SingleResult.merge$LSingleResult$LSingleResult$ = function ($this, rhs) {
+ /** @type {SingleResult} */
+ var result;
+ result = ({units: [ ], unitIds: [ ], or: false, not: false, searchWord: ''});
+ if (rhs.or) {
+ SingleResult$_orMerge$LSingleResult$LSingleResult$LSingleResult$($this, result, rhs);
+ } else {
+ if (rhs.not) {
+ SingleResult$_notMerge$LSingleResult$LSingleResult$LSingleResult$($this, result, rhs);
+ } else {
+ SingleResult$_andMerge$LSingleResult$LSingleResult$LSingleResult$($this, result, rhs);
+ }
+ }
+ return result;
+};
+
+var SingleResult$merge$LSingleResult$LSingleResult$ = SingleResult.merge$LSingleResult$LSingleResult$;
+
+/**
+ * @param {SingleResult} $this
+ * @return {!number}
+ */
+SingleResult.size$LSingleResult$ = function ($this) {
+ return ($this.units.length | 0);
+};
+
+var SingleResult$size$LSingleResult$ = SingleResult.size$LSingleResult$;
+
+/**
+ * @param {SingleResult} $this
+ * @param {SingleResult} result
+ * @param {SingleResult} rhs
+ */
+SingleResult._andMerge$LSingleResult$LSingleResult$LSingleResult$ = function ($this, result, rhs) {
+ /** @type {!number} */
+ var i;
+ /** @type {undefined|!number} */
+ var id;
+ /** @type {SearchUnit} */
+ var lhsSection;
+ for (i = 0; i < $this.unitIds.length; i++) {
+ id = $this.unitIds[i];
+ if (rhs.unitIds.indexOf(id) !== -1) {
+ lhsSection = $this.units[i];
+ result.unitIds.push(id);
+ result.units.push(lhsSection);
+ }
+ }
+};
+
+var SingleResult$_andMerge$LSingleResult$LSingleResult$LSingleResult$ = SingleResult._andMerge$LSingleResult$LSingleResult$LSingleResult$;
+
+/**
+ * @param {SingleResult} $this
+ * @param {SingleResult} result
+ * @param {SingleResult} rhs
+ */
+SingleResult._orMerge$LSingleResult$LSingleResult$LSingleResult$ = function ($this, result, rhs) {
+ /** @type {!number} */
+ var i;
+ /** @type {undefined|!number} */
+ var id;
+ /** @type {SearchUnit} */
+ var rhsSection;
+ /** @type {SearchUnit} */
+ var lhsSection;
+ /** @type {Array.<undefined|!number>} */
+ var unitIds$0;
+ /** @type {Array.<undefined|SearchUnit>} */
+ var units$0;
+ result.unitIds = (unitIds$0 = $this.unitIds).slice(0, unitIds$0.length);
+ result.units = (units$0 = $this.units).slice(0, units$0.length);
+ for (i = 0; i < rhs.unitIds.length; i++) {
+ id = rhs.unitIds[i];
+ rhsSection = rhs.units[i];
+ if (result.unitIds.indexOf(id) !== -1) {
+ lhsSection = result.units[result.unitIds.indexOf(id)];
+ SearchUnit$merge$LSearchUnit$LSearchUnit$(lhsSection, rhsSection);
+ } else {
+ result.unitIds.push(id);
+ result.units.push(rhsSection);
+ }
+ }
+};
+
+var SingleResult$_orMerge$LSingleResult$LSingleResult$LSingleResult$ = SingleResult._orMerge$LSingleResult$LSingleResult$LSingleResult$;
+
+/**
+ * @param {SingleResult} $this
+ * @param {SingleResult} result
+ * @param {SingleResult} rhs
+ */
+SingleResult._notMerge$LSingleResult$LSingleResult$LSingleResult$ = function ($this, result, rhs) {
+ /** @type {!number} */
+ var i;
+ /** @type {undefined|!number} */
+ var id;
+ /** @type {SearchUnit} */
+ var lhsSection;
+ for (i = 0; i < $this.unitIds.length; i++) {
+ id = $this.unitIds[i];
+ if (rhs.unitIds.indexOf(id) === -1) {
+ lhsSection = $this.units[i];
+ result.unitIds.push(id);
+ result.units.push(lhsSection);
+ }
+ }
+};
+
+var SingleResult$_notMerge$LSingleResult$LSingleResult$LSingleResult$ = SingleResult._notMerge$LSingleResult$LSingleResult$LSingleResult$;
+
+/**
+ * class SearchSummary extends Object
+ * @constructor
+ */
+function SearchSummary() {
+}
+
+/**
+ * @constructor
+ */
+function SearchSummary$() {
+ this.sourceResults = [ ];
+ this.result = null;
+ this.oktavia = null;
+};
+
+SearchSummary$.prototype = new SearchSummary;
+
+/**
+ * @constructor
+ * @param {Oktavia} oktavia
+ */
+function SearchSummary$LOktavia$(oktavia) {
+ this.sourceResults = [ ];
+ this.result = null;
+ this.oktavia = oktavia;
+};
+
+SearchSummary$LOktavia$.prototype = new SearchSummary;
+
+/**
+ * @param {SearchSummary} $this
+ * @param {SingleResult} result
+ */
+SearchSummary.addQuery$LSearchSummary$LSingleResult$ = function ($this, result) {
+ $this.sourceResults.push(result);
+};
+
+var SearchSummary$addQuery$LSearchSummary$LSingleResult$ = SearchSummary.addQuery$LSearchSummary$LSingleResult$;
+
+/**
+ * @param {SearchSummary} $this
+ */
+SearchSummary.mergeResult$LSearchSummary$ = function ($this) {
+ $this.result = SearchSummary$mergeResult$LSearchSummary$ALSingleResult$($this, $this.sourceResults);
+};
+
+var SearchSummary$mergeResult$LSearchSummary$ = SearchSummary.mergeResult$LSearchSummary$;
+
+/**
+ * @param {SearchSummary} $this
+ * @param {Array.<undefined|SingleResult>} results
+ * @return {SingleResult}
+ */
+SearchSummary.mergeResult$LSearchSummary$ALSingleResult$ = function ($this, results) {
+ /** @type {SingleResult} */
+ var rhs;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var results$len$0;
+ rhs = results[0];
+ for ((i = 1, results$len$0 = results.length); i < results$len$0; i++) {
+ rhs = SingleResult$merge$LSingleResult$LSingleResult$(rhs, results[i]);
+ }
+ return rhs;
+};
+
+var SearchSummary$mergeResult$LSearchSummary$ALSingleResult$ = SearchSummary.mergeResult$LSearchSummary$ALSingleResult$;
+
+/**
+ * @param {SearchSummary} $this
+ * @return {Array.<undefined|Proposal>}
+ */
+SearchSummary.getProposal$LSearchSummary$ = function ($this) {
+ /** @type {Array.<undefined|Proposal>} */
+ var proposals;
+ /** @type {!number} */
+ var i;
+ /** @type {Array.<undefined|SingleResult>} */
+ var tmpSource;
+ /** @type {!number} */
+ var j;
+ /** @type {SingleResult} */
+ var result;
+ proposals = [ ];
+ for (i = 0; i < $this.sourceResults.length; i++) {
+ tmpSource = [ ];
+ for (j = 0; j < $this.sourceResults.length; j++) {
+ if (i !== j) {
+ tmpSource.push($this.sourceResults[j]);
+ }
+ }
+ result = SearchSummary$mergeResult$LSearchSummary$ALSingleResult$($this, tmpSource);
+ proposals.push(({omit: i, expect: result.units.length}));
+ }
+ proposals.sort((function (a, b) {
+ return b.expect - a.expect;
+ }));
+ return proposals;
+};
+
+var SearchSummary$getProposal$LSearchSummary$ = SearchSummary.getProposal$LSearchSummary$;
+
+/**
+ * @param {SearchSummary} $this
+ * @return {Array.<undefined|SearchUnit>}
+ */
+SearchSummary.getSortedResult$LSearchSummary$ = function ($this) {
+ /** @type {Array.<undefined|SearchUnit>} */
+ var result;
+ /** @type {Array.<undefined|SearchUnit>} */
+ var units$0;
+ result = (units$0 = $this.result.units).slice(0, units$0.length);
+ result.sort((function (a, b) {
+ return b.score - a.score;
+ }));
+ return result;
+};
+
+var SearchSummary$getSortedResult$LSearchSummary$ = SearchSummary.getSortedResult$LSearchSummary$;
+
+/**
+ * @param {SearchSummary} $this
+ * @return {!number}
+ */
+SearchSummary.size$LSearchSummary$ = function ($this) {
+ /** @type {SingleResult} */
+ var this$0;
+ this$0 = $this.result;
+ return (this$0.units.length | 0);
+};
+
+var SearchSummary$size$LSearchSummary$ = SearchSummary.size$LSearchSummary$;
+
+/**
+ * @param {SearchSummary} $this
+ * @param {SingleResult} result
+ */
+SearchSummary.add$LSearchSummary$LSingleResult$ = function ($this, result) {
+ $this.sourceResults.push(result);
+};
+
+var SearchSummary$add$LSearchSummary$LSingleResult$ = SearchSummary.add$LSearchSummary$LSingleResult$;
+
+/**
+ * class Style extends Object
+ * @constructor
+ */
+function Style() {
+}
+
+/**
+ * @constructor
+ * @param {!string} mode
+ */
+function Style$S(mode) {
+ this.styles = null;
+ this.escapeHTML = false;
+ switch (mode) {
+ case 'console':
+ this.styles = Style.console;
+ break;
+ case 'html':
+ this.styles = Style.html;
+ break;
+ case 'ignore':
+ this.styles = Style.ignore;
+ break;
+ default:
+ this.styles = Style.ignore;
+ break;
+ }
+ this.escapeHTML = mode === 'html';
+};
+
+Style$S.prototype = new Style;
+
+/**
+ * @param {!string} source
+ * @return {!string}
+ */
+Style.prototype.convert$S = function (source) {
+ /** @type {_HTMLHandler} */
+ var handler;
+ /** @type {SAXParser} */
+ var parser;
+ handler = new _HTMLHandler$HASB(this.styles, this.escapeHTML);
+ parser = new SAXParser$LSAXHandler$(handler);
+ parser.parse$S(source);
+ return handler.text.join('');
+};
+
+/**
+ * class Stemmer
+ * @constructor
+ */
+function Stemmer() {
+}
+
+Stemmer.prototype.$__jsx_implements_Stemmer = true;
+
+/**
+ * @constructor
+ */
+function Stemmer$() {
+};
+
+Stemmer$.prototype = new Stemmer;
+
+/**
+ * class Metadata extends Object
+ * @constructor
+ */
+function Metadata() {
+}
+
+/**
+ * @constructor
+ * @param {Oktavia} parent
+ */
+function Metadata$LOktavia$(parent) {
+ this._parent = parent;
+ this._bitVector = new BitVector$();
+};
+
+Metadata$LOktavia$.prototype = new Metadata;
+
+/**
+ * @return {!number}
+ */
+Metadata.prototype._size$ = function () {
+ /** @type {BitVector} */
+ var this$0;
+ /** @type {!number} */
+ var i$0;
+ /** @type {BitVector} */
+ var _bitVector$0;
+ this$0 = _bitVector$0 = this._bitVector;
+ i$0 = _bitVector$0._size;
+ return this$0.rank$IB(i$0, true);
+};
+
+/**
+ * @param {!number} index
+ * @return {!string}
+ */
+Metadata.prototype.getContent$I = function (index) {
+ /** @type {!number} */
+ var startPosition;
+ /** @type {!number} */
+ var length;
+ if (index < 0 || this._size$() <= index) {
+ throw new Error("Section.getContent() : range error " + (index + ""));
+ }
+ startPosition = 0;
+ if (index > 0) {
+ startPosition = this._bitVector.select$I(index - 1) + 1;
+ }
+ length = this._bitVector.select$I(index) - startPosition + 1;
+ return this._parent._getSubstring$II(startPosition, length);
+};
+
+/**
+ * @param {!number} index
+ * @return {!number}
+ */
+Metadata.prototype.getStartPosition$I = function (index) {
+ /** @type {!number} */
+ var startPosition;
+ if (index < 0 || this._size$() <= index) {
+ throw new Error("Section.getContent() : range error " + (index + ""));
+ }
+ startPosition = 0;
+ if (index > 0) {
+ startPosition = this._bitVector.select$I(index - 1) + 1;
+ }
+ return (startPosition | 0);
+};
+
+/**
+ * @param {SingleResult} result
+ * @param {Array.<undefined|!number>} positions
+ * @param {!string} word
+ * @param {!boolean} stemmed
+ */
+Metadata.prototype.grouping$LSingleResult$AISB = function (result, positions, word, stemmed) {
+};
+
+/**
+ * @param {!number} index
+ * @return {!string}
+ */
+Metadata.prototype.getInformation$I = function (index) {
+ return '';
+};
+
+/**
+ */
+Metadata.prototype._build$ = function () {
+ this._bitVector.build$();
+};
+
+/**
+ * @param {!string} name
+ * @param {!string} data
+ * @param {!number} offset
+ * @return {!number}
+ */
+Metadata.prototype._load$SSI = function (name, data, offset) {
+ offset = this._bitVector.load$SI(data, offset);
+ this._parent._metadataLabels.push(name);
+ this._parent._metadatas[name] = this;
+ return offset;
+};
+
+/**
+ * @return {!string}
+ */
+Metadata.prototype._dump$ = function () {
+ /** @type {BitVector} */
+ var this$0;
+ /** @type {Array.<undefined|!string>} */
+ var contents$0;
+ this$0 = this._bitVector;
+ contents$0 = [ ];
+ contents$0.push(Binary$dump32bitNumber$N(this$0._size));
+ contents$0.push(Binary$dump32bitNumberList$AN(this$0._v));
+ return contents$0.join('');
+};
+
+/**
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+Metadata.prototype._dump$LCompressionReport$ = function (report) {
+ /** @type {BitVector} */
+ var this$0;
+ /** @type {Array.<undefined|!string>} */
+ var contents$0;
+ this$0 = this._bitVector;
+ contents$0 = [ ];
+ contents$0.push(Binary$dump32bitNumber$N(this$0._size));
+ CompressionReport$add$LCompressionReport$II(report, 2, 2);
+ contents$0.push(Binary$dump32bitNumberList$ANLCompressionReport$(this$0._v, report));
+ return contents$0.join('');
+};
+
+/**
+ * class Section extends Metadata
+ * @constructor
+ */
+function Section() {
+}
+
+Section.prototype = new Metadata;
+/**
+ * @constructor
+ * @param {Oktavia} parent
+ */
+function Section$LOktavia$(parent) {
+ this._parent = parent;
+ this._bitVector = new BitVector$();
+ this._names = [ ];
+};
+
+Section$LOktavia$.prototype = new Section;
+
+/**
+ * @param {!string} name
+ */
+Section.prototype.setTail$S = function (name) {
+ /** @type {!number} */
+ var index$0;
+ /** @type {Oktavia} */
+ var this$0;
+ /** @type {FMIndex} */
+ var this$0$0;
+ this$0 = this._parent;
+ this$0$0 = this$0._fmindex;
+ index$0 = this$0$0._substr.length;
+ this._names.push(name);
+ this._bitVector.set$I(index$0 - 1);
+};
+
+/**
+ * @param {!string} name
+ * @param {!number} index
+ */
+Section.prototype.setTail$SI = function (name, index) {
+ this._names.push(name);
+ this._bitVector.set$I(index - 1);
+};
+
+/**
+ * @return {!number}
+ */
+Section.prototype.size$ = function () {
+ return (this._names.length | 0);
+};
+
+/**
+ * @param {!number} position
+ * @return {!number}
+ */
+Section.prototype.getSectionIndex$I = function (position) {
+ /** @type {BitVector} */
+ var this$0;
+ if (position < 0 || this._bitVector.size$() <= position) {
+ throw new Error("Section.getSectionIndex() : range error " + (position + ""));
+ }
+ this$0 = this._bitVector;
+ return this$0.rank$IB(position, true);
+};
+
+/**
+ * @param {!number} index
+ * @return {!string}
+ */
+Section.prototype.getName$I = function (index) {
+ if (index < 0 || this._names.length <= index) {
+ throw new Error("Section.getName() : range error");
+ }
+ return this._names[index];
+};
+
+/**
+ * @param {SingleResult} result
+ * @param {Array.<undefined|!number>} positions
+ * @param {!string} word
+ * @param {!boolean} stemmed
+ */
+Section.prototype.grouping$LSingleResult$AISB = function (result, positions, word, stemmed) {
+ /** @type {!number} */
+ var i;
+ /** @type {undefined|!number} */
+ var position;
+ /** @type {!number} */
+ var index;
+ /** @type {SearchUnit} */
+ var unit;
+ for (i = 0; i < positions.length; i++) {
+ position = positions[i];
+ index = this.getSectionIndex$I(position);
+ unit = SingleResult$getSearchUnit$LSingleResult$I(result, index);
+ if (unit.startPosition < 0) {
+ unit.startPosition = this.getStartPosition$I(index);
+ }
+ SearchUnit$addPosition$LSearchUnit$SIB(unit, word, position - unit.startPosition, stemmed);
+ }
+};
+
+/**
+ * @param {!number} index
+ * @return {!string}
+ */
+Section.prototype.getInformation$I = function (index) {
+ return this.getName$I(index);
+};
+
+/**
+ * @param {Oktavia} parent
+ * @param {!string} name
+ * @param {!string} data
+ * @param {!number} offset
+ * @return {!number}
+ */
+Section._load$LOktavia$SSI = function (parent, name, data, offset) {
+ /** @type {LoadedStringListResult} */
+ var strs;
+ /** @type {Section} */
+ var section;
+ /** @type {!number} */
+ var offset$0;
+ strs = new LoadedStringListResult$SI(data, offset);
+ section = new Section$LOktavia$(parent);
+ section._names = strs.result;
+ offset$0 = strs.offset;
+ offset$0 = section._bitVector.load$SI(data, offset$0);
+ section._parent._metadataLabels.push(name);
+ section._parent._metadatas[name] = section;
+ return offset$0;
+};
+
+var Section$_load$LOktavia$SSI = Section._load$LOktavia$SSI;
+
+/**
+ * @return {!string}
+ */
+Section.prototype._dump$ = function () {
+ return [ Binary$dump16bitNumber$I(0), Binary$dumpStringList$AS(this._names), Metadata.prototype._dump$.call(this) ].join('');
+};
+
+/**
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+Section.prototype._dump$LCompressionReport$ = function (report) {
+ CompressionReport$add$LCompressionReport$II(report, 1, 1);
+ return [ Binary$dump16bitNumber$I(0), Binary$dumpStringList$ASLCompressionReport$(this._names, report), Metadata.prototype._dump$LCompressionReport$.call(this, report) ].join('');
+};
+
+/**
+ * class Splitter extends Metadata
+ * @constructor
+ */
+function Splitter() {
+}
+
+Splitter.prototype = new Metadata;
+/**
+ * @constructor
+ * @param {Oktavia} parent
+ */
+function Splitter$LOktavia$(parent) {
+ this._parent = parent;
+ this._bitVector = new BitVector$();
+ this.name = null;
+};
+
+Splitter$LOktavia$.prototype = new Splitter;
+
+/**
+ * @constructor
+ * @param {Oktavia} parent
+ * @param {!string} name
+ */
+function Splitter$LOktavia$S(parent, name) {
+ this._parent = parent;
+ this._bitVector = new BitVector$();
+ this.name = name;
+};
+
+Splitter$LOktavia$S.prototype = new Splitter;
+
+/**
+ * @return {!number}
+ */
+Splitter.prototype.size$ = function () {
+ /** @type {BitVector} */
+ var this$0$0;
+ /** @type {!number} */
+ var i$0$0;
+ /** @type {BitVector} */
+ var _bitVector$0;
+ this$0$0 = _bitVector$0 = this._bitVector;
+ i$0$0 = _bitVector$0._size;
+ return this$0$0.rank$IB(i$0$0, true);
+};
+
+/**
+ */
+Splitter.prototype.split$ = function () {
+ /** @type {!number} */
+ var index$0;
+ /** @type {Oktavia} */
+ var this$0;
+ /** @type {FMIndex} */
+ var this$0$0;
+ this$0 = this._parent;
+ this$0$0 = this$0._fmindex;
+ index$0 = this$0$0._substr.length;
+ this._bitVector.set$I(index$0 - 1);
+};
+
+/**
+ * @param {!number} index
+ */
+Splitter.prototype.split$I = function (index) {
+ this._bitVector.set$I(index - 1);
+};
+
+/**
+ * @param {!number} position
+ * @return {!number}
+ */
+Splitter.prototype.getIndex$I = function (position) {
+ /** @type {BitVector} */
+ var this$0;
+ if (position < 0 || this._bitVector.size$() <= position) {
+ throw new Error("Section.getSectionIndex() : range error");
+ }
+ this$0 = this._bitVector;
+ return this$0.rank$IB(position, true);
+};
+
+/**
+ * @param {SingleResult} result
+ * @param {Array.<undefined|!number>} positions
+ * @param {!string} word
+ * @param {!boolean} stemmed
+ */
+Splitter.prototype.grouping$LSingleResult$AISB = function (result, positions, word, stemmed) {
+ /** @type {!number} */
+ var i;
+ /** @type {undefined|!number} */
+ var position;
+ /** @type {!number} */
+ var index;
+ /** @type {SearchUnit} */
+ var unit;
+ for (i = 0; i < positions.length; i++) {
+ position = positions[i];
+ index = this.getIndex$I(position);
+ unit = SingleResult$getSearchUnit$LSingleResult$I(result, index);
+ if (unit.startPosition < 0) {
+ unit.startPosition = this.getStartPosition$I(index);
+ }
+ SearchUnit$addPosition$LSearchUnit$SIB(unit, word, position - unit.startPosition, stemmed);
+ }
+};
+
+/**
+ * @param {!number} index
+ * @return {!string}
+ */
+Splitter.prototype.getInformation$I = function (index) {
+ return (this.name != null ? this.name + (index + 1 + "") : '');
+};
+
+/**
+ * @param {Oktavia} parent
+ * @param {!string} name
+ * @param {!string} data
+ * @param {!number} offset
+ * @return {!number}
+ */
+Splitter._load$LOktavia$SSI = function (parent, name, data, offset) {
+ /** @type {Splitter} */
+ var section;
+ section = new Splitter$LOktavia$(parent);
+ offset = section._bitVector.load$SI(data, offset);
+ section._parent._metadataLabels.push(name);
+ section._parent._metadatas[name] = section;
+ return offset;
+};
+
+var Splitter$_load$LOktavia$SSI = Splitter._load$LOktavia$SSI;
+
+/**
+ * @return {!string}
+ */
+Splitter.prototype._dump$ = function () {
+ return [ Binary$dump16bitNumber$I(1), Metadata.prototype._dump$.call(this) ].join('');
+};
+
+/**
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+Splitter.prototype._dump$LCompressionReport$ = function (report) {
+ CompressionReport$add$LCompressionReport$II(report, 1, 1);
+ return [ Binary$dump16bitNumber$I(1), Metadata.prototype._dump$LCompressionReport$.call(this, report) ].join('');
+};
+
+/**
+ * class Table extends Metadata
+ * @constructor
+ */
+function Table() {
+}
+
+Table.prototype = new Metadata;
+/**
+ * @constructor
+ * @param {Oktavia} parent
+ * @param {Array.<undefined|!string>} headers
+ */
+function Table$LOktavia$AS(parent, headers) {
+ this._parent = parent;
+ this._bitVector = new BitVector$();
+ this._headers = headers;
+ this._columnTails = new BitVector$();
+};
+
+Table$LOktavia$AS.prototype = new Table;
+
+/**
+ * @return {!number}
+ */
+Table.prototype.rowSize$ = function () {
+ /** @type {BitVector} */
+ var this$0$0;
+ /** @type {!number} */
+ var i$0$0;
+ /** @type {BitVector} */
+ var _bitVector$0;
+ this$0$0 = _bitVector$0 = this._bitVector;
+ i$0$0 = _bitVector$0._size;
+ return this$0$0.rank$IB(i$0$0, true);
+};
+
+/**
+ * @return {!number}
+ */
+Table.prototype.columnSize$ = function () {
+ return (this._headers.length | 0);
+};
+
+/**
+ */
+Table.prototype.setColumnTail$ = function () {
+ /** @type {!number} */
+ var index;
+ /** @type {Oktavia} */
+ var this$0;
+ /** @type {FMIndex} */
+ var this$0$0;
+ /** @type {Oktavia} */
+ var _parent$0;
+ this$0 = _parent$0 = this._parent;
+ this$0$0 = this$0._fmindex;
+ index = this$0$0._substr.length;
+ _parent$0._fmindex.push$S(Oktavia.eob);
+ this._columnTails.set$I(index - 1);
+};
+
+/**
+ */
+Table.prototype.setRowTail$ = function () {
+ /** @type {!number} */
+ var index;
+ /** @type {Oktavia} */
+ var this$0;
+ /** @type {FMIndex} */
+ var this$0$0;
+ this$0 = this._parent;
+ this$0$0 = this$0._fmindex;
+ index = this$0$0._substr.length;
+ this._bitVector.set$I(index - 1);
+};
+
+/**
+ * @param {!number} position
+ * @return {Array.<undefined|!number>}
+ */
+Table.prototype.getCell$I = function (position) {
+ /** @type {!number} */
+ var row;
+ /** @type {!number} */
+ var currentColumn;
+ /** @type {!number} */
+ var lastRowColumn;
+ /** @type {!number} */
+ var startPosition;
+ /** @type {Array.<undefined|!number>} */
+ var result;
+ /** @type {BitVector} */
+ var this$0;
+ /** @type {BitVector} */
+ var this$1;
+ if (position < 0 || this._bitVector.size$() <= position) {
+ throw new Error("Section.getSectionIndex() : range error " + (position + ""));
+ }
+ this$0 = this._bitVector;
+ row = this$0.rank$IB(position, true);
+ this$1 = this._columnTails;
+ currentColumn = this$1.rank$IB(position, true);
+ lastRowColumn = 0;
+ if (row > 0) {
+ startPosition = this._bitVector.select$I(row - 1) + 1;
+ lastRowColumn = this._columnTails.rank$I(startPosition);
+ }
+ result = [ row, currentColumn - lastRowColumn ];
+ return result;
+};
+
+/**
+ * @param {!number} rowIndex
+ * @return {Object.<string, undefined|!string>}
+ */
+Table.prototype.getRowContent$I = function (rowIndex) {
+ /** @type {!string} */
+ var content;
+ /** @type {Array.<undefined|!string>} */
+ var values;
+ /** @type {Object.<string, undefined|!string>} */
+ var result;
+ /** @type {!number} */
+ var i;
+ content = this.getContent$I(rowIndex);
+ values = content.split(Oktavia.eob, this._headers.length);
+ result = ({ });
+ for (i in this._headers) {
+ if (i < values.length) {
+ result[this._headers[i]] = values[i];
+ } else {
+ result[this._headers[i]] = '';
+ }
+ }
+ return result;
+};
+
+/**
+ * @param {SingleResult} result
+ * @param {Array.<undefined|!number>} positions
+ * @param {!string} word
+ * @param {!boolean} stemmed
+ */
+Table.prototype.grouping$LSingleResult$AISB = function (result, positions, word, stemmed) {
+};
+
+/**
+ * @param {!number} index
+ * @return {!string}
+ */
+Table.prototype.getInformation$I = function (index) {
+ return '';
+};
+
+/**
+ */
+Table.prototype._build$ = function () {
+ this._bitVector.build$();
+ this._columnTails.build$();
+};
+
+/**
+ * @param {Oktavia} parent
+ * @param {!string} name
+ * @param {!string} data
+ * @param {!number} offset
+ * @return {!number}
+ */
+Table._load$LOktavia$SSI = function (parent, name, data, offset) {
+ /** @type {LoadedStringListResult} */
+ var strs;
+ /** @type {Table} */
+ var table;
+ /** @type {!number} */
+ var offset$0;
+ strs = new LoadedStringListResult$SI(data, offset);
+ table = new Table$LOktavia$AS(parent, strs.result);
+ offset$0 = strs.offset;
+ offset$0 = table._bitVector.load$SI(data, offset$0);
+ table._parent._metadataLabels.push(name);
+ table._parent._metadatas[name] = table;
+ offset = offset$0;
+ return table._columnTails.load$SI(data, offset$0);
+};
+
+var Table$_load$LOktavia$SSI = Table._load$LOktavia$SSI;
+
+/**
+ * @return {!string}
+ */
+Table.prototype._dump$ = function () {
+ return [ Binary$dump16bitNumber$I(2), Binary$dumpStringList$AS(this._headers), Metadata.prototype._dump$.call(this), this._columnTails.dump$() ].join('');
+};
+
+/**
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+Table.prototype._dump$LCompressionReport$ = function (report) {
+ CompressionReport$add$LCompressionReport$II(report, 1, 1);
+ return [ Binary$dump16bitNumber$I(2), Binary$dumpStringList$ASLCompressionReport$(this._headers, report), Metadata.prototype._dump$LCompressionReport$.call(this, report), this._columnTails.dump$LCompressionReport$(report) ].join('');
+};
+
+/**
+ * class Block extends Metadata
+ * @constructor
+ */
+function Block() {
+}
+
+Block.prototype = new Metadata;
+/**
+ * @constructor
+ * @param {Oktavia} parent
+ */
+function Block$LOktavia$(parent) {
+ this._parent = parent;
+ this._bitVector = new BitVector$();
+ this._names = [ ];
+ this._start = false;
+};
+
+Block$LOktavia$.prototype = new Block;
+
+/**
+ * @param {!string} blockName
+ */
+Block.prototype.startBlock$S = function (blockName) {
+ this.startBlock$SI(blockName, this._parent.contentSize$());
+};
+
+/**
+ * @param {!string} blockName
+ * @param {!number} index
+ */
+Block.prototype.startBlock$SI = function (blockName, index) {
+ if (this._start) {
+ throw new Error('Splitter `' + this._names[this._names.length - 1] + '` is not closed');
+ }
+ this._start = true;
+ this._names.push(blockName);
+ this._bitVector.set$I(index - 1);
+};
+
+/**
+ */
+Block.prototype.endBlock$ = function () {
+ this.endBlock$I(this._parent.contentSize$());
+};
+
+/**
+ * @param {!number} index
+ */
+Block.prototype.endBlock$I = function (index) {
+ if (! this._start) {
+ throw new Error('Splitter is not started');
+ }
+ this._start = false;
+ this._bitVector.set$I(index - 1);
+};
+
+/**
+ * @return {!number}
+ */
+Block.prototype.size$ = function () {
+ return (this._names.length | 0);
+};
+
+/**
+ * @param {!number} position
+ * @return {!number}
+ */
+Block.prototype.blockIndex$I = function (position) {
+ /** @type {!number} */
+ var result;
+ /** @type {BitVector} */
+ var this$0;
+ if (position < 0 || this._parent._fmindex.size$() - 1 <= position) {
+ throw new Error("Block.blockIndex() : range error " + (position + ""));
+ }
+ if (position >= this._bitVector.size$()) {
+ position = (this._bitVector.size$() - 1 | 0);
+ result = (this._bitVector.rank$I(position) + 1 | 0);
+ } else {
+ this$0 = this._bitVector;
+ result = this$0.rank$IB(position, true);
+ }
+ return result;
+};
+
+/**
+ * @param {!number} position
+ * @return {!boolean}
+ */
+Block.prototype.inBlock$I = function (position) {
+ /** @type {!number} */
+ var blockIndex;
+ blockIndex = this.blockIndex$I(position);
+ return blockIndex % 2 !== 0;
+};
+
+/**
+ * @param {!number} position
+ * @return {!string}
+ */
+Block.prototype.getBlockContent$I = function (position) {
+ /** @type {!number} */
+ var blockIndex;
+ /** @type {!string} */
+ var result;
+ blockIndex = this.blockIndex$I(position);
+ if (blockIndex % 2 !== 0) {
+ result = this.getContent$I(blockIndex);
+ } else {
+ result = '';
+ }
+ return result;
+};
+
+/**
+ * @param {!number} position
+ * @return {!string}
+ */
+Block.prototype.getBlockName$I = function (position) {
+ /** @type {!number} */
+ var blockIndex;
+ /** @type {!string} */
+ var result;
+ blockIndex = this.blockIndex$I(position);
+ if (blockIndex % 2 !== 0) {
+ result = this._names[blockIndex >>> 1];
+ } else {
+ result = '';
+ }
+ return result;
+};
+
+/**
+ * @param {SingleResult} result
+ * @param {Array.<undefined|!number>} positions
+ * @param {!string} word
+ * @param {!boolean} stemmed
+ */
+Block.prototype.grouping$LSingleResult$AISB = function (result, positions, word, stemmed) {
+};
+
+/**
+ * @param {!number} index
+ * @return {!string}
+ */
+Block.prototype.getInformation$I = function (index) {
+ return '';
+};
+
+/**
+ * @param {Oktavia} parent
+ * @param {!string} name
+ * @param {!string} data
+ * @param {!number} offset
+ * @return {!number}
+ */
+Block._load$LOktavia$SSI = function (parent, name, data, offset) {
+ /** @type {LoadedStringListResult} */
+ var strs;
+ /** @type {Block} */
+ var block;
+ /** @type {!number} */
+ var offset$0;
+ strs = new LoadedStringListResult$SI(data, offset);
+ block = new Block$LOktavia$(parent);
+ block._names = strs.result;
+ offset$0 = strs.offset;
+ offset$0 = block._bitVector.load$SI(data, offset$0);
+ block._parent._metadataLabels.push(name);
+ block._parent._metadatas[name] = block;
+ return offset$0;
+};
+
+var Block$_load$LOktavia$SSI = Block._load$LOktavia$SSI;
+
+/**
+ * @return {!string}
+ */
+Block.prototype._dump$ = function () {
+ return [ Binary$dump16bitNumber$I(3), Binary$dumpStringList$AS(this._names), Metadata.prototype._dump$.call(this) ].join('');
+};
+
+/**
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+Block.prototype._dump$LCompressionReport$ = function (report) {
+ CompressionReport$add$LCompressionReport$II(report, 1, 1);
+ return [ Binary$dump16bitNumber$I(3), Binary$dumpStringList$ASLCompressionReport$(this._names, report), Metadata.prototype._dump$LCompressionReport$.call(this, report) ].join('');
+};
+
+/**
+ * class FMIndex extends Object
+ * @constructor
+ */
+function FMIndex() {
+}
+
+/**
+ * @constructor
+ */
+function FMIndex$() {
+ /** @type {Array.<undefined|!number>} */
+ var _rlt$0;
+ this._ssize = 0;
+ (this._ddic = 0, this._head = 0);
+ this._substr = "";
+ this._sv = new WaveletMatrix$();
+ this._posdic = [ ];
+ this._idic = [ ];
+ _rlt$0 = this._rlt = [ ];
+ _rlt$0.length = 65536;
+};
+
+FMIndex$.prototype = new FMIndex;
+
+/**
+ */
+FMIndex.prototype.clear$ = function () {
+ /** @type {WaveletMatrix} */
+ var this$0;
+ this$0 = this._sv;
+ this$0._bv.length = 0;
+ this$0._seps.length = 0;
+ this$0._size = 0;
+ this._posdic.length = 0;
+ this._idic.length = 0;
+ this._ddic = 0;
+ this._head = 0;
+ this._substr = "";
+};
+
+/**
+ * @return {!number}
+ */
+FMIndex.prototype.size$ = function () {
+ /** @type {WaveletMatrix} */
+ var this$0;
+ this$0 = this._sv;
+ return this$0._size;
+};
+
+/**
+ * @return {!number}
+ */
+FMIndex.prototype.contentSize$ = function () {
+ return this._substr.length;
+};
+
+/**
+ * @param {!string} key
+ * @return {!number}
+ */
+FMIndex.prototype.getRows$S = function (key) {
+ /** @type {Array.<undefined|!number>} */
+ var pos;
+ pos = [ ];
+ return this.getRows$SAI(key, pos);
+};
+
+/**
+ * @param {!string} key
+ * @param {Array.<undefined|!number>} pos
+ * @return {!number}
+ */
+FMIndex.prototype.getRows$SAI = function (key, pos) {
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var code;
+ /** @type {!number} */
+ var first;
+ /** @type {undefined|!number} */
+ var last;
+ /** @type {!number} */
+ var c;
+ /** @type {Array.<undefined|!number>} */
+ var _rlt$0;
+ i = key.length - 1;
+ code = key.charCodeAt(i);
+ first = (_rlt$0 = this._rlt)[code] + 1;
+ last = _rlt$0[code + 1];
+ while (first <= last) {
+ if (i === 0) {
+ pos[0] = (-- first | 0);
+ pos[1] = -- last;
+ return (last - first + 1 | 0);
+ }
+ i--;
+ c = key.charCodeAt(i);
+ first = this._rlt[c] + this._sv.rank$II(first - 1, c) + 1;
+ last = this._rlt[c] + this._sv.rank$II(last, c);
+ }
+ return 0;
+};
+
+/**
+ * @param {!number} i
+ * @return {!number}
+ */
+FMIndex.prototype.getPosition$I = function (i) {
+ /** @type {!number} */
+ var pos;
+ /** @type {!number} */
+ var c;
+ if (i >= this.size$()) {
+ throw new Error("FMIndex.getPosition() : range error");
+ }
+ pos = 0;
+ while (i !== this._head) {
+ if (i % this._ddic === 0) {
+ pos += this._posdic[i / this._ddic] + 1;
+ break;
+ }
+ c = this._sv.get$I(i);
+ i = this._rlt[c] + this._sv.rank$II(i, c);
+ pos++;
+ }
+ return (pos % this.size$() | 0);
+};
+
+/**
+ * @param {!number} pos
+ * @param {!number} len
+ * @return {!string}
+ */
+FMIndex.prototype.getSubstring$II = function (pos, len) {
+ /** @type {!number} */
+ var pos_end;
+ /** @type {!number} */
+ var pos_tmp;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var pos_idic;
+ /** @type {!string} */
+ var substr;
+ /** @type {!number} */
+ var c;
+ /** @type {!number} */
+ var _ddic$0;
+ if (pos >= this.size$()) {
+ throw new Error("FMIndex.getSubstring() : range error");
+ }
+ pos_end = Math.min(pos + len, this.size$());
+ pos_tmp = this.size$() - 1;
+ i = this._head;
+ pos_idic = Math.floor((pos_end + (_ddic$0 = this._ddic) - 2) / _ddic$0);
+ if (pos_idic < this._idic.length) {
+ pos_tmp = pos_idic * this._ddic;
+ i = this._idic[pos_idic];
+ }
+ substr = "";
+ while (pos_tmp >= pos) {
+ c = this._sv.get$I(i);
+ i = this._rlt[c] + this._sv.rank$II(i, c);
+ if (pos_tmp < pos_end) {
+ substr = String.fromCharCode(c) + substr;
+ }
+ if (pos_tmp === 0) {
+ break;
+ }
+ pos_tmp--;
+ }
+ return substr;
+};
+
+/**
+ */
+FMIndex.prototype.build$ = function () {
+ this.build$SIIB(String.fromCharCode(0), 65535, 20, false);
+};
+
+/**
+ * @param {!string} end_marker
+ * @param {!number} ddic
+ * @param {!boolean} verbose
+ */
+FMIndex.prototype.build$SIB = function (end_marker, ddic, verbose) {
+ this.build$SIIB(end_marker, 65535, ddic, verbose);
+};
+
+/**
+ * @param {!string} end_marker
+ * @param {!number} maxChar
+ * @param {!number} ddic
+ * @param {!boolean} verbose
+ */
+FMIndex.prototype.build$SIIB = function (end_marker, maxChar, ddic, verbose) {
+ /** @type {BurrowsWheelerTransform} */
+ var b;
+ /** @type {!string} */
+ var s;
+ /** @type {!number} */
+ var c;
+ /** @type {!string} */
+ var str$0;
+ /** @type {WaveletMatrix} */
+ var this$0;
+ /** @type {!string} */
+ var _str$0;
+ /** @type {Array.<undefined|!number>} */
+ var _suffixarray$0;
+ if (verbose) {
+ console.time("building burrows-wheeler transform");
+ }
+ this._substr += end_marker;
+ b = ({_str: "", _size: 0, _head: 0, _suffixarray: [ ]});
+ str$0 = this._substr;
+ _str$0 = b._str = str$0;
+ b._size = _str$0.length;
+ _suffixarray$0 = b._suffixarray = SAIS$make$S(str$0);
+ b._head = (_suffixarray$0.indexOf(0) | 0);
+ s = BurrowsWheelerTransform$get$LBurrowsWheelerTransform$(b);
+ this._ssize = s.length;
+ this._head = b._head;
+ b._str = "";
+ b._size = 0;
+ b._head = 0;
+ b._suffixarray.length = 0;
+ this._substr = "";
+ if (verbose) {
+ console.timeEnd("building burrows-wheeler transform");
+ }
+ if (verbose) {
+ console.time("building wavelet matrix");
+ }
+ this$0 = this._sv;
+ this$0._bitsize = (Math.ceil(Math.log(maxChar) / 0.6931471805599453) | 0);
+ if (verbose) {
+ console.log(" maxCharCode: ", maxChar);
+ console.log(" bitSize: ", this._sv.bitsize$());
+ }
+ this._sv.build$S(s);
+ if (verbose) {
+ console.timeEnd("building wavelet matrix");
+ }
+ if (verbose) {
+ console.time("caching rank less than");
+ }
+ for (c = 0; c < maxChar; c++) {
+ this._rlt[c] = this._sv.rank_less_than$II(this._sv.size$(), c);
+ }
+ if (verbose) {
+ console.timeEnd("caching rank less than");
+ }
+ this._ddic = ddic;
+ if (verbose) {
+ console.time("building dictionaries");
+ }
+ this._buildDictionaries$();
+ if (verbose) {
+ console.timeEnd("building dictionaries");
+ console.log('');
+ }
+};
+
+/**
+ */
+FMIndex.prototype._buildDictionaries$ = function () {
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var pos;
+ /** @type {!number} */
+ var c;
+ for (i = 0; i < this._ssize / this._ddic + 1; i++) {
+ this._posdic.push(0);
+ this._idic.push(0);
+ }
+ i = this._head;
+ pos = this.size$() - 1;
+ do {
+ if (i % this._ddic === 0) {
+ this._posdic[Math.floor(i / this._ddic)] = (pos | 0);
+ }
+ if (pos % this._ddic === 0) {
+ this._idic[Math.floor(pos / this._ddic)] = (i | 0);
+ }
+ c = this._sv.get$I(i);
+ i = this._rlt[c] + this._sv.rank$II(i, c);
+ pos--;
+ } while (i !== this._head);
+};
+
+/**
+ * @param {!string} doc
+ */
+FMIndex.prototype.push$S = function (doc) {
+ if (doc.length <= 0) {
+ throw new Error("FMIndex::push(): empty string");
+ }
+ this._substr += doc;
+};
+
+/**
+ * @param {!string} keyword
+ * @return {Array.<undefined|!number>}
+ */
+FMIndex.prototype.search$S = function (keyword) {
+ /** @type {Array.<undefined|!number>} */
+ var result;
+ /** @type {Array.<undefined|!number>} */
+ var position;
+ /** @type {!number} */
+ var rows;
+ /** @type {undefined|!number} */
+ var first;
+ /** @type {undefined|!number} */
+ var last;
+ /** @type {undefined|!number} */
+ var i;
+ result = [ ];
+ position = [ ];
+ rows = this.getRows$SAI(keyword, position);
+ if (rows > 0) {
+ first = position[0];
+ last = position[1];
+ for (i = first; i <= last; i++) {
+ result.push(this.getPosition$I(i));
+ }
+ }
+ return result;
+};
+
+/**
+ * @return {!string}
+ */
+FMIndex.prototype.dump$ = function () {
+ return this.dump$B(false);
+};
+
+/**
+ * @param {!boolean} verbose
+ * @return {!string}
+ */
+FMIndex.prototype.dump$B = function (verbose) {
+ /** @type {Array.<undefined|!string>} */
+ var contents;
+ /** @type {CompressionReport} */
+ var report;
+ /** @type {!number} */
+ var i;
+ contents = [ ];
+ report = ({source: 0, result: 0});
+ contents.push(Binary$dump32bitNumber$N(this._ddic));
+ contents.push(Binary$dump32bitNumber$N(this._ssize));
+ contents.push(Binary$dump32bitNumber$N(this._head));
+ CompressionReport$add$LCompressionReport$II(report, 6, 6);
+ contents.push(this._sv.dump$LCompressionReport$(report));
+ if (verbose) {
+ console.log("Serializing FM-index");
+ console.log(' Wavelet Matrix: ' + (contents[3].length * 2 + "") + ' bytes (' + (Math.round(report.result * 100.0 / report.source) + "") + '%)');
+ }
+ contents.push(Binary$dump32bitNumber$N(this._posdic.length));
+ for (i in this._posdic) {
+ contents.push(Binary$dump32bitNumber$N(this._posdic[i]));
+ }
+ for (i in this._idic) {
+ contents.push(Binary$dump32bitNumber$N(this._idic[i]));
+ }
+ if (verbose) {
+ console.log(' Dictionary Cache: ' + (this._idic.length * 16 + "") + ' bytes');
+ }
+ return contents.join("");
+};
+
+/**
+ * @param {!string} data
+ * @return {!number}
+ */
+FMIndex.prototype.load$S = function (data) {
+ return this.load$SI(data, 0);
+};
+
+/**
+ * @param {!string} data
+ * @param {!number} offset
+ * @return {!number}
+ */
+FMIndex.prototype.load$SI = function (data, offset) {
+ /** @type {!number} */
+ var maxChar;
+ /** @type {!number} */
+ var c;
+ /** @type {!number} */
+ var size;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var result$0;
+ /** @type {!number} */
+ var result$1;
+ result$0 = data.charCodeAt(offset) * 65536 + data.charCodeAt(offset + 1);
+ this._ddic = (result$0 | 0);
+ this._ssize = (Binary$load32bitNumber$SI(data, offset + 2) | 0);
+ this._head = (Binary$load32bitNumber$SI(data, offset + 4) | 0);
+ offset = this._sv.load$SI(data, offset + 6);
+ maxChar = Math.pow(2, this._sv.bitsize$());
+ for (c = 0; c < maxChar; c++) {
+ this._rlt[c] = this._sv.rank_less_than$II(this._sv.size$(), c);
+ }
+ result$1 = data.charCodeAt(offset) * 65536 + data.charCodeAt(offset + 1);
+ size = result$1;
+ offset += 2;
+ for (i = 0; i < size; (i++, offset += 2)) {
+ this._posdic.push(Binary$load32bitNumber$SI(data, offset));
+ }
+ for (i = 0; i < size; (i++, offset += 2)) {
+ this._idic.push(Binary$load32bitNumber$SI(data, offset));
+ }
+ return offset;
+};
+
+/**
+ * class Tag extends Object
+ * @constructor
+ */
+function Tag() {
+}
+
+/**
+ * @constructor
+ * @param {!string} name
+ */
+function Tag$S(name) {
+ this.name = name;
+ this.attributes = ({ });
+ this.isSelfClosing = false;
+};
+
+Tag$S.prototype = new Tag;
+
+/**
+ * class _Common extends Object
+ * @constructor
+ */
+function _Common() {
+}
+
+/**
+ * @constructor
+ */
+function _Common$() {
+};
+
+_Common$.prototype = new _Common;
+
+/**
+ * class _State extends Object
+ * @constructor
+ */
+function _State() {
+}
+
+/**
+ * @constructor
+ */
+function _State$() {
+};
+
+_State$.prototype = new _State;
+
+/**
+ * class SAXHandler extends Object
+ * @constructor
+ */
+function SAXHandler() {
+}
+
+/**
+ * @constructor
+ */
+function SAXHandler$() {
+ this.position = 0;
+ this.column = 0;
+ this.line = 0;
+};
+
+SAXHandler$.prototype = new SAXHandler;
+
+/**
+ * @param {Error} error
+ */
+SAXHandler.prototype.onerror$LError$ = function (error) {
+};
+
+/**
+ * @param {!string} text
+ */
+SAXHandler.prototype.ontext$S = function (text) {
+};
+
+/**
+ * @param {!string} doctype
+ */
+SAXHandler.prototype.ondoctype$S = function (doctype) {
+};
+
+/**
+ * @param {!string} name
+ * @param {!string} body
+ */
+SAXHandler.prototype.onprocessinginstruction$SS = function (name, body) {
+};
+
+/**
+ * @param {!string} sgmlDecl
+ */
+SAXHandler.prototype.onsgmldeclaration$S = function (sgmlDecl) {
+};
+
+/**
+ * @param {!string} tagname
+ * @param {Object.<string, undefined|!string>} attributes
+ */
+SAXHandler.prototype.onopentag$SHS = function (tagname, attributes) {
+};
+
+/**
+ * @param {!string} tagname
+ */
+SAXHandler.prototype.onclosetag$S = function (tagname) {
+};
+
+/**
+ * @param {!string} name
+ * @param {!string} value
+ */
+SAXHandler.prototype.onattribute$SS = function (name, value) {
+};
+
+/**
+ * @param {!string} comment
+ */
+SAXHandler.prototype.oncomment$S = function (comment) {
+};
+
+/**
+ */
+SAXHandler.prototype.onopencdata$ = function () {
+};
+
+/**
+ * @param {!string} cdata
+ */
+SAXHandler.prototype.oncdata$S = function (cdata) {
+};
+
+/**
+ */
+SAXHandler.prototype.onclosecdata$ = function () {
+};
+
+/**
+ */
+SAXHandler.prototype.onend$ = function () {
+};
+
+/**
+ */
+SAXHandler.prototype.onready$ = function () {
+};
+
+/**
+ * @param {!string} script
+ */
+SAXHandler.prototype.onscript$S = function (script) {
+};
+
+/**
+ * class _HTMLHandler extends SAXHandler
+ * @constructor
+ */
+function _HTMLHandler() {
+}
+
+_HTMLHandler.prototype = new SAXHandler;
+/**
+ * @constructor
+ * @param {Object.<string, undefined|Array.<undefined|!string>>} styles
+ * @param {!boolean} escape
+ */
+function _HTMLHandler$HASB(styles, escape) {
+ this.position = 0;
+ this.column = 0;
+ this.line = 0;
+ this.text = [ ];
+ this.escape = escape;
+ this.styles = styles;
+};
+
+_HTMLHandler$HASB.prototype = new _HTMLHandler;
+
+/**
+ * @param {!string} str
+ * @return {!string}
+ */
+_HTMLHandler.escapeHTML$S = function (str) {
+ return str.replace(/\n/g, "<br/>").replace(/&/g, "&amp;").replace(/"/g, "&quot;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
+};
+
+var _HTMLHandler$escapeHTML$S = _HTMLHandler.escapeHTML$S;
+
+/**
+ * @param {!string} tagname
+ * @param {Object.<string, undefined|!string>} attributes
+ */
+_HTMLHandler.prototype.onopentag$SHS = function (tagname, attributes) {
+ this.text.push(this.styles[tagname][0]);
+};
+
+/**
+ * @param {!string} tagname
+ */
+_HTMLHandler.prototype.onclosetag$S = function (tagname) {
+ this.text.push(this.styles[tagname][1]);
+};
+
+/**
+ * @param {!string} text
+ */
+_HTMLHandler.prototype.ontext$S = function (text) {
+ if (this.escape) {
+ this.text.push(text.replace(/\n/g, "<br/>").replace(/&/g, "&amp;").replace(/"/g, "&quot;").replace(/</g, "&lt;").replace(/>/g, "&gt;"));
+ } else {
+ this.text.push(text);
+ }
+};
+
+/**
+ * @return {!string}
+ */
+_HTMLHandler.prototype.result$ = function () {
+ return this.text.join('');
+};
+
+/**
+ * class SAXParser extends Object
+ * @constructor
+ */
+function SAXParser() {
+}
+
+/**
+ * @constructor
+ * @param {SAXHandler} handler
+ */
+function SAXParser$LSAXHandler$(handler) {
+ this.q = "";
+ this.c = "";
+ this.bufferCheckPosition = 0;
+ this.looseCase = "";
+ this.tags = [ ];
+ this.closed = false;
+ this.closedRoot = false;
+ this.sawRoot = false;
+ this.tag = null;
+ this.error = null;
+ this.handler = null;
+ this.ENTITIES = null;
+ this.strict = false;
+ this.tagName = "";
+ this.state = 0;
+ this.line = 0;
+ this.column = 0;
+ this.position = 0;
+ this.startTagPosition = 0;
+ this.attribName = "";
+ this.attribValue = "";
+ this.script = "";
+ this.textNode = "";
+ this.attribList = null;
+ this.noscript = false;
+ this.cdata = "";
+ this.procInstBody = "";
+ this.procInstName = "";
+ this.doctype = "";
+ this.entity = "";
+ this.sgmlDecl = "";
+ this.comment = "";
+ this.preTags = 0;
+ this._init$LSAXHandler$B(handler, false);
+};
+
+SAXParser$LSAXHandler$.prototype = new SAXParser;
+
+/**
+ * @constructor
+ * @param {SAXHandler} handler
+ * @param {!boolean} strict
+ */
+function SAXParser$LSAXHandler$B(handler, strict) {
+ this.q = "";
+ this.c = "";
+ this.bufferCheckPosition = 0;
+ this.looseCase = "";
+ this.tags = [ ];
+ this.closed = false;
+ this.closedRoot = false;
+ this.sawRoot = false;
+ this.tag = null;
+ this.error = null;
+ this.handler = null;
+ this.ENTITIES = null;
+ this.strict = false;
+ this.tagName = "";
+ this.state = 0;
+ this.line = 0;
+ this.column = 0;
+ this.position = 0;
+ this.startTagPosition = 0;
+ this.attribName = "";
+ this.attribValue = "";
+ this.script = "";
+ this.textNode = "";
+ this.attribList = null;
+ this.noscript = false;
+ this.cdata = "";
+ this.procInstBody = "";
+ this.procInstName = "";
+ this.doctype = "";
+ this.entity = "";
+ this.sgmlDecl = "";
+ this.comment = "";
+ this.preTags = 0;
+ this._init$LSAXHandler$B(handler, strict);
+};
+
+SAXParser$LSAXHandler$B.prototype = new SAXParser;
+
+/**
+ * @param {SAXHandler} handler
+ * @param {!boolean} strict
+ */
+SAXParser.prototype._init$LSAXHandler$B = function (handler, strict) {
+ this.handler = handler;
+ this.clearBuffers$();
+ this.q = "";
+ this.bufferCheckPosition = 65536;
+ this.looseCase = 'toLowerCase';
+ this.tags = [ ];
+ this.closed = this.closedRoot = this.sawRoot = false;
+ this.tag = null;
+ this.error = null;
+ this.strict = strict;
+ this.noscript = strict;
+ this.state = 1;
+ this.ENTITIES = _Entities$entity_list$();
+ this.attribList = [ ];
+ this.noscript = false;
+ this.preTags = 0;
+};
+
+/**
+ * @param {!boolean} flag
+ */
+SAXParser.prototype.set_noscript$B = function (flag) {
+ this.noscript = flag;
+};
+
+/**
+ * @return {SAXParser}
+ */
+SAXParser.prototype.resume$ = function () {
+ this.error = null;
+ return this;
+};
+
+/**
+ * @return {SAXParser}
+ */
+SAXParser.prototype.close$ = function () {
+ return this.parse$S('');
+};
+
+/**
+ * @param {!string} chunk
+ * @return {SAXParser}
+ */
+SAXParser.prototype.parse$S = function (chunk) {
+ /** @type {Char} */
+ var _;
+ /** @type {!number} */
+ var i;
+ /** @type {!string} */
+ var c;
+ /** @type {!number} */
+ var starti;
+ /** @type {!number} */
+ var pad;
+ /** @type {!number} */
+ var returnState;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$0;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$1;
+ /** @type {RegExp} */
+ var charclass$2;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$3;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$4;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$5;
+ /** @type {!string} */
+ var text$0;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$6;
+ /** @type {RegExp} */
+ var charclass$7;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$8;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$9;
+ /** @type {RegExp} */
+ var charclass$10;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$11;
+ /** @type {RegExp} */
+ var charclass$12;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$13;
+ /** @type {RegExp} */
+ var charclass$14;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$15;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$16;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$17;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$18;
+ /** @type {RegExp} */
+ var charclass$19;
+ /** @type {RegExp} */
+ var charclass$20;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$21;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$22;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$23;
+ /** @type {Object.<string, undefined|!boolean>} */
+ var charclass$24;
+ /** @type {!string} */
+ var comment$0;
+ _ = new Char$();
+ if (this.error) {
+ throw this.error;
+ }
+ if (this.closed) {
+ return this.emiterror$S("Cannot write after close. Assign an onready handler.");
+ }
+ (i = 0, c = "");
+ while (this.c = c = chunk.charAt(i++)) {
+ this.position++;
+ if (c === "\n") {
+ this.handler.line++;
+ this.handler.column = 0;
+ } else {
+ this.handler.column++;
+ }
+ switch (this.state) {
+ case 1:
+ if (c === "<") {
+ this.state = 4;
+ this.startTagPosition = this.position;
+ } else {
+ charclass$0 = _.whitespace;
+ if (! $__jsx_ObjectHasOwnProperty.call(charclass$0, c)) {
+ this.strictFail$S("Non-whitespace before first tag.");
+ this.textNode = c;
+ this.state = 2;
+ }
+ }
+ continue;
+ case 2:
+ if (this.sawRoot && ! this.closedRoot) {
+ starti = i - 1;
+ while (c && c !== "<" && c !== "&") {
+ c = chunk.charAt(i++);
+ if (c) {
+ this.position++;
+ if (c === "\n") {
+ this.handler.line++;
+ this.handler.column = 0;
+ } else {
+ this.handler.column++;
+ }
+ }
+ }
+ this.textNode += chunk.substring(starti, i - 1);
+ }
+ if (c === "<") {
+ this.state = 4;
+ this.startTagPosition = this.position;
+ } else {
+ if (_.not$HBS(_.whitespace, c) && (! this.sawRoot || this.closedRoot)) {
+ this.strictFail$S("Text data outside of root node.");
+ }
+ if (c === "&") {
+ this.state = 3;
+ } else {
+ this.textNode += c;
+ }
+ }
+ continue;
+ case 33:
+ if (c === "<") {
+ this.state = 34;
+ } else {
+ this.script += c;
+ }
+ continue;
+ case 34:
+ if (c === "/") {
+ this.state = 31;
+ } else {
+ this.script += "<" + c;
+ this.state = 33;
+ }
+ continue;
+ case 4:
+ if (c === "!") {
+ this.state = 5;
+ this.sgmlDecl = "";
+ } else {
+ charclass$1 = _.whitespace;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$1, c)) {
+ } else {
+ charclass$2 = _.nameStart;
+ if (charclass$2.test(c)) {
+ this.state = 21;
+ this.tagName = c;
+ } else {
+ if (c === "/") {
+ this.state = 31;
+ this.tagName = "";
+ } else {
+ if (c === "?") {
+ this.state = 18;
+ this.procInstName = this.procInstBody = "";
+ } else {
+ this.strictFail$S("Unencoded <");
+ if (this.startTagPosition + 1 < this.position) {
+ pad = this.position - this.startTagPosition;
+ for (i = 0; i < pad; i++) {
+ c = " " + c;
+ }
+ }
+ this.textNode += "<" + c;
+ this.state = 2;
+ }
+ }
+ }
+ }
+ }
+ continue;
+ case 5:
+ if ((this.sgmlDecl + c).toUpperCase() === _.CDATA) {
+ this.closetext_if_exist$();
+ this.state = 15;
+ this.sgmlDecl = "";
+ this.cdata = "";
+ } else {
+ if (this.sgmlDecl + c === "--") {
+ this.state = 12;
+ this.comment = "";
+ this.sgmlDecl = "";
+ } else {
+ if ((this.sgmlDecl + c).toUpperCase() === _.DOCTYPE) {
+ this.state = 7;
+ if (this.doctype || this.sawRoot) {
+ this.strictFail$S("Inappropriately located doctype declaration");
+ }
+ this.doctype = "";
+ this.sgmlDecl = "";
+ } else {
+ if (c === ">") {
+ this.closetext_if_exist$();
+ this.sgmlDecl = "";
+ this.state = 2;
+ } else {
+ charclass$3 = _.quote;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$3, c)) {
+ this.state = 6;
+ this.sgmlDecl += c;
+ } else {
+ this.sgmlDecl += c;
+ }
+ }
+ }
+ }
+ }
+ continue;
+ case 6:
+ if (c === this.q) {
+ this.state = 5;
+ this.q = "";
+ }
+ this.sgmlDecl += c;
+ continue;
+ case 7:
+ if (c === ">") {
+ this.state = 2;
+ this.closetext_if_exist$();
+ this.doctype.trim();
+ } else {
+ this.doctype += c;
+ if (c === "[") {
+ this.state = 9;
+ } else {
+ charclass$4 = _.quote;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$4, c)) {
+ this.state = 8;
+ this.q = c;
+ }
+ }
+ }
+ continue;
+ case 8:
+ this.doctype += c;
+ if (c === this.q) {
+ this.q = "";
+ this.state = 7;
+ }
+ continue;
+ case 9:
+ this.doctype += c;
+ if (c === "]") {
+ this.state = 7;
+ } else {
+ charclass$5 = _.quote;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$5, c)) {
+ this.state = 10;
+ this.q = c;
+ }
+ }
+ continue;
+ case 10:
+ this.doctype += c;
+ if (c === this.q) {
+ this.state = 9;
+ this.q = "";
+ }
+ continue;
+ case 12:
+ if (c === "-") {
+ this.state = 13;
+ } else {
+ this.comment += c;
+ }
+ continue;
+ case 13:
+ if (c === "-") {
+ this.state = 14;
+ text$0 = this.comment;
+ text$0 = text$0.replace(/[\n\t]/g, ' ');
+ text$0 = text$0.replace(/\s\s+/g, " ");
+ comment$0 = this.comment = text$0;
+ if (comment$0) {
+ this.closetext_if_exist$();
+ this.comment.trim();
+ }
+ this.comment = "";
+ } else {
+ this.comment += "-" + c;
+ this.state = 12;
+ }
+ continue;
+ case 14:
+ if (c !== ">") {
+ this.strictFail$S("Malformed comment");
+ this.comment += "--" + c;
+ this.state = 12;
+ } else {
+ this.state = 2;
+ }
+ continue;
+ case 15:
+ if (c === "]") {
+ this.state = 16;
+ } else {
+ this.cdata += c;
+ }
+ continue;
+ case 16:
+ if (c === "]") {
+ this.state = 17;
+ } else {
+ this.cdata += "]" + c;
+ this.state = 15;
+ }
+ continue;
+ case 17:
+ if (c === ">") {
+ if (this.cdata) {
+ this.closetext_if_exist$();
+ }
+ this.cdata = "";
+ this.state = 2;
+ } else {
+ if (c === "]") {
+ this.cdata += "]";
+ } else {
+ this.cdata += "]]" + c;
+ this.state = 15;
+ }
+ }
+ continue;
+ case 18:
+ if (c === "?") {
+ this.state = 20;
+ } else {
+ charclass$6 = _.whitespace;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$6, c)) {
+ this.state = 19;
+ } else {
+ this.procInstName += c;
+ }
+ }
+ continue;
+ case 19:
+ if (! this.procInstBody && _.is$HBS(_.whitespace, c)) {
+ continue;
+ } else {
+ if (c === "?") {
+ this.state = 20;
+ } else {
+ this.procInstBody += c;
+ }
+ }
+ continue;
+ case 20:
+ if (c === ">") {
+ this.closetext_if_exist$();
+ this.procInstName = this.procInstBody = "";
+ this.state = 2;
+ } else {
+ this.procInstBody += "?" + c;
+ this.state = 19;
+ }
+ continue;
+ case 21:
+ charclass$7 = _.nameBody;
+ if (charclass$7.test(c)) {
+ this.tagName += c;
+ } else {
+ this.newTag$();
+ if (c === ">") {
+ this.openTag$B(false);
+ } else {
+ if (c === "/") {
+ this.state = 22;
+ } else {
+ charclass$8 = _.whitespace;
+ if (! $__jsx_ObjectHasOwnProperty.call(charclass$8, c)) {
+ this.strictFail$S("Invalid character in tag name");
+ }
+ this.state = 23;
+ }
+ }
+ }
+ continue;
+ case 22:
+ if (c === ">") {
+ this.openTag$B(true);
+ this.closeTag$();
+ } else {
+ this.strictFail$S("Forward-slash in opening tag not followed by >");
+ this.state = 23;
+ }
+ continue;
+ case 23:
+ charclass$9 = _.whitespace;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$9, c)) {
+ continue;
+ } else {
+ if (c === ">") {
+ this.openTag$B(false);
+ } else {
+ if (c === "/") {
+ this.state = 22;
+ } else {
+ charclass$10 = _.nameStart;
+ if (charclass$10.test(c)) {
+ this.attribName = c;
+ this.attribValue = "";
+ this.state = 24;
+ } else {
+ this.strictFail$S("Invalid attribute name");
+ }
+ }
+ }
+ }
+ continue;
+ case 24:
+ if (c === "=") {
+ this.state = 26;
+ } else {
+ if (c === ">") {
+ this.strictFail$S("Attribute without value");
+ this.attribValue = this.attribName;
+ this.attrib$();
+ this.openTag$B(false);
+ } else {
+ charclass$11 = _.whitespace;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$11, c)) {
+ this.state = 25;
+ } else {
+ charclass$12 = _.nameBody;
+ if (charclass$12.test(c)) {
+ this.attribName += c;
+ } else {
+ this.strictFail$S("Invalid attribute name");
+ }
+ }
+ }
+ }
+ continue;
+ case 25:
+ if (c === "=") {
+ this.state = 26;
+ } else {
+ charclass$13 = _.whitespace;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$13, c)) {
+ continue;
+ } else {
+ this.strictFail$S("Attribute without value");
+ this.tag.attributes[this.attribName] = "";
+ this.attribValue = "";
+ this.closetext_if_exist$();
+ this.attribName = "";
+ if (c === ">") {
+ this.openTag$B(false);
+ } else {
+ charclass$14 = _.nameStart;
+ if (charclass$14.test(c)) {
+ this.attribName = c;
+ this.state = 24;
+ } else {
+ this.strictFail$S("Invalid attribute name");
+ this.state = 23;
+ }
+ }
+ }
+ }
+ continue;
+ case 26:
+ charclass$15 = _.whitespace;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$15, c)) {
+ continue;
+ } else {
+ charclass$16 = _.quote;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$16, c)) {
+ this.q = c;
+ this.state = 27;
+ } else {
+ this.strictFail$S("Unquoted attribute value");
+ this.state = 28;
+ this.attribValue = c;
+ }
+ }
+ continue;
+ case 27:
+ if (c !== this.q) {
+ if (c === "&") {
+ this.state = 29;
+ } else {
+ this.attribValue += c;
+ }
+ continue;
+ }
+ this.attrib$();
+ this.q = "";
+ this.state = 23;
+ continue;
+ case 28:
+ charclass$17 = _.attribEnd;
+ if (! $__jsx_ObjectHasOwnProperty.call(charclass$17, c)) {
+ if (c === "&") {
+ this.state = 30;
+ } else {
+ this.attribValue += c;
+ }
+ continue;
+ }
+ this.attrib$();
+ if (c === ">") {
+ this.openTag$B(false);
+ } else {
+ this.state = 23;
+ }
+ continue;
+ case 31:
+ if (! this.tagName) {
+ charclass$18 = _.whitespace;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$18, c)) {
+ continue;
+ } else {
+ charclass$19 = _.nameStart;
+ if (! charclass$19.test(c)) {
+ if (this.script) {
+ this.script += "</" + c;
+ this.state = 33;
+ } else {
+ this.strictFail$S("Invalid tagname in closing tag.");
+ }
+ } else {
+ this.tagName = c;
+ }
+ }
+ } else {
+ if (c === ">") {
+ this.closeTag$();
+ } else {
+ charclass$20 = _.nameBody;
+ if (charclass$20.test(c)) {
+ this.tagName += c;
+ } else {
+ if (this.script) {
+ this.script += "</" + this.tagName;
+ this.tagName = "";
+ this.state = 33;
+ } else {
+ charclass$21 = _.whitespace;
+ if (! $__jsx_ObjectHasOwnProperty.call(charclass$21, c)) {
+ this.strictFail$S("Invalid tagname in closing tag");
+ }
+ this.state = 32;
+ }
+ }
+ }
+ }
+ continue;
+ case 32:
+ charclass$22 = _.whitespace;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$22, c)) {
+ continue;
+ }
+ if (c === ">") {
+ this.closeTag$();
+ } else {
+ this.strictFail$S("Invalid characters in closing tag");
+ }
+ continue;
+ case 3:
+ if (c === ";") {
+ this.textNode += this.parseEntity$();
+ this.entity = "";
+ this.state = 2;
+ } else {
+ charclass$23 = _.entity;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$23, c)) {
+ this.entity += c;
+ } else {
+ this.strictFail$S("Invalid character entity");
+ this.textNode += "&" + this.entity + c;
+ this.entity = "";
+ this.state = 2;
+ }
+ }
+ continue;
+ case 29:
+ case 30:
+ if (this.state === 29) {
+ returnState = 27;
+ } else {
+ returnState = 28;
+ }
+ if (c === ";") {
+ this.attribValue += this.parseEntity$();
+ this.entity = "";
+ this.state = (returnState | 0);
+ } else {
+ charclass$24 = _.entity;
+ if ($__jsx_ObjectHasOwnProperty.call(charclass$24, c)) {
+ this.entity += c;
+ } else {
+ this.strictFail$S("Invalid character entity");
+ this.attribValue += "&" + this.entity + c;
+ this.entity = "";
+ this.state = (returnState | 0);
+ }
+ }
+ continue;
+ default:
+ throw new Error("Unknown state: " + (this.state + ""));
+ }
+ }
+ this.end$();
+ return this;
+};
+
+/**
+ */
+SAXParser.prototype.clearBuffers$ = function () {
+ this.comment = '';
+ this.sgmlDecl = '';
+ this.textNode = '';
+ this.tagName = '';
+ this.doctype = '';
+ this.procInstName = '';
+ this.procInstBody = '';
+ this.entity = '';
+ this.attribName = '';
+ this.attribValue = '';
+ this.cdata = '';
+ this.script = '';
+};
+
+/**
+ */
+SAXParser.prototype.closetext_if_exist$ = function () {
+ if (this.textNode !== '') {
+ this.closetext$();
+ }
+};
+
+/**
+ */
+SAXParser.prototype.closetext$ = function () {
+ /** @type {!string} */
+ var text;
+ /** @type {!string} */
+ var text$0;
+ if (this.preTags === 0) {
+ text$0 = this.textNode;
+ text$0 = text$0.replace(/[\n\t]/g, ' ');
+ text$0 = text$0.replace(/\s\s+/g, " ");
+ text = text$0;
+ if (text$0) {
+ this.handler.ontext$S(text);
+ }
+ } else {
+ if (this.textNode) {
+ this.handler.ontext$S(this.textNode);
+ }
+ }
+ this.textNode = "";
+};
+
+/**
+ * @param {!string} text
+ * @return {!string}
+ */
+SAXParser.prototype.textopts$S = function (text) {
+ text = text.replace(/[\n\t]/g, ' ');
+ text = text.replace(/\s\s+/g, " ");
+ return text;
+};
+
+/**
+ * @param {!string} er
+ * @return {SAXParser}
+ */
+SAXParser.prototype.emiterror$S = function (er) {
+ /** @type {Error} */
+ var error;
+ this.closetext$();
+ er += "\nLine: " + (this.line + "") + "\nColumn: " + (this.column + "") + "\nChar: " + this.c;
+ error = new Error(er);
+ this.error = error;
+ return this;
+};
+
+/**
+ */
+SAXParser.prototype.end$ = function () {
+ if (! this.closedRoot) {
+ this.strictFail$S("Unclosed root tag");
+ }
+ if (this.state !== 2) {
+ this.emiterror$S("Unexpected end");
+ }
+ this.closetext$();
+ this.c = "";
+ this.closed = true;
+};
+
+/**
+ * @param {!string} message
+ */
+SAXParser.prototype.strictFail$S = function (message) {
+ if (this.strict) {
+ this.emiterror$S(message);
+ }
+};
+
+/**
+ */
+SAXParser.prototype.newTag$ = function () {
+ if (! this.strict) {
+ this.tagName = this.tagName.toLowerCase();
+ }
+ this.tag = ({name: this.tagName, attributes: ({ }), isSelfClosing: false});
+ this.attribList.length = 0;
+};
+
+/**
+ */
+SAXParser.prototype.attrib$ = function () {
+ if (! this.strict) {
+ this.attribName = this.attribName.toLowerCase();
+ }
+ if ($__jsx_ObjectHasOwnProperty.call(this.tag.attributes, this.attribName)) {
+ this.attribName = this.attribValue = "";
+ return;
+ }
+ this.tag.attributes[this.attribName] = this.attribValue;
+ this.closetext_if_exist$();
+ this.attribName = this.attribValue = "";
+};
+
+/**
+ */
+SAXParser.prototype.openTag$ = function () {
+ this.openTag$B(false);
+};
+
+/**
+ * @param {!boolean} selfClosing
+ */
+SAXParser.prototype.openTag$B = function (selfClosing) {
+ /** @type {Tag} */
+ var tag$0;
+ /** @type {Tag} */
+ var tag$1;
+ (tag$0 = this.tag).isSelfClosing = selfClosing;
+ this.sawRoot = true;
+ this.tags.push(tag$0);
+ this.closetext_if_exist$();
+ this.handler.onopentag$SHS((tag$1 = this.tag).name, tag$1.attributes);
+ if (this.tag.name === 'pre') {
+ this.preTags++;
+ }
+ if (! selfClosing) {
+ if (! this.noscript && this.tagName.toLowerCase() === "script") {
+ this.state = 33;
+ } else {
+ this.state = 2;
+ }
+ this.tag = null;
+ this.tagName = "";
+ }
+ this.attribName = this.attribValue = "";
+ this.attribList.length = 0;
+};
+
+/**
+ */
+SAXParser.prototype.closeTag$ = function () {
+ /** @type {!number} */
+ var t;
+ /** @type {!string} */
+ var tagName;
+ /** @type {!string} */
+ var closeTo;
+ /** @type {Tag} */
+ var close;
+ /** @type {!number} */
+ var s;
+ /** @type {Tag} */
+ var tag$0;
+ if (! this.tagName) {
+ this.strictFail$S("Weird empty close tag.");
+ this.textNode += "</>";
+ this.state = 2;
+ return;
+ }
+ if (this.script) {
+ if (this.tagName !== "script") {
+ this.script += "</" + this.tagName + ">";
+ this.tagName = "";
+ this.state = 33;
+ return;
+ }
+ this.closetext_if_exist$();
+ this.script = "";
+ }
+ t = this.tags.length;
+ tagName = this.tagName;
+ if (! this.strict) {
+ tagName = tagName.toLowerCase();
+ }
+ closeTo = tagName;
+ while (t--) {
+ close = this.tags[t];
+ if (close.name !== closeTo) {
+ this.strictFail$S("Unexpected close tag");
+ } else {
+ break;
+ }
+ }
+ if (t < 0) {
+ this.strictFail$S("Unmatched closing tag: " + this.tagName);
+ this.textNode += "</" + this.tagName + ">";
+ this.state = 2;
+ return;
+ }
+ this.tagName = tagName;
+ s = this.tags.length;
+ while (s-- > t) {
+ tag$0 = this.tag = this.tags.pop();
+ this.tagName = tag$0.name;
+ this.closetext_if_exist$();
+ this.handler.onclosetag$S(this.tagName);
+ if (this.tagName === 'pre') {
+ this.preTags--;
+ }
+ }
+ if (t === 0) {
+ this.closedRoot = true;
+ }
+ this.tagName = this.attribValue = this.attribName = "";
+ this.attribList.length = 0;
+ this.state = 2;
+};
+
+/**
+ * @return {!string}
+ */
+SAXParser.prototype.parseEntity$ = function () {
+ /** @type {!string} */
+ var entity;
+ /** @type {!string} */
+ var entityLC;
+ /** @type {!number} */
+ var num;
+ /** @type {!string} */
+ var numStr;
+ entity = this.entity;
+ entityLC = entity.toLowerCase();
+ num = 0;
+ numStr = "";
+ if (this.ENTITIES[entity]) {
+ return this.ENTITIES[entity];
+ }
+ if (this.ENTITIES[entityLC]) {
+ return this.ENTITIES[entityLC];
+ }
+ entity = entityLC;
+ if (entityLC.charAt(0) === "#") {
+ if (entity.charAt(1) === "x") {
+ entity = entity.slice(2);
+ num = $__jsx_parseInt(entity, 16);
+ numStr = num.toString(16);
+ } else {
+ entity = entity.slice(1);
+ num = $__jsx_parseInt(entity, 10);
+ numStr = num.toString(10);
+ }
+ }
+ entity = entity.replace(/^0+/, "");
+ if (numStr.toLowerCase() !== entity) {
+ this.strictFail$S("Invalid character entity");
+ return "&" + this.entity + ";";
+ }
+ return String.fromCharCode(num);
+};
+
+/**
+ * class Char extends Object
+ * @constructor
+ */
+function Char() {
+}
+
+/**
+ * @constructor
+ */
+function Char$() {
+ this.CDATA = "[CDATA[";
+ this.DOCTYPE = "DOCTYPE";
+ this.XML_NAMESPACE = "http://www.w3.org/XML/1998/namespace";
+ this.whitespace = this._charClass$S("\r\n\t ");
+ this.number = this._charClass$S("0124356789");
+ this.letter = this._charClass$S("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ");
+ this.quote = this._charClass$S("'\"");
+ this.entity = this._charClass$S("0124356789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ#");
+ this.attribEnd = this._charClass$S("\r\n\t >");
+ this.nameStart = /[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/;
+ this.nameBody = /[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040\.\d-]/;
+};
+
+Char$.prototype = new Char;
+
+/**
+ * @param {!string} str
+ * @return {Object.<string, undefined|!boolean>}
+ */
+Char.prototype._charClass$S = function (str) {
+ /** @type {Object.<string, undefined|!boolean>} */
+ var result;
+ /** @type {!number} */
+ var i;
+ result = ({ });
+ for (i = 0; i < str.length; i++) {
+ result[str.slice(i, i + 1)] = true;
+ }
+ return result;
+};
+
+/**
+ * @param {RegExp} charclass
+ * @param {!string} c
+ * @return {!boolean}
+ */
+Char.prototype.is$LRegExp$S = function (charclass, c) {
+ return charclass.test(c);
+};
+
+/**
+ * @param {Object.<string, undefined|!boolean>} charclass
+ * @param {!string} c
+ * @return {!boolean}
+ */
+Char.prototype.is$HBS = function (charclass, c) {
+ return $__jsx_ObjectHasOwnProperty.call(charclass, c);
+};
+
+/**
+ * @param {RegExp} charclass
+ * @param {!string} c
+ * @return {!boolean}
+ */
+Char.prototype.not$LRegExp$S = function (charclass, c) {
+ return ! charclass.test(c);
+};
+
+/**
+ * @param {Object.<string, undefined|!boolean>} charclass
+ * @param {!string} c
+ * @return {!boolean}
+ */
+Char.prototype.not$HBS = function (charclass, c) {
+ return ! $__jsx_ObjectHasOwnProperty.call(charclass, c);
+};
+
+/**
+ * class _Entities extends Object
+ * @constructor
+ */
+function _Entities() {
+}
+
+/**
+ * @constructor
+ */
+function _Entities$() {
+};
+
+_Entities$.prototype = new _Entities;
+
+/**
+ * @return {Object.<string, undefined|!string>}
+ */
+_Entities.entity_list$ = function () {
+ /** @type {Object.<string, undefined|!string>} */
+ var result;
+ /** @type {!string} */
+ var key;
+ /** @type {*} */
+ var value;
+ result = ({ });
+ for (key in _Entities._entities) {
+ value = _Entities._entities[key];
+ if (typeof value === 'string') {
+ result[key] = value + "";
+ } else {
+ if (typeof value === 'number') {
+ result[key] = String.fromCharCode(value | 0);
+ }
+ }
+ }
+ return result;
+};
+
+var _Entities$entity_list$ = _Entities.entity_list$;
+
+/**
+ * class BitVector extends Object
+ * @constructor
+ */
+function BitVector() {
+}
+
+/**
+ * @constructor
+ */
+function BitVector$() {
+ /** @type {Array.<undefined|!number>} */
+ var _v$0;
+ /** @type {Array.<undefined|!number>} */
+ var _r$0;
+ _r$0 = this._r = [ ];
+ _v$0 = this._v = [ ];
+ _v$0.length = 0;
+ _r$0.length = 0;
+ this._size = 0;
+ this._size1 = 0;
+};
+
+BitVector$.prototype = new BitVector;
+
+/**
+ */
+BitVector.prototype.build$ = function () {
+ /** @type {!number} */
+ var i;
+ this._size1 = 0;
+ for (i = 0; i < this._v.length; i++) {
+ if (i % 8 === 0) {
+ this._r.push(true ? this._size1 : this._size - this._size1);
+ }
+ this._size1 += this._rank32$IIB(this._v[i], 32, true);
+ }
+};
+
+/**
+ */
+BitVector.prototype.clear$ = function () {
+ this._v.length = 0;
+ this._r.length = 0;
+ this._size = 0;
+ this._size1 = 0;
+};
+
+/**
+ * @return {!number}
+ */
+BitVector.prototype.size$ = function () {
+ return this._size;
+};
+
+/**
+ * @param {!boolean} b
+ * @return {!number}
+ */
+BitVector.prototype.size$B = function (b) {
+ return (b ? this._size1 : this._size - this._size1);
+};
+
+/**
+ * @param {!number} value
+ */
+BitVector.prototype.set$I = function (value) {
+ this.set$IB(value, true);
+};
+
+/**
+ * @param {!number} value
+ * @param {!boolean} flag
+ */
+BitVector.prototype.set$IB = function (value, flag) {
+ /** @type {!number} */
+ var q;
+ /** @type {!number} */
+ var r;
+ /** @type {!number} */
+ var m;
+ if (value >= this._size) {
+ this._size = (value + 1 | 0);
+ }
+ q = (value / 32 | 0);
+ r = (value % 32 | 0);
+ while (q >= this._v.length) {
+ this._v.push(0);
+ }
+ m = 0x1 << r;
+ if (flag) {
+ this._v[q] |= m;
+ } else {
+ this._v[q] &= ~ m;
+ }
+};
+
+/**
+ * @param {!number} value
+ * @return {!boolean}
+ */
+BitVector.prototype.get$I = function (value) {
+ /** @type {!number} */
+ var q;
+ /** @type {!number} */
+ var r;
+ /** @type {!number} */
+ var m;
+ if (value >= this._size) {
+ throw new Error("BitVector.get() : range error");
+ }
+ q = (value / 32 | 0);
+ r = (value % 32 | 0);
+ m = 0x1 << r;
+ return !! (this._v[q] & m);
+};
+
+/**
+ * @param {!number} i
+ * @return {!number}
+ */
+BitVector.prototype.rank$I = function (i) {
+ return this.rank$IB(i, true);
+};
+
+/**
+ * @param {!number} i
+ * @param {!boolean} b
+ * @return {!number}
+ */
+BitVector.prototype.rank$IB = function (i, b) {
+ /** @type {!number} */
+ var q_large;
+ /** @type {!number} */
+ var q_small;
+ /** @type {!number} */
+ var r;
+ /** @type {!number} */
+ var rank;
+ /** @type {!number} */
+ var begin;
+ /** @type {!number} */
+ var j;
+ if (i > this._size) {
+ throw new Error("BitVector.rank() : range error");
+ }
+ if (i === 0) {
+ return 0;
+ }
+ i--;
+ q_large = (Math.floor(i / 256) | 0);
+ q_small = (Math.floor(i / 32) | 0);
+ r = (Math.floor(i % 32) | 0);
+ rank = (this._r[q_large] | 0);
+ if (! b) {
+ rank = q_large * 256 - rank;
+ }
+ begin = q_large * 8;
+ for (j = begin; j < q_small; j++) {
+ rank += this._rank32$IIB(this._v[j], 32, b);
+ }
+ rank += this._rank32$IIB(this._v[q_small], r + 1, b);
+ return rank;
+};
+
+/**
+ * @param {!number} i
+ * @return {!number}
+ */
+BitVector.prototype.select$I = function (i) {
+ return this.select$IB(i, true);
+};
+
+/**
+ * @param {!number} i
+ * @param {!boolean} b
+ * @return {!number}
+ */
+BitVector.prototype.select$IB = function (i, b) {
+ /** @type {!number} */
+ var left;
+ /** @type {!number} */
+ var right;
+ /** @type {!number} */
+ var pivot;
+ /** @type {undefined|!number} */
+ var rank;
+ /** @type {!number} */
+ var j;
+ if (i >= (b ? this._size1 : this._size - this._size1)) {
+ throw new Error("BitVector.select() : range error");
+ }
+ left = 0;
+ right = this._r.length;
+ while (left < right) {
+ pivot = Math.floor((left + right) / 2);
+ rank = this._r[pivot];
+ if (! b) {
+ rank = pivot * 256 - rank;
+ }
+ if (i < rank) {
+ right = pivot;
+ } else {
+ left = pivot + 1;
+ }
+ }
+ right--;
+ if (b) {
+ i -= (this._r[right] | 0);
+ } else {
+ i -= (right * 256 - this._r[right] | 0);
+ }
+ j = right * 8;
+ while (1) {
+ rank = this._rank32$IIB(this._v[j], 32, b);
+ if (i < rank) {
+ break;
+ }
+ j++;
+ i -= (rank | 0);
+ }
+ return (j * 32 + this._select32$IIB(this._v[j], i, b) | 0);
+};
+
+/**
+ * @param {!number} x
+ * @param {!number} i
+ * @param {!boolean} b
+ * @return {!number}
+ */
+BitVector.prototype._rank32$IIB = function (x, i, b) {
+ if (! b) {
+ x = ~ x;
+ }
+ x <<= 32 - i;
+ x = ((x & 0xaaaaaaaa) >>> 1) + (x & 0x55555555);
+ x = ((x & 0xcccccccc) >>> 2) + (x & 0x33333333);
+ x = ((x & 0xf0f0f0f0) >>> 4) + (x & 0x0f0f0f0f);
+ x = ((x & 0xff00ff00) >>> 8) + (x & 0x00ff00ff);
+ x = ((x & 0xffff0000) >>> 16) + (x & 0x0000ffff);
+ return x;
+};
+
+/**
+ * @param {!number} x
+ * @param {!number} i
+ * @param {!boolean} b
+ * @return {!number}
+ */
+BitVector.prototype._select32$IIB = function (x, i, b) {
+ /** @type {!number} */
+ var x1;
+ /** @type {!number} */
+ var x2;
+ /** @type {!number} */
+ var x3;
+ /** @type {!number} */
+ var x4;
+ /** @type {!number} */
+ var x5;
+ /** @type {!number} */
+ var pos;
+ /** @type {!number} */
+ var v5;
+ /** @type {!number} */
+ var v4;
+ /** @type {!number} */
+ var v3;
+ /** @type {!number} */
+ var v2;
+ /** @type {!number} */
+ var v1;
+ /** @type {!number} */
+ var v0;
+ if (! b) {
+ x = ~ x;
+ }
+ x1 = ((x & 0xaaaaaaaa) >>> 1) + (x & 0x55555555);
+ x2 = ((x1 & 0xcccccccc) >>> 2) + (x1 & 0x33333333);
+ x3 = ((x2 & 0xf0f0f0f0) >>> 4) + (x2 & 0x0f0f0f0f);
+ x4 = ((x3 & 0xff00ff00) >>> 8) + (x3 & 0x00ff00ff);
+ x5 = ((x4 & 0xffff0000) >>> 16) + (x4 & 0x0000ffff);
+ i++;
+ pos = 0;
+ v5 = x5 & 0xffffffff;
+ if (i > v5) {
+ i -= (v5 | 0);
+ pos += 32;
+ }
+ v4 = x4 >>> pos & 0x0000ffff;
+ if (i > v4) {
+ i -= (v4 | 0);
+ pos += 16;
+ }
+ v3 = x3 >>> pos & 0x000000ff;
+ if (i > v3) {
+ i -= (v3 | 0);
+ pos += 8;
+ }
+ v2 = x2 >>> pos & 0x0000000f;
+ if (i > v2) {
+ i -= (v2 | 0);
+ pos += 4;
+ }
+ v1 = x1 >>> pos & 0x00000003;
+ if (i > v1) {
+ i -= (v1 | 0);
+ pos += 2;
+ }
+ v0 = x >>> pos & 0x00000001;
+ if (i > v0) {
+ i -= (v0 | 0);
+ pos += 1;
+ }
+ return (pos | 0);
+};
+
+/**
+ * @return {!string}
+ */
+BitVector.prototype.dump$ = function () {
+ /** @type {Array.<undefined|!string>} */
+ var contents;
+ contents = [ ];
+ contents.push(Binary$dump32bitNumber$N(this._size));
+ contents.push(Binary$dump32bitNumberList$AN(this._v));
+ return contents.join('');
+};
+
+/**
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+BitVector.prototype.dump$LCompressionReport$ = function (report) {
+ /** @type {Array.<undefined|!string>} */
+ var contents;
+ contents = [ ];
+ contents.push(Binary$dump32bitNumber$N(this._size));
+ CompressionReport$add$LCompressionReport$II(report, 2, 2);
+ contents.push(Binary$dump32bitNumberList$ANLCompressionReport$(this._v, report));
+ return contents.join('');
+};
+
+/**
+ * @param {!string} data
+ * @return {!number}
+ */
+BitVector.prototype.load$S = function (data) {
+ return this.load$SI(data, 0);
+};
+
+/**
+ * @param {!string} data
+ * @param {!number} offset
+ * @return {!number}
+ */
+BitVector.prototype.load$SI = function (data, offset) {
+ /** @type {LoadedNumberListResult} */
+ var result;
+ /** @type {!number} */
+ var result$0;
+ this._v.length = 0;
+ this._r.length = 0;
+ this._size = 0;
+ this._size1 = 0;
+ result$0 = data.charCodeAt(offset) * 65536 + data.charCodeAt(offset + 1);
+ this._size = (result$0 | 0);
+ result = Binary$load32bitNumberList$SI(data, offset + 2);
+ this._v = result.result;
+ this.build$();
+ return result.offset;
+};
+
+/**
+ * class WaveletMatrix extends Object
+ * @constructor
+ */
+function WaveletMatrix() {
+}
+
+/**
+ * @constructor
+ */
+function WaveletMatrix$() {
+ /** @type {Array.<undefined|BitVector>} */
+ var _bv$0;
+ /** @type {Array.<undefined|!number>} */
+ var _seps$0;
+ this._range = ({ });
+ _bv$0 = this._bv = [ ];
+ _seps$0 = this._seps = [ ];
+ this._bitsize = 16;
+ _bv$0.length = 0;
+ _seps$0.length = 0;
+ this._size = 0;
+};
+
+WaveletMatrix$.prototype = new WaveletMatrix;
+
+/**
+ * @return {!number}
+ */
+WaveletMatrix.prototype.bitsize$ = function () {
+ return this._bitsize;
+};
+
+/**
+ * @param {!number} charCode
+ */
+WaveletMatrix.prototype.setMaxCharCode$I = function (charCode) {
+ this._bitsize = (Math.ceil(Math.log(charCode) / 0.6931471805599453) | 0);
+};
+
+/**
+ */
+WaveletMatrix.prototype.clear$ = function () {
+ this._bv.length = 0;
+ this._seps.length = 0;
+ this._size = 0;
+};
+
+/**
+ * @param {!string} v
+ */
+WaveletMatrix.prototype.build$S = function (v) {
+ /** @type {!number} */
+ var size;
+ /** @type {!number} */
+ var bitsize;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var depth;
+ /** @type {Object.<string, undefined|!number>} */
+ var range_tmp;
+ /** @type {!number} */
+ var code;
+ /** @type {!boolean} */
+ var bit;
+ /** @type {!number} */
+ var key;
+ /** @type {Object.<string, undefined|!number>} */
+ var range_rev;
+ /** @type {!string} */
+ var range_key;
+ /** @type {!number} */
+ var value;
+ /** @type {!number} */
+ var pos0;
+ /** @type {undefined|!number} */
+ var pos1;
+ /** @type {!string} */
+ var range_rev_key;
+ /** @type {!number} */
+ var begin;
+ /** @type {undefined|!number} */
+ var end;
+ /** @type {!number} */
+ var num0;
+ /** @type {!number} */
+ var num1;
+ this._bv.length = 0;
+ this._seps.length = 0;
+ this._size = 0;
+ size = v.length;
+ bitsize = this._bitsize;
+ for (i = 0; i < bitsize; i++) {
+ this._bv.push(new BitVector$());
+ this._seps.push(0);
+ }
+ this._size = (size | 0);
+ for (i = 0; i < size; i++) {
+ this._bv[0].set$IB(i, this._uint2bit$II(v.charCodeAt(i), 0));
+ }
+ this._bv[0].build$();
+ this._seps[0] = this._bv[0].size$B(false);
+ this._range["0"] = 0;
+ this._range["1"] = this._seps[0];
+ depth = 1;
+ while (depth < bitsize) {
+ range_tmp = WaveletMatrix$_shallow_copy$HI(this._range);
+ for (i = 0; i < size; i++) {
+ code = v.charCodeAt(i);
+ bit = this._uint2bit$II(code, depth);
+ key = code >>> bitsize - depth;
+ this._bv[depth].set$IB(range_tmp[key + ""], bit);
+ range_tmp[key + ""]++;
+ }
+ this._bv[depth].build$();
+ this._seps[depth] = this._bv[depth].size$B(false);
+ range_rev = ({ });
+ for (range_key in this._range) {
+ value = this._range[range_key];
+ if (value != range_tmp[range_key]) {
+ range_rev[value + ""] = range_key | 0;
+ }
+ }
+ this._range = ({ });
+ pos0 = 0;
+ pos1 = this._seps[depth];
+ for (range_rev_key in range_rev) {
+ begin = range_rev_key | 0;
+ value = range_rev[range_rev_key];
+ end = range_tmp[value + ""];
+ num0 = this._bv[depth].rank$IB(end, false) - this._bv[depth].rank$IB(begin, false);
+ num1 = end - begin - num0;
+ if (num0 > 0) {
+ this._range[(value << 1) + ""] = (pos0 | 0);
+ pos0 += num0;
+ }
+ if (num1 > 0) {
+ this._range[(value << 1) + 1 + ""] = pos1;
+ pos1 += (num1 | 0);
+ }
+ }
+ depth++;
+ }
+};
+
+/**
+ * @return {!number}
+ */
+WaveletMatrix.prototype.size$ = function () {
+ return this._size;
+};
+
+/**
+ * @param {!number} c
+ * @return {!number}
+ */
+WaveletMatrix.prototype.size$I = function (c) {
+ return this.rank$II(this._size, c);
+};
+
+/**
+ * @param {!number} i
+ * @return {!number}
+ */
+WaveletMatrix.prototype.get$I = function (i) {
+ /** @type {!number} */
+ var value;
+ /** @type {!number} */
+ var depth;
+ /** @type {!boolean} */
+ var bit;
+ if (i >= this._size) {
+ throw new Error("WaveletMatrix.get() : range error");
+ }
+ value = 0;
+ depth = 0;
+ while (depth < this._bitsize) {
+ bit = this._bv[depth].get$I(i);
+ i = this._bv[depth].rank$IB(i, bit);
+ value <<= 1;
+ if (bit) {
+ i += this._seps[depth];
+ value += 1;
+ }
+ depth++;
+ }
+ return (value | 0);
+};
+
+/**
+ * @param {!number} i
+ * @param {!number} c
+ * @return {!number}
+ */
+WaveletMatrix.prototype.rank$II = function (i, c) {
+ /** @type {undefined|!number} */
+ var begin;
+ /** @type {!number} */
+ var end;
+ /** @type {!number} */
+ var depth;
+ /** @type {!boolean} */
+ var bit;
+ if (i > this._size) {
+ throw new Error("WaveletMatrix.rank(): range error");
+ }
+ if (i === 0) {
+ return 0;
+ }
+ begin = this._range[c + ""];
+ if (begin == null) {
+ return 0;
+ }
+ end = i;
+ depth = 0;
+ while (depth < this._bitsize) {
+ bit = this._uint2bit$II(c, depth);
+ end = this._bv[depth].rank$IB(end, bit);
+ if (bit) {
+ end += this._seps[depth];
+ }
+ depth++;
+ }
+ return (end - begin | 0);
+};
+
+/**
+ * @param {!number} i
+ * @param {!number} c
+ * @return {!number}
+ */
+WaveletMatrix.prototype.rank_less_than$II = function (i, c) {
+ /** @type {!number} */
+ var begin;
+ /** @type {!number} */
+ var end;
+ /** @type {!number} */
+ var depth;
+ /** @type {!number} */
+ var rlt;
+ /** @type {!number} */
+ var rank0_begin;
+ /** @type {!number} */
+ var rank0_end;
+ /** @type {Array.<undefined|!number>} */
+ var _seps$0;
+ if (i > this._size) {
+ throw new Error("WaveletMatrix.rank_less_than(): range error");
+ }
+ if (i === 0) {
+ return 0;
+ }
+ begin = 0;
+ end = i;
+ depth = 0;
+ rlt = 0;
+ while (depth < this._bitsize) {
+ rank0_begin = this._bv[depth].rank$IB(begin, false);
+ rank0_end = this._bv[depth].rank$IB(end, false);
+ if (this._uint2bit$II(c, depth)) {
+ rlt += rank0_end - rank0_begin;
+ begin += (_seps$0 = this._seps)[depth] - rank0_begin;
+ end += _seps$0[depth] - rank0_end;
+ } else {
+ begin = rank0_begin;
+ end = rank0_end;
+ }
+ depth++;
+ }
+ return (rlt | 0);
+};
+
+/**
+ * @return {!string}
+ */
+WaveletMatrix.prototype.dump$ = function () {
+ /** @type {Array.<undefined|!string>} */
+ var contents;
+ /** @type {!number} */
+ var i;
+ /** @type {Array.<undefined|!string>} */
+ var range_contents;
+ /** @type {!number} */
+ var counter;
+ /** @type {!string} */
+ var key;
+ contents = [ Binary$dump16bitNumber$I(this._bitsize), Binary$dump32bitNumber$N(this._size) ];
+ for (i = 0; i < this._bitsize; i++) {
+ contents.push(this._bv[i].dump$());
+ }
+ for (i = 0; i < this._bitsize; i++) {
+ contents.push(Binary$dump32bitNumber$N(this._seps[i]));
+ }
+ range_contents = [ ];
+ counter = 0;
+ for (key in this._range) {
+ range_contents.push(Binary$dump32bitNumber$N(key | 0));
+ range_contents.push(Binary$dump32bitNumber$N(this._range[key]));
+ counter++;
+ }
+ contents.push(Binary$dump32bitNumber$N(counter));
+ return contents.join('') + range_contents.join('');
+};
+
+/**
+ * @param {CompressionReport} report
+ * @return {!string}
+ */
+WaveletMatrix.prototype.dump$LCompressionReport$ = function (report) {
+ /** @type {Array.<undefined|!string>} */
+ var contents;
+ /** @type {!number} */
+ var i;
+ /** @type {Array.<undefined|!string>} */
+ var range_contents;
+ /** @type {!number} */
+ var counter;
+ /** @type {!string} */
+ var key;
+ contents = [ Binary$dump16bitNumber$I(this._bitsize), Binary$dump32bitNumber$N(this._size) ];
+ CompressionReport$add$LCompressionReport$II(report, 3, 3);
+ for (i = 0; i < this._bitsize; i++) {
+ contents.push(this._bv[i].dump$LCompressionReport$(report));
+ }
+ for (i = 0; i < this._bitsize; i++) {
+ contents.push(Binary$dump32bitNumber$N(this._seps[i]));
+ CompressionReport$add$LCompressionReport$II(report, 2, 2);
+ }
+ range_contents = [ ];
+ counter = 0;
+ for (key in this._range) {
+ range_contents.push(Binary$dump32bitNumber$N(key | 0));
+ range_contents.push(Binary$dump32bitNumber$N(this._range[key]));
+ CompressionReport$add$LCompressionReport$II(report, 4, 4);
+ counter++;
+ }
+ CompressionReport$add$LCompressionReport$II(report, 2, 2);
+ contents.push(Binary$dump32bitNumber$N(counter));
+ return contents.join('') + range_contents.join('');
+};
+
+/**
+ * @param {!string} data
+ * @return {!number}
+ */
+WaveletMatrix.prototype.load$S = function (data) {
+ return this.load$SI(data, 0);
+};
+
+/**
+ * @param {!string} data
+ * @param {!number} offset
+ * @return {!number}
+ */
+WaveletMatrix.prototype.load$SI = function (data, offset) {
+ /** @type {!number} */
+ var i;
+ /** @type {BitVector} */
+ var bit_vector;
+ /** @type {!number} */
+ var range_size;
+ /** @type {!number} */
+ var value;
+ /** @type {!number} */
+ var offset$0;
+ /** @type {!number} */
+ var result$0;
+ /** @type {!number} */
+ var result$1;
+ /** @type {!number} */
+ var result$2;
+ this._bv.length = 0;
+ this._seps.length = 0;
+ this._size = 0;
+ offset$0 = offset++;
+ this._bitsize = (data.charCodeAt(offset$0) | 0);
+ result$0 = data.charCodeAt(offset) * 65536 + data.charCodeAt(offset + 1);
+ this._size = (result$0 | 0);
+ offset += 2;
+ for (i = 0; i < this._bitsize; i++) {
+ bit_vector = new BitVector$();
+ offset = bit_vector.load$SI(data, offset);
+ this._bv.push(bit_vector);
+ }
+ for (i = 0; i < this._bitsize; (i++, offset += 2)) {
+ this._seps.push(Binary$load32bitNumber$SI(data, offset));
+ }
+ result$1 = data.charCodeAt(offset) * 65536 + data.charCodeAt(offset + 1);
+ range_size = result$1;
+ offset += 2;
+ for (i = 0; i < range_size; (i++, offset += 4)) {
+ result$2 = data.charCodeAt(offset) * 65536 + data.charCodeAt(offset + 1);
+ value = Binary$load32bitNumber$SI(data, offset + 2);
+ this._range[result$2 + ""] = (value | 0);
+ }
+ return offset;
+};
+
+/**
+ * @param {Object.<string, undefined|!number>} input
+ * @return {Object.<string, undefined|!number>}
+ */
+WaveletMatrix._shallow_copy$HI = function (input) {
+ /** @type {Object.<string, undefined|!number>} */
+ var result;
+ /** @type {!string} */
+ var key;
+ result = ({ });
+ for (key in input) {
+ result[key] = input[key];
+ }
+ return result;
+};
+
+var WaveletMatrix$_shallow_copy$HI = WaveletMatrix._shallow_copy$HI;
+
+/**
+ * @param {!number} c
+ * @param {!number} i
+ * @return {!boolean}
+ */
+WaveletMatrix.prototype._uint2bit$II = function (c, i) {
+ return (c >>> this._bitsize - 1 - i & 0x1) === 0x1;
+};
+
+/**
+ * class BurrowsWheelerTransform extends Object
+ * @constructor
+ */
+function BurrowsWheelerTransform() {
+}
+
+/**
+ * @constructor
+ */
+function BurrowsWheelerTransform$() {
+ this._str = "";
+ this._size = 0;
+ this._head = 0;
+ this._suffixarray = [ ];
+};
+
+BurrowsWheelerTransform$.prototype = new BurrowsWheelerTransform;
+
+/**
+ * @param {BurrowsWheelerTransform} $this
+ * @return {!number}
+ */
+BurrowsWheelerTransform.size$LBurrowsWheelerTransform$ = function ($this) {
+ return $this._size;
+};
+
+var BurrowsWheelerTransform$size$LBurrowsWheelerTransform$ = BurrowsWheelerTransform.size$LBurrowsWheelerTransform$;
+
+/**
+ * @param {BurrowsWheelerTransform} $this
+ * @return {!number}
+ */
+BurrowsWheelerTransform.head$LBurrowsWheelerTransform$ = function ($this) {
+ return $this._head;
+};
+
+var BurrowsWheelerTransform$head$LBurrowsWheelerTransform$ = BurrowsWheelerTransform.head$LBurrowsWheelerTransform$;
+
+/**
+ * @param {BurrowsWheelerTransform} $this
+ */
+BurrowsWheelerTransform.clear$LBurrowsWheelerTransform$ = function ($this) {
+ $this._str = "";
+ $this._size = 0;
+ $this._head = 0;
+ $this._suffixarray.length = 0;
+};
+
+var BurrowsWheelerTransform$clear$LBurrowsWheelerTransform$ = BurrowsWheelerTransform.clear$LBurrowsWheelerTransform$;
+
+/**
+ * @param {BurrowsWheelerTransform} $this
+ * @param {!string} str
+ */
+BurrowsWheelerTransform.build$LBurrowsWheelerTransform$S = function ($this, str) {
+ /** @type {!string} */
+ var _str$0;
+ /** @type {Array.<undefined|!number>} */
+ var _suffixarray$0;
+ _str$0 = $this._str = str;
+ $this._size = _str$0.length;
+ _suffixarray$0 = $this._suffixarray = SAIS$make$S(str);
+ $this._head = (_suffixarray$0.indexOf(0) | 0);
+};
+
+var BurrowsWheelerTransform$build$LBurrowsWheelerTransform$S = BurrowsWheelerTransform.build$LBurrowsWheelerTransform$S;
+
+/**
+ * @param {BurrowsWheelerTransform} $this
+ * @param {!number} i
+ * @return {!string}
+ */
+BurrowsWheelerTransform.get$LBurrowsWheelerTransform$I = function ($this, i) {
+ /** @type {!number} */
+ var size;
+ /** @type {!number} */
+ var index;
+ size = $this._size;
+ if (i >= size) {
+ throw new Error("BurrowsWheelerTransform.get() : range error");
+ }
+ index = ($this._suffixarray[i] + size - 1) % size;
+ return $this._str.charAt(index);
+};
+
+var BurrowsWheelerTransform$get$LBurrowsWheelerTransform$I = BurrowsWheelerTransform.get$LBurrowsWheelerTransform$I;
+
+/**
+ * @param {BurrowsWheelerTransform} $this
+ * @return {!string}
+ */
+BurrowsWheelerTransform.get$LBurrowsWheelerTransform$ = function ($this) {
+ /** @type {Array.<undefined|!string>} */
+ var str;
+ /** @type {!number} */
+ var size;
+ /** @type {!number} */
+ var i;
+ str = [ ];
+ size = $this._size;
+ for (i = 0; i < size; i++) {
+ str.push(BurrowsWheelerTransform$get$LBurrowsWheelerTransform$I($this, i));
+ }
+ return str.join("");
+};
+
+var BurrowsWheelerTransform$get$LBurrowsWheelerTransform$ = BurrowsWheelerTransform.get$LBurrowsWheelerTransform$;
+
+/**
+ * @param {BurrowsWheelerTransform} $this
+ * @param {!string} replace
+ * @return {!string}
+ */
+BurrowsWheelerTransform.get$LBurrowsWheelerTransform$S = function ($this, replace) {
+ /** @type {!string} */
+ var result;
+ result = BurrowsWheelerTransform$get$LBurrowsWheelerTransform$($this);
+ return result.replace(BurrowsWheelerTransform.END_MARKER, replace);
+};
+
+var BurrowsWheelerTransform$get$LBurrowsWheelerTransform$S = BurrowsWheelerTransform.get$LBurrowsWheelerTransform$S;
+
+/**
+ * class OArray extends Object
+ * @constructor
+ */
+function OArray() {
+}
+
+/**
+ * @constructor
+ * @param {Array.<undefined|!number>} array
+ */
+function OArray$AI(array) {
+ this.array = array;
+ this.offset = 0;
+};
+
+OArray$AI.prototype = new OArray;
+
+/**
+ * @constructor
+ * @param {Array.<undefined|!number>} array
+ * @param {!number} offset
+ */
+function OArray$AII(array, offset) {
+ this.array = array;
+ this.offset = offset;
+};
+
+OArray$AII.prototype = new OArray;
+
+/**
+ * @param {OArray} $this
+ * @param {!number} index
+ * @return {!number}
+ */
+OArray.get$LOArray$I = function ($this, index) {
+ return $this.array[index + $this.offset];
+};
+
+var OArray$get$LOArray$I = OArray.get$LOArray$I;
+
+/**
+ * @param {OArray} $this
+ * @param {!number} index
+ * @param {!number} value
+ */
+OArray.set$LOArray$II = function ($this, index, value) {
+ $this.array[index + $this.offset] = value;
+};
+
+var OArray$set$LOArray$II = OArray.set$LOArray$II;
+
+/**
+ * @param {OArray} $this
+ * @param {!number} index
+ * @return {!boolean}
+ */
+OArray.isS$LOArray$I = function ($this, index) {
+ /** @type {Array.<undefined|!number>} */
+ var array$0;
+ /** @type {!number} */
+ var offset$0;
+ return (array$0 = $this.array)[index + (offset$0 = $this.offset)] < array$0[index + offset$0 + 1];
+};
+
+var OArray$isS$LOArray$I = OArray.isS$LOArray$I;
+
+/**
+ * @param {OArray} $this
+ * @param {!number} index1
+ * @param {!number} index2
+ * @return {!boolean}
+ */
+OArray.compare$LOArray$II = function ($this, index1, index2) {
+ /** @type {Array.<undefined|!number>} */
+ var array$0;
+ /** @type {!number} */
+ var offset$0;
+ return (array$0 = $this.array)[index1 + (offset$0 = $this.offset)] == array$0[index2 + offset$0];
+};
+
+var OArray$compare$LOArray$II = OArray.compare$LOArray$II;
+
+/**
+ * class SAIS extends Object
+ * @constructor
+ */
+function SAIS() {
+}
+
+/**
+ * @constructor
+ */
+function SAIS$() {
+};
+
+SAIS$.prototype = new SAIS;
+
+/**
+ * @param {BitVector} t
+ * @param {!number} i
+ * @return {!boolean}
+ */
+SAIS._isLMS$LBitVector$I = function (t, i) {
+ return i > 0 && t.get$I(i) && ! t.get$I(i - 1);
+};
+
+var SAIS$_isLMS$LBitVector$I = SAIS._isLMS$LBitVector$I;
+
+/**
+ * @param {OArray} s
+ * @param {Array.<undefined|!number>} bkt
+ * @param {!number} n
+ * @param {!number} K
+ * @param {!boolean} end
+ */
+SAIS._getBuckets$LOArray$AIIIB = function (s, bkt, n, K, end) {
+ /** @type {!number} */
+ var sum;
+ /** @type {!number} */
+ var i;
+ sum = 0;
+ for (i = 0; i <= K; i++) {
+ bkt[i] = 0;
+ }
+ for (i = 0; i < n; i++) {
+ bkt[OArray$get$LOArray$I(s, i)]++;
+ }
+ for (i = 0; i <= K; i++) {
+ sum += bkt[i];
+ bkt[i] = ((end ? sum : sum - bkt[i]) | 0);
+ }
+};
+
+var SAIS$_getBuckets$LOArray$AIIIB = SAIS._getBuckets$LOArray$AIIIB;
+
+/**
+ * @param {BitVector} t
+ * @param {Array.<undefined|!number>} SA
+ * @param {OArray} s
+ * @param {Array.<undefined|!number>} bkt
+ * @param {!number} n
+ * @param {!number} K
+ * @param {!boolean} end
+ */
+SAIS._induceSAl$LBitVector$AILOArray$AIIIB = function (t, SA, s, bkt, n, K, end) {
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var j;
+ SAIS$_getBuckets$LOArray$AIIIB(s, bkt, n, K, end);
+ for (i = 0; i < n; i++) {
+ j = SA[i] - 1;
+ if (j >= 0 && ! t.get$I(j)) {
+ SA[bkt[OArray$get$LOArray$I(s, j)]++] = (j | 0);
+ }
+ }
+};
+
+var SAIS$_induceSAl$LBitVector$AILOArray$AIIIB = SAIS._induceSAl$LBitVector$AILOArray$AIIIB;
+
+/**
+ * @param {BitVector} t
+ * @param {Array.<undefined|!number>} SA
+ * @param {OArray} s
+ * @param {Array.<undefined|!number>} bkt
+ * @param {!number} n
+ * @param {!number} K
+ * @param {!boolean} end
+ */
+SAIS._induceSAs$LBitVector$AILOArray$AIIIB = function (t, SA, s, bkt, n, K, end) {
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var j;
+ SAIS$_getBuckets$LOArray$AIIIB(s, bkt, n, K, end);
+ for (i = n - 1; i >= 0; i--) {
+ j = SA[i] - 1;
+ if (j >= 0 && t.get$I(j)) {
+ SA[-- bkt[OArray$get$LOArray$I(s, j)]] = (j | 0);
+ }
+ }
+};
+
+var SAIS$_induceSAs$LBitVector$AILOArray$AIIIB = SAIS._induceSAs$LBitVector$AILOArray$AIIIB;
+
+/**
+ * @param {!string} source
+ * @return {Array.<undefined|!number>}
+ */
+SAIS.make$S = function (source) {
+ /** @type {Array.<undefined|!number>} */
+ var charCodes;
+ /** @type {!number} */
+ var maxCode;
+ /** @type {!number} */
+ var i;
+ /** @type {!number} */
+ var code;
+ /** @type {Array.<undefined|!number>} */
+ var SA;
+ /** @type {OArray} */
+ var s;
+ charCodes = [ ];
+ charCodes.length = source.length;
+ maxCode = 0;
+ for (i = 0; i < source.length; i++) {
+ code = source.charCodeAt(i);
+ charCodes[i] = (code | 0);
+ maxCode = (code > maxCode ? code : maxCode);
+ }
+ SA = [ ];
+ SA.length = source.length;
+ s = ({offset: 0, array: charCodes});
+ SAIS$_make$LOArray$AIII(s, SA, source.length, maxCode);
+ return SA;
+};
+
+var SAIS$make$S = SAIS.make$S;
+
+/**
+ * @param {OArray} s
+ * @param {Array.<undefined|!number>} SA
+ * @param {!number} n
+ * @param {!number} K
+ */
+SAIS._make$LOArray$AIII = function (s, SA, n, K) {
+ /** @type {BitVector} */
+ var t;
+ /** @type {!number} */
+ var i;
+ /** @type {Array.<undefined|!number>} */
+ var bkt;
+ /** @type {!number} */
+ var n1;
+ /** @type {!number} */
+ var name;
+ /** @type {!number} */
+ var prev;
+ /** @type {undefined|!number} */
+ var pos;
+ /** @type {!boolean} */
+ var diff;
+ /** @type {!number} */
+ var d;
+ /** @type {!number} */
+ var j;
+ /** @type {Array.<undefined|!number>} */
+ var SA1;
+ /** @type {OArray} */
+ var s1;
+ /** @type {!number} */
+ var i$0;
+ /** @type {!number} */
+ var index$0;
+ t = new BitVector$();
+ t.set$IB(n - 2, false);
+ t.set$IB(n - 1, true);
+ for (i = n - 3; i >= 0; i--) {
+ t.set$IB(i, OArray$isS$LOArray$I(s, i) || OArray$compare$LOArray$II(s, i, i + 1) && t.get$I(i + 1));
+ }
+ bkt = [ ];
+ bkt.length = K + 1;
+ SAIS$_getBuckets$LOArray$AIIIB(s, bkt, n, K, true);
+ for (i = 0; i < n; i++) {
+ SA[i] = -1;
+ }
+ for (i = 1; i < n; i++) {
+ if (SAIS$_isLMS$LBitVector$I(t, i)) {
+ SA[-- bkt[OArray$get$LOArray$I(s, i)]] = (i | 0);
+ }
+ }
+ SAIS$_induceSAl$LBitVector$AILOArray$AIIIB(t, SA, s, bkt, n, K, false);
+ SAIS$_induceSAs$LBitVector$AILOArray$AIIIB(t, SA, s, bkt, n, K, true);
+ n1 = 0;
+ for (i = 0; i < n; i++) {
+ i$0 = SA[i];
+ if (i$0 > 0 && t.get$I(i$0) && ! t.get$I(i$0 - 1)) {
+ SA[n1++] = SA[i];
+ }
+ }
+ for (i = n1; i < n; i++) {
+ SA[i] = -1;
+ }
+ name = 0;
+ prev = -1;
+ for (i = 0; i < n1; i++) {
+ pos = SA[i];
+ diff = false;
+ for (d = 0; d < n; d++) {
+ if (prev === -1 || ! OArray$compare$LOArray$II(s, pos + d, prev + d) || t.get$I(pos + d) !== t.get$I(prev + d)) {
+ diff = true;
+ break;
+ } else {
+ if (d > 0 && (SAIS$_isLMS$LBitVector$I(t, pos + d) || SAIS$_isLMS$LBitVector$I(t, prev + d))) {
+ break;
+ }
+ }
+ }
+ if (diff) {
+ name++;
+ prev = pos;
+ }
+ pos = ((pos % 2 === 0 ? pos / 2 : (pos - 1) / 2) | 0);
+ SA[n1 + pos] = (name - 1 | 0);
+ }
+ for ((i = n - 1, j = n - 1); i >= n1; i--) {
+ if (SA[i] >= 0) {
+ SA[j--] = SA[i];
+ }
+ }
+ SA1 = SA;
+ s1 = ({offset: n - n1, array: SA});
+ if (name < n1) {
+ SAIS$_make$LOArray$AIII(s1, SA1, n1, name - 1);
+ } else {
+ for (i = 0; i < n1; i++) {
+ SA1[OArray$get$LOArray$I(s1, i)] = (i | 0);
+ }
+ }
+ bkt = [ ];
+ bkt.length = K + 1;
+ SAIS$_getBuckets$LOArray$AIIIB(s, bkt, n, K, true);
+ for ((i = 1, j = 0); i < n; i++) {
+ if (SAIS$_isLMS$LBitVector$I(t, i)) {
+ OArray$set$LOArray$II(s1, j++, i);
+ }
+ }
+ for (i = 0; i < n1; i++) {
+ index$0 = SA1[i];
+ SA1[i] = s1.array[index$0 + s1.offset];
+ }
+ for (i = n1; i < n; i++) {
+ SA[i] = -1;
+ }
+ for (i = n1 - 1; i >= 0; i--) {
+ j = SA[i];
+ SA[i] = -1;
+ SA[-- bkt[OArray$get$LOArray$I(s, j)]] = (j | 0);
+ }
+ SAIS$_induceSAl$LBitVector$AILOArray$AIIIB(t, SA, s, bkt, n, K, false);
+ SAIS$_induceSAs$LBitVector$AILOArray$AIIIB(t, SA, s, bkt, n, K, true);
+};
+
+var SAIS$_make$LOArray$AIII = SAIS._make$LOArray$AIII;
+
+OktaviaSearch._stemmer = null;
+OktaviaSearch._instance = null;
+$__jsx_lazy_init(Oktavia, "eof", function () {
+ return String.fromCharCode(0);
+});
+$__jsx_lazy_init(Oktavia, "eob", function () {
+ return String.fromCharCode(1);
+});
+$__jsx_lazy_init(Oktavia, "unknown", function () {
+ return String.fromCharCode(3);
+});
+Binary._base64EncodeChars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
+$__jsx_lazy_init(Binary, "_base64DecodeChars", function () {
+ return [ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 62, -1, -1, -1, 63, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, -1, -1, -1, -1, -1, -1, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -1, -1, -1, -1, -1, -1, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, -1, -1, -1, -1 ];
+});
+$__jsx_lazy_init(Style, "console", function () {
+ return ({ 'title': [ '\x1B[32m\x1b[4m', '\x1B[39m\x1b[0m' ], 'url': [ '\x1B[34m', '\x1B[39m' ], 'hit': [ '\x1B[4m', '\x1B[0m' ], 'del': [ '\x1B[9m', '\x1B[0m' ], 'summary': [ '\x1B[90m', '\x1B[39m' ] });
+});
+$__jsx_lazy_init(Style, "html", function () {
+ return ({ 'title': [ '<span class="title">', '</span>' ], 'url': [ '<span class="url">', '</span>' ], 'hit': [ '<span class="hit">', '</span>' ], 'del': [ '<del>', '</del>' ], 'summary': [ '<span class="reuslt">', '</span>' ] });
+});
+$__jsx_lazy_init(Style, "ignore", function () {
+ return ({ 'tilte': [ '', '' ], 'url': [ '', '' ], 'hit': [ '', '' ], 'del': [ '', '' ], 'summary': [ '', '' ] });
+});
+$__jsx_lazy_init(_Common, "buffers", function () {
+ return [ "comment", "sgmlDecl", "textNode", "tagName", "doctype", "procInstName", "procInstBody", "entity", "attribName", "attribValue", "cdata", "script" ];
+});
+$__jsx_lazy_init(_Common, "EVENTS", function () {
+ return [ "text", "processinginstruction", "sgmldeclaration", "doctype", "comment", "attribute", "opentag", "closetag", "opencdata", "cdata", "clo_State.CDATA", "error", "end", "ready", "script", "opennamespace", "closenamespace" ];
+});
+_Common.MAX_BUFFER_LENGTH = 65536;
+_State.BEGIN = 1;
+_State.TEXT = 2;
+_State.TEXT_ENTITY = 3;
+_State.OPEN_WAKA = 4;
+_State.SGML_DECL = 5;
+_State.SGML_DECL_QUOTED = 6;
+_State.DOCTYPE = 7;
+_State.DOCTYPE_QUOTED = 8;
+_State.DOCTYPE_DTD = 9;
+_State.DOCTYPE_DTD_QUOTED = 10;
+_State.COMMENT_STARTING = 11;
+_State.COMMENT = 12;
+_State.COMMENT_ENDING = 13;
+_State.COMMENT_ENDED = 14;
+_State.CDATA = 15;
+_State.CDATA_ENDING = 16;
+_State.CDATA_ENDING_2 = 17;
+_State.PROC_INST = 18;
+_State.PROC_INST_BODY = 19;
+_State.PROC_INST_ENDING = 20;
+_State.OPEN_TAG = 21;
+_State.OPEN_TAG_SLASH = 22;
+_State.ATTRIB = 23;
+_State.ATTRIB_NAME = 24;
+_State.ATTRIB_NAME_SAW_WHITE = 25;
+_State.ATTRIB_VALUE = 26;
+_State.ATTRIB_VALUE_QUOTED = 27;
+_State.ATTRIB_VALUE_UNQUOTED = 28;
+_State.ATTRIB_VALUE_ENTITY_Q = 29;
+_State.ATTRIB_VALUE_ENTITY_U = 30;
+_State.CLOSE_TAG = 31;
+_State.CLOSE_TAG_SAW_WHITE = 32;
+_State.SCRIPT = 33;
+_State.SCRIPT_ENDING = 34;
+$__jsx_lazy_init(_Entities, "_entities", function () {
+ return ({ "amp": "&", "gt": ">", "lt": "<", "quot": "\"", "apos": "'", "AElig": 198, "Aacute": 193, "Acirc": 194, "Agrave": 192, "Aring": 197, "Atilde": 195, "Auml": 196, "Ccedil": 199, "ETH": 208, "Eacute": 201, "Ecirc": 202, "Egrave": 200, "Euml": 203, "Iacute": 205, "Icirc": 206, "Igrave": 204, "Iuml": 207, "Ntilde": 209, "Oacute": 211, "Ocirc": 212, "Ograve": 210, "Oslash": 216, "Otilde": 213, "Ouml": 214, "THORN": 222, "Uacute": 218, "Ucirc": 219, "Ugrave": 217, "Uuml": 220, "Yacute": 221, "aacute": 225, "acirc": 226, "aelig": 230, "agrave": 224, "aring": 229, "atilde": 227, "auml": 228, "ccedil": 231, "eacute": 233, "ecirc": 234, "egrave": 232, "eth": 240, "euml": 235, "iacute": 237, "icirc": 238, "igrave": 236, "iuml": 239, "ntilde": 241, "oacute": 243, "ocirc": 244, "ograve": 242, "oslash": 248, "otilde": 245, "ouml": 246, "szlig": 223, "thorn": 254, "uacute": 250, "ucirc": 251, "ugrave": 249, "uuml": 252, "yacute": 253, "yuml": 255, "copy": 169, "reg": 174, "nbsp": 160, "iexcl": 161, "cent": 162, "pound": 163, "curren": 164, "yen": 165, "brvbar": 166, "sect": 167, "uml": 168, "ordf": 170, "laquo": 171, "not": 172, "shy": 173, "macr": 175, "deg": 176, "plusmn": 177, "sup1": 185, "sup2": 178, "sup3": 179, "acute": 180, "micro": 181, "para": 182, "middot": 183, "cedil": 184, "ordm": 186, "raquo": 187, "frac14": 188, "frac12": 189, "frac34": 190, "iquest": 191, "times": 215, "divide": 247, "OElig": 338, "oelig": 339, "Scaron": 352, "scaron": 353, "Yuml": 376, "fnof": 402, "circ": 710, "tilde": 732, "Alpha": 913, "Beta": 914, "Gamma": 915, "Delta": 916, "Epsilon": 917, "Zeta": 918, "Eta": 919, "Theta": 920, "Iota": 921, "Kappa": 922, "Lambda": 923, "Mu": 924, "Nu": 925, "Xi": 926, "Omicron": 927, "Pi": 928, "Rho": 929, "Sigma": 931, "Tau": 932, "Upsilon": 933, "Phi": 934, "Chi": 935, "Psi": 936, "Omega": 937, "alpha": 945, "beta": 946, "gamma": 947, "delta": 948, "epsilon": 949, "zeta": 950, "eta": 951, "theta": 952, "iota": 953, "kappa": 954, "lambda": 955, "mu": 956, "nu": 957, "xi": 958, "omicron": 959, "pi": 960, "rho": 961, "sigmaf": 962, "sigma": 963, "tau": 964, "upsilon": 965, "phi": 966, "chi": 967, "psi": 968, "omega": 969, "thetasym": 977, "upsih": 978, "piv": 982, "ensp": 8194, "emsp": 8195, "thinsp": 8201, "zwnj": 8204, "zwj": 8205, "lrm": 8206, "rlm": 8207, "ndash": 8211, "mdash": 8212, "lsquo": 8216, "rsquo": 8217, "sbquo": 8218, "ldquo": 8220, "rdquo": 8221, "bdquo": 8222, "dagger": 8224, "Dagger": 8225, "bull": 8226, "hellip": 8230, "permil": 8240, "prime": 8242, "Prime": 8243, "lsaquo": 8249, "rsaquo": 8250, "oline": 8254, "frasl": 8260, "euro": 8364, "image": 8465, "weierp": 8472, "real": 8476, "trade": 8482, "alefsym": 8501, "larr": 8592, "uarr": 8593, "rarr": 8594, "darr": 8595, "harr": 8596, "crarr": 8629, "lArr": 8656, "uArr": 8657, "rArr": 8658, "dArr": 8659, "hArr": 8660, "forall": 8704, "part": 8706, "exist": 8707, "empty": 8709, "nabla": 8711, "isin": 8712, "notin": 8713, "ni": 8715, "prod": 8719, "sum": 8721, "minus": 8722, "lowast": 8727, "radic": 8730, "prop": 8733, "infin": 8734, "ang": 8736, "and": 8743, "or": 8744, "cap": 8745, "cup": 8746, "int": 8747, "there4": 8756, "sim": 8764, "cong": 8773, "asymp": 8776, "ne": 8800, "equiv": 8801, "le": 8804, "ge": 8805, "sub": 8834, "sup": 8835, "nsub": 8836, "sube": 8838, "supe": 8839, "oplus": 8853, "otimes": 8855, "perp": 8869, "sdot": 8901, "lceil": 8968, "rceil": 8969, "lfloor": 8970, "rfloor": 8971, "lang": 9001, "rang": 9002, "loz": 9674, "spades": 9824, "clubs": 9827, "hearts": 9829, "diams": 9830 });
+});
+BitVector.SMALL_BLOCK_SIZE = 32;
+BitVector.LARGE_BLOCK_SIZE = 256;
+BitVector.BLOCK_RATE = 8;
+$__jsx_lazy_init(BurrowsWheelerTransform, "END_MARKER", function () {
+ return String.fromCharCode(0);
+});
+var $__jsx_classMap = {
+ "tool/web/oktavia-search.jsx": {
+ _Result: _Result,
+ _Result$SSSI: _Result$SSSI,
+ _Proposal: _Proposal,
+ _Proposal$SSI: _Proposal$SSI,
+ OktaviaSearch: OktaviaSearch,
+ OktaviaSearch$I: OktaviaSearch$I,
+ _Main: _Main,
+ _Main$: _Main$
+ },
+ "src/oktavia.jsx": {
+ Oktavia: Oktavia,
+ Oktavia$: Oktavia$
+ },
+ "src/binary-util.jsx": {
+ Binary: Binary,
+ Binary$: Binary$,
+ LoadedStringResult: LoadedStringResult,
+ LoadedStringResult$SI: LoadedStringResult$SI,
+ LoadedStringListResult: LoadedStringListResult,
+ LoadedStringListResult$SI: LoadedStringListResult$SI,
+ LoadedStringListMapResult: LoadedStringListMapResult,
+ LoadedStringListMapResult$SI: LoadedStringListMapResult$SI,
+ LoadedNumberListResult: LoadedNumberListResult,
+ LoadedNumberListResult$SI: LoadedNumberListResult$SI,
+ CompressionReport: CompressionReport,
+ CompressionReport$: CompressionReport$
+ },
+ "src/query.jsx": {
+ Query: Query,
+ Query$: Query$
+ },
+ "src/query-string-parser.jsx": {
+ QueryStringParser: QueryStringParser,
+ QueryStringParser$: QueryStringParser$
+ },
+ "src/search-result.jsx": {
+ Proposal: Proposal,
+ Proposal$II: Proposal$II,
+ Position: Position,
+ Position$SIB: Position$SIB,
+ SearchUnit: SearchUnit,
+ SearchUnit$I: SearchUnit$I,
+ SingleResult: SingleResult,
+ SingleResult$: SingleResult$,
+ SingleResult$SBB: SingleResult$SBB,
+ SearchSummary: SearchSummary,
+ SearchSummary$: SearchSummary$,
+ SearchSummary$LOktavia$: SearchSummary$LOktavia$
+ },
+ "src/style.jsx": {
+ Style: Style,
+ Style$S: Style$S,
+ _HTMLHandler: _HTMLHandler,
+ _HTMLHandler$HASB: _HTMLHandler$HASB
+ },
+ "src/stemmer/stemmer.jsx": {
+ Stemmer: Stemmer,
+ Stemmer$: Stemmer$
+ },
+ "src/metadata.jsx": {
+ Metadata: Metadata,
+ Metadata$LOktavia$: Metadata$LOktavia$,
+ Section: Section,
+ Section$LOktavia$: Section$LOktavia$,
+ Splitter: Splitter,
+ Splitter$LOktavia$: Splitter$LOktavia$,
+ Splitter$LOktavia$S: Splitter$LOktavia$S,
+ Table: Table,
+ Table$LOktavia$AS: Table$LOktavia$AS,
+ Block: Block,
+ Block$LOktavia$: Block$LOktavia$
+ },
+ "src/fm-index.jsx": {
+ FMIndex: FMIndex,
+ FMIndex$: FMIndex$
+ },
+ "src/sax.jsx": {
+ Tag: Tag,
+ Tag$S: Tag$S,
+ _Common: _Common,
+ _Common$: _Common$,
+ _State: _State,
+ _State$: _State$,
+ SAXHandler: SAXHandler,
+ SAXHandler$: SAXHandler$,
+ SAXParser: SAXParser,
+ SAXParser$LSAXHandler$: SAXParser$LSAXHandler$,
+ SAXParser$LSAXHandler$B: SAXParser$LSAXHandler$B,
+ Char: Char,
+ Char$: Char$,
+ _Entities: _Entities,
+ _Entities$: _Entities$
+ },
+ "src/bit-vector.jsx": {
+ BitVector: BitVector,
+ BitVector$: BitVector$
+ },
+ "src/wavelet-matrix.jsx": {
+ WaveletMatrix: WaveletMatrix,
+ WaveletMatrix$: WaveletMatrix$
+ },
+ "src/burrows-wheeler-transform.jsx": {
+ BurrowsWheelerTransform: BurrowsWheelerTransform,
+ BurrowsWheelerTransform$: BurrowsWheelerTransform$
+ },
+ "src/sais.jsx": {
+ OArray: OArray,
+ OArray$AI: OArray$AI,
+ OArray$AII: OArray$AII,
+ SAIS: SAIS,
+ SAIS$: SAIS$
+ }
+};
+
+
+/**
+ * launches _Main.main(:string[]):void invoked by jsx --run|--executable
+ */
+JSX.runMain = function (sourceFile, args) {
+ var module = JSX.require(sourceFile);
+ if (! module) {
+ throw new ReferenceError("entry point module not found in " + sourceFile);
+ }
+ if (! module._Main) {
+ throw new ReferenceError("entry point _Main not found in " + sourceFile);
+ }
+ if (! module._Main.main$AS) {
+ throw new ReferenceError("entry point _Main.main(:string[]):void not found in " + sourceFile);
+ }
+ module._Main.main$AS(args);
+};
+
+/**
+ * launches _Test#test*():void invoked by jsx --test
+ */
+JSX.runTests = function (sourceFile, tests) {
+ var module = JSX.require(sourceFile);
+ var testClass = module._Test$;
+
+ if (!testClass) return; // skip if there's no test class
+
+ if(tests.length === 0) {
+ var p = testClass.prototype;
+ for (var m in p) {
+ if (p[m] instanceof Function
+ && /^test.*[$]$/.test(m)) {
+ tests.push(m);
+ }
+ }
+ }
+ else { // set as process arguments
+ tests = tests.map(function (name) {
+ return name + "$"; // mangle for function test*():void
+ });
+ }
+
+ var testCase = new testClass();
+
+ if (testCase.beforeClass$AS != null)
+ testCase.beforeClass$AS(tests);
+
+ for (var i = 0; i < tests.length; ++i) {
+ (function (method) {
+ if (method in testCase) {
+ testCase.run$SF$V$(method, function() { testCase[method](); });
+ }
+ else {
+ throw new ReferenceError("No such test method: " + method);
+ }
+ }(tests[i]));
+ }
+
+ if (testCase.afterClass$ != null)
+ testCase.afterClass$();
+};
+/**
+ * call a function on load/DOMContentLoaded
+ */
+function $__jsx_onload (event) {
+ window.removeEventListener("load", $__jsx_onload);
+ document.removeEventListener("DOMContentLoaded", $__jsx_onload);
+ JSX.runMain("tool/web/oktavia-search.jsx", [])
+}
+
+window.addEventListener("load", $__jsx_onload);
+document.addEventListener("DOMContentLoaded", $__jsx_onload);
+
+})(JSX);
diff --git a/web/server/h2o/libh2o/misc/oktavia/templates/tinkerer/_static/searchstyle.css b/web/server/h2o/libh2o/misc/oktavia/templates/tinkerer/_static/searchstyle.css
new file mode 100644
index 00000000..a3d51d43
--- /dev/null
+++ b/web/server/h2o/libh2o/misc/oktavia/templates/tinkerer/_static/searchstyle.css
@@ -0,0 +1,174 @@
+form.oktavia_form {
+ position: relative;
+ display: block;
+ width: 240px;
+ height: 25px;
+}
+
+input.oktavia_search {
+ -webkit-appearance: searchfield;
+ -webkit-user-select: text;
+ cursor: auto;
+ background-color: white;
+ color: black;
+ line-height: normal;
+ display: inline-block;
+ padding: 1px;
+ text-align: start;
+ margin: 2px 0px 2px 0px;
+ padding: 1px;
+}
+
+div.oktavia_searchresult_box {
+ display: none;
+ position: absolute;
+ width: 500px;
+ padding: 10px;
+ right: 10px;
+ background-color: #ffffff;
+ -moz-border-radius: 8px;
+ border-radius: 8px;
+ -moz-box-shadow: 3px 3px 5px 5px #b5b2b2;
+ box-shadow: 3px 3px 5px 5px #b5b2b2;
+ opacity: 0.95;
+ z-index: 100000;
+}
+
+div.oktavia_close_search_box {
+ position: absolute;
+ top: 10px;
+ right: 10px;
+ width: 20px;
+ height: 20px;
+ text-align: center;
+ vertical-align: middle;
+ color: #666;
+}
+
+div.oktavia_close_search_box:hover {
+ background-color: #d1e8ff;
+ border: 1px solid gray;
+}
+
+div.oktavia_close_search_box:active {
+ background-color: #b4c8db;
+ border: 1px solid gray;
+}
+
+
+div.oktavia_searchresult_summary {
+ color: #444;
+}
+
+div.oktavia_searchresult .entry {
+ margin: 10px 10px 10px 10px;
+ color: black;
+}
+
+div.oktavia_searchresult .entry .title {
+ font-size: normal;
+}
+
+div.oktavia_searchresult .entry .title a:link {
+ color: #0000EE;
+ text-decoration: underline;
+}
+
+div.oktavia_searchresult .entry .title a:visited {
+ color: #551A8B;
+ text-decoration: underline;
+}
+
+div.oktavia_searchresult .entry .title a:hover {
+}
+
+div.oktavia_searchresult .entry .title a:active {
+ color: #FF0000;
+ text-decoration: underline;
+}
+
+div.oktavia_searchresult .entry .url {
+ font-size: 14px!important;
+ color: #093;
+ font-style: normal;
+ font-family: arial,sans-serif;
+}
+
+div.oktavia_searchresult .entry .resultcontent {
+ font-size: small;
+ font-family: arial,sans-serif;
+ color: #222;
+}
+
+div.oktavia_searchresult .entry .resultcontent .hit {
+ font-weight: bolder;
+ text-decoration: underline;
+}
+
+div.oktavia_searchresult .proposal {
+ margin: 10px 10px 10px 10px;
+ color: #222;
+ font-size: small;
+ font-family: arial,sans-serif;
+}
+
+div.oktavia_searchresult .proposal .option {
+ background-color: #e8f4ff;
+ border-bottom: 1px solid blue;
+}
+
+div.oktavia_searchresult .proposal .option:hover {
+ background-color: #d1e8ff;
+}
+
+div.oktavia_searchresult .proposal .option:active {
+ background-color: #b4c8db;
+}
+
+div.oktavia_searchresult_nav span.leader {
+ color: #228;
+}
+
+div.oktavia_searchresult_nav span.page {
+ background-color: #ffffff;
+ border: 1px solid #888888;
+ padding: 5px;
+ margin: 5px;
+ color: #222;
+}
+
+div.oktavia_searchresult_nav span.page:hover {
+ background-color: #d1e8ff;
+ border: 1px solid #7d98ff;
+}
+
+div.oktavia_searchresult_nav span.page:active {
+ background-color: #b4c8db;
+ border: 1px solid #6c83db;
+}
+
+div.oktavia_searchresult_nav span.selected {
+ background-color: #b4c8db;
+ border: 1px solid #6c83db;
+}
+
+div.oktavia_searchresult_nav span.selected:hover {
+ background-color: #b4c8db;
+ border: 1px solid #6c83db;
+}
+
+div.oktavia_searchresult_nav span.selected:active {
+ background-color: #b4c8db;
+ border: 1px solid #6c83db;
+}
+
+div.oktavia_searchresult_box span.pr {
+ position: absolute;
+ right: 10px;
+ bottom: 10px;
+ color: #555;
+}
+
+.highlighted {
+ background-color: #fbe54e;
+}
diff --git a/web/server/h2o/libh2o/misc/oktavia/templates/tinkerer/_templates/oktaviasearch.html b/web/server/h2o/libh2o/misc/oktavia/templates/tinkerer/_templates/oktaviasearch.html
new file mode 100644
index 00000000..30bf8626
--- /dev/null
+++ b/web/server/h2o/libh2o/misc/oktavia/templates/tinkerer/_templates/oktaviasearch.html
@@ -0,0 +1,8 @@
+<div class="widget">
+ <h1>Search by Oktavia</h1>
+ <script type="text/javascript" src="{{ pathto("_static/oktavia-search.js", 1) }}"></script>
+ <script type="text/javascript" src="{{ pathto("_static/oktavia-jquery-ui.js", 1) }}"></script>
+ <link rel="stylesheet" href="{{ pathto("_static/searchstyle.css", 1) }}" type="text/css" />
+ <div id="oktavia_search_form" data-index="search/searchindex.js"></div>
+</div>
+
diff --git a/web/server/h2o/libh2o/misc/oktavia/test/test-binary-util.jsx b/web/server/h2o/libh2o/misc/oktavia/test/test-binary-util.jsx
new file mode 100644
index 00000000..25882e34
--- /dev/null
+++ b/web/server/h2o/libh2o/misc/oktavia/test/test-binary-util.jsx
@@ -0,0 +1,190 @@
+import "test-case.jsx";
+import "binary-util.jsx";
+
+class _Test extends TestCase
+{
+ function test_16bit_number() : void
+ {
+ this.expect(Binary.load16bitNumber(Binary.dump16bitNumber(0), 0)).toBe(0);
+ this.expect(Binary.load16bitNumber(Binary.dump16bitNumber(65535), 0)).toBe(65535);
+ this.expect(Binary.load16bitNumber(Binary.dump16bitNumber(65536), 0)).notToBe(65536);
+ }
+
+ function test_32bit_number() : void
+ {
+ this.expect(Binary.load32bitNumber(Binary.dump32bitNumber(0), 0)).toBe(0);
+ this.expect(Binary.load32bitNumber(Binary.dump32bitNumber(4294967295), 0)).toBe(4294967295);
+ this.expect(Binary.load32bitNumber(Binary.dump32bitNumber(4294967296), 0)).notToBe(4294967296);
+ }
+
+ function test_string() : void
+ {
+ var str = Binary.loadString(Binary.dumpString('hello world'), 0);
+ this.expect(str.result).toBe('hello world');
+
+ // 7bit safe charactes will be compressed
+ this.expect(Binary.dumpString('hello world').length).toBeLE('hello world'.length);
+ this.expect(Binary.dumpString('').length).toBe(''.length + 1);
+
+ // 7bit unsafe charactes will not be compressed
+ this.expect(Binary.dumpString('\u1111\u1111').length).toBe('\u1111\u1111'.length + 1);
+ }
+
+ function test_string_list() : void
+ {
+ var list = Binary.loadStringList(Binary.dumpStringList(['hello', 'world']), 0);
+ this.expect(list.result[0]).toBe('hello');
+ this.expect(list.result[1]).toBe('world');
+
+ var list = Binary.loadStringList(Binary.dumpStringList(['\u1111', '\u2222']), 0);
+ this.expect(list.result[0]).toBe('\u1111');
+ this.expect(list.result[1]).toBe('\u2222');
+ }
+
+ function test_string_list_map() : void
+ {
+ var src = {'hello': ['HELLO'], 'world': ['WORLD']};
+ var list = Binary.loadStringListMap(Binary.dumpStringListMap(src), 0);
+ this.expect(list.result['hello'][0]).toBe('HELLO');
+ this.expect(list.result['world'][0]).toBe('WORLD');
+ }
+
+ function test_32bit_number_list_blank() : void
+ {
+ var list = [0, 0, 0, 0, 0, 0];
+ var dumped = Binary.dump32bitNumberList(list);
+ this.expect(dumped.length).toBe(2 + 1);
+ var loaded = Binary.load32bitNumberList(dumped, 0);
+ this.expect(loaded.result.length).toBe(6);
+ this.expect(loaded.result[0]).toBe(0);
+ this.expect(loaded.result[5]).toBe(0);
+ this.expect(loaded.offset).toBe(2 + 1);
+ }
+
+ function test_32bit_number_list_non_blank() : void
+ {
+ var list = [1, 1, 1, 1, 1, 1];
+ var dumped = Binary.dump32bitNumberList(list);
+ this.expect(dumped.length).toBe(2 * 6 + 2 + 1);
+ var loaded = Binary.load32bitNumberList(dumped, 0);
+ this.expect(loaded.result.length).toBe(6);
+ this.expect(loaded.result[0]).toBe(1);
+ this.expect(loaded.result[5]).toBe(1);
+ this.expect(loaded.offset).toBe(2 * 6 + 2 + 1);
+ }
+
+ function test_32bit_number_list_zebra() : void
+ {
+ var list = [1, 0, 1, 0, 1, 0];
+ var dumped = Binary.dump32bitNumberList(list);
+ this.expect(dumped.length).toBe(2 * 3 + 2 + 1);
+ var loaded = Binary.load32bitNumberList(dumped, 0);
+ this.expect(loaded.result.length).toBe(6);
+ this.expect(loaded.result[0]).toBe(1);
+ this.expect(loaded.result[1]).toBe(0);
+ this.expect(loaded.result[2]).toBe(1);
+ this.expect(loaded.result[3]).toBe(0);
+ this.expect(loaded.result[4]).toBe(1);
+ this.expect(loaded.result[5]).toBe(0);
+ this.expect(loaded.offset).toBe(2 * 3 + 2 + 1);
+ }
+
+ function test_32bit_number_list_combo1() : void
+ {
+ // non-blank + blank
+ var list = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0];
+ var dumped = Binary.dump32bitNumberList(list);
+ this.expect(dumped.length).toBe(2 + 1 + 2 * 17 + 1);
+ var loaded = Binary.load32bitNumberList(dumped, 0);
+ this.expect(loaded.result.length).toBe(list.length);
+ this.expect(loaded.result[0]).toBe(1);
+ this.expect(loaded.result[15]).toBe(1);
+ this.expect(loaded.result[17]).toBe(0);
+ this.expect(loaded.result[19]).toBe(0);
+ this.expect(loaded.offset).toBe(2 + 1 + 2 * 17 + 1);
+ }
+
+ function test_32bit_number_list_combo2() : void
+ {
+ // blank + non-blank
+ var list = [0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1];
+ var dumped = Binary.dump32bitNumberList(list);
+ this.expect(dumped.length).toBe(2 + 1 + 1 + 2 * 17);
+ var loaded = Binary.load32bitNumberList(dumped, 0);
+ this.expect(loaded.result.length).toBe(list.length);
+ this.expect(loaded.result[0]).toBe(0);
+ this.expect(loaded.result[2]).toBe(0);
+ this.expect(loaded.result[3]).toBe(1);
+ this.expect(loaded.result[19]).toBe(1);
+ this.expect(loaded.offset).toBe(2 + 1 + 1 + 2 * 17);
+ }
+
+ function test_32bit_number_list_combo3() : void
+ {
+ // non-blank + zebra
+ var list = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 0, 0];
+ var dumped = Binary.dump32bitNumberList(list);
+ this.expect(dumped.length).toBe(2 + 1 + 2 * 16 + 1 + 1 + 2 * 3);
+ var loaded = Binary.load32bitNumberList(dumped, 0);
+ this.expect(loaded.result.length).toBe(list.length);
+ this.expect(loaded.result[0]).toBe(1);
+ this.expect(loaded.result[9]).toBe(1);
+ this.expect(loaded.result[16]).toBe(0);
+ this.expect(loaded.result[18]).toBe(1);
+ this.expect(loaded.offset).toBe(2 + 1 + 2 * 16 + 1 + 1 + 2 * 3);
+ }
+
+ function test_32bit_number_list_combo4() : void
+ {
+ // zebra + non-block
+ var list = [1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2];
+ var dumped = Binary.dump32bitNumberList(list);
+ this.expect(dumped.length).toBe(2 + 1 + 2 * 11 + 1 + 2 * 16);
+ var loaded = Binary.load32bitNumberList(dumped, 0);
+ this.expect(loaded.result.length).toBe(list.length);
+ this.expect(loaded.result[0]).toBe(1);
+ this.expect(loaded.result[14]).toBe(0);
+ this.expect(loaded.result[15]).toBe(1);
+ this.expect(loaded.result[30]).toBe(2);
+ this.expect(loaded.offset).toBe(2 + 1 + 2 * 11 + 1 + 2 * 16);
+ }
+
+ function test_32bit_number_list_combo5() : void
+ {
+ // zero + zebra
+ var list = [0, 0, 0, 0, 0, 0, 1];
+ var dumped = Binary.dump32bitNumberList(list);
+ this.expect(dumped.length).toBe(2 + 1 + 1 + 2);
+ var loaded = Binary.load32bitNumberList(dumped, 0);
+ this.expect(loaded.result.length).toBe(7);
+ this.expect(loaded.result[0]).toBe(0);
+ this.expect(loaded.result[6]).toBe(1);
+ this.expect(loaded.offset).toBe(2 + 1 + 1 + 2);
+ }
+
+ function test_32bit_number_list_combo6() : void
+ {
+ // zebra + zero
+ var list = [1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0];
+ var dumped = Binary.dump32bitNumberList(list);
+ this.expect(dumped.length).toBe(2 + 1 + 2 * 12 + 1);
+ var loaded = Binary.load32bitNumberList(dumped, 0);
+ this.expect(loaded.result.length).toBe(list.length);
+ this.expect(loaded.result[0]).toBe(1);
+ this.expect(loaded.result[14]).toBe(1);
+ this.expect(loaded.result[15]).toBe(0);
+ this.expect(loaded.result[23]).toBe(0);
+ this.expect(loaded.offset).toBe(2 + 1 + 2 * 12 + 1);
+ }
+
+ function test_base64_encode_decode() : void
+ {
+ var allChars = [] : string[];
+ for (var i = 256; i < 65536; i++)
+ {
+ allChars.push(String.fromCharCode(i));
+ }
+ var allCharSource = allChars.join('');
+ this.expect(Binary.base64decode(Binary.base64encode(allCharSource))).toBe(allCharSource);
+ }
+}
diff --git a/web/server/h2o/libh2o/misc/oktavia/test/test-bit-vector.jsx b/web/server/h2o/libh2o/misc/oktavia/test/test-bit-vector.jsx
new file mode 100644
index 00000000..18f80b64
--- /dev/null
+++ b/web/server/h2o/libh2o/misc/oktavia/test/test-bit-vector.jsx
@@ -0,0 +1,131 @@
+import "test-case.jsx";
+import "bit-vector.jsx";
+import "console.jsx";
+
+class _Test extends TestCase
+{
+ var src_values : int[];
+ var bv0 : BitVector;
+ var bv1 : BitVector;
+
+ override function setUp () : void
+ {
+ this.bv0 = new BitVector();
+ this.bv1 = new BitVector();
+
+ this.src_values = [0, 511, 512, 1000, 2000, 3000] : int[];
+
+ for (var i = 0; i <= this.src_values[this.src_values.length - 1]; i++)
+ {
+ this.bv0.set(i, true);
+ }
+
+ for (var i = 0; i < this.src_values.length; i++)
+ {
+ var v = this.src_values[i];
+ this.bv1.set(v, true);
+ this.bv0.set(v, false);
+ }
+ this.bv1.build();
+ this.bv0.build();
+ }
+
+ function test_size () : void
+ {
+ this.expect(this.bv1.size()).toBe(this.src_values[this.src_values.length - 1] + 1); // == 3001
+ this.expect(this.bv1.size(true)).toBe(this.src_values.length); // == 6
+ this.expect(this.bv0.size()).toBe(this.src_values[this.src_values.length - 1] + 1); // == 3001
+ this.expect(this.bv0.size(false)).toBe(this.src_values.length); // == 6
+ }
+
+ function test_get () : void
+ {
+ for (var i = 0; i < this.src_values.length; i++)
+ {
+ var v = this.src_values[i];
+ this.expect(this.bv1.get(v)).toBe(true);
+ this.expect(this.bv0.get(v)).toBe(false);
+ }
+ }
+
+ function test_rank () : void
+ {
+ for (var i = 0; i < this.src_values.length; i++)
+ {
+ var v = this.src_values[i];
+ this.expect(this.bv1.rank(v, true)).toBe(i);
+ this.expect(this.bv0.rank(v, false)).toBe(i);
+ }
+ }
+
+ function test_select () : void
+ {
+ for (var i = 0; i < this.src_values.length; i++)
+ {
+ var v = this.src_values[i];
+ this.expect(this.bv1.select(i, true)).toBe(v);
+ this.expect(this.bv0.select(i, false)).toBe(v);
+ }
+ }
+
+ function test_load_dump_and_size () : void
+ {
+ console.log('dump1');
+ var dump1 = this.bv1.dump();
+ console.log('dump0');
+ var dump0 = this.bv0.dump();
+ console.log('load1');
+ this.bv1.load(dump1);
+ console.log('load0');
+ this.bv0.load(dump0);
+
+ this.expect(this.bv1.size()).toBe(this.src_values[this.src_values.length - 1] + 1); // == 3001
+ this.expect(this.bv1.size(true)).toBe(this.src_values.length); // == 6
+ this.expect(this.bv0.size()).toBe(this.src_values[this.src_values.length - 1] + 1); // == 3001
+ this.expect(this.bv0.size(false)).toBe(this.src_values.length); // == 6
+ }
+
+ function test_load_dump_and_get () : void
+ {
+ var dump1 = this.bv1.dump();
+ var dump0 = this.bv0.dump();
+ this.bv1.load(dump1);
+ this.bv0.load(dump0);
+
+ for (var i = 0; i < this.src_values.length; i++)
+ {
+ var v = this.src_values[i];
+ this.expect(this.bv1.get(v)).toBe(true);
+ this.expect(this.bv0.get(v)).toBe(false);
+ }
+ }
+
+ function test_load_dump_and_rank () : void
+ {
+ var dump1 = this.bv1.dump();
+ var dump0 = this.bv0.dump();
+ this.bv1.load(dump1);
+ this.bv0.load(dump0);
+
+ for (var i = 0; i < this.src_values.length; i++)
+ {
+ var v = this.src_values[i];
+ this.expect(this.bv1.rank(v, true)).toBe(i);
+ this.expect(this.bv0.rank(v, false)).toBe(i);
+ }
+ }
+
+ function test_load_dump_and_select () : void
+ {
+ var dump1 = this.bv1.dump();
+ var dump0 = this.bv0.dump();
+ this.bv1.load(dump1);
+ this.bv0.load(dump0);
+ for (var i = 0; i < this.src_values.length; i++)
+ {
+ var v = this.src_values[i];
+ this.expect(this.bv1.select(i, true)).toBe(v);
+ this.expect(this.bv0.select(i, false)).toBe(v);
+ }
+ }
+}
diff --git a/web/server/h2o/libh2o/misc/oktavia/test/test-burrows-wheeler-transform.jsx b/web/server/h2o/libh2o/misc/oktavia/test/test-burrows-wheeler-transform.jsx
new file mode 100644
index 00000000..6a033e58
--- /dev/null
+++ b/web/server/h2o/libh2o/misc/oktavia/test/test-burrows-wheeler-transform.jsx
@@ -0,0 +1,24 @@
+/**
+ * This is a JSX version of shellinford library:
+ * https://code.google.com/p/shellinford/
+ *
+ * License: http://shibu.mit-license.org/
+ */
+
+import "test-case.jsx";
+import "burrows-wheeler-transform.jsx";
+
+class _Test extends TestCase
+{
+ var bwt : BurrowsWheelerTransform;
+ override function setUp() : void
+ {
+ this.bwt = new BurrowsWheelerTransform();
+ this.bwt.build('abracadabra' + BurrowsWheelerTransform.END_MARKER);
+ }
+
+ function test_get() : void
+ {
+ this.expect(this.bwt.get("$")).toBe("ard$rcaaaabb");
+ }
+}
diff --git a/web/server/h2o/libh2o/misc/oktavia/test/test-fm-index.jsx b/web/server/h2o/libh2o/misc/oktavia/test/test-fm-index.jsx
new file mode 100644
index 00000000..80035a61
--- /dev/null
+++ b/web/server/h2o/libh2o/misc/oktavia/test/test-fm-index.jsx
@@ -0,0 +1,250 @@
+/**
+ * This is a JSX version of shellinford library:
+ * https://code.google.com/p/shellinford/
+ *
+ * License: http://shibu.mit-license.org/
+ */
+
+import "test-case.jsx";
+import "fm-index.jsx";
+
+class Pair
+{
+ var first : string;
+ var second : int;
+ function constructor (_first : string, _second : int)
+ {
+ this.first = _first;
+ this.second = _second;
+ }
+}
+
+class _Test extends TestCase
+{
+ var str : string;
+ var rd : Map.<int>;
+ var pd : int[];
+ var sd : string[];
+ var didd : int[];
+ var docd : string[];
+ var fm : FMIndex;
+ var end_marker : string;
+
+ override function setUp () : void
+ {
+ this.str = "";
+ this.sd = [] : string[];
+ this.rd = {} : Map.<int>;
+ this.pd = [] : int[];
+ this.didd = [] : int[];
+ this.docd = [] : string[];
+ this.fm = new FMIndex();
+ this.end_marker = String.fromCharCode(1);
+
+ this.docd.push("abracadabra");
+ this.docd.push("mississippi");
+ this.docd.push("abracadabra mississippi");
+
+ var did = 0;
+ for (var i in this.docd)
+ {
+ var doc = this.docd[i];
+ this.str += doc;
+ for (var j = 0; j < doc.length; j++){
+ this.didd.push(did);
+ }
+ this.fm.push(doc);
+ did++;
+ }
+
+ this.didd.push(did);
+ this.str += this.end_marker;
+ this.fm.build(this.end_marker, 3, false);
+
+ for (var i = 0; i < this.str.length; i++)
+ {
+ for (var j = 1; j <= (this.str.length - i); j++)
+ {
+ var s = this.str.slice(i, i + j);
+ if (this.rd[s] == null)
+ {
+ this.rd[s] = 1;
+ }
+ else
+ {
+ this.rd[s]++;
+ }
+ }
+ }
+
+ var v = [] : Pair[];
+ for (var i = 0; i < this.str.length; i++)
+ {
+ var s = this.str.slice(i) + this.str.slice(0, i);
+ v.push(new Pair(s, i));
+ }
+ v.sort(function (a: Pair, b: Pair) : number {
+ if (a.first < b.first)
+ {
+ return -1;
+ }
+ else if (a.first > b.first)
+ {
+ return 1;
+ }
+ return a.second - b.second;
+ });
+ for (var i in v)
+ {
+ this.pd.push(v[i].second);
+ }
+ for (var i = 0; i < this.str.length; i++)
+ {
+ this.sd.push(this.str.slice(i));
+ }
+ }
+
+ function test_size () : void
+ {
+ this.expect(this.fm.size()).toBe(this.str.length);
+ }
+
+ function test_getRows () : void
+ {
+ for (var i = 0; i < this.fm.size(); i++)
+ {
+ for (var j = i + 1; j < this.fm.size(); j++)
+ {
+ var s = this.str.slice(i, j);
+ this.expect(this.fm.getRows(s)).toBe(this.rd[s]);
+ }
+ }
+ }
+
+ function test_getPosition () : void
+ {
+ for (var i = 0; i < this.fm.size(); i++)
+ {
+ this.expect(this.fm.getPosition(i)).toBe(this.pd[i]);
+ }
+ }
+
+ function test_getSubstring () : void
+ {
+ for (var i = 0; i < this.fm.size(); i++)
+ {
+ this.expect(this.fm.getSubstring(i, this.fm.size())).toBe(this.sd[i]);
+ }
+ }
+
+ function test_getSubstring2 () : void
+ {
+ this.fm = new FMIndex();
+ this.fm.push("abracadabra");
+ this.fm.push("mississippi");
+ this.fm.push("abracadabra mississippi");
+ this.fm.build(this.end_marker, 3, false);
+ this.expect(this.fm.getSubstring(0, 11)).toBe('abracadabra');
+ this.expect(this.fm.getSubstring(11, 11)).toBe('mississippi');
+ this.expect(this.fm.getSubstring(22, 23)).toBe('abracadabra mississippi');
+ }
+
+ function test_getPosition_boundary () : void
+ {
+ try
+ {
+ this.fm.getPosition(this.fm.size());
+ this.fail("fm.getPosition()");
+ }
+ catch (e : Error)
+ {
+ }
+ }
+
+ function test_getSubstring_boundary () : void
+ {
+ try
+ {
+ this.fm.getSubstring(this.fm.size(), 0);
+ this.fail("fm.getSubstring()");
+ }
+ catch (e : Error)
+ {
+ }
+ }
+
+ function test_dump_load_and_size () : void
+ {
+ var dump = this.fm.dump();
+ this.fm.load(dump);
+
+ this.expect(this.fm.size()).toBe(this.str.length);
+ }
+
+ function test_dump_load_and_getRows () : void
+ {
+ var dump = this.fm.dump();
+ this.fm.load(dump);
+
+ for (var i = 0; i < this.fm.size(); i++)
+ {
+ for (var j = i + 1; j < this.fm.size(); j++)
+ {
+ var s = this.str.slice(i, j);
+ this.expect(this.fm.getRows(s)).toBe(this.rd[s]);
+ }
+ }
+ }
+
+ function test_dump_load_and_getPosition () : void
+ {
+ var dump = this.fm.dump();
+ this.fm.load(dump);
+
+ for (var i = 0; i < this.fm.size(); i++)
+ {
+ this.expect(this.fm.getPosition(i)).toBe(this.pd[i]);
+ }
+ }
+
+ function test_dump_load_and_getSubstring () : void
+ {
+ var dump = this.fm.dump();
+ this.fm.load(dump);
+
+ for (var i = 0; i < this.fm.size(); i++)
+ {
+ this.expect(this.fm.getSubstring(i, this.fm.size())).toBe(this.sd[i]);
+ }
+ }
+
+ function test_dump_load_and_getPosition_boundary () : void
+ {
+ var dump = this.fm.dump();
+ this.fm.load(dump);
+
+ try
+ {
+ this.fm.getPosition(this.fm.size());
+ this.fail("fm.getPosition()");
+ }
+ catch (e : Error)
+ {
+ }
+ }
+
+ function test_dump_load_and_getSubstring_boundary () : void
+ {
+ var dump = this.fm.dump();
+ this.fm.load(dump);
+
+ try
+ {
+ this.fm.getSubstring(this.fm.size(), 0);
+ this.fail("fm.getSubstring()");
+ }
+ catch (e : Error)
+ {
+ }
+ }
+}
diff --git a/web/server/h2o/libh2o/misc/oktavia/test/test-getopt.jsx b/web/server/h2o/libh2o/misc/oktavia/test/test-getopt.jsx
new file mode 100644
index 00000000..63731b92
--- /dev/null
+++ b/web/server/h2o/libh2o/misc/oktavia/test/test-getopt.jsx
@@ -0,0 +1,84 @@
+import "test-case.jsx";
+import "getopt.jsx";
+
+class _Test extends TestCase
+{
+ function test_empty () : void
+ {
+ var parser = new BasicParser('', [] : string[]);
+ this.expect(parser.getopt()).toBe(null);
+ }
+
+ function test_silent () : void
+ {
+ var parser = new BasicParser(':', [] : string[]);
+ this.expect(parser.getopt()).toBe(null);
+ }
+
+ function test_args_without_param_01 () : void
+ {
+ var parser = new BasicParser(':l', [] : string[]);
+ this.expect(parser.getopt()).toBe(null);
+ }
+
+ function test_args_without_param_02 () : void
+ {
+ var parser = new BasicParser(':l:', [] : string[]);
+ this.expect(parser.getopt()).toBe(null);
+ }
+
+ function test_args_without_param_03 () : void
+ {
+ var parser = new BasicParser(':las', [] : string[]);
+ this.expect(parser.getopt()).toBe(null);
+ }
+
+ function test_args_without_param_04 () : void
+ {
+ var parser = new BasicParser(':l:a:s:', [] : string[]);
+ this.expect(parser.getopt()).toBe(null);
+ }
+
+ function test_long_args_without_param () : void
+ {
+ var parser = new BasicParser(':l:(long)', [] : string[]);
+ this.expect(parser.getopt()).toBe(null);
+ }
+
+ function test_args () : void
+ {
+ var parser = new BasicParser(':l:(long)', ['-l', 'arg1', '--long=q', 'b', '--long', 'foo']);
+ var opt = parser.getopt();
+ this.expect(opt.option).toBe('l');
+ this.expect(opt.optarg).toBe('arg1');
+ opt = parser.getopt();
+ this.expect(opt.option).toBe('l');
+ this.expect(opt.optarg).toBe('q');
+ opt = parser.getopt();
+ this.expect(opt.option).toBe('b');
+ opt = parser.getopt();
+ this.expect(opt.option).toBe('--long');
+ opt = parser.getopt();
+ this.expect(opt.option).toBe('foo');
+ }
+
+ function test_aliased_long_args_without_param_01 () : void
+ {
+ var parser = new BasicParser(':l:(long)(longer)', [] : string[]);
+ this.expect(parser.getopt()).toBe(null);
+ }
+
+ function test_aliased_long_args_without_param_02 () : void
+ {
+ var parser = new BasicParser(':la:r(recurse)(recur)f:(file)(filename)q', [] : string[]);
+ this.expect(parser.getopt()).toBe(null);
+ }
+
+ function test_extra_options () : void
+ {
+ var parser = new BasicParser('la:r(recurse)(recur)f:(file)(filename)q', ['extra1', 'extra2']);
+ this.expect(parser.getopt().option).toBe('extra1');
+ this.expect(parser.getopt().option).toBe('extra2');
+ this.expect(parser.getopt()).toBe(null);
+ }
+}
diff --git a/web/server/h2o/libh2o/misc/oktavia/test/test-oktavia-block.jsx b/web/server/h2o/libh2o/misc/oktavia/test/test-oktavia-block.jsx
new file mode 100644
index 00000000..f5f562c7
--- /dev/null
+++ b/web/server/h2o/libh2o/misc/oktavia/test/test-oktavia-block.jsx
@@ -0,0 +1,226 @@
+/**
+ * This is a JSX version of shellinford library:
+ * https://code.google.com/p/shellinford/
+ *
+ * License: http://shibu.mit-license.org/
+ */
+
+import "test-case.jsx";
+import "oktavia.jsx";
+import "metadata.jsx";
+
+class _Test extends TestCase
+{
+ var oktavia : Oktavia;
+ var block : Block;
+
+ override function setUp () : void
+ {
+ this.oktavia = new Oktavia();
+ this.block = this.oktavia.addBlock('document');
+ this.oktavia.addWord("abracadabra");
+ this.block.startBlock("river");
+ this.oktavia.addWord("mississippi");
+ this.block.endBlock();
+ this.oktavia.addWord("abracadabra mississippi");
+ this.oktavia.build();
+ }
+
+ function test_doc_sizes () : void
+ {
+ this.expect(this.block.size()).toBe(1);
+ }
+
+ function test_in_block () : void
+ {
+ this.expect(this.block.inBlock(0)).toBe(false);
+ this.expect(this.block.inBlock(10)).toBe(false);
+ this.expect(this.block.inBlock(11)).toBe(true);
+ this.expect(this.block.inBlock(21)).toBe(true);
+ this.expect(this.block.inBlock(22)).toBe(false);
+ this.expect(this.block.inBlock(44)).toBe(false);
+ }
+
+ function test_in_block_boundary () : void
+ {
+ try
+ {
+ this.block.inBlock(-1);
+ this.fail("fm.inBlock() 1");
+ }
+ catch (e : Error)
+ {
+ }
+ try
+ {
+ this.block.inBlock(45);
+ this.fail("fm.inBlock() 2");
+ }
+ catch (e : Error)
+ {
+ }
+ }
+
+ function test_get_block_content () : void
+ {
+ this.expect(this.block.getBlockContent(11)).toBe("mississippi");
+ }
+
+ function test_get_block_content_boundary () : void
+ {
+ try
+ {
+ this.block.getBlockContent(45);
+ this.fail("fm.getContent()");
+ }
+ catch (e : Error)
+ {
+ }
+ try
+ {
+ this.block.getBlockContent(-1);
+ this.fail("fm.getContent()");
+ }
+ catch (e : Error)
+ {
+ }
+ }
+
+ function test_get_block_name () : void
+ {
+ this.expect(this.block.getBlockName(11)).toBe("river");
+ }
+
+ function test_get_block_name_boundary () : void
+ {
+ try
+ {
+ this.block.getBlockName(45);
+ this.fail("fm.getName()");
+ }
+ catch (e : Error)
+ {
+ }
+ try
+ {
+ this.block.getBlockName(-1);
+ this.fail("fm.getName()");
+ }
+ catch (e : Error)
+ {
+ }
+ }
+
+ function test_dump_load_and_doc_sizes () : void
+ {
+ var dump = this.oktavia.dump();
+ this.oktavia.load(dump);
+ this.block = this.oktavia.getBlock('document');
+
+ this.expect(this.block.size()).toBe(1);
+ }
+
+ function test_load_dump_and_in_block () : void
+ {
+ var dump = this.oktavia.dump();
+ this.oktavia.load(dump);
+ this.block = this.oktavia.getBlock('document');
+
+ this.expect(this.block.inBlock(0)).toBe(false);
+ this.expect(this.block.inBlock(10)).toBe(false);
+ this.expect(this.block.inBlock(11)).toBe(true);
+ this.expect(this.block.inBlock(21)).toBe(true);
+ this.expect(this.block.inBlock(22)).toBe(false);
+ this.expect(this.block.inBlock(44)).toBe(false);
+ }
+
+ function test_load_dump_and_in_block_boundary () : void
+ {
+ var dump = this.oktavia.dump();
+ this.oktavia.load(dump);
+ this.block = this.oktavia.getBlock('document');
+
+ try
+ {
+ this.block.inBlock(-1);
+ this.fail("fm.inBlock() 1");
+ }
+ catch (e : Error)
+ {
+ }
+ try
+ {
+ this.block.inBlock(45);
+ this.fail("fm.inBlock() 2");
+ }
+ catch (e : Error)
+ {
+ }
+ }
+
+ function test_load_dump_and_get_block_content () : void
+ {
+ var dump = this.oktavia.dump();
+ this.oktavia.load(dump);
+ this.block = this.oktavia.getBlock('document');
+
+ this.expect(this.block.getBlockContent(11)).toBe("mississippi");
+ }
+
+ function test_load_dump_and_get_block_content_boundary () : void
+ {
+ var dump = this.oktavia.dump();
+ this.oktavia.load(dump);
+ this.block = this.oktavia.getBlock('document');
+
+ try
+ {
+ this.block.getBlockContent(45);
+ this.fail("fm.getContent()");
+ }
+ catch (e : Error)
+ {
+ }
+ try
+ {
+ this.block.getBlockContent(-1);
+ this.fail("fm.getContent()");
+ }
+ catch (e : Error)
+ {
+ }
+ }
+
+ function test_load_dump_and_get_block_name () : void
+ {
+ var dump = this.oktavia.dump();
+ this.oktavia.load(dump);
+ this.block = this.oktavia.getBlock('document');
+
+ this.expect(this.block.getBlockName(11)).toBe("river");
+ }
+
+ function test_load_dump_and_get_block_name_boundary () : void
+ {
+ var dump = this.oktavia.dump();
+ this.oktavia.load(dump);
+ this.block = this.oktavia.getBlock('document');
+
+ try
+ {
+ this.block.getBlockName(45);
+ this.fail("fm.getName()");
+ }
+ catch (e : Error)
+ {
+ }
+ try
+ {
+ this.block.getBlockName(-1);
+ this.fail("fm.getName()");
+ }
+ catch (e : Error)
+ {
+ }
+ }
+}
diff --git a/web/server/h2o/libh2o/misc/oktavia/test/test-oktavia-section.jsx b/web/server/h2o/libh2o/misc/oktavia/test/test-oktavia-section.jsx
new file mode 100644
index 00000000..0c37afea
--- /dev/null
+++ b/web/server/h2o/libh2o/misc/oktavia/test/test-oktavia-section.jsx
@@ -0,0 +1,235 @@
+/**
+ * This is a JSX version of shellinford library:
+ * https://code.google.com/p/shellinford/
+ *
+ * License: http://shibu.mit-license.org/
+ */
+
+import "test-case.jsx";
+import "oktavia.jsx";
+import "metadata.jsx";
+
+class _Test extends TestCase
+{
+ var oktavia : Oktavia;
+ var section : Section;
+
+ override function setUp () : void
+ {
+ this.oktavia = new Oktavia();
+ this.section = this.oktavia.addSection('document');
+ this.oktavia.addWord("abracadabra");
+ this.section.setTail("doc1");
+ this.oktavia.addWord("mississippi");
+ this.section.setTail("doc2");
+ this.oktavia.addWord("abracadabra mississippi");
+ this.section.setTail("doc3");
+ this.oktavia.build(25, false);
+ }
+
+ function test_doc_sizes () : void
+ {
+ this.expect(this.section.size()).toBe(3);
+ }
+
+ function test_get_section_index () : void
+ {
+ this.expect(this.section.getSectionIndex(0)).toBe(0);
+ this.expect(this.section.getSectionIndex(10)).toBe(0);
+ this.expect(this.section.getSectionIndex(11)).toBe(1);
+ this.expect(this.section.getSectionIndex(21)).toBe(1);
+ this.expect(this.section.getSectionIndex(22)).toBe(2);
+ this.expect(this.section.getSectionIndex(44)).toBe(2);
+ }
+
+ function test_get_section_index_boundary () : void
+ {
+ try
+ {
+ this.section.getSectionIndex(-1);
+ this.fail("fm.getSectionIndex()");
+ }
+ catch (e : Error)
+ {
+ }
+ try
+ {
+ this.section.getSectionIndex(45);
+ this.fail("fm.getSectionIndex()");
+ }
+ catch (e : Error)
+ {
+ }
+ }
+
+ function test_get_section_content () : void
+ {
+ this.expect(this.section.getContent(0)).toBe("abracadabra");
+ this.expect(this.section.getContent(1)).toBe("mississippi");
+ this.expect(this.section.getContent(2)).toBe("abracadabra mississippi");
+ }
+
+ function test_get_section_content_boundary () : void
+ {
+ try
+ {
+ this.section.getContent(3);
+ this.fail("fm.getContent()");
+ }
+ catch (e : Error)
+ {
+ }
+ try
+ {
+ this.section.getContent(-1);
+ this.fail("fm.getContent()");
+ }
+ catch (e : Error)
+ {
+ }
+ }
+
+ function test_get_section_name () : void
+ {
+ this.expect(this.section.getName(0)).toBe("doc1");
+ this.expect(this.section.getName(1)).toBe("doc2");
+ this.expect(this.section.getName(2)).toBe("doc3");
+ }
+
+ function test_get_section_name_boundary () : void
+ {
+ try
+ {
+ this.section.getName(3);
+ this.fail("fm.getName()");
+ }
+ catch (e : Error)
+ {
+ }
+ try
+ {
+ this.section.getName(-1);
+ this.fail("fm.getName()");
+ }
+ catch (e : Error)
+ {
+ }
+ }
+
+ function test_load_dump_and_doc_sizes () : void
+ {
+ var dump = this.oktavia.dump();
+ this.oktavia.load(dump);
+ this.section = this.oktavia.getSection('document');
+
+ this.expect(this.section.size()).toBe(3);
+ }
+
+ function test_load_dump_and_get_section_index () : void
+ {
+ var dump = this.oktavia.dump();
+ this.oktavia.load(dump);
+ this.section = this.oktavia.getSection('document');
+
+ this.expect(this.section.getSectionIndex(0)).toBe(0);
+ this.expect(this.section.getSectionIndex(10)).toBe(0);
+ this.expect(this.section.getSectionIndex(11)).toBe(1);
+ this.expect(this.section.getSectionIndex(21)).toBe(1);
+ this.expect(this.section.getSectionIndex(22)).toBe(2);
+ this.expect(this.section.getSectionIndex(44)).toBe(2);
+ }
+
+ function test_load_dump_and_get_section_index_boundary () : void
+ {
+ var dump = this.oktavia.dump();
+ this.oktavia.load(dump);
+ this.section = this.oktavia.getSection('document');
+
+ try
+ {
+ this.section.getSectionIndex(-1);
+ this.fail("fm.getSectionIndex()");
+ }
+ catch (e : Error)
+ {
+ }
+ try
+ {
+ this.section.getSectionIndex(45);
+ this.fail("fm.getSectionIndex()");
+ }
+ catch (e : Error)
+ {
+ }
+ }
+
+ function test_load_dump_and_get_section_content () : void
+ {
+ var dump = this.oktavia.dump();
+ this.oktavia.load(dump);
+ this.section = this.oktavia.getSection('document');
+
+ this.expect(this.section.getContent(0)).toBe("abracadabra");
+ this.expect(this.section.getContent(1)).toBe("mississippi");
+ this.expect(this.section.getContent(2)).toBe("abracadabra mississippi");
+ }
+
+ function test_load_dump_and_get_section_content_boundary () : void
+ {
+ var dump = this.oktavia.dump();
+ this.oktavia.load(dump);
+ this.section = this.oktavia.getSection('document');
+
+ try
+ {
+ this.section.getContent(3);
+ this.fail("fm.getContent()");
+ }
+ catch (e : Error)
+ {
+ }
+ try
+ {
+ this.section.getContent(-1);
+ this.fail("fm.getContent()");
+ }
+ catch (e : Error)
+ {
+ }
+ }
+
+ function test_load_dump_and_get_section_name () : void
+ {
+ var dump = this.oktavia.dump();
+ this.oktavia.load(dump);
+ this.section = this.oktavia.getSection('document');
+
+ this.expect(this.section.getName(0)).toBe("doc1");
+ this.expect(this.section.getName(1)).toBe("doc2");
+ this.expect(this.section.getName(2)).toBe("doc3");
+ }
+
+ function test_load_dump_and_get_section_name_boundary () : void
+ {
+ var dump = this.oktavia.dump();
+ this.oktavia.load(dump);
+ this.section = this.oktavia.getSection('document');
+
+ try
+ {
+ this.section.getName(3);
+ this.fail("fm.getName()");
+ }
+ catch (e : Error)
+ {
+ }
+ try
+ {
+ this.section.getName(-1);
+ this.fail("fm.getName()");
+ }
+ catch (e : Error)
+ {
+ }
+ }
+}
diff --git a/web/server/h2o/libh2o/misc/oktavia/test/test-oktavia-splitter.jsx b/web/server/h2o/libh2o/misc/oktavia/test/test-oktavia-splitter.jsx
new file mode 100644
index 00000000..859eb911
--- /dev/null
+++ b/web/server/h2o/libh2o/misc/oktavia/test/test-oktavia-splitter.jsx
@@ -0,0 +1,173 @@
+/**
+ * This is a JSX version of shellinford library:
+ * https://code.google.com/p/shellinford/
+ *
+ * License: http://shibu.mit-license.org/
+ */
+
+import "test-case.jsx";
+import "oktavia.jsx";
+import "metadata.jsx";
+
+class _Test extends TestCase
+{
+ var oktavia : Oktavia;
+ var splitter : Splitter;
+
+ override function setUp () : void
+ {
+ this.oktavia = new Oktavia();
+ this.splitter = this.oktavia.addSplitter('document');
+ this.oktavia.addWord("abracadabra");
+ this.splitter.split();
+ this.oktavia.addWord("mississippi");
+ this.splitter.split();
+ this.oktavia.addWord("abracadabra mississippi");
+ this.splitter.split();
+ this.oktavia.build(25, false);
+ }
+
+ function test_count () : void
+ {
+ this.expect(this.splitter.size()).toBe(3);
+ }
+
+ function test_get_splitter_index () : void
+ {
+ this.expect(this.splitter.getIndex(0)).toBe(0);
+ this.expect(this.splitter.getIndex(10)).toBe(0);
+ this.expect(this.splitter.getIndex(11)).toBe(1);
+ this.expect(this.splitter.getIndex(21)).toBe(1);
+ this.expect(this.splitter.getIndex(22)).toBe(2);
+ this.expect(this.splitter.getIndex(44)).toBe(2);
+ }
+
+ function test_get_splitter_index_boundary () : void
+ {
+ try
+ {
+ this.splitter.getIndex(-1);
+ this.fail("fm.getIndex()");
+ }
+ catch (e : Error)
+ {
+ }
+ try
+ {
+ this.splitter.getIndex(45);
+ this.fail("fm.getIndex()");
+ }
+ catch (e : Error)
+ {
+ }
+ }
+
+ function test_get_splitter_content () : void
+ {
+ this.expect(this.splitter.getContent(2)).toBe("abracadabra mississippi");
+ this.expect(this.splitter.getContent(1)).toBe("mississippi");
+ this.expect(this.splitter.getContent(0)).toBe("abracadabra");
+ }
+
+ function test_get_splitter_content_boundary () : void
+ {
+ try
+ {
+ this.splitter.getContent(3);
+ this.fail("fm.getContent()");
+ }
+ catch (e : Error)
+ {
+ }
+ try
+ {
+ this.splitter.getContent(-1);
+ this.fail("fm.getContent()");
+ }
+ catch (e : Error)
+ {
+ }
+ }
+
+ function test_load_dump_and_count () : void
+ {
+ var dump = this.oktavia.dump();
+ this.oktavia.load(dump);
+ this.splitter = this.oktavia.getSplitter('document');
+
+ this.expect(this.splitter.size()).toBe(3);
+ }
+
+ function test_load_dump_and_get_splitter_index () : void
+ {
+ var dump = this.oktavia.dump();
+ this.oktavia.load(dump);
+ this.splitter = this.oktavia.getSplitter('document');
+
+ this.expect(this.splitter.getIndex(0)).toBe(0);
+ this.expect(this.splitter.getIndex(10)).toBe(0);
+ this.expect(this.splitter.getIndex(11)).toBe(1);
+ this.expect(this.splitter.getIndex(21)).toBe(1);
+ this.expect(this.splitter.getIndex(22)).toBe(2);
+ this.expect(this.splitter.getIndex(44)).toBe(2);
+ }
+
+ function test_load_dump_and_get_splitter_index_boundary () : void
+ {
+ var dump = this.oktavia.dump();
+ this.oktavia.load(dump);
+ this.splitter = this.oktavia.getSplitter('document');
+
+ try
+ {
+ this.splitter.getIndex(-1);
+ this.fail("fm.getIndex()");
+ }
+ catch (e : Error)
+ {
+ }
+ try
+ {
+ this.splitter.getIndex(45);
+ this.fail("fm.getIndex()");
+ }
+ catch (e : Error)
+ {
+ }
+ }
+
+ function test_load_dump_and_get_splitter_content () : void
+ {
+ var dump = this.oktavia.dump();
+ this.oktavia.load(dump);
+ this.splitter = this.oktavia.getSplitter('document');
+
+ this.expect(this.splitter.getContent(2)).toBe("abracadabra mississippi");
+ this.expect(this.splitter.getContent(1)).toBe("mississippi");
+ this.expect(this.splitter.getContent(0)).toBe("abracadabra");
+ }
+
+ function test_load_dump_and_get_splitter_content_boundary () : void
+ {
+ var dump = this.oktavia.dump();
+ this.oktavia.load(dump);
+ this.splitter = this.oktavia.getSplitter('document');
+
+ try
+ {
+ this.splitter.getContent(3);
+ this.fail("fm.getContent()");
+ }
+ catch (e : Error)
+ {
+ }
+ try
+ {
+ this.splitter.getContent(-1);
+ this.fail("fm.getContent()");
+ }
+ catch (e : Error)
+ {
+ }
+ }
+}
diff --git a/web/server/h2o/libh2o/misc/oktavia/test/test-oktavia-stemming.jsx b/web/server/h2o/libh2o/misc/oktavia/test/test-oktavia-stemming.jsx
new file mode 100644
index 00000000..d8d1d74e
--- /dev/null
+++ b/web/server/h2o/libh2o/misc/oktavia/test/test-oktavia-stemming.jsx
@@ -0,0 +1,55 @@
+import "test-case.jsx";
+import "oktavia.jsx";
+import "metadata.jsx";
+import "stemmer/english-stemmer.jsx";
+import "console.jsx";
+
+class _Test extends TestCase
+{
+ var oktavia : Oktavia;
+ var section : Section;
+
+ override function setUp () : void
+ {
+ this.oktavia = new Oktavia();
+ this.oktavia.setStemmer(new EnglishStemmer());
+ this.section = this.oktavia.addSection('document');
+ this.oktavia.addWord("stemming baby", true);
+ this.section.setTail("doc1");
+ this.oktavia.addWord("stemmed babies", true);
+ this.section.setTail("doc2");
+ this.oktavia.build();
+ }
+
+ function test_search_without_stemming () : void
+ {
+ var results = this.oktavia.rawSearch('baby', false);
+ this.expect(results.length).toBe(1);
+ }
+
+ function test_search_with_stemming () : void
+ {
+ var results = this.oktavia.rawSearch('baby', true);
+ this.expect(results.length).toBe(1);
+ }
+
+ function test_load_dump_and_search_without_stemming () : void
+ {
+ var dump = this.oktavia.dump();
+ var oktavia = new Oktavia();
+ oktavia.setStemmer(new EnglishStemmer());
+ oktavia.load(dump);
+ var results = oktavia.rawSearch('baby', false);
+ this.expect(results.length).toBe(1);
+ }
+
+ function test_load_dump_and_search_with_stemming () : void
+ {
+ var dump = this.oktavia.dump();
+ var oktavia = new Oktavia();
+ oktavia.setStemmer(new EnglishStemmer());
+ oktavia.load(dump);
+ var results = oktavia.rawSearch('baby', true);
+ this.expect(results.length).toBe(1);
+ }
+}
diff --git a/web/server/h2o/libh2o/misc/oktavia/test/test-oktavia-table.jsx b/web/server/h2o/libh2o/misc/oktavia/test/test-oktavia-table.jsx
new file mode 100644
index 00000000..ee2aa097
--- /dev/null
+++ b/web/server/h2o/libh2o/misc/oktavia/test/test-oktavia-table.jsx
@@ -0,0 +1,213 @@
+import "test-case.jsx";
+import "oktavia.jsx";
+import "metadata.jsx";
+
+class _Test extends TestCase
+{
+ var oktavia : Oktavia;
+ var table : Table;
+
+ override function setUp () : void
+ {
+ this.oktavia = new Oktavia();
+ this.table = this.oktavia.addTable('address book', ['zip', 'city', 'area code']);
+
+ this.oktavia.addWord("94101"); // 5
+ this.table.setColumnTail();
+ this.oktavia.addWord("San Francisco"); // 13
+ this.table.setColumnTail();
+ this.oktavia.addWord("415"); // 3
+ this.table.setColumnTail();
+ this.table.setRowTail();
+
+ this.oktavia.addWord("94607"); // 5
+ this.table.setColumnTail();
+ this.oktavia.addWord("Oakland"); // 7
+ this.table.setColumnTail();
+ this.oktavia.addWord("510"); // 3
+ this.table.setColumnTail();
+ this.table.setRowTail();
+
+ this.oktavia.addWord("94401"); // 5
+ this.table.setColumnTail();
+ this.oktavia.addWord("San Mateo"); // 9
+ this.table.setColumnTail();
+ this.oktavia.addWord("650"); // 3
+ this.table.setColumnTail();
+ this.table.setRowTail();
+
+ this.oktavia.build();
+ }
+
+ function test_row_sizes () : void
+ {
+ this.expect(this.table.rowSize()).toBe(3);
+ }
+
+ function test_column_sizes () : void
+ {
+ this.expect(this.table.columnSize()).toBe(3);
+ }
+
+ function test_get_cell () : void
+ {
+ this.expect(this.table.getCell(0)[0]).toBe(0);
+ this.expect(this.table.getCell(0)[1]).toBe(0);
+ this.expect(this.table.getCell(22)[0]).toBe(0);
+ this.expect(this.table.getCell(22)[1]).toBe(2);
+ this.expect(this.table.getCell(24)[0]).toBe(1);
+ this.expect(this.table.getCell(24)[1]).toBe(0);
+ this.expect(this.table.getCell(40)[0]).toBe(1);
+ this.expect(this.table.getCell(40)[1]).toBe(2);
+ this.expect(this.table.getCell(42)[0]).toBe(2);
+ this.expect(this.table.getCell(42)[1]).toBe(0);
+ this.expect(this.table.getCell(60)[0]).toBe(2);
+ this.expect(this.table.getCell(60)[1]).toBe(2);
+ }
+
+ function test_get_table_index_boundary () : void
+ {
+ try
+ {
+ this.table.getCell(-1);
+ this.fail("fm.gettableIndex()");
+ }
+ catch (e : Error)
+ {
+ }
+ try
+ {
+ this.table.getCell(62);
+ this.fail("fm.gettableIndex()");
+ }
+ catch (e : Error)
+ {
+ }
+ }
+
+ function test_get_table_content () : void
+ {
+ var row = this.table.getRowContent(0);
+ this.expect(row['zip']).toBe('94101');
+ this.expect(row['city']).toBe('San Francisco');
+ this.expect(row['area code']).toBe('415');
+ }
+
+ function test_get_table_content_boundary () : void
+ {
+ try
+ {
+ this.table.getContent(3);
+ this.fail("fm.getContent()");
+ }
+ catch (e : Error)
+ {
+ }
+ try
+ {
+ this.table.getContent(-1);
+ this.fail("fm.getContent()");
+ }
+ catch (e : Error)
+ {
+ }
+ }
+
+ function test_load_dump_and_row_sizes () : void
+ {
+ var dump = this.oktavia.dump();
+ this.oktavia.load(dump);
+ this.table = this.oktavia.getTable('address book');
+
+ this.expect(this.table.rowSize()).toBe(3);
+ }
+
+ function test_load_dump_and_column_sizes () : void
+ {
+ var dump = this.oktavia.dump();
+ this.oktavia.load(dump);
+ this.table = this.oktavia.getTable('address book');
+
+ this.expect(this.table.columnSize()).toBe(3);
+ }
+
+ function test_load_dump_and_get_cell () : void
+ {
+ var dump = this.oktavia.dump();
+ this.oktavia.load(dump);
+ this.table = this.oktavia.getTable('address book');
+
+ this.expect(this.table.getCell(0)[0]).toBe(0);
+ this.expect(this.table.getCell(0)[1]).toBe(0);
+ this.expect(this.table.getCell(22)[0]).toBe(0);
+ this.expect(this.table.getCell(22)[1]).toBe(2);
+ this.expect(this.table.getCell(24)[0]).toBe(1);
+ this.expect(this.table.getCell(24)[1]).toBe(0);
+ this.expect(this.table.getCell(40)[0]).toBe(1);
+ this.expect(this.table.getCell(40)[1]).toBe(2);
+ this.expect(this.table.getCell(42)[0]).toBe(2);
+ this.expect(this.table.getCell(42)[1]).toBe(0);
+ this.expect(this.table.getCell(60)[0]).toBe(2);
+ this.expect(this.table.getCell(60)[1]).toBe(2);
+ }
+
+ function test_load_dump_and_get_table_index_boundary () : void
+ {
+ var dump = this.oktavia.dump();
+ this.oktavia.load(dump);
+ this.table = this.oktavia.getTable('address book');
+
+ try
+ {
+ this.table.getCell(-1);
+ this.fail("fm.gettableIndex()");
+ }
+ catch (e : Error)
+ {
+ }
+ try
+ {
+ this.table.getCell(62);
+ this.fail("fm.gettableIndex()");
+ }
+ catch (e : Error)
+ {
+ }
+ }
+
+ function test_load_dump_and_get_table_content () : void
+ {
+ var dump = this.oktavia.dump();
+ this.oktavia.load(dump);
+ this.table = this.oktavia.getTable('address book');
+
+ var row = this.table.getRowContent(0);
+ this.expect(row['zip']).toBe('94101');
+ this.expect(row['city']).toBe('San Francisco');
+ this.expect(row['area code']).toBe('415');
+ }
+
+ function test_load_dump_and_get_table_content_boundary () : void
+ {
+ var dump = this.oktavia.dump();
+ this.oktavia.load(dump);
+ this.table = this.oktavia.getTable('address book');
+
+ try
+ {
+ this.table.getContent(3);
+ this.fail("fm.getContent()");
+ }
+ catch (e : Error)
+ {
+ }
+ try
+ {
+ this.table.getContent(-1);
+ this.fail("fm.getContent()");
+ }
+ catch (e : Error)
+ {
+ }
+ }
+}
diff --git a/web/server/h2o/libh2o/misc/oktavia/test/test-query-parser.jsx b/web/server/h2o/libh2o/misc/oktavia/test/test-query-parser.jsx
new file mode 100644
index 00000000..c04ac46e
--- /dev/null
+++ b/web/server/h2o/libh2o/misc/oktavia/test/test-query-parser.jsx
@@ -0,0 +1,92 @@
+import "test-case.jsx";
+import "query-parser.jsx";
+
+class _Test extends TestCase
+{
+ var parser : QueryParser;
+
+ override function setUp () : void
+ {
+ this.parser = new QueryParser();
+ }
+
+ function test_and () : void
+ {
+ this.parser.parse(['word1', 'word2']);
+ this.expect(this.parser.queries.length).toBe(2);
+
+ this.expect(this.parser.queries[0].word).toBe('word1');
+ this.expect(this.parser.queries[0].or).toBe(false);
+ this.expect(this.parser.queries[0].not).toBe(false);
+ this.expect(this.parser.queries[0].raw).toBe(false);
+
+ this.expect(this.parser.queries[1].word).toBe('word2');
+ this.expect(this.parser.queries[1].or).toBe(false);
+ this.expect(this.parser.queries[1].not).toBe(false);
+ this.expect(this.parser.queries[1].raw).toBe(false);
+ }
+
+ function test_or () : void
+ {
+ this.parser.parse(['word1', 'OR', 'word2']);
+ this.expect(this.parser.queries.length).toBe(2);
+
+ this.expect(this.parser.queries[0].word).toBe('word1');
+ this.expect(this.parser.queries[0].or).toBe(false);
+ this.expect(this.parser.queries[0].not).toBe(false);
+ this.expect(this.parser.queries[0].raw).toBe(false);
+
+ this.expect(this.parser.queries[1].word).toBe('word2');
+ this.expect(this.parser.queries[1].or).toBe(true);
+ this.expect(this.parser.queries[1].not).toBe(false);
+ this.expect(this.parser.queries[1].raw).toBe(false);
+ }
+
+ function test_not () : void
+ {
+ this.parser.parse(['word1', '-word2']);
+ this.expect(this.parser.queries.length).toBe(2);
+
+ this.expect(this.parser.queries[0].word).toBe('word1');
+ this.expect(this.parser.queries[0].or).toBe(false);
+ this.expect(this.parser.queries[0].not).toBe(false);
+ this.expect(this.parser.queries[0].raw).toBe(false);
+
+ this.expect(this.parser.queries[1].word).toBe('word2');
+ this.expect(this.parser.queries[1].or).toBe(false);
+ this.expect(this.parser.queries[1].not).toBe(true);
+ this.expect(this.parser.queries[1].raw).toBe(false);
+ }
+
+ function test_raw () : void
+ {
+ this.parser.parse(['word1', '"word2"']);
+ this.expect(this.parser.queries.length).toBe(2);
+
+ this.expect(this.parser.queries[0].word).toBe('word1');
+ this.expect(this.parser.queries[0].or).toBe(false);
+ this.expect(this.parser.queries[0].not).toBe(false);
+ this.expect(this.parser.queries[0].raw).toBe(false);
+
+ this.expect(this.parser.queries[1].word).toBe('word2');
+ this.expect(this.parser.queries[1].or).toBe(false);
+ this.expect(this.parser.queries[1].not).toBe(false);
+ this.expect(this.parser.queries[1].raw).toBe(true);
+ }
+
+ function test_raw_not () : void
+ {
+ this.parser.parse(['word1', '-"word2"']);
+ this.expect(this.parser.queries.length).toBe(2);
+
+ this.expect(this.parser.queries[0].word).toBe('word1');
+ this.expect(this.parser.queries[0].or).toBe(false);
+ this.expect(this.parser.queries[0].not).toBe(false);
+ this.expect(this.parser.queries[0].raw).toBe(false);
+
+ this.expect(this.parser.queries[1].word).toBe('word2');
+ this.expect(this.parser.queries[1].or).toBe(false);
+ this.expect(this.parser.queries[1].not).toBe(true);
+ this.expect(this.parser.queries[1].raw).toBe(true);
+ }
+}
diff --git a/web/server/h2o/libh2o/misc/oktavia/test/test-query-string-parser.jsx b/web/server/h2o/libh2o/misc/oktavia/test/test-query-string-parser.jsx
new file mode 100644
index 00000000..94ec7c19
--- /dev/null
+++ b/web/server/h2o/libh2o/misc/oktavia/test/test-query-string-parser.jsx
@@ -0,0 +1,94 @@
+import "test-case.jsx";
+import "query-string-parser.jsx";
+
+class _Test extends TestCase
+{
+ var parser : QueryStringParser;
+
+ override function setUp () : void
+ {
+ this.parser = new QueryStringParser();
+ }
+
+ function test_single_string_and () : void
+ {
+ this.parser.parse('word1 word2');
+ this.expect(this.parser.queries.length).toBe(2);
+
+ this.expect(this.parser.queries[0].word).toBe('word1');
+ this.expect(this.parser.queries[0].or).toBe(false);
+ this.expect(this.parser.queries[0].not).toBe(false);
+ this.expect(this.parser.queries[0].raw).toBe(false);
+
+ this.expect(this.parser.queries[1].word).toBe('word2');
+ this.expect(this.parser.queries[1].or).toBe(false);
+ this.expect(this.parser.queries[1].not).toBe(false);
+ this.expect(this.parser.queries[1].raw).toBe(false);
+ }
+
+ function test_single_string_or () : void
+ {
+ this.parser.parse('word1 OR word2');
+ this.expect(this.parser.queries.length).toBe(2);
+
+ this.expect(this.parser.queries[0].word).toBe('word1');
+ this.expect(this.parser.queries[0].or).toBe(false);
+ this.expect(this.parser.queries[0].not).toBe(false);
+ this.expect(this.parser.queries[0].raw).toBe(false);
+
+ this.expect(this.parser.queries[1].word).toBe('word2');
+ this.expect(this.parser.queries[1].or).toBe(true);
+ this.expect(this.parser.queries[1].not).toBe(false);
+ this.expect(this.parser.queries[1].raw).toBe(false);
+ }
+
+ function test_single_string_not () : void
+ {
+ this.parser.parse('word1 -word2');
+ this.expect(this.parser.queries.length).toBe(2);
+
+ this.expect(this.parser.queries[0].word).toBe('word1');
+ this.expect(this.parser.queries[0].or).toBe(false);
+ this.expect(this.parser.queries[0].not).toBe(false);
+ this.expect(this.parser.queries[0].raw).toBe(false);
+
+ this.expect(this.parser.queries[1].word).toBe('word2');
+ this.expect(this.parser.queries[1].or).toBe(false);
+ this.expect(this.parser.queries[1].not).toBe(true);
+ this.expect(this.parser.queries[1].raw).toBe(false);
+ }
+
+ function test_single_string_raw () : void
+ {
+ this.parser.parse('word1 "word2"');
+ this.expect(this.parser.queries.length).toBe(2);
+
+ this.expect(this.parser.queries[0].word).toBe('word1');
+ this.expect(this.parser.queries[0].or).toBe(false);
+ this.expect(this.parser.queries[0].not).toBe(false);
+ this.expect(this.parser.queries[0].raw).toBe(false);
+
+ this.expect(this.parser.queries[1].word).toBe('word2');
+ this.expect(this.parser.queries[1].or).toBe(false);
+ this.expect(this.parser.queries[1].not).toBe(false);
+ this.expect(this.parser.queries[1].raw).toBe(true);
+ }
+
+ function test_single_string_raw_not () : void
+ {
+ this.parser.parse('word1 -"word2"');
+ this.expect(this.parser.queries.length).toBe(2);
+
+ this.expect(this.parser.queries[0].word).toBe('word1');
+ this.expect(this.parser.queries[0].or).toBe(false);
+ this.expect(this.parser.queries[0].not).toBe(false);
+ this.expect(this.parser.queries[0].raw).toBe(false);
+
+ this.expect(this.parser.queries[1].word).toBe('word2');
+ this.expect(this.parser.queries[1].or).toBe(false);
+ this.expect(this.parser.queries[1].not).toBe(true);
+ this.expect(this.parser.queries[1].raw).toBe(true);
+ }
+
+}
+
diff --git a/web/server/h2o/libh2o/misc/oktavia/test/test-sax.jsx b/web/server/h2o/libh2o/misc/oktavia/test/test-sax.jsx
new file mode 100644
index 00000000..8310bf0a
--- /dev/null
+++ b/web/server/h2o/libh2o/misc/oktavia/test/test-sax.jsx
@@ -0,0 +1,147 @@
+import "sax.jsx";
+import "test-case.jsx";
+
+
+class TestHandler extends SAXHandler
+{
+ var events : string[];
+ var param1 : string[];
+ var param2 : string[];
+
+ function constructor (events : string[], param1 : string[], param2 : string[])
+ {
+ this.events = events;
+ this.param1 = param1;
+ this.param2 = param2;
+ }
+ override function ontext (text : string) : void
+ {
+ this.events.push("ontext");
+ this.param1.push(text);
+ this.param2.push(null);
+ }
+ override function ondoctype (doctype : string) : void
+ {
+ this.events.push("ondoctype");
+ this.param1.push(doctype);
+ this.param2.push(null);
+ }
+ override function onopentag (tagname : string, attributes : Map.<string>) : void
+ {
+ this.events.push("onopentag");
+ this.param1.push(tagname);
+ this.param2.push(null);
+ }
+ override function onclosetag (tagname : string) : void
+ {
+ this.events.push("onclosetag");
+ this.param1.push(tagname);
+ this.param2.push(null);
+ }
+ override function onattribute (name : string, value : string) : void
+ {
+ this.events.push("onattribute");
+ this.param1.push(name);
+ this.param2.push(value);
+ }
+ override function oncomment (comment : string) : void
+ {
+ this.events.push("oncomment");
+ this.param1.push(comment);
+ this.param2.push(null);
+ }
+ override function onend () : void
+ {
+ this.events.push("onend");
+ this.param1.push(null);
+ this.param2.push(null);
+ }
+ override function onready () : void
+ {
+ this.events.push("onready");
+ this.param1.push(null);
+ this.param2.push(null);
+ }
+ override function onscript (script : string) : void
+ {
+ this.events.push("onscript");
+ this.param1.push(script);
+ this.param2.push(null);
+ }
+}
+
+class _Test extends TestCase
+{
+ var handler : TestHandler;
+ var parser : SAXParser;
+
+ var events : string[];
+ var param1 : string[];
+ var param2 : string[];
+
+ override function setUp () : void
+ {
+ this.events = [] : string[];
+ this.param1 = [] : string[];
+ this.param2 = [] : string[];
+ this.handler = new TestHandler(this.events, this.param1, this.param2);
+ this.parser = new SAXParser(this.handler);
+ }
+
+ function test_empty_input () : void
+ {
+ this.parser.parse('');
+ this.expect(this.events[0]).toBe('onready');
+ this.expect(this.events[1]).toBe('onend');
+ }
+
+ function test_doctype () : void
+ {
+ this.parser.parse('<!DOCTYPE html>');
+ this.expect(this.events[1]).toBe('ondoctype');
+ this.expect(this.param1[1]).toBe('html');
+ }
+
+ function test_tag1 () : void
+ {
+ this.parser.parse('<html></html>');
+ this.expect(this.events[1]).toBe('onopentag');
+ this.expect(this.param1[1]).toBe('html');
+ this.expect(this.events[2]).toBe('onclosetag');
+ this.expect(this.param1[2]).toBe('html');
+ }
+
+ function test_tag2 () : void
+ {
+ this.parser.parse('<html/>');
+ this.expect(this.events[1]).toBe('onopentag');
+ this.expect(this.param1[1]).toBe('html');
+ this.expect(this.events[2]).toBe('onclosetag');
+ this.expect(this.param1[2]).toBe('html');
+ }
+
+ function test_attribute () : void
+ {
+ this.parser.parse('<html lang="ja"></html>');
+ this.expect(this.events[1]).toBe('onattribute');
+ this.expect(this.param1[1]).toBe('lang');
+ this.expect(this.param2[1]).toBe('ja');
+ this.expect(this.events[2]).toBe('onopentag');
+ this.expect(this.param1[2]).toBe('html');
+ }
+
+ function test_text () : void
+ {
+ this.parser.parse('<html><body>hello world</body></html>');
+ this.expect(this.events[3]).toBe('ontext');
+ this.expect(this.param1[3]).toBe('hello world');
+ }
+
+ function test_comment () : void
+ {
+ this.parser.parse('<html><body><!-- comment --></body></html>');
+ this.expect(this.events[3]).toBe('oncomment');
+ this.expect(this.param1[3]).toBe('comment');
+ }
+}
+
diff --git a/web/server/h2o/libh2o/misc/oktavia/test/test-search-result.jsx b/web/server/h2o/libh2o/misc/oktavia/test/test-search-result.jsx
new file mode 100644
index 00000000..81bcc05d
--- /dev/null
+++ b/web/server/h2o/libh2o/misc/oktavia/test/test-search-result.jsx
@@ -0,0 +1,159 @@
+import "test-case.jsx";
+import "search-result.jsx";
+
+
+class _Test extends TestCase
+{
+ function test_simple_registration () : void
+ {
+ var result = new SingleResult();
+ var section = result.getSearchUnit(0);
+ section.addPosition('hello', 0, false);
+ section.addPosition('world', 7, false);
+ this.expect(section.size()).toBe(2);
+ }
+
+ function test_duplicate_longer_word_is_kept () : void
+ {
+ var result = new SingleResult();
+ var section = result.getSearchUnit(0);
+ section.addPosition('hello', 0, false);
+ section.addPosition('hello world', 0, false);
+ var position = section.get(0);
+
+ this.expect(section.size()).toBe(1);
+ this.expect(position.word).toBe('hello world');
+ }
+
+ function test_duplicate_no_stemmed_word_is_kept () : void
+ {
+ var result = new SingleResult();
+ var section = result.getSearchUnit(0);
+ section.addPosition('hello', 0, true);
+ section.addPosition('hello', 0, false);
+ var position = section.get(0);
+
+ this.expect(section.size()).toBe(1);
+ this.expect(position.stemmed).toBe(false);
+ }
+
+ function test_and_merge () : void
+ {
+ var result1 = new SingleResult();
+ result1.getSearchUnit(0);
+ result1.getSearchUnit(1);
+
+ var result2 = new SingleResult();
+ result2.getSearchUnit(0);
+
+ var result3 = result1.merge(result2);
+
+ this.expect(result3.size()).toBe(1);
+ }
+
+ function test_and_merge_2 () : void
+ {
+ var result1 = new SingleResult();
+ result1.getSearchUnit(0);
+ result1.getSearchUnit(1);
+
+ var result2 = new SingleResult();
+ result2.getSearchUnit(2);
+
+ var result3 = result1.merge(result2);
+
+ this.expect(result3.size()).toBe(0);
+ }
+
+ function test_or_merge () : void
+ {
+ var result1 = new SingleResult();
+ result1.getSearchUnit(0);
+ result1.getSearchUnit(1);
+
+ var result2 = new SingleResult();
+ result2.getSearchUnit(0);
+ result2.getSearchUnit(2);
+ result2.or = true;
+
+ var result3 = result1.merge(result2);
+
+ this.expect(result3.size()).toBe(3);
+ }
+
+ function test_not_merge () : void
+ {
+ var result1 = new SingleResult();
+ result1.getSearchUnit(0);
+ result1.getSearchUnit(1);
+ result1.getSearchUnit(2);
+
+ var result2 = new SingleResult();
+ result2.getSearchUnit(0);
+ result2.getSearchUnit(2);
+ result2.not = true;
+
+ var result3 = result1.merge(result2);
+
+ this.expect(result3.size()).toBe(1);
+ }
+
+ function test_merge () : void
+ {
+ var summary = new SearchSummary();
+ var singleresult1 = new SingleResult();
+ singleresult1.getSearchUnit(0);
+ singleresult1.getSearchUnit(1);
+
+ var singleresult2 = new SingleResult();
+ singleresult2.getSearchUnit(1);
+
+ summary.add(singleresult1);
+ summary.add(singleresult2);
+ summary.mergeResult();
+
+ this.expect(summary.size()).toBe(1);
+ }
+
+ function test_proposal () : void
+ {
+ var summary = new SearchSummary();
+ var singleresult1 = new SingleResult();
+ singleresult1.getSearchUnit(0);
+ singleresult1.getSearchUnit(1);
+
+ var singleresult2 = new SingleResult();
+ singleresult2.getSearchUnit(2);
+
+ summary.add(singleresult1);
+ summary.add(singleresult2);
+
+ var proposal = summary.getProposal();
+
+ this.expect(proposal[0].omit).toBe(1);
+ this.expect(proposal[0].expect).toBe(2);
+ this.expect(proposal[1].omit).toBe(0);
+ this.expect(proposal[1].expect).toBe(1);
+ }
+
+ function test_sort () : void
+ {
+ var summary = new SearchSummary();
+ var singleresult = new SingleResult();
+ var section1 = singleresult.getSearchUnit(0);
+ var section2 = singleresult.getSearchUnit(1);
+ var section3 = singleresult.getSearchUnit(2);
+
+ summary.add(singleresult);
+ summary.mergeResult();
+ summary.result.getSearchUnit(0).score = 100;
+ summary.result.getSearchUnit(1).score = 300;
+ summary.result.getSearchUnit(2).score = 200;
+
+ var result = summary.getSortedResult();
+ this.expect(result.length).toBe(3);
+ this.expect(result[0].id).toBe(1);
+ this.expect(result[1].id).toBe(2);
+ this.expect(result[2].id).toBe(0);
+ }
+}
diff --git a/web/server/h2o/libh2o/misc/oktavia/test/test-wavelet-matrix.jsx b/web/server/h2o/libh2o/misc/oktavia/test/test-wavelet-matrix.jsx
new file mode 100644
index 00000000..049d18d8
--- /dev/null
+++ b/web/server/h2o/libh2o/misc/oktavia/test/test-wavelet-matrix.jsx
@@ -0,0 +1,143 @@
+/**
+ * This is a JSX version of shellinford library:
+ * https://code.google.com/p/shellinford/
+ *
+ * License: http://shibu.mit-license.org/
+ */
+
+import "test-case.jsx";
+import "wavelet-matrix.jsx";
+
+class _Test extends TestCase
+{
+ var test_src : string;
+ var wm : WaveletMatrix;
+ var rd : int[][];
+ var sd : int[][];
+ var td : int[][];
+
+ override function setUp () : void
+ {
+ this.test_src = "abracadabra mississippi";
+ this.wm = new WaveletMatrix();
+ this.wm.build(this.test_src);
+ this.rd = [] : int[][];
+ this.sd = [] : int[][];
+ this.td = [] : int[][];
+
+ for (var i = 0; i < 256; i++)
+ {
+ this.rd.push([0] : int[]);
+ this.td.push([0] : int[]);
+ this.sd.push([] : int[]);
+ }
+
+ for (var i = 0; i < this.test_src.length; i++)
+ {
+ for (var c = 0; c < 256; c++)
+ {
+ this.rd[c].push(this.rd[c][i]);
+ this.td[c].push(this.td[c][i]);
+ if (this.test_src.charCodeAt(i) == c)
+ {
+ this.rd[c][i + 1]++;
+ this.sd[c].push(i);
+ }
+ if (this.test_src.charCodeAt(i) < c)
+ {
+ this.td[c][i + 1]++;
+ }
+ }
+ }
+ }
+
+ function test_size () : void
+ {
+ this.expect(this.wm.size()).toBe(this.test_src.length);
+ for (var c = 0; c < 256; c++)
+ {
+ this.expect(this.wm.size(c)).toBe(this.rd[c][this.wm.size()]);
+ }
+ }
+
+ function test_get() : void
+ {
+ for (var i = 0; i < this.wm.size(); i++)
+ {
+ this.expect(this.wm.get(i)).toBe(this.test_src.charCodeAt((i)));
+ }
+ }
+
+ function test_rank() : void
+ {
+ for (var c = 0; c < 256; c++)
+ {
+ for (var i = 0; i <= this.wm.size(); i++)
+ {
+ this.expect(this.wm.rank(i, c)).toBe(this.rd[c][i]);
+ }
+ }
+ }
+
+ function test_rank_less_than() : void
+ {
+ for (var c = 0; c < 256; c++)
+ {
+ for (var i = 0; i <= this.wm.size(); i++)
+ {
+ this.expect(this.wm.rank_less_than(i, c)).toBe(this.td[c][i]);
+ }
+ }
+ }
+
+ function test_load_dump_and_size () : void
+ {
+ var dump = this.wm.dump();
+ this.wm.load(dump);
+
+ this.expect(this.wm.size()).toBe(this.test_src.length);
+ for (var c = 0; c < 256; c++)
+ {
+ this.expect(this.wm.size(c)).toBe(this.rd[c][this.wm.size()]);
+ }
+ }
+
+ function test_load_dump_and_get() : void
+ {
+ var dump = this.wm.dump();
+ this.wm.load(dump);
+
+ for (var i = 0; i < this.wm.size(); i++)
+ {
+ this.expect(this.wm.get(i)).toBe(this.test_src.charCodeAt((i)));
+ }
+ }
+
+ function test_load_dump_and_rank() : void
+ {
+ var dump = this.wm.dump();
+ this.wm.load(dump);
+
+ for (var c = 0; c < 256; c++)
+ {
+ for (var i = 0; i <= this.wm.size(); i++)
+ {
+ this.expect(this.wm.rank(i, c)).toBe(this.rd[c][i]);
+ }
+ }
+ }
+
+ function test_load_dump_and_rank_less_than() : void
+ {
+ var dump = this.wm.dump();
+ this.wm.load(dump);
+
+ for (var c = 0; c < 256; c++)
+ {
+ for (var i = 0; i <= this.wm.size(); i++)
+ {
+ this.expect(this.wm.rank_less_than(i, c)).toBe(this.td[c][i]);
+ }
+ }
+ }
+}
diff --git a/web/server/h2o/libh2o/misc/oktavia/testdata/jsx_literal.txt b/web/server/h2o/libh2o/misc/oktavia/testdata/jsx_literal.txt
new file mode 100644
index 00000000..7415d746
--- /dev/null
+++ b/web/server/h2o/libh2o/misc/oktavia/testdata/jsx_literal.txt
@@ -0,0 +1,65 @@
+Literals
+
+Keywords
+
+The table lists the keyword literals of JSX. In contrary to JavaScript, there is no distinction between undefined and null.
+
+Table 1. List of Keyword Literals
+Keyword Description
+null [: type] declares null, may have the type annotated. The type is deducted (if possible) if the type annotation does not exist.
+false a boolean constant
+true a boolean constant
+Number Literal
+
+Identical to JavaScript.
+
+String Literal
+
+Identical to JavaScript.
+
+RegExp Literal
+
+Identical to JavaScript.
+
+Function Literal
+
+Type annotations against arguments and return types are required for function declaration, unless the type can be deducted by the surrounding expression.
+
+// a function that takes no arguments, and returns void
+function () : void {}
+
+// a function that takes one argument (of number),
+// and returns a number that in incremented by one
+function (n : number) : number {
+ return n + 1;
+}
+
+// the argument types and return types may be omitted
+// (if it is deductable from the outer expression)
+var sum = 0;
+[ 1, 2, 3 ].forEach(function (e) {
+ sum += e;
+});
+log sum; // 6
+
+// short-handed
+var sum = 0;
+[ 1, 2, 3 ].forEach((e) -> { sum += e; });
+log sum; // 6
+
+// short-handed, single-statement function expression
+var s = "a0b1c".replace(/[a-z]/g, (ch) -> ch.toUpperCase());
+log s; // A0B1C
+A statement starting with function is parsed as inner function declaration, as is by JavaScript. Surround the function declaration with () if your intention is to create an anonymous function and call it immediately.
+
+// inner function declaration (when used within a function declaration)
+function innerFunc() : void {
+ ...;
+}
+
+// create an anonymous function and execute immediately
+(function () : void {
+ ...;
+})();
+See also: Member Function in Class, Interface, and Mixin.
+
diff --git a/web/server/h2o/libh2o/misc/oktavia/testdata/jsx_operator.txt b/web/server/h2o/libh2o/misc/oktavia/testdata/jsx_operator.txt
new file mode 100644
index 00000000..7b79f932
--- /dev/null
+++ b/web/server/h2o/libh2o/misc/oktavia/testdata/jsx_operator.txt
@@ -0,0 +1,68 @@
+Operators
+
+The operators of JSX are the same to those in JavaScript (ECMA-262 3rd edition) except for the following changes.
+
+types of the operands accepted by the operators are more restrictive
+logical operators (&& ||) return boolean
+binary ?: operator has been introduced (to cover the use of || in JavaScript to return non-boolean values)
+introduction of the as operator
+delete is a statement instead of an operator
+The table below lists the operators supported by JSX.
+
+Table 1. List of Operators by Precedence
+Operator Returned Type Operand Type(s)
+(x)[1] typeof x
+func(...) return type of the function
+obj.prop typeof obj.prop obj: any object type
+array[index] Nullable.<T> array: Array.<T>
+index: number
+map[key] Nullable.<T> map: Map.<T>
+key: string
+x++
+x-- typeof x number or int
+obj instanceof type boolean obj: any object type
+type: a Class, Interface, or Mixin
+x as type[2]
+x as __noconvert__ type[3] type
+++x
+--x typeof x number or int
++x
+-x typeof x number or int
+~x int number or int
+! x boolean any
+typeof x string variant
+x * y
+x % y number or int[4] number or int
+x / y number number or int
+x + y
+x - y number or int[4] number or int
+x + y string string
+x << y
+x >> y
+x >>> y int number or int
+x < y
+x<= y
+x > y
+x >= y boolean number, int, string[5]
+x in y boolean x: string
+y: Map.<T>
+x == y
+x != y boolean any except variant[5]
+x & y int number or int
+x ^ y int number or int
+x | y int number or int
+x && y boolean any
+x || y boolean any
+x ? y : z typeof y any[6]
+x ?: y typeof x any[5]
+x = y typeof x any[7]
+x op[8]= y typeof x same as op
+x, y typeof y any
+grouping operator
+cast operator
+cast operator (without run-time type check)
+int is returned if both operands are int
+types of x and y should be equal, or either should be convertible to the other
+types of y and z should be equal, or either should be convertible to the other
+type of y should be convertible to type of x
+any of: * / % + - << >> >>> & ^ |
diff --git a/web/server/h2o/libh2o/misc/oktavia/testdata/jsx_primitive_type.txt b/web/server/h2o/libh2o/misc/oktavia/testdata/jsx_primitive_type.txt
new file mode 100644
index 00000000..c55778dc
--- /dev/null
+++ b/web/server/h2o/libh2o/misc/oktavia/testdata/jsx_primitive_type.txt
@@ -0,0 +1,68 @@
+Primitive Types
+
+JSX provides the following four primitive types. Primitive types are non-nullable. Int exists as a type, but would be equal to or slower than using number in some cases (the definition of int is: an integral number between -231 to 231-1, or NaN, or +-Infinity).
+
+boolean
+number
+string
+(int)
+Nullable Primitive Types
+
+A nullable counterpart exists for each primitive type. Values of the types are returned by [] operators of Array.<primitive_type> and Map.<primitive_type>.
+
+Nullable.<boolean>
+Nullable.<number>
+Nullable.<string>
+(Nullable.<int>)
+Variant Type
+
+A variant can hold any type of data (including null). To use the data, explicit cast to other data types is necessary.
+
+Built-in Object Types
+
+Object
+
+Object class is the root class for all objects.
+
+Array.<T>
+
+The class represents an array, by providing the [] operator that takes a number as the argument, length property and other methods to manipulate the array. In contrast to JavaScript, the array is typed. An instance of Array.<T> class may only store elements of type T or null.
+
+The size of the array automatically grows. null is returned when an element out of the current boundary is requested.
+
+There are two ways to create an array object; one is to use the new opreator, the other is to use the array initialiser. The type of the array returned by an array initialiser is deducted from the type of the elements. Type information should be annotated in cases where such deduction is impossible (such as when initializing an empty array).
+
+new Array.<number>; // creates an empty array of numbers
+new Array.<number>(length); // creates an array of given length (elements are initialized to null)
+[] : Array.<number>; // creates an empty array of numbers
+[ 1, 2, 3 ]; // creates an array of numbers with three elements: 1, 2, 3
+Map.<T>
+
+The class represents an associative array (collection of key-values pairs), mapping strings to values of type T or null.
+
+Operator [] (that takes a string as the argument) is provided for registering / retreiving a keyed value. for..in statement can be used for iterating the keys. hasOwnProperty method is provided for checking whether or not a key-value pair of a particular name is registered. The delete statement can be used for unregistering a key-value pair.
+
+Map objects can be created in two ways; by using the new operator or by using the map initialiser.
+
+new Map.<number>; // creates an empty map of strings to numbers
+{} : Map.<number>; // same as above
+{ a: 1 }; // creates a map of strings to numbers that has one pair: ("a" => 1)
+Boolean, Number, String
+
+Internal types used for applying methods against primitives.
+
+These types of objects are instantiated when applying the dot operator against the primitives. For exmaple, the following code snippet applies the operator against string "abc", that returns a String object wrapping the primitive value. Then the charAt method of the object is called and "a" (of type string) is returned.
+
+"abc".charAt(0) // returns "a"
+Although being possible, it is discouraged to instantiate and store these values of the types (e.g. var s = new String("abc")). Use of the primitive types (or nullable primitive types) is preferable for performance and debugging reasons.
+
+Number and String classes also provide some useful class methods and constants, e.g. Number.parseInt(:string):number, String.encodeURIComponent(:string):string.
+
+JSX
+
+The class provides some methods for controlling the runtime environment.
+
+User-defined Types
+
+Users may define a new class by extending the Object class, or by declaring an interface or a mixin. See Class, Interface and Mixin.
+
diff --git a/web/server/h2o/libh2o/misc/oktavia/testdata/jsx_tutorial.txt b/web/server/h2o/libh2o/misc/oktavia/testdata/jsx_tutorial.txt
new file mode 100644
index 00000000..538238a3
--- /dev/null
+++ b/web/server/h2o/libh2o/misc/oktavia/testdata/jsx_tutorial.txt
@@ -0,0 +1,213 @@
+Background
+
+JSX is a statically-typed, object-oriented programming language compiling to standalone JavaScript. The reason why JSX was developed is our need for a more robust programming language than JavaScript. However, JSX is fairly close to JavaScript especially in its statements and expressions.
+
+Statically-typed programming language is robust because certain sorts of problems, for example typos in variable names or missing function definitions, are detected at compile-time. This is important especially in middle- to large-scale software development in which a number of engineers may be engaged.
+
+Therefore, JSX is designed as a statically-typed language. All the values and variables have a static type and you can only assign a correctly-typed value to a variable. In addition, all the functions including closures have types which are determined by the types of parameters and the return values, where you cannot call a function with incorrectly typed arguments.
+
+Also, another important reason why JSX was developed is to boost JavaScript performance. JavaScript itself is not so slow but large-scale development tends to have many abstraction layers, e.g. proxy classes and accessor methods, which often have negative impact on performance. JSX boosts performance by inline expansion: function bodies are expanded to where they are being called, if the functions being called could be determined at compile-time. This is the power of the statically-typed language in terms of performance.
+
+Run "Hello, World!"
+
+Let's start by running our first JSX program: hello.jsx. We use the jsx command, which is the JSX compiler in the JSX distribution, to compile JSX source code to JavaScript.
+
+Type as follows in the JSX distribution and/or repository, and then you will see it saying "Hello, world!".
+
+$ bin/jsx --run example/hello.jsx
+We will look into the hello.jsx source code in the next section.
+
+Program Structure
+
+Here is hello.jsx, the source code of the "Hello world!" example. You can see several features of JSX in this program, namely, static types and class structure within the source code.
+
+class _Main {
+ static function main(args : string[]) : void {
+ log "Hello, world!";
+ }
+}
+Class _Main has a static member function (a.k.a. a class method) named main, that takes an array of strings and returns nothing. _Main.main(:string[]):void is the entry point of JSX applications that is called when a user invokes an application from command line. JSX, like Java, does not allow top-level statements or functions.
+
+The log statement is mapped to console.log() in JavaScript, which displays the arguments to stdout with a newline.
+
+Next, we look into another typical library class, Point:
+
+class Point {
+ var x = 0;
+ var y = 0;
+
+ function constructor() {
+ }
+
+ function constructor(x : number, y : number) {
+ this.set(x, y);
+ }
+
+ function constructor(other : Point) {
+ this.set(other);
+ }
+
+ function set(x : number, y : number) : void {
+ this.x = x;
+ this.y = y;
+ }
+
+ function set(other : Point) : void {
+ this.x = other.x;
+ this.y = other.y;
+ }
+}
+As you can see, member variables of Point, var x and var y, are declared without types, but their types are deducted from their initial values to be number.
+
+You might be surprised at multiple definition of member functions: one takes no parameters and the others take parameters. They are overloaded by their types of parameters. When you construct the class with new Point(), the first constructor, which takes no parameters, is called. The second with two parameters will be called on new Point(2, 3) and the third with one parameter will be called as a copy constructor. Other forms of construction, e.g. new Point(42) or new Point("foo", "bar") will cause compilation errors of mismatching signatures. The Point#set() functions are also overloaded and the compiler know how to call the correct one.
+
+Static Types
+
+Basic type concept will be described in this section. Primitive types, object types, variant type, and Nullable types exist in JSX.
+
+Primitive types, e.g. string, boolean, or number are non-nullable, immutable types.
+
+var s : string = "hello";
+var n : number = 42;
+var b : boolean = true;
+Object types, e.g. string[] (array of string), functions or Date, are nullable, mutable types.
+
+var d : Date = new Date(); // Date
+var f : function():void = function() : void { log "Hi!"; };
+var a : string[] = ["foo"]; // the same as Array.<string>;
+Variant type, which means "no static type information," is used for interacting with existing JavaScript APIs. Some JavaScript libraries may return a variant value, which type cannot be determined at compile time. All you can do on variant values is to check equality of a variant value to another variant value. You have to cast it to another type before doing anything else on the value.
+
+Nullable type is a meta type which indicates a value may be null. For example, the return type of Array.<string>#shift() is Nullable.<string>. When you use a Nullable value, you have to make sure of the value is not null. Only primitive types can be marked Nullable. Object types and variants are nullable by default.
+
+function shiftOrReturnEmptyString(args : string[]) : string {
+ if (args.length > 0)
+ return args.shift();
+ else
+ return "";
+}
+When the source code is compiled in debug mode (which is the default), the compiler will insert run-time type-checking code. An exception will be raised (or the debugger will be activated) when misuse of a null value as actual value is detected. Run-time type checks can be omitted by compiling the source code with the --release option.
+Classes and Interfaces
+
+JSX is a class-based object-oriented language, and its class model is similar to Java.
+
+a class may extend another class (single inheritance)
+a class may implement multiple interfaces
+all classes share a single root class: the Object class
+interface Flyable {
+ abstract function fly() : void;
+}
+
+abstract class Animal {
+ function eat() : void {
+ log "An animal is eating!";
+ }
+}
+
+class Bat extends Animal implements Flyable {
+ override function fly() : void {
+ log "A bat is flying!";
+ }
+}
+
+abstract class Insect {
+}
+
+class Bee extends Insect implements Flyable {
+ override function fly() : void {
+ log "A bee is flying!";
+ }
+}
+
+class _Main {
+
+ static function main(args : string[]) : void {
+ // fo bar
+ var bat = new Bat();
+
+ var animal : Animal = bat; // OK. A bat is an animal.
+ animal.eat();
+
+ var flyable : Flyable = bat; // OK. A bat can fly
+ flyable.fly();
+
+ // for Bee
+ var bee = new Bee();
+
+ flyable = bee; // A bee is also flyable
+ flyable.fly();
+ }
+}
+In the example, the Bat class extends the Animal class, so it inherits the Animal#eat() member function, and it can be assigned to a variable typed to Animal. The class also implements the Flyable interface overriding the Flyable#fly() member function, so it can be assigned to a variable typed Flyable. There's also another flyable class, Bee. By using the Flyable interface, it is possible to deal with both classes as a flyable being, even if the organ of a bee is completely different from that of a bat.
+
+When overriding a member function, the use the override keyword is mandatory. Otherwise the compiler will report an error. In other words, you are saved from unexpected interface changes in the base classes which cause compilation errors in derived classes instead of undesirable runtime errors.
+Functions and Closures
+
+In JSX, functions are first-class objects and they have static types. You can declare a variable of a function type like var f : function(arg : number) : number, a function that takes a number as an argument and returns another number (or, just returns the same value as the argument; but it's not important here). The variable f can be called as f(42) from which you will get a number value.
+
+It is possible to define closures (or anonymous functions). They are typically used to implement event listeners, which are popular in GUI programming. Closures are similar to JavaScript except for what this points at: when a closure is defined within a member function, it refers to the receiver of the member function. See the following example.
+class _Main {
+ var foo = 42;
+
+ function constructor() {
+ var f = function() : void {
+ log this.foo;
+ };
+
+ f(); // says 42
+ }
+
+ static function main(args : string[]) : void {
+ var o = new _Main();
+ }
+}
+Modules
+
+JSX has a module system. You can reuse JSX class libraries by the import statement. For example, the following program uses timer.jsx module, which exports the Timer class.
+
+import "timer.jsx";
+
+class _Main {
+
+ static function main(args : string[]) : void {
+ Timer.setTimeout(function() : void {
+ log "Hello, world!";
+ }, 1000);
+ }
+
+}
+A module may export multiple classes, but you can specify what modules you import or name a namespace which the module is imported into.
+
+Interface to Web Browsers
+
+The js/web.jsx module provides the interface to web browser APIs, e.g. the window object and DOM APIs. The example below shows how to insert a text node into an HTML.
+
+// hello.jsx
+import "js/web.jsx";
+
+class _Main {
+
+ static function main(args : string[]) : void {
+ var document = dom.window.document;
+
+ var text = document.createTextNode("Hello, world!");
+ document.getElementById("hello").appendChild(text);
+ }
+
+}
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Hello, world!</title>
+ <script src="hello.jsx.js"></script>
+ </head>
+ <body>
+ <p id="hello"></p>
+ </body>
+</html>
+Once you compile hello.jsx by the following command, then you can access the HTML and you will see it saying "Hello, world!."
+
+$ bin/jsx --executable web --output hello.jsx.js hello.jsx
+Further Learning
+
+More documents can be found on the wiki.
+If you are looking for examples, please refer to the examples on this web site, the example directory of the distribution, or to the links on Resouces page of the wiki.
diff --git a/web/server/h2o/libh2o/misc/oktavia/testdata/jsx_typeconversion.txt b/web/server/h2o/libh2o/misc/oktavia/testdata/jsx_typeconversion.txt
new file mode 100644
index 00000000..ec138bb3
--- /dev/null
+++ b/web/server/h2o/libh2o/misc/oktavia/testdata/jsx_typeconversion.txt
@@ -0,0 +1,40 @@
+Documents > Type Conversion
+Type Conversion
+
+The as operator is used for: conversion between primitive types (including Nullable and variant), down-casting of object types.
+
+The conversion rules between primitive types are defined as follows. If the source type is a Nullable type and if the value is null, a run-time exception is raised under debug builds. The behavior is unspecified for release builds.
+
+The result of conversion from a variant type depends on the result of the typeof operator applied to the variant.
+
+Down-casting of an object type returns a reference to the casted object if successful, otherwise null.
+
+Table 1. Conversion between the Primitive Types using the As Operator
+Source Type Destination Type Result
+boolean number 0 if false, 1 if true
+boolean int same as above
+boolean string "false" if false, "true" if true
+number boolean false if 0 or NaN, otherwise true
+number int fractional part is removed, becomes 0 if NaN, may get rounded to between -231 and 231-1
+number string converted to string representation
+int boolean false if 0, otherwise true
+int number converted to number of same value
+int string converted to string representation
+string boolean false if the string is empty, otherwise true
+string number 0 if the string is empty, a number if the string can be parsed as a string, otherwise NaN
+string int equivalent to: as number as int
+Table 2. Conversion from Variant using the As Operator
+Result of typeof(variant) Destination Type Result
+"undefined" boolean false
+"undefined" number NaN
+"undefined" int 0
+"undefined" string "undefined"
+"null" boolean false
+"null" number 0
+"null" int 0
+"null" string "null"
+"boolean" any primitive type equivalent to the result of: boolean as type
+"number" any primitive type equivalent to the result of: number as type
+"string" any primitive type equivalent to the result of: string as type
+"object" any primitive type depends on the actual type of the value
+"object" any object type reference to the object if the value is an object of the specified type, otherwise null
diff --git a/web/server/h2o/libh2o/misc/oktavia/tool/httpstatus.jsx b/web/server/h2o/libh2o/misc/oktavia/tool/httpstatus.jsx
new file mode 100644
index 00000000..a4d7451e
--- /dev/null
+++ b/web/server/h2o/libh2o/misc/oktavia/tool/httpstatus.jsx
@@ -0,0 +1,130 @@
+import "console.jsx";
+import "oktavia.jsx";
+import "metadata.jsx";
+import "query-parser.jsx";
+import "stemmer/english-stemmer.jsx";
+
+
+class HTTPStatus
+{
+ var oktavia : Oktavia;
+ var splitter : Splitter;
+ var httpstatus : string[];
+
+ function constructor ()
+ {
+ this.oktavia = new Oktavia;
+ this.oktavia.setStemmer(new EnglishStemmer());
+ this.splitter = this.oktavia.addSplitter('line break');
+ this.makeIndex();
+ }
+
+ function makeIndex () : void
+ {
+ this.httpstatus = [
+ "100: Continue",
+ "101: Switching Protocols",
+ "102: Processing",
+ "200: OK",
+ "201: Created",
+ "202: Accepted",
+ "203: Non-Authoritative Information",
+ "204: No Content",
+ "205: Reset Content",
+ "206: Partial Content",
+ "207: Multi-Status",
+ "208: Already Reported",
+ "300: Multiple Choices",
+ "301: Moved Permanently",
+ "302: Found",
+ "303: See Other",
+ "304: Not Modified",
+ "305: Use Proxy",
+ "307: Temporary Redirect",
+ "400: Bad Request",
+ "401: Unauthorized",
+ "402: Payment Required",
+ "403: Forbidden",
+ "404: Not Found",
+ "405: Method Not Allowed",
+ "406: Not Acceptable",
+ "407: Proxy Authentication Required",
+ "408: Request Timeout",
+ "409: Conflict",
+ "410: Gone",
+ "411: Length Required",
+ "412: Precondition Failed",
+ "413: Request Entity Too Large",
+ "414: Request-URI Too Large",
+ "415: Unsupported Media Type",
+ "416: Request Range Not Satisfiable",
+ "417: Expectation Failed",
+ "418: I'm a teapot",
+ "422: Unprocessable Entity",
+ "423: Locked",
+ "424: Failed Dependency",
+ "425: No code",
+ "426: Upgrade Required",
+ "428: Precondition Required",
+ "429: Too Many Requests",
+ "431: Request Header Fields Too Large",
+ "449: Retry with",
+ "500: Internal Server Error",
+ "501: Not Implemented",
+ "502: Bad Gateway",
+ "503: Service Unavailable",
+ "504: Gateway Timeout",
+ "505: HTTP Version Not Supported",
+ "506: Variant Also Negotiates",
+ "507: Insufficient Storage",
+ "509: Bandwidth Limit Exceeded",
+ "510: Not Extended"
+ ];
+ for (var i in this.httpstatus)
+ {
+ this.oktavia.addWord(this.httpstatus[i], true);
+ this.splitter.split();
+ }
+ this.oktavia.build();
+ }
+
+ function search (words : string[]) : string
+ {
+ var queryParser = new QueryParser();
+ var queries = queryParser.parse(words);
+ if (queries.length == 0)
+ {
+ var result = this.httpstatus.join('\n');
+ result = result + "\n\nToday's status: " + this.random();
+ return result;
+ }
+ else
+ {
+ var summary = this.oktavia.search(queries);
+ if (summary.size() == 0)
+ {
+ return "not found ";
+ }
+ var resultWords = [] : string[];
+ for (var i in summary.result.unitIds)
+ {
+ resultWords.push(this.splitter.getContent(summary.result.unitIds[i]));
+ }
+ return resultWords.join('\n');
+ }
+ }
+
+ function random () : string
+ {
+ return this.httpstatus[Math.round(Math.random() * this.httpstatus.length)];
+ }
+}
+
+class _Main
+{
+ static function main (argv : string []) : void
+ {
+ var httpstatus = new HTTPStatus();
+ console.log(httpstatus.search(argv));
+ }
+}
diff --git a/web/server/h2o/libh2o/misc/oktavia/tool/oktavia-mkindex.jsx b/web/server/h2o/libh2o/misc/oktavia/tool/oktavia-mkindex.jsx
new file mode 100644
index 00000000..f2593bc9
--- /dev/null
+++ b/web/server/h2o/libh2o/misc/oktavia/tool/oktavia-mkindex.jsx
@@ -0,0 +1,470 @@
+import "console.jsx";
+import "js/nodejs.jsx";
+
+import "oktavia.jsx";
+import "getopt.jsx";
+import "htmlparser.jsx";
+import "csvparser.jsx";
+import "textparser.jsx";
+import "binary-util.jsx";
+
+import "stemmer/stemmer.jsx";
+import "stemmer/danish-stemmer.jsx";
+import "stemmer/dutch-stemmer.jsx";
+import "stemmer/english-stemmer.jsx";
+import "stemmer/finnish-stemmer.jsx";
+import "stemmer/french-stemmer.jsx";
+import "stemmer/german-stemmer.jsx";
+import "stemmer/hungarian-stemmer.jsx";
+import "stemmer/italian-stemmer.jsx";
+import "stemmer/norwegian-stemmer.jsx";
+import "stemmer/porter-stemmer.jsx";
+import "stemmer/portuguese-stemmer.jsx";
+import "stemmer/romanian-stemmer.jsx";
+import "stemmer/russian-stemmer.jsx";
+import "stemmer/spanish-stemmer.jsx";
+import "stemmer/swedish-stemmer.jsx";
+import "stemmer/turkish-stemmer.jsx";
+
+
+class _Main
+{
+ static function usage () : void
+ {
+ console.log([
+ "usage: oktavia_mkindex [options]",
+ "",
+ "Common Options:",
+ " -i, --input [input folder/file ] : Target files to search. .html, .csv, .txt are available.",
+ " -o, --output [outputfolder] : Directory that will store output files.",
+ " : This is a relative path from root.",
+ " : Default value is 'search'. ",
+ " -t, --type [type] : Export type. 'index'(default), 'base64', 'cmd', 'js',",
+ " : 'commonjs' are available.",
+ " : 'index' is a just index file. 'cmd' is a base64 code with search program.",
+ " : Others are base64 source code style output.",
+ " -m, --mode [mode] : Mode type. 'html', 'csv', 'text' are available.",
+ " -c, --cache-density [percent] : Cache data density. It effects file size and search speed.",
+ " : 100% become four times of base index file size. Default value is 5%.",
+ " : Valid value is 0.1% - 100%.",
+ " -n, --name [function] : A variable name for 'js' output or property name",
+ " : for 'js' and 'commonjs'. Default value is 'searchIndex'.",
+ " -q, --quiet : Hide detail information.",
+ " -h, --help : Display this message.",
+ "",
+ "HTML Mode Options:",
+ " -r, --root [document root] : Document root folder. Default is current. ",
+ " : Indexer creates result file path from this folder.",
+ " -p, --prefix [directory prefix] : Directory prefix for a document root from a server root.",
+ " : If your domain is example.com and 'manual' is passed,",
+ " : document root become http://example.com/manual/.",
+ " : It effects search result URL. Default value is '/'.",
+ " -u, --unit [search unit] : 'file', 'h1'-'h6'. Default value is 'file'.",
+ " -f, --filter [target tag] : Only contents inside this tag is indexed.",
+ " : Default value is \"article,#content,#main,div.body\".",
+ " -s, --stemmer [algorithm] : Select stemming algorithm.",
+ " -w, --word-splitter [splitter] : Use optional word splitter.",
+ " : 'ts' (TinySegmenter for Japanese) is available",
+ "",
+ "Text Mode Options:",
+ " -s, --stemmer [algorithm] : Select stemming algorithm.",
+ " -w, --word-splitter [splitter] : Use optional word splitter.",
+ " : 'ts' (TinySegmenter for Japanese) is available",
+ " -u, --unit [search unit] : file, block, line. Default value is 'file'.",
+ "",
+ "Supported Stemmer Algorithms:",
+ " danish, dutch, english, finnish, french german, hungarian italian",
+ " norwegian, porter, portuguese, romanian, russian, spanish, swedish, turkish"
+ ].join('\n'));
+ }
+
+ static function main(args : string[]) : void
+ {
+ console.log("Search Engine Oktavia - Index Generator\n");
+
+ var inputs = [] : string[];
+ var root = process.cwd();
+ var prefix = '/';
+ var output = "search";
+ var showhelp = false;
+ var notrun = false;
+ var unit = 'file';
+ var type = 'js';
+ var mode = '';
+ var verbose = true;
+ var filter = [] : string[];
+ var algorithm : Nullable.<string> = null;
+ var wordsplitter : Nullable.<string> = null;
+ var cacheDensity : number = 5.0;
+ var name = null : Nullable.<string>;
+ var validModes = ['html', 'csv', 'text'];
+ var validUnitsForHTML = ['file', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6'];
+ var validUnitsForText = ['file', 'block', 'line'];
+ var validStemmers = [
+ 'danish', 'dutch', 'english', 'finnish', 'french', 'german', 'hungarian',
+ 'italian', 'norwegian', 'porter', 'portuguese', 'romanian', 'russian',
+ 'spanish', 'swedish', 'turkish'
+ ];
+ var validTypes = ['index', 'base64', 'cmd', 'js', 'commonjs'];
+ var validWordSplitters = ['ts'];
+
+ var optstring = "n:(name)q(quiet)m:(mode)i:(input)r:(root)p:(prefix)o:(output)h(help)u:(unit)f:(filter)s:(stemmer)w:(word-splitter)t:(type)c:(cache-density)";
+ var parser = new BasicParser(optstring, args);
+ var opt = parser.getopt();
+ while (opt)
+ {
+ switch (opt.option)
+ {
+ case "m":
+ if (validModes.indexOf(opt.optarg) == -1)
+ {
+ console.error("Option m/mode should be 'html', 'csv', 'text'.");
+ notrun = true;
+ }
+ mode = opt.optarg;
+ break;
+ case "i":
+ inputs.push(opt.optarg);
+ break;
+ case "r":
+ root = node.path.resolve(opt.optarg);
+ break;
+ case "p":
+ prefix = opt.optarg;
+ break;
+ case "n":
+ name = opt.optarg;
+ break;
+ case "o":
+ output = opt.optarg;
+ if (output.slice(0, 1) == '/')
+ {
+ output = output.slice(1);
+ }
+ break;
+ case "h":
+ showhelp = true;
+ break;
+ case "q":
+ verbose = false;
+ break;
+ case "u":
+ unit = opt.optarg;
+ break;
+ case "f":
+ var items = opt.optarg.split(',');
+ for (var i in items)
+ {
+ filter.push(items[i]);
+ }
+ break;
+ case "t":
+ if (validTypes.indexOf(opt.optarg) == -1)
+ {
+ console.error('Option -t/--type is invalid.');
+ notrun = true;
+ }
+ else
+ {
+ type = opt.optarg;
+ }
+ break;
+ case "s":
+ if (validStemmers.indexOf(opt.optarg) == -1)
+ {
+ console.error('Option -s/--stemmer is invalid.');
+ notrun = true;
+ }
+ else
+ {
+ algorithm = opt.optarg;
+ }
+ break;
+ case "w":
+
+ break;
+ case "c":
+ var match = /(\d+\.?\d*)/.exec(opt.optarg);
+ if (match)
+ {
+ var tmpValue = match[1] as number;
+ if (0.1 <= tmpValue && tmpValue <= 100)
+ {
+ cacheDensity = tmpValue;
+ }
+ else
+ {
+ console.error('Option -c/--cache-density should be in 0.1 - 100.');
+ notrun = true;
+ }
+ }
+ else
+ {
+ console.error('Option -c/--cache-density is invalid.');
+ notrun = true;
+ }
+ break;
+ case "?":
+ notrun = true;
+ break;
+ }
+ opt = parser.getopt();
+ }
+ var inputTextFiles = [] : string[];
+ var inputHTMLFiles = [] : string[];
+ var inputCSVFiles = [] : string[];
+ if (filter.length == 0)
+ {
+ filter = ['article', '#content', '#main', 'div.body'];
+ }
+ for (var i in inputs)
+ {
+ var input = inputs[i];
+ if (!node.fs.existsSync(input))
+ {
+ console.error("Following input folder/file doesn't exist: " + input);
+ notrun = true;
+ }
+ else
+ {
+ var stat = node.fs.statSync(input);
+ if (stat.isFile())
+ {
+ _Main._checkFileType(node.path.resolve(input), inputTextFiles, inputHTMLFiles, inputCSVFiles);
+ }
+ else if (stat.isDirectory())
+ {
+ _Main._checkDirectory(input, inputTextFiles, inputHTMLFiles, inputCSVFiles);
+ }
+ else
+ {
+ console.error("Following input is not folder or file: " + input);
+ notrun = true;
+ }
+ }
+ }
+ if (inputTextFiles.length == 0 && inputHTMLFiles.length == 0 && inputCSVFiles.length == 0 || !mode)
+ {
+ showhelp = true;
+ }
+ if (showhelp)
+ {
+ _Main.usage();
+ }
+ else if (!notrun)
+ {
+ var stemmer : Nullable.<Stemmer> = null;
+ if (algorithm)
+ {
+ stemmer = _Main._createStemmer(algorithm);
+ }
+ var dump = null : Nullable.<string>;
+ switch (mode)
+ {
+ case 'html':
+ var unitIndex = validUnitsForHTML.indexOf(unit);
+ if (unitIndex == -1)
+ {
+ console.error('Option -u/--unit should be file, h1, h2, h3, h4, h5, h6. But ' + unit);
+ }
+ else
+ {
+ var htmlParser = new HTMLParser(unitIndex, root, prefix, filter, stemmer);
+ for (var i = 0; i < inputHTMLFiles.length; i++)
+ {
+ htmlParser.parse(inputHTMLFiles[i]);
+ }
+ console.log('generating index...');
+ if (verbose)
+ {
+ console.log('');
+ }
+ dump = htmlParser.dump(cacheDensity, verbose);
+ }
+ break;
+ case 'csv':
+ var csvParser = new CSVParser(root, stemmer);
+ for (var i in inputCSVFiles)
+ {
+ csvParser.parse(inputCSVFiles[i]);
+ }
+ break;
+ case 'text':
+ if (validUnitsForText.indexOf(unit) == -1)
+ {
+ console.error('Option u/unit should be file, block, line. But ' + unit);
+ }
+ else
+ {
+ var textParser = new TextParser(unit, root, stemmer);
+ for (var i in inputTextFiles)
+ {
+ textParser.parse(inputTextFiles[i]);
+ }
+ }
+ break;
+ }
+ if (dump)
+ {
+ var indexFilePath = "";
+ switch (type)
+ {
+ case 'index':
+ indexFilePath = node.path.resolve(root, output, 'searchindex.okt');
+ var dirPath = node.path.dirname(indexFilePath);
+ _Main._mkdirP(dirPath);
+ node.fs.writeFileSync(indexFilePath, dump, "utf16le");
+ break;
+ case 'base64':
+ indexFilePath = node.path.resolve(root, output, 'searchindex.okt.b64');
+ var dirPath = node.path.dirname(indexFilePath);
+ _Main._mkdirP(dirPath);
+ node.fs.writeFileSync(indexFilePath, Binary.base64encode(dump), "utf8");
+ break;
+ case 'cmd':
+ break;
+ case 'js':
+ indexFilePath = node.path.resolve(root, output, 'searchindex.js');
+ var dirPath = node.path.dirname(indexFilePath);
+ _Main._mkdirP(dirPath);
+ if (name == null)
+ {
+ name = 'searchIndex';
+ }
+ var contents = [
+ '// Oktavia Search Index',
+ 'var ' + name + ' = "' + Binary.base64encode(dump) + '";', ''
+ ];
+ node.fs.writeFileSync(indexFilePath, contents.join('\n'), "utf8");
+ break;
+ case 'commonjs':
+ indexFilePath = node.path.resolve(root, output, 'searchindex.js');
+ var dirPath = node.path.dirname(indexFilePath);
+ _Main._mkdirP(dirPath);
+ if (name == null)
+ {
+ name = 'searchIndex';
+ }
+ var contents = [
+ '// Oktavia Search Index',
+ 'exports.' + name + ' = "' + Binary.base64encode(dump) + '";', ''
+ ];
+ node.fs.writeFileSync(indexFilePath, contents.join('\n'), "utf8");
+ break;
+ }
+ if (indexFilePath)
+ {
+ console.log("generated: " + indexFilePath);
+ }
+ }
+ }
+ }
+
+ static function _checkFileType (path : string, texts : string[], HTMLs : string[], CSVs : string[]) : void
+ {
+ var match = path.match(/(.*)\.(.*)/);
+ if (match && match[1])
+ {
+ switch (match[2].toLowerCase())
+ {
+ case 'html':
+ case 'htm':
+ HTMLs.push(path);
+ break;
+ case 'csv':
+ CSVs.push(path);
+ break;
+ default:
+ texts.push(path);
+ }
+ }
+ }
+
+ static function _checkDirectory (path : string, texts : string[], HTMLs : string[], CSVs : string[]) : void
+ {
+ var files = node.fs.readdirSync(path);
+ for (var j in files)
+ {
+ var filepath = node.path.resolve(path, files[j]);
+ var stat = node.fs.statSync(filepath);
+ if (stat.isFile())
+ {
+ _Main._checkFileType(filepath, texts, HTMLs, CSVs);
+ }
+ else if (stat.isDirectory())
+ {
+ _Main._checkDirectory(filepath, texts, HTMLs, CSVs);
+ }
+ }
+ }
+
+ static function _mkdirP (path : string) : void
+ {
+ if (node.fs.existsSync(path))
+ {
+ return;
+ }
+ _Main._mkdirP(node.path.dirname(path));
+ node.fs.mkdirSync(path);
+ }
+
+ static function _createStemmer (algorithm : string) : Stemmer
+ {
+ var stemmer : Stemmer;
+ switch (algorithm.toLowerCase())
+ {
+ case "danish":
+ stemmer = new DanishStemmer();
+ break;
+ case "dutch":
+ stemmer = new DutchStemmer();
+ break;
+ case "english":
+ stemmer = new EnglishStemmer();
+ break;
+ case "finnish":
+ stemmer = new FinnishStemmer();
+ break;
+ case "french":
+ stemmer = new FrenchStemmer();
+ break;
+ case "german":
+ stemmer = new GermanStemmer();
+ break;
+ case "hungarian":
+ stemmer = new HungarianStemmer();
+ break;
+ case "italian":
+ stemmer = new ItalianStemmer();
+ break;
+ case "norwegian":
+ stemmer = new NorwegianStemmer();
+ break;
+ case "porter":
+ stemmer = new PorterStemmer();
+ break;
+ case "portuguese":
+ stemmer = new PortugueseStemmer();
+ break;
+ case "romanian":
+ stemmer = new RomanianStemmer();
+ break;
+ case "russian":
+ stemmer = new RussianStemmer();
+ break;
+ case "spanish":
+ stemmer = new SpanishStemmer();
+ break;
+ case "swedish":
+ stemmer = new SwedishStemmer();
+ break;
+ case "turkish":
+ stemmer = new TurkishStemmer();
+ break;
+ default:
+ stemmer = new EnglishStemmer();
+ break;
+ }
+ return stemmer;
+ }
+}
diff --git a/web/server/h2o/libh2o/misc/oktavia/tool/oktavia-search.jsx b/web/server/h2o/libh2o/misc/oktavia/tool/oktavia-search.jsx
new file mode 100644
index 00000000..719c71b8
--- /dev/null
+++ b/web/server/h2o/libh2o/misc/oktavia/tool/oktavia-search.jsx
@@ -0,0 +1,370 @@
+import "console.jsx";
+import "js/nodejs.jsx";
+
+import "oktavia.jsx";
+import "getopt.jsx";
+import "query-parser.jsx";
+import "search-result.jsx";
+import "style.jsx";
+import "binary-util.jsx";
+
+import "stemmer/stemmer.jsx";
+import "stemmer/danish-stemmer.jsx";
+import "stemmer/dutch-stemmer.jsx";
+import "stemmer/english-stemmer.jsx";
+import "stemmer/finnish-stemmer.jsx";
+import "stemmer/french-stemmer.jsx";
+import "stemmer/german-stemmer.jsx";
+import "stemmer/hungarian-stemmer.jsx";
+import "stemmer/italian-stemmer.jsx";
+import "stemmer/norwegian-stemmer.jsx";
+import "stemmer/porter-stemmer.jsx";
+import "stemmer/portuguese-stemmer.jsx";
+import "stemmer/romanian-stemmer.jsx";
+import "stemmer/russian-stemmer.jsx";
+import "stemmer/spanish-stemmer.jsx";
+import "stemmer/swedish-stemmer.jsx";
+import "stemmer/turkish-stemmer.jsx";
+
+
+class Search
+{
+ var style : Style;
+
+ function search (indexFile : string, queryStrings : string[], num : int, style : Style, algorithm : Nullable.<string>) : void
+ {
+ this.style = style;
+ var oktavia = new Oktavia();
+ if (algorithm != null)
+ {
+ oktavia.setStemmer(this.createStemmer(algorithm));
+ }
+ if (!this.loadIndex(oktavia, indexFile))
+ {
+ return;
+ }
+ console.time('searching');
+ var queryParser = new QueryParser();
+ queryParser.parse(queryStrings);
+ var summary = oktavia.search(queryParser.queries);
+ console.timeEnd('searching');
+ if (summary.size() == 0)
+ {
+ this.notFound(summary, queryStrings);
+ }
+ else
+ {
+ this.showResult(oktavia, summary, num);
+ }
+ }
+
+ function loadIndex (oktavia : Oktavia, filepath : string) : boolean
+ {
+ var ext = node.path.extname(filepath);
+ var content : string;
+ var result = true;
+ switch (ext)
+ {
+ case ".okt":
+ content = node.fs.readFileSync(filepath, "utf16le");
+ oktavia.load(content);
+ break;
+ case ".b64":
+ content = node.fs.readFileSync(filepath, "utf8");
+ oktavia.load(Binary.base64decode(content));
+ break;
+ case ".js":
+ content = node.fs.readFileSync(filepath, "utf8");
+ var index = content.indexOf('"');
+ var lastIndex = content.lastIndexOf('"');
+ oktavia.load(Binary.base64decode(content.slice(index, lastIndex)));
+ break;
+ default:
+ console.log("unknown file extension: " + ext);
+ result = false;
+ break;
+ }
+ return result;
+ }
+
+ function sortResult (oktavia : Oktavia, summary : SearchSummary) : SearchUnit[]
+ {
+ for (var i = 0; i < summary.result.units.length; i++)
+ {
+ var score = 0;
+ var unit = summary.result.units[i];
+ for (var pos in unit.positions)
+ {
+ var position = unit.positions[pos];
+ if (oktavia.wordPositionType(position.position))
+ {
+ score += 10;
+ }
+ else
+ {
+ score += 1;
+ }
+ if (!position.stemmed)
+ {
+ score += 2;
+ }
+ }
+ unit.score = score;
+ }
+ return summary.getSortedResult();
+ }
+
+ function showResult (oktavia : Oktavia, summary : SearchSummary, num : int) : void
+ {
+ var results = this.sortResult(oktavia, summary);
+ var style = this.style;
+ var metadata = oktavia.getPrimaryMetadata();
+ for (var i = 0; i < results.length; i++)
+ {
+ var unit = results[i];
+ var info = metadata.getInformation(unit.id).split(Oktavia.eob);
+ /*console.log(info.replace(Oktavia.eob, ' -- ') + '\n');
+ + ' ----------------------------------------------- '
+ + unit.score as string + ' pt');*/
+ console.log(style.convert('<title>' + info[0] + '</title>') + ' ' + style.convert('<url>' + info[1] + '</url>'));
+ var offset = info[0].length + 1;
+ var content = metadata.getContent(unit.id);
+ var start = 0;
+ var positions = unit.getPositions();
+ if (content.indexOf(info[0]) == 1)
+ {
+ content = content.slice(info[0].length + 2, content.length);
+ start += (info[0].length + 2);
+ }
+ var end = start + num;
+ var split = false;
+ if (positions[0].position > end - positions[0].word.length)
+ {
+ end = positions[0].position + Math.floor(num / 2);
+ split = true;
+ }
+ for (var j = positions.length - 1; j > -1; j--)
+ {
+ var pos = positions[j];
+ if (pos.position + pos.word.length < end)
+ {
+ /*log('--------------begin : ' + (pos.position - start) as string);
+ log(content.slice(0, pos.position - start));
+ log('--------------match : ' + pos.word.length as string);
+ .log(content.slice(pos.position - start, pos.position + pos.word.length - start));
+ log('--------------match : ' + (content.length - pos.position + pos.word.length - start) as string);
+ log(content.slice(pos.position + pos.word.length - start, content.length));
+ log('--------------end');*/
+ content = [
+ content.slice(0, pos.position - start),
+ style.convert('<hit>*</hit>').replace('*', content.slice(pos.position - start, pos.position + pos.word.length - start)),
+ content.slice(pos.position + pos.word.length - start, content.length)
+ ].join('');
+ }
+ }
+ var text : string;
+ if (split)
+ {
+ text = [
+ content.slice(0, Math.floor(num / 2)) + ' ...',
+ content.slice(-Math.floor(num / 2), end - start)].join('\n');
+ }
+ else
+ {
+ text = content.slice(0, end - start) + ' ...\n';
+ }
+ text = text.replace(Oktavia.eob, ' ').replace(/\n\n+/, '\n\n');
+ console.log(text);
+ }
+ console.log(style.convert('<summary>' + (summary.size() as string) + " results.</summary>\n"));
+ }
+
+ function notFound (summary : SearchSummary, query : string[]) : void
+ {
+ var style = this.style;
+ if (query.length > 1)
+ {
+ console.log("Suggestions:");
+ var proposals = summary.getProposal();
+ for (var i = 0; i < proposals.length; i++)
+ {
+ var proposal = proposals[i];
+ var querywords = [] : string[];
+ for (var j = 0; j < query.length; j++)
+ {
+ if (j != proposal.omit)
+ {
+ querywords.push(style.convert('<hit>' + query[j] + '</hit>'));
+ }
+ else
+ {
+ //querywords.push(style.convert('<del>' + query[j] + '</del>'));
+ }
+ }
+ console.log("* Expected result: " + querywords.join(" ") + " - " + (proposal.expect as string) + " hit");
+ }
+ }
+ else
+ {
+ console.log(style.convert("Your search - <hit>" + query[0] + "</hit> - didn't match any documents."));
+ }
+ }
+
+ function createStemmer (algorithm : string) : Stemmer
+ {
+ var stemmer : Stemmer;
+ switch (algorithm.toLowerCase())
+ {
+ case "danish":
+ stemmer = new DanishStemmer();
+ break;
+ case "dutch":
+ stemmer = new DutchStemmer();
+ break;
+ case "english":
+ stemmer = new EnglishStemmer();
+ break;
+ case "finnish":
+ stemmer = new FinnishStemmer();
+ break;
+ case "french":
+ stemmer = new FrenchStemmer();
+ break;
+ case "german":
+ stemmer = new GermanStemmer();
+ break;
+ case "hungarian":
+ stemmer = new HungarianStemmer();
+ break;
+ case "italian":
+ stemmer = new ItalianStemmer();
+ break;
+ case "norwegian":
+ stemmer = new NorwegianStemmer();
+ break;
+ case "porter":
+ stemmer = new PorterStemmer();
+ break;
+ case "portuguese":
+ stemmer = new PortugueseStemmer();
+ break;
+ case "romanian":
+ stemmer = new RomanianStemmer();
+ break;
+ case "russian":
+ stemmer = new RussianStemmer();
+ break;
+ case "spanish":
+ stemmer = new SpanishStemmer();
+ break;
+ case "swedish":
+ stemmer = new SwedishStemmer();
+ break;
+ case "turkish":
+ stemmer = new TurkishStemmer();
+ break;
+ default:
+ stemmer = new EnglishStemmer();
+ break;
+ }
+ return stemmer;
+ }
+}
+
+class _Main {
+ static function usage () : void
+ {
+ console.log([
+ "usage: oktavia_search index_file [options] query...",
+ "",
+ "Options:",
+ " -m, --mono : Don't use color.",
+ " -s, --stemmer [algorithm] : Select stemming algorithm.",
+ " -n, --number [char number] : Result display number. Default value = 250",
+ " -h, --help : Display this message.",
+ "",
+ "Search Query Syntax:",
+ " word1 word2 : All words.",
+ ' "word1 word2" : Exact words or phrase.',
+ " word1 OR word2 : Any of these words.",
+ " word1 -word2 : None of these words."
+ ].join('\n'));
+ }
+
+ static function main(args : string[]) : void
+ {
+ console.log("Search Engine Oktavia - Command-line Search Client\n");
+
+ var indexFile : Nullable.<string> = null;
+ var showhelp = false;
+ var notrun = false;
+ var styleType = 'console';
+ var num : int = 250;
+ var queryStrings = [] : string[];
+ var algorithm : Nullable.<string> = null;
+
+ var validStemmers = [
+ 'danish', 'dutch', 'english', 'finnish', 'french', 'german', 'hungarian',
+ 'italian', 'norwegian', 'porter', 'portuguese', 'romanian', 'russian',
+ 'spanish', 'swedish', 'turkish'
+ ];
+
+ if (args.length == 0)
+ {
+ showhelp = true;
+ }
+ else if (!node.fs.existsSync(args[0]))
+ {
+ console.error("Index file '" + args[0] + "' doesn't exist.");
+ notrun = true;
+ }
+ else
+ {
+ indexFile = args[0];
+ }
+
+ var optstring = "m(mono)s:(stemmer)n:(number)h(help)";
+ var parser = new BasicParser(optstring, args.slice(1));
+ var opt = parser.getopt();
+ while (opt)
+ {
+ switch (opt.option)
+ {
+ case "s":
+ if (validStemmers.indexOf(opt.optarg) == -1)
+ {
+ console.error('Option s/stemmer is invalid.');
+ notrun = true;
+ }
+ else
+ {
+ algorithm = opt.optarg;
+ }
+ break;
+ case "m":
+ styleType = 'ignore';
+ break;
+ case "n":
+ num = opt.optarg as int;
+ break;
+ case "h":
+ showhelp = true;
+ break;
+ default:
+ queryStrings.push(opt.option);
+ break;
+ }
+ opt = parser.getopt();
+ }
+ if (showhelp || queryStrings.length == 0)
+ {
+ _Main.usage();
+ }
+ else if (!notrun)
+ {
+ var style = new Style(styleType);
+ var search = new Search();
+ search.search(indexFile, queryStrings, num, style, algorithm);
+ }
+ }
+}
diff --git a/web/server/h2o/libh2o/misc/oktavia/tool/search_simple.jsx b/web/server/h2o/libh2o/misc/oktavia/tool/search_simple.jsx
new file mode 100644
index 00000000..f9b86751
--- /dev/null
+++ b/web/server/h2o/libh2o/misc/oktavia/tool/search_simple.jsx
@@ -0,0 +1,39 @@
+import "nodejs.jsx";
+import "fm_index.jsx";
+
+class _Main
+{
+ static function usage () : void
+ {
+ log "Simple FM-Index Search Engine: Oktavia";
+ log "";
+ log "[usage]";
+ log " search [input db file name] keyword";
+ }
+
+ static function main(args : string[]) : void
+ {
+ if (args.length <2)
+ {
+ _Main.usage();
+ }
+ else
+ {
+ var indexFileName = args.shift();
+ log "index file name: ", indexFileName;
+ var fm_index = new FMIndex();
+ fm_index.load(node.fs.readFileSync(indexFileName, "utf16le"));
+ for (var i in args)
+ {
+ log "[search world]", args[i];
+ var results = fm_index.search(args[i]);
+ for (var j in results)
+ {
+ var result = results[j];
+ log "[", result[0], "]: ", "(", result[1], ")";
+ }
+ log results.length, " hits";
+ }
+ }
+ }
+}
diff --git a/web/server/h2o/libh2o/misc/oktavia/tool/web/oktavia-danish-search.jsx b/web/server/h2o/libh2o/misc/oktavia/tool/web/oktavia-danish-search.jsx
new file mode 100644
index 00000000..98dba01d
--- /dev/null
+++ b/web/server/h2o/libh2o/misc/oktavia/tool/web/oktavia-danish-search.jsx
@@ -0,0 +1,10 @@
+import "oktavia-search.jsx";
+import "stemmer/danish-stemmer.jsx";
+
+class _Main
+{
+ static function main(args : string[]) : void
+ {
+ OktaviaSearch.setStemmer(new DanishStemmer);
+ }
+}
diff --git a/web/server/h2o/libh2o/misc/oktavia/tool/web/oktavia-dutch-search.jsx b/web/server/h2o/libh2o/misc/oktavia/tool/web/oktavia-dutch-search.jsx
new file mode 100644
index 00000000..117f2cce
--- /dev/null
+++ b/web/server/h2o/libh2o/misc/oktavia/tool/web/oktavia-dutch-search.jsx
@@ -0,0 +1,10 @@
+import "oktavia-search.jsx";
+import "stemmer/dutch-stemmer.jsx";
+
+class _Main
+{
+ static function main(args : string[]) : void
+ {
+ OktaviaSearch.setStemmer(new DutchStemmer);
+ }
+}
diff --git a/web/server/h2o/libh2o/misc/oktavia/tool/web/oktavia-english-search.jsx b/web/server/h2o/libh2o/misc/oktavia/tool/web/oktavia-english-search.jsx
new file mode 100644
index 00000000..d30ad2cc
--- /dev/null
+++ b/web/server/h2o/libh2o/misc/oktavia/tool/web/oktavia-english-search.jsx
@@ -0,0 +1,10 @@
+import "oktavia-search.jsx";
+import "stemmer/english-stemmer.jsx";
+
+class _Main
+{
+ static function main(args : string[]) : void
+ {
+ OktaviaSearch.setStemmer(new EnglishStemmer);
+ }
+}
diff --git a/web/server/h2o/libh2o/misc/oktavia/tool/web/oktavia-finnish-search.jsx b/web/server/h2o/libh2o/misc/oktavia/tool/web/oktavia-finnish-search.jsx
new file mode 100644
index 00000000..64006395
--- /dev/null
+++ b/web/server/h2o/libh2o/misc/oktavia/tool/web/oktavia-finnish-search.jsx
@@ -0,0 +1,10 @@
+import "oktavia-search.jsx";
+import "stemmer/finnish-stemmer.jsx";
+
+class _Main
+{
+ static function main(args : string[]) : void
+ {
+ OktaviaSearch.setStemmer(new FinnishStemmer);
+ }
+}
diff --git a/web/server/h2o/libh2o/misc/oktavia/tool/web/oktavia-french-search.jsx b/web/server/h2o/libh2o/misc/oktavia/tool/web/oktavia-french-search.jsx
new file mode 100644
index 00000000..777f5e2a
--- /dev/null
+++ b/web/server/h2o/libh2o/misc/oktavia/tool/web/oktavia-french-search.jsx
@@ -0,0 +1,10 @@
+import "oktavia-search.jsx";
+import "stemmer/french-stemmer.jsx";
+
+class _Main
+{
+ static function main(args : string[]) : void
+ {
+ OktaviaSearch.setStemmer(new FrenchStemmer);
+ }
+}
diff --git a/web/server/h2o/libh2o/misc/oktavia/tool/web/oktavia-german-search.jsx b/web/server/h2o/libh2o/misc/oktavia/tool/web/oktavia-german-search.jsx
new file mode 100644
index 00000000..58831870
--- /dev/null
+++ b/web/server/h2o/libh2o/misc/oktavia/tool/web/oktavia-german-search.jsx
@@ -0,0 +1,10 @@
+import "oktavia-search.jsx";
+import "stemmer/german-stemmer.jsx";
+
+class _Main
+{
+ static function main(args : string[]) : void
+ {
+ OktaviaSearch.setStemmer(new GermanStemmer);
+ }
+}
diff --git a/web/server/h2o/libh2o/misc/oktavia/tool/web/oktavia-hungarian-search.jsx b/web/server/h2o/libh2o/misc/oktavia/tool/web/oktavia-hungarian-search.jsx
new file mode 100644
index 00000000..a14fe345
--- /dev/null
+++ b/web/server/h2o/libh2o/misc/oktavia/tool/web/oktavia-hungarian-search.jsx
@@ -0,0 +1,10 @@
+import "oktavia-search.jsx";
+import "stemmer/hungarian-stemmer.jsx";
+
+class _Main
+{
+ static function main(args : string[]) : void
+ {
+ OktaviaSearch.setStemmer(new HungarianStemmer);
+ }
+}
diff --git a/web/server/h2o/libh2o/misc/oktavia/tool/web/oktavia-italian-search.jsx b/web/server/h2o/libh2o/misc/oktavia/tool/web/oktavia-italian-search.jsx
new file mode 100644
index 00000000..30769d1a
--- /dev/null
+++ b/web/server/h2o/libh2o/misc/oktavia/tool/web/oktavia-italian-search.jsx
@@ -0,0 +1,10 @@
+import "oktavia-search.jsx";
+import "stemmer/italian-stemmer.jsx";
+
+class _Main
+{
+ static function main(args : string[]) : void
+ {
+ OktaviaSearch.setStemmer(new ItalianStemmer);
+ }
+}
diff --git a/web/server/h2o/libh2o/misc/oktavia/tool/web/oktavia-norwegian-search.jsx b/web/server/h2o/libh2o/misc/oktavia/tool/web/oktavia-norwegian-search.jsx
new file mode 100644
index 00000000..180e6b04
--- /dev/null
+++ b/web/server/h2o/libh2o/misc/oktavia/tool/web/oktavia-norwegian-search.jsx
@@ -0,0 +1,10 @@
+import "oktavia-search.jsx";
+import "stemmer/norwegian-stemmer.jsx";
+
+class _Main
+{
+ static function main(args : string[]) : void
+ {
+ OktaviaSearch.setStemmer(new NorwegianStemmer);
+ }
+}
diff --git a/web/server/h2o/libh2o/misc/oktavia/tool/web/oktavia-porter-search.jsx b/web/server/h2o/libh2o/misc/oktavia/tool/web/oktavia-porter-search.jsx
new file mode 100644
index 00000000..ba1de086
--- /dev/null
+++ b/web/server/h2o/libh2o/misc/oktavia/tool/web/oktavia-porter-search.jsx
@@ -0,0 +1,10 @@
+import "oktavia-search.jsx";
+import "stemmer/porter-stemmer.jsx";
+
+class _Main
+{
+ static function main(args : string[]) : void
+ {
+ OktaviaSearch.setStemmer(new PorterStemmer);
+ }
+}
diff --git a/web/server/h2o/libh2o/misc/oktavia/tool/web/oktavia-portuguese-search.jsx b/web/server/h2o/libh2o/misc/oktavia/tool/web/oktavia-portuguese-search.jsx
new file mode 100644
index 00000000..89ed1a0f
--- /dev/null
+++ b/web/server/h2o/libh2o/misc/oktavia/tool/web/oktavia-portuguese-search.jsx
@@ -0,0 +1,10 @@
+import "oktavia-search.jsx";
+import "stemmer/portuguese-stemmer.jsx";
+
+class _Main
+{
+ static function main(args : string[]) : void
+ {
+ OktaviaSearch.setStemmer(new PortugueseStemmer);
+ }
+}
diff --git a/web/server/h2o/libh2o/misc/oktavia/tool/web/oktavia-romanian-search.jsx b/web/server/h2o/libh2o/misc/oktavia/tool/web/oktavia-romanian-search.jsx
new file mode 100644
index 00000000..ef8b47fc
--- /dev/null
+++ b/web/server/h2o/libh2o/misc/oktavia/tool/web/oktavia-romanian-search.jsx
@@ -0,0 +1,10 @@
+import "oktavia-search.jsx";
+import "stemmer/romanian-stemmer.jsx";
+
+class _Main
+{
+ static function main(args : string[]) : void
+ {
+ OktaviaSearch.setStemmer(new RomanianStemmer);
+ }
+}
diff --git a/web/server/h2o/libh2o/misc/oktavia/tool/web/oktavia-russian-search.jsx b/web/server/h2o/libh2o/misc/oktavia/tool/web/oktavia-russian-search.jsx
new file mode 100644
index 00000000..2a572d71
--- /dev/null
+++ b/web/server/h2o/libh2o/misc/oktavia/tool/web/oktavia-russian-search.jsx
@@ -0,0 +1,10 @@
+import "oktavia-search.jsx";
+import "stemmer/russian-stemmer.jsx";
+
+class _Main
+{
+ static function main(args : string[]) : void
+ {
+ OktaviaSearch.setStemmer(new RussianStemmer);
+ }
+}
diff --git a/web/server/h2o/libh2o/misc/oktavia/tool/web/oktavia-search.jsx b/web/server/h2o/libh2o/misc/oktavia/tool/web/oktavia-search.jsx
new file mode 100644
index 00000000..22dc3f77
--- /dev/null
+++ b/web/server/h2o/libh2o/misc/oktavia/tool/web/oktavia-search.jsx
@@ -0,0 +1,327 @@
+import "oktavia.jsx";
+import "binary-util.jsx";
+import "query.jsx";
+import "query-string-parser.jsx";
+import "search-result.jsx";
+import "style.jsx";
+import "stemmer/stemmer.jsx";
+import "console.jsx";
+
+
+class _Result
+{
+ var title : string;
+ var url : string;
+ var content : string;
+ var score : int;
+ function constructor (title : string, url : string, content : string, score : int)
+ {
+ this.title = title;
+ this.url = url;
+ this.content = content;
+ this.score = score;
+ }
+}
+
+class _Proposal
+{
+ var options : string;
+ var label : string;
+ var count : int;
+ function constructor (options : string, label : string, count : int)
+ {
+ this.options = options;
+ this.label = label;
+ this.count = count;
+ }
+}
+
+class OktaviaSearch
+{
+ var _oktavia : Oktavia;
+ static var _stemmer : Nullable.<Stemmer> = null;
+ static var _instance : Nullable.<OktaviaSearch> = null;
+ var _queryString : Nullable.<string>;
+ var _queries : Query[];
+ var _highlight : string;
+ var _callback : Nullable.<function(:int, :int):void>;
+ var _entriesPerPage : int;
+ var _currentPage : int;
+ var _result : SearchUnit[];
+ var _proposals : Proposal[];
+ var _currentFolderDepth : int;
+
+ function constructor (entriesPerPage : int)
+ {
+ this._oktavia = new Oktavia();
+ this._entriesPerPage = entriesPerPage;
+ this._currentPage = 1;
+ this._queryString = null;
+ this._callback = null;
+ OktaviaSearch._instance = this;
+ }
+
+ static function setStemmer(stemmer : Stemmer) : void
+ {
+ if (OktaviaSearch._instance)
+ {
+ OktaviaSearch._instance._oktavia.setStemmer(stemmer);
+ }
+ else
+ {
+ OktaviaSearch._stemmer = stemmer;
+ }
+ }
+
+ function loadIndex (index : string) : void
+ {
+ if (OktaviaSearch._stemmer)
+ {
+ this._oktavia.setStemmer(OktaviaSearch._stemmer);
+ }
+ this._oktavia.load(Binary.base64decode(index));
+ if (this._queryString)
+ {
+ this.search(this._queryString, this._callback);
+ this._queryString = null;
+ this._callback = null;
+ }
+ }
+
+ function search (queryString : string, callback : function(:int, :int):void) : void
+ {
+ if (this._oktavia)
+ {
+ var queryParser = new QueryStringParser();
+ this._queries = queryParser.parse(queryString);
+ this._highlight = queryParser.highlight();
+ var summary = this._oktavia.search(this._queries);
+ if (summary.size() > 0)
+ {
+ this._result = this._sortResult(summary);
+ this._proposals = [] : Proposal[];
+ this._currentPage = 1;
+ }
+ else
+ {
+ this._result = [] : SearchUnit[];
+ if (this._queries.length > 1)
+ {
+ this._proposals = summary.getProposal();
+ }
+ else
+ {
+ this._proposals = [] : Proposal[];
+ }
+ this._currentPage = 1;
+ }
+ callback(this.resultSize(), this.totalPages());
+ }
+ else
+ {
+ this._queryString = queryString;
+ this._callback = callback;
+ }
+ }
+
+ function resultSize () : int
+ {
+ return this._result.length;
+ }
+
+ function totalPages () : int
+ {
+ return Math.ceil(this._result.length / this._entriesPerPage);
+ }
+
+ function currentPage () : int
+ {
+ return this._currentPage;
+ }
+
+ function setCurrentPage (page : int) : void
+ {
+ this._currentPage = page;
+ }
+
+ function hasPrevPage () : boolean
+ {
+ return (this._currentPage != 1);
+ }
+
+ function hasNextPage () : boolean
+ {
+ return (this._currentPage != this.totalPages());
+ }
+
+ function pageIndexes () : string[]
+ {
+ var result = [] : string[];
+ var total = this.totalPages();
+ if (total < 10)
+ {
+ for (var i = 1; i <= total; i++)
+ {
+ result.push(i as string);
+ }
+ }
+ else if (this._currentPage <= 5)
+ {
+ for (var i = 1; i <= 7; i++)
+ {
+ result.push(i as string);
+ }
+ result.push('...', total as string);
+ }
+ else if (total - 5 <= this._currentPage)
+ {
+ result.push('1', '...');
+ for (var i = total - 8; i <= total; i++)
+ {
+ result.push(i as string);
+ }
+ }
+ else
+ {
+ result.push('1', '...');
+ for (var i = this._currentPage - 3; i <= this._currentPage + 3; i++)
+ {
+ result.push(i as string);
+ }
+ result.push('...', total as string);
+ }
+ return result;
+ }
+
+ function getResult () : _Result[]
+ {
+ var style = new Style('html');
+ var start = (this._currentPage - 1) * this._entriesPerPage;
+ var last = Math.min(this._currentPage * this._entriesPerPage, this._result.length);
+ var metadata = this._oktavia.getPrimaryMetadata();
+ var num = 250;
+
+ var results = [] : _Result[];
+
+ for (var i = start; i < last; i++)
+ {
+ var unit = this._result[i];
+ var info = metadata.getInformation(unit.id).split(Oktavia.eob);
+
+ var offset = info[0].length + 1;
+ var content = metadata.getContent(unit.id);
+ var start = 0;
+ var positions = unit.getPositions();
+ if (content.indexOf(info[0]) == 1)
+ {
+ content = content.slice(info[0].length + 2, content.length);
+ start += (info[0].length + 2);
+ }
+ var end = start + num;
+ var split = false;
+ if (positions[0].position > end - positions[0].word.length)
+ {
+ end = positions[0].position + Math.floor(num / 2);
+ split = true;
+ }
+ for (var j = positions.length - 1; j > -1; j--)
+ {
+ var pos = positions[j];
+ if (pos.position + pos.word.length < end)
+ {
+ content = [
+ content.slice(0, pos.position - start),
+ style.convert('<hit>*</hit>').replace('*', content.slice(pos.position - start, pos.position + pos.word.length - start)),
+ content.slice(pos.position + pos.word.length - start, content.length)
+ ].join('');
+ }
+ }
+ var text : string;
+ if (split)
+ {
+ text = [
+ content.slice(0, Math.floor(num / 2)) + ' ...',
+ content.slice(-Math.floor(num / 2), end - start)].join('<br/>');
+ }
+ else
+ {
+ text = content.slice(0, end - start) + ' ...<br/>';
+ }
+ text = text.replace(Oktavia.eob, ' ').replace(/(<br\/>)(<br\/>)+/, '<br/><br/>');
+ results.push(new _Result(info[0], info[1], text, unit.score));
+ }
+ return results;
+ }
+
+ function getHighlight () : string
+ {
+ return this._highlight;
+ }
+
+ function getProposals () : _Proposal[]
+ {
+ var style = new Style('html');
+ var results = [] : _Proposal[];
+
+ if (this._queries.length > 1)
+ {
+ for (var i = 0; i < this._proposals.length; i++)
+ {
+ var proposal = this._proposals[i];
+ if (proposal.expect > 0)
+ {
+ var label = [] : string[];
+ var option = [] : string[];
+ for (var j = 0; j < this._queries.length; j++)
+ {
+ if (j != proposal.omit)
+ {
+ label.push(style.convert('<hit>' + this._queries[j].toString() + '</hit>'));
+ option.push(this._queries[j].toString());
+ }
+ else
+ {
+ label.push(style.convert('<del>' + this._queries[j].toString() + '</del>'));
+ }
+ }
+ results.push(new _Proposal(option.join(' '), label.join('&nbsp;'), proposal.expect));
+ }
+ }
+ }
+ return results;
+ }
+
+ function _sortResult (summary : SearchSummary) : SearchUnit[]
+ {
+ for (var i = 0; i < summary.result.units.length; i++)
+ {
+ var score = 0;
+ var unit = summary.result.units[i];
+ for (var pos in unit.positions)
+ {
+ var position = unit.positions[pos];
+ if (this._oktavia.wordPositionType(position.position))
+ {
+ score += 10;
+ }
+ else
+ {
+ score += 1;
+ }
+ if (!position.stemmed)
+ {
+ score += 2;
+ }
+ }
+ unit.score = score;
+ }
+ return summary.getSortedResult();
+ }
+}
+
+class _Main
+{
+ static function main(args : string[]) : void
+ {
+ }
+}
diff --git a/web/server/h2o/libh2o/misc/oktavia/tool/web/oktavia-spanish-search.jsx b/web/server/h2o/libh2o/misc/oktavia/tool/web/oktavia-spanish-search.jsx
new file mode 100644
index 00000000..3ad9b8d1
--- /dev/null
+++ b/web/server/h2o/libh2o/misc/oktavia/tool/web/oktavia-spanish-search.jsx
@@ -0,0 +1,10 @@
+import "oktavia-search.jsx";
+import "stemmer/spanish-stemmer.jsx";
+
+class _Main
+{
+ static function main(args : string[]) : void
+ {
+ OktaviaSearch.setStemmer(new SpanishStemmer);
+ }
+}
diff --git a/web/server/h2o/libh2o/misc/oktavia/tool/web/oktavia-swedish-search.jsx b/web/server/h2o/libh2o/misc/oktavia/tool/web/oktavia-swedish-search.jsx
new file mode 100644
index 00000000..9b900a48
--- /dev/null
+++ b/web/server/h2o/libh2o/misc/oktavia/tool/web/oktavia-swedish-search.jsx
@@ -0,0 +1,10 @@
+import "oktavia-search.jsx";
+import "stemmer/swedish-stemmer.jsx";
+
+class _Main
+{
+ static function main(args : string[]) : void
+ {
+ OktaviaSearch.setStemmer(new SwedishStemmer);
+ }
+}
diff --git a/web/server/h2o/libh2o/misc/oktavia/tool/web/oktavia-turkish-search.jsx b/web/server/h2o/libh2o/misc/oktavia/tool/web/oktavia-turkish-search.jsx
new file mode 100644
index 00000000..24d04058
--- /dev/null
+++ b/web/server/h2o/libh2o/misc/oktavia/tool/web/oktavia-turkish-search.jsx
@@ -0,0 +1,10 @@
+import "oktavia-search.jsx";
+import "stemmer/turkish-stemmer.jsx";
+
+class _Main
+{
+ static function main(args : string[]) : void
+ {
+ OktaviaSearch.setStemmer(new TurkishStemmer);
+ }
+}