Link to home
Create AccountLog in
Avatar of onyourmark
onyourmark

asked on

perl module usage

Hello. I have downloaded a Java class:

weka.filters.unsupervised.attribute.StringToWordVector;
Description is here:
http://weka.sourceforge.net/doc.dev/index.html?weka/filters/unsupervised/attribute/StringToWordVector.html

from http://www.cs.waikato.ac.nz/~ml/weka/
(in fact I downloaded the entire weka program from there).

I am using Windows and the weka.jar file is located at
C:\Program Files\Weka-3-7
and my perl program is at
C:\Perl\bin



I want to use this in a perl program. I have seen references to 2 ways to do this.
One is here: http://search.cpan.org/~patl/Inline-Java-0.52/Java.pod
It provides a way to put the code inline. But I don't know where the code would be and also would there be dependency issues on other classes from weka?

The other is like this
#The Java library from perl lets you to easily integrate Java calls in Perl code.
#e.g.

use Java;
$java = new Java;
$obj = $java->create_object("com.my.Class","constructor parameter");
$obj->myMethod("method parameter");
$obj->setId(5);

If I did it this way, what would  "com.my.Class" be?
And if for example I wanted to use the options "-L" and "-S" how would I enter them as constructor parameters.
And finally, this class takes as input a csv file. Suppose that file is located at
C:\Perl\bin\myTestFile.csv
how would I indicate where it is in the code above?

THANK YOU.

ASKER CERTIFIED SOLUTION
Avatar of Adam314
Adam314

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account