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