1 instantiation of Word
Microsoft.ML.Tokenizers (1)
Model\Word.cs (1)
28public static Word WithCapacity(int capacity) => new Word(capacity);
14 references to Word
Microsoft.ML.Tokenizers (14)
Model\BpeTokenizer.cs (13)
343Cache = new StringSpanOrdinalKeyCache<Word>(); 1121internal StringSpanOrdinalKeyCache<Word>? Cache { get; } 1206internal Word MergeWord(ReadOnlySpan<char> w, ref PriorityQueue<Merge>? priorityQueue) 1208Word word = Word.WithCapacity(w.Length); 1321internal void WordToTokens(ref Word word, List<EncodedToken> tokens, int offset, ReadOnlySpan<int> mapping) => word.ToTokens(VocabReverse, tokens, offset, mapping); 1359Word word; 1390internal int WordToIds(ref Word word, IList<int>? accumulatedIds, out int charsConsumed, int fullTextLength, int maxTokens) 1411internal int WordToIdsFromEnd(ref Word word, IList<int>? accumulatedIds, out int textIndex, int fullTextLength, int maxTokens) 1441Word word; 1473if (Cache.TryGetValue(textSpan, out Word hit)) 1514Word word; 1553if (Cache.TryGetValue(textSpan, out Word hit))
Model\Word.cs (1)
28public static Word WithCapacity(int capacity) => new Word(capacity);