Commit 7bbf9131 authored by James C Bowden's avatar James C Bowden
Browse files

getCompletions ideque --> icollection (untested)

parent 565e93f6
No related merge requests found
Pipeline #62721 failed with stage
in 0 seconds
Showing with 3 additions and 2 deletions
+3 -2
......@@ -13,7 +13,7 @@ public interface ITrieMap<A, K extends Iterable<A>, V> extends IDictionary<K, V>
* @param prefix the prefix to search for in the trie
* @return the values corresponding to the keys starting with the given prefix
*/
public IDeque<V> getCompletions(K prefix);
public ICollection<V> getCompletions(K prefix);
/**
* Removes all elements from the trie.
......
......@@ -3,6 +3,7 @@ package wordcorrector;
import edu.caltech.cs2.datastructures.IterableString;
import edu.caltech.cs2.datastructures.LinkedDeque;
import edu.caltech.cs2.datastructures.TrieMap;
import edu.caltech.cs2.interfaces.ICollection;
import edu.caltech.cs2.interfaces.IDeque;
import java.io.File;
......@@ -45,7 +46,7 @@ public class AutoCompleteTrie extends TrieMap<Character, IterableString, AutoCom
* Retrieves keys that have the given key as a prefix
*/
public IDeque<IterableString> autocomplete(String keyString) {
IDeque<Word> completions = this.getCompletions(new IterableString(keyString));
ICollection<Word> completions = this.getCompletions(new IterableString(keyString));
IDeque<IterableString> suggestions = new LinkedDeque<>();
for (Word completion : completions) {
suggestions.add(new IterableString(completion.word));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment