lucenenet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From synhers...@apache.org
Subject [1/4] More work on Lucene.Net.Queries
Date Sun, 21 Sep 2014 23:56:43 GMT
Repository: lucenenet
Updated Branches:
  refs/heads/master cf1df6bec -> 5506faf0c


http://git-wip-us.apache.org/repos/asf/lucenenet/blob/5506faf0/src/Lucene.Net.Queries/Function/ValueSources/SimpleBoolFunction.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Queries/Function/ValueSources/SimpleBoolFunction.cs b/src/Lucene.Net.Queries/Function/ValueSources/SimpleBoolFunction.cs
index ea31a26..eab3ac6 100644
--- a/src/Lucene.Net.Queries/Function/ValueSources/SimpleBoolFunction.cs
+++ b/src/Lucene.Net.Queries/Function/ValueSources/SimpleBoolFunction.cs
@@ -15,89 +15,82 @@
  * limitations under the License.
  */
 using System.Collections;
+using Lucene.Net.Index;
 using Lucene.Net.Queries.Function.DocValues;
-using org.apache.lucene.queries.function;
+using Lucene.Net.Search;
 
 namespace Lucene.Net.Queries.Function.ValueSources
 {
     /// <summary>
-	/// <seealso cref="BoolFunction"/> implementation which applies an extendible boolean
-	/// function to the values of a single wrapped <seealso cref="ValueSource"/>.
-	/// 
-	/// Functions this can be used for include whether a field has a value or not,
-	/// or inverting the boolean value of the wrapped ValueSource.
-	/// </summary>
-	public abstract class SimpleBoolFunction : BoolFunction
-	{
-	  protected internal readonly ValueSource source;
+    /// <seealso cref="BoolFunction"/> implementation which applies an extendible boolean
+    /// function to the values of a single wrapped <seealso cref="ValueSource"/>.
+    /// 
+    /// Functions this can be used for include whether a field has a value or not,
+    /// or inverting the boolean value of the wrapped ValueSource.
+    /// </summary>
+    public abstract class SimpleBoolFunction : BoolFunction
+    {
+        protected internal readonly ValueSource source;
 
-	  public SimpleBoolFunction(ValueSource source)
-	  {
-		this.source = source;
-	  }
+        protected SimpleBoolFunction(ValueSource source)
+        {
+            this.source = source;
+        }
 
-	  protected internal abstract string name();
+        protected abstract string Name { get; }
 
-	  protected internal abstract bool func(int doc, FunctionValues vals);
+        protected abstract bool Func(int doc, FunctionValues vals);
 
-//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
-//ORIGINAL LINE: @Override public org.apache.lucene.queries.function.docvalues.BoolDocValues GetValues(java.util.Map context, org.apache.lucene.index.AtomicReaderContext readerContext) throws java.io.IOException
-	  public override BoolDocValues GetValues(IDictionary context, AtomicReaderContext readerContext)
-	  {
-//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
-//ORIGINAL LINE: final org.apache.lucene.queries.function.FunctionValues vals = source.GetValues(context, readerContext);
-		FunctionValues vals = source.GetValues(context, readerContext);
-		return new BoolDocValuesAnonymousInnerClassHelper(this, this, vals);
-	  }
+        public override FunctionValues GetValues(IDictionary context, AtomicReaderContext readerContext)
+        {
+            FunctionValues vals = source.GetValues(context, readerContext);
+            return new BoolDocValuesAnonymousInnerClassHelper(this, this, vals);
+        }
 
-	  private class BoolDocValuesAnonymousInnerClassHelper : BoolDocValues
-	  {
-		  private readonly SimpleBoolFunction outerInstance;
+        private class BoolDocValuesAnonymousInnerClassHelper : BoolDocValues
+        {
+            private readonly SimpleBoolFunction outerInstance;
 
-		  private FunctionValues vals;
+            private FunctionValues vals;
 
-		  public BoolDocValuesAnonymousInnerClassHelper(SimpleBoolFunction outerInstance, SimpleBoolFunction this, FunctionValues vals) : base(this)
-		  {
-			  this.outerInstance = outerInstance;
-			  this.vals = vals;
-		  }
+            public BoolDocValuesAnonymousInnerClassHelper(SimpleBoolFunction outerInstance, SimpleBoolFunction @this, FunctionValues vals)
+                : base(@this)
+            {
+                this.outerInstance = outerInstance;
+                this.vals = vals;
+            }
 
-		  public override bool boolVal(int doc)
-		  {
-			return outerInstance.func(doc, vals);
-		  }
-		  public override string ToString(int doc)
-		  {
-			return outerInstance.name() + '(' + vals.ToString(doc) + ')';
-		  }
-	  }
+            public override bool BoolVal(int doc)
+            {
+                return outerInstance.Func(doc, vals);
+            }
+            public override string ToString(int doc)
+            {
+                return outerInstance.Name + '(' + vals.ToString(doc) + ')';
+            }
+        }
 
-	  public override string description()
-	  {
-		return name() + '(' + source.description() + ')';
-	  }
+        public override string Description
+        {
+            get { return Name + '(' + source.Description + ')'; }
+        }
 
-	  public override int GetHashCode()
-	  {
-		return source.GetHashCode() + name().GetHashCode();
-	  }
+        public override int GetHashCode()
+        {
+            return source.GetHashCode() + Name.GetHashCode();
+        }
 
-	  public override bool Equals(object o)
-	  {
-		if (this.GetType() != o.GetType())
-		{
-			return false;
-		}
-		SimpleBoolFunction other = (SimpleBoolFunction)o;
-		return this.source.Equals(other.source);
-	  }
-
-//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
-//ORIGINAL LINE: @Override public void CreateWeight(java.util.Map context, org.apache.lucene.search.IndexSearcher searcher) throws java.io.IOException
-	  public override void CreateWeight(IDictionary context, IndexSearcher searcher)
-	  {
-		source.CreateWeight(context, searcher);
-	  }
-	}
+        public override bool Equals(object o)
+        {
+            var other = o as SimpleBoolFunction;
+            if (other == null)
+                return false;
+            return this.source.Equals(other.source);
+        }
 
+        public override void CreateWeight(IDictionary context, IndexSearcher searcher)
+        {
+            source.CreateWeight(context, searcher);
+        }
+    }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/5506faf0/src/Lucene.Net.Queries/Function/ValueSources/SimpleFloatFunction.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Queries/Function/ValueSources/SimpleFloatFunction.cs b/src/Lucene.Net.Queries/Function/ValueSources/SimpleFloatFunction.cs
index 31cb1c2..f18a0f1 100644
--- a/src/Lucene.Net.Queries/Function/ValueSources/SimpleFloatFunction.cs
+++ b/src/Lucene.Net.Queries/Function/ValueSources/SimpleFloatFunction.cs
@@ -17,48 +17,47 @@
  */
 using Lucene.Net.Index;
 using Lucene.Net.Queries.Function.DocValues;
-using org.apache.lucene.queries.function;
 
 namespace Lucene.Net.Queries.Function.ValueSources
 {
     /// <summary>
-	/// A simple float function with a single argument
-	/// </summary>
-	 public abstract class SimpleFloatFunction : SingleFunction
-	 {
-	  public SimpleFloatFunction(ValueSource source) : base(source)
-	  {
-	  }
-
-	  protected internal abstract float func(int doc, FunctionValues vals);
-
-	  public override FunctionValues GetValues(IDictionary context, AtomicReaderContext readerContext)
-	  {
-		FunctionValues vals = source.GetValues(context, readerContext);
-		return new FloatDocValuesAnonymousInnerClassHelper(this, this, vals);
-	  }
-
-	  private class FloatDocValuesAnonymousInnerClassHelper : FloatDocValues
-	  {
-		  private readonly SimpleFloatFunction outerInstance;
-
-		  private FunctionValues vals;
-
-		  public FloatDocValuesAnonymousInnerClassHelper(SimpleFloatFunction outerInstance, SimpleFloatFunction this, FunctionValues vals) : base(this)
-		  {
-			  this.outerInstance = outerInstance;
-			  this.vals = vals;
-		  }
-
-		  public override float FloatVal(int doc)
-		  {
-			return outerInstance.func(doc, vals);
-		  }
-		  public override string ToString(int doc)
-		  {
-			return outerInstance.name() + '(' + vals.ToString(doc) + ')';
-		  }
-	  }
-	 }
-
+    /// A simple float function with a single argument
+    /// </summary>
+    public abstract class SimpleFloatFunction : SingleFunction
+    {
+        protected SimpleFloatFunction(ValueSource source)
+            : base(source)
+        {
+        }
+
+        protected abstract float Func(int doc, FunctionValues vals);
+
+        public override FunctionValues GetValues(IDictionary context, AtomicReaderContext readerContext)
+        {
+            FunctionValues vals = source.GetValues(context, readerContext);
+            return new FloatDocValuesAnonymousInnerClassHelper(this, this, vals);
+        }
+
+        private class FloatDocValuesAnonymousInnerClassHelper : FloatDocValues
+        {
+            private readonly SimpleFloatFunction outerInstance;
+            private readonly FunctionValues vals;
+
+            public FloatDocValuesAnonymousInnerClassHelper(SimpleFloatFunction outerInstance, SimpleFloatFunction @this, FunctionValues vals)
+                : base(@this)
+            {
+                this.outerInstance = outerInstance;
+                this.vals = vals;
+            }
+
+            public override float FloatVal(int doc)
+            {
+                return outerInstance.Func(doc, vals);
+            }
+            public override string ToString(int doc)
+            {
+                return outerInstance.Name + '(' + vals.ToString(doc) + ')';
+            }
+        }
+    }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/5506faf0/src/Lucene.Net.Queries/Function/ValueSources/SingleFunction.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Queries/Function/ValueSources/SingleFunction.cs b/src/Lucene.Net.Queries/Function/ValueSources/SingleFunction.cs
index 51c196d..07cac33 100644
--- a/src/Lucene.Net.Queries/Function/ValueSources/SingleFunction.cs
+++ b/src/Lucene.Net.Queries/Function/ValueSources/SingleFunction.cs
@@ -15,48 +15,45 @@
  * limitations under the License.
  */
 using System.Collections;
+using Lucene.Net.Search;
 
 namespace Lucene.Net.Queries.Function.ValueSources
 {
     /// <summary>
-	/// A function with a single argument
-	/// </summary>
-	 public abstract class SingleFunction : ValueSource
-	 {
-	  protected internal readonly ValueSource source;
+    /// A function with a single argument
+    /// </summary>
+    public abstract class SingleFunction : ValueSource
+    {
+        protected internal readonly ValueSource source;
 
-	  public SingleFunction(ValueSource source)
-	  {
-		this.source = source;
-	  }
+        protected SingleFunction(ValueSource source)
+        {
+            this.source = source;
+        }
 
-	  protected internal abstract string name();
+        protected internal abstract string Name { get; }
 
-	  public override string description()
-	  {
-		return name() + '(' + source.description() + ')';
-	  }
+        public override string Description
+        {
+            get { return Name + '(' + source.Description + ')'; }
+        }
 
-	  public override int GetHashCode()
-	  {
-		return source.GetHashCode() + name().GetHashCode();
-	  }
+        public override int GetHashCode()
+        {
+            return source.GetHashCode() + Name.GetHashCode();
+        }
 
-	  public override bool Equals(object o)
-	  {
-		if (this.GetType() != o.GetType())
-		{
-			return false;
-		}
-		SingleFunction other = (SingleFunction)o;
-		return this.name().Equals(other.name()) && this.source.Equals(other.source);
-	  }
+        public override bool Equals(object o)
+        {
+            var other = o as SingleFunction;
+            if (other == null)
+                return false;
+            return Name.Equals(other.Name) && source.Equals(other.source);
+        }
 
-//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
-//ORIGINAL LINE: @Override public void CreateWeight(java.util.Map context, org.apache.lucene.search.IndexSearcher searcher) throws java.io.IOException
-	  public override void CreateWeight(IDictionary context, IndexSearcher searcher)
-	  {
-		source.CreateWeight(context, searcher);
-	  }
-	 }
+        public override void CreateWeight(IDictionary context, IndexSearcher searcher)
+        {
+            source.CreateWeight(context, searcher);
+        }
+    }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/5506faf0/src/Lucene.Net.Queries/Function/ValueSources/SumFloatFunction.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Queries/Function/ValueSources/SumFloatFunction.cs b/src/Lucene.Net.Queries/Function/ValueSources/SumFloatFunction.cs
index 35a8274..c4f9b33 100644
--- a/src/Lucene.Net.Queries/Function/ValueSources/SumFloatFunction.cs
+++ b/src/Lucene.Net.Queries/Function/ValueSources/SumFloatFunction.cs
@@ -15,34 +15,29 @@
  * limitations under the License.
  */
 
-using org.apache.lucene.queries.function;
+using System.Linq;
 
 namespace Lucene.Net.Queries.Function.ValueSources
 {
 
 
-	/// <summary>
-	/// <code>SumFloatFunction</code> returns the sum of it's components.
-	/// </summary>
-	public class SumFloatFunction : MultiFloatFunction
-	{
-	  public SumFloatFunction(ValueSource[] sources) : base(sources)
-	  {
-	  }
+    /// <summary>
+    /// <code>SumFloatFunction</code> returns the sum of it's components.
+    /// </summary>
+    public class SumFloatFunction : MultiFloatFunction
+    {
+        public SumFloatFunction(ValueSource[] sources)
+            : base(sources)
+        {
+        }
+        protected override string Name
+        {
+            get { return "sum"; }
+        }
 
-	  protected internal override string name()
-	  {
-		return "sum";
-	  }
-
-	  protected internal override float func(int doc, FunctionValues[] valsArr)
-	  {
-		float val = 0.0f;
-		foreach (FunctionValues vals in valsArr)
-		{
-		  val += vals.FloatVal(doc);
-		}
-		return val;
-	  }
-	}
+        protected override float Func(int doc, FunctionValues[] valsArr)
+        {
+            return valsArr.Sum(vals => vals.FloatVal(doc));
+        }
+    }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/5506faf0/src/Lucene.Net.Queries/Function/ValueSources/SumTotalTermFreqValueSource.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Queries/Function/ValueSources/SumTotalTermFreqValueSource.cs b/src/Lucene.Net.Queries/Function/ValueSources/SumTotalTermFreqValueSource.cs
index bb5aa41..07cb60d 100644
--- a/src/Lucene.Net.Queries/Function/ValueSources/SumTotalTermFreqValueSource.cs
+++ b/src/Lucene.Net.Queries/Function/ValueSources/SumTotalTermFreqValueSource.cs
@@ -15,110 +15,103 @@
  * limitations under the License.
  */
 using System.Collections;
+using Lucene.Net.Index;
 using Lucene.Net.Queries.Function.DocValues;
-using org.apache.lucene.queries.function;
+using Lucene.Net.Search;
 
 namespace Lucene.Net.Queries.Function.ValueSources
 {
     /// <summary>
-	/// <code>SumTotalTermFreqValueSource</code> returns the number of tokens.
-	/// (sum of term freqs across all documents, across all terms).
-	/// Returns -1 if frequencies were omitted for the field, or if 
-	/// the codec doesn't support this statistic.
-	/// @lucene.internal
-	/// </summary>
-	public class SumTotalTermFreqValueSource : ValueSource
-	{
-	  protected internal readonly string indexedField;
+    /// <code>SumTotalTermFreqValueSource</code> returns the number of tokens.
+    /// (sum of term freqs across all documents, across all terms).
+    /// Returns -1 if frequencies were omitted for the field, or if 
+    /// the codec doesn't support this statistic.
+    /// @lucene.internal
+    /// </summary>
+    public class SumTotalTermFreqValueSource : ValueSource
+    {
+        protected internal readonly string indexedField;
 
-	  public SumTotalTermFreqValueSource(string indexedField)
-	  {
-		this.indexedField = indexedField;
-	  }
+        public SumTotalTermFreqValueSource(string indexedField)
+        {
+            this.indexedField = indexedField;
+        }
 
-	  public virtual string name()
-	  {
-		return "sumtotaltermfreq";
-	  }
+        public virtual string Name
+        {
+            get { return "sumtotaltermfreq"; }
+        }
 
-	  public override string description()
-	  {
-		return name() + '(' + indexedField + ')';
-	  }
+        public override string Description
+        {
+            get { return Name + '(' + indexedField + ')'; }
+        }
 
-//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
-//ORIGINAL LINE: @Override public org.apache.lucene.queries.function.FunctionValues GetValues(java.util.Map context, org.apache.lucene.index.AtomicReaderContext readerContext) throws java.io.IOException
-	  public override FunctionValues GetValues(IDictionary context, AtomicReaderContext readerContext)
-	  {
-		return (FunctionValues)context[this];
-	  }
+        public override FunctionValues GetValues(IDictionary context, AtomicReaderContext readerContext)
+        {
+            return (FunctionValues)context[this];
+        }
 
-//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
-//ORIGINAL LINE: @Override public void CreateWeight(java.util.Map context, org.apache.lucene.search.IndexSearcher searcher) throws java.io.IOException
-	  public override void CreateWeight(IDictionary context, IndexSearcher searcher)
-	  {
-		long sumTotalTermFreq = 0;
-		foreach (AtomicReaderContext readerContext in searcher.TopReaderContext.leaves())
-		{
-		  Fields fields = readerContext.reader().fields();
-		  if (fields == null)
-		  {
-			  continue;
-		  }
-		  Terms terms = fields.terms(indexedField);
-		  if (terms == null)
-		  {
-			  continue;
-		  }
-		  long v = terms.SumTotalTermFreq;
-		  if (v == -1)
-		  {
-			sumTotalTermFreq = -1;
-			break;
-		  }
-		  else
-		  {
-			sumTotalTermFreq += v;
-		  }
-		}
-//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
-//ORIGINAL LINE: final long ttf = sumTotalTermFreq;
-		long ttf = sumTotalTermFreq;
-		context[this] = new LongDocValuesAnonymousInnerClassHelper(this, this, ttf);
-	  }
+        public override void CreateWeight(IDictionary context, IndexSearcher searcher)
+        {
+            long sumTotalTermFreq = 0;
+            foreach (AtomicReaderContext readerContext in searcher.TopReaderContext.Leaves)
+            {
+                Fields fields = readerContext.AtomicReader.Fields;
+                if (fields == null)
+                {
+                    continue;
+                }
+                Terms terms = fields.Terms(indexedField);
+                if (terms == null)
+                {
+                    continue;
+                }
+                long v = terms.SumTotalTermFreq;
+                if (v == -1)
+                {
+                    sumTotalTermFreq = -1;
+                    break;
+                }
+                else
+                {
+                    sumTotalTermFreq += v;
+                }
+            }
+            long ttf = sumTotalTermFreq;
+            context[this] = new LongDocValuesAnonymousInnerClassHelper(this, this, ttf);
+        }
 
-	  private class LongDocValuesAnonymousInnerClassHelper : LongDocValues
-	  {
-		  private readonly SumTotalTermFreqValueSource outerInstance;
+        private class LongDocValuesAnonymousInnerClassHelper : LongDocValues
+        {
+            private readonly SumTotalTermFreqValueSource outerInstance;
 
-		  private long ttf;
+            private long ttf;
 
-		  public LongDocValuesAnonymousInnerClassHelper(SumTotalTermFreqValueSource outerInstance, SumTotalTermFreqValueSource this, long ttf) : base(this)
-		  {
-			  this.outerInstance = outerInstance;
-			  this.ttf = ttf;
-		  }
+            public LongDocValuesAnonymousInnerClassHelper(SumTotalTermFreqValueSource outerInstance, SumTotalTermFreqValueSource @this, long ttf)
+                : base(@this)
+            {
+                this.outerInstance = outerInstance;
+                this.ttf = ttf;
+            }
 
-		  public override long LongVal(int doc)
-		  {
-			return ttf;
-		  }
-	  }
+            public override long LongVal(int doc)
+            {
+                return ttf;
+            }
+        }
 
-	  public override int GetHashCode()
-	  {
-		return this.GetType().GetHashCode() + indexedField.GetHashCode();
-	  }
-
-	  public override bool Equals(object o)
-	  {
-		if (this.GetType() != o.GetType())
-		{
-			return false;
-		}
-		SumTotalTermFreqValueSource other = (SumTotalTermFreqValueSource)o;
-		return this.indexedField.Equals(other.indexedField);
-	  }
-	}
+        public override int GetHashCode()
+        {
+            return this.GetType().GetHashCode() + indexedField.GetHashCode();
+        }
 
+        public override bool Equals(object o)
+        {
+            var other = o as SumTotalTermFreqValueSource;
+            if (other == null)
+                return false;
+            return this.indexedField.Equals(other.indexedField);
+        }
+    }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/5506faf0/src/Lucene.Net.Queries/Function/ValueSources/TFValueSource.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Queries/Function/ValueSources/TFValueSource.cs b/src/Lucene.Net.Queries/Function/ValueSources/TFValueSource.cs
index 2240d4d..a4353a8 100644
--- a/src/Lucene.Net.Queries/Function/ValueSources/TFValueSource.cs
+++ b/src/Lucene.Net.Queries/Function/ValueSources/TFValueSource.cs
@@ -6,7 +6,6 @@ using Lucene.Net.Queries.Function.DocValues;
 using Lucene.Net.Search;
 using Lucene.Net.Search.Similarities;
 using Lucene.Net.Util;
-using org.apache.lucene.queries.function;
 
 namespace Lucene.Net.Queries.Function.ValueSources
 {
@@ -65,8 +64,8 @@ namespace Lucene.Net.Queries.Function.ValueSources
 	  {
 		  private readonly TFValueSource outerInstance;
 
-		  private Terms terms;
-		  private TFIDFSimilarity similarity;
+		  private readonly Terms terms;
+		  private readonly TFIDFSimilarity similarity;
 
 		  public FloatDocValuesAnonymousInnerClassHelper(TFValueSource outerInstance, TFValueSource @this, Terms terms, TFIDFSimilarity similarity) : base(@this)
 		  {
@@ -76,9 +75,9 @@ namespace Lucene.Net.Queries.Function.ValueSources
 			  lastDocRequested = -1;
 		  }
 
-		  internal DocsEnum docs;
-		  internal int atDoc;
-		  internal int lastDocRequested;
+	      private DocsEnum docs;
+	      private int atDoc;
+	      private int lastDocRequested;
 
 //JAVA TO C# CONVERTER TODO TASK: Initialization blocks declared within anonymous inner classes are not converted:
 	//	  {
@@ -93,8 +92,6 @@ namespace Lucene.Net.Queries.Function.ValueSources
 
 			if (terms != null)
 			{
-//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
-//ORIGINAL LINE: final TermsEnum termsEnum = terms.iterator(null);
 			  TermsEnum termsEnum = terms.Iterator(null);
 			  if (termsEnum.SeekExact(outerInstance.indexedBytes))
 			  {
@@ -180,10 +177,9 @@ namespace Lucene.Net.Queries.Function.ValueSources
 			}
 			catch (IOException e)
 			{
-			  throw new Exception("caught exception in function " + outerInstance.description() + " : doc=" + doc, e);
+			  throw new Exception("caught exception in function " + outerInstance.Description + " : doc=" + doc, e);
 			}
 		  }
 	  }
 	}
-
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/5506faf0/src/Lucene.Net.Queries/Function/ValueSources/TermFreqValueSource.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Queries/Function/ValueSources/TermFreqValueSource.cs b/src/Lucene.Net.Queries/Function/ValueSources/TermFreqValueSource.cs
index 5634e0d..69888e0 100644
--- a/src/Lucene.Net.Queries/Function/ValueSources/TermFreqValueSource.cs
+++ b/src/Lucene.Net.Queries/Function/ValueSources/TermFreqValueSource.cs
@@ -16,165 +16,159 @@
  */
 using System;
 using System.Collections;
+using System.IO;
+using Lucene.Net.Index;
 using Lucene.Net.Queries.Function.DocValues;
-using org.apache.lucene.queries.function;
+using Lucene.Net.Search;
+using Lucene.Net.Util;
 
 namespace Lucene.Net.Queries.Function.ValueSources
 {
     /// <summary>
-	/// Function that returns <seealso cref="DocsEnum#freq()"/> for the
-	/// supplied term in every document.
-	/// <para>
-	/// If the term does not exist in the document, returns 0.
-	/// If frequencies are omitted, returns 1.
-	/// </para>
-	/// </summary>
-	public class TermFreqValueSource : DocFreqValueSource
-	{
-	  public TermFreqValueSource(string field, string val, string indexedField, BytesRef indexedBytes) : base(field, val, indexedField, indexedBytes)
-	  {
-	  }
-
-	  public override string name()
-	  {
-		return "termfreq";
-	  }
-
-//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
-//ORIGINAL LINE: @Override public org.apache.lucene.queries.function.FunctionValues GetValues(java.util.Map context, AtomicReaderContext readerContext) throws java.io.IOException
-	  public override FunctionValues GetValues(IDictionary context, AtomicReaderContext readerContext)
-	  {
-		Fields fields = readerContext.reader().fields();
-//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
-//ORIGINAL LINE: final Terms terms = fields.terms(indexedField);
-		Terms terms = fields.terms(indexedField);
-
-		return new IntDocValuesAnonymousInnerClassHelper(this, this, terms);
-	  }
-
-	  private class IntDocValuesAnonymousInnerClassHelper : IntDocValues
-	  {
-		  private readonly TermFreqValueSource outerInstance;
-
-		  private Terms terms;
-
-		  public IntDocValuesAnonymousInnerClassHelper(TermFreqValueSource outerInstance, TermFreqValueSource this, Terms terms) : base(this)
-		  {
-			  this.outerInstance = outerInstance;
-			  this.terms = terms;
-			  lastDocRequested = -1;
-		  }
-
-		  internal DocsEnum docs;
-		  internal int atDoc;
-		  internal int lastDocRequested;
-
-//JAVA TO C# CONVERTER TODO TASK: Initialization blocks declared within anonymous inner classes are not converted:
-	//	  {
-	//		  reset();
-	//	  }
-
-//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
-//ORIGINAL LINE: public void reset() throws java.io.IOException
-		  public virtual void reset()
-		  {
-			// no one should call us for deleted docs?
-
-			if (terms != null)
-			{
-//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
-//ORIGINAL LINE: final TermsEnum termsEnum = terms.iterator(null);
-			  TermsEnum termsEnum = terms.iterator(null);
-			  if (termsEnum.seekExact(outerInstance.indexedBytes))
-			  {
-				docs = termsEnum.docs(null, null);
-			  }
-			  else
-			  {
-				docs = null;
-			  }
-			}
-			else
-			{
-			  docs = null;
-			}
-
-			if (docs == null)
-			{
-			  docs = new DocsEnumAnonymousInnerClassHelper(this);
-			}
-			atDoc = -1;
-		  }
-
-		  private class DocsEnumAnonymousInnerClassHelper : DocsEnum
-		  {
-			  private readonly IntDocValuesAnonymousInnerClassHelper outerInstance;
-
-			  public DocsEnumAnonymousInnerClassHelper(IntDocValuesAnonymousInnerClassHelper outerInstance)
-			  {
-				  this.outerInstance = outerInstance;
-			  }
-
-			  public override int freq()
-			  {
-				return 0;
-			  }
-
-			  public override int docID()
-			  {
-				return DocIdSetIterator.NO_MORE_DOCS;
-			  }
-
-			  public override int nextDoc()
-			  {
-				return DocIdSetIterator.NO_MORE_DOCS;
-			  }
-
-			  public override int advance(int target)
-			  {
-				return DocIdSetIterator.NO_MORE_DOCS;
-			  }
-
-			  public override long cost()
-			  {
-				return 0;
-			  }
-		  }
-
-		  public override int intVal(int doc)
-		  {
-			try
-			{
-			  if (doc < lastDocRequested)
-			  {
-				// out-of-order access.... reset
-				reset();
-			  }
-			  lastDocRequested = doc;
-
-			  if (atDoc < doc)
-			  {
-				atDoc = docs.advance(doc);
-			  }
-
-			  if (atDoc > doc)
-			  {
-				// term doesn't match this document... either because we hit the
-				// end, or because the next doc is after this doc.
-				return 0;
-			  }
-
-			  // a match!
-			  return docs.freq();
-			}
-			catch (IOException e)
-			{
-			  throw new Exception("caught exception in function " + outerInstance.description() + " : doc=" + doc, e);
-			}
-		  }
-	  }
-	}
-
-
-
+    /// Function that returns <seealso cref="DocsEnum#freq()"/> for the
+    /// supplied term in every document.
+    /// <para>
+    /// If the term does not exist in the document, returns 0.
+    /// If frequencies are omitted, returns 1.
+    /// </para>
+    /// </summary>
+    public class TermFreqValueSource : DocFreqValueSource
+    {
+        public TermFreqValueSource(string field, string val, string indexedField, BytesRef indexedBytes)
+            : base(field, val, indexedField, indexedBytes)
+        {
+        }
+
+        public override string Name
+        {
+            get { return "termfreq"; }
+        }
+
+        public override FunctionValues GetValues(IDictionary context, AtomicReaderContext readerContext)
+        {
+            Fields fields = readerContext.AtomicReader.Fields;
+            Terms terms = fields.Terms(indexedField);
+
+            return new IntDocValuesAnonymousInnerClassHelper(this, this, terms);
+        }
+
+        private class IntDocValuesAnonymousInnerClassHelper : IntDocValues
+        {
+            private readonly TermFreqValueSource outerInstance;
+
+            private Terms terms;
+
+            public IntDocValuesAnonymousInnerClassHelper(TermFreqValueSource outerInstance, TermFreqValueSource @this, Terms terms)
+                : base(@this)
+            {
+                this.outerInstance = outerInstance;
+                this.terms = terms;
+                lastDocRequested = -1;
+            }
+
+            private DocsEnum docs;
+            private int atDoc;
+            private int lastDocRequested;
+
+            //JAVA TO C# CONVERTER TODO TASK: Initialization blocks declared within anonymous inner classes are not converted:
+            //	  {
+            //		  reset();
+            //	  }
+
+            public virtual void Reset()
+            {
+                // no one should call us for deleted docs?
+
+                if (terms != null)
+                {
+                    TermsEnum termsEnum = terms.Iterator(null);
+                    if (termsEnum.SeekExact(outerInstance.indexedBytes))
+                    {
+                        docs = termsEnum.Docs(null, null);
+                    }
+                    else
+                    {
+                        docs = null;
+                    }
+                }
+                else
+                {
+                    docs = null;
+                }
+
+                if (docs == null)
+                {
+                    docs = new DocsEnumAnonymousInnerClassHelper(this);
+                }
+                atDoc = -1;
+            }
+
+            private class DocsEnumAnonymousInnerClassHelper : DocsEnum
+            {
+                private readonly IntDocValuesAnonymousInnerClassHelper outerInstance;
+
+                public DocsEnumAnonymousInnerClassHelper(IntDocValuesAnonymousInnerClassHelper outerInstance)
+                {
+                    this.outerInstance = outerInstance;
+                }
+
+                public override int Freq()
+                {
+                    return 0;
+                }
+
+                public override int DocID()
+                {
+                    return DocIdSetIterator.NO_MORE_DOCS;
+                }
+
+                public override int NextDoc()
+                {
+                    return DocIdSetIterator.NO_MORE_DOCS;
+                }
+
+                public override int Advance(int target)
+                {
+                    return DocIdSetIterator.NO_MORE_DOCS;
+                }
+
+                public override long Cost()
+                {
+                    return 0;
+                }
+            }
+
+            public override int IntVal(int doc)
+            {
+                try
+                {
+                    if (doc < lastDocRequested)
+                    {
+                        // out-of-order access.... reset
+                        Reset();
+                    }
+                    lastDocRequested = doc;
+
+                    if (atDoc < doc)
+                    {
+                        atDoc = docs.Advance(doc);
+                    }
+
+                    if (atDoc > doc)
+                    {
+                        // term doesn't match this document... either because we hit the
+                        // end, or because the next doc is after this doc.
+                        return 0;
+                    }
+
+                    // a match!
+                    return docs.Freq();
+                }
+                catch (IOException e)
+                {
+                    throw new Exception("caught exception in function " + outerInstance.Description + " : doc=" + doc, e);
+                }
+            }
+        }
+    }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/5506faf0/src/Lucene.Net.Queries/Function/ValueSources/TotalTermFreqValueSource.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Queries/Function/ValueSources/TotalTermFreqValueSource.cs b/src/Lucene.Net.Queries/Function/ValueSources/TotalTermFreqValueSource.cs
index dce8177..c37f9c7 100644
--- a/src/Lucene.Net.Queries/Function/ValueSources/TotalTermFreqValueSource.cs
+++ b/src/Lucene.Net.Queries/Function/ValueSources/TotalTermFreqValueSource.cs
@@ -15,106 +15,102 @@
  * limitations under the License.
  */
 using System.Collections;
+using Lucene.Net.Index;
 using Lucene.Net.Queries.Function.DocValues;
-using org.apache.lucene.queries.function;
+using Lucene.Net.Search;
+using Lucene.Net.Util;
 
 namespace Lucene.Net.Queries.Function.ValueSources
 {
     /// <summary>
-	/// <code>TotalTermFreqValueSource</code> returns the total term freq 
-	/// (sum of term freqs across all documents).
-	/// Returns -1 if frequencies were omitted for the field, or if 
-	/// the codec doesn't support this statistic.
-	/// @lucene.internal
-	/// </summary>
-	public class TotalTermFreqValueSource : ValueSource
-	{
-	  protected internal readonly string field;
-	  protected internal readonly string indexedField;
-	  protected internal readonly string val;
-	  protected internal readonly BytesRef indexedBytes;
+    /// <code>TotalTermFreqValueSource</code> returns the total term freq 
+    /// (sum of term freqs across all documents).
+    /// Returns -1 if frequencies were omitted for the field, or if 
+    /// the codec doesn't support this statistic.
+    /// @lucene.internal
+    /// </summary>
+    public class TotalTermFreqValueSource : ValueSource
+    {
+        protected readonly string field;
+        protected readonly string indexedField;
+        protected readonly string val;
+        protected readonly BytesRef indexedBytes;
 
-	  public TotalTermFreqValueSource(string field, string val, string indexedField, BytesRef indexedBytes)
-	  {
-		this.field = field;
-		this.val = val;
-		this.indexedField = indexedField;
-		this.indexedBytes = indexedBytes;
-	  }
+        public TotalTermFreqValueSource(string field, string val, string indexedField, BytesRef indexedBytes)
+        {
+            this.field = field;
+            this.val = val;
+            this.indexedField = indexedField;
+            this.indexedBytes = indexedBytes;
+        }
 
-	  public virtual string name()
-	  {
-		return "totaltermfreq";
-	  }
+        public virtual string Name
+        {
+            get { return "totaltermfreq"; }
+        }
 
-	  public override string description()
-	  {
-		return name() + '(' + field + ',' + val + ')';
-	  }
+        public override string Description
+        {
+            get { return Name + '(' + field + ',' + val + ')'; }
+        }
 
-//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
-//ORIGINAL LINE: @Override public org.apache.lucene.queries.function.FunctionValues GetValues(java.util.Map context, org.apache.lucene.index.AtomicReaderContext readerContext) throws java.io.IOException
-	  public override FunctionValues GetValues(IDictionary context, AtomicReaderContext readerContext)
-	  {
-		return (FunctionValues)context[this];
-	  }
+        public override FunctionValues GetValues(IDictionary context, AtomicReaderContext readerContext)
+        {
+            return (FunctionValues)context[this];
+        }
 
-//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
-//ORIGINAL LINE: @Override public void CreateWeight(java.util.Map context, org.apache.lucene.search.IndexSearcher searcher) throws java.io.IOException
-	  public override void CreateWeight(IDictionary context, IndexSearcher searcher)
-	  {
-		long totalTermFreq = 0;
-		foreach (AtomicReaderContext readerContext in searcher.TopReaderContext.leaves())
-		{
-		  long val = readerContext.reader().totalTermFreq(new Term(indexedField, indexedBytes));
-		  if (val == -1)
-		  {
-			totalTermFreq = -1;
-			break;
-		  }
-		  else
-		  {
-			totalTermFreq += val;
-		  }
-		}
-//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
-//ORIGINAL LINE: final long ttf = totalTermFreq;
-		long ttf = totalTermFreq;
-		context[this] = new LongDocValuesAnonymousInnerClassHelper(this, this, ttf);
-	  }
+        public override void CreateWeight(IDictionary context, IndexSearcher searcher)
+        {
+            long totalTermFreq = 0;
+            foreach (var readerContext in searcher.TopReaderContext.Leaves)
+            {
+                long val = readerContext.Reader.TotalTermFreq(new Term(indexedField, indexedBytes));
+                if (val == -1)
+                {
+                    totalTermFreq = -1;
+                    break;
+                }
+                else
+                {
+                    totalTermFreq += val;
+                }
+            }
+            var ttf = totalTermFreq;
+            context[this] = new LongDocValuesAnonymousInnerClassHelper(this, this, ttf);
+        }
 
-	  private class LongDocValuesAnonymousInnerClassHelper : LongDocValues
-	  {
-		  private readonly TotalTermFreqValueSource outerInstance;
+        private class LongDocValuesAnonymousInnerClassHelper : LongDocValues
+        {
+            private readonly TotalTermFreqValueSource outerInstance;
 
-		  private long ttf;
+            private readonly long ttf;
 
-		  public LongDocValuesAnonymousInnerClassHelper(TotalTermFreqValueSource outerInstance, TotalTermFreqValueSource this, long ttf) : base(this)
-		  {
-			  this.outerInstance = outerInstance;
-			  this.ttf = ttf;
-		  }
+            public LongDocValuesAnonymousInnerClassHelper(TotalTermFreqValueSource outerInstance, TotalTermFreqValueSource @this, long ttf)
+                : base(@this)
+            {
+                this.outerInstance = outerInstance;
+                this.ttf = ttf;
+            }
 
-		  public override long LongVal(int doc)
-		  {
-			return ttf;
-		  }
-	  }
+            public override long LongVal(int doc)
+            {
+                return ttf;
+            }
+        }
 
-	  public override int GetHashCode()
-	  {
-		return this.GetType().GetHashCode() + indexedField.GetHashCode() * 29 + indexedBytes.GetHashCode();
-	  }
-
-	  public override bool Equals(object o)
-	  {
-		if (this.GetType() != o.GetType())
-		{
-			return false;
-		}
-		TotalTermFreqValueSource other = (TotalTermFreqValueSource)o;
-		return this.indexedField.Equals(other.indexedField) && this.indexedBytes.Equals(other.indexedBytes);
-	  }
-	}
+        public override int GetHashCode()
+        {
+            return this.GetType().GetHashCode() + indexedField.GetHashCode() * 29 + indexedBytes.GetHashCode();
+        }
 
+        public override bool Equals(object o)
+        {
+            if (this.GetType() != o.GetType())
+            {
+                return false;
+            }
+            var other = (TotalTermFreqValueSource)o;
+            return this.indexedField.Equals(other.indexedField) && this.indexedBytes.Equals(other.indexedBytes);
+        }
+    }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/5506faf0/src/Lucene.Net.Queries/Function/ValueSources/VectorValueSource.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Queries/Function/ValueSources/VectorValueSource.cs b/src/Lucene.Net.Queries/Function/ValueSources/VectorValueSource.cs
index e859263..fa53603 100644
--- a/src/Lucene.Net.Queries/Function/ValueSources/VectorValueSource.cs
+++ b/src/Lucene.Net.Queries/Function/ValueSources/VectorValueSource.cs
@@ -3,234 +3,223 @@ using System.Collections.Generic;
 using System.Text;
 using Lucene.Net.Index;
 using Lucene.Net.Search;
-using org.apache.lucene.queries.function;
 
 namespace Lucene.Net.Queries.Function.ValueSources
 {
-	/*
-	 * 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.
-	 */
+    /*
+     * 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.
+     */
     /// <summary>
-	/// Converts individual ValueSource instances to leverage the FunctionValues *Val functions that work with multiple values,
-	/// i.e. <seealso cref="FunctionValues#DoubleVal(int, double[])"/>
-	/// </summary>
-	//Not crazy about the name, but...
-	public class VectorValueSource : MultiValueSource
-	{
-	  protected internal readonly IList<ValueSource> sources;
+    /// Converts individual ValueSource instances to leverage the FunctionValues *Val functions that work with multiple values,
+    /// i.e. <seealso cref="FunctionValues#DoubleVal(int, double[])"/>
+    /// </summary>
+    //Not crazy about the name, but...
+    public class VectorValueSource : MultiValueSource
+    {
+        protected internal readonly IList<ValueSource> sources;
 
 
-	  public VectorValueSource(IList<ValueSource> sources)
-	  {
-		this.sources = sources;
-	  }
-
-	  public virtual IList<ValueSource> Sources
-	  {
-		  get
-		  {
-			return sources;
-		  }
-	  }
-
-	  public override int dimension()
-	  {
-		return sources.Count;
-	  }
+        public VectorValueSource(IList<ValueSource> sources)
+        {
+            this.sources = sources;
+        }
 
-	  public virtual string name()
-	  {
-		return "vector";
-	  }
+        public virtual IList<ValueSource> Sources
+        {
+            get
+            {
+                return sources;
+            }
+        }
 
-//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
-//ORIGINAL LINE: @Override public org.apache.lucene.queries.function.FunctionValues GetValues(java.util.Map context, org.apache.lucene.index.AtomicReaderContext readerContext) throws java.io.IOException
-	  public override FunctionValues GetValues(IDictionary context, AtomicReaderContext readerContext)
-	  {
-		int size = sources.Count;
+        public override int Dimension
+        {
+            get { return sources.Count; }
+        }
 
-		// special-case x,y and lat,lon since it's so common
-		if (size == 2)
-		{
-//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
-//ORIGINAL LINE: final org.apache.lucene.queries.function.FunctionValues x = sources.get(0).GetValues(context, readerContext);
-		  FunctionValues x = sources[0].GetValues(context, readerContext);
-//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
-//ORIGINAL LINE: final org.apache.lucene.queries.function.FunctionValues y = sources.get(1).GetValues(context, readerContext);
-		  FunctionValues y = sources[1].GetValues(context, readerContext);
-		  return new FunctionValuesAnonymousInnerClassHelper(this, x, y);
-		}
+        public virtual string Name
+        {
+            get { return "vector"; }
+        }
 
+        public override FunctionValues GetValues(IDictionary context, AtomicReaderContext readerContext)
+        {
+            var size = sources.Count;
 
-//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
-//ORIGINAL LINE: final org.apache.lucene.queries.function.FunctionValues[] valsArr = new org.apache.lucene.queries.function.FunctionValues[size];
-		FunctionValues[] valsArr = new FunctionValues[size];
-		for (int i = 0; i < size; i++)
-		{
-		  valsArr[i] = sources[i].GetValues(context, readerContext);
-		}
+            // special-case x,y and lat,lon since it's so common
+            if (size == 2)
+            {
+                var x = sources[0].GetValues(context, readerContext);
+                var y = sources[1].GetValues(context, readerContext);
+                return new FunctionValuesAnonymousInnerClassHelper(this, x, y);
+            }
 
-		return new FunctionValuesAnonymousInnerClassHelper2(this, valsArr);
-	  }
+            var valsArr = new FunctionValues[size];
+            for (int i = 0; i < size; i++)
+            {
+                valsArr[i] = sources[i].GetValues(context, readerContext);
+            }
 
-	  private class FunctionValuesAnonymousInnerClassHelper : FunctionValues
-	  {
-		  private readonly VectorValueSource outerInstance;
+            return new FunctionValuesAnonymousInnerClassHelper2(this, valsArr);
+        }
 
-		  private FunctionValues x;
-		  private FunctionValues y;
+        private class FunctionValuesAnonymousInnerClassHelper : FunctionValues
+        {
+            private readonly VectorValueSource outerInstance;
 
-		  public FunctionValuesAnonymousInnerClassHelper(VectorValueSource outerInstance, FunctionValues x, FunctionValues y)
-		  {
-			  this.outerInstance = outerInstance;
-			  this.x = x;
-			  this.y = y;
-		  }
+            private readonly FunctionValues x;
+            private readonly FunctionValues y;
 
-		  public override void ByteVal(int doc, sbyte[] vals)
-		  {
-			vals[0] = x.ByteVal(doc);
-			vals[1] = y.ByteVal(doc);
-		  }
+            public FunctionValuesAnonymousInnerClassHelper(VectorValueSource outerInstance, FunctionValues x, FunctionValues y)
+            {
+                this.outerInstance = outerInstance;
+                this.x = x;
+                this.y = y;
+            }
 
-		  public override void ShortVal(int doc, short[] vals)
-		  {
-			vals[0] = x.ShortVal(doc);
-			vals[1] = y.ShortVal(doc);
-		  }
-		  public override void IntVal(int doc, int[] vals)
-		  {
-			vals[0] = x.IntVal(doc);
-			vals[1] = y.IntVal(doc);
-		  }
-		  public override void LongVal(int doc, long[] vals)
-		  {
-			vals[0] = x.LongVal(doc);
-			vals[1] = y.LongVal(doc);
-		  }
-		  public override void FloatVal(int doc, float[] vals)
-		  {
-			vals[0] = x.FloatVal(doc);
-			vals[1] = y.FloatVal(doc);
-		  }
-		  public override void DoubleVal(int doc, double[] vals)
-		  {
-			vals[0] = x.DoubleVal(doc);
-			vals[1] = y.DoubleVal(doc);
-		  }
-		  public override void StrVal(int doc, string[] vals)
-		  {
-			vals[0] = x.StrVal(doc);
-			vals[1] = y.StrVal(doc);
-		  }
-		  public override string ToString(int doc)
-		  {
-			return outerInstance.name() + "(" + x.ToString(doc) + "," + y.ToString(doc) + ")";
-		  }
-	  }
+            public override void ByteVal(int doc, sbyte[] vals)
+            {
+                vals[0] = x.ByteVal(doc);
+                vals[1] = y.ByteVal(doc);
+            }
 
-	  private class FunctionValuesAnonymousInnerClassHelper2 : FunctionValues
-	  {
-		  private readonly VectorValueSource outerInstance;
+            public override void ShortVal(int doc, short[] vals)
+            {
+                vals[0] = x.ShortVal(doc);
+                vals[1] = y.ShortVal(doc);
+            }
+            public override void IntVal(int doc, int[] vals)
+            {
+                vals[0] = x.IntVal(doc);
+                vals[1] = y.IntVal(doc);
+            }
+            public override void LongVal(int doc, long[] vals)
+            {
+                vals[0] = x.LongVal(doc);
+                vals[1] = y.LongVal(doc);
+            }
+            public override void FloatVal(int doc, float[] vals)
+            {
+                vals[0] = x.FloatVal(doc);
+                vals[1] = y.FloatVal(doc);
+            }
+            public override void DoubleVal(int doc, double[] vals)
+            {
+                vals[0] = x.DoubleVal(doc);
+                vals[1] = y.DoubleVal(doc);
+            }
+            public override void StrVal(int doc, string[] vals)
+            {
+                vals[0] = x.StrVal(doc);
+                vals[1] = y.StrVal(doc);
+            }
+            public override string ToString(int doc)
+            {
+                return outerInstance.Name + "(" + x.ToString(doc) + "," + y.ToString(doc) + ")";
+            }
+        }
 
-		  private FunctionValues[] valsArr;
+        private class FunctionValuesAnonymousInnerClassHelper2 : FunctionValues
+        {
+            private readonly VectorValueSource outerInstance;
+            private readonly FunctionValues[] valsArr;
 
-		  public FunctionValuesAnonymousInnerClassHelper2(VectorValueSource outerInstance, FunctionValues[] valsArr)
-		  {
-			  this.outerInstance = outerInstance;
-			  this.valsArr = valsArr;
-		  }
+            public FunctionValuesAnonymousInnerClassHelper2(VectorValueSource outerInstance, FunctionValues[] valsArr)
+            {
+                this.outerInstance = outerInstance;
+                this.valsArr = valsArr;
+            }
 
-		  public override void ByteVal(int doc, sbyte[] vals)
-		  {
-			for (int i = 0; i < valsArr.Length; i++)
-			{
-			  vals[i] = valsArr[i].ByteVal(doc);
-			}
-		  }
+            public override void ByteVal(int doc, sbyte[] vals)
+            {
+                for (int i = 0; i < valsArr.Length; i++)
+                {
+                    vals[i] = valsArr[i].ByteVal(doc);
+                }
+            }
 
-		  public override void ShortVal(int doc, short[] vals)
-		  {
-			for (int i = 0; i < valsArr.Length; i++)
-			{
-			  vals[i] = valsArr[i].ShortVal(doc);
-			}
-		  }
+            public override void ShortVal(int doc, short[] vals)
+            {
+                for (int i = 0; i < valsArr.Length; i++)
+                {
+                    vals[i] = valsArr[i].ShortVal(doc);
+                }
+            }
 
-		  public override void FloatVal(int doc, float[] vals)
-		  {
-			for (int i = 0; i < valsArr.Length; i++)
-			{
-			  vals[i] = valsArr[i].FloatVal(doc);
-			}
-		  }
+            public override void FloatVal(int doc, float[] vals)
+            {
+                for (int i = 0; i < valsArr.Length; i++)
+                {
+                    vals[i] = valsArr[i].FloatVal(doc);
+                }
+            }
 
-		  public override void IntVal(int doc, int[] vals)
-		  {
-			for (int i = 0; i < valsArr.Length; i++)
-			{
-			  vals[i] = valsArr[i].IntVal(doc);
-			}
-		  }
+            public override void IntVal(int doc, int[] vals)
+            {
+                for (int i = 0; i < valsArr.Length; i++)
+                {
+                    vals[i] = valsArr[i].IntVal(doc);
+                }
+            }
 
-		  public override void LongVal(int doc, long[] vals)
-		  {
-			for (int i = 0; i < valsArr.Length; i++)
-			{
-			  vals[i] = valsArr[i].LongVal(doc);
-			}
-		  }
+            public override void LongVal(int doc, long[] vals)
+            {
+                for (int i = 0; i < valsArr.Length; i++)
+                {
+                    vals[i] = valsArr[i].LongVal(doc);
+                }
+            }
 
-		  public override void DoubleVal(int doc, double[] vals)
-		  {
-			for (int i = 0; i < valsArr.Length; i++)
-			{
-			  vals[i] = valsArr[i].DoubleVal(doc);
-			}
-		  }
+            public override void DoubleVal(int doc, double[] vals)
+            {
+                for (var i = 0; i < valsArr.Length; i++)
+                {
+                    vals[i] = valsArr[i].DoubleVal(doc);
+                }
+            }
 
-		  public override void StrVal(int doc, string[] vals)
-		  {
-			for (int i = 0; i < valsArr.Length; i++)
-			{
-			  vals[i] = valsArr[i].StrVal(doc);
-			}
-		  }
+            public override void StrVal(int doc, string[] vals)
+            {
+                for (var i = 0; i < valsArr.Length; i++)
+                {
+                    vals[i] = valsArr[i].StrVal(doc);
+                }
+            }
 
-		  public override string ToString(int doc)
-		  {
-			StringBuilder sb = new StringBuilder();
-			sb.Append(outerInstance.name()).Append('(');
-			bool firstTime = true;
-			foreach (FunctionValues vals in valsArr)
-			{
-			  if (firstTime)
-			  {
-				firstTime = false;
-			  }
-			  else
-			  {
-				sb.Append(',');
-			  }
-			  sb.Append(vals.ToString(doc));
-			}
-			sb.Append(')');
-			return sb.ToString();
-		  }
-	  }
+            public override string ToString(int doc)
+            {
+                var sb = new StringBuilder();
+                sb.Append(outerInstance.Name).Append('(');
+                bool firstTime = true;
+                foreach (var vals in valsArr)
+                {
+                    if (firstTime)
+                    {
+                        firstTime = false;
+                    }
+                    else
+                    {
+                        sb.Append(',');
+                    }
+                    sb.Append(vals.ToString(doc));
+                }
+                sb.Append(')');
+                return sb.ToString();
+            }
+        }
 
         public override void CreateWeight(IDictionary context, IndexSearcher searcher)
         {
@@ -241,48 +230,48 @@ namespace Lucene.Net.Queries.Function.ValueSources
         }
 
 
-        public override string description()
-	  {
-		StringBuilder sb = new StringBuilder();
-		sb.Append(name()).Append('(');
-		bool firstTime = true;
-		foreach (ValueSource source in sources)
-		{
-		  if (firstTime)
-		  {
-			firstTime = false;
-		  }
-		  else
-		  {
-			sb.Append(',');
-		  }
-		  sb.Append(source);
-		}
-		sb.Append(")");
-		return sb.ToString();
-	  }
-
-	  public override bool Equals(object o)
-	  {
-		if (this == o)
-		{
-			return true;
-		}
-		if (!(o is VectorValueSource))
-		{
-			return false;
-		}
-
-		VectorValueSource that = (VectorValueSource) o;
-
-		return sources.Equals(that.sources);
+        public override string Description
+        {
+            get
+            {
+                var sb = new StringBuilder();
+                sb.Append(Name).Append('(');
+                bool firstTime = true;
+                foreach (ValueSource source in sources)
+                {
+                    if (firstTime)
+                    {
+                        firstTime = false;
+                    }
+                    else
+                    {
+                        sb.Append(',');
+                    }
+                    sb.Append(source);
+                }
+                sb.Append(")");
+                return sb.ToString();
+            }
+        }
 
-	  }
+        public override bool Equals(object o)
+        {
+            if (this == o)
+            {
+                return true;
+            }
+            if (!(o is VectorValueSource))
+            {
+                return false;
+            }
 
-	  public override int GetHashCode()
-	  {
-		return sources.GetHashCode();
-	  }
-	}
+            var that = (VectorValueSource)o;
+            return sources.Equals(that.sources);
+        }
 
+        public override int GetHashCode()
+        {
+            return sources.GetHashCode();
+        }
+    }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/5506faf0/src/Lucene.Net.Queries/TermsFilter.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Queries/TermsFilter.cs b/src/Lucene.Net.Queries/TermsFilter.cs
index 667cd55..421b056 100644
--- a/src/Lucene.Net.Queries/TermsFilter.cs
+++ b/src/Lucene.Net.Queries/TermsFilter.cs
@@ -70,7 +70,7 @@ namespace Lucene.Net.Queries
 		  {
 			  this.outerInstance = outerInstance;
 			  this.terms = terms;
-			  iter = sort(terms).GetEnumerator();
+			  iter = Sort(terms).GetEnumerator();
 		  }
 
 			// we need to sort for deduplication and to have a common cache key
@@ -163,7 +163,7 @@ namespace Lucene.Net.Queries
 		string currentField;
 		while ((currentTerm = iter.Next()) != null)
 		{
-		  currentField = iter.field();
+		  currentField = iter.Field();
 		  if (currentField == null)
 		  {
 			throw new System.ArgumentException("Field must not be null");


Mime
View raw message