Ted Pedersen >
WebService-UMLSKS-Similarity >
WebService::UMLSKS::GetAllowablePaths

WebService::UMLSKS::GetAllowablePaths - Get an allowable shortest path between the supplied terms.

use WebService::UMLSKS::GetAllowablePaths;

%subgraph = graph formed by FormGraph module;

$regex = allowable pattern regex specified by configuaration;

# $term1 and $term2 are current pair of terms

my $get_paths = WebService::UMLSKS::GetAllowablePaths->new;

my $get_path_info_result = $get_paths->get_shortest_path_info( \%subgraph, $term1, $term2,$verbose, $regex );

# $get_path_info_result is an array reference which consists of path information.

Get an allowable shortest path between the input terms. This module uses a standard BFS graph algorithm with small modifications to accomodate the rules for allowable path. It calculates the shortest allowable path between any two terms supplied to it as a input with a graph formed by FormGraph module.

The subroutines are as follows:

This sub creates a new object of GetAllowablePaths

This sub returns the shortest path along with its cost and number of changes in direction

This sub finds the cost of the path accepted as a parameter

This subroutines prints the current contents of hash of hash

This sub prints argument hash.

GetUserData.pm Query.pm ws-getAllowabletPath.pl GetParents.pm

Mugdha Choudhari, University of Minnesota Duluth <chou0130 at d.umn.edu>

Ted Pedersen, University of Minnesota Duluth <tpederse at d.umn.edu>

Copyright (C) 2011, Mugdha Choudhari, 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.

syntax highlighting: