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 interface
WordScorer.WordScorerFactory
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.String
field
protected org.apache.lucene.index.IndexReader
reader
protected double
realWordLikelihood
protected org.apache.lucene.util.BytesRef
separator
protected org.apache.lucene.util.BytesRefBuilder
spare
protected org.apache.lucene.index.Terms
terms
protected long
vocabluarySize
-
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 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
scoreBigram(DirectCandidateGenerator.Candidate word, DirectCandidateGenerator.Candidate w_1)
protected double
scoreTrigram(DirectCandidateGenerator.Candidate word, DirectCandidateGenerator.Candidate w_1, DirectCandidateGenerator.Candidate w_2)
protected double
scoreUnigram(DirectCandidateGenerator.Candidate word)
-
-
-
Field Detail
-
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
-
-
Constructor Detail
-
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 Detail
-
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
protected double scoreUnigram(DirectCandidateGenerator.Candidate word) throws java.io.IOException
- 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)
-
-