#!/usr/bin/perl -s if($h){ print "Usage pibabylon [options] options: -words=eng file with many english words -en=english.dic babylon english.dic -dic=engtopor.dic babylon engtoany.dic makes a engtoany.dic.tei "; exit; } $babylon="/usr/share/dict/babylon"; $enWords = $words || "/usr/share/dict/en.jj.words" ; $enfile = $en || "english.dic" ; $dicfile = $dic || "EngtoPor.dic"; open(F,"cat $enWords | grep \"^[A-Za-z]\"| pibabylon $enfile $dicfile|") or die; if (-e "teiheader") { system ("cp teiheader $dicfile.tei")} else { system ("echo 'insert TEI header ' > $dicfile.tei")} open(G, "| sort -u >> $dicfile.tei") or die; $/=''; while(){ chomp; s{\:.*\n}{}g; s{\&}{&}g; s{\>}{>}g; s{\<}{<}g; if(/__(.*?)\s*\((.*?)\)__\n?/ ){ ($a1,$a2,$a3)=($1,$2,$'); $a3 =~ s/\n/|/g; print G "$a1$a2", "$a3\n" } else { s/\n/|/g; print G "\n"; } } close G; if (-e "teifooter") { system ("cat teifooter >> $dicfile.tei")}