Blame view

tools/lia_ltbox/lia_tagg/src/format/reacc_lemm_biglex_bdlex2win.c 2.66 KB
e6be5137b   Jean-François Rey   reinitialized pro...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
  /*  Affiche avec les accents  */
  
  #include <stdio.h>
  #include <string.h>
  
  void accent_mot(ch)
   char *ch;
  {
  char temp[90000];
  int i,n;
  
  for(n=0,i=0;ch[n];n++)
   {
   switch (ch[n+1])
    {
    case '1' :
  	switch (ch[n])
  	 {
  	 case 'e' : temp[i++]='é'; n++; break;
  	 case 'E' : temp[i++]='É'; n++; break;
  	 default  : { if (ch[n]=='\\') n++; temp[i++]=ch[n]; }
  	 }
  	break;
    case '2' :
  	switch (ch[n])
  	 {
  	 case 'a' : temp[i++]='à'; n++; break;
  	 case 'A' : temp[i++]='À'; n++; break;
  	 case 'e' : temp[i++]='è'; n++; break;
  	 case 'E' : temp[i++]='È'; n++; break;
  	 case 'u' : temp[i++]='ù'; n++; break;
  	 case 'U' : temp[i++]='Ù'; n++; break;
  	 default  : { if (ch[n]=='\\') n++; temp[i++]=ch[n]; }
  	 }
  	break;
    case '3' :
  	switch (ch[n])
  	 {
  	 case 'a' : temp[i++]='â'; n++; break;
  	 case 'A' : temp[i++]='Â'; n++; break;
  	 case 'e' : temp[i++]='ê'; n++; break;
  	 case 'E' : temp[i++]='Ê'; n++; break;
  	 case 'i' : temp[i++]='î'; n++; break;
  	 case 'I' : temp[i++]='Î'; n++; break;
  	 case 'o' : temp[i++]='ô'; n++; break;
  	 case 'O' : temp[i++]='Ô'; n++; break;
  	 case 'u' : temp[i++]='û'; n++; break;
  	 case 'U' : temp[i++]='Û'; n++; break;
  	 default  : { if (ch[n]=='\\') n++; temp[i++]=ch[n]; }
  	 }
  	break;
    case '4' :
  	switch (ch[n])
  	 {
  	 case 'a' : temp[i++]='ä'; n++; break;
  	 case 'A' : temp[i++]='Ä'; n++; break;
  	 case 'e' : temp[i++]='ë'; n++; break;
  	 case 'E' : temp[i++]='Ë'; n++; break;
  	 case 'i' : temp[i++]='ï'; n++; break;
  	 case 'I' : temp[i++]='Ï'; n++; break;
  	 case 'o' : temp[i++]='ö'; n++; break;
  	 case 'O' : temp[i++]='Ö'; n++; break;
  	 case 'u' : temp[i++]='ü'; n++; break;
  	 case 'U' : temp[i++]='Ü'; n++; break;
  	 default  : { if (ch[n]=='\\') n++; temp[i++]=ch[n]; }
  	 }
  	break;
    case '5' :
  	switch (ch[n])
  	 {
  	 case 'c' : temp[i++]='ç'; n++; break;
  	 case 'C' : temp[i++]='Ç'; n++; break;
  	 default  : { if (ch[n]=='\\') n++; temp[i++]=ch[n]; }
  	 }
  	break;
    case 'Æ' :
          temp[i++]='Ó'; 
  	n++;
  	break;
    case '°' :
          temp[i++]='³'; 
  	n++;
  	break;
    default  :
  	{
   	if ((ch[n]=='\\')&&((ch[n+1]=='\\')||((ch[n+1]>='1')&&(ch[n+1]<='5')))) n++;
   	temp[i++]=ch[n];
  	}
    }
   }
  temp[i]='\0';
  strcpy(ch,temp);
  }
  
  int main(argc,argv)
   int argc;
   char **argv;
  {
  char mot[80000],ch[80000],*pt;
  int i;
  
  while (fgets(ch,80000,stdin))
   {
   pt=strtok(ch," \t
  "); if (pt==NULL) { fprintf(stderr,"ZARBU
  "); exit(0); }
   strcpy(mot,pt); accent_mot(mot); printf("%s",mot);
   while (pt=strtok(NULL," \t
  "))
    {
    printf(" %s",pt);
    pt=strtok(NULL," \t
  "); if (pt==NULL) { fprintf(stderr,"ZARBU
  "); exit(0); }
    printf(" %s",pt);
    pt=strtok(NULL," \t
  "); if (pt==NULL) { fprintf(stderr,"ZARBU
  "); exit(0); }
    strcpy(mot,pt); accent_mot(mot); printf(" %s",mot);
    }
   printf("
  ");
   }
  return 0;
  }