Lucene.Net.Suggest: Changed all parameters and return types from List<T> to IList<T>
Project: http://git-wip-us.apache.org/repos/asf/lucenenet/repo Commit: http://git-wip-us.apache.org/repos/asf/lucenenet/commit/c2e1a011 Tree: http://git-wip-us.apache.org/repos/asf/lucenenet/tree/c2e1a011 Diff: http://git-wip-us.apache.org/repos/asf/lucenenet/diff/c2e1a011 Branch: refs/heads/api-work Commit: c2e1a011768bade483749929837c68180deddd15 Parents: 3a3b0f1 Author: Shad Storhaug <[email protected]> Authored: Tue Jan 31 19:31:29 2017 +0700 Committer: Shad Storhaug <[email protected]> Committed: Tue Jan 31 19:31:29 2017 +0700 ---------------------------------------------------------------------- .../Analyzing/AnalyzingInfixSuggester.cs | 10 ++--- .../Suggest/Analyzing/AnalyzingSuggester.cs | 10 ++--- .../Suggest/Analyzing/BlendedInfixSuggester.cs | 6 +-- .../Suggest/Analyzing/FSTUtil.cs | 2 +- .../Suggest/Analyzing/FreeTextSuggester.cs | 8 ++-- .../Suggest/Analyzing/FuzzySuggester.cs | 4 +- .../Suggest/Fst/FSTCompletion.cs | 2 +- .../Suggest/Fst/FSTCompletionLookup.cs | 2 +- .../Suggest/Fst/WFSTCompletionLookup.cs | 2 +- .../Suggest/Jaspell/JaspellLookup.cs | 2 +- .../Suggest/Jaspell/JaspellTernarySearchTrie.cs | 44 ++++++++++---------- src/Lucene.Net.Suggest/Suggest/Lookup.cs | 4 +- .../Suggest/Tst/TSTAutocomplete.cs | 2 +- src/Lucene.Net.Suggest/Suggest/Tst/TSTLookup.cs | 2 +- 14 files changed, 50 insertions(+), 50 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c2e1a011/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 806c22b..5dd491d 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 List<LookupResult> DoLookup(string key, IEnumerable<BytesRef> contexts, bool onlyMorePopular, int num) + public override IList<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 List<LookupResult> DoLookup(string key, int num, bool allTermsRequired, bool doHighlight) + public virtual IList<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 List<LookupResult> DoLookup(string key, IEnumerable<BytesRef> contexts, int num, bool allTermsRequired, bool doHighlight) + public virtual IList<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: ICollector c2 = new EarlyTerminatingSortingCollector(c, SORT, num); IndexSearcher searcher = searcherMgr.Acquire(); - List<LookupResult> results = null; + IList<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 List<LookupResult> CreateResults(IndexSearcher searcher, TopFieldDocs hits, int num, string charSequence, bool doHighlight, IEnumerable<string> matchedTokens, string prefixToken) + protected internal virtual IList<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); http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c2e1a011/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 e00a466..7b03a26 100644 --- a/src/Lucene.Net.Suggest/Suggest/Analyzing/AnalyzingSuggester.cs +++ b/src/Lucene.Net.Suggest/Suggest/Analyzing/AnalyzingSuggester.cs @@ -705,7 +705,7 @@ namespace Lucene.Net.Search.Suggest.Analyzing } } - public override List<LookupResult> DoLookup(string key, IEnumerable<BytesRef> contexts, bool onlyMorePopular, int num) + public override IList<LookupResult> DoLookup(string key, IEnumerable<BytesRef> contexts, bool onlyMorePopular, int num) { Debug.Assert(num > 0); @@ -757,9 +757,9 @@ namespace Lucene.Net.Search.Suggest.Analyzing var scratchArc = new FST.Arc<PairOutputs<long?, BytesRef>.Pair>(); - List<LookupResult> results = new List<LookupResult>(); + IList<LookupResult> results = new List<LookupResult>(); - List<FSTUtil.Path<PairOutputs<long?, BytesRef>.Pair>> prefixPaths = + IList<FSTUtil.Path<PairOutputs<long?, BytesRef>.Pair>> prefixPaths = FSTUtil.IntersectPrefixPaths(ConvertAutomaton(lookupAutomaton), fst); if (exactFirst) @@ -939,8 +939,8 @@ namespace Lucene.Net.Search.Suggest.Analyzing /// <summary> /// Returns all prefix paths to initialize the search. /// </summary> - protected internal virtual List<FSTUtil.Path<PairOutputs<long?, BytesRef>.Pair>> GetFullPrefixPaths( - List<FSTUtil.Path<PairOutputs<long?, BytesRef>.Pair>> prefixPaths, Automaton lookupAutomaton, + protected internal virtual IList<FSTUtil.Path<PairOutputs<long?, BytesRef>.Pair>> GetFullPrefixPaths( + IList<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/c2e1a011/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 8df5f20..61608a1 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 List<Lookup.LookupResult> DoLookup(string key, IEnumerable<BytesRef> contexts, bool onlyMorePopular, int num) + public override IList<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 List<Lookup.LookupResult> DoLookup(string key, IEnumerable<BytesRef> contexts, int num, bool allTermsRequired, bool doHighlight) + public override IList<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 List<Lookup.LookupResult> CreateResults(IndexSearcher searcher, TopFieldDocs hits, + protected internal override IList<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/c2e1a011/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 bf07131..ca4fe37 100644 --- a/src/Lucene.Net.Suggest/Suggest/Analyzing/FSTUtil.cs +++ b/src/Lucene.Net.Suggest/Suggest/Analyzing/FSTUtil.cs @@ -71,7 +71,7 @@ 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 List<Path<T>> IntersectPrefixPaths<T>(Automaton a, FST<T> fst) + public static IList<Path<T>> IntersectPrefixPaths<T>(Automaton a, FST<T> fst) { Debug.Assert(a.IsDeterministic); IList<Path<T>> queue = new List<Path<T>>(); http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c2e1a011/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 2d24d3c..e1e0da9 100644 --- a/src/Lucene.Net.Suggest/Suggest/Analyzing/FreeTextSuggester.cs +++ b/src/Lucene.Net.Suggest/Suggest/Analyzing/FreeTextSuggester.cs @@ -483,19 +483,19 @@ namespace Lucene.Net.Search.Suggest.Analyzing return true; } - public override List<LookupResult> DoLookup(string key, bool onlyMorePopular, int num) // ignored + public override IList<LookupResult> DoLookup(string key, bool onlyMorePopular, int num) // ignored { return DoLookup(key, null, onlyMorePopular, num); } /// <summary> /// Lookup, without any context. </summary> - public virtual List<LookupResult> DoLookup(string key, int num) + public virtual IList<LookupResult> DoLookup(string key, int num) { return DoLookup(key, null, true, num); } - public override List<LookupResult> DoLookup(string key, IEnumerable<BytesRef> contexts, /* ignored */ bool onlyMorePopular, int num) + public override IList<LookupResult> DoLookup(string key, IEnumerable<BytesRef> contexts, /* ignored */ bool onlyMorePopular, int num) { return DoLookup(key, contexts, num); } @@ -525,7 +525,7 @@ namespace Lucene.Net.Search.Suggest.Analyzing /// <summary> /// Retrieve suggestions. /// </summary> - public virtual List<LookupResult> DoLookup(string key, IEnumerable<BytesRef> contexts, int num) + public virtual IList<LookupResult> DoLookup(string key, IEnumerable<BytesRef> contexts, int num) { if (contexts != null) { http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c2e1a011/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 ce49db4..dac0de3 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 List<FSTUtil.Path<PairOutputs<long?, BytesRef>.Pair>> GetFullPrefixPaths( - List<FSTUtil.Path<PairOutputs<long?, BytesRef>.Pair>> prefixPaths, + protected internal override IList<FSTUtil.Path<PairOutputs<long?, BytesRef>.Pair>> GetFullPrefixPaths( + IList<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/c2e1a011/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 87596f9..5d2bd73 100644 --- a/src/Lucene.Net.Suggest/Suggest/Fst/FSTCompletion.cs +++ b/src/Lucene.Net.Suggest/Suggest/Fst/FSTCompletion.cs @@ -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 List<Completion> DoLookup(string key, int num) + public virtual IList<Completion> DoLookup(string key, int num) { if (key.Length == 0 || automaton == null) { http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c2e1a011/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 8f07e25..6cbb8ae 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 List<LookupResult> DoLookup(string key, IEnumerable<BytesRef> contexts, bool higherWeightsFirst, int num) + public override IList<LookupResult> DoLookup(string key, IEnumerable<BytesRef> contexts, bool higherWeightsFirst, int num) { if (contexts != null) { http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c2e1a011/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 b46183f..fd4ac67 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 List<LookupResult> DoLookup(string key, IEnumerable<BytesRef> contexts, bool onlyMorePopular, int num) + public override IList<LookupResult> DoLookup(string key, IEnumerable<BytesRef> contexts, bool onlyMorePopular, int num) { if (contexts != null) { http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c2e1a011/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 4bd7953..f91503d 100644 --- a/src/Lucene.Net.Suggest/Suggest/Jaspell/JaspellLookup.cs +++ b/src/Lucene.Net.Suggest/Suggest/Jaspell/JaspellLookup.cs @@ -107,7 +107,7 @@ namespace Lucene.Net.Search.Suggest.Jaspell return trie.Get(key); } - public override List<LookupResult> DoLookup(string key, IEnumerable<BytesRef> contexts, bool onlyMorePopular, int num) + public override IList<LookupResult> DoLookup(string key, IEnumerable<BytesRef> contexts, bool onlyMorePopular, int num) { if (contexts != null) { http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c2e1a011/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 98a91fb..722147c 100644 --- a/src/Lucene.Net.Suggest/Suggest/Jaspell/JaspellTernarySearchTrie.cs +++ b/src/Lucene.Net.Suggest/Suggest/Jaspell/JaspellTernarySearchTrie.cs @@ -675,7 +675,7 @@ namespace Lucene.Net.Search.Suggest.Jaspell } /// <summary> - /// Returns a <see cref="List{String}"/> of keys that almost match the argument key. + /// Returns a <see cref="IList{String}"/> of keys that almost match the argument key. /// Keys returned will have exactly diff characters that do not match the /// target key, where diff is equal to the last value set /// to the <see cref="MatchAlmostDiff"/> property. @@ -688,14 +688,14 @@ namespace Lucene.Net.Search.Suggest.Jaspell /// </summary> /// <param name="key"> /// The target key. </param> - /// <returns> A <see cref="List{String}"/> with the results. </returns> - public virtual List<string> MatchAlmost(string key) + /// <returns> A <see cref="IList{String}"/> with the results. </returns> + public virtual IList<string> MatchAlmost(string key) { return MatchAlmost(key, defaultNumReturnValues); } /// <summary> - /// Returns a <see cref="List{String}"/> of keys that almost match the argument key. + /// Returns a <see cref="IList{String}"/> of keys that almost match the argument key. /// Keys returned will have exactly diff characters that do not match the /// target key, where diff is equal to the last value set /// to the <see cref="MatchAlmostDiff"/> property. @@ -708,8 +708,8 @@ namespace Lucene.Net.Search.Suggest.Jaspell /// </summary> /// <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 List<string> MatchAlmost(string key, int numReturnValues) + /// <returns> A <see cref="IList{String}"/> with the results </returns> + public virtual IList<string> MatchAlmost(string key, int numReturnValues) { return MatchAlmostRecursion(rootNode, 0, matchAlmostDiff, key, ((numReturnValues < 0) ? -1 : numReturnValues), new List<string>(), false); } @@ -736,15 +736,15 @@ namespace Lucene.Net.Search.Suggest.Jaspell /// <see cref="MatchAlmostDiff"/> number of mismatched letters. </param> /// <param name="matchAlmostKey"> /// The key being searched. </param> - /// <returns> A <see cref="List{String}"/> with the results. </returns> - private List<string> MatchAlmostRecursion(TSTNode currentNode, int charIndex, int d, string matchAlmostKey, int matchAlmostNumReturnValues, List<string> matchAlmostResult2, bool upTo) + /// <returns> A <see cref="IList{String}"/> with the results. </returns> + private IList<string> MatchAlmostRecursion(TSTNode currentNode, int charIndex, int d, string matchAlmostKey, int matchAlmostNumReturnValues, IList<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); - List<string> matchAlmostResult = matchAlmostResult2; + IList<string> matchAlmostResult = matchAlmostResult2; if ((d > 0) || (charComp < 0)) { matchAlmostResult = MatchAlmostRecursion(currentNode.relatives[TSTNode.LOKID], charIndex, d, matchAlmostKey, matchAlmostNumReturnValues, matchAlmostResult, upTo); @@ -764,28 +764,28 @@ namespace Lucene.Net.Search.Suggest.Jaspell } /// <summary> - /// Returns an alphabetical <see cref="List{String}"/> of all keys in the trie that + /// Returns an alphabetical <see cref="IList{String}"/> of all keys in the trie that /// begin with a given prefix. Only keys for nodes having non-null data are - /// included in the <see cref="List{String}"/>. + /// included in the <see cref="IList{String}"/>. /// </summary> /// <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 List<string> MatchPrefix(string prefix) + /// <returns> A <see cref="IList{String}"/> with the results. </returns> + public virtual IList<string> MatchPrefix(string prefix) { return MatchPrefix(prefix, defaultNumReturnValues); } /// <summary> - /// Returns an alphabetical <see cref="List{String}"/> of all keys in the trie that + /// Returns an alphabetical <see cref="IList{String}"/> of all keys in the trie that /// begin with a given prefix. Only keys for nodes having non-null data are - /// included in the <see cref="List{String}"/>. + /// included in the <see cref="IList{String}"/>. /// </summary> /// <param name="prefix"> Each key returned from this method will begin with the characters /// 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 List<string> MatchPrefix(string prefix, int numReturnValues) + /// <returns> A <see cref="IList{String}"/> with the results </returns> + public virtual IList<string> MatchPrefix(string prefix, int numReturnValues) { List<string> sortKeysResult = new List<string>(); TSTNode startNode = GetNode(prefix); @@ -961,8 +961,8 @@ namespace Lucene.Net.Search.Suggest.Jaspell /// The top node defining the subtrie to be searched. </param> /// <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 List<string> SortKeys(TSTNode startNode, int numReturnValues) + /// <returns> A <see cref="IList{String}"/> with the results. </returns> + protected internal virtual IList<string> SortKeys(TSTNode startNode, int numReturnValues) { return SortKeysRecursion(startNode, ((numReturnValues < 0) ? -1 : numReturnValues), new List<string>()); } @@ -983,14 +983,14 @@ namespace Lucene.Net.Search.Suggest.Jaspell /// The maximum number of values in the result. </param> /// <param name="sortKeysResult2"> /// The results so far. </param> - /// <returns> A <see cref="List{String}"/> with the results. </returns> - private List<string> SortKeysRecursion(TSTNode currentNode, int sortKeysNumReturnValues, List<string> sortKeysResult2) + /// <returns> A <see cref="IList{String}"/> with the results. </returns> + private IList<string> SortKeysRecursion(TSTNode currentNode, int sortKeysNumReturnValues, IList<string> sortKeysResult2) { if (currentNode == null) { return sortKeysResult2; } - List<string> sortKeysResult = SortKeysRecursion(currentNode.relatives[TSTNode.LOKID], sortKeysNumReturnValues, sortKeysResult2); + IList<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/c2e1a011/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 1c78170..bca5275 100644 --- a/src/Lucene.Net.Suggest/Suggest/Lookup.cs +++ b/src/Lucene.Net.Suggest/Suggest/Lookup.cs @@ -257,7 +257,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 List<LookupResult> DoLookup(string key, bool onlyMorePopular, int num) + public virtual IList<LookupResult> DoLookup(string key, bool onlyMorePopular, int num) { return DoLookup(key, null, onlyMorePopular, num); } @@ -270,7 +270,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 List<LookupResult> DoLookup(string key, IEnumerable<BytesRef> contexts, bool onlyMorePopular, int num); + public abstract IList<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/c2e1a011/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 71fcbd6..8772597 100644 --- a/src/Lucene.Net.Suggest/Suggest/Tst/TSTAutocomplete.cs +++ b/src/Lucene.Net.Suggest/Suggest/Tst/TSTAutocomplete.cs @@ -126,7 +126,7 @@ namespace Lucene.Net.Search.Suggest.Tst /// index of current character to be searched while traversing through /// the prefix in TST. </param> /// <returns> suggest list of auto-completed keys for the given prefix query. </returns> - public virtual List<TernaryTreeNode> PrefixCompletion(TernaryTreeNode root, string s, int x) + public virtual IList<TernaryTreeNode> PrefixCompletion(TernaryTreeNode root, string s, int x) { TernaryTreeNode p = root; http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c2e1a011/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 e8d407e..362b5e8 100644 --- a/src/Lucene.Net.Suggest/Suggest/Tst/TSTLookup.cs +++ b/src/Lucene.Net.Suggest/Suggest/Tst/TSTLookup.cs @@ -131,7 +131,7 @@ namespace Lucene.Net.Search.Suggest.Tst return true; } - public override List<LookupResult> DoLookup(string key, IEnumerable<BytesRef> contexts, bool onlyMorePopular, int num) + public override IList<LookupResult> DoLookup(string key, IEnumerable<BytesRef> contexts, bool onlyMorePopular, int num) { if (contexts != null) {
