Added whole documents to the Translation, Grammar & Spelling, and Rewrite & Improve assistants (#1179)

Co-authored-by: Thorsten Sommer <SommerEngineering@users.noreply.github.com>
This commit is contained in:
Sabrina-devopsandThorsten Sommer authored and GitHub committed 2026-11-28 20:27:23 +01:00
1 parent f7666861f1
commit 918572c158
150 files changed
+12850 -302

No files matched your search

@@ -0,0 +1,27 @@
using System.Text;
namespace AIStudio.Tools.DocumentSegments;
/// <summary>
/// Tells whether words hold letters, i.e., whether a model has anything to work on.
/// </summary>
/// <remarks>
/// Letters count by Unicode scalar values rather than by chars: a letter beyond the Basic Multilingual Plane, e.g.,
/// of Adlam or a rare CJK character, takes two chars, neither of which is a letter on its own.
/// </remarks>
internal static class TextLetterExtensions
{
/// <param name="text">The words.</param>
extension(string text)
{
/// <summary>
/// Whether the words hold any letter.
/// </summary>
public bool HasLetters => text.EnumerateRunes().Any(Rune.IsLetter);
/// <summary>
/// How many letters the words hold.
/// </summary>
public int LetterCount => text.EnumerateRunes().Count(Rune.IsLetter);
}
}