Skip to content

Commit

Permalink
Don't attempt splits for zero-length lines
Browse files Browse the repository at this point in the history
  • Loading branch information
qqndrew committed Sep 9, 2023
1 parent 1238d79 commit 2922957
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 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.69</version>
<version>1.0.70</version>
<description>The MedTagger biomedical information extraction pipeline</description>


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ public void init() throws IOException, InvalidXMLException, URISyntaxException,
ae.add(AnalysisEngineFactory.createEngineDescription(RuleContextAnnotator.class, "context_ruleset", contextURI.toString()));
}
} else {
if (mode.equals(RunMode.STANDALONE_DICT_ONLY) || mode.equals(RunMode.STANDALONE_DICT_ONLY)) {
if (mode.equals(RunMode.STANDALONE_DICT_ONLY) || mode.equals(RunMode.GENERAL_CLINICAL)) {
if (this.context.equalsIgnoreCase("DEFAULT")) {
ae.add(AnalysisEngineFactory.createEngineDescription(RuleContextAnnotator.class));
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@ public void process(ProcessContext pc) {
// First, split by newlines
Arrays.stream(raw.split("\\r?\\n")).forEach(s -> {
// Now split by colon and add first part to candidates
if (s.trim().length() == 0) {
return;
}
String cand = s.split(":")[0].trim();
if (cand.length() > 0) {
// And output
Expand Down

0 comments on commit 2922957

Please sign in to comment.