X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FText%2FTradition%2FCollation%2FRelationship.pm;h=f9035fcb11288b5008f73d334f011f6c627bf21c;hb=94654e27c9b76e28a7fb0f5d12bb4eac45cfc4f7;hp=422c0c14608f9dc77c398530f6ec1142a31dc12c;hpb=9328f93d4563e7529095249bdd7c1e1531e4042e;p=scpubgit%2Fstemmatology.git diff --git a/lib/Text/Tradition/Collation/Relationship.pm b/lib/Text/Tradition/Collation/Relationship.pm index 422c0c1..f9035fc 100644 --- a/lib/Text/Tradition/Collation/Relationship.pm +++ b/lib/Text/Tradition/Collation/Relationship.pm @@ -48,6 +48,10 @@ or across all traditions. =item * annotation - (Optional) A freeform note to attach to the relationship. +=item * alters_meaning - Indicate whether, in context, the related words cause +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. @@ -109,6 +113,12 @@ has 'annotation' => ( isa => 'Str', predicate => 'has_annotation', ); + +has 'alters_meaning' => ( + is => 'rw', + isa => 'Int', + default => 0, + ); has 'non_correctable' => ( is => 'ro', @@ -120,6 +130,21 @@ has 'non_independent' => ( isa => 'Bool', ); +around 'alters_meaning' => sub { + my $orig = shift; + my $self = shift; + if( @_ ) { + if( $_[0] eq 'no' ) { + return $self->$orig( 0 ); + } elsif( $_[0] eq 'slightly' ) { + return $self->$orig( 1 ); + } elsif( $_[0] eq 'yes' ) { + return $self->$orig( 2 ); + } + } + return $self->$orig( @_ ); +}; + # A read-only meta-Boolean attribute. =head2 colocated