From 40cf2ddac597fb863ab5528d6bd9cabd4b637e9c Mon Sep 17 00:00:00 2001 From: Paolo Insogna Date: Wed, 4 Jan 2023 08:34:43 +0100 Subject: [PATCH] chore: Move tokenizer back to lyra. --- .swcrc | 4 - package.json | 8 +- src/algorithms.ts | 50 - src/errors.ts | 3 + src/index.ts | 4 +- src/tokenizer/diacritics.ts | 81 - src/tokenizer/errors.ts | 15 - src/tokenizer/index.ts | 203 -- src/tokenizer/languages.ts | 28 - src/tokenizer/stop-words/de.ts | 233 -- src/tokenizer/stop-words/dk.ts | 96 - src/tokenizer/stop-words/en.ts | 204 -- src/tokenizer/stop-words/es.ts | 310 --- src/tokenizer/stop-words/fi.ts | 237 -- src/tokenizer/stop-words/fr.ts | 167 -- src/tokenizer/stop-words/index.ts | 34 - src/tokenizer/stop-words/it.ts | 281 --- src/tokenizer/stop-words/nl.ts | 103 - src/tokenizer/stop-words/no.ts | 178 -- src/tokenizer/stop-words/pt.ts | 205 -- src/tokenizer/stop-words/ru.ts | 161 -- src/tokenizer/stop-words/se.ts | 116 - src/types.ts | 3 - src/wasm.ts | 17 +- stemmer/README.md | 6 - stemmer/lib/am.d.ts | 1 - stemmer/lib/am.js | 449 ---- stemmer/lib/ar.d.ts | 1 - stemmer/lib/ar.js | 996 --------- stemmer/lib/de.d.ts | 1 - stemmer/lib/de.js | 460 ---- stemmer/lib/dk.d.ts | 1 - stemmer/lib/dk.js | 335 --- stemmer/lib/en.d.ts | 1 - stemmer/lib/en.js | 189 -- stemmer/lib/es.d.ts | 1 - stemmer/lib/es.js | 704 ------ stemmer/lib/fi.d.ts | 1 - stemmer/lib/fi.js | 565 ----- stemmer/lib/fr.d.ts | 1 - stemmer/lib/fr.js | 875 -------- stemmer/lib/gr.d.ts | 1 - stemmer/lib/gr.js | 1873 ---------------- stemmer/lib/hu.d.ts | 1 - stemmer/lib/hu.js | 572 ----- stemmer/lib/id.d.ts | 1 - stemmer/lib/id.js | 416 ---- stemmer/lib/ie.d.ts | 1 - stemmer/lib/ie.js | 402 ---- stemmer/lib/in.d.ts | 1 - stemmer/lib/in.js | 344 --- stemmer/lib/it.d.ts | 1 - stemmer/lib/it.js | 711 ------ stemmer/lib/lt.d.ts | 1 - stemmer/lib/lt.js | 586 ----- stemmer/lib/nl.d.ts | 1 - stemmer/lib/nl.js | 494 ---- stemmer/lib/no.d.ts | 1 - stemmer/lib/no.js | 319 --- stemmer/lib/np.d.ts | 7 - stemmer/lib/np.js | 382 ---- stemmer/lib/pt.d.ts | 7 - stemmer/lib/pt.js | 673 ------ stemmer/lib/ro.d.ts | 1 - stemmer/lib/ro.js | 699 ------ stemmer/lib/rs.d.ts | 1 - stemmer/lib/rs.js | 3464 ----------------------------- stemmer/lib/ru.d.ts | 1 - stemmer/lib/ru.js | 523 ----- stemmer/lib/se.d.ts | 1 - stemmer/lib/se.js | 335 --- stemmer/lib/tr.d.ts | 1 - stemmer/lib/tr.js | 1260 ----------- tests/algorithms.test.ts | 67 +- tests/config/c8-ci.json | 2 +- tests/config/c8-local.json | 2 +- tests/diacritics.test.ts | 22 - tests/tokenizer.test.ts | 525 ----- tsconfig.json | 6 +- 79 files changed, 26 insertions(+), 21007 deletions(-) delete mode 100644 src/algorithms.ts create mode 100644 src/errors.ts delete mode 100644 src/tokenizer/diacritics.ts delete mode 100644 src/tokenizer/errors.ts delete mode 100644 src/tokenizer/index.ts delete mode 100644 src/tokenizer/languages.ts delete mode 100644 src/tokenizer/stop-words/de.ts delete mode 100644 src/tokenizer/stop-words/dk.ts delete mode 100644 src/tokenizer/stop-words/en.ts delete mode 100644 src/tokenizer/stop-words/es.ts delete mode 100644 src/tokenizer/stop-words/fi.ts delete mode 100644 src/tokenizer/stop-words/fr.ts delete mode 100644 src/tokenizer/stop-words/index.ts delete mode 100644 src/tokenizer/stop-words/it.ts delete mode 100644 src/tokenizer/stop-words/nl.ts delete mode 100644 src/tokenizer/stop-words/no.ts delete mode 100644 src/tokenizer/stop-words/pt.ts delete mode 100644 src/tokenizer/stop-words/ru.ts delete mode 100644 src/tokenizer/stop-words/se.ts delete mode 100644 src/types.ts delete mode 100644 stemmer/README.md delete mode 100644 stemmer/lib/am.d.ts delete mode 100644 stemmer/lib/am.js delete mode 100644 stemmer/lib/ar.d.ts delete mode 100644 stemmer/lib/ar.js delete mode 100644 stemmer/lib/de.d.ts delete mode 100644 stemmer/lib/de.js delete mode 100644 stemmer/lib/dk.d.ts delete mode 100644 stemmer/lib/dk.js delete mode 100644 stemmer/lib/en.d.ts delete mode 100644 stemmer/lib/en.js delete mode 100644 stemmer/lib/es.d.ts delete mode 100644 stemmer/lib/es.js delete mode 100644 stemmer/lib/fi.d.ts delete mode 100644 stemmer/lib/fi.js delete mode 100644 stemmer/lib/fr.d.ts delete mode 100644 stemmer/lib/fr.js delete mode 100644 stemmer/lib/gr.d.ts delete mode 100644 stemmer/lib/gr.js delete mode 100644 stemmer/lib/hu.d.ts delete mode 100644 stemmer/lib/hu.js delete mode 100644 stemmer/lib/id.d.ts delete mode 100644 stemmer/lib/id.js delete mode 100644 stemmer/lib/ie.d.ts delete mode 100644 stemmer/lib/ie.js delete mode 100644 stemmer/lib/in.d.ts delete mode 100644 stemmer/lib/in.js delete mode 100644 stemmer/lib/it.d.ts delete mode 100644 stemmer/lib/it.js delete mode 100644 stemmer/lib/lt.d.ts delete mode 100644 stemmer/lib/lt.js delete mode 100644 stemmer/lib/nl.d.ts delete mode 100644 stemmer/lib/nl.js delete mode 100644 stemmer/lib/no.d.ts delete mode 100644 stemmer/lib/no.js delete mode 100644 stemmer/lib/np.d.ts delete mode 100644 stemmer/lib/np.js delete mode 100644 stemmer/lib/pt.d.ts delete mode 100644 stemmer/lib/pt.js delete mode 100644 stemmer/lib/ro.d.ts delete mode 100644 stemmer/lib/ro.js delete mode 100644 stemmer/lib/rs.d.ts delete mode 100644 stemmer/lib/rs.js delete mode 100644 stemmer/lib/ru.d.ts delete mode 100644 stemmer/lib/ru.js delete mode 100644 stemmer/lib/se.d.ts delete mode 100644 stemmer/lib/se.js delete mode 100644 stemmer/lib/tr.d.ts delete mode 100644 stemmer/lib/tr.js delete mode 100644 tests/diacritics.test.ts delete mode 100644 tests/tokenizer.test.ts diff --git a/.swcrc b/.swcrc index c348e53..c65ba06 100644 --- a/.swcrc +++ b/.swcrc @@ -10,10 +10,6 @@ "syntax": "typescript", "tsx": false, "dynamicImport": true - }, - "baseUrl": ".", - "paths": { - "@stemmer/*": ["./src/stemmer/*"] } }, "sourceMaps": true diff --git a/package.json b/package.json index b92f533..e2441ac 100644 --- a/package.json +++ b/package.json @@ -9,10 +9,6 @@ "types": "./dist/index.d.ts", "import": "./dist/index.js" }, - "./stemmer/*": { - "types": "./dist/stemmer/*.d.ts", - "import": "./dist/stemmer/*.js" - }, "./wasm": { "types": "./dist/wasm.d.ts", "require": "./dist/wasm.js" @@ -30,12 +26,12 @@ "url": "https://github.com/lyrasearch/components" }, "scripts": { - "predev": "rm -rf dist && mkdir dist && cp -a stemmer/lib dist/stemmer", + "predev": "rm -rf dist && mkdir dist", "dev": "swc -s -w -d dist src", "prebuild": "npm run lint", "build": "swc --delete-dir-on-start -d dist src", "build:wasm": "node ./rust/scripts/wasm.mjs", - "postbuild": "npm run build:wasm && tsc -p . --emitDeclarationOnly && cp -a stemmer/lib dist/stemmer", + "postbuild": "npm run build:wasm && tsc -p . --emitDeclarationOnly", "format": "prettier -w src rust/scripts", "lint": "eslint src rust/scripts --ext .ts,.mjs", "test": "c8 -c tests/config/c8-local.json tap --rcfile=tests/config/tap.yml tests/*.test.ts", diff --git a/src/algorithms.ts b/src/algorithms.ts deleted file mode 100644 index f02c349..0000000 --- a/src/algorithms.ts +++ /dev/null @@ -1,50 +0,0 @@ -import { TokenScore } from "./types.js"; - -// Adapted from https://github.com/lovasoa/fast_array_intersect -// MIT Licensed (https://github.com/lovasoa/fast_array_intersect/blob/master/LICENSE) -// while on tag https://github.com/lovasoa/fast_array_intersect/tree/v1.1.0 -export function intersectTokenScores({ data: arrays }: { data: TokenScore[][] }): { data: TokenScore[] } { - if (arrays.length === 0) return { data: [] }; - - for (let i = 1; i < arrays.length; i++) { - if (arrays[i].length < arrays[0].length) { - const tmp = arrays[0]; - arrays[0] = arrays[i]; - arrays[i] = tmp; - } - } - - const set: Map = new Map(); - for (const elem of arrays[0]) { - set.set(elem[0], [1, elem[1]]); - } - - const arrLength = arrays.length; - for (let i = 1; i < arrLength; i++) { - let found = 0; - for (const elem of arrays[i]) { - /* c8 ignore next */ - const key = elem[0] ?? ""; - - const [count, score] = set.get(key) ?? [0, 0]; - if (count === i) { - set.set(key, [count + 1, score + elem[1]]); - found++; - } - } - - if (found === 0) { - return { data: [] }; - } - } - - const result: TokenScore[] = []; - - for (const [token, [count, score]] of set) { - if (count === arrLength) { - result.push([token, score]); - } - } - - return { data: result }; -} diff --git a/src/errors.ts b/src/errors.ts new file mode 100644 index 0000000..148e8bc --- /dev/null +++ b/src/errors.ts @@ -0,0 +1,3 @@ +export function INVALID_RUNTIME(type: string): string { + return `Unsupported runtime "${type}".`; +} diff --git a/src/index.ts b/src/index.ts index c117be5..4b9e605 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,3 +1 @@ -export * from "./algorithms.js"; -export * from "./tokenizer/index.js"; -export * from "./types.js"; +export * as wasm from "./wasm.js"; diff --git a/src/tokenizer/diacritics.ts b/src/tokenizer/diacritics.ts deleted file mode 100644 index 4763452..0000000 --- a/src/tokenizer/diacritics.ts +++ /dev/null @@ -1,81 +0,0 @@ -const DIACRITICS_CHARCODE_START = 192; -const DIACRITICS_CHARCODE_END = 252; - -const CHARCODE_REPLACE_MAPPING = [ - 65, - 65, - 65, - 65, - 65, - 65, - 65, - 67, - 69, - 69, - 69, - 69, - 73, - 73, - 73, - 73, - null, - 78, - 79, - 79, - 79, - 79, - 79, - 79, - 79, - 85, - 85, - 85, - 85, - null, - null, - null, - 97, - 97, - 97, - 97, - 97, - 97, - 97, - 99, - 101, - 101, - 101, - 101, - 105, - 105, - 105, - 105, - null, - 110, - 111, - 111, - 111, - 111, - 111, - 111, - 111, - 117, - 117, - 117, - 117, -]; - -function replaceChar(charCode: number): number { - if (charCode < DIACRITICS_CHARCODE_START || charCode > DIACRITICS_CHARCODE_END) return charCode; - - /* c8 ignore next */ - return CHARCODE_REPLACE_MAPPING[charCode - DIACRITICS_CHARCODE_START] || charCode; -} - -export function replaceDiacritics(str: string): string { - const stringCharCode = []; - for (let idx = 0; idx < str.length; idx++) { - stringCharCode[idx] = replaceChar(str.charCodeAt(idx)); - } - return String.fromCharCode(...stringCharCode); -} diff --git a/src/tokenizer/errors.ts b/src/tokenizer/errors.ts deleted file mode 100644 index a0b41fb..0000000 --- a/src/tokenizer/errors.ts +++ /dev/null @@ -1,15 +0,0 @@ -export function CUSTOM_STOP_WORDS_ARRAY_MUST_BE_STRING_ARRAY(): string { - return `Custom stop words array must only contain strings.`; -} - -export function CUSTOM_STOP_WORDS_MUST_BE_FUNCTION_OR_ARRAY(): string { - return `Custom stop words must be a function or an array of strings.`; -} - -export function INVALID_STEMMER_FUNCTION_TYPE(): string { - return `tokenizer.stemmingFn property must be a function.`; -} - -export function INVALID_TOKENIZER_FUNCTION(): string { - return `tokenizer.tokenizerFn must be a function.`; -} diff --git a/src/tokenizer/index.ts b/src/tokenizer/index.ts deleted file mode 100644 index 5f1c131..0000000 --- a/src/tokenizer/index.ts +++ /dev/null @@ -1,203 +0,0 @@ -import { stemmer } from "../../stemmer/lib/en.js"; - -import { replaceDiacritics } from "./diacritics.js"; -import * as ERRORS from "./errors.js"; -import type { Language } from "./languages.js"; -import { availableStopWords, stopWords } from "./stop-words/index.js"; - -export * from "./diacritics.js"; -export * from "./errors.js"; -export * from "./languages.js"; - -export type Stemmer = (word: string) => string; - -export type TokenizerConfig = { - enableStemming?: boolean; - enableStopWords?: boolean; - customStopWords?: ((stopWords: string[]) => string[]) | string[]; - stemmingFn?: Stemmer; - tokenizerFn?: Tokenizer; -}; - -export type TokenizerConfigExec = { - enableStemming: boolean; - enableStopWords: boolean; - customStopWords: string[]; - stemmingFn?: Stemmer; - tokenizerFn: Tokenizer; -}; - -export type Tokenizer = ( - text: string, - language: Language, - allowDuplicates: boolean, - tokenizerConfig: TokenizerConfig, - frequency?: boolean, -) => string[]; - -const splitRegex: Record = { - dutch: /[^a-z0-9_'-]+/gim, - english: /[^a-z0-9_'-]+/gim, - french: /[^a-z0-9äâàéèëêïîöôùüûœç-]+/gim, - italian: /[^a-z0-9_'-]+/gim, - norwegian: /[^a-z0-9_æøåÆØÅäÄöÖüÜ]+/gim, - portuguese: /[^a-zà-úÀ-Ú]/gim, - russian: /[^a-zа-яА-ЯёЁ]+/gim, - spanish: /[^a-zA-Zá-úÁ-ÚñÑüÜ]+/gim, - swedish: /[^a-z0-9_åÅäÄöÖüÜ-]+/gim, - german: /[^a-zA-ZäöüÄÖÜß]+/gim, - finnish: /[^a-z0-9äöÄÖ]+/gim, - danish: /[^a-z0-9æøåÆØÅ]+/gim, - hungarian: /[^a-z0-9áéíóöőúüűÁÉÍÓÖŐÚÜŰ]+/gim, - romanian: /[^a-z0-9ăâîșțĂÂÎȘȚ]+/gim, - serbian: /[^a-z0-9čćžšđČĆŽŠĐ]+/gim, - turkish: /[^a-z0-9çÇğĞıİöÖşŞüÜ]+/gim, - lithuanian: /[^a-z0-9ąčęėįšųūžĄČĘĖĮŠŲŪŽ]+/gim, - arabic: /[^a-z0-9أ-ي]+/gim, - nepali: /[^a-z0-9अ-ह]+/gim, - irish: /[^a-z0-9áéíóúÁÉÍÓÚ]+/gim, - indian: /[^a-z0-9अ-ह]+/gim, - armenian: /[^a-z0-9ա-ֆ]+/gim, - greek: /[^a-z0-9α-ωά-ώ]+/gim, - indonesian: /[^a-z0-9]+/gim, -}; - -export const normalizationCache = new Map(); - -function normalizeToken(token: string, language: Language, tokenizerConfig: TokenizerConfig): string { - const key = `${language}:${token}`; - - if (normalizationCache.has(key)) { - return normalizationCache.get(key)!; - } - // Check if stop-words removal is enabled - if (tokenizerConfig?.enableStopWords) { - // Remove stop-words - if ((tokenizerConfig.customStopWords as string[]).includes(token)) { - const token = ""; - normalizationCache.set(key, token); - return token; - } - } - - // Check if stemming is enabled - if (tokenizerConfig?.enableStemming) { - // Stem token when a stemming function is available - if (typeof tokenizerConfig?.stemmingFn === "function") { - token = tokenizerConfig?.stemmingFn(token); - } - } - - token = replaceDiacritics(token); - normalizationCache.set(key, token); - return token; -} - -/* c8 ignore next 10 */ -function trim(text: string[]): string[] { - while (text[text.length - 1] === "") { - text.pop(); - } - while (text[0] === "") { - text.shift(); - } - return text; -} - -export function tokenize( - input: string, - language: Language = "english", - allowDuplicates = false, - tokenizerConfig: TokenizerConfig = defaultTokenizerConfig(language), -) { - /* c8 ignore next 3 */ - if (typeof input !== "string") { - return [input]; - } - - const splitRule = splitRegex[language]; - const tokens = input - .toLowerCase() - .split(splitRule) - .map(token => normalizeToken(token, language, tokenizerConfig!)) - .filter(Boolean); - - const trimTokens = trim(tokens); - - if (!allowDuplicates) { - return Array.from(new Set(trimTokens)); - } - - return trimTokens; -} - -export function defaultTokenizerConfig(language: Language, tokenizerConfig: TokenizerConfig = {}): TokenizerConfigExec { - let defaultStopWords: string[] = []; - let customStopWords: string[] = []; - let defaultStemmingFn: Stemmer | undefined; - let defaultTokenizerFn: Tokenizer = tokenize; - - // Enable custom tokenizer function - if (tokenizerConfig?.tokenizerFn) { - if (typeof tokenizerConfig.tokenizerFn !== "function") { - throw Error(ERRORS.INVALID_TOKENIZER_FUNCTION()); - } - /* c8 ignore next 4 */ - defaultTokenizerFn = tokenizerConfig.tokenizerFn; - - // If there's no custom tokenizer, we can proceed setting custom - // stemming functions and stop-words. - } else { - // Enable custom stemming function - if (tokenizerConfig?.stemmingFn) { - if (typeof tokenizerConfig.stemmingFn !== "function") { - throw Error(ERRORS.INVALID_STEMMER_FUNCTION_TYPE()); - } - defaultStemmingFn = tokenizerConfig.stemmingFn; - } else { - defaultStemmingFn = stemmer; - } - - // Enable default stop-words - - if (availableStopWords.includes(language)) { - /* c8 ignore next */ - defaultStopWords = stopWords[language] ?? []; - } - - if (tokenizerConfig?.customStopWords) { - switch (typeof tokenizerConfig.customStopWords) { - // Execute the custom step-words function. - // This will pass the default step-words for a given language as a first parameter. - case "function": - customStopWords = tokenizerConfig.customStopWords(defaultStopWords); - break; - - // Check if the custom step-words is an array. - // If it's an object, throw an exception. If the array contains any non-string value, throw an exception. - case "object": - if (!Array.isArray(tokenizerConfig.customStopWords)) { - throw Error(ERRORS.CUSTOM_STOP_WORDS_MUST_BE_FUNCTION_OR_ARRAY()); - } - customStopWords = tokenizerConfig.customStopWords as string[]; - if (customStopWords.some(x => typeof x !== "string")) { - throw Error(ERRORS.CUSTOM_STOP_WORDS_ARRAY_MUST_BE_STRING_ARRAY()); - } - break; - - // By default, throw an exception, as this is a misconfiguration. - default: - throw Error(ERRORS.CUSTOM_STOP_WORDS_MUST_BE_FUNCTION_OR_ARRAY()); - } - } - } - - return { - /* c8 ignore next 5 */ - enableStopWords: tokenizerConfig?.enableStopWords ?? true, - enableStemming: tokenizerConfig?.enableStemming ?? true, - stemmingFn: defaultStemmingFn, - customStopWords: customStopWords ?? defaultStopWords, - tokenizerFn: defaultTokenizerFn, - }; -} diff --git a/src/tokenizer/languages.ts b/src/tokenizer/languages.ts deleted file mode 100644 index c067654..0000000 --- a/src/tokenizer/languages.ts +++ /dev/null @@ -1,28 +0,0 @@ -export type Language = typeof SUPPORTED_LANGUAGES[number]; - -export const SUPPORTED_LANGUAGES = [ - "arabic", - "armenian", - "dutch", - "english", - "french", - "greek", - "indonesian", - "italian", - "irish", - "indian", - "lithuanian", - "nepali", - "norwegian", - "portuguese", - "russian", - "spanish", - "swedish", - "german", - "finnish", - "danish", - "hungarian", - "romanian", - "serbian", - "turkish", -] as const; diff --git a/src/tokenizer/stop-words/de.ts b/src/tokenizer/stop-words/de.ts deleted file mode 100644 index d66ffd5..0000000 --- a/src/tokenizer/stop-words/de.ts +++ /dev/null @@ -1,233 +0,0 @@ -export const de = [ - "aber", - "alle", - "allem", - "allen", - "aller", - "alles", - "als", - "also", - "am", - "an", - "ander", - "andere", - "anderem", - "anderen", - "anderer", - "anderes", - "anderm", - "andern", - "anderr", - "anders", - "auch", - "auf", - "aus", - "bei", - "bin", - "bis", - "bist", - "da", - "damit", - "dann", - "der", - "den", - "des", - "dem", - "die", - "das", - "daß", - "derselbe", - "derselben", - "denselben", - "desselben", - "demselben", - "dieselbe", - "dieselben", - "dasselbe", - "dazu", - "dein", - "deine", - "deinem", - "deinen", - "deiner", - "deines", - "denn", - "derer", - "dessen", - "dich", - "dir", - "du", - "dies", - "diese", - "diesem", - "diesen", - "dieser", - "dieses", - "doch", - "dort", - "durch", - "ein", - "eine", - "einem", - "einen", - "einer", - "eines", - "einig", - "einige", - "einigem", - "einigen", - "einiger", - "einiges", - "einmal", - "er", - "ihn", - "ihm", - "es", - "etwas", - "euer", - "eure", - "eurem", - "euren", - "eurer", - "eures", - "für", - "gegen", - "gewesen", - "hab", - "habe", - "haben", - "hat", - "hatte", - "hatten", - "hier", - "hin", - "hinter", - "ich", - "mich", - "mir", - "ihr", - "ihre", - "ihrem", - "ihren", - "ihrer", - "ihres", - "euch", - "im", - "in", - "indem", - "ins", - "ist", - "jede", - "jedem", - "jeden", - "jeder", - "jedes", - "jene", - "jenem", - "jenen", - "jener", - "jenes", - "jetzt", - "kann", - "kein", - "keine", - "keinem", - "keinen", - "keiner", - "keines", - "können", - "könnte", - "machen", - "man", - "manche", - "manchem", - "manchen", - "mancher", - "manches", - "mein", - "meine", - "meinem", - "meinen", - "meiner", - "meines", - "mit", - "muss", - "musste", - "nach", - "nicht", - "nichts", - "noch", - "nun", - "nur", - "ob", - "oder", - "ohne", - "sehr", - "sein", - "seine", - "seinem", - "seinen", - "seiner", - "seines", - "selbst", - "sich", - "sie", - "ihnen", - "sind", - "so", - "solche", - "solchem", - "solchen", - "solcher", - "solches", - "soll", - "sollte", - "sondern", - "sonst", - "über", - "um", - "und", - "uns", - "unse", - "unsem", - "unsen", - "unser", - "unses", - "unter", - "viel", - "vom", - "von", - "vor", - "während", - "war", - "waren", - "warst", - "was", - "weg", - "weil", - "weiter", - "welche", - "welchem", - "welchen", - "welcher", - "welches", - "wenn", - "werde", - "werden", - "wie", - "wieder", - "will", - "wir", - "wird", - "wirst", - "wo", - "wollen", - "wollte", - "würde", - "würden", - "zu", - "zum", - "zur", - "zwar", - "zwischen", -]; diff --git a/src/tokenizer/stop-words/dk.ts b/src/tokenizer/stop-words/dk.ts deleted file mode 100644 index e249ed9..0000000 --- a/src/tokenizer/stop-words/dk.ts +++ /dev/null @@ -1,96 +0,0 @@ -export const dk = [ - "og", - "i", - "jeg", - "det", - "at", - "en", - "den", - "til", - "er", - "som", - "på", - "de", - "med", - "han", - "af", - "for", - "ikke", - "der", - "var", - "mig", - "sig", - "men", - "et", - "har", - "om", - "vi", - "min", - "havde", - "ham", - "hun", - "nu", - "over", - "da", - "fra", - "du", - "ud", - "sin", - "dem", - "os", - "op", - "man", - "hans", - "hvor", - "eller", - "hvad", - "skal", - "selv", - "her", - "alle", - "vil", - "blev", - "kunne", - "ind", - "når", - "være", - "dog", - "noget", - "ville", - "jo", - "deres", - "efter", - "ned", - "skulle", - "denne", - "end", - "dette", - "mit", - "også", - "under", - "have", - "dig", - "anden", - "hende", - "mine", - "alt", - "meget", - "sit", - "sine", - "vor", - "mod", - "disse", - "hvis", - "din", - "nogle", - "hos", - "blive", - "mange", - "ad", - "bliver", - "hendes", - "været", - "thi", - "jer", - "sådan", -]; diff --git a/src/tokenizer/stop-words/en.ts b/src/tokenizer/stop-words/en.ts deleted file mode 100644 index cced16a..0000000 --- a/src/tokenizer/stop-words/en.ts +++ /dev/null @@ -1,204 +0,0 @@ -export const en = [ - "i", - "me", - "my", - "myself", - "we", - "us", - "our", - "ours", - "ourselves", - - "you", - "your", - "yours", - "yourself", - "yourselves", - - "he", - "him", - "his", - "himself", - - "she", - "her", - "hers", - "herself", - "it", - "its", - "itself", - - "they", - "them", - "their", - "theirs", - "themselves", - - "what", - "which", - "who", - "whom", - "this", - "that", - "these", - "those", - - "am", - "is", - "are", - "was", - "were", - "be", - "been", - "being", - - "have", - "has", - "had", - "having", - - "do", - "does", - "did", - "doing", - - "will", - "would", - - "shall", - "should", - "can", - "could", - - "may", - "might", - "must", - "ought", - - "i'm", - "you're", - "he's", - "she's", - "it's", - "we're", - "they're", - "i've", - "you've", - "we've", - "they've", - "i'd", - "you'd", - "he'd", - "she'd", - "we'd", - "they'd", - "i'll", - "you'll", - "he'll", - "she'll", - "we'll", - "they'll", - - "isn't", - "aren't", - "wasn't", - "weren't", - "hasn't", - "haven't", - "hadn't", - "doesn't", - "don't", - "didn't", - - "won't", - "wouldn't", - "shan't", - "shouldn't", - "can't", - "cannot", - "couldn't", - "mustn't", - - "let's", - "that's", - "who's", - "what's", - "here's", - "there's", - "when's", - "where's", - "why's", - "how's", - - "an", - "the", - - "and", - "but", - "if", - "or", - "because", - "as", - "until", - "while", - - "of", - "at", - "by", - "for", - "with", - "about", - "against", - "between", - "into", - "through", - "during", - "before", - "after", - "above", - "below", - "to", - "from", - "up", - "down", - "in", - "out", - "on", - "off", - "over", - "under", - - "again", - "further", - "then", - "once", - - "here", - "there", - "when", - "where", - "why", - "how", - - "all", - "any", - "both", - "each", - "few", - "more", - "most", - "other", - "some", - "such", - - "no", - "nor", - "not", - "only", - "own", - "same", - "so", - "than", - "too", - "very", -]; diff --git a/src/tokenizer/stop-words/es.ts b/src/tokenizer/stop-words/es.ts deleted file mode 100644 index fe61a99..0000000 --- a/src/tokenizer/stop-words/es.ts +++ /dev/null @@ -1,310 +0,0 @@ -export const es = [ - "de", - "la", - "que", - "el", - "en", - "y", - "a", - "los", - "del", - "se", - "las", - "por", - "un", - "para", - "con", - "no", - "una", - "su", - "al", - "lo", - "como", - "más", - "pero", - "sus", - "le", - "ya", - "o", - "este", - "sí", - "porque", - "esta", - "entre", - "cuando", - "muy", - "sin", - "sobre", - "también", - "me", - "hasta", - "hay", - "donde", - "quien", - "desde", - "todo", - "nos", - "durante", - "todos", - "uno", - "les", - "ni", - "contra", - "otros", - "ese", - "eso", - "ante", - "ellos", - "e", - "esto", - "mí", - "antes", - "algunos", - "qué", - "unos", - "yo", - "otro", - "otras", - "otra", - "él", - "tanto", - "esa", - "estos", - "mucho", - "quienes", - "nada", - "muchos", - "cual", - "poco", - "ella", - "estar", - "estas", - "algunas", - "algo", - "nosotros", - "mi", - "mis", - "tú", - "te", - "ti", - "tu", - "tus", - "ellas", - "nosotras", - "vosotros", - "vosotras", - "os", - "mío", - "mía", - "míos", - "mías", - "tuyo", - "tuya", - "tuyos", - "tuyas", - "suyo", - "suya", - "suyos", - "suyas", - "nuestro", - "nuestra", - "nuestros", - "nuestras", - "vuestro", - "vuestra", - "vuestros", - "vuestras", - "esos", - "esas", - "estoy", - "estás", - "está", - "estamos", - "estáis", - "están", - "esté", - "estés", - "estemos", - "estéis", - "estén", - "estaré", - "estarás", - "estará", - "estaremos", - "estaréis", - "estarán", - "estaría", - "estarías", - "estaríamos", - "estaríais", - "estarían", - "estaba", - "estabas", - "estábamos", - "estabais", - "estaban", - "estuve", - "estuviste", - "estuvo", - "estuvimos", - "estuvisteis", - "estuvieron", - "estuviera", - "estuvieras", - "estuviéramos", - "estuvierais", - "estuvieran", - "estuviese", - "estuvieses", - "estuviésemos", - "estuvieseis", - "estuviesen", - "estando", - "estado", - "estada", - "estados", - "estadas", - "estad", - "he", - "has", - "ha", - "hemos", - "habéis", - "han", - "haya", - "hayas", - "hayamos", - "hayáis", - "hayan", - "habré", - "habrás", - "habrá", - "habremos", - "habréis", - "habrán", - "habría", - "habrías", - "habríamos", - "habríais", - "habrían", - "había", - "habías", - "habíamos", - "habíais", - "habían", - "hube", - "hubiste", - "hubo", - "hubimos", - "hubisteis", - "hubieron", - "hubiera", - "hubieras", - "hubiéramos", - "hubierais", - "hubieran", - "hubiese", - "hubieses", - "hubiésemos", - "hubieseis", - "hubiesen", - "habiendo", - "habido", - "habida", - "habidos", - "habidas", - "soy", - "eres", - "es", - "somos", - "sois", - "son", - "sea", - "seas", - "seamos", - "seáis", - "sean", - "seré", - "serás", - "será", - "seremos", - "seréis", - "serán", - "sería", - "serías", - "seríamos", - "seríais", - "serían", - "era", - "eras", - "éramos", - "erais", - "eran", - "fui", - "fuiste", - "fue", - "fuimos", - "fuisteis", - "fueron", - "fuera", - "fueras", - "fuéramos", - "fuerais", - "fueran", - "fuese", - "fueses", - "fuésemos", - "fueseis", - "fuesen", - "siendo", - "sido", - "tengo", - "tienes", - "tiene", - "tenemos", - "tenéis", - "tienen", - "tenga", - "tengas", - "tengamos", - "tengáis", - "tengan", - "tendré", - "tendrás", - "tendrá", - "tendremos", - "tendréis", - "tendrán", - "tendría", - "tendrías", - "tendríamos", - "tendríais", - "tendrían", - "tenía", - "tenías", - "teníamos", - "teníais", - "tenían", - "tuve", - "tuviste", - "tuvo", - "tuvimos", - "tuvisteis", - "tuvieron", - "tuviera", - "tuvieras", - "tuviéramos", - "tuvierais", - "tuvieran", - "tuviese", - "tuvieses", - "tuviésemos", - "tuvieseis", - "tuviesen", - "teniendo", - "tenido", - "tenida", - "tenidos", - "tenidas", - "tened", -]; diff --git a/src/tokenizer/stop-words/fi.ts b/src/tokenizer/stop-words/fi.ts deleted file mode 100644 index 5c77341..0000000 --- a/src/tokenizer/stop-words/fi.ts +++ /dev/null @@ -1,237 +0,0 @@ -export const fi = [ - "olla", - "olen", - "olet", - "on", - "olemme", - "olette", - "ovat", - "ole", - "oli", - "olisi", - "olisit", - "olisin", - "olisimme", - "olisitte", - "olisivat", - "olit", - "olin", - "olimme", - "olitte", - "olivat", - "ollut", - "olleet", - "en", - "et", - "ei", - "emme", - "ette", - "eivät", - "minä", - "minun", - "minut", - "minua", - "minussa", - "minusta", - "minuun", - "minulla", - "minulta", - "minulle", - "sinä", - "sinun", - "sinut", - "sinua", - "sinussa", - "sinusta", - "sinuun", - "sinulla", - "sinulta", - "sinulle", - "hän", - "hänen", - "hänet", - "häntä", - "hänessä", - "hänestä", - "häneen", - "hänellä", - "häneltä", - "hänelle", - "me", - "meidän", - "meidät", - "meitä", - "meissä", - "meistä", - "meihin", - "meillä", - "meiltä", - "meille", - "te", - "teidän", - "teidät", - "teitä", - "teissä", - "teistä", - "teihin", - "teillä", - "teiltä", - "teille", - "he", - "heidän", - "heidät", - "heitä", - "heissä", - "heistä", - "heihin", - "heillä", - "heiltä", - "heille", - "tämä", - "tämän", - "tätä", - "tässä", - "tästä", - "tähän", - "tällä", - "tältä", - "tälle", - "tänä", - "täksi", - "tuo", - "tuon", - "tuota", - "tuossa", - "tuosta", - "tuohon", - "tuolla", - "tuolta", - "tuolle", - "tuona", - "tuoksi", - "se", - "sen", - "sitä", - "siinä", - "siitä", - "siihen", - "sillä", - "siltä", - "sille", - "sinä", - "siksi", - "nämä", - "näiden", - "näitä", - "näissä", - "näistä", - "näihin", - "näillä", - "näiltä", - "näille", - "näinä", - "näiksi", - "nuo", - "noiden", - "noita", - "noissa", - "noista", - "noihin", - "noilla", - "noilta", - "noille", - "noina", - "noiksi", - "ne", - "niiden", - "niitä", - "niissä", - "niistä", - "niihin", - "niillä", - "niiltä", - "niille", - "niinä", - "niiksi", - "kuka", - "kenen", - "kenet", - "ketä", - "kenessä", - "kenestä", - "keneen", - "kenellä", - "keneltä", - "kenelle", - "kenenä", - "keneksi", - "ketkä", - "keiden", - "ketkä", - "keitä", - "keissä", - "keistä", - "keihin", - "keillä", - "keiltä", - "keille", - "keinä", - "keiksi", - "mikä", - "minkä", - "minkä", - "mitä", - "missä", - "mistä", - "mihin", - "millä", - "miltä", - "mille", - "minä", - "miksi", - "mitkä", - "joka", - "jonka", - "jota", - "jossa", - "josta", - "johon", - "jolla", - "jolta", - "jolle", - "jona", - "joksi", - "jotka", - "joiden", - "joita", - "joissa", - "joista", - "joihin", - "joilla", - "joilta", - "joille", - "joina", - "joiksi", - "että", - "ja", - "jos", - "koska", - "kuin", - "mutta", - "niin", - "sekä", - "sillä", - "tai", - "vaan", - "vai", - "vaikka", - "kanssa", - "mukaan", - "noin", - "poikki", - "yli", - "kun", - "niin", - "nyt", - "itse", -]; diff --git a/src/tokenizer/stop-words/fr.ts b/src/tokenizer/stop-words/fr.ts deleted file mode 100644 index d676066..0000000 --- a/src/tokenizer/stop-words/fr.ts +++ /dev/null @@ -1,167 +0,0 @@ -export const fr = [ - "au", - "aux", - "avec", - "ce", - "ces", - "dans", - "de", - "des", - "du", - "elle", - "en", - "et", - "eux", - "il", - "je", - "la", - "le", - "leur", - "lui", - "ma", - "mais", - "me", - "même", - "mes", - "moi", - "mon", - "ne", - "nos", - "notre", - "nous", - "on", - "ou", - "par", - "pas", - "pour", - "qu", - "que", - "qui", - "sa", - "se", - "ses", - "son", - "sur", - "ta", - "te", - "tes", - "toi", - "ton", - "tu", - "un", - "une", - "vos", - "votre", - "vous", - "c", - "d", - "j", - "l", - "à", - "m", - "n", - "s", - "t", - "y", - "", - "été", - "étée", - "étées", - "étés", - "étant", - "suis", - "es", - "est", - "sommes", - "êtes", - "sont", - "serai", - "seras", - "sera", - "serons", - "serez", - "seront", - "serais", - "serait", - "serions", - "seriez", - "seraient", - "étais", - "était", - "étions", - "étiez", - "étaient", - "fus", - "fut", - "fûmes", - "fûtes", - "furent", - "sois", - "soit", - "soyons", - "soyez", - "soient", - "fusse", - "fusses", - "fût", - "fussions", - "fussiez", - "fussent", - "ayant", - "eu", - "eue", - "eues", - "eus", - "ai", - "as", - "avons", - "avez", - "ont", - "aurai", - "auras", - "aura", - "aurons", - "aurez", - "auront", - "aurais", - "aurait", - "aurions", - "auriez", - "auraient", - "avais", - "avait", - "avions", - "aviez", - "avaient", - "eut", - "eûmes", - "eûtes", - "eurent", - "aie", - "aies", - "ait", - "ayons", - "ayez", - "aient", - "eusse", - "eusses", - "eût", - "eussions", - "eussiez", - "eussent", - "ceci", - "cela", - "celà", - "cet", - "cette", - "ici", - "ils", - "les", - "leurs", - "quel", - "quels", - "quelle", - "quelles", - "sans", - "soi", -]; diff --git a/src/tokenizer/stop-words/index.ts b/src/tokenizer/stop-words/index.ts deleted file mode 100644 index 2c66967..0000000 --- a/src/tokenizer/stop-words/index.ts +++ /dev/null @@ -1,34 +0,0 @@ -import type { Language } from "../languages.js"; -import { en } from "./en.js"; -import { it } from "./it.js"; -import { fr } from "./fr.js"; -import { es } from "./es.js"; -import { pt } from "./pt.js"; -import { nl } from "./nl.js"; -import { se } from "./se.js"; -import { ru } from "./ru.js"; -import { no } from "./no.js"; -import { de } from "./de.js"; -import { dk } from "./dk.js"; -import { fi } from "./fi.js"; - -type StopWordsMap = { - [key in Language]: string[]; -}; - -export const stopWords: Partial = { - english: en, - italian: it, - french: fr, - spanish: es, - portuguese: pt, - dutch: nl, - swedish: se, - russian: ru, - norwegian: no, - german: de, - danish: dk, - finnish: fi, -}; - -export const availableStopWords = Object.keys(stopWords); diff --git a/src/tokenizer/stop-words/it.ts b/src/tokenizer/stop-words/it.ts deleted file mode 100644 index 524c44f..0000000 --- a/src/tokenizer/stop-words/it.ts +++ /dev/null @@ -1,281 +0,0 @@ -export const it = [ - "ad", - "al", - "allo", - "ai", - "agli", - "all", - "agl", - "alla", - "alle", - "con", - "col", - "coi", - "da", - "dal", - "dallo", - "dai", - "dagli", - "dall", - "dagl", - "dalla", - "dalle", - "di", - "del", - "dello", - "dei", - "degli", - "dell", - "degl", - "della", - "delle", - "in", - "nel", - "nello", - "nei", - "negli", - "nell", - "negl", - "nella", - "nelle", - "su", - "sul", - "sullo", - "sui", - "sugli", - "sull", - "sugl", - "sulla", - "sulle", - "per", - "tra", - "contro", - "io", - "tu", - "lui", - "lei", - "noi", - "voi", - "loro", - "mio", - "mia", - "miei", - "mie", - "tuo", - "tua", - "tuoi", - "tue", - "suo", - "sua", - "suoi", - "sue", - "nostro", - "nostra", - "nostri", - "nostre", - "vostro", - "vostra", - "vostri", - "vostre", - "mi", - "ti", - "ci", - "vi", - "lo", - "la", - "li", - "le", - "gli", - "ne", - "il", - "un", - "uno", - "una", - "ma", - "ed", - "se", - "perché", - "anche", - "come", - "dov", - "dove", - "che", - "chi", - "cui", - "non", - "più", - "quale", - "quanto", - "quanti", - "quanta", - "quante", - "quello", - "quelli", - "quella", - "quelle", - "questo", - "questi", - "questa", - "queste", - "si", - "tutto", - "tutti", - "a", - "c", - "e", - "i", - "l", - "o", - "ho", - "hai", - "ha", - "abbiamo", - "avete", - "hanno", - "abbia", - "abbiate", - "abbiano", - "avrò", - "avrai", - "avrà", - "avremo", - "avrete", - "avranno", - "avrei", - "avresti", - "avrebbe", - "avremmo", - "avreste", - "avrebbero", - "avevo", - "avevi", - "aveva", - "avevamo", - "avevate", - "avevano", - "ebbi", - "avesti", - "ebbe", - "avemmo", - "aveste", - "ebbero", - "avessi", - "avesse", - "avessimo", - "avessero", - "avendo", - "avuto", - "avuta", - "avuti", - "avute", - "sono", - "sei", - "è", - "siamo", - "siete", - "sia", - "siate", - "siano", - "sarò", - "sarai", - "sarà", - "saremo", - "sarete", - "saranno", - "sarei", - "saresti", - "sarebbe", - "saremmo", - "sareste", - "sarebbero", - "ero", - "eri", - "era", - "eravamo", - "eravate", - "erano", - "fui", - "fosti", - "fu", - "fummo", - "foste", - "furono", - "fossi", - "fosse", - "fossimo", - "fossero", - "essendo", - "faccio", - "fai", - "facciamo", - "fanno", - "faccia", - "facciate", - "facciano", - "farò", - "farai", - "farà", - "faremo", - "farete", - "faranno", - "farei", - "faresti", - "farebbe", - "faremmo", - "fareste", - "farebbero", - "facevo", - "facevi", - "faceva", - "facevamo", - "facevate", - "facevano", - "feci", - "facesti", - "fece", - "facemmo", - "faceste", - "fecero", - "facessi", - "facesse", - "facessimo", - "facessero", - "facendo", - "sto", - "stai", - "sta", - "stiamo", - "stanno", - "stia", - "stiate", - "stiano", - "starò", - "starai", - "starà", - "staremo", - "starete", - "staranno", - "starei", - "staresti", - "starebbe", - "staremmo", - "stareste", - "starebbero", - "stavo", - "stavi", - "stava", - "stavamo", - "stavate", - "stavano", - "stetti", - "stesti", - "stette", - "stemmo", - "steste", - "stettero", - "stessi", - "stesse", - "stessimo", - "stessero", - "stando", -]; diff --git a/src/tokenizer/stop-words/nl.ts b/src/tokenizer/stop-words/nl.ts deleted file mode 100644 index dd20b21..0000000 --- a/src/tokenizer/stop-words/nl.ts +++ /dev/null @@ -1,103 +0,0 @@ -export const nl = [ - "de", - "en", - "van", - "ik", - "te", - "dat", - "die", - "in", - "een", - "hij", - "het", - "niet", - "zijn", - "is", - "was", - "op", - "aan", - "met", - "als", - "voor", - "had", - "er", - "maar", - "om", - "hem", - "dan", - "zou", - "of", - "wat", - "mijn", - "men", - "dit", - "zo", - "door", - "over", - "ze", - "zich", - "bij", - "ook", - "tot", - "je", - "mij", - "uit", - "der", - "daar", - "haar", - "naar", - "heb", - "hoe", - "heeft", - "hebben", - "deze", - "u", - "want", - "nog", - "zal", - "me", - "zij", - "nu", - "ge", - "geen", - "omdat", - "iets", - "worden", - "toch", - "al", - "waren", - "veel", - "meer", - "doen", - "toen", - "moet", - "ben", - "zonder", - "kan", - "hun", - "dus", - "alles", - "onder", - "ja", - "eens", - "hier", - "wie", - "werd", - "altijd", - "doch", - "wordt", - "wezen", - "kunnen", - "ons", - "zelf", - "tegen", - "na", - "reeds", - "wil", - "kon", - "niets", - "uw", - "iemand", - "geweest", - "andere", -]; diff --git a/src/tokenizer/stop-words/no.ts b/src/tokenizer/stop-words/no.ts deleted file mode 100644 index 764defd..0000000 --- a/src/tokenizer/stop-words/no.ts +++ /dev/null @@ -1,178 +0,0 @@ -export const no = [ - "og", - "i", - "jeg", - "det", - "at", - "en", - "et", - "den", - "til", - "er", - "som", - "på", - "de", - "med", - "han", - "av", - "ikke", - "ikkje", - "der", - "så", - "var", - "meg", - "seg", - "men", - "ett", - "har", - "om", - "vi", - "min", - "mitt", - "ha", - "hadde", - "hun", - "nå", - "over", - "da", - "ved", - "fra", - "du", - "ut", - "sin", - "dem", - "oss", - "opp", - "man", - "kan", - "hans", - "hvor", - "eller", - "hva", - "skal", - "selv", - "sjøl", - "her", - "alle", - "vil", - "bli", - "ble", - "blei", - "blitt", - "kunne", - "inn", - "når", - "være", - "kom", - "noen", - "noe", - "ville", - "dere", - "som", - "deres", - "kun", - "ja", - "etter", - "ned", - "skulle", - "denne", - "for", - "deg", - "si", - "sine", - "sitt", - "mot", - "å", - "meget", - "hvorfor", - "dette", - "disse", - "uten", - "hvordan", - "ingen", - "din", - "ditt", - "blir", - "samme", - "hvilken", - "hvilke", - "sånn", - "inni", - "mellom", - "vår", - "hver", - "hvem", - "vors", - "hvis", - "både", - "bare", - "enn", - "fordi", - "før", - "mange", - "også", - "slik", - "vært", - "være", - "båe", - "begge", - "siden", - "dykk", - "dykkar", - "dei", - "deira", - "deires", - "deim", - "di", - "då", - "eg", - "ein", - "eit", - "eitt", - "elles", - "honom", - "hjå", - "ho", - "hoe", - "henne", - "hennar", - "hennes", - "hoss", - "hossen", - "ikkje", - "ingi", - "inkje", - "korleis", - "korso", - "kva", - "kvar", - "kvarhelst", - "kven", - "kvi", - "kvifor", - "me", - "medan", - "mi", - "mine", - "mykje", - "no", - "nokon", - "noka", - "nokor", - "noko", - "nokre", - "si", - "sia", - "sidan", - "so", - "somt", - "somme", - "um", - "upp", - "vere", - "vore", - "verte", - "vort", - "varte", - "vart", -]; diff --git a/src/tokenizer/stop-words/pt.ts b/src/tokenizer/stop-words/pt.ts deleted file mode 100644 index 650656e..0000000 --- a/src/tokenizer/stop-words/pt.ts +++ /dev/null @@ -1,205 +0,0 @@ -export const pt = [ - "de", - "a", - "o", - "que", - "e", - "do", - "da", - "em", - "um", - "para", - "com", - "não", - "uma", - "os", - "no", - "se", - "na", - "por", - "mais", - "as", - "dos", - "como", - "mas", - "ao", - "ele", - "das", - "à", - "seu", - "sua", - "ou", - "quando", - "muito", - "nos", - "já", - "eu", - "também", - "só", - "pelo", - "pela", - "até", - "isso", - "ela", - "entre", - "depois", - "sem", - "mesmo", - "aos", - "seus", - "quem", - "nas", - "me", - "esse", - "eles", - "você", - "essa", - "num", - "nem", - "suas", - "meu", - "às", - "minha", - "numa", - "pelos", - "elas", - "qual", - "nós", - "lhe", - "deles", - "essas", - "esses", - "pelas", - "este", - "dele", - "tu", - "te", - "vocês", - "vos", - "lhes", - "meus", - "minhas", - "teu", - "tua", - "teus", - "tuas", - "nosso", - "nossa", - "nossos", - "nossas", - "dela", - "delas", - "esta", - "estes", - "estas", - "aquele", - "aquela", - "aqueles", - "aquelas", - "isto", - "aquilo", - "estou", - "está", - "estamos", - "estão", - "estive", - "esteve", - "estivemos", - "estiveram", - "estava", - "estávamos", - "estavam", - "estivera", - "estivéramos", - "esteja", - "estejamos", - "estejam", - "estivesse", - "estivéssemos", - "estivessem", - "estiver", - "estivermos", - "estiverem", - "hei", - "há", - "havemos", - "hão", - "houve", - "houvemos", - "houveram", - "houvera", - "houvéramos", - "haja", - "hajamos", - "hajam", - "houvesse", - "houvéssemos", - "houvessem", - "houver", - "houvermos", - "houverem", - "houverei", - "houverá", - "houveremos", - "houverão", - "houveria", - "houveríamos", - "houveriam", - "sou", - "somos", - "são", - "era", - "éramos", - "eram", - "fui", - "foi", - "fomos", - "foram", - "fora", - "fôramos", - "seja", - "sejamos", - "sejam", - "fosse", - "fôssemos", - "fossem", - "for", - "formos", - "forem", - "serei", - "será", - "seremos", - "serão", - "seria", - "seríamos", - "seriam", - "tenho", - "tem", - "temos", - "tém", - "tinha", - "tínhamos", - "tinham", - "tive", - "teve", - "tivemos", - "tiveram", - "tivera", - "tivéramos", - "tenha", - "tenhamos", - "tenham", - "tivesse", - "tivéssemos", - "tivessem", - "tiver", - "tivermos", - "tiverem", - "terei", - "terá", - "teremos", - "terão", - "teria", - "teríamos", - "teriam", -]; diff --git a/src/tokenizer/stop-words/ru.ts b/src/tokenizer/stop-words/ru.ts deleted file mode 100644 index 2a53488..0000000 --- a/src/tokenizer/stop-words/ru.ts +++ /dev/null @@ -1,161 +0,0 @@ -export const ru = [ - "и", - "в", - "во", - "не", - "что", - "он", - "на", - "я", - "с", - "со", - "как", - "а", - "то", - "все", - "она", - "так", - "его", - "но", - "да", - "ты", - "к", - "у", - "же", - "вы", - "за", - "бы", - "по", - "только", - "ее", - "мне", - "было", - "вот", - "от", - "меня", - "еще", - "нет", - "о", - "из", - "ему", - "теперь", - "когда", - "даже", - "ну", - "вдруг", - "ли", - "если", - "уже", - "или", - "ни", - "быть", - "был", - "него", - "до", - "вас", - "нибудь", - "опять", - "уж", - "вам", - "сказал", - "ведь", - "там", - "потом", - "себя", - "ничего", - "ей", - "может", - "они", - "тут", - "где", - "есть", - "надо", - "ней", - "для", - "мы", - "тебя", - "их", - "чем", - "была", - "сам", - "чтоб", - "без", - "будто", - "человек", - "чего", - "раз", - "тоже", - "себе", - "под", - "жизнь", - "будет", - "ж", - "тогда", - "кто", - "этот", - "говорил", - "того", - "потому", - "этого", - "какой", - "совсем", - "ним", - "здесь", - "этом", - "один", - "почти", - "мой", - "тем", - "чтобы", - "нее", - "кажется", - "сейчас", - "были", - "куда", - "зачем", - "сказать", - "всех", - "никогда", - "сегодня", - "можно", - "при", - "наконец", - "два", - "об", - "другой", - "хоть", - "после", - "над", - "больше", - "тот", - "через", - "эти", - "нас", - "про", - "всего", - "них", - "какая", - "много", - "разве", - "сказала", - "три", - "эту", - "моя", - "впрочем", - "хорошо", - "свою", - "этой", - "перед", - "иногда", - "лучше", - "чуть", - "том", - "нельзя", - "такой", - "им", - "более", - "всегда", - "конечно", - "всю", - "между", -]; diff --git a/src/tokenizer/stop-words/se.ts b/src/tokenizer/stop-words/se.ts deleted file mode 100644 index 79c484b..0000000 --- a/src/tokenizer/stop-words/se.ts +++ /dev/null @@ -1,116 +0,0 @@ -export const se = [ - "och", - "det", - "att", - "i", - "en", - "jag", - "hon", - "som", - "han", - "på", - "den", - "med", - "var", - "sig", - "för", - "så", - "till", - "är", - "men", - "ett", - "om", - "hade", - "de", - "av", - "icke", - "mig", - "du", - "henne", - "då", - "sin", - "nu", - "har", - "inte", - "hans", - "honom", - "skulle", - "hennes", - "där", - "min", - "man", - "ej", - "vid", - "kunde", - "något", - "från", - "ut", - "när", - "efter", - "upp", - "vi", - "dem", - "vara", - "vad", - "över", - "än", - "dig", - "kan", - "sina", - "här", - "ha", - "mot", - "alla", - "under", - "någon", - "eller", - "allt", - "mycket", - "sedan", - "ju", - "denna", - "själv", - "detta", - "åt", - "utan", - "varit", - "hur", - "ingen", - "mitt", - "ni", - "bli", - "blev", - "oss", - "din", - "dessa", - "några", - "deras", - "blir", - "mina", - "samma", - "vilken", - "er", - "sådan", - "vår", - "blivit", - "dess", - "inom", - "mellan", - "sådant", - "varför", - "varje", - "vilka", - "ditt", - "vem", - "vilket", - "sitta", - "sådana", - "vart", - "dina", - "vars", - "vårt", - "våra", - "ert", - "era", - "vilkas", -]; diff --git a/src/types.ts b/src/types.ts deleted file mode 100644 index c98d9e1..0000000 --- a/src/types.ts +++ /dev/null @@ -1,3 +0,0 @@ -export type TokenScore = [string, number]; - -export type IIntersectTokenScores = (options: { data: TokenScore[][] }) => { data: TokenScore[] }; diff --git a/src/wasm.ts b/src/wasm.ts index 204d8e7..2f09870 100644 --- a/src/wasm.ts +++ b/src/wasm.ts @@ -1,7 +1,11 @@ import { createRequire } from "module"; -import type { IIntersectTokenScores, TokenScore } from "./types.js"; +import { INVALID_RUNTIME } from "./errors.js"; -type Runtime = "deno" | "node" | "browser" | "unknown"; +export type Runtime = "deno" | "node" | "browser" | "unknown"; + +type TokenScore = [string, number]; + +type IIntersectTokenScores = (options: { data: TokenScore[][] }) => { data: TokenScore[] }; function getCurrentRuntime(): Runtime { /* c8 ignore next 11 */ @@ -21,12 +25,15 @@ function getCurrentRuntime(): Runtime { const currentRuntime = getCurrentRuntime(); let _intersectTokenScores: IIntersectTokenScores; -export async function intersectTokenScores(arrays: TokenScore[][]): Promise { +export async function intersectTokenScores( + arrays: TokenScore[][], + runtime: Runtime = currentRuntime, +): Promise { if (!_intersectTokenScores) { let runtimeWasm: { intersectTokenScores: IIntersectTokenScores }; /* c8 ignore next 21 */ - switch (currentRuntime) { + switch (runtime) { case "node": { const require = createRequire(import.meta.url); runtimeWasm = require("../dist/wasm/nodejs/lyra_utils_wasm.cjs"); @@ -43,7 +50,7 @@ export async function intersectTokenScores(arrays: TokenScore[][]): Promise= this.a) return p; - var c = this.j.charCodeAt(this.cursor); - if (c > h || c < l) return p; - c -= l; - if (0 == (k[c >>> 3] & (1 << (c & 7)))) return p; - this.cursor++; - return g; - }; - this.n = function (k, l, h) { - if (this.cursor <= this.f) return p; - var c = this.j.charCodeAt(this.cursor - 1); - if (c > h || c < l) return p; - c -= l; - if (0 == (k[c >>> 3] & (1 << (c & 7)))) return p; - this.cursor--; - return g; - }; - this.k = function (k, l, h) { - if (this.cursor >= this.a) return p; - var c = this.j.charCodeAt(this.cursor); - if (c > h || c < l) return this.cursor++, g; - c -= l; - return 0 == (k[c >>> 3] & (1 << (c & 7))) ? (this.cursor++, g) : p; - }; - this.q = function (k, l, h) { - if (this.cursor <= this.f) return p; - var c = this.j.charCodeAt(this.cursor - 1); - if (c > h || c < l) return this.cursor--, g; - c -= l; - return 0 == (k[c >>> 3] & (1 << (c & 7))) ? (this.cursor--, g) : p; - }; - this.m = function (k) { - if (this.a - this.cursor < k.length || this.j.slice(this.cursor, this.cursor + k.length) != k) return p; - this.cursor += k.length; - return g; - }; - this.g = function (k) { - if (this.cursor - this.f < k.length || this.j.slice(this.cursor - k.length, this.cursor) != k) return p; - this.cursor -= k.length; - return g; - }; - this.o = function (k) { - for (var l = 0, h = k.length, c = this.cursor, a = this.a, d = 0, n = 0, v = p; ; ) { - var b = l + ((h - l) >>> 1), - f = 0, - q = d < n ? d : n, - t = k[b], - s; - for (s = q; s < t[0].length; s++) { - if (c + q == a) { - f = -1; - break; - } - f = this.j.charCodeAt(c + q) - t[0].charCodeAt(s); - if (0 != f) break; - q++; - } - 0 > f ? ((h = b), (n = q)) : ((l = b), (d = q)); - if (1 >= h - l) { - if (0 < l) break; - if (h == l) break; - if (v) break; - v = g; - } - } - for (;;) { - t = k[l]; - if (d >= t[0].length) { - this.cursor = c + t[0].length; - if (4 > t.length) return t[2]; - l = t[3](this); - this.cursor = c + t[0].length; - if (l) return t[2]; - } - l = t[1]; - if (0 > l) return 0; - } - }; - this.h = function (k) { - for (var l = 0, h = k.length, c = this.cursor, a = this.f, d = 0, n = 0, v = p; ; ) { - var b = l + ((h - l) >> 1), - f = 0, - q = d < n ? d : n, - t = k[b], - s; - for (s = t[0].length - 1 - q; 0 <= s; s--) { - if (c - q == a) { - f = -1; - break; - } - f = this.j.charCodeAt(c - 1 - q) - t[0].charCodeAt(s); - if (0 != f) break; - q++; - } - 0 > f ? ((h = b), (n = q)) : ((l = b), (d = q)); - if (1 >= h - l) { - if (0 < l) break; - if (h == l) break; - if (v) break; - v = g; - } - } - for (;;) { - t = k[l]; - if (d >= t[0].length) { - this.cursor = c - t[0].length; - if (4 > t.length) return t[2]; - l = t[3](this); - this.cursor = c - t[0].length; - if (l) return t[2]; - } - l = t[1]; - if (0 > l) return 0; - } - }; - this.s = function (k, l, h) { - var c = h.length - (l - k); - this.j = this.j.slice(0, k) + h + this.j.slice(l); - this.a += c; - this.cursor >= l ? (this.cursor += c) : this.cursor > k && (this.cursor = k); - return c; - }; - this.t = function () { - return 0 > this.c || this.c > this.d || this.d > this.a || this.a > this.j.length ? p : g; - }; - this.b = function (k) { - var l = p; - this.t() && (this.s(this.c, this.d, k), (l = g)); - return l; - }; - this.e = function () { - return this.b(""); - }; - this.r = function (k, l, h) { - l = this.s(k, l, h); - k <= this.c && (this.c += l); - k <= this.d && (this.d += l); - }; - this.u = function () { - var k = ""; - this.t() && (k = this.j.slice(this.c, this.d)); - return k; - }; - this.v = function () { - return this.j.slice(0, this.a); - }; -} - -function stem() { - var k = new C(), - l = [ - ["\u0580\u0578\u0580\u0564", -1, 1], - ["\u0565\u0580\u0578\u0580\u0564", 0, 1], - ["\u0561\u056c\u056b", -1, 1], - ["\u0561\u056f\u056b", -1, 1], - ["\u0578\u0580\u0561\u056f", -1, 1], - ["\u0565\u0572", -1, 1], - ["\u0561\u056f\u0561\u0576", -1, 1], - ["\u0561\u0580\u0561\u0576", -1, 1], - ["\u0565\u0576", -1, 1], - ["\u0565\u056f\u0565\u0576", 8, 1], - ["\u0565\u0580\u0565\u0576", 8, 1], - ["\u0578\u0580\u0567\u0576", -1, 1], - ["\u056b\u0576", -1, 1], - ["\u0563\u056b\u0576", 12, 1], - ["\u0578\u057e\u056b\u0576", 12, 1], - ["\u056c\u0561\u0575\u0576", -1, 1], - ["\u057e\u0578\u0582\u0576", -1, 1], - ["\u057a\u0565\u057d", -1, 1], - ["\u056b\u057e", -1, 1], - ["\u0561\u057f", -1, 1], - ["\u0561\u057e\u0565\u057f", -1, 1], - ["\u056f\u0578\u057f", -1, 1], - ["\u0562\u0561\u0580", -1, 1], - ], - h = [ - ["\u0561", -1, 1], - ["\u0561\u0581\u0561", 0, 1], - ["\u0565\u0581\u0561", 0, 1], - ["\u057e\u0565", -1, 1], - ["\u0561\u0581\u0580\u056b", -1, 1], - ["\u0561\u0581\u056b", -1, 1], - ["\u0565\u0581\u056b", -1, 1], - ["\u057e\u0565\u0581\u056b", 6, 1], - ["\u0561\u056c", -1, 1], - ["\u0568\u0561\u056c", 8, 1], - ["\u0561\u0576\u0561\u056c", 8, 1], - ["\u0565\u0576\u0561\u056c", 8, 1], - ["\u0561\u0581\u0576\u0561\u056c", 8, 1], - ["\u0565\u056c", -1, 1], - ["\u0568\u0565\u056c", 13, 1], - ["\u0576\u0565\u056c", 13, 1], - ["\u0581\u0576\u0565\u056c", 15, 1], - ["\u0565\u0581\u0576\u0565\u056c", 16, 1], - ["\u0579\u0565\u056c", 13, 1], - ["\u057e\u0565\u056c", 13, 1], - ["\u0561\u0581\u057e\u0565\u056c", 19, 1], - ["\u0565\u0581\u057e\u0565\u056c", 19, 1], - ["\u057f\u0565\u056c", 13, 1], - ["\u0561\u057f\u0565\u056c", 22, 1], - ["\u0578\u057f\u0565\u056c", 22, 1], - ["\u056f\u0578\u057f\u0565\u056c", 24, 1], - ["\u057e\u0561\u056e", -1, 1], - ["\u0578\u0582\u0574", -1, 1], - ["\u057e\u0578\u0582\u0574", 27, 1], - ["\u0561\u0576", -1, 1], - ["\u0581\u0561\u0576", 29, 1], - ["\u0561\u0581\u0561\u0576", 30, 1], - ["\u0561\u0581\u0580\u056b\u0576", -1, 1], - ["\u0561\u0581\u056b\u0576", -1, 1], - ["\u0565\u0581\u056b\u0576", -1, 1], - ["\u057e\u0565\u0581\u056b\u0576", 34, 1], - ["\u0561\u056c\u056b\u057d", -1, 1], - ["\u0565\u056c\u056b\u057d", -1, 1], - ["\u0561\u057e", -1, 1], - ["\u0561\u0581\u0561\u057e", 38, 1], - ["\u0565\u0581\u0561\u057e", 38, 1], - ["\u0561\u056c\u0578\u057e", -1, 1], - ["\u0565\u056c\u0578\u057e", -1, 1], - ["\u0561\u0580", -1, 1], - ["\u0561\u0581\u0561\u0580", 43, 1], - ["\u0565\u0581\u0561\u0580", 43, 1], - ["\u0561\u0581\u0580\u056b\u0580", -1, 1], - ["\u0561\u0581\u056b\u0580", -1, 1], - ["\u0565\u0581\u056b\u0580", -1, 1], - ["\u057e\u0565\u0581\u056b\u0580", 48, 1], - ["\u0561\u0581", -1, 1], - ["\u0565\u0581", -1, 1], - ["\u0561\u0581\u0580\u0565\u0581", 51, 1], - ["\u0561\u056c\u0578\u0582\u0581", -1, 1], - ["\u0565\u056c\u0578\u0582\u0581", -1, 1], - ["\u0561\u056c\u0578\u0582", -1, 1], - ["\u0565\u056c\u0578\u0582", -1, 1], - ["\u0561\u0584", -1, 1], - ["\u0581\u0561\u0584", 57, 1], - ["\u0561\u0581\u0561\u0584", 58, 1], - ["\u0561\u0581\u0580\u056b\u0584", -1, 1], - ["\u0561\u0581\u056b\u0584", -1, 1], - ["\u0565\u0581\u056b\u0584", -1, 1], - ["\u057e\u0565\u0581\u056b\u0584", 62, 1], - ["\u0561\u0576\u0584", -1, 1], - ["\u0581\u0561\u0576\u0584", 64, 1], - ["\u0561\u0581\u0561\u0576\u0584", 65, 1], - ["\u0561\u0581\u0580\u056b\u0576\u0584", -1, 1], - ["\u0561\u0581\u056b\u0576\u0584", -1, 1], - ["\u0565\u0581\u056b\u0576\u0584", -1, 1], - ["\u057e\u0565\u0581\u056b\u0576\u0584", 69, 1], - ], - c = [ - ["\u0578\u0580\u0564", -1, 1], - ["\u0578\u0582\u0575\u0569", -1, 1], - ["\u0578\u0582\u0570\u056b", -1, 1], - ["\u0581\u056b", -1, 1], - ["\u056b\u056c", -1, 1], - ["\u0561\u056f", -1, 1], - ["\u0575\u0561\u056f", 5, 1], - ["\u0561\u0576\u0561\u056f", 5, 1], - ["\u056b\u056f", -1, 1], - ["\u0578\u0582\u056f", -1, 1], - ["\u0561\u0576", -1, 1], - ["\u057a\u0561\u0576", 10, 1], - ["\u057d\u057f\u0561\u0576", 10, 1], - ["\u0561\u0580\u0561\u0576", 10, 1], - ["\u0565\u0572\u0567\u0576", -1, 1], - ["\u0575\u0578\u0582\u0576", -1, 1], - ["\u0578\u0582\u0569\u0575\u0578\u0582\u0576", 15, 1], - ["\u0561\u056e\u0578", -1, 1], - ["\u056b\u0579", -1, 1], - ["\u0578\u0582\u057d", -1, 1], - ["\u0578\u0582\u057d\u057f", -1, 1], - ["\u0563\u0561\u0580", -1, 1], - ["\u057e\u0578\u0580", -1, 1], - ["\u0561\u057e\u0578\u0580", 22, 1], - ["\u0578\u0581", -1, 1], - ["\u0561\u0576\u0585\u0581", -1, 1], - ["\u0578\u0582", -1, 1], - ["\u0584", -1, 1], - ["\u0579\u0565\u0584", 27, 1], - ["\u056b\u0584", 27, 1], - ["\u0561\u056c\u056b\u0584", 29, 1], - ["\u0561\u0576\u056b\u0584", 29, 1], - ["\u057e\u0561\u056e\u0584", 27, 1], - ["\u0578\u0582\u0575\u0584", 27, 1], - ["\u0565\u0576\u0584", 27, 1], - ["\u0578\u0576\u0584", 27, 1], - ["\u0578\u0582\u0576\u0584", 27, 1], - ["\u0574\u0578\u0582\u0576\u0584", 36, 1], - ["\u056b\u0579\u0584", 27, 1], - ["\u0561\u0580\u0584", 27, 1], - ], - a = [ - ["\u057d\u0561", -1, 1], - ["\u057e\u0561", -1, 1], - ["\u0561\u0574\u0562", -1, 1], - ["\u0564", -1, 1], - ["\u0561\u0576\u0564", 3, 1], - ["\u0578\u0582\u0569\u0575\u0561\u0576\u0564", 4, 1], - ["\u057e\u0561\u0576\u0564", 4, 1], - ["\u0578\u057b\u0564", 3, 1], - ["\u0565\u0580\u0564", 3, 1], - ["\u0576\u0565\u0580\u0564", 8, 1], - ["\u0578\u0582\u0564", 3, 1], - ["\u0568", -1, 1], - ["\u0561\u0576\u0568", 11, 1], - ["\u0578\u0582\u0569\u0575\u0561\u0576\u0568", 12, 1], - ["\u057e\u0561\u0576\u0568", 12, 1], - ["\u0578\u057b\u0568", 11, 1], - ["\u0565\u0580\u0568", 11, 1], - ["\u0576\u0565\u0580\u0568", 16, 1], - ["\u056b", -1, 1], - ["\u057e\u056b", 18, 1], - ["\u0565\u0580\u056b", 18, 1], - ["\u0576\u0565\u0580\u056b", 20, 1], - ["\u0561\u0576\u0578\u0582\u0574", -1, 1], - ["\u0565\u0580\u0578\u0582\u0574", -1, 1], - ["\u0576\u0565\u0580\u0578\u0582\u0574", 23, 1], - ["\u0576", -1, 1], - ["\u0561\u0576", 25, 1], - ["\u0578\u0582\u0569\u0575\u0561\u0576", 26, 1], - ["\u057e\u0561\u0576", 26, 1], - ["\u056b\u0576", 25, 1], - ["\u0565\u0580\u056b\u0576", 29, 1], - ["\u0576\u0565\u0580\u056b\u0576", 30, 1], - ["\u0578\u0582\u0569\u0575\u0561\u0576\u0576", 25, 1], - ["\u0565\u0580\u0576", 25, 1], - ["\u0576\u0565\u0580\u0576", 33, 1], - ["\u0578\u0582\u0576", 25, 1], - ["\u0578\u057b", -1, 1], - ["\u0578\u0582\u0569\u0575\u0561\u0576\u057d", -1, 1], - ["\u057e\u0561\u0576\u057d", -1, 1], - ["\u0578\u057b\u057d", -1, 1], - ["\u0578\u057e", -1, 1], - ["\u0561\u0576\u0578\u057e", 40, 1], - ["\u057e\u0578\u057e", 40, 1], - ["\u0565\u0580\u0578\u057e", 40, 1], - ["\u0576\u0565\u0580\u0578\u057e", 43, 1], - ["\u0565\u0580", -1, 1], - ["\u0576\u0565\u0580", 45, 1], - ["\u0581", -1, 1], - ["\u056b\u0581", 47, 1], - ["\u057e\u0561\u0576\u056b\u0581", 48, 1], - ["\u0578\u057b\u056b\u0581", 48, 1], - ["\u057e\u056b\u0581", 48, 1], - ["\u0565\u0580\u056b\u0581", 48, 1], - ["\u0576\u0565\u0580\u056b\u0581", 52, 1], - ["\u0581\u056b\u0581", 48, 1], - ["\u0578\u0581", 47, 1], - ["\u0578\u0582\u0581", 47, 1], - ], - d = [209, 4, 128, 0, 18], - n = 0, - v = 0; - this.l = function () { - n = v = k.a; - var b = k.cursor; - a: { - b: for (;;) { - if (k.i(d, 1377, 1413)) break b; - if (k.cursor >= k.a) break a; - k.cursor++; - } - v = k.cursor; - b: for (;;) { - if (k.k(d, 1377, 1413)) break b; - if (k.cursor >= k.a) break a; - k.cursor++; - } - b: for (;;) { - if (k.i(d, 1377, 1413)) break b; - if (k.cursor >= k.a) break a; - k.cursor++; - } - b: for (;;) { - if (k.k(d, 1377, 1413)) break b; - if (k.cursor >= k.a) break a; - k.cursor++; - } - n = k.cursor; - } - k.cursor = b; - k.f = k.cursor; - k.cursor = k.a; - if (k.cursor < v) return p; - b = k.f; - k.f = v; - var f = k.a - k.cursor; - k.d = k.cursor; - 0 != k.h(a) && ((k.c = k.cursor), !(n <= k.cursor) || k.e()); - k.cursor = k.a - f; - f = k.a - k.cursor; - k.d = k.cursor; - 0 != k.h(h) && ((k.c = k.cursor), k.e()); - k.cursor = k.a - f; - f = k.a - k.cursor; - k.d = k.cursor; - 0 != k.h(l) && ((k.c = k.cursor), k.e()); - k.cursor = k.a - f; - f = k.a - k.cursor; - k.d = k.cursor; - 0 != k.h(c) && ((k.c = k.cursor), k.e()); - k.cursor = k.a - f; - k.f = b; - k.cursor = k.f; - return g; - }; - this.stemWord = function (a) { - k.p(a); - this.l(); - return k.j; - }; -} - -const stemmerInstance = new stem(); - -export function stemmer(word) { - return stemmerInstance.stemWord(word); -} diff --git a/stemmer/lib/ar.d.ts b/stemmer/lib/ar.d.ts deleted file mode 100644 index 838f68c..0000000 --- a/stemmer/lib/ar.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare function stemmer(word: string): string; diff --git a/stemmer/lib/ar.js b/stemmer/lib/ar.js deleted file mode 100644 index 4041537..0000000 --- a/stemmer/lib/ar.js +++ /dev/null @@ -1,996 +0,0 @@ -/* - * ----------------------------------------------------------------------------- - * GENERATED FILE - DO NOT EDIT! - * This file has been compiled using the Snowball stemmer generator. - * Don't edit this file directly. - * ----------------------------------------------------------------------------- - */ - -var g = !0, - p = !1; - -function C() { - this.p = function (k) { - this.j = k; - this.cursor = 0; - this.a = this.j.length; - this.f = 0; - this.c = this.cursor; - this.d = this.a; - }; - this.z = function () { - return this.j; - }; - this.w = function (k) { - this.j = k.j; - this.cursor = k.cursor; - this.a = k.a; - this.f = k.f; - this.c = k.c; - this.d = k.d; - }; - this.i = function (k, l, h) { - if (this.cursor >= this.a) return p; - var c = this.j.charCodeAt(this.cursor); - if (c > h || c < l) return p; - c -= l; - if (0 == (k[c >>> 3] & (1 << (c & 7)))) return p; - this.cursor++; - return g; - }; - this.n = function (k, l, h) { - if (this.cursor <= this.f) return p; - var c = this.j.charCodeAt(this.cursor - 1); - if (c > h || c < l) return p; - c -= l; - if (0 == (k[c >>> 3] & (1 << (c & 7)))) return p; - this.cursor--; - return g; - }; - this.k = function (k, l, h) { - if (this.cursor >= this.a) return p; - var c = this.j.charCodeAt(this.cursor); - if (c > h || c < l) return this.cursor++, g; - c -= l; - return 0 == (k[c >>> 3] & (1 << (c & 7))) ? (this.cursor++, g) : p; - }; - this.q = function (k, l, h) { - if (this.cursor <= this.f) return p; - var c = this.j.charCodeAt(this.cursor - 1); - if (c > h || c < l) return this.cursor--, g; - c -= l; - return 0 == (k[c >>> 3] & (1 << (c & 7))) ? (this.cursor--, g) : p; - }; - this.m = function (k) { - if (this.a - this.cursor < k.length || this.j.slice(this.cursor, this.cursor + k.length) != k) return p; - this.cursor += k.length; - return g; - }; - this.g = function (k) { - if (this.cursor - this.f < k.length || this.j.slice(this.cursor - k.length, this.cursor) != k) return p; - this.cursor -= k.length; - return g; - }; - this.o = function (k) { - for (var l = 0, h = k.length, c = this.cursor, a = this.a, d = 0, n = 0, v = p; ; ) { - var b = l + ((h - l) >>> 1), - f = 0, - q = d < n ? d : n, - t = k[b], - s; - for (s = q; s < t[0].length; s++) { - if (c + q == a) { - f = -1; - break; - } - f = this.j.charCodeAt(c + q) - t[0].charCodeAt(s); - if (0 != f) break; - q++; - } - 0 > f ? ((h = b), (n = q)) : ((l = b), (d = q)); - if (1 >= h - l) { - if (0 < l) break; - if (h == l) break; - if (v) break; - v = g; - } - } - for (;;) { - t = k[l]; - if (d >= t[0].length) { - this.cursor = c + t[0].length; - if (4 > t.length) return t[2]; - l = t[3](this); - this.cursor = c + t[0].length; - if (l) return t[2]; - } - l = t[1]; - if (0 > l) return 0; - } - }; - this.h = function (k) { - for (var l = 0, h = k.length, c = this.cursor, a = this.f, d = 0, n = 0, v = p; ; ) { - var b = l + ((h - l) >> 1), - f = 0, - q = d < n ? d : n, - t = k[b], - s; - for (s = t[0].length - 1 - q; 0 <= s; s--) { - if (c - q == a) { - f = -1; - break; - } - f = this.j.charCodeAt(c - 1 - q) - t[0].charCodeAt(s); - if (0 != f) break; - q++; - } - 0 > f ? ((h = b), (n = q)) : ((l = b), (d = q)); - if (1 >= h - l) { - if (0 < l) break; - if (h == l) break; - if (v) break; - v = g; - } - } - for (;;) { - t = k[l]; - if (d >= t[0].length) { - this.cursor = c - t[0].length; - if (4 > t.length) return t[2]; - l = t[3](this); - this.cursor = c - t[0].length; - if (l) return t[2]; - } - l = t[1]; - if (0 > l) return 0; - } - }; - this.s = function (k, l, h) { - var c = h.length - (l - k); - this.j = this.j.slice(0, k) + h + this.j.slice(l); - this.a += c; - this.cursor >= l ? (this.cursor += c) : this.cursor > k && (this.cursor = k); - return c; - }; - this.t = function () { - return 0 > this.c || this.c > this.d || this.d > this.a || this.a > this.j.length ? p : g; - }; - this.b = function (k) { - var l = p; - this.t() && (this.s(this.c, this.d, k), (l = g)); - return l; - }; - this.e = function () { - return this.b(""); - }; - this.r = function (k, l, h) { - l = this.s(k, l, h); - k <= this.c && (this.c += l); - k <= this.d && (this.d += l); - }; - this.u = function () { - var k = ""; - this.t() && (k = this.j.slice(this.c, this.d)); - return k; - }; - this.v = function () { - return this.j.slice(0, this.a); - }; -} - -function stem() { - function k() { - var a, - b = m.cursor; - for (;;) { - var c = m.cursor; - b: { - c: { - var e = m.cursor; - m.c = m.cursor; - a = m.o(w); - if (0 != a) { - m.d = m.cursor; - switch (a) { - case 1: - if (!m.e()) return; - break; - case 2: - if (!m.b("0")) return; - break; - case 3: - if (!m.b("1")) return; - break; - case 4: - if (!m.b("2")) return; - break; - case 5: - if (!m.b("3")) return; - break; - case 6: - if (!m.b("4")) return; - break; - case 7: - if (!m.b("5")) return; - break; - case 8: - if (!m.b("6")) return; - break; - case 9: - if (!m.b("7")) return; - break; - case 10: - if (!m.b("8")) return; - break; - case 11: - if (!m.b("9")) return; - break; - case 12: - if (!m.b("\u0621")) return; - break; - case 13: - if (!m.b("\u0623")) return; - break; - case 14: - if (!m.b("\u0625")) return; - break; - case 15: - if (!m.b("\u0626")) return; - break; - case 16: - if (!m.b("\u0622")) return; - break; - case 17: - if (!m.b("\u0624")) return; - break; - case 18: - if (!m.b("\u0627")) return; - break; - case 19: - if (!m.b("\u0628")) return; - break; - case 20: - if (!m.b("\u0629")) return; - break; - case 21: - if (!m.b("\u062a")) return; - break; - case 22: - if (!m.b("\u062b")) return; - break; - case 23: - if (!m.b("\u062c")) return; - break; - case 24: - if (!m.b("\u062d")) return; - break; - case 25: - if (!m.b("\u062e")) return; - break; - case 26: - if (!m.b("\u062f")) return; - break; - case 27: - if (!m.b("\u0630")) return; - break; - case 28: - if (!m.b("\u0631")) return; - break; - case 29: - if (!m.b("\u0632")) return; - break; - case 30: - if (!m.b("\u0633")) return; - break; - case 31: - if (!m.b("\u0634")) return; - break; - case 32: - if (!m.b("\u0635")) return; - break; - case 33: - if (!m.b("\u0636")) return; - break; - case 34: - if (!m.b("\u0637")) return; - break; - case 35: - if (!m.b("\u0638")) return; - break; - case 36: - if (!m.b("\u0639")) return; - break; - case 37: - if (!m.b("\u063a")) return; - break; - case 38: - if (!m.b("\u0641")) return; - break; - case 39: - if (!m.b("\u0642")) return; - break; - case 40: - if (!m.b("\u0643")) return; - break; - case 41: - if (!m.b("\u0644")) return; - break; - case 42: - if (!m.b("\u0645")) return; - break; - case 43: - if (!m.b("\u0646")) return; - break; - case 44: - if (!m.b("\u0647")) return; - break; - case 45: - if (!m.b("\u0648")) return; - break; - case 46: - if (!m.b("\u0649")) return; - break; - case 47: - if (!m.b("\u064a")) return; - break; - case 48: - if (!m.b("\u0644\u0627")) return; - break; - case 49: - if (!m.b("\u0644\u0623")) return; - break; - case 50: - if (!m.b("\u0644\u0625")) return; - break; - case 51: - if (!m.b("\u0644\u0622")) return; - } - break c; - } - m.cursor = e; - if (m.cursor >= m.a) break b; - m.cursor++; - } - continue; - } - m.cursor = c; - break; - } - m.cursor = b; - } - function l() { - var a; - a = m.cursor; - m.f = m.cursor; - m.cursor = m.a; - m.d = m.cursor; - if (0 != m.h(u)) { - m.c = m.cursor; - if (!m.b("\u0621")) return; - m.cursor = m.f; - } - m.cursor = a; - var b = m.cursor; - for (;;) { - var c = m.cursor; - b: { - c: { - var e = m.cursor; - m.c = m.cursor; - a = m.o(y); - if (0 != a) { - m.d = m.cursor; - switch (a) { - case 1: - if (!m.b("\u0627")) return; - break; - case 2: - if (!m.b("\u0648")) return; - break; - case 3: - if (!m.b("\u064a")) return; - } - break c; - } - m.cursor = e; - if (m.cursor >= m.a) break b; - m.cursor++; - } - continue; - } - m.cursor = c; - break; - } - m.cursor = b; - } - function h() { - var a; - m.c = m.cursor; - a = m.o(e); - if (0 == a) return p; - m.d = m.cursor; - switch (a) { - case 1: - if (!(3 < m.j.length) || !m.b("\u0623")) return p; - break; - case 2: - if (!(3 < m.j.length) || !m.b("\u0622")) return p; - break; - case 3: - if (!(3 < m.j.length) || !m.b("\u0627")) return p; - break; - case 4: - if (!(3 < m.j.length) || !m.b("\u0625")) return p; - } - return g; - } - function c() { - m.c = m.cursor; - if (0 == m.o(A)) return p; - m.d = m.cursor; - if (!(3 < m.j.length)) return p; - var a = m.cursor; - if (m.m("\u0627")) return p; - m.cursor = a; - return !m.e() ? p : g; - } - function a() { - var a; - m.c = m.cursor; - a = m.o(H); - if (0 == a) return p; - m.d = m.cursor; - switch (a) { - case 1: - if (!(5 < m.j.length) || !m.e()) return p; - break; - case 2: - if (!(4 < m.j.length) || !m.e()) return p; - } - return g; - } - function d() { - var a; - m.c = m.cursor; - a = m.o(G); - if (0 == a) return p; - m.d = m.cursor; - switch (a) { - case 1: - if (!(3 < m.j.length) || !m.e()) return p; - break; - case 2: - if (!(3 < m.j.length) || !m.b("\u0628")) return p; - break; - case 3: - if (!(3 < m.j.length) || !m.b("\u0643")) return p; - } - return g; - } - function n() { - var a; - m.c = m.cursor; - a = m.o(E); - if (0 == a) return p; - m.d = m.cursor; - switch (a) { - case 1: - if (!(4 < m.j.length) || !m.b("\u064a")) return p; - break; - case 2: - if (!(4 < m.j.length) || !m.b("\u062a")) return p; - break; - case 3: - if (!(4 < m.j.length) || !m.b("\u0646")) return p; - break; - case 4: - if (!(4 < m.j.length) || !m.b("\u0623")) return p; - } - return g; - } - function v() { - var a; - m.d = m.cursor; - a = m.h(O); - if (0 == a) return p; - m.c = m.cursor; - switch (a) { - case 1: - if (!(4 <= m.j.length) || !m.e()) return p; - break; - case 2: - if (!(5 <= m.j.length) || !m.e()) return p; - break; - case 3: - if (!(6 <= m.j.length) || !m.e()) return p; - } - return g; - } - function b() { - m.d = m.cursor; - if (0 == m.h(M)) return p; - m.c = m.cursor; - return !(4 < m.j.length) || !m.e() ? p : g; - } - function f() { - m.d = m.cursor; - if (0 == m.h(P)) return p; - m.c = m.cursor; - return !(5 <= m.j.length) || !m.e() ? p : g; - } - function q() { - m.d = m.cursor; - if (0 == m.h(Q)) return p; - m.c = m.cursor; - return !(4 <= m.j.length) || !m.e() ? p : g; - } - function t() { - var a; - m.d = m.cursor; - a = m.h(R); - if (0 == a) return p; - m.c = m.cursor; - switch (a) { - case 1: - if (!(4 <= m.j.length) || !m.e()) return p; - break; - case 2: - if (!(5 <= m.j.length) || !m.e()) return p; - break; - case 3: - if (!(6 <= m.j.length) || !m.e()) return p; - } - return g; - } - function s() { - var a; - m.d = m.cursor; - a = m.h(S); - if (0 == a) return p; - m.c = m.cursor; - switch (a) { - case 1: - if (!(4 <= m.j.length) || !m.e()) return p; - break; - case 2: - if (!(5 <= m.j.length) || !m.e()) return p; - break; - case 3: - if (!(5 < m.j.length) || !m.e()) return p; - break; - case 4: - if (!(6 <= m.j.length) || !m.e()) return p; - } - return g; - } - function r() { - var a; - m.d = m.cursor; - a = m.h(I); - if (0 == a) return p; - m.c = m.cursor; - switch (a) { - case 1: - if (!(4 <= m.j.length) || !m.e()) return p; - break; - case 2: - if (!(6 <= m.j.length) || !m.e()) return p; - } - return g; - } - var m = new C(), - w = [ - ["\u0640", -1, 1], - ["\u064b", -1, 1], - ["\u064c", -1, 1], - ["\u064d", -1, 1], - ["\u064e", -1, 1], - ["\u064f", -1, 1], - ["\u0650", -1, 1], - ["\u0651", -1, 1], - ["\u0652", -1, 1], - ["\u0660", -1, 2], - ["\u0661", -1, 3], - ["\u0662", -1, 4], - ["\u0663", -1, 5], - ["\u0664", -1, 6], - ["\u0665", -1, 7], - ["\u0666", -1, 8], - ["\u0667", -1, 9], - ["\u0668", -1, 10], - ["\u0669", -1, 11], - ["\ufe80", -1, 12], - ["\ufe81", -1, 16], - ["\ufe82", -1, 16], - ["\ufe83", -1, 13], - ["\ufe84", -1, 13], - ["\ufe85", -1, 17], - ["\ufe86", -1, 17], - ["\ufe87", -1, 14], - ["\ufe88", -1, 14], - ["\ufe89", -1, 15], - ["\ufe8a", -1, 15], - ["\ufe8b", -1, 15], - ["\ufe8c", -1, 15], - ["\ufe8d", -1, 18], - ["\ufe8e", -1, 18], - ["\ufe8f", -1, 19], - ["\ufe90", -1, 19], - ["\ufe91", -1, 19], - ["\ufe92", -1, 19], - ["\ufe93", -1, 20], - ["\ufe94", -1, 20], - ["\ufe95", -1, 21], - ["\ufe96", -1, 21], - ["\ufe97", -1, 21], - ["\ufe98", -1, 21], - ["\ufe99", -1, 22], - ["\ufe9a", -1, 22], - ["\ufe9b", -1, 22], - ["\ufe9c", -1, 22], - ["\ufe9d", -1, 23], - ["\ufe9e", -1, 23], - ["\ufe9f", -1, 23], - ["\ufea0", -1, 23], - ["\ufea1", -1, 24], - ["\ufea2", -1, 24], - ["\ufea3", -1, 24], - ["\ufea4", -1, 24], - ["\ufea5", -1, 25], - ["\ufea6", -1, 25], - ["\ufea7", -1, 25], - ["\ufea8", -1, 25], - ["\ufea9", -1, 26], - ["\ufeaa", -1, 26], - ["\ufeab", -1, 27], - ["\ufeac", -1, 27], - ["\ufead", -1, 28], - ["\ufeae", -1, 28], - ["\ufeaf", -1, 29], - ["\ufeb0", -1, 29], - ["\ufeb1", -1, 30], - ["\ufeb2", -1, 30], - ["\ufeb3", -1, 30], - ["\ufeb4", -1, 30], - ["\ufeb5", -1, 31], - ["\ufeb6", -1, 31], - ["\ufeb7", -1, 31], - ["\ufeb8", -1, 31], - ["\ufeb9", -1, 32], - ["\ufeba", -1, 32], - ["\ufebb", -1, 32], - ["\ufebc", -1, 32], - ["\ufebd", -1, 33], - ["\ufebe", -1, 33], - ["\ufebf", -1, 33], - ["\ufec0", -1, 33], - ["\ufec1", -1, 34], - ["\ufec2", -1, 34], - ["\ufec3", -1, 34], - ["\ufec4", -1, 34], - ["\ufec5", -1, 35], - ["\ufec6", -1, 35], - ["\ufec7", -1, 35], - ["\ufec8", -1, 35], - ["\ufec9", -1, 36], - ["\ufeca", -1, 36], - ["\ufecb", -1, 36], - ["\ufecc", -1, 36], - ["\ufecd", -1, 37], - ["\ufece", -1, 37], - ["\ufecf", -1, 37], - ["\ufed0", -1, 37], - ["\ufed1", -1, 38], - ["\ufed2", -1, 38], - ["\ufed3", -1, 38], - ["\ufed4", -1, 38], - ["\ufed5", -1, 39], - ["\ufed6", -1, 39], - ["\ufed7", -1, 39], - ["\ufed8", -1, 39], - ["\ufed9", -1, 40], - ["\ufeda", -1, 40], - ["\ufedb", -1, 40], - ["\ufedc", -1, 40], - ["\ufedd", -1, 41], - ["\ufede", -1, 41], - ["\ufedf", -1, 41], - ["\ufee0", -1, 41], - ["\ufee1", -1, 42], - ["\ufee2", -1, 42], - ["\ufee3", -1, 42], - ["\ufee4", -1, 42], - ["\ufee5", -1, 43], - ["\ufee6", -1, 43], - ["\ufee7", -1, 43], - ["\ufee8", -1, 43], - ["\ufee9", -1, 44], - ["\ufeea", -1, 44], - ["\ufeeb", -1, 44], - ["\ufeec", -1, 44], - ["\ufeed", -1, 45], - ["\ufeee", -1, 45], - ["\ufeef", -1, 46], - ["\ufef0", -1, 46], - ["\ufef1", -1, 47], - ["\ufef2", -1, 47], - ["\ufef3", -1, 47], - ["\ufef4", -1, 47], - ["\ufef5", -1, 51], - ["\ufef6", -1, 51], - ["\ufef7", -1, 49], - ["\ufef8", -1, 49], - ["\ufef9", -1, 50], - ["\ufefa", -1, 50], - ["\ufefb", -1, 48], - ["\ufefc", -1, 48], - ], - u = [ - ["\u0622", -1, 1], - ["\u0623", -1, 1], - ["\u0624", -1, 1], - ["\u0625", -1, 1], - ["\u0626", -1, 1], - ], - y = [ - ["\u0622", -1, 1], - ["\u0623", -1, 1], - ["\u0624", -1, 2], - ["\u0625", -1, 1], - ["\u0626", -1, 3], - ], - z = [ - ["\u0627\u0644", -1, 2], - ["\u0628\u0627\u0644", -1, 1], - ["\u0643\u0627\u0644", -1, 1], - ["\u0644\u0644", -1, 2], - ], - e = [ - ["\u0623\u0622", -1, 2], - ["\u0623\u0623", -1, 1], - ["\u0623\u0624", -1, 1], - ["\u0623\u0625", -1, 4], - ["\u0623\u0627", -1, 3], - ], - A = [ - ["\u0641", -1, 1], - ["\u0648", -1, 1], - ], - H = [ - ["\u0627\u0644", -1, 2], - ["\u0628\u0627\u0644", -1, 1], - ["\u0643\u0627\u0644", -1, 1], - ["\u0644\u0644", -1, 2], - ], - G = [ - ["\u0628", -1, 1], - ["\u0628\u0627", 0, -1], - ["\u0628\u0628", 0, 2], - ["\u0643\u0643", -1, 3], - ], - E = [ - ["\u0633\u0623", -1, 4], - ["\u0633\u062a", -1, 2], - ["\u0633\u0646", -1, 3], - ["\u0633\u064a", -1, 1], - ], - x = [ - ["\u062a\u0633\u062a", -1, 1], - ["\u0646\u0633\u062a", -1, 1], - ["\u064a\u0633\u062a", -1, 1], - ], - O = [ - ["\u0643\u0645\u0627", -1, 3], - ["\u0647\u0645\u0627", -1, 3], - ["\u0646\u0627", -1, 2], - ["\u0647\u0627", -1, 2], - ["\u0643", -1, 1], - ["\u0643\u0645", -1, 2], - ["\u0647\u0645", -1, 2], - ["\u0647\u0646", -1, 2], - ["\u0647", -1, 1], - ["\u064a", -1, 1], - ], - N = [["\u0646", -1, 1]], - M = [ - ["\u0627", -1, 1], - ["\u0648", -1, 1], - ["\u064a", -1, 1], - ], - P = [["\u0627\u062a", -1, 1]], - Q = [["\u062a", -1, 1]], - T = [["\u0629", -1, 1]], - U = [["\u064a", -1, 1]], - R = [ - ["\u0643\u0645\u0627", -1, 3], - ["\u0647\u0645\u0627", -1, 3], - ["\u0646\u0627", -1, 2], - ["\u0647\u0627", -1, 2], - ["\u0643", -1, 1], - ["\u0643\u0645", -1, 2], - ["\u0647\u0645", -1, 2], - ["\u0643\u0646", -1, 2], - ["\u0647\u0646", -1, 2], - ["\u0647", -1, 1], - ["\u0643\u0645\u0648", -1, 3], - ["\u0646\u064a", -1, 2], - ], - S = [ - ["\u0627", -1, 1], - ["\u062a\u0627", 0, 2], - ["\u062a\u0645\u0627", 0, 4], - ["\u0646\u0627", 0, 2], - ["\u062a", -1, 1], - ["\u0646", -1, 1], - ["\u0627\u0646", 5, 3], - ["\u062a\u0646", 5, 2], - ["\u0648\u0646", 5, 3], - ["\u064a\u0646", 5, 3], - ["\u064a", -1, 1], - ], - V = [ - ["\u0648\u0627", -1, 1], - ["\u062a\u0645", -1, 1], - ], - I = [ - ["\u0648", -1, 1], - ["\u062a\u0645\u0648", 0, 2], - ], - D = [["\u0649", -1, 1]], - L = p, - J = p, - K = p; - this.l = function () { - J = K = g; - L = p; - var e = m.cursor, - u; - m.c = m.cursor; - u = m.o(z); - if (0 != u) - switch (((m.d = m.cursor), u)) { - case 1: - if (!(4 < m.j.length)) break; - K = g; - J = p; - L = g; - break; - case 2: - if (!(3 < m.j.length)) break; - K = g; - J = p; - L = g; - } - m.cursor = e; - k(); - m.f = m.cursor; - m.cursor = m.a; - e = m.a - m.cursor; - b: { - u = m.a - m.cursor; - c: if (J) { - d: { - var w = m.a - m.cursor; - e: { - for (var y = 1; ; ) { - var A = m.a - m.cursor; - if (t()) { - y--; - continue; - } - m.cursor = m.a - A; - break; - } - if (!(0 < y)) { - f: { - y = m.a - m.cursor; - if (s()) break f; - m.cursor = m.a - y; - if (r()) break f; - m.cursor = m.a - y; - if (m.cursor <= m.f) break e; - m.cursor--; - } - break d; - } - } - m.cursor = m.a - w; - m.d = m.cursor; - 0 == m.h(V) ? (y = p) : ((m.c = m.cursor), (y = !(5 <= m.j.length) || !m.e() ? p : g)); - if (y) break d; - m.cursor = m.a - w; - if (!s()) break c; - } - break b; - } - m.cursor = m.a - u; - if (K) { - w = m.a - m.cursor; - e: { - y = m.a - m.cursor; - m.d = m.cursor; - 0 == m.h(T) ? (A = p) : ((m.c = m.cursor), (A = !(4 <= m.j.length) || !m.e() ? p : g)); - if (A) break e; - m.cursor = m.a - y; - f: { - if (L) break f; - if (v()) { - g: { - A = m.a - m.cursor; - if (b()) break g; - m.cursor = m.a - A; - if (f()) break g; - m.cursor = m.a - A; - if (q()) break g; - m.cursor = m.a - A; - if (m.cursor <= m.f) break f; - m.cursor--; - } - break e; - } - } - m.cursor = m.a - y; - f: if ( - ((m.d = m.cursor), 0 == m.h(N) ? (A = p) : ((m.c = m.cursor), (A = !(5 < m.j.length) || !m.e() ? p : g)), A) - ) { - g: { - A = m.a - m.cursor; - if (b()) break g; - m.cursor = m.a - A; - if (f()) break g; - m.cursor = m.a - A; - if (!q()) break f; - } - break e; - } - m.cursor = m.a - y; - f: { - if (L) break f; - if (b()) break e; - } - m.cursor = m.a - y; - f() || (m.cursor = m.a - w); - } - m.d = m.cursor; - 0 == m.h(U) ? (w = p) : ((m.c = m.cursor), (w = !(3 <= m.j.length) || !m.e() ? p : g)); - if (w) break b; - } - m.cursor = m.a - u; - m.d = m.cursor; - 0 != m.h(D) && ((m.c = m.cursor), m.b("\u064a")); - } - m.cursor = m.a - e; - m.cursor = m.f; - e = m.cursor; - u = m.cursor; - h() || (m.cursor = u); - u = m.cursor; - c() || (m.cursor = u); - b: { - u = m.cursor; - if (a()) break b; - m.cursor = u; - if (K && d()) break b; - m.cursor = u; - J && - ((u = m.cursor), - n() || (m.cursor = u), - (m.c = m.cursor), - 0 != m.o(x) && ((m.d = m.cursor), 4 < m.j.length && ((J = g), (K = p), m.b("\u0627\u0633\u062a")))); - } - m.cursor = e; - l(); - return g; - }; - this.stemWord = function (a) { - m.p(a); - this.l(); - return m.j; - }; -} - -const stemmerInstance = new stem(); - -export function stemmer(word) { - return stemmerInstance.stemWord(word); -} diff --git a/stemmer/lib/de.d.ts b/stemmer/lib/de.d.ts deleted file mode 100644 index 838f68c..0000000 --- a/stemmer/lib/de.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare function stemmer(word: string): string; diff --git a/stemmer/lib/de.js b/stemmer/lib/de.js deleted file mode 100644 index d3d8293..0000000 --- a/stemmer/lib/de.js +++ /dev/null @@ -1,460 +0,0 @@ -/* - * ----------------------------------------------------------------------------- - * GENERATED FILE - DO NOT EDIT! - * This file has been compiled using the Snowball stemmer generator. - * Don't edit this file directly. - * ----------------------------------------------------------------------------- - */ - -var g = !0, - p = !1; - -function C() { - this.p = function (k) { - this.j = k; - this.cursor = 0; - this.a = this.j.length; - this.f = 0; - this.c = this.cursor; - this.d = this.a; - }; - this.z = function () { - return this.j; - }; - this.w = function (k) { - this.j = k.j; - this.cursor = k.cursor; - this.a = k.a; - this.f = k.f; - this.c = k.c; - this.d = k.d; - }; - this.i = function (k, l, h) { - if (this.cursor >= this.a) return p; - var c = this.j.charCodeAt(this.cursor); - if (c > h || c < l) return p; - c -= l; - if (0 == (k[c >>> 3] & (1 << (c & 7)))) return p; - this.cursor++; - return g; - }; - this.n = function (k, l, h) { - if (this.cursor <= this.f) return p; - var c = this.j.charCodeAt(this.cursor - 1); - if (c > h || c < l) return p; - c -= l; - if (0 == (k[c >>> 3] & (1 << (c & 7)))) return p; - this.cursor--; - return g; - }; - this.k = function (k, l, h) { - if (this.cursor >= this.a) return p; - var c = this.j.charCodeAt(this.cursor); - if (c > h || c < l) return this.cursor++, g; - c -= l; - return 0 == (k[c >>> 3] & (1 << (c & 7))) ? (this.cursor++, g) : p; - }; - this.q = function (k, l, h) { - if (this.cursor <= this.f) return p; - var c = this.j.charCodeAt(this.cursor - 1); - if (c > h || c < l) return this.cursor--, g; - c -= l; - return 0 == (k[c >>> 3] & (1 << (c & 7))) ? (this.cursor--, g) : p; - }; - this.m = function (k) { - if (this.a - this.cursor < k.length || this.j.slice(this.cursor, this.cursor + k.length) != k) return p; - this.cursor += k.length; - return g; - }; - this.g = function (k) { - if (this.cursor - this.f < k.length || this.j.slice(this.cursor - k.length, this.cursor) != k) return p; - this.cursor -= k.length; - return g; - }; - this.o = function (k) { - for (var l = 0, h = k.length, c = this.cursor, a = this.a, d = 0, n = 0, v = p; ; ) { - var b = l + ((h - l) >>> 1), - f = 0, - q = d < n ? d : n, - t = k[b], - s; - for (s = q; s < t[0].length; s++) { - if (c + q == a) { - f = -1; - break; - } - f = this.j.charCodeAt(c + q) - t[0].charCodeAt(s); - if (0 != f) break; - q++; - } - 0 > f ? ((h = b), (n = q)) : ((l = b), (d = q)); - if (1 >= h - l) { - if (0 < l) break; - if (h == l) break; - if (v) break; - v = g; - } - } - for (;;) { - t = k[l]; - if (d >= t[0].length) { - this.cursor = c + t[0].length; - if (4 > t.length) return t[2]; - l = t[3](this); - this.cursor = c + t[0].length; - if (l) return t[2]; - } - l = t[1]; - if (0 > l) return 0; - } - }; - this.h = function (k) { - for (var l = 0, h = k.length, c = this.cursor, a = this.f, d = 0, n = 0, v = p; ; ) { - var b = l + ((h - l) >> 1), - f = 0, - q = d < n ? d : n, - t = k[b], - s; - for (s = t[0].length - 1 - q; 0 <= s; s--) { - if (c - q == a) { - f = -1; - break; - } - f = this.j.charCodeAt(c - 1 - q) - t[0].charCodeAt(s); - if (0 != f) break; - q++; - } - 0 > f ? ((h = b), (n = q)) : ((l = b), (d = q)); - if (1 >= h - l) { - if (0 < l) break; - if (h == l) break; - if (v) break; - v = g; - } - } - for (;;) { - t = k[l]; - if (d >= t[0].length) { - this.cursor = c - t[0].length; - if (4 > t.length) return t[2]; - l = t[3](this); - this.cursor = c - t[0].length; - if (l) return t[2]; - } - l = t[1]; - if (0 > l) return 0; - } - }; - this.s = function (k, l, h) { - var c = h.length - (l - k); - this.j = this.j.slice(0, k) + h + this.j.slice(l); - this.a += c; - this.cursor >= l ? (this.cursor += c) : this.cursor > k && (this.cursor = k); - return c; - }; - this.t = function () { - return 0 > this.c || this.c > this.d || this.d > this.a || this.a > this.j.length ? p : g; - }; - this.b = function (k) { - var l = p; - this.t() && (this.s(this.c, this.d, k), (l = g)); - return l; - }; - this.e = function () { - return this.b(""); - }; - this.r = function (k, l, h) { - l = this.s(k, l, h); - k <= this.c && (this.c += l); - k <= this.d && (this.d += l); - }; - this.u = function () { - var k = ""; - this.t() && (k = this.j.slice(this.c, this.d)); - return k; - }; - this.v = function () { - return this.j.slice(0, this.a); - }; -} - -function stem() { - function k() { - for (var b = a.cursor; ; ) { - var c = a.cursor; - a: { - b: { - var d = a.cursor; - a.c = a.cursor; - if (a.m("\u00df")) { - a.d = a.cursor; - if (!a.b("ss")) return; - break b; - } - a.cursor = d; - if (a.cursor >= a.a) break a; - a.cursor++; - } - continue; - } - a.cursor = c; - break; - } - for (a.cursor = b; ; ) { - b = a.cursor; - a: { - b: for (;;) { - c = a.cursor; - c: if (a.i(q, 97, 252)) { - a.c = a.cursor; - d: { - d = a.cursor; - if (a.m("u") && ((a.d = a.cursor), a.i(q, 97, 252))) { - if (!a.b("U")) return; - break d; - } - a.cursor = d; - if (!a.m("y")) break c; - a.d = a.cursor; - if (!a.i(q, 97, 252)) break c; - if (!a.b("Y")) return; - } - a.cursor = c; - break b; - } - a.cursor = c; - if (a.cursor >= a.a) break a; - a.cursor++; - } - continue; - } - a.cursor = b; - break; - } - } - function l() { - m = w = a.a; - var b = a.cursor, - c = a.cursor + 3; - if (!(c > a.a)) { - a.cursor = c; - r = a.cursor; - a.cursor = b; - a: for (;;) { - if (a.i(q, 97, 252)) break a; - if (a.cursor >= a.a) return; - a.cursor++; - } - a: for (;;) { - if (a.k(q, 97, 252)) break a; - if (a.cursor >= a.a) return; - a.cursor++; - } - w = a.cursor; - w < r && (w = r); - a: for (;;) { - if (a.i(q, 97, 252)) break a; - if (a.cursor >= a.a) return; - a.cursor++; - } - a: for (;;) { - if (a.k(q, 97, 252)) break a; - if (a.cursor >= a.a) return; - a.cursor++; - } - m = a.cursor; - } - } - function h() { - for (var b; ; ) { - var c = a.cursor; - a: if (((a.c = a.cursor), (b = a.o(d)), 0 != b)) { - a.d = a.cursor; - switch (b) { - case 1: - if (!a.b("y")) return; - break; - case 2: - if (!a.b("u")) return; - break; - case 3: - if (!a.b("a")) return; - break; - case 4: - if (!a.b("o")) return; - break; - case 5: - if (a.cursor >= a.a) break a; - a.cursor++; - } - continue; - } - a.cursor = c; - break; - } - } - function c() { - var c, - d = a.a - a.cursor; - a: if (((a.d = a.cursor), (c = a.h(n)), 0 != c && ((a.c = a.cursor), w <= a.cursor))) - switch (c) { - case 1: - if (!a.e()) return; - break; - case 2: - if (!a.e()) return; - c = a.a - a.cursor; - a.d = a.cursor; - if (a.g("s")) - if (((a.c = a.cursor), a.g("nis"))) { - if (!a.e()) return; - } else a.cursor = a.a - c; - else a.cursor = a.a - c; - break; - case 3: - if (!a.n(t, 98, 116)) break a; - if (!a.e()) return; - } - a.cursor = a.a - d; - d = a.a - a.cursor; - a: if (((a.d = a.cursor), (c = a.h(v)), 0 != c && ((a.c = a.cursor), w <= a.cursor))) - switch (c) { - case 1: - if (!a.e()) return; - break; - case 2: - if (!a.n(s, 98, 116)) break a; - c = a.cursor - 3; - if (c < a.f) break a; - a.cursor = c; - if (!a.e()) return; - } - a.cursor = a.a - d; - d = a.a - a.cursor; - a: if (((a.d = a.cursor), (c = a.h(f)), 0 != c && ((a.c = a.cursor), m <= a.cursor))) - switch (c) { - case 1: - if (!a.e()) return; - c = a.a - a.cursor; - b: if (((a.d = a.cursor), a.g("ig"))) { - a.c = a.cursor; - var h = a.a - a.cursor; - if (a.g("e")) { - a.cursor = a.a - c; - break b; - } - a.cursor = a.a - h; - if (m <= a.cursor) { - if (!a.e()) return; - } else a.cursor = a.a - c; - } else a.cursor = a.a - c; - break; - case 2: - c = a.a - a.cursor; - if (a.g("e")) break a; - a.cursor = a.a - c; - if (!a.e()) return; - break; - case 3: - if (!a.e()) return; - c = a.a - a.cursor; - b: { - a.d = a.cursor; - c: { - h = a.a - a.cursor; - if (a.g("er")) break c; - a.cursor = a.a - h; - if (!a.g("en")) { - a.cursor = a.a - c; - break b; - } - } - a.c = a.cursor; - if (w <= a.cursor) { - if (!a.e()) return; - } else a.cursor = a.a - c; - } - break; - case 4: - if (!a.e()) return; - c = a.a - a.cursor; - a.d = a.cursor; - if (0 == a.h(b)) a.cursor = a.a - c; - else if (((a.c = a.cursor), m <= a.cursor)) { - if (!a.e()) return; - } else a.cursor = a.a - c; - } - a.cursor = a.a - d; - } - var a = new C(), - d = [ - ["", -1, 5], - ["U", 0, 2], - ["Y", 0, 1], - ["\u00e4", 0, 3], - ["\u00f6", 0, 4], - ["\u00fc", 0, 2], - ], - n = [ - ["e", -1, 2], - ["em", -1, 1], - ["en", -1, 2], - ["ern", -1, 1], - ["er", -1, 1], - ["s", -1, 3], - ["es", 5, 2], - ], - v = [ - ["en", -1, 1], - ["er", -1, 1], - ["st", -1, 2], - ["est", 2, 1], - ], - b = [ - ["ig", -1, 1], - ["lich", -1, 1], - ], - f = [ - ["end", -1, 1], - ["ig", -1, 2], - ["ung", -1, 1], - ["lich", -1, 3], - ["isch", -1, 2], - ["ik", -1, 2], - ["heit", -1, 3], - ["keit", -1, 4], - ], - q = [17, 65, 16, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 32, 8], - t = [117, 30, 5], - s = [117, 30, 4], - r = 0, - m = 0, - w = 0; - this.l = function () { - var b = a.cursor; - k(); - a.cursor = b; - b = a.cursor; - l(); - a.cursor = b; - a.f = a.cursor; - a.cursor = a.a; - c(); - a.cursor = a.f; - b = a.cursor; - h(); - a.cursor = b; - return g; - }; - this.stemWord = function (b) { - a.p(b); - this.l(); - return a.j; - }; -} - -const stemmerInstance = new stem(); - -export function stemmer(word) { - return stemmerInstance.stemWord(word); -} diff --git a/stemmer/lib/dk.d.ts b/stemmer/lib/dk.d.ts deleted file mode 100644 index 838f68c..0000000 --- a/stemmer/lib/dk.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare function stemmer(word: string): string; diff --git a/stemmer/lib/dk.js b/stemmer/lib/dk.js deleted file mode 100644 index 2045ef9..0000000 --- a/stemmer/lib/dk.js +++ /dev/null @@ -1,335 +0,0 @@ -/* - * ----------------------------------------------------------------------------- - * GENERATED FILE - DO NOT EDIT! - * This file has been compiled using the Snowball stemmer generator. - * Don't edit this file directly. - * ----------------------------------------------------------------------------- - */ - -var g = !0, - p = !1; - -function C() { - this.p = function (k) { - this.j = k; - this.cursor = 0; - this.a = this.j.length; - this.f = 0; - this.c = this.cursor; - this.d = this.a; - }; - this.z = function () { - return this.j; - }; - this.w = function (k) { - this.j = k.j; - this.cursor = k.cursor; - this.a = k.a; - this.f = k.f; - this.c = k.c; - this.d = k.d; - }; - this.i = function (k, l, h) { - if (this.cursor >= this.a) return p; - var c = this.j.charCodeAt(this.cursor); - if (c > h || c < l) return p; - c -= l; - if (0 == (k[c >>> 3] & (1 << (c & 7)))) return p; - this.cursor++; - return g; - }; - this.n = function (k, l, h) { - if (this.cursor <= this.f) return p; - var c = this.j.charCodeAt(this.cursor - 1); - if (c > h || c < l) return p; - c -= l; - if (0 == (k[c >>> 3] & (1 << (c & 7)))) return p; - this.cursor--; - return g; - }; - this.k = function (k, l, h) { - if (this.cursor >= this.a) return p; - var c = this.j.charCodeAt(this.cursor); - if (c > h || c < l) return this.cursor++, g; - c -= l; - return 0 == (k[c >>> 3] & (1 << (c & 7))) ? (this.cursor++, g) : p; - }; - this.q = function (k, l, h) { - if (this.cursor <= this.f) return p; - var c = this.j.charCodeAt(this.cursor - 1); - if (c > h || c < l) return this.cursor--, g; - c -= l; - return 0 == (k[c >>> 3] & (1 << (c & 7))) ? (this.cursor--, g) : p; - }; - this.m = function (k) { - if (this.a - this.cursor < k.length || this.j.slice(this.cursor, this.cursor + k.length) != k) return p; - this.cursor += k.length; - return g; - }; - this.g = function (k) { - if (this.cursor - this.f < k.length || this.j.slice(this.cursor - k.length, this.cursor) != k) return p; - this.cursor -= k.length; - return g; - }; - this.o = function (k) { - for (var l = 0, h = k.length, c = this.cursor, a = this.a, d = 0, n = 0, v = p; ; ) { - var b = l + ((h - l) >>> 1), - f = 0, - q = d < n ? d : n, - t = k[b], - s; - for (s = q; s < t[0].length; s++) { - if (c + q == a) { - f = -1; - break; - } - f = this.j.charCodeAt(c + q) - t[0].charCodeAt(s); - if (0 != f) break; - q++; - } - 0 > f ? ((h = b), (n = q)) : ((l = b), (d = q)); - if (1 >= h - l) { - if (0 < l) break; - if (h == l) break; - if (v) break; - v = g; - } - } - for (;;) { - t = k[l]; - if (d >= t[0].length) { - this.cursor = c + t[0].length; - if (4 > t.length) return t[2]; - l = t[3](this); - this.cursor = c + t[0].length; - if (l) return t[2]; - } - l = t[1]; - if (0 > l) return 0; - } - }; - this.h = function (k) { - for (var l = 0, h = k.length, c = this.cursor, a = this.f, d = 0, n = 0, v = p; ; ) { - var b = l + ((h - l) >> 1), - f = 0, - q = d < n ? d : n, - t = k[b], - s; - for (s = t[0].length - 1 - q; 0 <= s; s--) { - if (c - q == a) { - f = -1; - break; - } - f = this.j.charCodeAt(c - 1 - q) - t[0].charCodeAt(s); - if (0 != f) break; - q++; - } - 0 > f ? ((h = b), (n = q)) : ((l = b), (d = q)); - if (1 >= h - l) { - if (0 < l) break; - if (h == l) break; - if (v) break; - v = g; - } - } - for (;;) { - t = k[l]; - if (d >= t[0].length) { - this.cursor = c - t[0].length; - if (4 > t.length) return t[2]; - l = t[3](this); - this.cursor = c - t[0].length; - if (l) return t[2]; - } - l = t[1]; - if (0 > l) return 0; - } - }; - this.s = function (k, l, h) { - var c = h.length - (l - k); - this.j = this.j.slice(0, k) + h + this.j.slice(l); - this.a += c; - this.cursor >= l ? (this.cursor += c) : this.cursor > k && (this.cursor = k); - return c; - }; - this.t = function () { - return 0 > this.c || this.c > this.d || this.d > this.a || this.a > this.j.length ? p : g; - }; - this.b = function (k) { - var l = p; - this.t() && (this.s(this.c, this.d, k), (l = g)); - return l; - }; - this.e = function () { - return this.b(""); - }; - this.r = function (k, l, h) { - l = this.s(k, l, h); - k <= this.c && (this.c += l); - k <= this.d && (this.d += l); - }; - this.u = function () { - var k = ""; - this.t() && (k = this.j.slice(this.c, this.d)); - return k; - }; - this.v = function () { - return this.j.slice(0, this.a); - }; -} - -function stem() { - function k() { - var a = l.a - l.cursor; - if (!(l.cursor < f)) { - var b = l.f; - l.f = f; - l.d = l.cursor; - 0 == l.h(c) - ? (l.f = b) - : ((l.c = l.cursor), (l.f = b), (l.cursor = l.a - a), l.cursor <= l.f || (l.cursor--, (l.c = l.cursor), l.e())); - } - } - var l = new C(), - h = [ - ["hed", -1, 1], - ["ethed", 0, 1], - ["ered", -1, 1], - ["e", -1, 1], - ["erede", 3, 1], - ["ende", 3, 1], - ["erende", 5, 1], - ["ene", 3, 1], - ["erne", 3, 1], - ["ere", 3, 1], - ["en", -1, 1], - ["heden", 10, 1], - ["eren", 10, 1], - ["er", -1, 1], - ["heder", 13, 1], - ["erer", 13, 1], - ["s", -1, 2], - ["heds", 16, 1], - ["es", 16, 1], - ["endes", 18, 1], - ["erendes", 19, 1], - ["enes", 18, 1], - ["ernes", 18, 1], - ["eres", 18, 1], - ["ens", 16, 1], - ["hedens", 24, 1], - ["erens", 24, 1], - ["ers", 16, 1], - ["ets", 16, 1], - ["erets", 28, 1], - ["et", -1, 1], - ["eret", 30, 1], - ], - c = [ - ["gd", -1, -1], - ["dt", -1, -1], - ["gt", -1, -1], - ["kt", -1, -1], - ], - a = [ - ["ig", -1, 1], - ["lig", 0, 1], - ["elig", 1, 1], - ["els", -1, 1], - ["l\u00f8st", -1, 2], - ], - d = [119, 223, 119, 1], - n = [17, 65, 16, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 48, 0, 128], - v = [239, 254, 42, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16], - b = 0, - f = 0, - q = ""; - this.l = function () { - var c = l.cursor; - a: { - f = l.a; - var s = l.cursor, - r = l.cursor + 3; - if (!(r > l.a)) { - l.cursor = r; - b = l.cursor; - l.cursor = s; - b: for (;;) { - s = l.cursor; - if (l.i(n, 97, 248)) { - l.cursor = s; - break b; - } - l.cursor = s; - if (l.cursor >= l.a) break a; - l.cursor++; - } - b: for (;;) { - if (l.k(n, 97, 248)) break b; - if (l.cursor >= l.a) break a; - l.cursor++; - } - f = l.cursor; - f < b && (f = b); - } - } - l.cursor = c; - l.f = l.cursor; - l.cursor = l.a; - c = l.a - l.cursor; - if (!(l.cursor < f)) - if (((r = l.f), (l.f = f), (l.d = l.cursor), (s = l.h(h)), 0 == s)) l.f = r; - else - switch (((l.c = l.cursor), (l.f = r), s)) { - case 1: - if (!l.e()) break; - break; - case 2: - !l.n(v, 97, 229) || l.e(); - } - l.cursor = l.a - c; - c = l.a - l.cursor; - k(); - l.cursor = l.a - c; - c = l.a - l.cursor; - a: { - s = l.a - l.cursor; - l.d = l.cursor; - if (l.g("st") && ((l.c = l.cursor), l.g("ig") && !l.e())) break a; - l.cursor = l.a - s; - if (!(l.cursor < f)) - if (((r = l.f), (l.f = f), (l.d = l.cursor), (s = l.h(a)), 0 == s)) l.f = r; - else - switch (((l.c = l.cursor), (l.f = r), s)) { - case 1: - if (!l.e()) break; - s = l.a - l.cursor; - k(); - l.cursor = l.a - s; - break; - case 2: - l.b("l\u00f8s"); - } - } - l.cursor = l.a - c; - c = l.a - l.cursor; - l.cursor < f || - ((s = l.f), - (l.f = f), - (l.d = l.cursor), - l.n(d, 98, 122) ? ((l.c = l.cursor), (q = l.u()), "" != q && ((l.f = s), !l.g(q) || l.e())) : (l.f = s)); - l.cursor = l.a - c; - l.cursor = l.f; - return g; - }; - this.stemWord = function (a) { - l.p(a); - this.l(); - return l.j; - }; -} -const stemmerInstance = new stem(); - -export function stemmer(word) { - return stemmerInstance.stemWord(word); -} diff --git a/stemmer/lib/en.d.ts b/stemmer/lib/en.d.ts deleted file mode 100644 index 838f68c..0000000 --- a/stemmer/lib/en.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare function stemmer(word: string): string; diff --git a/stemmer/lib/en.js b/stemmer/lib/en.js deleted file mode 100644 index b783dc9..0000000 --- a/stemmer/lib/en.js +++ /dev/null @@ -1,189 +0,0 @@ -const step2List = { - ational: "ate", - tional: "tion", - enci: "ence", - anci: "ance", - izer: "ize", - bli: "ble", - alli: "al", - entli: "ent", - eli: "e", - ousli: "ous", - ization: "ize", - ation: "ate", - ator: "ate", - alism: "al", - iveness: "ive", - fulness: "ful", - ousness: "ous", - aliti: "al", - iviti: "ive", - biliti: "ble", - logi: "log", -}; - -const step3List = { - icate: "ic", - ative: "", - alize: "al", - iciti: "ic", - ical: "ic", - ful: "", - ness: "", -}; - -// Consonant -const c = "[^aeiou]"; -// Vowel -const v = "[aeiouy]"; -// Consonant sequence -const C = c + "[^aeiouy]*"; -// Vowel sequence -const V = v + "[aeiou]*"; - -// [C]VC... is m>0 -const mgr0 = "^(" + C + ")?" + V + C; -// [C]VC[V] is m=1 -const meq1 = "^(" + C + ")?" + V + C + "(" + V + ")?$"; -// [C]VCVC... is m>1 -const mgr1 = "^(" + C + ")?" + V + C + V + C; -// vowel in stem -const s_v = "^(" + C + ")?" + v; - -export function stemmer(w) { - let stem; - let suffix; - let re; - let re2; - let re3; - let re4; - - if (w.length < 3) { - return w; - } - - const firstch = w.substring(0, 1); - if (firstch == "y") { - w = firstch.toUpperCase() + w.substring(1); - } - - re = /^(.+?)(ss|i)es$/; - re2 = /^(.+?)([^s])s$/; - - if (re.test(w)) { - w = w.replace(re, "$1$2"); - } else if (re2.test(w)) { - w = w.replace(re2, "$1$2"); - } - - re = /^(.+?)eed$/; - re2 = /^(.+?)(ed|ing)$/; - if (re.test(w)) { - const fp = re.exec(w); - re = new RegExp(mgr0); - if (re.test(fp[1])) { - re = /.$/; - w = w.replace(re, ""); - } - } else if (re2.test(w)) { - const fp = re2.exec(w); - stem = fp[1]; - re2 = new RegExp(s_v); - if (re2.test(stem)) { - w = stem; - re2 = /(at|bl|iz)$/; - re3 = new RegExp("([^aeiouylsz])\\1$"); - re4 = new RegExp("^" + C + v + "[^aeiouwxy]$"); - if (re2.test(w)) { - w = w + "e"; - } else if (re3.test(w)) { - re = /.$/; - w = w.replace(re, ""); - } else if (re4.test(w)) { - w = w + "e"; - } - } - } - - re = /^(.+?)y$/; - if (re.test(w)) { - const fp = re.exec(w); - stem = fp?.[1]; - re = new RegExp(s_v); - if (stem && re.test(stem)) { - w = stem + "i"; - } - } - - re = - /^(.+?)(ational|tional|enci|anci|izer|bli|alli|entli|eli|ousli|ization|ation|ator|alism|iveness|fulness|ousness|aliti|iviti|biliti|logi)$/; - if (re.test(w)) { - const fp = re.exec(w); - stem = fp?.[1]; - suffix = fp?.[2]; - re = new RegExp(mgr0); - if (stem && re.test(stem)) { - // eslint-disable-next-line @typescript-eslint/ban-ts-comment - // @ts-ignore - w = stem + step2List[suffix]; - } - } - - re = /^(.+?)(icate|ative|alize|iciti|ical|ful|ness)$/; - if (re.test(w)) { - const fp = re.exec(w); - stem = fp?.[1]; - suffix = fp?.[2]; - re = new RegExp(mgr0); - // eslint-disable-next-line @typescript-eslint/ban-ts-comment - // @ts-ignore - if (stem && re.test(stem)) { - // eslint-disable-next-line @typescript-eslint/ban-ts-comment - // @ts-ignore - w = stem + step3List[suffix]; - } - } - - re = /^(.+?)(al|ance|ence|er|ic|able|ible|ant|ement|ment|ent|ou|ism|ate|iti|ous|ive|ize)$/; - re2 = /^(.+?)(s|t)(ion)$/; - if (re.test(w)) { - const fp = re.exec(w); - stem = fp?.[1]; - re = new RegExp(mgr1); - if (stem && re.test(stem)) { - w = stem; - } - } else if (re2.test(w)) { - const fp = re2.exec(w); - stem = fp?.[1] ?? "" + fp?.[2] ?? ""; - re2 = new RegExp(mgr1); - if (re2.test(stem)) { - w = stem; - } - } - - re = /^(.+?)e$/; - if (re.test(w)) { - const fp = re.exec(w); - stem = fp?.[1]; - re = new RegExp(mgr1); - re2 = new RegExp(meq1); - re3 = new RegExp("^" + C + v + "[^aeiouwxy]$"); - if (stem && (re.test(stem) || (re2.test(stem) && !re3.test(stem)))) { - w = stem; - } - } - - re = /ll$/; - re2 = new RegExp(mgr1); - if (re.test(w) && re2.test(w)) { - re = /.$/; - w = w.replace(re, ""); - } - - if (firstch == "y") { - w = firstch.toLowerCase() + w.substring(1); - } - - return w; -} diff --git a/stemmer/lib/es.d.ts b/stemmer/lib/es.d.ts deleted file mode 100644 index 838f68c..0000000 --- a/stemmer/lib/es.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare function stemmer(word: string): string; diff --git a/stemmer/lib/es.js b/stemmer/lib/es.js deleted file mode 100644 index 77520c6..0000000 --- a/stemmer/lib/es.js +++ /dev/null @@ -1,704 +0,0 @@ -/* - * ----------------------------------------------------------------------------- - * GENERATED FILE - DO NOT EDIT! - * This file has been compiled using the Snowball stemmer generator. - * Don't edit this file directly. - * ----------------------------------------------------------------------------- - */ - -var g = !0, - p = !1; - -function C() { - this.p = function (k) { - this.j = k; - this.cursor = 0; - this.a = this.j.length; - this.f = 0; - this.c = this.cursor; - this.d = this.a; - }; - this.z = function () { - return this.j; - }; - this.w = function (k) { - this.j = k.j; - this.cursor = k.cursor; - this.a = k.a; - this.f = k.f; - this.c = k.c; - this.d = k.d; - }; - this.i = function (k, l, h) { - if (this.cursor >= this.a) return p; - var c = this.j.charCodeAt(this.cursor); - if (c > h || c < l) return p; - c -= l; - if (0 == (k[c >>> 3] & (1 << (c & 7)))) return p; - this.cursor++; - return g; - }; - this.n = function (k, l, h) { - if (this.cursor <= this.f) return p; - var c = this.j.charCodeAt(this.cursor - 1); - if (c > h || c < l) return p; - c -= l; - if (0 == (k[c >>> 3] & (1 << (c & 7)))) return p; - this.cursor--; - return g; - }; - this.k = function (k, l, h) { - if (this.cursor >= this.a) return p; - var c = this.j.charCodeAt(this.cursor); - if (c > h || c < l) return this.cursor++, g; - c -= l; - return 0 == (k[c >>> 3] & (1 << (c & 7))) ? (this.cursor++, g) : p; - }; - this.q = function (k, l, h) { - if (this.cursor <= this.f) return p; - var c = this.j.charCodeAt(this.cursor - 1); - if (c > h || c < l) return this.cursor--, g; - c -= l; - return 0 == (k[c >>> 3] & (1 << (c & 7))) ? (this.cursor--, g) : p; - }; - this.m = function (k) { - if (this.a - this.cursor < k.length || this.j.slice(this.cursor, this.cursor + k.length) != k) return p; - this.cursor += k.length; - return g; - }; - this.g = function (k) { - if (this.cursor - this.f < k.length || this.j.slice(this.cursor - k.length, this.cursor) != k) return p; - this.cursor -= k.length; - return g; - }; - this.o = function (k) { - for (var l = 0, h = k.length, c = this.cursor, a = this.a, d = 0, n = 0, v = p; ; ) { - var b = l + ((h - l) >>> 1), - f = 0, - q = d < n ? d : n, - t = k[b], - s; - for (s = q; s < t[0].length; s++) { - if (c + q == a) { - f = -1; - break; - } - f = this.j.charCodeAt(c + q) - t[0].charCodeAt(s); - if (0 != f) break; - q++; - } - 0 > f ? ((h = b), (n = q)) : ((l = b), (d = q)); - if (1 >= h - l) { - if (0 < l) break; - if (h == l) break; - if (v) break; - v = g; - } - } - for (;;) { - t = k[l]; - if (d >= t[0].length) { - this.cursor = c + t[0].length; - if (4 > t.length) return t[2]; - l = t[3](this); - this.cursor = c + t[0].length; - if (l) return t[2]; - } - l = t[1]; - if (0 > l) return 0; - } - }; - this.h = function (k) { - for (var l = 0, h = k.length, c = this.cursor, a = this.f, d = 0, n = 0, v = p; ; ) { - var b = l + ((h - l) >> 1), - f = 0, - q = d < n ? d : n, - t = k[b], - s; - for (s = t[0].length - 1 - q; 0 <= s; s--) { - if (c - q == a) { - f = -1; - break; - } - f = this.j.charCodeAt(c - 1 - q) - t[0].charCodeAt(s); - if (0 != f) break; - q++; - } - 0 > f ? ((h = b), (n = q)) : ((l = b), (d = q)); - if (1 >= h - l) { - if (0 < l) break; - if (h == l) break; - if (v) break; - v = g; - } - } - for (;;) { - t = k[l]; - if (d >= t[0].length) { - this.cursor = c - t[0].length; - if (4 > t.length) return t[2]; - l = t[3](this); - this.cursor = c - t[0].length; - if (l) return t[2]; - } - l = t[1]; - if (0 > l) return 0; - } - }; - this.s = function (k, l, h) { - var c = h.length - (l - k); - this.j = this.j.slice(0, k) + h + this.j.slice(l); - this.a += c; - this.cursor >= l ? (this.cursor += c) : this.cursor > k && (this.cursor = k); - return c; - }; - this.t = function () { - return 0 > this.c || this.c > this.d || this.d > this.a || this.a > this.j.length ? p : g; - }; - this.b = function (k) { - var l = p; - this.t() && (this.s(this.c, this.d, k), (l = g)); - return l; - }; - this.e = function () { - return this.b(""); - }; - this.r = function (k, l, h) { - l = this.s(k, l, h); - k <= this.c && (this.c += l); - k <= this.d && (this.d += l); - }; - this.u = function () { - var k = ""; - this.t() && (k = this.j.slice(this.c, this.d)); - return k; - }; - this.v = function () { - return this.j.slice(0, this.a); - }; -} - -function stem() { - function k() { - for (var a; ; ) { - var b = d.cursor; - a: if (((d.c = d.cursor), (a = d.o(n)), 0 != a)) { - d.d = d.cursor; - switch (a) { - case 1: - if (!d.b("a")) return; - break; - case 2: - if (!d.b("e")) return; - break; - case 3: - if (!d.b("i")) return; - break; - case 4: - if (!d.b("o")) return; - break; - case 5: - if (!d.b("u")) return; - break; - case 6: - if (d.cursor >= d.a) break a; - d.cursor++; - } - continue; - } - d.cursor = b; - break; - } - } - function l() { - return !(e <= d.cursor) ? p : g; - } - function h() { - return !(y <= d.cursor) ? p : g; - } - function c() { - var a; - d.d = d.cursor; - a = d.h(s); - if (0 == a) return p; - d.c = d.cursor; - switch (a) { - case 1: - if (!h() || !d.e()) return p; - break; - case 2: - if (!h() || !d.e()) return p; - a = d.a - d.cursor; - d.d = d.cursor; - if (d.g("ic")) - if (((d.c = d.cursor), h())) { - if (!d.e()) return p; - } else d.cursor = d.a - a; - else d.cursor = d.a - a; - break; - case 3: - if (!h() || !d.b("log")) return p; - break; - case 4: - if (!h() || !d.b("u")) return p; - break; - case 5: - if (!h() || !d.b("ente")) return p; - break; - case 6: - if (!(z <= d.cursor) || !d.e()) return p; - var b = d.a - d.cursor; - a: if (((d.d = d.cursor), (a = d.h(f)), 0 == a)) d.cursor = d.a - b; - else if (((d.c = d.cursor), h())) { - if (!d.e()) return p; - switch (a) { - case 1: - d.d = d.cursor; - if (!d.g("at")) { - d.cursor = d.a - b; - break a; - } - d.c = d.cursor; - if (!h()) { - d.cursor = d.a - b; - break a; - } - if (!d.e()) return p; - } - } else d.cursor = d.a - b; - break; - case 7: - if (!h() || !d.e()) return p; - a = d.a - d.cursor; - d.d = d.cursor; - if (0 == d.h(q)) d.cursor = d.a - a; - else if (((d.c = d.cursor), h())) { - if (!d.e()) return p; - } else d.cursor = d.a - a; - break; - case 8: - if (!h() || !d.e()) return p; - a = d.a - d.cursor; - d.d = d.cursor; - if (0 == d.h(t)) d.cursor = d.a - a; - else if (((d.c = d.cursor), h())) { - if (!d.e()) return p; - } else d.cursor = d.a - a; - break; - case 9: - if (!h() || !d.e()) return p; - a = d.a - d.cursor; - d.d = d.cursor; - if (d.g("at")) - if (((d.c = d.cursor), h())) { - if (!d.e()) return p; - } else d.cursor = d.a - a; - else d.cursor = d.a - a; - } - return g; - } - function a() { - if (d.cursor < e) return p; - var a = d.f; - d.f = e; - d.d = d.cursor; - if (0 == d.h(r)) return (d.f = a), p; - d.c = d.cursor; - d.f = a; - return !d.g("u") || !d.e() ? p : g; - } - var d = new C(), - n = [ - ["", -1, 6], - ["\u00e1", 0, 1], - ["\u00e9", 0, 2], - ["\u00ed", 0, 3], - ["\u00f3", 0, 4], - ["\u00fa", 0, 5], - ], - v = [ - ["la", -1, -1], - ["sela", 0, -1], - ["le", -1, -1], - ["me", -1, -1], - ["se", -1, -1], - ["lo", -1, -1], - ["selo", 5, -1], - ["las", -1, -1], - ["selas", 7, -1], - ["les", -1, -1], - ["los", -1, -1], - ["selos", 10, -1], - ["nos", -1, -1], - ], - b = [ - ["ando", -1, 6], - ["iendo", -1, 6], - ["yendo", -1, 7], - ["\u00e1ndo", -1, 2], - ["i\u00e9ndo", -1, 1], - ["ar", -1, 6], - ["er", -1, 6], - ["ir", -1, 6], - ["\u00e1r", -1, 3], - ["\u00e9r", -1, 4], - ["\u00edr", -1, 5], - ], - f = [ - ["ic", -1, -1], - ["ad", -1, -1], - ["os", -1, -1], - ["iv", -1, 1], - ], - q = [ - ["able", -1, 1], - ["ible", -1, 1], - ["ante", -1, 1], - ], - t = [ - ["ic", -1, 1], - ["abil", -1, 1], - ["iv", -1, 1], - ], - s = [ - ["ica", -1, 1], - ["ancia", -1, 2], - ["encia", -1, 5], - ["adora", -1, 2], - ["osa", -1, 1], - ["ista", -1, 1], - ["iva", -1, 9], - ["anza", -1, 1], - ["log\u00eda", -1, 3], - ["idad", -1, 8], - ["able", -1, 1], - ["ible", -1, 1], - ["ante", -1, 2], - ["mente", -1, 7], - ["amente", 13, 6], - ["aci\u00f3n", -1, 2], - ["uci\u00f3n", -1, 4], - ["ico", -1, 1], - ["ismo", -1, 1], - ["oso", -1, 1], - ["amiento", -1, 1], - ["imiento", -1, 1], - ["ivo", -1, 9], - ["ador", -1, 2], - ["icas", -1, 1], - ["ancias", -1, 2], - ["encias", -1, 5], - ["adoras", -1, 2], - ["osas", -1, 1], - ["istas", -1, 1], - ["ivas", -1, 9], - ["anzas", -1, 1], - ["log\u00edas", -1, 3], - ["idades", -1, 8], - ["ables", -1, 1], - ["ibles", -1, 1], - ["aciones", -1, 2], - ["uciones", -1, 4], - ["adores", -1, 2], - ["antes", -1, 2], - ["icos", -1, 1], - ["ismos", -1, 1], - ["osos", -1, 1], - ["amientos", -1, 1], - ["imientos", -1, 1], - ["ivos", -1, 9], - ], - r = [ - ["ya", -1, 1], - ["ye", -1, 1], - ["yan", -1, 1], - ["yen", -1, 1], - ["yeron", -1, 1], - ["yendo", -1, 1], - ["yo", -1, 1], - ["yas", -1, 1], - ["yes", -1, 1], - ["yais", -1, 1], - ["yamos", -1, 1], - ["y\u00f3", -1, 1], - ], - m = [ - ["aba", -1, 2], - ["ada", -1, 2], - ["ida", -1, 2], - ["ara", -1, 2], - ["iera", -1, 2], - ["\u00eda", -1, 2], - ["ar\u00eda", 5, 2], - ["er\u00eda", 5, 2], - ["ir\u00eda", 5, 2], - ["ad", -1, 2], - ["ed", -1, 2], - ["id", -1, 2], - ["ase", -1, 2], - ["iese", -1, 2], - ["aste", -1, 2], - ["iste", -1, 2], - ["an", -1, 2], - ["aban", 16, 2], - ["aran", 16, 2], - ["ieran", 16, 2], - ["\u00edan", 16, 2], - ["ar\u00edan", 20, 2], - ["er\u00edan", 20, 2], - ["ir\u00edan", 20, 2], - ["en", -1, 1], - ["asen", 24, 2], - ["iesen", 24, 2], - ["aron", -1, 2], - ["ieron", -1, 2], - ["ar\u00e1n", -1, 2], - ["er\u00e1n", -1, 2], - ["ir\u00e1n", -1, 2], - ["ado", -1, 2], - ["ido", -1, 2], - ["ando", -1, 2], - ["iendo", -1, 2], - ["ar", -1, 2], - ["er", -1, 2], - ["ir", -1, 2], - ["as", -1, 2], - ["abas", 39, 2], - ["adas", 39, 2], - ["idas", 39, 2], - ["aras", 39, 2], - ["ieras", 39, 2], - ["\u00edas", 39, 2], - ["ar\u00edas", 45, 2], - ["er\u00edas", 45, 2], - ["ir\u00edas", 45, 2], - ["es", -1, 1], - ["ases", 49, 2], - ["ieses", 49, 2], - ["abais", -1, 2], - ["arais", -1, 2], - ["ierais", -1, 2], - ["\u00edais", -1, 2], - ["ar\u00edais", 55, 2], - ["er\u00edais", 55, 2], - ["ir\u00edais", 55, 2], - ["aseis", -1, 2], - ["ieseis", -1, 2], - ["asteis", -1, 2], - ["isteis", -1, 2], - ["\u00e1is", -1, 2], - ["\u00e9is", -1, 1], - ["ar\u00e9is", 64, 2], - ["er\u00e9is", 64, 2], - ["ir\u00e9is", 64, 2], - ["ados", -1, 2], - ["idos", -1, 2], - ["amos", -1, 2], - ["\u00e1bamos", 70, 2], - ["\u00e1ramos", 70, 2], - ["i\u00e9ramos", 70, 2], - ["\u00edamos", 70, 2], - ["ar\u00edamos", 74, 2], - ["er\u00edamos", 74, 2], - ["ir\u00edamos", 74, 2], - ["emos", -1, 1], - ["aremos", 78, 2], - ["eremos", 78, 2], - ["iremos", 78, 2], - ["\u00e1semos", 78, 2], - ["i\u00e9semos", 78, 2], - ["imos", -1, 2], - ["ar\u00e1s", -1, 2], - ["er\u00e1s", -1, 2], - ["ir\u00e1s", -1, 2], - ["\u00eds", -1, 2], - ["ar\u00e1", -1, 2], - ["er\u00e1", -1, 2], - ["ir\u00e1", -1, 2], - ["ar\u00e9", -1, 2], - ["er\u00e9", -1, 2], - ["ir\u00e9", -1, 2], - ["i\u00f3", -1, 2], - ], - w = [ - ["a", -1, 1], - ["e", -1, 2], - ["o", -1, 1], - ["os", -1, 1], - ["\u00e1", -1, 1], - ["\u00e9", -1, 2], - ["\u00ed", -1, 1], - ["\u00f3", -1, 1], - ], - u = [17, 65, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 17, 4, 10], - y = 0, - z = 0, - e = 0; - this.l = function () { - y = z = e = d.a; - var f = d.cursor; - a: { - b: { - var h = d.cursor; - c: if (d.i(u, 97, 252)) { - d: { - var n = d.cursor; - e: if (d.k(u, 97, 252)) { - f: for (;;) { - if (d.i(u, 97, 252)) break f; - if (d.cursor >= d.a) break e; - d.cursor++; - } - break d; - } - d.cursor = n; - if (!d.i(u, 97, 252)) break c; - e: for (;;) { - if (d.k(u, 97, 252)) break e; - if (d.cursor >= d.a) break c; - d.cursor++; - } - } - break b; - } - d.cursor = h; - if (!d.k(u, 97, 252)) break a; - c: { - h = d.cursor; - d: if (d.k(u, 97, 252)) { - e: for (;;) { - if (d.i(u, 97, 252)) break e; - if (d.cursor >= d.a) break d; - d.cursor++; - } - break c; - } - d.cursor = h; - if (!d.i(u, 97, 252)) break a; - if (d.cursor >= d.a) break a; - d.cursor++; - } - } - e = d.cursor; - } - d.cursor = f; - f = d.cursor; - a: { - b: for (;;) { - if (d.i(u, 97, 252)) break b; - if (d.cursor >= d.a) break a; - d.cursor++; - } - b: for (;;) { - if (d.k(u, 97, 252)) break b; - if (d.cursor >= d.a) break a; - d.cursor++; - } - z = d.cursor; - b: for (;;) { - if (d.i(u, 97, 252)) break b; - if (d.cursor >= d.a) break a; - d.cursor++; - } - b: for (;;) { - if (d.k(u, 97, 252)) break b; - if (d.cursor >= d.a) break a; - d.cursor++; - } - y = d.cursor; - } - d.cursor = f; - d.f = d.cursor; - d.cursor = d.a; - f = d.a - d.cursor; - d.d = d.cursor; - if (0 != d.h(v) && ((d.c = d.cursor), (h = d.h(b)), 0 != h && l())) - switch (h) { - case 1: - d.c = d.cursor; - if (!d.b("iendo")) break; - break; - case 2: - d.c = d.cursor; - if (!d.b("ando")) break; - break; - case 3: - d.c = d.cursor; - if (!d.b("ar")) break; - break; - case 4: - d.c = d.cursor; - if (!d.b("er")) break; - break; - case 5: - d.c = d.cursor; - if (!d.b("ir")) break; - break; - case 6: - if (!d.e()) break; - break; - case 7: - !d.g("u") || d.e(); - } - d.cursor = d.a - f; - f = d.a - d.cursor; - b: { - h = d.a - d.cursor; - if (c()) break b; - d.cursor = d.a - h; - if (a()) break b; - d.cursor = d.a - h; - if (!(d.cursor < e)) - if (((n = d.f), (d.f = e), (d.d = d.cursor), (h = d.h(m)), 0 == h)) d.f = n; - else - switch (((d.c = d.cursor), (d.f = n), h)) { - case 1: - h = d.a - d.cursor; - d.g("u") - ? ((n = d.a - d.cursor), d.g("g") ? (d.cursor = d.a - n) : (d.cursor = d.a - h)) - : (d.cursor = d.a - h); - d.c = d.cursor; - if (!d.e()) break; - break; - case 2: - d.e(); - } - } - d.cursor = d.a - f; - f = d.a - d.cursor; - d.d = d.cursor; - h = d.h(w); - if (0 != h) - switch (((d.c = d.cursor), h)) { - case 1: - if (!l() || !d.e()) break; - break; - case 2: - if (!l() || !d.e()) break; - h = d.a - d.cursor; - d.d = d.cursor; - d.g("u") - ? ((d.c = d.cursor), - (n = d.a - d.cursor), - d.g("g") ? ((d.cursor = d.a - n), l() ? d.e() : (d.cursor = d.a - h)) : (d.cursor = d.a - h)) - : (d.cursor = d.a - h); - } - d.cursor = d.a - f; - d.cursor = d.f; - f = d.cursor; - k(); - d.cursor = f; - return g; - }; - this.stemWord = function (a) { - d.p(a); - this.l(); - return d.j; - }; -} - -const stemmerInstance = new stem(); - -export function stemmer(word) { - return stemmerInstance.stemWord(word); -} diff --git a/stemmer/lib/fi.d.ts b/stemmer/lib/fi.d.ts deleted file mode 100644 index 838f68c..0000000 --- a/stemmer/lib/fi.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare function stemmer(word: string): string; diff --git a/stemmer/lib/fi.js b/stemmer/lib/fi.js deleted file mode 100644 index ee1c3d6..0000000 --- a/stemmer/lib/fi.js +++ /dev/null @@ -1,565 +0,0 @@ -/* - * ----------------------------------------------------------------------------- - * GENERATED FILE - DO NOT EDIT! - * This file has been compiled using the Snowball stemmer generator. - * Don't edit this file directly. - * ----------------------------------------------------------------------------- - */ - -var g = !0, - p = !1; - -function C() { - this.p = function (k) { - this.j = k; - this.cursor = 0; - this.a = this.j.length; - this.f = 0; - this.c = this.cursor; - this.d = this.a; - }; - this.z = function () { - return this.j; - }; - this.w = function (k) { - this.j = k.j; - this.cursor = k.cursor; - this.a = k.a; - this.f = k.f; - this.c = k.c; - this.d = k.d; - }; - this.i = function (k, l, h) { - if (this.cursor >= this.a) return p; - var c = this.j.charCodeAt(this.cursor); - if (c > h || c < l) return p; - c -= l; - if (0 == (k[c >>> 3] & (1 << (c & 7)))) return p; - this.cursor++; - return g; - }; - this.n = function (k, l, h) { - if (this.cursor <= this.f) return p; - var c = this.j.charCodeAt(this.cursor - 1); - if (c > h || c < l) return p; - c -= l; - if (0 == (k[c >>> 3] & (1 << (c & 7)))) return p; - this.cursor--; - return g; - }; - this.k = function (k, l, h) { - if (this.cursor >= this.a) return p; - var c = this.j.charCodeAt(this.cursor); - if (c > h || c < l) return this.cursor++, g; - c -= l; - return 0 == (k[c >>> 3] & (1 << (c & 7))) ? (this.cursor++, g) : p; - }; - this.q = function (k, l, h) { - if (this.cursor <= this.f) return p; - var c = this.j.charCodeAt(this.cursor - 1); - if (c > h || c < l) return this.cursor--, g; - c -= l; - return 0 == (k[c >>> 3] & (1 << (c & 7))) ? (this.cursor--, g) : p; - }; - this.m = function (k) { - if (this.a - this.cursor < k.length || this.j.slice(this.cursor, this.cursor + k.length) != k) return p; - this.cursor += k.length; - return g; - }; - this.g = function (k) { - if (this.cursor - this.f < k.length || this.j.slice(this.cursor - k.length, this.cursor) != k) return p; - this.cursor -= k.length; - return g; - }; - this.o = function (k) { - for (var l = 0, h = k.length, c = this.cursor, a = this.a, d = 0, n = 0, v = p; ; ) { - var b = l + ((h - l) >>> 1), - f = 0, - q = d < n ? d : n, - t = k[b], - s; - for (s = q; s < t[0].length; s++) { - if (c + q == a) { - f = -1; - break; - } - f = this.j.charCodeAt(c + q) - t[0].charCodeAt(s); - if (0 != f) break; - q++; - } - 0 > f ? ((h = b), (n = q)) : ((l = b), (d = q)); - if (1 >= h - l) { - if (0 < l) break; - if (h == l) break; - if (v) break; - v = g; - } - } - for (;;) { - t = k[l]; - if (d >= t[0].length) { - this.cursor = c + t[0].length; - if (4 > t.length) return t[2]; - l = t[3](this); - this.cursor = c + t[0].length; - if (l) return t[2]; - } - l = t[1]; - if (0 > l) return 0; - } - }; - this.h = function (k) { - for (var l = 0, h = k.length, c = this.cursor, a = this.f, d = 0, n = 0, v = p; ; ) { - var b = l + ((h - l) >> 1), - f = 0, - q = d < n ? d : n, - t = k[b], - s; - for (s = t[0].length - 1 - q; 0 <= s; s--) { - if (c - q == a) { - f = -1; - break; - } - f = this.j.charCodeAt(c - 1 - q) - t[0].charCodeAt(s); - if (0 != f) break; - q++; - } - 0 > f ? ((h = b), (n = q)) : ((l = b), (d = q)); - if (1 >= h - l) { - if (0 < l) break; - if (h == l) break; - if (v) break; - v = g; - } - } - for (;;) { - t = k[l]; - if (d >= t[0].length) { - this.cursor = c - t[0].length; - if (4 > t.length) return t[2]; - l = t[3](this); - this.cursor = c - t[0].length; - if (l) return t[2]; - } - l = t[1]; - if (0 > l) return 0; - } - }; - this.s = function (k, l, h) { - var c = h.length - (l - k); - this.j = this.j.slice(0, k) + h + this.j.slice(l); - this.a += c; - this.cursor >= l ? (this.cursor += c) : this.cursor > k && (this.cursor = k); - return c; - }; - this.t = function () { - return 0 > this.c || this.c > this.d || this.d > this.a || this.a > this.j.length ? p : g; - }; - this.b = function (k) { - var l = p; - this.t() && (this.s(this.c, this.d, k), (l = g)); - return l; - }; - this.e = function () { - return this.b(""); - }; - this.r = function (k, l, h) { - l = this.s(k, l, h); - k <= this.c && (this.c += l); - k <= this.d && (this.d += l); - }; - this.u = function () { - var k = ""; - this.t() && (k = this.j.slice(this.c, this.d)); - return k; - }; - this.v = function () { - return this.j.slice(0, this.a); - }; -} - -function stem() { - function k() { - E = x = d.a; - a: for (;;) { - var a = d.cursor; - if (d.i(z, 97, 246)) { - d.cursor = a; - break a; - } - d.cursor = a; - if (d.cursor >= d.a) return; - d.cursor++; - } - a: for (;;) { - if (d.k(z, 97, 246)) break a; - if (d.cursor >= d.a) return; - d.cursor++; - } - x = d.cursor; - a: for (;;) { - a = d.cursor; - if (d.i(z, 97, 246)) { - d.cursor = a; - break a; - } - d.cursor = a; - if (d.cursor >= d.a) return; - d.cursor++; - } - a: for (;;) { - if (d.k(z, 97, 246)) break a; - if (d.cursor >= d.a) return; - d.cursor++; - } - E = d.cursor; - } - function l() { - return 0 == d.h(t) ? p : g; - } - function h() { - return !d.g("i") || !d.n(e, 97, 246) ? p : g; - } - function c() { - var a; - if (!(d.cursor < x)) { - var b = d.f; - d.f = x; - d.d = d.cursor; - a = d.h(s); - if (0 == a) d.f = b; - else { - d.c = d.cursor; - d.f = b; - switch (a) { - case 1: - if (!d.g("a")) return; - break; - case 2: - if (!d.g("e")) return; - break; - case 3: - if (!d.g("i")) return; - break; - case 4: - if (!d.g("o")) return; - break; - case 5: - if (!d.g("\u00e4")) return; - break; - case 6: - if (!d.g("\u00f6")) return; - break; - case 7: - a = d.a - d.cursor; - a: { - b = d.a - d.cursor; - b: { - var c = d.a - d.cursor; - if (l()) break b; - d.cursor = d.a - c; - if (!d.g("ie")) { - d.cursor = d.a - a; - break a; - } - } - d.cursor = d.a - b; - d.cursor <= d.f ? (d.cursor = d.a - a) : (d.cursor--, (d.c = d.cursor)); - } - break; - case 8: - if (!d.n(z, 97, 246) || !d.n(y, 98, 122)) return; - } - d.e() && (H = g); - } - } - } - function a() { - if (!(d.cursor < x)) { - var a = d.f; - d.f = x; - var b = d.a - d.cursor; - var c = d.a - d.cursor; - if (l() && ((d.cursor = d.a - c), (d.d = d.cursor), !(d.cursor <= d.f) && (d.cursor--, (d.c = d.cursor), !d.e()))) - return; - d.cursor = d.a - b; - b = d.a - d.cursor; - d.d = d.cursor; - if (d.n(u, 97, 228) && ((d.c = d.cursor), d.n(y, 98, 122) && !d.e())) return; - d.cursor = d.a - b; - b = d.a - d.cursor; - a: if (((d.d = d.cursor), d.g("j"))) { - d.c = d.cursor; - b: { - c = d.a - d.cursor; - if (d.g("o")) break b; - d.cursor = d.a - c; - if (!d.g("u")) break a; - } - if (!d.e()) return; - } - d.cursor = d.a - b; - b = d.a - d.cursor; - d.d = d.cursor; - if (d.g("o") && ((d.c = d.cursor), d.g("j") && !d.e())) return; - d.cursor = d.a - b; - d.f = a; - a: for (;;) { - a = d.a - d.cursor; - if (d.q(z, 97, 246)) { - d.cursor = d.a - a; - break a; - } - d.cursor = d.a - a; - if (d.cursor <= d.f) return; - d.cursor--; - } - d.d = d.cursor; - d.n(y, 98, 122) && ((d.c = d.cursor), (G = d.u()), "" == G || !d.g(G) || d.e()); - } - } - var d = new C(), - n = [ - ["pa", -1, 1], - ["sti", -1, 2], - ["kaan", -1, 1], - ["han", -1, 1], - ["kin", -1, 1], - ["h\u00e4n", -1, 1], - ["k\u00e4\u00e4n", -1, 1], - ["ko", -1, 1], - ["p\u00e4", -1, 1], - ["k\u00f6", -1, 1], - ], - v = [ - ["lla", -1, -1], - ["na", -1, -1], - ["ssa", -1, -1], - ["ta", -1, -1], - ["lta", 3, -1], - ["sta", 3, -1], - ], - b = [ - ["ll\u00e4", -1, -1], - ["n\u00e4", -1, -1], - ["ss\u00e4", -1, -1], - ["t\u00e4", -1, -1], - ["lt\u00e4", 3, -1], - ["st\u00e4", 3, -1], - ], - f = [ - ["lle", -1, -1], - ["ine", -1, -1], - ], - q = [ - ["nsa", -1, 3], - ["mme", -1, 3], - ["nne", -1, 3], - ["ni", -1, 2], - ["si", -1, 1], - ["an", -1, 4], - ["en", -1, 6], - ["\u00e4n", -1, 5], - ["ns\u00e4", -1, 3], - ], - t = [ - ["aa", -1, -1], - ["ee", -1, -1], - ["ii", -1, -1], - ["oo", -1, -1], - ["uu", -1, -1], - ["\u00e4\u00e4", -1, -1], - ["\u00f6\u00f6", -1, -1], - ], - s = [ - ["a", -1, 8], - ["lla", 0, -1], - ["na", 0, -1], - ["ssa", 0, -1], - ["ta", 0, -1], - ["lta", 4, -1], - ["sta", 4, -1], - ["tta", 4, 2], - ["lle", -1, -1], - ["ine", -1, -1], - ["ksi", -1, -1], - ["n", -1, 7], - ["han", 11, 1], - ["den", 11, -1, h], - ["seen", 11, -1, l], - ["hen", 11, 2], - ["tten", 11, -1, h], - ["hin", 11, 3], - ["siin", 11, -1, h], - ["hon", 11, 4], - ["h\u00e4n", 11, 5], - ["h\u00f6n", 11, 6], - ["\u00e4", -1, 8], - ["ll\u00e4", 22, -1], - ["n\u00e4", 22, -1], - ["ss\u00e4", 22, -1], - ["t\u00e4", 22, -1], - ["lt\u00e4", 26, -1], - ["st\u00e4", 26, -1], - ["tt\u00e4", 26, 2], - ], - r = [ - ["eja", -1, -1], - ["mma", -1, 1], - ["imma", 1, -1], - ["mpa", -1, 1], - ["impa", 3, -1], - ["mmi", -1, 1], - ["immi", 5, -1], - ["mpi", -1, 1], - ["impi", 7, -1], - ["ej\u00e4", -1, -1], - ["mm\u00e4", -1, 1], - ["imm\u00e4", 10, -1], - ["mp\u00e4", -1, 1], - ["imp\u00e4", 12, -1], - ], - m = [ - ["i", -1, -1], - ["j", -1, -1], - ], - w = [ - ["mma", -1, 1], - ["imma", 0, -1], - ], - u = [17, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8], - y = [119, 223, 119, 1], - z = [17, 65, 16, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 32], - e = [17, 65, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 32], - A = [17, 97, 24, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 32], - H = p, - G = "", - E = 0, - x = 0; - this.l = function () { - var e = d.cursor; - k(); - d.cursor = e; - H = p; - d.f = d.cursor; - d.cursor = d.a; - e = d.a - d.cursor; - a: { - var h; - if (!(d.cursor < x)) { - var l = d.f; - d.f = x; - d.d = d.cursor; - h = d.h(n); - if (0 == h) d.f = l; - else { - d.c = d.cursor; - d.f = l; - switch (h) { - case 1: - if (!d.n(A, 97, 246)) break a; - break; - case 2: - if (!(E <= d.cursor)) break a; - } - d.e(); - } - } - } - d.cursor = d.a - e; - e = d.a - d.cursor; - if (!(d.cursor < x)) - if (((l = d.f), (d.f = x), (d.d = d.cursor), (h = d.h(q)), 0 == h)) d.f = l; - else - switch (((d.c = d.cursor), (d.f = l), h)) { - case 1: - h = d.a - d.cursor; - if (d.g("k")) break; - d.cursor = d.a - h; - if (!d.e()) break; - break; - case 2: - if (!d.e()) break; - d.d = d.cursor; - if (!d.g("kse")) break; - d.c = d.cursor; - if (!d.b("ksi")) break; - break; - case 3: - if (!d.e()) break; - break; - case 4: - if (0 == d.h(v) || !d.e()) break; - break; - case 5: - if (0 == d.h(b) || !d.e()) break; - break; - case 6: - 0 == d.h(f) || d.e(); - } - d.cursor = d.a - e; - e = d.a - d.cursor; - c(); - d.cursor = d.a - e; - e = d.a - d.cursor; - a: if (!(d.cursor < E)) - if (((l = d.f), (d.f = E), (d.d = d.cursor), (h = d.h(r)), 0 == h)) d.f = l; - else { - d.c = d.cursor; - d.f = l; - switch (h) { - case 1: - h = d.a - d.cursor; - if (d.g("po")) break a; - d.cursor = d.a - h; - } - d.e(); - } - d.cursor = d.a - e; - a: { - if (H) { - e = d.a - d.cursor; - d.cursor < x || - ((h = d.f), (d.f = x), (d.d = d.cursor), 0 == d.h(m) ? (d.f = h) : ((d.c = d.cursor), (d.f = h), d.e())); - d.cursor = d.a - e; - break a; - } - e = d.a - d.cursor; - b: if (!(d.cursor < x)) - if (((h = d.f), (d.f = x), (d.d = d.cursor), d.g("t"))) - if (((d.c = d.cursor), (l = d.a - d.cursor), d.n(z, 97, 246))) { - if (((d.cursor = d.a - l), d.e() && ((d.f = h), !(d.cursor < E)))) - if (((l = d.f), (d.f = E), (d.d = d.cursor), (h = d.h(w)), 0 == h)) d.f = l; - else { - d.c = d.cursor; - d.f = l; - switch (h) { - case 1: - h = d.a - d.cursor; - if (d.g("po")) break b; - d.cursor = d.a - h; - } - d.e(); - } - } else d.f = h; - else d.f = h; - d.cursor = d.a - e; - } - e = d.a - d.cursor; - a(); - d.cursor = d.a - e; - d.cursor = d.f; - return g; - }; - this.stemWord = function (a) { - d.p(a); - this.l(); - return d.j; - }; -} - -const stemmerInstance = new stem(); - -export function stemmer(word) { - return stemmerInstance.stemWord(word); -} diff --git a/stemmer/lib/fr.d.ts b/stemmer/lib/fr.d.ts deleted file mode 100644 index 838f68c..0000000 --- a/stemmer/lib/fr.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare function stemmer(word: string): string; diff --git a/stemmer/lib/fr.js b/stemmer/lib/fr.js deleted file mode 100644 index 618a6c2..0000000 --- a/stemmer/lib/fr.js +++ /dev/null @@ -1,875 +0,0 @@ -/* - * ----------------------------------------------------------------------------- - * GENERATED FILE - DO NOT EDIT! - * This file has been compiled using the Snowball stemmer generator. - * Don't edit this file directly. - * ----------------------------------------------------------------------------- - */ - -var g = !0, - p = !1; - -function C() { - this.p = function (k) { - this.j = k; - this.cursor = 0; - this.a = this.j.length; - this.f = 0; - this.c = this.cursor; - this.d = this.a; - }; - this.z = function () { - return this.j; - }; - this.w = function (k) { - this.j = k.j; - this.cursor = k.cursor; - this.a = k.a; - this.f = k.f; - this.c = k.c; - this.d = k.d; - }; - this.i = function (k, l, h) { - if (this.cursor >= this.a) return p; - var c = this.j.charCodeAt(this.cursor); - if (c > h || c < l) return p; - c -= l; - if (0 == (k[c >>> 3] & (1 << (c & 7)))) return p; - this.cursor++; - return g; - }; - this.n = function (k, l, h) { - if (this.cursor <= this.f) return p; - var c = this.j.charCodeAt(this.cursor - 1); - if (c > h || c < l) return p; - c -= l; - if (0 == (k[c >>> 3] & (1 << (c & 7)))) return p; - this.cursor--; - return g; - }; - this.k = function (k, l, h) { - if (this.cursor >= this.a) return p; - var c = this.j.charCodeAt(this.cursor); - if (c > h || c < l) return this.cursor++, g; - c -= l; - return 0 == (k[c >>> 3] & (1 << (c & 7))) ? (this.cursor++, g) : p; - }; - this.q = function (k, l, h) { - if (this.cursor <= this.f) return p; - var c = this.j.charCodeAt(this.cursor - 1); - if (c > h || c < l) return this.cursor--, g; - c -= l; - return 0 == (k[c >>> 3] & (1 << (c & 7))) ? (this.cursor--, g) : p; - }; - this.m = function (k) { - if (this.a - this.cursor < k.length || this.j.slice(this.cursor, this.cursor + k.length) != k) return p; - this.cursor += k.length; - return g; - }; - this.g = function (k) { - if (this.cursor - this.f < k.length || this.j.slice(this.cursor - k.length, this.cursor) != k) return p; - this.cursor -= k.length; - return g; - }; - this.o = function (k) { - for (var l = 0, h = k.length, c = this.cursor, a = this.a, d = 0, n = 0, v = p; ; ) { - var b = l + ((h - l) >>> 1), - f = 0, - q = d < n ? d : n, - t = k[b], - s; - for (s = q; s < t[0].length; s++) { - if (c + q == a) { - f = -1; - break; - } - f = this.j.charCodeAt(c + q) - t[0].charCodeAt(s); - if (0 != f) break; - q++; - } - 0 > f ? ((h = b), (n = q)) : ((l = b), (d = q)); - if (1 >= h - l) { - if (0 < l) break; - if (h == l) break; - if (v) break; - v = g; - } - } - for (;;) { - t = k[l]; - if (d >= t[0].length) { - this.cursor = c + t[0].length; - if (4 > t.length) return t[2]; - l = t[3](this); - this.cursor = c + t[0].length; - if (l) return t[2]; - } - l = t[1]; - if (0 > l) return 0; - } - }; - this.h = function (k) { - for (var l = 0, h = k.length, c = this.cursor, a = this.f, d = 0, n = 0, v = p; ; ) { - var b = l + ((h - l) >> 1), - f = 0, - q = d < n ? d : n, - t = k[b], - s; - for (s = t[0].length - 1 - q; 0 <= s; s--) { - if (c - q == a) { - f = -1; - break; - } - f = this.j.charCodeAt(c - 1 - q) - t[0].charCodeAt(s); - if (0 != f) break; - q++; - } - 0 > f ? ((h = b), (n = q)) : ((l = b), (d = q)); - if (1 >= h - l) { - if (0 < l) break; - if (h == l) break; - if (v) break; - v = g; - } - } - for (;;) { - t = k[l]; - if (d >= t[0].length) { - this.cursor = c - t[0].length; - if (4 > t.length) return t[2]; - l = t[3](this); - this.cursor = c - t[0].length; - if (l) return t[2]; - } - l = t[1]; - if (0 > l) return 0; - } - }; - this.s = function (k, l, h) { - var c = h.length - (l - k); - this.j = this.j.slice(0, k) + h + this.j.slice(l); - this.a += c; - this.cursor >= l ? (this.cursor += c) : this.cursor > k && (this.cursor = k); - return c; - }; - this.t = function () { - return 0 > this.c || this.c > this.d || this.d > this.a || this.a > this.j.length ? p : g; - }; - this.b = function (k) { - var l = p; - this.t() && (this.s(this.c, this.d, k), (l = g)); - return l; - }; - this.e = function () { - return this.b(""); - }; - this.r = function (k, l, h) { - l = this.s(k, l, h); - k <= this.c && (this.c += l); - k <= this.d && (this.d += l); - }; - this.u = function () { - var k = ""; - this.t() && (k = this.j.slice(this.c, this.d)); - return k; - }; - this.v = function () { - return this.j.slice(0, this.a); - }; -} - -function stem() { - function k() { - for (;;) { - var a = f.cursor; - a: { - b: for (;;) { - var b = f.cursor; - c: { - d: { - var c = f.cursor; - e: if (f.i(e, 97, 251)) { - f.c = f.cursor; - f: { - var d = f.cursor; - if (f.m("u") && ((f.d = f.cursor), f.i(e, 97, 251))) { - if (!f.b("U")) return; - break f; - } - f.cursor = d; - if (f.m("i") && ((f.d = f.cursor), f.i(e, 97, 251))) { - if (!f.b("I")) return; - break f; - } - f.cursor = d; - if (!f.m("y")) break e; - f.d = f.cursor; - if (!f.b("Y")) return; - } - break d; - } - f.cursor = c; - f.c = f.cursor; - if (f.m("\u00eb")) { - f.d = f.cursor; - if (!f.b("He")) return; - break d; - } - f.cursor = c; - f.c = f.cursor; - if (f.m("\u00ef")) { - f.d = f.cursor; - if (!f.b("Hi")) return; - break d; - } - f.cursor = c; - f.c = f.cursor; - if (f.m("y") && ((f.d = f.cursor), f.i(e, 97, 251))) { - if (!f.b("Y")) return; - break d; - } - f.cursor = c; - if (!f.m("q")) break c; - f.c = f.cursor; - if (!f.m("u")) break c; - f.d = f.cursor; - if (!f.b("U")) return; - } - f.cursor = b; - break b; - } - f.cursor = b; - if (f.cursor >= f.a) break a; - f.cursor++; - } - continue; - } - f.cursor = a; - break; - } - } - function l() { - for (var a; ; ) { - var b = f.cursor; - a: if (((f.c = f.cursor), (a = f.o(t)), 0 != a)) { - f.d = f.cursor; - switch (a) { - case 1: - if (!f.b("i")) return; - break; - case 2: - if (!f.b("u")) return; - break; - case 3: - if (!f.b("y")) return; - break; - case 4: - if (!f.b("\u00eb")) return; - break; - case 5: - if (!f.b("\u00ef")) return; - break; - case 6: - if (!f.e()) return; - break; - case 7: - if (f.cursor >= f.a) break a; - f.cursor++; - } - continue; - } - f.cursor = b; - break; - } - } - function h() { - return !(E <= f.cursor) ? p : g; - } - function c() { - return !(G <= f.cursor) ? p : g; - } - function a() { - return !(H <= f.cursor) ? p : g; - } - function d() { - var b; - f.d = f.cursor; - b = f.h(m); - if (0 == b) return p; - f.c = f.cursor; - switch (b) { - case 1: - if (!a() || !f.e()) return p; - break; - case 2: - if (!a() || !f.e()) return p; - b = f.a - f.cursor; - f.d = f.cursor; - if (f.g("ic")) { - f.c = f.cursor; - b: { - b = f.a - f.cursor; - if (a()) { - if (!f.e()) return p; - break b; - } - f.cursor = f.a - b; - if (!f.b("iqU")) return p; - } - } else f.cursor = f.a - b; - break; - case 3: - if (!a() || !f.b("log")) return p; - break; - case 4: - if (!a() || !f.b("u")) return p; - break; - case 5: - if (!a() || !f.b("ent")) return p; - break; - case 6: - if (!h() || !f.e()) return p; - var d = f.a - f.cursor; - a: if (((f.d = f.cursor), (b = f.h(s)), 0 == b)) f.cursor = f.a - d; - else - switch (((f.c = f.cursor), b)) { - case 1: - if (!a()) { - f.cursor = f.a - d; - break a; - } - if (!f.e()) return p; - f.d = f.cursor; - if (!f.g("at")) { - f.cursor = f.a - d; - break a; - } - f.c = f.cursor; - if (!a()) { - f.cursor = f.a - d; - break a; - } - if (!f.e()) return p; - break; - case 2: - b: { - b = f.a - f.cursor; - if (a()) { - if (!f.e()) return p; - break b; - } - f.cursor = f.a - b; - if (!c()) { - f.cursor = f.a - d; - break a; - } - if (!f.b("eux")) return p; - } - break; - case 3: - if (!a()) { - f.cursor = f.a - d; - break a; - } - if (!f.e()) return p; - break; - case 4: - if (!h()) { - f.cursor = f.a - d; - break a; - } - if (!f.b("i")) return p; - } - break; - case 7: - if (!a() || !f.e()) return p; - d = f.a - f.cursor; - a: if (((f.d = f.cursor), (b = f.h(r)), 0 == b)) f.cursor = f.a - d; - else - switch (((f.c = f.cursor), b)) { - case 1: - b: { - b = f.a - f.cursor; - if (a()) { - if (!f.e()) return p; - break b; - } - f.cursor = f.a - b; - if (!f.b("abl")) return p; - } - break; - case 2: - b: { - b = f.a - f.cursor; - if (a()) { - if (!f.e()) return p; - break b; - } - f.cursor = f.a - b; - if (!f.b("iqU")) return p; - } - break; - case 3: - if (!a()) { - f.cursor = f.a - d; - break a; - } - if (!f.e()) return p; - } - break; - case 8: - if (!a() || !f.e()) return p; - b = f.a - f.cursor; - f.d = f.cursor; - if (f.g("at")) - if (((f.c = f.cursor), a())) { - if (!f.e()) return p; - f.d = f.cursor; - if (f.g("ic")) { - f.c = f.cursor; - b: { - b = f.a - f.cursor; - if (a()) { - if (!f.e()) return p; - break b; - } - f.cursor = f.a - b; - if (!f.b("iqU")) return p; - } - } else f.cursor = f.a - b; - } else f.cursor = f.a - b; - else f.cursor = f.a - b; - break; - case 9: - if (!f.b("eau")) return p; - break; - case 10: - if (!c() || !f.b("al")) return p; - break; - case 11: - a: { - b = f.a - f.cursor; - if (a()) { - if (!f.e()) return p; - break a; - } - f.cursor = f.a - b; - if (!c() || !f.b("eux")) return p; - } - break; - case 12: - if (!c() || !f.q(e, 97, 251) || !f.e()) return p; - break; - case 13: - if (!h()) return p; - f.b("ant"); - return p; - case 14: - if (!h()) return p; - f.b("ent"); - return p; - case 15: - b = f.a - f.cursor; - if (!f.n(e, 97, 251) || !h()) return p; - f.cursor = f.a - b; - f.e(); - return p; - } - return g; - } - function n() { - if (f.cursor < E) return p; - var a = f.f; - f.f = E; - f.d = f.cursor; - if (0 == f.h(w)) return (f.f = a), p; - f.c = f.cursor; - var b = f.a - f.cursor; - if (f.g("H")) return (f.f = a), p; - f.cursor = f.a - b; - if (!f.q(e, 97, 251)) return (f.f = a), p; - if (!f.e()) return p; - f.f = a; - return g; - } - function v() { - var b; - if (f.cursor < E) return p; - var c = f.f; - f.f = E; - f.d = f.cursor; - b = f.h(u); - if (0 == b) return (f.f = c), p; - f.c = f.cursor; - switch (b) { - case 1: - if (!a()) return (f.f = c), p; - if (!f.e()) return p; - break; - case 2: - if (!f.e()) return p; - break; - case 3: - if (!f.e()) return p; - b = f.a - f.cursor; - f.d = f.cursor; - if (f.g("e")) { - if (((f.c = f.cursor), !f.e())) return p; - } else f.cursor = f.a - b; - } - f.f = c; - return g; - } - function b() { - var b, - c = f.a - f.cursor; - a: if (((f.d = f.cursor), f.g("s"))) { - f.c = f.cursor; - b = f.a - f.cursor; - b: { - var e = f.a - f.cursor; - if (f.g("Hi")) break b; - f.cursor = f.a - e; - if (!f.q(A, 97, 232)) { - f.cursor = f.a - c; - break a; - } - } - f.cursor = f.a - b; - if (!f.e()) return; - } else f.cursor = f.a - c; - if (!(f.cursor < E)) { - c = f.f; - f.f = E; - f.d = f.cursor; - b = f.h(y); - if (0 != b) - switch (((f.c = f.cursor), b)) { - case 1: - if (!a()) { - f.f = c; - return; - } - a: { - b = f.a - f.cursor; - if (f.g("s")) break a; - f.cursor = f.a - b; - if (!f.g("t")) { - f.f = c; - return; - } - } - if (!f.e()) return; - break; - case 2: - if (!f.b("i")) return; - break; - case 3: - if (!f.e()) return; - } - f.f = c; - } - } - var f = new C(), - q = [ - ["col", -1, -1], - ["par", -1, -1], - ["tap", -1, -1], - ], - t = [ - ["", -1, 7], - ["H", 0, 6], - ["He", 1, 4], - ["Hi", 1, 5], - ["I", 0, 1], - ["U", 0, 2], - ["Y", 0, 3], - ], - s = [ - ["iqU", -1, 3], - ["abl", -1, 3], - ["I\u00e8r", -1, 4], - ["i\u00e8r", -1, 4], - ["eus", -1, 2], - ["iv", -1, 1], - ], - r = [ - ["ic", -1, 2], - ["abil", -1, 1], - ["iv", -1, 3], - ], - m = [ - ["iqUe", -1, 1], - ["atrice", -1, 2], - ["ance", -1, 1], - ["ence", -1, 5], - ["logie", -1, 3], - ["able", -1, 1], - ["isme", -1, 1], - ["euse", -1, 11], - ["iste", -1, 1], - ["ive", -1, 8], - ["if", -1, 8], - ["usion", -1, 4], - ["ation", -1, 2], - ["ution", -1, 4], - ["ateur", -1, 2], - ["iqUes", -1, 1], - ["atrices", -1, 2], - ["ances", -1, 1], - ["ences", -1, 5], - ["logies", -1, 3], - ["ables", -1, 1], - ["ismes", -1, 1], - ["euses", -1, 11], - ["istes", -1, 1], - ["ives", -1, 8], - ["ifs", -1, 8], - ["usions", -1, 4], - ["ations", -1, 2], - ["utions", -1, 4], - ["ateurs", -1, 2], - ["ments", -1, 15], - ["ements", 30, 6], - ["issements", 31, 12], - ["it\u00e9s", -1, 7], - ["ment", -1, 15], - ["ement", 34, 6], - ["issement", 35, 12], - ["amment", 34, 13], - ["emment", 34, 14], - ["aux", -1, 10], - ["eaux", 39, 9], - ["eux", -1, 1], - ["it\u00e9", -1, 7], - ], - w = [ - ["ira", -1, 1], - ["ie", -1, 1], - ["isse", -1, 1], - ["issante", -1, 1], - ["i", -1, 1], - ["irai", 4, 1], - ["ir", -1, 1], - ["iras", -1, 1], - ["ies", -1, 1], - ["\u00eemes", -1, 1], - ["isses", -1, 1], - ["issantes", -1, 1], - ["\u00eetes", -1, 1], - ["is", -1, 1], - ["irais", 13, 1], - ["issais", 13, 1], - ["irions", -1, 1], - ["issions", -1, 1], - ["irons", -1, 1], - ["issons", -1, 1], - ["issants", -1, 1], - ["it", -1, 1], - ["irait", 21, 1], - ["issait", 21, 1], - ["issant", -1, 1], - ["iraIent", -1, 1], - ["issaIent", -1, 1], - ["irent", -1, 1], - ["issent", -1, 1], - ["iront", -1, 1], - ["\u00eet", -1, 1], - ["iriez", -1, 1], - ["issiez", -1, 1], - ["irez", -1, 1], - ["issez", -1, 1], - ], - u = [ - ["a", -1, 3], - ["era", 0, 2], - ["asse", -1, 3], - ["ante", -1, 3], - ["\u00e9e", -1, 2], - ["ai", -1, 3], - ["erai", 5, 2], - ["er", -1, 2], - ["as", -1, 3], - ["eras", 8, 2], - ["\u00e2mes", -1, 3], - ["asses", -1, 3], - ["antes", -1, 3], - ["\u00e2tes", -1, 3], - ["\u00e9es", -1, 2], - ["ais", -1, 3], - ["erais", 15, 2], - ["ions", -1, 1], - ["erions", 17, 2], - ["assions", 17, 3], - ["erons", -1, 2], - ["ants", -1, 3], - ["\u00e9s", -1, 2], - ["ait", -1, 3], - ["erait", 23, 2], - ["ant", -1, 3], - ["aIent", -1, 3], - ["eraIent", 26, 2], - ["\u00e8rent", -1, 2], - ["assent", -1, 3], - ["eront", -1, 2], - ["\u00e2t", -1, 3], - ["ez", -1, 2], - ["iez", 32, 2], - ["eriez", 33, 2], - ["assiez", 33, 3], - ["erez", 32, 2], - ["\u00e9", -1, 2], - ], - y = [ - ["e", -1, 3], - ["I\u00e8re", 0, 2], - ["i\u00e8re", 0, 2], - ["ion", -1, 1], - ["Ier", -1, 2], - ["ier", -1, 2], - ], - z = [ - ["ell", -1, -1], - ["eill", -1, -1], - ["enn", -1, -1], - ["onn", -1, -1], - ["ett", -1, -1], - ], - e = [17, 65, 16, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128, 130, 103, 8, 5], - A = [1, 65, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128], - H = 0, - G = 0, - E = 0; - this.l = function () { - var a = f.cursor; - k(); - f.cursor = a; - H = G = E = f.a; - a = f.cursor; - a: { - b: { - var c = f.cursor; - if (f.i(e, 97, 251) && f.i(e, 97, 251) && !(f.cursor >= f.a)) { - f.cursor++; - break b; - } - f.cursor = c; - if (0 != f.o(q)) break b; - f.cursor = c; - if (f.cursor >= f.a) break a; - f.cursor++; - c: for (;;) { - if (f.i(e, 97, 251)) break c; - if (f.cursor >= f.a) break a; - f.cursor++; - } - } - E = f.cursor; - } - f.cursor = a; - a = f.cursor; - a: { - b: for (;;) { - if (f.i(e, 97, 251)) break b; - if (f.cursor >= f.a) break a; - f.cursor++; - } - b: for (;;) { - if (f.k(e, 97, 251)) break b; - if (f.cursor >= f.a) break a; - f.cursor++; - } - G = f.cursor; - b: for (;;) { - if (f.i(e, 97, 251)) break b; - if (f.cursor >= f.a) break a; - f.cursor++; - } - b: for (;;) { - if (f.k(e, 97, 251)) break b; - if (f.cursor >= f.a) break a; - f.cursor++; - } - H = f.cursor; - } - f.cursor = a; - f.f = f.cursor; - f.cursor = f.a; - a = f.a - f.cursor; - b: { - c = f.a - f.cursor; - c: { - var h = f.a - f.cursor; - d: { - var m = f.a - f.cursor; - if (d()) break d; - f.cursor = f.a - m; - if (n()) break d; - f.cursor = f.a - m; - if (!v()) break c; - } - f.cursor = f.a - h; - c = f.a - f.cursor; - f.d = f.cursor; - e: { - h = f.a - f.cursor; - if (f.g("Y")) { - f.c = f.cursor; - if (!f.b("i")) return p; - break e; - } - f.cursor = f.a - h; - if (f.g("\u00e7")) { - if (((f.c = f.cursor), !f.b("c"))) return p; - } else f.cursor = f.a - c; - } - break b; - } - f.cursor = f.a - c; - b(); - } - f.cursor = f.a - a; - a = f.a - f.cursor; - c = f.a - f.cursor; - 0 != f.h(z) && ((f.cursor = f.a - c), (f.d = f.cursor), f.cursor <= f.f || (f.cursor--, (f.c = f.cursor), f.e())); - f.cursor = f.a - a; - a = f.a - f.cursor; - a: { - for (c = 1; ; ) { - if (f.q(e, 97, 251)) { - c--; - continue; - } - break; - } - if (!(0 < c)) { - f.d = f.cursor; - b: { - c = f.a - f.cursor; - if (f.g("\u00e9")) break b; - f.cursor = f.a - c; - if (!f.g("\u00e8")) break a; - } - f.c = f.cursor; - f.b("e"); - } - } - f.cursor = f.a - a; - f.cursor = f.f; - a = f.cursor; - l(); - f.cursor = a; - return g; - }; - this.stemWord = function (a) { - f.p(a); - this.l(); - return f.j; - }; -} - -const stemmerInstance = new stem(); - -export function stemmer(word) { - return stemmerInstance.stemWord(word); -} diff --git a/stemmer/lib/gr.d.ts b/stemmer/lib/gr.d.ts deleted file mode 100644 index 838f68c..0000000 --- a/stemmer/lib/gr.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare function stemmer(word: string): string; diff --git a/stemmer/lib/gr.js b/stemmer/lib/gr.js deleted file mode 100644 index 98148ab..0000000 --- a/stemmer/lib/gr.js +++ /dev/null @@ -1,1873 +0,0 @@ -/* - * ----------------------------------------------------------------------------- - * GENERATED FILE - DO NOT EDIT! - * This file has been compiled using the Snowball stemmer generator. - * Don't edit this file directly. - * ----------------------------------------------------------------------------- - */ - -var g = !0, - p = !1; - -function C() { - this.p = function (k) { - this.j = k; - this.cursor = 0; - this.a = this.j.length; - this.f = 0; - this.c = this.cursor; - this.d = this.a; - }; - this.z = function () { - return this.j; - }; - this.w = function (k) { - this.j = k.j; - this.cursor = k.cursor; - this.a = k.a; - this.f = k.f; - this.c = k.c; - this.d = k.d; - }; - this.i = function (k, l, h) { - if (this.cursor >= this.a) return p; - var c = this.j.charCodeAt(this.cursor); - if (c > h || c < l) return p; - c -= l; - if (0 == (k[c >>> 3] & (1 << (c & 7)))) return p; - this.cursor++; - return g; - }; - this.n = function (k, l, h) { - if (this.cursor <= this.f) return p; - var c = this.j.charCodeAt(this.cursor - 1); - if (c > h || c < l) return p; - c -= l; - if (0 == (k[c >>> 3] & (1 << (c & 7)))) return p; - this.cursor--; - return g; - }; - this.k = function (k, l, h) { - if (this.cursor >= this.a) return p; - var c = this.j.charCodeAt(this.cursor); - if (c > h || c < l) return this.cursor++, g; - c -= l; - return 0 == (k[c >>> 3] & (1 << (c & 7))) ? (this.cursor++, g) : p; - }; - this.q = function (k, l, h) { - if (this.cursor <= this.f) return p; - var c = this.j.charCodeAt(this.cursor - 1); - if (c > h || c < l) return this.cursor--, g; - c -= l; - return 0 == (k[c >>> 3] & (1 << (c & 7))) ? (this.cursor--, g) : p; - }; - this.m = function (k) { - if (this.a - this.cursor < k.length || this.j.slice(this.cursor, this.cursor + k.length) != k) return p; - this.cursor += k.length; - return g; - }; - this.g = function (k) { - if (this.cursor - this.f < k.length || this.j.slice(this.cursor - k.length, this.cursor) != k) return p; - this.cursor -= k.length; - return g; - }; - this.o = function (k) { - for (var l = 0, h = k.length, c = this.cursor, a = this.a, d = 0, n = 0, v = p; ; ) { - var b = l + ((h - l) >>> 1), - f = 0, - q = d < n ? d : n, - t = k[b], - s; - for (s = q; s < t[0].length; s++) { - if (c + q == a) { - f = -1; - break; - } - f = this.j.charCodeAt(c + q) - t[0].charCodeAt(s); - if (0 != f) break; - q++; - } - 0 > f ? ((h = b), (n = q)) : ((l = b), (d = q)); - if (1 >= h - l) { - if (0 < l) break; - if (h == l) break; - if (v) break; - v = g; - } - } - for (;;) { - t = k[l]; - if (d >= t[0].length) { - this.cursor = c + t[0].length; - if (4 > t.length) return t[2]; - l = t[3](this); - this.cursor = c + t[0].length; - if (l) return t[2]; - } - l = t[1]; - if (0 > l) return 0; - } - }; - this.h = function (k) { - for (var l = 0, h = k.length, c = this.cursor, a = this.f, d = 0, n = 0, v = p; ; ) { - var b = l + ((h - l) >> 1), - f = 0, - q = d < n ? d : n, - t = k[b], - s; - for (s = t[0].length - 1 - q; 0 <= s; s--) { - if (c - q == a) { - f = -1; - break; - } - f = this.j.charCodeAt(c - 1 - q) - t[0].charCodeAt(s); - if (0 != f) break; - q++; - } - 0 > f ? ((h = b), (n = q)) : ((l = b), (d = q)); - if (1 >= h - l) { - if (0 < l) break; - if (h == l) break; - if (v) break; - v = g; - } - } - for (;;) { - t = k[l]; - if (d >= t[0].length) { - this.cursor = c - t[0].length; - if (4 > t.length) return t[2]; - l = t[3](this); - this.cursor = c - t[0].length; - if (l) return t[2]; - } - l = t[1]; - if (0 > l) return 0; - } - }; - this.s = function (k, l, h) { - var c = h.length - (l - k); - this.j = this.j.slice(0, k) + h + this.j.slice(l); - this.a += c; - this.cursor >= l ? (this.cursor += c) : this.cursor > k && (this.cursor = k); - return c; - }; - this.t = function () { - return 0 > this.c || this.c > this.d || this.d > this.a || this.a > this.j.length ? p : g; - }; - this.b = function (k) { - var l = p; - this.t() && (this.s(this.c, this.d, k), (l = g)); - return l; - }; - this.e = function () { - return this.b(""); - }; - this.r = function (k, l, h) { - l = this.s(k, l, h); - k <= this.c && (this.c += l); - k <= this.d && (this.d += l); - }; - this.u = function () { - var k = ""; - this.t() && (k = this.j.slice(this.c, this.d)); - return k; - }; - this.v = function () { - return this.j.slice(0, this.a); - }; -} - -function stem() { - function k() { - for (var b; ; ) { - var c = a.a - a.cursor; - a: if (((a.d = a.cursor), (b = a.h(d)), 0 != b)) { - a.c = a.cursor; - switch (b) { - case 1: - if (!a.b("\u03b1")) return; - break; - case 2: - if (!a.b("\u03b2")) return; - break; - case 3: - if (!a.b("\u03b3")) return; - break; - case 4: - if (!a.b("\u03b4")) return; - break; - case 5: - if (!a.b("\u03b5")) return; - break; - case 6: - if (!a.b("\u03b6")) return; - break; - case 7: - if (!a.b("\u03b7")) return; - break; - case 8: - if (!a.b("\u03b8")) return; - break; - case 9: - if (!a.b("\u03b9")) return; - break; - case 10: - if (!a.b("\u03ba")) return; - break; - case 11: - if (!a.b("\u03bb")) return; - break; - case 12: - if (!a.b("\u03bc")) return; - break; - case 13: - if (!a.b("\u03bd")) return; - break; - case 14: - if (!a.b("\u03be")) return; - break; - case 15: - if (!a.b("\u03bf")) return; - break; - case 16: - if (!a.b("\u03c0")) return; - break; - case 17: - if (!a.b("\u03c1")) return; - break; - case 18: - if (!a.b("\u03c3")) return; - break; - case 19: - if (!a.b("\u03c4")) return; - break; - case 20: - if (!a.b("\u03c5")) return; - break; - case 21: - if (!a.b("\u03c6")) return; - break; - case 22: - if (!a.b("\u03c7")) return; - break; - case 23: - if (!a.b("\u03c8")) return; - break; - case 24: - if (!a.b("\u03c9")) return; - break; - case 25: - if (a.cursor <= a.f) break a; - a.cursor--; - } - continue; - } - a.cursor = a.a - c; - break; - } - } - function l() { - var b; - a.d = a.cursor; - b = a.h(n); - if (0 != b) { - a.c = a.cursor; - switch (b) { - case 1: - if (!a.b("\u03c6\u03b1")) return; - break; - case 2: - if (!a.b("\u03c3\u03ba\u03b1")) return; - break; - case 3: - if (!a.b("\u03bf\u03bb\u03bf")) return; - break; - case 4: - if (!a.b("\u03c3\u03bf")) return; - break; - case 5: - if (!a.b("\u03c4\u03b1\u03c4\u03bf")) return; - break; - case 6: - if (!a.b("\u03ba\u03c1\u03b5")) return; - break; - case 7: - if (!a.b("\u03c0\u03b5\u03c1")) return; - break; - case 8: - if (!a.b("\u03c4\u03b5\u03c1")) return; - break; - case 9: - if (!a.b("\u03c6\u03c9")) return; - break; - case 10: - if (!a.b("\u03ba\u03b1\u03b8\u03b5\u03c3\u03c4")) return; - break; - case 11: - if (!a.b("\u03b3\u03b5\u03b3\u03bf\u03bd")) return; - } - B = p; - } - } - function h() { - var b = a.a - a.cursor; - a.d = a.cursor; - if (0 != a.h(ca)) { - a.c = a.cursor; - if (!a.e()) return; - B = p; - a.d = a.cursor; - a.c = a.cursor; - if (0 != a.h(ba) && !(a.cursor > a.f) && !a.b("\u03b1\u03b3\u03b1\u03bd")) return; - } - a.cursor = a.a - b; - a.d = a.cursor; - if (a.g("\u03b1\u03bd\u03b5") && ((a.c = a.cursor), a.e())) { - B = p; - a: { - b = a.a - a.cursor; - a.d = a.cursor; - a.c = a.cursor; - if (a.n(ha, 945, 969)) { - if (!a.b("\u03b1\u03bd")) return; - break a; - } - a.cursor = a.a - b; - a.d = a.cursor; - } - a.c = a.cursor; - 0 == a.h(F) || a.cursor > a.f || a.b("\u03b1\u03bd"); - } - } - function c() { - var b = a.a - a.cursor; - a.d = a.cursor; - if (0 != a.h(W)) { - a.c = a.cursor; - if (!a.e()) return; - B = p; - } - a.cursor = a.a - b; - a.d = a.cursor; - if (a.g("\u03b5\u03c4\u03b5") && ((a.c = a.cursor), a.e())) { - B = p; - a: { - b = a.a - a.cursor; - a.d = a.cursor; - a.c = a.cursor; - if (a.n(ha, 945, 969)) { - if (!a.b("\u03b5\u03c4")) return; - break a; - } - a.cursor = a.a - b; - a.d = a.cursor; - a.c = a.cursor; - if (0 != a.h(da)) { - if (!a.b("\u03b5\u03c4")) return; - break a; - } - a.cursor = a.a - b; - a.d = a.cursor; - } - a.c = a.cursor; - 0 == a.h(ea) || a.cursor > a.f || a.b("\u03b5\u03c4"); - } - } - var a = new C(), - d = [ - ["", -1, 25], - ["\u0386", 0, 1], - ["\u0388", 0, 5], - ["\u0389", 0, 7], - ["\u038a", 0, 9], - ["\u038c", 0, 15], - ["\u038e", 0, 20], - ["\u038f", 0, 24], - ["\u0390", 0, 7], - ["\u0391", 0, 1], - ["\u0392", 0, 2], - ["\u0393", 0, 3], - ["\u0394", 0, 4], - ["\u0395", 0, 5], - ["\u0396", 0, 6], - ["\u0397", 0, 7], - ["\u0398", 0, 8], - ["\u0399", 0, 9], - ["\u039a", 0, 10], - ["\u039b", 0, 11], - ["\u039c", 0, 12], - ["\u039d", 0, 13], - ["\u039e", 0, 14], - ["\u039f", 0, 15], - ["\u03a0", 0, 16], - ["\u03a1", 0, 17], - ["\u03a3", 0, 18], - ["\u03a4", 0, 19], - ["\u03a5", 0, 20], - ["\u03a6", 0, 21], - ["\u03a7", 0, 22], - ["\u03a8", 0, 23], - ["\u03a9", 0, 24], - ["\u03aa", 0, 9], - ["\u03ab", 0, 20], - ["\u03ac", 0, 1], - ["\u03ad", 0, 5], - ["\u03ae", 0, 7], - ["\u03af", 0, 9], - ["\u03b0", 0, 20], - ["\u03c2", 0, 18], - ["\u03ca", 0, 7], - ["\u03cb", 0, 20], - ["\u03cc", 0, 15], - ["\u03cd", 0, 20], - ["\u03ce", 0, 24], - ], - n = [ - ["\u03c3\u03ba\u03b1\u03b3\u03b9\u03b1", -1, 2], - ["\u03c6\u03b1\u03b3\u03b9\u03b1", -1, 1], - ["\u03bf\u03bb\u03bf\u03b3\u03b9\u03b1", -1, 3], - ["\u03c3\u03bf\u03b3\u03b9\u03b1", -1, 4], - ["\u03c4\u03b1\u03c4\u03bf\u03b3\u03b9\u03b1", -1, 5], - ["\u03ba\u03c1\u03b5\u03b1\u03c4\u03b1", -1, 6], - ["\u03c0\u03b5\u03c1\u03b1\u03c4\u03b1", -1, 7], - ["\u03c4\u03b5\u03c1\u03b1\u03c4\u03b1", -1, 8], - ["\u03b3\u03b5\u03b3\u03bf\u03bd\u03bf\u03c4\u03b1", -1, 11], - ["\u03ba\u03b1\u03b8\u03b5\u03c3\u03c4\u03c9\u03c4\u03b1", -1, 10], - ["\u03c6\u03c9\u03c4\u03b1", -1, 9], - ["\u03c0\u03b5\u03c1\u03b1\u03c4\u03b7", -1, 7], - ["\u03c3\u03ba\u03b1\u03b3\u03b9\u03c9\u03bd", -1, 2], - ["\u03c6\u03b1\u03b3\u03b9\u03c9\u03bd", -1, 1], - ["\u03bf\u03bb\u03bf\u03b3\u03b9\u03c9\u03bd", -1, 3], - ["\u03c3\u03bf\u03b3\u03b9\u03c9\u03bd", -1, 4], - ["\u03c4\u03b1\u03c4\u03bf\u03b3\u03b9\u03c9\u03bd", -1, 5], - ["\u03ba\u03c1\u03b5\u03b1\u03c4\u03c9\u03bd", -1, 6], - ["\u03c0\u03b5\u03c1\u03b1\u03c4\u03c9\u03bd", -1, 7], - ["\u03c4\u03b5\u03c1\u03b1\u03c4\u03c9\u03bd", -1, 8], - ["\u03b3\u03b5\u03b3\u03bf\u03bd\u03bf\u03c4\u03c9\u03bd", -1, 11], - ["\u03ba\u03b1\u03b8\u03b5\u03c3\u03c4\u03c9\u03c4\u03c9\u03bd", -1, 10], - ["\u03c6\u03c9\u03c4\u03c9\u03bd", -1, 9], - ["\u03ba\u03c1\u03b5\u03b1\u03c3", -1, 6], - ["\u03c0\u03b5\u03c1\u03b1\u03c3", -1, 7], - ["\u03c4\u03b5\u03c1\u03b1\u03c3", -1, 8], - ["\u03b3\u03b5\u03b3\u03bf\u03bd\u03bf\u03c3", -1, 11], - ["\u03ba\u03c1\u03b5\u03b1\u03c4\u03bf\u03c3", -1, 6], - ["\u03c0\u03b5\u03c1\u03b1\u03c4\u03bf\u03c3", -1, 7], - ["\u03c4\u03b5\u03c1\u03b1\u03c4\u03bf\u03c3", -1, 8], - ["\u03b3\u03b5\u03b3\u03bf\u03bd\u03bf\u03c4\u03bf\u03c3", -1, 11], - ["\u03ba\u03b1\u03b8\u03b5\u03c3\u03c4\u03c9\u03c4\u03bf\u03c3", -1, 10], - ["\u03c6\u03c9\u03c4\u03bf\u03c3", -1, 9], - ["\u03ba\u03b1\u03b8\u03b5\u03c3\u03c4\u03c9\u03c3", -1, 10], - ["\u03c6\u03c9\u03c3", -1, 9], - ["\u03c3\u03ba\u03b1\u03b3\u03b9\u03bf\u03c5", -1, 2], - ["\u03c6\u03b1\u03b3\u03b9\u03bf\u03c5", -1, 1], - ["\u03bf\u03bb\u03bf\u03b3\u03b9\u03bf\u03c5", -1, 3], - ["\u03c3\u03bf\u03b3\u03b9\u03bf\u03c5", -1, 4], - ["\u03c4\u03b1\u03c4\u03bf\u03b3\u03b9\u03bf\u03c5", -1, 5], - ], - v = [ - ["\u03c0\u03b1", -1, 1], - ["\u03be\u03b1\u03bd\u03b1\u03c0\u03b1", 0, 1], - ["\u03b5\u03c0\u03b1", 0, 1], - ["\u03c0\u03b5\u03c1\u03b9\u03c0\u03b1", 0, 1], - ["\u03b1\u03bd\u03b1\u03bc\u03c0\u03b1", 0, 1], - ["\u03b5\u03bc\u03c0\u03b1", 0, 1], - ["\u03b2", -1, 2], - ["\u03b4\u03b1\u03bd\u03b5", -1, 1], - ["\u03b2\u03b1\u03b8\u03c5\u03c1\u03b9", -1, 2], - ["\u03b2\u03b1\u03c1\u03ba", -1, 2], - ["\u03bc\u03b1\u03c1\u03ba", -1, 2], - ["\u03bb", -1, 2], - ["\u03bc", -1, 2], - ["\u03ba\u03bf\u03c1\u03bd", -1, 2], - ["\u03b1\u03b8\u03c1\u03bf", -1, 1], - ["\u03c3\u03c5\u03bd\u03b1\u03b8\u03c1\u03bf", 14, 1], - ["\u03c0", -1, 2], - ["\u03b9\u03bc\u03c0", 16, 2], - ["\u03c1", -1, 2], - ["\u03bc\u03b1\u03c1", 18, 2], - ["\u03b1\u03bc\u03c0\u03b1\u03c1", 18, 2], - ["\u03b3\u03ba\u03c1", 18, 2], - ["\u03b2\u03bf\u03bb\u03b2\u03bf\u03c1", 18, 2], - ["\u03b3\u03bb\u03c5\u03ba\u03bf\u03c1", 18, 2], - ["\u03c0\u03b9\u03c0\u03b5\u03c1\u03bf\u03c1", 18, 2], - ["\u03c0\u03c1", 18, 2], - ["\u03bc\u03c0\u03c1", 25, 2], - ["\u03b1\u03c1\u03c1", 18, 2], - ["\u03b3\u03bb\u03c5\u03ba\u03c5\u03c1", 18, 2], - ["\u03c0\u03bf\u03bb\u03c5\u03c1", 18, 2], - ["\u03bb\u03bf\u03c5", -1, 2], - ], - b = [ - ["\u03b9\u03b6\u03b1", -1, 1], - ["\u03b9\u03b6\u03b5", -1, 1], - ["\u03b9\u03b6\u03b1\u03bc\u03b5", -1, 1], - ["\u03b9\u03b6\u03bf\u03c5\u03bc\u03b5", -1, 1], - ["\u03b9\u03b6\u03b1\u03bd\u03b5", -1, 1], - ["\u03b9\u03b6\u03bf\u03c5\u03bd\u03b5", -1, 1], - ["\u03b9\u03b6\u03b1\u03c4\u03b5", -1, 1], - ["\u03b9\u03b6\u03b5\u03c4\u03b5", -1, 1], - ["\u03b9\u03b6\u03b5\u03b9", -1, 1], - ["\u03b9\u03b6\u03b1\u03bd", -1, 1], - ["\u03b9\u03b6\u03bf\u03c5\u03bd", -1, 1], - ["\u03b9\u03b6\u03b5\u03c3", -1, 1], - ["\u03b9\u03b6\u03b5\u03b9\u03c3", -1, 1], - ["\u03b9\u03b6\u03c9", -1, 1], - ], - f = [ - ["\u03b2\u03b9", -1, 1], - ["\u03bb\u03b9", -1, 1], - ["\u03b1\u03bb", -1, 1], - ["\u03b5\u03bd", -1, 1], - ["\u03c3", -1, 1], - ["\u03c7", -1, 1], - ["\u03c5\u03c8", -1, 1], - ["\u03b6\u03c9", -1, 1], - ], - q = [ - ["\u03c9\u03b8\u03b7\u03ba\u03b1", -1, 1], - ["\u03c9\u03b8\u03b7\u03ba\u03b5", -1, 1], - ["\u03c9\u03b8\u03b7\u03ba\u03b1\u03bc\u03b5", -1, 1], - ["\u03c9\u03b8\u03b7\u03ba\u03b1\u03bd\u03b5", -1, 1], - ["\u03c9\u03b8\u03b7\u03ba\u03b1\u03c4\u03b5", -1, 1], - ["\u03c9\u03b8\u03b7\u03ba\u03b1\u03bd", -1, 1], - ["\u03c9\u03b8\u03b7\u03ba\u03b5\u03c3", -1, 1], - ], - t = [ - ["\u03be\u03b1\u03bd\u03b1\u03c0\u03b1", -1, 1], - ["\u03b5\u03c0\u03b1", -1, 1], - ["\u03c0\u03b5\u03c1\u03b9\u03c0\u03b1", -1, 1], - ["\u03b1\u03bd\u03b1\u03bc\u03c0\u03b1", -1, 1], - ["\u03b5\u03bc\u03c0\u03b1", -1, 1], - ["\u03c7\u03b1\u03c1\u03c4\u03bf\u03c0\u03b1", -1, 1], - ["\u03b5\u03be\u03b1\u03c1\u03c7\u03b1", -1, 1], - ["\u03b3\u03b5", -1, 2], - ["\u03b3\u03ba\u03b5", -1, 2], - ["\u03ba\u03bb\u03b5", -1, 1], - ["\u03b5\u03ba\u03bb\u03b5", 9, 1], - ["\u03b1\u03c0\u03b5\u03ba\u03bb\u03b5", 10, 1], - ["\u03b1\u03c0\u03bf\u03ba\u03bb\u03b5", 9, 1], - ["\u03b5\u03c3\u03c9\u03ba\u03bb\u03b5", 9, 1], - ["\u03b4\u03b1\u03bd\u03b5", -1, 1], - ["\u03c0\u03b5", -1, 1], - ["\u03b5\u03c0\u03b5", 15, 1], - ["\u03bc\u03b5\u03c4\u03b5\u03c0\u03b5", 16, 1], - ["\u03b5\u03c3\u03b5", -1, 1], - ["\u03b3\u03ba", -1, 2], - ["\u03bc", -1, 2], - ["\u03c0\u03bf\u03c5\u03ba\u03b1\u03bc", 20, 2], - ["\u03ba\u03bf\u03bc", 20, 2], - ["\u03b1\u03bd", -1, 2], - ["\u03bf\u03bb\u03bf", -1, 2], - ["\u03b1\u03b8\u03c1\u03bf", -1, 1], - ["\u03c3\u03c5\u03bd\u03b1\u03b8\u03c1\u03bf", 25, 1], - ["\u03c0", -1, 2], - ["\u03bb\u03b1\u03c1", -1, 2], - ["\u03b4\u03b7\u03bc\u03bf\u03ba\u03c1\u03b1\u03c4", -1, 2], - ["\u03b1\u03c6", -1, 2], - ["\u03b3\u03b9\u03b3\u03b1\u03bd\u03c4\u03bf\u03b1\u03c6", 30, 2], - ], - s = [ - ["\u03b9\u03c3\u03b1", -1, 1], - ["\u03b9\u03c3\u03b1\u03bc\u03b5", -1, 1], - ["\u03b9\u03c3\u03b1\u03bd\u03b5", -1, 1], - ["\u03b9\u03c3\u03b5", -1, 1], - ["\u03b9\u03c3\u03b1\u03c4\u03b5", -1, 1], - ["\u03b9\u03c3\u03b1\u03bd", -1, 1], - ["\u03b9\u03c3\u03b5\u03c3", -1, 1], - ], - r = [ - ["\u03be\u03b1\u03bd\u03b1\u03c0\u03b1", -1, 1], - ["\u03b5\u03c0\u03b1", -1, 1], - ["\u03c0\u03b5\u03c1\u03b9\u03c0\u03b1", -1, 1], - ["\u03b1\u03bd\u03b1\u03bc\u03c0\u03b1", -1, 1], - ["\u03b5\u03bc\u03c0\u03b1", -1, 1], - ["\u03c7\u03b1\u03c1\u03c4\u03bf\u03c0\u03b1", -1, 1], - ["\u03b5\u03be\u03b1\u03c1\u03c7\u03b1", -1, 1], - ["\u03ba\u03bb\u03b5", -1, 1], - ["\u03b5\u03ba\u03bb\u03b5", 7, 1], - ["\u03b1\u03c0\u03b5\u03ba\u03bb\u03b5", 8, 1], - ["\u03b1\u03c0\u03bf\u03ba\u03bb\u03b5", 7, 1], - ["\u03b5\u03c3\u03c9\u03ba\u03bb\u03b5", 7, 1], - ["\u03b4\u03b1\u03bd\u03b5", -1, 1], - ["\u03c0\u03b5", -1, 1], - ["\u03b5\u03c0\u03b5", 13, 1], - ["\u03bc\u03b5\u03c4\u03b5\u03c0\u03b5", 14, 1], - ["\u03b5\u03c3\u03b5", -1, 1], - ["\u03b1\u03b8\u03c1\u03bf", -1, 1], - ["\u03c3\u03c5\u03bd\u03b1\u03b8\u03c1\u03bf", 17, 1], - ], - m = [ - ["\u03b9\u03c3\u03bf\u03c5\u03bc\u03b5", -1, 1], - ["\u03b9\u03c3\u03bf\u03c5\u03bd\u03b5", -1, 1], - ["\u03b9\u03c3\u03b5\u03c4\u03b5", -1, 1], - ["\u03b9\u03c3\u03b5\u03b9", -1, 1], - ["\u03b9\u03c3\u03bf\u03c5\u03bd", -1, 1], - ["\u03b9\u03c3\u03b5\u03b9\u03c3", -1, 1], - ["\u03b9\u03c3\u03c9", -1, 1], - ], - w = [ - ["\u03b1\u03c4\u03b1", -1, 2], - ["\u03c6\u03b1", -1, 2], - ["\u03b7\u03c6\u03b1", 1, 2], - ["\u03bc\u03b5\u03b3", -1, 2], - ["\u03bb\u03c5\u03b3", -1, 2], - ["\u03b7\u03b4", -1, 2], - ["\u03ba\u03bb\u03b5", -1, 1], - ["\u03b5\u03c3\u03c9\u03ba\u03bb\u03b5", 6, 1], - ["\u03c0\u03bb\u03b5", -1, 1], - ["\u03b4\u03b1\u03bd\u03b5", -1, 1], - ["\u03c3\u03b5", -1, 1], - ["\u03b1\u03c3\u03b5", 10, 1], - ["\u03ba\u03b1\u03b8", -1, 2], - ["\u03b5\u03c7\u03b8", -1, 2], - ["\u03ba\u03b1\u03ba", -1, 2], - ["\u03bc\u03b1\u03ba", -1, 2], - ["\u03c3\u03ba", -1, 2], - ["\u03c6\u03b9\u03bb", -1, 2], - ["\u03ba\u03c5\u03bb", -1, 2], - ["\u03bc", -1, 2], - ["\u03b3\u03b5\u03bc", 19, 2], - ["\u03b1\u03c7\u03bd", -1, 2], - ["\u03c3\u03c5\u03bd\u03b1\u03b8\u03c1\u03bf", -1, 1], - ["\u03c0", -1, 2], - ["\u03b1\u03c0", 23, 2], - ["\u03b5\u03bc\u03c0", 23, 2], - ["\u03b5\u03c5\u03c0", 23, 2], - ["\u03b1\u03c1", -1, 2], - ["\u03b1\u03bf\u03c1", -1, 2], - ["\u03b3\u03c5\u03c1", -1, 2], - ["\u03c7\u03c1", -1, 2], - ["\u03c7\u03c9\u03c1", -1, 2], - ["\u03ba\u03c4", -1, 2], - ["\u03b1\u03ba\u03c4", 32, 2], - ["\u03c7\u03c4", -1, 2], - ["\u03b1\u03c7\u03c4", 34, 2], - ["\u03c4\u03b1\u03c7", -1, 2], - ["\u03c3\u03c7", -1, 2], - ["\u03b1\u03c3\u03c7", 37, 2], - ["\u03c5\u03c8", -1, 2], - ], - u = [ - ["\u03b9\u03c3\u03c4\u03b1", -1, 1], - ["\u03b9\u03c3\u03c4\u03b5", -1, 1], - ["\u03b9\u03c3\u03c4\u03b7", -1, 1], - ["\u03b9\u03c3\u03c4\u03bf\u03b9", -1, 1], - ["\u03b9\u03c3\u03c4\u03c9\u03bd", -1, 1], - ["\u03b9\u03c3\u03c4\u03bf", -1, 1], - ["\u03b9\u03c3\u03c4\u03b5\u03c3", -1, 1], - ["\u03b9\u03c3\u03c4\u03b7\u03c3", -1, 1], - ["\u03b9\u03c3\u03c4\u03bf\u03c3", -1, 1], - ["\u03b9\u03c3\u03c4\u03bf\u03c5\u03c3", -1, 1], - ["\u03b9\u03c3\u03c4\u03bf\u03c5", -1, 1], - ], - y = [ - ["\u03b5\u03b3\u03ba\u03bb\u03b5", -1, 1], - ["\u03b1\u03c0\u03bf\u03ba\u03bb\u03b5", -1, 1], - ["\u03b4\u03b1\u03bd\u03b5", -1, 2], - ["\u03b1\u03bd\u03c4\u03b9\u03b4\u03b1\u03bd\u03b5", 2, 2], - ["\u03c3\u03b5", -1, 1], - ["\u03bc\u03b5\u03c4\u03b1\u03c3\u03b5", 4, 1], - ["\u03bc\u03b9\u03ba\u03c1\u03bf\u03c3\u03b5", 4, 1], - ], - z = [ - ["\u03b1\u03c4\u03bf\u03bc\u03b9\u03ba", -1, 2], - ["\u03b5\u03b8\u03bd\u03b9\u03ba", -1, 4], - ["\u03c4\u03bf\u03c0\u03b9\u03ba", -1, 7], - ["\u03b5\u03ba\u03bb\u03b5\u03ba\u03c4\u03b9\u03ba", -1, 5], - ["\u03c3\u03ba\u03b5\u03c0\u03c4\u03b9\u03ba", -1, 6], - ["\u03b3\u03bd\u03c9\u03c3\u03c4\u03b9\u03ba", -1, 3], - ["\u03b1\u03b3\u03bd\u03c9\u03c3\u03c4\u03b9\u03ba", 5, 1], - ["\u03b1\u03bb\u03b5\u03be\u03b1\u03bd\u03b4\u03c1\u03b9\u03bd", -1, 8], - ["\u03b8\u03b5\u03b1\u03c4\u03c1\u03b9\u03bd", -1, 10], - ["\u03b2\u03c5\u03b6\u03b1\u03bd\u03c4\u03b9\u03bd", -1, 9], - ], - e = [ - ["\u03b9\u03c3\u03bc\u03bf\u03b9", -1, 1], - ["\u03b9\u03c3\u03bc\u03c9\u03bd", -1, 1], - ["\u03b9\u03c3\u03bc\u03bf", -1, 1], - ["\u03b9\u03c3\u03bc\u03bf\u03c3", -1, 1], - ["\u03b9\u03c3\u03bc\u03bf\u03c5\u03c3", -1, 1], - ["\u03b9\u03c3\u03bc\u03bf\u03c5", -1, 1], - ], - A = [ - ["\u03c3", -1, 1], - ["\u03c7", -1, 1], - ], - H = [ - ["\u03bf\u03c5\u03b4\u03b1\u03ba\u03b9\u03b1", -1, 1], - ["\u03b1\u03c1\u03b1\u03ba\u03b9\u03b1", -1, 1], - ["\u03bf\u03c5\u03b4\u03b1\u03ba\u03b9", -1, 1], - ["\u03b1\u03c1\u03b1\u03ba\u03b9", -1, 1], - ], - G = [ - ["\u03b2", -1, 2], - ["\u03b2\u03b1\u03bc\u03b2", 0, 1], - ["\u03c3\u03bb\u03bf\u03b2", 0, 1], - ["\u03c4\u03c3\u03b5\u03c7\u03bf\u03c3\u03bb\u03bf\u03b2", 2, 1], - ["\u03ba\u03b1\u03c1\u03b4", -1, 2], - ["\u03b6", -1, 2], - ["\u03c4\u03b6", 5, 1], - ["\u03ba", -1, 1], - ["\u03ba\u03b1\u03c0\u03b1\u03ba", 7, 1], - ["\u03c3\u03bf\u03ba", 7, 1], - ["\u03c3\u03ba", 7, 1], - ["\u03b2\u03b1\u03bb", -1, 2], - ["\u03bc\u03b1\u03bb", -1, 1], - ["\u03b3\u03bb", -1, 2], - ["\u03c4\u03c1\u03b9\u03c0\u03bf\u03bb", -1, 2], - ["\u03c0\u03bb", -1, 1], - ["\u03bb\u03bf\u03c5\u03bb", -1, 1], - ["\u03c6\u03c5\u03bb", -1, 1], - ["\u03ba\u03b1\u03b9\u03bc", -1, 1], - ["\u03ba\u03bb\u03b9\u03bc", -1, 1], - ["\u03c6\u03b1\u03c1\u03bc", -1, 1], - ["\u03b3\u03b9\u03b1\u03bd", -1, 2], - ["\u03c3\u03c0\u03b1\u03bd", -1, 1], - ["\u03b7\u03b3\u03bf\u03c5\u03bc\u03b5\u03bd", -1, 2], - ["\u03ba\u03bf\u03bd", -1, 1], - ["\u03bc\u03b1\u03ba\u03c1\u03c5\u03bd", -1, 2], - ["\u03c0", -1, 2], - ["\u03ba\u03b1\u03c4\u03c1\u03b1\u03c0", 26, 1], - ["\u03c1", -1, 1], - ["\u03b2\u03c1", 28, 1], - ["\u03bb\u03b1\u03b2\u03c1", 29, 1], - ["\u03b1\u03bc\u03b2\u03c1", 29, 1], - ["\u03bc\u03b5\u03c1", 28, 1], - ["\u03c0\u03b1\u03c4\u03b5\u03c1", 28, 2], - ["\u03b1\u03bd\u03b8\u03c1", 28, 1], - ["\u03ba\u03bf\u03c1", 28, 1], - ["\u03c3", -1, 1], - ["\u03bd\u03b1\u03b3\u03ba\u03b1\u03c3", 36, 1], - ["\u03c4\u03bf\u03c3", 36, 2], - ["\u03bc\u03bf\u03c5\u03c3\u03c4", -1, 1], - ["\u03c1\u03c5", -1, 1], - ["\u03c6", -1, 1], - ["\u03c3\u03c6", 41, 1], - ["\u03b1\u03bb\u03b9\u03c3\u03c6", 42, 1], - ["\u03bd\u03c5\u03c6", 41, 2], - ["\u03c7", -1, 1], - ], - E = [ - ["\u03b1\u03ba\u03b9\u03b1", -1, 1], - ["\u03b1\u03c1\u03b1\u03ba\u03b9\u03b1", 0, 1], - ["\u03b9\u03c4\u03c3\u03b1", -1, 1], - ["\u03b1\u03ba\u03b9", -1, 1], - ["\u03b1\u03c1\u03b1\u03ba\u03b9", 3, 1], - ["\u03b9\u03c4\u03c3\u03c9\u03bd", -1, 1], - ["\u03b9\u03c4\u03c3\u03b1\u03c3", -1, 1], - ["\u03b9\u03c4\u03c3\u03b5\u03c3", -1, 1], - ], - x = [ - ["\u03c8\u03b1\u03bb", -1, 1], - ["\u03b1\u03b9\u03c6\u03bd", -1, 1], - ["\u03bf\u03bb\u03bf", -1, 1], - ["\u03b9\u03c1", -1, 1], - ], - O = [ - ["\u03b5", -1, 1], - ["\u03c0\u03b1\u03b9\u03c7\u03bd", -1, 1], - ], - N = [ - ["\u03b9\u03b4\u03b9\u03b1", -1, 1], - ["\u03b9\u03b4\u03b9\u03c9\u03bd", -1, 1], - ["\u03b9\u03b4\u03b9\u03bf", -1, 1], - ], - M = [ - ["\u03b9\u03b2", -1, 1], - ["\u03b4", -1, 1], - ["\u03c6\u03c1\u03b1\u03b3\u03ba", -1, 1], - ["\u03bb\u03c5\u03ba", -1, 1], - ["\u03bf\u03b2\u03b5\u03bb", -1, 1], - ["\u03bc\u03b7\u03bd", -1, 1], - ["\u03c1", -1, 1], - ], - P = [ - ["\u03b9\u03c3\u03ba\u03b5", -1, 1], - ["\u03b9\u03c3\u03ba\u03bf", -1, 1], - ["\u03b9\u03c3\u03ba\u03bf\u03c3", -1, 1], - ["\u03b9\u03c3\u03ba\u03bf\u03c5", -1, 1], - ], - Q = [ - ["\u03b1\u03b4\u03c9\u03bd", -1, 1], - ["\u03b1\u03b4\u03b5\u03c3", -1, 1], - ], - T = [ - ["\u03b3\u03b9\u03b1\u03b3\u03b9", -1, -1], - ["\u03b8\u03b5\u03b9", -1, -1], - ["\u03bf\u03ba", -1, -1], - ["\u03bc\u03b1\u03bc", -1, -1], - ["\u03bc\u03b1\u03bd", -1, -1], - ["\u03bc\u03c0\u03b1\u03bc\u03c0", -1, -1], - ["\u03c0\u03b5\u03b8\u03b5\u03c1", -1, -1], - ["\u03c0\u03b1\u03c4\u03b5\u03c1", -1, -1], - ["\u03ba\u03c5\u03c1", -1, -1], - ["\u03bd\u03c4\u03b1\u03bd\u03c4", -1, -1], - ], - U = [ - ["\u03b5\u03b4\u03c9\u03bd", -1, 1], - ["\u03b5\u03b4\u03b5\u03c3", -1, 1], - ], - R = [ - ["\u03bc\u03b9\u03bb", -1, 1], - ["\u03b4\u03b1\u03c0", -1, 1], - ["\u03b3\u03b7\u03c0", -1, 1], - ["\u03b9\u03c0", -1, 1], - ["\u03b5\u03bc\u03c0", -1, 1], - ["\u03bf\u03c0", -1, 1], - ["\u03ba\u03c1\u03b1\u03c3\u03c0", -1, 1], - ["\u03c5\u03c0", -1, 1], - ], - S = [ - ["\u03bf\u03c5\u03b4\u03c9\u03bd", -1, 1], - ["\u03bf\u03c5\u03b4\u03b5\u03c3", -1, 1], - ], - V = [ - ["\u03c4\u03c1\u03b1\u03b3", -1, 1], - ["\u03c6\u03b5", -1, 1], - ["\u03ba\u03b1\u03bb\u03b9\u03b1\u03ba", -1, 1], - ["\u03b1\u03c1\u03ba", -1, 1], - ["\u03c3\u03ba", -1, 1], - ["\u03c0\u03b5\u03c4\u03b1\u03bb", -1, 1], - ["\u03b2\u03b5\u03bb", -1, 1], - ["\u03bb\u03bf\u03c5\u03bb", -1, 1], - ["\u03c6\u03bb", -1, 1], - ["\u03c7\u03bd", -1, 1], - ["\u03c0\u03bb\u03b5\u03be", -1, 1], - ["\u03c3\u03c0", -1, 1], - ["\u03c6\u03c1", -1, 1], - ["\u03c3", -1, 1], - ["\u03bb\u03b9\u03c7", -1, 1], - ], - I = [ - ["\u03b5\u03c9\u03bd", -1, 1], - ["\u03b5\u03c9\u03c3", -1, 1], - ], - D = [ - ["\u03b4", -1, 1], - ["\u03b9\u03b4", 0, 1], - ["\u03b8", -1, 1], - ["\u03b3\u03b1\u03bb", -1, 1], - ["\u03b5\u03bb", -1, 1], - ["\u03bd", -1, 1], - ["\u03c0", -1, 1], - ["\u03c0\u03b1\u03c1", -1, 1], - ], - L = [ - ["\u03b9\u03b1", -1, 1], - ["\u03b9\u03c9\u03bd", -1, 1], - ["\u03b9\u03bf\u03c5", -1, 1], - ], - J = [ - ["\u03b9\u03ba\u03b1", -1, 1], - ["\u03b9\u03ba\u03c9\u03bd", -1, 1], - ["\u03b9\u03ba\u03bf", -1, 1], - ["\u03b9\u03ba\u03bf\u03c5", -1, 1], - ], - K = [ - ["\u03b1\u03b4", -1, 1], - ["\u03c3\u03c5\u03bd\u03b1\u03b4", 0, 1], - ["\u03ba\u03b1\u03c4\u03b1\u03b4", 0, 1], - ["\u03b1\u03bd\u03c4\u03b9\u03b4", -1, 1], - ["\u03b5\u03bd\u03b4", -1, 1], - ["\u03c6\u03c5\u03bb\u03bf\u03b4", -1, 1], - ["\u03c5\u03c0\u03bf\u03b4", -1, 1], - ["\u03c0\u03c1\u03c9\u03c4\u03bf\u03b4", -1, 1], - ["\u03b5\u03be\u03c9\u03b4", -1, 1], - ["\u03b7\u03b8", -1, 1], - ["\u03b1\u03bd\u03b7\u03b8", 9, 1], - ["\u03be\u03b9\u03ba", -1, 1], - ["\u03b1\u03bb", -1, 1], - ["\u03b1\u03bc\u03bc\u03bf\u03c7\u03b1\u03bb", 12, 1], - ["\u03c3\u03c5\u03bd\u03bf\u03bc\u03b7\u03bb", -1, 1], - ["\u03bc\u03c0\u03bf\u03bb", -1, 1], - ["\u03bc\u03bf\u03c5\u03bb", -1, 1], - ["\u03c4\u03c3\u03b1\u03bc", -1, 1], - ["\u03b2\u03c1\u03c9\u03bc", -1, 1], - ["\u03b1\u03bc\u03b1\u03bd", -1, 1], - ["\u03bc\u03c0\u03b1\u03bd", -1, 1], - ["\u03ba\u03b1\u03bb\u03bb\u03b9\u03bd", -1, 1], - ["\u03c0\u03bf\u03c3\u03c4\u03b5\u03bb\u03bd", -1, 1], - ["\u03c6\u03b9\u03bb\u03bf\u03bd", -1, 1], - ["\u03ba\u03b1\u03bb\u03c0", -1, 1], - ["\u03b3\u03b5\u03c1", -1, 1], - ["\u03c7\u03b1\u03c3", -1, 1], - ["\u03bc\u03c0\u03bf\u03c3", -1, 1], - ["\u03c0\u03bb\u03b9\u03b1\u03c4\u03c3", -1, 1], - ["\u03c0\u03b5\u03c4\u03c3", -1, 1], - ["\u03c0\u03b9\u03c4\u03c3", -1, 1], - ["\u03c6\u03c5\u03c3", -1, 1], - ["\u03bc\u03c0\u03b1\u03b3\u03b9\u03b1\u03c4", -1, 1], - ["\u03bd\u03b9\u03c4", -1, 1], - ["\u03c0\u03b9\u03ba\u03b1\u03bd\u03c4", -1, 1], - ["\u03c3\u03b5\u03c1\u03c4", -1, 1], - ], - $ = [ - ["\u03b1\u03b3\u03b1\u03bc\u03b5", -1, 1], - ["\u03b7\u03ba\u03b1\u03bc\u03b5", -1, 1], - ["\u03b7\u03b8\u03b7\u03ba\u03b1\u03bc\u03b5", 1, 1], - ["\u03b7\u03c3\u03b1\u03bc\u03b5", -1, 1], - ["\u03bf\u03c5\u03c3\u03b1\u03bc\u03b5", -1, 1], - ], - aa = [ - ["\u03b2\u03bf\u03c5\u03b2", -1, 1], - ["\u03be\u03b5\u03b8", -1, 1], - ["\u03c0\u03b5\u03b8", -1, 1], - ["\u03b1\u03c0\u03bf\u03b8", -1, 1], - ["\u03b1\u03c0\u03bf\u03ba", -1, 1], - ["\u03bf\u03c5\u03bb", -1, 1], - ["\u03b1\u03bd\u03b1\u03c0", -1, 1], - ["\u03c0\u03b9\u03ba\u03c1", -1, 1], - ["\u03c0\u03bf\u03c4", -1, 1], - ["\u03b1\u03c0\u03bf\u03c3\u03c4", -1, 1], - ["\u03c7", -1, 1], - ["\u03c3\u03b9\u03c7", 10, 1], - ], - ba = [ - ["\u03c4\u03c1", -1, 1], - ["\u03c4\u03c3", -1, 1], - ], - ca = [ - ["\u03b1\u03b3\u03b1\u03bd\u03b5", -1, 1], - ["\u03b7\u03ba\u03b1\u03bd\u03b5", -1, 1], - ["\u03b7\u03b8\u03b7\u03ba\u03b1\u03bd\u03b5", 1, 1], - ["\u03b7\u03c3\u03b1\u03bd\u03b5", -1, 1], - ["\u03bf\u03c5\u03c3\u03b1\u03bd\u03b5", -1, 1], - ["\u03bf\u03bd\u03c4\u03b1\u03bd\u03b5", -1, 1], - ["\u03b9\u03bf\u03bd\u03c4\u03b1\u03bd\u03b5", 5, 1], - ["\u03bf\u03c5\u03bd\u03c4\u03b1\u03bd\u03b5", -1, 1], - ["\u03b9\u03bf\u03c5\u03bd\u03c4\u03b1\u03bd\u03b5", 7, 1], - ["\u03bf\u03c4\u03b1\u03bd\u03b5", -1, 1], - ["\u03b9\u03bf\u03c4\u03b1\u03bd\u03b5", 9, 1], - ], - F = [ - ["\u03c4\u03b1\u03b2", -1, 1], - ["\u03bd\u03c4\u03b1\u03b2", 0, 1], - ["\u03c8\u03b7\u03bb\u03bf\u03c4\u03b1\u03b2", 0, 1], - ["\u03bb\u03b9\u03b2", -1, 1], - ["\u03ba\u03bb\u03b9\u03b2", 3, 1], - ["\u03be\u03b7\u03c1\u03bf\u03ba\u03bb\u03b9\u03b2", 4, 1], - ["\u03b3", -1, 1], - ["\u03b1\u03b3", 6, 1], - ["\u03c4\u03c1\u03b1\u03b3", 7, 1], - ["\u03c4\u03c3\u03b1\u03b3", 7, 1], - ["\u03b1\u03b8\u03b9\u03b3\u03b3", 6, 1], - ["\u03c4\u03c3\u03b9\u03b3\u03b3", 6, 1], - ["\u03b1\u03c4\u03c3\u03b9\u03b3\u03b3", 11, 1], - ["\u03c3\u03c4\u03b5\u03b3", 6, 1], - ["\u03b1\u03c0\u03b7\u03b3", 6, 1], - ["\u03c3\u03b9\u03b3", 6, 1], - ["\u03b1\u03bd\u03bf\u03c1\u03b3", 6, 1], - ["\u03b5\u03bd\u03bf\u03c1\u03b3", 6, 1], - ["\u03ba\u03b1\u03bb\u03c0\u03bf\u03c5\u03b6", -1, 1], - ["\u03b8", -1, 1], - ["\u03bc\u03c9\u03b1\u03bc\u03b5\u03b8", 19, 1], - ["\u03c0\u03b9\u03b8", 19, 1], - ["\u03b1\u03c0\u03b9\u03b8", 21, 1], - ["\u03b4\u03b5\u03ba", -1, 1], - ["\u03c0\u03b5\u03bb\u03b5\u03ba", -1, 1], - ["\u03b9\u03ba", -1, 1], - ["\u03b1\u03bd\u03b9\u03ba", 25, 1], - ["\u03b2\u03bf\u03c5\u03bb\u03ba", -1, 1], - ["\u03b2\u03b1\u03c3\u03ba", -1, 1], - ["\u03b2\u03c1\u03b1\u03c7\u03c5\u03ba", -1, 1], - ["\u03b3\u03b1\u03bb", -1, 1], - ["\u03ba\u03b1\u03c4\u03b1\u03b3\u03b1\u03bb", 30, 1], - ["\u03bf\u03bb\u03bf\u03b3\u03b1\u03bb", 30, 1], - ["\u03b2\u03b1\u03b8\u03c5\u03b3\u03b1\u03bb", 30, 1], - ["\u03bc\u03b5\u03bb", -1, 1], - ["\u03ba\u03b1\u03c3\u03c4\u03b5\u03bb", -1, 1], - ["\u03c0\u03bf\u03c1\u03c4\u03bf\u03bb", -1, 1], - ["\u03c0\u03bb", -1, 1], - ["\u03b4\u03b9\u03c0\u03bb", 37, 1], - ["\u03bb\u03b1\u03bf\u03c0\u03bb", 37, 1], - ["\u03c8\u03c5\u03c7\u03bf\u03c0\u03bb", 37, 1], - ["\u03bf\u03c5\u03bb", -1, 1], - ["\u03bc", -1, 1], - ["\u03bf\u03bb\u03b9\u03b3\u03bf\u03b4\u03b1\u03bc", 42, 1], - ["\u03bc\u03bf\u03c5\u03c3\u03bf\u03c5\u03bb\u03bc", 42, 1], - ["\u03b4\u03c1\u03b1\u03b4\u03bf\u03c5\u03bc", 42, 1], - ["\u03b2\u03c1\u03b1\u03c7\u03bc", 42, 1], - ["\u03bd", -1, 1], - ["\u03b1\u03bc\u03b5\u03c1\u03b9\u03ba\u03b1\u03bd", 47, 1], - ["\u03c0", -1, 1], - ["\u03b1\u03b4\u03b1\u03c0", 49, 1], - ["\u03c7\u03b1\u03bc\u03b7\u03bb\u03bf\u03b4\u03b1\u03c0", 49, 1], - ["\u03c0\u03bf\u03bb\u03c5\u03b4\u03b1\u03c0", 49, 1], - ["\u03ba\u03bf\u03c0", 49, 1], - ["\u03c5\u03c0\u03bf\u03ba\u03bf\u03c0", 53, 1], - ["\u03c4\u03c3\u03bf\u03c0", 49, 1], - ["\u03c3\u03c0", 49, 1], - ["\u03b5\u03c1", -1, 1], - ["\u03b3\u03b5\u03c1", 57, 1], - ["\u03b2\u03b5\u03c4\u03b5\u03c1", 57, 1], - ["\u03bb\u03bf\u03c5\u03b8\u03b7\u03c1", -1, 1], - ["\u03ba\u03bf\u03c1\u03bc\u03bf\u03c1", -1, 1], - ["\u03c0\u03b5\u03c1\u03b9\u03c4\u03c1", -1, 1], - ["\u03bf\u03c5\u03c1", -1, 1], - ["\u03c3", -1, 1], - ["\u03b2\u03b1\u03c3", 64, 1], - ["\u03c0\u03bf\u03bb\u03b9\u03c3", 64, 1], - ["\u03c3\u03b1\u03c1\u03b1\u03ba\u03b1\u03c4\u03c3", 64, 1], - ["\u03b8\u03c5\u03c3", 64, 1], - ["\u03b4\u03b9\u03b1\u03c4", -1, 1], - ["\u03c0\u03bb\u03b1\u03c4", -1, 1], - ["\u03c4\u03c3\u03b1\u03c1\u03bb\u03b1\u03c4", -1, 1], - ["\u03c4\u03b5\u03c4", -1, 1], - ["\u03c0\u03bf\u03c5\u03c1\u03b9\u03c4", -1, 1], - ["\u03c3\u03bf\u03c5\u03bb\u03c4", -1, 1], - ["\u03bc\u03b1\u03b9\u03bd\u03c4", -1, 1], - ["\u03b6\u03c9\u03bd\u03c4", -1, 1], - ["\u03ba\u03b1\u03c3\u03c4", -1, 1], - ["\u03c6", -1, 1], - ["\u03b4\u03b9\u03b1\u03c6", 78, 1], - ["\u03c3\u03c4\u03b5\u03c6", 78, 1], - ["\u03c6\u03c9\u03c4\u03bf\u03c3\u03c4\u03b5\u03c6", 80, 1], - ["\u03c0\u03b5\u03c1\u03b7\u03c6", 78, 1], - ["\u03c5\u03c0\u03b5\u03c1\u03b7\u03c6", 82, 1], - ["\u03ba\u03bf\u03b9\u03bb\u03b1\u03c1\u03c6", 78, 1], - ["\u03c0\u03b5\u03bd\u03c4\u03b1\u03c1\u03c6", 78, 1], - ["\u03bf\u03c1\u03c6", 78, 1], - ["\u03c7", -1, 1], - ["\u03b1\u03bc\u03b7\u03c7", 87, 1], - ["\u03b2\u03b9\u03bf\u03bc\u03b7\u03c7", 87, 1], - ["\u03bc\u03b5\u03b3\u03bb\u03bf\u03b2\u03b9\u03bf\u03bc\u03b7\u03c7", 89, 1], - ["\u03ba\u03b1\u03c0\u03bd\u03bf\u03b2\u03b9\u03bf\u03bc\u03b7\u03c7", 89, 1], - ["\u03bc\u03b9\u03ba\u03c1\u03bf\u03b2\u03b9\u03bf\u03bc\u03b7\u03c7", 89, 1], - ["\u03c0\u03bf\u03bb\u03c5\u03bc\u03b7\u03c7", 87, 1], - ["\u03bb\u03b9\u03c7", 87, 1], - ], - W = [["\u03b7\u03c3\u03b5\u03c4\u03b5", -1, 1]], - da = [ - ["\u03b5\u03bd\u03b4", -1, 1], - ["\u03c3\u03c5\u03bd\u03b4", -1, 1], - ["\u03bf\u03b4", -1, 1], - ["\u03b4\u03b9\u03b1\u03b8", -1, 1], - ["\u03ba\u03b1\u03b8", -1, 1], - ["\u03c1\u03b1\u03b8", -1, 1], - ["\u03c4\u03b1\u03b8", -1, 1], - ["\u03c4\u03b9\u03b8", -1, 1], - ["\u03b5\u03ba\u03b8", -1, 1], - ["\u03b5\u03bd\u03b8", -1, 1], - ["\u03c3\u03c5\u03bd\u03b8", -1, 1], - ["\u03c1\u03bf\u03b8", -1, 1], - ["\u03c5\u03c0\u03b5\u03c1\u03b8", -1, 1], - ["\u03c3\u03b8", -1, 1], - ["\u03b5\u03c5\u03b8", -1, 1], - ["\u03b1\u03c1\u03ba", -1, 1], - ["\u03c9\u03c6\u03b5\u03bb", -1, 1], - ["\u03b2\u03bf\u03bb", -1, 1], - ["\u03b1\u03b9\u03bd", -1, 1], - ["\u03c0\u03bf\u03bd", -1, 1], - ["\u03c1\u03bf\u03bd", -1, 1], - ["\u03c3\u03c5\u03bd", -1, 1], - ["\u03b2\u03b1\u03c1", -1, 1], - ["\u03b2\u03c1", -1, 1], - ["\u03b1\u03b9\u03c1", -1, 1], - ["\u03c6\u03bf\u03c1", -1, 1], - ["\u03b5\u03c5\u03c1", -1, 1], - ["\u03c0\u03c5\u03c1", -1, 1], - ["\u03c7\u03c9\u03c1", -1, 1], - ["\u03bd\u03b5\u03c4", -1, 1], - ["\u03c3\u03c7", -1, 1], - ], - ea = [ - ["\u03c0\u03b1\u03b3", -1, 1], - ["\u03b4", -1, 1], - ["\u03b1\u03b4", 1, 1], - ["\u03b8", -1, 1], - ["\u03b1\u03b8", 3, 1], - ["\u03c4\u03bf\u03ba", -1, 1], - ["\u03c3\u03ba", -1, 1], - ["\u03c0\u03b1\u03c1\u03b1\u03ba\u03b1\u03bb", -1, 1], - ["\u03c3\u03ba\u03b5\u03bb", -1, 1], - ["\u03b1\u03c0\u03bb", -1, 1], - ["\u03b5\u03bc", -1, 1], - ["\u03b1\u03bd", -1, 1], - ["\u03b2\u03b5\u03bd", -1, 1], - ["\u03b2\u03b1\u03c1\u03bf\u03bd", -1, 1], - ["\u03ba\u03bf\u03c0", -1, 1], - ["\u03c3\u03b5\u03c1\u03c0", -1, 1], - ["\u03b1\u03b2\u03b1\u03c1", -1, 1], - ["\u03b5\u03bd\u03b1\u03c1", -1, 1], - ["\u03b1\u03b2\u03c1", -1, 1], - ["\u03bc\u03c0\u03bf\u03c1", -1, 1], - ["\u03b8\u03b1\u03c1\u03c1", -1, 1], - ["\u03bd\u03c4\u03c1", -1, 1], - ["\u03c5", -1, 1], - ["\u03bd\u03b9\u03c6", -1, 1], - ["\u03c3\u03c5\u03c1\u03c6", -1, 1], - ], - fa = [ - ["\u03bf\u03bd\u03c4\u03b1\u03c3", -1, 1], - ["\u03c9\u03bd\u03c4\u03b1\u03c3", -1, 1], - ], - ga = [ - ["\u03bf\u03bc\u03b1\u03c3\u03c4\u03b5", -1, 1], - ["\u03b9\u03bf\u03bc\u03b1\u03c3\u03c4\u03b5", 0, 1], - ], - Y = [ - ["\u03c0", -1, 1], - ["\u03b1\u03c0", 0, 1], - ["\u03b1\u03ba\u03b1\u03c4\u03b1\u03c0", 1, 1], - ["\u03c3\u03c5\u03bc\u03c0", 0, 1], - ["\u03b1\u03c3\u03c5\u03bc\u03c0", 3, 1], - ["\u03b1\u03bc\u03b5\u03c4\u03b1\u03bc\u03c6", -1, 1], - ], - Z = [ - ["\u03b6", -1, 1], - ["\u03b1\u03bb", -1, 1], - ["\u03c0\u03b1\u03c1\u03b1\u03ba\u03b1\u03bb", 1, 1], - ["\u03b5\u03ba\u03c4\u03b5\u03bb", -1, 1], - ["\u03bc", -1, 1], - ["\u03be", -1, 1], - ["\u03c0\u03c1\u03bf", -1, 1], - ["\u03b1\u03c1", -1, 1], - ["\u03bd\u03b9\u03c3", -1, 1], - ], - X = [ - ["\u03b7\u03b8\u03b7\u03ba\u03b1", -1, 1], - ["\u03b7\u03b8\u03b7\u03ba\u03b5", -1, 1], - ["\u03b7\u03b8\u03b7\u03ba\u03b5\u03c3", -1, 1], - ], - ja = [ - ["\u03c0\u03b9\u03b8", -1, 1], - ["\u03bf\u03b8", -1, 1], - ["\u03bd\u03b1\u03c1\u03b8", -1, 1], - ["\u03c3\u03ba\u03bf\u03c5\u03bb", -1, 1], - ["\u03c3\u03ba\u03c9\u03bb", -1, 1], - ["\u03c3\u03c6", -1, 1], - ], - ka = [ - ["\u03b8", -1, 1], - ["\u03b4\u03b9\u03b1\u03b8", 0, 1], - ["\u03c0\u03b1\u03c1\u03b1\u03ba\u03b1\u03c4\u03b1\u03b8", 0, 1], - ["\u03c3\u03c5\u03bd\u03b8", 0, 1], - ["\u03c0\u03c1\u03bf\u03c3\u03b8", 0, 1], - ], - la = [ - ["\u03b7\u03ba\u03b1", -1, 1], - ["\u03b7\u03ba\u03b5", -1, 1], - ["\u03b7\u03ba\u03b5\u03c3", -1, 1], - ], - ma = [ - ["\u03c6\u03b1\u03b3", -1, 1], - ["\u03bb\u03b7\u03b3", -1, 1], - ["\u03c6\u03c1\u03c5\u03b4", -1, 1], - ["\u03bc\u03b1\u03bd\u03c4\u03b9\u03bb", -1, 1], - ["\u03bc\u03b1\u03bb\u03bb", -1, 1], - ["\u03bf\u03bc", -1, 1], - ["\u03b2\u03bb\u03b5\u03c0", -1, 1], - ["\u03c0\u03bf\u03b4\u03b1\u03c1", -1, 1], - ["\u03ba\u03c5\u03bc\u03b1\u03c4", -1, 1], - ["\u03c0\u03c1\u03c9\u03c4", -1, 1], - ["\u03bb\u03b1\u03c7", -1, 1], - ["\u03c0\u03b1\u03bd\u03c4\u03b1\u03c7", -1, 1], - ], - na = [ - ["\u03c4\u03c3\u03b1", -1, 1], - ["\u03c7\u03b1\u03b4", -1, 1], - ["\u03bc\u03b5\u03b4", -1, 1], - ["\u03bb\u03b1\u03bc\u03c0\u03b9\u03b4", -1, 1], - ["\u03b4\u03b5", -1, 1], - ["\u03c0\u03bb\u03b5", -1, 1], - ["\u03bc\u03b5\u03c3\u03b1\u03b6", -1, 1], - ["\u03b4\u03b5\u03c3\u03c0\u03bf\u03b6", -1, 1], - ["\u03b1\u03b9\u03b8", -1, 1], - ["\u03c6\u03b1\u03c1\u03bc\u03b1\u03ba", -1, 1], - ["\u03b1\u03b3\u03ba", -1, 1], - ["\u03b1\u03bd\u03b7\u03ba", -1, 1], - ["\u03bb", -1, 1], - ["\u03bc", -1, 1], - ["\u03b1\u03bc", 13, 1], - ["\u03b2\u03c1\u03bf\u03bc", 13, 1], - ["\u03c5\u03c0\u03bf\u03c4\u03b5\u03b9\u03bd", -1, 1], - ["\u03b5\u03ba\u03bb\u03b9\u03c0", -1, 1], - ["\u03c1", -1, 1], - ["\u03b5\u03bd\u03b4\u03b9\u03b1\u03c6\u03b5\u03c1", 18, 1], - ["\u03b1\u03bd\u03b1\u03c1\u03c1", 18, 1], - ["\u03c0\u03b1\u03c4", -1, 1], - ["\u03ba\u03b1\u03b8\u03b1\u03c1\u03b5\u03c5", -1, 1], - ["\u03b4\u03b5\u03c5\u03c4\u03b5\u03c1\u03b5\u03c5", -1, 1], - ["\u03bb\u03b5\u03c7", -1, 1], - ], - oa = [ - ["\u03bf\u03c5\u03c3\u03b1", -1, 1], - ["\u03bf\u03c5\u03c3\u03b5", -1, 1], - ["\u03bf\u03c5\u03c3\u03b5\u03c3", -1, 1], - ], - pa = [ - ["\u03c0\u03b5\u03bb", -1, 1], - ["\u03bb\u03bb", -1, 1], - ["\u03c3\u03bc\u03b7\u03bd", -1, 1], - ["\u03c1\u03c0", -1, 1], - ["\u03c0\u03c1", -1, 1], - ["\u03c6\u03c1", -1, 1], - ["\u03c7\u03bf\u03c1\u03c4", -1, 1], - ["\u03bf\u03c6", -1, 1], - ["\u03c8\u03bf\u03c6", 7, -1], - ["\u03c3\u03c6", -1, 1], - ["\u03bb\u03bf\u03c7", -1, 1], - ["\u03bd\u03b1\u03c5\u03bb\u03bf\u03c7", 10, -1], - ], - qa = [ - ["\u03b1\u03bc\u03b1\u03bb\u03bb\u03b9", -1, 1], - ["\u03bb", -1, 1], - ["\u03b1\u03bc\u03b1\u03bb", 1, 1], - ["\u03bc", -1, 1], - ["\u03bf\u03c5\u03bb\u03b1\u03bc", 3, 1], - ["\u03b5\u03bd", -1, 1], - ["\u03b4\u03b5\u03c1\u03b2\u03b5\u03bd", 5, 1], - ["\u03c0", -1, 1], - ["\u03b1\u03b5\u03b9\u03c0", 7, 1], - ["\u03b1\u03c1\u03c4\u03b9\u03c0", 7, 1], - ["\u03c3\u03c5\u03bc\u03c0", 7, 1], - ["\u03bd\u03b5\u03bf\u03c0", 7, 1], - ["\u03ba\u03c1\u03bf\u03ba\u03b1\u03bb\u03bf\u03c0", 7, 1], - ["\u03bf\u03bb\u03bf\u03c0", 7, 1], - ["\u03c0\u03c1\u03bf\u03c3\u03c9\u03c0\u03bf\u03c0", 7, 1], - ["\u03c3\u03b9\u03b4\u03b7\u03c1\u03bf\u03c0", 7, 1], - ["\u03b4\u03c1\u03bf\u03c3\u03bf\u03c0", 7, 1], - ["\u03b1\u03c3\u03c0", 7, 1], - ["\u03b1\u03bd\u03c5\u03c0", 7, 1], - ["\u03c1", -1, 1], - ["\u03b1\u03c3\u03c0\u03b1\u03c1", 19, 1], - ["\u03c7\u03b1\u03c1", 19, 1], - ["\u03b1\u03c7\u03b1\u03c1", 21, 1], - ["\u03b1\u03c0\u03b5\u03c1", 19, 1], - ["\u03c4\u03c1", 19, 1], - ["\u03bf\u03c5\u03c1", 19, 1], - ["\u03c4", -1, 1], - ["\u03b4\u03b9\u03b1\u03c4", 26, 1], - ["\u03b5\u03c0\u03b9\u03c4", 26, 1], - ["\u03c3\u03c5\u03bd\u03c4", 26, 1], - ["\u03bf\u03bc\u03bf\u03c4", 26, 1], - ["\u03bd\u03bf\u03bc\u03bf\u03c4", 30, 1], - ["\u03b1\u03c0\u03bf\u03c4", 26, 1], - ["\u03c5\u03c0\u03bf\u03c4", 26, 1], - ["\u03b1\u03b2\u03b1\u03c3\u03c4", 26, 1], - ["\u03b1\u03b9\u03bc\u03bf\u03c3\u03c4", 26, 1], - ["\u03c0\u03c1\u03bf\u03c3\u03c4", 26, 1], - ["\u03b1\u03bd\u03c5\u03c3\u03c4", 26, 1], - ["\u03bd\u03b1\u03c5", -1, 1], - ["\u03b1\u03c6", -1, 1], - ["\u03be\u03b5\u03c6", -1, 1], - ["\u03b1\u03b4\u03b7\u03c6", -1, 1], - ["\u03c0\u03b1\u03bc\u03c6", -1, 1], - ["\u03c0\u03bf\u03bb\u03c5\u03c6", -1, 1], - ], - ra = [ - ["\u03b1\u03b3\u03b1", -1, 1], - ["\u03b1\u03b3\u03b5", -1, 1], - ["\u03b1\u03b3\u03b5\u03c3", -1, 1], - ], - sa = [ - ["\u03b7\u03c3\u03b1", -1, 1], - ["\u03b7\u03c3\u03b5", -1, 1], - ["\u03b7\u03c3\u03bf\u03c5", -1, 1], - ], - ta = [ - ["\u03bd", -1, 1], - ["\u03b4\u03c9\u03b4\u03b5\u03ba\u03b1\u03bd", 0, 1], - ["\u03b5\u03c0\u03c4\u03b1\u03bd", 0, 1], - ["\u03bc\u03b5\u03b3\u03b1\u03bb\u03bf\u03bd", 0, 1], - ["\u03b5\u03c1\u03b7\u03bc\u03bf\u03bd", 0, 1], - ["\u03c7\u03b5\u03c1\u03c3\u03bf\u03bd", 0, 1], - ], - ua = [["\u03b7\u03c3\u03c4\u03b5", -1, 1]], - va = [ - ["\u03c3\u03b2", -1, 1], - ["\u03b1\u03c3\u03b2", 0, 1], - ["\u03b1\u03c0\u03bb", -1, 1], - ["\u03b1\u03b5\u03b9\u03bc\u03bd", -1, 1], - ["\u03c7\u03c1", -1, 1], - ["\u03b1\u03c7\u03c1", 4, 1], - ["\u03ba\u03bf\u03b9\u03bd\u03bf\u03c7\u03c1", 4, 1], - ["\u03b4\u03c5\u03c3\u03c7\u03c1", 4, 1], - ["\u03b5\u03c5\u03c7\u03c1", 4, 1], - ["\u03c0\u03b1\u03bb\u03b9\u03bc\u03c8", -1, 1], - ], - wa = [ - ["\u03bf\u03c5\u03bd\u03b5", -1, 1], - ["\u03b7\u03b8\u03bf\u03c5\u03bd\u03b5", 0, 1], - ["\u03b7\u03c3\u03bf\u03c5\u03bd\u03b5", 0, 1], - ], - xa = [ - ["\u03c3\u03c0\u03b9", -1, 1], - ["\u03bd", -1, 1], - ["\u03b5\u03be\u03c9\u03bd", 1, 1], - ["\u03c1", -1, 1], - ["\u03c3\u03c4\u03c1\u03b1\u03b2\u03bf\u03bc\u03bf\u03c5\u03c4\u03c3", -1, 1], - ["\u03ba\u03b1\u03ba\u03bf\u03bc\u03bf\u03c5\u03c4\u03c3", -1, 1], - ], - ya = [ - ["\u03bf\u03c5\u03bc\u03b5", -1, 1], - ["\u03b7\u03b8\u03bf\u03c5\u03bc\u03b5", 0, 1], - ["\u03b7\u03c3\u03bf\u03c5\u03bc\u03b5", 0, 1], - ], - za = [ - ["\u03b1\u03b6", -1, 1], - ["\u03c9\u03c1\u03b9\u03bf\u03c0\u03bb", -1, 1], - ["\u03b1\u03c3\u03bf\u03c5\u03c3", -1, 1], - ["\u03c0\u03b1\u03c1\u03b1\u03c3\u03bf\u03c5\u03c3", 2, 1], - ["\u03b1\u03bb\u03bb\u03bf\u03c3\u03bf\u03c5\u03c3", -1, 1], - ["\u03c6", -1, 1], - ["\u03c7", -1, 1], - ], - Aa = [ - ["\u03bc\u03b1\u03c4\u03b1", -1, 1], - ["\u03bc\u03b1\u03c4\u03c9\u03bd", -1, 1], - ["\u03bc\u03b1\u03c4\u03bf\u03c3", -1, 1], - ], - Ba = [ - ["\u03b1", -1, 1], - ["\u03b9\u03bf\u03c5\u03bc\u03b1", 0, 1], - ["\u03bf\u03bc\u03bf\u03c5\u03bd\u03b1", 0, 1], - ["\u03b9\u03bf\u03bc\u03bf\u03c5\u03bd\u03b1", 2, 1], - ["\u03bf\u03c3\u03bf\u03c5\u03bd\u03b1", 0, 1], - ["\u03b9\u03bf\u03c3\u03bf\u03c5\u03bd\u03b1", 4, 1], - ["\u03b5", -1, 1], - ["\u03b1\u03b3\u03b1\u03c4\u03b5", 6, 1], - ["\u03b7\u03ba\u03b1\u03c4\u03b5", 6, 1], - ["\u03b7\u03b8\u03b7\u03ba\u03b1\u03c4\u03b5", 8, 1], - ["\u03b7\u03c3\u03b1\u03c4\u03b5", 6, 1], - ["\u03bf\u03c5\u03c3\u03b1\u03c4\u03b5", 6, 1], - ["\u03b5\u03b9\u03c4\u03b5", 6, 1], - ["\u03b7\u03b8\u03b5\u03b9\u03c4\u03b5", 12, 1], - ["\u03b9\u03b5\u03bc\u03b1\u03c3\u03c4\u03b5", 6, 1], - ["\u03bf\u03c5\u03bc\u03b1\u03c3\u03c4\u03b5", 6, 1], - ["\u03b9\u03bf\u03c5\u03bc\u03b1\u03c3\u03c4\u03b5", 15, 1], - ["\u03b9\u03b5\u03c3\u03b1\u03c3\u03c4\u03b5", 6, 1], - ["\u03bf\u03c3\u03b1\u03c3\u03c4\u03b5", 6, 1], - ["\u03b9\u03bf\u03c3\u03b1\u03c3\u03c4\u03b5", 18, 1], - ["\u03b7", -1, 1], - ["\u03b9", -1, 1], - ["\u03b1\u03bc\u03b1\u03b9", 21, 1], - ["\u03b9\u03b5\u03bc\u03b1\u03b9", 21, 1], - ["\u03bf\u03bc\u03b1\u03b9", 21, 1], - ["\u03bf\u03c5\u03bc\u03b1\u03b9", 21, 1], - ["\u03b1\u03c3\u03b1\u03b9", 21, 1], - ["\u03b5\u03c3\u03b1\u03b9", 21, 1], - ["\u03b9\u03b5\u03c3\u03b1\u03b9", 27, 1], - ["\u03b1\u03c4\u03b1\u03b9", 21, 1], - ["\u03b5\u03c4\u03b1\u03b9", 21, 1], - ["\u03b9\u03b5\u03c4\u03b1\u03b9", 30, 1], - ["\u03bf\u03bd\u03c4\u03b1\u03b9", 21, 1], - ["\u03bf\u03c5\u03bd\u03c4\u03b1\u03b9", 21, 1], - ["\u03b9\u03bf\u03c5\u03bd\u03c4\u03b1\u03b9", 33, 1], - ["\u03b5\u03b9", 21, 1], - ["\u03b1\u03b5\u03b9", 35, 1], - ["\u03b7\u03b8\u03b5\u03b9", 35, 1], - ["\u03b7\u03c3\u03b5\u03b9", 35, 1], - ["\u03bf\u03b9", 21, 1], - ["\u03b1\u03bd", -1, 1], - ["\u03b1\u03b3\u03b1\u03bd", 40, 1], - ["\u03b7\u03ba\u03b1\u03bd", 40, 1], - ["\u03b7\u03b8\u03b7\u03ba\u03b1\u03bd", 42, 1], - ["\u03b7\u03c3\u03b1\u03bd", 40, 1], - ["\u03bf\u03c5\u03c3\u03b1\u03bd", 40, 1], - ["\u03bf\u03bd\u03c4\u03bf\u03c5\u03c3\u03b1\u03bd", 45, 1], - ["\u03b9\u03bf\u03bd\u03c4\u03bf\u03c5\u03c3\u03b1\u03bd", 46, 1], - ["\u03bf\u03bd\u03c4\u03b1\u03bd", 40, 1], - ["\u03b9\u03bf\u03bd\u03c4\u03b1\u03bd", 48, 1], - ["\u03bf\u03c5\u03bd\u03c4\u03b1\u03bd", 40, 1], - ["\u03b9\u03bf\u03c5\u03bd\u03c4\u03b1\u03bd", 50, 1], - ["\u03bf\u03c4\u03b1\u03bd", 40, 1], - ["\u03b9\u03bf\u03c4\u03b1\u03bd", 52, 1], - ["\u03bf\u03bc\u03b1\u03c3\u03c4\u03b1\u03bd", 40, 1], - ["\u03b9\u03bf\u03bc\u03b1\u03c3\u03c4\u03b1\u03bd", 54, 1], - ["\u03bf\u03c3\u03b1\u03c3\u03c4\u03b1\u03bd", 40, 1], - ["\u03b9\u03bf\u03c3\u03b1\u03c3\u03c4\u03b1\u03bd", 56, 1], - ["\u03bf\u03c5\u03bd", -1, 1], - ["\u03b7\u03b8\u03bf\u03c5\u03bd", 58, 1], - ["\u03bf\u03bc\u03bf\u03c5\u03bd", 58, 1], - ["\u03b9\u03bf\u03bc\u03bf\u03c5\u03bd", 60, 1], - ["\u03b7\u03c3\u03bf\u03c5\u03bd", 58, 1], - ["\u03bf\u03c3\u03bf\u03c5\u03bd", 58, 1], - ["\u03b9\u03bf\u03c3\u03bf\u03c5\u03bd", 63, 1], - ["\u03c9\u03bd", -1, 1], - ["\u03b7\u03b4\u03c9\u03bd", 65, 1], - ["\u03bf", -1, 1], - ["\u03b1\u03c3", -1, 1], - ["\u03b5\u03c3", -1, 1], - ["\u03b7\u03b4\u03b5\u03c3", 69, 1], - ["\u03b7\u03c3\u03b5\u03c3", 69, 1], - ["\u03b7\u03c3", -1, 1], - ["\u03b5\u03b9\u03c3", -1, 1], - ["\u03b7\u03b8\u03b5\u03b9\u03c3", 73, 1], - ["\u03bf\u03c3", -1, 1], - ["\u03c5\u03c3", -1, 1], - ["\u03bf\u03c5\u03c3", 76, 1], - ["\u03c5", -1, 1], - ["\u03bf\u03c5", 78, 1], - ["\u03c9", -1, 1], - ["\u03b1\u03c9", 80, 1], - ["\u03b7\u03b8\u03c9", 80, 1], - ["\u03b7\u03c3\u03c9", 80, 1], - ], - Ca = [ - ["\u03bf\u03c4\u03b5\u03c1", -1, 1], - ["\u03b5\u03c3\u03c4\u03b5\u03c1", -1, 1], - ["\u03c5\u03c4\u03b5\u03c1", -1, 1], - ["\u03c9\u03c4\u03b5\u03c1", -1, 1], - ["\u03bf\u03c4\u03b1\u03c4", -1, 1], - ["\u03b5\u03c3\u03c4\u03b1\u03c4", -1, 1], - ["\u03c5\u03c4\u03b1\u03c4", -1, 1], - ["\u03c9\u03c4\u03b1\u03c4", -1, 1], - ], - ia = [81, 65, 16, 1], - ha = [81, 65, 0, 1], - B = p; - this.l = function () { - a.f = a.cursor; - a.cursor = a.a; - var d = a.a - a.cursor; - k(); - a.cursor = a.a - d; - if (!(3 <= a.j.length)) return p; - B = g; - d = a.a - a.cursor; - l(); - a.cursor = a.a - d; - var d = a.a - a.cursor, - n; - a.d = a.cursor; - if ( - 0 != a.h(b) && - ((a.c = a.cursor), - a.e() && ((B = p), (a.d = a.cursor), (a.c = a.cursor), (n = a.h(v)), !(0 == n || a.cursor > a.f))) - ) - switch (n) { - case 1: - if (!a.b("\u03b9")) break; - break; - case 2: - a.b("\u03b9\u03b6"); - } - a.cursor = a.a - d; - d = a.a - a.cursor; - a.d = a.cursor; - 0 != a.h(q) && - ((a.c = a.cursor), - a.e() && ((B = p), (a.d = a.cursor), (a.c = a.cursor), 0 == a.h(f) || a.cursor > a.f || a.b("\u03c9\u03bd"))); - a.cursor = a.a - d; - d = a.a - a.cursor; - a: if (((a.d = a.cursor), 0 != a.h(s) && ((a.c = a.cursor), a.e()))) { - B = p; - b: { - n = a.a - a.cursor; - if (a.g("\u03b9\u03c3\u03b1") && !(a.cursor > a.f)) { - if (!a.b("\u03b9\u03c3")) break a; - break b; - } - a.cursor = a.a - n; - a.d = a.cursor; - a.c = a.cursor; - n = a.h(t); - if (!(0 == n || a.cursor > a.f)) - switch (n) { - case 1: - if (!a.b("\u03b9")) break; - break; - case 2: - a.b("\u03b9\u03c3"); - } - } - } - a.cursor = a.a - d; - d = a.a - a.cursor; - a.d = a.cursor; - 0 != a.h(m) && - ((a.c = a.cursor), - a.e() && ((B = p), (a.d = a.cursor), (a.c = a.cursor), 0 == a.h(r) || a.cursor > a.f || a.b("\u03b9"))); - a.cursor = a.a - d; - d = a.a - a.cursor; - a.d = a.cursor; - if ( - 0 != a.h(u) && - ((a.c = a.cursor), - a.e() && ((B = p), (a.d = a.cursor), (a.c = a.cursor), (n = a.h(w)), !(0 == n || a.cursor > a.f))) - ) - switch (n) { - case 1: - if (!a.b("\u03b9")) break; - break; - case 2: - a.b("\u03b9\u03c3\u03c4"); - } - a.cursor = a.a - d; - d = a.a - a.cursor; - a: if (((a.d = a.cursor), 0 != a.h(e) && ((a.c = a.cursor), a.e()))) { - B = p; - b: { - var F = a.a - a.cursor; - a.d = a.cursor; - a.c = a.cursor; - n = a.h(y); - if (0 != n && !(a.cursor > a.f)) { - switch (n) { - case 1: - if (!a.b("\u03b9\u03c3\u03bc")) break a; - break; - case 2: - if (!a.b("\u03b9")) break a; - } - break b; - } - a.cursor = a.a - F; - a.d = a.cursor; - n = a.h(z); - if (0 != n) - switch (((a.c = a.cursor), n)) { - case 1: - if (!a.b("\u03b1\u03b3\u03bd\u03c9\u03c3\u03c4")) break; - break; - case 2: - if (!a.b("\u03b1\u03c4\u03bf\u03bc")) break; - break; - case 3: - if (!a.b("\u03b3\u03bd\u03c9\u03c3\u03c4")) break; - break; - case 4: - if (!a.b("\u03b5\u03b8\u03bd")) break; - break; - case 5: - if (!a.b("\u03b5\u03ba\u03bb\u03b5\u03ba\u03c4")) break; - break; - case 6: - if (!a.b("\u03c3\u03ba\u03b5\u03c0\u03c4")) break; - break; - case 7: - if (!a.b("\u03c4\u03bf\u03c0")) break; - break; - case 8: - if (!a.b("\u03b1\u03bb\u03b5\u03be\u03b1\u03bd\u03b4\u03c1")) break; - break; - case 9: - if (!a.b("\u03b2\u03c5\u03b6\u03b1\u03bd\u03c4")) break; - break; - case 10: - a.b("\u03b8\u03b5\u03b1\u03c4\u03c1"); - } - } - } - a.cursor = a.a - d; - d = a.a - a.cursor; - a.d = a.cursor; - 0 != a.h(H) && - ((a.c = a.cursor), - a.e() && - ((B = p), - (a.d = a.cursor), - (a.c = a.cursor), - 0 == a.h(A) || a.cursor > a.f || a.b("\u03b1\u03c1\u03b1\u03ba"))); - a.cursor = a.a - d; - d = a.a - a.cursor; - a: if (((a.d = a.cursor), 0 != a.h(E) && ((a.c = a.cursor), a.e()))) { - B = p; - b: { - F = a.a - a.cursor; - a.d = a.cursor; - a.c = a.cursor; - n = a.h(G); - if (0 != n && !(a.cursor > a.f)) { - switch (n) { - case 1: - if (!a.b("\u03b1\u03ba")) break a; - break; - case 2: - if (!a.b("\u03b9\u03c4\u03c3")) break a; - } - break b; - } - a.cursor = a.a - F; - a.d = a.cursor; - a.c = a.cursor; - !a.g("\u03ba\u03bf\u03c1") || a.b("\u03b9\u03c4\u03c3"); - } - } - a.cursor = a.a - d; - d = a.a - a.cursor; - a: if (((a.d = a.cursor), 0 != a.h(N) && ((a.c = a.cursor), a.e()))) { - B = p; - b: { - n = a.a - a.cursor; - a.d = a.cursor; - a.c = a.cursor; - if (0 != a.h(x) && !(a.cursor > a.f)) { - if (!a.b("\u03b9\u03b4")) break a; - break b; - } - a.cursor = a.a - n; - a.d = a.cursor; - a.c = a.cursor; - 0 == a.h(O) || a.b("\u03b9\u03b4"); - } - } - a.cursor = a.a - d; - d = a.a - a.cursor; - a.d = a.cursor; - 0 != a.h(P) && - ((a.c = a.cursor), - a.e() && - ((B = p), (a.d = a.cursor), (a.c = a.cursor), 0 == a.h(M) || a.cursor > a.f || a.b("\u03b9\u03c3\u03ba"))); - a.cursor = a.a - d; - d = a.a - a.cursor; - a: if (((a.d = a.cursor), 0 != a.h(Q) && ((a.c = a.cursor), a.e()))) { - n = a.a - a.cursor; - if (0 != a.h(T)) break a; - a.cursor = a.a - n; - n = a.cursor; - a.r(a.cursor, a.cursor, "\u03b1\u03b4"); - a.cursor = n; - } - a.cursor = a.a - d; - d = a.a - a.cursor; - a.d = a.cursor; - 0 != a.h(U) && - ((a.c = a.cursor), a.e() && ((a.d = a.cursor), (a.c = a.cursor), 0 == a.h(R) || a.b("\u03b5\u03b4"))); - a.cursor = a.a - d; - d = a.a - a.cursor; - a.d = a.cursor; - 0 != a.h(S) && - ((a.c = a.cursor), a.e() && ((a.d = a.cursor), (a.c = a.cursor), 0 == a.h(V) || a.b("\u03bf\u03c5\u03b4"))); - a.cursor = a.a - d; - d = a.a - a.cursor; - a.d = a.cursor; - 0 != a.h(I) && - ((a.c = a.cursor), - a.e() && ((B = p), (a.d = a.cursor), (a.c = a.cursor), 0 == a.h(D) || a.cursor > a.f || a.b("\u03b5"))); - a.cursor = a.a - d; - d = a.a - a.cursor; - a.d = a.cursor; - 0 != a.h(L) && - ((a.c = a.cursor), a.e() && ((B = p), (a.d = a.cursor), (a.c = a.cursor), !a.n(ia, 945, 969) || a.b("\u03b9"))); - a.cursor = a.a - d; - d = a.a - a.cursor; - a: if (((a.d = a.cursor), 0 != a.h(J) && ((a.c = a.cursor), a.e()))) { - B = p; - b: { - n = a.a - a.cursor; - a.d = a.cursor; - a.c = a.cursor; - if (a.n(ia, 945, 969)) { - if (!a.b("\u03b9\u03ba")) break a; - break b; - } - a.cursor = a.a - n; - a.d = a.cursor; - } - a.c = a.cursor; - 0 == a.h(K) || a.cursor > a.f || a.b("\u03b9\u03ba"); - } - a.cursor = a.a - d; - d = a.a - a.cursor; - a: { - n = a.a - a.cursor; - if (a.g("\u03b1\u03b3\u03b1\u03bc\u03b5") && !(a.cursor > a.f) && !a.b("\u03b1\u03b3\u03b1\u03bc")) break a; - a.cursor = a.a - n; - n = a.a - a.cursor; - a.d = a.cursor; - if (0 != a.h($)) { - a.c = a.cursor; - if (!a.e()) break a; - B = p; - } - a.cursor = a.a - n; - a.d = a.cursor; - a.g("\u03b1\u03bc\u03b5") && - ((a.c = a.cursor), - a.e() && ((B = p), (a.d = a.cursor), (a.c = a.cursor), 0 == a.h(aa) || a.cursor > a.f || a.b("\u03b1\u03bc"))); - } - a.cursor = a.a - d; - d = a.a - a.cursor; - h(); - a.cursor = a.a - d; - d = a.a - a.cursor; - c(); - a.cursor = a.a - d; - d = a.a - a.cursor; - a: if (((a.d = a.cursor), 0 != a.h(fa) && ((a.c = a.cursor), a.e()))) { - B = p; - b: { - n = a.a - a.cursor; - a.d = a.cursor; - a.c = a.cursor; - if (a.g("\u03b1\u03c1\u03c7") && !(a.cursor > a.f)) { - if (!a.b("\u03bf\u03bd\u03c4")) break a; - break b; - } - a.cursor = a.a - n; - a.d = a.cursor; - a.c = a.cursor; - !a.g("\u03ba\u03c1\u03b5") || a.b("\u03c9\u03bd\u03c4"); - } - } - a.cursor = a.a - d; - d = a.a - a.cursor; - a.d = a.cursor; - 0 != a.h(ga) && - ((a.c = a.cursor), - a.e() && - ((B = p), - (a.d = a.cursor), - (a.c = a.cursor), - !a.g("\u03bf\u03bd") || a.cursor > a.f || a.b("\u03bf\u03bc\u03b1\u03c3\u03c4"))); - a.cursor = a.a - d; - d = a.a - a.cursor; - a: { - n = a.a - a.cursor; - a.d = a.cursor; - if (a.g("\u03b9\u03b5\u03c3\u03c4\u03b5")) { - a.c = a.cursor; - if (!a.e()) break a; - B = p; - a.d = a.cursor; - a.c = a.cursor; - if (0 != a.h(Y) && !(a.cursor > a.f) && !a.b("\u03b9\u03b5\u03c3\u03c4")) break a; - } - a.cursor = a.a - n; - a.d = a.cursor; - a.g("\u03b5\u03c3\u03c4\u03b5") && - ((a.c = a.cursor), - a.e() && - ((B = p), - (a.d = a.cursor), - (a.c = a.cursor), - 0 == a.h(Z) || a.cursor > a.f || a.b("\u03b9\u03b5\u03c3\u03c4"))); - } - a.cursor = a.a - d; - d = a.a - a.cursor; - a: { - n = a.a - a.cursor; - a.d = a.cursor; - if (0 != a.h(X)) { - a.c = a.cursor; - if (!a.e()) break a; - B = p; - } - a.cursor = a.a - n; - a.d = a.cursor; - if (0 != a.h(la) && ((a.c = a.cursor), a.e())) { - B = p; - b: { - n = a.a - a.cursor; - a.d = a.cursor; - a.c = a.cursor; - if (0 != a.h(ja)) { - if (!a.b("\u03b7\u03ba")) break a; - break b; - } - a.cursor = a.a - n; - a.d = a.cursor; - a.c = a.cursor; - 0 == a.h(ka) || a.cursor > a.f || a.b("\u03b7\u03ba"); - } - } - } - a.cursor = a.a - d; - d = a.a - a.cursor; - a: if (((a.d = a.cursor), 0 != a.h(oa) && ((a.c = a.cursor), a.e()))) { - B = p; - b: { - n = a.a - a.cursor; - a.d = a.cursor; - a.c = a.cursor; - if (0 != a.h(ma)) { - if (!a.b("\u03bf\u03c5\u03c3")) break a; - break b; - } - a.cursor = a.a - n; - a.d = a.cursor; - a.c = a.cursor; - 0 == a.h(na) || a.cursor > a.f || a.b("\u03bf\u03c5\u03c3"); - } - } - a.cursor = a.a - d; - d = a.a - a.cursor; - a.d = a.cursor; - 0 != a.h(sa) && - ((a.c = a.cursor), - a.e() && ((B = p), (a.d = a.cursor), (a.c = a.cursor), 0 == a.h(ta) || a.cursor > a.f || a.b("\u03b7\u03c3"))); - a.cursor = a.a - d; - d = a.a - a.cursor; - a: if (((a.d = a.cursor), 0 != a.h(ra) && ((a.c = a.cursor), a.e()))) { - B = p; - b: { - n = a.a - a.cursor; - a.d = a.cursor; - a.c = a.cursor; - if (a.g("\u03ba\u03bf\u03bb\u03bb")) { - if (!a.b("\u03b1\u03b3")) break a; - break b; - } - a.cursor = a.a - n; - c: { - F = a.a - a.cursor; - a.d = a.cursor; - a.c = a.cursor; - n = a.h(pa); - if (0 != n) { - switch (n) { - case 1: - if (!a.b("\u03b1\u03b3")) break a; - } - break c; - } - a.cursor = a.a - F; - a.d = a.cursor; - a.c = a.cursor; - 0 == a.h(qa) || a.cursor > a.f || a.b("\u03b1\u03b3"); - } - } - } - a.cursor = a.a - d; - d = a.a - a.cursor; - a.d = a.cursor; - 0 != a.h(ua) && - ((a.c = a.cursor), - a.e() && - ((B = p), (a.d = a.cursor), (a.c = a.cursor), 0 == a.h(va) || a.cursor > a.f || a.b("\u03b7\u03c3\u03c4"))); - a.cursor = a.a - d; - d = a.a - a.cursor; - a.d = a.cursor; - 0 != a.h(wa) && - ((a.c = a.cursor), - a.e() && - ((B = p), (a.d = a.cursor), (a.c = a.cursor), 0 == a.h(xa) || a.cursor > a.f || a.b("\u03bf\u03c5\u03bd"))); - a.cursor = a.a - d; - d = a.a - a.cursor; - a.d = a.cursor; - 0 != a.h(ya) && - ((a.c = a.cursor), - a.e() && - ((B = p), (a.d = a.cursor), (a.c = a.cursor), 0 == a.h(za) || a.cursor > a.f || a.b("\u03bf\u03c5\u03bc"))); - a.cursor = a.a - d; - d = a.a - a.cursor; - a: { - n = a.a - a.cursor; - a.d = a.cursor; - if (0 != a.h(Aa) && ((a.c = a.cursor), !a.b("\u03bc\u03b1"))) break a; - a.cursor = a.a - n; - B && ((a.d = a.cursor), 0 != a.h(Ba) && ((a.c = a.cursor), a.e())); - } - a.cursor = a.a - d; - d = a.a - a.cursor; - a.d = a.cursor; - 0 != a.h(Ca) && ((a.c = a.cursor), a.e()); - a.cursor = a.a - d; - a.cursor = a.f; - return g; - }; - this.stemWord = function (b) { - a.p(b); - this.l(); - return a.j; - }; -} - -const stemmerInstance = new stem(); - -export function stemmer(word) { - return stemmerInstance.stemWord(word); -} diff --git a/stemmer/lib/hu.d.ts b/stemmer/lib/hu.d.ts deleted file mode 100644 index 838f68c..0000000 --- a/stemmer/lib/hu.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare function stemmer(word: string): string; diff --git a/stemmer/lib/hu.js b/stemmer/lib/hu.js deleted file mode 100644 index 04cece0..0000000 --- a/stemmer/lib/hu.js +++ /dev/null @@ -1,572 +0,0 @@ -/* - * ----------------------------------------------------------------------------- - * GENERATED FILE - DO NOT EDIT! - * This file has been compiled using the Snowball stemmer generator. - * Don't edit this file directly. - * ----------------------------------------------------------------------------- - */ - -var g = !0, - p = !1; - -function C() { - this.p = function (k) { - this.j = k; - this.cursor = 0; - this.a = this.j.length; - this.f = 0; - this.c = this.cursor; - this.d = this.a; - }; - this.z = function () { - return this.j; - }; - this.w = function (k) { - this.j = k.j; - this.cursor = k.cursor; - this.a = k.a; - this.f = k.f; - this.c = k.c; - this.d = k.d; - }; - this.i = function (k, l, h) { - if (this.cursor >= this.a) return p; - var c = this.j.charCodeAt(this.cursor); - if (c > h || c < l) return p; - c -= l; - if (0 == (k[c >>> 3] & (1 << (c & 7)))) return p; - this.cursor++; - return g; - }; - this.n = function (k, l, h) { - if (this.cursor <= this.f) return p; - var c = this.j.charCodeAt(this.cursor - 1); - if (c > h || c < l) return p; - c -= l; - if (0 == (k[c >>> 3] & (1 << (c & 7)))) return p; - this.cursor--; - return g; - }; - this.k = function (k, l, h) { - if (this.cursor >= this.a) return p; - var c = this.j.charCodeAt(this.cursor); - if (c > h || c < l) return this.cursor++, g; - c -= l; - return 0 == (k[c >>> 3] & (1 << (c & 7))) ? (this.cursor++, g) : p; - }; - this.q = function (k, l, h) { - if (this.cursor <= this.f) return p; - var c = this.j.charCodeAt(this.cursor - 1); - if (c > h || c < l) return this.cursor--, g; - c -= l; - return 0 == (k[c >>> 3] & (1 << (c & 7))) ? (this.cursor--, g) : p; - }; - this.m = function (k) { - if (this.a - this.cursor < k.length || this.j.slice(this.cursor, this.cursor + k.length) != k) return p; - this.cursor += k.length; - return g; - }; - this.g = function (k) { - if (this.cursor - this.f < k.length || this.j.slice(this.cursor - k.length, this.cursor) != k) return p; - this.cursor -= k.length; - return g; - }; - this.o = function (k) { - for (var l = 0, h = k.length, c = this.cursor, a = this.a, d = 0, n = 0, v = p; ; ) { - var b = l + ((h - l) >>> 1), - f = 0, - q = d < n ? d : n, - t = k[b], - s; - for (s = q; s < t[0].length; s++) { - if (c + q == a) { - f = -1; - break; - } - f = this.j.charCodeAt(c + q) - t[0].charCodeAt(s); - if (0 != f) break; - q++; - } - 0 > f ? ((h = b), (n = q)) : ((l = b), (d = q)); - if (1 >= h - l) { - if (0 < l) break; - if (h == l) break; - if (v) break; - v = g; - } - } - for (;;) { - t = k[l]; - if (d >= t[0].length) { - this.cursor = c + t[0].length; - if (4 > t.length) return t[2]; - l = t[3](this); - this.cursor = c + t[0].length; - if (l) return t[2]; - } - l = t[1]; - if (0 > l) return 0; - } - }; - this.h = function (k) { - for (var l = 0, h = k.length, c = this.cursor, a = this.f, d = 0, n = 0, v = p; ; ) { - var b = l + ((h - l) >> 1), - f = 0, - q = d < n ? d : n, - t = k[b], - s; - for (s = t[0].length - 1 - q; 0 <= s; s--) { - if (c - q == a) { - f = -1; - break; - } - f = this.j.charCodeAt(c - 1 - q) - t[0].charCodeAt(s); - if (0 != f) break; - q++; - } - 0 > f ? ((h = b), (n = q)) : ((l = b), (d = q)); - if (1 >= h - l) { - if (0 < l) break; - if (h == l) break; - if (v) break; - v = g; - } - } - for (;;) { - t = k[l]; - if (d >= t[0].length) { - this.cursor = c - t[0].length; - if (4 > t.length) return t[2]; - l = t[3](this); - this.cursor = c - t[0].length; - if (l) return t[2]; - } - l = t[1]; - if (0 > l) return 0; - } - }; - this.s = function (k, l, h) { - var c = h.length - (l - k); - this.j = this.j.slice(0, k) + h + this.j.slice(l); - this.a += c; - this.cursor >= l ? (this.cursor += c) : this.cursor > k && (this.cursor = k); - return c; - }; - this.t = function () { - return 0 > this.c || this.c > this.d || this.d > this.a || this.a > this.j.length ? p : g; - }; - this.b = function (k) { - var l = p; - this.t() && (this.s(this.c, this.d, k), (l = g)); - return l; - }; - this.e = function () { - return this.b(""); - }; - this.r = function (k, l, h) { - l = this.s(k, l, h); - k <= this.c && (this.c += l); - k <= this.d && (this.d += l); - }; - this.u = function () { - var k = ""; - this.t() && (k = this.j.slice(this.c, this.d)); - return k; - }; - this.v = function () { - return this.j.slice(0, this.a); - }; -} - -function stem() { - function k() { - return !(y <= c.cursor) ? p : g; - } - function l() { - var a = c.a - c.cursor; - if (0 == c.h(n)) return p; - c.cursor = c.a - a; - return g; - } - function h() { - if (!(c.cursor <= c.f)) { - c.cursor--; - c.d = c.cursor; - var a = c.cursor - 1; - a < c.f || ((c.cursor = a), (c.c = c.cursor), c.e()); - } - } - var c = new C(), - a = [ - ["cs", -1, -1], - ["dzs", -1, -1], - ["gy", -1, -1], - ["ly", -1, -1], - ["ny", -1, -1], - ["sz", -1, -1], - ["ty", -1, -1], - ["zs", -1, -1], - ], - d = [ - ["\u00e1", -1, 1], - ["\u00e9", -1, 2], - ], - n = [ - ["bb", -1, -1], - ["cc", -1, -1], - ["dd", -1, -1], - ["ff", -1, -1], - ["gg", -1, -1], - ["jj", -1, -1], - ["kk", -1, -1], - ["ll", -1, -1], - ["mm", -1, -1], - ["nn", -1, -1], - ["pp", -1, -1], - ["rr", -1, -1], - ["ccs", -1, -1], - ["ss", -1, -1], - ["zzs", -1, -1], - ["tt", -1, -1], - ["vv", -1, -1], - ["ggy", -1, -1], - ["lly", -1, -1], - ["nny", -1, -1], - ["tty", -1, -1], - ["ssz", -1, -1], - ["zz", -1, -1], - ], - v = [ - ["al", -1, 1], - ["el", -1, 1], - ], - b = [ - ["ba", -1, -1], - ["ra", -1, -1], - ["be", -1, -1], - ["re", -1, -1], - ["ig", -1, -1], - ["nak", -1, -1], - ["nek", -1, -1], - ["val", -1, -1], - ["vel", -1, -1], - ["ul", -1, -1], - ["n\u00e1l", -1, -1], - ["n\u00e9l", -1, -1], - ["b\u00f3l", -1, -1], - ["r\u00f3l", -1, -1], - ["t\u00f3l", -1, -1], - ["\u00fcl", -1, -1], - ["b\u0151l", -1, -1], - ["r\u0151l", -1, -1], - ["t\u0151l", -1, -1], - ["n", -1, -1], - ["an", 19, -1], - ["ban", 20, -1], - ["en", 19, -1], - ["ben", 22, -1], - ["k\u00e9ppen", 22, -1], - ["on", 19, -1], - ["\u00f6n", 19, -1], - ["k\u00e9pp", -1, -1], - ["kor", -1, -1], - ["t", -1, -1], - ["at", 29, -1], - ["et", 29, -1], - ["k\u00e9nt", 29, -1], - ["ank\u00e9nt", 32, -1], - ["enk\u00e9nt", 32, -1], - ["onk\u00e9nt", 32, -1], - ["ot", 29, -1], - ["\u00e9rt", 29, -1], - ["\u00f6t", 29, -1], - ["hez", -1, -1], - ["hoz", -1, -1], - ["h\u00f6z", -1, -1], - ["v\u00e1", -1, -1], - ["v\u00e9", -1, -1], - ], - f = [ - ["\u00e1n", -1, 2], - ["\u00e9n", -1, 1], - ["\u00e1nk\u00e9nt", -1, 2], - ], - q = [ - ["stul", -1, 1], - ["astul", 0, 1], - ["\u00e1stul", 0, 2], - ["st\u00fcl", -1, 1], - ["est\u00fcl", 3, 1], - ["\u00e9st\u00fcl", 3, 3], - ], - t = [ - ["\u00e1", -1, 1], - ["\u00e9", -1, 1], - ], - s = [ - ["k", -1, 3], - ["ak", 0, 3], - ["ek", 0, 3], - ["ok", 0, 3], - ["\u00e1k", 0, 1], - ["\u00e9k", 0, 2], - ["\u00f6k", 0, 3], - ], - r = [ - ["\u00e9i", -1, 1], - ["\u00e1\u00e9i", 0, 3], - ["\u00e9\u00e9i", 0, 2], - ["\u00e9", -1, 1], - ["k\u00e9", 3, 1], - ["ak\u00e9", 4, 1], - ["ek\u00e9", 4, 1], - ["ok\u00e9", 4, 1], - ["\u00e1k\u00e9", 4, 3], - ["\u00e9k\u00e9", 4, 2], - ["\u00f6k\u00e9", 4, 1], - ["\u00e9\u00e9", 3, 2], - ], - m = [ - ["a", -1, 1], - ["ja", 0, 1], - ["d", -1, 1], - ["ad", 2, 1], - ["ed", 2, 1], - ["od", 2, 1], - ["\u00e1d", 2, 2], - ["\u00e9d", 2, 3], - ["\u00f6d", 2, 1], - ["e", -1, 1], - ["je", 9, 1], - ["nk", -1, 1], - ["unk", 11, 1], - ["\u00e1nk", 11, 2], - ["\u00e9nk", 11, 3], - ["\u00fcnk", 11, 1], - ["uk", -1, 1], - ["juk", 16, 1], - ["\u00e1juk", 17, 2], - ["\u00fck", -1, 1], - ["j\u00fck", 19, 1], - ["\u00e9j\u00fck", 20, 3], - ["m", -1, 1], - ["am", 22, 1], - ["em", 22, 1], - ["om", 22, 1], - ["\u00e1m", 22, 2], - ["\u00e9m", 22, 3], - ["o", -1, 1], - ["\u00e1", -1, 2], - ["\u00e9", -1, 3], - ], - w = [ - ["id", -1, 1], - ["aid", 0, 1], - ["jaid", 1, 1], - ["eid", 0, 1], - ["jeid", 3, 1], - ["\u00e1id", 0, 2], - ["\u00e9id", 0, 3], - ["i", -1, 1], - ["ai", 7, 1], - ["jai", 8, 1], - ["ei", 7, 1], - ["jei", 10, 1], - ["\u00e1i", 7, 2], - ["\u00e9i", 7, 3], - ["itek", -1, 1], - ["eitek", 14, 1], - ["jeitek", 15, 1], - ["\u00e9itek", 14, 3], - ["ik", -1, 1], - ["aik", 18, 1], - ["jaik", 19, 1], - ["eik", 18, 1], - ["jeik", 21, 1], - ["\u00e1ik", 18, 2], - ["\u00e9ik", 18, 3], - ["ink", -1, 1], - ["aink", 25, 1], - ["jaink", 26, 1], - ["eink", 25, 1], - ["jeink", 28, 1], - ["\u00e1ink", 25, 2], - ["\u00e9ink", 25, 3], - ["aitok", -1, 1], - ["jaitok", 32, 1], - ["\u00e1itok", -1, 2], - ["im", -1, 1], - ["aim", 35, 1], - ["jaim", 36, 1], - ["eim", 35, 1], - ["jeim", 38, 1], - ["\u00e1im", 35, 2], - ["\u00e9im", 35, 3], - ], - u = [17, 65, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 17, 36, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1], - y = 0; - this.l = function () { - var n = c.cursor; - a: { - y = c.a; - b: { - var e = c.cursor; - c: if (c.i(u, 97, 369)) { - d: for (;;) { - var A = c.cursor; - if (c.k(u, 97, 369)) { - c.cursor = A; - break d; - } - c.cursor = A; - if (c.cursor >= c.a) break c; - c.cursor++; - } - d: { - A = c.cursor; - if (0 != c.o(a)) break d; - c.cursor = A; - if (c.cursor >= c.a) break c; - c.cursor++; - } - y = c.cursor; - break b; - } - c.cursor = e; - if (c.k(u, 97, 369)) { - c: for (;;) { - if (c.i(u, 97, 369)) break c; - if (c.cursor >= c.a) break a; - c.cursor++; - } - y = c.cursor; - } - } - } - c.cursor = n; - c.f = c.cursor; - c.cursor = c.a; - n = c.a - c.cursor; - c.d = c.cursor; - 0 != c.h(v) && ((c.c = c.cursor), !k() || !l() || !c.e() || h()); - c.cursor = c.a - n; - n = c.a - c.cursor; - c.d = c.cursor; - if ( - 0 != c.h(b) && - ((c.c = c.cursor), k() && c.e() && ((c.d = c.cursor), (e = c.h(d)), 0 != e && ((c.c = c.cursor), k()))) - ) - switch (e) { - case 1: - if (!c.b("a")) break; - break; - case 2: - c.b("e"); - } - c.cursor = c.a - n; - n = c.a - c.cursor; - c.d = c.cursor; - e = c.h(f); - if (0 != e && ((c.c = c.cursor), k())) - switch (e) { - case 1: - if (!c.b("e")) break; - break; - case 2: - c.b("a"); - } - c.cursor = c.a - n; - n = c.a - c.cursor; - c.d = c.cursor; - e = c.h(q); - if (0 != e && ((c.c = c.cursor), k())) - switch (e) { - case 1: - if (!c.e()) break; - break; - case 2: - if (!c.b("a")) break; - break; - case 3: - c.b("e"); - } - c.cursor = c.a - n; - n = c.a - c.cursor; - c.d = c.cursor; - 0 != c.h(t) && ((c.c = c.cursor), !k() || !l() || !c.e() || h()); - c.cursor = c.a - n; - n = c.a - c.cursor; - c.d = c.cursor; - e = c.h(r); - if (0 != e && ((c.c = c.cursor), k())) - switch (e) { - case 1: - if (!c.e()) break; - break; - case 2: - if (!c.b("e")) break; - break; - case 3: - c.b("a"); - } - c.cursor = c.a - n; - n = c.a - c.cursor; - c.d = c.cursor; - e = c.h(m); - if (0 != e && ((c.c = c.cursor), k())) - switch (e) { - case 1: - if (!c.e()) break; - break; - case 2: - if (!c.b("a")) break; - break; - case 3: - c.b("e"); - } - c.cursor = c.a - n; - n = c.a - c.cursor; - c.d = c.cursor; - e = c.h(w); - if (0 != e && ((c.c = c.cursor), k())) - switch (e) { - case 1: - if (!c.e()) break; - break; - case 2: - if (!c.b("a")) break; - break; - case 3: - c.b("e"); - } - c.cursor = c.a - n; - n = c.a - c.cursor; - c.d = c.cursor; - e = c.h(s); - if (0 != e && ((c.c = c.cursor), k())) - switch (e) { - case 1: - if (!c.b("a")) break; - break; - case 2: - if (!c.b("e")) break; - break; - case 3: - c.e(); - } - c.cursor = c.a - n; - c.cursor = c.f; - return g; - }; - this.stemWord = function (a) { - c.p(a); - this.l(); - return c.j; - }; -} - -const stemmerInstance = new stem(); - -export function stemmer(word) { - return stemmerInstance.stemWord(word); -} diff --git a/stemmer/lib/id.d.ts b/stemmer/lib/id.d.ts deleted file mode 100644 index 838f68c..0000000 --- a/stemmer/lib/id.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare function stemmer(word: string): string; diff --git a/stemmer/lib/id.js b/stemmer/lib/id.js deleted file mode 100644 index f9732c2..0000000 --- a/stemmer/lib/id.js +++ /dev/null @@ -1,416 +0,0 @@ -/* - * ----------------------------------------------------------------------------- - * GENERATED FILE - DO NOT EDIT! - * This file has been compiled using the Snowball stemmer generator. - * Don't edit this file directly. - * ----------------------------------------------------------------------------- - */ - -var g = !0, - p = !1; - -function C() { - this.p = function (k) { - this.j = k; - this.cursor = 0; - this.a = this.j.length; - this.f = 0; - this.c = this.cursor; - this.d = this.a; - }; - this.z = function () { - return this.j; - }; - this.w = function (k) { - this.j = k.j; - this.cursor = k.cursor; - this.a = k.a; - this.f = k.f; - this.c = k.c; - this.d = k.d; - }; - this.i = function (k, l, h) { - if (this.cursor >= this.a) return p; - var c = this.j.charCodeAt(this.cursor); - if (c > h || c < l) return p; - c -= l; - if (0 == (k[c >>> 3] & (1 << (c & 7)))) return p; - this.cursor++; - return g; - }; - this.n = function (k, l, h) { - if (this.cursor <= this.f) return p; - var c = this.j.charCodeAt(this.cursor - 1); - if (c > h || c < l) return p; - c -= l; - if (0 == (k[c >>> 3] & (1 << (c & 7)))) return p; - this.cursor--; - return g; - }; - this.k = function (k, l, h) { - if (this.cursor >= this.a) return p; - var c = this.j.charCodeAt(this.cursor); - if (c > h || c < l) return this.cursor++, g; - c -= l; - return 0 == (k[c >>> 3] & (1 << (c & 7))) ? (this.cursor++, g) : p; - }; - this.q = function (k, l, h) { - if (this.cursor <= this.f) return p; - var c = this.j.charCodeAt(this.cursor - 1); - if (c > h || c < l) return this.cursor--, g; - c -= l; - return 0 == (k[c >>> 3] & (1 << (c & 7))) ? (this.cursor--, g) : p; - }; - this.m = function (k) { - if (this.a - this.cursor < k.length || this.j.slice(this.cursor, this.cursor + k.length) != k) return p; - this.cursor += k.length; - return g; - }; - this.g = function (k) { - if (this.cursor - this.f < k.length || this.j.slice(this.cursor - k.length, this.cursor) != k) return p; - this.cursor -= k.length; - return g; - }; - this.o = function (k) { - for (var l = 0, h = k.length, c = this.cursor, a = this.a, d = 0, n = 0, v = p; ; ) { - var b = l + ((h - l) >>> 1), - f = 0, - q = d < n ? d : n, - t = k[b], - s; - for (s = q; s < t[0].length; s++) { - if (c + q == a) { - f = -1; - break; - } - f = this.j.charCodeAt(c + q) - t[0].charCodeAt(s); - if (0 != f) break; - q++; - } - 0 > f ? ((h = b), (n = q)) : ((l = b), (d = q)); - if (1 >= h - l) { - if (0 < l) break; - if (h == l) break; - if (v) break; - v = g; - } - } - for (;;) { - t = k[l]; - if (d >= t[0].length) { - this.cursor = c + t[0].length; - if (4 > t.length) return t[2]; - l = t[3](this); - this.cursor = c + t[0].length; - if (l) return t[2]; - } - l = t[1]; - if (0 > l) return 0; - } - }; - this.h = function (k) { - for (var l = 0, h = k.length, c = this.cursor, a = this.f, d = 0, n = 0, v = p; ; ) { - var b = l + ((h - l) >> 1), - f = 0, - q = d < n ? d : n, - t = k[b], - s; - for (s = t[0].length - 1 - q; 0 <= s; s--) { - if (c - q == a) { - f = -1; - break; - } - f = this.j.charCodeAt(c - 1 - q) - t[0].charCodeAt(s); - if (0 != f) break; - q++; - } - 0 > f ? ((h = b), (n = q)) : ((l = b), (d = q)); - if (1 >= h - l) { - if (0 < l) break; - if (h == l) break; - if (v) break; - v = g; - } - } - for (;;) { - t = k[l]; - if (d >= t[0].length) { - this.cursor = c - t[0].length; - if (4 > t.length) return t[2]; - l = t[3](this); - this.cursor = c - t[0].length; - if (l) return t[2]; - } - l = t[1]; - if (0 > l) return 0; - } - }; - this.s = function (k, l, h) { - var c = h.length - (l - k); - this.j = this.j.slice(0, k) + h + this.j.slice(l); - this.a += c; - this.cursor >= l ? (this.cursor += c) : this.cursor > k && (this.cursor = k); - return c; - }; - this.t = function () { - return 0 > this.c || this.c > this.d || this.d > this.a || this.a > this.j.length ? p : g; - }; - this.b = function (k) { - var l = p; - this.t() && (this.s(this.c, this.d, k), (l = g)); - return l; - }; - this.e = function () { - return this.b(""); - }; - this.r = function (k, l, h) { - l = this.s(k, l, h); - k <= this.c && (this.c += l); - k <= this.d && (this.d += l); - }; - this.u = function () { - var k = ""; - this.t() && (k = this.j.slice(this.c, this.d)); - return k; - }; - this.v = function () { - return this.j.slice(0, this.a); - }; -} - -function stem() { - function k() { - a.d = a.cursor; - if (0 == a.h(v)) return p; - a.c = a.cursor; - if (!a.e()) return p; - s -= 1; - return g; - } - function l() { - return !a.i(q, 97, 117) ? p : g; - } - function h() { - var c; - a.c = a.cursor; - c = a.o(b); - if (0 == c) return p; - a.d = a.cursor; - switch (c) { - case 1: - if (!a.e()) return p; - t = 1; - s -= 1; - break; - case 2: - if (!a.e()) return p; - t = 3; - s -= 1; - break; - case 3: - t = 1; - if (!a.b("s")) return p; - s -= 1; - break; - case 4: - t = 3; - if (!a.b("s")) return p; - s -= 1; - break; - case 5: - t = 1; - s -= 1; - a: { - c = a.cursor; - var d = a.cursor; - if (a.i(q, 97, 117)) { - a.cursor = d; - if (!a.b("p")) return p; - break a; - } - a.cursor = c; - if (!a.e()) return p; - } - break; - case 6: - t = 3; - s -= 1; - a: { - c = a.cursor; - d = a.cursor; - if (a.i(q, 97, 117)) { - a.cursor = d; - if (!a.b("p")) return p; - break a; - } - a.cursor = c; - if (!a.e()) return p; - } - } - return g; - } - function c() { - var b; - a.c = a.cursor; - b = a.o(f); - if (0 != b) - switch (((a.d = a.cursor), b)) { - case 1: - if (!a.e()) break; - t = 2; - s -= 1; - break; - case 2: - if (!a.b("ajar")) break; - s -= 1; - break; - case 3: - if (!a.e()) break; - t = 4; - s -= 1; - break; - case 4: - if (!a.b("ajar")) break; - t = 4; - s -= 1; - } - } - var a = new C(), - d = [ - ["kah", -1, 1], - ["lah", -1, 1], - ["pun", -1, 1], - ], - n = [ - ["nya", -1, 1], - ["ku", -1, 1], - ["mu", -1, 1], - ], - v = [ - [ - "i", - -1, - 1, - function () { - if (!(2 >= t)) return p; - var b = a.a - a.cursor; - if (a.g("s")) return p; - a.cursor = a.a - b; - return g; - }, - ], - [ - "an", - -1, - 1, - function () { - return 1 == t ? p : g; - }, - ], - [ - "kan", - 1, - 1, - function () { - return 3 == t || 2 == t ? p : g; - }, - ], - ], - b = [ - ["di", -1, 1], - ["ke", -1, 2], - ["me", -1, 1], - ["mem", 2, 5], - ["men", 2, 1], - ["meng", 4, 1], - ["meny", 4, 3, l], - ["pem", -1, 6], - ["pen", -1, 2], - ["peng", 8, 2], - ["peny", 8, 4, l], - ["ter", -1, 1], - ], - f = [ - [ - "be", - -1, - 3, - function () { - return !a.k(q, 97, 117) || !a.m("er") ? p : g; - }, - ], - ["belajar", 0, 4], - ["ber", 0, 3], - ["pe", -1, 1], - ["pelajar", 3, 2], - ["per", 3, 1], - ], - q = [17, 65, 16], - t = 0, - s = 0; - this.l = function () { - s = 0; - var b = a.cursor; - for (;;) { - var f = a.cursor; - b: { - c: for (;;) { - if (a.i(q, 97, 117)) break c; - if (a.cursor >= a.a) break b; - a.cursor++; - } - s += 1; - continue; - } - a.cursor = f; - break; - } - a.cursor = b; - if (!(2 < s)) return p; - t = 0; - a.f = a.cursor; - a.cursor = a.a; - b = a.a - a.cursor; - a.d = a.cursor; - 0 != a.h(d) && ((a.c = a.cursor), a.e() && (s -= 1)); - a.cursor = a.a - b; - if (!(2 < s)) return p; - b = a.a - a.cursor; - a.d = a.cursor; - 0 != a.h(n) && ((a.c = a.cursor), a.e() && (s -= 1)); - a.cursor = a.a - b; - a.cursor = a.f; - if (!(2 < s)) return p; - a: { - f = a.cursor; - b = a.cursor; - if (h()) { - f = a.cursor; - var l = a.cursor; - 2 < s && ((a.f = a.cursor), (a.cursor = a.a), k() && ((a.cursor = a.f), (a.cursor = l), 2 < s && c())); - a.cursor = f; - a.cursor = b; - break a; - } - a.cursor = f; - b = a.cursor; - c(); - a.cursor = b; - b = a.cursor; - 2 < s && ((a.f = a.cursor), (a.cursor = a.a), k() && (a.cursor = a.f)); - a.cursor = b; - } - return g; - }; - this.stemWord = function (b) { - a.p(b); - this.l(); - return a.j; - }; -} - -const stemmerInstance = new stem(); - -export function stemmer(word) { - return stemmerInstance.stemWord(word); -} diff --git a/stemmer/lib/ie.d.ts b/stemmer/lib/ie.d.ts deleted file mode 100644 index 838f68c..0000000 --- a/stemmer/lib/ie.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare function stemmer(word: string): string; diff --git a/stemmer/lib/ie.js b/stemmer/lib/ie.js deleted file mode 100644 index 3c58dcc..0000000 --- a/stemmer/lib/ie.js +++ /dev/null @@ -1,402 +0,0 @@ -/* - * ----------------------------------------------------------------------------- - * GENERATED FILE - DO NOT EDIT! - * This file has been compiled using the Snowball stemmer generator. - * Don't edit this file directly. - * ----------------------------------------------------------------------------- - */ - -var g = !0, - p = !1; - -function C() { - this.p = function (k) { - this.j = k; - this.cursor = 0; - this.a = this.j.length; - this.f = 0; - this.c = this.cursor; - this.d = this.a; - }; - this.z = function () { - return this.j; - }; - this.w = function (k) { - this.j = k.j; - this.cursor = k.cursor; - this.a = k.a; - this.f = k.f; - this.c = k.c; - this.d = k.d; - }; - this.i = function (k, l, h) { - if (this.cursor >= this.a) return p; - var c = this.j.charCodeAt(this.cursor); - if (c > h || c < l) return p; - c -= l; - if (0 == (k[c >>> 3] & (1 << (c & 7)))) return p; - this.cursor++; - return g; - }; - this.n = function (k, l, h) { - if (this.cursor <= this.f) return p; - var c = this.j.charCodeAt(this.cursor - 1); - if (c > h || c < l) return p; - c -= l; - if (0 == (k[c >>> 3] & (1 << (c & 7)))) return p; - this.cursor--; - return g; - }; - this.k = function (k, l, h) { - if (this.cursor >= this.a) return p; - var c = this.j.charCodeAt(this.cursor); - if (c > h || c < l) return this.cursor++, g; - c -= l; - return 0 == (k[c >>> 3] & (1 << (c & 7))) ? (this.cursor++, g) : p; - }; - this.q = function (k, l, h) { - if (this.cursor <= this.f) return p; - var c = this.j.charCodeAt(this.cursor - 1); - if (c > h || c < l) return this.cursor--, g; - c -= l; - return 0 == (k[c >>> 3] & (1 << (c & 7))) ? (this.cursor--, g) : p; - }; - this.m = function (k) { - if (this.a - this.cursor < k.length || this.j.slice(this.cursor, this.cursor + k.length) != k) return p; - this.cursor += k.length; - return g; - }; - this.g = function (k) { - if (this.cursor - this.f < k.length || this.j.slice(this.cursor - k.length, this.cursor) != k) return p; - this.cursor -= k.length; - return g; - }; - this.o = function (k) { - for (var l = 0, h = k.length, c = this.cursor, a = this.a, d = 0, n = 0, v = p; ; ) { - var b = l + ((h - l) >>> 1), - f = 0, - q = d < n ? d : n, - t = k[b], - s; - for (s = q; s < t[0].length; s++) { - if (c + q == a) { - f = -1; - break; - } - f = this.j.charCodeAt(c + q) - t[0].charCodeAt(s); - if (0 != f) break; - q++; - } - 0 > f ? ((h = b), (n = q)) : ((l = b), (d = q)); - if (1 >= h - l) { - if (0 < l) break; - if (h == l) break; - if (v) break; - v = g; - } - } - for (;;) { - t = k[l]; - if (d >= t[0].length) { - this.cursor = c + t[0].length; - if (4 > t.length) return t[2]; - l = t[3](this); - this.cursor = c + t[0].length; - if (l) return t[2]; - } - l = t[1]; - if (0 > l) return 0; - } - }; - this.h = function (k) { - for (var l = 0, h = k.length, c = this.cursor, a = this.f, d = 0, n = 0, v = p; ; ) { - var b = l + ((h - l) >> 1), - f = 0, - q = d < n ? d : n, - t = k[b], - s; - for (s = t[0].length - 1 - q; 0 <= s; s--) { - if (c - q == a) { - f = -1; - break; - } - f = this.j.charCodeAt(c - 1 - q) - t[0].charCodeAt(s); - if (0 != f) break; - q++; - } - 0 > f ? ((h = b), (n = q)) : ((l = b), (d = q)); - if (1 >= h - l) { - if (0 < l) break; - if (h == l) break; - if (v) break; - v = g; - } - } - for (;;) { - t = k[l]; - if (d >= t[0].length) { - this.cursor = c - t[0].length; - if (4 > t.length) return t[2]; - l = t[3](this); - this.cursor = c - t[0].length; - if (l) return t[2]; - } - l = t[1]; - if (0 > l) return 0; - } - }; - this.s = function (k, l, h) { - var c = h.length - (l - k); - this.j = this.j.slice(0, k) + h + this.j.slice(l); - this.a += c; - this.cursor >= l ? (this.cursor += c) : this.cursor > k && (this.cursor = k); - return c; - }; - this.t = function () { - return 0 > this.c || this.c > this.d || this.d > this.a || this.a > this.j.length ? p : g; - }; - this.b = function (k) { - var l = p; - this.t() && (this.s(this.c, this.d, k), (l = g)); - return l; - }; - this.e = function () { - return this.b(""); - }; - this.r = function (k, l, h) { - l = this.s(k, l, h); - k <= this.c && (this.c += l); - k <= this.d && (this.d += l); - }; - this.u = function () { - var k = ""; - this.t() && (k = this.j.slice(this.c, this.d)); - return k; - }; - this.v = function () { - return this.j.slice(0, this.a); - }; -} - -function stem() { - var k = new C(), - l = [ - ["b'", -1, 1], - ["bh", -1, 4], - ["bhf", 1, 2], - ["bp", -1, 8], - ["ch", -1, 5], - ["d'", -1, 1], - ["d'fh", 5, 2], - ["dh", -1, 6], - ["dt", -1, 9], - ["fh", -1, 2], - ["gc", -1, 5], - ["gh", -1, 7], - ["h-", -1, 1], - ["m'", -1, 1], - ["mb", -1, 4], - ["mh", -1, 10], - ["n-", -1, 1], - ["nd", -1, 6], - ["ng", -1, 7], - ["ph", -1, 8], - ["sh", -1, 3], - ["t-", -1, 1], - ["th", -1, 9], - ["ts", -1, 3], - ], - h = [ - ["\u00edochta", -1, 1], - ["a\u00edochta", 0, 1], - ["ire", -1, 2], - ["aire", 2, 2], - ["abh", -1, 1], - ["eabh", 4, 1], - ["ibh", -1, 1], - ["aibh", 6, 1], - ["amh", -1, 1], - ["eamh", 8, 1], - ["imh", -1, 1], - ["aimh", 10, 1], - ["\u00edocht", -1, 1], - ["a\u00edocht", 12, 1], - ["ir\u00ed", -1, 2], - ["air\u00ed", 14, 2], - ], - c = [ - ["\u00f3ideacha", -1, 6], - ["patacha", -1, 5], - ["achta", -1, 1], - ["arcachta", 2, 2], - ["eachta", 2, 1], - ["grafa\u00edochta", -1, 4], - ["paite", -1, 5], - ["ach", -1, 1], - ["each", 7, 1], - ["\u00f3ideach", 8, 6], - ["gineach", 8, 3], - ["patach", 7, 5], - ["grafa\u00edoch", -1, 4], - ["pataigh", -1, 5], - ["\u00f3idigh", -1, 6], - ["acht\u00fail", -1, 1], - ["eacht\u00fail", 15, 1], - ["gineas", -1, 3], - ["ginis", -1, 3], - ["acht", -1, 1], - ["arcacht", 19, 2], - ["eacht", 19, 1], - ["grafa\u00edocht", -1, 4], - ["arcachta\u00ed", -1, 2], - ["grafa\u00edochta\u00ed", -1, 4], - ], - a = [ - ["imid", -1, 1], - ["aimid", 0, 1], - ["\u00edmid", -1, 1], - ["a\u00edmid", 2, 1], - ["adh", -1, 2], - ["eadh", 4, 2], - ["faidh", -1, 1], - ["fidh", -1, 1], - ["\u00e1il", -1, 2], - ["ain", -1, 2], - ["tear", -1, 2], - ["tar", -1, 2], - ], - d = [17, 65, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 17, 4, 2], - n = 0, - v = 0, - b = 0; - this.l = function () { - var f = k.cursor, - q; - k.c = k.cursor; - q = k.o(l); - if (0 != q) - switch (((k.d = k.cursor), q)) { - case 1: - if (!k.e()) break; - break; - case 2: - if (!k.b("f")) break; - break; - case 3: - if (!k.b("s")) break; - break; - case 4: - if (!k.b("b")) break; - break; - case 5: - if (!k.b("c")) break; - break; - case 6: - if (!k.b("d")) break; - break; - case 7: - if (!k.b("g")) break; - break; - case 8: - if (!k.b("p")) break; - break; - case 9: - if (!k.b("t")) break; - break; - case 10: - k.b("m"); - } - k.cursor = f; - n = v = b = k.a; - f = k.cursor; - a: { - b: for (;;) { - if (k.i(d, 97, 250)) break b; - if (k.cursor >= k.a) break a; - k.cursor++; - } - b = k.cursor; - b: for (;;) { - if (k.k(d, 97, 250)) break b; - if (k.cursor >= k.a) break a; - k.cursor++; - } - v = k.cursor; - b: for (;;) { - if (k.i(d, 97, 250)) break b; - if (k.cursor >= k.a) break a; - k.cursor++; - } - b: for (;;) { - if (k.k(d, 97, 250)) break b; - if (k.cursor >= k.a) break a; - k.cursor++; - } - n = k.cursor; - } - k.cursor = f; - k.f = k.cursor; - k.cursor = k.a; - f = k.a - k.cursor; - k.d = k.cursor; - q = k.h(h); - if (0 != q) - switch (((k.c = k.cursor), q)) { - case 1: - if (!(v <= k.cursor) || !k.e()) break; - break; - case 2: - !(n <= k.cursor) || k.e(); - } - k.cursor = k.a - f; - f = k.a - k.cursor; - k.d = k.cursor; - q = k.h(c); - if (0 != q) - switch (((k.c = k.cursor), q)) { - case 1: - if (!(n <= k.cursor) || !k.e()) break; - break; - case 2: - if (!k.b("arc")) break; - break; - case 3: - if (!k.b("gin")) break; - break; - case 4: - if (!k.b("graf")) break; - break; - case 5: - if (!k.b("paite")) break; - break; - case 6: - k.b("\u00f3id"); - } - k.cursor = k.a - f; - f = k.a - k.cursor; - k.d = k.cursor; - q = k.h(a); - if (0 != q) - switch (((k.c = k.cursor), q)) { - case 1: - if (!(b <= k.cursor) || !k.e()) break; - break; - case 2: - !(v <= k.cursor) || k.e(); - } - k.cursor = k.a - f; - k.cursor = k.f; - return g; - }; - this.stemWord = function (a) { - k.p(a); - this.l(); - return k.j; - }; -} - -const stemmerInstance = new stem(); - -export function stemmer(word) { - return stemmerInstance.stemWord(word); -} diff --git a/stemmer/lib/in.d.ts b/stemmer/lib/in.d.ts deleted file mode 100644 index 838f68c..0000000 --- a/stemmer/lib/in.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare function stemmer(word: string): string; diff --git a/stemmer/lib/in.js b/stemmer/lib/in.js deleted file mode 100644 index b48a23c..0000000 --- a/stemmer/lib/in.js +++ /dev/null @@ -1,344 +0,0 @@ -/* - * ----------------------------------------------------------------------------- - * GENERATED FILE - DO NOT EDIT! - * This file has been compiled using the Snowball stemmer generator. - * Don't edit this file directly. - * ----------------------------------------------------------------------------- - */ - -var g = !0, - p = !1; - -function C() { - this.p = function (k) { - this.j = k; - this.cursor = 0; - this.a = this.j.length; - this.f = 0; - this.c = this.cursor; - this.d = this.a; - }; - this.z = function () { - return this.j; - }; - this.w = function (k) { - this.j = k.j; - this.cursor = k.cursor; - this.a = k.a; - this.f = k.f; - this.c = k.c; - this.d = k.d; - }; - this.i = function (k, l, h) { - if (this.cursor >= this.a) return p; - var c = this.j.charCodeAt(this.cursor); - if (c > h || c < l) return p; - c -= l; - if (0 == (k[c >>> 3] & (1 << (c & 7)))) return p; - this.cursor++; - return g; - }; - this.n = function (k, l, h) { - if (this.cursor <= this.f) return p; - var c = this.j.charCodeAt(this.cursor - 1); - if (c > h || c < l) return p; - c -= l; - if (0 == (k[c >>> 3] & (1 << (c & 7)))) return p; - this.cursor--; - return g; - }; - this.k = function (k, l, h) { - if (this.cursor >= this.a) return p; - var c = this.j.charCodeAt(this.cursor); - if (c > h || c < l) return this.cursor++, g; - c -= l; - return 0 == (k[c >>> 3] & (1 << (c & 7))) ? (this.cursor++, g) : p; - }; - this.q = function (k, l, h) { - if (this.cursor <= this.f) return p; - var c = this.j.charCodeAt(this.cursor - 1); - if (c > h || c < l) return this.cursor--, g; - c -= l; - return 0 == (k[c >>> 3] & (1 << (c & 7))) ? (this.cursor--, g) : p; - }; - this.m = function (k) { - if (this.a - this.cursor < k.length || this.j.slice(this.cursor, this.cursor + k.length) != k) return p; - this.cursor += k.length; - return g; - }; - this.g = function (k) { - if (this.cursor - this.f < k.length || this.j.slice(this.cursor - k.length, this.cursor) != k) return p; - this.cursor -= k.length; - return g; - }; - this.o = function (k) { - for (var l = 0, h = k.length, c = this.cursor, a = this.a, d = 0, n = 0, v = p; ; ) { - var b = l + ((h - l) >>> 1), - f = 0, - q = d < n ? d : n, - t = k[b], - s; - for (s = q; s < t[0].length; s++) { - if (c + q == a) { - f = -1; - break; - } - f = this.j.charCodeAt(c + q) - t[0].charCodeAt(s); - if (0 != f) break; - q++; - } - 0 > f ? ((h = b), (n = q)) : ((l = b), (d = q)); - if (1 >= h - l) { - if (0 < l) break; - if (h == l) break; - if (v) break; - v = g; - } - } - for (;;) { - t = k[l]; - if (d >= t[0].length) { - this.cursor = c + t[0].length; - if (4 > t.length) return t[2]; - l = t[3](this); - this.cursor = c + t[0].length; - if (l) return t[2]; - } - l = t[1]; - if (0 > l) return 0; - } - }; - this.h = function (k) { - for (var l = 0, h = k.length, c = this.cursor, a = this.f, d = 0, n = 0, v = p; ; ) { - var b = l + ((h - l) >> 1), - f = 0, - q = d < n ? d : n, - t = k[b], - s; - for (s = t[0].length - 1 - q; 0 <= s; s--) { - if (c - q == a) { - f = -1; - break; - } - f = this.j.charCodeAt(c - 1 - q) - t[0].charCodeAt(s); - if (0 != f) break; - q++; - } - 0 > f ? ((h = b), (n = q)) : ((l = b), (d = q)); - if (1 >= h - l) { - if (0 < l) break; - if (h == l) break; - if (v) break; - v = g; - } - } - for (;;) { - t = k[l]; - if (d >= t[0].length) { - this.cursor = c - t[0].length; - if (4 > t.length) return t[2]; - l = t[3](this); - this.cursor = c - t[0].length; - if (l) return t[2]; - } - l = t[1]; - if (0 > l) return 0; - } - }; - this.s = function (k, l, h) { - var c = h.length - (l - k); - this.j = this.j.slice(0, k) + h + this.j.slice(l); - this.a += c; - this.cursor >= l ? (this.cursor += c) : this.cursor > k && (this.cursor = k); - return c; - }; - this.t = function () { - return 0 > this.c || this.c > this.d || this.d > this.a || this.a > this.j.length ? p : g; - }; - this.b = function (k) { - var l = p; - this.t() && (this.s(this.c, this.d, k), (l = g)); - return l; - }; - this.e = function () { - return this.b(""); - }; - this.r = function (k, l, h) { - l = this.s(k, l, h); - k <= this.c && (this.c += l); - k <= this.d && (this.d += l); - }; - this.u = function () { - var k = ""; - this.t() && (k = this.j.slice(this.c, this.d)); - return k; - }; - this.v = function () { - return this.j.slice(0, this.a); - }; -} - -function stem() { - function k() { - return !l.n(c, 2325, 2399) ? p : g; - } - var l = new C(), - h = [ - ["\u0906\u0901", -1, -1], - ["\u093e\u0901", -1, -1], - ["\u0907\u092f\u093e\u0901", 1, -1], - ["\u0906\u0907\u092f\u093e\u0901", 2, -1], - ["\u093e\u0907\u092f\u093e\u0901", 2, -1], - ["\u093f\u092f\u093e\u0901", 1, -1], - ["\u0906\u0902", -1, -1], - ["\u0909\u0906\u0902", 6, -1], - ["\u0941\u0906\u0902", 6, -1], - ["\u0908\u0902", -1, -1], - ["\u0906\u0908\u0902", 9, -1], - ["\u093e\u0908\u0902", 9, -1], - ["\u090f\u0902", -1, -1], - ["\u0906\u090f\u0902", 12, -1], - ["\u0909\u090f\u0902", 12, -1], - ["\u093e\u090f\u0902", 12, -1], - ["\u0924\u093e\u090f\u0902", 15, -1, k], - ["\u0905\u0924\u093e\u090f\u0902", 16, -1], - ["\u0928\u093e\u090f\u0902", 15, -1, k], - ["\u0905\u0928\u093e\u090f\u0902", 18, -1], - ["\u0941\u090f\u0902", 12, -1], - ["\u0913\u0902", -1, -1], - ["\u0906\u0913\u0902", 21, -1], - ["\u0909\u0913\u0902", 21, -1], - ["\u093e\u0913\u0902", 21, -1], - ["\u0924\u093e\u0913\u0902", 24, -1, k], - ["\u0905\u0924\u093e\u0913\u0902", 25, -1], - ["\u0928\u093e\u0913\u0902", 24, -1, k], - ["\u0905\u0928\u093e\u0913\u0902", 27, -1], - ["\u0941\u0913\u0902", 21, -1], - ["\u093e\u0902", -1, -1], - ["\u0907\u092f\u093e\u0902", 30, -1], - ["\u0906\u0907\u092f\u093e\u0902", 31, -1], - ["\u093e\u0907\u092f\u093e\u0902", 31, -1], - ["\u093f\u092f\u093e\u0902", 30, -1], - ["\u0940\u0902", -1, -1], - ["\u0924\u0940\u0902", 35, -1, k], - ["\u0905\u0924\u0940\u0902", 36, -1], - ["\u0906\u0924\u0940\u0902", 36, -1], - ["\u093e\u0924\u0940\u0902", 36, -1], - ["\u0947\u0902", -1, -1], - ["\u094b\u0902", -1, -1], - ["\u0907\u092f\u094b\u0902", 41, -1], - ["\u0906\u0907\u092f\u094b\u0902", 42, -1], - ["\u093e\u0907\u092f\u094b\u0902", 42, -1], - ["\u093f\u092f\u094b\u0902", 41, -1], - ["\u0905", -1, -1], - ["\u0906", -1, -1], - ["\u0907", -1, -1], - ["\u0908", -1, -1], - ["\u0906\u0908", 49, -1], - ["\u093e\u0908", 49, -1], - ["\u0909", -1, -1], - ["\u090a", -1, -1], - ["\u090f", -1, -1], - ["\u0906\u090f", 54, -1], - ["\u0907\u090f", 54, -1], - ["\u0906\u0907\u090f", 56, -1], - ["\u093e\u0907\u090f", 56, -1], - ["\u093e\u090f", 54, -1], - ["\u093f\u090f", 54, -1], - ["\u0913", -1, -1], - ["\u0906\u0913", 61, -1], - ["\u093e\u0913", 61, -1], - ["\u0915\u0930", -1, -1, k], - ["\u0905\u0915\u0930", 64, -1], - ["\u0906\u0915\u0930", 64, -1], - ["\u093e\u0915\u0930", 64, -1], - ["\u093e", -1, -1], - ["\u090a\u0902\u0917\u093e", 68, -1], - ["\u0906\u090a\u0902\u0917\u093e", 69, -1], - ["\u093e\u090a\u0902\u0917\u093e", 69, -1], - ["\u0942\u0902\u0917\u093e", 68, -1], - ["\u090f\u0917\u093e", 68, -1], - ["\u0906\u090f\u0917\u093e", 73, -1], - ["\u093e\u090f\u0917\u093e", 73, -1], - ["\u0947\u0917\u093e", 68, -1], - ["\u0924\u093e", 68, -1, k], - ["\u0905\u0924\u093e", 77, -1], - ["\u0906\u0924\u093e", 77, -1], - ["\u093e\u0924\u093e", 77, -1], - ["\u0928\u093e", 68, -1, k], - ["\u0905\u0928\u093e", 81, -1], - ["\u0906\u0928\u093e", 81, -1], - ["\u093e\u0928\u093e", 81, -1], - ["\u0906\u092f\u093e", 68, -1], - ["\u093e\u092f\u093e", 68, -1], - ["\u093f", -1, -1], - ["\u0940", -1, -1], - ["\u090a\u0902\u0917\u0940", 88, -1], - ["\u0906\u090a\u0902\u0917\u0940", 89, -1], - ["\u093e\u090a\u0902\u0917\u0940", 89, -1], - ["\u090f\u0902\u0917\u0940", 88, -1], - ["\u0906\u090f\u0902\u0917\u0940", 92, -1], - ["\u093e\u090f\u0902\u0917\u0940", 92, -1], - ["\u0942\u0902\u0917\u0940", 88, -1], - ["\u0947\u0902\u0917\u0940", 88, -1], - ["\u090f\u0917\u0940", 88, -1], - ["\u0906\u090f\u0917\u0940", 97, -1], - ["\u093e\u090f\u0917\u0940", 97, -1], - ["\u0913\u0917\u0940", 88, -1], - ["\u0906\u0913\u0917\u0940", 100, -1], - ["\u093e\u0913\u0917\u0940", 100, -1], - ["\u0947\u0917\u0940", 88, -1], - ["\u094b\u0917\u0940", 88, -1], - ["\u0924\u0940", 88, -1, k], - ["\u0905\u0924\u0940", 105, -1], - ["\u0906\u0924\u0940", 105, -1], - ["\u093e\u0924\u0940", 105, -1], - ["\u0928\u0940", 88, -1, k], - ["\u0905\u0928\u0940", 109, -1], - ["\u0941", -1, -1], - ["\u0942", -1, -1], - ["\u0947", -1, -1], - ["\u090f\u0902\u0917\u0947", 113, -1], - ["\u0906\u090f\u0902\u0917\u0947", 114, -1], - ["\u093e\u090f\u0902\u0917\u0947", 114, -1], - ["\u0947\u0902\u0917\u0947", 113, -1], - ["\u0913\u0917\u0947", 113, -1], - ["\u0906\u0913\u0917\u0947", 118, -1], - ["\u093e\u0913\u0917\u0947", 118, -1], - ["\u094b\u0917\u0947", 113, -1], - ["\u0924\u0947", 113, -1, k], - ["\u0905\u0924\u0947", 122, -1], - ["\u0906\u0924\u0947", 122, -1], - ["\u093e\u0924\u0947", 122, -1], - ["\u0928\u0947", 113, -1, k], - ["\u0905\u0928\u0947", 126, -1], - ["\u0906\u0928\u0947", 126, -1], - ["\u093e\u0928\u0947", 126, -1], - ["\u094b", -1, -1], - ["\u094d", -1, -1], - ], - c = [255, 255, 255, 255, 159, 0, 0, 0, 248, 7]; - this.l = function () { - if (l.cursor >= l.a) return p; - l.cursor++; - l.f = l.cursor; - l.cursor = l.a; - l.d = l.cursor; - if (0 == l.h(h)) return p; - l.c = l.cursor; - if (!l.e()) return p; - l.cursor = l.f; - return g; - }; - this.stemWord = function (a) { - l.p(a); - this.l(); - return l.j; - }; -} - -const stemmerInstance = new stem(); - -export function stemmer(word) { - return stemmerInstance.stemWord(word); -} diff --git a/stemmer/lib/it.d.ts b/stemmer/lib/it.d.ts deleted file mode 100644 index 838f68c..0000000 --- a/stemmer/lib/it.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare function stemmer(word: string): string; diff --git a/stemmer/lib/it.js b/stemmer/lib/it.js deleted file mode 100644 index 7f378fc..0000000 --- a/stemmer/lib/it.js +++ /dev/null @@ -1,711 +0,0 @@ -/* - * ----------------------------------------------------------------------------- - * GENERATED FILE - DO NOT EDIT! - * This file has been compiled using the Snowball stemmer generator. - * Don't edit this file directly. - * ----------------------------------------------------------------------------- - */ - -var g = !0, - p = !1; - -function C() { - this.p = function (k) { - this.j = k; - this.cursor = 0; - this.a = this.j.length; - this.f = 0; - this.c = this.cursor; - this.d = this.a; - }; - this.z = function () { - return this.j; - }; - this.w = function (k) { - this.j = k.j; - this.cursor = k.cursor; - this.a = k.a; - this.f = k.f; - this.c = k.c; - this.d = k.d; - }; - this.i = function (k, l, h) { - if (this.cursor >= this.a) return p; - var c = this.j.charCodeAt(this.cursor); - if (c > h || c < l) return p; - c -= l; - if (0 == (k[c >>> 3] & (1 << (c & 7)))) return p; - this.cursor++; - return g; - }; - this.n = function (k, l, h) { - if (this.cursor <= this.f) return p; - var c = this.j.charCodeAt(this.cursor - 1); - if (c > h || c < l) return p; - c -= l; - if (0 == (k[c >>> 3] & (1 << (c & 7)))) return p; - this.cursor--; - return g; - }; - this.k = function (k, l, h) { - if (this.cursor >= this.a) return p; - var c = this.j.charCodeAt(this.cursor); - if (c > h || c < l) return this.cursor++, g; - c -= l; - return 0 == (k[c >>> 3] & (1 << (c & 7))) ? (this.cursor++, g) : p; - }; - this.q = function (k, l, h) { - if (this.cursor <= this.f) return p; - var c = this.j.charCodeAt(this.cursor - 1); - if (c > h || c < l) return this.cursor--, g; - c -= l; - return 0 == (k[c >>> 3] & (1 << (c & 7))) ? (this.cursor--, g) : p; - }; - this.m = function (k) { - if (this.a - this.cursor < k.length || this.j.slice(this.cursor, this.cursor + k.length) != k) return p; - this.cursor += k.length; - return g; - }; - this.g = function (k) { - if (this.cursor - this.f < k.length || this.j.slice(this.cursor - k.length, this.cursor) != k) return p; - this.cursor -= k.length; - return g; - }; - this.o = function (k) { - for (var l = 0, h = k.length, c = this.cursor, a = this.a, d = 0, n = 0, v = p; ; ) { - var b = l + ((h - l) >>> 1), - f = 0, - q = d < n ? d : n, - t = k[b], - s; - for (s = q; s < t[0].length; s++) { - if (c + q == a) { - f = -1; - break; - } - f = this.j.charCodeAt(c + q) - t[0].charCodeAt(s); - if (0 != f) break; - q++; - } - 0 > f ? ((h = b), (n = q)) : ((l = b), (d = q)); - if (1 >= h - l) { - if (0 < l) break; - if (h == l) break; - if (v) break; - v = g; - } - } - for (;;) { - t = k[l]; - if (d >= t[0].length) { - this.cursor = c + t[0].length; - if (4 > t.length) return t[2]; - l = t[3](this); - this.cursor = c + t[0].length; - if (l) return t[2]; - } - l = t[1]; - if (0 > l) return 0; - } - }; - this.h = function (k) { - for (var l = 0, h = k.length, c = this.cursor, a = this.f, d = 0, n = 0, v = p; ; ) { - var b = l + ((h - l) >> 1), - f = 0, - q = d < n ? d : n, - t = k[b], - s; - for (s = t[0].length - 1 - q; 0 <= s; s--) { - if (c - q == a) { - f = -1; - break; - } - f = this.j.charCodeAt(c - 1 - q) - t[0].charCodeAt(s); - if (0 != f) break; - q++; - } - 0 > f ? ((h = b), (n = q)) : ((l = b), (d = q)); - if (1 >= h - l) { - if (0 < l) break; - if (h == l) break; - if (v) break; - v = g; - } - } - for (;;) { - t = k[l]; - if (d >= t[0].length) { - this.cursor = c - t[0].length; - if (4 > t.length) return t[2]; - l = t[3](this); - this.cursor = c - t[0].length; - if (l) return t[2]; - } - l = t[1]; - if (0 > l) return 0; - } - }; - this.s = function (k, l, h) { - var c = h.length - (l - k); - this.j = this.j.slice(0, k) + h + this.j.slice(l); - this.a += c; - this.cursor >= l ? (this.cursor += c) : this.cursor > k && (this.cursor = k); - return c; - }; - this.t = function () { - return 0 > this.c || this.c > this.d || this.d > this.a || this.a > this.j.length ? p : g; - }; - this.b = function (k) { - var l = p; - this.t() && (this.s(this.c, this.d, k), (l = g)); - return l; - }; - this.e = function () { - return this.b(""); - }; - this.r = function (k, l, h) { - l = this.s(k, l, h); - k <= this.c && (this.c += l); - k <= this.d && (this.d += l); - }; - this.u = function () { - var k = ""; - this.t() && (k = this.j.slice(this.c, this.d)); - return k; - }; - this.v = function () { - return this.j.slice(0, this.a); - }; -} - -function stem() { - function k() { - for (var b, c = a.cursor; ; ) { - var f = a.cursor; - a: if (((a.c = a.cursor), (b = a.o(d)), 0 != b)) { - a.d = a.cursor; - switch (b) { - case 1: - if (!a.b("\u00e0")) return; - break; - case 2: - if (!a.b("\u00e8")) return; - break; - case 3: - if (!a.b("\u00ec")) return; - break; - case 4: - if (!a.b("\u00f2")) return; - break; - case 5: - if (!a.b("\u00f9")) return; - break; - case 6: - if (!a.b("qU")) return; - break; - case 7: - if (a.cursor >= a.a) break a; - a.cursor++; - } - continue; - } - a.cursor = f; - break; - } - for (a.cursor = c; ; ) { - b = a.cursor; - a: { - b: for (;;) { - c = a.cursor; - c: if (a.i(r, 97, 249)) { - a.c = a.cursor; - d: { - f = a.cursor; - if (a.m("u") && ((a.d = a.cursor), a.i(r, 97, 249))) { - if (!a.b("U")) return; - break d; - } - a.cursor = f; - if (!a.m("i")) break c; - a.d = a.cursor; - if (!a.i(r, 97, 249)) break c; - if (!a.b("I")) return; - } - a.cursor = c; - break b; - } - a.cursor = c; - if (a.cursor >= a.a) break a; - a.cursor++; - } - continue; - } - a.cursor = b; - break; - } - } - function l() { - return !(z <= a.cursor) ? p : g; - } - function h() { - return !(u <= a.cursor) ? p : g; - } - function c() { - var b; - a.d = a.cursor; - b = a.h(t); - if (0 == b) return p; - a.c = a.cursor; - switch (b) { - case 1: - if (!h() || !a.e()) return p; - break; - case 2: - if (!h() || !a.e()) return p; - b = a.a - a.cursor; - a.d = a.cursor; - if (a.g("ic")) - if (((a.c = a.cursor), h())) { - if (!a.e()) return p; - } else a.cursor = a.a - b; - else a.cursor = a.a - b; - break; - case 3: - if (!h() || !a.b("log")) return p; - break; - case 4: - if (!h() || !a.b("u")) return p; - break; - case 5: - if (!h() || !a.b("ente")) return p; - break; - case 6: - if (!l() || !a.e()) return p; - break; - case 7: - if (!(y <= a.cursor) || !a.e()) return p; - var c = a.a - a.cursor; - a: if (((a.d = a.cursor), (b = a.h(f)), 0 == b)) a.cursor = a.a - c; - else if (((a.c = a.cursor), h())) { - if (!a.e()) return p; - switch (b) { - case 1: - a.d = a.cursor; - if (!a.g("at")) { - a.cursor = a.a - c; - break a; - } - a.c = a.cursor; - if (!h()) { - a.cursor = a.a - c; - break a; - } - if (!a.e()) return p; - } - } else a.cursor = a.a - c; - break; - case 8: - if (!h() || !a.e()) return p; - b = a.a - a.cursor; - a.d = a.cursor; - if (0 == a.h(q)) a.cursor = a.a - b; - else if (((a.c = a.cursor), h())) { - if (!a.e()) return p; - } else a.cursor = a.a - b; - break; - case 9: - if (!h() || !a.e()) return p; - b = a.a - a.cursor; - a.d = a.cursor; - if (a.g("at")) - if (((a.c = a.cursor), h())) { - if (!a.e()) return p; - a.d = a.cursor; - if (a.g("ic")) - if (((a.c = a.cursor), h())) { - if (!a.e()) return p; - } else a.cursor = a.a - b; - else a.cursor = a.a - b; - } else a.cursor = a.a - b; - else a.cursor = a.a - b; - } - return g; - } - var a = new C(), - d = [ - ["", -1, 7], - ["qu", 0, 6], - ["\u00e1", 0, 1], - ["\u00e9", 0, 2], - ["\u00ed", 0, 3], - ["\u00f3", 0, 4], - ["\u00fa", 0, 5], - ], - n = [ - ["", -1, 3], - ["I", 0, 1], - ["U", 0, 2], - ], - v = [ - ["la", -1, -1], - ["cela", 0, -1], - ["gliela", 0, -1], - ["mela", 0, -1], - ["tela", 0, -1], - ["vela", 0, -1], - ["le", -1, -1], - ["cele", 6, -1], - ["gliele", 6, -1], - ["mele", 6, -1], - ["tele", 6, -1], - ["vele", 6, -1], - ["ne", -1, -1], - ["cene", 12, -1], - ["gliene", 12, -1], - ["mene", 12, -1], - ["sene", 12, -1], - ["tene", 12, -1], - ["vene", 12, -1], - ["ci", -1, -1], - ["li", -1, -1], - ["celi", 20, -1], - ["glieli", 20, -1], - ["meli", 20, -1], - ["teli", 20, -1], - ["veli", 20, -1], - ["gli", 20, -1], - ["mi", -1, -1], - ["si", -1, -1], - ["ti", -1, -1], - ["vi", -1, -1], - ["lo", -1, -1], - ["celo", 31, -1], - ["glielo", 31, -1], - ["melo", 31, -1], - ["telo", 31, -1], - ["velo", 31, -1], - ], - b = [ - ["ando", -1, 1], - ["endo", -1, 1], - ["ar", -1, 2], - ["er", -1, 2], - ["ir", -1, 2], - ], - f = [ - ["ic", -1, -1], - ["abil", -1, -1], - ["os", -1, -1], - ["iv", -1, 1], - ], - q = [ - ["ic", -1, 1], - ["abil", -1, 1], - ["iv", -1, 1], - ], - t = [ - ["ica", -1, 1], - ["logia", -1, 3], - ["osa", -1, 1], - ["ista", -1, 1], - ["iva", -1, 9], - ["anza", -1, 1], - ["enza", -1, 5], - ["ice", -1, 1], - ["atrice", 7, 1], - ["iche", -1, 1], - ["logie", -1, 3], - ["abile", -1, 1], - ["ibile", -1, 1], - ["usione", -1, 4], - ["azione", -1, 2], - ["uzione", -1, 4], - ["atore", -1, 2], - ["ose", -1, 1], - ["ante", -1, 1], - ["mente", -1, 1], - ["amente", 19, 7], - ["iste", -1, 1], - ["ive", -1, 9], - ["anze", -1, 1], - ["enze", -1, 5], - ["ici", -1, 1], - ["atrici", 25, 1], - ["ichi", -1, 1], - ["abili", -1, 1], - ["ibili", -1, 1], - ["ismi", -1, 1], - ["usioni", -1, 4], - ["azioni", -1, 2], - ["uzioni", -1, 4], - ["atori", -1, 2], - ["osi", -1, 1], - ["anti", -1, 1], - ["amenti", -1, 6], - ["imenti", -1, 6], - ["isti", -1, 1], - ["ivi", -1, 9], - ["ico", -1, 1], - ["ismo", -1, 1], - ["oso", -1, 1], - ["amento", -1, 6], - ["imento", -1, 6], - ["ivo", -1, 9], - ["it\u00e0", -1, 8], - ["ist\u00e0", -1, 1], - ["ist\u00e8", -1, 1], - ["ist\u00ec", -1, 1], - ], - s = [ - ["isca", -1, 1], - ["enda", -1, 1], - ["ata", -1, 1], - ["ita", -1, 1], - ["uta", -1, 1], - ["ava", -1, 1], - ["eva", -1, 1], - ["iva", -1, 1], - ["erebbe", -1, 1], - ["irebbe", -1, 1], - ["isce", -1, 1], - ["ende", -1, 1], - ["are", -1, 1], - ["ere", -1, 1], - ["ire", -1, 1], - ["asse", -1, 1], - ["ate", -1, 1], - ["avate", 16, 1], - ["evate", 16, 1], - ["ivate", 16, 1], - ["ete", -1, 1], - ["erete", 20, 1], - ["irete", 20, 1], - ["ite", -1, 1], - ["ereste", -1, 1], - ["ireste", -1, 1], - ["ute", -1, 1], - ["erai", -1, 1], - ["irai", -1, 1], - ["isci", -1, 1], - ["endi", -1, 1], - ["erei", -1, 1], - ["irei", -1, 1], - ["assi", -1, 1], - ["ati", -1, 1], - ["iti", -1, 1], - ["eresti", -1, 1], - ["iresti", -1, 1], - ["uti", -1, 1], - ["avi", -1, 1], - ["evi", -1, 1], - ["ivi", -1, 1], - ["isco", -1, 1], - ["ando", -1, 1], - ["endo", -1, 1], - ["Yamo", -1, 1], - ["iamo", -1, 1], - ["avamo", -1, 1], - ["evamo", -1, 1], - ["ivamo", -1, 1], - ["eremo", -1, 1], - ["iremo", -1, 1], - ["assimo", -1, 1], - ["ammo", -1, 1], - ["emmo", -1, 1], - ["eremmo", 54, 1], - ["iremmo", 54, 1], - ["immo", -1, 1], - ["ano", -1, 1], - ["iscano", 58, 1], - ["avano", 58, 1], - ["evano", 58, 1], - ["ivano", 58, 1], - ["eranno", -1, 1], - ["iranno", -1, 1], - ["ono", -1, 1], - ["iscono", 65, 1], - ["arono", 65, 1], - ["erono", 65, 1], - ["irono", 65, 1], - ["erebbero", -1, 1], - ["irebbero", -1, 1], - ["assero", -1, 1], - ["essero", -1, 1], - ["issero", -1, 1], - ["ato", -1, 1], - ["ito", -1, 1], - ["uto", -1, 1], - ["avo", -1, 1], - ["evo", -1, 1], - ["ivo", -1, 1], - ["ar", -1, 1], - ["ir", -1, 1], - ["er\u00e0", -1, 1], - ["ir\u00e0", -1, 1], - ["er\u00f2", -1, 1], - ["ir\u00f2", -1, 1], - ], - r = [17, 65, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128, 128, 8, 2, 1], - m = [17, 65, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128, 128, 8, 2], - w = [17], - u = 0, - y = 0, - z = 0; - this.l = function () { - var e = a.cursor; - k(); - a.cursor = e; - u = y = z = a.a; - e = a.cursor; - a: { - b: { - var d = a.cursor; - c: if (a.i(r, 97, 249)) { - d: { - var f = a.cursor; - e: if (a.k(r, 97, 249)) { - f: for (;;) { - if (a.i(r, 97, 249)) break f; - if (a.cursor >= a.a) break e; - a.cursor++; - } - break d; - } - a.cursor = f; - if (!a.i(r, 97, 249)) break c; - e: for (;;) { - if (a.k(r, 97, 249)) break e; - if (a.cursor >= a.a) break c; - a.cursor++; - } - } - break b; - } - a.cursor = d; - if (!a.k(r, 97, 249)) break a; - c: { - d = a.cursor; - d: if (a.k(r, 97, 249)) { - e: for (;;) { - if (a.i(r, 97, 249)) break e; - if (a.cursor >= a.a) break d; - a.cursor++; - } - break c; - } - a.cursor = d; - if (!a.i(r, 97, 249)) break a; - if (a.cursor >= a.a) break a; - a.cursor++; - } - } - z = a.cursor; - } - a.cursor = e; - e = a.cursor; - a: { - b: for (;;) { - if (a.i(r, 97, 249)) break b; - if (a.cursor >= a.a) break a; - a.cursor++; - } - b: for (;;) { - if (a.k(r, 97, 249)) break b; - if (a.cursor >= a.a) break a; - a.cursor++; - } - y = a.cursor; - b: for (;;) { - if (a.i(r, 97, 249)) break b; - if (a.cursor >= a.a) break a; - a.cursor++; - } - b: for (;;) { - if (a.k(r, 97, 249)) break b; - if (a.cursor >= a.a) break a; - a.cursor++; - } - u = a.cursor; - } - a.cursor = e; - a.f = a.cursor; - a.cursor = a.a; - e = a.a - a.cursor; - a.d = a.cursor; - if (0 != a.h(v) && ((a.c = a.cursor), (d = a.h(b)), 0 != d && l())) - switch (d) { - case 1: - if (!a.e()) break; - break; - case 2: - a.b("e"); - } - a.cursor = a.a - e; - e = a.a - a.cursor; - b: { - d = a.a - a.cursor; - if (c()) break b; - a.cursor = a.a - d; - a.cursor < z || - ((d = a.f), (a.f = z), (a.d = a.cursor), 0 == a.h(s) ? (a.f = d) : ((a.c = a.cursor), a.e() && (a.f = d))); - } - a.cursor = a.a - e; - e = a.a - a.cursor; - a: { - d = a.a - a.cursor; - a.d = a.cursor; - if (a.n(m, 97, 242)) - if (((a.c = a.cursor), l())) { - if (!a.e()) break a; - a.d = a.cursor; - if (a.g("i")) - if (((a.c = a.cursor), l())) { - if (!a.e()) break a; - } else a.cursor = a.a - d; - else a.cursor = a.a - d; - } else a.cursor = a.a - d; - else a.cursor = a.a - d; - d = a.a - a.cursor; - a.d = a.cursor; - a.g("h") - ? ((a.c = a.cursor), a.n(w, 99, 103) ? (l() ? a.e() : (a.cursor = a.a - d)) : (a.cursor = a.a - d)) - : (a.cursor = a.a - d); - } - a.cursor = a.a - e; - a.cursor = a.f; - e = a.cursor; - a: for (;;) { - f = a.cursor; - b: if (((a.c = a.cursor), (d = a.o(n)), 0 != d)) { - a.d = a.cursor; - switch (d) { - case 1: - if (!a.b("i")) break a; - break; - case 2: - if (!a.b("u")) break a; - break; - case 3: - if (a.cursor >= a.a) break b; - a.cursor++; - } - continue; - } - a.cursor = f; - break; - } - a.cursor = e; - return g; - }; - this.stemWord = function (b) { - a.p(b); - this.l(); - return a.j; - }; -} - -const stemmerInstance = new stem(); - -export function stemmer(word) { - return stemmerInstance.stemWord(word); -} diff --git a/stemmer/lib/lt.d.ts b/stemmer/lib/lt.d.ts deleted file mode 100644 index 838f68c..0000000 --- a/stemmer/lib/lt.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare function stemmer(word: string): string; diff --git a/stemmer/lib/lt.js b/stemmer/lib/lt.js deleted file mode 100644 index e9f9e9a..0000000 --- a/stemmer/lib/lt.js +++ /dev/null @@ -1,586 +0,0 @@ -/* - * ----------------------------------------------------------------------------- - * GENERATED FILE - DO NOT EDIT! - * This file has been compiled using the Snowball stemmer generator. - * Don't edit this file directly. - * ----------------------------------------------------------------------------- - */ - -var g = !0, - p = !1; - -function C() { - this.p = function (k) { - this.j = k; - this.cursor = 0; - this.a = this.j.length; - this.f = 0; - this.c = this.cursor; - this.d = this.a; - }; - this.z = function () { - return this.j; - }; - this.w = function (k) { - this.j = k.j; - this.cursor = k.cursor; - this.a = k.a; - this.f = k.f; - this.c = k.c; - this.d = k.d; - }; - this.i = function (k, l, h) { - if (this.cursor >= this.a) return p; - var c = this.j.charCodeAt(this.cursor); - if (c > h || c < l) return p; - c -= l; - if (0 == (k[c >>> 3] & (1 << (c & 7)))) return p; - this.cursor++; - return g; - }; - this.n = function (k, l, h) { - if (this.cursor <= this.f) return p; - var c = this.j.charCodeAt(this.cursor - 1); - if (c > h || c < l) return p; - c -= l; - if (0 == (k[c >>> 3] & (1 << (c & 7)))) return p; - this.cursor--; - return g; - }; - this.k = function (k, l, h) { - if (this.cursor >= this.a) return p; - var c = this.j.charCodeAt(this.cursor); - if (c > h || c < l) return this.cursor++, g; - c -= l; - return 0 == (k[c >>> 3] & (1 << (c & 7))) ? (this.cursor++, g) : p; - }; - this.q = function (k, l, h) { - if (this.cursor <= this.f) return p; - var c = this.j.charCodeAt(this.cursor - 1); - if (c > h || c < l) return this.cursor--, g; - c -= l; - return 0 == (k[c >>> 3] & (1 << (c & 7))) ? (this.cursor--, g) : p; - }; - this.m = function (k) { - if (this.a - this.cursor < k.length || this.j.slice(this.cursor, this.cursor + k.length) != k) return p; - this.cursor += k.length; - return g; - }; - this.g = function (k) { - if (this.cursor - this.f < k.length || this.j.slice(this.cursor - k.length, this.cursor) != k) return p; - this.cursor -= k.length; - return g; - }; - this.o = function (k) { - for (var l = 0, h = k.length, c = this.cursor, a = this.a, d = 0, n = 0, v = p; ; ) { - var b = l + ((h - l) >>> 1), - f = 0, - q = d < n ? d : n, - t = k[b], - s; - for (s = q; s < t[0].length; s++) { - if (c + q == a) { - f = -1; - break; - } - f = this.j.charCodeAt(c + q) - t[0].charCodeAt(s); - if (0 != f) break; - q++; - } - 0 > f ? ((h = b), (n = q)) : ((l = b), (d = q)); - if (1 >= h - l) { - if (0 < l) break; - if (h == l) break; - if (v) break; - v = g; - } - } - for (;;) { - t = k[l]; - if (d >= t[0].length) { - this.cursor = c + t[0].length; - if (4 > t.length) return t[2]; - l = t[3](this); - this.cursor = c + t[0].length; - if (l) return t[2]; - } - l = t[1]; - if (0 > l) return 0; - } - }; - this.h = function (k) { - for (var l = 0, h = k.length, c = this.cursor, a = this.f, d = 0, n = 0, v = p; ; ) { - var b = l + ((h - l) >> 1), - f = 0, - q = d < n ? d : n, - t = k[b], - s; - for (s = t[0].length - 1 - q; 0 <= s; s--) { - if (c - q == a) { - f = -1; - break; - } - f = this.j.charCodeAt(c - 1 - q) - t[0].charCodeAt(s); - if (0 != f) break; - q++; - } - 0 > f ? ((h = b), (n = q)) : ((l = b), (d = q)); - if (1 >= h - l) { - if (0 < l) break; - if (h == l) break; - if (v) break; - v = g; - } - } - for (;;) { - t = k[l]; - if (d >= t[0].length) { - this.cursor = c - t[0].length; - if (4 > t.length) return t[2]; - l = t[3](this); - this.cursor = c - t[0].length; - if (l) return t[2]; - } - l = t[1]; - if (0 > l) return 0; - } - }; - this.s = function (k, l, h) { - var c = h.length - (l - k); - this.j = this.j.slice(0, k) + h + this.j.slice(l); - this.a += c; - this.cursor >= l ? (this.cursor += c) : this.cursor > k && (this.cursor = k); - return c; - }; - this.t = function () { - return 0 > this.c || this.c > this.d || this.d > this.a || this.a > this.j.length ? p : g; - }; - this.b = function (k) { - var l = p; - this.t() && (this.s(this.c, this.d, k), (l = g)); - return l; - }; - this.e = function () { - return this.b(""); - }; - this.r = function (k, l, h) { - l = this.s(k, l, h); - k <= this.c && (this.c += l); - k <= this.d && (this.d += l); - }; - this.u = function () { - var k = ""; - this.t() && (k = this.j.slice(this.c, this.d)); - return k; - }; - this.v = function () { - return this.j.slice(0, this.a); - }; -} - -function stem() { - function k() { - var a; - l.d = l.cursor; - a = l.h(d); - if (0 != a) - switch (((l.c = l.cursor), a)) { - case 1: - if (!l.b("t")) break; - break; - case 2: - l.b("d"); - } - } - var l = new C(), - h = [ - ["a", -1, -1], - ["ia", 0, -1], - ["eria", 1, -1], - ["osna", 0, -1], - ["iosna", 3, -1], - ["uosna", 3, -1], - ["iuosna", 5, -1], - ["ysna", 0, -1], - ["\u0117sna", 0, -1], - ["e", -1, -1], - ["ie", 9, -1], - ["enie", 10, -1], - ["erie", 10, -1], - ["oje", 9, -1], - ["ioje", 13, -1], - ["uje", 9, -1], - ["iuje", 15, -1], - ["yje", 9, -1], - ["enyje", 17, -1], - ["eryje", 17, -1], - ["\u0117je", 9, -1], - ["ame", 9, -1], - ["iame", 21, -1], - ["sime", 9, -1], - ["ome", 9, -1], - ["\u0117me", 9, -1], - ["tum\u0117me", 25, -1], - ["ose", 9, -1], - ["iose", 27, -1], - ["uose", 27, -1], - ["iuose", 29, -1], - ["yse", 9, -1], - ["enyse", 31, -1], - ["eryse", 31, -1], - ["\u0117se", 9, -1], - ["ate", 9, -1], - ["iate", 35, -1], - ["ite", 9, -1], - ["kite", 37, -1], - ["site", 37, -1], - ["ote", 9, -1], - ["tute", 9, -1], - ["\u0117te", 9, -1], - ["tum\u0117te", 42, -1], - ["i", -1, -1], - ["ai", 44, -1], - ["iai", 45, -1], - ["eriai", 46, -1], - ["ei", 44, -1], - ["tumei", 48, -1], - ["ki", 44, -1], - ["imi", 44, -1], - ["erimi", 51, -1], - ["umi", 44, -1], - ["iumi", 53, -1], - ["si", 44, -1], - ["asi", 55, -1], - ["iasi", 56, -1], - ["esi", 55, -1], - ["iesi", 58, -1], - ["siesi", 59, -1], - ["isi", 55, -1], - ["aisi", 61, -1], - ["eisi", 61, -1], - ["tumeisi", 63, -1], - ["uisi", 61, -1], - ["osi", 55, -1], - ["\u0117josi", 66, -1], - ["uosi", 66, -1], - ["iuosi", 68, -1], - ["siuosi", 69, -1], - ["usi", 55, -1], - ["ausi", 71, -1], - ["\u010diausi", 72, -1], - ["\u0105si", 55, -1], - ["\u0117si", 55, -1], - ["\u0173si", 55, -1], - ["t\u0173si", 76, -1], - ["ti", 44, -1], - ["enti", 78, -1], - ["inti", 78, -1], - ["oti", 78, -1], - ["ioti", 81, -1], - ["uoti", 81, -1], - ["iuoti", 83, -1], - ["auti", 78, -1], - ["iauti", 85, -1], - ["yti", 78, -1], - ["\u0117ti", 78, -1], - ["tel\u0117ti", 88, -1], - ["in\u0117ti", 88, -1], - ["ter\u0117ti", 88, -1], - ["ui", 44, -1], - ["iui", 92, -1], - ["eniui", 93, -1], - ["oj", -1, -1], - ["\u0117j", -1, -1], - ["k", -1, -1], - ["am", -1, -1], - ["iam", 98, -1], - ["iem", -1, -1], - ["im", -1, -1], - ["sim", 101, -1], - ["om", -1, -1], - ["tum", -1, -1], - ["\u0117m", -1, -1], - ["tum\u0117m", 105, -1], - ["an", -1, -1], - ["on", -1, -1], - ["ion", 108, -1], - ["un", -1, -1], - ["iun", 110, -1], - ["\u0117n", -1, -1], - ["o", -1, -1], - ["io", 113, -1], - ["enio", 114, -1], - ["\u0117jo", 113, -1], - ["uo", 113, -1], - ["s", -1, -1], - ["as", 118, -1], - ["ias", 119, -1], - ["es", 118, -1], - ["ies", 121, -1], - ["is", 118, -1], - ["ais", 123, -1], - ["iais", 124, -1], - ["tumeis", 123, -1], - ["imis", 123, -1], - ["enimis", 127, -1], - ["omis", 123, -1], - ["iomis", 129, -1], - ["umis", 123, -1], - ["\u0117mis", 123, -1], - ["enis", 123, -1], - ["asis", 123, -1], - ["ysis", 123, -1], - ["ams", 118, -1], - ["iams", 136, -1], - ["iems", 118, -1], - ["ims", 118, -1], - ["enims", 139, -1], - ["erims", 139, -1], - ["oms", 118, -1], - ["ioms", 142, -1], - ["ums", 118, -1], - ["\u0117ms", 118, -1], - ["ens", 118, -1], - ["os", 118, -1], - ["ios", 147, -1], - ["uos", 147, -1], - ["iuos", 149, -1], - ["ers", 118, -1], - ["us", 118, -1], - ["aus", 152, -1], - ["iaus", 153, -1], - ["ius", 152, -1], - ["ys", 118, -1], - ["enys", 156, -1], - ["erys", 156, -1], - ["\u0105s", 118, -1], - ["i\u0105s", 159, -1], - ["\u0117s", 118, -1], - ["am\u0117s", 161, -1], - ["iam\u0117s", 162, -1], - ["im\u0117s", 161, -1], - ["kim\u0117s", 164, -1], - ["sim\u0117s", 164, -1], - ["om\u0117s", 161, -1], - ["\u0117m\u0117s", 161, -1], - ["tum\u0117m\u0117s", 168, -1], - ["at\u0117s", 161, -1], - ["iat\u0117s", 170, -1], - ["sit\u0117s", 161, -1], - ["ot\u0117s", 161, -1], - ["\u0117t\u0117s", 161, -1], - ["tum\u0117t\u0117s", 174, -1], - ["\u012fs", 118, -1], - ["\u016bs", 118, -1], - ["t\u0173s", 118, -1], - ["at", -1, -1], - ["iat", 179, -1], - ["it", -1, -1], - ["sit", 181, -1], - ["ot", -1, -1], - ["\u0117t", -1, -1], - ["tum\u0117t", 184, -1], - ["u", -1, -1], - ["au", 186, -1], - ["iau", 187, -1], - ["\u010diau", 188, -1], - ["iu", 186, -1], - ["eniu", 190, -1], - ["siu", 190, -1], - ["y", -1, -1], - ["\u0105", -1, -1], - ["i\u0105", 194, -1], - ["\u0117", -1, -1], - ["\u0119", -1, -1], - ["\u012f", -1, -1], - ["en\u012f", 198, -1], - ["er\u012f", 198, -1], - ["\u0173", -1, -1], - ["i\u0173", 201, -1], - ["er\u0173", 201, -1], - ], - c = [ - ["ing", -1, -1], - ["aj", -1, -1], - ["iaj", 1, -1], - ["iej", -1, -1], - ["oj", -1, -1], - ["ioj", 4, -1], - ["uoj", 4, -1], - ["iuoj", 6, -1], - ["auj", -1, -1], - ["\u0105j", -1, -1], - ["i\u0105j", 9, -1], - ["\u0117j", -1, -1], - ["\u0173j", -1, -1], - ["i\u0173j", 12, -1], - ["ok", -1, -1], - ["iok", 14, -1], - ["iuk", -1, -1], - ["uliuk", 16, -1], - ["u\u010diuk", 16, -1], - ["i\u0161k", -1, -1], - ["iul", -1, -1], - ["yl", -1, -1], - ["\u0117l", -1, -1], - ["am", -1, -1], - ["dam", 23, -1], - ["jam", 23, -1], - ["zgan", -1, -1], - ["ain", -1, -1], - ["esn", -1, -1], - ["op", -1, -1], - ["iop", 29, -1], - ["ias", -1, -1], - ["ies", -1, -1], - ["ais", -1, -1], - ["iais", 33, -1], - ["os", -1, -1], - ["ios", 35, -1], - ["uos", 35, -1], - ["iuos", 37, -1], - ["aus", -1, -1], - ["iaus", 39, -1], - ["\u0105s", -1, -1], - ["i\u0105s", 41, -1], - ["\u0119s", -1, -1], - ["ut\u0117ait", -1, -1], - ["ant", -1, -1], - ["iant", 45, -1], - ["siant", 46, -1], - ["int", -1, -1], - ["ot", -1, -1], - ["uot", 49, -1], - ["iuot", 50, -1], - ["yt", -1, -1], - ["\u0117t", -1, -1], - ["yk\u0161t", -1, -1], - ["iau", -1, -1], - ["dav", -1, -1], - ["sv", -1, -1], - ["\u0161v", -1, -1], - ["yk\u0161\u010d", -1, -1], - ["\u0119", -1, -1], - ["\u0117j\u0119", 60, -1], - ], - a = [ - ["ojime", -1, 7], - ["\u0117jime", -1, 3], - ["avime", -1, 6], - ["okate", -1, 8], - ["aite", -1, 1], - ["uote", -1, 2], - ["asius", -1, 5], - ["okat\u0117s", -1, 8], - ["ait\u0117s", -1, 1], - ["uot\u0117s", -1, 2], - ["esiu", -1, 4], - ], - d = [ - ["\u010d", -1, 1], - ["d\u017e", -1, 2], - ], - n = [["gd", -1, 1]], - v = [17, 65, 16, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 64, 1, 0, 64, 0, 0, 0, 0, 0, 0, 0, 4, 4], - b = 0; - this.l = function () { - b = l.a; - var d = l.cursor; - a: { - var q = l.cursor; - var t = l.cursor; - l.m("a") - ? ((l.cursor = t), 6 < l.j.length ? ((t = l.cursor + 1), (l.cursor = t > l.a ? q : t)) : (l.cursor = q)) - : (l.cursor = q); - b: for (;;) { - if (l.i(v, 97, 371)) break b; - if (l.cursor >= l.a) break a; - l.cursor++; - } - b: for (;;) { - if (l.k(v, 97, 371)) break b; - if (l.cursor >= l.a) break a; - l.cursor++; - } - b = l.cursor; - } - l.cursor = d; - l.f = l.cursor; - l.cursor = l.a; - d = l.a - l.cursor; - l.d = l.cursor; - q = l.h(a); - if (0 != q) - switch (((l.c = l.cursor), q)) { - case 1: - if (!l.b("ait\u0117")) break; - break; - case 2: - if (!l.b("uot\u0117")) break; - break; - case 3: - if (!l.b("\u0117jimas")) break; - break; - case 4: - if (!l.b("esys")) break; - break; - case 5: - if (!l.b("asys")) break; - break; - case 6: - if (!l.b("avimas")) break; - break; - case 7: - if (!l.b("ojimas")) break; - break; - case 8: - l.b("okat\u0117"); - } - l.cursor = l.a - d; - d = l.a - l.cursor; - l.cursor < b || - ((q = l.f), - (l.f = b), - (l.d = l.cursor), - 0 == l.h(h) ? (l.f = q) : ((l.c = l.cursor), (l.f = q), !(b <= l.cursor) || l.e())); - l.cursor = l.a - d; - d = l.a - l.cursor; - k(); - l.cursor = l.a - d; - d = l.a - l.cursor; - a: for (;;) { - q = l.a - l.cursor; - if (!(l.cursor < b)) - if (((t = l.f), (l.f = b), (l.d = l.cursor), 0 == l.h(c))) l.f = t; - else { - l.c = l.cursor; - l.f = t; - if (!l.e()) break a; - continue; - } - l.cursor = l.a - q; - break; - } - l.cursor = l.a - d; - d = l.a - l.cursor; - k(); - l.cursor = l.a - d; - d = l.a - l.cursor; - l.d = l.cursor; - 0 != l.h(n) && ((l.c = l.cursor), l.b("g")); - l.cursor = l.a - d; - l.cursor = l.f; - return g; - }; - this.stemWord = function (a) { - l.p(a); - this.l(); - return l.j; - }; -} - -const stemmerInstance = new stem(); - -export function stemmer(word) { - return stemmerInstance.stemWord(word); -} diff --git a/stemmer/lib/nl.d.ts b/stemmer/lib/nl.d.ts deleted file mode 100644 index 838f68c..0000000 --- a/stemmer/lib/nl.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare function stemmer(word: string): string; diff --git a/stemmer/lib/nl.js b/stemmer/lib/nl.js deleted file mode 100644 index d539eb6..0000000 --- a/stemmer/lib/nl.js +++ /dev/null @@ -1,494 +0,0 @@ -/* - * ----------------------------------------------------------------------------- - * GENERATED FILE - DO NOT EDIT! - * This file has been compiled using the Snowball stemmer generator. - * Don't edit this file directly. - * ----------------------------------------------------------------------------- - */ - -var g = !0, - p = !1; - -function C() { - this.p = function (k) { - this.j = k; - this.cursor = 0; - this.a = this.j.length; - this.f = 0; - this.c = this.cursor; - this.d = this.a; - }; - this.z = function () { - return this.j; - }; - this.w = function (k) { - this.j = k.j; - this.cursor = k.cursor; - this.a = k.a; - this.f = k.f; - this.c = k.c; - this.d = k.d; - }; - this.i = function (k, l, h) { - if (this.cursor >= this.a) return p; - var c = this.j.charCodeAt(this.cursor); - if (c > h || c < l) return p; - c -= l; - if (0 == (k[c >>> 3] & (1 << (c & 7)))) return p; - this.cursor++; - return g; - }; - this.n = function (k, l, h) { - if (this.cursor <= this.f) return p; - var c = this.j.charCodeAt(this.cursor - 1); - if (c > h || c < l) return p; - c -= l; - if (0 == (k[c >>> 3] & (1 << (c & 7)))) return p; - this.cursor--; - return g; - }; - this.k = function (k, l, h) { - if (this.cursor >= this.a) return p; - var c = this.j.charCodeAt(this.cursor); - if (c > h || c < l) return this.cursor++, g; - c -= l; - return 0 == (k[c >>> 3] & (1 << (c & 7))) ? (this.cursor++, g) : p; - }; - this.q = function (k, l, h) { - if (this.cursor <= this.f) return p; - var c = this.j.charCodeAt(this.cursor - 1); - if (c > h || c < l) return this.cursor--, g; - c -= l; - return 0 == (k[c >>> 3] & (1 << (c & 7))) ? (this.cursor--, g) : p; - }; - this.m = function (k) { - if (this.a - this.cursor < k.length || this.j.slice(this.cursor, this.cursor + k.length) != k) return p; - this.cursor += k.length; - return g; - }; - this.g = function (k) { - if (this.cursor - this.f < k.length || this.j.slice(this.cursor - k.length, this.cursor) != k) return p; - this.cursor -= k.length; - return g; - }; - this.o = function (k) { - for (var l = 0, h = k.length, c = this.cursor, a = this.a, d = 0, n = 0, v = p; ; ) { - var b = l + ((h - l) >>> 1), - f = 0, - q = d < n ? d : n, - t = k[b], - s; - for (s = q; s < t[0].length; s++) { - if (c + q == a) { - f = -1; - break; - } - f = this.j.charCodeAt(c + q) - t[0].charCodeAt(s); - if (0 != f) break; - q++; - } - 0 > f ? ((h = b), (n = q)) : ((l = b), (d = q)); - if (1 >= h - l) { - if (0 < l) break; - if (h == l) break; - if (v) break; - v = g; - } - } - for (;;) { - t = k[l]; - if (d >= t[0].length) { - this.cursor = c + t[0].length; - if (4 > t.length) return t[2]; - l = t[3](this); - this.cursor = c + t[0].length; - if (l) return t[2]; - } - l = t[1]; - if (0 > l) return 0; - } - }; - this.h = function (k) { - for (var l = 0, h = k.length, c = this.cursor, a = this.f, d = 0, n = 0, v = p; ; ) { - var b = l + ((h - l) >> 1), - f = 0, - q = d < n ? d : n, - t = k[b], - s; - for (s = t[0].length - 1 - q; 0 <= s; s--) { - if (c - q == a) { - f = -1; - break; - } - f = this.j.charCodeAt(c - 1 - q) - t[0].charCodeAt(s); - if (0 != f) break; - q++; - } - 0 > f ? ((h = b), (n = q)) : ((l = b), (d = q)); - if (1 >= h - l) { - if (0 < l) break; - if (h == l) break; - if (v) break; - v = g; - } - } - for (;;) { - t = k[l]; - if (d >= t[0].length) { - this.cursor = c - t[0].length; - if (4 > t.length) return t[2]; - l = t[3](this); - this.cursor = c - t[0].length; - if (l) return t[2]; - } - l = t[1]; - if (0 > l) return 0; - } - }; - this.s = function (k, l, h) { - var c = h.length - (l - k); - this.j = this.j.slice(0, k) + h + this.j.slice(l); - this.a += c; - this.cursor >= l ? (this.cursor += c) : this.cursor > k && (this.cursor = k); - return c; - }; - this.t = function () { - return 0 > this.c || this.c > this.d || this.d > this.a || this.a > this.j.length ? p : g; - }; - this.b = function (k) { - var l = p; - this.t() && (this.s(this.c, this.d, k), (l = g)); - return l; - }; - this.e = function () { - return this.b(""); - }; - this.r = function (k, l, h) { - l = this.s(k, l, h); - k <= this.c && (this.c += l); - k <= this.d && (this.d += l); - }; - this.u = function () { - var k = ""; - this.t() && (k = this.j.slice(this.c, this.d)); - return k; - }; - this.v = function () { - return this.j.slice(0, this.a); - }; -} - -function stem() { - function k() { - for (var a, c = b.cursor; ; ) { - var e = b.cursor; - a: if (((b.c = b.cursor), (a = b.o(f)), 0 != a)) { - b.d = b.cursor; - switch (a) { - case 1: - if (!b.b("a")) return; - break; - case 2: - if (!b.b("e")) return; - break; - case 3: - if (!b.b("i")) return; - break; - case 4: - if (!b.b("o")) return; - break; - case 5: - if (!b.b("u")) return; - break; - case 6: - if (b.cursor >= b.a) break a; - b.cursor++; - } - continue; - } - b.cursor = e; - break; - } - b.cursor = c; - a = b.cursor; - b.c = b.cursor; - if (b.m("y")) { - if (((b.d = b.cursor), !b.b("Y"))) return; - } else b.cursor = a; - for (;;) { - a = b.cursor; - a: { - b: for (;;) { - c = b.cursor; - c: if (b.i(w, 97, 232)) { - b.c = b.cursor; - d: { - e = b.cursor; - if (b.m("i") && ((b.d = b.cursor), b.i(w, 97, 232))) { - if (!b.b("I")) return; - break d; - } - b.cursor = e; - if (!b.m("y")) break c; - b.d = b.cursor; - if (!b.b("Y")) return; - } - b.cursor = c; - break b; - } - b.cursor = c; - if (b.cursor >= b.a) break a; - b.cursor++; - } - continue; - } - b.cursor = a; - break; - } - } - function l() { - z = e = b.a; - a: for (;;) { - if (b.i(w, 97, 232)) break a; - if (b.cursor >= b.a) return; - b.cursor++; - } - a: for (;;) { - if (b.k(w, 97, 232)) break a; - if (b.cursor >= b.a) return; - b.cursor++; - } - e = b.cursor; - 3 > e && (e = 3); - a: for (;;) { - if (b.i(w, 97, 232)) break a; - if (b.cursor >= b.a) return; - b.cursor++; - } - a: for (;;) { - if (b.k(w, 97, 232)) break a; - if (b.cursor >= b.a) return; - b.cursor++; - } - z = b.cursor; - } - function h() { - return !(e <= b.cursor) ? p : g; - } - function c() { - return !(z <= b.cursor) ? p : g; - } - function a() { - var a = b.a - b.cursor; - if (0 == b.h(t)) return p; - b.cursor = b.a - a; - b.d = b.cursor; - if (b.cursor <= b.f) return p; - b.cursor--; - b.c = b.cursor; - return !b.e() ? p : g; - } - function d() { - A = p; - b.d = b.cursor; - if (!b.g("e")) return p; - b.c = b.cursor; - if (!h()) return p; - var c = b.a - b.cursor; - if (!b.q(w, 97, 232)) return p; - b.cursor = b.a - c; - if (!b.e()) return p; - A = g; - return !a() ? p : g; - } - function n() { - if (!h()) return p; - var c = b.a - b.cursor; - if (!b.q(w, 97, 232)) return p; - b.cursor = b.a - c; - c = b.a - b.cursor; - if (b.g("gem")) return p; - b.cursor = b.a - c; - return !b.e() || !a() ? p : g; - } - function v() { - var e, - f = b.a - b.cursor; - a: if (((b.d = b.cursor), (e = b.h(s)), 0 != e)) - switch (((b.c = b.cursor), e)) { - case 1: - if (!h()) break a; - if (!b.b("heid")) return; - break; - case 2: - if (!n()) break a; - break; - case 3: - if (!h()) break a; - if (!b.q(y, 97, 232)) break a; - if (!b.e()) return; - } - b.cursor = b.a - f; - f = b.a - b.cursor; - d(); - b.cursor = b.a - f; - f = b.a - b.cursor; - a: if (((b.d = b.cursor), b.g("heid") && ((b.c = b.cursor), c()))) { - e = b.a - b.cursor; - if (b.g("c")) break a; - b.cursor = b.a - e; - if (!b.e()) return; - b.d = b.cursor; - b.g("en") && ((b.c = b.cursor), n()); - } - b.cursor = b.a - f; - f = b.a - b.cursor; - a: if (((b.d = b.cursor), (e = b.h(r)), 0 != e)) - switch (((b.c = b.cursor), e)) { - case 1: - if (!c()) break a; - if (!b.e()) return; - b: { - e = b.a - b.cursor; - c: if (((b.d = b.cursor), b.g("ig") && ((b.c = b.cursor), c()))) { - var k = b.a - b.cursor; - if (b.g("e")) break c; - b.cursor = b.a - k; - if (!b.e()) return; - break b; - } - b.cursor = b.a - e; - if (!a()) break a; - } - break; - case 2: - if (!c()) break a; - e = b.a - b.cursor; - if (b.g("e")) break a; - b.cursor = b.a - e; - if (!b.e()) return; - break; - case 3: - if (!c()) break a; - if (!b.e()) return; - if (!d()) break a; - break; - case 4: - if (!c()) break a; - if (!b.e()) return; - break; - case 5: - if (!c()) break a; - if (!A) break a; - if (!b.e()) return; - } - b.cursor = b.a - f; - f = b.a - b.cursor; - if ( - b.q(u, 73, 232) && - ((e = b.a - b.cursor), - 0 != b.h(m) && - b.q(w, 97, 232) && - ((b.cursor = b.a - e), (b.d = b.cursor), !(b.cursor <= b.f) && (b.cursor--, (b.c = b.cursor), !b.e()))) - ) - return; - b.cursor = b.a - f; - } - var b = new C(), - f = [ - ["", -1, 6], - ["\u00e1", 0, 1], - ["\u00e4", 0, 1], - ["\u00e9", 0, 2], - ["\u00eb", 0, 2], - ["\u00ed", 0, 3], - ["\u00ef", 0, 3], - ["\u00f3", 0, 4], - ["\u00f6", 0, 4], - ["\u00fa", 0, 5], - ["\u00fc", 0, 5], - ], - q = [ - ["", -1, 3], - ["I", 0, 2], - ["Y", 0, 1], - ], - t = [ - ["dd", -1, -1], - ["kk", -1, -1], - ["tt", -1, -1], - ], - s = [ - ["ene", -1, 2], - ["se", -1, 3], - ["en", -1, 2], - ["heden", 2, 1], - ["s", -1, 3], - ], - r = [ - ["end", -1, 1], - ["ig", -1, 2], - ["ing", -1, 1], - ["lijk", -1, 3], - ["baar", -1, 4], - ["bar", -1, 5], - ], - m = [ - ["aa", -1, -1], - ["ee", -1, -1], - ["oo", -1, -1], - ["uu", -1, -1], - ], - w = [17, 65, 16, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128], - u = [1, 0, 0, 17, 65, 16, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128], - y = [17, 67, 16, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128], - z = 0, - e = 0, - A = p; - this.l = function () { - var a = b.cursor; - k(); - b.cursor = a; - a = b.cursor; - l(); - b.cursor = a; - b.f = b.cursor; - b.cursor = b.a; - v(); - b.cursor = b.f; - a = b.cursor; - a: for (var c; ; ) { - var e = b.cursor; - b: if (((b.c = b.cursor), (c = b.o(q)), 0 != c)) { - b.d = b.cursor; - switch (c) { - case 1: - if (!b.b("y")) break a; - break; - case 2: - if (!b.b("i")) break a; - break; - case 3: - if (b.cursor >= b.a) break b; - b.cursor++; - } - continue; - } - b.cursor = e; - break; - } - b.cursor = a; - return g; - }; - this.stemWord = function (a) { - b.p(a); - this.l(); - return b.j; - }; -} - -const stemmerInstance = new stem(); - -export function stemmer(word) { - return stemmerInstance.stemWord(word); -} diff --git a/stemmer/lib/no.d.ts b/stemmer/lib/no.d.ts deleted file mode 100644 index 838f68c..0000000 --- a/stemmer/lib/no.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare function stemmer(word: string): string; diff --git a/stemmer/lib/no.js b/stemmer/lib/no.js deleted file mode 100644 index 893d6ca..0000000 --- a/stemmer/lib/no.js +++ /dev/null @@ -1,319 +0,0 @@ -/* - * ----------------------------------------------------------------------------- - * GENERATED FILE - DO NOT EDIT! - * This file has been compiled using the Snowball stemmer generator. - * Don't edit this file directly. - * ----------------------------------------------------------------------------- - */ - -var g = !0, - p = !1; - -function C() { - this.p = function (k) { - this.j = k; - this.cursor = 0; - this.a = this.j.length; - this.f = 0; - this.c = this.cursor; - this.d = this.a; - }; - this.z = function () { - return this.j; - }; - this.w = function (k) { - this.j = k.j; - this.cursor = k.cursor; - this.a = k.a; - this.f = k.f; - this.c = k.c; - this.d = k.d; - }; - this.i = function (k, l, h) { - if (this.cursor >= this.a) return p; - var c = this.j.charCodeAt(this.cursor); - if (c > h || c < l) return p; - c -= l; - if (0 == (k[c >>> 3] & (1 << (c & 7)))) return p; - this.cursor++; - return g; - }; - this.n = function (k, l, h) { - if (this.cursor <= this.f) return p; - var c = this.j.charCodeAt(this.cursor - 1); - if (c > h || c < l) return p; - c -= l; - if (0 == (k[c >>> 3] & (1 << (c & 7)))) return p; - this.cursor--; - return g; - }; - this.k = function (k, l, h) { - if (this.cursor >= this.a) return p; - var c = this.j.charCodeAt(this.cursor); - if (c > h || c < l) return this.cursor++, g; - c -= l; - return 0 == (k[c >>> 3] & (1 << (c & 7))) ? (this.cursor++, g) : p; - }; - this.q = function (k, l, h) { - if (this.cursor <= this.f) return p; - var c = this.j.charCodeAt(this.cursor - 1); - if (c > h || c < l) return this.cursor--, g; - c -= l; - return 0 == (k[c >>> 3] & (1 << (c & 7))) ? (this.cursor--, g) : p; - }; - this.m = function (k) { - if (this.a - this.cursor < k.length || this.j.slice(this.cursor, this.cursor + k.length) != k) return p; - this.cursor += k.length; - return g; - }; - this.g = function (k) { - if (this.cursor - this.f < k.length || this.j.slice(this.cursor - k.length, this.cursor) != k) return p; - this.cursor -= k.length; - return g; - }; - this.o = function (k) { - for (var l = 0, h = k.length, c = this.cursor, a = this.a, d = 0, n = 0, v = p; ; ) { - var b = l + ((h - l) >>> 1), - f = 0, - q = d < n ? d : n, - t = k[b], - s; - for (s = q; s < t[0].length; s++) { - if (c + q == a) { - f = -1; - break; - } - f = this.j.charCodeAt(c + q) - t[0].charCodeAt(s); - if (0 != f) break; - q++; - } - 0 > f ? ((h = b), (n = q)) : ((l = b), (d = q)); - if (1 >= h - l) { - if (0 < l) break; - if (h == l) break; - if (v) break; - v = g; - } - } - for (;;) { - t = k[l]; - if (d >= t[0].length) { - this.cursor = c + t[0].length; - if (4 > t.length) return t[2]; - l = t[3](this); - this.cursor = c + t[0].length; - if (l) return t[2]; - } - l = t[1]; - if (0 > l) return 0; - } - }; - this.h = function (k) { - for (var l = 0, h = k.length, c = this.cursor, a = this.f, d = 0, n = 0, v = p; ; ) { - var b = l + ((h - l) >> 1), - f = 0, - q = d < n ? d : n, - t = k[b], - s; - for (s = t[0].length - 1 - q; 0 <= s; s--) { - if (c - q == a) { - f = -1; - break; - } - f = this.j.charCodeAt(c - 1 - q) - t[0].charCodeAt(s); - if (0 != f) break; - q++; - } - 0 > f ? ((h = b), (n = q)) : ((l = b), (d = q)); - if (1 >= h - l) { - if (0 < l) break; - if (h == l) break; - if (v) break; - v = g; - } - } - for (;;) { - t = k[l]; - if (d >= t[0].length) { - this.cursor = c - t[0].length; - if (4 > t.length) return t[2]; - l = t[3](this); - this.cursor = c - t[0].length; - if (l) return t[2]; - } - l = t[1]; - if (0 > l) return 0; - } - }; - this.s = function (k, l, h) { - var c = h.length - (l - k); - this.j = this.j.slice(0, k) + h + this.j.slice(l); - this.a += c; - this.cursor >= l ? (this.cursor += c) : this.cursor > k && (this.cursor = k); - return c; - }; - this.t = function () { - return 0 > this.c || this.c > this.d || this.d > this.a || this.a > this.j.length ? p : g; - }; - this.b = function (k) { - var l = p; - this.t() && (this.s(this.c, this.d, k), (l = g)); - return l; - }; - this.e = function () { - return this.b(""); - }; - this.r = function (k, l, h) { - l = this.s(k, l, h); - k <= this.c && (this.c += l); - k <= this.d && (this.d += l); - }; - this.u = function () { - var k = ""; - this.t() && (k = this.j.slice(this.c, this.d)); - return k; - }; - this.v = function () { - return this.j.slice(0, this.a); - }; -} - -function stem() { - var k = new C(), - l = [ - ["a", -1, 1], - ["e", -1, 1], - ["ede", 1, 1], - ["ande", 1, 1], - ["ende", 1, 1], - ["ane", 1, 1], - ["ene", 1, 1], - ["hetene", 6, 1], - ["erte", 1, 3], - ["en", -1, 1], - ["heten", 9, 1], - ["ar", -1, 1], - ["er", -1, 1], - ["heter", 12, 1], - ["s", -1, 2], - ["as", 14, 1], - ["es", 14, 1], - ["edes", 16, 1], - ["endes", 16, 1], - ["enes", 16, 1], - ["hetenes", 19, 1], - ["ens", 14, 1], - ["hetens", 21, 1], - ["ers", 14, 1], - ["ets", 14, 1], - ["et", -1, 1], - ["het", 25, 1], - ["ert", -1, 3], - ["ast", -1, 1], - ], - h = [ - ["dt", -1, -1], - ["vt", -1, -1], - ], - c = [ - ["leg", -1, 1], - ["eleg", 0, 1], - ["ig", -1, 1], - ["eig", 2, 1], - ["lig", 2, 1], - ["elig", 4, 1], - ["els", -1, 1], - ["lov", -1, 1], - ["elov", 7, 1], - ["slov", 7, 1], - ["hetslov", 9, 1], - ], - a = [17, 65, 16, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 48, 0, 128], - d = [119, 125, 149, 1], - n = 0, - v = 0; - this.l = function () { - var b = k.cursor; - a: { - v = k.a; - var f = k.cursor, - q = k.cursor + 3; - if (!(q > k.a)) { - k.cursor = q; - n = k.cursor; - k.cursor = f; - b: for (;;) { - f = k.cursor; - if (k.i(a, 97, 248)) { - k.cursor = f; - break b; - } - k.cursor = f; - if (k.cursor >= k.a) break a; - k.cursor++; - } - b: for (;;) { - if (k.k(a, 97, 248)) break b; - if (k.cursor >= k.a) break a; - k.cursor++; - } - v = k.cursor; - v < n && (v = n); - } - } - k.cursor = b; - k.f = k.cursor; - k.cursor = k.a; - b = k.a - k.cursor; - if (!(k.cursor < v)) - if (((q = k.f), (k.f = v), (k.d = k.cursor), (f = k.h(l)), 0 == f)) k.f = q; - else - switch (((k.c = k.cursor), (k.f = q), f)) { - case 1: - if (!k.e()) break; - break; - case 2: - a: { - f = k.a - k.cursor; - if (k.n(d, 98, 122)) break a; - k.cursor = k.a - f; - if (!k.g("k") || !k.q(a, 97, 248)) break; - } - if (!k.e()) break; - break; - case 3: - k.b("er"); - } - k.cursor = k.a - b; - b = k.a - k.cursor; - f = k.a - k.cursor; - k.cursor < v || - ((q = k.f), - (k.f = v), - (k.d = k.cursor), - 0 == k.h(h) - ? (k.f = q) - : ((k.c = k.cursor), - (k.f = q), - (k.cursor = k.a - f), - k.cursor <= k.f || (k.cursor--, (k.c = k.cursor), k.e()))); - k.cursor = k.a - b; - b = k.a - k.cursor; - k.cursor < v || - ((f = k.f), (k.f = v), (k.d = k.cursor), 0 == k.h(c) ? (k.f = f) : ((k.c = k.cursor), (k.f = f), k.e())); - k.cursor = k.a - b; - k.cursor = k.f; - return g; - }; - this.stemWord = function (a) { - k.p(a); - this.l(); - return k.j; - }; -} - -const stemmerInstance = new stem(); - -export function stemmer(word) { - return stemmerInstance.stemWord(word); -} diff --git a/stemmer/lib/np.d.ts b/stemmer/lib/np.d.ts deleted file mode 100644 index 5e9d2a7..0000000 --- a/stemmer/lib/np.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -export declare function stemmer(word: string): string; - -const stemmerInstance = new stem(); - -export function stemmer(word) { - return stemmerInstance.stemWord(word); -} diff --git a/stemmer/lib/np.js b/stemmer/lib/np.js deleted file mode 100644 index 243ba53..0000000 --- a/stemmer/lib/np.js +++ /dev/null @@ -1,382 +0,0 @@ -/* - * ----------------------------------------------------------------------------- - * GENERATED FILE - DO NOT EDIT! - * This file has been compiled using the Snowball stemmer generator. - * Don't edit this file directly. - * ----------------------------------------------------------------------------- - */ - -var g = !0, - p = !1; - -function C() { - this.p = function (k) { - this.j = k; - this.cursor = 0; - this.a = this.j.length; - this.f = 0; - this.c = this.cursor; - this.d = this.a; - }; - this.z = function () { - return this.j; - }; - this.w = function (k) { - this.j = k.j; - this.cursor = k.cursor; - this.a = k.a; - this.f = k.f; - this.c = k.c; - this.d = k.d; - }; - this.i = function (k, l, h) { - if (this.cursor >= this.a) return p; - var c = this.j.charCodeAt(this.cursor); - if (c > h || c < l) return p; - c -= l; - if (0 == (k[c >>> 3] & (1 << (c & 7)))) return p; - this.cursor++; - return g; - }; - this.n = function (k, l, h) { - if (this.cursor <= this.f) return p; - var c = this.j.charCodeAt(this.cursor - 1); - if (c > h || c < l) return p; - c -= l; - if (0 == (k[c >>> 3] & (1 << (c & 7)))) return p; - this.cursor--; - return g; - }; - this.k = function (k, l, h) { - if (this.cursor >= this.a) return p; - var c = this.j.charCodeAt(this.cursor); - if (c > h || c < l) return this.cursor++, g; - c -= l; - return 0 == (k[c >>> 3] & (1 << (c & 7))) ? (this.cursor++, g) : p; - }; - this.q = function (k, l, h) { - if (this.cursor <= this.f) return p; - var c = this.j.charCodeAt(this.cursor - 1); - if (c > h || c < l) return this.cursor--, g; - c -= l; - return 0 == (k[c >>> 3] & (1 << (c & 7))) ? (this.cursor--, g) : p; - }; - this.m = function (k) { - if (this.a - this.cursor < k.length || this.j.slice(this.cursor, this.cursor + k.length) != k) return p; - this.cursor += k.length; - return g; - }; - this.g = function (k) { - if (this.cursor - this.f < k.length || this.j.slice(this.cursor - k.length, this.cursor) != k) return p; - this.cursor -= k.length; - return g; - }; - this.o = function (k) { - for (var l = 0, h = k.length, c = this.cursor, a = this.a, d = 0, n = 0, v = p; ; ) { - var b = l + ((h - l) >>> 1), - f = 0, - q = d < n ? d : n, - t = k[b], - s; - for (s = q; s < t[0].length; s++) { - if (c + q == a) { - f = -1; - break; - } - f = this.j.charCodeAt(c + q) - t[0].charCodeAt(s); - if (0 != f) break; - q++; - } - 0 > f ? ((h = b), (n = q)) : ((l = b), (d = q)); - if (1 >= h - l) { - if (0 < l) break; - if (h == l) break; - if (v) break; - v = g; - } - } - for (;;) { - t = k[l]; - if (d >= t[0].length) { - this.cursor = c + t[0].length; - if (4 > t.length) return t[2]; - l = t[3](this); - this.cursor = c + t[0].length; - if (l) return t[2]; - } - l = t[1]; - if (0 > l) return 0; - } - }; - this.h = function (k) { - for (var l = 0, h = k.length, c = this.cursor, a = this.f, d = 0, n = 0, v = p; ; ) { - var b = l + ((h - l) >> 1), - f = 0, - q = d < n ? d : n, - t = k[b], - s; - for (s = t[0].length - 1 - q; 0 <= s; s--) { - if (c - q == a) { - f = -1; - break; - } - f = this.j.charCodeAt(c - 1 - q) - t[0].charCodeAt(s); - if (0 != f) break; - q++; - } - 0 > f ? ((h = b), (n = q)) : ((l = b), (d = q)); - if (1 >= h - l) { - if (0 < l) break; - if (h == l) break; - if (v) break; - v = g; - } - } - for (;;) { - t = k[l]; - if (d >= t[0].length) { - this.cursor = c - t[0].length; - if (4 > t.length) return t[2]; - l = t[3](this); - this.cursor = c - t[0].length; - if (l) return t[2]; - } - l = t[1]; - if (0 > l) return 0; - } - }; - this.s = function (k, l, h) { - var c = h.length - (l - k); - this.j = this.j.slice(0, k) + h + this.j.slice(l); - this.a += c; - this.cursor >= l ? (this.cursor += c) : this.cursor > k && (this.cursor = k); - return c; - }; - this.t = function () { - return 0 > this.c || this.c > this.d || this.d > this.a || this.a > this.j.length ? p : g; - }; - this.b = function (k) { - var l = p; - this.t() && (this.s(this.c, this.d, k), (l = g)); - return l; - }; - this.e = function () { - return this.b(""); - }; - this.r = function (k, l, h) { - l = this.s(k, l, h); - k <= this.c && (this.c += l); - k <= this.d && (this.d += l); - }; - this.u = function () { - var k = ""; - this.t() && (k = this.j.slice(this.c, this.d)); - return k; - }; - this.v = function () { - return this.j.slice(0, this.a); - }; -} - -function stem() { - var k = new C(), - l = [ - ["\u0932\u093e\u0907", -1, 1], - ["\u0932\u093e\u0908", -1, 1], - ["\u0938\u0901\u0917", -1, 1], - ["\u0938\u0902\u0917", -1, 1], - ["\u092e\u093e\u0930\u094d\u092b\u0924", -1, 1], - ["\u0930\u0924", -1, 1], - ["\u0915\u093e", -1, 2], - ["\u092e\u093e", -1, 1], - ["\u0926\u094d\u0935\u093e\u0930\u093e", -1, 1], - ["\u0915\u093f", -1, 2], - ["\u092a\u091b\u093f", -1, 1], - ["\u0915\u0940", -1, 2], - ["\u0932\u0947", -1, 1], - ["\u0915\u0948", -1, 2], - ["\u0938\u0901\u0917\u0948", -1, 1], - ["\u092e\u0948", -1, 1], - ["\u0915\u094b", -1, 2], - ], - h = [ - ["\u0901", -1, -1], - ["\u0902", -1, -1], - ["\u0948", -1, -1], - ], - c = [ - ["\u0901", -1, 1], - ["\u0902", -1, 1], - ["\u0948", -1, 2], - ], - a = [ - ["\u0925\u093f\u090f", -1, 1], - ["\u091b", -1, 1], - ["\u0907\u091b", 1, 1], - ["\u090f\u091b", 1, 1], - ["\u093f\u091b", 1, 1], - ["\u0947\u091b", 1, 1], - ["\u0928\u0947\u091b", 5, 1], - ["\u0939\u0941\u0928\u0947\u091b", 6, 1], - ["\u0907\u0928\u094d\u091b", 1, 1], - ["\u093f\u0928\u094d\u091b", 1, 1], - ["\u0939\u0941\u0928\u094d\u091b", 1, 1], - ["\u090f\u0915\u093e", -1, 1], - ["\u0907\u090f\u0915\u093e", 11, 1], - ["\u093f\u090f\u0915\u093e", 11, 1], - ["\u0947\u0915\u093e", -1, 1], - ["\u0928\u0947\u0915\u093e", 14, 1], - ["\u0926\u093e", -1, 1], - ["\u0907\u0926\u093e", 16, 1], - ["\u093f\u0926\u093e", 16, 1], - ["\u0926\u0947\u0916\u093f", -1, 1], - ["\u092e\u093e\u0925\u093f", -1, 1], - ["\u090f\u0915\u0940", -1, 1], - ["\u0907\u090f\u0915\u0940", 21, 1], - ["\u093f\u090f\u0915\u0940", 21, 1], - ["\u0947\u0915\u0940", -1, 1], - ["\u0926\u0947\u0916\u0940", -1, 1], - ["\u0925\u0940", -1, 1], - ["\u0926\u0940", -1, 1], - ["\u091b\u0941", -1, 1], - ["\u090f\u091b\u0941", 28, 1], - ["\u0947\u091b\u0941", 28, 1], - ["\u0928\u0947\u091b\u0941", 30, 1], - ["\u0928\u0941", -1, 1], - ["\u0939\u0930\u0941", -1, 1], - ["\u0939\u0930\u0942", -1, 1], - ["\u091b\u0947", -1, 1], - ["\u0925\u0947", -1, 1], - ["\u0928\u0947", -1, 1], - ["\u090f\u0915\u0948", -1, 1], - ["\u0947\u0915\u0948", -1, 1], - ["\u0928\u0947\u0915\u0948", 39, 1], - ["\u0926\u0948", -1, 1], - ["\u0907\u0926\u0948", 41, 1], - ["\u093f\u0926\u0948", 41, 1], - ["\u090f\u0915\u094b", -1, 1], - ["\u0907\u090f\u0915\u094b", 44, 1], - ["\u093f\u090f\u0915\u094b", 44, 1], - ["\u0947\u0915\u094b", -1, 1], - ["\u0928\u0947\u0915\u094b", 47, 1], - ["\u0926\u094b", -1, 1], - ["\u0907\u0926\u094b", 49, 1], - ["\u093f\u0926\u094b", 49, 1], - ["\u092f\u094b", -1, 1], - ["\u0907\u092f\u094b", 52, 1], - ["\u092d\u092f\u094b", 52, 1], - ["\u093f\u092f\u094b", 52, 1], - ["\u0925\u093f\u092f\u094b", 55, 1], - ["\u0926\u093f\u092f\u094b", 55, 1], - ["\u0925\u094d\u092f\u094b", 52, 1], - ["\u091b\u094c", -1, 1], - ["\u0907\u091b\u094c", 59, 1], - ["\u090f\u091b\u094c", 59, 1], - ["\u093f\u091b\u094c", 59, 1], - ["\u0947\u091b\u094c", 59, 1], - ["\u0928\u0947\u091b\u094c", 63, 1], - ["\u092f\u094c", -1, 1], - ["\u0925\u093f\u092f\u094c", 65, 1], - ["\u091b\u094d\u092f\u094c", 65, 1], - ["\u0925\u094d\u092f\u094c", 65, 1], - ["\u091b\u0928\u094d", -1, 1], - ["\u0907\u091b\u0928\u094d", 69, 1], - ["\u090f\u091b\u0928\u094d", 69, 1], - ["\u093f\u091b\u0928\u094d", 69, 1], - ["\u0947\u091b\u0928\u094d", 69, 1], - ["\u0928\u0947\u091b\u0928\u094d", 73, 1], - ["\u0932\u093e\u0928\u094d", -1, 1], - ["\u091b\u093f\u0928\u094d", -1, 1], - ["\u0925\u093f\u0928\u094d", -1, 1], - ["\u092a\u0930\u094d", -1, 1], - ["\u0907\u0938\u094d", -1, 1], - ["\u0925\u093f\u0907\u0938\u094d", 79, 1], - ["\u091b\u0938\u094d", -1, 1], - ["\u0907\u091b\u0938\u094d", 81, 1], - ["\u090f\u091b\u0938\u094d", 81, 1], - ["\u093f\u091b\u0938\u094d", 81, 1], - ["\u0947\u091b\u0938\u094d", 81, 1], - ["\u0928\u0947\u091b\u0938\u094d", 85, 1], - ["\u093f\u0938\u094d", -1, 1], - ["\u0925\u093f\u0938\u094d", 87, 1], - ["\u091b\u0947\u0938\u094d", -1, 1], - ["\u0939\u094b\u0938\u094d", -1, 1], - ]; - this.l = function () { - k.f = k.cursor; - k.cursor = k.a; - var d = k.a - k.cursor, - n; - k.d = k.cursor; - n = k.h(l); - if (0 != n) - switch (((k.c = k.cursor), n)) { - case 1: - if (!k.e()) break; - break; - case 2: - a: { - n = k.a - k.cursor; - b: { - c: { - var v = k.a - k.cursor; - if (k.g("\u090f")) break c; - k.cursor = k.a - v; - if (!k.g("\u0947")) break b; - } - break a; - } - k.cursor = k.a - n; - k.e(); - } - } - k.cursor = k.a - d; - d = k.a - k.cursor; - for (;;) { - n = k.a - k.cursor; - v = k.a - k.cursor; - var b = k.a - k.cursor, - f; - k.d = k.cursor; - 0 == k.h(h) ? (f = p) : ((k.c = k.cursor), (f = g)); - if (f && ((k.cursor = k.a - b), (b = void 0), (k.d = k.cursor), (b = k.h(c)), 0 != b)) - switch (((k.c = k.cursor), b)) { - case 1: - d: { - b = k.a - k.cursor; - if (k.g("\u092f\u094c")) break d; - k.cursor = k.a - b; - if (k.g("\u091b\u094c")) break d; - k.cursor = k.a - b; - if (k.g("\u0928\u094c")) break d; - k.cursor = k.a - b; - if (!k.g("\u0925\u0947")) break; - } - if (!k.e()) break; - break; - case 2: - !k.g("\u0924\u094d\u0930") || k.e(); - } - k.cursor = k.a - v; - k.d = k.cursor; - 0 == k.h(a) ? (v = p) : ((k.c = k.cursor), (v = !k.e() ? p : g)); - if (v) continue; - k.cursor = k.a - n; - break; - } - k.cursor = k.a - d; - k.cursor = k.f; - return g; - }; - this.stemWord = function (a) { - k.p(a); - this.l(); - return k.j; - }; -} - -const stemmerInstance = new stem(); - -export function stemmer(word) { - return stemmerInstance.stemWord(word); -} diff --git a/stemmer/lib/pt.d.ts b/stemmer/lib/pt.d.ts deleted file mode 100644 index 5e9d2a7..0000000 --- a/stemmer/lib/pt.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -export declare function stemmer(word: string): string; - -const stemmerInstance = new stem(); - -export function stemmer(word) { - return stemmerInstance.stemWord(word); -} diff --git a/stemmer/lib/pt.js b/stemmer/lib/pt.js deleted file mode 100644 index a5ffa8b..0000000 --- a/stemmer/lib/pt.js +++ /dev/null @@ -1,673 +0,0 @@ -/* - * ----------------------------------------------------------------------------- - * GENERATED FILE - DO NOT EDIT! - * This file has been compiled using the Snowball stemmer generator. - * Don't edit this file directly. - * ----------------------------------------------------------------------------- - */ - -var g = !0, - p = !1; - -function C() { - this.p = function (k) { - this.j = k; - this.cursor = 0; - this.a = this.j.length; - this.f = 0; - this.c = this.cursor; - this.d = this.a; - }; - this.z = function () { - return this.j; - }; - this.w = function (k) { - this.j = k.j; - this.cursor = k.cursor; - this.a = k.a; - this.f = k.f; - this.c = k.c; - this.d = k.d; - }; - this.i = function (k, l, h) { - if (this.cursor >= this.a) return p; - var c = this.j.charCodeAt(this.cursor); - if (c > h || c < l) return p; - c -= l; - if (0 == (k[c >>> 3] & (1 << (c & 7)))) return p; - this.cursor++; - return g; - }; - this.n = function (k, l, h) { - if (this.cursor <= this.f) return p; - var c = this.j.charCodeAt(this.cursor - 1); - if (c > h || c < l) return p; - c -= l; - if (0 == (k[c >>> 3] & (1 << (c & 7)))) return p; - this.cursor--; - return g; - }; - this.k = function (k, l, h) { - if (this.cursor >= this.a) return p; - var c = this.j.charCodeAt(this.cursor); - if (c > h || c < l) return this.cursor++, g; - c -= l; - return 0 == (k[c >>> 3] & (1 << (c & 7))) ? (this.cursor++, g) : p; - }; - this.q = function (k, l, h) { - if (this.cursor <= this.f) return p; - var c = this.j.charCodeAt(this.cursor - 1); - if (c > h || c < l) return this.cursor--, g; - c -= l; - return 0 == (k[c >>> 3] & (1 << (c & 7))) ? (this.cursor--, g) : p; - }; - this.m = function (k) { - if (this.a - this.cursor < k.length || this.j.slice(this.cursor, this.cursor + k.length) != k) return p; - this.cursor += k.length; - return g; - }; - this.g = function (k) { - if (this.cursor - this.f < k.length || this.j.slice(this.cursor - k.length, this.cursor) != k) return p; - this.cursor -= k.length; - return g; - }; - this.o = function (k) { - for (var l = 0, h = k.length, c = this.cursor, a = this.a, d = 0, n = 0, v = p; ; ) { - var b = l + ((h - l) >>> 1), - f = 0, - q = d < n ? d : n, - t = k[b], - s; - for (s = q; s < t[0].length; s++) { - if (c + q == a) { - f = -1; - break; - } - f = this.j.charCodeAt(c + q) - t[0].charCodeAt(s); - if (0 != f) break; - q++; - } - 0 > f ? ((h = b), (n = q)) : ((l = b), (d = q)); - if (1 >= h - l) { - if (0 < l) break; - if (h == l) break; - if (v) break; - v = g; - } - } - for (;;) { - t = k[l]; - if (d >= t[0].length) { - this.cursor = c + t[0].length; - if (4 > t.length) return t[2]; - l = t[3](this); - this.cursor = c + t[0].length; - if (l) return t[2]; - } - l = t[1]; - if (0 > l) return 0; - } - }; - this.h = function (k) { - for (var l = 0, h = k.length, c = this.cursor, a = this.f, d = 0, n = 0, v = p; ; ) { - var b = l + ((h - l) >> 1), - f = 0, - q = d < n ? d : n, - t = k[b], - s; - for (s = t[0].length - 1 - q; 0 <= s; s--) { - if (c - q == a) { - f = -1; - break; - } - f = this.j.charCodeAt(c - 1 - q) - t[0].charCodeAt(s); - if (0 != f) break; - q++; - } - 0 > f ? ((h = b), (n = q)) : ((l = b), (d = q)); - if (1 >= h - l) { - if (0 < l) break; - if (h == l) break; - if (v) break; - v = g; - } - } - for (;;) { - t = k[l]; - if (d >= t[0].length) { - this.cursor = c - t[0].length; - if (4 > t.length) return t[2]; - l = t[3](this); - this.cursor = c - t[0].length; - if (l) return t[2]; - } - l = t[1]; - if (0 > l) return 0; - } - }; - this.s = function (k, l, h) { - var c = h.length - (l - k); - this.j = this.j.slice(0, k) + h + this.j.slice(l); - this.a += c; - this.cursor >= l ? (this.cursor += c) : this.cursor > k && (this.cursor = k); - return c; - }; - this.t = function () { - return 0 > this.c || this.c > this.d || this.d > this.a || this.a > this.j.length ? p : g; - }; - this.b = function (k) { - var l = p; - this.t() && (this.s(this.c, this.d, k), (l = g)); - return l; - }; - this.e = function () { - return this.b(""); - }; - this.r = function (k, l, h) { - l = this.s(k, l, h); - k <= this.c && (this.c += l); - k <= this.d && (this.d += l); - }; - this.u = function () { - var k = ""; - this.t() && (k = this.j.slice(this.c, this.d)); - return k; - }; - this.v = function () { - return this.j.slice(0, this.a); - }; -} - -function stem() { - function k() { - return !(y <= a.cursor) ? p : g; - } - function l() { - return !(w <= a.cursor) ? p : g; - } - function h() { - var c; - a.d = a.cursor; - c = a.h(q); - if (0 == c) return p; - a.c = a.cursor; - switch (c) { - case 1: - if (!l() || !a.e()) return p; - break; - case 2: - if (!l() || !a.b("log")) return p; - break; - case 3: - if (!l() || !a.b("u")) return p; - break; - case 4: - if (!l() || !a.b("ente")) return p; - break; - case 5: - if (!(u <= a.cursor) || !a.e()) return p; - var d = a.a - a.cursor; - a: if (((a.d = a.cursor), (c = a.h(v)), 0 == c)) a.cursor = a.a - d; - else if (((a.c = a.cursor), l())) { - if (!a.e()) return p; - switch (c) { - case 1: - a.d = a.cursor; - if (!a.g("at")) { - a.cursor = a.a - d; - break a; - } - a.c = a.cursor; - if (!l()) { - a.cursor = a.a - d; - break a; - } - if (!a.e()) return p; - } - } else a.cursor = a.a - d; - break; - case 6: - if (!l() || !a.e()) return p; - c = a.a - a.cursor; - a.d = a.cursor; - if (0 == a.h(b)) a.cursor = a.a - c; - else if (((a.c = a.cursor), l())) { - if (!a.e()) return p; - } else a.cursor = a.a - c; - break; - case 7: - if (!l() || !a.e()) return p; - c = a.a - a.cursor; - a.d = a.cursor; - if (0 == a.h(f)) a.cursor = a.a - c; - else if (((a.c = a.cursor), l())) { - if (!a.e()) return p; - } else a.cursor = a.a - c; - break; - case 8: - if (!l() || !a.e()) return p; - c = a.a - a.cursor; - a.d = a.cursor; - if (a.g("at")) - if (((a.c = a.cursor), l())) { - if (!a.e()) return p; - } else a.cursor = a.a - c; - else a.cursor = a.a - c; - break; - case 9: - if (!k() || !a.g("e") || !a.b("ir")) return p; - } - return g; - } - function c() { - if (a.cursor < y) return p; - var b = a.f; - a.f = y; - a.d = a.cursor; - if (0 == a.h(t)) return (a.f = b), p; - a.c = a.cursor; - if (!a.e()) return p; - a.f = b; - return g; - } - var a = new C(), - d = [ - ["", -1, 3], - ["\u00e3", 0, 1], - ["\u00f5", 0, 2], - ], - n = [ - ["", -1, 3], - ["a~", 0, 1], - ["o~", 0, 2], - ], - v = [ - ["ic", -1, -1], - ["ad", -1, -1], - ["os", -1, -1], - ["iv", -1, 1], - ], - b = [ - ["ante", -1, 1], - ["avel", -1, 1], - ["\u00edvel", -1, 1], - ], - f = [ - ["ic", -1, 1], - ["abil", -1, 1], - ["iv", -1, 1], - ], - q = [ - ["ica", -1, 1], - ["\u00e2ncia", -1, 1], - ["\u00eancia", -1, 4], - ["logia", -1, 2], - ["ira", -1, 9], - ["adora", -1, 1], - ["osa", -1, 1], - ["ista", -1, 1], - ["iva", -1, 8], - ["eza", -1, 1], - ["idade", -1, 7], - ["ante", -1, 1], - ["mente", -1, 6], - ["amente", 12, 5], - ["\u00e1vel", -1, 1], - ["\u00edvel", -1, 1], - ["ico", -1, 1], - ["ismo", -1, 1], - ["oso", -1, 1], - ["amento", -1, 1], - ["imento", -1, 1], - ["ivo", -1, 8], - ["a\u00e7a~o", -1, 1], - ["u\u00e7a~o", -1, 3], - ["ador", -1, 1], - ["icas", -1, 1], - ["\u00eancias", -1, 4], - ["logias", -1, 2], - ["iras", -1, 9], - ["adoras", -1, 1], - ["osas", -1, 1], - ["istas", -1, 1], - ["ivas", -1, 8], - ["ezas", -1, 1], - ["idades", -1, 7], - ["adores", -1, 1], - ["antes", -1, 1], - ["a\u00e7o~es", -1, 1], - ["u\u00e7o~es", -1, 3], - ["icos", -1, 1], - ["ismos", -1, 1], - ["osos", -1, 1], - ["amentos", -1, 1], - ["imentos", -1, 1], - ["ivos", -1, 8], - ], - t = [ - ["ada", -1, 1], - ["ida", -1, 1], - ["ia", -1, 1], - ["aria", 2, 1], - ["eria", 2, 1], - ["iria", 2, 1], - ["ara", -1, 1], - ["era", -1, 1], - ["ira", -1, 1], - ["ava", -1, 1], - ["asse", -1, 1], - ["esse", -1, 1], - ["isse", -1, 1], - ["aste", -1, 1], - ["este", -1, 1], - ["iste", -1, 1], - ["ei", -1, 1], - ["arei", 16, 1], - ["erei", 16, 1], - ["irei", 16, 1], - ["am", -1, 1], - ["iam", 20, 1], - ["ariam", 21, 1], - ["eriam", 21, 1], - ["iriam", 21, 1], - ["aram", 20, 1], - ["eram", 20, 1], - ["iram", 20, 1], - ["avam", 20, 1], - ["em", -1, 1], - ["arem", 29, 1], - ["erem", 29, 1], - ["irem", 29, 1], - ["assem", 29, 1], - ["essem", 29, 1], - ["issem", 29, 1], - ["ado", -1, 1], - ["ido", -1, 1], - ["ando", -1, 1], - ["endo", -1, 1], - ["indo", -1, 1], - ["ara~o", -1, 1], - ["era~o", -1, 1], - ["ira~o", -1, 1], - ["ar", -1, 1], - ["er", -1, 1], - ["ir", -1, 1], - ["as", -1, 1], - ["adas", 47, 1], - ["idas", 47, 1], - ["ias", 47, 1], - ["arias", 50, 1], - ["erias", 50, 1], - ["irias", 50, 1], - ["aras", 47, 1], - ["eras", 47, 1], - ["iras", 47, 1], - ["avas", 47, 1], - ["es", -1, 1], - ["ardes", 58, 1], - ["erdes", 58, 1], - ["irdes", 58, 1], - ["ares", 58, 1], - ["eres", 58, 1], - ["ires", 58, 1], - ["asses", 58, 1], - ["esses", 58, 1], - ["isses", 58, 1], - ["astes", 58, 1], - ["estes", 58, 1], - ["istes", 58, 1], - ["is", -1, 1], - ["ais", 71, 1], - ["eis", 71, 1], - ["areis", 73, 1], - ["ereis", 73, 1], - ["ireis", 73, 1], - ["\u00e1reis", 73, 1], - ["\u00e9reis", 73, 1], - ["\u00edreis", 73, 1], - ["\u00e1sseis", 73, 1], - ["\u00e9sseis", 73, 1], - ["\u00edsseis", 73, 1], - ["\u00e1veis", 73, 1], - ["\u00edeis", 73, 1], - ["ar\u00edeis", 84, 1], - ["er\u00edeis", 84, 1], - ["ir\u00edeis", 84, 1], - ["ados", -1, 1], - ["idos", -1, 1], - ["amos", -1, 1], - ["\u00e1ramos", 90, 1], - ["\u00e9ramos", 90, 1], - ["\u00edramos", 90, 1], - ["\u00e1vamos", 90, 1], - ["\u00edamos", 90, 1], - ["ar\u00edamos", 95, 1], - ["er\u00edamos", 95, 1], - ["ir\u00edamos", 95, 1], - ["emos", -1, 1], - ["aremos", 99, 1], - ["eremos", 99, 1], - ["iremos", 99, 1], - ["\u00e1ssemos", 99, 1], - ["\u00eassemos", 99, 1], - ["\u00edssemos", 99, 1], - ["imos", -1, 1], - ["armos", -1, 1], - ["ermos", -1, 1], - ["irmos", -1, 1], - ["\u00e1mos", -1, 1], - ["ar\u00e1s", -1, 1], - ["er\u00e1s", -1, 1], - ["ir\u00e1s", -1, 1], - ["eu", -1, 1], - ["iu", -1, 1], - ["ou", -1, 1], - ["ar\u00e1", -1, 1], - ["er\u00e1", -1, 1], - ["ir\u00e1", -1, 1], - ], - s = [ - ["a", -1, 1], - ["i", -1, 1], - ["o", -1, 1], - ["os", -1, 1], - ["\u00e1", -1, 1], - ["\u00ed", -1, 1], - ["\u00f3", -1, 1], - ], - r = [ - ["e", -1, 1], - ["\u00e7", -1, 2], - ["\u00e9", -1, 1], - ["\u00ea", -1, 1], - ], - m = [17, 65, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 19, 12, 2], - w = 0, - u = 0, - y = 0; - this.l = function () { - var b = a.cursor; - a: for (var e; ; ) { - var f = a.cursor; - b: if (((a.c = a.cursor), (e = a.o(d)), 0 != e)) { - a.d = a.cursor; - switch (e) { - case 1: - if (!a.b("a~")) break a; - break; - case 2: - if (!a.b("o~")) break a; - break; - case 3: - if (a.cursor >= a.a) break b; - a.cursor++; - } - continue; - } - a.cursor = f; - break; - } - a.cursor = b; - w = u = y = a.a; - b = a.cursor; - a: { - b: { - e = a.cursor; - c: if (a.i(m, 97, 250)) { - d: { - f = a.cursor; - e: if (a.k(m, 97, 250)) { - f: for (;;) { - if (a.i(m, 97, 250)) break f; - if (a.cursor >= a.a) break e; - a.cursor++; - } - break d; - } - a.cursor = f; - if (!a.i(m, 97, 250)) break c; - e: for (;;) { - if (a.k(m, 97, 250)) break e; - if (a.cursor >= a.a) break c; - a.cursor++; - } - } - break b; - } - a.cursor = e; - if (!a.k(m, 97, 250)) break a; - c: { - e = a.cursor; - d: if (a.k(m, 97, 250)) { - e: for (;;) { - if (a.i(m, 97, 250)) break e; - if (a.cursor >= a.a) break d; - a.cursor++; - } - break c; - } - a.cursor = e; - if (!a.i(m, 97, 250)) break a; - if (a.cursor >= a.a) break a; - a.cursor++; - } - } - y = a.cursor; - } - a.cursor = b; - b = a.cursor; - a: { - b: for (;;) { - if (a.i(m, 97, 250)) break b; - if (a.cursor >= a.a) break a; - a.cursor++; - } - b: for (;;) { - if (a.k(m, 97, 250)) break b; - if (a.cursor >= a.a) break a; - a.cursor++; - } - u = a.cursor; - b: for (;;) { - if (a.i(m, 97, 250)) break b; - if (a.cursor >= a.a) break a; - a.cursor++; - } - b: for (;;) { - if (a.k(m, 97, 250)) break b; - if (a.cursor >= a.a) break a; - a.cursor++; - } - w = a.cursor; - } - a.cursor = b; - a.f = a.cursor; - a.cursor = a.a; - b = a.a - a.cursor; - b: { - e = a.a - a.cursor; - c: { - f = a.a - a.cursor; - d: { - var l = a.a - a.cursor; - if (h()) break d; - a.cursor = a.a - l; - if (!c()) break c; - } - a.cursor = a.a - f; - e = a.a - a.cursor; - a.d = a.cursor; - if (a.g("i") && ((a.c = a.cursor), (f = a.a - a.cursor), a.g("c") && ((a.cursor = a.a - f), k() && !a.e()))) - return p; - a.cursor = a.a - e; - break b; - } - a.cursor = a.a - e; - a.d = a.cursor; - 0 != a.h(s) && ((a.c = a.cursor), !k() || a.e()); - } - a.cursor = a.a - b; - b = a.a - a.cursor; - a.d = a.cursor; - e = a.h(r); - if (0 != e) - switch (((a.c = a.cursor), e)) { - case 1: - if (!k() || !a.e()) break; - a.d = a.cursor; - a: { - e = a.a - a.cursor; - if (a.g("u") && ((a.c = a.cursor), (f = a.a - a.cursor), a.g("g"))) { - a.cursor = a.a - f; - break a; - } - a.cursor = a.a - e; - if (!a.g("i")) break; - a.c = a.cursor; - e = a.a - a.cursor; - if (!a.g("c")) break; - a.cursor = a.a - e; - } - if (!k() || !a.e()) break; - break; - case 2: - a.b("c"); - } - a.cursor = a.a - b; - a.cursor = a.f; - b = a.cursor; - a: for (;;) { - f = a.cursor; - b: if (((a.c = a.cursor), (e = a.o(n)), 0 != e)) { - a.d = a.cursor; - switch (e) { - case 1: - if (!a.b("\u00e3")) break a; - break; - case 2: - if (!a.b("\u00f5")) break a; - break; - case 3: - if (a.cursor >= a.a) break b; - a.cursor++; - } - continue; - } - a.cursor = f; - break; - } - a.cursor = b; - return g; - }; - this.stemWord = function (b) { - a.p(b); - this.l(); - return a.j; - }; -} - -const stemmerInstance = new stem(); - -export function stemmer(word) { - return stemmerInstance.stemWord(word); -} diff --git a/stemmer/lib/ro.d.ts b/stemmer/lib/ro.d.ts deleted file mode 100644 index 838f68c..0000000 --- a/stemmer/lib/ro.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare function stemmer(word: string): string; diff --git a/stemmer/lib/ro.js b/stemmer/lib/ro.js deleted file mode 100644 index 5ae40a4..0000000 --- a/stemmer/lib/ro.js +++ /dev/null @@ -1,699 +0,0 @@ -/* - * ----------------------------------------------------------------------------- - * GENERATED FILE - DO NOT EDIT! - * This file has been compiled using the Snowball stemmer generator. - * Don't edit this file directly. - * ----------------------------------------------------------------------------- - */ - -var g = !0, - p = !1; - -function C() { - this.p = function (k) { - this.j = k; - this.cursor = 0; - this.a = this.j.length; - this.f = 0; - this.c = this.cursor; - this.d = this.a; - }; - this.z = function () { - return this.j; - }; - this.w = function (k) { - this.j = k.j; - this.cursor = k.cursor; - this.a = k.a; - this.f = k.f; - this.c = k.c; - this.d = k.d; - }; - this.i = function (k, l, h) { - if (this.cursor >= this.a) return p; - var c = this.j.charCodeAt(this.cursor); - if (c > h || c < l) return p; - c -= l; - if (0 == (k[c >>> 3] & (1 << (c & 7)))) return p; - this.cursor++; - return g; - }; - this.n = function (k, l, h) { - if (this.cursor <= this.f) return p; - var c = this.j.charCodeAt(this.cursor - 1); - if (c > h || c < l) return p; - c -= l; - if (0 == (k[c >>> 3] & (1 << (c & 7)))) return p; - this.cursor--; - return g; - }; - this.k = function (k, l, h) { - if (this.cursor >= this.a) return p; - var c = this.j.charCodeAt(this.cursor); - if (c > h || c < l) return this.cursor++, g; - c -= l; - return 0 == (k[c >>> 3] & (1 << (c & 7))) ? (this.cursor++, g) : p; - }; - this.q = function (k, l, h) { - if (this.cursor <= this.f) return p; - var c = this.j.charCodeAt(this.cursor - 1); - if (c > h || c < l) return this.cursor--, g; - c -= l; - return 0 == (k[c >>> 3] & (1 << (c & 7))) ? (this.cursor--, g) : p; - }; - this.m = function (k) { - if (this.a - this.cursor < k.length || this.j.slice(this.cursor, this.cursor + k.length) != k) return p; - this.cursor += k.length; - return g; - }; - this.g = function (k) { - if (this.cursor - this.f < k.length || this.j.slice(this.cursor - k.length, this.cursor) != k) return p; - this.cursor -= k.length; - return g; - }; - this.o = function (k) { - for (var l = 0, h = k.length, c = this.cursor, a = this.a, d = 0, n = 0, v = p; ; ) { - var b = l + ((h - l) >>> 1), - f = 0, - q = d < n ? d : n, - t = k[b], - s; - for (s = q; s < t[0].length; s++) { - if (c + q == a) { - f = -1; - break; - } - f = this.j.charCodeAt(c + q) - t[0].charCodeAt(s); - if (0 != f) break; - q++; - } - 0 > f ? ((h = b), (n = q)) : ((l = b), (d = q)); - if (1 >= h - l) { - if (0 < l) break; - if (h == l) break; - if (v) break; - v = g; - } - } - for (;;) { - t = k[l]; - if (d >= t[0].length) { - this.cursor = c + t[0].length; - if (4 > t.length) return t[2]; - l = t[3](this); - this.cursor = c + t[0].length; - if (l) return t[2]; - } - l = t[1]; - if (0 > l) return 0; - } - }; - this.h = function (k) { - for (var l = 0, h = k.length, c = this.cursor, a = this.f, d = 0, n = 0, v = p; ; ) { - var b = l + ((h - l) >> 1), - f = 0, - q = d < n ? d : n, - t = k[b], - s; - for (s = t[0].length - 1 - q; 0 <= s; s--) { - if (c - q == a) { - f = -1; - break; - } - f = this.j.charCodeAt(c - 1 - q) - t[0].charCodeAt(s); - if (0 != f) break; - q++; - } - 0 > f ? ((h = b), (n = q)) : ((l = b), (d = q)); - if (1 >= h - l) { - if (0 < l) break; - if (h == l) break; - if (v) break; - v = g; - } - } - for (;;) { - t = k[l]; - if (d >= t[0].length) { - this.cursor = c - t[0].length; - if (4 > t.length) return t[2]; - l = t[3](this); - this.cursor = c - t[0].length; - if (l) return t[2]; - } - l = t[1]; - if (0 > l) return 0; - } - }; - this.s = function (k, l, h) { - var c = h.length - (l - k); - this.j = this.j.slice(0, k) + h + this.j.slice(l); - this.a += c; - this.cursor >= l ? (this.cursor += c) : this.cursor > k && (this.cursor = k); - return c; - }; - this.t = function () { - return 0 > this.c || this.c > this.d || this.d > this.a || this.a > this.j.length ? p : g; - }; - this.b = function (k) { - var l = p; - this.t() && (this.s(this.c, this.d, k), (l = g)); - return l; - }; - this.e = function () { - return this.b(""); - }; - this.r = function (k, l, h) { - l = this.s(k, l, h); - k <= this.c && (this.c += l); - k <= this.d && (this.d += l); - }; - this.u = function () { - var k = ""; - this.t() && (k = this.j.slice(this.c, this.d)); - return k; - }; - this.v = function () { - return this.j.slice(0, this.a); - }; -} - -function stem() { - function k() { - var a, - b = c.a - c.cursor; - c.d = c.cursor; - a = c.h(n); - if (0 == a) return p; - c.c = c.cursor; - if (!(r <= c.cursor)) return p; - switch (a) { - case 1: - if (!c.b("abil")) return p; - break; - case 2: - if (!c.b("ibil")) return p; - break; - case 3: - if (!c.b("iv")) return p; - break; - case 4: - if (!c.b("ic")) return p; - break; - case 5: - if (!c.b("at")) return p; - break; - case 6: - if (!c.b("it")) return p; - } - t = g; - c.cursor = c.a - b; - return g; - } - function l() { - var a; - for (t = p; ; ) { - a = c.a - c.cursor; - if (k()) continue; - c.cursor = c.a - a; - break; - } - c.d = c.cursor; - a = c.h(v); - if (0 != a && ((c.c = c.cursor), s <= c.cursor)) { - switch (a) { - case 1: - if (!c.e()) return; - break; - case 2: - if (!c.g("\u0163")) return; - c.c = c.cursor; - if (!c.b("t")) return; - break; - case 3: - if (!c.b("ist")) return; - } - t = g; - } - } - function h() { - var a; - if (!(c.cursor < m)) { - var d = c.f; - c.f = m; - c.d = c.cursor; - a = c.h(b); - if (0 != a) - switch (((c.c = c.cursor), a)) { - case 1: - a: { - a = c.a - c.cursor; - if (c.q(q, 97, 259)) break a; - c.cursor = c.a - a; - if (!c.g("u")) { - c.f = d; - return; - } - } - if (!c.e()) return; - break; - case 2: - if (!c.e()) return; - } - c.f = d; - } - } - var c = new C(), - a = [ - ["", -1, 3], - ["I", 0, 1], - ["U", 0, 2], - ], - d = [ - ["ea", -1, 3], - ["a\u0163ia", -1, 7], - ["aua", -1, 2], - ["iua", -1, 4], - ["a\u0163ie", -1, 7], - ["ele", -1, 3], - ["ile", -1, 5], - ["iile", 6, 4], - ["iei", -1, 4], - ["atei", -1, 6], - ["ii", -1, 4], - ["ului", -1, 1], - ["ul", -1, 1], - ["elor", -1, 3], - ["ilor", -1, 4], - ["iilor", 14, 4], - ], - n = [ - ["icala", -1, 4], - ["iciva", -1, 4], - ["ativa", -1, 5], - ["itiva", -1, 6], - ["icale", -1, 4], - ["a\u0163iune", -1, 5], - ["i\u0163iune", -1, 6], - ["atoare", -1, 5], - ["itoare", -1, 6], - ["\u0103toare", -1, 5], - ["icitate", -1, 4], - ["abilitate", -1, 1], - ["ibilitate", -1, 2], - ["ivitate", -1, 3], - ["icive", -1, 4], - ["ative", -1, 5], - ["itive", -1, 6], - ["icali", -1, 4], - ["atori", -1, 5], - ["icatori", 18, 4], - ["itori", -1, 6], - ["\u0103tori", -1, 5], - ["icitati", -1, 4], - ["abilitati", -1, 1], - ["ivitati", -1, 3], - ["icivi", -1, 4], - ["ativi", -1, 5], - ["itivi", -1, 6], - ["icit\u0103i", -1, 4], - ["abilit\u0103i", -1, 1], - ["ivit\u0103i", -1, 3], - ["icit\u0103\u0163i", -1, 4], - ["abilit\u0103\u0163i", -1, 1], - ["ivit\u0103\u0163i", -1, 3], - ["ical", -1, 4], - ["ator", -1, 5], - ["icator", 35, 4], - ["itor", -1, 6], - ["\u0103tor", -1, 5], - ["iciv", -1, 4], - ["ativ", -1, 5], - ["itiv", -1, 6], - ["ical\u0103", -1, 4], - ["iciv\u0103", -1, 4], - ["ativ\u0103", -1, 5], - ["itiv\u0103", -1, 6], - ], - v = [ - ["ica", -1, 1], - ["abila", -1, 1], - ["ibila", -1, 1], - ["oasa", -1, 1], - ["ata", -1, 1], - ["ita", -1, 1], - ["anta", -1, 1], - ["ista", -1, 3], - ["uta", -1, 1], - ["iva", -1, 1], - ["ic", -1, 1], - ["ice", -1, 1], - ["abile", -1, 1], - ["ibile", -1, 1], - ["isme", -1, 3], - ["iune", -1, 2], - ["oase", -1, 1], - ["ate", -1, 1], - ["itate", 17, 1], - ["ite", -1, 1], - ["ante", -1, 1], - ["iste", -1, 3], - ["ute", -1, 1], - ["ive", -1, 1], - ["ici", -1, 1], - ["abili", -1, 1], - ["ibili", -1, 1], - ["iuni", -1, 2], - ["atori", -1, 1], - ["osi", -1, 1], - ["ati", -1, 1], - ["itati", 30, 1], - ["iti", -1, 1], - ["anti", -1, 1], - ["isti", -1, 3], - ["uti", -1, 1], - ["i\u015fti", -1, 3], - ["ivi", -1, 1], - ["it\u0103i", -1, 1], - ["o\u015fi", -1, 1], - ["it\u0103\u0163i", -1, 1], - ["abil", -1, 1], - ["ibil", -1, 1], - ["ism", -1, 3], - ["ator", -1, 1], - ["os", -1, 1], - ["at", -1, 1], - ["it", -1, 1], - ["ant", -1, 1], - ["ist", -1, 3], - ["ut", -1, 1], - ["iv", -1, 1], - ["ic\u0103", -1, 1], - ["abil\u0103", -1, 1], - ["ibil\u0103", -1, 1], - ["oas\u0103", -1, 1], - ["at\u0103", -1, 1], - ["it\u0103", -1, 1], - ["ant\u0103", -1, 1], - ["ist\u0103", -1, 3], - ["ut\u0103", -1, 1], - ["iv\u0103", -1, 1], - ], - b = [ - ["ea", -1, 1], - ["ia", -1, 1], - ["esc", -1, 1], - ["\u0103sc", -1, 1], - ["ind", -1, 1], - ["\u00e2nd", -1, 1], - ["are", -1, 1], - ["ere", -1, 1], - ["ire", -1, 1], - ["\u00e2re", -1, 1], - ["se", -1, 2], - ["ase", 10, 1], - ["sese", 10, 2], - ["ise", 10, 1], - ["use", 10, 1], - ["\u00e2se", 10, 1], - ["e\u015fte", -1, 1], - ["\u0103\u015fte", -1, 1], - ["eze", -1, 1], - ["ai", -1, 1], - ["eai", 19, 1], - ["iai", 19, 1], - ["sei", -1, 2], - ["e\u015fti", -1, 1], - ["\u0103\u015fti", -1, 1], - ["ui", -1, 1], - ["ezi", -1, 1], - ["\u00e2i", -1, 1], - ["a\u015fi", -1, 1], - ["se\u015fi", -1, 2], - ["ase\u015fi", 29, 1], - ["sese\u015fi", 29, 2], - ["ise\u015fi", 29, 1], - ["use\u015fi", 29, 1], - ["\u00e2se\u015fi", 29, 1], - ["i\u015fi", -1, 1], - ["u\u015fi", -1, 1], - ["\u00e2\u015fi", -1, 1], - ["a\u0163i", -1, 2], - ["ea\u0163i", 38, 1], - ["ia\u0163i", 38, 1], - ["e\u0163i", -1, 2], - ["i\u0163i", -1, 2], - ["\u00e2\u0163i", -1, 2], - ["ar\u0103\u0163i", -1, 1], - ["ser\u0103\u0163i", -1, 2], - ["aser\u0103\u0163i", 45, 1], - ["seser\u0103\u0163i", 45, 2], - ["iser\u0103\u0163i", 45, 1], - ["user\u0103\u0163i", 45, 1], - ["\u00e2ser\u0103\u0163i", 45, 1], - ["ir\u0103\u0163i", -1, 1], - ["ur\u0103\u0163i", -1, 1], - ["\u00e2r\u0103\u0163i", -1, 1], - ["am", -1, 1], - ["eam", 54, 1], - ["iam", 54, 1], - ["em", -1, 2], - ["asem", 57, 1], - ["sesem", 57, 2], - ["isem", 57, 1], - ["usem", 57, 1], - ["\u00e2sem", 57, 1], - ["im", -1, 2], - ["\u00e2m", -1, 2], - ["\u0103m", -1, 2], - ["ar\u0103m", 65, 1], - ["ser\u0103m", 65, 2], - ["aser\u0103m", 67, 1], - ["seser\u0103m", 67, 2], - ["iser\u0103m", 67, 1], - ["user\u0103m", 67, 1], - ["\u00e2ser\u0103m", 67, 1], - ["ir\u0103m", 65, 1], - ["ur\u0103m", 65, 1], - ["\u00e2r\u0103m", 65, 1], - ["au", -1, 1], - ["eau", 76, 1], - ["iau", 76, 1], - ["indu", -1, 1], - ["\u00e2ndu", -1, 1], - ["ez", -1, 1], - ["easc\u0103", -1, 1], - ["ar\u0103", -1, 1], - ["ser\u0103", -1, 2], - ["aser\u0103", 84, 1], - ["seser\u0103", 84, 2], - ["iser\u0103", 84, 1], - ["user\u0103", 84, 1], - ["\u00e2ser\u0103", 84, 1], - ["ir\u0103", -1, 1], - ["ur\u0103", -1, 1], - ["\u00e2r\u0103", -1, 1], - ["eaz\u0103", -1, 1], - ], - f = [ - ["a", -1, 1], - ["e", -1, 1], - ["ie", 1, 1], - ["i", -1, 1], - ["\u0103", -1, 1], - ], - q = [17, 65, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 32, 0, 0, 4], - t = p, - s = 0, - r = 0, - m = 0; - this.l = function () { - var b = c.cursor; - a: for (;;) { - var k = c.cursor; - b: { - c: for (;;) { - var n = c.cursor; - d: if (c.i(q, 97, 259)) { - c.c = c.cursor; - e: { - var v = c.cursor; - if (c.m("u") && ((c.d = c.cursor), c.i(q, 97, 259))) { - if (!c.b("U")) break a; - break e; - } - c.cursor = v; - if (!c.m("i")) break d; - c.d = c.cursor; - if (!c.i(q, 97, 259)) break d; - if (!c.b("I")) break a; - } - c.cursor = n; - break c; - } - c.cursor = n; - if (c.cursor >= c.a) break b; - c.cursor++; - } - continue; - } - c.cursor = k; - break; - } - c.cursor = b; - s = r = m = c.a; - b = c.cursor; - a: { - b: { - k = c.cursor; - c: if (c.i(q, 97, 259)) { - d: { - n = c.cursor; - e: if (c.k(q, 97, 259)) { - f: for (;;) { - if (c.i(q, 97, 259)) break f; - if (c.cursor >= c.a) break e; - c.cursor++; - } - break d; - } - c.cursor = n; - if (!c.i(q, 97, 259)) break c; - e: for (;;) { - if (c.k(q, 97, 259)) break e; - if (c.cursor >= c.a) break c; - c.cursor++; - } - } - break b; - } - c.cursor = k; - if (!c.k(q, 97, 259)) break a; - c: { - k = c.cursor; - d: if (c.k(q, 97, 259)) { - e: for (;;) { - if (c.i(q, 97, 259)) break e; - if (c.cursor >= c.a) break d; - c.cursor++; - } - break c; - } - c.cursor = k; - if (!c.i(q, 97, 259)) break a; - if (c.cursor >= c.a) break a; - c.cursor++; - } - } - m = c.cursor; - } - c.cursor = b; - b = c.cursor; - a: { - b: for (;;) { - if (c.i(q, 97, 259)) break b; - if (c.cursor >= c.a) break a; - c.cursor++; - } - b: for (;;) { - if (c.k(q, 97, 259)) break b; - if (c.cursor >= c.a) break a; - c.cursor++; - } - r = c.cursor; - b: for (;;) { - if (c.i(q, 97, 259)) break b; - if (c.cursor >= c.a) break a; - c.cursor++; - } - b: for (;;) { - if (c.k(q, 97, 259)) break b; - if (c.cursor >= c.a) break a; - c.cursor++; - } - s = c.cursor; - } - c.cursor = b; - c.f = c.cursor; - c.cursor = c.a; - b = c.a - c.cursor; - c.d = c.cursor; - k = c.h(d); - if (0 != k && ((c.c = c.cursor), r <= c.cursor)) - switch (k) { - case 1: - if (!c.e()) break; - break; - case 2: - if (!c.b("a")) break; - break; - case 3: - if (!c.b("e")) break; - break; - case 4: - if (!c.b("i")) break; - break; - case 5: - k = c.a - c.cursor; - if (c.g("ab")) break; - c.cursor = c.a - k; - if (!c.b("i")) break; - break; - case 6: - if (!c.b("at")) break; - break; - case 7: - c.b("a\u0163i"); - } - c.cursor = c.a - b; - b = c.a - c.cursor; - l(); - c.cursor = c.a - b; - b = c.a - c.cursor; - b: { - if (t) break b; - c.cursor = c.a - (c.a - c.cursor); - h(); - } - c.cursor = c.a - b; - b = c.a - c.cursor; - c.d = c.cursor; - 0 != c.h(f) && ((c.c = c.cursor), !(m <= c.cursor) || c.e()); - c.cursor = c.a - b; - c.cursor = c.f; - b = c.cursor; - a: for (;;) { - n = c.cursor; - b: if (((c.c = c.cursor), (k = c.o(a)), 0 != k)) { - c.d = c.cursor; - switch (k) { - case 1: - if (!c.b("i")) break a; - break; - case 2: - if (!c.b("u")) break a; - break; - case 3: - if (c.cursor >= c.a) break b; - c.cursor++; - } - continue; - } - c.cursor = n; - break; - } - c.cursor = b; - return g; - }; - this.stemWord = function (a) { - c.p(a); - this.l(); - return c.j; - }; -} - -const stemmerInstance = new stem(); - -export function stemmer(word) { - return stemmerInstance.stemWord(word); -} diff --git a/stemmer/lib/rs.d.ts b/stemmer/lib/rs.d.ts deleted file mode 100644 index 838f68c..0000000 --- a/stemmer/lib/rs.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare function stemmer(word: string): string; diff --git a/stemmer/lib/rs.js b/stemmer/lib/rs.js deleted file mode 100644 index 26d7317..0000000 --- a/stemmer/lib/rs.js +++ /dev/null @@ -1,3464 +0,0 @@ -/* - * ----------------------------------------------------------------------------- - * GENERATED FILE - DO NOT EDIT! - * This file has been compiled using the Snowball stemmer generator. - * Don't edit this file directly. - * ----------------------------------------------------------------------------- - */ - -var g = !0, - p = !1; - -function C() { - this.p = function (k) { - this.j = k; - this.cursor = 0; - this.a = this.j.length; - this.f = 0; - this.c = this.cursor; - this.d = this.a; - }; - this.z = function () { - return this.j; - }; - this.w = function (k) { - this.j = k.j; - this.cursor = k.cursor; - this.a = k.a; - this.f = k.f; - this.c = k.c; - this.d = k.d; - }; - this.i = function (k, l, h) { - if (this.cursor >= this.a) return p; - var c = this.j.charCodeAt(this.cursor); - if (c > h || c < l) return p; - c -= l; - if (0 == (k[c >>> 3] & (1 << (c & 7)))) return p; - this.cursor++; - return g; - }; - this.n = function (k, l, h) { - if (this.cursor <= this.f) return p; - var c = this.j.charCodeAt(this.cursor - 1); - if (c > h || c < l) return p; - c -= l; - if (0 == (k[c >>> 3] & (1 << (c & 7)))) return p; - this.cursor--; - return g; - }; - this.k = function (k, l, h) { - if (this.cursor >= this.a) return p; - var c = this.j.charCodeAt(this.cursor); - if (c > h || c < l) return this.cursor++, g; - c -= l; - return 0 == (k[c >>> 3] & (1 << (c & 7))) ? (this.cursor++, g) : p; - }; - this.q = function (k, l, h) { - if (this.cursor <= this.f) return p; - var c = this.j.charCodeAt(this.cursor - 1); - if (c > h || c < l) return this.cursor--, g; - c -= l; - return 0 == (k[c >>> 3] & (1 << (c & 7))) ? (this.cursor--, g) : p; - }; - this.m = function (k) { - if (this.a - this.cursor < k.length || this.j.slice(this.cursor, this.cursor + k.length) != k) return p; - this.cursor += k.length; - return g; - }; - this.g = function (k) { - if (this.cursor - this.f < k.length || this.j.slice(this.cursor - k.length, this.cursor) != k) return p; - this.cursor -= k.length; - return g; - }; - this.o = function (k) { - for (var l = 0, h = k.length, c = this.cursor, a = this.a, d = 0, n = 0, v = p; ; ) { - var b = l + ((h - l) >>> 1), - f = 0, - q = d < n ? d : n, - t = k[b], - s; - for (s = q; s < t[0].length; s++) { - if (c + q == a) { - f = -1; - break; - } - f = this.j.charCodeAt(c + q) - t[0].charCodeAt(s); - if (0 != f) break; - q++; - } - 0 > f ? ((h = b), (n = q)) : ((l = b), (d = q)); - if (1 >= h - l) { - if (0 < l) break; - if (h == l) break; - if (v) break; - v = g; - } - } - for (;;) { - t = k[l]; - if (d >= t[0].length) { - this.cursor = c + t[0].length; - if (4 > t.length) return t[2]; - l = t[3](this); - this.cursor = c + t[0].length; - if (l) return t[2]; - } - l = t[1]; - if (0 > l) return 0; - } - }; - this.h = function (k) { - for (var l = 0, h = k.length, c = this.cursor, a = this.f, d = 0, n = 0, v = p; ; ) { - var b = l + ((h - l) >> 1), - f = 0, - q = d < n ? d : n, - t = k[b], - s; - for (s = t[0].length - 1 - q; 0 <= s; s--) { - if (c - q == a) { - f = -1; - break; - } - f = this.j.charCodeAt(c - 1 - q) - t[0].charCodeAt(s); - if (0 != f) break; - q++; - } - 0 > f ? ((h = b), (n = q)) : ((l = b), (d = q)); - if (1 >= h - l) { - if (0 < l) break; - if (h == l) break; - if (v) break; - v = g; - } - } - for (;;) { - t = k[l]; - if (d >= t[0].length) { - this.cursor = c - t[0].length; - if (4 > t.length) return t[2]; - l = t[3](this); - this.cursor = c - t[0].length; - if (l) return t[2]; - } - l = t[1]; - if (0 > l) return 0; - } - }; - this.s = function (k, l, h) { - var c = h.length - (l - k); - this.j = this.j.slice(0, k) + h + this.j.slice(l); - this.a += c; - this.cursor >= l ? (this.cursor += c) : this.cursor > k && (this.cursor = k); - return c; - }; - this.t = function () { - return 0 > this.c || this.c > this.d || this.d > this.a || this.a > this.j.length ? p : g; - }; - this.b = function (k) { - var l = p; - this.t() && (this.s(this.c, this.d, k), (l = g)); - return l; - }; - this.e = function () { - return this.b(""); - }; - this.r = function (k, l, h) { - l = this.s(k, l, h); - k <= this.c && (this.c += l); - k <= this.d && (this.d += l); - }; - this.u = function () { - var k = ""; - this.t() && (k = this.j.slice(this.c, this.d)); - return k; - }; - this.v = function () { - return this.j.slice(0, this.a); - }; -} - -function stem() { - function k() { - var b, - d = c.cursor; - for (;;) { - var f = c.cursor; - b: { - c: for (;;) { - var k = c.cursor; - c.c = c.cursor; - b = c.o(a); - if (0 != b) { - c.d = c.cursor; - switch (b) { - case 1: - if (!c.b("a")) return; - break; - case 2: - if (!c.b("b")) return; - break; - case 3: - if (!c.b("v")) return; - break; - case 4: - if (!c.b("g")) return; - break; - case 5: - if (!c.b("d")) return; - break; - case 6: - if (!c.b("\u0111")) return; - break; - case 7: - if (!c.b("e")) return; - break; - case 8: - if (!c.b("\u017e")) return; - break; - case 9: - if (!c.b("z")) return; - break; - case 10: - if (!c.b("i")) return; - break; - case 11: - if (!c.b("j")) return; - break; - case 12: - if (!c.b("k")) return; - break; - case 13: - if (!c.b("l")) return; - break; - case 14: - if (!c.b("lj")) return; - break; - case 15: - if (!c.b("m")) return; - break; - case 16: - if (!c.b("n")) return; - break; - case 17: - if (!c.b("nj")) return; - break; - case 18: - if (!c.b("o")) return; - break; - case 19: - if (!c.b("p")) return; - break; - case 20: - if (!c.b("r")) return; - break; - case 21: - if (!c.b("s")) return; - break; - case 22: - if (!c.b("t")) return; - break; - case 23: - if (!c.b("\u0107")) return; - break; - case 24: - if (!c.b("u")) return; - break; - case 25: - if (!c.b("f")) return; - break; - case 26: - if (!c.b("h")) return; - break; - case 27: - if (!c.b("c")) return; - break; - case 28: - if (!c.b("\u010d")) return; - break; - case 29: - if (!c.b("d\u017e")) return; - break; - case 30: - if (!c.b("\u0161")) return; - } - c.cursor = k; - break c; - } - c.cursor = k; - if (c.cursor >= c.a) break b; - c.cursor++; - } - continue; - } - c.cursor = f; - break; - } - c.cursor = d; - } - function l() { - var a = c.cursor; - for (;;) { - var b = c.cursor; - b: { - c: for (;;) { - var d = c.cursor; - if (c.i(q, 98, 382) && ((c.c = c.cursor), c.m("ije") && ((c.d = c.cursor), c.i(q, 98, 382)))) { - if (!c.b("e")) return; - c.cursor = d; - break c; - } - c.cursor = d; - if (c.cursor >= c.a) break b; - c.cursor++; - } - continue; - } - c.cursor = b; - break; - } - c.cursor = a; - a = c.cursor; - for (;;) { - b = c.cursor; - b: { - c: for (;;) { - d = c.cursor; - if (c.i(q, 98, 382) && ((c.c = c.cursor), c.m("je") && ((c.d = c.cursor), c.i(q, 98, 382)))) { - if (!c.b("e")) return; - c.cursor = d; - break c; - } - c.cursor = d; - if (c.cursor >= c.a) break b; - c.cursor++; - } - continue; - } - c.cursor = b; - break; - } - c.cursor = a; - a = c.cursor; - for (;;) { - b = c.cursor; - b: { - c: for (;;) { - d = c.cursor; - c.c = c.cursor; - if (c.m("dj")) { - c.d = c.cursor; - if (!c.b("\u0111")) return; - c.cursor = d; - break c; - } - c.cursor = d; - if (c.cursor >= c.a) break b; - c.cursor++; - } - continue; - } - c.cursor = b; - break; - } - c.cursor = a; - } - function h() { - var a; - c.d = c.cursor; - a = c.h(n); - if (0 == a) return p; - c.c = c.cursor; - if (!(s <= c.cursor)) return p; - switch (a) { - case 1: - if (!c.b("sk")) return p; - break; - case 2: - if (!c.b("\u0161k")) return p; - break; - case 3: - if (!c.b("stv")) return p; - break; - case 4: - if (!c.b("\u0161tv")) return p; - break; - case 5: - if (!c.b("tanij")) return p; - break; - case 6: - if (!c.b("manij")) return p; - break; - case 7: - if (!c.b("panij")) return p; - break; - case 8: - if (!c.b("ranij")) return p; - break; - case 9: - if (!c.b("ganij")) return p; - break; - case 10: - if (!c.b("an")) return p; - break; - case 11: - if (!c.b("in")) return p; - break; - case 12: - if (!c.b("on")) return p; - break; - case 13: - if (!c.b("n")) return p; - break; - case 14: - if (!c.b("a\u0107")) return p; - break; - case 15: - if (!c.b("e\u0107")) return p; - break; - case 16: - if (!c.b("u\u0107")) return p; - break; - case 17: - if (!c.b("ugov")) return p; - break; - case 18: - if (!c.b("ug")) return p; - break; - case 19: - if (!c.b("log")) return p; - break; - case 20: - if (!c.b("g")) return p; - break; - case 21: - if (!c.b("rari")) return p; - break; - case 22: - if (!c.b("oti")) return p; - break; - case 23: - if (!c.b("si")) return p; - break; - case 24: - if (!c.b("li")) return p; - break; - case 25: - if (!c.b("uj")) return p; - break; - case 26: - if (!c.b("caj")) return p; - break; - case 27: - if (!c.b("\u010daj")) return p; - break; - case 28: - if (!c.b("\u0107aj")) return p; - break; - case 29: - if (!c.b("\u0111aj")) return p; - break; - case 30: - if (!c.b("laj")) return p; - break; - case 31: - if (!c.b("raj")) return p; - break; - case 32: - if (!c.b("bij")) return p; - break; - case 33: - if (!c.b("cij")) return p; - break; - case 34: - if (!c.b("dij")) return p; - break; - case 35: - if (!c.b("lij")) return p; - break; - case 36: - if (!c.b("nij")) return p; - break; - case 37: - if (!c.b("mij")) return p; - break; - case 38: - if (!c.b("\u017eij")) return p; - break; - case 39: - if (!c.b("gij")) return p; - break; - case 40: - if (!c.b("fij")) return p; - break; - case 41: - if (!c.b("pij")) return p; - break; - case 42: - if (!c.b("rij")) return p; - break; - case 43: - if (!c.b("sij")) return p; - break; - case 44: - if (!c.b("tij")) return p; - break; - case 45: - if (!c.b("zij")) return p; - break; - case 46: - if (!c.b("nal")) return p; - break; - case 47: - if (!c.b("ijal")) return p; - break; - case 48: - if (!c.b("ozil")) return p; - break; - case 49: - if (!c.b("olov")) return p; - break; - case 50: - if (!c.b("ol")) return p; - break; - case 51: - if (!c.b("lem")) return p; - break; - case 52: - if (!c.b("ram")) return p; - break; - case 53: - if (!c.b("ar")) return p; - break; - case 54: - if (!c.b("dr")) return p; - break; - case 55: - if (!c.b("er")) return p; - break; - case 56: - if (!c.b("or")) return p; - break; - case 57: - if (!c.b("es")) return p; - break; - case 58: - if (!c.b("is")) return p; - break; - case 59: - if (!c.b("ta\u0161")) return p; - break; - case 60: - if (!c.b("na\u0161")) return p; - break; - case 61: - if (!c.b("ja\u0161")) return p; - break; - case 62: - if (!c.b("ka\u0161")) return p; - break; - case 63: - if (!c.b("ba\u0161")) return p; - break; - case 64: - if (!c.b("ga\u0161")) return p; - break; - case 65: - if (!c.b("va\u0161")) return p; - break; - case 66: - if (!c.b("e\u0161")) return p; - break; - case 67: - if (!c.b("i\u0161")) return p; - break; - case 68: - if (!c.b("ikat")) return p; - break; - case 69: - if (!c.b("lat")) return p; - break; - case 70: - if (!c.b("et")) return p; - break; - case 71: - if (!c.b("est")) return p; - break; - case 72: - if (!c.b("ist")) return p; - break; - case 73: - if (!c.b("kst")) return p; - break; - case 74: - if (!c.b("ost")) return p; - break; - case 75: - if (!c.b("i\u0161t")) return p; - break; - case 76: - if (!c.b("ova")) return p; - break; - case 77: - if (!c.b("av")) return p; - break; - case 78: - if (!c.b("ev")) return p; - break; - case 79: - if (!c.b("iv")) return p; - break; - case 80: - if (!c.b("ov")) return p; - break; - case 81: - if (!c.b("mov")) return p; - break; - case 82: - if (!c.b("lov")) return p; - break; - case 83: - if (!c.b("el")) return p; - break; - case 84: - if (!c.b("anj")) return p; - break; - case 85: - if (!c.b("enj")) return p; - break; - case 86: - if (!c.b("\u0161nj")) return p; - break; - case 87: - if (!c.b("en")) return p; - break; - case 88: - if (!c.b("\u0161n")) return p; - break; - case 89: - if (!c.b("\u010din")) return p; - break; - case 90: - if (!c.b("ro\u0161i")) return p; - break; - case 91: - if (!c.b("o\u0161")) return p; - break; - case 92: - if (!c.b("evit")) return p; - break; - case 93: - if (!c.b("ovit")) return p; - break; - case 94: - if (!c.b("ast")) return p; - break; - case 95: - if (!c.b("k")) return p; - break; - case 96: - if (!c.b("eva")) return p; - break; - case 97: - if (!c.b("ava")) return p; - break; - case 98: - if (!c.b("iva")) return p; - break; - case 99: - if (!c.b("uva")) return p; - break; - case 100: - if (!c.b("ir")) return p; - break; - case 101: - if (!c.b("a\u010d")) return p; - break; - case 102: - if (!c.b("a\u010da")) return p; - break; - case 103: - if (!c.b("ni")) return p; - break; - case 104: - if (!c.b("a")) return p; - break; - case 105: - if (!c.b("ur")) return p; - break; - case 106: - if (!c.b("astaj")) return p; - break; - case 107: - if (!c.b("istaj")) return p; - break; - case 108: - if (!c.b("ostaj")) return p; - break; - case 109: - if (!c.b("aj")) return p; - break; - case 110: - if (!c.b("asta")) return p; - break; - case 111: - if (!c.b("ista")) return p; - break; - case 112: - if (!c.b("osta")) return p; - break; - case 113: - if (!c.b("ta")) return p; - break; - case 114: - if (!c.b("inj")) return p; - break; - case 115: - if (!c.b("as")) return p; - break; - case 116: - if (!c.b("i")) return p; - break; - case 117: - if (!c.b("lu\u010d")) return p; - break; - case 118: - if (!c.b("jeti")) return p; - break; - case 119: - if (!c.b("e")) return p; - break; - case 120: - if (!c.b("at")) return p; - break; - case 121: - if (!r || !c.b("luc")) return p; - break; - case 122: - if (!r || !c.b("snj")) return p; - break; - case 123: - if (!r || !c.b("os")) return p; - break; - case 124: - if (!r || !c.b("ac")) return p; - break; - case 125: - if (!r || !c.b("ec")) return p; - break; - case 126: - if (!r || !c.b("uc")) return p; - break; - case 127: - if (!r || !c.b("rosi")) return p; - break; - case 128: - if (!r || !c.b("aca")) return p; - break; - case 129: - if (!r || !c.b("jas")) return p; - break; - case 130: - if (!r || !c.b("tas")) return p; - break; - case 131: - if (!r || !c.b("gas")) return p; - break; - case 132: - if (!r || !c.b("nas")) return p; - break; - case 133: - if (!r || !c.b("kas")) return p; - break; - case 134: - if (!r || !c.b("vas")) return p; - break; - case 135: - if (!r || !c.b("bas")) return p; - break; - case 136: - if (!r || !c.b("as")) return p; - break; - case 137: - if (!r || !c.b("cin")) return p; - break; - case 138: - if (!r || !c.b("astaj")) return p; - break; - case 139: - if (!r || !c.b("istaj")) return p; - break; - case 140: - if (!r || !c.b("ostaj")) return p; - break; - case 141: - if (!r || !c.b("asta")) return p; - break; - case 142: - if (!r || !c.b("ista")) return p; - break; - case 143: - if (!r || !c.b("osta")) return p; - break; - case 144: - if (!r || !c.b("ava")) return p; - break; - case 145: - if (!r || !c.b("eva")) return p; - break; - case 146: - if (!r || !c.b("iva")) return p; - break; - case 147: - if (!r || !c.b("uva")) return p; - break; - case 148: - if (!r || !c.b("ova")) return p; - break; - case 149: - if (!r || !c.b("jeti")) return p; - break; - case 150: - if (!r || !c.b("inj")) return p; - break; - case 151: - if (!r || !c.b("ist")) return p; - break; - case 152: - if (!r || !c.b("es")) return p; - break; - case 153: - if (!r || !c.b("et")) return p; - break; - case 154: - if (!r || !c.b("is")) return p; - break; - case 155: - if (!r || !c.b("ir")) return p; - break; - case 156: - if (!r || !c.b("ur")) return p; - break; - case 157: - if (!r || !c.b("uj")) return p; - break; - case 158: - if (!r || !c.b("ni")) return p; - break; - case 159: - if (!r || !c.b("sn")) return p; - break; - case 160: - if (!r || !c.b("ta")) return p; - break; - case 161: - if (!r || !c.b("a")) return p; - break; - case 162: - if (!r || !c.b("i")) return p; - break; - case 163: - if (!r || !c.b("e")) return p; - break; - case 164: - if (!r || !c.b("n")) return p; - } - return g; - } - var c = new C(), - a = [ - ["\u0430", -1, 1], - ["\u0431", -1, 2], - ["\u0432", -1, 3], - ["\u0433", -1, 4], - ["\u0434", -1, 5], - ["\u0435", -1, 7], - ["\u0436", -1, 8], - ["\u0437", -1, 9], - ["\u0438", -1, 10], - ["\u043a", -1, 12], - ["\u043b", -1, 13], - ["\u043c", -1, 15], - ["\u043d", -1, 16], - ["\u043e", -1, 18], - ["\u043f", -1, 19], - ["\u0440", -1, 20], - ["\u0441", -1, 21], - ["\u0442", -1, 22], - ["\u0443", -1, 24], - ["\u0444", -1, 25], - ["\u0445", -1, 26], - ["\u0446", -1, 27], - ["\u0447", -1, 28], - ["\u0448", -1, 30], - ["\u0452", -1, 6], - ["\u0458", -1, 11], - ["\u0459", -1, 14], - ["\u045a", -1, 17], - ["\u045b", -1, 23], - ["\u045f", -1, 29], - ], - d = [ - ["daba", -1, 73], - ["ajaca", -1, 12], - ["ejaca", -1, 14], - ["ljaca", -1, 13], - ["njaca", -1, 85], - ["ojaca", -1, 15], - ["alaca", -1, 82], - ["elaca", -1, 83], - ["olaca", -1, 84], - ["maca", -1, 75], - ["naca", -1, 76], - ["raca", -1, 81], - ["saca", -1, 80], - ["vaca", -1, 79], - ["\u0161aca", -1, 18], - ["aoca", -1, 82], - ["acaka", -1, 55], - ["ajaka", -1, 16], - ["ojaka", -1, 17], - ["anaka", -1, 78], - ["ataka", -1, 58], - ["etaka", -1, 59], - ["itaka", -1, 60], - ["otaka", -1, 61], - ["utaka", -1, 62], - ["a\u010daka", -1, 54], - ["esama", -1, 67], - ["izama", -1, 87], - ["jacima", -1, 5], - ["nicima", -1, 23], - ["ticima", -1, 24], - ["teticima", 30, 21], - ["zicima", -1, 25], - ["atcima", -1, 58], - ["utcima", -1, 62], - ["\u010dcima", -1, 74], - ["pesima", -1, 2], - ["inzima", -1, 19], - ["lozima", -1, 1], - ["metara", -1, 68], - ["centara", -1, 69], - ["istara", -1, 70], - ["ekata", -1, 86], - ["anata", -1, 53], - ["nstava", -1, 22], - ["kustava", -1, 29], - ["ajac", -1, 12], - ["ejac", -1, 14], - ["ljac", -1, 13], - ["njac", -1, 85], - ["anjac", 49, 11], - ["ojac", -1, 15], - ["alac", -1, 82], - ["elac", -1, 83], - ["olac", -1, 84], - ["mac", -1, 75], - ["nac", -1, 76], - ["rac", -1, 81], - ["sac", -1, 80], - ["vac", -1, 79], - ["\u0161ac", -1, 18], - ["jebe", -1, 88], - ["olce", -1, 84], - ["kuse", -1, 27], - ["rave", -1, 42], - ["save", -1, 52], - ["\u0161ave", -1, 51], - ["baci", -1, 89], - ["jaci", -1, 5], - ["tvenici", -1, 20], - ["snici", -1, 26], - ["tetici", -1, 21], - ["bojci", -1, 4], - ["vojci", -1, 3], - ["ojsci", -1, 66], - ["atci", -1, 58], - ["itci", -1, 60], - ["utci", -1, 62], - ["\u010dci", -1, 74], - ["pesi", -1, 2], - ["inzi", -1, 19], - ["lozi", -1, 1], - ["acak", -1, 55], - ["usak", -1, 57], - ["atak", -1, 58], - ["etak", -1, 59], - ["itak", -1, 60], - ["otak", -1, 61], - ["utak", -1, 62], - ["a\u010dak", -1, 54], - ["u\u0161ak", -1, 56], - ["izam", -1, 87], - ["tican", -1, 65], - ["cajan", -1, 7], - ["\u010dajan", -1, 6], - ["voljan", -1, 77], - ["eskan", -1, 63], - ["alan", -1, 40], - ["bilan", -1, 33], - ["gilan", -1, 37], - ["nilan", -1, 39], - ["rilan", -1, 38], - ["silan", -1, 36], - ["tilan", -1, 34], - ["avilan", -1, 35], - ["laran", -1, 9], - ["eran", -1, 8], - ["asan", -1, 91], - ["esan", -1, 10], - ["dusan", -1, 31], - ["kusan", -1, 28], - ["atan", -1, 47], - ["pletan", -1, 50], - ["tetan", -1, 49], - ["antan", -1, 32], - ["pravan", -1, 44], - ["stavan", -1, 43], - ["sivan", -1, 46], - ["tivan", -1, 45], - ["ozan", -1, 41], - ["ti\u010dan", -1, 64], - ["a\u0161an", -1, 90], - ["du\u0161an", -1, 30], - ["metar", -1, 68], - ["centar", -1, 69], - ["istar", -1, 70], - ["ekat", -1, 86], - ["enat", -1, 48], - ["oscu", -1, 72], - ["o\u0161\u0107u", -1, 71], - ], - n = [ - ["aca", -1, 124], - ["eca", -1, 125], - ["uca", -1, 126], - ["ga", -1, 20], - ["acega", 3, 124], - ["ecega", 3, 125], - ["ucega", 3, 126], - ["anjijega", 3, 84], - ["enjijega", 3, 85], - ["snjijega", 3, 122], - ["\u0161njijega", 3, 86], - ["kijega", 3, 95], - ["skijega", 11, 1], - ["\u0161kijega", 11, 2], - ["elijega", 3, 83], - ["nijega", 3, 13], - ["osijega", 3, 123], - ["atijega", 3, 120], - ["evitijega", 3, 92], - ["ovitijega", 3, 93], - ["astijega", 3, 94], - ["avijega", 3, 77], - ["evijega", 3, 78], - ["ivijega", 3, 79], - ["ovijega", 3, 80], - ["o\u0161ijega", 3, 91], - ["anjega", 3, 84], - ["enjega", 3, 85], - ["snjega", 3, 122], - ["\u0161njega", 3, 86], - ["kega", 3, 95], - ["skega", 30, 1], - ["\u0161kega", 30, 2], - ["elega", 3, 83], - ["nega", 3, 13], - ["anega", 34, 10], - ["enega", 34, 87], - ["snega", 34, 159], - ["\u0161nega", 34, 88], - ["osega", 3, 123], - ["atega", 3, 120], - ["evitega", 3, 92], - ["ovitega", 3, 93], - ["astega", 3, 94], - ["avega", 3, 77], - ["evega", 3, 78], - ["ivega", 3, 79], - ["ovega", 3, 80], - ["a\u0107ega", 3, 14], - ["e\u0107ega", 3, 15], - ["u\u0107ega", 3, 16], - ["o\u0161ega", 3, 91], - ["acoga", 3, 124], - ["ecoga", 3, 125], - ["ucoga", 3, 126], - ["anjoga", 3, 84], - ["enjoga", 3, 85], - ["snjoga", 3, 122], - ["\u0161njoga", 3, 86], - ["koga", 3, 95], - ["skoga", 59, 1], - ["\u0161koga", 59, 2], - ["loga", 3, 19], - ["eloga", 62, 83], - ["noga", 3, 13], - ["cinoga", 64, 137], - ["\u010dinoga", 64, 89], - ["osoga", 3, 123], - ["atoga", 3, 120], - ["evitoga", 3, 92], - ["ovitoga", 3, 93], - ["astoga", 3, 94], - ["avoga", 3, 77], - ["evoga", 3, 78], - ["ivoga", 3, 79], - ["ovoga", 3, 80], - ["a\u0107oga", 3, 14], - ["e\u0107oga", 3, 15], - ["u\u0107oga", 3, 16], - ["o\u0161oga", 3, 91], - ["uga", 3, 18], - ["aja", -1, 109], - ["caja", 81, 26], - ["laja", 81, 30], - ["raja", 81, 31], - ["\u0107aja", 81, 28], - ["\u010daja", 81, 27], - ["\u0111aja", 81, 29], - ["bija", -1, 32], - ["cija", -1, 33], - ["dija", -1, 34], - ["fija", -1, 40], - ["gija", -1, 39], - ["anjija", -1, 84], - ["enjija", -1, 85], - ["snjija", -1, 122], - ["\u0161njija", -1, 86], - ["kija", -1, 95], - ["skija", 97, 1], - ["\u0161kija", 97, 2], - ["lija", -1, 24], - ["elija", 100, 83], - ["mija", -1, 37], - ["nija", -1, 13], - ["ganija", 103, 9], - ["manija", 103, 6], - ["panija", 103, 7], - ["ranija", 103, 8], - ["tanija", 103, 5], - ["pija", -1, 41], - ["rija", -1, 42], - ["rarija", 110, 21], - ["sija", -1, 23], - ["osija", 112, 123], - ["tija", -1, 44], - ["atija", 114, 120], - ["evitija", 114, 92], - ["ovitija", 114, 93], - ["otija", 114, 22], - ["astija", 114, 94], - ["avija", -1, 77], - ["evija", -1, 78], - ["ivija", -1, 79], - ["ovija", -1, 80], - ["zija", -1, 45], - ["o\u0161ija", -1, 91], - ["\u017eija", -1, 38], - ["anja", -1, 84], - ["enja", -1, 85], - ["snja", -1, 122], - ["\u0161nja", -1, 86], - ["ka", -1, 95], - ["ska", 131, 1], - ["\u0161ka", 131, 2], - ["ala", -1, 104], - ["acala", 134, 128], - ["astajala", 134, 106], - ["istajala", 134, 107], - ["ostajala", 134, 108], - ["ijala", 134, 47], - ["injala", 134, 114], - ["nala", 134, 46], - ["irala", 134, 100], - ["urala", 134, 105], - ["tala", 134, 113], - ["astala", 144, 110], - ["istala", 144, 111], - ["ostala", 144, 112], - ["avala", 134, 97], - ["evala", 134, 96], - ["ivala", 134, 98], - ["ovala", 134, 76], - ["uvala", 134, 99], - ["a\u010dala", 134, 102], - ["ela", -1, 83], - ["ila", -1, 116], - ["acila", 155, 124], - ["lucila", 155, 121], - ["nila", 155, 103], - ["astanila", 158, 110], - ["istanila", 158, 111], - ["ostanila", 158, 112], - ["rosila", 155, 127], - ["jetila", 155, 118], - ["ozila", 155, 48], - ["a\u010dila", 155, 101], - ["lu\u010dila", 155, 117], - ["ro\u0161ila", 155, 90], - ["ola", -1, 50], - ["asla", -1, 115], - ["nula", -1, 13], - ["gama", -1, 20], - ["logama", 171, 19], - ["ugama", 171, 18], - ["ajama", -1, 109], - ["cajama", 174, 26], - ["lajama", 174, 30], - ["rajama", 174, 31], - ["\u0107ajama", 174, 28], - ["\u010dajama", 174, 27], - ["\u0111ajama", 174, 29], - ["bijama", -1, 32], - ["cijama", -1, 33], - ["dijama", -1, 34], - ["fijama", -1, 40], - ["gijama", -1, 39], - ["lijama", -1, 35], - ["mijama", -1, 37], - ["nijama", -1, 36], - ["ganijama", 188, 9], - ["manijama", 188, 6], - ["panijama", 188, 7], - ["ranijama", 188, 8], - ["tanijama", 188, 5], - ["pijama", -1, 41], - ["rijama", -1, 42], - ["sijama", -1, 43], - ["tijama", -1, 44], - ["zijama", -1, 45], - ["\u017eijama", -1, 38], - ["alama", -1, 104], - ["ijalama", 200, 47], - ["nalama", 200, 46], - ["elama", -1, 119], - ["ilama", -1, 116], - ["ramama", -1, 52], - ["lemama", -1, 51], - ["inama", -1, 11], - ["cinama", 207, 137], - ["\u010dinama", 207, 89], - ["rama", -1, 52], - ["arama", 210, 53], - ["drama", 210, 54], - ["erama", 210, 55], - ["orama", 210, 56], - ["basama", -1, 135], - ["gasama", -1, 131], - ["jasama", -1, 129], - ["kasama", -1, 133], - ["nasama", -1, 132], - ["tasama", -1, 130], - ["vasama", -1, 134], - ["esama", -1, 152], - ["isama", -1, 154], - ["etama", -1, 70], - ["estama", -1, 71], - ["istama", -1, 72], - ["kstama", -1, 73], - ["ostama", -1, 74], - ["avama", -1, 77], - ["evama", -1, 78], - ["ivama", -1, 79], - ["ba\u0161ama", -1, 63], - ["ga\u0161ama", -1, 64], - ["ja\u0161ama", -1, 61], - ["ka\u0161ama", -1, 62], - ["na\u0161ama", -1, 60], - ["ta\u0161ama", -1, 59], - ["va\u0161ama", -1, 65], - ["e\u0161ama", -1, 66], - ["i\u0161ama", -1, 67], - ["lema", -1, 51], - ["acima", -1, 124], - ["ecima", -1, 125], - ["ucima", -1, 126], - ["ajima", -1, 109], - ["cajima", 245, 26], - ["lajima", 245, 30], - ["rajima", 245, 31], - ["\u0107ajima", 245, 28], - ["\u010dajima", 245, 27], - ["\u0111ajima", 245, 29], - ["bijima", -1, 32], - ["cijima", -1, 33], - ["dijima", -1, 34], - ["fijima", -1, 40], - ["gijima", -1, 39], - ["anjijima", -1, 84], - ["enjijima", -1, 85], - ["snjijima", -1, 122], - ["\u0161njijima", -1, 86], - ["kijima", -1, 95], - ["skijima", 261, 1], - ["\u0161kijima", 261, 2], - ["lijima", -1, 35], - ["elijima", 264, 83], - ["mijima", -1, 37], - ["nijima", -1, 13], - ["ganijima", 267, 9], - ["manijima", 267, 6], - ["panijima", 267, 7], - ["ranijima", 267, 8], - ["tanijima", 267, 5], - ["pijima", -1, 41], - ["rijima", -1, 42], - ["sijima", -1, 43], - ["osijima", 275, 123], - ["tijima", -1, 44], - ["atijima", 277, 120], - ["evitijima", 277, 92], - ["ovitijima", 277, 93], - ["astijima", 277, 94], - ["avijima", -1, 77], - ["evijima", -1, 78], - ["ivijima", -1, 79], - ["ovijima", -1, 80], - ["zijima", -1, 45], - ["o\u0161ijima", -1, 91], - ["\u017eijima", -1, 38], - ["anjima", -1, 84], - ["enjima", -1, 85], - ["snjima", -1, 122], - ["\u0161njima", -1, 86], - ["kima", -1, 95], - ["skima", 293, 1], - ["\u0161kima", 293, 2], - ["alima", -1, 104], - ["ijalima", 296, 47], - ["nalima", 296, 46], - ["elima", -1, 83], - ["ilima", -1, 116], - ["ozilima", 300, 48], - ["olima", -1, 50], - ["lemima", -1, 51], - ["nima", -1, 13], - ["anima", 304, 10], - ["inima", 304, 11], - ["cinima", 306, 137], - ["\u010dinima", 306, 89], - ["onima", 304, 12], - ["arima", -1, 53], - ["drima", -1, 54], - ["erima", -1, 55], - ["orima", -1, 56], - ["basima", -1, 135], - ["gasima", -1, 131], - ["jasima", -1, 129], - ["kasima", -1, 133], - ["nasima", -1, 132], - ["tasima", -1, 130], - ["vasima", -1, 134], - ["esima", -1, 57], - ["isima", -1, 58], - ["osima", -1, 123], - ["atima", -1, 120], - ["ikatima", 324, 68], - ["latima", 324, 69], - ["etima", -1, 70], - ["evitima", -1, 92], - ["ovitima", -1, 93], - ["astima", -1, 94], - ["estima", -1, 71], - ["istima", -1, 72], - ["kstima", -1, 73], - ["ostima", -1, 74], - ["i\u0161tima", -1, 75], - ["avima", -1, 77], - ["evima", -1, 78], - ["ajevima", 337, 109], - ["cajevima", 338, 26], - ["lajevima", 338, 30], - ["rajevima", 338, 31], - ["\u0107ajevima", 338, 28], - ["\u010dajevima", 338, 27], - ["\u0111ajevima", 338, 29], - ["ivima", -1, 79], - ["ovima", -1, 80], - ["govima", 346, 20], - ["ugovima", 347, 17], - ["lovima", 346, 82], - ["olovima", 349, 49], - ["movima", 346, 81], - ["onovima", 346, 12], - ["stvima", -1, 3], - ["\u0161tvima", -1, 4], - ["a\u0107ima", -1, 14], - ["e\u0107ima", -1, 15], - ["u\u0107ima", -1, 16], - ["ba\u0161ima", -1, 63], - ["ga\u0161ima", -1, 64], - ["ja\u0161ima", -1, 61], - ["ka\u0161ima", -1, 62], - ["na\u0161ima", -1, 60], - ["ta\u0161ima", -1, 59], - ["va\u0161ima", -1, 65], - ["e\u0161ima", -1, 66], - ["i\u0161ima", -1, 67], - ["o\u0161ima", -1, 91], - ["na", -1, 13], - ["ana", 368, 10], - ["acana", 369, 128], - ["urana", 369, 105], - ["tana", 369, 113], - ["avana", 369, 97], - ["evana", 369, 96], - ["ivana", 369, 98], - ["uvana", 369, 99], - ["a\u010dana", 369, 102], - ["acena", 368, 124], - ["lucena", 368, 121], - ["a\u010dena", 368, 101], - ["lu\u010dena", 368, 117], - ["ina", 368, 11], - ["cina", 382, 137], - ["anina", 382, 10], - ["\u010dina", 382, 89], - ["ona", 368, 12], - ["ara", -1, 53], - ["dra", -1, 54], - ["era", -1, 55], - ["ora", -1, 56], - ["basa", -1, 135], - ["gasa", -1, 131], - ["jasa", -1, 129], - ["kasa", -1, 133], - ["nasa", -1, 132], - ["tasa", -1, 130], - ["vasa", -1, 134], - ["esa", -1, 57], - ["isa", -1, 58], - ["osa", -1, 123], - ["ata", -1, 120], - ["ikata", 401, 68], - ["lata", 401, 69], - ["eta", -1, 70], - ["evita", -1, 92], - ["ovita", -1, 93], - ["asta", -1, 94], - ["esta", -1, 71], - ["ista", -1, 72], - ["ksta", -1, 73], - ["osta", -1, 74], - ["nuta", -1, 13], - ["i\u0161ta", -1, 75], - ["ava", -1, 77], - ["eva", -1, 78], - ["ajeva", 415, 109], - ["cajeva", 416, 26], - ["lajeva", 416, 30], - ["rajeva", 416, 31], - ["\u0107ajeva", 416, 28], - ["\u010dajeva", 416, 27], - ["\u0111ajeva", 416, 29], - ["iva", -1, 79], - ["ova", -1, 80], - ["gova", 424, 20], - ["ugova", 425, 17], - ["lova", 424, 82], - ["olova", 427, 49], - ["mova", 424, 81], - ["onova", 424, 12], - ["stva", -1, 3], - ["\u0161tva", -1, 4], - ["a\u0107a", -1, 14], - ["e\u0107a", -1, 15], - ["u\u0107a", -1, 16], - ["ba\u0161a", -1, 63], - ["ga\u0161a", -1, 64], - ["ja\u0161a", -1, 61], - ["ka\u0161a", -1, 62], - ["na\u0161a", -1, 60], - ["ta\u0161a", -1, 59], - ["va\u0161a", -1, 65], - ["e\u0161a", -1, 66], - ["i\u0161a", -1, 67], - ["o\u0161a", -1, 91], - ["ace", -1, 124], - ["ece", -1, 125], - ["uce", -1, 126], - ["luce", 448, 121], - ["astade", -1, 110], - ["istade", -1, 111], - ["ostade", -1, 112], - ["ge", -1, 20], - ["loge", 453, 19], - ["uge", 453, 18], - ["aje", -1, 104], - ["caje", 456, 26], - ["laje", 456, 30], - ["raje", 456, 31], - ["astaje", 456, 106], - ["istaje", 456, 107], - ["ostaje", 456, 108], - ["\u0107aje", 456, 28], - ["\u010daje", 456, 27], - ["\u0111aje", 456, 29], - ["ije", -1, 116], - ["bije", 466, 32], - ["cije", 466, 33], - ["dije", 466, 34], - ["fije", 466, 40], - ["gije", 466, 39], - ["anjije", 466, 84], - ["enjije", 466, 85], - ["snjije", 466, 122], - ["\u0161njije", 466, 86], - ["kije", 466, 95], - ["skije", 476, 1], - ["\u0161kije", 476, 2], - ["lije", 466, 35], - ["elije", 479, 83], - ["mije", 466, 37], - ["nije", 466, 13], - ["ganije", 482, 9], - ["manije", 482, 6], - ["panije", 482, 7], - ["ranije", 482, 8], - ["tanije", 482, 5], - ["pije", 466, 41], - ["rije", 466, 42], - ["sije", 466, 43], - ["osije", 490, 123], - ["tije", 466, 44], - ["atije", 492, 120], - ["evitije", 492, 92], - ["ovitije", 492, 93], - ["astije", 492, 94], - ["avije", 466, 77], - ["evije", 466, 78], - ["ivije", 466, 79], - ["ovije", 466, 80], - ["zije", 466, 45], - ["o\u0161ije", 466, 91], - ["\u017eije", 466, 38], - ["anje", -1, 84], - ["enje", -1, 85], - ["snje", -1, 122], - ["\u0161nje", -1, 86], - ["uje", -1, 25], - ["lucuje", 508, 121], - ["iruje", 508, 100], - ["lu\u010duje", 508, 117], - ["ke", -1, 95], - ["ske", 512, 1], - ["\u0161ke", 512, 2], - ["ale", -1, 104], - ["acale", 515, 128], - ["astajale", 515, 106], - ["istajale", 515, 107], - ["ostajale", 515, 108], - ["ijale", 515, 47], - ["injale", 515, 114], - ["nale", 515, 46], - ["irale", 515, 100], - ["urale", 515, 105], - ["tale", 515, 113], - ["astale", 525, 110], - ["istale", 525, 111], - ["ostale", 525, 112], - ["avale", 515, 97], - ["evale", 515, 96], - ["ivale", 515, 98], - ["ovale", 515, 76], - ["uvale", 515, 99], - ["a\u010dale", 515, 102], - ["ele", -1, 83], - ["ile", -1, 116], - ["acile", 536, 124], - ["lucile", 536, 121], - ["nile", 536, 103], - ["rosile", 536, 127], - ["jetile", 536, 118], - ["ozile", 536, 48], - ["a\u010dile", 536, 101], - ["lu\u010dile", 536, 117], - ["ro\u0161ile", 536, 90], - ["ole", -1, 50], - ["asle", -1, 115], - ["nule", -1, 13], - ["rame", -1, 52], - ["leme", -1, 51], - ["acome", -1, 124], - ["ecome", -1, 125], - ["ucome", -1, 126], - ["anjome", -1, 84], - ["enjome", -1, 85], - ["snjome", -1, 122], - ["\u0161njome", -1, 86], - ["kome", -1, 95], - ["skome", 558, 1], - ["\u0161kome", 558, 2], - ["elome", -1, 83], - ["nome", -1, 13], - ["cinome", 562, 137], - ["\u010dinome", 562, 89], - ["osome", -1, 123], - ["atome", -1, 120], - ["evitome", -1, 92], - ["ovitome", -1, 93], - ["astome", -1, 94], - ["avome", -1, 77], - ["evome", -1, 78], - ["ivome", -1, 79], - ["ovome", -1, 80], - ["a\u0107ome", -1, 14], - ["e\u0107ome", -1, 15], - ["u\u0107ome", -1, 16], - ["o\u0161ome", -1, 91], - ["ne", -1, 13], - ["ane", 578, 10], - ["acane", 579, 128], - ["urane", 579, 105], - ["tane", 579, 113], - ["astane", 582, 110], - ["istane", 582, 111], - ["ostane", 582, 112], - ["avane", 579, 97], - ["evane", 579, 96], - ["ivane", 579, 98], - ["uvane", 579, 99], - ["a\u010dane", 579, 102], - ["acene", 578, 124], - ["lucene", 578, 121], - ["a\u010dene", 578, 101], - ["lu\u010dene", 578, 117], - ["ine", 578, 11], - ["cine", 595, 137], - ["anine", 595, 10], - ["\u010dine", 595, 89], - ["one", 578, 12], - ["are", -1, 53], - ["dre", -1, 54], - ["ere", -1, 55], - ["ore", -1, 56], - ["ase", -1, 161], - ["base", 604, 135], - ["acase", 604, 128], - ["gase", 604, 131], - ["jase", 604, 129], - ["astajase", 608, 138], - ["istajase", 608, 139], - ["ostajase", 608, 140], - ["injase", 608, 150], - ["kase", 604, 133], - ["nase", 604, 132], - ["irase", 604, 155], - ["urase", 604, 156], - ["tase", 604, 130], - ["vase", 604, 134], - ["avase", 618, 144], - ["evase", 618, 145], - ["ivase", 618, 146], - ["ovase", 618, 148], - ["uvase", 618, 147], - ["ese", -1, 57], - ["ise", -1, 58], - ["acise", 625, 124], - ["lucise", 625, 121], - ["rosise", 625, 127], - ["jetise", 625, 149], - ["ose", -1, 123], - ["astadose", 630, 141], - ["istadose", 630, 142], - ["ostadose", 630, 143], - ["ate", -1, 104], - ["acate", 634, 128], - ["ikate", 634, 68], - ["late", 634, 69], - ["irate", 634, 100], - ["urate", 634, 105], - ["tate", 634, 113], - ["avate", 634, 97], - ["evate", 634, 96], - ["ivate", 634, 98], - ["uvate", 634, 99], - ["a\u010date", 634, 102], - ["ete", -1, 70], - ["astadete", 646, 110], - ["istadete", 646, 111], - ["ostadete", 646, 112], - ["astajete", 646, 106], - ["istajete", 646, 107], - ["ostajete", 646, 108], - ["ijete", 646, 116], - ["injete", 646, 114], - ["ujete", 646, 25], - ["lucujete", 655, 121], - ["irujete", 655, 100], - ["lu\u010dujete", 655, 117], - ["nete", 646, 13], - ["astanete", 659, 110], - ["istanete", 659, 111], - ["ostanete", 659, 112], - ["astete", 646, 115], - ["ite", -1, 116], - ["acite", 664, 124], - ["lucite", 664, 121], - ["nite", 664, 13], - ["astanite", 667, 110], - ["istanite", 667, 111], - ["ostanite", 667, 112], - ["rosite", 664, 127], - ["jetite", 664, 118], - ["astite", 664, 115], - ["evite", 664, 92], - ["ovite", 664, 93], - ["a\u010dite", 664, 101], - ["lu\u010dite", 664, 117], - ["ro\u0161ite", 664, 90], - ["ajte", -1, 104], - ["urajte", 679, 105], - ["tajte", 679, 113], - ["astajte", 681, 106], - ["istajte", 681, 107], - ["ostajte", 681, 108], - ["avajte", 679, 97], - ["evajte", 679, 96], - ["ivajte", 679, 98], - ["uvajte", 679, 99], - ["ijte", -1, 116], - ["lucujte", -1, 121], - ["irujte", -1, 100], - ["lu\u010dujte", -1, 117], - ["aste", -1, 94], - ["acaste", 693, 128], - ["astajaste", 693, 106], - ["istajaste", 693, 107], - ["ostajaste", 693, 108], - ["injaste", 693, 114], - ["iraste", 693, 100], - ["uraste", 693, 105], - ["taste", 693, 113], - ["avaste", 693, 97], - ["evaste", 693, 96], - ["ivaste", 693, 98], - ["ovaste", 693, 76], - ["uvaste", 693, 99], - ["a\u010daste", 693, 102], - ["este", -1, 71], - ["iste", -1, 72], - ["aciste", 709, 124], - ["luciste", 709, 121], - ["niste", 709, 103], - ["rosiste", 709, 127], - ["jetiste", 709, 118], - ["a\u010diste", 709, 101], - ["lu\u010diste", 709, 117], - ["ro\u0161iste", 709, 90], - ["kste", -1, 73], - ["oste", -1, 74], - ["astadoste", 719, 110], - ["istadoste", 719, 111], - ["ostadoste", 719, 112], - ["nuste", -1, 13], - ["i\u0161te", -1, 75], - ["ave", -1, 77], - ["eve", -1, 78], - ["ajeve", 726, 109], - ["cajeve", 727, 26], - ["lajeve", 727, 30], - ["rajeve", 727, 31], - ["\u0107ajeve", 727, 28], - ["\u010dajeve", 727, 27], - ["\u0111ajeve", 727, 29], - ["ive", -1, 79], - ["ove", -1, 80], - ["gove", 735, 20], - ["ugove", 736, 17], - ["love", 735, 82], - ["olove", 738, 49], - ["move", 735, 81], - ["onove", 735, 12], - ["a\u0107e", -1, 14], - ["e\u0107e", -1, 15], - ["u\u0107e", -1, 16], - ["a\u010de", -1, 101], - ["lu\u010de", -1, 117], - ["a\u0161e", -1, 104], - ["ba\u0161e", 747, 63], - ["ga\u0161e", 747, 64], - ["ja\u0161e", 747, 61], - ["astaja\u0161e", 750, 106], - ["istaja\u0161e", 750, 107], - ["ostaja\u0161e", 750, 108], - ["inja\u0161e", 750, 114], - ["ka\u0161e", 747, 62], - ["na\u0161e", 747, 60], - ["ira\u0161e", 747, 100], - ["ura\u0161e", 747, 105], - ["ta\u0161e", 747, 59], - ["va\u0161e", 747, 65], - ["ava\u0161e", 760, 97], - ["eva\u0161e", 760, 96], - ["iva\u0161e", 760, 98], - ["ova\u0161e", 760, 76], - ["uva\u0161e", 760, 99], - ["a\u010da\u0161e", 747, 102], - ["e\u0161e", -1, 66], - ["i\u0161e", -1, 67], - ["jeti\u0161e", 768, 118], - ["a\u010di\u0161e", 768, 101], - ["lu\u010di\u0161e", 768, 117], - ["ro\u0161i\u0161e", 768, 90], - ["o\u0161e", -1, 91], - ["astado\u0161e", 773, 110], - ["istado\u0161e", 773, 111], - ["ostado\u0161e", 773, 112], - ["aceg", -1, 124], - ["eceg", -1, 125], - ["uceg", -1, 126], - ["anjijeg", -1, 84], - ["enjijeg", -1, 85], - ["snjijeg", -1, 122], - ["\u0161njijeg", -1, 86], - ["kijeg", -1, 95], - ["skijeg", 784, 1], - ["\u0161kijeg", 784, 2], - ["elijeg", -1, 83], - ["nijeg", -1, 13], - ["osijeg", -1, 123], - ["atijeg", -1, 120], - ["evitijeg", -1, 92], - ["ovitijeg", -1, 93], - ["astijeg", -1, 94], - ["avijeg", -1, 77], - ["evijeg", -1, 78], - ["ivijeg", -1, 79], - ["ovijeg", -1, 80], - ["o\u0161ijeg", -1, 91], - ["anjeg", -1, 84], - ["enjeg", -1, 85], - ["snjeg", -1, 122], - ["\u0161njeg", -1, 86], - ["keg", -1, 95], - ["eleg", -1, 83], - ["neg", -1, 13], - ["aneg", 805, 10], - ["eneg", 805, 87], - ["sneg", 805, 159], - ["\u0161neg", 805, 88], - ["oseg", -1, 123], - ["ateg", -1, 120], - ["aveg", -1, 77], - ["eveg", -1, 78], - ["iveg", -1, 79], - ["oveg", -1, 80], - ["a\u0107eg", -1, 14], - ["e\u0107eg", -1, 15], - ["u\u0107eg", -1, 16], - ["o\u0161eg", -1, 91], - ["acog", -1, 124], - ["ecog", -1, 125], - ["ucog", -1, 126], - ["anjog", -1, 84], - ["enjog", -1, 85], - ["snjog", -1, 122], - ["\u0161njog", -1, 86], - ["kog", -1, 95], - ["skog", 827, 1], - ["\u0161kog", 827, 2], - ["elog", -1, 83], - ["nog", -1, 13], - ["cinog", 831, 137], - ["\u010dinog", 831, 89], - ["osog", -1, 123], - ["atog", -1, 120], - ["evitog", -1, 92], - ["ovitog", -1, 93], - ["astog", -1, 94], - ["avog", -1, 77], - ["evog", -1, 78], - ["ivog", -1, 79], - ["ovog", -1, 80], - ["a\u0107og", -1, 14], - ["e\u0107og", -1, 15], - ["u\u0107og", -1, 16], - ["o\u0161og", -1, 91], - ["ah", -1, 104], - ["acah", 847, 128], - ["astajah", 847, 106], - ["istajah", 847, 107], - ["ostajah", 847, 108], - ["injah", 847, 114], - ["irah", 847, 100], - ["urah", 847, 105], - ["tah", 847, 113], - ["avah", 847, 97], - ["evah", 847, 96], - ["ivah", 847, 98], - ["ovah", 847, 76], - ["uvah", 847, 99], - ["a\u010dah", 847, 102], - ["ih", -1, 116], - ["acih", 862, 124], - ["ecih", 862, 125], - ["ucih", 862, 126], - ["lucih", 865, 121], - ["anjijih", 862, 84], - ["enjijih", 862, 85], - ["snjijih", 862, 122], - ["\u0161njijih", 862, 86], - ["kijih", 862, 95], - ["skijih", 871, 1], - ["\u0161kijih", 871, 2], - ["elijih", 862, 83], - ["nijih", 862, 13], - ["osijih", 862, 123], - ["atijih", 862, 120], - ["evitijih", 862, 92], - ["ovitijih", 862, 93], - ["astijih", 862, 94], - ["avijih", 862, 77], - ["evijih", 862, 78], - ["ivijih", 862, 79], - ["ovijih", 862, 80], - ["o\u0161ijih", 862, 91], - ["anjih", 862, 84], - ["enjih", 862, 85], - ["snjih", 862, 122], - ["\u0161njih", 862, 86], - ["kih", 862, 95], - ["skih", 890, 1], - ["\u0161kih", 890, 2], - ["elih", 862, 83], - ["nih", 862, 13], - ["cinih", 894, 137], - ["\u010dinih", 894, 89], - ["osih", 862, 123], - ["rosih", 897, 127], - ["atih", 862, 120], - ["jetih", 862, 118], - ["evitih", 862, 92], - ["ovitih", 862, 93], - ["astih", 862, 94], - ["avih", 862, 77], - ["evih", 862, 78], - ["ivih", 862, 79], - ["ovih", 862, 80], - ["a\u0107ih", 862, 14], - ["e\u0107ih", 862, 15], - ["u\u0107ih", 862, 16], - ["a\u010dih", 862, 101], - ["lu\u010dih", 862, 117], - ["o\u0161ih", 862, 91], - ["ro\u0161ih", 913, 90], - ["astadoh", -1, 110], - ["istadoh", -1, 111], - ["ostadoh", -1, 112], - ["acuh", -1, 124], - ["ecuh", -1, 125], - ["ucuh", -1, 126], - ["a\u0107uh", -1, 14], - ["e\u0107uh", -1, 15], - ["u\u0107uh", -1, 16], - ["aci", -1, 124], - ["aceci", -1, 124], - ["ieci", -1, 162], - ["ajuci", -1, 161], - ["irajuci", 927, 155], - ["urajuci", 927, 156], - ["astajuci", 927, 138], - ["istajuci", 927, 139], - ["ostajuci", 927, 140], - ["avajuci", 927, 144], - ["evajuci", 927, 145], - ["ivajuci", 927, 146], - ["uvajuci", 927, 147], - ["ujuci", -1, 157], - ["lucujuci", 937, 121], - ["irujuci", 937, 155], - ["luci", -1, 121], - ["nuci", -1, 164], - ["etuci", -1, 153], - ["astuci", -1, 136], - ["gi", -1, 20], - ["ugi", 944, 18], - ["aji", -1, 109], - ["caji", 946, 26], - ["laji", 946, 30], - ["raji", 946, 31], - ["\u0107aji", 946, 28], - ["\u010daji", 946, 27], - ["\u0111aji", 946, 29], - ["biji", -1, 32], - ["ciji", -1, 33], - ["diji", -1, 34], - ["fiji", -1, 40], - ["giji", -1, 39], - ["anjiji", -1, 84], - ["enjiji", -1, 85], - ["snjiji", -1, 122], - ["\u0161njiji", -1, 86], - ["kiji", -1, 95], - ["skiji", 962, 1], - ["\u0161kiji", 962, 2], - ["liji", -1, 35], - ["eliji", 965, 83], - ["miji", -1, 37], - ["niji", -1, 13], - ["ganiji", 968, 9], - ["maniji", 968, 6], - ["paniji", 968, 7], - ["raniji", 968, 8], - ["taniji", 968, 5], - ["piji", -1, 41], - ["riji", -1, 42], - ["siji", -1, 43], - ["osiji", 976, 123], - ["tiji", -1, 44], - ["atiji", 978, 120], - ["evitiji", 978, 92], - ["ovitiji", 978, 93], - ["astiji", 978, 94], - ["aviji", -1, 77], - ["eviji", -1, 78], - ["iviji", -1, 79], - ["oviji", -1, 80], - ["ziji", -1, 45], - ["o\u0161iji", -1, 91], - ["\u017eiji", -1, 38], - ["anji", -1, 84], - ["enji", -1, 85], - ["snji", -1, 122], - ["\u0161nji", -1, 86], - ["ki", -1, 95], - ["ski", 994, 1], - ["\u0161ki", 994, 2], - ["ali", -1, 104], - ["acali", 997, 128], - ["astajali", 997, 106], - ["istajali", 997, 107], - ["ostajali", 997, 108], - ["ijali", 997, 47], - ["injali", 997, 114], - ["nali", 997, 46], - ["irali", 997, 100], - ["urali", 997, 105], - ["tali", 997, 113], - ["astali", 1007, 110], - ["istali", 1007, 111], - ["ostali", 1007, 112], - ["avali", 997, 97], - ["evali", 997, 96], - ["ivali", 997, 98], - ["ovali", 997, 76], - ["uvali", 997, 99], - ["a\u010dali", 997, 102], - ["eli", -1, 83], - ["ili", -1, 116], - ["acili", 1018, 124], - ["lucili", 1018, 121], - ["nili", 1018, 103], - ["rosili", 1018, 127], - ["jetili", 1018, 118], - ["ozili", 1018, 48], - ["a\u010dili", 1018, 101], - ["lu\u010dili", 1018, 117], - ["ro\u0161ili", 1018, 90], - ["oli", -1, 50], - ["asli", -1, 115], - ["nuli", -1, 13], - ["rami", -1, 52], - ["lemi", -1, 51], - ["ni", -1, 13], - ["ani", 1033, 10], - ["acani", 1034, 128], - ["urani", 1034, 105], - ["tani", 1034, 113], - ["avani", 1034, 97], - ["evani", 1034, 96], - ["ivani", 1034, 98], - ["uvani", 1034, 99], - ["a\u010dani", 1034, 102], - ["aceni", 1033, 124], - ["luceni", 1033, 121], - ["a\u010deni", 1033, 101], - ["lu\u010deni", 1033, 117], - ["ini", 1033, 11], - ["cini", 1047, 137], - ["\u010dini", 1047, 89], - ["oni", 1033, 12], - ["ari", -1, 53], - ["dri", -1, 54], - ["eri", -1, 55], - ["ori", -1, 56], - ["basi", -1, 135], - ["gasi", -1, 131], - ["jasi", -1, 129], - ["kasi", -1, 133], - ["nasi", -1, 132], - ["tasi", -1, 130], - ["vasi", -1, 134], - ["esi", -1, 152], - ["isi", -1, 154], - ["osi", -1, 123], - ["avsi", -1, 161], - ["acavsi", 1065, 128], - ["iravsi", 1065, 155], - ["tavsi", 1065, 160], - ["etavsi", 1068, 153], - ["astavsi", 1068, 141], - ["istavsi", 1068, 142], - ["ostavsi", 1068, 143], - ["ivsi", -1, 162], - ["nivsi", 1073, 158], - ["rosivsi", 1073, 127], - ["nuvsi", -1, 164], - ["ati", -1, 104], - ["acati", 1077, 128], - ["astajati", 1077, 106], - ["istajati", 1077, 107], - ["ostajati", 1077, 108], - ["injati", 1077, 114], - ["ikati", 1077, 68], - ["lati", 1077, 69], - ["irati", 1077, 100], - ["urati", 1077, 105], - ["tati", 1077, 113], - ["astati", 1087, 110], - ["istati", 1087, 111], - ["ostati", 1087, 112], - ["avati", 1077, 97], - ["evati", 1077, 96], - ["ivati", 1077, 98], - ["ovati", 1077, 76], - ["uvati", 1077, 99], - ["a\u010dati", 1077, 102], - ["eti", -1, 70], - ["iti", -1, 116], - ["aciti", 1098, 124], - ["luciti", 1098, 121], - ["niti", 1098, 103], - ["rositi", 1098, 127], - ["jetiti", 1098, 118], - ["eviti", 1098, 92], - ["oviti", 1098, 93], - ["a\u010diti", 1098, 101], - ["lu\u010diti", 1098, 117], - ["ro\u0161iti", 1098, 90], - ["asti", -1, 94], - ["esti", -1, 71], - ["isti", -1, 72], - ["ksti", -1, 73], - ["osti", -1, 74], - ["nuti", -1, 13], - ["avi", -1, 77], - ["evi", -1, 78], - ["ajevi", 1116, 109], - ["cajevi", 1117, 26], - ["lajevi", 1117, 30], - ["rajevi", 1117, 31], - ["\u0107ajevi", 1117, 28], - ["\u010dajevi", 1117, 27], - ["\u0111ajevi", 1117, 29], - ["ivi", -1, 79], - ["ovi", -1, 80], - ["govi", 1125, 20], - ["ugovi", 1126, 17], - ["lovi", 1125, 82], - ["olovi", 1128, 49], - ["movi", 1125, 81], - ["onovi", 1125, 12], - ["ie\u0107i", -1, 116], - ["a\u010de\u0107i", -1, 101], - ["aju\u0107i", -1, 104], - ["iraju\u0107i", 1134, 100], - ["uraju\u0107i", 1134, 105], - ["astaju\u0107i", 1134, 106], - ["istaju\u0107i", 1134, 107], - ["ostaju\u0107i", 1134, 108], - ["avaju\u0107i", 1134, 97], - ["evaju\u0107i", 1134, 96], - ["ivaju\u0107i", 1134, 98], - ["uvaju\u0107i", 1134, 99], - ["uju\u0107i", -1, 25], - ["iruju\u0107i", 1144, 100], - ["lu\u010duju\u0107i", 1144, 117], - ["nu\u0107i", -1, 13], - ["etu\u0107i", -1, 70], - ["astu\u0107i", -1, 115], - ["a\u010di", -1, 101], - ["lu\u010di", -1, 117], - ["ba\u0161i", -1, 63], - ["ga\u0161i", -1, 64], - ["ja\u0161i", -1, 61], - ["ka\u0161i", -1, 62], - ["na\u0161i", -1, 60], - ["ta\u0161i", -1, 59], - ["va\u0161i", -1, 65], - ["e\u0161i", -1, 66], - ["i\u0161i", -1, 67], - ["o\u0161i", -1, 91], - ["av\u0161i", -1, 104], - ["irav\u0161i", 1162, 100], - ["tav\u0161i", 1162, 113], - ["etav\u0161i", 1164, 70], - ["astav\u0161i", 1164, 110], - ["istav\u0161i", 1164, 111], - ["ostav\u0161i", 1164, 112], - ["a\u010dav\u0161i", 1162, 102], - ["iv\u0161i", -1, 116], - ["niv\u0161i", 1170, 103], - ["ro\u0161iv\u0161i", 1170, 90], - ["nuv\u0161i", -1, 13], - ["aj", -1, 104], - ["uraj", 1174, 105], - ["taj", 1174, 113], - ["avaj", 1174, 97], - ["evaj", 1174, 96], - ["ivaj", 1174, 98], - ["uvaj", 1174, 99], - ["ij", -1, 116], - ["acoj", -1, 124], - ["ecoj", -1, 125], - ["ucoj", -1, 126], - ["anjijoj", -1, 84], - ["enjijoj", -1, 85], - ["snjijoj", -1, 122], - ["\u0161njijoj", -1, 86], - ["kijoj", -1, 95], - ["skijoj", 1189, 1], - ["\u0161kijoj", 1189, 2], - ["elijoj", -1, 83], - ["nijoj", -1, 13], - ["osijoj", -1, 123], - ["evitijoj", -1, 92], - ["ovitijoj", -1, 93], - ["astijoj", -1, 94], - ["avijoj", -1, 77], - ["evijoj", -1, 78], - ["ivijoj", -1, 79], - ["ovijoj", -1, 80], - ["o\u0161ijoj", -1, 91], - ["anjoj", -1, 84], - ["enjoj", -1, 85], - ["snjoj", -1, 122], - ["\u0161njoj", -1, 86], - ["koj", -1, 95], - ["skoj", 1207, 1], - ["\u0161koj", 1207, 2], - ["aloj", -1, 104], - ["eloj", -1, 83], - ["noj", -1, 13], - ["cinoj", 1212, 137], - ["\u010dinoj", 1212, 89], - ["osoj", -1, 123], - ["atoj", -1, 120], - ["evitoj", -1, 92], - ["ovitoj", -1, 93], - ["astoj", -1, 94], - ["avoj", -1, 77], - ["evoj", -1, 78], - ["ivoj", -1, 79], - ["ovoj", -1, 80], - ["a\u0107oj", -1, 14], - ["e\u0107oj", -1, 15], - ["u\u0107oj", -1, 16], - ["o\u0161oj", -1, 91], - ["lucuj", -1, 121], - ["iruj", -1, 100], - ["lu\u010duj", -1, 117], - ["al", -1, 104], - ["iral", 1231, 100], - ["ural", 1231, 105], - ["el", -1, 119], - ["il", -1, 116], - ["am", -1, 104], - ["acam", 1236, 128], - ["iram", 1236, 100], - ["uram", 1236, 105], - ["tam", 1236, 113], - ["avam", 1236, 97], - ["evam", 1236, 96], - ["ivam", 1236, 98], - ["uvam", 1236, 99], - ["a\u010dam", 1236, 102], - ["em", -1, 119], - ["acem", 1246, 124], - ["ecem", 1246, 125], - ["ucem", 1246, 126], - ["astadem", 1246, 110], - ["istadem", 1246, 111], - ["ostadem", 1246, 112], - ["ajem", 1246, 104], - ["cajem", 1253, 26], - ["lajem", 1253, 30], - ["rajem", 1253, 31], - ["astajem", 1253, 106], - ["istajem", 1253, 107], - ["ostajem", 1253, 108], - ["\u0107ajem", 1253, 28], - ["\u010dajem", 1253, 27], - ["\u0111ajem", 1253, 29], - ["ijem", 1246, 116], - ["anjijem", 1263, 84], - ["enjijem", 1263, 85], - ["snjijem", 1263, 123], - ["\u0161njijem", 1263, 86], - ["kijem", 1263, 95], - ["skijem", 1268, 1], - ["\u0161kijem", 1268, 2], - ["lijem", 1263, 24], - ["elijem", 1271, 83], - ["nijem", 1263, 13], - ["rarijem", 1263, 21], - ["sijem", 1263, 23], - ["osijem", 1275, 123], - ["atijem", 1263, 120], - ["evitijem", 1263, 92], - ["ovitijem", 1263, 93], - ["otijem", 1263, 22], - ["astijem", 1263, 94], - ["avijem", 1263, 77], - ["evijem", 1263, 78], - ["ivijem", 1263, 79], - ["ovijem", 1263, 80], - ["o\u0161ijem", 1263, 91], - ["anjem", 1246, 84], - ["enjem", 1246, 85], - ["injem", 1246, 114], - ["snjem", 1246, 122], - ["\u0161njem", 1246, 86], - ["ujem", 1246, 25], - ["lucujem", 1292, 121], - ["irujem", 1292, 100], - ["lu\u010dujem", 1292, 117], - ["kem", 1246, 95], - ["skem", 1296, 1], - ["\u0161kem", 1296, 2], - ["elem", 1246, 83], - ["nem", 1246, 13], - ["anem", 1300, 10], - ["astanem", 1301, 110], - ["istanem", 1301, 111], - ["ostanem", 1301, 112], - ["enem", 1300, 87], - ["snem", 1300, 159], - ["\u0161nem", 1300, 88], - ["basem", 1246, 135], - ["gasem", 1246, 131], - ["jasem", 1246, 129], - ["kasem", 1246, 133], - ["nasem", 1246, 132], - ["tasem", 1246, 130], - ["vasem", 1246, 134], - ["esem", 1246, 152], - ["isem", 1246, 154], - ["osem", 1246, 123], - ["atem", 1246, 120], - ["etem", 1246, 70], - ["evitem", 1246, 92], - ["ovitem", 1246, 93], - ["astem", 1246, 94], - ["istem", 1246, 151], - ["i\u0161tem", 1246, 75], - ["avem", 1246, 77], - ["evem", 1246, 78], - ["ivem", 1246, 79], - ["a\u0107em", 1246, 14], - ["e\u0107em", 1246, 15], - ["u\u0107em", 1246, 16], - ["ba\u0161em", 1246, 63], - ["ga\u0161em", 1246, 64], - ["ja\u0161em", 1246, 61], - ["ka\u0161em", 1246, 62], - ["na\u0161em", 1246, 60], - ["ta\u0161em", 1246, 59], - ["va\u0161em", 1246, 65], - ["e\u0161em", 1246, 66], - ["i\u0161em", 1246, 67], - ["o\u0161em", 1246, 91], - ["im", -1, 116], - ["acim", 1341, 124], - ["ecim", 1341, 125], - ["ucim", 1341, 126], - ["lucim", 1344, 121], - ["anjijim", 1341, 84], - ["enjijim", 1341, 85], - ["snjijim", 1341, 122], - ["\u0161njijim", 1341, 86], - ["kijim", 1341, 95], - ["skijim", 1350, 1], - ["\u0161kijim", 1350, 2], - ["elijim", 1341, 83], - ["nijim", 1341, 13], - ["osijim", 1341, 123], - ["atijim", 1341, 120], - ["evitijim", 1341, 92], - ["ovitijim", 1341, 93], - ["astijim", 1341, 94], - ["avijim", 1341, 77], - ["evijim", 1341, 78], - ["ivijim", 1341, 79], - ["ovijim", 1341, 80], - ["o\u0161ijim", 1341, 91], - ["anjim", 1341, 84], - ["enjim", 1341, 85], - ["snjim", 1341, 122], - ["\u0161njim", 1341, 86], - ["kim", 1341, 95], - ["skim", 1369, 1], - ["\u0161kim", 1369, 2], - ["elim", 1341, 83], - ["nim", 1341, 13], - ["cinim", 1373, 137], - ["\u010dinim", 1373, 89], - ["osim", 1341, 123], - ["rosim", 1376, 127], - ["atim", 1341, 120], - ["jetim", 1341, 118], - ["evitim", 1341, 92], - ["ovitim", 1341, 93], - ["astim", 1341, 94], - ["avim", 1341, 77], - ["evim", 1341, 78], - ["ivim", 1341, 79], - ["ovim", 1341, 80], - ["a\u0107im", 1341, 14], - ["e\u0107im", 1341, 15], - ["u\u0107im", 1341, 16], - ["a\u010dim", 1341, 101], - ["lu\u010dim", 1341, 117], - ["o\u0161im", 1341, 91], - ["ro\u0161im", 1392, 90], - ["acom", -1, 124], - ["ecom", -1, 125], - ["ucom", -1, 126], - ["gom", -1, 20], - ["logom", 1397, 19], - ["ugom", 1397, 18], - ["bijom", -1, 32], - ["cijom", -1, 33], - ["dijom", -1, 34], - ["fijom", -1, 40], - ["gijom", -1, 39], - ["lijom", -1, 35], - ["mijom", -1, 37], - ["nijom", -1, 36], - ["ganijom", 1407, 9], - ["manijom", 1407, 6], - ["panijom", 1407, 7], - ["ranijom", 1407, 8], - ["tanijom", 1407, 5], - ["pijom", -1, 41], - ["rijom", -1, 42], - ["sijom", -1, 43], - ["tijom", -1, 44], - ["zijom", -1, 45], - ["\u017eijom", -1, 38], - ["anjom", -1, 84], - ["enjom", -1, 85], - ["snjom", -1, 122], - ["\u0161njom", -1, 86], - ["kom", -1, 95], - ["skom", 1423, 1], - ["\u0161kom", 1423, 2], - ["alom", -1, 104], - ["ijalom", 1426, 47], - ["nalom", 1426, 46], - ["elom", -1, 83], - ["ilom", -1, 116], - ["ozilom", 1430, 48], - ["olom", -1, 50], - ["ramom", -1, 52], - ["lemom", -1, 51], - ["nom", -1, 13], - ["anom", 1435, 10], - ["inom", 1435, 11], - ["cinom", 1437, 137], - ["aninom", 1437, 10], - ["\u010dinom", 1437, 89], - ["onom", 1435, 12], - ["arom", -1, 53], - ["drom", -1, 54], - ["erom", -1, 55], - ["orom", -1, 56], - ["basom", -1, 135], - ["gasom", -1, 131], - ["jasom", -1, 129], - ["kasom", -1, 133], - ["nasom", -1, 132], - ["tasom", -1, 130], - ["vasom", -1, 134], - ["esom", -1, 57], - ["isom", -1, 58], - ["osom", -1, 123], - ["atom", -1, 120], - ["ikatom", 1456, 68], - ["latom", 1456, 69], - ["etom", -1, 70], - ["evitom", -1, 92], - ["ovitom", -1, 93], - ["astom", -1, 94], - ["estom", -1, 71], - ["istom", -1, 72], - ["kstom", -1, 73], - ["ostom", -1, 74], - ["avom", -1, 77], - ["evom", -1, 78], - ["ivom", -1, 79], - ["ovom", -1, 80], - ["lovom", 1470, 82], - ["movom", 1470, 81], - ["stvom", -1, 3], - ["\u0161tvom", -1, 4], - ["a\u0107om", -1, 14], - ["e\u0107om", -1, 15], - ["u\u0107om", -1, 16], - ["ba\u0161om", -1, 63], - ["ga\u0161om", -1, 64], - ["ja\u0161om", -1, 61], - ["ka\u0161om", -1, 62], - ["na\u0161om", -1, 60], - ["ta\u0161om", -1, 59], - ["va\u0161om", -1, 65], - ["e\u0161om", -1, 66], - ["i\u0161om", -1, 67], - ["o\u0161om", -1, 91], - ["an", -1, 104], - ["acan", 1488, 128], - ["iran", 1488, 100], - ["uran", 1488, 105], - ["tan", 1488, 113], - ["avan", 1488, 97], - ["evan", 1488, 96], - ["ivan", 1488, 98], - ["uvan", 1488, 99], - ["a\u010dan", 1488, 102], - ["acen", -1, 124], - ["lucen", -1, 121], - ["a\u010den", -1, 101], - ["lu\u010den", -1, 117], - ["anin", -1, 10], - ["ao", -1, 104], - ["acao", 1503, 128], - ["astajao", 1503, 106], - ["istajao", 1503, 107], - ["ostajao", 1503, 108], - ["injao", 1503, 114], - ["irao", 1503, 100], - ["urao", 1503, 105], - ["tao", 1503, 113], - ["astao", 1511, 110], - ["istao", 1511, 111], - ["ostao", 1511, 112], - ["avao", 1503, 97], - ["evao", 1503, 96], - ["ivao", 1503, 98], - ["ovao", 1503, 76], - ["uvao", 1503, 99], - ["a\u010dao", 1503, 102], - ["go", -1, 20], - ["ugo", 1521, 18], - ["io", -1, 116], - ["acio", 1523, 124], - ["lucio", 1523, 121], - ["lio", 1523, 24], - ["nio", 1523, 103], - ["rario", 1523, 21], - ["sio", 1523, 23], - ["rosio", 1529, 127], - ["jetio", 1523, 118], - ["otio", 1523, 22], - ["a\u010dio", 1523, 101], - ["lu\u010dio", 1523, 117], - ["ro\u0161io", 1523, 90], - ["bijo", -1, 32], - ["cijo", -1, 33], - ["dijo", -1, 34], - ["fijo", -1, 40], - ["gijo", -1, 39], - ["lijo", -1, 35], - ["mijo", -1, 37], - ["nijo", -1, 36], - ["pijo", -1, 41], - ["rijo", -1, 42], - ["sijo", -1, 43], - ["tijo", -1, 44], - ["zijo", -1, 45], - ["\u017eijo", -1, 38], - ["anjo", -1, 84], - ["enjo", -1, 85], - ["snjo", -1, 122], - ["\u0161njo", -1, 86], - ["ko", -1, 95], - ["sko", 1554, 1], - ["\u0161ko", 1554, 2], - ["alo", -1, 104], - ["acalo", 1557, 128], - ["astajalo", 1557, 106], - ["istajalo", 1557, 107], - ["ostajalo", 1557, 108], - ["ijalo", 1557, 47], - ["injalo", 1557, 114], - ["nalo", 1557, 46], - ["iralo", 1557, 100], - ["uralo", 1557, 105], - ["talo", 1557, 113], - ["astalo", 1567, 110], - ["istalo", 1567, 111], - ["ostalo", 1567, 112], - ["avalo", 1557, 97], - ["evalo", 1557, 96], - ["ivalo", 1557, 98], - ["ovalo", 1557, 76], - ["uvalo", 1557, 99], - ["a\u010dalo", 1557, 102], - ["elo", -1, 83], - ["ilo", -1, 116], - ["acilo", 1578, 124], - ["lucilo", 1578, 121], - ["nilo", 1578, 103], - ["rosilo", 1578, 127], - ["jetilo", 1578, 118], - ["a\u010dilo", 1578, 101], - ["lu\u010dilo", 1578, 117], - ["ro\u0161ilo", 1578, 90], - ["aslo", -1, 115], - ["nulo", -1, 13], - ["amo", -1, 104], - ["acamo", 1589, 128], - ["ramo", 1589, 52], - ["iramo", 1591, 100], - ["uramo", 1591, 105], - ["tamo", 1589, 113], - ["avamo", 1589, 97], - ["evamo", 1589, 96], - ["ivamo", 1589, 98], - ["uvamo", 1589, 99], - ["a\u010damo", 1589, 102], - ["emo", -1, 119], - ["astademo", 1600, 110], - ["istademo", 1600, 111], - ["ostademo", 1600, 112], - ["astajemo", 1600, 106], - ["istajemo", 1600, 107], - ["ostajemo", 1600, 108], - ["ijemo", 1600, 116], - ["injemo", 1600, 114], - ["ujemo", 1600, 25], - ["lucujemo", 1609, 121], - ["irujemo", 1609, 100], - ["lu\u010dujemo", 1609, 117], - ["lemo", 1600, 51], - ["nemo", 1600, 13], - ["astanemo", 1614, 110], - ["istanemo", 1614, 111], - ["ostanemo", 1614, 112], - ["etemo", 1600, 70], - ["astemo", 1600, 115], - ["imo", -1, 116], - ["acimo", 1620, 124], - ["lucimo", 1620, 121], - ["nimo", 1620, 13], - ["astanimo", 1623, 110], - ["istanimo", 1623, 111], - ["ostanimo", 1623, 112], - ["rosimo", 1620, 127], - ["etimo", 1620, 70], - ["jetimo", 1628, 118], - ["astimo", 1620, 115], - ["a\u010dimo", 1620, 101], - ["lu\u010dimo", 1620, 117], - ["ro\u0161imo", 1620, 90], - ["ajmo", -1, 104], - ["urajmo", 1634, 105], - ["tajmo", 1634, 113], - ["astajmo", 1636, 106], - ["istajmo", 1636, 107], - ["ostajmo", 1636, 108], - ["avajmo", 1634, 97], - ["evajmo", 1634, 96], - ["ivajmo", 1634, 98], - ["uvajmo", 1634, 99], - ["ijmo", -1, 116], - ["ujmo", -1, 25], - ["lucujmo", 1645, 121], - ["irujmo", 1645, 100], - ["lu\u010dujmo", 1645, 117], - ["asmo", -1, 104], - ["acasmo", 1649, 128], - ["astajasmo", 1649, 106], - ["istajasmo", 1649, 107], - ["ostajasmo", 1649, 108], - ["injasmo", 1649, 114], - ["irasmo", 1649, 100], - ["urasmo", 1649, 105], - ["tasmo", 1649, 113], - ["avasmo", 1649, 97], - ["evasmo", 1649, 96], - ["ivasmo", 1649, 98], - ["ovasmo", 1649, 76], - ["uvasmo", 1649, 99], - ["a\u010dasmo", 1649, 102], - ["ismo", -1, 116], - ["acismo", 1664, 124], - ["lucismo", 1664, 121], - ["nismo", 1664, 103], - ["rosismo", 1664, 127], - ["jetismo", 1664, 118], - ["a\u010dismo", 1664, 101], - ["lu\u010dismo", 1664, 117], - ["ro\u0161ismo", 1664, 90], - ["astadosmo", -1, 110], - ["istadosmo", -1, 111], - ["ostadosmo", -1, 112], - ["nusmo", -1, 13], - ["no", -1, 13], - ["ano", 1677, 104], - ["acano", 1678, 128], - ["urano", 1678, 105], - ["tano", 1678, 113], - ["avano", 1678, 97], - ["evano", 1678, 96], - ["ivano", 1678, 98], - ["uvano", 1678, 99], - ["a\u010dano", 1678, 102], - ["aceno", 1677, 124], - ["luceno", 1677, 121], - ["a\u010deno", 1677, 101], - ["lu\u010deno", 1677, 117], - ["ino", 1677, 11], - ["cino", 1691, 137], - ["\u010dino", 1691, 89], - ["ato", -1, 120], - ["ikato", 1694, 68], - ["lato", 1694, 69], - ["eto", -1, 70], - ["evito", -1, 92], - ["ovito", -1, 93], - ["asto", -1, 94], - ["esto", -1, 71], - ["isto", -1, 72], - ["ksto", -1, 73], - ["osto", -1, 74], - ["nuto", -1, 13], - ["nuo", -1, 13], - ["avo", -1, 77], - ["evo", -1, 78], - ["ivo", -1, 79], - ["ovo", -1, 80], - ["stvo", -1, 3], - ["\u0161tvo", -1, 4], - ["as", -1, 161], - ["acas", 1713, 128], - ["iras", 1713, 155], - ["uras", 1713, 156], - ["tas", 1713, 160], - ["avas", 1713, 144], - ["evas", 1713, 145], - ["ivas", 1713, 146], - ["uvas", 1713, 147], - ["es", -1, 163], - ["astades", 1722, 141], - ["istades", 1722, 142], - ["ostades", 1722, 143], - ["astajes", 1722, 138], - ["istajes", 1722, 139], - ["ostajes", 1722, 140], - ["ijes", 1722, 162], - ["injes", 1722, 150], - ["ujes", 1722, 157], - ["lucujes", 1731, 121], - ["irujes", 1731, 155], - ["nes", 1722, 164], - ["astanes", 1734, 141], - ["istanes", 1734, 142], - ["ostanes", 1734, 143], - ["etes", 1722, 153], - ["astes", 1722, 136], - ["is", -1, 162], - ["acis", 1740, 124], - ["lucis", 1740, 121], - ["nis", 1740, 158], - ["rosis", 1740, 127], - ["jetis", 1740, 149], - ["at", -1, 104], - ["acat", 1746, 128], - ["astajat", 1746, 106], - ["istajat", 1746, 107], - ["ostajat", 1746, 108], - ["injat", 1746, 114], - ["irat", 1746, 100], - ["urat", 1746, 105], - ["tat", 1746, 113], - ["astat", 1754, 110], - ["istat", 1754, 111], - ["ostat", 1754, 112], - ["avat", 1746, 97], - ["evat", 1746, 96], - ["ivat", 1746, 98], - ["irivat", 1760, 100], - ["ovat", 1746, 76], - ["uvat", 1746, 99], - ["a\u010dat", 1746, 102], - ["it", -1, 116], - ["acit", 1765, 124], - ["lucit", 1765, 121], - ["rosit", 1765, 127], - ["jetit", 1765, 118], - ["a\u010dit", 1765, 101], - ["lu\u010dit", 1765, 117], - ["ro\u0161it", 1765, 90], - ["nut", -1, 13], - ["astadu", -1, 110], - ["istadu", -1, 111], - ["ostadu", -1, 112], - ["gu", -1, 20], - ["logu", 1777, 19], - ["ugu", 1777, 18], - ["ahu", -1, 104], - ["acahu", 1780, 128], - ["astajahu", 1780, 106], - ["istajahu", 1780, 107], - ["ostajahu", 1780, 108], - ["injahu", 1780, 114], - ["irahu", 1780, 100], - ["urahu", 1780, 105], - ["avahu", 1780, 97], - ["evahu", 1780, 96], - ["ivahu", 1780, 98], - ["ovahu", 1780, 76], - ["uvahu", 1780, 99], - ["a\u010dahu", 1780, 102], - ["aju", -1, 104], - ["caju", 1794, 26], - ["acaju", 1795, 128], - ["laju", 1794, 30], - ["raju", 1794, 31], - ["iraju", 1798, 100], - ["uraju", 1798, 105], - ["taju", 1794, 113], - ["astaju", 1801, 106], - ["istaju", 1801, 107], - ["ostaju", 1801, 108], - ["avaju", 1794, 97], - ["evaju", 1794, 96], - ["ivaju", 1794, 98], - ["uvaju", 1794, 99], - ["\u0107aju", 1794, 28], - ["\u010daju", 1794, 27], - ["a\u010daju", 1810, 102], - ["\u0111aju", 1794, 29], - ["iju", -1, 116], - ["biju", 1813, 32], - ["ciju", 1813, 33], - ["diju", 1813, 34], - ["fiju", 1813, 40], - ["giju", 1813, 39], - ["anjiju", 1813, 84], - ["enjiju", 1813, 85], - ["snjiju", 1813, 122], - ["\u0161njiju", 1813, 86], - ["kiju", 1813, 95], - ["liju", 1813, 24], - ["eliju", 1824, 83], - ["miju", 1813, 37], - ["niju", 1813, 13], - ["ganiju", 1827, 9], - ["maniju", 1827, 6], - ["paniju", 1827, 7], - ["raniju", 1827, 8], - ["taniju", 1827, 5], - ["piju", 1813, 41], - ["riju", 1813, 42], - ["rariju", 1834, 21], - ["siju", 1813, 23], - ["osiju", 1836, 123], - ["tiju", 1813, 44], - ["atiju", 1838, 120], - ["otiju", 1838, 22], - ["aviju", 1813, 77], - ["eviju", 1813, 78], - ["iviju", 1813, 79], - ["oviju", 1813, 80], - ["ziju", 1813, 45], - ["o\u0161iju", 1813, 91], - ["\u017eiju", 1813, 38], - ["anju", -1, 84], - ["enju", -1, 85], - ["snju", -1, 122], - ["\u0161nju", -1, 86], - ["uju", -1, 25], - ["lucuju", 1852, 121], - ["iruju", 1852, 100], - ["lu\u010duju", 1852, 117], - ["ku", -1, 95], - ["sku", 1856, 1], - ["\u0161ku", 1856, 2], - ["alu", -1, 104], - ["ijalu", 1859, 47], - ["nalu", 1859, 46], - ["elu", -1, 83], - ["ilu", -1, 116], - ["ozilu", 1863, 48], - ["olu", -1, 50], - ["ramu", -1, 52], - ["acemu", -1, 124], - ["ecemu", -1, 125], - ["ucemu", -1, 126], - ["anjijemu", -1, 84], - ["enjijemu", -1, 85], - ["snjijemu", -1, 122], - ["\u0161njijemu", -1, 86], - ["kijemu", -1, 95], - ["skijemu", 1874, 1], - ["\u0161kijemu", 1874, 2], - ["elijemu", -1, 83], - ["nijemu", -1, 13], - ["osijemu", -1, 123], - ["atijemu", -1, 120], - ["evitijemu", -1, 92], - ["ovitijemu", -1, 93], - ["astijemu", -1, 94], - ["avijemu", -1, 77], - ["evijemu", -1, 78], - ["ivijemu", -1, 79], - ["ovijemu", -1, 80], - ["o\u0161ijemu", -1, 91], - ["anjemu", -1, 84], - ["enjemu", -1, 85], - ["snjemu", -1, 122], - ["\u0161njemu", -1, 86], - ["kemu", -1, 95], - ["skemu", 1893, 1], - ["\u0161kemu", 1893, 2], - ["lemu", -1, 51], - ["elemu", 1896, 83], - ["nemu", -1, 13], - ["anemu", 1898, 10], - ["enemu", 1898, 87], - ["snemu", 1898, 159], - ["\u0161nemu", 1898, 88], - ["osemu", -1, 123], - ["atemu", -1, 120], - ["evitemu", -1, 92], - ["ovitemu", -1, 93], - ["astemu", -1, 94], - ["avemu", -1, 77], - ["evemu", -1, 78], - ["ivemu", -1, 79], - ["ovemu", -1, 80], - ["a\u0107emu", -1, 14], - ["e\u0107emu", -1, 15], - ["u\u0107emu", -1, 16], - ["o\u0161emu", -1, 91], - ["acomu", -1, 124], - ["ecomu", -1, 125], - ["ucomu", -1, 126], - ["anjomu", -1, 84], - ["enjomu", -1, 85], - ["snjomu", -1, 122], - ["\u0161njomu", -1, 86], - ["komu", -1, 95], - ["skomu", 1923, 1], - ["\u0161komu", 1923, 2], - ["elomu", -1, 83], - ["nomu", -1, 13], - ["cinomu", 1927, 137], - ["\u010dinomu", 1927, 89], - ["osomu", -1, 123], - ["atomu", -1, 120], - ["evitomu", -1, 92], - ["ovitomu", -1, 93], - ["astomu", -1, 94], - ["avomu", -1, 77], - ["evomu", -1, 78], - ["ivomu", -1, 79], - ["ovomu", -1, 80], - ["a\u0107omu", -1, 14], - ["e\u0107omu", -1, 15], - ["u\u0107omu", -1, 16], - ["o\u0161omu", -1, 91], - ["nu", -1, 13], - ["anu", 1943, 10], - ["astanu", 1944, 110], - ["istanu", 1944, 111], - ["ostanu", 1944, 112], - ["inu", 1943, 11], - ["cinu", 1948, 137], - ["aninu", 1948, 10], - ["\u010dinu", 1948, 89], - ["onu", 1943, 12], - ["aru", -1, 53], - ["dru", -1, 54], - ["eru", -1, 55], - ["oru", -1, 56], - ["basu", -1, 135], - ["gasu", -1, 131], - ["jasu", -1, 129], - ["kasu", -1, 133], - ["nasu", -1, 132], - ["tasu", -1, 130], - ["vasu", -1, 134], - ["esu", -1, 57], - ["isu", -1, 58], - ["osu", -1, 123], - ["atu", -1, 120], - ["ikatu", 1967, 68], - ["latu", 1967, 69], - ["etu", -1, 70], - ["evitu", -1, 92], - ["ovitu", -1, 93], - ["astu", -1, 94], - ["estu", -1, 71], - ["istu", -1, 72], - ["kstu", -1, 73], - ["ostu", -1, 74], - ["i\u0161tu", -1, 75], - ["avu", -1, 77], - ["evu", -1, 78], - ["ivu", -1, 79], - ["ovu", -1, 80], - ["lovu", 1982, 82], - ["movu", 1982, 81], - ["stvu", -1, 3], - ["\u0161tvu", -1, 4], - ["ba\u0161u", -1, 63], - ["ga\u0161u", -1, 64], - ["ja\u0161u", -1, 61], - ["ka\u0161u", -1, 62], - ["na\u0161u", -1, 60], - ["ta\u0161u", -1, 59], - ["va\u0161u", -1, 65], - ["e\u0161u", -1, 66], - ["i\u0161u", -1, 67], - ["o\u0161u", -1, 91], - ["avav", -1, 97], - ["evav", -1, 96], - ["ivav", -1, 98], - ["uvav", -1, 99], - ["kov", -1, 95], - ["a\u0161", -1, 104], - ["ira\u0161", 2002, 100], - ["ura\u0161", 2002, 105], - ["ta\u0161", 2002, 113], - ["ava\u0161", 2002, 97], - ["eva\u0161", 2002, 96], - ["iva\u0161", 2002, 98], - ["uva\u0161", 2002, 99], - ["a\u010da\u0161", 2002, 102], - ["e\u0161", -1, 119], - ["astade\u0161", 2011, 110], - ["istade\u0161", 2011, 111], - ["ostade\u0161", 2011, 112], - ["astaje\u0161", 2011, 106], - ["istaje\u0161", 2011, 107], - ["ostaje\u0161", 2011, 108], - ["ije\u0161", 2011, 116], - ["inje\u0161", 2011, 114], - ["uje\u0161", 2011, 25], - ["iruje\u0161", 2020, 100], - ["lu\u010duje\u0161", 2020, 117], - ["ne\u0161", 2011, 13], - ["astane\u0161", 2023, 110], - ["istane\u0161", 2023, 111], - ["ostane\u0161", 2023, 112], - ["ete\u0161", 2011, 70], - ["aste\u0161", 2011, 115], - ["i\u0161", -1, 116], - ["ni\u0161", 2029, 103], - ["jeti\u0161", 2029, 118], - ["a\u010di\u0161", 2029, 101], - ["lu\u010di\u0161", 2029, 117], - ["ro\u0161i\u0161", 2029, 90], - ], - v = [ - ["a", -1, 1], - ["oga", 0, 1], - ["ama", 0, 1], - ["ima", 0, 1], - ["ena", 0, 1], - ["e", -1, 1], - ["og", -1, 1], - ["anog", 6, 1], - ["enog", 6, 1], - ["anih", -1, 1], - ["enih", -1, 1], - ["i", -1, 1], - ["ani", 11, 1], - ["eni", 11, 1], - ["anoj", -1, 1], - ["enoj", -1, 1], - ["anim", -1, 1], - ["enim", -1, 1], - ["om", -1, 1], - ["enom", 18, 1], - ["o", -1, 1], - ["ano", 20, 1], - ["eno", 20, 1], - ["ost", -1, 1], - ["u", -1, 1], - ["enu", 24, 1], - ], - b = [17, 65, 16], - f = [65, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 128], - q = [ - 119, 95, 23, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 136, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128, 0, 0, 0, - 16, - ], - t = [1], - s = 0, - r = p; - this.l = function () { - k(); - l(); - r = g; - var a = c.cursor; - a: { - b: for (;;) { - if (c.i(f, 263, 382)) break b; - if (c.cursor >= c.a) break a; - c.cursor++; - } - r = p; - } - c.cursor = a; - s = c.a; - a = c.cursor; - a: { - b: for (;;) { - if (c.i(b, 97, 117)) break b; - if (c.cursor >= c.a) break a; - c.cursor++; - } - s = c.cursor; - if (2 > s) { - b: for (;;) { - if (c.k(b, 97, 117)) break b; - if (c.cursor >= c.a) break a; - c.cursor++; - } - s = c.cursor; - } - } - c.cursor = a; - a = c.cursor; - a: { - b: for (;;) { - if (c.m("r")) break b; - if (c.cursor >= c.a) break a; - c.cursor++; - } - b: { - if (2 <= c.cursor) break b; - c.cursor = c.cursor; - c: for (;;) { - if (c.k(t, 114, 114)) break c; - if (c.cursor >= c.a) break a; - c.cursor++; - } - } - 1 < s - c.cursor && (s = c.cursor); - } - c.cursor = a; - c.f = c.cursor; - c.cursor = c.a; - var a = c.a - c.cursor, - n; - c.d = c.cursor; - n = c.h(d); - if (0 != n) - switch (((c.c = c.cursor), n)) { - case 1: - if (!c.b("loga")) break; - break; - case 2: - if (!c.b("peh")) break; - break; - case 3: - if (!c.b("vojka")) break; - break; - case 4: - if (!c.b("bojka")) break; - break; - case 5: - if (!c.b("jak")) break; - break; - case 6: - if (!c.b("\u010dajni")) break; - break; - case 7: - if (!r || !c.b("cajni")) break; - break; - case 8: - if (!c.b("erni")) break; - break; - case 9: - if (!c.b("larni")) break; - break; - case 10: - if (!c.b("esni")) break; - break; - case 11: - if (!c.b("anjca")) break; - break; - case 12: - if (!c.b("ajca")) break; - break; - case 13: - if (!c.b("ljca")) break; - break; - case 14: - if (!c.b("ejca")) break; - break; - case 15: - if (!c.b("ojca")) break; - break; - case 16: - if (!c.b("ajka")) break; - break; - case 17: - if (!c.b("ojka")) break; - break; - case 18: - if (!c.b("\u0161ca")) break; - break; - case 19: - if (!c.b("ing")) break; - break; - case 20: - if (!c.b("tvenik")) break; - break; - case 21: - if (!c.b("tetika")) break; - break; - case 22: - if (!c.b("nstva")) break; - break; - case 23: - if (!c.b("nik")) break; - break; - case 24: - if (!c.b("tik")) break; - break; - case 25: - if (!c.b("zik")) break; - break; - case 26: - if (!c.b("snik")) break; - break; - case 27: - if (!c.b("kusi")) break; - break; - case 28: - if (!c.b("kusni")) break; - break; - case 29: - if (!c.b("kustva")) break; - break; - case 30: - if (!c.b("du\u0161ni")) break; - break; - case 31: - if (!r || !c.b("dusni")) break; - break; - case 32: - if (!c.b("antni")) break; - break; - case 33: - if (!c.b("bilni")) break; - break; - case 34: - if (!c.b("tilni")) break; - break; - case 35: - if (!c.b("avilni")) break; - break; - case 36: - if (!c.b("silni")) break; - break; - case 37: - if (!c.b("gilni")) break; - break; - case 38: - if (!c.b("rilni")) break; - break; - case 39: - if (!c.b("nilni")) break; - break; - case 40: - if (!c.b("alni")) break; - break; - case 41: - if (!c.b("ozni")) break; - break; - case 42: - if (!c.b("ravi")) break; - break; - case 43: - if (!c.b("stavni")) break; - break; - case 44: - if (!c.b("pravni")) break; - break; - case 45: - if (!c.b("tivni")) break; - break; - case 46: - if (!c.b("sivni")) break; - break; - case 47: - if (!c.b("atni")) break; - break; - case 48: - if (!c.b("enta")) break; - break; - case 49: - if (!c.b("tetni")) break; - break; - case 50: - if (!c.b("pletni")) break; - break; - case 51: - if (!c.b("\u0161avi")) break; - break; - case 52: - if (!r || !c.b("savi")) break; - break; - case 53: - if (!c.b("anta")) break; - break; - case 54: - if (!c.b("a\u010dka")) break; - break; - case 55: - if (!r || !c.b("acka")) break; - break; - case 56: - if (!c.b("u\u0161ka")) break; - break; - case 57: - if (!r || !c.b("uska")) break; - break; - case 58: - if (!c.b("atka")) break; - break; - case 59: - if (!c.b("etka")) break; - break; - case 60: - if (!c.b("itka")) break; - break; - case 61: - if (!c.b("otka")) break; - break; - case 62: - if (!c.b("utka")) break; - break; - case 63: - if (!c.b("eskna")) break; - break; - case 64: - if (!c.b("ti\u010dni")) break; - break; - case 65: - if (!r || !c.b("ticni")) break; - break; - case 66: - if (!c.b("ojska")) break; - break; - case 67: - if (!c.b("esma")) break; - break; - case 68: - if (!c.b("metra")) break; - break; - case 69: - if (!c.b("centra")) break; - break; - case 70: - if (!c.b("istra")) break; - break; - case 71: - if (!c.b("osti")) break; - break; - case 72: - if (!r || !c.b("osti")) break; - break; - case 73: - if (!c.b("dba")) break; - break; - case 74: - if (!c.b("\u010dka")) break; - break; - case 75: - if (!c.b("mca")) break; - break; - case 76: - if (!c.b("nca")) break; - break; - case 77: - if (!c.b("voljni")) break; - break; - case 78: - if (!c.b("anki")) break; - break; - case 79: - if (!c.b("vca")) break; - break; - case 80: - if (!c.b("sca")) break; - break; - case 81: - if (!c.b("rca")) break; - break; - case 82: - if (!c.b("alca")) break; - break; - case 83: - if (!c.b("elca")) break; - break; - case 84: - if (!c.b("olca")) break; - break; - case 85: - if (!c.b("njca")) break; - break; - case 86: - if (!c.b("ekta")) break; - break; - case 87: - if (!c.b("izma")) break; - break; - case 88: - if (!c.b("jebi")) break; - break; - case 89: - if (!c.b("baci")) break; - break; - case 90: - if (!c.b("a\u0161ni")) break; - break; - case 91: - !r || c.b("asni"); - } - c.cursor = c.a - a; - a = c.a - c.cursor; - b: { - n = c.a - c.cursor; - if (h()) break b; - c.cursor = c.a - n; - c.d = c.cursor; - 0 != c.h(v) && ((c.c = c.cursor), !(s <= c.cursor) || c.b("")); - } - c.cursor = c.a - a; - c.cursor = c.f; - return g; - }; - this.stemWord = function (a) { - c.p(a); - this.l(); - return c.j; - }; -} - -const stemmerInstance = new stem(); - -export function stemmer(word) { - return stemmerInstance.stemWord(word); -} diff --git a/stemmer/lib/ru.d.ts b/stemmer/lib/ru.d.ts deleted file mode 100644 index 838f68c..0000000 --- a/stemmer/lib/ru.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare function stemmer(word: string): string; diff --git a/stemmer/lib/ru.js b/stemmer/lib/ru.js deleted file mode 100644 index d037ffa..0000000 --- a/stemmer/lib/ru.js +++ /dev/null @@ -1,523 +0,0 @@ -/* - * ----------------------------------------------------------------------------- - * GENERATED FILE - DO NOT EDIT! - * This file has been compiled using the Snowball stemmer generator. - * Don't edit this file directly. - * ----------------------------------------------------------------------------- - */ - -var g = !0, - p = !1; - -function C() { - this.p = function (k) { - this.j = k; - this.cursor = 0; - this.a = this.j.length; - this.f = 0; - this.c = this.cursor; - this.d = this.a; - }; - this.z = function () { - return this.j; - }; - this.w = function (k) { - this.j = k.j; - this.cursor = k.cursor; - this.a = k.a; - this.f = k.f; - this.c = k.c; - this.d = k.d; - }; - this.i = function (k, l, h) { - if (this.cursor >= this.a) return p; - var c = this.j.charCodeAt(this.cursor); - if (c > h || c < l) return p; - c -= l; - if (0 == (k[c >>> 3] & (1 << (c & 7)))) return p; - this.cursor++; - return g; - }; - this.n = function (k, l, h) { - if (this.cursor <= this.f) return p; - var c = this.j.charCodeAt(this.cursor - 1); - if (c > h || c < l) return p; - c -= l; - if (0 == (k[c >>> 3] & (1 << (c & 7)))) return p; - this.cursor--; - return g; - }; - this.k = function (k, l, h) { - if (this.cursor >= this.a) return p; - var c = this.j.charCodeAt(this.cursor); - if (c > h || c < l) return this.cursor++, g; - c -= l; - return 0 == (k[c >>> 3] & (1 << (c & 7))) ? (this.cursor++, g) : p; - }; - this.q = function (k, l, h) { - if (this.cursor <= this.f) return p; - var c = this.j.charCodeAt(this.cursor - 1); - if (c > h || c < l) return this.cursor--, g; - c -= l; - return 0 == (k[c >>> 3] & (1 << (c & 7))) ? (this.cursor--, g) : p; - }; - this.m = function (k) { - if (this.a - this.cursor < k.length || this.j.slice(this.cursor, this.cursor + k.length) != k) return p; - this.cursor += k.length; - return g; - }; - this.g = function (k) { - if (this.cursor - this.f < k.length || this.j.slice(this.cursor - k.length, this.cursor) != k) return p; - this.cursor -= k.length; - return g; - }; - this.o = function (k) { - for (var l = 0, h = k.length, c = this.cursor, a = this.a, d = 0, n = 0, v = p; ; ) { - var b = l + ((h - l) >>> 1), - f = 0, - q = d < n ? d : n, - t = k[b], - s; - for (s = q; s < t[0].length; s++) { - if (c + q == a) { - f = -1; - break; - } - f = this.j.charCodeAt(c + q) - t[0].charCodeAt(s); - if (0 != f) break; - q++; - } - 0 > f ? ((h = b), (n = q)) : ((l = b), (d = q)); - if (1 >= h - l) { - if (0 < l) break; - if (h == l) break; - if (v) break; - v = g; - } - } - for (;;) { - t = k[l]; - if (d >= t[0].length) { - this.cursor = c + t[0].length; - if (4 > t.length) return t[2]; - l = t[3](this); - this.cursor = c + t[0].length; - if (l) return t[2]; - } - l = t[1]; - if (0 > l) return 0; - } - }; - this.h = function (k) { - for (var l = 0, h = k.length, c = this.cursor, a = this.f, d = 0, n = 0, v = p; ; ) { - var b = l + ((h - l) >> 1), - f = 0, - q = d < n ? d : n, - t = k[b], - s; - for (s = t[0].length - 1 - q; 0 <= s; s--) { - if (c - q == a) { - f = -1; - break; - } - f = this.j.charCodeAt(c - 1 - q) - t[0].charCodeAt(s); - if (0 != f) break; - q++; - } - 0 > f ? ((h = b), (n = q)) : ((l = b), (d = q)); - if (1 >= h - l) { - if (0 < l) break; - if (h == l) break; - if (v) break; - v = g; - } - } - for (;;) { - t = k[l]; - if (d >= t[0].length) { - this.cursor = c - t[0].length; - if (4 > t.length) return t[2]; - l = t[3](this); - this.cursor = c - t[0].length; - if (l) return t[2]; - } - l = t[1]; - if (0 > l) return 0; - } - }; - this.s = function (k, l, h) { - var c = h.length - (l - k); - this.j = this.j.slice(0, k) + h + this.j.slice(l); - this.a += c; - this.cursor >= l ? (this.cursor += c) : this.cursor > k && (this.cursor = k); - return c; - }; - this.t = function () { - return 0 > this.c || this.c > this.d || this.d > this.a || this.a > this.j.length ? p : g; - }; - this.b = function (k) { - var l = p; - this.t() && (this.s(this.c, this.d, k), (l = g)); - return l; - }; - this.e = function () { - return this.b(""); - }; - this.r = function (k, l, h) { - l = this.s(k, l, h); - k <= this.c && (this.c += l); - k <= this.d && (this.d += l); - }; - this.u = function () { - var k = ""; - this.t() && (k = this.j.slice(this.c, this.d)); - return k; - }; - this.v = function () { - return this.j.slice(0, this.a); - }; -} - -function stem() { - function k() { - var b; - c.d = c.cursor; - b = c.h(a); - if (0 == b) return p; - c.c = c.cursor; - switch (b) { - case 1: - a: { - b = c.a - c.cursor; - if (c.g("\u0430")) break a; - c.cursor = c.a - b; - if (!c.g("\u044f")) return p; - } - if (!c.e()) return p; - break; - case 2: - if (!c.e()) return p; - } - return g; - } - function l() { - var a, b; - c.d = c.cursor; - 0 == c.h(d) ? (b = p) : ((c.c = c.cursor), (b = !c.e() ? p : g)); - if (!b) return p; - b = c.a - c.cursor; - a: if (((c.d = c.cursor), (a = c.h(n)), 0 == a)) c.cursor = c.a - b; - else - switch (((c.c = c.cursor), a)) { - case 1: - b: { - a = c.a - c.cursor; - if (c.g("\u0430")) break b; - c.cursor = c.a - a; - if (!c.g("\u044f")) { - c.cursor = c.a - b; - break a; - } - } - if (!c.e()) return p; - break; - case 2: - if (!c.e()) return p; - } - return g; - } - function h() { - var a; - c.d = c.cursor; - a = c.h(b); - if (0 == a) return p; - c.c = c.cursor; - switch (a) { - case 1: - a: { - a = c.a - c.cursor; - if (c.g("\u0430")) break a; - c.cursor = c.a - a; - if (!c.g("\u044f")) return p; - } - if (!c.e()) return p; - break; - case 2: - if (!c.e()) return p; - } - return g; - } - var c = new C(), - a = [ - ["\u0432", -1, 1], - ["\u0438\u0432", 0, 2], - ["\u044b\u0432", 0, 2], - ["\u0432\u0448\u0438", -1, 1], - ["\u0438\u0432\u0448\u0438", 3, 2], - ["\u044b\u0432\u0448\u0438", 3, 2], - ["\u0432\u0448\u0438\u0441\u044c", -1, 1], - ["\u0438\u0432\u0448\u0438\u0441\u044c", 6, 2], - ["\u044b\u0432\u0448\u0438\u0441\u044c", 6, 2], - ], - d = [ - ["\u0435\u0435", -1, 1], - ["\u0438\u0435", -1, 1], - ["\u043e\u0435", -1, 1], - ["\u044b\u0435", -1, 1], - ["\u0438\u043c\u0438", -1, 1], - ["\u044b\u043c\u0438", -1, 1], - ["\u0435\u0439", -1, 1], - ["\u0438\u0439", -1, 1], - ["\u043e\u0439", -1, 1], - ["\u044b\u0439", -1, 1], - ["\u0435\u043c", -1, 1], - ["\u0438\u043c", -1, 1], - ["\u043e\u043c", -1, 1], - ["\u044b\u043c", -1, 1], - ["\u0435\u0433\u043e", -1, 1], - ["\u043e\u0433\u043e", -1, 1], - ["\u0435\u043c\u0443", -1, 1], - ["\u043e\u043c\u0443", -1, 1], - ["\u0438\u0445", -1, 1], - ["\u044b\u0445", -1, 1], - ["\u0435\u044e", -1, 1], - ["\u043e\u044e", -1, 1], - ["\u0443\u044e", -1, 1], - ["\u044e\u044e", -1, 1], - ["\u0430\u044f", -1, 1], - ["\u044f\u044f", -1, 1], - ], - n = [ - ["\u0435\u043c", -1, 1], - ["\u043d\u043d", -1, 1], - ["\u0432\u0448", -1, 1], - ["\u0438\u0432\u0448", 2, 2], - ["\u044b\u0432\u0448", 2, 2], - ["\u0449", -1, 1], - ["\u044e\u0449", 5, 1], - ["\u0443\u044e\u0449", 6, 2], - ], - v = [ - ["\u0441\u044c", -1, 1], - ["\u0441\u044f", -1, 1], - ], - b = [ - ["\u043b\u0430", -1, 1], - ["\u0438\u043b\u0430", 0, 2], - ["\u044b\u043b\u0430", 0, 2], - ["\u043d\u0430", -1, 1], - ["\u0435\u043d\u0430", 3, 2], - ["\u0435\u0442\u0435", -1, 1], - ["\u0438\u0442\u0435", -1, 2], - ["\u0439\u0442\u0435", -1, 1], - ["\u0435\u0439\u0442\u0435", 7, 2], - ["\u0443\u0439\u0442\u0435", 7, 2], - ["\u043b\u0438", -1, 1], - ["\u0438\u043b\u0438", 10, 2], - ["\u044b\u043b\u0438", 10, 2], - ["\u0439", -1, 1], - ["\u0435\u0439", 13, 2], - ["\u0443\u0439", 13, 2], - ["\u043b", -1, 1], - ["\u0438\u043b", 16, 2], - ["\u044b\u043b", 16, 2], - ["\u0435\u043c", -1, 1], - ["\u0438\u043c", -1, 2], - ["\u044b\u043c", -1, 2], - ["\u043d", -1, 1], - ["\u0435\u043d", 22, 2], - ["\u043b\u043e", -1, 1], - ["\u0438\u043b\u043e", 24, 2], - ["\u044b\u043b\u043e", 24, 2], - ["\u043d\u043e", -1, 1], - ["\u0435\u043d\u043e", 27, 2], - ["\u043d\u043d\u043e", 27, 1], - ["\u0435\u0442", -1, 1], - ["\u0443\u0435\u0442", 30, 2], - ["\u0438\u0442", -1, 2], - ["\u044b\u0442", -1, 2], - ["\u044e\u0442", -1, 1], - ["\u0443\u044e\u0442", 34, 2], - ["\u044f\u0442", -1, 2], - ["\u043d\u044b", -1, 1], - ["\u0435\u043d\u044b", 37, 2], - ["\u0442\u044c", -1, 1], - ["\u0438\u0442\u044c", 39, 2], - ["\u044b\u0442\u044c", 39, 2], - ["\u0435\u0448\u044c", -1, 1], - ["\u0438\u0448\u044c", -1, 2], - ["\u044e", -1, 2], - ["\u0443\u044e", 44, 2], - ], - f = [ - ["\u0430", -1, 1], - ["\u0435\u0432", -1, 1], - ["\u043e\u0432", -1, 1], - ["\u0435", -1, 1], - ["\u0438\u0435", 3, 1], - ["\u044c\u0435", 3, 1], - ["\u0438", -1, 1], - ["\u0435\u0438", 6, 1], - ["\u0438\u0438", 6, 1], - ["\u0430\u043c\u0438", 6, 1], - ["\u044f\u043c\u0438", 6, 1], - ["\u0438\u044f\u043c\u0438", 10, 1], - ["\u0439", -1, 1], - ["\u0435\u0439", 12, 1], - ["\u0438\u0435\u0439", 13, 1], - ["\u0438\u0439", 12, 1], - ["\u043e\u0439", 12, 1], - ["\u0430\u043c", -1, 1], - ["\u0435\u043c", -1, 1], - ["\u0438\u0435\u043c", 18, 1], - ["\u043e\u043c", -1, 1], - ["\u044f\u043c", -1, 1], - ["\u0438\u044f\u043c", 21, 1], - ["\u043e", -1, 1], - ["\u0443", -1, 1], - ["\u0430\u0445", -1, 1], - ["\u044f\u0445", -1, 1], - ["\u0438\u044f\u0445", 26, 1], - ["\u044b", -1, 1], - ["\u044c", -1, 1], - ["\u044e", -1, 1], - ["\u0438\u044e", 30, 1], - ["\u044c\u044e", 30, 1], - ["\u044f", -1, 1], - ["\u0438\u044f", 33, 1], - ["\u044c\u044f", 33, 1], - ], - q = [ - ["\u043e\u0441\u0442", -1, 1], - ["\u043e\u0441\u0442\u044c", -1, 1], - ], - t = [ - ["\u0435\u0439\u0448\u0435", -1, 1], - ["\u043d", -1, 2], - ["\u0435\u0439\u0448", -1, 1], - ["\u044c", -1, 3], - ], - s = [33, 65, 8, 232], - r = 0, - m = 0; - this.l = function () { - var a = c.cursor; - for (;;) { - var b = c.cursor; - b: { - c: for (;;) { - var d = c.cursor; - c.c = c.cursor; - if (c.m("\u0451")) { - c.d = c.cursor; - c.cursor = d; - break c; - } - c.cursor = d; - if (c.cursor >= c.a) break b; - c.cursor++; - } - if (!c.b("\u0435")) return p; - continue; - } - c.cursor = b; - break; - } - c.cursor = a; - r = m = c.a; - a = c.cursor; - a: { - b: for (;;) { - if (c.i(s, 1072, 1103)) break b; - if (c.cursor >= c.a) break a; - c.cursor++; - } - m = c.cursor; - b: for (;;) { - if (c.k(s, 1072, 1103)) break b; - if (c.cursor >= c.a) break a; - c.cursor++; - } - b: for (;;) { - if (c.i(s, 1072, 1103)) break b; - if (c.cursor >= c.a) break a; - c.cursor++; - } - b: for (;;) { - if (c.k(s, 1072, 1103)) break b; - if (c.cursor >= c.a) break a; - c.cursor++; - } - r = c.cursor; - } - c.cursor = a; - c.f = c.cursor; - c.cursor = c.a; - if (c.cursor < m) return p; - a = c.f; - c.f = m; - b = c.a - c.cursor; - b: { - d = c.a - c.cursor; - if (k()) break b; - c.cursor = c.a - d; - d = c.a - c.cursor; - var n; - c.d = c.cursor; - 0 == c.h(v) ? (n = p) : ((c.c = c.cursor), (n = !c.e() ? p : g)); - n || (c.cursor = c.a - d); - c: { - d = c.a - c.cursor; - if (l()) break c; - c.cursor = c.a - d; - if (h()) break c; - c.cursor = c.a - d; - c.d = c.cursor; - 0 != c.h(f) && ((c.c = c.cursor), c.e()); - } - } - c.cursor = c.a - b; - b = c.a - c.cursor; - c.d = c.cursor; - if (c.g("\u0438")) { - if (((c.c = c.cursor), !c.e())) return p; - } else c.cursor = c.a - b; - b = c.a - c.cursor; - c.d = c.cursor; - 0 != c.h(q) && ((c.c = c.cursor), !(r <= c.cursor) || c.e()); - c.cursor = c.a - b; - b = c.a - c.cursor; - c.d = c.cursor; - d = c.h(t); - if (0 != d) - switch (((c.c = c.cursor), d)) { - case 1: - if (!c.e()) break; - c.d = c.cursor; - if (!c.g("\u043d")) break; - c.c = c.cursor; - if (!c.g("\u043d") || !c.e()) break; - break; - case 2: - if (!c.g("\u043d") || !c.e()) break; - break; - case 3: - c.e(); - } - c.cursor = c.a - b; - c.f = a; - c.cursor = c.f; - return g; - }; - this.stemWord = function (a) { - c.p(a); - this.l(); - return c.j; - }; -} - -const stemmerInstance = new stem(); - -export function stemmer(word) { - return stemmerInstance.stemWord(word); -} diff --git a/stemmer/lib/se.d.ts b/stemmer/lib/se.d.ts deleted file mode 100644 index 838f68c..0000000 --- a/stemmer/lib/se.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare function stemmer(word: string): string; diff --git a/stemmer/lib/se.js b/stemmer/lib/se.js deleted file mode 100644 index ddae5ec..0000000 --- a/stemmer/lib/se.js +++ /dev/null @@ -1,335 +0,0 @@ -/* - * ----------------------------------------------------------------------------- - * GENERATED FILE - DO NOT EDIT! - * This file has been compiled using the Snowball stemmer generator. - * Don't edit this file directly. - * ----------------------------------------------------------------------------- - */ - -var g = !0, - p = !1; - -function C() { - this.p = function (k) { - this.j = k; - this.cursor = 0; - this.a = this.j.length; - this.f = 0; - this.c = this.cursor; - this.d = this.a; - }; - this.z = function () { - return this.j; - }; - this.w = function (k) { - this.j = k.j; - this.cursor = k.cursor; - this.a = k.a; - this.f = k.f; - this.c = k.c; - this.d = k.d; - }; - this.i = function (k, l, h) { - if (this.cursor >= this.a) return p; - var c = this.j.charCodeAt(this.cursor); - if (c > h || c < l) return p; - c -= l; - if (0 == (k[c >>> 3] & (1 << (c & 7)))) return p; - this.cursor++; - return g; - }; - this.n = function (k, l, h) { - if (this.cursor <= this.f) return p; - var c = this.j.charCodeAt(this.cursor - 1); - if (c > h || c < l) return p; - c -= l; - if (0 == (k[c >>> 3] & (1 << (c & 7)))) return p; - this.cursor--; - return g; - }; - this.k = function (k, l, h) { - if (this.cursor >= this.a) return p; - var c = this.j.charCodeAt(this.cursor); - if (c > h || c < l) return this.cursor++, g; - c -= l; - return 0 == (k[c >>> 3] & (1 << (c & 7))) ? (this.cursor++, g) : p; - }; - this.q = function (k, l, h) { - if (this.cursor <= this.f) return p; - var c = this.j.charCodeAt(this.cursor - 1); - if (c > h || c < l) return this.cursor--, g; - c -= l; - return 0 == (k[c >>> 3] & (1 << (c & 7))) ? (this.cursor--, g) : p; - }; - this.m = function (k) { - if (this.a - this.cursor < k.length || this.j.slice(this.cursor, this.cursor + k.length) != k) return p; - this.cursor += k.length; - return g; - }; - this.g = function (k) { - if (this.cursor - this.f < k.length || this.j.slice(this.cursor - k.length, this.cursor) != k) return p; - this.cursor -= k.length; - return g; - }; - this.o = function (k) { - for (var l = 0, h = k.length, c = this.cursor, a = this.a, d = 0, n = 0, v = p; ; ) { - var b = l + ((h - l) >>> 1), - f = 0, - q = d < n ? d : n, - t = k[b], - s; - for (s = q; s < t[0].length; s++) { - if (c + q == a) { - f = -1; - break; - } - f = this.j.charCodeAt(c + q) - t[0].charCodeAt(s); - if (0 != f) break; - q++; - } - 0 > f ? ((h = b), (n = q)) : ((l = b), (d = q)); - if (1 >= h - l) { - if (0 < l) break; - if (h == l) break; - if (v) break; - v = g; - } - } - for (;;) { - t = k[l]; - if (d >= t[0].length) { - this.cursor = c + t[0].length; - if (4 > t.length) return t[2]; - l = t[3](this); - this.cursor = c + t[0].length; - if (l) return t[2]; - } - l = t[1]; - if (0 > l) return 0; - } - }; - this.h = function (k) { - for (var l = 0, h = k.length, c = this.cursor, a = this.f, d = 0, n = 0, v = p; ; ) { - var b = l + ((h - l) >> 1), - f = 0, - q = d < n ? d : n, - t = k[b], - s; - for (s = t[0].length - 1 - q; 0 <= s; s--) { - if (c - q == a) { - f = -1; - break; - } - f = this.j.charCodeAt(c - 1 - q) - t[0].charCodeAt(s); - if (0 != f) break; - q++; - } - 0 > f ? ((h = b), (n = q)) : ((l = b), (d = q)); - if (1 >= h - l) { - if (0 < l) break; - if (h == l) break; - if (v) break; - v = g; - } - } - for (;;) { - t = k[l]; - if (d >= t[0].length) { - this.cursor = c - t[0].length; - if (4 > t.length) return t[2]; - l = t[3](this); - this.cursor = c - t[0].length; - if (l) return t[2]; - } - l = t[1]; - if (0 > l) return 0; - } - }; - this.s = function (k, l, h) { - var c = h.length - (l - k); - this.j = this.j.slice(0, k) + h + this.j.slice(l); - this.a += c; - this.cursor >= l ? (this.cursor += c) : this.cursor > k && (this.cursor = k); - return c; - }; - this.t = function () { - return 0 > this.c || this.c > this.d || this.d > this.a || this.a > this.j.length ? p : g; - }; - this.b = function (k) { - var l = p; - this.t() && (this.s(this.c, this.d, k), (l = g)); - return l; - }; - this.e = function () { - return this.b(""); - }; - this.r = function (k, l, h) { - l = this.s(k, l, h); - k <= this.c && (this.c += l); - k <= this.d && (this.d += l); - }; - this.u = function () { - var k = ""; - this.t() && (k = this.j.slice(this.c, this.d)); - return k; - }; - this.v = function () { - return this.j.slice(0, this.a); - }; -} - -function stem() { - function k() { - var c; - if (!(l.cursor < b)) { - var d = l.f; - l.f = b; - l.d = l.cursor; - c = l.h(a); - if (0 != c) - switch (((l.c = l.cursor), c)) { - case 1: - if (!l.e()) return; - break; - case 2: - if (!l.b("l\u00f6s")) return; - break; - case 3: - if (!l.b("full")) return; - } - l.f = d; - } - } - var l = new C(), - h = [ - ["a", -1, 1], - ["arna", 0, 1], - ["erna", 0, 1], - ["heterna", 2, 1], - ["orna", 0, 1], - ["ad", -1, 1], - ["e", -1, 1], - ["ade", 6, 1], - ["ande", 6, 1], - ["arne", 6, 1], - ["are", 6, 1], - ["aste", 6, 1], - ["en", -1, 1], - ["anden", 12, 1], - ["aren", 12, 1], - ["heten", 12, 1], - ["ern", -1, 1], - ["ar", -1, 1], - ["er", -1, 1], - ["heter", 18, 1], - ["or", -1, 1], - ["s", -1, 2], - ["as", 21, 1], - ["arnas", 22, 1], - ["ernas", 22, 1], - ["ornas", 22, 1], - ["es", 21, 1], - ["ades", 26, 1], - ["andes", 26, 1], - ["ens", 21, 1], - ["arens", 29, 1], - ["hetens", 29, 1], - ["erns", 21, 1], - ["at", -1, 1], - ["andet", -1, 1], - ["het", -1, 1], - ["ast", -1, 1], - ], - c = [ - ["dd", -1, -1], - ["gd", -1, -1], - ["nn", -1, -1], - ["dt", -1, -1], - ["gt", -1, -1], - ["kt", -1, -1], - ["tt", -1, -1], - ], - a = [ - ["ig", -1, 1], - ["lig", 0, 1], - ["els", -1, 1], - ["fullt", -1, 3], - ["l\u00f6st", -1, 2], - ], - d = [17, 65, 16, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 24, 0, 32], - n = [119, 127, 149], - v = 0, - b = 0; - this.l = function () { - var a = l.cursor; - a: { - b = l.a; - var q = l.cursor, - t = l.cursor + 3; - if (!(t > l.a)) { - l.cursor = t; - v = l.cursor; - l.cursor = q; - b: for (;;) { - q = l.cursor; - if (l.i(d, 97, 246)) { - l.cursor = q; - break b; - } - l.cursor = q; - if (l.cursor >= l.a) break a; - l.cursor++; - } - b: for (;;) { - if (l.k(d, 97, 246)) break b; - if (l.cursor >= l.a) break a; - l.cursor++; - } - b = l.cursor; - b < v && (b = v); - } - } - l.cursor = a; - l.f = l.cursor; - l.cursor = l.a; - a = l.a - l.cursor; - if (!(l.cursor < b)) - if (((t = l.f), (l.f = b), (l.d = l.cursor), (q = l.h(h)), 0 == q)) l.f = t; - else - switch (((l.c = l.cursor), (l.f = t), q)) { - case 1: - if (!l.e()) break; - break; - case 2: - !l.n(n, 98, 121) || l.e(); - } - l.cursor = l.a - a; - a = l.a - l.cursor; - l.cursor < b || - ((q = l.f), - (l.f = b), - (t = l.a - l.cursor), - 0 == l.h(c) - ? (l.f = q) - : ((l.cursor = l.a - t), - (l.d = l.cursor), - l.cursor <= l.f ? (l.f = q) : (l.cursor--, (l.c = l.cursor), l.e() && (l.f = q)))); - l.cursor = l.a - a; - a = l.a - l.cursor; - k(); - l.cursor = l.a - a; - l.cursor = l.f; - return g; - }; - this.stemWord = function (a) { - l.p(a); - this.l(); - return l.j; - }; -} - -const stemmerInstance = new stem(); - -export function stemmer(word) { - return stemmerInstance.stemWord(word); -} diff --git a/stemmer/lib/tr.d.ts b/stemmer/lib/tr.d.ts deleted file mode 100644 index 838f68c..0000000 --- a/stemmer/lib/tr.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare function stemmer(word: string): string; diff --git a/stemmer/lib/tr.js b/stemmer/lib/tr.js deleted file mode 100644 index 2dac3a0..0000000 --- a/stemmer/lib/tr.js +++ /dev/null @@ -1,1260 +0,0 @@ -/* - * ----------------------------------------------------------------------------- - * GENERATED FILE - DO NOT EDIT! - * This file has been compiled using the Snowball stemmer generator. - * Don't edit this file directly. - * ----------------------------------------------------------------------------- - */ - -var g = !0, - p = !1; - -function C() { - this.p = function (k) { - this.j = k; - this.cursor = 0; - this.a = this.j.length; - this.f = 0; - this.c = this.cursor; - this.d = this.a; - }; - this.z = function () { - return this.j; - }; - this.w = function (k) { - this.j = k.j; - this.cursor = k.cursor; - this.a = k.a; - this.f = k.f; - this.c = k.c; - this.d = k.d; - }; - this.i = function (k, l, h) { - if (this.cursor >= this.a) return p; - var c = this.j.charCodeAt(this.cursor); - if (c > h || c < l) return p; - c -= l; - if (0 == (k[c >>> 3] & (1 << (c & 7)))) return p; - this.cursor++; - return g; - }; - this.n = function (k, l, h) { - if (this.cursor <= this.f) return p; - var c = this.j.charCodeAt(this.cursor - 1); - if (c > h || c < l) return p; - c -= l; - if (0 == (k[c >>> 3] & (1 << (c & 7)))) return p; - this.cursor--; - return g; - }; - this.k = function (k, l, h) { - if (this.cursor >= this.a) return p; - var c = this.j.charCodeAt(this.cursor); - if (c > h || c < l) return this.cursor++, g; - c -= l; - return 0 == (k[c >>> 3] & (1 << (c & 7))) ? (this.cursor++, g) : p; - }; - this.q = function (k, l, h) { - if (this.cursor <= this.f) return p; - var c = this.j.charCodeAt(this.cursor - 1); - if (c > h || c < l) return this.cursor--, g; - c -= l; - return 0 == (k[c >>> 3] & (1 << (c & 7))) ? (this.cursor--, g) : p; - }; - this.m = function (k) { - if (this.a - this.cursor < k.length || this.j.slice(this.cursor, this.cursor + k.length) != k) return p; - this.cursor += k.length; - return g; - }; - this.g = function (k) { - if (this.cursor - this.f < k.length || this.j.slice(this.cursor - k.length, this.cursor) != k) return p; - this.cursor -= k.length; - return g; - }; - this.o = function (k) { - for (var l = 0, h = k.length, c = this.cursor, a = this.a, d = 0, n = 0, v = p; ; ) { - var b = l + ((h - l) >>> 1), - f = 0, - q = d < n ? d : n, - t = k[b], - s; - for (s = q; s < t[0].length; s++) { - if (c + q == a) { - f = -1; - break; - } - f = this.j.charCodeAt(c + q) - t[0].charCodeAt(s); - if (0 != f) break; - q++; - } - 0 > f ? ((h = b), (n = q)) : ((l = b), (d = q)); - if (1 >= h - l) { - if (0 < l) break; - if (h == l) break; - if (v) break; - v = g; - } - } - for (;;) { - t = k[l]; - if (d >= t[0].length) { - this.cursor = c + t[0].length; - if (4 > t.length) return t[2]; - l = t[3](this); - this.cursor = c + t[0].length; - if (l) return t[2]; - } - l = t[1]; - if (0 > l) return 0; - } - }; - this.h = function (k) { - for (var l = 0, h = k.length, c = this.cursor, a = this.f, d = 0, n = 0, v = p; ; ) { - var b = l + ((h - l) >> 1), - f = 0, - q = d < n ? d : n, - t = k[b], - s; - for (s = t[0].length - 1 - q; 0 <= s; s--) { - if (c - q == a) { - f = -1; - break; - } - f = this.j.charCodeAt(c - 1 - q) - t[0].charCodeAt(s); - if (0 != f) break; - q++; - } - 0 > f ? ((h = b), (n = q)) : ((l = b), (d = q)); - if (1 >= h - l) { - if (0 < l) break; - if (h == l) break; - if (v) break; - v = g; - } - } - for (;;) { - t = k[l]; - if (d >= t[0].length) { - this.cursor = c - t[0].length; - if (4 > t.length) return t[2]; - l = t[3](this); - this.cursor = c - t[0].length; - if (l) return t[2]; - } - l = t[1]; - if (0 > l) return 0; - } - }; - this.s = function (k, l, h) { - var c = h.length - (l - k); - this.j = this.j.slice(0, k) + h + this.j.slice(l); - this.a += c; - this.cursor >= l ? (this.cursor += c) : this.cursor > k && (this.cursor = k); - return c; - }; - this.t = function () { - return 0 > this.c || this.c > this.d || this.d > this.a || this.a > this.j.length ? p : g; - }; - this.b = function (k) { - var l = p; - this.t() && (this.s(this.c, this.d, k), (l = g)); - return l; - }; - this.e = function () { - return this.b(""); - }; - this.r = function (k, l, h) { - l = this.s(k, l, h); - k <= this.c && (this.c += l); - k <= this.d && (this.d += l); - }; - this.u = function () { - var k = ""; - this.t() && (k = this.j.slice(this.c, this.d)); - return k; - }; - this.v = function () { - return this.j.slice(0, this.a); - }; -} - -function stem() { - function k() { - var a = e.a - e.cursor; - a: for (;;) { - var b = e.a - e.cursor; - if (e.n(F, 97, 305)) { - e.cursor = e.a - b; - break a; - } - e.cursor = e.a - b; - if (e.cursor <= e.f) return p; - e.cursor--; - } - a: { - b = e.a - e.cursor; - b: if (e.g("a")) { - c: for (;;) { - var c = e.a - e.cursor; - if (e.n(da, 97, 305)) { - e.cursor = e.a - c; - break c; - } - e.cursor = e.a - c; - if (e.cursor <= e.f) break b; - e.cursor--; - } - break a; - } - e.cursor = e.a - b; - b: if (e.g("e")) { - c: for (;;) { - c = e.a - e.cursor; - if (e.n(ea, 101, 252)) { - e.cursor = e.a - c; - break c; - } - e.cursor = e.a - c; - if (e.cursor <= e.f) break b; - e.cursor--; - } - break a; - } - e.cursor = e.a - b; - b: if (e.g("\u0131")) { - c: for (;;) { - c = e.a - e.cursor; - if (e.n(fa, 97, 305)) { - e.cursor = e.a - c; - break c; - } - e.cursor = e.a - c; - if (e.cursor <= e.f) break b; - e.cursor--; - } - break a; - } - e.cursor = e.a - b; - b: if (e.g("i")) { - c: for (;;) { - c = e.a - e.cursor; - if (e.n(ga, 101, 105)) { - e.cursor = e.a - c; - break c; - } - e.cursor = e.a - c; - if (e.cursor <= e.f) break b; - e.cursor--; - } - break a; - } - e.cursor = e.a - b; - b: if (e.g("o")) { - c: for (;;) { - c = e.a - e.cursor; - if (e.n(Y, 111, 117)) { - e.cursor = e.a - c; - break c; - } - e.cursor = e.a - c; - if (e.cursor <= e.f) break b; - e.cursor--; - } - break a; - } - e.cursor = e.a - b; - b: if (e.g("\u00f6")) { - c: for (;;) { - c = e.a - e.cursor; - if (e.n(Z, 246, 252)) { - e.cursor = e.a - c; - break c; - } - e.cursor = e.a - c; - if (e.cursor <= e.f) break b; - e.cursor--; - } - break a; - } - e.cursor = e.a - b; - b: if (e.g("u")) { - c: for (;;) { - c = e.a - e.cursor; - if (e.n(Y, 111, 117)) { - e.cursor = e.a - c; - break c; - } - e.cursor = e.a - c; - if (e.cursor <= e.f) break b; - e.cursor--; - } - break a; - } - e.cursor = e.a - b; - if (!e.g("\u00fc")) return p; - b: for (;;) { - b = e.a - e.cursor; - if (e.n(Z, 246, 252)) { - e.cursor = e.a - b; - break b; - } - e.cursor = e.a - b; - if (e.cursor <= e.f) return p; - e.cursor--; - } - } - e.cursor = e.a - a; - return g; - } - function l() { - a: { - var a = e.a - e.cursor; - if (e.g("n")) { - var b = e.a - e.cursor; - if (e.n(F, 97, 305)) { - e.cursor = e.a - b; - break a; - } - } - e.cursor = e.a - a; - a = e.a - e.cursor; - b = e.a - e.cursor; - if (e.g("n")) return (e.cursor = e.a - b), p; - e.cursor = e.a - a; - a = e.a - e.cursor; - if (e.cursor <= e.f) return p; - e.cursor--; - if (!e.n(F, 97, 305)) return p; - e.cursor = e.a - a; - } - return g; - } - function h() { - a: { - var a = e.a - e.cursor; - if (e.g("s")) { - var b = e.a - e.cursor; - if (e.n(F, 97, 305)) { - e.cursor = e.a - b; - break a; - } - } - e.cursor = e.a - a; - a = e.a - e.cursor; - b = e.a - e.cursor; - if (e.g("s")) return (e.cursor = e.a - b), p; - e.cursor = e.a - a; - a = e.a - e.cursor; - if (e.cursor <= e.f) return p; - e.cursor--; - if (!e.n(F, 97, 305)) return p; - e.cursor = e.a - a; - } - return g; - } - function c() { - a: { - var a = e.a - e.cursor; - if (e.g("y")) { - var b = e.a - e.cursor; - if (e.n(F, 97, 305)) { - e.cursor = e.a - b; - break a; - } - } - e.cursor = e.a - a; - a = e.a - e.cursor; - b = e.a - e.cursor; - if (e.g("y")) return (e.cursor = e.a - b), p; - e.cursor = e.a - a; - a = e.a - e.cursor; - if (e.cursor <= e.f) return p; - e.cursor--; - if (!e.n(F, 97, 305)) return p; - e.cursor = e.a - a; - } - return g; - } - function a() { - a: { - var a = e.a - e.cursor; - if (e.n(W, 105, 305)) { - var b = e.a - e.cursor; - if (e.q(F, 97, 305)) { - e.cursor = e.a - b; - break a; - } - } - e.cursor = e.a - a; - a = e.a - e.cursor; - b = e.a - e.cursor; - if (e.n(W, 105, 305)) return (e.cursor = e.a - b), p; - e.cursor = e.a - a; - a = e.a - e.cursor; - if (e.cursor <= e.f) return p; - e.cursor--; - if (!e.q(F, 97, 305)) return p; - e.cursor = e.a - a; - } - return g; - } - function d() { - return 0 == e.h(A) || !a() ? p : g; - } - function n() { - return !k() || !e.n(W, 105, 305) || !h() ? p : g; - } - function v() { - return 0 == e.h(H) ? p : g; - } - function b() { - return !k() || 0 == e.h(R) || !c() ? p : g; - } - function f() { - return !k() || 0 == e.h(S) ? p : g; - } - function q() { - return !k() || 0 == e.h(V) || !c() ? p : g; - } - function t() { - return !k() || 0 == e.h(D) ? p : g; - } - function s() { - return !k() || 0 == e.h($) || !c() ? p : g; - } - function r() { - return 0 == e.h(aa) || !c() ? p : g; - } - function m() { - return !k() || 0 == e.h(ba) || !c() ? p : g; - } - function w() { - e.d = e.cursor; - X = g; - a: { - var a = e.a - e.cursor; - b: { - c: { - var d = e.a - e.cursor; - if (m()) break c; - e.cursor = e.a - d; - if (s()) break c; - e.cursor = e.a - d; - if (r()) break c; - e.cursor = e.a - d; - if (!e.g("ken") || !c()) break b; - } - break a; - } - e.cursor = e.a - a; - if (0 != e.h(K)) { - c: { - d = e.a - e.cursor; - if (0 != e.h(I)) break c; - e.cursor = e.a - d; - if (t()) break c; - e.cursor = e.a - d; - if (b()) break c; - e.cursor = e.a - d; - if (f()) break c; - e.cursor = e.a - d; - if (q()) break c; - e.cursor = e.a - d; - } - if (m()) break a; - } - e.cursor = e.a - a; - if (t()) { - e.c = e.cursor; - if (!e.e()) return; - a = e.a - e.cursor; - e.d = e.cursor; - d: { - d = e.a - e.cursor; - if (k() && 0 != e.h(J)) break d; - e.cursor = e.a - d; - if (s()) break d; - e.cursor = e.a - d; - if (r()) break d; - e.cursor = e.a - d; - m() || (e.cursor = e.a - a); - } - X = p; - break a; - } - e.cursor = e.a - a; - b: if (k() && 0 != e.h(L)) { - c: { - d = e.a - e.cursor; - if (s()) break c; - e.cursor = e.a - d; - if (!r()) break b; - } - break a; - } - e.cursor = e.a - a; - b: { - c: { - d = e.a - e.cursor; - if (0 != e.h(I)) break c; - e.cursor = e.a - d; - if (q()) break c; - e.cursor = e.a - d; - if (f()) break c; - e.cursor = e.a - d; - if (!b()) break b; - } - e.c = e.cursor; - if (!e.e()) return; - a = e.a - e.cursor; - e.d = e.cursor; - m() || (e.cursor = e.a - a); - break a; - } - e.cursor = e.a - a; - if (!k() || 0 == e.h(J)) return; - e.c = e.cursor; - if (!e.e()) return; - a = e.a - e.cursor; - e.d = e.cursor; - c: { - d = e.a - e.cursor; - if (0 != e.h(I)) break c; - e.cursor = e.a - d; - if (t()) break c; - e.cursor = e.a - d; - if (b()) break c; - e.cursor = e.a - d; - if (f()) break c; - e.cursor = e.a - d; - if (q()) break c; - e.cursor = e.a - d; - } - m() || (e.cursor = e.a - a); - } - e.c = e.cursor; - e.e(); - } - function u() { - e.d = e.cursor; - if (!e.g("ki")) return p; - a: { - var a = e.a - e.cursor; - if (k() && 0 != e.h(N)) { - e.c = e.cursor; - if (!e.e()) return p; - a = e.a - e.cursor; - e.d = e.cursor; - d: { - var b = e.a - e.cursor; - if (t()) { - e.c = e.cursor; - if (!e.e()) return p; - a = e.a - e.cursor; - u() || (e.cursor = e.a - a); - break d; - } - e.cursor = e.a - b; - if (d()) { - e.c = e.cursor; - if (!e.e()) return p; - a = e.a - e.cursor; - e.d = e.cursor; - if (t()) { - e.c = e.cursor; - if (!e.e()) return p; - u() || (e.cursor = e.a - a); - } else e.cursor = e.a - a; - } else e.cursor = e.a - a; - } - break a; - } - e.cursor = e.a - a; - if (k() && 0 != e.h(E) && l()) { - e.c = e.cursor; - if (!e.e()) return p; - a = e.a - e.cursor; - e.d = e.cursor; - d: { - b = e.a - e.cursor; - if (v()) { - e.c = e.cursor; - if (!e.e()) return p; - break d; - } - e.cursor = e.a - b; - e: { - e.d = e.cursor; - f: { - var c = e.a - e.cursor; - if (d()) break f; - e.cursor = e.a - c; - if (!n()) break e; - } - e.c = e.cursor; - if (!e.e()) return p; - a = e.a - e.cursor; - e.d = e.cursor; - if (t()) { - e.c = e.cursor; - if (!e.e()) return p; - u() || (e.cursor = e.a - a); - } else e.cursor = e.a - a; - break d; - } - e.cursor = e.a - b; - u() || (e.cursor = e.a - a); - } - break a; - } - e.cursor = e.a - a; - if (!k() || 0 == e.h(M)) return p; - b: { - a = e.a - e.cursor; - if (v()) { - e.c = e.cursor; - if (!e.e()) return p; - break b; - } - e.cursor = e.a - a; - if (n()) { - e.c = e.cursor; - if (!e.e()) return p; - a = e.a - e.cursor; - e.d = e.cursor; - if (t()) { - e.c = e.cursor; - if (!e.e()) return p; - u() || (e.cursor = e.a - a); - } else e.cursor = e.a - a; - break b; - } - e.cursor = e.a - a; - if (!u()) return p; - } - } - return g; - } - function y() { - a: { - var a = e.a - e.cursor; - e.d = e.cursor; - if (t()) { - e.c = e.cursor; - if (!e.e()) return; - a = e.a - e.cursor; - u() || (e.cursor = e.a - a); - break a; - } - e.cursor = e.a - a; - e.d = e.cursor; - if (k() && 0 != e.h(U) && l()) { - e.c = e.cursor; - if (!e.e()) return; - a = e.a - e.cursor; - d: { - var b = e.a - e.cursor; - e.d = e.cursor; - if (v()) { - e.c = e.cursor; - if (!e.e()) return; - break d; - } - e.cursor = e.a - b; - e: { - e.d = e.cursor; - f: { - var f = e.a - e.cursor; - if (d()) break f; - e.cursor = e.a - f; - if (!n()) break e; - } - e.c = e.cursor; - if (!e.e()) return; - a = e.a - e.cursor; - e.d = e.cursor; - if (t()) { - e.c = e.cursor; - if (!e.e()) return; - u() || (e.cursor = e.a - a); - } else e.cursor = e.a - a; - break d; - } - e.cursor = e.a - b; - e.d = e.cursor; - if (t()) { - e.c = e.cursor; - if (!e.e()) return; - u() || (e.cursor = e.a - a); - } else e.cursor = e.a - a; - } - break a; - } - e.cursor = e.a - a; - b: { - e.d = e.cursor; - c: { - b = e.a - e.cursor; - if (k() && 0 != e.h(M)) break c; - e.cursor = e.a - b; - if (!k() || 0 == e.h(O)) break b; - } - c: { - b = e.a - e.cursor; - if (v()) { - e.c = e.cursor; - if (!e.e()) return; - break c; - } - e.cursor = e.a - b; - if (n()) { - e.c = e.cursor; - if (!e.e()) return; - a = e.a - e.cursor; - e.d = e.cursor; - if (t()) { - e.c = e.cursor; - if (!e.e()) return; - u() || (e.cursor = e.a - a); - } else e.cursor = e.a - a; - break c; - } - e.cursor = e.a - b; - if (!u()) break b; - } - break a; - } - e.cursor = e.a - a; - b: { - e.d = e.cursor; - c: { - b = e.a - e.cursor; - if (k() && 0 != e.h(Q)) break c; - e.cursor = e.a - b; - if (!k() || 0 == e.h(G)) break b; - } - c: { - b = e.a - e.cursor; - if (n()) { - e.c = e.cursor; - if (!e.e()) return; - a = e.a - e.cursor; - e.d = e.cursor; - if (t()) { - e.c = e.cursor; - if (!e.e()) return; - u() || (e.cursor = e.a - a); - } else e.cursor = e.a - a; - break c; - } - e.cursor = e.a - b; - if (!v()) break b; - } - break a; - } - e.cursor = e.a - a; - e.d = e.cursor; - if (k() && 0 != e.h(P)) { - e.c = e.cursor; - if (!e.e()) return; - a = e.a - e.cursor; - e.d = e.cursor; - d: { - b = e.a - e.cursor; - if (d()) { - e.c = e.cursor; - if (!e.e()) return; - a = e.a - e.cursor; - e.d = e.cursor; - if (t()) { - e.c = e.cursor; - if (!e.e()) return; - u() || (e.cursor = e.a - a); - } else e.cursor = e.a - a; - break d; - } - e.cursor = e.a - b; - if (t()) { - e.c = e.cursor; - if (!e.e()) return; - a = e.a - e.cursor; - u() || (e.cursor = e.a - a); - break d; - } - e.cursor = e.a - b; - u() || (e.cursor = e.a - a); - } - break a; - } - e.cursor = e.a - a; - b: { - e.d = e.cursor; - c: { - b = e.a - e.cursor; - if (k() && 0 != e.h(E) && l()) break c; - e.cursor = e.a - b; - if (!k() || 0 == e.h(T) || !c()) break b; - } - e.c = e.cursor; - if (!e.e()) return; - a = e.a - e.cursor; - d: { - b = e.a - e.cursor; - e.d = e.cursor; - if (t()) { - e.c = e.cursor; - if (!e.e()) return; - if (u()) break d; - } - e.cursor = e.a - b; - e: { - e.d = e.cursor; - f: { - f = e.a - e.cursor; - if (d()) break f; - e.cursor = e.a - f; - if (!n()) break e; - } - e.c = e.cursor; - if (!e.e()) return; - a = e.a - e.cursor; - e.d = e.cursor; - if (t()) { - e.c = e.cursor; - if (!e.e()) return; - u() || (e.cursor = e.a - a); - } else e.cursor = e.a - a; - break d; - } - e.cursor = e.a - b; - u() || (e.cursor = e.a - a); - } - break a; - } - e.cursor = e.a - a; - e.d = e.cursor; - if (v()) { - e.c = e.cursor; - if (!e.e()) return; - break a; - } - e.cursor = e.a - a; - if (u()) break a; - e.cursor = e.a - a; - b: { - e.d = e.cursor; - c: { - b = e.a - e.cursor; - if (k() && 0 != e.h(N)) break c; - e.cursor = e.a - b; - if (k() && e.n(W, 105, 305) && c()) break c; - e.cursor = e.a - b; - if (!k() || 0 == e.h(x) || !c()) break b; - } - e.c = e.cursor; - if (!e.e()) return; - a = e.a - e.cursor; - c: { - e.d = e.cursor; - d: { - b = e.a - e.cursor; - if (d()) { - e.c = e.cursor; - if (!e.e()) return; - b = e.a - e.cursor; - e.d = e.cursor; - t() || (e.cursor = e.a - b); - break d; - } - e.cursor = e.a - b; - if (!t()) { - e.cursor = e.a - a; - break c; - } - } - e.c = e.cursor; - if (!e.e()) return; - e.d = e.cursor; - u() || (e.cursor = e.a - a); - } - break a; - } - e.cursor = e.a - a; - e.d = e.cursor; - b: { - a = e.a - e.cursor; - if (d()) break b; - e.cursor = e.a - a; - if (!n()) return; - } - e.c = e.cursor; - e.e() && - ((a = e.a - e.cursor), - (e.d = e.cursor), - t() ? ((e.c = e.cursor), e.e() && !u() && (e.cursor = e.a - a)) : (e.cursor = e.a - a)); - } - } - function z() { - var a = e.a - e.cursor; - a: { - var b = e.a - e.cursor; - if (e.g("d")) break a; - e.cursor = e.a - b; - if (!e.g("g")) return; - } - e.cursor = e.a - a; - a: { - a = e.a - e.cursor; - b: { - b = e.a - e.cursor; - c: for (;;) { - var c = e.a - e.cursor; - if (e.n(F, 97, 305)) { - e.cursor = e.a - c; - break c; - } - e.cursor = e.a - c; - if (e.cursor <= e.f) break b; - e.cursor--; - } - c: { - c = e.a - e.cursor; - if (e.g("a")) break c; - e.cursor = e.a - c; - if (!e.g("\u0131")) break b; - } - e.cursor = e.a - b; - a = e.cursor; - e.r(e.cursor, e.cursor, "\u0131"); - e.cursor = a; - break a; - } - e.cursor = e.a - a; - b: { - b = e.a - e.cursor; - c: for (;;) { - c = e.a - e.cursor; - if (e.n(F, 97, 305)) { - e.cursor = e.a - c; - break c; - } - e.cursor = e.a - c; - if (e.cursor <= e.f) break b; - e.cursor--; - } - c: { - c = e.a - e.cursor; - if (e.g("e")) break c; - e.cursor = e.a - c; - if (!e.g("i")) break b; - } - e.cursor = e.a - b; - a = e.cursor; - e.r(e.cursor, e.cursor, "i"); - e.cursor = a; - break a; - } - e.cursor = e.a - a; - b: { - b = e.a - e.cursor; - c: for (;;) { - c = e.a - e.cursor; - if (e.n(F, 97, 305)) { - e.cursor = e.a - c; - break c; - } - e.cursor = e.a - c; - if (e.cursor <= e.f) break b; - e.cursor--; - } - c: { - c = e.a - e.cursor; - if (e.g("o")) break c; - e.cursor = e.a - c; - if (!e.g("u")) break b; - } - e.cursor = e.a - b; - a = e.cursor; - e.r(e.cursor, e.cursor, "u"); - e.cursor = a; - break a; - } - e.cursor = e.a - a; - a = e.a - e.cursor; - b: for (;;) { - b = e.a - e.cursor; - if (e.n(F, 97, 305)) { - e.cursor = e.a - b; - break b; - } - e.cursor = e.a - b; - if (e.cursor <= e.f) return; - e.cursor--; - } - b: { - b = e.a - e.cursor; - if (e.g("\u00f6")) break b; - e.cursor = e.a - b; - if (!e.g("\u00fc")) return; - } - e.cursor = e.a - a; - a = e.cursor; - e.r(e.cursor, e.cursor, "\u00fc"); - e.cursor = a; - } - } - var e = new C(), - A = [ - ["m", -1, -1], - ["n", -1, -1], - ["miz", -1, -1], - ["niz", -1, -1], - ["muz", -1, -1], - ["nuz", -1, -1], - ["m\u00fcz", -1, -1], - ["n\u00fcz", -1, -1], - ["m\u0131z", -1, -1], - ["n\u0131z", -1, -1], - ], - H = [ - ["leri", -1, -1], - ["lar\u0131", -1, -1], - ], - G = [ - ["ni", -1, -1], - ["nu", -1, -1], - ["n\u00fc", -1, -1], - ["n\u0131", -1, -1], - ], - E = [ - ["in", -1, -1], - ["un", -1, -1], - ["\u00fcn", -1, -1], - ["\u0131n", -1, -1], - ], - x = [ - ["a", -1, -1], - ["e", -1, -1], - ], - O = [ - ["na", -1, -1], - ["ne", -1, -1], - ], - N = [ - ["da", -1, -1], - ["ta", -1, -1], - ["de", -1, -1], - ["te", -1, -1], - ], - M = [ - ["nda", -1, -1], - ["nde", -1, -1], - ], - P = [ - ["dan", -1, -1], - ["tan", -1, -1], - ["den", -1, -1], - ["ten", -1, -1], - ], - Q = [ - ["ndan", -1, -1], - ["nden", -1, -1], - ], - T = [ - ["la", -1, -1], - ["le", -1, -1], - ], - U = [ - ["ca", -1, -1], - ["ce", -1, -1], - ], - R = [ - ["im", -1, -1], - ["um", -1, -1], - ["\u00fcm", -1, -1], - ["\u0131m", -1, -1], - ], - S = [ - ["sin", -1, -1], - ["sun", -1, -1], - ["s\u00fcn", -1, -1], - ["s\u0131n", -1, -1], - ], - V = [ - ["iz", -1, -1], - ["uz", -1, -1], - ["\u00fcz", -1, -1], - ["\u0131z", -1, -1], - ], - I = [ - ["siniz", -1, -1], - ["sunuz", -1, -1], - ["s\u00fcn\u00fcz", -1, -1], - ["s\u0131n\u0131z", -1, -1], - ], - D = [ - ["lar", -1, -1], - ["ler", -1, -1], - ], - L = [ - ["niz", -1, -1], - ["nuz", -1, -1], - ["n\u00fcz", -1, -1], - ["n\u0131z", -1, -1], - ], - J = [ - ["dir", -1, -1], - ["tir", -1, -1], - ["dur", -1, -1], - ["tur", -1, -1], - ["d\u00fcr", -1, -1], - ["t\u00fcr", -1, -1], - ["d\u0131r", -1, -1], - ["t\u0131r", -1, -1], - ], - K = [ - ["cas\u0131na", -1, -1], - ["cesine", -1, -1], - ], - $ = [ - ["di", -1, -1], - ["ti", -1, -1], - ["dik", -1, -1], - ["tik", -1, -1], - ["duk", -1, -1], - ["tuk", -1, -1], - ["d\u00fck", -1, -1], - ["t\u00fck", -1, -1], - ["d\u0131k", -1, -1], - ["t\u0131k", -1, -1], - ["dim", -1, -1], - ["tim", -1, -1], - ["dum", -1, -1], - ["tum", -1, -1], - ["d\u00fcm", -1, -1], - ["t\u00fcm", -1, -1], - ["d\u0131m", -1, -1], - ["t\u0131m", -1, -1], - ["din", -1, -1], - ["tin", -1, -1], - ["dun", -1, -1], - ["tun", -1, -1], - ["d\u00fcn", -1, -1], - ["t\u00fcn", -1, -1], - ["d\u0131n", -1, -1], - ["t\u0131n", -1, -1], - ["du", -1, -1], - ["tu", -1, -1], - ["d\u00fc", -1, -1], - ["t\u00fc", -1, -1], - ["d\u0131", -1, -1], - ["t\u0131", -1, -1], - ], - aa = [ - ["sa", -1, -1], - ["se", -1, -1], - ["sak", -1, -1], - ["sek", -1, -1], - ["sam", -1, -1], - ["sem", -1, -1], - ["san", -1, -1], - ["sen", -1, -1], - ], - ba = [ - ["mi\u015f", -1, -1], - ["mu\u015f", -1, -1], - ["m\u00fc\u015f", -1, -1], - ["m\u0131\u015f", -1, -1], - ], - ca = [ - ["b", -1, 1], - ["c", -1, 2], - ["d", -1, 3], - ["\u011f", -1, 4], - ], - F = [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], - W = [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], - da = [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], - ea = [17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 130], - fa = [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], - ga = [17], - Y = [65], - Z = [65], - X = p; - this.l = function () { - var a; - a = e.cursor; - for (var b = 2; ; ) { - var c = e.cursor; - b: { - c: for (;;) { - if (e.i(F, 97, 305)) break c; - if (e.cursor >= e.a) break b; - e.cursor++; - } - b--; - continue; - } - e.cursor = c; - break; - } - 0 < b ? (a = p) : ((e.cursor = a), (a = g)); - if (!a) return p; - e.f = e.cursor; - e.cursor = e.a; - a = e.a - e.cursor; - w(); - e.cursor = e.a - a; - if (!X) return p; - a = e.a - e.cursor; - y(); - e.cursor = e.a - a; - e.cursor = e.f; - a: { - e.f = e.cursor; - e.cursor = e.a; - a = e.a - e.cursor; - e.g("ad") ? ((b = e.a - e.cursor), e.g("soy") || (e.cursor = e.a - b), (b = e.cursor > e.f ? p : g)) : (b = p); - if (b) { - a = p; - break a; - } - e.cursor = e.a - a; - a = e.a - e.cursor; - z(); - e.cursor = e.a - a; - a = e.a - e.cursor; - e.d = e.cursor; - b = e.h(ca); - if (0 != b) - switch (((e.c = e.cursor), b)) { - case 1: - if (!e.b("p")) break; - break; - case 2: - if (!e.b("\u00e7")) break; - break; - case 3: - if (!e.b("t")) break; - break; - case 4: - e.b("k"); - } - e.cursor = e.a - a; - e.cursor = e.f; - a = g; - } - return !a ? p : g; - }; - this.stemWord = function (a) { - e.p(a); - this.l(); - return e.j; - }; -} - -const stemmerInstance = new stem(); - -export function stemmer(word) { - return stemmerInstance.stemWord(word); -} diff --git a/tests/algorithms.test.ts b/tests/algorithms.test.ts index e164972..b9b61c2 100644 --- a/tests/algorithms.test.ts +++ b/tests/algorithms.test.ts @@ -1,70 +1,13 @@ import t from "tap"; -import { intersectTokenScores } from "../src/algorithms.js"; -import { intersectTokenScores as wasmIntersectTokenScores } from "../src/wasm.js"; +import { intersectTokenScores as wasmIntersectTokenScores, Runtime } from "../src/wasm.js"; t.test("utils", t => { t.plan(2); - t.test("should correctly intersect 2 or more arrays", async t => { - t.plan(3); - - t.same( - await intersectTokenScores({ - data: [ - [ - ["foo", 1], - ["bar", 1], - ["baz", 2], - ], - [ - ["foo", 4], - ["quick", 10], - ["brown", 3], - ["bar", 2], - ], - [ - ["fox", 12], - ["foo", 4], - ["jumps", 3], - ["bar", 6], - ], - ], - }), - { - data: [ - ["foo", 9], - ["bar", 9], - ], - }, - ); - - t.same( - await intersectTokenScores({ - data: [ - [ - ["foo", 1], - ["bar", 1], - ["baz", 2], - ], - [ - ["quick", 10], - ["brown", 3], - ], - ], - }), - { - data: [], - }, - ); - - t.same( - await intersectTokenScores({ - data: [], - }), - { - data: [], - }, - ); + t.test("should throw when the runtime is not supported", async t => { + await t.rejects(() => wasmIntersectTokenScores([], "runtime" as Runtime), { + message: 'Unsupported runtime "node"', + }); }); t.test("should correctly intersect 2 or more arrays (using WASM)", async t => { diff --git a/tests/config/c8-ci.json b/tests/config/c8-ci.json index fe7280a..f174573 100644 --- a/tests/config/c8-ci.json +++ b/tests/config/c8-ci.json @@ -1,7 +1,7 @@ { "check-coverage": true, "reporter": ["text", "json"], - "exclude": ["dist", "stemmer", "tests"], + "exclude": ["dist", "tests"], "branches": 80, "functions": 80, "lines": 80, diff --git a/tests/config/c8-local.json b/tests/config/c8-local.json index 6abbf29..3416f7b 100644 --- a/tests/config/c8-local.json +++ b/tests/config/c8-local.json @@ -1,4 +1,4 @@ { "reporter": ["text", "html"], - "exclude": ["dist", "stemmer", "tests"] + "exclude": ["dist", "tests"] } diff --git a/tests/diacritics.test.ts b/tests/diacritics.test.ts deleted file mode 100644 index 4587ca2..0000000 --- a/tests/diacritics.test.ts +++ /dev/null @@ -1,22 +0,0 @@ -import t from "tap"; -import { replaceDiacritics } from "../src/tokenizer/diacritics.js"; - -t.test("Diacritics Replacer", t => { - t.plan(1); - - t.test("Should replace diacritics", t => { - t.plan(3); - - const I1 = "áàâãéèêíïóôõöúçñÁÀÂÃÉÈÍÏÓÔÕÖÚÇÑ"; - const I2 = "áaauioèaíïóiuubnÁoiÃotytÓhygÚnÑ"; - const I3 = "aaaaeeeiiooooucnAAAAEEIIOOOOUCN"; - - const O1 = replaceDiacritics(I1); - const O2 = replaceDiacritics(I2); - const O3 = replaceDiacritics(I3); - - t.equal(O1, "aaaaeeeiiooooucnAAAAEEIIOOOOUCN"); - t.equal(O2, `aaauioeaiioiuubnAoiAotytOhygUnN`); - t.equal(O3, `aaaaeeeiiooooucnAAAAEEIIOOOOUCN`); - }); -}); diff --git a/tests/tokenizer.test.ts b/tests/tokenizer.test.ts deleted file mode 100644 index beb6781..0000000 --- a/tests/tokenizer.test.ts +++ /dev/null @@ -1,525 +0,0 @@ -import t from "tap"; -import { defaultTokenizerConfig, normalizationCache, tokenize } from "../src/tokenizer/index.js"; -import { stopWords } from "../src/tokenizer/stop-words/index.js"; -import { stemmer as ENStemmer } from "../stemmer/lib/en.js"; -import { stemmer as FRStemmer } from "../stemmer/lib/fr.js"; - -t.test("Tokenizer", t => { - t.plan(13); - - t.test("Should tokenize and stem correctly in english", t => { - t.plan(2); - - const I1 = "the quick brown fox jumps over the lazy dog"; - const I2 = "I baked some cakes"; - - const O1 = tokenize(I1, "english"); - const O2 = tokenize(I2, "english"); - - t.matchSnapshot(O1, `${t.name}-O1`); - t.matchSnapshot(O2, `${t.name}-O2`); - }); - - t.test("Should tokenize and stem correctly in english and allow duplicates", t => { - t.plan(2); - - const I1 = "this is a test with test duplicates"; - const I2 = "it's alive! it's alive!"; - - const O1 = tokenize(I1, "english", true); - const O2 = tokenize(I2, "english", true); - - t.matchSnapshot(O1, `${t.name}-O1`); - t.matchSnapshot(O2, `${t.name}-O2`); - }); - - t.test("Should tokenize and stem correctly in french", async t => { - t.plan(2); - - const I1 = "voyons quel temps il fait dehors"; - const I2 = "j'ai fait des gâteaux"; - - const O1 = tokenize( - I1, - "french", - false, - defaultTokenizerConfig("french", { - stemmingFn: FRStemmer, - customStopWords: stopWords.french, - }), - ); - const O2 = tokenize( - I2, - "french", - false, - defaultTokenizerConfig("french", { - stemmingFn: FRStemmer, - customStopWords: stopWords.french, - }), - ); - - t.matchSnapshot(O1, `${t.name}-O1`); - t.matchSnapshot(O2, `${t.name}-O2`); - }); - - t.test("Should tokenize and stem correctly in italian", async t => { - t.plan(2); - - const I1 = "ho cucinato delle torte"; - const I2 = "dormire è una cosa difficile quando i test non passano"; - - const O1 = tokenize( - I1, - "italian", - false, - defaultTokenizerConfig("italian", { - stemmingFn: FRStemmer, - customStopWords: stopWords.italian, - }), - ); - const O2 = tokenize( - I2, - "italian", - false, - defaultTokenizerConfig("italian", { - stemmingFn: FRStemmer, - customStopWords: stopWords.italian, - }), - ); - - t.matchSnapshot(O1, `${t.name}-O1`); - t.matchSnapshot(O2, `${t.name}-O2`); - }); - - t.test("Should tokenize and stem correctly in norwegian", async t => { - t.plan(2); - - const I1 = "Jeg kokte noen kaker"; - const I2 = "å sove er en vanskelig ting når testene mislykkes"; - - const O1 = tokenize( - I1, - "norwegian", - false, - defaultTokenizerConfig("norwegian", { - stemmingFn: FRStemmer, - customStopWords: stopWords.norwegian, - }), - ); - const O2 = tokenize( - I2, - "norwegian", - false, - defaultTokenizerConfig("norwegian", { - stemmingFn: FRStemmer, - customStopWords: stopWords.norwegian, - }), - ); - - t.matchSnapshot(O1, `${t.name}-O1`); - t.matchSnapshot(O2, `${t.name}-O2`); - }); - - t.test("Should tokenize and stem correctly in portuguese", async t => { - t.plan(2); - - const I1 = "Eu cozinhei alguns bolos"; - const I2 = "dormir é uma coisa difícil quando os testes falham"; - - const O1 = tokenize( - I1, - "portuguese", - false, - defaultTokenizerConfig("portuguese", { - stemmingFn: FRStemmer, - customStopWords: stopWords.portuguese, - }), - ); - const O2 = tokenize( - I2, - "portuguese", - false, - defaultTokenizerConfig("portuguese", { - stemmingFn: FRStemmer, - customStopWords: stopWords.portuguese, - }), - ); - - t.matchSnapshot(O1, `${t.name}-O1`); - t.matchSnapshot(O2, `${t.name}-O2`); - }); - - t.test("Should tokenize and stem correctly in russian", async t => { - t.plan(2); - - const I1 = "я приготовила пирожные"; - const I2 = "спать трудно, когда тесты не срабатывают"; - - const O1 = tokenize( - I1, - "russian", - false, - defaultTokenizerConfig("russian", { - stemmingFn: FRStemmer, - customStopWords: stopWords.russian, - }), - ); - const O2 = tokenize( - I2, - "russian", - false, - defaultTokenizerConfig("russian", { - stemmingFn: FRStemmer, - customStopWords: stopWords.russian, - }), - ); - - t.matchSnapshot(O1, `${t.name}-O1`); - t.matchSnapshot(O2, `${t.name}-O2`); - }); - - t.test("Should tokenize and stem correctly in swedish", async t => { - t.plan(2); - - const I1 = "Jag lagade några kakor"; - const I2 = "att sova är en svår sak när testerna misslyckas"; - - const O1 = tokenize( - I1, - "swedish", - false, - defaultTokenizerConfig("swedish", { - stemmingFn: FRStemmer, - customStopWords: stopWords.swedish, - }), - ); - const O2 = tokenize( - I2, - "swedish", - false, - defaultTokenizerConfig("swedish", { - stemmingFn: FRStemmer, - customStopWords: stopWords.swedish, - }), - ); - - t.matchSnapshot(O1, `${t.name}-O1`); - t.matchSnapshot(O2, `${t.name}-O2`); - }); - - t.test("Should tokenize and stem correctly in spanish", async t => { - t.plan(2); - - const I1 = "cociné unos pasteles"; - const I2 = "dormir es algo dificil cuando las pruebas fallan"; - - const O1 = tokenize( - I1, - "spanish", - false, - defaultTokenizerConfig("spanish", { - stemmingFn: FRStemmer, - customStopWords: stopWords.spanish, - }), - ); - const O2 = tokenize( - I2, - "spanish", - false, - defaultTokenizerConfig("spanish", { - stemmingFn: FRStemmer, - customStopWords: stopWords.spanish, - }), - ); - - t.matchSnapshot(O1, `${t.name}-O1`); - t.matchSnapshot(O2, `${t.name}-O2`); - }); - - t.test("Should tokenize and stem correctly in dutch", async t => { - t.plan(2); - - const I1 = "de kleine koeien"; - const I2 = "Ik heb wat taarten gemaakt"; - - const O2 = tokenize( - I2, - "dutch", - false, - defaultTokenizerConfig("dutch", { - stemmingFn: FRStemmer, - customStopWords: stopWords.dutch, - }), - ); - const O1 = tokenize( - I1, - "dutch", - false, - defaultTokenizerConfig("dutch", { - stemmingFn: FRStemmer, - customStopWords: stopWords.dutch, - }), - ); - - t.matchSnapshot(O1, `${t.name}-O1`); - t.matchSnapshot(O2, `${t.name}-O2`); - }); - - t.test("Should tokenize and stem correctly in german", async t => { - t.plan(2); - - const I1 = "Schlaf ist eine harte Sache, wenn Tests fehlschlagen"; - const I2 = "Ich habe ein paar Kekse gebacken"; - - const O1 = tokenize( - I1, - "german", - false, - defaultTokenizerConfig("german", { - stemmingFn: FRStemmer, - customStopWords: stopWords.german, - }), - ); - const O2 = tokenize( - I2, - "german", - false, - defaultTokenizerConfig("german", { - stemmingFn: FRStemmer, - customStopWords: stopWords.german, - }), - ); - - t.matchSnapshot(O1, `${t.name}-O1`); - t.matchSnapshot(O2, `${t.name}-O2`); - }); - - t.test("Should tokenize and stem correctly in finnish", async t => { - t.plan(2); - - const I1 = "Uni on vaikea asia, kun testit epäonnistuvat"; - const I2 = "Leivoin keksejä"; - - const O1 = tokenize( - I1, - "finnish", - false, - defaultTokenizerConfig("finnish", { - stemmingFn: FRStemmer, - customStopWords: stopWords.finnish, - }), - ); - const O2 = tokenize( - I2, - "finnish", - false, - defaultTokenizerConfig("finnish", { - stemmingFn: FRStemmer, - customStopWords: stopWords.finnish, - }), - ); - - t.matchSnapshot(O1, `${t.name}-O1`); - t.matchSnapshot(O2, `${t.name}-O2`); - }); - - t.test("Should tokenize and stem correctly in danish", async t => { - t.plan(2); - - const I1 = "Søvn er en svær ting, når prøver mislykkes"; - const I2 = "Jeg bagte småkager"; - - const O1 = tokenize( - I1, - "danish", - false, - defaultTokenizerConfig("danish", { - stemmingFn: FRStemmer, - customStopWords: stopWords.danish, - }), - ); - const O2 = tokenize( - I2, - "danish", - false, - defaultTokenizerConfig("danish", { - stemmingFn: FRStemmer, - customStopWords: stopWords.danish, - }), - ); - - t.matchSnapshot(O1, `${t.name}-O1`); - t.matchSnapshot(O2, `${t.name}-O2`); - }); -}); - -t.test("Custom stop-words rules", t => { - t.plan(6); - - t.test("custom array of stop-words", async t => { - t.plan(2); - - normalizationCache.clear(); - - const I1 = "the quick brown fox jumps over the lazy dog"; - const I2 = "I baked some cakes"; - - const O1 = tokenize( - I1, - "english", - false, - defaultTokenizerConfig("english", { - stemmingFn: ENStemmer, - customStopWords: ["quick", "brown", "fox", "dog"], - }), - ); - - const O2 = tokenize( - I2, - "english", - false, - defaultTokenizerConfig("english", { - stemmingFn: ENStemmer, - customStopWords: ["quick", "brown", "fox", "dog"], - }), - ); - - t.same(O1, ["the", "jump", "over", "lazi"]); - t.same(O2, ["i", "bake", "some", "cake"]); - }); - - t.test("custom stop-words function", async t => { - t.plan(2); - - normalizationCache.clear(); - - const I1 = "the quick brown fox jumps over the lazy dog"; - const I2 = "I baked some cakes"; - - const O1 = tokenize( - I1, - "english", - false, - defaultTokenizerConfig("english", { - customStopWords(words: string[]): string[] { - return [...words, "quick", "brown", "fox", "dog"]; - }, - }), - ); - const O2 = tokenize( - I2, - "english", - false, - defaultTokenizerConfig("english", { - customStopWords(words: string[]): string[] { - return [...words, "quick", "brown", "fox", "dog"]; - }, - }), - ); - - t.same(O1, ["jump", "lazi"]); - t.same(O2, ["bake", "cake"]); - }); - - t.test("disable stop-words", async t => { - t.plan(2); - - normalizationCache.clear(); - - const I1 = "the quick brown fox jumps over the lazy dog"; - const I2 = "I baked some cakes"; - - const O1 = tokenize(I1, "english", false, defaultTokenizerConfig("english", { enableStopWords: false })); - const O2 = tokenize(I2, "english", false, defaultTokenizerConfig("english", { enableStopWords: false })); - - t.same(O1, ["the", "quick", "brown", "fox", "jump", "over", "lazi", "dog"]); - t.same(O2, ["i", "bake", "some", "cake"]); - }); - - t.test("disable stemming", async t => { - t.plan(2); - - normalizationCache.clear(); - - const I1 = "the quick brown fox jumps over the lazy dog"; - const I2 = "I baked some cakes"; - - const O1 = tokenize( - I1, - "english", - false, - defaultTokenizerConfig("english", { - enableStemming: false, - customStopWords: stopWords.english, - }), - ); - const O2 = tokenize( - I2, - "english", - false, - defaultTokenizerConfig("english", { - enableStemming: false, - customStopWords: stopWords.english, - }), - ); - - t.same(O1, ["quick", "brown", "fox", "jumps", "lazy", "dog"]); - t.same(O2, ["baked", "cakes"]); - }); - - t.test("custom stemming function", async t => { - t.plan(2); - - normalizationCache.clear(); - - const I1 = "the quick brown fox jumps over the lazy dog"; - const I2 = "I baked some cakes"; - - const O1 = tokenize( - I1, - "english", - false, - defaultTokenizerConfig("english", { - customStopWords: stopWords.english, - stemmingFn: word => `${word}-ish`, - }), - ); - const O2 = tokenize( - I2, - "english", - false, - defaultTokenizerConfig("english", { - customStopWords: stopWords.english, - stemmingFn: word => `${word}-ish`, - }), - ); - - t.same(O1, ["quick-ish", "brown-ish", "fox-ish", "jumps-ish", "lazy-ish", "dog-ish"]); - t.same(O2, ["baked-ish", "cakes-ish"]); - }); - - t.test("should validate options", async t => { - t.plan(5); - - // @ts-expect-error testing validation - t.throws(() => defaultTokenizerConfig("english", { tokenizerFn: "FOO" }), { - message: "tokenizer.tokenizerFn must be a function.", - }); - // @ts-expect-error testing validation - t.throws(() => defaultTokenizerConfig("english", { stemmingFn: "FOO" }), { - message: "tokenizer.stemmingFn property must be a function.", - }); - // @ts-expect-error testing validation - t.throws(() => defaultTokenizerConfig("english", { stemmingFn: ENStemmer, customStopWords: "FOO" }), { - message: "Custom stop words must be a function or an array of strings.", - }); - // @ts-expect-error testing validation - t.throws(() => defaultTokenizerConfig("english", { stemmingFn: ENStemmer, customStopWords: [1, 2, 3] }), { - message: "Custom stop words array must only contain strings.", - }); - // @ts-expect-error testing validation - t.throws(() => defaultTokenizerConfig("english", { stemmingFn: ENStemmer, customStopWords: {} }), { - message: "Custom stop words must be a function or an array of strings.", - }); - }); -}); diff --git a/tsconfig.json b/tsconfig.json index a6634b3..441935b 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -12,11 +12,7 @@ "skipLibCheck": true, "resolveJsonModule": true, "sourceMap": true, - "moduleResolution": "node", - "baseUrl": ".", - "paths": { - "@stemmer/*": ["./stemmer/lib/*"] - } + "moduleResolution": "node" }, "include": ["src/*.ts", "src/**/*.ts"] }