EXTENSION
EXTENSION
can be described as a completion feature of the matched value rather than a normalization. It adds elements surrounding the original matched data to the final output value.
Its action is based on the concept of "extension", which in turn is linked to the SCOPE
statement (the part of the rule's syntax in which the portion of text to which a rule applies is specified).
The EXTENSION
option reads what the SCOPE
statement (found at the beginning of the rule) contains and returns the portion of text containing the value matched by an attribute as defined in the SCOPE
statement. In this way, EXTENSION
dynamically reproduces what the options PHRASE
, CLAUSE
, SENTENCE
, PARAGRAPH
, SEGMENT
and SECTION
do without having to choose the extension beforehand.
The syntax for extraction rules is:
SCOPE scopeOption
{
IDENTIFY(templateName)
{
@field[attribute]|[EXTENSION]
}
}
The syntax for tagging rules is:
SCOPE scopeOption
{
TAGGER(tagLevel)
{
@tag[attribute]|[EXTENSION]
}
}
This option is useful in cases where it's necessary to expand the output revolving around a matched element, to include exactly what the extension of the rule is; whereas the options PHRASE
, CLAUSE
, SENTENCE
, PARAGRAPH
, SEGMENT
and SECTION
allow the extension of the rule to be different from the transformation option.
Consider the following example:
SCOPE CLAUSE
{
IDENTIFY(SUBJECT)
{
@Subject[TYPE(NPH) + ROLE(SUBJECT)]|[EXTENSION]
}
}
The purpose of this rule is to extract people's names (TYPE (NPH)
), only if the names identified are the subjects of a clause (+ ROLE (SUBJECT)
). If this condition is verified, the EXTENSION
transformation option will ensure that every extracted value will be expanded to the defined extension in the SCOPE
statement of the rule, in this case, a clause.
Consider the extraction output if the rule above is run against the following sample sentence:
My sister Louise Letterman loves dogs and her husband loves cats.
The text contains one value matching the sample rule: Louise Letterman. Louise Letterman is recognized as both a person's name and as the subject in the first clause of the sentence, so it causes the rule to trigger while the EXTENSION
transformation determines the extraction of the extension defined in the SCOPE
statement of the rule, the clause to which the person's name belongs, which is My sister Louise Letterman loves dogs.
If the rule's scope is changed to PHRASE
and the transformation remains unchanged, the extraction will become the phrase that contains the person's name: My sister Louise Letterman.