The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Text::Same::Match

DESCRIPTION

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.

SYNOPSIS

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

METHODS

See below. Methods private to this module are prefixed by an underscore.

new

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

add

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

source1

Title   : source1
Usage   : my $chunked_source = $match->source1;
Function: get the ChunkedSource for the source 1
Returns : a ChunkedSource reference
Args    : none

source2

Title   : source2
Usage   : my $chunked_source = $match->source2;
Function: get the ChunkedSource for the source 2
Returns : a ChunkedSource reference
Args    : none

min1

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

max1

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

min2

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

max2

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

set_min1

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

set_min2

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

set_max1

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

set_max2

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

pairs

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

score

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

as_string

Title   : as_string
Usage   : my $str = $match->as_string
Function: return a string representation of this Match
Args    : none

AUTHOR

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

COPYRIGHT & LICENSE

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.

DISCLAIMER

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