1 package Text::Tradition::Collation::Reading::WordForm;
7 Text::Tradition::Collation::Reading::WordForm - represents a
8 language/lemma/morphology triplet that can be associated with a Reading.
12 Text::Tradition is a library for representation and analysis of collated
13 texts, particularly medieval ones. A word form is used for the analysis of
14 Reading objects; it consists of a lemma, a language, and a code to
15 represent its part of speech. In general the word forms for a particular
16 language should be read from / written to some morphological database.
22 Creates a new word form from the passed options.
26 Returns the language to which this word form belongs.
30 Returns the lemma for the word form.
34 Returns an array representing this word's morphology. The contents of the
35 array depend on the language being used.
45 # TODO do we need this?
64 around BUILDARGS => sub {
67 my %args = @_ == 1 ? %{$_[0]} : @_;
68 unless( ref( $args{'morphology'} ) ) {
69 my @morph = split( '', $args{'morphology'} );
70 $args{'morphology'} = \@morph;
72 $class->$orig( %args );
77 return sprintf( "%s//%s//%s", $self->language, $self->lemma,
78 join( '', $self->morphology ) );
82 __PACKAGE__->meta->make_immutable;
88 This package is free software and is provided "as is" without express
89 or implied warranty. You can redistribute it and/or modify it under
90 the same terms as Perl itself.
94 Tara L Andrews E<lt>aurum@cpan.orgE<gt>