| 1 | package Treex::Block::W2A::EN::Lemmatize; | ||
| 2 | BEGIN { | ||
| 3 | 1 | ▶ | $Treex::Block::W2A::EN::Lemmatize::VERSION = '0.06903_1'; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | } | ||
| 5 | 1 | ▶ | use Moose; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 6 | 1 | ▶ | use Treex::Core::Common; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 7 | 1 | extends 'Treex::Core::Block'; | |
| 8 | |||
| 9 | 1 | ▶ | use Treex::Tool::EnglishMorpho::Lemmatizer; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 10 | |||
| 11 | 1 | has 'lemmatizer' => ( | |
| 12 | is => 'ro', | ||
| 13 | isa => 'Treex::Tool::EnglishMorpho::Lemmatizer', | ||
| 14 | builder => '_build_lemmatizer', | ||
| 15 | init_arg => undef, | ||
| 16 | lazy => 1, | ||
| 17 | ); | ||
| 18 | |||
| 19 | sub process_anode { | ||
| 20 | 0 | ▶ | my ( $self, $anode ) = @_; |
|
Subroutine
process_anode: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 21 | 0 | my ( $lemma ) = $self->lemmatizer->lemmatize( $anode->form, $anode->tag ); #gracefully throwing away second field of returned list | |
| 22 | 0 | $anode->set_lemma($lemma); | |
| 23 | |||
| 24 | 0 | return 1; | |
| 25 | } | ||
| 26 | |||
| 27 | sub _build_lemmatizer { | ||
| 28 | 0 | ▶ | my $self = shift; |
|
Subroutine
_build_lemmatizer: not called CC=1 SCAR=6.9
| |||
| 29 | 0 | my $lemmatizer = Treex::Tool::EnglishMorpho::Lemmatizer->new(); | |
| 30 | 0 | return $lemmatizer; | |
| 31 | } | ||
| 32 | |||
| 33 | 1 | 1; | |
| 34 | |||
| 35 | __END__ | ||
| 36 | |||
| 37 | =encoding utf-8 | ||
| 38 | |||
| 39 | =head1 NAME | ||
| 40 | |||
| 41 | Treex::Block::W2A::EN::Lemmatize - wrapper for rule based lemmatizer for English | ||
| 42 | |||
| 43 | =head1 VERSION | ||
| 44 | |||
| 45 | version 0.06903_1 | ||
| 46 | |||
| 47 | =head1 DESCRIPTION | ||
| 48 | |||
| 49 | For each node in the analytical tree, attribute C<lemma> is filled with a lemma | ||
| 50 | derived from attributes C<form> and C<tag> using C<Treex::Tool::EnglishMorpho::Lemmatizer>. | ||
| 51 | |||
| 52 | =head1 ATTRIBUTES | ||
| 53 | |||
| 54 | =over 4 | ||
| 55 | |||
| 56 | =item lemmatizer | ||
| 57 | |||
| 58 | An instance of C<Treex::Tool::EnglishMorpho::Lemmatizer> | ||
| 59 | |||
| 60 | =back | ||
| 61 | |||
| 62 | =head1 OVERRIDEN METHODS | ||
| 63 | |||
| 64 | =head2 from C<Treex::Core::Block> | ||
| 65 | |||
| 66 | =over 4 | ||
| 67 | |||
| 68 | =item process_anode | ||
| 69 | |||
| 70 | =back | ||
| 71 | |||
| 72 | =head1 AUTHORS | ||
| 73 | |||
| 74 | Zdeněk Žabokrtský <zabokrtsky@ufal.mff.cuni.cz> | ||
| 75 | |||
| 76 | David Mareček <marecek@ufal.mff.cuni.cz> | ||
| 77 | |||
| 78 | =head1 COPYRIGHT AND LICENSE | ||
| 79 | |||
| 80 | Copyright © 2008 - 2011 by Institute of Formal and Applied Linguistics, Charles University in Prague | ||
| 81 | |||
| 82 | This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. | ||