Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
C
cdisc-etox-annotation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Packages
Packages
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
INB
T
Text Mining
Bio Tools
cdisc-etox-annotation
Commits
7bccc36b
Commit
7bccc36b
authored
Sep 03, 2020
by
jcorvi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update add_lemma_to_lookup.jape
parent
9e004192
Pipeline
#10958
passed with stage
in 2 minutes
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
+4
-2
jape_rules/add_lemma_to_lookup.jape
jape_rules/add_lemma_to_lookup.jape
+4
-2
No files found.
jape_rules/add_lemma_to_lookup.jape
View file @
7bccc36b
...
...
@@ -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());
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment