ddc
GraphmatFile.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 __GRAPHMATFILE_H_
21 #define __GRAPHMATFILE_H_
22 
23 #include "UnitHolder.h"
24 
25 class CGraphanDicts;
26 class CDictionary;
27 
28 class CGraphmatFile : public CUnitHolder
29 {
30  string m_LastError;
31 
32 
33 
34  // Analyzing
35  bool IsKey(size_t LB, size_t HB, size_t& GraLast) const;
36  bool FindKeySequence (const char* title, size_t i,size_t HB, size_t& GraLast) const;
37  bool DealBullet (size_t i, size_t HB);
38  bool DealAsteriskBullet (size_t LB, size_t HB);
39  int DealBulletsWithTwoBrackets (size_t StartPos, size_t EndPos);
40  bool DealEnglishStyleFIO (size_t StartPos, size_t EndPos);
41  bool DealAbbrev (size_t StartPos, size_t EndPos);
42  size_t FindOborotto (size_t i, size_t HB, short& OborotNo, vector<WORD>& OborortIds) const;
43  void DealOborotto(size_t HB);
44  int DealReferences (size_t i,size_t HB);
45  void DealModifierKey (size_t LB, size_t HB);
46  void DealSimpleKey (size_t LB, size_t HB);
47  void DealKeySequence(size_t LB, size_t HB);
48  void DealGermanDividedCompounds(size_t LB, size_t HB);
49  void DealExtensionsAndLocalFileNames(size_t LB, size_t HB);
50  int HasIndention (size_t LB, size_t HB);
51  int CountEndL (size_t LB, size_t HB);
52  int CountSpaces (size_t LB, size_t HB);
53  int DealFIO (size_t i,size_t HB);
54  int DealShortFIO(size_t i, size_t HB);
55  void DealNames (size_t LB, size_t HB);
56  bool DealSentBreaker ();
58  bool GraphmatMain ();
59  int InitContextDescriptors (size_t LB, size_t HB);
60  void MacSynHierarchy ();
61 
62 
63 
64 
65 public:
68 
69  size_t m_MinParOfs;
70  size_t m_MaxParOfs;
71  size_t m_TabSize;
72  // file for graphematical table
74  // Нужно ли запускать делилку на предложения.
76  // нужно ли конвертировать латиницу в кириллицу внутри русского слова, если это возможно
77  // (исправление ошибок)
79 
80  // пустая строка является разделителем абазцев и предложений bool m_bEmptyLineIsSentenceDelim; // использовать таг </p> для разделения на параграфы bool m_bUseParagraphTagToDivide; // использовать красную строку для разделения на параграфы bool m_bUseIndention; bool m_bFilterUnprintableSymbols; bool m_bRecognizeShortFIOs; // max length of sentence size_t m_MaxSentenceLength; CGraphmatFile(); ~CGraphmatFile(); // processing bool LoadDicts(); bool LoadStringToGraphan(const string& szBuffer); const string& GetLastError() const; // browsing results void GetGraphematicalLine (char* line, size_t NumLine) const; void WriteGraphMat (const char* FName) const; }; #endif //__GRAPHMATFILE_H_ /*--- emacs style variables --- * Local Variables: * mode: C++ * c-file-style: "ellemtel" * c-basic-offset: 4 * tab-width: 8 * indent-tabs-mode: nil * End: */
82 
83  // использовать таг </p> для разделения на параграфы bool m_bUseParagraphTagToDivide; // использовать красную строку для разделения на параграфы bool m_bUseIndention; bool m_bFilterUnprintableSymbols; bool m_bRecognizeShortFIOs; // max length of sentence size_t m_MaxSentenceLength; CGraphmatFile(); ~CGraphmatFile(); // processing bool LoadDicts(); bool LoadStringToGraphan(const string& szBuffer); const string& GetLastError() const; // browsing results void GetGraphematicalLine (char* line, size_t NumLine) const; void WriteGraphMat (const char* FName) const; }; #endif //__GRAPHMATFILE_H_ /*--- emacs style variables --- * Local Variables: * mode: C++ * c-file-style: "ellemtel" * c-basic-offset: 4 * tab-width: 8 * indent-tabs-mode: nil * End: */
85 
86  // использовать красную строку для разделения на параграфы bool m_bUseIndention; bool m_bFilterUnprintableSymbols; bool m_bRecognizeShortFIOs; // max length of sentence size_t m_MaxSentenceLength; CGraphmatFile(); ~CGraphmatFile(); // processing bool LoadDicts(); bool LoadStringToGraphan(const string& szBuffer); const string& GetLastError() const; // browsing results void GetGraphematicalLine (char* line, size_t NumLine) const; void WriteGraphMat (const char* FName) const; }; #endif //__GRAPHMATFILE_H_ /*--- emacs style variables --- * Local Variables: * mode: C++ * c-file-style: "ellemtel" * c-basic-offset: 4 * tab-width: 8 * indent-tabs-mode: nil * End: */
88 
90 
92  // max length of sentence
94 
95 
96  CGraphmatFile();
98 
99  // processing
100  bool LoadDicts();
101  bool LoadStringToGraphan(const string& szBuffer);
102  const string& GetLastError() const;
103 
104  // browsing results
105 
106  void GetGraphematicalLine (char* line, size_t NumLine) const;
107 
108  void WriteGraphMat (const char* FName) const;
109 
110 
111 
112 
113 
114 };
115 
116 
117 #endif //__GRAPHMATFILE_H_
118 
119 /*--- emacs style variables ---
120  * Local Variables:
121  * mode: C++
122  * c-file-style: "ellemtel"
123  * c-basic-offset: 4
124  * tab-width: 8
125  * indent-tabs-mode: nil
126  * End:
127  */
size_t FindOborotto(size_t i, size_t HB, short &OborotNo, vector< WORD > &OborortIds) const
Definition: Oborots.cpp:33
bool DealEnglishStyleFIO(size_t StartPos, size_t EndPos)
Definition: C_desc.cpp:233
void DealGermanDividedCompounds(size_t LB, size_t HB)
Definition: C_desc.cpp:1006
bool FindKeySequence(const char *title, size_t i, size_t HB, size_t &GraLast) const
Definition: C_desc.cpp:836
bool IsKey(size_t LB, size_t HB, size_t &GraLast) const
Definition: C_desc.cpp:881
int CountSpaces(size_t LB, size_t HB)
Definition: C_desc.cpp:471
const string & GetLastError() const
Definition: GraphmatFile.cpp:269
size_t m_MaxSentenceLength
Definition: GraphmatFile.h:93
void DealExtensionsAndLocalFileNames(size_t LB, size_t HB)
Definition: C_desc.cpp:722
void MacSynHierarchy()
Definition: Cs_hiera.cpp:124
Definition: graline.h:66
int DealBulletsWithTwoBrackets(size_t StartPos, size_t EndPos)
Definition: C_desc.cpp:185
void DealKeySequence(size_t LB, size_t HB)
Definition: C_desc.cpp:969
int HasIndention(size_t LB, size_t HB)
Definition: C_desc.cpp:451
bool m_bEmptyLineIsSentenceDelim
Definition: GraphmatFile.h:81
bool m_bForceToRus
Definition: GraphmatFile.h:78
string m_LastError
Definition: GraphmatFile.h:30
bool m_bFilterUnprintableSymbols
Definition: GraphmatFile.h:89
int DealFIO(size_t i, size_t HB)
Definition: C_desc.cpp:576
bool m_bUseIndention
Definition: GraphmatFile.h:87
bool m_bConvertRussianJo2Je
Definition: GraphmatFile.h:67
void WriteGraphMat(const char *FName) const
Definition: Writegra.cpp:112
bool DealSentBreaker()
Definition: Sentences.cpp:167
bool DealAsteriskBullet(size_t LB, size_t HB)
Definition: C_desc.cpp:102
void InitNonContextDescriptors(CGraLine &L)
Definition: Nc_desc.cpp:25
void DealOborotto(size_t HB)
Definition: C_desc.cpp:284
const CGraphanDicts * m_pDicts
Definition: GraphmatFile.h:66
string m_GraOutputFile
Definition: GraphmatFile.h:73
Definition: GraphanDicts.h:71
size_t m_MinParOfs
Definition: GraphmatFile.h:69
Definition: UnitHolder.h:26
bool m_bSentBreaker
Definition: GraphmatFile.h:75
bool DealBullet(size_t i, size_t HB)
Definition: C_desc.cpp:34
bool LoadStringToGraphan(const string &szBuffer)
Definition: GraphmatFile.cpp:242
CGraphmatFile()
Definition: GraphmatFile.cpp:31
void DealModifierKey(size_t LB, size_t HB)
Definition: C_desc.cpp:917
bool m_bUseParagraphTagToDivide
Definition: GraphmatFile.h:84
void DealNames(size_t LB, size_t HB)
Definition: C_desc.cpp:692
int DealReferences(size_t i, size_t HB)
Definition: C_desc.cpp:325
int CountEndL(size_t LB, size_t HB)
Definition: C_desc.cpp:460
bool m_bRecognizeShortFIOs
Definition: GraphmatFile.h:91
bool DealAbbrev(size_t StartPos, size_t EndPos)
Definition: abbrev.cpp:280
void GetGraphematicalLine(char *line, size_t NumLine) const
Definition: Writegra.cpp:27
Definition: Ross.h:243
int InitContextDescriptors(size_t LB, size_t HB)
Definition: C_desc.cpp:1081
Definition: GraphmatFile.h:28
size_t m_TabSize
Definition: GraphmatFile.h:71
int DealShortFIO(size_t i, size_t HB)
Definition: C_desc.cpp:487
bool GraphmatMain()
Definition: GraphmatFile.cpp:121
bool LoadDicts()
Definition: GraphmatFile.cpp:58
~CGraphmatFile()
Definition: GraphmatFile.cpp:49
size_t m_MaxParOfs
Definition: GraphmatFile.h:70
void DealSimpleKey(size_t LB, size_t HB)
Definition: C_desc.cpp:949