Help-Site Computer Manuals
Software
Hardware
Programming
Networking
  Algorithms & Data Structures   Programming Languages   Revision Control
  Protocols
  Cameras   Computers   Displays   Keyboards & Mice   Motherboards   Networking   Printers & Scanners   Storage
  Windows   Linux & Unix   Mac

FrameNet::QueryData
A module for accessing the FrameNet data.

FrameNet::QueryData - A module for accessing the FrameNet data.


NAME

FrameNet::QueryData - A module for accessing the FrameNet data.


VERSION

Version 0.03


SYNOPSIS


    use FrameNet::QueryData;

    # The name of the frame

    my $framename = "Getting";

    my $qd = FrameNet::QueryData->new(-fnhome => $ENV{'FNHOME'},

                                      -verbose => 0,

                                      -cache => 1);

    

    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);

    # Listing all frames that are used by Getting

    print $qd->related_frames('Getting', 'Using');

    # List all frames that use Getting

    print $qd->related_inv_frames('Getting', 'Using');

    # Find out if two frames are directly related

    print "They are!" if ($qd->related("Getting", "Intentionally_create"));

    # Find out, if two frames are related through a Using relation

    print "They are!" if ($qd->path_related("Getting", "Intentionally_create", "Using"));

    # Find out if two frames are related through some relations and other frames, i.e. indirectly related

    print "They are!" if ($qd->transitive_related("Getting", "Intentionally_create"));

    # Printing a list of all frames 

    print join(', ', $qd->frames);


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 has been tested with FrameNet 1.2 and 1.3. Other versions may work, but it is not guaranteed.


METHODS

new ( -fnhome, -verbose, -cache)
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.

-cache (available since 0.03) controls, if the parsed data is kept in a file for later use. This increases performance significantly. The cache itself is located in the temporary directory of your system.

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'.

related_frames ($FRAMENAME, $RELATIONNAME)
This method returns a list of frame names, that are related to $FRAMENAME via the relation $RELATIONNAME.

related_inv_frames ($FRAMENAME, $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.

related ( $FRAME1, $FRAME2 )
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.

transitive_related ( $FRAME1, $FRAME2 )
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.

path_related ( $FRAME1, $FRAME2, @RELATIONS )
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 (NOT a reference to 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 reiter@cpan.org.


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.

Programminig
Wy
Wy
yW
Wy
Programming
Wy
Wy
Wy
Wy