Skip to content

NEXT NOT operator

NEXT 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. In other words, The operator verifies whether the first declared operand is not followed 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
NEXT NOT
operand2

where NEXT NOT is a language keyword and must be written in uppercase. If two (or more) operands are defined in a rule, the NEXT NOT operator verifies whether the first operand is present and if it is not followed by the second operand.

Consider the following categorization rule:

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

The condition matches a positional sequence of three attributes if not followed by the keyword however 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 however in the third and in the fourth sentence.

The condition is not met in the first sentence because of the presence of the keyword however in the second sentence.