[ 
https://issues.apache.org/jira/browse/CODEC-161?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13560781#comment-13560781
 ] 

Sebb commented on CODEC-161:
----------------------------

It's boolean logic: DeMorgan's theorem [1][2]

Can be useful when trying to simplify (or complicate!) compound boolean 
conditions.

I suppose you could change the code, changing the original equivalent into a 
comment.
I'd also document that the condition was changed to satisfy Cobertura.

For example:

{noformat}
// The following condition is not handled correctly by Cobertura 
// (it does not realise both conditions cannot be false)            
//        } else if (sumLength >= FIVE && sumLength <= SEVEN) {
// So we use the equivalent by DeMorgan's theorem:
        } else if (!(sumLength < FIVE || sumLength > SEVEN)) {
{noformat}

Similarly for the next condition.

[1] http://en.wikipedia.org/wiki/De_Morgan%27s_laws
[2] http://hyperphysics.phy-astr.gsu.edu/hbase/electronic/demorgan.html
                
> Add Match Rating Approach (MRA) phonetic algorithm encoder
> ----------------------------------------------------------
>
>                 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
>             Fix For: 1.8
>
>         Attachments: CODEC-161-18Jan2013.patch, 
> CODEC-161-MatchRatingApproach.patch, CODEC-161.patch, CODEC-161.patch, 
> CODEC-161.patch, CODEC-161.patch, CODEC-161.patch, 
> Code_Coverage_EclEmma_MRA_TargetAlgo_03Dec2012.jpg, CODED-161.patch, 
> MRA_Cobertura_CodeCoverage_18Jan2013.jpg, 
> MRA_Cobertura_ScreenShot_01Jan2013.jpg, MRA_eCobertura_Output.jpg
>
>   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

Reply via email to