Closed caroltang0331 closed 3 years ago
I feel confused about this as well. Also, technically, when the given prefix is "sh", shouldn't the first candidate be "sh" since it is the shortest word that starts with "sh"?
"sh" is not a word in the dictionary tho, so prolly wont show up as a candidate unless its picked before
"sh" is not a word in the dictionary tho, so prolly wont show up as a candidate unless its picked before
Thank you so much for your response! I thought it was in the provided text file. How should I check if it is a word in the dictionary though?
oh wait it was. I missed it. Sorry. u were right i think it should be the first suggestion then. Also do you know how to get that file into IntelliJ, just copy paste?
The function that reads a text file is already provided in AutoComplete and AutoCompleteHW will call its superclass' constructor to read the file. So try this in your main method: AutocompleteHW hw = new AutocompleteHW("src/main/resources/dict.txt", #maxCandidates, e.g. 20).
Thanks so much! hmm so when i copy the dict.txt file to the main/resources folder on my IntelliJ, got an error saying file is too large. do u hv that problem? might just go office hr this hw is so hard even to start
Thanks so much! hmm so when i copy the dict.txt file to the main/resources folder on my IntelliJ, got an error saying file is too large. do u hv that problem? might just go office hr this hw is so hard even to start
Yeah I got the same message. But if you read carefully, you will realize that the message appears only because certain functions of IntelliJ are disabled when the file is too large. You can still use it and browse thorough it.
thanks its working now!
In the unit test, the max = 20, but why do the three expected have only 3 or 4 strings instead of 20 strings?