WARC::Index::Entry - abstract base class for WARC::Index entries
use WARC; # or ... use WARC::Index; # WARC::Index::Entry objects are returned from directly searching an index # match search criteria against entry $distance = $entry->distance( ... ); @report = $entry->distance( ... ); $index = $entry->index; # get index containing entry $volume = $entry->volume; # get WARC::Volume containing record $record = $entry->record; # get WARC record
Entries from all index systems support these methods:
In list context, return a detailed report mapping each search key to a distance value. In scalar context, return an overall summary distance, such that sorting entries by the return values of this method in ascending order will place the closest matches at the top of the list.
A valid distance is non-negative. Negative distance values indicate that the record does not match the criteria at all. An undefined value indicates that the entry is from an index that does not store the information needed to evaluate distance for that search key. Undefined values are ignored when computing the summarized distance, but the summarized distance will be negative if any keys do not match at all and itself undefined if none of the requested keys can be evaluated.
For details on available search keys, see the "Search Keys" section of the WARC::Collection page. If multiple values are given in an arrayref, the best match is reported.
WARC::Collection
Return the WARC::Index containing this entry.
WARC::Index
Return the WARC::Volume object representing the file in which this index entry's record is located.
WARC::Volume
Return the WARC::Record this index entry represents. Arguments if given are additional key => value pairs for the record object.
WARC::Record
Return the file offset at which this index entry's record is located.
Return the value this index entry holds for a given search key.
Return a tag for this index entry. The exact format of the tag is unspecified and platform-dependent. Two index entries that refer to different records are guaranteed (if the underlying system software behaves correctly) to have different tag values, while two entries that refer to the same record in the same volume will normally have the same tag value, except in edge cases.
Some index entries may additionally support any of these methods:
Indexes with an inherent sequence of entries may provide a method to obtain the next entry in the index. Some index systems have this, while others do not have a meaningful order amongst their entries.
Indexes with an inherent sequence of entries may provide a method to obtain some kind of index-specific entry number or location parameter. This is most useful for metaindexes to record the location of an index entry.
Jacob Bachmeyer, <jcb@cpan.org>
WARC, WARC::Index
Copyright (C) 2019 by Jacob Bachmeyer
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install WARC, copy and paste the appropriate command in to your terminal.
cpanm
cpanm WARC
CPAN shell
perl -MCPAN -e shell install WARC
For more information on module installation, please visit the detailed CPAN module installation guide.