| 1 | package Treex::Block::W2A::EN::Lemmatize; | ||
| 2 | 1 | $Treex::Block::W2A::EN::Lemmatize::VERSION = '2.20151102'; | |
| 3 | 1 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | 1 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 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 | 0 | ▶ | sub process_anode { |
|
Subroutine
process_anode: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 20 | 0 | my ( $self, $anode ) = @_; | |
| 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 | 0 | ▶ | sub _build_lemmatizer { |
|
Subroutine
_build_lemmatizer: not called CC=1 SCAR=6.9
| |||
| 28 | 0 | my $self = shift; | |
| 29 | 0 | my $lemmatizer = Treex::Tool::EnglishMorpho::Lemmatizer->new(); | |
| 30 | 0 | return $lemmatizer; | |
| 31 | } | ||
| 32 | |||
| 33 | 1 | 1; | |
| 34 | |||
| 35 | __END__ | ||