// Path: src/main/java/uk/ac/shef/dcs/oak/jate/JATEException.java
// public class JATEException extends Exception {
// 	private static final long serialVersionUID = -4511571544868986419L;
// 
// 	public JATEException(String exception){
// 		super(exception);
// 	}
// 
// 	public JATEException(Exception e){
// 		super(e);
// 	}
// 
// 	public JATEException(String exception, Throwable cause){
// 		super(exception, cause);
// 	}
// }


import uk.ac.shef.dcs.oak.jate.core.feature.indexer.GlobalIndex;
import uk.ac.shef.dcs.oak.jate.JATEException;
import org.apache.log4j.Logger;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;

package uk.ac.shef.dcs.oak.jate.core.feature;




/**
 * A specific type of feature builder that builds an instance of FeatureRefCorpusTermFrequency. This is a dummy class
 * which reads the data from a text file which stores information as:
 * <br> [freq_in_corpus]      [term]
 *
 * @author <a href="mailto:z.zhang@dcs.shef.ac.uk">Ziqi Zhang</a>
 */



public class FeatureBuilderRefCorpusTermFrequency extends AbstractFeatureBuilder {

	private static final Logger _logger = Logger.getLogger(FeatureBuilderRefCorpusTermFrequency.class);

	private final String _refStatsPath;

	/**
	 * Default constructor
	 * @param refStatsPath file path to the reference corpus statistics file. The file should store one term on a line, and in the format of:
	 * <br>[freq_in_ref_corpus]   [term]
	 * <br> Any terms with frequency < 2 will be ignored.
	 */
	public FeatureBuilderRefCorpusTermFrequency(String refStatsPath) {
		super(null, null, null);
		_refStatsPath=refStatsPath;
	}


	/**
	 * Dummy method which does nothing with the GlobalIndexMem instance but load statistics and creates
	 * and instance of FeatureRefCorpusTermFrequency from the file
	 * specified in the constructor
	 * @param nullValue can be either an instance or null value
	 * @return
	 * @throws uk.ac.shef.dcs.oak.jate.JATEException
	 */

// Path: src/main/java/uk/ac/shef/dcs/oak/jate/JATEException.java
// public class JATEException extends Exception {
// 	private static final long serialVersionUID = -4511571544868986419L;
// 
// 	public JATEException(String exception){
// 		super(exception);
// 	}
// 
// 	public JATEException(Exception e){
// 		super(e);
// 	}
// 
// 	public JATEException(String exception, Throwable cause){
// 		super(exception, cause);
// 	}
// }


// Path: src/main/java/uk/ac/shef/dcs/oak/jate/core/feature/FeatureBuilderRefCorpusTermFrequency.java
import uk.ac.shef.dcs.oak.jate.core.feature.indexer.GlobalIndex;
import uk.ac.shef.dcs.oak.jate.JATEException;
import org.apache.log4j.Logger;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;

package uk.ac.shef.dcs.oak.jate.core.feature;




/**
 * A specific type of feature builder that builds an instance of FeatureRefCorpusTermFrequency. This is a dummy class
 * which reads the data from a text file which stores information as:
 * <br> [freq_in_corpus]      [term]
 *
 * @author <a href="mailto:z.zhang@dcs.shef.ac.uk">Ziqi Zhang</a>
 */



public class FeatureBuilderRefCorpusTermFrequency extends AbstractFeatureBuilder {

	private static final Logger _logger = Logger.getLogger(FeatureBuilderRefCorpusTermFrequency.class);

	private final String _refStatsPath;

	/**
	 * Default constructor
	 * @param refStatsPath file path to the reference corpus statistics file. The file should store one term on a line, and in the format of:
	 * <br>[freq_in_ref_corpus]   [term]
	 * <br> Any terms with frequency < 2 will be ignored.
	 */
	public FeatureBuilderRefCorpusTermFrequency(String refStatsPath) {
		super(null, null, null);
		_refStatsPath=refStatsPath;
	}


	/**
	 * Dummy method which does nothing with the GlobalIndexMem instance but load statistics and creates
	 * and instance of FeatureRefCorpusTermFrequency from the file
	 * specified in the constructor
	 * @param nullValue can be either an instance or null value
	 * @return
	 * @throws uk.ac.shef.dcs.oak.jate.JATEException
	 */

	public FeatureRefCorpusTermFrequency build(GlobalIndex nullValue) throws JATEException {
