Block/W2A/EN/TagMorphoDiTa.pm

filter: Statementstmt 100% 12 / 12 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 4 / 4 Podpod n/a totaltotal 100% 16 / 16 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« Tool/EnglishMorpho/exceptions/verbs_other.pl ↑ Summary EN.pm »
1 package Treex::Block::W2A::EN::TagMorphoDiTa;
2 $Treex::Block::W2A::EN::TagMorphoDiTa::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 extends 'Treex::Block::W2A::TagMorphoDiTa';
8  
9 has '+model' => ( default => 'data/models/morphodita/en/english-morphium-wsj-140407.tagger' );
10  
11 has 'negative_prefixes_in_lemma' => (
12 is => 'ro',
13 isa => 'Bool',
14 default => 0,
15 documentation => 'Some English MorphoDiTa models lemmatize words with negative prefixes'
16 . ' e.g. as "unable"->"able^un". Do we want to have such lemmas? Default is false.',
17 );
18  
19  
20 after 'process_atree' => sub {
21 my ($self, $atree) = @_;
22 if ($self->lemmatize && $self->model !~ /no_negation.tagger$/ && !$self->negative_prefixes_in_lemma){
23 foreach my $anode ($atree->get_descendants()){
24 my ($lemma, $prefix) = split /\^/, $anode->lemma;
25 if (defined $prefix){
26 $anode->set_lemma($lemma);
27 $anode->set_iset(negativeness => 'neg');
28 }
29 }
30 }
31 return;
32 };
33  
34 1;
35  
36 __END__
« Tool/EnglishMorpho/exceptions/verbs_other.pl ↑ Summary EN.pm »