Search code examples
javaapacheopennlp

Error in generatin parsing tree using Apache OpenNLP


public static void main(String[] args)
{
String parsed_sentence = null;
        try {

            parsed_data = new FileInputStream("src/DATA/en-parser-chunking.zip");
            System.out.println("fetched from the file");
            ParserModel model = new ParserModel(parsed_data);
            System.out.println("model created");
            Parser parser = ParserFactory.create(model);
            System.out.println("parseer created");
            String t = "The quick brown fox jumps over the lazy dog .";
            opennlp.tools.parser.Parse topParses[] = ParserTool.parseLine(t, parser, 1);
            System.out.println("parsed ");
            System.out.println(topParses[0]);
        }
        catch (Exception ex)
        {
          System.out.println("Error");
        }

    }  
}
}

Output : fetched from the file Exception in thread "main" java.lang.OutOfMemoryError: Java heap space....

while running this project in Netbeans ,I am getting this error i dont know what to do. I did exactly told on the OpenNLP site http://opennlp.apache.org/documentation/1.5.2-incubating/manual/opennlp.html#tools.parser .


Solution

  • (Java heap space in netbeans.. but I've increased the heap size already!)...... This has solved my problem... i need to add that in my project's VMX variable....