NAME

Text::Tradition - a software model for a set of collated texts

SYNOPSIS

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

my @text_wits = $t->witnesses();
my $manuscript_a = $t->witness( 'A' );
my $new_ms = $t->add_witness( 'sigil' => 'B' );

my $text_path_svg = $t->collation->as_svg();
## See Text::Tradition::Collation for more on text collation itself
  

DESCRIPTION

Text::Tradition is a library for representation and analysis of collated texts, particularly medieval ones. A 'tradition' refers to the aggregation of surviving versions of a text, generally preserved in multiple manuscripts (or 'witnesses'). A Tradition object thus has one more more Witnesses, as well as a Collation that represents the unity of all versions of the text.

METHODS

new

Creates and returns a new text tradition object. The following options are accepted.

General options:

name - The name of the text.

Initialization based on a collation file:

input - The input format of the collation file. Can be one of the following:
  • Self - a GraphML format produced by this module

  • CollateX - a GraphML format produced by CollateX

  • CTE - a TEI XML format produced by Classical Text Editor

  • JSON - an alignment table in JSON format, as produced by CollateX and other tools

  • KUL - a specific CSV format for variants, not documented here

  • TEI - a TEI parallel segmentation format file

  • Tabular - a comma- or tab-separated collation. Takes an additional option, 'sep_char', which defaults to the tab character.

file - The name of the file that contains the data. One of 'file' or 'string' should be specified.
string - A text string that contains the data. One of 'file' or 'string' should be specified.
base - The name of a text file that contains the base text, to be used with input formats that require it (currently only KUL).

Initialization based on a list of witnesses [NOT YET IMPLEMENTED]:

witnesses - A reference to an array of Text::Tradition::Witness objects that carry the text to be collated.
collator - A reference to a collation program that will accept Witness objects.

witnesses

Return the Text::Tradition::Witness objects associated with this tradition, as an array.

witness( $sigil )

Returns the Text::Tradition::Witness object whose sigil is $sigil, or undef if there is no such object within the tradition.

add_witness( %opts )

Instantiate a new witness with the given options (see documentation for Text::Tradition::Witness) and add it to the tradition.

del_witness( $sigil )

Delete the witness with the given sigil from the tradition. Returns the witness object for the deleted witness.

add_stemma( $dotfile )

Initializes a Text::Tradition::Stemma object from the given dotfile, and associates it with the tradition.

BUGS / TODO

  • Allow tradition to be initialized via passing to a collator.

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.

AUTHOR

Tara L Andrews <aurum@cpan.org>