00001
00002
00003
00004
00005 #ifndef __GERGRAMTAB_H_
00006 #define __GERGRAMTAB_H_
00007
00008
00009 #include "agramtab_.h"
00010 #include "ger_consts.h"
00011
00012
00014
00015 const unsigned int gStartUp = 0x4141;
00016 const unsigned int gEndUp = 0x7A7B;
00017 const unsigned int gMaxGrmCount = gEndUp -gStartUp;
00018
00019 const BYTE gPartOfSpeechesCount = 17;
00020
00021 const char gPartOfSpeeches[gPartOfSpeechesCount][20] = {
00022 "ART",
00023 "ADJ",
00024 "ADV",
00025 "EIG",
00026 "SUB",
00027 "VER",
00028 "PA1",
00029 "PA2",
00030 "PRO",
00031 "PRP",
00032 "KON",
00033 "NEG",
00034 "INJ",
00035 "ZAL",
00036 "ZUS",
00037 "PROBEG",
00038 "INF"
00039 };
00040 const short gGrammemsCount = 62;
00041 const char gGrammems[gGrammemsCount][10] = {
00042
00043
00044 "noa",
00045 "prd",
00046 "pro",
00047 "tmp",
00048
00049
00050
00051 "nac","mou","cou","geo","wat","geb","std","lok","vor",
00052
00053
00054 "sich-akk","sich-dat",
00055
00056
00057 "sft","non","mod","aux",
00058
00059
00060 "kj1","kj2","pa1","pa2","eiz","imp","prt","prae",
00061
00062
00063 "gru","kom","sup",
00064
00065
00066 "pri","inf","vgl","neb","unt",
00067
00068
00069
00070 "per","dem","inr","pos","ref","rin","alg",
00071
00072
00073 "sol","ind","def",
00074
00075
00076 "1", "2", "3",
00077
00078
00079 "fem","mas","neu",
00080
00081
00082
00083 "plu","sin",
00084
00085
00086 "nom","gen","dat","akk",
00087
00088
00089 "abbr",
00090
00091
00092 "ew",
00093
00094
00095 "trans", "intra", "imper"
00096
00097
00098 };
00099
00100
00101 const int gClauseTypesCount = 3;
00102 const char gClauseTypes [gClauseTypesCount][30] =
00103 {
00104 "VERBSATZ", "PARTIZIPIALSATZ", "INFINITIVSATZ"
00105 };
00106
00107
00108
00109
00110
00111 class CGerGramTab : public CAgramtab
00112 {
00113 public:
00114 CAgramtabLine* Lines[gMaxGrmCount];
00115 CGerGramTab();
00116 ~CGerGramTab();
00117
00118 BYTE GetPartOfSpeechesCount () const {return gPartOfSpeechesCount;};
00119 const char* GetPartOfSpeechStr(BYTE i) const {return gPartOfSpeeches[i];};
00120 size_t GetGrammemsCount() const{return gGrammemsCount;};
00121 const char* GetGrammemStr(size_t i) const{return gGrammems[i];};
00122 size_t GetMaxGrmCount() const{return gMaxGrmCount;};
00123 CAgramtabLine*& GetLine(size_t LineNo) {return Lines[LineNo];}
00124 const CAgramtabLine* GetLine(size_t LineNo) const {return Lines[LineNo];}
00125 size_t s2i(const char * s ) const { return (unsigned char) s[0]*0x100+(unsigned char) s[1] - gStartUp;};
00126
00127 string i2s(WORD i) const
00128 {
00129 i += gStartUp;
00130 char res[3];
00131
00132 res[0] = (i >> 8);
00133 res[1] = (0xFF & i);
00134 res[2] = 0;
00135 return res;
00136 };
00137 int GetGroupTypebyName(const char* TypeName) const;
00138
00139
00140
00141 const char* GetRegistryString() const
00142 {
00143 return "Software\\Dialing\\Lemmatizer\\German\\Ggramtab";
00144 };
00145
00146 long GetClauseTypeByName(const char* TypeName) const;
00147 const char* GetClauseNameByType(long type) const;
00148 bool GleicheGenderNumber(const char* gram_code1, const char* gram_code2) const;
00149 bool GleicheSubjectPredicate(const char* gram_code1, const char* gram_code2) const;
00150 const size_t GetClauseTypesCount() const
00151 {
00152 return gClauseTypesCount;
00153 };
00154 bool IsStrongClauseRoot(const DWORD Poses) const;
00155 bool is_month (const char* lemma) const;
00156 bool is_small_number (const char* lemma) const;
00157 bool IsMorphNoun (size_t Poses) const;
00158 bool is_morph_adj (size_t poses) const;
00159 bool is_morph_participle (size_t poses) const;
00160 bool is_morph_pronoun (size_t poses) const;
00161 bool is_morph_pronoun_adjective(size_t poses) const;
00162 bool is_left_noun_modifier (size_t poses, QWORD grammems) const;
00163 bool is_numeral (size_t poses) const;
00164 bool is_verb_form (size_t poses) const;
00165 bool is_infinitive(size_t poses) const;
00166 bool is_morph_predk(size_t poses) const;
00167 bool is_morph_adv(size_t poses) const;
00168 bool is_morph_personal_pronoun (size_t poses, QWORD grammems) const;
00169 bool is_morph_article(size_t poses) const;
00170
00171 bool IsSimpleParticle(const char* lemma, size_t poses) const;
00172 bool IsSynNoun(size_t Poses, const char* Lemma) const;
00173 bool IsStandardParamAbbr (const char* WordStrUpper) const;
00174 bool GleicheCase(const char* gram_code_noun, const char* gram_code_adj) const;
00175 bool GleicheCaseNumber(const char* gram_code1, const char* gram_code2) const;
00176 QWORD GleicheGenderNumberCase(const char* common_gram_code_noun, const char* gram_code_noun, const char* gram_code_adj) const;
00177
00178 };
00179
00180
00181
00182 const QWORD gBestimtheit = ( _QM(gAdjektiveOhneArtikel) | _QM(gAdjektiveMitUnbestimmte) | _QM(gAdjektiveMitBestimmte));
00183 const QWORD gAllCases = (_QM(gNominativ) | _QM(gGenitiv) | _QM(gDativ) | _QM(gAkkusativ));
00184 const QWORD gAllNumbers = ( _QM(gPlural) | _QM(gSingular) );
00185 const QWORD gAllGenders = ( _QM(gFeminin) | _QM(gMaskulin) | _QM(gNeutrum));
00186 const QWORD gAllPersons = ( _QM(gErstePerson) | _QM(gZweitePerson) | _QM(gDrittePerson));
00187 const QWORD gAllVerbForms = ( _QM(gKonj1) | _QM(gKonj2) | _QM(gImperativ)| _QM(gPrasens)| _QM(gPraeteritum));
00188 const QWORD gAllVerbClasses = ( _QM(gModal) | _QM(gAuxiliar) | _QM(gSchwach)| _QM(gNichtSchwach));
00189
00190
00191
00192
00193
00194
00195 #endif //__GERGRAMTAB_H_