public static void main(String[] args) {
        String path = System.getProperty("user.dir") + FILE_PATH;
        Dictionary dictionary = new Dictionary(path);
        System.out.println("initializing dictionary...");
        dictionary.preprocess();
        Scanner userInputScanner = new Scanner(System.in);
        System.out.print("Enter a word or % to quit: ");
        String input = userInputScanner.nextLine();
        if (input.equals("%"))
            return;
        while (!input.equals("%")) {
            long startTime = System.currentTimeMillis();
            try {
                validate(input);
                input = input.toLowerCase();
                List<String> findings = dictionary.find(input);
                System.out.println("Found: " + findings);
                System.out.println(String.format("%d words found in %d seconds", findings.size(),
                        TimeUnit.MILLISECONDS.toSeconds(System.currentTimeMillis() - startTime)));
            } catch (Exception e) {
                System.out.println(e.getMessage());
            }
            System.out.print("Enter a word or % to quit: ");
            input = userInputScanner.nextLine();
        }
        System.out.println("Game over");

    }