lucenenet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From synhers...@apache.org
Subject [32/50] [abbrv] lucenenet git commit: Suggest: Return List<T> rather than IList<T> from methods to prevent having to do too many O(n) list operations. Namely, the Sort() method doesn't exist on IList<T>. But accept IList<T> as input where possible.
Date Sun, 02 Oct 2016 14:35:50 GMT
Suggest: Return List<T> rather than IList<T> from methods to prevent having to
do too many O(n) list operations.
Namely, the Sort() method doesn't exist on IList<T>. But accept IList<T> as input
where possible.


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

Branch: refs/heads/master
Commit: 183ae70430b3832c47ad8fde54463588e01d4216
Parents: e5132a4
Author: Shad Storhaug <shad@shadstorhaug.com>
Authored: Sun Sep 18 23:33:58 2016 +0700
Committer: Shad Storhaug <shad@shadstorhaug.com>
Committed: Sun Oct 2 17:44:55 2016 +0700

----------------------------------------------------------------------
 .../Suggest/Analyzing/AnalyzingInfixSuggester.cs  | 12 ++++++------
 .../Suggest/Analyzing/AnalyzingSuggester.cs       | 12 ++++++------
 .../Suggest/Analyzing/BlendedInfixSuggester.cs    |  6 +++---
 .../Suggest/Analyzing/FSTUtil.cs                  |  4 ++--
 .../Suggest/Analyzing/FreeTextSuggester.cs        |  8 ++++----
 .../Suggest/Analyzing/FuzzySuggester.cs           |  4 ++--
 .../Suggest/Fst/FSTCompletion.cs                  | 14 +++++++-------
 .../Suggest/Fst/FSTCompletionLookup.cs            |  2 +-
 .../Suggest/Fst/WFSTCompletionLookup.cs           |  8 ++++----
 .../Suggest/Jaspell/JaspellLookup.cs              |  4 ++--
 .../Suggest/Jaspell/JaspellTernarySearchTrie.cs   | 18 +++++++++---------
 src/Lucene.Net.Suggest/Suggest/Lookup.cs          |  4 ++--
 src/Lucene.Net.Suggest/Suggest/Tst/TSTLookup.cs   |  4 ++--
 13 files changed, 50 insertions(+), 50 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucenenet/blob/183ae704/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 5847224..aa64d7f 100644
--- a/src/Lucene.Net.Suggest/Suggest/Analyzing/AnalyzingInfixSuggester.cs
+++ b/src/Lucene.Net.Suggest/Suggest/Analyzing/AnalyzingInfixSuggester.cs
@@ -366,7 +366,7 @@ namespace Lucene.Net.Search.Suggest.Analyzing
             }
         }
 
-        public override IList<LookupResult> DoLookup(string key, IEnumerable<BytesRef>
contexts, bool onlyMorePopular, int num)
+        public override List<LookupResult> DoLookup(string key, IEnumerable<BytesRef>
contexts, bool onlyMorePopular, int num)
         {
             return DoLookup(key, contexts, num, true, true);
         }
@@ -374,7 +374,7 @@ namespace Lucene.Net.Search.Suggest.Analyzing
         /// <summary>
         /// Lookup, without any context.
         /// </summary>
-        public virtual IList<LookupResult> DoLookup(string key, int num, bool allTermsRequired,
bool doHighlight)
+        public virtual List<LookupResult> DoLookup(string key, int num, bool allTermsRequired,
bool doHighlight)
         {
             return DoLookup(key, null, num, allTermsRequired, doHighlight);
         }
@@ -400,7 +400,7 @@ namespace Lucene.Net.Search.Suggest.Analyzing
         ///  must match (<paramref name="allTermsRequired"/>) and whether the hits
         ///  should be highlighted (<paramref name="doHighlight"/>). 
         /// </summary>
-        public virtual IList<LookupResult> DoLookup(string key, IEnumerable<BytesRef>
contexts, int num, bool allTermsRequired, bool doHighlight)
+        public virtual List<LookupResult> DoLookup(string key, IEnumerable<BytesRef>
contexts, int num, bool allTermsRequired, bool doHighlight)
         {
 
             if (searcherMgr == null)
@@ -518,7 +518,7 @@ namespace Lucene.Net.Search.Suggest.Analyzing
             // only retrieve the first num hits now:
             Collector c2 = new EarlyTerminatingSortingCollector(c, SORT, num);
             IndexSearcher searcher = searcherMgr.Acquire();
-            IList<LookupResult> results = null;
+            List<LookupResult> results = null;
             try
             {
                 //System.out.println("got searcher=" + searcher);
@@ -545,7 +545,7 @@ namespace Lucene.Net.Search.Suggest.Analyzing
         /// Create the results based on the search hits.
         /// Can be overridden by subclass to add particular behavior (e.g. weight transformation)
</summary>
         /// <exception cref="System.IO.IOException"> If there are problems reading
fields from the underlying Lucene index. </exception>
-        protected internal virtual IList<LookupResult> CreateResults(IndexSearcher
searcher, TopFieldDocs hits, int num, string charSequence, bool doHighlight, IEnumerable<string>
matchedTokens, string prefixToken)
+        protected internal virtual List<LookupResult> CreateResults(IndexSearcher searcher,
TopFieldDocs hits, int num, string charSequence, bool doHighlight, IEnumerable<string>
matchedTokens, string prefixToken)
         {
 
             BinaryDocValues textDV = MultiDocValues.GetBinaryValues(searcher.IndexReader,
TEXT_FIELD_NAME);
@@ -554,7 +554,7 @@ namespace Lucene.Net.Search.Suggest.Analyzing
             // TODO: maybe just stored fields?  they compress...
             BinaryDocValues payloadsDV = MultiDocValues.GetBinaryValues(searcher.IndexReader,
"payloads");
             IList<AtomicReaderContext> leaves = searcher.IndexReader.Leaves;
-            IList<LookupResult> results = new List<LookupResult>();
+            List<LookupResult> results = new List<LookupResult>();
             BytesRef scratch = new BytesRef();
             for (int i = 0; i < hits.ScoreDocs.Length; i++)
             {

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/183ae704/src/Lucene.Net.Suggest/Suggest/Analyzing/AnalyzingSuggester.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Suggest/Suggest/Analyzing/AnalyzingSuggester.cs b/src/Lucene.Net.Suggest/Suggest/Analyzing/AnalyzingSuggester.cs
index 95d4ff6..711a5ef 100644
--- a/src/Lucene.Net.Suggest/Suggest/Analyzing/AnalyzingSuggester.cs
+++ b/src/Lucene.Net.Suggest/Suggest/Analyzing/AnalyzingSuggester.cs
@@ -722,7 +722,7 @@ namespace Lucene.Net.Search.Suggest.Analyzing
             }
         }
 
-        public override IList<LookupResult> DoLookup(string key, IEnumerable<BytesRef>
contexts, bool onlyMorePopular, int num)
+        public override List<LookupResult> DoLookup(string key, IEnumerable<BytesRef>
contexts, bool onlyMorePopular, int num)
         {
             Debug.Assert(num > 0);
 
@@ -736,7 +736,7 @@ namespace Lucene.Net.Search.Suggest.Analyzing
             }
             if (fst == null)
             {
-                return Collections.EmptyList<LookupResult>();
+                return new List<LookupResult>();
             }
 
             //System.out.println("lookup key=" + key + " num=" + num);
@@ -774,9 +774,9 @@ namespace Lucene.Net.Search.Suggest.Analyzing
 
                 var scratchArc = new FST.Arc<PairOutputs<long?, BytesRef>.Pair>();
 
-                IList<LookupResult> results = new List<LookupResult>();
+                List<LookupResult> results = new List<LookupResult>();
 
-                IList<FSTUtil.Path<PairOutputs<long?, BytesRef>.Pair>>
prefixPaths =
+                List<FSTUtil.Path<PairOutputs<long?, BytesRef>.Pair>> prefixPaths
=
                     FSTUtil.IntersectPrefixPaths(ConvertAutomaton(lookupAutomaton), fst);
 
                 if (exactFirst)
@@ -956,8 +956,8 @@ namespace Lucene.Net.Search.Suggest.Analyzing
         /// <summary>
         /// Returns all prefix paths to initialize the search.
         /// </summary>
-        protected internal virtual IList<FSTUtil.Path<PairOutputs<long?, BytesRef>.Pair>>
GetFullPrefixPaths(
-            IList<FSTUtil.Path<PairOutputs<long?, BytesRef>.Pair>> prefixPaths,
Automaton lookupAutomaton,
+        protected internal virtual List<FSTUtil.Path<PairOutputs<long?, BytesRef>.Pair>>
GetFullPrefixPaths(
+            List<FSTUtil.Path<PairOutputs<long?, BytesRef>.Pair>> prefixPaths,
Automaton lookupAutomaton,
             FST<PairOutputs<long?, BytesRef>.Pair> fst)
         {
             return prefixPaths;

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/183ae704/src/Lucene.Net.Suggest/Suggest/Analyzing/BlendedInfixSuggester.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Suggest/Suggest/Analyzing/BlendedInfixSuggester.cs b/src/Lucene.Net.Suggest/Suggest/Analyzing/BlendedInfixSuggester.cs
index fb3ba65..a5098a8 100644
--- a/src/Lucene.Net.Suggest/Suggest/Analyzing/BlendedInfixSuggester.cs
+++ b/src/Lucene.Net.Suggest/Suggest/Analyzing/BlendedInfixSuggester.cs
@@ -115,13 +115,13 @@ namespace Lucene.Net.Search.Suggest.Analyzing
             this.numFactor = numFactor;
         }
 
-        public override IList<Lookup.LookupResult> DoLookup(string key, IEnumerable<BytesRef>
contexts, bool onlyMorePopular, int num)
+        public override List<Lookup.LookupResult> DoLookup(string key, IEnumerable<BytesRef>
contexts, bool onlyMorePopular, int num)
         {
             // here we multiply the number of searched element by the defined factor
             return base.DoLookup(key, contexts, onlyMorePopular, num * numFactor);
         }
 
-        public override IList<Lookup.LookupResult> DoLookup(string key, IEnumerable<BytesRef>
contexts, int num, bool allTermsRequired, bool doHighlight)
+        public override List<Lookup.LookupResult> DoLookup(string key, IEnumerable<BytesRef>
contexts, int num, bool allTermsRequired, bool doHighlight)
         {
             // here we multiply the number of searched element by the defined factor
             return base.DoLookup(key, contexts, num * numFactor, allTermsRequired, doHighlight);
@@ -141,7 +141,7 @@ namespace Lucene.Net.Search.Suggest.Analyzing
             }
         }
 
-        protected internal override IList<Lookup.LookupResult> CreateResults(IndexSearcher
searcher, TopFieldDocs hits,
+        protected internal override List<Lookup.LookupResult> CreateResults(IndexSearcher
searcher, TopFieldDocs hits,
             int num, string key, bool doHighlight, IEnumerable<string> matchedTokens,
string prefixToken)
         {
 

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/183ae704/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 2c23a23..6912f2c 100644
--- a/src/Lucene.Net.Suggest/Suggest/Analyzing/FSTUtil.cs
+++ b/src/Lucene.Net.Suggest/Suggest/Analyzing/FSTUtil.cs
@@ -71,11 +71,11 @@ namespace Lucene.Net.Search.Suggest.Analyzing
         /// Enumerates all minimal prefix paths in the automaton that also intersect the
<see cref="FST"/>,
         /// accumulating the <see cref="FST"/> end node and output for each path.
         /// </summary>
-        public static IList<Path<T>> IntersectPrefixPaths<T>(Automaton
a, FST<T> fst)
+        public static List<Path<T>> IntersectPrefixPaths<T>(Automaton a,
FST<T> fst)
         {
             Debug.Assert(a.Deterministic);
             IList<Path<T>> queue = new List<Path<T>>();
-            IList<Path<T>> endNodes = new List<Path<T>>();
+            List<Path<T>> endNodes = new List<Path<T>>();
             queue.Add(new Path<T>(a.InitialState, fst.GetFirstArc(new FST.Arc<T>()),
fst.Outputs.NoOutput, new IntsRef()));
 
             FST.Arc<T> scratchArc = new FST.Arc<T>();

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/183ae704/src/Lucene.Net.Suggest/Suggest/Analyzing/FreeTextSuggester.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Suggest/Suggest/Analyzing/FreeTextSuggester.cs b/src/Lucene.Net.Suggest/Suggest/Analyzing/FreeTextSuggester.cs
index 3bd5f4d..5b40ca2 100644
--- a/src/Lucene.Net.Suggest/Suggest/Analyzing/FreeTextSuggester.cs
+++ b/src/Lucene.Net.Suggest/Suggest/Analyzing/FreeTextSuggester.cs
@@ -482,19 +482,19 @@ namespace Lucene.Net.Search.Suggest.Analyzing
             return true;
         }
 
-        public override IList<LookupResult> DoLookup(string key, bool onlyMorePopular,
int num) // ignored
+        public override List<LookupResult> DoLookup(string key, bool onlyMorePopular,
int num) // ignored
         {
             return DoLookup(key, null, onlyMorePopular, num);
         }
 
         /// <summary>
         /// Lookup, without any context. </summary>
-        public virtual IList<LookupResult> DoLookup(string key, int num)
+        public virtual List<LookupResult> DoLookup(string key, int num)
         {
             return DoLookup(key, null, true, num);
         }
 
-        public override IList<LookupResult> DoLookup(string key, IEnumerable<BytesRef>
contexts, bool onlyMorePopular, int num) // ignored
+        public override List<LookupResult> DoLookup(string key, IEnumerable<BytesRef>
contexts, /* ignored */ bool onlyMorePopular, int num)
         {
             return DoLookup(key, contexts, num);
         }
@@ -524,7 +524,7 @@ namespace Lucene.Net.Search.Suggest.Analyzing
         /// <summary>
         /// Retrieve suggestions.
         /// </summary>
-        public virtual IList<LookupResult> DoLookup(string key, IEnumerable<BytesRef>
contexts, int num)
+        public virtual List<LookupResult> DoLookup(string key, IEnumerable<BytesRef>
contexts, int num)
         {
             if (contexts != null)
             {

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/183ae704/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 c81f03d..51da2b3 100644
--- a/src/Lucene.Net.Suggest/Suggest/Analyzing/FuzzySuggester.cs
+++ b/src/Lucene.Net.Suggest/Suggest/Analyzing/FuzzySuggester.cs
@@ -171,8 +171,8 @@ namespace Lucene.Net.Search.Suggest.Analyzing
             this.unicodeAware = unicodeAware;
         }
 
-        protected internal override IList<FSTUtil.Path<PairOutputs<long?, BytesRef>.Pair>>
GetFullPrefixPaths(
-            IList<FSTUtil.Path<PairOutputs<long?, BytesRef>.Pair>> prefixPaths,

+        protected internal override List<FSTUtil.Path<PairOutputs<long?, BytesRef>.Pair>>
GetFullPrefixPaths(
+            List<FSTUtil.Path<PairOutputs<long?, BytesRef>.Pair>> prefixPaths,

             Automaton lookupAutomaton, 
             FST<PairOutputs<long?, BytesRef>.Pair> fst)
         {

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/183ae704/src/Lucene.Net.Suggest/Suggest/Fst/FSTCompletion.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Suggest/Suggest/Fst/FSTCompletion.cs b/src/Lucene.Net.Suggest/Suggest/Fst/FSTCompletion.cs
index aba5fdd..1b91762 100644
--- a/src/Lucene.Net.Suggest/Suggest/Fst/FSTCompletion.cs
+++ b/src/Lucene.Net.Suggest/Suggest/Fst/FSTCompletion.cs
@@ -80,7 +80,7 @@ namespace Lucene.Net.Search.Suggest.Fst
         /// An empty result. Keep this an <see cref="List"/> to keep all the returned
         /// lists of single type (monomorphic calls).
         /// </summary>
-        private static readonly IList<Completion> EMPTY_RESULT = new List<Completion>();
+        private static readonly List<Completion> EMPTY_RESULT = new List<Completion>();
 
         /// <summary>
         /// Finite state automaton encoding all the lookup terms. See class notes for
@@ -225,7 +225,7 @@ namespace Lucene.Net.Search.Suggest.Fst
         ///          At most this number of suggestions will be returned. </param>
         /// <returns> Returns the suggestions, sorted by their approximated weight
first
         ///         (decreasing) and then alphabetically (UTF-8 codepoint order). </returns>
-        public virtual IList<Completion> DoLookup(string key, int num)
+        public virtual List<Completion> DoLookup(string key, int num)
         {
             if (key.Length == 0 || automaton == null)
             {
@@ -261,16 +261,16 @@ namespace Lucene.Net.Search.Suggest.Fst
         /// constant</c>. This is a workaround: in general, use constant weights for
         /// alphabetically sorted result.
         /// </summary>
-        private IList<Completion> LookupSortedAlphabetically(BytesRef key, int num)
+        private List<Completion> LookupSortedAlphabetically(BytesRef key, int num)
         {
             // Greedily get num results from each weight branch.
-            var res = new List<Completion>(LookupSortedByWeight(key, num, true));
+            var res = LookupSortedByWeight(key, num, true);
 
             // Sort and trim.
             res.Sort();
             if (res.Count > num)
             {
-                res = new List<Completion>(res.SubList(0, num));
+                res = res.GetRange(0, num - 0);
             }
             return res;
         }
@@ -283,7 +283,7 @@ namespace Lucene.Net.Search.Suggest.Fst
         ///          <paramref name="num"/> suggestions have been collected. If
         ///          <c>false</c>, it will collect suggestions from all weight
         ///          arcs (needed for <see cref="LookupSortedAlphabetically"/>. </param>
-        private IList<Completion> LookupSortedByWeight(BytesRef key, int num, bool
collectAll)
+        private List<Completion> LookupSortedByWeight(BytesRef key, int num, bool collectAll)
         {
             // Don't overallocate the results buffers. This also serves the purpose of
             // allowing the user of this class to request all matches using Integer.MAX_VALUE
as
@@ -342,7 +342,7 @@ namespace Lucene.Net.Search.Suggest.Fst
         /// Returns <c>true<c> if and only if <paramref name="list"/> contained
         /// <paramref name="key"/>.
         /// </returns>
-        private bool CheckExistingAndReorder(List<Completion> list, BytesRef key)
+        private bool CheckExistingAndReorder(IList<Completion> list, BytesRef key)
         {
             // We assume list does not have duplicates (because of how the FST is created).
             for (int i = list.Count; --i >= 0; )

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/183ae704/src/Lucene.Net.Suggest/Suggest/Fst/FSTCompletionLookup.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Suggest/Suggest/Fst/FSTCompletionLookup.cs b/src/Lucene.Net.Suggest/Suggest/Fst/FSTCompletionLookup.cs
index 6cbb8ae..8f07e25 100644
--- a/src/Lucene.Net.Suggest/Suggest/Fst/FSTCompletionLookup.cs
+++ b/src/Lucene.Net.Suggest/Suggest/Fst/FSTCompletionLookup.cs
@@ -249,7 +249,7 @@ namespace Lucene.Net.Search.Suggest.Fst
             return (int)value;
         }
 
-        public override IList<LookupResult> DoLookup(string key, IEnumerable<BytesRef>
contexts, bool higherWeightsFirst, int num)
+        public override List<LookupResult> DoLookup(string key, IEnumerable<BytesRef>
contexts, bool higherWeightsFirst, int num)
         {
             if (contexts != null)
             {

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/183ae704/src/Lucene.Net.Suggest/Suggest/Fst/WFSTCompletionLookup.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Suggest/Suggest/Fst/WFSTCompletionLookup.cs b/src/Lucene.Net.Suggest/Suggest/Fst/WFSTCompletionLookup.cs
index 147d85b..582f5b1 100644
--- a/src/Lucene.Net.Suggest/Suggest/Fst/WFSTCompletionLookup.cs
+++ b/src/Lucene.Net.Suggest/Suggest/Fst/WFSTCompletionLookup.cs
@@ -132,7 +132,7 @@ namespace Lucene.Net.Search.Suggest.Fst
             return true;
         }
 
-        public override IList<LookupResult> DoLookup(string key, IEnumerable<BytesRef>
contexts, bool onlyMorePopular, int num)
+        public override List<LookupResult> DoLookup(string key, IEnumerable<BytesRef>
contexts, bool onlyMorePopular, int num)
         {
             if (contexts != null)
             {
@@ -147,7 +147,7 @@ namespace Lucene.Net.Search.Suggest.Fst
 
             if (fst == null)
             {
-                return Collections.EmptyList<LookupResult>();
+                return new List<LookupResult>();
             }
 
             BytesRef scratch = new BytesRef(key);
@@ -167,10 +167,10 @@ namespace Lucene.Net.Search.Suggest.Fst
 
             if (prefixOutput == null)
             {
-                return Collections.EmptyList<LookupResult>();
+                return new List<LookupResult>();
             }
 
-            IList<LookupResult> results = new List<LookupResult>(num);
+            List<LookupResult> results = new List<LookupResult>(num);
             CharsRef spare = new CharsRef();
             if (exactFirst && arc.IsFinal)
             {

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/183ae704/src/Lucene.Net.Suggest/Suggest/Jaspell/JaspellLookup.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Suggest/Suggest/Jaspell/JaspellLookup.cs b/src/Lucene.Net.Suggest/Suggest/Jaspell/JaspellLookup.cs
index ca474a4..a222949 100644
--- a/src/Lucene.Net.Suggest/Suggest/Jaspell/JaspellLookup.cs
+++ b/src/Lucene.Net.Suggest/Suggest/Jaspell/JaspellLookup.cs
@@ -107,13 +107,13 @@ namespace Lucene.Net.Search.Suggest.Jaspell
             return trie.Get(key);
         }
 
-        public override IList<LookupResult> DoLookup(string key, IEnumerable<BytesRef>
contexts, bool onlyMorePopular, int num)
+        public override List<LookupResult> DoLookup(string key, IEnumerable<BytesRef>
contexts, bool onlyMorePopular, int num)
         {
             if (contexts != null)
             {
                 throw new System.ArgumentException("this suggester doesn't support contexts");
             }
-            IList<LookupResult> res = new List<LookupResult>();
+            List<LookupResult> res = new List<LookupResult>();
             IList<string> list;
             int count = onlyMorePopular ? num * 2 : num;
             if (usePrefix)

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/183ae704/src/Lucene.Net.Suggest/Suggest/Jaspell/JaspellTernarySearchTrie.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Suggest/Suggest/Jaspell/JaspellTernarySearchTrie.cs b/src/Lucene.Net.Suggest/Suggest/Jaspell/JaspellTernarySearchTrie.cs
index 442007b..86d52f6 100644
--- a/src/Lucene.Net.Suggest/Suggest/Jaspell/JaspellTernarySearchTrie.cs
+++ b/src/Lucene.Net.Suggest/Suggest/Jaspell/JaspellTernarySearchTrie.cs
@@ -689,7 +689,7 @@ namespace Lucene.Net.Search.Suggest.Jaspell
         /// <param name="key">
         ///          The target key. </param>
         /// <returns> A <see cref="List{String}"/> with the results. </returns>
-        public virtual IList<string> MatchAlmost(string key)
+        public virtual List<string> MatchAlmost(string key)
         {
             return MatchAlmost(key, defaultNumReturnValues);
         }
@@ -709,7 +709,7 @@ namespace Lucene.Net.Search.Suggest.Jaspell
         /// <param name="key"> The target key. </param>
         /// <param name="numReturnValues"> The maximum number of values returned by
this method. </param>
         /// <returns> A <see cref="List{String}"/> with the results </returns>
-        public virtual IList<string> MatchAlmost(string key, int numReturnValues)
+        public virtual List<string> MatchAlmost(string key, int numReturnValues)
         {
             return MatchAlmostRecursion(rootNode, 0, matchAlmostDiff, key, ((numReturnValues
< 0) ? -1 : numReturnValues), new List<string>(), false);
         }
@@ -737,14 +737,14 @@ namespace Lucene.Net.Search.Suggest.Jaspell
         /// <param name="matchAlmostKey">
         ///          The key being searched. </param>
         /// <returns> A <see cref="List{String}"/> with the results. </returns>
-        private IList<string> MatchAlmostRecursion(TSTNode currentNode, int charIndex,
int d, string matchAlmostKey, int matchAlmostNumReturnValues, IList<string> matchAlmostResult2,
bool upTo)
+        private List<string> MatchAlmostRecursion(TSTNode currentNode, int charIndex,
int d, string matchAlmostKey, int matchAlmostNumReturnValues, List<string> matchAlmostResult2,
bool upTo)
         {
             if ((currentNode == null) || (matchAlmostNumReturnValues != -1 && matchAlmostResult2.Count
>= matchAlmostNumReturnValues) || (d < 0) || (charIndex >= matchAlmostKey.Length))
             {
                 return matchAlmostResult2;
             }
             int charComp = CompareCharsAlphabetically(matchAlmostKey[charIndex], currentNode.splitchar,
this.culture);
-            IList<string> matchAlmostResult = matchAlmostResult2;
+            List<string> matchAlmostResult = matchAlmostResult2;
             if ((d > 0) || (charComp < 0))
             {
                 matchAlmostResult = MatchAlmostRecursion(currentNode.relatives[TSTNode.LOKID],
charIndex, d, matchAlmostKey, matchAlmostNumReturnValues, matchAlmostResult, upTo);
@@ -771,7 +771,7 @@ namespace Lucene.Net.Search.Suggest.Jaspell
         /// <param name="prefix"> Each key returned from this method will begin with
the characters
         ///          in prefix. </param>
         /// <returns> A <see cref="List{String}"/> with the results. </returns>
-        public virtual IList<string> MatchPrefix(string prefix)
+        public virtual List<string> MatchPrefix(string prefix)
         {
             return MatchPrefix(prefix, defaultNumReturnValues);
         }
@@ -785,7 +785,7 @@ namespace Lucene.Net.Search.Suggest.Jaspell
         ///          in prefix. </param>
         /// <param name="numReturnValues"> The maximum number of values returned from
this method. </param>
         /// <returns> A <see cref="List{String}"/> with the results </returns>
-        public virtual IList<string> MatchPrefix(string prefix, int numReturnValues)
+        public virtual List<string> MatchPrefix(string prefix, int numReturnValues)
         {
             List<string> sortKeysResult = new List<string>();
             TSTNode startNode = GetNode(prefix);
@@ -962,7 +962,7 @@ namespace Lucene.Net.Search.Suggest.Jaspell
         /// <param name="numReturnValues">
         ///          The maximum number of values returned from this method. </param>
         /// <returns> A <see cref="List{String}"/> with the results. </returns>
-        protected internal virtual IList<string> SortKeys(TSTNode startNode, int numReturnValues)
+        protected internal virtual List<string> SortKeys(TSTNode startNode, int numReturnValues)
         {
             return SortKeysRecursion(startNode, ((numReturnValues < 0) ? -1 : numReturnValues),
new List<string>());
         }
@@ -984,13 +984,13 @@ namespace Lucene.Net.Search.Suggest.Jaspell
         /// <param name="sortKeysResult2">
         ///          The results so far. </param>
         /// <returns> A <see cref="List{String}"/> with the results. </returns>
-        private IList<string> SortKeysRecursion(TSTNode currentNode, int sortKeysNumReturnValues,
IList<string> sortKeysResult2)
+        private List<string> SortKeysRecursion(TSTNode currentNode, int sortKeysNumReturnValues,
List<string> sortKeysResult2)
         {
             if (currentNode == null)
             {
                 return sortKeysResult2;
             }
-            IList<string> sortKeysResult = SortKeysRecursion(currentNode.relatives[TSTNode.LOKID],
sortKeysNumReturnValues, sortKeysResult2);
+            List<string> sortKeysResult = SortKeysRecursion(currentNode.relatives[TSTNode.LOKID],
sortKeysNumReturnValues, sortKeysResult2);
             if (sortKeysNumReturnValues != -1 && sortKeysResult.Count >= sortKeysNumReturnValues)
             {
                 return sortKeysResult;

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/183ae704/src/Lucene.Net.Suggest/Suggest/Lookup.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Suggest/Suggest/Lookup.cs b/src/Lucene.Net.Suggest/Suggest/Lookup.cs
index 50867c8..892bd00 100644
--- a/src/Lucene.Net.Suggest/Suggest/Lookup.cs
+++ b/src/Lucene.Net.Suggest/Suggest/Lookup.cs
@@ -260,7 +260,7 @@ namespace Lucene.Net.Search.Suggest
         /// <param name="onlyMorePopular"> return only more popular results </param>
         /// <param name="num"> maximum number of results to return </param>
         /// <returns> a list of possible completions, with their relative weight (e.g.
popularity) </returns>
-        public virtual IList<LookupResult> DoLookup(string key, bool onlyMorePopular,
int num)
+        public virtual List<LookupResult> DoLookup(string key, bool onlyMorePopular,
int num)
         {
             return DoLookup(key, null, onlyMorePopular, num);
         }
@@ -273,7 +273,7 @@ namespace Lucene.Net.Search.Suggest
         /// <param name="onlyMorePopular"> return only more popular results </param>
         /// <param name="num"> maximum number of results to return </param>
         /// <returns> a list of possible completions, with their relative weight (e.g.
popularity) </returns>
-        public abstract IList<LookupResult> DoLookup(string key, IEnumerable<BytesRef>
contexts, bool onlyMorePopular, int num);
+        public abstract List<LookupResult> DoLookup(string key, IEnumerable<BytesRef>
contexts, bool onlyMorePopular, int num);
 
         /// <summary>
         /// Persist the constructed lookup data to a directory. Optional operation. </summary>

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/183ae704/src/Lucene.Net.Suggest/Suggest/Tst/TSTLookup.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Suggest/Suggest/Tst/TSTLookup.cs b/src/Lucene.Net.Suggest/Suggest/Tst/TSTLookup.cs
index 80da708..a8d7a69 100644
--- a/src/Lucene.Net.Suggest/Suggest/Tst/TSTLookup.cs
+++ b/src/Lucene.Net.Suggest/Suggest/Tst/TSTLookup.cs
@@ -129,14 +129,14 @@ namespace Lucene.Net.Search.Suggest.Tst
             return true;
         }
        
-        public override IList<LookupResult> DoLookup(string key, IEnumerable<BytesRef>
contexts, bool onlyMorePopular, int num)
+        public override List<LookupResult> DoLookup(string key, IEnumerable<BytesRef>
contexts, bool onlyMorePopular, int num)
         {
             if (contexts != null)
             {
                 throw new System.ArgumentException("this suggester doesn't support contexts");
             }
             IList<TernaryTreeNode> list = autocomplete.PrefixCompletion(root, key,
0);
-            IList<LookupResult> res = new List<LookupResult>();
+            List<LookupResult> res = new List<LookupResult>();
             if (list == null || list.Count == 0)
             {
                 return res;


Mime
View raw message