NAME

FrameNet::WordNet::Detour - a WordNet2FrameNet 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);

if ($result->isOK) {
  print "Beste Frames: \n"
  print join(' ', $result->get_best_framenames);
  print "Alle Frames: \n"
  print join(' ', $result->get_all_framenames);
  foreach my $frame ($result->get_all_frames) {
     print $frame->get_name.": ";
     print $frame->get_weight."\n";
  }
} else {
  print $result->get_message."\n";
}

DESCRIPTION

FUNCTIONS

new( $wn, $sim )

Blesses a new Detour-object. $wn has to be an object of type WordNet::QueryData, $sim has to be an object of type WordNet::similarity::path.

Will call implicitly the method initialize().

query ( $string )

The query-function. Returns a FrameNet::WordNet::Detour::Data-object containing the result. $string can be either one synset (e.g. get#v#1) or a word and its part-of-speech (e.g. get#v).

If the string one asks for is not recorded in WordNet or if the query-string is not wellformed, then a Data-object will be returned also, but it contains no data, and its method isOK() will return a false value.

A more detailed description of the error can be accessed via getMessage() and will be in verbose output if it is enabled (see set_verbose() for further information).

The query-string can be given in two forms:

get#v#1 -- a fully specified synset or
get#v -- a word and its part-of-speech

In either way, the delimiter has to be '#'.

listQuery ( $list )

Returns a reference to a list of Data-objects. These are the results of a query for each single synset in the given $list (which has to be given as reference).

For the specification of each single synset, the same rules as in the function "query" apply.

Internally, this method will be called with all synsets for this word in a list from within query() if one gives a query string of the second form.

For internal use only.

basicQuery ( $synset )

Queries one single, fully specified Synset, and returns the result as a non-blessed reference to a hash.

For internal use only.

cached ( )
uncached ( )

Enables or disables the caching.

If caching is enabled, all results are stored in a binary file. The file is located in /tmp (or an equivalent). The results are devided into the limited and the unlimited ones and stored in different files.

Default: Cached.

limited ( )
unlimited ( )

Enables or Disables the limited-mode.

In the limited mode, the query-synset itself will not be asked for in FrameNet. Normally, there should be no need to use the limited mode, since one could easily get the frames to a synset, when it is specified as lexical unit in FrameNet. In this case, there is no need for this whole script either.

Default: Unlimited.

set_verbose ( )
set_debug ( )
unset_verbose ( )

As the names allready tell, with these methods, one can set different modes of output. If the script is in verbose-mode, some information during the work is printed out. If the script runs in debug-mode, information as much as possible will be printed out. With unset_verbose(), no information at all will be printed.

All output goes to STDERR.

Default: No verbose, no debug.

initialize ( )

This method initializes the object. I.e., it sets several values to its defaults and it empties the result-array. The default values are:

  • cached: 1

  • limited: 0

  • verbosity: 0

BUGS

Please report bugs to 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.

SEE ALSO

WordNet::QueryData

WordNet::similarity

FrameNet::WordNet::Detour::Data

FrameNet::WordNet::Detour::Frame