Open topic with navigation

# addComponent

Adds a new component to the match. For example, if your Eduction task returns an email address as a match, you can use `addComponent` to extract the text after the @ symbol and add it as a DOMAIN component for the match.

You can also use `addComponent` to add metadata from other sources. For example, if you have extracted a place name, you can add components called “LATITUDE” and “LONGITUDE”, and populate them with data from a different source, regardless of the fact that they were not components of the original text.

## Syntax

`edkmatch:addComponent(name, offset, offsetLength)`

## Arguments

Argument | Description
--- | ---
`name` | The name of the new component (for example, TOPIC, or SENTIMENT)
`offset` | The position of the text in the match to use as the new component (in bytes).
`offsetLength` | The position of the text in the match to use as the new component (in characters).

NOTE:

If you are unsure of the correct `offset` or `offsetLength`, you can specify `offset=0` or `offsetLength=0`.

## Returns

The new empty component object.

Related Topics

- getName
- setName
- getText
- setText

© 2013-2017 Hewlett Packard Enterprise Development LP | Send documentation feedback to HPE Close Send documentation feedback To open the configured email client on this computer, open an email window. Otherwise, copy the information below to a web mail client, and send this email to AutonomyTPFeedback@hpe.com. We appreciate your feedback! Product: Topic Title: Help Topic: Feedback:

_HP_HTML5_bannerTitle.htm