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 extraction template:

TEMPLATE(JOB)
{
    @NAME
}

this extraction rule:

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

extracts the following JOB record from the above text:

Field Value
@NAME developer of the product

because the default value of the TAG attribute used to set filed NAME 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 operand using the TAGENTRY transformation is:

  • For extraction rules:

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

  • For tagging rules:

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

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