Win32 API 日本語リファレンス
ホームMedia.Speech › ISpeechLexicon

ISpeechLexicon

COMIDispatch (デュアル)
IDispatch を実装(デュアルインターフェース)。HSP では comobj 経由でメソッド名による遅延バインド呼び出しができます(vtableインデックス不要)。
IID3da7627a-c7ae-4b23-8708-638c50362c25継承元IDispatch呼び出し名前(IDispatch) または vtbl自前メソッド開始 vtbl7

メソッド 8

vtbl = vtable インデックス(0始まり)。IDispatch 実装のため HSP ではメソッド名でも呼べます(上記)。低レベルの index 呼び出し用に vtbl も掲載。0〜2 は IUnknown。

vtbl 7 HRESULT get_GenerationId(INT* GenerationId)
GenerationIdINT*outレキシコンの現在の世代ID(変更追跡用カウンタ)を受け取る出力先。INTへのポインタで指定する。
vtbl 8 HRESULT GetWords(SpeechLexiconType Flags, INT* GenerationID, ISpeechLexiconWords** Words)
FlagsSpeechLexiconTypein取得対象の単語種別を指定するSpeechLexiconType列挙のフラグ。ユーザー/アプリ等を組み合わせる。
GenerationIDINT*out現在の世代IDを受け取る入出力ポインタ。差分取得の基準として使う。NULL可。
WordsISpeechLexiconWords**out条件に合致する単語コレクションISpeechLexiconWordsを受け取る出力ポインタ。
vtbl 9 HRESULT AddPronunciation(LPWSTR bstrWord, INT LangId, SpeechPartOfSpeech PartOfSpeech, LPWSTR bstrPronunciation)
bstrWordLPWSTRin発音を登録する対象の単語文字列。BSTRで指定する。
LangIdINTin対象言語のロケール識別子(LCID)。0で既定言語を意味する。
PartOfSpeechSpeechPartOfSpeechin単語の品詞を示すSpeechPartOfSpeech列挙値。
bstrPronunciationLPWSTRin登録する発音を表す記号列(発音文字列)。BSTRで指定する。
vtbl 10 HRESULT AddPronunciationByPhoneIds(LPWSTR bstrWord, INT LangId, SpeechPartOfSpeech PartOfSpeech, VARIANT* PhoneIds)
bstrWordLPWSTRin発音を登録する対象の単語文字列。BSTRで指定する。
LangIdINTin対象言語のロケール識別子(LCID)。0で既定言語を意味する。
PartOfSpeechSpeechPartOfSpeechin単語の品詞を示すSpeechPartOfSpeech列挙値。
PhoneIdsVARIANT*in登録する発音を音素IDの配列としてVARIANTで指定する。整数配列を格納する。
vtbl 11 HRESULT RemovePronunciation(LPWSTR bstrWord, INT LangId, SpeechPartOfSpeech PartOfSpeech, LPWSTR bstrPronunciation)
bstrWordLPWSTRin発音を削除する対象の単語文字列。BSTRで指定する。
LangIdINTin対象言語のロケール識別子(LCID)。0で既定言語を意味する。
PartOfSpeechSpeechPartOfSpeechin削除対象を絞り込む品詞SpeechPartOfSpeech列挙値。
bstrPronunciationLPWSTRin削除する発音記号列。BSTRで指定する。
vtbl 12 HRESULT RemovePronunciationByPhoneIds(LPWSTR bstrWord, INT LangId, SpeechPartOfSpeech PartOfSpeech, VARIANT* PhoneIds)
bstrWordLPWSTRin発音を削除する対象の単語文字列。BSTRで指定する。
LangIdINTin対象言語のロケール識別子(LCID)。0で既定言語を意味する。
PartOfSpeechSpeechPartOfSpeechin削除対象を絞り込む品詞SpeechPartOfSpeech列挙値。
PhoneIdsVARIANT*in削除する発音を音素ID配列としてVARIANTで指定する。
vtbl 13 HRESULT GetPronunciations(LPWSTR bstrWord, INT LangId, SpeechLexiconType TypeFlags, ISpeechLexiconPronunciations** ppPronunciations)
bstrWordLPWSTRin発音を取得する対象の単語文字列。BSTRで指定する。
LangIdINTin対象言語のロケール識別子(LCID)。0で既定言語を意味する。
TypeFlagsSpeechLexiconTypein取得対象の発音種別を指定するSpeechLexiconType列挙のフラグ。
ppPronunciationsISpeechLexiconPronunciations**out該当する発音コレクションISpeechLexiconPronunciationsを受け取る出力ポインタ。
vtbl 14 HRESULT GetGenerationChange(INT* GenerationID, ISpeechLexiconWords** ppWords)
GenerationIDINT*inout前回の世代IDを渡し、最新の世代IDを受け取る入出力ポインタ。差分基準に使う。
ppWordsISpeechLexiconWords**out指定世代以降に変更された単語コレクションを受け取る出力ポインタ。

HSP用 COM定義

#usecom / #comfunc によるHSPのCOM呼び出し定義。数字は vtbl インデックス(0始まり)。クラスIDが無い場合 #usecom の末尾は "{}"、ある場合は "{CLSID}"

出力引数:
#define global IID_ISpeechLexicon "{3DA7627A-C7AE-4B23-8708-638C50362C25}"
#usecom global ISpeechLexicon IID_ISpeechLexicon "{}"
#comfunc global ISpeechLexicon_get_GenerationId               7 var
#comfunc global ISpeechLexicon_GetWords                       8 int,var,sptr
#comfunc global ISpeechLexicon_AddPronunciation               9 wstr,int,int,wstr
#comfunc global ISpeechLexicon_AddPronunciationByPhoneIds     10 wstr,int,int,var
#comfunc global ISpeechLexicon_RemovePronunciation            11 wstr,int,int,wstr
#comfunc global ISpeechLexicon_RemovePronunciationByPhoneIds  12 wstr,int,int,var
#comfunc global ISpeechLexicon_GetPronunciations              13 wstr,int,int,sptr
#comfunc global ISpeechLexicon_GetGenerationChange            14 var,sptr
; ※数字は vtbl インデックス(0始まり)。0/1/2 は IUnknown(QueryInterface/AddRef/Release)。
; ※このインターフェースは直接 CoCreateInstance するクラスIDが無いため "{}"(他メソッド/アクティベーションで取得)。
; ※出力/バッファ引数は var(変数直渡し)。varptr 方式にも切替可。
; ※ハンドル/void*等の不透明ポインタは IronHSP では intptr 指定が可能。
; ※IDispatch 実装。HSP では comobj 経由でメソッド名による呼び出しも可能(vtbl 不要)。