1 package Text::Tradition::Language::Armenian;
6 use parent qw/ Text::Tradition::Language::Perseus /;
10 Text::Tradition::Language::Armenian - language-specific module for Armenian
14 Implements morphology lookup for Armenian (Grabar) words in context. This module
15 depends on the Lingua::Morph::Perseus module for access to PhiloLogic database data.
19 =head2 lemmatize( $text )
21 Evaluates the string using Treetagger and Perseus, and returns the results.
23 =head2 reading_lookup( $word )
25 Returns a single-word morphological lookup of the given word using Perseus.
30 use_ok( 'Text::Tradition::Language::Armenian' );
32 eval "use Lingua::Morph::Perseus";
36 skip "No Armenian test data yet";
38 my $trad = Text::Tradition->new(
39 'language' => 'Armenian',
40 'file' => 't/data/legendfrag.xml',
44 foreach my $r ( $trad->collation->readings ) {
46 ok( $r->has_lexemes, "Reading $r has one or more lexemes" );
47 my @lex = $r->lexemes;
48 my $lexstr = join( '', map { $_->string } @lex );
49 my $textstr = $r->text;
51 is( $textstr, $lexstr, "Lexemes for reading $r match the reading" );
52 foreach my $l ( @lex ) {
53 next unless $l->matches;
54 next if $l->is_disambiguated;
55 printf( "Ambiguous lexeme %s for reading %s:\n\t%s\n", $l->string, $r->id,
56 join( "\n\t", map { $_->lemma . ': ' . $_->morphology->to_string } $l->matching_forms ) );
60 is( $ambig, 4, "Found 4 ambiguous forms as expected" );
70 return __PACKAGE__->perseus_lemmatize( @_ );
74 return __PACKAGE__->perseus_reading_lookup( @_ );
77 =head2 regularize( $text )
79 Returns a regularized form of the reading for the purposes of collation.
85 # We don't really distinguish between commas and semicolons properly
86 # in the manuscript. Make them the same.
89 # Get rid of accent marks.
93 # Get rid of any backtick that falls mid-word.
95 # Standardize ligatures.
96 $word =~ s/աւ/օ/g; # for easy vocalic comparison to ո
99 # TODO split off suspected prefix/suffix markers?