class SimpleCorpus implements ErrorCorpus {

  private final List<String> lines = new ArrayList<>();
  
  private int pos;
  
  public SimpleCorpus(File simpleTextFile) throws IOException {
    try (FileInputStream fis = new FileInputStream(simpleTextFile)) {
      lines.addAll(IOUtils.readLines(fis).stream().filter(line -> line.matches("\\d+\\..*")).collect(Collectors.toList()));
    }
    System.out.println("Loaded " + lines.size() + " example sentences");
  }

  @Override
  public Iterator<ErrorSentence> iterator() {
    return new Iterator<ErrorSentence>() {
      @Override
      public boolean hasNext() {
        return pos < lines.size();
      }
      @Override
      public ErrorSentence next() {
        String line = lines.get(pos++);
        return getIncorrectSentence(line);
      }
      @Override
      public void remove() {
        throw new UnsupportedOperationException();
      }
    };
  }

  private ErrorSentence getIncorrectSentence(String line) {<FILL_FUNCTION_BODY>}

  private AnnotatedText makeAnnotatedText(String text) {
    AnnotatedTextBuilder builder = new AnnotatedTextBuilder();
    builder.addText(text.replace("_", " ").replaceAll("\\s+", " "));
    return builder.build();
  }

}

    String normalized = line.replaceFirst("\\d+\\.\\s*", "");
    String normalizedNoCorrection = normalized.replaceFirst("=>.*", "").trim();
    int startError = normalized.indexOf('_');
    int endError = normalized.indexOf('_', startError+1);
    if (startError == -1 || endError == -1) {
      throw new RuntimeException("No '_..._' marker found: " + line);
    }
    int startCorrectionMarker = normalized.indexOf("=>");
    if (startCorrectionMarker == -1) {
      throw new RuntimeException("No '=>' marker found: " + line);
    }
    String correction = normalized.substring(startCorrectionMarker + "=>".length());
    List<Error> errors = Arrays.asList(new Error(startError + 1, endError - 1, correction));
    return new ErrorSentence(normalizedNoCorrection, makeAnnotatedText(normalizedNoCorrection), errors);
  
<no_super_class>