From: Tara L Andrews Date: Thu, 6 Oct 2011 14:10:54 +0000 (+0200) Subject: CollateX: no ranks if nonlinear X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=scpubgit%2Fstemmatology.git;a=commitdiff_plain;h=94a077d641e8c906d7131a059b009f335781337a;hp=e367f5c07b97362a0b60dba97fcc0ce944a4a08a CollateX: no ranks if nonlinear Analysis: fix bug in conflict detection --- diff --git a/Tradition.bbprojectd/project.bbprojectdata b/Tradition.bbprojectd/project.bbprojectdata index 6dacb92..777e914 100644 --- a/Tradition.bbprojectd/project.bbprojectdata +++ b/Tradition.bbprojectd/project.bbprojectdata @@ -88,9 +88,9 @@ AAAAAAGkAAIAAAxNYWNpbnRvc2ggSEQAAAAAAAAAAAAA AAAAAADKPI0jSCsAAAAILogRbWFrZV90cmFkaXRpb24u cGwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAADA/68quyjNURVhUAAAAAP// + AAAAAAAAAAAAAAAAAAAAADZNAcqzM/JURVhUAAAAAP// //8AAAkgAAAAAAAAAAAAAAAAAAAADHN0ZW1tYXRvbG9n - eQAQAAgAAMo8cQMAAAARAAgAAMqurhMAAAABABAACC6I + eQAQAAgAAMo8cQMAAAARAAgAAMqzF9IAAAABABAACC6I AAckkwAFBAYAAL8xAAIAQk1hY2ludG9zaCBIRDpVc2Vy czoAdGxhOgBQcm9qZWN0czoAc3RlbW1hdG9sb2d5OgBt YWtlX3RyYWRpdGlvbi5wbAAOACQAEQBtAGEAawBlAF8A diff --git a/TreeOfTexts/root/js/interaction.js b/TreeOfTexts/root/js/interaction.js index 919fd51..15f64e0 100644 --- a/TreeOfTexts/root/js/interaction.js +++ b/TreeOfTexts/root/js/interaction.js @@ -32,7 +32,7 @@ function color_nodes( column_index, arr_node_ids, arr_greynode_ids ) { jQuery.each( arr_node_ids, function(index,value) { $('.node').children('title').filter( function(index) { return $(this).text() == value; - }).siblings('ellipse, polygon').each( function( index ) { + }).siblings('ellipse').each( function( index ) { $(this).attr( {stroke:'black', fill:colors[column_index-1]} ); }); }); diff --git a/lib/Text/Tradition/Analysis.pm b/lib/Text/Tradition/Analysis.pm index b14f597..f4605ed 100644 --- a/lib/Text/Tradition/Analysis.pm +++ b/lib/Text/Tradition/Analysis.pm @@ -102,6 +102,7 @@ sub run_analysis { # For all the groups with more than one member, collect the list of all # contiguous vertices needed to connect them. # TODO: deal with a.c. reading logic + $DB::single = 1 if $rank == 25; my $variant_row = analyze_variant_location( $group_readings, $groups, $stemma->apsp, $lacunose ); $variant_row->{'id'} = $rank; @@ -150,10 +151,14 @@ sub analyze_variant_location { my %missing; map { $missing{$_} = 1 } @$lacunose; my $variant_row = { 'readings' => [] }; + # Mark each ms as in its own group, first. + foreach my $g ( @$groups ) { + my $gst = wit_stringify( $g ); + map { $contig{$_} = $gst } @$g; + } foreach my $g ( sort { scalar @$b <=> scalar @$a } @$groups ) { my @members = @$g; my $gst = wit_stringify( $g ); # $gst is now the name of this group. - map { $contig{$_} = $gst } @members; # All members are in this group. while( @members ) { # Gather the list of vertices that are needed to join all members. my $curr = pop @members; diff --git a/lib/Text/Tradition/Parser/CollateX.pm b/lib/Text/Tradition/Parser/CollateX.pm index 474d3ff..62123fe 100644 --- a/lib/Text/Tradition/Parser/CollateX.pm +++ b/lib/Text/Tradition/Parser/CollateX.pm @@ -167,7 +167,7 @@ sub parse { populate_witness_path( $tradition ); # Rank the readings. - $collation->calculate_ranks(); + $collation->calculate_ranks() if $collation->linear; } =head1 BUGS / TODO diff --git a/make_tradition.pl b/make_tradition.pl index a7a5030..28140e8 100755 --- a/make_tradition.pl +++ b/make_tradition.pl @@ -12,7 +12,7 @@ binmode STDOUT, ":utf8"; eval { no warnings; binmode $DB::OUT, ":utf8"; }; my( $informat, $inbase, $outformat, $help, $linear, $name, $HACK ) - = ( '', '', '', '', 1, 0 ); + = ( '', '', '', '', 0, 0 ); GetOptions( 'i|in=s' => \$informat, 'b|base=s' => \$inbase,