Skip to content

PREV NOT operator

PREV NOT is an operator that combines the Boolean operator AND NOT with the flexible positional sequence operator (<>).

It allows you to combine operands and verify their presence/absence and position in a portion of text made of multiple sentences. The operator verifies whether the first declared operand is not preceded by the second operand within the rule's scope. For the rule to trigger, the two elements must not occur in the same sentence, but in two sentences—or more—according to the rule scope.

The syntax is:

operand1
PREV NOT
operand2

where PREV NOT is a language keyword and must be written in uppercase. If two (or more) operands are defined in a rule, the PREV NOT operator will verify whether the first operand is present and not preceded by the second operand.

For example, consider the following categorization rule:

SCOPE SENTENCE*2
{
    DOMAIN(dom1)
    {
        ANCESTOR(78207)//@SYN: #78207# [actual constructions]
        <:4>
        LEMMA("comply","compliance")
        <:4>
        LEMMA("fire safety")
        PREV NOT
        KEYWORD("code")
    }
}

The condition matches a positional sequence of three attributes if not preceded by the keyword code within the rule's scope of at least two sentences.

If the rule is run against this text:

The mill complies with the fire safety standard. However, further upgrade work will be required to avert fire risk.
The manufacturing plant is in compliance with the fire safety standard. A building code compliance certificate will be issued.

the condition is met by:

  • manufacturing plant, third sentence = descendant of syncon 78207.
  • compliance, third sentence = lemma compliance.
  • fire safety, third sentence = lemma fire safety.
  • Absence of keyword code in the second and in the third sentence.