Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error building Stanford CoreNLP

When I build Core-NLP on my own, I get the following message:

incompatible types; no instance(s) of type variable(s) VALUE exist so that VALUE conforms to Map<Integer,String>

The offending line:

Map<Integer,String> roleMap = ((CoreLabel)t1.label()).get(CoreAnnotations.CoNLLSRLAnnotation.class);

The offending function:

  @SuppressWarnings("unchecked")
  public <VALUE, KEY extends Key<CoreMap, VALUE>>
    VALUE get(Class<KEY> key) {
    for (int i = size; i > 0; ) {
   if (keys[--i] == key) {
    return (VALUE)values[i];
  }
}
    return null;
}

I really have no clue how to fix this. I'm trying to build CoreNLP with Maven so I can use it easily in my project. Ideas?

like image 336
Ian Macalinao Avatar asked Oct 23 '11 01:10

Ian Macalinao


1 Answers

Where are you grabbing your source from?

I had no problem building from the master branch on their github repository. I'm using java 1.8, which is required in their maven pom.

like image 129
Steve Siebert Avatar answered Nov 04 '22 13:11

Steve Siebert