NAME
Data::Freq::Field - Controls counting with Data::Freq at each level
METHODS
new
Usage:
Data::Freq::Field->new({
type => 'text' , # { 'text' | 'number' | 'date' }
sort => 'count', # { 'value' | 'count' | 'first' | 'last' }
order => 'desc' , # { 'asc' | 'desc' }
pos => 0 , # { 0 | 1 | 2 | -1 | -2 | .. | [0, 1, 2] | .. }
key => 'mykey', # { any key(s) for input hash refs }
convert => sub {...},
});
Constructs a field object.
See "field specification" in Data::Freq for details.
evaluate_record
Usage:
my $field = Data::Freq::Field->new(...);
my $record = Data::Freq::Record->new(...);
my $normalized_text = $field->evaluate_record($record);
Evaluates an input record as a normalized text that will be used for frequency counting, depending on the parameters passed to the new() method.
This is intended to be an internal method for Data::Freq.
select_nodes
Usage:
my $raw_node_list = [values %{$parent_node->children}];
my $sorted_node_list = $field->select_nodes($raw_node_list);
Sorts and reduces a list of nodes (Data::Freq::Node) at the corresponding depth in the frequency tree, depending on the parameters passed to the new() method.
This is intended to be an internal method for Data::Freq.
type
Retrieves the type
parameter.
aggregate
Retrieves the aggregate
parameter.
sort
Retrieves the sort
parameter.
order
Retrieves the order
parameter.
pos
Retrieves the pos
parameter as an array ref.
key
Retrieves the key
parameter as an array ref.
limit
Retrieves the limit
parameter.
offset
Retrieves the offset
parameter.
strftime
Retrieves the strftime
parameter (POSIX::strftime()).
convert
Retrieves the convert
parameter.
AUTHOR
Mahiro Ando, <mahiro at cpan.org>
LICENSE AND COPYRIGHT
Copyright 2012 Mahiro Ando.
This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.
See http://dev.perl.org/licenses/ for more information.