NaturalLanguage.frameworkのごくごく入門的なオブジェクト「NLEmbedding」を利用できるか、各言語でチェックを行ったところ、macOS 13、14で予想外の結果が返ってきた内容をmacOS 15で再確認してみました。
ラテン系言語を中心に中国語がサポートされているあたりがあまりにも特徴的なNaturalLanguage.framework。多くの機能を日本語で利用できないことは分かりきっていたのですが、macOS 14で対応言語が激減。このまま廃止されるのかと驚いていたのですが、macOS 15で復旧していました。
どうしてmacOS 14.x台で復旧していなかったのか。ひたすら不思議です。
AppleScript名:指定言語でNLEmbeddingを処理できるかチェック_13_14_15.scpt |
— – Created by: Takaaki Naganoya – Created on: 2024/03/13 — – Copyright © 2024 Piyomaru Software, All Rights Reserved — use AppleScript version "2.8" use framework "Foundation" use framework "NaturalLanguage" use scripting additions –The result is on macOS 13.6.5 / 14.4 / 15.2 set aRes to testNLLanguage("NLLanguageEnglish") of me –> true–> true –true set aRes to testNLLanguage("NLLanguageFrench") of me –> true–>false (macOS 14)—> true set aRes to testNLLanguage("NLLanguageGerman") of me –> true–>false (macOS 14)–> true set aRes to testNLLanguage("NLLanguageItalian") of me –> true–>false (macOS 14)–> true set aRes to testNLLanguage("NLLanguagePortuguese") of me –> true–>false (macOS 14)–> true set aRes to testNLLanguage("NLLanguageSimplifiedChinese") of me –> true–>false (macOS 14)–> true set aRes to testNLLanguage("NLLanguageSpanish") of me –> true–>false (macOS 14)–> true set aRes to testNLLanguage("NLLanguageUndetermined") of me –> true –>Natural Language framework doesn’t recognize(macOS 14).–> true –macOS 14.7.2で再確認したところtrueに set aRes to testNLLanguage("NLLanguageAmharic") of me –> false–> false–> false set aRes to testNLLanguage("NLLanguageArabic") of me –> false–> false–> false set aRes to testNLLanguage("NLLanguageArmenian") of me –> false–> false–> false set aRes to testNLLanguage("NLLanguageBengali") of me –> false–> false–> false set aRes to testNLLanguage("NLLanguageBulgarian") of me –> false–> false–> false set aRes to testNLLanguage("NLLanguageBurmese") of me –> false–> false–> false set aRes to testNLLanguage("NLLanguageCatalan") of me –> false–> false–> false set aRes to testNLLanguage("NLLanguageCherokee") of me –> false–> false–> false set aRes to testNLLanguage("NLLanguageCroatian") of me –> false–> false–> false set aRes to testNLLanguage("NLLanguageCzech") of me –> false–> false–> false set aRes to testNLLanguage("NLLanguageDanish") of me –> false–> false–> false set aRes to testNLLanguage("NLLanguageDutch") of me –> false–> false–> false set aRes to testNLLanguage("NLLanguageFinnish") of me –> false–> false–> false set aRes to testNLLanguage("NLLanguageGeorgian") of me –> false–> false–> false set aRes to testNLLanguage("NLLanguageGreek") of me –> false–> false–> false set aRes to testNLLanguage("NLLanguageGujarati") of me –> false–> false–> false set aRes to testNLLanguage("NLLanguageHebrew") of me –> false–> false–> false set aRes to testNLLanguage("NLLanguageHindi") of me –> false–> false–> false set aRes to testNLLanguage("NLLanguageHungarian") of me –> false–> false–> false set aRes to testNLLanguage("NLLanguageIcelandic") of me –> false–> false–> false set aRes to testNLLanguage("NLLanguageIndonesian") of me –> false–> false–> false set aRes to testNLLanguage("NLLanguageJapanese") of me –> false–> false–> false set aRes to testNLLanguage("NLLanguageKannada") of me –> false–> false–> false set aRes to testNLLanguage("NLLanguageKazakh") of me –> false–> false–> false set aRes to testNLLanguage("NLLanguageKhmer") of me –> false–> false–> false set aRes to testNLLanguage("NLLanguageKorean") of me –> false–> false–> false set aRes to testNLLanguage("NLLanguageLao") of me –> false–> false–> false set aRes to testNLLanguage("NLLanguageMalay") of me –> false–> false–> false set aRes to testNLLanguage("NLLanguageMalayalam") of me –> false–> false–> false set aRes to testNLLanguage("NLLanguageMarathi") of me –> false–> false–> false set aRes to testNLLanguage("NLLanguageMongolian") of me –> false–> false–> false set aRes to testNLLanguage("NLLanguageNorwegian") of me –> false–> false–> false set aRes to testNLLanguage("NLLanguageOriya") of me –> false–> false–> false set aRes to testNLLanguage("NLLanguagePersian") of me –> false–> false–> false set aRes to testNLLanguage("NLLanguagePolish") of me –> false–> false–> false set aRes to testNLLanguage("NLLanguagePunjabi") of me –> false–> false–> false set aRes to testNLLanguage("NLLanguageRomanian") of me –> false–> false–> false set aRes to testNLLanguage("NLLanguageRussian") of me –> false–> false–> false set aRes to testNLLanguage("NLLanguageSinhalese") of me –> false–> false–> false set aRes to testNLLanguage("NLLanguageSlovak") of me –> false–> false–> false set aRes to testNLLanguage("NLLanguageSwedish") of me –> false–> false–> false set aRes to testNLLanguage("NLLanguageTamil") of me –> false–> false–> false set aRes to testNLLanguage("NLLanguageTelugu") of me –> false–> false–> false set aRes to testNLLanguage("NLLanguageThai") of me –> false–> false–> false set aRes to testNLLanguage("NLLanguageTibetan") of me –> false–> false–> false set aRes to testNLLanguage("NLLanguageTraditionalChinese") of me –> false–> false–> false set aRes to testNLLanguage("NLLanguageTurkish") of me –> false–> false–> false set aRes to testNLLanguage("NLLanguageUkrainian") of me –> false–> false–> false set aRes to testNLLanguage("NLLanguageUrdu") of me –> false–> false–> false set aRes to testNLLanguage("NLLanguageVietnamese") of me –> false–> false–> false on testNLLanguage(aLangName) set aText to "use AppleScript use framework \"Foundation\" use framework \"NaturalLanguage\" set targLang to (current application’s " & aLangName & ") set aEmb to current application’s NLEmbedding’s wordEmbeddingForLanguage:(targLang) if aEmb = missing value then return false return true " return run script aText end testNLLanguage |