Text::Tradition::Witness - a manuscript witness to a text tradition
use Text::Tradition::Witness; my $w = Text::Tradition::Witness->new( 'sigil' => 'A', 'identifier' => 'Oxford MS Ex.1932', );
Text::Tradition::Witness is an object representation of a manuscript witness to a text tradition. A manuscript has a sigil (a short code that represents it in the wider tradition), an identifier (e.g. the library ID), and probably a text.
Create a new witness. Options include:
sigil - A short code to represent the manuscript. Required.
sourcetype - What sort of witness data this is. Options are 'xmldesc', 'plaintext', 'json', or 'collation' (the last should only be used by Collation parsers.)
file =item * string =item * object
The data source for the witness. Use the appropriate option.
use_text - An initialization option. If the witness is read from a TEI document and more than one <text/> tag exists therein, the default behavior is to use the first defined text. If this is not desired, use_text should be set to an XPath expression that will select the correct text.
identifier - The recognized name of the manuscript, e.g. a library identifier. Taken from the msDesc element for a TEI file.
other_info - A freeform string for any other description of the manuscript.
The sigil by which to identify this manuscript, which must conform to the specification for XML attribute strings (broadly speaking, it must begin with a letter and can have only a few sorts of punctuation characters in it.)
A freeform name by which to identify the manuscript, which may be longer than the sigil. Defaults to 'Unidentified ms', but will be taken from the TEI msName attribute, or constructed from the settlement and idno if supplied.
The city, town, etc. where the manuscript is held. Will be read from the TEI msDesc element if supplied.
The institution that holds the manuscript. Will be read from the TEI msDesc element if supplied.
The identification or call number of the manuscript. Will be read from the TEI msDesc element if supplied.
An array of strings (words) that contains the text of the manuscript. This should not change after the witness has been instantiated, and the path through the collation should always match it.
An array of strings (words) that contains the layered text, if any, of the manuscript. This should not change after the witness has been instantiated, and the path through the collation should always match it.
Accessor method for the witness identifier.
Accessor method for the general witness description.
Boolean method that returns a true value if the witness was created with a data source (that is, a file, string, or object to be parsed).
Boolean method to note whether the witness has layers (e.g. pre-correction readings) in the collation.
Exports the witness as a JSON structure, with the following keys:
id - The witness sigil
name - The witness identifier
tokens - An array of hashes of the form { "t":"WORD" }
Figure out how to serialize a witness
Support encodings other than UTF-8
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.