<commit_before>package com.twu.biblioteca;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

/**
 * Created by watsonarw on 16/04/15.
 */
public class MainMenu {

    public static MainMenu instance = new MainMenu();

    public static final String INVALID_INPUT_MESSAGE = "The input you've entered is invalid, please try again.\n";

    private MainMenu(){ }

    public void show() {
        System.out.print("------ Main Menu ------\n" +
                           "Select an option below:\n" +
                           " 1 | List Books\n");
    }

    public void handleResponse() {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        try {
            String response = br.readLine();
            switch (Integer.parseInt(response)) {
                case 1:
                    System.out.print(BibliotecaApp.getLibrary().getBookList());
                    break;
                default:
                    System.out.print(INVALID_INPUT_MESSAGE);
            }
        } catch (IOException e) {
            e.printStackTrace();
        } catch (NumberFormatException e) {
            System.out.print(INVALID_INPUT_MESSAGE);
        }
    }
}
<commit_msg>Cleanup MainMenu - simplify future menu options<commit_after>package com.twu.biblioteca;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.HashMap;

/**
 * Created by watsonarw on 16/04/15.
 */
public class MainMenu {

    public static MainMenu instance = new MainMenu();
    private HashMap<Integer, String> menuOptions = new HashMap<Integer, String>();

    public static final String INVALID_INPUT_MESSAGE = "The input you've entered is invalid, please try again.\n";

    private MainMenu(){
        menuOptions.put(1, "List Books");
    }

    public void show() {
        StringBuilder sb = new StringBuilder();

        sb.append("------ Main Menu ------\n" +
                "Select an option below:\n");
        for (Integer key: menuOptions.keySet()) {
            sb.append(" " + key + " | " + menuOptions.get(key) + "\n");
        }
        System.out.print(sb.toString());
    }

    public void handleResponse() {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        try {
            String response = br.readLine();
            switch (Integer.parseInt(response)) {
                case 1:
                    System.out.print(BibliotecaApp.getLibrary().getBookList());
                    break;
                default:
                    System.out.print(INVALID_INPUT_MESSAGE);
            }
        } catch (IOException e) {
            e.printStackTrace();
        } catch (NumberFormatException e) {
            System.out.print(INVALID_INPUT_MESSAGE);
        }
    }
}

{'fraction_non_alphanumeric': 0.11533052039381153, 'fraction_numerical': 0.005625879043600563, 'mean_word_length': 1.9884453781512605, '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': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3207064', 'n_tokens_mistral': 782, 'n_tokens_neox': 747, 'n_words': 187}