
Text::Same::Match

Objects of this class represent a match between a group of chunks (generally lines) in one source (eg a file) and a group of chunks in another. The "chunks" could potentially be paragraphs or sentences.

my @pairs = ($chunk_pair1, $chunk_pair2, ...); my $match = new Text::Same::Match(@pairs);

See below. Methods private to this module are prefixed by an underscore.
Title : new Usage : $match = new Text::Same::Match(@pairs) Function: Creates a new Match object from an array of ChunkPair objects Returns : A Text::Same::Match object Args : an array of ChunkPair objects
Title : add
Usage : $match->add(@chunk_pairs);
Function: add ChunkPair objects to this objects - no checks are made that
the new ChunkPairs are ajacent to the current pairs
Returns : $self
Args : an array of ChunkPair objects
Title : source1 Usage : my $chunked_source = $match->source1; Function: get the ChunkedSource for the source 1 Returns : a ChunkedSource reference Args : none
Title : source2 Usage : my $chunked_source = $match->source2; Function: get the ChunkedSource for the source 2 Returns : a ChunkedSource reference Args : none
Title : min1
Usage : $match->min1;
Function: return the minimum index of the chunks in the first (ie. left) of
the ChunkedSources held in this Match
Args : None
Title : max1
Usage : $match->max1;
Function: return the maximum index of the chunks in the first (ie. left) of
the ChunkedSources held in this Match
Args : None
Title : min2
Usage : $match->min2;
Function: return the minimum index of the chunks in the second (ie. right) of
the ChunkedSources held in this Match
Args : None
Title : max2
Usage : $match->max2;
Function: return the maximum index of the chunks in the second (ie. right) of
the ChunkedSources held in this Match
Args : None
Title : set_min1
Usage : $match->set_min1;
Function: Set the minimum index of the chunks in the first (ie. left) of
the ChunkedSources held in this Match
Title : set_min2
Usage : $match->set_min2;
Function: Set the minimum index of the chunks in the second (ie. right) of
the ChunkedSources held in this Match
Title : set_max1
Usage : $match->set_max1;
Function: Set the maximum index of the chunks in the first (ie. left) of
the ChunkedSources held in this Match
Title : set_max2
Usage : $match->set_max2;
Function: Set the maximum index of the chunks in the second (ie. right) of
the ChunkedSources held in this Match
Title : pairs Usage : my @pairs = $match->pairs; Function: return all the ChunkPair objects that have been add()ed to this Match Returns : a List of ChunkPair objects Args : none
Title : score
Usage : $acc = $seq->score;
Function: The score of this Match - longer match gives a higher score
Returns : int - currently returns the total number of lines this match
covers in both files
Args : None
Title : as_string Usage : my $str = $match->as_string Function: return a string representation of this Match Args : none

Kim Rutherford <kmr+same@xenu.org.uk>

Copyright 2005,2006 Kim Rutherford. All rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

This module is provided "as is" without warranty of any kind. It may redistributed under the same conditions as Perl itself.