CMUSphinx ps_get_hyp_final具有自己的语法(jsgf)

时间:2018-08-08 15:46:05

标签: c cmusphinx pocketsphinx

我在C上使用自己的语法(.jsgf文件)使用Pocketsphinx。 问题是:方法是什么

ps_get_hyp_final(* ps,* out_is_final)

(来自pocketsphinx.h文件) 放在out_is_final变量中?

我的.jsgf文件如下:

#JSGF V1.0;

grammar myGrammar;

<where> = (where is|where's);
<my> = my;
<object> = (phone|keys|wallet);

public <query> = (<where><my><object>);

当hyp等于(<\ where> <\ my> <\ object>)结构(完整结构,例如:“ where is my”不完整,因为它等于<\ where>)时,我猜测out_is_final == 1 <\ my>)。 但是当我说一个完整的语法结构时,out_is_final等于0。

pocketsphinx.h的标头为:

/**
 * Get hypothesis string and final flag.
 *
 * @param ps Decoder.
 * @param out_is_best_score Output: if hypothesis is reached final state in the grammar.
 * @return String containing best hypothesis at this point in
 *         decoding.  NULL if no hypothesis is available.
 */
POCKETSPHINX_EXPORT
char const *ps_get_hyp_final(ps_decoder_t *ps, int32 *out_is_final);

也许我应该注意语法file.jsgf中的最终状态在哪里?

0 个答案:

没有答案