reckart / tt4j

TreeTagger for Java
http://reckart.github.io/tt4j/
Apache License 2.0
16 stars 7 forks source link

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

Closed reckart closed 9 years ago

reckart commented 9 years ago

Original issue 12 created by reckart on 2012-01-20T11:00:38.000Z:

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.

reckart commented 9 years ago

Comment #1 originally posted by reckart on 2012-01-20T12:03:26.000Z:

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.

reckart commented 9 years ago

Comment #2 originally posted by reckart on 2012-01-20T12:38:34.000Z:

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.

reckart commented 9 years ago

Comment #3 originally posted by reckart on 2012-01-20T12:40:25.000Z:

<empty>