SBSDKOpticalCharacterRecognizerConfiguration

@interface SBSDKOpticalCharacterRecognizerConfiguration : NSObject <NSCopying>

A class describing the configuration of the optical character recognizer.

  • The recognition mode. See SBSDKOpticalCharacterRecognitionMode. The default value is SBSDKOpticalCharacterRecognitionModeML. Readonly.

    Declaration

    Objective-C

    @property (nonatomic, readonly) SBSDKOpticalCharacterRecognitionMode recognitionMode;

    Swift

    var recognitionMode: SBSDKOpticalCharacterRecognitionMode { get }
  • An array of two-letter ISO 639-1 language code strings that are being used by the character recognizer. The machine-learning-based recognizer ignores this property. Readonly.

    Declaration

    Objective-C

    @property (nonatomic, readonly) NSArray<NSString *> *_Nonnull languages;

    Swift

    var languages: [String] { get }
  • Undocumented

    Declaration

    Objective-C

    - (instancetype)init NS_UNAVAILABLE;
  • Returns a configuration using the ML-based OCR. @returns The configuration.

    Declaration

    Objective-C

    + (nonnull SBSDKOpticalCharacterRecognizerConfiguration *)mlConfiguration;

    Swift

    class func ml() -> SBSDKOpticalCharacterRecognizerConfiguration
  • Returns a configuration using the legacy OCR.

    Declaration

    Objective-C

    + (nonnull SBSDKOpticalCharacterRecognizerConfiguration *)
        legacyConfigurationWithLanguageString:(nonnull NSString *)languageString;

    Swift

    class func legacyConfiguration(withLanguageString languageString: String) -> SBSDKOpticalCharacterRecognizerConfiguration

    Parameters

    languageString

    A string of “+”-separated two-letter ISO 639-1 language codes, e.g. “en+de”. @returns The configuration.

  • Returns a configuration using the legacy OCR.

    Declaration

    Objective-C

    + (nonnull SBSDKOpticalCharacterRecognizerConfiguration *)
        legacyConfigurationWithLanguages:(nonnull NSArray<NSString *> *)languages;

    Swift

    class func legacyConfiguration(withLanguages languages: [String]) -> SBSDKOpticalCharacterRecognizerConfiguration

    Parameters

    languages

    An array of two-letter ISO 639-1 language codes, e.g. “@[@"en”, @“de”]“. @returns The configuration.