From: Eden Cardim Date: Tue, 31 Jul 2012 13:41:05 +0000 (-0300) Subject: fixing start/end nodes X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=144d845bf7f7c1a72c065e84235422f18af84ca3;p=scpubgit%2Fstemmatology.git fixing start/end nodes Conflicts: lib/Text/Tradition/Parser/Self.pm --- diff --git a/lib/Text/Tradition/Collation.pm b/lib/Text/Tradition/Collation.pm index f7fb717..67cbfb0 100644 --- a/lib/Text/Tradition/Collation.pm +++ b/lib/Text/Tradition/Collation.pm @@ -51,6 +51,7 @@ has 'readings' => ( _add_reading => 'set', del_reading => 'delete', has_reading => 'exists', +# reading_keys => 'keys', readings => 'values', }, default => sub { {} }, diff --git a/lib/Text/Tradition/Parser/Self.pm b/lib/Text/Tradition/Parser/Self.pm index ae70531..51c49aa 100644 --- a/lib/Text/Tradition/Parser/Self.pm +++ b/lib/Text/Tradition/Parser/Self.pm @@ -168,19 +168,20 @@ is( $usert->user->id, $testuser->id, "Parsed tradition with userstore points to =end testing =cut - +use Data::Dump; sub parse { my( $tradition, $opts ) = @_; # Collation data is in the first graph; relationship-specific stuff # is in the second. my( $graph_data, $rel_data ) = graphml_parse( $opts ); - + my $collation = $tradition->collation; my %witnesses; # print STDERR "Setting graph globals\n"; $tradition->name( $graph_data->{'name'} ); + my $use_version; my $tmeta = $tradition->meta; my $cmeta = $collation->meta; @@ -227,8 +228,14 @@ sub parse { foreach my $n ( @{$graph_data->{'nodes'}} ) { # If it is the start or end node, we already have one, so # grab the rank and go. - next if( defined $n->{'is_start'} ); + if( defined $n->{'is_start'} ) { + warn Data::Dump::dump($n); + warn $collation->start->id; + $collation->start->rank($n->{'rank'}); + next; + } if( defined $n->{'is_end'} ) { + warn Data::Dump::dump($n); $collation->end->rank( $n->{'rank'} ); next; }