<commit_before>package com.martin.jtests.serializing;

import java.util.Scanner;

public class Main {

	private static IndexManager manager;

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		manager = new IndexManager(sc);
		String input;
		displayCommands();
		System.out.println("\n");

		while (!(input = sc.nextLine()).toLowerCase().contentEquals("end")) {
			if (!input.contentEquals("")) {
				Action action = Parser.getAction(input);
				doAction(action);
				System.out.println("\n");
			}
		}

		sc.close();
	}

	private static void doAction(Action action) {
		switch (action.getCommand()) {
		case GENERATE:
			manager.generate(Integer.parseInt(action.getData()));
			break;
		case WRITE:
			manager.write(action.getData());
			break;
		case READ:
			manager.read(action.getData());
			break;
		case ADD:
			manager.add(action.getData());
			break;
		case SEARCH:
			manager.search(action.getData());
			break;
		case HELP:
			displayCommands();
			break;
		case UNKNOWN:
			System.out.println("Unknown command");
			break;
		}
	}

	private static void displayCommands() {
		System.out.println("\nAvailable commands:\n");
		System.out
				.println("Generate [amount]\nWrite [name]\nRead [name]\nAdd [title]\nSearch [part of title or tag]\nHelp");
	}

}
<commit_msg>Hopefully final fix for crappy appending of empty lines<commit_after>package com.martin.jtests.serializing;

import java.util.Scanner;

public class Main {

	private static IndexManager manager;

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		manager = new IndexManager(sc);
		String input;
		displayCommands();
		System.out.print("\n");

		while (!(input = sc.nextLine()).toLowerCase().contentEquals("end")) {
			if (!input.contentEquals("")) {
				Action action = Parser.getAction(input);
				doAction(action);
				System.out.print("\n");
			}
		}

		sc.close();
	}

	private static void doAction(Action action) {
		switch (action.getCommand()) {
		case GENERATE:
			manager.generate(Integer.parseInt(action.getData()));
			break;
		case WRITE:
			manager.write(action.getData());
			break;
		case READ:
			manager.read(action.getData());
			break;
		case ADD:
			manager.add(action.getData());
			break;
		case SEARCH:
			manager.search(action.getData());
			break;
		case HELP:
			displayCommands();
			break;
		case UNKNOWN:
			System.out.println("Unknown command");
			break;
		}
	}

	private static void displayCommands() {
		System.out.println("\nAvailable commands:\n");
		System.out
				.println("Generate [amount]\nWrite [name]\nRead [name]\nAdd [title]\nSearch [part of title or tag]\nHelp");
	}

}

{'fraction_non_alphanumeric': 0.14909638554216867, 'fraction_numerical': 0.0, 'mean_word_length': 3.8397085610200365, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '2224639', 'n_tokens_mistral': 981, 'n_tokens_neox': 857, 'n_words': 190}