// 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.JATEException;
import uk.ac.shef.dcs.oak.jate.core.feature.indexer.GlobalIndex;
import uk.ac.shef.dcs.oak.jate.model.Term;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Set;

package uk.ac.shef.dcs.oak.jate.io;



/**
 * A helper class which outputs term recognition results
 *
 * @author <a href="mailto:z.zhang@dcs.shef.ac.uk">Ziqi Zhang</a>
 */


public class ResultWriter2File {

	private final GlobalIndex _index;

	/*modified code begins:RAKE*/
	
	public ResultWriter2File() {
		_index=null;
	}
	
	/*modified code ends:RAKE*/


	/**
	 * @param index an instance of GlobalIndexMem. The writer will read mapping data from term canonical from to variant
	 * forms and output the result
	 */
	public ResultWriter2File(GlobalIndex index) {
		this._index = index;
	}

	/**
	 * Output the result. This writes one term on a line in the format of:
	 * <p>
	 * canonical |variant1 |variant2 |variantX       confidence
	 * </p>
	 * @param result term recognition result sorted descendingly by confidence
	 * @param path output file path
	 * @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/io/ResultWriter2File.java
import uk.ac.shef.dcs.oak.jate.JATEException;
import uk.ac.shef.dcs.oak.jate.core.feature.indexer.GlobalIndex;
import uk.ac.shef.dcs.oak.jate.model.Term;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Set;

package uk.ac.shef.dcs.oak.jate.io;



/**
 * A helper class which outputs term recognition results
 *
 * @author <a href="mailto:z.zhang@dcs.shef.ac.uk">Ziqi Zhang</a>
 */


public class ResultWriter2File {

	private final GlobalIndex _index;

	/*modified code begins:RAKE*/
	
	public ResultWriter2File() {
		_index=null;
	}
	
	/*modified code ends:RAKE*/


	/**
	 * @param index an instance of GlobalIndexMem. The writer will read mapping data from term canonical from to variant
	 * forms and output the result
	 */
	public ResultWriter2File(GlobalIndex index) {
		this._index = index;
	}

	/**
	 * Output the result. This writes one term on a line in the format of:
	 * <p>
	 * canonical |variant1 |variant2 |variantX       confidence
	 * </p>
	 * @param result term recognition result sorted descendingly by confidence
	 * @param path output file path
	 * @throws uk.ac.shef.dcs.oak.jate.JATEException
	 */

	public void output(Term[] result, String path) throws JATEException {
