X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FText%2FTradition%2FAnalysis.pm;h=fda51376077c9e67781e1c5e134c203704fd706a;hb=679f17e1a60a81370df8cbb49b94a2b5d19e3a98;hp=8bfaf1ac107022ca10d261b810d51c997f494b82;hpb=a2ed66b255a1b88374b5279faa18f0c390ca5dbb;p=scpubgit%2Fstemmatology.git diff --git a/lib/Text/Tradition/Analysis.pm b/lib/Text/Tradition/Analysis.pm index 8bfaf1a..fda5137 100644 --- a/lib/Text/Tradition/Analysis.pm +++ b/lib/Text/Tradition/Analysis.pm @@ -56,6 +56,8 @@ is 0 (i.e. the first). =item * merge_types - Specify a list of relationship types, where related readings should be treated as identical for the purposes of analysis. +=item * exclude_type1 - Exclude those ranks whose groupings have only type-1 variants. + =back =begin testing @@ -150,7 +152,13 @@ sub run_analysis { my %lacunae; foreach my $rank ( @ranks ) { my $missing = [ @lacunose ]; - push( @groups, group_variants( $tradition, $rank, $missing, \@collapse ) ); + my $rankgroup = group_variants( $tradition, $rank, $missing, \@collapse ); + if( $opts{'exclude_type1'} ) { + # Check to see whether this is a "useful" group. + my( $rdgs, $grps ) = _useful_variant( $rankgroup ); + next unless @$rdgs; + } + push( @groups, $rankgroup ); $lacunae{$rank} = $missing; } $DB::single = 1; @@ -187,8 +195,8 @@ relationships in @merge_relationship_types as equivalent. $lacunose should be a reference to an array, to which the sigla of lacunose witnesses at this rank will be appended. -Returns two ordered lists $readings, $groups, where $readings->[$n] is attested -by the witnesses listed in $groups->[$n]. +Returns a hash $group_readings where $rdg is attested by the witnesses listed +in $group_readings->{$rdg}. =cut