lucenenet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aro...@apache.org
Subject svn commit: r516652 - in /incubator/lucene.net/trunk/C#/src/Lucene.Net: Analysis/Tokenizer.cs Index/TermVectorsWriter.cs QueryParser/QueryParser.cs Search/FieldCacheImpl.cs Search/PhraseQuery.cs Search/TermQuery.cs SupportClass.cs
Date Sat, 10 Mar 2007 05:05:53 GMT
Author: aroush
Date: Fri Mar  9 21:05:52 2007
New Revision: 516652

URL: http://svn.apache.org/viewvc?view=rev&rev=516652
Log:
Fixed a number of JIRA issues: LUCENENET-36, LUCENENET-35, LUCENENET-33, LUCENENET-32, LUCENENET-31,
and LUCENENET-30.

Modified:
    incubator/lucene.net/trunk/C#/src/Lucene.Net/Analysis/Tokenizer.cs
    incubator/lucene.net/trunk/C#/src/Lucene.Net/Index/TermVectorsWriter.cs
    incubator/lucene.net/trunk/C#/src/Lucene.Net/QueryParser/QueryParser.cs
    incubator/lucene.net/trunk/C#/src/Lucene.Net/Search/FieldCacheImpl.cs
    incubator/lucene.net/trunk/C#/src/Lucene.Net/Search/PhraseQuery.cs
    incubator/lucene.net/trunk/C#/src/Lucene.Net/Search/TermQuery.cs
    incubator/lucene.net/trunk/C#/src/Lucene.Net/SupportClass.cs

Modified: incubator/lucene.net/trunk/C#/src/Lucene.Net/Analysis/Tokenizer.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/C%23/src/Lucene.Net/Analysis/Tokenizer.cs?view=diff&rev=516652&r1=516651&r2=516652
==============================================================================
--- incubator/lucene.net/trunk/C#/src/Lucene.Net/Analysis/Tokenizer.cs (original)
+++ incubator/lucene.net/trunk/C#/src/Lucene.Net/Analysis/Tokenizer.cs Fri Mar  9 21:05:52
2007
@@ -44,7 +44,10 @@
 		/// <summary>By default, closes the input Reader. </summary>
 		public override void  Close()
 		{
-			input.Close();
+			if (input != null)
+			{
+				input.Close();
+			}
 		}
 	}
 }

Modified: incubator/lucene.net/trunk/C#/src/Lucene.Net/Index/TermVectorsWriter.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/C%23/src/Lucene.Net/Index/TermVectorsWriter.cs?view=diff&rev=516652&r1=516651&r2=516652
==============================================================================
--- incubator/lucene.net/trunk/C#/src/Lucene.Net/Index/TermVectorsWriter.cs (original)
+++ incubator/lucene.net/trunk/C#/src/Lucene.Net/Index/TermVectorsWriter.cs Fri Mar  9 21:05:52
2007
@@ -218,7 +218,7 @@
 					bool storePositionWithTermVector = false;
 					bool storeOffsetWithTermVector = false;
 					
-					try
+					if (vectors[i] is TermPositionVector)
 					{
 						
 						TermPositionVector tpVector = (TermPositionVector) vectors[i];
@@ -236,7 +236,7 @@
 						
 						CloseField();
 					}
-					catch (System.InvalidCastException ignore)
+					else
 					{
 						
 						TermFreqVector tfVector = vectors[i];

Modified: incubator/lucene.net/trunk/C#/src/Lucene.Net/QueryParser/QueryParser.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/C%23/src/Lucene.Net/QueryParser/QueryParser.cs?view=diff&rev=516652&r1=516651&r2=516652
==============================================================================
--- incubator/lucene.net/trunk/C#/src/Lucene.Net/QueryParser/QueryParser.cs (original)
+++ incubator/lucene.net/trunk/C#/src/Lucene.Net/QueryParser/QueryParser.cs Fri Mar  9 21:05:52
2007
@@ -1021,7 +1021,8 @@
 						float fms = fuzzyMinSim;
 						try
 						{
-							fms = (float) System.Single.Parse(fuzzySlop.image.Substring(1));
+							fms = (float) System.Single.Parse(fuzzySlop.image.Substring(1).Replace(".", 
+								System.Globalization.CultureInfo.CurrentCulture.NumberFormat.NumberDecimalSeparator));
 						}
 						catch (System.Exception ignored)
 						{

Modified: incubator/lucene.net/trunk/C#/src/Lucene.Net/Search/FieldCacheImpl.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/C%23/src/Lucene.Net/Search/FieldCacheImpl.cs?view=diff&rev=516652&r1=516651&r2=516652
==============================================================================
--- incubator/lucene.net/trunk/C#/src/Lucene.Net/Search/FieldCacheImpl.cs (original)
+++ incubator/lucene.net/trunk/C#/src/Lucene.Net/Search/FieldCacheImpl.cs Fri Mar  9 21:05:52
2007
@@ -265,14 +265,7 @@
 						if (term == null || term.Field() != field)
 							break;
 						float termval;
-                        try
-                        {
-                            termval = SupportClass.Single.Parse(term.Text());
-                        }
-                        catch (Exception e)
-                        {
-                            termval = 0;
-                        }
+						termval = SupportClass.Single.Parse(term.Text());
 						termDocs.Seek(termEnum);
 						while (termDocs.Next())
 						{

Modified: incubator/lucene.net/trunk/C#/src/Lucene.Net/Search/PhraseQuery.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/C%23/src/Lucene.Net/Search/PhraseQuery.cs?view=diff&rev=516652&r1=516651&r2=516652
==============================================================================
--- incubator/lucene.net/trunk/C#/src/Lucene.Net/Search/PhraseQuery.cs (original)
+++ incubator/lucene.net/trunk/C#/src/Lucene.Net/Search/PhraseQuery.cs Fri Mar  9 21:05:52
2007
@@ -286,7 +286,10 @@
 		{
 			foreach (Term term in terms)
 			{
-				queryTerms.Add(term, term);
+				if (queryTerms.Contains(term) == false)
+				{
+					queryTerms.Add(term, term);
+				}
 			}
 		}
 		

Modified: incubator/lucene.net/trunk/C#/src/Lucene.Net/Search/TermQuery.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/C%23/src/Lucene.Net/Search/TermQuery.cs?view=diff&rev=516652&r1=516651&r2=516652
==============================================================================
--- incubator/lucene.net/trunk/C#/src/Lucene.Net/Search/TermQuery.cs (original)
+++ incubator/lucene.net/trunk/C#/src/Lucene.Net/Search/TermQuery.cs Fri Mar  9 21:05:52 2007
@@ -171,8 +171,11 @@
 		
 		public override void  ExtractTerms(System.Collections.Hashtable terms)
 		{
-            Term term = GetTerm();
-			terms.Add(term, term);
+			Term term = GetTerm();
+			if (terms.Contains(term) == false)
+			{
+				terms.Add(term, term);
+			}
 		}
 		
 		/// <summary>Prints a user-readable version of this query. </summary>

Modified: incubator/lucene.net/trunk/C#/src/Lucene.Net/SupportClass.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/C%23/src/Lucene.Net/SupportClass.cs?view=diff&rev=516652&r1=516651&r2=516652
==============================================================================
--- incubator/lucene.net/trunk/C#/src/Lucene.Net/SupportClass.cs (original)
+++ incubator/lucene.net/trunk/C#/src/Lucene.Net/SupportClass.cs Fri Mar  9 21:05:52 2007
@@ -590,16 +590,28 @@
         /// <returns></returns>
         public static System.Single Parse(System.String s)
         {
+            System.Double res; 
+
+            if (s.EndsWith("f") || s.EndsWith("F"))
+            {
+                System.Double.TryParse(s.Substring(0, s.Length - 1), 
+                    (System.Globalization.NumberStyles.Float | System.Globalization.NumberStyles.AllowThousands),
+                    null, out res);
+            }
+            else
+            {
+                System.Double.TryParse(s, 
+                    (System.Globalization.NumberStyles.Float | System.Globalization.NumberStyles.AllowThousands),
+                    null, out res);
+            }
+
             try
             {
-                if (s.EndsWith("f") || s.EndsWith("F"))
-                    return System.Single.Parse(s.Substring(0, s.Length - 1));
-                else
-                    return System.Single.Parse(s);
+                return System.Convert.ToSingle(res);
             }
-            catch(System.FormatException fex)
+            catch (System.OverflowException)
             {
-                throw fex;					
+                return 0;
             }
         }
     }



Mime
View raw message