Revision 147

Date:
2009/10/07 23:21:59
Author:
dpavlin
Revision Log:
improved C1_country view
Files:

Legend:

 
Added
 
Removed
 
Modified
  • trunk/views/00.demo.pl

     
    3 3
    4 4 #$out->{ 'years +' }->{ $rec->{PY}->[0] }++;
    5 5
    6 $out->{ 'DT +' }->{ $_ }++ foreach @{ $rec->{DT} };
    6 #$out->{ 'DT +' }->{ $_ }++ foreach @{ $rec->{DT} };
    7 7
    8 $out->{'SC +'}->{ $_ }++ foreach @{ $rec->{SC} };
    8 #$out->{'SC +'}->{ $_ }++ foreach @{ $rec->{SC} };
    9 9
    10 10 # FIXME out of memory without Sack::Digest
    11 11 #$out->{'C1 +'}->{ $_ }++ foreach @{ $rec->{C1} };
    12 12 #$out->{'C1#+'}->{ $_ }++ foreach @{ $rec->{C1} };
    13 13
    14 14
    15 #$out->{'C1_country+'}->{ m{,\s?([^,]+)\.$} && ucfirst(lc($1)) }++ foreach @{ $rec->{C1} };
    15 #$out->{'C1_country+'}->{ m{,\s?([^,]+)\.$} && $1 }++ foreach @{ $rec->{C1} };
    16 16
    17 foreach ( @{ $rec->{C1} } ) {
    18 my $country = $1 if m{,\s?([^,]+)\.$};
    19 $country =~ s{^.+USA$}{USA};
    20 $country =~ s{^\w\w\s\d{5}$}{USA};
    21 $country =~ s{^\w\w$}{USA};
    22 # $country =~ s{^([A-Z]+)$}{ucfirst($1)}e;
    23 $country =~ s{^YUGOS.+}{Yugoslavia};
    24 $out->{'C1_country+'}->{ uc $country }++;
    25 }
    17 26
    27
    18 28 #$out->{'CR#+'}->{ $_ }++ foreach @{ $rec->{CR} };
    19 29
    20 my $cr = 1;
    21 my $nr = $out->{_debug}->{nr}++;
    30 #$out->{'CR+'}->{ $_ }++ foreach @{ $rec->{CR} };
    31
    32 #$out->{'CR'}->{ $_ }++ foreach @{ $rec->{CR} };
    33
    34 #my $cr = 1;
    35 #my $nr = $out->{_debug}->{nr}++;
    22 36 #$out->{'CR +'}->{ "$nr." . $cr++ }++ foreach @{ $rec->{CR} };
    23 37
    24 38 # XXX dump first record
     
    28 42
    29 43 #push @{ $out->{_debug}->{id} }, $rec->{'000'};
    30 44
    45 if (0) {
    31 46 $out->{'_debug'}->{records}++ if $rec;
    32 47 $out->{'_debug'}->{start_t} ||= time;
    33 48 $out->{'_debug'}->{duration} = time - $out->{'_debug'}->{start_t};
    49 }