Пример #1
0
        public NgramBufferBuilder(int ngramLength, int skipLength, int slotLim, NgramIdFinder finder)
        {
            Contracts.Assert(ngramLength > 0);
            Contracts.Assert(skipLength >= 0);
            Contracts.Assert(ngramLength <= MaxSkipNgramLength - skipLength);
            Contracts.Assert(slotLim >= 0);

            _ngramLength = ngramLength;
            _skipLength  = skipLength;
            _slotLim     = slotLim;

            _ngram = new uint[_ngramLength];
            _queue = new FixedSizeQueue <uint>(_ngramLength + _skipLength);
            _bldr  = BufferBuilder <float> .CreateDefault();

            _finder = finder;
        }