Skip to content

Commit f430e2f

Browse files
committed
Should fix #24
1 parent c3bd94a commit f430e2f

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

src/main/java/com/jpetrak/gate/stringannotation/extendedgazetteer/GazetteerBase.java

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -518,8 +518,8 @@ void loadListFile(String listFileName, String majorType, String minorType,
518518
// All this only, if the separator is set at all
519519
if (unescapedSeparator != null) {
520520
int firstSepIndex = line.indexOf(unescapedSeparator);
521-
if (firstSepIndex > -1) {
522-
entry = line.substring(0, firstSepIndex);
521+
if (firstSepIndex > -1) {
522+
entry = line.substring(0, firstSepIndex);
523523
// split the rest of the line real fast
524524
int lastSepIndex = firstSepIndex;
525525
int nrFeatures = 0;
@@ -538,6 +538,12 @@ void loadListFile(String listFileName, String majorType, String minorType,
538538
if (nextSepIndex < 0) { // if none found, use beyond end of String
539539
nextSepIndex = line.length();
540540
}
541+
// first of all, check if the field between the last and next seps is zero length, if yes
542+
// just ignore it (see issue #24
543+
if (nextSepIndex-lastSepIndex == 1) {
544+
lastSepIndex = nextSepIndex;
545+
continue;
546+
}
541547
// find the first equals character in the string section for this feature
542548
int equalsIndex = line.indexOf('=', lastSepIndex + 1);
543549
//logger.info("lastSepIndex="+lastSepIndex+", nextSepIndex="+nextSepIndex+", equalsIndex="+equalsIndex);

0 commit comments

Comments
 (0)