Grammalecte  Diff

Differences From Artifact [8b933913ea]:

To Artifact [d63c8f768b]:


227
228
229
230
231
232
233
234

235
236
237
238
239
240
241
227
228
229
230
231
232
233

234
235
236
237
238
239
240
241







-
+







        this.oDict = oDict;
        this.oTokenizer = oTokenizer;
        this.oLocGraph = JSON.parse(oLocGraph);

        this._zElidedPrefix = new RegExp("^([dljmtsncç]|quoiqu|lorsqu|jusqu|puisqu|qu)['’](.+)", "i");
        this._zCompoundWord = new RegExp("([a-zA-Zà-ö0-9À-Öø-ÿØ-ßĀ-ʯ]+)-((?:les?|la)-(?:moi|toi|lui|[nv]ous|leur)|t-(?:il|elle|on)|y|en|[mts][’'](?:y|en)|les?|l[aà]|[mt]oi|leur|lui|je|tu|ils?|elles?|on|[nv]ous)$", "i");
        this._zTag = new RegExp("[:;/][a-zA-Zà-ö0-9À-Öø-ÿØ-ßĀ-ʯ*Ṽ][^:;/]*", "g");

        this._zLocTag = new RegExp("(:L[A-Z])([a-z].?)?(.*)");
    }

    getInfoForToken (oToken) {
        // Token: .sType, .sValue, .nStart, .nEnd
        // return a object {sType, sValue, aLabel}
        let m = null;
        try {
341
342
343
344
345
346
347
348
349


350
351
352
353
354


355
356
357
358
359
360
361
341
342
343
344
345
346
347


348
349
350
351
352


353
354
355
356
357
358
359
360
361







-
-
+
+



-
-
+
+







            return sRes;
        }
        return sRes.gl_trimRight(",");
    }

    _formatTagsLoc (sTags) {
        let sRes = "";
        let sTagsVerb = sTags.replace(/(:LV)([a-z].?)(.*)/, '$2');
        sTags = sTags.replace(/(:LV)([a-z].?)(.*)/, "V$1");
        let oTagsVerb = this._zLocTag.exec(sTags);
        sTags = oTagsVerb[1]+oTagsVerb[3];
        let m;
        while ((m = this._zTag.exec(sTags)) !== null) {
            sRes += _dLocTAGS.get(m[0]);
            if (m[0] == ':LV'){
                sTagsVerb.split(/(?!$)/u).forEach(function(sKey) {
            if (m[0] == ':LV' && oTagsVerb[2]){
                oTagsVerb[2].split(/(?!$)/u).forEach(function(sKey) {
                    sRes += _dLocVERB.get(sKey);
                });
            }
            if (sRes.length > 100) {
                break;
            }
        }