public void read ( BufferedReader reader ) throws Exception { String line ; clear ( ) ; while ( ( line = reader . readLine ( ) ) != null ) { line = line . trim ( ) ; // comment? if ( line . startsWith ( "#" ) ) continue ; add ( line ) ; } reader . close ( ) ; }
Generates a new Stopwords object from the reader . The reader is closed automatically .