lucenenet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject [Lucene.Net] svn commit: r1100824 - in /incubator/lucene.net/branches/Lucene.Net_2_9_4g: src/core/Analysis/ src/core/Index/ src/core/Search/ test/core/Analysis/ test/core/Support/
Date Sun, 08 May 2011 21:53:41 GMT
Author: digy
Date: Sun May  8 21:53:40 2011
New Revision: 1100824

URL: http://svn.apache.org/viewvc?rev=1100824&view=rev
Log:
[LUCENENET-412]

Modified:
    incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/core/Analysis/CharArraySet.cs
    incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/core/Analysis/SinkTokenizer.cs
    incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/core/Analysis/StopFilter.cs
    incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/core/Analysis/TeeSinkTokenFilter.cs
    incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/core/Analysis/TokenStream.cs
    incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/core/Index/SortedTermVectorMapper.cs
    incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/core/Search/BooleanQuery.cs
    incubator/lucene.net/branches/Lucene.Net_2_9_4g/test/core/Analysis/TestTeeTokenFilter.cs
    incubator/lucene.net/branches/Lucene.Net_2_9_4g/test/core/Support/SupportTestCases.cs

Modified: incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/core/Analysis/CharArraySet.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/core/Analysis/CharArraySet.cs?rev=1100824&r1=1100823&r2=1100824&view=diff
==============================================================================
--- incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/core/Analysis/CharArraySet.cs (original)
+++ incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/core/Analysis/CharArraySet.cs Sun
May  8 21:53:40 2011
@@ -31,7 +31,7 @@ namespace Lucene.Net.Analysis
 	/// to a String first.
 	/// </summary>
 	
-	public class CharArraySet : List<string> //:System.Collections.Hashtable
+	public class CharArraySet : List<string> 
 	{
 		public new int Count
 		{

Modified: incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/core/Analysis/SinkTokenizer.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/core/Analysis/SinkTokenizer.cs?rev=1100824&r1=1100823&r2=1100824&view=diff
==============================================================================
--- incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/core/Analysis/SinkTokenizer.cs (original)
+++ incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/core/Analysis/SinkTokenizer.cs Sun
May  8 21:53:40 2011
@@ -16,6 +16,7 @@
  */
 
 using System;
+using System.Collections.Generic;
 
 namespace Lucene.Net.Analysis
 {
@@ -36,24 +37,24 @@ namespace Lucene.Net.Analysis
     [Obsolete("Use TeeSinkTokenFilter instead")]
 	public class SinkTokenizer:Tokenizer
 	{
-		protected internal System.Collections.IList lst = new System.Collections.ArrayList();
-		protected internal System.Collections.IEnumerator iter;
+        protected internal List<Token> lst = new List<Token>();
+		protected internal IEnumerator<Token> iter;
 		
-		public SinkTokenizer(System.Collections.IList input)
+		public SinkTokenizer(List<Token> input)
 		{
 			this.lst = input;
-			if (this.lst == null)
-				this.lst = new System.Collections.ArrayList();
+            if (this.lst == null)
+                this.lst = new List<Token>();
 		}
 		
 		public SinkTokenizer()
 		{
-			this.lst = new System.Collections.ArrayList();
+            this.lst = new List<Token>();
 		}
 		
 		public SinkTokenizer(int initCap)
 		{
-			this.lst = new System.Collections.ArrayList(initCap);
+            this.lst = new List<Token>(initCap);
 		}
 		
 		/// <summary> Get the tokens in the internal List.
@@ -85,7 +86,7 @@ namespace Lucene.Net.Analysis
 			// Since this TokenStream can be reset we have to maintain the tokens as immutable
 			if (iter.MoveNext())
 			{
-				Token nextToken = (Token) iter.Current;
+				Token nextToken = iter.Current;
 				return (Token) nextToken.Clone();
 			}
 			return null;

Modified: incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/core/Analysis/StopFilter.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/core/Analysis/StopFilter.cs?rev=1100824&r1=1100823&r2=1100824&view=diff
==============================================================================
--- incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/core/Analysis/StopFilter.cs (original)
+++ incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/core/Analysis/StopFilter.cs Sun May
 8 21:53:40 2011
@@ -58,7 +58,7 @@ namespace Lucene.Net.Analysis
 		/// </param>
 		/// <deprecated> Use {@link #StopFilter(boolean, TokenStream, Set)} instead.
 		/// </deprecated>
-        [Obsolete("Use StopFilter(bool, TokenStream, Hashtable) instead.")]
+        [Obsolete("Use StopFilter(bool, TokenStream, List<string>) instead.")]
 		public StopFilter(bool enablePositionIncrements, TokenStream input, System.String[] stopWords):this(enablePositionIncrements,
input, stopWords, false)
 		{
 		}
@@ -86,7 +86,7 @@ namespace Lucene.Net.Analysis
 		/// </param>
 		/// <deprecated> Use {@link #StopFilter(boolean, TokenStream, Set, boolean)} instead.
 		/// </deprecated>
-        [Obsolete("Use StopFilter(bool, TokenStream, Hashtable, bool) instead.")]
+        [Obsolete("Use StopFilter(bool, TokenStream, List<string>, bool) instead.")]
 		public StopFilter(bool enablePositionIncrements, TokenStream in_Renamed, System.String[]
stopWords, bool ignoreCase):base(in_Renamed)
 		{
 			this.stopWords = (CharArraySet) MakeStopSet(stopWords, ignoreCase);
@@ -161,7 +161,7 @@ namespace Lucene.Net.Analysis
 		/// </seealso>
 		/// <deprecated> Use {@link #StopFilter(boolean, TokenStream, Set)} instead
 		/// </deprecated>
-        [Obsolete("Use StopFilter(bool, TokenStream, Hashtable) instead")]
+        [Obsolete("Use StopFilter(bool, TokenStream, List<string>) instead")]
         public StopFilter(TokenStream in_Renamed, List<string> stopWords) : this(ENABLE_POSITION_INCREMENTS_DEFAULT,
in_Renamed, stopWords, false)
 		{
 		}

Modified: incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/core/Analysis/TeeSinkTokenFilter.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/core/Analysis/TeeSinkTokenFilter.cs?rev=1100824&r1=1100823&r2=1100824&view=diff
==============================================================================
--- incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/core/Analysis/TeeSinkTokenFilter.cs
(original)
+++ incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/core/Analysis/TeeSinkTokenFilter.cs
Sun May  8 21:53:40 2011
@@ -16,6 +16,7 @@
  */
 
 using System;
+using System.Collections.Generic;
 
 using AttributeImpl = Lucene.Net.Util.AttributeImpl;
 using AttributeSource = Lucene.Net.Util.AttributeSource;
@@ -74,7 +75,7 @@ namespace Lucene.Net.Analysis
 				return true;
 			}
 		}
-		private System.Collections.IList sinks = new System.Collections.ArrayList();
+        private List<WeakReference> sinks = new List<WeakReference>();
 		
 		/// <summary> Instantiates a new TeeSinkTokenFilter.</summary>
 		public TeeSinkTokenFilter(TokenStream input):base(input)
@@ -135,9 +136,9 @@ namespace Lucene.Net.Analysis
 			{
 				// capture state lazily - maybe no SinkFilter accepts this state
 				AttributeSource.State state = null;
-				for (System.Collections.IEnumerator it = sinks.GetEnumerator(); it.MoveNext(); )
+                foreach(WeakReference wr in sinks)
 				{
-					SinkTokenStream sink = (SinkTokenStream) ((System.WeakReference) it.Current).Target;
+					SinkTokenStream sink = (SinkTokenStream) wr.Target;
 					if (sink != null)
 					{
 						if (sink.Accept(this))
@@ -160,9 +161,9 @@ namespace Lucene.Net.Analysis
 		{
 			base.End();
 			AttributeSource.State finalState = CaptureState();
-			for (System.Collections.IEnumerator it = sinks.GetEnumerator(); it.MoveNext(); )
+            foreach(WeakReference wr in sinks)
 			{
-				SinkTokenStream sink = (SinkTokenStream) ((System.WeakReference) it.Current).Target;
+				SinkTokenStream sink = (SinkTokenStream) wr.Target;
 				if (sink != null)
 				{
 					sink.SetFinalState(finalState);
@@ -189,9 +190,9 @@ namespace Lucene.Net.Analysis
 		
 		public sealed class SinkTokenStream:TokenStream
 		{
-			private System.Collections.IList cachedStates = new System.Collections.ArrayList();
+            private List<AttributeSource.State> cachedStates = new List<State>();
 			private AttributeSource.State finalState;
-			private System.Collections.IEnumerator it = null;
+			private IEnumerator<AttributeSource.State> it = null;
 			private SinkFilter filter;
 			
 			internal SinkTokenStream(AttributeSource source, SinkFilter filter):base(source)

Modified: incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/core/Analysis/TokenStream.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/core/Analysis/TokenStream.cs?rev=1100824&r1=1100823&r2=1100824&view=diff
==============================================================================
--- incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/core/Analysis/TokenStream.cs (original)
+++ incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/core/Analysis/TokenStream.cs Sun May
 8 21:53:40 2011
@@ -145,7 +145,7 @@ namespace Lucene.Net.Analysis
 		/// <deprecated> Remove this when old API is removed! 
 		/// </deprecated>
         [Obsolete("Remove this when old API is removed! ")]
-		private static readonly System.Collections.Hashtable knownMethodSupport = new System.Collections.Hashtable();
+        private static readonly Support.Dictionary<Type, MethodSupport> knownMethodSupport
= new Support.Dictionary<Type, MethodSupport>();
 
         // {{Aroush-2.9 Port issue, need to mimic java's IdentityHashMap
         /*
@@ -167,7 +167,7 @@ namespace Lucene.Net.Analysis
 			MethodSupport supportedMethods;
 			lock (knownMethodSupport)
 			{
-				supportedMethods = (MethodSupport) knownMethodSupport[clazz];
+				supportedMethods = knownMethodSupport[clazz];
 				if (supportedMethods == null)
 				{
 					knownMethodSupport.Add(clazz, supportedMethods = new MethodSupport(clazz));

Modified: incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/core/Index/SortedTermVectorMapper.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/core/Index/SortedTermVectorMapper.cs?rev=1100824&r1=1100823&r2=1100824&view=diff
==============================================================================
--- incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/core/Index/SortedTermVectorMapper.cs
(original)
+++ incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/core/Index/SortedTermVectorMapper.cs
Sun May  8 21:53:40 2011
@@ -34,7 +34,7 @@ namespace Lucene.Net.Index
 
 
         private SortedSet<TermVectorEntry> currentSet;
-		private System.Collections.IDictionary termToTVE = new System.Collections.Hashtable();
+		private Support.Dictionary<string,TermVectorEntry> termToTVE = new Support.Dictionary<string,TermVectorEntry>();
 		private bool storeOffsets;
 		private bool storePositions;
 		/// <summary> Stand-in name for the field in {@link TermVectorEntry}.</summary>
@@ -63,9 +63,9 @@ namespace Lucene.Net.Index
 		/// <param name="positions">Position information, may be null
 		/// </param>
 		//We need to combine any previous mentions of the term
-		public override void  Map(System.String term, int frequency, TermVectorOffsetInfo[] offsets,
int[] positions)
+		public override void  Map(string term, int frequency, TermVectorOffsetInfo[] offsets, int[]
positions)
 		{
-			TermVectorEntry entry = (TermVectorEntry) termToTVE[term];
+			TermVectorEntry entry = termToTVE[term];
 			if (entry == null)
 			{
 				entry = new TermVectorEntry(ALL, term, frequency, storeOffsets == true?offsets:null,
storePositions == true?positions:null);

Modified: incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/core/Search/BooleanQuery.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/core/Search/BooleanQuery.cs?rev=1100824&r1=1100823&r2=1100824&view=diff
==============================================================================
--- incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/core/Search/BooleanQuery.cs (original)
+++ incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/core/Search/BooleanQuery.cs Sun May
 8 21:53:40 2011
@@ -307,12 +307,12 @@ namespace Lucene.Net.Search
 				float sum = 0.0f;
 				bool fail = false;
 				int shouldMatchCount = 0;
-				for (System.Collections.IEnumerator wIter = weights.GetEnumerator(), cIter = Enclosing_Instance.clauses.GetEnumerator();
wIter.MoveNext(); )
+                IEnumerator<BooleanClause> cIter = Enclosing_Instance.clauses.GetEnumerator();
+                foreach(Weight w in weights)
 				{
                     cIter.MoveNext();
 
-                    Weight w = (Weight)wIter.Current;
-					BooleanClause c = (BooleanClause) cIter.Current;
+					BooleanClause c = cIter.Current;
 					if (w.Scorer(reader, true, true) == null)
 					{
 						continue;
@@ -385,12 +385,12 @@ namespace Lucene.Net.Search
                 List<Scorer> required = new List<Scorer>();
                 List<Scorer> prohibited = new List<Scorer>();
                 List<Scorer> optional = new List<Scorer>();
-				for (System.Collections.IEnumerator wIter = weights.GetEnumerator(), cIter = Enclosing_Instance.clauses.GetEnumerator();
wIter.MoveNext(); )
+                IEnumerator<BooleanClause> cIter = Enclosing_Instance.clauses.GetEnumerator();
+                foreach(Weight w in weights)
 				{
                     cIter.MoveNext();
 
-					Weight w = (Weight) wIter.Current;
-					BooleanClause c = (BooleanClause) cIter.Current;
+					BooleanClause c = cIter.Current;
 					Scorer subScorer = w.Scorer(reader, true, false);
 					if (subScorer == null)
 					{

Modified: incubator/lucene.net/branches/Lucene.Net_2_9_4g/test/core/Analysis/TestTeeTokenFilter.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/branches/Lucene.Net_2_9_4g/test/core/Analysis/TestTeeTokenFilter.cs?rev=1100824&r1=1100823&r2=1100824&view=diff
==============================================================================
--- incubator/lucene.net/branches/Lucene.Net_2_9_4g/test/core/Analysis/TestTeeTokenFilter.cs
(original)
+++ incubator/lucene.net/branches/Lucene.Net_2_9_4g/test/core/Analysis/TestTeeTokenFilter.cs
Sun May  8 21:53:40 2011
@@ -16,6 +16,7 @@
  */
 
 using System;
+using System.Collections.Generic;
 
 using NUnit.Framework;
 
@@ -46,7 +47,7 @@ namespace Lucene.Net.Analysis
 				}
 				
 			}
-			internal AnonymousClassSinkTokenizer(TestTeeTokenFilter enclosingInstance, System.Collections.IList
Param1):base(Param1)
+			internal AnonymousClassSinkTokenizer(TestTeeTokenFilter enclosingInstance, List<Token>
Param1):base(Param1)
 			{
 				InitBlock(enclosingInstance);
 			}
@@ -73,7 +74,7 @@ namespace Lucene.Net.Analysis
 				}
 				
 			}
-			internal AnonymousClassSinkTokenizer1(TestTeeTokenFilter enclosingInstance, System.Collections.IList
Param1):base(Param1)
+			internal AnonymousClassSinkTokenizer1(TestTeeTokenFilter enclosingInstance, List<Token>
Param1):base(Param1)
 			{
 				InitBlock(enclosingInstance);
 			}
@@ -100,7 +101,7 @@ namespace Lucene.Net.Analysis
 				}
 				
 			}
-			internal AnonymousClassSinkTokenizer2(TestTeeTokenFilter enclosingInstance, System.Collections.IList
Param1):base(Param1)
+			internal AnonymousClassSinkTokenizer2(TestTeeTokenFilter enclosingInstance, List<Token>
Param1):base(Param1)
 			{
 				InitBlock(enclosingInstance);
 			}
@@ -367,7 +368,7 @@ namespace Lucene.Net.Analysis
 			{
 				InitBlock(enclosingInstance);
 				modCount = mc;
-				lst = new System.Collections.ArrayList(numToks % mc);
+				lst = new List<Token>(numToks % mc);
 			}
 			
 			public override void  Add(Token t)

Modified: incubator/lucene.net/branches/Lucene.Net_2_9_4g/test/core/Support/SupportTestCases.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/branches/Lucene.Net_2_9_4g/test/core/Support/SupportTestCases.cs?rev=1100824&r1=1100823&r2=1100824&view=diff
==============================================================================
--- incubator/lucene.net/branches/Lucene.Net_2_9_4g/test/core/Support/SupportTestCases.cs
(original)
+++ incubator/lucene.net/branches/Lucene.Net_2_9_4g/test/core/Support/SupportTestCases.cs
Sun May  8 21:53:40 2011
@@ -41,7 +41,7 @@ namespace Lucene.Net.Support
                     object[] o2 = mi.GetCustomAttributes(typeof(NUnit.Framework.TestAttribute),
true);
                     if (o2 == null || o2.Length == 0) continue;
 
-                    if (type.FullName.StartsWith("Lucene.Net._SupportClass"))
+                    if (type.FullName.StartsWith("Lucene.Net.Support"))
                     {
                         countSupport++;
                     }



Mime
View raw message