Skip to content

Commit

Permalink
normal form should not propagate along other/uncertain relationships! #…
Browse files Browse the repository at this point in the history
  • Loading branch information
tla committed Jun 4, 2015
1 parent 53771ea commit d71f418
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
11 changes: 10 additions & 1 deletion morphology/lib/Text/Tradition/Morphology.pm
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,15 @@ $c->add_relationship( $r6, $r7, { type => 'grammatical' }, \@changed );
is( $r7->normal_form, 'QUUX', "normal form on grammatical relationship unchanged" );
is( scalar @changed, 0, "No readings were marked as changed" );
# Check that 'other' and 'uncertain' relationships don't propagate
my $r8 = $c->reading('w121');
my $r9 = $c->reading('w122');
$r8->normal_form('THIS');
$r9->normal_form('THAT');
$c->add_relationship( $r8, $r9, { type => 'other' } ) ;
$r8->make_lemma( 1 );
is( $r9->normal_form, 'THAT', "Normal form unchanged on non-generalizable relationship" );
=end testing
=cut
Expand All @@ -361,7 +370,7 @@ sub push_normal_form {
my $filter = sub {
my $rl = shift;
my $rltype = $self->collation->relations->type( $rl->type );
return $rltype->bindlevel < 2
return $rltype->bindlevel < 2 && $rltype->is_generalizable;
};
foreach my $r ( $self->related_readings( $filter ) ) {
if( $r->normal_form ne $self->normal_form ) {
Expand Down
9 changes: 9 additions & 0 deletions morphology/t/text_tradition_morphology.t
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,15 @@ $r6->make_lemma( 1 );
$c->add_relationship( $r6, $r7, { type => 'grammatical' }, \@changed );
is( $r7->normal_form, 'QUUX', "normal form on grammatical relationship unchanged" );
is( scalar @changed, 0, "No readings were marked as changed" );

# Check that 'other' and 'uncertain' relationships don't propagate
my $r8 = $c->reading('w121');
my $r9 = $c->reading('w122');
$r8->normal_form('THIS');
$r9->normal_form('THAT');
$c->add_relationship( $r8, $r9, { type => 'other' } ) ;
$r8->make_lemma( 1 );
is( $r9->normal_form, 'THAT', "Normal form unchanged on non-generalizable relationship" );
}


Expand Down

0 comments on commit d71f418

Please sign in to comment.