Create a new class Freq that uses the Linear Probing hash table t,o perform a frequency analysis of a sa of filas as follows. First, implement the method add_file(self , filename). which reads each word from the file into the hash table, in such a way that the data associated to the word is its .occurrence count”, i.e., the number of times the word has been “added’ to the hash table (which is the same as the number ‘This is known as
Zit’s law. You Can read more at https://en.wikipedia.org/rikiaipfX27s_law
of times it has already appeared in the file). The class (and its methods) must keep track of the number of occurrences wax for the most common word read. Then, implement a method rarity(self, word) that given a word. returns its rarity score. Download some ebooks as text files from https://www.guteriberg.org/ and use Freq to read these files into your hash table. At the end of this process the table will store the number of times each word appears in the texts. We will consider the resulting hash table as a reasonably accurate representation of the frequency of words in the English language. Make sure you use the data you collected in the previous tasks to select an appropriate table size for the selected text files. Also, modify _setite,_ to call rehash when the load of the hash table is above 0.5. rather than when full (this will not be used if you choose an appropriate table size, but is more realistic for cases where you do not know the number or size of the books being read).