-1

How to use opennlp with netbeans. I made a small program as given in apache document but it is not working. I have set path to the opennlp bin as stated in the apache document but still i m not geting an output. it is not able to find .bin and hence SentenceModel model. package sp;

             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) {
                                                                 }
                                                              }
                                         }
                                       }
                                     }

1 Answers1

0

The current working directory when you run in Netbeans is the base project directory (the one with build.xml in it). Place your .bin file there, and you should be able to open the file like that.

BillRobertson42
  • 12,602
  • 4
  • 40
  • 57