From b485aab7e71c1625cfc27e0f92c9509f42378458 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 5 May 2024 13:19:16 +0200 Subject: Adding upstream version 1.45.3+dfsg. Signed-off-by: Daniel Baumann --- web/server/h2o/libh2o/misc/oktavia/.gitignore | 1 - web/server/h2o/libh2o/misc/oktavia/.proverc | 4 - web/server/h2o/libh2o/misc/oktavia/.travis.yml | 12 - web/server/h2o/libh2o/misc/oktavia/LICENSE.rst | 22 - web/server/h2o/libh2o/misc/oktavia/Makefile | 54 - web/server/h2o/libh2o/misc/oktavia/README.rst | 78 - web/server/h2o/libh2o/misc/oktavia/bin/httpstatus | 7032 ------ .../h2o/libh2o/misc/oktavia/bin/oktavia-mkindex | 25034 ------------------- .../h2o/libh2o/misc/oktavia/bin/oktavia-search | 24779 ------------------ .../misc/oktavia/lib/oktavia-danish-search.js | 8023 ------ .../misc/oktavia/lib/oktavia-dutch-search.js | 8423 ------- .../misc/oktavia/lib/oktavia-english-search.js | 8922 ------- .../misc/oktavia/lib/oktavia-finnish-search.js | 8609 ------- .../misc/oktavia/lib/oktavia-french-search.js | 9061 ------- .../misc/oktavia/lib/oktavia-german-search.js | 8352 ------- .../misc/oktavia/lib/oktavia-hungarian-search.js | 8599 ------- .../misc/oktavia/lib/oktavia-italian-search.js | 8633 ------- .../misc/oktavia/lib/oktavia-jquery-highlight.js | 105 - .../libh2o/misc/oktavia/lib/oktavia-jquery-ui.js | 521 - .../misc/oktavia/lib/oktavia-norwegian-search.js | 7952 ------ .../misc/oktavia/lib/oktavia-porter-search.js | 8494 ------- .../misc/oktavia/lib/oktavia-portuguese-search.js | 8566 ------- .../misc/oktavia/lib/oktavia-romanian-search.js | 8488 ------- .../misc/oktavia/lib/oktavia-russian-search.js | 8254 ------ .../h2o/libh2o/misc/oktavia/lib/oktavia-search.js | 6795 ----- .../misc/oktavia/lib/oktavia-spanish-search.js | 8607 ------- .../misc/oktavia/lib/oktavia-swedish-search.js | 7934 ------ .../misc/oktavia/lib/oktavia-turkish-search.js | 10729 -------- .../h2o/libh2o/misc/oktavia/lib/searchstyle.css | 174 - web/server/h2o/libh2o/misc/oktavia/package.json | 23 - .../h2o/libh2o/misc/oktavia/resource/favicon.ai | 1176 - .../h2o/libh2o/misc/oktavia/resource/oktavia.eps | Bin 702054 -> 0 bytes .../libh2o/misc/oktavia/resource/oktavia_large.jpg | Bin 91592 -> 0 bytes .../misc/oktavia/resource/oktavia_medium.jpg | Bin 38493 -> 0 bytes .../libh2o/misc/oktavia/resource/oktavia_small.jpg | Bin 39534 -> 0 bytes .../h2o/libh2o/misc/oktavia/src/binary-util.jsx | 597 - .../h2o/libh2o/misc/oktavia/src/bit-vector.jsx | 295 - .../misc/oktavia/src/burrows-wheeler-transform.jsx | 73 - .../h2o/libh2o/misc/oktavia/src/csvparser.jsx | 22 - .../h2o/libh2o/misc/oktavia/src/fm-index.jsx | 323 - web/server/h2o/libh2o/misc/oktavia/src/getopt.jsx | 356 - .../h2o/libh2o/misc/oktavia/src/htmlparser.jsx | 280 - .../h2o/libh2o/misc/oktavia/src/metadata.jsx | 498 - .../h2o/libh2o/misc/oktavia/src/node-sqlite3.jsx | 115 - web/server/h2o/libh2o/misc/oktavia/src/oktavia.jsx | 427 - .../h2o/libh2o/misc/oktavia/src/query-parser.jsx | 60 - .../misc/oktavia/src/query-string-parser.jsx | 128 - web/server/h2o/libh2o/misc/oktavia/src/query.jsx | 37 - web/server/h2o/libh2o/misc/oktavia/src/sais.jsx | 250 - web/server/h2o/libh2o/misc/oktavia/src/sax.jsx | 1356 - .../h2o/libh2o/misc/oktavia/src/search-result.jsx | 287 - .../h2o/libh2o/misc/oktavia/src/stemmer/among.jsx | 34 - .../misc/oktavia/src/stemmer/base-stemmer.jsx | 419 - .../misc/oktavia/src/stemmer/danish-stemmer.jsx | 507 - .../misc/oktavia/src/stemmer/dutch-stemmer.jsx | 1020 - .../misc/oktavia/src/stemmer/english-stemmer.jsx | 1638 -- .../misc/oktavia/src/stemmer/finnish-stemmer.jsx | 1208 - .../misc/oktavia/src/stemmer/french-stemmer.jsx | 1867 -- .../misc/oktavia/src/stemmer/german-stemmer.jsx | 894 - .../misc/oktavia/src/stemmer/hungarian-stemmer.jsx | 1478 -- .../misc/oktavia/src/stemmer/italian-stemmer.jsx | 1412 -- .../misc/oktavia/src/stemmer/norwegian-stemmer.jsx | 428 - .../misc/oktavia/src/stemmer/porter-stemmer.jsx | 1121 - .../oktavia/src/stemmer/portuguese-stemmer.jsx | 1321 - .../misc/oktavia/src/stemmer/romanian-stemmer.jsx | 1227 - .../misc/oktavia/src/stemmer/russian-stemmer.jsx | 875 - .../misc/oktavia/src/stemmer/spanish-stemmer.jsx | 1408 -- .../libh2o/misc/oktavia/src/stemmer/stemmer.jsx | 5 - .../misc/oktavia/src/stemmer/swedish-stemmer.jsx | 416 - .../misc/oktavia/src/stemmer/turkish-stemmer.jsx | 3824 --- web/server/h2o/libh2o/misc/oktavia/src/style.jsx | 105 - .../h2o/libh2o/misc/oktavia/src/textparser.jsx | 25 - .../h2o/libh2o/misc/oktavia/src/tiny-segmenter.jsx | 350 - .../h2o/libh2o/misc/oktavia/src/wavelet-matrix.jsx | 321 - .../libh2o/misc/oktavia/templates/jsdoc3/README.md | 1 - .../misc/oktavia/templates/jsdoc3/publish.js | 508 - .../jsdoc3/static/scripts/jquery-1.9.1.min.js | 5 - .../static/scripts/oktavia-english-search.js | 8922 ------- .../static/scripts/oktavia-jquery-highlight.js | 105 - .../jsdoc3/static/scripts/oktavia-jquery-ui.js | 521 - .../static/scripts/prettify/Apache-License-2.0.txt | 202 - .../jsdoc3/static/scripts/prettify/lang-css.js | 2 - .../jsdoc3/static/scripts/prettify/prettify.js | 28 - .../jsdoc3/static/styles/jsdoc-default.css | 283 - .../jsdoc3/static/styles/prettify-jsdoc.css | 111 - .../jsdoc3/static/styles/prettify-tomorrow.css | 132 - .../templates/jsdoc3/static/styles/searchstyle.css | 174 - .../oktavia/templates/jsdoc3/tmpl/container.tmpl | 154 - .../oktavia/templates/jsdoc3/tmpl/details.tmpl | 98 - .../oktavia/templates/jsdoc3/tmpl/example.tmpl | 2 - .../oktavia/templates/jsdoc3/tmpl/examples.tmpl | 11 - .../oktavia/templates/jsdoc3/tmpl/exceptions.tmpl | 19 - .../misc/oktavia/templates/jsdoc3/tmpl/fires.tmpl | 4 - .../misc/oktavia/templates/jsdoc3/tmpl/layout.tmpl | 45 - .../oktavia/templates/jsdoc3/tmpl/mainpage.tmpl | 14 - .../oktavia/templates/jsdoc3/tmpl/members.tmpl | 22 - .../misc/oktavia/templates/jsdoc3/tmpl/method.tmpl | 76 - .../misc/oktavia/templates/jsdoc3/tmpl/params.tmpl | 108 - .../oktavia/templates/jsdoc3/tmpl/properties.tmpl | 107 - .../oktavia/templates/jsdoc3/tmpl/returns.tmpl | 19 - .../misc/oktavia/templates/jsdoc3/tmpl/source.tmpl | 8 - .../oktavia/templates/jsdoc3/tmpl/tutorial.tmpl | 19 - .../misc/oktavia/templates/jsdoc3/tmpl/type.tmpl | 7 - .../templates/sphinx/_static/oktavia-jquery-ui.js | 521 - .../templates/sphinx/_static/oktavia-search.js | 6795 ----- .../templates/sphinx/_static/searchstyle.css | 174 - .../templates/sphinx/_templates/layout.html | 12 - .../templates/sphinx/_templates/searchbox.html | 0 .../tinkerer/_static/oktavia-jquery-ui.js | 521 - .../templates/tinkerer/_static/oktavia-search.js | 6795 ----- .../templates/tinkerer/_static/searchstyle.css | 174 - .../tinkerer/_templates/oktaviasearch.html | 8 - .../libh2o/misc/oktavia/test/test-binary-util.jsx | 190 - .../libh2o/misc/oktavia/test/test-bit-vector.jsx | 131 - .../test/test-burrows-wheeler-transform.jsx | 24 - .../h2o/libh2o/misc/oktavia/test/test-fm-index.jsx | 250 - .../h2o/libh2o/misc/oktavia/test/test-getopt.jsx | 84 - .../misc/oktavia/test/test-oktavia-block.jsx | 226 - .../misc/oktavia/test/test-oktavia-section.jsx | 235 - .../misc/oktavia/test/test-oktavia-splitter.jsx | 173 - .../misc/oktavia/test/test-oktavia-stemming.jsx | 55 - .../misc/oktavia/test/test-oktavia-table.jsx | 213 - .../libh2o/misc/oktavia/test/test-query-parser.jsx | 92 - .../misc/oktavia/test/test-query-string-parser.jsx | 94 - .../h2o/libh2o/misc/oktavia/test/test-sax.jsx | 147 - .../misc/oktavia/test/test-search-result.jsx | 159 - .../misc/oktavia/test/test-wavelet-matrix.jsx | 143 - .../libh2o/misc/oktavia/testdata/jsx_literal.txt | 65 - .../libh2o/misc/oktavia/testdata/jsx_operator.txt | 68 - .../misc/oktavia/testdata/jsx_primitive_type.txt | 68 - .../libh2o/misc/oktavia/testdata/jsx_tutorial.txt | 213 - .../misc/oktavia/testdata/jsx_typeconversion.txt | 40 - .../h2o/libh2o/misc/oktavia/tool/httpstatus.jsx | 130 - .../libh2o/misc/oktavia/tool/oktavia-mkindex.jsx | 470 - .../libh2o/misc/oktavia/tool/oktavia-search.jsx | 370 - .../h2o/libh2o/misc/oktavia/tool/search_simple.jsx | 39 - .../oktavia/tool/web/oktavia-danish-search.jsx | 10 - .../misc/oktavia/tool/web/oktavia-dutch-search.jsx | 10 - .../oktavia/tool/web/oktavia-english-search.jsx | 10 - .../oktavia/tool/web/oktavia-finnish-search.jsx | 10 - .../oktavia/tool/web/oktavia-french-search.jsx | 10 - .../oktavia/tool/web/oktavia-german-search.jsx | 10 - .../oktavia/tool/web/oktavia-hungarian-search.jsx | 10 - .../oktavia/tool/web/oktavia-italian-search.jsx | 10 - .../oktavia/tool/web/oktavia-norwegian-search.jsx | 10 - .../oktavia/tool/web/oktavia-porter-search.jsx | 10 - .../oktavia/tool/web/oktavia-portuguese-search.jsx | 10 - .../oktavia/tool/web/oktavia-romanian-search.jsx | 10 - .../oktavia/tool/web/oktavia-russian-search.jsx | 10 - .../misc/oktavia/tool/web/oktavia-search.jsx | 327 - .../oktavia/tool/web/oktavia-spanish-search.jsx | 10 - .../oktavia/tool/web/oktavia-swedish-search.jsx | 10 - .../oktavia/tool/web/oktavia-turkish-search.jsx | 10 - 153 files changed, 261336 deletions(-) delete mode 100644 web/server/h2o/libh2o/misc/oktavia/.gitignore delete mode 100644 web/server/h2o/libh2o/misc/oktavia/.proverc delete mode 100644 web/server/h2o/libh2o/misc/oktavia/.travis.yml delete mode 100644 web/server/h2o/libh2o/misc/oktavia/LICENSE.rst delete mode 100644 web/server/h2o/libh2o/misc/oktavia/Makefile delete mode 100644 web/server/h2o/libh2o/misc/oktavia/README.rst delete mode 100755 web/server/h2o/libh2o/misc/oktavia/bin/httpstatus delete mode 100755 web/server/h2o/libh2o/misc/oktavia/bin/oktavia-mkindex delete mode 100755 web/server/h2o/libh2o/misc/oktavia/bin/oktavia-search delete mode 100644 web/server/h2o/libh2o/misc/oktavia/lib/oktavia-danish-search.js delete mode 100644 web/server/h2o/libh2o/misc/oktavia/lib/oktavia-dutch-search.js delete mode 100644 web/server/h2o/libh2o/misc/oktavia/lib/oktavia-english-search.js delete mode 100644 web/server/h2o/libh2o/misc/oktavia/lib/oktavia-finnish-search.js delete mode 100644 web/server/h2o/libh2o/misc/oktavia/lib/oktavia-french-search.js delete mode 100644 web/server/h2o/libh2o/misc/oktavia/lib/oktavia-german-search.js delete mode 100644 web/server/h2o/libh2o/misc/oktavia/lib/oktavia-hungarian-search.js delete mode 100644 web/server/h2o/libh2o/misc/oktavia/lib/oktavia-italian-search.js delete mode 100644 web/server/h2o/libh2o/misc/oktavia/lib/oktavia-jquery-highlight.js delete mode 100644 web/server/h2o/libh2o/misc/oktavia/lib/oktavia-jquery-ui.js delete mode 100644 web/server/h2o/libh2o/misc/oktavia/lib/oktavia-norwegian-search.js delete mode 100644 web/server/h2o/libh2o/misc/oktavia/lib/oktavia-porter-search.js delete mode 100644 web/server/h2o/libh2o/misc/oktavia/lib/oktavia-portuguese-search.js delete mode 100644 web/server/h2o/libh2o/misc/oktavia/lib/oktavia-romanian-search.js delete mode 100644 web/server/h2o/libh2o/misc/oktavia/lib/oktavia-russian-search.js delete mode 100644 web/server/h2o/libh2o/misc/oktavia/lib/oktavia-search.js delete mode 100644 web/server/h2o/libh2o/misc/oktavia/lib/oktavia-spanish-search.js delete mode 100644 web/server/h2o/libh2o/misc/oktavia/lib/oktavia-swedish-search.js delete mode 100644 web/server/h2o/libh2o/misc/oktavia/lib/oktavia-turkish-search.js delete mode 100644 web/server/h2o/libh2o/misc/oktavia/lib/searchstyle.css delete mode 100644 web/server/h2o/libh2o/misc/oktavia/package.json delete mode 100644 web/server/h2o/libh2o/misc/oktavia/resource/favicon.ai delete mode 100644 web/server/h2o/libh2o/misc/oktavia/resource/oktavia.eps delete mode 100644 web/server/h2o/libh2o/misc/oktavia/resource/oktavia_large.jpg delete mode 100644 web/server/h2o/libh2o/misc/oktavia/resource/oktavia_medium.jpg delete mode 100644 web/server/h2o/libh2o/misc/oktavia/resource/oktavia_small.jpg delete mode 100644 web/server/h2o/libh2o/misc/oktavia/src/binary-util.jsx delete mode 100644 web/server/h2o/libh2o/misc/oktavia/src/bit-vector.jsx delete mode 100644 web/server/h2o/libh2o/misc/oktavia/src/burrows-wheeler-transform.jsx delete mode 100644 web/server/h2o/libh2o/misc/oktavia/src/csvparser.jsx delete mode 100644 web/server/h2o/libh2o/misc/oktavia/src/fm-index.jsx delete mode 100644 web/server/h2o/libh2o/misc/oktavia/src/getopt.jsx delete mode 100644 web/server/h2o/libh2o/misc/oktavia/src/htmlparser.jsx delete mode 100644 web/server/h2o/libh2o/misc/oktavia/src/metadata.jsx delete mode 100644 web/server/h2o/libh2o/misc/oktavia/src/node-sqlite3.jsx delete mode 100644 web/server/h2o/libh2o/misc/oktavia/src/oktavia.jsx delete mode 100644 web/server/h2o/libh2o/misc/oktavia/src/query-parser.jsx delete mode 100644 web/server/h2o/libh2o/misc/oktavia/src/query-string-parser.jsx delete mode 100644 web/server/h2o/libh2o/misc/oktavia/src/query.jsx delete mode 100644 web/server/h2o/libh2o/misc/oktavia/src/sais.jsx delete mode 100644 web/server/h2o/libh2o/misc/oktavia/src/sax.jsx delete mode 100644 web/server/h2o/libh2o/misc/oktavia/src/search-result.jsx delete mode 100644 web/server/h2o/libh2o/misc/oktavia/src/stemmer/among.jsx delete mode 100644 web/server/h2o/libh2o/misc/oktavia/src/stemmer/base-stemmer.jsx delete mode 100644 web/server/h2o/libh2o/misc/oktavia/src/stemmer/danish-stemmer.jsx delete mode 100644 web/server/h2o/libh2o/misc/oktavia/src/stemmer/dutch-stemmer.jsx delete mode 100644 web/server/h2o/libh2o/misc/oktavia/src/stemmer/english-stemmer.jsx delete mode 100644 web/server/h2o/libh2o/misc/oktavia/src/stemmer/finnish-stemmer.jsx delete mode 100644 web/server/h2o/libh2o/misc/oktavia/src/stemmer/french-stemmer.jsx delete mode 100644 web/server/h2o/libh2o/misc/oktavia/src/stemmer/german-stemmer.jsx delete mode 100644 web/server/h2o/libh2o/misc/oktavia/src/stemmer/hungarian-stemmer.jsx delete mode 100644 web/server/h2o/libh2o/misc/oktavia/src/stemmer/italian-stemmer.jsx delete mode 100644 web/server/h2o/libh2o/misc/oktavia/src/stemmer/norwegian-stemmer.jsx delete mode 100644 web/server/h2o/libh2o/misc/oktavia/src/stemmer/porter-stemmer.jsx delete mode 100644 web/server/h2o/libh2o/misc/oktavia/src/stemmer/portuguese-stemmer.jsx delete mode 100644 web/server/h2o/libh2o/misc/oktavia/src/stemmer/romanian-stemmer.jsx delete mode 100644 web/server/h2o/libh2o/misc/oktavia/src/stemmer/russian-stemmer.jsx delete mode 100644 web/server/h2o/libh2o/misc/oktavia/src/stemmer/spanish-stemmer.jsx delete mode 100644 web/server/h2o/libh2o/misc/oktavia/src/stemmer/stemmer.jsx delete mode 100644 web/server/h2o/libh2o/misc/oktavia/src/stemmer/swedish-stemmer.jsx delete mode 100644 web/server/h2o/libh2o/misc/oktavia/src/stemmer/turkish-stemmer.jsx delete mode 100644 web/server/h2o/libh2o/misc/oktavia/src/style.jsx delete mode 100644 web/server/h2o/libh2o/misc/oktavia/src/textparser.jsx delete mode 100644 web/server/h2o/libh2o/misc/oktavia/src/tiny-segmenter.jsx delete mode 100644 web/server/h2o/libh2o/misc/oktavia/src/wavelet-matrix.jsx delete mode 100644 web/server/h2o/libh2o/misc/oktavia/templates/jsdoc3/README.md delete mode 100644 web/server/h2o/libh2o/misc/oktavia/templates/jsdoc3/publish.js delete mode 100644 web/server/h2o/libh2o/misc/oktavia/templates/jsdoc3/static/scripts/jquery-1.9.1.min.js delete mode 100644 web/server/h2o/libh2o/misc/oktavia/templates/jsdoc3/static/scripts/oktavia-english-search.js delete mode 100644 web/server/h2o/libh2o/misc/oktavia/templates/jsdoc3/static/scripts/oktavia-jquery-highlight.js delete mode 100644 web/server/h2o/libh2o/misc/oktavia/templates/jsdoc3/static/scripts/oktavia-jquery-ui.js delete mode 100644 web/server/h2o/libh2o/misc/oktavia/templates/jsdoc3/static/scripts/prettify/Apache-License-2.0.txt delete mode 100644 web/server/h2o/libh2o/misc/oktavia/templates/jsdoc3/static/scripts/prettify/lang-css.js delete mode 100644 web/server/h2o/libh2o/misc/oktavia/templates/jsdoc3/static/scripts/prettify/prettify.js delete mode 100644 web/server/h2o/libh2o/misc/oktavia/templates/jsdoc3/static/styles/jsdoc-default.css delete mode 100644 web/server/h2o/libh2o/misc/oktavia/templates/jsdoc3/static/styles/prettify-jsdoc.css delete mode 100644 web/server/h2o/libh2o/misc/oktavia/templates/jsdoc3/static/styles/prettify-tomorrow.css delete mode 100644 web/server/h2o/libh2o/misc/oktavia/templates/jsdoc3/static/styles/searchstyle.css delete mode 100644 web/server/h2o/libh2o/misc/oktavia/templates/jsdoc3/tmpl/container.tmpl delete mode 100644 web/server/h2o/libh2o/misc/oktavia/templates/jsdoc3/tmpl/details.tmpl delete mode 100644 web/server/h2o/libh2o/misc/oktavia/templates/jsdoc3/tmpl/example.tmpl delete mode 100644 web/server/h2o/libh2o/misc/oktavia/templates/jsdoc3/tmpl/examples.tmpl delete mode 100644 web/server/h2o/libh2o/misc/oktavia/templates/jsdoc3/tmpl/exceptions.tmpl delete mode 100644 web/server/h2o/libh2o/misc/oktavia/templates/jsdoc3/tmpl/fires.tmpl delete mode 100644 web/server/h2o/libh2o/misc/oktavia/templates/jsdoc3/tmpl/layout.tmpl delete mode 100644 web/server/h2o/libh2o/misc/oktavia/templates/jsdoc3/tmpl/mainpage.tmpl delete mode 100644 web/server/h2o/libh2o/misc/oktavia/templates/jsdoc3/tmpl/members.tmpl delete mode 100644 web/server/h2o/libh2o/misc/oktavia/templates/jsdoc3/tmpl/method.tmpl delete mode 100644 web/server/h2o/libh2o/misc/oktavia/templates/jsdoc3/tmpl/params.tmpl delete mode 100644 web/server/h2o/libh2o/misc/oktavia/templates/jsdoc3/tmpl/properties.tmpl delete mode 100644 web/server/h2o/libh2o/misc/oktavia/templates/jsdoc3/tmpl/returns.tmpl delete mode 100644 web/server/h2o/libh2o/misc/oktavia/templates/jsdoc3/tmpl/source.tmpl delete mode 100644 web/server/h2o/libh2o/misc/oktavia/templates/jsdoc3/tmpl/tutorial.tmpl delete mode 100644 web/server/h2o/libh2o/misc/oktavia/templates/jsdoc3/tmpl/type.tmpl delete mode 100644 web/server/h2o/libh2o/misc/oktavia/templates/sphinx/_static/oktavia-jquery-ui.js delete mode 100644 web/server/h2o/libh2o/misc/oktavia/templates/sphinx/_static/oktavia-search.js delete mode 100644 web/server/h2o/libh2o/misc/oktavia/templates/sphinx/_static/searchstyle.css delete mode 100644 web/server/h2o/libh2o/misc/oktavia/templates/sphinx/_templates/layout.html delete mode 100644 web/server/h2o/libh2o/misc/oktavia/templates/sphinx/_templates/searchbox.html delete mode 100644 web/server/h2o/libh2o/misc/oktavia/templates/tinkerer/_static/oktavia-jquery-ui.js delete mode 100644 web/server/h2o/libh2o/misc/oktavia/templates/tinkerer/_static/oktavia-search.js delete mode 100644 web/server/h2o/libh2o/misc/oktavia/templates/tinkerer/_static/searchstyle.css delete mode 100644 web/server/h2o/libh2o/misc/oktavia/templates/tinkerer/_templates/oktaviasearch.html delete mode 100644 web/server/h2o/libh2o/misc/oktavia/test/test-binary-util.jsx delete mode 100644 web/server/h2o/libh2o/misc/oktavia/test/test-bit-vector.jsx delete mode 100644 web/server/h2o/libh2o/misc/oktavia/test/test-burrows-wheeler-transform.jsx delete mode 100644 web/server/h2o/libh2o/misc/oktavia/test/test-fm-index.jsx delete mode 100644 web/server/h2o/libh2o/misc/oktavia/test/test-getopt.jsx delete mode 100644 web/server/h2o/libh2o/misc/oktavia/test/test-oktavia-block.jsx delete mode 100644 web/server/h2o/libh2o/misc/oktavia/test/test-oktavia-section.jsx delete mode 100644 web/server/h2o/libh2o/misc/oktavia/test/test-oktavia-splitter.jsx delete mode 100644 web/server/h2o/libh2o/misc/oktavia/test/test-oktavia-stemming.jsx delete mode 100644 web/server/h2o/libh2o/misc/oktavia/test/test-oktavia-table.jsx delete mode 100644 web/server/h2o/libh2o/misc/oktavia/test/test-query-parser.jsx delete mode 100644 web/server/h2o/libh2o/misc/oktavia/test/test-query-string-parser.jsx delete mode 100644 web/server/h2o/libh2o/misc/oktavia/test/test-sax.jsx delete mode 100644 web/server/h2o/libh2o/misc/oktavia/test/test-search-result.jsx delete mode 100644 web/server/h2o/libh2o/misc/oktavia/test/test-wavelet-matrix.jsx delete mode 100644 web/server/h2o/libh2o/misc/oktavia/testdata/jsx_literal.txt delete mode 100644 web/server/h2o/libh2o/misc/oktavia/testdata/jsx_operator.txt delete mode 100644 web/server/h2o/libh2o/misc/oktavia/testdata/jsx_primitive_type.txt delete mode 100644 web/server/h2o/libh2o/misc/oktavia/testdata/jsx_tutorial.txt delete mode 100644 web/server/h2o/libh2o/misc/oktavia/testdata/jsx_typeconversion.txt delete mode 100644 web/server/h2o/libh2o/misc/oktavia/tool/httpstatus.jsx delete mode 100644 web/server/h2o/libh2o/misc/oktavia/tool/oktavia-mkindex.jsx delete mode 100644 web/server/h2o/libh2o/misc/oktavia/tool/oktavia-search.jsx delete mode 100644 web/server/h2o/libh2o/misc/oktavia/tool/search_simple.jsx delete mode 100644 web/server/h2o/libh2o/misc/oktavia/tool/web/oktavia-danish-search.jsx delete mode 100644 web/server/h2o/libh2o/misc/oktavia/tool/web/oktavia-dutch-search.jsx delete mode 100644 web/server/h2o/libh2o/misc/oktavia/tool/web/oktavia-english-search.jsx delete mode 100644 web/server/h2o/libh2o/misc/oktavia/tool/web/oktavia-finnish-search.jsx delete mode 100644 web/server/h2o/libh2o/misc/oktavia/tool/web/oktavia-french-search.jsx delete mode 100644 web/server/h2o/libh2o/misc/oktavia/tool/web/oktavia-german-search.jsx delete mode 100644 web/server/h2o/libh2o/misc/oktavia/tool/web/oktavia-hungarian-search.jsx delete mode 100644 web/server/h2o/libh2o/misc/oktavia/tool/web/oktavia-italian-search.jsx delete mode 100644 web/server/h2o/libh2o/misc/oktavia/tool/web/oktavia-norwegian-search.jsx delete mode 100644 web/server/h2o/libh2o/misc/oktavia/tool/web/oktavia-porter-search.jsx delete mode 100644 web/server/h2o/libh2o/misc/oktavia/tool/web/oktavia-portuguese-search.jsx delete mode 100644 web/server/h2o/libh2o/misc/oktavia/tool/web/oktavia-romanian-search.jsx delete mode 100644 web/server/h2o/libh2o/misc/oktavia/tool/web/oktavia-russian-search.jsx delete mode 100644 web/server/h2o/libh2o/misc/oktavia/tool/web/oktavia-search.jsx delete mode 100644 web/server/h2o/libh2o/misc/oktavia/tool/web/oktavia-spanish-search.jsx delete mode 100644 web/server/h2o/libh2o/misc/oktavia/tool/web/oktavia-swedish-search.jsx delete mode 100644 web/server/h2o/libh2o/misc/oktavia/tool/web/oktavia-turkish-search.jsx (limited to 'web/server/h2o/libh2o/misc/oktavia') diff --git a/web/server/h2o/libh2o/misc/oktavia/.gitignore b/web/server/h2o/libh2o/misc/oktavia/.gitignore deleted file mode 100644 index 10d00b579..000000000 --- a/web/server/h2o/libh2o/misc/oktavia/.gitignore +++ /dev/null @@ -1 +0,0 @@ -*.gz diff --git a/web/server/h2o/libh2o/misc/oktavia/.proverc b/web/server/h2o/libh2o/misc/oktavia/.proverc deleted file mode 100644 index ab863e4f3..000000000 --- a/web/server/h2o/libh2o/misc/oktavia/.proverc +++ /dev/null @@ -1,4 +0,0 @@ ---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 deleted file mode 100644 index 0cf13fe47..000000000 --- a/web/server/h2o/libh2o/misc/oktavia/.travis.yml +++ /dev/null @@ -1,12 +0,0 @@ -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 deleted file mode 100644 index 5db7f172a..000000000 --- a/web/server/h2o/libh2o/misc/oktavia/LICENSE.rst +++ /dev/null @@ -1,22 +0,0 @@ -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 deleted file mode 100644 index b0fecfb83..000000000 --- a/web/server/h2o/libh2o/misc/oktavia/Makefile +++ /dev/null @@ -1,54 +0,0 @@ -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 deleted file mode 100644 index 4617c550f..000000000 --- a/web/server/h2o/libh2o/misc/oktavia/README.rst +++ /dev/null @@ -1,78 +0,0 @@ -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 deleted file mode 100755 index 40d13cd77..000000000 --- a/web/server/h2o/libh2o/misc/oktavia/bin/httpstatus +++ /dev/null @@ -1,7032 +0,0 @@ -#!/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.} words - * @return {!string} - */ -HTTPStatus.prototype.search$AS = function (words) { - /** @type {QueryParser} */ - var queryParser; - /** @type {Array.} */ - var queries; - /** @type {!string} */ - var result; - /** @type {SearchSummary} */ - var summary; - /** @type {Array.} */ - 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.} 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.} */ - 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.} 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.} */ - 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.} */ - 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.} */ - 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.} */ - 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.} - */ -Oktavia.prototype.rawSearch$SB = function (keyword, stemming) { - /** @type {Array.} */ - var result; - /** @type {!string} */ - var baseWord; - /** @type {Array.} */ - 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.} 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.} */ - 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.} */ - 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.} */ - 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.} 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.} */ - 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.} */ - 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.} 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.} 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.} 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.} - */ -Table.prototype.getCell$I = function (position) { - /** @type {!number} */ - var row; - /** @type {!number} */ - var currentColumn; - /** @type {!number} */ - var lastRowColumn; - /** @type {!number} */ - var startPosition; - /** @type {Array.} */ - 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.} - */ -Table.prototype.getRowContent$I = function (rowIndex) { - /** @type {!string} */ - var content; - /** @type {Array.} */ - var values; - /** @type {Object.} */ - 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.} 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.} 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.} queryStrings - * @return {Array.} - */ -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.} */ - 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.} */ - 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.} */ - var pos; - pos = [ ]; - return this.getRows$SAI(key, pos); -}; - -/** - * @param {!string} key - * @param {Array.} 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.} */ - 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.} */ - 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.} - */ -FMIndex.prototype.search$S = function (keyword) { - /** @type {Array.} */ - var result; - /** @type {Array.} */ - 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.} */ - 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.} */ - 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.} */ - var charCodes; - /** @type {!number} */ - var i; - /** @type {!number} */ - var charCode; - /** @type {Array.} */ - 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.} strList - * @return {!string} - */ -Binary.dumpStringList$AS = function (strList) { - return Binary$dumpStringList$ASLCompressionReport$(strList, null); -}; - -var Binary$dumpStringList$AS = Binary.dumpStringList$AS; - -/** - * @param {Array.} strList - * @param {CompressionReport} report - * @return {!string} - */ -Binary.dumpStringList$ASLCompressionReport$ = function (strList, report) { - /** @type {Array.} */ - 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.>} strMap - * @return {!string} - */ -Binary.dumpStringListMap$HAS = function (strMap) { - return Binary$dumpStringListMap$HASLCompressionReport$(strMap, null); -}; - -var Binary$dumpStringListMap$HAS = Binary.dumpStringListMap$HAS; - -/** - * @param {Object.>} strMap - * @param {CompressionReport} report - * @return {!string} - */ -Binary.dumpStringListMap$HASLCompressionReport$ = function (strMap, report) { - /** @type {Array.} */ - 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.} array - * @return {!string} - */ -Binary.dump32bitNumberList$AN = function (array) { - return Binary$dump32bitNumberList$ANLCompressionReport$(array, null); -}; - -var Binary$dump32bitNumberList$AN = Binary.dump32bitNumberList$AN; - -/** - * @param {Array.} array - * @param {CompressionReport} report - * @return {!string} - */ -Binary.dump32bitNumberList$ANLCompressionReport$ = function (array, report) { - /** @type {Array.} */ - 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.} 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.} */ - 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.} 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.} 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.} array - * @param {!number} offset - * @param {!number} length - * @return {!string} - */ -Binary._nonZeroBlock$ANII = function (array, offset, length) { - /** @type {Array.} */ - 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.} array - * @param {!number} offset - * @return {!string} - */ -Binary._createZebraCode$ANI = function (array, offset) { - /** @type {!number} */ - var last; - /** @type {!number} */ - var code; - /** @type {Array.} */ - 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.} */ - var out; - /** @type {Array.} */ - 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.} source - * @return {!string} - */ -Binary._mergeCharCode$AI = function (source) { - /** @type {Array.} */ - 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.} */ - 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.} */ - 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.} */ - 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.} */ - 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.} */ - 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.} - */ -SearchUnit.getPositions$LSearchUnit$ = function ($this) { - /** @type {Array.} */ - 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.} */ - var unitIds$0; - /** @type {Array.} */ - 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.} 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.} - */ -SearchSummary.getProposal$LSearchSummary$ = function ($this) { - /** @type {Array.} */ - var proposals; - /** @type {!number} */ - var i; - /** @type {Array.} */ - 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.} - */ -SearchSummary.getSortedResult$LSearchSummary$ = function ($this) { - /** @type {Array.} */ - var result; - /** @type {Array.} */ - 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.} */ - var _v$0; - /** @type {Array.} */ - 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.} */ - 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.} */ - 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.} 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.} 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.} 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.} 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.} 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.} 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.} words - * @return {Array.} - */ -BaseStemmer.prototype.stemWords$AS = function (words) { - /** @type {Array.} */ - 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.} */ - var _bv$0; - /** @type {Array.} */ - 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.} */ - var range_tmp; - /** @type {!number} */ - var code; - /** @type {!boolean} */ - var bit; - /** @type {!number} */ - var key; - /** @type {Object.} */ - 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.} */ - 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.} */ - var contents; - /** @type {!number} */ - var i; - /** @type {Array.} */ - 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.} */ - var contents; - /** @type {!number} */ - var i; - /** @type {Array.} */ - 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.} input - * @return {Object.} - */ -WaveletMatrix._shallow_copy$HI = function (input) { - /** @type {Object.} */ - 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.} */ - 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.} */ - 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.} array - */ -function OArray$AI(array) { - this.array = array; - this.offset = 0; -}; - -OArray$AI.prototype = new OArray; - -/** - * @constructor - * @param {Array.} 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.} */ - 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.} */ - 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.} 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.} SA - * @param {OArray} s - * @param {Array.} 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.} SA - * @param {OArray} s - * @param {Array.} 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.} - */ -SAIS.make$S = function (source) { - /** @type {Array.} */ - var charCodes; - /** @type {!number} */ - var maxCode; - /** @type {!number} */ - var i; - /** @type {!number} */ - var code; - /** @type {Array.} */ - 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.} 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.} */ - 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.} */ - 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 deleted file mode 100755 index b0171b536..000000000 --- a/web/server/h2o/libh2o/misc/oktavia/bin/oktavia-mkindex +++ /dev/null @@ -1,25034 +0,0 @@ -#!/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.} args - */ -_Main.main$AS = function (args) { - /** @type {Array.} */ - 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.} */ - var filter; - /** @type {undefined|!string} */ - var algorithm; - /** @type {undefined|!string} */ - var wordsplitter; - /** @type {!number} */ - var cacheDensity; - /** @type {undefined|!string} */ - var name; - /** @type {Array.} */ - var validModes; - /** @type {Array.} */ - var validUnitsForHTML; - /** @type {Array.} */ - var validUnitsForText; - /** @type {Array.} */ - var validStemmers; - /** @type {Array.} */ - var validTypes; - /** @type {BasicParser} */ - var parser; - /** @type {CommandOption} */ - var opt; - /** @type {Array.} */ - var items; - /** @type {!number} */ - var i; - /** @type {Array.} */ - var match; - /** @type {!number} */ - var tmpValue; - /** @type {Array.} */ - var inputTextFiles; - /** @type {Array.} */ - var inputHTMLFiles; - /** @type {Array.} */ - 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.} */ - 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.} texts - * @param {Array.} HTMLs - * @param {Array.} CSVs - */ -_Main._checkFileType$SASASAS = function (path, texts, HTMLs, CSVs) { - /** @type {Array.} */ - 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.} texts - * @param {Array.} HTMLs - * @param {Array.} CSVs - */ -_Main._checkDirectory$SASASAS = function (path, texts, HTMLs, CSVs) { - /** @type {Array.} */ - 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.} */ - 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.} 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.} */ - 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.} */ - 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.} */ - 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.} */ - 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.} - */ -Oktavia.prototype.rawSearch$SB = function (keyword, stemming) { - /** @type {Array.} */ - var result; - /** @type {!string} */ - var baseWord; - /** @type {Array.} */ - 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.} 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.} */ - 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.} */ - 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.} */ - 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.} 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.} 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.} 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.} 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.} */ - 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.} */ - var charCodes; - /** @type {!number} */ - var i; - /** @type {!number} */ - var charCode; - /** @type {Array.} */ - 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.} strList - * @return {!string} - */ -Binary.dumpStringList$AS = function (strList) { - return Binary$dumpStringList$ASLCompressionReport$(strList, null); -}; - -var Binary$dumpStringList$AS = Binary.dumpStringList$AS; - -/** - * @param {Array.} strList - * @param {CompressionReport} report - * @return {!string} - */ -Binary.dumpStringList$ASLCompressionReport$ = function (strList, report) { - /** @type {Array.} */ - 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.>} strMap - * @return {!string} - */ -Binary.dumpStringListMap$HAS = function (strMap) { - return Binary$dumpStringListMap$HASLCompressionReport$(strMap, null); -}; - -var Binary$dumpStringListMap$HAS = Binary.dumpStringListMap$HAS; - -/** - * @param {Object.>} strMap - * @param {CompressionReport} report - * @return {!string} - */ -Binary.dumpStringListMap$HASLCompressionReport$ = function (strMap, report) { - /** @type {Array.} */ - 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.} array - * @return {!string} - */ -Binary.dump32bitNumberList$AN = function (array) { - return Binary$dump32bitNumberList$ANLCompressionReport$(array, null); -}; - -var Binary$dump32bitNumberList$AN = Binary.dump32bitNumberList$AN; - -/** - * @param {Array.} array - * @param {CompressionReport} report - * @return {!string} - */ -Binary.dump32bitNumberList$ANLCompressionReport$ = function (array, report) { - /** @type {Array.} */ - 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.} 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.} */ - 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.} 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.} 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.} array - * @param {!number} offset - * @param {!number} length - * @return {!string} - */ -Binary._nonZeroBlock$ANII = function (array, offset, length) { - /** @type {Array.} */ - 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.} array - * @param {!number} offset - * @return {!string} - */ -Binary._createZebraCode$ANI = function (array, offset) { - /** @type {!number} */ - var last; - /** @type {!number} */ - var code; - /** @type {Array.} */ - 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.} */ - var out; - /** @type {Array.} */ - 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.} source - * @return {!string} - */ -Binary._mergeCharCode$AI = function (source) { - /** @type {Array.} */ - 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.} */ - 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.} */ - 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.} */ - 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.} */ - 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.} 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.} */ - 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.} */ - 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.} 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.} 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.} 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.} - */ -Table.prototype.getCell$I = function (position) { - /** @type {!number} */ - var row; - /** @type {!number} */ - var currentColumn; - /** @type {!number} */ - var lastRowColumn; - /** @type {!number} */ - var startPosition; - /** @type {Array.} */ - 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.} - */ -Table.prototype.getRowContent$I = function (rowIndex) { - /** @type {!string} */ - var content; - /** @type {Array.} */ - var values; - /** @type {Object.} */ - 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.} 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.} 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.} */ - 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.} */ - var pos; - pos = [ ]; - return this.getRows$SAI(key, pos); -}; - -/** - * @param {!string} key - * @param {Array.} 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.} */ - 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.} */ - 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.} - */ -FMIndex.prototype.search$S = function (keyword) { - /** @type {Array.} */ - var result; - /** @type {Array.} */ - 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.} */ - 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.} */ - 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.} - */ -SearchUnit.getPositions$LSearchUnit$ = function ($this) { - /** @type {Array.} */ - 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.} */ - var unitIds$0; - /** @type {Array.} */ - 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.} 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.} - */ -SearchSummary.getProposal$LSearchSummary$ = function ($this) { - /** @type {Array.} */ - var proposals; - /** @type {!number} */ - var i; - /** @type {Array.} */ - 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.} - */ -SearchSummary.getSortedResult$LSearchSummary$ = function ($this) { - /** @type {Array.} */ - var result; - /** @type {Array.} */ - 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.} 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.} attributes - */ -_HTMLHandler.prototype.onopentag$SHS = function (tagname, attributes) { - /** @type {Array.} */ - 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.} */ - var charclass$0; - /** @type {Object.} */ - var charclass$1; - /** @type {RegExp} */ - var charclass$2; - /** @type {Object.} */ - var charclass$3; - /** @type {Object.} */ - var charclass$4; - /** @type {Object.} */ - var charclass$5; - /** @type {!string} */ - var text$0; - /** @type {Object.} */ - var charclass$6; - /** @type {RegExp} */ - var charclass$7; - /** @type {Object.} */ - var charclass$8; - /** @type {Object.} */ - var charclass$9; - /** @type {RegExp} */ - var charclass$10; - /** @type {Object.} */ - var charclass$11; - /** @type {RegExp} */ - var charclass$12; - /** @type {Object.} */ - var charclass$13; - /** @type {RegExp} */ - var charclass$14; - /** @type {Object.} */ - var charclass$15; - /** @type {Object.} */ - var charclass$16; - /** @type {Object.} */ - var charclass$17; - /** @type {Object.} */ - var charclass$18; - /** @type {RegExp} */ - var charclass$19; - /** @type {RegExp} */ - var charclass$20; - /** @type {Object.} */ - var charclass$21; - /** @type {Object.} */ - var charclass$22; - /** @type {Object.} */ - var charclass$23; - /** @type {Object.} */ - 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 += "") { - this.closeTag$(); - } else { - charclass$20 = _.nameBody; - if (charclass$20.test(c)) { - this.tagName += c; - } else { - if (this.script) { - this.script += "") { - 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.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.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.} - */ -Char.prototype._charClass$S = function (str) { - /** @type {Object.} */ - 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.} 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.} 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.} - */ -_Entities.entity_list$ = function () { - /** @type {Object.} */ - 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.} 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.} 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.} 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.} 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.} 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.} 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.} words - * @return {Array.} - */ -BaseStemmer.prototype.stemWords$AS = function (words) { - /** @type {Array.} */ - 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.} */ - var _v$0; - /** @type {Array.} */ - 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.} */ - 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.} */ - 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.} */ - var _bv$0; - /** @type {Array.} */ - 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.} */ - var range_tmp; - /** @type {!number} */ - var code; - /** @type {!boolean} */ - var bit; - /** @type {!number} */ - var key; - /** @type {Object.} */ - 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.} */ - 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.} */ - var contents; - /** @type {!number} */ - var i; - /** @type {Array.} */ - 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.} */ - var contents; - /** @type {!number} */ - var i; - /** @type {Array.} */ - 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.} input - * @return {Object.} - */ -WaveletMatrix._shallow_copy$HI = function (input) { - /** @type {Object.} */ - 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.} */ - 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.} */ - 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.} array - */ -function OArray$AI(array) { - this.array = array; - this.offset = 0; -}; - -OArray$AI.prototype = new OArray; - -/** - * @constructor - * @param {Array.} 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.} */ - 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.} */ - 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.} 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.} SA - * @param {OArray} s - * @param {Array.} 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.} SA - * @param {OArray} s - * @param {Array.} 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.} - */ -SAIS.make$S = function (source) { - /** @type {Array.} */ - var charCodes; - /** @type {!number} */ - var maxCode; - /** @type {!number} */ - var i; - /** @type {!number} */ - var code; - /** @type {Array.} */ - 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.} 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.} */ - 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.} */ - 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 deleted file mode 100755 index 33edd769d..000000000 --- a/web/server/h2o/libh2o/misc/oktavia/bin/oktavia-search +++ /dev/null @@ -1,24779 +0,0 @@ -#!/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.} 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.} - */ -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.} */ - var results; - /** @type {Style} */ - var style; - /** @type {Metadata} */ - var metadata; - /** @type {!number} */ - var i; - /** @type {SearchUnit} */ - var unit; - /** @type {Array.} */ - var info; - /** @type {!string} */ - var content; - /** @type {!number} */ - var start; - /** @type {Array.} */ - 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('' + info[0] + '') + ' ' + style.convert$S('' + info[1] + '')); - 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('*').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('' + (SearchSummary$size$LSearchSummary$(summary) + "") + " results.\n")); -}; - -var Search$showResult$LSearch$LOktavia$LSearchSummary$I = Search.showResult$LSearch$LOktavia$LSearchSummary$I; - -/** - * @param {Search} $this - * @param {SearchSummary} summary - * @param {Array.} query - */ -Search.notFound$LSearch$LSearchSummary$AS = function ($this, summary, query) { - /** @type {Style} */ - var style; - /** @type {Array.} */ - var proposals; - /** @type {!number} */ - var i; - /** @type {Proposal} */ - var proposal; - /** @type {Array.} */ - 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('' + query[j] + '')); - } - } - console.log("* Expected result: " + querywords.join(" ") + " - " + (proposal.expect + "") + " hit"); - } - } else { - console.log(style.convert$S("Your search - " + query[0] + " - 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.} 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.} */ - var queryStrings; - /** @type {undefined|!string} */ - var algorithm; - /** @type {Array.} */ - 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.} */ - 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.} 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.} */ - 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.} */ - 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.} */ - 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.} */ - 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.} - */ -Oktavia.prototype.rawSearch$SB = function (keyword, stemming) { - /** @type {Array.} */ - var result; - /** @type {!string} */ - var baseWord; - /** @type {Array.} */ - 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.} 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.} */ - 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.} */ - 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.} */ - 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.} 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.} queryStrings - * @return {Array.} - */ -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.} */ - 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.} - */ -SearchUnit.getPositions$LSearchUnit$ = function ($this) { - /** @type {Array.} */ - 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.} */ - var unitIds$0; - /** @type {Array.} */ - 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.} 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.} - */ -SearchSummary.getProposal$LSearchSummary$ = function ($this) { - /** @type {Array.} */ - var proposals; - /** @type {!number} */ - var i; - /** @type {Array.} */ - 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.} - */ -SearchSummary.getSortedResult$LSearchSummary$ = function ($this) { - /** @type {Array.} */ - var result; - /** @type {Array.} */ - 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.} */ - 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.} */ - var charCodes; - /** @type {!number} */ - var i; - /** @type {!number} */ - var charCode; - /** @type {Array.} */ - 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.} strList - * @return {!string} - */ -Binary.dumpStringList$AS = function (strList) { - return Binary$dumpStringList$ASLCompressionReport$(strList, null); -}; - -var Binary$dumpStringList$AS = Binary.dumpStringList$AS; - -/** - * @param {Array.} strList - * @param {CompressionReport} report - * @return {!string} - */ -Binary.dumpStringList$ASLCompressionReport$ = function (strList, report) { - /** @type {Array.} */ - 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.>} strMap - * @return {!string} - */ -Binary.dumpStringListMap$HAS = function (strMap) { - return Binary$dumpStringListMap$HASLCompressionReport$(strMap, null); -}; - -var Binary$dumpStringListMap$HAS = Binary.dumpStringListMap$HAS; - -/** - * @param {Object.>} strMap - * @param {CompressionReport} report - * @return {!string} - */ -Binary.dumpStringListMap$HASLCompressionReport$ = function (strMap, report) { - /** @type {Array.} */ - 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.} array - * @return {!string} - */ -Binary.dump32bitNumberList$AN = function (array) { - return Binary$dump32bitNumberList$ANLCompressionReport$(array, null); -}; - -var Binary$dump32bitNumberList$AN = Binary.dump32bitNumberList$AN; - -/** - * @param {Array.} array - * @param {CompressionReport} report - * @return {!string} - */ -Binary.dump32bitNumberList$ANLCompressionReport$ = function (array, report) { - /** @type {Array.} */ - 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.} 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.} */ - 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.} 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.} 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.} array - * @param {!number} offset - * @param {!number} length - * @return {!string} - */ -Binary._nonZeroBlock$ANII = function (array, offset, length) { - /** @type {Array.} */ - 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.} array - * @param {!number} offset - * @return {!string} - */ -Binary._createZebraCode$ANI = function (array, offset) { - /** @type {!number} */ - var last; - /** @type {!number} */ - var code; - /** @type {Array.} */ - 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.} */ - var out; - /** @type {Array.} */ - 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.} source - * @return {!string} - */ -Binary._mergeCharCode$AI = function (source) { - /** @type {Array.} */ - 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.} */ - 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.} */ - 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.} */ - 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.} */ - 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.} 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.} */ - 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.} */ - 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.} 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.} 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.} 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.} - */ -Table.prototype.getCell$I = function (position) { - /** @type {!number} */ - var row; - /** @type {!number} */ - var currentColumn; - /** @type {!number} */ - var lastRowColumn; - /** @type {!number} */ - var startPosition; - /** @type {Array.} */ - 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.} - */ -Table.prototype.getRowContent$I = function (rowIndex) { - /** @type {!string} */ - var content; - /** @type {Array.} */ - var values; - /** @type {Object.} */ - 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.} 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.} 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.} */ - 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.} */ - var pos; - pos = [ ]; - return this.getRows$SAI(key, pos); -}; - -/** - * @param {!string} key - * @param {Array.} 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.} */ - 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.} */ - 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.} - */ -FMIndex.prototype.search$S = function (keyword) { - /** @type {Array.} */ - var result; - /** @type {Array.} */ - 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.} */ - 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.} */ - 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.} 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.>} 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, "
").replace(/&/g, "&").replace(/"/g, """).replace(//g, ">"); -}; - -var _HTMLHandler$escapeHTML$S = _HTMLHandler.escapeHTML$S; - -/** - * @param {!string} tagname - * @param {Object.} 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, "
").replace(/&/g, "&").replace(/"/g, """).replace(//g, ">")); - } 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.} */ - var charclass$0; - /** @type {Object.} */ - var charclass$1; - /** @type {RegExp} */ - var charclass$2; - /** @type {Object.} */ - var charclass$3; - /** @type {Object.} */ - var charclass$4; - /** @type {Object.} */ - var charclass$5; - /** @type {!string} */ - var text$0; - /** @type {Object.} */ - var charclass$6; - /** @type {RegExp} */ - var charclass$7; - /** @type {Object.} */ - var charclass$8; - /** @type {Object.} */ - var charclass$9; - /** @type {RegExp} */ - var charclass$10; - /** @type {Object.} */ - var charclass$11; - /** @type {RegExp} */ - var charclass$12; - /** @type {Object.} */ - var charclass$13; - /** @type {RegExp} */ - var charclass$14; - /** @type {Object.} */ - var charclass$15; - /** @type {Object.} */ - var charclass$16; - /** @type {Object.} */ - var charclass$17; - /** @type {Object.} */ - var charclass$18; - /** @type {RegExp} */ - var charclass$19; - /** @type {RegExp} */ - var charclass$20; - /** @type {Object.} */ - var charclass$21; - /** @type {Object.} */ - var charclass$22; - /** @type {Object.} */ - var charclass$23; - /** @type {Object.} */ - 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 += "") { - this.closeTag$(); - } else { - charclass$20 = _.nameBody; - if (charclass$20.test(c)) { - this.tagName += c; - } else { - if (this.script) { - this.script += "") { - 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.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.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.} - */ -Char.prototype._charClass$S = function (str) { - /** @type {Object.} */ - 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.} 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.} 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.} - */ -_Entities.entity_list$ = function () { - /** @type {Object.} */ - 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.} 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.} 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.} 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.} 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.} 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.} 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.} words - * @return {Array.} - */ -BaseStemmer.prototype.stemWords$AS = function (words) { - /** @type {Array.} */ - 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.} */ - var _v$0; - /** @type {Array.} */ - 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.} */ - 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.} */ - 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.} */ - var _bv$0; - /** @type {Array.} */ - 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.} */ - var range_tmp; - /** @type {!number} */ - var code; - /** @type {!boolean} */ - var bit; - /** @type {!number} */ - var key; - /** @type {Object.} */ - 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.} */ - 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.} */ - var contents; - /** @type {!number} */ - var i; - /** @type {Array.} */ - 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.} */ - var contents; - /** @type {!number} */ - var i; - /** @type {Array.} */ - 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.} input - * @return {Object.} - */ -WaveletMatrix._shallow_copy$HI = function (input) { - /** @type {Object.} */ - 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.} */ - 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.} */ - 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.} array - */ -function OArray$AI(array) { - this.array = array; - this.offset = 0; -}; - -OArray$AI.prototype = new OArray; - -/** - * @constructor - * @param {Array.} 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.} */ - 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.} */ - 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.} 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.} SA - * @param {OArray} s - * @param {Array.} 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.} SA - * @param {OArray} s - * @param {Array.} 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.} - */ -SAIS.make$S = function (source) { - /** @type {Array.} */ - var charCodes; - /** @type {!number} */ - var maxCode; - /** @type {!number} */ - var i; - /** @type {!number} */ - var code; - /** @type {Array.} */ - 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.} 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.} */ - 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.} */ - 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': [ '', '' ], 'url': [ '', '' ], 'hit': [ '', '' ], 'del': [ '', '' ], 'summary': [ '', '' ] }); -}); -$__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 deleted file mode 100644 index e0d209e85..000000000 --- a/web/server/h2o/libh2o/misc/oktavia/lib/oktavia-danish-search.js +++ /dev/null @@ -1,8023 +0,0 @@ -// 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.} 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.} */ - 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.} - */ -OktaviaSearch.prototype.pageIndexes$ = function () { - /** @type {Array.} */ - 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.} - */ -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.} */ - var results; - /** @type {!number} */ - var i; - /** @type {SearchUnit} */ - var unit; - /** @type {Array.} */ - var info; - /** @type {!string} */ - var content; - /** @type {Array.} */ - 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('*').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('
'); - } else { - text = content.slice(0, end - start) + ' ...
'; - } - text = text.replace(Oktavia.eob, ' ').replace(/()()+/, '

'); - 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.} - */ -OktaviaSearch.prototype.getProposals$ = function () { - /** @type {Style} */ - var style; - /** @type {Array.} */ - var results; - /** @type {!number} */ - var i; - /** @type {Proposal} */ - var proposal; - /** @type {Array.} */ - var label; - /** @type {Array.} */ - 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('' + this._queries[j].toString() + '')); - option.push(this._queries[j].toString()); - } else { - label.push(style.convert$S('' + this._queries[j].toString() + '')); - } - } - results.push(({options: option.join(' '), label: label.join(' '), count: proposal.expect})); - } - } - } - return results; -}; - -/** - * @param {SearchSummary} summary - * @return {Array.} - */ -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.} 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.} */ - 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.} 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.} */ - 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.} */ - 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.} */ - 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.} */ - 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.} - */ -Oktavia.prototype.rawSearch$SB = function (keyword, stemming) { - /** @type {Array.} */ - var result; - /** @type {!string} */ - var baseWord; - /** @type {Array.} */ - 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.} 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.} */ - 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.} */ - 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.} */ - 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.} */ - 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.} */ - var charCodes; - /** @type {!number} */ - var i; - /** @type {!number} */ - var charCode; - /** @type {Array.} */ - 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.} strList - * @return {!string} - */ -Binary.dumpStringList$AS = function (strList) { - return Binary$dumpStringList$ASLCompressionReport$(strList, null); -}; - -var Binary$dumpStringList$AS = Binary.dumpStringList$AS; - -/** - * @param {Array.} strList - * @param {CompressionReport} report - * @return {!string} - */ -Binary.dumpStringList$ASLCompressionReport$ = function (strList, report) { - /** @type {Array.} */ - 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.>} strMap - * @return {!string} - */ -Binary.dumpStringListMap$HAS = function (strMap) { - return Binary$dumpStringListMap$HASLCompressionReport$(strMap, null); -}; - -var Binary$dumpStringListMap$HAS = Binary.dumpStringListMap$HAS; - -/** - * @param {Object.>} strMap - * @param {CompressionReport} report - * @return {!string} - */ -Binary.dumpStringListMap$HASLCompressionReport$ = function (strMap, report) { - /** @type {Array.} */ - 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.} array - * @return {!string} - */ -Binary.dump32bitNumberList$AN = function (array) { - return Binary$dump32bitNumberList$ANLCompressionReport$(array, null); -}; - -var Binary$dump32bitNumberList$AN = Binary.dump32bitNumberList$AN; - -/** - * @param {Array.} array - * @param {CompressionReport} report - * @return {!string} - */ -Binary.dump32bitNumberList$ANLCompressionReport$ = function (array, report) { - /** @type {Array.} */ - 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.} 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.} */ - 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.} 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.} 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.} array - * @param {!number} offset - * @param {!number} length - * @return {!string} - */ -Binary._nonZeroBlock$ANII = function (array, offset, length) { - /** @type {Array.} */ - 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.} array - * @param {!number} offset - * @return {!string} - */ -Binary._createZebraCode$ANI = function (array, offset) { - /** @type {!number} */ - var last; - /** @type {!number} */ - var code; - /** @type {Array.} */ - 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.} */ - var out; - /** @type {Array.} */ - 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.} source - * @return {!string} - */ -Binary._mergeCharCode$AI = function (source) { - /** @type {Array.} */ - 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.} */ - 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.} */ - 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.} */ - 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.} */ - 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.} */ - 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.} - */ -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.} */ - 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.} - */ -SearchUnit.getPositions$LSearchUnit$ = function ($this) { - /** @type {Array.} */ - 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.} */ - var unitIds$0; - /** @type {Array.} */ - 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.} 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.} - */ -SearchSummary.getProposal$LSearchSummary$ = function ($this) { - /** @type {Array.} */ - var proposals; - /** @type {!number} */ - var i; - /** @type {Array.} */ - 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.} - */ -SearchSummary.getSortedResult$LSearchSummary$ = function ($this) { - /** @type {Array.} */ - var result; - /** @type {Array.} */ - 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.} 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.} 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.} 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.} 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.} 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.} 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.} words - * @return {Array.} - */ -BaseStemmer.prototype.stemWords$AS = function (words) { - /** @type {Array.} */ - 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.} 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.} */ - 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.} */ - 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.} 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.} 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.} 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.} - */ -Table.prototype.getCell$I = function (position) { - /** @type {!number} */ - var row; - /** @type {!number} */ - var currentColumn; - /** @type {!number} */ - var lastRowColumn; - /** @type {!number} */ - var startPosition; - /** @type {Array.} */ - 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.} - */ -Table.prototype.getRowContent$I = function (rowIndex) { - /** @type {!string} */ - var content; - /** @type {Array.} */ - var values; - /** @type {Object.} */ - 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.} 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.} 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.} */ - 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.} */ - var pos; - pos = [ ]; - return this.getRows$SAI(key, pos); -}; - -/** - * @param {!string} key - * @param {Array.} 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.} */ - 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.} */ - 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.} - */ -FMIndex.prototype.search$S = function (keyword) { - /** @type {Array.} */ - var result; - /** @type {Array.} */ - 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.} */ - 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.} 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.>} 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, "
").replace(/&/g, "&").replace(/"/g, """).replace(//g, ">"); -}; - -var _HTMLHandler$escapeHTML$S = _HTMLHandler.escapeHTML$S; - -/** - * @param {!string} tagname - * @param {Object.} 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, "
").replace(/&/g, "&").replace(/"/g, """).replace(//g, ">")); - } 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.} */ - var charclass$0; - /** @type {Object.} */ - var charclass$1; - /** @type {RegExp} */ - var charclass$2; - /** @type {Object.} */ - var charclass$3; - /** @type {Object.} */ - var charclass$4; - /** @type {Object.} */ - var charclass$5; - /** @type {!string} */ - var text$0; - /** @type {Object.} */ - var charclass$6; - /** @type {RegExp} */ - var charclass$7; - /** @type {Object.} */ - var charclass$8; - /** @type {Object.} */ - var charclass$9; - /** @type {RegExp} */ - var charclass$10; - /** @type {Object.} */ - var charclass$11; - /** @type {RegExp} */ - var charclass$12; - /** @type {Object.} */ - var charclass$13; - /** @type {RegExp} */ - var charclass$14; - /** @type {Object.} */ - var charclass$15; - /** @type {Object.} */ - var charclass$16; - /** @type {Object.} */ - var charclass$17; - /** @type {Object.} */ - var charclass$18; - /** @type {RegExp} */ - var charclass$19; - /** @type {RegExp} */ - var charclass$20; - /** @type {Object.} */ - var charclass$21; - /** @type {Object.} */ - var charclass$22; - /** @type {Object.} */ - var charclass$23; - /** @type {Object.} */ - 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 += "") { - this.closeTag$(); - } else { - charclass$20 = _.nameBody; - if (charclass$20.test(c)) { - this.tagName += c; - } else { - if (this.script) { - this.script += "") { - 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.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.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.} - */ -Char.prototype._charClass$S = function (str) { - /** @type {Object.} */ - 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.} 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.} 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.} - */ -_Entities.entity_list$ = function () { - /** @type {Object.} */ - 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.} */ - var _v$0; - /** @type {Array.} */ - 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.} */ - 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.} */ - 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.} */ - var _bv$0; - /** @type {Array.} */ - 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.} */ - var range_tmp; - /** @type {!number} */ - var code; - /** @type {!boolean} */ - var bit; - /** @type {!number} */ - var key; - /** @type {Object.} */ - 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.} */ - 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.} */ - var contents; - /** @type {!number} */ - var i; - /** @type {Array.} */ - 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.} */ - var contents; - /** @type {!number} */ - var i; - /** @type {Array.} */ - 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.} input - * @return {Object.} - */ -WaveletMatrix._shallow_copy$HI = function (input) { - /** @type {Object.} */ - 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.} */ - 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.} */ - 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.} array - */ -function OArray$AI(array) { - this.array = array; - this.offset = 0; -}; - -OArray$AI.prototype = new OArray; - -/** - * @constructor - * @param {Array.} 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.} */ - 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.} */ - 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.} 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.} SA - * @param {OArray} s - * @param {Array.} 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.} SA - * @param {OArray} s - * @param {Array.} 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.} - */ -SAIS.make$S = function (source) { - /** @type {Array.} */ - var charCodes; - /** @type {!number} */ - var maxCode; - /** @type {!number} */ - var i; - /** @type {!number} */ - var code; - /** @type {Array.} */ - 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.} 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.} */ - 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.} */ - 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': [ '', '' ], 'url': [ '', '' ], 'hit': [ '', '' ], 'del': [ '', '' ], 'summary': [ '', '' ] }); -}); -$__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 deleted file mode 100644 index 4f46e2fc7..000000000 --- a/web/server/h2o/libh2o/misc/oktavia/lib/oktavia-dutch-search.js +++ /dev/null @@ -1,8423 +0,0 @@ -// 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.} 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.} */ - 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.} - */ -OktaviaSearch.prototype.pageIndexes$ = function () { - /** @type {Array.} */ - 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.} - */ -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.} */ - var results; - /** @type {!number} */ - var i; - /** @type {SearchUnit} */ - var unit; - /** @type {Array.} */ - var info; - /** @type {!string} */ - var content; - /** @type {Array.} */ - 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('*').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('
'); - } else { - text = content.slice(0, end - start) + ' ...
'; - } - text = text.replace(Oktavia.eob, ' ').replace(/()()+/, '

'); - 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.} - */ -OktaviaSearch.prototype.getProposals$ = function () { - /** @type {Style} */ - var style; - /** @type {Array.} */ - var results; - /** @type {!number} */ - var i; - /** @type {Proposal} */ - var proposal; - /** @type {Array.} */ - var label; - /** @type {Array.} */ - 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('' + this._queries[j].toString() + '')); - option.push(this._queries[j].toString()); - } else { - label.push(style.convert$S('' + this._queries[j].toString() + '')); - } - } - results.push(({options: option.join(' '), label: label.join(' '), count: proposal.expect})); - } - } - } - return results; -}; - -/** - * @param {SearchSummary} summary - * @return {Array.} - */ -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.} 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.} */ - 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.} 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.} */ - 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.} */ - 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.} */ - 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.} */ - 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.} - */ -Oktavia.prototype.rawSearch$SB = function (keyword, stemming) { - /** @type {Array.} */ - var result; - /** @type {!string} */ - var baseWord; - /** @type {Array.} */ - 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.} 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.} */ - 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.} */ - 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.} */ - 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.} */ - 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.} */ - var charCodes; - /** @type {!number} */ - var i; - /** @type {!number} */ - var charCode; - /** @type {Array.} */ - 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.} strList - * @return {!string} - */ -Binary.dumpStringList$AS = function (strList) { - return Binary$dumpStringList$ASLCompressionReport$(strList, null); -}; - -var Binary$dumpStringList$AS = Binary.dumpStringList$AS; - -/** - * @param {Array.} strList - * @param {CompressionReport} report - * @return {!string} - */ -Binary.dumpStringList$ASLCompressionReport$ = function (strList, report) { - /** @type {Array.} */ - 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.>} strMap - * @return {!string} - */ -Binary.dumpStringListMap$HAS = function (strMap) { - return Binary$dumpStringListMap$HASLCompressionReport$(strMap, null); -}; - -var Binary$dumpStringListMap$HAS = Binary.dumpStringListMap$HAS; - -/** - * @param {Object.>} strMap - * @param {CompressionReport} report - * @return {!string} - */ -Binary.dumpStringListMap$HASLCompressionReport$ = function (strMap, report) { - /** @type {Array.} */ - 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.} array - * @return {!string} - */ -Binary.dump32bitNumberList$AN = function (array) { - return Binary$dump32bitNumberList$ANLCompressionReport$(array, null); -}; - -var Binary$dump32bitNumberList$AN = Binary.dump32bitNumberList$AN; - -/** - * @param {Array.} array - * @param {CompressionReport} report - * @return {!string} - */ -Binary.dump32bitNumberList$ANLCompressionReport$ = function (array, report) { - /** @type {Array.} */ - 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.} 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.} */ - 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.} 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.} 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.} array - * @param {!number} offset - * @param {!number} length - * @return {!string} - */ -Binary._nonZeroBlock$ANII = function (array, offset, length) { - /** @type {Array.} */ - 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.} array - * @param {!number} offset - * @return {!string} - */ -Binary._createZebraCode$ANI = function (array, offset) { - /** @type {!number} */ - var last; - /** @type {!number} */ - var code; - /** @type {Array.} */ - 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.} */ - var out; - /** @type {Array.} */ - 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.} source - * @return {!string} - */ -Binary._mergeCharCode$AI = function (source) { - /** @type {Array.} */ - 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.} */ - 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.} */ - 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.} */ - 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.} */ - 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.} */ - 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.} - */ -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.} */ - 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.} - */ -SearchUnit.getPositions$LSearchUnit$ = function ($this) { - /** @type {Array.} */ - 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.} */ - var unitIds$0; - /** @type {Array.} */ - 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.} 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.} - */ -SearchSummary.getProposal$LSearchSummary$ = function ($this) { - /** @type {Array.} */ - var proposals; - /** @type {!number} */ - var i; - /** @type {Array.} */ - 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.} - */ -SearchSummary.getSortedResult$LSearchSummary$ = function ($this) { - /** @type {Array.} */ - var result; - /** @type {Array.} */ - 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.} 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.} 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.} 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.} 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.} 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.} 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.} words - * @return {Array.} - */ -BaseStemmer.prototype.stemWords$AS = function (words) { - /** @type {Array.} */ - 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.} 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.} */ - 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.} */ - 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.} 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.} 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.} 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.} - */ -Table.prototype.getCell$I = function (position) { - /** @type {!number} */ - var row; - /** @type {!number} */ - var currentColumn; - /** @type {!number} */ - var lastRowColumn; - /** @type {!number} */ - var startPosition; - /** @type {Array.} */ - 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.} - */ -Table.prototype.getRowContent$I = function (rowIndex) { - /** @type {!string} */ - var content; - /** @type {Array.} */ - var values; - /** @type {Object.} */ - 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.} 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.} 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.} */ - 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.} */ - var pos; - pos = [ ]; - return this.getRows$SAI(key, pos); -}; - -/** - * @param {!string} key - * @param {Array.} 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.} */ - 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.} */ - 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.} - */ -FMIndex.prototype.search$S = function (keyword) { - /** @type {Array.} */ - var result; - /** @type {Array.} */ - 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.} */ - 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.} 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.>} 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, "
").replace(/&/g, "&").replace(/"/g, """).replace(//g, ">"); -}; - -var _HTMLHandler$escapeHTML$S = _HTMLHandler.escapeHTML$S; - -/** - * @param {!string} tagname - * @param {Object.} 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, "
").replace(/&/g, "&").replace(/"/g, """).replace(//g, ">")); - } 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.} */ - var charclass$0; - /** @type {Object.} */ - var charclass$1; - /** @type {RegExp} */ - var charclass$2; - /** @type {Object.} */ - var charclass$3; - /** @type {Object.} */ - var charclass$4; - /** @type {Object.} */ - var charclass$5; - /** @type {!string} */ - var text$0; - /** @type {Object.} */ - var charclass$6; - /** @type {RegExp} */ - var charclass$7; - /** @type {Object.} */ - var charclass$8; - /** @type {Object.} */ - var charclass$9; - /** @type {RegExp} */ - var charclass$10; - /** @type {Object.} */ - var charclass$11; - /** @type {RegExp} */ - var charclass$12; - /** @type {Object.} */ - var charclass$13; - /** @type {RegExp} */ - var charclass$14; - /** @type {Object.} */ - var charclass$15; - /** @type {Object.} */ - var charclass$16; - /** @type {Object.} */ - var charclass$17; - /** @type {Object.} */ - var charclass$18; - /** @type {RegExp} */ - var charclass$19; - /** @type {RegExp} */ - var charclass$20; - /** @type {Object.} */ - var charclass$21; - /** @type {Object.} */ - var charclass$22; - /** @type {Object.} */ - var charclass$23; - /** @type {Object.} */ - 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 += "") { - this.closeTag$(); - } else { - charclass$20 = _.nameBody; - if (charclass$20.test(c)) { - this.tagName += c; - } else { - if (this.script) { - this.script += "") { - 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.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.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.} - */ -Char.prototype._charClass$S = function (str) { - /** @type {Object.} */ - 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.} 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.} 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.} - */ -_Entities.entity_list$ = function () { - /** @type {Object.} */ - 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.} */ - var _v$0; - /** @type {Array.} */ - 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.} */ - 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.} */ - 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.} */ - var _bv$0; - /** @type {Array.} */ - 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.} */ - var range_tmp; - /** @type {!number} */ - var code; - /** @type {!boolean} */ - var bit; - /** @type {!number} */ - var key; - /** @type {Object.} */ - 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.} */ - 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.} */ - var contents; - /** @type {!number} */ - var i; - /** @type {Array.} */ - 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.} */ - var contents; - /** @type {!number} */ - var i; - /** @type {Array.} */ - 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.} input - * @return {Object.} - */ -WaveletMatrix._shallow_copy$HI = function (input) { - /** @type {Object.} */ - 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.} */ - 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.} */ - 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.} array - */ -function OArray$AI(array) { - this.array = array; - this.offset = 0; -}; - -OArray$AI.prototype = new OArray; - -/** - * @constructor - * @param {Array.} 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.} */ - 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.} */ - 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.} 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.} SA - * @param {OArray} s - * @param {Array.} 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.} SA - * @param {OArray} s - * @param {Array.} 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.} - */ -SAIS.make$S = function (source) { - /** @type {Array.} */ - var charCodes; - /** @type {!number} */ - var maxCode; - /** @type {!number} */ - var i; - /** @type {!number} */ - var code; - /** @type {Array.} */ - 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.} 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.} */ - 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.} */ - 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': [ '', '' ], 'url': [ '', '' ], 'hit': [ '', '' ], 'del': [ '', '' ], 'summary': [ '', '' ] }); -}); -$__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 deleted file mode 100644 index cf5c38f3a..000000000 --- a/web/server/h2o/libh2o/misc/oktavia/lib/oktavia-english-search.js +++ /dev/null @@ -1,8922 +0,0 @@ -// 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.} 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.} */ - 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.} - */ -OktaviaSearch.prototype.pageIndexes$ = function () { - /** @type {Array.} */ - 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.} - */ -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.} */ - var results; - /** @type {!number} */ - var i; - /** @type {SearchUnit} */ - var unit; - /** @type {Array.} */ - var info; - /** @type {!string} */ - var content; - /** @type {Array.} */ - 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('*').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('
'); - } else { - text = content.slice(0, end - start) + ' ...
'; - } - text = text.replace(Oktavia.eob, ' ').replace(/()()+/, '

'); - 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.} - */ -OktaviaSearch.prototype.getProposals$ = function () { - /** @type {Style} */ - var style; - /** @type {Array.} */ - var results; - /** @type {!number} */ - var i; - /** @type {Proposal} */ - var proposal; - /** @type {Array.} */ - var label; - /** @type {Array.} */ - 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('' + this._queries[j].toString() + '')); - option.push(this._queries[j].toString()); - } else { - label.push(style.convert$S('' + this._queries[j].toString() + '')); - } - } - results.push(({options: option.join(' '), label: label.join(' '), count: proposal.expect})); - } - } - } - return results; -}; - -/** - * @param {SearchSummary} summary - * @return {Array.} - */ -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.} 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.} */ - 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.} 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.} */ - 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.} */ - 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.} */ - 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.} */ - 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.} - */ -Oktavia.prototype.rawSearch$SB = function (keyword, stemming) { - /** @type {Array.} */ - var result; - /** @type {!string} */ - var baseWord; - /** @type {Array.} */ - 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.} 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.} */ - 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.} */ - 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.} */ - 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.} */ - 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.} */ - var charCodes; - /** @type {!number} */ - var i; - /** @type {!number} */ - var charCode; - /** @type {Array.} */ - 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.} strList - * @return {!string} - */ -Binary.dumpStringList$AS = function (strList) { - return Binary$dumpStringList$ASLCompressionReport$(strList, null); -}; - -var Binary$dumpStringList$AS = Binary.dumpStringList$AS; - -/** - * @param {Array.} strList - * @param {CompressionReport} report - * @return {!string} - */ -Binary.dumpStringList$ASLCompressionReport$ = function (strList, report) { - /** @type {Array.} */ - 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.>} strMap - * @return {!string} - */ -Binary.dumpStringListMap$HAS = function (strMap) { - return Binary$dumpStringListMap$HASLCompressionReport$(strMap, null); -}; - -var Binary$dumpStringListMap$HAS = Binary.dumpStringListMap$HAS; - -/** - * @param {Object.>} strMap - * @param {CompressionReport} report - * @return {!string} - */ -Binary.dumpStringListMap$HASLCompressionReport$ = function (strMap, report) { - /** @type {Array.} */ - 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.} array - * @return {!string} - */ -Binary.dump32bitNumberList$AN = function (array) { - return Binary$dump32bitNumberList$ANLCompressionReport$(array, null); -}; - -var Binary$dump32bitNumberList$AN = Binary.dump32bitNumberList$AN; - -/** - * @param {Array.} array - * @param {CompressionReport} report - * @return {!string} - */ -Binary.dump32bitNumberList$ANLCompressionReport$ = function (array, report) { - /** @type {Array.} */ - 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.} 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.} */ - 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.} 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.} 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.} array - * @param {!number} offset - * @param {!number} length - * @return {!string} - */ -Binary._nonZeroBlock$ANII = function (array, offset, length) { - /** @type {Array.} */ - 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.} array - * @param {!number} offset - * @return {!string} - */ -Binary._createZebraCode$ANI = function (array, offset) { - /** @type {!number} */ - var last; - /** @type {!number} */ - var code; - /** @type {Array.} */ - 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.} */ - var out; - /** @type {Array.} */ - 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.} source - * @return {!string} - */ -Binary._mergeCharCode$AI = function (source) { - /** @type {Array.} */ - 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.} */ - 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.} */ - 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.} */ - 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.} */ - 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.} */ - 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.} - */ -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.} */ - 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.} - */ -SearchUnit.getPositions$LSearchUnit$ = function ($this) { - /** @type {Array.} */ - 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.} */ - var unitIds$0; - /** @type {Array.} */ - 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.} 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.} - */ -SearchSummary.getProposal$LSearchSummary$ = function ($this) { - /** @type {Array.} */ - var proposals; - /** @type {!number} */ - var i; - /** @type {Array.} */ - 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.} - */ -SearchSummary.getSortedResult$LSearchSummary$ = function ($this) { - /** @type {Array.} */ - var result; - /** @type {Array.} */ - 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.} 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.} 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.} 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.} 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.} 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.} 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.} words - * @return {Array.} - */ -BaseStemmer.prototype.stemWords$AS = function (words) { - /** @type {Array.} */ - 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.} 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.} */ - 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.} */ - 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.} 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.} 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.} 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.} - */ -Table.prototype.getCell$I = function (position) { - /** @type {!number} */ - var row; - /** @type {!number} */ - var currentColumn; - /** @type {!number} */ - var lastRowColumn; - /** @type {!number} */ - var startPosition; - /** @type {Array.} */ - 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.} - */ -Table.prototype.getRowContent$I = function (rowIndex) { - /** @type {!string} */ - var content; - /** @type {Array.} */ - var values; - /** @type {Object.} */ - 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.} 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.} 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.} */ - 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.} */ - var pos; - pos = [ ]; - return this.getRows$SAI(key, pos); -}; - -/** - * @param {!string} key - * @param {Array.} 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.} */ - 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.} */ - 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.} - */ -FMIndex.prototype.search$S = function (keyword) { - /** @type {Array.} */ - var result; - /** @type {Array.} */ - 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.} */ - 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.} 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.>} 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, "
").replace(/&/g, "&").replace(/"/g, """).replace(//g, ">"); -}; - -var _HTMLHandler$escapeHTML$S = _HTMLHandler.escapeHTML$S; - -/** - * @param {!string} tagname - * @param {Object.} 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, "
").replace(/&/g, "&").replace(/"/g, """).replace(//g, ">")); - } 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.} */ - var charclass$0; - /** @type {Object.} */ - var charclass$1; - /** @type {RegExp} */ - var charclass$2; - /** @type {Object.} */ - var charclass$3; - /** @type {Object.} */ - var charclass$4; - /** @type {Object.} */ - var charclass$5; - /** @type {!string} */ - var text$0; - /** @type {Object.} */ - var charclass$6; - /** @type {RegExp} */ - var charclass$7; - /** @type {Object.} */ - var charclass$8; - /** @type {Object.} */ - var charclass$9; - /** @type {RegExp} */ - var charclass$10; - /** @type {Object.} */ - var charclass$11; - /** @type {RegExp} */ - var charclass$12; - /** @type {Object.} */ - var charclass$13; - /** @type {RegExp} */ - var charclass$14; - /** @type {Object.} */ - var charclass$15; - /** @type {Object.} */ - var charclass$16; - /** @type {Object.} */ - var charclass$17; - /** @type {Object.} */ - var charclass$18; - /** @type {RegExp} */ - var charclass$19; - /** @type {RegExp} */ - var charclass$20; - /** @type {Object.} */ - var charclass$21; - /** @type {Object.} */ - var charclass$22; - /** @type {Object.} */ - var charclass$23; - /** @type {Object.} */ - 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 += "") { - this.closeTag$(); - } else { - charclass$20 = _.nameBody; - if (charclass$20.test(c)) { - this.tagName += c; - } else { - if (this.script) { - this.script += "") { - 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.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.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.} - */ -Char.prototype._charClass$S = function (str) { - /** @type {Object.} */ - 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.} 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.} 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.} - */ -_Entities.entity_list$ = function () { - /** @type {Object.} */ - 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.} */ - var _v$0; - /** @type {Array.} */ - 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.} */ - 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.} */ - 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.} */ - var _bv$0; - /** @type {Array.} */ - 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.} */ - var range_tmp; - /** @type {!number} */ - var code; - /** @type {!boolean} */ - var bit; - /** @type {!number} */ - var key; - /** @type {Object.} */ - 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.} */ - 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.} */ - var contents; - /** @type {!number} */ - var i; - /** @type {Array.} */ - 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.} */ - var contents; - /** @type {!number} */ - var i; - /** @type {Array.} */ - 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.} input - * @return {Object.} - */ -WaveletMatrix._shallow_copy$HI = function (input) { - /** @type {Object.} */ - 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.} */ - 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.} */ - 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.} array - */ -function OArray$AI(array) { - this.array = array; - this.offset = 0; -}; - -OArray$AI.prototype = new OArray; - -/** - * @constructor - * @param {Array.} 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.} */ - 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.} */ - 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.} 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.} SA - * @param {OArray} s - * @param {Array.} 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.} SA - * @param {OArray} s - * @param {Array.} 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.} - */ -SAIS.make$S = function (source) { - /** @type {Array.} */ - var charCodes; - /** @type {!number} */ - var maxCode; - /** @type {!number} */ - var i; - /** @type {!number} */ - var code; - /** @type {Array.} */ - 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.} 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.} */ - 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.} */ - 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': [ '', '' ], 'url': [ '', '' ], 'hit': [ '', '' ], 'del': [ '', '' ], 'summary': [ '', '' ] }); -}); -$__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 deleted file mode 100644 index 2d81bc79e..000000000 --- a/web/server/h2o/libh2o/misc/oktavia/lib/oktavia-finnish-search.js +++ /dev/null @@ -1,8609 +0,0 @@ -// 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.} 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.} */ - 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.} - */ -OktaviaSearch.prototype.pageIndexes$ = function () { - /** @type {Array.} */ - 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.} - */ -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.} */ - var results; - /** @type {!number} */ - var i; - /** @type {SearchUnit} */ - var unit; - /** @type {Array.} */ - var info; - /** @type {!string} */ - var content; - /** @type {Array.} */ - 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('*').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('
'); - } else { - text = content.slice(0, end - start) + ' ...
'; - } - text = text.replace(Oktavia.eob, ' ').replace(/()()+/, '

'); - 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.} - */ -OktaviaSearch.prototype.getProposals$ = function () { - /** @type {Style} */ - var style; - /** @type {Array.} */ - var results; - /** @type {!number} */ - var i; - /** @type {Proposal} */ - var proposal; - /** @type {Array.} */ - var label; - /** @type {Array.} */ - 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('' + this._queries[j].toString() + '')); - option.push(this._queries[j].toString()); - } else { - label.push(style.convert$S('' + this._queries[j].toString() + '')); - } - } - results.push(({options: option.join(' '), label: label.join(' '), count: proposal.expect})); - } - } - } - return results; -}; - -/** - * @param {SearchSummary} summary - * @return {Array.} - */ -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.} 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.} */ - 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.} 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.} */ - 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.} */ - 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.} */ - 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.} */ - 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.} - */ -Oktavia.prototype.rawSearch$SB = function (keyword, stemming) { - /** @type {Array.} */ - var result; - /** @type {!string} */ - var baseWord; - /** @type {Array.} */ - 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.} 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.} */ - 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.} */ - 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.} */ - 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.} */ - 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.} */ - var charCodes; - /** @type {!number} */ - var i; - /** @type {!number} */ - var charCode; - /** @type {Array.} */ - 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.} strList - * @return {!string} - */ -Binary.dumpStringList$AS = function (strList) { - return Binary$dumpStringList$ASLCompressionReport$(strList, null); -}; - -var Binary$dumpStringList$AS = Binary.dumpStringList$AS; - -/** - * @param {Array.} strList - * @param {CompressionReport} report - * @return {!string} - */ -Binary.dumpStringList$ASLCompressionReport$ = function (strList, report) { - /** @type {Array.} */ - 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.>} strMap - * @return {!string} - */ -Binary.dumpStringListMap$HAS = function (strMap) { - return Binary$dumpStringListMap$HASLCompressionReport$(strMap, null); -}; - -var Binary$dumpStringListMap$HAS = Binary.dumpStringListMap$HAS; - -/** - * @param {Object.>} strMap - * @param {CompressionReport} report - * @return {!string} - */ -Binary.dumpStringListMap$HASLCompressionReport$ = function (strMap, report) { - /** @type {Array.} */ - 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.} array - * @return {!string} - */ -Binary.dump32bitNumberList$AN = function (array) { - return Binary$dump32bitNumberList$ANLCompressionReport$(array, null); -}; - -var Binary$dump32bitNumberList$AN = Binary.dump32bitNumberList$AN; - -/** - * @param {Array.} array - * @param {CompressionReport} report - * @return {!string} - */ -Binary.dump32bitNumberList$ANLCompressionReport$ = function (array, report) { - /** @type {Array.} */ - 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.} 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.} */ - 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.} 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.} 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.} array - * @param {!number} offset - * @param {!number} length - * @return {!string} - */ -Binary._nonZeroBlock$ANII = function (array, offset, length) { - /** @type {Array.} */ - 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.} array - * @param {!number} offset - * @return {!string} - */ -Binary._createZebraCode$ANI = function (array, offset) { - /** @type {!number} */ - var last; - /** @type {!number} */ - var code; - /** @type {Array.} */ - 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.} */ - var out; - /** @type {Array.} */ - 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.} source - * @return {!string} - */ -Binary._mergeCharCode$AI = function (source) { - /** @type {Array.} */ - 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.} */ - 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.} */ - 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.} */ - 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.} */ - 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.} */ - 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.} - */ -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.} */ - 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.} - */ -SearchUnit.getPositions$LSearchUnit$ = function ($this) { - /** @type {Array.} */ - 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.} */ - var unitIds$0; - /** @type {Array.} */ - 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.} 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.} - */ -SearchSummary.getProposal$LSearchSummary$ = function ($this) { - /** @type {Array.} */ - var proposals; - /** @type {!number} */ - var i; - /** @type {Array.} */ - 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.} - */ -SearchSummary.getSortedResult$LSearchSummary$ = function ($this) { - /** @type {Array.} */ - var result; - /** @type {Array.} */ - 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.} 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.} 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.} 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.} 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.} 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.} 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.} words - * @return {Array.} - */ -BaseStemmer.prototype.stemWords$AS = function (words) { - /** @type {Array.} */ - 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.} 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.} */ - 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.} */ - 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.} 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.} 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.} 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.} - */ -Table.prototype.getCell$I = function (position) { - /** @type {!number} */ - var row; - /** @type {!number} */ - var currentColumn; - /** @type {!number} */ - var lastRowColumn; - /** @type {!number} */ - var startPosition; - /** @type {Array.} */ - 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.} - */ -Table.prototype.getRowContent$I = function (rowIndex) { - /** @type {!string} */ - var content; - /** @type {Array.} */ - var values; - /** @type {Object.} */ - 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.} 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.} 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.} */ - 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.} */ - var pos; - pos = [ ]; - return this.getRows$SAI(key, pos); -}; - -/** - * @param {!string} key - * @param {Array.} 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.} */ - 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.} */ - 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.} - */ -FMIndex.prototype.search$S = function (keyword) { - /** @type {Array.} */ - var result; - /** @type {Array.} */ - 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.} */ - 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.} 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.>} 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, "
").replace(/&/g, "&").replace(/"/g, """).replace(//g, ">"); -}; - -var _HTMLHandler$escapeHTML$S = _HTMLHandler.escapeHTML$S; - -/** - * @param {!string} tagname - * @param {Object.} 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, "
").replace(/&/g, "&").replace(/"/g, """).replace(//g, ">")); - } 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.} */ - var charclass$0; - /** @type {Object.} */ - var charclass$1; - /** @type {RegExp} */ - var charclass$2; - /** @type {Object.} */ - var charclass$3; - /** @type {Object.} */ - var charclass$4; - /** @type {Object.} */ - var charclass$5; - /** @type {!string} */ - var text$0; - /** @type {Object.} */ - var charclass$6; - /** @type {RegExp} */ - var charclass$7; - /** @type {Object.} */ - var charclass$8; - /** @type {Object.} */ - var charclass$9; - /** @type {RegExp} */ - var charclass$10; - /** @type {Object.} */ - var charclass$11; - /** @type {RegExp} */ - var charclass$12; - /** @type {Object.} */ - var charclass$13; - /** @type {RegExp} */ - var charclass$14; - /** @type {Object.} */ - var charclass$15; - /** @type {Object.} */ - var charclass$16; - /** @type {Object.} */ - var charclass$17; - /** @type {Object.} */ - var charclass$18; - /** @type {RegExp} */ - var charclass$19; - /** @type {RegExp} */ - var charclass$20; - /** @type {Object.} */ - var charclass$21; - /** @type {Object.} */ - var charclass$22; - /** @type {Object.} */ - var charclass$23; - /** @type {Object.} */ - 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 += "") { - this.closeTag$(); - } else { - charclass$20 = _.nameBody; - if (charclass$20.test(c)) { - this.tagName += c; - } else { - if (this.script) { - this.script += "") { - 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.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.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.} - */ -Char.prototype._charClass$S = function (str) { - /** @type {Object.} */ - 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.} 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.} 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.} - */ -_Entities.entity_list$ = function () { - /** @type {Object.} */ - 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.} */ - var _v$0; - /** @type {Array.} */ - 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.} */ - 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.} */ - 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.} */ - var _bv$0; - /** @type {Array.} */ - 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.} */ - var range_tmp; - /** @type {!number} */ - var code; - /** @type {!boolean} */ - var bit; - /** @type {!number} */ - var key; - /** @type {Object.} */ - 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.} */ - 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.} */ - var contents; - /** @type {!number} */ - var i; - /** @type {Array.} */ - 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.} */ - var contents; - /** @type {!number} */ - var i; - /** @type {Array.} */ - 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.} input - * @return {Object.} - */ -WaveletMatrix._shallow_copy$HI = function (input) { - /** @type {Object.} */ - 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.} */ - 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.} */ - 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.} array - */ -function OArray$AI(array) { - this.array = array; - this.offset = 0; -}; - -OArray$AI.prototype = new OArray; - -/** - * @constructor - * @param {Array.} 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.} */ - 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.} */ - 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.} 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.} SA - * @param {OArray} s - * @param {Array.} 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.} SA - * @param {OArray} s - * @param {Array.} 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.} - */ -SAIS.make$S = function (source) { - /** @type {Array.} */ - var charCodes; - /** @type {!number} */ - var maxCode; - /** @type {!number} */ - var i; - /** @type {!number} */ - var code; - /** @type {Array.} */ - 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.} 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.} */ - 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.} */ - 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': [ '', '' ], 'url': [ '', '' ], 'hit': [ '', '' ], 'del': [ '', '' ], 'summary': [ '', '' ] }); -}); -$__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 deleted file mode 100644 index 4668c8438..000000000 --- a/web/server/h2o/libh2o/misc/oktavia/lib/oktavia-french-search.js +++ /dev/null @@ -1,9061 +0,0 @@ -// 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.} 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.} */ - 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.} - */ -OktaviaSearch.prototype.pageIndexes$ = function () { - /** @type {Array.} */ - 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.} - */ -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.} */ - var results; - /** @type {!number} */ - var i; - /** @type {SearchUnit} */ - var unit; - /** @type {Array.} */ - var info; - /** @type {!string} */ - var content; - /** @type {Array.} */ - 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('*').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('
'); - } else { - text = content.slice(0, end - start) + ' ...
'; - } - text = text.replace(Oktavia.eob, ' ').replace(/()()+/, '

'); - 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.} - */ -OktaviaSearch.prototype.getProposals$ = function () { - /** @type {Style} */ - var style; - /** @type {Array.} */ - var results; - /** @type {!number} */ - var i; - /** @type {Proposal} */ - var proposal; - /** @type {Array.} */ - var label; - /** @type {Array.} */ - 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('' + this._queries[j].toString() + '')); - option.push(this._queries[j].toString()); - } else { - label.push(style.convert$S('' + this._queries[j].toString() + '')); - } - } - results.push(({options: option.join(' '), label: label.join(' '), count: proposal.expect})); - } - } - } - return results; -}; - -/** - * @param {SearchSummary} summary - * @return {Array.} - */ -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.} 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.} */ - 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.} 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.} */ - 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.} */ - 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.} */ - 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.} */ - 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.} - */ -Oktavia.prototype.rawSearch$SB = function (keyword, stemming) { - /** @type {Array.} */ - var result; - /** @type {!string} */ - var baseWord; - /** @type {Array.} */ - 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.} 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.} */ - 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.} */ - 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.} */ - 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.} */ - 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.} */ - var charCodes; - /** @type {!number} */ - var i; - /** @type {!number} */ - var charCode; - /** @type {Array.} */ - 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.} strList - * @return {!string} - */ -Binary.dumpStringList$AS = function (strList) { - return Binary$dumpStringList$ASLCompressionReport$(strList, null); -}; - -var Binary$dumpStringList$AS = Binary.dumpStringList$AS; - -/** - * @param {Array.} strList - * @param {CompressionReport} report - * @return {!string} - */ -Binary.dumpStringList$ASLCompressionReport$ = function (strList, report) { - /** @type {Array.} */ - 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.>} strMap - * @return {!string} - */ -Binary.dumpStringListMap$HAS = function (strMap) { - return Binary$dumpStringListMap$HASLCompressionReport$(strMap, null); -}; - -var Binary$dumpStringListMap$HAS = Binary.dumpStringListMap$HAS; - -/** - * @param {Object.>} strMap - * @param {CompressionReport} report - * @return {!string} - */ -Binary.dumpStringListMap$HASLCompressionReport$ = function (strMap, report) { - /** @type {Array.} */ - 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.} array - * @return {!string} - */ -Binary.dump32bitNumberList$AN = function (array) { - return Binary$dump32bitNumberList$ANLCompressionReport$(array, null); -}; - -var Binary$dump32bitNumberList$AN = Binary.dump32bitNumberList$AN; - -/** - * @param {Array.} array - * @param {CompressionReport} report - * @return {!string} - */ -Binary.dump32bitNumberList$ANLCompressionReport$ = function (array, report) { - /** @type {Array.} */ - 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.} 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.} */ - 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.} 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.} 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.} array - * @param {!number} offset - * @param {!number} length - * @return {!string} - */ -Binary._nonZeroBlock$ANII = function (array, offset, length) { - /** @type {Array.} */ - 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.} array - * @param {!number} offset - * @return {!string} - */ -Binary._createZebraCode$ANI = function (array, offset) { - /** @type {!number} */ - var last; - /** @type {!number} */ - var code; - /** @type {Array.} */ - 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.} */ - var out; - /** @type {Array.} */ - 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.} source - * @return {!string} - */ -Binary._mergeCharCode$AI = function (source) { - /** @type {Array.} */ - 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.} */ - 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.} */ - 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.} */ - 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.} */ - 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.} */ - 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.} - */ -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.} */ - 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.} - */ -SearchUnit.getPositions$LSearchUnit$ = function ($this) { - /** @type {Array.} */ - 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.} */ - var unitIds$0; - /** @type {Array.} */ - 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.} 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.} - */ -SearchSummary.getProposal$LSearchSummary$ = function ($this) { - /** @type {Array.} */ - var proposals; - /** @type {!number} */ - var i; - /** @type {Array.} */ - 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.} - */ -SearchSummary.getSortedResult$LSearchSummary$ = function ($this) { - /** @type {Array.} */ - var result; - /** @type {Array.} */ - 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.} 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.} 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.} 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.} 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.} 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.} 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.} words - * @return {Array.} - */ -BaseStemmer.prototype.stemWords$AS = function (words) { - /** @type {Array.} */ - 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.} 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.} */ - 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.} */ - 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.} 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.} 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.} 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.} - */ -Table.prototype.getCell$I = function (position) { - /** @type {!number} */ - var row; - /** @type {!number} */ - var currentColumn; - /** @type {!number} */ - var lastRowColumn; - /** @type {!number} */ - var startPosition; - /** @type {Array.} */ - 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.} - */ -Table.prototype.getRowContent$I = function (rowIndex) { - /** @type {!string} */ - var content; - /** @type {Array.} */ - var values; - /** @type {Object.} */ - 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.} 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.} 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.} */ - 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.} */ - var pos; - pos = [ ]; - return this.getRows$SAI(key, pos); -}; - -/** - * @param {!string} key - * @param {Array.} 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.} */ - 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.} */ - 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.} - */ -FMIndex.prototype.search$S = function (keyword) { - /** @type {Array.} */ - var result; - /** @type {Array.} */ - 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.} */ - 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.} 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.>} 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, "
").replace(/&/g, "&").replace(/"/g, """).replace(//g, ">"); -}; - -var _HTMLHandler$escapeHTML$S = _HTMLHandler.escapeHTML$S; - -/** - * @param {!string} tagname - * @param {Object.} 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, "
").replace(/&/g, "&").replace(/"/g, """).replace(//g, ">")); - } 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.} */ - var charclass$0; - /** @type {Object.} */ - var charclass$1; - /** @type {RegExp} */ - var charclass$2; - /** @type {Object.} */ - var charclass$3; - /** @type {Object.} */ - var charclass$4; - /** @type {Object.} */ - var charclass$5; - /** @type {!string} */ - var text$0; - /** @type {Object.} */ - var charclass$6; - /** @type {RegExp} */ - var charclass$7; - /** @type {Object.} */ - var charclass$8; - /** @type {Object.} */ - var charclass$9; - /** @type {RegExp} */ - var charclass$10; - /** @type {Object.} */ - var charclass$11; - /** @type {RegExp} */ - var charclass$12; - /** @type {Object.} */ - var charclass$13; - /** @type {RegExp} */ - var charclass$14; - /** @type {Object.} */ - var charclass$15; - /** @type {Object.} */ - var charclass$16; - /** @type {Object.} */ - var charclass$17; - /** @type {Object.} */ - var charclass$18; - /** @type {RegExp} */ - var charclass$19; - /** @type {RegExp} */ - var charclass$20; - /** @type {Object.} */ - var charclass$21; - /** @type {Object.} */ - var charclass$22; - /** @type {Object.} */ - var charclass$23; - /** @type {Object.} */ - 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 += "") { - this.closeTag$(); - } else { - charclass$20 = _.nameBody; - if (charclass$20.test(c)) { - this.tagName += c; - } else { - if (this.script) { - this.script += "") { - 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.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.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.} - */ -Char.prototype._charClass$S = function (str) { - /** @type {Object.} */ - 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.} 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.} 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.} - */ -_Entities.entity_list$ = function () { - /** @type {Object.} */ - 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.} */ - var _v$0; - /** @type {Array.} */ - 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.} */ - 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.} */ - 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.} */ - var _bv$0; - /** @type {Array.} */ - 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.} */ - var range_tmp; - /** @type {!number} */ - var code; - /** @type {!boolean} */ - var bit; - /** @type {!number} */ - var key; - /** @type {Object.} */ - 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.} */ - 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.} */ - var contents; - /** @type {!number} */ - var i; - /** @type {Array.} */ - 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.} */ - var contents; - /** @type {!number} */ - var i; - /** @type {Array.} */ - 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.} input - * @return {Object.} - */ -WaveletMatrix._shallow_copy$HI = function (input) { - /** @type {Object.} */ - 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.} */ - 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.} */ - 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.} array - */ -function OArray$AI(array) { - this.array = array; - this.offset = 0; -}; - -OArray$AI.prototype = new OArray; - -/** - * @constructor - * @param {Array.} 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.} */ - 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.} */ - 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.} 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.} SA - * @param {OArray} s - * @param {Array.} 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.} SA - * @param {OArray} s - * @param {Array.} 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.} - */ -SAIS.make$S = function (source) { - /** @type {Array.} */ - var charCodes; - /** @type {!number} */ - var maxCode; - /** @type {!number} */ - var i; - /** @type {!number} */ - var code; - /** @type {Array.} */ - 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.} 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.} */ - 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.} */ - 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': [ '', '' ], 'url': [ '', '' ], 'hit': [ '', '' ], 'del': [ '', '' ], 'summary': [ '', '' ] }); -}); -$__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 deleted file mode 100644 index 3769dd3ca..000000000 --- a/web/server/h2o/libh2o/misc/oktavia/lib/oktavia-german-search.js +++ /dev/null @@ -1,8352 +0,0 @@ -// 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.} 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.} */ - 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.} - */ -OktaviaSearch.prototype.pageIndexes$ = function () { - /** @type {Array.} */ - 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.} - */ -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.} */ - var results; - /** @type {!number} */ - var i; - /** @type {SearchUnit} */ - var unit; - /** @type {Array.} */ - var info; - /** @type {!string} */ - var content; - /** @type {Array.} */ - 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('*').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('
'); - } else { - text = content.slice(0, end - start) + ' ...
'; - } - text = text.replace(Oktavia.eob, ' ').replace(/()()+/, '

'); - 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.} - */ -OktaviaSearch.prototype.getProposals$ = function () { - /** @type {Style} */ - var style; - /** @type {Array.} */ - var results; - /** @type {!number} */ - var i; - /** @type {Proposal} */ - var proposal; - /** @type {Array.} */ - var label; - /** @type {Array.} */ - 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('' + this._queries[j].toString() + '')); - option.push(this._queries[j].toString()); - } else { - label.push(style.convert$S('' + this._queries[j].toString() + '')); - } - } - results.push(({options: option.join(' '), label: label.join(' '), count: proposal.expect})); - } - } - } - return results; -}; - -/** - * @param {SearchSummary} summary - * @return {Array.} - */ -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.} 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.} */ - 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.} 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.} */ - 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.} */ - 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.} */ - 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.} */ - 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.} - */ -Oktavia.prototype.rawSearch$SB = function (keyword, stemming) { - /** @type {Array.} */ - var result; - /** @type {!string} */ - var baseWord; - /** @type {Array.} */ - 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.} 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.} */ - 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.} */ - 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.} */ - 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.} */ - 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.} */ - var charCodes; - /** @type {!number} */ - var i; - /** @type {!number} */ - var charCode; - /** @type {Array.} */ - 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.} strList - * @return {!string} - */ -Binary.dumpStringList$AS = function (strList) { - return Binary$dumpStringList$ASLCompressionReport$(strList, null); -}; - -var Binary$dumpStringList$AS = Binary.dumpStringList$AS; - -/** - * @param {Array.} strList - * @param {CompressionReport} report - * @return {!string} - */ -Binary.dumpStringList$ASLCompressionReport$ = function (strList, report) { - /** @type {Array.} */ - 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.>} strMap - * @return {!string} - */ -Binary.dumpStringListMap$HAS = function (strMap) { - return Binary$dumpStringListMap$HASLCompressionReport$(strMap, null); -}; - -var Binary$dumpStringListMap$HAS = Binary.dumpStringListMap$HAS; - -/** - * @param {Object.>} strMap - * @param {CompressionReport} report - * @return {!string} - */ -Binary.dumpStringListMap$HASLCompressionReport$ = function (strMap, report) { - /** @type {Array.} */ - 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.} array - * @return {!string} - */ -Binary.dump32bitNumberList$AN = function (array) { - return Binary$dump32bitNumberList$ANLCompressionReport$(array, null); -}; - -var Binary$dump32bitNumberList$AN = Binary.dump32bitNumberList$AN; - -/** - * @param {Array.} array - * @param {CompressionReport} report - * @return {!string} - */ -Binary.dump32bitNumberList$ANLCompressionReport$ = function (array, report) { - /** @type {Array.} */ - 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.} 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.} */ - 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.} 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.} 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.} array - * @param {!number} offset - * @param {!number} length - * @return {!string} - */ -Binary._nonZeroBlock$ANII = function (array, offset, length) { - /** @type {Array.} */ - 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.} array - * @param {!number} offset - * @return {!string} - */ -Binary._createZebraCode$ANI = function (array, offset) { - /** @type {!number} */ - var last; - /** @type {!number} */ - var code; - /** @type {Array.} */ - 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.} */ - var out; - /** @type {Array.} */ - 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.} source - * @return {!string} - */ -Binary._mergeCharCode$AI = function (source) { - /** @type {Array.} */ - 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.} */ - 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.} */ - 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.} */ - 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.} */ - 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.} */ - 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.} - */ -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.} */ - 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.} - */ -SearchUnit.getPositions$LSearchUnit$ = function ($this) { - /** @type {Array.} */ - 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.} */ - var unitIds$0; - /** @type {Array.} */ - 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.} 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.} - */ -SearchSummary.getProposal$LSearchSummary$ = function ($this) { - /** @type {Array.} */ - var proposals; - /** @type {!number} */ - var i; - /** @type {Array.} */ - 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.} - */ -SearchSummary.getSortedResult$LSearchSummary$ = function ($this) { - /** @type {Array.} */ - var result; - /** @type {Array.} */ - 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.} 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.} 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.} 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.} 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.} 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.} 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.} words - * @return {Array.} - */ -BaseStemmer.prototype.stemWords$AS = function (words) { - /** @type {Array.} */ - 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.} 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.} */ - 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.} */ - 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.} 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.} 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.} 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.} - */ -Table.prototype.getCell$I = function (position) { - /** @type {!number} */ - var row; - /** @type {!number} */ - var currentColumn; - /** @type {!number} */ - var lastRowColumn; - /** @type {!number} */ - var startPosition; - /** @type {Array.} */ - 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.} - */ -Table.prototype.getRowContent$I = function (rowIndex) { - /** @type {!string} */ - var content; - /** @type {Array.} */ - var values; - /** @type {Object.} */ - 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.} 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.} 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.} */ - 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.} */ - var pos; - pos = [ ]; - return this.getRows$SAI(key, pos); -}; - -/** - * @param {!string} key - * @param {Array.} 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.} */ - 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.} */ - 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.} - */ -FMIndex.prototype.search$S = function (keyword) { - /** @type {Array.} */ - var result; - /** @type {Array.} */ - 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.} */ - 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.} 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.>} 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, "
").replace(/&/g, "&").replace(/"/g, """).replace(//g, ">"); -}; - -var _HTMLHandler$escapeHTML$S = _HTMLHandler.escapeHTML$S; - -/** - * @param {!string} tagname - * @param {Object.} 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, "
").replace(/&/g, "&").replace(/"/g, """).replace(//g, ">")); - } 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.} */ - var charclass$0; - /** @type {Object.} */ - var charclass$1; - /** @type {RegExp} */ - var charclass$2; - /** @type {Object.} */ - var charclass$3; - /** @type {Object.} */ - var charclass$4; - /** @type {Object.} */ - var charclass$5; - /** @type {!string} */ - var text$0; - /** @type {Object.} */ - var charclass$6; - /** @type {RegExp} */ - var charclass$7; - /** @type {Object.} */ - var charclass$8; - /** @type {Object.} */ - var charclass$9; - /** @type {RegExp} */ - var charclass$10; - /** @type {Object.} */ - var charclass$11; - /** @type {RegExp} */ - var charclass$12; - /** @type {Object.} */ - var charclass$13; - /** @type {RegExp} */ - var charclass$14; - /** @type {Object.} */ - var charclass$15; - /** @type {Object.} */ - var charclass$16; - /** @type {Object.} */ - var charclass$17; - /** @type {Object.} */ - var charclass$18; - /** @type {RegExp} */ - var charclass$19; - /** @type {RegExp} */ - var charclass$20; - /** @type {Object.} */ - var charclass$21; - /** @type {Object.} */ - var charclass$22; - /** @type {Object.} */ - var charclass$23; - /** @type {Object.} */ - 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 += "") { - this.closeTag$(); - } else { - charclass$20 = _.nameBody; - if (charclass$20.test(c)) { - this.tagName += c; - } else { - if (this.script) { - this.script += "") { - 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.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.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.} - */ -Char.prototype._charClass$S = function (str) { - /** @type {Object.} */ - 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.} 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.} 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.} - */ -_Entities.entity_list$ = function () { - /** @type {Object.} */ - 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.} */ - var _v$0; - /** @type {Array.} */ - 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.} */ - 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.} */ - 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.} */ - var _bv$0; - /** @type {Array.} */ - 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.} */ - var range_tmp; - /** @type {!number} */ - var code; - /** @type {!boolean} */ - var bit; - /** @type {!number} */ - var key; - /** @type {Object.} */ - 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.} */ - 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.} */ - var contents; - /** @type {!number} */ - var i; - /** @type {Array.} */ - 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.} */ - var contents; - /** @type {!number} */ - var i; - /** @type {Array.} */ - 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.} input - * @return {Object.} - */ -WaveletMatrix._shallow_copy$HI = function (input) { - /** @type {Object.} */ - 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.} */ - 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.} */ - 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.} array - */ -function OArray$AI(array) { - this.array = array; - this.offset = 0; -}; - -OArray$AI.prototype = new OArray; - -/** - * @constructor - * @param {Array.} 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.} */ - 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.} */ - 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.} 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.} SA - * @param {OArray} s - * @param {Array.} 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.} SA - * @param {OArray} s - * @param {Array.} 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.} - */ -SAIS.make$S = function (source) { - /** @type {Array.} */ - var charCodes; - /** @type {!number} */ - var maxCode; - /** @type {!number} */ - var i; - /** @type {!number} */ - var code; - /** @type {Array.} */ - 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.} 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.} */ - 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.} */ - 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': [ '', '' ], 'url': [ '', '' ], 'hit': [ '', '' ], 'del': [ '', '' ], 'summary': [ '', '' ] }); -}); -$__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 deleted file mode 100644 index 8fe69650a..000000000 --- a/web/server/h2o/libh2o/misc/oktavia/lib/oktavia-hungarian-search.js +++ /dev/null @@ -1,8599 +0,0 @@ -// 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.} 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.} */ - 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.} - */ -OktaviaSearch.prototype.pageIndexes$ = function () { - /** @type {Array.} */ - 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.} - */ -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.} */ - var results; - /** @type {!number} */ - var i; - /** @type {SearchUnit} */ - var unit; - /** @type {Array.} */ - var info; - /** @type {!string} */ - var content; - /** @type {Array.} */ - 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('*').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('
'); - } else { - text = content.slice(0, end - start) + ' ...
'; - } - text = text.replace(Oktavia.eob, ' ').replace(/()()+/, '

'); - 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.} - */ -OktaviaSearch.prototype.getProposals$ = function () { - /** @type {Style} */ - var style; - /** @type {Array.} */ - var results; - /** @type {!number} */ - var i; - /** @type {Proposal} */ - var proposal; - /** @type {Array.} */ - var label; - /** @type {Array.} */ - 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('' + this._queries[j].toString() + '')); - option.push(this._queries[j].toString()); - } else { - label.push(style.convert$S('' + this._queries[j].toString() + '')); - } - } - results.push(({options: option.join(' '), label: label.join(' '), count: proposal.expect})); - } - } - } - return results; -}; - -/** - * @param {SearchSummary} summary - * @return {Array.} - */ -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.} 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.} */ - 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.} 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.} */ - 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.} */ - 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.} */ - 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.} */ - 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.} - */ -Oktavia.prototype.rawSearch$SB = function (keyword, stemming) { - /** @type {Array.} */ - var result; - /** @type {!string} */ - var baseWord; - /** @type {Array.} */ - 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.} 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.} */ - 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.} */ - 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.} */ - 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.} */ - 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.} */ - var charCodes; - /** @type {!number} */ - var i; - /** @type {!number} */ - var charCode; - /** @type {Array.} */ - 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.} strList - * @return {!string} - */ -Binary.dumpStringList$AS = function (strList) { - return Binary$dumpStringList$ASLCompressionReport$(strList, null); -}; - -var Binary$dumpStringList$AS = Binary.dumpStringList$AS; - -/** - * @param {Array.} strList - * @param {CompressionReport} report - * @return {!string} - */ -Binary.dumpStringList$ASLCompressionReport$ = function (strList, report) { - /** @type {Array.} */ - 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.>} strMap - * @return {!string} - */ -Binary.dumpStringListMap$HAS = function (strMap) { - return Binary$dumpStringListMap$HASLCompressionReport$(strMap, null); -}; - -var Binary$dumpStringListMap$HAS = Binary.dumpStringListMap$HAS; - -/** - * @param {Object.>} strMap - * @param {CompressionReport} report - * @return {!string} - */ -Binary.dumpStringListMap$HASLCompressionReport$ = function (strMap, report) { - /** @type {Array.} */ - 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.} array - * @return {!string} - */ -Binary.dump32bitNumberList$AN = function (array) { - return Binary$dump32bitNumberList$ANLCompressionReport$(array, null); -}; - -var Binary$dump32bitNumberList$AN = Binary.dump32bitNumberList$AN; - -/** - * @param {Array.} array - * @param {CompressionReport} report - * @return {!string} - */ -Binary.dump32bitNumberList$ANLCompressionReport$ = function (array, report) { - /** @type {Array.} */ - 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.} 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.} */ - 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.} 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.} 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.} array - * @param {!number} offset - * @param {!number} length - * @return {!string} - */ -Binary._nonZeroBlock$ANII = function (array, offset, length) { - /** @type {Array.} */ - 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.} array - * @param {!number} offset - * @return {!string} - */ -Binary._createZebraCode$ANI = function (array, offset) { - /** @type {!number} */ - var last; - /** @type {!number} */ - var code; - /** @type {Array.} */ - 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.} */ - var out; - /** @type {Array.} */ - 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.} source - * @return {!string} - */ -Binary._mergeCharCode$AI = function (source) { - /** @type {Array.} */ - 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.} */ - 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.} */ - 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.} */ - 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.} */ - 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.} */ - 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.} - */ -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.} */ - 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.} - */ -SearchUnit.getPositions$LSearchUnit$ = function ($this) { - /** @type {Array.} */ - 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.} */ - var unitIds$0; - /** @type {Array.} */ - 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.} 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.} - */ -SearchSummary.getProposal$LSearchSummary$ = function ($this) { - /** @type {Array.} */ - var proposals; - /** @type {!number} */ - var i; - /** @type {Array.} */ - 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.} - */ -SearchSummary.getSortedResult$LSearchSummary$ = function ($this) { - /** @type {Array.} */ - var result; - /** @type {Array.} */ - 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.} 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.} 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.} 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.} 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.} 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.} 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.} words - * @return {Array.} - */ -BaseStemmer.prototype.stemWords$AS = function (words) { - /** @type {Array.} */ - 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.} 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.} */ - 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.} */ - 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.} 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.} 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.} 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.} - */ -Table.prototype.getCell$I = function (position) { - /** @type {!number} */ - var row; - /** @type {!number} */ - var currentColumn; - /** @type {!number} */ - var lastRowColumn; - /** @type {!number} */ - var startPosition; - /** @type {Array.} */ - 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.} - */ -Table.prototype.getRowContent$I = function (rowIndex) { - /** @type {!string} */ - var content; - /** @type {Array.} */ - var values; - /** @type {Object.} */ - 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.} 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.} 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.} */ - 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.} */ - var pos; - pos = [ ]; - return this.getRows$SAI(key, pos); -}; - -/** - * @param {!string} key - * @param {Array.} 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.} */ - 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.} */ - 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.} - */ -FMIndex.prototype.search$S = function (keyword) { - /** @type {Array.} */ - var result; - /** @type {Array.} */ - 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.} */ - 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.} 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.>} 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, "
").replace(/&/g, "&").replace(/"/g, """).replace(//g, ">"); -}; - -var _HTMLHandler$escapeHTML$S = _HTMLHandler.escapeHTML$S; - -/** - * @param {!string} tagname - * @param {Object.} 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, "
").replace(/&/g, "&").replace(/"/g, """).replace(//g, ">")); - } 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.} */ - var charclass$0; - /** @type {Object.} */ - var charclass$1; - /** @type {RegExp} */ - var charclass$2; - /** @type {Object.} */ - var charclass$3; - /** @type {Object.} */ - var charclass$4; - /** @type {Object.} */ - var charclass$5; - /** @type {!string} */ - var text$0; - /** @type {Object.} */ - var charclass$6; - /** @type {RegExp} */ - var charclass$7; - /** @type {Object.} */ - var charclass$8; - /** @type {Object.} */ - var charclass$9; - /** @type {RegExp} */ - var charclass$10; - /** @type {Object.} */ - var charclass$11; - /** @type {RegExp} */ - var charclass$12; - /** @type {Object.} */ - var charclass$13; - /** @type {RegExp} */ - var charclass$14; - /** @type {Object.} */ - var charclass$15; - /** @type {Object.} */ - var charclass$16; - /** @type {Object.} */ - var charclass$17; - /** @type {Object.} */ - var charclass$18; - /** @type {RegExp} */ - var charclass$19; - /** @type {RegExp} */ - var charclass$20; - /** @type {Object.} */ - var charclass$21; - /** @type {Object.} */ - var charclass$22; - /** @type {Object.} */ - var charclass$23; - /** @type {Object.} */ - 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 += "") { - this.closeTag$(); - } else { - charclass$20 = _.nameBody; - if (charclass$20.test(c)) { - this.tagName += c; - } else { - if (this.script) { - this.script += "") { - 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.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.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.} - */ -Char.prototype._charClass$S = function (str) { - /** @type {Object.} */ - 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.} 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.} 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.} - */ -_Entities.entity_list$ = function () { - /** @type {Object.} */ - 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.} */ - var _v$0; - /** @type {Array.} */ - 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.} */ - 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.} */ - 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.} */ - var _bv$0; - /** @type {Array.} */ - 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.} */ - var range_tmp; - /** @type {!number} */ - var code; - /** @type {!boolean} */ - var bit; - /** @type {!number} */ - var key; - /** @type {Object.} */ - 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.} */ - 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.} */ - var contents; - /** @type {!number} */ - var i; - /** @type {Array.} */ - 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.} */ - var contents; - /** @type {!number} */ - var i; - /** @type {Array.} */ - 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.} input - * @return {Object.} - */ -WaveletMatrix._shallow_copy$HI = function (input) { - /** @type {Object.} */ - 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.} */ - 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.} */ - 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.} array - */ -function OArray$AI(array) { - this.array = array; - this.offset = 0; -}; - -OArray$AI.prototype = new OArray; - -/** - * @constructor - * @param {Array.} 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.} */ - 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.} */ - 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.} 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.} SA - * @param {OArray} s - * @param {Array.} 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.} SA - * @param {OArray} s - * @param {Array.} 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.} - */ -SAIS.make$S = function (source) { - /** @type {Array.} */ - var charCodes; - /** @type {!number} */ - var maxCode; - /** @type {!number} */ - var i; - /** @type {!number} */ - var code; - /** @type {Array.} */ - 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.} 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.} */ - 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.} */ - 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': [ '', '' ], 'url': [ '', '' ], 'hit': [ '', '' ], 'del': [ '', '' ], 'summary': [ '', '' ] }); -}); -$__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 deleted file mode 100644 index fa33ac166..000000000 --- a/web/server/h2o/libh2o/misc/oktavia/lib/oktavia-italian-search.js +++ /dev/null @@ -1,8633 +0,0 @@ -// 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.} 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.} */ - 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.} - */ -OktaviaSearch.prototype.pageIndexes$ = function () { - /** @type {Array.} */ - 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.} - */ -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.} */ - var results; - /** @type {!number} */ - var i; - /** @type {SearchUnit} */ - var unit; - /** @type {Array.} */ - var info; - /** @type {!string} */ - var content; - /** @type {Array.} */ - 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('*').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('
'); - } else { - text = content.slice(0, end - start) + ' ...
'; - } - text = text.replace(Oktavia.eob, ' ').replace(/()()+/, '

'); - 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.} - */ -OktaviaSearch.prototype.getProposals$ = function () { - /** @type {Style} */ - var style; - /** @type {Array.} */ - var results; - /** @type {!number} */ - var i; - /** @type {Proposal} */ - var proposal; - /** @type {Array.} */ - var label; - /** @type {Array.} */ - 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('' + this._queries[j].toString() + '')); - option.push(this._queries[j].toString()); - } else { - label.push(style.convert$S('' + this._queries[j].toString() + '')); - } - } - results.push(({options: option.join(' '), label: label.join(' '), count: proposal.expect})); - } - } - } - return results; -}; - -/** - * @param {SearchSummary} summary - * @return {Array.} - */ -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.} 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.} */ - 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.} 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.} */ - 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.} */ - 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.} */ - 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.} */ - 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.} - */ -Oktavia.prototype.rawSearch$SB = function (keyword, stemming) { - /** @type {Array.} */ - var result; - /** @type {!string} */ - var baseWord; - /** @type {Array.} */ - 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.} 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.} */ - 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.} */ - 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.} */ - 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.} */ - 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.} */ - var charCodes; - /** @type {!number} */ - var i; - /** @type {!number} */ - var charCode; - /** @type {Array.} */ - 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.} strList - * @return {!string} - */ -Binary.dumpStringList$AS = function (strList) { - return Binary$dumpStringList$ASLCompressionReport$(strList, null); -}; - -var Binary$dumpStringList$AS = Binary.dumpStringList$AS; - -/** - * @param {Array.} strList - * @param {CompressionReport} report - * @return {!string} - */ -Binary.dumpStringList$ASLCompressionReport$ = function (strList, report) { - /** @type {Array.} */ - 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.>} strMap - * @return {!string} - */ -Binary.dumpStringListMap$HAS = function (strMap) { - return Binary$dumpStringListMap$HASLCompressionReport$(strMap, null); -}; - -var Binary$dumpStringListMap$HAS = Binary.dumpStringListMap$HAS; - -/** - * @param {Object.>} strMap - * @param {CompressionReport} report - * @return {!string} - */ -Binary.dumpStringListMap$HASLCompressionReport$ = function (strMap, report) { - /** @type {Array.} */ - 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.} array - * @return {!string} - */ -Binary.dump32bitNumberList$AN = function (array) { - return Binary$dump32bitNumberList$ANLCompressionReport$(array, null); -}; - -var Binary$dump32bitNumberList$AN = Binary.dump32bitNumberList$AN; - -/** - * @param {Array.} array - * @param {CompressionReport} report - * @return {!string} - */ -Binary.dump32bitNumberList$ANLCompressionReport$ = function (array, report) { - /** @type {Array.} */ - 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.} 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.} */ - 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.} 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.} 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.} array - * @param {!number} offset - * @param {!number} length - * @return {!string} - */ -Binary._nonZeroBlock$ANII = function (array, offset, length) { - /** @type {Array.} */ - 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.} array - * @param {!number} offset - * @return {!string} - */ -Binary._createZebraCode$ANI = function (array, offset) { - /** @type {!number} */ - var last; - /** @type {!number} */ - var code; - /** @type {Array.} */ - 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.} */ - var out; - /** @type {Array.} */ - 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.} source - * @return {!string} - */ -Binary._mergeCharCode$AI = function (source) { - /** @type {Array.} */ - 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.} */ - 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.} */ - 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.} */ - 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.} */ - 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.} */ - 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.} - */ -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.} */ - 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.} - */ -SearchUnit.getPositions$LSearchUnit$ = function ($this) { - /** @type {Array.} */ - 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.} */ - var unitIds$0; - /** @type {Array.} */ - 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.} 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.} - */ -SearchSummary.getProposal$LSearchSummary$ = function ($this) { - /** @type {Array.} */ - var proposals; - /** @type {!number} */ - var i; - /** @type {Array.} */ - 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.} - */ -SearchSummary.getSortedResult$LSearchSummary$ = function ($this) { - /** @type {Array.} */ - var result; - /** @type {Array.} */ - 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.} 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.} 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.} 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.} 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.} 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.} 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.} words - * @return {Array.} - */ -BaseStemmer.prototype.stemWords$AS = function (words) { - /** @type {Array.} */ - 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.} 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.} */ - 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.} */ - 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.} 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.} 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.} 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.} - */ -Table.prototype.getCell$I = function (position) { - /** @type {!number} */ - var row; - /** @type {!number} */ - var currentColumn; - /** @type {!number} */ - var lastRowColumn; - /** @type {!number} */ - var startPosition; - /** @type {Array.} */ - 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.} - */ -Table.prototype.getRowContent$I = function (rowIndex) { - /** @type {!string} */ - var content; - /** @type {Array.} */ - var values; - /** @type {Object.} */ - 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.} 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.} 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.} */ - 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.} */ - var pos; - pos = [ ]; - return this.getRows$SAI(key, pos); -}; - -/** - * @param {!string} key - * @param {Array.} 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.} */ - 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.} */ - 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.} - */ -FMIndex.prototype.search$S = function (keyword) { - /** @type {Array.} */ - var result; - /** @type {Array.} */ - 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.} */ - 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.} 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.>} 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, "
").replace(/&/g, "&").replace(/"/g, """).replace(//g, ">"); -}; - -var _HTMLHandler$escapeHTML$S = _HTMLHandler.escapeHTML$S; - -/** - * @param {!string} tagname - * @param {Object.} 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, "
").replace(/&/g, "&").replace(/"/g, """).replace(//g, ">")); - } 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.} */ - var charclass$0; - /** @type {Object.} */ - var charclass$1; - /** @type {RegExp} */ - var charclass$2; - /** @type {Object.} */ - var charclass$3; - /** @type {Object.} */ - var charclass$4; - /** @type {Object.} */ - var charclass$5; - /** @type {!string} */ - var text$0; - /** @type {Object.} */ - var charclass$6; - /** @type {RegExp} */ - var charclass$7; - /** @type {Object.} */ - var charclass$8; - /** @type {Object.} */ - var charclass$9; - /** @type {RegExp} */ - var charclass$10; - /** @type {Object.} */ - var charclass$11; - /** @type {RegExp} */ - var charclass$12; - /** @type {Object.} */ - var charclass$13; - /** @type {RegExp} */ - var charclass$14; - /** @type {Object.} */ - var charclass$15; - /** @type {Object.} */ - var charclass$16; - /** @type {Object.} */ - var charclass$17; - /** @type {Object.} */ - var charclass$18; - /** @type {RegExp} */ - var charclass$19; - /** @type {RegExp} */ - var charclass$20; - /** @type {Object.} */ - var charclass$21; - /** @type {Object.} */ - var charclass$22; - /** @type {Object.} */ - var charclass$23; - /** @type {Object.} */ - 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 += "") { - this.closeTag$(); - } else { - charclass$20 = _.nameBody; - if (charclass$20.test(c)) { - this.tagName += c; - } else { - if (this.script) { - this.script += "") { - 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.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.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.} - */ -Char.prototype._charClass$S = function (str) { - /** @type {Object.} */ - 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.} 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.} 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.} - */ -_Entities.entity_list$ = function () { - /** @type {Object.} */ - 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.} */ - var _v$0; - /** @type {Array.} */ - 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.} */ - 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.} */ - 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.} */ - var _bv$0; - /** @type {Array.} */ - 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.} */ - var range_tmp; - /** @type {!number} */ - var code; - /** @type {!boolean} */ - var bit; - /** @type {!number} */ - var key; - /** @type {Object.} */ - 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.} */ - 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.} */ - var contents; - /** @type {!number} */ - var i; - /** @type {Array.} */ - 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.} */ - var contents; - /** @type {!number} */ - var i; - /** @type {Array.} */ - 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.} input - * @return {Object.} - */ -WaveletMatrix._shallow_copy$HI = function (input) { - /** @type {Object.} */ - 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.} */ - 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.} */ - 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.} array - */ -function OArray$AI(array) { - this.array = array; - this.offset = 0; -}; - -OArray$AI.prototype = new OArray; - -/** - * @constructor - * @param {Array.} 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.} */ - 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.} */ - 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.} 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.} SA - * @param {OArray} s - * @param {Array.} 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.} SA - * @param {OArray} s - * @param {Array.} 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.} - */ -SAIS.make$S = function (source) { - /** @type {Array.} */ - var charCodes; - /** @type {!number} */ - var maxCode; - /** @type {!number} */ - var i; - /** @type {!number} */ - var code; - /** @type {Array.} */ - 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.} 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.} */ - 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.} */ - 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': [ '', '' ], 'url': [ '', '' ], 'hit': [ '', '' ], 'del': [ '', '' ], 'summary': [ '', '' ] }); -}); -$__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 deleted file mode 100644 index 519e8876c..000000000 --- a/web/server/h2o/libh2o/misc/oktavia/lib/oktavia-jquery-highlight.js +++ /dev/null @@ -1,105 +0,0 @@ -/** - * @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 deleted file mode 100644 index bd1efb8c5..000000000 --- a/web/server/h2o/libh2o/misc/oktavia/lib/oktavia-jquery-ui.js +++ /dev/null @@ -1,521 +0,0 @@ -/** - * @fileOverview - * A UI script that creates search form, loads an index files and show search results. - * It needs jQuery and oktavia-search.js or oktavia-*-search.js - * (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 = $('').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 = $('
', { "class": "entry" }); - var link = $('', { "href": url + this.engine.getHighlight$() }).text(result.title); - link.bind('click', clearCallback); - entry.append($('
', { "class": "title" }).append(link)); - entry.append($('
', { "class": "url" }).text(url)); - entry.append($('
', { "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 = $('
', {"class": "proposal"}); - listitem.append('Search with: '); - var option = $('', {"class": "option"}); - option.html(proposal.label); - option.bind('click', createCallback(proposal.options)); - listitem.append(option); - listitem.append(' → ' + proposal.count + ' results.'); - 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 option 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. 'false' or 'disable' 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.submit(function (event) { - event.stopPropagation(); - setTimeout(function () { - view.search(); - }, 10); - return false; - }); - this.append(form); - var resultForm = $([ - '
', - '', - '
', - '
', - '
', - '
' - ].join('')); - if (data.logo) - { - resultForm.append($('Powered by
Oktavia')); - } - 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 deleted file mode 100644 index 55bb7d7fd..000000000 --- a/web/server/h2o/libh2o/misc/oktavia/lib/oktavia-norwegian-search.js +++ /dev/null @@ -1,7952 +0,0 @@ -// 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.} 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.} */ - 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.} - */ -OktaviaSearch.prototype.pageIndexes$ = function () { - /** @type {Array.} */ - 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.} - */ -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.} */ - var results; - /** @type {!number} */ - var i; - /** @type {SearchUnit} */ - var unit; - /** @type {Array.} */ - var info; - /** @type {!string} */ - var content; - /** @type {Array.} */ - 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('*').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('
'); - } else { - text = content.slice(0, end - start) + ' ...
'; - } - text = text.replace(Oktavia.eob, ' ').replace(/()()+/, '

'); - 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.} - */ -OktaviaSearch.prototype.getProposals$ = function () { - /** @type {Style} */ - var style; - /** @type {Array.} */ - var results; - /** @type {!number} */ - var i; - /** @type {Proposal} */ - var proposal; - /** @type {Array.} */ - var label; - /** @type {Array.} */ - 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('' + this._queries[j].toString() + '')); - option.push(this._queries[j].toString()); - } else { - label.push(style.convert$S('' + this._queries[j].toString() + '')); - } - } - results.push(({options: option.join(' '), label: label.join(' '), count: proposal.expect})); - } - } - } - return results; -}; - -/** - * @param {SearchSummary} summary - * @return {Array.} - */ -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.} 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.} */ - 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.} 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.} */ - 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.} */ - 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.} */ - 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.} */ - 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.} - */ -Oktavia.prototype.rawSearch$SB = function (keyword, stemming) { - /** @type {Array.} */ - var result; - /** @type {!string} */ - var baseWord; - /** @type {Array.} */ - 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.} 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.} */ - 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.} */ - 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.} */ - 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.} */ - 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.} */ - var charCodes; - /** @type {!number} */ - var i; - /** @type {!number} */ - var charCode; - /** @type {Array.} */ - 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.} strList - * @return {!string} - */ -Binary.dumpStringList$AS = function (strList) { - return Binary$dumpStringList$ASLCompressionReport$(strList, null); -}; - -var Binary$dumpStringList$AS = Binary.dumpStringList$AS; - -/** - * @param {Array.} strList - * @param {CompressionReport} report - * @return {!string} - */ -Binary.dumpStringList$ASLCompressionReport$ = function (strList, report) { - /** @type {Array.} */ - 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.>} strMap - * @return {!string} - */ -Binary.dumpStringListMap$HAS = function (strMap) { - return Binary$dumpStringListMap$HASLCompressionReport$(strMap, null); -}; - -var Binary$dumpStringListMap$HAS = Binary.dumpStringListMap$HAS; - -/** - * @param {Object.>} strMap - * @param {CompressionReport} report - * @return {!string} - */ -Binary.dumpStringListMap$HASLCompressionReport$ = function (strMap, report) { - /** @type {Array.} */ - 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.} array - * @return {!string} - */ -Binary.dump32bitNumberList$AN = function (array) { - return Binary$dump32bitNumberList$ANLCompressionReport$(array, null); -}; - -var Binary$dump32bitNumberList$AN = Binary.dump32bitNumberList$AN; - -/** - * @param {Array.} array - * @param {CompressionReport} report - * @return {!string} - */ -Binary.dump32bitNumberList$ANLCompressionReport$ = function (array, report) { - /** @type {Array.} */ - 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.} 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.} */ - 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.} 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.} 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.} array - * @param {!number} offset - * @param {!number} length - * @return {!string} - */ -Binary._nonZeroBlock$ANII = function (array, offset, length) { - /** @type {Array.} */ - 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.} array - * @param {!number} offset - * @return {!string} - */ -Binary._createZebraCode$ANI = function (array, offset) { - /** @type {!number} */ - var last; - /** @type {!number} */ - var code; - /** @type {Array.} */ - 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.} */ - var out; - /** @type {Array.} */ - 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.} source - * @return {!string} - */ -Binary._mergeCharCode$AI = function (source) { - /** @type {Array.} */ - 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.} */ - 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.} */ - 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.} */ - 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.} */ - 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.} */ - 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.} - */ -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.} */ - 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.} - */ -SearchUnit.getPositions$LSearchUnit$ = function ($this) { - /** @type {Array.} */ - 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.} */ - var unitIds$0; - /** @type {Array.} */ - 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.} 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.} - */ -SearchSummary.getProposal$LSearchSummary$ = function ($this) { - /** @type {Array.} */ - var proposals; - /** @type {!number} */ - var i; - /** @type {Array.} */ - 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.} - */ -SearchSummary.getSortedResult$LSearchSummary$ = function ($this) { - /** @type {Array.} */ - var result; - /** @type {Array.} */ - 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.} 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.} 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.} 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.} 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.} 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.} 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.} words - * @return {Array.} - */ -BaseStemmer.prototype.stemWords$AS = function (words) { - /** @type {Array.} */ - 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.} 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.} */ - 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.} */ - 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.} 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.} 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.} 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.} - */ -Table.prototype.getCell$I = function (position) { - /** @type {!number} */ - var row; - /** @type {!number} */ - var currentColumn; - /** @type {!number} */ - var lastRowColumn; - /** @type {!number} */ - var startPosition; - /** @type {Array.} */ - 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.} - */ -Table.prototype.getRowContent$I = function (rowIndex) { - /** @type {!string} */ - var content; - /** @type {Array.} */ - var values; - /** @type {Object.} */ - 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.} 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.} 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.} */ - 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.} */ - var pos; - pos = [ ]; - return this.getRows$SAI(key, pos); -}; - -/** - * @param {!string} key - * @param {Array.} 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.} */ - 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.} */ - 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.} - */ -FMIndex.prototype.search$S = function (keyword) { - /** @type {Array.} */ - var result; - /** @type {Array.} */ - 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.} */ - 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.} 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.>} 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, "
").replace(/&/g, "&").replace(/"/g, """).replace(//g, ">"); -}; - -var _HTMLHandler$escapeHTML$S = _HTMLHandler.escapeHTML$S; - -/** - * @param {!string} tagname - * @param {Object.} 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, "
").replace(/&/g, "&").replace(/"/g, """).replace(//g, ">")); - } 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.} */ - var charclass$0; - /** @type {Object.} */ - var charclass$1; - /** @type {RegExp} */ - var charclass$2; - /** @type {Object.} */ - var charclass$3; - /** @type {Object.} */ - var charclass$4; - /** @type {Object.} */ - var charclass$5; - /** @type {!string} */ - var text$0; - /** @type {Object.} */ - var charclass$6; - /** @type {RegExp} */ - var charclass$7; - /** @type {Object.} */ - var charclass$8; - /** @type {Object.} */ - var charclass$9; - /** @type {RegExp} */ - var charclass$10; - /** @type {Object.} */ - var charclass$11; - /** @type {RegExp} */ - var charclass$12; - /** @type {Object.} */ - var charclass$13; - /** @type {RegExp} */ - var charclass$14; - /** @type {Object.} */ - var charclass$15; - /** @type {Object.} */ - var charclass$16; - /** @type {Object.} */ - var charclass$17; - /** @type {Object.} */ - var charclass$18; - /** @type {RegExp} */ - var charclass$19; - /** @type {RegExp} */ - var charclass$20; - /** @type {Object.} */ - var charclass$21; - /** @type {Object.} */ - var charclass$22; - /** @type {Object.} */ - var charclass$23; - /** @type {Object.} */ - 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 += "") { - this.closeTag$(); - } else { - charclass$20 = _.nameBody; - if (charclass$20.test(c)) { - this.tagName += c; - } else { - if (this.script) { - this.script += "") { - 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.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.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.} - */ -Char.prototype._charClass$S = function (str) { - /** @type {Object.} */ - 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.} 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.} 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.} - */ -_Entities.entity_list$ = function () { - /** @type {Object.} */ - 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.} */ - var _v$0; - /** @type {Array.} */ - 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.} */ - 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.} */ - 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.} */ - var _bv$0; - /** @type {Array.} */ - 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.} */ - var range_tmp; - /** @type {!number} */ - var code; - /** @type {!boolean} */ - var bit; - /** @type {!number} */ - var key; - /** @type {Object.} */ - 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.} */ - 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.} */ - var contents; - /** @type {!number} */ - var i; - /** @type {Array.} */ - 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.} */ - var contents; - /** @type {!number} */ - var i; - /** @type {Array.} */ - 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.} input - * @return {Object.} - */ -WaveletMatrix._shallow_copy$HI = function (input) { - /** @type {Object.} */ - 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.} */ - 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.} */ - 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.} array - */ -function OArray$AI(array) { - this.array = array; - this.offset = 0; -}; - -OArray$AI.prototype = new OArray; - -/** - * @constructor - * @param {Array.} 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.} */ - 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.} */ - 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.} 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.} SA - * @param {OArray} s - * @param {Array.} 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.} SA - * @param {OArray} s - * @param {Array.} 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.} - */ -SAIS.make$S = function (source) { - /** @type {Array.} */ - var charCodes; - /** @type {!number} */ - var maxCode; - /** @type {!number} */ - var i; - /** @type {!number} */ - var code; - /** @type {Array.} */ - 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.} 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.} */ - 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.} */ - 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': [ '', '' ], 'url': [ '', '' ], 'hit': [ '', '' ], 'del': [ '', '' ], 'summary': [ '', '' ] }); -}); -$__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 deleted file mode 100644 index f1bb1801e..000000000 --- a/web/server/h2o/libh2o/misc/oktavia/lib/oktavia-porter-search.js +++ /dev/null @@ -1,8494 +0,0 @@ -// 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.} 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.} */ - 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.} - */ -OktaviaSearch.prototype.pageIndexes$ = function () { - /** @type {Array.} */ - 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.} - */ -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.} */ - var results; - /** @type {!number} */ - var i; - /** @type {SearchUnit} */ - var unit; - /** @type {Array.} */ - var info; - /** @type {!string} */ - var content; - /** @type {Array.} */ - 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('*').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('
'); - } else { - text = content.slice(0, end - start) + ' ...
'; - } - text = text.replace(Oktavia.eob, ' ').replace(/()()+/, '

'); - 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.} - */ -OktaviaSearch.prototype.getProposals$ = function () { - /** @type {Style} */ - var style; - /** @type {Array.} */ - var results; - /** @type {!number} */ - var i; - /** @type {Proposal} */ - var proposal; - /** @type {Array.} */ - var label; - /** @type {Array.} */ - 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('' + this._queries[j].toString() + '')); - option.push(this._queries[j].toString()); - } else { - label.push(style.convert$S('' + this._queries[j].toString() + '')); - } - } - results.push(({options: option.join(' '), label: label.join(' '), count: proposal.expect})); - } - } - } - return results; -}; - -/** - * @param {SearchSummary} summary - * @return {Array.} - */ -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.} 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.} */ - 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.} 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.} */ - 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.} */ - 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.} */ - 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.} */ - 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.} - */ -Oktavia.prototype.rawSearch$SB = function (keyword, stemming) { - /** @type {Array.} */ - var result; - /** @type {!string} */ - var baseWord; - /** @type {Array.} */ - 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.} 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.} */ - 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.} */ - 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.} */ - 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.} */ - 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.} */ - var charCodes; - /** @type {!number} */ - var i; - /** @type {!number} */ - var charCode; - /** @type {Array.} */ - 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.} strList - * @return {!string} - */ -Binary.dumpStringList$AS = function (strList) { - return Binary$dumpStringList$ASLCompressionReport$(strList, null); -}; - -var Binary$dumpStringList$AS = Binary.dumpStringList$AS; - -/** - * @param {Array.} strList - * @param {CompressionReport} report - * @return {!string} - */ -Binary.dumpStringList$ASLCompressionReport$ = function (strList, report) { - /** @type {Array.} */ - 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.>} strMap - * @return {!string} - */ -Binary.dumpStringListMap$HAS = function (strMap) { - return Binary$dumpStringListMap$HASLCompressionReport$(strMap, null); -}; - -var Binary$dumpStringListMap$HAS = Binary.dumpStringListMap$HAS; - -/** - * @param {Object.>} strMap - * @param {CompressionReport} report - * @return {!string} - */ -Binary.dumpStringListMap$HASLCompressionReport$ = function (strMap, report) { - /** @type {Array.} */ - 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.} array - * @return {!string} - */ -Binary.dump32bitNumberList$AN = function (array) { - return Binary$dump32bitNumberList$ANLCompressionReport$(array, null); -}; - -var Binary$dump32bitNumberList$AN = Binary.dump32bitNumberList$AN; - -/** - * @param {Array.} array - * @param {CompressionReport} report - * @return {!string} - */ -Binary.dump32bitNumberList$ANLCompressionReport$ = function (array, report) { - /** @type {Array.} */ - 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.} 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.} */ - 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.} 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.} 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.} array - * @param {!number} offset - * @param {!number} length - * @return {!string} - */ -Binary._nonZeroBlock$ANII = function (array, offset, length) { - /** @type {Array.} */ - 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.} array - * @param {!number} offset - * @return {!string} - */ -Binary._createZebraCode$ANI = function (array, offset) { - /** @type {!number} */ - var last; - /** @type {!number} */ - var code; - /** @type {Array.} */ - 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.} */ - var out; - /** @type {Array.} */ - 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.} source - * @return {!string} - */ -Binary._mergeCharCode$AI = function (source) { - /** @type {Array.} */ - 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.} */ - 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.} */ - 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.} */ - 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.} */ - 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.} */ - 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.} - */ -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.} */ - 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.} - */ -SearchUnit.getPositions$LSearchUnit$ = function ($this) { - /** @type {Array.} */ - 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.} */ - var unitIds$0; - /** @type {Array.} */ - 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.} 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.} - */ -SearchSummary.getProposal$LSearchSummary$ = function ($this) { - /** @type {Array.} */ - var proposals; - /** @type {!number} */ - var i; - /** @type {Array.} */ - 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.} - */ -SearchSummary.getSortedResult$LSearchSummary$ = function ($this) { - /** @type {Array.} */ - var result; - /** @type {Array.} */ - 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.} 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.} 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.} 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.} 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.} 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.} 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.} words - * @return {Array.} - */ -BaseStemmer.prototype.stemWords$AS = function (words) { - /** @type {Array.} */ - 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.} 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.} */ - 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.} */ - 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.} 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.} 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.} 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.} - */ -Table.prototype.getCell$I = function (position) { - /** @type {!number} */ - var row; - /** @type {!number} */ - var currentColumn; - /** @type {!number} */ - var lastRowColumn; - /** @type {!number} */ - var startPosition; - /** @type {Array.} */ - 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.} - */ -Table.prototype.getRowContent$I = function (rowIndex) { - /** @type {!string} */ - var content; - /** @type {Array.} */ - var values; - /** @type {Object.} */ - 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.} 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.} 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.} */ - 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.} */ - var pos; - pos = [ ]; - return this.getRows$SAI(key, pos); -}; - -/** - * @param {!string} key - * @param {Array.} 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.} */ - 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.} */ - 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.} - */ -FMIndex.prototype.search$S = function (keyword) { - /** @type {Array.} */ - var result; - /** @type {Array.} */ - 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.} */ - 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.} 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.>} 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, "
").replace(/&/g, "&").replace(/"/g, """).replace(//g, ">"); -}; - -var _HTMLHandler$escapeHTML$S = _HTMLHandler.escapeHTML$S; - -/** - * @param {!string} tagname - * @param {Object.} 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, "
").replace(/&/g, "&").replace(/"/g, """).replace(//g, ">")); - } 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.} */ - var charclass$0; - /** @type {Object.} */ - var charclass$1; - /** @type {RegExp} */ - var charclass$2; - /** @type {Object.} */ - var charclass$3; - /** @type {Object.} */ - var charclass$4; - /** @type {Object.} */ - var charclass$5; - /** @type {!string} */ - var text$0; - /** @type {Object.} */ - var charclass$6; - /** @type {RegExp} */ - var charclass$7; - /** @type {Object.} */ - var charclass$8; - /** @type {Object.} */ - var charclass$9; - /** @type {RegExp} */ - var charclass$10; - /** @type {Object.} */ - var charclass$11; - /** @type {RegExp} */ - var charclass$12; - /** @type {Object.} */ - var charclass$13; - /** @type {RegExp} */ - var charclass$14; - /** @type {Object.} */ - var charclass$15; - /** @type {Object.} */ - var charclass$16; - /** @type {Object.} */ - var charclass$17; - /** @type {Object.} */ - var charclass$18; - /** @type {RegExp} */ - var charclass$19; - /** @type {RegExp} */ - var charclass$20; - /** @type {Object.} */ - var charclass$21; - /** @type {Object.} */ - var charclass$22; - /** @type {Object.} */ - var charclass$23; - /** @type {Object.} */ - 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 += "") { - this.closeTag$(); - } else { - charclass$20 = _.nameBody; - if (charclass$20.test(c)) { - this.tagName += c; - } else { - if (this.script) { - this.script += "") { - 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.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.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.} - */ -Char.prototype._charClass$S = function (str) { - /** @type {Object.} */ - 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.} 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.} 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.} - */ -_Entities.entity_list$ = function () { - /** @type {Object.} */ - 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.} */ - var _v$0; - /** @type {Array.} */ - 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.} */ - 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.} */ - 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.} */ - var _bv$0; - /** @type {Array.} */ - 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.} */ - var range_tmp; - /** @type {!number} */ - var code; - /** @type {!boolean} */ - var bit; - /** @type {!number} */ - var key; - /** @type {Object.} */ - 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.} */ - 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.} */ - var contents; - /** @type {!number} */ - var i; - /** @type {Array.} */ - 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.} */ - var contents; - /** @type {!number} */ - var i; - /** @type {Array.} */ - 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.} input - * @return {Object.} - */ -WaveletMatrix._shallow_copy$HI = function (input) { - /** @type {Object.} */ - 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.} */ - 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.} */ - 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.} array - */ -function OArray$AI(array) { - this.array = array; - this.offset = 0; -}; - -OArray$AI.prototype = new OArray; - -/** - * @constructor - * @param {Array.} 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.} */ - 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.} */ - 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.} 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.} SA - * @param {OArray} s - * @param {Array.} 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.} SA - * @param {OArray} s - * @param {Array.} 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.} - */ -SAIS.make$S = function (source) { - /** @type {Array.} */ - var charCodes; - /** @type {!number} */ - var maxCode; - /** @type {!number} */ - var i; - /** @type {!number} */ - var code; - /** @type {Array.} */ - 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.} 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.} */ - 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.} */ - 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': [ '', '' ], 'url': [ '', '' ], 'hit': [ '', '' ], 'del': [ '', '' ], 'summary': [ '', '' ] }); -}); -$__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 deleted file mode 100644 index 1c9a0d531..000000000 --- a/web/server/h2o/libh2o/misc/oktavia/lib/oktavia-portuguese-search.js +++ /dev/null @@ -1,8566 +0,0 @@ -// 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.} 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.} */ - 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.} - */ -OktaviaSearch.prototype.pageIndexes$ = function () { - /** @type {Array.} */ - 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.} - */ -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.} */ - var results; - /** @type {!number} */ - var i; - /** @type {SearchUnit} */ - var unit; - /** @type {Array.} */ - var info; - /** @type {!string} */ - var content; - /** @type {Array.} */ - 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('*').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('
'); - } else { - text = content.slice(0, end - start) + ' ...
'; - } - text = text.replace(Oktavia.eob, ' ').replace(/()()+/, '

'); - 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.} - */ -OktaviaSearch.prototype.getProposals$ = function () { - /** @type {Style} */ - var style; - /** @type {Array.} */ - var results; - /** @type {!number} */ - var i; - /** @type {Proposal} */ - var proposal; - /** @type {Array.} */ - var label; - /** @type {Array.} */ - 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('' + this._queries[j].toString() + '')); - option.push(this._queries[j].toString()); - } else { - label.push(style.convert$S('' + this._queries[j].toString() + '')); - } - } - results.push(({options: option.join(' '), label: label.join(' '), count: proposal.expect})); - } - } - } - return results; -}; - -/** - * @param {SearchSummary} summary - * @return {Array.} - */ -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.} 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.} */ - 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.} 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.} */ - 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.} */ - 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.} */ - 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.} */ - 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.} - */ -Oktavia.prototype.rawSearch$SB = function (keyword, stemming) { - /** @type {Array.} */ - var result; - /** @type {!string} */ - var baseWord; - /** @type {Array.} */ - 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.} 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.} */ - 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.} */ - 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.} */ - 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.} */ - 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.} */ - var charCodes; - /** @type {!number} */ - var i; - /** @type {!number} */ - var charCode; - /** @type {Array.} */ - 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.} strList - * @return {!string} - */ -Binary.dumpStringList$AS = function (strList) { - return Binary$dumpStringList$ASLCompressionReport$(strList, null); -}; - -var Binary$dumpStringList$AS = Binary.dumpStringList$AS; - -/** - * @param {Array.} strList - * @param {CompressionReport} report - * @return {!string} - */ -Binary.dumpStringList$ASLCompressionReport$ = function (strList, report) { - /** @type {Array.} */ - 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.>} strMap - * @return {!string} - */ -Binary.dumpStringListMap$HAS = function (strMap) { - return Binary$dumpStringListMap$HASLCompressionReport$(strMap, null); -}; - -var Binary$dumpStringListMap$HAS = Binary.dumpStringListMap$HAS; - -/** - * @param {Object.>} strMap - * @param {CompressionReport} report - * @return {!string} - */ -Binary.dumpStringListMap$HASLCompressionReport$ = function (strMap, report) { - /** @type {Array.} */ - 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.} array - * @return {!string} - */ -Binary.dump32bitNumberList$AN = function (array) { - return Binary$dump32bitNumberList$ANLCompressionReport$(array, null); -}; - -var Binary$dump32bitNumberList$AN = Binary.dump32bitNumberList$AN; - -/** - * @param {Array.} array - * @param {CompressionReport} report - * @return {!string} - */ -Binary.dump32bitNumberList$ANLCompressionReport$ = function (array, report) { - /** @type {Array.} */ - 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.} 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.} */ - 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.} 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.} 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.} array - * @param {!number} offset - * @param {!number} length - * @return {!string} - */ -Binary._nonZeroBlock$ANII = function (array, offset, length) { - /** @type {Array.} */ - 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.} array - * @param {!number} offset - * @return {!string} - */ -Binary._createZebraCode$ANI = function (array, offset) { - /** @type {!number} */ - var last; - /** @type {!number} */ - var code; - /** @type {Array.} */ - 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.} */ - var out; - /** @type {Array.} */ - 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.} source - * @return {!string} - */ -Binary._mergeCharCode$AI = function (source) { - /** @type {Array.} */ - 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.} */ - 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.} */ - 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.} */ - 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.} */ - 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.} */ - 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.} - */ -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.} */ - 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.} - */ -SearchUnit.getPositions$LSearchUnit$ = function ($this) { - /** @type {Array.} */ - 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.} */ - var unitIds$0; - /** @type {Array.} */ - 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.} 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.} - */ -SearchSummary.getProposal$LSearchSummary$ = function ($this) { - /** @type {Array.} */ - var proposals; - /** @type {!number} */ - var i; - /** @type {Array.} */ - 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.} - */ -SearchSummary.getSortedResult$LSearchSummary$ = function ($this) { - /** @type {Array.} */ - var result; - /** @type {Array.} */ - 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.} 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.} 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.} 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.} 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.} 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.} 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.} words - * @return {Array.} - */ -BaseStemmer.prototype.stemWords$AS = function (words) { - /** @type {Array.} */ - 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.} 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.} */ - 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.} */ - 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.} 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.} 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.} 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.} - */ -Table.prototype.getCell$I = function (position) { - /** @type {!number} */ - var row; - /** @type {!number} */ - var currentColumn; - /** @type {!number} */ - var lastRowColumn; - /** @type {!number} */ - var startPosition; - /** @type {Array.} */ - 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.} - */ -Table.prototype.getRowContent$I = function (rowIndex) { - /** @type {!string} */ - var content; - /** @type {Array.} */ - var values; - /** @type {Object.} */ - 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.} 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.} 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.} */ - 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.} */ - var pos; - pos = [ ]; - return this.getRows$SAI(key, pos); -}; - -/** - * @param {!string} key - * @param {Array.} 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.} */ - 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.} */ - 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.} - */ -FMIndex.prototype.search$S = function (keyword) { - /** @type {Array.} */ - var result; - /** @type {Array.} */ - 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.} */ - 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.} 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.>} 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, "
").replace(/&/g, "&").replace(/"/g, """).replace(//g, ">"); -}; - -var _HTMLHandler$escapeHTML$S = _HTMLHandler.escapeHTML$S; - -/** - * @param {!string} tagname - * @param {Object.} 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, "
").replace(/&/g, "&").replace(/"/g, """).replace(//g, ">")); - } 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.} */ - var charclass$0; - /** @type {Object.} */ - var charclass$1; - /** @type {RegExp} */ - var charclass$2; - /** @type {Object.} */ - var charclass$3; - /** @type {Object.} */ - var charclass$4; - /** @type {Object.} */ - var charclass$5; - /** @type {!string} */ - var text$0; - /** @type {Object.} */ - var charclass$6; - /** @type {RegExp} */ - var charclass$7; - /** @type {Object.} */ - var charclass$8; - /** @type {Object.} */ - var charclass$9; - /** @type {RegExp} */ - var charclass$10; - /** @type {Object.} */ - var charclass$11; - /** @type {RegExp} */ - var charclass$12; - /** @type {Object.} */ - var charclass$13; - /** @type {RegExp} */ - var charclass$14; - /** @type {Object.} */ - var charclass$15; - /** @type {Object.} */ - var charclass$16; - /** @type {Object.} */ - var charclass$17; - /** @type {Object.} */ - var charclass$18; - /** @type {RegExp} */ - var charclass$19; - /** @type {RegExp} */ - var charclass$20; - /** @type {Object.} */ - var charclass$21; - /** @type {Object.} */ - var charclass$22; - /** @type {Object.} */ - var charclass$23; - /** @type {Object.} */ - 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 += "") { - this.closeTag$(); - } else { - charclass$20 = _.nameBody; - if (charclass$20.test(c)) { - this.tagName += c; - } else { - if (this.script) { - this.script += "") { - 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.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.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.} - */ -Char.prototype._charClass$S = function (str) { - /** @type {Object.} */ - 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.} 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.} 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.} - */ -_Entities.entity_list$ = function () { - /** @type {Object.} */ - 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.} */ - var _v$0; - /** @type {Array.} */ - 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.} */ - 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.} */ - 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.} */ - var _bv$0; - /** @type {Array.} */ - 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.} */ - var range_tmp; - /** @type {!number} */ - var code; - /** @type {!boolean} */ - var bit; - /** @type {!number} */ - var key; - /** @type {Object.} */ - 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.} */ - 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.} */ - var contents; - /** @type {!number} */ - var i; - /** @type {Array.} */ - 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.} */ - var contents; - /** @type {!number} */ - var i; - /** @type {Array.} */ - 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.} input - * @return {Object.} - */ -WaveletMatrix._shallow_copy$HI = function (input) { - /** @type {Object.} */ - 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.} */ - 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.} */ - 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.} array - */ -function OArray$AI(array) { - this.array = array; - this.offset = 0; -}; - -OArray$AI.prototype = new OArray; - -/** - * @constructor - * @param {Array.} 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.} */ - 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.} */ - 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.} 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.} SA - * @param {OArray} s - * @param {Array.} 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.} SA - * @param {OArray} s - * @param {Array.} 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.} - */ -SAIS.make$S = function (source) { - /** @type {Array.} */ - var charCodes; - /** @type {!number} */ - var maxCode; - /** @type {!number} */ - var i; - /** @type {!number} */ - var code; - /** @type {Array.} */ - 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.} 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.} */ - 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.} */ - 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': [ '', '' ], 'url': [ '', '' ], 'hit': [ '', '' ], 'del': [ '', '' ], 'summary': [ '', '' ] }); -}); -$__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 deleted file mode 100644 index 4e4e65a8f..000000000 --- a/web/server/h2o/libh2o/misc/oktavia/lib/oktavia-romanian-search.js +++ /dev/null @@ -1,8488 +0,0 @@ -// 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.} 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.} */ - 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.} - */ -OktaviaSearch.prototype.pageIndexes$ = function () { - /** @type {Array.} */ - 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.} - */ -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.} */ - var results; - /** @type {!number} */ - var i; - /** @type {SearchUnit} */ - var unit; - /** @type {Array.} */ - var info; - /** @type {!string} */ - var content; - /** @type {Array.} */ - 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('*').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('
'); - } else { - text = content.slice(0, end - start) + ' ...
'; - } - text = text.replace(Oktavia.eob, ' ').replace(/()()+/, '

'); - 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.} - */ -OktaviaSearch.prototype.getProposals$ = function () { - /** @type {Style} */ - var style; - /** @type {Array.} */ - var results; - /** @type {!number} */ - var i; - /** @type {Proposal} */ - var proposal; - /** @type {Array.} */ - var label; - /** @type {Array.} */ - 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('' + this._queries[j].toString() + '')); - option.push(this._queries[j].toString()); - } else { - label.push(style.convert$S('' + this._queries[j].toString() + '')); - } - } - results.push(({options: option.join(' '), label: label.join(' '), count: proposal.expect})); - } - } - } - return results; -}; - -/** - * @param {SearchSummary} summary - * @return {Array.} - */ -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.} 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.} */ - 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.} 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.} */ - 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.} */ - 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.} */ - 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.} */ - 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.} - */ -Oktavia.prototype.rawSearch$SB = function (keyword, stemming) { - /** @type {Array.} */ - var result; - /** @type {!string} */ - var baseWord; - /** @type {Array.} */ - 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.} 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.} */ - 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.} */ - 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.} */ - 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.} */ - 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.} */ - var charCodes; - /** @type {!number} */ - var i; - /** @type {!number} */ - var charCode; - /** @type {Array.} */ - 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.} strList - * @return {!string} - */ -Binary.dumpStringList$AS = function (strList) { - return Binary$dumpStringList$ASLCompressionReport$(strList, null); -}; - -var Binary$dumpStringList$AS = Binary.dumpStringList$AS; - -/** - * @param {Array.} strList - * @param {CompressionReport} report - * @return {!string} - */ -Binary.dumpStringList$ASLCompressionReport$ = function (strList, report) { - /** @type {Array.} */ - 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.>} strMap - * @return {!string} - */ -Binary.dumpStringListMap$HAS = function (strMap) { - return Binary$dumpStringListMap$HASLCompressionReport$(strMap, null); -}; - -var Binary$dumpStringListMap$HAS = Binary.dumpStringListMap$HAS; - -/** - * @param {Object.>} strMap - * @param {CompressionReport} report - * @return {!string} - */ -Binary.dumpStringListMap$HASLCompressionReport$ = function (strMap, report) { - /** @type {Array.} */ - 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.} array - * @return {!string} - */ -Binary.dump32bitNumberList$AN = function (array) { - return Binary$dump32bitNumberList$ANLCompressionReport$(array, null); -}; - -var Binary$dump32bitNumberList$AN = Binary.dump32bitNumberList$AN; - -/** - * @param {Array.} array - * @param {CompressionReport} report - * @return {!string} - */ -Binary.dump32bitNumberList$ANLCompressionReport$ = function (array, report) { - /** @type {Array.} */ - 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.} 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.} */ - 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.} 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.} 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.} array - * @param {!number} offset - * @param {!number} length - * @return {!string} - */ -Binary._nonZeroBlock$ANII = function (array, offset, length) { - /** @type {Array.} */ - 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.} array - * @param {!number} offset - * @return {!string} - */ -Binary._createZebraCode$ANI = function (array, offset) { - /** @type {!number} */ - var last; - /** @type {!number} */ - var code; - /** @type {Array.} */ - 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.} */ - var out; - /** @type {Array.} */ - 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.} source - * @return {!string} - */ -Binary._mergeCharCode$AI = function (source) { - /** @type {Array.} */ - 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.} */ - 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.} */ - 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.} */ - 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.} */ - 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.} */ - 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.} - */ -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.} */ - 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.} - */ -SearchUnit.getPositions$LSearchUnit$ = function ($this) { - /** @type {Array.} */ - 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.} */ - var unitIds$0; - /** @type {Array.} */ - 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.} 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.} - */ -SearchSummary.getProposal$LSearchSummary$ = function ($this) { - /** @type {Array.} */ - var proposals; - /** @type {!number} */ - var i; - /** @type {Array.} */ - 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.} - */ -SearchSummary.getSortedResult$LSearchSummary$ = function ($this) { - /** @type {Array.} */ - var result; - /** @type {Array.} */ - 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.} 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.} 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.} 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.} 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.} 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.} 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.} words - * @return {Array.} - */ -BaseStemmer.prototype.stemWords$AS = function (words) { - /** @type {Array.} */ - 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.} 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.} */ - 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.} */ - 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.} 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.} 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.} 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.} - */ -Table.prototype.getCell$I = function (position) { - /** @type {!number} */ - var row; - /** @type {!number} */ - var currentColumn; - /** @type {!number} */ - var lastRowColumn; - /** @type {!number} */ - var startPosition; - /** @type {Array.} */ - 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.} - */ -Table.prototype.getRowContent$I = function (rowIndex) { - /** @type {!string} */ - var content; - /** @type {Array.} */ - var values; - /** @type {Object.} */ - 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.} 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.} 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.} */ - 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.} */ - var pos; - pos = [ ]; - return this.getRows$SAI(key, pos); -}; - -/** - * @param {!string} key - * @param {Array.} 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.} */ - 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.} */ - 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.} - */ -FMIndex.prototype.search$S = function (keyword) { - /** @type {Array.} */ - var result; - /** @type {Array.} */ - 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.} */ - 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.} 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.>} 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, "
").replace(/&/g, "&").replace(/"/g, """).replace(//g, ">"); -}; - -var _HTMLHandler$escapeHTML$S = _HTMLHandler.escapeHTML$S; - -/** - * @param {!string} tagname - * @param {Object.} 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, "
").replace(/&/g, "&").replace(/"/g, """).replace(//g, ">")); - } 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.} */ - var charclass$0; - /** @type {Object.} */ - var charclass$1; - /** @type {RegExp} */ - var charclass$2; - /** @type {Object.} */ - var charclass$3; - /** @type {Object.} */ - var charclass$4; - /** @type {Object.} */ - var charclass$5; - /** @type {!string} */ - var text$0; - /** @type {Object.} */ - var charclass$6; - /** @type {RegExp} */ - var charclass$7; - /** @type {Object.} */ - var charclass$8; - /** @type {Object.} */ - var charclass$9; - /** @type {RegExp} */ - var charclass$10; - /** @type {Object.} */ - var charclass$11; - /** @type {RegExp} */ - var charclass$12; - /** @type {Object.} */ - var charclass$13; - /** @type {RegExp} */ - var charclass$14; - /** @type {Object.} */ - var charclass$15; - /** @type {Object.} */ - var charclass$16; - /** @type {Object.} */ - var charclass$17; - /** @type {Object.} */ - var charclass$18; - /** @type {RegExp} */ - var charclass$19; - /** @type {RegExp} */ - var charclass$20; - /** @type {Object.} */ - var charclass$21; - /** @type {Object.} */ - var charclass$22; - /** @type {Object.} */ - var charclass$23; - /** @type {Object.} */ - 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 += "") { - this.closeTag$(); - } else { - charclass$20 = _.nameBody; - if (charclass$20.test(c)) { - this.tagName += c; - } else { - if (this.script) { - this.script += "") { - 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.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.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.} - */ -Char.prototype._charClass$S = function (str) { - /** @type {Object.} */ - 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.} 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.} 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.} - */ -_Entities.entity_list$ = function () { - /** @type {Object.} */ - 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.} */ - var _v$0; - /** @type {Array.} */ - 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.} */ - 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.} */ - 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.} */ - var _bv$0; - /** @type {Array.} */ - 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.} */ - var range_tmp; - /** @type {!number} */ - var code; - /** @type {!boolean} */ - var bit; - /** @type {!number} */ - var key; - /** @type {Object.} */ - 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.} */ - 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.} */ - var contents; - /** @type {!number} */ - var i; - /** @type {Array.} */ - 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.} */ - var contents; - /** @type {!number} */ - var i; - /** @type {Array.} */ - 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.} input - * @return {Object.} - */ -WaveletMatrix._shallow_copy$HI = function (input) { - /** @type {Object.} */ - 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.} */ - 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.} */ - 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.} array - */ -function OArray$AI(array) { - this.array = array; - this.offset = 0; -}; - -OArray$AI.prototype = new OArray; - -/** - * @constructor - * @param {Array.} 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.} */ - 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.} */ - 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.} 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.} SA - * @param {OArray} s - * @param {Array.} 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.} SA - * @param {OArray} s - * @param {Array.} 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.} - */ -SAIS.make$S = function (source) { - /** @type {Array.} */ - var charCodes; - /** @type {!number} */ - var maxCode; - /** @type {!number} */ - var i; - /** @type {!number} */ - var code; - /** @type {Array.} */ - 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.} 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.} */ - 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.} */ - 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': [ '', '' ], 'url': [ '', '' ], 'hit': [ '', '' ], 'del': [ '', '' ], 'summary': [ '', '' ] }); -}); -$__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 deleted file mode 100644 index 5cbe89518..000000000 --- a/web/server/h2o/libh2o/misc/oktavia/lib/oktavia-russian-search.js +++ /dev/null @@ -1,8254 +0,0 @@ -// 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.} 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.} */ - 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.} - */ -OktaviaSearch.prototype.pageIndexes$ = function () { - /** @type {Array.} */ - 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.} - */ -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.} */ - var results; - /** @type {!number} */ - var i; - /** @type {SearchUnit} */ - var unit; - /** @type {Array.} */ - var info; - /** @type {!string} */ - var content; - /** @type {Array.} */ - 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('*').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('
'); - } else { - text = content.slice(0, end - start) + ' ...
'; - } - text = text.replace(Oktavia.eob, ' ').replace(/()()+/, '

'); - 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.} - */ -OktaviaSearch.prototype.getProposals$ = function () { - /** @type {Style} */ - var style; - /** @type {Array.} */ - var results; - /** @type {!number} */ - var i; - /** @type {Proposal} */ - var proposal; - /** @type {Array.} */ - var label; - /** @type {Array.} */ - 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('' + this._queries[j].toString() + '')); - option.push(this._queries[j].toString()); - } else { - label.push(style.convert$S('' + this._queries[j].toString() + '')); - } - } - results.push(({options: option.join(' '), label: label.join(' '), count: proposal.expect})); - } - } - } - return results; -}; - -/** - * @param {SearchSummary} summary - * @return {Array.} - */ -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.} 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.} */ - 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.} 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.} */ - 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.} */ - 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.} */ - 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.} */ - 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.} - */ -Oktavia.prototype.rawSearch$SB = function (keyword, stemming) { - /** @type {Array.} */ - var result; - /** @type {!string} */ - var baseWord; - /** @type {Array.} */ - 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.} 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.} */ - 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.} */ - 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.} */ - 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.} */ - 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.} */ - var charCodes; - /** @type {!number} */ - var i; - /** @type {!number} */ - var charCode; - /** @type {Array.} */ - 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.} strList - * @return {!string} - */ -Binary.dumpStringList$AS = function (strList) { - return Binary$dumpStringList$ASLCompressionReport$(strList, null); -}; - -var Binary$dumpStringList$AS = Binary.dumpStringList$AS; - -/** - * @param {Array.} strList - * @param {CompressionReport} report - * @return {!string} - */ -Binary.dumpStringList$ASLCompressionReport$ = function (strList, report) { - /** @type {Array.} */ - 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.>} strMap - * @return {!string} - */ -Binary.dumpStringListMap$HAS = function (strMap) { - return Binary$dumpStringListMap$HASLCompressionReport$(strMap, null); -}; - -var Binary$dumpStringListMap$HAS = Binary.dumpStringListMap$HAS; - -/** - * @param {Object.>} strMap - * @param {CompressionReport} report - * @return {!string} - */ -Binary.dumpStringListMap$HASLCompressionReport$ = function (strMap, report) { - /** @type {Array.} */ - 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.} array - * @return {!string} - */ -Binary.dump32bitNumberList$AN = function (array) { - return Binary$dump32bitNumberList$ANLCompressionReport$(array, null); -}; - -var Binary$dump32bitNumberList$AN = Binary.dump32bitNumberList$AN; - -/** - * @param {Array.} array - * @param {CompressionReport} report - * @return {!string} - */ -Binary.dump32bitNumberList$ANLCompressionReport$ = function (array, report) { - /** @type {Array.} */ - 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.} 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.} */ - 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.} 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.} 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.} array - * @param {!number} offset - * @param {!number} length - * @return {!string} - */ -Binary._nonZeroBlock$ANII = function (array, offset, length) { - /** @type {Array.} */ - 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.} array - * @param {!number} offset - * @return {!string} - */ -Binary._createZebraCode$ANI = function (array, offset) { - /** @type {!number} */ - var last; - /** @type {!number} */ - var code; - /** @type {Array.} */ - 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.} */ - var out; - /** @type {Array.} */ - 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.} source - * @return {!string} - */ -Binary._mergeCharCode$AI = function (source) { - /** @type {Array.} */ - 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.} */ - 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.} */ - 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.} */ - 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.} */ - 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.} */ - 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.} - */ -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.} */ - 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.} - */ -SearchUnit.getPositions$LSearchUnit$ = function ($this) { - /** @type {Array.} */ - 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.} */ - var unitIds$0; - /** @type {Array.} */ - 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.} 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.} - */ -SearchSummary.getProposal$LSearchSummary$ = function ($this) { - /** @type {Array.} */ - var proposals; - /** @type {!number} */ - var i; - /** @type {Array.} */ - 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.} - */ -SearchSummary.getSortedResult$LSearchSummary$ = function ($this) { - /** @type {Array.} */ - var result; - /** @type {Array.} */ - 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.} 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.} 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.} 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.} 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.} 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.} 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.} words - * @return {Array.} - */ -BaseStemmer.prototype.stemWords$AS = function (words) { - /** @type {Array.} */ - 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.} 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.} */ - 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.} */ - 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.} 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.} 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.} 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.} - */ -Table.prototype.getCell$I = function (position) { - /** @type {!number} */ - var row; - /** @type {!number} */ - var currentColumn; - /** @type {!number} */ - var lastRowColumn; - /** @type {!number} */ - var startPosition; - /** @type {Array.} */ - 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.} - */ -Table.prototype.getRowContent$I = function (rowIndex) { - /** @type {!string} */ - var content; - /** @type {Array.} */ - var values; - /** @type {Object.} */ - 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.} 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.} 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.} */ - 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.} */ - var pos; - pos = [ ]; - return this.getRows$SAI(key, pos); -}; - -/** - * @param {!string} key - * @param {Array.} 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.} */ - 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.} */ - 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.} - */ -FMIndex.prototype.search$S = function (keyword) { - /** @type {Array.} */ - var result; - /** @type {Array.} */ - 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.} */ - 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.} 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.>} 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, "
").replace(/&/g, "&").replace(/"/g, """).replace(//g, ">"); -}; - -var _HTMLHandler$escapeHTML$S = _HTMLHandler.escapeHTML$S; - -/** - * @param {!string} tagname - * @param {Object.} 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, "
").replace(/&/g, "&").replace(/"/g, """).replace(//g, ">")); - } 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.} */ - var charclass$0; - /** @type {Object.} */ - var charclass$1; - /** @type {RegExp} */ - var charclass$2; - /** @type {Object.} */ - var charclass$3; - /** @type {Object.} */ - var charclass$4; - /** @type {Object.} */ - var charclass$5; - /** @type {!string} */ - var text$0; - /** @type {Object.} */ - var charclass$6; - /** @type {RegExp} */ - var charclass$7; - /** @type {Object.} */ - var charclass$8; - /** @type {Object.} */ - var charclass$9; - /** @type {RegExp} */ - var charclass$10; - /** @type {Object.} */ - var charclass$11; - /** @type {RegExp} */ - var charclass$12; - /** @type {Object.} */ - var charclass$13; - /** @type {RegExp} */ - var charclass$14; - /** @type {Object.} */ - var charclass$15; - /** @type {Object.} */ - var charclass$16; - /** @type {Object.} */ - var charclass$17; - /** @type {Object.} */ - var charclass$18; - /** @type {RegExp} */ - var charclass$19; - /** @type {RegExp} */ - var charclass$20; - /** @type {Object.} */ - var charclass$21; - /** @type {Object.} */ - var charclass$22; - /** @type {Object.} */ - var charclass$23; - /** @type {Object.} */ - 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 += "") { - this.closeTag$(); - } else { - charclass$20 = _.nameBody; - if (charclass$20.test(c)) { - this.tagName += c; - } else { - if (this.script) { - this.script += "") { - 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.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.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.} - */ -Char.prototype._charClass$S = function (str) { - /** @type {Object.} */ - 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.} 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.} 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.} - */ -_Entities.entity_list$ = function () { - /** @type {Object.} */ - 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.} */ - var _v$0; - /** @type {Array.} */ - 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.} */ - 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.} */ - 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.} */ - var _bv$0; - /** @type {Array.} */ - 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.} */ - var range_tmp; - /** @type {!number} */ - var code; - /** @type {!boolean} */ - var bit; - /** @type {!number} */ - var key; - /** @type {Object.} */ - 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.} */ - 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.} */ - var contents; - /** @type {!number} */ - var i; - /** @type {Array.} */ - 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.} */ - var contents; - /** @type {!number} */ - var i; - /** @type {Array.} */ - 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.} input - * @return {Object.} - */ -WaveletMatrix._shallow_copy$HI = function (input) { - /** @type {Object.} */ - 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.} */ - 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.} */ - 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.} array - */ -function OArray$AI(array) { - this.array = array; - this.offset = 0; -}; - -OArray$AI.prototype = new OArray; - -/** - * @constructor - * @param {Array.} 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.} */ - 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.} */ - 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.} 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.} SA - * @param {OArray} s - * @param {Array.} 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.} SA - * @param {OArray} s - * @param {Array.} 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.} - */ -SAIS.make$S = function (source) { - /** @type {Array.} */ - var charCodes; - /** @type {!number} */ - var maxCode; - /** @type {!number} */ - var i; - /** @type {!number} */ - var code; - /** @type {Array.} */ - 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.} 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.} */ - 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.} */ - 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': [ '', '' ], 'url': [ '', '' ], 'hit': [ '', '' ], 'del': [ '', '' ], 'summary': [ '', '' ] }); -}); -$__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 deleted file mode 100644 index fce9732a7..000000000 --- a/web/server/h2o/libh2o/misc/oktavia/lib/oktavia-search.js +++ /dev/null @@ -1,6795 +0,0 @@ -// 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.} */ - 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.} - */ -OktaviaSearch.prototype.pageIndexes$ = function () { - /** @type {Array.} */ - 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.} - */ -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.} */ - var results; - /** @type {!number} */ - var i; - /** @type {SearchUnit} */ - var unit; - /** @type {Array.} */ - var info; - /** @type {!string} */ - var content; - /** @type {Array.} */ - 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('*').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('
'); - } else { - text = content.slice(0, end - start) + ' ...
'; - } - text = text.replace(Oktavia.eob, ' ').replace(/()()+/, '

'); - 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.} - */ -OktaviaSearch.prototype.getProposals$ = function () { - /** @type {Style} */ - var style; - /** @type {Array.} */ - var results; - /** @type {!number} */ - var i; - /** @type {Proposal} */ - var proposal; - /** @type {Array.} */ - var label; - /** @type {Array.} */ - 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('' + this._queries[j].toString() + '')); - option.push(this._queries[j].toString()); - } else { - label.push(style.convert$S('' + this._queries[j].toString() + '')); - } - } - results.push(({options: option.join(' '), label: label.join(' '), count: proposal.expect})); - } - } - } - return results; -}; - -/** - * @param {SearchSummary} summary - * @return {Array.} - */ -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.} 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.} */ - 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.} 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.} */ - 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.} */ - 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.} */ - 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.} */ - 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.} - */ -Oktavia.prototype.rawSearch$SB = function (keyword, stemming) { - /** @type {Array.} */ - var result; - /** @type {!string} */ - var baseWord; - /** @type {Array.} */ - 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.} 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.} */ - 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.} */ - 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.} */ - 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.} */ - 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.} */ - var charCodes; - /** @type {!number} */ - var i; - /** @type {!number} */ - var charCode; - /** @type {Array.} */ - 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.} strList - * @return {!string} - */ -Binary.dumpStringList$AS = function (strList) { - return Binary$dumpStringList$ASLCompressionReport$(strList, null); -}; - -var Binary$dumpStringList$AS = Binary.dumpStringList$AS; - -/** - * @param {Array.} strList - * @param {CompressionReport} report - * @return {!string} - */ -Binary.dumpStringList$ASLCompressionReport$ = function (strList, report) { - /** @type {Array.} */ - 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.>} strMap - * @return {!string} - */ -Binary.dumpStringListMap$HAS = function (strMap) { - return Binary$dumpStringListMap$HASLCompressionReport$(strMap, null); -}; - -var Binary$dumpStringListMap$HAS = Binary.dumpStringListMap$HAS; - -/** - * @param {Object.>} strMap - * @param {CompressionReport} report - * @return {!string} - */ -Binary.dumpStringListMap$HASLCompressionReport$ = function (strMap, report) { - /** @type {Array.} */ - 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.} array - * @return {!string} - */ -Binary.dump32bitNumberList$AN = function (array) { - return Binary$dump32bitNumberList$ANLCompressionReport$(array, null); -}; - -var Binary$dump32bitNumberList$AN = Binary.dump32bitNumberList$AN; - -/** - * @param {Array.} array - * @param {CompressionReport} report - * @return {!string} - */ -Binary.dump32bitNumberList$ANLCompressionReport$ = function (array, report) { - /** @type {Array.} */ - 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.} 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.} */ - 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.} 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.} 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.} array - * @param {!number} offset - * @param {!number} length - * @return {!string} - */ -Binary._nonZeroBlock$ANII = function (array, offset, length) { - /** @type {Array.} */ - 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.} array - * @param {!number} offset - * @return {!string} - */ -Binary._createZebraCode$ANI = function (array, offset) { - /** @type {!number} */ - var last; - /** @type {!number} */ - var code; - /** @type {Array.} */ - 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.} */ - var out; - /** @type {Array.} */ - 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.} source - * @return {!string} - */ -Binary._mergeCharCode$AI = function (source) { - /** @type {Array.} */ - 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.} */ - 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.} */ - 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.} */ - 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.} */ - 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.} */ - 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.} - */ -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.} */ - 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.} - */ -SearchUnit.getPositions$LSearchUnit$ = function ($this) { - /** @type {Array.} */ - 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.} */ - var unitIds$0; - /** @type {Array.} */ - 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.} 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.} - */ -SearchSummary.getProposal$LSearchSummary$ = function ($this) { - /** @type {Array.} */ - var proposals; - /** @type {!number} */ - var i; - /** @type {Array.} */ - 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.} - */ -SearchSummary.getSortedResult$LSearchSummary$ = function ($this) { - /** @type {Array.} */ - var result; - /** @type {Array.} */ - 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.} 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.} */ - 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.} */ - 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.} 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.} 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.} 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.} - */ -Table.prototype.getCell$I = function (position) { - /** @type {!number} */ - var row; - /** @type {!number} */ - var currentColumn; - /** @type {!number} */ - var lastRowColumn; - /** @type {!number} */ - var startPosition; - /** @type {Array.} */ - 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.} - */ -Table.prototype.getRowContent$I = function (rowIndex) { - /** @type {!string} */ - var content; - /** @type {Array.} */ - var values; - /** @type {Object.} */ - 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.} 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.} 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.} */ - 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.} */ - var pos; - pos = [ ]; - return this.getRows$SAI(key, pos); -}; - -/** - * @param {!string} key - * @param {Array.} 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.} */ - 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.} */ - 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.} - */ -FMIndex.prototype.search$S = function (keyword) { - /** @type {Array.} */ - var result; - /** @type {Array.} */ - 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.} */ - 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.} 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.>} 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, "
").replace(/&/g, "&").replace(/"/g, """).replace(//g, ">"); -}; - -var _HTMLHandler$escapeHTML$S = _HTMLHandler.escapeHTML$S; - -/** - * @param {!string} tagname - * @param {Object.} 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, "
").replace(/&/g, "&").replace(/"/g, """).replace(//g, ">")); - } 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.} */ - var charclass$0; - /** @type {Object.} */ - var charclass$1; - /** @type {RegExp} */ - var charclass$2; - /** @type {Object.} */ - var charclass$3; - /** @type {Object.} */ - var charclass$4; - /** @type {Object.} */ - var charclass$5; - /** @type {!string} */ - var text$0; - /** @type {Object.} */ - var charclass$6; - /** @type {RegExp} */ - var charclass$7; - /** @type {Object.} */ - var charclass$8; - /** @type {Object.} */ - var charclass$9; - /** @type {RegExp} */ - var charclass$10; - /** @type {Object.} */ - var charclass$11; - /** @type {RegExp} */ - var charclass$12; - /** @type {Object.} */ - var charclass$13; - /** @type {RegExp} */ - var charclass$14; - /** @type {Object.} */ - var charclass$15; - /** @type {Object.} */ - var charclass$16; - /** @type {Object.} */ - var charclass$17; - /** @type {Object.} */ - var charclass$18; - /** @type {RegExp} */ - var charclass$19; - /** @type {RegExp} */ - var charclass$20; - /** @type {Object.} */ - var charclass$21; - /** @type {Object.} */ - var charclass$22; - /** @type {Object.} */ - var charclass$23; - /** @type {Object.} */ - 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 += "") { - this.closeTag$(); - } else { - charclass$20 = _.nameBody; - if (charclass$20.test(c)) { - this.tagName += c; - } else { - if (this.script) { - this.script += "") { - 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.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.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.} - */ -Char.prototype._charClass$S = function (str) { - /** @type {Object.} */ - 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.} 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.} 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.} - */ -_Entities.entity_list$ = function () { - /** @type {Object.} */ - 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.} */ - var _v$0; - /** @type {Array.} */ - 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.} */ - 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.} */ - 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.} */ - var _bv$0; - /** @type {Array.} */ - 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.} */ - var range_tmp; - /** @type {!number} */ - var code; - /** @type {!boolean} */ - var bit; - /** @type {!number} */ - var key; - /** @type {Object.} */ - 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.} */ - 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.} */ - var contents; - /** @type {!number} */ - var i; - /** @type {Array.} */ - 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.} */ - var contents; - /** @type {!number} */ - var i; - /** @type {Array.} */ - 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.} input - * @return {Object.} - */ -WaveletMatrix._shallow_copy$HI = function (input) { - /** @type {Object.} */ - 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.} */ - 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.} */ - 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.} array - */ -function OArray$AI(array) { - this.array = array; - this.offset = 0; -}; - -OArray$AI.prototype = new OArray; - -/** - * @constructor - * @param {Array.} 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.} */ - 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.} */ - 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.} 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.} SA - * @param {OArray} s - * @param {Array.} 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.} SA - * @param {OArray} s - * @param {Array.} 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.} - */ -SAIS.make$S = function (source) { - /** @type {Array.} */ - var charCodes; - /** @type {!number} */ - var maxCode; - /** @type {!number} */ - var i; - /** @type {!number} */ - var code; - /** @type {Array.} */ - 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.} 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.} */ - 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.} */ - 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': [ '', '' ], 'url': [ '', '' ], 'hit': [ '', '' ], 'del': [ '', '' ], 'summary': [ '', '' ] }); -}); -$__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 deleted file mode 100644 index 7a8c74dd0..000000000 --- a/web/server/h2o/libh2o/misc/oktavia/lib/oktavia-spanish-search.js +++ /dev/null @@ -1,8607 +0,0 @@ -// 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.} 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.} */ - 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.} - */ -OktaviaSearch.prototype.pageIndexes$ = function () { - /** @type {Array.} */ - 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.} - */ -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.} */ - var results; - /** @type {!number} */ - var i; - /** @type {SearchUnit} */ - var unit; - /** @type {Array.} */ - var info; - /** @type {!string} */ - var content; - /** @type {Array.} */ - 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('*').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('
'); - } else { - text = content.slice(0, end - start) + ' ...
'; - } - text = text.replace(Oktavia.eob, ' ').replace(/()()+/, '

'); - 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.} - */ -OktaviaSearch.prototype.getProposals$ = function () { - /** @type {Style} */ - var style; - /** @type {Array.} */ - var results; - /** @type {!number} */ - var i; - /** @type {Proposal} */ - var proposal; - /** @type {Array.} */ - var label; - /** @type {Array.} */ - 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('' + this._queries[j].toString() + '')); - option.push(this._queries[j].toString()); - } else { - label.push(style.convert$S('' + this._queries[j].toString() + '')); - } - } - results.push(({options: option.join(' '), label: label.join(' '), count: proposal.expect})); - } - } - } - return results; -}; - -/** - * @param {SearchSummary} summary - * @return {Array.} - */ -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.} 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.} */ - 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.} 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.} */ - 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.} */ - 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.} */ - 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.} */ - 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.} - */ -Oktavia.prototype.rawSearch$SB = function (keyword, stemming) { - /** @type {Array.} */ - var result; - /** @type {!string} */ - var baseWord; - /** @type {Array.} */ - 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.} 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.} */ - 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.} */ - 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.} */ - 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.} */ - 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.} */ - var charCodes; - /** @type {!number} */ - var i; - /** @type {!number} */ - var charCode; - /** @type {Array.} */ - 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.} strList - * @return {!string} - */ -Binary.dumpStringList$AS = function (strList) { - return Binary$dumpStringList$ASLCompressionReport$(strList, null); -}; - -var Binary$dumpStringList$AS = Binary.dumpStringList$AS; - -/** - * @param {Array.} strList - * @param {CompressionReport} report - * @return {!string} - */ -Binary.dumpStringList$ASLCompressionReport$ = function (strList, report) { - /** @type {Array.} */ - 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.>} strMap - * @return {!string} - */ -Binary.dumpStringListMap$HAS = function (strMap) { - return Binary$dumpStringListMap$HASLCompressionReport$(strMap, null); -}; - -var Binary$dumpStringListMap$HAS = Binary.dumpStringListMap$HAS; - -/** - * @param {Object.>} strMap - * @param {CompressionReport} report - * @return {!string} - */ -Binary.dumpStringListMap$HASLCompressionReport$ = function (strMap, report) { - /** @type {Array.} */ - 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.} array - * @return {!string} - */ -Binary.dump32bitNumberList$AN = function (array) { - return Binary$dump32bitNumberList$ANLCompressionReport$(array, null); -}; - -var Binary$dump32bitNumberList$AN = Binary.dump32bitNumberList$AN; - -/** - * @param {Array.} array - * @param {CompressionReport} report - * @return {!string} - */ -Binary.dump32bitNumberList$ANLCompressionReport$ = function (array, report) { - /** @type {Array.} */ - 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.} 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.} */ - 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.} 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.} 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.} array - * @param {!number} offset - * @param {!number} length - * @return {!string} - */ -Binary._nonZeroBlock$ANII = function (array, offset, length) { - /** @type {Array.} */ - 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.} array - * @param {!number} offset - * @return {!string} - */ -Binary._createZebraCode$ANI = function (array, offset) { - /** @type {!number} */ - var last; - /** @type {!number} */ - var code; - /** @type {Array.} */ - 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.} */ - var out; - /** @type {Array.} */ - 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.} source - * @return {!string} - */ -Binary._mergeCharCode$AI = function (source) { - /** @type {Array.} */ - 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.} */ - 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.} */ - 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.} */ - 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.} */ - 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.} */ - 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.} - */ -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.} */ - 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.} - */ -SearchUnit.getPositions$LSearchUnit$ = function ($this) { - /** @type {Array.} */ - 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.} */ - var unitIds$0; - /** @type {Array.} */ - 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.} 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.} - */ -SearchSummary.getProposal$LSearchSummary$ = function ($this) { - /** @type {Array.} */ - var proposals; - /** @type {!number} */ - var i; - /** @type {Array.} */ - 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.} - */ -SearchSummary.getSortedResult$LSearchSummary$ = function ($this) { - /** @type {Array.} */ - var result; - /** @type {Array.} */ - 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.} 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.} 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.} 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.} 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.} 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.} 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.} words - * @return {Array.} - */ -BaseStemmer.prototype.stemWords$AS = function (words) { - /** @type {Array.} */ - 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.} 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.} */ - 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.} */ - 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.} 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.} 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.} 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.} - */ -Table.prototype.getCell$I = function (position) { - /** @type {!number} */ - var row; - /** @type {!number} */ - var currentColumn; - /** @type {!number} */ - var lastRowColumn; - /** @type {!number} */ - var startPosition; - /** @type {Array.} */ - 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.} - */ -Table.prototype.getRowContent$I = function (rowIndex) { - /** @type {!string} */ - var content; - /** @type {Array.} */ - var values; - /** @type {Object.} */ - 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.} 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.} 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.} */ - 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.} */ - var pos; - pos = [ ]; - return this.getRows$SAI(key, pos); -}; - -/** - * @param {!string} key - * @param {Array.} 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.} */ - 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.} */ - 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.} - */ -FMIndex.prototype.search$S = function (keyword) { - /** @type {Array.} */ - var result; - /** @type {Array.} */ - 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.} */ - 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.} 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.>} 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, "
").replace(/&/g, "&").replace(/"/g, """).replace(//g, ">"); -}; - -var _HTMLHandler$escapeHTML$S = _HTMLHandler.escapeHTML$S; - -/** - * @param {!string} tagname - * @param {Object.} 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, "
").replace(/&/g, "&").replace(/"/g, """).replace(//g, ">")); - } 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.} */ - var charclass$0; - /** @type {Object.} */ - var charclass$1; - /** @type {RegExp} */ - var charclass$2; - /** @type {Object.} */ - var charclass$3; - /** @type {Object.} */ - var charclass$4; - /** @type {Object.} */ - var charclass$5; - /** @type {!string} */ - var text$0; - /** @type {Object.} */ - var charclass$6; - /** @type {RegExp} */ - var charclass$7; - /** @type {Object.} */ - var charclass$8; - /** @type {Object.} */ - var charclass$9; - /** @type {RegExp} */ - var charclass$10; - /** @type {Object.} */ - var charclass$11; - /** @type {RegExp} */ - var charclass$12; - /** @type {Object.} */ - var charclass$13; - /** @type {RegExp} */ - var charclass$14; - /** @type {Object.} */ - var charclass$15; - /** @type {Object.} */ - var charclass$16; - /** @type {Object.} */ - var charclass$17; - /** @type {Object.} */ - var charclass$18; - /** @type {RegExp} */ - var charclass$19; - /** @type {RegExp} */ - var charclass$20; - /** @type {Object.} */ - var charclass$21; - /** @type {Object.} */ - var charclass$22; - /** @type {Object.} */ - var charclass$23; - /** @type {Object.} */ - 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 += "") { - this.closeTag$(); - } else { - charclass$20 = _.nameBody; - if (charclass$20.test(c)) { - this.tagName += c; - } else { - if (this.script) { - this.script += "") { - 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.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.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.} - */ -Char.prototype._charClass$S = function (str) { - /** @type {Object.} */ - 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.} 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.} 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.} - */ -_Entities.entity_list$ = function () { - /** @type {Object.} */ - 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.} */ - var _v$0; - /** @type {Array.} */ - 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.} */ - 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.} */ - 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.} */ - var _bv$0; - /** @type {Array.} */ - 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.} */ - var range_tmp; - /** @type {!number} */ - var code; - /** @type {!boolean} */ - var bit; - /** @type {!number} */ - var key; - /** @type {Object.} */ - 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.} */ - 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.} */ - var contents; - /** @type {!number} */ - var i; - /** @type {Array.} */ - 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.} */ - var contents; - /** @type {!number} */ - var i; - /** @type {Array.} */ - 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.} input - * @return {Object.} - */ -WaveletMatrix._shallow_copy$HI = function (input) { - /** @type {Object.} */ - 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.} */ - 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.} */ - 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.} array - */ -function OArray$AI(array) { - this.array = array; - this.offset = 0; -}; - -OArray$AI.prototype = new OArray; - -/** - * @constructor - * @param {Array.} 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.} */ - 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.} */ - 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.} 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.} SA - * @param {OArray} s - * @param {Array.} 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.} SA - * @param {OArray} s - * @param {Array.} 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.} - */ -SAIS.make$S = function (source) { - /** @type {Array.} */ - var charCodes; - /** @type {!number} */ - var maxCode; - /** @type {!number} */ - var i; - /** @type {!number} */ - var code; - /** @type {Array.} */ - 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.} 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.} */ - 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.} */ - 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': [ '', '' ], 'url': [ '', '' ], 'hit': [ '', '' ], 'del': [ '', '' ], 'summary': [ '', '' ] }); -}); -$__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 deleted file mode 100644 index c36b3db82..000000000 --- a/web/server/h2o/libh2o/misc/oktavia/lib/oktavia-swedish-search.js +++ /dev/null @@ -1,7934 +0,0 @@ -// 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.} 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.} */ - 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.} - */ -OktaviaSearch.prototype.pageIndexes$ = function () { - /** @type {Array.} */ - 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.} - */ -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.} */ - var results; - /** @type {!number} */ - var i; - /** @type {SearchUnit} */ - var unit; - /** @type {Array.} */ - var info; - /** @type {!string} */ - var content; - /** @type {Array.} */ - 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('*').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('
'); - } else { - text = content.slice(0, end - start) + ' ...
'; - } - text = text.replace(Oktavia.eob, ' ').replace(/()()+/, '

'); - 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.} - */ -OktaviaSearch.prototype.getProposals$ = function () { - /** @type {Style} */ - var style; - /** @type {Array.} */ - var results; - /** @type {!number} */ - var i; - /** @type {Proposal} */ - var proposal; - /** @type {Array.} */ - var label; - /** @type {Array.} */ - 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('' + this._queries[j].toString() + '')); - option.push(this._queries[j].toString()); - } else { - label.push(style.convert$S('' + this._queries[j].toString() + '')); - } - } - results.push(({options: option.join(' '), label: label.join(' '), count: proposal.expect})); - } - } - } - return results; -}; - -/** - * @param {SearchSummary} summary - * @return {Array.} - */ -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.} 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.} */ - 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.} 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.} */ - 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.} */ - 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.} */ - 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.} */ - 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.} - */ -Oktavia.prototype.rawSearch$SB = function (keyword, stemming) { - /** @type {Array.} */ - var result; - /** @type {!string} */ - var baseWord; - /** @type {Array.} */ - 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.} 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.} */ - 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.} */ - 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.} */ - 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.} */ - 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.} */ - var charCodes; - /** @type {!number} */ - var i; - /** @type {!number} */ - var charCode; - /** @type {Array.} */ - 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.} strList - * @return {!string} - */ -Binary.dumpStringList$AS = function (strList) { - return Binary$dumpStringList$ASLCompressionReport$(strList, null); -}; - -var Binary$dumpStringList$AS = Binary.dumpStringList$AS; - -/** - * @param {Array.} strList - * @param {CompressionReport} report - * @return {!string} - */ -Binary.dumpStringList$ASLCompressionReport$ = function (strList, report) { - /** @type {Array.} */ - 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.>} strMap - * @return {!string} - */ -Binary.dumpStringListMap$HAS = function (strMap) { - return Binary$dumpStringListMap$HASLCompressionReport$(strMap, null); -}; - -var Binary$dumpStringListMap$HAS = Binary.dumpStringListMap$HAS; - -/** - * @param {Object.>} strMap - * @param {CompressionReport} report - * @return {!string} - */ -Binary.dumpStringListMap$HASLCompressionReport$ = function (strMap, report) { - /** @type {Array.} */ - 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.} array - * @return {!string} - */ -Binary.dump32bitNumberList$AN = function (array) { - return Binary$dump32bitNumberList$ANLCompressionReport$(array, null); -}; - -var Binary$dump32bitNumberList$AN = Binary.dump32bitNumberList$AN; - -/** - * @param {Array.} array - * @param {CompressionReport} report - * @return {!string} - */ -Binary.dump32bitNumberList$ANLCompressionReport$ = function (array, report) { - /** @type {Array.} */ - 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.} 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.} */ - 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.} 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.} 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.} array - * @param {!number} offset - * @param {!number} length - * @return {!string} - */ -Binary._nonZeroBlock$ANII = function (array, offset, length) { - /** @type {Array.} */ - 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.} array - * @param {!number} offset - * @return {!string} - */ -Binary._createZebraCode$ANI = function (array, offset) { - /** @type {!number} */ - var last; - /** @type {!number} */ - var code; - /** @type {Array.} */ - 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.} */ - var out; - /** @type {Array.} */ - 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.} source - * @return {!string} - */ -Binary._mergeCharCode$AI = function (source) { - /** @type {Array.} */ - 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.} */ - 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.} */ - 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.} */ - 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.} */ - 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.} */ - 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.} - */ -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.} */ - 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.} - */ -SearchUnit.getPositions$LSearchUnit$ = function ($this) { - /** @type {Array.} */ - 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.} */ - var unitIds$0; - /** @type {Array.} */ - 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.} 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.} - */ -SearchSummary.getProposal$LSearchSummary$ = function ($this) { - /** @type {Array.} */ - var proposals; - /** @type {!number} */ - var i; - /** @type {Array.} */ - 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.} - */ -SearchSummary.getSortedResult$LSearchSummary$ = function ($this) { - /** @type {Array.} */ - var result; - /** @type {Array.} */ - 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.} 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.} 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.} 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.} 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.} 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.} 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.} words - * @return {Array.} - */ -BaseStemmer.prototype.stemWords$AS = function (words) { - /** @type {Array.} */ - 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.} 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.} */ - 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.} */ - 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.} 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.} 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.} 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.} - */ -Table.prototype.getCell$I = function (position) { - /** @type {!number} */ - var row; - /** @type {!number} */ - var currentColumn; - /** @type {!number} */ - var lastRowColumn; - /** @type {!number} */ - var startPosition; - /** @type {Array.} */ - 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.} - */ -Table.prototype.getRowContent$I = function (rowIndex) { - /** @type {!string} */ - var content; - /** @type {Array.} */ - var values; - /** @type {Object.} */ - 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.} 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.} 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.} */ - 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.} */ - var pos; - pos = [ ]; - return this.getRows$SAI(key, pos); -}; - -/** - * @param {!string} key - * @param {Array.} 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.} */ - 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.} */ - 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.} - */ -FMIndex.prototype.search$S = function (keyword) { - /** @type {Array.} */ - var result; - /** @type {Array.} */ - 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.} */ - 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.} 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.>} 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, "
").replace(/&/g, "&").replace(/"/g, """).replace(//g, ">"); -}; - -var _HTMLHandler$escapeHTML$S = _HTMLHandler.escapeHTML$S; - -/** - * @param {!string} tagname - * @param {Object.} 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, "
").replace(/&/g, "&").replace(/"/g, """).replace(//g, ">")); - } 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.} */ - var charclass$0; - /** @type {Object.} */ - var charclass$1; - /** @type {RegExp} */ - var charclass$2; - /** @type {Object.} */ - var charclass$3; - /** @type {Object.} */ - var charclass$4; - /** @type {Object.} */ - var charclass$5; - /** @type {!string} */ - var text$0; - /** @type {Object.} */ - var charclass$6; - /** @type {RegExp} */ - var charclass$7; - /** @type {Object.} */ - var charclass$8; - /** @type {Object.} */ - var charclass$9; - /** @type {RegExp} */ - var charclass$10; - /** @type {Object.} */ - var charclass$11; - /** @type {RegExp} */ - var charclass$12; - /** @type {Object.} */ - var charclass$13; - /** @type {RegExp} */ - var charclass$14; - /** @type {Object.} */ - var charclass$15; - /** @type {Object.} */ - var charclass$16; - /** @type {Object.} */ - var charclass$17; - /** @type {Object.} */ - var charclass$18; - /** @type {RegExp} */ - var charclass$19; - /** @type {RegExp} */ - var charclass$20; - /** @type {Object.} */ - var charclass$21; - /** @type {Object.} */ - var charclass$22; - /** @type {Object.} */ - var charclass$23; - /** @type {Object.} */ - 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 += "") { - this.closeTag$(); - } else { - charclass$20 = _.nameBody; - if (charclass$20.test(c)) { - this.tagName += c; - } else { - if (this.script) { - this.script += "") { - 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.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.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.} - */ -Char.prototype._charClass$S = function (str) { - /** @type {Object.} */ - 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.} 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.} 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.} - */ -_Entities.entity_list$ = function () { - /** @type {Object.} */ - 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.} */ - var _v$0; - /** @type {Array.} */ - 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.} */ - 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.} */ - 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.} */ - var _bv$0; - /** @type {Array.} */ - 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.} */ - var range_tmp; - /** @type {!number} */ - var code; - /** @type {!boolean} */ - var bit; - /** @type {!number} */ - var key; - /** @type {Object.} */ - 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.} */ - 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.} */ - var contents; - /** @type {!number} */ - var i; - /** @type {Array.} */ - 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.} */ - var contents; - /** @type {!number} */ - var i; - /** @type {Array.} */ - 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.} input - * @return {Object.} - */ -WaveletMatrix._shallow_copy$HI = function (input) { - /** @type {Object.} */ - 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.} */ - 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.} */ - 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.} array - */ -function OArray$AI(array) { - this.array = array; - this.offset = 0; -}; - -OArray$AI.prototype = new OArray; - -/** - * @constructor - * @param {Array.} 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.} */ - 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.} */ - 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.} 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.} SA - * @param {OArray} s - * @param {Array.} 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.} SA - * @param {OArray} s - * @param {Array.} 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.} - */ -SAIS.make$S = function (source) { - /** @type {Array.} */ - var charCodes; - /** @type {!number} */ - var maxCode; - /** @type {!number} */ - var i; - /** @type {!number} */ - var code; - /** @type {Array.} */ - 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.} 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.} */ - 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.} */ - 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': [ '', '' ], 'url': [ '', '' ], 'hit': [ '', '' ], 'del': [ '', '' ], 'summary': [ '', '' ] }); -}); -$__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 deleted file mode 100644 index f960dd868..000000000 --- a/web/server/h2o/libh2o/misc/oktavia/lib/oktavia-turkish-search.js +++ /dev/null @@ -1,10729 +0,0 @@ -// 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.} 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.} */ - 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.} - */ -OktaviaSearch.prototype.pageIndexes$ = function () { - /** @type {Array.} */ - 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.} - */ -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.} */ - var results; - /** @type {!number} */ - var i; - /** @type {SearchUnit} */ - var unit; - /** @type {Array.} */ - var info; - /** @type {!string} */ - var content; - /** @type {Array.} */ - 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('*').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('
'); - } else { - text = content.slice(0, end - start) + ' ...
'; - } - text = text.replace(Oktavia.eob, ' ').replace(/()()+/, '

'); - 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.} - */ -OktaviaSearch.prototype.getProposals$ = function () { - /** @type {Style} */ - var style; - /** @type {Array.} */ - var results; - /** @type {!number} */ - var i; - /** @type {Proposal} */ - var proposal; - /** @type {Array.} */ - var label; - /** @type {Array.} */ - 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('' + this._queries[j].toString() + '')); - option.push(this._queries[j].toString()); - } else { - label.push(style.convert$S('' + this._queries[j].toString() + '')); - } - } - results.push(({options: option.join(' '), label: label.join(' '), count: proposal.expect})); - } - } - } - return results; -}; - -/** - * @param {SearchSummary} summary - * @return {Array.} - */ -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.} 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.} */ - 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.} 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.} */ - 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.} */ - 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.} */ - 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.} */ - 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.} - */ -Oktavia.prototype.rawSearch$SB = function (keyword, stemming) { - /** @type {Array.} */ - var result; - /** @type {!string} */ - var baseWord; - /** @type {Array.} */ - 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.} 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.} */ - 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.} */ - 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.} */ - 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.} */ - 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.} */ - var charCodes; - /** @type {!number} */ - var i; - /** @type {!number} */ - var charCode; - /** @type {Array.} */ - 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.} strList - * @return {!string} - */ -Binary.dumpStringList$AS = function (strList) { - return Binary$dumpStringList$ASLCompressionReport$(strList, null); -}; - -var Binary$dumpStringList$AS = Binary.dumpStringList$AS; - -/** - * @param {Array.} strList - * @param {CompressionReport} report - * @return {!string} - */ -Binary.dumpStringList$ASLCompressionReport$ = function (strList, report) { - /** @type {Array.} */ - 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.>} strMap - * @return {!string} - */ -Binary.dumpStringListMap$HAS = function (strMap) { - return Binary$dumpStringListMap$HASLCompressionReport$(strMap, null); -}; - -var Binary$dumpStringListMap$HAS = Binary.dumpStringListMap$HAS; - -/** - * @param {Object.>} strMap - * @param {CompressionReport} report - * @return {!string} - */ -Binary.dumpStringListMap$HASLCompressionReport$ = function (strMap, report) { - /** @type {Array.} */ - 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.} array - * @return {!string} - */ -Binary.dump32bitNumberList$AN = function (array) { - return Binary$dump32bitNumberList$ANLCompressionReport$(array, null); -}; - -var Binary$dump32bitNumberList$AN = Binary.dump32bitNumberList$AN; - -/** - * @param {Array.} array - * @param {CompressionReport} report - * @return {!string} - */ -Binary.dump32bitNumberList$ANLCompressionReport$ = function (array, report) { - /** @type {Array.} */ - 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.} 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.} */ - 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.} 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.} 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.} array - * @param {!number} offset - * @param {!number} length - * @return {!string} - */ -Binary._nonZeroBlock$ANII = function (array, offset, length) { - /** @type {Array.} */ - 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.} array - * @param {!number} offset - * @return {!string} - */ -Binary._createZebraCode$ANI = function (array, offset) { - /** @type {!number} */ - var last; - /** @type {!number} */ - var code; - /** @type {Array.} */ - 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.} */ - var out; - /** @type {Array.} */ - 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.} source - * @return {!string} - */ -Binary._mergeCharCode$AI = function (source) { - /** @type {Array.} */ - 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.} */ - 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.} */ - 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.} */ - 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.} */ - 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.} */ - 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.} - */ -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.} */ - 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.} - */ -SearchUnit.getPositions$LSearchUnit$ = function ($this) { - /** @type {Array.} */ - 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.} */ - var unitIds$0; - /** @type {Array.} */ - 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.} 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.} - */ -SearchSummary.getProposal$LSearchSummary$ = function ($this) { - /** @type {Array.} */ - var proposals; - /** @type {!number} */ - var i; - /** @type {Array.} */ - 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.} - */ -SearchSummary.getSortedResult$LSearchSummary$ = function ($this) { - /** @type {Array.} */ - var result; - /** @type {Array.} */ - 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.} 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.} 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.} 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.} 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.} 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.} 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.} words - * @return {Array.} - */ -BaseStemmer.prototype.stemWords$AS = function (words) { - /** @type {Array.} */ - 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.} 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.} */ - 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.} */ - 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.} 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.} 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.} 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.} - */ -Table.prototype.getCell$I = function (position) { - /** @type {!number} */ - var row; - /** @type {!number} */ - var currentColumn; - /** @type {!number} */ - var lastRowColumn; - /** @type {!number} */ - var startPosition; - /** @type {Array.} */ - 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.} - */ -Table.prototype.getRowContent$I = function (rowIndex) { - /** @type {!string} */ - var content; - /** @type {Array.} */ - var values; - /** @type {Object.} */ - 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.} 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.} 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.} */ - 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.} */ - var pos; - pos = [ ]; - return this.getRows$SAI(key, pos); -}; - -/** - * @param {!string} key - * @param {Array.} 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.} */ - 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.} */ - 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.} - */ -FMIndex.prototype.search$S = function (keyword) { - /** @type {Array.} */ - var result; - /** @type {Array.} */ - 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.} */ - 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.} 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.>} 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, "
").replace(/&/g, "&").replace(/"/g, """).replace(//g, ">"); -}; - -var _HTMLHandler$escapeHTML$S = _HTMLHandler.escapeHTML$S; - -/** - * @param {!string} tagname - * @param {Object.} 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, "
").replace(/&/g, "&").replace(/"/g, """).replace(//g, ">")); - } 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.} */ - var charclass$0; - /** @type {Object.} */ - var charclass$1; - /** @type {RegExp} */ - var charclass$2; - /** @type {Object.} */ - var charclass$3; - /** @type {Object.} */ - var charclass$4; - /** @type {Object.} */ - var charclass$5; - /** @type {!string} */ - var text$0; - /** @type {Object.} */ - var charclass$6; - /** @type {RegExp} */ - var charclass$7; - /** @type {Object.} */ - var charclass$8; - /** @type {Object.} */ - var charclass$9; - /** @type {RegExp} */ - var charclass$10; - /** @type {Object.} */ - var charclass$11; - /** @type {RegExp} */ - var charclass$12; - /** @type {Object.} */ - var charclass$13; - /** @type {RegExp} */ - var charclass$14; - /** @type {Object.} */ - var charclass$15; - /** @type {Object.} */ - var charclass$16; - /** @type {Object.} */ - var charclass$17; - /** @type {Object.} */ - var charclass$18; - /** @type {RegExp} */ - var charclass$19; - /** @type {RegExp} */ - var charclass$20; - /** @type {Object.} */ - var charclass$21; - /** @type {Object.} */ - var charclass$22; - /** @type {Object.} */ - var charclass$23; - /** @type {Object.} */ - 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 += "") { - this.closeTag$(); - } else { - charclass$20 = _.nameBody; - if (charclass$20.test(c)) { - this.tagName += c; - } else { - if (this.script) { - this.script += "") { - 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.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.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.} - */ -Char.prototype._charClass$S = function (str) { - /** @type {Object.} */ - 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.} 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.} 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.} - */ -_Entities.entity_list$ = function () { - /** @type {Object.} */ - 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.} */ - var _v$0; - /** @type {Array.} */ - 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.} */ - 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.} */ - 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.} */ - var _bv$0; - /** @type {Array.} */ - 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.} */ - var range_tmp; - /** @type {!number} */ - var code; - /** @type {!boolean} */ - var bit; - /** @type {!number} */ - var key; - /** @type {Object.} */ - 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.} */ - 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.} */ - var contents; - /** @type {!number} */ - var i; - /** @type {Array.} */ - 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.} */ - var contents; - /** @type {!number} */ - var i; - /** @type {Array.} */ - 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.} input - * @return {Object.} - */ -WaveletMatrix._shallow_copy$HI = function (input) { - /** @type {Object.} */ - 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.} */ - 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.} */ - 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.} array - */ -function OArray$AI(array) { - this.array = array; - this.offset = 0; -}; - -OArray$AI.prototype = new OArray; - -/** - * @constructor - * @param {Array.} 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.} */ - 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.} */ - 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.} 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.} SA - * @param {OArray} s - * @param {Array.} 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.} SA - * @param {OArray} s - * @param {Array.} 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.} - */ -SAIS.make$S = function (source) { - /** @type {Array.} */ - var charCodes; - /** @type {!number} */ - var maxCode; - /** @type {!number} */ - var i; - /** @type {!number} */ - var code; - /** @type {Array.} */ - 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.} 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.} */ - 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.} */ - 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': [ '', '' ], 'url': [ '', '' ], 'hit': [ '', '' ], 'del': [ '', '' ], 'summary': [ '', '' ] }); -}); -$__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 deleted file mode 100644 index a3d51d436..000000000 --- a/web/server/h2o/libh2o/misc/oktavia/lib/searchstyle.css +++ /dev/null @@ -1,174 +0,0 @@ -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 deleted file mode 100644 index 3d0a1b299..000000000 --- a/web/server/h2o/libh2o/misc/oktavia/package.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "author": "Yoshiki Shibukawa ", - "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 deleted file mode 100644 index 14e3ce21f..000000000 --- a/web/server/h2o/libh2o/misc/oktavia/resource/favicon.ai +++ /dev/null @@ -1,1176 +0,0 @@ -%PDF-1.5 %âãÏÓ -1 0 obj <>/OCGs[5 0 R]>>/Pages 3 0 R/Type/Catalog>> endobj 2 0 obj <>stream - - - - - application/pdf - - - favicon - - - - - Adobe Illustrator CS5 - 2013-04-05T08:48:31-07:00 - 2013-04-05T08:48:31-07:00 - 2013-04-05T08:48:31-07:00 - - - - 256 - 184 - JPEG - /9j/4AAQSkZJRgABAgEASABIAAD/7QAsUGhvdG9zaG9wIDMuMAA4QklNA+0AAAAAABAASAAAAAEA AQBIAAAAAQAB/+4ADkFkb2JlAGTAAAAAAf/bAIQABgQEBAUEBgUFBgkGBQYJCwgGBggLDAoKCwoK DBAMDAwMDAwQDA4PEA8ODBMTFBQTExwbGxscHx8fHx8fHx8fHwEHBwcNDA0YEBAYGhURFRofHx8f Hx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8f/8AAEQgAuAEAAwER AAIRAQMRAf/EAaIAAAAHAQEBAQEAAAAAAAAAAAQFAwIGAQAHCAkKCwEAAgIDAQEBAQEAAAAAAAAA AQACAwQFBgcICQoLEAACAQMDAgQCBgcDBAIGAnMBAgMRBAAFIRIxQVEGE2EicYEUMpGhBxWxQiPB UtHhMxZi8CRygvElQzRTkqKyY3PCNUQnk6OzNhdUZHTD0uIIJoMJChgZhJRFRqS0VtNVKBry4/PE 1OT0ZXWFlaW1xdXl9WZ2hpamtsbW5vY3R1dnd4eXp7fH1+f3OEhYaHiImKi4yNjo+Ck5SVlpeYmZ qbnJ2en5KjpKWmp6ipqqusra6voRAAICAQIDBQUEBQYECAMDbQEAAhEDBCESMUEFURNhIgZxgZEy obHwFMHR4SNCFVJicvEzJDRDghaSUyWiY7LCB3PSNeJEgxdUkwgJChgZJjZFGidkdFU38qOzwygp 0+PzhJSktMTU5PRldYWVpbXF1eX1RlZmdoaWprbG1ub2R1dnd4eXp7fH1+f3OEhYaHiImKi4yNjo +DlJWWl5iZmpucnZ6fkqOkpaanqKmqq6ytrq+v/aAAwDAQACEQMRAD8A9U4q7FXYq7FXYq7FXYq7 FXYq7FXYq7FXYqoXt/ZWNs9ze3Edtbpu80zBEHzZiBirzjzD+ffliwLRaTDJqsw29QfuYa/6zAuf oX6cKvPdX/PDzzfki2mh06I7BbeMFqe7y+oa/KmKGLXvmvzNfk/XNVu5wf2XnkK+Gy1oMVS5nZ2L MSzHqTuTiq5HZWDKSrDoRsRiqaWPmfzHYkfU9Uu7cD9mOaRV+4GmFWVaR+dHnexKieeLUIh+xcRi tP8AXj4N99cFKz7y/wDnp5fvCsWr28mmynYyr++hr7lQHH/An540l6JYahY6hbLdWNxHc27/AGZY mDqfao74FRGKuxV2KuxV2KuxV2KuxV2KuxV2KuxV2KuxV2KuxV2KuxV2KuxV2KvNfP351aPoDSaf pATUtWX4XINbeFv8tl+2w/lU/MjDSvCPMHmvX/MV2brV7x7l6/u4yaRoPBIxRV+gYoSwHFVwOKVw OKF4OKrgcVXA4quBwqvBxVM9D8xa1ol0LnS7uS2k25BT8DgdnQ/Cw+YwK9Bg/PbzG6IjWlmJQACx WUhm8aCQUzYaLDp8npyGUZfCvudL2pqdbh9eGMJw7qPF9h3CI/5XT5p/5ZbH/kXN/wBVc3P8h4e+ X2fqeY/0Wan+bj+Uv+KV7X87NaV63en20qbbRGSI++7GX9WQn2Fj/hkR9v6mzF7W5gfXCJHlY/TJ kGmfnPoFwVS/tprJid3FJowPEleL/cmYWXsPLH6SJfZ+Pm7TTe1mCVDJGUP9kP0H7GaaXrekatD6 2nXcV0lAWEbAstenJftL9IzVZsE8ZqYIeh02sxZxeOQl+Oo5j4o3KnJdirsVdirsVdirsVdirsVd irsVdirsVdirTuiIzuwVFBLMTQADckk4q8C/NP8AOmW/aXRfLMzRWAql1qK7PN2KxEbrH/ldW+XU q8hBxVcDihPvLHkzzJ5ln9PSLJ5kU0kuW+CFP9aQ/DX26+2KvWdG/IPRrGFbnzNqvqU3aKAiGEHw Mj/E30BcUp/b2X5SaN8NppcFy6inIxG4b6HnqPuOKEdB520VZAlho7FhvGsaRq1fYIGxpUxTVJb0 Vn8tysG3f1Ej3p/xkC1xVBar5V/L65gWTWNFttMjkPFZpPRtSWpUDnDIN/mcnDHKZqIJ9zVmz48Q uchEeZA+9i2t/kJplxGZ/L+oNCWHJIbj97Ea/wAsiDkB9DZA7c20EEWHlvmLyh5i8uz+nqtm8KMa R3A+KF/9WQfDX26+2FUoBxVcDiqMtLsqeEh+E9Ce2bns/tQ46hPePf3fseV7Z9nxmvLh2ydR0l+o /f8Aaj86gEEWHgpRINHm7FCrbXVzazrPayvBOm6SxsUYfJhQ4JQEhRFhlDJKB4okiQ6jYvSfKf5v zRlLTzCPVj6Lfxr8Y3/3Yi7MPdd/Y5odZ2KD6sXy/U9d2b7USj6dRuP5w5/Efq38i9Vtrm3uYEuL eRZoJRyjlQhlYHuCM52UTE0di9tjyRnESibBVMizdirsVdirsVdirsVdirsVdirsVdirwb87/wA0 nmmm8qaLNSCMlNWuUP226GBSP2R+34nbpWpV4uDihcDil7D+XP5L/WrdNc82VttOA9SKwYmN5F68 pm2KJ7dT7d1Wf6j52s7C3XTvLltHBbQjhHIECooH++4wAPpP3Y0hILa013zBeHiXuZB9uWQnggPi TsPkMKsy0n8vdOtwsmoMbubqUFVjB+j4j/ntgtaZPbWlrax+nbQpCn8sahR+GBKD1/XtP0LTJNQv n4xJsiCnORz0RB3J/t6Zfp9PLNMRi4mt1uPTYzkmdvtJ7g8A80ea9S8xaibq8bjEtRbWyk8IlPYe JP7Td/uzs9JpIYI8Mfie98w7R7QyarJxz5dB0H46nqs0PzVruhy89Ou3iStXgJ5RN/rIar9PXDqN Jjyj1i/vY6PX5tMbxyI8uh+H4L1fyp+YGk+bEOjatZKt3MpDQlTLbygCrdQeHyb765zWu7LOEcUT cPt/a912R2/HUnw5jhyeXI/q+PzYb+YX5NvYpLqvltWltFq8+nVLPGBuWiJ3dR/Kd/n21VvQvKRh VdirKPIyaDqGpJpWtSS263J4Wl5EygJIdlSQMGBVu3Sh9umw03aeXDHhFGPm6TX9g4NTPjNxl5df fsy7X/yh1/T0abTpF1OFRVkQenMKAk0jJYN/sWqfDNzp+2cU9peg/Z83ltb7MZ8QuB8QeWx+X6iT 5MFlSSGV4pUMcsZKvG4KsrDYgg7gjNwCCLDzsokGjsQt5YWNMn8keer3y3ecG5T6XM1bm1ruD09S OvRx/wAN0PYjX6/QRzx7pjkf0F3HZHa09HPvxn6o/pHn9/I9CO9WN9aX9nDeWkomtp1DxSL0IP8A HxGcdkxyhIxkKIfTMOaGWAnA3GXJXyDa7FXYq7FXYq7FXYq7FXYq7FWB/nF58/wp5ZKWknHWNS5Q 2RB+KMAfvJv9gCKe5GKvlYuzMWYksTUk7kk4VXA4oe1fk/8AlpaRWa+cfMqBbWMCXTbaToQOkzqe u/8Adjv18MVZF5l803esTFFrFYof3cHjT9p/E/qwqq+VvKk+ryevNWKwQ/E/dyOqp/E42r0yzsrW yt1t7WJYoU6Iv6z4n3yKVbFWndUUu5CooJZiaAAdSTiBaCa3L56/MDzg/mPWmeJiNNtax2Sbio/a kIPdyPuoM7Ps7RjBj3+o8/1fB8x7Z7ROqzWPojtH9fx/UxjlmwdRSf8Ak/yfqfma+MNtSK1iI+tX bCqoD4D9pjTYfqzD1mthgjZ3J5B2XZvZeTVzqO0RzPd+s+X3PefL3ljR9AsxbadCEJA9WdqGWQju 7d/l0HbOQ1Oqnmlcj+oPo+i7PxaaPDjHvPU+8/gJrmO5rx783vy1XhN5k0aLiVq+pWqDYjqZ1H/E x9PjhCHjoOFWwcVfRP5Tecz5g0L6pdyctU04LHMWPxSRnZJPc7cW99++ApTXzh5E0nzJblpFFvqK CkN6g+L/AFXG3Nfn07Zm6PXzwHbePc6ntPsfFqxZ9M+kv194/AeCa3o+oaLqUun38fp3ER7bqyno 6nupzr8GeOWIlHk+b6rSTwZDCYqQ/FhA8sucenof5S+c30/Ul0O8f/Qb1qWxP+65z0A9pOnzp75p e19Hxx8SP1R5+Y/Y9P7OdpnFk8GR9E+XlL9v315vas5Z792KuxV2KuxV2KuxV2KuxV2KvkP81PN5 8z+c7y8jctYW5+q2A7elESOQ/wBdqt9OFWJg4qzv8ovIv+LPMqrcqTpOn8Z789n3+CKv+WRv/kg4 q9f85eYBfXIsLQhdPtDxVV2VmXaoptQdFxCEF5Y0CTWNQEZqtrFRriQdl7KPdsKvWIIIbeFIYUEc UYCog6ADIpX4q7FWBfnD5kOmeXV0+B+N1qhMZI6iBKGT/gqhfkTm37H03Hk4jyj9/R532k1nhYPD H1ZNvh1/V83hPLOrfP6Rek6dd6rqVtp1ovK4unEcY3oK9WNK7KNz7ZXlyjHEyPINuDTyyzEI/VIv pby9oNjoOkw6bZLSOIVkkp8Ukh+1I3u39mcRqNRLLMyk+paLRw0+MY4ch9p7/wAe5Msoct2KuIDA gioOxB6UxV83fmp5MHlvzAXtU46Vf1ltABsjV+OL/Yk1HsRhQw0HCrIvIXmVvL3me0vyxFsW9G8A 7wyEBtv8nZh7jAr6hBDAEGoO4I6UwJYh+ZPk1PMOjNLbp/uVslL2rDq46tEf9b9n3+nNj2brPBnR +iXP9bpO2+zBqcVxH7yPLz8v1efxfPfLOxfOKcHIIINCOhxWn0n5D8xfp/yzaXzsDdKDDd0/37Hs SaAU5CjU984nX6fwcpiOXMe78bPqHZOs/MaeMz9XI+8fr5/FkGYbsnYq7FXYq7FXYq7FXYqxH81/ MX6B8hareI3G4li+q2xHX1Lj93Uf6qkt9GKvkAHCq4HFX0t5R0xfJn5YWyBeGra0PXnb9oGVage3 pxUHsxxQkQBJAAqTsAOtcKvXfLOjLpWkxQED13HqXDeLt2/2PTIpTXFXYq7FXzz+bWtHUfOd1Grc oLALaxU8U3k+n1GYfRnX9lYeDCO+W/4+D5z2/qPF1Uh0h6f1/bbDeWbJ01PVPyL0NZry+1uVKi2A trZiKjm45SEe6rQfJs0XbeeojGOu5/H45PV+y+kucsp/h2HvPP7PveyZzb2jsVdirsVYr+Zvltde 8o3kCLW7tR9atD35xAkqP9ZKriFfMgOSQuBxV9MflfrZ1fyVp8rtyntlNrMe/KH4Vr7lOJyJSyvF Xzt+amgro3m649JQtrfAXcIHQeoSHH/IwNt4UzsOy9R4mEXzjt+Pg+cdu6TwdSa+mXqHx5/bbEOW bF09PUPyL1sxarfaQ7fu7qIXEIJ6SRGjAD/KVqn/AFc0fbeG4Cfdt8/x9r1PsvqOHJLGeUhfxH67 +x7RnNPbOxV2KuxV2KuxV2KuxV4j/wA5PasY9M0TSVY/6RNLdSKP+KVCJX/ka2Kvn4HCqe+SNGXW /Nuk6U45RXVzGsw/4qB5Sf8ACA4q+hvzAvvW1oWq/wB3ZxhAo6cnHI/hQYhBQvkvThe6/AGFY7es 7j/U+z/wxGEq9WyKXYq7FVskiRxtI5oiAsx8ABU4QL2QTQt8l397Le31xeTGstzK80h/ypGLH8Tn ewiIxER0fJ8szORkecjfzUOWSYU+jPyk04WfkWwYpwkuzJcye5dyEP8AyLVc5DtXJxZz5bfj4von YOHg0sdqMrP6vspmOa53DsVdirsVdir5S86aQNH816ppyrxihuGMK+EUnxx/8IwwoScHCr2f/nH7 UiYNX01jsjRXMa+7go5/4VcBV69gS8v/AD505ZNF07UgPjtrhoDT+WZOW/yMQ+/N32Hkqco94v5f 2vL+1GG8cJ90q+Y/Y8S5Z0rxdMh/L3UmsPOujzggcrlYGJ6cZ/3LH6A+Ymvhx4ZDyv5buw7KyeHq cZ/pV89v0vpzOKfTHYq7FXYq7FXYq7FXYq+a/wDnJq7L+c9OtgQVh09X2PRpJpQQR8kGKvIgcKvT P+ce7Rbj8x4JSKm0tbiYHwJURf8AM3FXoGtz/WNYvZuzzyFflyIH4YUMt/LO2HC+uSNyUjU/KrN+ sYCoZxgS7FXYqlHm+YweU9ZmDcWSxuSrVp8XpNx/HMjSi8sR/SH3uJrzWDIR/Ml9z5U5Z3D5jTuW K0+rfKkH1fyvo8BABjsrdWp0qIlr+OcNqpXlkf6R+99P0MDHBAHpCP3JrlDlOxV2KuxV2Kvnn887 UQeefVH/AB9WkMx+gtF/zLwoefA4Vel/kLcFPN91D+zNZSbe6yRkH7q4Cr3zAlhv5vQLL+X+pMRV oTDInsRMgJ/4Fjmx7KlWoj8fudR29G9JL4f7oPm/lnXvntKtpdPbXUNwho8LrIp36qQR0+WRlGwR 3soSMSJDmH17nAvq7sVdirsVdirsVdirsVfLv/OSJ/5CJH/zAQf8Tkwq8tBxV67/AM4zn/ne7/8A 7Zcv/URb4FZRcEmeQk1Jdqn6ckh6J+W4H6EnNNzcsCflGmAqGV4EuxV2Ksf/ADB/5QjW/wDmEl/4 jmVof76PvcLtL/F5/wBUvljlnavm1O5YrT6/01VXTrVVACiGMADYABRnB5PqPvfU8Y9I9yIyDN2K uxV2KuxV4J/zkCU/xVp4FOf1FeXjT1pKfxwhDzEHFXoP5H8z56j41oLabnTwoOv00xV9EYEsY/M7 /lAtZ/4wf8brmZ2f/fx97r+1f8Wn7ny/yzs3zmncsVp9j5wD6s7FXYq7FXYq7FXYq7FXzT/zk/as nnLS7qnwzaesfbcxTSE/hIMVePA4Vem/849Xy2/5lWsTHe8t7iFfmE9X/mVir0PWITBq15Cf2J5F +gMaYUM4/LWYHTLuHuk/P/g0A/40wFQy/Al2KuxVIvPkJl8la4gNCLG4bx+xGWp9NMydGazQ/rBw +0Benn/VP3PlDlnavnFO5YrT6+0K4FzoenXAIImtoZAR0+OMHavzzhc0amR3Evp2nnxY4y7wPuR2 VtrsVdirsVdir50/PS9E/nt4q1+qWsMJ9q8pf+ZuFDz8HFXpv5BW5k83Xc2/GGyfcfzPJGAD9FcV e/YEsP8AzdnMP5eauwbizLCg6b8541I39icz+zBeePx+4ur7akRpZ15feHzHyzr3gKXwo0syRJu8 jBVHuxoMBNJESTQ5vsnOCfUnYq7FXYq7FXYq7FXYq8P/AOcpNIaXRdE1dV2tbiS1kI8LhA61+RgP 34q+dQcVT3yXrn6C816Tq5/u7O5jkmp1MXKkg+lCcKvozz1ZrDrjXEdDDeIs0bLup24mh+iv04Qh GflxeiLVLi0Y0FzHyUeLRmtP+BY4Coei4EuxV2KqN9aR3llcWkn93cxPE/f4XUqf15KEuEgjoxnA SiYnkXxvPFLbzyQSrxliZkkXwZTQj787sEEWHzOUCDR5hT5YWNPqj8rtTGo+QdGmrVooBbMNqg25 MQrT2QHON7Qx8OeQ87+e76B2Xk49PA9wr5bMqzDdg7FXYq7FXEgAkmgHU4q+SPOGsjWfNOqamrco 7i4cwn/ipTxj/wCEUYUJSDir27/nHrTCtnq+qMu0kkdtE3/GMF3H/JRcSr1/Al5h/wA5Aamtv5St bINSS9u1JXxjiVmb/himbfsaF5Se4Oh9oMlYRH+dL7vwHz5yzp3jaT/yFYNqPnTRbQLyDXcTyL4x xN6kn/CIcxtZPhxSPk5nZ+IzzwH9IfZu+s84p9EdirsVdirsVdirsVdirFPzS8tHzH5D1fTY053P ome0A6+tAfUQD3bjx+nFXxapwqqK2BX0n5K1keb/AMr7aQtz1by7/o10v7TQqKI30xgGvipwoWaX fPYajb3idYXDEeK9GH0jbCr2aCeKeGOeJuUUqh0Yd1YVGRSvxV2KuxV8ufm/ojaP581BQKQXxF9C T3E9S/8AyVDjOv7NzceEeW3y/Y8L2tp/D1Eu6Xq+f7bYXyzOdbT2/wD5x38yI0Oo+XpW+NWF7ag9 1NElH0EIae5zQdtYdxMe79T0/s/qNpYz7x+n9D2jNC9K7FXYq7FWF/m35pXQPJ9yI3432oA2lqB1 HMfvH/2KV38aYq+YQcKF4OKvqb8sdCbRfJWm20i8biZPrNwDsec3x0PuqkL9GBLKcVfOX58eY11H zemnQvyt9Ji9I0NR68lHlp9HBT7jOo7Iw8GLiPOX3PG9u5+PNwjlAfaef6HmvLNq6Wnqf/OPuiNd +abnVnWsOmwFUbwmn+Af8kw+ajtjLWMR/nH7vwHe9gYOLKZ/zR9p/Zb6EzmXr3Yq7FXYq7FXYq7F XYq7FXx7+dPktvK3ni6SFOOm6kTeWJHQCRj6kf8AsHqKeFMKsFBwKzT8qvPr+TvM8d3NV9Kuh9X1 OECtYidnA/mjO49qjvir23zHpEVlcR3Vm4m0q+UTWU6HkhRhyAB+R28RkkMl/L/zArR/oi4b41q1 oT3HVk+jqMBUM2wJdirsVeWfn95WbUPLkOuW8fK50pqT8RubeQgMf9g1D7Cpzb9kajhnwHlL73Sd uabjxiY5x+587cs6Z5Gk08seYrzy9rtpq9nvLauGZK0DodnQ+zKSMpz4RkgYnq36bPLDkE49H11o Wt6frek22qafIJbW6QOh7g9GVh2ZTsRnGZcUscjGXMPfYcsckRKPIo7K2x2KrJpooYXmmdY4YlLy SMQFVVFSST0AGKvlv8zvO7ea/Mbzwsf0ZaAw6ehqKpX4pCD3kO/yoO2FDEwcVZX+WflZvMfmy0tH TlZQH6xfHt6UZB4n/Xai/Tir6owJY55/85WnlPy7PqMpDXTAx2NuTvJMw+Hb+VftN7ZlaTTHNMR6 dXE1uqGDGZHn0975Lurue6uZbq4cy3E7tJNI3Vnc8mY/MnOxjEAUOQeCkTIknmVLlkkU+p/yh8qt 5f8AJlss6cL6/P1u6B6qZAPTQ/6sYFR41zke0dR4mU1yGz2/ZWl8HCAfqluWa5gOydirsVdirsVd irsVdirsVeQf85Hz+TpfKqWupXax69C/raTCg5zEnZwyj7Mbr1J7gdaUxV8vg4qvBxV65+UX5nWV ra/4Q80yV0S4b/QL1jvaSt2JPSMk1r+yevwk0KvQdW0jUNDvUJY8a87W6j+ywG4II6H2woegeVfN MOrwCGYhNQjH7xOgcD9tf4jtgISn+BXYqp3FvBc28tvOgkgmRo5Y23DI4oyn2IOGJINhEogijyfJ f5jeS7nyj5kmsGDNYzEy6dOd+cJOwJ/mT7Lff0IzsNHqhmhfXq8Pr9GcGQj+E8vd+xi3LMtwqZ1+ V/5nXfk+/MFwGn0O6YG6txuyN09WKv7QHUftD6MwNdoRmFj6w7Ps7XnBKj9B5/rfTekavpmsafDq Gm3CXVnOOUcsZqPcEdQw7g7jOVyY5QlwyFF6/FljOIlE2CjCQoLMaAbknoBkGx4D+cf5rJqjSeXd CmDaappfXkZ2nYH+7QjrGO5/aPt1KvJAcUKiBmYKoLMxoqjckntir6f/ACn8kf4Y8uhrpKarqHGa 8r1QU/dxf7AHf3JwJT7zT5s0Tyxpb6jq04ijFRFEKGWV/wCSNf2j+A77Zdg088suGIaNRqYYY8Ui +WfPPnnVPN+stf3v7uCOqWdmpqkMda092P7Td/lQDrdLpY4Y8I+JeK1mrnnnxS5dB3Mc5ZkuLT0H 8m/Ib+ZvMS3l3HXRtMZZbksPhlk6xw79andv8n5jNd2lq/ChQ+qX4t2nZWi8XJxH6I/b5PqDOUey dirsVdirsVdirsVdiryT8yf+cgND8verpvl/hqusiqtKDW1gYbfGyn94w/lU/M9sVeLad+d35i2N xqtyNSM9xqqhWedQ4gZT8L26fYjIBIpxp7VxVhN9fXl/dy3l7O9zdzsXmnlYu7se7MdziqjirYOK rwcVeoflz+cc2i2iaB5jhbVPLh+GMdZ7YeMRNKqP5a7dj2wq9Yh0eC+tY9b8o3w1OxryRoWpPEw3 4suzch4UDe2NoZHoPnyNiLTWR6Fwp4/WKUUn/LX9k/h8saVl8ckciB42DowqrKQQR7EYErsVY756 8laZ5u0OTTrz93MtXs7oD4opabH3U9GHce9DmTpdTLDPiHxcXV6WOeHCfge58oeZfLes+W9Vk0zV oDDcR7q3VJEJoJI2/aU0/rvnXYc8cseKJ2eMz6eeKXDIboOwsL/ULpLSwt5Lq5kNEhhUu5+ha5Oc xEWTQa4YpTNRFl7r+W3kzUPIFvJ5i81a0NJtGU8tJWQMkhK7er9oM4/ZWOre/UZzvaOux5RwxF/0 v1PT9mdn5MPqlKv6P6/2fNiv5k/nRf8AmJZdL0UPZaKarLITSa4HQ8qfZQ/yjr38M1DunmYOKrwc Vekfldb+StImXzL5q1S2ieA8tO07l60wcf7ukijDstP2AR/leGZOPR5Z/TEuLl1mKH1SDJ/NP/OR 9lGjweWbFppTsL28+CMe6xKeTf7Ir8s2WDsY88h+AdXqO24jbGL8z+P1PF9e8ya1r9+1/q9293ct sGc/Cq9eKKKKi+wGbvFhjjFRFB5/NmnllxTNlLeWWtVMi8keStY836wun6evGJaNd3jAmOGOv2m8 Sf2V7/KpGNqdTHDHil8B3uTpNJPPPhj8T3PrDyz5c0zy5otvpOmx8LeAbsftSOftSOe7Mf6dM5HP mlkkZS5vaYMEcUBGPIJplTc7FXYq7FXYq7FUn80ebvL/AJX01tQ1u8S1g3EaneSRgK8I0HxM3y+n FXzP+ZP57+YPNPq6fpfPSdDb4TErf6RMv/Fsi9FP8i7eJbFXl+KuxVWs7O7vbqK0s4XuLqZgkUES l3Zj2VRUnFXvv5bf844qnpap5z+Jtni0aNth3/0iRTv/AKin5ntirX5wfkJyMuv+TrcA05XmjRLT p1e3A/GP/gfDFXgBDo5RwVdSQykUII6gjCq4HAqa6D5k1zQb0Xuj3stlcilXiagYDs6mquPZgRhV 6tpH/OQMF5GkHnDQ4r6gAN/Z/upqD/IJAJ+TqPbFWaaF+Yn5bsQ2k+ZptIdz8VpexsYxXx5L6f8A w+KGc6d518uypWTzBpNwn+/YbmNDXwKF3p/wWBKJm87eTYE5za9p6L4tdQivfb4t8VYP578+fktq 9iLXWrlNV9JuUK2iStKpHXhMgQAHv8e+X4NRPEbiaaM+nhlFTFsDn/O3StGtXsvIvl6DSonFDd3A DSt4EqpNWHi7tkcuaeQ3I2yxYYYxUQA861zzJrmvXhvNXvZLyffiZD8Kg9kQUVB7KMrbUADihcDi lqWcIKKav3PYf25u9B2bfryDbu/W6LtDtTh9GM79T+pDcs37zjXLCtNqSxCqCSdgB1JwKA9O8h/k Z5j16SO71lX0jSTRj6i0uZB4JG32a/zP9AOazVdqQx7R9UvsdtpOyJ5N5+mP2vory95c0by9pkem 6TbLbWse5A3Z2PV3Y7sx8T+rOczZpZJcUjZelw4Y448MRQTLKm12KuxV2KuxV2KvJPzJ/wCcgND8 verpvl/hqusiqtKDW1gYbfGyn94w/lU/M9sVfNnmHzLrnmLUpNS1m7e8u5P2nPwqP5UUfCi+yjFU txV2KuxV61+TH5U+c7/WbDzMkjaLp1rIs0N26/vZ1HVYozSqOvwlm+Gh25dMKvqbArsVecfmR+SX lzzeZL+3ppmukV+uRrVJSBt66CnL/WHxfPpir5t84fl35t8o3Bj1iyZbcmkV9FV7d/Ckg6H/ACWo fbCrHQcCqgOFV4OKrwcVXA4quBxVeDiq8HFWQeVvJHmfzPP6ej2TzRqaSXLfBAn+tI3w19uuKshv fyN/M6IlLfTY516c47mAEj/no6UGbfRS02P1SNy9x2dProanJ6Yj0+/cpav5Lfme0piGhychWpM1 uF2/yzJx/HNt/KWD+d97qP5Mz/zftH60wsvyA/Mu4YCa0gswerTXEZA+fomU5XLtXAOpPwbY9kZj zofH9TL9E/5xklJV9c1oAftQWUZJI9pZaU/5F5h5O2v5kfm5mLsQfxy+X4/Q9Q8rfll5L8s8ZNN0 5Ddr/wAfs/76eviGb7H+wAzV59bly/Udu52mDR4sX0jfv6spzFcp2KuxV2KuxV2KpP5o83eX/K+m tqGt3iWsG4jU7ySMBXhGg+Jm+X04q+Z/zJ/PfzB5p9XT9L56TobfCYlb/SJl/wCLZF6Kf5F28S2K vL8VdirsVTDQvL+s6/qMenaPaSXl5J0jjHQd2ZjRVUd2Y0xV9Iflt/zj3o2h+lqXmX09U1YUZLWl bWE/I/3rDxYU9u+KvYAABQdMVdirsVdiqye3guIXguI1mhkHGSKRQysD2KmoOKvMvNH/ADjz5E1h nnsFk0W6apra0MBJ8YX2A9kK4q8v1v8A5xs89WTs2lzW2qwj7AV/QlPzSWiD/kZirDb/APLbz/p5 P1ny/fADq8cLyoN6btGHX8cKpRJpGrQkCayuIyegeJ16fMYqvh0nVpjSKynkI6hInY/gMVTvT/y5 8+X5AttAviD0eSB4kPb7cgRe3jirMtE/5x2883jK2oyW2lxbcg7+tLQ+CxclP0uMVemeWvyA8l6U yTah6usXK7/v/ggr7RJ1+TM2BXpNtbW1rAlvbRJBbxDjHDEoRFHgqrQDFVTFXYq7FXYq7FXYq7FX Yq7FXYq8n/Mn8/tC8uerp2hcNV1lfhZga20Lf5br9th/Kp+ZGKvmrzF5m1zzHqT6lrN293dPsGbZ VX+VFHwqo8BiqWYq7FXYq9L/AC2/I3zF5sMV/fctK0JqMLmRf3sy/wDFEZ7H+dtvDl0xV9NeU/Jn l3yppwsNEtFt4zQzSn4pZWH7Ukh3Y/gO1MVTvFXYq7FXYq7FXYq7FXYq7FXYq7FXYq7FXYq7FXYq 7FXYq7FXYq7FXYq7FXYq+WfzX/OvzVrF7eaDaRS6Hp0EjwXNuTS6kKkqyzOv2R/kLt4k4VeS4Fdi rsVTDQvL+s6/qMenaPaSXl5J0jjHQd2ZjRVUd2Y0xV9Iflt/zj3o2h+lqXmX09U1YUZLWlbWE/I/ 3rDxYU9u+KvYAABQdMVdirsVdirsVdirsVdirsVdirsVdirsVdirsVdirsVdirsVdirsVdirsVdi rsVdirwT/nI78tvVi/xnpcX7yMLHrMSDdl2WO42/l2V/ah7HFXz1irsVel/lt+RvmLzYYr++5aVo TUYXMi/vZl/4ojPY/wA7beHLpir6a8p+TPLvlTThYaJaLbxmhmlPxSysP2pJDux/AdqYqneKuxV2 KuxV2KuxV2KuxV2KuxV2KuxV2KuxV2KuxV2KuxV2KuxV2KuxV2KuxV2KuxV2KqdxbwXNvLb3Eayw TI0csTCqsjijKR4EHFXyP56/J7zBpPnr9BaJZS31tf1n0pk+L9zWjLI5+FfSJozMelD3xV65+W3/ ADj3o2h+lqXmX09U1YUZLWlbWE/I/wB6w8WFPbvir2AAAUHTFXYq7FXYq7FXYq7FXYq7FXYq7FXY q7FXYq7FXYq7FXYq7FXYq7FXYq7FXYq7FXYq7FXYq7FX/9k= - - - - - - xmp.did:F87F1174072068118083FFCA059709C7 - uuid:877c9053-4997-5b44-9e97-702d22d152ca - uuid:158E45247E8EE2119A5495E790BEF36B - proof:pdf - - xmp.iid:F77F1174072068118083FFCA059709C7 - xmp.did:F77F1174072068118083FFCA059709C7 - uuid:158E45247E8EE2119A5495E790BEF36B - - - - - converted - from application/postscript to application/vnd.adobe.illustrator - - - saved - xmp.iid:F77F1174072068118083FFCA059709C7 - 2013-04-05T00:02:23-07:00 - Adobe Illustrator CS5 - / - - - converted - from application/postscript to application/vnd.adobe.illustrator - - - saved - xmp.iid:F87F1174072068118083FFCA059709C7 - 2013-04-05T08:48:29-07:00 - Adobe Illustrator CS5 - / - - - - - - Print - Document - - - 1 - False - False - - 259.840820 - 260.000000 - Pixels - - - - Cyan - Magenta - Black - - - - - - Default Swatch Group - 0 - - - - White - CMYK - PROCESS - 0.000000 - 0.000000 - 0.000000 - 0.000000 - - - Black - CMYK - PROCESS - 0.000000 - 0.000000 - 0.000000 - 100.000000 - - - CMYK Red - CMYK - PROCESS - 0.000000 - 100.000000 - 100.000000 - 0.000000 - - - CMYK Yellow - CMYK - PROCESS - 0.000000 - 0.000000 - 100.000000 - 0.000000 - - - CMYK Green - CMYK - PROCESS - 100.000000 - 0.000000 - 100.000000 - 0.000000 - - - CMYK Cyan - CMYK - PROCESS - 100.000000 - 0.000000 - 0.000000 - 0.000000 - - - CMYK Blue - CMYK - PROCESS - 100.000000 - 100.000000 - 0.000000 - 0.000000 - - - CMYK Magenta - CMYK - PROCESS - 0.000000 - 100.000000 - 0.000000 - 0.000000 - - - C=15 M=100 Y=90 K=10 - CMYK - PROCESS - 14.999998 - 100.000000 - 90.000000 - 10.000002 - - - C=0 M=90 Y=85 K=0 - CMYK - PROCESS - 0.000000 - 90.000000 - 85.000000 - 0.000000 - - - C=0 M=80 Y=95 K=0 - CMYK - PROCESS - 0.000000 - 80.000000 - 95.000000 - 0.000000 - - - C=0 M=50 Y=100 K=0 - CMYK - PROCESS - 0.000000 - 50.000000 - 100.000000 - 0.000000 - - - C=0 M=35 Y=85 K=0 - CMYK - PROCESS - 0.000000 - 35.000004 - 85.000000 - 0.000000 - - - C=5 M=0 Y=90 K=0 - CMYK - PROCESS - 5.000001 - 0.000000 - 90.000000 - 0.000000 - - - C=20 M=0 Y=100 K=0 - CMYK - PROCESS - 19.999998 - 0.000000 - 100.000000 - 0.000000 - - - C=50 M=0 Y=100 K=0 - CMYK - PROCESS - 50.000000 - 0.000000 - 100.000000 - 0.000000 - - - C=75 M=0 Y=100 K=0 - CMYK - PROCESS - 75.000000 - 0.000000 - 100.000000 - 0.000000 - - - C=85 M=10 Y=100 K=10 - CMYK - PROCESS - 85.000000 - 10.000002 - 100.000000 - 10.000002 - - - C=90 M=30 Y=95 K=30 - CMYK - PROCESS - 90.000000 - 30.000002 - 95.000000 - 30.000002 - - - C=75 M=0 Y=75 K=0 - CMYK - PROCESS - 75.000000 - 0.000000 - 75.000000 - 0.000000 - - - C=80 M=10 Y=45 K=0 - CMYK - PROCESS - 80.000000 - 10.000002 - 45.000000 - 0.000000 - - - C=70 M=15 Y=0 K=0 - CMYK - PROCESS - 70.000000 - 14.999998 - 0.000000 - 0.000000 - - - C=85 M=50 Y=0 K=0 - CMYK - PROCESS - 85.000000 - 50.000000 - 0.000000 - 0.000000 - - - C=100 M=95 Y=5 K=0 - CMYK - PROCESS - 100.000000 - 95.000000 - 5.000001 - 0.000000 - - - C=100 M=100 Y=25 K=25 - CMYK - PROCESS - 100.000000 - 100.000000 - 25.000000 - 25.000000 - - - C=75 M=100 Y=0 K=0 - CMYK - PROCESS - 75.000000 - 100.000000 - 0.000000 - 0.000000 - - - C=50 M=100 Y=0 K=0 - CMYK - PROCESS - 50.000000 - 100.000000 - 0.000000 - 0.000000 - - - C=35 M=100 Y=35 K=10 - CMYK - PROCESS - 35.000004 - 100.000000 - 35.000004 - 10.000002 - - - C=10 M=100 Y=50 K=0 - CMYK - PROCESS - 10.000002 - 100.000000 - 50.000000 - 0.000000 - - - C=0 M=95 Y=20 K=0 - CMYK - PROCESS - 0.000000 - 95.000000 - 19.999998 - 0.000000 - - - C=25 M=25 Y=40 K=0 - CMYK - PROCESS - 25.000000 - 25.000000 - 39.999996 - 0.000000 - - - C=40 M=45 Y=50 K=5 - CMYK - PROCESS - 39.999996 - 45.000000 - 50.000000 - 5.000001 - - - C=50 M=50 Y=60 K=25 - CMYK - PROCESS - 50.000000 - 50.000000 - 60.000004 - 25.000000 - - - C=55 M=60 Y=65 K=40 - CMYK - PROCESS - 55.000000 - 60.000004 - 65.000000 - 39.999996 - - - C=25 M=40 Y=65 K=0 - CMYK - PROCESS - 25.000000 - 39.999996 - 65.000000 - 0.000000 - - - C=30 M=50 Y=75 K=10 - CMYK - PROCESS - 30.000002 - 50.000000 - 75.000000 - 10.000002 - - - C=35 M=60 Y=80 K=25 - CMYK - PROCESS - 35.000004 - 60.000004 - 80.000000 - 25.000000 - - - C=40 M=65 Y=90 K=35 - CMYK - PROCESS - 39.999996 - 65.000000 - 90.000000 - 35.000004 - - - C=40 M=70 Y=100 K=50 - CMYK - PROCESS - 39.999996 - 70.000000 - 100.000000 - 50.000000 - - - C=50 M=70 Y=80 K=70 - CMYK - PROCESS - 50.000000 - 70.000000 - 80.000000 - 70.000000 - - - - - - Print Color Group - 1 - - - - C=0 M=30 Y=70 K=0 - CMYK - PROCESS - 0.000000 - 30.000002 - 70.000000 - 0.000000 - - - C=5 M=70 Y=90 K=0 - CMYK - PROCESS - 5.000001 - 70.000000 - 90.000000 - 0.000000 - - - C=5 M=90 Y=75 K=0 - CMYK - PROCESS - 5.000001 - 90.000000 - 75.000000 - 0.000000 - - - C=30 M=0 Y=95 K=0 - CMYK - PROCESS - 30.000002 - 0.000000 - 95.000000 - 0.000000 - - - C=60 M=5 Y=95 K=0 - CMYK - PROCESS - 60.000004 - 5.000001 - 95.000000 - 0.000000 - - - C=30 M=0 Y=10 K=0 - CMYK - PROCESS - 30.000002 - 0.000000 - 10.000002 - 0.000000 - - - C=60 M=10 Y=5 K=0 - CMYK - PROCESS - 60.000004 - 10.000002 - 5.000001 - 0.000000 - - - C=80 M=5 Y=10 K=0 - CMYK - PROCESS - 80.000000 - 5.000001 - 10.000002 - 0.000000 - - - - - - Grayscale - 1 - - - - K=100 - GRAY - PROCESS - 255 - - - K=90 - GRAY - PROCESS - 229 - - - K=80 - GRAY - PROCESS - 203 - - - K=70 - GRAY - PROCESS - 178 - - - K=60 - GRAY - PROCESS - 152 - - - K=50 - GRAY - PROCESS - 127 - - - K=40 - GRAY - PROCESS - 101 - - - K=30 - GRAY - PROCESS - 76 - - - K=20 - GRAY - PROCESS - 50 - - - K=10 - GRAY - PROCESS - 25 - - - K=5 - GRAY - PROCESS - 12 - - - - - - - - - Adobe PDF library 9.90 - - - - - - - - - - - - - - - - - - - - - - - - - endstream endobj 3 0 obj <> endobj 7 0 obj <>/Resources<>/ExtGState<>/Properties<>/Shading<>>>/Thumb 15 0 R/TrimBox[0.0 0.0 259.841 260.0]/Type/Page>> endobj 8 0 obj <>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ó$Ç釉¨¥î✟röE‰ ³ gSæŒÌ=qz´ÀÝ%è(D¯cs+$±»T@Iæ”Z}íõZà•št<$Û%Áž:É1(‰²ƒüŒ‚]iZPÄM¾Ü%›yWÁáh-ŠÊÌ^zçòs­V4¯µòÑy)ç×d§­JX íÍ~,è_ù|h;øÅAØ0*ÑsÀ¤WEj‚L7°®ËòûšÍ|!â®ü./@ÝØ Ï`m_.Ëß‚Á¤²ò!H‘² IêK_«$’üö~ÄíMÀþŒ9*ÞD¼ØP¨¶fÕ;¨åTãJ7Å“UÎC‚†Úá@”‚ñ` ˜QÙ¯%Ùs©¸K¶K‚*Ó@:FløÆY©B‚)1RÑKÅ]"i‚O·`ê*)_ÊTiVgŸÚ0(ß%‚Pðs쵞"Ê`FSïi•¥\Ú×{Y¾I„…HòÓµ4ñº,£>ù4†þ~òriÁ™ç+|Ö°®çQGãb¡à)ŠþáW÷å—ß‚ûã7÷Ó¯n'«Z|PÝÍF@VTVUºDKJ -‰Óª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Ò[ Èš¤èõóõl¯q•§øÚªÖJCïI'ŽFÁö"•i€W ?4Èz® ÷`#ÉC°‚ :aÞC[ª–ûã4ÍOñíôµÞ^XQʬ—`{×4ÅE0¦aBôŠÚâçë¾f7kŠ\3P3[DÅŠM”µ‘+f‰0¬SøÀAUy­É Ø@HÙ@¡rï.¯ifÓI)îæ%Ük}yšZ ?‰4Q¬…ì)™q¯ œÂ÷";«dN5]Éõœ\G×"¬ÛZ–0YÈ©T‰«ˆƒ¸‹; ëXŠ0oÁ4…S ´j0:ÔQ“jY×ñwÁš*f̧¹”jim÷E“ꧧ´Â»`M94cÀÖl¶œ*2ЭÝ!„bö?j¥P3”âÐ4¦²z¨5_ë’OÉvI M§‡NÃ&Þu(èF3»5céê°¼RëÁËí«*Ÿõs.7 à(dÊ!UnÜÛOX™xlÖ -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ò÷õvÉÞñ ¹û¹¿ß=M'þê"sYql†Çb³ën÷H6wné΢™îŠÄC²J Ͻ¢¦D0ûf^÷Þ¡ ±âI'oñ §íÙ³Q$íJî¹¾Øà!Ù.ÉŽ C%QÖõÉÎÔIÌpZñ&ÙlZ×uÒf°}€+*Õ1¾㪊‡DÄ*mqu«rÔ?h‹qÍ…îSvªéê -ûòÂÃ.¤†MÏÇÝ`°ûPwç€çÄó¡~œr†Û¢û˜Šk¢‹ëŠ‹¢ŠÖæjZvùLº’Š E¯Ç ÏA觟¿:¦¡?¤à˜ endstream endobj 15 0 obj <>stream -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*\([=LCSggbU&a)n-U6oQ -rHl3_!2WVAM#~> endstream endobj 16 0 obj [/Indexed/DeviceRGB 255 17 0 R] endobj 17 0 obj <>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#soRZ7Dl%MLY\.?d>Mn -6%Q2oYfNRF$$+ON<+]RUJmC0InDZ4OTs0S!saG>GGKUlQ*Q?45:CI&4J'_2j$XKrcYp0n+Xl_nU*O( -l[$6Nn+Z_Nq0]s7hs]`XX1nZ8&94a\~> endstream endobj 13 0 obj <> endobj 14 0 obj <> endobj 11 0 obj [/DeviceN[/Black]/DeviceCMYK 20 0 R 21 0 R] endobj 19 0 obj <> endobj 22 0 obj <> endobj 20 0 obj <>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 <> endobj 23 0 obj <> endobj 10 0 obj [/DeviceN[/Cyan/Magenta]/DeviceCMYK 24 0 R 25 0 R] endobj 18 0 obj <> endobj 26 0 obj <> endobj 24 0 obj <>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 <> endobj 27 0 obj <> endobj 5 0 obj <> endobj 28 0 obj [/View/Design] endobj 29 0 obj <>>> endobj 12 0 obj <> endobj 9 0 obj <> endobj 30 0 obj <> endobj 31 0 obj <>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 <>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 <>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ÿÏõÏ致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ˆ\¢õƒÂÿŽ»>úÉúà'ìå'íé'î¡“×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̯YÑ›¥&ÿÓlÿ:¾£<ð½ï±ZV{m¶Û7ÇÜ+Ë›i9ïòf©Xîû}Þì[/>öšóÇ.Ó»ô-þÐ}k»½Ç>uÚú{æ76šRÁíÞö‡ä~?¯ÿõîó±hñº¯~Àÿ*Zü¯¢Åw-~ŸbÄï[ØøgÜùwî÷^Ú~Ÿåæjy÷Ó?xù¡ ~ÿ•ýËݾÊ÷,ßoô`䟕”|oJòúÚüϬÀ÷üݧß/Çwœ -|¿ß}ϵxñìñøûg_gQEhóUw_ýh I݈mæÁ7e{ò Ú&my± ßùø*~­Ÿýz¿¨°´ùuoé‡ç9?Ø–Û?O <{¦åò¸Â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ûÏÙø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'®~Öì,mã©Õì,™môl5;Kf[»×ì<™]zÍÎó9jvžÌ®cÍÎ’Ùcë5;àAÍΓÙe¬ÙÉìâ¹lOf—×¹ìâ©lçž‘i›ãÕ¢`¬ÇxC.k°–#¸gÃn›®s Ÿ ÎUttôMžÌÎ{°oòl¶Õ~vºÕPd úÙ©PÖiüy‡]î2­Ó,® `#pòœ¶e„0pò¤¶EhÁɳÚn9'Ok;?ÿâá«ož?|f?†ûî«ßÝÿ¤výÈOè:†~|ÿ¿øæ+û1×=>>|öÙ·_üüËoü„|ÿ¿Ûÿ}z‡ÿÀ¡ÿh¨ýÄá/g¿vèozøÎ7ýås{ËÿQÿWÿïoî˜ú]úÔïú6×{¿ÿÑïÿóºcFô_ߢo¦ŒÛéyS’´®\’ô3xO¤¯×%IÃÑ>¥ ÒvïjJ¤¯Û’¤sâH󣯱$iíÛ’d;ß.Qf;ÓÔèëUIÒ»RIÒa•J’·›’¤Î/ªL¾†’¤5oK’öÍrIÒ÷V*I:»nJ’öÞ\’ܯ±$i º)I:‡zIÒ¾g‚¸í†Û’¤í©\’4„ä’¤‹›’¤â\’ôCœJ’~"Ý”$ílË%É£Œ%I;ÕoK’F(I.·Jñ_ :·%IëË%IS*I:»nJ’Öw–¾ïrIÒÚ·%IëË%IßÆá«5oK’þÑG_­K’m±$é}‰âþ1©$i{äãÍT’´íå’¤}­›’¤í„qÛy¹$éï¦$éƒ3•$­K’vÌnK’~¬SIÒÇKIs£¯×%Iï[:¾fÚÜèëUIÒa•J’ÞN%Ikç’äÿoËZú-¥Ú1mS»Ç¤¼Æ{S»ÑÝCòúšºˆÌgK×™ÏJRrd>OG[‡À|¿t®˜ïÛtSŠ0NÔ³rËùÙ®ô˜×s e)._ê…ë8S\¾MÓÕn——ï‡*9.ߎí¶ÊkMÇŠ=*¯€+¯-:IQù>µ8VqùY®†ï—_W«Y(.ŸK+µ–_“.S=,ßK»+*ßLÍQ¹—Ãn¢r•[Ê÷íL÷Ñk–¸¶bnÊϵî -Ê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ã•Ç>Ý&IÕ¿æÌÑøyÎgGzí°­Ïÿš™þ­þ§XÚ\±© ¡´)eóÉ5n±öyôHÚš6lz$ݬ´¢8Ú5¶£•6¬Lj³ª_£[߬b¤ÅÑfNƒ½µ›™¤8Ú¼¹]uÊ­Io“Ýo#6÷ÎÎI[ßÜ.³­@;¿ñáG$míéŠ?Ëoî×¾ýj‘ªEÒæj­-ZöHÚd­åŠoÞ"i½eî‘´-ïh‘´ÀmëÁJë;Ö¶¿Z$Íä"ézæìkÆ-”.­TK,m—?Õˆv©”ÓaT‹¥ ÚÓÜcéÒ6±´]WÇHÚ4ЫôHš™/DÒõü*ÄwDÒµïl÷9Z$]Úƒa"’®íÊÓ1’®¯-S‹ýæ¾õ/=”Þ=|îa±…Òv04£ÆCikïÛ¡´;«nöPº x«Bg ¥ý˜kò…Òîl®±Ž‡ÒÖç—t¶QÇÚ¶öXz·‰5\é±´Ÿ!ó¢¿Åbi¾k¬ÓÄÀíBi;¶VÝõPz÷{éW„Ò~^±Ž‡ÒµÏKë„Òµ]/ú¡ô.Á&‡ÒÖ··aã±´mâhg…ÇÒ¦}ÚäŸKï.ÝD(]›ëÜN6¥ÝÝ#üöPÚú–ëlgÁt5ã4Bko—µ3 0“÷Ž%Bik_-ÏôPÚ0t,c,m} -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Άø¶^A8ôjçí†æ œ÷µ_"qÂy{À9ƒæs \ûɈ%¿† ¹õ-&¹yl™pÖåá±gí½å²F8×"Ë>΄ì£ÄÃÝÊ¥4ãÌaÞÛ.g}¥Eþ9÷±[Lá狵ÏÖÈ™>]ÚÕÓ!ç¾ôÙbo7¶åVM^ƒrÖö{袜+ØÇ:PÎUîv:åÜ_· œ»å-¨ ÌÙ÷=s¾Ï–Î9ÓZ—èL}µïéL—õš¡HçvmK"ƒt.áî:µ1™Úg9Й©­ ËAg^¯_+:3µ·%qÎ4íc=‚s¦iŸÓœ[}*M8gšöºíÁ9Ó´g…mÆ9“‹×–èLÓVðê 3)ùÜçÝJ^“H·ªp#Э¤F{Ï-÷ Йr=M[€ÎÚÇ2è\ÛžçtÖ·¶Ãé ‹mtîS·RN€Î?{;tþž–×8è¼­4E ó®m ÒùǬWÎ-ôiHg{RA¯“Îçrél„,Û6ÎFÒÖ°ä¤[a®Hç#o9Òùè\fHgͶUçc[Й¦}­s€ÎÑrm:?'Z ó¾–#;è¼Ý¶ë¤sÍó@:ßn9‚tÞžŽ :ø é\É>ÖLºÅfÝ®=[]4sW¤sµ²‰A:ë+ç)Ò™³¬šœ‘Îæ}ÌV~ô@¤s)ûèÙªµçcÌVMÒÞΞ­º.ÝB>'·ç1]õí¶ ÇI·øì¶#Hgí½å+A:ײž®6Õ{ Ò¹`Þâ» {ésOWÍn†tæ°Ó˜®ºûÚúœtæË.[€ÎíÚsÌVÝÂm­“ÎDí}îÙêj“· ;é¦Àéì¦ÓÕAg“3[ìÏi.Ó4H7u";éêëç èl.æÖÓU³´wÞc «vc¾j–ö¹÷|Õ­äVh +ªcfÐym¥'¬Þž{Âêæs»uÒ{ÒuOXWû›–ÒIg‡d.#éÌ{ÊÛ€tÅfÒŽ)«vKéì=-¿i¤+=ctÖµõ”Õ?fí)«ké#çêŽ<¦ž±úÁlŒrÎÙ9”¹Ã9H×Ö3Öåj3ä᜻eÌX}l¶lÙÆŒ5¯µ§¬‹ý*Æ6¦¬6Ä—VpÐ9Y®ž³.šÜŸAç}­jà óö6èE#ç|³¥ç¬ÞžzÎêfwy•³.>÷8W4AΕ–¥ s~{ì1§9¹ÂœÝP;·ÀœÕØ·ñæ†?s¡é sæ=ïGÇœÝÝjíŽ9;!ÛU´anjîE`ÎÚe1gÛmw+æÌÙ.r6³mßGÊMª>A9;Ë[¼Qn²Ý°”³;ážr¥Ê \S+°uÊyMq딳ÛkëÒ1g§ãΙ€{µZb£ÜsÊ™¤½«öå–9Â/§œI½~±æLÒ^Zå„OYÞø½S0·¸%zæ“̹Åo ŸÁ9S‰'pƹÚöy¾™s‹ ¯} Ι’ìÅ5qn!Iœ[¨°ˆs iŒ8ç6u;ÀÁ9ëóy(âœYÙÛÜ+sÖ^t Î5“ûÎÅ6Ä9k·á˜ó¿C·çÖXc˔󮔹Zû\KPÎôk8g;rjQ’sÎg¿½Q›¥¬ãý HKcRüs6ðZ‘³cN?b -æl(´X­a®ž­åËs6¢Ý«h˜3°œGÇœµ[¾Ü1Wt¸À\QîæŠnPfÎù”Õ«sÎ4îVœoœ+JGÎÍ>/aÏœ›ùIQqÎÚž­7й:ÙÅÙ¦Ê4ÐYki—Î$fݽÐÍÔi:“ŸÏ½g®öú´™«ùÓËÑ3×&y/:o—1sõíöÄÕµíVtuйÞ -·:ësò tîŠ/ýV®ýi¥…w:ûÆ¥ôÄunS¡t¦µ®×˜¸ºúz­º¹²Î:³kmÞB&I¸KKnt³~ÒÍþ¤ç@:SµÏ:óz¯³'®fjsI 3O[·stæiCd;yÌÓV 3O{_{æjžöz,:³‹¹?èf¯hôÌÕÅìVpйù<5:ëÛz<ç͹g®Í§0gÊu¹zâjík^sÖ>ÊxÂúöÒ×؆0gíiWÿè–ùÈö÷´ÇAçícH\½kí‰+v8 s+ýWÛ‘ëÕW?œRN:![»%¤³‘t¬=qÁ:xó˜·Úà\Ûïüú ÑGqΆóµŽy«ÿÁ²ç,gÏ[½ÝœóÓ¤cÎ›í¾‡cÎAtÎÍš7ææ%î;ææE×úse3cp˜«b]Æ -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^È ™x!ƒÀ<›û¿-K¿ù6H¦:Ô ì…’¹75çµO3 ò¡ƒdòuDèë:ˆØ×u¿ÐAˆóÐAˆóÐArœ‡Bœ×ÉÖ=„è!„ÌJ!—E鹬tRYtRYtœÊJ!“E¡d‡’Kvè ”ìü´ê™,>ÈP²“%;å5Tìäƒ »7M⊄¨ØI*vB¢bÇ6¨ØÉJvf„¤(#$jv2BrÍNBHÔì$„DÍNBÈP³“©¬„ˆò$„ Qž„ˆòd„D”'#$Ã#Dð !ú…’ñBüs!dêu»ðA2§vÔæ R )$#0¬ V +äƒÿìÙÉBõÚ&x™ÿ“}›vðY»?tcž¥mÙ½7›$¶1aÜ…›Z¶í{(#Ö¾Ú4Øȳ¦íy­âÎÈVƒw~«kmœ¨`½Â±Ùl{¨×í$k(#>ÿMj‡)#µ½”cO°Š¬Í™Û%[[5ÄÚ¥\¡Œlö«z{üU®ŒØ¬ª¥¹6=ɧæ5oÙ•‘mmó2µŠ+#6cê<®PFlÆÔ±„1Âó,´J›‰¶†ðâПH£Ÿ¿1cdóŸ’”®,c¤öÙÅcÄ&.–ö»~§ÕÚÛ¶€_“|dó=ܱ¶û2F|²ã>:#Öw6›Ö§1Ø$«¶í뵎;#>G¬”pFì=þ£VrFìõé/ÃßKG(#¶¦¸2b;z﫸2bÃh2â³Ýæʈµm: -ë˜îá³äÚ¯…¹2bÇ\fµ+#>¯²Ä:^ò³±ä¿Õ·áaʈµ÷îr¸2²ÙOÎaŒØp½b•ö|ã«ØÀ÷gæ¬W(#v^ᣛ2bç¦ÝÀÐ:®ŒøÌÉ9Œ›½x6Óh-šx¸„häÆH{˜ÍƈmA¿@àƈÍÍ4ÀÇð\ý±;çÚ~Á•›ÒÉO¥lí±2åPGD9™#@s$SsÊaŽ@9Ì‘[Ê¡ŽdÊáŽ@9Ü(‡<’)‡<åÐGàþHæþ Ãtø# tè#€}СdÒ¡@:ôH‡>’I‡>éÐG úHFú¨Cë°G2ì°G ö´ÃÉ´“=ì°G€öH†ö°Ãv²G2ëðG`þ¬ÃɬÃuø#°$ÃD°Cvè#™vÒG€ú°CÉ°Cývè#À}$Ã}Ø¥m8ìÐG2ìÐG;ì`‡=’a‡>íÐG úH¦úˆh‡=í°G2í°G ö´ÃÉ´ÃvÒG€úH†ú°Cvè#vè#‚ö´ÃÉ´ÃvØ#Ð{ä–vè#™vø#ÐÚ!dÚ!@;h‡C’i‡CípH I¢ - ´C!v($™v($Ð…Ú¡dÚ¡@;h‡B’i‡BíPHD; ’L; h'ƒØadØa@; ’  ’v2H‚vÍ ØÉ h'‡$h7—íšC2ÀNIÀNIÀNÉ;9$ÀN -IÀN -É;)$A;)$A»õÕN;éA;)$A;)$í¤íú6í¤ ´“BídíJä-vRH‚vRH‚v® ¬“BëdÀ: ’Ì: X‡Aë0H2ë0H` - °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Øá’;\`‡K’`‡JìPI€*I†TX‡JìPI2ìPI€* °C%É°C%v¨$‚&I†& °Ã$v˜$™v˜$ГÚa’dÚÉ$v˜$À“$×Øá’;\’ ;\`‡KìpI2ìpI;T`‡J’a'•Ö¡’À:©$uh  •Ô¡’dÔ¡’€º´ G*If*‰`‡Iì0I2ìPI€* °C%É°C%ì0I &I¦& ´“Iì0I2ì0I€TX‡J’Y‡JëPI`*IfT¡“Ôa’dÔa’€:LP‡Ir‹:T’Œ:\P‡KêšL’A‡LèÐI|’Ì9|8‡OçðI礓€9t0‡N’1‡NçÐIà:Iæ: œC'sè$™sè$pDœÃ&ÉœÃ&sØ$p›$s›ÎÉ&sØ$sØ$p›Îa“dÎá“À9|8‡O’9'ŸÌá“€9|’Œ9|aÌ¡“dÌ¡“À9t8‡N’A‡ -èÐI:I:  KÛpС“dС“tØ$€›$ƒС“:t’ :t›Ða“dÐa“:lH‡M’I‡MéÐI@:IF: ¨C'uè$uè$b6 ¬Ã&ɬÃ&uØ$°›ä–uè$™uø$°ŸÖ!”dÚ!”@;”h‡S’q‡SîpJÀNI”p‡RîPJ2îPJÀJ ¸C)ɸC)w(%à¥$ã¥Ü¡”w%w%à£Üa”dÜa”€;%à£$ã£Üa”îd” ¸“S¸›‚Ì wrJÜÉ) ÞÉ) ÞMýæEðNN ¼“R¼“R2ðNJIðNJIð®D ´óN:HðNJIðNJÉÀ;)%Á»¾Æ»¦” ¸“RîšQ´+‘¶tÚI) ÚI) ÚI)h'¥D´Ã(v%™v2J€F °Ã(É°Ã(v(%À¥$åء”;”’ ;”Á£Øa”dØÉ(u%°£ä–u¡”dØ…SíÂ)w!•dÞ…TðB+xá•dä…WóÂ+zá•$ê…V÷B+|¡•dò¡•@¾ÐJ@_h%™}¡•¿ÐJ ZI¦_h%à/´ñ/¬’ @¬’ˆ÷d•D¼'«dˆ÷d•D¼—è柬’!à“U‰m³J"¯•U2äµÍ+‰´V^I¤µòJ†´¶y%‘ÕÊ+‰ž¼’¡„'¯„ž´’(áI+JxÒJ¢„§$‡ -ž´’¡‚'%$*xÒJ¢‚'­d¨àI+‰ -^ßF«àI+JxÒJ¨áÉ*‰ž¬’¡†'­$jxÒJ¢†'­d¨áI+!­•UÑž¬’!Ú“UÑž¬’ˆöd•db•ÀÐJ `h%¡•À@´ZI†`h%¢ V  «$c0¬@V $ «ä…ÿµ›aB²Vb}óV‰M©ØÏþkOýé\n•Ø4 =œÙã@k¯s<ÐÏ&jý)!vÃĺÊÚèg“¦©?Ðoµ`wå!vßß\MR‰Ï9ûýl6IŸïõYëÒÓ¿Ü)©íö³ôrJ¬=-ñ5Ü)©}þ¬H9%mK ŸM>X–ñ~6ÁEh9%µ}ÈÁq©Äf ÏyÐKÚsÏJ|vÐÑè·Zz‚HûýÀÍŸ%¥ÄVØ—þ@?›Ö3ñ)%LýA)±u®Òèg¯Û=5_GJ‰MÒC-}jƒý¡Wéô³©¢ƒ”ŸNqöú­ÊQJ¬m„¯#¥ÄwÒº‡Sb;±=Ä•ÛÏvè´Š+%Öwý~>1äêô³C·°Ó¤ƒø„’³?ÐÏÚzˆ+%>éèg}×´Þ§mR?ö6ðìêñ1Vaµ±9_ý~6t—«?Ðφö6Çp¥Ä§.Íý~vRY¼Rbs’ìù¼ZÇ•ŸdtíᔬW{ø‘œ›qcKƒÀëÛúCHl z+%6‹ÉæíÇàl?ËS,])±v9ûýlÏÞŸBäJ‰OìYçPJlÕ‚bR¼í>£Öi¬~CÿQ49%Ö>÷þ@?£Pí~‚U<í÷¤”Xû˜ûýfËú'PJŒJ)£2J£2JŒÊ( ŒÊ( ŒÊ(É•P•P•P2pTF 0mBI°TBIf©|’`©|’`©|’¥òI‚¥òI¦òI˜Ê' ˜Ê' ˜J(`*¡$`*¡˜"”$˜â“¦è$Ð$Ó$~‡ÛtPŠN’QŠNJÑI@):IF): (•N²ößfq$“’Ê'HÑI2HÑI): E'É E¤ÒIà¨t’ŒQt0š¶ ßÒr›$c›Œ¢“€Qt’ŒQt0ŠNF¥“dŠ¢“@Q|(ŠO’1ŠO"Œ¢“F¥“ m:IPT:IP´ÄzwŠ6$ *$ *d€¨t’€¨|’€hóI2C¥“C¥“C¥“Ü2tÓä†L¸M:‰·É&p›l’L¸M6 „k6 |Ã&I|“LÞIÀ2IÆ6‰ð†Lß$“$¼á’€7\ð†K’ñ†KÞpIÀ›\’L7\è¶5—¸mM&ÉlÛšLÚ6É$ m“L’жÉ%Ú6©$ m“J’ѶmÔµ RI Û&•$Óm“Jݶ½C˜;…ŠpƒnÛUhfŸSÛn4•$Óm“JÝpI„7©$™n¨$Ð •º¡’dº¡@7Tð†J’ù†JßÒ6¸Ã»¶?-ø†IßPIà*Iæ›Tð†JÞPI2ß6©$ðm“Kß6¹$™o›\ñm“Jß6©$™o›T·I%p›T’ ¸M* „Û¤’@¸M*I&Ü&•ÂmÍ%p›\’D¸MÓ® Ü&•ÂmšºuK8T’L8T“Âa’dÂa’@8L‡I’‡HäI€"I†&‰ ‡HäIåðH  ”Ã#É”Ã#r0Êá‘dÌá‘€9<8‡H’A‡HéI "I"<С‘dС‘Ä—F褑dΡ‘À948‡F’9‡FçÐHàI  Ã#èÐH2餑:4@‡F’A‡èÐHI  KÛ8Ú©ìI  C#th$th$Ò¡‘dÒ¡‘@:<H‡G’I‡G"Ò¡‘@:4’L:4H'С‘dС‘:4@‡F’A‡FèðH I" ¤C#th$·¤C#ɤC#é°H I& ¤Ã"tX$‰tH$‰Ò!‘dÒa‘ˆtH$‰$‘‡Òá@:’L:H‡CépH2épH  ¤C"ɤC"t’HI‰H‡B¤“B2nŠð«‘®)$:)$é¤é¦Nd']SHÐI! ÐI! ÐI!@'…$@'‡ÐI!@'…$H'…$H'…d ô ’ ’tRH‚t}‡TùSV ’ ’ ]éÙJN -IN -IÎ’sRH‚srHàIæ‰8‡BçPH2çPHà -  C!É C!t($€…$ƒ…Ðá:9$‰s($p…Ρ¼âœ’sRHà\3Hs2HÌÉ ÌÉ ÌÉ É˜“@˜“@˜“@2`N ˜“@˜“@’1'$0×ü‘ œü‘ròG‚ròG‚ròGÊÉ ÊÉ Ê•ó“|¢rPNI`® $™ròG ÜsÊ¡dÊ¡@9ô0‡>’1‡>æÐGÀúHæúœCsè#™sè#pDœCÉœCsè#p}$sõΡÀ9ô‘Ì9ô8—¶qHôØs²G ú”CÉ”Crè#P}$s}ÎÉ ÌÉ0'ÌÁ[0'}dÀœô‘Àœô‘Àœô‘sÒGsÒGsÒGÌI Ì•È:æädÎI ÎI ΕÈΡdΡˆsØ#€{$ƒ{Ða:ì‘:ä@‡<èG2è°G:ä@‡<’@'wÎáŽ:Ü‘ :Ü@‡;èpG2èpGî CÉ CtÈ#€y$‘wD¤Ct¨#™tRGê CÉ Ct¨#€u$ƒuСŽ:Ô‘ :Ô@‡;"СŽdÐIs¨#pNêHÆÚ˜Cs¨#s¨#`.mãâ1ícâŠ9èPGêHê Ct¨#t¨#€wÒáŽdÒᎈtRGêHê “:çPG2çPGàêœCÉœ“:æpGÀîHÂê˜Cs¨#·˜CɘCæ0GÀ\3G2ä0G€æ“9’‡8ãG`âHfœÌ!qÄ!Ž$ÄáÀ8¼‡7’‡7ãðF`ÞHfÞŒÃqˆ#™qˆ#0qÆ!Ž$ÆáˆqÒF@ÚHFÚŒCqh#™qh#0mÆ¡dÆIqh# m$#mÄáqh#qh#0mÆ¡dÈ¡|9´ ‡6’!‡6äÒ6éfdÈa9´ ‡6’!‡6äÐF€ÚH†ÚÃrx#r¥—H rh#Pm$SmÊ¡€9´‘Œ9´0‡6æÐF2æÐFàÞœÃIœCsh#pmä–sh#™sh#âÖœÃɤÃtX#k$¡iÔ!€:¤‘Œ:Y#BÒ¨CI¨Ãu8# g$£gÔጀ:œ‘Œ:œP‡3êF2êF@Ò¨CI¨Ãꤌ€:”‘Œ:”P‡2¨“22 NÊH nêLvÔIP'e$X'e$X7õÁ:)#Á:9#°NÊÈÀ:)#Á:)#Á:)#ë¤{뤌뤌 ¬“2¬ëÛ8šÜQnf”`Œêš2¤+=Y ÒI ÒI ÒIH'eÒáŒ@:œ‘L:9#Ê CÉ Ct(#€e$ƒeСŒ:”‘ :”@‡3èpF褌À9”8‡2r˹PF2èBéÂuaŒdÖ…1ìÂvaŒ$Ü…0ïBx!Œdâ…1"æ…0ôBIÔÃzá‹€½ðE2÷Â|á‹@>|‘L¾ðE@_ø"°/„‘ ?„‘ˆó$ŒDœ'a$ÇyòEˆó:ÙZ ']dô¤‹D2Ût‘Èe¥‹ ¹lÓE"••.©¬t‘!•mºHd²ÒE¢d']d(ÙI‰’|JvÒE†’t‘(Ù)±¡b']d¨ØIõˆŠt‘¨ØI*vÒE¢b×·q4­cÖ ¾^²“-5;é"Q³“.2Ô줋DÍNºHÔ줋 5;é"‘Êʉ(O¾ÈåÉ!Ê“.Qžt‘ ?tàºô ]$ã/tø‡.ÿBÉ ]â‹@ÀðEC‚¡‹@ÁÐEn1øoR)n ¶HüQ¢è"“Ïf [D÷/>»K¶H=j[é²Hmúƒd$‹Øeu‰5š-bà*¥Û"S›z¶HEß^–°EŒúKÒElþ»¼×E¦6£žØÚ YŸ%‚/bí©Íƒw_¤¶ÏmŠ?Ë}»·4‘Ã&'ÙÍ·öT×Eüæ[Ÿ)ïºÈbƒ{žC±›k{{²‚ë"Ëyó‡Ö‡ìâÃÏnŒï뺈µín¤¿òEjßlÌ–0bwµmˆµmâ¶Vñ ’õIöpaÄÚnOHñ»ë2ä‹X×9•ðEìžE<ø"öm6”ù"öçm _ÄÞcU|{} -÷Ã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¿!šû"¥Í _¤daL“¢jŸ?á aÄÞsm]±½ö§ÐEF±EÀ(ºˆ0Š-’1Š-"Œ"‹€Qd‘ÌQl8Š-G±E2G±E€©tXŠ.’Y*_$X*_$X*_d`©|‘`©|`*]d€©t‘€©t‘€©t‘¦ÒE¦ÒE€)ºH†)¾0E¦#™¦#ÐÔ…PŠ0’PŠ/JñE@)¾HF)¾(•/IñEIÑE ©t@Š/’AŠ/HñE)¾H)¶ •/Gå‹dŒ†/"Œ†/"Œ†0’0ˆ0ˆ0ÂHÇhø"Âhø"Â(¾H¢hø"¢hø"¢hø" £á‹£!Œ€Q„‘ŒQ #¢(¾ÅÉ•/DñE€(¾H†(¾Å¢òEÊ ‹5a†"ŒÀP„‘¡¡‹tÂ…-"Â….Ò¶H"\Ø"p’EÄ·Eß°E„·°E„·°EÞÂÞBßÐEÞðEÀ¾xÃÉxÃoø"›t‘L7tè&]¸IÉl“.ÚÐE@ºHF¾hCm#m#  aº!Œ$ºá‹@7|è†/’é†/Ýâ·:…7ù"‰nè"Ð ]¼ÉÉtÃnø"Ð _$Ó ×ºá‹€7|‘Ì·ðEÄ·ðEÄ·FßBßBßBé|ÃÞÂÞÂI| _D| _D| _$ñ-|ñ-„ñ-„‘Ä·FàÂàÂI€ _D„ _D„ _$.|_D€ _$.„.„.„‘p+ºH'ÜŠ-"­è"p+¶H"ÜŠ-Ò·"‹ˆq+²HbÜŠ-"È­Ø"‚ÜŠ-’ ·b‹r+ºˆ ·¢‹$Ê­òE Ü*_Ê­òE2åVù"P.¦æ5Ê­ÒE2æVé"`n•.çVé"t«tH·Jt«t‘Lºµù"€n=:ÄʤÚm› [ˆ¹˜Ãà [›0’8·Ês«|8·ÊÉœ[å‹À¹U¾œÃI Ctè"€_$“N¾ Ãtø"t¸€_Ðá‹dÐ…/"Ð…/"Ð…0’@ˆ@ˆ@ÂH]ø""]ø""]ø"‰tወt+¾ˆH¾H"]ø""]#"ÝŠ0’H·"Œ4Ò­òEº_$nÅèV|‘úfóEèV|nÅéV|‘2HcMéV„‘nÝ#ïž>¡‹tÒ…-"Ò….ÒH¶H"]Ø"t!‹ˆt!‹$Ò…-"Ò…-"Ò…-’H¶ˆHºˆHºH"¾¤Ãtø"™tø"_D¤CɤCtè"]$“]ÒItè"tø"a$H'ad Ýñ¶Ç¦á “0’I'_$H7’éš/2€N¾H€N¾H€N¾Ht‘t‘|‘tòE‚tòE‚tòEÒÉõÒÉ ÒÉH‡/éðE ÂH&¤Ct¥',W|æ‹@:|H×|‘Ì9|8‡/"Î…/’8¾ˆ8ˆ8ÂHâ\#sá‹tá‹$Ð…/"Ð…/R"íhSbèÂèÂèðEçBçBçB9‡.’8‡-礋sØ"sØ"²˜CɘÃsØ"`[$c[Ì¡‹€9t‘Œ9ù"¹æ‹åä‹ ”“/”“/夋 ”“.”“.”+ñ˜üHŸœ”“.˜kºÈ@9ù"A¹¹Ì(‡0’)‡0åFÀÂH¾˜Ãsø"™sø"p_Îá‹$Ρ‹À9t8‡/’9‡/çðEà¾H殜Ãsø"™sወsወs# s#¢\#¢\#rወrወrá‹$Î…/"Îá‹€9|‘Œ9|0oÁÂHƈ0‡/æðE2æðEÀ¾˜ÃɘÃsø"`_$saÎ!ŒÀ¹ òô ]¤s.lq.t‘º°EèÂi  YD  Y$.l.l.l‘º°EºÐEºÐEèä‹À9|@‡/’A‡/èðE:t‘ :t@‡.èÐE2èÐEº CɤÃt#a$“N Ct# tø"€_Ðá‹dÐá‹:|@‡/’@‡.èÐE¾H|8‡/çä‹dÌáz€9|0‡/’1¾ˆ0¾ˆ0ÂHâ\#]#]#tá‹tá‹tá‹$Ð…/"Ð…/"Ò…/’H¾ˆH‡0"Ð…0’@ÂH¾ˆ8¾Hâ\ø"â\ø"â\ø"‰sø"Â\ø"Â\ø" s!Œs!Œs!Œ ˜ ]¤c.la.t‘†9Ù" ra‹4È…,"È!‹$Æ…-"Æ…-"Æ…-’‡-"Ä…."Ä….’‡/ãðE`¾Hf¾ŒÃãÐE2ãÐE`ºŒCÉŒCqè"0]$3_ÆIq#q#0aÆ!Œ$Æá‹À8|‡/’'_Äá‹€8|‘„8t‡.âðE2âðE`¾ŒÃÉÃõrø"@_$C.|A.|A.„‘¹F¹F¹F:äÂäÂäÂI _D _D _$A®ô_špÈ…0"Ê…0’(ÂH£\ø"Â\ø" sá‹sá‹sá‹$Ì…/"Î…/"Î…/’8ˆ8ˆ8ÂÈÀ¹ÐE:çÂçBiœ [$‘.l‘FºEDºEêÂêÂêÂI¨ÃêBêBI¨Ãuø" _$£_Ôá‹uè"uè" ]Ô¡‹dÔ¡‹€:tP‡.’Q‡/ê$Œ€:„‘Œ:„P‡0¨“0’Q'_$P7”êä‹ ¨“/¬“/¬›úŠ)Vq]$X']$X'_d`|‘`|‘`|‘ur=‚uòE‚uòEÖá‹À:|X'a$£aÔIt¥ç+Wÿ2çÒóÖðE ¾H&¾ˆH¾ˆH¾H"¾ˆ@ˆ@ÂH]# tá‹tá‹$Ð…/"Ð…/"Ð…/’@¾ˆ@¾ˆ@¾Hˆ8ˆ8ÂÈÀ¹®‹tÐu[D¤ëºHC]·Eëº-Ò`×eÑ®Ë" wÝïº-"àu[$¯Û"b^×E½®‹$êá‹@½ðEÀ^ø"™{ዾðED>t‘L¾ÐE@_è"°/t‘ ?t‘ˆó¤‹Dœ']dˆóä‹Dœ—Èæž„‘!Г0ÉlF"—•0’sÙæ‹D*+_$RYù"C*Û|‘Èdå‹DÉN¾H.ÙI‰’t‘(ÙÉJvòE¢d×òš¨ØÉ*vr=¢b'_$*vòE†Š¾;|*v#¹d‡0BÍa„šÂHªÙá‹P³Ã¡f‡/’kvø"¤²ø"Dyø"9ÊÃ!ÊC!ÊCIð a¤Á¯û"¢_÷Eþº/"þ…/"þu_$°û""`ø""`÷E»0"vaDìÂÈgvòŸP±*¹ÙAÙ±¾r¬á‹X¥Ýæ"ŒX¥ÝFÕgw]±ýuîaŒ,ªÚɱ—=bcÄú¬$ƒ1²Ô3ýZ¯0F¬]ô“¯b­}“ÈáñãÜjz#v—a»ÖøFævC#„‘¹Ý2adnÅ7­Ó„‘¹þ¥MuqaÄÊÒóÞ•¥µJ3FÌ¥¸®nŒÔÛüš&Œ”›G8´>ŸqÂÈÔN˜FꀯW¢þ"ŒLíiP#v…¬»1„‘©MS×*íŠ4µ4:„‘©M* adjÏøñu0F&›¼ytcÄN¨mëƈôx #ÅvˆÝH:÷.ŒÔ¶1ÚWÁ±t^Ý)íÒÆHi×´N3Fì^oÙ»1RZìÆÈܦ‘°Ž#s;ÕñcÞžÒŒ‘úùVhÒ:^ñ³>wÙû6|û#µíÁŸã•Õ:>ç.ŒØà]bÿ¿&±Š#vØ$HŒ;Ïj¾ƈ‡j¾Œ¿Û²†0R›þÄ# #~ofÛ.ŒXŸ #¶=eÇ…»Áe•Áž«ÿŽš?ò cÄÚÆqŒ»¿³õ ¹1â÷ÎÎ-Œ»·¶`o»«¨uÚ[|æˆ5-ôA±`¦ñ¼jðY6­cˆ¿GOñ‰U´ãðȧ?XP*g$P*g$P*id@©¤‘@©¬‘@©¬‘¥²F‚¥²F‚¥²F2K%P›4<•42ðiž"ÀS¤‘ÌS¤xŠ4P±F2P±F*Öˆ€Š4’Š4P‘F¦˜ÏÏO.PCPCQCID iDDmÒˆpÒHÂiX#ÂiX#ÂiX# §a4œ"ˆ¦!$š†5"šb¦a$˜†5"˜†5"˜†5’`Öˆ`Š5"–b$”b€Ò´?ó±F2J±F„R¤PŠ4’QŠ5J±F@©¬‘LR¬‘i’"d”"€R¤‘@©¤‘¥M ’Ê ’ÊHÚ¬‘©¬‘©¬‘¤²F©¤‘i“FŽJ ŽJ ŽJ¹å(ÚH¦Þ”Ãrˆ#™rˆ#P®™#0s$3NæˆÃq˜# qˆ# qÆIɈ qDˆ qDˆ q$!.Ä!.Ä!s$.Ìs¤q$ñ qDx qdŠéüMIx qDx qDx q$á-Äá-Ä.Ä‘D¸0GD¸0GD¸0GáÂi„ qDˆCI„ sD„ sDˆÃI„ sD„ s¤ôÇÏíò„ sD„ sDˆ s$1sÆ¥m8ã0G2ã0GÄ8ć8’'sÄaŽ€8Ì‘Ì8Ì1qÆ!ŽdÆ!ŽÀ8ć8’‡8ä0G€æH†æ”Ãr˜#™r˜#¢œÄ ‡8’)‡8åG âÈ-åPG2åpG î”CÉ”CrØ#p{$s{Ða:ì‘:ä@‡<èG2éB™ãÇ¡›<2Çï/7y$‘.ä‘.ä‘.ì‘„º°G„º°GëBI° yD´ yD´ y$ÑyD° yD° y$Á.äÁ.ä‘)ÑåòHb]Ø#b]Ø#b]Ø#‰ua4Ö…<"Ö…<’`öˆ`öˆ`öH¢öˆ`öHé¿cµ·6`öˆ`öˆ`öH‚ö°KÛhò¿ì‘ ;ìÁyØ!dØa@;ìh‡=’i‡="Ú!@;ä‘L;äh‡<íG2íG ì`‡=’a‡=ì°G€öH†öˆ`‡<íG2íG ò´C¹¥úH¦þ´Ãv$™v$ЃÚadÚa@; h‡A’h‡@íH I¦]$sÌmnɳ‡›@’h‰h‰hI¢]$¢]$v!$Ú…@"Ú!L1¯¿ $ v!ˆv!@;’L;h'Ø!dÚa@»©sù”~ÞÀƒD°C v$v$ÀƒØadØa@; ’’Y§ ´Ã v$™v2H‚v}üÔ‰$íd@; $A»yK§ ’  ’ $ëdÀ: $°$³Ö!À:’Ì:X‡Aì0H2ì0H€ °Ã É°Ã ìH€’Ì:X‡@ëH^±N -ÉÀ: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’$Ø!’;D`‡H’a‡H"Ö…H"Ø…H’`"‰`"‰`&I‚]˜$‚]˜$ v!’$Ø…H"Ø…H2Åüþ&’$Ú…H"Ú…H"Ú…H’h‡H"Ø…H"Ø…H’`&‰`&‰`&I‚]˜$ v!’v!’$Ø…I"Ø…I"Ø…I’`‡I"Ö…I"Öa’$Ô…I"Ô…I"Ô…I’P‡IêÒ6u˜$™u˜$‚" °C$É°Ã$v˜$À“$ÓD°C$vˆ$™vˆ$ÐN" °C$É°C$v2I`&If& ¬Ã$u˜$™u2I„:DP‡H’Q‡HêI@"É-êPI2êpI@. ¨k2I2  Ã&t²I2ç°Ià6 œÃ&Iœ“LæIÀ2IÆ\È$â\È$â\È$‰s!“ˆs!“ˆsa“$Î…M"Î…MÒ82Iâ\È$â\È$SÌðo2Iâ\È$â2‰02IÂ\È$â\È$â\È$‰sa“ˆsa“ˆsa“$Îa“4Ì…L"Ì…L’06‰06‰06IÂ\Ø$â\Ø$â\Ø$ ta“ta“ta“$Ða“º´ 6I6‰@‡LèI2è°I6  Ã&É Ã&èI2I2  C&tÈ$™tÈ$›Ôa“dÔa“€:lP‡M’Q‡M"Ö!“À:d’Ì:dX‡LëInY‡N’Y‡OëðI`BI¦B ´Ã(v%w%à£Üa”$ÜI(w%à¡$ã.„á.„á.„’„»J„»J„»0JîÂ(îÂ(i¸ ¡$á.„á.„’‰yþJîB(îJ„»JîB(îB(w%w%ànêdvÜa”dÜa”ˆw%ðnê÷.‚w%ð£Þa”dÞa”À;Œx‡Q’y‡Qï0JàFI挒à]ßFã]3JÜÉ(wM( Ú•H[:í4µ8h'£$h'£d ŒÑ¡Ú!”dÚ=½ßüA7M(v%v%À£Øa”dØa”;Œ`‡Q’a‡Q"Ø!”;„’ ; %°¡Ö!”ܲ.”’ »pJ ]8%à.¤’Ì»J^X%/¬’Œ¼°J`^X%@/¬’D½Jà^H%€/¤’L¾JD¾.•}]*IìëR‰à×¥Ñ/¬’D¿n•Ý*iüëRI`H%Ä{H%Ä{H%9ÞC*!ÞëtkRIøJHl%•×"•ä¼VE4ÒZ¬ÒZ¬’œÖÊ*QV‹TB ©$—ð°J(áa•PÂÃ*É%<¬JxJr¨àa•ä -V <¬*xX%¹‚'«$*x}­‚'«d(áÉ*¡†'©$jx’J†ž¬’¨áÉ*‰ž¬’¡†'«„´VRID{’J†hORID{’J"Ú“T’ˆTÃ*€a•d†U±J``X%‚a•ˆ‚H%P0¤’ŒÁJaH%0¤’[þ[ÔJ¬jdQÖJ¼º´–ÐJ¬m' ZɬŒù³»®•X…Êb´kŸËŠVbÍr²†[%V÷Ú¶-¬+¤hŽ¹©k»&mZ‰UÑ®3¬+´Í²?Ì*™m>íºe–}ÓcG¬0bí©M–w«¤¶·µOŽw«ÄÊ7vôe•xåæZÂ*±ÊͱÆq«d^š‚URÛ5«?B+™—›=´>¤_×*«›‰ÒJæÑ(™+÷¶¡Äê¡ö&„¯¡òü %^vm2ˆ %^S5»BB‰—jõÔ&„««Z‹P2/-ãC(ñ"*Ò‚„û²õp†Qbï1ᜎ U{˜³ -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¥“Òf“Ge“ •M•M•M2pT6IpT6I€T6ÉRÙ$RÙ$Ré$H¥“H¥“Rt’y4IRDHŠH’IŠHI]$£ˆ$£ˆ$`‘Œ"’dŒ"’€Q™$P“$S“ŠÊ$DI2DI€(" E$IÅ¢òH`¨<’ŒP<š¶Ð -âIF( E#¡h$¡h$ „J#ÉE# x$$#DE# „J#Ú4’ ¨4’ ¨4’ M# €J# €J#*$Zâ&bhóH2?¥‘?¥‘?¥‘Üò$Ó º¡‘@74’L74èÖ4؆F’Ø&‹´a‘€6,’Œ64¡ ‹¶É"ÉhÃ"mX$  ‹$£ ‹´a‘€6Y$™lX$M `“F’¹&¬¡‘€54’y4H„5°†@’±†@ÖH I& dC l$™l$ ƒ´É Édà l$B›’L6Ȇ@ÙHÙp? þhÃÉlÃmií‰ nd¶aÀ6ô؆>’Ù&}´¡€6ô‘Ì6ô؆?ÛðG2ÛðGÄ6ô؆>’Ù†>ÜÐG€úH†útCnè#™nè#ÐMþpÃItCnè#Ð }ä–nè#™nè#Ð }º¡dº¡@7ôø†>’ø†=à°GöHúˆ‡=à°G2á°G ö„ÃÉ„Ãpñ|a{$#{ÄaÀ8ô‘ 9ô(‡>åÐGæÁäG€âH†âCrG2ãG`âŒCÉŒCq˜#0s$CsÈaŽrˆ#™rG€âCIÃùrx#@o$CoÈ¥mèa §&89¬ ‡6äÐF2äÐF Ú”CÉ”Crx#Po$SoD”Crh#™rh#PNÚCÉCrh#@m$CmÈá@9¼‘D9´(‡6åÐFn)‡6’)‡6åÐF ÚH¦Ú”Crh#‰rX#PkÊadÊ¡ˆrX#Pk$SkÊa@9¬‘L9¬(‡5å°F2å°F Ö”CÉ”CI?jm“€ÚO—1"Ê!Œå$Œ ”›"ìÂöØ=‡œ„‘rF‚rS¸Q® #ä$ŒädŒädŒ “1“1ä$Œ “0”“0”“0’)'×#('_$('_d œ|‘ \߆~.Ðl‘r²E‚rÒE‚r¥'(A9é"A9é"A9×EÆI ÆÉqø"™qø"bºŒCÉŒCqè"@]$C]È¡‹9t‘ 9t ‡/ää‹$Æ¡‹À8t‡.òŠqÒEÆI Æ5]$']d@œt‘@œt‘@œt‘Œ8Ù"8Ù"8Ù"⤋€8Ù"8Ù"âd‹âš-„“-2N¶HN¶HN¶È@8Ù"A8Ù"A¸¸óc|ZršlíºH ®é"N¦„›;½¦æ(øÄÑL8D‡(âE2âE@¢ˆCÉŒCq˜"0S$3SÆaŠˆqˆ"™qˆ"0QÆ!Š$ÆáxÀ8<‡'’‡'ãÒ64ƒe?ÄÉph"M$M¡‰@84‘Ì84'O$'Od@œ<kû¯S¸&2 NšH NšH NšÈ€8i"8i"8i"⤉âä‰âä‰dÆI ÆI ƕȉÆÍÒD2ãfi"0n–&äæ%bÄ€Ü,MÈÍÒD€Ü,M$An–%äfY"@n–%’!7KäfY"@n–%’!77KÆͲD€Ü,K$CnÆmäfY"@n–%’!7Ër€ ÈÍÒD2äfi"ñ^i"@n–&2†ˆ(7Kr³‘L¹y%èBîðyC@n– ’!7Kró$ösg– ’!7Kr³  ‡!’!‡!ä0D9‘ 9 "0AÆIIˆÃíqø! ?$#?Ä¥m´€¸’‡äÐC€zH†zCrè!rè!@n–åfù!™r³üQnnz›¥‡dÈÍÒC€ÜÜô7KÉŒ›¥‡À¸YzŒ›¥‡dÆÍMq³ü7/ñlœ¤ˆùÌ)7/qÜ7K¹EzHFzˆCqMÉ€Cpè!NzHâv|ÃoØ!™oÒC„7ìð†’ñ†ß°CàvHæv|ÃoØ!™oØ!ð ;¾¡‡d¾¡‡À7ôø†2fˆø&1¼!†d¼!†À7Äø†’ù†ßCàbHæ›Äð†Þ0C2Þ0CÀfˆð†’ñ†ßCàbHN€Ã px!px!.m£=üí 8¬‡àÐB2àÐBZ€C É€C px!/$/D€C ph!™ph!-Ä¡…dÄ¡…€8´‡’‡ãðB`^HbZŒC qh!·ŒC ÉŒC qh!0-$S-Ê¡…@9´„9¬0‡æ°B2椅sX!`+$c+Ìa…€9¬Œ9¬0‡æ°B2æ°BÀV˜C ɘC sh!`-daNB˜CɘCs!9 !æ$„æ¦`qÃœ„sB‚s2B‚sSܔ蜓œ“ç$„ œ“œ“œ“’9'—#8'$8'dàœ|à\߆ýq3k$0×t \éùIPN:HPN:HPN:È@9é PÊáƒdÊ]¾ÎÐA€:H†:Crè rè @È¡ƒdÈ¡ƒ9| ‡’ 'Æ¡ƒÀ8t[Æ…’!:” Ì…’9:  Ò…’P6¬ Ø… ’i:ˆx6À $â… òÂÉÌ è… õ°A2õÂ{aƒÀ½ÐA2øÐA"¾“ñtâ;™ Äw‰jàI<‰ ‘À6$òW‰ Cþª }•é«D!}m"Hd¯2A¢D'd(ÑɉLJtA†D(Ñ)¡B'$WèäpD…NHTèä :y Q¡ëÛð‡~4 d(Ñɉ4¨ÑIjtÒ@¢F' $jtÒ@†4H_åDt'dˆîäÝI‰èNHà ò…’ÑìC}¡dø…ýð@ _x ¡ÀÐ@ `h ·ü·¨Ô ÞG¶@¬«”#,K¹¶þl‘âYLw Ä2¹«; ž´•‚b¯î[¬áˆõÙ¥ ¤¶ý2ƒbíæ#X*¹¶?¢%GÓ2°@j{²œ˜p+éh‡Á±ŒumÉÝ©íz¤ãÏr Ä“Üf¯Ø$K_Úluÿ4K_ê„5\±Ʋ/$K_ä̸b©Éðð†Âó KH –ñûÓø$XaÅj b}v7R*ˆ­b™*…­â—"/H,s¨ ^l˜¶PA¼Ä1š ^'™K˜ ö—Ö€7Lû6†‚LKÈìAW˜ Ö¶z&ˆµm¨ù:2Al/Ù1Á±½h7³PA0ÅÉ0ŦòA`)>Hf)>,•JB2JB@)B(EÉ(Åç¥2B ©Œ RŒ@[HqB2HqB)N Å I E ¤(!€TJHæ(JE £(!¤(!€'$@*'disBਔਔ£M ŒJ ŒJ 0*%$0*%$0Ú”¢rB‚¢rB‚¢ÿ?uo׳K²¤åý‚þ}b V«>2³*}Æ,8°½Œˆ1[–…FÍà/õÆfó÷]q_‘QÏZ½íÉB#öŠ®'ߪ¬¬;3#ãŠò¡¢ !Eã BÐ8ˆi@HÕ8€i\ð (äCëÀCŠÖA‡ uÐ!Ò:àªuÀ!Ò:Ø´6¤jpZ‚Ö‡T­Aë CÐ:èªuÐ!htZRµ:­ƒ‘Ö‡T­Aë€CÐ:àªuÀ!hà¤8¤J„Z"’Z'Dä¥u[®ÁBëI©"RµN„HjݶDÙµ.‘—Ô‰I©!’R'Bä%u"DRêDˆ¤Ô yI‘Ô:!"©uBD^Z'¾#µNŒHj‘—Ö‰I­£ ´N”ÈKëD‰¤Ö‰I­Ûs×ÒËO<µZ'H$µÎ!‘—Ò I¥$‚Ò‰T¥Aé DP:(‘ªtP"R: ¤H¤JR$‚Ô‰T©Aê€D:A"Ué DP:(”JäSé‰T¥#’JŒB'Dä%tBD:")t"D^B'D$…NˆH -‘—Ð 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éEªÒŠ t€"( HU:(”R¥ƒ©J)‚ÒeR:±"UèÄŠ s°"è¬HÑ9PtT©J*‚Ò I¡*ò:¡")t(.B'Vä%tbE:¡")tBE^B'T$…N¨H -P‘—Ð I¡*’B'Tä¥tbERéÄŠ¤Òí¹M®J*R”R¥ƒ‘ÔŠT©‘ÔÁ‰ up"UêE:@¤P¤J R)‚ÔAŠT©)‚ÒAŠ u"Uê E:HI H•:@¤®Gïyó½}AêE:@‘ªuÐ"h¸Z.RµN¸R.‚Ô‹©ƒAê E:h‘*uÐ"H´R-R¥Z©ƒAêÀEªÔ AéÀEP:á"Uè`=:x„^¤ -¼B—mHè FªÒAŒ u#HÄH‘:€¤`©©R0‚ÔŒ u#UëFÐ:#HÄH•:ˆI€”`¤*ÀJ0‚ÒŒT¥0‚ÐŒ t#Uè F:ˆ„bäCèFŠÐÁ‹ tð"ºÀEªÌ‹Hæ E9Ñ"UåÀEP9pT\¤ªœpD^‘ƒ©"/‚Êñù£rð"UåàEP9x©¸HU9pT\•©*· Aåvá"¨Ü.\¤ªÜ.f•Û -ߺ ‘*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Ç*$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î~/U q„dúiJO„ÄFoaBbá:¦H«æûf‹³±Y™¿cþUÛ Ø„dºëdyÞü]*8Bò ÿ[uJîøÊ<¼,û2¯ÎoÂ7fëö¾’çMë$»½­¬(‰­®¶[ønc${È{ŽÏælºû,!±ÅÙBRʉ%Bbqö…lÊÓB²½¨ßB²ý",,’ÍVÆ}$[¥È eŸÃ1Abר¾ˆÇX=ÿ>âN{„¤ -) 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ˌ7Ub#òù˜[b%›}BV+ -®Ä&¶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å6¥Êl -r›‚ÜÁ¦T¹ƒM‘ܦ x )Uð@SP<Ð4¥*t -Šç4ʵvØYà¤H^8‘äeI^8)’—N$yYàD’—N–æeitJŠxÊKõTRö TRö@T^²'FeK:%U<¥ªxJª|Jªž•—èA¨¤è¨¤èÁ¨ÑQIуQIÑRy©”Jª^V:‘êe¥“"{T:‘êe¥©^V:)ª—UJ¤zYé$T/ ÕËB'R½ÕD¨^:)ª¥"ÕRAõ€TªêA© {P*È”J•=(dLÙS©²¦‚ì© {`*UöÀT${¢TP=(•ªzP*¨” -ª¥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ôVP=€•ªz+¨À -ª°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õXRõ X^ªÂ’ªÃ’ªÄRT†%Uˆ%UŠå¥z`,©zY -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-Ÿ¼€‚\¶Ÿ÷9V€â[^+@ñ-kË·¾v¼bNÞ;Þ@\Ö†WŒËÚð -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\Ò;ìø×ú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Ï~Ä,wm‘Uz‰9Ì¥8"ÅÐAñ ;ÚSêC;ÅvÊi¦.ã¯,Ùó•>?¸?6ð|»^‹Ó×VÊáiÕ6#¶ø°£?–8¹ø°‰÷¹“Û!òŽ›ËÏóŸÚ–Öÿ=î¾µú˜Ýÿ¶\誺ÄW~ÊýÈC[e¸n§º‹ûÙcòL._l{ß}ý1"!¾wÛטžÝÈÝæ5î춶G›µÛ, ðˆLæÞm§¥7ðbzÑo¶ž¹÷þê7[ÏX ýæë+ƒ¢~³õÌxw›/gL~Ôm¾žñT°Ñm¶ž9=™Îê6[ÏÜ^q/º­¡­ê6_ÐøÂê6_Є%ºÍW4χ¡n³ÏñTÝmë6Û=¦ºÍjwúH‚ûmJDUºm·X†Hô ?ÝQÔ³Û|…äõ¼W·Ù -ÉÜ–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Ô/Ï©(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ò†ƹó>vNßZë«[§ôü@®¶ªÏöòÞn-¢õÖ@vÝk‘ÙìÝ€ùHöp¶Œ'3øzœ“VO=™™sfz–²kS#ü!¨ÂCf´Ó h`øíÆôÑmÍ›k }vÝœi¬¼}4`æ|e6m{× §ÐäÃcXüzΣj×öb*»ÔÛÛõLú½…&{f»—kÍøŒÄ½3+šÎ0óvÓ€ÍU~c—˜G~ž Ÿû{+ØÙC¨î³|ø͉x»·ÇéÑ喌Œö"¹‡;–Js++—aûÿý´ô"Û{U5Ÿ¥ËsEئ½3Ž_ÄúÙï *‰ßÏ2±ùÏšu;,߈nÊÏ©ÌØËúíâkšÛ³-i,´üàù‹í^y÷E¯ÍDf³ÀMFò¸gÈÑ4¿IӇܴ˜©ùoÏ&È·aó/ɉ›ž§cú&s7la/3NÛ,³ºý[0£í¾GŒ™Ûü:Î÷Mæ«ó-Õ 5aJy ”ÓÏ„Ñ’:ª¿P/3ûÏônŸÏé›Ìãâã¿W»ç5s=çËG¿òÌ!gKXÚUe>º÷Ï´z¯Vï¹g*)hýk¹éÌø¨G®jï7|»öŠÕ€¹rÔÄœkÛŸmgz= ?‹+ǶïûveHU.Î}ÿ”cÑ·ïMÕÓêµó¬…óÒµ6®N<¦Œ{gÆõÜ4°Ý|åãòM76SÖüj]»1;ø±¼®ìü±g¹´žÌ Ð [;u­ŒÇGb«¿0:þîFÏGûÙÒ¬‡ð¸¤KÆ1—1>“ˆ\¾Ý½ñǶ3‡Ç¾µ;PbÇhàØW>ý„Ù”·‡³‘±½Õç?kŠ^°y"ŒS+ªfk¶õmw?¸ß.ÄG}¦±ûK·¥Ó1Z¹2eO8ç~HAŽ6é…m2zÄ‚ÞÂuø´é×îƒkÛ»Æ"’¹×uW*Ãx5g°9é˜qëÚg7¨îö.cm$F–-i×Æþ=E íFÛ8eÜî©!pØlȯýèMR{ŸÒÚ}ºÿgˆ„ú9Ï•·”nÞ7ÞwÛ†®½òíR¿òЕ¾›lÃwÌ3îÀDæV¯œ‡Æ…­(÷Á²ipoæ9ââózæ•ge¤^yya¼ÚèëóÖçõ˜=c^ÜÁæÞÜÌÅ·ÓÇ…q‹¢Š~%¿e úlæcÛf¼3{îkJ,4mUßÓÝ5Óbf}km;íF[x\ueË—žï×™î™ßŽ¿Ék¹PM¿Ç”qyS'3kf?#ë Œûu”>”ñF|7óBDG`øëÁÌh]x`Óù:,ÁªíÔ-ú ×eb芮™‡Úõl5|QãæÀ5,4ÉÍÏFÃßp³>c3tËÉg©ÚÅÆ+=\–*7Y¾ˆv{*‡9Þ"n^…Ù…±üÞ|t_õûgA>xÞð™1J&ûßò5’Û‰‹mØŠ2h¡A#ÏÂ(:#dÄ{hGÎåj4~D°vôÁÆ{°ˆˆ\Sùþ׌[œÂjà…®³lTsãffVÐZï“Ùkè¥ÙbR5ÒçþlKç0ÈÃ⎟³î¿üÈ—/'ÿ÷^çßÒÜàôÞsCTŒù>p½˜¹ÓAŸ+ã™oWôüÞÿF»”mHœ­Ã~Ãœ“ odœh´gûó»Ÿ#×2Zßy«gnHbÝýýØÒ¿ø‰”æõùâ?þã¿~'þ¿2ºÕb;_§ÿŸÏ/ãNŸOÚÖIÏm>Ýsõ9CÍ—ùÛÛl±×å:¥ßoY?ÍÃÅ_œ-°xáé‰ÛŸK/;*{®¾íL÷ˆ¿=“û4gàc><É¥µisûtÛ÷ߟüRs>[ 3û dhìc3âQ5¿tZ(õ-s·”=y«¦+W^åçÞÕÆl•ÿ´hY#­št³ÿl+`¿ÖVjx ~úü-æhÜÞ¬ßø‘±Æ˜ß~ûô†¶°¿NëÇhÎ «ÿó<`,~ÐE6´­+{w–ÈÂÕ=Œ?:ÔB æЭºÉ»tܱéô?wG?]wdÁõ¿KÜÇx©>Šuèæ~ÜÇ6bmî/Ä£ÇÌxÆrí1n–n·ýü‡Ÿâ¢ …›ÝñîOûhd—ÑÏüž¬•0:Žá=ótXT¯ðÛÚÕ«ß=Ö_ª¾Q&ÇþT—Nû¼.›dÝíi›£0úi‘±™Ïˆ?õÙ_õóf=þóëˆÁcá0^—ý‘ÛpUù°ð Oµ·‰U³K-ŠÄY»Ôë5|±¬C¿8^è·êIˆ¾ê÷G¼—«ER·è•ÍܪnÌ[ýîYÿüภèõ!o‘æ3¦o|9ó˜‡RºÖp¾6¶xöøàZ¤ÛµÀŒ86‰/N_áe]rø#_#ü•ñ²˜“=Æ’—QhöÑ\–9`¿ÔKÙƒÄðêÊä?èŠÎ±0Íø¸‡Ò š±Çé1>Ùbx[0ªmÈŸ§:cëÿUŠ£Û²ôw®ý?ê˜?ýxx ?ÊOAÇÊÖ…ãÙðG)R7ûiËc\ŸÂåYþä—ŽX ?Öfˆ£_jUqç%ÌxÇjÝçóú¥X3ýsœ›V‘–7Ì øÄçøb-çHÞlø'®Øœ{ gOâcÆ#êö¸Jø.õ‡ýõg‡è3²y¸Û¸ä#º×«íûmÄvÏŸÂ)*¿Ô7öf´=¾sßÒþêO|…ôM=JX«Ò"ËþÄø)žÃCU Œ4¤ñÄî¸~Œ^”âú9nËÏžqg»bõÍ?ònèv¼û£ÇúùîÕ<ížÉÓàr|qC¾„Q*c*qÿÎÃÕï­R<§Aqï[k3~ïáU>4Îkdÿ”ŸÎñvm×1}º¶–Í`©çN÷påû;=¹¿ AähùîÌ?PÏAñý£þùqáGåV8®yRÝÖ²kÜëfŸŒ¹Öçe‹Þ풮篆?إýNv­¢’\y,@4nÌó ù…"§â!¢»=ÄmKÛÇØt¨âÆp`=F­mãˆSGï?:µj ÍNíÜGÝxúgë «c[€ŒW-k}‹ È_%>VxË´k:“÷ó{Æ´ëo~8º,©˜×(4s¶Ñ{±)ÿ±O¾¼~Œ¢|7MZ ›gB$F‹Wê]cêdOñ!ܱšÙZ„…ûóBTqŸ!ºÞ߆"ĬàiX|ÙeÁ½öÏìf=ʸ÷à2›ITì|s; Xl÷f l§ÖS­ûØ°3ÿz,{z ü¡Ô@1/<;àÛ5q($Ë&¶=Ê–x«žOõ/ -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ñ×vëvý8!Yžyf=C|‡ýòÆЭ#R@¿¯=lè¨[úÑ›ü8Yöîüãf#Ýgfáv G¨mh„±_ý(Æ_ÕÀ#xß_{ýü®U?Kˆ;°OéÕNÊ´&VîA9»®e¶¶Mä–{®zàïkïÈå -cçlocócž_ú´^=|a×]пc|'‚¶¢jLJ£ðÌùa´”1íü®3¢ˆÃ¨¥ê%t¬þ¼tÒ2Fg$¿¯=s¯]ú ={4 `V\UÏÙÔ_øÌoIƽZx$ xˆ›9ý°#ƒ†Ëûœ³}gt¶’–y `ýcGœ„qÖöÅ hÝù¾Ö§-õl/p5ÚÚn沫¥'8õ<ô-ÜŽåGw{o7ÆM*|ߌ„™>ó}]kƒ7ûyŒÓHÔ=7x{8¹î=Îmå`9+|ry^=+Us^_daüUçzzõZ é÷©ðnyQŒg™H^f_Ó…q›qÔsä(°?¥Û’‘;ð"„Ÿ×Žè/?êÜv{ôê«pÁÍrÍúãNß!Ú±gÌvH¢#[ü}Õ}]¹GU -·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ÉÒMtÇk±½’ŽXFúUžè÷µm¶b7Ïí§qäéef“>¼¼æãqÕ0µ Ïóîf–†ÃÖÿñXƒ£ý·Ñ%0§GÁC2nyÆ<ð]|øíLfÿù©#u(jK—ûPt”¡}² }4–E£aì“×û¬Qöbä³ñ˜î÷µ{ŸŽy¥§£j ÓÀ2{挡"q\ÙêœèÍÑ8Rx>Ü;Oµã5ê"¦Ä5v|OÏ[¿Fè2ë(ÏŒÇ%q$Pò»üªã[䓾îÙµ/3Çvy§–·üÊ-ãaÜíÜG~Ñž*+0u2cŽ¬Ùµâ𼸺±8ǘޱ#$¥\{aËÎãç#ø§–™MÌÛx§ÓÎË,¹±ìè—îêÚ~…/íW]«¯—Ѹy27åðÇWtW®ìýâç!˃.<ˆu™]…åµ2H;BÉ|VèÛQŒé Œ/ª^Û"ƒZL蚤‹Q9àh`™‘¯†oÁFÜya¼'“´ù èëtá³üåoí[L–‡‚ëÃó½_Z÷óÌWÐz#¸7½ôóŠYqÐFøR`‰¿Ï¹zðÚ´ìM·}s ã%í·½ŒøXçyŽ÷µåÓ°ìåóø0ê3RxÄ¥B Jk'¿q@^}Ì/ ¶3Tí@‹ÑüìcM¹˜¯ç/<_¾y"/¢”ûÕ5åqZ2ßšž5çºmæïûõ½1RC~š=n3Œ×Ûj›´'>ù{îDÝÎ{îjÔߊëÕé81jY¿ü÷óÂÿ_¯= ¼ÓVl=Â0ø@17e«¨^ýûÈ­Òe }üFnüU'ÂZÌ”kͱ»_x®ðnÌÃæ4µûW9ïF| æké¿TøŸÅ¦j·TŒ“ìW/sÙØ™8|l«7cÃlç[r# ‡¹Öâ #øiÕË­¾òZà„/æMK¿;òSÄ*ïœ y'»Ñu:OqîÁ–•ç¡Üq¼Æ<0ÀÈ9‚¹ÿ¼Vž.3Ú–^Æ80pãq¬Õ÷hšÖ<63îVQé¶~ž‘ž£cy £ããÚgµ¶HýFCðx„b>ªüžôœBý 1Œç8îbÄï¹ûÞ×6Nø¦’ì‘!ÝÑ×ÆŸÆûΣ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²%¸‰Ј³ïÙM¹]—ùÛ‡ùˆpŽoüŽ9ùãg¾tuû2×ϲz Š+'ò ûñqŒ˜ò'ZÄ s$}Ÿ„Px»Ð{ï³Ha4àÕôø`äÚ³ò[~Û -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ﱺ¥û@½bç7ÌçTÈ3>OË™Ñ®Ú aÜôÅŒµ5k¿ëwF¯bC{ŒÇ¨dŠS^;h¹Àmé¾²º¿[ -—‚öÚ/õý®¢Ò$sËïh¨o®¨Â½ÞŽŒW˧½îÕÀœ -F?DP·›Àœq´âõ›Ç]FR4pçžHI¿xVÁYsäNËÒ çweDe,Î=$€„¥¹îÆ‹·Z -²é™<̺ã{®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òaz>·Á -1#˜”úZK‹LÛ¥$¥sÙÜó¶E ž€X¦ŽLÆd È«3TŽÒ¾ª“ð$sæJ»ôbËóºÅ2µòy~oöL)@°T‹·ü~€–îVyÄh`}¹‡ -´»™ãÉõ‘^*U:§•þåµ¥]Ës©4X˜-ƒvÏ‘Çs+ý§®œ&GÍ+'û¶ÀÂü¼‘¨ß$uh[yw?ñ{ tbùüQSÏ´‰¼ü<ŒÏk…=çÔ‘ l‹`Ü÷p³Ìq¹¶Ì¸ÿKåâﯠ0¢q–cÏXè“;]“¢ßÀ•›ÛÌ}wn'_ñ˜½hAË%Œç7c}{nÙC“"/q¼óižÌ¿÷sÅ“ÚŸ"ù]Ïó§Q߀í!iÝŽë ®Äàèn¼TIR!ì,9¸°Vï9ð¬Ò…ûjÀëÆê}OÂÇ•IAN~ÿ,V¸ §+3úOÛ¸*‘À¨_7t숈ðõmÑÀ•n]þ$ÏiȺä"ûǬ?wg'ŠAü‡EXÒ;ÉDÏÙ™QÅI8³Ib,FFžY,´Fu&q¸¬:8ÝL òs$@‡k­ÐÇ7Txküá9Ywxv¶÷ÆÙuÕuÀòɼ~~fbÞGõ& -” $×Ö»ë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¹’lÛíÚ|e$‰³?ÖùÊýå…Ñs¢Æ½¦›ÄH¥ZšW£~}ã–ßp#©Ðv±¦5s„ÊûÚçæå媲Sít<䉮];Ú‡›À®Ý3×…üçö§Ò«ïÆhà,ÎTZ<ç;ŽÌ«‘póØq‹Í5 -,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Ñ*†_å -ʃ¢û«ÃŽ¯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†šb4ï ìãT{ -­WߥËÎ ªóYI¤ì±Ì5I‚)!•Ýî´q'`fÍfìḖ.j„ØZnÙ šÄ£—i¥n™¤£tãb1ìV•Ð‚V¡âcZÔøÒèT¨eA »ƒd·ª ÏpÙpÕÌ•Í©…sYƱç…@~öû¤IüðB££“Ö4õyîÞŠÿÈ9J¢ÛÉÐ絜 !wï#NqÑxfî˜Ë[Ì8Š} ¯»Ü1Pü1â*,óó‘’Äð›¦è$©dÙ”GnÅÛ[ -©É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$  Üä-ábá;7p® ˆçB=«Ç ¯Wsƹå7™•ÒŸWgøƒÒŠv³Ú °‡1Ïœ,fB‹:­‚¾xÐÆúnHGêõùNuAÊõп×NÒª±Ê{¬0«ù~‘ý6†¾ÌhV' -Výà(Ã3Îð•»ÑÓjÑõ Î<"ôÀòùáÓGn ΂ˆŽÜ›œ‘ŠéË+ðçÝÀÖrt¡scĨ÷óÜßmÕ¢•y‹õ l ¥©öVk0'FGÏrþ{¯”ËK`}ÐYȼ#ÖÎŒ|¹jè QÞ€o27‘×Gô3ýÅg¤GckC ¬(Æ3·²+Óm_© Ÿ–mÂó$+Žß99¯2BÃ}1Šü㋇k÷væBgÍ<ù8ÈTÛ÷ ë;cv—ñº.¾Úìׇ~FhÔnǃ»Æ¦Ý+¬áŒh4`å°ùfÈibA÷.àHØŒù -{†¿õ¼usÕmj3¦3â<Ã8N&üŒh†²­ ×á4c[ÃXÐÌ£Û³Ôiw§çbU.K\Ä(T€q5ë®r®j­|ö-± @d‹Y‹™ÆP¥Á ê™Ä µäáíû‰µ­Úg®s u'E³½æäÚbÖZ"‚Ï*Dèµò®d[½Œê@â “ZFþž ×±e -Âë'ÝÑ@ÖW·kˆ16 -gF{·3“”œ+çµYe!|¹TÍ:48ãÔí‹Sw3ë=°Öo{Ò—¯ÞHÍ‹¯c“ÃјßIÂQJPœGž…Ä2ðü¦XÉ¥“K4 Â#OðŽ…2%ÓïaÉäÉ RiÆ>ôü\aî=ƒ°¦cK‰‹}‰ÙÖ0T «_8Pè\9[³rÄ¡Z²‡ÉÐbK`FE”¼°<Q¸Õwžq6{lrdÈþ>“¢:J ø>s…{$``Æ›:,¢¬;Å4ç.Ë¢­üΈo˜‰âýü³*æ˜Y9:vKpÈýRpÎ èfuš\Pï -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ç1^çàëÛý¦?ØJW¸gò7™¯ ç] ¤¯NèL_tPt ŒYË»åºn$ƒåg:_çöý |Í;cS¦¸îŒU̪ph#bt©èäeé9®],^LqÌÀ!fË/ã—žG`Ÿ³‚àôúø óÎ]™¹õhœ˜æáÞžQŒ~bÊŽdfLƨDZ=«¨çûϯœu+\¥gºy\o¹ãŸ[W&SNæFYC˜w ƒU:J3 Š¸Y¶ü‹òQ›ïëîJÃÎÙA<Ì®q¿ÉÜg¢¶à\©ÜCðíǨõ¶eb/•VÿMf¤}qœ–‡ cмi¶ý(ì«(}õZRVh•ã¼ïo@ïè< Wç óß0ÏÌa¬Â7Ì7ž;÷ø|ûq#ß¼èøfZ¿þwU`œÐúUŸ[«BekúWñË*0¾{bÁ?Sdüùº•ŸÝŽí²ÆøNm¿ÙñŒl×®äÿWËã­*)à‡}¿ê÷Ô^Ù5ójÌÒȺyfî¡â3žmŸÆàZ¶8^äüT‘O -«Û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Ò4ßëZr¬êvæÛ<Ùà¯êv…¼qºEu;ÏÚLÌeV·Û"Ües¼«Æ¾ñaQ0PJ'ékR©dõi;b ÝJmmG"Š/Û]þ¢ƒßXI¯Ò:³ÖñYexæ«Ö'׶<[exŠQõyýéÓL*Xߣ³.½UÁkqTug±¯Lz|^k©ý8™#©k¡®—9ï`Ïù3K]¿ŒçªaºÌG¦8·Ã²~~odk”é&÷¼>®Ý¢@ØØkÿθêYsC’ì…v2F‘fÇ É&ãRéÚúã&°"¯åXñŒ(ÑÜáfmÁ°lë€Ðvš!%ËÁUYZ¶ìsÅݯ+·¼|7iÙ†¦ŒkWÊlú¢#·¬)E¡”Å¿Êè7àÅ ·ñݵ]¾NÑ¥ŸÆR¡¢š³Pæ¼{±vÝÏ»å¸k§ÄE^»kfŠ¾Ø^õ…Ò\ë ¤ª¯õ…Î o©õ…<BÁym§J}©/TŒµ¾Ð2Û­X³óØ•þ˜¯éöó´jŒì\€2»åÚ-ÜT^»Wy^¹wêñÚ÷V®«/:<”Nœêž~68ïbä%´Ðz­¥'M¹¾¦b»-[oI<>Toz*|yØ‘¥)mT,Æ_s+µ ʵ·Eqª·²âAíÃÎzÓÅÜr=eª3™EŽ²c,3ò¤ÎU¹ÖóùãCð%çїÑ@53 -¬Õ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¡¨Ú@\}ÝÀ#ò×ËÈË[”u)×n)%q© ´Œ÷{t`ž™ëÂZ Øf!ùì}ÇÒã¯9 ~p­¢Xî¬pè´ÅTM—•­ÈÝ6Q³Á ßEG?þÂsx.£Ï ~¶wË@Î ŠåVzÇ?IŠD.Þ#«jN2U[T­xǬNWÝ-S­ ,RTIpM O -|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¹º*$ëÖ”P;HËG^²çJŠ0í°ù^ù1ƒÓ¶\_ÉãyÝù,{îû‡ñ,¥ÓŠyˠ̨r½ÇÄ—¥¯,/F„äŒo«^km9›¢ú2ú\µ­•õ2³›´Ù=ŽmâÊ‚BúK²¡¤ -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ïËê‡ïFuÒ ­ H™X†×k7òÛ|H©³eTPNm2g¿ÕàžQ²G%‹¸%sÈØZE–k3EÍÕò|éetÞ€XÌôV5’!EU6þ¾’w¿®äV-úüàþ·Ùª‘”K°^»“oÃfCZ­FW4€Ù>¬›rö*Vgo@‘"WR΂ZÏ×k§h6óét¸Uà ½ý2÷_¶•If0^ó¡”bÔ„tË•èF4žm±ÇžÛÃÛqMâþÖ‘˜mÒ2Óm1+÷I¦zŠ)ÄK€k`y€ÝÍ$–G:·6rãäÌUÌÝqñôíÔâ„òw§jVHÐ*|}ñM¤âGL‡oNU‹9Ÿ^›x ù- Á+œÙð>Sýýݵ-ö·§0î—¿tûKg[<$~ƒ#–×aTš¼[¥qÂ(Ð#1åiø¸6Èh7f5_…GÒã´$õº‚y:ù²­«B¤¼ðІsO4þ"†W†Ÿ€ƒôë¶Âý¿{Tz4íˆAzEŒß¾3_Gîz*w]µíÕÎjÄáªaV¯5o@L)÷rß(uT] Û~”‚ѯ價õÏŒ¢¼½Ö¹Ö9}ôÍë¤Ë]éï¼"Á•×ݯŠÇót_ûíŠ'‰âõî^?¾Jwïº6Ë׎%‰Ý÷/á× ™cn‚«çËÑ¥ølé·¾¨”Kâ+sʼnF^Î.÷µJ‘îF¼é®†²-š[À¬ý}ÊŸdu³Ô†þèþÿ®J ^ÿ©1­eõ õeñéûŸa/ Ç™¯vxðûA–R~^¼`;ãûMf¹Ô½&òÌLñç¡…?®Ä·Ñv¿¿þôiV8§¥ûÂþåmY/à8ŽbüUOÑÆ®¥Žòˆ3ìOãÈcµ—¹é8°5Ž–l×v æ²r ÑÀ­ogäÙ”Å%Ÿ4€§úet,ž0¯z éLµEìÌæ3ü¦–á,“´{ó©kñÈ[XòŵZ{”qÒ#ÜáëÇð9"‘ñ!*Ñwƒú -×Æ’¬±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Çòú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šÞò¯…æ\HåÚF¶Í²sŸuƒÿuù‡¬Àm'U‹2un&œÃóE¡×‡ÎF-þqÃg±\åóUIKÝÎéÞo›Döù2Ns!óýc#,'üOÛr泎×Õæ}ÆŽ#ý)£^{¤/åùb´7 &ˆŒ¿ê}ú~ý}íNõ/OØÒçwÆVä—ÙËg¨UiÅr³Íµj”K ¼£ò½M©ò[;QzÈ¥¯Ë!<¯!áræˆ,dÇ*Wæ8ë:«ž+-Ý‘Ù!­>`~ ”h;²úž‡ -‘ À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­!ï–(­5=®—ø­\pËè©Èy„e&‘ͽ’Z†Ÿß+é5”3ª¤^ÛÃ{et­6ß³¾Ç\NóoÍ-^˜V\œ´¼Eã‘ÿöÞt9ëÊ}¼þ0ÂŽ(ÀyÆÌ,ý² Û·nÃõ\Ýîèè`@ h¡ ‚–UOÏZkŸœ‰ø´”$¿ª%nfæwÆ=ï½Ôic|–­¼}ÕzcŽ¤¨ž"ƒzß×䧡Qj¨pe„3è+{h,õÀˆƒt4ýxò¬ò¬šÁj™Ùȵ~`$³ìÛÄ«ÔKX°P1þçÁ’\s;1Ýe†.‡n‰QŒ£ëù0†9»Ê¤ý¨U{°LˆÍÄ(Ɉ ·—÷ê~° ‹ @KüBêN8¤YªI|;&L‚÷©k´ EŒÁ˜Ê:æP‚qºÏ ò<Ì3;#ºá¬ÌÈCê=œø½Åc³iJœ˜™NŒš‘ì¸ÑMci#±ÞsÖMŸMrˆhuÎ3"›«ÕŒäÚ¤=iÍI«‘½‘í¢‡yœÀ¹Æ¹ìÇ®çYjV3-˜JEgúl¬‰*,7ðcƒ‰¦Ÿ+Û7êôÙÁ!À¦ˆÝCbkpsâ<€ß®«Î«ye^f_«BL)¬ÄãÍ|þlÛÖ|…áÄá['›!T¯Êìz6– ËÑM­ÑùÆÄÈɳmÕV‘œQ»©ÄnRñ4!·c{î48è ]ShI_‰Õ3èâà†´gQ<`ΞNÙÞKb9ºc' ë…Ä ëÐÄVÑTxfÉÔª -댋¨Æ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Œ¾M5($±¶¹0bAmi9yvTÛ〯ǂ²&Oˆ•ý:É…é³(ˆÖEgXX?n'±^¥êrxÖ©›B7í‰1#òÀÔäo;V¡¡õcS÷q2…)¹æc´¹¶( †k_‰ucϺáYH®Úr ¶¤¹gk YÀ¨7¤Ç#&¢3ŸtjT¶CÖÏÔü„-Uø{’]E*$´‚p•fF^ ˜Ur£¤­+UD^««y­¾­§¤½ö[…ÎŽ,\–Ìò -¦Å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@vôÓâÐx~WJð"WÙךû!…ìÁˆz–C…Ÿ™<ËN»38#òlÔŒä¡p ¬Ò •Œ¹JÕ[— ¶|÷µ½{2ð é*ÖÇËb0bͤš;¥¡C}3@ ¤T«àq¶.iC6bÝD?8è†g§D˪ISpBÕÅÄhdítT4öÁL MýСp|6ZÿDµG5xFÓÕÙ¾Z•ëÙOŠx¸G¥}¼µõ~Bœšòh6 ¯ÇŒÝÑÀ@?ì88kc¤0Kn>ÛÕP?ÛX"d¯:Ñ‘X§`ùU“gÇ…•‡Ü »r-ëXûakÁY?t¼YKc· šõW?0’«¥8²¨‰M‰¦Þ2ófö'.ŽçôÙA­™XµâÔžGk¢jÓÌ ÒPžZ‰Ã\õc ώ鄽üþš‚F0ZÀ)ªØHdsÅ°Y¹Ö SˆÃøV®õ $ÖËÜXîëäÙá2cÝT8'S˜’{‹YûzÈ»‘ ¨c$V†Ê&ógƒ °H¬Ù z'ÄaÅûæÏÚÊâ«–@?#RYìÜI¦™$€˜÷棬þ¬‘p+õ#¹nB¨i7Ó 6šó˵¿‹g›Zá1ñQDÜ¥˜Æ¬â‘\«_R£ž)3?ãŒ8ú$gäê¿D^sîFç§ý„ÏÄŠôåf¨|Q¥Ô²TÝ®ÆF"Ì_WoF®5+±êKFqlk¢öÌŒb‹¶ú[†gÇ°r*šXô‘Çãœ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“€*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ì`¯Úû~¶^þ^~¶-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ç\ï-¾½Å·­¹·øößÞâÛ[|{‹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üç);·ªÏ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 <>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{ô§¤P(.GçÝ¡?ömÊŸËû¾iÏòqŽ±|èÈcd>ºtÜ5©-„tcË_Äàs!¸ãì\(/¹þ-ÿÛµý¡+¿—¼N_p)êWz×÷x!7Ù~¸ïwr}Æ¥Ž„6·åWÊ£Ñ7õ¥à}!¥ãж‡e¹q™³Iø†?N‘jzßáì0@žt¡<Ñu…Ž»Pÿî¼¼ç\Ê"u|)ûÞáW\rø®?n»äAhÿš>ãP¦™1ß²}Á•¯–]p]X\&òa{ÜÅ6“Ðv­s›oCùl™o›Ú®<ãÊæBYæ.—Le+cùZÙµ¾/[pxòÈ6Ÿ¼.G„²åàVüûÁ‘se©Êà0ÏÔG,—¸¬Oæöd®¶óÂŽ7eL ¤”s,£<òXcœ˜ÎqäË~ÄÀÃÔ¥&õ‡xÆ»ˆE,ç,µzÏ—m 8`M×wZ½P^ë8mþlçcÙÍrh0¼S>ìbYñr®rùw*ëŸËna¥±Ý w}y¡å”5,kçËyâÒ•±• ø&â…²¹åGÊȺÜèà·)à•ásŒGùاT6É÷6Ÿî¸%!¸ã®m6Kkw~°±eXWßâ´eÔ<¿å–”+{X.GÛb51 ž¿d©<ÓçòLYï.¦mÊm/Ã+·Ñ‹ ëçË2õ½dðKþ¸é|²¯”wÊçy”\Û¶Z†Ðãü•ìc_Nh¹(-¾[ŽRë˹++XØJÆ:äÞqt¼;)ã„xG.QÓ—>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\ô]©è!EY,ß)"B{K<ÞPš\j[¤é”#Ö–Áübê{¬K..3å8tÃòòTˆû‘ç:5 h¨Ü, º0†¾,_ -©ƒ|/·¥Ë>Ì¡V‹¡Ü-|Cúp!„6ñ•ÂäôHr¾=,…÷N›æ\aå:ÛÖ2/ Ö—e  ©l]9»ÅÒÁ*:K[* MòX©¢Ö•±•ïZò ÊQà òMn’fš¥Ö”©v8/Ðk¼ç—œT§»¥ãw\ë:¼íõkeÉß+–ã‚úã>ñÀ•Õ5t&Z 8Ÿ]#=»9yžÏ,­¥Ò$U¬ÌKjy ù¶*¦z¯¬Z-JO,â£É‘ï¥ì£/÷ÂG ô8†'°òœ‹^´àÊœÂLÈä‹Tîp©¾7¶t M ¢äãPè½rrd^”=×÷}„Y†/5·Å§Fk`K•_-¯e¸0u¾æ$Û -»Äê—¥³%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Ž'lÁChÿEb‚é”ÓY¦ê |=µØºŒCBK=Û¹ 0EV*S›èaÌ{,‰Tª,å%W'RƱ‡h–%\Ž Å}‚ŸB¦±Çõ9¬6ƒƒqéq;1äÜy~£\P©´ùŠ™BŠ´Ú -'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ð¾-·¾WN|Ùß.–£‹?gjN`ú…Ÿ§rûÇêaYëòç.ùd®…®²ò+t‰¹–M-?ÖuÔÃ1ÅxÔÑÏ•‘÷©¬}¹Œ< ¯©Û”E -RcàÒàçˈ2¤ÔõØP*³Ö……R_äGFUžç´ï…õöüo.ø{YþV¹«¸ßØØDAV–¶÷™ 7Ð7@w ¼‚eÓ™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‡·é ƒÆôd5®)/[‚L¤ñŽþwXŽâ!E1‚xöÙsyÀ{ -û+”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^ŽšgÑq¤Z–ÃSÄСcÀÊ3LÙ$†3‰Vx©_» ƒ”)‹°€yvªLûŠÃ‡•ã%šÌÑš›ªôháðpBxPI(šzr ydÓÃã Ïg#=½óŽ ˜ÎÐV‚‚ÎÄb}”…h;ó~’1À©ÜI$3z3›6‘=H…D»IŠBGm¾5žI3,0öäcÓAÁ(™ÿδѺs]ïÌ°q´b°ÁÉÉ »ÏDÞjoß猲8Hs¢u!e–º®ßæ¼î;0ÀXíO˜›åÐ#Θ‹åväžàÕM–”W¤.ò€Ù3…+á :ÎA ]ƒ-W")ÊWö·ü»UKlx¢Yæah8;ôáT6/¬Ê¬Å¡E_q6_1/¯ƒØnÄÝs›¹ôÃ]ƒR.ªœ‚TàT¨:(tI(ùIÞŒH7ÛCoÞkª^¼òÔßáxº>x¨ž>ò\¥ÿyPÃ.?þ_¿øõ«Ûo.}wÿÇ›?Ý{øåÝ»·ßþåööꗌϹð×?¼hbS¸_SL±r‡›ðÛfþNS8X9+ù7—ãÄ7þ+ߤxð¢pß>ÿ¦i^¼üUù©YÉ‹—c¾ó’C¸xõãA’È‹—_”&ƒgÌèÕAKïKà€„ 09«Ãü$jì8[ôQ#8Òa¿¸ñ§ -¢§®A …ñ“²;…7Q Anüt¸W0´q3`Exé"ç¸ôçâlAN•ír¢³ˆ˜% %üá¦pP§rprfÞjT‰ð'Ìë^n6ø†‡£À‰'3…*œˆ€;&00_"+³ÂB;àíøí,¶%קÜ:¨?1ãš2ðZÞå ¨8w yH4Á¬ÿ_þö; g+o åßZt|HAH–‰qÅgÁý#MW2ÖùÈHÇc£˜Ç²~ô:H~#ñ ^ÏI{ROÇPHnC_iÓWËÂhÚ¨¨‡q*æ]4tÁ0fg¯ÂûÈWy‘ÌòÛ}Ë3º²üúIýÉ.Ë[í þí7û.˜KÚ¨—I*KÆYâLr-¤ËÍÉ™¬o‘Ò¯A0«æÁïi,9*x!¯EëdîC=¤¦úà¹S{»†Z«±´5Xh…mp^ÌÏj±e’0m¦P¢…èÏhÂo&QABd‘/* -ngîêÈ ´^;J±ÇÜè†-ïÖXH‹A¶SÒº w°Åb ú–eœ¹Áeœ˜…yBIÓ„.ë)ÈúSÒB#¿¤A¡ -§<ÓPtxà÷Àòô­ØÉ­”2sI -ÅyyKsVþB£D¨³Š\‘ÔYÔö†¦“lX -Épi|;yŠËGoz”–Tqþ$G!1%z*}dÔ{•µ'ï¢vUN¸×¨ðTàè¼/¢5Ü)10—ÆNV×´òžÊ#×­È/…^ù¼…:¯0÷T'ÙóÄ ˜X߃c”Þ‚³åïºÈ¤®®]úVy :É#¿Ê––HùÚ·ü½ºÂôäÅN®Y…Eù˜÷ü|åÈp×âV’¿¥¨÷üÔà¨'-ÈÍKÇÓ)U˜¾·t Æ"øTl©ÔÈ{aÏXŽFßV#=  årsê·h·J$G3wz‘'”8ôž–ŸœŽÅ Ó•yìCäi-=ªÁ^+f¥fh|§P2.}¹bÉ 46c*õöž^4yPNî“œ¬:B .!¹]kl 4rß,QBB£D§Ö²¸[Ô”ûÉŸsZ(úصNõ•28ó*-H•tÌ;Ó8½æ,^褜òn²}p‰+ÅNké»Z̤X¦Ë±Î¥‡) ZƒÈüéŒæ1Qxoz:m, €gCs§M= YÑñ[…ÖÇVÁÒ`âZÙëÕ38}Æ·9ÔoÅ&Ê7¨Ø²H)h˜öF!ÛxPÝÓ,KÏX„|Å­9åx;;ØÊ“Ç=uv`¨Cè½ì4,ÇÊ ¦˜² ËL©Y5 bϯ{fÑ™pövŽ“ÒqcP@’ž -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ÑàÔ;Ê0š1_I£1#*›››ÒŒÁ‰lI'¤0܇óÜ)jé{K^ÇS]òö­šÐåü‡ÏÓ)-«“” =ŒIW˜Û–M!ѧ˜Éó\F<ÓLÑPË!WN'M{=c -(}¿ìŒ›¼‡"ç8i Ä@;pâÈÊ·•¡ˆ|¶ mZDÖð›ÔÊš%MKˆÄ•úœì•ú.u’¤¯ …éé( 4¦ï³T¿¦u¾·OÉõ>há88Y‹%•ãHõ$^‘zãI yùZ$ðuxûä,ç)7¤ÙŽEÚÝnm Ã!cøÝpÏäMŒjËPÎÞ¬_—ešì š*ÛeѪO‰‰fo©Äêm0sD‘5^byzf3Ö;Ûš½ Æ®VzE¯Ì -öÝzÆnô{f -÷œ¬ì´¬=£¢É%=Üh9›Ÿ‘¥ÓG|òˆ,ý×¢Éó@wìã^†×¦w:¯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éµåd™9Ðu–RŽ$-sío%y‡‰ï:••*)µ± Õ>©Š”Á‚£]©óÅžÓj]·º,*`QVF¾ù¡'åIŬY–IsT¢¸ñpÖÁ"ú“«Ÿìɪà3v-+±ouJ>ïº~ð“Ê;̯¡Y÷V_ÃÒeP²Ë6ë¦ú\åc ðrÚžÕ€z;àhÒ솧TºqÍ$í:+»Ý+U¿º7aÊ…LOß*WLµ AiSHŠ±‘¶ÑL!t’Z&÷ž%#?LŒªÎédeÅÈswM;>S=™â•±æNiVfD½>k•U#‹F_ ÔШ礪”hnJjÂÆï(b¨¼FÛŽ9ñTT»çø]ÓJ©<…¡Ç(Òf™»Å;rÕ iig›·\¦«„°lî–Å Ù†íigõp}}ª\77&àÒæn;EKjhA)Ü5Ä“^á¬8på®É -ϸ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%‹Ê@‰ý$‹@ï…Þ‘¼4÷: ºã•Ö,XO›•­ÕÉA¿]/ÆÃ|U}¿\[Ýs¥w*‚fÙ/¤ô -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¥³æt2-5? Ó_¥îNj={üs­*þZ)ºTgVWðÏÎî&Ò}=A6©C9И®`.5i`Õ„ì•5χûTU#©„Ô›)ÃlzÃÜ`žÂس›oƇjÃ¥0Ɉt©ªÅŠð‡¡LÐ" \ƒ`®2Ò\”òç-D]DNÇ3g›”,Û-ZN0iQÖAlªzÔYVí Í‰Ca¢³…VšeüˆHˆ0”¬Ùø~ÒÓ Å'ÓŒ%ô;K(¦ÇÙ·œ3Ð’2†ƒ%E§³O˜´Âmc:0\‰ÑM¬~I×j&™u…O[fµÂ –¥1u H¥Ã±‰ƒƒ¢¡ÑÌSRÆÞŒúÉÄeQóäf–ÿµ‘œ‘,}㡃À\£É²[(%Ì5:STNyîóso>Å·‡»”¯cØõš´¤ÍC±{œ¸‡ÿ8@Üj¡4/oœ4YùË‘œ -%[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“¯¦Ö’³§*}Kí$@k;½©<.…‚(výÙAK¨`YRzÒ©‘R¯FtÈ6M–'Ò9¼î‡ç-b䤷ó A 2ðzw•QbØ2K®¡B¯ÆnGÉgÙyÈ3]ªœ¡g5°ê¡èK\¼;“åÇT~ÙXëKfå¶åç²—©nUYHÍFžý"ü˜CC9cüËÅÙáXœÉ[Ž<:A‰GË„*Ö…&™Þb¹4i5L‹hû+GñéF·~ü”ñ‡¡f4чzõ½13É%}«Ÿœ¾GßÓüÝð­Ö˜öÚFF>¥e‰Â48 ƒŠÆù=çíZ%ò&õ™å3Ö ÊפH8g!¥Äš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…Ñô±«©Ôáj&?¾€¬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×àèÍ86±Ž¨k`p´Ä+€p´«k pª Ù ǘá -8c»âTüÇ„ý -P½¹„Å‘:µǾ·€Æ±ïíŽc/î£×äØ›+ rL Ý$Ç~r“cÄPŽQw‡Ê±wË©{7‡Ë™Sw̱²€Ì1ê -ГÒsØœJÜ8§ -ýÝ¡sL—Y€ç˜è^Ÿco®Ð1¡¿€Ð1>Ñ1¶3ŒŽi‡»é˜Bº€Ò©jêÎ`:zqw8cú @ª€ì ©cšÆ -P ¼%¬ŽQÀ:F]@ëu¸ŽÞ\Âëuw€½¸„Ø1êdǨ+`vôæ ÓJP;F]€íTênGÔ5€;¦ê- wD]ºc -àvGÔ5À;zs ôŽÞ\€ï˜>¹;üŽé“ £. xlváÑ‹K£®âÑ›K(³V€ñØ_Àñu )ÕsH#®å©÷|Ëclcg`½·„æX Ä -Î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›, ‡Œº2ê¼»°™E+ˆÌ@[@™+f‘q§ ‘ùbVÙiZ@ žŒV—éé`D&pDF]HTßœC™å¾”ÈVj,‘­ü˜ÈL÷ÐDzs 8Ñ]̵EfW/ Šªy¼+H‘4£50E¦•ÍŠLÅÛªÈ4ÆX‘¨kàŠÌX-¨CyéZÐ"3v‡-2M}wà"[õÐE¶Ó+À‹Ìç±¾È|/s#S¤W@Uµ|bdGw£ú¹9‘}nw(#{q˜‘‰ÝpFU`ïhTÝs;CÙO.@Œº€5ªZÆîÀFuSw‡6²]]€Õ½ÞÞÈŽðàȨ»Cé.-AŽŒºæÈîæ - #{su$ê -°#½¸îÈ~rx$êò¨Rw=2À -Ø#½¹>2ê -è£êÎØüȤëþÈDç -$½¹ÉW $Q—0HF!q’Dî ɨ+àÌ3·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]Cu õØFþþ ʨ ˆ¨å¶i$®€‰šüü*ªjõسã$BFUê4ê±g§_YBGUê<ʨ+à£ôæ@JÔ%„”Q RF]ÀHÕ/Ì ×gw‡’Ò› 0)mÁNʨ @)£î)eû¼•²Ï-`¥Œ:–ªÄ9´”QàRF]ÀKŸ™L-ˆ1eÔ SÆEv‡™ú¡#üÔ”Q`Sv|WÀM‰E®œÒ›KÈ)£®Ò›KØ)£î<¥%Y@OUâ|JÔðSõîï@egeU=µ»ƒPéj¬¡Ò›»Q™Z°€¢ªãØŒªjs8*ûÜ -@*ûÞ’ʨáQê–Ê~{0•½¹€¦2Ꜫþöžª.î ªÎiQeû·€È0ê¦Ê¨+€ªìÍT•)~þµ÷UÕ7‡«ª#Þ°ª*¢3È*#ê ÷“%][UÇ»3p•b]5,%õâ -^eÔðUv*V•:‡°²3¸ÄÊÞÜÆÊ„öȪRw‡²2]g˜UÕ’æpV¦u-­*ui5(VÓ5´ï{keÄÀV¦0, ­Œº·ªÏÎá­Lr­¸ªÂrqe‚urU©s˜+‰ô%ÐU¥òÉIŒp Ø•½·€»2ÕdxeÔW¦š,@¯Œº;ìUÕæÀWF]@_Ù w¿Ò‹Kø+£î€eÚã˨»ƒ`Ù¾-`°¦çen¤<„²·#V=Ós8,Q—€XF]@bÕ?”}a±³K§ë«RçðX?dV| ’õ£:À(kïâ]ºx?cçÖè™n|•v%î sìÑmœ¡œ½øõ¸æåon^}ýýõ7·Wüs|ùåÅß.oŒò‹/¯Þ]þöêö»‹»_Nì+Z»ï+öTÜÀž‚÷øù¿=|ß ò3ó€ÒÿIè”õ†VqÒë4Ãj -;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{g¹^ß©8ÍuC·Äv&h|¨.íËï@´±ÇháDÇLkØõš-þ‚RšÐ)‹Þ“®%F_sòujÌŒ…Lnì‚Z–ûZþß¡Z‰°·Àª`|ßX -ÚêR;íQXÆN€=Ò¢f™Ø‰ÁjŠÿ²+±±\^Õ –³³<»S'J&´Y0l ’6X/œ<æœrm*V%Ó «£©mU”]~/Vm»C©Ëu]8åK­zi¤o°À¾9¶٣؛QRÆ`- “ú+•“æä‰À¢¯¤:Õò{ †d|*"3²Å´·ßX5ÀÕ þ(6¨ñwü½$0½£€ZVfÏ j ý(xz¡ø¸ù,q|ˆ]vBmæÛÖ\—ý¤Ø¤™„õžVñìx+x±li±7—3ú -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îòv’±rL¤håÃìmœ`ftöúípîYb…‹=‰qÿ߃#‘QfL¯VÌLf¨*ƒýÎUÎ/ )FBÕæ ´×Á‡o°,K4œ¯•¡3=ByäÈ+f -t½¼©ZLEó_¬\èLÃLð6tÑø–ÒiR¶fDhõ&J¨]ÝéV+.¾¥b~,5S»Ê9SõùÅ‹ÀÉ„ÌKNÁÔ -·0™³¼JýŽ-Ô¢ª8O23ÓðóN<ûz˜“]| „ÐÓ“ºc©nLW…¹›ZšâóìäÇ[Ðì)2…‡–›’Й¶lkHÇBpÉA¬|ŽÝÚ³WVHá±rS§>ð©³ü±×ðš 0Ó:¸ð%ÉUì²Ð /RâZØÁ#‚Œ5z—:ëP&ä„ qÄhVL#¢i°üì‡ðüàÿ9øåü?Œ&ûΔ®r^¤o•cN¥ Ò4C#£dkD¬ S•®)DÌÅÐÙæÇ–9aål{­/3Qî!Ân<4*³µ³ñ¾¢É`SÙ㙼”/QKzrðõ‡¸Ã?|m¸çT¿õx ]•Úµ¿»påwÖB½L n%}Q²ÊFµµä¬í©Õ&åmS›¾|˜YDXÕ­îTBÿß2‹ämð”n 6tÇjp‚Jf‰õíëÅ>(¥YMŒµbNN–y£É"[\uëŠ+éø ‰jmDiÃÛu}œ4uQ‡—‰jPƒæÉÉ`y!–ÍiûAF‚îÇrS7*ȸ):ÚihKÀ«}N+׬ U€·Y™Øç1:p›øÊZó’0Êia¢ót( ¡ßA^’)àhWÖ”R-l"½é¼ÜeaùC-??6Ç@š³=Ñ1~Èc¢º\ÊYH”üÁ¦áÔ·î°a|Ð ¥¯ˆ8Ô€C¶F ½5 äÙU$¸sÁÁF'÷¬®lߊð–KO -ÉÀá‚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< ÐÛ½±VxÖÖÃÙõwÁ -&œ‹óƒ·âÀÁ´ „oÑ"÷¾±f8°Š!ÿX¤Œ)öÖ 8°k¢™Gk«Œ?˜&THeëc4¹Ñ%áUÃÞ‰lÿ£@Æà[;˜ÍQG3|3g¼­ï‰ ¨“FÚ»l{ yWƒ<}íùŽ;¨tÙ´=_5·®á‘Ç}2å®m­L¶a–SÛ§®ÿáåä‹3:d~À%E àPð Òɵ.Ý‹U -¦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À\-Ö,«ŸžÖx+O­)8i—XqBq²ª•&0׆; -öÐpMд™`æl[àD@¢_`©:;—s™£…×Ë΢3Sð‡ÉÒè Xá ¶P.Ïkd£À¾ò.ºƒ>Ò3!†ð™à9ÈÒƒ -Ä ÏXoSë¸6¦)ç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ÙŸÁÔekò,áñä ·FŽñ2|ÂUgœÓ.Y:6a=Êñ‘ÿ«³_žÅHåŸ:ˆAÖÒCv—ˆ~˜å™%Ò:µë¯àLwôÖÌðä€HTšA'dk@ö*(¤bàÚã -^\,î@+ )%ñ.±‡db.P·ëéçK,€kX´ -ø‡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+ŠHj%Á±è»±œeõB÷}'¼¬”0_”¶Ø–…säêAð0Ø ­vÇlÙëÐñå h3NS¸£ áòP±ýH.@(Q„£QF -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­¦ÇÁÙ þêÖ¶9l[‰gært4 ºl ­àAS°¤é6«£!žuÞüÄ-ml„XVƒ4$8/qY§’zeæþX=ßÁëq¶²µ§‰ ¨—‹š‰!·òuýáÈ]­%j…¯Ž°«ê|²X{njá¯=˜ Àd9ëM€zŸå“¦ ÊV­…/#Ýá¸Îl‡8ôhTÚÅ T2ôÑXe+–ÉÂÌ…ˆ„ù*©ÐÑW§1÷Ìì¥×FÙâ8®ŽA!©Vf0ÆR´)…QÉÎ<+É«epy/'I(…õ¸aµ:Oü£5]:{Ùôˆ~Dë„'¼·­éº  /xhíR+gû9ÈeÝõQ/’9e± ‰OuÝ@’LRÀˆ1²NçŠE`³þdmMŒÅžTè.Dk…F×_à -]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ž0V5äßµ0í#¡O”$ZðÊ)„q}ˆ±c®¶±°On¹7x¢o4¼2ษ}µ¶9ìÅ‚ð.F•˜&/¢>3!KZâeÀê£reˆN -™_Øä‘“À Èë)";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™“Kf:gº) LGšúO€»NCH*nNÙšŽùPþ43Z€¥yÖýwLˆÊJËé•çÓXH¦¼¥„UæýÁžN,[q”°ÔŠª¶È ’2oðZ¶äb\s"×Æh5I½š©vè¬öëäHÆ)”^–£Ö™°´8ïå¬[/|J¦h·MíããtfÀ)•…Ó„ÃFU¿7ÞiIІÕò‡ö“%$¨LĤaùP'±bIMV²@‚Š; û 0–â‡ÔULÕþRj,¦…cÅÉwPé˜iL -®¥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…Áåh=c°:SÐÀ(1kB›Ë><™ªR7˜=ÈJCÞ¤‚ l9¸û,ï[9(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”±’Ñ™‚_Ò1Kr/µ½KH„G -hÎ8+~½KêÆÙ´i¾êCǬ:™Çð%”oXè¬à|?á“ ´u†ÍСMBßÉ»îÕK¿Õ[,µ³ƒƒó_-µ¹o"Áéo‚š™ ª×å ™6ÌÅh¡Ô3¹ :A”CÔµ’ðçŸRpéÄnzÕ }ÏÿÄS0Â$1•¤ÂB•Â@t$ÈêÆäT)zM™^ ÑË„"Çû¨Æ0¦±Plïëøï(°o±¸¿ó\ª?šdãçY6ÍSM‡²øI’x­^+…WÊàUx•ü]'}×ÊÞu’÷)r÷½Rw­Ì]+q×ÉÛuÒöi²ö)’ö rvw)»Fƾ_¾W¾®‘®kdëÎ’uw¹ú©ú~™º»D]!OWIÓÝeé -Iú9ºJŠ®’¡«$èfž»…½ú÷HÅ#†“a«} ¾Û5ȺBD1rPÏ.Tù«€¨ø ²*À+ s–@@ô}ùÛèäˆY˜.{¡ö$ëµqÞ.Ÿ#òWÇG‡"!6ì Å]9áK856:Å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Ñ8–¨ òÞÉÌêPµr@ÚÁÄ+¤Ë‡½5&wD  QÞMjÛdäétÖ*ŽI‡}°F§.°U>¾Âª5zêì%E5 =ìY´ÌàJnzK?fQÏUc=¾—êöÙ·–•… ‡5À`Šµ8,¯ Dg™p`|H&f×}ˆ7¸•{h}Qµ­Ö{RÄÚ 2Zó3ˆÔ†ìTŒ0å’¹LãäÅMÍ,S»ù^T‘ZA1÷£µþߺ‚ó÷Àãjut¯þÈØm¢÷èÒÓó8fζ x‡(HïYÖ™=WÎ0üÍë Š‘o°c$U8ža6tPÆnÏLþ ~Ñd½Ñ%3BYFWFAÃ~à"½¡}ð‹½mÉAÅ°¼VQ@ °˜™’‘˜eO`1ô¬ãA¼¹Ø1Øo$É­^úf1/”µ,È5o¬©}¦…5¦æ"rÔ;÷5YØYôbcBö2{©A¼a¹Cú'Ô§p²¦@ †g?s®šN–c½0'ªÐà!qB9=¾àøu)‘9)4•DÀö`/m’ ’wc£Û°(õï°.tsIyöd˵ˆõDÊ £d^© §$u ºA ù–Š¥¢rz@`ûOhAA"¬±(8ña‘2Ý)¶Ô40T‹jìy€åèÛõ–Š©Å€ôïUÅ'ä ˆ| ¢È¸€±JBÛ‘@óë„n¶š±Ýê•{>ÊpT!(¬Ò"£Ò‘ÀΓ,Œo‡9©zëRàTÚ²äžÖío­QXÇ— ¯$SÖu:œ}°tìÏ&ôÌ^ÕÔ'Œ›èPÙ=usÔ%²ºŠ j#BX¢<±‘Vþz8Úl·TŠ• æ™Å¨j ¼”UÂÏa㤛$<Þa}°=ÈSVÀD£rµ>Ä–¯+ÚÇ&@P!´¹Ph÷ÃúÔ âH@<4 Ròs MùÆ‚ŠuOœ©%˜3/\¸V²]ߪrÞÔ?/;êAG}Ë©´Ö%³áqI®—ÚNþ%÷¹¥À'¶…ÅAXzòX÷rI¡€‘‹ós(dµS\Ô–Ê(+g˜RR´sÂÑžæH!­¡uúŒZ.æŠN!|¦miæÒ6ud3`Ò²ˆì,ö¾üÎ"‹”ÀN¶dìl&N~ЩAD=õà<±¥öÄB{áB zWiÏ uУâ%ô•!´‘ç•u¼þ¡cÈNRœ¥„#¾©_’ôË5[ #ÃÄ@È'SmmÁ—ʆðõ¡þÔñObdlŒå)Œj«½Ç äUC¡f-P9X¤N9ë_§—TFîÕËM®m2y';IŠÄfNà™ÑHʽڈdRâ‹Bˆ&à’XyFvd‡@©p©ÉûŠ±©G‹X&Ð¨å‚ ‚Ô³7hý4J C¾Ãö Êå‹Ð¢‹  -B+Û#Zb=je#ͦ8¢N)šè>B…«µcT÷GáÜ4Î\…åŠ! ÿ/p¹i½ZSÒ¡%U`ªô ôn ý?súAÖ œµš./´7‰ÂîZ‘!lìŠÐTeN¨ü¾Ó)DÛ[:ŠÜ¡}¢b'™µó}T2±ëÅ0ú¬„mgíGʺÅس—Gˆ¹"–V4ìïk *…—ò¦´h©e*A‹Šdj™ˆÐÞŒÝ.*43û|xü˜†±Qž¿ÖÃàcWNOI‚|a/5õãI}€ ð‰‡&¡–qte¸}ª{½¡)‡Öt% -ª$&¶€” h@'îy%H ü×N±¬‘¤2niÊÔíN±°BAÆwÃã¡(ä@õok‰ekê¤:°:ÛÁý>¡ûv¤ÜµÖuµv -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 kD5k´òrz<ÁÎ0t²Ñ¤FoLÜ#¬ñÿ³÷%ŒMÙÖßð$HbÓû’2`0°“…ì²,°‚$gy¿þ«sέîÖ.g™Þ¼a UÝÕU]uë®çÀ…–šWXåÍš¢×24¡'Iq¡bOæt=à%¢²Â[Yµ—NÍI Ê+(\Ä•œ^,o ß‘E›\‰ Ç€‰a*c$³è•‰¼’FõO%‘¡cyÓÝ¥ÀJ=ù$¾*@Ò3Ó5)Œ&ÖÄnI$öÀLùña`²1$$²ž6Ñ?sÜtr±3Fv±çÄth¥4Wi)%¤£D–ß>³ãøKnne"2ÐÁmË|:hk¥¾Æ>°›è£ÀšË@0 ”XG$:¾x#2D)P˜+)HâNádBNœ¼ÒNI¤K;5‹ W* šdRXUM‘«’²”+~ŸÑ%ÄÿpE\ߌ7Å„¾*ý¿sù!¼þ“Éž‰y¤èBœ[â#Âhvx¾J-f˜Ò])•è†¸\ì¯P gsHuEÔœb®4É -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˜Ù´¹¶Ã(¶Š•èÂa*·z?ÊD|ñ -—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*—&óxUDÒÝ•¶™@ˆ$£b]V„½èˆ!Ú3zª ¶8 -1NgDꨜd…!iZ±yH  ÓáC[µQy˜ÑEûMŒ¡4NUà•r+_¯—kÈDzA„!tøjO‚²°Ê6×\dr¦«† 21i ø©9K=·s&ŠéJÀ5ž¼‚µ Ÿ£°Ž8Õù -š%“ ˆ)Ÿ ©”Ä~àáÛŠÐØu‘xÄ|®ª‚“ö€`‹Â°XkŠŠ¥å@AÔ¹7Œ€=U ƒ'qK¨Ö†–Þô`gWð¤©<ˆ\ìˆÓ8ÎVƒzJ‰ºRc{–ŒäƒMB>+Ô¾æZIÓ‹€$Êí Ò’ß!dýOJ Ǹy-Æ8à¨3%Jø\ðedw*@0KˆMˆ"Ok"°G•+ŽT"¡¡ìÌ[O¬÷£žMè5)?!ÕÓ„×ÁŒ‚}¡  cǬ›VB톙ÒÔ"óÌÆV‹ÌC•YäÁU±«åL¥ŠxîÒ³ÿrœù˜jœˆÍö=N—œÍgÓ˪þYfêÙ¹t‰RR<$¨ Ý<*­¼´¼'¨ìþŒæœIzØ„%³ÎêZDHgJÈÂKe­9‹î 1¹®#€­Lê -øBFçùzX§Lmˆ,Ê´ÏFG_è÷*8” ¿É&è7{zV'zD ¼"/×$uF õXÂw ™Dm9Wn׃‹¡BŸf7tòÉ¥–ë¸Ë˜•^ÌNtÖâèÏ D0]ép%ô`,ë/‘ @"r™Ëí ÔÛÔâ{¬5…âO;j Œ_˜ïÐRA„üƒ˜eV «m—ŠB!òÊÒ\ÈðG¯ùôq(æ#^°XdTxëdŸ¨Y”éÀ5ÙJ TqIøvatðWRÒ_ÓúaÊZlqŸºÆ]k}Š¼™“€¸Ærý\׈§‡ kšÁô<^ÁBlTý&’ç¸Æ/ˆkØÌx-OJ] Â"³k R®”sê¹¢ÒÀÈú„à ²›(IÏ‚\ UQFŪMØ'Ò ÓƉ= ND¹@nvùÍ õA8L… °Ô,` -øî+"˜«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{äµ÷Æ@*y®ò2Ö³Ñ|Ô‡D£V¾ÏeË©G²ÔÜ$óKg!.U$d}6Be ÷`}ÉÑÁ× È¯Çdlî¡¥Ðb™C’&æç ‡ì˜Ñˆ’‡IäábQ:D–|»KH¬XD9"Sˆu~aóµ"cUfÙ€k#£PÞ'a]“¥A Â>€x¡œT*¹þâOéºÌ&3],"«¦¨l™hG>•”Œ¸”N0DˆÓóŽ÷'’Š9¸é”ŽJÔ–þð) Ò4¶üL\IŒTU>:¢Ô¢ö2€% Ãd &*ýŠ iÆêXŠvjfxá`Ä=–jGu‡p’° -!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ÚÄ€È3®%ï3ëQ~§22Lr9’#‡ö©•r2.ŒØv©$BÒ††­ÎÓ‡*ÂñVXD;„.%ù+«½Pæ!í·ú£_ºã9¸ßp!Û¢mA#X£š*9k°Ãª?äZ^5'±¡•A‰~ -²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ÉÔÔ ®°nÀŒÍŸåôH*Ô`H>›C_SþRïqŠç™6K¾{zÚ¥{?ç»­CW6ˆÈ[¾”1(qYf ž¹¿"ó1»oaÜf,¥3F*¨k -!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¨¨ã¹¦J keÔÁXÐ:ØñàâÐÊ ÊÀîƒÖâ¬d#À\F%IbŽâسˆ5 ´EprbË{¦fDf,T#òº%xuÀ6ü@úAÄAÈìÂÒ)rsy,ö¤M¨Ø+À«Ä·I&aO½?ε¤õ¡H–ø °Fb¹gð”(™NŒsébœêTy÷xS¦ø‹òŠTW,%šƒàŠ`9)e¡€d!eYÞ `9Û¡T@cjÉ g ã^8`´GÆY™F -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¤ÿ÷¡âVáQPƒrôr""ÂÚ[Ò³Óc€EŽÏÛÁE’QZ°Ïa‚ßÇGÀ¤ƒ“ô±ð_’kȘWw=”\§žÐð7àB?|yîm‚¹è(ƇzK°è”–üOm43†UÚ]5;ÄÃ|D¢ÏchB)2E O|8Ùrï‘ ¨ÓÈè´Š@dPNi ª©"ñåQ±f¥|Zo¨•š«Ø„7…BåÊM@ -Š]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µµØnb5­Û±tì'‘Fì |´’4uRbHb€b+ŠZk  “„çLŸ2)‡ÌŒ0{Š# IQg‚žÈ”Œ0dfÁ3)'æ~ÓòhEåQŽTùú²B.6¥†=k_Ê Kß‘u**âŒb£*‰fâwY©M|l˜H˹/y@#*Vá «ÃxEÈ™ø\¡r + -§/Tts2ˆÈ´¨äJT(yUt‰-ë[)MŒVfH À7Âd„’åVïHï5´Ô‡‰¡IÄ`I VˆÏ&DrkÀZ”@[9 …­ƒ¨“U¾Ø¼-Š­BA©ˆ_Y°SÐ0`Ñ*X![s@³ê¡ÞXäLånÒH—à‘Iã#¥NŒRMwˆ¡–ä“Ó$#OeÊH,¥C€x”œ³>*} …3·t˜‚§TȤÃz€wßÖ/,mxì/…LÖ ÚÎbkã‚JKï|Fþ £É¾ÿœö 9ˆKaÑæ ØÐ0ÑÄå¿3 -z(W8*ùdZáFXŸ\ˆÌk†ÐDæqbüPJÆÌñ%hã‘éšØÃ%å,k\SZêµ-–rˆ%³ÊÃ}3¢”GÚ0K2¢ ÅÂbb›TÃ\b½•*Y!q_ú5ÝiŸ $=šP¼Ò‚•u8’±´µFɪC|0Ð)‡«PÒKg˜ eÅxÉXS¯Í‡­ÏdÔÐ -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ØÔÈzØ®äqÍ5“Œ]qXefVè'c–wã-ï‹•ÜH”âA 7±|/S9=q,ñCºÝIJ,ê¼T¼k×C&2³!Q¶ ªŒ1u½C3\?¹V÷ÀjYá¨ÊXœ”˜¢RaO‚S”©Õá¢t[ ølJÊT>5åK) ⵎ#¶bÐH"ÄMg©JÈØTj9%¾Àß‹²Ââ ´|#‚ÁXì¾C‹4KT‡¦2m¸ýIìKi§È>ÅM¨K¥­KQÄ|Á L_Œ¹k¸Äb£Ð`( N‘{òw§ÀWKí“li»1¥CdË¡¸+–N˜""X%ЖHÐÐ{„A פ0îßêµKÿé"«Ãã%åš`UGþVøŽåÅqû5mˆd¦ùINy-¸-0H<_'+#Fú.?‹%›œŸ0¤K#á†`´©c™¹yjU„ÚˆÍ$¶!Ä\ZÖ ž‘¸p71{TßK~!÷á+58:bb‰JÚ¶I®ex~HÀ{±¸‡Ÿ€Ü‘È -Œ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ð›©&€ÐÁv7Ä?kËïVH|Ø¡Ì’Xú…:÷`0XD¦Â(V@'dÂJ-^2OFJÎ N%Ûͪ½m%e¨²üí@µ ¼± dW‰ì (›’…‰/=…—)3¡@¢\/Ã(Ãò·¢f@-Žó¯–šaÜÚ`îbÅ5“&~ú7½Ò¤qI![âÃ7Û!.çÛÙÓš—Ø«n­/ -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!ðåë±[Ä®ÞS~t¼C`:x‰Èá0ªß@ÞqÙg‚Ô$è$gåO¢ˆmP­¼Ô‡<‘N_Qʹ5€êT(új¾*Ÿ2x)è‰ô„‰Ê ¹RPqèRøx¹%—fOAÝbž¢ å¿Ì-GŠ¯%/íèR§í.!‚syyîíï0oF•M±¡Ed„ µÞè5FY«‹ ,f2¼ìfÞ¥LÖ.úΤ™bžˆà&8ôÅZF3¢¨ðJˆnGòÉe`½{¿(%I0¹*Ann®„Á9„½ÕI“&`î«ö “\ –ÂÄp/.±€UZÌ…0Ò”Tf˜Ò×›[º2_÷]±eâZÆèNfÀÈ<Á(vàÆó.eà†,ˆâ5z“YñØÖ¯qÁÜ›v>ö$6W|¤ÃåÐt¤Ò]“ -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µÄ¢‚UÒ¶¥çbÖn(‰BúqÁ«þÁðù*hB êÏL6=Ž” -ðQdø MâRUΔ™U™TNU_ÁÃ%4K@;¦`@ - 2ŽCƒß ¿¸åZÚµÈæ-@[m;à'îŠÓ´N8ä‚0¤†)˜Gñìèì«šjG,>:&ˆòB(…S‘’&äë£Ø£°CÃÔEÁt¨*@Õ£HV)€Ï€E*Fb %…êP˜IÁÒä …Y¹XÏrå\v°uÓ*”!ˆWï$ú¾)3¡>nÁc 1ÜˉUÏá4fU>ä S®‘¥LHC&"û‰ D¼@—Ë EÆŠÈò`ÅhDÕô‰bŒPYÒO ­=eçDþó›i0-V}¡€‰±/´„'@h Zª.ãgQÍÙ»JE)‰Œu)f Ñ$>Ö%™<ÒÀd–»E4nVTÃôÀ2Yœ!ðñ™ #;ÒQ`‚•Ôc¾%MðnL¼’bå.•’éè"B3½F࿹¡œPBû¥Ôat¸„?åçÊ‹ˆÝəٵc0ýäoéÈL(FÊ$ º–BÊiFŸ‘ßÏ´Rª«‡æÅÄC‰,˜#Ï|z(ÃLÇP,º|ÄôÀ$â^Fö(«‹Š0 šU&H³(ð>äP*ÈmS¦©_¬(–»0g -Š¬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³Š¹™„ #H(æðRlÊ™“d…äGd𞨺eŽp&«É¯NˆŒ$°Å ›Ž\µ¸‡\›±¯B3¤n2@ˆéÓpÀ‘á:°d\‚¦•âàUN>*}§åoæ¾)äˆF­ŸYwåÊ$ÌX -Í/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䪥{‡¼Ó´Ã5éÄÄÌ,‡Š …~jÉ­¡¹qäuHÂÉZ¦O9I:fÞ—|n:p -•00>,~šu8™°7#¹µg…xltËŠ -bc‚ÆEñ…‘ƒ˜Š¤ š<¶ ¼êaîñ$ á…w%+Ëa¨Ó fæ¿¥¬x'j‘›Å•ÅÔ¤›ÃW¢%>CRšŠFFl±…oNåN¼FlBþ:ŠjÈóé ÜÄ8{ˆ©†,«® ÓD²‚Å=Ä*âù•2‰=Aµ•S+öí€|Žg³*:óH þ™ÅÂj÷3:óÁðž[0.ThðÄTêBÃVèn¬šÖ|&™¹ÙÓw€ê¥5O\‡$H5Ò$¥\p®«˜,εÂpPRiDâUÁ¤u2·‡αÊ&”Ì6X\±‚*•&²"Q\³ƒ"òu Pm_9ã#2SQ±Eð*DfŠ…ÚìÀvO…ÈòiØ”©éIfò +Å×RPúÈ"$Ÿp8YL›Xù+ËØJ–¼K¬X¾àœå6.öÓ‰E§¹+›6”`¦çŽpñæîÔzb’‰•Š& -ëŠ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”d=Êê ýŒz•BZu&%â%‘O4!/[ jxú1¹Êã´á–Œ™GäP°#öôžÆ°ÌÇÂÅìõXvï&J å±DØ€xËd‡²“<3 -OÔ•ïe%n ×‡ÜO-eVÚ=l ‰’(u(7*êô -± •ò½´Š5§*íÇ -¤>Ìjð…ü$ÌÝ•˜ʶC~,r2S¹`m#½™)êŠNú+|±òDbžÂœG¡/Kd˜ e¹…§Jc%RZñ.”ŸÂ„ …ƒkX±6¦‘¤4èÊZ&ªÌ‰è;»‘ÏóJïÞñÙà ¡„³H_&`A‰ dÎä€ØÛbÊdˆhL ”X³ÔȦí*NC°lÉJ?CÉ)ø°¤«¿ £ PìI¨p@&ú@Ëå £ì#Šmsy>Õ]_­?` x±´-4Ò2,tºŠ“*òZŒ&Î|\ªVRÐLZ -èlLåë ÛŽ'C±Î†8‰$“cÂb,,çF{jHÂ$S#(YÏõml? ù gÐbqæ"8¥ëÔ«›‘”²ìÌœ „õ¤U!£ßÐT…êôh rÉ(_Ø¥ÌøEJ˜Ií†IRƶ×W†/‡ˆÐ—E[ª0kEÜ©@Á•&b[$£_)ÌH¹éŒ‰XÚ”g–'š‹J{¦4œ=~K¸FÍ>ß ÀHŠ4%¢Ê&°¸Qñ9++¦L¥S£CTx9›A@¬ÌŒÄÊfpÊn Ï –A–ÚúÌIü†h3‘ðèkÃcÅdÃãæ…ßHÍo\ÜŸ™Ä)» ôÒܲEa -³"UŒìRp%$¬Ž,X3PVdLN‰¸JÏ<} ¶~e³§{½ÊyÄc05÷+€1k„H$DYÔÚÎF “l0äÆkŽ³@HÂðWR•ËR9éƒÁ‘ÅÞ_Tï4JÏÜAéa§2ö€…ßw*;5”‘6@ÉXNô|È èŸp(¥&Bé«lˆúÔ f/¢úFHEÆaƒG’ÂÅ̉ó‹‚IÞLP!ì\øH~GngXr‘ ¢¤NnQ•Ö «¥ôÖ®ÙÛ`H,Ǩsa[Ç2ôy%±”ói*ëRIÒBÎ ŒLybY¬ á„‹7¿ùp·SqVäî)p‚‘ Eê*Ü××yê_7abn6‹¡š…æJiÙ£Xã)––êÔc©á²"r3Ü È„ï¹V øL#ÂâªðË„´zHÈfÖJ¦ÌìèàÀ±<# ©0©T@±Ô°dâL*µVΈk¬y Kâ¬òÔBâe;D'DK/ -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‘÷Šs6D‘\HcByiD•ÌF‘TB$ÔÇ RFF¥‚›KcKc”"ñÅTÍãr€ ëÝY‘µÃLש–´31ˆ~êLÚã‰QZIÏ@Ùm,;S0ª ‹‘…ÍOTh§±b”ÛÜIÖAv]Ô¨CÈ ‘-Ëå`kJ%Α(¶=›˜óSž1R&(QÒ"2ë‚—ïIcÊ¿ÙèöA,‡1«eˆ3'¬ <³ê„q¢Å"<„5ó;8K”ÈC ¼ \dY$Ôùê´ñƒ·xâlTÇKAB„†G²¡BSžÄ älÈÄ0‡Ã­ô"Nþ§{:Îx†‹ <7þ¢ôvÛR#N1Ôb%Á V6:”ÏhG,LËìå*/ -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¤;Ê”˜øá£Ã²•c -Ä¿ÅÀA( …0Q“(……ìHÌÉTgg -øS€{¥Vè87鈼çVxkÙlèªo¸qšÇ21ªAˆ’гïÂÍ dØ*.gÂý‘R Û#5öK¦Þx½Aæ\*Š_ïÉÐzgÕ ?¤l\ÆÔñÆŒIpx ,0Î=kî!½ËE>ezT’P¸ ¨à|Îcc»æ’*„»K° ÷Ùq‰Ø\„4Óy¥ºÞLçY²gäy =£”NÄøiAmK9H€÷.+=%eV¦¥‡5¨¢8|m@^ÊÜ…/ ŠKLÛÇ@Rš¬*íÌ{%TæÃ{ ‰ ·.IZÜ´Cêä¹Ôt~ºÒŒv¨û³Ë¡à½vêHÊÓ - °XÜED!LK­pïvâSr&.Ëè†S(ñgø‹a9@Q‹ò -±g7QŠ­‘Ì”ËJ…º%8@UKÀ1®´Ð«rD%%lœÍ* 8ˆ6èÈÅžwÖ%·¥’-s/¦³@ ]u˜–â`š-sR=ËÅl‚*2@º1TãÓtt ¶5PöY”k“1 -倴 ±Zz¦"Ò•È`²Ä:•o(ËÌjØ^ȃ ìäa(ƒTMvÞd)¦ §ê…U®šUE1U"÷¸î(Td¥/ìS¦7Ôn¹<Z"QâÄU—!-2/âš -!åÔÞêµdÉ¥W€¡Yò’2J#/BòLe‚¤1‡}KÄW‰iìi©ÈjŒ7š§†ˆN¥"È« Фø5ÄÓ É“špŒZLDŠ/úy ÷©4ÌÕƒê‘pDP¿*ø 2e§ÞýFçf"èCá‰Ó͇ø|–X‚Òܽuš?ÁŠØ±…0cáÔÅ£üš€[Eb#Œ ºahé`'•$½RÞ \Ùi¢ü3IK²+„üxTE!°‚Z@= !ƒªÒubïš„EPù›sƒÜoèe QÎqhÕ‹™§\ôU =‹ïCaœŸ@ì ™u3ÞAÀ0Ê€6 -ù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÷úæ0R„àL‚Ѓ÷É[péb+é3À …_á3H*g\a¡Qh]ts©\4(¡“›<¥9ÒÕ“j%u³@JB -&ðÚZœ3D¤šT$¥Ø(dÕêÏiîØûøvE&†ËÄNŠ\j6±Ìˆ Ôjà'¢º³S(#!6·YòTZ Ù™eDí®ly׫ùïbó嶴‰«ðPàkÖè[‡˜:áV‚:$— Ý¿þ -AöPœJ¯@)6•.³æ;;àON”¤–00Vä†ZˆÚ¨šp#›§špŽ¯Œî"°“'àŠPfF½ÅŠ0PɼÃØ>>ÙH.å2’GxýPg\ü¢0I6‚€úŽ"BͺÙFåhÂøX`æ3'E3)TÛ÷Bð±Eà¿B‰g²®G±‰4Ó!­¶S«•ÿÃ=(•X€G8 -#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)Ë `áÌô£^ø -ÇŒZ›à…!l4õš—ùÄ>Éjf8>,ÇÞŸ_@•‰`‡ š’„Ê¥¯Ï¹î5K­Ë#ù1á((Í3£€¿ÎýÛŠÞ,Í?74'%Rºw‡z€UOsYÚ(uÄLVWëb¼"Å^Ψ!"ªðßy;*>níÑ¢B††ÕˆGœ"1Á¬„† ;Š ¢š9ÔeaX\¢.€ÆGC4/”£Lø:÷…óÌC‹§¶Xs; •¡EÊwk;•rÓ1‰KW”˜ÞB¦_1ó6OÅb‹¨ñ²vº5ŸÍ©­ K§›ž-d¤ÆqŽs ‹@y@ -sDvXÿçÄ&kРbÀÊÃ=œÂ€rÇj/iM;3ToEºƒÒJySãÁÊ­:+ %PÀ@€|»â·sejS¨*tNJÁ5 B€uŸ o™ä’¨˜`à3Êá±’þÅ0Éqi¹,ȳOÍ<­Pt/¡'JC¦†8âȵ}ño$çƒÀ.doïê|ÆÒ -}ÈZp -á–øƨå -éz'“o‡J@’ò -]›(§ƒ_†)@!þI>N³Zì`.èËó›îd-~wÙ™P„泃“_˜IÏ BŽI@$‰° YrQ ˆf£™­òÑ9Oþ‡£Ky¥JÐÈ*€v[úÒÔLË"Ó®žÑ1v å^"WåD‰½Ò@ø™Ya R© -( d˜ÛªEà¤`EYl5¨°S3†ÇC` ÝAI ŒÖ^,õ6F 0Ýu“m»J*84¾³ -”é¡V€TŒ2/ë0>´R‘ÑÅѵ ,&Ù1¥NWļtиý6©åÎÁ‚û/°Ô fóòÛâ‚IÇÈ€›úÄÀúÚY3±T*D)`›1‰,Wafnú'ƒ1ÊòRb‹Š Úžl¢8 óÜë Ãî\y+?>‰è;I¤ÿã­9?ž-‹î!(K~2¤4Ó[’o/Ì°â"€™)_3Áø*¨6§fÍR*©‚Rêõ¾˜‚4¶ô"Ux½C×TD+OˆÙJД<”]œzç¿Ò%,U@à }˜áë:Ï”o í„B'h¨•d6õ±©Ì”N¢k€ë0bu-Òv -„ -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-øª, `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±áäœsæe3àN ²&ùÆ鉑ÊêåÒ -žI6Ä®„Þƒ¸%ü&•¶ÀOb\˜»˜~ûDdC¾ÔÆ|cØÎÍXö¹EæõmGÑá½ )=bóSÕ´·Äü>±b#C¿‘ÓŠçˆì$Ǹ‘²M…¢32^†é<¼j¨BJ=w“r¶ÕFEdÆ O&ιB5#„ºO/„ñ |@è¹r¬a©§–1)G·œ5tõ;=S>~Ñ5¡‚ÎVÀ†ž:7ÈG™S¬ÃÇqE4½\ôϤ*-Lì»@»ŠúÒL•ZÉÛ¡|g¦cqÓGF‚I¾II8K@Í+ðÒ$”|†<žË‰ Šj ,ß–h,|`ÔheƒÌ&¤dî!4Q‡H±Yj>gJV¼Ô°C1âÒ ø”pE|´Øð¼gbÉß~ȨNª\¦i!²P˜H—#=ç¾a*€rwxº{cŽa9xΊÜò˜(Ϻð"6iSš*Ax#ãÑ"°“EáŒbéöŠêÓŠ*W>ÔËØ ª‡Õ‚þv&ÀâxË<· "Ê--L>1&èЧ•Ùz/M8r‘'Â(¶Õ rÏÁTHRÿ“IOãPi -:Êè!V½=lcXì>æáó©hö-y^’Z)h³è€jE -û7 -}@‰¨ÎµÃd·ïEŸÍœ/„™aÛ”1Ó_a\ð³øt=‹hµdâƃY¿' gÑÔâyÃ$‡8ŠmðÔiÑ%ë)™ï„ c`äjÈQBAaŒJkpúFˆ€ŽUh! 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щ‚§-)Fª¾[ëÉv0ÏU­|‘‰rWÅ™aÎüŠDŽ¯]F#OTÁ´d±¥A«Fž»$ò8ˆèÑGšO¨ÿLIµrÎÁä³mê”´ÂRçUv' ã#4{®¬k/A5â4u)caèAÏæ¶~jˆ.øååÜJZ¨-KdJ\c] @ZIµ-©Ç-ái2­J.P -!‰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 -zsO¥…+¢Yé+r€—*£p{‰hj<6› D,85â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ùÿA­tæ1 ó\`÷Ìi*˜âñÿ üÄþÁ»â½½TZõæ­¤~w¼ÈµßÆ©Í÷sÿâ›ëò_ò¢3âvîm£åïø{fðÏ\*«·{ûɽrþóeÓÅ‹œÿ©Ÿ -,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èˆÄ? T¿B&‚ÂïX|#߈Å?],æoÄâ?X,F`±}#ßHF¬¡Çk×ЫÕæÆ¢ì ßÈÎ-dgñzËÎ?þsßÒdàÖ÷ŸSx.Åß{ÔÏI»-vü_½J£?y•þÙ¢ëO_*ÿ5jáÍJù_“Ñ·Û““.FYðz êÿ•½óŸ>?~§Rƒ·ÆtêP •ö?ÛkØ™–ù?·…Ò:Î_)þ|ÃJÂãñ‹“îù\'Ÿl~¿ß?›LÇíéh¼×>].Cf¹ Iüvô{ƒ«:ĸCNOùïªÅèÅdºå†ü[–ÂùÀ­£jõÜ:q£¾â3ê^ŽÛǽ®›‚"»ÚšMôÞzéî½uë¨Ñú¦gÿ÷¿µ¶'¯þ¬pÐußÓ½åׯÄïS7è³ÉùÂ7:Òÿ¶nØ÷ŽŽúÿ,ëüÍ¢mý·ùa U•‚µB°T–û€ñnŠdn-λë|§y#vìU*õã—ÝÇÎ6è·Oí¨·Ö\g_öŽ§>ô¶Ðþ‹ö¸W «7‡/-¹”uŒT/½üûµ7ìN&³?è•gî:ßYô·,:Ôo0ð¯^vÿs'ËIoi÷»Ói—/ñäh'´ -é+ßÿ´õ´{\5n^Þí#Ÿ¹ŸîŽ»ÝaõKÐøeÿ·¶ÿ!œùáVÿ¬[ußüáaû% -­õÛ!$ööøÚû×Ý•‡×&ðüz´>uõoËVEjϺîZ<¿î.}z½nUÔ>kUða³­Òj€l’¢ zm¶ŠÂ\‡îÒl‡²3½àv­ðúÕËûFQcB¯G5™éo/m¶I—·ÉgåéÒFxã=~?§…æ´jéç”3Û|¹¿°qÉqVSÏômÿ3Û}ÞœÂìï¤jW¾÷¤ÙÇèql†ù]L£‡Â¯U· -ý‚ªOŒó!ðüzÚh‡–Qª?í´Ü"´ŒÒz¸aãåêU9ûÍmÒ`i›XKÜûŽÎ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(q^-+ã®…‘.ÕÐ2Öż’¸XêbVïjþ»ÚåY£J¨å>ª“´hôUGq£ú|NëÛ%wžÜª”K¯CžëåS#›êr#¤a.óY¾³ÝŒxAñåÓ"Mè'!ðá1ÿ*ìY·u«7ÎÔ~t†ÿuÊkëÀ½&zØ ú—[“ šŒ&˜–«ó¸~zêê·³™º=꜡ìêv{Úx ÿ7qg¬!÷ï,^¨UlÝ/[Îh9µÇÇ­7xØ:‚Üxn%Q±ºitž¦ãî±Z^ûêáƒG£ã®p|ß:¶wmùþ:è]ƒ]ü| -Ý·ü÷ŸÛÕ+”Ö}óçé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š[ó_‘óyÁ}]–ú2y÷‹±6Œ( J‘¼^#úÅg‘Íê·#ŠILQd¯Ùˆ~[6š“nïåÉfu)¹Üë5$ÿö‹ã:Mzø ûbúxÜ{Iìõ#¬‚©¯ÉÐð;ΑÑé´70”whÃhÿûÌ»i{ü²;ýÛ_ãÉ£»ÅÁhííÍ)í~o2gWNNGÓ¹VÂfða•Çø´}|\ ñæýÖM§l·žòLèýßüÑuó~¶ü4´^ GW£³i륲ä¸ø¾yØ=î ZO»“QÿÌräçÁùœ*mÇmijS’óM»Ãî¸õdÜE¥Ñ£Å£³wÚvš_kÒœõÄל«°vŸMOÝ‹ùq°aã•lªÒ™{v''îX1=ת=í¶ŽP+a5ä[dU9B³‰^2»»§Îµµ¦óKÞÞ§UÿEY„kÞªF…Éš–wëÎWoƒþh4~ŒÚõéoþK¬j»ßí÷‰gmŸ9ʳ|Eÿ|l5¦-ëA%i‘¯›6GU¬Æç×i% 6ŒŸåt›¦ŠNùæLE+ÞóY%µƒjq,î±íá˳öËnëÉèÔïØpfMsïu¶î8¿}Ôë×*í³ïÀ?}¿=ü¹=9¬äEÓ='ׂV–ìÁ“‘³ŸvûÏFOwp?»&=ÜÀ_C/j˽" ŠV\loT ϦöæÓ¹ߟܴÍcÉ–CmhÅb—~Èó2måER4Þƒ}?=ëwÇÍøÉÿp$qÏ ÀfNƒ—½Öœs7ûûãÑéÍq·­RþšÂ†_é ܇oj7ï|ٺ˭ó££þ±¬šJûÎhwûì´ßë@Ê¡”ÍZ·º'íŸ{«Ž°†°ÄxÊ]ÛÓÖ—½áñè—ùk±›µ_$ï|£‡*5´lî×^sõ.ä†ÎŒðÐÅÍK=<Öæ±{°»Z‰-Æä\w¥vWp®»ÂÙݾÝM~Å—çº+þ]ÃÊ~×]¹Ýu¾qºkÛaMZµ$ -ÏÕQ0·ŽÖô±Õ‚BVȦ7 ¶»E/¸ü¯¿çÛ —¬÷ùµ[œó¾èwö·b)n¼/™ÿn+'~©ÄÙþÖºÕ;<^*pî;ý3g‡}õðÉÒg|>é΋ҹ—âëØŠª#Ó‹‹ôÞ³‡ª­g·‰1Ô4%‚5Íù -Û§µ:mÑúÁ¨Ó^ªä.ÞrwôÀA^¶ö—.âÙ;R䔕;ƒÓéoÐæ&[ÜÂݦÿ!\÷NömÜK êo¼vîkíšö·ùÝÍž›Š-f«[¾èŽ§î¸ìÏ-‚™¶[›¼£^]7' +uþDçu#»Q¸ +–[£µêž§mï ³<Ï£0Ý|ײ±6ÚÌ»jÖTQ¿×ë¶l5c“ξé;óÏËϼ~±0h½¨ŒÈ1 ¹ÝŸŽìÆsÔî·‡>~”4mV'¦ï³³6T…ÖƒîÏÝþ -%kÆ#rØíßkOÝûcÿô!i& åmEÛûˆùÜ¿ÝlÙü™©èuÑàlŽÎYÝÀkM–¾¨Æ/k9a­Ð¢œiÜé÷N!‰Lþ_yúÒ }çÞ^€+ùÕ:vCeÑÝíÜì?ížžõ' s}ÁWŸŽkÌ­§ˆsöÖRÓÈ)‘Õ…ójû|ãCÕ¨IÕwöP–ï‘öE{Ø›œ¸eÄfzï-’d«á~Ûú³wë—À7òf±‰ÀÕûê‹^÷7XgùN"s¥ƒ“|àŽ¼ -×p]cŽd®õÊ%Pzéb+N¶Í*¨Ÿ3¿ ‚Önê݆kîïÂÏøs—‹ÙZXí½a×3÷niëʵvZjßÕ:7›6|WWÂt/Ø‹.€W7ïœõûþvJ D´ûu¹žŒÓáÙ¨å=K­;¿‚ZÍ* «zŒëîI{ìÎIwNžÜ>Xb¢{åd¦é—'½ÎÉ“ñQ©O»sΑ™–wGÝãù–ËûGçîðªÏ¤°v!Ï4t -ý¤;=púßä)öQõÜѼBÚ™Óæxf5•¨uó¾ùš¯}!åVSEižûlûØŽñgKü™&‡«Nz¶âGÜ·#þióˆ_áºoøìù€5~úZ³t'ç'‡­ÇsJÁŒÇÝÚTm§#Ê?çuoNœîÙræì%ÖNÝl›•s§fdòô„ífOßsnòfBj¸lGÎ=¶kcºió„Ïö¤ߢ«f”f8ª5ÂVoH¥ÞÙeÞËÅ­â§âZ†»vúrðjÏ)ÇÝãÑ‹{g“®“Z·ðÏ9ƒ²yOg°çÔ‘@ÞW=½Ñ²3øíÕ¬ 2×i[•ô¿òùÞá^ëËî‘[îp:n}{åðËÇO¾½Úú9Zôû.tIIµöµîöyC¯Ùd|<žì©DÕÞh}·lßGõfЧ^häµüÉšVóagC“î†ÍñÚͲæ¥=Ý[Ì&˜k0:=>ÛÐ`²é ÑêoáÀ>Zß`4ÞÄè×Öôe-\º¢åËñ²í¹¬åx¾e%9çΘÃKÀ©>ÿúï96Û®!;曞´»ãîúçõÕ‚µÜÜMY»¶ÍÜñ¾¢Ý°û²]GU– -žÉÞQ’ʸâÅk¯Á²ž^ §{§H¬š÷OÇ/FMGåŠfµTÈ–N7„å =~5°TÏÖÍǵ¯q‹ÖÓÑéÖmûÎX¨&`EãJÄ7ßz‹æãé¦ÖÕ[oÑvæ­—ŸK ¾µÇë7Ú(šž¶_ºSæÅhSÏãÆHÖšÖ[«|Ü}%¨QŽ¸ì‘?ŽÜ~˜Ú§óÒfÃÁÃ>ÜÝSŽn‡Ž¶ú˜\9̉©\ÓfæZúé;ã㽑ü÷~޲ݚÙB³iÏ ¯8ä]›I§3\'Ôæ´ï‹3ÂåbVÍÚý®÷íN6qüró<¸6'•Ûo黟Zh~ýÝú;õ¸°«[ÆP_7ì¡N¼Wi G„Ú\Û֟ܧ£é:…Òµ¬Eï†å‹²^kA ¾`{¢-µEӆƸL?­ÚY!úºw'½—ÃM3yz:Þ£ ~Ý2@£“Q#©eu³_¶kvÒÝ Ñõ°ZZ]¹Ý}áä×qëè·Öí±;ÓÇÄ‹»½þ>y-•Œ®S'fOÑpCã§QÕrÃITµ«O¡5oÚœ³5ïؘ´¥kr¬”˜5òÔ5:‡Ù1™ö­ùééñê®Ñ̺®Úmñd×Û²ßÈ‚Ýâ&l“îx¸`¯z!µ÷6LÐx•7ê÷»´ugpL,Ù -ÖñM߸5÷©=[$q5½i}ÓޯÝþ“îøE×?xƒá½…Dó ‡N ¼\3oµhë÷ý-“uv,opÃjž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‹áÿe=ûª¬›ñè¨=}Ðþ­;^"šYƒ«ÖC-óÕ6WR½ú˜B|óhäÃdëï[úó7¯ß7³Ï/Âó}Ÿ§3¬­§©^çú®à£û¾ÇÓÞ‹ž7’µÆŠ\3Y›wÝê¤ÝóÍÖƒÊÁxþø¼hN­ô–Ë;j|h;ó{¹‘¿2/µ¶¨×]×éŠÍØì|iø|û<óåqúuR~I½ñêÈä—§‹u!K¿‹{Ë/»GÈíÜ<3·»“ioh)£õl\yvâ>i«='Ý–9E[_ùðËIwØš¨À¥=lrJ¶0¹­ö—Eg躩ʧ÷XÞ0åÃgöÛè¬uê&´å>m{Ë=]ëq/Á“Ù›éèý–묺uèæ§5án«Ç<¤v«ßþ 5ëíSÕ3bÙLÎ:'x½ûÃÛ ˆÔQoC÷ ÎÜÛ^ÔÝ÷&­³á+PÜím'$Ü£;ãÞéy>nu¾¬=ó± ÛÓ³ÁÑ°Ý›/°Yö.nÂé·|¶!2YÉ -HÛ¼Ò¸—o­„Ï ‹g Ès5Ъ½xw±†nÙPÝÓOO×F|g¦¼‚áÚÝ['…2'tó`Ÿ{”û4™µS¸2-vÙ§íáq•Ž»å‘et…¿-–Å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É$š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¦KKÜr¿‡%¾Zõ÷Ù㛘ò‚ؤ‡l…äxFÔ’b}7ðPï,¦jåÎï¯^ B¹p±ŽÃ'ÞREùÓ=±âM–øgº=ÄK‚ÉJ¹ÅC“åoqò uÚ~n„7ø&Ž%¼Åc½îäèpí¤X„„KØŒ†d£½á…d#’×Í°ÏpŠ“C²04j#¹«Ÿ:L²‰y ;¢á ßKŠveó;¬–Ço 2 ’©2²ZâkÑ©Œ¸O¡Ä‹Ò½nâáîE¦¸NKr¬/" -ñœ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¢¢ -Y·!ã^+'ǘÛðâCtr¬qœïtþb,£ås0¡“nû0ðÈ@' d»!¦Åé°¯fܦÅJ³½8ñ6´pT:r[cen4†…à3þÅN‰µH•'ÇM¡Æ̺Xx,Dêí䵈T‘z;y'2H€úå‚Hý5È‘Štò@¤"^,;"©äHE:b×@G\⸼>²AØ—¦¦N2ªÔÜÕoÃóÌÛ0…‹—cyCáH>?7£'(\ìºä…?nž1¾ïžÂ¯Ì…£ï "`¸ÿ -.&ªð_€ÂÅÇÇý³ ž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š.Ž´’3š.î´$’Ÿš.N<„½×<Ðt '#9¡é’õKhº¸É¬ñ¼ÐtIH®|ÐtqX:f=¾ì`-pCõÅR]ÝÄ®â5Z¤2Z›Cø4HØì¡É×ÞYµlƯW7Ò¥!žòä]¯Žm]ˆÍÓ°:“jž‚Y -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]®ê‰!Õ o¥³ O€ BøÌî<|%«ÆÝÛ0&¹bܺÕé*Üñ¶¡Çhn…»\*å%â‰Ä*åeÅù•ò²oCN…»0.I2N…;^½W¬q—¾Âè­æˆ~ʬý5Ì–÷* ¬bÉfNAÄÐqjÓ¬"õ¬ñ#ÄîÄ¡ÓÝsEèŒ!7Gîˆ@:¹à9w$1_,‘ 1’®™ åòÒàÛã@Lô©( -ˆ¹‘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  ð=$,€˜“.€ÅŽÆ“Ó E1€ô ‡éQ€¢@µbŽ‡̓M‡Å⌠æ“/7«´(@Q  ï#…dtiHŸW:ýUö¢|âÙ²å£Æò_,Ê7Uø¯åKªÈ–OQ>3Â7P²å+”b¬ÂÜ‹òÖGþoåc×Gγ(ŸPýÊ,Eùè¨vÊ`vÊ¢$h0»ª_ö»¡6ó¸J°®ŸÐÝP™ëúQCËán(V]¿tyJãÖõãWõën¨˜º~ü¨P¼'ž¾®_<óq®_2'çQןâG®2ÖõKBråÐåVõ+”Rt™uýøC‹Ä.Æ®ëêÈHU¿1*€ÄÖõã(.Cuœº~±pDÞ­æâ#Œ”½ zŒº~ü›¿ü3ñŒuý¸Š®E´XuýøaáT7Pqêúñ]ÝØ,è1êúÅÁ$ƒ­—­_˜÷TuýøT0ΟG]?þJA˜Nà{‘:n]¿S“ªêGWg2Ôõ‹lC)\Õ/tgWjxŠä×õKĽæR×_ÕÏçäŒuýø ×"5S]¿¿Ç‹‘{®Æ®ëÇŸ@bÁæP׳׾žÕœêñÍò©×ãK(''\/S]?ŸJìöI‹æ©ëÇÁ=$fÛöÓÖõã[òxãAuýX:ütô$q<ü–€9ï$&mäº~üóæpÁøuý³õÇ­Ç—.Iƒ]/‡íãWõË^OÄ”t{Ãh®FºR|QDj¶º~¡ÀöHU?1”½®Ÿ•âÕÍ\×oæ0x,u]?~U¿Ì·6¹uý2Æúëú à^s¨ëǯꗺßX(܈´­ë7>žªêGµ’©®ßh(™®êǺå,m]?~zWD‹]ןè‰)]×/f]¨ª~ü{áÄëú· ÏXzÌïÌP×/\qUýÆÎŒÔõãrU$[]?¾aèx¯Ùëúñ±®FÎ\×/<ÈhU¿{Lø&«p]?¶äØ0 7Y Öõ²a2×õ£Wrô‡ƒ®eìÏøº~|åÀEqæˆuô~#F=üäÙh{'ñÑ{¥žœ#ºž²C»üÄûl1ÄM§7ËK4Þ‰M¹M•C²þLŒÔØëþ|î†<Ñí/ľ)_O V6'ª—»ÓRãüÙt^B<ÕÄôÎòF]*¿M4î/?4õói³»üòÛ>8™-×^+3ÍASZÜ]›|7‰_·*üu³ZÒ­…õ;{ƒC}ð|qY(™z]»·vºçõ­ú焾ÝÓnš‡Ï'+G;ÆÙÓqWœ–ûÿLŸ­U´ößÉãíçù—Åó÷þJùmpmJŸ«oÆîÄÙîÊÌ´Zî¥.76*ßOS—Úû¯þ¼»÷ ¶sùäøèt¢^½ZP§ÕEufUê6·šR÷ŸûM©gü8üü¼±ËŸ_ÖÙÆ×Ô•q÷¥ß]îûHËãêR£vVW·íIöö·ñùõë‹ÍÙS¶zT†„ð¥ ?·¯íµûƒt¨ýXOòûF.Í®­noÆM™ îð®‹:=Á+A4–ogúûS§?—§ß>ÝŠöø=õò0ñ€HÒM:ñ=÷¡íb¾ÚÎÁ$N¬uKÒtÿøûûïa“ý#²}`hû- -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äá>n4$ýn ÷ìV=,<¥öæ⻯ìÉD—à®»r6¸³t½%˜1…—QVɺ9¬wUG´ël¹÷1[nþ1O×[7Ïk}˜Ô‡/ qHÑVWN&¾ã8'Ȥy‡45ÁôäOpÚIÛm+¶Êáí»ƒÐ=žÕWƒ§Ö·óú{k‹²uɳ‰aùË'±!–Òl¯®­¯½J¥·öççÒû,m­ƒ­,Öv|{e])Ûj`Á:ÆH©9ÝöHÜÿˆøül6(r÷¼'ûf3ÎHý•TǾ(þnüY>铦ñgn~™(Þ³Ó÷ìâ³ñgï­ªN/.ÞîVWNw·BvŽY«àõö„{w©ðŒÃ'¼ë8ì)·¶öËÉ.í'ªÀ8 °íPZzU¶/?Õ;¹ó«ÚuŠIc7#S¸§¢ŽBq.—h{ñ•¢½j›þ-»ÞeRÈ.%Õ]‘A+NÉjå1Tž›­‹é7V–‚r´¿Ž|³9rWHÍ=KòIÜxöè’♢`ÁÞMþëJëE l¯ß, #ý¦u—á‚T”f,ÄÊüþpÌ…¨Rß@8™\²X=›½õHÀ áÚ9} #àöÁñ_FIkãõ\˜æ*°§!ABL)¦²P!q2߈%}ø 0è`Ï -°¡<×*UñÄJ€â‰ìtÞ)W\}søª\Ñï"ˆ£W(Å­VÜ<ɵé Ùmª·Þ šÂyPï]^ñºô×YS²úô…1.Þ^ôÇ¿}“žÔmm‰þxµºBhæɤ?JoOFWcþxe.Ñ—–é.oOÚôÇ“ò<ýñªN‘] ®Ä"ýýÇ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ãÖÙC·“›'rUõ^: À©ã0°?¿¾ðÛ†¿ú¿à£ùIDa4rÛTH0i„6ZwfõÕšƒã« bú ›ïÔ•}ý}sÑqrÀ ¸ŒÍÞÝõ+:½ø -³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á„Á‡Å‰R_Þš˜{ú{„»ŽEîj4~̘j÷?›ßêÎöYD~‡N¹ë Ú?»úz¡´¶®Ïã=ŒO—Í›]åÈÜZ]™ƒ÷5‡¥(tè̇ŠxpC*A@Æ2ݶs•ÕU'šR=˜Ü¨Þ×wãC*~ÌÆ ©(UgG_.¸²±{íëÚýw"Y -NÔðqÙÙjŽðëñzUf/ú@/,ƒŒ…O‚qÔ < ² ÿ¸ƒ&ñ;Âýô¤sØ°ÌšÙßä ‚~3?÷§LúÈèáÈ «Ê£[7`9i½}tç7õ9/r´Ó¥ã¦¿$¿}×B¤á†£¨Ë³Óx?¢¾ZÓûõ} -¥,Þ¨ï´2Ž÷#êû Í?¾÷#êû`+ã{?¢¾O!“÷#êû86̸ިïƒ36¾÷#êûxÐÌñ¼QߧPÊâýˆú>´—”ÞûqÒe=>øAøÀ‘¥ G–W®•ç¬ço}¸/ÝjÞ¹ŒVÎeü£”¼Rm€â¨êŠ#Ìy¡ÄÑÅ{Ý9™Yøíú•xF:G„¾òû{q£ñç|XwBñææ«ÄÔQÑÙŒ»‰„$ D¦¿8q ]tÆ屈à"GE ³œœ05Ÿ÷"t~#ùy)ÐèGÓ8óâ^8ûńųdg{'eŒ€=î9§6N’Ë£VwÏjˆ1½ê¹8½=É‘NT@¨w¢xÁ»¯ÿY.,ÀH6dùºóö@‡7 ¥<9ê¿?ðýºÙüó¶}ûŸþgA.:ÿIðþkÚEY±ŠŠ®ÃŸnßÊäÝ¢\)n¿J×µÏaûÏýðÏûÛíçŠóøè|gûd£]œ/:ï^û Å2ôFº†·á« -Æ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• Ó3fÃ⛲¼3nÀ@ -ô^µa¡M왬:tMèN«€oY²f¦1møC¾€Ÿ©„ALËv°uè+þÎÒë6üƒ¿³ºn¨d’¬‡M—“<ÁåÁ>Úºì?€qÁŠÙ†eùàCBΰt³¨À2hŠ…œ+ÎS€?ÅB¦Ó m)ÀCš ¦6 ZÕà‰á,¶n[6ÉìÃÆ4‘‹uàøEƒV-è4ìØIôXlåþÌ{&ÈlX=øT—%äÜ(¸ä˜_Ý2T•ôR®ë²#ŒÍ2‘Gd™ R³€3lÉ 3¢ ‹øOpÙ€ElM§ß‚™5Mƒ<Ñ$[!óošâ<ÈüãâÀ\à¦1a•eXÅ°ìYS‡I–a -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“¡éÏÅÆîûð°ÿþùÓˆê+åL5û·/;·ÃÏ?ÿ†Ë­µž»Çÿ¼¾:_¹štçÃû]ÿzmÃFU|4üÏKÿ:èNH‚|ÀUVR¬r`;HÞÂ,År¥x~V Wx£N!ìž)ŽÑ,Ðs*¨Ù€=.ë&yj˜ÁÁ&ÙêŠNô#ˆÐq*Ñ3²Ûw<€f’MPE†‚ûÑtØ6–‰oØtÁ‚ÉDB že¢uØÃð%ƒI¤H_"µuÉÐ'”-† -È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ÚÅ51P Í™I"& ¬²E, ÛºŠJ† &Ù•ŽþBùo˨’ü'0—D´£¥á=®À[(7A\ê2R‚D›Iâ°J¨¬óKCÃf—W6e\Pb`i¹Œ+5Ê—-®x“TŶU—ñaÊ%#»xSläcS!¤ è´jJrH¼} Z˜ñ.‘nÀðFT¸±‰7‰ÿ_“m1KÌ—mƒø`Gƒ¤B{ËT`îe°ª^ 54³MmWt9˜^ÛPÞ¶¡«EU^”€á¶ *˜18÷À¼`ϘÀ–/1ä¶YŒ)‰¬‚U"{Θ€.(š4‹†¼ü›I±q¶u -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<«]F×H‚od 4 @×­ˆÖ·¬¥¯ä˜ÿDX ècù`µ‰ãSÑuÐúvСyv:ôÎœD€Á¢åk|`l üð6,Isb hÀߣ¤í jÓF&Gœ;CÓÑEOÕJ^[Â'G*Q·0ýÄöçº,c@@w &˜wxÍù€†ÐgÆù˜•ú©i8Z„n]K…êøµ ²Í £ -L9q6ƒÁ ƒ£JäXñº¬ÏÔÖdgNˆ¨Èà³È¨Þ`â,ÓñÁ8Û0¹::´dedƒL¿¶Kð X¢à™B¢9èŸx¯—J½náÿÚXÏ endstream endobj 6 0 obj [5 0 R] endobj 35 0 obj <> 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 <]>> 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 deleted file mode 100644 index 977c77df8..000000000 Binary files a/web/server/h2o/libh2o/misc/oktavia/resource/oktavia.eps and /dev/null 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 deleted file mode 100644 index 5be4709e0..000000000 Binary files a/web/server/h2o/libh2o/misc/oktavia/resource/oktavia_large.jpg and /dev/null 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 deleted file mode 100644 index 2e926f193..000000000 Binary files a/web/server/h2o/libh2o/misc/oktavia/resource/oktavia_medium.jpg and /dev/null 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 deleted file mode 100644 index 5b01e3ec1..000000000 Binary files a/web/server/h2o/libh2o/misc/oktavia/resource/oktavia_small.jpg and /dev/null 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 deleted file mode 100644 index 06d5e7584..000000000 --- a/web/server/h2o/libh2o/misc/oktavia/src/binary-util.jsx +++ /dev/null @@ -1,597 +0,0 @@ -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.) : 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.) : 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 - { - return Binary.dumpStringListMap(strMap, null); - } - - static function dumpStringListMap (strMap : Map., report : Nullable.) : 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.) : 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 - * 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.; - var offset : int; - - function constructor (data : string, offset : int) - { - this.result = {} : Map.; - - 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 deleted file mode 100644 index b366e43a0..000000000 --- a/web/server/h2o/libh2o/misc/oktavia/src/bit-vector.jsx +++ /dev/null @@ -1,295 +0,0 @@ -/** - * 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 deleted file mode 100644 index 4bdd72fe6..000000000 --- a/web/server/h2o/libh2o/misc/oktavia/src/burrows-wheeler-transform.jsx +++ /dev/null @@ -1,73 +0,0 @@ -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 deleted file mode 100644 index 64ed6ac85..000000000 --- a/web/server/h2o/libh2o/misc/oktavia/src/csvparser.jsx +++ /dev/null @@ -1,22 +0,0 @@ -import "oktavia.jsx"; -import "stemmer/stemmer.jsx"; - - -class CSVParser -{ - var oktavia : Oktavia; - var root : string; - var stemmer : Nullable.; - - 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 deleted file mode 100644 index 502b4fcf9..000000000 --- a/web/server/h2o/libh2o/misc/oktavia/src/fm-index.jsx +++ /dev/null @@ -1,323 +0,0 @@ -/** - * 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.; - 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 deleted file mode 100644 index 56db655a9..000000000 --- a/web/server/h2o/libh2o/misc/oktavia/src/getopt.jsx +++ /dev/null @@ -1,356 +0,0 @@ -/* - * 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.; - 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.; - var _aliases : Map.; - var _optind : int; - var _subind : int; - var _silent : boolean; - var _extraoptions : boolean; - - function constructor (optstring : string, argv : string[]) - { - this._argv = argv; - this._options = {} : Map.; - this._aliases = {} : Map.; - 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. - { - 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 deleted file mode 100644 index 3d0ace782..000000000 --- a/web/server/h2o/libh2o/misc/oktavia/src/htmlparser.jsx +++ /dev/null @@ -1,280 +0,0 @@ -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.) : 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.) : 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.) - { - 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 deleted file mode 100644 index 25c388133..000000000 --- a/web/server/h2o/libh2o/misc/oktavia/src/metadata.jsx +++ /dev/null @@ -1,498 +0,0 @@ -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.; - - 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. - { - var content = this.getContent(rowIndex); - var values = content.split(Oktavia.eob, this._headers.length); - var result = {} : Map.; - 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 deleted file mode 100644 index 32196983d..000000000 --- a/web/server/h2o/libh2o/misc/oktavia/src/node-sqlite3.jsx +++ /dev/null @@ -1,115 +0,0 @@ -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 deleted file mode 100644 index 8109b4759..000000000 --- a/web/server/h2o/libh2o/misc/oktavia/src/oktavia.jsx +++ /dev/null @@ -1,427 +0,0 @@ -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.; - var _metadataLabels : string[]; - var _stemmer : Nullable.; - var _stemmingResult : Map.; - - // 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.; - this._metadataLabels = [] : string[]; - this._stemmer = null; - this._stemmingResult = {} : Map.; - 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. = 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.; - 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 deleted file mode 100644 index 86308bcb8..000000000 --- a/web/server/h2o/libh2o/misc/oktavia/src/query-parser.jsx +++ /dev/null @@ -1,60 +0,0 @@ -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 deleted file mode 100644 index 71d015c91..000000000 --- a/web/server/h2o/libh2o/misc/oktavia/src/query-string-parser.jsx +++ /dev/null @@ -1,128 +0,0 @@ -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 deleted file mode 100644 index 38c52c71a..000000000 --- a/web/server/h2o/libh2o/misc/oktavia/src/query.jsx +++ /dev/null @@ -1,37 +0,0 @@ -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 deleted file mode 100644 index 9d8fa8fb6..000000000 --- a/web/server/h2o/libh2o/misc/oktavia/src/sais.jsx +++ /dev/null @@ -1,250 +0,0 @@ -/* 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 deleted file mode 100644 index d34cb8253..000000000 --- a/web/server/h2o/libh2o/misc/oktavia/src/sax.jsx +++ /dev/null @@ -1,1356 +0,0 @@ -// 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.; - var isSelfClosing : boolean; - function constructor (name : string) - { - this.name = name; - this.attributes = {} : Map.; - 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; // & and such. - static const OPEN_WAKA = 4; // < - static const SGML_DECL = 5; // - static const SCRIPT = 33; // - - - - - - - - - - - - - - -
- -

- - -
- - - -
- -
- Documentation generated by JSDoc on -
- - - - 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 deleted file mode 100644 index 64e9e5943..000000000 --- a/web/server/h2o/libh2o/misc/oktavia/templates/jsdoc3/tmpl/mainpage.tmpl +++ /dev/null @@ -1,14 +0,0 @@ - - - -

- - - -
-
-
- 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 deleted file mode 100644 index c76f772cc..000000000 --- a/web/server/h2o/libh2o/misc/oktavia/templates/jsdoc3/tmpl/members.tmpl +++ /dev/null @@ -1,22 +0,0 @@ - -
-

- - -

- -
-
- -
- -
- - - - - -
Example 1? 's':'' ?>
- - -
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 deleted file mode 100644 index 1eb9032d2..000000000 --- a/web/server/h2o/libh2o/misc/oktavia/templates/jsdoc3/tmpl/method.tmpl +++ /dev/null @@ -1,76 +0,0 @@ - -
-

- - -

- -
-
- - -
- -
- - - -
Type:
-
    -
  • - -
  • -
- - - -
This:
-
- - - -
Parameters:
- - - - - - -
Fires:
-
    - -
- - - -
Throws:
- 1) { ?>
    -
  • -
- - - - -
Returns:
- 1) { ?>
    -
  • -
- - - - -
Example 1? 's':'' ?>
- - -
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 deleted file mode 100644 index ca81f8f8f..000000000 --- a/web/server/h2o/libh2o/misc/oktavia/templates/jsdoc3/tmpl/params.tmpl +++ /dev/null @@ -1,108 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeArgumentDefaultDescription
- - - - - - <optional>
- - - - <nullable>
- -
- - - - -
Properties
- -
\ 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 deleted file mode 100644 index dfa6ee0e9..000000000 --- a/web/server/h2o/libh2o/misc/oktavia/templates/jsdoc3/tmpl/properties.tmpl +++ /dev/null @@ -1,107 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeArgumentDefaultDescription
- - - - - - <optional>
- - - - <nullable>
- -
- - - - -
Properties
-
\ 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 deleted file mode 100644 index 32e059ed4..000000000 --- a/web/server/h2o/libh2o/misc/oktavia/templates/jsdoc3/tmpl/returns.tmpl +++ /dev/null @@ -1,19 +0,0 @@ - -
- -
- - - -
-
- Type -
-
- -
-
- \ 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 deleted file mode 100644 index e1092ef29..000000000 --- a/web/server/h2o/libh2o/misc/oktavia/templates/jsdoc3/tmpl/source.tmpl +++ /dev/null @@ -1,8 +0,0 @@ - -
-
-
-
-
\ 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 deleted file mode 100644 index b0c79c1dd..000000000 --- a/web/server/h2o/libh2o/misc/oktavia/templates/jsdoc3/tmpl/tutorial.tmpl +++ /dev/null @@ -1,19 +0,0 @@ -
- -
- 0) { ?> -
    -
  • -
- - -

-
- -
- -
- -
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 deleted file mode 100644 index db8194d6d..000000000 --- a/web/server/h2o/libh2o/misc/oktavia/templates/jsdoc3/tmpl/type.tmpl +++ /dev/null @@ -1,7 +0,0 @@ - - -| - \ 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 deleted file mode 100644 index bd1efb8c5..000000000 --- a/web/server/h2o/libh2o/misc/oktavia/templates/sphinx/_static/oktavia-jquery-ui.js +++ /dev/null @@ -1,521 +0,0 @@ -/** - * @fileOverview - * A UI script that creates search form, loads an index files and show search results. - * It needs jQuery and oktavia-search.js or oktavia-*-search.js - * (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 = $('').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 = $('
', { "class": "entry" }); - var link = $('', { "href": url + this.engine.getHighlight$() }).text(result.title); - link.bind('click', clearCallback); - entry.append($('
', { "class": "title" }).append(link)); - entry.append($('
', { "class": "url" }).text(url)); - entry.append($('
', { "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 = $('
', {"class": "proposal"}); - listitem.append('Search with: '); - var option = $('', {"class": "option"}); - option.html(proposal.label); - option.bind('click', createCallback(proposal.options)); - listitem.append(option); - listitem.append(' → ' + proposal.count + ' results.'); - 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 option 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. 'false' or 'disable' 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.submit(function (event) { - event.stopPropagation(); - setTimeout(function () { - view.search(); - }, 10); - return false; - }); - this.append(form); - var resultForm = $([ - '
', - '', - '
', - '
', - '
', - '
' - ].join('')); - if (data.logo) - { - resultForm.append($('Powered by
Oktavia')); - } - 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 deleted file mode 100644 index fce9732a7..000000000 --- a/web/server/h2o/libh2o/misc/oktavia/templates/sphinx/_static/oktavia-search.js +++ /dev/null @@ -1,6795 +0,0 @@ -// 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.} */ - 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.} - */ -OktaviaSearch.prototype.pageIndexes$ = function () { - /** @type {Array.} */ - 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.} - */ -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.} */ - var results; - /** @type {!number} */ - var i; - /** @type {SearchUnit} */ - var unit; - /** @type {Array.} */ - var info; - /** @type {!string} */ - var content; - /** @type {Array.} */ - 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('*').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('
'); - } else { - text = content.slice(0, end - start) + ' ...
'; - } - text = text.replace(Oktavia.eob, ' ').replace(/()()+/, '

'); - 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.} - */ -OktaviaSearch.prototype.getProposals$ = function () { - /** @type {Style} */ - var style; - /** @type {Array.} */ - var results; - /** @type {!number} */ - var i; - /** @type {Proposal} */ - var proposal; - /** @type {Array.} */ - var label; - /** @type {Array.} */ - 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('' + this._queries[j].toString() + '')); - option.push(this._queries[j].toString()); - } else { - label.push(style.convert$S('' + this._queries[j].toString() + '')); - } - } - results.push(({options: option.join(' '), label: label.join(' '), count: proposal.expect})); - } - } - } - return results; -}; - -/** - * @param {SearchSummary} summary - * @return {Array.} - */ -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.} 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.} */ - 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.} 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.} */ - 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.} */ - 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.} */ - 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.} */ - 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.} - */ -Oktavia.prototype.rawSearch$SB = function (keyword, stemming) { - /** @type {Array.} */ - var result; - /** @type {!string} */ - var baseWord; - /** @type {Array.} */ - 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.} 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.} */ - 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.} */ - 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.} */ - 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.} */ - 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.} */ - var charCodes; - /** @type {!number} */ - var i; - /** @type {!number} */ - var charCode; - /** @type {Array.} */ - 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.} strList - * @return {!string} - */ -Binary.dumpStringList$AS = function (strList) { - return Binary$dumpStringList$ASLCompressionReport$(strList, null); -}; - -var Binary$dumpStringList$AS = Binary.dumpStringList$AS; - -/** - * @param {Array.} strList - * @param {CompressionReport} report - * @return {!string} - */ -Binary.dumpStringList$ASLCompressionReport$ = function (strList, report) { - /** @type {Array.} */ - 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.>} strMap - * @return {!string} - */ -Binary.dumpStringListMap$HAS = function (strMap) { - return Binary$dumpStringListMap$HASLCompressionReport$(strMap, null); -}; - -var Binary$dumpStringListMap$HAS = Binary.dumpStringListMap$HAS; - -/** - * @param {Object.>} strMap - * @param {CompressionReport} report - * @return {!string} - */ -Binary.dumpStringListMap$HASLCompressionReport$ = function (strMap, report) { - /** @type {Array.} */ - 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.} array - * @return {!string} - */ -Binary.dump32bitNumberList$AN = function (array) { - return Binary$dump32bitNumberList$ANLCompressionReport$(array, null); -}; - -var Binary$dump32bitNumberList$AN = Binary.dump32bitNumberList$AN; - -/** - * @param {Array.} array - * @param {CompressionReport} report - * @return {!string} - */ -Binary.dump32bitNumberList$ANLCompressionReport$ = function (array, report) { - /** @type {Array.} */ - 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.} 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.} */ - 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.} 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.} 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.} array - * @param {!number} offset - * @param {!number} length - * @return {!string} - */ -Binary._nonZeroBlock$ANII = function (array, offset, length) { - /** @type {Array.} */ - 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.} array - * @param {!number} offset - * @return {!string} - */ -Binary._createZebraCode$ANI = function (array, offset) { - /** @type {!number} */ - var last; - /** @type {!number} */ - var code; - /** @type {Array.} */ - 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.} */ - var out; - /** @type {Array.} */ - 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.} source - * @return {!string} - */ -Binary._mergeCharCode$AI = function (source) { - /** @type {Array.} */ - 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.} */ - 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.} */ - 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.} */ - 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.} */ - 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.} */ - 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.} - */ -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.} */ - 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.} - */ -SearchUnit.getPositions$LSearchUnit$ = function ($this) { - /** @type {Array.} */ - 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.} */ - var unitIds$0; - /** @type {Array.} */ - 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.} 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.} - */ -SearchSummary.getProposal$LSearchSummary$ = function ($this) { - /** @type {Array.} */ - var proposals; - /** @type {!number} */ - var i; - /** @type {Array.} */ - 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.} - */ -SearchSummary.getSortedResult$LSearchSummary$ = function ($this) { - /** @type {Array.} */ - var result; - /** @type {Array.} */ - 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.} 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.} */ - 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.} */ - 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.} 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.} 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.} 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.} - */ -Table.prototype.getCell$I = function (position) { - /** @type {!number} */ - var row; - /** @type {!number} */ - var currentColumn; - /** @type {!number} */ - var lastRowColumn; - /** @type {!number} */ - var startPosition; - /** @type {Array.} */ - 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.} - */ -Table.prototype.getRowContent$I = function (rowIndex) { - /** @type {!string} */ - var content; - /** @type {Array.} */ - var values; - /** @type {Object.} */ - 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.} 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.} 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.} */ - 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.} */ - var pos; - pos = [ ]; - return this.getRows$SAI(key, pos); -}; - -/** - * @param {!string} key - * @param {Array.} 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.} */ - 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.} */ - 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.} - */ -FMIndex.prototype.search$S = function (keyword) { - /** @type {Array.} */ - var result; - /** @type {Array.} */ - 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.} */ - 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.} 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.>} 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, "
").replace(/&/g, "&").replace(/"/g, """).replace(//g, ">"); -}; - -var _HTMLHandler$escapeHTML$S = _HTMLHandler.escapeHTML$S; - -/** - * @param {!string} tagname - * @param {Object.} 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, "
").replace(/&/g, "&").replace(/"/g, """).replace(//g, ">")); - } 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.} */ - var charclass$0; - /** @type {Object.} */ - var charclass$1; - /** @type {RegExp} */ - var charclass$2; - /** @type {Object.} */ - var charclass$3; - /** @type {Object.} */ - var charclass$4; - /** @type {Object.} */ - var charclass$5; - /** @type {!string} */ - var text$0; - /** @type {Object.} */ - var charclass$6; - /** @type {RegExp} */ - var charclass$7; - /** @type {Object.} */ - var charclass$8; - /** @type {Object.} */ - var charclass$9; - /** @type {RegExp} */ - var charclass$10; - /** @type {Object.} */ - var charclass$11; - /** @type {RegExp} */ - var charclass$12; - /** @type {Object.} */ - var charclass$13; - /** @type {RegExp} */ - var charclass$14; - /** @type {Object.} */ - var charclass$15; - /** @type {Object.} */ - var charclass$16; - /** @type {Object.} */ - var charclass$17; - /** @type {Object.} */ - var charclass$18; - /** @type {RegExp} */ - var charclass$19; - /** @type {RegExp} */ - var charclass$20; - /** @type {Object.} */ - var charclass$21; - /** @type {Object.} */ - var charclass$22; - /** @type {Object.} */ - var charclass$23; - /** @type {Object.} */ - 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 += "") { - this.closeTag$(); - } else { - charclass$20 = _.nameBody; - if (charclass$20.test(c)) { - this.tagName += c; - } else { - if (this.script) { - this.script += "") { - 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.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.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.} - */ -Char.prototype._charClass$S = function (str) { - /** @type {Object.} */ - 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.} 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.} 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.} - */ -_Entities.entity_list$ = function () { - /** @type {Object.} */ - 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.} */ - var _v$0; - /** @type {Array.} */ - 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.} */ - 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.} */ - 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.} */ - var _bv$0; - /** @type {Array.} */ - 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.} */ - var range_tmp; - /** @type {!number} */ - var code; - /** @type {!boolean} */ - var bit; - /** @type {!number} */ - var key; - /** @type {Object.} */ - 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.} */ - 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.} */ - var contents; - /** @type {!number} */ - var i; - /** @type {Array.} */ - 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.} */ - var contents; - /** @type {!number} */ - var i; - /** @type {Array.} */ - 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.} input - * @return {Object.} - */ -WaveletMatrix._shallow_copy$HI = function (input) { - /** @type {Object.} */ - 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.} */ - 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.} */ - 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.} array - */ -function OArray$AI(array) { - this.array = array; - this.offset = 0; -}; - -OArray$AI.prototype = new OArray; - -/** - * @constructor - * @param {Array.} 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.} */ - 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.} */ - 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.} 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.} SA - * @param {OArray} s - * @param {Array.} 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.} SA - * @param {OArray} s - * @param {Array.} 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.} - */ -SAIS.make$S = function (source) { - /** @type {Array.} */ - var charCodes; - /** @type {!number} */ - var maxCode; - /** @type {!number} */ - var i; - /** @type {!number} */ - var code; - /** @type {Array.} */ - 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.} 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.} */ - 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.} */ - 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': [ '', '' ], 'url': [ '', '' ], 'hit': [ '', '' ], 'del': [ '', '' ], 'summary': [ '', '' ] }); -}); -$__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 deleted file mode 100644 index a3d51d436..000000000 --- a/web/server/h2o/libh2o/misc/oktavia/templates/sphinx/_static/searchstyle.css +++ /dev/null @@ -1,174 +0,0 @@ -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 deleted file mode 100644 index bb36ee1f4..000000000 --- a/web/server/h2o/libh2o/misc/oktavia/templates/sphinx/_templates/layout.html +++ /dev/null @@ -1,12 +0,0 @@ -{% extends "!layout.html" %} - -{% block sidebarlogo %} -{{ super() }} -
- - - -

Search by Oktavia

-
-
-{% 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 deleted file mode 100644 index e69de29bb..000000000 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 deleted file mode 100644 index bd1efb8c5..000000000 --- a/web/server/h2o/libh2o/misc/oktavia/templates/tinkerer/_static/oktavia-jquery-ui.js +++ /dev/null @@ -1,521 +0,0 @@ -/** - * @fileOverview - * A UI script that creates search form, loads an index files and show search results. - * It needs jQuery and oktavia-search.js or oktavia-*-search.js - * (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 = $('').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 = $('
', { "class": "entry" }); - var link = $('', { "href": url + this.engine.getHighlight$() }).text(result.title); - link.bind('click', clearCallback); - entry.append($('
', { "class": "title" }).append(link)); - entry.append($('
', { "class": "url" }).text(url)); - entry.append($('
', { "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 = $('
', {"class": "proposal"}); - listitem.append('Search with: '); - var option = $('', {"class": "option"}); - option.html(proposal.label); - option.bind('click', createCallback(proposal.options)); - listitem.append(option); - listitem.append(' → ' + proposal.count + ' results.'); - 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 option 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. 'false' or 'disable' 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.submit(function (event) { - event.stopPropagation(); - setTimeout(function () { - view.search(); - }, 10); - return false; - }); - this.append(form); - var resultForm = $([ - '
', - '', - '
', - '
', - '
', - '
' - ].join('')); - if (data.logo) - { - resultForm.append($('Powered by
Oktavia')); - } - 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 deleted file mode 100644 index fce9732a7..000000000 --- a/web/server/h2o/libh2o/misc/oktavia/templates/tinkerer/_static/oktavia-search.js +++ /dev/null @@ -1,6795 +0,0 @@ -// 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.} */ - 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.} - */ -OktaviaSearch.prototype.pageIndexes$ = function () { - /** @type {Array.} */ - 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.} - */ -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.} */ - var results; - /** @type {!number} */ - var i; - /** @type {SearchUnit} */ - var unit; - /** @type {Array.} */ - var info; - /** @type {!string} */ - var content; - /** @type {Array.} */ - 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('*').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('
'); - } else { - text = content.slice(0, end - start) + ' ...
'; - } - text = text.replace(Oktavia.eob, ' ').replace(/()()+/, '

'); - 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.} - */ -OktaviaSearch.prototype.getProposals$ = function () { - /** @type {Style} */ - var style; - /** @type {Array.} */ - var results; - /** @type {!number} */ - var i; - /** @type {Proposal} */ - var proposal; - /** @type {Array.} */ - var label; - /** @type {Array.} */ - 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('' + this._queries[j].toString() + '')); - option.push(this._queries[j].toString()); - } else { - label.push(style.convert$S('' + this._queries[j].toString() + '')); - } - } - results.push(({options: option.join(' '), label: label.join(' '), count: proposal.expect})); - } - } - } - return results; -}; - -/** - * @param {SearchSummary} summary - * @return {Array.} - */ -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.} 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.} */ - 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.} 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.} */ - 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.} */ - 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.} */ - 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.} */ - 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.} - */ -Oktavia.prototype.rawSearch$SB = function (keyword, stemming) { - /** @type {Array.} */ - var result; - /** @type {!string} */ - var baseWord; - /** @type {Array.} */ - 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.} 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.} */ - 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.} */ - 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.} */ - 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.} */ - 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.} */ - var charCodes; - /** @type {!number} */ - var i; - /** @type {!number} */ - var charCode; - /** @type {Array.} */ - 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.} strList - * @return {!string} - */ -Binary.dumpStringList$AS = function (strList) { - return Binary$dumpStringList$ASLCompressionReport$(strList, null); -}; - -var Binary$dumpStringList$AS = Binary.dumpStringList$AS; - -/** - * @param {Array.} strList - * @param {CompressionReport} report - * @return {!string} - */ -Binary.dumpStringList$ASLCompressionReport$ = function (strList, report) { - /** @type {Array.} */ - 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.>} strMap - * @return {!string} - */ -Binary.dumpStringListMap$HAS = function (strMap) { - return Binary$dumpStringListMap$HASLCompressionReport$(strMap, null); -}; - -var Binary$dumpStringListMap$HAS = Binary.dumpStringListMap$HAS; - -/** - * @param {Object.>} strMap - * @param {CompressionReport} report - * @return {!string} - */ -Binary.dumpStringListMap$HASLCompressionReport$ = function (strMap, report) { - /** @type {Array.} */ - 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.} array - * @return {!string} - */ -Binary.dump32bitNumberList$AN = function (array) { - return Binary$dump32bitNumberList$ANLCompressionReport$(array, null); -}; - -var Binary$dump32bitNumberList$AN = Binary.dump32bitNumberList$AN; - -/** - * @param {Array.} array - * @param {CompressionReport} report - * @return {!string} - */ -Binary.dump32bitNumberList$ANLCompressionReport$ = function (array, report) { - /** @type {Array.} */ - 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.} 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.} */ - 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.} 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.} 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.} array - * @param {!number} offset - * @param {!number} length - * @return {!string} - */ -Binary._nonZeroBlock$ANII = function (array, offset, length) { - /** @type {Array.} */ - 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.} array - * @param {!number} offset - * @return {!string} - */ -Binary._createZebraCode$ANI = function (array, offset) { - /** @type {!number} */ - var last; - /** @type {!number} */ - var code; - /** @type {Array.} */ - 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.} */ - var out; - /** @type {Array.} */ - 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.} source - * @return {!string} - */ -Binary._mergeCharCode$AI = function (source) { - /** @type {Array.} */ - 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.} */ - 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.} */ - 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.} */ - 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.} */ - 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.} */ - 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.} - */ -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.} */ - 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.} - */ -SearchUnit.getPositions$LSearchUnit$ = function ($this) { - /** @type {Array.} */ - 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.} */ - var unitIds$0; - /** @type {Array.} */ - 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.} 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.} - */ -SearchSummary.getProposal$LSearchSummary$ = function ($this) { - /** @type {Array.} */ - var proposals; - /** @type {!number} */ - var i; - /** @type {Array.} */ - 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.} - */ -SearchSummary.getSortedResult$LSearchSummary$ = function ($this) { - /** @type {Array.} */ - var result; - /** @type {Array.} */ - 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.} 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.} */ - 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.} */ - 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.} 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.} 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.} 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.} - */ -Table.prototype.getCell$I = function (position) { - /** @type {!number} */ - var row; - /** @type {!number} */ - var currentColumn; - /** @type {!number} */ - var lastRowColumn; - /** @type {!number} */ - var startPosition; - /** @type {Array.} */ - 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.} - */ -Table.prototype.getRowContent$I = function (rowIndex) { - /** @type {!string} */ - var content; - /** @type {Array.} */ - var values; - /** @type {Object.} */ - 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.} 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.} 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.} */ - 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.} */ - var pos; - pos = [ ]; - return this.getRows$SAI(key, pos); -}; - -/** - * @param {!string} key - * @param {Array.} 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.} */ - 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.} */ - 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.} - */ -FMIndex.prototype.search$S = function (keyword) { - /** @type {Array.} */ - var result; - /** @type {Array.} */ - 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.} */ - 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.} 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.>} 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, "
").replace(/&/g, "&").replace(/"/g, """).replace(//g, ">"); -}; - -var _HTMLHandler$escapeHTML$S = _HTMLHandler.escapeHTML$S; - -/** - * @param {!string} tagname - * @param {Object.} 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, "
").replace(/&/g, "&").replace(/"/g, """).replace(//g, ">")); - } 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.} */ - var charclass$0; - /** @type {Object.} */ - var charclass$1; - /** @type {RegExp} */ - var charclass$2; - /** @type {Object.} */ - var charclass$3; - /** @type {Object.} */ - var charclass$4; - /** @type {Object.} */ - var charclass$5; - /** @type {!string} */ - var text$0; - /** @type {Object.} */ - var charclass$6; - /** @type {RegExp} */ - var charclass$7; - /** @type {Object.} */ - var charclass$8; - /** @type {Object.} */ - var charclass$9; - /** @type {RegExp} */ - var charclass$10; - /** @type {Object.} */ - var charclass$11; - /** @type {RegExp} */ - var charclass$12; - /** @type {Object.} */ - var charclass$13; - /** @type {RegExp} */ - var charclass$14; - /** @type {Object.} */ - var charclass$15; - /** @type {Object.} */ - var charclass$16; - /** @type {Object.} */ - var charclass$17; - /** @type {Object.} */ - var charclass$18; - /** @type {RegExp} */ - var charclass$19; - /** @type {RegExp} */ - var charclass$20; - /** @type {Object.} */ - var charclass$21; - /** @type {Object.} */ - var charclass$22; - /** @type {Object.} */ - var charclass$23; - /** @type {Object.} */ - 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 += "") { - this.closeTag$(); - } else { - charclass$20 = _.nameBody; - if (charclass$20.test(c)) { - this.tagName += c; - } else { - if (this.script) { - this.script += "") { - 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.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.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.} - */ -Char.prototype._charClass$S = function (str) { - /** @type {Object.} */ - 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.} 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.} 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.} - */ -_Entities.entity_list$ = function () { - /** @type {Object.} */ - 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.} */ - var _v$0; - /** @type {Array.} */ - 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.} */ - 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.} */ - 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.} */ - var _bv$0; - /** @type {Array.} */ - 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.} */ - var range_tmp; - /** @type {!number} */ - var code; - /** @type {!boolean} */ - var bit; - /** @type {!number} */ - var key; - /** @type {Object.} */ - 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.} */ - 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.} */ - var contents; - /** @type {!number} */ - var i; - /** @type {Array.} */ - 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.} */ - var contents; - /** @type {!number} */ - var i; - /** @type {Array.} */ - 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.} input - * @return {Object.} - */ -WaveletMatrix._shallow_copy$HI = function (input) { - /** @type {Object.} */ - 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.} */ - 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.} */ - 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.} array - */ -function OArray$AI(array) { - this.array = array; - this.offset = 0; -}; - -OArray$AI.prototype = new OArray; - -/** - * @constructor - * @param {Array.} 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.} */ - 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.} */ - 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.} 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.} SA - * @param {OArray} s - * @param {Array.} 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.} SA - * @param {OArray} s - * @param {Array.} 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.} - */ -SAIS.make$S = function (source) { - /** @type {Array.} */ - var charCodes; - /** @type {!number} */ - var maxCode; - /** @type {!number} */ - var i; - /** @type {!number} */ - var code; - /** @type {Array.} */ - 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.} 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.} */ - 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.} */ - 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': [ '', '' ], 'url': [ '', '' ], 'hit': [ '', '' ], 'del': [ '', '' ], 'summary': [ '', '' ] }); -}); -$__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 deleted file mode 100644 index a3d51d436..000000000 --- a/web/server/h2o/libh2o/misc/oktavia/templates/tinkerer/_static/searchstyle.css +++ /dev/null @@ -1,174 +0,0 @@ -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 deleted file mode 100644 index 30bf86267..000000000 --- a/web/server/h2o/libh2o/misc/oktavia/templates/tinkerer/_templates/oktaviasearch.html +++ /dev/null @@ -1,8 +0,0 @@ -
-

Search by Oktavia

- - - -
-
- 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 deleted file mode 100644 index 25882e340..000000000 --- a/web/server/h2o/libh2o/misc/oktavia/test/test-binary-util.jsx +++ /dev/null @@ -1,190 +0,0 @@ -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 deleted file mode 100644 index 18f80b645..000000000 --- a/web/server/h2o/libh2o/misc/oktavia/test/test-bit-vector.jsx +++ /dev/null @@ -1,131 +0,0 @@ -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 deleted file mode 100644 index 6a033e589..000000000 --- a/web/server/h2o/libh2o/misc/oktavia/test/test-burrows-wheeler-transform.jsx +++ /dev/null @@ -1,24 +0,0 @@ -/** - * 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 deleted file mode 100644 index 80035a61f..000000000 --- a/web/server/h2o/libh2o/misc/oktavia/test/test-fm-index.jsx +++ /dev/null @@ -1,250 +0,0 @@ -/** - * 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.; - 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.; - 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 deleted file mode 100644 index 63731b924..000000000 --- a/web/server/h2o/libh2o/misc/oktavia/test/test-getopt.jsx +++ /dev/null @@ -1,84 +0,0 @@ -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 deleted file mode 100644 index f5f562c7d..000000000 --- a/web/server/h2o/libh2o/misc/oktavia/test/test-oktavia-block.jsx +++ /dev/null @@ -1,226 +0,0 @@ -/** - * 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 deleted file mode 100644 index 0c37afeaa..000000000 --- a/web/server/h2o/libh2o/misc/oktavia/test/test-oktavia-section.jsx +++ /dev/null @@ -1,235 +0,0 @@ -/** - * 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 deleted file mode 100644 index 859eb9112..000000000 --- a/web/server/h2o/libh2o/misc/oktavia/test/test-oktavia-splitter.jsx +++ /dev/null @@ -1,173 +0,0 @@ -/** - * 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 deleted file mode 100644 index d8d1d74eb..000000000 --- a/web/server/h2o/libh2o/misc/oktavia/test/test-oktavia-stemming.jsx +++ /dev/null @@ -1,55 +0,0 @@ -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 deleted file mode 100644 index ee2aa0975..000000000 --- a/web/server/h2o/libh2o/misc/oktavia/test/test-oktavia-table.jsx +++ /dev/null @@ -1,213 +0,0 @@ -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 deleted file mode 100644 index c04ac46e4..000000000 --- a/web/server/h2o/libh2o/misc/oktavia/test/test-query-parser.jsx +++ /dev/null @@ -1,92 +0,0 @@ -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 deleted file mode 100644 index 94ec7c193..000000000 --- a/web/server/h2o/libh2o/misc/oktavia/test/test-query-string-parser.jsx +++ /dev/null @@ -1,94 +0,0 @@ -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 deleted file mode 100644 index 8310bf0a7..000000000 --- a/web/server/h2o/libh2o/misc/oktavia/test/test-sax.jsx +++ /dev/null @@ -1,147 +0,0 @@ -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.) : 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(''); - this.expect(this.events[1]).toBe('ondoctype'); - this.expect(this.param1[1]).toBe('html'); - } - - function test_tag1 () : void - { - this.parser.parse(''); - 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(''); - 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(''); - 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('hello world'); - this.expect(this.events[3]).toBe('ontext'); - this.expect(this.param1[3]).toBe('hello world'); - } - - function test_comment () : void - { - this.parser.parse(''); - 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 deleted file mode 100644 index 81bcc05d0..000000000 --- a/web/server/h2o/libh2o/misc/oktavia/test/test-search-result.jsx +++ /dev/null @@ -1,159 +0,0 @@ -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 deleted file mode 100644 index 049d18d89..000000000 --- a/web/server/h2o/libh2o/misc/oktavia/test/test-wavelet-matrix.jsx +++ /dev/null @@ -1,143 +0,0 @@ -/** - * 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 deleted file mode 100644 index 7415d7468..000000000 --- a/web/server/h2o/libh2o/misc/oktavia/testdata/jsx_literal.txt +++ /dev/null @@ -1,65 +0,0 @@ -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 deleted file mode 100644 index 7b79f9324..000000000 --- a/web/server/h2o/libh2o/misc/oktavia/testdata/jsx_operator.txt +++ /dev/null @@ -1,68 +0,0 @@ -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. array: Array. -index: number -map[key] Nullable. map: Map. -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. -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 deleted file mode 100644 index c55778dc1..000000000 --- a/web/server/h2o/libh2o/misc/oktavia/testdata/jsx_primitive_type.txt +++ /dev/null @@ -1,68 +0,0 @@ -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. and Map.. - -Nullable. -Nullable. -Nullable. -(Nullable.) -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. - -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. 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.; // creates an empty array of numbers -new Array.(length); // creates an array of given length (elements are initialized to null) -[] : Array.; // creates an empty array of numbers -[ 1, 2, 3 ]; // creates an array of numbers with three elements: 1, 2, 3 -Map. - -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.; // creates an empty map of strings to numbers -{} : Map.; // 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 deleted file mode 100644 index 538238a39..000000000 --- a/web/server/h2o/libh2o/misc/oktavia/testdata/jsx_tutorial.txt +++ /dev/null @@ -1,213 +0,0 @@ -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.; -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.#shift() is Nullable.. 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); - } - -} - - - - Hello, world! - - - -

- - -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 deleted file mode 100644 index ec138bb32..000000000 --- a/web/server/h2o/libh2o/misc/oktavia/testdata/jsx_typeconversion.txt +++ /dev/null @@ -1,40 +0,0 @@ -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 deleted file mode 100644 index a4d7451e5..000000000 --- a/web/server/h2o/libh2o/misc/oktavia/tool/httpstatus.jsx +++ /dev/null @@ -1,130 +0,0 @@ -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 deleted file mode 100644 index f2593bc9e..000000000 --- a/web/server/h2o/libh2o/misc/oktavia/tool/oktavia-mkindex.jsx +++ /dev/null @@ -1,470 +0,0 @@ -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. = null; - var wordsplitter : Nullable. = null; - var cacheDensity : number = 5.0; - var name = null : Nullable.; - 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. = null; - if (algorithm) - { - stemmer = _Main._createStemmer(algorithm); - } - var dump = null : Nullable.; - 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 deleted file mode 100644 index 719c71b86..000000000 --- a/web/server/h2o/libh2o/misc/oktavia/tool/oktavia-search.jsx +++ /dev/null @@ -1,370 +0,0 @@ -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.) : 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('' + info[0] + '') + ' ' + style.convert('' + info[1] + '')); - 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('*').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.size() as string) + " results.\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('' + query[j] + '')); - } - else - { - //querywords.push(style.convert('' + query[j] + '')); - } - } - console.log("* Expected result: " + querywords.join(" ") + " - " + (proposal.expect as string) + " hit"); - } - } - else - { - console.log(style.convert("Your search - " + query[0] + " - 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. = null; - var showhelp = false; - var notrun = false; - var styleType = 'console'; - var num : int = 250; - var queryStrings = [] : string[]; - var algorithm : Nullable. = 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 deleted file mode 100644 index f9b867511..000000000 --- a/web/server/h2o/libh2o/misc/oktavia/tool/search_simple.jsx +++ /dev/null @@ -1,39 +0,0 @@ -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 deleted file mode 100644 index 98dba01dd..000000000 --- a/web/server/h2o/libh2o/misc/oktavia/tool/web/oktavia-danish-search.jsx +++ /dev/null @@ -1,10 +0,0 @@ -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 deleted file mode 100644 index 117f2cce4..000000000 --- a/web/server/h2o/libh2o/misc/oktavia/tool/web/oktavia-dutch-search.jsx +++ /dev/null @@ -1,10 +0,0 @@ -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 deleted file mode 100644 index d30ad2ccf..000000000 --- a/web/server/h2o/libh2o/misc/oktavia/tool/web/oktavia-english-search.jsx +++ /dev/null @@ -1,10 +0,0 @@ -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 deleted file mode 100644 index 640063958..000000000 --- a/web/server/h2o/libh2o/misc/oktavia/tool/web/oktavia-finnish-search.jsx +++ /dev/null @@ -1,10 +0,0 @@ -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 deleted file mode 100644 index 777f5e2a3..000000000 --- a/web/server/h2o/libh2o/misc/oktavia/tool/web/oktavia-french-search.jsx +++ /dev/null @@ -1,10 +0,0 @@ -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 deleted file mode 100644 index 588318704..000000000 --- a/web/server/h2o/libh2o/misc/oktavia/tool/web/oktavia-german-search.jsx +++ /dev/null @@ -1,10 +0,0 @@ -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 deleted file mode 100644 index a14fe3450..000000000 --- a/web/server/h2o/libh2o/misc/oktavia/tool/web/oktavia-hungarian-search.jsx +++ /dev/null @@ -1,10 +0,0 @@ -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 deleted file mode 100644 index 30769d1a6..000000000 --- a/web/server/h2o/libh2o/misc/oktavia/tool/web/oktavia-italian-search.jsx +++ /dev/null @@ -1,10 +0,0 @@ -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 deleted file mode 100644 index 180e6b045..000000000 --- a/web/server/h2o/libh2o/misc/oktavia/tool/web/oktavia-norwegian-search.jsx +++ /dev/null @@ -1,10 +0,0 @@ -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 deleted file mode 100644 index ba1de086e..000000000 --- a/web/server/h2o/libh2o/misc/oktavia/tool/web/oktavia-porter-search.jsx +++ /dev/null @@ -1,10 +0,0 @@ -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 deleted file mode 100644 index 89ed1a0f8..000000000 --- a/web/server/h2o/libh2o/misc/oktavia/tool/web/oktavia-portuguese-search.jsx +++ /dev/null @@ -1,10 +0,0 @@ -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 deleted file mode 100644 index ef8b47fca..000000000 --- a/web/server/h2o/libh2o/misc/oktavia/tool/web/oktavia-romanian-search.jsx +++ /dev/null @@ -1,10 +0,0 @@ -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 deleted file mode 100644 index 2a572d712..000000000 --- a/web/server/h2o/libh2o/misc/oktavia/tool/web/oktavia-russian-search.jsx +++ /dev/null @@ -1,10 +0,0 @@ -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 deleted file mode 100644 index 22dc3f779..000000000 --- a/web/server/h2o/libh2o/misc/oktavia/tool/web/oktavia-search.jsx +++ /dev/null @@ -1,327 +0,0 @@ -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. = null; - static var _instance : Nullable. = null; - var _queryString : Nullable.; - var _queries : Query[]; - var _highlight : string; - var _callback : Nullable.; - 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('*').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('
'); - } - else - { - text = content.slice(0, end - start) + ' ...
'; - } - text = text.replace(Oktavia.eob, ' ').replace(/()()+/, '

'); - 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('' + this._queries[j].toString() + '')); - option.push(this._queries[j].toString()); - } - else - { - label.push(style.convert('' + this._queries[j].toString() + '')); - } - } - results.push(new _Proposal(option.join(' '), label.join(' '), 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 deleted file mode 100644 index 3ad9b8d1e..000000000 --- a/web/server/h2o/libh2o/misc/oktavia/tool/web/oktavia-spanish-search.jsx +++ /dev/null @@ -1,10 +0,0 @@ -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 deleted file mode 100644 index 9b900a484..000000000 --- a/web/server/h2o/libh2o/misc/oktavia/tool/web/oktavia-swedish-search.jsx +++ /dev/null @@ -1,10 +0,0 @@ -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 deleted file mode 100644 index 24d040584..000000000 --- a/web/server/h2o/libh2o/misc/oktavia/tool/web/oktavia-turkish-search.jsx +++ /dev/null @@ -1,10 +0,0 @@ -import "oktavia-search.jsx"; -import "stemmer/turkish-stemmer.jsx"; - -class _Main -{ - static function main(args : string[]) : void - { - OktaviaSearch.setStemmer(new TurkishStemmer); - } -} -- cgit v1.2.3