如何在 Bixby 中定义词汇 "tuples"?
How do I define vocabulary "tuples" in Bixby?
我有一个枚举定义 altbrains(出版物)的名称,如下所示:
enum (AltBrainsNames) {
description (AltBrainsNames)
symbol (Inside the Helmet)
symbol (Impeachment Sage)
symbol (Iran Conflict Tracker)
symbol (Historical Carbon Dioxide Emissions)
symbol (Picard)
symbol (Quotation Bank)
symbol (US Elections)
}
使用相应的 vocab.bxb 文件将名称的变体与这些 "official" 名称相匹配。
我真正想要的是 Bixby 传递一个对应于每个符号的字符串标识符——比如 (Impeachment Sage, impeachmentsage),这样标识符就可以用作 restdb 请求中的参数。建立这些元组关系的简单方法是什么?
弗雷德
您的枚举概念的符号可以是您的 restDb 中的字符串标识符。这是一种模式:
修改您现有的枚举以遵循此格式
enum (AltBrainsNames) {
description (AltBrainsNames Identifiers)
symbol (insideTheHelmut)
symbol (impeachmentSage)
symbol (iranConflictTracker)
symbol (historicalCarbonDioxideEmissions)
symbol (picard)
symbol (quotationBank)
symbol (USElections)
}
用于将用户友好名称连接到标识符的元组。
structure (NameSelection) {
property (name) {
type (AltBrainsNames)
min (Required) max (One)
}
property (title) {
type (core.Text)
min (Required) max (One)
visibility (Private)
}
}
获取姓名列表
action (GetAltBrainsNames) {
type(Constructor)
output (NameSelection)
}
提供姓名列表,并提示用户select一个
action (MakeNameSelection) {
type(Calculation)
collect {
input (selection) {
type (NameSelection)
min (Required) max (One)
default-init {
intent {
goal: GetAltBrainsNames
}
}
}
}
output (AltBrainsNames)
}
您的词汇可以支持用户说出符号的同义词
vocab (AltBrainsNames) {
"insideTheHelmut" { "insideTheHelmut" "inside the helmut" "helmut"}
"impeachmentSage" { "impeachmentSage" "impeachment sage" "impeachment" "sage"}
"iranConflictTracker" {"iranConflictTracker" "iran conflict tracker"}
"historicalCarbonDioxideEmissions" { "historicalCarbonDioxideEmissions" "historical carbon dioxide emissions"}
"picard" { "picard"}
"quotationBank" {"quotationBank" "quotation bank" "quotations"}
"USElections" {"USElections" "us elections" }
}
我有一个枚举定义 altbrains(出版物)的名称,如下所示:
enum (AltBrainsNames) {
description (AltBrainsNames)
symbol (Inside the Helmet)
symbol (Impeachment Sage)
symbol (Iran Conflict Tracker)
symbol (Historical Carbon Dioxide Emissions)
symbol (Picard)
symbol (Quotation Bank)
symbol (US Elections)
}
使用相应的 vocab.bxb 文件将名称的变体与这些 "official" 名称相匹配。
我真正想要的是 Bixby 传递一个对应于每个符号的字符串标识符——比如 (Impeachment Sage, impeachmentsage),这样标识符就可以用作 restdb 请求中的参数。建立这些元组关系的简单方法是什么?
弗雷德
您的枚举概念的符号可以是您的 restDb 中的字符串标识符。这是一种模式:
修改您现有的枚举以遵循此格式
enum (AltBrainsNames) {
description (AltBrainsNames Identifiers)
symbol (insideTheHelmut)
symbol (impeachmentSage)
symbol (iranConflictTracker)
symbol (historicalCarbonDioxideEmissions)
symbol (picard)
symbol (quotationBank)
symbol (USElections)
}
用于将用户友好名称连接到标识符的元组。
structure (NameSelection) {
property (name) {
type (AltBrainsNames)
min (Required) max (One)
}
property (title) {
type (core.Text)
min (Required) max (One)
visibility (Private)
}
}
获取姓名列表
action (GetAltBrainsNames) {
type(Constructor)
output (NameSelection)
}
提供姓名列表,并提示用户select一个
action (MakeNameSelection) {
type(Calculation)
collect {
input (selection) {
type (NameSelection)
min (Required) max (One)
default-init {
intent {
goal: GetAltBrainsNames
}
}
}
}
output (AltBrainsNames)
}
您的词汇可以支持用户说出符号的同义词
vocab (AltBrainsNames) {
"insideTheHelmut" { "insideTheHelmut" "inside the helmut" "helmut"}
"impeachmentSage" { "impeachmentSage" "impeachment sage" "impeachment" "sage"}
"iranConflictTracker" {"iranConflictTracker" "iran conflict tracker"}
"historicalCarbonDioxideEmissions" { "historicalCarbonDioxideEmissions" "historical carbon dioxide emissions"}
"picard" { "picard"}
"quotationBank" {"quotationBank" "quotation bank" "quotations"}
"USElections" {"USElections" "us elections" }
}