Data::Freq::Field - Controls counting with Data::Freq at each level
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.
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.
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.
Retrieves the type parameter.
type
Retrieves the aggregate parameter.
aggregate
Retrieves the sort parameter.
sort
Retrieves the order parameter.
order
Retrieves the pos parameter as an array ref.
pos
Retrieves the key parameter as an array ref.
key
Retrieves the limit parameter.
limit
Retrieves the offset parameter.
offset
Retrieves the strftime parameter (POSIX::strftime()).
strftime
Retrieves the convert parameter.
convert
Mahiro Ando, <mahiro at cpan.org>
<mahiro at cpan.org>
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.
To install Data::Freq, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Data::Freq
CPAN shell
perl -MCPAN -e shell install Data::Freq
For more information on module installation, please visit the detailed CPAN module installation guide.