Subversion Repositories wimsdev

Rev

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

Rev 6818 Rev 6819
Line 208... Line 208...
208
    if(strlen(start)-(bad_end-bad_beg)+strlen(buf)>=MAX_LINELEN)
208
    if(strlen(start)-(bad_end-bad_beg)+strlen(buf)>=MAX_LINELEN)
209
      return;
209
      return;
210
    strcat(buf,bad_end);
210
    strcat(buf,bad_end);
211
    ovlstrcpy(bad_beg,buf);
211
    ovlstrcpy(bad_beg,buf);
212
}
212
}
-
 
213
 
-
 
214
/* add a space after comma to see end of words */
-
 
215
 
-
 
216
void comma(char *p)
-
 
217
{
-
 
218
    char *pp;
-
 
219
    for(pp=strchr(p,','); pp; pp=strchr(pp+1,','))
-
 
220
      string_modify(p,pp,pp+1,", ");
-
 
221
}
-
 
222
 
213
 
223
 
214
void _getdef(char buf[], char *name, char value[])
224
void _getdef(char buf[], char *name, char value[])
215
{
225
{
216
    char *p1, *p2, *p3;
226
    char *p1, *p2, *p3;
217
 
227
 
Line 413... Line 423...
413
 
423
 
414
        /* read and treat module's INDEX file */
424
        /* read and treat module's INDEX file */
415
int module_index(const char *name)
425
int module_index(const char *name)
416
{
426
{
417
    char *p, fbuf[MAX_LINELEN+1], ibuf[MAX_LINELEN+1];
427
    char *p, fbuf[MAX_LINELEN+1], ibuf[MAX_LINELEN+1];
418
    FILE *indf;
428
    FILE *indf;
419
    int i,l;
429
    int i,l;
420
 
430
 
421
    snprintf(fbuf,sizeof(fbuf),"%s/%s/INDEX",moduledir,name);
431
    snprintf(fbuf,sizeof(fbuf),"%s/%s/INDEX",moduledir,name);
422
    indf=fopen(fbuf,"r"); if(indf==NULL) return -1;
432
    indf=fopen(fbuf,"r"); if(indf==NULL) return -1;
423
    l=fread(ibuf,1,MAX_LINELEN,indf); fclose(indf);
433
    l=fread(ibuf,1,MAX_LINELEN,indf); fclose(indf);
Line 536... Line 546...
536
      fprintf(robotf,"%s ,%s,%s,%s,%s\n",name,module_language,name,
546
      fprintf(robotf,"%s ,%s,%s,%s,%s\n",name,module_language,name,
537
              indbuf[i_title], buf);
547
              indbuf[i_title], buf);
538
        /*  Normalize the information, using main dictionary bases/sys/words.xx */
548
        /*  Normalize the information, using main dictionary bases/sys/words.xx */
539
    entrycount=mentrycount; dicbuf=mdicbuf;
549
    entrycount=mentrycount; dicbuf=mdicbuf;
540
    memmove(entry,mentry,mentrycount*sizeof(entry[0]));
550
    memmove(entry,mentry,mentrycount*sizeof(entry[0]));
541
    unknown_type=unk_leave;
551
    unknown_type=unk_leave;  /* used in translator_.c */
-
 
552
 
542
    for(i=0;i<trcnt;i++) {
553
    for(i=0;i<trcnt;i++) {
543
        detag(indbuf[trlist[i]]);
554
        detag(indbuf[trlist[i]]);
544
        deaccent(indbuf[trlist[i]]);
555
        deaccent(indbuf[trlist[i]]);
-
 
556
        comma(indbuf[trlist[i]]);
545
        singlespace(indbuf[trlist[i]]);
557
        singlespace(indbuf[trlist[i]]);
546
        suffix_translate(indbuf[trlist[i]]);
558
        suffix_translate(indbuf[trlist[i]]);
547
        translate(indbuf[trlist[i]]);
559
        translate(indbuf[trlist[i]]);
548
    }
560
    }
549
        /*  append words of title  */
561
        /*  append words of title  */
Line 692... Line 704...
692
    memmove(entry,mentry,mentrycount*sizeof(entry[0]));
704
    memmove(entry,mentry,mentrycount*sizeof(entry[0]));
693
    unknown_type=unk_leave;
705
    unknown_type=unk_leave;
694
    for(i=0;i<trcnt;i++) {
706
    for(i=0;i<trcnt;i++) {
695
        detag(sindbuf[trlist[i]]);
707
        detag(sindbuf[trlist[i]]);
696
        deaccent(sindbuf[trlist[i]]);
708
        deaccent(sindbuf[trlist[i]]);
-
 
709
        comma(sindbuf[trlist[i]]);
697
        singlespace(sindbuf[trlist[i]]);
710
        singlespace(sindbuf[trlist[i]]);
698
        suffix_translate(sindbuf[trlist[i]]);
711
        suffix_translate(sindbuf[trlist[i]]);
699
        translate(sindbuf[trlist[i]]);
712
        translate(sindbuf[trlist[i]]);
700
    }
713
    }
701
    taken[0]=0; takenlen=tweight=0;
714
    taken[0]=0; takenlen=tweight=0;