IntentRecognizerSet class
意図認識エンジンのセット間で recognize() 呼び出しをフェデレーションします。
- Extends
コンストラクター
| Intent |
IntentRecognizerSet の新しいインスタンスを構築します。 |
プロパティ
| length | セット内の認識エンジンの数。 |
メソッド
| clone(Intent |
既存の IntentRecognizerSet の複製を返します。 |
| on |
認識エンジンを条件付きで有効または無効にする関数を登録します。 複数のハンドラーを登録でき、他のハンドラーの前に新しいハンドラーが実行されます。 |
| on |
認識エンジンからの出力をフィルター処理する関数を登録します。 複数のハンドラーを登録でき、新しいハンドラーは他のハンドラーの後に実行されます。 |
| on |
実際の認識ロジックを実装します。 |
| recognize(IRecognize |
ユーザーのテキスト発話と意図の照合を試みます。 |
| recognizer(IIntent |
新しい認識エンジン プラグインをセットに追加します。 |
コンストラクターの詳細
IntentRecognizerSet(IIntentRecognizerSetOptions)
IntentRecognizerSet の新しいインスタンスを構築します。
new IntentRecognizerSet(options?: IIntentRecognizerSetOptions)
パラメーター
- options
- IIntentRecognizerSetOptions
(省略可能) セットを初期化し、認識のフローを制御するために使用されるオプション。
プロパティの詳細
length
セット内の認識エンジンの数。
length: number
プロパティ値
number
メソッドの詳細
clone(IntentRecognizerSet)
既存の IntentRecognizerSet の複製を返します。
function clone(copyTo?: IntentRecognizerSet)
パラメーター
- copyTo
- IntentRecognizerSet
(省略可能) 現在のオブジェクトのコピー先のインスタンス。 見つからない場合は、新しいインスタンスが作成されます。
戻り値
onEnabled((context: IRecognizeContext, callback: (err: Error, enabled: boolean) => void) => void)
認識エンジンを条件付きで有効または無効にする関数を登録します。 複数のハンドラーを登録でき、他のハンドラーの前に新しいハンドラーが実行されます。
function onEnabled(handler: (context: IRecognizeContext, callback: (err: Error, enabled: boolean) => void) => void)
パラメーター
- handler
-
(context: IRecognizeContext, callback: (err: Error, enabled: boolean) => void) => void
すべてのメッセージに対して呼び出される関数。 認識されるすべてのメッセージに対して callback(null, true) を呼び出す必要があります。
戻り値
onFilter((context: IRecognizeContext, result: IIntentRecognizerResult, callback: (err: Error, result: IIntentRecognizerResult) => void) => void)
認識エンジンからの出力をフィルター処理する関数を登録します。 複数のハンドラーを登録でき、新しいハンドラーは他のハンドラーの後に実行されます。
function onFilter(handler: (context: IRecognizeContext, result: IIntentRecognizerResult, callback: (err: Error, result: IIntentRecognizerResult) => void) => void)
パラメーター
- handler
-
(context: IRecognizeContext, result: IIntentRecognizerResult, callback: (err: Error, result: IIntentRecognizerResult) => void) => void
スコアが 0.0 より大きい意図になるすべてのメッセージに対して関数が呼び出されました。 意図が返されないようにするには、callback(null, { score: 0.0, intent: null }) を呼び出す必要があります。
戻り値
onRecognize(IRecognizeContext, (err: Error, result: IIntentRecognizerResult) => void)
実際の認識ロジックを実装します。
function onRecognize(context: IRecognizeContext, callback: (err: Error, result: IIntentRecognizerResult) => void)
パラメーター
- context
- IRecognizeContext
- callback
-
(err: Error, result: IIntentRecognizerResult) => void
recognize(IRecognizeContext, (err: Error, result: IIntentRecognizerResult) => void)
ユーザーのテキスト発話と意図の照合を試みます。
function recognize(context: IRecognizeContext, callback: (err: Error, result: IIntentRecognizerResult) => void)
パラメーター
- context
- IRecognizeContext
認識されている受信メッセージのコンテキスト情報。
- callback
-
(err: Error, result: IIntentRecognizerResult) => void
認識操作の結果を使用して呼び出す関数。
recognizer(IIntentRecognizer)
新しい認識エンジン プラグインをセットに追加します。
function recognizer(plugin: IIntentRecognizer)
パラメーター
- plugin
- IIntentRecognizer
追加する認識エンジン。