From 1b43af61e17d7a06b90690952dfb7ac59a91ccd7 Mon Sep 17 00:00:00 2001 From: Haritha Mohan Date: Fri, 15 Sep 2023 20:08:25 -0700 Subject: [PATCH 1/7] [NaturalLanguage] Add support for Xcode 15 --- src/NaturalLanguage/Enums.cs | 86 +++++++++++++++++++ src/naturallanguage.cs | 83 ++++++++++++++++++ .../iOS-NaturalLanguage.todo | 57 ------------ .../macOS-NaturalLanguage.todo | 57 ------------ .../tvOS-NaturalLanguage.todo | 57 ------------ tests/xtro-sharpie/iOS-NaturalLanguage.todo | 57 ------------ tests/xtro-sharpie/macOS-NaturalLanguage.todo | 57 ------------ tests/xtro-sharpie/tvOS-NaturalLanguage.todo | 57 ------------ .../xtro-sharpie/watchOS-NaturalLanguage.todo | 57 ------------ 9 files changed, 169 insertions(+), 399 deletions(-) delete mode 100644 tests/xtro-sharpie/api-annotations-dotnet/iOS-NaturalLanguage.todo delete mode 100644 tests/xtro-sharpie/api-annotations-dotnet/macOS-NaturalLanguage.todo delete mode 100644 tests/xtro-sharpie/api-annotations-dotnet/tvOS-NaturalLanguage.todo delete mode 100644 tests/xtro-sharpie/iOS-NaturalLanguage.todo delete mode 100644 tests/xtro-sharpie/macOS-NaturalLanguage.todo delete mode 100644 tests/xtro-sharpie/tvOS-NaturalLanguage.todo delete mode 100644 tests/xtro-sharpie/watchOS-NaturalLanguage.todo diff --git a/src/NaturalLanguage/Enums.cs b/src/NaturalLanguage/Enums.cs index 90afcae6c7b9..ea359d08b491 100644 --- a/src/NaturalLanguage/Enums.cs +++ b/src/NaturalLanguage/Enums.cs @@ -216,4 +216,90 @@ public enum NLTagScheme { [Field ("NLTagSchemeSentimentScore")] SentimentScore, } + + [Watch(10, 0), TV(17, 0), Mac(14, 0), iOS(17, 0), MacCatalyst(17, 0)] + public enum NLScript { + [Field("NLScriptUndetermined")] + Undetermined, + [Field("NLScriptArabic")] + Arabic, + [Field("NLScriptArmenian")] + Armenian, + [Field("NLScriptBengali")] + Bengali, + [Field("NLScriptCanadianAboriginalSyllabics")] + CanadianAboriginalSyllabics, + [Field("NLScriptCherokee")] + Cherokee, + [Field("NLScriptCyrillic")] + Cyrillic, + [Field("NLScriptDevanagari")] + Devanagari, + [Field("NLScriptEthiopic")] + Ethiopic, + [Field("NLScriptGeorgian")] + Georgian, + [Field("NLScriptGreek")] + Greek, + [Field("NLScriptGujarati")] + Gujarati, + [Field("NLScriptGurmukhi")] + Gurmukhi, + [Field("NLScriptHebrew")] + Hebrew, + [Field("NLScriptJapanese")] + Japanese, + [Field("NLScriptKannada")] + Kannada, + [Field("NLScriptKhmer")] + Khmer, + [Field("NLScriptKorean")] + Korean, + [Field("NLScriptLao")] + Lao, + [Field("NLScriptLatin")] + Latin, + [Field("NLScriptMalayalam")] + Malayalam, + [Field("NLScriptMongolian")] + Mongolian, + [Field("NLScriptMyanmar")] + Myanmar, + [Field("NLScriptOriya")] + Oriya, + [Field("NLScriptSimplifiedChinese")] + SimplifiedChinese, + [Field("NLScriptSinhala")] + Sinhala, + [Field("NLScriptTamil")] + Tamil, + [Field("NLScriptTelugu")] + Telugu, + [Field("NLScriptThai")] + Thai, + [Field("NLScriptTibetan")] + Tibetan, + [Field("NLScriptTraditionalChinese")] + TraditionalChinese, + } + + [Watch(10, 0), TV(17, 0), Mac(14, 0), iOS(17, 0), MacCatalyst(17, 0)] + [Native] + public enum NLContextualEmbeddingAssetsResult : long + { + Available, + NotAvailable, + Error, + } + + [Watch(10, 0), TV(17, 0), Mac(14, 0), iOS(17, 0), MacCatalyst(17, 0)] + public enum NLContextualEmebeddingKey + { + [Field("NLContextualEmbeddingKeyLanguages")] + Languages, + [Field("NLContextualEmbeddingKeyScripts")] + Scripts, + [Field("NLContextualEmbeddingKeyRevision")] + Revision, + } } diff --git a/src/naturallanguage.cs b/src/naturallanguage.cs index 34f5cfe52098..bf55d7644ba0 100644 --- a/src/naturallanguage.cs +++ b/src/naturallanguage.cs @@ -651,4 +651,87 @@ interface NLGazetteer { [Wrap ("Write (dictionary.GetDictionary ()!, language.HasValue ? language.Value.GetConstant () : null, url, out error)")] bool Write (NLStrongDictionary dictionary, NLLanguage? language, NSUrl url, [NullAllowed] out NSError error); } + + [Watch(10, 0), TV(17, 0), Mac(14, 0), iOS(17, 0), MacCatalyst(17,0)] + [BaseType(typeof(NSObject))] + [DisableDefaultCtor] + interface NLContextualEmbedding + { + [Static] + [Export("contextualEmbeddingWithModelIdentifier:")] + [return: NullAllowed] + NLContextualEmbedding ContextualEmbeddingWithModelIdentifier(string modelIdentifier); + + [Static] + [Export("contextualEmbeddingsForValues:")] + NLContextualEmbedding[] ContextualEmbeddingsForValues(NSDictionary valuesDictionary); + + [Static] + [Export("contextualEmbeddingWithLanguage:")] + [return: NullAllowed] + NLContextualEmbedding ContextualEmbeddingWithLanguage(string language); + + [Static] + [Export("contextualEmbeddingWithScript:")] + [return: NullAllowed] + NLContextualEmbedding ContextualEmbeddingWithScript(string script); + + [Export("modelIdentifier")] + string ModelIdentifier { get; } + + [Export("languages", ArgumentSemantic.Copy)] + string[] Languages { get; } + + [Export("scripts", ArgumentSemantic.Copy)] + string[] Scripts { get; } + + [Export("revision")] + nuint Revision { get; } + + [Export("dimension")] + nuint Dimension { get; } + + [Export("maximumSequenceLength")] + nuint MaximumSequenceLength { get; } + + [Export("loadWithError:")] + bool Load([NullAllowed] out NSError error); + + [Export("unload")] + void Unload(); + + [Export("embeddingResultForString:language:error:")] + [return: NullAllowed] + NLContextualEmbeddingResult EmbeddingResult(string @string, [NullAllowed] string language, [NullAllowed] out NSError error); + + [Export("hasAvailableAssets")] + bool HasAvailableAssets { get; } + + [Export("requestEmbeddingAssetsWithCompletionHandler:")] + [Async] + void RequestAssets(Action completionHandler); + } + + [Watch(10, 0), TV(17, 0), Mac(14, 0), iOS(17, 0), MacCatalyst(17, 0)] + [BaseType(typeof(NSObject))] + [DisableDefaultCtor] + interface NLContextualEmbeddingResult + { + [Export("string")] + string String { get; } + + [Export("language")] + string Language { get; } + + [Export("sequenceLength")] + nuint SequenceLength { get; } + + [Export("enumerateTokenVectorsInRange:usingBlock:")] + // [Async] + void EnumerateTokenVectorsInRange(NSRange range, Action, NSRange, IntPtr> block); + + [Export("tokenVectorAtIndex:tokenRange:")] + [return: NullAllowed] + NSNumber[] TokenVectorAtIndex(nuint characterIndex, IntPtr tokenRange); + } } diff --git a/tests/xtro-sharpie/api-annotations-dotnet/iOS-NaturalLanguage.todo b/tests/xtro-sharpie/api-annotations-dotnet/iOS-NaturalLanguage.todo deleted file mode 100644 index 0d9894c3af57..000000000000 --- a/tests/xtro-sharpie/api-annotations-dotnet/iOS-NaturalLanguage.todo +++ /dev/null @@ -1,57 +0,0 @@ -!missing-enum! NLContextualEmbeddingAssetsResult not bound -!missing-field! NLContextualEmbeddingKeyLanguages not bound -!missing-field! NLContextualEmbeddingKeyRevision not bound -!missing-field! NLContextualEmbeddingKeyScripts not bound -!missing-field! NLScriptArabic not bound -!missing-field! NLScriptArmenian not bound -!missing-field! NLScriptBengali not bound -!missing-field! NLScriptCanadianAboriginalSyllabics not bound -!missing-field! NLScriptCherokee not bound -!missing-field! NLScriptCyrillic not bound -!missing-field! NLScriptDevanagari not bound -!missing-field! NLScriptEthiopic not bound -!missing-field! NLScriptGeorgian not bound -!missing-field! NLScriptGreek not bound -!missing-field! NLScriptGujarati not bound -!missing-field! NLScriptGurmukhi not bound -!missing-field! NLScriptHebrew not bound -!missing-field! NLScriptJapanese not bound -!missing-field! NLScriptKannada not bound -!missing-field! NLScriptKhmer not bound -!missing-field! NLScriptKorean not bound -!missing-field! NLScriptLao not bound -!missing-field! NLScriptLatin not bound -!missing-field! NLScriptMalayalam not bound -!missing-field! NLScriptMongolian not bound -!missing-field! NLScriptMyanmar not bound -!missing-field! NLScriptOriya not bound -!missing-field! NLScriptSimplifiedChinese not bound -!missing-field! NLScriptSinhala not bound -!missing-field! NLScriptTamil not bound -!missing-field! NLScriptTelugu not bound -!missing-field! NLScriptThai not bound -!missing-field! NLScriptTibetan not bound -!missing-field! NLScriptTraditionalChinese not bound -!missing-field! NLScriptUndetermined not bound -!missing-selector! +NLContextualEmbedding::contextualEmbeddingsForValues: not bound -!missing-selector! +NLContextualEmbedding::contextualEmbeddingWithLanguage: not bound -!missing-selector! +NLContextualEmbedding::contextualEmbeddingWithModelIdentifier: not bound -!missing-selector! +NLContextualEmbedding::contextualEmbeddingWithScript: not bound -!missing-selector! NLContextualEmbedding::dimension not bound -!missing-selector! NLContextualEmbedding::embeddingResultForString:language:error: not bound -!missing-selector! NLContextualEmbedding::hasAvailableAssets not bound -!missing-selector! NLContextualEmbedding::languages not bound -!missing-selector! NLContextualEmbedding::loadWithError: not bound -!missing-selector! NLContextualEmbedding::maximumSequenceLength not bound -!missing-selector! NLContextualEmbedding::modelIdentifier not bound -!missing-selector! NLContextualEmbedding::requestEmbeddingAssetsWithCompletionHandler: not bound -!missing-selector! NLContextualEmbedding::revision not bound -!missing-selector! NLContextualEmbedding::scripts not bound -!missing-selector! NLContextualEmbedding::unload not bound -!missing-selector! NLContextualEmbeddingResult::enumerateTokenVectorsInRange:usingBlock: not bound -!missing-selector! NLContextualEmbeddingResult::language not bound -!missing-selector! NLContextualEmbeddingResult::sequenceLength not bound -!missing-selector! NLContextualEmbeddingResult::string not bound -!missing-selector! NLContextualEmbeddingResult::tokenVectorAtIndex:tokenRange: not bound -!missing-type! NLContextualEmbedding not bound -!missing-type! NLContextualEmbeddingResult not bound diff --git a/tests/xtro-sharpie/api-annotations-dotnet/macOS-NaturalLanguage.todo b/tests/xtro-sharpie/api-annotations-dotnet/macOS-NaturalLanguage.todo deleted file mode 100644 index 0d9894c3af57..000000000000 --- a/tests/xtro-sharpie/api-annotations-dotnet/macOS-NaturalLanguage.todo +++ /dev/null @@ -1,57 +0,0 @@ -!missing-enum! NLContextualEmbeddingAssetsResult not bound -!missing-field! NLContextualEmbeddingKeyLanguages not bound -!missing-field! NLContextualEmbeddingKeyRevision not bound -!missing-field! NLContextualEmbeddingKeyScripts not bound -!missing-field! NLScriptArabic not bound -!missing-field! NLScriptArmenian not bound -!missing-field! NLScriptBengali not bound -!missing-field! NLScriptCanadianAboriginalSyllabics not bound -!missing-field! NLScriptCherokee not bound -!missing-field! NLScriptCyrillic not bound -!missing-field! NLScriptDevanagari not bound -!missing-field! NLScriptEthiopic not bound -!missing-field! NLScriptGeorgian not bound -!missing-field! NLScriptGreek not bound -!missing-field! NLScriptGujarati not bound -!missing-field! NLScriptGurmukhi not bound -!missing-field! NLScriptHebrew not bound -!missing-field! NLScriptJapanese not bound -!missing-field! NLScriptKannada not bound -!missing-field! NLScriptKhmer not bound -!missing-field! NLScriptKorean not bound -!missing-field! NLScriptLao not bound -!missing-field! NLScriptLatin not bound -!missing-field! NLScriptMalayalam not bound -!missing-field! NLScriptMongolian not bound -!missing-field! NLScriptMyanmar not bound -!missing-field! NLScriptOriya not bound -!missing-field! NLScriptSimplifiedChinese not bound -!missing-field! NLScriptSinhala not bound -!missing-field! NLScriptTamil not bound -!missing-field! NLScriptTelugu not bound -!missing-field! NLScriptThai not bound -!missing-field! NLScriptTibetan not bound -!missing-field! NLScriptTraditionalChinese not bound -!missing-field! NLScriptUndetermined not bound -!missing-selector! +NLContextualEmbedding::contextualEmbeddingsForValues: not bound -!missing-selector! +NLContextualEmbedding::contextualEmbeddingWithLanguage: not bound -!missing-selector! +NLContextualEmbedding::contextualEmbeddingWithModelIdentifier: not bound -!missing-selector! +NLContextualEmbedding::contextualEmbeddingWithScript: not bound -!missing-selector! NLContextualEmbedding::dimension not bound -!missing-selector! NLContextualEmbedding::embeddingResultForString:language:error: not bound -!missing-selector! NLContextualEmbedding::hasAvailableAssets not bound -!missing-selector! NLContextualEmbedding::languages not bound -!missing-selector! NLContextualEmbedding::loadWithError: not bound -!missing-selector! NLContextualEmbedding::maximumSequenceLength not bound -!missing-selector! NLContextualEmbedding::modelIdentifier not bound -!missing-selector! NLContextualEmbedding::requestEmbeddingAssetsWithCompletionHandler: not bound -!missing-selector! NLContextualEmbedding::revision not bound -!missing-selector! NLContextualEmbedding::scripts not bound -!missing-selector! NLContextualEmbedding::unload not bound -!missing-selector! NLContextualEmbeddingResult::enumerateTokenVectorsInRange:usingBlock: not bound -!missing-selector! NLContextualEmbeddingResult::language not bound -!missing-selector! NLContextualEmbeddingResult::sequenceLength not bound -!missing-selector! NLContextualEmbeddingResult::string not bound -!missing-selector! NLContextualEmbeddingResult::tokenVectorAtIndex:tokenRange: not bound -!missing-type! NLContextualEmbedding not bound -!missing-type! NLContextualEmbeddingResult not bound diff --git a/tests/xtro-sharpie/api-annotations-dotnet/tvOS-NaturalLanguage.todo b/tests/xtro-sharpie/api-annotations-dotnet/tvOS-NaturalLanguage.todo deleted file mode 100644 index 0d9894c3af57..000000000000 --- a/tests/xtro-sharpie/api-annotations-dotnet/tvOS-NaturalLanguage.todo +++ /dev/null @@ -1,57 +0,0 @@ -!missing-enum! NLContextualEmbeddingAssetsResult not bound -!missing-field! NLContextualEmbeddingKeyLanguages not bound -!missing-field! NLContextualEmbeddingKeyRevision not bound -!missing-field! NLContextualEmbeddingKeyScripts not bound -!missing-field! NLScriptArabic not bound -!missing-field! NLScriptArmenian not bound -!missing-field! NLScriptBengali not bound -!missing-field! NLScriptCanadianAboriginalSyllabics not bound -!missing-field! NLScriptCherokee not bound -!missing-field! NLScriptCyrillic not bound -!missing-field! NLScriptDevanagari not bound -!missing-field! NLScriptEthiopic not bound -!missing-field! NLScriptGeorgian not bound -!missing-field! NLScriptGreek not bound -!missing-field! NLScriptGujarati not bound -!missing-field! NLScriptGurmukhi not bound -!missing-field! NLScriptHebrew not bound -!missing-field! NLScriptJapanese not bound -!missing-field! NLScriptKannada not bound -!missing-field! NLScriptKhmer not bound -!missing-field! NLScriptKorean not bound -!missing-field! NLScriptLao not bound -!missing-field! NLScriptLatin not bound -!missing-field! NLScriptMalayalam not bound -!missing-field! NLScriptMongolian not bound -!missing-field! NLScriptMyanmar not bound -!missing-field! NLScriptOriya not bound -!missing-field! NLScriptSimplifiedChinese not bound -!missing-field! NLScriptSinhala not bound -!missing-field! NLScriptTamil not bound -!missing-field! NLScriptTelugu not bound -!missing-field! NLScriptThai not bound -!missing-field! NLScriptTibetan not bound -!missing-field! NLScriptTraditionalChinese not bound -!missing-field! NLScriptUndetermined not bound -!missing-selector! +NLContextualEmbedding::contextualEmbeddingsForValues: not bound -!missing-selector! +NLContextualEmbedding::contextualEmbeddingWithLanguage: not bound -!missing-selector! +NLContextualEmbedding::contextualEmbeddingWithModelIdentifier: not bound -!missing-selector! +NLContextualEmbedding::contextualEmbeddingWithScript: not bound -!missing-selector! NLContextualEmbedding::dimension not bound -!missing-selector! NLContextualEmbedding::embeddingResultForString:language:error: not bound -!missing-selector! NLContextualEmbedding::hasAvailableAssets not bound -!missing-selector! NLContextualEmbedding::languages not bound -!missing-selector! NLContextualEmbedding::loadWithError: not bound -!missing-selector! NLContextualEmbedding::maximumSequenceLength not bound -!missing-selector! NLContextualEmbedding::modelIdentifier not bound -!missing-selector! NLContextualEmbedding::requestEmbeddingAssetsWithCompletionHandler: not bound -!missing-selector! NLContextualEmbedding::revision not bound -!missing-selector! NLContextualEmbedding::scripts not bound -!missing-selector! NLContextualEmbedding::unload not bound -!missing-selector! NLContextualEmbeddingResult::enumerateTokenVectorsInRange:usingBlock: not bound -!missing-selector! NLContextualEmbeddingResult::language not bound -!missing-selector! NLContextualEmbeddingResult::sequenceLength not bound -!missing-selector! NLContextualEmbeddingResult::string not bound -!missing-selector! NLContextualEmbeddingResult::tokenVectorAtIndex:tokenRange: not bound -!missing-type! NLContextualEmbedding not bound -!missing-type! NLContextualEmbeddingResult not bound diff --git a/tests/xtro-sharpie/iOS-NaturalLanguage.todo b/tests/xtro-sharpie/iOS-NaturalLanguage.todo deleted file mode 100644 index 0d9894c3af57..000000000000 --- a/tests/xtro-sharpie/iOS-NaturalLanguage.todo +++ /dev/null @@ -1,57 +0,0 @@ -!missing-enum! NLContextualEmbeddingAssetsResult not bound -!missing-field! NLContextualEmbeddingKeyLanguages not bound -!missing-field! NLContextualEmbeddingKeyRevision not bound -!missing-field! NLContextualEmbeddingKeyScripts not bound -!missing-field! NLScriptArabic not bound -!missing-field! NLScriptArmenian not bound -!missing-field! NLScriptBengali not bound -!missing-field! NLScriptCanadianAboriginalSyllabics not bound -!missing-field! NLScriptCherokee not bound -!missing-field! NLScriptCyrillic not bound -!missing-field! NLScriptDevanagari not bound -!missing-field! NLScriptEthiopic not bound -!missing-field! NLScriptGeorgian not bound -!missing-field! NLScriptGreek not bound -!missing-field! NLScriptGujarati not bound -!missing-field! NLScriptGurmukhi not bound -!missing-field! NLScriptHebrew not bound -!missing-field! NLScriptJapanese not bound -!missing-field! NLScriptKannada not bound -!missing-field! NLScriptKhmer not bound -!missing-field! NLScriptKorean not bound -!missing-field! NLScriptLao not bound -!missing-field! NLScriptLatin not bound -!missing-field! NLScriptMalayalam not bound -!missing-field! NLScriptMongolian not bound -!missing-field! NLScriptMyanmar not bound -!missing-field! NLScriptOriya not bound -!missing-field! NLScriptSimplifiedChinese not bound -!missing-field! NLScriptSinhala not bound -!missing-field! NLScriptTamil not bound -!missing-field! NLScriptTelugu not bound -!missing-field! NLScriptThai not bound -!missing-field! NLScriptTibetan not bound -!missing-field! NLScriptTraditionalChinese not bound -!missing-field! NLScriptUndetermined not bound -!missing-selector! +NLContextualEmbedding::contextualEmbeddingsForValues: not bound -!missing-selector! +NLContextualEmbedding::contextualEmbeddingWithLanguage: not bound -!missing-selector! +NLContextualEmbedding::contextualEmbeddingWithModelIdentifier: not bound -!missing-selector! +NLContextualEmbedding::contextualEmbeddingWithScript: not bound -!missing-selector! NLContextualEmbedding::dimension not bound -!missing-selector! NLContextualEmbedding::embeddingResultForString:language:error: not bound -!missing-selector! NLContextualEmbedding::hasAvailableAssets not bound -!missing-selector! NLContextualEmbedding::languages not bound -!missing-selector! NLContextualEmbedding::loadWithError: not bound -!missing-selector! NLContextualEmbedding::maximumSequenceLength not bound -!missing-selector! NLContextualEmbedding::modelIdentifier not bound -!missing-selector! NLContextualEmbedding::requestEmbeddingAssetsWithCompletionHandler: not bound -!missing-selector! NLContextualEmbedding::revision not bound -!missing-selector! NLContextualEmbedding::scripts not bound -!missing-selector! NLContextualEmbedding::unload not bound -!missing-selector! NLContextualEmbeddingResult::enumerateTokenVectorsInRange:usingBlock: not bound -!missing-selector! NLContextualEmbeddingResult::language not bound -!missing-selector! NLContextualEmbeddingResult::sequenceLength not bound -!missing-selector! NLContextualEmbeddingResult::string not bound -!missing-selector! NLContextualEmbeddingResult::tokenVectorAtIndex:tokenRange: not bound -!missing-type! NLContextualEmbedding not bound -!missing-type! NLContextualEmbeddingResult not bound diff --git a/tests/xtro-sharpie/macOS-NaturalLanguage.todo b/tests/xtro-sharpie/macOS-NaturalLanguage.todo deleted file mode 100644 index 0d9894c3af57..000000000000 --- a/tests/xtro-sharpie/macOS-NaturalLanguage.todo +++ /dev/null @@ -1,57 +0,0 @@ -!missing-enum! NLContextualEmbeddingAssetsResult not bound -!missing-field! NLContextualEmbeddingKeyLanguages not bound -!missing-field! NLContextualEmbeddingKeyRevision not bound -!missing-field! NLContextualEmbeddingKeyScripts not bound -!missing-field! NLScriptArabic not bound -!missing-field! NLScriptArmenian not bound -!missing-field! NLScriptBengali not bound -!missing-field! NLScriptCanadianAboriginalSyllabics not bound -!missing-field! NLScriptCherokee not bound -!missing-field! NLScriptCyrillic not bound -!missing-field! NLScriptDevanagari not bound -!missing-field! NLScriptEthiopic not bound -!missing-field! NLScriptGeorgian not bound -!missing-field! NLScriptGreek not bound -!missing-field! NLScriptGujarati not bound -!missing-field! NLScriptGurmukhi not bound -!missing-field! NLScriptHebrew not bound -!missing-field! NLScriptJapanese not bound -!missing-field! NLScriptKannada not bound -!missing-field! NLScriptKhmer not bound -!missing-field! NLScriptKorean not bound -!missing-field! NLScriptLao not bound -!missing-field! NLScriptLatin not bound -!missing-field! NLScriptMalayalam not bound -!missing-field! NLScriptMongolian not bound -!missing-field! NLScriptMyanmar not bound -!missing-field! NLScriptOriya not bound -!missing-field! NLScriptSimplifiedChinese not bound -!missing-field! NLScriptSinhala not bound -!missing-field! NLScriptTamil not bound -!missing-field! NLScriptTelugu not bound -!missing-field! NLScriptThai not bound -!missing-field! NLScriptTibetan not bound -!missing-field! NLScriptTraditionalChinese not bound -!missing-field! NLScriptUndetermined not bound -!missing-selector! +NLContextualEmbedding::contextualEmbeddingsForValues: not bound -!missing-selector! +NLContextualEmbedding::contextualEmbeddingWithLanguage: not bound -!missing-selector! +NLContextualEmbedding::contextualEmbeddingWithModelIdentifier: not bound -!missing-selector! +NLContextualEmbedding::contextualEmbeddingWithScript: not bound -!missing-selector! NLContextualEmbedding::dimension not bound -!missing-selector! NLContextualEmbedding::embeddingResultForString:language:error: not bound -!missing-selector! NLContextualEmbedding::hasAvailableAssets not bound -!missing-selector! NLContextualEmbedding::languages not bound -!missing-selector! NLContextualEmbedding::loadWithError: not bound -!missing-selector! NLContextualEmbedding::maximumSequenceLength not bound -!missing-selector! NLContextualEmbedding::modelIdentifier not bound -!missing-selector! NLContextualEmbedding::requestEmbeddingAssetsWithCompletionHandler: not bound -!missing-selector! NLContextualEmbedding::revision not bound -!missing-selector! NLContextualEmbedding::scripts not bound -!missing-selector! NLContextualEmbedding::unload not bound -!missing-selector! NLContextualEmbeddingResult::enumerateTokenVectorsInRange:usingBlock: not bound -!missing-selector! NLContextualEmbeddingResult::language not bound -!missing-selector! NLContextualEmbeddingResult::sequenceLength not bound -!missing-selector! NLContextualEmbeddingResult::string not bound -!missing-selector! NLContextualEmbeddingResult::tokenVectorAtIndex:tokenRange: not bound -!missing-type! NLContextualEmbedding not bound -!missing-type! NLContextualEmbeddingResult not bound diff --git a/tests/xtro-sharpie/tvOS-NaturalLanguage.todo b/tests/xtro-sharpie/tvOS-NaturalLanguage.todo deleted file mode 100644 index 0d9894c3af57..000000000000 --- a/tests/xtro-sharpie/tvOS-NaturalLanguage.todo +++ /dev/null @@ -1,57 +0,0 @@ -!missing-enum! NLContextualEmbeddingAssetsResult not bound -!missing-field! NLContextualEmbeddingKeyLanguages not bound -!missing-field! NLContextualEmbeddingKeyRevision not bound -!missing-field! NLContextualEmbeddingKeyScripts not bound -!missing-field! NLScriptArabic not bound -!missing-field! NLScriptArmenian not bound -!missing-field! NLScriptBengali not bound -!missing-field! NLScriptCanadianAboriginalSyllabics not bound -!missing-field! NLScriptCherokee not bound -!missing-field! NLScriptCyrillic not bound -!missing-field! NLScriptDevanagari not bound -!missing-field! NLScriptEthiopic not bound -!missing-field! NLScriptGeorgian not bound -!missing-field! NLScriptGreek not bound -!missing-field! NLScriptGujarati not bound -!missing-field! NLScriptGurmukhi not bound -!missing-field! NLScriptHebrew not bound -!missing-field! NLScriptJapanese not bound -!missing-field! NLScriptKannada not bound -!missing-field! NLScriptKhmer not bound -!missing-field! NLScriptKorean not bound -!missing-field! NLScriptLao not bound -!missing-field! NLScriptLatin not bound -!missing-field! NLScriptMalayalam not bound -!missing-field! NLScriptMongolian not bound -!missing-field! NLScriptMyanmar not bound -!missing-field! NLScriptOriya not bound -!missing-field! NLScriptSimplifiedChinese not bound -!missing-field! NLScriptSinhala not bound -!missing-field! NLScriptTamil not bound -!missing-field! NLScriptTelugu not bound -!missing-field! NLScriptThai not bound -!missing-field! NLScriptTibetan not bound -!missing-field! NLScriptTraditionalChinese not bound -!missing-field! NLScriptUndetermined not bound -!missing-selector! +NLContextualEmbedding::contextualEmbeddingsForValues: not bound -!missing-selector! +NLContextualEmbedding::contextualEmbeddingWithLanguage: not bound -!missing-selector! +NLContextualEmbedding::contextualEmbeddingWithModelIdentifier: not bound -!missing-selector! +NLContextualEmbedding::contextualEmbeddingWithScript: not bound -!missing-selector! NLContextualEmbedding::dimension not bound -!missing-selector! NLContextualEmbedding::embeddingResultForString:language:error: not bound -!missing-selector! NLContextualEmbedding::hasAvailableAssets not bound -!missing-selector! NLContextualEmbedding::languages not bound -!missing-selector! NLContextualEmbedding::loadWithError: not bound -!missing-selector! NLContextualEmbedding::maximumSequenceLength not bound -!missing-selector! NLContextualEmbedding::modelIdentifier not bound -!missing-selector! NLContextualEmbedding::requestEmbeddingAssetsWithCompletionHandler: not bound -!missing-selector! NLContextualEmbedding::revision not bound -!missing-selector! NLContextualEmbedding::scripts not bound -!missing-selector! NLContextualEmbedding::unload not bound -!missing-selector! NLContextualEmbeddingResult::enumerateTokenVectorsInRange:usingBlock: not bound -!missing-selector! NLContextualEmbeddingResult::language not bound -!missing-selector! NLContextualEmbeddingResult::sequenceLength not bound -!missing-selector! NLContextualEmbeddingResult::string not bound -!missing-selector! NLContextualEmbeddingResult::tokenVectorAtIndex:tokenRange: not bound -!missing-type! NLContextualEmbedding not bound -!missing-type! NLContextualEmbeddingResult not bound diff --git a/tests/xtro-sharpie/watchOS-NaturalLanguage.todo b/tests/xtro-sharpie/watchOS-NaturalLanguage.todo deleted file mode 100644 index 0d9894c3af57..000000000000 --- a/tests/xtro-sharpie/watchOS-NaturalLanguage.todo +++ /dev/null @@ -1,57 +0,0 @@ -!missing-enum! NLContextualEmbeddingAssetsResult not bound -!missing-field! NLContextualEmbeddingKeyLanguages not bound -!missing-field! NLContextualEmbeddingKeyRevision not bound -!missing-field! NLContextualEmbeddingKeyScripts not bound -!missing-field! NLScriptArabic not bound -!missing-field! NLScriptArmenian not bound -!missing-field! NLScriptBengali not bound -!missing-field! NLScriptCanadianAboriginalSyllabics not bound -!missing-field! NLScriptCherokee not bound -!missing-field! NLScriptCyrillic not bound -!missing-field! NLScriptDevanagari not bound -!missing-field! NLScriptEthiopic not bound -!missing-field! NLScriptGeorgian not bound -!missing-field! NLScriptGreek not bound -!missing-field! NLScriptGujarati not bound -!missing-field! NLScriptGurmukhi not bound -!missing-field! NLScriptHebrew not bound -!missing-field! NLScriptJapanese not bound -!missing-field! NLScriptKannada not bound -!missing-field! NLScriptKhmer not bound -!missing-field! NLScriptKorean not bound -!missing-field! NLScriptLao not bound -!missing-field! NLScriptLatin not bound -!missing-field! NLScriptMalayalam not bound -!missing-field! NLScriptMongolian not bound -!missing-field! NLScriptMyanmar not bound -!missing-field! NLScriptOriya not bound -!missing-field! NLScriptSimplifiedChinese not bound -!missing-field! NLScriptSinhala not bound -!missing-field! NLScriptTamil not bound -!missing-field! NLScriptTelugu not bound -!missing-field! NLScriptThai not bound -!missing-field! NLScriptTibetan not bound -!missing-field! NLScriptTraditionalChinese not bound -!missing-field! NLScriptUndetermined not bound -!missing-selector! +NLContextualEmbedding::contextualEmbeddingsForValues: not bound -!missing-selector! +NLContextualEmbedding::contextualEmbeddingWithLanguage: not bound -!missing-selector! +NLContextualEmbedding::contextualEmbeddingWithModelIdentifier: not bound -!missing-selector! +NLContextualEmbedding::contextualEmbeddingWithScript: not bound -!missing-selector! NLContextualEmbedding::dimension not bound -!missing-selector! NLContextualEmbedding::embeddingResultForString:language:error: not bound -!missing-selector! NLContextualEmbedding::hasAvailableAssets not bound -!missing-selector! NLContextualEmbedding::languages not bound -!missing-selector! NLContextualEmbedding::loadWithError: not bound -!missing-selector! NLContextualEmbedding::maximumSequenceLength not bound -!missing-selector! NLContextualEmbedding::modelIdentifier not bound -!missing-selector! NLContextualEmbedding::requestEmbeddingAssetsWithCompletionHandler: not bound -!missing-selector! NLContextualEmbedding::revision not bound -!missing-selector! NLContextualEmbedding::scripts not bound -!missing-selector! NLContextualEmbedding::unload not bound -!missing-selector! NLContextualEmbeddingResult::enumerateTokenVectorsInRange:usingBlock: not bound -!missing-selector! NLContextualEmbeddingResult::language not bound -!missing-selector! NLContextualEmbeddingResult::sequenceLength not bound -!missing-selector! NLContextualEmbeddingResult::string not bound -!missing-selector! NLContextualEmbeddingResult::tokenVectorAtIndex:tokenRange: not bound -!missing-type! NLContextualEmbedding not bound -!missing-type! NLContextualEmbeddingResult not bound From 0656533bce57b7dbeace5acb897324e95627e242 Mon Sep 17 00:00:00 2001 From: GitHub Actions Autoformatter Date: Mon, 18 Sep 2023 15:44:34 +0000 Subject: [PATCH 2/7] Auto-format source code --- src/NaturalLanguage/Enums.cs | 82 ++++++++++++++++++------------------ src/naturallanguage.cs | 78 +++++++++++++++++----------------- 2 files changed, 78 insertions(+), 82 deletions(-) diff --git a/src/NaturalLanguage/Enums.cs b/src/NaturalLanguage/Enums.cs index ea359d08b491..a5c008e8f341 100644 --- a/src/NaturalLanguage/Enums.cs +++ b/src/NaturalLanguage/Enums.cs @@ -217,89 +217,87 @@ public enum NLTagScheme { SentimentScore, } - [Watch(10, 0), TV(17, 0), Mac(14, 0), iOS(17, 0), MacCatalyst(17, 0)] + [Watch (10, 0), TV (17, 0), Mac (14, 0), iOS (17, 0), MacCatalyst (17, 0)] public enum NLScript { - [Field("NLScriptUndetermined")] + [Field ("NLScriptUndetermined")] Undetermined, - [Field("NLScriptArabic")] + [Field ("NLScriptArabic")] Arabic, - [Field("NLScriptArmenian")] + [Field ("NLScriptArmenian")] Armenian, - [Field("NLScriptBengali")] + [Field ("NLScriptBengali")] Bengali, - [Field("NLScriptCanadianAboriginalSyllabics")] + [Field ("NLScriptCanadianAboriginalSyllabics")] CanadianAboriginalSyllabics, - [Field("NLScriptCherokee")] + [Field ("NLScriptCherokee")] Cherokee, - [Field("NLScriptCyrillic")] + [Field ("NLScriptCyrillic")] Cyrillic, - [Field("NLScriptDevanagari")] + [Field ("NLScriptDevanagari")] Devanagari, - [Field("NLScriptEthiopic")] + [Field ("NLScriptEthiopic")] Ethiopic, - [Field("NLScriptGeorgian")] + [Field ("NLScriptGeorgian")] Georgian, - [Field("NLScriptGreek")] + [Field ("NLScriptGreek")] Greek, - [Field("NLScriptGujarati")] + [Field ("NLScriptGujarati")] Gujarati, - [Field("NLScriptGurmukhi")] + [Field ("NLScriptGurmukhi")] Gurmukhi, - [Field("NLScriptHebrew")] + [Field ("NLScriptHebrew")] Hebrew, - [Field("NLScriptJapanese")] + [Field ("NLScriptJapanese")] Japanese, - [Field("NLScriptKannada")] + [Field ("NLScriptKannada")] Kannada, - [Field("NLScriptKhmer")] + [Field ("NLScriptKhmer")] Khmer, - [Field("NLScriptKorean")] + [Field ("NLScriptKorean")] Korean, - [Field("NLScriptLao")] + [Field ("NLScriptLao")] Lao, - [Field("NLScriptLatin")] + [Field ("NLScriptLatin")] Latin, - [Field("NLScriptMalayalam")] + [Field ("NLScriptMalayalam")] Malayalam, - [Field("NLScriptMongolian")] + [Field ("NLScriptMongolian")] Mongolian, - [Field("NLScriptMyanmar")] + [Field ("NLScriptMyanmar")] Myanmar, - [Field("NLScriptOriya")] + [Field ("NLScriptOriya")] Oriya, - [Field("NLScriptSimplifiedChinese")] + [Field ("NLScriptSimplifiedChinese")] SimplifiedChinese, - [Field("NLScriptSinhala")] + [Field ("NLScriptSinhala")] Sinhala, - [Field("NLScriptTamil")] + [Field ("NLScriptTamil")] Tamil, - [Field("NLScriptTelugu")] + [Field ("NLScriptTelugu")] Telugu, - [Field("NLScriptThai")] + [Field ("NLScriptThai")] Thai, - [Field("NLScriptTibetan")] + [Field ("NLScriptTibetan")] Tibetan, - [Field("NLScriptTraditionalChinese")] - TraditionalChinese, + [Field ("NLScriptTraditionalChinese")] + TraditionalChinese, } - [Watch(10, 0), TV(17, 0), Mac(14, 0), iOS(17, 0), MacCatalyst(17, 0)] + [Watch (10, 0), TV (17, 0), Mac (14, 0), iOS (17, 0), MacCatalyst (17, 0)] [Native] - public enum NLContextualEmbeddingAssetsResult : long - { + public enum NLContextualEmbeddingAssetsResult : long { Available, NotAvailable, Error, } - [Watch(10, 0), TV(17, 0), Mac(14, 0), iOS(17, 0), MacCatalyst(17, 0)] - public enum NLContextualEmebeddingKey - { - [Field("NLContextualEmbeddingKeyLanguages")] + [Watch (10, 0), TV (17, 0), Mac (14, 0), iOS (17, 0), MacCatalyst (17, 0)] + public enum NLContextualEmebeddingKey { + [Field ("NLContextualEmbeddingKeyLanguages")] Languages, - [Field("NLContextualEmbeddingKeyScripts")] + [Field ("NLContextualEmbeddingKeyScripts")] Scripts, - [Field("NLContextualEmbeddingKeyRevision")] + [Field ("NLContextualEmbeddingKeyRevision")] Revision, } } diff --git a/src/naturallanguage.cs b/src/naturallanguage.cs index bf55d7644ba0..ac518644e805 100644 --- a/src/naturallanguage.cs +++ b/src/naturallanguage.cs @@ -652,86 +652,84 @@ interface NLGazetteer { bool Write (NLStrongDictionary dictionary, NLLanguage? language, NSUrl url, [NullAllowed] out NSError error); } - [Watch(10, 0), TV(17, 0), Mac(14, 0), iOS(17, 0), MacCatalyst(17,0)] - [BaseType(typeof(NSObject))] + [Watch (10, 0), TV (17, 0), Mac (14, 0), iOS (17, 0), MacCatalyst (17, 0)] + [BaseType (typeof (NSObject))] [DisableDefaultCtor] - interface NLContextualEmbedding - { + interface NLContextualEmbedding { [Static] - [Export("contextualEmbeddingWithModelIdentifier:")] + [Export ("contextualEmbeddingWithModelIdentifier:")] [return: NullAllowed] - NLContextualEmbedding ContextualEmbeddingWithModelIdentifier(string modelIdentifier); + NLContextualEmbedding ContextualEmbeddingWithModelIdentifier (string modelIdentifier); [Static] - [Export("contextualEmbeddingsForValues:")] - NLContextualEmbedding[] ContextualEmbeddingsForValues(NSDictionary valuesDictionary); + [Export ("contextualEmbeddingsForValues:")] + NLContextualEmbedding [] ContextualEmbeddingsForValues (NSDictionary valuesDictionary); [Static] - [Export("contextualEmbeddingWithLanguage:")] + [Export ("contextualEmbeddingWithLanguage:")] [return: NullAllowed] - NLContextualEmbedding ContextualEmbeddingWithLanguage(string language); + NLContextualEmbedding ContextualEmbeddingWithLanguage (string language); [Static] - [Export("contextualEmbeddingWithScript:")] + [Export ("contextualEmbeddingWithScript:")] [return: NullAllowed] - NLContextualEmbedding ContextualEmbeddingWithScript(string script); + NLContextualEmbedding ContextualEmbeddingWithScript (string script); - [Export("modelIdentifier")] + [Export ("modelIdentifier")] string ModelIdentifier { get; } - [Export("languages", ArgumentSemantic.Copy)] - string[] Languages { get; } + [Export ("languages", ArgumentSemantic.Copy)] + string [] Languages { get; } - [Export("scripts", ArgumentSemantic.Copy)] - string[] Scripts { get; } + [Export ("scripts", ArgumentSemantic.Copy)] + string [] Scripts { get; } - [Export("revision")] + [Export ("revision")] nuint Revision { get; } - [Export("dimension")] + [Export ("dimension")] nuint Dimension { get; } - [Export("maximumSequenceLength")] + [Export ("maximumSequenceLength")] nuint MaximumSequenceLength { get; } - [Export("loadWithError:")] - bool Load([NullAllowed] out NSError error); + [Export ("loadWithError:")] + bool Load ([NullAllowed] out NSError error); - [Export("unload")] - void Unload(); + [Export ("unload")] + void Unload (); - [Export("embeddingResultForString:language:error:")] + [Export ("embeddingResultForString:language:error:")] [return: NullAllowed] - NLContextualEmbeddingResult EmbeddingResult(string @string, [NullAllowed] string language, [NullAllowed] out NSError error); + NLContextualEmbeddingResult EmbeddingResult (string @string, [NullAllowed] string language, [NullAllowed] out NSError error); - [Export("hasAvailableAssets")] + [Export ("hasAvailableAssets")] bool HasAvailableAssets { get; } - [Export("requestEmbeddingAssetsWithCompletionHandler:")] + [Export ("requestEmbeddingAssetsWithCompletionHandler:")] [Async] - void RequestAssets(Action completionHandler); + void RequestAssets (Action completionHandler); } - [Watch(10, 0), TV(17, 0), Mac(14, 0), iOS(17, 0), MacCatalyst(17, 0)] - [BaseType(typeof(NSObject))] + [Watch (10, 0), TV (17, 0), Mac (14, 0), iOS (17, 0), MacCatalyst (17, 0)] + [BaseType (typeof (NSObject))] [DisableDefaultCtor] - interface NLContextualEmbeddingResult - { - [Export("string")] + interface NLContextualEmbeddingResult { + [Export ("string")] string String { get; } - [Export("language")] + [Export ("language")] string Language { get; } - [Export("sequenceLength")] + [Export ("sequenceLength")] nuint SequenceLength { get; } - [Export("enumerateTokenVectorsInRange:usingBlock:")] + [Export ("enumerateTokenVectorsInRange:usingBlock:")] // [Async] - void EnumerateTokenVectorsInRange(NSRange range, Action, NSRange, IntPtr> block); + void EnumerateTokenVectorsInRange (NSRange range, Action, NSRange, IntPtr> block); - [Export("tokenVectorAtIndex:tokenRange:")] + [Export ("tokenVectorAtIndex:tokenRange:")] [return: NullAllowed] - NSNumber[] TokenVectorAtIndex(nuint characterIndex, IntPtr tokenRange); + NSNumber [] TokenVectorAtIndex (nuint characterIndex, IntPtr tokenRange); } } From 40e8ece7e8a389a71f2e0198ada7c458382a6900 Mon Sep 17 00:00:00 2001 From: Haritha Mohan Date: Mon, 18 Sep 2023 19:07:02 -0700 Subject: [PATCH 3/7] Apply suggestions from code review Co-authored-by: Rolf Bjarne Kvinge --- src/naturallanguage.cs | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/naturallanguage.cs b/src/naturallanguage.cs index ac518644e805..b78de13620cf 100644 --- a/src/naturallanguage.cs +++ b/src/naturallanguage.cs @@ -659,21 +659,21 @@ interface NLContextualEmbedding { [Static] [Export ("contextualEmbeddingWithModelIdentifier:")] [return: NullAllowed] - NLContextualEmbedding ContextualEmbeddingWithModelIdentifier (string modelIdentifier); + NLContextualEmbedding CreateWithModelIdentifier (string modelIdentifier); [Static] [Export ("contextualEmbeddingsForValues:")] - NLContextualEmbedding [] ContextualEmbeddingsForValues (NSDictionary valuesDictionary); + NLContextualEmbedding [] Create (NSDictionary values); [Static] [Export ("contextualEmbeddingWithLanguage:")] [return: NullAllowed] - NLContextualEmbedding ContextualEmbeddingWithLanguage (string language); + NLContextualEmbedding CreateWithLanguage (string language); [Static] [Export ("contextualEmbeddingWithScript:")] [return: NullAllowed] - NLContextualEmbedding ContextualEmbeddingWithScript (string script); + NLContextualEmbedding CreateWithScript (string script); [Export ("modelIdentifier")] string ModelIdentifier { get; } @@ -701,7 +701,7 @@ interface NLContextualEmbedding { [Export ("embeddingResultForString:language:error:")] [return: NullAllowed] - NLContextualEmbeddingResult EmbeddingResult (string @string, [NullAllowed] string language, [NullAllowed] out NSError error); + NLContextualEmbeddingResult GetEmbeddingResult (string @string, [NullAllowed] string language, [NullAllowed] out NSError error); [Export ("hasAvailableAssets")] bool HasAvailableAssets { get; } @@ -725,11 +725,10 @@ interface NLContextualEmbeddingResult { nuint SequenceLength { get; } [Export ("enumerateTokenVectorsInRange:usingBlock:")] - // [Async] - void EnumerateTokenVectorsInRange (NSRange range, Action, NSRange, IntPtr> block); + void EnumerateTokenVectors (NSRange range, Action, NSRange, IntPtr> block); [Export ("tokenVectorAtIndex:tokenRange:")] [return: NullAllowed] - NSNumber [] TokenVectorAtIndex (nuint characterIndex, IntPtr tokenRange); + NSNumber [] GetVector (nuint characterIndex, ref NSRange tokenRange); } } From dbf9e8b3fe01c5233aa0afccbc92ee0f3cb1531a Mon Sep 17 00:00:00 2001 From: Haritha Mohan Date: Mon, 18 Sep 2023 21:37:51 -0700 Subject: [PATCH 4/7] address rolf comments --- src/naturallanguage.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/naturallanguage.cs b/src/naturallanguage.cs index b78de13620cf..ce4544315fb3 100644 --- a/src/naturallanguage.cs +++ b/src/naturallanguage.cs @@ -711,6 +711,8 @@ interface NLContextualEmbedding { void RequestAssets (Action completionHandler); } + delegate void TokenVectorEnumeratorHandler(NSArray tokenVector, NSRange tokenRange, out bool stop); + [Watch (10, 0), TV (17, 0), Mac (14, 0), iOS (17, 0), MacCatalyst (17, 0)] [BaseType (typeof (NSObject))] [DisableDefaultCtor] @@ -725,8 +727,13 @@ interface NLContextualEmbeddingResult { nuint SequenceLength { get; } [Export ("enumerateTokenVectorsInRange:usingBlock:")] - void EnumerateTokenVectors (NSRange range, Action, NSRange, IntPtr> block); + void EnumerateTokenVectors (NSRange range, TokenVectorEnumeratorHandler enumerationHandler); +#if WATCHOS + [return: BindAs (typeof(int[]))] +#else + [return: BindAs (typeof(long[]))] +#endif [Export ("tokenVectorAtIndex:tokenRange:")] [return: NullAllowed] NSNumber [] GetVector (nuint characterIndex, ref NSRange tokenRange); From 07fa68a2c3507bd76c2f9031b5077ba6106127ba Mon Sep 17 00:00:00 2001 From: GitHub Actions Autoformatter Date: Tue, 19 Sep 2023 04:41:42 +0000 Subject: [PATCH 5/7] Auto-format source code --- src/naturallanguage.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/naturallanguage.cs b/src/naturallanguage.cs index ce4544315fb3..41ed0b9770b1 100644 --- a/src/naturallanguage.cs +++ b/src/naturallanguage.cs @@ -711,7 +711,7 @@ interface NLContextualEmbedding { void RequestAssets (Action completionHandler); } - delegate void TokenVectorEnumeratorHandler(NSArray tokenVector, NSRange tokenRange, out bool stop); + delegate void TokenVectorEnumeratorHandler (NSArray tokenVector, NSRange tokenRange, out bool stop); [Watch (10, 0), TV (17, 0), Mac (14, 0), iOS (17, 0), MacCatalyst (17, 0)] [BaseType (typeof (NSObject))] @@ -732,7 +732,7 @@ interface NLContextualEmbeddingResult { #if WATCHOS [return: BindAs (typeof(int[]))] #else - [return: BindAs (typeof(long[]))] + [return: BindAs (typeof (long []))] #endif [Export ("tokenVectorAtIndex:tokenRange:")] [return: NullAllowed] From 378d7695079e6e03c4e1cc73307d744a0ec65f5a Mon Sep 17 00:00:00 2001 From: Haritha Mohan Date: Tue, 19 Sep 2023 08:42:16 -0700 Subject: [PATCH 6/7] Update src/naturallanguage.cs Co-authored-by: Rolf Bjarne Kvinge --- src/naturallanguage.cs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/naturallanguage.cs b/src/naturallanguage.cs index 41ed0b9770b1..eeddd1fa70b9 100644 --- a/src/naturallanguage.cs +++ b/src/naturallanguage.cs @@ -729,11 +729,7 @@ interface NLContextualEmbeddingResult { [Export ("enumerateTokenVectorsInRange:usingBlock:")] void EnumerateTokenVectors (NSRange range, TokenVectorEnumeratorHandler enumerationHandler); -#if WATCHOS - [return: BindAs (typeof(int[]))] -#else - [return: BindAs (typeof (long []))] -#endif + [return: BindAs (typeof(nuint[]))] [Export ("tokenVectorAtIndex:tokenRange:")] [return: NullAllowed] NSNumber [] GetVector (nuint characterIndex, ref NSRange tokenRange); From 888a3e914b1f92de392031544cc862c946667577 Mon Sep 17 00:00:00 2001 From: GitHub Actions Autoformatter Date: Tue, 19 Sep 2023 15:45:48 +0000 Subject: [PATCH 7/7] Auto-format source code --- src/naturallanguage.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/naturallanguage.cs b/src/naturallanguage.cs index eeddd1fa70b9..7885da20230c 100644 --- a/src/naturallanguage.cs +++ b/src/naturallanguage.cs @@ -729,7 +729,7 @@ interface NLContextualEmbeddingResult { [Export ("enumerateTokenVectorsInRange:usingBlock:")] void EnumerateTokenVectors (NSRange range, TokenVectorEnumeratorHandler enumerationHandler); - [return: BindAs (typeof(nuint[]))] + [return: BindAs (typeof (nuint []))] [Export ("tokenVectorAtIndex:tokenRange:")] [return: NullAllowed] NSNumber [] GetVector (nuint characterIndex, ref NSRange tokenRange);