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

Mailing List Archive: Lucene: General

Making a contribution to Lucene - please help

 

 

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


catherine_tate70 at hotmail

Aug 21, 2012, 7:09 AM

Post #1 of 2 (188 views)
Permalink
Making a contribution to Lucene - please help

Hi,
I'm trying to add a phonetic algorithm to the Apache Lucene project. I have the algorithm ready-to-go plus tests. All that remains is "hard-wiring" it into the project itself (which I'm finding difficult). I need some help here (a little hand holding)
I initially thought that I had to put it into the commons-codec sub-project but I was corrected and told to put the algorithm into the lucene/analysis/phoenetic/src/java area and implement org.apache.commons.codec.Encoder
I'm a little worried by this as all I see are filters here and I'm trying to follow existing pattern before I upload the patch.
Anyway, what I have at the moment is something like this sketch:
public class NewPhoenetic implements org.apache.commons.codec.Encoder{public static String GetMRA(String name){ //blah blah - gets the encoding
}
public static boolean ComparePhoeneticEncoding(String name1, string name2){ //compare 2 encoded names to see if they match //etc...
}

@Overridepublic Object encode(Object arg0) throws EncoderException {//return null;if(arg0 == null)return null;return MatchRatingApproach.GetPhoeneticEncoding(arg0.toString());}
}

My question are: 1. Am I going in the right direction, any suggestions, improvements, things to watch out for? The second question is how do I integrate the unit tests that I have. I see that may are located in: lucene/analysis/phoenetic/src/test but I don't understand the pattern.
I would appreciate if you could code some small code-samples/patterns along with any explanations - I'm still pretty new to Java so what may be simple to you may not be so obvious to me.
Thanks for any help in advance,Catherine


sarowe at syr

Aug 21, 2012, 12:41 PM

Post #2 of 2 (172 views)
Permalink
RE: Making a contribution to Lucene - please help [In reply to]

Hi Catherine,

Welcome!

I assume you are the same person as "jellyman" who posted earlier in this mailing list about exactly this same topic? If so, FYI, someone posting under multiple identities can be a predictor for various forms of mailing list nastiness, so you might want to pick one identity and stick with it here.

FYI, you're posting to the wrong mailing list. general [at] lucene is not monitored by many people, and is intended for use in discussing top-level Lucene or cross-sub-project issues. You should instead be on dev [at] lucene, which is devoted to *development* of Lucene and Solr. I'm sending this to both lists, but you should respond only on dev [at] lucene For future reference, discussions of *usage* of Lucene goes to java-user [at] lucene More details here: <http://lucene.apache.org/core/discussion.html>.

Some of your tests should go into lucene/analysis/phonetic/src/test/org/apache/lucene/analysis/phonetic/TestPhoneticFilter.java - you should add your algorithm to each of the three test*() methods in that class.

As soon as possible, you should create a JIRA issue and upload your patch - it's much easier to provide guidance against a concrete implementation. In case you haven't seen it, some of the mechanics of this process are described here: <http://wiki.apache.org/lucene-java/HowToContribute>.

Happy coding!

Steve

-----Original Message-----
From: Catherine Tate [mailto:catherine_tate70 [at] hotmail]
Sent: Tuesday, August 21, 2012 10:09 AM
To: general [at] lucene
Subject: Making a contribution to Lucene - please help


Hi,
I'm trying to add a phonetic algorithm to the Apache Lucene project. I have the algorithm ready-to-go plus tests. All that remains is "hard-wiring" it into the project itself (which I'm finding difficult). I need some help here (a little hand holding)
I initially thought that I had to put it into the commons-codec sub-project but I was corrected and told to put the algorithm into the lucene/analysis/phoenetic/src/java area and implement org.apache.commons.codec.Encoder
I'm a little worried by this as all I see are filters here and I'm trying to follow existing pattern before I upload the patch.
Anyway, what I have at the moment is something like this sketch:
public class NewPhoenetic implements org.apache.commons.codec.Encoder{public static String GetMRA(String name){ //blah blah - gets the encoding
}
public static boolean ComparePhoeneticEncoding(String name1, string name2){ //compare 2 encoded names to see if they match //etc...
}

@Overridepublic Object encode(Object arg0) throws EncoderException {//return null;if(arg0 == null)return null;return MatchRatingApproach.GetPhoeneticEncoding(arg0.toString());}
}

My question are: 1. Am I going in the right direction, any suggestions, improvements, things to watch out for? The second question is how do I integrate the unit tests that I have. I see that may are located in: lucene/analysis/phoenetic/src/test but I don't understand the pattern.
I would appreciate if you could code some small code-samples/patterns along with any explanations - I'm still pretty new to Java so what may be simple to you may not be so obvious to me.
Thanks for any help in advance,Catherine

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.