NetResponsibility

class Filter

Library: Net Responsibility
Package: Core
Header: Filter.h

Description

This class will run all test to find out if the URLs are appropriate or not. It is done by initially loading the blacklists, and then testing each URL against them. When keywords are found within the given text, Filter thries to determine how strong the match is. This means every match will be given an individual strength to indicate how likely it is to be an inappropriate site. (The higher number, the more likely).

The URLs are filtered instantly, rather than at report time, as done in several previous versions.

Member Summary

Member Functions: isMatch, isTokenMatch, isUrlMatch, loadBlacklist

Constructors

Filter

Filter();

Filter

Filter(
    string blacklistFile
);

Load the Filter, given the path to the blacklist. This is especially useful when improvign the algorithms.

Filter

Filter(
    Options * options,
    Database * db
);

Load the Filter, given both the options and database.

Member Functions

isMatch

bool isMatch(
    HTTPRequest & request,
    BlacklistMatch & blacklistMatch
);

This is the method used for running a complete scan on the URL. The URL is given as a HTTPRequest, and the result with a formatted URL, strength etc. is returned in blacklistMatch. The return value is true if the URL is considered suspicious, otherwise false.

isTokenMatch

bool isTokenMatch(
    HTTPRequest & request,
    BlacklistMatch & blacklistMatch
);

isUrlMatch

bool isUrlMatch(
    HTTPRequest & request,
    BlacklistMatch & blacklistMatch
);

loadBlacklist

void loadBlacklist(
    string path
);

loadBlacklist

void loadBlacklist(
    Options * options,
    Database * db
);