Skip to main content

Search OfficeIMO

Enter a topic, API type, or PowerShell command.

Documentation Search all OfficeIMO/

API Reference

Class

ReaderDelegateTokenCounter

Namespace OfficeIMO.Reader
Assembly OfficeIMO.Reader.Core
Modifiers sealed

Connects an application-owned tokenizer to Reader without adding a tokenizer package to its runtime graph.

Inheritance

  • Object
  • ReaderDelegateTokenCounter

Remarks

Delegates must be deterministic, thread-safe and return non-negative counts. Include the tokenizer model or vocabulary version in the identifier so chunking evidence identifies the actual counting contract.

Constructors

public ReaderDelegateTokenCounter(String id, Func<String, Int32> count, Func<String, String, Int32, Int32, Int32> countRange = null) #

Creates a tokenizer bridge with an optional allocation-free range callback.

Parameters

id System.String requiredposition: 0
count System.Func{System.String,System.Int32} requiredposition: 1
countRange System.Func{System.String,System.String,System.Int32,System.Int32,System.Int32} = null optionalposition: 2

Methods

CountTokens 2 overloads
public virtual Int32 CountTokens(String text) #
Returns: Int32

Parameters

text System.String requiredposition: 0
public virtual Int32 CountTokens(String prefix, String source, Int32 start, Int32 length) #
Returns: Int32

Parameters

prefix System.String requiredposition: 0
source System.String requiredposition: 1
start System.Int32 requiredposition: 2
length System.Int32 requiredposition: 3

Properties