# 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


In reply to Re^3: Use of uninitialized value $cui1 in print by Raksha Jalan
in thread Use of uninitialized value $cui1 in print by Raksha Jalan

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.