You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ctakes.apache.org by se...@apache.org on 2016/11/23 18:40:24 UTC
svn commit: r1771024 -
/ctakes/trunk/ctakes-core/src/main/java/org/apache/ctakes/core/ae/RegexSectionizer.java
Author: seanfinan
Date: Wed Nov 23 18:40:24 2016
New Revision: 1771024
URL: http://svn.apache.org/viewvc?rev=1771024&view=rev
Log:
remove empty space at beginning of section
Modified:
ctakes/trunk/ctakes-core/src/main/java/org/apache/ctakes/core/ae/RegexSectionizer.java
Modified: ctakes/trunk/ctakes-core/src/main/java/org/apache/ctakes/core/ae/RegexSectionizer.java
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-core/src/main/java/org/apache/ctakes/core/ae/RegexSectionizer.java?rev=1771024&r1=1771023&r2=1771024&view=diff
==============================================================================
--- ctakes/trunk/ctakes-core/src/main/java/org/apache/ctakes/core/ae/RegexSectionizer.java (original)
+++ ctakes/trunk/ctakes-core/src/main/java/org/apache/ctakes/core/ae/RegexSectionizer.java Wed Nov 23 18:40:24 2016
@@ -244,7 +244,7 @@ abstract public class RegexSectionizer e
// add segments 1 -> n
for ( int i = 0; i < length; i++ ) {
leftBounds = boundsList.get( i );
- final int sectionBegin = leftBounds.getValue2();
+ int sectionBegin = leftBounds.getValue2();
if ( i + 1 < length ) {
sectionEnd = boundsList.get( i + 1 ).getValue1();
} else {
@@ -259,6 +259,9 @@ abstract public class RegexSectionizer e
// Section has no text, parsing would be pointless
continue;
}
+ while ( docText.charAt( sectionBegin ) == ' ' ) {
+ sectionBegin++;
+ }
final SectionTag leftTag = sectionTags.get( leftBounds );
final Segment segment = new Segment( jcas, sectionBegin, sectionEnd );
if ( leftTag.__tagType == TagType.HEADER ) {