public void process(JCas jcas) throws AnalysisEngineProcessException {
    // get model path
    FSIndex crfIndex = jcas.getAnnotationIndex(CRFModel.type);
    Iterator iter = crfIndex.iterator();
    // only one instance
    while (iter.hasNext()) {
      CRFModel model = (CRFModel) iter.next();
      mmodelPath = model.getPath();
    }

    CRF crf = null;
    try {
      crf = readModel(mmodelPath);
    } catch (IOException e) {
      e.printStackTrace();
    } catch (ClassNotFoundException e) {
      e.printStackTrace();
    }

    String text = jcas.getDocumentText();
    String[] textLine = text.split("\n");

    for (int i = 0; i < textLine.length; i++) {
      String line = textLine[i];
      String sentid = line.substring(0, line.indexOf(' '));
      String sent = line.substring(line.indexOf(' ') + 1);
      Map<Integer, Integer> gslineMap = getGeneSpansCRF(crf, sent);
      Set<Map.Entry<Integer, Integer>> entries = gslineMap.entrySet();
      for (Map.Entry<Integer, Integer> entry : entries) {
        GeneMention gmAnnot = new GeneMention(jcas);
        gmAnnot.setBegin(getIdx(sent, entry.getKey()));
        gmAnnot.setEnd(getIdx(sent, entry.getValue() - 1));
        gmAnnot.setId(sentid);
        gmAnnot.setText(sent);
        gmAnnot.setTag(sent.substring(entry.getKey(), entry.getValue()));
        gmAnnot.addToIndexes();
      }
    }
  }