Treex/Core/TredView/LineStyles.pm

filter: Statementstmt 69.2% 9 / 13 Branchbran 0.0% 0 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 50.0% 2 / 4 Podpod 0.0% 0 / 1 totaltotal 50.0% 11 / 22 CC 3 SCAR 19.0
CC
3
Cov
53%
dash_style
12.0
_build_dash
2.0
BEGIN
1.0
CRAP 6.7
« Treex/Core/Node/EffectiveRelations.pm ↑ Summary Treex/Block/Write/Treex.pm »
1 package Treex::Core::TredView::LineStyles;
2 3 $Treex::Core::TredView::LineStyles::VERSION = '2.20151210';
3 3 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 3 ▶use Treex::Core::Log;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6  
7 3 has '_dash' => (
8 is => 'ro',
9 isa => 'HashRef[Str]',
10 builder => '_build_dash',
11 );
12  
13 sub _build_dash {
14 return {
15 # just alignment lines are dashed, others are plain
16 0 ▶ 'alignment' => '5,3',
Subroutine _build_dash: not called CC=1 SCAR=6.9
17 'left' => '5,3',
18 'right' => '5,3',
19 'int' => '5,3',
20 'gdfa' => '5,3',
21 'revgdfa' => '5,3',
22 'rule-based' => '5,3',
23 'monolingual' => '5,3',
24 'copy' => '5,3',
25 };
26 }
27  
28  
29 sub dash_style {
30 0 ▶ my ( $self, $code ) = @_;
Subroutine dash_style: not called CC=3 SCAR=24.8
Pod undocumented
31  
32 # try to truncate complex alignment types to first one (e.g. "gdfa.int.left.right.revgdfa" -> "gdfa")
33 0 ▶ $code =~ s/\..*// if ( not exists $self->_dash->{$code} );
Branch: 1 branch
BranchTrueFalseTotal
unless exists $self->_dash->{$code} 0 0 0
34 # return dash type or nothing
35 0 ▶ return defined( $self->_dash->{$code} ) ? $self->_dash->{$code} : '' ;
Branch: 1 branch
BranchTrueFalseTotal
defined $self->_dash->{$code} ? : 0 0 0
36 }
37  
38  
39 3 1;
40  
41 __END__
42  
43 =pod
44  
45 =encoding utf-8
46  
47 =head1 NAME
48  
49 Treex::Core::TredView::LineStyles - List of line styles used in TrEd
50  
51 =head1 VERSION
52  
53 version 2.20151210
54  
55 =head1 DESCRIPTION
56  
57 This package provides names for common line styles (dash types) used in TrEd.
58  
59 =head1 AUTHOR
60  
61 Ondřej Dušek <odusek@ufal.mff.cuni.cz>
62  
63 =head1 COPYRIGHT AND LICENSE
64  
65 Copyright © 2012 by Institute of Formal and Applied Linguistics, Charles University in Prague
66  
67 This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
« Treex/Core/Node/EffectiveRelations.pm ↑ Summary Treex/Block/Write/Treex.pm »