// Path: src/io/Preface.java
// public class Preface {
// 	public static void readPreface(BufferedReader in) throws IOException {
// 		String line = in.readLine();
// 
// 		if (line == null || line.charAt(0) != '#') {
// 			throw new IllegalArgumentException("File does not start with the mandatory preface.");
// 		}
// 
// 		while ((line = in.readLine()) != null) {
// 			if (line.isEmpty()) {
// 				break;
// 			}
// 			if (line.charAt(0) != '#') {
// 				throw new IllegalArgumentException("Uncommented line within preface.");
// 			}
// 		}
// 	}
// 
// 	public static void printPreface(PrintWriter out) {
// 		out.println("# mandatory preface");
// 		out.println("# mandatory preface");
// 		out.println();
// 	}
// }


import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import io.Preface;
package model;



public class Weights {
	private double[] weights;
	private double logp;
	private double depnn;

	public Weights() {
	}

	public Weights(String weightsFile, int numFeatures) throws IOException {
		this.weights = new double[numFeatures];

		if (!weightsFile.equals("zero")) {
			readWeights(weightsFile);
		}
	}

	public void setWeights(double[] weights) {
		this.weights = weights.clone();
	}

	private void readWeights(String weightsFile) throws IOException {
		int ID = 0;

		try ( BufferedReader in = new BufferedReader(new FileReader(weightsFile)) ) {

// Path: src/io/Preface.java
// public class Preface {
// 	public static void readPreface(BufferedReader in) throws IOException {
// 		String line = in.readLine();
// 
// 		if (line == null || line.charAt(0) != '#') {
// 			throw new IllegalArgumentException("File does not start with the mandatory preface.");
// 		}
// 
// 		while ((line = in.readLine()) != null) {
// 			if (line.isEmpty()) {
// 				break;
// 			}
// 			if (line.charAt(0) != '#') {
// 				throw new IllegalArgumentException("Uncommented line within preface.");
// 			}
// 		}
// 	}
// 
// 	public static void printPreface(PrintWriter out) {
// 		out.println("# mandatory preface");
// 		out.println("# mandatory preface");
// 		out.println();
// 	}
// }


// Path: src/model/Weights.java
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import io.Preface;

package model;



public class Weights {
	private double[] weights;
	private double logp;
	private double depnn;

	public Weights() {
	}

	public Weights(String weightsFile, int numFeatures) throws IOException {
		this.weights = new double[numFeatures];

		if (!weightsFile.equals("zero")) {
			readWeights(weightsFile);
		}
	}

	public void setWeights(double[] weights) {
		this.weights = weights.clone();
	}

	private void readWeights(String weightsFile) throws IOException {
		int ID = 0;

		try ( BufferedReader in = new BufferedReader(new FileReader(weightsFile)) ) {

			Preface.readPreface(in);