Package Contract
The feature package provides classes for each feature type. Each feature subclass has methods to compute a feature value and to compare another feature of the same feature type.
It should be relatively simple to keep adding new features by subclassing. Code for computing and comparing features is abstracted into the Feature class, so all other classes can treat all features the same way. Features of a page are computed using a combination of the attributes of the page, such as word frequencies, number of images, interesting things about the URL, and so on.
Fingerprints consist of one or more features. When an incoming page is being checked for acceptability, the same feature is computed for the incoming page. The newly computed feature is compared with the stored feature (associated with this fingerprint function) and a measure of similarity returned. The measure of similarity is compared against the threshold for this fingerprint, and that decides whether the page will be acceptable.
Each Feature subclass implements the two abstract methods computeFeatureValue() and compareFeatureValue() of class Feature separately. Packages using class Feature, however, do not have to know how this is done. For example, the ferret fingerprints will have an instance of one of the Feature subclasses. To determine if a fingerprint function when applied on a page has a value above the threshold, the ferret will call the isPageGood() method (see the fingerprint package for details). The isPageGood() method will call the decidingFunction() method. This method creates an object of the Feature class and computes the feature value using the Feature's computeFeatureValue() method. It then calls compareFeatureValue() to compare the feature value of the new page and that which the ferret had in its fingerprint. The value returned by the compareFeatureValue() method is returned and compared to the threshold by the isPageGood() method.
Package-Level CRC
Collaborators:
Classes in package feature work with classes in the following packages:
Advisor
Fingerprint
Responsibilities:
The feature package defines the kinds of features a page
could have along with methods to compute and compare values for those
feature.