From: tla Date: Thu, 7 Jun 2012 11:58:07 +0000 (+0200) Subject: Merge branch 'master' of github.com:tla/stemmatology X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=scpubgit%2Fstemmatology.git;a=commitdiff_plain;h=ef475b1a0eb6b8bebfa1f753bf0de395221d15cb;hp=6ba69acdba350d403384d150614d0294d17828a1 Merge branch 'master' of github.com:tla/stemmatology --- diff --git a/script/make_tradition.pl b/script/make_tradition.pl index 97e8145..591e56e 100755 --- a/script/make_tradition.pl +++ b/script/make_tradition.pl @@ -14,9 +14,9 @@ binmode STDOUT, ":utf8"; eval { no warnings; binmode $DB::OUT, ":utf8"; }; my( $informat, $inbase, $outformat, $help, $language, $name, $sep, $stemmafile, - $dsn, $dbuser, $dbpass, $from, $to ) + $dsn, $dbuser, $dbpass, $from, $to, $dbid ) = ( '', '', '', '', 'Default', 'Tradition', "\t", '', - "dbi:SQLite:dbname=stemmaweb/db/traditions.db", undef, undef, undef, undef ); + "dbi:SQLite:dbname=stemmaweb/db/traditions.db", undef, undef, undef, undef, undef ); GetOptions( 'i|in=s' => \$informat, 'b|base=s' => \$inbase, @@ -31,6 +31,7 @@ GetOptions( 'i|in=s' => \$informat, 't|to=s' => \$to, 'sep=s' => \$sep, 'dsn=s' => \$dsn, + 'dbid=s' => \$dbid, ); if( $help ) { @@ -98,7 +99,12 @@ if( $outformat eq 'stemma' ) { my $dir = Text::Tradition::Directory->new( 'dsn' => $dsn, 'extra_args' => $extra_args ); my $scope = $dir->new_scope; - my $uuid = $dir->store( $tradition ); + my $uuid; + if( $dbid ) { + $uuid = $dir->store( $dbid => $tradition ); + } else { + $uuid = $dir->store( $tradition ); + } print STDERR "Saved tradition to database with ID $uuid\n"; } else { my $output = "as_$outformat"; diff --git a/script/orth_case_links.pl b/script/orth_case_links.pl index a2ddbf1..c86ec5c 100755 --- a/script/orth_case_links.pl +++ b/script/orth_case_links.pl @@ -18,7 +18,7 @@ my $dir = Text::Tradition::Directory->new( $connect_args ); foreach my $text ( $dir->traditionlist ) { my $id = $text->{'id'}; - next unless $text->{'name'} =~ /Virtutes/; + next unless $text->{'name'} =~ /punctuat/; my $scope = $dir->new_scope; my $tradition = $dir->lookup( $id ); print STDERR "Processing tradition " . $tradition->name . "\n"; @@ -38,7 +38,7 @@ foreach my $text ( $dir->traditionlist ) { . $r->text . ")\n"; $merged{$om->id} = 1; $c->merge_readings( $r, $om ); - } elsif ( $c->get_relationship( $r, $om ) ) { + } elsif ( !$c->get_relationship( $r, $om ) ) { print STDERR sprintf( "Adding orthographic link for %s and %s (%s / %s)\n", $r->id, $om->id, $r->text, $om->text ); $c->add_relationship( $r, $om,