예제 #1
0
        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));
            }
        }
예제 #2
0
        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);
        }
예제 #3
0
        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);
        }