Advertisement
Guest User

Untitled

a guest
Mar 28th, 2017
43
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. while ( input.hasNextLine() ) {
  2.  
  3. if ( line.length() > 0 ) {
  4.  
  5. line = line.trim();
  6. line = line.toLowerCase();
  7. tokens = line.trim().split( "[^a-z']+" );
  8. tokenizer( tokens );
  9.  
  10. for ( int i = 0; i < tokens.length; i++ ) {
  11.  
  12. if ( tokens[i].length() > 0 ) {
  13. int hashCode = hash( tokens[i] ); // get the hashCode
  14. index = compressionMap( hashCode ); // get the index
  15.  
  16. boolean result = search( index, tokens[i] );
  17. if ( !result ) {
  18. insert( index, tokens[i] ); // insert the word
  19. uniqueWords++;
  20. }
  21. }
  22. } // for loop
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement