CPC G06F 16/36 (2019.01) [G06F 16/313 (2019.01); G06F 16/335 (2019.01)] | 18 Claims |
1. A method performed by a processor of a computing device for searching for words within a hierarchical dictionary stored in computer-readable memory, the method comprising:
receiving, by the processor, a word that is to be searched for in the hierarchical dictionary;
determining, by the processor, a hash value for the word;
determining, by the processor and based upon the hash value, that a first layer of the hierarchical dictionary does not include the word, wherein the first layer of the hierarchical dictionary is configured to retain a first plurality of words for a first period of time;
when the first layer of the hierarchical dictionary is determined to not include the word, outputting, by the processor, a notification that the word has not been located in the first layer;
then, determining, by the processor and based upon the hash value, whether or not a second layer of the hierarchical dictionary includes the word, wherein the second layer of the hierarchical dictionary is configured to retain a second plurality of words for a second period of time, wherein the second period of time is less than the first period of time; and
when the second layer of the hierarchical dictionary includes the word, outputting, by the processor, a notification that the word has been located in the second layer;
wherein the first layer has a first word capacity, wherein the second layer has a second word capacity, wherein the first word capacity is greater than the second word capacity;
wherein the first plurality of words are stored in a first hash map stored in the first layer of the hierarchical dictionary, wherein the second plurality of words are stored in a second hash map stored in the second layer of the hierarchical dictionary;
wherein the first hash map of the first layer is augmented with a doubly linked list for keeping track of youngest and oldest words that are stored in the first layer.
|