-
Notifications
You must be signed in to change notification settings - Fork 7
/
noralujv.pl
41 lines (35 loc) · 927 Bytes
/
noralujv.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
35
36
37
38
39
40
41
#!/usr/bin/env perl
# $Header$
# Process the NORALUJV.txt file to generate dictionary input
#
# COPYRIGHT
open (IN, "<NORALUJV.txt") || die "Could not open NORALUJV.txt";
@lines = <IN>;
close (IN);
foreach $x (@lines) {
chomp $x;
$lujvo = substr($x, 0, 30);
$lujvo =~ s/ +$//;
$rest = substr($x, 31);
$rest =~ m/^([^:]*):([^:]*):(.*)$/ || next;
$makeup = $1;
$trans = $2;
$plac = $3;
$plac =~ s/\([^\)]+\)//g;
@plac = split(/,/, $plac);
$trans =~ s/^ +//;
$trans =~ s/ +$//;
print $lujvo."1:".$trans."\n";
@places = ();
foreach $p (@plac) {
if ($p =~ m/x([1-9]) = ([a-z\']+[12345])/) {
$place = $1;
$gismu = $2;
$gplace = $3;
if ($place > 1) {
$places[$place] = $gismu.$gplace;
print $lujvo.$place.":\@".$gismu.$gplace."\n";
}
}
}
}