1 package Text::Tradition::Language::Greek;
6 use parent qw/ Text::Tradition::Language::Perseus /;
7 use Text::Tradition::Language::Base qw/ unicode_regularize /;
11 Text::Tradition::Language::Greek - language-specific module for Greek
15 Implements morphology lookup for Greek words in context. This module
16 depends on the Lingua::Morph::Perseus module for access to PhiloLogic database data.
20 =head2 lemmatize( $text )
22 Evaluates the string using Treetagger and Perseus, and returns the results.
24 =head2 reading_lookup( $word )
26 Returns a single-word morphological lookup of the given word using Perseus.
31 use_ok( 'Text::Tradition::Language::Greek' );
33 eval "use Lingua::Morph::Perseus";
37 skip "Greek linguistic data not read yet";
39 my $trad = Text::Tradition->new(
40 'language' => 'Greek',
41 'file' => 't/data/florilegium_graphml.xml',
45 foreach my $r ( $trad->collation->readings ) {
47 ok( $r->has_lexemes, "Reading $r has one or more lexemes" );
48 my @lex = $r->lexemes;
49 my $lexstr = join( '', map { $_->string } @lex );
50 my $textstr = $r->text;
52 is( $textstr, $lexstr, "Lexemes for reading $r match the reading" );
53 foreach my $l ( @lex ) {
54 next unless $l->matches;
55 next if $l->is_disambiguated;
56 printf( "Ambiguous lexeme %s for reading %s:\n\t%s\n", $l->string, $r->id,
57 join( "\n\t", map { $_->lemma . ': ' . $_->morphology->to_string } $l->matching_forms ) );
61 is( $ambig, 4, "Found 4 ambiguous forms as expected" );
71 return __PACKAGE__->perseus_lemmatize( @_ );
75 return __PACKAGE__->perseus_reading_lookup( @_ );
78 =head2 regularize( $text )
80 Returns a regularized form of the reading for the purposes of collation.
85 return unicode_regularize( @_ );