tema16 / tt4j

Automatically exported from code.google.com/p/tt4j
0 stars 0 forks source link

Adding argument "-lex <f>" raises an exception #12

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.Initialise as follow : 
private final String MODEL_EN =  "english.par";
private final String[] TT_ARGS = { "-quiet", "-no-unknown",
        "-sgml", "-token", "-lemma", "-lex /opt/treetagger/lib/english-lexicon.txt" };
        TreeTaggerWrapper<Unit> tt = new TreeTaggerWrapper<Unit>();
        tt.setArguments(TT_ARGS);
        tt.setModel(MODEL_EN);
        tt.process(input); // input is "This is a test.", tokenized

What is the expected output? What do you see instead?
I expect it to work, but I get an exception :

12/01/20 11:54:53 ERROR treetagger.AnnoLabTreeTagger: TreeTaggerException raised
org.annolab.tt4j.TreeTaggerException: java.io.IOException: The TreeTagger 
process has died:
TreeTagger process: still running.
Last token sent (#0): none
Last tokens read: []
Last record read (#0): none
Tokens originally recieved: 4
Tokens written            : 0
Tokens read               : 0

Make sure the following comand (in parentheses) works when running it from the 
command line: [echo "test" | /opt/treetagger/bin/tree-tagger -quiet -no-unknown 
-sgml -token -lemma -lex /opt/treetagger/lib/english-lexicon.txt 
/opt/treetagger/models/english.par]
    at org.annolab.tt4j.TreeTaggerWrapper.checkThreads(TreeTaggerWrapper.java:590)
    at org.annolab.tt4j.TreeTaggerWrapper.process(TreeTaggerWrapper.java:561)
    at ...
Caused by: java.io.IOException: The TreeTagger process has died:
TreeTagger process: still running.
Last token sent (#0): none
Last tokens read: []
Last record read (#0): none
Tokens originally recieved: 4
Tokens written            : 0
Tokens read               : 0

Make sure the following comand (in parentheses) works when running it from the 
command line: [echo "test" | /opt/treetagger/bin/tree-tagger -quiet -no-unknown 
-sgml -token -lemma -lex /opt/treetagger/lib/english-lexicon.txt 
/opt/treetagger/models/english.par]
    at org.annolab.tt4j.TreeTaggerWrapper$Reader.run(TreeTaggerWrapper.java:863)
    at java.lang.Thread.run(Thread.java:662)

What version of the product are you using? On what operating system?
Version 1.0.16 on linux

Please provide any additional information below.

The command works fine on the command line:
echo "test" | /opt/treetagger/bin/tree-tagger -quiet -no-unknown -sgml -token 
-lemma -lex /opt/treetagger/lib/english-lexicon.txt 
/opt/treetagger/models/english.par
test    NN  test

And the same test works fine without the added argument "-lex 
/opt/treetagger/lib/english-lexicon.txt"

Is the option "-lex" supposed to work ?

Thank you for your feedback.

Original issue reported on code.google.com by alain.bo...@gmail.com on 20 Jan 2012 at 11:00

GoogleCodeExporter commented 9 years ago
I have never tried the -lex option. I think your problem might be that "-lex" 
and "/opt/treetagger/lib/english-lexicon.txt" must be separate in the TT_ARGS 
list.

Original comment by richard.eckart on 20 Jan 2012 at 12:03

GoogleCodeExporter commented 9 years ago
Thank you for your quick reply.
Saparating the "-lex" and the file name in the args list indeed fixed the 
problem.

False alarm then !
You can close the bug.

Thanks again.

Original comment by alain.bo...@gmail.com on 20 Jan 2012 at 12:38

GoogleCodeExporter commented 9 years ago

Original comment by richard.eckart on 20 Jan 2012 at 12:40