line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Lingua::StanfordCoreNLP; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
25961
|
use strict; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
65
|
|
4
|
|
|
|
|
|
|
#use warnings; |
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
our ($JAR_PATH, $JAVA_ARGS); |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
BEGIN { |
9
|
1
|
|
|
1
|
|
5
|
use Config; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
78
|
|
10
|
1
|
|
|
1
|
|
6
|
use File::Spec; |
|
1
|
|
|
|
|
7
|
|
|
1
|
|
|
|
|
46
|
|
11
|
1
|
|
|
1
|
|
1532
|
use Env qw($LINGUA_CORENLP_JAR_PATH $LINGUA_CORENLP_VERSION $LINGUA_CORENLP_JAVA_ARGS); |
|
1
|
|
|
|
|
3970
|
|
|
1
|
|
|
|
|
10
|
|
12
|
|
|
|
|
|
|
|
13
|
1
|
|
|
1
|
|
215
|
use Exporter (); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
318
|
|
14
|
1
|
|
|
1
|
|
19
|
our @ISA = qw(Exporter); |
15
|
1
|
|
|
|
|
3
|
our @EXPORT = (); |
16
|
1
|
|
|
|
|
2
|
our $VERSION = '0.10'; |
17
|
1
|
|
|
|
|
150
|
$VERSION = eval $VERSION; |
18
|
|
|
|
|
|
|
|
19
|
1
|
50
|
|
|
|
7
|
our $CORENLP_VERSION = defined $LINGUA_CORENLP_VERSION |
20
|
|
|
|
|
|
|
? $LINGUA_CORENLP_VERSION |
21
|
|
|
|
|
|
|
: '1.3.4'; |
22
|
|
|
|
|
|
|
|
23
|
1
|
50
|
|
|
|
15
|
$JAVA_ARGS = defined $LINGUA_CORENLP_JAVA_ARGS |
24
|
|
|
|
|
|
|
? $LINGUA_CORENLP_JAVA_ARGS |
25
|
|
|
|
|
|
|
: '-Xmx2000m'; |
26
|
|
|
|
|
|
|
|
27
|
1
|
|
|
|
|
10
|
my ($mod_path) = __FILE__ =~ /(.*)\.pm/; |
28
|
1
|
50
|
|
|
|
3
|
my $pkg_path = defined $LINGUA_CORENLP_JAR_PATH ? $LINGUA_CORENLP_JAR_PATH : $mod_path; |
29
|
1
|
|
|
|
|
7
|
my @jar_files; |
30
|
|
|
|
|
|
|
|
31
|
1
|
50
|
|
|
|
4
|
if ($pkg_path =~ /\*\.jar$/) { |
32
|
0
|
|
|
|
|
0
|
@jar_files = glob($pkg_path); |
33
|
|
|
|
|
|
|
} else { |
34
|
1
|
|
|
|
|
1
|
@jar_files = map { File::Spec->catfile($pkg_path, $_); } qw( |
|
5
|
|
|
|
|
53
|
|
35
|
|
|
|
|
|
|
stanford-corenlp-$$.jar |
36
|
|
|
|
|
|
|
stanford-corenlp-$$-models.jar |
37
|
|
|
|
|
|
|
joda-time.jar |
38
|
|
|
|
|
|
|
jollyday.jar |
39
|
|
|
|
|
|
|
xom.jar |
40
|
|
|
|
|
|
|
); |
41
|
|
|
|
|
|
|
} |
42
|
1
|
|
|
|
|
8
|
push @jar_files, File::Spec->catfile($mod_path, 'LinguaSCNLP.jar'); |
43
|
|
|
|
|
|
|
|
44
|
1
|
|
|
|
|
11
|
$JAR_PATH = join($Config{'path_sep'}, @jar_files); |
45
|
1
|
|
|
|
|
49
|
$JAR_PATH =~ s/\$\$/$CORENLP_VERSION/g; |
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
use Inline ( |
49
|
0
|
|
|
|
|
|
Java => 'DATA', |
50
|
|
|
|
|
|
|
CLASSPATH => $JAR_PATH, |
51
|
|
|
|
|
|
|
EXTRA_JAVA_ARGS => $JAVA_ARGS, |
52
|
|
|
|
|
|
|
AUTOSTUDY => 1 |
53
|
1
|
|
|
1
|
|
479
|
); |
|
0
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
1; |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
__DATA__ |