|
From: Sean <so...@or...> - 2011-01-01 05:41:26
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
<title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
Sure, Ted, here it is:<br>
<br>
#-------------------------------------------- CODE
----------------------------------------------<br>
my $str1 = "the dog bit Jim";<br>
my $str2 = "jim bit the dog ";<br>
my $laptool = "Text::Similarity::Overlaps";<br>
eval "require $laptool"; <br>
if ($@) {die "\nWARNING ! $tool not loaded ..\n\n";}<br>
#my %lapopts = ('normalise' => 0, 'verbose' => 1); #
'verbose' = ++lesk-score<br>
my %lapopts = ('normalise' => 1, 'verbose' => 1); #
'verbose' = ++lesk-score <br>
my $mod = $laptool->new(\%lapopts);<br>
unless (defined($mod)) {print "FAILED '$laptool'\n"; return 0;}<br>
$score = $mod->getSimilarityStrings ($str1, $str2);<br>
print "score= $score\n\n";<br>
#---------------------------------------END CODE
----------------------------------------------<br>
<br>
My guess is that self->verbose is not actually getting properly set
via the options?<br>
<br>
regards<br>
Sean<br>
<br>
<br>
Ted Pedersen wrote:
<blockquote
cite="mid:AAN...@ma..."
type="cite">
<pre wrap="">Hi Sean,
Thanks for your suggestions, let me take a look at those and see what
we might be able to do.
And I'm sorry you are having some troubles. Can you go ahead and post
whatever code you are running to get these results? That will make it
easier to recreate the output.
Cordially,
Ted
On Fri, Dec 31, 2010 at 7:33 PM, Sean <a class="moz-txt-link-rfc2396E" href="mailto:so...@or..."><so...@or...></a> wrote:
</pre>
<blockquote type="cite">
<pre wrap="">Hello Ted
I have installed v-0.08 and do not seem to get the results as documented.
In order to get the Lesk-score I have tried setting the options 2
different ways, both without luck.
1. ('normalise' => 0, 'verbose' => 1); # I expected this to work, not
wanting the Lesk normalised ...
2. ('normalise' => 1, 'verbose' => 1); # also tried this just in case ...
The COMPLETE screen-printed output from BOTH (using your doc example) is:
"keys: 3 -->'bit' len(1) cnt(1) -->'jim' len(1) cnt(1)
-->'the dog' len(2) cnt(1)"
This is using the getSimilarityStrings ($str1, $str2) function directly
from another script ..(getting a score of 4 returned there as expected).
While at it I may as well mention what tops my wish-list for v-0.09. I
would like to see additional simple wrapper functions like getLesk(),
getCosine() which would return just the single measure specified, and
getAll() which would return a hashref of 'named'-parameters to include
all provided measures, and which the other functions would be simple
wrappers around to pull out one or other from that comprehensive
getAll()-hashref?
This would avoid having to capture & parse output from stdout/stderr or
some other arbitrary output channel, although it would probably do no
harm to also "print" those measures. Since adding string (rather than
file) acceptance obviously came as an afterthought itself, this might be
the next logical extension to functionality. Looking at previous mailers
I thought I detected similar requests, though expressed somewhat
differently.
Keep up the good work in 2011.
Sean
------------------------------------------------------------------------------
Learn how Oracle Real Application Clusters (RAC) One Node allows customers
to consolidate database storage, standardize their database environment, and,
should the need arise, upgrade to a full multi-node Oracle RAC database
without downtime or disruption
<a class="moz-txt-link-freetext" href="http://p.sf.net/sfu/oracle-sfdevnl">http://p.sf.net/sfu/oracle-sfdevnl</a>
_______________________________________________
text-similarity-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:tex...@li...">tex...@li...</a>
<a class="moz-txt-link-freetext" href="https://lists.sourceforge.net/lists/listinfo/text-similarity-users">https://lists.sourceforge.net/lists/listinfo/text-similarity-users</a>
</pre>
</blockquote>
<pre wrap=""><!---->
</pre>
</blockquote>
</body>
</html>
|