Changeset e1942be for app


Ignore:
Timestamp:
03/27/08 12:29:02 (16 years ago)
Author:
obrebski <obrebski@…>
Branches:
master, help
Children:
ef85bd7
Parents:
c8e8fa8
git-author:
obrebski <obrebski@…> (03/27/08 12:29:02)
git-committer:
obrebski <obrebski@…> (03/27/08 12:29:02)
Message:

poprawiony compiledic, dziala

tyle, ze compiledic.conf dorobilem recznie i plik .sym umiescilem recznie
w jakims tam katalogu (zostal znaleziony)

git-svn-id: svn://atos.wmid.amu.edu.pl/utt@16 e293616e-ec6a-49c2-aa92-f4a8b91c5d16

File:
1 edited

Legend:

Unmodified
Added
Removed
  • app/src/compiledic/compiledic

    rc8e8fa8 re1942be  
    5353######################################################### 
    5454 
    55  
    5655GetOptions("symbols=s" => \$symbols, 
    5756           "help|h" => \$help); 
     
    7069} 
    7170 
    72  
    73  
    7471################################################## 
    7572 
    7673-f $symbols or die("Symbol file not found."); 
    7774 
    78 @ARGV < 1   or die("Source dictionary not given."); 
     75@ARGV > 0   or die("Source dictionary not given."); 
    7976 
    8077my $file = shift; 
     
    8986 
    9087# Tworzymy katalog tymczasowy, gdzie wszystko bedzie umieszczane. 
    91 $tmp_root = tempdir( CLEANUP => 1 ); 
    92  
    93 print "TMPROOT: $tmp_root\n"; 
    94  
     88my $tmp_root = File::Temp::tempdir( CLEANUP => 1 ); 
    9589 
    9690(undef, my $symfile) = File::Temp::tempfile( DIR => $tmp_root, SUFFIX => ".sym" ); 
     
    109103# Analiza pliku slownika 
    110104 
    111 print "preparing file...........................................\n"; 
    112 print "... sed section .....\n"; 
     105print "preparing file..........................................."; 
     106#print "... sed section .....\n"; 
    113107(undef, my $file_sed) = File::Temp::tempfile( DIR => $tmp_root, SUFFIX => ".sed" ); 
    114108`sed -r "s/([[:punct:]])/\[\\1\]/g" < $file > $file_sed`; 
     
    123117open(IN, $file_sed); 
    124118 
    125 $lineCount = 0; 
    126 $fileCount = 0; 
     119my $lineCount = 0; 
     120my $fileCount = 0; 
    127121 
    128122open(FILE, ">$tmp_root/slo_$fileCount"); 
     
    147141 
    148142#32 kropki, fileCount plikow 
    149 $filesPerDot = $fileCount/32; 
    150 $files=$filesPerDot; 
    151 $dots=0; 
    152  
    153 for ($i=0; $i<=$fileCount; $i++) { 
     143my $filesPerDot = $fileCount/32; 
     144my $files=$filesPerDot; 
     145my $dots=0; 
     146 
     147for (my $i=0; $i<=$fileCount; $i++) { 
    154148 
    155149    if ($files >= $filesPerDot) { 
     
    164158} 
    165159if ($dots < 32) { 
    166     for ($i=0; $i<32 - $dots; $i++) { 
     160    for (my $i=0; $i<32 - $dots; $i++) { 
    167161        print "."; 
    168162    } 
     
    176170 
    177171#35 kropek... 
    178 $ndots=33; 
     172my $ndots=33; 
    179173$filesPerDot = $fileCount/$ndots; 
    180174$files=$filesPerDot; 
     
    183177copy("$tmp_root/slownik_0.fsm", "$tmp_root/slownik1.fsm"); 
    184178 
    185 for ($i=1; $i<=$filecount; $i++) { 
     179for (my $i=1; $i<=$fileCount; $i++) { 
    186180 
    187181    if ($files >= $filesPerDot) { 
     
    192186    $files++; 
    193187 
    194     `fsmunion $tmp_root/slownik_$i slownik1.fsm > $tmp_file/slownik2.fsm`; 
     188    `fsmunion $tmp_root/slownik_$i slownik1.fsm > $tmp_root/slownik2.fsm`; 
    195189 
    196190    move("$tmp_root/slownik2.fsm", "$tmp_root/slownik1.fsm") || die "Unable to move $tmp_root/slownik2.fsm!\n"; 
     
    198192 
    199193if ($dots < $ndots) { 
    200     for ($i=0; $i<$ndots - $dots; $i++) { 
    201         print "."; 
    202     } 
    203 } 
    204  
    205 `fsmunion $tmp_root/* > $tmp_root/slownik1.fsm`; 
     194    for (my $i=0; $i<$ndots - $dots; $i++) { 
     195        print "."; 
     196    } 
     197} 
     198 
     199#`fsmunion $tmp_root/* > $tmp_root/slownik1.fsm`; 
    206200 
    207201print "OK\n"; 
Note: See TracChangeset for help on using the changeset viewer.