1 package Text::Tradition::Collation;
7 writer => '_init_graph',
9 add_node => 'add_reading',
10 del_node => 'del_reading',
11 add_edge => 'add_path',
12 del_edge => 'del_path',
18 # TODO do we not have a way to access the parent object?
21 isa => 'Text::Tradition',
24 # The collation can be created two ways:
25 # 1. Collate a set of witnesses (with CollateX I guess) and process
26 # the results as in 2.
27 # 2. Read a pre-prepared collation in one of a variety of formats,
28 # and make the graph from that.
30 # The graph itself will (for now) be immutable, and the positions
31 # within the graph will also be immutable. We need to calculate those
32 # positions upon graph construction. The equivalences between graph
33 # nodes will be mutable, entirely determined by the user (or possibly
34 # by some semantic pre-processing provided by the user.) So the
35 # constructor should just make an empty equivalences object. The
36 # constructor will also need to make the witness objects, if we didn't
37 # come through option 1.
41 # Wrappers around some methods
45 my $first_node = shift;
46 my $second_node = shift;
47 $first_node->merge_from( $second_node );
48 unshift( @_, $first_node, $second_node );
49 return $self->graph->merge_nodes( @_ );
53 __PACKAGE__->meta->make_immutable;