private void test(String corpus, String dict, String file,int length,Mode mode,boolean freq){
        Trainer tr = new Trainer(length, 0,-1);
        tr.load(dict, file, mode);

        Developer dev = null;
        if (mode == Mode.COMBINED) {
            dev = new DevDictNgram(tr);
        } else if (mode == Mode.NGRAM) {
            dev = new DevNgram(tr);
        } else if (mode == Mode.DMC) {
            dev = new DevDMC(tr);
        } else if (mode == Mode.HMM) {
            dev = new DevHMMPre(tr);
        } else if (mode == Mode.HMMEnd) {
            dev = new DevHMM(tr);
        }

        if (dev != null) {
            System.out.println("MODE "+mode);
            System.out.println("Param size: "+dev.getSize());
            System.out.println("logprob: "+dev.logLikelihood(corpus));
            System.out.println("logprob/words: "+dev.getLastTest() + "("+dev.getLastLength()+")");
        }
    }