1 /***************************************************************************
5 manage grammer parts (articles, conjugation)
7 -----------------------------------------------------------------------
9 begin : Sat Nov 27 09:50:53 MET 1999
11 copyright : (C) 1999-2001 Ewald Arnold
12 (C) 2001 The KDE-EDU team
13 email : kvoctrain@ewald-arnold.de
15 -----------------------------------------------------------------------
17 ***************************************************************************/
19 /***************************************************************************
21 * This program is free software; you can redistribute it and/or modify *
22 * it under the terms of the GNU General Public License as published by *
23 * the Free Software Foundation; either version 2 of the License, or *
24 * (at your option) any later version. *
26 ***************************************************************************/
29 #ifndef GrammerManager_included
30 #define GrammerManager_included
32 #include <qdatastream.h>
37 #define CONJ_SIMPLE_PRESENT "PrSi" // I live at home what you frequently do
38 #define CONJ_PRESENT_PROGR "PrPr" // I am working what you currently are doing
39 #define CONJ_PRESENT_PERFECT "PrPe" // I have cleaned tell, #that# something has happened
41 #define CONJ_SIMPLE_PAST "PaSi" // the train left 2 min ago when did it happen
42 #define CONJ_PAST_PROGR "PaPr" // it was raining what happen at a given time in the past
43 #define CONJ_PAST_PARTICIPLE "PaPa" // I cleaned tell, #that# it happened
45 #define CONJ_FUTURE "FuSi"
47 #define CONJ_PREFIX "--" // definition of prefixes (I, you, ..)
49 #define UL_USER_TENSE "#" // designates number of user tense
59 const QString
&fem_def
, const QString
&fem_indef
,
60 const QString
&mal_def
, const QString
&mal_indef
,
61 const QString
&nat_def
, const QString
&nat_indef
64 void setFemale (const QString
&def
, const QString
&indef
);
65 void setMale (const QString
&def
, const QString
&indef
);
66 void setNatural (const QString
&def
, const QString
&indef
);
68 void female (QString
&def
, QString
&indef
) const;
69 void male (QString
&def
, QString
&indef
) const;
70 void natural (QString
&def
, QString
&indef
) const;
74 QString fem_def
, fem_indef
,
93 void setL1 (const QString
&s
) { ls1
= s
; }
94 void setL2 (const QString
&s
) { ls2
= s
; }
95 void setL3 (const QString
&s
) { ls3
= s
; }
97 QString
l1 () const { return ls1
; }
98 QString
l2 () const { return ls2
; }
99 QString
l3 () const { return ls3
; }
101 bool isEmpty() const;
106 QString ls1
, ls2
, ls3
;
114 TenseRelation (const QString
& _short
, const QString
& _long
)
115 : shortId (_short
), longId(_long
) {}
117 inline QString
shortStr() const { return shortId
; }
118 inline QString
longStr() const { return longId
; }
122 QString shortId
, longId
;
133 int numEntries() const;
135 static vector
<TenseRelation
> getRelation ();
136 static void setTenseNames (vector
<QString
> names
);
138 static QString
getName (const QString
&abbrev
);
139 static QString
getName (int index
);
140 static QString
getAbbrev (const QString
&name
);
141 static QString
getAbbrev (int index
);
142 static int numInternalNames();
143 static int numTenses();
145 QString
getType (int index
);
146 void setType (int index
, const QString
& type
);
148 bool isEmpty (int idx
);
150 QString
pers1Singular(const QString
&type
) const;
151 QString
pers2Singular(const QString
&type
) const;
152 bool pers3SingularCommon(const QString
&type
) const;
153 QString
pers3FemaleSingular(const QString
&type
) const;
154 QString
pers3MaleSingular(const QString
&type
) const;
155 QString
pers3NaturalSingular(const QString
&type
) const;
157 QString
pers1Plural(const QString
&type
) const;
158 QString
pers2Plural(const QString
&type
) const;
159 bool pers3PluralCommon(const QString
&type
) const;
160 QString
pers3FemalePlural(const QString
&type
) const;
161 QString
pers3MalePlural(const QString
&type
) const;
162 QString
pers3NaturalPlural(const QString
&type
) const;
164 void setPers1Singular(const QString
&type
, const QString
&str
);
165 void setPers2Singular(const QString
&type
, const QString
&str
);
166 void setPers3SingularCommon(const QString
&type
, bool f
);
167 void setPers3FemaleSingular(const QString
&type
, const QString
&str
);
168 void setPers3MaleSingular(const QString
&type
, const QString
&str
);
169 void setPers3NaturalSingular(const QString
&type
, const QString
&str
);
171 void setPers1Plural(const QString
&type
, const QString
&str
);
172 void setPers2Plural(const QString
&type
, const QString
&str
);
173 void setPers3PluralCommon(const QString
&type
, bool f
);
174 void setPers3FemalePlural(const QString
&type
, const QString
&str
);
175 void setPers3MalePlural(const QString
&type
, const QString
&str
);
176 void setPers3NaturalPlural(const QString
&type
, const QString
&str
);
202 struct conjug_name_t
{
209 vector
<conjug_t
> conjugations
;
211 static conjug_name_t names
[];
212 static vector
<QString
> userTenses
;
216 #endif // GrammerManager_included