You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@opennlp.apache.org by "xia0c (Jira)" <ji...@apache.org> on 2019/12/16 17:26:00 UTC

[jira] [Created] (OPENNLP-1286) Updating from 1.7.0 to 1.9.1 breaks

xia0c created OPENNLP-1286:
------------------------------

             Summary: Updating from 1.7.0 to 1.9.1 breaks
                 Key: OPENNLP-1286
                 URL: https://issues.apache.org/jira/browse/OPENNLP-1286
             Project: OpenNLP
          Issue Type: Bug
    Affects Versions: 1.8.4, 1.8.3, 1.8.2, 1.8.1, 1.8.0
            Reporter: xia0c


When I try to upgrade Opennlp-tools from 1.7.0 to the version after 1.8.0. The following code breaks.

{code:java}
public void demo(String summary) {
	
	try {		
		inputStrean = new FileInputStream(Paths.get(bin).toFile());
		DoccatModel doccatModel = new DoccatModel(inputStrean);
		DocumentCategorizerME myCategorizer = new DocumentCategorizerME(doccatModel);
		double[] outcomes = myCategorizer.categorize(summary);
		String category = myCategorizer.getBestCategory(outcomes);
		
		LOGGER.info(category);
		} catch (IOException e) {
		LOGGER.error(ExceptionUtils.getStackTrace(e));			
	} 
}
{code}

The code should pass, but it throws an error:
{code:java}
incompatible types: java.lang.String cannot be converted to java.lang.String[]
{code}





--
This message was sent by Atlassian Jira
(v8.3.4#803005)