| class info |
| com.huawei.hms.mlsdk.text.MLTextAnalyzer.Factory |
| Creates a text analyzer instance to detect text. Only on-device detection is supported. On-cloud detection is not supported. |
| Constructor name |
Factory(android.content.Context context) Creates a text analyzer instance. |
| Return type | Method name |
| MLTextAnalyzer | create() |
| MLTextAnalyzer.Factory | setLanguage(String language) |
| MLTextAnalyzer.Factory | setLocalOCRMode(int analyseType) |
| Method |
| public Factory(android.content.Context context) |
| Creates a text analyzer instance. |
Parameters
| Parameter name | Parameter desc |
| context | Input context. |
| Method |
| public MLTextAnalyzer create() |
| Creates a text analyzer instance. |
Return
| Type | desc |
| MLTextAnalyzer | Returns the instance of the text analyzer MLTextAnalyzer. |
| Method |
| public MLTextAnalyzer.Factory setLanguage(String language) |
| Sets languages for the analyzer. The default setting is Romance languages. |
Parameters
| Parameter name | Parameter desc |
| language | Language 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
| Type | desc |
| MLTextAnalyzer.Factory | Returns the instance of MLTextAnalyzer.Factory. |
| Method |
| public MLTextAnalyzer.Factory setLocalOCRMode(int analyseType) |
| Sets the detection mode for the analyzer. The default value is OCR_DETECT_MODE (independent detection mode). |
Parameters
| Parameter name | Parameter desc |
| analyseType | Detection mode of the analyzer. OCR_DETECT_MODE: The value is 1, indicating the independent detection mode. In this mode, each supplied image is detected independently. This mode applies to single image detection. OCR_TRACKING_MODE: The value is 2, indicating the tracking mode. In this mode, the detection result of the preceding frame is used as the basis to quickly detect the text position in the image. This mode applies to video stream text detection. |
Return
| Type | desc |
| MLTextAnalyzer.Factory | Returns the instance of MLTextAnalyzer.Factory. |