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)
209Cache = new StringSpanOrdinalKeyCache<Word>(); 751internal StringSpanOrdinalKeyCache<Word>? Cache { get; } 820internal Word MergeWord(ReadOnlySpan<char> w, ref PriorityQueue<Merge>? priorityQueue) 822Word word = Word.WithCapacity(w.Length); 935internal void WordToTokens(ref Word word, List<EncodedToken> tokens, int offset) => word.ToTokens(VocabReverse, tokens, offset); 939Word word; 963internal int WordToIds(ref Word word, IList<int>? accumulatedIds, out int charsConsumed, int fullTextLength, int maxTokens) 984internal int WordToIdsFromEnd(ref Word word, IList<int>? accumulatedIds, out int textIndex, int fullTextLength, int maxTokens) 1007Word word; 1011if (Cache.TryGetValue(text, out Word hit)) 1033Word word; 1037if (Cache.TryGetValue(text, out Word hit))
Model\Word.cs (1)
28public static Word WithCapacity(int capacity) => new Word(capacity);