Class LinearInterpolation
java.lang.Object
org.elasticsearch.search.suggest.phrase.SmoothingModel
org.elasticsearch.search.suggest.phrase.LinearInterpolation
- All Implemented Interfaces:
NamedWriteable
,VersionedNamedWriteable
,Writeable
,org.elasticsearch.xcontent.ToXContent
,org.elasticsearch.xcontent.ToXContentFragment
Linear interpolation smoothing model.
See N-Gram Smoothing for details.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.elasticsearch.xcontent.ToXContent
org.elasticsearch.xcontent.ToXContent.DelegatingMapParams, org.elasticsearch.xcontent.ToXContent.MapParams, org.elasticsearch.xcontent.ToXContent.Params
Nested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable
Writeable.Reader<V>, Writeable.Writer<V>
-
Field Summary
Fields inherited from interface org.elasticsearch.xcontent.ToXContent
EMPTY_PARAMS
-
Constructor Summary
ConstructorDescriptionLinearInterpolation
(double trigramLambda, double bigramLambda, double unigramLambda) Creates a linear interpolation smoothing model.Read from a stream. -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
doEquals
(SmoothingModel other) subtype specific implementation of "equals".protected int
static LinearInterpolation
fromXContent
(org.elasticsearch.xcontent.XContentParser parser) double
The minimal version of the recipient this object can be sent todouble
double
Returns the name of the writeable objectprotected org.elasticsearch.xcontent.XContentBuilder
innerToXContent
(org.elasticsearch.xcontent.XContentBuilder builder, org.elasticsearch.xcontent.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:
-
-
Constructor Details
-
LinearInterpolation
public LinearInterpolation(double trigramLambda, double bigramLambda, double unigramLambda) Creates a linear interpolation smoothing model. Note: the lambdas must sum up to one.- Parameters:
trigramLambda
- the trigram lambdabigramLambda
- the bigram lambdaunigramLambda
- the unigram lambda
-
LinearInterpolation
Read from a stream.- Throws:
IOException
-
-
Method Details
-
writeTo
Description copied from interface:Writeable
Write this into the StreamOutput.- Throws:
IOException
-
getTrigramLambda
public double getTrigramLambda() -
getBigramLambda
public double getBigramLambda() -
getUnigramLambda
public double getUnigramLambda() -
innerToXContent
protected org.elasticsearch.xcontent.XContentBuilder innerToXContent(org.elasticsearch.xcontent.XContentBuilder builder, org.elasticsearch.xcontent.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
public static LinearInterpolation fromXContent(org.elasticsearch.xcontent.XContentParser parser) throws IOException - 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
-