]> git.donarmstrong.com Git - bin.git/commitdiff
* update anamang
authorDon Armstrong <don@donarmstrong.com>
Sat, 17 Jan 2009 00:58:48 +0000 (00:58 +0000)
committerDon Armstrong <don@donarmstrong.com>
Sat, 17 Jan 2009 00:58:48 +0000 (00:58 +0000)
anamang

diff --git a/anamang b/anamang
index 54cd32b98a916284f94f11347d5dca9c58b86d62..78f0ea322de1328761804e8645de2e031cb046cd 100755 (executable)
--- a/anamang
+++ b/anamang
@@ -119,13 +119,12 @@ if (not @words) {
     exit 1;
 }
 
-my $database = update_and_load_database($options{database_dir},$options{wordlist});
-
 # letter order
 my @l_o = ('a'..'z');
 my %l_o;
 @l_o{@l_o} = (0 .. 25);
 
+my $database = update_and_load_database($options{database_dir},$options{wordlist});
 
 # run through and use the database
 
@@ -270,6 +269,8 @@ sub update_and_load_database {
            chomp;
            next unless length $_;
            my $word = lc($_);
+           $word =~ s/[^a-z]//;
+           next unless length $_;
            next if exists $seen_words{$word};
            $seen_words{$word} = 1;
            if ((keys %seen_words) % 100 == 0) {