Grammalecte  Diff

Differences From Artifact [07bba03053]:

To Artifact [fb94b7fe43]:


1


2


3
4



5
6
7
8
9
10
11
1
2
3

4
5
6

7
8
9
10
11
12
13
14
15
16

+
+
-
+
+

-
+
+
+







// Grammalecte - Suggestion phonétique

/* jshint esversion:6 */
/*jslint esversion: 6*/
/* jslint esversion:6 */
/* global __dirname */

if (typeof(require) !== 'undefined') {
if(typeof process !== 'undefined') {
    var helpers = require("../graphspell/helpers.js");
} else if (typeof require  !== 'undefined') {
    var helpers = require("resource://grammalecte/graphspell/helpers.js");
}


var phonet = {
    _dWord: new Map(),
    _lSet: [],
80
81
82
83
84
85
86
87




88
89
90


91
92

93
94

95
96

97
98
99
100

101
102
103
104
105
106
107
108
85
86
87
88
89
90
91

92
93
94
95
96


97
98
99

100
101

102
103

104
105
106
107

108
109
110
111
112
113
114
115
116







-
+
+
+
+

-
-
+
+

-
+

-
+

-
+



-
+








        }
        return aSelect;
    }
};


// Initialization
if (!phonet.bInit && typeof(browser) !== 'undefined') {
if (!phonet.bInit && typeof process !== 'undefined') {
    //Nodejs
    phonet.init(helpers.loadFile(__dirname+'/phonet_data.json'));
} else if (!phonet.bInit && typeof browser !== 'undefined') {
    // WebExtension
    phonet.init(helpers.loadFile(browser.extension.getURL("grammalecte/fr/phonet_data.json")));
} else if (!phonet.bInit && typeof(require) !== 'undefined') {
    phonet.init(helpers.loadFile(browser.extension.getURL('grammalecte/fr/phonet_data.json')));
} else if (!phonet.bInit && typeof require !== 'undefined') {
    // Add-on SDK and Thunderbird
    phonet.init(helpers.loadFile("resource://grammalecte/fr/phonet_data.json"));
    phonet.init(helpers.loadFile('resource://grammalecte/fr/phonet_data.json'));
} else if (phonet.bInit){
    console.log("Module phonet déjà initialisé");
    console.log('Module phonet déjà initialisé');
} else {
    //console.log("Module phonet non initialisé");
    //console.log('Module phonet non initialisé');
}


if (typeof(exports) !== 'undefined') {
if (typeof exports !== 'undefined') {
    exports._dWord = phonet._dWord;
    exports._lSet = phonet._lSet;
    exports._dMorph = phonet._dMorph;
    exports.init = phonet.init;
    exports.hasSimil = phonet.hasSimil;
    exports.getSimil = phonet.getSimil;
    exports.selectSimil = phonet.selectSimil;
}