// Path: src/main/java/unsw/curation/api/domain/ExtractNumberSimilarity.java
// public class ExtractNumberSimilarity {
// 
// 	private String vector1;
// 	private String vector2;
// 	private double score;
// 	
// 	public ExtractNumberSimilarity(){}
// 	
// 	public ExtractNumberSimilarity(String vector1,String vector2,double score)
// 	{
// 		this.vector1=vector1;
// 		this.vector2=vector2;
// 		this.score=score;
// 	}
// 	
// 	public void setVector1(String vector1)
// 	{
// 		this.vector1=vector1;
// 	}
// 	public String getVector1()
// 	{
// 		return this.vector1;
// 	}
// 	
// 	public void setVecor2(String vector2)
// 	{
// 		this.vector2=vector2;
// 	}
// 	public String getVector2()
// 	{
// 		return this.vector2;
// 	}
// 	public void setScore(double score)
// 	{
// 		this.score=score;
// 	}
// 	public double getScore()
// 	{
// 		return this.score;
// 	}
// }
// 
// Path: src/main/java/unsw/curation/api/domain/abstraction/INumberJaccardSimilarity.java
// public interface INumberJaccardSimilarity {
// 
// 	double Jaccard_Vector_Vector(double [] number1,double [] number2);
// 	List<ExtractNumberSimilarity> Jaccard_Vector_VectorS(String filePath) throws IOException;
// 	List<ExtractNumberSimilarity> Jaccard_Vector_VectorS(Double [] vector,String filePath) throws IOException;
// }


import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashSet;
import java.util.List;
import java.util.stream.Collectors;
import unsw.curation.api.domain.ExtractNumberSimilarity;
import unsw.curation.api.domain.abstraction.INumberJaccardSimilarity;

          Collections.sort(lstValues,new MyJaccardCoefficientComp());
            lstValues=lstValues.stream().limit(10).collect(Collectors.toList());
            lstTopRecords.addAll(lstValues);
            lstValues.clear();
        }
        return lstTopRecords;
	}

	@Override
	public List<ExtractNumberSimilarity> Jaccard_Vector_VectorS(Double[] vector, String filePath) throws IOException {
		List<ExtractNumberSimilarity> lstValues=new ArrayList<>();
        List<String[]> lstarr=ReadData(filePath);
        for(String [] arrItem:lstarr)
        {
           HashSet<Double> lstUniqueItems=new HashSet<>();
           HashSet<Double> lstIntersect=new HashSet<>();
            for(String arrIt: arrItem)
            {
                lstUniqueItems.add(Double.parseDouble(arrIt));
                lstIntersect.add(Double.parseDouble(arrIt));
            }
            lstUniqueItems.addAll(Arrays.asList(vector));
            lstIntersect.retainAll(Arrays.asList(vector));
            double intersectSize=lstIntersect.size();
            double uniqueSize=lstUniqueItems.size();
            double JaccardSimlarity=intersectSize/uniqueSize;
                lstValues.add(new ExtractNumberSimilarity(Arrays.toString(arrItem),Arrays.toString(vector)
                        ,JaccardSimlarity));
        }
        Collections.sort(lstValues,new MyJaccardCoefficientComp());

// Path: src/main/java/unsw/curation/api/domain/ExtractNumberSimilarity.java
// public class ExtractNumberSimilarity {
// 
// 	private String vector1;
// 	private String vector2;
// 	private double score;
// 	
// 	public ExtractNumberSimilarity(){}
// 	
// 	public ExtractNumberSimilarity(String vector1,String vector2,double score)
// 	{
// 		this.vector1=vector1;
// 		this.vector2=vector2;
// 		this.score=score;
// 	}
// 	
// 	public void setVector1(String vector1)
// 	{
// 		this.vector1=vector1;
// 	}
// 	public String getVector1()
// 	{
// 		return this.vector1;
// 	}
// 	
// 	public void setVecor2(String vector2)
// 	{
// 		this.vector2=vector2;
// 	}
// 	public String getVector2()
// 	{
// 		return this.vector2;
// 	}
// 	public void setScore(double score)
// 	{
// 		this.score=score;
// 	}
// 	public double getScore()
// 	{
// 		return this.score;
// 	}
// }
// 
// Path: src/main/java/unsw/curation/api/domain/abstraction/INumberJaccardSimilarity.java
// public interface INumberJaccardSimilarity {
// 
// 	double Jaccard_Vector_Vector(double [] number1,double [] number2);
// 	List<ExtractNumberSimilarity> Jaccard_Vector_VectorS(String filePath) throws IOException;
// 	List<ExtractNumberSimilarity> Jaccard_Vector_VectorS(Double [] vector,String filePath) throws IOException;
// }


// Path: src/main/java/unsw/curation/api/extractsimilarity/ExtractNumberJaccardSimilarityImpl.java
import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashSet;
import java.util.List;
import java.util.stream.Collectors;
import unsw.curation.api.domain.ExtractNumberSimilarity;
import unsw.curation.api.domain.abstraction.INumberJaccardSimilarity;

          Collections.sort(lstValues,new MyJaccardCoefficientComp());
            lstValues=lstValues.stream().limit(10).collect(Collectors.toList());
            lstTopRecords.addAll(lstValues);
            lstValues.clear();
        }
        return lstTopRecords;
	}

	@Override
	public List<ExtractNumberSimilarity> Jaccard_Vector_VectorS(Double[] vector, String filePath) throws IOException {
		List<ExtractNumberSimilarity> lstValues=new ArrayList<>();
        List<String[]> lstarr=ReadData(filePath);
        for(String [] arrItem:lstarr)
        {
           HashSet<Double> lstUniqueItems=new HashSet<>();
           HashSet<Double> lstIntersect=new HashSet<>();
            for(String arrIt: arrItem)
            {
                lstUniqueItems.add(Double.parseDouble(arrIt));
                lstIntersect.add(Double.parseDouble(arrIt));
            }
            lstUniqueItems.addAll(Arrays.asList(vector));
            lstIntersect.retainAll(Arrays.asList(vector));
            double intersectSize=lstIntersect.size();
            double uniqueSize=lstUniqueItems.size();
            double JaccardSimlarity=intersectSize/uniqueSize;
                lstValues.add(new ExtractNumberSimilarity(Arrays.toString(arrItem),Arrays.toString(vector)
                        ,JaccardSimlarity));
        }
        Collections.sort(lstValues,new MyJaccardCoefficientComp());

        List<ExtractNumberSimilarity> lstTopRecords=lstValues.stream()
