1 package Text::Tradition::Language;
9 Text::Tradition::Language - add-on role to enable language awareness and
10 morphology functions to a Text::Tradition object. See also
11 L<Text::Tradition::Morphology> for individual reading morphologies.
17 Accessor for the primary language of the tradition. Must correspond to one
18 of the Text::Tradition::Language::* modules in this package.
25 predicate => 'has_language',
28 before 'language' => sub {
30 if( @_ && $_[0] ne 'Default' ) {
31 # We are trying to set the language; check that the corresponding
33 eval "require Text::Tradition::Language::".$_[0];
35 throw( "Cannot load language module for @_: $@" );
42 Calls the appropriate lemmatization function for the language of the
49 unless( $self->has_language ) {
50 throw( "Please set a language to lemmatize a tradition" );
52 my $mod = "Text::Tradition::Language::" . $self->language;
54 $mod->can( 'lemmatize' )->( $self );
61 This package is free software and is provided "as is" without express
62 or implied warranty. You can redistribute it and/or modify it under
63 the same terms as Perl itself.
67 Tara L Andrews E<lt>aurum@cpan.orgE<gt>