From: Tara L Andrews Date: Tue, 25 Sep 2012 02:40:56 +0000 (+0200) Subject: method to clear out collation object for re-collation X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=d1a7f940d4e77a9e3540335b3c9f84cf81127ad6;p=scpubgit%2Fstemmatology.git method to clear out collation object for re-collation --- diff --git a/base/lib/Text/Tradition.pm b/base/lib/Text/Tradition.pm index bd3ac2f..6bd9293 100644 --- a/base/lib/Text/Tradition.pm +++ b/base/lib/Text/Tradition.pm @@ -334,6 +334,19 @@ sub BUILD { return $self; } +=head2 clear_collation + +Blow away the existing collation object and mark all witnesses as uncollated. +Not to be used lightly. + +=cut + +sub clear_collation { + my $self = shift; + $self->_save_collation( Text::Tradition::Collation->new( tradition => $self ) ); + map { $_->is_collated( 0 ) } $self->witnesses; +} + =head2 add_json_witnesses( $jsonstring, $options ) Adds a set of witnesses from a JSON array specification. This is a wrapper