[
https://issues.apache.org/jira/browse/CODEC-161?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13485148#comment-13485148
]
Gary Gregory commented on CODEC-161:
------------------------------------
Hello Colm,
Thank you for the patch. Welcome to our little [codec] world!
Please find my code review below.
# General note: Look at the code around you in [codec] and follow the
conventions you see.
# Rename the main class from {{MatchRatingApproach}} to
{{MatchRatingApproachEncoder}}
# All methods start with a lower case, so rename {{public static String
GetMRA(String name)}} to {{GetMRA}}, and so on.
# About @see hyperlink(s) in the Javadoc for {{MatchRatingApproachEncoder}}. If
Wikipedia is all there is, then so be it, but any other documentation would be
helpful.
# You can add yourself as a contributor in the pom.xml but I'd rather leave
names, emails (and egos) out of .java files.
# In the Javadocs, "soundex" should be "Soundex".
# Always use blocks. IOW: if (expr){\n stmt;\n}
# Rename all unit test methods to be prefixed with {{test}} instead of {{MRA_}}.
# The method {{RemoveDoubleConsonants}} (sic) looks like it could be
implemented in one loop. I'd worry about this one last.
# {{PLAIN_ASCII}} and {{UNICODE}} need Javadoc to explain how they are used.
# Rename {{MatchRatingApproachTests}} to {{MatchRatingApproachTest}} (singular)
or Maven will not pick it up in the test suite.
# Improve code coverage from 84% to... can you get it to 100%?
# In-line your test methods from:
{code:java}
@Test
public void MRA_Compare_ZACH_ZAKARIA_SuccessfullyMatched()
{
//Arrange
String testInput2 = "Zach";
String testInput1 = "Zakaria";
//Assert
boolean actualRes = MatchRatingApproach.CompareMRA(testInput1,
testInput2);
//Act
assertTrue(actualRes);
}
{code}
to:
{code:java}
@Test
public void MRA_Compare_ZACH_ZAKARIA_SuccessfullyMatched() {
assertTrue(MatchRatingApproach.CompareMRA("Zakaria", "Zach"));
}
{code}
> Add phonetic algorithm Match Rating Approach (MRA) to the commons codec
> -----------------------------------------------------------------------
>
> Key: CODEC-161
> URL: https://issues.apache.org/jira/browse/CODEC-161
> Project: Commons Codec
> Issue Type: New Feature
> Affects Versions: 1.6
> Reporter: Colm Rice
> Priority: Minor
> Labels: newbie
> Attachments: CODEC-161-MatchRatingApproach.patch
>
> Original Estimate: 168h
> Remaining Estimate: 168h
>
> I want to add MatchRatingApproach algorithm to the Lucene project via commons
> codec.
> What I have at the moment is a class called
> org.apache.lucene.analysis.phoenetic.MatchRatingApproach implementing
> StringEncoder
> I have a pretty comprehensive test file located at:
> org.apache.lucene.analysis.phonetic.MatchRatingApproachTests
> It's not exactly existing pattern so I'm going to need a bit of advice here.
> Thanks! Feel free to email.
> FYI: It my first contribution so be gentle :-) C# is my native.
> I had incorrectly added this to Lucene solution as LUCENE-4494 but received
> some good advice to move it to here. I'm doing that now.
> Reference: http://en.wikipedia.org/wiki/Match_rating_approach
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira