public void Put(long docId, long keyId, IEnumerable <IVector> tokens) { var column = _index.GetOrAdd(keyId, key => new VectorNode()); foreach (var token in tokens) { _indexingStrategy.ExecutePut <T>(column, new VectorNode(token, docId)); } }
public void Put(long docId, long keyId, T value) { var vectors = _model.Tokenize(value); var column = _index.GetOrAdd(keyId, new VectorNode()); foreach (var vector in vectors) { _indexingStrategy.ExecutePut <T>(column, new VectorNode(vector, docId)); } var size = PathFinder.Size(column); }
public static VectorNode CreateTree <T>(this IModel <T> model, IIndexingStrategy indexingStrategy, params T[] data) { var root = new VectorNode(); foreach (var item in data) { foreach (var vector in model.Tokenize(item)) { indexingStrategy.ExecutePut <T>(root, new VectorNode(vector)); } } return(root); }