From: tla Date: Mon, 26 May 2014 09:32:34 +0000 (+0200) Subject: POD fixes for base Text::Tradition package X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=b34fd19daaa139d86ce82c74665f895d92c665ed;p=scpubgit%2Fstemmatology.git POD fixes for base Text::Tradition package --- diff --git a/base/lib/Text/Tradition.pm b/base/lib/Text/Tradition.pm index 901f96a..7cdcea9 100644 --- a/base/lib/Text/Tradition.pm +++ b/base/lib/Text/Tradition.pm @@ -222,6 +222,11 @@ Text::Tradition::Witness) and add it to the tradition. Delete the witness with the given sigil from the tradition. Returns the witness object for the deleted witness. +=head2 B( $oldsigil, $newsigil ) + +Safely rename (i.e., assign a new sigil to) the given witness. At the moment +this can only be done when the witness does not yet appear in the collation. + =begin testing use TryCatch; diff --git a/base/lib/Text/Tradition/Collation.pm b/base/lib/Text/Tradition/Collation.pm index db06e24..1c2a36b 100644 --- a/base/lib/Text/Tradition/Collation.pm +++ b/base/lib/Text/Tradition/Collation.pm @@ -224,6 +224,18 @@ sub BUILD { { 'collation' => $self, 'is_end' => 1, 'init' => 1 } ) ); } +=head2 register_relationship_type( %relationship_definition ) + +Add a relationship type definition to this collation. The argument can be either a +hash or a hashref, defining the properties of the relationship. For relationship types +and their properties, see L. + +=head2 get_relationship_type( $relationship_name ) + +Retrieve the RelationshipType object for the relationship with the given name. + +=cut + sub register_relationship_type { my $self = shift; my %args = @_ == 1 ? %{$_[0]} : @_; diff --git a/base/lib/Text/Tradition/Collation/RelationshipStore.pm b/base/lib/Text/Tradition/Collation/RelationshipStore.pm index f7cf1b9..13aba7c 100644 --- a/base/lib/Text/Tradition/Collation/RelationshipStore.pm +++ b/base/lib/Text/Tradition/Collation/RelationshipStore.pm @@ -1612,7 +1612,7 @@ sub _add_graphml_data { $data_el->appendText( $value ); } -sub dump_segment { +sub _dump_segment { my( $self, $from, $to ) = @_; open( DUMP, ">debug.svg" ) or die "Could not open debug.svg"; binmode DUMP, ':utf8'; diff --git a/base/lib/Text/Tradition/Datatypes.pm b/base/lib/Text/Tradition/Datatypes.pm index dc7d414..50ed1a1 100644 --- a/base/lib/Text/Tradition/Datatypes.pm +++ b/base/lib/Text/Tradition/Datatypes.pm @@ -22,4 +22,22 @@ subtype 'Sigil', where { $_ =~ /\A$xml10_name_rx\z/ }, message { 'Sigil must be a valid XML attribute string' }; -1; \ No newline at end of file +1; + +=head1 NAME + +Text::Tradition::Datatypes - custom Moose data types for the Tradition package + +=head1 DESCRIPTION + +An internal class with the more complex data types we need. + +=head1 LICENSE + +This package is free software and is provided "as is" without express +or implied warranty. You can redistribute it and/or modify it under +the same terms as Perl itself. + +=head1 AUTHOR + +Tara L Andrews Eaurum@cpan.orgE diff --git a/base/lib/Text/Tradition/Parser/CTE.pm b/base/lib/Text/Tradition/Parser/CTE.pm index fa0f286..d619b8e 100644 --- a/base/lib/Text/Tradition/Parser/CTE.pm +++ b/base/lib/Text/Tradition/Parser/CTE.pm @@ -671,12 +671,12 @@ sub _dump_suspects { say STDERR "Suspect apparatus entries:"; foreach my $suspect ( sort { $a <=> $b } keys %list ) { my @badrdgs = @{$list{$suspect}}; - say STDERR print_apparatus( $suspect ); + say STDERR _print_apparatus( $suspect ); say STDERR "\t(Linked to readings @badrdgs)"; } } -sub print_apparatus { +sub _print_apparatus { my( $appid ) = @_; my $tag = '__APP_' . $appid . '__'; my $app = $apps{$tag};