NAME
FrameNet::WordNet::Detour::Data - A class representing the results of the Detour.
SYNOPSIS
use FrameNet::WordNet::Detour;
my $wn = WordNet::QueryData->new($WNSEARCHDIR);
my $sim = WordNet::Similarity::path->new ($wn);
my $detour = FrameNet::WordNet::Detour->new($wn,$sim);
my $result = $detour->query($synset);
$result->isOK; # Returns whether there were problems in the run
$result->getMessage; # Returns 'Ok' or an error message
# All frames are returned as lists of
# L<FrameNet::WordNet::Detour::Frame> objects
$result->get_best_frames; # Returns the frames
# with the highest weight
$result->get_best_frames(3); # Returns the frames
# with the three highest weights
$result->get_all_frames; # Returns all resulting frames
$result->get_best_framenames; # Returns the names
# of the highest weighted frames
$result->get_best_framenames(3); # Returns the names of the frames
# with the three highest weights
$result->get_all_framenames; # Returns the names of all frames.
METHODS
- get_frame FRAME
-
Returns the frame $string as a FrameNet::WordNet::Detour::Frame-object. Returns -1 if FRAME is not in the result (Pay attention on lower/upper case, we look a bit around, but that could be a hard-to-find error).
- get_best_frames [ NUMBER ]
-
Returns the frames with the highest weight (as Frame-objects). Optional: If you specify $number, the method returns the $number highest rated frames.
- get_all_frames
-
Returns all found frames as Frame-objects.
- get_query
-
Returns the query-synset as string.
- get_fees FRAME
-
Returns the frame evoking elements for the given frame. Returns -1 if FRAME was not in the result (Pay attention on lower/upper case, we look a bit around, but that could be a hard-to-find error).
- get_weight FRAME
-
Returns the weight of the given frame. Returns -1 if FRAME was not in the result(Pay attention on lower/upper case, we look a bit around, but that could be a hard-to-find error).
- get_weights
-
Returns a reference to an array of all weights that appeared in this run. The weights are sorted in descending order (normally, one is interested in the best e.g. highest values instead of the bad ones).
- get_number_of_frames
-
Returns the overall number of frames found for this specific query:
# The first variant returns all frames, because even in the worst # case (that each frame has a different weight) we get all weight # classes. It does not matter if one specifies a number greater # that the numer of existing frames, # so the second variant leads normally to the same results. $result->get_best_frames($result->get_number_of_frames) $result->get_best_frames(1000);
- get_frames_with_weight WEIGHT
-
Returns a reference to a list of the frames with the given weight. You should notice, that you have to give the exact weight - e.g. like in the get_weights-array. Rounded values will not find anything.
BUGS
Please report bugs to mailto:reiter@cpan.org.
COPYRIGHT
Copyright 2005 Aljoscha Burchardt and Nils Reiter. All rights reserved.
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.