76
76
#include "user_voc.h"
77
77
#include "minmax.h"
79
extern BYTE db_trace_flag;
80
extern BYTE decode_ASCII_to_[256][4];
81
extern BYTE valid_word_number;
82
extern INT text_findstat(CHAR * w);
83
extern INT text_findstat_aux(CHAR * w);
84
extern INT text_findstat_agressive(CHAR * w);
85
static INT get_right_coord(cell *c);
86
static INT get_left_coord(cell *c);
87
static BYTE is_english_word(cell *c,cell *e);
88
static BYTE change_Il1(cell *b, cell *e);
89
static BYTE eng_recognize(cell *b, cell *e);
90
static BYTE english_cell_recognize(cell *cc);
79
extern uchar db_trace_flag;
80
extern uchar decode_ASCII_to_[256][4];
81
extern uchar valid_word_number;
82
extern int16_t text_findstat(char * w);
83
extern int16_t text_findstat_aux(char * w);
84
extern int16_t text_findstat_agressive(char * w);
85
static int16_t get_right_coord(cell *c);
86
static int16_t get_left_coord(cell *c);
87
static uchar is_english_word(cell *c,cell *e);
88
static uchar change_Il1(cell *b, cell *e);
89
static uchar eng_recognize(cell *b, cell *e);
90
static uchar english_cell_recognize(cell *cc);
91
91
static void filtrate_language(cell *b,cell *e);
92
static void mark_two_lang_word(cell *b, cell *e, BYTE val);
93
static BOOL bad_chars_in_word(cell *b,cell *e);
94
static BOOL small_prob_in_word(cell *b,cell *e) ;
95
static BOOL more_alt(cell *b,cell *e);
96
static BOOL II_place(cell *c);
97
static BOOL II_config(cell *c);
98
BOOL russian_word(BYTE *wrd);
99
BOOL english_word(BYTE *wrd);
100
BOOL russian_word_all(BYTE *wrd,BYTE language,BYTE nextlet);
101
BOOL english_word_all(BYTE *wrd,BYTE language);
102
static BOOL exist_symbol(cell *b,cell *e,BYTE ch) ;
103
static BOOL left_over(cell *b,INT limit);
92
static void mark_two_lang_word(cell *b, cell *e, uchar val);
93
static Bool bad_chars_in_word(cell *b,cell *e);
94
static Bool small_prob_in_word(cell *b,cell *e) ;
95
static Bool more_alt(cell *b,cell *e);
96
static Bool II_place(cell *c);
97
static Bool II_config(cell *c);
98
Bool russian_word(uchar *wrd);
99
Bool english_word(uchar *wrd);
100
Bool russian_word_all(uchar *wrd,uchar language,uchar nextlet);
101
Bool english_word_all(uchar *wrd,uchar language);
102
static Bool exist_symbol(cell *b,cell *e,uchar ch) ;
103
static Bool left_over(cell *b,int16_t limit);
105
105
//Alik 04-25-96 06:53pm
106
106
//============== Import func ===========
107
//INT text_findstat(CHAR * word);
107
//int16_t text_findstat(char * word);
108
108
//============== Local func =================
109
static BOOL russian_dictionary_word(cell * first, cell * last,PBYTE);
110
BOOL _spell(PCHAR s,BYTE lang);
111
BOOL _spell_agressive(PCHAR s,BYTE lang);
112
BOOL short_spell(BYTE *wrd,BYTE language, BYTE nextlet );
109
static Bool russian_dictionary_word(cell * first, cell * last,puchar);
110
Bool _spell(pchar s,uchar lang);
111
Bool _spell_agressive(pchar s,uchar lang);
112
Bool short_spell(uchar *wrd,uchar language, uchar nextlet );
113
113
extern void final_descriminate(cell *b, cell *e);
114
extern void del_word_for2lang(INT left_limit,INT right_limit);
115
extern INT line_number; // number of line in ed_file
114
extern void del_word_for2lang(int16_t left_limit,int16_t right_limit);
115
extern int16_t line_number; // number of line in ed_file
117
117
#define MAX_LEN_WORD 48
118
118
#define GOOD_PROB 200
120
BOOL short_spell(BYTE *wrd,BYTE language, BYTE nextlet )
120
Bool short_spell(uchar *wrd,uchar language, uchar nextlet )
122
BOOL short_word_solid;
122
Bool short_word_solid;
123
123
switch( language )
125
125
case LANG_RUSSIAN:
215
215
void set_spell_solid(void)
217
217
cell *c, *e, *cc, *ce, *ee, *t;
218
BYTE word_len,buf[MAX_LEN_WORD+40], *wrd, *pwrd,
218
uchar word_len,buf[MAX_LEN_WORD+40], *wrd, *pwrd,
219
219
buff[MAX_LEN_WORD+40], llanguage,
220
220
// left_terms[]="<(�\"\'/[",
221
221
left_terms[]="//<(\"\'/[",
222
222
// right_terms[]="/)>�ؼ\"!\';?\x1e\x1f",
223
223
right_terms[]="///)>�\"!\';?\x1e\x1f", // 31.05.2001 E.P.
225
INT l,n=sizeof(buf)-1;
225
int16_t l,n=sizeof(buf)-1;
227
227
// ���� �������� ��������� � ������� �� �����. 31.05.2001 E.P.
228
228
left_terms[0] = low_quotes;
420
BYTE english_word_recognize(void)
420
uchar english_word_recognize(void)
423
BYTE buf[MAX_LEN_WORD+40],is_eng,word_len,eng,r1,r2,val,BadWord;
424
BYTE wrd[MAX_LEN_WORD+40];
425
INT left_limit, right_limit, last_wrd;
423
uchar buf[MAX_LEN_WORD+40],is_eng,word_len,eng,r1,r2,val,BadWord;
424
uchar wrd[MAX_LEN_WORD+40];
425
int16_t left_limit, right_limit, last_wrd;
426
426
cell *right_cell, *left_cell ;
428
428
if( db_status && snap_activity('c') )
711
static BYTE russian_letters[] ="������뢫���ﬨ�졉����������������������";
712
static BYTE english_letters[] ="Ili";
713
static BYTE two_lang_letters[]="�234567890㓪�������啂��������ᑌ���";
714
//static BYTE eng_lang_letters[]="�234567890yYkKeEHr33xXBaAnpPoOvcCMTbm";
715
static BYTE punct_letters[] ="(){}[]!�,.\"':?\\/-_";
716
static BYTE russian_prepositions[]="��᮪。������";
717
static BYTE critical_digitals[]="183";
711
static uchar russian_letters[] ="������뢫���ﬨ�졉����������������������";
712
static uchar english_letters[] ="Ili";
713
static uchar two_lang_letters[]="�234567890㓪�������啂��������ᑌ���";
714
//static uchar eng_lang_letters[]="�234567890yYkKeEHr33xXBaAnpPoOvcCMTbm";
715
static uchar punct_letters[] ="(){}[]!�,.\"':?\\/-_";
716
static uchar russian_prepositions[]="��᮪。������";
717
static uchar critical_digitals[]="183";
721
721
// return : 0 - russian, 1 - english, 2 - russian or english
722
BYTE is_english_word(cell *b,cell *e)
722
uchar is_english_word(cell *b,cell *e)
725
int16_t n,r,re,r1,rd,rp;
729
729
{ // one letter in word
1102
static BYTE rus_two_lang_letters[]="�������������㨮���1234567890,���!._<>;";
1103
static BYTE eng_two_lang_letters[]="ETYOPAHKXCBMeyuopaxcn1234567890,���!._<>;";
1104
static BYTE rus_two_lang_letters1[]="�������������㨮���";
1105
static BYTE eng_two_lang_letters1[]="ETYOPAHKXCBMeyuopaxcn";
1107
static BOOL mixed_eng_rus_word(cell *b, cell *e);
1108
static BOOL mixed_rus_eng_word(cell *b, cell *e);
1109
static BOOL eng_word_to_rus_word(cell *b, cell *e);
1110
static BOOL rus_word_to_eng_word(cell *b, cell *e);
1111
static BOOL russian_letter(cell *b,cell *e);
1112
static BOOL english_letter(cell *b,cell *e);
1114
BOOL mixed_eng_rus_word(cell *b, cell *e)
1102
static uchar rus_two_lang_letters[]="�������������㨮���1234567890,���!._<>;";
1103
static uchar eng_two_lang_letters[]="ETYOPAHKXCBMeyuopaxcn1234567890,���!._<>;";
1104
static uchar rus_two_lang_letters1[]="�������������㨮���";
1105
static uchar eng_two_lang_letters1[]="ETYOPAHKXCBMeyuopaxcn";
1107
static Bool mixed_eng_rus_word(cell *b, cell *e);
1108
static Bool mixed_rus_eng_word(cell *b, cell *e);
1109
static Bool eng_word_to_rus_word(cell *b, cell *e);
1110
static Bool rus_word_to_eng_word(cell *b, cell *e);
1111
static Bool russian_letter(cell *b,cell *e);
1112
static Bool english_letter(cell *b,cell *e);
1114
Bool mixed_eng_rus_word(cell *b, cell *e)
1119
BYTE wrd[MAX_LEN_WORD];
1119
uchar wrd[MAX_LEN_WORD];
1121
1121
for(c=b;c!=e;c=c->next)
1122
1122
if( c->language!=LANG_RUSSIAN )