X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=make_tradition.pl;h=22b50df8c235e19b81b9146f429b74040937a781;hb=94c00c71ffabc3dc155d237364e76af4385dcb96;hp=14acdef84279d9e4e4a8570183241f5f123c5948;hpb=910a0a6d9f858731358772a45e52817b039cf019;p=scpubgit%2Fstemmatology.git diff --git a/make_tradition.pl b/make_tradition.pl old mode 100644 new mode 100755 index 14acdef..22b50df --- a/make_tradition.pl +++ b/make_tradition.pl @@ -26,7 +26,7 @@ if( $help ) { help(); } -unless( $informat =~ /^(CSV|CTE|KUL|Self|TEI|CollateX)$/i ) { +unless( $informat =~ /^(CSV|CTE|KUL|Self|TEI|CollateX|tab(ular)?)$/i ) { help( "Input format must be one of CollateX, CSV, CTE, Self, TEI" ); } $informat = 'CollateX' if $informat =~ /^c(ollate)?x$/i; @@ -34,6 +34,7 @@ $informat = 'KUL' if $informat =~ /^kul$/i; $informat = 'CTE' if $informat =~ /^cte$/i; $informat = 'Self' if $informat =~ /^self$/i; $informat = 'TEI' if $informat =~ /^tei$/i; +$informat = 'Tabular' if $informat =~ /^tab$/i; unless( $outformat =~ /^(graphml|svg|dot|stemma|csv)$/ ) { help( "Output format must be one of graphml, svg, csv, stemma, or dot" ); @@ -49,6 +50,7 @@ my $input = $ARGV[0]; unless( $informat eq 'KUL' || $informat eq 'CSV' ) { my @lines; open( INFILE, "$input" ) or die "Could not read $input"; + binmode INFILE, ':utf8'; @lines = ; close INFILE; $input = join( '', @lines ); @@ -79,7 +81,7 @@ if( $HACK ) { if( $outformat eq 'stemma' ) { my $stemma = Text::Tradition::Stemma->new( 'collation' => $tradition->collation ); - my( $result, $tree ) = $stemma->run_pars(); + my( $result, $tree ) = $stemma->run_phylip_pars(); if( $result ) { print $tree; } else {