Text::Tradition - a software model for a set of collated texts
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' ); $t = Text::Tradition->new(); $t->add_witness( 'sourcetype' => 'xmldesc', 'file' => '/path/to/teitranscription.xml' ); $t->add_witness( 'sourcetype => 'plaintext', 'sigil' => 'Q', 'string' => 'The quick brown fox jumped over the lazy dogs' ); ## TODO $t->collate_texts; my $text_path_svg = $t->collation->as_svg(); ## See Text::Tradition::Collation for more on text collation itself
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.
Creates and returns a new text tradition object. The following options are accepted.
General options:
Initialization based on a collation file:
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
TEI - a TEI parallel segmentation format file
Tabular - a spreadsheet collation. See the documentation for Text::Tradition::Parser::Tabular for an explanation of additional options.
Initialization based on a list of witnesses [NOT YET IMPLEMENTED]:
Return the Text::Tradition::Witness objects associated with this tradition, as an array.
Returns the Text::Tradition::Witness object whose sigil is $sigil, or undef if there is no such object within the tradition.
Instantiate a new witness with the given options (see documentation for 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.
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.
Blow away the existing collation object and mark all witnesses as uncollated. Not to be used lightly.
Adds a set of witnesses from a JSON array specification. This is a wrapper to parse the JSON and call add_witness (with the specified $options) for each element therein.
Allow tradition to be initialized via passing to a collator.
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 <aurum@cpan.org>
To install Text::Tradition, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Text::Tradition
CPAN shell
perl -MCPAN -e shell install Text::Tradition
For more information on module installation, please visit the detailed CPAN module installation guide.