You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucenenet.apache.org by sy...@apache.org on 2014/11/14 12:06:49 UTC
[1/7] lucenenet git commit: Fix html syntax in XML comments
Repository: lucenenet
Updated Branches:
refs/heads/master 4f1399f4b -> 58ccdea29
Fix html syntax in XML comments
Project: http://git-wip-us.apache.org/repos/asf/lucenenet/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucenenet/commit/a3f23a75
Tree: http://git-wip-us.apache.org/repos/asf/lucenenet/tree/a3f23a75
Diff: http://git-wip-us.apache.org/repos/asf/lucenenet/diff/a3f23a75
Branch: refs/heads/master
Commit: a3f23a75ad68b74b4eb98129d15e8044b44513a9
Parents: b5afe76
Author: mdissel <ma...@gmail.com>
Authored: Tue Nov 4 22:44:45 2014 +0100
Committer: mdissel <ma...@gmail.com>
Committed: Tue Nov 4 22:44:45 2014 +0100
----------------------------------------------------------------------
.../Index/ConcurrentMergeScheduler.cs | 2 +-
src/Lucene.Net.Core/Search/DocIdSetIterator.cs | 2 +-
.../Search/NumericRangeFilter.cs | 16 ++++++++--------
src/Lucene.Net.Core/Search/NumericRangeQuery.cs | 20 ++++++++++----------
.../Search/Similarities/IBSimilarity.cs | 2 +-
src/Lucene.Net.Core/Search/Spans/Spans.cs | 2 +-
src/Lucene.Net.Core/Store/Directory.cs | 4 ++--
7 files changed, 24 insertions(+), 24 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/a3f23a75/src/Lucene.Net.Core/Index/ConcurrentMergeScheduler.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Index/ConcurrentMergeScheduler.cs b/src/Lucene.Net.Core/Index/ConcurrentMergeScheduler.cs
index d5863bd..a0b2e4f 100644
--- a/src/Lucene.Net.Core/Index/ConcurrentMergeScheduler.cs
+++ b/src/Lucene.Net.Core/Index/ConcurrentMergeScheduler.cs
@@ -379,7 +379,7 @@ namespace Lucene.Net.Index
/// <summary>
/// Returns the number of merge threads that are alive. Note that this number
- /// is ≤ <seealso cref="#mergeThreads"/> size.
+ /// is <= <seealso cref="#mergeThreads"/> size.
/// </summary>
protected internal virtual int MergeThreadCount()
{
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/a3f23a75/src/Lucene.Net.Core/Search/DocIdSetIterator.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Search/DocIdSetIterator.cs b/src/Lucene.Net.Core/Search/DocIdSetIterator.cs
index 33b44eb..4ec0fec 100644
--- a/src/Lucene.Net.Core/Search/DocIdSetIterator.cs
+++ b/src/Lucene.Net.Core/Search/DocIdSetIterator.cs
@@ -108,7 +108,7 @@ namespace Lucene.Net.Search
/// is greater than the highest document number in the set.
/// <p>
/// The behavior of this method is <b>undefined</b> when called with
- /// <code> target ≤ current</code>, or after the iterator has exhausted.
+ /// <code> target <= current</code>, or after the iterator has exhausted.
/// Both cases may result in unpredicted behavior.
/// <p>
/// When <code> target > current</code> it behaves as if written:
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/a3f23a75/src/Lucene.Net.Core/Search/NumericRangeFilter.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Search/NumericRangeFilter.cs b/src/Lucene.Net.Core/Search/NumericRangeFilter.cs
index fd94ee4..234e4e6 100644
--- a/src/Lucene.Net.Core/Search/NumericRangeFilter.cs
+++ b/src/Lucene.Net.Core/Search/NumericRangeFilter.cs
@@ -105,7 +105,7 @@ namespace Lucene.Net.Search
/// <summary>
/// Factory that creates a <code>NumericRangeFilter</code>, that filters a <code>long</code>
/// range using the given <a href="NumericRangeQuery.html#precisionStepDesc"><code>precisionStep</code></a>.
- /// You can have half-open ranges (which are in fact </≤ or >/≥ queries)
+ /// You can have half-open ranges (which are in fact </<= or >/>= queries)
/// by setting the min or max value to <code>null</code>. By setting inclusive to false, it will
/// match all documents excluding the bounds, with inclusive on, the boundaries are hits, too.
/// </summary>
@@ -117,7 +117,7 @@ namespace Lucene.Net.Search
/// <summary>
/// Factory that creates a <code>NumericRangeFilter</code>, that queries a <code>long</code>
/// range using the default <code>precisionStep</code> <seealso cref="NumericUtils#PRECISION_STEP_DEFAULT"/> (4).
- /// You can have half-open ranges (which are in fact </≤ or >/≥ queries)
+ /// You can have half-open ranges (which are in fact </<= or >/>= queries)
/// by setting the min or max value to <code>null</code>. By setting inclusive to false, it will
/// match all documents excluding the bounds, with inclusive on, the boundaries are hits, too.
/// </summary>
@@ -129,7 +129,7 @@ namespace Lucene.Net.Search
/// <summary>
/// Factory that creates a <code>NumericRangeFilter</code>, that filters a <code>int</code>
/// range using the given <a href="NumericRangeQuery.html#precisionStepDesc"><code>precisionStep</code></a>.
- /// You can have half-open ranges (which are in fact </≤ or >/≥ queries)
+ /// You can have half-open ranges (which are in fact </<= or >/>= queries)
/// by setting the min or max value to <code>null</code>. By setting inclusive to false, it will
/// match all documents excluding the bounds, with inclusive on, the boundaries are hits, too.
/// </summary>
@@ -141,7 +141,7 @@ namespace Lucene.Net.Search
/// <summary>
/// Factory that creates a <code>NumericRangeFilter</code>, that queries a <code>int</code>
/// range using the default <code>precisionStep</code> <seealso cref="NumericUtils#PRECISION_STEP_DEFAULT"/> (4).
- /// You can have half-open ranges (which are in fact </≤ or >/≥ queries)
+ /// You can have half-open ranges (which are in fact </<= or >/>= queries)
/// by setting the min or max value to <code>null</code>. By setting inclusive to false, it will
/// match all documents excluding the bounds, with inclusive on, the boundaries are hits, too.
/// </summary>
@@ -153,7 +153,7 @@ namespace Lucene.Net.Search
/// <summary>
/// Factory that creates a <code>NumericRangeFilter</code>, that filters a <code>double</code>
/// range using the given <a href="NumericRangeQuery.html#precisionStepDesc"><code>precisionStep</code></a>.
- /// You can have half-open ranges (which are in fact </≤ or >/≥ queries)
+ /// You can have half-open ranges (which are in fact </<= or >/>= queries)
/// by setting the min or max value to <code>null</code>.
/// <seealso cref="Double#NaN"/> will never match a half-open range, to hit {@code NaN} use a query
/// with {@code min == max == Double.NaN}. By setting inclusive to false, it will
@@ -167,7 +167,7 @@ namespace Lucene.Net.Search
/// <summary>
/// Factory that creates a <code>NumericRangeFilter</code>, that queries a <code>double</code>
/// range using the default <code>precisionStep</code> <seealso cref="NumericUtils#PRECISION_STEP_DEFAULT"/> (4).
- /// You can have half-open ranges (which are in fact </≤ or >/≥ queries)
+ /// You can have half-open ranges (which are in fact </<= or >/>= queries)
/// by setting the min or max value to <code>null</code>.
/// <seealso cref="Double#NaN"/> will never match a half-open range, to hit {@code NaN} use a query
/// with {@code min == max == Double.NaN}. By setting inclusive to false, it will
@@ -181,7 +181,7 @@ namespace Lucene.Net.Search
/// <summary>
/// Factory that creates a <code>NumericRangeFilter</code>, that filters a <code>float</code>
/// range using the given <a href="NumericRangeQuery.html#precisionStepDesc"><code>precisionStep</code></a>.
- /// You can have half-open ranges (which are in fact </≤ or >/≥ queries)
+ /// You can have half-open ranges (which are in fact </<= or >/>= queries)
/// by setting the min or max value to <code>null</code>.
/// <seealso cref="Float#NaN"/> will never match a half-open range, to hit {@code NaN} use a query
/// with {@code min == max == Float.NaN}. By setting inclusive to false, it will
@@ -195,7 +195,7 @@ namespace Lucene.Net.Search
/// <summary>
/// Factory that creates a <code>NumericRangeFilter</code>, that queries a <code>float</code>
/// range using the default <code>precisionStep</code> <seealso cref="NumericUtils#PRECISION_STEP_DEFAULT"/> (4).
- /// You can have half-open ranges (which are in fact </≤ or >/≥ queries)
+ /// You can have half-open ranges (which are in fact </<= or >/>= queries)
/// by setting the min or max value to <code>null</code>.
/// <seealso cref="Float#NaN"/> will never match a half-open range, to hit {@code NaN} use a query
/// with {@code min == max == Float.NaN}. By setting inclusive to false, it will
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/a3f23a75/src/Lucene.Net.Core/Search/NumericRangeQuery.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Search/NumericRangeQuery.cs b/src/Lucene.Net.Core/Search/NumericRangeQuery.cs
index 0e3db46..689f3fe 100644
--- a/src/Lucene.Net.Core/Search/NumericRangeQuery.cs
+++ b/src/Lucene.Net.Core/Search/NumericRangeQuery.cs
@@ -78,7 +78,7 @@ namespace Lucene.Net.Search
///
/// <p>this query defaults to {@linkplain
/// MultiTermQuery#CONSTANT_SCORE_AUTO_REWRITE_DEFAULT}.
- /// With precision steps of ≤4, this query can be run with
+ /// With precision steps of <=4, this query can be run with
/// one of the BooleanQuery rewrite methods without changing
/// BooleanQuery's default max clause count.
///
@@ -150,7 +150,7 @@ namespace Lucene.Net.Search
/// <li>Ideal value in most cases for <em>32 bit</em> data types <em>(int, float)</em> is <b>4</b>.
/// <li>For low cardinality fields larger precision steps are good. If the cardinality is < 100, it is
/// fair to use <seealso cref="Integer#MAX_VALUE"/> (see below).
- /// <li>Steps <b>≥64</b> for <em>long/double</em> and <b>≥32</b> for <em>int/float</em> produces one token
+ /// <li>Steps <b>>=64</b> for <em>long/double</em> and <b>>=32</b> for <em>int/float</em> produces one token
/// per value in the index and querying is as slow as a conventional <seealso cref="TermRangeQuery"/>. But it can be used
/// to produce fields, that are solely used for sorting (in this case simply use <seealso cref="Integer#MAX_VALUE"/> as
/// <code>precisionStep</code>). Using <seealso cref="IntField"/>,
@@ -518,7 +518,7 @@ namespace Lucene.Net.Search
/// <summary>
/// Factory that creates a <code>NumericRangeQuery</code>, that queries a <code>long</code>
/// range using the given <a href="#precisionStepDesc"><code>precisionStep</code></a>.
- /// You can have half-open ranges (which are in fact </≤ or >/≥ queries)
+ /// You can have half-open ranges (which are in fact </<= or >/>= queries)
/// by setting the min or max value to <code>null</code>. By setting inclusive to false, it will
/// match all documents excluding the bounds, with inclusive on, the boundaries are hits, too.
/// </summary>
@@ -530,7 +530,7 @@ namespace Lucene.Net.Search
/// <summary>
/// Factory that creates a <code>NumericRangeQuery</code>, that queries a <code>long</code>
/// range using the default <code>precisionStep</code> <seealso cref="NumericUtils#PRECISION_STEP_DEFAULT"/> (4).
- /// You can have half-open ranges (which are in fact </≤ or >/≥ queries)
+ /// You can have half-open ranges (which are in fact </<= or >/>= queries)
/// by setting the min or max value to <code>null</code>. By setting inclusive to false, it will
/// match all documents excluding the bounds, with inclusive on, the boundaries are hits, too.
/// </summary>
@@ -542,7 +542,7 @@ namespace Lucene.Net.Search
/// <summary>
/// Factory that creates a <code>NumericRangeQuery</code>, that queries a <code>int</code>
/// range using the given <a href="#precisionStepDesc"><code>precisionStep</code></a>.
- /// You can have half-open ranges (which are in fact </≤ or >/≥ queries)
+ /// You can have half-open ranges (which are in fact </<= or >/>= queries)
/// by setting the min or max value to <code>null</code>. By setting inclusive to false, it will
/// match all documents excluding the bounds, with inclusive on, the boundaries are hits, too.
/// </summary>
@@ -554,7 +554,7 @@ namespace Lucene.Net.Search
/// <summary>
/// Factory that creates a <code>NumericRangeQuery</code>, that queries a <code>int</code>
/// range using the default <code>precisionStep</code> <seealso cref="NumericUtils#PRECISION_STEP_DEFAULT"/> (4).
- /// You can have half-open ranges (which are in fact </≤ or >/≥ queries)
+ /// You can have half-open ranges (which are in fact </<= or >/>= queries)
/// by setting the min or max value to <code>null</code>. By setting inclusive to false, it will
/// match all documents excluding the bounds, with inclusive on, the boundaries are hits, too.
/// </summary>
@@ -566,7 +566,7 @@ namespace Lucene.Net.Search
/// <summary>
/// Factory that creates a <code>NumericRangeQuery</code>, that queries a <code>double</code>
/// range using the given <a href="#precisionStepDesc"><code>precisionStep</code></a>.
- /// You can have half-open ranges (which are in fact </≤ or >/≥ queries)
+ /// You can have half-open ranges (which are in fact </<= or >/>= queries)
/// by setting the min or max value to <code>null</code>.
/// <seealso cref="Double#NaN"/> will never match a half-open range, to hit {@code NaN} use a query
/// with {@code min == max == Double.NaN}. By setting inclusive to false, it will
@@ -580,7 +580,7 @@ namespace Lucene.Net.Search
/// <summary>
/// Factory that creates a <code>NumericRangeQuery</code>, that queries a <code>double</code>
/// range using the default <code>precisionStep</code> <seealso cref="NumericUtils#PRECISION_STEP_DEFAULT"/> (4).
- /// You can have half-open ranges (which are in fact </≤ or >/≥ queries)
+ /// You can have half-open ranges (which are in fact </<= or >/>= queries)
/// by setting the min or max value to <code>null</code>.
/// <seealso cref="Double#NaN"/> will never match a half-open range, to hit {@code NaN} use a query
/// with {@code min == max == Double.NaN}. By setting inclusive to false, it will
@@ -594,7 +594,7 @@ namespace Lucene.Net.Search
/// <summary>
/// Factory that creates a <code>NumericRangeQuery</code>, that queries a <code>float</code>
/// range using the given <a href="#precisionStepDesc"><code>precisionStep</code></a>.
- /// You can have half-open ranges (which are in fact </≤ or >/≥ queries)
+ /// You can have half-open ranges (which are in fact </<= or >/>= queries)
/// by setting the min or max value to <code>null</code>.
/// <seealso cref="Float#NaN"/> will never match a half-open range, to hit {@code NaN} use a query
/// with {@code min == max == Float.NaN}. By setting inclusive to false, it will
@@ -608,7 +608,7 @@ namespace Lucene.Net.Search
/// <summary>
/// Factory that creates a <code>NumericRangeQuery</code>, that queries a <code>float</code>
/// range using the default <code>precisionStep</code> <seealso cref="NumericUtils#PRECISION_STEP_DEFAULT"/> (4).
- /// You can have half-open ranges (which are in fact </≤ or >/≥ queries)
+ /// You can have half-open ranges (which are in fact </<= or >/>= queries)
/// by setting the min or max value to <code>null</code>.
/// <seealso cref="Float#NaN"/> will never match a half-open range, to hit {@code NaN} use a query
/// with {@code min == max == Float.NaN}. By setting inclusive to false, it will
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/a3f23a75/src/Lucene.Net.Core/Search/Similarities/IBSimilarity.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Search/Similarities/IBSimilarity.cs b/src/Lucene.Net.Core/Search/Similarities/IBSimilarity.cs
index 7979a11..014dd04 100644
--- a/src/Lucene.Net.Core/Search/Similarities/IBSimilarity.cs
+++ b/src/Lucene.Net.Core/Search/Similarities/IBSimilarity.cs
@@ -24,7 +24,7 @@ namespace Lucene.Net.Search.Similarities
/// conference on Research and development in information retrieval (SIGIR '10).
/// ACM, New York, NY, USA, 234-241.
/// <p>The retrieval function is of the form <em>RSV(q, d) = ∑
- /// -x<sup>q</sup><sub>w</sub> log Prob(X<sub>w</sub> ≥
+ /// -x<sup>q</sup><sub>w</sub> log Prob(X<sub>w</sub> >=
/// t<sup>d</sup><sub>w</sub> | λ<sub>w</sub>)</em>, where
/// <ul>
/// <li><em>x<sup>q</sup><sub>w</sub></em> is the query boost;</li>
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/a3f23a75/src/Lucene.Net.Core/Search/Spans/Spans.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Search/Spans/Spans.cs b/src/Lucene.Net.Core/Search/Spans/Spans.cs
index d187ba8..41c5129 100644
--- a/src/Lucene.Net.Core/Search/Spans/Spans.cs
+++ b/src/Lucene.Net.Core/Search/Spans/Spans.cs
@@ -35,7 +35,7 @@ namespace Lucene.Net.Search.Spans
/// Skips to the first match beyond the current, whose document number is
/// greater than or equal to <i>target</i>.
/// <p>The behavior of this method is <b>undefined</b> when called with
- /// <code> target ≤ current</code>, or after the iterator has exhausted.
+ /// <code> target <= current</code>, or after the iterator has exhausted.
/// Both cases may result in unpredicted behavior.
/// <p>Returns true iff there is such
/// a match. <p>Behaves as if written: <pre class="prettyprint">
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/a3f23a75/src/Lucene.Net.Core/Store/Directory.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Store/Directory.cs b/src/Lucene.Net.Core/Store/Directory.cs
index 8286867..3d1aa7f 100644
--- a/src/Lucene.Net.Core/Store/Directory.cs
+++ b/src/Lucene.Net.Core/Store/Directory.cs
@@ -66,8 +66,8 @@ namespace Lucene.Net.Store
/// following contract:
/// <ul>
/// <li>Throws <seealso cref="FileNotFoundException"/> or <seealso cref="NoSuchFileException"/>
- /// if the file does not exist.
- /// <li>Returns a value ≥0 if the file exists, which specifies its length.
+ /// if the file does not exist.</li>
+ /// <li>Returns a value >=0 if the file exists, which specifies its length.</li>
/// </ul>
/// </summary>
/// <param name="name"> the name of the file for which to return the length. </param>
[2/7] lucenenet git commit: NRE on file without extension
Posted by sy...@apache.org.
NRE on file without extension
Project: http://git-wip-us.apache.org/repos/asf/lucenenet/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucenenet/commit/a4e8a7a0
Tree: http://git-wip-us.apache.org/repos/asf/lucenenet/tree/a4e8a7a0
Diff: http://git-wip-us.apache.org/repos/asf/lucenenet/diff/a4e8a7a0
Branch: refs/heads/master
Commit: a4e8a7a0614b6ecdfd060fdbf862a955ca817900
Parents: a3f23a7
Author: mdissel <ma...@gmail.com>
Authored: Tue Nov 4 22:45:27 2014 +0100
Committer: mdissel <ma...@gmail.com>
Committed: Tue Nov 4 22:45:27 2014 +0100
----------------------------------------------------------------------
.../Index/BaseIndexFileFormatTestCase.cs | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/a4e8a7a0/src/Lucene.Net.TestFramework/Index/BaseIndexFileFormatTestCase.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.TestFramework/Index/BaseIndexFileFormatTestCase.cs b/src/Lucene.Net.TestFramework/Index/BaseIndexFileFormatTestCase.cs
index 693540e..95cb4e1 100644
--- a/src/Lucene.Net.TestFramework/Index/BaseIndexFileFormatTestCase.cs
+++ b/src/Lucene.Net.TestFramework/Index/BaseIndexFileFormatTestCase.cs
@@ -64,11 +64,13 @@ namespace Lucene.Net.Index
IDictionary<string, long> bytesUsedByExtension = new Dictionary<string, long>();
foreach (string file in d.ListAll())
{
- string ext = IndexFileNames.GetExtension(file);
+ string ext = IndexFileNames.GetExtension(file) ?? string.Empty;
long previousLength = bytesUsedByExtension.ContainsKey(ext) ? bytesUsedByExtension[ext] : 0;
bytesUsedByExtension[ext] = previousLength + d.FileLength(file);
}
- bytesUsedByExtension.Keys.RemoveAll(ExcludedExtensionsFromByteCounts());
+ foreach (string item in ExcludedExtensionsFromByteCounts()) {
+ bytesUsedByExtension.Remove(item);
+ }
return bytesUsedByExtension;
}
[6/7] lucenenet git commit: Merge remote-tracking branch
'mdissel/master'
Posted by sy...@apache.org.
Merge remote-tracking branch 'mdissel/master'
Project: http://git-wip-us.apache.org/repos/asf/lucenenet/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucenenet/commit/f173e122
Tree: http://git-wip-us.apache.org/repos/asf/lucenenet/tree/f173e122
Diff: http://git-wip-us.apache.org/repos/asf/lucenenet/diff/f173e122
Branch: refs/heads/master
Commit: f173e1220999313b2ff74bf8ff44dcbba4513a00
Parents: 65825c1 76fa486
Author: Itamar Syn-Hershko <it...@code972.com>
Authored: Fri Nov 14 12:58:03 2014 +0200
Committer: Itamar Syn-Hershko <it...@code972.com>
Committed: Fri Nov 14 12:58:03 2014 +0200
----------------------------------------------------------------------
.../Index/ConcurrentMergeScheduler.cs | 2 +-
src/Lucene.Net.Core/Search/DocIdSetIterator.cs | 2 +-
.../Search/NumericRangeFilter.cs | 16 ++++++++--------
src/Lucene.Net.Core/Search/NumericRangeQuery.cs | 20 ++++++++++----------
.../Search/Similarities/IBSimilarity.cs | 2 +-
src/Lucene.Net.Core/Search/Spans/Spans.cs | 2 +-
src/Lucene.Net.Core/Store/Directory.cs | 4 ++--
.../Index/BaseIndexFileFormatTestCase.cs | 6 ++++--
.../Search/SearchEquivalenceTestBase.cs | 6 +++---
9 files changed, 31 insertions(+), 29 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/f173e122/src/Lucene.Net.Core/Search/Spans/Spans.cs
----------------------------------------------------------------------
[4/7] lucenenet git commit: More work into Number helper class
Posted by sy...@apache.org.
More work into Number helper class
Project: http://git-wip-us.apache.org/repos/asf/lucenenet/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucenenet/commit/ec71eac8
Tree: http://git-wip-us.apache.org/repos/asf/lucenenet/tree/ec71eac8
Diff: http://git-wip-us.apache.org/repos/asf/lucenenet/diff/ec71eac8
Branch: refs/heads/master
Commit: ec71eac8c20cb87302913ef38d69f9f5934d2edc
Parents: 4f1399f
Author: Itamar Syn-Hershko <it...@code972.com>
Authored: Fri Nov 14 12:56:29 2014 +0200
Committer: Itamar Syn-Hershko <it...@code972.com>
Committed: Fri Nov 14 12:57:05 2014 +0200
----------------------------------------------------------------------
src/Lucene.Net.Core/Support/Number.cs | 32 ++++++++++++++++++++++++------
1 file changed, 26 insertions(+), 6 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/ec71eac8/src/Lucene.Net.Core/Support/Number.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Support/Number.cs b/src/Lucene.Net.Core/Support/Number.cs
index 13bf69e..e3f0744 100644
--- a/src/Lucene.Net.Core/Support/Number.cs
+++ b/src/Lucene.Net.Core/Support/Number.cs
@@ -27,7 +27,7 @@ namespace Lucene.Net.Support
/// <summary>
/// A simple class for number conversions.
/// </summary>
- public class Number
+ public static class Number
{
/// <summary>
/// Min radix value.
@@ -42,16 +42,16 @@ namespace Lucene.Net.Support
/*public const int CHAR_MIN_CODE_POINT =
public const int CHAR_MAX_CODE_POINT = */
- private const System.String digits = "0123456789abcdefghijklmnopqrstuvwxyz";
+ private const string digits = "0123456789abcdefghijklmnopqrstuvwxyz";
/// <summary>
/// Converts a number to System.String.
/// </summary>
/// <param name="number"></param>
/// <returns></returns>
- public static System.String ToString(long number)
+ public static string ToString(long number)
{
- System.Text.StringBuilder s = new System.Text.StringBuilder();
+ var s = new System.Text.StringBuilder();
if (number == 0)
{
@@ -99,12 +99,12 @@ namespace Lucene.Net.Support
/// <param name="i">A number to be converted.</param>
/// <param name="radix">A radix.</param>
/// <returns>A System.String representation of the number in the specified redix.</returns>
- public static System.String ToString(long i, int radix)
+ public static String ToString(long i, int radix)
{
if (radix < MIN_RADIX || radix > MAX_RADIX)
radix = 10;
- char[] buf = new char[65];
+ var buf = new char[65];
int charPos = 64;
bool negative = (i < 0);
@@ -482,5 +482,25 @@ namespace Lucene.Net.Support
long x = BitConverter.DoubleToInt64Bits(d);
return BitConverter.Int64BitsToDouble(FlipEndian(x));
}
+
+ public static bool IsNumber(this object value)
+ {
+ return value is sbyte
+ || value is byte
+ || value is short
+ || value is ushort
+ || value is int
+ || value is uint
+ || value is long
+ || value is ulong
+ || value is float
+ || value is double
+ || value is decimal;
+ }
+
+ public static long DoubleToRawLongBits(double d)
+ {
+ return BitConverter.DoubleToInt64Bits(d);
+ }
}
}
\ No newline at end of file
[5/7] lucenenet git commit: Renaming back to slop
Posted by sy...@apache.org.
Renaming back to slop
Project: http://git-wip-us.apache.org/repos/asf/lucenenet/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucenenet/commit/65825c1d
Tree: http://git-wip-us.apache.org/repos/asf/lucenenet/tree/65825c1d
Diff: http://git-wip-us.apache.org/repos/asf/lucenenet/diff/65825c1d
Branch: refs/heads/master
Commit: 65825c1d62481d02615614f99bbdf786fda0ef79
Parents: ec71eac
Author: Itamar Syn-Hershko <it...@code972.com>
Authored: Fri Nov 14 12:56:43 2014 +0200
Committer: Itamar Syn-Hershko <it...@code972.com>
Committed: Fri Nov 14 12:57:06 2014 +0200
----------------------------------------------------------------------
src/Lucene.Net.Core/Search/PhraseQuery.cs | 22 +++++++++++-----------
1 file changed, 11 insertions(+), 11 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/65825c1d/src/Lucene.Net.Core/Search/PhraseQuery.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Search/PhraseQuery.cs b/src/Lucene.Net.Core/Search/PhraseQuery.cs
index b41f253..de6a1c6 100644
--- a/src/Lucene.Net.Core/Search/PhraseQuery.cs
+++ b/src/Lucene.Net.Core/Search/PhraseQuery.cs
@@ -54,7 +54,7 @@ namespace Lucene.Net.Search
private List<Term> Terms_Renamed = new List<Term>(4);
private List<int?> Positions_Renamed = new List<int?>(4);
private int MaxPosition = 0;
- private int Slop_Renamed = 0;
+ private int slop = 0;
/// <summary>
/// Constructs an empty phrase query. </summary>
@@ -86,11 +86,11 @@ namespace Lucene.Net.Search
{
throw new System.ArgumentException("slop value cannot be negative");
}
- Slop_Renamed = value;
+ slop = value;
}
get
{
- return Slop_Renamed;
+ return slop;
}
}
@@ -380,12 +380,12 @@ namespace Lucene.Net.Search
}
// sort by increasing docFreq order
- if (OuterInstance.Slop_Renamed == 0)
+ if (OuterInstance.slop == 0)
{
ArrayUtil.TimSort(postingsFreqs);
}
- if (OuterInstance.Slop_Renamed == 0) // optimize exact case
+ if (OuterInstance.slop == 0) // optimize exact case
{
ExactPhraseScorer s = new ExactPhraseScorer(this, postingsFreqs, Similarity.DoSimScorer(Stats, context));
if (s.NoDocs)
@@ -399,7 +399,7 @@ namespace Lucene.Net.Search
}
else
{
- return new SloppyPhraseScorer(this, postingsFreqs, OuterInstance.Slop_Renamed, Similarity.DoSimScorer(Stats, context));
+ return new SloppyPhraseScorer(this, postingsFreqs, OuterInstance.slop, Similarity.DoSimScorer(Stats, context));
}
}
@@ -417,7 +417,7 @@ namespace Lucene.Net.Search
int newDoc = scorer.Advance(doc);
if (newDoc == doc)
{
- float freq = OuterInstance.Slop_Renamed == 0 ? scorer.Freq() : ((SloppyPhraseScorer)scorer).SloppyFreq();
+ float freq = OuterInstance.slop == 0 ? scorer.Freq() : ((SloppyPhraseScorer)scorer).SloppyFreq();
SimScorer docScorer = Similarity.DoSimScorer(Stats, context);
ComplexExplanation result = new ComplexExplanation();
result.Description = "weight(" + Query + " in " + doc + ") [" + Similarity.GetType().Name + "], result of:";
@@ -490,10 +490,10 @@ namespace Lucene.Net.Search
}
buffer.Append("\"");
- if (Slop_Renamed != 0)
+ if (slop != 0)
{
buffer.Append("~");
- buffer.Append(Slop_Renamed);
+ buffer.Append(slop);
}
buffer.Append(ToStringUtils.Boost(Boost));
@@ -510,14 +510,14 @@ namespace Lucene.Net.Search
return false;
}
PhraseQuery other = (PhraseQuery)o;
- return (this.Boost == other.Boost) && (this.Slop_Renamed == other.Slop_Renamed) && this.Terms_Renamed.SequenceEqual(other.Terms_Renamed) && this.Positions_Renamed.SequenceEqual(other.Positions_Renamed);
+ return (this.Boost == other.Boost) && (this.slop == other.slop) && this.Terms_Renamed.SequenceEqual(other.Terms_Renamed) && this.Positions_Renamed.SequenceEqual(other.Positions_Renamed);
}
/// <summary>
/// Returns a hash code value for this object. </summary>
public override int GetHashCode()
{
- return Number.FloatToIntBits(Boost) ^ Slop_Renamed ^ Terms_Renamed.GetHashCode() ^ Positions_Renamed.GetHashCode();
+ return Number.FloatToIntBits(Boost) ^ slop ^ Terms_Renamed.GetHashCode() ^ Positions_Renamed.GetHashCode();
}
}
}
\ No newline at end of file
[7/7] lucenenet git commit: Fixing compilation
Posted by sy...@apache.org.
Fixing compilation
Project: http://git-wip-us.apache.org/repos/asf/lucenenet/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucenenet/commit/58ccdea2
Tree: http://git-wip-us.apache.org/repos/asf/lucenenet/tree/58ccdea2
Diff: http://git-wip-us.apache.org/repos/asf/lucenenet/diff/58ccdea2
Branch: refs/heads/master
Commit: 58ccdea29c3221ba931f0692a364f50d5857024a
Parents: f173e12
Author: Itamar Syn-Hershko <it...@code972.com>
Authored: Fri Nov 14 13:05:32 2014 +0200
Committer: Itamar Syn-Hershko <it...@code972.com>
Committed: Fri Nov 14 13:05:32 2014 +0200
----------------------------------------------------------------------
src/Lucene.Net.Core/Document/Field.cs | 3 +--
src/Lucene.Net.Core/Support/Number.cs | 5 -----
.../Index/BaseStoredFieldsFormatTestCase.cs | 6 +++---
3 files changed, 4 insertions(+), 10 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/58ccdea2/src/Lucene.Net.Core/Document/Field.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Document/Field.cs b/src/Lucene.Net.Core/Document/Field.cs
index d93f0f4..2c20987 100644
--- a/src/Lucene.Net.Core/Document/Field.cs
+++ b/src/Lucene.Net.Core/Document/Field.cs
@@ -582,7 +582,6 @@ namespace Lucene.Net.Documents
{
return null;
}
- Number n = new Number();
FieldType.NumericType? numericType = ((FieldType)FieldType()).NumericTypeValue;
if (numericType != null)
{
@@ -592,7 +591,7 @@ namespace Lucene.Net.Documents
// (attributes,...) if not needed (stored field loading)
InternalTokenStream = new NumericTokenStream(Type.NumericPrecisionStep);
}
- NumericTokenStream nts = (NumericTokenStream)InternalTokenStream;
+ var nts = (NumericTokenStream)InternalTokenStream;
// initialize value in TokenStream
object val = FieldsData;
switch (numericType)
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/58ccdea2/src/Lucene.Net.Core/Support/Number.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Support/Number.cs b/src/Lucene.Net.Core/Support/Number.cs
index e3f0744..7b689d9 100644
--- a/src/Lucene.Net.Core/Support/Number.cs
+++ b/src/Lucene.Net.Core/Support/Number.cs
@@ -497,10 +497,5 @@ namespace Lucene.Net.Support
|| value is double
|| value is decimal;
}
-
- public static long DoubleToRawLongBits(double d)
- {
- return BitConverter.DoubleToInt64Bits(d);
- }
}
}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/58ccdea2/src/Lucene.Net.TestFramework/Index/BaseStoredFieldsFormatTestCase.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.TestFramework/Index/BaseStoredFieldsFormatTestCase.cs b/src/Lucene.Net.TestFramework/Index/BaseStoredFieldsFormatTestCase.cs
index c885649..7e555ee 100644
--- a/src/Lucene.Net.TestFramework/Index/BaseStoredFieldsFormatTestCase.cs
+++ b/src/Lucene.Net.TestFramework/Index/BaseStoredFieldsFormatTestCase.cs
@@ -262,9 +262,9 @@ namespace Lucene.Net.Index
public void TestNumericField()
{
Directory dir = NewDirectory();
- RandomIndexWriter w = new RandomIndexWriter(Random(), dir);
- int numDocs = AtLeast(500);
- object[] answers = new Number[numDocs];
+ var w = new RandomIndexWriter(Random(), dir);
+ var numDocs = AtLeast(500);
+ var answers = new object[numDocs];
FieldType.NumericType[] typeAnswers = new FieldType.NumericType[numDocs];
for (int id = 0; id < numDocs; id++)
{
[3/7] lucenenet git commit: Remove static in setup/teardown methods
Posted by sy...@apache.org.
Remove static in setup/teardown methods
Project: http://git-wip-us.apache.org/repos/asf/lucenenet/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucenenet/commit/76fa4868
Tree: http://git-wip-us.apache.org/repos/asf/lucenenet/tree/76fa4868
Diff: http://git-wip-us.apache.org/repos/asf/lucenenet/diff/76fa4868
Branch: refs/heads/master
Commit: 76fa4868e9f6ff046772deb9653c34bb35cb6d5f
Parents: a4e8a7a
Author: mdissel <ma...@gmail.com>
Authored: Tue Nov 4 23:29:24 2014 +0100
Committer: mdissel <ma...@gmail.com>
Committed: Tue Nov 4 23:29:24 2014 +0100
----------------------------------------------------------------------
.../Search/SearchEquivalenceTestBase.cs | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/76fa4868/src/Lucene.Net.TestFramework/Search/SearchEquivalenceTestBase.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.TestFramework/Search/SearchEquivalenceTestBase.cs b/src/Lucene.Net.TestFramework/Search/SearchEquivalenceTestBase.cs
index 04b21e2..2371021 100644
--- a/src/Lucene.Net.TestFramework/Search/SearchEquivalenceTestBase.cs
+++ b/src/Lucene.Net.TestFramework/Search/SearchEquivalenceTestBase.cs
@@ -50,14 +50,14 @@ namespace Lucene.Net.Search
/// </summary>
public abstract class SearchEquivalenceTestBase : LuceneTestCase
{
- protected internal static IndexSearcher S1, S2;
+ protected internal static IndexSearcher S1, S2;
protected internal static Directory Directory;
protected internal static IndexReader Reader;
protected internal static Analyzer Analyzer;
protected internal static string Stopword; // we always pick a character as a stopword
[SetUp]
- public static void BeforeClass()
+ public void BeforeClass()
{
Random random = Random();
Directory = NewDirectory();
@@ -102,7 +102,7 @@ namespace Lucene.Net.Search
}
[TearDown]
- public static void AfterClass()
+ public void AfterClass()
{
Reader.Dispose();
Directory.Dispose();