stop tracking bbedit stuff; first pass at Collate! parsing
[scpubgit/stemmatology.git] / make_tradition.pl
index 5f75f33..f928c33 100755 (executable)
@@ -27,7 +27,7 @@ if( $help ) {
     help();
 }
 
-unless( $informat =~ /^(CSV|CTE|KUL|Self|TEI|CollateX|tab(ular)?)$/i ) {
+unless( $informat =~ /^(CSV|CTE|KUL|Self|TEI|CollateX|tab(ular)?)|stone$/i ) {
     help( "Input format must be one of CollateX, CSV, CTE, Self, TEI" );
 }
 $informat = 'CollateX' if $informat =~ /^c(ollate)?x$/i;
@@ -36,16 +36,18 @@ $informat = 'CTE' if $informat =~ /^cte$/i;
 $informat = 'Self' if $informat =~ /^self$/i;
 $informat = 'TEI' if $informat =~ /^tei$/i;
 $informat = 'Tabular' if $informat =~ /^tab$/i;
+$informat = 'CollateText' if $informat =~ /^stone$/i;
 
 unless( $outformat =~ /^(graphml|svg|dot|stemma|csv)$/ ) {
     help( "Output format must be one of graphml, svg, csv, stemma, or dot" );
 }
 
 # Do we have a base if we need it?
-if( $informat eq 'KUL' && !$inbase ) {
+if( $informat =~ /^(KUL|CollateText)$/ && !$inbase ) {
     help( "$informat input needs a base text" );
 }
 
+
 my $input = $ARGV[0];
 
 # First: read the base. Make a graph, but also note which
@@ -55,6 +57,10 @@ my %args = ( 'input' => $informat,
              'linear' => $linear );
 $args{'base'} = $inbase if $inbase;
 $args{'name'} = $name if $name;
+### Custom hacking for Stone
+if( $informat eq 'CollateText' ) {
+    $args{'sigla'} = [ qw/ S M X V Z Bb B K W L / ];
+}
 my $tradition = Text::Tradition->new( %args );
 
 ### Custom hacking