| 1 | /* lemmatiseur.cpp |
| 2 | * |
| 3 | * This file is part of COLLATINUS. |
| 4 | * |
| 5 | * COLLATINUS is free software; you can redistribute it and/or modify |
| 6 | * it under the terms of the GNU General Public License as published by |
| 7 | * the Free Software Foundation; either version 2 of the License, or |
| 8 | * (at your option) any later version. |
| 9 | * |
| 10 | * COLLATINVS is distributed in the hope that it will be useful, |
| 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 | * GNU General Public License for more details. |
| 14 | * |
| 15 | * You should have received a copy of the GNU General Public License |
| 16 | * along with COLLATINUS; if not, write to the Free Software |
| 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| 18 | * |
| 19 | * © Yves Ouvrard, 2009 - 2016 |
| 20 | */ |
| 21 | |
| 22 | /** |
| 23 | * \file lemmatiseur.cpp |
| 24 | * \brief module de lemmatisation des formes latines |
| 25 | */ |
| 26 | |
| 27 | #include <QDir> |
| 28 | #include <QFile> |
| 29 | #include <QRegExp> |
| 30 | #include <QTextStream> |
| 31 | #include <iostream> |
| 32 | |
| 33 | #include "ch.h"cxx . . $ `<file>/src/ch.h`/ |
| 34 | #include "lemmatiseur.h"cxx . . $ `<file>/src/lemmatiseur.h`/ |
| 35 | |
| 36 | #include <QDebug> |
| 37 | // #include <QElapsedTimer> |
| 38 | // #define DEBOG |
| 39 | |
| 40 | /** |
| 41 | * \fn Lemmat::Lemmat (QObject *parent) |
| 42 | * \brief Constructeur de la classe Lemmat. |
| 43 | * |
| 44 | * Il définit quelques constantes, initialise |
| 45 | * les options à false, et appelle les fonctions |
| 46 | * de lecture des données : modèles, lexique, |
| 47 | * traductions et irréguliers. |
| 48 | */ |
| 49 | Lemmatcxx . . $ Lemmat#::Lemmatcxx . . $ Lemmat#Lemmat(54cacb9d94b458b).(QObjectcxx . . $ QObject# *parent, QStringcxx . . $ QString# resDir) : QObjectcxx . . $ QObject#QObject(749de1b6ae65bddd).(parent) |
| 50 | { |
| 51 | if (resDir.isEmptycxx . . $ QString#isEmpty(50ce9a9e25b4a850).()) |
| 52 | _resDircxx . . $ Lemmat#_resDir. =cxx . . $ QString#`operator=`(b79fde0b0ce9b948). qAppcxx . . $ `<external>/3955209949423095026/qcoreapplication.h:70:9`!->applicationDirPathcxx . . $ QCoreApplication#applicationDirPath(4365c3963150523e).() +cxx . . $ operator+(3d22f08efddf8107). "/data/"; |
| 53 | else if (resDir.endsWithcxx . . $ QString#endsWith(8cce4688c16f48f3).("/"cxx . . $ QString#QString(85c52e162fed56f9).)) _resDircxx . . $ Lemmat#_resDir. =cxx . . $ QString#`operator=`(b79fde0b0ce9b948). resDir; |
| 54 | else _resDircxx . . $ Lemmat#_resDir..appendcxx . . $ QString#append(d02845eef0c33901).("/"); |
| 55 | // options |
| 56 | _alphacxx . . $ Lemmat#_alpha. = false; |
| 57 | _formeTcxx . . $ Lemmat#_formeT. = false; |
| 58 | _htmlcxx . . $ Lemmat#_html. = false; |
| 59 | _majPertcxx . . $ Lemmat#_majPert. = false; |
| 60 | _morphocxx . . $ Lemmat#_morpho. = false; |
| 61 | _extensioncxx . . $ Lemmat#_extension. = false; |
| 62 | _extLoadedcxx . . $ Lemmat#_extLoaded. = false; |
| 63 | // suffixes |
| 64 | suffixescxx . . $ Lemmat#suffixes..insertcxx . . $ QMap#insert(929a1ed410fe8423).("ne"cxx . . $ QString#QString(85c52e162fed56f9)., "nĕ"cxx . . $ QString#QString(85c52e162fed56f9).); |
| 65 | suffixescxx . . $ Lemmat#suffixes..insertcxx . . $ QMap#insert(929a1ed410fe8423).("que"cxx . . $ QString#QString(85c52e162fed56f9)., "quĕ"cxx . . $ QString#QString(85c52e162fed56f9).); |
| 66 | suffixescxx . . $ Lemmat#suffixes..insertcxx . . $ QMap#insert(929a1ed410fe8423).("ue"cxx . . $ QString#QString(85c52e162fed56f9)., "vĕ"cxx . . $ QString#QString(85c52e162fed56f9).); |
| 67 | suffixescxx . . $ Lemmat#suffixes..insertcxx . . $ QMap#insert(929a1ed410fe8423).("ve"cxx . . $ QString#QString(85c52e162fed56f9)., "vĕ"cxx . . $ QString#QString(85c52e162fed56f9).); |
| 68 | suffixescxx . . $ Lemmat#suffixes..insertcxx . . $ QMap#insert(929a1ed410fe8423).("st"cxx . . $ QString#QString(85c52e162fed56f9)., "st"cxx . . $ QString#QString(85c52e162fed56f9).); |
| 69 | // assimilations |
| 70 | ajAssimscxx . . $ Lemmat#ajAssims(49f6e7a06ebc5aa8).(); |
| 71 | // contractions |
| 72 | ajContractionscxx . . $ Lemmat#ajContractions(49f6e7a06ebc5aa8).(); |
| 73 | // POS |
| 74 | ajPoscxx . . $ Lemmat#ajPos(49f6e7a06ebc5aa8).(); |
| 75 | // lecture des morphos |
| 76 | _morphoscxx . . $ Lemmat#_morphos. =cxx . . $ QStringList#`operator=`(335bb966c1744308). lignesFichiercxx . . $ Lemmat#lignesFichier(327870d3b2cb3fa6).(_resDircxx . . $ Lemmat#_resDir. +cxx . . $ operator+(3d22f08efddf8107). "morphos.la"); |
| 77 | |
| 78 | lisModelescxx . . $ Lemmat#lisModeles(49f6e7a06ebc5aa8).(); |
| 79 | lisLexiquecxx . . $ Lemmat#lisLexique(49f6e7a06ebc5aa8).(); |
| 80 | lisTraductionscxx . . $ Lemmat#lisTraductions(b0b38cda41d4ede4).(true, false); |
| 81 | posCfcxx . . $ Lemmat#posCf(49f6e7a06ebc5aa8).(); |
| 82 | lisIrregulierscxx . . $ Lemmat#lisIrreguliers(49f6e7a06ebc5aa8).(); |
| 83 | lisLexicoSyntaxecxx . . $ Lemmat#lisLexicoSyntaxe(49f6e7a06ebc5aa8).(); |
| 84 | } |
| 85 | |
| 86 | /** |
| 87 | * \fn void Lemmat::ajAssims () |
| 88 | * \brief définit les débuts de mots |
| 89 | * non assimilés, et associe à chacun sa |
| 90 | * forme assimilée. |
| 91 | */ |
| 92 | void Lemmatcxx . . $ Lemmat#::ajAssimscxx . . $ Lemmat#ajAssims(49f6e7a06ebc5aa8).() |
| 93 | { |
| 94 | // peupler la QMap assims |
| 95 | QStringListcxx . . $ QStringList# lignes = lignesFichiercxx . . $ Lemmat#lignesFichier(327870d3b2cb3fa6).(_resDircxx . . $ Lemmat#_resDir. +cxx . . $ operator+(3d22f08efddf8107). "assimilations.la"); |
| 96 | foreachcxx . . $ `<external>/15045578679651060896/qglobal.h:1145:13`!(QString lin, lignes) |
| 97 | { |
| 98 | if (lin.isEmptycxx . . $ QString#isEmpty(50ce9a9e25b4a850).()) continue; |
| 99 | QStringListcxx . . $ QStringList# liste = lin.splitcxx . . $ QString#split(92030b8bf74e4227).(':'cxx . . $ QChar#QChar(f349c77f591a7878).); |
| 100 | assimsqcxx . . $ Lemmat#assimsq..insertcxx . . $ QMap#insert(929a1ed410fe8423).(liste.atcxx . . $ QList#at(e2681f9bb6b2f357).(0), liste.atcxx . . $ QList#at(e2681f9bb6b2f357).(1)); |
| 101 | assimscxx . . $ Lemmat#assims..insertcxx . . $ QMap#insert(929a1ed410fe8423).(Chcxx . . $ Ch/::atonecxx . . $ Ch/atone(afa4754008a97e3f).(listecxx . . $ QString#QString(132dd6869045752b)..atcxx . . $ QList#at(e2681f9bb6b2f357).(0)), Chcxx . . $ Ch/::atonecxx . . $ Ch/atone(afa4754008a97e3f).(listecxx . . $ QString#QString(132dd6869045752b)..atcxx . . $ QList#at(e2681f9bb6b2f357).(1))); |
| 102 | } |
| 103 | } |
| 104 | |
| 105 | /** |
| 106 | * \fn void Lemmat::ajContractions () |
| 107 | * \brief Établit une liste qui donne, pour chaque |
| 108 | * contraction, la forme non contracte qui lui |
| 109 | * correspond. |
| 110 | */ |
| 111 | void Lemmatcxx . . $ Lemmat#::ajContractionscxx . . $ Lemmat#ajContractions(49f6e7a06ebc5aa8).() |
| 112 | { |
| 113 | // peupler la QMap _contractions |
| 114 | QStringListcxx . . $ QStringList# lignes = lignesFichiercxx . . $ Lemmat#lignesFichier(327870d3b2cb3fa6).(_resDircxx . . $ Lemmat#_resDir. +cxx . . $ operator+(3d22f08efddf8107). "contractions.la"); |
| 115 | foreachcxx . . $ `<external>/15045578679651060896/qglobal.h:1145:13`!(QString lin, lignes) |
| 116 | { |
| 117 | QStringListcxx . . $ QStringList# liste = lin.splitcxx . . $ QString#split(92030b8bf74e4227).(':'cxx . . $ QChar#QChar(f349c77f591a7878).); |
| 118 | _contractionscxx . . $ Lemmat#_contractions..insertcxx . . $ QMap#insert(929a1ed410fe8423).(liste.atcxx . . $ QList#at(e2681f9bb6b2f357).(0), liste.atcxx . . $ QList#at(e2681f9bb6b2f357).(1)); |
| 119 | } |
| 120 | } |
| 121 | |
| 122 | /** |
| 123 | * \fn void Lemmat::ajDesinence (Desinence *d) |
| 124 | * \brief ajoute la désinence d dans la map des |
| 125 | * désinences. |
| 126 | */ |
| 127 | void Lemmatcxx . . $ Lemmat#::ajDesinencecxx . . $ Lemmat#ajDesinence(d733b4e682391b4).(Desinencecxx . . $ Desinence# *d) |
| 128 | { |
| 129 | _desinencescxx . . $ Lemmat#_desinences..insertcxx . . $ QMultiMap#insert(9bf047f9fc4d1418).(Chcxx . . $ Ch/::deramisecxx . . $ Ch/deramise(f7f320d754b8fd09).(d->grcxx . . $ Desinence#gr(4365c3963150523e).()), d); |
| 130 | } |
| 131 | |
| 132 | /** |
| 133 | * \fn void Lemmat::ajRadicaux (Lemme *l) |
| 134 | * \brief Calcule tous les radicaux du lemme l, |
| 135 | * en se servant des modèles, les ajoute à ce lemme, |
| 136 | * et ensuite à la map * des radicaux de la classe Lemmat. |
| 137 | * |
| 138 | */ |
| 139 | void Lemmatcxx . . $ Lemmat#::ajRadicauxcxx . . $ Lemmat#ajRadicaux(f0cbd0f60d582656).(Lemmecxx . . $ Lemme# *l) |
| 140 | { |
| 141 | // ablŭo=ā̆blŭo|lego|ā̆blŭ|ā̆blūt|is, ere, lui, lutum |
| 142 | // 0 1 2 3 4 |
| 143 | // ăvellāna=ăvēllāna,ăbēllāna|uita|||ae, f.|2 |
| 144 | Modelecxx . . $ Modele# *m = modelecxx . . $ Lemmat#modele(8a17f6f53c814648).(l->grModelecxx . . $ Lemme#grModele(4365c3963150523e).()); |
| 145 | // insérer d'abord les radicaux définis dans lemmes.la |
| 146 | foreachcxx . . $ `<external>/15045578679651060896/qglobal.h:1145:13`! (int i, l->clesR()) |
| 147 | { |
| 148 | QListcxx . . $ QList#<Radicalcxx . . $ Radical# *> lr = l->radicalcxx . . $ Lemme#radical(37bb355a9e08422e).(i); |
| 149 | foreachcxx . . $ `<external>/15045578679651060896/qglobal.h:1145:13`! (Radical *r, lr) |
| 150 | { |
| 151 | _radicauxcxx . . $ Lemmat#_radicaux..insertcxx . . $ QMultiMap#insert(9bf047f9fc4d1418).(Chcxx . . $ Ch/::deramisecxx . . $ Ch/deramise(f7f320d754b8fd09).(r->grcxx . . $ Radical#gr(4365c3963150523e).()), r); |
| 152 | } |
| 153 | } |
| 154 | // pour chaque radical du modèle |
| 155 | // test avec ăvellāna=ăvēllāna,ăbēllāna|uita|||ae, f.|2 |
| 156 | foreachcxx . . $ `<external>/15045578679651060896/qglobal.h:1145:13`! (int i, m->clesR()) |
| 157 | { |
| 158 | if (l->clesRcxx . . $ Lemme#clesR(9be6d6d0db5cf9a9).().containscxx . . $ QList#contains(8877ebe272b9620d).(i)) continue; |
| 159 | QStringListcxx . . $ QStringList# gs = l->grqcxx . . $ Lemme#grq(4365c3963150523e).().splitcxx . . $ QString#split(92030b8bf74e4227).(','cxx . . $ QChar#QChar(f349c77f591a7878).); |
| 160 | foreachcxx . . $ `<external>/15045578679651060896/qglobal.h:1145:13`! (QString g, gs) |
| 161 | { |
| 162 | Radicalcxx . . $ Radical# *r = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 163 | QStringcxx . . $ QString# gen = m->genRadicalcxx . . $ Modele#genRadical(ce915ed341d4a7f0).(i); |
| 164 | // si gen == 'K', le radical est la forme canonique |
| 165 | if (gen ==cxx . . $ QString#`operator==`(7d4bdb1abc417636). "K") |
| 166 | r = new Radicalcxx . . $ Radical#(gcxx . . $ QString#QString(132dd6869045752b)., i, l); |
| 167 | else |
| 168 | { |
| 169 | // sinon, appliquer la règle de formation du modèle |
| 170 | int oter = gen.sectioncxx . . $ QString#section(6e922cf609fb9683).(','cxx . . $ QChar#QChar(f349c77f591a7878)., 0, 0).toIntcxx . . $ QString#toInt(d7972accae11ee1f).(); |
| 171 | QStringcxx . . $ QString# ajouter = gen.sectioncxx . . $ QString#section(6e922cf609fb9683).(','cxx . . $ QChar#QChar(f349c77f591a7878)., 1, 1); |
| 172 | if (g.endsWithcxx . . $ QString#endsWith(7cf081d1b6a1defd).(0x0306cxx . . $ QChar#QChar(f349c77f591a7878).)) g.chopcxx . . $ QString#chop(d4f767463ce0a6b3).(1); |
| 173 | g.chopcxx . . $ QString#chop(d4f767463ce0a6b3).(oter); |
| 174 | if (ajouter !=cxx . . $ QString#`operator!=`(7d4bdb1abc417636). "0") g.appendcxx . . $ QString#append(6a89d0b7f4d2681c).(ajouter); |
| 175 | r = new Radicalcxx . . $ Radical#(gcxx . . $ QString#QString(132dd6869045752b)., i, l); |
| 176 | } |
| 177 | l->ajRadicalcxx . . $ Lemme#ajRadical(3c7d300b94decee2).(i, r); |
| 178 | _radicauxcxx . . $ Lemmat#_radicaux..insertcxx . . $ QMultiMap#insert(9bf047f9fc4d1418).(Chcxx . . $ Ch/::deramisecxx . . $ Ch/deramise(f7f320d754b8fd09).(r->grcxx . . $ Radical#gr(4365c3963150523e).()), r); |
| 179 | } |
| 180 | } |
| 181 | } |
| 182 | |
| 183 | void Lemmatcxx . . $ Lemmat#::ajPoscxx . . $ Lemmat#ajPos(49f6e7a06ebc5aa8).() |
| 184 | { |
| 185 | mapPoscxx . . $ Lemmat#mapPos..insertcxx . . $ QMap#insert(929a1ed410fe8423).("adj."cxx . . $ QString#QString(85c52e162fed56f9)., 'a'cxx . . $ QChar#QChar(f349c77f591a7878).); |
| 186 | mapPoscxx . . $ Lemmat#mapPos..insertcxx . . $ QMap#insert(929a1ed410fe8423).("adv."cxx . . $ QString#QString(85c52e162fed56f9)., 'd'cxx . . $ QChar#QChar(f349c77f591a7878).); |
| 187 | mapPoscxx . . $ Lemmat#mapPos..insertcxx . . $ QMap#insert(929a1ed410fe8423).("conj."cxx . . $ QString#QString(85c52e162fed56f9)., 'c'cxx . . $ QChar#QChar(f349c77f591a7878).); |
| 188 | mapPoscxx . . $ Lemmat#mapPos..insertcxx . . $ QMap#insert(929a1ed410fe8423).("excl."cxx . . $ QString#QString(85c52e162fed56f9)., 'e'cxx . . $ QChar#QChar(f349c77f591a7878).); |
| 189 | mapPoscxx . . $ Lemmat#mapPos..insertcxx . . $ QMap#insert(929a1ed410fe8423).("interj."cxx . . $ QString#QString(85c52e162fed56f9)., 'i'cxx . . $ QChar#QChar(f349c77f591a7878).); |
| 190 | mapPoscxx . . $ Lemmat#mapPos..insertcxx . . $ QMap#insert(929a1ed410fe8423).("num."cxx . . $ QString#QString(85c52e162fed56f9)., 'm'cxx . . $ QChar#QChar(f349c77f591a7878).); |
| 191 | mapPoscxx . . $ Lemmat#mapPos..insertcxx . . $ QMap#insert(929a1ed410fe8423).("pron."cxx . . $ QString#QString(85c52e162fed56f9)., 'p'cxx . . $ QChar#QChar(f349c77f591a7878).); |
| 192 | mapPoscxx . . $ Lemmat#mapPos..insertcxx . . $ QMap#insert(929a1ed410fe8423).("prép."cxx . . $ QString#QString(85c52e162fed56f9)., 'r'cxx . . $ QChar#QChar(f349c77f591a7878).); |
| 193 | mapPoscxx . . $ Lemmat#mapPos..insertcxx . . $ QMap#insert(929a1ed410fe8423).("subst."cxx . . $ QString#QString(85c52e162fed56f9)., 'n'cxx . . $ QChar#QChar(f349c77f591a7878).); |
| 194 | mapPoscxx . . $ Lemmat#mapPos..insertcxx . . $ QMap#insert(929a1ed410fe8423).(" v."cxx . . $ QString#QString(85c52e162fed56f9)., 'V'cxx . . $ QChar#QChar(f349c77f591a7878).); |
| 195 | mapPoscxx . . $ Lemmat#mapPos..insertcxx . . $ QMap#insert(929a1ed410fe8423).("vb."cxx . . $ QString#QString(85c52e162fed56f9)., 'V'cxx . . $ QChar#QChar(f349c77f591a7878).); |
| 196 | mapPoscxx . . $ Lemmat#mapPos..insertcxx . . $ QMap#insert(929a1ed410fe8423).("intr."cxx . . $ QString#QString(85c52e162fed56f9)., 'v'cxx . . $ QChar#QChar(f349c77f591a7878).); |
| 197 | } |
| 198 | |
| 199 | /** |
| 200 | * \fn QString Lemmat::assim (QString a) |
| 201 | * \brief Cherche si la chaîne a peut subir |
| 202 | * une assimilation, et renvoie |
| 203 | * cette chaîne éventuellement assimilée. |
| 204 | * *version avec quantités* |
| 205 | */ |
| 206 | QStringcxx . . $ QString# Lemmatcxx . . $ Lemmat#::assimcxx . . $ Lemmat#assim(f7f320d754b8fd09).(QStringcxx . . $ QString# a) |
| 207 | { |
| 208 | foreachcxx . . $ `<external>/15045578679651060896/qglobal.h:1145:13`! (QString d, assims.keys()) |
| 209 | if (a.startsWithcxx . . $ QString#startsWith(8cce4688c16f48f3).(d)) |
| 210 | { |
| 211 | a.replacecxx . . $ QString#replace(192e628656427d1c).(d, assimscxx . . $ Lemmat#assims..valuecxx . . $ QMap#value(866b0a4e5fb46e14).(d)); |
| 212 | return acxx . . $ QString#QString(28715ad661ad3cec).; |
| 213 | } |
| 214 | return acxx . . $ QString#QString(28715ad661ad3cec).; |
| 215 | } |
| 216 | |
| 217 | int Lemmatcxx . . $ Lemmat#::aRomanocxx . . $ Lemmat#aRomano(87a9b7c6fe1ccdba). (QStringcxx . . $ QString# r) |
| 218 | { |
| 219 | if (r.sizecxx . . $ QString#size(455f465bc33b4cdf). () == 0) return 0; |
| 220 | // création de la table de conversion : pourrait être créée ailleurs. |
| 221 | QMapcxx . . $ QMap#<QCharcxx . . $ QChar#,int> conversioncxx . . $ QMap#QMap(ced63f7c635d850d).; |
| 222 | conversion[cxx . . $ QMap#`operator[]`(bbd415b616967878).'I'cxx . . $ QChar#QChar(f349c77f591a7878).]=1; |
| 223 | conversion[cxx . . $ QMap#`operator[]`(bbd415b616967878).'V'cxx . . $ QChar#QChar(f349c77f591a7878).]=5; |
| 224 | conversion[cxx . . $ QMap#`operator[]`(bbd415b616967878).'X'cxx . . $ QChar#QChar(f349c77f591a7878).]=10; |
| 225 | conversion[cxx . . $ QMap#`operator[]`(bbd415b616967878).'L'cxx . . $ QChar#QChar(f349c77f591a7878).]=50; |
| 226 | conversion[cxx . . $ QMap#`operator[]`(bbd415b616967878).'C'cxx . . $ QChar#QChar(f349c77f591a7878).]=100; |
| 227 | conversion[cxx . . $ QMap#`operator[]`(bbd415b616967878).'D'cxx . . $ QChar#QChar(f349c77f591a7878).]=500; |
| 228 | conversion[cxx . . $ QMap#`operator[]`(bbd415b616967878).'M'cxx . . $ QChar#QChar(f349c77f591a7878).]=1000; |
| 229 | // calcul du résultat : ajout d'un terme si l'ordre est normal, soustraction sinon. |
| 230 | int res=0; |
| 231 | int conv_s = conversion[cxx . . $ QMap#`operator[]`(bbd415b616967878).r[cxx . . $ QString#`operator[]`(57436120916eb52c).0]]; |
| 232 | for (int i = 0; i < r.countcxx . . $ QString#count(455f465bc33b4cdf).()-1; i++) |
| 233 | { |
| 234 | int conv_c = conv_s; |
| 235 | conv_s = conversion[cxx . . $ QMap#`operator[]`(bbd415b616967878).r[cxx . . $ QString#`operator[]`(57436120916eb52c).i+1]]; |
| 236 | if (conv_c < conv_s) |
| 237 | res -= conv_c; |
| 238 | else res += conv_c; |
| 239 | } |
| 240 | res += conv_s; |
| 241 | return res; |
| 242 | } |
| 243 | |
| 244 | /** |
| 245 | * \fn QString Lemmat::assimq (QString a) |
| 246 | * \brief Cherche si la chaîne a peut subir |
| 247 | * une assimilation, et renvoie |
| 248 | * cette chaîne éventuellement assimilée. |
| 249 | * *version avec quantités* |
| 250 | */ |
| 251 | QStringcxx . . $ QString# Lemmatcxx . . $ Lemmat#::assimqcxx . . $ Lemmat#assimq(f7f320d754b8fd09).(QStringcxx . . $ QString# a) |
| 252 | { |
| 253 | foreachcxx . . $ `<external>/15045578679651060896/qglobal.h:1145:13`! (QString d, assimsq.keys()) |
| 254 | if (a.startsWithcxx . . $ QString#startsWith(8cce4688c16f48f3).(d)) |
| 255 | { |
| 256 | a.replacecxx . . $ QString#replace(192e628656427d1c).(d, assimsqcxx . . $ Lemmat#assimsq..valuecxx . . $ QMap#value(866b0a4e5fb46e14).(d)); |
| 257 | return acxx . . $ QString#QString(28715ad661ad3cec).; |
| 258 | } |
| 259 | return acxx . . $ QString#QString(28715ad661ad3cec).; |
| 260 | } |
| 261 | |
| 262 | /* |
| 263 | QMap<QString, QString> Lemmat::cibles() |
| 264 | { |
| 265 | return _cibles; |
| 266 | } |
| 267 | */ |
| 268 | |
| 269 | /** |
| 270 | * \fn QString Lemmat::desassim (QString a) |
| 271 | * \brief Essaie de remplacer l'assimilation de a |
| 272 | * par sa forme non assimilée, et renvoie |
| 273 | * le résultat. |
| 274 | */ |
| 275 | QStringcxx . . $ QString# Lemmatcxx . . $ Lemmat#::desassimcxx . . $ Lemmat#desassim(f7f320d754b8fd09).(QStringcxx . . $ QString# a) |
| 276 | { |
| 277 | foreachcxx . . $ `<external>/15045578679651060896/qglobal.h:1145:13`! (QString d, assims.values()) |
| 278 | { |
| 279 | if (a.startsWithcxx . . $ QString#startsWith(8cce4688c16f48f3).(d)) |
| 280 | { |
| 281 | a.replacecxx . . $ QString#replace(192e628656427d1c).(d, assimscxx . . $ Lemmat#assims..keycxx . . $ QMap#key(dd8c0696c30c0a31).(d)); |
| 282 | return acxx . . $ QString#QString(28715ad661ad3cec).; |
| 283 | } |
| 284 | } |
| 285 | return acxx . . $ QString#QString(28715ad661ad3cec).; |
| 286 | } |
| 287 | |
| 288 | /** |
| 289 | * \fn QString Lemmat::desassimq (QString a) |
| 290 | * \brief Essaie de remplacer l'assimilation de a |
| 291 | * par sa forme non assimilée, et renvoie |
| 292 | * le résultat. |
| 293 | */ |
| 294 | QStringcxx . . $ QString# Lemmatcxx . . $ Lemmat#::desassimqcxx . . $ Lemmat#desassimq(f7f320d754b8fd09).(QStringcxx . . $ QString# a) |
| 295 | { |
| 296 | foreachcxx . . $ `<external>/15045578679651060896/qglobal.h:1145:13`! (QString d, assimsq.values()) |
| 297 | { |
| 298 | if (a.startsWithcxx . . $ QString#startsWith(8cce4688c16f48f3).(d)) |
| 299 | { |
| 300 | a.replacecxx . . $ QString#replace(192e628656427d1c).(d, assimsqcxx . . $ Lemmat#assimsq..keycxx . . $ QMap#key(dd8c0696c30c0a31).(d)); |
| 301 | return acxx . . $ QString#QString(28715ad661ad3cec).; |
| 302 | } |
| 303 | } |
| 304 | return acxx . . $ QString#QString(28715ad661ad3cec).; |
| 305 | } |
| 306 | |
| 307 | /** |
| 308 | * Fonction de conversion |
| 309 | * des chiffres romains en chiffres arabes. |
| 310 | * |
| 311 | */ |
| 312 | bool Lemmatcxx . . $ Lemmat#::estRomaincxx . . $ Lemmat#estRomain(7dc6c9a0b6a7270f).(QStringcxx . . $ QString# r) |
| 313 | { |
| 314 | return !(r.containscxx . . $ QString#contains(493fc6ca23db3119).(QRegExpcxx . . $ QRegExp#QRegExp(31e086911ff70bd0). ("[^IVXLCDM]"cxx . . $ QString#QString(85c52e162fed56f9).)) |
| 315 | || r.containscxx . . $ QString#contains(8cce4688c16f48f3).("IL"cxx . . $ QString#QString(85c52e162fed56f9).) |
| 316 | || r.containscxx . . $ QString#contains(8cce4688c16f48f3).("IVI"cxx . . $ QString#QString(85c52e162fed56f9).)); |
| 317 | } |
| 318 | |
| 319 | /** |
| 320 | * \fn MapLem Lemmat::lemmatise (QString f) |
| 321 | * \brief Le cœur du lemmatiseur |
| 322 | * |
| 323 | * renvoie une QMap<Lemme*,QStringlist> contenant |
| 324 | * - la liste de tous les lemmes pouvant donner |
| 325 | * la forme f; |
| 326 | * - pour chacun de ces lemmes la QStringList des morphologies |
| 327 | * correspondant à la forme. |
| 328 | */ |
| 329 | MapLemcxx . . $ MapLem# Lemmatcxx . . $ Lemmat#::lemmatisecxx . . $ Lemmat#lemmatise(a620231c7e1d945d).(QStringcxx . . $ QString# f) |
| 330 | { |
| 331 | MapLemcxx . . $ MapLem# resultcxx . . $ QMap#QMap(ced63f7c635d850d).; |
| 332 | if (f.isEmptycxx . . $ QString#isEmpty(50ce9a9e25b4a850).()) return resultcxx . . $ QMap#QMap(28c642871a274d78).; |
| 333 | QStringcxx . . $ QString# f_lower = f.toLowercxx . . $ QString#toLower(dca2c5857e9adf82).(); |
| 334 | int cnt_v = f_lower.countcxx . . $ QString#count(38964227c2ffb4ec).("v"cxx . . $ QString#QString(85c52e162fed56f9).); |
| 335 | bool V_maj = f[cxx . . $ QString#`operator[]`(57436120916eb52c).0] ==cxx . . $ `operator==`(a468b2f18a3afe8). 'V'cxx . . $ QChar#QChar(f349c77f591a7878).; |
| 336 | int cnt_ae = f_lower.countcxx . . $ QString#count(38964227c2ffb4ec).("æ"cxx . . $ QString#QString(85c52e162fed56f9).); |
| 337 | int cnt_oe = f_lower.countcxx . . $ QString#count(38964227c2ffb4ec).("œ"cxx . . $ QString#QString(85c52e162fed56f9).); |
| 338 | f =cxx . . $ QString#`operator=`(4f35bf974e7f8568). Chcxx . . $ Ch/::deramisecxx . . $ Ch/deramise(f7f320d754b8fd09).(fcxx . . $ QString#QString(132dd6869045752b).); |
| 339 | // formes irrégulières |
| 340 | QListcxx . . $ QList#<Irregcxx . . $ Irreg# *> lirr = _irregscxx . . $ Lemmat#_irregs..valuescxx . . $ QMultiMap#values(8fb875fcb58d4a3b).(f); |
| 341 | foreachcxx . . $ `<external>/15045578679651060896/qglobal.h:1145:13`! (Irreg *irr, lirr) |
| 342 | { |
| 343 | foreachcxx . . $ `<external>/15045578679651060896/qglobal.h:1145:13`! (int m, irr->morphos()) |
| 344 | { |
| 345 | SLemcxx . . $ SLem# sl = {irr->grqcxx . . $ Irreg#grq(4365c3963150523e).(), irr->lemmecxx . . $ Irreg#lemme(f4a9bc1d1653523f).(), morphocxx . . $ Lemmat#morpho(ce915ed341d4a7f0).(m), "", irr->lemmecxx . . $ Irreg#lemme(f4a9bc1d1653523f).()->poscxx . . $ Lemme#pos(4365c3963150523e).().atcxx . . $ QString#at(13af7ae5a875439e).(0).toLatin1cxx . . $ QChar#toLatin1(a33b425be6aff8f0).()}; |
| 346 | result[cxx . . $ QMap#`operator[]`(bbd415b616967878).irr->lemmecxx . . $ Irreg#lemme(f4a9bc1d1653523f).()].prependcxx . . $ QList#prepend(77d9f17553126ecb).(sl); |
| 347 | } |
| 348 | } |
| 349 | // radical + désinence |
| 350 | for (int i = 0; i <= f.lengthcxx . . $ QString#length(455f465bc33b4cdf).(); ++i) |
| 351 | { |
| 352 | QStringcxx . . $ QString# r = f.leftcxx . . $ QString#left(3f3c3d0e9c0eb37f).(i); |
| 353 | QStringcxx . . $ QString# d = f.midcxx . . $ QString#mid(44b7563da18aea72).(i); |
| 354 | QListcxx . . $ QList#<Desinencecxx . . $ Desinence# *> ldes = _desinencescxx . . $ Lemmat#_desinences..valuescxx . . $ QMultiMap#values(8fb875fcb58d4a3b).(d); |
| 355 | if (ldes.emptycxx . . $ QList#empty(50ce9a9e25b4a850).()) continue; |
| 356 | // Je regarde d'abord si d est une désinence possible, |
| 357 | // car il y a moins de désinences que de radicaux. |
| 358 | // Je fais la recherche sur les radicaux seulement si la désinence existe. |
| 359 | QListcxx . . $ QList#<Radicalcxx . . $ Radical# *> lrad = _radicauxcxx . . $ Lemmat#_radicaux..valuescxx . . $ QMultiMap#values(8fb875fcb58d4a3b).(r); |
| 360 | // ii noté ī |
| 361 | // 1. Patauium, gén. Pataui : Patau.i -> Patau+i.i |
| 362 | // 2. conubium, ablP conubis : conubi.s -> conubi.i+s |
| 363 | if (d.startsWithcxx . . $ QString#startsWith(7cf081d1b6a1defd).('i'cxx . . $ QChar#QChar(f349c77f591a7878).) && !d.startsWithcxx . . $ QString#startsWith(8cce4688c16f48f3).("ii"cxx . . $ QString#QString(85c52e162fed56f9).) && !r.endsWithcxx . . $ QString#endsWith(7cf081d1b6a1defd).('i'cxx . . $ QChar#QChar(f349c77f591a7878).)) |
| 364 | lrad <<cxx . . $ QList#`operator<<`(296c5e09a09ca26f). _radicauxcxx . . $ Lemmat#_radicaux..valuescxx . . $ QMultiMap#values(8fb875fcb58d4a3b).(r +cxx . . $ operator+(3d22f08efddf8107). "i"); |
| 365 | if (lrad.emptycxx . . $ QList#empty(50ce9a9e25b4a850).()) continue; |
| 366 | // Il n'y a rien à faire si le radical n'existe pas. |
| 367 | foreachcxx . . $ `<external>/15045578679651060896/qglobal.h:1145:13`! (Radical *rad, lrad) |
| 368 | { |
| 369 | Lemmecxx . . $ Lemme# *l = rad->lemmecxx . . $ Radical#lemme(f4a9bc1d1653523f).(); |
| 370 | foreachcxx . . $ `<external>/15045578679651060896/qglobal.h:1145:13`! (Desinence *des, ldes) |
| 371 | { |
| 372 | if (des->modelecxx . . $ Desinence#modele(4de283a37babcaa).() == l->modelecxx . . $ Lemme#modele(4de283a37babcaa).() && |
| 373 | des->numRadcxx . . $ Desinence#numRad(b126dc7c1de90089).() == rad->numRadcxx . . $ Radical#numRad(b126dc7c1de90089).() && |
| 374 | !l->estIrregExclcxx . . $ Lemme#estIrregExcl(83c267b20bac841a).(des->morphoNumcxx . . $ Desinence#morphoNum(b126dc7c1de90089).())) |
| 375 | { |
| 376 | bool c = ((cnt_v==0) |
| 377 | ||(cnt_v == rad->grqcxx . . $ Radical#grq(4365c3963150523e).().toLowercxx . . $ QString#toLower(30b3b70527b1c61a).().countcxx . . $ QString#count(38964227c2ffb4ec).("v"cxx . . $ QString#QString(85c52e162fed56f9).) |
| 378 | +des->grqcxx . . $ Desinence#grq(4365c3963150523e).().countcxx . . $ QString#count(38964227c2ffb4ec).("v"cxx . . $ QString#QString(85c52e162fed56f9).))); |
| 379 | if (!c) c = (V_maj && (rad->grcxx . . $ Radical#gr(4365c3963150523e).()[cxx . . $ QString#`operator[]`(57436120916eb52c).0] ==cxx . . $ `operator==`(a468b2f18a3afe8). 'U'cxx . . $ QChar#QChar(f349c77f591a7878).) |
| 380 | && (cnt_v - 1 == rad->grqcxx . . $ Radical#grq(4365c3963150523e).().toLowercxx . . $ QString#toLower(30b3b70527b1c61a).().countcxx . . $ QString#count(38964227c2ffb4ec).("v"cxx . . $ QString#QString(85c52e162fed56f9).))); |
| 381 | c = c && ((cnt_oe==0)||(cnt_oe == rad->grqcxx . . $ Radical#grq(4365c3963150523e).().toLowercxx . . $ QString#toLower(30b3b70527b1c61a).().countcxx . . $ QString#count(38964227c2ffb4ec).("ōe"cxx . . $ QString#QString(85c52e162fed56f9).))); |
| 382 | c = c && ((cnt_ae==0)||(cnt_ae == rad->grqcxx . . $ Radical#grq(4365c3963150523e).().toLowercxx . . $ QString#toLower(30b3b70527b1c61a).().countcxx . . $ QString#count(38964227c2ffb4ec).("āe"cxx . . $ QString#QString(85c52e162fed56f9).) |
| 383 | +des->grqcxx . . $ Desinence#grq(4365c3963150523e).().countcxx . . $ QString#count(38964227c2ffb4ec).("āe"cxx . . $ QString#QString(85c52e162fed56f9).))); |
| 384 | if (c) |
| 385 | { |
| 386 | QStringcxx . . $ QString# fq = rad->grqcxx . . $ Radical#grq(4365c3963150523e).() +cxx . . $ operator+(fab9b4f80031f353). des->grqcxx . . $ Desinence#grq(4365c3963150523e).(); |
| 387 | if (!r.endsWithcxx . . $ QString#endsWith(8cce4688c16f48f3).("i"cxx . . $ QString#QString(85c52e162fed56f9).) && rad->grcxx . . $ Radical#gr(4365c3963150523e).().endsWithcxx . . $ QString#endsWith(8cce4688c16f48f3).("i"cxx . . $ QString#QString(85c52e162fed56f9).)) |
| 388 | fq =cxx . . $ QString#`operator=`(b79fde0b0ce9b948). rad->grqcxx . . $ Radical#grq(4365c3963150523e).().leftcxx . . $ QString#left(3f3c3d0e9c0eb37f).(rad->grqcxx . . $ Radical#grq(4365c3963150523e).().sizecxx . . $ QString#size(455f465bc33b4cdf).()-1) +cxx . . $ operator+(3d22f08efddf8107). "ī" |
| 389 | +cxx . . $ operator+(fab9b4f80031f353). des->grqcxx . . $ Desinence#grq(4365c3963150523e).().rightcxx . . $ QString#right(3f3c3d0e9c0eb37f).(des->grqcxx . . $ Desinence#grq(4365c3963150523e).().sizecxx . . $ QString#size(455f465bc33b4cdf).()-1); |
| 390 | int numM; |
| 391 | if (l->modelecxx . . $ Lemme#modele(4de283a37babcaa).()->grcxx . . $ Modele#gr(4365c3963150523e).() ==cxx . . $ QString#`operator==`(7d4bdb1abc417636). "inv") numM = 416; |
| 392 | else numM = des->morphoNumcxx . . $ Desinence#morphoNum(b126dc7c1de90089).(); |
| 393 | QStringcxx . . $ QString# morphosl = morphocxx . . $ Lemmat#morpho(ce915ed341d4a7f0).(numM); |
| 394 | if (l->poscxx . . $ Lemme#pos(4365c3963150523e).() ==cxx . . $ QString#`operator==`(7d4bdb1abc417636). "n") morphosl.appendcxx . . $ QString#append(6a89d0b7f4d2681c).(" "+cxx . . $ operator+(c75c3ae4eb9af1a8).l->genrecxx . . $ Lemme#genre(4365c3963150523e).()); |
| 395 | SLemcxx . . $ SLem# sl = {fq, l, morphosl, "", l->modelecxx . . $ Lemme#modele(4de283a37babcaa).()->poscxx . . $ Modele#pos(44eb9225326fcbf5).().toLatin1cxx . . $ QChar#toLatin1(a33b425be6aff8f0).()}; |
| 396 | result[cxx . . $ QMap#`operator[]`(bbd415b616967878).l].prependcxx . . $ QList#prepend(77d9f17553126ecb).(sl); |
| 397 | } |
| 398 | } |
| 399 | } |
| 400 | } |
| 401 | } |
| 402 | if (_extLoadedcxx . . $ Lemmat#_extLoaded. && !_extensioncxx . . $ Lemmat#_extension. && !result.isEmptycxx . . $ QMap#isEmpty(50ce9a9e25b4a850).()) |
| 403 | { |
| 404 | // L'extension est chargée mais je ne veux voir |
| 405 | // les solutions qui en viennent que si toutes en viennent. |
| 406 | MapLemcxx . . $ MapLem# rescxx . . $ QMap#QMap(ced63f7c635d850d).; |
| 407 | foreachcxx . . $ `<external>/15045578679651060896/qglobal.h:1145:13`! (Lemme *l, result.keys()) |
| 408 | { |
| 409 | if (l->origincxx . . $ Lemme#origin(b126dc7c1de90089).() == 0) |
| 410 | res[cxx . . $ QMap#`operator[]`(bbd415b616967878).l] =cxx . . $ QList#`operator=`(296c5e09a09ca26f). result[cxx . . $ QMap#`operator[]`(bbd415b616967878).l]; |
| 411 | } |
| 412 | |
| 413 | if (!res.isEmptycxx . . $ QMap#isEmpty(50ce9a9e25b4a850).()) result =cxx . . $ QMap#`operator=`(9a30e17cbbb0999d). res; |
| 414 | } |
| 415 | return resultcxx . . $ QMap#QMap(28c642871a274d78).; |
| 416 | } |
| 417 | |
| 418 | /** |
| 419 | * \fn MapLem Lemmat::lemmatiseM (QString f, bool debPhr) |
| 420 | * \brief Renvoie dans une MapLem les lemmatisations de la |
| 421 | * forme f. le paramètre debPhr à true indique qu'il |
| 422 | * s'agit d'un début de phrase, et la fonction |
| 423 | * peut tenir compte des majuscules pour savoir |
| 424 | * s'il s'agit d'un nom propre. |
| 425 | */ |
| 426 | MapLemcxx . . $ MapLem# Lemmatcxx . . $ Lemmat#::lemmatiseMcxx . . $ Lemmat#lemmatiseM(8e33ef44f3e788bb).(QStringcxx . . $ QString# f, bool debPhr) |
| 427 | { |
| 428 | QStringcxx . . $ QString# rescxx . . $ QString#QString(ced63f7c635d850d).; |
| 429 | QTextStreamcxx . . $ QTextStream# flcxx . . $ QTextStream#QTextStream(16e3d097052a73db).(&res); |
| 430 | // chiffres romains |
| 431 | MapLemcxx . . $ MapLem# mm = lemmatisecxx . . $ Lemmat#lemmatise(a620231c7e1d945d).(fcxx . . $ QString#QString(132dd6869045752b).); |
| 432 | if (estRomaincxx . . $ Lemmat#estRomain(7dc6c9a0b6a7270f).(fcxx . . $ QString#QString(132dd6869045752b).)) |
| 433 | { |
| 434 | QStringcxx . . $ QString# lin = QStringcxx . . $ QString#QString(85c52e162fed56f9).("%1|inv|||num.|1").argcxx . . $ QString#arg(bc823072288cbbb5).(f); |
| 435 | Lemmecxx . . $ Lemme# *romain = new Lemmecxx . . $ Lemme#Lemme(74fd4704878d03ee).(lincxx . . $ QString#QString(132dd6869045752b)., 0, this); |
| 436 | int nr = aRomanocxx . . $ Lemmat#aRomano(87a9b7c6fe1ccdba).(fcxx . . $ QString#QString(132dd6869045752b).); |
| 437 | romain->ajTradcxx . . $ Lemme#ajTrad(3458fe3960d5051).(QStringcxx . . $ QString#QString(85c52e162fed56f9).("%1").argcxx . . $ QString#arg(64ab2ed17cc11715).(nr), "fr"cxx . . $ QString#QString(85c52e162fed56f9).); |
| 438 | SLemcxx . . $ SLem# sl = {f, 0, "inv","",'m'}; |
| 439 | QListcxx . . $ QList#<SLemcxx . . $ SLem#> lslcxx . . $ QList#QList(ced63f7c635d850d).; |
| 440 | lsl.appendcxx . . $ QList#append(77d9f17553126ecb).(sl); |
| 441 | mm.insertcxx . . $ QMap#insert(929a1ed410fe8423).(romain, lsl); |
| 442 | } |
| 443 | if (f.isEmptycxx . . $ QString#isEmpty(50ce9a9e25b4a850).()) return mmcxx . . $ QMap#QMap(28c642871a274d78).; |
| 444 | // suffixes |
| 445 | foreachcxx . . $ `<external>/15045578679651060896/qglobal.h:1145:13`! (QString suf, suffixes.keys()) |
| 446 | if (mm.emptycxx . . $ QMap#empty(50ce9a9e25b4a850).() && f.endsWithcxx . . $ QString#endsWith(8cce4688c16f48f3).(suf)) |
| 447 | { |
| 448 | QStringcxx . . $ QString# sf = fcxx . . $ QString#QString(132dd6869045752b).; |
| 449 | sf.chopcxx . . $ QString#chop(d4f767463ce0a6b3).(suf.lengthcxx . . $ QString#length(455f465bc33b4cdf).()); |
| 450 | // TODO : aequeque est la seule occurrence |
| 451 | // de -queque dans le corpus classique |
| 452 | mm =cxx . . $ QMap#`operator=`(86243d55ea3d6313). lemmatiseMcxx . . $ Lemmat#lemmatiseM(8e33ef44f3e788bb).(sfcxx . . $ QString#QString(132dd6869045752b)., debPhr); |
| 453 | bool sst = false; |
| 454 | if (mm.isEmptycxx . . $ QMap#isEmpty(50ce9a9e25b4a850).() && (suf ==cxx . . $ QString#`operator==`(7d4bdb1abc417636). "st")) |
| 455 | { |
| 456 | sf +=cxx . . $ QString#`operator+=`(d02845eef0c33901). "s"; |
| 457 | mm =cxx . . $ QMap#`operator=`(86243d55ea3d6313). lemmatiseMcxx . . $ Lemmat#lemmatiseM(8e33ef44f3e788bb).(sfcxx . . $ QString#QString(132dd6869045752b)., debPhr); |
| 458 | sst = true; |
| 459 | } |
| 460 | foreachcxx . . $ `<external>/15045578679651060896/qglobal.h:1145:13`! (Lemme *l, mm.keys()) |
| 461 | { |
| 462 | QListcxx . . $ QList#<SLemcxx . . $ SLem#> ls = mm.valuecxx . . $ QMap#value(866b0a4e5fb46e14).(l); |
| 463 | for (int i = 0; i < ls.countcxx . . $ QList#count(455f465bc33b4cdf).(); ++i) |
| 464 | if (sst) mm[cxx . . $ QMap#`operator[]`(bbd415b616967878).l][cxx . . $ QList#`operator[]`(7a0ef1c7079e8533).i].sufqcxx . . $ $anonymous_type_8217b278145723a1_0#sufq. =cxx . . $ QString#`operator=`(d02845eef0c33901). "t"; |
| 465 | else mm[cxx . . $ QMap#`operator[]`(bbd415b616967878).l][cxx . . $ QList#`operator[]`(7a0ef1c7079e8533).i].sufqcxx . . $ $anonymous_type_8217b278145723a1_0#sufq. +=cxx . . $ QString#`operator+=`(6a89d0b7f4d2681c). suffixescxx . . $ Lemmat#suffixes..valuecxx . . $ QMap#value(866b0a4e5fb46e14).(suf); // Pour modoquest |
| 466 | } |
| 467 | } |
| 468 | if (debPhr && f.atcxx . . $ QString#at(13af7ae5a875439e).(0).isUppercxx . . $ QChar#isUpper(3482b152b9333168).()) |
| 469 | { |
| 470 | QStringcxx . . $ QString# nf = f.toLowercxx . . $ QString#toLower(dca2c5857e9adf82).(); |
| 471 | MapLemcxx . . $ MapLem# nmm = lemmatiseMcxx . . $ Lemmat#lemmatiseM(8e33ef44f3e788bb).(nfcxx . . $ QString#QString(132dd6869045752b).); |
| 472 | foreachcxx . . $ `<external>/15045578679651060896/qglobal.h:1145:13`! (Lemme *nl, nmm.keys()) |
| 473 | mm.insertcxx . . $ QMap#insert(929a1ed410fe8423).(nl, nmm.valuecxx . . $ QMap#value(866b0a4e5fb46e14).(nl)); |
| 474 | } |
| 475 | // assimilations |
| 476 | if (mm.emptycxx . . $ QMap#empty(50ce9a9e25b4a850).()) |
| 477 | { |
| 478 | QStringcxx . . $ QString# fa = assimcxx . . $ Lemmat#assim(f7f320d754b8fd09).(fcxx . . $ QString#QString(132dd6869045752b).); |
| 479 | if (fa !=cxx . . $ `operator!=`(5bc2975d2d751687). f) |
| 480 | { |
| 481 | MapLemcxx . . $ MapLem# nmm = lemmatiseMcxx . . $ Lemmat#lemmatiseM(8e33ef44f3e788bb).(facxx . . $ QString#QString(132dd6869045752b).); |
| 482 | // désassimiler les résultats |
| 483 | foreachcxx . . $ `<external>/15045578679651060896/qglobal.h:1145:13`! (Lemme *nl, nmm.keys()) |
| 484 | { |
| 485 | for (int i = 0; i < nmm[cxx . . $ QMap#`operator[]`(bbd415b616967878).nl].countcxx . . $ QList#count(455f465bc33b4cdf).(); ++i) |
| 486 | nmm[cxx . . $ QMap#`operator[]`(bbd415b616967878).nl][cxx . . $ QList#`operator[]`(7a0ef1c7079e8533).i].grqcxx . . $ $anonymous_type_8217b278145723a1_0#grq. =cxx . . $ QString#`operator=`(4f35bf974e7f8568). desassimqcxx . . $ Lemmat#desassimq(f7f320d754b8fd09).(nmmcxx . . $ QString#QString(132dd6869045752b).[cxx . . $ QMap#`operator[]`(bbd415b616967878).nl][cxx . . $ QList#`operator[]`(7a0ef1c7079e8533).i].grqcxx . . $ $anonymous_type_8217b278145723a1_0#grq.); |
| 487 | mm.insertcxx . . $ QMap#insert(929a1ed410fe8423).(nl, nmm.valuecxx . . $ QMap#value(866b0a4e5fb46e14).(nl)); |
| 488 | } |
| 489 | } |
| 490 | } |
| 491 | if (mm.emptycxx . . $ QMap#empty(50ce9a9e25b4a850).()) |
| 492 | { |
| 493 | QStringcxx . . $ QString# fa = desassimcxx . . $ Lemmat#desassim(f7f320d754b8fd09).(fcxx . . $ QString#QString(132dd6869045752b).); |
| 494 | if (fa !=cxx . . $ `operator!=`(5bc2975d2d751687). f) |
| 495 | { |
| 496 | MapLemcxx . . $ MapLem# nmm = lemmatisecxx . . $ Lemmat#lemmatise(a620231c7e1d945d).(facxx . . $ QString#QString(132dd6869045752b).); |
| 497 | foreachcxx . . $ `<external>/15045578679651060896/qglobal.h:1145:13`! (Lemme *nl, nmm.keys()) |
| 498 | { |
| 499 | for (int i = 0; i < nmm[cxx . . $ QMap#`operator[]`(bbd415b616967878).nl].countcxx . . $ QList#count(455f465bc33b4cdf).(); ++i) |
| 500 | nmm[cxx . . $ QMap#`operator[]`(bbd415b616967878).nl][cxx . . $ QList#`operator[]`(7a0ef1c7079e8533).i].grqcxx . . $ $anonymous_type_8217b278145723a1_0#grq. =cxx . . $ QString#`operator=`(4f35bf974e7f8568). assimqcxx . . $ Lemmat#assimq(f7f320d754b8fd09).(nmmcxx . . $ QString#QString(132dd6869045752b).[cxx . . $ QMap#`operator[]`(bbd415b616967878).nl][cxx . . $ QList#`operator[]`(7a0ef1c7079e8533).i].grqcxx . . $ $anonymous_type_8217b278145723a1_0#grq.); |
| 501 | mm.insertcxx . . $ QMap#insert(929a1ed410fe8423).(nl, nmm.valuecxx . . $ QMap#value(866b0a4e5fb46e14).(nl)); |
| 502 | } |
| 503 | } |
| 504 | } |
| 505 | // contractions |
| 506 | QStringcxx . . $ QString# fd = fcxx . . $ QString#QString(132dd6869045752b).; |
| 507 | foreachcxx . . $ `<external>/15045578679651060896/qglobal.h:1145:13`! (QString cle, _contractions.keys()) |
| 508 | if (fd.endsWithcxx . . $ QString#endsWith(8cce4688c16f48f3).(cle)) |
| 509 | { |
| 510 | fd.chopcxx . . $ QString#chop(d4f767463ce0a6b3).(cle.lengthcxx . . $ QString#length(455f465bc33b4cdf).()); |
| 511 | if ((fd.containscxx . . $ QString#contains(8cce4688c16f48f3).("v"cxx . . $ QString#QString(85c52e162fed56f9).) || fd.containscxx . . $ QString#contains(8cce4688c16f48f3).("V"cxx . . $ QString#QString(85c52e162fed56f9).))) |
| 512 | fd.appendcxx . . $ QString#append(6a89d0b7f4d2681c).(_contractionscxx . . $ Lemmat#_contractions..valuecxx . . $ QMap#value(866b0a4e5fb46e14).(cle)); |
| 513 | else |
| 514 | fd.appendcxx . . $ QString#append(6a89d0b7f4d2681c).(Chcxx . . $ Ch/::deramisecxx . . $ Ch/deramise(f7f320d754b8fd09).(_contractionscxx . . $ Lemmat#_contractions..valuecxx . . $ QMap#value(866b0a4e5fb46e14).(cle))); |
| 515 | MapLemcxx . . $ MapLem# nmm = lemmatisecxx . . $ Lemmat#lemmatise(a620231c7e1d945d).(fdcxx . . $ QString#QString(132dd6869045752b).); |
| 516 | foreachcxx . . $ `<external>/15045578679651060896/qglobal.h:1145:13`! (Lemme *nl, nmm.keys()) |
| 517 | { |
| 518 | int diff = _contractionscxx . . $ Lemmat#_contractions..valuecxx . . $ QMap#value(866b0a4e5fb46e14).(cle).sizecxx . . $ QString#size(455f465bc33b4cdf).() - cle.sizecxx . . $ QString#size(455f465bc33b4cdf).(); |
| 519 | // nombre de lettres que je dois supprimer |
| 520 | for (int i = 0; i < nmm[cxx . . $ QMap#`operator[]`(bbd415b616967878).nl].countcxx . . $ QList#count(455f465bc33b4cdf).(); ++i) |
| 521 | { |
| 522 | int position = f.sizecxx . . $ QString#size(455f465bc33b4cdf).() - cle.sizecxx . . $ QString#size(455f465bc33b4cdf).() + 1; |
| 523 | // position de la 1ère lettre à supprimer |
| 524 | if (fd.sizecxx . . $ QString#size(455f465bc33b4cdf).() != nmm[cxx . . $ QMap#`operator[]`(bbd415b616967878).nl][cxx . . $ QList#`operator[]`(7a0ef1c7079e8533).i].grqcxx . . $ $anonymous_type_8217b278145723a1_0#grq..sizecxx . . $ QString#size(455f465bc33b4cdf).()) |
| 525 | { |
| 526 | // il y a une (ou des) voyelle(s) commune(s) |
| 527 | QStringcxx . . $ QString# debut = nmm[cxx . . $ QMap#`operator[]`(bbd415b616967878).nl][cxx . . $ QList#`operator[]`(7a0ef1c7079e8533).i].grqcxx . . $ $anonymous_type_8217b278145723a1_0#grq..leftcxx . . $ QString#left(3f3c3d0e9c0eb37f).(position + 2); |
| 528 | position += debut.countcxx . . $ QString#count(38964227c2ffb4ec).("\u0306"cxx . . $ QString#QString(85c52e162fed56f9).); // Faut-il vérifier que je suis sur le "v". |
| 529 | } |
| 530 | nmm[cxx . . $ QMap#`operator[]`(bbd415b616967878).nl][cxx . . $ QList#`operator[]`(7a0ef1c7079e8533).i].grqcxx . . $ $anonymous_type_8217b278145723a1_0#grq. =cxx . . $ QString#`operator=`(b79fde0b0ce9b948). nmm[cxx . . $ QMap#`operator[]`(bbd415b616967878).nl][cxx . . $ QList#`operator[]`(7a0ef1c7079e8533).i].grqcxx . . $ $anonymous_type_8217b278145723a1_0#grq..removecxx . . $ QString#remove(6483560ce2afa901).(position, diff); |
| 531 | } |
| 532 | mm.insertcxx . . $ QMap#insert(929a1ed410fe8423).(nl, nmm.valuecxx . . $ QMap#value(866b0a4e5fb46e14).(nl)); |
| 533 | } |
| 534 | } |
| 535 | // majuscule initiale |
| 536 | if (mm.emptycxx . . $ QMap#empty(50ce9a9e25b4a850).()) |
| 537 | { |
| 538 | f[cxx . . $ QString#`operator[]`(57436120916eb52c).0] =cxx . . $ QCharRef#`operator=`(5f0dd24e11013996). f.atcxx . . $ QString#at(13af7ae5a875439e).(0).toUppercxx . . $ QChar#toUpper(e5ddf3948a40da3f).(); |
| 539 | MapLemcxx . . $ MapLem# nmm = lemmatisecxx . . $ Lemmat#lemmatise(a620231c7e1d945d).(fcxx . . $ QString#QString(132dd6869045752b).); |
| 540 | foreachcxx . . $ `<external>/15045578679651060896/qglobal.h:1145:13`! (Lemme *nl, nmm.keys()) |
| 541 | mm.insertcxx . . $ QMap#insert(929a1ed410fe8423).(nl, nmm.valuecxx . . $ QMap#value(866b0a4e5fb46e14).(nl)); |
| 542 | } |
| 543 | return mmcxx . . $ QMap#QMap(28c642871a274d78).; |
| 544 | } |
| 545 | |
| 546 | /** |
| 547 | * \fn Lemme* Lemmat::lemme (QString l) |
| 548 | * \brief cherche dans la liste des lemmes le lemme |
| 549 | * dont la clé est l, et retourne le résultat. |
| 550 | */ |
| 551 | Lemmecxx . . $ Lemme# *Lemmatcxx . . $ Lemmat#::lemmecxx . . $ Lemmat#lemme(232dd0184078fd95).(QStringcxx . . $ QString# l) |
| 552 | { |
| 553 | return _lemmescxx . . $ Lemmat#_lemmes..valuecxx . . $ QMap#value(866b0a4e5fb46e14).(l); |
| 554 | } |
| 555 | |
| 556 | QStringListcxx . . $ QStringList# Lemmatcxx . . $ Lemmat#::lignesFichiercxx . . $ Lemmat#lignesFichier(327870d3b2cb3fa6).(QStringcxx . . $ QString# nf) |
| 557 | { |
| 558 | QFilecxx . . $ QFile# fcxx . . $ QFile#QFile(3520e46b33348bf6).(nf); |
| 559 | f.opencxx . . $ QFile#open(dca164408be960c8).(QFilecxx . . $ QFlags#QFlags(93d577a3e9528307).::ReadOnlycxx . . $ QIODevice#ReadOnly.); |
| 560 | QTextStreamcxx . . $ QTextStream# fluxcxx . . $ QTextStream#QTextStream(bebe8f2dee7f9e86).(&f); |
| 561 | flux.setCodeccxx . . $ QTextStream#setCodec(85c52e162fed56f9).("UTF-8"); |
| 562 | QStringListcxx . . $ QStringList# retourcxx . . $ QStringList#QStringList(ced63f7c635d850d).; |
| 563 | while (!flux.atEndcxx . . $ QTextStream#atEnd(50ce9a9e25b4a850).()) |
| 564 | { |
| 565 | QStringcxx . . $ QString# lin = flux.readLinecxx . . $ QTextStream#readLine(20e0a2766677f583).(); |
| 566 | if ((!lin.isEmptycxx . . $ QString#isEmpty(50ce9a9e25b4a850).()) && ((!lin.startsWithcxx . . $ QString#startsWith(8cce4688c16f48f3).("!"cxx . . $ QString#QString(85c52e162fed56f9).)) || lin.startsWithcxx . . $ QString#startsWith(8cce4688c16f48f3).("! --- "cxx . . $ QString#QString(85c52e162fed56f9).))) |
| 567 | retour.appendcxx . . $ QList#append(77d9f17553126ecb).(lin.simplifiedcxx . . $ QString#simplified(dca2c5857e9adf82).()); |
| 568 | } |
| 569 | f.closecxx . . $ QFileDevice#close(49f6e7a06ebc5aa8).(); |
| 570 | return retour; |
| 571 | } |
| 572 | |
| 573 | /** |
| 574 | * \fn void Lemmat::lisIrreguliers() |
| 575 | * \brief Chargement des formes irrégulières |
| 576 | * du fichier data/irregs.la |
| 577 | */ |
| 578 | void Lemmatcxx . . $ Lemmat#::lisIrregulierscxx . . $ Lemmat#lisIrreguliers(49f6e7a06ebc5aa8).() |
| 579 | { |
| 580 | QStringListcxx . . $ QStringList# lignes = lignesFichiercxx . . $ Lemmat#lignesFichier(327870d3b2cb3fa6).(_resDircxx . . $ Lemmat#_resDir. +cxx . . $ operator+(3d22f08efddf8107). "irregs.la"); |
| 581 | foreachcxx . . $ `<external>/15045578679651060896/qglobal.h:1145:13`! (QString lin, lignes) |
| 582 | { |
| 583 | if (lin.isEmptycxx . . $ QString#isEmpty(50ce9a9e25b4a850).()) continue; |
| 584 | Irregcxx . . $ Irreg# *irr = new Irregcxx . . $ Irreg#(lincxx . . $ QString#QString(132dd6869045752b)., this); |
| 585 | if (irr != 0 && irr->lemmecxx . . $ Irreg#lemme(f4a9bc1d1653523f).() != 0) |
| 586 | _irregscxx . . $ Lemmat#_irregs..insertcxx . . $ QMultiMap#insert(9bf047f9fc4d1418).(Chcxx . . $ Ch/::deramisecxx . . $ Ch/deramise(f7f320d754b8fd09).(irr->grcxx . . $ Irreg#gr(4365c3963150523e).()), irr); |
| 587 | #ifdef DEBOG |
| 588 | else |
| 589 | std::cerr << "Irréguliers, erreur dans la ligne" << qPrintable(lin); |
| 590 | #endif |
| 591 | } |
| 592 | // ajouter les irréguliers aux lemmes |
| 593 | foreachcxx . . $ `<external>/15045578679651060896/qglobal.h:1145:13`! (Irreg *ir, _irregs) |
| 594 | ir->lemmecxx . . $ Irreg#lemme(f4a9bc1d1653523f).()->ajIrregcxx . . $ Lemme#ajIrreg(6ae356483522c774).(ir); |
| 595 | } |
| 596 | |
| 597 | /** |
| 598 | * \fn void Lemmat::lisFichierLexique(filepath) |
| 599 | * \brief Lecture des lemmes, synthèse et enregistrement |
| 600 | * de leurs radicaux |
| 601 | */ |
| 602 | void Lemmatcxx . . $ Lemmat#::lisFichierLexiquecxx . . $ Lemmat#lisFichierLexique(7df51288a9ebd664).(QStringcxx . . $ QString# filepath) |
| 603 | { |
| 604 | int orig = 0; |
| 605 | if (filepath.endsWithcxx . . $ QString#endsWith(8cce4688c16f48f3).("ext.la"cxx . . $ QString#QString(85c52e162fed56f9).)) orig = 1; |
| 606 | QStringListcxx . . $ QStringList# lignes = lignesFichiercxx . . $ Lemmat#lignesFichier(327870d3b2cb3fa6).(filepathcxx . . $ QString#QString(132dd6869045752b).); |
| 607 | foreachcxx . . $ `<external>/15045578679651060896/qglobal.h:1145:13`! (QString lin, lignes) |
| 608 | { |
| 609 | // contrôle de format |
| 610 | QStringListcxx . . $ QStringList# eclats = lin.splitcxx . . $ QString#split(92030b8bf74e4227).('|'cxx . . $ QChar#QChar(f349c77f591a7878).); |
| 611 | if (eclats.countcxx . . $ QList#count(455f465bc33b4cdf).() < 6) |
| 612 | { |
| 613 | stdcxx . . $ std/::cerrcxx . . $ std/cerr. <<cxx . . $ std/`operator<<`(efaf8c13fc75f3c7). qPrintablecxx . . $ `<external>/15045578679651060896/qglobal.h:831:11`! ("ligne mal formée:"+lin); |
| 614 | continue; |
| 615 | } |
| 616 | Lemmecxx . . $ Lemme# *l = new Lemmecxx . . $ Lemme#Lemme(74fd4704878d03ee).(lincxx . . $ QString#QString(132dd6869045752b)., orig, this); |
| 617 | _lemmescxx . . $ Lemmat#_lemmes..insertcxx . . $ QMap#insert(929a1ed410fe8423).(l->clecxx . . $ Lemme#cle(4365c3963150523e).(), l); |
| 618 | } |
| 619 | } |
| 620 | |
| 621 | void Lemmatcxx . . $ Lemmat#::lisLexicoSyntaxecxx . . $ Lemmat#lisLexicoSyntaxe(49f6e7a06ebc5aa8).() |
| 622 | { |
| 623 | QStringListcxx . . $ QStringList# lignes = lignesFichiercxx . . $ Lemmat#lignesFichier(327870d3b2cb3fa6).(_resDircxx . . $ Lemmat#_resDir.+cxx . . $ operator+(3d22f08efddf8107)."lexsynt.la"); |
| 624 | while (lignes.countcxx . . $ QList#count(455f465bc33b4cdf).() > 0) |
| 625 | { |
| 626 | QStringcxx . . $ QString# lin = lignes.takeFirstcxx . . $ QList#takeFirst(5f357b03ed472e5e).(); |
| 627 | QStringListcxx . . $ QStringList# eclats = lin.splitcxx . . $ QString#split(2ba03f79dd8e9c12).(':'cxx . . $ QChar#QChar(f349c77f591a7878).,QStringcxx . . $ QString#::SkipEmptyPartscxx . . $ QString#SkipEmptyParts.); |
| 628 | if (eclats.countcxx . . $ QList#count(455f465bc33b4cdf).() > 1) |
| 629 | { |
| 630 | Lemmecxx . . $ Lemme# *l = lemmecxx . . $ Lemmat#lemme(232dd0184078fd95).(eclatscxx . . $ QString#QString(132dd6869045752b)..atcxx . . $ QList#at(e2681f9bb6b2f357).(0)); |
| 631 | if (l != 0) |
| 632 | { |
| 633 | QStringListcxx . . $ QStringList# lsynt = eclats.atcxx . . $ QList#at(e2681f9bb6b2f357).(1).splitcxx . . $ QString#split(2ba03f79dd8e9c12).(','cxx . . $ QChar#QChar(f349c77f591a7878).,QStringcxx . . $ QString#::SkipEmptyPartscxx . . $ QString#SkipEmptyParts.); |
| 634 | l->setLexSyntcxx . . $ Lemme#setLexSynt(fc47db3ea09604d9).(lsynt); |
| 635 | } |
| 636 | } |
| 637 | } |
| 638 | } |
| 639 | |
| 640 | /** |
| 641 | * \fn void Lemmat::lisLexique() |
| 642 | * \brief Lecture du fichier de lemmes de base |
| 643 | */ |
| 644 | void Lemmatcxx . . $ Lemmat#::lisLexiquecxx . . $ Lemmat#lisLexique(49f6e7a06ebc5aa8).() |
| 645 | { |
| 646 | Lemmatcxx . . $ Lemmat#::lisFichierLexiquecxx . . $ Lemmat#lisFichierLexique(7df51288a9ebd664).(_resDircxx . . $ Lemmat#_resDir. +cxx . . $ operator+(3d22f08efddf8107). "lemmes.la"); |
| 647 | } |
| 648 | |
| 649 | /** |
| 650 | * \fn void Lemmat::lisModeles() |
| 651 | * \brief Lecture des modèles, synthèse et enregistrement |
| 652 | * de leurs désinences |
| 653 | */ |
| 654 | void Lemmatcxx . . $ Lemmat#::lisModelescxx . . $ Lemmat#lisModeles(49f6e7a06ebc5aa8).() |
| 655 | { |
| 656 | QStringListcxx . . $ QStringList# lignes = lignesFichiercxx . . $ Lemmat#lignesFichier(327870d3b2cb3fa6).(_resDircxx . . $ Lemmat#_resDir. +cxx . . $ operator+(3d22f08efddf8107). "modeles.la"); |
| 657 | int max = lignes.countcxx . . $ QList#count(455f465bc33b4cdf).()-1; |
| 658 | QStringListcxx . . $ QStringList# slcxx . . $ QStringList#QStringList(ced63f7c635d850d).; |
| 659 | for (int i=0;i<=max;++i) |
| 660 | { |
| 661 | QStringcxx . . $ QString# l = lignescxx . . $ QString#QString(132dd6869045752b)..atcxx . . $ QList#at(e2681f9bb6b2f357).(i); |
| 662 | if (l.startsWithcxx . . $ QString#startsWith(7cf081d1b6a1defd).('$'cxx . . $ QChar#QChar(f349c77f591a7878).)) |
| 663 | { |
| 664 | _variablescxx . . $ Lemmat#_variables.[cxx . . $ QMap#`operator[]`(bbd415b616967878).l.sectioncxx . . $ QString#section(6e922cf609fb9683).('='cxx . . $ QChar#QChar(f349c77f591a7878)., 0, 0)] =cxx . . $ QString#`operator=`(4f35bf974e7f8568). l.sectioncxx . . $ QString#section(6e922cf609fb9683).('='cxx . . $ QChar#QChar(f349c77f591a7878)., 1, 1); |
| 665 | continue; |
| 666 | } |
| 667 | QStringListcxx . . $ QStringList# eclats = l.splitcxx . . $ QString#split(c8b44a97dcb6200d).(":"cxx . . $ QString#QString(85c52e162fed56f9).); |
| 668 | if ((eclats.atcxx . . $ QList#at(e2681f9bb6b2f357).(0) ==cxx . . $ QString#`operator==`(7d4bdb1abc417636). "modele" || i == max) && !sl.emptycxx . . $ QList#empty(50ce9a9e25b4a850).()) |
| 669 | { |
| 670 | Modelecxx . . $ Modele# *m = new Modelecxx . . $ Modele#Modele(2a16bbc69f72c7ea).(sl, this); |
| 671 | _modelescxx . . $ Lemmat#_modeles..insertcxx . . $ QMap#insert(929a1ed410fe8423).(m->grcxx . . $ Modele#gr(4365c3963150523e).(), m); |
| 672 | sl.clearcxx . . $ QList#clear(49f6e7a06ebc5aa8).(); |
| 673 | } |
| 674 | sl.appendcxx . . $ QList#append(77d9f17553126ecb).(l); |
| 675 | } |
| 676 | } |
| 677 | |
| 678 | /** |
| 679 | * \fn void Lemmat::lisTraductions() |
| 680 | * \brief Lecture des fichiers de traductions |
| 681 | * trouvés dans data/, nommés lemmes, avec |
| 682 | * un suffixe corresponant à la langue cible |
| 683 | * qu'ils fournissent. |
| 684 | */ |
| 685 | void Lemmatcxx . . $ Lemmat#::lisTraductionscxx . . $ Lemmat#lisTraductions(b0b38cda41d4ede4).(bool base, bool extension) |
| 686 | { |
| 687 | QDircxx . . $ QDir# repcxx . . $ QDir#QDir(3520e46b33348bf6).; |
| 688 | if (!base && !extension) return; |
| 689 | if (base && extension) { |
| 690 | rep =cxx . . $ QDir#`operator=`(cc7d5403368d850). QDircxx . . $ QDir#QDir(8b3566800564c7be).(_resDircxx . . $ Lemmat#_resDir., "lem*.*"cxx . . $ QString#QString(85c52e162fed56f9).); |
| 691 | } else if (base) { |
| 692 | rep =cxx . . $ QDir#`operator=`(cc7d5403368d850). QDircxx . . $ QDir#QDir(8b3566800564c7be).(_resDircxx . . $ Lemmat#_resDir., "lemmes.*"cxx . . $ QString#QString(85c52e162fed56f9).); |
| 693 | } else { |
| 694 | rep =cxx . . $ QDir#`operator=`(cc7d5403368d850). QDircxx . . $ QDir#QDir(8b3566800564c7be).(_resDircxx . . $ Lemmat#_resDir., "lem_ext.*"cxx . . $ QString#QString(85c52e162fed56f9).); |
| 695 | } |
| 696 | QStringListcxx . . $ QStringList# ltr = rep.entryListcxx . . $ QDir#entryList(648720ae7e049ebe).(); |
| 697 | if (base) { |
| 698 | ltr.removeOnecxx . . $ QList#removeOne(fe1ba53999e710f3).("lemmes.la"cxx . . $ QString#QString(85c52e162fed56f9).); // n'est pas un fichier de traductions |
| 699 | } |
| 700 | if (extension) { |
| 701 | ltr.removeOnecxx . . $ QList#removeOne(fe1ba53999e710f3).("lem_ext.la"cxx . . $ QString#QString(85c52e162fed56f9).); // n'est pas un fichier de traductions |
| 702 | } |
| 703 | foreachcxx . . $ `<external>/15045578679651060896/qglobal.h:1145:13`! (QString nfl, ltr) |
| 704 | { |
| 705 | // suffixe |
| 706 | QStringcxx . . $ QString# suff = QFileInfocxx . . $ QFileInfo#(nfl).suffixcxx . . $ QFileInfo#suffix(6ef7b6c27b00b43d).(); |
| 707 | QStringListcxx . . $ QStringList# lignes = lignesFichiercxx . . $ Lemmat#lignesFichier(327870d3b2cb3fa6).(_resDircxx . . $ Lemmat#_resDir. +cxx . . $ operator+(fab9b4f80031f353). nfl); |
| 708 | // lire le nom de la langue |
| 709 | QStringcxx . . $ QString# lang = lignes.takeFirstcxx . . $ QList#takeFirst(5f357b03ed472e5e).(); |
| 710 | lang =cxx . . $ QString#`operator=`(4f35bf974e7f8568). lang.midcxx . . $ QString#mid(44b7563da18aea72).(1); |
| 711 | _ciblescxx . . $ Lemmat#_cibles.[cxx . . $ QMap#`operator[]`(bbd415b616967878).suff] =cxx . . $ QString#`operator=`(b79fde0b0ce9b948). lang; |
| 712 | foreachcxx . . $ `<external>/15045578679651060896/qglobal.h:1145:13`!(QString lin, lignes) |
| 713 | { |
| 714 | Lemmecxx . . $ Lemme# *l = lemmecxx . . $ Lemmat#lemme(232dd0184078fd95).(Chcxx . . $ Ch/::deramisecxx . . $ Ch/deramise(f7f320d754b8fd09).(lin.sectioncxx . . $ QString#section(6e922cf609fb9683).(':'cxx . . $ QChar#QChar(f349c77f591a7878)., 0, 0))); |
| 715 | if (l != 0) l->ajTradcxx . . $ Lemme#ajTrad(3458fe3960d5051).(lin.sectioncxx . . $ QString#section(6e922cf609fb9683).(':'cxx . . $ QChar#QChar(f349c77f591a7878)., 1), suffcxx . . $ QString#QString(132dd6869045752b).); |
| 716 | #ifdef DEBOG |
| 717 | else |
| 718 | std::cerr << "traduction, erreur dans la ligne" << lin |
| 719 | << "\n clé" << Ch::deramise(lin.section(':', 0, 0)); |
| 720 | #endif |
| 721 | } |
| 722 | } |
| 723 | } |
| 724 | |
| 725 | /** |
| 726 | * \fn Modele * Lemmat::modele (QString m) |
| 727 | * \brief Renvoie l'objet de la classe Modele dont le nom est m. |
| 728 | */ |
| 729 | Modelecxx . . $ Modele# *Lemmatcxx . . $ Lemmat#::modelecxx . . $ Lemmat#modele(8a17f6f53c814648).(QStringcxx . . $ QString# m) { return _modelescxx . . $ Lemmat#_modeles.[cxx . . $ QMap#`operator[]`(bbd415b616967878).m]; } |
| 730 | /** |
| 731 | * \fn QString Lemmat::morpho (int m) |
| 732 | * \brief Renvoie la chaîne de rang m dans la liste des morphologies |
| 733 | * donnée par le fichier data/morphos.la |
| 734 | */ |
| 735 | QStringcxx . . $ QString# Lemmatcxx . . $ Lemmat#::morphocxx . . $ Lemmat#morpho(ce915ed341d4a7f0).(int m) |
| 736 | { |
| 737 | if (m < 0 || m >= _morphoscxx . . $ Lemmat#_morphos..countcxx . . $ QList#count(455f465bc33b4cdf).()+1) return "morpho, erreur d'indice"cxx . . $ QString#QString(85c52e162fed56f9).; |
| 738 | //if (m == _morphos.count() - 1) return "-"; |
| 739 | return _morphoscxx . . $ QString#QString(132dd6869045752b)..atcxx . . $ QList#at(e2681f9bb6b2f357).(m - 1); |
| 740 | } |
| 741 | |
| 742 | /** |
| 743 | * \fn void Lemmat::posCf() |
| 744 | * \brief récupère les entrées cf. pos des entrées renvoyées |
| 745 | */ |
| 746 | void Lemmatcxx . . $ Lemmat#::posCfcxx . . $ Lemmat#posCf(49f6e7a06ebc5aa8).() |
| 747 | { |
| 748 | foreachcxx . . $ `<external>/15045578679651060896/qglobal.h:1145:13`! (Lemme *l, _lemmes) |
| 749 | { |
| 750 | if (!l->renvoicxx . . $ Lemme#renvoi(4365c3963150523e).().isEmptycxx . . $ QString#isEmpty(50ce9a9e25b4a850).()) |
| 751 | { |
| 752 | Lemmecxx . . $ Lemme# *lr = lemmecxx . . $ Lemmat#lemme(232dd0184078fd95).(l->renvoicxx . . $ Lemme#renvoi(4365c3963150523e).()); |
| 753 | if (lr != 0) |
| 754 | { |
| 755 | l->setPoscxx . . $ Lemme#setPos(7df51288a9ebd664).(lr->poscxx . . $ Lemme#pos(4365c3963150523e).()); |
| 756 | l->ajTradcxx . . $ Lemme#ajTrad(3458fe3960d5051).(lr->traductioncxx . . $ Lemme#traduction(f7f320d754b8fd09).("fr"cxx . . $ QString#QString(85c52e162fed56f9).), "fr"cxx . . $ QString#QString(85c52e162fed56f9).); |
| 757 | } |
| 758 | } |
| 759 | } |
| 760 | } |
| 761 | |
| 762 | QStringcxx . . $ QString# Lemmatcxx . . $ Lemmat#::posStringcxx . . $ Lemmat#posString(6ea5eb906e411b01).(QCharcxx . . $ QChar# p) |
| 763 | { |
| 764 | return mapPoscxx . . $ Lemmat#mapPos..keycxx . . $ QMap#key(dd8c0696c30c0a31).(p,"n."cxx . . $ QString#QString(85c52e162fed56f9).); |
| 765 | } |
| 766 | |
| 767 | /** |
| 768 | * \fn QString Lemmat::variable (QString v) |
| 769 | * \brief permet de remplacer la métavariable v |
| 770 | * par son contenu. Ces métavariables sont |
| 771 | * utilisées par le fichier modeles.la, pour |
| 772 | * éviter de répéter des suites de désinences. |
| 773 | * Elles sont repérées comme en PHP, par leur |
| 774 | * premier caractère $. |
| 775 | */ |
| 776 | QStringcxx . . $ QString# Lemmatcxx . . $ Lemmat#::variablecxx . . $ Lemmat#variable(f7f320d754b8fd09).(QStringcxx . . $ QString# v) |
| 777 | { |
| 778 | return _variablescxx . . $ QString#QString(132dd6869045752b).[cxx . . $ QMap#`operator[]`(bbd415b616967878).v]; |
| 779 | } |