X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=analysis%2Flib%2FText%2FTradition%2FAnalysis.pm;h=7777f86476437ec937c61885a36edfca1ddaae4d;hb=8943ff6864673cb890d378aa8387c9383732a344;hp=f245b94de41e322aacdcb1a49b036c1fe50f0b49;hpb=ed5b9b7019c32c126faecf339bef3a98928f9f31;p=scpubgit%2Fstemmatology.git diff --git a/analysis/lib/Text/Tradition/Analysis.pm b/analysis/lib/Text/Tradition/Analysis.pm index f245b94..7777f86 100644 --- a/analysis/lib/Text/Tradition/Analysis.pm +++ b/analysis/lib/Text/Tradition/Analysis.pm @@ -10,7 +10,6 @@ use JSON qw/ to_json decode_json /; use LWP::UserAgent; use Set::Scalar; use Text::Tradition::Analysis::Result; -use Text::Tradition::Directory; use Text::Tradition::Stemma; use TryCatch; @@ -26,6 +25,30 @@ my $unsolved_problems = {}; Text::Tradition::Analysis - functions for stemma analysis of a tradition +=head1 DESCRIPTION + +Text::Tradition is a library for representation and analysis of collated +texts, particularly medieval ones. Where the Collation is the central +feature of a Tradition, it may also have one or more stemmata associated +with it, and these stemmata may be analyzed. This package provides the +following modules: + +=over 4 + +=item * L - a role that will be composed into +Text::Tradition objects, providing the ability for Text::Tradition::Stemma +objects to be associated with them. + +=item * L - an object class that represents stemma +hypotheses, both rooted (with a single archetype) and unrooted (e.g. +phylogenetic trees). + +=item * Text::Tradition::Analysis (this package). Provides functions for +the analysis of a given stemma against the collation within a given +Tradition. + +=back + =head1 SYNOPSIS use Text::Tradition; @@ -37,25 +60,7 @@ Text::Tradition::Analysis - functions for stemma analysis of a tradition $t->add_stemma( 'dotfile' => $stemmafile ); my $variant_data = run_analysis( $tradition ); - # Recalculate rank $n treating all orthographic variants as equivalent - my $reanalyze = analyze_variant_location( $tradition, $n, 0, 'orthographic' ); -=head1 DESCRIPTION - -Text::Tradition is a library for representation and analysis of collated -texts, particularly medieval ones. Where the Collation is the central feature of -a Tradition, it may also have one or more temmata associated with it, and these stemmata may be analyzed. This package provides the following modules: - -=over 4 - -=item * L - a role that can be composed into Text::Tradition objects, providing the ability for Text::Tradition::Stemma objects to be associated with them. - -=item * L - an object class that represents stemma hypotheses, both rooted (with a single archetype) and unrooted (e.g. phylogenetic trees). - -=item * Text::Tradition::Analysis (this package). Provides functions for the analysis of a given stemma against the collation within a given Tradition. - -=back - =head1 SUBROUTINES =head2 run_analysis( $tradition, %opts ) @@ -171,6 +176,11 @@ sub run_analysis { if( exists $opts{'calcdir'} ) { $dir = delete $opts{'calcdir'} } elsif ( exists $opts{'calcdsn'} ) { + eval { require Text::Tradition::Directory }; + if( $@ ) { + throw( "Could not instantiate a directory for " . $opts{'calcdsn'} + . ": $@" ); + } $dir = Text::Tradition::Directory->new( dsn => $opts{'calcdsn'} ); }