Skip to content

Commit

Permalink
Don't assume split will always return size 1
Browse files Browse the repository at this point in the history
  • Loading branch information
qqndrew committed Sep 9, 2023
1 parent 2922957 commit 5431742
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>org.ohnlp.medtagger</groupId>
<artifactId>medtagger</artifactId>
<version>1.0.70</version>
<version>1.0.71</version>
<description>The MedTagger biomedical information extraction pipeline</description>


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,13 @@ public void process(ProcessContext pc) {
if (s.trim().length() == 0) {
return;
}
String cand = s.split(":")[0].trim();
if (cand.length() > 0) {
// And output
pc.output(KV.of(cand, 1));
String[] parsed = s.split(":");
if (parsed.length > 0) {
String cand = parsed[0].trim();
if (cand.length() > 0) {
// And output
pc.output(KV.of(cand, 1));
}
}
});

Expand Down

0 comments on commit 5431742

Please sign in to comment.