public void process(JCas aJCas) throws AnalysisEngineProcessException {
    String text = aJCas.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);
      List<String> tokenArr = new ArrayList<String>();
      Map<Integer, Integer> gslineMap = getGeneSpans(sent, tokenArr);
      StringArray sa = new StringArray(aJCas, tokenArr.size());
      String[] tokens = new String[tokenArr.size()];
      for(int i1 = 0; i1 < tokenArr.size(); i1++)
        tokens[i1] = tokenArr.get(i1);
      sa.copyFromArray(tokens, 0, 0, tokenArr.size());
      
      Set<Map.Entry<Integer, Integer>> entries = gslineMap.entrySet();
      for (Map.Entry<Integer, Integer> entry : entries) {
        GeneMention gmAnnot = new GeneMention(aJCas);
        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.setTokenArr(sa);
        gmAnnot.addToIndexes();
      }
    }
  }