-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathlee_check.pl
executable file
·51 lines (42 loc) · 1.4 KB
/
lee_check.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
42
43
44
45
46
47
48
49
50
51
#!/usr/bin/env perl
# Text::TogoAnnotatorを利用したバージョン
# Emacsが適切に本ファイルの文字コード(UTF8)を判断できるようにして書き込みしておく。
use warnings;
use strict;
use Fatal qw/open/;
use Getopt::Std;
use JSON::XS;
#use lib qw(/opt/services2/togoannot/togoannotator);
#use lib qw(/home/tga/togoannotator /home/tga/simstring-1.0/swig/perl);
use FindBin qw($Bin);
use lib "$Bin";
use open qw/:utf8/;
use Text::TogoAnnotator;
use utf8;
my $verify = "product_checklist.txt";
#my $sysroot = '/opt/services2/togoannot/togoannotator';
#my $sysroot = '/home/tga/togoannotator';
my $sysroot = "$Bin";
my $evaldir = 'lee_batch';
$| = 1;
our ($opt_t, $opt_m) = (0.6, 5);
getopt('tm'); # -tm take arg. Sets $opt_t, $opt_m as a side effect.
print "#th:", $opt_t, ", dm:", $opt_m, "\n";
Text::TogoAnnotator->init($opt_t, 30, $opt_m, 3, $sysroot, $evaldir."/dictionary.txt", undef, 0, "lee");
#Text::TogoAnnotator->init($opt_t, 30, $opt_m, 3, $sysroot, "nite_ALL_1305_99.txt");
Text::TogoAnnotator->openDicts;
match();
Text::TogoAnnotator->closeDicts;
sub match{
open(my $VRFY, $sysroot.'/'.$verify);
while(<$VRFY>){
chomp;
my @vals = split /\t/;
print join("\t", ("Lee", @vals[0..1]));
my $r = Text::TogoAnnotator->retrieve($vals[0]);
print "\t", join("\t", (@$r{'match','result','info'})), "\n";
}
close($VRFY);
return;
}
__END__