Text::Tradition::Parser::JSON
use Text::Tradition; my $tradition = Text::Tradition->new( 'name' => 'my text', 'input' => 'JSON', 'string' => $json_encoded_utf8, );
Parser module for Text::Tradition to read a JSON alignment table format such as that produced by CollateX.
Takes an initialized tradition and a set of options; creates the appropriate nodes and edges on the graph, as well as the appropriate witness objects. The $option_hash must contain either a 'file' or a 'string' argument with the JSON structure to be parsed.
The structure of the JSON is thus:
{ alignment => [ { witness => "SIGIL", tokens => [ { t => "TEXT" }, ... ] }, { witness => "SIG2", tokens => [ { t => "TEXT" }, ... ] }, ... ], };
Longer lacunae in the text, to be disregarded in cladistic analysis, may be represented with the meta-reading '#LACUNA#'. Multiple lacuna tags in sequence are collapsed into a single multi-reading lacuna.
If a witness name ends in the collation's ac_label, it will be treated as an extra layer of the 'main' witness whose sigil it shares.
Create readings from the unique tokens in @tokenlist, and set their rank to $index. Returns an array of readings of the same size as the original @tokenlist.
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.