@Override
	public void restoreSQL(String sql,WeightFactory wfactory,IDFLookup idflookup) throws IOException {
		ArrayList<HashEntry> hashlist = new ArrayList<HashEntry>();
		char tok;
		int start;
		if (sql.length() < 2) {
			throw new IOException("Empty lshvector SQL");
		}
		if (sql.charAt(0) != '(') {
			throw new IOException("Missing '(' while parsing lshvector SQL");
		}
		start = 1;
		tok = sql.charAt(1);
		if (tok != ')') {
			do {
				HashEntry entry = new HashEntry();
				hashlist.add(entry);
				start = entry.restoreSQL(sql, start, wfactory, idflookup);
				tok = sql.charAt(start);
				start += 1;
			}
			while (tok == ',');
		}
		if (tok != ')') {
			throw new IOException("Missing ')' while parsing lshvector SQL");
		}
		hash = new HashEntry[hashlist.size()];
		hashlist.toArray(hash);
		calcLength();
	}
Assuming -feature- is sorted and -hash- is empty, count the features and populate -hash- and -tf-
For every unique feature, look up its idf via -idflookup-
@param feature is the list of sorted hash features
@param wfactory is the WeightFactory used to decide feature weights
@param idflookup is the IDFLookup used to decide relative frequency of individual features
Ghidra/Framework/Generic/src/main/java/generic/lsh/vector/LSHCosineVector.java