|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| SpanFirstQuery | Line # 29 | 47 | 25 | 81.2% |
0.8125
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||
| (32) | |||
| Result | |||
|
0.7625
|
org.apache.lucene.search.spans.TestSpanExplanations.testSF6
org.apache.lucene.search.spans.TestSpanExplanations.testSF6
|
1 PASS | |
|
0.7625
|
org.apache.lucene.search.spans.TestSpanExplanations.testSF4
org.apache.lucene.search.spans.TestSpanExplanations.testSF4
|
1 PASS | |
|
0.7625
|
org.apache.lucene.search.spans.TestBasics.testSpanFirst
org.apache.lucene.search.spans.TestBasics.testSpanFirst
|
1 PASS | |
|
0.75
|
org.apache.lucene.search.spans.TestSpanExplanations.testSF1
org.apache.lucene.search.spans.TestSpanExplanations.testSF1
|
1 PASS | |
|
0.75
|
org.apache.lucene.search.spans.TestSpanExplanations.testSF2
org.apache.lucene.search.spans.TestSpanExplanations.testSF2
|
1 PASS | |
|
0.6875
|
org.apache.lucene.search.spans.TestSpanExplanations.testSF5
org.apache.lucene.search.spans.TestSpanExplanations.testSF5
|
1 PASS | |
|
0.6875
|
org.apache.lucene.search.TestComplexExplanations.testSF3
org.apache.lucene.search.TestComplexExplanations.testSF3
|
1 PASS | |
|
0.6875
|
org.apache.lucene.search.spans.TestSpanExplanations.testSNot5
org.apache.lucene.search.spans.TestSpanExplanations.testSNot5
|
1 PASS | |
|
0.6875
|
org.apache.lucene.search.spans.TestBasics.testNpeInSpanNearInSpanFirstInSpanNot
org.apache.lucene.search.spans.TestBasics.testNpeInSpanNearInSpanFirstInSpanNot
|
1 PASS | |
|
0.6875
|
org.apache.lucene.search.spans.TestSpanExplanations.testSNot2
org.apache.lucene.search.spans.TestSpanExplanations.testSNot2
|
1 PASS | |
|
0.6875
|
org.apache.lucene.search.TestComplexExplanations.testSF7
org.apache.lucene.search.TestComplexExplanations.testSF7
|
1 PASS | |
|
0.6875
|
org.apache.lucene.search.spans.TestSpanExplanations.testSNot1
org.apache.lucene.search.spans.TestSpanExplanations.testSNot1
|
1 PASS | |
|
0.6875
|
org.apache.lucene.search.spans.TestSpanExplanations.testSNot4
org.apache.lucene.search.spans.TestSpanExplanations.testSNot4
|
1 PASS | |
|
0.675
|
org.apache.lucene.search.TestComplexExplanations.test2
org.apache.lucene.search.TestComplexExplanations.test2
|
1 PASS | |
|
0.675
|
org.apache.lucene.search.TestComplexExplanations.test1
org.apache.lucene.search.TestComplexExplanations.test1
|
1 PASS | |
|
0.6375
|
org.apache.lucene.search.TestComplexExplanations.testSNot6
org.apache.lucene.search.TestComplexExplanations.testSNot6
|
1 PASS | |
|
0.6375
|
org.apache.lucene.search.TestComplexExplanations.testSNot3
org.apache.lucene.search.TestComplexExplanations.testSNot3
|
1 PASS | |
|
0.5875
|
org.apache.lucene.search.spans.TestSpanExplanations.testSF6
org.apache.lucene.search.spans.TestSpanExplanations.testSF6
|
1 PASS | |
|
0.5875
|
org.apache.lucene.search.spans.TestSpanExplanations.testSF4
org.apache.lucene.search.spans.TestSpanExplanations.testSF4
|
1 PASS | |
|
0.5625
|
org.apache.lucene.search.TestComplexExplanations.test2
org.apache.lucene.search.TestComplexExplanations.test2
|
1 PASS | |
|
0.5625
|
org.apache.lucene.search.TestComplexExplanations.test1
org.apache.lucene.search.TestComplexExplanations.test1
|
1 PASS | |
|
0.55
|
org.apache.lucene.search.TestComplexExplanations.testSF7
org.apache.lucene.search.TestComplexExplanations.testSF7
|
1 PASS | |
|
0.5125
|
org.apache.lucene.search.spans.TestSpanExplanations.testSF5
org.apache.lucene.search.spans.TestSpanExplanations.testSF5
|
1 PASS | |
|
0.175
|
org.apache.lucene.search.TestComplexExplanations.testSNot3
org.apache.lucene.search.TestComplexExplanations.testSNot3
|
1 PASS | |
|
0.175
|
org.apache.lucene.search.spans.TestSpanExplanations.testSNot2
org.apache.lucene.search.spans.TestSpanExplanations.testSNot2
|
1 PASS | |
|
0.175
|
org.apache.lucene.search.spans.TestSpanExplanations.testSNot4
org.apache.lucene.search.spans.TestSpanExplanations.testSNot4
|
1 PASS | |
|
0.175
|
org.apache.lucene.search.spans.TestSpanExplanations.testSNot1
org.apache.lucene.search.spans.TestSpanExplanations.testSNot1
|
1 PASS | |
|
0.175
|
org.apache.lucene.search.spans.TestSpanExplanations.testSNot5
org.apache.lucene.search.spans.TestSpanExplanations.testSNot5
|
1 PASS | |
|
0.175
|
org.apache.lucene.search.TestComplexExplanations.testSNot6
org.apache.lucene.search.TestComplexExplanations.testSNot6
|
1 PASS | |
|
0.15
|
org.apache.lucene.search.TestComplexExplanations.testSF3
org.apache.lucene.search.TestComplexExplanations.testSF3
|
1 PASS | |
|
0.15
|
org.apache.lucene.search.spans.TestSpanExplanations.testSF2
org.apache.lucene.search.spans.TestSpanExplanations.testSF2
|
1 PASS | |
|
0.15
|
org.apache.lucene.search.spans.TestSpanExplanations.testSF1
org.apache.lucene.search.spans.TestSpanExplanations.testSF1
|
1 PASS | |
| 1 | package org.apache.lucene.search.spans; | |
| 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 | ||
| 21 | import java.util.Collection; | |
| 22 | import java.util.Set; | |
| 23 | ||
| 24 | import org.apache.lucene.index.IndexReader; | |
| 25 | import org.apache.lucene.search.Query; | |
| 26 | import org.apache.lucene.util.ToStringUtils; | |
| 27 | ||
| 28 | /** Matches spans near the beginning of a field. */ | |
| 29 | public class SpanFirstQuery extends SpanQuery { | |
| 30 | private SpanQuery match; | |
| 31 | private int end; | |
| 32 | ||
| 33 | /** Construct a SpanFirstQuery matching spans in <code>match</code> whose end | |
| 34 | * position is less than or equal to <code>end</code>. */ | |
| 35 | 33 |
public SpanFirstQuery(SpanQuery match, int end) { |
| 36 | 33 | this.match = match; |
| 37 | 33 | this.end = end; |
| 38 | } | |
| 39 | ||
| 40 | /** Return the SpanQuery whose matches are filtered. */ | |
| 41 | 0 |
public SpanQuery getMatch() { return match; } |
| 42 | ||
| 43 | /** Return the maximum end position permitted in a match. */ | |
| 44 | 0 |
public int getEnd() { return end; } |
| 45 | ||
| 46 | 237 |
public String getField() { return match.getField(); } |
| 47 | ||
| 48 | /** Returns a collection of all terms matched by this query. | |
| 49 | * @deprecated use extractTerms instead | |
| 50 | * @see #extractTerms(Set) | |
| 51 | */ | |
| 52 | 0 |
public Collection getTerms() { return match.getTerms(); } |
| 53 | ||
| 54 | 296 |
public String toString(String field) { |
| 55 | 296 | StringBuffer buffer = new StringBuffer(); |
| 56 | 296 | buffer.append("spanFirst("); |
| 57 | 296 | buffer.append(match.toString(field)); |
| 58 | 296 | buffer.append(", "); |
| 59 | 296 | buffer.append(end); |
| 60 | 296 | buffer.append(")"); |
| 61 | 296 | buffer.append(ToStringUtils.boost(getBoost())); |
| 62 | 296 | return buffer.toString(); |
| 63 | } | |
| 64 | ||
| 65 | ||