# 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 = "<I>File:</I> $F"; } else { # No: use description provided by Harvest $description = $desc; } # Format matched lines ("opaque data") if data is present if ($opaque ne '') { $opaque = "<strong>matched lines:</strong><BR>$opaque" } </PerObjectFunction> # PrintObject defines the apperance of hits <PrintObject> $objectnum <A HREF="$url"><STRONG>$description</STRONG></A> \ [<A HREF="$cs_a://$cs_h/Harvest/cgi-bin/displaySOIF.cgi?object=$cs_p">\ indexing data</A>] <pre> $opaque </pre>\n </PrintObject> # Format the appearance of the hit number <ObjectNumPrintf> (%2d) </ObjectNumPrintf> # Format the appearance of every matched line <MatchedLineSub> s/^Matched line: *//; # Remove "Matched line:" s/^([\w-]+# )[\w-]+{\d+}:\t/\1/; # Remove SOIF attributes of the form "partial-text{43}:" s/^([\w-]+#)/<I>\1<\/I>/; # Format attribute names as italics s/^.*/ $&/; # Add spaces to indent text </MatchedLineSub> # Modifies the report of how many objects were matched <EndBrokerResults> <STRONG>Found $nopaquelines matched lines, $nobjects objects.</STRONG> <P>\n </EndBrokerResults>