-1

Error in code:

If that train is removed then also show compiler error as below. I tried a lot to remove that and classify sentence as positive or negative.

Mad Physicist
  • 107,652
  • 25
  • 181
  • 264
  • 1
    Welcome to Stack Overflow! I would suggest you to look on some other questions to catch a drift of how we need you to ask, so we can help you. For a starter, instead of linking image of your code, you should _post_ the code. Also, [please read this (How to ask a question)](http://stackoverflow.com/help/how-to-ask), good question will help you get the answer you are looking for. – FanaticD May 02 '17 at 14:29

1 Answers1

0

An InputStreamFactory in not the same as an InputStream. Here is a simple bit of code that will create an InputStreamFactory for you. (You might say it is an InputStreamFactoryFactory :-) )

public static InputStreamFactory getInputStreamFactory(final File file) throws IOException{
    return new InputStreamFactory() {

        @Override
        public InputStream createInputStream() throws IOException {
            return new FileInputStream(file);
        }
    };
}

see javadocs: https://opennlp.apache.org/documentation/1.7.2/apidocs/opennlp-tools/opennlp/tools/util/InputStreamFactory.html