NAME
FrameNet::QueryData - A module for accessing the FrameNet data.
VERSION
Version 0.01
SYNOPSIS
use FrameNet::QueryData;
# The name of the frame
my $framename = "Getting";
my $qd = FrameNet::QueryData->new(-fnhome => $ENV{'FNHOME'},
-verbose => 0);
my $frame = $qd->frame($framename);
# Getting the lexical units
my $lus = $frame->{'lus'};
# Getting the frame elements
my $fes = $frame->{'fes'}
# Listing the names of all lexical units
print join(', ', map { $_->{'name'} } @$lus);
DESCRIPTION
The purpose of this module is to provide an easy access to FrameNet. Its database is organized in large XML files, which are parsed by this module. The module is tested with FrameNet 1.2. Other versions may work, but it can not be guaranteed.
METHODS
- new ( -fnhome, -verbose)
-
The constructor for this class. It can take two arguments: The path to the FrameNet directory and a verbosity level. Both are not mandatory. -fnhome defaults to the environment variable $FNHOME, -verbose defaults to 0 (zero), which means no output.
- fnhome ($FNHOME)
-
Sets and returns the FrameNet home directory. If the argument is given, it will be set to the new value. If the argument is omitted, the value will be returned.
- verbose ($VERBOSE)
-
Sets and returns the verbosity level. If the argument is given, the verbosity level will be set to this new value. If not, the value is returned.
- frame ($FRAMENAME)
-
This method returns a hash containing information for the frame $FRAMENAME. The hash has three elements:
- name
-
The name of the frame
- lus
-
A list containing all the lexical units of the frame. The lexical units are represented by another hash containing the keys 'name', 'ID', 'pos', 'status' and 'lemmaId'.
- fes
-
A list containg all the frame elements for this frame. The frame elements are represented by a hash containing the keys 'name', 'ID', 'abbrev' and 'coreType'.
-
This method returns a list of frame names, that are related to $FRAMENAME via the relation $RELATIONNAME.
-
Does the same as "related_frames ($FRAMENAME, $RELATIONNAME)", but in the other direction of the relation. Using the relation "Inheritance", you can ask for the superordinated frames for example.
-
Checks, if $FRAME1 and $FRAME2 are somehow related. If they are related, the exact name of the relation is returned. Otherwise, a 0 (zero) is returned. Note, that this method is not transitive.
-
Checks, if $FRAME1 and $FRAME2 are somehow related. There is no limit on the maximum number of steps, so this method can be slow. And it will probably run forever, if a frame is related to itself.
-
With this method, one can check if $FRAME1 and $FRAME2 are related through the given path. The path itself is a list of relations. The method tries to explore all the possiblities along the path, so it is also slow.
- frames ( )
-
Returns a list of all frames that are defined in FrameNet.
- file_frames_xml ( $PATH )
-
Can be used to get and set the path to the file frames.xml. To get it, just use it without argument.
- file_frrelation_xml ( $PATH )
-
Can be used to get and set the path to the file frrelation.xml. To get, use it without argument.
- parse ( )
-
Internal method.
- xparse ( )
-
Internal method.
AUTHOR
Nils Reiter, <reiter@cpan.org>
BUGS
Please report any bugs or feature requests to bug-framenet-querydata@rt.cpan.org
, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=FrameNet-QueryData. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
ACKNOWLEDGEMENTS
COPYRIGHT & LICENSE
Copyright 2005 Nils Reiter and Aljoscha Burchardt, all rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.