| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package Gesture::Simple; |
|
2
|
1
|
|
|
1
|
|
1623
|
use Any::Moose; |
|
|
1
|
|
|
|
|
40010
|
|
|
|
1
|
|
|
|
|
6
|
|
|
3
|
1
|
|
|
1
|
|
566
|
use 5.008001; |
|
|
1
|
|
|
|
|
3
|
|
|
|
1
|
|
|
|
|
50
|
|
|
4
|
|
|
|
|
|
|
|
|
5
|
1
|
|
|
1
|
|
645
|
use Gesture::Simple::Gesture; |
|
|
1
|
|
|
|
|
2
|
|
|
|
1
|
|
|
|
|
29
|
|
|
6
|
1
|
|
|
1
|
|
590
|
use Gesture::Simple::Template; |
|
|
1
|
|
|
|
|
3
|
|
|
|
1
|
|
|
|
|
57
|
|
|
7
|
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
our $VERSION = '0.01'; |
|
9
|
|
|
|
|
|
|
|
|
10
|
1
|
|
|
1
|
|
7
|
use constant gesture_class => 'Gesture::Simple::Gesture'; |
|
|
1
|
|
|
|
|
1
|
|
|
|
1
|
|
|
|
|
6108
|
|
|
11
|
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
has templates => ( |
|
13
|
|
|
|
|
|
|
is => 'ro', |
|
14
|
|
|
|
|
|
|
isa => 'ArrayRef', |
|
15
|
|
|
|
|
|
|
default => sub { [] }, |
|
16
|
|
|
|
|
|
|
auto_deref => 1, |
|
17
|
|
|
|
|
|
|
); |
|
18
|
|
|
|
|
|
|
|
|
19
|
4
|
|
|
4
|
0
|
7
|
sub has_templates { @{ shift->templates } > 0 } |
|
|
4
|
|
|
|
|
28
|
|
|
20
|
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
sub add_template { |
|
22
|
2
|
|
|
2
|
0
|
3480
|
my $self = shift; |
|
23
|
|
|
|
|
|
|
|
|
24
|
2
|
|
|
|
|
5
|
for (@_) { |
|
25
|
2
|
50
|
33
|
|
|
38
|
blessed($_) && $_->isa('Gesture::Simple::Template') |
|
26
|
|
|
|
|
|
|
or confess "$_ is not a Gesture::Simple::Template."; |
|
27
|
|
|
|
|
|
|
} |
|
28
|
|
|
|
|
|
|
|
|
29
|
2
|
|
|
|
|
4
|
push @{ $self->templates }, @_; |
|
|
2
|
|
|
|
|
14
|
|
|
30
|
|
|
|
|
|
|
} |
|
31
|
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
sub match { |
|
33
|
4
|
|
|
4
|
0
|
7111
|
my $self = shift; |
|
34
|
4
|
|
|
|
|
18
|
my $gesture = shift; |
|
35
|
|
|
|
|
|
|
|
|
36
|
4
|
50
|
|
|
|
17
|
confess "You have no templates to match against!" |
|
37
|
|
|
|
|
|
|
unless $self->has_templates; |
|
38
|
|
|
|
|
|
|
|
|
39
|
4
|
50
|
|
|
|
21
|
$gesture = $self->gesture_class->new(points => $gesture) |
|
40
|
|
|
|
|
|
|
if !blessed($gesture); |
|
41
|
|
|
|
|
|
|
|
|
42
|
3
|
|
|
|
|
27
|
my @matches = sort { $b->score <=> $a->score } |
|
|
7
|
|
|
|
|
40
|
|
|
43
|
4
|
|
|
|
|
17
|
map { $_->match($gesture) } |
|
44
|
|
|
|
|
|
|
$self->templates; |
|
45
|
|
|
|
|
|
|
|
|
46
|
4
|
100
|
|
|
|
160
|
return @matches if wantarray; |
|
47
|
1
|
|
|
|
|
6
|
return $matches[0]; |
|
48
|
|
|
|
|
|
|
} |
|
49
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
__PACKAGE__->meta->make_immutable; |
|
51
|
1
|
|
|
1
|
|
7
|
no Any::Moose; |
|
|
1
|
|
|
|
|
2
|
|
|
|
1
|
|
|
|
|
5
|
|
|
52
|
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
1; |
|
54
|
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
__END__ |