NAME

Text::Tradition::Parser::Tabular

SYNOPSIS

use Text::Tradition;

my $t_from_file = Text::Tradition->new( 
  'name' => 'my text',
  'input' => 'Tabular',
  'file' => '/path/to/collation.csv',
  'sep_char' => ','
  );
  
my $t_from_string = Text::Tradition->new( 
  'name' => 'my text',
  'input' => 'Tabular',
  'string' => $tab_separated_collation,
  'sep_char' => "\t",
  );

DESCRIPTION

Parser module for Text::Tradition to read an alignment table format, such as CSV or Excel.

METHODS

parse( $tradition, $option_hash )

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 can contain the following:

  • file - Name of file which contains the data

  • string - A string that itself contains the data. One of 'file' or 'string' is required.

  • sep_char - For plaintext formats, the field separation character. Defaults to "\t" (tab-separated); should be "," for comma-separated format.

  • excel - If the data is in an Excel file, this option should be set to 'xls' (for pre-2007 Excel format) or 'xlsx' (for Excel XML format.)

The data should comprise a table with witnesses arranged in columns, with the witness sigla in the first row. Empty cells are interpreted as omissions (and thus stemmatologically relevant.) Longer lacunae in the text, to be disregarded in cladistic analysis, may be represented by filling the appropriate cells with the tag '#LACUNA#'.

If a witness name ends in the collation's ac_label, it will be treated as an 'ante-correction' version of the 'main' witness whose sigil it shares.

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>