Grammalecte  Check-in [78b42e9b7f]

Overview
Comment:[graphspell][js] ibdawg: constructor with data object
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk | graphspell
Files: files | file ages | folders
SHA3-256: 78b42e9b7f782b0fdf94f78bde89c6ee97fe4a89562f49715f278c473890f2ed
User & Date: olr on 2018-02-07 14:49:14
Other Links: manifest | tags
Context
2018-02-07
15:19
[graphspell][py] ibdawg: select(), don’t compile pattern if empty check-in: 418b212030 user: olr tags: trunk, graphspell
14:49
[graphspell][js] ibdawg: constructor with data object check-in: 78b42e9b7f user: olr tags: trunk, graphspell
13:58
[fx] update: lexicon editor check-in: 84a72ba4e1 user: olr tags: trunk, fx
Changes

Modified graphspell-js/ibdawg.js from [5f5404403f] to [46212759e7].

80
81
82
83
84
85
86
87

88



89
90



91
92
93
94
95
96
97
98
    }
}


class IBDAWG {
    // INDEXABLE BINARY DIRECT ACYCLIC WORD GRAPH

    constructor (sDicName, sPath="") {

        try {



            let sURL = (sPath !== "") ? sPath + "/" + sDicName : "resource://grammalecte/graphspell/_dictionaries/"+sDicName;
            const dict = JSON.parse(helpers.loadFile(sURL));



            Object.assign(this, dict);
        }
        catch (e) {
            throw Error("# Error. File not found or not loadable.\n" + e.message + "\n");
        }
        /*
            Properties:
            sName, nVersion, sHeader, lArcVal, nArcVal, byDic, sLang, nChar, nBytesArc, nBytesNodeAddress,







|
>

>
>
>
|
|
>
>
>
|







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
    }
}


class IBDAWG {
    // 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) {
            throw Error("# Error. File not found or not loadable.\n" + e.message + "\n");
        }
        /*
            Properties:
            sName, nVersion, sHeader, lArcVal, nArcVal, byDic, sLang, nChar, nBytesArc, nBytesNodeAddress,