analysis script for upcoming presentation
[scpubgit/stemmatology.git] / lib / Text / Tradition / Parser / JSON.pm
index cc960b4..0734856 100644 (file)
@@ -108,7 +108,8 @@ sub parse {
        my @witnesses; # Keep the ordered list of our witnesses
     my %ac_wits;  # Track these for later removal
     foreach my $sigil ( map { $_->{'witness'} } @{$table->{'alignment'}} ) {
-        my $wit = $tradition->add_witness( 'sigil' => $sigil );
+        my $wit = $tradition->add_witness( 
+               'sigil' => $sigil, 'sourcetype' => 'collation' );
         $wit->path( [ $c->start ] );
         push( @witnesses, $wit );
         my $aclabel = $c->ac_label;
@@ -182,6 +183,9 @@ sub parse {
        foreach my $rdg ( grep { $_->is_lacuna } $c->readings ) {
                $c->del_reading( $rdg ) unless $c->reading_witnesses( $rdg );
        }
+       
+       # Note that our ranks and common readings are set.
+       $c->_graphcalc_done(1);
 }
 
 =head2 make_nodes( $collation, $index, @tokenlist )
@@ -203,7 +207,7 @@ sub make_nodes {
                        if( exists( $unique{$word} ) ) {
                                $rdg = $unique{$word};
                        } else {
-                               my %args = ( 'id' => join( ',', $idx, $j+1 ),
+                               my %args = ( 'id' => 'r' . join( '.', $idx, $j+1 ),
                                        'rank' => $idx,
                                        'text' => $word,
                                        'collation' => $c );