initial upload

This commit is contained in:
Fiedler
2025-09-24 13:27:39 +02:00
commit c721469c3b
2676 changed files with 787530 additions and 0 deletions

View File

@ -0,0 +1,23 @@
using System.Linq;
namespace Convai.Scripts.Runtime.Utils
{
/// <summary>
/// Utility for language features
/// </summary>
public abstract class ConvaiLanguageCheck
{
private const char MIN_ARABIC_RANGE = '\u0600';
private const char MAX_ARABIC_RANGE = '\u06FF';
/// <summary>
/// To check if the text is in a Right-to-Left(RTL) Language
/// </summary>
/// <param name="text">The text for RTL Check.</param>
/// <returns>Bool denoting the text is RTL or not</returns>
public static bool IsRTL(string text)
{
return text.Any(c => c is >= MIN_ARABIC_RANGE and <= MAX_ARABIC_RANGE);
}
}
}