Type Definitions
The following type definitions are available globally.
-
A block that handles a language identification result.
Declaration
Swift
typealias IdentifyLanguageCallback = (String?, Error?) -> Void
Parameters
languageTag
The identified language tag for the text,
IdentifiedLanguage.undetermined
if no language was identified, ornil
if there was an error.error
The error or
nil
. -
A block that handles the result of identifying possible languages.
Declaration
Swift
typealias IdentifyPossibleLanguagesCallback = ([MLKIdentifiedLanguage]?, Error?) -> Void
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 languageIdentifiedLanguage.undetermined
and confidence 1.error
The error or
nil
.