code: public String senSegment(String text){
          //text normalization         
          text = text.replaceAll("([\t \n])+", "$1");
          //System.out.println(text);
          
          //generate context predicates
          List markList = new ArrayList();
          List data = FeatureGenerator.doFeatureGen(new HashMap(), text, markList, false);
  
          if (markList.isEmpty())
              return text + "\n";
          
          //classify
          List labels = classifier.classify(data);
  	 
          String result = text.substring(0, ((Integer)markList.get(0)).intValue());
  
          for (int i =0; i < markList.size(); ++i){        
              int curPos = ((Integer) markList.get(i)).intValue();            
  
              if ( ((String)labels.get(i)).equals(positiveLabel)){
                  result += " " + text.charAt(curPos) + "\n";            
              }
              else result += text.charAt(curPos);
  
              if (i < markList.size() - 1){                    
                  int nexPos = ((Integer) markList.get(i + 1)).intValue();                                
                  result += text.substring(curPos + 1, nexPos);           
              }
          }
  
          int finalMarkPos = ((Integer) markList.get(markList.size() - 1)).intValue();
          result += text.substring(finalMarkPos + 1, text.length());
  
          //System.out.println(result);
          result = result.replaceAll("\n ", "\n");        
          result = result.replaceAll("\n\n", "\n");
          result = result.replaceAll("\\.\\. \\.", "...");
          return result;
      }
docs: Sen segment.
  
  @param text the text
  @return the string