use transposition info from CollateX
Tara L Andrews [Thu, 12 May 2011 13:51:41 +0000 (15:51 +0200)]
lib/Text/Tradition/Graph.pm
lib/Text/Tradition/Parser/GraphML.pm
t/data/Collatex-16.xml
t/data/collate.svg
t/graph.t

index ee90761..1e0f02f 100644 (file)
@@ -426,21 +426,35 @@ Tell the graph that these two nodes contain the same (transposed) reading.
 =cut
 
 sub set_identical_node {
-    my( $self, $node, $same_node ) = @_;
+    my( $self, $node, $main_node ) = @_;
+
+    # The identical_nodes hash contains a key per node, and a value
+    # that is an arrayref to a list of nodes.  Those nodes that are
+    # the same (transposed) node should be keys that point to the same
+    # arrayref.  Each arrayref should contain the name of each node
+    # that points to it.  So basically here we want to merge the
+    # arrays for the two nodes that are now identical.  The 'main'
+    # node should always be first in the array.
+
     my $pool = $self->{'identical_nodes'}->{ $node };
-    my $same_pool = $self->{'identical_nodes'}->{ $same_node };
+    my $main_pool = $self->{'identical_nodes'}->{ $main_node };
+
     my %poolhash;
-    foreach ( @$pool ) {
+    foreach ( @$main_pool ) {
+       # Note which nodes are already in the main pool so that we
+       # don't re-add them.
        $poolhash{$_} = 1;
     }
-    foreach( @$same_pool ) {
-       push( @$pool, $_ ) unless $poolhash{$_};
-    }
 
-    $self->{'identical_nodes'}->{ $same_node } = $pool;
+    foreach( @$pool ) {
+       # Add the remaining nodes to the main pool...
+       push( @$main_pool, $_ ) unless $poolhash{$_};
+    }
+    # ...and set this node to point to the enlarged pool.
+    $self->{'identical_nodes'}->{ $node } = $main_pool;
 }
 
-=item B<set_identical_node>
+=item B<identical_nodes>
 
 my @nodes = $graph->identical_nodes( $node )
 
@@ -488,6 +502,110 @@ sub as_svg {
     return $svg;
 }
 
+=item B<as_graphml>
+
+print $graph->as_graphml( $recalculate )
+
+Returns a GraphML representation of the collation graph, with
+transposition information and position information. Unless
+$recalculate is passed (and is a true value), the method will return a
+cached copy of the SVG after the first call to the method.
+
+=cut
+
+sub as_graphml {
+    my( $self, $recalc ) = @_;
+    return $self->{'graphml'} if( exists $self->{'graphml'} && !$recalc );
+
+    # Some namespaces
+    my $graphml_ns = 'http://graphml.graphdrawing.org/xmlns';
+    my $xsi_ns = 'http://www.w3.org/2001/XMLSchema-instance';
+    my $graphml_schema = 'http://graphml.graphdrawing.org/xmlns ' .
+       'http://graphml.graphdrawing.org/xmlns/1.0/graphml.xsd';
+
+    # Create the document and root node
+    my $graphml = XML::LibXML->createDocument( "1.0", "UTF-8" );
+    my $root = $graphml->createElementNS( $graphml_ns, 'graphml' );
+    $graphml->setDocumentElement( $root );
+    $root->setNamespace( $xsi_ns, 'xsi', 0 );
+    $root->setAttributeNS( $xsi_ns, 'schemaLocation', $graphml_schema );
+
+    # Add the data keys for nodes
+    my @node_data = ( 'name', 'token', 'identical', 'position' );
+    foreach my $ndi ( 0 .. $#node_data ) {
+       my $key = $root->addNewChild( $graphml_ns, 'key' );
+       $key->setAttribute( 'attr.name', $node_data[$ndi] );
+       $key->setAttribute( 'attr.type', 'string' );
+       $key->setAttribute( 'for', 'node' );
+       $key->setAttribute( 'id', 'd'.$ndi );
+    }
+
+    # Add the data keys for edges
+    my %wit_hash;
+    my $wit_ctr = 0;
+    foreach my $wit ( $self->getWitnessList ) {
+       my $wit_key = 'w' . $wit_ctr++;
+       $wit_hash{$wit} = $wit_key;
+       my $key = $root->addNewChild( $graphml_ns, 'key' );
+       $key->setAttribute( 'attr.name', $wit );
+       $key->setAttribute( 'attr.type', 'string' );
+       $key->setAttribute( 'for', 'edge' );
+       $key->setAttribute( 'id', $wit_key );
+    }
+
+    # Add the graph, its nodes, and its edges
+    my $graph = $root->addNewChild( $graphml_ns, 'graph' );
+    $graph->setAttribute( 'edgedefault', 'directed' );
+    $graph->setAttribute( 'id', 'g0' ); # TODO make this meaningful
+    $graph->setAttribute( 'parse.edgeids', 'canonical' );
+    $graph->setAttribute( 'parse.edges', $self->edges() );
+    $graph->setAttribute( 'parse.nodeids', 'canonical' );
+    $graph->setAttribute( 'parse.nodes', $self->nodes() );
+    $graph->setAttribute( 'parse.order', 'nodesfirst' );
+
+    my $node_ctr = 0;
+    my %node_hash;
+    foreach my $n ( $self->nodes() ) {
+       my %this_node_data = ();
+       foreach my $ndi ( 0 .. $#node_data ) {
+           my $value;
+           $this_node_data{'d'.$ndi} = $n->name if $node_data[$ndi] eq 'name';
+           $this_node_data{'d'.$ndi} = $n->label 
+               if $node_data[$ndi] eq 'token';
+           $this_node_data{'d'.$ndi} = $self->primary_node( $n )
+               if $node_data[$ndi] eq 'name';
+           $this_node_data{'d'.$ndi} = 
+               $self->{'positions'}->node_position( $n )
+               if $node_data[$ndi] eq 'position';
+       }
+       my $node_el = $graph->addNewChild( $graphml_ns, 'node' );
+       my $node_xmlid = 'n' . $node_ctr++;
+       $node_hash{ $n->name } = $node_xmlid;
+       $node_el->setAttribute( 'id', $node_xmlid );
+           
+       foreach my $dk ( keys %this_node_data ) {
+           my $d_el = $node_el->addNewChild( $graphml_ns, 'data' );
+           $d_el->setAttribute( 'key', $dk );
+           $d_el->appendTextChild( $this_node_data{$dk} );
+       }
+    }
+
+    foreach my $e ( $self->edges() ) {
+       my( $name, $from, $to ) = ( $e->name,
+                                   $node_hash{ $e->from()->name() },
+                                   $node_hash{ $e->to()->name() } );
+       my $edge_el = $graph->addNewChild( $graphml_ns, 'edge' );
+       $edge_el->setAttribute( 'source', $from );
+       $edge_el->setAttribute( 'target', $to );
+       $edge_el->setAttribute( 'id', $name );
+       # TODO Got to add the witnesses
+    }
+
+    # Return the thing
+    $self->{'graphml'} = $graphml;
+    return $graphml;
+}
+
 =back
 
 =head2 Lemmatization methods
index 19b294c..260e938 100644 (file)
@@ -97,11 +97,11 @@ sub parse {
     my %node_id = reverse %node_name;
 
     ## Record the nodes that are marked as transposed.
-    my $tr_xpath = '//g:node[g:data[@key="' . $nodedata{'identity'} . '"]]';
+    my $tr_xpath = '//g:node[g:data[@key="' . $nodedata{'identical'} . '"]]';
     my $transposition_nodes = $xpc->find( $tr_xpath );
     foreach my $tn ( @$transposition_nodes ) {
        my $id_xpath = sprintf( './g:data[@key="%s"]/text()', 
-                               $nodedata{'identity'} );
+                               $nodedata{'identical'} );
        $graph->set_identical_node( $node_name{ $tn->getAttribute( 'id' ) },
                                    $node_name{ $xpc->findvalue( $id_xpath, 
                                                                 $tn ) } );
@@ -124,8 +124,8 @@ sub parse {
                unless scalar @bn;
            $begin_node = $bn[0];
            $graph->start( $gnode );
-           $node_name{ 0 } = '#START#';
-           $node_id{'#START#'} = 0;
+           $node_name{ $begin_node->getAttribute( 'id' ) } = '#START#';
+           $node_id{'#START#'} = $begin_node->getAttribute( 'id' );
        }
        unless( scalar @outgoing ) {
            warn "Already have an ending node" if $end_node;
@@ -149,13 +149,14 @@ sub parse {
        my $node_id = $begin_node->getAttribute('id');
        my @wit_path = ( $node_name{ $node_id } );
        # TODO Detect loops at some point
-       while( $node_id != $end_node->getAttribute('id') ) {
+       while( $node_id ne $end_node->getAttribute('id') ) {
            # Find the node which is the target of the edge whose
            # source is $node_id and applies to this witness.
            my $xpath_expr = '//g:edge[child::g:data[@key="' 
                . $wit . '"] and attribute::source="'
                . $node_id . '"]';
            my $next_edge = $xpc->find( $xpath_expr, $graph_el )->[0];
+           print STDERR " - at $wit / $node_id\n";
            $node_id = $next_edge->getAttribute('target');
            push( @wit_path, $node_name{ $node_id } );
        }
index 2a32a56..d8c4350 100644 (file)
 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<graphml xmlns="http://graphml.graphdrawing.org/xmlns" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://graphml.graphdrawing.org/xmlns http://graphml.graphdrawing.org/xmlns/1.0/graphml.xsd">
+<graphml xmlns="http://graphml.graphdrawing.org/xmlns" 
+        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
+        xsi:schemaLocation="http://graphml.graphdrawing.org/xmlns http://graphml.graphdrawing.org/xmlns/1.0/graphml.xsd">
     <key attr.name="number" attr.type="int" for="node" id="d1"/>
     <key attr.name="token" attr.type="string" for="node" id="d0"/>
-    <key attr.name="identity" attr.type="int" for="node" id="d2"/>
+    <key attr.name="identical" attr.type="string" for="node" id="d2"/>
     <key attr.name="A" attr.type="string" for="edge" id="w0"/>
     <key attr.name="B" attr.type="string" for="edge" id="w1"/>
     <key attr.name="C" attr.type="string" for="edge" id="w2"/>
-    <graph edgedefault="directed" id="0">
-        <node id="0">
+    <graph edgedefault="directed" id="g0" parse.edgeids="free" 
+          parse.edges="30" parse.nodeids="free" parse.nodes="24" 
+          parse.order="nodesfirst">
+        <node id="n0">
             <data key="d0">#</data>
-            <data key="d1">0</data>
+            <data key="d1">n0</data>
         </node>
-        <node id="1">
+        <node id="n1">
             <data key="d0">when</data>
-            <data key="d1">1</data>
+            <data key="d1">n1</data>
         </node>
-        <node id="2">
+        <node id="n2">
             <data key="d0">april</data>
-            <data key="d1">2</data>
-           <data key="d2">9</data>
-        </node>
-       <node id="3">
-           <data key="d0">with his</data>
-           <data key="d1">3</data>
-       </node>
-        <node id="8">
-            <data key="d0">showers sweet with</data>
-            <data key="d1">8</data>
-        </node>
-        <node id="9">
+            <data key="d1">n2</data>
+        </node>
+        <node id="n3">
+            <data key="d0">with</data>
+            <data key="d1">n3</data>
+        </node>
+        <node id="n4">
+            <data key="d0">his</data>
+            <data key="d1">n4</data>
+        </node>
+        <node id="n5">
+            <data key="d0">showers</data>
+            <data key="d1">n5</data>
+        </node>
+        <node id="n6">
+            <data key="d0">sweet</data>
+            <data key="d1">n6</data>
+        </node>
+        <node id="n7">
+            <data key="d0">with</data>
+            <data key="d1">n7</data>
+        </node>
+        <node id="n11">
             <data key="d0">april</data>
-            <data key="d1">9</data>
-           <data key="d2">2</data>
+            <data key="d1">n11</data>
+            <data key="d2">n2</data>
         </node>
-       <node id="12">
+        <node id="n12">
             <data key="d0">fruit</data>
-            <data key="d1">12</data>
+            <data key="d1">n12</data>
         </node>
-        <node id="13">
+        <node id="n13">
             <data key="d0">the</data>
-            <data key="d1">13</data>
+            <data key="d1">n13</data>
         </node>
-        <node id="14">
+        <node id="n14">
             <data key="d0">drought</data>
-            <data key="d1">14</data>
-           <data key="d2">18</data>
+            <data key="d1">n14</data>
         </node>
-        <node id="15">
+        <node id="n15">
             <data key="d0">march</data>
-            <data key="d1">15</data>
-           <data key="d2">17</data>
+            <data key="d1">n15</data>
+            <data key="d2">n17</data>
         </node>
-        <node id="16">
+        <node id="n16">
             <data key="d0">of</data>
-            <data key="d1">16</data>
+            <data key="d1">n16</data>
         </node>
-        <node id="17">
+        <node id="n17">
             <data key="d0">march</data>
-            <data key="d1">17</data>
-           <data key="d2">15</data>
+            <data key="d1">n17</data>
         </node>
-        <node id="18">
+        <node id="n18">
             <data key="d0">drought</data>
-            <data key="d1">18</data>
-           <data key="d2">14</data>
+            <data key="d1">n18</data>
+            <data key="d2">n14</data>
         </node>
-        <node id="19">
+        <node id="n19">
             <data key="d0">has</data>
-            <data key="d1">19</data>
+            <data key="d1">n19</data>
         </node>
-        <node id="20">
+        <node id="n20">
             <data key="d0">pierced</data>
-            <data key="d1">20</data>
+            <data key="d1">n20</data>
         </node>
-        <node id="21">
+        <node id="n21">
             <data key="d0">unto</data>
-            <data key="d1">21</data>
+            <data key="d1">n21</data>
         </node>
-        <node id="22">
+        <node id="n22">
             <data key="d0">to</data>
-            <data key="d1">22</data>
+            <data key="d1">n22</data>
         </node>
-        <node id="23">
+        <node id="n23">
             <data key="d0">the</data>
-            <data key="d1">23</data>
-        </node>
-        <node id="24">
-            <data key="d0">root</data>
-            <data key="d1">24</data>
+            <data key="d1">n23</data>
         </node>
-        <node id="26">
+        <node id="n25">
             <data key="d0">rood</data>
-            <data key="d1">26</data>
+            <data key="d1">n25</data>
         </node>
-        <node id="27">
+        <node id="n26">
+            <data key="d0">root</data>
+            <data key="d1">n26</data>
+        </node>
+        <node id="n27">
             <data key="d0">#</data>
-            <data key="d1">27</data>
+            <data key="d1">n27</data>
         </node>
-        <edge id="0" source="0" target="1">
+        <edge id="e0" source="n0" target="n1">
             <data key="w0">A</data>
-            <data key="w1">B</data>
             <data key="w2">C</data>
+            <data key="w1">B</data>
         </edge>
-        <edge id="1" source="1" target="2">
+        <edge id="e1" source="n1" target="n2">
             <data key="w0">A</data>
         </edge>
-        <edge id="2" source="2" target="3">
+        <edge id="e2" source="n2" target="n3">
             <data key="w0">A</data>
         </edge>
-        <edge id="3" source="3" target="8">
+        <edge id="e3" source="n3" target="n4">
             <data key="w0">A</data>
         </edge>
-        <edge id="4" source="8" target="12">
+        <edge id="e4" source="n4" target="n5">
             <data key="w0">A</data>
         </edge>
-        <edge id="7" source="1" target="8">
-            <data key="w1">B</data>
+        <edge id="e5" source="n5" target="n6">
+            <data key="w0">A</data>
             <data key="w2">C</data>
-        </edge>
-        <edge id="8" source="8" target="9">
             <data key="w1">B</data>
+        </edge>
+        <edge id="e6" source="n6" target="n7">
+            <data key="w0">A</data>
             <data key="w2">C</data>
+            <data key="w1">B</data>
         </edge>
-        <edge id="9" source="9" target="12">
+        <edge id="e7" source="n1" target="n5">
+            <data key="w2">C</data>
             <data key="w1">B</data>
+        </edge>
+        <edge id="e10" source="n7" target="n11">
             <data key="w2">C</data>
+            <data key="w1">B</data>
         </edge>
-        <edge id="13" source="12" target="13">
+        <edge id="e11" source="n7" target="n12">
             <data key="w0">A</data>
-            <data key="w1">B</data>
+        </edge>
+        <edge id="e12" source="n11" target="n12">
             <data key="w2">C</data>
+            <data key="w1">B</data>
         </edge>
-        <edge id="14" source="13" target="14">
+        <edge id="e13" source="n12" target="n13">
             <data key="w0">A</data>
             <data key="w2">C</data>
-        </edge>
-        <edge id="15" source="13" target="15">
             <data key="w1">B</data>
         </edge>
-        <edge id="16" source="14" target="16">
+        <edge id="e14" source="n13" target="n14">
             <data key="w0">A</data>
             <data key="w2">C</data>
         </edge>
-        <edge id="17" source="15" target="16">
+        <edge id="e15" source="n13" target="n15">
             <data key="w1">B</data>
         </edge>
-        <edge id="18" source="16" target="17">
+        <edge id="e16" source="n14" target="n16">
             <data key="w0">A</data>
             <data key="w2">C</data>
         </edge>
-        <edge id="19" source="16" target="18">
+        <edge id="e17" source="n15" target="n16">
             <data key="w1">B</data>
         </edge>
-        <edge id="20" source="17" target="19">
+        <edge id="e18" source="n16" target="n17">
             <data key="w0">A</data>
             <data key="w2">C</data>
         </edge>
-        <edge id="21" source="18" target="19">
+        <edge id="e19" source="n16" target="n18">
             <data key="w1">B</data>
         </edge>
-        <edge id="22" source="19" target="20">
+        <edge id="e20" source="n17" target="n19">
             <data key="w0">A</data>
-            <data key="w1">B</data>
             <data key="w2">C</data>
         </edge>
-        <edge id="23" source="20" target="21">
-            <data key="w0">A</data>
+        <edge id="e21" source="n18" target="n19">
+            <data key="w1">B</data>
         </edge>
-        <edge id="24" source="20" target="22">
+        <edge id="e22" source="n19" target="n20">
+            <data key="w0">A</data>
+            <data key="w2">C</data>
             <data key="w1">B</data>
         </edge>
-        <edge id="25" source="21" target="23">
+        <edge id="e23" source="n20" target="n21">
             <data key="w0">A</data>
         </edge>
-        <edge id="26" source="22" target="23">
+        <edge id="e24" source="n20" target="n22">
             <data key="w1">B</data>
         </edge>
-        <edge id="27" source="23" target="24">
+        <edge id="e25" source="n21" target="n23">
             <data key="w0">A</data>
+        </edge>
+        <edge id="e26" source="n22" target="n23">
             <data key="w1">B</data>
         </edge>
-        <edge id="28" source="20" target="23">
+        <edge id="e27" source="n20" target="n23">
             <data key="w2">C</data>
         </edge>
-        <edge id="29" source="23" target="26">
+        <edge id="e28" source="n23" target="n25">
             <data key="w2">C</data>
         </edge>
-        <edge id="30" source="24" target="27">
+        <edge id="e29" source="n23" target="n26">
+            <data key="w0">A</data>
+            <data key="w1">B</data>
+        </edge>
+        <edge id="e30" source="n26" target="n27">
             <data key="w0">A</data>
             <data key="w1">B</data>
         </edge>
-        <edge id="31" source="26" target="27">
+        <edge id="e31" source="n25" target="n27">
             <data key="w2">C</data>
         </edge>
     </graph>
 </graphml>
+
index 55ba73d..a82f51e 100644 (file)
 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN"
- "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd" [
- <!ATTLIST svg xmlns:xlink CDATA #FIXED "http://www.w3.org/1999/xlink">
-]>
-<!-- Generated by Graphviz version 2.20.2 (Mon Mar 30 10:09:11 UTC 2009)
-     For user: (tla) Tara Andrews -->
-<!-- Title: test Pages: 1 -->
-<svg width="2122pt" height="136pt"
- viewBox="0.00 0.00 2122.00 136.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
-<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 132)">
-<title>test</title>
-<polygon style="fill:white;stroke:white;" points="-4,4 -4,-132 2118,-132 2118,4 -4,4"/>
-<!-- node_0 -->
-<g id="node1" class="node"><title>node_0</title>
-<ellipse style="fill:none;stroke:black;" cx="27" cy="-46" rx="27" ry="18"/>
-<text text-anchor="middle" x="27" y="-41.9" style="font-family:Times New Roman;font-size:14.00;">#</text>
-</g>
-<!-- node_1 -->
-<g id="node2" class="node"><title>node_1</title>
-<ellipse style="fill:none;stroke:black;" cx="176" cy="-46" rx="38.2185" ry="18"/>
-<text text-anchor="middle" x="176" y="-41.9" style="font-family:Times New Roman;font-size:14.00;">when</text>
-</g>
-<!-- node_0&#45;&gt;node_1 -->
-<g id="edge2" class="edge"><title>node_0&#45;&gt;node_1</title>
-<path style="fill:none;stroke:black;" d="M54,-46C74,-46 103,-46 128,-46"/>
-<polygon style="fill:black;stroke:black;" points="128,-49.5001 138,-46 128,-42.5001 128,-49.5001"/>
-<text text-anchor="middle" x="96" y="-49.9" style="font-family:Times New Roman;font-size:14.00;">A, B, C</text>
-</g>
-<!-- node_2 -->
-<g id="node3" class="node"><title>node_2</title>
-<ellipse style="fill:none;stroke:black;" cx="455" cy="-72" rx="173.916" ry="18"/>
-<text text-anchor="middle" x="455" y="-67.9" style="font-family:Times New Roman;font-size:14.00;">april with his showers sweet with</text>
-</g>
-<!-- node_1&#45;&gt;node_2 -->
-<g id="edge4" class="edge"><title>node_1&#45;&gt;node_2</title>
-<path style="fill:none;stroke:black;" d="M213,-49C240,-52 277,-55 315,-59"/>
-<polygon style="fill:black;stroke:black;" points="314.701,-62.4875 325,-60 315.398,-55.5222 314.701,-62.4875"/>
-<text text-anchor="middle" x="247" y="-56.9" style="font-family:Times New Roman;font-size:14.00;">A</text>
-</g>
-<!-- node_8 -->
-<g id="node4" class="node"><title>node_8</title>
-<ellipse style="fill:none;stroke:black;" cx="455" cy="-18" rx="132.222" ry="18"/>
-<text text-anchor="middle" x="455" y="-13.9" style="font-family:Times New Roman;font-size:14.00;">showers sweet with april</text>
-</g>
-<!-- node_1&#45;&gt;node_8 -->
-<g id="edge6" class="edge"><title>node_1&#45;&gt;node_8</title>
-<path style="fill:none;stroke:black;" d="M207,-36C215,-33 224,-31 232,-30 258,-26 286,-23 314,-21"/>
-<polygon style="fill:black;stroke:black;" points="314.398,-24.4778 324,-20 313.701,-17.5125 314.398,-24.4778"/>
-<text text-anchor="middle" x="247" y="-33.9" style="font-family:Times New Roman;font-size:14.00;">B, C</text>
-</g>
-<!-- node_12 -->
-<g id="node5" class="node"><title>node_12</title>
-<ellipse style="fill:none;stroke:black;" cx="728" cy="-46" rx="30.7734" ry="18"/>
-<text text-anchor="middle" x="728" y="-41.9" style="font-family:Times New Roman;font-size:14.00;">fruit</text>
-</g>
-<!-- node_2&#45;&gt;node_12 -->
-<g id="edge28" class="edge"><title>node_2&#45;&gt;node_12</title>
-<path style="fill:none;stroke:black;" d="M584,-60C621,-56 659,-53 687,-50"/>
-<polygon style="fill:black;stroke:black;" points="687.398,-53.4778 697,-49 686.701,-46.5125 687.398,-53.4778"/>
-<text text-anchor="middle" x="663" y="-56.9" style="font-family:Times New Roman;font-size:14.00;">A</text>
-</g>
-<!-- node_8&#45;&gt;node_12 -->
-<g id="edge48" class="edge"><title>node_8&#45;&gt;node_12</title>
-<path style="fill:none;stroke:black;" d="M587,-19C617,-20 649,-24 678,-29 683,-30 688,-31 692,-32"/>
-<polygon style="fill:black;stroke:black;" points="691.416,-35.4788 702,-35 693.427,-28.7741 691.416,-35.4788"/>
-<text text-anchor="middle" x="663" y="-32.9" style="font-family:Times New Roman;font-size:14.00;">B, C</text>
-</g>
-<!-- node_13 -->
-<g id="node6" class="node"><title>node_13</title>
-<ellipse style="fill:none;stroke:black;" cx="871" cy="-46" rx="27.1004" ry="18"/>
-<text text-anchor="middle" x="871" y="-41.9" style="font-family:Times New Roman;font-size:14.00;">the</text>
-</g>
-<!-- node_12&#45;&gt;node_13 -->
-<g id="edge8" class="edge"><title>node_12&#45;&gt;node_13</title>
-<path style="fill:none;stroke:black;" d="M760,-46C782,-46 811,-46 834,-46"/>
-<polygon style="fill:black;stroke:black;" points="834,-49.5001 844,-46 834,-42.5001 834,-49.5001"/>
-<text text-anchor="middle" x="802" y="-49.9" style="font-family:Times New Roman;font-size:14.00;">A, B, C</text>
-</g>
-<!-- node_14 -->
-<g id="node7" class="node"><title>node_14</title>
-<ellipse style="fill:none;stroke:black;" cx="1014" cy="-77" rx="48.8383" ry="18"/>
-<text text-anchor="middle" x="1014" y="-72.9" style="font-family:Times New Roman;font-size:14.00;">drought</text>
-</g>
-<!-- node_13&#45;&gt;node_14 -->
-<g id="edge10" class="edge"><title>node_13&#45;&gt;node_14</title>
-<path style="fill:none;stroke:black;" d="M897,-52C915,-56 939,-61 961,-66"/>
-<polygon style="fill:black;stroke:black;" points="960.508,-69.4708 971,-68 961.881,-62.6067 960.508,-69.4708"/>
-<text text-anchor="middle" x="931" y="-64.9" style="font-family:Times New Roman;font-size:14.00;">A, C</text>
-</g>
-<!-- node_15 -->
-<g id="node8" class="node"><title>node_15</title>
-<ellipse style="fill:none;stroke:black;" cx="1014" cy="-23" rx="40.9981" ry="18"/>
-<text text-anchor="middle" x="1014" y="-18.9" style="font-family:Times New Roman;font-size:14.00;">march</text>
-</g>
-<!-- node_13&#45;&gt;node_15 -->
-<g id="edge12" class="edge"><title>node_13&#45;&gt;node_15</title>
-<path style="fill:none;stroke:black;" d="M896,-38C902,-37 909,-35 916,-34 931,-31 948,-29 963,-27"/>
-<polygon style="fill:black;stroke:black;" points="963.398,-30.4778 973,-26 962.701,-23.5125 963.398,-30.4778"/>
-<text text-anchor="middle" x="931" y="-37.9" style="font-family:Times New Roman;font-size:14.00;">B</text>
-</g>
-<!-- node_16 -->
-<g id="node9" class="node"><title>node_16</title>
-<ellipse style="fill:none;stroke:black;" cx="1157" cy="-51" rx="27" ry="18"/>
-<text text-anchor="middle" x="1157" y="-46.9" style="font-family:Times New Roman;font-size:14.00;">of</text>
-</g>
-<!-- node_14&#45;&gt;node_16 -->
-<g id="edge14" class="edge"><title>node_14&#45;&gt;node_16</title>
-<path style="fill:none;stroke:black;" d="M1058,-69C1078,-65 1102,-61 1121,-58"/>
-<polygon style="fill:black;stroke:black;" points="1121.88,-61.3933 1131,-56 1120.51,-54.5292 1121.88,-61.3933"/>
-<text text-anchor="middle" x="1097" y="-66.9" style="font-family:Times New Roman;font-size:14.00;">A, C</text>
-</g>
-<!-- node_15&#45;&gt;node_16 -->
-<g id="edge16" class="edge"><title>node_15&#45;&gt;node_16</title>
-<path style="fill:none;stroke:black;" d="M1054,-27C1072,-29 1093,-33 1112,-37 1116,-38 1119,-38 1123,-39"/>
-<polygon style="fill:black;stroke:black;" points="1122.42,-42.4788 1133,-42 1124.43,-35.7741 1122.42,-42.4788"/>
-<text text-anchor="middle" x="1097" y="-40.9" style="font-family:Times New Roman;font-size:14.00;">B</text>
-</g>
-<!-- node_17 -->
-<g id="node10" class="node"><title>node_17</title>
-<ellipse style="fill:none;stroke:black;" cx="1300" cy="-82" rx="40.9981" ry="18"/>
-<text text-anchor="middle" x="1300" y="-77.9" style="font-family:Times New Roman;font-size:14.00;">march</text>
-</g>
-<!-- node_16&#45;&gt;node_17 -->
-<g id="edge18" class="edge"><title>node_16&#45;&gt;node_17</title>
-<path style="fill:none;stroke:black;" d="M1183,-57C1202,-61 1230,-67 1253,-72"/>
-<polygon style="fill:black;stroke:black;" points="1252.51,-75.4708 1263,-74 1253.88,-68.6067 1252.51,-75.4708"/>
-<text text-anchor="middle" x="1217" y="-69.9" style="font-family:Times New Roman;font-size:14.00;">A, C</text>
-</g>
-<!-- node_18 -->
-<g id="node11" class="node"><title>node_18</title>
-<ellipse style="fill:none;stroke:black;" cx="1300" cy="-28" rx="48.8383" ry="18"/>
-<text text-anchor="middle" x="1300" y="-23.9" style="font-family:Times New Roman;font-size:14.00;">drought</text>
-</g>
-<!-- node_16&#45;&gt;node_18 -->
-<g id="edge20" class="edge"><title>node_16&#45;&gt;node_18</title>
-<path style="fill:none;stroke:black;" d="M1182,-43C1188,-42 1195,-40 1202,-39 1214,-37 1228,-34 1241,-33"/>
-<polygon style="fill:black;stroke:black;" points="1241.4,-36.4778 1251,-32 1240.7,-29.5125 1241.4,-36.4778"/>
-<text text-anchor="middle" x="1217" y="-42.9" style="font-family:Times New Roman;font-size:14.00;">B</text>
-</g>
-<!-- node_19 -->
-<g id="node12" class="node"><title>node_19</title>
-<ellipse style="fill:none;stroke:black;" cx="1444" cy="-56" rx="27.7953" ry="18"/>
-<text text-anchor="middle" x="1444" y="-51.9" style="font-family:Times New Roman;font-size:14.00;">has</text>
-</g>
-<!-- node_17&#45;&gt;node_19 -->
-<g id="edge22" class="edge"><title>node_17&#45;&gt;node_19</title>
-<path style="fill:none;stroke:black;" d="M1338,-75C1359,-71 1385,-66 1407,-63"/>
-<polygon style="fill:black;stroke:black;" points="1407.88,-66.3933 1417,-61 1406.51,-59.5292 1407.88,-66.3933"/>
-<text text-anchor="middle" x="1383" y="-71.9" style="font-family:Times New Roman;font-size:14.00;">A, C</text>
-</g>
-<!-- node_18&#45;&gt;node_19 -->
-<g id="edge24" class="edge"><title>node_18&#45;&gt;node_19</title>
-<path style="fill:none;stroke:black;" d="M1347,-34C1363,-36 1382,-39 1398,-43 1401,-44 1405,-44 1408,-45"/>
-<polygon style="fill:black;stroke:black;" points="1407.42,-48.4788 1418,-48 1409.43,-41.7741 1407.42,-48.4788"/>
-<text text-anchor="middle" x="1383" y="-46.9" style="font-family:Times New Roman;font-size:14.00;">B</text>
-</g>
-<!-- node_20 -->
-<g id="node13" class="node"><title>node_20</title>
-<ellipse style="fill:none;stroke:black;" cx="1602" cy="-56" rx="45.8622" ry="18"/>
-<text text-anchor="middle" x="1602" y="-51.9" style="font-family:Times New Roman;font-size:14.00;">pierced</text>
-</g>
-<!-- node_19&#45;&gt;node_20 -->
-<g id="edge26" class="edge"><title>node_19&#45;&gt;node_20</title>
-<path style="fill:none;stroke:black;" d="M1472,-56C1492,-56 1521,-56 1546,-56"/>
-<polygon style="fill:black;stroke:black;" points="1546,-59.5001 1556,-56 1546,-52.5001 1546,-59.5001"/>
-<text text-anchor="middle" x="1514" y="-59.9" style="font-family:Times New Roman;font-size:14.00;">A, B, C</text>
-</g>
-<!-- node_21 -->
-<g id="node14" class="node"><title>node_21</title>
-<ellipse style="fill:none;stroke:black;" cx="1728" cy="-110" rx="32.8565" ry="18"/>
-<text text-anchor="middle" x="1728" y="-105.9" style="font-family:Times New Roman;font-size:14.00;">unto</text>
-</g>
-<!-- node_20&#45;&gt;node_21 -->
-<g id="edge30" class="edge"><title>node_20&#45;&gt;node_21</title>
-<path style="fill:none;stroke:black;" d="M1633,-69C1651,-77 1674,-87 1693,-95"/>
-<polygon style="fill:black;stroke:black;" points="1691.44,-98.1369 1702,-99 1694.28,-91.7402 1691.44,-98.1369"/>
-<text text-anchor="middle" x="1671" y="-88.9" style="font-family:Times New Roman;font-size:14.00;">A</text>
-</g>
-<!-- node_22 -->
-<g id="node15" class="node"><title>node_22</title>
-<ellipse style="fill:none;stroke:black;" cx="1728" cy="-56" rx="27" ry="18"/>
-<text text-anchor="middle" x="1728" y="-51.9" style="font-family:Times New Roman;font-size:14.00;">to</text>
-</g>
-<!-- node_20&#45;&gt;node_22 -->
-<g id="edge32" class="edge"><title>node_20&#45;&gt;node_22</title>
-<path style="fill:none;stroke:black;" d="M1648,-56C1662,-56 1677,-56 1691,-56"/>
-<polygon style="fill:black;stroke:black;" points="1691,-59.5001 1701,-56 1691,-52.5001 1691,-59.5001"/>
-<text text-anchor="middle" x="1671" y="-59.9" style="font-family:Times New Roman;font-size:14.00;">B</text>
-</g>
-<!-- node_23 -->
-<g id="node16" class="node"><title>node_23</title>
-<ellipse style="fill:none;stroke:black;" cx="1835" cy="-56" rx="27.1004" ry="18"/>
-<text text-anchor="middle" x="1835" y="-51.9" style="font-family:Times New Roman;font-size:14.00;">the</text>
-</g>
-<!-- node_20&#45;&gt;node_23 -->
-<g id="edge34" class="edge"><title>node_20&#45;&gt;node_23</title>
-<path style="fill:none;stroke:black;" d="M1626,-41C1644,-30 1670,-18 1694,-12 1724,-6 1733,-4 1762,-12 1779,-17 1796,-27 1810,-36"/>
-<polygon style="fill:black;stroke:black;" points="1807.9,-38.8 1818,-42 1812.1,-33.2 1807.9,-38.8"/>
-<text text-anchor="middle" x="1728" y="-18.9" style="font-family:Times New Roman;font-size:14.00;">C</text>
-</g>
-<!-- node_21&#45;&gt;node_23 -->
-<g id="edge36" class="edge"><title>node_21&#45;&gt;node_23</title>
-<path style="fill:none;stroke:black;" d="M1753,-98C1768,-90 1788,-80 1804,-72"/>
-<polygon style="fill:black;stroke:black;" points="1805.96,-74.916 1813,-67 1802.56,-68.7969 1805.96,-74.916"/>
-<text text-anchor="middle" x="1785" y="-85.9" style="font-family:Times New Roman;font-size:14.00;">A</text>
-</g>
-<!-- node_22&#45;&gt;node_23 -->
-<g id="edge38" class="edge"><title>node_22&#45;&gt;node_23</title>
-<path style="fill:none;stroke:black;" d="M1755,-56C1768,-56 1784,-56 1798,-56"/>
-<polygon style="fill:black;stroke:black;" points="1798,-59.5001 1808,-56 1798,-52.5001 1798,-59.5001"/>
-<text text-anchor="middle" x="1785" y="-59.9" style="font-family:Times New Roman;font-size:14.00;">B</text>
-</g>
-<!-- node_24 -->
-<g id="node17" class="node"><title>node_24</title>
-<ellipse style="fill:none;stroke:black;" cx="1961" cy="-87" rx="30.7734" ry="18"/>
-<text text-anchor="middle" x="1961" y="-82.9" style="font-family:Times New Roman;font-size:14.00;">root</text>
-</g>
-<!-- node_23&#45;&gt;node_24 -->
-<g id="edge40" class="edge"><title>node_23&#45;&gt;node_24</title>
-<path style="fill:none;stroke:black;" d="M1860,-62C1878,-66 1902,-72 1922,-77"/>
-<polygon style="fill:black;stroke:black;" points="1921.42,-80.4788 1932,-80 1923.43,-73.7741 1921.42,-80.4788"/>
-<text text-anchor="middle" x="1895" y="-76.9" style="font-family:Times New Roman;font-size:14.00;">A, B</text>
-</g>
-<!-- node_26 -->
-<g id="node18" class="node"><title>node_26</title>
-<ellipse style="fill:none;stroke:black;" cx="1961" cy="-33" rx="32.157" ry="18"/>
-<text text-anchor="middle" x="1961" y="-28.9" style="font-family:Times New Roman;font-size:14.00;">rood</text>
-</g>
-<!-- node_23&#45;&gt;node_26 -->
-<g id="edge42" class="edge"><title>node_23&#45;&gt;node_26</title>
-<path style="fill:none;stroke:black;" d="M1860,-49C1866,-47 1873,-45 1880,-44 1892,-41 1906,-39 1919,-37"/>
-<polygon style="fill:black;stroke:black;" points="1919.4,-40.4778 1929,-36 1918.7,-33.5125 1919.4,-40.4778"/>
-<text text-anchor="middle" x="1895" y="-47.9" style="font-family:Times New Roman;font-size:14.00;">C</text>
-</g>
-<!-- node_27 -->
-<g id="node19" class="node"><title>node_27</title>
-<ellipse style="fill:none;stroke:black;" cx="2087" cy="-61" rx="27" ry="18"/>
-<text text-anchor="middle" x="2087" y="-56.9" style="font-family:Times New Roman;font-size:14.00;">#</text>
-</g>
-<!-- node_24&#45;&gt;node_27 -->
-<g id="edge44" class="edge"><title>node_24&#45;&gt;node_27</title>
-<path style="fill:none;stroke:black;" d="M1991,-81C2009,-77 2032,-72 2051,-68"/>
-<polygon style="fill:black;stroke:black;" points="2051.88,-71.3933 2061,-66 2050.51,-64.5292 2051.88,-71.3933"/>
-<text text-anchor="middle" x="2027" y="-78.9" style="font-family:Times New Roman;font-size:14.00;">A, B</text>
-</g>
-<!-- node_26&#45;&gt;node_27 -->
-<g id="edge46" class="edge"><title>node_26&#45;&gt;node_27</title>
-<path style="fill:none;stroke:black;" d="M1992,-38C2007,-41 2026,-45 2042,-49 2045,-50 2049,-50 2052,-51"/>
-<polygon style="fill:black;stroke:black;" points="2051.42,-54.4788 2062,-54 2053.43,-47.7741 2051.42,-54.4788"/>
-<text text-anchor="middle" x="2027" y="-52.9" style="font-family:Times New Roman;font-size:14.00;">C</text>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
+ "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
+<!-- Generated by graphviz version 2.24.0 (20090616.2323)
+ -->
+<!-- Title: GRAPH_0 Pages: 1 -->
+<svg width="2338pt" height="132pt"
+ viewBox="0.00 0.00 2338.00 132.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
+<g id="graph1" class="graph" transform="scale(1 1) rotate(0) translate(4 128)">
+<title>GRAPH_0</title>
+<polygon fill="white" stroke="white" points="-4,5 -4,-128 2335,-128 2335,5 -4,5"/>
+<!-- #START# -->
+<g id="node1" class="node"><title>#START#</title>
+<ellipse fill="white" stroke="black" cx="27" cy="-35" rx="27" ry="18"/>
+<text text-anchor="middle" x="27" y="-30.6" font-family="Times,serif" font-size="11.00">#</text>
+</g>
+<!-- n1 -->
+<g id="node2" class="node"><title>n1</title>
+<ellipse fill="white" stroke="black" cx="163" cy="-35" rx="27" ry="18"/>
+<text text-anchor="middle" x="163" y="-30.6" font-family="Times,serif" font-size="11.00">when</text>
+</g>
+<!-- #START#&#45;&gt;n1 -->
+<g id="edge2" class="edge"><title>#START#&#45;&gt;n1</title>
+<path fill="none" stroke="#000000" d="M54.1948,-35C74.6717,-35 102.983,-35 125.593,-35"/>
+<polygon fill="#000000" stroke="#000000" points="135.852,-35 125.852,-39.5001 130.852,-35 125.852,-35.0001 125.852,-35.0001 125.852,-35.0001 130.852,-35 125.852,-30.5001 135.852,-35 135.852,-35"/>
+<text text-anchor="middle" x="95" y="-36.4" font-family="Times,serif" font-size="14.00" fill="#000000">A, C, B</text>
+</g>
+<!-- n2 -->
+<g id="node12" class="node"><title>n2</title>
+<ellipse fill="white" stroke="black" cx="265" cy="-64" rx="27" ry="18"/>
+<text text-anchor="middle" x="265" y="-59.6" font-family="Times,serif" font-size="11.00">april</text>
+</g>
+<!-- n1&#45;&gt;n2 -->
+<g id="edge4" class="edge"><title>n1&#45;&gt;n2</title>
+<path fill="none" stroke="#000000" d="M187.952,-42.0942C200.671,-45.7104 216.345,-50.1667 230.228,-54.1137"/>
+<polygon fill="#000000" stroke="#000000" points="239.952,-56.8785 229.103,-58.4722 235.143,-55.5111 230.333,-54.1437 230.333,-54.1437 230.333,-54.1437 235.143,-55.5111 231.564,-49.8152 239.952,-56.8785 239.952,-56.8785"/>
+<text text-anchor="middle" x="214" y="-51.4" font-family="Times,serif" font-size="14.00" fill="#000000">A</text>
+</g>
+<!-- n5 -->
+<g id="node22" class="node"><title>n5</title>
+<ellipse fill="white" stroke="black" cx="576" cy="-36" rx="31.7878" ry="18"/>
+<text text-anchor="middle" x="576" y="-31.6" font-family="Times,serif" font-size="11.00">showers</text>
+</g>
+<!-- n1&#45;&gt;n5 -->
+<g id="edge6" class="edge"><title>n1&#45;&gt;n5</title>
+<path fill="none" stroke="#000000" d="M187.91,-27.7084C208.415,-22.3503 238.341,-16 265,-16 265,-16 265,-16 469,-16 491.957,-16 517.22,-20.5033 537.431,-25.2362"/>
+<polygon fill="#000000" stroke="#000000" points="547.207,-27.6341 536.423,-29.6222 542.351,-26.4429 537.495,-25.2518 537.495,-25.2518 537.495,-25.2518 542.351,-26.4429 538.567,-20.8813 547.207,-27.6341 547.207,-27.6341"/>
+<text text-anchor="middle" x="367" y="-17.4" font-family="Times,serif" font-size="14.00" fill="#000000">C, B</text>
+</g>
+<!-- n11 -->
+<g id="node3" class="node"><title>n11</title>
+<ellipse fill="white" stroke="black" cx="971" cy="-70" rx="27" ry="18"/>
+<text text-anchor="middle" x="971" y="-65.6" font-family="Times,serif" font-size="11.00">april</text>
+</g>
+<!-- n12 -->
+<g id="node4" class="node"><title>n12</title>
+<ellipse fill="white" stroke="black" cx="1089" cy="-40" rx="27" ry="18"/>
+<text text-anchor="middle" x="1089" y="-35.6" font-family="Times,serif" font-size="11.00">fruit</text>
+</g>
+<!-- n11&#45;&gt;n12 -->
+<g id="edge22" class="edge"><title>n11&#45;&gt;n12</title>
+<path fill="none" stroke="#000000" d="M996.314,-63.5642C1013.11,-59.2934 1035.39,-53.6296 1053.89,-48.9251"/>
+<polygon fill="#000000" stroke="#000000" points="1063.73,-46.4251 1055.15,-53.2504 1058.88,-47.6571 1054.04,-48.8892 1054.04,-48.8892 1054.04,-48.8892 1058.88,-47.6571 1052.93,-44.5279 1063.73,-46.4251 1063.73,-46.4251"/>
+<text text-anchor="middle" x="1030" y="-58.4" font-family="Times,serif" font-size="14.00" fill="#000000">C, B</text>
+</g>
+<!-- n13 -->
+<g id="node5" class="node"><title>n13</title>
+<ellipse fill="white" stroke="black" cx="1225" cy="-40" rx="27" ry="18"/>
+<text text-anchor="middle" x="1225" y="-35.6" font-family="Times,serif" font-size="11.00">the</text>
+</g>
+<!-- n12&#45;&gt;n13 -->
+<g id="edge24" class="edge"><title>n12&#45;&gt;n13</title>
+<path fill="none" stroke="#000000" d="M1116.19,-40C1136.67,-40 1164.98,-40 1187.59,-40"/>
+<polygon fill="#000000" stroke="#000000" points="1197.85,-40 1187.85,-44.5001 1192.85,-40 1187.85,-40.0001 1187.85,-40.0001 1187.85,-40.0001 1192.85,-40 1187.85,-35.5001 1197.85,-40 1197.85,-40"/>
+<text text-anchor="middle" x="1157" y="-41.4" font-family="Times,serif" font-size="14.00" fill="#000000">A, C, B</text>
+</g>
+<!-- n14 -->
+<g id="node6" class="node"><title>n14</title>
+<ellipse fill="white" stroke="black" cx="1349" cy="-72" rx="30.1087" ry="18"/>
+<text text-anchor="middle" x="1349" y="-67.6" font-family="Times,serif" font-size="11.00">drought</text>
+</g>
+<!-- n13&#45;&gt;n14 -->
+<g id="edge26" class="edge"><title>n13&#45;&gt;n14</title>
+<path fill="none" stroke="#000000" d="M1250.39,-46.5529C1267.89,-51.0685 1291.45,-57.1481 1311.15,-62.2326"/>
+<polygon fill="#000000" stroke="#000000" points="1321.05,-64.7871 1310.24,-66.6455 1316.21,-63.5377 1311.37,-62.2882 1311.37,-62.2882 1311.37,-62.2882 1316.21,-63.5377 1312.49,-57.931 1321.05,-64.7871 1321.05,-64.7871"/>
+<text text-anchor="middle" x="1285" y="-59.4" font-family="Times,serif" font-size="14.00" fill="#000000">A, C</text>
+</g>
+<!-- n15 -->
+<g id="node7" class="node"><title>n15</title>
+<ellipse fill="white" stroke="black" cx="1349" cy="-18" rx="27" ry="18"/>
+<text text-anchor="middle" x="1349" y="-13.6" font-family="Times,serif" font-size="11.00">march</text>
+</g>
+<!-- n13&#45;&gt;n15 -->
+<g id="edge28" class="edge"><title>n13&#45;&gt;n15</title>
+<path fill="none" stroke="#000000" d="M1251.15,-34.6132C1257.32,-33.3848 1263.89,-32.1141 1270,-31 1283.81,-28.4833 1299.02,-25.9289 1312.38,-23.7583"/>
+<polygon fill="#000000" stroke="#000000" points="1322.63,-22.1079 1313.47,-28.1403 1317.69,-22.9027 1312.75,-23.6975 1312.75,-23.6975 1312.75,-23.6975 1317.69,-22.9027 1312.04,-19.2547 1322.63,-22.1079 1322.63,-22.1079"/>
+<text text-anchor="middle" x="1285" y="-32.4" font-family="Times,serif" font-size="14.00" fill="#000000">B</text>
+</g>
+<!-- n16 -->
+<g id="node8" class="node"><title>n16</title>
+<ellipse fill="white" stroke="black" cx="1473" cy="-46" rx="27" ry="18"/>
+<text text-anchor="middle" x="1473" y="-41.6" font-family="Times,serif" font-size="11.00">of</text>
+</g>
+<!-- n14&#45;&gt;n16 -->
+<g id="edge30" class="edge"><title>n14&#45;&gt;n16</title>
+<path fill="none" stroke="#000000" d="M1377.76,-65.9697C1395.39,-62.2738 1418.1,-57.5107 1436.93,-53.5634"/>
+<polygon fill="#000000" stroke="#000000" points="1446.93,-51.4663 1438.07,-57.9228 1442.04,-52.4924 1437.14,-53.5185 1437.14,-53.5185 1437.14,-53.5185 1442.04,-52.4924 1436.22,-49.1143 1446.93,-51.4663 1446.93,-51.4663"/>
+<text text-anchor="middle" x="1413" y="-62.4" font-family="Times,serif" font-size="14.00" fill="#000000">A, C</text>
+</g>
+<!-- n15&#45;&gt;n16 -->
+<g id="edge32" class="edge"><title>n15&#45;&gt;n16</title>
+<path fill="none" stroke="#000000" d="M1374.69,-23.8016C1392.82,-27.8938 1417.33,-33.4289 1437.34,-37.9481"/>
+<polygon fill="#000000" stroke="#000000" points="1447.34,-40.2058 1436.59,-42.3926 1442.46,-39.1045 1437.59,-38.0031 1437.59,-38.0031 1437.59,-38.0031 1442.46,-39.1045 1438.58,-33.6136 1447.34,-40.2058 1447.34,-40.2058"/>
+<text text-anchor="middle" x="1413" y="-36.4" font-family="Times,serif" font-size="14.00" fill="#000000">B</text>
+</g>
+<!-- n17 -->
+<g id="node9" class="node"><title>n17</title>
+<ellipse fill="white" stroke="black" cx="1597" cy="-78" rx="27" ry="18"/>
+<text text-anchor="middle" x="1597" y="-73.6" font-family="Times,serif" font-size="11.00">march</text>
+</g>
+<!-- n16&#45;&gt;n17 -->
+<g id="edge34" class="edge"><title>n16&#45;&gt;n17</title>
+<path fill="none" stroke="#000000" d="M1498.39,-52.5529C1516.7,-57.2769 1541.64,-63.7127 1561.85,-68.93"/>
+<polygon fill="#000000" stroke="#000000" points="1571.64,-71.4559 1560.83,-73.3143 1566.8,-70.2064 1561.96,-68.957 1561.96,-68.957 1561.96,-68.957 1566.8,-70.2064 1563.08,-64.5998 1571.64,-71.4559 1571.64,-71.4559"/>
+<text text-anchor="middle" x="1533" y="-65.4" font-family="Times,serif" font-size="14.00" fill="#000000">A, C</text>
+</g>
+<!-- n18 -->
+<g id="node10" class="node"><title>n18</title>
+<ellipse fill="white" stroke="black" cx="1597" cy="-24" rx="30.1087" ry="18"/>
+<text text-anchor="middle" x="1597" y="-19.6" font-family="Times,serif" font-size="11.00">drought</text>
+</g>
+<!-- n16&#45;&gt;n18 -->
+<g id="edge36" class="edge"><title>n16&#45;&gt;n18</title>
+<path fill="none" stroke="#000000" d="M1499.15,-40.6132C1505.32,-39.3848 1511.89,-38.1141 1518,-37 1530.71,-34.6834 1544.61,-32.3349 1557.16,-30.2832"/>
+<polygon fill="#000000" stroke="#000000" points="1567.32,-28.6367 1558.17,-34.6778 1562.39,-29.4362 1557.45,-30.2357 1557.45,-30.2357 1557.45,-30.2357 1562.39,-29.4362 1556.73,-25.7936 1567.32,-28.6367 1567.32,-28.6367"/>
+<text text-anchor="middle" x="1533" y="-38.4" font-family="Times,serif" font-size="14.00" fill="#000000">B</text>
+</g>
+<!-- n19 -->
+<g id="node11" class="node"><title>n19</title>
+<ellipse fill="white" stroke="black" cx="1721" cy="-52" rx="27" ry="18"/>
+<text text-anchor="middle" x="1721" y="-47.6" font-family="Times,serif" font-size="11.00">has</text>
+</g>
+<!-- n17&#45;&gt;n19 -->
+<g id="edge38" class="edge"><title>n17&#45;&gt;n19</title>
+<path fill="none" stroke="#000000" d="M1622.99,-72.5495C1641.02,-68.7708 1665.25,-63.6897 1685.11,-59.5255"/>
+<polygon fill="#000000" stroke="#000000" points="1695.04,-57.4433 1686.18,-63.8997 1690.15,-58.4694 1685.25,-59.4955 1685.25,-59.4955 1685.25,-59.4955 1690.15,-58.4694 1684.33,-55.0913 1695.04,-57.4433 1695.04,-57.4433"/>
+<text text-anchor="middle" x="1661" y="-68.4" font-family="Times,serif" font-size="14.00" fill="#000000">A, C</text>
+</g>
+<!-- n18&#45;&gt;n19 -->
+<g id="edge40" class="edge"><title>n18&#45;&gt;n19</title>
+<path fill="none" stroke="#000000" d="M1625.76,-30.4941C1643.59,-34.5202 1666.63,-39.7221 1685.58,-44.0012"/>
+<polygon fill="#000000" stroke="#000000" points="1695.34,-46.2069 1684.6,-48.3937 1690.47,-45.1055 1685.59,-44.0042 1685.59,-44.0042 1685.59,-44.0042 1690.47,-45.1055 1686.58,-39.6147 1695.34,-46.2069 1695.34,-46.2069"/>
+<text text-anchor="middle" x="1661" y="-42.4" font-family="Times,serif" font-size="14.00" fill="#000000">B</text>
+</g>
+<!-- n20 -->
+<g id="node13" class="node"><title>n20</title>
+<ellipse fill="white" stroke="black" cx="1860" cy="-52" rx="28.9343" ry="18"/>
+<text text-anchor="middle" x="1860" y="-47.6" font-family="Times,serif" font-size="11.00">pierced</text>
+</g>
+<!-- n19&#45;&gt;n20 -->
+<g id="edge42" class="edge"><title>n19&#45;&gt;n20</title>
+<path fill="none" stroke="#000000" d="M1748.13,-52C1768.55,-52 1796.85,-52 1819.88,-52"/>
+<polygon fill="#000000" stroke="#000000" points="1830.05,-52 1820.05,-56.5001 1825.05,-52 1820.05,-52.0001 1820.05,-52.0001 1820.05,-52.0001 1825.05,-52 1820.05,-47.5001 1830.05,-52 1830.05,-52"/>
+<text text-anchor="middle" x="1789" y="-53.4" font-family="Times,serif" font-size="14.00" fill="#000000">A, C, B</text>
+</g>
+<!-- n3 -->
+<g id="node20" class="node"><title>n3</title>
+<ellipse fill="white" stroke="black" cx="367" cy="-66" rx="27" ry="18"/>
+<text text-anchor="middle" x="367" y="-61.6" font-family="Times,serif" font-size="11.00">with</text>
+</g>
+<!-- n2&#45;&gt;n3 -->
+<g id="edge8" class="edge"><title>n2&#45;&gt;n3</title>
+<path fill="none" stroke="#000000" d="M292.066,-64.5307C303.594,-64.7567 317.231,-65.0241 329.69,-65.2684"/>
+<polygon fill="#000000" stroke="#000000" points="339.807,-65.4668 329.721,-69.7698 334.808,-65.3687 329.809,-65.2707 329.809,-65.2707 329.809,-65.2707 334.808,-65.3687 329.897,-60.7715 339.807,-65.4668 339.807,-65.4668"/>
+<text text-anchor="middle" x="316" y="-66.4" font-family="Times,serif" font-size="14.00" fill="#000000">A</text>
+</g>
+<!-- n21 -->
+<g id="node14" class="node"><title>n21</title>
+<ellipse fill="white" stroke="black" cx="1965" cy="-106" rx="27" ry="18"/>
+<text text-anchor="middle" x="1965" y="-101.6" font-family="Times,serif" font-size="11.00">unto</text>
+</g>
+<!-- n20&#45;&gt;n21 -->
+<g id="edge46" class="edge"><title>n20&#45;&gt;n21</title>
+<path fill="none" stroke="#000000" d="M1882.78,-63.7172C1897.81,-71.4444 1917.68,-81.6617 1934.12,-90.1168"/>
+<polygon fill="#000000" stroke="#000000" points="1943.34,-94.8593 1932.39,-94.2875 1938.89,-92.5725 1934.44,-90.2857 1934.44,-90.2857 1934.44,-90.2857 1938.89,-92.5725 1936.5,-86.2839 1943.34,-94.8593 1943.34,-94.8593"/>
+<text text-anchor="middle" x="1914" y="-83.4" font-family="Times,serif" font-size="14.00" fill="#000000">A</text>
+</g>
+<!-- n22 -->
+<g id="node15" class="node"><title>n22</title>
+<ellipse fill="white" stroke="black" cx="1965" cy="-52" rx="27" ry="18"/>
+<text text-anchor="middle" x="1965" y="-47.6" font-family="Times,serif" font-size="11.00">to</text>
+</g>
+<!-- n20&#45;&gt;n22 -->
+<g id="edge44" class="edge"><title>n20&#45;&gt;n22</title>
+<path fill="none" stroke="#000000" d="M1889.53,-52C1901.37,-52 1915.17,-52 1927.69,-52"/>
+<polygon fill="#000000" stroke="#000000" points="1937.85,-52 1927.85,-56.5001 1932.85,-52 1927.85,-52.0001 1927.85,-52.0001 1927.85,-52.0001 1932.85,-52 1927.85,-47.5001 1937.85,-52 1937.85,-52"/>
+<text text-anchor="middle" x="1914" y="-53.4" font-family="Times,serif" font-size="14.00" fill="#000000">B</text>
+</g>
+<!-- n23 -->
+<g id="node16" class="node"><title>n23</title>
+<ellipse fill="white" stroke="black" cx="2067" cy="-52" rx="27" ry="18"/>
+<text text-anchor="middle" x="2067" y="-47.6" font-family="Times,serif" font-size="11.00">the</text>
+</g>
+<!-- n20&#45;&gt;n23 -->
+<g id="edge48" class="edge"><title>n20&#45;&gt;n23</title>
+<path fill="none" stroke="#000000" d="M1879.44,-38.3549C1894.61,-28.5916 1916.61,-16.2788 1938,-11 1961.3,-5.24911 1968.75,-5.05904 1992,-11 2009.1,-15.3693 2026.5,-24.5295 2040.23,-33.0854"/>
+<polygon fill="#000000" stroke="#000000" points="2048.68,-38.5641 2037.85,-36.9011 2044.49,-35.8445 2040.29,-33.1249 2040.29,-33.1249 2040.29,-33.1249 2044.49,-35.8445 2042.74,-29.3488 2048.68,-38.5641 2048.68,-38.5641"/>
+<text text-anchor="middle" x="1965" y="-12.4" font-family="Times,serif" font-size="14.00" fill="#000000">C</text>
+</g>
+<!-- n21&#45;&gt;n23 -->
+<g id="edge50" class="edge"><title>n21&#45;&gt;n23</title>
+<path fill="none" stroke="#000000" d="M1986.63,-94.548C2001.2,-86.8357 2020.62,-76.556 2036.72,-68.0329"/>
+<polygon fill="#000000" stroke="#000000" points="2045.75,-63.2503 2039.02,-71.9063 2041.33,-65.5898 2036.91,-67.9293 2036.91,-67.9293 2036.91,-67.9293 2041.33,-65.5898 2034.81,-63.9522 2045.75,-63.2503 2045.75,-63.2503"/>
+<text text-anchor="middle" x="2016" y="-81.4" font-family="Times,serif" font-size="14.00" fill="#000000">A</text>
+</g>
+<!-- n22&#45;&gt;n23 -->
+<g id="edge52" class="edge"><title>n22&#45;&gt;n23</title>
+<path fill="none" stroke="#000000" d="M1992.07,-52C2003.59,-52 2017.23,-52 2029.69,-52"/>
+<polygon fill="#000000" stroke="#000000" points="2039.81,-52 2029.81,-56.5001 2034.81,-52 2029.81,-52.0001 2029.81,-52.0001 2029.81,-52.0001 2034.81,-52 2029.81,-47.5001 2039.81,-52 2039.81,-52"/>
+<text text-anchor="middle" x="2016" y="-53.4" font-family="Times,serif" font-size="14.00" fill="#000000">B</text>
+</g>
+<!-- n25 -->
+<g id="node17" class="node"><title>n25</title>
+<ellipse fill="white" stroke="black" cx="2185" cy="-84" rx="27" ry="18"/>
+<text text-anchor="middle" x="2185" y="-79.6" font-family="Times,serif" font-size="11.00">rood</text>
+</g>
+<!-- n23&#45;&gt;n25 -->
+<g id="edge56" class="edge"><title>n23&#45;&gt;n25</title>
+<path fill="none" stroke="#000000" d="M2092.02,-58.7864C2108.81,-63.3374 2131.15,-69.3971 2149.73,-74.4353"/>
+<polygon fill="#000000" stroke="#000000" points="2159.6,-77.1131 2148.78,-78.8388 2154.78,-75.8044 2149.95,-74.4957 2149.95,-74.4957 2149.95,-74.4957 2154.78,-75.8044 2151.13,-70.1526 2159.6,-77.1131 2159.6,-77.1131"/>
+<text text-anchor="middle" x="2126" y="-71.4" font-family="Times,serif" font-size="14.00" fill="#000000">C</text>
+</g>
+<!-- n26 -->
+<g id="node18" class="node"><title>n26</title>
+<ellipse fill="white" stroke="black" cx="2185" cy="-30" rx="27" ry="18"/>
+<text text-anchor="middle" x="2185" y="-25.6" font-family="Times,serif" font-size="11.00">root</text>
+</g>
+<!-- n23&#45;&gt;n26 -->
+<g id="edge54" class="edge"><title>n23&#45;&gt;n26</title>
+<path fill="none" stroke="#000000" d="M2093.16,-46.6714C2099.33,-45.4406 2105.89,-44.1542 2112,-43 2123.94,-40.744 2136.99,-38.3849 2148.72,-36.3052"/>
+<polygon fill="#000000" stroke="#000000" points="2158.62,-34.5591 2149.55,-40.7273 2153.7,-35.4274 2148.77,-36.2957 2148.77,-36.2957 2148.77,-36.2957 2153.7,-35.4274 2147.99,-31.864 2158.62,-34.5591 2158.62,-34.5591"/>
+<text text-anchor="middle" x="2126" y="-44.4" font-family="Times,serif" font-size="14.00" fill="#000000">A, B</text>
+</g>
+<!-- n27 -->
+<g id="node19" class="node"><title>n27</title>
+<ellipse fill="white" stroke="black" cx="2303" cy="-58" rx="27" ry="18"/>
+<text text-anchor="middle" x="2303" y="-53.6" font-family="Times,serif" font-size="11.00">#</text>
+</g>
+<!-- n25&#45;&gt;n27 -->
+<g id="edge58" class="edge"><title>n25&#45;&gt;n27</title>
+<path fill="none" stroke="#000000" d="M2210.9,-78.2942C2227.42,-74.6535 2249.06,-69.8842 2267.22,-65.884"/>
+<polygon fill="#000000" stroke="#000000" points="2277.16,-63.6925 2268.37,-70.2389 2272.28,-64.7684 2267.4,-65.8444 2267.4,-65.8444 2267.4,-65.8444 2272.28,-64.7684 2266.43,-61.4498 2277.16,-63.6925 2277.16,-63.6925"/>
+<text text-anchor="middle" x="2244" y="-74.4" font-family="Times,serif" font-size="14.00" fill="#000000">C</text>
+</g>
+<!-- n26&#45;&gt;n27 -->
+<g id="edge60" class="edge"><title>n26&#45;&gt;n27</title>
+<path fill="none" stroke="#000000" d="M2210.6,-36.0756C2227.3,-40.0383 2249.33,-45.264 2267.68,-49.6196"/>
+<polygon fill="#000000" stroke="#000000" points="2277.45,-51.9363 2266.68,-54.0058 2272.58,-50.7818 2267.72,-49.6274 2267.72,-49.6274 2267.72,-49.6274 2272.58,-50.7818 2268.75,-45.249 2277.45,-51.9363 2277.45,-51.9363"/>
+<text text-anchor="middle" x="2244" y="-47.4" font-family="Times,serif" font-size="14.00" fill="#000000">A, B</text>
+</g>
+<!-- n4 -->
+<g id="node21" class="node"><title>n4</title>
+<ellipse fill="white" stroke="black" cx="469" cy="-63" rx="27" ry="18"/>
+<text text-anchor="middle" x="469" y="-58.6" font-family="Times,serif" font-size="11.00">his</text>
+</g>
+<!-- n3&#45;&gt;n4 -->
+<g id="edge10" class="edge"><title>n3&#45;&gt;n4</title>
+<path fill="none" stroke="#000000" d="M394.066,-65.2039C405.594,-64.8649 419.231,-64.4638 431.69,-64.0973"/>
+<polygon fill="#000000" stroke="#000000" points="441.807,-63.7998 431.944,-68.5919 436.809,-63.9468 431.812,-64.0939 431.812,-64.0939 431.812,-64.0939 436.809,-63.9468 431.679,-59.5958 441.807,-63.7998 441.807,-63.7998"/>
+<text text-anchor="middle" x="418" y="-65.4" font-family="Times,serif" font-size="14.00" fill="#000000">A</text>
+</g>
+<!-- n4&#45;&gt;n5 -->
+<g id="edge12" class="edge"><title>n4&#45;&gt;n5</title>
+<path fill="none" stroke="#000000" d="M494.358,-56.6014C506.989,-53.4141 522.546,-49.4884 536.68,-45.9219"/>
+<polygon fill="#000000" stroke="#000000" points="546.658,-43.4041 538.063,-50.2141 541.81,-44.6275 536.962,-45.8508 536.962,-45.8508 536.962,-45.8508 541.81,-44.6275 535.861,-41.4876 546.658,-43.4041 546.658,-43.4041"/>
+<text text-anchor="middle" x="520" y="-52.4" font-family="Times,serif" font-size="14.00" fill="#000000">A</text>
+</g>
+<!-- n6 -->
+<g id="node23" class="node"><title>n6</title>
+<ellipse fill="white" stroke="black" cx="717" cy="-36" rx="27" ry="18"/>
+<text text-anchor="middle" x="717" y="-31.6" font-family="Times,serif" font-size="11.00">sweet</text>
+</g>
+<!-- n5&#45;&gt;n6 -->
+<g id="edge14" class="edge"><title>n5&#45;&gt;n6</title>
+<path fill="none" stroke="#000000" d="M608.348,-36C629.545,-36 657.327,-36 679.492,-36"/>
+<polygon fill="#000000" stroke="#000000" points="689.551,-36 679.551,-40.5001 684.551,-36 679.551,-36.0001 679.551,-36.0001 679.551,-36.0001 684.551,-36 679.551,-31.5001 689.551,-36 689.551,-36"/>
+<text text-anchor="middle" x="649" y="-37.4" font-family="Times,serif" font-size="14.00" fill="#000000">A, C, B</text>
+</g>
+<!-- n7 -->
+<g id="node24" class="node"><title>n7</title>
+<ellipse fill="white" stroke="black" cx="853" cy="-36" rx="27" ry="18"/>
+<text text-anchor="middle" x="853" y="-31.6" font-family="Times,serif" font-size="11.00">with</text>
+</g>
+<!-- n6&#45;&gt;n7 -->
+<g id="edge16" class="edge"><title>n6&#45;&gt;n7</title>
+<path fill="none" stroke="#000000" d="M744.195,-36C764.672,-36 792.983,-36 815.593,-36"/>
+<polygon fill="#000000" stroke="#000000" points="825.852,-36 815.852,-40.5001 820.852,-36 815.852,-36.0001 815.852,-36.0001 815.852,-36.0001 820.852,-36 815.852,-31.5001 825.852,-36 825.852,-36"/>
+<text text-anchor="middle" x="785" y="-37.4" font-family="Times,serif" font-size="14.00" fill="#000000">A, C, B</text>
+</g>
+<!-- n7&#45;&gt;n11 -->
+<g id="edge18" class="edge"><title>n7&#45;&gt;n11</title>
+<path fill="none" stroke="#000000" d="M878.025,-43.2105C894.999,-48.1014 917.665,-54.6322 936.367,-60.0211"/>
+<polygon fill="#000000" stroke="#000000" points="946.011,-62.7999 935.156,-64.3552 941.207,-61.4155 936.402,-60.0311 936.402,-60.0311 936.402,-60.0311 941.207,-61.4155 937.648,-55.707 946.011,-62.7999 946.011,-62.7999"/>
+<text text-anchor="middle" x="912" y="-57.4" font-family="Times,serif" font-size="14.00" fill="#000000">C, B</text>
+</g>
+<!-- n7&#45;&gt;n12 -->
+<g id="edge20" class="edge"><title>n7&#45;&gt;n12</title>
+<path fill="none" stroke="#000000" d="M879.735,-32.975C908.838,-30.087 956.742,-26.5154 998,-29 1015.85,-30.075 1035.57,-32.3261 1052.07,-34.5135"/>
+<polygon fill="#000000" stroke="#000000" points="1062.4,-35.9287 1051.88,-39.0294 1057.44,-35.2499 1052.49,-34.5711 1052.49,-34.5711 1052.49,-34.5711 1057.44,-35.2499 1053.1,-30.1127 1062.4,-35.9287 1062.4,-35.9287"/>
+<text text-anchor="middle" x="971" y="-30.4" font-family="Times,serif" font-size="14.00" fill="#000000">A</text>
 </g>
 </g>
 </svg>
index 032246a..f579a17 100644 (file)
--- a/t/graph.t
+++ b/t/graph.t
@@ -24,21 +24,22 @@ is( $svg->documentElement->nodeName(), 'svg', 'Got an svg document' );
 my $svg_xpc = XML::LibXML::XPathContext->new( $svg->documentElement() );
 $svg_xpc->registerNs( 'svg', 'http://www.w3.org/2000/svg' );
 my @svg_nodes = $svg_xpc->findnodes( '//svg:g[@class="node"]' );
-is( scalar @svg_nodes, 21, "Correct number of nodes in the graph" );
+is( scalar @svg_nodes, 24, "Correct number of nodes in the graph" );
 
 # Test for the correct number of edges
 my @svg_edges = $svg_xpc->findnodes( '//svg:g[@class="edge"]' );
-is( scalar @svg_edges, 27, "Correct number of edges in the graph" );
+is( scalar @svg_edges, 30, "Correct number of edges in the graph" );
 
 # Test for the correct common nodes
-my @expected_nodes = map { [ $_, 1 ] } qw/#START# 1 8 12 13 16 19 20 23 27/;
-foreach my $idx ( qw/2 3 5 8 10 13 15/ ) {
+my @expected_nodes = map { [ $_, 1 ] } qw/ #START# n1 n5 n6 n7 n12 n13
+                                            n16 n19 n20 n23 n27 /;
+foreach my $idx ( qw/2 3 4 8 11 13 16 18/ ) {
     splice( @expected_nodes, $idx, 0, [ "node_null", undef ] );
 }
 my @active_nodes = $graph->active_nodes();
 # is_deeply( \@active_nodes, \@expected_nodes, "Initial common points" );
 subtest 'Initial common points' => \&compare_active;
-my $string = '# when ... ... showers sweet with ... fruit the ... of ... has pierced ... the ... #';
+my $string = '# when ... ... ... showers sweet with ... fruit the ... of ... has pierced ... the ... #';
 is( make_text( @active_nodes ), $string, "Got the right starting text" );
 
 sub compare_active {
@@ -76,13 +77,14 @@ is( $graph->text_for_witness( "B" ), $wit_b, "Correct path for witness B" );
 is( $graph->text_for_witness( "C" ), $wit_c, "Correct path for witness C" );
 
 # Test the transposition identifiers
-my $transposition_pools = [ [ 2, 9 ], [ 14, 18 ], [ 15, 17 ] ];
-my $transposed_nodes = { 2 => $transposition_pools->[0],
-                        9 => $transposition_pools->[0],
-                        14 => $transposition_pools->[1],
-                        15 => $transposition_pools->[2],
-                        17 => $transposition_pools->[2],
-                        18 => $transposition_pools->[1],
+my $transposition_pools = [ [ 'n2', 'n11' ], [ 'n14', 'n18' ], 
+                           [ 'n17', 'n15' ] ];
+my $transposed_nodes = { 'n2' => $transposition_pools->[0],
+                        'n11' => $transposition_pools->[0],
+                        'n14' => $transposition_pools->[1],
+                        'n15' => $transposition_pools->[2],
+                        'n17' => $transposition_pools->[2],
+                        'n18' => $transposition_pools->[1],
 };
 foreach my $n ( $graph->nodes() ) {
     $transposed_nodes->{ $n->name() } = [ $n->name() ]
@@ -91,84 +93,84 @@ foreach my $n ( $graph->nodes() ) {
 is_deeply( $graph->{'identical_nodes'}, $transposed_nodes, "Found the right transpositions" );
 
 # Test turning on a node
-my @off = $graph->toggle_node( '24' );
-$expected_nodes[ 15 ] = [ "24", 1 ];
+my @off = $graph->toggle_node( 'n25' );
+$expected_nodes[ 18 ] = [ "n25", 1 ];
 @active_nodes = $graph->active_nodes( @off );
 subtest 'Turned on node for new location' => \&compare_active;
-$string = '# when ... ... showers sweet with ... fruit the ... of ... has pierced ... the root #';
+$string = '# when ... ... ... showers sweet with ... fruit the ... of ... has pierced ... the rood #';
 is( make_text( @active_nodes ), $string, "Got the right text" );
  
 # Test the toggling effects of same-column
-@off = $graph->toggle_node( '26' );
-splice( @expected_nodes, 15, 1, ( [ "24", 0 ], [ "26", 1 ] ) );
+@off = $graph->toggle_node( 'n26' );
+splice( @expected_nodes, 18, 1, ( [ "n25", 0 ], [ "n26", 1 ] ) );
 @active_nodes = $graph->active_nodes( @off );
 subtest 'Turned on other node in that location' => \&compare_active;
-$string = '# when ... ... showers sweet with ... fruit the ... of ... has pierced ... the rood #';
+$string = '# when ... ... ... showers sweet with ... fruit the ... of ... has pierced ... the root #';
 is( make_text( @active_nodes ), $string, "Got the right text" );
 
 # Test the toggling effects of transposition
 
-@off = $graph->toggle_node( '14' );
+@off = $graph->toggle_node( 'n14' );
 # Add the turned on node
-$expected_nodes[ 8 ] = [ "14", 1 ];
+$expected_nodes[ 11 ] = [ "n14", 1 ];
 # Remove the 'off' for the previous node
-splice( @expected_nodes, 15, 1 );
+splice( @expected_nodes, 18, 1 );
 @active_nodes = $graph->active_nodes( @off );
 subtest 'Turned on transposition node' => \&compare_active;
-$string = '# when ... ... showers sweet with ... fruit the drought of ... has pierced ... the rood #';
+$string = '# when ... ... ... showers sweet with ... fruit the drought of ... has pierced ... the root #';
 is( make_text( @active_nodes ), $string, "Got the right text" );
 
-@off = $graph->toggle_node( '18' );
+@off = $graph->toggle_node( 'n18' );
 # Toggle on the new node
-$expected_nodes[ 10 ] = [ "18", 1 ];
+$expected_nodes[ 13 ] = [ "n18", 1 ];
 # Toggle off the transposed node
-$expected_nodes[ 8 ] = [ "14", undef ];
+$expected_nodes[ 11 ] = [ "n14", undef ];
 @active_nodes = $graph->active_nodes( @off );
 subtest 'Turned on that node\'s partner' => \&compare_active;
-$string = '# when ... ... showers sweet with ... fruit the ... of drought has pierced ... the rood #';
+$string = '# when ... ... ... showers sweet with ... fruit the ... of drought has pierced ... the root #';
 is( make_text( @active_nodes ), $string, "Got the right text" );
 
-@off = $graph->toggle_node( '14' );
+@off = $graph->toggle_node( 'n14' );
 # Toggle on the new node
-$expected_nodes[ 8 ] = [ "14", 1 ];
+$expected_nodes[ 11 ] = [ "n14", 1 ];
 # Toggle off the transposed node
-$expected_nodes[ 10 ] = [ "18", undef ];
+$expected_nodes[ 13 ] = [ "n18", undef ];
 @active_nodes = $graph->active_nodes( @off );
 subtest 'Turned on the original node' => \&compare_active;
-$string = '# when ... ... showers sweet with ... fruit the drought of ... has pierced ... the rood #';
+$string = '# when ... ... ... showers sweet with ... fruit the drought of ... has pierced ... the root #';
 is( make_text( @active_nodes ), $string, "Got the right text" );
 
-@off = $graph->toggle_node( '15' );
+@off = $graph->toggle_node( 'n15' );
 # Toggle on the new node, and off with the old
-splice( @expected_nodes, 8, 1, [ "14", 0 ], [ "15", 1 ] );
+splice( @expected_nodes, 11, 1, [ "n14", 0 ], [ "n15", 1 ] );
 @active_nodes = $graph->active_nodes( @off );
 subtest 'Turned on the colocated node' => \&compare_active;
-$string = '# when ... ... showers sweet with ... fruit the march of ... has pierced ... the rood #';
+$string = '# when ... ... ... showers sweet with ... fruit the march of ... has pierced ... the root #';
 is( make_text( @active_nodes ), $string, "Got the right text" );
 
-@off = $graph->toggle_node( '3' );
+@off = $graph->toggle_node( 'n3' );
 # Toggle on the new node
-splice( @expected_nodes, 3, 1, [ "3", 1 ] );
+splice( @expected_nodes, 3, 1, [ "n3", 1 ] );
 # Remove the old toggle-off
-splice( @expected_nodes, 8, 1 );
+splice( @expected_nodes, 11, 1 );
 @active_nodes = $graph->active_nodes( @off );
 subtest 'Turned on a singleton node' => \&compare_active;
-$string = '# when ... with his showers sweet with ... fruit the march of ... has pierced ... the rood #';
+$string = '# when ... with ... showers sweet with ... fruit the march of ... has pierced ... the root #';
 is( make_text( @active_nodes ), $string, "Got the right text" );
 
-@off = $graph->toggle_node( '3' );
+@off = $graph->toggle_node( 'n3' );
 # Toggle off this node
-splice( @expected_nodes, 3, 1, [ "3", 0 ] );
+splice( @expected_nodes, 3, 1, [ "n3", 0 ] );
 @active_nodes = $graph->active_nodes( @off );
 subtest 'Turned off a singleton node' => \&compare_active;
-$string = '# when ... showers sweet with ... fruit the march of ... has pierced ... the rood #';
+$string = '# when ... ... showers sweet with ... fruit the march of ... has pierced ... the root #';
 is( make_text( @active_nodes ), $string, "Got the right text" );
 
-@off = $graph->toggle_node( '21' );
-splice( @expected_nodes, 13, 1, [ "21", 1 ] );
+@off = $graph->toggle_node( 'n21' );
+splice( @expected_nodes, 16, 1, [ "n21", 1 ] );
 @active_nodes = $graph->active_nodes( @off );
 subtest 'Turned on a new node after singleton switchoff' => \&compare_active;
-$string = '# when ... showers sweet with ... fruit the march of ... has pierced unto the rood #';
+$string = '# when ... ... showers sweet with ... fruit the march of ... has pierced unto the root #';
 is( make_text( @active_nodes ), $string, "Got the right text" );
 
 done_testing();