in reply to building similarity matrix

Telling us what error you get would be a good start. Providing a very small sample data set that demonstrates the error may help too.


Perl is environmentally friendly - it saves trees

Replies are listed 'Best First'.
Re^2: building similarity matrix
by Anonymous Monk on Feb 04, 2008 at 14:21 UTC

    dear friend, here is the error i get after running my codes like this: simmat.pl 1.txt 2.txt res
    Scalar found where operator expected at simmat.pl line 43, near ") $sim" (Missing operator before $sim?) Global symbol "@words" requires explicit package name at simmat.pl lin +e 36. Global symbol "@words" requires explicit package name at simmat.pl lin +e 40. Global symbol "@words" requires explicit package name at simmat.pl lin +e 41. Global symbol "@sim" requires explicit package name at simmat.pl line +42. Global symbol "@words" requires explicit package name at simmat.pl lin +e 42. Global symbol "@words" requires explicit package name at simmat.pl lin +e 42. syntax error at simmat.pl line 43, near ") $sim" Global symbol "@sim" requires explicit package name at simmat.pl line +43. Global symbol "@sim" requires explicit package name at simmat.pl line +43. Global symbol "@sim" requires explicit package name at simmat.pl line +57. Execution of simmat.pl aborted due to compilation errors.

    any idea where is the error from?
Re^2: building similarity matrix
by Anonymous Monk on Feb 04, 2008 at 14:37 UTC
    I could figure out errors of global variables but how to solve the erroe of "Scalar found where operator expected"? anyway to solve it? tx

      pc88mxer has provided the answer at Re: building similarity matrix.

      You could set $Measure by:

      my $Measure = "WordNet::Similarity::" . shift;

      then do as pc88mxer suggests and create the measure object once outside the loop.


      Perl is environmentally friendly - it saves trees