public List < List < IN > > classifyRaw ( String str , DocumentReaderAndWriter < IN > readerAndWriter ) { ObjectBank < List < IN >> documents = makeObjectBankFromString ( str , readerAndWriter ) ; List < List < IN > > result = new ArrayList < List < IN > > ( ) ; for ( List < IN > document : documents ) { classify ( document ) ; List < IN > sentence = new ArrayList < IN > ( ) ; for ( IN wi : document ) { // TaggedWord word = new TaggedWord(wi.word(), wi.answer()); // sentence.add(word); sentence . add ( wi ) ; } result . add ( sentence ) ; } return result ; }
Classify the tokens in a String . Each sentence becomes a separate document . Doesn t override default readerAndWriter .