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 org.apache.lucene.index.IndexReaderreaderprotected doublerealWordLikelyhoodprotected 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 realWordLikelyHood, org.apache.lucene.util.BytesRef separator)WordScorer(org.apache.lucene.index.IndexReader reader, org.apache.lucene.index.Terms terms, java.lang.String field, double realWordLikelyHood, org.apache.lucene.util.BytesRef separator)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods 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 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
-
realWordLikelyhood
protected final double realWordLikelyhood
-
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 realWordLikelyHood, 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 realWordLikelyHood, 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)
-
-