Use linkgrammar in my application

44 views
Skip to first unread message

marwa

unread,
Apr 27, 2014, 11:50:22 AM4/27/14
to link-g...@googlegroups.com
hello,
I want to use the linkgrammar in my application.
first of all I downloaded the link41b i have tested the .exe and it work very good so,to test this one from eclipse i have writen this code

public static void main(String[] args) {
// TODO Auto-generated method stub

Process child;
String line;
try {
String command="C:\\Users\\ME\\Desktop\\link41b\\link41b\\link41b.exe";
child = Runtime.getRuntime().exec(command);
child.waitFor();
System.out.println(child.exitValue());
BufferedReader input =new BufferedReader(new InputStreamReader(child.getInputStream()));
    while((line = input.readLine()) != null)
    {System.out.println(line); }
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}

}
}
but the result of child.exitvalue() is -1 ,it does mean that  the Process  doesn't work .
I decided to test this one from the cmd soIhave written    cd  C:\Users\ME\Desktop\link41b\link41b\link41b.exe 

this is the output of the cmd .
I didn't undrestand what does it mean command because I have writte linkparser it didn't work.....

then i have decided to search for an Api to  use it directly in my java application : I have downloaded link-grammar-5.0.6 
but it does'nt contain the .jar it contain a java buildings(classes) the Readme file are so dfficult to undrestand .
Really I'm so upset , i have searched for 2 weeks and there is  nothing to help me .
I just want request for my question from a person who have already work with the linkGrammar in java .
Please i nedd your help.


Linas Vepstas

unread,
Apr 28, 2014, 6:34:43 PM4/28/14
to link-grammar
Hi Nedra,

link-grammar 4.1b is more than 10 years old, and is no longer supported. 

To obtain a jar file for link-grammar, you have to actually build the java code. By default, apache ant is used, but some people have also used eclipse.

The link-grammar jar file requires the link-grammar library.  To build that on windows, you need to use either the mingw environment, or MSVC .

If you know Linux at all, you should use Linux. It is much easier to use than Windows.  Ubuntu and Debian come with an older version of link-grammar pre-complied. 

--linas

p.s. Is this a homework assignment for some class?  You are the third person in one week who has asked these kinds of questions.  You should probably talk to the other people in your class about how to do this stuff.



--
You received this message because you are subscribed to the Google Groups "link-grammar" group.
To unsubscribe from this group and stop receiving emails from it, send an email to link-grammar...@googlegroups.com.
To post to this group, send email to link-g...@googlegroups.com.
Visit this group at http://groups.google.com/group/link-grammar.
For more options, visit https://groups.google.com/d/optout.

David Hart

unread,
Apr 28, 2014, 8:57:15 PM4/28/14
to link-g...@googlegroups.com
Hi Nedra,

The crude RelEx installer script is instructive for building all of linkgrammar, and/or for making necessary adaptations for Cygwin and other Linux/Unixes. 


On 27 Apr 2014, at 11:50 pm, marwa <nedra1...@gmail.com> wrote:

hello,
I want to use the linkgrammar in my application.
first of all I downloaded the link41b i have tested the .exe and it work very good so,to test this one from eclipse i have writen this code
public static void main(String[] args) {
// TODO Auto-generated method stub

Process child;
String line;
try {
String command="C:\\Users\\ME\\Desktop\\link41b\\link41b\\link41b.exe";
child = Runtime.getRuntime().exec(comman
child.waitFor();
System.out.println(child.exitValue());
BufferedReader input =new BufferedReader(new InputStreamReader(child.getInputStream()));
    while((line = input.readLine()) != null)
    {System.out.println(line); }
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}

}
}
but the result of child.exitvalue() is -1 ,it does mean that  the Process  doesn't work .
I decided to test this one from the cmd soIhave written    cd  C:\Users\ME\Desktop\link41b\link41b\link41b.exe 

this is the output of the cmd .
I didn't undrestand what does it mean command because I have writte linkparser it didn't work.....

then i have decided to search for an Api to  use it directly in my java application : I have downloaded link-grammar-5.0.6 
but it does'nt contain the .jar it contain a java buildings(classes) the Readme file are so dfficult to undrestand .
Really I'm so upset , i have searched for 2 weeks and there is  nothing to help me .
I just want request for my question from a person who have already work with the linkGrammar in java .
Please i nedd your help.


Reply all
Reply to author
Forward
0 new messages