PARAGRAPH
- Last Updated: May 13, 2026
- 2 minute read
- Semaphore
- Documentation
The paragraph rule identifies an occurrence of two or more elements in the same paragraph. (Note that children that have the not attribute have paragraph level scope - i.e. not in the same paragraph rather than not in the document)
Since Semaphore 3.5 the DATA attribute is now supported for this rule. The text will be parsed and each token found will be appended as a child text rule. This is mainly as a convenience to avoid typing but also avoids issues where the tokenisation is not easily determined for the text
Score calculation
Scores its given weight if all its children have a non-zero score otherwise it scores 0
Attributes
- _KEY
- DATA Since Semaphore 3.5
- FOREACH
- LABEL
- NOT
- SCALE
- USE_ZONE_AS_EVIDENCE Since Semaphore 3.5
- WEIGHT
- WIDTH
Children
Example 1
The following rulebase fragment
<paragraph>
<text data="Jean-Claude Trichet" />
<text data="inflation" />
</paragraph>
Would fire against the following text
Jean-Claude Trichet announced today a rise of 1/2 point in interest rates.In a separate intervention the governor of the European Central Bank
announced that the institution will keep a firm handle on inflation.
But would fail to fire against
Jean-Claude Trichet announced today a rise of 1/2 point in interest rates.
In a separate intervention the governor of the European Central Bank announced that the institution will keep a firm handle on inflation.
Note If testing this rule using a textual submission of data (such as typing in the body text in the test interface) care needs to be taken that the paragraph is recognised as such. Carriage returns within text data often have to be treated as paragraph breaks since there is no higher level formatting available (using text format) to accurately specify formatting.
Example 2
<paragraph data="same paragraph in" />
is equivalent to
<paragraph>
<text data="same"/>
<text data="paragraph"/>
<text data="in"/>
</paragraph>
and would fire in a document containing
This is the 1st paragraph. It has a sentence with the same words in it.