Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package com.sun.bigbrother.Trainer;
 
 
 import java.io.*;
 
public class TrainerMain {
    public static void main(String[] argsthrows Exception {
        if (args.length < 2) {
             System.exit(usage());
        }
        FisherClassifierImpl fc = new FisherClassifierImpl();
        JNIssueTracker jni = getIssueTracker();
        train(jnifcnew File(args[1]));
        writeObject(args[0], fc);
    }
    private static void writeObject(String filenameFisherClassifier fcthrows IOException {
        ObjectOutputStream out = null;
        try {
            out = new ObjectOutputStream(new FileOutputStream(filename));
            out.writeObject(fc);
        } finally {
            if (out != null)
                out.close();
        }
    }
    private static void train(JNIssueTracker jniTrainer tFile dirthrows ProcessingException {
        for (File f : dir.listFiles()) {
            if (f.isDirectory())
                continue;
            String n = f.getName();
            int id = Integer.parseInt(n.substring(0, 5));
            try {
                JNIssue i = jni.load(idnew FileInputStream(f));
                List<JNIssue.Descriptionlist = i.getDescriptions();
                t.train(i.getShortDescription(), i.getSubComponent());
                t.train(list.get(0).getText(), i.getSubComponent());
            } catch (FileNotFoundException ex) {
                Logger.getLogger(TrainerMain.class.getName()).log(.nullex);
            }
        }
    }
    private static JNIssueTracker getIssueTracker() throws ProcessingException {
        JavaNet jn = JavaNet.connect();
        JNProject gf = jn.getProject("glassfish");
        return gf.getIssueTracker();
    }
    private static int usage() {
        ..println("usage : java TrainerMain trainer-file-name trainer-inputdata-directory");
        ..println("example : java TrainerMain trainer.ser /Users/nachi/Bayes/data/");
        return 1;
    }
New to GrepCode? Check out our FAQ X