// // KBSuggestionEngine.h // CustomKeyboard // #import NS_ASSUME_NONNULL_BEGIN typedef NS_ENUM(NSInteger, KBSuggestionEngineType) { KBSuggestionEngineTypeLatin = 0, // 拉丁字母(英语、葡萄牙语、印尼语) KBSuggestionEngineTypeSpanish, // 西班牙语 KBSuggestionEngineTypePinyinSimplified, // 简体拼音 KBSuggestionEngineTypePinyinTraditional, // 繁体拼音 KBSuggestionEngineTypeBopomofo // 注音(繁体) }; /// Simple local suggestion engine (prefix match + lightweight ranking). @interface KBSuggestionEngine : NSObject @property (nonatomic, assign) KBSuggestionEngineType engineType; + (instancetype)shared; /// Returns suggestions for prefix (lowercase expected), limited by count. - (NSArray *)suggestionsForPrefix:(NSString *)prefix limit:(NSUInteger)limit; /// Record a selection to slightly boost ranking next time. - (void)recordSelection:(NSString *)word; /// 设置联想引擎类型(根据 profileId 的 suggestionEngine 字段) - (void)setEngineTypeFromString:(NSString *)engineTypeString; @end NS_ASSUME_NONNULL_END