// 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
// 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 {
// 		FeatureRefCorpusTermFrequency _feature = new FeatureRefCorpusTermFrequency();
// 
// 		BufferedReader reader = null;
// 		try{
// 			reader = new BufferedReader(new FileReader(_refStatsPath));
// 			String line;
// 			while ((line = reader.readLine()) != null) {
// 				line = line.trim();
// 				String[] elements = line.split("\\s+");
// 				if(Integer.valueOf(elements[0])<2) continue;
// 				_feature.addToTermFreq(elements[1].trim(), Integer.valueOf(elements[0]));
// 			}
// 
// 		}
// 		catch ( Exception e ) {
// 			throw new JATEException( "Error processing file", e );
// 		}
// 		finally {
// 			if ( reader != null ) {
// 				try {
// 					reader.close();
// 				} catch ( IOException ioe ) {
// 					_logger.error( "I/O Exception closing file; ignoring", ioe );
// 				}
// 			}
// 		}
// 
// 		return _feature;
// 	}
// }


import uk.ac.shef.dcs.oak.jate.JATEException;
import uk.ac.shef.dcs.oak.jate.core.feature.FeatureBuilderRefCorpusTermFrequency;
import uk.ac.shef.dcs.oak.jate.model.Term;
import java.util.*;
import java.io.*;
import org.apache.log4j.Logger;

				String[] elements = line.split("\\\\|");
				//if (elements.length < 2) continue;
				result.add(new Term(elements[0],0));
				//result.add(new Term(elements[0], Double.valueOf(elements[1])));
			}
		}
		catch ( Exception e ) {
			_logger.error( "Error processing " + path + "; silently ignoring", e );
		}
		finally {
			if ( reader != null ) {
				try {
					reader.close();
				} catch ( IOException ioe ) {
					_logger.error( "I/O Exception closing file; ignoring", ioe );
				}
			}
		}
		Collections.sort(result);

		return result;
	}

	/**
	 * Produce the voting result
	 *
	 * @param outputs
	 * @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
// 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 {
// 		FeatureRefCorpusTermFrequency _feature = new FeatureRefCorpusTermFrequency();
// 
// 		BufferedReader reader = null;
// 		try{
// 			reader = new BufferedReader(new FileReader(_refStatsPath));
// 			String line;
// 			while ((line = reader.readLine()) != null) {
// 				line = line.trim();
// 				String[] elements = line.split("\\s+");
// 				if(Integer.valueOf(elements[0])<2) continue;
// 				_feature.addToTermFreq(elements[1].trim(), Integer.valueOf(elements[0]));
// 			}
// 
// 		}
// 		catch ( Exception e ) {
// 			throw new JATEException( "Error processing file", e );
// 		}
// 		finally {
// 			if ( reader != null ) {
// 				try {
// 					reader.close();
// 				} catch ( IOException ioe ) {
// 					_logger.error( "I/O Exception closing file; ignoring", ioe );
// 				}
// 			}
// 		}
// 
// 		return _feature;
// 	}
// }


// Path: src/main/java/uk/ac/shef/dcs/oak/jate/core/voting/Voting.java
import uk.ac.shef.dcs.oak.jate.JATEException;
import uk.ac.shef.dcs.oak.jate.core.feature.FeatureBuilderRefCorpusTermFrequency;
import uk.ac.shef.dcs.oak.jate.model.Term;
import java.util.*;
import java.io.*;
import org.apache.log4j.Logger;

				String[] elements = line.split("\\\\|");
				//if (elements.length < 2) continue;
				result.add(new Term(elements[0],0));
				//result.add(new Term(elements[0], Double.valueOf(elements[1])));
			}
		}
		catch ( Exception e ) {
			_logger.error( "Error processing " + path + "; silently ignoring", e );
		}
		finally {
			if ( reader != null ) {
				try {
					reader.close();
				} catch ( IOException ioe ) {
					_logger.error( "I/O Exception closing file; ignoring", ioe );
				}
			}
		}
		Collections.sort(result);

		return result;
	}

	/**
	 * Produce the voting result
	 *
	 * @param outputs
	 * @return
	 * @throws uk.ac.shef.dcs.oak.jate.JATEException
	 */

	public List<Term> calculate(WeightedOutput... outputs) throws JATEException {
