Class Laplace
java.lang.Object
org.elasticsearch.search.suggest.phrase.SmoothingModel
org.elasticsearch.search.suggest.phrase.Laplace
- All Implemented Interfaces:
NamedWriteable,Writeable,ToXContent,ToXContentFragment
public final class Laplace extends SmoothingModel
An additive
smoothing model.
See N-Gram Smoothing for details.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.elasticsearch.common.xcontent.ToXContent
ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.ParamsNested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable
Writeable.Reader<V>, Writeable.Writer<V> -
Field Summary
Fields Modifier and Type Field Description static doubleDEFAULT_LAPLACE_ALPHADefault alpha parameter for laplace smoothingstatic java.lang.StringNAME -
Constructor Summary
Constructors Constructor Description Laplace(double alpha)Creates a Laplace smoothing model.Laplace(StreamInput in)Read from a stream. -
Method Summary
Modifier and Type Method Description WordScorer.WordScorerFactorybuildWordScorerFactory()protected booleandoEquals(SmoothingModel other)subtype specific implementation of "equals".protected intdoHashCode()static SmoothingModelfromXContent(XContentParser parser)doublegetAlpha()java.lang.StringgetWriteableName()Returns the name of the writeable objectprotected XContentBuilderinnerToXContent(XContentBuilder builder, ToXContent.Params params)voidwriteTo(StreamOutput out)Write this into the StreamOutput.Methods inherited from class org.elasticsearch.search.suggest.phrase.SmoothingModel
equals, hashCode, toXContent
-
Field Details
-
NAME
public static final java.lang.String NAME- See Also:
- Constant Field Values
-
DEFAULT_LAPLACE_ALPHA
public static final double DEFAULT_LAPLACE_ALPHADefault alpha parameter for laplace smoothing- See Also:
- Constant Field Values
-
-
Constructor Details
-
Method Details
-
writeTo
Description copied from interface:WriteableWrite this into the StreamOutput.- Throws:
java.io.IOException
-
getAlpha
public double getAlpha()- Returns:
- the laplace model alpha parameter
-
innerToXContent
protected XContentBuilder innerToXContent(XContentBuilder builder, ToXContent.Params params) throws java.io.IOException- Specified by:
innerToXContentin classSmoothingModel- Throws:
java.io.IOException
-
getWriteableName
public java.lang.String getWriteableName()Description copied from interface:NamedWriteableReturns the name of the writeable object -
doEquals
Description copied from class:SmoothingModelsubtype specific implementation of "equals".- Specified by:
doEqualsin classSmoothingModel
-
doHashCode
protected int doHashCode()- Specified by:
doHashCodein classSmoothingModel
-
fromXContent
- Throws:
java.io.IOException
-
buildWordScorerFactory
- Specified by:
buildWordScorerFactoryin classSmoothingModel
-