提交 e917202d authored 作者: Christopher Rienzo's avatar Christopher Rienzo

FS-5188 --resolve Allow full path to grammar in mod_pocketsphinx

上级 424738e9
......@@ -125,7 +125,12 @@ static switch_status_t pocketsphinx_asr_load_grammar(switch_asr_handle_t *ah, co
}
if (switch_is_file_path(grammar)) {
jsgf = switch_mprintf("%s.gram", grammar);
char *dot = strrchr(grammar, '.');
if (dot && !strcmp(dot, ".gram")) {
jsgf = strdup(grammar);
} else {
jsgf = switch_mprintf("%s.gram", grammar);
}
} else {
jsgf = switch_mprintf("%s%s%s.gram", SWITCH_GLOBAL_dirs.grammar_dir, SWITCH_PATH_SEPARATOR, grammar);
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论