带有netbeans的opennlp未提供输出
如何将opennlp与netbeans一起使用。我制作了一个apache文档中给出的小程序,但它不起作用。我已经按照apache文档中的说明设置了opennlp bin的路径,但仍然没有得到输出。它无法找到.bin,因此无法找到SentenceModel。 包sp带有netbeans的opennlp未提供输出,netbeans,opennlp,Netbeans,Opennlp,如何将opennlp与netbeans一起使用。我制作了一个apache文档中给出的小程序,但它不起作用。我已经按照apache文档中的说明设置了opennlp bin的路径,但仍然没有得到输出。它无法找到.bin,因此无法找到SentenceModel。 包sp public class Sp { public static void main(String[] args) throws FileNotFoundExcep
public class Sp {
public static void main(String[] args) throws FileNotFoundException {
InputStream modelIn ;
modelIn = new FileInputStream("en-token.bin");
try {
SentenceModel model = new SentenceModel(modelIn);
}
finally {
if (modelIn != null) {
try {
modelIn.close();
}
catch (IOException e) {
}
}
}
}
}
在Netbeans中运行时的当前工作目录是基本项目目录(其中包含build.xml)。将您的.bin文件放在那里,您应该能够像这样打开该文件