Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Lucene: General

Lucene making reference to a .jar -- How do I this code?

 

 

Lucene general RSS feed   Index | Next | Previous | View Threaded


colm_rice at hotmail

Aug 16, 2012, 3:58 AM

Post #1 of 6 (465 views)
Permalink
Lucene making reference to a .jar -- How do I this code?

Hi,

I have the Lucene source code successfully building inside Eclipse (using
ant & ivy). I wish to make a contribution to the lucene project and using
the principle of "follow the existing pattern" I need to put the source code
into the "commons-codec-1.6.jar" area.
Now obviously, this is not possible so I need to get the source code for
this component. My first question is where do I get this?

My second question after I have added the source code ie the .java file
contain the new functionality do I do a Source Attachment Configuration and
point it to the location of this java file from the main lucene project?

Should I create another project next to the lucene project called something
like: "commons-codec" or something like that.

Can anyone recommend the best practise as to what to do when I need to add
something to Lucene that is inside another jar? Would appreciate a little
handholding on this one as I'm still a bit of a newbie.

Thanks a mill,
jellyman



--
View this message in context: http://lucene.472066.n3.nabble.com/Lucene-making-reference-to-a-jar-How-do-I-this-code-tp4001597.html
Sent from the Lucene - General mailing list archive at Nabble.com.


ted.dunning at gmail

Aug 16, 2012, 7:41 AM

Post #2 of 6 (436 views)
Permalink
Re: Lucene making reference to a .jar -- How do I this code? [In reply to]

Maybe you want to look this project?

http://commons.apache.org/codec/

But do you really need to change commons codec? You don't really describe
what you are doing and changing a pre-built package is a very rare
requirement for working with Lucene. Can you describe what you want to do
more specifically?

Also, you will generally have better results if you subscribe directly to
the mailing list rather than use a proxy interface like nabble.

On Thu, Aug 16, 2012 at 3:58 AM, jellyman <colm_rice [at] hotmail> wrote:

> Hi,
>
> I have the Lucene source code successfully building inside Eclipse
> (using
> ant & ivy). I wish to make a contribution to the lucene project and using
> the principle of "follow the existing pattern" I need to put the source
> code
> into the "commons-codec-1.6.jar" area.
> Now obviously, this is not possible so I need to get the source
> code for
> this component. My first question is where do I get this?
>
> My second question after I have added the source code ie the .java
> file
> contain the new functionality do I do a Source Attachment Configuration and
> point it to the location of this java file from the main lucene project?
>
> Should I create another project next to the lucene project called
> something
> like: "commons-codec" or something like that.
>
> Can anyone recommend the best practise as to what to do when I
> need to add
> something to Lucene that is inside another jar? Would appreciate a little
> handholding on this one as I'm still a bit of a newbie.
>
> Thanks a mill,
> jellyman
>
>
>
> --
> View this message in context:
> http://lucene.472066.n3.nabble.com/Lucene-making-reference-to-a-jar-How-do-I-this-code-tp4001597.html
> Sent from the Lucene - General mailing list archive at Nabble.com.
>


colm_rice at hotmail

Aug 16, 2012, 7:56 AM

Post #3 of 6 (430 views)
Permalink
Re: Lucene making reference to a .jar -- How do I this code? [In reply to]

Hi Ted,


Thanks for the URL. To answer your question: I'm adding another phoenetic
algorithm to the org.apache.commons.codec.language package (as the rest of
them live there) and then hardwire it into the
lucene/analysis/phoenetic/src/java path like the existing phoenetic filters
that exist there already. Following existing pattern essentially.
I'm assuming that you have to edit this pre-built package or am I missing
something? I think that I am...

Any advice/guidance much appreciated,
jellyman.




--
View this message in context: http://lucene.472066.n3.nabble.com/Lucene-making-reference-to-a-jar-How-do-I-this-code-tp4001597p4001637.html
Sent from the Lucene - General mailing list archive at Nabble.com.


rcmuir at gmail

Aug 16, 2012, 11:55 AM

Post #4 of 6 (435 views)
Permalink
Re: Lucene making reference to a .jar -- How do I this code? [In reply to]

On Thu, Aug 16, 2012 at 10:56 AM, jellyman <colm_rice [at] hotmail> wrote:
> Hi Ted,
>
>
> Thanks for the URL. To answer your question: I'm adding another phoenetic
> algorithm to the org.apache.commons.codec.language package (as the rest of
> them live there) and then hardwire it into the
> lucene/analysis/phoenetic/src/java path like the existing phoenetic filters
> that exist there already. Following existing pattern essentially.
> I'm assuming that you have to edit this pre-built package or am I missing
> something? I think that I am...
>

You don't need to actually modify commons-codec to do that, you can
just write your own phonetic encoder, extending
org.apache.commons.codec.Encoder, and pass that to PhoneticFilter.

--
lucidworks.com


colm_rice at hotmail

Aug 17, 2012, 3:55 AM

Post #5 of 6 (433 views)
Permalink
Re: Lucene making reference to a .jar -- How do I this code? [In reply to]

Ted,

Thanks a million, that's great. Just what I needed a bit of guidance.
I'm going to ask a silly question now but lets say I have a new java class
called "NewPhoenetic.java" that as you indicated entends
org.apache.commons.codec.Encoder, my question is where should I put this
file? - would it be into the
lucene/analysis/phoenetic/src/java fiolder beside all the other phoenetic
filter classes?

Thanks,
jellyman



--
View this message in context: http://lucene.472066.n3.nabble.com/Lucene-making-reference-to-a-jar-How-do-I-this-code-tp4001597p4001814.html
Sent from the Lucene - General mailing list archive at Nabble.com.


colm_rice at hotmail

Aug 17, 2012, 8:22 AM

Post #6 of 6 (435 views)
Permalink
Re: Lucene making reference to a .jar -- How do I this code? [In reply to]

Hi Ted,

I cannot extend this interface so I guess to you have to use "implements". I
do something like:


public class NewPhoeneticAlgo implements org.apache.commons.codec.Encoder
{

public static String GetPhoneticCode(String name)
{
//...etc...

}

@Override
public Object encode(Object arg0) throws EncoderException {
return null;

}

That's about as far as I get. I need some guidance here as to how to do
this properly and then pass it to PhoneticFilter and call the unit tests
properly from inside lucene/analysis/phonetic/src/test

Any assistance much appreciated,
jellyman.



--
View this message in context: http://lucene.472066.n3.nabble.com/Lucene-making-reference-to-a-jar-How-do-I-this-code-tp4001597p4001860.html
Sent from the Lucene - General mailing list archive at Nabble.com.

Lucene general RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.