X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=script%2Fmake_tradition.pl;h=362758b46088f2b56f52f4c21416403eea8b143e;hb=6a1c434d9024223c496c7b3f977c4b1d434b4a4c;hp=e4bc47c39d9564f497da70df5d2cac288b236efd;hpb=5d90cf7462f08da5c1f328af38a8fc461c0c294a;p=scpubgit%2Fstemmatology.git diff --git a/script/make_tradition.pl b/script/make_tradition.pl index e4bc47c..362758b 100755 --- a/script/make_tradition.pl +++ b/script/make_tradition.pl @@ -12,7 +12,7 @@ binmode STDERR, ":utf8"; binmode STDOUT, ":utf8"; eval { no warnings; binmode $DB::OUT, ":utf8"; }; -my( $informat, $inbase, $outformat, $help, $linear, $name, $HACK, $sep, $stemmafile, +my( $informat, $inbase, $outformat, $help, $language, $name, $HACK, $sep, $stemmafile, $dsn, $dbuser, $dbpass ) = ( '', '', '', '', 1, 'Tradition', 0, "\t", '', "dbi:SQLite:dbname=stemmaweb/db/traditions.db", undef, undef ); @@ -20,7 +20,7 @@ my( $informat, $inbase, $outformat, $help, $linear, $name, $HACK, $sep, $stemmaf GetOptions( 'i|in=s' => \$informat, 'b|base=s' => \$inbase, 'o|out=s' => \$outformat, - 'l|linear!' => \$linear, + 'l|language=s' => \$language, 'n|name=s' => \$name, 'h|help' => \$help, 's|stemma=s' => \$stemmafile, @@ -61,9 +61,9 @@ my $input = $ARGV[0]; # First: read the base. Make a graph, but also note which # nodes represent line beginnings. my %args = ( 'input' => $informat, - 'file' => $input, - 'linear' => $linear ); + 'file' => $input ); $args{'base'} = $inbase if $inbase; +$args{'language'} = $language if $language; $args{'name'} = $name if $name; $args{'sep_char'} = $sep if $informat eq 'Tabular'; ### Custom hacking for Stone @@ -79,11 +79,11 @@ if( $stemmafile ) { ### Custom hacking # Remove witnesses C, E, G in the Matthew text if( $HACK ) { - my @togo = qw/ C E G /; - $tradition->collation->clear_witness( @togo ); - $tradition->del_witness( @togo ); # Set the funny name while we're at it - $tradition->name( "\x{17d}amanakagrut\x{2bf}iwn" ); + my $oldname = $tradition->name; + $oldname =~ s/(\d)/ $1/; + my $newname = "\x{17d}amanakagrut\x{2bf}iwn " . ucfirst( $oldname ); + $tradition->name( $newname ); } # Now output what we have been asked to.