Skip to content

TAGENTRY

The TAGENTRY transformation option returns the value—also called entry—of an instance of a tag.

For example, with this declaration:

TAGS
{
    @JOB
}

and this tagging rule that makes use of composition:

SCOPE SENTENCE
{
    TAGGER()
    {
        @JOB[LEMMA("developer")]|[#2]
        <1:4>
        @JOB[LEMMA("product")]|[#1]
    }
}

analyzing this text:

Mark is the developer of the product.

an instance of the JOB tag covering developer of the product is added to underlying text tokens. The tag entry is product developer due to the composition transformation.
Under these conditions, given this definition of template:

TEMPLATE(JOB)
{
    @NAME
}

this extraction rule:

SCOPE SENTENCE
{
    IDENTIFY(JOB)
    {
        @NAME[TAG(JOB)]
    }
}

extracts this JOB template record from the above text:

Field Value
@NAME developer of the product

because the default value of the TAG attribute is the text covered by the tag instance.
If you want to use the tag instance value instead, you need to use the TAGENTRY transformation option, changing the extraction rule like this:

SCOPE SENTENCE
{
    IDENTIFY(PERSONAL_DATA)
    {
        @NAME[TAG(JOB)]|[TAGENTRY]
    }
}

In this way the extracted record becomes:

Field Value
@NAME product developer

The syntax of an extraction operand using the transformation is:

@fieldName[TAG(tagName)]|[TAGENTRY]

The syntax of a tagging operand using the transformation is:

@tagName[TAG(tagName)]|[TAGENTRY]

where fieldName is the name of the field to set and tagName is the name of a tag.