前往主控台

FirebaseMLNLLanguageID Framework Reference

LanguageIdentification

class LanguageIdentification : NSObject

The LanguageIdentification class that identifies the main language or possible languages for the given text.

  • Unavailable.

  • Identifies the main language for the given text.

    Declaration

    Swift

    func identifyLanguage(for text: String, completion: @escaping IdentifyLanguageCallback)

    Parameters

    text

    The input text to use for identifying the language. Inputs longer than 200 characters are truncated to 200 characters, as longer input does not improve the detection accuracy.

    completion

    Handler to call back on the main queue with the identified language code or error.

  • Identifies possible languages for the given text.

    Declaration

    Swift

    func identifyPossibleLanguages(for text: String, completion: @escaping IdentifyPossibleLanguagesCallback)

    Parameters

    text

    The input text to use for identifying the language. Inputs longer than 200 characters are truncated to 200 characters, as longer input does not improve the detection accuracy.

    completion

    Handler to call back on the main queue with identified languages or error.