ddc
GraphanDicts.h
Go to the documentation of this file.
1 //
2 // This file is part of DDC.
3 //
4 // DDC is free software: you can redistribute it and/or modify
5 // it under the terms of the GNU Lesser General Public License as published by
6 // the Free Software Foundation, either version 3 of the License, or
7 // (at your option) any later version.
8 //
9 // DDC is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU Lesser General Public License for more details.
13 //
14 // You should have received a copy of the GNU Lesser General Public License
15 // along with DDC. If not, see <http://www.gnu.org/licenses/>.
16 //
17 // ========== Dialing Graphematical Module (www.aot.ru)
18 // ========== Copyright by Alexey Sokirko (1996-2001), Bryan Jurish (2011)
19 
20 #ifndef __GRAPHMAT_DICTS_H
21 #define __GRAPHMAT_DICTS_H
22 
23 #include "graline.h"
24 #include "abbrev.h"
25 #include "../CommonLib/util_classes.h"
26 
27 
28 const int MaxSpaceWordLen = 100;
29 
30 const size_t MaxNameSize = 100;
31 
32 class CEnglishName {
33 public:
34 
36 
37  //bool operator==(const CEnglishName& X) const
38  //{ return strcmp (name, X.name) == 0;};
39 
40  //bool operator<(const CEnglishName& X) const
41  //{ return strcmp (name, X.name) < 0;};
42 
43 };
44 
46 {
47  bool operator () (const CEnglishName& X1, const char* X2) const
48  {
49  return strcmp(X1.name,X2) < 0;
50  };
51  bool operator () (const char* X1, const CEnglishName& X2) const
52  {
53  return strcmp(X1,X2.name) < 0;
54  };
55  bool operator () (const CEnglishName& X1, const CEnglishName& X2) const
56  {
57  return strcmp(X1.name,X2.name) < 0;
58  };
59 };
60 //inline bool EnglishNameLess (const CEnglishName& _Y, const char* X)
61 //{
62 // return strcmp (_Y.name, X) < 0;
63 //};
64 
65 
66 
67 
68 
69 
70 
72 public:
73 
75 
77  ~CGraphanDicts();
78 
79 
80 
81  struct CSpacedWord
82  {
83  char m_SpacedWord[MaxSpaceWordLen];
85  };
86  vector<CSpacedWord> m_Spaces;
87  bool ReadSpaces (string FileName);
88  const char* SearchSpace (const char *In ,int *len ) const;
89 
90 
91 
92  // ������������� - ��� ���-��, ��� �������� � ���� ���� ����������, �� �������� ����� ������
93  // ���� C++, TCP/IP.
94  StringVector m_Idents[256];
95  bool FindInIdents (const char* s, BYTE& ResultLen) const;
96  bool ReadIdents (string FileName);
97 
98 
99  // John, Bill
100  vector<CEnglishName> m_EnglishNames;
101  bool ReadENames (string FileName);
102 
103 
105  const CDictionary* GetOborDic() const
106  {
107  return m_pOborDic.Get();
108  };
109 
110 
111 
112  map<WORD, vector<WORD> > m_OborottosFirstWordIndex;
113  vector<CGraphemOborot> m_Oborottos;
115 
116 
117 
118 
119  void BuildOborot (const string& s, int OborotNo);
120  void BuildOborottos ();
121 
122  vector<CAbbrev> m_Abbrevs;
123  bool ReadAbbrevations();
124 
125 
126 
128  bool IsRegisteredKeyModifier(const char* Str, size_t Len) const;
129 
131  bool ReadKeyboard(string FileName);
132 
133 
135  bool IsExtension(const char * UpperStr, BYTE Len) const;
136  bool ReadExtensions(string FileName);
137 
138 
139 
140 };
141 
142 
143 
144 #endif
145 
146 /*--- emacs style variables ---
147  * Local Variables:
148  * mode: C++
149  * c-file-style: "ellemtel"
150  * c-basic-offset: 4
151  * tab-width: 8
152  * indent-tabs-mode: nil
153  * End:
154  */
StringVector m_OborotTokens
Definition: GraphanDicts.h:114
const size_t MaxNameSize
Definition: GraphanDicts.h:30
const int MaxSpaceWordLen
Definition: GraphanDicts.h:28
PtrHolder< CDictionary > m_pOborDic
Definition: GraphanDicts.h:104
vector< CGraphemOborot > m_Oborottos
Definition: GraphanDicts.h:113
char name[MaxNameSize]
Definition: GraphanDicts.h:35
const CDictionary * GetOborDic() const
Definition: GraphanDicts.h:105
T * Get() const
Definition: ptrholder.h:50
Definition: GraphanDicts.h:45
map< WORD, vector< WORD > > m_OborottosFirstWordIndex
Definition: GraphanDicts.h:108
Definition: GraphanDicts.h:81
vector< CSpacedWord > m_Spaces
Definition: GraphanDicts.h:86
vector< CEnglishName > m_EnglishNames
Definition: GraphanDicts.h:100
vector< string > StringVector
Definition: utilit.h:146
Definition: GraphanDicts.h:71
MorphLanguageEnum m_Language
Definition: GraphanDicts.h:74
unsigned char BYTE
Definition: utilit.h:94
int m_SpacedWordLen
Definition: GraphanDicts.h:84
StringVector m_Extensions
Definition: GraphanDicts.h:134
MorphLanguageEnum
Definition: utilit.h:162
Definition: GraphanDicts.h:32
StringVector m_Keys
Definition: GraphanDicts.h:130
Definition: Ross.h:243
vector< CAbbrev > m_Abbrevs
Definition: GraphanDicts.h:122
StringVector m_KeyModifiers
Definition: GraphanDicts.h:127