Module org.elasticsearch.server
Class LinearInterpolation
java.lang.Object
org.elasticsearch.search.suggest.phrase.SmoothingModel
org.elasticsearch.search.suggest.phrase.LinearInterpolation
- All Implemented Interfaces:
NamedWriteable,VersionedNamedWriteable,Writeable,ToXContent,ToXContentFragment
Linear interpolation 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.ParamsNested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable
Writeable.Reader<V>, Writeable.Writer<V> -
Field Summary
FieldsFields inherited from interface org.elasticsearch.xcontent.ToXContent
EMPTY, EMPTY_PARAMS -
Constructor Summary
ConstructorsConstructorDescriptionLinearInterpolation(double trigramLambda, double bigramLambda, double unigramLambda) Creates a linear interpolation smoothing model.Read from a stream. -
Method Summary
Modifier and TypeMethodDescriptionprotected booleandoEquals(SmoothingModel other) subtype specific implementation of "equals".protected intstatic LinearInterpolationfromXContent(XContentParser parser) doubleThe minimal version of the recipient this object can be sent todoubledoubleReturns 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, toXContentMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods 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:WriteableWrite this into the StreamOutput.- Throws:
IOException
-
getTrigramLambda
public double getTrigramLambda() -
getBigramLambda
public double getBigramLambda() -
getUnigramLambda
public double getUnigramLambda() -
innerToXContent
protected XContentBuilder innerToXContent(XContentBuilder builder, ToXContent.Params params) throws IOException - Specified by:
innerToXContentin classSmoothingModel- Throws:
IOException
-
getWriteableName
Description copied from interface:VersionedNamedWriteableReturns 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:
IOException
-
buildWordScorerFactory
- Specified by:
buildWordScorerFactoryin classSmoothingModel
-
getMinimalSupportedVersion
Description copied from interface:VersionedNamedWriteableThe minimal version of the recipient this object can be sent to
-