目录

MLDocumentSetting.Factory

Class Info

com.huawei.hms.mlsdk.document.MLDocumentSetting.Factory

Creates an instance of the document analyzer configurator to set document detection attributes.

Public Constructor Summary

Constructor Name

Factory()

Creates an instance of the document analyzer configurator.

Public Method Summary

Qualifier and Type

Method Name and Description

MLDocumentSetting

create()

Creates an instance of the document analyzer configurator.

MLDocumentSetting.Factory

enableFingerprintVerification()

Enables forcible verification of the certificate fingerprint.

MLDocumentSetting.Factory

setBorderType(String borderType)

Sets the type of a text bounding box.

MLDocumentSetting.Factory

setLanguageList(List<String> languages)

Sets the preset languages.

Public Constructors

[h2]Factory()

Constructor

public Factory()

Creates an instance of the document analyzer configurator.

Public Methods

[h2]create()

Method

public MLDocumentSetting create()

Creates an instance of the document analyzer configurator.

Return

Type

Description

MLDocumentSetting

Instance of the document analyzer configurator MLDocumentSetting.

[h2]enableFingerprintVerification()

Method

public MLDocumentSetting.Factory enableFingerprintVerification()

Sets whether to enable certificate fingerprint verification. Only registered apps that pass the verification can access the cloud API for document detection. There is no need to set this parameter during app debugging.

Return

Type

Description

MLDocumentSetting.Factory

Instance of MLDocumentSetting.Factory.

[h2]setBorderType(String borderType)

Method

public MLDocumentSetting.Factory setBorderType(String borderType)

Sets the type of a text bounding box.

Parameters

Name

Description

borderType

  • NGON: coordinates of the four vertices of a text bounding box that is a quadrilateral.
  • ARC: coordinates of up to 72 vertices of a text bounding box that is a polygon for text in a curved layout.
Return

Type

Description

MLDocumentSetting.Factory

Instance of MLDocumentSetting.Factory.

[h2]setLanguageList(List<String> languages)

Method

public MLDocumentSetting.Factory setLanguageList(List<String> languages)

Sets the preset languages. Correct language setting ensures fast and accurate detection. Do not set this parameter if languages are not determined. The service will automatically identify the languages. The analyzer currently supports 19 languages: Chinese, Japanese, Korean, English, French, German, Russian, Italian, Portuguese, Spanish, Polish, Norwegian, Swedish, Danish, Turkish, Finnish, Thai, Arabic, and Hindi.

Parameters

Name

Description

languages

A list of languages.

Language codes: en (English), zh (Chinese), ja (Japanese), ko (Korean), ru (Russian), de (German), fr (French), it (Italian), pt (Portuguese), es (Spanish), pl (Polish), no (Norwegian), sv (Swedish), da (Danish), tr (Turkish), fi (Finnish), th (Thai), ar (Arabic), and hi (Hindi)

Return

Type

Description

MLDocumentSetting.Factory

Instance of MLDocumentSetting.Factory.