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: r1103630 - in /incubator/lucene.net/branches/Lucene.Net_2_9_4g: src/contrib/Highlighter/ test/contrib/Highlighter/
Date Mon, 16 May 2011 07:22:33 GMT
Author: digy
Date: Mon May 16 07:22:32 2011
New Revision: 1103630

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

Added:
    incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/contrib/Highlighter/IMPORTANT.txt
Modified:
    incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/contrib/Highlighter/Contrib.Highlighter.csproj
    incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/contrib/Highlighter/Highlighter.cs
    incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/contrib/Highlighter/QueryTermExtractor.cs
    incubator/lucene.net/branches/Lucene.Net_2_9_4g/test/contrib/Highlighter/Contrib.Highlighter.Test.csproj
    incubator/lucene.net/branches/Lucene.Net_2_9_4g/test/contrib/Highlighter/HighlighterTest.cs

Modified: incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/contrib/Highlighter/Contrib.Highlighter.csproj
URL: http://svn.apache.org/viewvc/incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/contrib/Highlighter/Contrib.Highlighter.csproj?rev=1103630&r1=1103629&r2=1103630&view=diff
==============================================================================
--- incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/contrib/Highlighter/Contrib.Highlighter.csproj
(original)
+++ incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/contrib/Highlighter/Contrib.Highlighter.csproj
Mon May 16 07:22:32 2011
@@ -11,7 +11,7 @@
     </ApplicationIcon>
     <AssemblyKeyContainerName>
     </AssemblyKeyContainerName>
-    <AssemblyName>Lucene.Net.Contrib.Highlighter</AssemblyName>
+    <AssemblyName>Lucene.Net.Highlighter</AssemblyName>
     <AssemblyOriginatorKeyFile>
     </AssemblyOriginatorKeyFile>
     <DefaultClientScript>JScript</DefaultClientScript>

Modified: incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/contrib/Highlighter/Highlighter.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/contrib/Highlighter/Highlighter.cs?rev=1103630&r1=1103629&r2=1103630&view=diff
==============================================================================
--- incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/contrib/Highlighter/Highlighter.cs
(original)
+++ incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/contrib/Highlighter/Highlighter.cs
Mon May 16 07:22:32 2011
@@ -19,7 +19,7 @@ using System;
 using Analyzer = Lucene.Net.Analysis.Analyzer;
 using Token = Lucene.Net.Analysis.Token;
 using TokenStream = Lucene.Net.Analysis.TokenStream;
-using PriorityQueue = Lucene.Net.Util.PriorityQueue;
+using Lucene.Net.Util;
 
 namespace Lucene.Net.Highlight
 {
@@ -508,21 +508,19 @@ namespace Lucene.Net.Highlight
 		}
 	}
 
-	class FragmentQueue : PriorityQueue
+	class FragmentQueue : PriorityQueue<TextFragment>
 	{
 		public FragmentQueue(int size)
 		{
 			Initialize(size);
 		}
 		
-		public override bool LessThan(System.Object a, System.Object b)
-		{
-			TextFragment fragA = (TextFragment) a;
-			TextFragment fragB = (TextFragment) b;
-			if (fragA.GetScore() == fragB.GetScore())
-				return fragA.fragNum > fragB.fragNum;
-			else
-				return fragA.GetScore() < fragB.GetScore();
-		}
-	}
+        public override bool LessThan(TextFragment fragA, TextFragment fragB)
+        {
+            if (fragA.GetScore() == fragB.GetScore())
+                return fragA.fragNum > fragB.fragNum;
+            else
+                return fragA.GetScore() < fragB.GetScore();
+        }
+    }
 }

Added: incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/contrib/Highlighter/IMPORTANT.txt
URL: http://svn.apache.org/viewvc/incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/contrib/Highlighter/IMPORTANT.txt?rev=1103630&view=auto
==============================================================================
--- incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/contrib/Highlighter/IMPORTANT.txt
(added)
+++ incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/contrib/Highlighter/IMPORTANT.txt
Mon May 16 07:22:32 2011
@@ -0,0 +1,3 @@
+There are failing test cases & porting problems since Lucene.Net 2.0.
+Try FastVectorHighlighter
+DIGY.
\ No newline at end of file

Modified: incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/contrib/Highlighter/QueryTermExtractor.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/contrib/Highlighter/QueryTermExtractor.cs?rev=1103630&r1=1103629&r2=1103630&view=diff
==============================================================================
--- incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/contrib/Highlighter/QueryTermExtractor.cs
(original)
+++ incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/contrib/Highlighter/QueryTermExtractor.cs
Mon May 16 07:22:32 2011
@@ -16,6 +16,7 @@
  */
 
 using System;
+using System.Collections.Generic;
 using IndexReader = Lucene.Net.Index.IndexReader;
 using Term = Lucene.Net.Index.Term;
 using BooleanClause = Lucene.Net.Search.BooleanClause;
@@ -134,13 +135,11 @@ namespace Lucene.Net.Highlight
 					GetTermsFromFilteredQuery((FilteredQuery) query, terms, prohibited, fieldName);
 				else
 				{
-					System.Collections.Hashtable nonWeightedTerms = new System.Collections.Hashtable();
+                    List<Term> nonWeightedTerms = new List<Term>();
 					query.ExtractTerms(nonWeightedTerms);
 
-                    System.Collections.IDictionaryEnumerator iter =  nonWeightedTerms.GetEnumerator();
-                    while (iter.MoveNext())
+                    foreach(Term term in nonWeightedTerms)
                     {
-                        Term term = (Term)iter.Value;
                         if ((fieldName == null) || (term.Field() == fieldName))
                         {
                             WeightedTerm temp = new  WeightedTerm(query.GetBoost(), term.Text());

Modified: incubator/lucene.net/branches/Lucene.Net_2_9_4g/test/contrib/Highlighter/Contrib.Highlighter.Test.csproj
URL: http://svn.apache.org/viewvc/incubator/lucene.net/branches/Lucene.Net_2_9_4g/test/contrib/Highlighter/Contrib.Highlighter.Test.csproj?rev=1103630&r1=1103629&r2=1103630&view=diff
==============================================================================
--- incubator/lucene.net/branches/Lucene.Net_2_9_4g/test/contrib/Highlighter/Contrib.Highlighter.Test.csproj
(original)
+++ incubator/lucene.net/branches/Lucene.Net_2_9_4g/test/contrib/Highlighter/Contrib.Highlighter.Test.csproj
Mon May 16 07:22:32 2011
@@ -11,7 +11,7 @@
     </ApplicationIcon>
     <AssemblyKeyContainerName>
     </AssemblyKeyContainerName>
-    <AssemblyName>Lucene.Net.Contrib.Highlighter.Test</AssemblyName>
+    <AssemblyName>Lucene.Net.Highlighter.Test</AssemblyName>
     <AssemblyOriginatorKeyFile>
     </AssemblyOriginatorKeyFile>
     <DefaultClientScript>JScript</DefaultClientScript>
@@ -92,9 +92,8 @@
     <ErrorReport>prompt</ErrorReport>
   </PropertyGroup>
   <ItemGroup>
-    <Reference Include="nunit.framework, Version=2.5.9.10348, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77,
processorArchitecture=MSIL">
-      <SpecificVersion>False</SpecificVersion>
-      <HintPath>..\..\..\..\..\..\..\..\..\..\discovere\discover-e\current\resource\third-party\NUnit.org\NUnit\2.5.9\bin\net-2.0\framework\nunit.framework.dll</HintPath>
+    <Reference Include="nunit.framework">
+      <HintPath>..\..\..\lib\NUnit.org\NUnit\2.5.9\bin\net-2.0\nunit.framework.dll</HintPath>
     </Reference>
     <Reference Include="System">
       <Name>System</Name>

Modified: incubator/lucene.net/branches/Lucene.Net_2_9_4g/test/contrib/Highlighter/HighlighterTest.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/branches/Lucene.Net_2_9_4g/test/contrib/Highlighter/HighlighterTest.cs?rev=1103630&r1=1103629&r2=1103630&view=diff
==============================================================================
--- incubator/lucene.net/branches/Lucene.Net_2_9_4g/test/contrib/Highlighter/HighlighterTest.cs
(original)
+++ incubator/lucene.net/branches/Lucene.Net_2_9_4g/test/contrib/Highlighter/HighlighterTest.cs
Mon May 16 07:22:32 2011
@@ -869,7 +869,7 @@ namespace Lucene.Net.Search.Highlight
 		* @see TestCase#setUp()
 		*/
 		[SetUp]
-        protected virtual void  SetUp()
+        public virtual void  SetUp()
 		{
 			ramDir = new RAMDirectory();
 			IndexWriter writer = new IndexWriter(ramDir, new StandardAnalyzer(), true);



Mime
View raw message