Commit 7bccc36b authored by jcorvi's avatar jcorvi

Update add_lemma_to_lookup.jape

parent 9e004192
Pipeline #10958 passed with stage
in 2 minutes
......@@ -16,9 +16,11 @@ Rule: label_mapping
gate.Annotation ann = (gate.Annotation) lookup.iterator().next();
FeatureMap lookupFeatures = ann.getFeatures();
gate.AnnotationSet tokens = outputAS.get("Token", ann.getStartNode().getOffset(), ann.getEndNode().getOffset());
List<Annotation> tokensList = new ArrayList<Annotation>(tokens);
Collections.sort(tokensList, new gate.util.OffsetComparator());
String lemma = "";
for (Annotation token : tokens) {
lemma = lemma + " " + token.getFeatures().get("root").toString();
for (Annotation token : tokensList) {
lemma = lemma + " " + token.getFeatures().get("root").toString();
}
lookupFeatures.put("lemma",lemma.trim());
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment