| 1 | package Treex::Core::TredView::Common; | ||||||||||
| 2 | 4 | $Treex::Core::TredView::Common::VERSION = '2.20151210'; | |||||||||
| 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 | sub cur_node { | ||||||||||
| 7 | 0 | ▶ | my $node; | ||||||||
|
Subroutine
cur_node: not called CC=2 SCAR=13.7
Pod
documented
| |||||||||||
| 8 | |||||||||||
| 9 | # TODO: no warnings should be avoided as well as the whole re-blessing | ||||||||||
| 10 | { | ||||||||||
| 11 | 4 | ▶ | 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__ | ||||||||||
| 30 | |||||||||||
| 31 | =pod | ||||||||||
| 32 | |||||||||||
| 33 | =encoding utf-8 | ||||||||||
| 34 | |||||||||||
| 35 | =head1 NAME | ||||||||||
| 36 | |||||||||||
| 37 | Treex::Core::TredView::Common - Common methods related to TredView | ||||||||||
| 38 | |||||||||||
| 39 | =head1 VERSION | ||||||||||
| 40 | |||||||||||
| 41 | version 2.20151210 | ||||||||||
| 42 | |||||||||||
| 43 | =head1 DESCRIPTION | ||||||||||
| 44 | |||||||||||
| 45 | This packages provides methods that are useful for the whole TredView::* set of | ||||||||||
| 46 | packages. | ||||||||||
| 47 | |||||||||||
| 48 | =head1 METHODS | ||||||||||
| 49 | |||||||||||
| 50 | =head2 Public methods | ||||||||||
| 51 | |||||||||||
| 52 | =over 4 | ||||||||||
| 53 | |||||||||||
| 54 | =item cur_node | ||||||||||
| 55 | |||||||||||
| 56 | =back | ||||||||||
| 57 | |||||||||||
| 58 | =head2 Private methods | ||||||||||
| 59 | |||||||||||
| 60 | =over 4 | ||||||||||
| 61 | |||||||||||
| 62 | =back | ||||||||||
| 63 | |||||||||||
| 64 | =head1 AUTHOR | ||||||||||
| 65 | |||||||||||
| 66 | Josef Toman <toman@ufal.mff.cuni.cz> | ||||||||||
| 67 | |||||||||||
| 68 | =head1 COPYRIGHT AND LICENSE | ||||||||||
| 69 | |||||||||||
| 70 | Copyright © 2011 by Institute of Formal and Applied Linguistics, Charles University in Prague | ||||||||||
| 71 | |||||||||||
| 72 | This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. | ||||||||||