if( ref( $reading ) eq 'Text::Tradition::Collation::Reading' ) {
$reading = $reading->id;
$return_object = 1;
- print STDERR "Returning related objects\n";
- } else {
- print STDERR "Returning related object names\n";
+# print STDERR "Returning related objects\n";
+# } else {
+# print STDERR "Returning related object names\n";
}
my @related = $self->relations->all_reachable( $reading );
if( $colocated ) {
my $datafile = 't/data/Collatex-16.xml';
-open( GRAPHFILE, $datafile ) or die "Could not open $datafile";
-my @lines = <GRAPHFILE>;
-close GRAPHFILE;
-my $tradition = Text::Tradition->new( 'CollateX' => join( '', @lines ) );
+my $tradition = Text::Tradition->new(
+ 'name' => 'inline',
+ 'input' => 'CollateX',
+ 'file' => $datafile,
+ );
my $collation = $tradition->collation;
# Test the svg creation
my @words;
foreach my $n ( @_ ) {
if( $n->[1] ) {
- push( @words, $collation->reading( $n->[0] )->label );
+ push( @words, $collation->reading( $n->[0] )->text );
} elsif ( !defined $n->[1] ) {
push( @words, '...' );
}
my $datafile = 't/data/Collatex-16.xml'; #TODO need other test data
-open( GRAPHFILE, $datafile ) or die "Could not open $datafile";
-my @lines = <GRAPHFILE>;
-close GRAPHFILE;
-my $tradition = Text::Tradition->new( 'CollateX' => join( '', @lines ),
- 'linear' => 1 );
-my $stemma = Text::Tradition::Stemma->new( 'tradition' => $tradition );
+my $tradition = Text::Tradition->new(
+ 'name' => 'inline',
+ 'input' => 'CollateX',
+ 'file' => $datafile,
+ );
+my $stemma = Text::Tradition::Stemma->new( 'collation' => $tradition->collation );
# Test for object creation
ok( $stemma->isa( 'Text::Tradition::Stemma' ), 'Got the right sort of object' );
## check number of columns
# Test that pars runs
-my( $status, $tree ) = $stemma->run_pars();
+my( $status, $tree ) = $stemma->run_phylip_pars();
ok( $status, "pars ran successfully" );
print STDERR "Error was $tree\n" unless $status;
# Test that we get a tree
# Test that the tree has all our witnesses
+
+done_testing();
\ No newline at end of file