java.lang.Object
org.elasticsearch.search.suggest.phrase.SmoothingModel
org.elasticsearch.search.suggest.phrase.Laplace
- All Implemented Interfaces:
NamedWriteable
,VersionedNamedWriteable
,Writeable
,ToXContent
,ToXContentFragment
An additive
smoothing model.
See N-Gram Smoothing for details.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.elasticsearch.xcontent.ToXContent
ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.Params
Nested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable
Writeable.Reader<V>, Writeable.Writer<V>
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final double
Default alpha parameter for laplace smoothingstatic final String
Fields inherited from interface org.elasticsearch.xcontent.ToXContent
EMPTY, EMPTY_PARAMS
-
Constructor Summary
ConstructorsConstructorDescriptionLaplace
(double alpha) Creates a Laplace smoothing model.Laplace
(StreamInput in) Read from a stream. -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
doEquals
(SmoothingModel other) subtype specific implementation of "equals".protected int
static SmoothingModel
fromXContent
(XContentParser parser) double
getAlpha()
The minimal version of the recipient this object can be sent toReturns the name of the writeable objectprotected XContentBuilder
innerToXContent
(XContentBuilder builder, ToXContent.Params params) void
writeTo
(StreamOutput out) Write this into the StreamOutput.Methods inherited from class org.elasticsearch.search.suggest.phrase.SmoothingModel
equals, hashCode, toXContent
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.elasticsearch.xcontent.ToXContentFragment
isFragment
-
Field Details
-
NAME
- See Also:
-
DEFAULT_LAPLACE_ALPHA
public static final double DEFAULT_LAPLACE_ALPHADefault alpha parameter for laplace smoothing- See Also:
-
-
Constructor Details
-
Laplace
public Laplace(double alpha) Creates a Laplace smoothing model. -
Laplace
Read from a stream.- Throws:
IOException
-
-
Method Details
-
writeTo
Description copied from interface:Writeable
Write this into the StreamOutput.- Throws:
IOException
-
getAlpha
public double getAlpha()- Returns:
- the laplace model alpha parameter
-
innerToXContent
protected XContentBuilder innerToXContent(XContentBuilder builder, ToXContent.Params params) throws IOException - Specified by:
innerToXContent
in classSmoothingModel
- Throws:
IOException
-
getWriteableName
Description copied from interface:VersionedNamedWriteable
Returns the name of the writeable object -
doEquals
Description copied from class:SmoothingModel
subtype specific implementation of "equals".- Specified by:
doEquals
in classSmoothingModel
-
doHashCode
protected int doHashCode()- Specified by:
doHashCode
in classSmoothingModel
-
fromXContent
- Throws:
IOException
-
buildWordScorerFactory
- Specified by:
buildWordScorerFactory
in classSmoothingModel
-
getMinimalSupportedVersion
Description copied from interface:VersionedNamedWriteable
The minimal version of the recipient this object can be sent to
-