fix stemma test
[scpubgit/stemmatology.git] / lib / Text / Tradition / Collation / Data.pm
1 package Text::Tradition::Collation::Data;
2 use Moose;
3 use Graph;
4
5 has 'sequence' => (
6     is => 'ro',
7     isa => 'Graph',
8     default => sub { Graph->new() },
9     handles => {
10         paths => 'edges',
11     },
12     );
13     
14 has 'relations' => (
15         is => 'ro',
16         isa => 'Text::Tradition::Collation::RelationshipStore',
17         handles => {
18                 relationships => 'relationships',
19                 related_readings => 'related_readings',
20                 get_relationship => 'get_relationship',
21                 del_relationship => 'del_relationship',
22                 equivalence => 'equivalence',
23                 equivalence_graph => 'equivalence_graph',
24         },
25         writer => '_set_relations',
26         );
27
28 has 'readings' => (
29         isa => 'HashRef[Text::Tradition::Collation::Reading]',
30         traits => ['Hash'],
31     handles => {
32         reading     => 'get',
33         _add_reading => 'set',
34         del_reading => 'delete',
35         has_reading => 'exists',
36 #        reading_keys => 'keys',
37         readings   => 'values',
38     },
39     default => sub { {} },
40         );
41
42 has 'wit_list_separator' => (
43     is => 'rw',
44     isa => 'Str',
45     default => ', ',
46     );
47
48 has 'baselabel' => (
49     is => 'rw',
50     isa => 'Str',
51     default => 'base text',
52     );
53
54 has 'linear' => (
55     is => 'rw',
56     isa => 'Bool',
57     default => 1,
58     );
59     
60 has 'ac_label' => (
61     is => 'rw',
62     isa => 'Str',
63     default => ' (a.c.)',
64     );
65     
66 has 'wordsep' => (
67         is => 'rw',
68         isa => 'Str',
69         default => ' ',
70         );
71     
72 has 'start' => (
73         is => 'ro',
74         isa => 'Text::Tradition::Collation::Reading',
75         writer => '_set_start',
76         weak_ref => 1,
77         );
78
79 has 'end' => (
80         is => 'ro',
81         isa => 'Text::Tradition::Collation::Reading',
82         writer => '_set_end',
83         weak_ref => 1,
84         );
85         
86 has 'cached_table' => (
87         is => 'rw',
88         isa => 'HashRef',
89         predicate => 'has_cached_table',
90         clearer => 'wipe_table',
91         );
92         
93 has '_graphcalc_done' => (
94         is => 'rw',
95         isa => 'Bool',
96         default => undef,
97         ); 
98
99 1;