Overview
Comment: | [fr] lexicographe: code cleaning |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | fr | Lexicographe |
Files: | files | file ages | folders |
SHA3-256: |
afcd96f2ab0f393f78d9f2c93c8f48d0 |
User & Date: | olr on 2017-11-01 11:38:31 |
Other Links: | branch diff | manifest | tags |
Context
2017-11-01
| ||
13:17 | [fr] lexicographe: nouveaux labels pour locutions verbales check-in: 8db44cfb54 user: olr tags: fr, Lexicographe | |
12:01 | Ajout script de génération de locutions.txt Closed-Leaf check-in: e6c5e7908d user: IllusionPerdu tags: Lexicographe_dead | |
11:38 | [fr] lexicographe: code cleaning check-in: afcd96f2ab user: olr tags: fr, Lexicographe | |
10:35 | [fr] lexicographe: useless code (WTF?) check-in: 4cfb006e3a user: olr tags: fr, Lexicographe | |
Changes
Modified gc_lang/fr/modules-js/lexicographe.js from [5be8f7e98e] to [254ccfd456].
︙ | ︙ | |||
127 128 129 130 131 132 133 | [':s', " singulière"], [':p', " plurielle"], [':i', " invariable"], ['/L', " {latin}"] ]); const _dLocVERB = new Map([ | | | | | | | 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 | [':s', " singulière"], [':p', " plurielle"], [':i', " invariable"], ['/L', " {latin}"] ]); const _dLocVERB = new Map([ ['i', ", intransitif"], ['n', ", transitif indirect"], ['t', ", transitif direct"], ['p', ", pronominal"], ['m', ", impersonnel"], ]); const _dPFX = new Map([ ['d', "(de), déterminant épicène invariable"], ['l', "(le/la), déterminant masculin/féminin singulier"], ['j', "(je), pronom personnel sujet, 1ʳᵉ pers., épicène singulier"], ['m', "(me), pronom personnel objet, 1ʳᵉ pers., épicène singulier"], |
︙ | ︙ | |||
226 227 228 229 230 231 232 | class Lexicographe { constructor (oDict, oTokenizer, oLocGraph) { this.oDict = oDict; this.oTokenizer = oTokenizer; this.oLocGraph = JSON.parse(oLocGraph); | < | < | 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 | class Lexicographe { constructor (oDict, oTokenizer, oLocGraph) { this.oDict = oDict; this.oTokenizer = oTokenizer; this.oLocGraph = JSON.parse(oLocGraph); 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-Z0-9ÑÂĴĈŔÔṼŴ!][^:;/]*", "g"); } getInfoForToken (oToken) { // Token: .sType, .sValue, .nStart, .nEnd // return a object {sType, sValue, aLabel} let m = null; try { |
︙ | ︙ | |||
331 332 333 334 335 336 337 | while ((m = this._zTag.exec(sTags)) !== null) { sRes += _dTAGS.get(m[0]); } if (sRes.startsWith(" verbe") && !sRes.includes("infinitif")) { sRes += " [" + sTags.slice(1, sTags.indexOf(" ")) + "]"; } if (!sRes) { | | < > | > | < < > | < | < | < | < | 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 | while ((m = this._zTag.exec(sTags)) !== null) { sRes += _dTAGS.get(m[0]); } if (sRes.startsWith(" verbe") && !sRes.includes("infinitif")) { sRes += " [" + sTags.slice(1, sTags.indexOf(" ")) + "]"; } if (!sRes) { return "#Erreur. Étiquette inconnue : [" + sTags + "]"; } return sRes.gl_trimRight(","); } _formatTagsLoc (sTags) { let sRes = ""; let m; while ((m = this._zTag.exec(sTags)) !== null) { if (m[0].startsWith(":LV")) { sRes += _dLocTAGS.get(":LV"); for (let c of m[0].slice(3)) { sRes += _dLocVERB.get(c); } } else { sRes += _dLocTAGS.get(m[0]); } } if (!sRes) { return "#Erreur. Étiquette inconnue : [" + sTags + "]"; } return sRes.gl_trimRight(","); } _formatSuffix (s) { if (s.startsWith("t-")) { return "“t” euphonique +" + _dAD.get(s.slice(2)); |
︙ | ︙ |