#include <julius.h>
#include <stdarg.h>
module.cのインクルード依存関係図
マクロ定義 | |
#define | MAXBUFLEN 4096 |
Maximum line length of a message sent from a client | |
列挙型 | |
enum | { SM_TERMINATE, SM_PAUSE, SM_WAIT } |
Switch to specify the grammar changing timing policy. | |
関数 | |
void | main_module_loop () |
モジュールモード時のアプリケーションメインループ. | |
boolean | module_disconnect () |
boolean | module_is_connected () |
static boolean | msock_read_grammar (DFA_INFO **ret_dfa, WORD_INFO **ret_winfo) |
接続中のモジュールから送られてくる文法を読み込む. | |
static void | set_grammar_switch_timing_flag () |
グローバル文法の更新を依頼する. | |
void | msock_exec_command (char *command) |
モジュールコマンドを処理する. | |
boolean | module_is_active () |
認識処理の実行可能/実行停止状態を返す. | |
boolean | module_wants_terminate () |
現在音声認識の即時停止要求があるかどうかを返す. | |
void | module_reset_reload () |
void | msock_process_command () |
void | msock_check_and_process_command () |
int | msock_check_in_adin () |
音声入力待ち中のモジュールコマンド処理のためのコールバック関数. 音声入力待ち中にクライアントモジュールから送られたコマンドを 処理するためのコールバック関数.音声入力処理中に定期的に呼ばれる. もしコマンドがある場合それを処理する.また,即時の認識中断(入力破棄)や 入力の中止を求められている場合はそのようにステータスを音声入力処理関数に 返す. | |
変数 | |
static int | listen_sd = -1 |
Socket to listen to a client | |
static char | mbuf [MAXBUFLEN] |
Work buffer for message output | |
static boolean | process_active = TRUE |
static boolean | process_want_terminate = FALSE |
static boolean | process_want_reload = FALSE |
static short | gram_switch_input_method = SM_PAUSE |
Specify when to refresh the global lexicon while recognition. |
module.c で定義されています。
void main_module_loop | ( | ) |
boolean module_disconnect | ( | ) |
現在接続中のクライアントとの接続を切断する.
boolean module_is_connected | ( | ) |
現在クライアントと接続中かどうかを返す
接続中のモジュールから送られてくる文法を読み込む.
文法は 構文ファイル (.dfa) と辞書ファイル (.dict) の内容がエンドマーカー "DFAEND", "DICEND" とともにモジュールクライアントから送られてくる. この関数ではそれらを受取り格納する.格納先はこの関数内で新たに確保される. 受け取った文法は,次回の更新タイミングでグローバル文法に結合される.
ret_dfa | [out] 新たに受け取った構文制約(DFA)データへのポインタ | |
ret_winfo | [out] 新たに受け取った単語辞書データへのポインタ |
参照元 msock_exec_command().
static void set_grammar_switch_timing_flag | ( | ) | [static] |
グローバル文法の更新を依頼する.
グローバル文法を更新するタイミングの設定である gram_switch_input_method の値にしたがって,次回の更新タイミングでグローバル辞書を更新するよう フラグをセットする.
参照元 msock_exec_command().
void msock_exec_command | ( | char * | command | ) |
モジュールコマンドを処理する.
クライアントより与えられたコマンドを処理する.この関数はクライアントから コマンドが送られてくるたびに音声認識処理に割り込んで呼ばれる. ステータス等についてはここですぐに応答メッセージを送るが, 文法の追加や削除などは,ここでは受信のみ行い,実際の変更処理 (各文法からのグローバル文法の再構築など)は認識処理の合間に実行される. この文法再構築処理を実際に行うのは multigram_exec() である.
command | [in] コマンド文字列 |
参照元 main_recognition_loop()・msock_check_and_process_command()・msock_process_command().
boolean module_is_active | ( | ) |
認識処理の実行可能/実行停止状態を返す.
プロセスが実行可能状態(入力音声のトリガをモニタ中,あるいは現在 音声認識処理を実行中)であれば TRUE を,実行停止状態 (モジュールからのコマンド処理以外の処理を停止しており,入力が あっても無視する)であれば FALSE を返す.
参照元 adin_cut_callback_store_buffer()・main_recognition_loop().
boolean module_wants_terminate | ( | ) |
現在音声認識の即時停止要求があるかどうかを返す.
モジュールコマンド "TERMINATE" や文法変更などで,即時に認識処理を 停止する必要があるかどうかを返す.この関数は音声認識処理の各ループ 内で,即時に停止する必要があるかどうかチェックするために呼ばれる.
参照元 adin_cut_callback_store_buffer()・get_back_trellis()・main_recognition_loop()・msock_check_in_adin().
void module_reset_reload | ( | ) |
void msock_process_command | ( | ) |
クライアントモジュールからの命令を読み込んで処理する. 命令が無い場合,次のコマンドが来るまで待つ.
void msock_check_and_process_command | ( | ) |
現在クライアントモジュールからの命令がバッファにあるか調べ, もしあれば処理する.なければそのまま終了する.
参照元 adin_cut_callback_store_buffer()・main_recognition_loop()・msock_check_in_adin().
int msock_check_in_adin | ( | ) |
音声入力待ち中のモジュールコマンド処理のためのコールバック関数. 音声入力待ち中にクライアントモジュールから送られたコマンドを 処理するためのコールバック関数.音声入力処理中に定期的に呼ばれる. もしコマンドがある場合それを処理する.また,即時の認識中断(入力破棄)や 入力の中止を求められている場合はそのようにステータスを音声入力処理関数に 返す.
boolean process_active = TRUE [static] |
Status flag indicating whether the recognition is alive or not. If TRUE, the process is currently activated, either monitoring an audio input or recognizing the current input. If FALSE, the recognition is now disabled until some activation command has been arrived from client. While disabled, all the inputs are ignored.
If set to FALSE in the program, Julius/Julian will stop after the current recognition ends, and enter the disabled status.
参照元 module_is_active()・msock_exec_command()・set_grammar_switch_timing_flag().
boolean process_want_terminate = FALSE [static] |
If set to TRUE, Julius/Julian stops recognition immediately, terminating the currenct recognition process, and enter into disabled status.
参照元 module_wants_terminate()・msock_exec_command()・set_grammar_switch_timing_flag().
boolean process_want_reload = FALSE [static] |
If set to TRUE, Julius/Julian stops recognition softly. If it is performing recognition of the 1st pass, it immediately segments the current input, process the 2nd pass, and output the result. Then it enters the disabled status.
参照元 module_reset_reload()・msock_check_in_adin()・msock_exec_command()・set_grammar_switch_timing_flag().