简体   繁体   English

如果不存在,如何添加NSLinguisticTagger Scheme

[英]How to add NSLinguisticTagger Scheme if doesn't exist

I need to get stem of word. 我需要得到一个词。 So i can't get if lemma scheme doesn't exist for english. 如果英语不存在引理方案,那么我无法得到。

Here's the code that i'm testing available tag schemes : 这是我正在测试可用标签方案的代码:

    let tagSchemes = NSLinguisticTagger.availableTagSchemes(forLanguage: "en")
    print(tagSchemes)

and this is output: 这是输出:

[__C.NSLinguisticTagScheme(_rawValue: TokenType),
     __C.NSLinguisticTagScheme(_rawValue: Language),
     __C.NSLinguisticTagScheme(_rawValue: Script)]

Notice that, simulators will return all scheme. 请注意,模拟器将返回所有方案。 My issue is on my device. 我的问题出在我的设备上。 You can try 'fr' or 'de' except 'en'. 您可以尝试'fr'或'de',除了'en'。

Basically can't. 基本上不能。 iOS SDK doesn't exist this feature yet. iOS SDK尚不存在此功能。 Some tag schemes only available for which language used on keyboard as in my question. 有些标签方案仅适用于我在问题中键盘上使用的语言。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM