use Text::Tradition;
use_ok( 'Text::Tradition::Language::Latin' );
+my $trad = Text::Tradition->new(
+ 'language' => 'Latin',
+ 'file' => 't/data/legendfrag.xml',
+ 'input' => 'Self' );
+
eval "use Lingua::Morph::Perseus";
my $err = $@;
-
SKIP: {
skip "Package Lingua::Morph::Perseus not found" if $err;
- my $trad = Text::Tradition->new(
- 'language' => 'Latin',
- 'file' => 't/data/legendfrag.xml',
- 'input' => 'Self' );
$trad->lemmatize();
my $ambig = 0;
foreach my $r ( $trad->collation->readings ) {
}
is( $ambig, 4, "Found 4 ambiguous forms as expected" );
}
+
+# Try exporting some witnesses
+my $e_v = 'in suetia uenerabilis pontifex beatus henricus in anglia oriundus';
+my $struct_v = $trad->witness('V')->export_as_json;
+my $g_v = join( ' ', map { $_->{'n'} } @{$struct_v->{'tokens'}} );
+is( $g_v, $e_v, "Got expected regularization of witness V" );
+my $e_n = 'in suetia beatus henricus uenerabilis pontifex de anglia oriundus';
+my $struct_n = $trad->witness('N')->export_as_json;
+my $g_n = join( ' ', map { $_->{'n'} } @{$struct_n->{'tokens'}} );
+is( $g_n, $e_n, "Got expected regularization of witness N" );
}