continued doc and testing drive; rationalize GraphML a little
[scpubgit/stemmatology.git] / lib / Text / Tradition / Parser / KUL.pm
index 05c3a12..1ac3b9a 100644 (file)
@@ -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<read>
+=head2 B<read>
 
 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