Net::Z3950::PQF::Node - Abstract class for nodes in a PQF parse tree
$node = new Net::Z3950::PQF::TermNode('unix'); $node->isa("Net::Z3950::PQF::Node") or die "oops";
This module implements the types for the nodes that make up a PQF
parse tree. Each such concrete type is a subclass of the abstract
base class
Net::Z3950::Node
,
and has a type whose name is of the form
Net::Z3950::PQF::
somethingNode.
The following node types are defined:
TermNode
brian
,
"brian"
or
"Brian W. Kernighan"
.
The term is accompanied by zero or more attributes, each of which is a triple represented by a reference to a three-element array. Each such array consists of an attribute set identifier which may be either an OID or a short descriptive string, an integer type, and a value which may be either an integer or a string.
RsetNode
AndNode
OrNode
NotNode
ProxNode
exclusion: a boolean indicating whether the condition indicated by the other parameters should be inverted.
distance: an integer indicating the number of units that may separate the fragments identified by the subnodes.
ordered: a boolean indicating whether the elements indicated by the subnodes are constrained to be in the same order as the subnodes themselves.
relation: indicates the relation required on the specified distance in order for the condition to be satisfied.
unit:
a short string indicating the units of proximity (word
,
sentence
, etc.)
Except where noted, the methods described below are defined for all of the concrete node types.
new()
$term1 = new Net::Z3950::PQF::TermNode('brian', [ "bib-1", 1, 1003 ]); $term2 = new Net::Z3950::PQF::TermNode('unix', [ "bib-1", 1, 4 ]); $and = new Net::Z3950::PQF::AndNode($term1, $term2);
Creates a new node object of the appropriate type. It is not possible
to instantiate the abstract node type, Net::Z3950::PQF::Node
, only its
concrete subclasses.
The parameters required are different for different node types:
TermNode
AndNode
, OrNode
, NotNode
ProxNode
render()
$node->render(0);
Renders the contents of the tree rooted at the specified node, indented to a level indicated by the parameter. This output is in a human-readable form that is useful for debugging but probably not much else.
This module is part of the Net::Z3950::PQF distribution. The copyright, authorship and licence are all as for the distribution.