/** * Constructor which directly instantiates the BufferedReader containing * the model contents. * * @param br The BufferedReader containing the model information. */ public PlainTextNaiveBayesModelReader(BufferedReader br) { super(new PlainTextFileDataReader(br)); }
public AbstractModelReader(File f) throws IOException { String filename = f.getName(); InputStream input; // handle the zipped/not zipped distinction if (filename.endsWith(".gz")) { input = new GZIPInputStream(new FileInputStream(f)); filename = filename.substring(0,filename.length() - 3); } else { input = new FileInputStream(f); } // handle the different formats if (filename.endsWith(".bin")) { this.dataReader = new BinaryFileDataReader(input); } else { // filename ends with ".txt" this.dataReader = new PlainTextFileDataReader(input); } }
/** * Constructor which directly instantiates the BufferedReader containing * the model contents. * * @param br The BufferedReader containing the model information. */ public PlainTextNaiveBayesModelReader(BufferedReader br) { super(new PlainTextFileDataReader(br)); }
/** * Constructor which directly instantiates the BufferedReader containing * the model contents. * * @param br The BufferedReader containing the model information. */ public PlainTextNaiveBayesModelReader(BufferedReader br) { super(new PlainTextFileDataReader(br)); }
public AbstractModelReader(File f) throws IOException { String filename = f.getName(); InputStream input; // handle the zipped/not zipped distinction if (filename.endsWith(".gz")) { input = new GZIPInputStream(new FileInputStream(f)); filename = filename.substring(0,filename.length() - 3); } else { input = new FileInputStream(f); } // handle the different formats if (filename.endsWith(".bin")) { this.dataReader = new BinaryFileDataReader(input); } else { // filename ends with ".txt" this.dataReader = new PlainTextFileDataReader(input); } }
public AbstractModelReader(File f) throws IOException { String filename = f.getName(); InputStream input; // handle the zipped/not zipped distinction if (filename.endsWith(".gz")) { input = new GZIPInputStream(new FileInputStream(f)); filename = filename.substring(0,filename.length() - 3); } else { input = new FileInputStream(f); } // handle the different formats if (filename.endsWith(".bin")) { this.dataReader = new BinaryFileDataReader(input); } else { // filename ends with ".txt" this.dataReader = new PlainTextFileDataReader(input); } }
DataReader modelReader = new PlainTextFileDataReader(decodedInputStream); MaxentModel loadedMaxentModel = new GISModelReader(modelReader).getModel();