<commit_before>package ru.spec.java1.lec6;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.InputStream;
import java.net.URL;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Scanner;
import java.util.TreeSet;


public class FileHW {

	public static void main(String[] args) throws FileNotFoundException   {
		//System.out.println("Enter any string");
		InputStream in = 		System.in;
		
		File file = new File("C:/java/java1.txt");
		in = new FileInputStream(file);
		//in  = new URL("http://specialist.ru").openStream();
		
		
		Scanner scanner = new Scanner(in);
		
		//Map<String,Integer> stat = new HashMap<>();
		
		ArrayList<String> strings = new ArrayList<>();
		strings.listIterator().previousIndex();
		//TreeSet<String> set = new TreeSet<>();
		HashSet<String> set = new HashSet<>();
		
		
		for (;scanner.hasNextLine();) {
		//String nextLine = scanner.nextLine();
		String [] nextLine = scanner.nextLine().toLowerCase().split("[^а-яё]+");
			strings.addAll(Arrays.asList(nextLine));
			
		//System.out.println(nextLine);
		}
//		System.out.println(strings.size());
//		for (int i=0;i<=strings.size();i++) {
		
		
		
			set.addAll(strings);
			
			
			
//			int wordsCount=1;
//			for (String word:set) {
//				if (strings.equals(word)){
//					wordsCount++;
//					System.out.println(strings + " " + wordsCount);
//				}
//			}
//		}
		
		
		for (String word : set) { // добавляет уникальные значения
			
			System.out.println (word + "(" +word.length()+ ")");
		}
///
		//System.out.println(split.length);
		System.out.println(set.size()+ "ээ");
	}

}<commit_msg>System in<commit_after>package ru.spec.java1.lec6;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.InputStream;
import java.net.URL;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Scanner;
import java.util.Set;
import java.util.TreeSet;

import ru.spec.java1.lec4.WordsCount;


public class FileHW {

	public static void main(String[] args) throws FileNotFoundException   {
		//System.out.println("Enter any string");
		InputStream in = 		System.in;
		
		File file = new File("C:/java/java1.txt");
		in = new FileInputStream(file);
		//in  = new URL("http://specialist.ru").openStream();
		
		
		Scanner scanner = new Scanner(in);
		
		//Map<String,Integer> stat = new HashMap<>();
		
		ArrayList<String> strings = new ArrayList<>();
		strings.listIterator().previousIndex();
		TreeSet<String> set = new TreeSet<>();
		//HashSet<String> set = new HashSet<>();
		
		
		for (;scanner.hasNextLine();) {
		//String nextLine = scanner.nextLine();
		String [] nextLine = scanner.nextLine().toLowerCase().split("[^а-яё]+");
			strings.addAll(Arrays.asList(nextLine));
			
		//System.out.println(nextLine);
		}
//		System.out.println(strings.size());
//		for (int i=0;i<=strings.size();i++) {
		
		
		
			set.addAll(strings);
			
			
			
//			int wordsCount=1;
//			for (String word:set) {
//				if (strings.equals(word)){
//					wordsCount++;
//					System.out.println(strings + " " + wordsCount);
//				}
//			}
//		}
		
			for (String word : set){
	            int count = 0;
	            for (String w : strings){
	                if (word.equals(w)) count++;
	            }
	            System.out.println(word + " - "+count);
	        }
	
			
			
		
///
		//System.out.println(split.length);
		System.out.println("Уникальных слов: "+set.size());
	}


}
{'fraction_non_alphanumeric': 0.1735900962861073, 'fraction_numerical': 0.003576341127922971, 'mean_word_length': 3.0355160932297447, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4662767', 'n_tokens_mistral': 1400, 'n_tokens_neox': 1215, 'n_words': 234}