Class WordScorer
java.lang.Object
org.elasticsearch.search.suggest.phrase.WordScorer
- Direct Known Subclasses:
LinearInterpolatingScorer
public abstract class WordScorer
extends java.lang.Object
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceWordScorer.WordScorerFactory -
Field Summary
Fields Modifier and Type Field Description protected java.lang.Stringfieldprotected longnumTermsprotected org.apache.lucene.index.IndexReaderreaderprotected doublerealWordLikelihoodprotected org.apache.lucene.util.BytesRefseparatorprotected org.apache.lucene.util.BytesRefBuilderspareprotected org.apache.lucene.index.Termstermsprotected longvocabluarySize -
Constructor Summary
Constructors Constructor Description WordScorer(org.apache.lucene.index.IndexReader reader, java.lang.String field, double realWordLikelihood, org.apache.lucene.util.BytesRef separator)WordScorer(org.apache.lucene.index.IndexReader reader, org.apache.lucene.index.Terms terms, java.lang.String field, double realWordLikelihood, org.apache.lucene.util.BytesRef separator) -
Method Summary
Modifier and Type Method Description protected doublechannelScore(DirectCandidateGenerator.Candidate candidate, DirectCandidateGenerator.Candidate original)longfrequency(org.apache.lucene.util.BytesRef term)static org.apache.lucene.util.BytesRefjoin(org.apache.lucene.util.BytesRef separator, org.apache.lucene.util.BytesRefBuilder result, org.apache.lucene.util.BytesRef... toJoin)doublescore(DirectCandidateGenerator.Candidate[] path, DirectCandidateGenerator.CandidateSet[] candidateSet, int at, int gramSize)protected doublescoreBigram(DirectCandidateGenerator.Candidate word, DirectCandidateGenerator.Candidate w_1)protected doublescoreTrigram(DirectCandidateGenerator.Candidate word, DirectCandidateGenerator.Candidate w_1, DirectCandidateGenerator.Candidate w_2)protected doublescoreUnigram(DirectCandidateGenerator.Candidate word)
-
Field Details
-
reader
protected final org.apache.lucene.index.IndexReader reader -
field
protected final java.lang.String field -
terms
protected final org.apache.lucene.index.Terms terms -
vocabluarySize
protected final long vocabluarySize -
realWordLikelihood
protected final double realWordLikelihood -
spare
protected final org.apache.lucene.util.BytesRefBuilder spare -
separator
protected final org.apache.lucene.util.BytesRef separator -
numTerms
protected final long numTerms
-
-
Constructor Details
-
WordScorer
public WordScorer(org.apache.lucene.index.IndexReader reader, java.lang.String field, double realWordLikelihood, org.apache.lucene.util.BytesRef separator) throws java.io.IOException- Throws:
java.io.IOException
-
WordScorer
public WordScorer(org.apache.lucene.index.IndexReader reader, org.apache.lucene.index.Terms terms, java.lang.String field, double realWordLikelihood, org.apache.lucene.util.BytesRef separator) throws java.io.IOException- Throws:
java.io.IOException
-
-
Method Details
-
frequency
public long frequency(org.apache.lucene.util.BytesRef term) throws java.io.IOException- Throws:
java.io.IOException
-
channelScore
protected double channelScore(DirectCandidateGenerator.Candidate candidate, DirectCandidateGenerator.Candidate original) throws java.io.IOException- Throws:
java.io.IOException
-
score
public double score(DirectCandidateGenerator.Candidate[] path, DirectCandidateGenerator.CandidateSet[] candidateSet, int at, int gramSize) throws java.io.IOException- Throws:
java.io.IOException
-
scoreUnigram
- Throws:
java.io.IOException
-
scoreBigram
protected double scoreBigram(DirectCandidateGenerator.Candidate word, DirectCandidateGenerator.Candidate w_1) throws java.io.IOException- Throws:
java.io.IOException
-
scoreTrigram
protected double scoreTrigram(DirectCandidateGenerator.Candidate word, DirectCandidateGenerator.Candidate w_1, DirectCandidateGenerator.Candidate w_2) throws java.io.IOException- Throws:
java.io.IOException
-
join
public static org.apache.lucene.util.BytesRef join(org.apache.lucene.util.BytesRef separator, org.apache.lucene.util.BytesRefBuilder result, org.apache.lucene.util.BytesRef... toJoin)
-