AND NOT operator
A combination of two expressions made with the AND NOT
operator is true if the expression before the operator is matched and the expression after the operator is not matched anywhere within the scope of the rule.
Consider the following example:
SCOPE SENTENCE
{
DOMAIN(dom1:NORMAL)
{
ANCESTOR(134210) // 134210: well
AND NOT
LEMMA("abandon")
}
}
The rule's condition is the combination of an ANCESTOR
attribute and a LEMMA
attribute. It will match the portion of input text delimited by the rule's scope, if it contains at least a token descending from syncon 134210 and it does not contain the lemma abandon.
Consider this text:
There are about 603 fields in the Niger Delta. Over 55 per cent of these are onshore, while the remaining is in the shallow waters (less than 500 meters). Of these fields, 193 are currently producing while 23 have either been closed down or abandoned. Across the Niger Delta, abandoned drill locations (including well stubs) numbering well over several tens of thousands.
A large number of exploratory wells were drilled on land, swamp and offshore locations.
The fifth sentence contains exploratory wells, a child of syncon 134210 and it does not contain occurrences of the lemma abandon so the rule can trigger and a NORMAL
quantity of points (e.g., 60) is added to dom1
domain's cumulative score.
The fourth sentence contains a match for the ANCESTOR
attribute (well), but since this same sentence also contains the verb form abandoned, the rule's condition is not met.
The AND NOT
operator can be used to combine positional sequences and combinations of attributes. In the following extraction rules:
SCOPE SENTENCE
{
IDENTIFY(TEST)
{
LEMMA("offshore")
<1:4>
@OffShoreField_gas[TYPE(NPR)]|[TEXT]
<1:4>
LEMMA("discovery")
AND NOT
ANCESTOR(64566) + TYPE(NOU)// 64566: petroleum, rock oil, fossil oil, oil, black gold
}
IDENTIFY(TEST)
{
LEMMA("offshore")
<1:4>
@OffShoreField_oil[TYPE(NPR)]|[TEXT]
<1:4>
LEMMA("discovery")
AND NOT
ANCESTOR(64471) + TYPE(NOU)// 64471: natural gas, gas
}
}
the operator AND NOT
is used to combine a positional sequence with the concepts that descend from an "ancestor" concept.
If run against the following sample text:
The offshore Tuui and Maari discoveries are predominantly oil. The basin remains under-explored compared to many comparable rift complex basins of its size and there remains considerable potential for further discoveries.
the second rule will be triggered twice, extracting Tuui and Maari in the @OffShoreField_oil field; the first rule is not triggered, because its conditions ask for the lemma offshore, a proper noun and the lemma discovery in the same sentence at a certain maximum distance from each other (and the first sentence has them all), but does not "tolerate" the presence of oil, a concept which descends from ancestor syncon 64566.
The syntax of the AND NOT
operator is:
expression
AND NOT
expression
where `AND NOT` are language keywords and must be written in uppercase.