X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=scpubgit%2Fstemmatology.git;a=blobdiff_plain;f=lib%2FText%2FTradition%2FParser%2FCollateX.pm;h=628e672496d461c13400d6f0d680691c693f0d1d;hp=3521d9ffb0611590a6448c9ccde5dfcd3a70dc50;hb=1ff82d4f33cfde715c3f06f4e7b6735ad389745c;hpb=2f54cbcd936095989331cbe1eaefec1083c7d8fb diff --git a/lib/Text/Tradition/Parser/CollateX.pm b/lib/Text/Tradition/Parser/CollateX.pm index 3521d9f..628e672 100644 --- a/lib/Text/Tradition/Parser/CollateX.pm +++ b/lib/Text/Tradition/Parser/CollateX.pm @@ -132,13 +132,18 @@ sub parse { $collation->add_path( $from->{$IDKEY}, $to->{$IDKEY}, $wit ); } } else { # type 'relationship' - $collation->add_relationship( $from->{$IDKEY}, $to->{$IDKEY}, - { 'type' => 'transposition' } ); + if( $collation->linear ) { + $collation->add_relationship( $from->{$IDKEY}, $to->{$IDKEY}, + { 'type' => 'transposition' } ); + } else { + $collation->merge_readings( $from->{$IDKEY}, $to->{$IDKEY} ); + } } } # Rank the readings. - $collation->calculate_common_readings(); # will implicitly rank + $collation->calculate_common_readings() + if $collation->linear; # will implicitly rank # Save the text for each witness so that we can ensure consistency # later on