in reply to Re^2: Use of uninitialized value $cui1 in print
in thread Use of uninitialized value $cui1 in print
# UMLS::Similarity::lch.pm # # Module implementing the semantic relatedness measure described # by Leacock and Chodorow (1998). # <code> sub getRelatedness { my $self = shift; return undef if(!defined $self || !ref $self); my $concept1 = shift; my $concept2 = shift; # get the interfaceg my $interface = $self->{'interface'}; # find the length of the shortest path # if concept 1 and 2 are the same just return 1 my $length = 0; if($concept1 eq $concept2) { $length = 1; } else { $length = $interface->findShortestPathLength($concept1, $co +ncept2); } # get the depth of the taxonomy my $depth = $interface->depth(); # if the length of hte path is less than zero return -1 if($length < 0) { return -1; } # calculate lch my $score = -1 * log ($length / (2 * $depth)); return $score; } =
this subroutine in code is by default present in umls::similarity package. Where our $t1 is passes as $concept1 and $t2 is passed as $concept 2.So I dont think there is anything wrong in this code.What am I thinking is maybe $t1 is not able to get value as string the way it should be.Well I am beginner so I dont have much knowledge so plz help me
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Use of uninitialized value $cui1 in print
by AnomalousMonk (Archbishop) on Mar 03, 2017 at 05:12 UTC |