| 1 | /* irregs.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 | // TODO |
| 23 | // déclinaison interne : jusjurandum, respublica, unusquisque |
| 24 | // autre cas : paterfamilias |
| 25 | // génération des irréguliers |
| 26 | // |
| 27 | |
| 28 | #include "irregs.h" |
| 29 | #include <QStringList> |
| 30 | #include "ch.h" |
| 31 | #include "lemme.h" |
| 32 | #include "modele.h" |
| 33 | |
| 34 | #include <QDebug> |
| 35 | |
| 36 | /** |
| 37 | * \fn Irreg::Irreg (QString l, QObject *parent) |
| 38 | * \brief Constructeur de la classe Irreg. l est la |
| 39 | * clé du lemme dans la map des lemmes du |
| 40 | * lemmatiseur (classe Lemmat) représenté par |
| 41 | * le paramètre *parent. |
| 42 | */ |
| 43 | Irreg::Irreg(QString l, QObject* parent) |
| 44 | { |
| 45 | if (parent != 0) _lemmat = qobject_cast<Lemmat*>(parent); |
| 46 | QStringList ecl = l.split(':'); |
| 47 | _grq = ecl.at(0); |
| 48 | if (_grq.endsWith("*")) |
| 49 | { |
| 50 | _grq.chop(1); |
| 51 | _exclusif = true; |
| 52 | } |
| 53 | else |
| 54 | _exclusif = false; |
| 55 | _gr = Ch::atone(_grq); |
| 56 | _lemme = _lemmat->lemme(ecl.at(1)); |
| 57 | _morphos = Modele::listeI(ecl.at(2)); |
| 58 | } |
| 59 | |
| 60 | /** |
| 61 | * \fn bool Irreg::exclusif () |
| 62 | * \brief True si le lemmes est exclusif, c'est à dire |
| 63 | * si la forme régulière calculée par le modèle |
| 64 | * est inusitée, et remplace par la forme irrégulière. |
| 65 | */ |
| 66 | bool Irreg::exclusif() { return _exclusif; } |
| 67 | /** |
| 68 | * \fn QString Irreg::gr () |
| 69 | * \brief Graphie ramiste sans diacritique. |
| 70 | */ |
| 71 | QString Irreg::gr() { return _gr; } |
| 72 | /** |
| 73 | * \fn QString Irreg::grq () |
| 74 | * \brief Graphie ramiset avec diacritiques. |
| 75 | */ |
| 76 | QString Irreg::grq() { return _grq; } |
| 77 | /** |
| 78 | * \fn Lemme* Irreg::lemme () |
| 79 | * \brief Le lemme de l'irrégulier. |
| 80 | */ |
| 81 | Lemme* Irreg::lemme() { return _lemme; } |
| 82 | /** |
| 83 | * \fn QList<int> Irreg::morphos () |
| 84 | * \brief liste des numéros de morphos |
| 85 | * que peut prendre l'irrégulier, en |
| 86 | * tenant compte des quantités. |
| 87 | */ |
| 88 | QList<int> Irreg::morphos() { return _morphos; } |