File Coverage

blib/lib/Lingua/TFIDF/WordCounter/Simple.pm
Criterion Covered Total %
statement 14 14 100.0
branch n/a
condition n/a
subroutine 7 7 100.0
pod 0 4 0.0
total 21 25 84.0


line stmt bran cond sub pod time code
1             package Lingua::TFIDF::WordCounter::Simple;
2              
3 1     1   5 use strict;
  1         2  
  1         34  
4 1     1   6 use warnings;
  1         1  
  1         30  
5 1     1   5 use Smart::Args;
  1         2  
  1         171  
6              
7 1     1 0 6 sub new { bless +{ frequencies => +{} } => $_[0] }
8              
9             sub add_count {
10 419     419 0 836 args_pos
11             my $self,
12             my $word => 'Str';
13              
14 419         26151 ++$self->{frequencies}{$word};
15             }
16              
17 8     8 0 31 sub clear { $_[0]->{frequencies} = +{} }
18              
19 8     8 0 60 sub frequencies { $_[0]->{frequencies} }
20              
21             1;
22              
23             __END__
24              
25             =pod
26              
27             =encoding UTF-8
28              
29             =head1 NAME
30              
31             Lingua::TFIDF::WordCounter::Simple
32              
33             =head1 VERSION
34              
35             version 0.01
36              
37             =head1 AUTHOR
38              
39             Koichi SATOH <sekia@cpan.org>
40              
41             =head1 COPYRIGHT AND LICENSE
42              
43             This software is Copyright (c) 2014 by Koichi SATOH.
44              
45             This is free software, licensed under:
46              
47             The MIT (X11) License
48              
49             =cut