1 package Text::Tradition::Language;
12 Text::Tradition::Language - add-on role to enable language awareness and
13 morphology functions to a Text::Tradition object. See also
14 L<Text::Tradition::Morphology> for individual reading morphologies.
20 Accessor for the primary language of the tradition. Must correspond to one
21 of the Text::Tradition::Language::* modules in this package.
28 predicate => 'has_language',
31 before 'language' => sub {
33 if( @_ && $_[0] ne 'Default' ) {
34 # We are trying to set the language; check that the corresponding
36 eval "require Text::Tradition::Language::".$_[0];
38 throw( "Cannot load language module for @_: $@" );
45 Calls the appropriate lemmatization function for the language of the
52 unless( $self->has_language ) {
53 throw( "Please set a language to lemmatize a tradition" );
55 my $mod = "Text::Tradition::Language::" . $self->language;
57 $mod->can( 'lemmatize' )->( $self );
64 This package is free software and is provided "as is" without express
65 or implied warranty. You can redistribute it and/or modify it under
66 the same terms as Perl itself.
70 Tara L Andrews E<lt>aurum@cpan.orgE<gt>