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