|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| StandardAnalyzer | Line # 32 | 10 | 6 | 62.5% |
0.625
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||
| (38) | |||
| Result | |||
|
0.625
|
org.apache.lucene.search.TestMultiSearcherRanking.testOneTermQuery
org.apache.lucene.search.TestMultiSearcherRanking.testOneTermQuery
|
1 PASS | |
|
0.625
|
org.apache.lucene.search.TestMultiSearcher.testEmptyIndex
org.apache.lucene.search.TestMultiSearcher.testEmptyIndex
|
1 PASS | |
|
0.625
|
org.apache.lucene.queryParser.TestMultiFieldQueryParser.testStaticMethod2Old
org.apache.lucene.queryParser.TestMultiFieldQueryParser.testStaticMethod2Old
|
1 PASS | |
|
0.625
|
org.apache.lucene.queryParser.TestMultiFieldQueryParser.testStaticMethod2
org.apache.lucene.queryParser.TestMultiFieldQueryParser.testStaticMethod2
|
1 PASS | |
|
0.625
|
org.apache.lucene.queryParser.TestMultiFieldQueryParser.testStopWordSearching
org.apache.lucene.queryParser.TestMultiFieldQueryParser.testStopWordSearching
|
1 PASS | |
|
0.625
|
org.apache.lucene.queryParser.TestMultiFieldQueryParser.testAnalyzerReturningNull
org.apache.lucene.queryParser.TestMultiFieldQueryParser.testAnalyzerReturningNull
|
1 PASS | |
|
0.625
|
org.apache.lucene.queryParser.TestMultiFieldQueryParser.testBoostsSimple
org.apache.lucene.queryParser.TestMultiFieldQueryParser.testBoostsSimple
|
1 PASS | |
|
0.625
|
org.apache.lucene.search.TestMultiSearcherRanking.testTwoTermQuery
org.apache.lucene.search.TestMultiSearcherRanking.testTwoTermQuery
|
1 PASS | |
|
0.625
|
org.apache.lucene.queryParser.TestMultiFieldQueryParser.testSimple
org.apache.lucene.queryParser.TestMultiFieldQueryParser.testSimple
|
1 PASS | |
|
0.625
|
org.apache.lucene.index.TestParallelReader.testIncompatibleIndexes
org.apache.lucene.index.TestParallelReader.testIncompatibleIndexes
|
1 PASS | |
|
0.625
|
org.apache.lucene.queryParser.TestMultiFieldQueryParser.testStaticMethod3
org.apache.lucene.queryParser.TestMultiFieldQueryParser.testStaticMethod3
|
1 PASS | |
|
0.625
|
org.apache.lucene.index.TestIndexReader.testIsCurrent
org.apache.lucene.index.TestIndexReader.testIsCurrent
|
1 PASS | |
|
0.625
|
org.apache.lucene.analysis.TestStandardAnalyzer.testStandard
org.apache.lucene.analysis.TestStandardAnalyzer.testStandard
|
1 PASS | |
|
0.625
|
org.apache.lucene.index.TestIndexModifier.testIndexWithThreads
org.apache.lucene.index.TestIndexModifier.testIndexWithThreads
|
1 PASS | |
|
0.625
|
org.apache.lucene.search.TestMatchAllDocsQuery.testQuery
org.apache.lucene.search.TestMatchAllDocsQuery.testQuery
|
1 PASS | |
|
0.625
|
org.apache.lucene.queryParser.TestQueryParser.testNumber
org.apache.lucene.queryParser.TestQueryParser.testNumber
|
1 PASS | |
|
0.625
|
org.apache.lucene.queryParser.TestMultiFieldQueryParser.testStaticMethod1
org.apache.lucene.queryParser.TestMultiFieldQueryParser.testStaticMethod1
|
1 PASS | |
|
0.625
|
org.apache.lucene.queryParser.TestMultiFieldQueryParser.testStaticMethod3Old
org.apache.lucene.queryParser.TestMultiFieldQueryParser.testStaticMethod3Old
|
1 PASS | |
|
0.625
|
org.apache.lucene.index.TestIndexReader.testGetFieldNames
org.apache.lucene.index.TestIndexReader.testGetFieldNames
|
1 PASS | |
|
0.625
|
org.apache.lucene.TestDemo.testDemo
org.apache.lucene.TestDemo.testDemo
|
1 PASS | |
|
0.625
|
org.apache.lucene.index.TestParallelReader.testFieldNames
org.apache.lucene.index.TestParallelReader.testFieldNames
|
1 PASS | |
|
0.625
|
org.apache.lucene.search.TestMultiSearcherRanking.testMultiPhraseQuery
org.apache.lucene.search.TestMultiSearcherRanking.testMultiPhraseQuery
|
1 PASS | |
|
0.625
|
org.apache.lucene.search.TestMultiSearcher.testEmptyIndex
org.apache.lucene.search.TestMultiSearcher.testEmptyIndex
|
1 PASS | |
|
0.625
|
org.apache.lucene.queryParser.TestQueryParser.testBoost
org.apache.lucene.queryParser.TestQueryParser.testBoost
|
1 PASS | |
|
0.625
|
org.apache.lucene.index.TestParallelReader.testDocument
org.apache.lucene.index.TestParallelReader.testDocument
|
1 PASS | |
|
0.625
|
org.apache.lucene.index.TestTermVectorsWriter.testBadSegment
org.apache.lucene.index.TestTermVectorsWriter.testBadSegment
|
1 PASS | |
|
0.625
|
org.apache.lucene.document.TestDocument.testGetValuesForIndexedDocument
org.apache.lucene.document.TestDocument.testGetValuesForIndexedDocument
|
1 PASS | |
|
0.625
|
org.apache.lucene.search.TestMultiSearcherRanking.testNoMatchQuery
org.apache.lucene.search.TestMultiSearcherRanking.testNoMatchQuery
|
1 PASS | |
|
0.5
|
org.apache.lucene.search.TestMultiPhraseQuery.testPhrasePrefixWithBooleanQuery
org.apache.lucene.search.TestMultiPhraseQuery.testPhrasePrefixWithBooleanQuery
|
1 PASS | |
|
0.25
|
org.apache.lucene.index.TestIndexModifier.testIndex
org.apache.lucene.index.TestIndexModifier.testIndex
|
1 PASS | |
|
0.25
|
org.apache.lucene.search.TestMultiSearcherRanking.testPrefixQuery
org.apache.lucene.search.TestMultiSearcherRanking.testPrefixQuery
|
1 PASS | |
|
0.25
|
org.apache.lucene.document.TestBinaryDocument.testBinaryFieldInIndex
org.apache.lucene.document.TestBinaryDocument.testBinaryFieldInIndex
|
1 PASS | |
|
0.25
|
org.apache.lucene.index.TestIndexModifier.testExtendedIndex
org.apache.lucene.index.TestIndexModifier.testExtendedIndex
|
1 PASS | |
|
0.25
|
org.apache.lucene.search.TestCachingWrapperFilter.testCachingWorks
org.apache.lucene.search.TestCachingWrapperFilter.testCachingWorks
|
1 PASS | |
|
0.25
|
org.apache.lucene.index.TestIndexWriterMerging.testLucene
org.apache.lucene.index.TestIndexWriterMerging.testLucene
|
1 PASS | |
|
0.25
|
org.apache.lucene.queryParser.TestQueryParser.testSimple
org.apache.lucene.queryParser.TestQueryParser.testSimple
|
1 PASS | |
|
0.25
|
org.apache.lucene.search.TestMultiSearcherRanking.testRangeQuery
org.apache.lucene.search.TestMultiSearcherRanking.testRangeQuery
|
1 PASS | |
|
0.25
|
org.apache.lucene.search.TestMultiSearcherRanking.testFuzzyQuery
org.apache.lucene.search.TestMultiSearcherRanking.testFuzzyQuery
|
1 PASS | |
| 1 | package org.apache.lucene.analysis.standard; | |
| 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 org.apache.lucene.analysis.*; | |
| 20 | ||
| 21 | import java.io.File; | |
| 22 | import java.io.IOException; | |
| 23 | import java.io.Reader; | |
| 24 | import java.util.Set; | |
| 25 | ||
| 26 | /** | |
| 27 | * Filters {@link StandardTokenizer} with {@link StandardFilter}, {@link | |
| 28 | * LowerCaseFilter} and {@link StopFilter}, using a list of English stop words. | |
| 29 | * | |
| 30 | * @version $Id: StandardAnalyzer.java 219090 2005-07-14 20:36:28Z dnaber $ | |
| 31 | */ | |
| 32 | public class StandardAnalyzer extends Analyzer { | |
| 33 | private Set stopSet; | |
| 34 | ||
| 35 | /** An array containing some common English words that are usually not | |
| 36 | useful for searching. */ | |
| 37 | public static final String[] STOP_WORDS = StopAnalyzer.ENGLISH_STOP_WORDS; | |
| 38 | ||
| 39 | /** Builds an analyzer with the default stop words ({@link #STOP_WORDS}). */ | |
| 40 | 116 |
public StandardAnalyzer() { |
| 41 | 116 | this(STOP_WORDS); |
| 42 | } | |
| 43 | ||
| 44 | /** Builds an analyzer with the given stop words. */ | |
| 45 | 0 |
public StandardAnalyzer(Set stopWords) { |
| 46 | 0 | stopSet = stopWords; |
| 47 | } | |
| 48 | ||
| 49 | /** Builds an analyzer with the given stop words. */ | |
| 50 | 118 |
public StandardAnalyzer(String[] stopWords) { |
| 51 | 118 | stopSet = StopFilter.makeStopSet(stopWords); |
| 52 | } | |
| 53 | ||
| 54 | /** Builds an analyzer with the stop words from the given file. | |
| 55 | * @see WordlistLoader#getWordSet(File) | |
| 56 | */ | |
| 57 | 0 |
public StandardAnalyzer(File stopwords) throws IOException { |
| 58 | 0 | stopSet = WordlistLoader.getWordSet(stopwords); |
| 59 | } | |
| 60 | ||
| 61 | /** Builds an analyzer with the stop words from the given reader. | |
| 62 | * @see WordlistLoader#getWordSet(Reader) | |
| 63 | */ | |
| 64 | 0 |
public StandardAnalyzer(Reader stopwords) throws IOException { |
| 65 | 0 | stopSet = WordlistLoader.getWordSet(stopwords); |
| 66 | } | |
| 67 | ||
| 68 | /** Constructs a {@link StandardTokenizer} filtered by a {@link | |
| 69 | StandardFilter}, a {@link LowerCaseFilter} and a {@link StopFilter}. */ | |
| 70 | 6517 |
public TokenStream tokenStream(String fieldName, Reader reader) { |
| 71 | 6517 | TokenStream result = new StandardTokenizer(reader); |
| 72 | 6517 | result = new StandardFilter(result); |
| 73 | 6517 | result = new LowerCaseFilter(result); |
| 74 | 6517 | result = new StopFilter(result, stopSet); |
| 75 | 6517 | return result; |
| 76 | } | |
| 77 | } | |
|
||||||||||