| 
16
17
18
19
20
21
22
23
24
25
26
27
28
2930
31
3233
34
3536
37
38
39
40
4142
4344
45
46
4748
49
5051
52
53
54
55
5657
5859
60
61
6263
6465
66
67
6869
7071
72
73
74
75
76
77
78 | 
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
 | 
-
-
+
+
-
+
+
+
-
-
+
+
-
-
-
+
+
+
-
-
+
-
+
+
+
-
-
+
+
+
+
+
+
-
+
+
+
-
+
-
+
-
+
-
+
-
+
-
+
 | 
}
${map}
const dDefaultDictionaries = new Map([
    ["fr", "fr.["fr", "fr.json"],
    ["en", "en.json"]
]);
class Spellchecker {bdic"],
    ["en", "en.bdic"]    constructor (sLangCode, constructor (sLangCode, mainDic=null, extentedDic=null, personalDic=null, sPath="") {
        // returns true if the main dictionary is loaded
        this.sLangCode = sLangCode;
        console.log(sLangCode);
        console.log(mainDic);sfMainDic="",sfExtendedDic="",sfPersonalDic="") {        if (if (mainDic === null) {
            mainDic = dDefaultDictionaries.gl_get(sLangCode, "");
        }sfMainDic ==="") {sfMainDic = dDefaultDictionaries.gl_get(sLangCode, "");        this.oMainDic = this._loadDictionary(this.oMainDic = this._loadDictionary(mainDic, sPath, true);
        this.oExtendedDic = this._loadDictionary(extentedDic, sPath);
        this.oPersonalDic = this._loadDictionary(personalDic, sPath);sfMainDic);
        this.oExtendedDic = this._loadDictionary(sfExtendedDic);
        this.oPersonalDic = this._loadDictionary(sfPersonalDic);}        return bool(this.oMainDic);    _loadDictionary (_loadDictionary (dictionary, sPath, bNecessary=false) {
        // returns an IBDAWG objectsfDictionary) {        if (if (dictionary === null) {
            return null;
        }
        try {
        	if (typeof(require) !== 'undefined') {
        		console.log(">>>> <resource:>");sfDictionary ==="") {            return ibdawg.IBDAWG(return new ibdawg.IBDAWG(dictionary);  // dictionary can be a filename or a JSON object
            } else {
            	console.log(">>>> no <resource:>");
                return new IBDAWG(dictionary, sPath);  // dictionary can be a filename or a JSON object
            }
        }
        catch (e) {sfDictionary);
        }if (bNecessary) {
        		throw e.message;
        	}
            console.log(e.message);
            return null;
        }
    }            console.log("Error: <" + sDicName + "> not loaded.");    setMainDictionary (setMainDictionary (dictionary) {
        // returns true if the dictionary is loadedsfDictionary) {        this.oMainDic = this._loadDictionary(this.oMainDic = this._loadDictionary(dictionary);
        return bool(this.oMainDic);
    }sfDictionary);    setExtendedDictionary (setExtendedDictionary (dictionary) {
        // returns true if the dictionary is loadedsfDictionary) {        this.oExtendedDic = this._loadDictionary(this.oExtendedDic = this._loadDictionary(dictionary);
        return bool(this.oExtendedDic);
    }sfDictionary);    setPersonalDictionary (setPersonalDictionary (dictionary) {
        // returns true if the dictionary is loadedsfDictionary) {        this.oPersonalDic = this._loadDictionary(this.oPersonalDic = this._loadDictionary(dictionary);
        return bool(this.oPersonalDic);
    }
    // IBDAWG functions
    isValidToken (sToken) {
        // checks if sToken is valid (if there is hyphens in sToken, sToken is split, each part is checked)sfDictionary); | 
| 
146
147
148
149
150
151
152
 | 
155
156
157
158
159
160
161
162
163
164
165
 | 
+
+
+
+
 | 
            yield* this.oExtendedDic.select(sPattern);
        }
        if (this.oPersonalDic) {
            yield* this.oPersonalDic.select(sPattern);
        }
    }
}
if (typeof(exports) !== 'undefined') {
    exports.Spellchecker = Spellchecker;
}
 |