6

当我自己构建 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,以便可以在我的项目中轻松使用它。想法?

4

1 回答 1

1

你从哪里获取资源?

我从他们的 github 存储库上的 master 分支构建没有问题。我正在使用 java 1.8,这在他们的 maven pom 中是必需的。

于 2014-11-11T17:25:04.173 回答