Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- scanner = new Scanner(file).useDelimiter("\\s*\\p{Punct} \\s*");
- while(scanner.hasNext()){
- temp = scanner.next();
- if(!lista.isEmpty() && lista.contains(temp)){
- int temp_ilosc = lista_wyst.indexOf(temp);
- temp_ilosc++;
- lista_wyst.set(lista.indexOf(temp), temp_ilosc);
- }
- else{
- lista.add(temp);
- lista_wyst.add(1);
- }
- for(int i = 0; i < lista.size(); i++){
- System.out.println(lista.get(i)+ " " + lista_wyst.get(i));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement