@Override
	public void saveXml(Writer fwrite) throws IOException {
		StringBuilder buf = new StringBuilder();
		buf.append("<lshcosine>\n");
		fwrite.append(buf.toString());
		// The length is not stored as part of XML
		for (int i = 0; i < hash.length; ++i) {
			hash[i].saveXml(fwrite);
		}
		fwrite.append("</lshcosine>\n");
	}
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