Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- while ( input.hasNextLine() ) {
- if ( line.length() > 0 ) {
- line = line.trim();
- line = line.toLowerCase();
- tokens = line.trim().split( "[^a-z']+" );
- tokenizer( tokens );
- for ( int i = 0; i < tokens.length; i++ ) {
- if ( tokens[i].length() > 0 ) {
- int hashCode = hash( tokens[i] ); // get the hashCode
- index = compressionMap( hashCode ); // get the index
- boolean result = search( index, tokens[i] );
- if ( !result ) {
- insert( index, tokens[i] ); // insert the word
- uniqueWords++;
- }
- }
- } // for loop
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement