-
Notifications
You must be signed in to change notification settings - Fork 1
/
msgstrchk.pl
34 lines (28 loc) · 640 Bytes
/
msgstrchk.pl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/usr/bin/perl
# checks all mappings in en2wn.po to be sure they actually exist in
# the current version of WN linked in this dir
use strict;
use warnings;
my %sensekeys;
open(INDEX, "<", "index.sense") or die "Could not open index.sense: $!";
while (<INDEX>) {
chomp;
s/ .+//;
$sensekeys{$_}++;
}
close INDEX;
open(ENWNPO, "<", "en2wn.po") or die "Could not open PO file: $!";
while (<ENWNPO>) {
chomp;
if (/^msgstr/) {
s/^msgstr "//;
s/"$//;
unless ($_ eq 'NULL' or $_ eq '' or m/^Content-Type/) {
unless (exists ($sensekeys{$_})) {
print "msgstr $_ not in index.sense...\n";
}
}
}
}
close ENWNPO;
exit 0;