Class SweetSpotSimilarity
A similarity with a lengthNorm that provides for a "plateau" of equally good lengths, and tf helper functions.
For lengthNorm, A min/max can be specified to define the plateau of lengths that should all have a norm of 1.0. Below the min, and above the max the lengthNorm drops off in a sqrt function.
For tf, baselineTf and hyperbolicTf functions are provided, which subclasses can choose between.
Inherited Members
Assembly: Lucene.Net.Misc.dll
Syntax
public class SweetSpotSimilarity : DefaultSimilarity
Constructors
Name | Description |
---|---|
SweetSpotSimilarity() |
Methods
Name | Description |
---|---|
BaselineTf(Single) | Implemented as:
...but with a special case check for 0. This degrates to when min and base are both 0
|
ComputeLengthNorm(Int32) | Implemented as: .
This degrades to when min and max are both 1 and
steepness is 0.5
:TODO: potential optimization is to just flat out return 1.0f if numTerms is between min and max. |
HyperbolicTf(Single) | Uses a hyperbolic tangent function that allows for a hard max...
This code is provided as a convenience for subclasses that want to use a hyperbolic tf function. |
LengthNorm(FieldInvertState) | Implemented as
|
SetBaselineTfFactors(Single, Single) | Sets the baseline and minimum function variables for baselineTf |
SetHyperbolicTfFactors(Single, Single, Double, Single) | Sets the function variables for the hyperbolicTf functions |
SetLengthNormFactors(Int32, Int32, Single, Boolean) | Sets the default function variables used by lengthNorm when no field specific variables have been set. |
Tf(Single) | Delegates to baselineTf |