Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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<CoreLabel> get = stanfordSentence.get(CoreAnnotations.TokensAnnotation.class);
int size = get.size();

String[] forms = new String[size + 1];
String[] poss = new String[size + 1];
Expand All @@ -54,22 +55,18 @@ public static Sentence createMateSentence(CoreMap stanfordSentence) {
lemmas[0] = "<root>";
feats[0] = "<root>";

java.util.List<CoreLabel> 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;
}

Expand Down