sphinx 使用带有权重的 JSGF 语法:java.lang.NullPointerException 异常

sphinx using JSGF grammar with weights: java.lang.NullPointerException exception

我正在使用以下语法:

#JSGF V1.0;
grammar tag;
public <tag> = <tagPart> +; 
<tagPart> =  <digit> |  <letter>;

<digit> = oh  | zero | one   | two | three | four | five  | six   |seven | eight | nine  ;
<letter> = a | b | c | d | e | f | g | h | i | j | k | l | m | n | o | p | q | r | s | t | u | v | w | x | y | z ;

一切正常,除非我增加重量。 运行 权重:

<tagPart> = /0.8/ <digit> | /0.1/ <letter>;

我收到以下错误:

Exception in thread "main" java.lang.NullPointerException
    at edu.cmu.sphinx.jsgf.JSGFGrammar.getNormalizedWeights(JSGFGrammar.java:49)

我使用语法的方式是:

Configuration configuration = new Configuration();
configuration.setAcousticModelPath("file:/E/sphinx4-5prealpha-src/sphinx4-data/src/main/resources/edu/cmu/sphinx/models/en-us/en-us");
configuration.setDictionaryPath("file:/E/sphinx4-5prealpha-src/sphinx4-data/src/main/resources/edu/cmu/sphinx/models/en-us/cmudict-en-us.dict");
configuration.setGrammarPath("file:/E/sT/src/main/resources/");
configuration.setGrammarName("tag");
configuration.setUseGrammar(true);
StreamSpeechRecognizer recognizer = new StreamSpeechRecognizer(configuration);

很抱歉耽误了,这个问题刚刚在版本 13217 的主干中修复,请更新并重试,应该可以。