// Path: src/main/scala/com/stefansavev/similaritysearch/implementation/VectorTypes.java
// public class VectorTypes {
//     public static VectorType uncorrelatedFeatures(int dimension, VectorType.StorageSize storageSize){
//         return new VectorType.UncorrelatedFeatures(dimension, storageSize);
//     }
// }


import com.stefansavev.randomprojections.actors.Application;
import com.stefansavev.similaritysearch.*;
import com.stefansavev.similaritysearch.implementation.VectorTypes;
import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.Iterator;
import java.util.List;
import java.util.Random;
package com.stefansavev.fuzzysearchtest;



public class GloveTest {
    static SimilaritySearchItem parseItem(int lineNumber, String line, int numDimensions) {
        String[] parts = line.split("\\s+");
        if (parts.length != (1 + numDimensions)) {
            throw new IllegalStateException("Invalid data format. Expecting data of dimension " + numDimensions + " such as: 'the 0.020341 0.011216 0.099383 0.102027 0.041391 -0.010218 ");
        }
        String word = parts[0];
        double[] vec = new double[numDimensions];
        for (int i = 0; i < numDimensions; i++) {
            vec[i] = Double.parseDouble(parts[i + 1]);
        }
        return new SimilaritySearchItem(word, -1, vec); //ignore the label
    }

    static void buildIndex(String inputFile, String outputIndexFile, int numTrees) throws IOException, InvalidDataPointException {
        int dataDimension = 100;

        //create an indexer
        SimilaritySearchIndexBuilder indexBuilder = new SimilaritySearchIndexBuilder(outputIndexFile,
// Path: src/main/scala/com/stefansavev/similaritysearch/implementation/VectorTypes.java
// public class VectorTypes {
//     public static VectorType uncorrelatedFeatures(int dimension, VectorType.StorageSize storageSize){
//         return new VectorType.UncorrelatedFeatures(dimension, storageSize);
//     }
// }


// Path: src/test/scala/com/stefansavev/fuzzysearchtest/GloveTest.java
import com.stefansavev.randomprojections.actors.Application;
import com.stefansavev.similaritysearch.*;
import com.stefansavev.similaritysearch.implementation.VectorTypes;
import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.Iterator;
import java.util.List;
import java.util.Random;

package com.stefansavev.fuzzysearchtest;



public class GloveTest {
    static SimilaritySearchItem parseItem(int lineNumber, String line, int numDimensions) {
        String[] parts = line.split("\\s+");
        if (parts.length != (1 + numDimensions)) {
            throw new IllegalStateException("Invalid data format. Expecting data of dimension " + numDimensions + " such as: 'the 0.020341 0.011216 0.099383 0.102027 0.041391 -0.010218 ");
        }
        String word = parts[0];
        double[] vec = new double[numDimensions];
        for (int i = 0; i < numDimensions; i++) {
            vec[i] = Double.parseDouble(parts[i + 1]);
        }
        return new SimilaritySearchItem(word, -1, vec); //ignore the label
    }

    static void buildIndex(String inputFile, String outputIndexFile, int numTrees) throws IOException, InvalidDataPointException {
        int dataDimension = 100;

        //create an indexer
        SimilaritySearchIndexBuilder indexBuilder = new SimilaritySearchIndexBuilder(outputIndexFile,
                VectorTypes.uncorrelatedFeatures(dataDimension, VectorType.StorageSize.Double),