public static void main(String[]args){
        String Train = args[0];
        //String Test = args[1];

        //Naive naive = new Naive();
        topwordsLogOdds naive = new topwordsLogOdds();
        try {
            naive.train(Train);
        } catch (IOException e) {
            e.printStackTrace();
        }
        //naive.test(Test);

        List<Map.Entry<String, Double>> folder = new ArrayList<Map.Entry<String, Double>>(naive.ppMap2.entrySet());
        Collections.sort(folder, new Comparator<Map.Entry<String, Double>>() {
            public int compare(Map.Entry<String, Double> e1,
                               Map.Entry<String, Double> e2) {
                if (!e1.getValue().equals(e2.getValue())) {
                    if (e2.getValue() > e1.getValue()) return 1;
                    else return -1;
                } else
                    return (e1.getKey()).toString().compareTo(e2.getKey().toString());
            }
        });

        for(int i = 0; i < 20; i++){
            System.out.printf(folder.get(i).getKey() + " %.04f" + "\n", folder.get(i).getValue());

        }

        System.out.printf("\n");


        folder = new ArrayList<Map.Entry<String, Double>>(naive.ppMap.entrySet());
        Collections.sort(folder, new Comparator<Map.Entry<String, Double>>() {
            public int compare(Map.Entry<String, Double> e1,
                               Map.Entry<String, Double> e2) {
                if (!e1.getValue().equals(e2.getValue())) {
                    if (e2.getValue() > e1.getValue()) return 1;
                    else return -1;
                } else
                    return (e1.getKey()).toString().compareTo(e2.getKey().toString());
            }
        });

        for(int i = 0; i < 20; i++){
            System.out.printf(folder.get(i).getKey() + " %.04f" + "\n", folder.get(i).getValue());

        }


    }