Merge branch 'master' of github.com:tla/stemmatology
tla [Sun, 19 Jan 2014 19:36:51 +0000 (20:36 +0100)]
base/lib/Text/Tradition.pm
base/lib/Text/Tradition/Collation.pm
base/lib/Text/Tradition/Collation/Reading.pm
base/lib/Text/Tradition/Collation/Relationship.pm

index 74436e9..901f96a 100644 (file)
@@ -11,7 +11,7 @@ use Text::Tradition::Witness;
 use TryCatch;
 
 use vars qw( $VERSION );
-$VERSION = "1.2";
+$VERSION = "1.3";
 
 # Enable plugin(s) if available
 eval { with 'Text::Tradition::HasStemma'; };
index f1903ce..ce46556 100644 (file)
@@ -233,6 +233,12 @@ sub register_relationship_type {
        $self->relations->add_type( %args );
 }
 
+sub get_relationship_type {
+       my( $self, $name ) = @_;
+               return $self->relations->has_type( $name ) 
+                       ? $self->relations->type( $name ) : undef;
+}
+
 ### Reading construct/destruct functions
 
 sub add_reading {
@@ -629,10 +635,8 @@ sub duplicate_reading {
        }
        throw( "Cannot duplicate a meta-reading" )
                if $r->is_meta;
-       my $ordered_req_wits = join( ',', sort @wits );
-       my $ordered_rdg_wits = join( ',', $r->witnesses );
        throw( "Cannot join all witnesses to the new reading" )
-               if $ordered_req_wits eq $ordered_rdg_wits;
+               if scalar( @wits ) == scalar( $r->witnesses );
 
        # Get all the reading attributes and duplicate them.    
        my $rmeta = Text::Tradition::Collation::Reading->meta;
index 62b592e..a482b60 100644 (file)
@@ -104,6 +104,13 @@ has 'text' => (
        writer => 'alter_text',
        );
        
+has 'is_lemma' => (
+       is => 'ro',
+       isa => 'Bool',
+       default => undef,
+       writer => 'make_lemma',
+       );
+       
 has 'is_start' => (
        is => 'ro',
        isa => 'Bool',
index d43ea21..4141f44 100644 (file)
@@ -49,8 +49,9 @@ or across all traditions.
 the text to have different meanings. Possible values are 0 (no), 1 (slightly),
 and >1 (yes).
 
-=item * non_correctable - (Optional) True if the reading would not have been 
-corrected independently.
+=item * a_derivable_from_b - (Optional) True if the first reading is likely to 
+
+=item * b_derivable_from_a - (Optional) True if the second reading is likely to
 
 =item * non_independent - (Optional) True if the variant is unlikely to have 
 occurred independently in unrelated witnesses.
@@ -67,7 +68,9 @@ occurred independently in unrelated witnesses.
 
 =head2 annotation
 
-=head2 non_correctable
+=head2 a_derivable_from_b
+
+=head2 b_derivable_from_a
 
 =head2 non_independent
 
@@ -117,11 +120,16 @@ has 'alters_meaning' => (
        default => 0,
        );
 
-has 'non_correctable' => (
+has 'a_derivable_from_b' => (
        is => 'ro',
        isa => 'Bool',
        );
-
+       
+has 'b_derivable_from_a' => (
+       is => 'ro',
+       isa => 'Bool',
+       );
+       
 has 'non_independent' => (
        is => 'ro',
        isa => 'Bool',