Subject: | perlindex-1.605 Can't take log of -612.333 at /usr/local/bin/perlindex line 361 |
When attempting to run perlindex 1.605, I was getting the following
error message:
2011-09-05 19:44:04 dpchrist@p43400e ~
$ perlindex dpchrist
Can't take log of -612.333 at /usr/local/bin/perlindex line 361.
I haven't studied the program to find the root cause, but this hack
works around the error:
2011-09-05 19:55:57 root@p43400e ~/build
# diff -r perlindex-1.605 perlindex-1.605-dpc
diff -r perlindex-1.605/perlindex.PL perlindex-1.605-dpc/perlindex.PL
428c428,430
< my $idf = log($FN{'last'}/$IDF{$word});
---
Show quoted text
> # my $idf = log($FN{'last'}/$IDF{$word});
> my $qqqq = $FN{'last'}/$IDF{$word};
> my $idf = 0 < $qqqq ? log($qqqq) : 0;
HTH,
David