MLKitLanguageID Framework Reference

Type Definitions

The following type definitions are available globally.

  • A block that handles a language identification result.

    Declaration

    Objective-C

    typedef void (^MLKIdentifyLanguageCallback)(NSString *_Nullable,
                                                NSError *_Nullable)

    Parameters

    languageTag

    The identified language tag for the text, IdentifiedLanguage.undetermined if no language was identified, or nil if there was an error.

    error

    The error or nil.

  • A block that handles the result of identifying possible languages.

    Declaration

    Objective-C

    typedef void (^MLKIdentifyPossibleLanguagesCallback)(
        NSArray<MLKIdentifiedLanguage *> *_Nullable, NSError *_Nullable)

    Parameters

    identifiedLanguages

    The list of identified languages for the text, or nil in case of an error. If no languages were identified, the result will consist of a single element with the language IdentifiedLanguage.undetermined and confidence 1.

    error

    The error or nil.