# Demo to show some of the customization features for the Harvest output
# More information can be found in the manual at:
# http://harvest.sourceforge.net/harvest/doc/html/manual.html
# The PerObjectFunction is Perl code evaluated for every hit
# Create description
# Is the descriptions provided by Harvest very short (e.g. missing )?
if (length($desc) < 5) {
# Yes: use filename ($F) instead
$description = "File: $F";
} else {
# No: use description provided by Harvest
$description = $desc;
}
# Format matched lines ("opaque data") if data is present
if ($opaque ne '') {
$opaque = "matched lines:
$opaque"
}
# PrintObject defines the apperance of hits
$objectnum $description \
[\
indexing data]
$opaque
\n
# Format the appearance of the hit number
(%2d)
# Format the appearance of every matched line
s/^Matched line: *//; # Remove "Matched line:"
s/^([\w-]+# )[\w-]+{\d+}:\t/\1/; # Remove SOIF attributes of the form "partial-text{43}:"
s/^([\w-]+#)/\1<\/I>/; # Format attribute names as italics
s/^.*/ $&/; # Add spaces to indent text
# Modifies the report of how many objects were matched
Found $nopaquelines matched lines, $nobjects objects.
\n