Powered by Zoomin Software. For more details please contactZoomin

Semaphore Classification Server Rulebase Reference

The SINK rule (Experimental)

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

Provides the rules to loop over using FOREACH

Experimental use only - the semantics of this rule may change between versions of CS. Use with care

Score calculation

N/A technically is a COMBINE calculation but will probably be irrelevant in use

Evidence calculation

The combined evidence of it’s children - the parent FOREACH rule will iterate over these phrase ranges

Attribute information

Children restrictions

Any rule is allowed other than those only allowed a specific parent

Parent restrictions

  • must be the first child of a foreach rule otherwise not valid

Description

The sink rule defines the colletion of phraseranges which the parent foreach rule will iterate over. One (or more) source rules will connect to this sink and the foreach rule will feed the individual phrase range to those source rules and evaluate the branch of the rulenet iteratively.

Example 1

The following rulebase fragment

<foreach extract="1" extract_tags="place" >
    <sink>
        <text data="Arlington" />
    </sink>
    <max>
        <sentence>
            <source tag="Arlington (Texas)" />
            <any data="Texas" />
        </sentence>
        <sentence>
            <source tag="Arlington (Virginia)" />
            <any data="Texas" />
        </sentence>
        <sentence weight="80" >
            <source tag="Arlington (Texas)" />
            <any data="Dallas Cowboys Stadium" />
        </sentence>
        <sentence weight="80" >
            <source tag="Arlington (Virginia)" />
            <any data="National Cemetery Washington" />
        </sentence>
        <source tag="Arlington (Unknown)" weight="70" />
    </max>
</foreach>

evaluating the following document text

Across the Potomoc is the National Cemetery in Arlington.

The Dallas Cowboys are investing heavily in new wi-fi infrastruce in their Arlington Stadium.

Arlington House is a significant piece of architectural heritage nestling in a Cotswold valley.

Would extract the three occurences of “Arlington” with the appropriate tag applied to discriminate between the uses.

In this case the foreach rule is used to re-use the max rule - but by iterating over each phrase range in the sink you avoid the global behaviour of the max and allow the decision to be made per phrase range.

...
<META name="place" value="Arlington (Texas)" score="0.80"/>
<META name="place" value="Arlington (Unknown)" score="0.80"/>
<META name="place" value="Arlington (Virginia)" score="0.80"/>
...

NB the score for each iteration of the foreach is not kept - ie even though the score for the max for the 3rd Arlington (the one in “Arlington House”) would be 0.70 and the phrase range tagged “Arlington (Unknown)” the tagged phrase range is kept and ends up as tagged evidence for the foreach rule but the score from that iteration is discarded. The score for the foreach will currently be the max of any iterations score.

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