is => 'rw',
isa => 'Int',
predicate => 'has_rank',
+ clearer => 'clear_rank',
);
+
+## For morphological analysis
+
+has 'normal_form' => (
+ is => 'rw',
+ isa => 'Str',
+ predicate => 'has_normal_form',
+ );
+
+has 'lemma' => (
+ is => 'rw',
+ isa => 'Str',
+ predicate => 'has_lemma',
+ );
+
+has 'morphology' => (
+ is => 'rw',
+ isa => 'Str',
+ predicate => 'has_morphology',
+ );
+
+has 'morph_possibilities' => (
+ is => 'ro',
+ isa => 'HashRef[Str]',
+ default => sub { {} },
+ );
+
+## For prefix/suffix readings
+
+has 'join_prior' => (
+ is => 'ro',
+ isa => 'Bool',
+ default => undef,
+ );
+
+has 'join_next' => (
+ is => 'ro',
+ isa => 'Bool',
+ default => undef,
+ );
around BUILDARGS => sub {
return $self->collation->related_readings( $self, @_ );
}
+=head2 witnesses
+
+Calls Collation's reading_witnesses with $self as the first argument.
+
+=cut
+
+sub witnesses {
+ my $self = shift;
+ return $self->collation->reading_witnesses( $self, @_ );
+}
+
=head2 predecessors
Returns a list of Reading objects that immediately precede $self in the collation.
return $self->id;
}
+sub TO_JSON {
+ my $self = shift;
+ return $self->text;
+}
+
no Moose;
__PACKAGE__->meta->make_immutable;