1
我在C#語言中使用opennlp工具。 我寫了下面的代碼:TypeInitializationException未處理
string modelpath = @"D:\models\en-sent.bin";
java.io.FileInputStream modelInpStream = new java.io.FileInputStream(modelpath);
SentenceModel model = new SentenceModel(modelInpStream);
SentenceDetectorME sentenceDetector = new SentenceDetectorME(model);
,但它造成的線TypeInitializationException:
SentenceModel model = new SentenceModel(modelInpStream);
異常消息:
TypeInitializationException was unhandled
The type initializer for 'java.nio.charset.StandardCharsets' threw an exception.
嗯,這是Java不是C#?除非你真的使用SharpNLP? – Yuck 2012-04-05 15:20:25