Changeset e1942be
- Timestamp:
- 03/27/08 12:29:02 (17 years ago)
- 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)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
app/src/compiledic/compiledic
rc8e8fa8 re1942be 53 53 ######################################################### 54 54 55 56 55 GetOptions("symbols=s" => \$symbols, 57 56 "help|h" => \$help); … … 70 69 } 71 70 72 73 74 71 ################################################## 75 72 76 73 -f $symbols or die("Symbol file not found."); 77 74 78 @ARGV < 1or die("Source dictionary not given.");75 @ARGV > 0 or die("Source dictionary not given."); 79 76 80 77 my $file = shift; … … 89 86 90 87 # Tworzymy katalog tymczasowy, gdzie wszystko bedzie umieszczane. 91 $tmp_root = tempdir( CLEANUP => 1 ); 92 93 print "TMPROOT: $tmp_root\n"; 94 88 my $tmp_root = File::Temp::tempdir( CLEANUP => 1 ); 95 89 96 90 (undef, my $symfile) = File::Temp::tempfile( DIR => $tmp_root, SUFFIX => ".sym" ); … … 109 103 # Analiza pliku slownika 110 104 111 print "preparing file........................................... \n";112 print "... sed section .....\n";105 print "preparing file..........................................."; 106 #print "... sed section .....\n"; 113 107 (undef, my $file_sed) = File::Temp::tempfile( DIR => $tmp_root, SUFFIX => ".sed" ); 114 108 `sed -r "s/([[:punct:]])/\[\\1\]/g" < $file > $file_sed`; … … 123 117 open(IN, $file_sed); 124 118 125 $lineCount = 0;126 $fileCount = 0;119 my $lineCount = 0; 120 my $fileCount = 0; 127 121 128 122 open(FILE, ">$tmp_root/slo_$fileCount"); … … 147 141 148 142 #32 kropki, fileCount plikow 149 $filesPerDot = $fileCount/32;150 $files=$filesPerDot;151 $dots=0;152 153 for ( $i=0; $i<=$fileCount; $i++) {143 my $filesPerDot = $fileCount/32; 144 my $files=$filesPerDot; 145 my $dots=0; 146 147 for (my $i=0; $i<=$fileCount; $i++) { 154 148 155 149 if ($files >= $filesPerDot) { … … 164 158 } 165 159 if ($dots < 32) { 166 for ( $i=0; $i<32 - $dots; $i++) {160 for (my $i=0; $i<32 - $dots; $i++) { 167 161 print "."; 168 162 } … … 176 170 177 171 #35 kropek... 178 $ndots=33;172 my $ndots=33; 179 173 $filesPerDot = $fileCount/$ndots; 180 174 $files=$filesPerDot; … … 183 177 copy("$tmp_root/slownik_0.fsm", "$tmp_root/slownik1.fsm"); 184 178 185 for ( $i=1; $i<=$filecount; $i++) {179 for (my $i=1; $i<=$fileCount; $i++) { 186 180 187 181 if ($files >= $filesPerDot) { … … 192 186 $files++; 193 187 194 `fsmunion $tmp_root/slownik_$i slownik1.fsm > $tmp_ file/slownik2.fsm`;188 `fsmunion $tmp_root/slownik_$i slownik1.fsm > $tmp_root/slownik2.fsm`; 195 189 196 190 move("$tmp_root/slownik2.fsm", "$tmp_root/slownik1.fsm") || die "Unable to move $tmp_root/slownik2.fsm!\n"; … … 198 192 199 193 if ($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`; 206 200 207 201 print "OK\n";
Note: See TracChangeset
for help on using the changeset viewer.