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.
edkmatch:addComponent(name, offset, offsetLength)
| 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). |
If you are unsure of the correct offset or offsetLength, you can specify offset=0 or offsetLength=0.
The new empty component object.
|
|