@Override
	public void restoreXml(XmlPullParser parser,WeightFactory wfactory,IDFLookup idflookup) {
		parser.start("lshcosine");
		ArrayList<HashEntry> hashlist = new ArrayList<HashEntry>();
		if (idflookup.empty()) {
			while (parser.peek().isStart()) {
				HashEntry entry = new HashEntry();
				hashlist.add(entry);
				entry.restoreXml(parser, wfactory);
			}
		}
		else {
			while (parser.peek().isStart()) {
				HashEntry entry = new HashEntry();
				hashlist.add(entry);
				entry.restoreXml(parser, wfactory, idflookup);
			}
		}
		parser.end();
		hash = new HashEntry[hashlist.size()];
		hashlist.toArray(hash);
		calcLength();// The length is not stored as part of XML
	}
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