6 use Text::Tradition::Directory;
8 binmode STDERR, ':utf8';
10 my( $dsn, $user, $pass ) = @ARGV;
12 my $connect_args = { dsn => $dsn };
13 $connect_args->{'extra_args'} = { user => $user, password => $pass }
15 my $dir = Text::Tradition::Directory->new( $connect_args );
17 foreach my $id ( $dir->tradition_ids ) {
18 my $scope = $dir->new_scope;
19 my $tradition = $dir->lookup( $id );
20 print STDERR "Processing tradition " . $tradition->name . "\n";
21 foreach my $reading ( $tradition->collation->readings ) {
22 next if $reading->is_meta;
23 $reading->alter_text( strip_punct( $reading->text ) );
25 $tradition->collation->flatten_ranks;
26 $dir->save( $tradition );
29 print STDERR "Done\n";
34 return $rtext unless $rtext =~ /\w/;
37 print STDERR "Altering $orig_r to $rtext\n"
38 unless $orig_r eq $rtext;