<commit_before>package lt.repl;

import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.util.Scanner;

/**
 * repl
 */
public class REPL {
        private REPL() {
        }

        public static void main(String[] args) {
                System.out.println("LessTyping REPL");
                System.out.print(">");
                Evaluator evaluator = new Evaluator();
                Scanner scanner = new Scanner(System.in);
                StringBuilder sb = new StringBuilder();
                while (true) {
                        String str = scanner.nextLine();
                        if (str.trim().isEmpty()) {
                                if (sb.length() != 0) {
                                        // do repl
                                        try {
                                                Evaluator.Entry entry = evaluator.eval(sb.toString());
                                                String name = entry.name;
                                                Object o = entry.result;
                                                if (name == null) {
                                                        showObjectStructure(o);
                                                } else {
                                                        System.out.println(name + " : " + o.getClass().getName() + " = " + o);
                                                }
                                                System.out.print("\n>");
                                        } catch (Exception e) {
                                                e.printStackTrace();
                                        }
                                        sb.delete(0, sb.length());
                                }
                        } else {
                                sb.append(str).append("\n");
                                System.out.print(">");
                        }

                }
        }

        private static void showObjectStructure(Object o) throws IllegalAccessException {
                Class<?> cls = o.getClass();
                String className = cls.getName();
                System.out.println("class " + className);
                for (Field f : cls.getDeclaredFields()) {
                        f.setAccessible(true);
                        Object value = f.get(o);
                        System.out.println("    " + f.getName() + " : " + f.getType() + " = " + value);
                }
                for (Method m : cls.getDeclaredMethods()) {
                        System.out.print("    " + m.getName() + "(");
                        boolean isFirst = true;
                        for (Class<?> paramT : m.getParameterTypes()) {
                                if (isFirst) {
                                        isFirst = false;
                                } else {
                                        System.out.print(", ");<commit_msg>REPL output pretty<commit_after>package lt.repl;

import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.util.Scanner;

/**
 * repl
 */
public class REPL {
        private REPL() {
        }

        public static void main(String[] args) {
                System.out.println("LessTyping REPL");
                System.out.print(">");
                Evaluator evaluator = new Evaluator();
                Scanner scanner = new Scanner(System.in);
                StringBuilder sb = new StringBuilder();
                while (true) {
                        String str = scanner.nextLine();
                        if (str.trim().isEmpty()) {
                                if (sb.length() != 0) {
                                        // do repl
                                        try {
                                                Evaluator.Entry entry = evaluator.eval(sb.toString());
                                                String name = entry.name;
                                                Object o = entry.result;
                                                if (name == null) {
                                                        showObjectStructure(o);
                                                } else {
                                                        System.out.println(name + " : " + o.getClass().getName() + " = " + o);
                                                }
                                                System.out.print("\n>");
                                        } catch (Throwable t) {
                                                t.printStackTrace();
                                                try {
                                                        Thread.sleep(10);
                                                } catch (InterruptedException e) {
                                                        e.printStackTrace();
                                                }
                                                System.out.print(">");
                                        }
                                        sb.delete(0, sb.length());
                                }
                        } else {
                                sb.append(str).append("\n");
                                System.out.print(">");
                        }

                }
        }

        private static void showObjectStructure(Object o) throws IllegalAccessException {
                Class<?> cls = o.getClass();
                String className = cls.getName();
                System.out.println("class " + className);
                for (Field f : cls.getDeclaredFields()) {
                        f.setAccessible(true);
                        Object value = f.get(o);
                        System.out.println("    " + f.getName() + " : " + f.getType() + " = " + value);
                }
                for (Method m : cls.getDeclaredMethods()) {
                        System.out.print("    " + m.getName() + "(");
                        boolean isFirst = true;
                        for (Class<?> paramT : m.getParameterTypes()) {
                                if (isFirst) {
                                        isFirst = false;
                                } else {
                                        System.out.print(", ");
{'fraction_non_alphanumeric': 0.09736180904522614, 'fraction_numerical': 0.0009422110552763819, 'mean_word_length': 0.6867055084745762, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 14, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 76, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6792315', 'n_tokens_mistral': 1216, 'n_tokens_neox': 1165, 'n_words': 249}