Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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 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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started