From: Tara L Andrews Date: Sat, 21 Jan 2012 21:18:53 +0000 (+0100) Subject: restore total count; get rid of benchmarking X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=a2cf85dd89b882408436836441a51588d97ed443;p=scpubgit%2Fstemmatology.git restore total count; get rid of benchmarking --- diff --git a/lib/Text/Tradition/Analysis.pm b/lib/Text/Tradition/Analysis.pm index b60de8d..7bded9e 100644 --- a/lib/Text/Tradition/Analysis.pm +++ b/lib/Text/Tradition/Analysis.pm @@ -8,7 +8,7 @@ use Text::Tradition; use Text::Tradition::Stemma; use vars qw/ @EXPORT_OK /; -@EXPORT_OK = qw/ run_analysis group_variants wit_stringify /; +@EXPORT_OK = qw/ run_analysis group_variants analyze_variant_location wit_stringify /; sub run_analysis { my( $tradition ) = @_; @@ -31,9 +31,8 @@ sub run_analysis { # groupings of witnesses match our stemma hypothesis. We also need to keep # track of the maximum number of variants at any one location. my $max_variants = 0; - my ( $total, $genealogical, $conflicts ) = ( 0, 0, 0 ); + my ( $genealogical, $conflicts ) = ( 0, 0, 0 ); - my $t0 = Benchmark->new(); my $variant_groups = group_variants( $tradition->collation, $wits ); foreach my $rank ( 0 .. $#{$variant_groups} ) { my $groups = $variant_groups->[$rank]->{'groups'}; @@ -72,10 +71,7 @@ sub run_analysis { # Record that we used this variant in an analysis push( @$variants, $variant_loc ); } - my $t1 = Benchmark->new(); - print STDERR "Analysis of graph for " . $tradition->name . " took " - . timestr( timediff( $t1, $t0 ) ) . "seconds\n"; - + # Go through our variant locations, after we have seen all of them once, # and add the number of empty columns needed by each. foreach my $row ( @$variants ) { @@ -84,7 +80,7 @@ sub run_analysis { } $data->{'variants'} = $variants; - $data->{'variant_count'} = $total; + $data->{'variant_count'} = $tradition->collation->end->rank - 1; $data->{'conflict_count'} = $conflicts; $data->{'genealogical_count'} = $genealogical; return $data;