You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucenenet.apache.org by bo...@apache.org on 2012/05/31 06:33:43 UTC
svn commit: r1344562 [1/4] - in /incubator/lucene.net/trunk:
src/contrib/Analyzers/De/ src/contrib/Analyzers/Filters/
src/contrib/Core/Analysis/Ext/ src/contrib/Memory/
src/contrib/Memory/Properties/ src/contrib/Spatial/
src/contrib/Spatial/Prefix/ src...
Author: bodewig
Date: Thu May 31 04:33:41 2012
New Revision: 1344562
URL: http://svn.apache.org/viewvc?rev=1344562&view=rev
Log:
even more line-ends
Modified:
incubator/lucene.net/trunk/src/contrib/Analyzers/De/GermanDIN2Stemmer.cs (contents, props changed)
incubator/lucene.net/trunk/src/contrib/Analyzers/Filters/ChainedFilter.cs (contents, props changed)
incubator/lucene.net/trunk/src/contrib/Core/Analysis/Ext/Analysis.Ext.cs (contents, props changed)
incubator/lucene.net/trunk/src/contrib/Memory/CollectionsHelper.cs (contents, props changed)
incubator/lucene.net/trunk/src/contrib/Memory/EmptyCollector.cs (contents, props changed)
incubator/lucene.net/trunk/src/contrib/Memory/KeywordTokenStream.cs (contents, props changed)
incubator/lucene.net/trunk/src/contrib/Memory/MemoryIndex.cs (contents, props changed)
incubator/lucene.net/trunk/src/contrib/Memory/MemoryTermEnum.cs (contents, props changed)
incubator/lucene.net/trunk/src/contrib/Memory/MemoryTermPositionVector.cs (contents, props changed)
incubator/lucene.net/trunk/src/contrib/Memory/MemoryTermPositions.cs (contents, props changed)
incubator/lucene.net/trunk/src/contrib/Memory/Properties/AssemblyInfo.cs (contents, props changed)
incubator/lucene.net/trunk/src/contrib/Memory/TermComparer.cs (contents, props changed)
incubator/lucene.net/trunk/src/contrib/Spatial/Prefix/PointPrefixTreeFieldCacheProvider.cs (props changed)
incubator/lucene.net/trunk/src/contrib/Spatial/Prefix/PrefixCellsTokenizer.cs (props changed)
incubator/lucene.net/trunk/src/contrib/Spatial/Prefix/PrefixTreeStrategy.cs (props changed)
incubator/lucene.net/trunk/src/contrib/Spatial/Prefix/RecursivePrefixTreeFilter.cs (props changed)
incubator/lucene.net/trunk/src/contrib/Spatial/Prefix/RecursivePrefixTreeStrategy.cs (props changed)
incubator/lucene.net/trunk/src/contrib/Spatial/Prefix/TermQueryPrefixTreeStrategy.cs (props changed)
incubator/lucene.net/trunk/src/contrib/Spatial/Prefix/Tree/GeohashPrefixTree.cs (props changed)
incubator/lucene.net/trunk/src/contrib/Spatial/Prefix/Tree/Node.cs (props changed)
incubator/lucene.net/trunk/src/contrib/Spatial/Prefix/Tree/QuadPrefixTree.cs (props changed)
incubator/lucene.net/trunk/src/contrib/Spatial/Prefix/Tree/SpatialPrefixTree.cs (props changed)
incubator/lucene.net/trunk/src/contrib/Spatial/Prefix/Tree/SpatialPrefixTreeFactory.cs (props changed)
incubator/lucene.net/trunk/src/contrib/Spatial/SimpleSpatialFieldInfo.cs (props changed)
incubator/lucene.net/trunk/src/contrib/Spatial/SpatialFieldInfo.cs (props changed)
incubator/lucene.net/trunk/src/contrib/Spatial/SpatialStrategy.cs (props changed)
incubator/lucene.net/trunk/src/contrib/Spatial/Util/Bits.cs (props changed)
incubator/lucene.net/trunk/src/contrib/Spatial/Util/CachedDistanceValueSource.cs (props changed)
incubator/lucene.net/trunk/src/contrib/Spatial/Util/CachingDoubleValueSource.cs (props changed)
incubator/lucene.net/trunk/src/contrib/Spatial/Util/CompatibilityExtensions.cs (props changed)
incubator/lucene.net/trunk/src/contrib/Spatial/Util/FixedBitSet.cs (props changed)
incubator/lucene.net/trunk/src/contrib/Spatial/Util/FunctionQuery.cs (props changed)
incubator/lucene.net/trunk/src/contrib/Spatial/Util/NumericFieldInfo.cs (props changed)
incubator/lucene.net/trunk/src/contrib/Spatial/Util/OpenBitSetIterator.cs (props changed)
incubator/lucene.net/trunk/src/contrib/Spatial/Util/ShapeFieldCache.cs (props changed)
incubator/lucene.net/trunk/src/contrib/Spatial/Util/ShapeFieldCacheProvider.cs (props changed)
incubator/lucene.net/trunk/src/contrib/Spatial/Util/StringListTokenizer.cs (props changed)
incubator/lucene.net/trunk/src/contrib/Spatial/Util/TermsEnumCompatibility.cs (props changed)
incubator/lucene.net/trunk/src/contrib/Spatial/Util/TruncateFilter.cs (props changed)
incubator/lucene.net/trunk/src/contrib/Spatial/Util/ValueSourceFilter.cs (props changed)
incubator/lucene.net/trunk/src/contrib/Spatial/Vector/DistanceValueSource.cs (props changed)
incubator/lucene.net/trunk/src/contrib/Spatial/Vector/TwoDoublesFieldInfo.cs (props changed)
incubator/lucene.net/trunk/src/contrib/Spatial/Vector/TwoDoublesStrategy.cs (props changed)
incubator/lucene.net/trunk/test/contrib/Analyzers/Filters/ChainedFilterTest.cs (contents, props changed)
incubator/lucene.net/trunk/test/contrib/Highlighter/Tokenizer.cs (contents, props changed)
incubator/lucene.net/trunk/test/contrib/Memory/MemoryIndexTest.cs (contents, props changed)
incubator/lucene.net/trunk/test/contrib/Memory/Properties/AssemblyInfo.cs (contents, props changed)
incubator/lucene.net/trunk/test/contrib/Spatial/Compatibility/TestFixedBitSet.cs (props changed)
incubator/lucene.net/trunk/test/contrib/Spatial/Prefix/BaseRecursivePrefixTreeStrategyTestCase.cs (props changed)
incubator/lucene.net/trunk/test/contrib/Spatial/Prefix/TestRecursivePrefixTreeStrategy.cs (props changed)
incubator/lucene.net/trunk/test/contrib/Spatial/Prefix/TestSpatialPrefixField.cs (props changed)
incubator/lucene.net/trunk/test/contrib/Spatial/Prefix/TestTermQueryPrefixGridStrategy.cs (props changed)
incubator/lucene.net/trunk/test/contrib/Spatial/Prefix/Tree/SpatialPrefixTreeTest.cs (props changed)
incubator/lucene.net/trunk/test/contrib/Spatial/SpatialMatchConcern.cs (props changed)
incubator/lucene.net/trunk/test/contrib/Spatial/SpatialTestCase.cs (props changed)
incubator/lucene.net/trunk/test/contrib/Spatial/SpatialTestQuery.cs (props changed)
incubator/lucene.net/trunk/test/contrib/Spatial/StrategyTestCase.cs (props changed)
incubator/lucene.net/trunk/test/contrib/Spatial/TestTestFramework.cs (props changed)
incubator/lucene.net/trunk/test/contrib/Spatial/Various.cs (props changed)
incubator/lucene.net/trunk/test/contrib/Spatial/Vector/BaseTwoDoublesStrategyTestCase.cs (props changed)
incubator/lucene.net/trunk/test/contrib/Spatial/Vector/TwoDoublesStrategyTestCase.cs (props changed)
incubator/lucene.net/trunk/test/core/Util/TestParameter.cs (contents, props changed)
Modified: incubator/lucene.net/trunk/src/contrib/Analyzers/De/GermanDIN2Stemmer.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/src/contrib/Analyzers/De/GermanDIN2Stemmer.cs?rev=1344562&r1=1344561&r2=1344562&view=diff
==============================================================================
--- incubator/lucene.net/trunk/src/contrib/Analyzers/De/GermanDIN2Stemmer.cs (original)
+++ incubator/lucene.net/trunk/src/contrib/Analyzers/De/GermanDIN2Stemmer.cs Thu May 31 04:33:41 2012
@@ -1,34 +1,34 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-
-namespace Lucene.Net.Analysis.De
-{
- /// <summary>
- /// A stemmer for the german language that uses the
- /// DIN-5007-2 "Phone Book" rules for handling
- /// umlaut characters.
- /// </summary>
- public sealed class GermanDIN2Stemmer : GermanStemmer
- {
- protected override void Substitute(StringBuilder buffer)
- {
- for (int c = 0; c < buffer.Length; c++)
- {
- if (buffer[c] == 'e')
- {
- switch (buffer[c - 1])
- {
- case 'a':
- case 'o':
- case 'u':
- buffer.Remove(c, 1);
- break;
- }
- }
- }
- base.Substitute(buffer);
- }
- }
-}
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace Lucene.Net.Analysis.De
+{
+ /// <summary>
+ /// A stemmer for the german language that uses the
+ /// DIN-5007-2 "Phone Book" rules for handling
+ /// umlaut characters.
+ /// </summary>
+ public sealed class GermanDIN2Stemmer : GermanStemmer
+ {
+ protected override void Substitute(StringBuilder buffer)
+ {
+ for (int c = 0; c < buffer.Length; c++)
+ {
+ if (buffer[c] == 'e')
+ {
+ switch (buffer[c - 1])
+ {
+ case 'a':
+ case 'o':
+ case 'u':
+ buffer.Remove(c, 1);
+ break;
+ }
+ }
+ }
+ base.Substitute(buffer);
+ }
+ }
+}
Propchange: incubator/lucene.net/trunk/src/contrib/Analyzers/De/GermanDIN2Stemmer.cs
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/lucene.net/trunk/src/contrib/Analyzers/Filters/ChainedFilter.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/src/contrib/Analyzers/Filters/ChainedFilter.cs?rev=1344562&r1=1344561&r2=1344562&view=diff
==============================================================================
--- incubator/lucene.net/trunk/src/contrib/Analyzers/Filters/ChainedFilter.cs (original)
+++ incubator/lucene.net/trunk/src/contrib/Analyzers/Filters/ChainedFilter.cs Thu May 31 04:33:41 2012
@@ -1,275 +1,275 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-
-using Lucene.Net.Search;
-using Lucene.Net.Index;
-using Lucene.Net.Util;
-
-namespace Lucene.Net.Analysis
-{
-
- ///<summary>
- ///* <p>
- /// * Allows multiple {@link Filter}s to be chained.
- /// * Logical operations such as <b>NOT</b> and <b>XOR</b>
- /// * are applied between filters. One operation can be used
- /// * for all filters, or a specific operation can be declared
- /// * for each filter.
- /// * </p>
- /// * <p>
- /// * Order in which filters are called depends on
- /// * the position of the filter in the chain. It's probably
- /// * more efficient to place the most restrictive filters
- /// * /least computationally-intensive filters first.
- /// * </p>
- ///</summary>
- public class ChainedFilter : Filter
- {
- public enum Logic
- {
- NONE = -1,
- OR = 0,
- AND = 1,
- ANDNOT = 2,
- XOR = 3
- };
-
- ///<summary>Logical operation when none is declared. Defaults to OR</summary>
- public const Logic DEFAULT = Logic.OR;
-
- /** The filter chain */
- private Filter[] chain = null;
-
- private Logic[] logicArray;
-
- private Logic logic = Logic.NONE;
-
- ///<summary>Ctor</summary><param name="chain">The chain of filters</param>
- public ChainedFilter(Filter[] chain)
- {
- this.chain = chain;
- }
-
- ///<summary>ctor</summary>
- ///<param name="chain">The chain of filters</param>
- ///<param name="logicArray">Logical operations to apply between filters</param>
- public ChainedFilter(Filter[] chain, Logic[] logicArray)
- {
- this.chain = chain;
- this.logicArray = logicArray;
- }
-
- ///<summary>ctor</summary>
- ///<param name="chain">The chain of filters</param>
- ///<param name="logic">Logical operation to apply to ALL filters</param>
- public ChainedFilter(Filter[] chain, Logic logic)
- {
- this.chain = chain;
- this.logic = logic;
- }
-
- ///<see cref="Filter#getDocIdSet"/>
- public override DocIdSet GetDocIdSet(IndexReader reader)
- {
- int[] index = new int[1]; // use array as reference to modifiable int;
- index[0] = 0; // an object attribute would not be thread safe.
- if (logic != Logic.NONE)
- return GetDocIdSet(reader, logic, index);
- else if (logicArray != null)
- return GetDocIdSet(reader, logicArray, index);
- else
- return GetDocIdSet(reader, DEFAULT, index);
- }
-
- private DocIdSetIterator GetDISI(Filter filter, IndexReader reader)
- {
- DocIdSet docIdSet = filter.GetDocIdSet(reader);
- if (docIdSet == null)
- {
- return DocIdSet.EMPTY_DOCIDSET.Iterator();
- }
- else
- {
- DocIdSetIterator iter = docIdSet.Iterator();
- if (iter == null)
- {
- return DocIdSet.EMPTY_DOCIDSET.Iterator();
- }
- else
- {
- return iter;
- }
- }
- }
-
- private OpenBitSetDISI InitialResult(IndexReader reader, Logic logic, int[] index)
- {
- OpenBitSetDISI result;
- /**
- * First AND operation takes place against a completely false
- * bitset and will always return zero results.
- */
- if (logic == Logic.AND)
- {
- result = new OpenBitSetDISI(GetDISI(chain[index[0]], reader), reader.MaxDoc());
- ++index[0];
- }
- else if (logic == Logic.ANDNOT)
- {
- result = new OpenBitSetDISI(GetDISI(chain[index[0]], reader), reader.MaxDoc());
- result.Flip(0, reader.MaxDoc()); // NOTE: may set bits for deleted docs.
- ++index[0];
- }
- else
- {
- result = new OpenBitSetDISI(reader.MaxDoc());
- }
- return result;
- }
-
-
- ///<summary>
- /// * Provide a SortedVIntList when it is definitely
- /// * smaller than an OpenBitSet
- /// * @deprecated Either use CachingWrapperFilter, or
- /// * switch to a different DocIdSet implementation yourself.
- /// * This method will be removed in Lucene 4.0
- ///</summary>
- protected DocIdSet FinalResult(OpenBitSetDISI result, int maxDocs)
- {
- return result;
- }
-
-
- /**
- * Delegates to each filter in the chain.
- * @param reader IndexReader
- * @param logic Logical operation
- * @return DocIdSet
- */
- private DocIdSet GetDocIdSet(IndexReader reader, Logic logic, int[] index)
- {
- OpenBitSetDISI result = InitialResult(reader, logic, index);
- for (; index[0] < chain.Length; index[0]++)
- {
- DoChain(result, logic, chain[index[0]].GetDocIdSet(reader));
- }
- return FinalResult(result, reader.MaxDoc());
- }
-
- /**
- * Delegates to each filter in the chain.
- * @param reader IndexReader
- * @param logic Logical operation
- * @return DocIdSet
- */
- private DocIdSet GetDocIdSet(IndexReader reader, Logic[] logic, int[] index)
- {
- if (logic.Length != chain.Length)
- throw new ArgumentException("Invalid number of elements in logic array");
-
- OpenBitSetDISI result = InitialResult(reader, logic[0], index);
- for (; index[0] < chain.Length; index[0]++)
- {
- DoChain(result, logic[index[0]], chain[index[0]].GetDocIdSet(reader));
- }
- return FinalResult(result, reader.MaxDoc());
- }
-
- public override String ToString()
- {
- StringBuilder sb = new StringBuilder();
- sb.Append("ChainedFilter: [");
- for (int i = 0; i < chain.Length; i++)
- {
- sb.Append(chain[i]);
- sb.Append(' ');
- }
- sb.Append(']');
- return sb.ToString();
- }
-
- private void DoChain(OpenBitSetDISI result, Logic logic, DocIdSet dis)
- {
-
- if (dis is OpenBitSet)
- {
- // optimized case for OpenBitSets
- switch (logic)
- {
- case Logic.OR:
- result.Or((OpenBitSet)dis);
- break;
- case Logic.AND:
- result.And((OpenBitSet)dis);
- break;
- case Logic.ANDNOT:
- result.AndNot((OpenBitSet)dis);
- break;
- case Logic.XOR:
- result.Xor((OpenBitSet)dis);
- break;
- default:
- DoChain(result, DEFAULT, dis);
- break;
- }
- }
- else
- {
- DocIdSetIterator disi;
- if (dis == null)
- {
- disi = DocIdSet.EMPTY_DOCIDSET.Iterator();
- }
- else
- {
- disi = dis.Iterator();
- if (disi == null)
- {
- disi = DocIdSet.EMPTY_DOCIDSET.Iterator();
- }
- }
-
- switch (logic)
- {
- case Logic.OR:
- result.InPlaceOr(disi);
- break;
- case Logic.AND:
- result.InPlaceAnd(disi);
- break;
- case Logic.ANDNOT:
- result.InPlaceNot(disi);
- break;
- case Logic.XOR:
- result.InPlaceXor(disi);
- break;
- default:
- DoChain(result, DEFAULT, dis);
- break;
- }
- }
- }
-
- }
-
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+using Lucene.Net.Search;
+using Lucene.Net.Index;
+using Lucene.Net.Util;
+
+namespace Lucene.Net.Analysis
+{
+
+ ///<summary>
+ ///* <p>
+ /// * Allows multiple {@link Filter}s to be chained.
+ /// * Logical operations such as <b>NOT</b> and <b>XOR</b>
+ /// * are applied between filters. One operation can be used
+ /// * for all filters, or a specific operation can be declared
+ /// * for each filter.
+ /// * </p>
+ /// * <p>
+ /// * Order in which filters are called depends on
+ /// * the position of the filter in the chain. It's probably
+ /// * more efficient to place the most restrictive filters
+ /// * /least computationally-intensive filters first.
+ /// * </p>
+ ///</summary>
+ public class ChainedFilter : Filter
+ {
+ public enum Logic
+ {
+ NONE = -1,
+ OR = 0,
+ AND = 1,
+ ANDNOT = 2,
+ XOR = 3
+ };
+
+ ///<summary>Logical operation when none is declared. Defaults to OR</summary>
+ public const Logic DEFAULT = Logic.OR;
+
+ /** The filter chain */
+ private Filter[] chain = null;
+
+ private Logic[] logicArray;
+
+ private Logic logic = Logic.NONE;
+
+ ///<summary>Ctor</summary><param name="chain">The chain of filters</param>
+ public ChainedFilter(Filter[] chain)
+ {
+ this.chain = chain;
+ }
+
+ ///<summary>ctor</summary>
+ ///<param name="chain">The chain of filters</param>
+ ///<param name="logicArray">Logical operations to apply between filters</param>
+ public ChainedFilter(Filter[] chain, Logic[] logicArray)
+ {
+ this.chain = chain;
+ this.logicArray = logicArray;
+ }
+
+ ///<summary>ctor</summary>
+ ///<param name="chain">The chain of filters</param>
+ ///<param name="logic">Logical operation to apply to ALL filters</param>
+ public ChainedFilter(Filter[] chain, Logic logic)
+ {
+ this.chain = chain;
+ this.logic = logic;
+ }
+
+ ///<see cref="Filter#getDocIdSet"/>
+ public override DocIdSet GetDocIdSet(IndexReader reader)
+ {
+ int[] index = new int[1]; // use array as reference to modifiable int;
+ index[0] = 0; // an object attribute would not be thread safe.
+ if (logic != Logic.NONE)
+ return GetDocIdSet(reader, logic, index);
+ else if (logicArray != null)
+ return GetDocIdSet(reader, logicArray, index);
+ else
+ return GetDocIdSet(reader, DEFAULT, index);
+ }
+
+ private DocIdSetIterator GetDISI(Filter filter, IndexReader reader)
+ {
+ DocIdSet docIdSet = filter.GetDocIdSet(reader);
+ if (docIdSet == null)
+ {
+ return DocIdSet.EMPTY_DOCIDSET.Iterator();
+ }
+ else
+ {
+ DocIdSetIterator iter = docIdSet.Iterator();
+ if (iter == null)
+ {
+ return DocIdSet.EMPTY_DOCIDSET.Iterator();
+ }
+ else
+ {
+ return iter;
+ }
+ }
+ }
+
+ private OpenBitSetDISI InitialResult(IndexReader reader, Logic logic, int[] index)
+ {
+ OpenBitSetDISI result;
+ /**
+ * First AND operation takes place against a completely false
+ * bitset and will always return zero results.
+ */
+ if (logic == Logic.AND)
+ {
+ result = new OpenBitSetDISI(GetDISI(chain[index[0]], reader), reader.MaxDoc());
+ ++index[0];
+ }
+ else if (logic == Logic.ANDNOT)
+ {
+ result = new OpenBitSetDISI(GetDISI(chain[index[0]], reader), reader.MaxDoc());
+ result.Flip(0, reader.MaxDoc()); // NOTE: may set bits for deleted docs.
+ ++index[0];
+ }
+ else
+ {
+ result = new OpenBitSetDISI(reader.MaxDoc());
+ }
+ return result;
+ }
+
+
+ ///<summary>
+ /// * Provide a SortedVIntList when it is definitely
+ /// * smaller than an OpenBitSet
+ /// * @deprecated Either use CachingWrapperFilter, or
+ /// * switch to a different DocIdSet implementation yourself.
+ /// * This method will be removed in Lucene 4.0
+ ///</summary>
+ protected DocIdSet FinalResult(OpenBitSetDISI result, int maxDocs)
+ {
+ return result;
+ }
+
+
+ /**
+ * Delegates to each filter in the chain.
+ * @param reader IndexReader
+ * @param logic Logical operation
+ * @return DocIdSet
+ */
+ private DocIdSet GetDocIdSet(IndexReader reader, Logic logic, int[] index)
+ {
+ OpenBitSetDISI result = InitialResult(reader, logic, index);
+ for (; index[0] < chain.Length; index[0]++)
+ {
+ DoChain(result, logic, chain[index[0]].GetDocIdSet(reader));
+ }
+ return FinalResult(result, reader.MaxDoc());
+ }
+
+ /**
+ * Delegates to each filter in the chain.
+ * @param reader IndexReader
+ * @param logic Logical operation
+ * @return DocIdSet
+ */
+ private DocIdSet GetDocIdSet(IndexReader reader, Logic[] logic, int[] index)
+ {
+ if (logic.Length != chain.Length)
+ throw new ArgumentException("Invalid number of elements in logic array");
+
+ OpenBitSetDISI result = InitialResult(reader, logic[0], index);
+ for (; index[0] < chain.Length; index[0]++)
+ {
+ DoChain(result, logic[index[0]], chain[index[0]].GetDocIdSet(reader));
+ }
+ return FinalResult(result, reader.MaxDoc());
+ }
+
+ public override String ToString()
+ {
+ StringBuilder sb = new StringBuilder();
+ sb.Append("ChainedFilter: [");
+ for (int i = 0; i < chain.Length; i++)
+ {
+ sb.Append(chain[i]);
+ sb.Append(' ');
+ }
+ sb.Append(']');
+ return sb.ToString();
+ }
+
+ private void DoChain(OpenBitSetDISI result, Logic logic, DocIdSet dis)
+ {
+
+ if (dis is OpenBitSet)
+ {
+ // optimized case for OpenBitSets
+ switch (logic)
+ {
+ case Logic.OR:
+ result.Or((OpenBitSet)dis);
+ break;
+ case Logic.AND:
+ result.And((OpenBitSet)dis);
+ break;
+ case Logic.ANDNOT:
+ result.AndNot((OpenBitSet)dis);
+ break;
+ case Logic.XOR:
+ result.Xor((OpenBitSet)dis);
+ break;
+ default:
+ DoChain(result, DEFAULT, dis);
+ break;
+ }
+ }
+ else
+ {
+ DocIdSetIterator disi;
+ if (dis == null)
+ {
+ disi = DocIdSet.EMPTY_DOCIDSET.Iterator();
+ }
+ else
+ {
+ disi = dis.Iterator();
+ if (disi == null)
+ {
+ disi = DocIdSet.EMPTY_DOCIDSET.Iterator();
+ }
+ }
+
+ switch (logic)
+ {
+ case Logic.OR:
+ result.InPlaceOr(disi);
+ break;
+ case Logic.AND:
+ result.InPlaceAnd(disi);
+ break;
+ case Logic.ANDNOT:
+ result.InPlaceNot(disi);
+ break;
+ case Logic.XOR:
+ result.InPlaceXor(disi);
+ break;
+ default:
+ DoChain(result, DEFAULT, dis);
+ break;
+ }
+ }
+ }
+
+ }
+
}
\ No newline at end of file
Propchange: incubator/lucene.net/trunk/src/contrib/Analyzers/Filters/ChainedFilter.cs
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/lucene.net/trunk/src/contrib/Core/Analysis/Ext/Analysis.Ext.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/src/contrib/Core/Analysis/Ext/Analysis.Ext.cs?rev=1344562&r1=1344561&r2=1344562&view=diff
==============================================================================
Binary files - no diff available.
Propchange: incubator/lucene.net/trunk/src/contrib/Core/Analysis/Ext/Analysis.Ext.cs
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/lucene.net/trunk/src/contrib/Core/Analysis/Ext/Analysis.Ext.cs
('svn:mime-type' removed)
Modified: incubator/lucene.net/trunk/src/contrib/Memory/CollectionsHelper.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/src/contrib/Memory/CollectionsHelper.cs?rev=1344562&r1=1344561&r2=1344562&view=diff
==============================================================================
--- incubator/lucene.net/trunk/src/contrib/Memory/CollectionsHelper.cs (original)
+++ incubator/lucene.net/trunk/src/contrib/Memory/CollectionsHelper.cs Thu May 31 04:33:41 2012
@@ -1,85 +1,85 @@
-using System;
-using System.Collections;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-
-namespace Lucene.Net.Index.Memory
-{
- internal static class CollectionsHelper<T>
- {
- private static readonly T[] EmptyArray = new T[0];
-
- /// <summary>
- /// Returns an empty list of type T
- /// </summary>
- public static IList<T> EmptyList()
- {
- return EmptyArray;
- }
- }
-
- public static class CollectionsExtensions
- {
- public static ICollection<T> AsReadOnly<T>(this ICollection<T> collection)
- {
- return new ReadOnlyCollection<T>(collection);
- }
-
- private sealed class ReadOnlyCollection<T> : ICollection<T>
- {
- private readonly ICollection<T> _other;
-
- public ReadOnlyCollection(ICollection<T> other)
- {
- _other = other;
- }
-
- public IEnumerator<T> GetEnumerator()
- {
- return _other.GetEnumerator();
- }
-
- IEnumerator IEnumerable.GetEnumerator()
- {
- return GetEnumerator();
- }
-
- public void Add(T item)
- {
- throw new NotSupportedException("Collection is read only!");
- }
-
- public void Clear()
- {
- throw new NotSupportedException("Collection is read only!");
- }
-
- public bool Contains(T item)
- {
- return _other.Contains(item);
- }
-
- public void CopyTo(T[] array, int arrayIndex)
- {
- _other.CopyTo(array, arrayIndex);
- }
-
- public bool Remove(T item)
- {
- throw new NotSupportedException("Collection is read only!");
- }
-
- public int Count
- {
- get { return _other.Count; }
- }
-
- public bool IsReadOnly
- {
- get { return true; }
- }
- }
- }
-}
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Lucene.Net.Index.Memory
+{
+ internal static class CollectionsHelper<T>
+ {
+ private static readonly T[] EmptyArray = new T[0];
+
+ /// <summary>
+ /// Returns an empty list of type T
+ /// </summary>
+ public static IList<T> EmptyList()
+ {
+ return EmptyArray;
+ }
+ }
+
+ public static class CollectionsExtensions
+ {
+ public static ICollection<T> AsReadOnly<T>(this ICollection<T> collection)
+ {
+ return new ReadOnlyCollection<T>(collection);
+ }
+
+ private sealed class ReadOnlyCollection<T> : ICollection<T>
+ {
+ private readonly ICollection<T> _other;
+
+ public ReadOnlyCollection(ICollection<T> other)
+ {
+ _other = other;
+ }
+
+ public IEnumerator<T> GetEnumerator()
+ {
+ return _other.GetEnumerator();
+ }
+
+ IEnumerator IEnumerable.GetEnumerator()
+ {
+ return GetEnumerator();
+ }
+
+ public void Add(T item)
+ {
+ throw new NotSupportedException("Collection is read only!");
+ }
+
+ public void Clear()
+ {
+ throw new NotSupportedException("Collection is read only!");
+ }
+
+ public bool Contains(T item)
+ {
+ return _other.Contains(item);
+ }
+
+ public void CopyTo(T[] array, int arrayIndex)
+ {
+ _other.CopyTo(array, arrayIndex);
+ }
+
+ public bool Remove(T item)
+ {
+ throw new NotSupportedException("Collection is read only!");
+ }
+
+ public int Count
+ {
+ get { return _other.Count; }
+ }
+
+ public bool IsReadOnly
+ {
+ get { return true; }
+ }
+ }
+ }
+}
Propchange: incubator/lucene.net/trunk/src/contrib/Memory/CollectionsHelper.cs
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/lucene.net/trunk/src/contrib/Memory/EmptyCollector.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/src/contrib/Memory/EmptyCollector.cs?rev=1344562&r1=1344561&r2=1344562&view=diff
==============================================================================
--- incubator/lucene.net/trunk/src/contrib/Memory/EmptyCollector.cs (original)
+++ incubator/lucene.net/trunk/src/contrib/Memory/EmptyCollector.cs Thu May 31 04:33:41 2012
@@ -1,45 +1,45 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using Lucene.Net.Search;
-
-namespace Lucene.Net.Index.Memory
-{
- public partial class MemoryIndex
- {
- /// <summary>
- /// Fills the given float array with the values
- /// as the collector scores the search
- /// </summary>
- private sealed class FillingCollector : Collector
- {
- private readonly float[] _scores;
- private Scorer _scorer;
-
- public FillingCollector(float[] scores)
- {
- _scores = scores;
- }
-
- public override void SetScorer(Scorer scorer)
- {
- _scorer = scorer;
- }
-
- public override void Collect(int doc)
- {
- _scores[0] = _scorer.Score();
- }
-
- public override void SetNextReader(IndexReader reader, int docBase)
- { }
-
- public override bool AcceptsDocsOutOfOrder
- {
- get { return true; }
- }
- }
- }
-}
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using Lucene.Net.Search;
+
+namespace Lucene.Net.Index.Memory
+{
+ public partial class MemoryIndex
+ {
+ /// <summary>
+ /// Fills the given float array with the values
+ /// as the collector scores the search
+ /// </summary>
+ private sealed class FillingCollector : Collector
+ {
+ private readonly float[] _scores;
+ private Scorer _scorer;
+
+ public FillingCollector(float[] scores)
+ {
+ _scores = scores;
+ }
+
+ public override void SetScorer(Scorer scorer)
+ {
+ _scorer = scorer;
+ }
+
+ public override void Collect(int doc)
+ {
+ _scores[0] = _scorer.Score();
+ }
+
+ public override void SetNextReader(IndexReader reader, int docBase)
+ { }
+
+ public override bool AcceptsDocsOutOfOrder
+ {
+ get { return true; }
+ }
+ }
+ }
+}
Propchange: incubator/lucene.net/trunk/src/contrib/Memory/EmptyCollector.cs
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/lucene.net/trunk/src/contrib/Memory/KeywordTokenStream.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/src/contrib/Memory/KeywordTokenStream.cs?rev=1344562&r1=1344561&r2=1344562&view=diff
==============================================================================
--- incubator/lucene.net/trunk/src/contrib/Memory/KeywordTokenStream.cs (original)
+++ incubator/lucene.net/trunk/src/contrib/Memory/KeywordTokenStream.cs Thu May 31 04:33:41 2012
@@ -1,48 +1,48 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using Lucene.Net.Analysis;
-using Lucene.Net.Analysis.Tokenattributes;
-
-namespace Lucene.Net.Index.Memory
-{
- public partial class MemoryIndex
- {
- private sealed class KeywordTokenStream<T> : TokenStream
- {
- private IEnumerator<T> iter;
- private int start = 0;
- private ITermAttribute termAtt;
- private IOffsetAttribute offsetAtt;
-
- public KeywordTokenStream(IEnumerable<T> keywords)
- {
- iter = keywords.GetEnumerator();
- termAtt = AddAttribute<ITermAttribute>();
- offsetAtt = AddAttribute<IOffsetAttribute>();
- }
-
- public override bool IncrementToken()
- {
- if (!iter.MoveNext()) return false;
-
- T obj = iter.Current;
- if (obj == null)
- throw new ArgumentException("keyword must not be null");
-
- String term = obj.ToString();
- ClearAttributes();
- termAtt.SetTermBuffer(term);
- offsetAtt.SetOffset(start, start + termAtt.TermLength());
- start += term.Length + 1; // separate words by 1 (blank) character
- return true;
- }
-
- protected override void Dispose(bool disposing)
- {
- }
- }
- }
-}
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using Lucene.Net.Analysis;
+using Lucene.Net.Analysis.Tokenattributes;
+
+namespace Lucene.Net.Index.Memory
+{
+ public partial class MemoryIndex
+ {
+ private sealed class KeywordTokenStream<T> : TokenStream
+ {
+ private IEnumerator<T> iter;
+ private int start = 0;
+ private ITermAttribute termAtt;
+ private IOffsetAttribute offsetAtt;
+
+ public KeywordTokenStream(IEnumerable<T> keywords)
+ {
+ iter = keywords.GetEnumerator();
+ termAtt = AddAttribute<ITermAttribute>();
+ offsetAtt = AddAttribute<IOffsetAttribute>();
+ }
+
+ public override bool IncrementToken()
+ {
+ if (!iter.MoveNext()) return false;
+
+ T obj = iter.Current;
+ if (obj == null)
+ throw new ArgumentException("keyword must not be null");
+
+ String term = obj.ToString();
+ ClearAttributes();
+ termAtt.SetTermBuffer(term);
+ offsetAtt.SetOffset(start, start + termAtt.TermLength());
+ start += term.Length + 1; // separate words by 1 (blank) character
+ return true;
+ }
+
+ protected override void Dispose(bool disposing)
+ {
+ }
+ }
+ }
+}
Propchange: incubator/lucene.net/trunk/src/contrib/Memory/KeywordTokenStream.cs
------------------------------------------------------------------------------
svn:eol-style = native