Skip to content

Commit

Permalink
cosmetics
Browse files Browse the repository at this point in the history
  • Loading branch information
lfoppiano committed Nov 10, 2020
1 parent dbeff71 commit 2bfd557
Showing 1 changed file with 9 additions and 9 deletions.
Expand Up @@ -3,14 +3,14 @@
import org.grobid.core.exceptions.GrobidException;
import org.grobid.core.lang.SentenceDetectorFactory;
import org.grobid.core.layout.LayoutToken;

import java.util.*;
import java.util.function.Predicate;
import java.util.stream.Collectors;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.stream.Collectors;

/**
* Class for using sentence segmentation (singleton). The actual sentence segmentation implementation
* is specified in the Grobid configuration. See org.grobid.core.lang.impl.* for the available
Expand Down Expand Up @@ -59,7 +59,7 @@ private SentenceUtilities() {
}

/**
* Basic run for sentence identification, return the offset positions of the
* Basic run for sentence identification, return the offset positions of the
* identified sentences
*
* @param text text to segment into sentences
Expand All @@ -77,7 +77,7 @@ public List<OffsetPosition> runSentenceDetection(String text) {
}

/**
* Run for sentence identification with some forbidden span constraints, return the offset positions of the
* Run for sentence identification with some forbidden span constraints, return the offset positions of the
* identified sentences without sentence boundaries within a forbidden span (typically a reference marker
* and we don't want a sentence end/start in the middle of that).
*
Expand Down Expand Up @@ -123,9 +123,9 @@ public List<OffsetPosition> runSentenceDetection(String text, List<OffsetPositio
OffsetPosition position = sentencePositions.get(j);
for(int i=forbiddenIndex; i < forbidden.size(); i++) {
OffsetPosition forbiddenPos = forbidden.get(i);
if (forbiddenPos.end < position.end)
if (forbiddenPos.end < position.end)
continue;
if (forbiddenPos.start > position.end)
if (forbiddenPos.start > position.end)
break;
while ( (forbiddenPos.start < position.end && position.end < forbiddenPos.end) ) {
if (j+1 < sentencePositions.size()) {
Expand Down

0 comments on commit 2bfd557

Please sign in to comment.