File Coverage

blib/lib/Treex/Core/DocZone.pm
Criterion Covered Total %
statement 3 3 100.0
branch n/a
condition n/a
subroutine 1 1 100.0
pod n/a
total 4 4 100.0


line stmt bran cond sub pod time code
1             package Treex::Core::DocZone;
2             $Treex::Core::DocZone::VERSION = '2.20210102';
3 24     24   216 use Moose;
  24         71  
  24         199  
4              
5             extends 'Treex::Core::Zone';
6              
7             has text => ( is => 'rw' );
8              
9             1;
10              
11             __END__
12              
13              
14             =encoding utf-8
15              
16             =head1 NAME
17              
18             Treex::Core::DocZone - document zone for the text attribute
19              
20             =head1 VERSION
21              
22             version 2.20210102
23              
24             =head1 SYNOPSIS
25              
26             use Treex::Core;
27             my $doc = Treex::Core->new;
28             my $zone = $doc->create_zone('en','reference');
29             $zone->set_text('Piece of text. Translated by a human.');
30              
31              
32             =head1 DESCRIPTION
33              
34             Document zones allow Treex documents to contain more texts,
35             typically parallel texts (translations), or corresponding
36             texts from different sources (text to be translated, reference
37             translation, test translation).
38              
39             =head1 ATTRIBUTES
40              
41             Treex::Core::DocZone instances have the following attributes:
42              
43             =over 4
44              
45             =item language
46              
47             =item selector
48              
49             =item my $text = $zone->text;
50              
51             =back
52              
53             The attributes can be accessed using semi-affordance accessors:
54             getters have the same names as attributes, while setters start with
55             'C<set_>'. For example, the attribute C<text> has a getter C<text()> and a setter C<set_text($text)>
56              
57              
58             =head1 METHODS
59              
60             =head2 Construction
61              
62             C<Treex::Core::DocZone> instances should not be created by a constructor,
63             but should be created exclusively from the embedding document
64             by one of the document's methods:
65              
66             =over 4
67              
68             =item create_zone
69              
70             =item get_or_create_zone
71              
72             =back
73              
74              
75             =head1 AUTHOR
76              
77             Zdeněk Žabokrtský <zabokrtsky@ufal.mff.cuni.cz>
78              
79             =head1 COPYRIGHT AND LICENSE
80              
81             Copyright © 2011 by Institute of Formal and Applied Linguistics, Charles University in Prague
82              
83             This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.