Powered by Zoomin Software. For more details please contactZoomin

Semaphore Classification Server Rulebase Reference

Template Attribute

  • Last Updated: May 13, 2026
  • 2 minute read
    • Semaphore
    • Documentation

Note: This attribute is retired in Semaphore 4.0. This attribute will no longer work from Semaphore 4.0 onward - use the EXTRACT attribute which allows a much greater level of control over extraction.

In template mode a category rule does not simply return the “name” attribute if it is scored above the threshold. Instead the text is extracted from descendant rule(s) with the CAPTURE attribute set.

Once a rule has captured all its evidence (by having the capture attribute set) then this evidence will be considered by the ancestor templated category rule. If the captured evidence has passed any “filters” in the tree and has ended up as evidence for the category rule then it will be added to the list of data to return.

The text returned may be the actual text in the document which was captured or if an expression is captured and the expression type normalises its data then the normalised form will be used.

Once the list of possible firings has been extracted it is sorted and any multiple occurrences (calculated by exact textual equality) are removed

The rule will fire for each entry in the list (and if a foreach calculation is requested then the number of occurrences in this list will be used)

NB if no descendant rule has a capture attribute this is not flagged as an error - the rule will simply never fire.

Applies to

Values

  • “1” - Work in template mode
  • “0” - Default

Examples

<category class="DATES" template="1">
    <with>
        <text data="{field_start}" field="body"/>
        <expression type="date" capture="1" />
    </with>
</category>

This will find the first date in the body of the document which is close to the beginning of the document (actually within 145 words since at this point the with rules score would drop below 48 which is the default document threshold).

So applied to:

On the morning of Wednesday 21st of June 2012 I updated this documentation.  
I'm not quite sure on what date it was originally written but am guessing that is was some time in Q2 2009.  
On the 1/3/2011 it had been updated which is another way of saying 1st March 2011.  

Would return:

... 
<META name="DATES" value="2012-06-21" score="0.98" />
...

So a single date is extracted (and turned into a normalised form) as expected.

Running the following rules on the same document:

<category class="DATES" template="1" foreach="1" >
    <expression type="date" capture="1" weight="50" />
</category>

Would return:

...
<META name="DATES" value="2009-Q2" score="0.50" />
<META name="DATES" value="2011-03-01" score="0.75" />
<META name="DATES" value="2012-06-21" score="0.50" />
...

So in this case has returned all 4 dates in the document - has grouped 2011-03-01 into 1 firing with 2 occurrences (since the normalised values match for these 2 date forms) and applied the correct foreach calculation to each firing.

See also

TitleResults for “How to create a CRG?”Also Available inAlert