From: Frederik Gladhorn Date: Thu, 20 Sep 2007 12:15:35 +0000 (+0000) Subject: Remove irregular plural tags in favour of a real declination class (not used currentl... X-Git-Tag: v3.94.0~33 X-Git-Url: https://git.rmz.fi/?a=commitdiff_plain;h=5b00cde73342e0fa15e0386b9544cfd51fe5211b;p=libqmvoc.git Remove irregular plural tags in favour of a real declination class (not used currently). This will also allow support for plurals and dual forms correctly. svn path=/trunk/KDE/kdeedu/libkdeedu/; revision=714727 --- diff --git a/keduvocdocument/CMakeLists.txt b/keduvocdocument/CMakeLists.txt index 28bd198..b9474aa 100644 --- a/keduvocdocument/CMakeLists.txt +++ b/keduvocdocument/CMakeLists.txt @@ -13,6 +13,7 @@ set(keduvocdocument_LIB_SRCS keduvocgrade.cpp keduvocgrammar.cpp keduvocconjugation.cpp +# keduvocdeclination.cpp keduvocwordtype.cpp keduvockvtmlreader.cpp keduvockvtml2reader.cpp diff --git a/keduvocdocument/keduvocdeclination.cpp b/keduvocdocument/keduvocdeclination.cpp new file mode 100644 index 0000000..3ee70cd --- /dev/null +++ b/keduvocdocument/keduvocdeclination.cpp @@ -0,0 +1,66 @@ +/*************************************************************************** + + C++ Implementation: keduvocdeclination + + ----------------------------------------------------------------------- + + begin : Do Sep 20 2007 + + copyright : (C) 2007 Frederik Gladhorn + + ----------------------------------------------------------------------- + + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ +#include "keduvocdeclination.h" + +#include + +class KEduVocDeclination::Private +{ +public: + struct DeclinationCase { + QStringList test; + }; + + + DeclinationGender m_gender; + + Private(); +}; + +KEduVocDeclination::Private::Private() +{ + m_gender = Undefined; +} + +KEduVocDeclination::KEduVocDeclination() + :d (new Private) +{ +} + +KEduVocDeclination::KEduVocDeclination(const KEduVocDeclination & other) + :d (new Private) +{ +} + +KEduVocDeclination & KEduVocDeclination::operator =(const KEduVocDeclination & other) +{ + d->m_gender = other.d->m_gender; +} + +KEduVocDeclination::~KEduVocDeclination() +{ + delete d; +} + + + diff --git a/keduvocdocument/keduvocdeclination.h b/keduvocdocument/keduvocdeclination.h new file mode 100644 index 0000000..d49f316 --- /dev/null +++ b/keduvocdocument/keduvocdeclination.h @@ -0,0 +1,87 @@ +/*************************************************************************** + + C++ Interface: keduvocdeclination + + ----------------------------------------------------------------------- + + begin : Do Sep 20 2007 + + copyright : (C) 2007 Frederik Gladhorn + + ----------------------------------------------------------------------- + + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ +#ifndef KEDUVOCDECLINATION_H +#define KEDUVOCDECLINATION_H + +/** +A declination contains all forms that a NOUN possibly can have. + + @author Frederik Gladhorn +*/ +class KEduVocDeclination{ +public: + enum DeclinationNumber { + Singular = 1, + Dual, + Plural + }; + + enum DeclinationGender { + Undefined, + Masculine, + Feminine, + Neuter + }; + + enum DeclinationCase { + Nominative = 1, + Genitive, + Dative, + Accusative, + Ablative, + Locative, + Vocative + }; + + + /** + * The constructor without arguments + */ + explicit KEduVocDeclination(); + + /** copy constructor + * @param other comparison object to copy + */ + KEduVocDeclination( const KEduVocDeclination &other ); + + ~KEduVocDeclination(); + + /** equality operator + * @param a object to compare to + * @returns true if comparisons are the same, false otherwise + */ +// will probably not be necessary +// bool operator == ( const KEduVocDeclination& a ) const; + + /** assignment operator for d-pointer copying + * @param other object to copy from + * @returns reference to this object + */ + KEduVocDeclination& operator= ( const KEduVocDeclination& other ); + +private: + class Private; + Private * const d; +}; + +#endif diff --git a/keduvocdocument/keduvocgrammar.h b/keduvocdocument/keduvocgrammar.h index 69e4762..efa7248 100644 --- a/keduvocdocument/keduvocgrammar.h +++ b/keduvocdocument/keduvocgrammar.h @@ -40,6 +40,24 @@ class KEDUVOCDOCUMENT_EXPORT KEduVocArticle { public: + enum ArticleNumber { + Singular, + Dual, + Plural + }; + + enum ArticleGender { + Masculine, + Feminine, + Neuter + }; + + enum ArticleDefiniteness { + Definite, + Indefinite + }; + + /** * The constructor without arguments */ diff --git a/keduvocdocument/keduvoctranslation.cpp b/keduvocdocument/keduvoctranslation.cpp index 2580c0a..2d21f34 100644 --- a/keduvocdocument/keduvoctranslation.cpp +++ b/keduvocdocument/keduvoctranslation.cpp @@ -21,14 +21,13 @@ #include #include "keduvocgrade.h" +// #include "keduvocdeclination.h" class KEduVocTranslation::KEduVocTranslationPrivate { public: /// This is the word itself. The vocabulary. This is what it is all about. QString m_translation; - /// Some languages (german) have irregular plurals. Kept here. - QString m_irregularPlural; /// Type of a word noun, verb, adjective etc QString m_type; @@ -54,12 +53,15 @@ public: QString m_soundUrl; /// Usages give a context (eg. this word is usually used in [biology]) QSet m_usages; + /// When creating multiple choice tests, these are possible answers. (otherwise other words are added randomly) + KEduVocMultipleChoice m_multipleChoice; + /// Conjugations of a word (I go, you go, he goes... boring in english) QMap m_conjugations; /// The comparison forms of adjectives and adverbs: fast, faster, fastest KEduVocComparison m_comparison; - /// When creating multiple choice tests, these are possible answers. (otherwise other words are added randomly) - KEduVocMultipleChoice m_multipleChoice; + +// KEduVocDeclination* m_declination; // Here come all int indexFrom grades. (If you want, imagine the TO grades as int indexFrom of the other translation. That is where they belong. ) // User is asked to give THIS here as answer, than the grades go here. @@ -89,7 +91,6 @@ KEduVocTranslation::KEduVocTranslation( const KEduVocTranslation &other ) : d( n d->m_subType = other.d->m_subType; d->m_usages = other.d->m_usages; d->m_comment = other.d->m_comment; - d->m_irregularPlural = other.d->m_irregularPlural; d->m_paraphrase = other.d->m_paraphrase; d->m_synonym = other.d->m_synonym; d->m_example = other.d->m_example; @@ -346,16 +347,6 @@ void KEduVocTranslation::setConjugations(const QMap< QString, KEduVocConjugation d->m_conjugations = conjugations; } -void KEduVocTranslation::setIrregularPlural(const QString & plural) -{ - d->m_irregularPlural = plural; -} - -QString KEduVocTranslation::irregularPlural() const -{ - return d->m_irregularPlural; -} - /** get the sound url for this translation if it exists */ QString KEduVocTranslation::soundUrl() {