Go to the documentation of this file.00001
00002
00003
00004
00005 #ifndef __GRAPHMAT_DICTS_H
00006 #define __GRAPHMAT_DICTS_H
00007
00008 #include "graline.h"
00009 #include "abbrev.h"
00010 #include "../common/util_classes.h"
00011
00012
00013 const int MaxSpaceWordLen = 100;
00014
00015 const size_t MaxNameSize = 100;
00016
00017 class CEnglishName {
00018 public:
00019
00020 char name[MaxNameSize];
00021
00022
00023
00024
00025
00026
00027
00028 };
00029
00030 struct EnglishNameLess
00031 {
00032 bool operator () (const CEnglishName& X1, const char* X2) const
00033 {
00034 return strcmp(X1.name,X2) < 0;
00035 };
00036 bool operator () (const char* X1, const CEnglishName& X2) const
00037 {
00038 return strcmp(X1,X2.name) < 0;
00039 };
00040 bool operator () (const CEnglishName& X1, const CEnglishName& X2) const
00041 {
00042 return strcmp(X1.name,X2.name) < 0;
00043 };
00044 };
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056 class CGraphanDicts {
00057 public:
00058
00059 MorphLanguageEnum m_Language;
00060
00061 CGraphanDicts(MorphLanguageEnum Language);
00062 ~CGraphanDicts();
00063 void FreeData();
00064
00065
00066
00067 struct CSpacedWord
00068 {
00069 char m_SpacedWord[MaxSpaceWordLen];
00070 int m_SpacedWordLen;
00071 };
00072 vector<CSpacedWord> m_Spaces;
00073 bool ReadSpaces (string FileName);
00074 const char* SearchSpace (const char *In ,int *len ) const;
00075
00076
00077
00078
00079
00080 StringVector m_Idents[256];
00081 bool FindInIdents (const char* s, BYTE& ResultLen) const;
00082 bool ReadIdents (string FileName);
00083
00084
00085
00086 vector<CEnglishName> m_EnglishNames;
00087 bool ReadENames (string FileName);
00088
00089
00090 mutable _share_pointer_t<CDictionary*> m_pOborDic;
00091 const CDictionary* GetOborDic() const
00092 {
00093 return m_pOborDic.m_Pointer;
00094 };
00095
00096 void SetOborDic(CDictionary* Dic)
00097 {
00098 m_pOborDic.SetPointer(Dic, false );
00099 };
00100
00101
00102 map<WORD, vector<WORD> > m_OborottosFirstWordIndex;
00103 vector<CGraphemOborot> m_Oborottos;
00104 StringVector m_OborotTokens;
00105
00106
00107
00108
00109 void BuildOborot (const string& s, int OborotNo,bool bFixedFet);
00110 void BuildOborottos ();
00111
00112 vector<CAbbrev> m_Abbrevs;
00113 bool ReadAbbrevations();
00114
00115
00116
00117 StringVector m_KeyModifiers;
00118 bool IsRegisteredKeyModifier(const char* Str, size_t Len) const;
00119
00120 StringVector m_Keys;
00121 bool ReadKeyboard(string FileName);
00122
00123
00124 StringVector m_Extensions;
00125 bool IsExtension(const char * UpperStr, BYTE Len) const;
00126 bool ReadExtensions(string FileName);
00127
00128
00129
00130 };
00131
00132
00133
00134 #endif