forked from citiususc/Linguakit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
lexicon_compiler.perl
executable file
·63 lines (52 loc) · 1.46 KB
/
lexicon_compiler.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
#!/usr/bin/env perl
use strict;
use warnings;
use File::Basename;
$| = 1;
if (!eval{require Storable;}){
warn "Please install Storable module: cpan Storable\n";
exit(1);
}
my $path = dirname(__FILE__);
my @lex_stored = (
"$path/tagger/en/lexicon/lex_stored",
"$path/tagger/es/lexicon/lex_stored",
"$path/tagger/pt/lexicon/lex_stored",
"$path/tagger/gl/lexicon/lex_stored",
"$path/tagger/gl/lexicon/split_stored",
"$path/tagger/histgz/lexicon/lex_stored",
"$path/tagger/histgz/lexicon/split_stored"
);
foreach my $file ( @lex_stored ) {
if (-e $file) {
unlink $file or die "Could not delete $file: $!";
}
}
print ("Compiling lexicons:\n");
print ("\tEnglish \t");
my $lex = "$path/tagger/en/store_lex.perl";
do $lex;
print ((-e $lex) ? "Done\n": "Failed\n");
print ("\tPortuguese\t");
$lex = "$path/tagger/pt/store_lex.perl";
do $lex;
print ((-e $lex) ? "Done\n": "Failed\n");
print ("\tSpanish \t");
$lex = "$path/tagger/es/store_lex.perl";
do $lex;
print ((-e $lex) ? "Done\n": "Failed\n");
print ("\tGalician \t");
$lex = "$path/tagger/gl/store_lex.perl";
do $lex;
print ((-e $lex) ? "Done ": "Failed ");
$lex = "$path/tagger/gl/store_split.perl";
do $lex;
print ((-e $lex) ? "Done\n": "Failed\n");
print ("\tHistoric galician-portuguese \t");
$lex = "$path/tagger/histgz/store_lex.perl";
do $lex;
print ((-e $lex) ? "Done ": "Failed ");
$lex = "$path/tagger/histgz/store_split.perl";
do $lex;
print ((-e $lex) ? "Done\n": "Failed\n");
print ("Installation done!\n");