Grammalecte  Check-in [1a7c706a66]

Overview
Comment:Optimisation mineur
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | fr | Lexicographe
Files: files | file ages | folders
SHA3-256: 1a7c706a66d5369d56062c12adb9ec72e565498e2aa4ef504698ebd740336a6c
User & Date: IllusionPerdu on 2017-10-31 21:05:12
Other Links: branch diff | manifest | tags
Context
2017-11-01
08:16
[build][fr] build_data: readFile as a generator check-in: 1a082eec4e user: olr tags: fr, build, Lexicographe
2017-10-31
21:05
Optimisation mineur check-in: 1a7c706a66 user: IllusionPerdu tags: fr, Lexicographe
20:42
Changement mineur check-in: eda5a34bc9 user: IllusionPerdu tags: fr, Lexicographe
Changes

Modified gc_lang/fr/modules-js/lexicographe.js from [8b933913ea] to [d63c8f768b].

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");

    }

    getInfoForToken (oToken) {
        // Token: .sType, .sValue, .nStart, .nEnd
        // return a object {sType, sValue, aLabel}
        let m = null;
        try {







|







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
            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 m;
        while ((m = this._zTag.exec(sTags)) !== null) {
            sRes += _dLocTAGS.get(m[0]);
            if (m[0] == ':LV'){
                sTagsVerb.split(/(?!$)/u).forEach(function(sKey) {
                    sRes += _dLocVERB.get(sKey);
                });
            }
            if (sRes.length > 100) {
                break;
            }
        }







|
|



|
|







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 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' && oTagsVerb[2]){
                oTagsVerb[2].split(/(?!$)/u).forEach(function(sKey) {
                    sRes += _dLocVERB.get(sKey);
                });
            }
            if (sRes.length > 100) {
                break;
            }
        }