TextUtility.SplitWords Method
- Namespace
- Kampute.DocToolkit.Support
- Assembly
- Kampute.DocToolkit.dll
Definition
Enumerates word boundaries in the given text, identifying words separated by non-alphanumeric characters or case changes, and provides information about whether each word is an acronym.
public static IEnumerable<ValueTuple<Range, bool>> SplitWords(string text)Parameters
textstring- The text to analyze.
Returns
- IEnumerable<ValueTuple<Range, bool>>
- An enumerable of tuples containing the word range and whether the word is an acronym.

- Non-alphanumeric characters (spaces, punctuation, symbols)
- Case transitions (e.g., PascalCase becomes "Pascal", "Case")
- Acronym boundaries (e.g., XMLDocument becomes "XML", "Document")
The non-alphanumeric characters are not included in the ranges, only the alphanumeric parts that form words. Acronyms are identified as sequences of uppercase letters.This method is implemented by using deferred execution. The immediate return value is an object that stores all the information that is required to perform the action.