X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FText%2FTradition%2FParser%2FKUL.pm;h=1ac3b9a88b93135a0c52f421038ba736384a234b;hb=fedee8dac79426f8a1f7ae70d95478c6fcd5d69a;hp=05c3a1252138cd7f977a680869d666ad10ee8d51;hpb=910a0a6d9f858731358772a45e52817b039cf019;p=scpubgit%2Fstemmatology.git diff --git a/lib/Text/Tradition/Parser/KUL.pm b/lib/Text/Tradition/Parser/KUL.pm index 05c3a12..1ac3b9a 100644 --- a/lib/Text/Tradition/Parser/KUL.pm +++ b/lib/Text/Tradition/Parser/KUL.pm @@ -3,23 +3,22 @@ package Text::Tradition::Parser::KUL; 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 +=head2 B my @apparatus = read( $csv_file ); @@ -29,11 +28,11 @@ merged with a base text. =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] ); @@ -114,8 +113,6 @@ sub read { return @app_list; } -=back - =head1 LICENSE This package is free software and is provided "as is" without express