Assignment Description
Through this assignment we want to implement a dictionary of words. We intend to help our user to find the meaning and synonyms of an entered word using the trie data structure.
Data Items
A trie node must consist of the following data items:
1. Meaning of the word.
2. List of synonyms of the word.
3. Array of pointers of type trie node of length 26.
4. Flag that indicates the completion of the word.
You can add other data items as per your logic.
Operations
The “TRIE” class must have the following methods.
1. void CreateDictionary("..\\trie\\dictionary.txt")
Requirements: None
Result: A trie is created from dictionary.txt. The file is in the following format:
-piper
--someone who plays the bagpipe bagpiper
musician
player
instrumentalist
-pecked
--(of a bird) strike or bite something with its beak.
strike
beak
pick
The line starting with single dash (-) consists of the word. The line starting with double dash (--) consists of the meaning of the word. Afterwards the lines without any dashes consist of the synonyms until the next word or end of file.
2. vector< string> OutputAscending()
Requirements: Trie is not empty.
Result: Output all the words in ascending order.
3. bool FindWord(key)
Requirements: Trie is not empty.
Result: Search for the word with the given key.
4. vector< string> FindSynonyms(key)
Requirements: Trie is not empty.
Result: Search for all the synonyms for a given key.
5. string FindMeaning(key)
Requirements: Trie is not empty.
Result: Search for the meaning of a given word.
6. vector< string> OutputPrefix(prefix)
Requirements: Trie is not empty.
Result: Search for all the words with the given prefix.
7. vector< string> OutputSE(length)
Requirements: Trie is not empty.
Result: Search for all the words equal and smaller than the given length.
Answers
Answered by
0
Answer:
h75zjsu5xju5xmutxmu6dj57djd76dj6uyd
Similar questions