ITextSplitterService

Wisej.AI.Services.ITextSplitterService

Namespace: Wisej.AI.Services

Assembly: Wisej.AI (3.5.0.0)

Represents a service for splitting text into an array of substrings.

public interface ITextSplitterService

This interface defines a contract for text splitting services. The primary function is to take a single piece of text and split it into an array of substrings based on a specific implementation-defined criterion. Implementations of this interface may use different strategies for splitting, such as splitting by spaces, punctuation, or custom delimiters.

Methods

Split(text)

Splits the specified text into an array of substrings.

Parameter
Type
Description

text

The text to split into substrings. This parameter should not be null or empty.

Returns: String[]. An array of substrings derived from the text .

This method processes the input text according to the splitting logic defined by the implementation. The result is an array where each element is a substring of the original text. Example usage:


  ITextSplitterService splitterService = new SimpleTextSplitterService();
  string[] words = splitterService.Split("This is a sample text.");
  // words: ["This", "is", "a", "sample", "text."]

Implemented By

Name
Description

A service for recursively splitting text into chunks based on specified separators and chunk size constraints. This service attempts to split text by different characters to find an optimal separation strategy.

Provides the base functionality for text splitting services, allowing subclasses to define custom splitting logic.

Last updated