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