Class: Target

Target

a target class maintaining a queue of outputs from NLU classifier layers

new Target()

constructor

Methods


add(targetObj)

add a target object to the queue
Parameters:
Name Type Description
targetObj TargetObject

clone()

return a deep clone of this

exists()

Returns:
true if a target exist
Type
boolean

get()

get last target object
Returns:
[TargetObject] - current target object in queue

getEntity(entityName [, index])

get entity by name. if an array of entities with same name, get then entity by index
Parameters:
Name Type Argument Default Description
entityName string
index number <optional>
0

getIntent()

get intent id of last targetObj

getLatest()

get last target object
Returns:
[TargetObject] - current target object in queue

getMessageObj()

Returns:

getTargets()

get targetObjs

id()

Returns:
last id
Type
string

isWakeUp()

a wakeup message is relevant to non-push clients like Alexa
Returns:
true if the current message received is a wakeup event
Type
boolean

remove()

remove target from the queue and return it

removeAll()

remove all targets from the queue

summary()

text summary of this

useAndRemove(ettName, ettIndex)

use ettName, remove targetObj when all is used
Parameters:
Name Type Default Description
ettName string
ettIndex number 0

useEntity(ettName, ettIndex, depth)

set a flag for using this entity for context mapping
Parameters:
Name Type Default Description
ettName string
ettIndex number 0 the index of this entity in the message from NLU (in case there were several entities or a composite entity)
depth number the depth at which it was used for mapping
Returns:
Type
number