code: public static List doFeatureGen(Map map, String text , List markList, boolean label){
          markList.clear();
          
          //Find out positions of .!? and store them in the markList
          int nextPos = 0;
          while( (nextPos = StringUtils.findFirstOf(text, ".!?", nextPos + 1)) != -1) 
                  markList.add(new Integer(nextPos));
          
          //Generate context predicates at those positions
          List results = new ArrayList();
          for (int i = 0; i < markList.size(); ++i){                        
          
              int curPos = ((Integer) markList.get(i)).intValue();            
              String record = genCPs(map, text, curPos);
              
              //Assign label to feature string if it is specified
              if (label){
                  int idx = StringUtils.findFirstNotOf(text, " \t", curPos + 1);
              
                  if (idx == -1 || (text.charAt(idx) == '\n')){
                      //end of sentence
                      record += " " + "y";
                  }                    
                  else record += " " + "n";                                
              }
              
              results.add(record);
          }        
          return results;
      }
docs: Generate context predicates for a specified text, return string representing the context predicates.
  
  @param map the map
  @param text the text
  @param markList the mark list
  @param label the label
  @return the list