public Map<Integer, Integer> getGeneSpans(String text) throws IOException, ClassNotFoundException{
    Map<Integer, Integer> begin2end = new HashMap<Integer, Integer>();
    Chunking chunking = chunker.chunk(text);
    Iterator<Chunk>iter = chunking.chunkSet().iterator();
    while(iter.hasNext()){
      int numOfSpace = 0;
      Chunk c = (Chunk)iter.next();
      begin2end.put(c.start(), c.end());
      
      for(int i = 0; i < c.start(); i++){
        if(text.charAt(i)==' ')
          numOfSpace++;
      }
      space.put(c.start(), numOfSpace);
    }
    return begin2end;
  }