// Path: src/main/java/uk/ac/shef/dcs/oak/jate/model/NCTermwithOriginals.java
// public class NCTermwithOriginals extends Term { //implements Comparable<Term> {
// 
// 	Set<String> _originals;
// 
// 	/**
// 	 * Creates a term
// 	 * @param lemma the lemmatised text of the term
// 	 * @param confidence the relevance of the term to the corpus from which it is extracted
// 	 */
// 	public NCTermwithOriginals(java.lang.String lemma, Set<String> originals, double confidence) {
// 		super(lemma, confidence);
// 		_originals.addAll(originals);
// 	}
// 
// 	public java.lang.String getConcept() {
// 		return _singular;
// 	}
// 
// 	public double getConfidence() {
// 		return _confidence;
// 	}
// 
// 	public void setConcept(java.lang.String singular){
// 		_singular = singular;
// 	}
// 	public void setConfidence(double c){
// 		_confidence=c;
// 	}
// 	
// 	public void setOriginals(Set<String> originals){
// 		_originals=originals;
// 	}
// 	public Set<String> getOriginals(){
// 		return _originals;
// 	}
// 
// 	public boolean equals(Object o) {
// 		if (this == o) return true;
// 		if (o == null || getClass() != o.getClass()) return false;
// 		final Term that = (Term) o;
// 
// 		return that.getConcept().equals(getConcept()) || that.getConcept().equals(getConcept());
// 
// 	}
// 
// 	public int hashCode(){
// 		return getConcept().hashCode();
// 	}
// 
// 	public int compareTo(final Term c) {
//       return getConfidence() > c.getConfidence() ? -1 : getConfidence() < c.getConfidence() ? 1 : 0;
//    }
// }


import java.io.BufferedReader;
import java.io.DataInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.HashSet;
import java.util.Set;
import org.apache.log4j.Logger;
import uk.ac.shef.dcs.oak.jate.model.NCTermwithOriginals;
import uk.ac.shef.dcs.oak.jate.model.Term;
package uk.ac.shef.dcs.oak.jate.io;



public class NCValueIO{
	private static final Logger _logger = Logger.getLogger(NCValueIO.class);

	public static boolean OutputFileExists(String fname, String path)
	 {
		// int indx = path.lastIndexOf( File.separator );
		 
		 File directory = new File( path );
		 boolean found = false;
		 File[] files = directory.listFiles();
		 if ( files == null ) {
			 return false;
		 }
		 for( File f : files)
		 {
		    if( f.getName().equals( fname ) )
		    {
		        found = true;
		        break;
		    }
		 } 
		 return found;
	 }
	
	public static Term[] readFile(String filename)
	{
// Path: src/main/java/uk/ac/shef/dcs/oak/jate/model/NCTermwithOriginals.java
// public class NCTermwithOriginals extends Term { //implements Comparable<Term> {
// 
// 	Set<String> _originals;
// 
// 	/**
// 	 * Creates a term
// 	 * @param lemma the lemmatised text of the term
// 	 * @param confidence the relevance of the term to the corpus from which it is extracted
// 	 */
// 	public NCTermwithOriginals(java.lang.String lemma, Set<String> originals, double confidence) {
// 		super(lemma, confidence);
// 		_originals.addAll(originals);
// 	}
// 
// 	public java.lang.String getConcept() {
// 		return _singular;
// 	}
// 
// 	public double getConfidence() {
// 		return _confidence;
// 	}
// 
// 	public void setConcept(java.lang.String singular){
// 		_singular = singular;
// 	}
// 	public void setConfidence(double c){
// 		_confidence=c;
// 	}
// 	
// 	public void setOriginals(Set<String> originals){
// 		_originals=originals;
// 	}
// 	public Set<String> getOriginals(){
// 		return _originals;
// 	}
// 
// 	public boolean equals(Object o) {
// 		if (this == o) return true;
// 		if (o == null || getClass() != o.getClass()) return false;
// 		final Term that = (Term) o;
// 
// 		return that.getConcept().equals(getConcept()) || that.getConcept().equals(getConcept());
// 
// 	}
// 
// 	public int hashCode(){
// 		return getConcept().hashCode();
// 	}
// 
// 	public int compareTo(final Term c) {
//       return getConfidence() > c.getConfidence() ? -1 : getConfidence() < c.getConfidence() ? 1 : 0;
//    }
// }


// Path: src/main/java/uk/ac/shef/dcs/oak/jate/io/NCValueIO.java
import java.io.BufferedReader;
import java.io.DataInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.HashSet;
import java.util.Set;
import org.apache.log4j.Logger;
import uk.ac.shef.dcs.oak.jate.model.NCTermwithOriginals;
import uk.ac.shef.dcs.oak.jate.model.Term;

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



public class NCValueIO{
	private static final Logger _logger = Logger.getLogger(NCValueIO.class);

	public static boolean OutputFileExists(String fname, String path)
	 {
		// int indx = path.lastIndexOf( File.separator );
		 
		 File directory = new File( path );
		 boolean found = false;
		 File[] files = directory.listFiles();
		 if ( files == null ) {
			 return false;
		 }
		 for( File f : files)
		 {
		    if( f.getName().equals( fname ) )
		    {
		        found = true;
		        break;
		    }
		 } 
		 return found;
	 }
	
	public static Term[] readFile(String filename)
	{
		Set<NCTermwithOriginals> result = new HashSet<NCTermwithOriginals>();