Subversion Repositories wimsdev

Rev

Rev 8100 | Rev 8185 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 8100 Rev 8123
Line 16... Line 16...
16
 */
16
 */
17
 
17
 
18
/* Versatile translation according to a dictionary */
18
/* Versatile translation according to a dictionary */
19
 
19
 
20
/*************** Customization: change values hereafter ****************/
20
/*************** Customization: change values hereafter ****************/
21
 
-
 
-
 
21
#include "suffix.h"
-
 
22
#include "../Lib/libwims.h"
-
 
23
#include "../wimsdef.h"
-
 
24
#include "translator_.h"
22
/* limit of dictionary entries */
25
/* limit of dictionary entries */
23
#define entrylim 32768
26
#define entrylim 32768
24
/* limit of dictionary length */
27
/* limit of dictionary length */
25
#define diclim 1024*1024
28
#define diclim 1024*1024
26
 
29
 
27
/***************** Nothing should need change hereafter *****************/
30
/***************** Nothing should need change hereafter *****************/
28
 
31
 
29
 
32
 
30
char inpbuf[MAX_LINELEN+1], outbuf[2*MAX_LINELEN+2];
33
char inpbuf[MAX_LINELEN+1], outbuf[2*MAX_LINELEN+2];
31
char *dicbuf;
34
char *dicbuf;
32
struct entry {
-
 
33
    unsigned char *original, *replace;
-
 
34
    int olen,earlier;
-
 
35
} entry[entrylim];
35
struct entry entry[entrylim];
36
int entrycount;
36
int entrycount;
37
 
-
 
38
enum {
-
 
39
    unk_delete, unk_leave, unk_replace
37
int entry_size=sizeof(entry);
40
};
-
 
41
 
38
 
42
int has_digits=0;
39
int has_digits=0;
43
int unknown_type=unk_delete;
40
int unknown_type=unk_delete;
44
int nocase=0,leaveline=0;
41
int nocase=0,leaveline=0;
45
char *unknown, unkbuf[1024];
42
char *unknown, unkbuf[1024];
Line 109... Line 106...
109
          for(pp++,p2=pp;isspace(*p2);p2++);
106
          for(pp++,p2=pp;isspace(*p2);p2++);
110
          ovlstrcpy(pp,p2); pp--;
107
          ovlstrcpy(pp,p2); pp--;
111
      }
108
      }
112
    }
109
    }
113
}
110
}
114
 
-
 
115
#include "suffix.c"
-
 
116
 
111
 
117
/* Prepare dictionary */
112
/* Prepare dictionary */
118
void prepare_dic(char *fname)
113
void prepare_dic(char *fname)
119
{
114
{
120
    int i,l;
115
    int i,l;