#!/usr/bin/perl -w # # started Matija Nalis 07/2003, GPL # # Convert Igaly's (www.math.hr/~igaly/EHrjecnik.htm) EH.txt # to MiD dictionary sources (http://www.pdathaipalm.com/) # # copy to same directory as EH.txt and run it. # after it, run under MSDOS: # # MiDCnv.exe eng2hrv.txt EHrj EnTh eng_hrv "/" # MiDCnv.exe hrv2eng.txt EHrj EnTh hrv_eng "/" # # after uploading to palm, process with MiDZip.prc to finish! # open (IN, "hrv2eng.txt") or die "can't write output1: $!"; open (OUTEH, "|sort>eng2hrv.txt") or die "can't write output2: $!"; my $line = 0; while () { $line++; s/(\r|\n)*$//; # and not chomp()... ($eng, $hrv) = split /\t/; if (!$eng or !$hrv) { print "error in source line #$line, skipping >$_<\n"; next; } # modify eventual reserved '/' $eng =~ s/\//\\/g; $hrv =~ s/\//\\/g; print OUTEH "$eng/$hrv\r\n"; print OUTHE "$hrv/$eng\r\n"; undef $eng; undef $hrv; } close (OUTHE); close (OUTEH); close (IN); print "Finished OK.\n"; exit 0;