EntityInfo class
Extended information about an entity including $instance data. Extended information about an entity including $instance data.
Properties
coverage | How much (0-1.0) of the original utterance is covered by entity. |
end | Position where entity ends in utterance. |
name | Name of entity. |
operation | Operation to apply to entity. |
priority | Relative priority of entity compared to other entities with 0 being highest priority. |
property | Value of property if any. |
root |
Root entity where this entity was found. |
score | Score (0-1.0) of entity. |
start | Position where entity starts in utterance. |
text | Original text that led to entity. |
type | Type of entity. |
value | Value of entity. |
when |
Event counter when entity was recognized. |
Methods
alternative(Partial<Entity |
Returns true if entities come from exactly the same text in the utterance. |
covers(Partial<Entity |
Returns true entity text completely includes another entity text. |
is |
Returns true if entities are the same. |
overlaps(Partial<Entity |
Returns true if entities share text in utterance. |
shares |
Returns true if entities share the same root. |
to |
Print an entity as a string. |
Property Details
coverage
How much (0-1.0) of the original utterance is covered by entity.
coverage: number
Property Value
number
end
Position where entity ends in utterance.
end: number
Property Value
number
name
Name of entity.
name: string
Property Value
string
operation
Operation to apply to entity.
operation: string
Property Value
string
priority
Relative priority of entity compared to other entities with 0 being highest priority.
priority: number
Property Value
number
property
Value of property if any.
property: string
Property Value
string
rootEntity
Root entity where this entity was found.
rootEntity: string
Property Value
string
score
Score (0-1.0) of entity.
score: number
Property Value
number
start
Position where entity starts in utterance.
start: number
Property Value
number
text
Original text that led to entity.
text: string
Property Value
string
type
Type of entity.
type: string
Property Value
string
value
Value of entity.
value: any
Property Value
any
whenRecognized
Event counter when entity was recognized.
whenRecognized: number
Property Value
number
Method Details
alternative(Partial<EntityInfo>, Partial<EntityInfo>)
Returns true if entities come from exactly the same text in the utterance.
static function alternative(source: Partial<EntityInfo>, entity: Partial<EntityInfo>): boolean
Parameters
- source
-
Partial<EntityInfo>
Source entity.
- entity
-
Partial<EntityInfo>
Entity to compare.
Returns
boolean
True if entities come from the exactly same text in utterance, otherwise false.
covers(Partial<EntityInfo>, Partial<EntityInfo>)
Returns true entity text completely includes another entity text.
static function covers(source: Partial<EntityInfo>, entity: Partial<EntityInfo>): boolean
Parameters
- source
-
Partial<EntityInfo>
Source entity.
- entity
-
Partial<EntityInfo>
Entity to compare.
Returns
boolean
True if the entity text completely includes another entity text, otherwise false.
isSameEntity(Partial<EntityInfo>, Partial<EntityInfo>)
Returns true if entities are the same.
static function isSameEntity(source: Partial<EntityInfo>, entity: Partial<EntityInfo>): boolean
Parameters
- source
-
Partial<EntityInfo>
Source entity.
- entity
-
Partial<EntityInfo>
Entity to compare.
Returns
boolean
True if entities are the same, otherwise false.
overlaps(Partial<EntityInfo>, Partial<EntityInfo>)
Returns true if entities share text in utterance.
static function overlaps(source: Partial<EntityInfo>, entity: Partial<EntityInfo>): boolean
Parameters
- source
-
Partial<EntityInfo>
Source entity.
- entity
-
Partial<EntityInfo>
Entity to compare.
Returns
boolean
True if entities share text in utterance, otherwise false.
sharesRoot(Partial<EntityInfo>, Partial<EntityInfo>)
Returns true if entities share the same root.
static function sharesRoot(source: Partial<EntityInfo>, entity: Partial<EntityInfo>): boolean
Parameters
- source
-
Partial<EntityInfo>
Source entity.
- entity
-
Partial<EntityInfo>
Entity to compare.
Returns
boolean
True if entities share the same root, otherwise false.
toString(Partial<EntityInfo>)
Print an entity as a string.
static function toString(source: Partial<EntityInfo>): string
Parameters
- source
-
Partial<EntityInfo>
Source entity.
Returns
string
A string that represents the current object.