public static String[] parseArgs(String[] args) {

        String[] words = null;

        if(args.length < 1) {
            printHelpAndExit();
        }

        if(args[0].compareTo("train") == 0 ) {
            STATE = "train";
        } else if(args[0].compareTo("test") == 0 ) {
            STATE = "test";
        } else if(args[0].compareTo("words") == 0 ) {
            STATE = "words";

            words = new String[args.length -1];

            for(int i = 1; i < args.length; i++) {
                words[i-1] = args[i];
            }

        } else {
            printHelpAndExit();
        }

        return words;

    }