AutoDetectParser not picking up custom parser

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

AutoDetectParser not picking up custom parser

122jxgcn
This post was updated on .
CONTENTS DELETED
The author has deleted this message.
Reply | Threaded
Open this post in threaded view
|

Re: AutoDetectParser not picking up custom parser

Nick Burch-2
On Mon, 6 Aug 2012, 122jxgcn wrote:
> In order to AutoDetectParser to pick up my parser, I followed the
> instructions listed in
> http://tika.apache.org/1.1/parser_guide.html#List_the_new_parser 
> However, AutoDetectParser is not picking up my parser when I do Parser
> parser = new AutoDetectParser(); inside the ParserTest

Did you make sure both your parser and the service file are on the
classpath? If you miss one or both then your new parser won't be loaded

Nick
Reply | Threaded
Open this post in threaded view
|

Re: AutoDetectParser not picking up custom parser

122jxgcn
Nick Burch-2 wrote
On Mon, 6 Aug 2012, 122jxgcn wrote:
> In order to AutoDetectParser to pick up my parser, I followed the
> instructions listed in
> http://tika.apache.org/1.1/parser_guide.html#List_the_new_parser 
> However, AutoDetectParser is not picking up my parser when I do Parser
> parser = new AutoDetectParser(); inside the ParserTest

Did you make sure both your parser and the service file are on the
classpath? If you miss one or both then your new parser won't be loaded

Nick
I'm sorry but can you be more specific?
I'm not sure what do you mean by service file.
Also, my custom parser is not a jar, it's just a java file like every other default parsers,
so I'm not sure what do you mean by adding parser and the service file to the classpath.
Reply | Threaded
Open this post in threaded view
|

Re: AutoDetectParser not picking up custom parser

Nick Burch-2
On Mon, 6 Aug 2012, 122jxgcn wrote:
>> Did you make sure both your parser and the service file are on the
>> classpath? If you miss one or both then your new parser won't be loaded
>
> I'm sorry but can you be more specific?
> I'm not sure what do you mean by service file.

The step is described here:
    http://tika.apache.org/1.2/parser_guide.html#List_the_new_parser

You basically need to create a file with a specific name, and put the
class name of your parser in it. Tika loads all the instances of files
with that name on the classpath, and processes them to get the parsers to
load.

> Also, my custom parser is not a jar, it's just a java file like every
> other default parsers, so I'm not sure what do you mean by adding parser
> and the service file to the classpath.

If it's not on the classpath, then Java can't find it to use it!

Nick