@Override
  public void process(JCas aJCas) throws AnalysisEngineProcessException {

    String inputDocument = aJCas.getDocumentText();

    Matcher questionMatcher = questionPattern.matcher(inputDocument);

    // Find all question patterns, and create Question annotations
    while (questionMatcher.find()) {
      Question newQuestion = new Question(aJCas);
      newQuestion.setBegin(questionMatcher.start(1));
      newQuestion.setEnd(questionMatcher.end(1));
      newQuestion.setCasProcessorId(PROCESSOR_ID);
      newQuestion.setConfidence(1D);
      newQuestion.addToIndexes();
    }

    Matcher answerMatcher = answerPattern.matcher(inputDocument);

    // Find all answer patterns, and create Answer annotations
    while (answerMatcher.find()) {
      Answer newAnswer = new Answer(aJCas);
      newAnswer.setBegin(answerMatcher.start(2));
      newAnswer.setEnd(answerMatcher.end(2));
      newAnswer.setCasProcessorId(PROCESSOR_ID);
      newAnswer.setConfidence(1D);

      if (answerMatcher.group(1).equals("1")) {
        newAnswer.setIsCorrect(true);
      } else if (answerMatcher.group(1).equals("0")) {
        newAnswer.setIsCorrect(false);
      }

      newAnswer.addToIndexes();
    }
  }