line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package AI::CRM114;
|
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
22559
|
use 5.008000;
|
|
1
|
|
|
|
|
5
|
|
|
1
|
|
|
|
|
43
|
|
4
|
1
|
|
|
1
|
|
5
|
use strict;
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
33
|
|
5
|
1
|
|
|
1
|
|
4
|
use warnings;
|
|
1
|
|
|
|
|
6
|
|
|
1
|
|
|
|
|
37
|
|
6
|
1
|
|
|
1
|
|
1520
|
use IPC::Run qw /run/;
|
|
1
|
|
|
|
|
67746
|
|
|
1
|
|
|
|
|
349
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
our @ISA = qw();
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
our $VERSION = '0.01';
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub new {
|
13
|
0
|
|
|
0
|
1
|
|
my $class = shift;
|
14
|
0
|
|
|
|
|
|
my $self = { cmd => 'crm', @_ };
|
15
|
0
|
|
|
|
|
|
bless $self, $class;
|
16
|
0
|
|
|
|
|
|
return $self;
|
17
|
|
|
|
|
|
|
}
|
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
sub classify {
|
20
|
0
|
|
|
0
|
1
|
|
my ($self, $flags, $files, $text) = @_;
|
21
|
|
|
|
|
|
|
|
22
|
0
|
|
|
|
|
|
my $code = qq#-{
|
23
|
|
|
|
|
|
|
isolate (:stats:);
|
24
|
|
|
|
|
|
|
classify <@$flags> ( @$files ) (:stats:);
|
25
|
|
|
|
|
|
|
output /:*:stats:/
|
26
|
|
|
|
|
|
|
}#;
|
27
|
|
|
|
|
|
|
|
28
|
0
|
|
|
|
|
|
my $o = "";
|
29
|
0
|
|
|
|
|
|
my $h = run [$self->{cmd}, $code], \$text, \$o;
|
30
|
|
|
|
|
|
|
|
31
|
0
|
|
|
|
|
|
my ($file, $prob, $pr) = $o =~
|
32
|
|
|
|
|
|
|
/Best match to file \S+ \((.*?)\) +prob: *([0-9.]+) +pR: *([0-9.-]+)/;
|
33
|
|
|
|
|
|
|
|
34
|
0
|
0
|
|
|
|
|
wantarray ? ($file, $prob, $pr) : $file;
|
35
|
|
|
|
|
|
|
}
|
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
sub learn {
|
38
|
0
|
|
|
0
|
1
|
|
my ($self, $flags, $file, $text) = @_;
|
39
|
|
|
|
|
|
|
|
40
|
0
|
|
|
|
|
|
my $code = qq#-{ learn <@$flags> ( $file ) }#;
|
41
|
|
|
|
|
|
|
|
42
|
0
|
|
|
|
|
|
my $o = "";
|
43
|
0
|
|
|
|
|
|
my $h = run [$self->{cmd}, $code], \$text, \$o;
|
44
|
|
|
|
|
|
|
}
|
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
1;
|
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
__END__
|