85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
|
// INDEXABLE BINARY DIRECT ACYCLIC WORD GRAPH
constructor (param1, sPath="") {
// param1 can be a filename or a object with all the necessary data.
try {
let oData = null;
if (typeof(param1) == "string") {
let sDicName = param1;
let sURL = (sPath !== "") ? sPath + "/" + sDicName : "resource://grammalecte/graphspell/_dictionaries/"+sDicName;
oData = JSON.parse(helpers.loadFile(sURL));
} else {
oData = param1;
}
Object.assign(this, oData);
}
catch (e) {
|
<
|
|
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
|
// INDEXABLE BINARY DIRECT ACYCLIC WORD GRAPH
constructor (param1, sPath="") {
// param1 can be a filename or a object with all the necessary data.
try {
let oData = null;
if (typeof(param1) == "string") {
let sURL = (sPath !== "") ? sPath + "/" + param1 : "resource://grammalecte/graphspell/_dictionaries/"+param1;
oData = JSON.parse(helpers.loadFile(sURL));
} else {
oData = param1;
}
Object.assign(this, oData);
}
catch (e) {
|