<commit_before>using Uno;
using Uno.Compiler.ExportTargetInterop;

namespace Fuse.Text.Implementation
{
	[extern(HOST_MAC && (PInvoke || NATIVE)) Require("LinkLibrary", "icucore")]
	[extern(HOST_MAC && (PInvoke || iOS || NATIVE)) Require("IncludeDirectory", "@('../icu/i18n':Path)")]
	[extern(HOST_MAC && (PInvoke || iOS || NATIVE)) Require("IncludeDirectory", "@('../icu/common':Path)")]
	[extern(iOS) Require("LinkLibrary", "icuuc")]
	[extern(iOS) Require("LinkLibrary", "icudata")]
	[extern(iOS) Require("LinkDirectory", "@('../icu/iOS/':Path)")]
	[extern(HOST_WINDOWS && (PInvoke || NATIVE)) Require("LinkLibrary", "icudt")]
	[extern(HOST_WINDOWS && (PInvoke || NATIVE)) Require("LinkLibrary", "icuin")]
	[extern(HOST_WINDOWS && (PInvoke || NATIVE)) Require("LinkLibrary", "icuio")]
	[extern(HOST_WINDOWS && (PInvoke || NATIVE)) Require("LinkLibrary", "icule")]
	[extern(HOST_WINDOWS && (PInvoke || NATIVE)) Require("LinkLibrary", "iculx")]
	[extern(HOST_WINDOWS && (PInvoke || NATIVE)) Require("LinkLibrary", "icutu")]
	[extern(HOST_WINDOWS && (PInvoke || NATIVE)) Require("LinkLibrary", "icuuc")]
	[extern(HOST_WINDOWS && (PInvoke || NATIVE)) Require("IncludeDirectory", "@('../icu/x64/include':Path)")]
	[extern(HOST_WINDOWS && (PInvoke || NATIVE)) Require("LinkDirectory","@('../icu/x64/lib64':Path)")]
	[extern(CPlusPlus || PInvoke) Require("Source.Include", "unicode/utypes.h")]
	static extern(USE_ICU) class ICU
	{
		public enum ErrorCode : int { }

		public static void CheckError(ErrorCode errorCode)
		{
			if (IsFailure(errorCode) != 0)
			{
				throw new Exception("UBiDi error: " + CString.ToString(ErrorCString(errorCode)));
			}
		}

		// Return `int` because `bool` marshalling in .NET is... weird
		[Foreign(Language.CPlusPlus)]<commit_msg>Fuse.Text: link ICU on Linux<commit_after>using Uno;
using Uno.Compiler.ExportTargetInterop;

namespace Fuse.Text.Implementation
{
	[extern(LINUX) Require("LinkLibrary", "icuuc")]
	[extern(LINUX) Require("LinkLibrary", "icudata")]
	[extern(HOST_MAC && (PInvoke || NATIVE)) Require("LinkLibrary", "icucore")]
	[extern(HOST_MAC && (PInvoke || iOS || NATIVE)) Require("IncludeDirectory", "@('../icu/i18n':Path)")]
	[extern(HOST_MAC && (PInvoke || iOS || NATIVE)) Require("IncludeDirectory", "@('../icu/common':Path)")]
	[extern(iOS) Require("LinkLibrary", "icuuc")]
	[extern(iOS) Require("LinkLibrary", "icudata")]
	[extern(iOS) Require("LinkDirectory", "@('../icu/iOS/':Path)")]
	[extern(HOST_WINDOWS && (PInvoke || NATIVE)) Require("LinkLibrary", "icudt")]
	[extern(HOST_WINDOWS && (PInvoke || NATIVE)) Require("LinkLibrary", "icuin")]
	[extern(HOST_WINDOWS && (PInvoke || NATIVE)) Require("LinkLibrary", "icuio")]
	[extern(HOST_WINDOWS && (PInvoke || NATIVE)) Require("LinkLibrary", "icule")]
	[extern(HOST_WINDOWS && (PInvoke || NATIVE)) Require("LinkLibrary", "iculx")]
	[extern(HOST_WINDOWS && (PInvoke || NATIVE)) Require("LinkLibrary", "icutu")]
	[extern(HOST_WINDOWS && (PInvoke || NATIVE)) Require("LinkLibrary", "icuuc")]
	[extern(HOST_WINDOWS && (PInvoke || NATIVE)) Require("IncludeDirectory", "@('../icu/x64/include':Path)")]
	[extern(HOST_WINDOWS && (PInvoke || NATIVE)) Require("LinkDirectory","@('../icu/x64/lib64':Path)")]
	[extern(CPlusPlus || PInvoke) Require("Source.Include", "unicode/utypes.h")]
	static extern(USE_ICU) class ICU
	{
		public enum ErrorCode : int { }

		public static void CheckError(ErrorCode errorCode)
		{
			if (IsFailure(errorCode) != 0)
			{
				throw new Exception("UBiDi error: " + CString.ToString(ErrorCString(errorCode)));
			}
		}

		// Return `int` because `bool` marshalling in .NET is... weird
		[Foreign(Language.CPlusPlus)]
{'fraction_non_alphanumeric': 0.2073137200989827, 'fraction_numerical': 0.004949133901567226, 'mean_word_length': 6.547717842323651, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '116487', 'n_tokens_mistral': 1360, 'n_tokens_neox': 1230, 'n_words': 231}