allow wordforms to be cleared out
[scpubgit/stemmatology.git] / lib / Text / Tradition / Collation / Reading / Lexeme.pm
index b6c7693..fa564ee 100644 (file)
@@ -4,6 +4,7 @@ use Moose;
 use JSON ();
 use Module::Load;
 use Text::Tradition::Collation::Reading::WordForm;
+use Text::Tradition::Error;
 
 =head1 NAME
 
@@ -78,6 +79,7 @@ has 'wordform_matchlist' => (
                'matching_forms' => 'elements',
                'matching_form' => 'get',
                'add_matching_form' => 'push',
+               'clear_matching_forms' => 'clear',
                },
        default => sub { [] },
        );
@@ -188,6 +190,14 @@ sub TO_JSON {
        $hash->{'wordform_matchlist'} = [ $self->matching_forms ] if $self->matches;
        return $hash;
 }
+
+sub throw {
+       Text::Tradition::Error->throw( 
+               'ident' => 'Lexeme error',
+               'message' => $_[0],
+               );
+}
+
 no Moose;
 __PACKAGE__->meta->make_immutable;