Question: Part 2 . Filters in WebSearch A web search engine is nothing more than a collection of information that you filter through it to get
Part Filters in WebSearch
A web search engine is nothing more than a collection of information that you filter through it to get the search results. Obviously, it has to be optimized since it is searching through millions of pages and doing a myriad of comparisons, but otherwise, there is a simplicity in its design.
For this project, you will write various filters. A filter is routine that goes over elements of a collection returning only those elements that meet certain criteria. This is often done with a predicate. A predicate is a method with one argument that returns a boolean and serves to answer YesNo questions for each element over a collection.Your job is to add the method to a WebSearch class. The filter method runs through all of the objects stored in the WebSearch object and returns a new list with ONLY those objects that evaluate true with the predicate.
This has will be explained in class, look at the examples in class lecture to follow how to implement this method.With this internal method, you can create various ways to search your data that rely on passing filters. For example, a routine like the one below calls filtero to return objects that match the test, founded after year.You could also return a page that contains a particular phrase'anywhere in the domain or university name. For example:Following this approach, create the WebSearch class as an extension of the WebSearchADT which is given for you. You must implement all of the abstract methods in WebSearchAOT.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
