Algorithm-Accounting

 view release on metacpan or  search on metacpan

lib/Algorithm/Accounting.pm  view on Meta::CPAN

        \$obj = $class->new;
    };
    die"report() error\n" if $@;
    $obj->process(
        $self->occurrence_hash,
        $self->field_groups,
        $self->group_occurrence
       );
}

sub update_group_field {
  my $data = shift;
  my $groups = $self->field_groups || return;
  my $gocc = $self->group_occurrence;
  for my $i (0..@$groups-1) {
    my @index = $self->position_of($self->fields,$groups->[$i]);
    for my $row (@$data) {
      my $permutor = Algorithm::Accounting::Array::Iterator::LOL->new([@$row[@index]]);
      my %exclude;
      while(my $permutation = $permutor->getNext) {
 	my @_row = map {(ref($_) ? $_->[0] : $_)||''} @$permutation;

lib/Algorithm/Accounting.pm  view on Meta::CPAN

 	unless($exclude{$__row}) {
 	  $gocc->[$i]->{freeze(@_row)}++;
 	  $exclude{$__row}++;
 	}
      }
    }
  }
  $self->group_occurrence($gocc);
}

sub update_single_field {
  my $data = shift;
  my $aocc = $self->occurrence_array;
  my $hocc = $self->occurrence_hash;
  my $fields = $self->fields;
  for my $i (0..@$fields-1) {
    my $occ = $aocc->[$i] || {};
    for(@$data) {
      last unless exists $_->[$i];
      if('ARRAY' eq ref($_->[$i])) {
	for my $v (@{$_->[$i]}) {$occ->{$v}++}



( run in 0.228 second using v1.01-cache-2.11-cpan-95122f20152 )