diff --git a/Hyphenopoly.js b/Hyphenopoly.js index 8b4d72a6..7f1d36f3 100644 --- a/Hyphenopoly.js +++ b/Hyphenopoly.js @@ -99,6 +99,7 @@ "keepAlive": setProp(true, 2), "normalize": setProp(false, 2), "safeCopy": setProp(true, 2), + "substitutions": setProp(empty(), 2), "timeout": setProp(1000, 2) }); @@ -497,6 +498,8 @@ "msg": "found word longer than 61 characters" }); hw = word; + } else if (lo.reNotAlphabet.test(word)) { + hw = word; } else { /* eslint-disable security/detect-object-injection */ hw = lo.hyphenate( @@ -505,8 +508,8 @@ selSettings.leftminPerLang[lang], selSettings.rightminPerLang[lang] ); - /* eslint-enable security/detect-object-injection */ } + /* eslint-enable security/detect-object-injection */ } else { hw = hyphenateCompound(word); } @@ -574,7 +577,14 @@ const orphanController = (orphanControllerPool.has(sel)) ? orphanControllerPool.get(sel) : createOrphanController(sel); - const re = lo.re.get(sel); + + /* + * Transpiled RegExp of + * /[${alphabet}\p{Letter}-]{${minwordlength},}/gui + */ + const reWord = RegExp( + `[${lo.alphabet}a-z\u00DF-\u00F6\u00F8-\u00FE\u0101\u0103\u0105\u0107\u0109\u010D\u010F\u0111\u0113\u0117\u0119\u011B\u011D\u011F\u0123\u0125\u012B\u012F\u0131\u0135\u0137\u013C\u013E\u0142\u0144\u0146\u0148\u014D\u0151\u0153\u0155\u0159\u015B\u015D\u015F\u0161\u0165\u016B\u016D\u016F\u0171\u0173\u017A\u017C\u017E\u017F\u01CE\u01D0\u01D2\u01D4\u01D6\u01D8\u01DA\u01DC\u0219\u021B\u02BC\u0390\u03AC-\u03CE\u03D0\u03E3\u03E5\u03E7\u03E9\u03EB\u03ED\u03EF\u03F2\u0430-\u044F\u0451-\u045C\u045E\u045F\u0491\u04AF\u04E9\u0561-\u0585\u0587\u0905-\u090C\u090F\u0910\u0913-\u0928\u092A-\u0930\u0932\u0933\u0935-\u0939\u093D\u0960\u0961\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A85-\u0A8B\u0A8F\u0A90\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AE0\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B60\u0B61\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB5\u0BB7-\u0BB9\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D28\u0D2A-\u0D39\u0D60\u0D61\u0D7A-\u0D7F\u0E01-\u0E2E\u0E30\u0E32\u0E33\u0E40-\u0E45\u10D0-\u10F0\u1200-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u1E0D\u1E37\u1E41\u1E43\u1E45\u1E47\u1E6D\u1F00-\u1F07\u1F10-\u1F15\u1F20-\u1F27\u1F30-\u1F37\u1F40-\u1F45\u1F50-\u1F57\u1F60-\u1F67\u1F70-\u1F7D\u1F80-\u1F87\u1F90-\u1F97\u1FA0-\u1FA7\u1FB2-\u1FB4\u1FB6\u1FB7\u1FC2-\u1FC4\u1FC6\u1FC7\u1FD2\u1FD3\u1FD6\u1FD7\u1FE2-\u1FE7\u1FF2-\u1FF4\u1FF6\u1FF7\u2C81\u2C83\u2C85\u2C87\u2C89\u2C8D\u2C8F\u2C91\u2C93\u2C95\u2C97\u2C99\u2C9B\u2C9D\u2C9F\u2CA1\u2CA3\u2CA5\u2CA7\u2CA9\u2CAB\u2CAD\u2CAF\u2CB1\u2CC9\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E-]{${minWordLength},}`, "gui" + ); /** * Hyphenate text according to setting in sel @@ -584,9 +594,9 @@ function hyphenateText(text) { let tn = null; if (C.normalize) { - tn = text.normalize("NFC").replace(re, wordHyphenator); + tn = text.normalize("NFC").replace(reWord, wordHyphenator); } else { - tn = text.replace(re, wordHyphenator); + tn = text.replace(reWord, wordHyphenator); } if (selSettings.orphanControl !== 1) { tn = tn.replace( @@ -751,7 +761,8 @@ lo.exc = new Map(); } /* eslint-enable security/detect-object-injection */ - lo.re = new Map(); + lo.alphabet = alphabet; + lo.reNotAlphabet = RegExp(`[^${alphabet}]`, "gi"); lo.hyphenate = hyphenateFunction; C.selectors.forEach((sel) => { /* eslint-disable security/detect-object-injection */ @@ -784,16 +795,6 @@ Number(selSettings.rightminPerLang[lang]) || 0 ); /* eslint-enable security/detect-object-injection */ - - /* - * Find words with characters from `alphabet` and - * `Zero Width Non-Joiner` and `-` with a min length. - * - * This regexp is not perfect. It also finds parts of words - * that follow a character that is not in the `alphabet`. - * Word delimiters are not taken in account. - */ - lo.re.set(sel, RegExp(`[${alphabet}\u200C-]{${selSettings.minWordLength},}`, "gi")); }); lo.ready = true; // eslint-disable-next-line security/detect-object-injection @@ -852,10 +853,34 @@ */ function instantiateWasmEngine(heProm, lang) { const wa = window.WebAssembly; + + // eslint-disable-next-line require-jsdoc + function registerSubstitutions(alphalen, exp) { + /* eslint-disable security/detect-object-injection */ + if (H.c.substitute && H.c.substitute[lang]) { + const subst = H.c.substitute[lang]; + eachKey(subst, (sChar) => { + const sCharU = sChar.toUpperCase(); + let sCharUcc = 0; + if (sCharU !== sChar) { + sCharUcc = sCharU.charCodeAt(0); + } + alphalen = exp.subst( + sChar.charCodeAt(0), + sCharUcc, + subst[sChar].charCodeAt(0) + ); + }); + } + return alphalen; + /* eslint-enable security/detect-object-injection */ + } + // eslint-disable-next-line require-jsdoc function handleWasm(res) { const exp = res.instance.exports; - const alphalen = exp.conv(); + let alphalen = exp.conv(); + alphalen = registerSubstitutions(alphalen, exp); const baseData = { /* eslint-disable multiline-ternary */ "buf": exp.mem.buffer, @@ -871,7 +896,7 @@ baseData, exp.hyphenate ), - decode(new Uint16Array(exp.mem.buffer, 770, alphalen - 1)), + decode(new Uint16Array(exp.mem.buffer, 1026, alphalen - 1)), baseData.lm, baseData.rm ); diff --git a/docs/Setup.md b/docs/Setup.md index 212ebe1e..6a410dfb 100644 --- a/docs/Setup.md +++ b/docs/Setup.md @@ -10,6 +10,7 @@ These page documents the optional fields in `setup`: * [keepAlive](#keepalive) * [normalize](#normalize) * [safeCopy](#safecopy) + * [substitute](#substitute) * [timeout](#timeout) * [Selector Based Settings](#selector-based-settings) * [compound](#compound) @@ -269,6 +270,34 @@ To prevent soft hyphens from being copied to the clipboard, Hyphenopoly.js regis _It does NOT remove other `hyphen`-characters!_ This feature is on by default, but it's a hack – disable it if you don't like it. +### substitute +```` +type: Object +default: undefined +```` +Substitute characters +````html + +```` +If a word contains a letter that is not part of the alphabet defined in the sample file, this word is not hyphenated by default. This is the case for example with "communiqué". The letter "é" is not in the English alphabet, so the word cannot be hyphenated. +These problems can be solved with letter substitutions. If you want to use the letter "e" instead of the letter "é" for the hyphenation process, you can specify this accordingly (see example). +"communiqué" is then separated (com-mu-niqué). + +The substitute object must contain language-codes as keys. The values are objects theirselves, with the characters to be substituted as keys and the substituting characters as values (both lowercase only – Hyphenopoly handles all the letter casing, if necessary). + ### timeout ```` type: number diff --git a/hyphenopoly.module.js b/hyphenopoly.module.js index d72a8ed3..b6f51deb 100644 --- a/hyphenopoly.module.js +++ b/hyphenopoly.module.js @@ -255,9 +255,8 @@ function prepareLanguagesObj( } else { lo.exceptions = new Map(); } - /* eslint-disable security/detect-non-literal-regexp */ - lo.genRegExp = new RegExp(`[${alphabet}\u200C-]{${H.c.minWordLength},}`, "gi"); - /* eslint-enable security/detect-non-literal-regexp */ + lo.alphabet = alphabet; + lo.reNotAlphabet = RegExp(`[^${alphabet}]`, "gi"); (() => { H.c.leftminPerLang[lang] = Math.max( patternLeftmin, @@ -323,6 +322,28 @@ function encloseHyphenateFunction(baseData, hyphenateFunc) { * @returns {undefined} */ function instantiateWasmEngine(lang) { + // eslint-disable-next-line require-jsdoc + function registerSubstitutions(alphalen, exp) { + /* eslint-disable security/detect-object-injection */ + if (H.c.substitute && H.c.substitute[lang]) { + const subst = H.c.substitute[lang]; + Object.keys(subst).forEach((sChar) => { + const sCharU = sChar.toUpperCase(); + let sCharUcc = 0; + if (sCharU !== sChar) { + sCharUcc = sCharU.charCodeAt(0); + } + alphalen = exp.subst( + sChar.charCodeAt(0), + sCharUcc, + subst[sChar].charCodeAt(0) + ); + }); + } + return alphalen; + /* eslint-enable security/detect-object-injection */ + } + // eslint-disable-next-line require-jsdoc function handleWasm(inst) { const exp = inst.exports; @@ -335,14 +356,15 @@ function instantiateWasmEngine(lang) { "wo": (WebAssembly.Global) ? exp.uwo.value : exp.uwo /* eslint-enable multiline-ternary */ }; - const alphalen = exp.conv(); + let alphalen = exp.conv(); + alphalen = registerSubstitutions(alphalen, exp); prepareLanguagesObj( lang, encloseHyphenateFunction( baseData, exp.hyphenate ), - decode(new Uint16Array(exp.mem.buffer, 770, alphalen - 1)), + decode(new Uint16Array(exp.mem.buffer, 1026, alphalen - 1)), baseData.lm, baseData.rm ); @@ -431,6 +453,8 @@ function createWordHyphenator(lo, lang) { if (word.length > 61) { H.events.dispatch("error", {"msg": "found word longer than 61 characters"}); hw = word; + } else if (lo.reNotAlphabet.test(word)) { + hw = word; } else { hw = lo.hyphenateFunction( word, @@ -494,6 +518,14 @@ function createTextHyphenator(lang) { ? wordHyphenatorPool.get(lang) : createWordHyphenator(lo, lang); + /* + * Transpiled RegExp of + * /[${alphabet}\p{Letter}-]{${minwordlength},}/gui + */ + const reWord = RegExp( + `[${lo.alphabet}a-z\u00DF-\u00F6\u00F8-\u00FE\u0101\u0103\u0105\u0107\u0109\u010D\u010F\u0111\u0113\u0117\u0119\u011B\u011D\u011F\u0123\u0125\u012B\u012F\u0131\u0135\u0137\u013C\u013E\u0142\u0144\u0146\u0148\u014D\u0151\u0153\u0155\u0159\u015B\u015D\u015F\u0161\u0165\u016B\u016D\u016F\u0171\u0173\u017A\u017C\u017E\u017F\u01CE\u01D0\u01D2\u01D4\u01D6\u01D8\u01DA\u01DC\u0219\u021B\u02BC\u0390\u03AC-\u03CE\u03D0\u03E3\u03E5\u03E7\u03E9\u03EB\u03ED\u03EF\u03F2\u0430-\u044F\u0451-\u045C\u045E\u045F\u0491\u04AF\u04E9\u0561-\u0585\u0587\u0905-\u090C\u090F\u0910\u0913-\u0928\u092A-\u0930\u0932\u0933\u0935-\u0939\u093D\u0960\u0961\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A85-\u0A8B\u0A8F\u0A90\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AE0\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B60\u0B61\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB5\u0BB7-\u0BB9\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D28\u0D2A-\u0D39\u0D60\u0D61\u0D7A-\u0D7F\u0E01-\u0E2E\u0E30\u0E32\u0E33\u0E40-\u0E45\u10D0-\u10F0\u1200-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u1E0D\u1E37\u1E41\u1E43\u1E45\u1E47\u1E6D\u1F00-\u1F07\u1F10-\u1F15\u1F20-\u1F27\u1F30-\u1F37\u1F40-\u1F45\u1F50-\u1F57\u1F60-\u1F67\u1F70-\u1F7D\u1F80-\u1F87\u1F90-\u1F97\u1FA0-\u1FA7\u1FB2-\u1FB4\u1FB6\u1FB7\u1FC2-\u1FC4\u1FC6\u1FC7\u1FD2\u1FD3\u1FD6\u1FD7\u1FE2-\u1FE7\u1FF2-\u1FF4\u1FF6\u1FF7\u2C81\u2C83\u2C85\u2C87\u2C89\u2C8D\u2C8F\u2C91\u2C93\u2C95\u2C97\u2C99\u2C9B\u2C9D\u2C9F\u2CA1\u2CA3\u2CA5\u2CA7\u2CA9\u2CAB\u2CAD\u2CAF\u2CB1\u2CC9\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E-]{${H.c.minWordLength},}`, "gui" + ); + /** * Hyphenate text * @param {string} text The text @@ -504,7 +536,7 @@ function createTextHyphenator(lang) { if (H.c.normalize) { text = text.normalize("NFC"); } - let tn = text.replace(lo.genRegExp, wordHyphenator); + let tn = text.replace(reWord, wordHyphenator); if (H.c.orphanControl !== 1) { tn = tn.replace( // eslint-disable-next-line prefer-named-capture-group @@ -621,6 +653,7 @@ H.config = ((userConfig) => { "require": setProp([], 2), "rightmin": setProp(0, 3), "rightminPerLang": setProp(empty(), 2), + "substitute": setProp(empty(), 2), "sync": setProp(false, 2) }); const settings = Object.create(defaults); diff --git a/lang/af/af.wasm b/lang/af/af.wasm index d508baef..657f779f 100644 Binary files a/lang/af/af.wasm and b/lang/af/af.wasm differ diff --git a/lang/af/src/g.ts b/lang/af/src/g.ts index e910c57e..0961feed 100644 --- a/lang/af/src/g.ts +++ b/lang/af/src/g.ts @@ -1,11 +1,11 @@ -export const to: i32 = 5060952; -export const po: i32 = 5061114; +export const to: i32 = 5061208; +export const po: i32 = 5061370; export const pl: i32 = 55096; -export const vs: i32 = 1280; -export const pt: i32 = 48904; -export const wo: i32 = 5059884; -export const tw: i32 = 5060012; -export const hp: i32 = 5060076; -export const hw: i32 = 5060140; +export const vs: i32 = 1536; +export const pt: i32 = 49160; +export const wo: i32 = 5060140; +export const tw: i32 = 5060268; +export const hp: i32 = 5060332; +export const hw: i32 = 5060396; export const lm: i32 = 1; export const rm: i32 = 2; diff --git a/lang/af/src/hyphenEngine.ts b/lang/af/src/hyphenEngine.ts index 2f603c23..6043b680 100644 --- a/lang/af/src/hyphenEngine.ts +++ b/lang/af/src/hyphenEngine.ts @@ -5,6 +5,8 @@ export const hwo: i32 = hw; export const lmi: i32 = lm; export const rmi: i32 = rm; +let alphabetCount: i32 = 0; + /** * Maps BMP-charCode (16bit) to 8bit adresses * @@ -46,7 +48,6 @@ function createTranslateMap(): i32 { let first: i32 = 0; let second: i32 = 0; let secondInt: i32 = 0; - let alphabetCount: i32 = 0; i = to + 2; while (i < po) { first = load(i); @@ -69,13 +70,27 @@ function createTranslateMap(): i32 { pushToTranslateMap(first, secondInt); } // Add to alphabet - store(alphabetCount, first, 768); + store(alphabetCount, first, 1024); alphabetCount += 2; i += 4; } return alphabetCount >> 1; } +export function subst(ccl: i32, ccu: i32, replcc: i32): i32 { + const replccInt: i32 = pullFromTranslateMap(replcc); + if (replccInt !== 255) { + pushToTranslateMap(ccl, replccInt); + if (ccu !== 0) { + pushToTranslateMap(ccu, replccInt); + } + // Add to alphabet + store(alphabetCount, ccl, 1024); + alphabetCount += 2; + } + return alphabetCount >> 1; +} + export function conv(): i32 { let i: i32 = po; const patternEnd: i32 = po + pl; diff --git a/lang/as/as.wasm b/lang/as/as.wasm index 3b9e0d97..d39e057b 100644 Binary files a/lang/as/as.wasm and b/lang/as/as.wasm differ diff --git a/lang/as/src/g.ts b/lang/as/src/g.ts index e5f173f7..517721ed 100644 --- a/lang/as/src/g.ts +++ b/lang/as/src/g.ts @@ -1,11 +1,11 @@ -export const to: i32 = 3052; -export const po: i32 = 3346; +export const to: i32 = 3308; +export const po: i32 = 3602; export const pl: i32 = 228; -export const vs: i32 = 1280; -export const pt: i32 = 1464; -export const wo: i32 = 2048; -export const tw: i32 = 2176; -export const hp: i32 = 2240; -export const hw: i32 = 2304; +export const vs: i32 = 1536; +export const pt: i32 = 1720; +export const wo: i32 = 2304; +export const tw: i32 = 2432; +export const hp: i32 = 2496; +export const hw: i32 = 2560; export const lm: i32 = 1; export const rm: i32 = 1; diff --git a/lang/as/src/hyphenEngine.ts b/lang/as/src/hyphenEngine.ts index 2f603c23..6043b680 100644 --- a/lang/as/src/hyphenEngine.ts +++ b/lang/as/src/hyphenEngine.ts @@ -5,6 +5,8 @@ export const hwo: i32 = hw; export const lmi: i32 = lm; export const rmi: i32 = rm; +let alphabetCount: i32 = 0; + /** * Maps BMP-charCode (16bit) to 8bit adresses * @@ -46,7 +48,6 @@ function createTranslateMap(): i32 { let first: i32 = 0; let second: i32 = 0; let secondInt: i32 = 0; - let alphabetCount: i32 = 0; i = to + 2; while (i < po) { first = load(i); @@ -69,13 +70,27 @@ function createTranslateMap(): i32 { pushToTranslateMap(first, secondInt); } // Add to alphabet - store(alphabetCount, first, 768); + store(alphabetCount, first, 1024); alphabetCount += 2; i += 4; } return alphabetCount >> 1; } +export function subst(ccl: i32, ccu: i32, replcc: i32): i32 { + const replccInt: i32 = pullFromTranslateMap(replcc); + if (replccInt !== 255) { + pushToTranslateMap(ccl, replccInt); + if (ccu !== 0) { + pushToTranslateMap(ccu, replccInt); + } + // Add to alphabet + store(alphabetCount, ccl, 1024); + alphabetCount += 2; + } + return alphabetCount >> 1; +} + export function conv(): i32 { let i: i32 = po; const patternEnd: i32 = po + pl; diff --git a/lang/be/be.wasm b/lang/be/be.wasm index a8cc47fc..fd20e5eb 100644 Binary files a/lang/be/be.wasm and b/lang/be/be.wasm differ diff --git a/lang/be/src/g.ts b/lang/be/src/g.ts index c9e6287e..c6e150de 100644 --- a/lang/be/src/g.ts +++ b/lang/be/src/g.ts @@ -1,11 +1,11 @@ -export const to: i32 = 252080; -export const po: i32 = 252230; +export const to: i32 = 252336; +export const po: i32 = 252486; export const pl: i32 = 10475; -export const vs: i32 = 1280; -export const pt: i32 = 15624; -export const wo: i32 = 251120; -export const tw: i32 = 251248; -export const hp: i32 = 251312; -export const hw: i32 = 251376; +export const vs: i32 = 1536; +export const pt: i32 = 15880; +export const wo: i32 = 251376; +export const tw: i32 = 251504; +export const hp: i32 = 251568; +export const hw: i32 = 251632; export const lm: i32 = 2; export const rm: i32 = 2; diff --git a/lang/be/src/hyphenEngine.ts b/lang/be/src/hyphenEngine.ts index 2f603c23..6043b680 100644 --- a/lang/be/src/hyphenEngine.ts +++ b/lang/be/src/hyphenEngine.ts @@ -5,6 +5,8 @@ export const hwo: i32 = hw; export const lmi: i32 = lm; export const rmi: i32 = rm; +let alphabetCount: i32 = 0; + /** * Maps BMP-charCode (16bit) to 8bit adresses * @@ -46,7 +48,6 @@ function createTranslateMap(): i32 { let first: i32 = 0; let second: i32 = 0; let secondInt: i32 = 0; - let alphabetCount: i32 = 0; i = to + 2; while (i < po) { first = load(i); @@ -69,13 +70,27 @@ function createTranslateMap(): i32 { pushToTranslateMap(first, secondInt); } // Add to alphabet - store(alphabetCount, first, 768); + store(alphabetCount, first, 1024); alphabetCount += 2; i += 4; } return alphabetCount >> 1; } +export function subst(ccl: i32, ccu: i32, replcc: i32): i32 { + const replccInt: i32 = pullFromTranslateMap(replcc); + if (replccInt !== 255) { + pushToTranslateMap(ccl, replccInt); + if (ccu !== 0) { + pushToTranslateMap(ccu, replccInt); + } + // Add to alphabet + store(alphabetCount, ccl, 1024); + alphabetCount += 2; + } + return alphabetCount >> 1; +} + export function conv(): i32 { let i: i32 = po; const patternEnd: i32 = po + pl; diff --git a/lang/bg/bg.wasm b/lang/bg/bg.wasm index 2c974bd5..3b29561c 100644 Binary files a/lang/bg/bg.wasm and b/lang/bg/bg.wasm differ diff --git a/lang/bg/src/g.ts b/lang/bg/src/g.ts index cab0215a..1910ebe7 100644 --- a/lang/bg/src/g.ts +++ b/lang/bg/src/g.ts @@ -1,11 +1,11 @@ -export const to: i32 = 223704; -export const po: i32 = 223826; +export const to: i32 = 223960; +export const po: i32 = 224082; export const pl: i32 = 20462; -export const vs: i32 = 1280; -export const pt: i32 = 33244; -export const wo: i32 = 222340; -export const tw: i32 = 222468; -export const hp: i32 = 222532; -export const hw: i32 = 222596; +export const vs: i32 = 1536; +export const pt: i32 = 33500; +export const wo: i32 = 222596; +export const tw: i32 = 222724; +export const hp: i32 = 222788; +export const hw: i32 = 222852; export const lm: i32 = 2; export const rm: i32 = 2; diff --git a/lang/bg/src/hyphenEngine.ts b/lang/bg/src/hyphenEngine.ts index 2f603c23..6043b680 100644 --- a/lang/bg/src/hyphenEngine.ts +++ b/lang/bg/src/hyphenEngine.ts @@ -5,6 +5,8 @@ export const hwo: i32 = hw; export const lmi: i32 = lm; export const rmi: i32 = rm; +let alphabetCount: i32 = 0; + /** * Maps BMP-charCode (16bit) to 8bit adresses * @@ -46,7 +48,6 @@ function createTranslateMap(): i32 { let first: i32 = 0; let second: i32 = 0; let secondInt: i32 = 0; - let alphabetCount: i32 = 0; i = to + 2; while (i < po) { first = load(i); @@ -69,13 +70,27 @@ function createTranslateMap(): i32 { pushToTranslateMap(first, secondInt); } // Add to alphabet - store(alphabetCount, first, 768); + store(alphabetCount, first, 1024); alphabetCount += 2; i += 4; } return alphabetCount >> 1; } +export function subst(ccl: i32, ccu: i32, replcc: i32): i32 { + const replccInt: i32 = pullFromTranslateMap(replcc); + if (replccInt !== 255) { + pushToTranslateMap(ccl, replccInt); + if (ccu !== 0) { + pushToTranslateMap(ccu, replccInt); + } + // Add to alphabet + store(alphabetCount, ccl, 1024); + alphabetCount += 2; + } + return alphabetCount >> 1; +} + export function conv(): i32 { let i: i32 = po; const patternEnd: i32 = po + pl; diff --git a/lang/bn/bn.wasm b/lang/bn/bn.wasm index 51c83690..0c075e02 100644 Binary files a/lang/bn/bn.wasm and b/lang/bn/bn.wasm differ diff --git a/lang/bn/src/g.ts b/lang/bn/src/g.ts index 1a146ee2..431284df 100644 --- a/lang/bn/src/g.ts +++ b/lang/bn/src/g.ts @@ -1,11 +1,11 @@ -export const to: i32 = 3048; -export const po: i32 = 3342; +export const to: i32 = 3304; +export const po: i32 = 3598; export const pl: i32 = 228; -export const vs: i32 = 1280; -export const pt: i32 = 1464; -export const wo: i32 = 2048; -export const tw: i32 = 2176; -export const hp: i32 = 2240; -export const hw: i32 = 2304; +export const vs: i32 = 1536; +export const pt: i32 = 1720; +export const wo: i32 = 2304; +export const tw: i32 = 2432; +export const hp: i32 = 2496; +export const hw: i32 = 2560; export const lm: i32 = 1; export const rm: i32 = 1; diff --git a/lang/bn/src/hyphenEngine.ts b/lang/bn/src/hyphenEngine.ts index 2f603c23..6043b680 100644 --- a/lang/bn/src/hyphenEngine.ts +++ b/lang/bn/src/hyphenEngine.ts @@ -5,6 +5,8 @@ export const hwo: i32 = hw; export const lmi: i32 = lm; export const rmi: i32 = rm; +let alphabetCount: i32 = 0; + /** * Maps BMP-charCode (16bit) to 8bit adresses * @@ -46,7 +48,6 @@ function createTranslateMap(): i32 { let first: i32 = 0; let second: i32 = 0; let secondInt: i32 = 0; - let alphabetCount: i32 = 0; i = to + 2; while (i < po) { first = load(i); @@ -69,13 +70,27 @@ function createTranslateMap(): i32 { pushToTranslateMap(first, secondInt); } // Add to alphabet - store(alphabetCount, first, 768); + store(alphabetCount, first, 1024); alphabetCount += 2; i += 4; } return alphabetCount >> 1; } +export function subst(ccl: i32, ccu: i32, replcc: i32): i32 { + const replccInt: i32 = pullFromTranslateMap(replcc); + if (replccInt !== 255) { + pushToTranslateMap(ccl, replccInt); + if (ccu !== 0) { + pushToTranslateMap(ccu, replccInt); + } + // Add to alphabet + store(alphabetCount, ccl, 1024); + alphabetCount += 2; + } + return alphabetCount >> 1; +} + export function conv(): i32 { let i: i32 = po; const patternEnd: i32 = po + pl; diff --git a/lang/ca/ca.wasm b/lang/ca/ca.wasm index 9c6f9975..6eeebb87 100644 Binary files a/lang/ca/ca.wasm and b/lang/ca/ca.wasm differ diff --git a/lang/ca/src/g.ts b/lang/ca/src/g.ts index 73da773d..56cb3092 100644 --- a/lang/ca/src/g.ts +++ b/lang/ca/src/g.ts @@ -1,11 +1,11 @@ -export const to: i32 = 99944; -export const po: i32 = 100086; +export const to: i32 = 100200; +export const po: i32 = 100342; export const pl: i32 = 2764; -export const vs: i32 = 1280; -export const pt: i32 = 4364; -export const wo: i32 = 98932; -export const tw: i32 = 99060; -export const hp: i32 = 99124; -export const hw: i32 = 99188; +export const vs: i32 = 1536; +export const pt: i32 = 4620; +export const wo: i32 = 99188; +export const tw: i32 = 99316; +export const hp: i32 = 99380; +export const hw: i32 = 99444; export const lm: i32 = 2; export const rm: i32 = 2; diff --git a/lang/ca/src/hyphenEngine.ts b/lang/ca/src/hyphenEngine.ts index 2f603c23..6043b680 100644 --- a/lang/ca/src/hyphenEngine.ts +++ b/lang/ca/src/hyphenEngine.ts @@ -5,6 +5,8 @@ export const hwo: i32 = hw; export const lmi: i32 = lm; export const rmi: i32 = rm; +let alphabetCount: i32 = 0; + /** * Maps BMP-charCode (16bit) to 8bit adresses * @@ -46,7 +48,6 @@ function createTranslateMap(): i32 { let first: i32 = 0; let second: i32 = 0; let secondInt: i32 = 0; - let alphabetCount: i32 = 0; i = to + 2; while (i < po) { first = load(i); @@ -69,13 +70,27 @@ function createTranslateMap(): i32 { pushToTranslateMap(first, secondInt); } // Add to alphabet - store(alphabetCount, first, 768); + store(alphabetCount, first, 1024); alphabetCount += 2; i += 4; } return alphabetCount >> 1; } +export function subst(ccl: i32, ccu: i32, replcc: i32): i32 { + const replccInt: i32 = pullFromTranslateMap(replcc); + if (replccInt !== 255) { + pushToTranslateMap(ccl, replccInt); + if (ccu !== 0) { + pushToTranslateMap(ccu, replccInt); + } + // Add to alphabet + store(alphabetCount, ccl, 1024); + alphabetCount += 2; + } + return alphabetCount >> 1; +} + export function conv(): i32 { let i: i32 = po; const patternEnd: i32 = po + pl; diff --git a/lang/cop/cop.wasm b/lang/cop/cop.wasm index 2c4d09f4..23f4705d 100644 Binary files a/lang/cop/cop.wasm and b/lang/cop/cop.wasm differ diff --git a/lang/cop/src/g.ts b/lang/cop/src/g.ts index dc5809cb..c6d0f9ab 100644 --- a/lang/cop/src/g.ts +++ b/lang/cop/src/g.ts @@ -1,11 +1,11 @@ -export const to: i32 = 29932; -export const po: i32 = 30074; +export const to: i32 = 30188; +export const po: i32 = 30330; export const pl: i32 = 1550; -export const vs: i32 = 1280; -export const pt: i32 = 3168; -export const wo: i32 = 29008; -export const tw: i32 = 29136; -export const hp: i32 = 29200; -export const hw: i32 = 29264; +export const vs: i32 = 1536; +export const pt: i32 = 3424; +export const wo: i32 = 29264; +export const tw: i32 = 29392; +export const hp: i32 = 29456; +export const hw: i32 = 29520; export const lm: i32 = 1; export const rm: i32 = 1; diff --git a/lang/cop/src/hyphenEngine.ts b/lang/cop/src/hyphenEngine.ts index 2f603c23..6043b680 100644 --- a/lang/cop/src/hyphenEngine.ts +++ b/lang/cop/src/hyphenEngine.ts @@ -5,6 +5,8 @@ export const hwo: i32 = hw; export const lmi: i32 = lm; export const rmi: i32 = rm; +let alphabetCount: i32 = 0; + /** * Maps BMP-charCode (16bit) to 8bit adresses * @@ -46,7 +48,6 @@ function createTranslateMap(): i32 { let first: i32 = 0; let second: i32 = 0; let secondInt: i32 = 0; - let alphabetCount: i32 = 0; i = to + 2; while (i < po) { first = load(i); @@ -69,13 +70,27 @@ function createTranslateMap(): i32 { pushToTranslateMap(first, secondInt); } // Add to alphabet - store(alphabetCount, first, 768); + store(alphabetCount, first, 1024); alphabetCount += 2; i += 4; } return alphabetCount >> 1; } +export function subst(ccl: i32, ccu: i32, replcc: i32): i32 { + const replccInt: i32 = pullFromTranslateMap(replcc); + if (replccInt !== 255) { + pushToTranslateMap(ccl, replccInt); + if (ccu !== 0) { + pushToTranslateMap(ccu, replccInt); + } + // Add to alphabet + store(alphabetCount, ccl, 1024); + alphabetCount += 2; + } + return alphabetCount >> 1; +} + export function conv(): i32 { let i: i32 = po; const patternEnd: i32 = po + pl; diff --git a/lang/cs/cs.wasm b/lang/cs/cs.wasm index 6c87fba5..807fbfb1 100644 Binary files a/lang/cs/cs.wasm and b/lang/cs/cs.wasm differ diff --git a/lang/cs/src/g.ts b/lang/cs/src/g.ts index 641262d2..4e068ee7 100644 --- a/lang/cs/src/g.ts +++ b/lang/cs/src/g.ts @@ -1,11 +1,11 @@ -export const to: i32 = 761252; -export const po: i32 = 761422; +export const to: i32 = 761508; +export const po: i32 = 761678; export const pl: i32 = 12545; -export const vs: i32 = 1280; -export const pt: i32 = 14296; -export const wo: i32 = 760252; -export const tw: i32 = 760380; -export const hp: i32 = 760444; -export const hw: i32 = 760508; +export const vs: i32 = 1536; +export const pt: i32 = 14552; +export const wo: i32 = 760508; +export const tw: i32 = 760636; +export const hp: i32 = 760700; +export const hw: i32 = 760764; export const lm: i32 = 2; export const rm: i32 = 3; diff --git a/lang/cs/src/hyphenEngine.ts b/lang/cs/src/hyphenEngine.ts index 2f603c23..6043b680 100644 --- a/lang/cs/src/hyphenEngine.ts +++ b/lang/cs/src/hyphenEngine.ts @@ -5,6 +5,8 @@ export const hwo: i32 = hw; export const lmi: i32 = lm; export const rmi: i32 = rm; +let alphabetCount: i32 = 0; + /** * Maps BMP-charCode (16bit) to 8bit adresses * @@ -46,7 +48,6 @@ function createTranslateMap(): i32 { let first: i32 = 0; let second: i32 = 0; let secondInt: i32 = 0; - let alphabetCount: i32 = 0; i = to + 2; while (i < po) { first = load(i); @@ -69,13 +70,27 @@ function createTranslateMap(): i32 { pushToTranslateMap(first, secondInt); } // Add to alphabet - store(alphabetCount, first, 768); + store(alphabetCount, first, 1024); alphabetCount += 2; i += 4; } return alphabetCount >> 1; } +export function subst(ccl: i32, ccu: i32, replcc: i32): i32 { + const replccInt: i32 = pullFromTranslateMap(replcc); + if (replccInt !== 255) { + pushToTranslateMap(ccl, replccInt); + if (ccu !== 0) { + pushToTranslateMap(ccu, replccInt); + } + // Add to alphabet + store(alphabetCount, ccl, 1024); + alphabetCount += 2; + } + return alphabetCount >> 1; +} + export function conv(): i32 { let i: i32 = po; const patternEnd: i32 = po + pl; diff --git a/lang/cy/cy.wasm b/lang/cy/cy.wasm index fb616840..bfdfe7cd 100644 Binary files a/lang/cy/cy.wasm and b/lang/cy/cy.wasm differ diff --git a/lang/cy/src/g.ts b/lang/cy/src/g.ts index 6d0fab0a..49c41bb7 100644 --- a/lang/cy/src/g.ts +++ b/lang/cy/src/g.ts @@ -1,11 +1,11 @@ -export const to: i32 = 1172116; -export const po: i32 = 1172230; +export const to: i32 = 1172372; +export const po: i32 = 1172486; export const pl: i32 = 27543; -export const vs: i32 = 1280; -export const pt: i32 = 30716; -export const wo: i32 = 1171168; -export const tw: i32 = 1171296; -export const hp: i32 = 1171360; -export const hw: i32 = 1171424; +export const vs: i32 = 1536; +export const pt: i32 = 30972; +export const wo: i32 = 1171424; +export const tw: i32 = 1171552; +export const hp: i32 = 1171616; +export const hw: i32 = 1171680; export const lm: i32 = 2; export const rm: i32 = 3; diff --git a/lang/cy/src/hyphenEngine.ts b/lang/cy/src/hyphenEngine.ts index 2f603c23..6043b680 100644 --- a/lang/cy/src/hyphenEngine.ts +++ b/lang/cy/src/hyphenEngine.ts @@ -5,6 +5,8 @@ export const hwo: i32 = hw; export const lmi: i32 = lm; export const rmi: i32 = rm; +let alphabetCount: i32 = 0; + /** * Maps BMP-charCode (16bit) to 8bit adresses * @@ -46,7 +48,6 @@ function createTranslateMap(): i32 { let first: i32 = 0; let second: i32 = 0; let secondInt: i32 = 0; - let alphabetCount: i32 = 0; i = to + 2; while (i < po) { first = load(i); @@ -69,13 +70,27 @@ function createTranslateMap(): i32 { pushToTranslateMap(first, secondInt); } // Add to alphabet - store(alphabetCount, first, 768); + store(alphabetCount, first, 1024); alphabetCount += 2; i += 4; } return alphabetCount >> 1; } +export function subst(ccl: i32, ccu: i32, replcc: i32): i32 { + const replccInt: i32 = pullFromTranslateMap(replcc); + if (replccInt !== 255) { + pushToTranslateMap(ccl, replccInt); + if (ccu !== 0) { + pushToTranslateMap(ccu, replccInt); + } + // Add to alphabet + store(alphabetCount, ccl, 1024); + alphabetCount += 2; + } + return alphabetCount >> 1; +} + export function conv(): i32 { let i: i32 = po; const patternEnd: i32 = po + pl; diff --git a/lang/da/da.wasm b/lang/da/da.wasm index a17e3e46..2b775b4c 100644 Binary files a/lang/da/da.wasm and b/lang/da/da.wasm differ diff --git a/lang/da/src/g.ts b/lang/da/src/g.ts index d2c4748e..22377c3f 100644 --- a/lang/da/src/g.ts +++ b/lang/da/src/g.ts @@ -1,11 +1,11 @@ -export const to: i32 = 160920; -export const po: i32 = 161042; +export const to: i32 = 161176; +export const po: i32 = 161298; export const pl: i32 = 4223; -export const vs: i32 = 1280; -export const pt: i32 = 5060; -export const wo: i32 = 159996; -export const tw: i32 = 160124; -export const hp: i32 = 160188; -export const hw: i32 = 160252; +export const vs: i32 = 1536; +export const pt: i32 = 5316; +export const wo: i32 = 160252; +export const tw: i32 = 160380; +export const hp: i32 = 160444; +export const hw: i32 = 160508; export const lm: i32 = 2; export const rm: i32 = 2; diff --git a/lang/da/src/hyphenEngine.ts b/lang/da/src/hyphenEngine.ts index 2f603c23..6043b680 100644 --- a/lang/da/src/hyphenEngine.ts +++ b/lang/da/src/hyphenEngine.ts @@ -5,6 +5,8 @@ export const hwo: i32 = hw; export const lmi: i32 = lm; export const rmi: i32 = rm; +let alphabetCount: i32 = 0; + /** * Maps BMP-charCode (16bit) to 8bit adresses * @@ -46,7 +48,6 @@ function createTranslateMap(): i32 { let first: i32 = 0; let second: i32 = 0; let secondInt: i32 = 0; - let alphabetCount: i32 = 0; i = to + 2; while (i < po) { first = load(i); @@ -69,13 +70,27 @@ function createTranslateMap(): i32 { pushToTranslateMap(first, secondInt); } // Add to alphabet - store(alphabetCount, first, 768); + store(alphabetCount, first, 1024); alphabetCount += 2; i += 4; } return alphabetCount >> 1; } +export function subst(ccl: i32, ccu: i32, replcc: i32): i32 { + const replccInt: i32 = pullFromTranslateMap(replcc); + if (replccInt !== 255) { + pushToTranslateMap(ccl, replccInt); + if (ccu !== 0) { + pushToTranslateMap(ccu, replccInt); + } + // Add to alphabet + store(alphabetCount, ccl, 1024); + alphabetCount += 2; + } + return alphabetCount >> 1; +} + export function conv(): i32 { let i: i32 = po; const patternEnd: i32 = po + pl; diff --git a/lang/de/de.wasm b/lang/de/de.wasm index 4fd73893..bc20fb4f 100644 Binary files a/lang/de/de.wasm and b/lang/de/de.wasm differ diff --git a/lang/de/src/g.ts b/lang/de/src/g.ts index d794389e..5992961f 100644 --- a/lang/de/src/g.ts +++ b/lang/de/src/g.ts @@ -1,11 +1,11 @@ -export const to: i32 = 3425164; -export const po: i32 = 3425294; +export const to: i32 = 3425420; +export const po: i32 = 3425550; export const pl: i32 = 81727; -export const vs: i32 = 1280; -export const pt: i32 = 77432; -export const wo: i32 = 3423484; -export const tw: i32 = 3423612; -export const hp: i32 = 3423676; -export const hw: i32 = 3423740; +export const vs: i32 = 1536; +export const pt: i32 = 77688; +export const wo: i32 = 3423740; +export const tw: i32 = 3423868; +export const hp: i32 = 3423932; +export const hw: i32 = 3423996; export const lm: i32 = 2; export const rm: i32 = 2; diff --git a/lang/de/src/hyphenEngine.ts b/lang/de/src/hyphenEngine.ts index 2f603c23..6043b680 100644 --- a/lang/de/src/hyphenEngine.ts +++ b/lang/de/src/hyphenEngine.ts @@ -5,6 +5,8 @@ export const hwo: i32 = hw; export const lmi: i32 = lm; export const rmi: i32 = rm; +let alphabetCount: i32 = 0; + /** * Maps BMP-charCode (16bit) to 8bit adresses * @@ -46,7 +48,6 @@ function createTranslateMap(): i32 { let first: i32 = 0; let second: i32 = 0; let secondInt: i32 = 0; - let alphabetCount: i32 = 0; i = to + 2; while (i < po) { first = load(i); @@ -69,13 +70,27 @@ function createTranslateMap(): i32 { pushToTranslateMap(first, secondInt); } // Add to alphabet - store(alphabetCount, first, 768); + store(alphabetCount, first, 1024); alphabetCount += 2; i += 4; } return alphabetCount >> 1; } +export function subst(ccl: i32, ccu: i32, replcc: i32): i32 { + const replccInt: i32 = pullFromTranslateMap(replcc); + if (replccInt !== 255) { + pushToTranslateMap(ccl, replccInt); + if (ccu !== 0) { + pushToTranslateMap(ccu, replccInt); + } + // Add to alphabet + store(alphabetCount, ccl, 1024); + alphabetCount += 2; + } + return alphabetCount >> 1; +} + export function conv(): i32 { let i: i32 = po; const patternEnd: i32 = po + pl; diff --git a/lang/el-monoton/el-monoton.wasm b/lang/el-monoton/el-monoton.wasm index c78dfdda..a635273e 100644 Binary files a/lang/el-monoton/el-monoton.wasm and b/lang/el-monoton/el-monoton.wasm differ diff --git a/lang/el-monoton/src/g.ts b/lang/el-monoton/src/g.ts index d85ff8e6..16656d3a 100644 --- a/lang/el-monoton/src/g.ts +++ b/lang/el-monoton/src/g.ts @@ -1,11 +1,11 @@ -export const to: i32 = 45884; -export const po: i32 = 46102; +export const to: i32 = 46140; +export const po: i32 = 46358; export const pl: i32 = 1373; -export const vs: i32 = 1280; -export const pt: i32 = 2924; -export const wo: i32 = 44936; -export const tw: i32 = 45064; -export const hp: i32 = 45128; -export const hw: i32 = 45192; +export const vs: i32 = 1536; +export const pt: i32 = 3180; +export const wo: i32 = 45192; +export const tw: i32 = 45320; +export const hp: i32 = 45384; +export const hw: i32 = 45448; export const lm: i32 = 1; export const rm: i32 = 1; diff --git a/lang/el-monoton/src/hyphenEngine.ts b/lang/el-monoton/src/hyphenEngine.ts index 2f603c23..6043b680 100644 --- a/lang/el-monoton/src/hyphenEngine.ts +++ b/lang/el-monoton/src/hyphenEngine.ts @@ -5,6 +5,8 @@ export const hwo: i32 = hw; export const lmi: i32 = lm; export const rmi: i32 = rm; +let alphabetCount: i32 = 0; + /** * Maps BMP-charCode (16bit) to 8bit adresses * @@ -46,7 +48,6 @@ function createTranslateMap(): i32 { let first: i32 = 0; let second: i32 = 0; let secondInt: i32 = 0; - let alphabetCount: i32 = 0; i = to + 2; while (i < po) { first = load(i); @@ -69,13 +70,27 @@ function createTranslateMap(): i32 { pushToTranslateMap(first, secondInt); } // Add to alphabet - store(alphabetCount, first, 768); + store(alphabetCount, first, 1024); alphabetCount += 2; i += 4; } return alphabetCount >> 1; } +export function subst(ccl: i32, ccu: i32, replcc: i32): i32 { + const replccInt: i32 = pullFromTranslateMap(replcc); + if (replccInt !== 255) { + pushToTranslateMap(ccl, replccInt); + if (ccu !== 0) { + pushToTranslateMap(ccu, replccInt); + } + // Add to alphabet + store(alphabetCount, ccl, 1024); + alphabetCount += 2; + } + return alphabetCount >> 1; +} + export function conv(): i32 { let i: i32 = po; const patternEnd: i32 = po + pl; diff --git a/lang/el-polyton/el-polyton.wasm b/lang/el-polyton/el-polyton.wasm index 8ae19b01..b55c3cbf 100644 Binary files a/lang/el-polyton/el-polyton.wasm and b/lang/el-polyton/el-polyton.wasm differ diff --git a/lang/el-polyton/src/g.ts b/lang/el-polyton/src/g.ts index cd9e9f18..a1be42cc 100644 --- a/lang/el-polyton/src/g.ts +++ b/lang/el-polyton/src/g.ts @@ -1,11 +1,11 @@ -export const to: i32 = 1207768; -export const po: i32 = 1208674; +export const to: i32 = 1208024; +export const po: i32 = 1208930; export const pl: i32 = 4745; -export const vs: i32 = 1280; -export const pt: i32 = 6028; -export const wo: i32 = 1206820; -export const tw: i32 = 1206948; -export const hp: i32 = 1207012; -export const hw: i32 = 1207076; +export const vs: i32 = 1536; +export const pt: i32 = 6284; +export const wo: i32 = 1207076; +export const tw: i32 = 1207204; +export const hp: i32 = 1207268; +export const hw: i32 = 1207332; export const lm: i32 = 1; export const rm: i32 = 1; diff --git a/lang/el-polyton/src/hyphenEngine.ts b/lang/el-polyton/src/hyphenEngine.ts index 2f603c23..6043b680 100644 --- a/lang/el-polyton/src/hyphenEngine.ts +++ b/lang/el-polyton/src/hyphenEngine.ts @@ -5,6 +5,8 @@ export const hwo: i32 = hw; export const lmi: i32 = lm; export const rmi: i32 = rm; +let alphabetCount: i32 = 0; + /** * Maps BMP-charCode (16bit) to 8bit adresses * @@ -46,7 +48,6 @@ function createTranslateMap(): i32 { let first: i32 = 0; let second: i32 = 0; let secondInt: i32 = 0; - let alphabetCount: i32 = 0; i = to + 2; while (i < po) { first = load(i); @@ -69,13 +70,27 @@ function createTranslateMap(): i32 { pushToTranslateMap(first, secondInt); } // Add to alphabet - store(alphabetCount, first, 768); + store(alphabetCount, first, 1024); alphabetCount += 2; i += 4; } return alphabetCount >> 1; } +export function subst(ccl: i32, ccu: i32, replcc: i32): i32 { + const replccInt: i32 = pullFromTranslateMap(replcc); + if (replccInt !== 255) { + pushToTranslateMap(ccl, replccInt); + if (ccu !== 0) { + pushToTranslateMap(ccu, replccInt); + } + // Add to alphabet + store(alphabetCount, ccl, 1024); + alphabetCount += 2; + } + return alphabetCount >> 1; +} + export function conv(): i32 { let i: i32 = po; const patternEnd: i32 = po + pl; diff --git a/lang/en-gb/en-gb.wasm b/lang/en-gb/en-gb.wasm index 1e9a09ba..c780ed8b 100644 Binary files a/lang/en-gb/en-gb.wasm and b/lang/en-gb/en-gb.wasm differ diff --git a/lang/en-gb/src/g.ts b/lang/en-gb/src/g.ts index b2d4c1f6..c02cc7dc 100644 --- a/lang/en-gb/src/g.ts +++ b/lang/en-gb/src/g.ts @@ -1,11 +1,11 @@ -export const to: i32 = 1530604; -export const po: i32 = 1530714; +export const to: i32 = 1530860; +export const po: i32 = 1530970; export const pl: i32 = 35329; -export const vs: i32 = 1280; -export const pt: i32 = 36928; -export const wo: i32 = 1529624; -export const tw: i32 = 1529752; -export const hp: i32 = 1529816; -export const hw: i32 = 1529880; +export const vs: i32 = 1536; +export const pt: i32 = 37184; +export const wo: i32 = 1529880; +export const tw: i32 = 1530008; +export const hp: i32 = 1530072; +export const hw: i32 = 1530136; export const lm: i32 = 2; export const rm: i32 = 3; diff --git a/lang/en-gb/src/hyphenEngine.ts b/lang/en-gb/src/hyphenEngine.ts index 2f603c23..6043b680 100644 --- a/lang/en-gb/src/hyphenEngine.ts +++ b/lang/en-gb/src/hyphenEngine.ts @@ -5,6 +5,8 @@ export const hwo: i32 = hw; export const lmi: i32 = lm; export const rmi: i32 = rm; +let alphabetCount: i32 = 0; + /** * Maps BMP-charCode (16bit) to 8bit adresses * @@ -46,7 +48,6 @@ function createTranslateMap(): i32 { let first: i32 = 0; let second: i32 = 0; let secondInt: i32 = 0; - let alphabetCount: i32 = 0; i = to + 2; while (i < po) { first = load(i); @@ -69,13 +70,27 @@ function createTranslateMap(): i32 { pushToTranslateMap(first, secondInt); } // Add to alphabet - store(alphabetCount, first, 768); + store(alphabetCount, first, 1024); alphabetCount += 2; i += 4; } return alphabetCount >> 1; } +export function subst(ccl: i32, ccu: i32, replcc: i32): i32 { + const replccInt: i32 = pullFromTranslateMap(replcc); + if (replccInt !== 255) { + pushToTranslateMap(ccl, replccInt); + if (ccu !== 0) { + pushToTranslateMap(ccu, replccInt); + } + // Add to alphabet + store(alphabetCount, ccl, 1024); + alphabetCount += 2; + } + return alphabetCount >> 1; +} + export function conv(): i32 { let i: i32 = po; const patternEnd: i32 = po + pl; diff --git a/lang/en-us/en-us.wasm b/lang/en-us/en-us.wasm index 2f8bd671..2030fed4 100644 Binary files a/lang/en-us/en-us.wasm and b/lang/en-us/en-us.wasm differ diff --git a/lang/en-us/src/g.ts b/lang/en-us/src/g.ts index b2da20a3..8a9e2978 100644 --- a/lang/en-us/src/g.ts +++ b/lang/en-us/src/g.ts @@ -1,11 +1,11 @@ -export const to: i32 = 970680; -export const po: i32 = 970790; +export const to: i32 = 970936; +export const po: i32 = 971046; export const pl: i32 = 22250; -export const vs: i32 = 1280; -export const pt: i32 = 21652; -export const wo: i32 = 969628; -export const tw: i32 = 969756; -export const hp: i32 = 969820; -export const hw: i32 = 969884; +export const vs: i32 = 1536; +export const pt: i32 = 21908; +export const wo: i32 = 969884; +export const tw: i32 = 970012; +export const hp: i32 = 970076; +export const hw: i32 = 970140; export const lm: i32 = 2; export const rm: i32 = 3; diff --git a/lang/en-us/src/hyphenEngine.ts b/lang/en-us/src/hyphenEngine.ts index 2f603c23..6043b680 100644 --- a/lang/en-us/src/hyphenEngine.ts +++ b/lang/en-us/src/hyphenEngine.ts @@ -5,6 +5,8 @@ export const hwo: i32 = hw; export const lmi: i32 = lm; export const rmi: i32 = rm; +let alphabetCount: i32 = 0; + /** * Maps BMP-charCode (16bit) to 8bit adresses * @@ -46,7 +48,6 @@ function createTranslateMap(): i32 { let first: i32 = 0; let second: i32 = 0; let secondInt: i32 = 0; - let alphabetCount: i32 = 0; i = to + 2; while (i < po) { first = load(i); @@ -69,13 +70,27 @@ function createTranslateMap(): i32 { pushToTranslateMap(first, secondInt); } // Add to alphabet - store(alphabetCount, first, 768); + store(alphabetCount, first, 1024); alphabetCount += 2; i += 4; } return alphabetCount >> 1; } +export function subst(ccl: i32, ccu: i32, replcc: i32): i32 { + const replccInt: i32 = pullFromTranslateMap(replcc); + if (replccInt !== 255) { + pushToTranslateMap(ccl, replccInt); + if (ccu !== 0) { + pushToTranslateMap(ccu, replccInt); + } + // Add to alphabet + store(alphabetCount, ccl, 1024); + alphabetCount += 2; + } + return alphabetCount >> 1; +} + export function conv(): i32 { let i: i32 = po; const patternEnd: i32 = po + pl; diff --git a/lang/eo/eo.wasm b/lang/eo/eo.wasm index 9964b57f..11f2fc66 100644 Binary files a/lang/eo/eo.wasm and b/lang/eo/eo.wasm differ diff --git a/lang/eo/src/g.ts b/lang/eo/src/g.ts index cffd71a2..9309a48c 100644 --- a/lang/eo/src/g.ts +++ b/lang/eo/src/g.ts @@ -1,11 +1,11 @@ -export const to: i32 = 788076; -export const po: i32 = 788194; +export const to: i32 = 788332; +export const po: i32 = 788450; export const pl: i32 = 12999; -export const vs: i32 = 1280; -export const pt: i32 = 13028; -export const wo: i32 = 787104; -export const tw: i32 = 787232; -export const hp: i32 = 787296; -export const hw: i32 = 787360; +export const vs: i32 = 1536; +export const pt: i32 = 13284; +export const wo: i32 = 787360; +export const tw: i32 = 787488; +export const hp: i32 = 787552; +export const hw: i32 = 787616; export const lm: i32 = 2; export const rm: i32 = 2; diff --git a/lang/eo/src/hyphenEngine.ts b/lang/eo/src/hyphenEngine.ts index 2f603c23..6043b680 100644 --- a/lang/eo/src/hyphenEngine.ts +++ b/lang/eo/src/hyphenEngine.ts @@ -5,6 +5,8 @@ export const hwo: i32 = hw; export const lmi: i32 = lm; export const rmi: i32 = rm; +let alphabetCount: i32 = 0; + /** * Maps BMP-charCode (16bit) to 8bit adresses * @@ -46,7 +48,6 @@ function createTranslateMap(): i32 { let first: i32 = 0; let second: i32 = 0; let secondInt: i32 = 0; - let alphabetCount: i32 = 0; i = to + 2; while (i < po) { first = load(i); @@ -69,13 +70,27 @@ function createTranslateMap(): i32 { pushToTranslateMap(first, secondInt); } // Add to alphabet - store(alphabetCount, first, 768); + store(alphabetCount, first, 1024); alphabetCount += 2; i += 4; } return alphabetCount >> 1; } +export function subst(ccl: i32, ccu: i32, replcc: i32): i32 { + const replccInt: i32 = pullFromTranslateMap(replcc); + if (replccInt !== 255) { + pushToTranslateMap(ccl, replccInt); + if (ccu !== 0) { + pushToTranslateMap(ccu, replccInt); + } + // Add to alphabet + store(alphabetCount, ccl, 1024); + alphabetCount += 2; + } + return alphabetCount >> 1; +} + export function conv(): i32 { let i: i32 = po; const patternEnd: i32 = po + pl; diff --git a/lang/es/es.wasm b/lang/es/es.wasm index 0656a7fc..63e56159 100644 Binary files a/lang/es/es.wasm and b/lang/es/es.wasm differ diff --git a/lang/es/src/g.ts b/lang/es/src/g.ts index 6f04ce25..7df4442b 100644 --- a/lang/es/src/g.ts +++ b/lang/es/src/g.ts @@ -1,11 +1,11 @@ -export const to: i32 = 818200; -export const po: i32 = 818334; +export const to: i32 = 818456; +export const po: i32 = 818590; export const pl: i32 = 26257; -export const vs: i32 = 1280; -export const pt: i32 = 28056; -export const wo: i32 = 817312; -export const tw: i32 = 817440; -export const hp: i32 = 817504; -export const hw: i32 = 817568; +export const vs: i32 = 1536; +export const pt: i32 = 28312; +export const wo: i32 = 817568; +export const tw: i32 = 817696; +export const hp: i32 = 817760; +export const hw: i32 = 817824; export const lm: i32 = 2; export const rm: i32 = 2; diff --git a/lang/es/src/hyphenEngine.ts b/lang/es/src/hyphenEngine.ts index 2f603c23..6043b680 100644 --- a/lang/es/src/hyphenEngine.ts +++ b/lang/es/src/hyphenEngine.ts @@ -5,6 +5,8 @@ export const hwo: i32 = hw; export const lmi: i32 = lm; export const rmi: i32 = rm; +let alphabetCount: i32 = 0; + /** * Maps BMP-charCode (16bit) to 8bit adresses * @@ -46,7 +48,6 @@ function createTranslateMap(): i32 { let first: i32 = 0; let second: i32 = 0; let secondInt: i32 = 0; - let alphabetCount: i32 = 0; i = to + 2; while (i < po) { first = load(i); @@ -69,13 +70,27 @@ function createTranslateMap(): i32 { pushToTranslateMap(first, secondInt); } // Add to alphabet - store(alphabetCount, first, 768); + store(alphabetCount, first, 1024); alphabetCount += 2; i += 4; } return alphabetCount >> 1; } +export function subst(ccl: i32, ccu: i32, replcc: i32): i32 { + const replccInt: i32 = pullFromTranslateMap(replcc); + if (replccInt !== 255) { + pushToTranslateMap(ccl, replccInt); + if (ccu !== 0) { + pushToTranslateMap(ccu, replccInt); + } + // Add to alphabet + store(alphabetCount, ccl, 1024); + alphabetCount += 2; + } + return alphabetCount >> 1; +} + export function conv(): i32 { let i: i32 = po; const patternEnd: i32 = po + pl; diff --git a/lang/et/et.wasm b/lang/et/et.wasm index cf939df4..2a042169 100644 Binary files a/lang/et/et.wasm and b/lang/et/et.wasm differ diff --git a/lang/et/src/g.ts b/lang/et/src/g.ts index 4352dade..6d4756c1 100644 --- a/lang/et/src/g.ts +++ b/lang/et/src/g.ts @@ -1,11 +1,11 @@ -export const to: i32 = 708088; -export const po: i32 = 708202; +export const to: i32 = 708344; +export const po: i32 = 708458; export const pl: i32 = 15039; -export const vs: i32 = 1280; -export const pt: i32 = 15200; -export const wo: i32 = 707176; -export const tw: i32 = 707304; -export const hp: i32 = 707368; -export const hw: i32 = 707432; +export const vs: i32 = 1536; +export const pt: i32 = 15456; +export const wo: i32 = 707432; +export const tw: i32 = 707560; +export const hp: i32 = 707624; +export const hw: i32 = 707688; export const lm: i32 = 2; export const rm: i32 = 3; diff --git a/lang/et/src/hyphenEngine.ts b/lang/et/src/hyphenEngine.ts index 2f603c23..6043b680 100644 --- a/lang/et/src/hyphenEngine.ts +++ b/lang/et/src/hyphenEngine.ts @@ -5,6 +5,8 @@ export const hwo: i32 = hw; export const lmi: i32 = lm; export const rmi: i32 = rm; +let alphabetCount: i32 = 0; + /** * Maps BMP-charCode (16bit) to 8bit adresses * @@ -46,7 +48,6 @@ function createTranslateMap(): i32 { let first: i32 = 0; let second: i32 = 0; let secondInt: i32 = 0; - let alphabetCount: i32 = 0; i = to + 2; while (i < po) { first = load(i); @@ -69,13 +70,27 @@ function createTranslateMap(): i32 { pushToTranslateMap(first, secondInt); } // Add to alphabet - store(alphabetCount, first, 768); + store(alphabetCount, first, 1024); alphabetCount += 2; i += 4; } return alphabetCount >> 1; } +export function subst(ccl: i32, ccu: i32, replcc: i32): i32 { + const replccInt: i32 = pullFromTranslateMap(replcc); + if (replccInt !== 255) { + pushToTranslateMap(ccl, replccInt); + if (ccu !== 0) { + pushToTranslateMap(ccu, replccInt); + } + // Add to alphabet + store(alphabetCount, ccl, 1024); + alphabetCount += 2; + } + return alphabetCount >> 1; +} + export function conv(): i32 { let i: i32 = po; const patternEnd: i32 = po + pl; diff --git a/lang/eu/eu.wasm b/lang/eu/eu.wasm index 2f67fde2..7f5456f5 100644 Binary files a/lang/eu/eu.wasm and b/lang/eu/eu.wasm differ diff --git a/lang/eu/src/g.ts b/lang/eu/src/g.ts index 843639fa..43dfb75d 100644 --- a/lang/eu/src/g.ts +++ b/lang/eu/src/g.ts @@ -1,11 +1,11 @@ -export const to: i32 = 13512; -export const po: i32 = 13622; +export const to: i32 = 13768; +export const po: i32 = 13878; export const pl: i32 = 467; -export const vs: i32 = 1280; -export const pt: i32 = 1756; -export const wo: i32 = 10772; -export const tw: i32 = 10900; -export const hp: i32 = 10964; -export const hw: i32 = 11028; +export const vs: i32 = 1536; +export const pt: i32 = 2012; +export const wo: i32 = 11028; +export const tw: i32 = 11156; +export const hp: i32 = 11220; +export const hw: i32 = 11284; export const lm: i32 = 2; export const rm: i32 = 2; diff --git a/lang/eu/src/hyphenEngine.ts b/lang/eu/src/hyphenEngine.ts index 2f603c23..6043b680 100644 --- a/lang/eu/src/hyphenEngine.ts +++ b/lang/eu/src/hyphenEngine.ts @@ -5,6 +5,8 @@ export const hwo: i32 = hw; export const lmi: i32 = lm; export const rmi: i32 = rm; +let alphabetCount: i32 = 0; + /** * Maps BMP-charCode (16bit) to 8bit adresses * @@ -46,7 +48,6 @@ function createTranslateMap(): i32 { let first: i32 = 0; let second: i32 = 0; let secondInt: i32 = 0; - let alphabetCount: i32 = 0; i = to + 2; while (i < po) { first = load(i); @@ -69,13 +70,27 @@ function createTranslateMap(): i32 { pushToTranslateMap(first, secondInt); } // Add to alphabet - store(alphabetCount, first, 768); + store(alphabetCount, first, 1024); alphabetCount += 2; i += 4; } return alphabetCount >> 1; } +export function subst(ccl: i32, ccu: i32, replcc: i32): i32 { + const replccInt: i32 = pullFromTranslateMap(replcc); + if (replccInt !== 255) { + pushToTranslateMap(ccl, replccInt); + if (ccu !== 0) { + pushToTranslateMap(ccu, replccInt); + } + // Add to alphabet + store(alphabetCount, ccl, 1024); + alphabetCount += 2; + } + return alphabetCount >> 1; +} + export function conv(): i32 { let i: i32 = po; const patternEnd: i32 = po + pl; diff --git a/lang/fi/fi.wasm b/lang/fi/fi.wasm index a01ef966..0380f07d 100644 Binary files a/lang/fi/fi.wasm and b/lang/fi/fi.wasm differ diff --git a/lang/fi/src/g.ts b/lang/fi/src/g.ts index 0fe7d93c..e22eb589 100644 --- a/lang/fi/src/g.ts +++ b/lang/fi/src/g.ts @@ -1,11 +1,11 @@ -export const to: i32 = 38512; -export const po: i32 = 38618; +export const to: i32 = 38768; +export const po: i32 = 38874; export const pl: i32 = 910; -export const vs: i32 = 1280; -export const pt: i32 = 2172; -export const wo: i32 = 37572; -export const tw: i32 = 37700; -export const hp: i32 = 37764; -export const hw: i32 = 37828; +export const vs: i32 = 1536; +export const pt: i32 = 2428; +export const wo: i32 = 37828; +export const tw: i32 = 37956; +export const hp: i32 = 38020; +export const hw: i32 = 38084; export const lm: i32 = 2; export const rm: i32 = 2; diff --git a/lang/fi/src/hyphenEngine.ts b/lang/fi/src/hyphenEngine.ts index 2f603c23..6043b680 100644 --- a/lang/fi/src/hyphenEngine.ts +++ b/lang/fi/src/hyphenEngine.ts @@ -5,6 +5,8 @@ export const hwo: i32 = hw; export const lmi: i32 = lm; export const rmi: i32 = rm; +let alphabetCount: i32 = 0; + /** * Maps BMP-charCode (16bit) to 8bit adresses * @@ -46,7 +48,6 @@ function createTranslateMap(): i32 { let first: i32 = 0; let second: i32 = 0; let secondInt: i32 = 0; - let alphabetCount: i32 = 0; i = to + 2; while (i < po) { first = load(i); @@ -69,13 +70,27 @@ function createTranslateMap(): i32 { pushToTranslateMap(first, secondInt); } // Add to alphabet - store(alphabetCount, first, 768); + store(alphabetCount, first, 1024); alphabetCount += 2; i += 4; } return alphabetCount >> 1; } +export function subst(ccl: i32, ccu: i32, replcc: i32): i32 { + const replccInt: i32 = pullFromTranslateMap(replcc); + if (replccInt !== 255) { + pushToTranslateMap(ccl, replccInt); + if (ccu !== 0) { + pushToTranslateMap(ccu, replccInt); + } + // Add to alphabet + store(alphabetCount, ccl, 1024); + alphabetCount += 2; + } + return alphabetCount >> 1; +} + export function conv(): i32 { let i: i32 = po; const patternEnd: i32 = po + pl; diff --git a/lang/fr/fr.wasm b/lang/fr/fr.wasm index ac16c456..a7cf0525 100644 Binary files a/lang/fr/fr.wasm and b/lang/fr/fr.wasm differ diff --git a/lang/fr/src/g.ts b/lang/fr/src/g.ts index 6f6355ff..310d21a5 100644 --- a/lang/fr/src/g.ts +++ b/lang/fr/src/g.ts @@ -1,11 +1,11 @@ -export const to: i32 = 712024; -export const po: i32 = 712186; +export const to: i32 = 712280; +export const po: i32 = 712442; export const pl: i32 = 7140; -export const vs: i32 = 1280; -export const pt: i32 = 6840; -export const wo: i32 = 710888; -export const tw: i32 = 711016; -export const hp: i32 = 711080; -export const hw: i32 = 711144; +export const vs: i32 = 1536; +export const pt: i32 = 7096; +export const wo: i32 = 711144; +export const tw: i32 = 711272; +export const hp: i32 = 711336; +export const hw: i32 = 711400; export const lm: i32 = 2; export const rm: i32 = 2; diff --git a/lang/fr/src/hyphenEngine.ts b/lang/fr/src/hyphenEngine.ts index 2f603c23..6043b680 100644 --- a/lang/fr/src/hyphenEngine.ts +++ b/lang/fr/src/hyphenEngine.ts @@ -5,6 +5,8 @@ export const hwo: i32 = hw; export const lmi: i32 = lm; export const rmi: i32 = rm; +let alphabetCount: i32 = 0; + /** * Maps BMP-charCode (16bit) to 8bit adresses * @@ -46,7 +48,6 @@ function createTranslateMap(): i32 { let first: i32 = 0; let second: i32 = 0; let secondInt: i32 = 0; - let alphabetCount: i32 = 0; i = to + 2; while (i < po) { first = load(i); @@ -69,13 +70,27 @@ function createTranslateMap(): i32 { pushToTranslateMap(first, secondInt); } // Add to alphabet - store(alphabetCount, first, 768); + store(alphabetCount, first, 1024); alphabetCount += 2; i += 4; } return alphabetCount >> 1; } +export function subst(ccl: i32, ccu: i32, replcc: i32): i32 { + const replccInt: i32 = pullFromTranslateMap(replcc); + if (replccInt !== 255) { + pushToTranslateMap(ccl, replccInt); + if (ccu !== 0) { + pushToTranslateMap(ccu, replccInt); + } + // Add to alphabet + store(alphabetCount, ccl, 1024); + alphabetCount += 2; + } + return alphabetCount >> 1; +} + export function conv(): i32 { let i: i32 = po; const patternEnd: i32 = po + pl; diff --git a/lang/fur/fur.wasm b/lang/fur/fur.wasm index af5bf3a4..2f62705a 100644 Binary files a/lang/fur/fur.wasm and b/lang/fur/fur.wasm differ diff --git a/lang/fur/src/fur.hpb b/lang/fur/src/fur.hpb index e2ffa78e..0e878f52 100644 Binary files a/lang/fur/src/fur.hpb and b/lang/fur/src/fur.hpb differ diff --git a/lang/fur/src/g.ts b/lang/fur/src/g.ts index 6076e380..869dfc7c 100644 --- a/lang/fur/src/g.ts +++ b/lang/fur/src/g.ts @@ -1,11 +1,11 @@ -export const to: i32 = 45184; -export const po: i32 = 45306; +export const to: i32 = 45440; +export const po: i32 = 45570; export const pl: i32 = 1168; -export const vs: i32 = 1280; -export const pt: i32 = 2532; -export const wo: i32 = 44252; -export const tw: i32 = 44380; -export const hp: i32 = 44444; -export const hw: i32 = 44508; +export const vs: i32 = 1536; +export const pt: i32 = 2788; +export const wo: i32 = 44508; +export const tw: i32 = 44636; +export const hp: i32 = 44700; +export const hw: i32 = 44764; export const lm: i32 = 2; export const rm: i32 = 2; diff --git a/lang/fur/src/hyphenEngine.ts b/lang/fur/src/hyphenEngine.ts index 2f603c23..6043b680 100644 --- a/lang/fur/src/hyphenEngine.ts +++ b/lang/fur/src/hyphenEngine.ts @@ -5,6 +5,8 @@ export const hwo: i32 = hw; export const lmi: i32 = lm; export const rmi: i32 = rm; +let alphabetCount: i32 = 0; + /** * Maps BMP-charCode (16bit) to 8bit adresses * @@ -46,7 +48,6 @@ function createTranslateMap(): i32 { let first: i32 = 0; let second: i32 = 0; let secondInt: i32 = 0; - let alphabetCount: i32 = 0; i = to + 2; while (i < po) { first = load(i); @@ -69,13 +70,27 @@ function createTranslateMap(): i32 { pushToTranslateMap(first, secondInt); } // Add to alphabet - store(alphabetCount, first, 768); + store(alphabetCount, first, 1024); alphabetCount += 2; i += 4; } return alphabetCount >> 1; } +export function subst(ccl: i32, ccu: i32, replcc: i32): i32 { + const replccInt: i32 = pullFromTranslateMap(replcc); + if (replccInt !== 255) { + pushToTranslateMap(ccl, replccInt); + if (ccu !== 0) { + pushToTranslateMap(ccu, replccInt); + } + // Add to alphabet + store(alphabetCount, ccl, 1024); + alphabetCount += 2; + } + return alphabetCount >> 1; +} + export function conv(): i32 { let i: i32 = po; const patternEnd: i32 = po + pl; diff --git a/lang/ga/ga.wasm b/lang/ga/ga.wasm index f3219383..10e9ee5d 100644 Binary files a/lang/ga/ga.wasm and b/lang/ga/ga.wasm differ diff --git a/lang/ga/src/g.ts b/lang/ga/src/g.ts index 95cdcac6..7ee256f9 100644 --- a/lang/ga/src/g.ts +++ b/lang/ga/src/g.ts @@ -1,11 +1,11 @@ -export const to: i32 = 1299708; -export const po: i32 = 1299826; +export const to: i32 = 1299964; +export const po: i32 = 1300082; export const pl: i32 = 28579; -export const vs: i32 = 1280; -export const pt: i32 = 31124; -export const wo: i32 = 1298676; -export const tw: i32 = 1298804; -export const hp: i32 = 1298868; -export const hw: i32 = 1298932; +export const vs: i32 = 1536; +export const pt: i32 = 31380; +export const wo: i32 = 1298932; +export const tw: i32 = 1299060; +export const hp: i32 = 1299124; +export const hw: i32 = 1299188; export const lm: i32 = 2; export const rm: i32 = 3; diff --git a/lang/ga/src/hyphenEngine.ts b/lang/ga/src/hyphenEngine.ts index 2f603c23..6043b680 100644 --- a/lang/ga/src/hyphenEngine.ts +++ b/lang/ga/src/hyphenEngine.ts @@ -5,6 +5,8 @@ export const hwo: i32 = hw; export const lmi: i32 = lm; export const rmi: i32 = rm; +let alphabetCount: i32 = 0; + /** * Maps BMP-charCode (16bit) to 8bit adresses * @@ -46,7 +48,6 @@ function createTranslateMap(): i32 { let first: i32 = 0; let second: i32 = 0; let secondInt: i32 = 0; - let alphabetCount: i32 = 0; i = to + 2; while (i < po) { first = load(i); @@ -69,13 +70,27 @@ function createTranslateMap(): i32 { pushToTranslateMap(first, secondInt); } // Add to alphabet - store(alphabetCount, first, 768); + store(alphabetCount, first, 1024); alphabetCount += 2; i += 4; } return alphabetCount >> 1; } +export function subst(ccl: i32, ccu: i32, replcc: i32): i32 { + const replccInt: i32 = pullFromTranslateMap(replcc); + if (replccInt !== 255) { + pushToTranslateMap(ccl, replccInt); + if (ccu !== 0) { + pushToTranslateMap(ccu, replccInt); + } + // Add to alphabet + store(alphabetCount, ccl, 1024); + alphabetCount += 2; + } + return alphabetCount >> 1; +} + export function conv(): i32 { let i: i32 = po; const patternEnd: i32 = po + pl; diff --git a/lang/gl/gl.wasm b/lang/gl/gl.wasm index 174da1da..aed9669d 100644 Binary files a/lang/gl/gl.wasm and b/lang/gl/gl.wasm differ diff --git a/lang/gl/src/g.ts b/lang/gl/src/g.ts index 77455be1..d9a76df3 100644 --- a/lang/gl/src/g.ts +++ b/lang/gl/src/g.ts @@ -1,11 +1,11 @@ -export const to: i32 = 577756; -export const po: i32 = 577886; +export const to: i32 = 578012; +export const po: i32 = 578142; export const pl: i32 = 13882; -export const vs: i32 = 1280; -export const pt: i32 = 14644; -export const wo: i32 = 576760; -export const tw: i32 = 576888; -export const hp: i32 = 576952; -export const hw: i32 = 577016; +export const vs: i32 = 1536; +export const pt: i32 = 14900; +export const wo: i32 = 577016; +export const tw: i32 = 577144; +export const hp: i32 = 577208; +export const hw: i32 = 577272; export const lm: i32 = 2; export const rm: i32 = 2; diff --git a/lang/gl/src/hyphenEngine.ts b/lang/gl/src/hyphenEngine.ts index 2f603c23..6043b680 100644 --- a/lang/gl/src/hyphenEngine.ts +++ b/lang/gl/src/hyphenEngine.ts @@ -5,6 +5,8 @@ export const hwo: i32 = hw; export const lmi: i32 = lm; export const rmi: i32 = rm; +let alphabetCount: i32 = 0; + /** * Maps BMP-charCode (16bit) to 8bit adresses * @@ -46,7 +48,6 @@ function createTranslateMap(): i32 { let first: i32 = 0; let second: i32 = 0; let secondInt: i32 = 0; - let alphabetCount: i32 = 0; i = to + 2; while (i < po) { first = load(i); @@ -69,13 +70,27 @@ function createTranslateMap(): i32 { pushToTranslateMap(first, secondInt); } // Add to alphabet - store(alphabetCount, first, 768); + store(alphabetCount, first, 1024); alphabetCount += 2; i += 4; } return alphabetCount >> 1; } +export function subst(ccl: i32, ccu: i32, replcc: i32): i32 { + const replccInt: i32 = pullFromTranslateMap(replcc); + if (replccInt !== 255) { + pushToTranslateMap(ccl, replccInt); + if (ccu !== 0) { + pushToTranslateMap(ccu, replccInt); + } + // Add to alphabet + store(alphabetCount, ccl, 1024); + alphabetCount += 2; + } + return alphabetCount >> 1; +} + export function conv(): i32 { let i: i32 = po; const patternEnd: i32 = po + pl; diff --git a/lang/grc/grc.wasm b/lang/grc/grc.wasm index 75577042..0bf02af5 100644 Binary files a/lang/grc/grc.wasm and b/lang/grc/grc.wasm differ diff --git a/lang/grc/src/g.ts b/lang/grc/src/g.ts index 4d75bc92..165173a3 100644 --- a/lang/grc/src/g.ts +++ b/lang/grc/src/g.ts @@ -1,11 +1,11 @@ -export const to: i32 = 5306092; -export const po: i32 = 5307002; +export const to: i32 = 5306348; +export const po: i32 = 5307258; export const pl: i32 = 25229; -export const vs: i32 = 1280; -export const pt: i32 = 21240; -export const wo: i32 = 5305152; -export const tw: i32 = 5305280; -export const hp: i32 = 5305344; -export const hw: i32 = 5305408; +export const vs: i32 = 1536; +export const pt: i32 = 21496; +export const wo: i32 = 5305408; +export const tw: i32 = 5305536; +export const hp: i32 = 5305600; +export const hw: i32 = 5305664; export const lm: i32 = 1; export const rm: i32 = 1; diff --git a/lang/grc/src/hyphenEngine.ts b/lang/grc/src/hyphenEngine.ts index 2f603c23..6043b680 100644 --- a/lang/grc/src/hyphenEngine.ts +++ b/lang/grc/src/hyphenEngine.ts @@ -5,6 +5,8 @@ export const hwo: i32 = hw; export const lmi: i32 = lm; export const rmi: i32 = rm; +let alphabetCount: i32 = 0; + /** * Maps BMP-charCode (16bit) to 8bit adresses * @@ -46,7 +48,6 @@ function createTranslateMap(): i32 { let first: i32 = 0; let second: i32 = 0; let secondInt: i32 = 0; - let alphabetCount: i32 = 0; i = to + 2; while (i < po) { first = load(i); @@ -69,13 +70,27 @@ function createTranslateMap(): i32 { pushToTranslateMap(first, secondInt); } // Add to alphabet - store(alphabetCount, first, 768); + store(alphabetCount, first, 1024); alphabetCount += 2; i += 4; } return alphabetCount >> 1; } +export function subst(ccl: i32, ccu: i32, replcc: i32): i32 { + const replccInt: i32 = pullFromTranslateMap(replcc); + if (replccInt !== 255) { + pushToTranslateMap(ccl, replccInt); + if (ccu !== 0) { + pushToTranslateMap(ccu, replccInt); + } + // Add to alphabet + store(alphabetCount, ccl, 1024); + alphabetCount += 2; + } + return alphabetCount >> 1; +} + export function conv(): i32 { let i: i32 = po; const patternEnd: i32 = po + pl; diff --git a/lang/gu/gu.wasm b/lang/gu/gu.wasm index 9a31b0c2..482ce086 100644 Binary files a/lang/gu/gu.wasm and b/lang/gu/gu.wasm differ diff --git a/lang/gu/src/g.ts b/lang/gu/src/g.ts index cf917722..3246ddac 100644 --- a/lang/gu/src/g.ts +++ b/lang/gu/src/g.ts @@ -1,11 +1,11 @@ -export const to: i32 = 2984; -export const po: i32 = 3254; +export const to: i32 = 3240; +export const po: i32 = 3510; export const pl: i32 = 209; -export const vs: i32 = 1280; -export const pt: i32 = 1448; -export const wo: i32 = 1984; -export const tw: i32 = 2112; -export const hp: i32 = 2176; -export const hw: i32 = 2240; +export const vs: i32 = 1536; +export const pt: i32 = 1704; +export const wo: i32 = 2240; +export const tw: i32 = 2368; +export const hp: i32 = 2432; +export const hw: i32 = 2496; export const lm: i32 = 1; export const rm: i32 = 1; diff --git a/lang/gu/src/hyphenEngine.ts b/lang/gu/src/hyphenEngine.ts index 2f603c23..6043b680 100644 --- a/lang/gu/src/hyphenEngine.ts +++ b/lang/gu/src/hyphenEngine.ts @@ -5,6 +5,8 @@ export const hwo: i32 = hw; export const lmi: i32 = lm; export const rmi: i32 = rm; +let alphabetCount: i32 = 0; + /** * Maps BMP-charCode (16bit) to 8bit adresses * @@ -46,7 +48,6 @@ function createTranslateMap(): i32 { let first: i32 = 0; let second: i32 = 0; let secondInt: i32 = 0; - let alphabetCount: i32 = 0; i = to + 2; while (i < po) { first = load(i); @@ -69,13 +70,27 @@ function createTranslateMap(): i32 { pushToTranslateMap(first, secondInt); } // Add to alphabet - store(alphabetCount, first, 768); + store(alphabetCount, first, 1024); alphabetCount += 2; i += 4; } return alphabetCount >> 1; } +export function subst(ccl: i32, ccu: i32, replcc: i32): i32 { + const replccInt: i32 = pullFromTranslateMap(replcc); + if (replccInt !== 255) { + pushToTranslateMap(ccl, replccInt); + if (ccu !== 0) { + pushToTranslateMap(ccu, replccInt); + } + // Add to alphabet + store(alphabetCount, ccl, 1024); + alphabetCount += 2; + } + return alphabetCount >> 1; +} + export function conv(): i32 { let i: i32 = po; const patternEnd: i32 = po + pl; diff --git a/lang/hi/hi.wasm b/lang/hi/hi.wasm index 6f7c2f7b..d694dcc4 100644 Binary files a/lang/hi/hi.wasm and b/lang/hi/hi.wasm differ diff --git a/lang/hi/src/g.ts b/lang/hi/src/g.ts index 6f461500..0fd5d115 100644 --- a/lang/hi/src/g.ts +++ b/lang/hi/src/g.ts @@ -1,11 +1,11 @@ -export const to: i32 = 3024; -export const po: i32 = 3310; +export const to: i32 = 3280; +export const po: i32 = 3566; export const pl: i32 = 223; -export const vs: i32 = 1280; -export const pt: i32 = 1460; -export const wo: i32 = 2028; -export const tw: i32 = 2156; -export const hp: i32 = 2220; -export const hw: i32 = 2284; +export const vs: i32 = 1536; +export const pt: i32 = 1716; +export const wo: i32 = 2284; +export const tw: i32 = 2412; +export const hp: i32 = 2476; +export const hw: i32 = 2540; export const lm: i32 = 1; export const rm: i32 = 1; diff --git a/lang/hi/src/hyphenEngine.ts b/lang/hi/src/hyphenEngine.ts index 2f603c23..6043b680 100644 --- a/lang/hi/src/hyphenEngine.ts +++ b/lang/hi/src/hyphenEngine.ts @@ -5,6 +5,8 @@ export const hwo: i32 = hw; export const lmi: i32 = lm; export const rmi: i32 = rm; +let alphabetCount: i32 = 0; + /** * Maps BMP-charCode (16bit) to 8bit adresses * @@ -46,7 +48,6 @@ function createTranslateMap(): i32 { let first: i32 = 0; let second: i32 = 0; let secondInt: i32 = 0; - let alphabetCount: i32 = 0; i = to + 2; while (i < po) { first = load(i); @@ -69,13 +70,27 @@ function createTranslateMap(): i32 { pushToTranslateMap(first, secondInt); } // Add to alphabet - store(alphabetCount, first, 768); + store(alphabetCount, first, 1024); alphabetCount += 2; i += 4; } return alphabetCount >> 1; } +export function subst(ccl: i32, ccu: i32, replcc: i32): i32 { + const replccInt: i32 = pullFromTranslateMap(replcc); + if (replccInt !== 255) { + pushToTranslateMap(ccl, replccInt); + if (ccu !== 0) { + pushToTranslateMap(ccu, replccInt); + } + // Add to alphabet + store(alphabetCount, ccl, 1024); + alphabetCount += 2; + } + return alphabetCount >> 1; +} + export function conv(): i32 { let i: i32 = po; const patternEnd: i32 = po + pl; diff --git a/lang/hr/hr.wasm b/lang/hr/hr.wasm index 04dbca2a..2603273a 100644 Binary files a/lang/hr/hr.wasm and b/lang/hr/hr.wasm differ diff --git a/lang/hr/src/g.ts b/lang/hr/src/g.ts index 9bba9d48..67ebdafe 100644 --- a/lang/hr/src/g.ts +++ b/lang/hr/src/g.ts @@ -1,11 +1,11 @@ -export const to: i32 = 95272; -export const po: i32 = 95386; +export const to: i32 = 95528; +export const po: i32 = 95642; export const pl: i32 = 3119; -export const vs: i32 = 1280; -export const pt: i32 = 5576; -export const wo: i32 = 94264; -export const tw: i32 = 94392; -export const hp: i32 = 94456; -export const hw: i32 = 94520; +export const vs: i32 = 1536; +export const pt: i32 = 5832; +export const wo: i32 = 94520; +export const tw: i32 = 94648; +export const hp: i32 = 94712; +export const hw: i32 = 94776; export const lm: i32 = 2; export const rm: i32 = 2; diff --git a/lang/hr/src/hyphenEngine.ts b/lang/hr/src/hyphenEngine.ts index 2f603c23..6043b680 100644 --- a/lang/hr/src/hyphenEngine.ts +++ b/lang/hr/src/hyphenEngine.ts @@ -5,6 +5,8 @@ export const hwo: i32 = hw; export const lmi: i32 = lm; export const rmi: i32 = rm; +let alphabetCount: i32 = 0; + /** * Maps BMP-charCode (16bit) to 8bit adresses * @@ -46,7 +48,6 @@ function createTranslateMap(): i32 { let first: i32 = 0; let second: i32 = 0; let secondInt: i32 = 0; - let alphabetCount: i32 = 0; i = to + 2; while (i < po) { first = load(i); @@ -69,13 +70,27 @@ function createTranslateMap(): i32 { pushToTranslateMap(first, secondInt); } // Add to alphabet - store(alphabetCount, first, 768); + store(alphabetCount, first, 1024); alphabetCount += 2; i += 4; } return alphabetCount >> 1; } +export function subst(ccl: i32, ccu: i32, replcc: i32): i32 { + const replccInt: i32 = pullFromTranslateMap(replcc); + if (replccInt !== 255) { + pushToTranslateMap(ccl, replccInt); + if (ccu !== 0) { + pushToTranslateMap(ccu, replccInt); + } + // Add to alphabet + store(alphabetCount, ccl, 1024); + alphabetCount += 2; + } + return alphabetCount >> 1; +} + export function conv(): i32 { let i: i32 = po; const patternEnd: i32 = po + pl; diff --git a/lang/hsb/hsb.wasm b/lang/hsb/hsb.wasm index 788ec95a..4e1a786f 100644 Binary files a/lang/hsb/hsb.wasm and b/lang/hsb/hsb.wasm differ diff --git a/lang/hsb/src/g.ts b/lang/hsb/src/g.ts index f04a2112..81ca1cfd 100644 --- a/lang/hsb/src/g.ts +++ b/lang/hsb/src/g.ts @@ -1,11 +1,11 @@ -export const to: i32 = 163696; -export const po: i32 = 163834; +export const to: i32 = 163952; +export const po: i32 = 164090; export const pl: i32 = 6048; -export const vs: i32 = 1280; -export const pt: i32 = 7908; -export const wo: i32 = 162740; -export const tw: i32 = 162868; -export const hp: i32 = 162932; -export const hw: i32 = 162996; +export const vs: i32 = 1536; +export const pt: i32 = 8164; +export const wo: i32 = 162996; +export const tw: i32 = 163124; +export const hp: i32 = 163188; +export const hw: i32 = 163252; export const lm: i32 = 2; export const rm: i32 = 2; diff --git a/lang/hsb/src/hyphenEngine.ts b/lang/hsb/src/hyphenEngine.ts index 2f603c23..6043b680 100644 --- a/lang/hsb/src/hyphenEngine.ts +++ b/lang/hsb/src/hyphenEngine.ts @@ -5,6 +5,8 @@ export const hwo: i32 = hw; export const lmi: i32 = lm; export const rmi: i32 = rm; +let alphabetCount: i32 = 0; + /** * Maps BMP-charCode (16bit) to 8bit adresses * @@ -46,7 +48,6 @@ function createTranslateMap(): i32 { let first: i32 = 0; let second: i32 = 0; let secondInt: i32 = 0; - let alphabetCount: i32 = 0; i = to + 2; while (i < po) { first = load(i); @@ -69,13 +70,27 @@ function createTranslateMap(): i32 { pushToTranslateMap(first, secondInt); } // Add to alphabet - store(alphabetCount, first, 768); + store(alphabetCount, first, 1024); alphabetCount += 2; i += 4; } return alphabetCount >> 1; } +export function subst(ccl: i32, ccu: i32, replcc: i32): i32 { + const replccInt: i32 = pullFromTranslateMap(replcc); + if (replccInt !== 255) { + pushToTranslateMap(ccl, replccInt); + if (ccu !== 0) { + pushToTranslateMap(ccu, replccInt); + } + // Add to alphabet + store(alphabetCount, ccl, 1024); + alphabetCount += 2; + } + return alphabetCount >> 1; +} + export function conv(): i32 { let i: i32 = po; const patternEnd: i32 = po + pl; diff --git a/lang/hu/hu.wasm b/lang/hu/hu.wasm index 2af4f109..f8283465 100644 Binary files a/lang/hu/hu.wasm and b/lang/hu/hu.wasm differ diff --git a/lang/hu/src/g.ts b/lang/hu/src/g.ts index 41a18aa9..bb731223 100644 --- a/lang/hu/src/g.ts +++ b/lang/hu/src/g.ts @@ -1,11 +1,11 @@ -export const to: i32 = 13127816; -export const po: i32 = 13127966; +export const to: i32 = 13128072; +export const po: i32 = 13128222; export const pl: i32 = 299923; -export const vs: i32 = 1280; -export const pt: i32 = 278460; -export const wo: i32 = 13126856; -export const tw: i32 = 13126984; -export const hp: i32 = 13127048; -export const hw: i32 = 13127112; +export const vs: i32 = 1536; +export const pt: i32 = 278716; +export const wo: i32 = 13127112; +export const tw: i32 = 13127240; +export const hp: i32 = 13127304; +export const hw: i32 = 13127368; export const lm: i32 = 2; export const rm: i32 = 2; diff --git a/lang/hu/src/hyphenEngine.ts b/lang/hu/src/hyphenEngine.ts index 2f603c23..6043b680 100644 --- a/lang/hu/src/hyphenEngine.ts +++ b/lang/hu/src/hyphenEngine.ts @@ -5,6 +5,8 @@ export const hwo: i32 = hw; export const lmi: i32 = lm; export const rmi: i32 = rm; +let alphabetCount: i32 = 0; + /** * Maps BMP-charCode (16bit) to 8bit adresses * @@ -46,7 +48,6 @@ function createTranslateMap(): i32 { let first: i32 = 0; let second: i32 = 0; let secondInt: i32 = 0; - let alphabetCount: i32 = 0; i = to + 2; while (i < po) { first = load(i); @@ -69,13 +70,27 @@ function createTranslateMap(): i32 { pushToTranslateMap(first, secondInt); } // Add to alphabet - store(alphabetCount, first, 768); + store(alphabetCount, first, 1024); alphabetCount += 2; i += 4; } return alphabetCount >> 1; } +export function subst(ccl: i32, ccu: i32, replcc: i32): i32 { + const replccInt: i32 = pullFromTranslateMap(replcc); + if (replccInt !== 255) { + pushToTranslateMap(ccl, replccInt); + if (ccu !== 0) { + pushToTranslateMap(ccu, replccInt); + } + // Add to alphabet + store(alphabetCount, ccl, 1024); + alphabetCount += 2; + } + return alphabetCount >> 1; +} + export function conv(): i32 { let i: i32 = po; const patternEnd: i32 = po + pl; diff --git a/lang/hy/hy.wasm b/lang/hy/hy.wasm index 569c2b11..b17166e0 100644 Binary files a/lang/hy/hy.wasm and b/lang/hy/hy.wasm differ diff --git a/lang/hy/src/g.ts b/lang/hy/src/g.ts index 636f23dd..4c6654e4 100644 --- a/lang/hy/src/g.ts +++ b/lang/hy/src/g.ts @@ -1,11 +1,11 @@ -export const to: i32 = 73472; -export const po: i32 = 73630; +export const to: i32 = 73728; +export const po: i32 = 73886; export const pl: i32 = 2877; -export const vs: i32 = 1280; -export const pt: i32 = 5568; -export const wo: i32 = 72556; -export const tw: i32 = 72684; -export const hp: i32 = 72748; -export const hw: i32 = 72812; +export const vs: i32 = 1536; +export const pt: i32 = 5824; +export const wo: i32 = 72812; +export const tw: i32 = 72940; +export const hp: i32 = 73004; +export const hw: i32 = 73068; export const lm: i32 = 1; export const rm: i32 = 2; diff --git a/lang/hy/src/hyphenEngine.ts b/lang/hy/src/hyphenEngine.ts index 2f603c23..6043b680 100644 --- a/lang/hy/src/hyphenEngine.ts +++ b/lang/hy/src/hyphenEngine.ts @@ -5,6 +5,8 @@ export const hwo: i32 = hw; export const lmi: i32 = lm; export const rmi: i32 = rm; +let alphabetCount: i32 = 0; + /** * Maps BMP-charCode (16bit) to 8bit adresses * @@ -46,7 +48,6 @@ function createTranslateMap(): i32 { let first: i32 = 0; let second: i32 = 0; let secondInt: i32 = 0; - let alphabetCount: i32 = 0; i = to + 2; while (i < po) { first = load(i); @@ -69,13 +70,27 @@ function createTranslateMap(): i32 { pushToTranslateMap(first, secondInt); } // Add to alphabet - store(alphabetCount, first, 768); + store(alphabetCount, first, 1024); alphabetCount += 2; i += 4; } return alphabetCount >> 1; } +export function subst(ccl: i32, ccu: i32, replcc: i32): i32 { + const replccInt: i32 = pullFromTranslateMap(replcc); + if (replccInt !== 255) { + pushToTranslateMap(ccl, replccInt); + if (ccu !== 0) { + pushToTranslateMap(ccu, replccInt); + } + // Add to alphabet + store(alphabetCount, ccl, 1024); + alphabetCount += 2; + } + return alphabetCount >> 1; +} + export function conv(): i32 { let i: i32 = po; const patternEnd: i32 = po + pl; diff --git a/lang/ia/ia.wasm b/lang/ia/ia.wasm index 83943453..039a5aab 100644 Binary files a/lang/ia/ia.wasm and b/lang/ia/ia.wasm differ diff --git a/lang/ia/src/g.ts b/lang/ia/src/g.ts index 4f1e35ad..2a8c05bc 100644 --- a/lang/ia/src/g.ts +++ b/lang/ia/src/g.ts @@ -1,11 +1,11 @@ -export const to: i32 = 83284; -export const po: i32 = 83394; +export const to: i32 = 83540; +export const po: i32 = 83650; export const pl: i32 = 2302; -export const vs: i32 = 1280; -export const pt: i32 = 3536; -export const wo: i32 = 82292; -export const tw: i32 = 82420; -export const hp: i32 = 82484; -export const hw: i32 = 82548; +export const vs: i32 = 1536; +export const pt: i32 = 3792; +export const wo: i32 = 82548; +export const tw: i32 = 82676; +export const hp: i32 = 82740; +export const hw: i32 = 82804; export const lm: i32 = 2; export const rm: i32 = 2; diff --git a/lang/ia/src/hyphenEngine.ts b/lang/ia/src/hyphenEngine.ts index 2f603c23..6043b680 100644 --- a/lang/ia/src/hyphenEngine.ts +++ b/lang/ia/src/hyphenEngine.ts @@ -5,6 +5,8 @@ export const hwo: i32 = hw; export const lmi: i32 = lm; export const rmi: i32 = rm; +let alphabetCount: i32 = 0; + /** * Maps BMP-charCode (16bit) to 8bit adresses * @@ -46,7 +48,6 @@ function createTranslateMap(): i32 { let first: i32 = 0; let second: i32 = 0; let secondInt: i32 = 0; - let alphabetCount: i32 = 0; i = to + 2; while (i < po) { first = load(i); @@ -69,13 +70,27 @@ function createTranslateMap(): i32 { pushToTranslateMap(first, secondInt); } // Add to alphabet - store(alphabetCount, first, 768); + store(alphabetCount, first, 1024); alphabetCount += 2; i += 4; } return alphabetCount >> 1; } +export function subst(ccl: i32, ccu: i32, replcc: i32): i32 { + const replccInt: i32 = pullFromTranslateMap(replcc); + if (replccInt !== 255) { + pushToTranslateMap(ccl, replccInt); + if (ccu !== 0) { + pushToTranslateMap(ccu, replccInt); + } + // Add to alphabet + store(alphabetCount, ccl, 1024); + alphabetCount += 2; + } + return alphabetCount >> 1; +} + export function conv(): i32 { let i: i32 = po; const patternEnd: i32 = po + pl; diff --git a/lang/id/id.wasm b/lang/id/id.wasm index 7876a07d..12cabcce 100644 Binary files a/lang/id/id.wasm and b/lang/id/id.wasm differ diff --git a/lang/id/src/g.ts b/lang/id/src/g.ts index 135d1308..e59eea15 100644 --- a/lang/id/src/g.ts +++ b/lang/id/src/g.ts @@ -1,11 +1,11 @@ -export const to: i32 = 59752; -export const po: i32 = 59858; +export const to: i32 = 60008; +export const po: i32 = 60114; export const pl: i32 = 1421; -export const vs: i32 = 1280; -export const pt: i32 = 2312; -export const wo: i32 = 58700; -export const tw: i32 = 58828; -export const hp: i32 = 58892; -export const hw: i32 = 58956; +export const vs: i32 = 1536; +export const pt: i32 = 2568; +export const wo: i32 = 58956; +export const tw: i32 = 59084; +export const hp: i32 = 59148; +export const hw: i32 = 59212; export const lm: i32 = 2; export const rm: i32 = 2; diff --git a/lang/id/src/hyphenEngine.ts b/lang/id/src/hyphenEngine.ts index 2f603c23..6043b680 100644 --- a/lang/id/src/hyphenEngine.ts +++ b/lang/id/src/hyphenEngine.ts @@ -5,6 +5,8 @@ export const hwo: i32 = hw; export const lmi: i32 = lm; export const rmi: i32 = rm; +let alphabetCount: i32 = 0; + /** * Maps BMP-charCode (16bit) to 8bit adresses * @@ -46,7 +48,6 @@ function createTranslateMap(): i32 { let first: i32 = 0; let second: i32 = 0; let secondInt: i32 = 0; - let alphabetCount: i32 = 0; i = to + 2; while (i < po) { first = load(i); @@ -69,13 +70,27 @@ function createTranslateMap(): i32 { pushToTranslateMap(first, secondInt); } // Add to alphabet - store(alphabetCount, first, 768); + store(alphabetCount, first, 1024); alphabetCount += 2; i += 4; } return alphabetCount >> 1; } +export function subst(ccl: i32, ccu: i32, replcc: i32): i32 { + const replccInt: i32 = pullFromTranslateMap(replcc); + if (replccInt !== 255) { + pushToTranslateMap(ccl, replccInt); + if (ccu !== 0) { + pushToTranslateMap(ccu, replccInt); + } + // Add to alphabet + store(alphabetCount, ccl, 1024); + alphabetCount += 2; + } + return alphabetCount >> 1; +} + export function conv(): i32 { let i: i32 = po; const patternEnd: i32 = po + pl; diff --git a/lang/is/is.wasm b/lang/is/is.wasm index 4a79055a..b0f7acce 100644 Binary files a/lang/is/is.wasm and b/lang/is/is.wasm differ diff --git a/lang/is/src/g.ts b/lang/is/src/g.ts index 92193f9f..a2582239 100644 --- a/lang/is/src/g.ts +++ b/lang/is/src/g.ts @@ -1,11 +1,11 @@ -export const to: i32 = 822472; -export const po: i32 = 822622; +export const to: i32 = 822728; +export const po: i32 = 822878; export const pl: i32 = 16242; -export const vs: i32 = 1280; -export const pt: i32 = 16920; -export const wo: i32 = 821516; -export const tw: i32 = 821644; -export const hp: i32 = 821708; -export const hw: i32 = 821772; +export const vs: i32 = 1536; +export const pt: i32 = 17176; +export const wo: i32 = 821772; +export const tw: i32 = 821900; +export const hp: i32 = 821964; +export const hw: i32 = 822028; export const lm: i32 = 2; export const rm: i32 = 2; diff --git a/lang/is/src/hyphenEngine.ts b/lang/is/src/hyphenEngine.ts index 2f603c23..6043b680 100644 --- a/lang/is/src/hyphenEngine.ts +++ b/lang/is/src/hyphenEngine.ts @@ -5,6 +5,8 @@ export const hwo: i32 = hw; export const lmi: i32 = lm; export const rmi: i32 = rm; +let alphabetCount: i32 = 0; + /** * Maps BMP-charCode (16bit) to 8bit adresses * @@ -46,7 +48,6 @@ function createTranslateMap(): i32 { let first: i32 = 0; let second: i32 = 0; let secondInt: i32 = 0; - let alphabetCount: i32 = 0; i = to + 2; while (i < po) { first = load(i); @@ -69,13 +70,27 @@ function createTranslateMap(): i32 { pushToTranslateMap(first, secondInt); } // Add to alphabet - store(alphabetCount, first, 768); + store(alphabetCount, first, 1024); alphabetCount += 2; i += 4; } return alphabetCount >> 1; } +export function subst(ccl: i32, ccu: i32, replcc: i32): i32 { + const replccInt: i32 = pullFromTranslateMap(replcc); + if (replccInt !== 255) { + pushToTranslateMap(ccl, replccInt); + if (ccu !== 0) { + pushToTranslateMap(ccu, replccInt); + } + // Add to alphabet + store(alphabetCount, ccl, 1024); + alphabetCount += 2; + } + return alphabetCount >> 1; +} + export function conv(): i32 { let i: i32 = po; const patternEnd: i32 = po + pl; diff --git a/lang/it/it.wasm b/lang/it/it.wasm index b8101255..2956e42e 100644 Binary files a/lang/it/it.wasm and b/lang/it/it.wasm differ diff --git a/lang/it/src/g.ts b/lang/it/src/g.ts index c791bbfe..f2e486c6 100644 --- a/lang/it/src/g.ts +++ b/lang/it/src/g.ts @@ -1,11 +1,11 @@ -export const to: i32 = 38404; -export const po: i32 = 38522; +export const to: i32 = 38660; +export const po: i32 = 38778; export const pl: i32 = 993; -export const vs: i32 = 1280; -export const pt: i32 = 2312; -export const wo: i32 = 37472; -export const tw: i32 = 37600; -export const hp: i32 = 37664; -export const hw: i32 = 37728; +export const vs: i32 = 1536; +export const pt: i32 = 2568; +export const wo: i32 = 37728; +export const tw: i32 = 37856; +export const hp: i32 = 37920; +export const hw: i32 = 37984; export const lm: i32 = 2; export const rm: i32 = 2; diff --git a/lang/it/src/hyphenEngine.ts b/lang/it/src/hyphenEngine.ts index 2f603c23..6043b680 100644 --- a/lang/it/src/hyphenEngine.ts +++ b/lang/it/src/hyphenEngine.ts @@ -5,6 +5,8 @@ export const hwo: i32 = hw; export const lmi: i32 = lm; export const rmi: i32 = rm; +let alphabetCount: i32 = 0; + /** * Maps BMP-charCode (16bit) to 8bit adresses * @@ -46,7 +48,6 @@ function createTranslateMap(): i32 { let first: i32 = 0; let second: i32 = 0; let secondInt: i32 = 0; - let alphabetCount: i32 = 0; i = to + 2; while (i < po) { first = load(i); @@ -69,13 +70,27 @@ function createTranslateMap(): i32 { pushToTranslateMap(first, secondInt); } // Add to alphabet - store(alphabetCount, first, 768); + store(alphabetCount, first, 1024); alphabetCount += 2; i += 4; } return alphabetCount >> 1; } +export function subst(ccl: i32, ccu: i32, replcc: i32): i32 { + const replccInt: i32 = pullFromTranslateMap(replcc); + if (replccInt !== 255) { + pushToTranslateMap(ccl, replccInt); + if (ccu !== 0) { + pushToTranslateMap(ccu, replccInt); + } + // Add to alphabet + store(alphabetCount, ccl, 1024); + alphabetCount += 2; + } + return alphabetCount >> 1; +} + export function conv(): i32 { let i: i32 = po; const patternEnd: i32 = po + pl; diff --git a/lang/ka/ka.wasm b/lang/ka/ka.wasm index 335aaf05..2dcf7868 100644 Binary files a/lang/ka/ka.wasm and b/lang/ka/ka.wasm differ diff --git a/lang/ka/src/g.ts b/lang/ka/src/g.ts index c34e1788..e00f4e22 100644 --- a/lang/ka/src/g.ts +++ b/lang/ka/src/g.ts @@ -1,11 +1,11 @@ -export const to: i32 = 287772; -export const po: i32 = 287910; +export const to: i32 = 288028; +export const po: i32 = 288166; export const pl: i32 = 6739; -export const vs: i32 = 1280; -export const pt: i32 = 9156; -export const wo: i32 = 286808; -export const tw: i32 = 286936; -export const hp: i32 = 287000; -export const hw: i32 = 287064; +export const vs: i32 = 1536; +export const pt: i32 = 9412; +export const wo: i32 = 287064; +export const tw: i32 = 287192; +export const hp: i32 = 287256; +export const hw: i32 = 287320; export const lm: i32 = 1; export const rm: i32 = 2; diff --git a/lang/ka/src/hyphenEngine.ts b/lang/ka/src/hyphenEngine.ts index 2f603c23..6043b680 100644 --- a/lang/ka/src/hyphenEngine.ts +++ b/lang/ka/src/hyphenEngine.ts @@ -5,6 +5,8 @@ export const hwo: i32 = hw; export const lmi: i32 = lm; export const rmi: i32 = rm; +let alphabetCount: i32 = 0; + /** * Maps BMP-charCode (16bit) to 8bit adresses * @@ -46,7 +48,6 @@ function createTranslateMap(): i32 { let first: i32 = 0; let second: i32 = 0; let secondInt: i32 = 0; - let alphabetCount: i32 = 0; i = to + 2; while (i < po) { first = load(i); @@ -69,13 +70,27 @@ function createTranslateMap(): i32 { pushToTranslateMap(first, secondInt); } // Add to alphabet - store(alphabetCount, first, 768); + store(alphabetCount, first, 1024); alphabetCount += 2; i += 4; } return alphabetCount >> 1; } +export function subst(ccl: i32, ccu: i32, replcc: i32): i32 { + const replccInt: i32 = pullFromTranslateMap(replcc); + if (replccInt !== 255) { + pushToTranslateMap(ccl, replccInt); + if (ccu !== 0) { + pushToTranslateMap(ccu, replccInt); + } + // Add to alphabet + store(alphabetCount, ccl, 1024); + alphabetCount += 2; + } + return alphabetCount >> 1; +} + export function conv(): i32 { let i: i32 = po; const patternEnd: i32 = po + pl; diff --git a/lang/kmr/kmr.wasm b/lang/kmr/kmr.wasm index eb5398ad..6bfb3a3e 100644 Binary files a/lang/kmr/kmr.wasm and b/lang/kmr/kmr.wasm differ diff --git a/lang/kmr/src/g.ts b/lang/kmr/src/g.ts index da688dd3..5a81a50e 100644 --- a/lang/kmr/src/g.ts +++ b/lang/kmr/src/g.ts @@ -1,11 +1,11 @@ -export const to: i32 = 30916; -export const po: i32 = 31046; +export const to: i32 = 31172; +export const po: i32 = 31302; export const pl: i32 = 765; -export const vs: i32 = 1280; -export const pt: i32 = 2036; -export const wo: i32 = 29852; -export const tw: i32 = 29980; -export const hp: i32 = 30044; -export const hw: i32 = 30108; +export const vs: i32 = 1536; +export const pt: i32 = 2292; +export const wo: i32 = 30108; +export const tw: i32 = 30236; +export const hp: i32 = 30300; +export const hw: i32 = 30364; export const lm: i32 = 2; export const rm: i32 = 2; diff --git a/lang/kmr/src/hyphenEngine.ts b/lang/kmr/src/hyphenEngine.ts index 2f603c23..6043b680 100644 --- a/lang/kmr/src/hyphenEngine.ts +++ b/lang/kmr/src/hyphenEngine.ts @@ -5,6 +5,8 @@ export const hwo: i32 = hw; export const lmi: i32 = lm; export const rmi: i32 = rm; +let alphabetCount: i32 = 0; + /** * Maps BMP-charCode (16bit) to 8bit adresses * @@ -46,7 +48,6 @@ function createTranslateMap(): i32 { let first: i32 = 0; let second: i32 = 0; let secondInt: i32 = 0; - let alphabetCount: i32 = 0; i = to + 2; while (i < po) { first = load(i); @@ -69,13 +70,27 @@ function createTranslateMap(): i32 { pushToTranslateMap(first, secondInt); } // Add to alphabet - store(alphabetCount, first, 768); + store(alphabetCount, first, 1024); alphabetCount += 2; i += 4; } return alphabetCount >> 1; } +export function subst(ccl: i32, ccu: i32, replcc: i32): i32 { + const replccInt: i32 = pullFromTranslateMap(replcc); + if (replccInt !== 255) { + pushToTranslateMap(ccl, replccInt); + if (ccu !== 0) { + pushToTranslateMap(ccu, replccInt); + } + // Add to alphabet + store(alphabetCount, ccl, 1024); + alphabetCount += 2; + } + return alphabetCount >> 1; +} + export function conv(): i32 { let i: i32 = po; const patternEnd: i32 = po + pl; diff --git a/lang/kn/kn.wasm b/lang/kn/kn.wasm index 8d68b02c..7ee07be2 100644 Binary files a/lang/kn/kn.wasm and b/lang/kn/kn.wasm differ diff --git a/lang/kn/src/g.ts b/lang/kn/src/g.ts index 25c426b5..92e3ef34 100644 --- a/lang/kn/src/g.ts +++ b/lang/kn/src/g.ts @@ -1,11 +1,11 @@ -export const to: i32 = 2932; -export const po: i32 = 3230; +export const to: i32 = 3188; +export const po: i32 = 3486; export const pl: i32 = 231; -export const vs: i32 = 1280; -export const pt: i32 = 1464; -export const wo: i32 = 2056; -export const tw: i32 = 2184; -export const hp: i32 = 2248; -export const hw: i32 = 2312; +export const vs: i32 = 1536; +export const pt: i32 = 1720; +export const wo: i32 = 2312; +export const tw: i32 = 2440; +export const hp: i32 = 2504; +export const hw: i32 = 2568; export const lm: i32 = 1; export const rm: i32 = 1; diff --git a/lang/kn/src/hyphenEngine.ts b/lang/kn/src/hyphenEngine.ts index 2f603c23..6043b680 100644 --- a/lang/kn/src/hyphenEngine.ts +++ b/lang/kn/src/hyphenEngine.ts @@ -5,6 +5,8 @@ export const hwo: i32 = hw; export const lmi: i32 = lm; export const rmi: i32 = rm; +let alphabetCount: i32 = 0; + /** * Maps BMP-charCode (16bit) to 8bit adresses * @@ -46,7 +48,6 @@ function createTranslateMap(): i32 { let first: i32 = 0; let second: i32 = 0; let secondInt: i32 = 0; - let alphabetCount: i32 = 0; i = to + 2; while (i < po) { first = load(i); @@ -69,13 +70,27 @@ function createTranslateMap(): i32 { pushToTranslateMap(first, secondInt); } // Add to alphabet - store(alphabetCount, first, 768); + store(alphabetCount, first, 1024); alphabetCount += 2; i += 4; } return alphabetCount >> 1; } +export function subst(ccl: i32, ccu: i32, replcc: i32): i32 { + const replccInt: i32 = pullFromTranslateMap(replcc); + if (replccInt !== 255) { + pushToTranslateMap(ccl, replccInt); + if (ccu !== 0) { + pushToTranslateMap(ccu, replccInt); + } + // Add to alphabet + store(alphabetCount, ccl, 1024); + alphabetCount += 2; + } + return alphabetCount >> 1; +} + export function conv(): i32 { let i: i32 = po; const patternEnd: i32 = po + pl; diff --git a/lang/la/la.wasm b/lang/la/la.wasm index 693bd060..117fd8c5 100644 Binary files a/lang/la/la.wasm and b/lang/la/la.wasm differ diff --git a/lang/la/src/g.ts b/lang/la/src/g.ts index e95d46e4..8887d0d5 100644 --- a/lang/la/src/g.ts +++ b/lang/la/src/g.ts @@ -1,11 +1,11 @@ -export const to: i32 = 28116; -export const po: i32 = 28218; +export const to: i32 = 28372; +export const po: i32 = 28474; export const pl: i32 = 1000; -export const vs: i32 = 1280; -export const pt: i32 = 2292; -export const wo: i32 = 27176; -export const tw: i32 = 27304; -export const hp: i32 = 27368; -export const hw: i32 = 27432; +export const vs: i32 = 1536; +export const pt: i32 = 2548; +export const wo: i32 = 27432; +export const tw: i32 = 27560; +export const hp: i32 = 27624; +export const hw: i32 = 27688; export const lm: i32 = 2; export const rm: i32 = 2; diff --git a/lang/la/src/hyphenEngine.ts b/lang/la/src/hyphenEngine.ts index 2f603c23..6043b680 100644 --- a/lang/la/src/hyphenEngine.ts +++ b/lang/la/src/hyphenEngine.ts @@ -5,6 +5,8 @@ export const hwo: i32 = hw; export const lmi: i32 = lm; export const rmi: i32 = rm; +let alphabetCount: i32 = 0; + /** * Maps BMP-charCode (16bit) to 8bit adresses * @@ -46,7 +48,6 @@ function createTranslateMap(): i32 { let first: i32 = 0; let second: i32 = 0; let secondInt: i32 = 0; - let alphabetCount: i32 = 0; i = to + 2; while (i < po) { first = load(i); @@ -69,13 +70,27 @@ function createTranslateMap(): i32 { pushToTranslateMap(first, secondInt); } // Add to alphabet - store(alphabetCount, first, 768); + store(alphabetCount, first, 1024); alphabetCount += 2; i += 4; } return alphabetCount >> 1; } +export function subst(ccl: i32, ccu: i32, replcc: i32): i32 { + const replccInt: i32 = pullFromTranslateMap(replcc); + if (replccInt !== 255) { + pushToTranslateMap(ccl, replccInt); + if (ccu !== 0) { + pushToTranslateMap(ccu, replccInt); + } + // Add to alphabet + store(alphabetCount, ccl, 1024); + alphabetCount += 2; + } + return alphabetCount >> 1; +} + export function conv(): i32 { let i: i32 = po; const patternEnd: i32 = po + pl; diff --git a/lang/lt/lt.wasm b/lang/lt/lt.wasm index 5477f99d..4c1d617c 100644 Binary files a/lang/lt/lt.wasm and b/lang/lt/lt.wasm differ diff --git a/lang/lt/src/g.ts b/lang/lt/src/g.ts index 4371d79d..b2b7046b 100644 --- a/lang/lt/src/g.ts +++ b/lang/lt/src/g.ts @@ -1,11 +1,11 @@ -export const to: i32 = 158620; -export const po: i32 = 158758; +export const to: i32 = 158876; +export const po: i32 = 159014; export const pl: i32 = 4662; -export const vs: i32 = 1280; -export const pt: i32 = 6552; -export const wo: i32 = 157520; -export const tw: i32 = 157648; -export const hp: i32 = 157712; -export const hw: i32 = 157776; +export const vs: i32 = 1536; +export const pt: i32 = 6808; +export const wo: i32 = 157776; +export const tw: i32 = 157904; +export const hp: i32 = 157968; +export const hw: i32 = 158032; export const lm: i32 = 2; export const rm: i32 = 2; diff --git a/lang/lt/src/hyphenEngine.ts b/lang/lt/src/hyphenEngine.ts index 2f603c23..6043b680 100644 --- a/lang/lt/src/hyphenEngine.ts +++ b/lang/lt/src/hyphenEngine.ts @@ -5,6 +5,8 @@ export const hwo: i32 = hw; export const lmi: i32 = lm; export const rmi: i32 = rm; +let alphabetCount: i32 = 0; + /** * Maps BMP-charCode (16bit) to 8bit adresses * @@ -46,7 +48,6 @@ function createTranslateMap(): i32 { let first: i32 = 0; let second: i32 = 0; let secondInt: i32 = 0; - let alphabetCount: i32 = 0; i = to + 2; while (i < po) { first = load(i); @@ -69,13 +70,27 @@ function createTranslateMap(): i32 { pushToTranslateMap(first, secondInt); } // Add to alphabet - store(alphabetCount, first, 768); + store(alphabetCount, first, 1024); alphabetCount += 2; i += 4; } return alphabetCount >> 1; } +export function subst(ccl: i32, ccu: i32, replcc: i32): i32 { + const replccInt: i32 = pullFromTranslateMap(replcc); + if (replccInt !== 255) { + pushToTranslateMap(ccl, replccInt); + if (ccu !== 0) { + pushToTranslateMap(ccu, replccInt); + } + // Add to alphabet + store(alphabetCount, ccl, 1024); + alphabetCount += 2; + } + return alphabetCount >> 1; +} + export function conv(): i32 { let i: i32 = po; const patternEnd: i32 = po + pl; diff --git a/lang/lv/lv.wasm b/lang/lv/lv.wasm index 843d62de..d3b1239b 100644 Binary files a/lang/lv/lv.wasm and b/lang/lv/lv.wasm differ diff --git a/lang/lv/src/g.ts b/lang/lv/src/g.ts index a465d9e9..8c029941 100644 --- a/lang/lv/src/g.ts +++ b/lang/lv/src/g.ts @@ -1,11 +1,11 @@ -export const to: i32 = 1407432; -export const po: i32 = 1407570; +export const to: i32 = 1407688; +export const po: i32 = 1407826; export const pl: i32 = 43093; -export const vs: i32 = 1280; -export const pt: i32 = 49944; -export const wo: i32 = 1406480; -export const tw: i32 = 1406608; -export const hp: i32 = 1406672; -export const hw: i32 = 1406736; +export const vs: i32 = 1536; +export const pt: i32 = 50200; +export const wo: i32 = 1406736; +export const tw: i32 = 1406864; +export const hp: i32 = 1406928; +export const hw: i32 = 1406992; export const lm: i32 = 2; export const rm: i32 = 2; diff --git a/lang/lv/src/hyphenEngine.ts b/lang/lv/src/hyphenEngine.ts index 2f603c23..6043b680 100644 --- a/lang/lv/src/hyphenEngine.ts +++ b/lang/lv/src/hyphenEngine.ts @@ -5,6 +5,8 @@ export const hwo: i32 = hw; export const lmi: i32 = lm; export const rmi: i32 = rm; +let alphabetCount: i32 = 0; + /** * Maps BMP-charCode (16bit) to 8bit adresses * @@ -46,7 +48,6 @@ function createTranslateMap(): i32 { let first: i32 = 0; let second: i32 = 0; let secondInt: i32 = 0; - let alphabetCount: i32 = 0; i = to + 2; while (i < po) { first = load(i); @@ -69,13 +70,27 @@ function createTranslateMap(): i32 { pushToTranslateMap(first, secondInt); } // Add to alphabet - store(alphabetCount, first, 768); + store(alphabetCount, first, 1024); alphabetCount += 2; i += 4; } return alphabetCount >> 1; } +export function subst(ccl: i32, ccu: i32, replcc: i32): i32 { + const replccInt: i32 = pullFromTranslateMap(replcc); + if (replccInt !== 255) { + pushToTranslateMap(ccl, replccInt); + if (ccu !== 0) { + pushToTranslateMap(ccu, replccInt); + } + // Add to alphabet + store(alphabetCount, ccl, 1024); + alphabetCount += 2; + } + return alphabetCount >> 1; +} + export function conv(): i32 { let i: i32 = po; const patternEnd: i32 = po + pl; diff --git a/lang/mk/mk.wasm b/lang/mk/mk.wasm index ddccd97a..19dc4074 100644 Binary files a/lang/mk/mk.wasm and b/lang/mk/mk.wasm differ diff --git a/lang/mk/src/g.ts b/lang/mk/src/g.ts index 8c0728bd..1bc81a1c 100644 --- a/lang/mk/src/g.ts +++ b/lang/mk/src/g.ts @@ -1,11 +1,11 @@ -export const to: i32 = 77408; -export const po: i32 = 77538; +export const to: i32 = 77664; +export const po: i32 = 77794; export const pl: i32 = 2222; -export const vs: i32 = 1280; -export const pt: i32 = 3720; -export const wo: i32 = 76516; -export const tw: i32 = 76644; -export const hp: i32 = 76708; -export const hw: i32 = 76772; +export const vs: i32 = 1536; +export const pt: i32 = 3976; +export const wo: i32 = 76772; +export const tw: i32 = 76900; +export const hp: i32 = 76964; +export const hw: i32 = 77028; export const lm: i32 = 2; export const rm: i32 = 2; diff --git a/lang/mk/src/hyphenEngine.ts b/lang/mk/src/hyphenEngine.ts index 2f603c23..6043b680 100644 --- a/lang/mk/src/hyphenEngine.ts +++ b/lang/mk/src/hyphenEngine.ts @@ -5,6 +5,8 @@ export const hwo: i32 = hw; export const lmi: i32 = lm; export const rmi: i32 = rm; +let alphabetCount: i32 = 0; + /** * Maps BMP-charCode (16bit) to 8bit adresses * @@ -46,7 +48,6 @@ function createTranslateMap(): i32 { let first: i32 = 0; let second: i32 = 0; let secondInt: i32 = 0; - let alphabetCount: i32 = 0; i = to + 2; while (i < po) { first = load(i); @@ -69,13 +70,27 @@ function createTranslateMap(): i32 { pushToTranslateMap(first, secondInt); } // Add to alphabet - store(alphabetCount, first, 768); + store(alphabetCount, first, 1024); alphabetCount += 2; i += 4; } return alphabetCount >> 1; } +export function subst(ccl: i32, ccu: i32, replcc: i32): i32 { + const replccInt: i32 = pullFromTranslateMap(replcc); + if (replccInt !== 255) { + pushToTranslateMap(ccl, replccInt); + if (ccu !== 0) { + pushToTranslateMap(ccu, replccInt); + } + // Add to alphabet + store(alphabetCount, ccl, 1024); + alphabetCount += 2; + } + return alphabetCount >> 1; +} + export function conv(): i32 { let i: i32 = po; const patternEnd: i32 = po + pl; diff --git a/lang/ml/ml.wasm b/lang/ml/ml.wasm index 17460c63..337eebcd 100644 Binary files a/lang/ml/ml.wasm and b/lang/ml/ml.wasm differ diff --git a/lang/ml/src/g.ts b/lang/ml/src/g.ts index ae57d441..ce9c0605 100644 --- a/lang/ml/src/g.ts +++ b/lang/ml/src/g.ts @@ -1,11 +1,11 @@ -export const to: i32 = 10508; -export const po: i32 = 10818; +export const to: i32 = 10764; +export const po: i32 = 11074; export const pl: i32 = 309; -export const vs: i32 = 1280; -export const pt: i32 = 1504; -export const wo: i32 = 9560; -export const tw: i32 = 9688; -export const hp: i32 = 9752; -export const hw: i32 = 9816; +export const vs: i32 = 1536; +export const pt: i32 = 1760; +export const wo: i32 = 9816; +export const tw: i32 = 9944; +export const hp: i32 = 10008; +export const hw: i32 = 10072; export const lm: i32 = 1; export const rm: i32 = 1; diff --git a/lang/ml/src/hyphenEngine.ts b/lang/ml/src/hyphenEngine.ts index 2f603c23..6043b680 100644 --- a/lang/ml/src/hyphenEngine.ts +++ b/lang/ml/src/hyphenEngine.ts @@ -5,6 +5,8 @@ export const hwo: i32 = hw; export const lmi: i32 = lm; export const rmi: i32 = rm; +let alphabetCount: i32 = 0; + /** * Maps BMP-charCode (16bit) to 8bit adresses * @@ -46,7 +48,6 @@ function createTranslateMap(): i32 { let first: i32 = 0; let second: i32 = 0; let secondInt: i32 = 0; - let alphabetCount: i32 = 0; i = to + 2; while (i < po) { first = load(i); @@ -69,13 +70,27 @@ function createTranslateMap(): i32 { pushToTranslateMap(first, secondInt); } // Add to alphabet - store(alphabetCount, first, 768); + store(alphabetCount, first, 1024); alphabetCount += 2; i += 4; } return alphabetCount >> 1; } +export function subst(ccl: i32, ccu: i32, replcc: i32): i32 { + const replccInt: i32 = pullFromTranslateMap(replcc); + if (replccInt !== 255) { + pushToTranslateMap(ccl, replccInt); + if (ccu !== 0) { + pushToTranslateMap(ccu, replccInt); + } + // Add to alphabet + store(alphabetCount, ccl, 1024); + alphabetCount += 2; + } + return alphabetCount >> 1; +} + export function conv(): i32 { let i: i32 = po; const patternEnd: i32 = po + pl; diff --git a/lang/mn-cyrl/mn-cyrl.wasm b/lang/mn-cyrl/mn-cyrl.wasm index 2879934a..f5a623f1 100644 Binary files a/lang/mn-cyrl/mn-cyrl.wasm and b/lang/mn-cyrl/mn-cyrl.wasm differ diff --git a/lang/mn-cyrl/src/g.ts b/lang/mn-cyrl/src/g.ts index 9df409f6..bb41150f 100644 --- a/lang/mn-cyrl/src/g.ts +++ b/lang/mn-cyrl/src/g.ts @@ -1,11 +1,11 @@ -export const to: i32 = 172164; -export const po: i32 = 172310; +export const to: i32 = 172420; +export const po: i32 = 172566; export const pl: i32 = 5609; -export const vs: i32 = 1280; -export const pt: i32 = 7348; -export const wo: i32 = 171156; -export const tw: i32 = 171284; -export const hp: i32 = 171348; -export const hw: i32 = 171412; +export const vs: i32 = 1536; +export const pt: i32 = 7604; +export const wo: i32 = 171412; +export const tw: i32 = 171540; +export const hp: i32 = 171604; +export const hw: i32 = 171668; export const lm: i32 = 2; export const rm: i32 = 2; diff --git a/lang/mn-cyrl/src/hyphenEngine.ts b/lang/mn-cyrl/src/hyphenEngine.ts index 2f603c23..6043b680 100644 --- a/lang/mn-cyrl/src/hyphenEngine.ts +++ b/lang/mn-cyrl/src/hyphenEngine.ts @@ -5,6 +5,8 @@ export const hwo: i32 = hw; export const lmi: i32 = lm; export const rmi: i32 = rm; +let alphabetCount: i32 = 0; + /** * Maps BMP-charCode (16bit) to 8bit adresses * @@ -46,7 +48,6 @@ function createTranslateMap(): i32 { let first: i32 = 0; let second: i32 = 0; let secondInt: i32 = 0; - let alphabetCount: i32 = 0; i = to + 2; while (i < po) { first = load(i); @@ -69,13 +70,27 @@ function createTranslateMap(): i32 { pushToTranslateMap(first, secondInt); } // Add to alphabet - store(alphabetCount, first, 768); + store(alphabetCount, first, 1024); alphabetCount += 2; i += 4; } return alphabetCount >> 1; } +export function subst(ccl: i32, ccu: i32, replcc: i32): i32 { + const replccInt: i32 = pullFromTranslateMap(replcc); + if (replccInt !== 255) { + pushToTranslateMap(ccl, replccInt); + if (ccu !== 0) { + pushToTranslateMap(ccu, replccInt); + } + // Add to alphabet + store(alphabetCount, ccl, 1024); + alphabetCount += 2; + } + return alphabetCount >> 1; +} + export function conv(): i32 { let i: i32 = po; const patternEnd: i32 = po + pl; diff --git a/lang/mr/mr.wasm b/lang/mr/mr.wasm index 894d5565..50dc3952 100644 Binary files a/lang/mr/mr.wasm and b/lang/mr/mr.wasm differ diff --git a/lang/mr/src/g.ts b/lang/mr/src/g.ts index 1cbc087e..57da90ce 100644 --- a/lang/mr/src/g.ts +++ b/lang/mr/src/g.ts @@ -1,11 +1,11 @@ -export const to: i32 = 2972; -export const po: i32 = 3258; +export const to: i32 = 3228; +export const po: i32 = 3514; export const pl: i32 = 223; -export const vs: i32 = 1280; -export const pt: i32 = 1460; -export const wo: i32 = 2028; -export const tw: i32 = 2156; -export const hp: i32 = 2220; -export const hw: i32 = 2284; +export const vs: i32 = 1536; +export const pt: i32 = 1716; +export const wo: i32 = 2284; +export const tw: i32 = 2412; +export const hp: i32 = 2476; +export const hw: i32 = 2540; export const lm: i32 = 1; export const rm: i32 = 1; diff --git a/lang/mr/src/hyphenEngine.ts b/lang/mr/src/hyphenEngine.ts index 2f603c23..6043b680 100644 --- a/lang/mr/src/hyphenEngine.ts +++ b/lang/mr/src/hyphenEngine.ts @@ -5,6 +5,8 @@ export const hwo: i32 = hw; export const lmi: i32 = lm; export const rmi: i32 = rm; +let alphabetCount: i32 = 0; + /** * Maps BMP-charCode (16bit) to 8bit adresses * @@ -46,7 +48,6 @@ function createTranslateMap(): i32 { let first: i32 = 0; let second: i32 = 0; let secondInt: i32 = 0; - let alphabetCount: i32 = 0; i = to + 2; while (i < po) { first = load(i); @@ -69,13 +70,27 @@ function createTranslateMap(): i32 { pushToTranslateMap(first, secondInt); } // Add to alphabet - store(alphabetCount, first, 768); + store(alphabetCount, first, 1024); alphabetCount += 2; i += 4; } return alphabetCount >> 1; } +export function subst(ccl: i32, ccu: i32, replcc: i32): i32 { + const replccInt: i32 = pullFromTranslateMap(replcc); + if (replccInt !== 255) { + pushToTranslateMap(ccl, replccInt); + if (ccu !== 0) { + pushToTranslateMap(ccu, replccInt); + } + // Add to alphabet + store(alphabetCount, ccl, 1024); + alphabetCount += 2; + } + return alphabetCount >> 1; +} + export function conv(): i32 { let i: i32 = po; const patternEnd: i32 = po + pl; diff --git a/lang/mul-ethi/mul-ethi.wasm b/lang/mul-ethi/mul-ethi.wasm index f0464049..888eb5af 100644 Binary files a/lang/mul-ethi/mul-ethi.wasm and b/lang/mul-ethi/mul-ethi.wasm differ diff --git a/lang/mul-ethi/src/g.ts b/lang/mul-ethi/src/g.ts index 5fabec88..3ae0f666 100644 --- a/lang/mul-ethi/src/g.ts +++ b/lang/mul-ethi/src/g.ts @@ -1,11 +1,11 @@ -export const to: i32 = 7252; -export const po: i32 = 9078; +export const to: i32 = 7508; +export const po: i32 = 9334; export const pl: i32 = 1822; -export const vs: i32 = 1280; -export const pt: i32 = 2660; -export const wo: i32 = 6308; -export const tw: i32 = 6436; -export const hp: i32 = 6500; -export const hw: i32 = 6564; +export const vs: i32 = 1536; +export const pt: i32 = 2916; +export const wo: i32 = 6564; +export const tw: i32 = 6692; +export const hp: i32 = 6756; +export const hw: i32 = 6820; export const lm: i32 = 1; export const rm: i32 = 1; diff --git a/lang/mul-ethi/src/hyphenEngine.ts b/lang/mul-ethi/src/hyphenEngine.ts index 2f603c23..6043b680 100644 --- a/lang/mul-ethi/src/hyphenEngine.ts +++ b/lang/mul-ethi/src/hyphenEngine.ts @@ -5,6 +5,8 @@ export const hwo: i32 = hw; export const lmi: i32 = lm; export const rmi: i32 = rm; +let alphabetCount: i32 = 0; + /** * Maps BMP-charCode (16bit) to 8bit adresses * @@ -46,7 +48,6 @@ function createTranslateMap(): i32 { let first: i32 = 0; let second: i32 = 0; let secondInt: i32 = 0; - let alphabetCount: i32 = 0; i = to + 2; while (i < po) { first = load(i); @@ -69,13 +70,27 @@ function createTranslateMap(): i32 { pushToTranslateMap(first, secondInt); } // Add to alphabet - store(alphabetCount, first, 768); + store(alphabetCount, first, 1024); alphabetCount += 2; i += 4; } return alphabetCount >> 1; } +export function subst(ccl: i32, ccu: i32, replcc: i32): i32 { + const replccInt: i32 = pullFromTranslateMap(replcc); + if (replccInt !== 255) { + pushToTranslateMap(ccl, replccInt); + if (ccu !== 0) { + pushToTranslateMap(ccu, replccInt); + } + // Add to alphabet + store(alphabetCount, ccl, 1024); + alphabetCount += 2; + } + return alphabetCount >> 1; +} + export function conv(): i32 { let i: i32 = po; const patternEnd: i32 = po + pl; diff --git a/lang/nb-no/nb-no.wasm b/lang/nb-no/nb-no.wasm index fb5f55bb..8fe97c77 100644 Binary files a/lang/nb-no/nb-no.wasm and b/lang/nb-no/nb-no.wasm differ diff --git a/lang/nb-no/src/g.ts b/lang/nb-no/src/g.ts index 03a785d0..80e2838e 100644 --- a/lang/nb-no/src/g.ts +++ b/lang/nb-no/src/g.ts @@ -1,11 +1,11 @@ -export const to: i32 = 5793776; -export const po: i32 = 5793922; +export const to: i32 = 5794032; +export const po: i32 = 5794178; export const pl: i32 = 117878; -export const vs: i32 = 1280; -export const pt: i32 = 113516; -export const wo: i32 = 5792620; -export const tw: i32 = 5792748; -export const hp: i32 = 5792812; -export const hw: i32 = 5792876; +export const vs: i32 = 1536; +export const pt: i32 = 113772; +export const wo: i32 = 5792876; +export const tw: i32 = 5793004; +export const hp: i32 = 5793068; +export const hw: i32 = 5793132; export const lm: i32 = 2; export const rm: i32 = 2; diff --git a/lang/nb-no/src/hyphenEngine.ts b/lang/nb-no/src/hyphenEngine.ts index 2f603c23..6043b680 100644 --- a/lang/nb-no/src/hyphenEngine.ts +++ b/lang/nb-no/src/hyphenEngine.ts @@ -5,6 +5,8 @@ export const hwo: i32 = hw; export const lmi: i32 = lm; export const rmi: i32 = rm; +let alphabetCount: i32 = 0; + /** * Maps BMP-charCode (16bit) to 8bit adresses * @@ -46,7 +48,6 @@ function createTranslateMap(): i32 { let first: i32 = 0; let second: i32 = 0; let secondInt: i32 = 0; - let alphabetCount: i32 = 0; i = to + 2; while (i < po) { first = load(i); @@ -69,13 +70,27 @@ function createTranslateMap(): i32 { pushToTranslateMap(first, secondInt); } // Add to alphabet - store(alphabetCount, first, 768); + store(alphabetCount, first, 1024); alphabetCount += 2; i += 4; } return alphabetCount >> 1; } +export function subst(ccl: i32, ccu: i32, replcc: i32): i32 { + const replccInt: i32 = pullFromTranslateMap(replcc); + if (replccInt !== 255) { + pushToTranslateMap(ccl, replccInt); + if (ccu !== 0) { + pushToTranslateMap(ccu, replccInt); + } + // Add to alphabet + store(alphabetCount, ccl, 1024); + alphabetCount += 2; + } + return alphabetCount >> 1; +} + export function conv(): i32 { let i: i32 = po; const patternEnd: i32 = po + pl; diff --git a/lang/nl/nl.wasm b/lang/nl/nl.wasm index 6c2ed6c3..36d1c040 100644 Binary files a/lang/nl/nl.wasm and b/lang/nl/nl.wasm differ diff --git a/lang/nl/src/g.ts b/lang/nl/src/g.ts index 9de4ac88..2ddd2ceb 100644 --- a/lang/nl/src/g.ts +++ b/lang/nl/src/g.ts @@ -1,11 +1,11 @@ -export const to: i32 = 2572056; -export const po: i32 = 2572214; +export const to: i32 = 2572312; +export const po: i32 = 2572470; export const pl: i32 = 52607; -export const vs: i32 = 1280; -export const pt: i32 = 53216; -export const wo: i32 = 2571100; -export const tw: i32 = 2571228; -export const hp: i32 = 2571292; -export const hw: i32 = 2571356; +export const vs: i32 = 1536; +export const pt: i32 = 53472; +export const wo: i32 = 2571356; +export const tw: i32 = 2571484; +export const hp: i32 = 2571548; +export const hw: i32 = 2571612; export const lm: i32 = 2; export const rm: i32 = 2; diff --git a/lang/nl/src/hyphenEngine.ts b/lang/nl/src/hyphenEngine.ts index 2f603c23..6043b680 100644 --- a/lang/nl/src/hyphenEngine.ts +++ b/lang/nl/src/hyphenEngine.ts @@ -5,6 +5,8 @@ export const hwo: i32 = hw; export const lmi: i32 = lm; export const rmi: i32 = rm; +let alphabetCount: i32 = 0; + /** * Maps BMP-charCode (16bit) to 8bit adresses * @@ -46,7 +48,6 @@ function createTranslateMap(): i32 { let first: i32 = 0; let second: i32 = 0; let secondInt: i32 = 0; - let alphabetCount: i32 = 0; i = to + 2; while (i < po) { first = load(i); @@ -69,13 +70,27 @@ function createTranslateMap(): i32 { pushToTranslateMap(first, secondInt); } // Add to alphabet - store(alphabetCount, first, 768); + store(alphabetCount, first, 1024); alphabetCount += 2; i += 4; } return alphabetCount >> 1; } +export function subst(ccl: i32, ccu: i32, replcc: i32): i32 { + const replccInt: i32 = pullFromTranslateMap(replcc); + if (replccInt !== 255) { + pushToTranslateMap(ccl, replccInt); + if (ccu !== 0) { + pushToTranslateMap(ccu, replccInt); + } + // Add to alphabet + store(alphabetCount, ccl, 1024); + alphabetCount += 2; + } + return alphabetCount >> 1; +} + export function conv(): i32 { let i: i32 = po; const patternEnd: i32 = po + pl; diff --git a/lang/nn/nn.wasm b/lang/nn/nn.wasm index cf5f3006..8bbc5cab 100644 Binary files a/lang/nn/nn.wasm and b/lang/nn/nn.wasm differ diff --git a/lang/nn/src/g.ts b/lang/nn/src/g.ts index 210a87bd..3ee5ad8a 100644 --- a/lang/nn/src/g.ts +++ b/lang/nn/src/g.ts @@ -1,11 +1,11 @@ -export const to: i32 = 5793724; -export const po: i32 = 5793870; +export const to: i32 = 5793980; +export const po: i32 = 5794126; export const pl: i32 = 117878; -export const vs: i32 = 1280; -export const pt: i32 = 113516; -export const wo: i32 = 5792620; -export const tw: i32 = 5792748; -export const hp: i32 = 5792812; -export const hw: i32 = 5792876; +export const vs: i32 = 1536; +export const pt: i32 = 113772; +export const wo: i32 = 5792876; +export const tw: i32 = 5793004; +export const hp: i32 = 5793068; +export const hw: i32 = 5793132; export const lm: i32 = 2; export const rm: i32 = 2; diff --git a/lang/nn/src/hyphenEngine.ts b/lang/nn/src/hyphenEngine.ts index 2f603c23..6043b680 100644 --- a/lang/nn/src/hyphenEngine.ts +++ b/lang/nn/src/hyphenEngine.ts @@ -5,6 +5,8 @@ export const hwo: i32 = hw; export const lmi: i32 = lm; export const rmi: i32 = rm; +let alphabetCount: i32 = 0; + /** * Maps BMP-charCode (16bit) to 8bit adresses * @@ -46,7 +48,6 @@ function createTranslateMap(): i32 { let first: i32 = 0; let second: i32 = 0; let secondInt: i32 = 0; - let alphabetCount: i32 = 0; i = to + 2; while (i < po) { first = load(i); @@ -69,13 +70,27 @@ function createTranslateMap(): i32 { pushToTranslateMap(first, secondInt); } // Add to alphabet - store(alphabetCount, first, 768); + store(alphabetCount, first, 1024); alphabetCount += 2; i += 4; } return alphabetCount >> 1; } +export function subst(ccl: i32, ccu: i32, replcc: i32): i32 { + const replccInt: i32 = pullFromTranslateMap(replcc); + if (replccInt !== 255) { + pushToTranslateMap(ccl, replccInt); + if (ccu !== 0) { + pushToTranslateMap(ccu, replccInt); + } + // Add to alphabet + store(alphabetCount, ccl, 1024); + alphabetCount += 2; + } + return alphabetCount >> 1; +} + export function conv(): i32 { let i: i32 = po; const patternEnd: i32 = po + pl; diff --git a/lang/oc/oc.wasm b/lang/oc/oc.wasm index 99cc3edb..447290f3 100644 Binary files a/lang/oc/oc.wasm and b/lang/oc/oc.wasm differ diff --git a/lang/oc/src/g.ts b/lang/oc/src/g.ts index fdc04fb2..e8c1ec1d 100644 --- a/lang/oc/src/g.ts +++ b/lang/oc/src/g.ts @@ -1,11 +1,11 @@ -export const to: i32 = 26904; -export const po: i32 = 27030; +export const to: i32 = 27160; +export const po: i32 = 27286; export const pl: i32 = 758; -export const vs: i32 = 1280; -export const pt: i32 = 2036; -export const wo: i32 = 25972; -export const tw: i32 = 26100; -export const hp: i32 = 26164; -export const hw: i32 = 26228; +export const vs: i32 = 1536; +export const pt: i32 = 2292; +export const wo: i32 = 26228; +export const tw: i32 = 26356; +export const hp: i32 = 26420; +export const hw: i32 = 26484; export const lm: i32 = 2; export const rm: i32 = 2; diff --git a/lang/oc/src/hyphenEngine.ts b/lang/oc/src/hyphenEngine.ts index 2f603c23..6043b680 100644 --- a/lang/oc/src/hyphenEngine.ts +++ b/lang/oc/src/hyphenEngine.ts @@ -5,6 +5,8 @@ export const hwo: i32 = hw; export const lmi: i32 = lm; export const rmi: i32 = rm; +let alphabetCount: i32 = 0; + /** * Maps BMP-charCode (16bit) to 8bit adresses * @@ -46,7 +48,6 @@ function createTranslateMap(): i32 { let first: i32 = 0; let second: i32 = 0; let secondInt: i32 = 0; - let alphabetCount: i32 = 0; i = to + 2; while (i < po) { first = load(i); @@ -69,13 +70,27 @@ function createTranslateMap(): i32 { pushToTranslateMap(first, secondInt); } // Add to alphabet - store(alphabetCount, first, 768); + store(alphabetCount, first, 1024); alphabetCount += 2; i += 4; } return alphabetCount >> 1; } +export function subst(ccl: i32, ccu: i32, replcc: i32): i32 { + const replccInt: i32 = pullFromTranslateMap(replcc); + if (replccInt !== 255) { + pushToTranslateMap(ccl, replccInt); + if (ccu !== 0) { + pushToTranslateMap(ccu, replccInt); + } + // Add to alphabet + store(alphabetCount, ccl, 1024); + alphabetCount += 2; + } + return alphabetCount >> 1; +} + export function conv(): i32 { let i: i32 = po; const patternEnd: i32 = po + pl; diff --git a/lang/or/or.wasm b/lang/or/or.wasm index 53801c03..e1ec437e 100644 Binary files a/lang/or/or.wasm and b/lang/or/or.wasm differ diff --git a/lang/or/src/g.ts b/lang/or/src/g.ts index c2e90392..b3ef35a8 100644 --- a/lang/or/src/g.ts +++ b/lang/or/src/g.ts @@ -1,11 +1,11 @@ -export const to: i32 = 2916; -export const po: i32 = 3182; +export const to: i32 = 3172; +export const po: i32 = 3438; export const pl: i32 = 206; -export const vs: i32 = 1280; -export const pt: i32 = 1444; -export const wo: i32 = 1972; -export const tw: i32 = 2100; -export const hp: i32 = 2164; -export const hw: i32 = 2228; +export const vs: i32 = 1536; +export const pt: i32 = 1700; +export const wo: i32 = 2228; +export const tw: i32 = 2356; +export const hp: i32 = 2420; +export const hw: i32 = 2484; export const lm: i32 = 1; export const rm: i32 = 1; diff --git a/lang/or/src/hyphenEngine.ts b/lang/or/src/hyphenEngine.ts index 2f603c23..6043b680 100644 --- a/lang/or/src/hyphenEngine.ts +++ b/lang/or/src/hyphenEngine.ts @@ -5,6 +5,8 @@ export const hwo: i32 = hw; export const lmi: i32 = lm; export const rmi: i32 = rm; +let alphabetCount: i32 = 0; + /** * Maps BMP-charCode (16bit) to 8bit adresses * @@ -46,7 +48,6 @@ function createTranslateMap(): i32 { let first: i32 = 0; let second: i32 = 0; let secondInt: i32 = 0; - let alphabetCount: i32 = 0; i = to + 2; while (i < po) { first = load(i); @@ -69,13 +70,27 @@ function createTranslateMap(): i32 { pushToTranslateMap(first, secondInt); } // Add to alphabet - store(alphabetCount, first, 768); + store(alphabetCount, first, 1024); alphabetCount += 2; i += 4; } return alphabetCount >> 1; } +export function subst(ccl: i32, ccu: i32, replcc: i32): i32 { + const replccInt: i32 = pullFromTranslateMap(replcc); + if (replccInt !== 255) { + pushToTranslateMap(ccl, replccInt); + if (ccu !== 0) { + pushToTranslateMap(ccu, replccInt); + } + // Add to alphabet + store(alphabetCount, ccl, 1024); + alphabetCount += 2; + } + return alphabetCount >> 1; +} + export function conv(): i32 { let i: i32 = po; const patternEnd: i32 = po + pl; diff --git a/lang/pa/pa.wasm b/lang/pa/pa.wasm index a642516d..ec672f7b 100644 Binary files a/lang/pa/pa.wasm and b/lang/pa/pa.wasm differ diff --git a/lang/pa/src/g.ts b/lang/pa/src/g.ts index abf1849e..093312b5 100644 --- a/lang/pa/src/g.ts +++ b/lang/pa/src/g.ts @@ -1,11 +1,11 @@ -export const to: i32 = 2860; -export const po: i32 = 3106; +export const to: i32 = 3116; +export const po: i32 = 3362; export const pl: i32 = 192; -export const vs: i32 = 1280; -export const pt: i32 = 1428; -export const wo: i32 = 1916; -export const tw: i32 = 2044; -export const hp: i32 = 2108; -export const hw: i32 = 2172; +export const vs: i32 = 1536; +export const pt: i32 = 1684; +export const wo: i32 = 2172; +export const tw: i32 = 2300; +export const hp: i32 = 2364; +export const hw: i32 = 2428; export const lm: i32 = 1; export const rm: i32 = 1; diff --git a/lang/pa/src/hyphenEngine.ts b/lang/pa/src/hyphenEngine.ts index 2f603c23..6043b680 100644 --- a/lang/pa/src/hyphenEngine.ts +++ b/lang/pa/src/hyphenEngine.ts @@ -5,6 +5,8 @@ export const hwo: i32 = hw; export const lmi: i32 = lm; export const rmi: i32 = rm; +let alphabetCount: i32 = 0; + /** * Maps BMP-charCode (16bit) to 8bit adresses * @@ -46,7 +48,6 @@ function createTranslateMap(): i32 { let first: i32 = 0; let second: i32 = 0; let secondInt: i32 = 0; - let alphabetCount: i32 = 0; i = to + 2; while (i < po) { first = load(i); @@ -69,13 +70,27 @@ function createTranslateMap(): i32 { pushToTranslateMap(first, secondInt); } // Add to alphabet - store(alphabetCount, first, 768); + store(alphabetCount, first, 1024); alphabetCount += 2; i += 4; } return alphabetCount >> 1; } +export function subst(ccl: i32, ccu: i32, replcc: i32): i32 { + const replccInt: i32 = pullFromTranslateMap(replcc); + if (replccInt !== 255) { + pushToTranslateMap(ccl, replccInt); + if (ccu !== 0) { + pushToTranslateMap(ccu, replccInt); + } + // Add to alphabet + store(alphabetCount, ccl, 1024); + alphabetCount += 2; + } + return alphabetCount >> 1; +} + export function conv(): i32 { let i: i32 = po; const patternEnd: i32 = po + pl; diff --git a/lang/pi/pi.wasm b/lang/pi/pi.wasm index f7f50752..87b38b68 100644 Binary files a/lang/pi/pi.wasm and b/lang/pi/pi.wasm differ diff --git a/lang/pi/src/g.ts b/lang/pi/src/g.ts index 3424f917..4aef1f60 100644 --- a/lang/pi/src/g.ts +++ b/lang/pi/src/g.ts @@ -1,11 +1,11 @@ -export const to: i32 = 10632; -export const po: i32 = 10766; +export const to: i32 = 10888; +export const po: i32 = 11022; export const pl: i32 = 399; -export const vs: i32 = 1280; -export const pt: i32 = 1636; -export const wo: i32 = 9672; -export const tw: i32 = 9800; -export const hp: i32 = 9864; -export const hw: i32 = 9928; +export const vs: i32 = 1536; +export const pt: i32 = 1892; +export const wo: i32 = 9928; +export const tw: i32 = 10056; +export const hp: i32 = 10120; +export const hw: i32 = 10184; export const lm: i32 = 1; export const rm: i32 = 2; diff --git a/lang/pi/src/hyphenEngine.ts b/lang/pi/src/hyphenEngine.ts index 2f603c23..6043b680 100644 --- a/lang/pi/src/hyphenEngine.ts +++ b/lang/pi/src/hyphenEngine.ts @@ -5,6 +5,8 @@ export const hwo: i32 = hw; export const lmi: i32 = lm; export const rmi: i32 = rm; +let alphabetCount: i32 = 0; + /** * Maps BMP-charCode (16bit) to 8bit adresses * @@ -46,7 +48,6 @@ function createTranslateMap(): i32 { let first: i32 = 0; let second: i32 = 0; let secondInt: i32 = 0; - let alphabetCount: i32 = 0; i = to + 2; while (i < po) { first = load(i); @@ -69,13 +70,27 @@ function createTranslateMap(): i32 { pushToTranslateMap(first, secondInt); } // Add to alphabet - store(alphabetCount, first, 768); + store(alphabetCount, first, 1024); alphabetCount += 2; i += 4; } return alphabetCount >> 1; } +export function subst(ccl: i32, ccu: i32, replcc: i32): i32 { + const replccInt: i32 = pullFromTranslateMap(replcc); + if (replccInt !== 255) { + pushToTranslateMap(ccl, replccInt); + if (ccu !== 0) { + pushToTranslateMap(ccu, replccInt); + } + // Add to alphabet + store(alphabetCount, ccl, 1024); + alphabetCount += 2; + } + return alphabetCount >> 1; +} + export function conv(): i32 { let i: i32 = po; const patternEnd: i32 = po + pl; diff --git a/lang/pl/pl.wasm b/lang/pl/pl.wasm index 0ade1877..6208ef75 100644 Binary files a/lang/pl/pl.wasm and b/lang/pl/pl.wasm differ diff --git a/lang/pl/src/g.ts b/lang/pl/src/g.ts index 880e0213..decab055 100644 --- a/lang/pl/src/g.ts +++ b/lang/pl/src/g.ts @@ -1,11 +1,11 @@ -export const to: i32 = 707104; -export const po: i32 = 707246; +export const to: i32 = 707360; +export const po: i32 = 707502; export const pl: i32 = 18420; -export const vs: i32 = 1280; -export const pt: i32 = 24140; -export const wo: i32 = 706020; -export const tw: i32 = 706148; -export const hp: i32 = 706212; -export const hw: i32 = 706276; +export const vs: i32 = 1536; +export const pt: i32 = 24396; +export const wo: i32 = 706276; +export const tw: i32 = 706404; +export const hp: i32 = 706468; +export const hw: i32 = 706532; export const lm: i32 = 2; export const rm: i32 = 2; diff --git a/lang/pl/src/hyphenEngine.ts b/lang/pl/src/hyphenEngine.ts index 2f603c23..6043b680 100644 --- a/lang/pl/src/hyphenEngine.ts +++ b/lang/pl/src/hyphenEngine.ts @@ -5,6 +5,8 @@ export const hwo: i32 = hw; export const lmi: i32 = lm; export const rmi: i32 = rm; +let alphabetCount: i32 = 0; + /** * Maps BMP-charCode (16bit) to 8bit adresses * @@ -46,7 +48,6 @@ function createTranslateMap(): i32 { let first: i32 = 0; let second: i32 = 0; let secondInt: i32 = 0; - let alphabetCount: i32 = 0; i = to + 2; while (i < po) { first = load(i); @@ -69,13 +70,27 @@ function createTranslateMap(): i32 { pushToTranslateMap(first, secondInt); } // Add to alphabet - store(alphabetCount, first, 768); + store(alphabetCount, first, 1024); alphabetCount += 2; i += 4; } return alphabetCount >> 1; } +export function subst(ccl: i32, ccu: i32, replcc: i32): i32 { + const replccInt: i32 = pullFromTranslateMap(replcc); + if (replccInt !== 255) { + pushToTranslateMap(ccl, replccInt); + if (ccu !== 0) { + pushToTranslateMap(ccu, replccInt); + } + // Add to alphabet + store(alphabetCount, ccl, 1024); + alphabetCount += 2; + } + return alphabetCount >> 1; +} + export function conv(): i32 { let i: i32 = po; const patternEnd: i32 = po + pl; diff --git a/lang/pms/pms.wasm b/lang/pms/pms.wasm index c1582bf3..52af063a 100644 Binary files a/lang/pms/pms.wasm and b/lang/pms/pms.wasm differ diff --git a/lang/pms/src/g.ts b/lang/pms/src/g.ts index 8a82b174..9f3df656 100644 --- a/lang/pms/src/g.ts +++ b/lang/pms/src/g.ts @@ -1,11 +1,11 @@ -export const to: i32 = 37028; -export const po: i32 = 37146; +export const to: i32 = 37284; +export const po: i32 = 37402; export const pl: i32 = 1018; -export const vs: i32 = 1280; -export const pt: i32 = 2348; -export const wo: i32 = 36092; -export const tw: i32 = 36220; -export const hp: i32 = 36284; -export const hw: i32 = 36348; +export const vs: i32 = 1536; +export const pt: i32 = 2604; +export const wo: i32 = 36348; +export const tw: i32 = 36476; +export const hp: i32 = 36540; +export const hw: i32 = 36604; export const lm: i32 = 2; export const rm: i32 = 2; diff --git a/lang/pms/src/hyphenEngine.ts b/lang/pms/src/hyphenEngine.ts index 2f603c23..6043b680 100644 --- a/lang/pms/src/hyphenEngine.ts +++ b/lang/pms/src/hyphenEngine.ts @@ -5,6 +5,8 @@ export const hwo: i32 = hw; export const lmi: i32 = lm; export const rmi: i32 = rm; +let alphabetCount: i32 = 0; + /** * Maps BMP-charCode (16bit) to 8bit adresses * @@ -46,7 +48,6 @@ function createTranslateMap(): i32 { let first: i32 = 0; let second: i32 = 0; let secondInt: i32 = 0; - let alphabetCount: i32 = 0; i = to + 2; while (i < po) { first = load(i); @@ -69,13 +70,27 @@ function createTranslateMap(): i32 { pushToTranslateMap(first, secondInt); } // Add to alphabet - store(alphabetCount, first, 768); + store(alphabetCount, first, 1024); alphabetCount += 2; i += 4; } return alphabetCount >> 1; } +export function subst(ccl: i32, ccu: i32, replcc: i32): i32 { + const replccInt: i32 = pullFromTranslateMap(replcc); + if (replccInt !== 255) { + pushToTranslateMap(ccl, replccInt); + if (ccu !== 0) { + pushToTranslateMap(ccu, replccInt); + } + // Add to alphabet + store(alphabetCount, ccl, 1024); + alphabetCount += 2; + } + return alphabetCount >> 1; +} + export function conv(): i32 { let i: i32 = po; const patternEnd: i32 = po + pl; diff --git a/lang/pt/pt.wasm b/lang/pt/pt.wasm index 9ec0fa2e..7f55fef1 100644 Binary files a/lang/pt/pt.wasm and b/lang/pt/pt.wasm differ diff --git a/lang/pt/src/g.ts b/lang/pt/src/g.ts index 73f422f1..5b897b0c 100644 --- a/lang/pt/src/g.ts +++ b/lang/pt/src/g.ts @@ -1,11 +1,11 @@ -export const to: i32 = 16912; -export const po: i32 = 17066; +export const to: i32 = 17168; +export const po: i32 = 17322; export const pl: i32 = 515; -export const vs: i32 = 1280; -export const pt: i32 = 1980; -export const wo: i32 = 15836; -export const tw: i32 = 15964; -export const hp: i32 = 16028; -export const hw: i32 = 16092; +export const vs: i32 = 1536; +export const pt: i32 = 2236; +export const wo: i32 = 16092; +export const tw: i32 = 16220; +export const hp: i32 = 16284; +export const hw: i32 = 16348; export const lm: i32 = 2; export const rm: i32 = 3; diff --git a/lang/pt/src/hyphenEngine.ts b/lang/pt/src/hyphenEngine.ts index 2f603c23..6043b680 100644 --- a/lang/pt/src/hyphenEngine.ts +++ b/lang/pt/src/hyphenEngine.ts @@ -5,6 +5,8 @@ export const hwo: i32 = hw; export const lmi: i32 = lm; export const rmi: i32 = rm; +let alphabetCount: i32 = 0; + /** * Maps BMP-charCode (16bit) to 8bit adresses * @@ -46,7 +48,6 @@ function createTranslateMap(): i32 { let first: i32 = 0; let second: i32 = 0; let secondInt: i32 = 0; - let alphabetCount: i32 = 0; i = to + 2; while (i < po) { first = load(i); @@ -69,13 +70,27 @@ function createTranslateMap(): i32 { pushToTranslateMap(first, secondInt); } // Add to alphabet - store(alphabetCount, first, 768); + store(alphabetCount, first, 1024); alphabetCount += 2; i += 4; } return alphabetCount >> 1; } +export function subst(ccl: i32, ccu: i32, replcc: i32): i32 { + const replccInt: i32 = pullFromTranslateMap(replcc); + if (replccInt !== 255) { + pushToTranslateMap(ccl, replccInt); + if (ccu !== 0) { + pushToTranslateMap(ccu, replccInt); + } + // Add to alphabet + store(alphabetCount, ccl, 1024); + alphabetCount += 2; + } + return alphabetCount >> 1; +} + export function conv(): i32 { let i: i32 = po; const patternEnd: i32 = po + pl; diff --git a/lang/rm/rm.wasm b/lang/rm/rm.wasm index be5ad331..30d44a0b 100644 Binary files a/lang/rm/rm.wasm and b/lang/rm/rm.wasm differ diff --git a/lang/rm/src/g.ts b/lang/rm/src/g.ts index 9d17eaf2..77e046d1 100644 --- a/lang/rm/src/g.ts +++ b/lang/rm/src/g.ts @@ -1,11 +1,11 @@ -export const to: i32 = 42028; -export const po: i32 = 42146; +export const to: i32 = 42284; +export const po: i32 = 42402; export const pl: i32 = 1119; -export const vs: i32 = 1280; -export const pt: i32 = 2396; -export const wo: i32 = 41096; -export const tw: i32 = 41224; -export const hp: i32 = 41288; -export const hw: i32 = 41352; +export const vs: i32 = 1536; +export const pt: i32 = 2652; +export const wo: i32 = 41352; +export const tw: i32 = 41480; +export const hp: i32 = 41544; +export const hw: i32 = 41608; export const lm: i32 = 2; export const rm: i32 = 2; diff --git a/lang/rm/src/hyphenEngine.ts b/lang/rm/src/hyphenEngine.ts index 2f603c23..6043b680 100644 --- a/lang/rm/src/hyphenEngine.ts +++ b/lang/rm/src/hyphenEngine.ts @@ -5,6 +5,8 @@ export const hwo: i32 = hw; export const lmi: i32 = lm; export const rmi: i32 = rm; +let alphabetCount: i32 = 0; + /** * Maps BMP-charCode (16bit) to 8bit adresses * @@ -46,7 +48,6 @@ function createTranslateMap(): i32 { let first: i32 = 0; let second: i32 = 0; let secondInt: i32 = 0; - let alphabetCount: i32 = 0; i = to + 2; while (i < po) { first = load(i); @@ -69,13 +70,27 @@ function createTranslateMap(): i32 { pushToTranslateMap(first, secondInt); } // Add to alphabet - store(alphabetCount, first, 768); + store(alphabetCount, first, 1024); alphabetCount += 2; i += 4; } return alphabetCount >> 1; } +export function subst(ccl: i32, ccu: i32, replcc: i32): i32 { + const replccInt: i32 = pullFromTranslateMap(replcc); + if (replccInt !== 255) { + pushToTranslateMap(ccl, replccInt); + if (ccu !== 0) { + pushToTranslateMap(ccu, replccInt); + } + // Add to alphabet + store(alphabetCount, ccl, 1024); + alphabetCount += 2; + } + return alphabetCount >> 1; +} + export function conv(): i32 { let i: i32 = po; const patternEnd: i32 = po + pl; diff --git a/lang/ro/ro.wasm b/lang/ro/ro.wasm index 5e1c2869..a67b83d7 100644 Binary files a/lang/ro/ro.wasm and b/lang/ro/ro.wasm differ diff --git a/lang/ro/src/g.ts b/lang/ro/src/g.ts index b495cb18..ecededfa 100644 --- a/lang/ro/src/g.ts +++ b/lang/ro/src/g.ts @@ -1,11 +1,11 @@ -export const to: i32 = 87960; -export const po: i32 = 88074; +export const to: i32 = 88216; +export const po: i32 = 88330; export const pl: i32 = 2402; -export const vs: i32 = 1280; -export const pt: i32 = 3396; -export const wo: i32 = 87068; -export const tw: i32 = 87196; -export const hp: i32 = 87260; -export const hw: i32 = 87324; +export const vs: i32 = 1536; +export const pt: i32 = 3652; +export const wo: i32 = 87324; +export const tw: i32 = 87452; +export const hp: i32 = 87516; +export const hw: i32 = 87580; export const lm: i32 = 2; export const rm: i32 = 2; diff --git a/lang/ro/src/hyphenEngine.ts b/lang/ro/src/hyphenEngine.ts index 2f603c23..6043b680 100644 --- a/lang/ro/src/hyphenEngine.ts +++ b/lang/ro/src/hyphenEngine.ts @@ -5,6 +5,8 @@ export const hwo: i32 = hw; export const lmi: i32 = lm; export const rmi: i32 = rm; +let alphabetCount: i32 = 0; + /** * Maps BMP-charCode (16bit) to 8bit adresses * @@ -46,7 +48,6 @@ function createTranslateMap(): i32 { let first: i32 = 0; let second: i32 = 0; let secondInt: i32 = 0; - let alphabetCount: i32 = 0; i = to + 2; while (i < po) { first = load(i); @@ -69,13 +70,27 @@ function createTranslateMap(): i32 { pushToTranslateMap(first, secondInt); } // Add to alphabet - store(alphabetCount, first, 768); + store(alphabetCount, first, 1024); alphabetCount += 2; i += 4; } return alphabetCount >> 1; } +export function subst(ccl: i32, ccu: i32, replcc: i32): i32 { + const replccInt: i32 = pullFromTranslateMap(replcc); + if (replccInt !== 255) { + pushToTranslateMap(ccl, replccInt); + if (ccu !== 0) { + pushToTranslateMap(ccu, replccInt); + } + // Add to alphabet + store(alphabetCount, ccl, 1024); + alphabetCount += 2; + } + return alphabetCount >> 1; +} + export function conv(): i32 { let i: i32 = po; const patternEnd: i32 = po + pl; diff --git a/lang/ru/ru.wasm b/lang/ru/ru.wasm index 5c36b108..321b3edb 100644 Binary files a/lang/ru/ru.wasm and b/lang/ru/ru.wasm differ diff --git a/lang/ru/src/g.ts b/lang/ru/src/g.ts index 85b9d678..8771c07b 100644 --- a/lang/ru/src/g.ts +++ b/lang/ru/src/g.ts @@ -1,11 +1,11 @@ -export const to: i32 = 1208148; -export const po: i32 = 1208290; +export const to: i32 = 1208404; +export const po: i32 = 1208546; export const pl: i32 = 27828; -export const vs: i32 = 1280; -export const pt: i32 = 29420; -export const wo: i32 = 1207164; -export const tw: i32 = 1207292; -export const hp: i32 = 1207356; -export const hw: i32 = 1207420; +export const vs: i32 = 1536; +export const pt: i32 = 29676; +export const wo: i32 = 1207420; +export const tw: i32 = 1207548; +export const hp: i32 = 1207612; +export const hw: i32 = 1207676; export const lm: i32 = 2; export const rm: i32 = 2; diff --git a/lang/ru/src/hyphenEngine.ts b/lang/ru/src/hyphenEngine.ts index 2f603c23..6043b680 100644 --- a/lang/ru/src/hyphenEngine.ts +++ b/lang/ru/src/hyphenEngine.ts @@ -5,6 +5,8 @@ export const hwo: i32 = hw; export const lmi: i32 = lm; export const rmi: i32 = rm; +let alphabetCount: i32 = 0; + /** * Maps BMP-charCode (16bit) to 8bit adresses * @@ -46,7 +48,6 @@ function createTranslateMap(): i32 { let first: i32 = 0; let second: i32 = 0; let secondInt: i32 = 0; - let alphabetCount: i32 = 0; i = to + 2; while (i < po) { first = load(i); @@ -69,13 +70,27 @@ function createTranslateMap(): i32 { pushToTranslateMap(first, secondInt); } // Add to alphabet - store(alphabetCount, first, 768); + store(alphabetCount, first, 1024); alphabetCount += 2; i += 4; } return alphabetCount >> 1; } +export function subst(ccl: i32, ccu: i32, replcc: i32): i32 { + const replccInt: i32 = pullFromTranslateMap(replcc); + if (replccInt !== 255) { + pushToTranslateMap(ccl, replccInt); + if (ccu !== 0) { + pushToTranslateMap(ccu, replccInt); + } + // Add to alphabet + store(alphabetCount, ccl, 1024); + alphabetCount += 2; + } + return alphabetCount >> 1; +} + export function conv(): i32 { let i: i32 = po; const patternEnd: i32 = po + pl; diff --git a/lang/sh-cyrl/sh-cyrl.wasm b/lang/sh-cyrl/sh-cyrl.wasm index e9e0548e..92fb3e71 100644 Binary files a/lang/sh-cyrl/sh-cyrl.wasm and b/lang/sh-cyrl/sh-cyrl.wasm differ diff --git a/lang/sh-cyrl/src/g.ts b/lang/sh-cyrl/src/g.ts index a9cd4db8..b770eb7b 100644 --- a/lang/sh-cyrl/src/g.ts +++ b/lang/sh-cyrl/src/g.ts @@ -1,11 +1,11 @@ -export const to: i32 = 375420; -export const po: i32 = 375546; +export const to: i32 = 375676; +export const po: i32 = 375802; export const pl: i32 = 13093; -export const vs: i32 = 1280; -export const pt: i32 = 12816; -export const wo: i32 = 374432; -export const tw: i32 = 374560; -export const hp: i32 = 374624; -export const hw: i32 = 374688; +export const vs: i32 = 1536; +export const pt: i32 = 13072; +export const wo: i32 = 374688; +export const tw: i32 = 374816; +export const hp: i32 = 374880; +export const hw: i32 = 374944; export const lm: i32 = 2; export const rm: i32 = 2; diff --git a/lang/sh-cyrl/src/hyphenEngine.ts b/lang/sh-cyrl/src/hyphenEngine.ts index 2f603c23..6043b680 100644 --- a/lang/sh-cyrl/src/hyphenEngine.ts +++ b/lang/sh-cyrl/src/hyphenEngine.ts @@ -5,6 +5,8 @@ export const hwo: i32 = hw; export const lmi: i32 = lm; export const rmi: i32 = rm; +let alphabetCount: i32 = 0; + /** * Maps BMP-charCode (16bit) to 8bit adresses * @@ -46,7 +48,6 @@ function createTranslateMap(): i32 { let first: i32 = 0; let second: i32 = 0; let secondInt: i32 = 0; - let alphabetCount: i32 = 0; i = to + 2; while (i < po) { first = load(i); @@ -69,13 +70,27 @@ function createTranslateMap(): i32 { pushToTranslateMap(first, secondInt); } // Add to alphabet - store(alphabetCount, first, 768); + store(alphabetCount, first, 1024); alphabetCount += 2; i += 4; } return alphabetCount >> 1; } +export function subst(ccl: i32, ccu: i32, replcc: i32): i32 { + const replccInt: i32 = pullFromTranslateMap(replcc); + if (replccInt !== 255) { + pushToTranslateMap(ccl, replccInt); + if (ccu !== 0) { + pushToTranslateMap(ccu, replccInt); + } + // Add to alphabet + store(alphabetCount, ccl, 1024); + alphabetCount += 2; + } + return alphabetCount >> 1; +} + export function conv(): i32 { let i: i32 = po; const patternEnd: i32 = po + pl; diff --git a/lang/sh-latn/sh-latn.wasm b/lang/sh-latn/sh-latn.wasm index 5cf806ab..e14d1732 100644 Binary files a/lang/sh-latn/sh-latn.wasm and b/lang/sh-latn/sh-latn.wasm differ diff --git a/lang/sh-latn/src/g.ts b/lang/sh-latn/src/g.ts index 2968d10d..e23ee298 100644 --- a/lang/sh-latn/src/g.ts +++ b/lang/sh-latn/src/g.ts @@ -1,11 +1,11 @@ -export const to: i32 = 384700; -export const po: i32 = 384814; +export const to: i32 = 384956; +export const po: i32 = 385070; export const pl: i32 = 13656; -export const vs: i32 = 1280; -export const pt: i32 = 12992; -export const wo: i32 = 383716; -export const tw: i32 = 383844; -export const hp: i32 = 383908; -export const hw: i32 = 383972; +export const vs: i32 = 1536; +export const pt: i32 = 13248; +export const wo: i32 = 383972; +export const tw: i32 = 384100; +export const hp: i32 = 384164; +export const hw: i32 = 384228; export const lm: i32 = 2; export const rm: i32 = 2; diff --git a/lang/sh-latn/src/hyphenEngine.ts b/lang/sh-latn/src/hyphenEngine.ts index 2f603c23..6043b680 100644 --- a/lang/sh-latn/src/hyphenEngine.ts +++ b/lang/sh-latn/src/hyphenEngine.ts @@ -5,6 +5,8 @@ export const hwo: i32 = hw; export const lmi: i32 = lm; export const rmi: i32 = rm; +let alphabetCount: i32 = 0; + /** * Maps BMP-charCode (16bit) to 8bit adresses * @@ -46,7 +48,6 @@ function createTranslateMap(): i32 { let first: i32 = 0; let second: i32 = 0; let secondInt: i32 = 0; - let alphabetCount: i32 = 0; i = to + 2; while (i < po) { first = load(i); @@ -69,13 +70,27 @@ function createTranslateMap(): i32 { pushToTranslateMap(first, secondInt); } // Add to alphabet - store(alphabetCount, first, 768); + store(alphabetCount, first, 1024); alphabetCount += 2; i += 4; } return alphabetCount >> 1; } +export function subst(ccl: i32, ccu: i32, replcc: i32): i32 { + const replccInt: i32 = pullFromTranslateMap(replcc); + if (replccInt !== 255) { + pushToTranslateMap(ccl, replccInt); + if (ccu !== 0) { + pushToTranslateMap(ccu, replccInt); + } + // Add to alphabet + store(alphabetCount, ccl, 1024); + alphabetCount += 2; + } + return alphabetCount >> 1; +} + export function conv(): i32 { let i: i32 = po; const patternEnd: i32 = po + pl; diff --git a/lang/sk/sk.wasm b/lang/sk/sk.wasm index e849e683..0116a4e5 100644 Binary files a/lang/sk/sk.wasm and b/lang/sk/sk.wasm differ diff --git a/lang/sk/src/g.ts b/lang/sk/src/g.ts index 8dff0074..daf97d9e 100644 --- a/lang/sk/src/g.ts +++ b/lang/sk/src/g.ts @@ -1,11 +1,11 @@ -export const to: i32 = 634544; -export const po: i32 = 634714; +export const to: i32 = 634800; +export const po: i32 = 634970; export const pl: i32 = 12235; -export const vs: i32 = 1280; -export const pt: i32 = 12980; -export const wo: i32 = 633476; -export const tw: i32 = 633604; -export const hp: i32 = 633668; -export const hw: i32 = 633732; +export const vs: i32 = 1536; +export const pt: i32 = 13236; +export const wo: i32 = 633732; +export const tw: i32 = 633860; +export const hp: i32 = 633924; +export const hw: i32 = 633988; export const lm: i32 = 2; export const rm: i32 = 3; diff --git a/lang/sk/src/hyphenEngine.ts b/lang/sk/src/hyphenEngine.ts index 2f603c23..6043b680 100644 --- a/lang/sk/src/hyphenEngine.ts +++ b/lang/sk/src/hyphenEngine.ts @@ -5,6 +5,8 @@ export const hwo: i32 = hw; export const lmi: i32 = lm; export const rmi: i32 = rm; +let alphabetCount: i32 = 0; + /** * Maps BMP-charCode (16bit) to 8bit adresses * @@ -46,7 +48,6 @@ function createTranslateMap(): i32 { let first: i32 = 0; let second: i32 = 0; let secondInt: i32 = 0; - let alphabetCount: i32 = 0; i = to + 2; while (i < po) { first = load(i); @@ -69,13 +70,27 @@ function createTranslateMap(): i32 { pushToTranslateMap(first, secondInt); } // Add to alphabet - store(alphabetCount, first, 768); + store(alphabetCount, first, 1024); alphabetCount += 2; i += 4; } return alphabetCount >> 1; } +export function subst(ccl: i32, ccu: i32, replcc: i32): i32 { + const replccInt: i32 = pullFromTranslateMap(replcc); + if (replccInt !== 255) { + pushToTranslateMap(ccl, replccInt); + if (ccu !== 0) { + pushToTranslateMap(ccu, replccInt); + } + // Add to alphabet + store(alphabetCount, ccl, 1024); + alphabetCount += 2; + } + return alphabetCount >> 1; +} + export function conv(): i32 { let i: i32 = po; const patternEnd: i32 = po + pl; diff --git a/lang/sl/sl.wasm b/lang/sl/sl.wasm index 7594c756..7d934107 100644 Binary files a/lang/sl/sl.wasm and b/lang/sl/sl.wasm differ diff --git a/lang/sl/src/g.ts b/lang/sl/src/g.ts index 1d91b498..a945f0e0 100644 --- a/lang/sl/src/g.ts +++ b/lang/sl/src/g.ts @@ -1,11 +1,11 @@ -export const to: i32 = 184496; -export const po: i32 = 184618; +export const to: i32 = 184752; +export const po: i32 = 184874; export const pl: i32 = 4049; -export const vs: i32 = 1280; -export const pt: i32 = 4940; -export const wo: i32 = 183544; -export const tw: i32 = 183672; -export const hp: i32 = 183736; -export const hw: i32 = 183800; +export const vs: i32 = 1536; +export const pt: i32 = 5196; +export const wo: i32 = 183800; +export const tw: i32 = 183928; +export const hp: i32 = 183992; +export const hw: i32 = 184056; export const lm: i32 = 2; export const rm: i32 = 2; diff --git a/lang/sl/src/hyphenEngine.ts b/lang/sl/src/hyphenEngine.ts index 2f603c23..6043b680 100644 --- a/lang/sl/src/hyphenEngine.ts +++ b/lang/sl/src/hyphenEngine.ts @@ -5,6 +5,8 @@ export const hwo: i32 = hw; export const lmi: i32 = lm; export const rmi: i32 = rm; +let alphabetCount: i32 = 0; + /** * Maps BMP-charCode (16bit) to 8bit adresses * @@ -46,7 +48,6 @@ function createTranslateMap(): i32 { let first: i32 = 0; let second: i32 = 0; let secondInt: i32 = 0; - let alphabetCount: i32 = 0; i = to + 2; while (i < po) { first = load(i); @@ -69,13 +70,27 @@ function createTranslateMap(): i32 { pushToTranslateMap(first, secondInt); } // Add to alphabet - store(alphabetCount, first, 768); + store(alphabetCount, first, 1024); alphabetCount += 2; i += 4; } return alphabetCount >> 1; } +export function subst(ccl: i32, ccu: i32, replcc: i32): i32 { + const replccInt: i32 = pullFromTranslateMap(replcc); + if (replccInt !== 255) { + pushToTranslateMap(ccl, replccInt); + if (ccu !== 0) { + pushToTranslateMap(ccu, replccInt); + } + // Add to alphabet + store(alphabetCount, ccl, 1024); + alphabetCount += 2; + } + return alphabetCount >> 1; +} + export function conv(): i32 { let i: i32 = po; const patternEnd: i32 = po + pl; diff --git a/lang/sr-cyrl/sr-cyrl.wasm b/lang/sr-cyrl/sr-cyrl.wasm index 3d045133..e2c3dd93 100644 Binary files a/lang/sr-cyrl/sr-cyrl.wasm and b/lang/sr-cyrl/sr-cyrl.wasm differ diff --git a/lang/sr-cyrl/src/g.ts b/lang/sr-cyrl/src/g.ts index 15d8a116..d3fcb89a 100644 --- a/lang/sr-cyrl/src/g.ts +++ b/lang/sr-cyrl/src/g.ts @@ -1,11 +1,11 @@ -export const to: i32 = 390576; -export const po: i32 = 390702; +export const to: i32 = 390832; +export const po: i32 = 390958; export const pl: i32 = 12934; -export const vs: i32 = 1280; -export const pt: i32 = 12372; -export const wo: i32 = 389360; -export const tw: i32 = 389488; -export const hp: i32 = 389552; -export const hw: i32 = 389616; +export const vs: i32 = 1536; +export const pt: i32 = 12628; +export const wo: i32 = 389616; +export const tw: i32 = 389744; +export const hp: i32 = 389808; +export const hw: i32 = 389872; export const lm: i32 = 2; export const rm: i32 = 2; diff --git a/lang/sr-cyrl/src/hyphenEngine.ts b/lang/sr-cyrl/src/hyphenEngine.ts index 2f603c23..6043b680 100644 --- a/lang/sr-cyrl/src/hyphenEngine.ts +++ b/lang/sr-cyrl/src/hyphenEngine.ts @@ -5,6 +5,8 @@ export const hwo: i32 = hw; export const lmi: i32 = lm; export const rmi: i32 = rm; +let alphabetCount: i32 = 0; + /** * Maps BMP-charCode (16bit) to 8bit adresses * @@ -46,7 +48,6 @@ function createTranslateMap(): i32 { let first: i32 = 0; let second: i32 = 0; let secondInt: i32 = 0; - let alphabetCount: i32 = 0; i = to + 2; while (i < po) { first = load(i); @@ -69,13 +70,27 @@ function createTranslateMap(): i32 { pushToTranslateMap(first, secondInt); } // Add to alphabet - store(alphabetCount, first, 768); + store(alphabetCount, first, 1024); alphabetCount += 2; i += 4; } return alphabetCount >> 1; } +export function subst(ccl: i32, ccu: i32, replcc: i32): i32 { + const replccInt: i32 = pullFromTranslateMap(replcc); + if (replccInt !== 255) { + pushToTranslateMap(ccl, replccInt); + if (ccu !== 0) { + pushToTranslateMap(ccu, replccInt); + } + // Add to alphabet + store(alphabetCount, ccl, 1024); + alphabetCount += 2; + } + return alphabetCount >> 1; +} + export function conv(): i32 { let i: i32 = po; const patternEnd: i32 = po + pl; diff --git a/lang/sv/src/g.ts b/lang/sv/src/g.ts index 2e8f3e93..876554de 100644 --- a/lang/sv/src/g.ts +++ b/lang/sv/src/g.ts @@ -1,11 +1,11 @@ -export const to: i32 = 892032; -export const po: i32 = 892158; +export const to: i32 = 892288; +export const po: i32 = 892414; export const pl: i32 = 18883; -export const vs: i32 = 1280; -export const pt: i32 = 17944; -export const wo: i32 = 891120; -export const tw: i32 = 891248; -export const hp: i32 = 891312; -export const hw: i32 = 891376; +export const vs: i32 = 1536; +export const pt: i32 = 18200; +export const wo: i32 = 891376; +export const tw: i32 = 891504; +export const hp: i32 = 891568; +export const hw: i32 = 891632; export const lm: i32 = 2; export const rm: i32 = 2; diff --git a/lang/sv/src/hyphenEngine.ts b/lang/sv/src/hyphenEngine.ts index 2f603c23..6043b680 100644 --- a/lang/sv/src/hyphenEngine.ts +++ b/lang/sv/src/hyphenEngine.ts @@ -5,6 +5,8 @@ export const hwo: i32 = hw; export const lmi: i32 = lm; export const rmi: i32 = rm; +let alphabetCount: i32 = 0; + /** * Maps BMP-charCode (16bit) to 8bit adresses * @@ -46,7 +48,6 @@ function createTranslateMap(): i32 { let first: i32 = 0; let second: i32 = 0; let secondInt: i32 = 0; - let alphabetCount: i32 = 0; i = to + 2; while (i < po) { first = load(i); @@ -69,13 +70,27 @@ function createTranslateMap(): i32 { pushToTranslateMap(first, secondInt); } // Add to alphabet - store(alphabetCount, first, 768); + store(alphabetCount, first, 1024); alphabetCount += 2; i += 4; } return alphabetCount >> 1; } +export function subst(ccl: i32, ccu: i32, replcc: i32): i32 { + const replccInt: i32 = pullFromTranslateMap(replcc); + if (replccInt !== 255) { + pushToTranslateMap(ccl, replccInt); + if (ccu !== 0) { + pushToTranslateMap(ccu, replccInt); + } + // Add to alphabet + store(alphabetCount, ccl, 1024); + alphabetCount += 2; + } + return alphabetCount >> 1; +} + export function conv(): i32 { let i: i32 = po; const patternEnd: i32 = po + pl; diff --git a/lang/sv/sv.wasm b/lang/sv/sv.wasm index 1cd61905..e2ca121f 100644 Binary files a/lang/sv/sv.wasm and b/lang/sv/sv.wasm differ diff --git a/lang/ta/src/g.ts b/lang/ta/src/g.ts index f4ff4f4e..464d6e26 100644 --- a/lang/ta/src/g.ts +++ b/lang/ta/src/g.ts @@ -1,11 +1,11 @@ -export const to: i32 = 11676; -export const po: i32 = 11886; +export const to: i32 = 11932; +export const po: i32 = 12142; export const pl: i32 = 279; -export const vs: i32 = 1280; -export const pt: i32 = 1496; -export const wo: i32 = 10732; -export const tw: i32 = 10860; -export const hp: i32 = 10924; -export const hw: i32 = 10988; +export const vs: i32 = 1536; +export const pt: i32 = 1752; +export const wo: i32 = 10988; +export const tw: i32 = 11116; +export const hp: i32 = 11180; +export const hw: i32 = 11244; export const lm: i32 = 1; export const rm: i32 = 1; diff --git a/lang/ta/src/hyphenEngine.ts b/lang/ta/src/hyphenEngine.ts index 2f603c23..6043b680 100644 --- a/lang/ta/src/hyphenEngine.ts +++ b/lang/ta/src/hyphenEngine.ts @@ -5,6 +5,8 @@ export const hwo: i32 = hw; export const lmi: i32 = lm; export const rmi: i32 = rm; +let alphabetCount: i32 = 0; + /** * Maps BMP-charCode (16bit) to 8bit adresses * @@ -46,7 +48,6 @@ function createTranslateMap(): i32 { let first: i32 = 0; let second: i32 = 0; let secondInt: i32 = 0; - let alphabetCount: i32 = 0; i = to + 2; while (i < po) { first = load(i); @@ -69,13 +70,27 @@ function createTranslateMap(): i32 { pushToTranslateMap(first, secondInt); } // Add to alphabet - store(alphabetCount, first, 768); + store(alphabetCount, first, 1024); alphabetCount += 2; i += 4; } return alphabetCount >> 1; } +export function subst(ccl: i32, ccu: i32, replcc: i32): i32 { + const replccInt: i32 = pullFromTranslateMap(replcc); + if (replccInt !== 255) { + pushToTranslateMap(ccl, replccInt); + if (ccu !== 0) { + pushToTranslateMap(ccu, replccInt); + } + // Add to alphabet + store(alphabetCount, ccl, 1024); + alphabetCount += 2; + } + return alphabetCount >> 1; +} + export function conv(): i32 { let i: i32 = po; const patternEnd: i32 = po + pl; diff --git a/lang/ta/ta.wasm b/lang/ta/ta.wasm index 2e16a014..faa75937 100644 Binary files a/lang/ta/ta.wasm and b/lang/ta/ta.wasm differ diff --git a/lang/te/src/g.ts b/lang/te/src/g.ts index 4266c977..3fea75b5 100644 --- a/lang/te/src/g.ts +++ b/lang/te/src/g.ts @@ -1,11 +1,11 @@ -export const to: i32 = 2992; -export const po: i32 = 3286; +export const to: i32 = 3248; +export const po: i32 = 3542; export const pl: i32 = 228; -export const vs: i32 = 1280; -export const pt: i32 = 1464; -export const wo: i32 = 2048; -export const tw: i32 = 2176; -export const hp: i32 = 2240; -export const hw: i32 = 2304; +export const vs: i32 = 1536; +export const pt: i32 = 1720; +export const wo: i32 = 2304; +export const tw: i32 = 2432; +export const hp: i32 = 2496; +export const hw: i32 = 2560; export const lm: i32 = 1; export const rm: i32 = 1; diff --git a/lang/te/src/hyphenEngine.ts b/lang/te/src/hyphenEngine.ts index 2f603c23..6043b680 100644 --- a/lang/te/src/hyphenEngine.ts +++ b/lang/te/src/hyphenEngine.ts @@ -5,6 +5,8 @@ export const hwo: i32 = hw; export const lmi: i32 = lm; export const rmi: i32 = rm; +let alphabetCount: i32 = 0; + /** * Maps BMP-charCode (16bit) to 8bit adresses * @@ -46,7 +48,6 @@ function createTranslateMap(): i32 { let first: i32 = 0; let second: i32 = 0; let secondInt: i32 = 0; - let alphabetCount: i32 = 0; i = to + 2; while (i < po) { first = load(i); @@ -69,13 +70,27 @@ function createTranslateMap(): i32 { pushToTranslateMap(first, secondInt); } // Add to alphabet - store(alphabetCount, first, 768); + store(alphabetCount, first, 1024); alphabetCount += 2; i += 4; } return alphabetCount >> 1; } +export function subst(ccl: i32, ccu: i32, replcc: i32): i32 { + const replccInt: i32 = pullFromTranslateMap(replcc); + if (replccInt !== 255) { + pushToTranslateMap(ccl, replccInt); + if (ccu !== 0) { + pushToTranslateMap(ccu, replccInt); + } + // Add to alphabet + store(alphabetCount, ccl, 1024); + alphabetCount += 2; + } + return alphabetCount >> 1; +} + export function conv(): i32 { let i: i32 = po; const patternEnd: i32 = po + pl; diff --git a/lang/te/te.wasm b/lang/te/te.wasm index 16c2981c..d127aa6b 100644 Binary files a/lang/te/te.wasm and b/lang/te/te.wasm differ diff --git a/lang/th/src/g.ts b/lang/th/src/g.ts index b34d0c2c..b812fd10 100644 --- a/lang/th/src/g.ts +++ b/lang/th/src/g.ts @@ -1,11 +1,11 @@ -export const to: i32 = 2071584; -export const po: i32 = 2071874; +export const to: i32 = 2071840; +export const po: i32 = 2072130; export const pl: i32 = 15792; -export const vs: i32 = 1280; -export const pt: i32 = 16768; -export const wo: i32 = 2070544; -export const tw: i32 = 2070672; -export const hp: i32 = 2070736; -export const hw: i32 = 2070800; +export const vs: i32 = 1536; +export const pt: i32 = 17024; +export const wo: i32 = 2070800; +export const tw: i32 = 2070928; +export const hp: i32 = 2070992; +export const hw: i32 = 2071056; export const lm: i32 = 2; export const rm: i32 = 3; diff --git a/lang/th/src/hyphenEngine.ts b/lang/th/src/hyphenEngine.ts index 2f603c23..6043b680 100644 --- a/lang/th/src/hyphenEngine.ts +++ b/lang/th/src/hyphenEngine.ts @@ -5,6 +5,8 @@ export const hwo: i32 = hw; export const lmi: i32 = lm; export const rmi: i32 = rm; +let alphabetCount: i32 = 0; + /** * Maps BMP-charCode (16bit) to 8bit adresses * @@ -46,7 +48,6 @@ function createTranslateMap(): i32 { let first: i32 = 0; let second: i32 = 0; let secondInt: i32 = 0; - let alphabetCount: i32 = 0; i = to + 2; while (i < po) { first = load(i); @@ -69,13 +70,27 @@ function createTranslateMap(): i32 { pushToTranslateMap(first, secondInt); } // Add to alphabet - store(alphabetCount, first, 768); + store(alphabetCount, first, 1024); alphabetCount += 2; i += 4; } return alphabetCount >> 1; } +export function subst(ccl: i32, ccu: i32, replcc: i32): i32 { + const replccInt: i32 = pullFromTranslateMap(replcc); + if (replccInt !== 255) { + pushToTranslateMap(ccl, replccInt); + if (ccu !== 0) { + pushToTranslateMap(ccu, replccInt); + } + // Add to alphabet + store(alphabetCount, ccl, 1024); + alphabetCount += 2; + } + return alphabetCount >> 1; +} + export function conv(): i32 { let i: i32 = po; const patternEnd: i32 = po + pl; diff --git a/lang/th/th.wasm b/lang/th/th.wasm index 51fb6332..22f73bf0 100644 Binary files a/lang/th/th.wasm and b/lang/th/th.wasm differ diff --git a/lang/tk/src/g.ts b/lang/tk/src/g.ts index 70844cc5..152ffe7b 100644 --- a/lang/tk/src/g.ts +++ b/lang/tk/src/g.ts @@ -1,11 +1,11 @@ -export const to: i32 = 78684; -export const po: i32 = 78814; +export const to: i32 = 78940; +export const po: i32 = 79070; export const pl: i32 = 4789; -export const vs: i32 = 1280; -export const pt: i32 = 9132; -export const wo: i32 = 77768; -export const tw: i32 = 77896; -export const hp: i32 = 77960; -export const hw: i32 = 78024; +export const vs: i32 = 1536; +export const pt: i32 = 9388; +export const wo: i32 = 78024; +export const tw: i32 = 78152; +export const hp: i32 = 78216; +export const hw: i32 = 78280; export const lm: i32 = 2; export const rm: i32 = 2; diff --git a/lang/tk/src/hyphenEngine.ts b/lang/tk/src/hyphenEngine.ts index 2f603c23..6043b680 100644 --- a/lang/tk/src/hyphenEngine.ts +++ b/lang/tk/src/hyphenEngine.ts @@ -5,6 +5,8 @@ export const hwo: i32 = hw; export const lmi: i32 = lm; export const rmi: i32 = rm; +let alphabetCount: i32 = 0; + /** * Maps BMP-charCode (16bit) to 8bit adresses * @@ -46,7 +48,6 @@ function createTranslateMap(): i32 { let first: i32 = 0; let second: i32 = 0; let secondInt: i32 = 0; - let alphabetCount: i32 = 0; i = to + 2; while (i < po) { first = load(i); @@ -69,13 +70,27 @@ function createTranslateMap(): i32 { pushToTranslateMap(first, secondInt); } // Add to alphabet - store(alphabetCount, first, 768); + store(alphabetCount, first, 1024); alphabetCount += 2; i += 4; } return alphabetCount >> 1; } +export function subst(ccl: i32, ccu: i32, replcc: i32): i32 { + const replccInt: i32 = pullFromTranslateMap(replcc); + if (replccInt !== 255) { + pushToTranslateMap(ccl, replccInt); + if (ccu !== 0) { + pushToTranslateMap(ccu, replccInt); + } + // Add to alphabet + store(alphabetCount, ccl, 1024); + alphabetCount += 2; + } + return alphabetCount >> 1; +} + export function conv(): i32 { let i: i32 = po; const patternEnd: i32 = po + pl; diff --git a/lang/tk/tk.wasm b/lang/tk/tk.wasm index a26ca2a0..5832830d 100644 Binary files a/lang/tk/tk.wasm and b/lang/tk/tk.wasm differ diff --git a/lang/tr/src/g.ts b/lang/tr/src/g.ts index d646f839..07eecf0c 100644 --- a/lang/tr/src/g.ts +++ b/lang/tr/src/g.ts @@ -1,11 +1,11 @@ -export const to: i32 = 14620; -export const po: i32 = 14754; +export const to: i32 = 14876; +export const po: i32 = 15010; export const pl: i32 = 932; -export const vs: i32 = 1280; -export const pt: i32 = 2756; -export const wo: i32 = 13472; -export const tw: i32 = 13600; -export const hp: i32 = 13664; -export const hw: i32 = 13728; +export const vs: i32 = 1536; +export const pt: i32 = 3012; +export const wo: i32 = 13728; +export const tw: i32 = 13856; +export const hp: i32 = 13920; +export const hw: i32 = 13984; export const lm: i32 = 2; export const rm: i32 = 2; diff --git a/lang/tr/src/hyphenEngine.ts b/lang/tr/src/hyphenEngine.ts index 2f603c23..6043b680 100644 --- a/lang/tr/src/hyphenEngine.ts +++ b/lang/tr/src/hyphenEngine.ts @@ -5,6 +5,8 @@ export const hwo: i32 = hw; export const lmi: i32 = lm; export const rmi: i32 = rm; +let alphabetCount: i32 = 0; + /** * Maps BMP-charCode (16bit) to 8bit adresses * @@ -46,7 +48,6 @@ function createTranslateMap(): i32 { let first: i32 = 0; let second: i32 = 0; let secondInt: i32 = 0; - let alphabetCount: i32 = 0; i = to + 2; while (i < po) { first = load(i); @@ -69,13 +70,27 @@ function createTranslateMap(): i32 { pushToTranslateMap(first, secondInt); } // Add to alphabet - store(alphabetCount, first, 768); + store(alphabetCount, first, 1024); alphabetCount += 2; i += 4; } return alphabetCount >> 1; } +export function subst(ccl: i32, ccu: i32, replcc: i32): i32 { + const replccInt: i32 = pullFromTranslateMap(replcc); + if (replccInt !== 255) { + pushToTranslateMap(ccl, replccInt); + if (ccu !== 0) { + pushToTranslateMap(ccu, replccInt); + } + // Add to alphabet + store(alphabetCount, ccl, 1024); + alphabetCount += 2; + } + return alphabetCount >> 1; +} + export function conv(): i32 { let i: i32 = po; const patternEnd: i32 = po + pl; diff --git a/lang/tr/tr.wasm b/lang/tr/tr.wasm index 8137756a..35a20767 100644 Binary files a/lang/tr/tr.wasm and b/lang/tr/tr.wasm differ diff --git a/lang/uk/src/g.ts b/lang/uk/src/g.ts index 01c105e0..4ed77c07 100644 --- a/lang/uk/src/g.ts +++ b/lang/uk/src/g.ts @@ -1,11 +1,11 @@ -export const to: i32 = 1121760; -export const po: i32 = 1121910; +export const to: i32 = 1122016; +export const po: i32 = 1122166; export const pl: i32 = 18226; -export const vs: i32 = 1280; -export const pt: i32 = 19828; -export const wo: i32 = 1120824; -export const tw: i32 = 1120952; -export const hp: i32 = 1121016; -export const hw: i32 = 1121080; +export const vs: i32 = 1536; +export const pt: i32 = 20084; +export const wo: i32 = 1121080; +export const tw: i32 = 1121208; +export const hp: i32 = 1121272; +export const hw: i32 = 1121336; export const lm: i32 = 2; export const rm: i32 = 2; diff --git a/lang/uk/src/hyphenEngine.ts b/lang/uk/src/hyphenEngine.ts index 2f603c23..6043b680 100644 --- a/lang/uk/src/hyphenEngine.ts +++ b/lang/uk/src/hyphenEngine.ts @@ -5,6 +5,8 @@ export const hwo: i32 = hw; export const lmi: i32 = lm; export const rmi: i32 = rm; +let alphabetCount: i32 = 0; + /** * Maps BMP-charCode (16bit) to 8bit adresses * @@ -46,7 +48,6 @@ function createTranslateMap(): i32 { let first: i32 = 0; let second: i32 = 0; let secondInt: i32 = 0; - let alphabetCount: i32 = 0; i = to + 2; while (i < po) { first = load(i); @@ -69,13 +70,27 @@ function createTranslateMap(): i32 { pushToTranslateMap(first, secondInt); } // Add to alphabet - store(alphabetCount, first, 768); + store(alphabetCount, first, 1024); alphabetCount += 2; i += 4; } return alphabetCount >> 1; } +export function subst(ccl: i32, ccu: i32, replcc: i32): i32 { + const replccInt: i32 = pullFromTranslateMap(replcc); + if (replccInt !== 255) { + pushToTranslateMap(ccl, replccInt); + if (ccu !== 0) { + pushToTranslateMap(ccu, replccInt); + } + // Add to alphabet + store(alphabetCount, ccl, 1024); + alphabetCount += 2; + } + return alphabetCount >> 1; +} + export function conv(): i32 { let i: i32 = po; const patternEnd: i32 = po + pl; diff --git a/lang/uk/uk.wasm b/lang/uk/uk.wasm index 2288a956..e1a30171 100644 Binary files a/lang/uk/uk.wasm and b/lang/uk/uk.wasm differ diff --git a/lang/zh-latn-pinyin/src/g.ts b/lang/zh-latn-pinyin/src/g.ts index 8a74917a..121b1ea2 100644 --- a/lang/zh-latn-pinyin/src/g.ts +++ b/lang/zh-latn-pinyin/src/g.ts @@ -1,11 +1,11 @@ -export const to: i32 = 18264; -export const po: i32 = 18470; +export const to: i32 = 18520; +export const po: i32 = 18726; export const pl: i32 = 813; -export const vs: i32 = 1280; -export const pt: i32 = 3284; -export const wo: i32 = 17288; -export const tw: i32 = 17416; -export const hp: i32 = 17480; -export const hw: i32 = 17544; +export const vs: i32 = 1536; +export const pt: i32 = 3540; +export const wo: i32 = 17544; +export const tw: i32 = 17672; +export const hp: i32 = 17736; +export const hw: i32 = 17800; export const lm: i32 = 1; export const rm: i32 = 2; diff --git a/lang/zh-latn-pinyin/src/hyphenEngine.ts b/lang/zh-latn-pinyin/src/hyphenEngine.ts index 2f603c23..6043b680 100644 --- a/lang/zh-latn-pinyin/src/hyphenEngine.ts +++ b/lang/zh-latn-pinyin/src/hyphenEngine.ts @@ -5,6 +5,8 @@ export const hwo: i32 = hw; export const lmi: i32 = lm; export const rmi: i32 = rm; +let alphabetCount: i32 = 0; + /** * Maps BMP-charCode (16bit) to 8bit adresses * @@ -46,7 +48,6 @@ function createTranslateMap(): i32 { let first: i32 = 0; let second: i32 = 0; let secondInt: i32 = 0; - let alphabetCount: i32 = 0; i = to + 2; while (i < po) { first = load(i); @@ -69,13 +70,27 @@ function createTranslateMap(): i32 { pushToTranslateMap(first, secondInt); } // Add to alphabet - store(alphabetCount, first, 768); + store(alphabetCount, first, 1024); alphabetCount += 2; i += 4; } return alphabetCount >> 1; } +export function subst(ccl: i32, ccu: i32, replcc: i32): i32 { + const replccInt: i32 = pullFromTranslateMap(replcc); + if (replccInt !== 255) { + pushToTranslateMap(ccl, replccInt); + if (ccu !== 0) { + pushToTranslateMap(ccu, replccInt); + } + // Add to alphabet + store(alphabetCount, ccl, 1024); + alphabetCount += 2; + } + return alphabetCount >> 1; +} + export function conv(): i32 { let i: i32 = po; const patternEnd: i32 = po + pl; diff --git a/lang/zh-latn-pinyin/zh-latn-pinyin.wasm b/lang/zh-latn-pinyin/zh-latn-pinyin.wasm index e6c4d6e9..50b96dba 100644 Binary files a/lang/zh-latn-pinyin/zh-latn-pinyin.wasm and b/lang/zh-latn-pinyin/zh-latn-pinyin.wasm differ diff --git a/package-lock.json b/package-lock.json index d19327b2..c5ef55f2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -592,6 +592,12 @@ "integrity": "sha512-mKKUkUbhPpQlCOfIuZkvSEgktjPFIsZKRRbC6KWVEMvlzblj3i3asQv5ODsrwt0N3pHAEvjP8KTQPHkp0+6jOg==", "dev": true }, + "characterset": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/characterset/-/characterset-1.3.0.tgz", + "integrity": "sha1-lkDUfShfPsdCpaYUTrRF4HNJTho=", + "dev": true + }, "chardet": { "version": "0.7.0", "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.7.0.tgz", diff --git a/package.json b/package.json index e047179f..dde6c085 100644 --- a/package.json +++ b/package.json @@ -46,6 +46,7 @@ "@typescript-eslint/parser": "^2.26.0", "all-contributors-cli": "^6.14.0", "assemblyscript": "^0.9.4", + "characterset": "^1.3.0", "eslint": "^6.8.0", "eslint-plugin-security": "^1.4.0", "remark-cli": "^8.0.0", @@ -62,7 +63,7 @@ "preinstall3rdparty": "rm -fR third-party", "install3rdparty": "git clone https://github.com/WebAssembly/binaryen.git third-party/binaryen", "postinstall3rdparty": "cd ./third-party/binaryen/ && cmake . && make", - "createWasmForLang": "sh ./tools/createWasmForLang.sh mk", + "createWasmForLang": "sh ./tools/createWasmForLang.sh en-us", "createAllWasm": "sh ./tools/createAllWasm.sh", "test": "tap test/*.js --no-esm", "testsuite": "open http://127.0.0.1/~mnater/Hyphenopoly/testsuite/ && open http://127.0.0.1/~mnater/Hyphenopoly/min/testsuite/", diff --git a/patterns/af.wasm b/patterns/af.wasm index d508baef..657f779f 100644 Binary files a/patterns/af.wasm and b/patterns/af.wasm differ diff --git a/patterns/as.wasm b/patterns/as.wasm index 3b9e0d97..d39e057b 100644 Binary files a/patterns/as.wasm and b/patterns/as.wasm differ diff --git a/patterns/be.wasm b/patterns/be.wasm index a8cc47fc..fd20e5eb 100644 Binary files a/patterns/be.wasm and b/patterns/be.wasm differ diff --git a/patterns/bg.wasm b/patterns/bg.wasm index 2c974bd5..3b29561c 100644 Binary files a/patterns/bg.wasm and b/patterns/bg.wasm differ diff --git a/patterns/bn.wasm b/patterns/bn.wasm index 51c83690..0c075e02 100644 Binary files a/patterns/bn.wasm and b/patterns/bn.wasm differ diff --git a/patterns/ca.wasm b/patterns/ca.wasm index 9c6f9975..6eeebb87 100644 Binary files a/patterns/ca.wasm and b/patterns/ca.wasm differ diff --git a/patterns/cop.wasm b/patterns/cop.wasm index 2c4d09f4..23f4705d 100644 Binary files a/patterns/cop.wasm and b/patterns/cop.wasm differ diff --git a/patterns/cs.wasm b/patterns/cs.wasm index 6c87fba5..807fbfb1 100644 Binary files a/patterns/cs.wasm and b/patterns/cs.wasm differ diff --git a/patterns/cy.wasm b/patterns/cy.wasm index fb616840..bfdfe7cd 100644 Binary files a/patterns/cy.wasm and b/patterns/cy.wasm differ diff --git a/patterns/da.wasm b/patterns/da.wasm index a17e3e46..2b775b4c 100644 Binary files a/patterns/da.wasm and b/patterns/da.wasm differ diff --git a/patterns/de.wasm b/patterns/de.wasm index 4fd73893..bc20fb4f 100644 Binary files a/patterns/de.wasm and b/patterns/de.wasm differ diff --git a/patterns/el-monoton.wasm b/patterns/el-monoton.wasm index c78dfdda..a635273e 100644 Binary files a/patterns/el-monoton.wasm and b/patterns/el-monoton.wasm differ diff --git a/patterns/el-polyton.wasm b/patterns/el-polyton.wasm index 8ae19b01..b55c3cbf 100644 Binary files a/patterns/el-polyton.wasm and b/patterns/el-polyton.wasm differ diff --git a/patterns/en-gb.wasm b/patterns/en-gb.wasm index 1e9a09ba..c780ed8b 100644 Binary files a/patterns/en-gb.wasm and b/patterns/en-gb.wasm differ diff --git a/patterns/en-us.wasm b/patterns/en-us.wasm index 2f8bd671..2030fed4 100644 Binary files a/patterns/en-us.wasm and b/patterns/en-us.wasm differ diff --git a/patterns/eo.wasm b/patterns/eo.wasm index 9964b57f..11f2fc66 100644 Binary files a/patterns/eo.wasm and b/patterns/eo.wasm differ diff --git a/patterns/es.wasm b/patterns/es.wasm index 0656a7fc..63e56159 100644 Binary files a/patterns/es.wasm and b/patterns/es.wasm differ diff --git a/patterns/et.wasm b/patterns/et.wasm index cf939df4..2a042169 100644 Binary files a/patterns/et.wasm and b/patterns/et.wasm differ diff --git a/patterns/eu.wasm b/patterns/eu.wasm index 2f67fde2..7f5456f5 100644 Binary files a/patterns/eu.wasm and b/patterns/eu.wasm differ diff --git a/patterns/fi.wasm b/patterns/fi.wasm index a01ef966..0380f07d 100644 Binary files a/patterns/fi.wasm and b/patterns/fi.wasm differ diff --git a/patterns/fr.wasm b/patterns/fr.wasm index ac16c456..a7cf0525 100644 Binary files a/patterns/fr.wasm and b/patterns/fr.wasm differ diff --git a/patterns/fur.wasm b/patterns/fur.wasm index af5bf3a4..2f62705a 100644 Binary files a/patterns/fur.wasm and b/patterns/fur.wasm differ diff --git a/patterns/ga.wasm b/patterns/ga.wasm index f3219383..10e9ee5d 100644 Binary files a/patterns/ga.wasm and b/patterns/ga.wasm differ diff --git a/patterns/gl.wasm b/patterns/gl.wasm index 174da1da..aed9669d 100644 Binary files a/patterns/gl.wasm and b/patterns/gl.wasm differ diff --git a/patterns/grc.wasm b/patterns/grc.wasm index 75577042..0bf02af5 100644 Binary files a/patterns/grc.wasm and b/patterns/grc.wasm differ diff --git a/patterns/gu.wasm b/patterns/gu.wasm index 9a31b0c2..482ce086 100644 Binary files a/patterns/gu.wasm and b/patterns/gu.wasm differ diff --git a/patterns/hi.wasm b/patterns/hi.wasm index 6f7c2f7b..d694dcc4 100644 Binary files a/patterns/hi.wasm and b/patterns/hi.wasm differ diff --git a/patterns/hr.wasm b/patterns/hr.wasm index 04dbca2a..2603273a 100644 Binary files a/patterns/hr.wasm and b/patterns/hr.wasm differ diff --git a/patterns/hsb.wasm b/patterns/hsb.wasm index 788ec95a..4e1a786f 100644 Binary files a/patterns/hsb.wasm and b/patterns/hsb.wasm differ diff --git a/patterns/hu.wasm b/patterns/hu.wasm index 2af4f109..f8283465 100644 Binary files a/patterns/hu.wasm and b/patterns/hu.wasm differ diff --git a/patterns/hy.wasm b/patterns/hy.wasm index 569c2b11..b17166e0 100644 Binary files a/patterns/hy.wasm and b/patterns/hy.wasm differ diff --git a/patterns/ia.wasm b/patterns/ia.wasm index 83943453..039a5aab 100644 Binary files a/patterns/ia.wasm and b/patterns/ia.wasm differ diff --git a/patterns/id.wasm b/patterns/id.wasm index 7876a07d..12cabcce 100644 Binary files a/patterns/id.wasm and b/patterns/id.wasm differ diff --git a/patterns/is.wasm b/patterns/is.wasm index 4a79055a..b0f7acce 100644 Binary files a/patterns/is.wasm and b/patterns/is.wasm differ diff --git a/patterns/it.wasm b/patterns/it.wasm index b8101255..2956e42e 100644 Binary files a/patterns/it.wasm and b/patterns/it.wasm differ diff --git a/patterns/ka.wasm b/patterns/ka.wasm index 335aaf05..2dcf7868 100644 Binary files a/patterns/ka.wasm and b/patterns/ka.wasm differ diff --git a/patterns/kmr.wasm b/patterns/kmr.wasm index eb5398ad..6bfb3a3e 100644 Binary files a/patterns/kmr.wasm and b/patterns/kmr.wasm differ diff --git a/patterns/kn.wasm b/patterns/kn.wasm index 8d68b02c..7ee07be2 100644 Binary files a/patterns/kn.wasm and b/patterns/kn.wasm differ diff --git a/patterns/la.wasm b/patterns/la.wasm index 693bd060..117fd8c5 100644 Binary files a/patterns/la.wasm and b/patterns/la.wasm differ diff --git a/patterns/lt.wasm b/patterns/lt.wasm index 5477f99d..4c1d617c 100644 Binary files a/patterns/lt.wasm and b/patterns/lt.wasm differ diff --git a/patterns/lv.wasm b/patterns/lv.wasm index 843d62de..d3b1239b 100644 Binary files a/patterns/lv.wasm and b/patterns/lv.wasm differ diff --git a/patterns/mk.wasm b/patterns/mk.wasm index ddccd97a..19dc4074 100644 Binary files a/patterns/mk.wasm and b/patterns/mk.wasm differ diff --git a/patterns/ml.wasm b/patterns/ml.wasm index 17460c63..337eebcd 100644 Binary files a/patterns/ml.wasm and b/patterns/ml.wasm differ diff --git a/patterns/mn-cyrl.wasm b/patterns/mn-cyrl.wasm index 2879934a..f5a623f1 100644 Binary files a/patterns/mn-cyrl.wasm and b/patterns/mn-cyrl.wasm differ diff --git a/patterns/mr.wasm b/patterns/mr.wasm index 894d5565..50dc3952 100644 Binary files a/patterns/mr.wasm and b/patterns/mr.wasm differ diff --git a/patterns/mul-ethi.wasm b/patterns/mul-ethi.wasm index f0464049..888eb5af 100644 Binary files a/patterns/mul-ethi.wasm and b/patterns/mul-ethi.wasm differ diff --git a/patterns/nb-no.wasm b/patterns/nb-no.wasm index fb5f55bb..8fe97c77 100644 Binary files a/patterns/nb-no.wasm and b/patterns/nb-no.wasm differ diff --git a/patterns/nl.wasm b/patterns/nl.wasm index 6c2ed6c3..36d1c040 100644 Binary files a/patterns/nl.wasm and b/patterns/nl.wasm differ diff --git a/patterns/nn.wasm b/patterns/nn.wasm index cf5f3006..8bbc5cab 100644 Binary files a/patterns/nn.wasm and b/patterns/nn.wasm differ diff --git a/patterns/oc.wasm b/patterns/oc.wasm index 99cc3edb..447290f3 100644 Binary files a/patterns/oc.wasm and b/patterns/oc.wasm differ diff --git a/patterns/or.wasm b/patterns/or.wasm index 53801c03..e1ec437e 100644 Binary files a/patterns/or.wasm and b/patterns/or.wasm differ diff --git a/patterns/pa.wasm b/patterns/pa.wasm index a642516d..ec672f7b 100644 Binary files a/patterns/pa.wasm and b/patterns/pa.wasm differ diff --git a/patterns/pi.wasm b/patterns/pi.wasm index f7f50752..87b38b68 100644 Binary files a/patterns/pi.wasm and b/patterns/pi.wasm differ diff --git a/patterns/pl.wasm b/patterns/pl.wasm index 0ade1877..6208ef75 100644 Binary files a/patterns/pl.wasm and b/patterns/pl.wasm differ diff --git a/patterns/pms.wasm b/patterns/pms.wasm index c1582bf3..52af063a 100644 Binary files a/patterns/pms.wasm and b/patterns/pms.wasm differ diff --git a/patterns/pt.wasm b/patterns/pt.wasm index 9ec0fa2e..7f55fef1 100644 Binary files a/patterns/pt.wasm and b/patterns/pt.wasm differ diff --git a/patterns/rm.wasm b/patterns/rm.wasm index be5ad331..30d44a0b 100644 Binary files a/patterns/rm.wasm and b/patterns/rm.wasm differ diff --git a/patterns/ro.wasm b/patterns/ro.wasm index 5e1c2869..a67b83d7 100644 Binary files a/patterns/ro.wasm and b/patterns/ro.wasm differ diff --git a/patterns/ru.wasm b/patterns/ru.wasm index 5c36b108..321b3edb 100644 Binary files a/patterns/ru.wasm and b/patterns/ru.wasm differ diff --git a/patterns/sh-cyrl.wasm b/patterns/sh-cyrl.wasm index e9e0548e..92fb3e71 100644 Binary files a/patterns/sh-cyrl.wasm and b/patterns/sh-cyrl.wasm differ diff --git a/patterns/sh-latn.wasm b/patterns/sh-latn.wasm index 5cf806ab..e14d1732 100644 Binary files a/patterns/sh-latn.wasm and b/patterns/sh-latn.wasm differ diff --git a/patterns/sk.wasm b/patterns/sk.wasm index e849e683..0116a4e5 100644 Binary files a/patterns/sk.wasm and b/patterns/sk.wasm differ diff --git a/patterns/sl.wasm b/patterns/sl.wasm index 7594c756..7d934107 100644 Binary files a/patterns/sl.wasm and b/patterns/sl.wasm differ diff --git a/patterns/sr-cyrl.wasm b/patterns/sr-cyrl.wasm index 3d045133..e2c3dd93 100644 Binary files a/patterns/sr-cyrl.wasm and b/patterns/sr-cyrl.wasm differ diff --git a/patterns/sv.wasm b/patterns/sv.wasm index 1cd61905..e2ca121f 100644 Binary files a/patterns/sv.wasm and b/patterns/sv.wasm differ diff --git a/patterns/ta.wasm b/patterns/ta.wasm index 2e16a014..faa75937 100644 Binary files a/patterns/ta.wasm and b/patterns/ta.wasm differ diff --git a/patterns/te.wasm b/patterns/te.wasm index 16c2981c..d127aa6b 100644 Binary files a/patterns/te.wasm and b/patterns/te.wasm differ diff --git a/patterns/th.wasm b/patterns/th.wasm index 51fb6332..22f73bf0 100644 Binary files a/patterns/th.wasm and b/patterns/th.wasm differ diff --git a/patterns/tk.wasm b/patterns/tk.wasm index a26ca2a0..5832830d 100644 Binary files a/patterns/tk.wasm and b/patterns/tk.wasm differ diff --git a/patterns/tr.wasm b/patterns/tr.wasm index 8137756a..35a20767 100644 Binary files a/patterns/tr.wasm and b/patterns/tr.wasm differ diff --git a/patterns/uk.wasm b/patterns/uk.wasm index 2288a956..e1a30171 100644 Binary files a/patterns/uk.wasm and b/patterns/uk.wasm differ diff --git a/patterns/zh-latn-pinyin.wasm b/patterns/zh-latn-pinyin.wasm index e6c4d6e9..50b96dba 100644 Binary files a/patterns/zh-latn-pinyin.wasm and b/patterns/zh-latn-pinyin.wasm differ diff --git a/src/hyphenEngine.ts b/src/hyphenEngine.ts index 2f603c23..6043b680 100644 --- a/src/hyphenEngine.ts +++ b/src/hyphenEngine.ts @@ -5,6 +5,8 @@ export const hwo: i32 = hw; export const lmi: i32 = lm; export const rmi: i32 = rm; +let alphabetCount: i32 = 0; + /** * Maps BMP-charCode (16bit) to 8bit adresses * @@ -46,7 +48,6 @@ function createTranslateMap(): i32 { let first: i32 = 0; let second: i32 = 0; let secondInt: i32 = 0; - let alphabetCount: i32 = 0; i = to + 2; while (i < po) { first = load(i); @@ -69,13 +70,27 @@ function createTranslateMap(): i32 { pushToTranslateMap(first, secondInt); } // Add to alphabet - store(alphabetCount, first, 768); + store(alphabetCount, first, 1024); alphabetCount += 2; i += 4; } return alphabetCount >> 1; } +export function subst(ccl: i32, ccu: i32, replcc: i32): i32 { + const replccInt: i32 = pullFromTranslateMap(replcc); + if (replccInt !== 255) { + pushToTranslateMap(ccl, replccInt); + if (ccu !== 0) { + pushToTranslateMap(ccu, replccInt); + } + // Add to alphabet + store(alphabetCount, ccl, 1024); + alphabetCount += 2; + } + return alphabetCount >> 1; +} + export function conv(): i32 { let i: i32 = po; const patternEnd: i32 = po + pl; diff --git a/test/basic.js b/test/basic.js index 044cf09c..cce04a5c 100644 --- a/test/basic.js +++ b/test/basic.js @@ -33,10 +33,57 @@ t.test("run config with one language", async function (t) { t.end(); }); +t.test("substitue characters", async function (t) { + const deHyphenator = await H9Y.config({ + "require": ["de"], + "substitute": { + "de": { + "å": "a" + } + } + }); + t.test("hyphenate ångström", function (t) { + t.equal(deHyphenator("ångström"), "ångst\u00ADröm", deHyphenator("ångström")); + t.end(); + }); + t.end(); +}); + +t.test("substitue characters unicase", async function (t) { + const deHyphenator = await H9Y.config({ + "require": ["en-us"], + "substitute": { + "en-us": { + "0": "o", + "1": "l", + "3": "e", + "4": "a", + "5": "s", + "7": "t", + "8": "b" + } + } + }); + t.test("hyphenate 1337speak", function (t) { + t.equal(deHyphenator("48501u73"), "48\u00AD501u73", deHyphenator("48501u73")); + t.end(); + }); + t.end(); +}); + t.test("try to hyphenate a word outside alphabet", async function (t) { + const deHyphenator = await H9Y.config({"require": ["de"]}); + t.test("hyphenate ångström", function (t) { + t.equal(deHyphenator("ångström"), "ångström", deHyphenator("ångström")); + t.end(); + }); + t.end(); +}); + +t.test("force .wasm.hyphenate to return 0", async function (t) { const deHyphenator = await H9Y.config({"require": ["de"]}); // eslint-disable-next-line prefer-regex-literals - H9Y.languages.get("de").genRegExp = new RegExp("[abcdefghijklmnopqrstuvwxyzåäöüßſ‌-]{6,}", "gi"); + H9Y.languages.get("de").reNotAlphabet = RegExp("[^abcdefghijklmnopqrstuvwxyzåäöüßſ‌-]", "gi"); t.test("hyphenate ångström", function (t) { t.equal(deHyphenator("ångström"), "ångström", deHyphenator("ångström")); t.end(); diff --git a/testsuite/test23.html b/testsuite/test23.html index f0b88d67..8f75084c 100644 --- a/testsuite/test23.html +++ b/testsuite/test23.html @@ -86,7 +86,7 @@

Test 023


fur

Il furlan e je une lenghe romanze de famee des lenghis retichis, che e je fevelade soredut intal Friûl, ma ancje vie pal mont. Cualchi volte al ven clamât Ladin orientâl, parcè che al à diviers ponts in comun cul ladin, ma si è svilupât in un altri mût cul passâ dal timp, sot de influence des lenghis ator dal Friûl

-

Il fur|lan e je une len|ghe ro|man|ze de fa|mee des len|ghis re|ti|chis, che e je fe|ve|la|de so|re|dut in|tal Friûl, ma an|cje vie pal mont. Cual|chi vol|te al ven clamât La|din orientâl, parcè che al à di|viers ponts in co|mun cul la|din, ma si è svi|lupât in un al|tri mût cul pa|ssâ dal timp, sot de in|fluen|ce des len|ghis ator dal Friûl

+

Il fur|lan e je une len|ghe ro|man|ze de fa|mee des len|ghis re|ti|chis, che e je fe|ve|la|de so|re|dut in|tal Friûl, ma an|cje vie pal mont. Cual|chi vol|te al ven cla|mât La|din orien|tâl, parcè che al à di|viers ponts in co|mun cul la|din, ma si è svi|lu|pât in un al|tri mût cul pa|ssâ dal timp, sot de in|fluen|ce des len|ghis ator dal Friûl


Test Ref
diff --git a/testsuite/test27.html b/testsuite/test27.html index 6b7348e3..b93368b8 100644 --- a/testsuite/test27.html +++ b/testsuite/test27.html @@ -104,7 +104,7 @@

Test 027


fur

-

Il fur|lan e je une len|ghe ro|man|ze de fa|mee des len|ghis re|ti|chis, che e je fe|ve|la|de so|re|dut in|tal Friûl, ma an|cje vie pal mont. Cual|chi vol|te al ven clamât La|din orientâl, parcè che al à di|viers ponts in co|mun cul la|din, ma si è svi|lupât in un al|tri mût cul pa|ssâ dal timp, sot de in|fluen|ce des len|ghis ator dal Friûl

+

Il fur|lan e je une len|ghe ro|man|ze de fa|mee des len|ghis re|ti|chis, che e je fe|ve|la|de so|re|dut in|tal Friûl, ma an|cje vie pal mont. Cual|chi vol|te al ven cla|mât La|din orien|tâl, parcè che al à di|viers ponts in co|mun cul la|din, ma si è svi|lu|pât in un al|tri mût cul pa|ssâ dal timp, sot de in|fluen|ce des len|ghis ator dal Friûl


Test Ref
diff --git a/testsuite/test36.html b/testsuite/test36.html index f8c6119e..46e0dc56 100644 --- a/testsuite/test36.html +++ b/testsuite/test36.html @@ -121,7 +121,7 @@

Test 036


fur

-

Il fur|lan e je une len|ghe ro|man|ze de fa|mee des len|ghis re|ti|chis, che e je fe|ve|la|de so|re|dut in|tal Friûl, ma an|cje vie pal mont. Cual|chi vol|te al ven clamât La|din orientâl, parcè che al à di|viers ponts in co|mun cul la|din, ma si è svi|lupât in un al|tri mût cul pa|ssâ dal timp, sot de in|fluen|ce des len|ghis ator dal Friûl

+

Il fur|lan e je une len|ghe ro|man|ze de fa|mee des len|ghis re|ti|chis, che e je fe|ve|la|de so|re|dut in|tal Friûl, ma an|cje vie pal mont. Cual|chi vol|te al ven cla|mât La|din orien|tâl, parcè che al à di|viers ponts in co|mun cul la|din, ma si è svi|lu|pât in un al|tri mût cul pa|ssâ dal timp, sot de in|fluen|ce des len|ghis ator dal Friûl


Test Ref
diff --git a/testsuite/test37.html b/testsuite/test37.html index 5e219b85..1caa05af 100644 --- a/testsuite/test37.html +++ b/testsuite/test37.html @@ -110,7 +110,7 @@

Test 037


fur

-

Il fur|lan e je une len|ghe ro|man|ze de fa|mee des len|ghis re|ti|chis, che e je fe|ve|la|de so|re|dut in|tal Friûl, ma an|cje vie pal mont. Cual|chi vol|te al ven clamât La|din orientâl, parcè che al à di|viers ponts in co|mun cul la|din, ma si è svi|lupât in un al|tri mût cul pa|ssâ dal timp, sot de in|fluen|ce des len|ghis ator dal Friûl

+

Il fur|lan e je une len|ghe ro|man|ze de fa|mee des len|ghis re|ti|chis, che e je fe|ve|la|de so|re|dut in|tal Friûl, ma an|cje vie pal mont. Cual|chi vol|te al ven cla|mât La|din orien|tâl, parcè che al à di|viers ponts in co|mun cul la|din, ma si è svi|lu|pât in un al|tri mût cul pa|ssâ dal timp, sot de in|fluen|ce des len|ghis ator dal Friûl


Test Ref
diff --git a/testsuite/test44.html b/testsuite/test44.html new file mode 100644 index 00000000..e805024e --- /dev/null +++ b/testsuite/test44.html @@ -0,0 +1,104 @@ + + + + + Test 044 + + + + + + + +

Test 044

+

Check hyphenation of words that contain characters that are not in the alphabet.

+
+
+

1: Foreign suffix

+

communiqué

+

communiqué

+ +

2: Foreign affix

+

ångstromian

+

ångstromian

+ +

3: Foreign infix

+

Reëlection

+

Reëlection

+ +
+
Test Ref
+ + + \ No newline at end of file diff --git a/testsuite/test45.html b/testsuite/test45.html new file mode 100644 index 00000000..6930de32 --- /dev/null +++ b/testsuite/test45.html @@ -0,0 +1,115 @@ + + + + + Test 045 + + + + + + + +

Test 045

+

Test character substitution

+
+
+

1: en-us (é, å, ë)

+

communiqué communique ångstromian angstromian Reëlection Reelection

+

com•mu•niqué com•mu•nique ångstro•mian angstro•mian Re•ëlec•tion Re•elec•tion

+ +

2: de (é)

+

communiqué communique

+

com•mu•ni•qué com•mu•ni•que

+ +

3: de (É)

+

Élégance

+

Élé•gan•ce

+ +
+
Test Ref
+ + + \ No newline at end of file diff --git a/testsuite/testdriver.js b/testsuite/testdriver.js index 814db61b..9ac40f74 100644 --- a/testsuite/testdriver.js +++ b/testsuite/testdriver.js @@ -47,7 +47,9 @@ {"exec": true, "path": "test40.html"}, {"exec": true, "path": "test41.html"}, {"exec": true, "path": "test42.html"}, - {"exec": true, "path": "test43.html"} + {"exec": true, "path": "test43.html"}, + {"exec": true, "path": "test44.html"}, + {"exec": true, "path": "test45.html"} ]; var testframe = document.getElementById("testframe"); var currentTest = 1; diff --git a/tools/calculateBaseData.js b/tools/calculateBaseData.js index 7db85ce7..411bd60d 100644 --- a/tools/calculateBaseData.js +++ b/tools/calculateBaseData.js @@ -37,10 +37,13 @@ function nodeBuffer2typedArray(buf) { * | + | * | values: | * |256 chars * 1Byte | - * -------------------- <- 768 Bytes + * | + | + * | substi: | + * |256 chars * 1Byte | + * -------------------- <- 1024 Bytes * | alphabet | * |256 chars * 2Bytes| - * -------------------- <- valueStoreOffset (vs) = 1280 + * -------------------- <- valueStoreOffset (vs) = 1536 * | valueStore | * | 1 Byte | * |* valueStoreLength| @@ -88,7 +91,7 @@ function calculateBaseData(hpbBuf) { hpbBuf = nodeBuffer2typedArray(hpbBuf); const hpbMetaData = new Uint32Array(hpbBuf).subarray(0, 8); const valueStoreLength = hpbMetaData[7]; - const valueStoreOffset = 1280; + const valueStoreOffset = 1536; const patternTrieOffset = valueStoreOffset + valueStoreLength + (4 - ((valueStoreOffset + valueStoreLength) % 4)); const wordOffset = patternTrieOffset + (hpbMetaData[6] * 4); diff --git a/tools/collectLetters.js b/tools/collectLetters.js new file mode 100644 index 00000000..5f55dccf --- /dev/null +++ b/tools/collectLetters.js @@ -0,0 +1,54 @@ +/* eslint-disable security/detect-non-literal-fs-filename */ +/* eslint-disable no-console, no-sync */ +/* eslint-env node */ + +"use strict"; +const fs = require("fs"); +const Characterset = require("characterset"); + + +const dir = process.argv[2]; + +const charSet = new Set(); + +const transpiledLetter = "u+0041-005A,u+0061-007A,u+00AA,u+00B5,u+00BA,u+00C0-00D6,u+00D8-00F6,u+00F8-02C1,u+02C6-02D1,u+02E0-02E4,u+02EC,u+02EE,u+0370-0374,u+0376,u+0377,u+037A-037D,u+037F,u+0386,u+0388-038A,u+038C,u+038E-03A1,u+03A3-03F5,u+03F7-0481,u+048A-052F,u+0531-0556,u+0559,u+0560-0588,u+05D0-05EA,u+05EF-05F2,u+0620-064A,u+066E,u+066F,u+0671-06D3,u+06D5,u+06E5,u+06E6,u+06EE,u+06EF,u+06FA-06FC,u+06FF,u+0710,u+0712-072F,u+074D-07A5,u+07B1,u+07CA-07EA,u+07F4,u+07F5,u+07FA,u+0800-0815,u+081A,u+0824,u+0828,u+0840-0858,u+0860-086A,u+08A0-08B4,u+08B6-08C7,u+0904-0939,u+093D,u+0950,u+0958-0961,u+0971-0980,u+0985-098C,u+098F,u+0990,u+0993-09A8,u+09AA-09B0,u+09B2,u+09B6-09B9,u+09BD,u+09CE,u+09DC,u+09DD,u+09DF-09E1,u+09F0,u+09F1,u+09FC,u+0A05-0A0A,u+0A0F,u+0A10,u+0A13-0A28,u+0A2A-0A30,u+0A32,u+0A33,u+0A35,u+0A36,u+0A38,u+0A39,u+0A59-0A5C,u+0A5E,u+0A72-0A74,u+0A85-0A8D,u+0A8F-0A91,u+0A93-0AA8,u+0AAA-0AB0,u+0AB2,u+0AB3,u+0AB5-0AB9,u+0ABD,u+0AD0,u+0AE0,u+0AE1,u+0AF9,u+0B05-0B0C,u+0B0F,u+0B10,u+0B13-0B28,u+0B2A-0B30,u+0B32,u+0B33,u+0B35-0B39,u+0B3D,u+0B5C,u+0B5D,u+0B5F-0B61,u+0B71,u+0B83,u+0B85-0B8A,u+0B8E-0B90,u+0B92-0B95,u+0B99,u+0B9A,u+0B9C,u+0B9E,u+0B9F,u+0BA3,u+0BA4,u+0BA8-0BAA,u+0BAE-0BB9,u+0BD0,u+0C05-0C0C,u+0C0E-0C10,u+0C12-0C28,u+0C2A-0C39,u+0C3D,u+0C58-0C5A,u+0C60,u+0C61,u+0C80,u+0C85-0C8C,u+0C8E-0C90,u+0C92-0CA8,u+0CAA-0CB3,u+0CB5-0CB9,u+0CBD,u+0CDE,u+0CE0,u+0CE1,u+0CF1,u+0CF2,u+0D04-0D0C,u+0D0E-0D10,u+0D12-0D3A,u+0D3D,u+0D4E,u+0D54-0D56,u+0D5F-0D61,u+0D7A-0D7F,u+0D85-0D96,u+0D9A-0DB1,u+0DB3-0DBB,u+0DBD,u+0DC0-0DC6,u+0E01-0E30,u+0E32,u+0E33,u+0E40-0E46,u+0E81,u+0E82,u+0E84,u+0E86-0E8A,u+0E8C-0EA3,u+0EA5,u+0EA7-0EB0,u+0EB2,u+0EB3,u+0EBD,u+0EC0-0EC4,u+0EC6,u+0EDC-0EDF,u+0F00,u+0F40-0F47,u+0F49-0F6C,u+0F88-0F8C,u+1000-102A,u+103F,u+1050-1055,u+105A-105D,u+1061,u+1065,u+1066,u+106E-1070,u+1075-1081,u+108E,u+10A0-10C5,u+10C7,u+10CD,u+10D0-10FA,u+10FC-1248,u+124A-124D,u+1250-1256,u+1258,u+125A-125D,u+1260-1288,u+128A-128D,u+1290-12B0,u+12B2-12B5,u+12B8-12BE,u+12C0,u+12C2-12C5,u+12C8-12D6,u+12D8-1310,u+1312-1315,u+1318-135A,u+1380-138F,u+13A0-13F5,u+13F8-13FD,u+1401-166C,u+166F-167F,u+1681-169A,u+16A0-16EA,u+16F1-16F8,u+1700-170C,u+170E-1711,u+1720-1731,u+1740-1751,u+1760-176C,u+176E-1770,u+1780-17B3,u+17D7,u+17DC,u+1820-1878,u+1880-1884,u+1887-18A8,u+18AA,u+18B0-18F5,u+1900-191E,u+1950-196D,u+1970-1974,u+1980-19AB,u+19B0-19C9,u+1A00-1A16,u+1A20-1A54,u+1AA7,u+1B05-1B33,u+1B45-1B4B,u+1B83-1BA0,u+1BAE,u+1BAF,u+1BBA-1BE5,u+1C00-1C23,u+1C4D-1C4F,u+1C5A-1C7D,u+1C80-1C88,u+1C90-1CBA,u+1CBD-1CBF,u+1CE9-1CEC,u+1CEE-1CF3,u+1CF5,u+1CF6,u+1CFA,u+1D00-1DBF,u+1E00-1F15,u+1F18-1F1D,u+1F20-1F45,u+1F48-1F4D,u+1F50-1F57,u+1F59,u+1F5B,u+1F5D,u+1F5F-1F7D,u+1F80-1FB4,u+1FB6-1FBC,u+1FBE,u+1FC2-1FC4,u+1FC6-1FCC,u+1FD0-1FD3,u+1FD6-1FDB,u+1FE0-1FEC,u+1FF2-1FF4,u+1FF6-1FFC,u+2071,u+207F,u+2090-209C,u+2102,u+2107,u+210A-2113,u+2115,u+2119-211D,u+2124,u+2126,u+2128,u+212A-212D,u+212F-2139,u+213C-213F,u+2145-2149,u+214E,u+2183,u+2184,u+2C00-2C2E,u+2C30-2C5E,u+2C60-2CE4,u+2CEB-2CEE,u+2CF2,u+2CF3,u+2D00-2D25,u+2D27,u+2D2D,u+2D30-2D67,u+2D6F,u+2D80-2D96,u+2DA0-2DA6,u+2DA8-2DAE,u+2DB0-2DB6,u+2DB8-2DBE,u+2DC0-2DC6,u+2DC8-2DCE,u+2DD0-2DD6,u+2DD8-2DDE,u+2E2F,u+3005,u+3006,u+3031-3035,u+303B,u+303C,u+3041-3096,u+309D-309F,u+30A1-30FA,u+30FC-30FF,u+3105-312F,u+3131-318E,u+31A0-31BF,u+31F0-31FF,u+3400-4DBF,u+4E00-9FFC,u+A000-A48C,u+A4D0-A4FD,u+A500-A60C,u+A610-A61F,u+A62A,u+A62B,u+A640-A66E,u+A67F-A69D,u+A6A0-A6E5,u+A717-A71F,u+A722-A788,u+A78B-A7BF,u+A7C2-A7CA,u+A7F5-A801,u+A803-A805,u+A807-A80A,u+A80C-A822,u+A840-A873,u+A882-A8B3,u+A8F2-A8F7,u+A8FB,u+A8FD,u+A8FE,u+A90A-A925,u+A930-A946,u+A960-A97C,u+A984-A9B2,u+A9CF,u+A9E0-A9E4,u+A9E6-A9EF,u+A9FA-A9FE,u+AA00-AA28,u+AA40-AA42,u+AA44-AA4B,u+AA60-AA76,u+AA7A,u+AA7E-AAAF,u+AAB1,u+AAB5,u+AAB6,u+AAB9-AABD,u+AAC0,u+AAC2,u+AADB-AADD,u+AAE0-AAEA,u+AAF2-AAF4,u+AB01-AB06,u+AB09-AB0E,u+AB11-AB16,u+AB20-AB26,u+AB28-AB2E,u+AB30-AB5A,u+AB5C-AB69,u+AB70-ABE2,u+AC00-D7A3,u+D7B0-D7C6,u+D7CB-D7FB,u+F900-FA6D,u+FA70-FAD9,u+FB00-FB06,u+FB13-FB17,u+FB1D,u+FB1F-FB28,u+FB2A-FB36,u+FB38-FB3C,u+FB3E,u+FB40,u+FB41,u+FB43,u+FB44,u+FB46-FBB1,u+FBD3-FD3D,u+FD50-FD8F,u+FD92-FDC7,u+FDF0-FDFB,u+FE70-FE74,u+FE76-FEFC,u+FF21-FF3A,u+FF41-FF5A,u+FF66-FFBE,u+FFC2-FFC7,u+FFCA-FFCF,u+FFD2-FFD7,u+FFDA-FFDC"; + +const ct = Characterset.parseUnicodeRange(transpiledLetter); + +/** + * Read .chr.txt File + */ +function getChrFile(filename) { + let chrfile = fs.readFileSync(filename, "utf8"); + chrfile = chrfile.trim(); + return chrfile; +} + +/** + * Collect chars to charSet + */ +function extractChars(chars) { + const charsA = chars.split(""); + charsA.forEach((char) => { + if (char !== ",\n") { + charSet.add(char.toLowerCase()); + } + }); +} + +fs.readdir(dir, (err, files) => { + if (err) { + return console.log("Unable to scan directory: " + err); + } + files.forEach((filename) => { + if (filename.indexOf(".chr.txt") !== -1) { + extractChars(getChrFile(dir + filename)); + } + }); + const cr = new Characterset(Array.from(charSet).join("")); + const cn = cr.intersect(ct); + cn.toArray().forEach((cc) => { + console.log(String.fromCharCode(cc)); + }); + return console.log(cn.toRegExp()); +}); diff --git a/tools/createAllWasm.sh b/tools/createAllWasm.sh index be48b95f..23dc4c70 100644 --- a/tools/createAllWasm.sh +++ b/tools/createAllWasm.sh @@ -13,6 +13,7 @@ prefix='hyph-' mkdir -p ./patterns/ for filename in ${path_in}*.chr.txt; do { + #filename='en-us.chr.txt' echo $filename base=$(basename "$filename" .chr.txt) lang=${base#$prefix}