]> Git trees. - libqmvoc.git/commitdiff
Remove irregular plural tags in favour of a real declination class (not used currentl...
authorFrederik Gladhorn <gladhorn@kde.org>
Thu, 20 Sep 2007 12:15:35 +0000 (12:15 +0000)
committerFrederik Gladhorn <gladhorn@kde.org>
Thu, 20 Sep 2007 12:15:35 +0000 (12:15 +0000)
svn path=/trunk/KDE/kdeedu/libkdeedu/; revision=714727

keduvocdocument/CMakeLists.txt
keduvocdocument/keduvocdeclination.cpp [new file with mode: 0644]
keduvocdocument/keduvocdeclination.h [new file with mode: 0644]
keduvocdocument/keduvocgrammar.h
keduvocdocument/keduvoctranslation.cpp

index 28bd198cc990bd2ee8d0c3f860668a6e78249af1..b9474aa6140e0c29681ae2056c25bc5b90c0065b 100644 (file)
@@ -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 (file)
index 0000000..3ee70cd
--- /dev/null
@@ -0,0 +1,66 @@
+/***************************************************************************
+
+    C++ Implementation: keduvocdeclination
+
+    -----------------------------------------------------------------------
+
+    begin         : Do Sep 20 2007
+
+    copyright     : (C) 2007 Frederik Gladhorn <frederik.gladhorn@kdemail.net>
+
+    -----------------------------------------------------------------------
+
+ ***************************************************************************/
+
+/***************************************************************************
+ *                                                                         *
+ *   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 <QtCore/QStringList>
+
+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 (file)
index 0000000..d49f316
--- /dev/null
@@ -0,0 +1,87 @@
+/***************************************************************************
+
+    C++ Interface: keduvocdeclination
+
+    -----------------------------------------------------------------------
+
+    begin         : Do Sep 20 2007
+
+    copyright     : (C) 2007 Frederik Gladhorn <frederik.gladhorn@kdemail.net>
+
+    -----------------------------------------------------------------------
+
+ ***************************************************************************/
+
+/***************************************************************************
+ *                                                                         *
+ *   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 <frederik.gladhorn@kdemail.net>
+*/
+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
index 69e47621a95fabe953a8b52a22c2a418351fa9e3..efa7248ee64470d38e67380ac0dfa5640dfc8f4c 100644 (file)
@@ -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
      */
index 2580c0ab74dc8464e306f848e28df766a13846a3..2d21f346cf979a41f4cc1ac10921018e10c7e8c5 100644 (file)
 #include <KDebug>
 
 #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<QString> 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 <QString, KEduVocConjugation> 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()
 {