WEIGHT
- Last Updated: May 13, 2026
- 2 minute read
- Semaphore
- Documentation
Specifies the weight to use for the rule if rule is triggered. For those rules marked with * above the weight is used as a scaling factor on the calculated score. For the other rules the weight is used as the actual score
Note in cases where other score modifiers are applied (scale and foreach) these rules are applied to this weight - ie effects are cumulative.
Applies to
Note rules marked with * apply the weight as a scaling factor for the calculated score
Does Not apply to
Values
- “[NNN]”
Where [NNN] is the numeric integer weight from 0 - 100
Default if weight is not specified is 100
- “-[NNN]” weight may be set as a negative value. A negative weight is simply the opposite of a positive weight (as you would expect) so we have:-
<combine>
<text data="hello" weight="50"/>
<text data="world" weight="-50"/>
</combine>
evaluating a document body of
hello world.
would have the combine scoring 0
- “[N.NN]” weight may alternatively be specified as a normalised score i.e. 0.50 rather than 50. This is because scores are always returned in this normalised form so sometimes is easier to think of these values
Example
With a rulebase like
<category class="test" name="1">
<all weight="60" >
<max weight="50">
<text weight="80" data="hello"/>
<text weight="60" data="goodbye"/>
</max>
<min weight="75">
<text weight="80" data="morning"/>
<text weight="60" data="afternoon"/>
</min>
</all>
</category>
with a document like
Fred: Hello
Jo: Good morning
Aniera: well good afternoon actually.
Jo: Depends on your timezone really
Fred: Don't you just love how inane chat room conversations (or Palringo)actually seem when typed out!
The max rule would get a score of 40 (50 ie 1/2 of the 80 from “hello”) The min rule would get a score of 45 (75 ie 3/4 of the 60 from “afternoon”)
The all would have score of 60 (both children are fired so its score will be its weight) which is what is passed up to the category rule