tf:createAdjacentTextReference

Create reference descriptions for adjacent text locations.

Top of page

Related Syntax Constructs

The following construct(s) refer to this construct:


Syntax

tf:createAdjacentTextReference(node $input, integer $distance, token+ $word) => node*

Description

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.

Arguments

$input

node

$distance

integer value denoting proximity distance

$word

a word token

Example

  • 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:

    graphics/xqr-refdesc-adjacent.png