make db save script use new Directory interface
[scpubgit/stemmatology.git] / script / make_tradition.pl
index f928c33..9e1e8a7 100755 (executable)
@@ -11,15 +11,16 @@ binmode STDERR, ":utf8";
 binmode STDOUT, ":utf8";
 eval { no warnings; binmode $DB::OUT, ":utf8"; };
 
-my( $informat, $inbase, $outformat, $help, $linear, $name, $HACK ) 
-    = ( '', '', '', '', 1, 'Tradition', 0 );
+my( $informat, $inbase, $outformat, $help, $linear, $name, $HACK, $sep ) 
+    = ( '', '', '', '', 1, 'Tradition', 0, ',' );
 
 GetOptions( 'i|in=s'    => \$informat,
             'b|base=s'  => \$inbase,
             'o|out=s'   => \$outformat,
             'l|linear!' => \$linear,
-            'n|name'    => \$name,
+            'n|name=s'    => \$name,
             'h|help'    => \$help,
+            'sep=s'            => \$sep,
             'hack'      => \$HACK,
     );
 
@@ -46,7 +47,7 @@ unless( $outformat =~ /^(graphml|svg|dot|stemma|csv)$/ ) {
 if( $informat =~ /^(KUL|CollateText)$/ && !$inbase ) {
     help( "$informat input needs a base text" );
 }
-
+$sep = "\t" if $sep eq 'tab';
 
 my $input = $ARGV[0];
 
@@ -57,6 +58,7 @@ my %args = ( 'input' => $informat,
              'linear' => $linear );
 $args{'base'} = $inbase if $inbase;
 $args{'name'} = $name if $name;
+$args{'sep_char'} = $sep if $informat eq 'Tabular';
 ### Custom hacking for Stone
 if( $informat eq 'CollateText' ) {
     $args{'sigla'} = [ qw/ S M X V Z Bb B K W L / ];