|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ExactPhraseScorer | Line # 22 | 14 | 7 | 96.2% |
0.96153843
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||
| (23) | |||
| Result | |||
|
0.96153843
|
org.apache.lucene.search.TestSimpleExplanations.testMPQ3
org.apache.lucene.search.TestSimpleExplanations.testMPQ3
|
1 PASS | |
|
0.9230769
|
org.apache.lucene.search.spans.TestBasics.testPhrase
org.apache.lucene.search.spans.TestBasics.testPhrase
|
1 PASS | |
|
0.84615386
|
org.apache.lucene.search.TestSimpleExplanations.testMPQ2
org.apache.lucene.search.TestSimpleExplanations.testMPQ2
|
1 PASS | |
|
0.84615386
|
org.apache.lucene.search.TestMultiPhraseQuery.testPhrasePrefixWithBooleanQuery
org.apache.lucene.search.TestMultiPhraseQuery.testPhrasePrefixWithBooleanQuery
|
1 PASS | |
|
0.84615386
|
org.apache.lucene.search.TestSimpleExplanations.testMPQ2
org.apache.lucene.search.TestSimpleExplanations.testMPQ2
|
1 PASS | |
|
0.84615386
|
org.apache.lucene.search.TestSimpleExplanations.testMPQ1
org.apache.lucene.search.TestSimpleExplanations.testMPQ1
|
1 PASS | |
|
0.8076923
|
org.apache.lucene.search.TestSimpleExplanations.testP1
org.apache.lucene.search.TestSimpleExplanations.testP1
|
1 PASS | |
|
0.8076923
|
org.apache.lucene.search.TestSimpleExplanations.testP1
org.apache.lucene.search.TestSimpleExplanations.testP1
|
1 PASS | |
|
0.8076923
|
org.apache.lucene.search.TestSimilarity.testSimilarity
org.apache.lucene.search.TestSimilarity.testSimilarity
|
1 PASS | |
|
0.8076923
|
org.apache.lucene.search.TestSimpleExplanations.testMPQ4
org.apache.lucene.search.TestSimpleExplanations.testMPQ4
|
1 PASS | |
|
0.8076923
|
org.apache.lucene.search.TestSimpleExplanations.testP2
org.apache.lucene.search.TestSimpleExplanations.testP2
|
1 PASS | |
|
0.8076923
|
org.apache.lucene.search.TestSimpleExplanations.testP2
org.apache.lucene.search.TestSimpleExplanations.testP2
|
1 PASS | |
|
0.8076923
|
org.apache.lucene.search.TestPositionIncrement.testSetPosition
org.apache.lucene.search.TestPositionIncrement.testSetPosition
|
1 PASS | |
|
0.8076923
|
org.apache.lucene.search.TestSimpleExplanations.testMPQ4
org.apache.lucene.search.TestSimpleExplanations.testMPQ4
|
1 PASS | |
|
0.8076923
|
org.apache.lucene.search.TestPhraseQuery.testPhraseQueryInConjunctionScorer
org.apache.lucene.search.TestPhraseQuery.testPhraseQueryInConjunctionScorer
|
1 PASS | |
|
0.8076923
|
org.apache.lucene.search.TestPhraseQuery.testExact
org.apache.lucene.search.TestPhraseQuery.testExact
|
1 PASS | |
|
0.8076923
|
org.apache.lucene.search.TestMultiPhraseQuery.testPhrasePrefix
org.apache.lucene.search.TestMultiPhraseQuery.testPhrasePrefix
|
1 PASS | |
|
0.61538464
|
org.apache.lucene.search.TestPhrasePrefixQuery.testPhrasePrefix
org.apache.lucene.search.TestPhrasePrefixQuery.testPhrasePrefix
|
1 PASS | |
|
0.61538464
|
org.apache.lucene.search.TestRemoteSearchable.testPhraseQuery
org.apache.lucene.search.TestRemoteSearchable.testPhraseQuery
|
1 PASS | |
|
0.61538464
|
org.apache.lucene.index.TestLazyProxSkipping.testLazySkipping
org.apache.lucene.index.TestLazyProxSkipping.testLazySkipping
|
1 PASS | |
|
0.61538464
|
org.apache.lucene.search.TestPhraseQuery.testPhraseQueryWithStopAnalyzer
org.apache.lucene.search.TestPhraseQuery.testPhraseQueryWithStopAnalyzer
|
1 PASS | |
|
0.07692308
|
org.apache.lucene.search.spans.TestBasics.testPhrase2
org.apache.lucene.search.spans.TestBasics.testPhrase2
|
1 PASS | |
|
0.07692308
|
org.apache.lucene.search.TestMultiSearcherRanking.testMultiPhraseQuery
org.apache.lucene.search.TestMultiSearcherRanking.testMultiPhraseQuery
|
1 PASS | |
| 1 | package org.apache.lucene.search; | |
| 2 | ||
| 3 | /** | |
| 4 | * Copyright 2004 The Apache Software Foundation | |
| 5 | * | |
| 6 | * Licensed under the Apache License, Version 2.0 (the "License"); | |
| 7 | * you may not use this file except in compliance with the License. | |
| 8 | * You may obtain a copy of the License at | |
| 9 | * | |
| 10 | * http://www.apache.org/licenses/LICENSE-2.0 | |
| 11 | * | |
| 12 | * Unless required by applicable law or agreed to in writing, software | |
| 13 | * distributed under the License is distributed on an "AS IS" BASIS, | |
| 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
| 15 | * See the License for the specific language governing permissions and | |
| 16 | * limitations under the License. | |
| 17 | */ | |
| 18 | ||
| 19 | import java.io.IOException; | |
| 20 | import org.apache.lucene.index.*; | |
| 21 | ||
| 22 | final class ExactPhraseScorer extends PhraseScorer { | |
| 23 | ||
| 24 | 99 |
ExactPhraseScorer(Weight weight, TermPositions[] tps, int[] positions, Similarity similarity, |
| 25 | byte[] norms) { | |
| 26 | 99 | super(weight, tps, positions, similarity, norms); |
| 27 | } | |
| 28 | ||
| 29 | 328 |
protected final float phraseFreq() throws IOException { |
| 30 | // sort list with pq | |
| 31 | 984 | for (PhrasePositions pp = first; pp != null; pp = pp.next) { |
| 32 | 656 | pp.firstPosition(); |
| 33 | 656 | pq.put(pp); // build pq from list |
| 34 | } | |
| 35 | 328 | pqToList(); // rebuild list from pq |
| 36 | ||
| 37 | 328 | int freq = 0; |
| 38 | 328 | do { // find position w/ all terms |
| 39 | 383 | while (first.position < last.position) { // scan forward in first |
| 40 | 170 | do { |
| 41 | 170 | if (!first.nextPosition()) |
| 42 | 153 | return (float)freq; |
| 43 | 17 | } while (first.position < last.position); |
| 44 | 17 | firstToLast(); |
| 45 | } | |
| 46 | 213 | freq++; // all equal: a match |
| 47 | 213 | } while (last.nextPosition()); |
| 48 | ||
| 49 | 175 | return (float)freq; |
| 50 | } | |
| 51 | } | |
|
||||||||||