public boolean classifyDocumentStdin(DocumentReaderAndWriter<IN> readerWriter)
    throws IOException
  {
    BufferedReader is = new BufferedReader(new InputStreamReader(System.in, flags.inputEncoding));
    String line;
    String text = "";
    String eol = "\n";
    String sentence = "<s>";
    int blankLines = 0;
    while ((line = is.readLine()) != null) {
      if (line.trim().equals("")) {
    	  ++blankLines;
    	  if (blankLines > 3) {
    		  return false;
    	  } else if (blankLines > 2) {
			  ObjectBank<List<IN>> documents = makeObjectBankFromString(text, readerWriter);
	    	  classifyAndWriteAnswers(documents, readerWriter);
    		  text = "";
    	  } else {
    		  text += sentence + eol;
    	  }
      } else {
    	  text += line + eol;
    	  blankLines = 0;
      }
    }
    // Classify last document before input stream end
    if (text.trim() != "") {
      ObjectBank<List<IN>> documents = makeObjectBankFromString(text, readerWriter);
  	  classifyAndWriteAnswers(documents, readerWriter);
    }
    return (line == null); // reached eol
  }
public boolean classifyDocumentStdin ( DocumentReaderAndWriter < IN > readerWriter ) throws IOException { BufferedReader is = new BufferedReader ( new InputStreamReader ( System . in , flags . inputEncoding ) ) ; String line ; String text = "" ; String eol = "\n" ; String sentence = "<s>" ; int blankLines = 0 ; while ( ( line = is . readLine ( ) ) != null ) { if ( line . trim ( ) . equals ( "" ) ) { ++ blankLines ; if ( blankLines > 3 ) { return false ; } else if ( blankLines > 2 ) { ObjectBank < List < IN > > documents = makeObjectBankFromString ( text , readerWriter ) ; classifyAndWriteAnswers ( documents , readerWriter ) ; text = "" ; } else { text += sentence + eol ; } } else { text += line + eol ; blankLines = 0 ; } } if ( text . trim ( ) != "" ) { ObjectBank < List < IN > > documents = makeObjectBankFromString ( text , readerWriter ) ; classifyAndWriteAnswers ( documents , readerWriter ) ; } return ( line == null ) ; }
Classify stdin by documents seperated by 3 blank line
@param readerWriter
@return boolean reached end of IO
@throws IOException