class CSVHandler extends ResultHandler {

  CSVHandler(int maxSentences, int maxErrors) {
    super(maxSentences, maxErrors);
  }

  @Override
  protected void handleResult(Sentence sentence, List<RuleMatch> ruleMatches, Language language) {<FILL_FUNCTION_BODY>}

  private String noTabs(String s) {
    return s.replace("\t", "\\t");
  }

  @Override
  public void close() throws Exception {
  }
}

    String sentenceStr = sentence.getText();
    if (ruleMatches.size() > 0) {
      for (RuleMatch match : ruleMatches) {
        sentenceStr = noTabs(sentenceStr.substring(0, match.getFromPos())) +
                      "__" +
                      noTabs(sentenceStr.substring(match.getFromPos(), match.getToPos())) +
                      "__" +
                      noTabs(sentenceStr.substring(match.getToPos()));
        System.out.println("MATCH\t" + match.getRule().getFullId() + "\t" + noTabs(sentenceStr));
        checkMaxErrors(++errorCount);
      }
    } else {
      System.out.println("NOMATCH\t\t" + noTabs(sentenceStr));
    }
    checkMaxSentences(++sentenceCount);
  
<methods><variables>protected static final int CONTEXT_SIZE,protected static final java.lang.String MARKER_END,protected static final java.lang.String MARKER_START,protected int errorCount,private final non-sealed int maxErrors,private final non-sealed int maxSentences,protected int sentenceCount