Index: gc_lang/fr/webext/gce_worker.js ================================================================== --- gc_lang/fr/webext/gce_worker.js +++ gc_lang/fr/webext/gce_worker.js @@ -183,11 +183,11 @@ if (!(dOptions instanceof Map)) { dOptions = helpers.objectToMap(dOptions); } gc_engine.setOptions(dOptions); } - //tests(); + tests(); bInitDone = true; } else { console.log("[Worker] Already initialized…") } // we always retrieve options from the gc_engine, for setOptions filters obsolete options @@ -290,17 +290,26 @@ let dOptions = helpers.mapToObject(gc_engine.getOptions()); postMessage(createResponse("resetOptions", dOptions, oInfo, true)); } function tests () { - console.log(conj.getConj("devenir", ":E", ":2s")); + /*console.log(conj.getConj("devenir", ":E", ":2s")); console.log(mfsp.getMasForm("emmerdeuse", true)); console.log(mfsp.getMasForm("pointilleuse", false)); console.log(phonet.getSimil("est")); let aRes = gc_engine.parse("Je suit..."); for (let oErr of aRes) { console.log(text.getReadableError(oErr)); + }*/ + for (let sWord of ["fatiqué", "coeur", "trèèèèèèèèès", "vraaaaiiiimeeeeennnt", "apele", "email", "Co2", "emmppâiiiller", "testt", "apelaion", "exsepttion", "sintaxik", "ebriete", "ennormmement"]) { + console.time("Suggestions for " + sWord); + for (let aSugg of oSpellChecker.suggest(sWord)) { + if (aSugg.length) { + console.log(sWord + " -> ", aSugg.join(" ")); + } + } + console.timeEnd("Suggestions for " + sWord); } } function textToTest (sText, sCountry, bDebug, bContext, oInfo={}) { if (!gc_engine) {