public void process(JCas pJCas) throws AnalysisEngineProcessException {
    System.out.println("GeneAnnotator");
    File chunkerFile = new File("src/main/resources/data/ne-en-bio-genetag.HmmChunker");
    // HMM chunker to identify gene mentions
    Chunker HMMchunker;
    try {
      HMMchunker = (Chunker) AbstractExternalizable.readObject(chunkerFile);
      FSIterator<Annotation> iterator = pJCas.getAnnotationIndex(sentence.type).iterator();
      while (iterator.hasNext()) {
        sentence senTag = (sentence) iterator.next();
        String content = senTag.getContent();
        Chunking chunking = HMMchunker.chunk(content);
        Set<Chunk> chunkSet = chunking.chunkSet();
        for (Chunk chunk : chunkSet) {
          if (chunk != null) {
            word gene = new word(pJCas);
            gene.setSource(senTag.getSource());
            gene.setBegin(chunk.start());
            gene.setEnd(chunk.end());
            gene.setContent(content.substring(chunk.start(), chunk.end()));
            gene.addToIndexes();
          }
        }
      }

    } catch (IOException e) {
      e.printStackTrace();
    } catch (ClassNotFoundException e) {
      e.printStackTrace();
    }

  }