@Test void testEndWithSingleQuotation() { SentenceExtractor extractor = new SentenceExtractor( Configuration.builder().build().getSymbolTable()); final String input = "this is a \'pen.\'"; List<Pair<Integer, Integer>> outputPositions = new ArrayList<>(); int lastPosition = extractor.extract(input, outputPositions); List<Sentence> outputSentences = createSentences(outputPositions, lastPosition, input); assertEquals(1, outputSentences.size()); assertEquals("this is a \'pen.\'", outputSentences.get(0).getContent()); assertEquals(input.length(), lastPosition); }
public int extract(String line, List<Pair<Integer, Integer>> sentencePositions) { int startPosition = 0; int periodPosition = endOfSentenceDetector.getSentenceEndPosition(line, 0); while (periodPosition >= 0) { sentencePositions.add(new Pair<>(startPosition, periodPosition + 1)); startPosition = periodPosition + 1; periodPosition = endOfSentenceDetector.getSentenceEndPosition(line, startPosition); } return startPosition; }
SentenceExtractor { public int extract(String line, List<Pair<Integer, Integer>> sentencePositions) { int startPosition = 0; int periodPosition = endOfSentenceDetector.getSentenceEndPosition(line, 0); while (periodPosition >= 0) { sentencePositions.add(new Pair<>(startPosition, periodPosition + 1)); startPosition = periodPosition + 1; periodPosition = endOfSentenceDetector.getSentenceEndPosition(line, startPosition); } return startPosition; } }
SentenceExtractor { public int extract(String line, List<Pair<Integer, Integer>> sentencePositions) { int startPosition = 0; int periodPosition = endOfSentenceDetector.getSentenceEndPosition(line, 0); while (periodPosition >= 0) { sentencePositions.add(new Pair<>(startPosition, periodPosition + 1)); startPosition = periodPosition + 1; periodPosition = endOfSentenceDetector.getSentenceEndPosition(line, startPosition); } return startPosition; } SentenceExtractor(char...fullStopList);  SentenceExtractor(SymbolTable symbolTable);   SentenceExtractor(char[] fullStopList, char[] rightQuotationList); }
SentenceExtractor { public int extract(String line, List<Pair<Integer, Integer>> sentencePositions) { int startPosition = 0; int periodPosition = endOfSentenceDetector.getSentenceEndPosition(line, 0); while (periodPosition >= 0) { sentencePositions.add(new Pair<>(startPosition, periodPosition + 1)); startPosition = periodPosition + 1; periodPosition = endOfSentenceDetector.getSentenceEndPosition(line, startPosition); } return startPosition; } SentenceExtractor(char...fullStopList);  SentenceExtractor(SymbolTable symbolTable);   SentenceExtractor(char[] fullStopList, char[] rightQuotationList); int extract(String line, List<Pair<Integer, Integer>> sentencePositions); int getSentenceEndPosition(String str); String getBrokenLineSeparator(); }
SentenceExtractor { public int extract(String line, List<Pair<Integer, Integer>> sentencePositions) { int startPosition = 0; int periodPosition = endOfSentenceDetector.getSentenceEndPosition(line, 0); while (periodPosition >= 0) { sentencePositions.add(new Pair<>(startPosition, periodPosition + 1)); startPosition = periodPosition + 1; periodPosition = endOfSentenceDetector.getSentenceEndPosition(line, startPosition); } return startPosition; } SentenceExtractor(char...fullStopList);  SentenceExtractor(SymbolTable symbolTable);   SentenceExtractor(char[] fullStopList, char[] rightQuotationList); int extract(String line, List<Pair<Integer, Integer>> sentencePositions); int getSentenceEndPosition(String str); String getBrokenLineSeparator();  }