| 1 | package Treex::Core::TredView::Common; | ||||||||||
| 2 | { | ||||||||||
| 3 | 4 | $Treex::Core::TredView::Common::VERSION = '0.08633_1'; | |||||||||
| 4 | } | ||||||||||
| 5 | |||||||||||
| 6 | 4 | ▶ | use Moose; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 7 | 4 | ▶ | use Treex::Core::Log; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 8 | |||||||||||
| 9 | sub cur_node { | ||||||||||
| 10 | 0 | ▶ | my $node; | ||||||||
|
Subroutine
cur_node: not called CC=2 SCAR=13.7
Pod
documented
| |||||||||||
| 11 | |||||||||||
| 12 | # TODO: no warnings should be avoided as well as the whole re-blessing | ||||||||||
| 13 | { | ||||||||||
| 14 | 4 | ▶ | no warnings 'once'; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.2
| |||||||||||
| 15 | 0 | $node = $TredMacro::this; | |||||||||
| 16 | } | ||||||||||
| 17 | |||||||||||
| 18 | 0 | my $layer; | |||||||||
| 19 | 0 | ▶ | if ( $node->type->get_structure_name =~ /(\S)-(root|node|nonterminal|terminal)/ ) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 20 | 0 | $layer = $1; | |||||||||
| 21 | } | ||||||||||
| 22 | else { | ||||||||||
| 23 | 0 | return; | |||||||||
| 24 | } | ||||||||||
| 25 | 0 | bless $node, 'Treex::Core::Node::' . uc($layer); | |||||||||
| 26 | |||||||||||
| 27 | 0 | return $node; | |||||||||
| 28 | } | ||||||||||
| 29 | |||||||||||
| 30 | 4 | 1; | |||||||||
| 31 | |||||||||||
| 32 | __END__ | ||||||||||
| 33 | |||||||||||
| 34 | =head1 NAME | ||||||||||
| 35 | |||||||||||
| 36 | Treex::Core::TredView::Common - Common methods related to TredView | ||||||||||
| 37 | |||||||||||
| 38 | =head1 VERSION | ||||||||||
| 39 | |||||||||||
| 40 | version 0.08633_1 | ||||||||||
| 41 | |||||||||||
| 42 | =head1 DESCRIPTION | ||||||||||
| 43 | |||||||||||
| 44 | This packages provides methods that are useful for the whole TredView::* set of | ||||||||||
| 45 | packages. | ||||||||||
| 46 | |||||||||||
| 47 | =head1 METHODS | ||||||||||
| 48 | |||||||||||
| 49 | =head2 Public methods | ||||||||||
| 50 | |||||||||||
| 51 | =over 4 | ||||||||||
| 52 | |||||||||||
| 53 | =item cur_node | ||||||||||
| 54 | |||||||||||
| 55 | =back | ||||||||||
| 56 | |||||||||||
| 57 | =head2 Private methods | ||||||||||
| 58 | |||||||||||
| 59 | =over 4 | ||||||||||
| 60 | |||||||||||
| 61 | =back | ||||||||||
| 62 | |||||||||||
| 63 | =head1 AUTHOR | ||||||||||
| 64 | |||||||||||
| 65 | Josef Toman <toman@ufal.mff.cuni.cz> | ||||||||||
| 66 | |||||||||||
| 67 | =head1 COPYRIGHT AND LICENSE | ||||||||||
| 68 | |||||||||||
| 69 | Copyright © 2011 by Institute of Formal and Applied Linguistics, Charles University in Prague | ||||||||||
| 70 | |||||||||||
| 71 | This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. | ||||||||||