Variables

February 15, 2013

In dialog scenario files (.fst), you can set/get any numerical value to a defined variable.  Please note that the variable name is case-sensitive.

A value can be stored in a variable by using the VALUE_SET command.  No previous declaration is needed: in case the variable already exists, its value will be changed with the new specified one.  Otherwise, the new variable will be newly allocated.  A  VALUE_EVENT_SET event will be emitted in case of success.

The value currently stored in one variable can be retrieved with VALUE_GET command.  This will emit a VALUE_EVENT_GET event, with the name of the specified variable and its current value.

One can also compare the value currently stored with any other fixed value by using the VALUE_EVAL command.  It takes a variable name, one of the following comparison operators and a fixed value as arguments.

EQ (EQual) =
NE (Not Equal)
LE (Less or Equal)
LT (Less Than) <
GE (Greater or Equal)
GT (Greater Than) >

The comparison result will appear as a VALUE_EVENT_EVAL event, displaying both the arguments and the result of either TRUE or FALSE.

Finally, a variable can be released from memory with VALUE_UNSET command.  It successfully released, a VALUE_EVENT_UNSET event will be emitted.

=== Japanese ========================================

音声対話スクリプト (.fst) では数値を格納する変数を扱うことができます.変数名のアルファベットの小文字と大文字は区別されます.

変数への代入は VALUE_SET コマンドで行います.宣言は必要ありません.新規名の場合は新規に定義され,すでにある名前の場合は上書きされます.代入終了時には VALUE_EVENT_SET イベントが発行されます.

変数の値の参照は VALUE_GET コマンドで行います.指定された変数名とその値を含む VALUE_EVENT_GET イベントが発行されます.

変数の値を固定値と比較するには VALUE_EVAL コマンドで行います.変数名,比較値および以下の比較演算子の1つを指定します.

EQ (EQual) =
NE (Not Equal)
LE (Less or Equal)
LT (Less Than) <
GE (Greater or Equal)
GT (Greater Than) >

比較終了時には比較結果の TRUE または FALSE を含む VALUE_EVENT_EVAL イベントが発行されます.

変数を解放するには VALUE_UNSET コマンドを用います.変数解放時には VALUE_EVENT_UNSET イベントが発行されます.

As described in the posted article “Adding recognition words”, a word pronunciation should be described as a sequence of phonemes in the recognition dictionary.  Here is the Japanese kana-to-phone mapping used in MMDAgent.

a i u e o
k a k i k u k e k o
s a sh i s u s e s o
t a ch i ts u t e t o
n a n i n u n e n o
h a h i f u h e h o
m a m i m u m e m o
y a y u y o
r a r i r u r e r o
w a o N
g a g i g u g e g o
z a z i z u z e z o
d a z i z u d e d o
b a b i b u b e b o
p a p i p u p e p o
キャ キュ キョ
ky a ky u ky o
シャ シュ シェ ショ
sh a sh u sh e sh o
チャ チュ チェ チョ
ch a ch u ch e ch o
ニャ ニュ ニョ
ny a ny u ny o
ヒャ ヒュ ヒョ
hy a hy u hy o
ミャ ミュ ミョ
my a my u my o
リャ リュ リョ
ry a ry u ry o
ギャ ギュ ギョ
gy a gy u gy o
ジャ ジュ ジェ ジョ
j a j u j e j o
ビャ ビュ ビョ
by a by u by o
ピャ ピュ ピョ
py a py u py o
ファ フィ フュ フェ フォ
f a f i hy u f e f o
ウィ ウェ ウォ
w i w e w o
ヴァ ヴィ ヴェ ヴォ
b a b i b e b o
ツァ ツィ ツェ ツォ
ts a ts i ts e ts o
ティ テュ
t i t u
ディ デュ
d i d u
ドゥ
d u

Please note that there are special rules for Japanese prolonged consonant “ッ” and long vowels, as shown bellow.

special phoneme

prolonged consonant(ッ) q example: ラッコ r a q k o
long vowels(ー) a: i: u: e: o: example: チーター ch i: t a:

You can also consult the system’s dictionary for reference.  It is located at “AppData\Julius\lang_m\web.60k.htkdic”. The actual pronunciations are written according to the same rules above.

=== Japanese ========================================

「Adding recognition words」の記事で説明したように,ユーザ用の辞書ファイルでは各単語の発音を音素列で記述します.カタカナ読みから音素列への変換は以下の規則に従います.

a i u e o
k a k i k u k e k o
s a sh i s u s e s o
t a ch i ts u t e t o
n a n i n u n e n o
h a h i f u h e h o
m a m i m u m e m o
y a y u y o
r a r i r u r e r o
w a o N
g a g i g u g e g o
z a z i z u z e z o
d a z i z u d e d o
b a b i b u b e b o
p a p i p u p e p o
キャ キュ キョ
ky a ky u ky o
シャ シュ シェ ショ
sh a sh u sh e sh o
チャ チュ チェ チョ
ch a ch u ch e ch o
ニャ ニュ ニョ
ny a ny u ny o
ヒャ ヒュ ヒョ
hy a hy u hy o
ミャ ミュ ミョ
my a my u my o
リャ リュ リョ
ry a ry u ry o
ギャ ギュ ギョ
gy a gy u gy o
ジャ ジュ ジェ ジョ
j a j u j e j o
ビャ ビュ ビョ
by a by u by o
ピャ ピュ ピョ
py a py u py o
ファ フィ フュ フェ フォ
f a f i hy u f e f o
ウィ ウェ ウォ
w i w e w o
ヴァ ヴィ ヴェ ヴォ
b a b i b e b o
ツァ ツィ ツェ ツォ
ts a ts i ts e ts o
ティ テュ
t i t u
ディ デュ
d i d u
ドゥ
d u

なお,促音・長音については以下のルールに従います.

特殊な音素

促音(ッ) q (例)ラッコ r a q k o
長音(ー) a: i: u: e: o: (例)チーター ch i: t a:

MMDAgentに付属のシステム用の辞書は,MMDAgentのフォルダにあるAppData\Julius\lang_m\web.60k.htkdicにあります.同じ形式で記述されていますので,そちらも参考にしてください.