@Override
  public void processCas(CAS aCAS) throws ResourceProcessException {
    JCas jcas = null;
    try {
      jcas = aCAS.getJCas();
    } catch (CASException e) {
      throw new ResourceProcessException(e);
    }
    
    String sentenceId = "";
    FSIterator<TOP> sentenceIterator = jcas.getJFSIndexRepository().getAllIndexedFS(Sentence.type);
    if (sentenceIterator.hasNext()) {
      Sentence sentence = (Sentence)sentenceIterator.next();
      sentenceId = sentence.getSentenceId();
    }
    
    for (Annotation geneEntity : jcas.getAnnotationIndex(GeneEntity.type)) {
      GeneEntity thisGeneEntity = (GeneEntity)geneEntity;
      String outputString = sentenceId + "|" + ((Integer)thisGeneEntity.getBegin()).toString() + " "
              + ((Integer)thisGeneEntity.getEnd()).toString() + "|" + thisGeneEntity.getEntityText()
              + "\n";
      try {
        mBufferedWriter.write(outputString);
        mBufferedWriter.flush();
      } catch (IOException e) {
        e.printStackTrace();
      }
    }
  }