-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgfcm.perl
77 lines (65 loc) · 1.7 KB
/
gfcm.perl
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
$argv = join ":", @ARGV;
die "Usage: perl gfcm.perl (Agenda|MP3|Delux|Tram) (Present|Single|Unimodal)* usermodule lng ... \n"
unless $argv =~ /^(Agenda | MP3 | Delux | Tram) :
((Present | Single | Unimodal) :)* \w+ (: \w\w\w)+$/x;
$dom = shift;
$dir = $dom;
while ($ARGV[0] =~ /^(Present|Single|Unimodal)$/) {
$flag = shift;
$$flag = $flag;
}
$usrmod = shift;
@mods = ("System", $Unimodal ? () : ("SystemMM"));
@langs = @ARGV;
$pre = $Present . $Single . $Unimodal;
$pre = $pre ?"-preproc=./mk$pre" : "";
$opts = "-s -nocf -optimize=share_subs";
print "! rm -f $dir/*.gfc $dir/*.gfr Common/*.gfc Common/*.gfr \n";
print "! rm -f output/temp-* \n";
######################################################################
# system modules
for $mod (@mods) {
$gram = $dom . $mod;
print "! echo '== Creating GFCM+CFGM for $gram' \n";
for $lng (@langs) {
print <<XXX;
e
i $opts $pre $dir/$gram$lng.gf
s
pm -printer=gfcm | wf output/temp-$gram$lng.gfcm
XXX
}
print "e \n";
for $lng (@langs) {
print "i output/temp-$gram$lng.gfcm \n";
}
print <<XXX;
pm -utf8 -utf8id -printer=header | wf output/$gram.gfcm
e
i $opts $pre $dir/${gram}Sem.gf
s
pm -utf8 -utf8id -printer=cfgm | wf output/$gram.cfgm
XXX
}
######################################################################
# the user module
$gram = $dom . $usrmod;
for $lng (@langs) {
print <<XXX;
e
i $opts $dir/$gram$lng.gf
s
pm -printer=gfcm | wf output/temp-$gram$lng.gfcm
XXX
}
print "e \n";
for $lng (@langs) {
print "i output/temp-$gram$lng.gfcm \n";
}
print <<XXX;
pm -utf8 -utf8id -printer=cfgm | wf output/$gram.cfgm
e
i $opts $dir/${gram}Sem.gf
s
pm -utf8 -utf8id -printer=header | wf output/$gram.gfcm
XXX