From 68eb807a2cc860717ea2a9e0470cd0d96e8354f1 Mon Sep 17 00:00:00 2001 From: petrux Date: Wed, 15 Jul 2015 09:41:00 +0200 Subject: [PATCH] fixed issue#1: number of stanford CoreNLP annotators was takwn instead of number of tokens --- .../dkm/pikes/tintop/annotators/MateSrlAnnotator.java | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/pikes-tintop/src/main/java/eu/fbk/dkm/pikes/tintop/annotators/MateSrlAnnotator.java b/pikes-tintop/src/main/java/eu/fbk/dkm/pikes/tintop/annotators/MateSrlAnnotator.java index 00a3e6c37..db5b30c6b 100644 --- a/pikes-tintop/src/main/java/eu/fbk/dkm/pikes/tintop/annotators/MateSrlAnnotator.java +++ b/pikes-tintop/src/main/java/eu/fbk/dkm/pikes/tintop/annotators/MateSrlAnnotator.java @@ -39,8 +39,9 @@ public MateSrlAnnotator(String annotatorName, Properties props) { public static Sentence createMateSentence(CoreMap stanfordSentence) { Sentence ret; - - int size = stanfordSentence.size(); + + java.util.List get = stanfordSentence.get(CoreAnnotations.TokensAnnotation.class); + int size = get.size(); String[] forms = new String[size + 1]; String[] poss = new String[size + 1]; @@ -54,22 +55,18 @@ public static Sentence createMateSentence(CoreMap stanfordSentence) { lemmas[0] = ""; feats[0] = ""; - java.util.List get = stanfordSentence.get(CoreAnnotations.TokensAnnotation.class); for (int i = 0; i < get.size(); i++) { CoreLabel token = get.get(i); forms[i + 1] = token.get(CoreAnnotations.TextAnnotation.class); poss[i + 1] = token.get(CoreAnnotations.PartOfSpeechAnnotation.class); lemmas[i + 1] = token.get(CoreAnnotations.LemmaAnnotation.class); feats[i + 1] = null; - labels[0] = token.get(CoreAnnotations.CoNLLDepTypeAnnotation.class); parents[0] = token.get(CoreAnnotations.CoNLLDepParentIndexAnnotation.class) + 1; } ret = new Sentence(forms, lemmas, poss, feats); - ret.setHeadsAndDeprels(parents, labels); - return ret; }