Tara Andrews > Text-Tradition-Analysis > Text::Tradition::Analysis::Result

Download:
Text-Tradition-Analysis-1.2_clean.tar.gz

Dependencies

Annotate this POD

View/Report Bugs
Source  

NAME ^

Text::Tradition::Analysis::Result - object to express an IDP calculation result for a particular graph problem.

DESCRIPTION ^

Given a graph (expressing a stemma hypothesis) and a set of witness groupings (expressing variation in reading between witnesses related according to the stemma hypothesis), it is possible to calculate certain properties of how the readings might be related to each other. This calculation depends on a custom program run under the IDP system [TODO URL]. As the problem is NP-hard, the calculation can take a long time. The purpose of this object is to allow storage of calculated results in a database.

For each graph problem, the following features can be calculated:

CONSTRUCTOR ^

new

Creates a new graph problem. Requires two properties:

All other properties should be calculated by IDP rather than set manually. These include:

METHODS ^

$self->has_class( $witness )

$self->class( $witness )

If a class has been calculated for the given witness, has_class returns true and class returns the calculated answer.

$self->object_key

Returns a unique key that can be used to look up this graph/set combination in a database. Currently an MD5 hash of the request_string.

$self->request_string

A request string is the graph followed by the groups, which should form a unique key for the result.

by_size_and_alpha

A useful utility function to sort Set::Scalar objects first in descending order by size, then in ascending alphabetical order by first element (i.e. by stringification.)

$self->sources

Return all 'source' class witnesses in these sets for this graph.

$self->minimum_grouping_for( $set )

Return the minimum grouping (including necessary hypothetical witnesses) for the witness set specified. Will return undef if $set does not match one of the defined witness sets in $self->sets.

CALCULATION STORAGE METHODS ^

$self->is_genealogical( $bool )

Record that the sets are genealogical for this graph.

$self->set_class( $witness, $class )

Record that the witness in question is of the given class.

$self->record_grouping( $group )

Record that the group in question (either an arrayref or a Set::Scalar) forms a minimum grouping on the graph. Will throw an error unless the group is a (non-proper) superset of an existing witness set.

syntax highlighting: