Text::Tradition::Parser::GraphML
use Text::Tradition; my $t_from_file = Text::Tradition->new( 'name' => 'my text', 'input' => 'Self', 'file' => '/path/to/tradition.xml' ); my $t_from_string = Text::Tradition->new( 'name' => 'my text', 'input' => 'Self', 'string' => $tradition_xml, );
Parser module for Text::Tradition to read in its own GraphML output format. GraphML is a relatively simple graph description language; a 'graph' element can have 'node' and 'edge' elements, and each of these can have simple 'data' elements for attributes to be saved.
The graph itself has attributes as in the Collation object:
linear
ac_label
baselabel
wit_list_separator
The node objects have the following attributes:
name
reading
identical
rank
class
The edge objects have the following attributes:
witness (for 'path' class edges)
extra (for 'path' class edges)
relationship (for 'relationship' class edges)
equal_rank (for 'relationship' class edges)
non_correctable (for 'relationship' class edges)
non_independent (for 'relationship' class edges)
parse( $graph, $opts );
Takes an initialized Text::Tradition object and a set of options; creates the appropriate nodes and edges on the graph. The options hash should include either a 'file' argument or a 'string' argument, depending on the source of the XML to be parsed.
Make this into a stream parser with GraphML
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.