lucenenet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From synhers...@apache.org
Subject [31/50] [abbrv] lucenenet git commit: Suggest: general housekeeping
Date Sun, 02 Oct 2016 14:35:49 GMT
Suggest: general housekeeping


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

Branch: refs/heads/master
Commit: e5132a40184080e291fbe87dac9eb193ef6dffa5
Parents: da1b0ef
Author: Shad Storhaug <shad@shadstorhaug.com>
Authored: Sun Sep 18 22:59:28 2016 +0700
Committer: Shad Storhaug <shad@shadstorhaug.com>
Committed: Sun Oct 2 17:44:53 2016 +0700

----------------------------------------------------------------------
 .../Suggest/Analyzing/AnalyzingInfixSuggester.cs          |  6 ++++--
 src/Lucene.Net.Suggest/Suggest/Analyzing/FSTUtil.cs       |  1 -
 .../Suggest/Analyzing/FuzzySuggester.cs                   |  8 ++++++--
 src/Lucene.Net.Suggest/Suggest/BufferedInputIterator.cs   | 10 +++++-----
 src/Lucene.Net.Suggest/Suggest/SortedInputIterator.cs     |  4 +++-
 .../Suggest/SortedTermFreqIteratorWrapper.cs              |  3 ++-
 src/Lucene.Net.Suggest/Suggest/Tst/TSTAutocomplete.cs     |  1 -
 7 files changed, 20 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucenenet/blob/e5132a40/src/Lucene.Net.Suggest/Suggest/Analyzing/AnalyzingInfixSuggester.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Suggest/Suggest/Analyzing/AnalyzingInfixSuggester.cs b/src/Lucene.Net.Suggest/Suggest/Analyzing/AnalyzingInfixSuggester.cs
index d839260..5847224 100644
--- a/src/Lucene.Net.Suggest/Suggest/Analyzing/AnalyzingInfixSuggester.cs
+++ b/src/Lucene.Net.Suggest/Suggest/Analyzing/AnalyzingInfixSuggester.cs
@@ -133,7 +133,8 @@ namespace Lucene.Net.Search.Suggest.Analyzing
         ///     Prefixes shorter than this are indexed as character
         ///     ngrams (increasing index size but making lookups
         ///     faster). </param>
-        public AnalyzingInfixSuggester(LuceneVersion matchVersion, Directory dir, Analyzer
indexAnalyzer, Analyzer queryAnalyzer, int minPrefixChars)
+        public AnalyzingInfixSuggester(LuceneVersion matchVersion, Directory dir, Analyzer
indexAnalyzer, 
+            Analyzer queryAnalyzer, int minPrefixChars)
         {
 
             if (minPrefixChars < 0)
@@ -159,7 +160,8 @@ namespace Lucene.Net.Search.Suggest.Analyzing
         /// Override this to customize index settings, e.g. which
         /// codec to use. 
         /// </summary>
-        protected internal virtual IndexWriterConfig GetIndexWriterConfig(LuceneVersion matchVersion,
Analyzer indexAnalyzer, IndexWriterConfig.OpenMode_e openMode)
+        protected internal virtual IndexWriterConfig GetIndexWriterConfig(LuceneVersion matchVersion,

+            Analyzer indexAnalyzer, IndexWriterConfig.OpenMode_e openMode)
         {
             IndexWriterConfig iwc = new IndexWriterConfig(matchVersion, indexAnalyzer);
             iwc.SetCodec(new Lucene46Codec());

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/e5132a40/src/Lucene.Net.Suggest/Suggest/Analyzing/FSTUtil.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Suggest/Suggest/Analyzing/FSTUtil.cs b/src/Lucene.Net.Suggest/Suggest/Analyzing/FSTUtil.cs
index 3aed4d4..2c23a23 100644
--- a/src/Lucene.Net.Suggest/Suggest/Analyzing/FSTUtil.cs
+++ b/src/Lucene.Net.Suggest/Suggest/Analyzing/FSTUtil.cs
@@ -83,7 +83,6 @@ namespace Lucene.Net.Search.Suggest.Analyzing
 
             while (queue.Count != 0)
             {
-                //Path<T> path = queue.RemoveAt(queue.Count - 1);
                 Path<T> path = queue.ElementAt(queue.Count - 1);
                 queue.Remove(path);
                 if (path.state.Accept)

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/e5132a40/src/Lucene.Net.Suggest/Suggest/Analyzing/FuzzySuggester.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Suggest/Suggest/Analyzing/FuzzySuggester.cs b/src/Lucene.Net.Suggest/Suggest/Analyzing/FuzzySuggester.cs
index a01da75..c81f03d 100644
--- a/src/Lucene.Net.Suggest/Suggest/Analyzing/FuzzySuggester.cs
+++ b/src/Lucene.Net.Suggest/Suggest/Analyzing/FuzzySuggester.cs
@@ -117,7 +117,9 @@ namespace Lucene.Net.Search.Suggest.Analyzing
         /// <param name="queryAnalyzer">
         ///           <see cref="Analyzer"/> that will be used for analyzing query
text during lookup </param>
         public FuzzySuggester(Analyzer indexAnalyzer, Analyzer queryAnalyzer)
-            : this(indexAnalyzer, queryAnalyzer, EXACT_FIRST | PRESERVE_SEP, 256, -1, true,
DEFAULT_MAX_EDITS, DEFAULT_TRANSPOSITIONS, DEFAULT_NON_FUZZY_PREFIX, DEFAULT_MIN_FUZZY_LENGTH,
DEFAULT_UNICODE_AWARE)
+            : this(indexAnalyzer, queryAnalyzer, EXACT_FIRST | PRESERVE_SEP, 256, -1, true,

+                  DEFAULT_MAX_EDITS, DEFAULT_TRANSPOSITIONS, DEFAULT_NON_FUZZY_PREFIX, 
+                  DEFAULT_MIN_FUZZY_LENGTH, DEFAULT_UNICODE_AWARE)
         {
         }
 
@@ -144,7 +146,9 @@ namespace Lucene.Net.Search.Suggest.Analyzing
         /// <param name="nonFuzzyPrefix"> length of common (non-fuzzy) prefix (see
default <see cref="DEFAULT_NON_FUZZY_PREFIX"/> </param>
         /// <param name="minFuzzyLength"> minimum length of lookup key before any edits
are allowed (see default <see cref="DEFAULT_MIN_FUZZY_LENGTH"/>) </param>
         /// <param name="unicodeAware"> operate Unicode code points instead of bytes.
</param>
-        public FuzzySuggester(Analyzer indexAnalyzer, Analyzer queryAnalyzer, int options,
int maxSurfaceFormsPerAnalyzedForm, int maxGraphExpansions, bool preservePositionIncrements,
int maxEdits, bool transpositions, int nonFuzzyPrefix, int minFuzzyLength, bool unicodeAware)
+        public FuzzySuggester(Analyzer indexAnalyzer, Analyzer queryAnalyzer, int options,

+            int maxSurfaceFormsPerAnalyzedForm, int maxGraphExpansions, bool preservePositionIncrements,

+            int maxEdits, bool transpositions, int nonFuzzyPrefix, int minFuzzyLength, bool
unicodeAware)
             : base(indexAnalyzer, queryAnalyzer, options, maxSurfaceFormsPerAnalyzedForm,
maxGraphExpansions, preservePositionIncrements)
         {
             if (maxEdits < 0 || maxEdits > LevenshteinAutomata.MAXIMUM_SUPPORTED_DISTANCE)

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/e5132a40/src/Lucene.Net.Suggest/Suggest/BufferedInputIterator.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Suggest/Suggest/BufferedInputIterator.cs b/src/Lucene.Net.Suggest/Suggest/BufferedInputIterator.cs
index e133411..d56f832 100644
--- a/src/Lucene.Net.Suggest/Suggest/BufferedInputIterator.cs
+++ b/src/Lucene.Net.Suggest/Suggest/BufferedInputIterator.cs
@@ -47,7 +47,7 @@ namespace Lucene.Net.Search.Suggest
         private readonly bool hasPayloads;
         private readonly IComparer<BytesRef> comp;
 
-        private readonly bool hasContexts_Renamed;
+        private readonly bool hasContexts;
 
         /// <summary>
         /// Creates a new iterator, buffering entries from the specified iterator </summary>
@@ -56,7 +56,7 @@ namespace Lucene.Net.Search.Suggest
             BytesRef spare;
             int freqIndex = 0;
             hasPayloads = source.HasPayloads;
-            hasContexts_Renamed = source.HasContexts;
+            hasContexts = source.HasContexts;
             while ((spare = source.Next()) != null)
             {
                 entries.Append(spare);
@@ -64,7 +64,7 @@ namespace Lucene.Net.Search.Suggest
                 {
                     payloads.Append(source.Payload);
                 }
-                if (hasContexts_Renamed)
+                if (hasContexts)
                 {
                     contextSets.Add(source.Contexts);
                 }
@@ -121,7 +121,7 @@ namespace Lucene.Net.Search.Suggest
         {
             get
             {
-                if (hasContexts_Renamed && curPos < contextSets.Count)
+                if (hasContexts && curPos < contextSets.Count)
                 {
                     return contextSets[curPos];
                 }
@@ -131,7 +131,7 @@ namespace Lucene.Net.Search.Suggest
 
         public virtual bool HasContexts
         {
-            get { return hasContexts_Renamed; }
+            get { return hasContexts; }
         }
     }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/e5132a40/src/Lucene.Net.Suggest/Suggest/SortedInputIterator.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Suggest/Suggest/SortedInputIterator.cs b/src/Lucene.Net.Suggest/Suggest/SortedInputIterator.cs
index 719c76d..9b7060a 100644
--- a/src/Lucene.Net.Suggest/Suggest/SortedInputIterator.cs
+++ b/src/Lucene.Net.Suggest/Suggest/SortedInputIterator.cs
@@ -268,7 +268,9 @@ namespace Lucene.Net.Search.Suggest
         /// <summary>
         /// encodes an entry (bytes+(contexts)+(payload)+weight) to the provided writer
         /// </summary>
-        protected internal virtual void Encode(OfflineSorter.ByteSequencesWriter writer,
ByteArrayDataOutput output, byte[] buffer, BytesRef spare, BytesRef payload, IEnumerable<BytesRef>
contexts, long weight)
+        protected internal virtual void Encode(OfflineSorter.ByteSequencesWriter writer,

+            ByteArrayDataOutput output, byte[] buffer, BytesRef spare, BytesRef payload,

+            IEnumerable<BytesRef> contexts, long weight)
         {
             int requiredLength = spare.Length + 8 + ((hasPayloads) ? 2 + payload.Length :
0);
             if (hasContexts)

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/e5132a40/src/Lucene.Net.Suggest/Suggest/SortedTermFreqIteratorWrapper.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Suggest/Suggest/SortedTermFreqIteratorWrapper.cs b/src/Lucene.Net.Suggest/Suggest/SortedTermFreqIteratorWrapper.cs
index ef58e04..67e9838 100644
--- a/src/Lucene.Net.Suggest/Suggest/SortedTermFreqIteratorWrapper.cs
+++ b/src/Lucene.Net.Suggest/Suggest/SortedTermFreqIteratorWrapper.cs
@@ -204,7 +204,8 @@ namespace Lucene.Net.Search.Suggest
         /// <summary>
         /// encodes an entry (bytes+weight) to the provided writer
         /// </summary>
-        protected internal virtual void Encode(OfflineSorter.ByteSequencesWriter writer,
ByteArrayDataOutput output, byte[] buffer, BytesRef spare, long weight)
+        protected internal virtual void Encode(OfflineSorter.ByteSequencesWriter writer,

+            ByteArrayDataOutput output, byte[] buffer, BytesRef spare, long weight)
         {
             if (spare.Length + 8 >= buffer.Length)
             {

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/e5132a40/src/Lucene.Net.Suggest/Suggest/Tst/TSTAutocomplete.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Suggest/Suggest/Tst/TSTAutocomplete.cs b/src/Lucene.Net.Suggest/Suggest/Tst/TSTAutocomplete.cs
index f4a6137..71fcbd6 100644
--- a/src/Lucene.Net.Suggest/Suggest/Tst/TSTAutocomplete.cs
+++ b/src/Lucene.Net.Suggest/Suggest/Tst/TSTAutocomplete.cs
@@ -202,5 +202,4 @@ namespace Lucene.Net.Search.Suggest.Tst
             return suggest;
         }
     }
-
 }
\ No newline at end of file


Mime
View raw message