Skip to content

Commit

Permalink
Discard invalid values in context config
Browse files Browse the repository at this point in the history
  • Loading branch information
qqndrew committed Mar 7, 2022
1 parent 6ccd35d commit 84898cd
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
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.34</version>
<version>1.0.35</version>
<description>The MedTagger biomedical information extraction pipeline</description>


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,13 @@ public ConTexTSettings(/*String*/Object contextFile, int priority) throws FileNo
String line = sc.nextLine();
if (line.startsWith("#")) continue;
if (!(line.startsWith("//"))) {
if (line.trim().length() == 0) {
continue;
}
String[] tmp = line.split("~\\|~");
if (tmp.length < 4) {
continue;
}
// String phrase = tmp[0].replaceAll(" ", "[\\\\s\\\\-]+");
String phrase = tmp[0].trim();
boolean isRegex = phrase.startsWith("regex:");
Expand Down

0 comments on commit 84898cd

Please sign in to comment.