new-words
changeset 19:416394a87d9f
minifix
author | Igor Chubin <igor@chub.in> |
---|---|
date | Tue Apr 20 21:15:19 2010 +0400 (2010-04-20) |
parents | 7e3a52db54ad |
children | 23f949c03f95 |
files | INSTALL.sh grep-sentences.pl new-words.sh |
line diff
1.1 --- a/INSTALL.sh Mon Apr 05 21:34:55 2010 +0300 1.2 +++ b/INSTALL.sh Tue Apr 20 21:15:19 2010 +0400 1.3 @@ -1,6 +1,6 @@ 1.4 #!/bin/sh 1.5 1.6 -if [ "$UID" == 0 ] 1.7 +if [ "$UID" = 0 ] 1.8 then 1.9 DEST=/usr/local/bin/ 1.10 else
2.1 --- a/grep-sentences.pl Mon Apr 05 21:34:55 2010 +0300 2.2 +++ b/grep-sentences.pl Tue Apr 20 21:15:19 2010 +0400 2.3 @@ -10,7 +10,7 @@ 2.4 $text =~ s@http://[a-zA-Z&_.:/0-9%?=,\#+()\[\]~-]*@@g; 2.5 $text =~ s@\n@@g; 2.6 $text =~ s@(Mr|Mrs)\.@\1POINT@g; 2.7 - @sentences=split /\./, $text; 2.8 + @sentences=split /[.!?]/, $text; 2.9 for (@sentences) { 2.10 s@(Mr|Mrs)POINT@\1.@g; 2.11 s/^\s*//;
3.1 --- a/new-words.sh Mon Apr 05 21:34:55 2010 +0300 3.2 +++ b/new-words.sh Tue Apr 20 21:15:19 2010 +0400 3.3 @@ -95,13 +95,15 @@ 3.4 my $total_known=shift(@ARGV); 3.5 my $s=0; 3.6 my $mark_line=int($total_known*100/$total/5)*5; 3.7 -if ($mark_line>=90) { $mark_line+=1; } else { $mark_line +=5; }; 3.8 +if ($mark_line>=90) { 3.9 + $mark_line=int($total_known*100/$total)+1; 3.10 +} else { $mark_line +=5; }; 3.11 while(<>) 3.12 { 3.13 print; 3.14 /^\s*([0-9]*)\s*/; 3.15 $s+=$1; 3.16 - if (int(($total_known+$s)*100/$total)>=$mark_line) { 3.17 + if (($total_known+$s)*100/$total>=$mark_line) { 3.18 print "# $mark_line\n"; 3.19 if ($mark_line>=90) { $mark_line+=1; } else { $mark_line +=5; }; 3.20 }