From: Tara L Andrews Date: Fri, 21 Oct 2011 20:14:28 +0000 (+0200) Subject: grey out any stemma node not in the collation X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=4f343ec00a314758011005e720d44826afa776fd;p=scpubgit%2Fstemmatology.git grey out any stemma node not in the collation --- diff --git a/lib/Text/Tradition/Analysis.pm b/lib/Text/Tradition/Analysis.pm index 7eaee51..49cbe95 100644 --- a/lib/Text/Tradition/Analysis.pm +++ b/lib/Text/Tradition/Analysis.pm @@ -53,6 +53,11 @@ sub run_analysis { # Strip the list of sigla and save it for correlation to the readings. my $col_wits = shift @$all_wits_table; + # Any witness in the stemma that has no row should be noted. + foreach ( @$col_wits ) { + $wits->{$_}++; + } + my @not_collated = grep { $wits->{$_} == 1 } keys %$wits; # 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 } @@ -61,7 +66,7 @@ sub run_analysis { my $rdg_wits = {}; my $col_rdgs = shift @$all_wits_table; my $rank; - my $lacunose = []; + my $lacunose = [ @not_collated ]; foreach my $j ( 0 .. $#{$col_rdgs} ) { my $rdg = $col_rdgs->[$j]; my $rdg_text = '(omitted)'; # Initialize in case of empty reading