Java bindings
Friday, 3 March 2017 · 5 messages · last reply 6 Mar 2017
M
meumapple3 Mar 2017 15:33 #
Hi,
I have a java parser (opennlp-tools-1.7.2.jar) whose main class is "opennlp.tools.cmdline.CLI"
At the command line I run it with opennlp POSTagger mymodel.bin (opennlp is a bash script running the abovementioned jar file). After that I am asked interactively for the text to parse.
Is it possible to invoke the command from XQuery via java bindings? I have put the opennlp jar files in the repo folder and I have tried "import module namespace m = "java.opennlp.tools.cmdline.CLI;" but the I get the "module not found error"
Thanks!
Joseph
CG
Christian Grün3 Mar 2017 15:55 #
Hi Joseph,
As a primer, I invite you to have a look at our Wiki page on Java bindings [1].
Cheers,
Christian
[1] http://docs.basex.org/wiki/Java_Bindings
Quoted text · meumapple · 11 lines
On Fri, Mar 3, 2017 at 3:33 PM, meumapple <meumapple at gmail.com> wrote: > Hi, > > I have a java parser (opennlp-tools-1.7.2.jar) whose main class is "opennlp.tools.cmdline.CLI" > > At the command line I run it with opennlp POSTagger mymodel.bin (opennlp is a bash script running the abovementioned jar file). After that I am asked interactively for the text to parse. > > Is it possible to invoke the command from XQuery via java bindings? I have put the opennlp jar files in the repo folder and I have tried "import module namespace m = "java.opennlp.tools.cmdline.CLI;" but the I get the "module not found error" > > Thanks! > Joseph
M
meumapple4 Mar 2017 18:14 #
Hi Christian,
I have read the page. My classes have a dot in their names, and I suspect this creates a conflict with the rewriting rules. Is that correct? Thanks.
Best,
Joseph
Quoted text · Christian Grün · 1 line
Il giorno 03 mar 2017, alle ore 15:55, Christian Grün <christian.gruen at gmail.com> ha scritto:
Hi Joseph,
As a primer, I invite you to have a look at our Wiki page on Java bindings [1].
Cheers,
Christian
[1] http://docs.basex.org/wiki/Java_Bindings
Quoted text · meumapple · 11 lines
> On Fri, Mar 3, 2017 at 3:33 PM, meumapple <meumapple at gmail.com> wrote: > Hi, > > I have a java parser (opennlp-tools-1.7.2.jar) whose main class is "opennlp.tools.cmdline.CLI" > > At the command line I run it with opennlp POSTagger mymodel.bin (opennlp is a bash script running the abovementioned jar file). After that I am asked interactively for the text to parse. > > Is it possible to invoke the command from XQuery via java bindings? I have put the opennlp jar files in the repo folder and I have tried "import module namespace m = "java.opennlp.tools.cmdline.CLI;" but the I get the "module not found error" > > Thanks! > Joseph
KK
Kristian Kankainen4 Mar 2017 19:35 #
The rewriting rules are not applied when prefixing the namespace with "java:". Perhaps there's a typo in you mail.
Perhaps try
import module namespace m = "java:opennlp.tools.cmdline.CLI";
Cheers
Kristian K
04.03.2017 19:14 meumapple kirjutas:
Quoted text · meumapple · 30 lines
> Hi Christian, > > I have read the page. My classes have a dot in their names, and I suspect this creates a conflict with the rewriting rules. Is that correct? Thanks. > > Best, > Joseph > > Il giorno 03 mar 2017, alle ore 15:55, Christian Grün <christian.gruen at gmail.com> ha scritto: > > Hi Joseph, > > As a primer, I invite you to have a look at our Wiki page on Java bindings [1]. > > Cheers, > Christian > > [1] http://docs.basex.org/wiki/Java_Bindings > > >> On Fri, Mar 3, 2017 at 3:33 PM, meumapple <meumapple at gmail.com> wrote: >> Hi, >> >> I have a java parser (opennlp-tools-1.7.2.jar) whose main class is "opennlp.tools.cmdline.CLI" >> >> At the command line I run it with opennlp POSTagger mymodel.bin (opennlp is a bash script running the abovementioned jar file). After that I am asked interactively for the text to parse. >> >> Is it possible to invoke the command from XQuery via java bindings? I have put the opennlp jar files in the repo folder and I have tried "import module namespace m = "java.opennlp.tools.cmdline.CLI;" but the I get the "module not found error" >> >> Thanks! >> Joseph
M
meumapple6 Mar 2017 10:07 #
Hi Kristian,
Thanks. I tried different combinations (with and without java:), but it does not work. I write the path contained in "Manifest", but it is not recognized by Basex. The software is Apache OpenNLP.
Quoted text · Kristian Kankainen · 1 line
Il giorno 04 mar 2017, alle ore 19:35, Kristian Kankainen <kristian at keeleleek.ee> ha scritto:
The rewriting rules are not applied when prefixing the namespace with "java:". Perhaps there's a typo in you mail.
Perhaps try
import module namespace m = "java:opennlp.tools.cmdline.CLI";
Cheers
Kristian K
04.03.2017 19:14 meumapple kirjutas:
Quoted text · Kristian Kankainen · 30 lines
> Hi Christian, > > I have read the page. My classes have a dot in their names, and I suspect this creates a conflict with the rewriting rules. Is that correct? Thanks. > > Best, > Joseph > > Il giorno 03 mar 2017, alle ore 15:55, Christian Grün <christian.gruen at gmail.com> ha scritto: > > Hi Joseph, > > As a primer, I invite you to have a look at our Wiki page on Java bindings [1]. > > Cheers, > Christian > > [1] http://docs.basex.org/wiki/Java_Bindings > > >> On Fri, Mar 3, 2017 at 3:33 PM, meumapple <meumapple at gmail.com> wrote: >> Hi, >> >> I have a java parser (opennlp-tools-1.7.2.jar) whose main class is "opennlp.tools.cmdline.CLI" >> >> At the command line I run it with opennlp POSTagger mymodel.bin (opennlp is a bash script running the abovementioned jar file). After that I am asked interactively for the text to parse. >> >> Is it possible to invoke the command from XQuery via java bindings? I have put the opennlp jar files in the repo folder and I have tried "import module namespace m = "java.opennlp.tools.cmdline.CLI;" but the I get the "module not found error" >> >> Thanks! >> Joseph
Written for BaseX 8.6. BaseX may have changed since: please check the current documentation.
⚡Generated with XQuery