当我自己构建 Core-NLP 时,我收到以下消息:
incompatible types; no instance(s) of type variable(s) VALUE exist so that VALUE conforms to Map<Integer,String>
违规行:
Map<Integer,String> roleMap = ((CoreLabel)t1.label()).get(CoreAnnotations.CoNLLSRLAnnotation.class);
违规功能:
@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;
}
我真的不知道如何解决这个问题。我正在尝试使用 Maven 构建 CoreNLP,以便可以在我的项目中轻松使用它。想法?