Powered by Zoomin Software. For more details please contactZoomin

Semaphore Classification Server Rulebase Reference

CONDITION

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

The CONDITION rule is used to specify the condition for an IF rule.

Parent

  • IF
  • // Note: It is an error for this rule to be anything but the 1st child of an IF rule//

If this rule fires (has a score) then it will make its parent IF rule use its THEN child - if this rule does not fire then the parent IF will use the ELSE rule (if existing) or not fire.

Score calculation

Scores as if it were a COMBINE rule

Evidence calculation

The evidence is discarded - it will never pass up to it’s parent IF rule

Attribute information

  • any attribute
  • CUTOFF - checks score against classification threshold
  • WEIGHT - a “conditional” weight - see below

Children restrictions

Any rule other than those restricted to a specific parent

Details

This rule will calculate its score and evidence as if it were a COMBINE rule with a weight of 100.

Since the parent IF rule is not interested in the score of this rule (just whether it fires or not) it allows us to use the declared weight as a “conditional” score for the rule - i.e. if the calculated score is >= than this declared weight then fire with score 100 - otherwise score 0 (don’t fire).

By default if no weight is declared then this rule will default to weight=“1” (rather than 100 as most other rules do) - This way its default logic is “if children fire” i.e. the combined children’s score >= 1. This may be adjusted to “if children fire with score >= 20” simply by specifying a weight=“20” for this rule.

Similarly the CUTOFF attribute may be used to say “if children fire with score >= request threshold”.

Example 1

The following rulebase fragment

<if>
     <condition>
          <all>
               <text data="Trichet"/>
               <text data="Bob" not="1"/>
          </all>
     </condition>
     <then>
          <combine>
               <text data="Trichet" weight="10" foreach="1" />
               <text data="Bob" not="1" weight="10"/>
          </combine>
     </then>
</if>

evaluated against the following document

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.

Would score 0.19 (the combined value of 10,10)


Note 1: This use case is so common that there is a single rule ALL_COMBINE which does this behaviour.

Note 2:Since <then> is simply a <combine> rule the <combine> in the above is unnecessary - but makes the behaviour more obvious for explanatory purposes.

Example 2

<if>
     <condition weight="30" >
         <any foreach="3" weight="30" >
            <text data="cat"/>
            <text data="dog"/>
            <text data="mouse"/>
         </any>
     </condition>
     <then>         
         <text data="cat" weight="30"/>
         <text data="dog" weight="30"/>
         <text data="mouse" weight="30"/>
     </then>
     <else>
         <text data="cat" foreach="3" weight="30"/>
         <text data="dog" foreach="3" weight="30"/>
         <text data="mouse" foreach="3" weight="30"/>
     </else>
</if>

Would be some sort of limited FOREACH - so would score the combined foreach values of the terms if < 3 occurrences of all terms in the document but if >= 3 terms (NB the foreach is on the any so counts any of cat, dog or mouse) would stop the foreach growth from happening

NB in most cases though something similar to the following would provide a more obvious way of limiting the growth of foreach evidence if required

    <min>
         <text data="cat" weight="30" />
         <text data="cat" foreach="3" weight="30" />
    </min>

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