| 1 |
/* |
| 2 |
Copyright (c) 1993-2008, Cognitive Technologies |
| 3 |
All rights reserved. |
| 4 |
|
| 5 |
пЮГПЕЬЮЕРЯЪ ОНБРНПМНЕ ПЮЯОПНЯРПЮМЕМХЕ Х ХЯОНКЭГНБЮМХЕ ЙЮЙ Б БХДЕ ХЯУНДМНЦН ЙНДЮ, |
| 6 |
РЮЙ Х Б ДБНХВМНИ ТНПЛЕ, Я ХГЛЕМЕМХЪЛХ ХКХ АЕГ, ОПХ ЯНАКЧДЕМХХ ЯКЕДСЧЫХУ СЯКНБХИ: |
| 7 |
|
| 8 |
* оПХ ОНБРНПМНЛ ПЮЯОПНЯРПЮМЕМХХ ХЯУНДМНЦН ЙНДЮ ДНКФМШ НЯРЮБЮРЭЯЪ СЙЮГЮММНЕ |
| 9 |
БШЬЕ СБЕДНЛКЕМХЕ НА ЮБРНПЯЙНЛ ОПЮБЕ, ЩРНР ЯОХЯНЙ СЯКНБХИ Х ОНЯКЕДСЧЫХИ |
| 10 |
НРЙЮГ НР ЦЮПЮМРХИ. |
| 11 |
* оПХ ОНБРНПМНЛ ПЮЯОПНЯРПЮМЕМХХ ДБНХВМНЦН ЙНДЮ Б ДНЙСЛЕМРЮЖХХ Х/ХКХ Б |
| 12 |
ДПСЦХУ ЛЮРЕПХЮКЮУ, ОНЯРЮБКЪЕЛШУ ОПХ ПЮЯОПНЯРПЮМЕМХХ, ДНКФМШ ЯНУПЮМЪРЭЯЪ |
| 13 |
СЙЮГЮММЮЪ БШЬЕ ХМТНПЛЮЖХЪ НА ЮБРНПЯЙНЛ ОПЮБЕ, ЩРНР ЯОХЯНЙ СЯКНБХИ Х |
| 14 |
ОНЯКЕДСЧЫХИ НРЙЮГ НР ЦЮПЮМРХИ. |
| 15 |
* мХ МЮГБЮМХЕ Cognitive Technologies, МХ ХЛЕМЮ ЕЕ ЯНРПСДМХЙНБ МЕ ЛНЦСР |
| 16 |
АШРЭ ХЯОНКЭГНБЮМШ Б ЙЮВЕЯРБЕ ЯПЕДЯРБЮ ОНДДЕПФЙХ Х/ХКХ ОПНДБХФЕМХЪ |
| 17 |
ОПНДСЙРНБ, НЯМНБЮММШУ МЮ ЩРНЛ он, АЕГ ОПЕДБЮПХРЕКЭМНЦН ОХЯЭЛЕММНЦН |
| 18 |
ПЮГПЕЬЕМХЪ. |
| 19 |
|
| 20 |
щрю опнцпюллю опеднярюбкемю бкюдекэжюлх юбрнпяйху опюб х/хкх дпсцхлх кхжюлх "йюй |
| 21 |
нмю еярэ" аег йюйнцн-кхан бхдю цюпюмрхи, бшпюфеммшу ъбмн хкх ондпюгслебюелшу, |
| 22 |
бйкчвюъ цюпюмрхх йнллепвеяйни жеммнярх х опхцндмнярх дкъ йнмйпермни жекх, мн ме |
| 23 |
нцпюмхвхбюъяэ хлх. мх бкюдекеж юбрнпяйху опюб х мх ндмн дпсцне кхжн, йнрнпне |
| 24 |
лнфер хглемърэ х/хкх онбрнпмн пюяопнярпюмърэ опнцпюллс, мх б йнел яксвюе ме |
| 25 |
мея╗р нрберярбеммнярх, бйкчвюъ кчаше наыхе, яксвюимше, яоежхюкэмше хкх |
| 26 |
онякеднбюбьхе сашрйх, ябъгюммше я хяонкэгнбюмхел хкх онмеяеммше бякедярбхе |
| 27 |
мебнглнфмнярх хяонкэгнбюмхъ опнцпюллш (бйкчвюъ онрепх дюммшу, хкх дюммше, |
| 28 |
ярюбьхе мецндмшлх, хкх сашрйх х/хкх онрепх днунднб, онмеяеммше хг-гю деиярбхи |
| 29 |
рперэху кхж х/хкх нрйюгю опнцпюллш пюанрюрэ янблеярмн я дпсцхлх опнцпюллюлх, |
| 30 |
мн ме нцпюмхвхбюъяэ щрхлх яксвюълх), мн ме нцпюмхвхбюъяэ хлх, дюфе еякх рюйни |
| 31 |
бкюдекеж хкх дпсцне кхжн ашкх хгбеыемш н бнглнфмнярх рюйху сашрйнб х онрепэ. |
| 32 |
|
| 33 |
Redistribution and use in source and binary forms, with or without modification, |
| 34 |
are permitted provided that the following conditions are met: |
| 35 |
|
| 36 |
* Redistributions of source code must retain the above copyright notice, |
| 37 |
this list of conditions and the following disclaimer. |
| 38 |
* Redistributions in binary form must reproduce the above copyright notice, |
| 39 |
this list of conditions and the following disclaimer in the documentation |
| 40 |
and/or other materials provided with the distribution. |
| 41 |
* Neither the name of the Cognitive Technologies nor the names of its |
| 42 |
contributors may be used to endorse or promote products derived from this |
| 43 |
software without specific prior written permission. |
| 44 |
|
| 45 |
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND |
| 46 |
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
| 47 |
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
| 48 |
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE |
| 49 |
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
| 50 |
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
| 51 |
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER |
| 52 |
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
| 53 |
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 54 |
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 55 |
*/ |
| 56 |
|
| 57 |
/* |
| 58 |
шшшшшшшшшшшшшшшшшшшшшшшшшшшшшшшшшшшшшшшшшшшшшшшшшшшшшшшшшшшшшшшшшш |
| 59 |
шш шш |
| 60 |
шш Copyright (C) 1990 Cognitive Technology Corporation. шш |
| 61 |
шш All rights reserved. This program is proprietary and шш |
| 62 |
шш a trade secret of Cognitive Technology Corporation. шш |
| 63 |
шш шш |
| 64 |
шшшшшшшшшшшшшшшшшшшшшшшшшшшшшшшшшшшшшшшшшшшшшшшшшшшшшшшшшшшшшшшшшш |
| 65 |
*/ |
| 66 |
|
| 67 |
#ifndef CUTSTR |
| 68 |
|
| 69 |
#define CUTSTR 1 |
| 70 |
|
| 71 |
#define MAX_CELLS_IN_LIST 8 |
| 72 |
|
| 73 |
struct v_v |
| 74 |
{int16_t v1,v2,v3;}; |
| 75 |
typedef struct v_v v_val; |
| 76 |
|
| 77 |
struct save_vers |
| 78 |
{int16_t nvers; version vers[VERS_IN_CELL]; char flg; char pos; uchar source; |
| 79 |
uchar broken_II; uchar cg_flag_fine;uchar accent_leader; |
| 80 |
uchar bottom_accent; // 16.10.97 E.P. |
| 81 |
}; |
| 82 |
typedef struct save_vers SVERS; |
| 83 |
|
| 84 |
struct cut_elm |
| 85 |
{ |
| 86 |
char x; // position |
| 87 |
char dh; // height to be cut |
| 88 |
char h; // end of segment |
| 89 |
char var; // method |
| 90 |
v_val lv; // two-component estimate of left side |
| 91 |
char px; // best previous point |
| 92 |
v_val rv; // two-component estimate of right sude |
| 93 |
char duflm, gvarm, duflr, gvarr; // glue variant, dust flags |
| 94 |
SVERS versm; // best cell versions |
| 95 |
SVERS versr; // right part versions |
| 96 |
}; |
| 97 |
|
| 98 |
typedef struct cut_position |
| 99 |
{ int16_t row1, row2, cuth; char flag; } cut_pos; |
| 100 |
struct glue_struct |
| 101 |
{ |
| 102 |
c_comp *complist[MAX_CELLS_IN_LIST]; |
| 103 |
cell *celist[MAX_CELLS_IN_LIST]; |
| 104 |
cell *maxlist[MAX_CELLS_IN_LIST]; |
| 105 |
cell *nclist[MAX_CELLS_IN_LIST]; |
| 106 |
void *kitlist[MAX_CELLS_IN_LIST]; |
| 107 |
uchar ncell, ngluc, arg, maxnc; |
| 108 |
uchar flarg, fres, var; |
| 109 |
int16_t Dist, dist, bdiff, maxval; |
| 110 |
MN *mn; |
| 111 |
int16_t row, col, height, width; |
| 112 |
int16_t c_r, c_c, c_w, c_h, c_mc, c_mr, c_dens; |
| 113 |
}; |
| 114 |
typedef struct glue_struct s_glue; |
| 115 |
|
| 116 |
struct all_c |
| 117 |
{ |
| 118 |
int16_t Nb, Nd, minb, mind, minf; |
| 119 |
uchar flag; |
| 120 |
#define dust_left 1 |
| 121 |
#define dust_right 2 |
| 122 |
#define cl_disorder 4 |
| 123 |
cell *minlet, *maxlet, *mincl, *maxcl; |
| 124 |
cell *bcells[MAX_CELLS_IN_LIST], |
| 125 |
*dcells[MAX_CELLS_IN_LIST]; |
| 126 |
}; |
| 127 |
typedef struct all_c all_cells; |
| 128 |
|
| 129 |
struct st_answer |
| 130 |
{ |
| 131 |
char ltr; |
| 132 |
char fnt; |
| 133 |
uint16_t iprob; |
| 134 |
char n_rsn; // number of letter from list of same letters |
| 135 |
}; |
| 136 |
typedef struct st_answer t_answer; |
| 137 |
|
| 138 |
struct info_elm |
| 139 |
{ |
| 140 |
char topline, botline; |
| 141 |
char lnum; |
| 142 |
char topf, toph, botf, both; |
| 143 |
char sumb; |
| 144 |
}; |
| 145 |
|
| 146 |
struct own_cut |
| 147 |
{ |
| 148 |
char x; // position |
| 149 |
char dh; // height to be cut |
| 150 |
char h; // end of segment |
| 151 |
char var; // method |
| 152 |
}; |
| 153 |
|
| 154 |
struct extrem_elem |
| 155 |
{ |
| 156 |
char type; // +- -- max/min |
| 157 |
char cat; // category |
| 158 |
char beg, end; // area limits |
| 159 |
char val; // etrem value |
| 160 |
}; |
| 161 |
|
| 162 |
struct linehdr |
| 163 |
{ |
| 164 |
int16_t lth; |
| 165 |
uint16_t dy; |
| 166 |
uint16_t y0; |
| 167 |
char flag; |
| 168 |
}; |
| 169 |
|
| 170 |
struct segment |
| 171 |
{ |
| 172 |
uchar lth; |
| 173 |
uchar end; |
| 174 |
}; |
| 175 |
|
| 176 |
struct short_line_header |
| 177 |
{ |
| 178 |
uchar top; // top string of line (relative) |
| 179 |
uchar bot; // bottom string of line (relative) |
| 180 |
uchar fb; // beginning of first segment of line |
| 181 |
uchar fe; // end of first segment of line |
| 182 |
uchar lb; // beginning of last segment of line |
| 183 |
uchar le; // end of last segment of line |
| 184 |
uchar next; // number of next line in (shortened) lines' list |
| 185 |
int16_t segm_addr; // offset of first segment in line |
| 186 |
}; |
| 187 |
|
| 188 |
struct vertex_header |
| 189 |
{ |
| 190 |
uchar top; // top string of component (relative) |
| 191 |
uchar bot; // bottom string of component (relative) |
| 192 |
int16_t beg; // offset of first segment of line in c_comp |
| 193 |
int16_t end; // offset of last + 1 segment of line in c_comp |
| 194 |
uchar out; // outgoing valency |
| 195 |
uchar in; // incoming valency |
| 196 |
}; |
| 197 |
|
| 198 |
struct local_min |
| 199 |
{ |
| 200 |
int16_t value; // value of minimum |
| 201 |
int16_t ambeg; // x-coordinate of beginning |
| 202 |
int16_t amend; // end of local minimum area |
| 203 |
}; |
| 204 |
|
| 205 |
struct func_elem |
| 206 |
{ // description of argument (x) |
| 207 |
char fvalue[3]; // values of lth, lower, upper |
| 208 |
char extrem[6]; // number of minimum area for this |
| 209 |
// particular x for three functions; |
| 210 |
// -1 means out of minima areas |
| 211 |
char line; // number of line in graph containing this x |
| 212 |
}; |
| 213 |
|
| 214 |
struct graph_comp |
| 215 |
{ |
| 216 |
char top; |
| 217 |
char bot; |
| 218 |
char left; |
| 219 |
char right; |
| 220 |
}; |
| 221 |
|
| 222 |
struct less_vertex_elem |
| 223 |
{ // graph without one vertex |
| 224 |
char n_connect; // number of connected components |
| 225 |
}; |
| 226 |
|
| 227 |
typedef struct own_cut mas_cpnt; |
| 228 |
#endif |