java.lang.Object
model.logic.server.dictionary.Dictionary
-
Constructor Summary
ConstructorsConstructorDescriptionDictionary(String... fileNames) The Dictionary function takes in a list of file names and adds the words from each file to the bloom filter. -
Method Summary
-
Constructor Details
-
Dictionary
The Dictionary function takes in a list of file names and adds the words from each file to the bloom filter.- Parameters:
fileNames- fileNames Allow the user to pass in an arbitrary number of file names
-
-
Method Details
-
query
The query function takes in a string and returns true if the word is in the dictionary, false otherwise.- Parameters:
word- word Query the bloom filter- Returns:
- True if the word is in the data structure
-
challenge
The challenge function takes in a word and checks if it is in the dictionary. If it is, then the word will be added to LRU cache. Otherwise, it will be added to LFU cache.- Parameters:
word- word Search for the word in the files- Returns:
- True if the word is found in any of the files, and false otherwise
-