public synchronized void processCas(CAS aCAS) throws ResourceProcessException {
   
/**
 * Get the sentence ID and the original sentences from collectionReader
 * Get the start and end point of each gene
 */
     JCas jcas;
    try {
      jcas = aCAS.getJCas();
    } catch (CASException e) {
      throw new ResourceProcessException(e);
    }
    
    
 /**
  * Iterates and prints annotations.
  * Counts the correct and total number of recognitions in the meanwhile.
  */
    Iterator annotationIter = jcas.getAnnotationIndex(geneTag.type).iterator();
    
    while (annotationIter.hasNext()) {
      
      geneTag g= (geneTag) annotationIter.next();
      
      // get the text that is enclosed within the annotation in the CAS
      String aText = g.getText();
      try {
        System.out.println("#############");
        fileWriter.write(((geneTag) g).getID() + '|');
        fileWriter.write(g.getStart() + " " + g.getEnd() + "|");
        fileWriter.write(g.getText() + '\n');
        fileWriter.flush();
      } catch (IOException e) {
        throw new ResourceProcessException(e);
      }
    }
//      }
   
//      try {
//          br.close();
//      } catch (IOException ignoreMe){
//     // TODO Auto-generated catch block
//        ignoreMe.printStackTrace();
      }