Question: Write a WebPageIndex class that will contain the index representation of a web page. This class will help you transfer a web page (text file

 Write a WebPageIndex class that will contain the index representation of

Write a WebPageIndex class that will contain the index representation of a web page. This class will help you transfer a web page (text file in this assignment) into an AVLTreeMap, where each key refers to each word appearing in the document, and each value represents a list containing the positions of this word in the file. Your WebPageIndex class should satisfy the following requirements (you can create more instance variables/functions if you want): 1) Implement a __init --(self, file) function that initilizes an instance of Web- PageIndex from a txt file. Must have an attribute specifying the path of the file used for initilizing the WebPageIndex instance. Lower case all words appearing in the input file. 2) Implement a getCount(s) function that returns the number of times the words appeared on the page. 3) Test your WebPageIndex class using data/docl.txt

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!