00001
00002
00003
00004
00005 #ifndef __RUSGRAMTAB_H_
00006 #define __RUSGRAMTAB_H_
00007
00008
00009 #include "agramtab_.h"
00010 #include "rus_consts.h"
00011
00013
00014 const unsigned int StartUp = 0xC0E0;
00015 const unsigned int EndUp = 0x10000;
00016 const unsigned int MaxGrmCount = EndUp -StartUp;
00017 const BYTE rPartOfSpeechCount = 22;
00018
00019 const char rPartOfSpeeches[rPartOfSpeechCount][20] =
00020 { "С",
00021 "П",
00022 "Г",
00023 "МС",
00024 "МС-П",
00025 "МС-ПРЕДК",
00026 "ЧИСЛ",
00027 "ЧИСЛ-П",
00028 "Н",
00029 "ПРЕДК",
00030 "ПРЕДЛ",
00031 "ПОСЛ",
00032 "СОЮЗ",
00033 "МЕЖД",
00034 "ВВОДН",
00035 "ФРАЗ",
00036 "ЧАСТ",
00037 "КР_ПРИЛ",
00038 "ПРИЧАСТИЕ",
00039 "ДЕЕПРИЧАСТИЕ",
00040 "КР_ПРИЧАСТИЕ",
00041 "ИНФИНИТИВ"
00042 };
00043
00044 const short GrammemsCount = 52;
00045 const char Grammems[GrammemsCount][10] = {
00046
00047 "мн","ед",
00048
00049 "им","рд","дт","вн","тв","пр","зв",
00050
00051 "мр","жр","ср","мр-жр",
00052
00053 "нст","буд","прш",
00054
00055 "1л","2л","3л",
00056
00057 "пвл",
00058
00059 "од","но",
00060
00061 "сравн",
00062
00063 "св","нс",
00064
00065 "нп","пе",
00066
00067 "дст","стр",
00068
00069 "0", "аббр", "отч",
00070
00071 "лок", "орг",
00072
00073 "кач", "дфст",
00074
00075 "вопр", "указат",
00076
00077 "имя","фам",
00078
00079 "безл",
00080
00081 "жарг", "опч",
00082
00083 "разг", "притяж", "арх",
00084
00085 "2",
00086 "поэт", "проф",
00087 "прев", "полож"
00088 };
00089
00090
00091
00092
00093 const int rClauseTypesCount = 12;
00094 const char rClauseTypes [rClauseTypesCount][30] =
00095 {
00096 "ГЛ_ЛИЧН",
00097 "ДПР",
00098 "КР_ПРЧ",
00099 "КР_ПРИЛ",
00100 "ПРЕДК",
00101 "ПРЧ",
00102 "ИНФ",
00103 "ВВОД",
00104 "ТИРЕ",
00105 "НСО",
00106 "СРАВН",
00107 "КОПУЛ"
00108 };
00109
00110
00111
00112
00113 class CRusGramTab : public CAgramtab{
00114 public:
00115 CAgramtabLine* Lines[MaxGrmCount];
00116 CRusGramTab();
00117 ~CRusGramTab();
00118
00119 BYTE GetPartOfSpeechesCount () const;
00120 const char* GetPartOfSpeechStr(BYTE i) const;
00121 size_t GetGrammemsCount() const;
00122 const char* GetGrammemStr(size_t i) const;
00123 size_t GetMaxGrmCount() const;
00124 CAgramtabLine*& GetLine(size_t LineNo);
00125 const CAgramtabLine* GetLine(size_t LineNo) const;
00126 size_t s2i(const char * s ) const;
00127 string i2s(WORD i) const;
00128
00129 bool ProcessPOSAndGrammems (const char* tab_str, BYTE& PartOfSpeech, QWORD& grammems) const;
00130 const char* GetRegistryString() const;
00131
00132 bool GleicheCase(const char* gram_code_noun, const char* gram_code_adj) const;
00133 bool GleicheCaseNumber(const char* gram_code1, const char* gram_code2) const;
00134 QWORD GleicheGenderNumberCase(const char* common_gram_code_noun, const char* gram_code_noun, const char* gram_code_adj) const;
00135
00136 bool GleicheGenderNumber(const char* gram_code1, const char* gram_code2) const;
00137 bool GleicheSubjectPredicate(const char* gram_code1, const char* gram_code2) const;
00138 long GetClauseTypeByName(const char* TypeName) const;
00139
00140 const char* GetClauseNameByType(long type) const;
00141 const size_t GetClauseTypesCount() const;
00142
00143 bool IsStrongClauseRoot(const DWORD Poses) const;
00144 bool is_month (const char* lemma) const;
00145 bool is_small_number (const char* lemma) const;
00146 bool IsMorphNoun (size_t Poses) const;
00147 bool is_morph_adj (size_t poses) const;
00148 bool is_morph_participle (size_t poses) const;
00149 bool is_morph_pronoun (size_t poses) const;
00150 bool is_morph_pronoun_adjective(size_t poses) const;
00151 bool is_left_noun_modifier (size_t poses, QWORD grammems) const;
00152 bool is_numeral (size_t poses) const;
00153 bool is_verb_form (size_t poses) const;
00154 bool is_infinitive(size_t poses) const;
00155 bool is_morph_predk(size_t poses) const;
00156 bool is_morph_adv(size_t poses) const;
00157 bool is_morph_article(size_t poses) const;
00158 bool is_morph_personal_pronoun (size_t poses, QWORD grammems) const;
00159 bool IsSimpleParticle(const char* lemma, size_t poses) const;
00160 bool IsSynNoun(size_t Poses, const char* Lemma) const;
00161 bool IsStandardParamAbbr (const char* WordStrUpper) const;
00162
00163 };
00164
00165 extern bool GenderNumberCaseRussian (const CAgramtabLine* l1, const CAgramtabLine* l2);
00166 extern bool FiniteFormCoordRussian (const CAgramtabLine* l1, const CAgramtabLine* l2);
00167
00168 #endif //__RUSGRAMTAB_H_