Skip to content

Commit

Permalink
Fix indexing issues due to pos
Browse files Browse the repository at this point in the history
  • Loading branch information
qqndrew committed Oct 7, 2024
1 parent a857027 commit 8ffc4ea
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 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.79</version>
<version>1.0.80</version>
<description>The MedTagger biomedical information extraction pipeline</description>


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,12 @@ private Segment SecIndicator(Sentence sen, JCas jcas) {
String str=sen.getCoveredText();
Segment cSeg=null;
int pos=str.indexOf(":");
// if(pos < 0 || pos >=100) return null;
String secStr=str.substring(0,pos);
String secStr;
if(pos < 0 || pos >=100)
secStr=str;
else {
secStr=str.substring(0,pos);
}
if(sectionMap.containsKey(lvg.getNorm(secStr))){
sen.removeFromIndexes(jcas);
String cSegment=sectionMap.get(lvg.getNorm(secStr));
Expand Down

0 comments on commit 8ffc4ea

Please sign in to comment.