View on
MetaCPAN is shutting down
For details read Perl NOC. After June 25th this page will redirect to
Tara Andrews > Text-Tradition-Analysis > Text::Tradition::Analysis



Annotate this POD


Open  0
View/Report Bugs
Module Version: 2.0.4   Source  


Text::Tradition::Analysis - functions for stemma analysis of a tradition


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:


  use Text::Tradition;
  use Text::Tradition::Analysis qw/ run_analysis analyze_variant_location /;
  my $t = Text::Tradition->new( 
    'name' => 'this is a text',
    'input' => 'TEI',
    'file' => '/path/to/tei_parallel_seg_file.xml' );
  $t->add_stemma( 'dotfile' => $stemmafile );

  my $variant_data = run_analysis( $tradition );


run_analysis( $tradition, %opts )

Runs the analysis described in analyze_variant_location on every location in the collation of the given tradition, with the given options. These include:

group_variants( $tradition, $rank, $lacunose, $transposed, $merge_relationship_types )

Groups the variants at the given $rank of the collation, treating any relationships in the set $merge_relationship_types as equivalent. $lacunose should be a reference to an array, to which the sigla of lacunose witnesses at this rank will be appended; $transposed should be a reference to a hash, wherein the identities of transposed readings and their relatives will be stored.

Returns a hash $group_readings where $rdg is attested by the witnesses listed in $group_readings->{$rdg}.

solve_variants( $calcdir, @groups )

Looks up the set of groups in the answers provided by the external graph solver service and returns a cleaned-up answer, adding the rank IDs back where they belong.

The answer has the form { "variants" => [ array of variant location structures ], "variant_count" => total, "conflict_count" => number of conflicts detected, "genealogical_count" => number of solutions found }

analyze_location ( $tradition, $graph, $location_hash )

Given the tradition, its stemma graph, and the solution from the graph solver, work out the rest of the information we want. For each reading we need missing, conflict, reading_parents, independent_occurrence, followed, not_followed, and follow_unknown. Alters the location_hash in place.

similar( $word1, $word2 )

Use Algorithm::Diff to get a sense of how close the words are to each other. This will hopefully handle substitutions a bit more nicely than Levenshtein.

wit_stringify( $groups )

Takes an array of witness groupings and produces a string like ['A','B'] / ['C','D','E'] / ['F']


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.


Tara L Andrews <>

syntax highlighting: