| 1 | package Treex::Core::TredView::Common; | ||||||||||
| 2 | 4 | $Treex::Core::TredView::Common::VERSION = '2.20210102'; | |||||||||
| 3 | 4 | ▶ | use Moose; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 4 | ▶ | use Treex::Core::Log; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | |||||||||||
| 6 | 0 | ▶ | sub cur_node { | ||||||||
|
Subroutine
cur_node: not called CC=2 SCAR=13.7
Pod
documented
| |||||||||||
| 7 | 0 | my $node; | |||||||||
| 8 | |||||||||||
| 9 | # TODO: no warnings should be avoided as well as the whole re-blessing | ||||||||||
| 10 | { | ||||||||||
| 11 | 0 | ▶ | no warnings 'once'; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.2
| |||||||||||
| 12 | 0 | $node = $TredMacro::this; | |||||||||
| 13 | } | ||||||||||
| 14 | |||||||||||
| 15 | 0 | my $layer; | |||||||||
| 16 | 0 | ▶ | if ( $node->type->get_structure_name =~ /(\S)-(root|node|nonterminal|terminal)/ ) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 17 | 0 | $layer = $1; | |||||||||
| 18 | } | ||||||||||
| 19 | else { | ||||||||||
| 20 | 0 | return; | |||||||||
| 21 | } | ||||||||||
| 22 | 0 | bless $node, 'Treex::Core::Node::' . uc($layer); | |||||||||
| 23 | |||||||||||
| 24 | 0 | return $node; | |||||||||
| 25 | } | ||||||||||
| 26 | |||||||||||
| 27 | 4 | 1; | |||||||||
| 28 | |||||||||||
| 29 | __END__ | ||||||||||