__PACKAGE__->config(
class => 'Text::Tradition::Analysis',
args => { 'traditions' => [
-# { 'file' => TreeOfTexts->path_to( 't', 'data', 'florilegium.xml' ),
-# 'stemmadot' => TreeOfTexts->path_to( 't', 'data', 'stemma_a.dot' ) },
+ { 'file' => TreeOfTexts->path_to( 't', 'data', 'florilegium.xml' ),
+ 'stemmadot' => TreeOfTexts->path_to( 't', 'data', 'stemma_a.dot' ) },
{ 'file' => TreeOfTexts->path_to( 't', 'data', 'besoin.xml' ),
'stemmadot' => TreeOfTexts->path_to( 't', 'data', 'stemma_b.dot' ) },
-# { 'file' => TreeOfTexts->path_to( 't', 'data', 'heinrichi.xml' ),
-# 'stemmadot' => TreeOfTexts->path_to( 't', 'data', 'stemma_h.dot' ) },
-# { 'file' => TreeOfTexts->path_to( 't', 'data', 'parzival.xml' ),
-# 'stemmadot' => TreeOfTexts->path_to( 't', 'data', 'stemma_p.dot' ) },
+ { 'file' => TreeOfTexts->path_to( 't', 'data', 'heinrichi.xml' ),
+ 'stemmadot' => TreeOfTexts->path_to( 't', 'data', 'stemma_h.dot' ) },
+ { 'file' => TreeOfTexts->path_to( 't', 'data', 'parzival.xml' ),
+ 'stemmadot' => TreeOfTexts->path_to( 't', 'data', 'stemma_p.dot' ) },
{ 'file' => TreeOfTexts->path_to( 't', 'data', 's158.xml' ),
'stemmadot' => TreeOfTexts->path_to( 't', 'data', 'stemma_s.dot' ) },
] },
use strict;
use warnings;
+use Benchmark;
use Exporter 'import';
use Text::Tradition;
use Text::Tradition::Stemma;
# We will return a data structure, an array for each row that looks like:
# { id = X, genealogical = Y, readings = [ text = X, group = Y], empty = N }
+ my $rank = 0;
+ my $t0 = Benchmark->new();
foreach my $i ( 0 .. $#$all_wits_table ) {
# For each column in the table, group the readings by witness.
my $rdg_wits = {};
my $col_rdgs = shift @$all_wits_table;
- my $rank;
+ # my $rank;
my $lacunose = [ @not_collated ];
foreach my $j ( 0 .. $#{$col_rdgs} ) {
my $rdg = $col_rdgs->[$j];
} else {
$rdg_text = $rdg->text;
# Get the rank from any real reading; they should be identical.
- $rank = $rdg->rank;
+ # $rank = $rdg->rank;
}
}
if( defined $rdg_text ) {
$total++ unless scalar keys %$rdg_wits == 1;
my( $groups, $readings ) = useful_variant( $rdg_wits );
next unless $groups && $readings;
+ $rank++;
# Keep track of our widest row
$html_columns = scalar @$groups if scalar @$groups > $html_columns;
# Record that we used this variant in an analysis
push( @$variants, $variant_row );
}
+ my $t1 = Benchmark->new();
+ print STDERR "Analysis of graph for " . $tradition->name . " took "
+ . timestr( timediff( $t1, $t0 ) ) . "seconds\n";
# Go through our variant rows, after we have seen all of them once,
# and add the number of empty columns needed by each.