use strict;
use warnings;
use Storable qw /dclone/;
-use Text::CSV::Simple;
+use Text::CSV::Simple; # TODO convert to CSV_XS
=head1 NAME
-Text::Tradition::Parser::CSV
+Text::Tradition::Parser::KUL
=head1 DESCRIPTION
Parser module for Text::Tradition, given a list of variants as a CSV
file and a reference text as a plaintext file with appropriate line
-breaks.
+breaks. The CSV file is a specialized format developed at KU Leuven,
+and other formats are vastly preferred.
=head1 METHODS
-=over
-
-=item B<read>
+=head2 B<read>
my @apparatus = read( $csv_file );
=cut
sub read {
- my( $csv_file ) = @_;
+ my( $opts ) = @_;
my $parser = Text::CSV::Simple->new();
my @fields = qw/ reference text variant type context non_corr non_indep
length total origin /;
- my @lines = $parser->read_file( $ARGV[0] );
+ my @lines = $parser->read_file( $opts->{'file'} );
my @labels = @{shift( @lines )};
push( @fields, @labels[10..$#labels] );
return @app_list;
}
-=back
-
=head1 LICENSE
This package is free software and is provided "as is" without express