Question: I am Looking for help implementing this with the code below based on these instructions in python. 2. Problem Statement: has how many occurrences. Instead
I am Looking for help implementing this with the code below based on these instructions in python.

2. Problem Statement: has how many occurrences. Instead of using hashtable, hashmap, or dictionary, we would like to use this tree data structure, trie. The initial trie will have [0,[]] \# which means no occurrence 0 , and no sub-trie on the root node. No occurrence, no sub-trie. There is a trie node of no occurrence and no sub-trie. Then, if a word ' a ' is added, the trie will become [0,[[1,[]]] Then, a sub-trie of [1,[]] is added. This means ' a ' letter occurs once Then, if another word ' ab ' is added. The trie will become [0,[[1,[ None, [1, 0] ]] ]] The black 1 , means ' a ' occurs once. The red 1, means ' ab ' occurs once. The None, means 'aa' never been added to the trie. In summary, Each trie node is a list with 2 elements number_of_occurrence: int, which denotes number of occurrence times for the string which terminated at current node. list_for_sub-tries: list of sub-tries. If this list is an empty list. Then, there is no sub-trie. If it is not an empty list, then, it will have many sub-tries up to the character which has sub-trie. Say, 'aa' has no sub-trie, then a None will be store. 'ab' has a sub-trie, then, we store [1,[]] There is no 'ac' or any string with leading ' a ' and trailing letter after ' b '. There is no need to put more sub-trie into it. Using the length of the list, we know how many letters are on this sub-trie list. To write this program, 1. Use class for Object-Oriented Programming. 2. Numbers, symbols, and punctuation marks are not counted. 3. apple and apples are treated as different words. 4. it's and its considered one same word. (our purpose is to exercise on recursion and tree, not to development tokenization algorithm in this project). 5. we're and we are considered different words. 6. Only consider lowercase, all text should be converted to lowercase first. Therefore, a trie node may have a minimum of 0 sub-trie node and a maximum of 26 sub-trie nodes 7. Read in the "declare.txt". Click this link to download. 8. Enter each word into the trie. If a word has never been added, then, create a new path for it. If the word has been added to the trie, then increate the trie's corresponding occurrence number by 1. 9. Write a _str _ function for the trie can be converted into a string with word-10 - 10. Print out your listing for the number of occurrence for each word in the trie
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
