From: Tara L Andrews Date: Thu, 27 Sep 2012 13:22:56 +0000 (+0200) Subject: fix test, fix doc X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=248276a273b92ae88bc9413cf50b679b8dd5f3ed;p=scpubgit%2Fstemmatology.git fix test, fix doc --- diff --git a/base/lib/Text/Tradition/Collation.pm b/base/lib/Text/Tradition/Collation.pm index ced2d13..18ccf07 100644 --- a/base/lib/Text/Tradition/Collation.pm +++ b/base/lib/Text/Tradition/Collation.pm @@ -1242,7 +1242,7 @@ sub as_csv { return join( "\n", @result ); } -=head2 alignment_table( $use_refs, $include_witnesses ) +=head2 alignment_table Return a reference to an alignment table, in a slightly enhanced CollateX format which looks like this: @@ -1254,12 +1254,6 @@ format which looks like this: ... ], length => TEXTLEN }; -If $use_refs is set to 1, the reading object is returned in the table -instead of READINGTEXT; if not, the text of the reading is returned. - -If $include_witnesses is set to a hashref, only the witnesses whose sigil -keys have a true hash value will be included. - =cut sub alignment_table { @@ -1321,6 +1315,7 @@ sub _make_witness_row { return @filled_row; } + =head1 NAVIGATION METHODS =head2 reading_sequence( $first, $last, $sigil, $backup ) diff --git a/base/lib/Text/Tradition/Witness.pm b/base/lib/Text/Tradition/Witness.pm index 4ab7d5b..16fe172 100644 --- a/base/lib/Text/Tradition/Witness.pm +++ b/base/lib/Text/Tradition/Witness.pm @@ -137,6 +137,7 @@ my $ptwit = $trad->add_witness( is( ref( $ptwit ), 'Text::Tradition::Witness', 'Created a witness' ); if( $ptwit ) { is( $ptwit->sigil, 'A', "Witness has correct sigil" ); + $c->make_witness_path( $ptwit ); is( $c->path_text( $ptwit->sigil ), $str, "Witness has correct text" ); } @@ -196,10 +197,10 @@ subtype 'Sigil', no Moose::Util::TypeConstraints; has 'tradition' => ( - 'is' => 'ro', - 'isa' => 'Text::Tradition', - 'required' => 1, - weak_ref => 1 + is => 'ro', + isa => 'Text::Tradition', + required => 1, + weak_ref => 1 ); # Sigil. Required identifier for a witness, but may be found inside @@ -776,7 +777,7 @@ sub export_as_json { 'name' => $self->identifier, }; if( $self->is_layered ) { - my @lwlist = map { { 't' => $_ || '' } } @{$self->uncorrected}; + my @lwlist = map { { 't' => $_ || '' } } @{$self->layertext}; $obj->{'layertokens'} = \@lwlist; } return $obj; diff --git a/base/t/text_tradition_witness.t b/base/t/text_tradition_witness.t index 2457b2c..4badcb6 100644 --- a/base/t/text_tradition_witness.t +++ b/base/t/text_tradition_witness.t @@ -22,6 +22,7 @@ my $ptwit = $trad->add_witness( is( ref( $ptwit ), 'Text::Tradition::Witness', 'Created a witness' ); if( $ptwit ) { is( $ptwit->sigil, 'A', "Witness has correct sigil" ); + $c->make_witness_path( $ptwit ); is( $c->path_text( $ptwit->sigil ), $str, "Witness has correct text" ); }