Grammalecte  Diff

Differences From Artifact [eb5a5d5e73]:

To Artifact [5fadd970c2]:


341
342
343
344
345
346
347






348
349
350
351
352
353
354
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360







+
+
+
+
+
+







            return aSugg.map( (sSugg) => { return sPfx + sSugg + sSfx; } );
        }
        //console.timeEnd("Suggestions for " + sWord);
        return aSugg;
    }

    _splitSuggest (oSuggResult, sWord) {
        // split trailing numbers
        let m = /^([a-zA-Zà-öÀ-Ö_ø-ÿØ-ßĀ-ʯfi-st][a-zA-Zà-öÀ-Ö_ø-ÿØ-ßĀ-ʯfi-st-]+)([0-9]+)$/.exec(sWord);
        if (m) {
            oSuggResult.addSugg(m[1] + " " + char_player.numbersToExponent(m[2]));
        }
        // split at apostrophes
        for (let cSplitter of "'’") {
            if (sWord.includes(cSplitter)) {
                let [sWord1, sWord2] = sWord.split(cSplitter, 2);
                if (this.isValid(sWord1) && this.isValid(sWord2)) {
                    oSuggResult.addSugg(sWord1+" "+sWord2);
                }
            }
362
363
364
365
366
367
368
369

370
371
372
373
374
375
376
368
369
370
371
372
373
374

375
376
377
378
379
380
381
382







-
+







            if (sRemain == "") {
                oSuggResult.addSugg(sNewWord);
                for (let sTail of this._getTails(iAddr)) {
                    oSuggResult.addSugg(sNewWord+sTail);
                }
                return;
            }
            else if (this.isValid(sRemain) && oSuggResult.sWord.toLowerCase().startsWith(sNewWord.toLowerCase())) {
            else if ( (sNewWord.length + sRemain.length == oSuggResult.sWord.length) && oSuggResult.sWord.toLowerCase().startsWith(sNewWord.toLowerCase()) && this.isValid(sRemain) ) {
                oSuggResult.addSugg(sNewWord+" "+sRemain);
            }
        }
        if (nDist > oSuggResult.nDistLimit) {
            return;
        }