EntityInfo class
有关实体的扩展信息,包括$instance数据。 有关实体的扩展信息,包括$instance数据。
属性
coverage | 实体涵盖原始话语的量(0-1.0)。 |
end | 实体在话语中结束的位置。 |
name | 实体的名称。 |
operation | 要应用于实体的操作。 |
priority | 与优先级最高的其他实体相比,实体的相对优先级。 |
property | 属性值(如果有)。 |
root |
找到此实体的根实体。 |
score | 实体的分数(0-1.0)。 |
start | 在话语中启动实体的位置。 |
text | 导致实体的原始文本。 |
type | 实体的类型。 |
value | 实体的值。 |
when |
识别实体时的事件计数器。 |
方法
alternative(Partial<Entity |
如果实体来自话语中完全相同的文本,则返回 true。 |
covers(Partial<Entity |
返回真正的实体文本完全包含另一个实体文本。 |
is |
如果实体相同,则返回 true。 |
overlaps(Partial<Entity |
如果实体共享话语中的文本,则返回 true。 |
shares |
如果实体共享同一根根,则返回 true。 |
to |
将实体打印为字符串。 |
属性详细信息
coverage
实体涵盖原始话语的量(0-1.0)。
coverage: number
属性值
number
end
实体在话语中结束的位置。
end: number
属性值
number
name
实体的名称。
name: string
属性值
string
operation
要应用于实体的操作。
operation: string
属性值
string
priority
与优先级最高的其他实体相比,实体的相对优先级。
priority: number
属性值
number
property
属性值(如果有)。
property: string
属性值
string
rootEntity
找到此实体的根实体。
rootEntity: string
属性值
string
score
实体的分数(0-1.0)。
score: number
属性值
number
start
在话语中启动实体的位置。
start: number
属性值
number
text
导致实体的原始文本。
text: string
属性值
string
type
实体的类型。
type: string
属性值
string
value
实体的值。
value: any
属性值
any
whenRecognized
识别实体时的事件计数器。
whenRecognized: number
属性值
number
方法详细信息
alternative(Partial<EntityInfo>, Partial<EntityInfo>)
如果实体来自话语中完全相同的文本,则返回 true。
static function alternative(source: Partial<EntityInfo>, entity: Partial<EntityInfo>): boolean
参数
- source
-
Partial<EntityInfo>
源实体。
- entity
-
Partial<EntityInfo>
要比较的实体。
返回
boolean
如此 如果实体来自话语中完全相同的文本,则为 true,否则为 false。
covers(Partial<EntityInfo>, Partial<EntityInfo>)
返回真正的实体文本完全包含另一个实体文本。
static function covers(source: Partial<EntityInfo>, entity: Partial<EntityInfo>): boolean
参数
- source
-
Partial<EntityInfo>
源实体。
- entity
-
Partial<EntityInfo>
要比较的实体。
返回
boolean
如此 如果实体文本完全包含另一个实体文本,则为 false。
isSameEntity(Partial<EntityInfo>, Partial<EntityInfo>)
如果实体相同,则返回 true。
static function isSameEntity(source: Partial<EntityInfo>, entity: Partial<EntityInfo>): boolean
参数
- source
-
Partial<EntityInfo>
源实体。
- entity
-
Partial<EntityInfo>
要比较的实体。
返回
boolean
如果实体相同,则为 True,否则为 false。
overlaps(Partial<EntityInfo>, Partial<EntityInfo>)
如果实体共享话语中的文本,则返回 true。
static function overlaps(source: Partial<EntityInfo>, entity: Partial<EntityInfo>): boolean
参数
- source
-
Partial<EntityInfo>
源实体。
- entity
-
Partial<EntityInfo>
要比较的实体。
返回
boolean
如果实体在话语中共享文本,则为 True,否则为 false。
sharesRoot(Partial<EntityInfo>, Partial<EntityInfo>)
如果实体共享同一根根,则返回 true。
static function sharesRoot(source: Partial<EntityInfo>, entity: Partial<EntityInfo>): boolean
参数
- source
-
Partial<EntityInfo>
源实体。
- entity
-
Partial<EntityInfo>
要比较的实体。
返回
boolean
如果实体共享同一根根,则为 True,否则为 false。
toString(Partial<EntityInfo>)
将实体打印为字符串。
static function toString(source: Partial<EntityInfo>): string
参数
- source
-
Partial<EntityInfo>
源实体。
返回
string
一个表示当前对象的字符串。