X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Ftext_tradition_language_french.t;h=3d1b38a0756442a65a682b068fe9d8187232903a;hb=fc5c4949b38572067ab389afa8c1cafec2b5dbd0;hp=84e9d0268bb7e545266e5e4fbe39eab52651761b;hpb=e0f6836abec58dd0dd896a130c7587368880d255;p=scpubgit%2Fstemmatology.git diff --git a/t/text_tradition_language_french.t b/t/text_tradition_language_french.t index 84e9d02..3d1b38a 100644 --- a/t/text_tradition_language_french.t +++ b/t/text_tradition_language_french.t @@ -27,6 +27,7 @@ SKIP: { # Test the lemmatization. How many readings now have morphological info? # Do the lexemes match the reading? my $ambig = 0; + my $flemmed = 0; foreach my $r ( $tf->collation->readings ) { next if $r->is_meta; ok( $r->has_lexemes, "Reading $r has one or more lexemes" ); @@ -36,13 +37,16 @@ SKIP: { $textstr =~ s/\s+//g; is( $textstr, $lexstr, "Lexemes for reading $r match the reading" ); foreach my $l ( @lex ) { + # Check to see if Flemm actually ran + foreach my $wf ( $l->matching_forms ) { + $flemmed++ if $wf->morphology->get_feature('num'); + } next if $l->is_disambiguated; - # printf( "Ambiguous lexeme %s for reading %s:\n\t%s\n", $l->string, $r->id, - # join( "\n\t", map { $_->lemma . ': ' . $_->morphology->to_string } $l->matching_forms ) ); $ambig++; } } is( $ambig, 102, "Found 102 ambiguous forms as expected" ); + ok( $flemmed > 500, "Found enough Flemm info in wordforms" ); # Try setting the normal form of a reading and re-analyzing my $mr = $tf->collation->reading('r99.2'); @@ -50,7 +54,11 @@ SKIP: { is( $mr->language, 'French', "Reading has correct language setting" ); $mr->normal_form( "m'inspire" ); $mr->lemmatize; - is( $mr->lexemes, 2, "Got two lexemes for new m'inspire reading" ); + my @l = $mr->lexemes; + is( @l, 2, "Got two lexemes for new m'inspire reading" ); + is( $l[0]->form->to_string, + '"French // se|le|lui // cat@pron type@pers pers@1 num@sing case@acc|dat"', + "New reading has correct first lexeme" ); } }