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,
't|to=s' => \$to,
'sep=s' => \$sep,
'dsn=s' => \$dsn,
+ 'dbid=s' => \$dbid,
);
if( $help ) {
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";
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";
. $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,