目录

class info
com.huawei.hms.mlsdk.text.MLLocalTextSetting.Factory
Creates an instance of the on-device text analysis configurator to set on-device text detection attributes.

Public Method Summary

Return typeMethod name
MLLocalTextSettingcreate()
MLLocalTextSetting.FactorysetLanguage(String language)
MLLocalTextSetting.FactorysetOCRMode(int ocrMode)

Public Methods

Method
public MLLocalTextSetting create()
Creates an instance of the text analysis configurator.

Return

Typedesc
MLLocalTextSettingReturns the instance of the text analysis configurator MLLocalTextSetting.
Method
public MLLocalTextSetting.Factory setLanguage(String language)
Sets languages for the analyzer. The default setting is rm (Romance languages).

Parameters

Parameter nameParameter desc
languageLanguage codes.
Supported languages: en (English), zh (Chinese),
ja (Japanese), ko (Korean), ru (Russian), de (German),
fr (French), it (Italian), pt (Portuguese), and es (Spanish)


Return

Typedesc
MLLocalTextSetting.FactoryReturns the instance of MLLocalTextSetting.Factory.
Method
public MLLocalTextSetting.Factory setOCRMode(int ocrMode)
Sets the text detection mode. The analyzer calls an appropriate API for text detection based on the detection mode.

Parameters

Parameter nameParameter desc
ocrModeText detection mode.
1: OCR_DETECT_MODE, indicating the independent detection mode
2: OCR_TRACKING_MODE, indicating the tracking mode


Return

Typedesc
MLLocalTextSetting.FactoryMLLocalTextSetting.Factory instance.