Class WordScorer
org.elasticsearch.search.suggest.phrase.WordScorer
- Direct Known Subclasses:
LinearInterpolatingScorer
public abstract class WordScorer
extends
-
Nested Class Summary
-
Field Summary
Modifier and TypeFieldDescriptionprotected
protected long
protected org.apache.lucene.index.IndexReader
protected double
protected org.apache.lucene.util.BytesRef
protected org.apache.lucene.util.BytesRefBuilder
protected org.apache.lucene.index.Terms
protected long
-
Constructor Summary
ConstructorDescriptionWordScorer(org.apache.lucene.index.IndexReader reader, field, double realWordLikelihood, org.apache.lucene.util.BytesRef separator)
WordScorer(org.apache.lucene.index.IndexReader reader, org.apache.lucene.index.Terms terms, field, double realWordLikelihood, org.apache.lucene.util.BytesRef separator)
-
Method Summary
Modifier and TypeMethodDescriptionprotected double
channelScore(DirectCandidateGenerator.Candidate candidate, DirectCandidateGenerator.Candidate original)
long
frequency(org.apache.lucene.util.BytesRef term)
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)
double
score(DirectCandidateGenerator.Candidate[] path, DirectCandidateGenerator.CandidateSet[] candidateSet, int at, int gramSize)
protected double
protected double
scoreTrigram(DirectCandidateGenerator.Candidate word, DirectCandidateGenerator.Candidate w_1, DirectCandidateGenerator.Candidate w_2)
protected double
Methods inherited from class java.lang.
, , , , , , , , , ,
-
Field Details
-
reader
protected final org.apache.lucene.index.IndexReader reader -
field
protected final 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, field, double realWordLikelihood, org.apache.lucene.util.BytesRef separator) throws- Throws:
-
WordScorer
public WordScorer(org.apache.lucene.index.IndexReader reader, org.apache.lucene.index.Terms terms, field, double realWordLikelihood, org.apache.lucene.util.BytesRef separator) throws- Throws:
-
-
Method Details
-
frequency
public long frequency(org.apache.lucene.util.BytesRef term) throws- Throws:
-
channelScore
protected double channelScore(DirectCandidateGenerator.Candidate candidate, DirectCandidateGenerator.Candidate original) throws- Throws:
-
score
public double score(DirectCandidateGenerator.Candidate[] path, DirectCandidateGenerator.CandidateSet[] candidateSet, int at, int gramSize) throws- Throws:
-
scoreUnigram
- Throws:
-
scoreBigram
protected double scoreBigram(DirectCandidateGenerator.Candidate word, DirectCandidateGenerator.Candidate w_1) throws- Throws:
-
scoreTrigram
protected double scoreTrigram(DirectCandidateGenerator.Candidate word, DirectCandidateGenerator.Candidate w_1, DirectCandidateGenerator.Candidate w_2) throws- Throws:
-
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)
-