| 1 | /* modele.h |
| 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 | #ifndef MODELE_H |
| 23 | #define MODELE_H |
| 24 | |
| 25 | #include <QList> |
| 26 | #include <QMultiMap> |
| 27 | #include <QString> |
| 28 | #include <QStringList> |
| 29 | #include <QtCore> |
| 30 | |
| 31 | class Lemmat; |
| 32 | class Modele; |
| 33 | |
| 34 | class Desinence : public QObject |
| 35 | { |
| 36 | Q_OBJECT |
| 37 | private: |
| 38 | QString _gr; |
| 39 | QString _grq; |
| 40 | int _morpho; |
| 41 | Modele *_modele; |
| 42 | int _numR; |
| 43 | int _rarete; |
| 44 | |
| 45 | public: |
| 46 | Desinence(QString d, int morph, int nr, Modele *parent = 0); |
| 47 | QString gr(); |
| 48 | QString grq(); |
| 49 | Modele *modele(); |
| 50 | int morphoNum(); |
| 51 | int numRad(); |
| 52 | }; |
| 53 | |
| 54 | class Modele : public QObject |
| 55 | { |
| 56 | Q_OBJECT |
| 57 | private: |
| 58 | QList<int> _absents; |
| 59 | QStringList static const cles; |
| 60 | QMultiMap<int, Desinence *> _desinences; |
| 61 | QMap<int, QString> _genRadicaux; |
| 62 | QString _gr; |
| 63 | QString _grq; |
| 64 | Lemmat *_lemmatiseur; |
| 65 | Modele *_pere; |
| 66 | |
| 67 | public: |
| 68 | Modele(QStringList ll, Lemmat *parent = 0); |
| 69 | QList<int> absents(); |
| 70 | QList<int> clesR(); |
| 71 | Desinence *clone(Desinence *d); |
| 72 | bool deja(int m); |
| 73 | QList<Desinence *> desinences(int d); |
| 74 | QList<Desinence *> desinences(); |
| 75 | bool estUn(QString m); |
| 76 | QString genRadical(int r); |
| 77 | QString gr(); |
| 78 | QString grq(); |
| 79 | static QList<int> listeI(QString l); |
| 80 | QList<int> morphos(); |
| 81 | QChar pos(); |
| 82 | }; |
| 83 | |
| 84 | #endif |