Skip to content

Commit

Permalink
Fix string split mechanism for section tagging
Browse files Browse the repository at this point in the history
  • Loading branch information
qqndrew committed Oct 7, 2024
1 parent 8ffc4ea commit be085ec
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 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.80</version>
<version>1.0.81</version>
<description>The MedTagger biomedical information extraction pipeline</description>


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,13 +125,18 @@ public void process(JCas jCas) throws AnalysisEngineProcessException {
private Segment SecIndicator(Sentence sen, JCas jcas) {
String str=sen.getCoveredText();
Segment cSeg=null;
int pos=str.indexOf(":");
String secStr;
if(pos < 0 || pos >=100)
secStr=str;
else {
secStr=str.substring(0,pos);
}
int pos = -1;
int colonPos=str.indexOf(":");
int senPos = pos= str.indexOf("\n");
if (colonPos == -1) {
pos = senPos;
} else if (senPos == -1) {
pos = colonPos;
} else {
pos = Math.min(senPos, colonPos);
};
if(pos < 0 || pos >=100) return null;
String 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 be085ec

Please sign in to comment.