lucenenet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From synhers...@apache.org
Subject [16/46] lucenenet git commit: .NETify Facet: Method names should be PascalCase
Date Tue, 04 Oct 2016 20:01:46 GMT
.NETify Facet: Method names should be PascalCase


Project: http://git-wip-us.apache.org/repos/asf/lucenenet/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucenenet/commit/9604c0f7
Tree: http://git-wip-us.apache.org/repos/asf/lucenenet/tree/9604c0f7
Diff: http://git-wip-us.apache.org/repos/asf/lucenenet/diff/9604c0f7

Branch: refs/heads/master
Commit: 9604c0f723c4574cfe48f491a7ff6de06613c094
Parents: 2e5bae0
Author: Shad Storhaug <shad@shadstorhaug.com>
Authored: Sun Sep 25 14:50:19 2016 +0700
Committer: Shad Storhaug <shad@shadstorhaug.com>
Committed: Mon Oct 3 23:31:09 2016 +0700

----------------------------------------------------------------------
 src/Lucene.Net.Facet/FacetsConfig.cs            | 10 ++++----
 src/Lucene.Net.Facet/Range/DoubleRange.cs       |  4 ++--
 .../Range/DoubleRangeFacetCounts.cs             |  4 ++--
 src/Lucene.Net.Facet/Range/LongRange.cs         |  4 ++--
 src/Lucene.Net.Facet/Range/LongRangeCounter.cs  | 24 ++++++++++----------
 .../Range/LongRangeFacetCounts.cs               |  4 ++--
 src/Lucene.Net.Facet/Taxonomy/CategoryPath.cs   | 12 +++++-----
 .../Taxonomy/FloatAssociationFacetField.cs      | 12 +++++-----
 .../Taxonomy/IntAssociationFacetField.cs        |  8 +++----
 9 files changed, 41 insertions(+), 41 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucenenet/blob/9604c0f7/src/Lucene.Net.Facet/FacetsConfig.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Facet/FacetsConfig.cs b/src/Lucene.Net.Facet/FacetsConfig.cs
index 99aaf6c..16a0ea3 100644
--- a/src/Lucene.Net.Facet/FacetsConfig.cs
+++ b/src/Lucene.Net.Facet/FacetsConfig.cs
@@ -378,7 +378,7 @@ namespace Lucene.Net.Facet
             Document result = new Document();
 
             ProcessFacetFields(taxoWriter, byField, result);
-            processSSDVFacetFields(dvByField, result);
+            ProcessSSDVFacetFields(dvByField, result);
             ProcessAssocFacetFields(taxoWriter, assocByField, result);
 
             //System.out.println("add stored: " + addedStoredFields);
@@ -416,7 +416,7 @@ namespace Lucene.Net.Facet
 
                     FacetLabel cp = new FacetLabel(facetField.dim, facetField.path);
 
-                    checkTaxoWriter(taxoWriter);
+                    CheckTaxoWriter(taxoWriter);
                     int ordinal = taxoWriter.AddCategory(cp);
                     if (ordinals.Length == ordinals.Ints.Length)
                     {
@@ -461,7 +461,7 @@ namespace Lucene.Net.Facet
             }
         }
 
-        public void processSSDVFacetFields(IDictionary<string, IList<SortedSetDocValuesFacetField>>
byField, Document doc)
+        public void ProcessSSDVFacetFields(IDictionary<string, IList<SortedSetDocValuesFacetField>>
byField, Document doc)
         {
             //System.out.println("process SSDV: " + byField);
             foreach (KeyValuePair<string, IList<SortedSetDocValuesFacetField>>
ent in byField)
@@ -496,7 +496,7 @@ namespace Lucene.Net.Facet
                 foreach (AssociationFacetField field in ent.Value)
                 {
                     // NOTE: we don't add parents for associations
-                    checkTaxoWriter(taxoWriter);
+                    CheckTaxoWriter(taxoWriter);
                     FacetLabel label = new FacetLabel(field.dim, field.path);
                     int ordinal = taxoWriter.AddCategory(label);
                     if (upto + 4 > bytes.Length)
@@ -592,7 +592,7 @@ namespace Lucene.Net.Facet
             return new BytesRef(bytes, 0, upto);
         }
 
-        private void checkTaxoWriter(ITaxonomyWriter taxoWriter)
+        private void CheckTaxoWriter(ITaxonomyWriter taxoWriter)
         {
             if (taxoWriter == null)
             {

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/9604c0f7/src/Lucene.Net.Facet/Range/DoubleRange.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Facet/Range/DoubleRange.cs b/src/Lucene.Net.Facet/Range/DoubleRange.cs
index 28685d4..93f85cb 100644
--- a/src/Lucene.Net.Facet/Range/DoubleRange.cs
+++ b/src/Lucene.Net.Facet/Range/DoubleRange.cs
@@ -100,7 +100,7 @@ namespace Lucene.Net.Facet.Range
 
         /// <summary>
         /// True if this range accepts the provided value. </summary>
-        public bool accept(double value)
+        public bool Accept(double value)
         {
             return value >= minIncl && value <= maxIncl;
         }
@@ -216,7 +216,7 @@ namespace Lucene.Net.Facet.Range
                         {
                             return false;
                         }
-                        return outerInstance.outerInstance.outerInstance.accept(outerInstance.values.DoubleVal(docID));
+                        return outerInstance.outerInstance.outerInstance.Accept(outerInstance.values.DoubleVal(docID));
                     }
 
                     public virtual int Length()

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/9604c0f7/src/Lucene.Net.Facet/Range/DoubleRangeFacetCounts.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Facet/Range/DoubleRangeFacetCounts.cs b/src/Lucene.Net.Facet/Range/DoubleRangeFacetCounts.cs
index 1e3a996..1033a42 100644
--- a/src/Lucene.Net.Facet/Range/DoubleRangeFacetCounts.cs
+++ b/src/Lucene.Net.Facet/Range/DoubleRangeFacetCounts.cs
@@ -135,7 +135,7 @@ namespace Lucene.Net.Facet.Range
                     // Skip missing docs:
                     if (fv.Exists(doc))
                     {
-                        counter.add(NumericUtils.DoubleToSortableLong(fv.DoubleVal(doc)));
+                        counter.Add(NumericUtils.DoubleToSortableLong(fv.DoubleVal(doc)));
                     }
                     else
                     {
@@ -144,7 +144,7 @@ namespace Lucene.Net.Facet.Range
                 }
             }
 
-            missingCount += counter.fillCounts(Counts);
+            missingCount += counter.FillCounts(Counts);
             TotCount -= missingCount;
         }
     }

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/9604c0f7/src/Lucene.Net.Facet/Range/LongRange.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Facet/Range/LongRange.cs b/src/Lucene.Net.Facet/Range/LongRange.cs
index 7a4f0c1..c54456d 100644
--- a/src/Lucene.Net.Facet/Range/LongRange.cs
+++ b/src/Lucene.Net.Facet/Range/LongRange.cs
@@ -101,7 +101,7 @@ namespace Lucene.Net.Facet.Range
 
         /// <summary>
         /// True if this range accepts the provided value. </summary>
-        public bool accept(long value)
+        public bool Accept(long value)
         {
             return value >= minIncl && value <= maxIncl;
         }
@@ -214,7 +214,7 @@ namespace Lucene.Net.Facet.Range
                         {
                             return false;
                         }
-                        return outerInstance.outerInstance.outerInstance.accept(outerInstance.values.LongVal(docID));
+                        return outerInstance.outerInstance.outerInstance.Accept(outerInstance.values.LongVal(docID));
                     }
 
 

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/9604c0f7/src/Lucene.Net.Facet/Range/LongRangeCounter.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Facet/Range/LongRangeCounter.cs b/src/Lucene.Net.Facet/Range/LongRangeCounter.cs
index 43ef3b4..f5753fa 100644
--- a/src/Lucene.Net.Facet/Range/LongRangeCounter.cs
+++ b/src/Lucene.Net.Facet/Range/LongRangeCounter.cs
@@ -135,7 +135,7 @@ namespace Lucene.Net.Facet.Range
             // each node in the tree:
             for (int i = 0; i < ranges.Length; i++)
             {
-                root.addOutputs(i, ranges[i]);
+                root.AddOutputs(i, ranges[i]);
             }
 
             // Set boundaries (ends of each elementary interval):
@@ -153,7 +153,7 @@ namespace Lucene.Net.Facet.Range
             //System.out.println("root:\n" + root);
         }
 
-        public void add(long v)
+        public void Add(long v)
         {
             //System.out.println("add v=" + v);
 
@@ -208,23 +208,23 @@ namespace Lucene.Net.Facet.Range
         ///  ranges, returning the missing count (how many hits
         ///  didn't match any ranges). 
         /// </summary>
-        public int fillCounts(int[] counts)
+        public int FillCounts(int[] counts)
         {
             //System.out.println("  rollup");
             missingCount = 0;
             leafUpto = 0;
-            rollup(root, counts, false);
+            Rollup(root, counts, false);
             return missingCount;
         }
 
-        private int rollup(LongRangeNode node, int[] counts, bool sawOutputs)
+        private int Rollup(LongRangeNode node, int[] counts, bool sawOutputs)
         {
             int count;
             sawOutputs |= node.outputs != null;
             if (node.left != null)
             {
-                count = rollup(node.left, counts, sawOutputs);
-                count += rollup(node.right, counts, sawOutputs);
+                count = Rollup(node.left, counts, sawOutputs);
+                count += Rollup(node.right, counts, sawOutputs);
             }
             else
             {
@@ -319,7 +319,7 @@ namespace Lucene.Net.Facet.Range
                 return sb.ToString();
             }
 
-            internal static void indent(StringBuilder sb, int depth)
+            internal static void Indent(StringBuilder sb, int depth)
             {
                 for (int i = 0; i < depth; i++)
                 {
@@ -329,7 +329,7 @@ namespace Lucene.Net.Facet.Range
 
             /// <summary>
             /// Recursively assigns range outputs to each node. </summary>
-            internal void addOutputs(int index, LongRange range)
+            internal void AddOutputs(int index, LongRange range)
             {
                 if (start >= range.minIncl && end <= range.maxIncl)
                 {
@@ -345,14 +345,14 @@ namespace Lucene.Net.Facet.Range
                 {
                     Debug.Assert(right != null);
                     // Recurse:
-                    left.addOutputs(index, range);
-                    right.addOutputs(index, range);
+                    left.AddOutputs(index, range);
+                    right.AddOutputs(index, range);
                 }
             }
 
             internal void ToString(StringBuilder sb, int depth)
             {
-                indent(sb, depth);
+                Indent(sb, depth);
                 if (left == null)
                 {
                     Debug.Assert(right == null);

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/9604c0f7/src/Lucene.Net.Facet/Range/LongRangeFacetCounts.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Facet/Range/LongRangeFacetCounts.cs b/src/Lucene.Net.Facet/Range/LongRangeFacetCounts.cs
index 813757d..167eb85 100644
--- a/src/Lucene.Net.Facet/Range/LongRangeFacetCounts.cs
+++ b/src/Lucene.Net.Facet/Range/LongRangeFacetCounts.cs
@@ -120,7 +120,7 @@ namespace Lucene.Net.Facet.Range
                     // Skip missing docs:
                     if (fv.Exists(doc))
                     {
-                        counter.add(fv.LongVal(doc));
+                        counter.Add(fv.LongVal(doc));
                     }
                     else
                     {
@@ -129,7 +129,7 @@ namespace Lucene.Net.Facet.Range
                 }
             }
 
-            int x = counter.fillCounts(Counts);
+            int x = counter.FillCounts(Counts);
 
             missingCount += x;
 

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/9604c0f7/src/Lucene.Net.Facet/Taxonomy/CategoryPath.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Facet/Taxonomy/CategoryPath.cs b/src/Lucene.Net.Facet/Taxonomy/CategoryPath.cs
index 3709b58..d00c50a 100644
--- a/src/Lucene.Net.Facet/Taxonomy/CategoryPath.cs
+++ b/src/Lucene.Net.Facet/Taxonomy/CategoryPath.cs
@@ -149,19 +149,19 @@ namespace Lucene.Net.Facet.Taxonomy
             return length - other.length;
         }
 
-        private void hasDelimiter(string offender, char delimiter)
+        private void HasDelimiter(string offender, char delimiter)
         {
             throw new System.ArgumentException("delimiter character '" + delimiter + 
                 "' (U+" + delimiter.ToString() + ") appears in path component \"" + offender
+ "\"");
         }
 
-        private void noDelimiter(char[] buf, int offset, int len, char delimiter)
+        private void NoDelimiter(char[] buf, int offset, int len, char delimiter)
         {
             for (int idx = 0; idx < len; idx++)
             {
                 if (buf[offset + idx] == delimiter)
                 {
-                    hasDelimiter(new string(buf, offset, len), delimiter);
+                    HasDelimiter(new string(buf, offset, len), delimiter);
                 }
             }
         }
@@ -190,12 +190,12 @@ namespace Lucene.Net.Facet.Taxonomy
             {
                 int len = components[i].Length;
                 components[i].CopyTo(0, buf, idx, len - 0);
-                noDelimiter(buf, idx, len, delimiter);
+                NoDelimiter(buf, idx, len, delimiter);
                 idx += len;
                 buf[idx++] = delimiter;
             }
             components[upto].CopyTo(0, buf, idx, components[upto].Length - 0);
-            noDelimiter(buf, idx, components[upto].Length, delimiter);
+            NoDelimiter(buf, idx, components[upto].Length, delimiter);
 
             return idx + components[upto].Length - start;
         }
@@ -301,7 +301,7 @@ namespace Lucene.Net.Facet.Taxonomy
             {
                 if (components[i].IndexOf(delimiter) != -1)
                 {
-                    hasDelimiter(components[i], delimiter);
+                    HasDelimiter(components[i], delimiter);
                 }
                 sb.Append(components[i]).Append(delimiter);
             }

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/9604c0f7/src/Lucene.Net.Facet/Taxonomy/FloatAssociationFacetField.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Facet/Taxonomy/FloatAssociationFacetField.cs b/src/Lucene.Net.Facet/Taxonomy/FloatAssociationFacetField.cs
index a1e6c88..8b47430 100644
--- a/src/Lucene.Net.Facet/Taxonomy/FloatAssociationFacetField.cs
+++ b/src/Lucene.Net.Facet/Taxonomy/FloatAssociationFacetField.cs
@@ -38,28 +38,28 @@ namespace Lucene.Net.Facet.Taxonomy
         ///  float association 
         /// </summary>
         public FloatAssociationFacetField(float assoc, string dim, params string[] path)

-            : base(floatToBytesRef(assoc), dim, path)
+            : base(FloatToBytesRef(assoc), dim, path)
         {
         }
 
         /// <summary>
         /// Encodes a {@code float} as a 4-byte <seealso cref="BytesRef"/>. </summary>
-        public static BytesRef floatToBytesRef(float v)
+        public static BytesRef FloatToBytesRef(float v)
         {
-            return IntAssociationFacetField.intToBytesRef(Number.FloatToIntBits(v));
+            return IntAssociationFacetField.IntToBytesRef(Number.FloatToIntBits(v));
         }
 
         /// <summary>
         /// Decodes a previously encoded {@code float}. </summary>
-        public static float bytesRefToFloat(BytesRef b)
+        public static float BytesRefToFloat(BytesRef b)
         {
-            return Number.IntBitsToFloat(IntAssociationFacetField.bytesRefToInt(b));
+            return Number.IntBitsToFloat(IntAssociationFacetField.BytesRefToInt(b));
         }
 
         public override string ToString()
         {
             return "FloatAssociationFacetField(dim=" + dim + " path=" + Arrays.ToString(path)
+ 
-                " value=" + bytesRefToFloat(assoc).ToString("0.0#####", CultureInfo.InvariantCulture)
+ ")";
+                " value=" + BytesRefToFloat(assoc).ToString("0.0#####", CultureInfo.InvariantCulture)
+ ")";
         }
     }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/9604c0f7/src/Lucene.Net.Facet/Taxonomy/IntAssociationFacetField.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Facet/Taxonomy/IntAssociationFacetField.cs b/src/Lucene.Net.Facet/Taxonomy/IntAssociationFacetField.cs
index 417fbd6..1c854fd 100644
--- a/src/Lucene.Net.Facet/Taxonomy/IntAssociationFacetField.cs
+++ b/src/Lucene.Net.Facet/Taxonomy/IntAssociationFacetField.cs
@@ -37,7 +37,7 @@ namespace Lucene.Net.Facet.Taxonomy
         ///  int association 
         /// </summary>
         public IntAssociationFacetField(int assoc, string dim, params string[] path)
-            : base(intToBytesRef(assoc), dim, path)
+            : base(IntToBytesRef(assoc), dim, path)
         {
         }
 
@@ -45,7 +45,7 @@ namespace Lucene.Net.Facet.Taxonomy
         /// Encodes an {@code int} as a 4-byte <seealso cref="BytesRef"/>,
         ///  big-endian. 
         /// </summary>
-        public static BytesRef intToBytesRef(int v)
+        public static BytesRef IntToBytesRef(int v)
         {
 
             byte[] bytes = new byte[4];
@@ -59,7 +59,7 @@ namespace Lucene.Net.Facet.Taxonomy
 
         /// <summary>
         /// Decodes a previously encoded {@code int}. </summary>
-        public static int bytesRefToInt(BytesRef b)
+        public static int BytesRefToInt(BytesRef b)
         {
             return ((b.Bytes[b.Offset] & 0xFF) << 24) | ((b.Bytes[b.Offset + 1]
& 0xFF) << 16) | 
                 ((b.Bytes[b.Offset + 2] & 0xFF) << 8) | (b.Bytes[b.Offset + 3]
& 0xFF);
@@ -67,7 +67,7 @@ namespace Lucene.Net.Facet.Taxonomy
 
         public override string ToString()
         {
-            return "IntAssociationFacetField(dim=" + dim + " path=" + Arrays.ToString(path)
+ " value=" + bytesRefToInt(assoc) + ")";
+            return "IntAssociationFacetField(dim=" + dim + " path=" + Arrays.ToString(path)
+ " value=" + BytesRefToInt(assoc) + ")";
         }
     }
 }
\ No newline at end of file


Mime
View raw message