<commit_before>package tknz.exec;
 
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStreamReader;

import org.antlr.v4.runtime.*; 

import tknz.parser.TknzEngine;

public class Main {
	public static void main(String[] args) {
		ANTLRInputStream[] grammars = null;
		InputStreamReader input = null;
		
		try {
			input = new InputStreamReader(new FileInputStream(args[0]));
			grammars = new ANTLRInputStream[args.length - 1];
			for (int i = 1; i < args.length; i++) {
				grammars[i - 1] = new ANTLRInputStream(new FileInputStream(args[i]));
			}
		} catch (IndexOutOfBoundsException e) {
			String[] usage = {
					"Usage: tknz <input> [<grammar1.tkn>, ...]"
					};
			for (String u : usage) {
				System.out.println(u);
			}
			System.exit(1);
		} catch (FileNotFoundException e) {
			System.err.printf("Could not find file %s\n", e.getMessage());
			System.exit(1);
		} catch (IOException e) {
			System.err.printf("Could not find file %s\n", e.getMessage());
			System.exit(1);
		}
		
		TknzEngine engine = new TknzEngine(input);
		for (ANTLRInputStream stream : grammars) {
			engine.load(stream);
		}
		
	}
}<commit_msg>Simplified approach to the main executable<commit_after>package tknz.exec;
 
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStreamReader;

import org.antlr.v4.runtime.*; 

import tknz.parser.Engine;

public class Main {
	public static void main(String[] args) {
		ANTLRInputStream grammar = null;
		InputStreamReader input = null;
		
		try {
			grammar = new ANTLRInputStream(new FileInputStream(args[0]));
			input = new InputStreamReader(new FileInputStream(args[1]));
		} catch (IndexOutOfBoundsException e) {
			String[] usage = {"Usage: tknz <grammar> <input>"};
			for (String u : usage) {
				System.out.println(u);
			}
			System.exit(1);
		} catch (FileNotFoundException e) {
			System.err.printf("Could not find file %s\n", e.getMessage());
			System.exit(1);
		} catch (IOException e) {
			System.err.printf("Could not find file %s\n", e.getMessage());
			System.exit(1);
		}
		
		Engine engine = new Engine(input);
		engine.load(grammar);
	}
}
{'fraction_non_alphanumeric': 0.13848920863309352, 'fraction_numerical': 0.006744604316546762, 'mean_word_length': 3.89010989010989, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 7, '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': '2937851', 'n_tokens_mistral': 843, 'n_tokens_neox': 735, 'n_words': 175}