nikcio opened a new pull request, #693:
URL: https://github.com/apache/lucenenet/pull/693

   Following #690 I've now added suppression attributes to the methods we 
decided not to make static.
   
   Adds to #663 
   
   I also had another look at [This 
issue](https://sonarcloud.io/project/issues?issues=AYPAuN5xhbfJOGLOoaDV&open=AYPAuN5xhbfJOGLOoaDV&id=nikcio_lucenenet)
 and found that the reason this caused problems is because I forgot to change 
the `this.` to `BasicModelBE.` in the `Score` method. But I don't know if this 
is moving too far away from the original code?
   
   The change would be:
   
   ```csharp
   public override sealed float Score(BasicStats stats, float tfn)
   {
       double F = stats.TotalTermFreq + 1 + tfn;
       // approximation only holds true when F << N, so we use N += F
       double N = F + stats.NumberOfDocuments;
       return (float)(-SimilarityBase.Log2((N - 1) * Math.E) + BasicModelBE.F(N 
+ F - 1, N + F - tfn - 2) - BasicModelBE.F(F, F - tfn));
   }
   /// <summary>
   /// The <em>f</em> helper function defined for <em>B<sub>E</sub></em>. 
</summary>
   private static double F(double n, double m) // LUCENENET: CA1822: Mark 
members as static
   {
       return (m + 0.5) * SimilarityBase.Log2(n / m) + (n - m) * 
SimilarityBase.Log2(n);
   }
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to