/[kvake]/kvake.pl
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Annotation of /kvake.pl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1.1.1 - (hide annotations) (vendor branch)
Fri Apr 14 06:01:44 2000 UTC (22 years, 7 months ago) by dpavlin
Branch: PLIVA
CVS Tags: prod
Changes since 1.1: +0 -0 lines
File MIME type: text/plain
poŤetno punjenje

1 dpavlin 1.1 #!/usr/local/bin/perl -w
2     #
3     # program pretvara ch, zh, sh, cc, dh u odgovrajuce
4     # ISO 8859-2 znakove
5     # ozujak 1998.
6     # Hana Breyer Priselac
7     #
8     # poziva se s ./kvake.sh PUT
9     # gdje je PUT puni UNIX path do html dokumenata koje
10     # konvertirate
11     #
12     # 2000-02-16 Dobrica Pavlinusic <dpavlin@pliva.hr> prva perl verzija
13     # 2000-03-01 DbP poravljen ignore_dirs grep bug
14    
15     #$mod_time = 10*60; # 10 minuta
16     $mod_time = 24*60*60; # 1 day
17    
18     $verbose = 0;
19    
20     @ignore_dirs=( "/data/web/public/adresar/", "/data/web/public/eng" );
21    
22     if (! defined(@ARGV)) {
23     @dirs=( "/data/web/public",
24     "/usr/users/it/dpeterc" );
25     } else {
26     @dirs=@ARGV;
27     }
28    
29     foreach $dir (@dirs) {
30     opendir(DIR,"$dir") || warn "can't open $dir: $!";
31     foreach $f (grep { !/^\./ } readdir(DIR)) {
32     if (-f "$dir/$f" && ! -l "$dir/$f") {
33     print "jedan od fileka dir/$f\n";
34     @stat = stat(_);
35     if ($f =~ /\.html/ && (time() - $stat[9]) < $mod_time) {
36     push @files,"$dir/$f";
37     }
38     } elsif (-d "$dir/$f") {
39     $push_it = 1;
40     foreach $ig_dir (@ignore_dirs) {
41     # print "\t$dir/$f -- $ig_dir\n";
42     if ("$dir/$f" =~ m,$ig_dir,) {
43     print "skipping $dir/$f (in ignore list)\n" if ($verbose);
44     $push_it = 0;
45     }
46     }
47     push @dirs,"$dir/$f" if ($push_it);
48     } else {
49     print "skipping $dir/$f\n" if ($verbose);
50     }
51     }
52     closedir DIR;
53     }
54    
55     #foreach $file ("/data/web/public/VIJESTI/30ozpotpiskol.html") {
56     foreach $file (@files) {
57     if (open(IN,"$file")) {
58     print "$file\n" if ($verbose);
59     if (open(OUT,"> $file.$$")) {
60     while(<IN>) {
61     replace();
62     print OUT "$_";
63     }
64     } else {
65     warn "can't open $file.$$: $!";
66     }
67     close(OUT);
68     } else {
69     warn "can't open $file for reading: $!";
70     }
71     close(IN);
72     @stat = stat($file);
73     rename "$file.$$","$file";
74     chmod 0664,"$file";
75     # chmod $stat[2],"$file";
76     chown $stat[4],$stat[5],"$file";
77     }
78    
79     1;
80    
81     sub replace {
82    
83     s/ch/√®/g; s/CH/√ą/g;
84     s/cc/√¶/g; s/CC/√Ü/g;
85     s/zh/¬ĺ/g; s/ZH/¬ģ/g;
86     s/sh/¬Ļ/g; s/SH/¬©/g;
87     s/dh/√į/g; s/DH/√ź/g;
88    
89     s/ √ąN / CHN /g;
90     s/18th I√Ü Sto/18th ICC Sto/g;
91     s/a√¶epted/accepted/g;
92     s/a√¶ount/account/g;
93     s/a√¶umulated/accumulated/g;
94     s/A√¶ount/Account/g;
95     s/A√¶ess/Access/g;
96     s/a√®ieved/achieved/g;
97     s/an√®or/anchor/g;
98     s/AN√ąOR/ANCHOR/g;
99     s/approa√®ing/approaching/g;
100     s/Bat√®/Batch/g;
101     s/BAT√ą/BATCH/g;
102     s/Bayeris√®e/Bayerische/g;
103     s/Bee√®am/Beecham/g;
104     s/BEE√ąAM/BEECHAM/g;
105     s/Biote√®/Biotech/g;
106     s/infote√®/infotech/g;
107     s/Blue √®ip/Blue chip/g;
108     s/Bo√¶oni/Bocconi/g;
109     s/BRON√ąITIS/BRONCHITIS/g;
110     s/√ąANGE/CHANGE/g;
111     s/√®ange/change/g;
112     s/√®aracteris/characteris/g;
113     s/√ąARACTERISTICS/CHARACTERISTICS/g;
114     s/√®art /chart /g;
115     s/ca¬Ļ/cash/g;
116     s/ca¬Ļless/cashless/g;
117     s/√®arset/charset/g;
118     s/√®eck/check/g;
119     s/Cellte√®/Celltech/g;
120     s/√®emi/chemi/g;
121     s/√ąEMI/CHEMI/g;
122     s/√®emotherapy/chemotherapy/g;
123     s/√®ildbearing/childbearing/g;
124     s/√ąILDREN/CHILDREN/g;
125     s/√ąIRON/CHIRON/g;
126     s/√ąLAMIDIA/CHLAMIDIA/g;
127     s/√ąLAMYDIAL/CHLAMYDIAL/g;
128     s/√®ool/chool/g;
129     s/√ąROMOS/CHROMOS/g;
130     s/√ąRONIC/CHRONIC/g;
131     s/√®ronic/chronic/g;
132     s/Daii√®i/Daiichi/g;
133     s/Deuts√®/Deutsch/g;
134     s/Doxy√¶line/Doxyccline/g;
135     s/dkat√®alkov/dkatchalkov/g;
136     s/ ea√® / each /g;
137     s/eandryus√®enko/eandryuschenko/g;
138     s/einri√®/einrich/g;
139     s/ekarta¬Ļeva/ekartasheva/g;
140     s/Engli¬Ļ/English/g;
141     s/engli¬Ļ/english/g;
142     s/esterrei√®/esterreich/g;
143     s/FINI¬©ED/FINISHED/g;
144     s/FRE¬©/FRESH/g;
145     s/fre¬Ļ/fresh/g;
146     s/Gold¬Ļield/Goldshield/g;
147     s/gonoco√¶al/gonococcal/g;
148     s/Hoe√®st/Hoechst/g;
149     s/IFS√Ü/IFSCC/g;
150     s/ilev¬Ļin/ilevshin/g;
151     s/i¬Ļo√įenje/isho√įenje/g;
152     s/i¬Ļoditi/ishoditi/g;
153     s/i¬Ļode/ishode/g;
154     s/Ita√®a/Itacha/g;
155     s/Karpis√®enko/Karpischenko/g;
156     s/LA√ąEM/LACHEM/g;
157     s/La√®em/Lachem/g;
158     s/Leader¬Ļip/Leadership/g;
159     s/LYN√ą/LYNCH/g;
160     s/lo√¶o/locco/g;
161     s/acinto¬Ļ/acintosh/g;
162     s/me√®anis/mechanis/g;
163     s/MACINTO¬©/MACINTOSH/g;
164     s/mat√®ing/matching/g;
165     s/Ma¬Ļkilleyson/Mashkilleyson/g;
166     s/medwat√®/medwatch/g;
167     s/Mer√®ant/Merchant/g;
168     s/Mi√®ele/Michele/g;
169     s/Mun√®en/Munchen/g;
170     s/Osterrei√®/Osterreich/g;
171     s/Pa¬Ļkova/Pashkova/g;
172     s/PUBLI¬©ED/PUBLISHED/g;
173     s/pur√®as/purchas/g;
174     s/Relaun√®/Relaunch/g;
175     s/relaun√®/relaunch/g;
176     s/ri√®/rich/g;
177     s/Ri√®ter/Richter/g;
178     s/Ri√®ard/Richard/g;
179     s/riti¬Ļ/ritish/g;
180     s/Ro√®e/Roche/g;
181     s/Ryt√®ik/Rytchik/g;
182     s/Savi√®eva/Savicheva/g;
183     s/S√®auer/Schauer/g;
184     s/S√®onwald/Schonwald/g;
185     s/s√®eduling/scheduling/g;
186     s/s√®en/schen/g;
187     s/S√®/Sch/g;
188     s/S√ą/SCH/g;
189     s/S√®ering/Schering/g;
190     s/S√®leswig/Schleswig/g;
191     s/S√®midt/Schmidt/g;
192     s/S√ąMIDT/SCHMIDT/g;
193     s/SEAR√ą/SEARCH/g;
194     s/Sear√®/Search/g;
195     s/sear√®/search/g;
196     s/Stra√®ounsky/Strachounsky/g;
197     s/¬Ļare/share/g;
198     s/¬Ļea/shea/g;
199     s/¬Ļell/shell/g;
200     s/¬Ļeet/sheet/g;
201     s/¬Ļema/shema/g;
202     s/¬©EMA/SHEMA/g;
203     s/¬Ļip/ship/g;
204     s/¬Ļodno/shodno/g;
205     s/¬Ļop/shop/g;
206     s/¬©ORT/SHORT/g;
207     s/¬Ļort-term/short-term/g;
208     s/ ¬Ļown / shown /g;
209     s/ ¬Ļows / shows /g;
210     s/¬Ļridge/shridge/g;
211     s/¬Ļva√¶a/shva√¶a/g;
212     s/¬Ļvate/shvate/g;
213     s/¬©;.GIF/SH;.GIF/g;
214     s/¬Ļ;.html/sh;.html/g;
215     s/ex√®ange/exchange/g;
216     s/SU√ÜESSFUL/SUCCESSFUL/g;
217     s/SUPERFRE¬©/SUPERFRESH/g;
218     s/tea√® /teach /g;
219     s/te√®niques/techniques/g;
220     s/e√®nolog/echnolog/g;
221     s/tra√®omatis/trachomatis/g;
222     s/u√¶ess/uccess/g;
223     s/Va√¶ines /Vaccines /g;
224     s/ whi√® / which /g;
225     s/Wa¬Ļington/Washington/g;
226     s/Yamanou√®i/Yamanouchi/g;
227     s/yn√®/ynch/g;
228     s/Zinner ¬©./Zinner SH./g;
229     s/Zinner ¬©/Zinner SH/g;
230     s/Zuri√®/Zurich/g;
231    
232     # ovi idu uvijek na kraju
233     s/generich/generi√®/g;
234     s/i¬Ļho√įenje/isho√įenje/g;
235     s/Jurichu /Juri√®u /g;
236     s/merichk/meri√®k/g;
237     s/Petrichi/Petri√®i/g;
238     s/Petrichevi/Petri√®evi/g;
239     s/prichuva/pri√®uva/g;
240     s/ra¬Ļod/rashod/g;
241     s/Ra¬Ļod/Rashod/g;
242     s/√®osen/chosen/g;
243    
244     s/iso\.√®/iso\.ch/g;
245     s/medicorpte√®\.com/medicorptech.com/g;
246     s/√®lorination/chlorination/g;
247     s/Te√®nical/Technical/g;
248     s/Sati¬Ļ Jo¬Ļi/Satish Joshi/g;
249     s/√®loride/chloride/g;
250     s/Fis√®er/Fischer/g;
251     s/ √®ain/ chain/g;
252     s/Hydri√®lorination/ Hydrichlorination/g;
253     s/Manni√®/Mannich/g;
254     s/Flemi¬Ļ/Flemish/g;
255    
256     s/AREA ¬©APE=/AREA SHAPE=/g;
257     s/&Ecirc;/√¶/g; # hm?
258    
259     s/Streptoco√¶us/Streptococcus/g;
260     s/Co√¶i/Cocci/g;
261     s/√ąPSG/CHPSG/g;
262    
263     s/BEN√ąMARKING/BENCHMARKING/g;
264     s/Ben√®marking/Benchmarking/g;
265     s/Fi¬Ļer/Fisher/g;
266     s/¬Ļeppard/sheppard/g;
267     s/Cze√®/Czech/g;
268     s/To¬Ļiba/Toshiba/g;
269     s/Mar√®/March/g;
270    
271     }

  ViewVC Help
Powered by ViewVC 1.1.26