8 plan skip_all => "Flemm 3.1 required" if $@;
10 binmode( STDOUT, ':utf8' );
11 binmode( STDERR, ':utf8' );
13 my $tf = Text::Tradition->new(
15 'file' => 't/data/besoin.xml',
16 'language' => 'French' );
19 my $graphmlstr = $tf->collation->as_graphml;
20 like( $graphmlstr, qr/graphml xmlns/,
21 "Serialized tradition after lemmatization" );
23 my $tf2 = Text::Tradition->new(
25 string => $graphmlstr,
26 language => 'French' );
28 is( ref $tf2, 'Text::Tradition', "Re-parsed tradition with lemmatization" );
29 is( $tf->name, $tf2->name, "Traditions have same name" );
30 foreach my $r ( $tf->collation->readings ) {
31 my $r2 = $tf2->collation->reading( $r->id );
32 is( ref $r2, 'Text::Tradition::Collation::Reading',
33 "Reading $r exists in new tradition" );
35 is( scalar $r->lexemes, scalar $r2->lexemes,
36 "Same number of lexemes in new tradition for $r" );
40 # Test a snippet of tradition with possibly-problematic saved lexemes
41 my $tf3 = Text::Tradition->new(
43 'file' => 't/data/lexformat.xml' );
44 is( ref $tf3, 'Text::Tradition',
45 "Successfully parsed tradition with incomplete lexemes" );