suppress display of hyphens for joined-on punctuation
Tara L Andrews [Sat, 7 Jun 2014 08:40:22 +0000 (10:40 +0200)]
base/lib/Text/Tradition/Collation.pm

index 1c2a36b..425259a 100644 (file)
@@ -60,6 +60,8 @@ has 'tradition' => (
     weak_ref => 1,
     );
 
+=encoding utf8
+
 =head1 NAME
 
 Text::Tradition::Collation - a software model for a text collation
@@ -1021,8 +1023,10 @@ sub as_dot {
         next if $reading->id eq $reading->text;
         my $rattrs;
         my $label = $reading->text;
-        $label .= '-' if $reading->join_next;
-        $label = "-$label" if $reading->join_prior;
+        unless( $label =~ /^[[:punct:]]+$/ ) {
+               $label .= '-' if $reading->join_next;
+           $label = "-$label" if $reading->join_prior;
+       }
         $label =~ s/\"/\\\"/g;
                $rattrs->{'label'} = $label;
                $rattrs->{'id'} = $reading->id;