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