default => sub { [] },
);
+has '_initialized' => (
+ is => 'ro',
+ isa => 'Bool',
+ default => undef,
+ writer => '_init_done',
+ );
+
# Create the witness before trying to add it
around 'add_witness' => sub {
my $orig = shift;
$mod->can('parse')->( $self, $init_args );
}
}
+ $self->_init_done( 1 );
return $self;
}
return $stemma;
}
+sub lemmatize {
+ my $self = shift;
+ unless( $self->has_language ) {
+ warn "Please set a language to lemmatize a tradition";
+ return;
+ }
+ my $mod = "Text::Tradition::Language::" . $self->language;
+ load( $mod );
+ $mod->can( 'lemmatize' )->( $self );
+}
+
no Moose;
__PACKAGE__->meta->make_immutable;