<commit_before>package it.unito.geosummly.io;

import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.math.RoundingMode;
import java.text.NumberFormat;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.Vector;

public class LogWriter {
	
	/**
	 * Write the log file of clustering process 
	*/
	public void printClusteringLog(StringBuilder sb, double eps, double sse, String output) {
		sb.append("\n\neps value: "+eps);
		sb.append("\nSSE value: "+sse);
		
		try {
	    	File file=new File(output+"/clustering-eps"+eps+".log");
	 
    		//if file doesn't exist, then create it
			if(!file.exists()){
				file.createNewFile();
			}
 
    		FileWriter fw = new FileWriter(file);
	        BufferedWriter bw = new BufferedWriter(fw);
	        bw.write(sb.toString());
	        bw.flush();
	        bw.close();
	 
    	} catch(IOException e){
    		e.printStackTrace();
    	}
	}
	
	/**
	 * Write the log file of SSE values
	*/
	public void printSSELog(ArrayList<Double> SSEs, String output) {
		try {
	    	File file=new File(output+"/SSEs.log");
	 <commit_msg>change name of clustering log file<commit_after>package it.unito.geosummly.io;

import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.math.RoundingMode;
import java.text.NumberFormat;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.Vector;

public class LogWriter {
	
	/**
	 * Write the log file of clustering process 
	*/
	public void printClusteringLog(StringBuilder sb, double eps, double sse, String output) {
		sb.append("\n\neps value: "+eps);
		sb.append("\nSSE value: "+sse);
		
		try {
	    	File file=new File(output+"/clustering-log-eps"+eps+".log");
	 
    		//if file doesn't exist, then create it
			if(!file.exists()){
				file.createNewFile();
			}
 
    		FileWriter fw = new FileWriter(file);
	        BufferedWriter bw = new BufferedWriter(fw);
	        bw.write(sb.toString());
	        bw.flush();
	        bw.close();
	 
    	} catch(IOException e){
    		e.printStackTrace();
    	}
	}
	
	/**
	 * Write the log file of SSE values
	*/
	public void printSSELog(ArrayList<Double> SSEs, String output) {
		try {
	    	File file=new File(output+"/SSEs.log");
	 
{'fraction_non_alphanumeric': 0.12997987927565394, 'fraction_numerical': 0.0, 'mean_word_length': 3.2641509433962264, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '7385647', 'n_tokens_mistral': 899, 'n_tokens_neox': 813, 'n_words': 197}