Create reference descriptions for adjacent text locations.
tf:createAdjacentTextReference(node $input, integer $distance, token+ $word) => node*
The function tf:createAdjacentTextReference
is specific to
Tamino. It takes a node sequence, an integer value indicating a distance, and
one or more word tokens as arguments. Similar to the function
tf:containsAdjacentText
it searches all word tokens of the node
that are within the specified distance respecting the token order. However, it
does not return a Boolean value, but a sequence of reference descriptions for
all nodes found.
You can use reference descriptions for subsequent highlighting of these
nodes, see tf:highlight
.
With tf:createAdjacentTextReference
you can create reference
descriptions based on a search using wildcard characters. The section
Pattern
Matching in the XQuery 4 User Guide
explains this in detail.
$input |
node |
---|---|
$distance |
integer value denoting proximity distance |
$word |
a word token |
Create reference descriptions in remarks
nodes stating
that patients are responding to current treatment:
for $a in input()/patient return tf:createAdjacentTextReference($a/remarks, 3, "patient", "to", "treatment")
This query returns reference descriptions to the locations of all word tokens found:
The following construct(s) refer to this construct: