HTML::Index::Document - Perl object used by HTML::Index::Store to create an index of HTML documents for searching
$doc = HTML::Index::Document->new( path => $path ); $doc = HTML::Index::Document->new( name => $name, contents => $contents, mod_time => $mod_time, );
This module allows you to create objects to represent HTML documents to be indexed for searching using the HTML::Index modules. These might be HTML files in a webserver document root, or HTML pages stored in a database, etc.
HTML::Index::Document is a subclass of Class::Struct, with 4 attributes:
The path to the document. This is an optional attribute, but if used should correspond to an existing, readable file.
The name of the document. This attribute is what is returned as a result of a search, and is the primary identifier for the document. It should be unique. If the path attribute is set, then the name attribute defaults to path. Otherwise, it must be provided to the constructor.
The (HTML) contents of the document. This attribute provides the text which is indexed by HTML::Index::Store. If the path attribute is set, the contents attribute defaults to the contents of path. Otherwise, it must be provided to the constructor.
Should be one of html or regex. If html, documents are parsed using HTML::TreeBuilder to extract visible text. If regex, the same job is done by a "quick and dirty" regex.
Ave Wrigley <Ave.Wrigley@itn.co.uk>
Copyright (c) 2001 Ave Wrigley. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.