4 use Test::More 'no_plan';
12 use_ok( 'Text::Tradition::Language::Latin' );
14 eval "use Lingua::Morph::Perseus";
18 skip "Package Lingua::Morph::Perseus not found" if $err;
20 my $trad = Text::Tradition->new(
21 'language' => 'Latin',
22 'file' => 't/data/legendfrag.xml',
26 foreach my $r ( $trad->collation->readings ) {
28 ok( $r->has_lexemes, "Reading $r has one or more lexemes" );
29 my @lex = $r->lexemes;
30 my $lexstr = join( '', map { $_->string } @lex );
31 my $textstr = $r->text;
33 is( $textstr, $lexstr, "Lexemes for reading $r match the reading" );
34 foreach my $l ( @lex ) {
35 next unless $l->matches;
36 next if $l->is_disambiguated;
37 printf( "Ambiguous lexeme %s for reading %s:\n\t%s\n", $l->string, $r->id,
38 join( "\n\t", map { $_->lemma . ': ' . $_->morphology->to_string } $l->matching_forms ) );
42 is( $ambig, 4, "Found 4 ambiguous forms as expected" );