NAME
WordNet::Similarity::DepthFinder - methods to find the depth of synsets in WordNet taxonomies
SYNOPSIS
use WordNet::QueryData;
use WordNet::Similarity::DepthFinder;
my $wn = WordNet::QueryData->new;
defined $wn or die "Construction of WordNet::QueryData failed";
my $obj = WordNet::Similarity::DepthFinder->new ($wn);
my ($err, $errString) = $obj->getError ();
$err and die $errString;
my @roots = $obj->getTaxonomyRoot (2855301, 'n');
my $taxonomy_depth = $obj->getTaxonomyDepth ($roots[0], 'n');
print "The maximum depth of the car#n#4's taxonomy is $taxonomy_depth\n";
my @depths = $obj->getSynsetDepth (2855301, 'n');
print "The depth of car#n#4 is $depths[0]->[0]\n";
DESCRIPTION
The following methods are provided by this module:
- $obj->initialize ($configfile)
-
Overrides the initialize method in WordNet::Similarity to look for and process depths files. The superclass' initialize method is also called.
- $obj->getSynsetDepth ($offset, $pos)
-
Returns the depth(s) of the synset denoted by $offset and $pos. The return value is a list of references to arrays. Each array has the form (depth, root).
- $obj->getTaxonomyDepth ($offset, $pos)
-
Returns the maximum depth of the taxonomy rooted at the synset identified by $offset and $pos. If $offset and $pos does not identify a root of a taxonomy, then undef is returned and an error is raised.
- $obj->getTaxonomies ($offset, $pos)
-
Returns a list of the roots of the taxonomies to which the synset identified by $offset and $pos belongs.
- $obj->_processSynsetsFile ($filename)
-
Reads and processes a synsets file as output by wnDepths.pl
- $obj->_processTaxonomyFile ($filename)
-
Reads and processes a taxonomies file as produced by wnDepths.pl
AUTHORS
Jason Michelizzi, University of Minnesota Duluth
mich0212 at d.umn.edu
Ted Pedersen, University of Minnesota Duluth
tpederse at d.umn.edu
BUGS
None.
To report bugs, e-mail tpederse at d.umn.edu or go to http://groups.yahoo.com/group/wn-similarity/.
SEE ALSO
WordNet::Similarity(3) WordNet::Similarity::wup(3) WordNet::Similarity::lch(3)
COPYRIGHT
Copyright (C) 2004, Jason Michelizzi and Ted Pedersen
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to
The Free Software Foundation, Inc.,
59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
Note: a copy of the GNU General Public License is available on the web at http://www.gnu.org/licenses/gpl.txt and is included in this distribution as GPL.txt.