我正在尝试使用 OpenEars,但遇到一个烦人的错误。
当我将语言模型文件添加到我的项目后尝试运行该应用程序时,该错误立即开始。
这是错误:
Lex /Users/ilizabetabibi/Desktop/Adi apps/TTSTest3/TTSTest3/../../../../Downloads/TAR4075/4075.languagemodel.lm
cd "/Users/ilizabetabibi/Desktop/Adi apps/TTSTest3"
setenv PATH "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
lex -o/Users/ilizabetabibi/Library/Developer/Xcode/DerivedData/TTSTest3-dsfbczwtfautfsglnlohlfwwgmjt/Build/Intermediates/TTSTest3.build/Debug-iphonesimulator/TTSTest3.build/DerivedSources/4075.languagemodel.yy.m "/Users/ilizabetabibi/Desktop/Adi apps/TTSTest3/TTSTest3/../../../../Downloads/TAR4075/4075.languagemodel.lm"
/Users/ilizabetabibi/Desktop/Adi apps/TTSTest3/TTSTest3/../../../../Downloads/TAR4075/4075.languagemodel.lm:6: name defined twice
/Users/ilizabetabibi/Desktop/Adi apps/TTSTest3/TTSTest3/../../../../Downloads/TAR4075/4075.languagemodel.lm:9: name defined twice
/Users/ilizabetabibi/Desktop/Adi apps/TTSTest3/TTSTest3/../../../../Downloads/TAR4075/4075.languagemodel.lm:12: bad character: \
/Users/ilizabetabibi/Desktop/Adi apps/TTSTest3/TTSTest3/../../../../Downloads/TAR4075/4075.languagemodel.lm:12: unknown error processing section 1
/Users/ilizabetabibi/Desktop/Adi apps/TTSTest3/TTSTest3/../../../../Downloads/TAR4075/4075.languagemodel.lm:12: unknown error processing section 1
/Users/ilizabetabibi/Desktop/Adi apps/TTSTest3/TTSTest3/../../../../Downloads/TAR4075/4075.languagemodel.lm:12: bad character: \
/Users/ilizabetabibi/Desktop/Adi apps/TTSTest3/TTSTest3/../../../../Downloads/TAR4075/4075.languagemodel.lm:14: name defined twice
/Users/ilizabetabibi/Desktop/Adi apps/TTSTest3/TTSTest3/../../../../Downloads/TAR4075/4075.languagemodel.lm:15: name defined twice
/Users/ilizabetabibi/Desktop/Adi apps/TTSTest3/TTSTest3/../../../../Downloads/TAR4075/4075.languagemodel.lm:17: bad character: \
/Users/ilizabetabibi/Desktop/Adi apps/TTSTest3/TTSTest3/../../../../Downloads/TAR4075/4075.languagemodel.lm:17: bad character: 1
/Users/ilizabetabibi/Desktop/Adi apps/TTSTest3/TTSTest3/../../../../Downloads/TAR4075/4075.languagemodel.lm:17: bad character: -
/Users/ilizabetabibi/Desktop/Adi apps/TTSTest3/TTSTest3/../../../../Downloads/TAR4075/4075.languagemodel.lm:17: unknown error processing section 1
/Users/ilizabetabibi/Desktop/Adi apps/TTSTest3/TTSTest3/../../../../Downloads/TAR4075/4075.languagemodel.lm:17: bad character: :
/Users/ilizabetabibi/Desktop/Adi apps/TTSTest3/TTSTest3/../../../../Downloads/TAR4075/4075.languagemodel.lm:18: bad character: -
/Users/ilizabetabibi/Desktop/Adi apps/TTSTest3/TTSTest3/../../../../Downloads/TAR4075/4075.languagemodel.lm:18: bad character: 0
/Users/ilizabetabibi/Desktop/Adi apps/TTSTest3/TTSTest3/../../../../Downloads/TAR4075/4075.languagemodel.lm:18: bad character: .
/Users/ilizabetabibi/Desktop/Adi apps/TTSTest3/TTSTest3/../../../../Downloads/TAR4075/4075.languagemodel.lm:18: bad character: 7
/Users/ilizabetabibi/Desktop/Adi apps/TTSTest3/TTSTest3/../../../../Downloads/TAR4075/4075.languagemodel.lm:18: bad character: 7
/Users/ilizabetabibi/Desktop/Adi apps/TTSTest3/TTSTest3/../../../../Downloads/TAR4075/4075.languagemodel.lm:18: bad character: 8
/Users/ilizabetabibi/Desktop/Adi apps/TTSTest3/TTSTest3/../../../../Downloads/TAR4075/4075.languagemodel.lm:18: bad character: 2
/Users/ilizabetabibi/Desktop/Adi apps/TTSTest3/TTSTest3/../../../../Downloads/TAR4075/4075.languagemodel.lm:18: bad character: <
/Users/ilizabetabibi/Desktop/Adi apps/TTSTest3/TTSTest3/../../../../Downloads/TAR4075/4075.languagemodel.lm:18: bad character: /
/Users/ilizabetabibi/Desktop/Adi apps/TTSTest3/TTSTest3/../../../../Downloads/TAR4075/4075.languagemodel.lm:18: unknown error processing section 1
/Users/ilizabetabibi/Desktop/Adi apps/TTSTest3/TTSTest3/../../../../Downloads/TAR4075/4075.languagemodel.lm:18: bad character:
/Users/ilizabetabibi/Desktop/Adi apps/TTSTest3/TTSTest3/../../../../Downloads/TAR4075/4075.languagemodel.lm:58: premature EOF
Command /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/lex failed with exit code 1
这是语言模型文件:
\data\
ngram 1=10
ngram 2=16
ngram 3=8
\1-grams:
-0.7782 </s> -0.3010
-0.7782 <s> -0.2218
-1.6812 BACKWARD -0.2218
-1.6812 FORWARD -0.2218
-1.6812 GO -0.2218
-1.6812 LEFT -0.2218
-1.6812 RIGHT -0.2218
-1.6812 START -0.2218
-1.6812 STOP -0.2218
-1.6812 TURN -0.2218
\2-grams:
-1.2041 <s> BACKWARD 0.0000
-1.2041 <s> FORWARD 0.0000
-1.2041 <s> GO 0.0000
-1.2041 <s> LEFT 0.0000
-1.2041 <s> RIGHT 0.0000
-1.2041 <s> START 0.0000
-1.2041 <s> STOP 0.0000
-1.2041 <s> TURN 0.0000
-0.3010 BACKWARD </s> -0.3010
-0.3010 FORWARD </s> -0.3010
-0.3010 GO </s> -0.3010
-0.3010 LEFT </s> -0.3010
-0.3010 RIGHT </s> -0.3010
-0.3010 START </s> -0.3010
-0.3010 STOP </s> -0.3010
-0.3010 TURN </s> -0.3010
\3-grams:
-0.3010 <s> BACKWARD </s>
-0.3010 <s> FORWARD </s>
-0.3010 <s> GO </s>
-0.3010 <s> LEFT </s>
-0.3010 <s> RIGHT </s>
-0.3010 <s> START </s>
-0.3010 <s> STOP </s>
-0.3010 <s> TURN </s>
\end\
我真的希望你能帮助我。
最好的问候,阿迪。
最佳答案
OpenEars 开发人员在这里。通常最好在 OpenEars 论坛中询问与 OpenEars 相关的故障排除问题,因为我通常不支持 Stack Overflow 上的 OpenEars,而且这不太可能是影响许多 Stack Overflow 用户的问题。要修复它,请尝试从使用 CMU 工具生成语言模型开始的 OpenEars 文档中的这些步骤:
这一步的原因是根据版本的不同,Xcode 有时会忽略并有时会尝试编译后缀为 .lm 的文件。
关于objective-c - Xcode - OpenEars 语言模型文件错误,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/11158035/