| 1 | /* regle.h */ |
| 2 | /* |
| 3 | * This file is part of PRAELECTOR. |
| 4 | * |
| 5 | * PRAELECTOR 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 PRAELECTOR; 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 - 2018 |
| 20 | */ |
| 21 | |
| 22 | # ifndef REGLE_H |
| 23 | # define REGLE_H |
| 24 | |
| 25 | # include <QStringList> |
| 26 | # include <modele.h> |
| 27 | # include <motflechi.h> |
| 28 | |
| 29 | class Modele; |
| 30 | class MotFlechi; |
| 31 | |
| 32 | class Regle : public QObject |
| 33 | { |
| 34 | Q_OBJECT |
| 35 | |
| 36 | private: |
| 37 | QString _accord; |
| 38 | int _antepos; |
| 39 | QString _aff; |
| 40 | int _avContig; |
| 41 | QStringList _conflits; |
| 42 | int _contig; |
| 43 | QString _doc; |
| 44 | QString _id; |
| 45 | QStringList _exclus; |
| 46 | QStringList _filtre; |
| 47 | QStringList _lemmeSub; |
| 48 | QStringList _lemmeSup; |
| 49 | bool _multi; |
| 50 | QString _subEstSup; |
| 51 | QString _supEstSub; |
| 52 | QStringList _supEstSup; |
| 53 | QStringList _lsSub; |
| 54 | QStringList _lsSup; |
| 55 | QStringList _lSubExclus; |
| 56 | QStringList _lSupExclus; |
| 57 | QStringList _morphoSub; |
| 58 | QStringList _morphoSup; |
| 59 | int _poids; |
| 60 | QString _posSub; |
| 61 | QString _posSup; |
| 62 | QChar _sens; |
| 63 | QStringList _tr; |
| 64 | |
| 65 | public: |
| 66 | Regle(QStringList ll); |
| 67 | QString accord(); |
| 68 | int antepos(); |
| 69 | QString aff(); |
| 70 | bool conflit(QString id); |
| 71 | bool compatibleSubSub(Regle* r); |
| 72 | bool compatibleSubSup(Regle* r); |
| 73 | bool compatibleSupSub(Regle* r); |
| 74 | bool compatibleSupSup(Regle* r); |
| 75 | int contig(); |
| 76 | QString doc(); |
| 77 | bool estSub(MotFlechi* mf); |
| 78 | bool estSuper(MotFlechi* mf); |
| 79 | bool exclut(QString id); |
| 80 | QString id(); |
| 81 | QStringList filtre(); |
| 82 | bool static inclus(QString a, QString b); // tous les mots de a sont dans b |
| 83 | bool static intersect(QString a, QString b); // a et b ont au moins un char commun |
| 84 | QStringList lemmeSub(); |
| 85 | QStringList lemmeSup(); |
| 86 | bool lsSub(QString l); |
| 87 | QString lsSub(int i); |
| 88 | bool lsSup(QString l); |
| 89 | QString lsSup(int i); |
| 90 | QStringList morphoSub(); |
| 91 | QStringList morphoSup(); |
| 92 | bool multi(); |
| 93 | int nbLsSub(); |
| 94 | int nbLsSup(); |
| 95 | int nbTr(); |
| 96 | int poids(); |
| 97 | QString posSub(); |
| 98 | QString posSup(); |
| 99 | QChar sens(); |
| 100 | QString subEstSup(); |
| 101 | QString supEstSub(); |
| 102 | QStringList supEstSup(); |
| 103 | bool subExclu(QString s); |
| 104 | bool supExclu(QString s); |
| 105 | QString tr(int i=0); |
| 106 | }; |
| 107 | |
| 108 | # endif |