2012-04-05 5 views
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. 
+4

음, 이것은 자바가 아닙니다 C#입니까? SharpNLP를 실제로 사용하지 않는다면? – Yuck

답변

0

당신이 변환 iKVM을 코드를 사용하는 가정을 openNLP jar 파일을 .Net에 추가하려면 프로젝트에 IKVM Charsets dll을 포함시켜야합니다.

관련 문제